@trackunit/react-components 8.0.3 → 8.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@trackunit/react-router-components",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=24.x"
8
8
  },
9
9
  "dependencies": {
10
- "@trackunit/css-class-variance-utilities": "^2.6.60",
11
- "@trackunit/i18n-library-translation": "^2.14.57",
12
- "@trackunit/react-components": "^8.0.3",
13
- "@trackunit/react-drawer": "^3.0.14",
14
- "@trackunit/shared-utils": "^1.22.60",
10
+ "@trackunit/css-class-variance-utilities": "^2.6.61",
11
+ "@trackunit/i18n-library-translation": "^2.14.58",
12
+ "@trackunit/react-components": "^8.0.5",
13
+ "@trackunit/react-drawer": "^3.0.16",
14
+ "@trackunit/shared-utils": "^1.22.61",
15
15
  "dequal": "^2.0.3",
16
16
  "zod": "^3.25.76"
17
17
  },
@@ -561,7 +561,7 @@ const migrateCollapseUsages = (state, filePath, content) => {
561
561
  return file.needsSyntheticEventImport ? updateReactImport(edited, filePath) : edited;
562
562
  };
563
563
  /**
564
- * Migrates consumers to the 7.0.0 `Collapse`, rebuilt on native `<details>`/`<summary>`:
564
+ * Migrates consumers to the 8.0.0 `Collapse`, rebuilt on native `<details>`/`<summary>`:
565
565
  *
566
566
  * - Retypes `onToggle` handlers declared as `(event: MouseEvent<HTMLDivElement>, …)`, inline or in the same file,
567
567
  * to `SyntheticEvent<HTMLElement>` and updates the `react` import.
@@ -1 +1 @@
1
- {"version":3,"file":"collapse-native-details.js","sourceRoot":"","sources":["../../../../../../libs/react/components/migrations/v7-0-0/collapse-native-details.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAqE;AACrE,2CAA6B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MAAM,qBAAqB,GAAG,CAAC,IAAU,EAAQ,EAAE;IACxD,MAAM,KAAK,GAAa,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAEzE,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,IAAI,EAAE,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CACtE,qBAAqB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAChD,CAAC;IAEF,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAE5B,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,YAAY;QAAE,eAAM,CAAC,IAAI,CAAC,KAAK,cAAc,KAAK,OAAO,EAAE,CAAC,CAAC;IACzF,IAAA,sBAAU,EAAC,cAAc,EAAE,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC;AAXW,QAAA,qBAAqB,yBAWhC;AAEF,kBAAe,6BAAqB,CAAC","sourcesContent":["import { logger, type Tree, visitNotIgnoredFiles } from \"@nx/devkit\";\nimport * as path from \"path\";\nimport * as ts from \"typescript\";\nimport {\n findJsxAttribute,\n findJsxElements,\n getImportedAliases,\n hasSpreadAttribute,\n isWorkspaceSourceFile,\n logSummary,\n parseTsx,\n visitTsxFiles,\n} from \"../utils/jsx-utils\";\n\nconst MIGRATION_NAME = \"collapse-native-details\";\nconst PACKAGE_NAME = \"@trackunit/react-components\";\nconst COMPONENT_NAME = \"Collapse\";\nconst NEW_EVENT_TYPE = \"SyntheticEvent<HTMLElement>\";\nconst LAZY_PROP = \"lazy\";\n\n/** Extensions tried when resolving a relative import to a file. */\nconst MODULE_EXTENSIONS = [\".ts\", \".tsx\", \".jsx\"] as const;\nconst TEST_FILE_PATTERN = /\\.(spec|test)\\.[jt]sx?$/;\n/** Attributes the old header had. Other components have them too, so they only count next to a header query. */\nconst OLD_HEADER_ATTRIBUTE_PATTERN = /aria-expanded|aria-controls/;\n/** A variable assigned on a line, as in `const header = screen.getByRole(…)`: group 1 is its name. */\nconst HEADER_VARIABLE_PATTERN = /(?:const|let|var)\\s+([A-Za-z_][\\w]*)\\s*=/;\n/** Any button query by role, used to count the specs whose header queries can't be identified statically. */\nconst BUTTON_ROLE_QUERY_PATTERN = /ByRole\\(\\s*[\"'`]button[\"'`]/;\n/** A button query with a string or regex `name`, which may span lines: group 1 is the name literal. */\nconst NAMED_BUTTON_QUERY_PATTERN =\n /ByRole\\(\\s*[\"'`]button[\"'`]\\s*,\\s*\\{\\s*name:\\s*(\\/(?:\\\\.|[^/\\\\\\n])+\\/[a-z]*|\"[^\"\\n]*\"|'[^'\\n]*'|`[^`$\\n]*`)/g;\n/** A nameless button query scoped to a test id, e.g. `within(screen.getByTestId(\"x\")).getByRole(\"button\")`: group 1 is the id. */\nconst SCOPED_BUTTON_QUERY_PATTERN =\n /within\\(\\s*(?:screen\\.)?(?:get|query|find)ByTestId\\(\\s*[\"'`]([^\"'`]+)[\"'`]\\s*\\)\\s*\\)\\.(?:get|query|find)(?:All)?ByRole\\(\\s*[\"'`]button[\"'`]\\s*\\)/g;\n/** Elements that are interactive themselves, so nesting them in the `<summary>` header is `nested-interactive`. */\nconst INTERACTIVE_ELEMENTS: ReadonlySet<string> = new Set([\n \"a\",\n \"button\",\n \"input\",\n \"select\",\n \"textarea\",\n \"Button\",\n \"IconButton\",\n \"ToggleGroup\",\n \"Link\",\n \"ExternalLink\",\n \"Checkbox\",\n \"Toggle\",\n \"RadioGroup\",\n \"Select\",\n \"TextField\",\n \"MoreMenu\",\n]);\nconst RELATIVE_IMPORT_PATTERN = /(?:from\\s+|import\\s*\\(\\s*|require\\s*\\(\\s*)[\"'](\\.{1,2}\\/[^\"']+)[\"']/g;\n\ntype Edit = { start: number; end: number; text: string };\n\ntype FunctionLike = ts.ArrowFunction | ts.FunctionExpression | ts.FunctionDeclaration;\n\ntype ReactImports = {\n /** Local names of named imports from \"react\", mapped to the imported name. */\n named: Map<string, string>;\n /** Local names of default and namespace imports of \"react\" (e.g. `React`). */\n namespaces: Set<string>;\n};\n\n/** What the Collapses in one file give test queries to match on. */\ntype CollapseFacts = {\n /** Static `label`s: string literals and the key of a `t(\"key\")` call. */\n labels: Set<string>;\n /** Static `data-testid`s. */\n testIds: Set<string>;\n};\n\ntype RunState = {\n tree: Tree;\n /** Every file that renders a Collapse, by path. */\n collapses: Map<string, CollapseFacts>;\n manualReview: Array<string>;\n};\n\n/** One file being migrated: its parsed source, the edits collected for it and the run's review list. */\ntype FileContext = {\n filePath: string;\n sourceFile: ts.SourceFile;\n edits: Array<Edit>;\n /** Set when a handler is retyped to the bare `SyntheticEvent`, which the file then has to import. */\n needsSyntheticEventImport: boolean;\n manualReview: Array<string>;\n};\n\nconst location = (file: FileContext, node: ts.Node): string =>\n `${file.filePath}:${file.sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}`;\n\nconst addEdit = (file: FileContext, edit: Edit): void => {\n // The same handler can be reached through several Collapses; record each edit once.\n if (!file.edits.some(existing => existing.start === edit.start && existing.end === edit.end)) {\n file.edits.push(edit);\n }\n};\n\nconst applyEdits = (content: string, edits: ReadonlyArray<Edit>): string =>\n [...edits]\n .sort((a, b) => b.start - a.start)\n .reduce((updated, { start, end, text }) => `${updated.slice(0, start)}${text}${updated.slice(end)}`, content);\n\nconst getReactImports = (sourceFile: ts.SourceFile): ReactImports => {\n const named = new Map<string, string>();\n const namespaces = new Set<string>();\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt) || !ts.isStringLiteral(stmt.moduleSpecifier)) continue;\n if (stmt.moduleSpecifier.text !== \"react\") continue;\n const clause = stmt.importClause;\n if (clause === undefined) continue;\n if (clause.name !== undefined) namespaces.add(clause.name.text);\n const bindings = clause.namedBindings;\n if (bindings === undefined) continue;\n if (ts.isNamespaceImport(bindings)) {\n namespaces.add(bindings.name.text);\n } else {\n for (const element of bindings.elements) {\n named.set(element.name.text, element.propertyName?.text ?? element.name.text);\n }\n }\n }\n return { named, namespaces };\n};\n\ntype LocalDeclaration = ts.VariableDeclaration | ts.FunctionDeclaration;\n\nconst bindsName = (name: ts.BindingName, identifier: string): boolean =>\n ts.isIdentifier(name)\n ? name.text === identifier\n : name.elements.some(element => !ts.isOmittedExpression(element) && bindsName(element.name, identifier));\n\n/** The statements a scope node holds directly, or none when the node isn't a scope with statements. */\nconst statementsOf = (node: ts.Node): ReadonlyArray<ts.Statement> =>\n ts.isBlock(node) ||\n ts.isSourceFile(node) ||\n ts.isModuleBlock(node) ||\n ts.isCaseClause(node) ||\n ts.isDefaultClause(node)\n ? node.statements\n : [];\n\n/**\n * Finds the declaration an identifier refers to, walking out through the scopes that enclose `from`, so two\n * components in one file that each declare `handleToggle` resolve to their own.\n *\n * Returns `null` when the name is a parameter, a destructured binding or an import, or isn't declared in this file.\n */\nconst resolveLocalDeclaration = (from: ts.Node, identifier: string): LocalDeclaration | null => {\n // `from` is inside a source file, and the source file is the outermost scope.\n for (let scope = from.parent; ; scope = scope.parent) {\n if (ts.isFunctionLike(scope) && scope.parameters.some(parameter => bindsName(parameter.name, identifier))) {\n return null;\n }\n for (const statement of statementsOf(scope)) {\n if (ts.isFunctionDeclaration(statement) && statement.name?.text === identifier) return statement;\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (!bindsName(declaration.name, identifier)) continue;\n return ts.isIdentifier(declaration.name) ? declaration : null;\n }\n }\n if (ts.isSourceFile(scope)) return null;\n }\n};\n\n/** Unwraps parentheses and `useCallback(fn, deps)` to reach the function itself. */\nconst unwrapFunction = (expression: ts.Expression): FunctionLike | null => {\n if (ts.isParenthesizedExpression(expression)) return unwrapFunction(expression.expression);\n if (ts.isArrowFunction(expression) || ts.isFunctionExpression(expression)) return expression;\n if (ts.isCallExpression(expression)) {\n const callee = expression.expression;\n const calleeName = ts.isIdentifier(callee)\n ? callee.text\n : ts.isPropertyAccessExpression(callee)\n ? callee.name.text\n : null;\n const firstArgument = expression.arguments[0];\n if (calleeName === \"useCallback\" && firstArgument !== undefined) return unwrapFunction(firstArgument);\n }\n return null;\n};\n\nconst jsxExpressionOf = (attribute: ts.JsxAttribute): ts.Expression | null => {\n const initializer = attribute.initializer;\n if (initializer === undefined || !ts.isJsxExpression(initializer)) return null;\n return initializer.expression ?? null;\n};\n\n/** Resolves a relative import specifier to a file that exists in the tree. */\nconst resolveRelativeModule = (tree: Tree, fromFile: string, specifier: string): string | null => {\n const base = path.posix.normalize(path.posix.join(path.posix.dirname(fromFile), specifier));\n const candidates = [\n base,\n ...MODULE_EXTENSIONS.map(ext => `${base}${ext}`),\n ...MODULE_EXTENSIONS.map(ext => `${base}/index${ext}`),\n ];\n return candidates.find(candidate => tree.exists(candidate) && tree.isFile(candidate)) ?? null;\n};\n\n/* -------------------------------------------------------------------------- */\n/* onToggle: MouseEvent<HTMLDivElement> -> SyntheticEvent<HTMLElement> */\n/* -------------------------------------------------------------------------- */\n\n/** Returns the replacement text when `type` is React's MouseEvent, or `null` when it isn't. */\nconst syntheticEventReplacement = (type: ts.TypeNode, reactImports: ReactImports): string | null => {\n if (!ts.isTypeReferenceNode(type)) return null;\n const typeName = type.typeName;\n if (ts.isIdentifier(typeName)) {\n return reactImports.named.get(typeName.text) === \"MouseEvent\" ? NEW_EVENT_TYPE : null;\n }\n if (ts.isIdentifier(typeName.left) && reactImports.namespaces.has(typeName.left.text)) {\n return typeName.right.text === \"MouseEvent\" ? `${typeName.left.text}.${NEW_EVENT_TYPE}` : null;\n }\n return null;\n};\n\nconst retypeOnToggle = (file: FileContext, attribute: ts.JsxAttribute, reactImports: ReactImports): void => {\n const expression = jsxExpressionOf(attribute);\n if (expression === null) return;\n const flagForReview = (): void => {\n file.manualReview.push(\n `${location(file, attribute)}: check the onToggle handler's event parameter; its type is now SyntheticEvent<HTMLElement> (was MouseEvent<HTMLDivElement>).`\n );\n };\n\n const declaration = ts.isIdentifier(expression) ? resolveLocalDeclaration(attribute, expression.text) : null;\n const handler = !ts.isIdentifier(expression)\n ? unwrapFunction(expression)\n : declaration === null\n ? null\n : ts.isFunctionDeclaration(declaration)\n ? declaration\n : declaration.initializer !== undefined\n ? unwrapFunction(declaration.initializer)\n : null;\n if (handler === null) {\n flagForReview();\n return;\n }\n\n // The event type is on the handler's first parameter, or on the variable's own function type:\n // `const onToggle: (event: MouseEvent<HTMLDivElement>, expanded: boolean) => void = (event, expanded) => …`.\n const annotation = declaration !== null && ts.isVariableDeclaration(declaration) ? declaration.type : undefined;\n const eventType =\n handler.parameters[0]?.type ??\n (annotation !== undefined && ts.isFunctionTypeNode(annotation) ? annotation.parameters[0]?.type : undefined);\n if (eventType === undefined) {\n // Typed some other way, such as a type alias. Untyped handlers need nothing.\n if (annotation?.getText().includes(\"MouseEvent\") === true) flagForReview();\n return;\n }\n const replacement = syntheticEventReplacement(eventType, reactImports);\n if (replacement === null) {\n // A MouseEvent this migration can't tie to React, such as one behind an alias.\n if (eventType.getText().includes(\"MouseEvent\")) flagForReview();\n return;\n }\n\n addEdit(file, { start: eventType.getStart(), end: eventType.getEnd(), text: replacement });\n if (!replacement.includes(\".\")) file.needsSyntheticEventImport = true;\n};\n\n/** Adds `SyntheticEvent` to the react import and drops `MouseEvent` when nothing else uses it. */\nconst updateReactImport = (content: string, filePath: string): string => {\n const sourceFile = parseTsx(content, filePath);\n const reactImports = getReactImports(sourceFile);\n\n const mouseEventLocal = [...reactImports.named.entries()].find(([, imported]) => imported === \"MouseEvent\")?.[0];\n let mouseEventStillUsed = false;\n if (mouseEventLocal !== undefined) {\n const visit = (node: ts.Node): void => {\n if (mouseEventStillUsed || ts.isImportDeclaration(node)) return;\n if (ts.isIdentifier(node) && node.text === mouseEventLocal) {\n mouseEventStillUsed = true;\n return;\n }\n ts.forEachChild(node, visit);\n };\n visit(sourceFile);\n }\n const hasSyntheticEvent = [...reactImports.named.values()].includes(\"SyntheticEvent\");\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt) || !ts.isStringLiteral(stmt.moduleSpecifier)) continue;\n if (stmt.moduleSpecifier.text !== \"react\") continue;\n const bindings = stmt.importClause?.namedBindings;\n if (bindings === undefined || !ts.isNamedImports(bindings)) continue;\n\n const kept = bindings.elements\n .filter(element => mouseEventStillUsed || (element.propertyName?.text ?? element.name.text) !== \"MouseEvent\")\n .map(element => element.getText());\n const isSorted = kept.every((name, index) => index === 0 || (kept[index - 1] ?? \"\").localeCompare(name) <= 0);\n const withSyntheticEvent = hasSyntheticEvent ? kept : [...kept, \"SyntheticEvent\"];\n const merged = isSorted ? [...withSyntheticEvent].sort((a, b) => a.localeCompare(b)) : withSyntheticEvent;\n return `${content.slice(0, bindings.getStart())}{ ${merged.join(\", \")} }${content.slice(bindings.getEnd())}`;\n }\n\n return hasSyntheticEvent ? content : `import { SyntheticEvent } from \"react\";\\n${content}`;\n};\n\nconst containsJsx = (node: ts.Node): boolean =>\n ts.isJsxElement(node) ||\n ts.isJsxSelfClosingElement(node) ||\n ts.isJsxFragment(node) ||\n ts.forEachChild(node, containsJsx) === true;\n\n/** `null`, `undefined`, booleans, strings and numbers render nothing interactive. */\nconst isEmptyOrTextLiteral = (expression: ts.Expression): boolean =>\n ts.isParenthesizedExpression(expression)\n ? isEmptyOrTextLiteral(expression.expression)\n : expression.kind === ts.SyntaxKind.NullKeyword ||\n expression.kind === ts.SyntaxKind.TrueKeyword ||\n expression.kind === ts.SyntaxKind.FalseKeyword ||\n (ts.isIdentifier(expression) && expression.text === \"undefined\") ||\n ts.isStringLiteralLike(expression) ||\n ts.isNumericLiteral(expression);\n\n/**\n * Interactive controls in the addon are `nested-interactive` inside a native `<summary>`.\n * They are logged, not moved: the controls belong in the content, and where they go there is a layout decision.\n */\nconst flagInteractiveAddon = (file: FileContext, attribute: ts.JsxAttribute): void => {\n const expression = jsxExpressionOf(attribute);\n if (expression === null) return;\n const flagOpaque = (): void => {\n const source = expression.getText();\n file.manualReview.push(\n `${location(file, attribute)}: headerAddon is \\`${source.length > 60 ? `${source.slice(0, 57)}...` : source}\\`, which this migration can't look into (it comes from a prop, an import or a call). If it can render interactive controls such as a Button or ToggleGroup, move those into the content (e.g. a toolbar row at the top): the header is now a native <summary>, and controls nested in it are reported by axe as nested-interactive.`\n );\n };\n\n if (isEmptyOrTextLiteral(expression)) return;\n\n const declaration = ts.isIdentifier(expression) ? resolveLocalDeclaration(attribute, expression.text) : null;\n const addonRoot = !ts.isIdentifier(expression)\n ? expression\n : declaration !== null && ts.isVariableDeclaration(declaration)\n ? (declaration.initializer ?? null)\n : null;\n if (addonRoot === null) {\n flagOpaque();\n return;\n }\n\n const found = new Set<string>();\n const visit = (node: ts.Node): void => {\n if (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) {\n const tagName = node.tagName.getText();\n if (INTERACTIVE_ELEMENTS.has(tagName)) found.add(tagName);\n }\n ts.forEachChild(node, visit);\n };\n visit(addonRoot);\n if (found.size === 0) {\n if (!containsJsx(addonRoot) && !isEmptyOrTextLiteral(addonRoot)) flagOpaque();\n return;\n }\n\n file.manualReview.push(\n `${location(file, attribute)}: headerAddon contains interactive controls (${[...found].join(\", \")}). The header is now a native <summary>, which is interactive itself, so axe reports nested-interactive and screen readers may not announce these controls. Clicks on them still don't toggle the section, but move them into the content (e.g. a toolbar row at the top), and keep only non-interactive items such as status icons or badges in headerAddon.`\n );\n};\n\n/* -------------------------------------------------------------------------- */\n/* animate={false} -> animate={false} lazy */\n/* -------------------------------------------------------------------------- */\n\n/** The `lazy` attribute that keeps the old rendering of this `animate` value, or `null` when it is always true. */\nconst lazyAttributeFor = (animate: ts.JsxAttribute): string | null => {\n // The `animate` shorthand means `animate={true}`.\n if (animate.initializer === undefined) return null;\n const expression = jsxExpressionOf(animate);\n if (expression === null || expression.kind === ts.SyntaxKind.TrueKeyword) return null;\n if (expression.kind === ts.SyntaxKind.FalseKeyword) return LAZY_PROP;\n const text = expression.getText();\n const isSimple = ts.isIdentifier(expression) || ts.isPropertyAccessExpression(expression);\n return `${LAZY_PROP}={!${isSimple ? text : `(${text})`}}`;\n};\n\n/**\n * `animate={false}` used to also mean \"render children only while open\". That is now the separate `lazy` prop,\n * so it is added wherever `animate` is, or can be, false. It goes in alphabetical position when the attributes\n * are sorted, and right after `animate` otherwise.\n */\nconst keepLazyRendering = (\n file: FileContext,\n openingElement: ts.JsxOpeningElement | ts.JsxSelfClosingElement,\n animate: ts.JsxAttribute\n): void => {\n const lazyAttribute = lazyAttributeFor(animate);\n if (lazyAttribute === null) return;\n\n const named: Array<{ attribute: ts.JsxAttribute; name: string }> = [];\n for (const attribute of openingElement.attributes.properties) {\n if (ts.isJsxAttribute(attribute) && ts.isIdentifier(attribute.name)) {\n named.push({ attribute, name: attribute.name.text.toLowerCase() });\n }\n }\n const isSorted =\n named.length === openingElement.attributes.properties.length &&\n named.every(({ name }, index) => index === 0 || (named[index - 1]?.name ?? \"\") <= name);\n const anchor = isSorted ? (named.filter(({ name }) => name < LAZY_PROP).at(-1)?.attribute ?? animate) : animate;\n\n const leadingTrivia = file.sourceFile.text.slice(anchor.getFullStart(), anchor.getStart());\n const separator = /^\\s+$/.test(leadingTrivia) ? leadingTrivia : \" \";\n addEdit(file, { start: anchor.getEnd(), end: anchor.getEnd(), text: `${separator}${lazyAttribute}` });\n};\n\n/* -------------------------------------------------------------------------- */\n/* Manual review: tests that query the old header */\n/* -------------------------------------------------------------------------- */\n\n/** What a test file can render: its Collapse files' static labels and test ids, found through relative imports. */\ntype ReachedCollapses = { files: number; labels: Set<string>; testIds: Set<string> };\n\nconst reachedCollapses = (\n state: RunState,\n dependenciesOf: (filePath: string) => ReadonlyArray<string>,\n testFile: string\n): ReachedCollapses => {\n const reached: ReachedCollapses = { files: 0, labels: new Set(), testIds: new Set() };\n const visited = new Set<string>([testFile]);\n const queue = [testFile];\n for (let next = queue.shift(); next !== undefined; next = queue.shift()) {\n const facts = state.collapses.get(next);\n if (facts !== undefined) {\n reached.files++;\n for (const label of facts.labels) reached.labels.add(label);\n for (const testId of facts.testIds) reached.testIds.add(testId);\n }\n for (const dependency of dependenciesOf(next)) {\n if (visited.has(dependency)) continue;\n visited.add(dependency);\n queue.push(dependency);\n }\n }\n return reached;\n};\n\nconst flagOldHeaderQueries = (state: RunState): void => {\n // Nothing renders a Collapse, so no test can target its header.\n if (state.collapses.size === 0) return;\n\n const testFiles: Array<string> = [];\n visitNotIgnoredFiles(state.tree, \"/\", filePath => {\n if (isWorkspaceSourceFile(filePath) && TEST_FILE_PATTERN.test(filePath)) testFiles.push(filePath);\n });\n\n // The import graph is followed outward from the test files, so only files a test can reach are read.\n const dependencies = new Map<string, ReadonlyArray<string>>();\n const dependenciesOf = (filePath: string): ReadonlyArray<string> => {\n const known = dependencies.get(filePath);\n if (known !== undefined) return known;\n const resolved = new Set<string>();\n for (const match of (state.tree.read(filePath, \"utf-8\") ?? \"\").matchAll(RELATIVE_IMPORT_PATTERN)) {\n const specifier = match[1];\n const target = specifier === undefined ? null : resolveRelativeModule(state.tree, filePath, specifier);\n if (target !== null) resolved.add(target);\n }\n const result = [...resolved];\n dependencies.set(filePath, result);\n return result;\n };\n\n let unidentifiedFiles = 0;\n for (const testFile of testFiles) {\n const reached = reachedCollapses(state, dependenciesOf, testFile);\n if (reached.files === 0) continue;\n const content = state.tree.read(testFile, \"utf-8\") ?? \"\";\n const lines = headerQueryLines(reached, content);\n if (lines.length === 0) {\n if (BUTTON_ROLE_QUERY_PATTERN.test(content) || OLD_HEADER_ATTRIBUTE_PATTERN.test(content)) unidentifiedFiles++;\n continue;\n }\n state.manualReview.push(\n `${testFile} (${lines.length === 1 ? \"line\" : \"lines\"} ${lines.join(\", \")}): these queries target the header of a Collapse, which is now a native <summary> without role=\"button\", aria-expanded or aria-controls (other button queries in the file may too, if their Collapse label isn't static). Query it with getByTestId(\"<data-testid>-header\"), or to keep checking the label, with within(getByTestId(\"<data-testid>-header\")).getByText(label): a bare getByText(label) also matches the same text elsewhere and no longer proves it is the header. Read the state from the open attribute of the \"<data-testid>-details\" element. Content is in the DOM while the section is closed (unless the Collapse is lazy), so finding it doesn't prove the section expanded: assert the open attribute instead.`\n );\n }\n\n if (unidentifiedFiles > 0) {\n state.manualReview.push(\n `${unidentifiedFiles} other test ${unidentifiedFiles === 1 ? \"file renders\" : \"files render\"} a Collapse and ${unidentifiedFiles === 1 ? \"queries\" : \"query\"} buttons by role or ${unidentifiedFiles === 1 ? \"asserts\" : \"assert\"} aria-expanded or aria-controls. Those usually target other elements. Any that targeted a Collapse header, for example by a label rendered from a variable, now fail with 'Unable to find an accessible element with the role \"button\"': fix them as described for the files above.`\n );\n }\n};\n\n/**\n * 1-based line numbers in a test file of queries and assertions that target the old Collapse header.\n *\n * `aria-expanded` and `aria-controls` are also on selects, popovers and menus, so an assertion on them counts only\n * when its line holds a header query or a variable assigned from one.\n */\nconst headerQueryLines = (reached: ReachedCollapses, content: string): Array<number> => {\n const lineOf = (index: number): number => content.slice(0, index).split(\"\\n\").length;\n const lines = new Set<number>();\n\n for (const match of content.matchAll(SCOPED_BUTTON_QUERY_PATTERN)) {\n const testId = match[1];\n if (testId !== undefined && reached.testIds.has(testId)) lines.add(lineOf(match.index));\n }\n for (const match of content.matchAll(NAMED_BUTTON_QUERY_PATTERN)) {\n const name = match[1];\n if (name !== undefined && matchesCollapseLabel(reached.labels, name)) lines.add(lineOf(match.index));\n }\n\n const sourceLines = content.split(\"\\n\");\n const headerVariables = [...lines]\n .map(line => HEADER_VARIABLE_PATTERN.exec(sourceLines[line - 1] ?? \"\")?.[1])\n .filter(name => name !== undefined);\n sourceLines.forEach((line, index) => {\n if (!OLD_HEADER_ATTRIBUTE_PATTERN.test(line)) return;\n const usesHeaderVariable = headerVariables.some(name => new RegExp(`(?<![\\\\w$])${name}(?![\\\\w$])`).test(line));\n if (lines.has(index + 1) || usesHeaderVariable) lines.add(index + 1);\n });\n\n return [...lines].sort((a, b) => a - b);\n};\n\n/** Whether a query's `name` literal (a string or a regex) matches one of the static Collapse labels. */\nconst matchesCollapseLabel = (labels: ReadonlySet<string>, nameLiteral: string): boolean => {\n if (!nameLiteral.startsWith(\"/\")) {\n const name = nameLiteral.slice(1, -1).trim();\n return labels.has(name);\n }\n const lastSlash = nameLiteral.lastIndexOf(\"/\");\n let pattern: RegExp;\n try {\n pattern = new RegExp(nameLiteral.slice(1, lastSlash), nameLiteral.slice(lastSlash + 1).replace(/[gy]/g, \"\"));\n } catch {\n return false;\n }\n return [...labels].some(label => pattern.test(label));\n};\n\n/** The text of a string literal attribute, `{\"text\"}`, or the key of a translation call such as `{t(\"key\")}`. */\nconst staticAttributeText = (attribute: ts.JsxAttribute | null): string | null => {\n if (attribute === null || attribute.initializer === undefined) return null;\n if (ts.isStringLiteral(attribute.initializer)) return attribute.initializer.text;\n const expression = jsxExpressionOf(attribute);\n if (expression === null) return null;\n if (ts.isStringLiteral(expression) || ts.isNoSubstitutionTemplateLiteral(expression)) return expression.text;\n if (ts.isCallExpression(expression)) {\n const [firstArgument] = expression.arguments;\n if (firstArgument !== undefined && ts.isStringLiteral(firstArgument)) return firstArgument.text;\n }\n return null;\n};\n\n/* -------------------------------------------------------------------------- */\n\n/** Migrates the Collapses in one file and returns its new content, or `null` when nothing in it changes. */\nconst migrateCollapseUsages = (state: RunState, filePath: string, content: string): string | null => {\n const sourceFile = parseTsx(content, filePath);\n const aliases = getImportedAliases(sourceFile, PACKAGE_NAME);\n if (aliases === null) return null;\n const collapseAliases = Object.entries(aliases)\n .filter(([, imported]) => imported === COMPONENT_NAME)\n .map(([local]) => local);\n if (collapseAliases.length === 0) return null;\n\n const matches = findJsxElements(sourceFile, collapseAliases);\n if (matches.length === 0) return null;\n\n const file: FileContext = {\n filePath,\n sourceFile,\n edits: [],\n needsSyntheticEventImport: false,\n manualReview: state.manualReview,\n };\n const facts: CollapseFacts = { labels: new Set(), testIds: new Set() };\n state.collapses.set(filePath, facts);\n const reactImports = getReactImports(sourceFile);\n\n for (const { openingElement } of matches) {\n const onToggle = findJsxAttribute(openingElement, \"onToggle\");\n if (onToggle !== null) retypeOnToggle(file, onToggle, reactImports);\n\n const headerAddon = findJsxAttribute(openingElement, \"headerAddon\");\n if (headerAddon !== null) flagInteractiveAddon(file, headerAddon);\n\n if (findJsxAttribute(openingElement, LAZY_PROP) === null) {\n const animate = findJsxAttribute(openingElement, \"animate\");\n if (animate !== null) {\n keepLazyRendering(file, openingElement, animate);\n } else if (hasSpreadAttribute(openingElement)) {\n file.manualReview.push(\n `${location(file, openingElement)}: this Collapse gets props from a spread. If they can include animate={false}, also pass lazy: animate={false} now only turns the animation off, and lazy renders children only while the section is open, as animate={false} used to.`\n );\n }\n }\n\n const label = staticAttributeText(findJsxAttribute(openingElement, \"label\"));\n if (label !== null) facts.labels.add(label);\n const testId = staticAttributeText(findJsxAttribute(openingElement, \"data-testid\"));\n if (testId !== null) facts.testIds.add(testId);\n }\n\n if (file.edits.length === 0) return null;\n const edited = applyEdits(content, file.edits);\n return file.needsSyntheticEventImport ? updateReactImport(edited, filePath) : edited;\n};\n\n/**\n * Migrates consumers to the 7.0.0 `Collapse`, rebuilt on native `<details>`/`<summary>`:\n *\n * - Retypes `onToggle` handlers declared as `(event: MouseEvent<HTMLDivElement>, …)`, inline or in the same file,\n * to `SyntheticEvent<HTMLElement>` and updates the `react` import.\n * - Adds `lazy` next to `animate={false}` (and `lazy={!value}` next to a dynamic `animate={value}`): `animate` now\n * only controls the animation, and `lazy` renders children only while the section is open.\n * - Logs, without changing them:\n * - Collapses that get their props from a spread, which may carry `animate={false}`.\n * - `headerAddon`s that contain interactive controls (e.g. a `Button` or `ToggleGroup`), which would be\n * `nested-interactive` inside the native `<summary>`, and ones it can't look into (a prop, an import or a call).\n * - `onToggle` handlers it can't resolve or whose `MouseEvent` type it can't rewrite.\n * - Test lines that target the old header, which was a `role=\"button\"` with `aria-expanded` and `aria-controls`:\n * nameless button queries scoped to a Collapse's `data-testid`, button queries whose `name` matches a Collapse's\n * static label (a string or a `t(\"key\")` key), and assertions on those two attributes next to such a query.\n * Other button queries and attribute assertions in tests that render a Collapse are counted in a single note,\n * since they usually target other elements.\n *\n * Handlers and addons passed by name are resolved in the scope of the Collapse that uses them.\n */\nexport const collapseNativeDetails = (tree: Tree): void => {\n const state: RunState = { tree, collapses: new Map(), manualReview: [] };\n\n const touched = visitTsxFiles(tree, PACKAGE_NAME, (filePath, content) =>\n migrateCollapseUsages(state, filePath, content)\n );\n\n flagOldHeaderQueries(state);\n\n for (const message of state.manualReview) logger.warn(` ${MIGRATION_NAME}: ${message}`);\n logSummary(MIGRATION_NAME, touched, state.manualReview.length);\n};\n\nexport default collapseNativeDetails;\n"]}
1
+ {"version":3,"file":"collapse-native-details.js","sourceRoot":"","sources":["../../../../../../libs/react/components/migrations/v8-0-0/collapse-native-details.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAqE;AACrE,2CAA6B;AAC7B,+CAAiC;AACjC,kDAS4B;AAE5B,MAAM,cAAc,GAAG,yBAAyB,CAAC;AACjD,MAAM,YAAY,GAAG,6BAA6B,CAAC;AACnD,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AACrD,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB,mEAAmE;AACnE,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAC3D,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AACpD,gHAAgH;AAChH,MAAM,4BAA4B,GAAG,6BAA6B,CAAC;AACnE,sGAAsG;AACtG,MAAM,uBAAuB,GAAG,0CAA0C,CAAC;AAC3E,6GAA6G;AAC7G,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAChE,uGAAuG;AACvG,MAAM,0BAA0B,GAC9B,8GAA8G,CAAC;AACjH,kIAAkI;AAClI,MAAM,2BAA2B,GAC/B,mJAAmJ,CAAC;AACtJ,mHAAmH;AACnH,MAAM,oBAAoB,GAAwB,IA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otIgnoredFiles } from \"@nx/devkit\";\nimport * as path from \"path\";\nimport * as ts from \"typescript\";\nimport {\n findJsxAttribute,\n findJsxElements,\n getImportedAliases,\n hasSpreadAttribute,\n isWorkspaceSourceFile,\n logSummary,\n parseTsx,\n visitTsxFiles,\n} from \"../utils/jsx-utils\";\n\nconst MIGRATION_NAME = \"collapse-native-details\";\nconst PACKAGE_NAME = \"@trackunit/react-components\";\nconst COMPONENT_NAME = \"Collapse\";\nconst NEW_EVENT_TYPE = \"SyntheticEvent<HTMLElement>\";\nconst LAZY_PROP = \"lazy\";\n\n/** Extensions tried when resolving a relative import to a file. */\nconst MODULE_EXTENSIONS = [\".ts\", \".tsx\", \".jsx\"] as const;\nconst TEST_FILE_PATTERN = /\\.(spec|test)\\.[jt]sx?$/;\n/** Attributes the old header had. Other components have them too, so they only count next to a header query. */\nconst OLD_HEADER_ATTRIBUTE_PATTERN = /aria-expanded|aria-controls/;\n/** A variable assigned on a line, as in `const header = screen.getByRole(…)`: group 1 is its name. */\nconst HEADER_VARIABLE_PATTERN = /(?:const|let|var)\\s+([A-Za-z_][\\w]*)\\s*=/;\n/** Any button query by role, used to count the specs whose header queries can't be identified statically. */\nconst BUTTON_ROLE_QUERY_PATTERN = /ByRole\\(\\s*[\"'`]button[\"'`]/;\n/** A button query with a string or regex `name`, which may span lines: group 1 is the name literal. */\nconst NAMED_BUTTON_QUERY_PATTERN =\n /ByRole\\(\\s*[\"'`]button[\"'`]\\s*,\\s*\\{\\s*name:\\s*(\\/(?:\\\\.|[^/\\\\\\n])+\\/[a-z]*|\"[^\"\\n]*\"|'[^'\\n]*'|`[^`$\\n]*`)/g;\n/** A nameless button query scoped to a test id, e.g. `within(screen.getByTestId(\"x\")).getByRole(\"button\")`: group 1 is the id. */\nconst SCOPED_BUTTON_QUERY_PATTERN =\n /within\\(\\s*(?:screen\\.)?(?:get|query|find)ByTestId\\(\\s*[\"'`]([^\"'`]+)[\"'`]\\s*\\)\\s*\\)\\.(?:get|query|find)(?:All)?ByRole\\(\\s*[\"'`]button[\"'`]\\s*\\)/g;\n/** Elements that are interactive themselves, so nesting them in the `<summary>` header is `nested-interactive`. */\nconst INTERACTIVE_ELEMENTS: ReadonlySet<string> = new Set([\n \"a\",\n \"button\",\n \"input\",\n \"select\",\n \"textarea\",\n \"Button\",\n \"IconButton\",\n \"ToggleGroup\",\n \"Link\",\n \"ExternalLink\",\n \"Checkbox\",\n \"Toggle\",\n \"RadioGroup\",\n \"Select\",\n \"TextField\",\n \"MoreMenu\",\n]);\nconst RELATIVE_IMPORT_PATTERN = /(?:from\\s+|import\\s*\\(\\s*|require\\s*\\(\\s*)[\"'](\\.{1,2}\\/[^\"']+)[\"']/g;\n\ntype Edit = { start: number; end: number; text: string };\n\ntype FunctionLike = ts.ArrowFunction | ts.FunctionExpression | ts.FunctionDeclaration;\n\ntype ReactImports = {\n /** Local names of named imports from \"react\", mapped to the imported name. */\n named: Map<string, string>;\n /** Local names of default and namespace imports of \"react\" (e.g. `React`). */\n namespaces: Set<string>;\n};\n\n/** What the Collapses in one file give test queries to match on. */\ntype CollapseFacts = {\n /** Static `label`s: string literals and the key of a `t(\"key\")` call. */\n labels: Set<string>;\n /** Static `data-testid`s. */\n testIds: Set<string>;\n};\n\ntype RunState = {\n tree: Tree;\n /** Every file that renders a Collapse, by path. */\n collapses: Map<string, CollapseFacts>;\n manualReview: Array<string>;\n};\n\n/** One file being migrated: its parsed source, the edits collected for it and the run's review list. */\ntype FileContext = {\n filePath: string;\n sourceFile: ts.SourceFile;\n edits: Array<Edit>;\n /** Set when a handler is retyped to the bare `SyntheticEvent`, which the file then has to import. */\n needsSyntheticEventImport: boolean;\n manualReview: Array<string>;\n};\n\nconst location = (file: FileContext, node: ts.Node): string =>\n `${file.filePath}:${file.sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}`;\n\nconst addEdit = (file: FileContext, edit: Edit): void => {\n // The same handler can be reached through several Collapses; record each edit once.\n if (!file.edits.some(existing => existing.start === edit.start && existing.end === edit.end)) {\n file.edits.push(edit);\n }\n};\n\nconst applyEdits = (content: string, edits: ReadonlyArray<Edit>): string =>\n [...edits]\n .sort((a, b) => b.start - a.start)\n .reduce((updated, { start, end, text }) => `${updated.slice(0, start)}${text}${updated.slice(end)}`, content);\n\nconst getReactImports = (sourceFile: ts.SourceFile): ReactImports => {\n const named = new Map<string, string>();\n const namespaces = new Set<string>();\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt) || !ts.isStringLiteral(stmt.moduleSpecifier)) continue;\n if (stmt.moduleSpecifier.text !== \"react\") continue;\n const clause = stmt.importClause;\n if (clause === undefined) continue;\n if (clause.name !== undefined) namespaces.add(clause.name.text);\n const bindings = clause.namedBindings;\n if (bindings === undefined) continue;\n if (ts.isNamespaceImport(bindings)) {\n namespaces.add(bindings.name.text);\n } else {\n for (const element of bindings.elements) {\n named.set(element.name.text, element.propertyName?.text ?? element.name.text);\n }\n }\n }\n return { named, namespaces };\n};\n\ntype LocalDeclaration = ts.VariableDeclaration | ts.FunctionDeclaration;\n\nconst bindsName = (name: ts.BindingName, identifier: string): boolean =>\n ts.isIdentifier(name)\n ? name.text === identifier\n : name.elements.some(element => !ts.isOmittedExpression(element) && bindsName(element.name, identifier));\n\n/** The statements a scope node holds directly, or none when the node isn't a scope with statements. */\nconst statementsOf = (node: ts.Node): ReadonlyArray<ts.Statement> =>\n ts.isBlock(node) ||\n ts.isSourceFile(node) ||\n ts.isModuleBlock(node) ||\n ts.isCaseClause(node) ||\n ts.isDefaultClause(node)\n ? node.statements\n : [];\n\n/**\n * Finds the declaration an identifier refers to, walking out through the scopes that enclose `from`, so two\n * components in one file that each declare `handleToggle` resolve to their own.\n *\n * Returns `null` when the name is a parameter, a destructured binding or an import, or isn't declared in this file.\n */\nconst resolveLocalDeclaration = (from: ts.Node, identifier: string): LocalDeclaration | null => {\n // `from` is inside a source file, and the source file is the outermost scope.\n for (let scope = from.parent; ; scope = scope.parent) {\n if (ts.isFunctionLike(scope) && scope.parameters.some(parameter => bindsName(parameter.name, identifier))) {\n return null;\n }\n for (const statement of statementsOf(scope)) {\n if (ts.isFunctionDeclaration(statement) && statement.name?.text === identifier) return statement;\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (!bindsName(declaration.name, identifier)) continue;\n return ts.isIdentifier(declaration.name) ? declaration : null;\n }\n }\n if (ts.isSourceFile(scope)) return null;\n }\n};\n\n/** Unwraps parentheses and `useCallback(fn, deps)` to reach the function itself. */\nconst unwrapFunction = (expression: ts.Expression): FunctionLike | null => {\n if (ts.isParenthesizedExpression(expression)) return unwrapFunction(expression.expression);\n if (ts.isArrowFunction(expression) || ts.isFunctionExpression(expression)) return expression;\n if (ts.isCallExpression(expression)) {\n const callee = expression.expression;\n const calleeName = ts.isIdentifier(callee)\n ? callee.text\n : ts.isPropertyAccessExpression(callee)\n ? callee.name.text\n : null;\n const firstArgument = expression.arguments[0];\n if (calleeName === \"useCallback\" && firstArgument !== undefined) return unwrapFunction(firstArgument);\n }\n return null;\n};\n\nconst jsxExpressionOf = (attribute: ts.JsxAttribute): ts.Expression | null => {\n const initializer = attribute.initializer;\n if (initializer === undefined || !ts.isJsxExpression(initializer)) return null;\n return initializer.expression ?? null;\n};\n\n/** Resolves a relative import specifier to a file that exists in the tree. */\nconst resolveRelativeModule = (tree: Tree, fromFile: string, specifier: string): string | null => {\n const base = path.posix.normalize(path.posix.join(path.posix.dirname(fromFile), specifier));\n const candidates = [\n base,\n ...MODULE_EXTENSIONS.map(ext => `${base}${ext}`),\n ...MODULE_EXTENSIONS.map(ext => `${base}/index${ext}`),\n ];\n return candidates.find(candidate => tree.exists(candidate) && tree.isFile(candidate)) ?? null;\n};\n\n/* -------------------------------------------------------------------------- */\n/* onToggle: MouseEvent<HTMLDivElement> -> SyntheticEvent<HTMLElement> */\n/* -------------------------------------------------------------------------- */\n\n/** Returns the replacement text when `type` is React's MouseEvent, or `null` when it isn't. */\nconst syntheticEventReplacement = (type: ts.TypeNode, reactImports: ReactImports): string | null => {\n if (!ts.isTypeReferenceNode(type)) return null;\n const typeName = type.typeName;\n if (ts.isIdentifier(typeName)) {\n return reactImports.named.get(typeName.text) === \"MouseEvent\" ? NEW_EVENT_TYPE : null;\n }\n if (ts.isIdentifier(typeName.left) && reactImports.namespaces.has(typeName.left.text)) {\n return typeName.right.text === \"MouseEvent\" ? `${typeName.left.text}.${NEW_EVENT_TYPE}` : null;\n }\n return null;\n};\n\nconst retypeOnToggle = (file: FileContext, attribute: ts.JsxAttribute, reactImports: ReactImports): void => {\n const expression = jsxExpressionOf(attribute);\n if (expression === null) return;\n const flagForReview = (): void => {\n file.manualReview.push(\n `${location(file, attribute)}: check the onToggle handler's event parameter; its type is now SyntheticEvent<HTMLElement> (was MouseEvent<HTMLDivElement>).`\n );\n };\n\n const declaration = ts.isIdentifier(expression) ? resolveLocalDeclaration(attribute, expression.text) : null;\n const handler = !ts.isIdentifier(expression)\n ? unwrapFunction(expression)\n : declaration === null\n ? null\n : ts.isFunctionDeclaration(declaration)\n ? declaration\n : declaration.initializer !== undefined\n ? unwrapFunction(declaration.initializer)\n : null;\n if (handler === null) {\n flagForReview();\n return;\n }\n\n // The event type is on the handler's first parameter, or on the variable's own function type:\n // `const onToggle: (event: MouseEvent<HTMLDivElement>, expanded: boolean) => void = (event, expanded) => …`.\n const annotation = declaration !== null && ts.isVariableDeclaration(declaration) ? declaration.type : undefined;\n const eventType =\n handler.parameters[0]?.type ??\n (annotation !== undefined && ts.isFunctionTypeNode(annotation) ? annotation.parameters[0]?.type : undefined);\n if (eventType === undefined) {\n // Typed some other way, such as a type alias. Untyped handlers need nothing.\n if (annotation?.getText().includes(\"MouseEvent\") === true) flagForReview();\n return;\n }\n const replacement = syntheticEventReplacement(eventType, reactImports);\n if (replacement === null) {\n // A MouseEvent this migration can't tie to React, such as one behind an alias.\n if (eventType.getText().includes(\"MouseEvent\")) flagForReview();\n return;\n }\n\n addEdit(file, { start: eventType.getStart(), end: eventType.getEnd(), text: replacement });\n if (!replacement.includes(\".\")) file.needsSyntheticEventImport = true;\n};\n\n/** Adds `SyntheticEvent` to the react import and drops `MouseEvent` when nothing else uses it. */\nconst updateReactImport = (content: string, filePath: string): string => {\n const sourceFile = parseTsx(content, filePath);\n const reactImports = getReactImports(sourceFile);\n\n const mouseEventLocal = [...reactImports.named.entries()].find(([, imported]) => imported === \"MouseEvent\")?.[0];\n let mouseEventStillUsed = false;\n if (mouseEventLocal !== undefined) {\n const visit = (node: ts.Node): void => {\n if (mouseEventStillUsed || ts.isImportDeclaration(node)) return;\n if (ts.isIdentifier(node) && node.text === mouseEventLocal) {\n mouseEventStillUsed = true;\n return;\n }\n ts.forEachChild(node, visit);\n };\n visit(sourceFile);\n }\n const hasSyntheticEvent = [...reactImports.named.values()].includes(\"SyntheticEvent\");\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt) || !ts.isStringLiteral(stmt.moduleSpecifier)) continue;\n if (stmt.moduleSpecifier.text !== \"react\") continue;\n const bindings = stmt.importClause?.namedBindings;\n if (bindings === undefined || !ts.isNamedImports(bindings)) continue;\n\n const kept = bindings.elements\n .filter(element => mouseEventStillUsed || (element.propertyName?.text ?? element.name.text) !== \"MouseEvent\")\n .map(element => element.getText());\n const isSorted = kept.every((name, index) => index === 0 || (kept[index - 1] ?? \"\").localeCompare(name) <= 0);\n const withSyntheticEvent = hasSyntheticEvent ? kept : [...kept, \"SyntheticEvent\"];\n const merged = isSorted ? [...withSyntheticEvent].sort((a, b) => a.localeCompare(b)) : withSyntheticEvent;\n return `${content.slice(0, bindings.getStart())}{ ${merged.join(\", \")} }${content.slice(bindings.getEnd())}`;\n }\n\n return hasSyntheticEvent ? content : `import { SyntheticEvent } from \"react\";\\n${content}`;\n};\n\nconst containsJsx = (node: ts.Node): boolean =>\n ts.isJsxElement(node) ||\n ts.isJsxSelfClosingElement(node) ||\n ts.isJsxFragment(node) ||\n ts.forEachChild(node, containsJsx) === true;\n\n/** `null`, `undefined`, booleans, strings and numbers render nothing interactive. */\nconst isEmptyOrTextLiteral = (expression: ts.Expression): boolean =>\n ts.isParenthesizedExpression(expression)\n ? isEmptyOrTextLiteral(expression.expression)\n : expression.kind === ts.SyntaxKind.NullKeyword ||\n expression.kind === ts.SyntaxKind.TrueKeyword ||\n expression.kind === ts.SyntaxKind.FalseKeyword ||\n (ts.isIdentifier(expression) && expression.text === \"undefined\") ||\n ts.isStringLiteralLike(expression) ||\n ts.isNumericLiteral(expression);\n\n/**\n * Interactive controls in the addon are `nested-interactive` inside a native `<summary>`.\n * They are logged, not moved: the controls belong in the content, and where they go there is a layout decision.\n */\nconst flagInteractiveAddon = (file: FileContext, attribute: ts.JsxAttribute): void => {\n const expression = jsxExpressionOf(attribute);\n if (expression === null) return;\n const flagOpaque = (): void => {\n const source = expression.getText();\n file.manualReview.push(\n `${location(file, attribute)}: headerAddon is \\`${source.length > 60 ? `${source.slice(0, 57)}...` : source}\\`, which this migration can't look into (it comes from a prop, an import or a call). If it can render interactive controls such as a Button or ToggleGroup, move those into the content (e.g. a toolbar row at the top): the header is now a native <summary>, and controls nested in it are reported by axe as nested-interactive.`\n );\n };\n\n if (isEmptyOrTextLiteral(expression)) return;\n\n const declaration = ts.isIdentifier(expression) ? resolveLocalDeclaration(attribute, expression.text) : null;\n const addonRoot = !ts.isIdentifier(expression)\n ? expression\n : declaration !== null && ts.isVariableDeclaration(declaration)\n ? (declaration.initializer ?? null)\n : null;\n if (addonRoot === null) {\n flagOpaque();\n return;\n }\n\n const found = new Set<string>();\n const visit = (node: ts.Node): void => {\n if (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) {\n const tagName = node.tagName.getText();\n if (INTERACTIVE_ELEMENTS.has(tagName)) found.add(tagName);\n }\n ts.forEachChild(node, visit);\n };\n visit(addonRoot);\n if (found.size === 0) {\n if (!containsJsx(addonRoot) && !isEmptyOrTextLiteral(addonRoot)) flagOpaque();\n return;\n }\n\n file.manualReview.push(\n `${location(file, attribute)}: headerAddon contains interactive controls (${[...found].join(\", \")}). The header is now a native <summary>, which is interactive itself, so axe reports nested-interactive and screen readers may not announce these controls. Clicks on them still don't toggle the section, but move them into the content (e.g. a toolbar row at the top), and keep only non-interactive items such as status icons or badges in headerAddon.`\n );\n};\n\n/* -------------------------------------------------------------------------- */\n/* animate={false} -> animate={false} lazy */\n/* -------------------------------------------------------------------------- */\n\n/** The `lazy` attribute that keeps the old rendering of this `animate` value, or `null` when it is always true. */\nconst lazyAttributeFor = (animate: ts.JsxAttribute): string | null => {\n // The `animate` shorthand means `animate={true}`.\n if (animate.initializer === undefined) return null;\n const expression = jsxExpressionOf(animate);\n if (expression === null || expression.kind === ts.SyntaxKind.TrueKeyword) return null;\n if (expression.kind === ts.SyntaxKind.FalseKeyword) return LAZY_PROP;\n const text = expression.getText();\n const isSimple = ts.isIdentifier(expression) || ts.isPropertyAccessExpression(expression);\n return `${LAZY_PROP}={!${isSimple ? text : `(${text})`}}`;\n};\n\n/**\n * `animate={false}` used to also mean \"render children only while open\". That is now the separate `lazy` prop,\n * so it is added wherever `animate` is, or can be, false. It goes in alphabetical position when the attributes\n * are sorted, and right after `animate` otherwise.\n */\nconst keepLazyRendering = (\n file: FileContext,\n openingElement: ts.JsxOpeningElement | ts.JsxSelfClosingElement,\n animate: ts.JsxAttribute\n): void => {\n const lazyAttribute = lazyAttributeFor(animate);\n if (lazyAttribute === null) return;\n\n const named: Array<{ attribute: ts.JsxAttribute; name: string }> = [];\n for (const attribute of openingElement.attributes.properties) {\n if (ts.isJsxAttribute(attribute) && ts.isIdentifier(attribute.name)) {\n named.push({ attribute, name: attribute.name.text.toLowerCase() });\n }\n }\n const isSorted =\n named.length === openingElement.attributes.properties.length &&\n named.every(({ name }, index) => index === 0 || (named[index - 1]?.name ?? \"\") <= name);\n const anchor = isSorted ? (named.filter(({ name }) => name < LAZY_PROP).at(-1)?.attribute ?? animate) : animate;\n\n const leadingTrivia = file.sourceFile.text.slice(anchor.getFullStart(), anchor.getStart());\n const separator = /^\\s+$/.test(leadingTrivia) ? leadingTrivia : \" \";\n addEdit(file, { start: anchor.getEnd(), end: anchor.getEnd(), text: `${separator}${lazyAttribute}` });\n};\n\n/* -------------------------------------------------------------------------- */\n/* Manual review: tests that query the old header */\n/* -------------------------------------------------------------------------- */\n\n/** What a test file can render: its Collapse files' static labels and test ids, found through relative imports. */\ntype ReachedCollapses = { files: number; labels: Set<string>; testIds: Set<string> };\n\nconst reachedCollapses = (\n state: RunState,\n dependenciesOf: (filePath: string) => ReadonlyArray<string>,\n testFile: string\n): ReachedCollapses => {\n const reached: ReachedCollapses = { files: 0, labels: new Set(), testIds: new Set() };\n const visited = new Set<string>([testFile]);\n const queue = [testFile];\n for (let next = queue.shift(); next !== undefined; next = queue.shift()) {\n const facts = state.collapses.get(next);\n if (facts !== undefined) {\n reached.files++;\n for (const label of facts.labels) reached.labels.add(label);\n for (const testId of facts.testIds) reached.testIds.add(testId);\n }\n for (const dependency of dependenciesOf(next)) {\n if (visited.has(dependency)) continue;\n visited.add(dependency);\n queue.push(dependency);\n }\n }\n return reached;\n};\n\nconst flagOldHeaderQueries = (state: RunState): void => {\n // Nothing renders a Collapse, so no test can target its header.\n if (state.collapses.size === 0) return;\n\n const testFiles: Array<string> = [];\n visitNotIgnoredFiles(state.tree, \"/\", filePath => {\n if (isWorkspaceSourceFile(filePath) && TEST_FILE_PATTERN.test(filePath)) testFiles.push(filePath);\n });\n\n // The import graph is followed outward from the test files, so only files a test can reach are read.\n const dependencies = new Map<string, ReadonlyArray<string>>();\n const dependenciesOf = (filePath: string): ReadonlyArray<string> => {\n const known = dependencies.get(filePath);\n if (known !== undefined) return known;\n const resolved = new Set<string>();\n for (const match of (state.tree.read(filePath, \"utf-8\") ?? \"\").matchAll(RELATIVE_IMPORT_PATTERN)) {\n const specifier = match[1];\n const target = specifier === undefined ? null : resolveRelativeModule(state.tree, filePath, specifier);\n if (target !== null) resolved.add(target);\n }\n const result = [...resolved];\n dependencies.set(filePath, result);\n return result;\n };\n\n let unidentifiedFiles = 0;\n for (const testFile of testFiles) {\n const reached = reachedCollapses(state, dependenciesOf, testFile);\n if (reached.files === 0) continue;\n const content = state.tree.read(testFile, \"utf-8\") ?? \"\";\n const lines = headerQueryLines(reached, content);\n if (lines.length === 0) {\n if (BUTTON_ROLE_QUERY_PATTERN.test(content) || OLD_HEADER_ATTRIBUTE_PATTERN.test(content)) unidentifiedFiles++;\n continue;\n }\n state.manualReview.push(\n `${testFile} (${lines.length === 1 ? \"line\" : \"lines\"} ${lines.join(\", \")}): these queries target the header of a Collapse, which is now a native <summary> without role=\"button\", aria-expanded or aria-controls (other button queries in the file may too, if their Collapse label isn't static). Query it with getByTestId(\"<data-testid>-header\"), or to keep checking the label, with within(getByTestId(\"<data-testid>-header\")).getByText(label): a bare getByText(label) also matches the same text elsewhere and no longer proves it is the header. Read the state from the open attribute of the \"<data-testid>-details\" element. Content is in the DOM while the section is closed (unless the Collapse is lazy), so finding it doesn't prove the section expanded: assert the open attribute instead.`\n );\n }\n\n if (unidentifiedFiles > 0) {\n state.manualReview.push(\n `${unidentifiedFiles} other test ${unidentifiedFiles === 1 ? \"file renders\" : \"files render\"} a Collapse and ${unidentifiedFiles === 1 ? \"queries\" : \"query\"} buttons by role or ${unidentifiedFiles === 1 ? \"asserts\" : \"assert\"} aria-expanded or aria-controls. Those usually target other elements. Any that targeted a Collapse header, for example by a label rendered from a variable, now fail with 'Unable to find an accessible element with the role \"button\"': fix them as described for the files above.`\n );\n }\n};\n\n/**\n * 1-based line numbers in a test file of queries and assertions that target the old Collapse header.\n *\n * `aria-expanded` and `aria-controls` are also on selects, popovers and menus, so an assertion on them counts only\n * when its line holds a header query or a variable assigned from one.\n */\nconst headerQueryLines = (reached: ReachedCollapses, content: string): Array<number> => {\n const lineOf = (index: number): number => content.slice(0, index).split(\"\\n\").length;\n const lines = new Set<number>();\n\n for (const match of content.matchAll(SCOPED_BUTTON_QUERY_PATTERN)) {\n const testId = match[1];\n if (testId !== undefined && reached.testIds.has(testId)) lines.add(lineOf(match.index));\n }\n for (const match of content.matchAll(NAMED_BUTTON_QUERY_PATTERN)) {\n const name = match[1];\n if (name !== undefined && matchesCollapseLabel(reached.labels, name)) lines.add(lineOf(match.index));\n }\n\n const sourceLines = content.split(\"\\n\");\n const headerVariables = [...lines]\n .map(line => HEADER_VARIABLE_PATTERN.exec(sourceLines[line - 1] ?? \"\")?.[1])\n .filter(name => name !== undefined);\n sourceLines.forEach((line, index) => {\n if (!OLD_HEADER_ATTRIBUTE_PATTERN.test(line)) return;\n const usesHeaderVariable = headerVariables.some(name => new RegExp(`(?<![\\\\w$])${name}(?![\\\\w$])`).test(line));\n if (lines.has(index + 1) || usesHeaderVariable) lines.add(index + 1);\n });\n\n return [...lines].sort((a, b) => a - b);\n};\n\n/** Whether a query's `name` literal (a string or a regex) matches one of the static Collapse labels. */\nconst matchesCollapseLabel = (labels: ReadonlySet<string>, nameLiteral: string): boolean => {\n if (!nameLiteral.startsWith(\"/\")) {\n const name = nameLiteral.slice(1, -1).trim();\n return labels.has(name);\n }\n const lastSlash = nameLiteral.lastIndexOf(\"/\");\n let pattern: RegExp;\n try {\n pattern = new RegExp(nameLiteral.slice(1, lastSlash), nameLiteral.slice(lastSlash + 1).replace(/[gy]/g, \"\"));\n } catch {\n return false;\n }\n return [...labels].some(label => pattern.test(label));\n};\n\n/** The text of a string literal attribute, `{\"text\"}`, or the key of a translation call such as `{t(\"key\")}`. */\nconst staticAttributeText = (attribute: ts.JsxAttribute | null): string | null => {\n if (attribute === null || attribute.initializer === undefined) return null;\n if (ts.isStringLiteral(attribute.initializer)) return attribute.initializer.text;\n const expression = jsxExpressionOf(attribute);\n if (expression === null) return null;\n if (ts.isStringLiteral(expression) || ts.isNoSubstitutionTemplateLiteral(expression)) return expression.text;\n if (ts.isCallExpression(expression)) {\n const [firstArgument] = expression.arguments;\n if (firstArgument !== undefined && ts.isStringLiteral(firstArgument)) return firstArgument.text;\n }\n return null;\n};\n\n/* -------------------------------------------------------------------------- */\n\n/** Migrates the Collapses in one file and returns its new content, or `null` when nothing in it changes. */\nconst migrateCollapseUsages = (state: RunState, filePath: string, content: string): string | null => {\n const sourceFile = parseTsx(content, filePath);\n const aliases = getImportedAliases(sourceFile, PACKAGE_NAME);\n if (aliases === null) return null;\n const collapseAliases = Object.entries(aliases)\n .filter(([, imported]) => imported === COMPONENT_NAME)\n .map(([local]) => local);\n if (collapseAliases.length === 0) return null;\n\n const matches = findJsxElements(sourceFile, collapseAliases);\n if (matches.length === 0) return null;\n\n const file: FileContext = {\n filePath,\n sourceFile,\n edits: [],\n needsSyntheticEventImport: false,\n manualReview: state.manualReview,\n };\n const facts: CollapseFacts = { labels: new Set(), testIds: new Set() };\n state.collapses.set(filePath, facts);\n const reactImports = getReactImports(sourceFile);\n\n for (const { openingElement } of matches) {\n const onToggle = findJsxAttribute(openingElement, \"onToggle\");\n if (onToggle !== null) retypeOnToggle(file, onToggle, reactImports);\n\n const headerAddon = findJsxAttribute(openingElement, \"headerAddon\");\n if (headerAddon !== null) flagInteractiveAddon(file, headerAddon);\n\n if (findJsxAttribute(openingElement, LAZY_PROP) === null) {\n const animate = findJsxAttribute(openingElement, \"animate\");\n if (animate !== null) {\n keepLazyRendering(file, openingElement, animate);\n } else if (hasSpreadAttribute(openingElement)) {\n file.manualReview.push(\n `${location(file, openingElement)}: this Collapse gets props from a spread. If they can include animate={false}, also pass lazy: animate={false} now only turns the animation off, and lazy renders children only while the section is open, as animate={false} used to.`\n );\n }\n }\n\n const label = staticAttributeText(findJsxAttribute(openingElement, \"label\"));\n if (label !== null) facts.labels.add(label);\n const testId = staticAttributeText(findJsxAttribute(openingElement, \"data-testid\"));\n if (testId !== null) facts.testIds.add(testId);\n }\n\n if (file.edits.length === 0) return null;\n const edited = applyEdits(content, file.edits);\n return file.needsSyntheticEventImport ? updateReactImport(edited, filePath) : edited;\n};\n\n/**\n * Migrates consumers to the 8.0.0 `Collapse`, rebuilt on native `<details>`/`<summary>`:\n *\n * - Retypes `onToggle` handlers declared as `(event: MouseEvent<HTMLDivElement>, …)`, inline or in the same file,\n * to `SyntheticEvent<HTMLElement>` and updates the `react` import.\n * - Adds `lazy` next to `animate={false}` (and `lazy={!value}` next to a dynamic `animate={value}`): `animate` now\n * only controls the animation, and `lazy` renders children only while the section is open.\n * - Logs, without changing them:\n * - Collapses that get their props from a spread, which may carry `animate={false}`.\n * - `headerAddon`s that contain interactive controls (e.g. a `Button` or `ToggleGroup`), which would be\n * `nested-interactive` inside the native `<summary>`, and ones it can't look into (a prop, an import or a call).\n * - `onToggle` handlers it can't resolve or whose `MouseEvent` type it can't rewrite.\n * - Test lines that target the old header, which was a `role=\"button\"` with `aria-expanded` and `aria-controls`:\n * nameless button queries scoped to a Collapse's `data-testid`, button queries whose `name` matches a Collapse's\n * static label (a string or a `t(\"key\")` key), and assertions on those two attributes next to such a query.\n * Other button queries and attribute assertions in tests that render a Collapse are counted in a single note,\n * since they usually target other elements.\n *\n * Handlers and addons passed by name are resolved in the scope of the Collapse that uses them.\n */\nexport const collapseNativeDetails = (tree: Tree): void => {\n const state: RunState = { tree, collapses: new Map(), manualReview: [] };\n\n const touched = visitTsxFiles(tree, PACKAGE_NAME, (filePath, content) =>\n migrateCollapseUsages(state, filePath, content)\n );\n\n flagOldHeaderQueries(state);\n\n for (const message of state.manualReview) logger.warn(` ${MIGRATION_NAME}: ${message}`);\n logSummary(MIGRATION_NAME, touched, state.manualReview.length);\n};\n\nexport default collapseNativeDetails;\n"]}
package/migrations.json CHANGED
@@ -55,10 +55,10 @@
55
55
  "description": "Move imports of usePersistedState, useSearchParamSync, useCursorUrlSync, MAX_URL_LENGTH, UrlPersistenceLocation and Breadcrumb from @trackunit/react-components to @trackunit/react-router-components, and add @trackunit/react-router-components to the root package.json. Re-install dependencies afterwards.",
56
56
  "implementation": "./migrations/v4-0-0/move-to-router-components"
57
57
  },
58
- "v7-0-0-collapse-native-details": {
59
- "version": "7.0.0",
58
+ "v8-0-0-collapse-native-details": {
59
+ "version": "8.0.0",
60
60
  "description": "Collapse is rebuilt on native details/summary: retype onToggle handlers from MouseEvent<HTMLDivElement> to SyntheticEvent<HTMLElement>, add lazy next to animate={false} (animate now only controls the animation; lazy renders children only while open), and log Collapses that get props from a spread, headerAddons that contain interactive controls and tests that query the old role=button header for manual review.",
61
- "implementation": "./migrations/v7-0-0/collapse-native-details"
61
+ "implementation": "./migrations/v8-0-0/collapse-native-details"
62
62
  }
63
63
  }
64
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "8.0.3",
3
+ "version": "8.0.5",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "migrations": "./migrations.json",
@@ -14,15 +14,15 @@
14
14
  "@floating-ui/react": "^0.26.25",
15
15
  "string-ts": "^2.0.0",
16
16
  "tailwind-merge": "^3.7.0",
17
- "@trackunit/ui-design-tokens": "^1.21.57",
18
- "@trackunit/css-class-variance-utilities": "^2.6.60",
19
- "@trackunit/shared-utils": "^1.22.60",
20
- "@trackunit/ui-icons": "^1.20.57",
17
+ "@trackunit/ui-design-tokens": "^1.21.58",
18
+ "@trackunit/css-class-variance-utilities": "^2.6.61",
19
+ "@trackunit/shared-utils": "^1.22.61",
20
+ "@trackunit/ui-icons": "^1.20.58",
21
21
  "es-toolkit": "^1.52.0",
22
22
  "@tanstack/react-virtual": "^3.14.13",
23
23
  "fflate": "^0.8.3",
24
24
  "zod": "^3.25.76",
25
- "@trackunit/i18n-library-translation": "^2.14.57"
25
+ "@trackunit/i18n-library-translation": "^2.14.58"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^19.0.0",