@eui/core 22.0.0-alpha.27 → 22.0.0-alpha.29
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.
- package/CHANGELOG.md +23 -0
- package/docs/changelog.html +22 -0
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/documentation.json +408 -408
- package/docs/llms.txt +1 -1
- package/docs/properties.html +1 -1
- package/package.json +2 -2
|
@@ -2536,12 +2536,12 @@
|
|
|
2536
2536
|
},
|
|
2537
2537
|
{
|
|
2538
2538
|
"name": "Schema",
|
|
2539
|
-
"id": "interface-Schema-
|
|
2540
|
-
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
2539
|
+
"id": "interface-Schema-311bef7d5e4b40b356b0fdb5e35dd89e48a5c5beec29eeb865c22c2ca1c4c4fb1fd0bb4391ed0b33825a6d1d744bc3a2e9822b347fbc686a537e15b170c279dd-8",
|
|
2540
|
+
"file": "packages/core/schematics/migrate-eui-chip-list/index.ts",
|
|
2541
2541
|
"deprecated": false,
|
|
2542
2542
|
"deprecationMessage": "",
|
|
2543
2543
|
"type": "interface",
|
|
2544
|
-
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst REMOVED_INPUTS = new Set(['isSquared']);\n\nexport function migrateEuiChip(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes('eui-chip') && !original.includes('euiChip')) return;\n\n const result = path.endsWith('.html')\n ? migrateTemplate(original)\n : migrateInlineTemplates(original);\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would remove 'isSquared' input in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n\n // Warn about TS usages inline\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts') && original.includes('isSquared')) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && node.name.text === 'isSquared') {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(`${path}:${line + 1} - \"isSquared\" is no longer a valid input on eui-chip. Remove this assignment.`);\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n });\n\n context.logger.info(`Removed deprecated eui-chip 'isSquared' input from ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const removals: { start: number; end: number }[] = [];\n\n visitNodes(parsed.nodes, removals);\n\n let result = source;\n for (const { start, end } of removals.sort((a, b) => b.start - a.start)) {\n let adjustedStart = start;\n while (adjustedStart > 0 && (result[adjustedStart - 1] === ' ' || result[adjustedStart - 1] === '\\t')) {\n adjustedStart--;\n }\n result = result.slice(0, adjustedStart) + result.slice(end);\n }\n\n return result;\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const templateRegex = /template\\s*:\\s*`([^`]*)`/gs;\n return source.replace(templateRegex, (match, templateContent: string) => {\n if (!templateContent.includes('eui-chip') && !templateContent.includes('euiChip')) return match;\n const migrated = migrateTemplate(templateContent);\n if (migrated === templateContent) return match;\n return match.replace(templateContent, migrated);\n });\n}\n\nfunction isChipElement(element: TmplAstElement): boolean {\n if (element.name === 'eui-chip') return true;\n return element.attributes.some((a) => a.name === 'euiChip');\n}\n\nfunction visitNodes(nodes: TmplAstNode[], removals: { start: number; end: number }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (isChipElement(node)) collectRemovals(node, removals);\n visitNodes(node.children, removals);\n }\n }\n}\n\nfunction collectRemovals(element: TmplAstElement, removals: { start: number; end: number }[]): void {\n for (const attr of element.attributes) {\n if (REMOVED_INPUTS.has(attr.name)) {\n removals.push(getAttributeSpan(attr));\n }\n }\n for (const input of element.inputs) {\n if (REMOVED_INPUTS.has(input.name)) {\n removals.push(getAttributeSpan(input));\n }\n }\n}\n\nfunction getAttributeSpan(attr: TmplAstTextAttribute | TmplAstBoundAttribute): { start: number; end: number } {\n return { start: attr.sourceSpan.start.offset, end: attr.sourceSpan.end.offset };\n}\n",
|
|
2544
|
+
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\nconst CHIP_LIST_TAG = 'eui-chip-list';\nconst CHIP_LIST_ATTR = 'euiChipList';\nconst CHIP_TAG = 'eui-chip';\nconst CHIP_ATTR = 'euiChip';\n\nconst PROPAGATED_INPUTS = new Set([\n 'euiPrimary', 'euiSecondary', 'euiSuccess', 'euiInfo', 'euiWarning',\n 'euiDanger', 'euiAccent', 'euiVariant', 'euiSizeS', 'euiSizeVariant',\n 'euiOutline', 'euiDisabled',\n]);\n\nconst WARN_PROPERTIES = new Set([...PROPAGATED_INPUTS, 'chipRemove', 'isChipsRemovable', 'chipsLabelTruncateCount',\n 'maxVisibleChipsCount', 'isMaxVisibleChipsOpened', 'toggleLinkMoreLabel', 'toggleLinkLessLabel',\n 'isChipsSorted', 'chipsSortOrder']);\n\nconst REMOVED_INPUTS = new Set(['maxVisibleChipsCount', 'isMaxVisibleChipsOpened', 'toggleLinkMoreLabel', 'toggleLinkLessLabel', 'isChipsSorted', 'chipsSortOrder']);\n\nconst TRUNCATE_PIPE_IMPORT = 'EuiTruncatePipe';\nconst TRUNCATE_PIPE_PATH = '@eui/components/pipes';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\nexport function migrateEuiChipList(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n const filesNeedingTruncateImport = new Set<string>();\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(CHIP_LIST_TAG) && !original.includes(CHIP_LIST_ATTR)) return;\n\n let result: string;\n let addedTruncate = false;\n\n if (path.endsWith('.html')) {\n result = migrateTemplate(original);\n if (result !== original && result.includes('euiTruncate') && !original.includes('euiTruncate')) {\n // Find the associated .ts file\n const tsPath = path.replace(/\\.html$/, '.ts');\n if (tree.exists(tsPath)) {\n filesNeedingTruncateImport.add(tsPath);\n } else {\n // Try component naming convention\n const componentTsPath = path.replace(/\\.html$/, '.component.ts');\n if (tree.exists(componentTsPath)) {\n filesNeedingTruncateImport.add(componentTsPath);\n }\n }\n }\n } else {\n result = migrateInlineTemplates(original);\n if (result !== original && result.includes('euiTruncate') && !original.includes('euiTruncate')) {\n addedTruncate = true;\n }\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would move variant/size/outline inputs to child eui-chip in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n\n if (addedTruncate) {\n filesNeedingTruncateImport.add(path);\n }\n\n // Warn about TS usages of removed properties\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts')) {\n if ([...WARN_PROPERTIES].some((p) => original.includes(p))) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && WARN_PROPERTIES.has(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${path}:${line + 1} - \"${node.name.text}\" has been removed from eui-chip-list. Move it to individual eui-chip elements.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n }\n });\n\n // Add EuiTruncatePipe import to component files that need it\n for (const tsPath of filesNeedingTruncateImport) {\n const buffer = tree.read(tsPath);\n if (!buffer) continue;\n const source = buffer.toString('utf-8');\n if (source.includes(TRUNCATE_PIPE_IMPORT)) continue;\n const result = addTruncatePipeImport(source, tsPath);\n if (result !== source) {\n if (!options.dryRun) {\n tree.overwrite(tsPath, result);\n }\n }\n }\n\n context.logger.info(`Migrated eui-chip-list inputs/outputs to child eui-chip in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction addTruncatePipeImport(source: string, filePath: string): string {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n const edits: Edit[] = [];\n\n // 1. Add ES import statement for EuiTruncatePipe\n let hasEsImport = false;\n let lastImportEnd = 0;\n\n for (const stmt of sourceFile.statements) {\n if (ts.isImportDeclaration(stmt)) {\n lastImportEnd = stmt.getEnd();\n const moduleSpec = (stmt.moduleSpecifier as ts.StringLiteral).text;\n if (moduleSpec === TRUNCATE_PIPE_PATH) {\n const namedBindings = stmt.importClause?.namedBindings;\n if (namedBindings && ts.isNamedImports(namedBindings)) {\n if (namedBindings.elements.some((el) => el.name.text === TRUNCATE_PIPE_IMPORT)) {\n hasEsImport = true;\n } else {\n // Add to existing import from same path\n const lastEl = namedBindings.elements[namedBindings.elements.length - 1];\n edits.push({ start: lastEl.getEnd(), end: lastEl.getEnd(), replacement: `, ${TRUNCATE_PIPE_IMPORT}` });\n hasEsImport = true;\n }\n }\n }\n }\n }\n\n if (!hasEsImport) {\n const importStatement = `\\nimport { ${TRUNCATE_PIPE_IMPORT} } from '${TRUNCATE_PIPE_PATH}';`;\n edits.push({ start: lastImportEnd, end: lastImportEnd, replacement: importStatement });\n }\n\n // 2. Add EuiTruncatePipe to @Component imports array\n const visit = (node: ts.Node): void => {\n if (ts.isClassDeclaration(node)) {\n const decs = ts.getDecorators(node);\n if (!decs) return;\n for (const dec of decs) {\n if (!ts.isCallExpression(dec.expression) || !ts.isIdentifier(dec.expression.expression) || dec.expression.expression.text !== 'Component') continue;\n const metadata = dec.expression.arguments[0];\n if (!ts.isObjectLiteralExpression(metadata)) continue;\n for (const prop of metadata.properties) {\n if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name) || prop.name.text !== 'imports') continue;\n if (!ts.isArrayLiteralExpression(prop.initializer)) continue;\n const arr = prop.initializer;\n const arrText = source.slice(arr.getStart(sourceFile), arr.getEnd());\n if (arrText.includes(TRUNCATE_PIPE_IMPORT)) continue;\n if (arr.elements.length > 0) {\n const lastElement = arr.elements[arr.elements.length - 1];\n edits.push({ start: lastElement.getEnd(), end: lastElement.getEnd(), replacement: `,\\n ${TRUNCATE_PIPE_IMPORT}` });\n } else {\n edits.push({ start: arr.getStart(sourceFile) + 1, end: arr.getEnd() - 1, replacement: TRUNCATE_PIPE_IMPORT });\n }\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(sourceFile);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: Edit[] = [];\n\n visitNodes(parsed.nodes, source, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(CHIP_LIST_TAG) && !rawTemplate.includes(CHIP_LIST_ATTR)) {\n ts.forEachChild(node, visit);\n return;\n }\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) changes.push({ start, end, replacement: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return applyEdits(source, changes);\n}\n\nfunction visitNodes(nodes: TmplAstNode[], source: string, edits: Edit[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (isChipListElement(node)) {\n migrateChipListElement(node, source, edits);\n }\n visitNodes(node.children, source, edits);\n }\n }\n}\n\nfunction isChipListElement(element: TmplAstElement): boolean {\n if (element.name === CHIP_LIST_TAG) return true;\n return element.attributes.some((a) => a.name === CHIP_LIST_ATTR);\n}\n\nfunction isChipElement(element: TmplAstElement): boolean {\n if (element.name === CHIP_TAG) return true;\n return element.attributes.some((a) => a.name === CHIP_ATTR);\n}\n\nfunction findChildChips(nodes: TmplAstNode[]): TmplAstElement[] {\n const chips: TmplAstElement[] = [];\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (isChipElement(node)) {\n chips.push(node);\n } else {\n chips.push(...findChildChips(node.children));\n }\n }\n }\n return chips;\n}\n\nfunction migrateChipListElement(element: TmplAstElement, source: string, edits: Edit[]): void {\n const childChips = findChildChips(element.children);\n const insertions: string[] = [];\n let truncateValue: string | null = null;\n\n // Collect and remove propagated static attributes\n for (const attr of element.attributes) {\n if (PROPAGATED_INPUTS.has(attr.name)) {\n edits.push(removalEdit(attr, source));\n insertions.push(attr.value ? `${attr.name}=\"${attr.value}\"` : attr.name);\n }\n if (attr.name === 'isChipsRemovable') {\n edits.push(removalEdit(attr, source));\n insertions.push('isChipRemovable');\n }\n if (attr.name === 'chipsLabelTruncateCount') {\n edits.push(removalEdit(attr, source));\n truncateValue = attr.value || null;\n }\n if (REMOVED_INPUTS.has(attr.name)) {\n edits.push(removalEdit(attr, source));\n }\n }\n\n // Collect and remove propagated bound inputs\n for (const input of element.inputs) {\n if (PROPAGATED_INPUTS.has(input.name)) {\n edits.push(removalEdit(input, source));\n const raw = source.slice(input.sourceSpan.start.offset, input.sourceSpan.end.offset);\n insertions.push(raw);\n }\n if (input.name === 'isChipsRemovable') {\n edits.push(removalEdit(input, source));\n const valueText = extractBindingValue(input, source);\n insertions.push(`[isChipRemovable]=\"${valueText}\"`);\n }\n if (input.name === 'chipsLabelTruncateCount') {\n edits.push(removalEdit(input, source));\n truncateValue = extractBindingValue(input, source);\n }\n if (REMOVED_INPUTS.has(input.name)) {\n edits.push(removalEdit(input, source));\n }\n }\n\n // Collect and remove (chipRemove) output\n let chipRemoveHandler: string | null = null;\n for (const output of element.outputs) {\n if (output.name === 'chipRemove') {\n edits.push(removalEdit(output, source));\n chipRemoveHandler = extractHandlerExpression(output, source);\n }\n }\n\n if (chipRemoveHandler) {\n insertions.push(`(remove)=\"${chipRemoveHandler}\"`);\n }\n\n // Add collected attributes to each child eui-chip\n if (insertions.length > 0) {\n for (const chip of childChips) {\n const existingNames = getExistingAttrNames(chip);\n const toInsert = insertions.filter((ins) => {\n const name = extractAttrName(ins);\n return !existingNames.has(name);\n });\n if (toInsert.length > 0) {\n const insertPos = chip.startSourceSpan.end.offset - 1;\n edits.push({ start: insertPos, end: insertPos, replacement: ' ' + toInsert.join(' ') });\n }\n }\n }\n\n // Add euiTruncate pipe to chip label content\n if (truncateValue) {\n for (const chip of childChips) {\n const labelEdit = buildTruncatePipeEdit(chip, source, truncateValue);\n if (labelEdit) edits.push(labelEdit);\n }\n }\n}\n\nfunction buildTruncatePipeEdit(chip: TmplAstElement, source: string, truncateValue: string): Edit | null {\n // Find <span euiLabel>...</span> inside the chip\n const labelEl = findLabelElement(chip.children);\n if (labelEl && labelEl.endSourceSpan) {\n const contentStart = labelEl.startSourceSpan.end.offset;\n const contentEnd = labelEl.endSourceSpan.start.offset;\n const content = source.slice(contentStart, contentEnd);\n if (content && !content.includes('euiTruncate')) {\n const trimmed = content.trim();\n const interpMatch = trimmed.match(/^\\{\\{\\s*(.+?)\\s*\\}\\}$/);\n if (interpMatch) {\n return { start: contentStart, end: contentEnd, replacement: `{{ ${interpMatch[1]} | euiTruncate: ${truncateValue} }}` };\n }\n return { start: contentStart, end: contentEnd, replacement: `{{ '${trimmed}' | euiTruncate: ${truncateValue} }}` };\n }\n }\n\n // Check direct text content inside chip (no label element)\n if (chip.endSourceSpan) {\n const chipContentStart = chip.startSourceSpan.end.offset;\n const chipContentEnd = chip.endSourceSpan.start.offset;\n const chipContent = source.slice(chipContentStart, chipContentEnd);\n const trimmed = chipContent.trim();\n const interpMatch = trimmed.match(/^\\{\\{\\s*(.+?)\\s*\\}\\}$/);\n if (interpMatch && !chipContent.includes('euiTruncate')) {\n return { start: chipContentStart, end: chipContentEnd, replacement: `{{ ${interpMatch[1]} | euiTruncate: ${truncateValue} }}` };\n }\n }\n return null;\n}\n\nfunction findLabelElement(nodes: TmplAstNode[]): TmplAstElement | null {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.attributes.some((a) => a.name === 'euiLabel')) return node;\n const nested = findLabelElement(node.children);\n if (nested) return nested;\n }\n }\n return null;\n}\n\nfunction getExistingAttrNames(element: TmplAstElement): Set<string> {\n const names = new Set<string>();\n for (const attr of element.attributes) names.add(attr.name);\n for (const input of element.inputs) names.add(input.name);\n for (const output of element.outputs) names.add(output.name);\n return names;\n}\n\nfunction extractAttrName(insertion: string): string {\n const outputMatch = insertion.match(/^\\(([^)]+)\\)/);\n if (outputMatch) return outputMatch[1];\n const inputMatch = insertion.match(/^\\[([^\\]]+)\\]/);\n if (inputMatch) return inputMatch[1];\n return insertion.split('=')[0];\n}\n\nfunction removalEdit(node: TmplAstTextAttribute | TmplAstBoundAttribute | TmplAstBoundEvent, source: string): Edit {\n let start = node.sourceSpan.start.offset;\n while (start > 0 && (source[start - 1] === ' ' || source[start - 1] === '\\t')) {\n start--;\n }\n return { start, end: node.sourceSpan.end.offset, replacement: '' };\n}\n\nfunction extractBindingValue(input: TmplAstBoundAttribute, source: string): string {\n const raw = source.slice(input.sourceSpan.start.offset, input.sourceSpan.end.offset);\n const match = raw.match(/=[\"']([^\"']*)[\"']/);\n return match ? match[1] : 'true';\n}\n\nfunction extractHandlerExpression(output: TmplAstBoundEvent, source: string): string {\n const raw = source.slice(output.sourceSpan.start.offset, output.sourceSpan.end.offset);\n const match = raw.match(/=[\"']([^\"']*)[\"']/);\n return match ? match[1] : '';\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n const unique = deduplicateEdits(edits);\n let result = source;\n for (const edit of unique.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction deduplicateEdits(edits: Edit[]): Edit[] {\n const seen = new Map<string, Edit>();\n for (const edit of edits) {\n seen.set(`${edit.start}:${edit.end}`, edit);\n }\n return Array.from(seen.values());\n}\n",
|
|
2545
2545
|
"displayName": "Schema",
|
|
2546
2546
|
"properties": [
|
|
2547
2547
|
{
|
|
@@ -2553,7 +2553,7 @@
|
|
|
2553
2553
|
"indexKey": "",
|
|
2554
2554
|
"optional": true,
|
|
2555
2555
|
"description": "",
|
|
2556
|
-
"line":
|
|
2556
|
+
"line": 28,
|
|
2557
2557
|
"rawdescription": "\n"
|
|
2558
2558
|
},
|
|
2559
2559
|
{
|
|
@@ -2565,7 +2565,7 @@
|
|
|
2565
2565
|
"indexKey": "",
|
|
2566
2566
|
"optional": true,
|
|
2567
2567
|
"description": "",
|
|
2568
|
-
"line":
|
|
2568
|
+
"line": 27,
|
|
2569
2569
|
"rawdescription": "\n"
|
|
2570
2570
|
}
|
|
2571
2571
|
],
|
|
@@ -2583,12 +2583,12 @@
|
|
|
2583
2583
|
},
|
|
2584
2584
|
{
|
|
2585
2585
|
"name": "Schema",
|
|
2586
|
-
"id": "interface-Schema-
|
|
2587
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2586
|
+
"id": "interface-Schema-869dfc324e9111966817cbebb3553eabfe200acfe33bb77efa71a6c46e1cba0ff5852de7b9ade3060f87264035b99591361331a9e0622daaac22b8d59146c761-9",
|
|
2587
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
2588
2588
|
"deprecated": false,
|
|
2589
2589
|
"deprecationMessage": "",
|
|
2590
2590
|
"type": "interface",
|
|
2591
|
-
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\nconst CHIP_LIST_TAG = 'eui-chip-list';\nconst CHIP_LIST_ATTR = 'euiChipList';\nconst CHIP_TAG = 'eui-chip';\nconst CHIP_ATTR = 'euiChip';\n\nconst PROPAGATED_INPUTS = new Set([\n 'euiPrimary', 'euiSecondary', 'euiSuccess', 'euiInfo', 'euiWarning',\n 'euiDanger', 'euiAccent', 'euiVariant', 'euiSizeS', 'euiSizeVariant',\n 'euiOutline', 'euiDisabled',\n]);\n\nconst WARN_PROPERTIES = new Set([...PROPAGATED_INPUTS, 'chipRemove', 'isChipsRemovable', 'chipsLabelTruncateCount',\n 'maxVisibleChipsCount', 'isMaxVisibleChipsOpened', 'toggleLinkMoreLabel', 'toggleLinkLessLabel',\n 'isChipsSorted', 'chipsSortOrder']);\n\nconst REMOVED_INPUTS = new Set(['maxVisibleChipsCount', 'isMaxVisibleChipsOpened', 'toggleLinkMoreLabel', 'toggleLinkLessLabel', 'isChipsSorted', 'chipsSortOrder']);\n\nconst TRUNCATE_PIPE_IMPORT = 'EuiTruncatePipe';\nconst TRUNCATE_PIPE_PATH = '@eui/components/pipes';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\nexport function migrateEuiChipList(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n const filesNeedingTruncateImport = new Set<string>();\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(CHIP_LIST_TAG) && !original.includes(CHIP_LIST_ATTR)) return;\n\n let result: string;\n let addedTruncate = false;\n\n if (path.endsWith('.html')) {\n result = migrateTemplate(original);\n if (result !== original && result.includes('euiTruncate') && !original.includes('euiTruncate')) {\n // Find the associated .ts file\n const tsPath = path.replace(/\\.html$/, '.ts');\n if (tree.exists(tsPath)) {\n filesNeedingTruncateImport.add(tsPath);\n } else {\n // Try component naming convention\n const componentTsPath = path.replace(/\\.html$/, '.component.ts');\n if (tree.exists(componentTsPath)) {\n filesNeedingTruncateImport.add(componentTsPath);\n }\n }\n }\n } else {\n result = migrateInlineTemplates(original);\n if (result !== original && result.includes('euiTruncate') && !original.includes('euiTruncate')) {\n addedTruncate = true;\n }\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would move variant/size/outline inputs to child eui-chip in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n\n if (addedTruncate) {\n filesNeedingTruncateImport.add(path);\n }\n\n // Warn about TS usages of removed properties\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts')) {\n if ([...WARN_PROPERTIES].some((p) => original.includes(p))) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && WARN_PROPERTIES.has(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${path}:${line + 1} - \"${node.name.text}\" has been removed from eui-chip-list. Move it to individual eui-chip elements.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n }\n });\n\n // Add EuiTruncatePipe import to component files that need it\n for (const tsPath of filesNeedingTruncateImport) {\n const buffer = tree.read(tsPath);\n if (!buffer) continue;\n const source = buffer.toString('utf-8');\n if (source.includes(TRUNCATE_PIPE_IMPORT)) continue;\n const result = addTruncatePipeImport(source, tsPath);\n if (result !== source) {\n if (!options.dryRun) {\n tree.overwrite(tsPath, result);\n }\n }\n }\n\n context.logger.info(`Migrated eui-chip-list inputs/outputs to child eui-chip in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction addTruncatePipeImport(source: string, filePath: string): string {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n const edits: Edit[] = [];\n\n // 1. Add ES import statement for EuiTruncatePipe\n let hasEsImport = false;\n let lastImportEnd = 0;\n\n for (const stmt of sourceFile.statements) {\n if (ts.isImportDeclaration(stmt)) {\n lastImportEnd = stmt.getEnd();\n const moduleSpec = (stmt.moduleSpecifier as ts.StringLiteral).text;\n if (moduleSpec === TRUNCATE_PIPE_PATH) {\n const namedBindings = stmt.importClause?.namedBindings;\n if (namedBindings && ts.isNamedImports(namedBindings)) {\n if (namedBindings.elements.some((el) => el.name.text === TRUNCATE_PIPE_IMPORT)) {\n hasEsImport = true;\n } else {\n // Add to existing import from same path\n const lastEl = namedBindings.elements[namedBindings.elements.length - 1];\n edits.push({ start: lastEl.getEnd(), end: lastEl.getEnd(), replacement: `, ${TRUNCATE_PIPE_IMPORT}` });\n hasEsImport = true;\n }\n }\n }\n }\n }\n\n if (!hasEsImport) {\n const importStatement = `\\nimport { ${TRUNCATE_PIPE_IMPORT} } from '${TRUNCATE_PIPE_PATH}';`;\n edits.push({ start: lastImportEnd, end: lastImportEnd, replacement: importStatement });\n }\n\n // 2. Add EuiTruncatePipe to @Component imports array\n const visit = (node: ts.Node): void => {\n if (ts.isClassDeclaration(node)) {\n const decs = ts.getDecorators(node);\n if (!decs) return;\n for (const dec of decs) {\n if (!ts.isCallExpression(dec.expression) || !ts.isIdentifier(dec.expression.expression) || dec.expression.expression.text !== 'Component') continue;\n const metadata = dec.expression.arguments[0];\n if (!ts.isObjectLiteralExpression(metadata)) continue;\n for (const prop of metadata.properties) {\n if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name) || prop.name.text !== 'imports') continue;\n if (!ts.isArrayLiteralExpression(prop.initializer)) continue;\n const arr = prop.initializer;\n const arrText = source.slice(arr.getStart(sourceFile), arr.getEnd());\n if (arrText.includes(TRUNCATE_PIPE_IMPORT)) continue;\n if (arr.elements.length > 0) {\n const lastElement = arr.elements[arr.elements.length - 1];\n edits.push({ start: lastElement.getEnd(), end: lastElement.getEnd(), replacement: `,\\n ${TRUNCATE_PIPE_IMPORT}` });\n } else {\n edits.push({ start: arr.getStart(sourceFile) + 1, end: arr.getEnd() - 1, replacement: TRUNCATE_PIPE_IMPORT });\n }\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(sourceFile);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: Edit[] = [];\n\n visitNodes(parsed.nodes, source, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(CHIP_LIST_TAG) && !rawTemplate.includes(CHIP_LIST_ATTR)) {\n ts.forEachChild(node, visit);\n return;\n }\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) changes.push({ start, end, replacement: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return applyEdits(source, changes);\n}\n\nfunction visitNodes(nodes: TmplAstNode[], source: string, edits: Edit[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (isChipListElement(node)) {\n migrateChipListElement(node, source, edits);\n }\n visitNodes(node.children, source, edits);\n }\n }\n}\n\nfunction isChipListElement(element: TmplAstElement): boolean {\n if (element.name === CHIP_LIST_TAG) return true;\n return element.attributes.some((a) => a.name === CHIP_LIST_ATTR);\n}\n\nfunction isChipElement(element: TmplAstElement): boolean {\n if (element.name === CHIP_TAG) return true;\n return element.attributes.some((a) => a.name === CHIP_ATTR);\n}\n\nfunction findChildChips(nodes: TmplAstNode[]): TmplAstElement[] {\n const chips: TmplAstElement[] = [];\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (isChipElement(node)) {\n chips.push(node);\n } else {\n chips.push(...findChildChips(node.children));\n }\n }\n }\n return chips;\n}\n\nfunction migrateChipListElement(element: TmplAstElement, source: string, edits: Edit[]): void {\n const childChips = findChildChips(element.children);\n const insertions: string[] = [];\n let truncateValue: string | null = null;\n\n // Collect and remove propagated static attributes\n for (const attr of element.attributes) {\n if (PROPAGATED_INPUTS.has(attr.name)) {\n edits.push(removalEdit(attr, source));\n insertions.push(attr.value ? `${attr.name}=\"${attr.value}\"` : attr.name);\n }\n if (attr.name === 'isChipsRemovable') {\n edits.push(removalEdit(attr, source));\n insertions.push('isChipRemovable');\n }\n if (attr.name === 'chipsLabelTruncateCount') {\n edits.push(removalEdit(attr, source));\n truncateValue = attr.value || null;\n }\n if (REMOVED_INPUTS.has(attr.name)) {\n edits.push(removalEdit(attr, source));\n }\n }\n\n // Collect and remove propagated bound inputs\n for (const input of element.inputs) {\n if (PROPAGATED_INPUTS.has(input.name)) {\n edits.push(removalEdit(input, source));\n const raw = source.slice(input.sourceSpan.start.offset, input.sourceSpan.end.offset);\n insertions.push(raw);\n }\n if (input.name === 'isChipsRemovable') {\n edits.push(removalEdit(input, source));\n const valueText = extractBindingValue(input, source);\n insertions.push(`[isChipRemovable]=\"${valueText}\"`);\n }\n if (input.name === 'chipsLabelTruncateCount') {\n edits.push(removalEdit(input, source));\n truncateValue = extractBindingValue(input, source);\n }\n if (REMOVED_INPUTS.has(input.name)) {\n edits.push(removalEdit(input, source));\n }\n }\n\n // Collect and remove (chipRemove) output\n let chipRemoveHandler: string | null = null;\n for (const output of element.outputs) {\n if (output.name === 'chipRemove') {\n edits.push(removalEdit(output, source));\n chipRemoveHandler = extractHandlerExpression(output, source);\n }\n }\n\n if (chipRemoveHandler) {\n insertions.push(`(remove)=\"${chipRemoveHandler}\"`);\n }\n\n // Add collected attributes to each child eui-chip\n if (insertions.length > 0) {\n for (const chip of childChips) {\n const existingNames = getExistingAttrNames(chip);\n const toInsert = insertions.filter((ins) => {\n const name = extractAttrName(ins);\n return !existingNames.has(name);\n });\n if (toInsert.length > 0) {\n const insertPos = chip.startSourceSpan.end.offset - 1;\n edits.push({ start: insertPos, end: insertPos, replacement: ' ' + toInsert.join(' ') });\n }\n }\n }\n\n // Add euiTruncate pipe to chip label content\n if (truncateValue) {\n for (const chip of childChips) {\n const labelEdit = buildTruncatePipeEdit(chip, source, truncateValue);\n if (labelEdit) edits.push(labelEdit);\n }\n }\n}\n\nfunction buildTruncatePipeEdit(chip: TmplAstElement, source: string, truncateValue: string): Edit | null {\n // Find <span euiLabel>...</span> inside the chip\n const labelEl = findLabelElement(chip.children);\n if (labelEl && labelEl.endSourceSpan) {\n const contentStart = labelEl.startSourceSpan.end.offset;\n const contentEnd = labelEl.endSourceSpan.start.offset;\n const content = source.slice(contentStart, contentEnd);\n if (content && !content.includes('euiTruncate')) {\n const trimmed = content.trim();\n const interpMatch = trimmed.match(/^\\{\\{\\s*(.+?)\\s*\\}\\}$/);\n if (interpMatch) {\n return { start: contentStart, end: contentEnd, replacement: `{{ ${interpMatch[1]} | euiTruncate: ${truncateValue} }}` };\n }\n return { start: contentStart, end: contentEnd, replacement: `{{ '${trimmed}' | euiTruncate: ${truncateValue} }}` };\n }\n }\n\n // Check direct text content inside chip (no label element)\n if (chip.endSourceSpan) {\n const chipContentStart = chip.startSourceSpan.end.offset;\n const chipContentEnd = chip.endSourceSpan.start.offset;\n const chipContent = source.slice(chipContentStart, chipContentEnd);\n const trimmed = chipContent.trim();\n const interpMatch = trimmed.match(/^\\{\\{\\s*(.+?)\\s*\\}\\}$/);\n if (interpMatch && !chipContent.includes('euiTruncate')) {\n return { start: chipContentStart, end: chipContentEnd, replacement: `{{ ${interpMatch[1]} | euiTruncate: ${truncateValue} }}` };\n }\n }\n return null;\n}\n\nfunction findLabelElement(nodes: TmplAstNode[]): TmplAstElement | null {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.attributes.some((a) => a.name === 'euiLabel')) return node;\n const nested = findLabelElement(node.children);\n if (nested) return nested;\n }\n }\n return null;\n}\n\nfunction getExistingAttrNames(element: TmplAstElement): Set<string> {\n const names = new Set<string>();\n for (const attr of element.attributes) names.add(attr.name);\n for (const input of element.inputs) names.add(input.name);\n for (const output of element.outputs) names.add(output.name);\n return names;\n}\n\nfunction extractAttrName(insertion: string): string {\n const outputMatch = insertion.match(/^\\(([^)]+)\\)/);\n if (outputMatch) return outputMatch[1];\n const inputMatch = insertion.match(/^\\[([^\\]]+)\\]/);\n if (inputMatch) return inputMatch[1];\n return insertion.split('=')[0];\n}\n\nfunction removalEdit(node: TmplAstTextAttribute | TmplAstBoundAttribute | TmplAstBoundEvent, source: string): Edit {\n let start = node.sourceSpan.start.offset;\n while (start > 0 && (source[start - 1] === ' ' || source[start - 1] === '\\t')) {\n start--;\n }\n return { start, end: node.sourceSpan.end.offset, replacement: '' };\n}\n\nfunction extractBindingValue(input: TmplAstBoundAttribute, source: string): string {\n const raw = source.slice(input.sourceSpan.start.offset, input.sourceSpan.end.offset);\n const match = raw.match(/=[\"']([^\"']*)[\"']/);\n return match ? match[1] : 'true';\n}\n\nfunction extractHandlerExpression(output: TmplAstBoundEvent, source: string): string {\n const raw = source.slice(output.sourceSpan.start.offset, output.sourceSpan.end.offset);\n const match = raw.match(/=[\"']([^\"']*)[\"']/);\n return match ? match[1] : '';\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n const unique = deduplicateEdits(edits);\n let result = source;\n for (const edit of unique.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction deduplicateEdits(edits: Edit[]): Edit[] {\n const seen = new Map<string, Edit>();\n for (const edit of edits) {\n seen.set(`${edit.start}:${edit.end}`, edit);\n }\n return Array.from(seen.values());\n}\n",
|
|
2591
|
+
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst COMPONENT_TAG = 'eui-discussion-thread';\n\nexport function migrateEuiDiscussionThread(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(COMPONENT_TAG)) return;\n\n const result = path.endsWith('.html')\n ? migrateTemplate(original)\n : migrateInlineTemplates(original);\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would remove [trackBy] binding in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n\n // Warn about TS usages inline\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts') && original.includes('trackByFn')) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && node.name.text === 'trackByFn') {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(`${path}:${line + 1} - \"trackByFn\" has been removed from ${COMPONENT_TAG}. Remove this reference manually.`);\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n });\n\n context.logger.info(`Removed trackByFn-based [trackBy] bindings from ${COMPONENT_TAG} in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const removals: { start: number; end: number }[] = [];\n\n visitNodes(parsed.nodes, source, removals);\n\n let result = source;\n for (const { start, end } of removals.sort((a, b) => b.start - a.start)) {\n let adjustedStart = start;\n while (adjustedStart > 0 && (result[adjustedStart - 1] === ' ' || result[adjustedStart - 1] === '\\t')) {\n adjustedStart--;\n }\n result = result.slice(0, adjustedStart) + result.slice(end);\n }\n\n return result;\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const templateRegex = /template\\s*:\\s*`([^`]*)`/gs;\n return source.replace(templateRegex, (match, templateContent: string) => {\n if (!templateContent.includes(COMPONENT_TAG)) return match;\n const migrated = migrateTemplate(templateContent);\n if (migrated === templateContent) return match;\n return match.replace(templateContent, migrated);\n });\n}\n\nfunction visitNodes(nodes: TmplAstNode[], source: string, removals: { start: number; end: number }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === COMPONENT_TAG) collectRemovals(node, source, removals);\n visitNodes(node.children, source, removals);\n }\n }\n}\n\nfunction collectRemovals(element: TmplAstElement, source: string, removals: { start: number; end: number }[]): void {\n for (const input of element.inputs) {\n if (input.name === 'trackBy') {\n const valueSource = source.slice(input.sourceSpan.start.offset, input.sourceSpan.end.offset);\n if (valueSource.includes('trackByFn')) {\n removals.push({ start: input.sourceSpan.start.offset, end: input.sourceSpan.end.offset });\n }\n }\n }\n}\n",
|
|
2592
2592
|
"displayName": "Schema",
|
|
2593
2593
|
"properties": [
|
|
2594
2594
|
{
|
|
@@ -2600,7 +2600,7 @@
|
|
|
2600
2600
|
"indexKey": "",
|
|
2601
2601
|
"optional": true,
|
|
2602
2602
|
"description": "",
|
|
2603
|
-
"line":
|
|
2603
|
+
"line": 8,
|
|
2604
2604
|
"rawdescription": "\n"
|
|
2605
2605
|
},
|
|
2606
2606
|
{
|
|
@@ -2612,7 +2612,7 @@
|
|
|
2612
2612
|
"indexKey": "",
|
|
2613
2613
|
"optional": true,
|
|
2614
2614
|
"description": "",
|
|
2615
|
-
"line":
|
|
2615
|
+
"line": 7,
|
|
2616
2616
|
"rawdescription": "\n"
|
|
2617
2617
|
}
|
|
2618
2618
|
],
|
|
@@ -2630,12 +2630,12 @@
|
|
|
2630
2630
|
},
|
|
2631
2631
|
{
|
|
2632
2632
|
"name": "Schema",
|
|
2633
|
-
"id": "interface-Schema-
|
|
2634
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2633
|
+
"id": "interface-Schema-375dc0924084a2acbafe4a6a32577d59f631c9a386d151180d8fb1c89e7e7cd23da9fd459e597592ed823692adb6ad2633c50baf16621f003246e8c9bb1c6ce0-10",
|
|
2634
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
2635
2635
|
"deprecated": false,
|
|
2636
2636
|
"deprecationMessage": "",
|
|
2637
2637
|
"type": "interface",
|
|
2638
|
-
"sourceCode": "import { parseTemplate,
|
|
2638
|
+
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\nconst COMPONENT_TAG = 'eui-editor';\nconst OLD_NAME = 'onEditorChanged';\nconst NEW_NAME = 'contentChange';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nexport function migrateEuiEditor(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n if (path.endsWith('.html')) {\n if (!original.includes(COMPONENT_TAG)) return;\n const result = migrateTemplate(original);\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would rename '${OLD_NAME}' → '${NEW_NAME}' in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n return;\n }\n\n // .ts file — handle both migration and warnings in one pass\n const hasTag = original.includes(COMPONENT_TAG);\n const hasOldName = original.includes(OLD_NAME);\n if (!hasTag && !hasOldName) return;\n\n if (hasTag) {\n const result = migrateInlineTemplates(original);\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would rename '${OLD_NAME}' → '${NEW_NAME}' in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n }\n\n // Warn about TS property access usages (skip spec files)\n if (hasOldName && !path.endsWith('.spec.ts')) {\n warnPropertyAccesses(path, original, context);\n }\n });\n\n context.logger.info(`Renamed '(${OLD_NAME})' → '(${NEW_NAME})' on ${COMPONENT_TAG} in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n visitNodes(parsed.nodes, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: { start: number; end: number; text: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(COMPONENT_TAG)) {\n ts.forEachChild(node, visit); return;\n}\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) changes.push({ start, end, text: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n let result = source;\n for (const change of changes.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n return result;\n}\n\nfunction warnPropertyAccesses(path: string, source: string, context: SchematicContext): void {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && node.name.text === OLD_NAME) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(`${path}:${line + 1} - \"${OLD_NAME}\" has been renamed to \"${NEW_NAME}\" on ${COMPONENT_TAG}. Update this reference manually.`);\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction visitNodes(nodes: TmplAstNode[], edits: { start: number; end: number; replacement: string }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === COMPONENT_TAG) collectRenames(node, edits);\n visitNodes(node.children, edits);\n }\n }\n}\n\nfunction collectRenames(element: TmplAstElement, edits: { start: number; end: number; replacement: string }[]): void {\n for (const output of element.outputs) {\n if (output.name === OLD_NAME) {\n edits.push({ start: output.keySpan!.start.offset, end: output.keySpan!.end.offset, replacement: NEW_NAME });\n }\n }\n}\n\nfunction applyEdits(source: string, edits: { start: number; end: number; replacement: string }[]): string {\n let result = source;\n for (const edit of edits.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n",
|
|
2639
2639
|
"displayName": "Schema",
|
|
2640
2640
|
"properties": [
|
|
2641
2641
|
{
|
|
@@ -2647,7 +2647,7 @@
|
|
|
2647
2647
|
"indexKey": "",
|
|
2648
2648
|
"optional": true,
|
|
2649
2649
|
"description": "",
|
|
2650
|
-
"line":
|
|
2650
|
+
"line": 12,
|
|
2651
2651
|
"rawdescription": "\n"
|
|
2652
2652
|
},
|
|
2653
2653
|
{
|
|
@@ -2659,7 +2659,7 @@
|
|
|
2659
2659
|
"indexKey": "",
|
|
2660
2660
|
"optional": true,
|
|
2661
2661
|
"description": "",
|
|
2662
|
-
"line":
|
|
2662
|
+
"line": 11,
|
|
2663
2663
|
"rawdescription": "\n"
|
|
2664
2664
|
}
|
|
2665
2665
|
],
|
|
@@ -2677,12 +2677,12 @@
|
|
|
2677
2677
|
},
|
|
2678
2678
|
{
|
|
2679
2679
|
"name": "Schema",
|
|
2680
|
-
"id": "interface-Schema-
|
|
2681
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2680
|
+
"id": "interface-Schema-b3ff4600c4a5ca1888c45e5baf3600fa6dc6477f1e473e5241ff6682e2929dc8950a5dfa8b1048a348dba7ad1f0ce8cc3681471933911b689e04713334ef4811-11",
|
|
2681
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
2682
2682
|
"deprecated": false,
|
|
2683
2683
|
"deprecationMessage": "",
|
|
2684
2684
|
"type": "interface",
|
|
2685
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\nconst COMPONENT_TAG = 'eui-
|
|
2685
|
+
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst COMPONENT_TAG = 'eui-icon-svg';\n\nconst INPUT_RENAMES = new Map([\n ['variant', 'fillColor'],\n ['aria-label', 'ariaLabel'],\n]);\n\nconst TS_PROPERTY_RENAMES = new Map([\n ['variant', 'fillColor'],\n]);\n\nexport function migrateEuiIconSvg(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(COMPONENT_TAG)) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n result = migrateTemplate(original);\n } else {\n result = migrateInlineTemplates(original);\n result = renameTsPropertyAccesses(result);\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would rename deprecated inputs in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n });\n\n context.logger.info(`Migrated eui-icon-svg inputs in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n visitNodes(parsed.nodes, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: { start: number; end: number; text: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(COMPONENT_TAG)) {\n ts.forEachChild(node, visit);\n return;\n }\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) {\n changes.push({ start, end, text: migrated });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n let result = source;\n for (const change of changes.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n return result;\n}\n\nfunction renameTsPropertyAccesses(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && TS_PROPERTY_RENAMES.has(node.name.text)) {\n edits.push({ start: node.name.getStart(sourceFile), end: node.name.getEnd(), replacement: TS_PROPERTY_RENAMES.get(node.name.text)! });\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return applyEdits(source, edits);\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n}\n\nfunction visitNodes(nodes: TmplAstNode[], edits: { start: number; end: number; replacement: string }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === COMPONENT_TAG) {\n collectRenames(node, edits);\n }\n visitNodes(node.children, edits);\n }\n }\n}\n\nfunction collectRenames(element: TmplAstElement, edits: { start: number; end: number; replacement: string }[]): void {\n for (const attr of element.attributes) {\n const newName = INPUT_RENAMES.get(attr.name);\n if (newName) {\n edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n }\n for (const input of element.inputs) {\n const newName = INPUT_RENAMES.get(input.name);\n if (newName) {\n edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n }\n}\n\nfunction applyEdits(source: string, edits: { start: number; end: number; replacement: string }[]): string {\n let result = source;\n for (const edit of edits.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n",
|
|
2686
2686
|
"displayName": "Schema",
|
|
2687
2687
|
"properties": [
|
|
2688
2688
|
{
|
|
@@ -2694,7 +2694,7 @@
|
|
|
2694
2694
|
"indexKey": "",
|
|
2695
2695
|
"optional": true,
|
|
2696
2696
|
"description": "",
|
|
2697
|
-
"line":
|
|
2697
|
+
"line": 8,
|
|
2698
2698
|
"rawdescription": "\n"
|
|
2699
2699
|
},
|
|
2700
2700
|
{
|
|
@@ -2706,7 +2706,7 @@
|
|
|
2706
2706
|
"indexKey": "",
|
|
2707
2707
|
"optional": true,
|
|
2708
2708
|
"description": "",
|
|
2709
|
-
"line":
|
|
2709
|
+
"line": 7,
|
|
2710
2710
|
"rawdescription": "\n"
|
|
2711
2711
|
}
|
|
2712
2712
|
],
|
|
@@ -2724,12 +2724,12 @@
|
|
|
2724
2724
|
},
|
|
2725
2725
|
{
|
|
2726
2726
|
"name": "Schema",
|
|
2727
|
-
"id": "interface-Schema-
|
|
2728
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2727
|
+
"id": "interface-Schema-39d3d52e788050bebc4e0b99ed0756f7e9727556cb090ae8796bd4261a56463fe1f479c322b23028cd4134d71e4d1dc44cd248ac62a9a148b5fc46a665466f7c-12",
|
|
2728
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
2729
2729
|
"deprecated": false,
|
|
2730
2730
|
"deprecationMessage": "",
|
|
2731
2731
|
"type": "interface",
|
|
2732
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst
|
|
2732
|
+
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst REMOVED_INPUTS = new Set(['isSquared']);\n\nexport function migrateEuiChip(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes('eui-chip') && !original.includes('euiChip')) return;\n\n const result = path.endsWith('.html')\n ? migrateTemplate(original)\n : migrateInlineTemplates(original);\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would remove 'isSquared' input in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n\n // Warn about TS usages inline\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts') && original.includes('isSquared')) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && node.name.text === 'isSquared') {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(`${path}:${line + 1} - \"isSquared\" is no longer a valid input on eui-chip. Remove this assignment.`);\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n });\n\n context.logger.info(`Removed deprecated eui-chip 'isSquared' input from ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const removals: { start: number; end: number }[] = [];\n\n visitNodes(parsed.nodes, removals);\n\n let result = source;\n for (const { start, end } of removals.sort((a, b) => b.start - a.start)) {\n let adjustedStart = start;\n while (adjustedStart > 0 && (result[adjustedStart - 1] === ' ' || result[adjustedStart - 1] === '\\t')) {\n adjustedStart--;\n }\n result = result.slice(0, adjustedStart) + result.slice(end);\n }\n\n return result;\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const templateRegex = /template\\s*:\\s*`([^`]*)`/gs;\n return source.replace(templateRegex, (match, templateContent: string) => {\n if (!templateContent.includes('eui-chip') && !templateContent.includes('euiChip')) return match;\n const migrated = migrateTemplate(templateContent);\n if (migrated === templateContent) return match;\n return match.replace(templateContent, migrated);\n });\n}\n\nfunction isChipElement(element: TmplAstElement): boolean {\n if (element.name === 'eui-chip') return true;\n return element.attributes.some((a) => a.name === 'euiChip');\n}\n\nfunction visitNodes(nodes: TmplAstNode[], removals: { start: number; end: number }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (isChipElement(node)) collectRemovals(node, removals);\n visitNodes(node.children, removals);\n }\n }\n}\n\nfunction collectRemovals(element: TmplAstElement, removals: { start: number; end: number }[]): void {\n for (const attr of element.attributes) {\n if (REMOVED_INPUTS.has(attr.name)) {\n removals.push(getAttributeSpan(attr));\n }\n }\n for (const input of element.inputs) {\n if (REMOVED_INPUTS.has(input.name)) {\n removals.push(getAttributeSpan(input));\n }\n }\n}\n\nfunction getAttributeSpan(attr: TmplAstTextAttribute | TmplAstBoundAttribute): { start: number; end: number } {\n return { start: attr.sourceSpan.start.offset, end: attr.sourceSpan.end.offset };\n}\n",
|
|
2733
2733
|
"displayName": "Schema",
|
|
2734
2734
|
"properties": [
|
|
2735
2735
|
{
|
|
@@ -2771,12 +2771,12 @@
|
|
|
2771
2771
|
},
|
|
2772
2772
|
{
|
|
2773
2773
|
"name": "Schema",
|
|
2774
|
-
"id": "interface-Schema-
|
|
2775
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
2774
|
+
"id": "interface-Schema-21147930d3fbc38fbb3052a2ed9e7aa2b7505e6ed8c88c28796ce7101bd2ad914726eb230dda5826647036190edec6dae7e7e1d172387cd3803aa00bcdf790be-13",
|
|
2775
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
2776
2776
|
"deprecated": false,
|
|
2777
2777
|
"deprecationMessage": "",
|
|
2778
2778
|
"type": "interface",
|
|
2779
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst
|
|
2779
|
+
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst OLD_NAME = 'iconSet';\nconst NEW_NAME = 'iconSvgName';\nconst COMPONENT_TAG = 'eui-icon-toggle';\n\nexport function migrateEuiIconToggle(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let templateCount = 0;\n let tsCount = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(COMPONENT_TAG)) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n result = migrateTemplate(original);\n } else {\n result = migrateInlineTemplates(original);\n result = renameTsPropertyAccesses(result);\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would rename '${OLD_NAME}' → '${NEW_NAME}' in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n if (path.endsWith('.html')) templateCount++;\n else tsCount++;\n }\n });\n\n context.logger.info(`Renamed '${OLD_NAME}' → '${NEW_NAME}' on ${COMPONENT_TAG} in ${templateCount + tsCount} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n visitNodes(parsed.nodes, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: { start: number; end: number; text: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(COMPONENT_TAG)) {\n ts.forEachChild(node, visit);\n return;\n }\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) {\n changes.push({ start, end, text: migrated });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n let result = source;\n for (const change of changes.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n return result;\n}\n\nfunction renameTsPropertyAccesses(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && node.name.text === OLD_NAME) {\n edits.push({ start: node.name.getStart(sourceFile), end: node.name.getEnd(), replacement: NEW_NAME });\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return applyEdits(source, edits);\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n}\n\nfunction visitNodes(nodes: TmplAstNode[], edits: { start: number; end: number; replacement: string }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === COMPONENT_TAG) {\n collectRenames(node, edits);\n }\n visitNodes(node.children, edits);\n }\n }\n}\n\nfunction collectRenames(element: TmplAstElement, edits: { start: number; end: number; replacement: string }[]): void {\n for (const attr of element.attributes) {\n if (attr.name === OLD_NAME) {\n edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: NEW_NAME });\n }\n }\n for (const input of element.inputs) {\n if (input.name === OLD_NAME) {\n edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: NEW_NAME });\n }\n }\n}\n\nfunction applyEdits(source: string, edits: { start: number; end: number; replacement: string }[]): string {\n let result = source;\n for (const edit of edits.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n",
|
|
2780
2780
|
"displayName": "Schema",
|
|
2781
2781
|
"properties": [
|
|
2782
2782
|
{
|
|
@@ -2818,12 +2818,12 @@
|
|
|
2818
2818
|
},
|
|
2819
2819
|
{
|
|
2820
2820
|
"name": "Schema",
|
|
2821
|
-
"id": "interface-Schema-
|
|
2822
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2821
|
+
"id": "interface-Schema-0ee574e11dd651dd971057cb66220845e5b87b2949c69c623c8ddf7355af92a396c58c237a52a05f18c22a5332a2695b717bcfeb8ea840c4e7df8d0084c2b49c-14",
|
|
2822
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
2823
2823
|
"deprecated": false,
|
|
2824
2824
|
"deprecationMessage": "",
|
|
2825
2825
|
"type": "interface",
|
|
2826
|
-
"sourceCode": "import { parseTemplate,
|
|
2826
|
+
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst COMPONENT_TAG = 'eui-fieldset';\nconst OLD_NAME = 'iconSvgType';\nconst NEW_NAME = 'iconSvgName';\n\nexport function migrateEuiFieldset(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(COMPONENT_TAG)) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n result = migrateTemplate(original);\n } else {\n result = migrateInlineTemplates(original);\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would rename '${OLD_NAME}' → '${NEW_NAME}' in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n\n // Warn about TS property access usages (merged from warnTsUsages)\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts') && original.includes(OLD_NAME)) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && node.name.text === OLD_NAME) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(`${path}:${line + 1} - \"${OLD_NAME}\" has been renamed to \"${NEW_NAME}\" on ${COMPONENT_TAG}. Update this reference manually.`);\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n });\n\n context.logger.info(`Renamed '${OLD_NAME}' → '${NEW_NAME}' on ${COMPONENT_TAG} in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n visitNodes(parsed.nodes, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: { start: number; end: number; text: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(COMPONENT_TAG)) {\n ts.forEachChild(node, visit); return; \n}\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) changes.push({ start, end, text: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n let result = source;\n for (const change of changes.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n return result;\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction visitNodes(nodes: TmplAstNode[], edits: { start: number; end: number; replacement: string }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === COMPONENT_TAG) collectRenames(node, edits);\n visitNodes(node.children, edits);\n }\n }\n}\n\nfunction collectRenames(element: TmplAstElement, edits: { start: number; end: number; replacement: string }[]): void {\n for (const attr of element.attributes) {\n if (attr.name === OLD_NAME) {\n edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: NEW_NAME });\n }\n }\n for (const input of element.inputs) {\n if (input.name === OLD_NAME) {\n edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: NEW_NAME });\n }\n }\n}\n\nfunction applyEdits(source: string, edits: { start: number; end: number; replacement: string }[]): string {\n let result = source;\n for (const edit of edits.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n",
|
|
2827
2827
|
"displayName": "Schema",
|
|
2828
2828
|
"properties": [
|
|
2829
2829
|
{
|
|
@@ -2912,12 +2912,12 @@
|
|
|
2912
2912
|
},
|
|
2913
2913
|
{
|
|
2914
2914
|
"name": "Schema",
|
|
2915
|
-
"id": "interface-Schema-
|
|
2916
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2915
|
+
"id": "interface-Schema-90e62c16ce9ada881e8d434336bb633dae9745236106ddf60964afbd11de6aa579255a13d6036b384281860eb6ed2ee329194b519c51fdaf20f79bc511d0f64f-16",
|
|
2916
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
2917
2917
|
"deprecated": false,
|
|
2918
2918
|
"deprecationMessage": "",
|
|
2919
2919
|
"type": "interface",
|
|
2920
|
-
"sourceCode": "import { BindingPipe, parseTemplate, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstBoundText, TmplAstElement, TmplAstNode, TmplAstTemplate, TmplAstTextAttribute, AST, ASTWithSource, Interpolation } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Edit { start: number; end: number; replacement: string; }\n\n// --- Table-level input renames (on elements with euiTable attribute) ---\nconst TABLE_INPUT_RENAMES = new Map([\n ['rows', 'data'],\n ['loading', 'isLoading'],\n ['asyncTable', 'isAsync'],\n ['euiTableResponsive', 'isTableResponsive'],\n ['euiTableFixedLayout', 'isTableFixedLayout'],\n ['euiTableCompact', 'isTableCompact'],\n ['hasStickyColumns', 'hasStickyCols'],\n]);\n\n// --- Child element input renames (scoped to euiTable context) ---\nconst TH_TD_INPUT_RENAMES = new Map([\n ['isStickyColumn', 'isStickyCol'],\n ['sortable', 'isSortable'],\n]);\n\nconst TR_INPUT_RENAMES = new Map([\n ['isSelectableHeader', 'isHeaderSelectable'],\n ['isSelectable', 'isDataSelectable'],\n]);\n\n// --- Removed inputs ---\nconst REMOVED_INPUTS = new Set(['euiTableBordered', 'isHoverable', 'defaultMultiOrder', 'paginable']);\n\n// --- Output renames/removals ---\nconst OUTPUT_RENAMES = new Map([['selectedRows', 'rowsSelect']]);\nconst REMOVED_OUTPUTS = new Set(['multiSortChange']);\n\n// --- Pipe rename ---\nconst OLD_PIPE = 'euiTableHighlightFilter';\nconst NEW_PIPE = 'euiTableHighlight';\n\n// --- TS property renames ---\nconst TS_PROPERTY_RENAMES = new Map([['filteredRows', 'getFilteredData']]);\n\nconst PAGINATOR_IMPORT_PATH = '@eui/components/eui-paginator';\nconst PAGINATOR_COMPONENT = 'EuiPaginatorComponent';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nexport function migrateEuiTable(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n const paginatorHtmlFiles = new Set<string>();\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes('euiTable') && !original.includes(OLD_PIPE) && !original.includes('filteredRows') && !original.includes('setSort')) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n const { output, hasPaginator } = migrateTemplateWithPaginator(original, path, context);\n result = output;\n if (hasPaginator) paginatorHtmlFiles.add(path);\n } else {\n const { output, hasPaginator } = migrateTypeScript(original, path, context);\n result = output;\n if (hasPaginator) {\n result = addPaginatorImport(result, path);\n }\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate eui-table breaking changes in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n });\n\n // Handle paginator imports for external templates\n if (paginatorHtmlFiles.size > 0) {\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!source.includes('templateUrl')) return;\n\n for (const htmlFile of paginatorHtmlFiles) {\n const htmlFileName = htmlFile.split('/').pop()!;\n if (source.includes(htmlFileName)) {\n const updated = addPaginatorImport(source, path);\n if (updated !== source) {\n if (options.dryRun) {\n logDryRun(context, `Would add paginator import in ${path}`);\n } else {\n tree.overwrite(path, updated);\n }\n count++;\n }\n break;\n }\n }\n });\n }\n\n context.logger.info(`Migrated eui-table in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction migrateTemplateWithPaginator(source: string, filePath: string, context: SchematicContext): { output: string; hasPaginator: boolean } {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: Edit[] = [];\n let hasPaginator = false;\n\n const paginatorResult = visitNodesForTable(parsed.nodes, source, edits, false, filePath, context);\n if (paginatorResult) hasPaginator = true;\n\n collectPipeRenames(parsed.nodes, source, edits);\n\n return { output: applyEdits(source, edits), hasPaginator };\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): string {\n return migrateTemplateWithPaginator(source, filePath, context).output;\n}\n\nfunction migrateTypeScript(source: string, filePath: string, context: SchematicContext): { output: string; hasPaginator: boolean } {\n let result = source;\n let hasPaginator = false;\n\n // Migrate inline templates\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = result.slice(start, end);\n if (!rawTemplate.includes('euiTable') && !rawTemplate.includes(OLD_PIPE)) {\n ts.forEachChild(node, visit); return;\n}\n const { output: migrated, hasPaginator: pag } = migrateTemplateWithPaginator(rawTemplate, filePath, context);\n if (pag) hasPaginator = true;\n if (migrated !== rawTemplate) changes.push({ start, end, replacement: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n result = applyEdits(result, changes);\n\n // Rename TS property accesses\n result = renameTsProperties(result);\n\n // Warn about setSort\n warnSetSort(result, filePath, context);\n\n return { output: result, hasPaginator };\n}\n\nfunction renameTsProperties(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && TS_PROPERTY_RENAMES.has(node.name.text)) {\n edits.push({ start: node.name.getStart(sourceFile), end: node.name.getEnd(), replacement: TS_PROPERTY_RENAMES.get(node.name.text)! });\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return applyEdits(source, edits);\n}\n\nfunction warnSetSort(source: string, filePath: string, context: SchematicContext): void {\n if (!source.includes('setSort')) return;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) &&\n ts.isIdentifier(node.expression.name) && node.expression.name.text === 'setSort') {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"setSort\" signature changed from setSort(sort: string, order: \"asc\" | \"desc\") to setSort(Sort[]). Update manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n}\n\n// --- Template AST visitors ---\n\nfunction visitNodesForTable(\n nodes: TmplAstNode[], source: string, edits: Edit[], insideEuiTable: boolean, filePath: string, context: SchematicContext,\n): boolean {\n let hasPaginator = false;\n\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n const isEuiTable = hasEuiTableAttribute(node);\n\n if (isEuiTable) {\n collectTableInputRenames(node, edits);\n collectInputRemovals(node, source, edits, filePath, context);\n collectOutputChanges(node, source, edits, filePath, context);\n if (collectPaginatorMigration(node, source, edits)) hasPaginator = true;\n }\n\n if (isEuiTable || insideEuiTable) {\n collectChildElementRenames(node, edits);\n collectChildInputRemovals(node, source, edits, filePath, context);\n collectEmptyMessageRename(node, edits);\n }\n\n const childResult = visitNodesForTable(node.children, source, edits, isEuiTable || insideEuiTable, filePath, context);\n if (childResult) hasPaginator = true;\n }\n\n if (node instanceof TmplAstTemplate) {\n if (insideEuiTable) {\n collectTemplateEmptyMessageRename(node, edits);\n }\n const childResult = visitNodesForTable(node.children, source, edits, insideEuiTable, filePath, context);\n if (childResult) hasPaginator = true;\n }\n }\n\n return hasPaginator;\n}\n\nfunction hasEuiTableAttribute(element: TmplAstElement): boolean {\n return element.attributes.some((a) => a.name === 'euiTable') ||\n element.inputs.some((i) => i.name === 'euiTable');\n}\n\nfunction collectTableInputRenames(element: TmplAstElement, edits: Edit[]): void {\n for (const attr of element.attributes) {\n const newName = TABLE_INPUT_RENAMES.get(attr.name);\n if (newName) edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n for (const input of element.inputs) {\n const newName = TABLE_INPUT_RENAMES.get(input.name);\n if (newName) edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n}\n\nfunction collectChildElementRenames(element: TmplAstElement, edits: Edit[]): void {\n const renames = (element.name === 'th' || element.name === 'td') ? TH_TD_INPUT_RENAMES\n : element.name === 'tr' ? TR_INPUT_RENAMES : null;\n if (!renames) return;\n\n for (const attr of element.attributes) {\n const newName = renames.get(attr.name);\n if (newName) edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n for (const input of element.inputs) {\n const newName = renames.get(input.name);\n if (newName) edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n}\n\nfunction collectChildInputRemovals(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n const childRemovedInputs = new Set(['defaultMultiOrder']);\n\n for (const attr of element.attributes) {\n if (childRemovedInputs.has(attr.name)) {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n logRemovalWarning(attr.name, filePath, element, context);\n }\n }\n for (const input of element.inputs) {\n if (childRemovedInputs.has(input.name)) {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n logRemovalWarning(input.name, filePath, element, context);\n }\n }\n}\n\nfunction collectInputRemovals(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const attr of element.attributes) {\n if (REMOVED_INPUTS.has(attr.name) && attr.name !== 'paginable') {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n logRemovalWarning(attr.name, filePath, element, context);\n }\n }\n for (const input of element.inputs) {\n if (REMOVED_INPUTS.has(input.name) && input.name !== 'paginable') {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n logRemovalWarning(input.name, filePath, element, context);\n }\n }\n}\n\nfunction collectOutputChanges(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const output of element.outputs) {\n const newName = OUTPUT_RENAMES.get(output.name);\n if (newName) {\n edits.push({ start: output.keySpan!.start.offset, end: output.keySpan!.end.offset, replacement: newName });\n }\n if (REMOVED_OUTPUTS.has(output.name)) {\n removeAttribute(output.sourceSpan.start.offset, output.sourceSpan.end.offset, source, edits);\n const { line } = element.startSourceSpan.start;\n context.logger.warn(\n `${filePath}:${line + 1} - \"(${output.name})\" removed. Multi-sort is now supported by (sortChange) output.`,\n );\n }\n }\n}\n\nfunction collectPaginatorMigration(element: TmplAstElement, source: string, edits: Edit[]): boolean {\n let found = false;\n\n for (const attr of element.attributes) {\n if (attr.name === 'paginable') {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n found = true;\n }\n }\n for (const input of element.inputs) {\n if (input.name === 'paginable') {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n found = true;\n }\n }\n\n if (found) {\n // Add [paginator]=\"paginator\" before closing > of opening tag\n const insertPos = element.startSourceSpan.end.offset - 1;\n edits.push({ start: insertPos, end: insertPos, replacement: ' [paginator]=\"paginator\"' });\n\n // Add eui-paginator after </table>\n if (element.endSourceSpan) {\n const afterTable = element.endSourceSpan.end.offset;\n edits.push({\n start: afterTable,\n end: afterTable,\n replacement: '\\n<!-- TODO: Configure paginator and implement onPageChange handler -->\\n<eui-paginator #paginator [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 50]\" />',\n });\n }\n }\n\n return found;\n}\n\nfunction collectEmptyMessageRename(element: TmplAstElement, edits: Edit[]): void {\n // Handle direct attribute on elements (unlikely but handle)\n for (const attr of element.attributes) {\n if (attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n}\n\nfunction collectTemplateEmptyMessageRename(template: TmplAstTemplate, edits: Edit[]): void {\n for (const attr of template.templateAttrs) {\n if (attr instanceof TmplAstTextAttribute && attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n for (const attr of template.attributes) {\n if (attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n}\n\n// --- Pipe rename via AST ---\n\nfunction collectPipeRenames(nodes: TmplAstNode[], source: string, edits: Edit[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n for (const input of node.inputs) {\n visitExpressionForPipes(input.value, edits);\n }\n for (const output of node.outputs) {\n if (output.handler) visitExpressionForPipes(output.handler, edits);\n }\n collectPipeRenames(node.children, source, edits);\n }\n if (node instanceof TmplAstTemplate) {\n for (const input of node.inputs) {\n visitExpressionForPipes(input.value, edits);\n }\n collectPipeRenames(node.children, source, edits);\n }\n if (node instanceof TmplAstBoundText) {\n visitExpressionForPipes(node.value, edits);\n }\n }\n}\n\nfunction visitExpressionForPipes(expr: AST, edits: Edit[]): void {\n if (expr instanceof ASTWithSource && expr.ast) {\n visitAstForPipes(expr.ast, edits);\n } else {\n visitAstForPipes(expr, edits);\n }\n}\n\nfunction visitAstForPipes(ast: AST, edits: Edit[]): void {\n if (ast instanceof BindingPipe) {\n if (ast.name === OLD_PIPE && ast.nameSpan) {\n edits.push({ start: ast.nameSpan.start, end: ast.nameSpan.end, replacement: NEW_PIPE });\n }\n visitAstForPipes(ast.exp, edits);\n for (const arg of ast.args) {\n visitAstForPipes(arg, edits);\n }\n return;\n }\n\n if (ast instanceof Interpolation) {\n for (const expr of ast.expressions) {\n visitAstForPipes(expr, edits);\n }\n return;\n }\n\n // Recursively visit all properties that could contain AST nodes\n for (const key of Object.keys(ast)) {\n // eslint-disable-next-line\n const val = (ast as any)[key];\n if (val instanceof AST) {\n visitAstForPipes(val, edits);\n } else if (Array.isArray(val)) {\n for (const item of val) {\n if (item instanceof AST) visitAstForPipes(item, edits);\n }\n }\n }\n}\n\n// --- Import handling for paginator ---\n\nfunction addPaginatorImport(source: string, filePath: string): string {\n if (source.includes(PAGINATOR_COMPONENT)) return source;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Add import statement after last import\n let lastImportEnd = 0;\n for (const stmt of sourceFile.statements) {\n if (ts.isImportDeclaration(stmt)) {\n lastImportEnd = stmt.getEnd();\n }\n }\n\n if (lastImportEnd > 0) {\n edits.push({\n start: lastImportEnd,\n end: lastImportEnd,\n replacement: `\\nimport { ${PAGINATOR_COMPONENT} } from '${PAGINATOR_IMPORT_PATH}';`,\n });\n }\n\n // Add to component imports array\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && node.name.text === 'imports' && isComponentMetadataProperty(node)) {\n if (ts.isArrayLiteralExpression(node.initializer)) {\n const arr = node.initializer;\n const elements = arr.elements;\n if (elements.length > 0) {\n const lastElement = elements[elements.length - 1];\n edits.push({\n start: lastElement.getEnd(),\n end: lastElement.getEnd(),\n replacement: `, ${PAGINATOR_COMPONENT}`,\n });\n } else {\n const insertPos = arr.getStart(sourceFile) + 1;\n edits.push({ start: insertPos, end: insertPos, replacement: PAGINATOR_COMPONENT });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return applyEdits(source, edits);\n}\n\n// --- Helpers ---\n\nfunction removeAttribute(start: number, end: number, source: string, edits: Edit[]): void {\n let adjustedStart = start;\n while (adjustedStart > 0 && (source[adjustedStart - 1] === ' ' || source[adjustedStart - 1] === '\\t')) {\n adjustedStart--;\n }\n edits.push({ start: adjustedStart, end, replacement: '' });\n}\n\nfunction logRemovalWarning(name: string, filePath: string, element: TmplAstElement, context: SchematicContext): void {\n const { line } = element.startSourceSpan.start;\n if (name === 'defaultMultiOrder') {\n context.logger.warn(`${filePath}:${line + 1} - \"[${name}]\" removed. Use setSort(Sort[]) to initialize sorting.`);\n } else {\n context.logger.warn(`${filePath}:${line + 1} - \"[${name}]\" removed to align to Design System.`);\n }\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n const unique = new Map<string, Edit>();\n for (const edit of edits) {\n const key = `${edit.start}:${edit.end}`;\n unique.set(key, edit);\n }\n let result = source;\n for (const edit of [...unique.values()].sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2920
|
+
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst INPUT_RENAMES = new Map([\n ['iconLabelClass', 'icon'],\n ['iconLabelStyleClass', 'fillColor'],\n]);\n\nexport function migrateEuiProgressCircle(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n const oldNames = [...INPUT_RENAMES.keys()];\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n if (original.includes('eui-progress-circle')) {\n const result = path.endsWith('.html')\n ? migrateTemplate(original)\n : migrateInlineTemplates(original);\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would rename deprecated inputs in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n }\n\n // Warn about TS property access usages (merged from warnTsUsages)\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts')) {\n if (oldNames.some((name) => original.includes(name))) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && INPUT_RENAMES.has(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const newName = INPUT_RENAMES.get(node.name.text);\n context.logger.warn(\n `${path}:${line + 1} - \"${node.name.text}\" has been renamed to \"${newName}\" on eui-progress-circle. Update this reference manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n }\n });\n\n context.logger.info(`Renamed deprecated eui-progress-circle inputs in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n visitNodes(parsed.nodes, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: { start: number; end: number; text: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes('eui-progress-circle')) {\n ts.forEachChild(node, visit);\n return;\n }\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) {\n changes.push({ start, end, text: migrated });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n let result = source;\n for (const change of changes.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n return result;\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n}\n\nfunction visitNodes(nodes: TmplAstNode[], edits: { start: number; end: number; replacement: string }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === 'eui-progress-circle') {\n collectRenames(node, edits);\n }\n visitNodes(node.children, edits);\n }\n }\n}\n\nfunction collectRenames(element: TmplAstElement, edits: { start: number; end: number; replacement: string }[]): void {\n for (const attr of element.attributes) {\n const newName = INPUT_RENAMES.get(attr.name);\n if (newName) {\n edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n }\n for (const input of element.inputs) {\n const newName = INPUT_RENAMES.get(input.name);\n if (newName) {\n edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n }\n}\n\nfunction applyEdits(source: string, edits: { start: number; end: number; replacement: string }[]): string {\n let result = source;\n for (const edit of edits.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n",
|
|
2921
2921
|
"displayName": "Schema",
|
|
2922
2922
|
"properties": [
|
|
2923
2923
|
{
|
|
@@ -2929,7 +2929,7 @@
|
|
|
2929
2929
|
"indexKey": "",
|
|
2930
2930
|
"optional": true,
|
|
2931
2931
|
"description": "",
|
|
2932
|
-
"line":
|
|
2932
|
+
"line": 8,
|
|
2933
2933
|
"rawdescription": "\n"
|
|
2934
2934
|
},
|
|
2935
2935
|
{
|
|
@@ -2941,7 +2941,7 @@
|
|
|
2941
2941
|
"indexKey": "",
|
|
2942
2942
|
"optional": true,
|
|
2943
2943
|
"description": "",
|
|
2944
|
-
"line":
|
|
2944
|
+
"line": 7,
|
|
2945
2945
|
"rawdescription": "\n"
|
|
2946
2946
|
}
|
|
2947
2947
|
],
|
|
@@ -2959,12 +2959,12 @@
|
|
|
2959
2959
|
},
|
|
2960
2960
|
{
|
|
2961
2961
|
"name": "Schema",
|
|
2962
|
-
"id": "interface-Schema-
|
|
2963
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2962
|
+
"id": "interface-Schema-91c9f900bf3ebb82488fb65644938ef486ceaa447cff8bfd9d710df9595d82acb267b26f3c252173bc684353f362473120226426ed7ee5d98b33e30011dd9383-17",
|
|
2963
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
2964
2964
|
"deprecated": false,
|
|
2965
2965
|
"deprecationMessage": "",
|
|
2966
2966
|
"type": "interface",
|
|
2967
|
-
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst INPUT_RENAMES = new Map([\n ['iconLabelClass', 'icon'],\n ['iconLabelStyleClass', 'fillColor'],\n]);\n\nexport function migrateEuiProgressCircle(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n const oldNames = [...INPUT_RENAMES.keys()];\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n if (original.includes('eui-progress-circle')) {\n const result = path.endsWith('.html')\n ? migrateTemplate(original)\n : migrateInlineTemplates(original);\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would rename deprecated inputs in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n }\n\n // Warn about TS property access usages (merged from warnTsUsages)\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts')) {\n if (oldNames.some((name) => original.includes(name))) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && INPUT_RENAMES.has(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const newName = INPUT_RENAMES.get(node.name.text);\n context.logger.warn(\n `${path}:${line + 1} - \"${node.name.text}\" has been renamed to \"${newName}\" on eui-progress-circle. Update this reference manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n }\n });\n\n context.logger.info(`Renamed deprecated eui-progress-circle inputs in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n visitNodes(parsed.nodes, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: { start: number; end: number; text: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes('eui-progress-circle')) {\n ts.forEachChild(node, visit);\n return;\n }\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) {\n changes.push({ start, end, text: migrated });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n let result = source;\n for (const change of changes.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n return result;\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n}\n\nfunction visitNodes(nodes: TmplAstNode[], edits: { start: number; end: number; replacement: string }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === 'eui-progress-circle') {\n collectRenames(node, edits);\n }\n visitNodes(node.children, edits);\n }\n }\n}\n\nfunction collectRenames(element: TmplAstElement, edits: { start: number; end: number; replacement: string }[]): void {\n for (const attr of element.attributes) {\n const newName = INPUT_RENAMES.get(attr.name);\n if (newName) {\n edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n }\n for (const input of element.inputs) {\n const newName = INPUT_RENAMES.get(input.name);\n if (newName) {\n edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n }\n}\n\nfunction applyEdits(source: string, edits: { start: number; end: number; replacement: string }[]): string {\n let result = source;\n for (const edit of edits.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n",
|
|
2967
|
+
"sourceCode": "import { BindingPipe, parseTemplate, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstBoundText, TmplAstElement, TmplAstNode, TmplAstTemplate, TmplAstTextAttribute, AST, ASTWithSource, Interpolation } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Edit { start: number; end: number; replacement: string; }\n\n// --- Table-level input renames (on elements with euiTable attribute) ---\nconst TABLE_INPUT_RENAMES = new Map([\n ['rows', 'data'],\n ['loading', 'isLoading'],\n ['asyncTable', 'isAsync'],\n ['euiTableResponsive', 'isTableResponsive'],\n ['euiTableFixedLayout', 'isTableFixedLayout'],\n ['euiTableCompact', 'isTableCompact'],\n ['hasStickyColumns', 'hasStickyCols'],\n]);\n\n// --- Child element input renames (scoped to euiTable context) ---\nconst TH_TD_INPUT_RENAMES = new Map([\n ['isStickyColumn', 'isStickyCol'],\n ['sortable', 'isSortable'],\n]);\n\nconst TR_INPUT_RENAMES = new Map([\n ['isSelectableHeader', 'isHeaderSelectable'],\n ['isSelectable', 'isDataSelectable'],\n]);\n\n// --- Removed inputs ---\nconst REMOVED_INPUTS = new Set(['euiTableBordered', 'isHoverable', 'defaultMultiOrder', 'paginable']);\n\n// --- Output renames/removals ---\nconst OUTPUT_RENAMES = new Map([['selectedRows', 'rowsSelect']]);\nconst REMOVED_OUTPUTS = new Set(['multiSortChange']);\n\n// --- Pipe rename ---\nconst OLD_PIPE = 'euiTableHighlightFilter';\nconst NEW_PIPE = 'euiTableHighlight';\n\n// --- TS property renames ---\nconst TS_PROPERTY_RENAMES = new Map([['filteredRows', 'getFilteredData']]);\n\nconst PAGINATOR_IMPORT_PATH = '@eui/components/eui-paginator';\nconst PAGINATOR_COMPONENT = 'EuiPaginatorComponent';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nexport function migrateEuiTable(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n const paginatorHtmlFiles = new Set<string>();\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes('euiTable') && !original.includes(OLD_PIPE) && !original.includes('filteredRows') && !original.includes('setSort')) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n const { output, hasPaginator } = migrateTemplateWithPaginator(original, path, context);\n result = output;\n if (hasPaginator) paginatorHtmlFiles.add(path);\n } else {\n const { output, hasPaginator } = migrateTypeScript(original, path, context);\n result = output;\n if (hasPaginator) {\n result = addPaginatorImport(result, path);\n }\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate eui-table breaking changes in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n });\n\n // Handle paginator imports for external templates\n if (paginatorHtmlFiles.size > 0) {\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!source.includes('templateUrl')) return;\n\n for (const htmlFile of paginatorHtmlFiles) {\n const htmlFileName = htmlFile.split('/').pop()!;\n if (source.includes(htmlFileName)) {\n const updated = addPaginatorImport(source, path);\n if (updated !== source) {\n if (options.dryRun) {\n logDryRun(context, `Would add paginator import in ${path}`);\n } else {\n tree.overwrite(path, updated);\n }\n count++;\n }\n break;\n }\n }\n });\n }\n\n context.logger.info(`Migrated eui-table in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction migrateTemplateWithPaginator(source: string, filePath: string, context: SchematicContext): { output: string; hasPaginator: boolean } {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: Edit[] = [];\n let hasPaginator = false;\n\n const paginatorResult = visitNodesForTable(parsed.nodes, source, edits, false, filePath, context);\n if (paginatorResult) hasPaginator = true;\n\n collectPipeRenames(parsed.nodes, source, edits);\n\n return { output: applyEdits(source, edits), hasPaginator };\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): string {\n return migrateTemplateWithPaginator(source, filePath, context).output;\n}\n\nfunction migrateTypeScript(source: string, filePath: string, context: SchematicContext): { output: string; hasPaginator: boolean } {\n let result = source;\n let hasPaginator = false;\n\n // Migrate inline templates\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = result.slice(start, end);\n if (!rawTemplate.includes('euiTable') && !rawTemplate.includes(OLD_PIPE)) {\n ts.forEachChild(node, visit); return;\n}\n const { output: migrated, hasPaginator: pag } = migrateTemplateWithPaginator(rawTemplate, filePath, context);\n if (pag) hasPaginator = true;\n if (migrated !== rawTemplate) changes.push({ start, end, replacement: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n result = applyEdits(result, changes);\n\n // Rename TS property accesses\n result = renameTsProperties(result);\n\n // Warn about setSort\n warnSetSort(result, filePath, context);\n\n return { output: result, hasPaginator };\n}\n\nfunction renameTsProperties(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && TS_PROPERTY_RENAMES.has(node.name.text)) {\n edits.push({ start: node.name.getStart(sourceFile), end: node.name.getEnd(), replacement: TS_PROPERTY_RENAMES.get(node.name.text)! });\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return applyEdits(source, edits);\n}\n\nfunction warnSetSort(source: string, filePath: string, context: SchematicContext): void {\n if (!source.includes('setSort')) return;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) &&\n ts.isIdentifier(node.expression.name) && node.expression.name.text === 'setSort') {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"setSort\" signature changed from setSort(sort: string, order: \"asc\" | \"desc\") to setSort(Sort[]). Update manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n}\n\n// --- Template AST visitors ---\n\nfunction visitNodesForTable(\n nodes: TmplAstNode[], source: string, edits: Edit[], insideEuiTable: boolean, filePath: string, context: SchematicContext,\n): boolean {\n let hasPaginator = false;\n\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n const isEuiTable = hasEuiTableAttribute(node);\n\n if (isEuiTable) {\n collectTableInputRenames(node, edits);\n collectInputRemovals(node, source, edits, filePath, context);\n collectOutputChanges(node, source, edits, filePath, context);\n if (collectPaginatorMigration(node, source, edits)) hasPaginator = true;\n }\n\n if (isEuiTable || insideEuiTable) {\n collectChildElementRenames(node, edits);\n collectChildInputRemovals(node, source, edits, filePath, context);\n collectEmptyMessageRename(node, edits);\n }\n\n const childResult = visitNodesForTable(node.children, source, edits, isEuiTable || insideEuiTable, filePath, context);\n if (childResult) hasPaginator = true;\n }\n\n if (node instanceof TmplAstTemplate) {\n if (insideEuiTable) {\n collectTemplateEmptyMessageRename(node, edits);\n }\n const childResult = visitNodesForTable(node.children, source, edits, insideEuiTable, filePath, context);\n if (childResult) hasPaginator = true;\n }\n }\n\n return hasPaginator;\n}\n\nfunction hasEuiTableAttribute(element: TmplAstElement): boolean {\n return element.attributes.some((a) => a.name === 'euiTable') ||\n element.inputs.some((i) => i.name === 'euiTable');\n}\n\nfunction collectTableInputRenames(element: TmplAstElement, edits: Edit[]): void {\n for (const attr of element.attributes) {\n const newName = TABLE_INPUT_RENAMES.get(attr.name);\n if (newName) edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n for (const input of element.inputs) {\n const newName = TABLE_INPUT_RENAMES.get(input.name);\n if (newName) edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n}\n\nfunction collectChildElementRenames(element: TmplAstElement, edits: Edit[]): void {\n const renames = (element.name === 'th' || element.name === 'td') ? TH_TD_INPUT_RENAMES\n : element.name === 'tr' ? TR_INPUT_RENAMES : null;\n if (!renames) return;\n\n for (const attr of element.attributes) {\n const newName = renames.get(attr.name);\n if (newName) edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n for (const input of element.inputs) {\n const newName = renames.get(input.name);\n if (newName) edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n}\n\nfunction collectChildInputRemovals(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n const childRemovedInputs = new Set(['defaultMultiOrder']);\n\n for (const attr of element.attributes) {\n if (childRemovedInputs.has(attr.name)) {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n logRemovalWarning(attr.name, filePath, element, context);\n }\n }\n for (const input of element.inputs) {\n if (childRemovedInputs.has(input.name)) {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n logRemovalWarning(input.name, filePath, element, context);\n }\n }\n}\n\nfunction collectInputRemovals(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const attr of element.attributes) {\n if (REMOVED_INPUTS.has(attr.name) && attr.name !== 'paginable') {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n logRemovalWarning(attr.name, filePath, element, context);\n }\n }\n for (const input of element.inputs) {\n if (REMOVED_INPUTS.has(input.name) && input.name !== 'paginable') {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n logRemovalWarning(input.name, filePath, element, context);\n }\n }\n}\n\nfunction collectOutputChanges(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const output of element.outputs) {\n const newName = OUTPUT_RENAMES.get(output.name);\n if (newName) {\n edits.push({ start: output.keySpan!.start.offset, end: output.keySpan!.end.offset, replacement: newName });\n }\n if (REMOVED_OUTPUTS.has(output.name)) {\n removeAttribute(output.sourceSpan.start.offset, output.sourceSpan.end.offset, source, edits);\n const { line } = element.startSourceSpan.start;\n context.logger.warn(\n `${filePath}:${line + 1} - \"(${output.name})\" removed. Multi-sort is now supported by (sortChange) output.`,\n );\n }\n }\n}\n\nfunction collectPaginatorMigration(element: TmplAstElement, source: string, edits: Edit[]): boolean {\n let found = false;\n\n for (const attr of element.attributes) {\n if (attr.name === 'paginable') {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n found = true;\n }\n }\n for (const input of element.inputs) {\n if (input.name === 'paginable') {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n found = true;\n }\n }\n\n if (found) {\n // Add [paginator]=\"paginator\" before closing > of opening tag\n const insertPos = element.startSourceSpan.end.offset - 1;\n edits.push({ start: insertPos, end: insertPos, replacement: ' [paginator]=\"paginator\"' });\n\n // Add eui-paginator after </table>\n if (element.endSourceSpan) {\n const afterTable = element.endSourceSpan.end.offset;\n edits.push({\n start: afterTable,\n end: afterTable,\n replacement: '\\n<!-- TODO: Configure paginator and implement onPageChange handler -->\\n<eui-paginator #paginator [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 50]\" />',\n });\n }\n }\n\n return found;\n}\n\nfunction collectEmptyMessageRename(element: TmplAstElement, edits: Edit[]): void {\n // Handle direct attribute on elements (unlikely but handle)\n for (const attr of element.attributes) {\n if (attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n}\n\nfunction collectTemplateEmptyMessageRename(template: TmplAstTemplate, edits: Edit[]): void {\n for (const attr of template.templateAttrs) {\n if (attr instanceof TmplAstTextAttribute && attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n for (const attr of template.attributes) {\n if (attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n}\n\n// --- Pipe rename via AST ---\n\nfunction collectPipeRenames(nodes: TmplAstNode[], source: string, edits: Edit[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n for (const input of node.inputs) {\n visitExpressionForPipes(input.value, edits);\n }\n for (const output of node.outputs) {\n if (output.handler) visitExpressionForPipes(output.handler, edits);\n }\n collectPipeRenames(node.children, source, edits);\n }\n if (node instanceof TmplAstTemplate) {\n for (const input of node.inputs) {\n visitExpressionForPipes(input.value, edits);\n }\n collectPipeRenames(node.children, source, edits);\n }\n if (node instanceof TmplAstBoundText) {\n visitExpressionForPipes(node.value, edits);\n }\n }\n}\n\nfunction visitExpressionForPipes(expr: AST, edits: Edit[]): void {\n if (expr instanceof ASTWithSource && expr.ast) {\n visitAstForPipes(expr.ast, edits);\n } else {\n visitAstForPipes(expr, edits);\n }\n}\n\nfunction visitAstForPipes(ast: AST, edits: Edit[]): void {\n if (ast instanceof BindingPipe) {\n if (ast.name === OLD_PIPE && ast.nameSpan) {\n edits.push({ start: ast.nameSpan.start, end: ast.nameSpan.end, replacement: NEW_PIPE });\n }\n visitAstForPipes(ast.exp, edits);\n for (const arg of ast.args) {\n visitAstForPipes(arg, edits);\n }\n return;\n }\n\n if (ast instanceof Interpolation) {\n for (const expr of ast.expressions) {\n visitAstForPipes(expr, edits);\n }\n return;\n }\n\n // Recursively visit all properties that could contain AST nodes\n for (const key of Object.keys(ast)) {\n // eslint-disable-next-line\n const val = (ast as any)[key];\n if (val instanceof AST) {\n visitAstForPipes(val, edits);\n } else if (Array.isArray(val)) {\n for (const item of val) {\n if (item instanceof AST) visitAstForPipes(item, edits);\n }\n }\n }\n}\n\n// --- Import handling for paginator ---\n\nfunction addPaginatorImport(source: string, filePath: string): string {\n if (source.includes(PAGINATOR_COMPONENT)) return source;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Add import statement after last import\n let lastImportEnd = 0;\n for (const stmt of sourceFile.statements) {\n if (ts.isImportDeclaration(stmt)) {\n lastImportEnd = stmt.getEnd();\n }\n }\n\n if (lastImportEnd > 0) {\n edits.push({\n start: lastImportEnd,\n end: lastImportEnd,\n replacement: `\\nimport { ${PAGINATOR_COMPONENT} } from '${PAGINATOR_IMPORT_PATH}';`,\n });\n }\n\n // Add to component imports array\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && node.name.text === 'imports' && isComponentMetadataProperty(node)) {\n if (ts.isArrayLiteralExpression(node.initializer)) {\n const arr = node.initializer;\n const elements = arr.elements;\n if (elements.length > 0) {\n const lastElement = elements[elements.length - 1];\n edits.push({\n start: lastElement.getEnd(),\n end: lastElement.getEnd(),\n replacement: `, ${PAGINATOR_COMPONENT}`,\n });\n } else {\n const insertPos = arr.getStart(sourceFile) + 1;\n edits.push({ start: insertPos, end: insertPos, replacement: PAGINATOR_COMPONENT });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return applyEdits(source, edits);\n}\n\n// --- Helpers ---\n\nfunction removeAttribute(start: number, end: number, source: string, edits: Edit[]): void {\n let adjustedStart = start;\n while (adjustedStart > 0 && (source[adjustedStart - 1] === ' ' || source[adjustedStart - 1] === '\\t')) {\n adjustedStart--;\n }\n edits.push({ start: adjustedStart, end, replacement: '' });\n}\n\nfunction logRemovalWarning(name: string, filePath: string, element: TmplAstElement, context: SchematicContext): void {\n const { line } = element.startSourceSpan.start;\n if (name === 'defaultMultiOrder') {\n context.logger.warn(`${filePath}:${line + 1} - \"[${name}]\" removed. Use setSort(Sort[]) to initialize sorting.`);\n } else {\n context.logger.warn(`${filePath}:${line + 1} - \"[${name}]\" removed to align to Design System.`);\n }\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n const unique = new Map<string, Edit>();\n for (const edit of edits) {\n const key = `${edit.start}:${edit.end}`;\n unique.set(key, edit);\n }\n let result = source;\n for (const edit of [...unique.values()].sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2968
2968
|
"displayName": "Schema",
|
|
2969
2969
|
"properties": [
|
|
2970
2970
|
{
|
|
@@ -2976,7 +2976,7 @@
|
|
|
2976
2976
|
"indexKey": "",
|
|
2977
2977
|
"optional": true,
|
|
2978
2978
|
"description": "",
|
|
2979
|
-
"line":
|
|
2979
|
+
"line": 49,
|
|
2980
2980
|
"rawdescription": "\n"
|
|
2981
2981
|
},
|
|
2982
2982
|
{
|
|
@@ -2988,7 +2988,7 @@
|
|
|
2988
2988
|
"indexKey": "",
|
|
2989
2989
|
"optional": true,
|
|
2990
2990
|
"description": "",
|
|
2991
|
-
"line":
|
|
2991
|
+
"line": 48,
|
|
2992
2992
|
"rawdescription": "\n"
|
|
2993
2993
|
}
|
|
2994
2994
|
],
|
|
@@ -3006,12 +3006,12 @@
|
|
|
3006
3006
|
},
|
|
3007
3007
|
{
|
|
3008
3008
|
"name": "Schema",
|
|
3009
|
-
"id": "interface-Schema-
|
|
3010
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
3009
|
+
"id": "interface-Schema-760dec88d3f709d5b38226e55f7cbfb1e5fabcea6c004fd46e611be1dd563b8b247e9e6c77667e5582fe7b443374ba2c4facd2b2db2985edb46c9a4a37a8a876-18",
|
|
3010
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
3011
3011
|
"deprecated": false,
|
|
3012
3012
|
"deprecationMessage": "",
|
|
3013
3013
|
"type": "interface",
|
|
3014
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\nconst OLD_TAG = 'eui-toolbar-menu';\nconst NEW_TAG = 'eui-toolbar-mega-menu';\nconst OLD_COMPONENT = 'EuiToolbarMenuComponent';\nconst NEW_COMPONENT = 'EuiToolbarMegaMenuComponent';\nconst OLD_INTERFACE = 'ToolbarItem';\nconst NEW_INTERFACE = 'EuiMenuItem';\nconst NEW_COMPONENT_PATH = '@eui/components/layout';\nconst NEW_INTERFACE_PATH = '@eui/core';\nconst REMOVED_OUTPUT = 'menuItemClick';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\nexport function migrateEuiToolbarMenu(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(OLD_TAG) && !original.includes(OLD_COMPONENT) && !original.includes(OLD_INTERFACE)) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n result = migrateTemplate(original, path, context);\n } else {\n result = migrateTypeScript(original, path, context);\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate eui-toolbar-menu → eui-toolbar-mega-menu in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n fileCount++;\n }\n });\n\n context.logger.info(`Migrated eui-toolbar-menu → eui-toolbar-mega-menu in ${fileCount} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: Edit[] = [];\n\n visitNodes(parsed.nodes, source, edits, filePath, context);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateTypeScript(source: string, filePath: string, context: SchematicContext): string {\n let result = migrateInlineTemplates(source, filePath, context);\n result = migrateImportsAndTypes(result, filePath, context);\n return result;\n}\n\nfunction migrateInlineTemplates(source: string, filePath: string, context: SchematicContext): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(OLD_TAG)) {\n ts.forEachChild(node, visit); return; \n}\n const migrated = migrateTemplate(rawTemplate, filePath, context);\n if (migrated !== rawTemplate) changes.push({ start, end, replacement: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return applyEdits(source, changes);\n}\n\nfunction migrateImportsAndTypes(source: string, filePath: string, context: SchematicContext): string {\n if (!source.includes(OLD_COMPONENT) && !source.includes(OLD_INTERFACE)) return source;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Track if EuiMenuItem is already imported from @eui/core\n let hasEuiMenuItemImport = false;\n\n // First pass: analyze imports\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const moduleSpec = (stmt.moduleSpecifier as ts.StringLiteral).text;\n const namedBindings = stmt.importClause?.namedBindings;\n if (!namedBindings || !ts.isNamedImports(namedBindings)) continue;\n\n for (const specifier of namedBindings.elements) {\n if (specifier.name.text === NEW_INTERFACE && moduleSpec === NEW_INTERFACE_PATH) {\n hasEuiMenuItemImport = true;\n }\n }\n }\n\n // Second pass: collect edits for import declarations\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const namedBindings = stmt.importClause?.namedBindings;\n if (!namedBindings || !ts.isNamedImports(namedBindings)) continue;\n\n const moduleSpec = stmt.moduleSpecifier as ts.StringLiteral;\n const specifiers = namedBindings.elements;\n const hasComponent = specifiers.some((s) => s.name.text === OLD_COMPONENT);\n const hasInterface = specifiers.some((s) => s.name.text === OLD_INTERFACE);\n\n if (hasComponent && hasInterface) {\n // Both are in the same import → must split into two different paths\n const others = specifiers.filter((s) => s.name.text !== OLD_COMPONENT && s.name.text !== OLD_INTERFACE);\n const lines: string[] = [];\n lines.push(`import { ${NEW_COMPONENT} } from '${NEW_COMPONENT_PATH}';`);\n if (!hasEuiMenuItemImport) {\n lines.push(`import { ${NEW_INTERFACE} } from '${NEW_INTERFACE_PATH}';`);\n }\n if (others.length > 0) {\n const otherNames = others.map((s) => s.name.text).join(', ');\n lines.push(`import { ${otherNames} } from '${moduleSpec.text}';`);\n }\n edits.push({\n start: stmt.getStart(sourceFile),\n end: stmt.getEnd(),\n replacement: lines.join('\\n'),\n });\n } else if (hasComponent) {\n edits.push({\n start: moduleSpec.getStart(sourceFile) + 1,\n end: moduleSpec.getEnd() - 1,\n replacement: NEW_COMPONENT_PATH,\n });\n for (const specifier of specifiers) {\n if (specifier.name.text === OLD_COMPONENT) {\n edits.push({\n start: specifier.name.getStart(sourceFile),\n end: specifier.name.getEnd(),\n replacement: NEW_COMPONENT,\n });\n }\n }\n } else if (hasInterface) {\n if (hasEuiMenuItemImport) {\n removeImportSpecifier(namedBindings, specifiers.find((s) => s.name.text === OLD_INTERFACE)!, sourceFile, edits);\n } else {\n edits.push({\n start: moduleSpec.getStart(sourceFile) + 1,\n end: moduleSpec.getEnd() - 1,\n replacement: NEW_INTERFACE_PATH,\n });\n for (const specifier of specifiers) {\n if (specifier.name.text === OLD_INTERFACE) {\n edits.push({\n start: specifier.name.getStart(sourceFile),\n end: specifier.name.getEnd(),\n replacement: NEW_INTERFACE,\n });\n }\n }\n }\n }\n }\n\n // Third pass: rename identifier references in non-import positions\n const visitRefs = (node: ts.Node): void => {\n if (ts.isImportDeclaration(node)) return; // skip imports (already handled)\n if (ts.isIdentifier(node)) {\n if (node.text === OLD_COMPONENT) {\n edits.push({ start: node.getStart(sourceFile), end: node.getEnd(), replacement: NEW_COMPONENT });\n }\n if (node.text === OLD_INTERFACE) {\n edits.push({ start: node.getStart(sourceFile), end: node.getEnd(), replacement: NEW_INTERFACE });\n }\n }\n ts.forEachChild(node, visitRefs);\n };\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) {\n visitRefs(stmt);\n }\n }\n\n // Warn about ToolbarItem-specific properties\n warnRemovedProperties(sourceFile, filePath, context);\n\n return applyEdits(source, edits);\n}\n\nfunction removeImportSpecifier(\n namedImports: ts.NamedImports,\n specifier: ts.ImportSpecifier,\n sourceFile: ts.SourceFile,\n edits: Edit[],\n): void {\n const elements = namedImports.elements;\n if (elements.length === 1) {\n // Remove the entire import declaration\n const importDecl = namedImports.parent.parent;\n edits.push({\n start: importDecl.getStart(sourceFile),\n end: importDecl.getEnd(),\n replacement: '',\n });\n } else {\n // Remove just this specifier with surrounding comma/whitespace\n const idx = elements.indexOf(specifier);\n let start: number;\n let end: number;\n if (idx < elements.length - 1) {\n start = specifier.getStart(sourceFile);\n end = elements[idx + 1].getStart(sourceFile);\n } else {\n start = elements[idx - 1].getEnd();\n end = specifier.getEnd();\n }\n edits.push({ start, end, replacement: '' });\n }\n}\n\nfunction warnRemovedProperties(sourceFile: ts.SourceFile, filePath: string, context: SchematicContext): void {\n const deprecated = ['isHome', 'isSeparator'];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && deprecated.includes(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"${node.name.text}\" was part of ToolbarItem but does not exist on EuiMenuItem. Review manually.`,\n );\n }\n if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && deprecated.includes(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"${node.name.text}\" was part of ToolbarItem but does not exist on EuiMenuItem. Review manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n}\n\nfunction visitNodes(nodes: TmplAstNode[], source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === OLD_TAG) {\n collectTagRenames(node, source, edits);\n collectOutputRemovals(node, source, edits, filePath, context);\n }\n visitNodes(node.children, source, edits, filePath, context);\n }\n }\n}\n\nfunction collectTagRenames(element: TmplAstElement, source: string, edits: Edit[]): void {\n // Rename opening tag\n const openStart = element.startSourceSpan.start.offset + 1; // skip '<'\n edits.push({ start: openStart, end: openStart + OLD_TAG.length, replacement: NEW_TAG });\n\n // Rename closing tag\n if (element.endSourceSpan) {\n const closeStart = element.endSourceSpan.start.offset + 2; // skip '</'\n edits.push({ start: closeStart, end: closeStart + OLD_TAG.length, replacement: NEW_TAG });\n }\n}\n\nfunction collectOutputRemovals(\n element: TmplAstElement,\n source: string,\n edits: Edit[],\n filePath: string,\n context: SchematicContext,\n): void {\n for (const output of element.outputs) {\n if (output.name === REMOVED_OUTPUT) {\n let start = output.sourceSpan.start.offset;\n // Remove leading whitespace\n while (start > 0 && (source[start - 1] === ' ' || source[start - 1] === '\\t')) {\n start--;\n }\n edits.push({ start, end: output.sourceSpan.end.offset, replacement: '' });\n\n const { line } = element.startSourceSpan.start;\n context.logger.warn(\n `${filePath}:${line + 1} - \"(menuItemClick)\" has been removed. There is no equivalent on eui-toolbar-mega-menu.`,\n );\n }\n }\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n // Deduplicate edits at same position (e.g. module path edits when both Component and ToolbarItem are from same source)\n const unique = deduplicateEdits(edits);\n let result = source;\n for (const edit of unique.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction deduplicateEdits(edits: Edit[]): Edit[] {\n const seen = new Map<string, Edit>();\n for (const edit of edits) {\n const key = `${edit.start}:${edit.end}`;\n // Last wins for same range\n seen.set(key, edit);\n }\n return Array.from(seen.values());\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
3014
|
+
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface TextChange {\n start: number;\n end: number;\n text: string;\n}\n\ninterface MigrationResult {\n content: string;\n migrated: number;\n skipped: number;\n}\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst OLD_LABEL = 'eui-tab-label';\nconst OLD_SUB_LABEL = 'euiTabSubLabel';\nconst OLD_CONTENT = 'eui-tab-content';\nconst NEW_HEADER = 'eui-tab-header';\nconst NEW_HEADER_LABEL = 'eui-tab-header-label';\nconst NEW_HEADER_SUB_LABEL = 'eui-tab-header-sub-label';\nconst NEW_BODY = 'eui-tab-body';\n\nexport function migrateEuiTabs(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let migrated = 0;\n let skipped = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) {\n return;\n }\n\n const original = buffer.toString('utf-8');\n const result = path.endsWith('.html')\n ? migrateTemplate(original, path, context)\n : migrateInlineTemplates(original, path, context);\n\n migrated += result.migrated;\n skipped += result.skipped;\n\n if (result.content !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate ${result.migrated} tab block(s) in ${path}`);\n } else {\n tree.overwrite(path, result.content);\n }\n }\n });\n\n context.logger.info(`Migrated ${migrated} EUI tab template block(s).`);\n if (skipped > 0) {\n context.logger.warn(`Skipped ${skipped} malformed EUI tab template block(s).`);\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n\n return tree;\n };\n}\n\nfunction migrateInlineTemplates(source: string, filePath: string, context: SchematicContext): MigrationResult {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: TextChange[] = [];\n let migrated = 0;\n let skipped = 0;\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const initializer = unwrapExpression(node.initializer);\n\n if (ts.isStringLiteral(initializer) || ts.isNoSubstitutionTemplateLiteral(initializer)) {\n const start = initializer.getStart(sourceFile) + 1;\n const end = initializer.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n const result = migrateTemplate(rawTemplate, `${filePath}@inline-template`, context);\n\n migrated += result.migrated;\n skipped += result.skipped;\n\n if (result.content !== rawTemplate) {\n changes.push({ start, end, text: result.content });\n }\n } else if (ts.isTemplateExpression(initializer)) {\n context.logger.warn(`Skipping interpolated inline template in ${filePath}.`);\n skipped++;\n }\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return {\n content: applyChanges(source, changes),\n migrated,\n skipped,\n };\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (\n (ts.isIdentifier(name) && name.text === 'template') ||\n (ts.isStringLiteral(name) && name.text === 'template')\n );\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n\n return current;\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) {\n return false;\n }\n\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) {\n return false;\n }\n\n return (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): MigrationResult {\n const parsed = parseTemplate(source, filePath, { preserveWhitespaces: true });\n const changes: TextChange[] = [];\n let migrated = 0;\n let skipped = 0;\n\n for (const error of parsed.errors ?? []) {\n context.logger.warn(`Template parse warning in ${filePath}: ${error.msg}`);\n }\n\n for (const tab of findElements(parsed.nodes, 'eui-tab')) {\n const label = findDirectChild(tab, OLD_LABEL);\n const content = findDirectChild(tab, OLD_CONTENT);\n const hasOldMarkup = Boolean(label || content);\n const hasNewMarkup = Boolean(findDirectChild(tab, NEW_HEADER) || findDirectChild(tab, NEW_BODY));\n\n if (!hasOldMarkup || hasNewMarkup) {\n continue;\n }\n\n if (!label || !content) {\n context.logger.warn(`Skipping malformed <eui-tab> in ${filePath}.`);\n skipped++;\n continue;\n }\n\n changes.push({\n start: label.sourceSpan.start.offset,\n end: label.sourceSpan.end.offset,\n text: buildHeaderReplacement(source, label),\n });\n changes.push({\n start: content.sourceSpan.start.offset,\n end: content.sourceSpan.end.offset,\n text: buildBodyReplacement(source, content),\n });\n migrated++;\n }\n\n return {\n content: applyChanges(source, withoutOverlaps(changes)),\n migrated,\n skipped,\n };\n}\n\nfunction findElements(nodes: readonly TmplAstNode[], name: string): TmplAstElement[] {\n const matches: TmplAstElement[] = [];\n\n for (const node of nodes) {\n if (isElement(node)) {\n if (node.name === name) {\n matches.push(node);\n }\n matches.push(...findElements(node.children, name));\n }\n }\n\n return matches;\n}\n\nfunction findDirectChild(element: TmplAstElement, name: string): TmplAstElement | undefined {\n return element.children.find((child): child is TmplAstElement => isElement(child) && child.name === name);\n}\n\nfunction isElement(node: TmplAstNode): node is TmplAstElement {\n return node instanceof TmplAstElement;\n}\n\nfunction buildHeaderReplacement(source: string, label: TmplAstElement): string {\n const indent = getIndent(source, label.sourceSpan.start.offset);\n const labelAttributes = getAttributeText(source, label, OLD_LABEL);\n const subLabels = findElements(label.children, OLD_SUB_LABEL);\n const mainLabelContent = removeElementRanges(getInnerText(source, label), label, subLabels);\n const lines = [\n `<${NEW_HEADER}>`,\n `${indent} <${NEW_HEADER_LABEL}${labelAttributes}>`,\n ...formatInnerLines(mainLabelContent, `${indent} `),\n `${indent} </${NEW_HEADER_LABEL}>`,\n ];\n\n for (const subLabel of subLabels) {\n const subLabelAttributes = getAttributeText(source, subLabel, OLD_SUB_LABEL);\n lines.push(\n `${indent} <${NEW_HEADER_SUB_LABEL}${subLabelAttributes}>`,\n ...formatInnerLines(getInnerText(source, subLabel), `${indent} `),\n `${indent} </${NEW_HEADER_SUB_LABEL}>`,\n );\n }\n\n lines.push(`${indent}</${NEW_HEADER}>`);\n\n return lines.join('\\n');\n}\n\nfunction buildBodyReplacement(source: string, content: TmplAstElement): string {\n const indent = getIndent(source, content.sourceSpan.start.offset);\n const attributes = getAttributeText(source, content, OLD_CONTENT);\n const innerText = getInnerText(source, content);\n const trimmed = innerText.trim();\n\n if (trimmed && !trimmed.includes('\\n')) {\n return `<${NEW_BODY}${attributes}>${trimmed}</${NEW_BODY}>`;\n }\n\n return [\n `<${NEW_BODY}${attributes}>`,\n ...formatInnerLines(innerText, `${indent} `),\n `${indent}</${NEW_BODY}>`,\n ].join('\\n');\n}\n\nfunction getInnerText(source: string, element: TmplAstElement): string {\n if (!element.endSourceSpan) {\n return '';\n }\n\n return source.slice(element.startSourceSpan.end.offset, element.endSourceSpan.start.offset);\n}\n\nfunction removeElementRanges(source: string, parent: TmplAstElement, elements: readonly TmplAstElement[]): string {\n const parentContentStart = parent.startSourceSpan.end.offset;\n let result = source;\n\n for (const element of [...elements].sort((a, b) => b.sourceSpan.start.offset - a.sourceSpan.start.offset)) {\n const start = element.sourceSpan.start.offset - parentContentStart;\n const end = element.sourceSpan.end.offset - parentContentStart;\n result = result.slice(0, start) + result.slice(end);\n }\n\n return result;\n}\n\nfunction getAttributeText(source: string, element: TmplAstElement, tagName: string): string {\n const startTag = source.slice(element.startSourceSpan.start.offset, element.startSourceSpan.end.offset);\n const tagStart = startTag.indexOf(tagName);\n\n if (tagStart === -1) {\n return '';\n }\n\n const contentEnd = startTag.endsWith('/>') ? startTag.length - 2 : startTag.length - 1;\n return startTag.slice(tagStart + tagName.length, contentEnd).trimEnd();\n}\n\nfunction getIndent(source: string, offset: number): string {\n const lineStart = source.lastIndexOf('\\n', offset - 1) + 1;\n const prefix = source.slice(lineStart, offset);\n return prefix.match(/^\\s*/)?.[0] ?? '';\n}\n\nfunction formatInnerLines(source: string, indent: string): string[] {\n const trimmed = source.trim();\n\n if (!trimmed) {\n return [];\n }\n\n return trimmed.split(/\\r?\\n/).map((line) => `${indent}${line.trim()}`);\n}\n\nfunction withoutOverlaps(changes: TextChange[]): TextChange[] {\n const accepted: TextChange[] = [];\n\n for (const change of [...changes].sort((a, b) => a.start - b.start || b.end - a.end)) {\n if (!accepted.some((current) => change.start < current.end && current.start < change.end)) {\n accepted.push(change);\n }\n }\n\n return accepted;\n}\n\nfunction applyChanges(source: string, changes: readonly TextChange[]): string {\n let result = source;\n\n for (const change of [...changes].sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n\n return result;\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
3015
3015
|
"displayName": "Schema",
|
|
3016
3016
|
"properties": [
|
|
3017
3017
|
{
|
|
@@ -3023,7 +3023,7 @@
|
|
|
3023
3023
|
"indexKey": "",
|
|
3024
3024
|
"optional": true,
|
|
3025
3025
|
"description": "",
|
|
3026
|
-
"line":
|
|
3026
|
+
"line": 20,
|
|
3027
3027
|
"rawdescription": "\n"
|
|
3028
3028
|
},
|
|
3029
3029
|
{
|
|
@@ -3035,7 +3035,7 @@
|
|
|
3035
3035
|
"indexKey": "",
|
|
3036
3036
|
"optional": true,
|
|
3037
3037
|
"description": "",
|
|
3038
|
-
"line":
|
|
3038
|
+
"line": 19,
|
|
3039
3039
|
"rawdescription": "\n"
|
|
3040
3040
|
}
|
|
3041
3041
|
],
|
|
@@ -3053,12 +3053,12 @@
|
|
|
3053
3053
|
},
|
|
3054
3054
|
{
|
|
3055
3055
|
"name": "Schema",
|
|
3056
|
-
"id": "interface-Schema-
|
|
3057
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
3056
|
+
"id": "interface-Schema-e1cd02924eb82a618c71a0b26c081bdd020519d2699aa0e2dc98640c4e0f347c3649b967c5fc87543e41bbbfabd1304835850ccc38f40684d6521c242b2030ed-19",
|
|
3057
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
3058
3058
|
"deprecated": false,
|
|
3059
3059
|
"deprecationMessage": "",
|
|
3060
3060
|
"type": "interface",
|
|
3061
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface TextChange {\n start: number;\n end: number;\n text: string;\n}\n\ninterface MigrationResult {\n content: string;\n migrated: number;\n skipped: number;\n}\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst OLD_LABEL = 'eui-tab-label';\nconst OLD_SUB_LABEL = 'euiTabSubLabel';\nconst OLD_CONTENT = 'eui-tab-content';\nconst NEW_HEADER = 'eui-tab-header';\nconst NEW_HEADER_LABEL = 'eui-tab-header-label';\nconst NEW_HEADER_SUB_LABEL = 'eui-tab-header-sub-label';\nconst NEW_BODY = 'eui-tab-body';\n\nexport function migrateEuiTabs(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let migrated = 0;\n let skipped = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) {\n return;\n }\n\n const original = buffer.toString('utf-8');\n const result = path.endsWith('.html')\n ? migrateTemplate(original, path, context)\n : migrateInlineTemplates(original, path, context);\n\n migrated += result.migrated;\n skipped += result.skipped;\n\n if (result.content !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate ${result.migrated} tab block(s) in ${path}`);\n } else {\n tree.overwrite(path, result.content);\n }\n }\n });\n\n context.logger.info(`Migrated ${migrated} EUI tab template block(s).`);\n if (skipped > 0) {\n context.logger.warn(`Skipped ${skipped} malformed EUI tab template block(s).`);\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n\n return tree;\n };\n}\n\nfunction migrateInlineTemplates(source: string, filePath: string, context: SchematicContext): MigrationResult {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: TextChange[] = [];\n let migrated = 0;\n let skipped = 0;\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const initializer = unwrapExpression(node.initializer);\n\n if (ts.isStringLiteral(initializer) || ts.isNoSubstitutionTemplateLiteral(initializer)) {\n const start = initializer.getStart(sourceFile) + 1;\n const end = initializer.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n const result = migrateTemplate(rawTemplate, `${filePath}@inline-template`, context);\n\n migrated += result.migrated;\n skipped += result.skipped;\n\n if (result.content !== rawTemplate) {\n changes.push({ start, end, text: result.content });\n }\n } else if (ts.isTemplateExpression(initializer)) {\n context.logger.warn(`Skipping interpolated inline template in ${filePath}.`);\n skipped++;\n }\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return {\n content: applyChanges(source, changes),\n migrated,\n skipped,\n };\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (\n (ts.isIdentifier(name) && name.text === 'template') ||\n (ts.isStringLiteral(name) && name.text === 'template')\n );\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n\n return current;\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) {\n return false;\n }\n\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) {\n return false;\n }\n\n return (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): MigrationResult {\n const parsed = parseTemplate(source, filePath, { preserveWhitespaces: true });\n const changes: TextChange[] = [];\n let migrated = 0;\n let skipped = 0;\n\n for (const error of parsed.errors ?? []) {\n context.logger.warn(`Template parse warning in ${filePath}: ${error.msg}`);\n }\n\n for (const tab of findElements(parsed.nodes, 'eui-tab')) {\n const label = findDirectChild(tab, OLD_LABEL);\n const content = findDirectChild(tab, OLD_CONTENT);\n const hasOldMarkup = Boolean(label || content);\n const hasNewMarkup = Boolean(findDirectChild(tab, NEW_HEADER) || findDirectChild(tab, NEW_BODY));\n\n if (!hasOldMarkup || hasNewMarkup) {\n continue;\n }\n\n if (!label || !content) {\n context.logger.warn(`Skipping malformed <eui-tab> in ${filePath}.`);\n skipped++;\n continue;\n }\n\n changes.push({\n start: label.sourceSpan.start.offset,\n end: label.sourceSpan.end.offset,\n text: buildHeaderReplacement(source, label),\n });\n changes.push({\n start: content.sourceSpan.start.offset,\n end: content.sourceSpan.end.offset,\n text: buildBodyReplacement(source, content),\n });\n migrated++;\n }\n\n return {\n content: applyChanges(source, withoutOverlaps(changes)),\n migrated,\n skipped,\n };\n}\n\nfunction findElements(nodes: readonly TmplAstNode[], name: string): TmplAstElement[] {\n const matches: TmplAstElement[] = [];\n\n for (const node of nodes) {\n if (isElement(node)) {\n if (node.name === name) {\n matches.push(node);\n }\n matches.push(...findElements(node.children, name));\n }\n }\n\n return matches;\n}\n\nfunction findDirectChild(element: TmplAstElement, name: string): TmplAstElement | undefined {\n return element.children.find((child): child is TmplAstElement => isElement(child) && child.name === name);\n}\n\nfunction isElement(node: TmplAstNode): node is TmplAstElement {\n return node instanceof TmplAstElement;\n}\n\nfunction buildHeaderReplacement(source: string, label: TmplAstElement): string {\n const indent = getIndent(source, label.sourceSpan.start.offset);\n const labelAttributes = getAttributeText(source, label, OLD_LABEL);\n const subLabels = findElements(label.children, OLD_SUB_LABEL);\n const mainLabelContent = removeElementRanges(getInnerText(source, label), label, subLabels);\n const lines = [\n `<${NEW_HEADER}>`,\n `${indent} <${NEW_HEADER_LABEL}${labelAttributes}>`,\n ...formatInnerLines(mainLabelContent, `${indent} `),\n `${indent} </${NEW_HEADER_LABEL}>`,\n ];\n\n for (const subLabel of subLabels) {\n const subLabelAttributes = getAttributeText(source, subLabel, OLD_SUB_LABEL);\n lines.push(\n `${indent} <${NEW_HEADER_SUB_LABEL}${subLabelAttributes}>`,\n ...formatInnerLines(getInnerText(source, subLabel), `${indent} `),\n `${indent} </${NEW_HEADER_SUB_LABEL}>`,\n );\n }\n\n lines.push(`${indent}</${NEW_HEADER}>`);\n\n return lines.join('\\n');\n}\n\nfunction buildBodyReplacement(source: string, content: TmplAstElement): string {\n const indent = getIndent(source, content.sourceSpan.start.offset);\n const attributes = getAttributeText(source, content, OLD_CONTENT);\n const innerText = getInnerText(source, content);\n const trimmed = innerText.trim();\n\n if (trimmed && !trimmed.includes('\\n')) {\n return `<${NEW_BODY}${attributes}>${trimmed}</${NEW_BODY}>`;\n }\n\n return [\n `<${NEW_BODY}${attributes}>`,\n ...formatInnerLines(innerText, `${indent} `),\n `${indent}</${NEW_BODY}>`,\n ].join('\\n');\n}\n\nfunction getInnerText(source: string, element: TmplAstElement): string {\n if (!element.endSourceSpan) {\n return '';\n }\n\n return source.slice(element.startSourceSpan.end.offset, element.endSourceSpan.start.offset);\n}\n\nfunction removeElementRanges(source: string, parent: TmplAstElement, elements: readonly TmplAstElement[]): string {\n const parentContentStart = parent.startSourceSpan.end.offset;\n let result = source;\n\n for (const element of [...elements].sort((a, b) => b.sourceSpan.start.offset - a.sourceSpan.start.offset)) {\n const start = element.sourceSpan.start.offset - parentContentStart;\n const end = element.sourceSpan.end.offset - parentContentStart;\n result = result.slice(0, start) + result.slice(end);\n }\n\n return result;\n}\n\nfunction getAttributeText(source: string, element: TmplAstElement, tagName: string): string {\n const startTag = source.slice(element.startSourceSpan.start.offset, element.startSourceSpan.end.offset);\n const tagStart = startTag.indexOf(tagName);\n\n if (tagStart === -1) {\n return '';\n }\n\n const contentEnd = startTag.endsWith('/>') ? startTag.length - 2 : startTag.length - 1;\n return startTag.slice(tagStart + tagName.length, contentEnd).trimEnd();\n}\n\nfunction getIndent(source: string, offset: number): string {\n const lineStart = source.lastIndexOf('\\n', offset - 1) + 1;\n const prefix = source.slice(lineStart, offset);\n return prefix.match(/^\\s*/)?.[0] ?? '';\n}\n\nfunction formatInnerLines(source: string, indent: string): string[] {\n const trimmed = source.trim();\n\n if (!trimmed) {\n return [];\n }\n\n return trimmed.split(/\\r?\\n/).map((line) => `${indent}${line.trim()}`);\n}\n\nfunction withoutOverlaps(changes: TextChange[]): TextChange[] {\n const accepted: TextChange[] = [];\n\n for (const change of [...changes].sort((a, b) => a.start - b.start || b.end - a.end)) {\n if (!accepted.some((current) => change.start < current.end && current.start < change.end)) {\n accepted.push(change);\n }\n }\n\n return accepted;\n}\n\nfunction applyChanges(source: string, changes: readonly TextChange[]): string {\n let result = source;\n\n for (const change of [...changes].sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n\n return result;\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
3061
|
+
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\nconst OLD_TAG = 'eui-toolbar-menu';\nconst NEW_TAG = 'eui-toolbar-mega-menu';\nconst OLD_COMPONENT = 'EuiToolbarMenuComponent';\nconst NEW_COMPONENT = 'EuiToolbarMegaMenuComponent';\nconst OLD_INTERFACE = 'ToolbarItem';\nconst NEW_INTERFACE = 'EuiMenuItem';\nconst NEW_COMPONENT_PATH = '@eui/components/layout';\nconst NEW_INTERFACE_PATH = '@eui/core';\nconst REMOVED_OUTPUT = 'menuItemClick';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\nexport function migrateEuiToolbarMenu(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(OLD_TAG) && !original.includes(OLD_COMPONENT) && !original.includes(OLD_INTERFACE)) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n result = migrateTemplate(original, path, context);\n } else {\n result = migrateTypeScript(original, path, context);\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate eui-toolbar-menu → eui-toolbar-mega-menu in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n fileCount++;\n }\n });\n\n context.logger.info(`Migrated eui-toolbar-menu → eui-toolbar-mega-menu in ${fileCount} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: Edit[] = [];\n\n visitNodes(parsed.nodes, source, edits, filePath, context);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateTypeScript(source: string, filePath: string, context: SchematicContext): string {\n let result = migrateInlineTemplates(source, filePath, context);\n result = migrateImportsAndTypes(result, filePath, context);\n return result;\n}\n\nfunction migrateInlineTemplates(source: string, filePath: string, context: SchematicContext): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(OLD_TAG)) {\n ts.forEachChild(node, visit); return; \n}\n const migrated = migrateTemplate(rawTemplate, filePath, context);\n if (migrated !== rawTemplate) changes.push({ start, end, replacement: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return applyEdits(source, changes);\n}\n\nfunction migrateImportsAndTypes(source: string, filePath: string, context: SchematicContext): string {\n if (!source.includes(OLD_COMPONENT) && !source.includes(OLD_INTERFACE)) return source;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Track if EuiMenuItem is already imported from @eui/core\n let hasEuiMenuItemImport = false;\n\n // First pass: analyze imports\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const moduleSpec = (stmt.moduleSpecifier as ts.StringLiteral).text;\n const namedBindings = stmt.importClause?.namedBindings;\n if (!namedBindings || !ts.isNamedImports(namedBindings)) continue;\n\n for (const specifier of namedBindings.elements) {\n if (specifier.name.text === NEW_INTERFACE && moduleSpec === NEW_INTERFACE_PATH) {\n hasEuiMenuItemImport = true;\n }\n }\n }\n\n // Second pass: collect edits for import declarations\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const namedBindings = stmt.importClause?.namedBindings;\n if (!namedBindings || !ts.isNamedImports(namedBindings)) continue;\n\n const moduleSpec = stmt.moduleSpecifier as ts.StringLiteral;\n const specifiers = namedBindings.elements;\n const hasComponent = specifiers.some((s) => s.name.text === OLD_COMPONENT);\n const hasInterface = specifiers.some((s) => s.name.text === OLD_INTERFACE);\n\n if (hasComponent && hasInterface) {\n // Both are in the same import → must split into two different paths\n const others = specifiers.filter((s) => s.name.text !== OLD_COMPONENT && s.name.text !== OLD_INTERFACE);\n const lines: string[] = [];\n lines.push(`import { ${NEW_COMPONENT} } from '${NEW_COMPONENT_PATH}';`);\n if (!hasEuiMenuItemImport) {\n lines.push(`import { ${NEW_INTERFACE} } from '${NEW_INTERFACE_PATH}';`);\n }\n if (others.length > 0) {\n const otherNames = others.map((s) => s.name.text).join(', ');\n lines.push(`import { ${otherNames} } from '${moduleSpec.text}';`);\n }\n edits.push({\n start: stmt.getStart(sourceFile),\n end: stmt.getEnd(),\n replacement: lines.join('\\n'),\n });\n } else if (hasComponent) {\n edits.push({\n start: moduleSpec.getStart(sourceFile) + 1,\n end: moduleSpec.getEnd() - 1,\n replacement: NEW_COMPONENT_PATH,\n });\n for (const specifier of specifiers) {\n if (specifier.name.text === OLD_COMPONENT) {\n edits.push({\n start: specifier.name.getStart(sourceFile),\n end: specifier.name.getEnd(),\n replacement: NEW_COMPONENT,\n });\n }\n }\n } else if (hasInterface) {\n if (hasEuiMenuItemImport) {\n removeImportSpecifier(namedBindings, specifiers.find((s) => s.name.text === OLD_INTERFACE)!, sourceFile, edits);\n } else {\n edits.push({\n start: moduleSpec.getStart(sourceFile) + 1,\n end: moduleSpec.getEnd() - 1,\n replacement: NEW_INTERFACE_PATH,\n });\n for (const specifier of specifiers) {\n if (specifier.name.text === OLD_INTERFACE) {\n edits.push({\n start: specifier.name.getStart(sourceFile),\n end: specifier.name.getEnd(),\n replacement: NEW_INTERFACE,\n });\n }\n }\n }\n }\n }\n\n // Third pass: rename identifier references in non-import positions\n const visitRefs = (node: ts.Node): void => {\n if (ts.isImportDeclaration(node)) return; // skip imports (already handled)\n if (ts.isIdentifier(node)) {\n if (node.text === OLD_COMPONENT) {\n edits.push({ start: node.getStart(sourceFile), end: node.getEnd(), replacement: NEW_COMPONENT });\n }\n if (node.text === OLD_INTERFACE) {\n edits.push({ start: node.getStart(sourceFile), end: node.getEnd(), replacement: NEW_INTERFACE });\n }\n }\n ts.forEachChild(node, visitRefs);\n };\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) {\n visitRefs(stmt);\n }\n }\n\n // Warn about ToolbarItem-specific properties\n warnRemovedProperties(sourceFile, filePath, context);\n\n return applyEdits(source, edits);\n}\n\nfunction removeImportSpecifier(\n namedImports: ts.NamedImports,\n specifier: ts.ImportSpecifier,\n sourceFile: ts.SourceFile,\n edits: Edit[],\n): void {\n const elements = namedImports.elements;\n if (elements.length === 1) {\n // Remove the entire import declaration\n const importDecl = namedImports.parent.parent;\n edits.push({\n start: importDecl.getStart(sourceFile),\n end: importDecl.getEnd(),\n replacement: '',\n });\n } else {\n // Remove just this specifier with surrounding comma/whitespace\n const idx = elements.indexOf(specifier);\n let start: number;\n let end: number;\n if (idx < elements.length - 1) {\n start = specifier.getStart(sourceFile);\n end = elements[idx + 1].getStart(sourceFile);\n } else {\n start = elements[idx - 1].getEnd();\n end = specifier.getEnd();\n }\n edits.push({ start, end, replacement: '' });\n }\n}\n\nfunction warnRemovedProperties(sourceFile: ts.SourceFile, filePath: string, context: SchematicContext): void {\n const deprecated = ['isHome', 'isSeparator'];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && deprecated.includes(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"${node.name.text}\" was part of ToolbarItem but does not exist on EuiMenuItem. Review manually.`,\n );\n }\n if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && deprecated.includes(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"${node.name.text}\" was part of ToolbarItem but does not exist on EuiMenuItem. Review manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n}\n\nfunction visitNodes(nodes: TmplAstNode[], source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === OLD_TAG) {\n collectTagRenames(node, source, edits);\n collectOutputRemovals(node, source, edits, filePath, context);\n }\n visitNodes(node.children, source, edits, filePath, context);\n }\n }\n}\n\nfunction collectTagRenames(element: TmplAstElement, source: string, edits: Edit[]): void {\n // Rename opening tag\n const openStart = element.startSourceSpan.start.offset + 1; // skip '<'\n edits.push({ start: openStart, end: openStart + OLD_TAG.length, replacement: NEW_TAG });\n\n // Rename closing tag\n if (element.endSourceSpan) {\n const closeStart = element.endSourceSpan.start.offset + 2; // skip '</'\n edits.push({ start: closeStart, end: closeStart + OLD_TAG.length, replacement: NEW_TAG });\n }\n}\n\nfunction collectOutputRemovals(\n element: TmplAstElement,\n source: string,\n edits: Edit[],\n filePath: string,\n context: SchematicContext,\n): void {\n for (const output of element.outputs) {\n if (output.name === REMOVED_OUTPUT) {\n let start = output.sourceSpan.start.offset;\n // Remove leading whitespace\n while (start > 0 && (source[start - 1] === ' ' || source[start - 1] === '\\t')) {\n start--;\n }\n edits.push({ start, end: output.sourceSpan.end.offset, replacement: '' });\n\n const { line } = element.startSourceSpan.start;\n context.logger.warn(\n `${filePath}:${line + 1} - \"(menuItemClick)\" has been removed. There is no equivalent on eui-toolbar-mega-menu.`,\n );\n }\n }\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n // Deduplicate edits at same position (e.g. module path edits when both Component and ToolbarItem are from same source)\n const unique = deduplicateEdits(edits);\n let result = source;\n for (const edit of unique.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction deduplicateEdits(edits: Edit[]): Edit[] {\n const seen = new Map<string, Edit>();\n for (const edit of edits) {\n const key = `${edit.start}:${edit.end}`;\n // Last wins for same range\n seen.set(key, edit);\n }\n return Array.from(seen.values());\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
3062
3062
|
"displayName": "Schema",
|
|
3063
3063
|
"properties": [
|
|
3064
3064
|
{
|
|
@@ -3070,7 +3070,7 @@
|
|
|
3070
3070
|
"indexKey": "",
|
|
3071
3071
|
"optional": true,
|
|
3072
3072
|
"description": "",
|
|
3073
|
-
"line":
|
|
3073
|
+
"line": 18,
|
|
3074
3074
|
"rawdescription": "\n"
|
|
3075
3075
|
},
|
|
3076
3076
|
{
|
|
@@ -3082,7 +3082,7 @@
|
|
|
3082
3082
|
"indexKey": "",
|
|
3083
3083
|
"optional": true,
|
|
3084
3084
|
"description": "",
|
|
3085
|
-
"line":
|
|
3085
|
+
"line": 17,
|
|
3086
3086
|
"rawdescription": "\n"
|
|
3087
3087
|
}
|
|
3088
3088
|
],
|
|
@@ -22314,34 +22314,34 @@
|
|
|
22314
22314
|
"name": "COMPONENT_TAG",
|
|
22315
22315
|
"ctype": "miscellaneous",
|
|
22316
22316
|
"subtype": "variable",
|
|
22317
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
22317
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
22318
22318
|
"coverageIgnore": false,
|
|
22319
22319
|
"deprecated": false,
|
|
22320
22320
|
"deprecationMessage": "",
|
|
22321
22321
|
"type": "string",
|
|
22322
|
-
"defaultValue": "'eui-
|
|
22322
|
+
"defaultValue": "'eui-icon-svg'"
|
|
22323
22323
|
},
|
|
22324
22324
|
{
|
|
22325
22325
|
"name": "COMPONENT_TAG",
|
|
22326
22326
|
"ctype": "miscellaneous",
|
|
22327
22327
|
"subtype": "variable",
|
|
22328
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
22328
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
22329
22329
|
"coverageIgnore": false,
|
|
22330
22330
|
"deprecated": false,
|
|
22331
22331
|
"deprecationMessage": "",
|
|
22332
22332
|
"type": "string",
|
|
22333
|
-
"defaultValue": "'eui-icon-
|
|
22333
|
+
"defaultValue": "'eui-icon-toggle'"
|
|
22334
22334
|
},
|
|
22335
22335
|
{
|
|
22336
22336
|
"name": "COMPONENT_TAG",
|
|
22337
22337
|
"ctype": "miscellaneous",
|
|
22338
22338
|
"subtype": "variable",
|
|
22339
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
22339
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
22340
22340
|
"coverageIgnore": false,
|
|
22341
22341
|
"deprecated": false,
|
|
22342
22342
|
"deprecationMessage": "",
|
|
22343
22343
|
"type": "string",
|
|
22344
|
-
"defaultValue": "'eui-
|
|
22344
|
+
"defaultValue": "'eui-fieldset'"
|
|
22345
22345
|
},
|
|
22346
22346
|
{
|
|
22347
22347
|
"name": "CONFIG_TOKEN",
|
|
@@ -23279,7 +23279,7 @@
|
|
|
23279
23279
|
"name": "NEW_NAME",
|
|
23280
23280
|
"ctype": "miscellaneous",
|
|
23281
23281
|
"subtype": "variable",
|
|
23282
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
23282
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
23283
23283
|
"coverageIgnore": false,
|
|
23284
23284
|
"deprecated": false,
|
|
23285
23285
|
"deprecationMessage": "",
|
|
@@ -23290,7 +23290,7 @@
|
|
|
23290
23290
|
"name": "NEW_NAME",
|
|
23291
23291
|
"ctype": "miscellaneous",
|
|
23292
23292
|
"subtype": "variable",
|
|
23293
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
23293
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
23294
23294
|
"coverageIgnore": false,
|
|
23295
23295
|
"deprecated": false,
|
|
23296
23296
|
"deprecationMessage": "",
|
|
@@ -23424,23 +23424,23 @@
|
|
|
23424
23424
|
"name": "OLD_NAME",
|
|
23425
23425
|
"ctype": "miscellaneous",
|
|
23426
23426
|
"subtype": "variable",
|
|
23427
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
23427
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
23428
23428
|
"coverageIgnore": false,
|
|
23429
23429
|
"deprecated": false,
|
|
23430
23430
|
"deprecationMessage": "",
|
|
23431
23431
|
"type": "string",
|
|
23432
|
-
"defaultValue": "'
|
|
23432
|
+
"defaultValue": "'iconSet'"
|
|
23433
23433
|
},
|
|
23434
23434
|
{
|
|
23435
23435
|
"name": "OLD_NAME",
|
|
23436
23436
|
"ctype": "miscellaneous",
|
|
23437
23437
|
"subtype": "variable",
|
|
23438
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
23438
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
23439
23439
|
"coverageIgnore": false,
|
|
23440
23440
|
"deprecated": false,
|
|
23441
23441
|
"deprecationMessage": "",
|
|
23442
23442
|
"type": "string",
|
|
23443
|
-
"defaultValue": "'
|
|
23443
|
+
"defaultValue": "'iconSvgType'"
|
|
23444
23444
|
},
|
|
23445
23445
|
{
|
|
23446
23446
|
"name": "OLD_PIPE",
|
|
@@ -23593,23 +23593,23 @@
|
|
|
23593
23593
|
"name": "REMOVED_INPUTS",
|
|
23594
23594
|
"ctype": "miscellaneous",
|
|
23595
23595
|
"subtype": "variable",
|
|
23596
|
-
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
23596
|
+
"file": "packages/core/schematics/migrate-eui-chip-list/index.ts",
|
|
23597
23597
|
"coverageIgnore": false,
|
|
23598
23598
|
"deprecated": false,
|
|
23599
23599
|
"deprecationMessage": "",
|
|
23600
23600
|
"type": "unknown",
|
|
23601
|
-
"defaultValue": "new Set(['
|
|
23601
|
+
"defaultValue": "new Set(['maxVisibleChipsCount', 'isMaxVisibleChipsOpened', 'toggleLinkMoreLabel', 'toggleLinkLessLabel', 'isChipsSorted', 'chipsSortOrder'])"
|
|
23602
23602
|
},
|
|
23603
23603
|
{
|
|
23604
23604
|
"name": "REMOVED_INPUTS",
|
|
23605
23605
|
"ctype": "miscellaneous",
|
|
23606
23606
|
"subtype": "variable",
|
|
23607
|
-
"file": "packages/core/schematics/migrate-eui-chip
|
|
23607
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
23608
23608
|
"coverageIgnore": false,
|
|
23609
23609
|
"deprecated": false,
|
|
23610
23610
|
"deprecationMessage": "",
|
|
23611
23611
|
"type": "unknown",
|
|
23612
|
-
"defaultValue": "new Set(['
|
|
23612
|
+
"defaultValue": "new Set(['isSquared'])"
|
|
23613
23613
|
},
|
|
23614
23614
|
{
|
|
23615
23615
|
"name": "REMOVED_INPUTS",
|
|
@@ -24563,7 +24563,7 @@
|
|
|
24563
24563
|
},
|
|
24564
24564
|
{
|
|
24565
24565
|
"name": "applyEdits",
|
|
24566
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
24566
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
24567
24567
|
"ctype": "miscellaneous",
|
|
24568
24568
|
"subtype": "function",
|
|
24569
24569
|
"coverageIgnore": false,
|
|
@@ -24608,7 +24608,7 @@
|
|
|
24608
24608
|
},
|
|
24609
24609
|
{
|
|
24610
24610
|
"name": "applyEdits",
|
|
24611
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
24611
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
24612
24612
|
"ctype": "miscellaneous",
|
|
24613
24613
|
"subtype": "function",
|
|
24614
24614
|
"coverageIgnore": false,
|
|
@@ -24653,7 +24653,7 @@
|
|
|
24653
24653
|
},
|
|
24654
24654
|
{
|
|
24655
24655
|
"name": "applyEdits",
|
|
24656
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
24656
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
24657
24657
|
"ctype": "miscellaneous",
|
|
24658
24658
|
"subtype": "function",
|
|
24659
24659
|
"coverageIgnore": false,
|
|
@@ -24698,7 +24698,7 @@
|
|
|
24698
24698
|
},
|
|
24699
24699
|
{
|
|
24700
24700
|
"name": "applyEdits",
|
|
24701
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
24701
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
24702
24702
|
"ctype": "miscellaneous",
|
|
24703
24703
|
"subtype": "function",
|
|
24704
24704
|
"coverageIgnore": false,
|
|
@@ -24743,7 +24743,7 @@
|
|
|
24743
24743
|
},
|
|
24744
24744
|
{
|
|
24745
24745
|
"name": "applyEdits",
|
|
24746
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
24746
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
24747
24747
|
"ctype": "miscellaneous",
|
|
24748
24748
|
"subtype": "function",
|
|
24749
24749
|
"coverageIgnore": false,
|
|
@@ -26040,7 +26040,7 @@
|
|
|
26040
26040
|
},
|
|
26041
26041
|
{
|
|
26042
26042
|
"name": "collectRemovals",
|
|
26043
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
26043
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
26044
26044
|
"ctype": "miscellaneous",
|
|
26045
26045
|
"subtype": "function",
|
|
26046
26046
|
"coverageIgnore": false,
|
|
@@ -26056,6 +26056,12 @@
|
|
|
26056
26056
|
"deprecated": false,
|
|
26057
26057
|
"deprecationMessage": ""
|
|
26058
26058
|
},
|
|
26059
|
+
{
|
|
26060
|
+
"name": "source",
|
|
26061
|
+
"type": "string",
|
|
26062
|
+
"deprecated": false,
|
|
26063
|
+
"deprecationMessage": ""
|
|
26064
|
+
},
|
|
26059
26065
|
{
|
|
26060
26066
|
"name": "removals",
|
|
26061
26067
|
"deprecated": false,
|
|
@@ -26073,6 +26079,15 @@
|
|
|
26073
26079
|
"text": "param"
|
|
26074
26080
|
}
|
|
26075
26081
|
},
|
|
26082
|
+
{
|
|
26083
|
+
"name": "source",
|
|
26084
|
+
"type": "string",
|
|
26085
|
+
"deprecated": false,
|
|
26086
|
+
"deprecationMessage": "",
|
|
26087
|
+
"tagName": {
|
|
26088
|
+
"text": "param"
|
|
26089
|
+
}
|
|
26090
|
+
},
|
|
26076
26091
|
{
|
|
26077
26092
|
"name": "removals",
|
|
26078
26093
|
"deprecated": false,
|
|
@@ -26085,7 +26100,7 @@
|
|
|
26085
26100
|
},
|
|
26086
26101
|
{
|
|
26087
26102
|
"name": "collectRemovals",
|
|
26088
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
26103
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
26089
26104
|
"ctype": "miscellaneous",
|
|
26090
26105
|
"subtype": "function",
|
|
26091
26106
|
"coverageIgnore": false,
|
|
@@ -26101,12 +26116,6 @@
|
|
|
26101
26116
|
"deprecated": false,
|
|
26102
26117
|
"deprecationMessage": ""
|
|
26103
26118
|
},
|
|
26104
|
-
{
|
|
26105
|
-
"name": "source",
|
|
26106
|
-
"type": "string",
|
|
26107
|
-
"deprecated": false,
|
|
26108
|
-
"deprecationMessage": ""
|
|
26109
|
-
},
|
|
26110
26119
|
{
|
|
26111
26120
|
"name": "removals",
|
|
26112
26121
|
"deprecated": false,
|
|
@@ -26124,15 +26133,6 @@
|
|
|
26124
26133
|
"text": "param"
|
|
26125
26134
|
}
|
|
26126
26135
|
},
|
|
26127
|
-
{
|
|
26128
|
-
"name": "source",
|
|
26129
|
-
"type": "string",
|
|
26130
|
-
"deprecated": false,
|
|
26131
|
-
"deprecationMessage": "",
|
|
26132
|
-
"tagName": {
|
|
26133
|
-
"text": "param"
|
|
26134
|
-
}
|
|
26135
|
-
},
|
|
26136
26136
|
{
|
|
26137
26137
|
"name": "removals",
|
|
26138
26138
|
"deprecated": false,
|
|
@@ -26325,7 +26325,7 @@
|
|
|
26325
26325
|
},
|
|
26326
26326
|
{
|
|
26327
26327
|
"name": "collectRenames",
|
|
26328
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
26328
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
26329
26329
|
"ctype": "miscellaneous",
|
|
26330
26330
|
"subtype": "function",
|
|
26331
26331
|
"coverageIgnore": false,
|
|
@@ -26370,7 +26370,7 @@
|
|
|
26370
26370
|
},
|
|
26371
26371
|
{
|
|
26372
26372
|
"name": "collectRenames",
|
|
26373
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
26373
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
26374
26374
|
"ctype": "miscellaneous",
|
|
26375
26375
|
"subtype": "function",
|
|
26376
26376
|
"coverageIgnore": false,
|
|
@@ -26415,7 +26415,7 @@
|
|
|
26415
26415
|
},
|
|
26416
26416
|
{
|
|
26417
26417
|
"name": "collectRenames",
|
|
26418
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
26418
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
26419
26419
|
"ctype": "miscellaneous",
|
|
26420
26420
|
"subtype": "function",
|
|
26421
26421
|
"coverageIgnore": false,
|
|
@@ -29754,7 +29754,7 @@
|
|
|
29754
29754
|
},
|
|
29755
29755
|
{
|
|
29756
29756
|
"name": "isChipElement",
|
|
29757
|
-
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
29757
|
+
"file": "packages/core/schematics/migrate-eui-chip-list/index.ts",
|
|
29758
29758
|
"ctype": "miscellaneous",
|
|
29759
29759
|
"subtype": "function",
|
|
29760
29760
|
"coverageIgnore": false,
|
|
@@ -29786,7 +29786,7 @@
|
|
|
29786
29786
|
},
|
|
29787
29787
|
{
|
|
29788
29788
|
"name": "isChipElement",
|
|
29789
|
-
"file": "packages/core/schematics/migrate-eui-chip
|
|
29789
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
29790
29790
|
"ctype": "miscellaneous",
|
|
29791
29791
|
"subtype": "function",
|
|
29792
29792
|
"coverageIgnore": false,
|
|
@@ -29970,7 +29970,7 @@
|
|
|
29970
29970
|
},
|
|
29971
29971
|
{
|
|
29972
29972
|
"name": "isComponentMetadataProperty",
|
|
29973
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
29973
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
29974
29974
|
"ctype": "miscellaneous",
|
|
29975
29975
|
"subtype": "function",
|
|
29976
29976
|
"coverageIgnore": false,
|
|
@@ -30000,7 +30000,7 @@
|
|
|
30000
30000
|
},
|
|
30001
30001
|
{
|
|
30002
30002
|
"name": "isComponentMetadataProperty",
|
|
30003
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
30003
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
30004
30004
|
"ctype": "miscellaneous",
|
|
30005
30005
|
"subtype": "function",
|
|
30006
30006
|
"coverageIgnore": false,
|
|
@@ -30030,7 +30030,7 @@
|
|
|
30030
30030
|
},
|
|
30031
30031
|
{
|
|
30032
30032
|
"name": "isComponentMetadataProperty",
|
|
30033
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30033
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
30034
30034
|
"ctype": "miscellaneous",
|
|
30035
30035
|
"subtype": "function",
|
|
30036
30036
|
"coverageIgnore": false,
|
|
@@ -30060,7 +30060,7 @@
|
|
|
30060
30060
|
},
|
|
30061
30061
|
{
|
|
30062
30062
|
"name": "isComponentMetadataProperty",
|
|
30063
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30063
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
30064
30064
|
"ctype": "miscellaneous",
|
|
30065
30065
|
"subtype": "function",
|
|
30066
30066
|
"coverageIgnore": false,
|
|
@@ -30090,7 +30090,7 @@
|
|
|
30090
30090
|
},
|
|
30091
30091
|
{
|
|
30092
30092
|
"name": "isComponentMetadataProperty",
|
|
30093
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30093
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
30094
30094
|
"ctype": "miscellaneous",
|
|
30095
30095
|
"subtype": "function",
|
|
30096
30096
|
"coverageIgnore": false,
|
|
@@ -30120,7 +30120,7 @@
|
|
|
30120
30120
|
},
|
|
30121
30121
|
{
|
|
30122
30122
|
"name": "isComponentMetadataProperty",
|
|
30123
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30123
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
30124
30124
|
"ctype": "miscellaneous",
|
|
30125
30125
|
"subtype": "function",
|
|
30126
30126
|
"coverageIgnore": false,
|
|
@@ -30150,7 +30150,7 @@
|
|
|
30150
30150
|
},
|
|
30151
30151
|
{
|
|
30152
30152
|
"name": "isComponentMetadataProperty",
|
|
30153
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30153
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
30154
30154
|
"ctype": "miscellaneous",
|
|
30155
30155
|
"subtype": "function",
|
|
30156
30156
|
"coverageIgnore": false,
|
|
@@ -30515,7 +30515,7 @@
|
|
|
30515
30515
|
},
|
|
30516
30516
|
{
|
|
30517
30517
|
"name": "isTemplateProperty",
|
|
30518
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30518
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
30519
30519
|
"ctype": "miscellaneous",
|
|
30520
30520
|
"subtype": "function",
|
|
30521
30521
|
"coverageIgnore": false,
|
|
@@ -30545,7 +30545,7 @@
|
|
|
30545
30545
|
},
|
|
30546
30546
|
{
|
|
30547
30547
|
"name": "isTemplateProperty",
|
|
30548
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
30548
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
30549
30549
|
"ctype": "miscellaneous",
|
|
30550
30550
|
"subtype": "function",
|
|
30551
30551
|
"coverageIgnore": false,
|
|
@@ -30575,7 +30575,7 @@
|
|
|
30575
30575
|
},
|
|
30576
30576
|
{
|
|
30577
30577
|
"name": "isTemplateProperty",
|
|
30578
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30578
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
30579
30579
|
"ctype": "miscellaneous",
|
|
30580
30580
|
"subtype": "function",
|
|
30581
30581
|
"coverageIgnore": false,
|
|
@@ -30605,7 +30605,7 @@
|
|
|
30605
30605
|
},
|
|
30606
30606
|
{
|
|
30607
30607
|
"name": "isTemplateProperty",
|
|
30608
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30608
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
30609
30609
|
"ctype": "miscellaneous",
|
|
30610
30610
|
"subtype": "function",
|
|
30611
30611
|
"coverageIgnore": false,
|
|
@@ -30635,7 +30635,7 @@
|
|
|
30635
30635
|
},
|
|
30636
30636
|
{
|
|
30637
30637
|
"name": "isTemplateProperty",
|
|
30638
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30638
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
30639
30639
|
"ctype": "miscellaneous",
|
|
30640
30640
|
"subtype": "function",
|
|
30641
30641
|
"coverageIgnore": false,
|
|
@@ -30665,7 +30665,7 @@
|
|
|
30665
30665
|
},
|
|
30666
30666
|
{
|
|
30667
30667
|
"name": "isTemplateProperty",
|
|
30668
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30668
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
30669
30669
|
"ctype": "miscellaneous",
|
|
30670
30670
|
"subtype": "function",
|
|
30671
30671
|
"coverageIgnore": false,
|
|
@@ -30695,7 +30695,7 @@
|
|
|
30695
30695
|
},
|
|
30696
30696
|
{
|
|
30697
30697
|
"name": "isTemplateProperty",
|
|
30698
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30698
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
30699
30699
|
"ctype": "miscellaneous",
|
|
30700
30700
|
"subtype": "function",
|
|
30701
30701
|
"coverageIgnore": false,
|
|
@@ -32355,7 +32355,7 @@
|
|
|
32355
32355
|
},
|
|
32356
32356
|
{
|
|
32357
32357
|
"name": "migrateInlineTemplates",
|
|
32358
|
-
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
32358
|
+
"file": "packages/core/schematics/migrate-eui-chip-list/index.ts",
|
|
32359
32359
|
"ctype": "miscellaneous",
|
|
32360
32360
|
"subtype": "function",
|
|
32361
32361
|
"coverageIgnore": false,
|
|
@@ -32387,7 +32387,7 @@
|
|
|
32387
32387
|
},
|
|
32388
32388
|
{
|
|
32389
32389
|
"name": "migrateInlineTemplates",
|
|
32390
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32390
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
32391
32391
|
"ctype": "miscellaneous",
|
|
32392
32392
|
"subtype": "function",
|
|
32393
32393
|
"coverageIgnore": false,
|
|
@@ -32419,7 +32419,7 @@
|
|
|
32419
32419
|
},
|
|
32420
32420
|
{
|
|
32421
32421
|
"name": "migrateInlineTemplates",
|
|
32422
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32422
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
32423
32423
|
"ctype": "miscellaneous",
|
|
32424
32424
|
"subtype": "function",
|
|
32425
32425
|
"coverageIgnore": false,
|
|
@@ -32451,7 +32451,7 @@
|
|
|
32451
32451
|
},
|
|
32452
32452
|
{
|
|
32453
32453
|
"name": "migrateInlineTemplates",
|
|
32454
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32454
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
32455
32455
|
"ctype": "miscellaneous",
|
|
32456
32456
|
"subtype": "function",
|
|
32457
32457
|
"coverageIgnore": false,
|
|
@@ -32483,7 +32483,7 @@
|
|
|
32483
32483
|
},
|
|
32484
32484
|
{
|
|
32485
32485
|
"name": "migrateInlineTemplates",
|
|
32486
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32486
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
32487
32487
|
"ctype": "miscellaneous",
|
|
32488
32488
|
"subtype": "function",
|
|
32489
32489
|
"coverageIgnore": false,
|
|
@@ -32515,7 +32515,7 @@
|
|
|
32515
32515
|
},
|
|
32516
32516
|
{
|
|
32517
32517
|
"name": "migrateInlineTemplates",
|
|
32518
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
32518
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
32519
32519
|
"ctype": "miscellaneous",
|
|
32520
32520
|
"subtype": "function",
|
|
32521
32521
|
"coverageIgnore": false,
|
|
@@ -32547,7 +32547,7 @@
|
|
|
32547
32547
|
},
|
|
32548
32548
|
{
|
|
32549
32549
|
"name": "migrateInlineTemplates",
|
|
32550
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32550
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
32551
32551
|
"ctype": "miscellaneous",
|
|
32552
32552
|
"subtype": "function",
|
|
32553
32553
|
"coverageIgnore": false,
|
|
@@ -32643,7 +32643,7 @@
|
|
|
32643
32643
|
},
|
|
32644
32644
|
{
|
|
32645
32645
|
"name": "migrateInlineTemplates",
|
|
32646
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32646
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
32647
32647
|
"ctype": "miscellaneous",
|
|
32648
32648
|
"subtype": "function",
|
|
32649
32649
|
"coverageIgnore": false,
|
|
@@ -32672,7 +32672,7 @@
|
|
|
32672
32672
|
"deprecationMessage": ""
|
|
32673
32673
|
}
|
|
32674
32674
|
],
|
|
32675
|
-
"returnType": "
|
|
32675
|
+
"returnType": "MigrationResult",
|
|
32676
32676
|
"jsdoctags": [
|
|
32677
32677
|
{
|
|
32678
32678
|
"name": "source",
|
|
@@ -32705,7 +32705,7 @@
|
|
|
32705
32705
|
},
|
|
32706
32706
|
{
|
|
32707
32707
|
"name": "migrateInlineTemplates",
|
|
32708
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32708
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
32709
32709
|
"ctype": "miscellaneous",
|
|
32710
32710
|
"subtype": "function",
|
|
32711
32711
|
"coverageIgnore": false,
|
|
@@ -32734,7 +32734,7 @@
|
|
|
32734
32734
|
"deprecationMessage": ""
|
|
32735
32735
|
}
|
|
32736
32736
|
],
|
|
32737
|
-
"returnType": "
|
|
32737
|
+
"returnType": "string",
|
|
32738
32738
|
"jsdoctags": [
|
|
32739
32739
|
{
|
|
32740
32740
|
"name": "source",
|
|
@@ -32895,7 +32895,7 @@
|
|
|
32895
32895
|
},
|
|
32896
32896
|
{
|
|
32897
32897
|
"name": "migrateTemplate",
|
|
32898
|
-
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
32898
|
+
"file": "packages/core/schematics/migrate-eui-chip-list/index.ts",
|
|
32899
32899
|
"ctype": "miscellaneous",
|
|
32900
32900
|
"subtype": "function",
|
|
32901
32901
|
"coverageIgnore": false,
|
|
@@ -32927,7 +32927,7 @@
|
|
|
32927
32927
|
},
|
|
32928
32928
|
{
|
|
32929
32929
|
"name": "migrateTemplate",
|
|
32930
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32930
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
32931
32931
|
"ctype": "miscellaneous",
|
|
32932
32932
|
"subtype": "function",
|
|
32933
32933
|
"coverageIgnore": false,
|
|
@@ -32959,7 +32959,7 @@
|
|
|
32959
32959
|
},
|
|
32960
32960
|
{
|
|
32961
32961
|
"name": "migrateTemplate",
|
|
32962
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32962
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
32963
32963
|
"ctype": "miscellaneous",
|
|
32964
32964
|
"subtype": "function",
|
|
32965
32965
|
"coverageIgnore": false,
|
|
@@ -32991,7 +32991,7 @@
|
|
|
32991
32991
|
},
|
|
32992
32992
|
{
|
|
32993
32993
|
"name": "migrateTemplate",
|
|
32994
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32994
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
32995
32995
|
"ctype": "miscellaneous",
|
|
32996
32996
|
"subtype": "function",
|
|
32997
32997
|
"coverageIgnore": false,
|
|
@@ -33023,7 +33023,7 @@
|
|
|
33023
33023
|
},
|
|
33024
33024
|
{
|
|
33025
33025
|
"name": "migrateTemplate",
|
|
33026
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
33026
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
33027
33027
|
"ctype": "miscellaneous",
|
|
33028
33028
|
"subtype": "function",
|
|
33029
33029
|
"coverageIgnore": false,
|
|
@@ -33055,7 +33055,7 @@
|
|
|
33055
33055
|
},
|
|
33056
33056
|
{
|
|
33057
33057
|
"name": "migrateTemplate",
|
|
33058
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
33058
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
33059
33059
|
"ctype": "miscellaneous",
|
|
33060
33060
|
"subtype": "function",
|
|
33061
33061
|
"coverageIgnore": false,
|
|
@@ -33087,7 +33087,7 @@
|
|
|
33087
33087
|
},
|
|
33088
33088
|
{
|
|
33089
33089
|
"name": "migrateTemplate",
|
|
33090
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
33090
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
33091
33091
|
"ctype": "miscellaneous",
|
|
33092
33092
|
"subtype": "function",
|
|
33093
33093
|
"coverageIgnore": false,
|
|
@@ -33149,6 +33149,38 @@
|
|
|
33149
33149
|
}
|
|
33150
33150
|
]
|
|
33151
33151
|
},
|
|
33152
|
+
{
|
|
33153
|
+
"name": "migrateTemplate",
|
|
33154
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
33155
|
+
"ctype": "miscellaneous",
|
|
33156
|
+
"subtype": "function",
|
|
33157
|
+
"coverageIgnore": false,
|
|
33158
|
+
"deprecated": false,
|
|
33159
|
+
"deprecationMessage": "",
|
|
33160
|
+
"rawdescription": "",
|
|
33161
|
+
"description": "",
|
|
33162
|
+
"displayName": "migrateTemplate",
|
|
33163
|
+
"args": [
|
|
33164
|
+
{
|
|
33165
|
+
"name": "source",
|
|
33166
|
+
"type": "string",
|
|
33167
|
+
"deprecated": false,
|
|
33168
|
+
"deprecationMessage": ""
|
|
33169
|
+
}
|
|
33170
|
+
],
|
|
33171
|
+
"returnType": "string",
|
|
33172
|
+
"jsdoctags": [
|
|
33173
|
+
{
|
|
33174
|
+
"name": "source",
|
|
33175
|
+
"type": "string",
|
|
33176
|
+
"deprecated": false,
|
|
33177
|
+
"deprecationMessage": "",
|
|
33178
|
+
"tagName": {
|
|
33179
|
+
"text": "param"
|
|
33180
|
+
}
|
|
33181
|
+
}
|
|
33182
|
+
]
|
|
33183
|
+
},
|
|
33152
33184
|
{
|
|
33153
33185
|
"name": "migrateTemplate",
|
|
33154
33186
|
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
@@ -33213,39 +33245,7 @@
|
|
|
33213
33245
|
},
|
|
33214
33246
|
{
|
|
33215
33247
|
"name": "migrateTemplate",
|
|
33216
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
33217
|
-
"ctype": "miscellaneous",
|
|
33218
|
-
"subtype": "function",
|
|
33219
|
-
"coverageIgnore": false,
|
|
33220
|
-
"deprecated": false,
|
|
33221
|
-
"deprecationMessage": "",
|
|
33222
|
-
"rawdescription": "",
|
|
33223
|
-
"description": "",
|
|
33224
|
-
"displayName": "migrateTemplate",
|
|
33225
|
-
"args": [
|
|
33226
|
-
{
|
|
33227
|
-
"name": "source",
|
|
33228
|
-
"type": "string",
|
|
33229
|
-
"deprecated": false,
|
|
33230
|
-
"deprecationMessage": ""
|
|
33231
|
-
}
|
|
33232
|
-
],
|
|
33233
|
-
"returnType": "string",
|
|
33234
|
-
"jsdoctags": [
|
|
33235
|
-
{
|
|
33236
|
-
"name": "source",
|
|
33237
|
-
"type": "string",
|
|
33238
|
-
"deprecated": false,
|
|
33239
|
-
"deprecationMessage": "",
|
|
33240
|
-
"tagName": {
|
|
33241
|
-
"text": "param"
|
|
33242
|
-
}
|
|
33243
|
-
}
|
|
33244
|
-
]
|
|
33245
|
-
},
|
|
33246
|
-
{
|
|
33247
|
-
"name": "migrateTemplate",
|
|
33248
|
-
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
33248
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
33249
33249
|
"ctype": "miscellaneous",
|
|
33250
33250
|
"subtype": "function",
|
|
33251
33251
|
"coverageIgnore": false,
|
|
@@ -33274,7 +33274,7 @@
|
|
|
33274
33274
|
"deprecationMessage": ""
|
|
33275
33275
|
}
|
|
33276
33276
|
],
|
|
33277
|
-
"returnType": "
|
|
33277
|
+
"returnType": "MigrationResult",
|
|
33278
33278
|
"jsdoctags": [
|
|
33279
33279
|
{
|
|
33280
33280
|
"name": "source",
|
|
@@ -33307,7 +33307,7 @@
|
|
|
33307
33307
|
},
|
|
33308
33308
|
{
|
|
33309
33309
|
"name": "migrateTemplate",
|
|
33310
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
33310
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
33311
33311
|
"ctype": "miscellaneous",
|
|
33312
33312
|
"subtype": "function",
|
|
33313
33313
|
"coverageIgnore": false,
|
|
@@ -33336,7 +33336,7 @@
|
|
|
33336
33336
|
"deprecationMessage": ""
|
|
33337
33337
|
}
|
|
33338
33338
|
],
|
|
33339
|
-
"returnType": "
|
|
33339
|
+
"returnType": "string",
|
|
33340
33340
|
"jsdoctags": [
|
|
33341
33341
|
{
|
|
33342
33342
|
"name": "source",
|
|
@@ -35421,7 +35421,7 @@
|
|
|
35421
35421
|
},
|
|
35422
35422
|
{
|
|
35423
35423
|
"name": "unwrapExpression",
|
|
35424
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35424
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
35425
35425
|
"ctype": "miscellaneous",
|
|
35426
35426
|
"subtype": "function",
|
|
35427
35427
|
"coverageIgnore": false,
|
|
@@ -35451,7 +35451,7 @@
|
|
|
35451
35451
|
},
|
|
35452
35452
|
{
|
|
35453
35453
|
"name": "unwrapExpression",
|
|
35454
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
35454
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
35455
35455
|
"ctype": "miscellaneous",
|
|
35456
35456
|
"subtype": "function",
|
|
35457
35457
|
"coverageIgnore": false,
|
|
@@ -35481,7 +35481,7 @@
|
|
|
35481
35481
|
},
|
|
35482
35482
|
{
|
|
35483
35483
|
"name": "unwrapExpression",
|
|
35484
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35484
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
35485
35485
|
"ctype": "miscellaneous",
|
|
35486
35486
|
"subtype": "function",
|
|
35487
35487
|
"coverageIgnore": false,
|
|
@@ -35511,7 +35511,7 @@
|
|
|
35511
35511
|
},
|
|
35512
35512
|
{
|
|
35513
35513
|
"name": "unwrapExpression",
|
|
35514
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35514
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
35515
35515
|
"ctype": "miscellaneous",
|
|
35516
35516
|
"subtype": "function",
|
|
35517
35517
|
"coverageIgnore": false,
|
|
@@ -35541,7 +35541,7 @@
|
|
|
35541
35541
|
},
|
|
35542
35542
|
{
|
|
35543
35543
|
"name": "unwrapExpression",
|
|
35544
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35544
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
35545
35545
|
"ctype": "miscellaneous",
|
|
35546
35546
|
"subtype": "function",
|
|
35547
35547
|
"coverageIgnore": false,
|
|
@@ -35571,7 +35571,7 @@
|
|
|
35571
35571
|
},
|
|
35572
35572
|
{
|
|
35573
35573
|
"name": "unwrapExpression",
|
|
35574
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35574
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
35575
35575
|
"ctype": "miscellaneous",
|
|
35576
35576
|
"subtype": "function",
|
|
35577
35577
|
"coverageIgnore": false,
|
|
@@ -35601,7 +35601,7 @@
|
|
|
35601
35601
|
},
|
|
35602
35602
|
{
|
|
35603
35603
|
"name": "unwrapExpression",
|
|
35604
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35604
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
35605
35605
|
"ctype": "miscellaneous",
|
|
35606
35606
|
"subtype": "function",
|
|
35607
35607
|
"coverageIgnore": false,
|
|
@@ -36124,7 +36124,7 @@
|
|
|
36124
36124
|
},
|
|
36125
36125
|
{
|
|
36126
36126
|
"name": "visitDir",
|
|
36127
|
-
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
36127
|
+
"file": "packages/core/schematics/migrate-eui-chip-list/index.ts",
|
|
36128
36128
|
"ctype": "miscellaneous",
|
|
36129
36129
|
"subtype": "function",
|
|
36130
36130
|
"coverageIgnore": false,
|
|
@@ -36169,7 +36169,7 @@
|
|
|
36169
36169
|
},
|
|
36170
36170
|
{
|
|
36171
36171
|
"name": "visitDir",
|
|
36172
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36172
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
36173
36173
|
"ctype": "miscellaneous",
|
|
36174
36174
|
"subtype": "function",
|
|
36175
36175
|
"coverageIgnore": false,
|
|
@@ -36214,7 +36214,7 @@
|
|
|
36214
36214
|
},
|
|
36215
36215
|
{
|
|
36216
36216
|
"name": "visitDir",
|
|
36217
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36217
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
36218
36218
|
"ctype": "miscellaneous",
|
|
36219
36219
|
"subtype": "function",
|
|
36220
36220
|
"coverageIgnore": false,
|
|
@@ -36259,7 +36259,7 @@
|
|
|
36259
36259
|
},
|
|
36260
36260
|
{
|
|
36261
36261
|
"name": "visitDir",
|
|
36262
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36262
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
36263
36263
|
"ctype": "miscellaneous",
|
|
36264
36264
|
"subtype": "function",
|
|
36265
36265
|
"coverageIgnore": false,
|
|
@@ -36304,7 +36304,7 @@
|
|
|
36304
36304
|
},
|
|
36305
36305
|
{
|
|
36306
36306
|
"name": "visitDir",
|
|
36307
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36307
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
36308
36308
|
"ctype": "miscellaneous",
|
|
36309
36309
|
"subtype": "function",
|
|
36310
36310
|
"coverageIgnore": false,
|
|
@@ -36349,7 +36349,7 @@
|
|
|
36349
36349
|
},
|
|
36350
36350
|
{
|
|
36351
36351
|
"name": "visitDir",
|
|
36352
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
36352
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
36353
36353
|
"ctype": "miscellaneous",
|
|
36354
36354
|
"subtype": "function",
|
|
36355
36355
|
"coverageIgnore": false,
|
|
@@ -36394,7 +36394,7 @@
|
|
|
36394
36394
|
},
|
|
36395
36395
|
{
|
|
36396
36396
|
"name": "visitDir",
|
|
36397
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36397
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
36398
36398
|
"ctype": "miscellaneous",
|
|
36399
36399
|
"subtype": "function",
|
|
36400
36400
|
"coverageIgnore": false,
|
|
@@ -36484,7 +36484,7 @@
|
|
|
36484
36484
|
},
|
|
36485
36485
|
{
|
|
36486
36486
|
"name": "visitDir",
|
|
36487
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36487
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
36488
36488
|
"ctype": "miscellaneous",
|
|
36489
36489
|
"subtype": "function",
|
|
36490
36490
|
"coverageIgnore": false,
|
|
@@ -36529,7 +36529,7 @@
|
|
|
36529
36529
|
},
|
|
36530
36530
|
{
|
|
36531
36531
|
"name": "visitDir",
|
|
36532
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36532
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
36533
36533
|
"ctype": "miscellaneous",
|
|
36534
36534
|
"subtype": "function",
|
|
36535
36535
|
"coverageIgnore": false,
|
|
@@ -36574,7 +36574,7 @@
|
|
|
36574
36574
|
},
|
|
36575
36575
|
{
|
|
36576
36576
|
"name": "visitDir",
|
|
36577
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36577
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
36578
36578
|
"ctype": "miscellaneous",
|
|
36579
36579
|
"subtype": "function",
|
|
36580
36580
|
"coverageIgnore": false,
|
|
@@ -36619,7 +36619,7 @@
|
|
|
36619
36619
|
},
|
|
36620
36620
|
{
|
|
36621
36621
|
"name": "visitDir",
|
|
36622
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36622
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
36623
36623
|
"ctype": "miscellaneous",
|
|
36624
36624
|
"subtype": "function",
|
|
36625
36625
|
"coverageIgnore": false,
|
|
@@ -37016,7 +37016,7 @@
|
|
|
37016
37016
|
},
|
|
37017
37017
|
{
|
|
37018
37018
|
"name": "visitNodes",
|
|
37019
|
-
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
37019
|
+
"file": "packages/core/schematics/migrate-eui-chip-list/index.ts",
|
|
37020
37020
|
"ctype": "miscellaneous",
|
|
37021
37021
|
"subtype": "function",
|
|
37022
37022
|
"coverageIgnore": false,
|
|
@@ -37032,7 +37032,13 @@
|
|
|
37032
37032
|
"deprecationMessage": ""
|
|
37033
37033
|
},
|
|
37034
37034
|
{
|
|
37035
|
-
"name": "
|
|
37035
|
+
"name": "source",
|
|
37036
|
+
"type": "string",
|
|
37037
|
+
"deprecated": false,
|
|
37038
|
+
"deprecationMessage": ""
|
|
37039
|
+
},
|
|
37040
|
+
{
|
|
37041
|
+
"name": "edits",
|
|
37036
37042
|
"deprecated": false,
|
|
37037
37043
|
"deprecationMessage": ""
|
|
37038
37044
|
}
|
|
@@ -37048,7 +37054,16 @@
|
|
|
37048
37054
|
}
|
|
37049
37055
|
},
|
|
37050
37056
|
{
|
|
37051
|
-
"name": "
|
|
37057
|
+
"name": "source",
|
|
37058
|
+
"type": "string",
|
|
37059
|
+
"deprecated": false,
|
|
37060
|
+
"deprecationMessage": "",
|
|
37061
|
+
"tagName": {
|
|
37062
|
+
"text": "param"
|
|
37063
|
+
}
|
|
37064
|
+
},
|
|
37065
|
+
{
|
|
37066
|
+
"name": "edits",
|
|
37052
37067
|
"deprecated": false,
|
|
37053
37068
|
"deprecationMessage": "",
|
|
37054
37069
|
"tagName": {
|
|
@@ -37059,7 +37074,7 @@
|
|
|
37059
37074
|
},
|
|
37060
37075
|
{
|
|
37061
37076
|
"name": "visitNodes",
|
|
37062
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
37077
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
37063
37078
|
"ctype": "miscellaneous",
|
|
37064
37079
|
"subtype": "function",
|
|
37065
37080
|
"coverageIgnore": false,
|
|
@@ -37081,7 +37096,7 @@
|
|
|
37081
37096
|
"deprecationMessage": ""
|
|
37082
37097
|
},
|
|
37083
37098
|
{
|
|
37084
|
-
"name": "
|
|
37099
|
+
"name": "removals",
|
|
37085
37100
|
"deprecated": false,
|
|
37086
37101
|
"deprecationMessage": ""
|
|
37087
37102
|
}
|
|
@@ -37106,7 +37121,7 @@
|
|
|
37106
37121
|
}
|
|
37107
37122
|
},
|
|
37108
37123
|
{
|
|
37109
|
-
"name": "
|
|
37124
|
+
"name": "removals",
|
|
37110
37125
|
"deprecated": false,
|
|
37111
37126
|
"deprecationMessage": "",
|
|
37112
37127
|
"tagName": {
|
|
@@ -37117,7 +37132,7 @@
|
|
|
37117
37132
|
},
|
|
37118
37133
|
{
|
|
37119
37134
|
"name": "visitNodes",
|
|
37120
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
37135
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
37121
37136
|
"ctype": "miscellaneous",
|
|
37122
37137
|
"subtype": "function",
|
|
37123
37138
|
"coverageIgnore": false,
|
|
@@ -37133,13 +37148,7 @@
|
|
|
37133
37148
|
"deprecationMessage": ""
|
|
37134
37149
|
},
|
|
37135
37150
|
{
|
|
37136
|
-
"name": "
|
|
37137
|
-
"type": "string",
|
|
37138
|
-
"deprecated": false,
|
|
37139
|
-
"deprecationMessage": ""
|
|
37140
|
-
},
|
|
37141
|
-
{
|
|
37142
|
-
"name": "removals",
|
|
37151
|
+
"name": "edits",
|
|
37143
37152
|
"deprecated": false,
|
|
37144
37153
|
"deprecationMessage": ""
|
|
37145
37154
|
}
|
|
@@ -37155,16 +37164,7 @@
|
|
|
37155
37164
|
}
|
|
37156
37165
|
},
|
|
37157
37166
|
{
|
|
37158
|
-
"name": "
|
|
37159
|
-
"type": "string",
|
|
37160
|
-
"deprecated": false,
|
|
37161
|
-
"deprecationMessage": "",
|
|
37162
|
-
"tagName": {
|
|
37163
|
-
"text": "param"
|
|
37164
|
-
}
|
|
37165
|
-
},
|
|
37166
|
-
{
|
|
37167
|
-
"name": "removals",
|
|
37167
|
+
"name": "edits",
|
|
37168
37168
|
"deprecated": false,
|
|
37169
37169
|
"deprecationMessage": "",
|
|
37170
37170
|
"tagName": {
|
|
@@ -37175,7 +37175,7 @@
|
|
|
37175
37175
|
},
|
|
37176
37176
|
{
|
|
37177
37177
|
"name": "visitNodes",
|
|
37178
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
37178
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
37179
37179
|
"ctype": "miscellaneous",
|
|
37180
37180
|
"subtype": "function",
|
|
37181
37181
|
"coverageIgnore": false,
|
|
@@ -37218,7 +37218,7 @@
|
|
|
37218
37218
|
},
|
|
37219
37219
|
{
|
|
37220
37220
|
"name": "visitNodes",
|
|
37221
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
37221
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
37222
37222
|
"ctype": "miscellaneous",
|
|
37223
37223
|
"subtype": "function",
|
|
37224
37224
|
"coverageIgnore": false,
|
|
@@ -37234,7 +37234,7 @@
|
|
|
37234
37234
|
"deprecationMessage": ""
|
|
37235
37235
|
},
|
|
37236
37236
|
{
|
|
37237
|
-
"name": "
|
|
37237
|
+
"name": "removals",
|
|
37238
37238
|
"deprecated": false,
|
|
37239
37239
|
"deprecationMessage": ""
|
|
37240
37240
|
}
|
|
@@ -37250,7 +37250,7 @@
|
|
|
37250
37250
|
}
|
|
37251
37251
|
},
|
|
37252
37252
|
{
|
|
37253
|
-
"name": "
|
|
37253
|
+
"name": "removals",
|
|
37254
37254
|
"deprecated": false,
|
|
37255
37255
|
"deprecationMessage": "",
|
|
37256
37256
|
"tagName": {
|
|
@@ -37261,7 +37261,7 @@
|
|
|
37261
37261
|
},
|
|
37262
37262
|
{
|
|
37263
37263
|
"name": "visitNodes",
|
|
37264
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
37264
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
37265
37265
|
"ctype": "miscellaneous",
|
|
37266
37266
|
"subtype": "function",
|
|
37267
37267
|
"coverageIgnore": false,
|
|
@@ -37304,7 +37304,7 @@
|
|
|
37304
37304
|
},
|
|
37305
37305
|
{
|
|
37306
37306
|
"name": "visitNodes",
|
|
37307
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
37307
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
37308
37308
|
"ctype": "miscellaneous",
|
|
37309
37309
|
"subtype": "function",
|
|
37310
37310
|
"coverageIgnore": false,
|
|
@@ -39124,93 +39124,93 @@
|
|
|
39124
39124
|
"defaultValue": "'onEditorChanged'"
|
|
39125
39125
|
}
|
|
39126
39126
|
],
|
|
39127
|
-
"packages/core/schematics/migrate-eui-
|
|
39127
|
+
"packages/core/schematics/migrate-eui-icon-svg/index.ts": [
|
|
39128
39128
|
{
|
|
39129
39129
|
"name": "COMPONENT_TAG",
|
|
39130
39130
|
"ctype": "miscellaneous",
|
|
39131
39131
|
"subtype": "variable",
|
|
39132
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
39132
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
39133
39133
|
"coverageIgnore": false,
|
|
39134
39134
|
"deprecated": false,
|
|
39135
39135
|
"deprecationMessage": "",
|
|
39136
39136
|
"type": "string",
|
|
39137
|
-
"defaultValue": "'eui-
|
|
39137
|
+
"defaultValue": "'eui-icon-svg'"
|
|
39138
39138
|
},
|
|
39139
39139
|
{
|
|
39140
|
-
"name": "
|
|
39140
|
+
"name": "INPUT_RENAMES",
|
|
39141
39141
|
"ctype": "miscellaneous",
|
|
39142
39142
|
"subtype": "variable",
|
|
39143
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
39143
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
39144
39144
|
"coverageIgnore": false,
|
|
39145
39145
|
"deprecated": false,
|
|
39146
39146
|
"deprecationMessage": "",
|
|
39147
|
-
"type": "
|
|
39148
|
-
"defaultValue": "'
|
|
39147
|
+
"type": "unknown",
|
|
39148
|
+
"defaultValue": "new Map([\n ['variant', 'fillColor'],\n ['aria-label', 'ariaLabel'],\n])"
|
|
39149
39149
|
},
|
|
39150
39150
|
{
|
|
39151
|
-
"name": "
|
|
39151
|
+
"name": "TS_PROPERTY_RENAMES",
|
|
39152
39152
|
"ctype": "miscellaneous",
|
|
39153
39153
|
"subtype": "variable",
|
|
39154
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
39154
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
39155
39155
|
"coverageIgnore": false,
|
|
39156
39156
|
"deprecated": false,
|
|
39157
39157
|
"deprecationMessage": "",
|
|
39158
|
-
"type": "
|
|
39159
|
-
"defaultValue": "'
|
|
39158
|
+
"type": "unknown",
|
|
39159
|
+
"defaultValue": "new Map([\n ['variant', 'fillColor'],\n])"
|
|
39160
39160
|
}
|
|
39161
39161
|
],
|
|
39162
|
-
"packages/core/schematics/migrate-eui-icon-
|
|
39162
|
+
"packages/core/schematics/migrate-eui-icon-toggle/index.ts": [
|
|
39163
39163
|
{
|
|
39164
39164
|
"name": "COMPONENT_TAG",
|
|
39165
39165
|
"ctype": "miscellaneous",
|
|
39166
39166
|
"subtype": "variable",
|
|
39167
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
39167
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
39168
39168
|
"coverageIgnore": false,
|
|
39169
39169
|
"deprecated": false,
|
|
39170
39170
|
"deprecationMessage": "",
|
|
39171
39171
|
"type": "string",
|
|
39172
|
-
"defaultValue": "'eui-icon-
|
|
39172
|
+
"defaultValue": "'eui-icon-toggle'"
|
|
39173
39173
|
},
|
|
39174
39174
|
{
|
|
39175
|
-
"name": "
|
|
39175
|
+
"name": "NEW_NAME",
|
|
39176
39176
|
"ctype": "miscellaneous",
|
|
39177
39177
|
"subtype": "variable",
|
|
39178
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
39178
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
39179
39179
|
"coverageIgnore": false,
|
|
39180
39180
|
"deprecated": false,
|
|
39181
39181
|
"deprecationMessage": "",
|
|
39182
|
-
"type": "
|
|
39183
|
-
"defaultValue": "
|
|
39182
|
+
"type": "string",
|
|
39183
|
+
"defaultValue": "'iconSvgName'"
|
|
39184
39184
|
},
|
|
39185
39185
|
{
|
|
39186
|
-
"name": "
|
|
39186
|
+
"name": "OLD_NAME",
|
|
39187
39187
|
"ctype": "miscellaneous",
|
|
39188
39188
|
"subtype": "variable",
|
|
39189
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
39189
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
39190
39190
|
"coverageIgnore": false,
|
|
39191
39191
|
"deprecated": false,
|
|
39192
39192
|
"deprecationMessage": "",
|
|
39193
|
-
"type": "
|
|
39194
|
-
"defaultValue": "
|
|
39193
|
+
"type": "string",
|
|
39194
|
+
"defaultValue": "'iconSet'"
|
|
39195
39195
|
}
|
|
39196
39196
|
],
|
|
39197
|
-
"packages/core/schematics/migrate-eui-
|
|
39197
|
+
"packages/core/schematics/migrate-eui-fieldset/index.ts": [
|
|
39198
39198
|
{
|
|
39199
39199
|
"name": "COMPONENT_TAG",
|
|
39200
39200
|
"ctype": "miscellaneous",
|
|
39201
39201
|
"subtype": "variable",
|
|
39202
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
39202
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
39203
39203
|
"coverageIgnore": false,
|
|
39204
39204
|
"deprecated": false,
|
|
39205
39205
|
"deprecationMessage": "",
|
|
39206
39206
|
"type": "string",
|
|
39207
|
-
"defaultValue": "'eui-
|
|
39207
|
+
"defaultValue": "'eui-fieldset'"
|
|
39208
39208
|
},
|
|
39209
39209
|
{
|
|
39210
39210
|
"name": "NEW_NAME",
|
|
39211
39211
|
"ctype": "miscellaneous",
|
|
39212
39212
|
"subtype": "variable",
|
|
39213
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
39213
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
39214
39214
|
"coverageIgnore": false,
|
|
39215
39215
|
"deprecated": false,
|
|
39216
39216
|
"deprecationMessage": "",
|
|
@@ -39221,12 +39221,12 @@
|
|
|
39221
39221
|
"name": "OLD_NAME",
|
|
39222
39222
|
"ctype": "miscellaneous",
|
|
39223
39223
|
"subtype": "variable",
|
|
39224
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
39224
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
39225
39225
|
"coverageIgnore": false,
|
|
39226
39226
|
"deprecated": false,
|
|
39227
39227
|
"deprecationMessage": "",
|
|
39228
39228
|
"type": "string",
|
|
39229
|
-
"defaultValue": "'
|
|
39229
|
+
"defaultValue": "'iconSvgType'"
|
|
39230
39230
|
}
|
|
39231
39231
|
],
|
|
39232
39232
|
"packages/core/src/lib/helpers/event-helpers.ts": [
|
|
@@ -45993,10 +45993,10 @@
|
|
|
45993
45993
|
]
|
|
45994
45994
|
}
|
|
45995
45995
|
],
|
|
45996
|
-
"packages/core/schematics/migrate-eui-
|
|
45996
|
+
"packages/core/schematics/migrate-eui-icon-svg/index.ts": [
|
|
45997
45997
|
{
|
|
45998
45998
|
"name": "applyEdits",
|
|
45999
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
45999
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46000
46000
|
"ctype": "miscellaneous",
|
|
46001
46001
|
"subtype": "function",
|
|
46002
46002
|
"coverageIgnore": false,
|
|
@@ -46041,7 +46041,7 @@
|
|
|
46041
46041
|
},
|
|
46042
46042
|
{
|
|
46043
46043
|
"name": "collectRenames",
|
|
46044
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46044
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46045
46045
|
"ctype": "miscellaneous",
|
|
46046
46046
|
"subtype": "function",
|
|
46047
46047
|
"coverageIgnore": false,
|
|
@@ -46086,7 +46086,7 @@
|
|
|
46086
46086
|
},
|
|
46087
46087
|
{
|
|
46088
46088
|
"name": "isComponentMetadataProperty",
|
|
46089
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46089
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46090
46090
|
"ctype": "miscellaneous",
|
|
46091
46091
|
"subtype": "function",
|
|
46092
46092
|
"coverageIgnore": false,
|
|
@@ -46116,7 +46116,7 @@
|
|
|
46116
46116
|
},
|
|
46117
46117
|
{
|
|
46118
46118
|
"name": "isTemplateProperty",
|
|
46119
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46119
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46120
46120
|
"ctype": "miscellaneous",
|
|
46121
46121
|
"subtype": "function",
|
|
46122
46122
|
"coverageIgnore": false,
|
|
@@ -46145,8 +46145,8 @@
|
|
|
46145
46145
|
]
|
|
46146
46146
|
},
|
|
46147
46147
|
{
|
|
46148
|
-
"name": "
|
|
46149
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46148
|
+
"name": "migrateEuiIconSvg",
|
|
46149
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46150
46150
|
"ctype": "miscellaneous",
|
|
46151
46151
|
"subtype": "function",
|
|
46152
46152
|
"coverageIgnore": false,
|
|
@@ -46154,7 +46154,7 @@
|
|
|
46154
46154
|
"deprecationMessage": "",
|
|
46155
46155
|
"rawdescription": "",
|
|
46156
46156
|
"description": "",
|
|
46157
|
-
"displayName": "
|
|
46157
|
+
"displayName": "migrateEuiIconSvg",
|
|
46158
46158
|
"args": [
|
|
46159
46159
|
{
|
|
46160
46160
|
"name": "options",
|
|
@@ -46180,7 +46180,7 @@
|
|
|
46180
46180
|
},
|
|
46181
46181
|
{
|
|
46182
46182
|
"name": "migrateInlineTemplates",
|
|
46183
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46183
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46184
46184
|
"ctype": "miscellaneous",
|
|
46185
46185
|
"subtype": "function",
|
|
46186
46186
|
"coverageIgnore": false,
|
|
@@ -46212,7 +46212,7 @@
|
|
|
46212
46212
|
},
|
|
46213
46213
|
{
|
|
46214
46214
|
"name": "migrateTemplate",
|
|
46215
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46215
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46216
46216
|
"ctype": "miscellaneous",
|
|
46217
46217
|
"subtype": "function",
|
|
46218
46218
|
"coverageIgnore": false,
|
|
@@ -46242,9 +46242,41 @@
|
|
|
46242
46242
|
}
|
|
46243
46243
|
]
|
|
46244
46244
|
},
|
|
46245
|
+
{
|
|
46246
|
+
"name": "renameTsPropertyAccesses",
|
|
46247
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46248
|
+
"ctype": "miscellaneous",
|
|
46249
|
+
"subtype": "function",
|
|
46250
|
+
"coverageIgnore": false,
|
|
46251
|
+
"deprecated": false,
|
|
46252
|
+
"deprecationMessage": "",
|
|
46253
|
+
"rawdescription": "",
|
|
46254
|
+
"description": "",
|
|
46255
|
+
"displayName": "renameTsPropertyAccesses",
|
|
46256
|
+
"args": [
|
|
46257
|
+
{
|
|
46258
|
+
"name": "source",
|
|
46259
|
+
"type": "string",
|
|
46260
|
+
"deprecated": false,
|
|
46261
|
+
"deprecationMessage": ""
|
|
46262
|
+
}
|
|
46263
|
+
],
|
|
46264
|
+
"returnType": "string",
|
|
46265
|
+
"jsdoctags": [
|
|
46266
|
+
{
|
|
46267
|
+
"name": "source",
|
|
46268
|
+
"type": "string",
|
|
46269
|
+
"deprecated": false,
|
|
46270
|
+
"deprecationMessage": "",
|
|
46271
|
+
"tagName": {
|
|
46272
|
+
"text": "param"
|
|
46273
|
+
}
|
|
46274
|
+
}
|
|
46275
|
+
]
|
|
46276
|
+
},
|
|
46245
46277
|
{
|
|
46246
46278
|
"name": "unwrapExpression",
|
|
46247
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46279
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46248
46280
|
"ctype": "miscellaneous",
|
|
46249
46281
|
"subtype": "function",
|
|
46250
46282
|
"coverageIgnore": false,
|
|
@@ -46274,7 +46306,7 @@
|
|
|
46274
46306
|
},
|
|
46275
46307
|
{
|
|
46276
46308
|
"name": "visitDir",
|
|
46277
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46309
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46278
46310
|
"ctype": "miscellaneous",
|
|
46279
46311
|
"subtype": "function",
|
|
46280
46312
|
"coverageIgnore": false,
|
|
@@ -46319,7 +46351,7 @@
|
|
|
46319
46351
|
},
|
|
46320
46352
|
{
|
|
46321
46353
|
"name": "visitNodes",
|
|
46322
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46354
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
46323
46355
|
"ctype": "miscellaneous",
|
|
46324
46356
|
"subtype": "function",
|
|
46325
46357
|
"coverageIgnore": false,
|
|
@@ -46361,10 +46393,10 @@
|
|
|
46361
46393
|
]
|
|
46362
46394
|
}
|
|
46363
46395
|
],
|
|
46364
|
-
"packages/core/schematics/migrate-eui-icon-
|
|
46396
|
+
"packages/core/schematics/migrate-eui-icon-toggle/index.ts": [
|
|
46365
46397
|
{
|
|
46366
46398
|
"name": "applyEdits",
|
|
46367
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46399
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46368
46400
|
"ctype": "miscellaneous",
|
|
46369
46401
|
"subtype": "function",
|
|
46370
46402
|
"coverageIgnore": false,
|
|
@@ -46409,7 +46441,7 @@
|
|
|
46409
46441
|
},
|
|
46410
46442
|
{
|
|
46411
46443
|
"name": "collectRenames",
|
|
46412
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46444
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46413
46445
|
"ctype": "miscellaneous",
|
|
46414
46446
|
"subtype": "function",
|
|
46415
46447
|
"coverageIgnore": false,
|
|
@@ -46454,7 +46486,7 @@
|
|
|
46454
46486
|
},
|
|
46455
46487
|
{
|
|
46456
46488
|
"name": "isComponentMetadataProperty",
|
|
46457
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46489
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46458
46490
|
"ctype": "miscellaneous",
|
|
46459
46491
|
"subtype": "function",
|
|
46460
46492
|
"coverageIgnore": false,
|
|
@@ -46484,7 +46516,7 @@
|
|
|
46484
46516
|
},
|
|
46485
46517
|
{
|
|
46486
46518
|
"name": "isTemplateProperty",
|
|
46487
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46519
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46488
46520
|
"ctype": "miscellaneous",
|
|
46489
46521
|
"subtype": "function",
|
|
46490
46522
|
"coverageIgnore": false,
|
|
@@ -46513,8 +46545,8 @@
|
|
|
46513
46545
|
]
|
|
46514
46546
|
},
|
|
46515
46547
|
{
|
|
46516
|
-
"name": "
|
|
46517
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46548
|
+
"name": "migrateEuiIconToggle",
|
|
46549
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46518
46550
|
"ctype": "miscellaneous",
|
|
46519
46551
|
"subtype": "function",
|
|
46520
46552
|
"coverageIgnore": false,
|
|
@@ -46522,7 +46554,7 @@
|
|
|
46522
46554
|
"deprecationMessage": "",
|
|
46523
46555
|
"rawdescription": "",
|
|
46524
46556
|
"description": "",
|
|
46525
|
-
"displayName": "
|
|
46557
|
+
"displayName": "migrateEuiIconToggle",
|
|
46526
46558
|
"args": [
|
|
46527
46559
|
{
|
|
46528
46560
|
"name": "options",
|
|
@@ -46548,7 +46580,7 @@
|
|
|
46548
46580
|
},
|
|
46549
46581
|
{
|
|
46550
46582
|
"name": "migrateInlineTemplates",
|
|
46551
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46583
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46552
46584
|
"ctype": "miscellaneous",
|
|
46553
46585
|
"subtype": "function",
|
|
46554
46586
|
"coverageIgnore": false,
|
|
@@ -46580,7 +46612,7 @@
|
|
|
46580
46612
|
},
|
|
46581
46613
|
{
|
|
46582
46614
|
"name": "migrateTemplate",
|
|
46583
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46615
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46584
46616
|
"ctype": "miscellaneous",
|
|
46585
46617
|
"subtype": "function",
|
|
46586
46618
|
"coverageIgnore": false,
|
|
@@ -46612,7 +46644,7 @@
|
|
|
46612
46644
|
},
|
|
46613
46645
|
{
|
|
46614
46646
|
"name": "renameTsPropertyAccesses",
|
|
46615
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46647
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46616
46648
|
"ctype": "miscellaneous",
|
|
46617
46649
|
"subtype": "function",
|
|
46618
46650
|
"coverageIgnore": false,
|
|
@@ -46644,7 +46676,7 @@
|
|
|
46644
46676
|
},
|
|
46645
46677
|
{
|
|
46646
46678
|
"name": "unwrapExpression",
|
|
46647
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46679
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46648
46680
|
"ctype": "miscellaneous",
|
|
46649
46681
|
"subtype": "function",
|
|
46650
46682
|
"coverageIgnore": false,
|
|
@@ -46674,7 +46706,7 @@
|
|
|
46674
46706
|
},
|
|
46675
46707
|
{
|
|
46676
46708
|
"name": "visitDir",
|
|
46677
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46709
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46678
46710
|
"ctype": "miscellaneous",
|
|
46679
46711
|
"subtype": "function",
|
|
46680
46712
|
"coverageIgnore": false,
|
|
@@ -46719,7 +46751,7 @@
|
|
|
46719
46751
|
},
|
|
46720
46752
|
{
|
|
46721
46753
|
"name": "visitNodes",
|
|
46722
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
46754
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46723
46755
|
"ctype": "miscellaneous",
|
|
46724
46756
|
"subtype": "function",
|
|
46725
46757
|
"coverageIgnore": false,
|
|
@@ -46761,10 +46793,10 @@
|
|
|
46761
46793
|
]
|
|
46762
46794
|
}
|
|
46763
46795
|
],
|
|
46764
|
-
"packages/core/schematics/migrate-eui-
|
|
46796
|
+
"packages/core/schematics/migrate-eui-fieldset/index.ts": [
|
|
46765
46797
|
{
|
|
46766
46798
|
"name": "applyEdits",
|
|
46767
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46799
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
46768
46800
|
"ctype": "miscellaneous",
|
|
46769
46801
|
"subtype": "function",
|
|
46770
46802
|
"coverageIgnore": false,
|
|
@@ -46809,7 +46841,7 @@
|
|
|
46809
46841
|
},
|
|
46810
46842
|
{
|
|
46811
46843
|
"name": "collectRenames",
|
|
46812
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46844
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
46813
46845
|
"ctype": "miscellaneous",
|
|
46814
46846
|
"subtype": "function",
|
|
46815
46847
|
"coverageIgnore": false,
|
|
@@ -46854,7 +46886,7 @@
|
|
|
46854
46886
|
},
|
|
46855
46887
|
{
|
|
46856
46888
|
"name": "isComponentMetadataProperty",
|
|
46857
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46889
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
46858
46890
|
"ctype": "miscellaneous",
|
|
46859
46891
|
"subtype": "function",
|
|
46860
46892
|
"coverageIgnore": false,
|
|
@@ -46884,7 +46916,7 @@
|
|
|
46884
46916
|
},
|
|
46885
46917
|
{
|
|
46886
46918
|
"name": "isTemplateProperty",
|
|
46887
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46919
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
46888
46920
|
"ctype": "miscellaneous",
|
|
46889
46921
|
"subtype": "function",
|
|
46890
46922
|
"coverageIgnore": false,
|
|
@@ -46913,8 +46945,8 @@
|
|
|
46913
46945
|
]
|
|
46914
46946
|
},
|
|
46915
46947
|
{
|
|
46916
|
-
"name": "
|
|
46917
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46948
|
+
"name": "migrateEuiFieldset",
|
|
46949
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
46918
46950
|
"ctype": "miscellaneous",
|
|
46919
46951
|
"subtype": "function",
|
|
46920
46952
|
"coverageIgnore": false,
|
|
@@ -46922,7 +46954,7 @@
|
|
|
46922
46954
|
"deprecationMessage": "",
|
|
46923
46955
|
"rawdescription": "",
|
|
46924
46956
|
"description": "",
|
|
46925
|
-
"displayName": "
|
|
46957
|
+
"displayName": "migrateEuiFieldset",
|
|
46926
46958
|
"args": [
|
|
46927
46959
|
{
|
|
46928
46960
|
"name": "options",
|
|
@@ -46948,7 +46980,7 @@
|
|
|
46948
46980
|
},
|
|
46949
46981
|
{
|
|
46950
46982
|
"name": "migrateInlineTemplates",
|
|
46951
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
46983
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
46952
46984
|
"ctype": "miscellaneous",
|
|
46953
46985
|
"subtype": "function",
|
|
46954
46986
|
"coverageIgnore": false,
|
|
@@ -46980,7 +47012,7 @@
|
|
|
46980
47012
|
},
|
|
46981
47013
|
{
|
|
46982
47014
|
"name": "migrateTemplate",
|
|
46983
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
47015
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
46984
47016
|
"ctype": "miscellaneous",
|
|
46985
47017
|
"subtype": "function",
|
|
46986
47018
|
"coverageIgnore": false,
|
|
@@ -47010,41 +47042,9 @@
|
|
|
47010
47042
|
}
|
|
47011
47043
|
]
|
|
47012
47044
|
},
|
|
47013
|
-
{
|
|
47014
|
-
"name": "renameTsPropertyAccesses",
|
|
47015
|
-
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47016
|
-
"ctype": "miscellaneous",
|
|
47017
|
-
"subtype": "function",
|
|
47018
|
-
"coverageIgnore": false,
|
|
47019
|
-
"deprecated": false,
|
|
47020
|
-
"deprecationMessage": "",
|
|
47021
|
-
"rawdescription": "",
|
|
47022
|
-
"description": "",
|
|
47023
|
-
"displayName": "renameTsPropertyAccesses",
|
|
47024
|
-
"args": [
|
|
47025
|
-
{
|
|
47026
|
-
"name": "source",
|
|
47027
|
-
"type": "string",
|
|
47028
|
-
"deprecated": false,
|
|
47029
|
-
"deprecationMessage": ""
|
|
47030
|
-
}
|
|
47031
|
-
],
|
|
47032
|
-
"returnType": "string",
|
|
47033
|
-
"jsdoctags": [
|
|
47034
|
-
{
|
|
47035
|
-
"name": "source",
|
|
47036
|
-
"type": "string",
|
|
47037
|
-
"deprecated": false,
|
|
47038
|
-
"deprecationMessage": "",
|
|
47039
|
-
"tagName": {
|
|
47040
|
-
"text": "param"
|
|
47041
|
-
}
|
|
47042
|
-
}
|
|
47043
|
-
]
|
|
47044
|
-
},
|
|
47045
47045
|
{
|
|
47046
47046
|
"name": "unwrapExpression",
|
|
47047
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
47047
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
47048
47048
|
"ctype": "miscellaneous",
|
|
47049
47049
|
"subtype": "function",
|
|
47050
47050
|
"coverageIgnore": false,
|
|
@@ -47074,7 +47074,7 @@
|
|
|
47074
47074
|
},
|
|
47075
47075
|
{
|
|
47076
47076
|
"name": "visitDir",
|
|
47077
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
47077
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
47078
47078
|
"ctype": "miscellaneous",
|
|
47079
47079
|
"subtype": "function",
|
|
47080
47080
|
"coverageIgnore": false,
|
|
@@ -47119,7 +47119,7 @@
|
|
|
47119
47119
|
},
|
|
47120
47120
|
{
|
|
47121
47121
|
"name": "visitNodes",
|
|
47122
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
47122
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
47123
47123
|
"ctype": "miscellaneous",
|
|
47124
47124
|
"subtype": "function",
|
|
47125
47125
|
"coverageIgnore": false,
|
|
@@ -50777,10 +50777,10 @@
|
|
|
50777
50777
|
]
|
|
50778
50778
|
}
|
|
50779
50779
|
],
|
|
50780
|
-
"packages/core/schematics/migrate-eui-
|
|
50780
|
+
"packages/core/schematics/migrate-eui-discussion-thread/index.ts": [
|
|
50781
50781
|
{
|
|
50782
50782
|
"name": "collectRemovals",
|
|
50783
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
50783
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
50784
50784
|
"ctype": "miscellaneous",
|
|
50785
50785
|
"subtype": "function",
|
|
50786
50786
|
"coverageIgnore": false,
|
|
@@ -50796,6 +50796,12 @@
|
|
|
50796
50796
|
"deprecated": false,
|
|
50797
50797
|
"deprecationMessage": ""
|
|
50798
50798
|
},
|
|
50799
|
+
{
|
|
50800
|
+
"name": "source",
|
|
50801
|
+
"type": "string",
|
|
50802
|
+
"deprecated": false,
|
|
50803
|
+
"deprecationMessage": ""
|
|
50804
|
+
},
|
|
50799
50805
|
{
|
|
50800
50806
|
"name": "removals",
|
|
50801
50807
|
"deprecated": false,
|
|
@@ -50814,69 +50820,16 @@
|
|
|
50814
50820
|
}
|
|
50815
50821
|
},
|
|
50816
50822
|
{
|
|
50817
|
-
"name": "
|
|
50818
|
-
"
|
|
50819
|
-
"deprecationMessage": "",
|
|
50820
|
-
"tagName": {
|
|
50821
|
-
"text": "param"
|
|
50822
|
-
}
|
|
50823
|
-
}
|
|
50824
|
-
]
|
|
50825
|
-
},
|
|
50826
|
-
{
|
|
50827
|
-
"name": "getAttributeSpan",
|
|
50828
|
-
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
50829
|
-
"ctype": "miscellaneous",
|
|
50830
|
-
"subtype": "function",
|
|
50831
|
-
"coverageIgnore": false,
|
|
50832
|
-
"deprecated": false,
|
|
50833
|
-
"deprecationMessage": "",
|
|
50834
|
-
"rawdescription": "",
|
|
50835
|
-
"description": "",
|
|
50836
|
-
"displayName": "getAttributeSpan",
|
|
50837
|
-
"args": [
|
|
50838
|
-
{
|
|
50839
|
-
"name": "attr",
|
|
50840
|
-
"deprecated": false,
|
|
50841
|
-
"deprecationMessage": ""
|
|
50842
|
-
}
|
|
50843
|
-
],
|
|
50844
|
-
"returnType": "{ start: number; end: number }",
|
|
50845
|
-
"jsdoctags": [
|
|
50846
|
-
{
|
|
50847
|
-
"name": "attr",
|
|
50823
|
+
"name": "source",
|
|
50824
|
+
"type": "string",
|
|
50848
50825
|
"deprecated": false,
|
|
50849
50826
|
"deprecationMessage": "",
|
|
50850
50827
|
"tagName": {
|
|
50851
50828
|
"text": "param"
|
|
50852
50829
|
}
|
|
50853
|
-
}
|
|
50854
|
-
]
|
|
50855
|
-
},
|
|
50856
|
-
{
|
|
50857
|
-
"name": "isChipElement",
|
|
50858
|
-
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
50859
|
-
"ctype": "miscellaneous",
|
|
50860
|
-
"subtype": "function",
|
|
50861
|
-
"coverageIgnore": false,
|
|
50862
|
-
"deprecated": false,
|
|
50863
|
-
"deprecationMessage": "",
|
|
50864
|
-
"rawdescription": "",
|
|
50865
|
-
"description": "",
|
|
50866
|
-
"displayName": "isChipElement",
|
|
50867
|
-
"args": [
|
|
50868
|
-
{
|
|
50869
|
-
"name": "element",
|
|
50870
|
-
"type": "TmplAstElement",
|
|
50871
|
-
"deprecated": false,
|
|
50872
|
-
"deprecationMessage": ""
|
|
50873
|
-
}
|
|
50874
|
-
],
|
|
50875
|
-
"returnType": "boolean",
|
|
50876
|
-
"jsdoctags": [
|
|
50830
|
+
},
|
|
50877
50831
|
{
|
|
50878
|
-
"name": "
|
|
50879
|
-
"type": "TmplAstElement",
|
|
50832
|
+
"name": "removals",
|
|
50880
50833
|
"deprecated": false,
|
|
50881
50834
|
"deprecationMessage": "",
|
|
50882
50835
|
"tagName": {
|
|
@@ -50886,8 +50839,8 @@
|
|
|
50886
50839
|
]
|
|
50887
50840
|
},
|
|
50888
50841
|
{
|
|
50889
|
-
"name": "
|
|
50890
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
50842
|
+
"name": "migrateEuiDiscussionThread",
|
|
50843
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
50891
50844
|
"ctype": "miscellaneous",
|
|
50892
50845
|
"subtype": "function",
|
|
50893
50846
|
"coverageIgnore": false,
|
|
@@ -50895,7 +50848,7 @@
|
|
|
50895
50848
|
"deprecationMessage": "",
|
|
50896
50849
|
"rawdescription": "",
|
|
50897
50850
|
"description": "",
|
|
50898
|
-
"displayName": "
|
|
50851
|
+
"displayName": "migrateEuiDiscussionThread",
|
|
50899
50852
|
"args": [
|
|
50900
50853
|
{
|
|
50901
50854
|
"name": "options",
|
|
@@ -50921,7 +50874,7 @@
|
|
|
50921
50874
|
},
|
|
50922
50875
|
{
|
|
50923
50876
|
"name": "migrateInlineTemplates",
|
|
50924
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
50877
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
50925
50878
|
"ctype": "miscellaneous",
|
|
50926
50879
|
"subtype": "function",
|
|
50927
50880
|
"coverageIgnore": false,
|
|
@@ -50953,7 +50906,7 @@
|
|
|
50953
50906
|
},
|
|
50954
50907
|
{
|
|
50955
50908
|
"name": "migrateTemplate",
|
|
50956
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
50909
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
50957
50910
|
"ctype": "miscellaneous",
|
|
50958
50911
|
"subtype": "function",
|
|
50959
50912
|
"coverageIgnore": false,
|
|
@@ -50985,7 +50938,7 @@
|
|
|
50985
50938
|
},
|
|
50986
50939
|
{
|
|
50987
50940
|
"name": "visitDir",
|
|
50988
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
50941
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
50989
50942
|
"ctype": "miscellaneous",
|
|
50990
50943
|
"subtype": "function",
|
|
50991
50944
|
"coverageIgnore": false,
|
|
@@ -51030,7 +50983,7 @@
|
|
|
51030
50983
|
},
|
|
51031
50984
|
{
|
|
51032
50985
|
"name": "visitNodes",
|
|
51033
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
50986
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
51034
50987
|
"ctype": "miscellaneous",
|
|
51035
50988
|
"subtype": "function",
|
|
51036
50989
|
"coverageIgnore": false,
|
|
@@ -51045,6 +50998,12 @@
|
|
|
51045
50998
|
"deprecated": false,
|
|
51046
50999
|
"deprecationMessage": ""
|
|
51047
51000
|
},
|
|
51001
|
+
{
|
|
51002
|
+
"name": "source",
|
|
51003
|
+
"type": "string",
|
|
51004
|
+
"deprecated": false,
|
|
51005
|
+
"deprecationMessage": ""
|
|
51006
|
+
},
|
|
51048
51007
|
{
|
|
51049
51008
|
"name": "removals",
|
|
51050
51009
|
"deprecated": false,
|
|
@@ -51061,6 +51020,15 @@
|
|
|
51061
51020
|
"text": "param"
|
|
51062
51021
|
}
|
|
51063
51022
|
},
|
|
51023
|
+
{
|
|
51024
|
+
"name": "source",
|
|
51025
|
+
"type": "string",
|
|
51026
|
+
"deprecated": false,
|
|
51027
|
+
"deprecationMessage": "",
|
|
51028
|
+
"tagName": {
|
|
51029
|
+
"text": "param"
|
|
51030
|
+
}
|
|
51031
|
+
},
|
|
51064
51032
|
{
|
|
51065
51033
|
"name": "removals",
|
|
51066
51034
|
"deprecated": false,
|
|
@@ -51072,10 +51040,10 @@
|
|
|
51072
51040
|
]
|
|
51073
51041
|
}
|
|
51074
51042
|
],
|
|
51075
|
-
"packages/core/schematics/migrate-eui-
|
|
51043
|
+
"packages/core/schematics/migrate-eui-chip/index.ts": [
|
|
51076
51044
|
{
|
|
51077
51045
|
"name": "collectRemovals",
|
|
51078
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
51046
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
51079
51047
|
"ctype": "miscellaneous",
|
|
51080
51048
|
"subtype": "function",
|
|
51081
51049
|
"coverageIgnore": false,
|
|
@@ -51091,12 +51059,6 @@
|
|
|
51091
51059
|
"deprecated": false,
|
|
51092
51060
|
"deprecationMessage": ""
|
|
51093
51061
|
},
|
|
51094
|
-
{
|
|
51095
|
-
"name": "source",
|
|
51096
|
-
"type": "string",
|
|
51097
|
-
"deprecated": false,
|
|
51098
|
-
"deprecationMessage": ""
|
|
51099
|
-
},
|
|
51100
51062
|
{
|
|
51101
51063
|
"name": "removals",
|
|
51102
51064
|
"deprecated": false,
|
|
@@ -51115,16 +51077,37 @@
|
|
|
51115
51077
|
}
|
|
51116
51078
|
},
|
|
51117
51079
|
{
|
|
51118
|
-
"name": "
|
|
51119
|
-
"type": "string",
|
|
51080
|
+
"name": "removals",
|
|
51120
51081
|
"deprecated": false,
|
|
51121
51082
|
"deprecationMessage": "",
|
|
51122
51083
|
"tagName": {
|
|
51123
51084
|
"text": "param"
|
|
51124
51085
|
}
|
|
51125
|
-
}
|
|
51086
|
+
}
|
|
51087
|
+
]
|
|
51088
|
+
},
|
|
51089
|
+
{
|
|
51090
|
+
"name": "getAttributeSpan",
|
|
51091
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
51092
|
+
"ctype": "miscellaneous",
|
|
51093
|
+
"subtype": "function",
|
|
51094
|
+
"coverageIgnore": false,
|
|
51095
|
+
"deprecated": false,
|
|
51096
|
+
"deprecationMessage": "",
|
|
51097
|
+
"rawdescription": "",
|
|
51098
|
+
"description": "",
|
|
51099
|
+
"displayName": "getAttributeSpan",
|
|
51100
|
+
"args": [
|
|
51126
51101
|
{
|
|
51127
|
-
"name": "
|
|
51102
|
+
"name": "attr",
|
|
51103
|
+
"deprecated": false,
|
|
51104
|
+
"deprecationMessage": ""
|
|
51105
|
+
}
|
|
51106
|
+
],
|
|
51107
|
+
"returnType": "{ start: number; end: number }",
|
|
51108
|
+
"jsdoctags": [
|
|
51109
|
+
{
|
|
51110
|
+
"name": "attr",
|
|
51128
51111
|
"deprecated": false,
|
|
51129
51112
|
"deprecationMessage": "",
|
|
51130
51113
|
"tagName": {
|
|
@@ -51134,8 +51117,8 @@
|
|
|
51134
51117
|
]
|
|
51135
51118
|
},
|
|
51136
51119
|
{
|
|
51137
|
-
"name": "
|
|
51138
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
51120
|
+
"name": "isChipElement",
|
|
51121
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
51139
51122
|
"ctype": "miscellaneous",
|
|
51140
51123
|
"subtype": "function",
|
|
51141
51124
|
"coverageIgnore": false,
|
|
@@ -51143,7 +51126,39 @@
|
|
|
51143
51126
|
"deprecationMessage": "",
|
|
51144
51127
|
"rawdescription": "",
|
|
51145
51128
|
"description": "",
|
|
51146
|
-
"displayName": "
|
|
51129
|
+
"displayName": "isChipElement",
|
|
51130
|
+
"args": [
|
|
51131
|
+
{
|
|
51132
|
+
"name": "element",
|
|
51133
|
+
"type": "TmplAstElement",
|
|
51134
|
+
"deprecated": false,
|
|
51135
|
+
"deprecationMessage": ""
|
|
51136
|
+
}
|
|
51137
|
+
],
|
|
51138
|
+
"returnType": "boolean",
|
|
51139
|
+
"jsdoctags": [
|
|
51140
|
+
{
|
|
51141
|
+
"name": "element",
|
|
51142
|
+
"type": "TmplAstElement",
|
|
51143
|
+
"deprecated": false,
|
|
51144
|
+
"deprecationMessage": "",
|
|
51145
|
+
"tagName": {
|
|
51146
|
+
"text": "param"
|
|
51147
|
+
}
|
|
51148
|
+
}
|
|
51149
|
+
]
|
|
51150
|
+
},
|
|
51151
|
+
{
|
|
51152
|
+
"name": "migrateEuiChip",
|
|
51153
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
51154
|
+
"ctype": "miscellaneous",
|
|
51155
|
+
"subtype": "function",
|
|
51156
|
+
"coverageIgnore": false,
|
|
51157
|
+
"deprecated": false,
|
|
51158
|
+
"deprecationMessage": "",
|
|
51159
|
+
"rawdescription": "",
|
|
51160
|
+
"description": "",
|
|
51161
|
+
"displayName": "migrateEuiChip",
|
|
51147
51162
|
"args": [
|
|
51148
51163
|
{
|
|
51149
51164
|
"name": "options",
|
|
@@ -51169,7 +51184,7 @@
|
|
|
51169
51184
|
},
|
|
51170
51185
|
{
|
|
51171
51186
|
"name": "migrateInlineTemplates",
|
|
51172
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
51187
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
51173
51188
|
"ctype": "miscellaneous",
|
|
51174
51189
|
"subtype": "function",
|
|
51175
51190
|
"coverageIgnore": false,
|
|
@@ -51201,7 +51216,7 @@
|
|
|
51201
51216
|
},
|
|
51202
51217
|
{
|
|
51203
51218
|
"name": "migrateTemplate",
|
|
51204
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
51219
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
51205
51220
|
"ctype": "miscellaneous",
|
|
51206
51221
|
"subtype": "function",
|
|
51207
51222
|
"coverageIgnore": false,
|
|
@@ -51233,7 +51248,7 @@
|
|
|
51233
51248
|
},
|
|
51234
51249
|
{
|
|
51235
51250
|
"name": "visitDir",
|
|
51236
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
51251
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
51237
51252
|
"ctype": "miscellaneous",
|
|
51238
51253
|
"subtype": "function",
|
|
51239
51254
|
"coverageIgnore": false,
|
|
@@ -51278,7 +51293,7 @@
|
|
|
51278
51293
|
},
|
|
51279
51294
|
{
|
|
51280
51295
|
"name": "visitNodes",
|
|
51281
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
51296
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
51282
51297
|
"ctype": "miscellaneous",
|
|
51283
51298
|
"subtype": "function",
|
|
51284
51299
|
"coverageIgnore": false,
|
|
@@ -51293,12 +51308,6 @@
|
|
|
51293
51308
|
"deprecated": false,
|
|
51294
51309
|
"deprecationMessage": ""
|
|
51295
51310
|
},
|
|
51296
|
-
{
|
|
51297
|
-
"name": "source",
|
|
51298
|
-
"type": "string",
|
|
51299
|
-
"deprecated": false,
|
|
51300
|
-
"deprecationMessage": ""
|
|
51301
|
-
},
|
|
51302
51311
|
{
|
|
51303
51312
|
"name": "removals",
|
|
51304
51313
|
"deprecated": false,
|
|
@@ -51315,15 +51324,6 @@
|
|
|
51315
51324
|
"text": "param"
|
|
51316
51325
|
}
|
|
51317
51326
|
},
|
|
51318
|
-
{
|
|
51319
|
-
"name": "source",
|
|
51320
|
-
"type": "string",
|
|
51321
|
-
"deprecated": false,
|
|
51322
|
-
"deprecationMessage": "",
|
|
51323
|
-
"tagName": {
|
|
51324
|
-
"text": "param"
|
|
51325
|
-
}
|
|
51326
|
-
},
|
|
51327
51327
|
{
|
|
51328
51328
|
"name": "removals",
|
|
51329
51329
|
"deprecated": false,
|