{"_id":"@a11yst/source-mapping-react","_rev":"3-c8a1f35878820ca5732256a6766ffc45","name":"@a11yst/source-mapping-react","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@a11yst/source-mapping-react","version":"1.0.0","license":"MPL-2.0","_id":"@a11yst/source-mapping-react@1.0.0","maintainers":[{"name":"angelabenavente","email":"ang.ben.dev@gmail.com"}],"homepage":"https://github.com/angelabenavente/a11yst#readme","bugs":{"url":"https://github.com/angelabenavente/a11yst/issues"},"dist":{"shasum":"92268dfa8c35c5846b5c4a63385ff403b87b33a7","tarball":"https://registry.npmjs.org/@a11yst/source-mapping-react/-/source-mapping-react-1.0.0.tgz","fileCount":47,"integrity":"sha512-20P/5dcbBFLF/sYnmXJq9o2qjZhJWbWPfFRgtiFBMmRhLHJ7tAn7OzxNksHYyKCrmWnvFXzl+iwT7LYo9s3Qbg==","signatures":[{"sig":"MEYCIQCJClHeUkjFo8Slw8kbNfXhRjz1ujRzNxS89EZR0hqlngIhANex16Fe1D4z6eaeORsAEgy55/VRaK3IlHla8CT+8Bw4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":151195},"main":"./dist/index.js","type":"module","_from":"file:a11yst-source-mapping-react-1.0.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"angelabenavente","email":"ang.ben.dev@gmail.com"},"_resolved":"/private/var/folders/tf/l5jz90dj0yncc_ds04tbfs5c0000gn/T/d0d2eabd9d794e3d15d277461a7162f7/a11yst-source-mapping-react-1.0.0.tgz","_integrity":"sha512-20P/5dcbBFLF/sYnmXJq9o2qjZhJWbWPfFRgtiFBMmRhLHJ7tAn7OzxNksHYyKCrmWnvFXzl+iwT7LYo9s3Qbg==","repository":{"url":"git+https://github.com/angelabenavente/a11yst.git","type":"git"},"_npmVersion":"10.9.0","description":"Conservative React/JSX static source catalog and mapping for a11yst","directories":{},"_nodeVersion":"22.12.0","dependencies":{"css-what":"^6.1.0","@babel/types":"^7.26.3","@a11yst/types":"1.0.0","@babel/parser":"^7.26.3","@a11yst/source-index":"1.0.0","@a11yst/source-mapping":"1.0.0","@a11yst/source-mapping-html":"1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/source-mapping-react_1.0.0_1787506259169_0.3844779247552179","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@a11yst/source-mapping-react","version":"1.0.1","license":"MPL-2.0","_id":"@a11yst/source-mapping-react@1.0.1","maintainers":[{"name":"angelabenavente","email":"ang.ben.dev@gmail.com"}],"homepage":"https://github.com/angelabenavente/a11yst#readme","bugs":{"url":"https://github.com/angelabenavente/a11yst/issues"},"dist":{"shasum":"b26ec47eb180e934d66db1faf3176f5a65611c4b","tarball":"https://registry.npmjs.org/@a11yst/source-mapping-react/-/source-mapping-react-1.0.1.tgz","fileCount":47,"integrity":"sha512-otpGXXRPWlELlUvncfqvHtmnNqQd70V02HQFBytuo6mvNFsS7D9ycw8hYIV7CLdmRiMwbJd2wWICySpxP2pSAw==","signatures":[{"sig":"MEUCIFGrhpubbPBM24juZ5PN4BAmS6XhjYXwM8FiZvqJMHN9AiEAz2DW9LhvUnpkHyultKDqXIMtCO3wAoW5efgXBi2fGM0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":151195},"main":"./dist/index.js","type":"module","_from":"file:a11yst-source-mapping-react-1.0.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"angelabenavente","email":"ang.ben.dev@gmail.com"},"_resolved":"/private/var/folders/tf/l5jz90dj0yncc_ds04tbfs5c0000gn/T/6bbaf50c43a8eed91bb761154fa81fbd/a11yst-source-mapping-react-1.0.1.tgz","_integrity":"sha512-otpGXXRPWlELlUvncfqvHtmnNqQd70V02HQFBytuo6mvNFsS7D9ycw8hYIV7CLdmRiMwbJd2wWICySpxP2pSAw==","repository":{"url":"git+https://github.com/angelabenavente/a11yst.git","type":"git"},"_npmVersion":"10.9.8","description":"Conservative React/JSX static source catalog and mapping for a11yst","directories":{},"_nodeVersion":"22.23.1","dependencies":{"css-what":"^6.1.0","@babel/types":"^7.26.3","@a11yst/types":"1.0.1","@babel/parser":"^7.26.3","@a11yst/source-index":"1.0.1","@a11yst/source-mapping":"1.0.1","@a11yst/source-mapping-html":"1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/source-mapping-react_1.0.1_1787508685701_0.14402320909260236","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@a11yst/source-mapping-react","version":"1.0.2","description":"Conservative React/JSX static source catalog and mapping for a11yst","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"main":"./dist/index.js","types":"./dist/index.d.ts","dependencies":{"@babel/parser":"^7.26.3","@babel/types":"^7.26.3","css-what":"^6.1.0","@a11yst/source-index":"1.0.2","@a11yst/source-mapping":"1.0.2","@a11yst/source-mapping-html":"1.0.2","@a11yst/types":"1.0.2"},"devDependencies":{"@types/node":"^22.10.2","typescript":"^5.7.2"},"license":"MPL-2.0","repository":{"type":"git","url":"git+https://github.com/angelabenavente/a11yst.git"},"homepage":"https://www.a11yst.dev","bugs":{"url":"https://github.com/angelabenavente/a11yst/issues"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","clean":"rm -rf dist *.tsbuildinfo"},"_id":"@a11yst/source-mapping-react@1.0.2","_integrity":"sha512-ViiM1LcRUX2/FiB2LFsxhnNdYc5Au0Od1zzg3AuVWX6m55Hf/qR/Rnsu4gEKOAqxR5PSWsscdD1PzLkhyHeOcA==","_resolved":"/private/var/folders/tf/l5jz90dj0yncc_ds04tbfs5c0000gn/T/f652fd3b1e91d792e3d6c4d33bb1d82f/a11yst-source-mapping-react-1.0.2.tgz","_from":"file:a11yst-source-mapping-react-1.0.2.tgz","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-ViiM1LcRUX2/FiB2LFsxhnNdYc5Au0Od1zzg3AuVWX6m55Hf/qR/Rnsu4gEKOAqxR5PSWsscdD1PzLkhyHeOcA==","shasum":"b07f3459de8e5a4982dc2ed7f7df946f48a5209c","tarball":"https://registry.npmjs.org/@a11yst/source-mapping-react/-/source-mapping-react-1.0.2.tgz","fileCount":47,"unpackedSize":151567,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDExqR8X/vnSVCtfSchA8NVDQuaCc81h0lAR2EoOHO1VAIgOA1/O+1XJocHxlYIHIeeVdePVhvAKb8e+AQ6woO06vQ="}]},"_npmUser":{"name":"angelabenavente","email":"ang.ben.dev@gmail.com"},"directories":{},"maintainers":[{"name":"angelabenavente","email":"ang.ben.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/source-mapping-react_1.0.2_1787683124884_0.40769689869720627"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T17:30:58.977Z","modified":"2026-08-25T18:38:45.274Z","1.0.0":"2026-08-23T17:30:59.319Z","1.0.1":"2026-08-23T18:11:25.850Z","1.0.2":"2026-08-25T18:38:45.102Z"},"bugs":{"url":"https://github.com/angelabenavente/a11yst/issues"},"license":"MPL-2.0","homepage":"https://www.a11yst.dev","repository":{"type":"git","url":"git+https://github.com/angelabenavente/a11yst.git"},"description":"Conservative React/JSX static source catalog and mapping for a11yst","maintainers":[{"name":"angelabenavente","email":"ang.ben.dev@gmail.com"}],"readme":"# @a11yst/source-mapping-react [![NPM version](https://img.shields.io/npm/v/@a11yst/source-mapping-react.svg?style=flat)](https://www.npmjs.com/package/@a11yst/source-mapping-react) [![License: MPL-2.0](https://img.shields.io/badge/License-MPL--2.0-blue.svg)](LICENSE) [![NPM total downloads](https://img.shields.io/npm/dt/@a11yst/source-mapping-react.svg?style=flat)](https://www.npmjs.com/package/@a11yst/source-mapping-react)\n\nConservative static catalog and source mapping for JSX and React components in a11yst Phase 10d.\n\n## Scope\n\nThis package reads JSX, TSX, and JavaScript files that contain parseable JSX from `@a11yst/source-index`. It parses source with `@babel/parser`, builds a static element catalog, and maps DOM evidence to JSX opening-element locations through `@a11yst/source-mapping`.\n\nSupported:\n\n- Intrinsic JSX elements such as `<button />` and `<input />`\n- Custom component usages such as `<CheckoutButton />` and `<UI.Button />`\n- Static props, class names, text, and accessible-name hints\n- Conservative selector, id, attribute, component-name, owner, and text matching\n\nNot supported in 10d:\n\n- Next.js App Router or Pages Router semantics\n- React Server Components as special semantics\n- Source maps, bundles, or runtime component stacks\n- Import resolution between files\n- Variable evaluation, hooks, or code execution\n- `React.createElement`\n- Styled Components, Emotion, CSS Modules, or Tailwind resolution\n- Audit, SARIF, report, or recommendation integration\n\nPhase 10e adds Next.js routing. Phase 10h adds ranking. Phase 10i adds recommendations.\n\n## Source index dependency\n\nThe catalog consumes indexed files only. It does not traverse the repository, use globs, or discover files outside the source index.\n\nAccepted index kinds:\n\n- `jsx`\n- `tsx`\n- `javascript` when JSX is present\n\nIgnored kinds include `html`, `typescript`, `vue`, `svelte`, `astro`, and `angular-template`.\n\n## Parser\n\nParsing uses `@babel/parser` with locations enabled. Columns are converted from Babel's 0-based columns to a11yst's 1-based contract.\n\n- `.jsx`, `.js`, `.mjs`, `.cjs`: `jsx`\n- `.tsx`: `typescript`, `jsx`\n\n## Catalog model\n\nEach catalog entry represents a JSX opening element:\n\n- Intrinsic elements keep lowercase `tagName`\n- Component usages keep normalized `componentName`, including member expressions such as `UI.Button`\n- `ownerComponent` is the nearest statically identifiable PascalCase container\n- `staticProps` stores allowlisted literal props only\n- `dynamicPropNames` records unevaluated props\n- `hasSpreadProps` and `spreadBeforeStaticProps` record spread uncertainty\n- `staticVisibleText` and `staticAccessibleName` are conservative hints only\n\nFragments and `React.Fragment` are ignored because they do not represent DOM nodes.\n\nComponent usages represent JSX usage sites, not component definitions, and are not followed across files.\n\n## Mapping behavior\n\n`mapReactSource()` delegates final selection to `createSourceMappingResult()` from `@a11yst/source-mapping`.\n\nConservative rules:\n\n- Valid `existingSourceLocation` maps to `exact` immediately\n- Unique intrinsic selector match maps to `high` with `selector-match`, never `exact`\n- Duplicate matches produce `ambiguous` with no selected candidate\n- Unique component name alone maps to `medium`\n- Component name plus stable prop can map to `high`\n- `ownerComponent` filters candidates but never creates a candidate by itself\n- `route` is retained as contextual signal only in 10d\n\nThe package never selects the first match, shortest path, or highest confidence when multiple distinct candidates remain.\n\n## Security\n\nThe catalog and mapping output never store:\n\n- Source code, AST nodes, expressions, imports, or comments\n- Passwords, tokens, cookies, authorization values, or form values\n- Event handlers or `dangerouslySetInnerHTML`\n- Absolute paths, stack traces, or parser fragments\n\nFilesystem access is confined to the explicit repository root. Symlinks are not followed.\n\n## Limits\n\nDefault limits:\n\n- `maxFiles`: 5000\n- `maxElementsPerFile`: 50000\n- `maxPropsPerElement`: 128\n- `maxTextLength`: 256\n\nInvalid limits produce an invalid catalog.\n\n## Public API\n\n- `createReactSourceCatalog()`\n- `mapReactSource()`\n- `stableSerializeReactCatalog()`\n\nDiagnostics use React-specific codes such as `react-parse-failed`, `react-spread-props`, and `react-source-ambiguous`.\n","readmeFilename":"README.md"}