@taiga-ui/cdk 4.2.0 → 4.4.0-canary.6e6e993

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.
Files changed (83) hide show
  1. package/classes/control.d.ts +2 -1
  2. package/constants/used-icons.d.ts +1 -1
  3. package/constants/version.d.ts +1 -1
  4. package/constants/version.js +1 -1
  5. package/directives/platform/platform.directive.d.ts +1 -1
  6. package/esm2022/classes/control.mjs +9 -11
  7. package/esm2022/constants/used-icons.mjs +2 -1
  8. package/esm2022/constants/version.mjs +2 -2
  9. package/esm2022/directives/active-zone/active-zone.directive.mjs +2 -2
  10. package/esm2022/directives/copy-processor/copy-processor.directive.mjs +5 -5
  11. package/esm2022/directives/focus-trap/focus-trap.directive.mjs +4 -6
  12. package/esm2022/directives/media/media.directive.mjs +14 -28
  13. package/esm2022/directives/native-validator/native-validator.directive.mjs +5 -5
  14. package/esm2022/directives/platform/platform.directive.mjs +7 -9
  15. package/esm2022/directives/resizer/resizer.directive.mjs +10 -16
  16. package/esm2022/observables/control-value.mjs +2 -13
  17. package/esm2022/tokens/active-element.mjs +5 -3
  18. package/esm2022/tokens/fallback-value.mjs +3 -3
  19. package/esm2022/utils/miscellaneous/count-filled-controls.mjs +13 -0
  20. package/esm2022/utils/miscellaneous/index.mjs +3 -1
  21. package/esm2022/utils/miscellaneous/is-control-empty.mjs +4 -0
  22. package/fesm2022/taiga-ui-cdk-classes.mjs +9 -11
  23. package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
  24. package/fesm2022/taiga-ui-cdk-constants.mjs +2 -1
  25. package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
  26. package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +1 -1
  27. package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs.map +1 -1
  28. package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs +4 -4
  29. package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs.map +1 -1
  30. package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs +3 -5
  31. package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs.map +1 -1
  32. package/fesm2022/taiga-ui-cdk-directives-media.mjs +13 -27
  33. package/fesm2022/taiga-ui-cdk-directives-media.mjs.map +1 -1
  34. package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs +4 -4
  35. package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs.map +1 -1
  36. package/fesm2022/taiga-ui-cdk-directives-platform.mjs +6 -8
  37. package/fesm2022/taiga-ui-cdk-directives-platform.mjs.map +1 -1
  38. package/fesm2022/taiga-ui-cdk-directives-resizer.mjs +9 -15
  39. package/fesm2022/taiga-ui-cdk-directives-resizer.mjs.map +1 -1
  40. package/fesm2022/taiga-ui-cdk-observables.mjs +2 -13
  41. package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
  42. package/fesm2022/taiga-ui-cdk-tokens.mjs +7 -4
  43. package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
  44. package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +17 -2
  45. package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
  46. package/observables/control-value.d.ts +0 -3
  47. package/package.json +356 -356
  48. package/schematics/migration.json +8 -3
  49. package/schematics/ng-add/index.js +3 -0
  50. package/schematics/ng-add/steps/add-taiga-modules.js +3 -1
  51. package/schematics/ng-add/steps/wrap-with-tui-root.js +11 -7
  52. package/schematics/ng-update/steps/replace-package-name.js +3 -2
  53. package/schematics/ng-update/v4/index.js +1 -0
  54. package/schematics/ng-update/v4/migrate-addon-doc/index.d.ts +3 -0
  55. package/schematics/ng-update/v4/migrate-addon-doc/index.js +52 -0
  56. package/schematics/ng-update/v4/migrate-addon-doc/replace-symbols.d.ts +2 -0
  57. package/schematics/ng-update/v4/migrate-addon-doc/replace-symbols.js +139 -0
  58. package/schematics/ng-update/v4/migrate-icons/index.js +2 -1
  59. package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.js +4 -3
  60. package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +0 -127
  61. package/schematics/ng-update/v4/steps/constants/types.js +0 -9
  62. package/schematics/ng-update/v4/steps/index.d.ts +1 -0
  63. package/schematics/ng-update/v4/steps/index.js +1 -0
  64. package/schematics/ng-update/v4/steps/migrate-alert-service.js +7 -9
  65. package/schematics/ng-update/v4/steps/migrate-destroy-service.js +5 -3
  66. package/schematics/ng-update/v4/steps/migrate-proprietary.js +9 -8
  67. package/schematics/ng-update/v4/steps/migrate-root.js +2 -1
  68. package/schematics/ng-update/v4/steps/migrate-templates.js +3 -0
  69. package/schematics/ng-update/v4/steps/remove-duplicates.d.ts +2 -0
  70. package/schematics/ng-update/v4/steps/remove-duplicates.js +41 -0
  71. package/schematics/ng-update/v4/steps/templates/migrate-badge.js +3 -2
  72. package/schematics/ng-update/v4/steps/templates/migrate-money.js +8 -3
  73. package/schematics/ng-update/v4/steps/update-packages.d.ts +4 -0
  74. package/schematics/ng-update/v4/steps/update-packages.js +14 -6
  75. package/schematics/utils/add-import-to-closest-module.d.ts +1 -0
  76. package/schematics/utils/add-import-to-closest-module.js +24 -17
  77. package/schematics/utils/add-unique-import.js +2 -0
  78. package/schematics/utils/create-angular-json.d.ts +0 -1
  79. package/schematics/utils/create-angular-json.js +1 -27
  80. package/tokens/fallback-value.d.ts +1 -2
  81. package/utils/miscellaneous/count-filled-controls.d.ts +2 -0
  82. package/utils/miscellaneous/index.d.ts +2 -0
  83. package/utils/miscellaneous/is-control-empty.d.ts +2 -0
@@ -3,17 +3,22 @@
3
3
  "schematics": {
4
4
  "migrateCssVarsV4": {
5
5
  "description": "Migrate Taiga UI css variables",
6
- "version": "4.0.0-rc.1",
6
+ "version": "4.0.0",
7
7
  "factory": "./ng-update/v4/migrate-css-vars/index#migrateCssVars"
8
8
  },
9
9
  "migrateIconsV4": {
10
10
  "description": "Migrate Taiga UI icons to a new format",
11
- "version": "4.0.0-rc.1",
11
+ "version": "4.0.0",
12
12
  "factory": "./ng-update/v4/migrate-icons/index#migrateIcons"
13
13
  },
14
+ "migrateAddonDocV4": {
15
+ "description": "Migrate Taiga UI addon doc",
16
+ "version": "4.0.0",
17
+ "factory": "./ng-update/v4/migrate-addon-doc/index#migrateAddonDoc"
18
+ },
14
19
  "updateToV4": {
15
20
  "description": "Updates Taiga UI packages to v4",
16
- "version": "4.0.0-rc.1",
21
+ "version": "4.0.0",
17
22
  "factory": "./ng-update/v4/index#updateToV4"
18
23
  }
19
24
  }
@@ -11,6 +11,7 @@ function addDependencies(tree, options) {
11
11
  (0, ng_morph_1.addPackageJsonDependency)(tree, {
12
12
  name: `@taiga-ui/${pack}`,
13
13
  version: versions_1.TAIGA_VERSION,
14
+ type: ng_morph_1.NodeDependencyType.Default,
14
15
  });
15
16
  });
16
17
  removeTaigaSchematicsPackage(tree);
@@ -18,6 +19,7 @@ function addDependencies(tree, options) {
18
19
  (0, ng_morph_1.addPackageJsonDependency)(tree, {
19
20
  name: '@taiga-ui/styles',
20
21
  version: versions_1.TAIGA_VERSION,
22
+ type: ng_morph_1.NodeDependencyType.Default,
21
23
  });
22
24
  }
23
25
  if (packages.includes('addon-table') || packages.includes('addon-mobile')) {
@@ -35,6 +37,7 @@ function addAngularCdkDep(tree) {
35
37
  (0, ng_morph_1.addPackageJsonDependency)(tree, {
36
38
  name: '@angular/cdk',
37
39
  version: `^${majorVersionArr[0]}.0.0`,
40
+ type: ng_morph_1.NodeDependencyType.Default,
38
41
  });
39
42
  }
40
43
  }
@@ -97,7 +97,9 @@ function addTaigaModules(options) {
97
97
  }
98
98
  else {
99
99
  const mainClass = (0, ng_morph_1.getMainModule)(mainFilePath);
100
- addTuiModules({ mainClass, options, context });
100
+ if (mainClass) {
101
+ addTuiModules({ mainClass, options, context });
102
+ }
101
103
  }
102
104
  (0, ng_morph_1.saveActiveProject)();
103
105
  });
@@ -33,12 +33,15 @@ function getAppTemplatePath(mainPath) {
33
33
  if (standaloneBootstrapFunction) {
34
34
  const [componentIdentifier] = standaloneBootstrapFunction.getArguments();
35
35
  const component = (0, get_component_from_identifier_1.getComponentFromIdentifier)(componentIdentifier);
36
- return component && getTemplatePathFromComponent(component);
36
+ return (component && getTemplatePathFromComponent(component)) || '';
37
37
  }
38
38
  const mainModule = (0, ng_morph_1.getMainModule)(mainPath);
39
+ if (!mainModule) {
40
+ return '';
41
+ }
39
42
  const mainInitializer = getTemplateInitializer(mainModule, 'NgModule', 'declarations');
40
- if (!ng_morph_1.Node.isArrayLiteralExpression(mainInitializer)) {
41
- return;
43
+ if (!mainInitializer || !ng_morph_1.Node.isArrayLiteralExpression(mainInitializer)) {
44
+ return '';
42
45
  }
43
46
  const appIdentifier = mainInitializer.getElements()[0];
44
47
  const appComponent = appIdentifier.getDefinitionNodes()[0];
@@ -52,19 +55,20 @@ function getTemplatePathFromComponent(component) {
52
55
  .join('/')}/${templateInitializer === null || templateInitializer === void 0 ? void 0 : templateInitializer.getText().replaceAll(/['"]/g, '')}`;
53
56
  }
54
57
  function getTemplateInitializer(classDeclaration, decoratorName, propertyName) {
58
+ var _a;
55
59
  const decorator = classDeclaration.getDecorator(decoratorName);
56
60
  if (!decorator) {
57
- return;
61
+ return null;
58
62
  }
59
63
  const [metadata] = decorator.getArguments();
60
64
  if (!ng_morph_1.Node.isObjectLiteralExpression(metadata)) {
61
- return;
65
+ return null;
62
66
  }
63
67
  const property = metadata.getProperty(propertyName);
64
68
  if (!ng_morph_1.Node.isPropertyAssignment(property)) {
65
- return;
69
+ return null;
66
70
  }
67
- return property.getInitializer();
71
+ return (_a = property.getInitializer()) !== null && _a !== void 0 ? _a : null;
68
72
  }
69
73
  function wrapWithTuiRoot(options) {
70
74
  return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -8,9 +8,10 @@ const replace_text_1 = require("../utils/replace-text");
8
8
  function replacePackageName(oldPackage, newPackage, tree) {
9
9
  const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
10
10
  (0, replace_text_1.replaceText)([{ from: oldPackage, to: newPackage.name }], constants_1.ALL_TS_FILES);
11
- if ((0, ng_morph_1.getPackageJsonDependency)(tree, oldPackage)) {
11
+ const old = (0, ng_morph_1.getPackageJsonDependency)(tree, oldPackage);
12
+ if (old) {
12
13
  (0, ng_morph_1.removePackageJsonDependency)(tree, oldPackage);
13
- (0, ng_morph_1.addPackageJsonDependency)(tree, newPackage);
14
+ (0, ng_morph_1.addPackageJsonDependency)(tree, Object.assign(Object.assign({}, newPackage), { type: old.type }));
14
15
  }
15
16
  fileSystem.commitEdits();
16
17
  (0, ng_morph_1.saveActiveProject)();
@@ -42,6 +42,7 @@ function main(options) {
42
42
  (0, steps_1.showWarnings)(context, constants_1.MIGRATION_WARNINGS);
43
43
  fileSystem.commitEdits();
44
44
  (0, ng_morph_1.saveActiveProject)();
45
+ (0, steps_2.removeDuplicates)(options);
45
46
  (0, steps_2.migrateStyles)();
46
47
  (0, steps_2.migrateProprietary)(fileSystem, options);
47
48
  (0, steps_2.updatePackages)(fileSystem, options);
@@ -0,0 +1,3 @@
1
+ import type { Rule } from '@angular-devkit/schematics';
2
+ import type { TuiSchema } from '../../../ng-add/schema';
3
+ export declare function migrateAddonDoc(options: TuiSchema): Rule;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateAddonDoc = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const steps_1 = require("@taiga-ui/cdk/schematics/ng-update/steps");
6
+ const ng_morph_1 = require("ng-morph");
7
+ const file_globs_1 = require("../../../constants/file-globs");
8
+ const colored_log_1 = require("../../../utils/colored-log");
9
+ const remove_module_1 = require("../../steps/remove-module");
10
+ const get_file_system_1 = require("../../utils/get-file-system");
11
+ const replace_symbols_1 = require("./replace-symbols");
12
+ function migrateAddonDoc(options) {
13
+ return (0, schematics_1.chain)([
14
+ (tree, _context) => {
15
+ const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
16
+ if (!(0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, '@taiga-ui/addon-doc')) {
17
+ return;
18
+ }
19
+ !options['skip-logs'] &&
20
+ (0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing...`);
21
+ (0, remove_module_1.removeModules)(options, [
22
+ {
23
+ name: 'tuiGenerateRoutes',
24
+ moduleSpecifier: '@taiga-ui/addon-doc',
25
+ },
26
+ ]);
27
+ (0, steps_1.renameTypes)(options, [
28
+ {
29
+ from: 'TuiDocExample',
30
+ to: 'Record<string, TuiRawLoaderContent>',
31
+ moduleSpecifier: ['@taiga-ui/addon-doc'],
32
+ removeImport: true,
33
+ newImports: [
34
+ {
35
+ name: 'TuiRawLoaderContent',
36
+ moduleSpecifier: '@taiga-ui/addon-doc',
37
+ },
38
+ ],
39
+ },
40
+ ]);
41
+ (0, ng_morph_1.getSourceFiles)(file_globs_1.ALL_TS_FILES).forEach((file) => file.replaceWithText(file
42
+ .getFullText()
43
+ .replaceAll(/RouterModule\.forChild\(tuiGenerateRoutes\(\w+\)\)/g, 'RouterModule')));
44
+ (0, steps_1.replaceIdentifiers)(options, replace_symbols_1.DOC_SYMBOLS_TO_REPLACE);
45
+ fileSystem.commitEdits();
46
+ (0, ng_morph_1.saveActiveProject)();
47
+ !options['skip-logs'] &&
48
+ (0, colored_log_1.titleLog)(`${colored_log_1.FINISH_SYMBOL} addon-doc successfully migrated \n`);
49
+ },
50
+ ]);
51
+ }
52
+ exports.migrateAddonDoc = migrateAddonDoc;
@@ -0,0 +1,2 @@
1
+ import type { ReplacementIdentifierMulti } from '../../interfaces/replacement-identifier';
2
+ export declare const DOC_SYMBOLS_TO_REPLACE: ReplacementIdentifierMulti[];
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DOC_SYMBOLS_TO_REPLACE = void 0;
4
+ exports.DOC_SYMBOLS_TO_REPLACE = [
5
+ {
6
+ from: {
7
+ name: 'DocumentationPropertyType',
8
+ moduleSpecifier: '@taiga-ui/addon-doc',
9
+ },
10
+ to: {
11
+ name: 'TuiDocumentationPropertyType',
12
+ moduleSpecifier: '@taiga-ui/addon-doc',
13
+ },
14
+ },
15
+ {
16
+ from: {
17
+ name: 'RawContentLoader',
18
+ moduleSpecifier: '@taiga-ui/addon-doc',
19
+ },
20
+ to: {
21
+ name: 'TuiRawContentLoader',
22
+ moduleSpecifier: '@taiga-ui/addon-doc',
23
+ },
24
+ },
25
+ {
26
+ from: {
27
+ name: 'TuiDocCopyModule',
28
+ moduleSpecifier: '@taiga-ui/addon-doc',
29
+ },
30
+ to: {
31
+ name: 'TuiDocCopy',
32
+ moduleSpecifier: '@taiga-ui/addon-doc',
33
+ },
34
+ },
35
+ {
36
+ from: {
37
+ name: 'TuiScrollIntoViewLinkModule',
38
+ moduleSpecifier: '@taiga-ui/addon-doc',
39
+ },
40
+ to: {
41
+ name: 'TuiDocScrollIntoViewLink',
42
+ moduleSpecifier: '@taiga-ui/addon-doc',
43
+ },
44
+ },
45
+ {
46
+ from: {
47
+ name: 'TuiTextCodeModule',
48
+ moduleSpecifier: '@taiga-ui/addon-doc',
49
+ },
50
+ to: {
51
+ name: 'TuiDocText',
52
+ moduleSpecifier: '@taiga-ui/addon-doc',
53
+ },
54
+ },
55
+ {
56
+ from: {
57
+ name: 'TuiDocDocumentationModule',
58
+ moduleSpecifier: '@taiga-ui/addon-doc',
59
+ },
60
+ to: {
61
+ name: 'TuiAddonDoc',
62
+ moduleSpecifier: '@taiga-ui/addon-doc',
63
+ spreadInModule: true,
64
+ },
65
+ },
66
+ {
67
+ from: {
68
+ name: 'TuiDocPage',
69
+ moduleSpecifier: '@taiga-ui/addon-doc',
70
+ },
71
+ to: {
72
+ name: 'TuiDocRoutePage',
73
+ moduleSpecifier: '@taiga-ui/addon-doc',
74
+ },
75
+ },
76
+ {
77
+ from: [
78
+ {
79
+ name: 'TuiDocCodeModule',
80
+ moduleSpecifier: '@taiga-ui/addon-doc',
81
+ },
82
+ {
83
+ name: 'TuiDocDemoModule',
84
+ moduleSpecifier: '@taiga-ui/addon-doc',
85
+ },
86
+ {
87
+ name: 'TuiDocMainModule',
88
+ moduleSpecifier: '@taiga-ui/addon-doc',
89
+ },
90
+ {
91
+ name: 'TuiDocNavigationModule',
92
+ moduleSpecifier: '@taiga-ui/addon-doc',
93
+ },
94
+ {
95
+ name: 'TuiDocPageModule',
96
+ moduleSpecifier: '@taiga-ui/addon-doc',
97
+ },
98
+ {
99
+ name: 'TuiAddonDocModule',
100
+ moduleSpecifier: '@taiga-ui/addon-doc',
101
+ },
102
+ ],
103
+ to: {
104
+ name: 'TuiAddonDoc',
105
+ moduleSpecifier: '@taiga-ui/addon-doc',
106
+ spreadInModule: true,
107
+ },
108
+ },
109
+ {
110
+ from: {
111
+ name: 'TuiDocPage',
112
+ moduleSpecifier: '@taiga-ui/addon-doc',
113
+ },
114
+ to: {
115
+ name: 'TuiDocRoutePage',
116
+ moduleSpecifier: '@taiga-ui/addon-doc',
117
+ },
118
+ },
119
+ {
120
+ from: {
121
+ name: 'TuiDocPages',
122
+ moduleSpecifier: '@taiga-ui/addon-doc',
123
+ },
124
+ to: {
125
+ name: 'TuiDocRoutePages',
126
+ moduleSpecifier: '@taiga-ui/addon-doc',
127
+ },
128
+ },
129
+ {
130
+ from: {
131
+ name: 'TuiDeepPartial',
132
+ moduleSpecifier: '@taiga-ui/cdk',
133
+ },
134
+ to: {
135
+ name: 'TuiDeepPartial',
136
+ moduleSpecifier: '@taiga-ui/addon-doc',
137
+ },
138
+ },
139
+ ];
@@ -28,5 +28,6 @@ function migrateIcons(options) {
28
28
  }
29
29
  exports.migrateIcons = migrateIcons;
30
30
  function hasProprietaryIcons(tree) {
31
- return !!(0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/proprietary-icons');
31
+ return (!!(0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/proprietary-icons') ||
32
+ !!(0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/proprietary'));
32
33
  }
@@ -8,16 +8,17 @@ function renameProprietaryIcons({ logger }, pattern = constants_1.ALL_FILES) {
8
8
  sourceFiles.forEach((file) => {
9
9
  let text = file.getFullText();
10
10
  const regex = /['"`]tuiIcon(?!Button\b)[A-Z][a-zA-Z0-9]*\b/g;
11
+ const invalidIcons = new Set();
11
12
  text = text.replaceAll(regex, (icon) => {
12
13
  if (icon.match(/['"`]tuiIcon(?!Tds)\w*/)) {
13
14
  logger.warn(`[WARNING] in ${file.getSourceFile().getFilePath()}: Invalid icon name ${icon}. Please select an icon from the proprietary pack.`);
15
+ invalidIcons.add(icon.slice(1));
14
16
  return icon;
15
17
  }
16
18
  return convertString(icon);
17
19
  });
18
- const invalidIcons = [...new Set(text.match(/\b(tuiIcon(?!Tds|Button)\w*)\b/g))];
19
- if (invalidIcons.length) {
20
- const message = `TODO (Taiga UI migration): invalid icons ${invalidIcons.join(', ')}. Please select an icon from the proprietary pack`;
20
+ if (invalidIcons.size > 0) {
21
+ const message = `TODO (Taiga UI migration): invalid icons ${Array.from(invalidIcons).join(', ')}. Please select an icon from the proprietary pack`;
21
22
  const todo = file.getFilePath().endsWith('html')
22
23
  ? `<!-- ${message} -->`
23
24
  : `// ${message}`;
@@ -492,26 +492,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
492
492
  from: { name: 'ArrayElement', moduleSpecifier: '@taiga-ui/kit' },
493
493
  to: { name: 'TuiArrayElement', moduleSpecifier: '@taiga-ui/kit' },
494
494
  },
495
- {
496
- from: {
497
- name: 'DocumentationPropertyType',
498
- moduleSpecifier: '@taiga-ui/addon-doc',
499
- },
500
- to: {
501
- name: 'TuiDocumentationPropertyType',
502
- moduleSpecifier: '@taiga-ui/addon-doc',
503
- },
504
- },
505
- {
506
- from: {
507
- name: 'RawContentLoader',
508
- moduleSpecifier: '@taiga-ui/addon-doc',
509
- },
510
- to: {
511
- name: 'TuiRawContentLoader',
512
- moduleSpecifier: '@taiga-ui/addon-doc',
513
- },
514
- },
515
495
  {
516
496
  from: {
517
497
  name: 'TuiContextWithImplicit',
@@ -1286,16 +1266,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
1286
1266
  moduleSpecifier: '@taiga-ui/addon-charts',
1287
1267
  },
1288
1268
  },
1289
- {
1290
- from: {
1291
- name: 'TuiDocCopyModule',
1292
- moduleSpecifier: '@taiga-ui/addon-doc',
1293
- },
1294
- to: {
1295
- name: 'TuiDocCopy',
1296
- moduleSpecifier: '@taiga-ui/addon-doc',
1297
- },
1298
- },
1299
1269
  {
1300
1270
  from: {
1301
1271
  name: 'TuiPromptData',
@@ -1439,26 +1409,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
1439
1409
  spreadInModule: true,
1440
1410
  },
1441
1411
  },
1442
- {
1443
- from: {
1444
- name: 'TuiScrollIntoViewLinkModule',
1445
- moduleSpecifier: '@taiga-ui/addon-doc',
1446
- },
1447
- to: {
1448
- name: 'TuiDocScrollIntoViewLink',
1449
- moduleSpecifier: '@taiga-ui/addon-doc',
1450
- },
1451
- },
1452
- {
1453
- from: {
1454
- name: 'TuiTextCodeModule',
1455
- moduleSpecifier: '@taiga-ui/addon-doc',
1456
- },
1457
- to: {
1458
- name: 'TuiDocText',
1459
- moduleSpecifier: '@taiga-ui/addon-doc',
1460
- },
1461
- },
1462
1412
  {
1463
1413
  from: {
1464
1414
  name: 'TuiPreviewDialogModule',
@@ -1557,59 +1507,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
1557
1507
  spreadInModule: true,
1558
1508
  },
1559
1509
  },
1560
- {
1561
- from: {
1562
- name: 'TuiDocDocumentationModule',
1563
- moduleSpecifier: '@taiga-ui/addon-doc',
1564
- },
1565
- to: {
1566
- name: 'TuiAddonDoc',
1567
- moduleSpecifier: '@taiga-ui/addon-doc',
1568
- spreadInModule: true,
1569
- },
1570
- },
1571
- {
1572
- from: {
1573
- name: 'TuiDocPage',
1574
- moduleSpecifier: '@taiga-ui/addon-doc',
1575
- },
1576
- to: {
1577
- name: 'TuiDocRoutePage',
1578
- moduleSpecifier: '@taiga-ui/addon-doc',
1579
- },
1580
- },
1581
- {
1582
- from: [
1583
- {
1584
- name: 'TuiDocCodeModule',
1585
- moduleSpecifier: '@taiga-ui/addon-doc',
1586
- },
1587
- {
1588
- name: 'TuiDocDemoModule',
1589
- moduleSpecifier: '@taiga-ui/addon-doc',
1590
- },
1591
- {
1592
- name: 'TuiDocMainModule',
1593
- moduleSpecifier: '@taiga-ui/addon-doc',
1594
- },
1595
- {
1596
- name: 'TuiDocNavigationModule',
1597
- moduleSpecifier: '@taiga-ui/addon-doc',
1598
- },
1599
- {
1600
- name: 'TuiDocPageModule',
1601
- moduleSpecifier: '@taiga-ui/addon-doc',
1602
- },
1603
- {
1604
- name: 'TuiAddonDocModule',
1605
- moduleSpecifier: '@taiga-ui/addon-doc',
1606
- },
1607
- ],
1608
- to: {
1609
- name: 'TuiAddonDoc',
1610
- moduleSpecifier: '@taiga-ui/addon-doc',
1611
- },
1612
- },
1613
1510
  {
1614
1511
  from: {
1615
1512
  name: 'TuiLegendItemModule',
@@ -2498,26 +2395,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
2498
2395
  moduleSpecifier: '@taiga-ui/legacy',
2499
2396
  },
2500
2397
  },
2501
- {
2502
- from: {
2503
- name: 'TuiDocPage',
2504
- moduleSpecifier: '@taiga-ui/addon-doc',
2505
- },
2506
- to: {
2507
- name: 'TuiDocRoutePage',
2508
- moduleSpecifier: '@taiga-ui/addon-doc',
2509
- },
2510
- },
2511
- {
2512
- from: {
2513
- name: 'TuiDocPages',
2514
- moduleSpecifier: '@taiga-ui/addon-doc',
2515
- },
2516
- to: {
2517
- name: 'TuiDocRoutePages',
2518
- moduleSpecifier: '@taiga-ui/addon-doc',
2519
- },
2520
- },
2521
2398
  {
2522
2399
  from: [
2523
2400
  {
@@ -2653,10 +2530,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
2653
2530
  from: { name: 'TUI_DATE_FORMAT', moduleSpecifier: '@taiga-ui/cdk' },
2654
2531
  to: { name: 'TUI_DATE_FORMAT', moduleSpecifier: '@taiga-ui/core' },
2655
2532
  },
2656
- {
2657
- from: { name: 'TuiDeepPartial', moduleSpecifier: '@taiga-ui/cdk' },
2658
- to: { name: 'TuiDeepPartial', moduleSpecifier: '@taiga-ui/addon-doc' },
2659
- },
2660
2533
  {
2661
2534
  from: { name: 'TUI_FOCUSABLE_ITEM_ACCESSOR', moduleSpecifier: '@taiga-ui/cdk' },
2662
2535
  to: { name: 'TUI_FOCUSABLE_ITEM_ACCESSOR', moduleSpecifier: '@taiga-ui/legacy' },
@@ -2,15 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TYPES_TO_RENAME = void 0;
4
4
  exports.TYPES_TO_RENAME = [
5
- {
6
- from: 'TuiDocExample',
7
- to: 'Record<string, TuiRawLoaderContent>',
8
- moduleSpecifier: ['@taiga-ui/addon-doc'],
9
- removeImport: true,
10
- newImports: [
11
- { name: 'TuiRawLoaderContent', moduleSpecifier: '@taiga-ui/addon-doc' },
12
- ],
13
- },
14
5
  {
15
6
  from: 'TuiBrightness',
16
7
  to: "'onDark' | 'onLight'",
@@ -7,6 +7,7 @@ export * from './migrate-number-format-settings';
7
7
  export * from './migrate-option-providers';
8
8
  export * from './migrate-proprietary';
9
9
  export * from './migrate-templates';
10
+ export * from './remove-duplicates';
10
11
  export * from './restore-tui-mapper';
11
12
  export * from './restore-tui-matcher';
12
13
  export * from './styles';
@@ -10,6 +10,7 @@ tslib_1.__exportStar(require("./migrate-number-format-settings"), exports);
10
10
  tslib_1.__exportStar(require("./migrate-option-providers"), exports);
11
11
  tslib_1.__exportStar(require("./migrate-proprietary"), exports);
12
12
  tslib_1.__exportStar(require("./migrate-templates"), exports);
13
+ tslib_1.__exportStar(require("./remove-duplicates"), exports);
13
14
  tslib_1.__exportStar(require("./restore-tui-mapper"), exports);
14
15
  tslib_1.__exportStar(require("./restore-tui-matcher"), exports);
15
16
  tslib_1.__exportStar(require("./styles"), exports);
@@ -53,21 +53,19 @@ function migrateAlertService(options) {
53
53
  .map((x) => { var _a; return (_a = x.getFirstAncestorByKind(ng_morph_1.SyntaxKind.Parameter)) === null || _a === void 0 ? void 0 : _a.findReferencesAsNodes(); })
54
54
  .flat()
55
55
  .map(toAlertServiceOpenCallExpression);
56
- const inlineAlertOptions = [
57
- ...viaDirectInjects,
58
- ...viaClassProperty,
59
- ...viaConstructorParam,
60
- ]
61
- .map((callExpression) => {
56
+ const inlineAlertOptions = [];
57
+ [...viaDirectInjects, ...viaClassProperty, ...viaConstructorParam].forEach((callExpression) => {
62
58
  if (!callExpression || callExpression.wasForgotten()) {
63
59
  return;
64
60
  }
65
61
  const [, arg] = callExpression.getArguments();
66
- return (arg === null || arg === void 0 ? void 0 : arg.isKind(ng_morph_1.SyntaxKind.PropertyAccessExpression))
62
+ const expression = (arg === null || arg === void 0 ? void 0 : arg.isKind(ng_morph_1.SyntaxKind.PropertyAccessExpression))
67
63
  ? findOptionsInitializer(arg)
68
64
  : arg;
69
- })
70
- .filter(ng_morph_1.Node.isObjectLiteralExpression);
65
+ if (ng_morph_1.Node.isObjectLiteralExpression(expression)) {
66
+ inlineAlertOptions.push(expression);
67
+ }
68
+ });
71
69
  const standaloneAlertOptions = (0, get_named_import_references_1.getNamedImportReferences)('TuiAlertOptions', '@taiga-ui/core')
72
70
  .map((n) => {
73
71
  const type = n.getFirstAncestorByKind(ng_morph_1.SyntaxKind.TypeReference);
@@ -75,7 +75,8 @@ function migrateDestroyService(options) {
75
75
  const constructor = possibleTakeUntil.getFirstAncestorByKind(ng_morph_1.SyntaxKind.Constructor);
76
76
  if (constructor) {
77
77
  // we are definitely inside an injection context
78
- return possibleTakeUntil.replaceWithText('takeUntilDestroyed()');
78
+ possibleTakeUntil.replaceWithText('takeUntilDestroyed()');
79
+ return;
79
80
  }
80
81
  // other cases when we are not sure if we are inside an injection context
81
82
  (0, add_unique_import_1.addUniqueImport)(possibleTakeUntil.getSourceFile().getFilePath(), 'DestroyRef', '@angular/core');
@@ -88,9 +89,10 @@ function migrateDestroyService(options) {
88
89
  initializer: 'inject(DestroyRef)',
89
90
  isReadonly: true,
90
91
  });
91
- return possibleTakeUntil.replaceWithText('takeUntilDestroyed(this.destroyRef)');
92
+ possibleTakeUntil.replaceWithText('takeUntilDestroyed(this.destroyRef)');
93
+ return;
92
94
  }
93
- return nodesForComments.push(node);
95
+ nodesForComments.push(node);
94
96
  });
95
97
  });
96
98
  /**
@@ -5,10 +5,10 @@ const ng_morph_1 = require("ng-morph");
5
5
  const version_1 = require("../../../../constants/version");
6
6
  const colored_log_1 = require("../../../utils/colored-log");
7
7
  function migrateProprietary(fileSystem, options) {
8
- var _a;
9
8
  try {
10
- const hasProprietary = !!((_a = (0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, '@taiga-ui/proprietary-core')) === null || _a === void 0 ? void 0 : _a.version);
11
- if (!hasProprietary) {
9
+ const proprietary = (0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, '@taiga-ui/proprietary-core') ||
10
+ (0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, '@taiga-ui/proprietary');
11
+ if (!proprietary) {
12
12
  return;
13
13
  }
14
14
  !options['skip-logs'] &&
@@ -16,10 +16,15 @@ function migrateProprietary(fileSystem, options) {
16
16
  replaceScopePackages();
17
17
  replaceProprietaryIconPath();
18
18
  removeProprietaryPackages(fileSystem);
19
+ (0, ng_morph_1.addPackageJsonDependency)(fileSystem.tree, {
20
+ name: '@taiga-ui/proprietary',
21
+ version: version_1.TUI_VERSION,
22
+ type: proprietary.type,
23
+ });
19
24
  fileSystem.commitEdits();
20
25
  (0, ng_morph_1.saveActiveProject)();
21
26
  }
22
- catch (_b) { }
27
+ catch (_a) { }
23
28
  }
24
29
  exports.migrateProprietary = migrateProprietary;
25
30
  function replaceScopePackages() {
@@ -57,9 +62,5 @@ function removeProprietaryPackages(fileSystem) {
57
62
  '@taiga-ui/proprietary-tds-icons',
58
63
  '@taiga-ui/proprietary-tds-palette',
59
64
  ].forEach((name) => (0, ng_morph_1.removePackageJsonDependency)(fileSystem.tree, name));
60
- (0, ng_morph_1.addPackageJsonDependency)(fileSystem.tree, {
61
- name: '@taiga-ui/proprietary',
62
- version: version_1.TUI_VERSION,
63
- });
64
65
  }
65
66
  exports.removeProprietaryPackages = removeProprietaryPackages;