@taiga-ui/cdk 4.8.1-canary.f683230 → 4.9.0
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/classes/control.d.ts +1 -2
- package/constants/used-icons.d.ts +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2022/classes/control.mjs +3 -4
- package/esm2022/constants/used-icons.mjs +2 -2
- package/esm2022/constants/version.mjs +2 -2
- package/esm2022/observables/zone.mjs +2 -3
- package/esm2022/pipes/index.mjs +2 -1
- package/esm2022/pipes/repeat-times/index.mjs +19 -0
- package/esm2022/pipes/repeat-times/taiga-ui-cdk-pipes-repeat-times.mjs +5 -0
- package/esm2022/tokens/window-size.mjs +23 -24
- package/esm2022/utils/miscellaneous/is-valid-url.mjs +7 -5
- package/fesm2022/taiga-ui-cdk-classes.mjs +2 -3
- package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs +25 -0
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs.map +1 -0
- package/fesm2022/taiga-ui-cdk-pipes.mjs +1 -0
- package/fesm2022/taiga-ui-cdk-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-tokens.mjs +21 -23
- package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +6 -4
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
- package/observables/zone.d.ts +1 -1
- package/package.json +368 -362
- package/pipes/index.d.ts +1 -0
- package/pipes/repeat-times/index.d.ts +7 -0
- package/schematics/index.d.ts +0 -1
- package/schematics/index.js +0 -1
- package/schematics/ng-update/steps/icons/replace-imports.js +1 -2
- package/schematics/ng-update/steps/remove-module.js +2 -3
- package/schematics/ng-update/steps/rename-types.js +2 -3
- package/schematics/ng-update/steps/replace-deep-import.js +2 -3
- package/schematics/ng-update/steps/replace-enums.js +2 -3
- package/schematics/ng-update/steps/replace-identifier.js +2 -3
- package/schematics/ng-update/steps/replace-services.js +3 -4
- package/schematics/ng-update/v4/index.js +5 -3
- package/schematics/ng-update/v4/migrate-addon-doc/index.js +2 -3
- package/schematics/ng-update/v4/migrate-css-vars/index.js +2 -3
- package/schematics/ng-update/v4/migrate-css-vars/palette.js +7 -7
- package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js +11 -2
- package/schematics/ng-update/v4/migrate-icons/index.js +2 -3
- package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +9 -0
- package/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.js +5 -0
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +0 -9
- package/schematics/ng-update/v4/steps/constants/functions.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/functions.js +10 -0
- package/schematics/ng-update/v4/steps/drop-universal-mock.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-alert-service.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-destroy-service.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-editor.d.ts +2 -2
- package/schematics/ng-update/v4/steps/migrate-editor.js +6 -9
- package/schematics/ng-update/v4/steps/migrate-legacy-mask.js +4 -5
- package/schematics/ng-update/v4/steps/migrate-month-context.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-number-format-settings.js +2 -3
- package/schematics/ng-update/v4/steps/migrate-option-providers.js +3 -4
- package/schematics/ng-update/v4/steps/migrate-proprietary.js +1 -2
- package/schematics/ng-update/v4/steps/migrate-providers-from.js +1 -2
- package/schematics/ng-update/v4/steps/migrate-root.d.ts +1 -1
- package/schematics/ng-update/v4/steps/migrate-root.js +1 -2
- package/schematics/ng-update/v4/steps/migrate-templates.js +3 -3
- package/schematics/ng-update/v4/steps/remove-duplicates.js +2 -3
- package/schematics/ng-update/v4/steps/replace-functions.d.ts +2 -0
- package/schematics/ng-update/v4/steps/replace-functions.js +19 -0
- package/schematics/ng-update/v4/steps/restore-tui-mapper.js +3 -4
- package/schematics/ng-update/v4/steps/restore-tui-matcher.js +3 -4
- package/schematics/ng-update/v4/steps/templates/migrate-label.js +16 -6
- package/schematics/ng-update/v4/steps/update-packages.js +1 -2
- package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.js +2 -3
- package/schematics/utils/progress.js +3 -3
- package/tokens/window-size.d.ts +1 -2
- package/utils/miscellaneous/is-valid-url.d.ts +3 -0
- package/schematics/utils/colored-log.d.ts +0 -11
- package/schematics/utils/colored-log.js +0 -29
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateMonthContext = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const add_unique_import_1 = require("../../../utils/add-unique-import");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
6
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
8
7
|
const import_manipulations_1 = require("../../../utils/import-manipulations");
|
9
8
|
function migrateMonthContext(options) {
|
10
9
|
!options['skip-logs'] &&
|
11
|
-
(0,
|
10
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} migrating TuiBooleanHandlerWithContext<TuiMonth, TuiMonthContext> ...`);
|
12
11
|
const monthContextRefs = (0, get_named_import_references_1.getNamedImportReferences)('TuiMonthContext', '@taiga-ui/kit');
|
13
12
|
monthContextRefs
|
14
13
|
.map((n) => n.getFirstAncestorByKind(ng_morph_1.SyntaxKind.TypeReference))
|
@@ -32,6 +31,6 @@ function migrateMonthContext(options) {
|
|
32
31
|
node.getFirstAncestorByKind(ng_morph_1.SyntaxKind.ImportSpecifier))
|
33
32
|
.filter((x) => !!x)
|
34
33
|
.forEach(import_manipulations_1.removeImport);
|
35
|
-
!options['skip-logs'] && (0,
|
34
|
+
!options['skip-logs'] && (0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} successfully migrated \n`);
|
36
35
|
}
|
37
36
|
exports.migrateMonthContext = migrateMonthContext;
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.migrateNumberFormatSettings = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
6
5
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
6
|
const OPTIONS_MIGRATIONS = {
|
8
7
|
decimalLimit: (property) => property.replaceWithText(property.getText().replace('decimalLimit', 'precision')),
|
@@ -24,7 +23,7 @@ const OPTIONS_MIGRATIONS = {
|
|
24
23
|
};
|
25
24
|
function migrateNumberFormatSettings(options) {
|
26
25
|
!options['skip-logs'] &&
|
27
|
-
(0,
|
26
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} migrating TuiNumberFormatSettings...`);
|
28
27
|
const asFunctionArgument = [
|
29
28
|
...(0, get_named_import_references_1.getNamedImportReferences)('tuiFormatNumber', '@taiga-ui/core'),
|
30
29
|
...(0, get_named_import_references_1.getNamedImportReferences)('tuiNumberFormatProvider', '@taiga-ui/core'),
|
@@ -59,6 +58,6 @@ function migrateNumberFormatSettings(options) {
|
|
59
58
|
});
|
60
59
|
});
|
61
60
|
!options['skip-logs'] &&
|
62
|
-
(0,
|
61
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} migration of TuiNumberFormatSettings completes \n`);
|
63
62
|
}
|
64
63
|
exports.migrateNumberFormatSettings = migrateNumberFormatSettings;
|
@@ -2,19 +2,18 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.migrateOptionProviders = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
6
5
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
6
|
const insert_todo_1 = require("../../../utils/insert-todo");
|
8
7
|
function migrateOptionProviders(options) {
|
9
8
|
!options['skip-logs'] &&
|
10
|
-
(0,
|
9
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} migrating providers...`);
|
11
10
|
migrateInputNumberOptions(options);
|
12
|
-
!options['skip-logs'] && (0,
|
11
|
+
!options['skip-logs'] && (0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} successfully migrated \n`);
|
13
12
|
}
|
14
13
|
exports.migrateOptionProviders = migrateOptionProviders;
|
15
14
|
function migrateInputNumberOptions(options) {
|
16
15
|
!options['skip-logs'] &&
|
17
|
-
(0,
|
16
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} tuiInputNumberOptionsProvider`);
|
18
17
|
const references = [
|
19
18
|
...(0, get_named_import_references_1.getNamedImportReferences)('tuiInputNumberOptionsProvider', '@taiga-ui/kit'),
|
20
19
|
...(0, get_named_import_references_1.getNamedImportReferences)('tuiInputNumberOptionsProvider', '@taiga-ui/legacy'),
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.removeProprietaryPackages = exports.migrateProprietary = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const version_1 = require("../../../../constants/version");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
6
|
function migrateProprietary(fileSystem, options) {
|
8
7
|
try {
|
9
8
|
const proprietary = (0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, '@taiga-ui/proprietary-core') ||
|
@@ -12,7 +11,7 @@ function migrateProprietary(fileSystem, options) {
|
|
12
11
|
return;
|
13
12
|
}
|
14
13
|
!options['skip-logs'] &&
|
15
|
-
(0,
|
14
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} migrating proprietary...`);
|
16
15
|
replaceScopePackages();
|
17
16
|
replaceProprietaryIconPath();
|
18
17
|
removeProprietaryPackages(fileSystem);
|
@@ -2,11 +2,10 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.migrateImportProvidersFrom = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
6
5
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
6
|
function migrateImportProvidersFrom(options) {
|
8
7
|
!options['skip-logs'] &&
|
9
|
-
(0,
|
8
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} updating importProvidersFrom`);
|
10
9
|
const refs = [
|
11
10
|
...(0, get_named_import_references_1.getNamedImportReferences)('TuiDialogModule', '@taiga-ui/core'),
|
12
11
|
...(0, get_named_import_references_1.getNamedImportReferences)('TuiAlertModule', '@taiga-ui/core'),
|
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateRoot = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const add_unique_import_1 = require("../../../utils/add-unique-import");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
6
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
8
7
|
const import_manipulations_1 = require("../../../utils/import-manipulations");
|
9
8
|
function migrateRoot(fileSystem, options) {
|
10
9
|
!options['skip-logs'] &&
|
11
|
-
(0,
|
10
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} updating TuiRoot`);
|
12
11
|
const refs = [
|
13
12
|
...(0, get_named_import_references_1.getNamedImportReferences)('TuiRootModule', '@taiga-ui/core'),
|
14
13
|
...(0, get_named_import_references_1.getNamedImportReferences)('TuiProprietaryRootModule', '@taiga-ui/proprietary-core'),
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.migrateTemplates = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
4
5
|
const constants_1 = require("../../../constants");
|
5
6
|
const add_import_to_closest_module_1 = require("../../../utils/add-import-to-closest-module");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
7
|
const progress_1 = require("../../../utils/progress");
|
8
8
|
const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
|
9
9
|
const template_resource_1 = require("../../../utils/templates/template-resource");
|
@@ -18,7 +18,7 @@ function getAction({ action, requiredData, }) {
|
|
18
18
|
}
|
19
19
|
function migrateTemplates(fileSystem, options) {
|
20
20
|
!options['skip-logs'] &&
|
21
|
-
(0,
|
21
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} migrating templates...`);
|
22
22
|
const componentWithTemplatesPaths = (0, get_component_templates_1.getComponentTemplates)(constants_1.ALL_TS_FILES);
|
23
23
|
const actions = [
|
24
24
|
getAction({ action: templates_1.addHTMLCommentTags, requiredData: constants_2.HTML_COMMENTS }),
|
@@ -69,6 +69,6 @@ function migrateTemplates(fileSystem, options) {
|
|
69
69
|
fileSystem.commitEdits();
|
70
70
|
(0, add_import_to_closest_module_1.saveAddedImports)();
|
71
71
|
!options['skip-logs'] &&
|
72
|
-
(0,
|
72
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} templates migrated \n`);
|
73
73
|
}
|
74
74
|
exports.migrateTemplates = migrateTemplates;
|
@@ -3,10 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.removeDuplicates = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const constants_1 = require("../../../constants");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
6
|
function removeDuplicates(options) {
|
8
7
|
!options['skip-logs'] &&
|
9
|
-
(0,
|
8
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} removing duplicates...`);
|
10
9
|
const classes = (0, ng_morph_1.getClasses)(constants_1.ALL_TS_FILES);
|
11
10
|
const modules = (0, ng_morph_1.getDecorators)(classes, { name: 'NgModule' });
|
12
11
|
const components = (0, ng_morph_1.getDecorators)(classes, { name: 'Component' });
|
@@ -36,6 +35,6 @@ function removeDuplicates(options) {
|
|
36
35
|
indexToRemove.forEach((index, i) => importsInitializer.removeElement(index - i));
|
37
36
|
});
|
38
37
|
!options['skip-logs'] &&
|
39
|
-
(0,
|
38
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} duplicates removed \n`);
|
40
39
|
}
|
41
40
|
exports.removeDuplicates = removeDuplicates;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.replaceFunctions = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
6
|
+
function replaceFunctions(functions) {
|
7
|
+
functions.forEach(({ from, to, moduleSpecifier }) => {
|
8
|
+
(0, get_named_import_references_1.getNamedImportReferences)(from, moduleSpecifier).forEach((ref) => {
|
9
|
+
if (ref.wasForgotten()) {
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
const parent = ref.getParent();
|
13
|
+
if (ng_morph_1.Node.isImportSpecifier(parent) || ng_morph_1.Node.isCallExpression(parent)) {
|
14
|
+
parent === null || parent === void 0 ? void 0 : parent.replaceWithText(parent === null || parent === void 0 ? void 0 : parent.getText({ includeJsDocComments: false }).trim().replace(from, to !== null && to !== void 0 ? to : from));
|
15
|
+
}
|
16
|
+
});
|
17
|
+
});
|
18
|
+
}
|
19
|
+
exports.replaceFunctions = replaceFunctions;
|
@@ -2,12 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.restoreTuiMapper = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
6
5
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
6
|
const replace_identifier_1 = require("../../steps/replace-identifier");
|
8
7
|
function updateTuiMapper(options) {
|
9
8
|
!options['skip-logs'] &&
|
10
|
-
(0,
|
9
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} updating TuiMapper typing to the typed version`);
|
11
10
|
const refs = (0, get_named_import_references_1.getNamedImportReferences)('TuiMapper', '@taiga-ui/cdk');
|
12
11
|
for (const ref of refs) {
|
13
12
|
if (ref.wasForgotten()) {
|
@@ -26,7 +25,7 @@ function updateTuiMapper(options) {
|
|
26
25
|
}
|
27
26
|
function renameTuiTypedMapper(options) {
|
28
27
|
!options['skip-logs'] &&
|
29
|
-
(0,
|
28
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} renaming TuiTypedMapper to TuiMapper`);
|
30
29
|
(0, replace_identifier_1.replaceIdentifier)({
|
31
30
|
from: { name: 'TuiTypedMapper', moduleSpecifier: '@taiga-ui/cdk' },
|
32
31
|
to: { name: 'TuiMapper', moduleSpecifier: '@taiga-ui/cdk' },
|
@@ -35,6 +34,6 @@ function renameTuiTypedMapper(options) {
|
|
35
34
|
function restoreTuiMapper(options) {
|
36
35
|
updateTuiMapper(options);
|
37
36
|
renameTuiTypedMapper(options);
|
38
|
-
!options['skip-logs'] && (0,
|
37
|
+
!options['skip-logs'] && (0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} successfully migrated \n`);
|
39
38
|
}
|
40
39
|
exports.restoreTuiMapper = restoreTuiMapper;
|
@@ -2,12 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.restoreTuiMatcher = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
6
5
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
6
|
const replace_identifier_1 = require("../../steps/replace-identifier");
|
8
7
|
function updateTuiMatcher(options) {
|
9
8
|
!options['skip-logs'] &&
|
10
|
-
(0,
|
9
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} updating TuiMatcher typing to the typed version`);
|
11
10
|
const refs = (0, get_named_import_references_1.getNamedImportReferences)('TuiMatcher', '@taiga-ui/cdk');
|
12
11
|
for (const ref of refs) {
|
13
12
|
if (ref.wasForgotten()) {
|
@@ -26,7 +25,7 @@ function updateTuiMatcher(options) {
|
|
26
25
|
}
|
27
26
|
function renameTuiTypedMatcher(options) {
|
28
27
|
!options['skip-logs'] &&
|
29
|
-
(0,
|
28
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} renaming TuiTypedMatcher to TuiMatcher`);
|
30
29
|
(0, replace_identifier_1.replaceIdentifier)({
|
31
30
|
from: { name: 'TuiTypedMatcher', moduleSpecifier: '@taiga-ui/cdk' },
|
32
31
|
to: { name: 'TuiMatcher', moduleSpecifier: '@taiga-ui/cdk' },
|
@@ -35,6 +34,6 @@ function renameTuiTypedMatcher(options) {
|
|
35
34
|
function restoreTuiMatcher(options) {
|
36
35
|
updateTuiMatcher(options);
|
37
36
|
renameTuiTypedMatcher(options);
|
38
|
-
!options['skip-logs'] && (0,
|
37
|
+
!options['skip-logs'] && (0, ng_morph_1.titleLog)(`${ng_morph_1.FINISH_SYMBOL} successfully migrated \n`);
|
39
38
|
}
|
40
39
|
exports.restoreTuiMatcher = restoreTuiMatcher;
|
@@ -8,7 +8,7 @@ function migrateLabel({ resource, recorder, fileSystem, }) {
|
|
8
8
|
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
9
9
|
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
10
10
|
const labelElements = (0, elements_1.findElementsByTagName)(template, 'label', ({ attrs }) => attrs.some(({ name }) => name === 'tuilabel' || name === '[tuilabel]'));
|
11
|
-
labelElements.forEach(({ attrs, sourceCodeLocation }) => {
|
11
|
+
labelElements.forEach(({ attrs, sourceCodeLocation, childNodes }) => {
|
12
12
|
const labelAttr = (0, inputs_1.findAttr)(attrs, 'tuilabel');
|
13
13
|
if (!labelAttr || !sourceCodeLocation) {
|
14
14
|
return;
|
@@ -18,19 +18,29 @@ function migrateLabel({ resource, recorder, fileSystem, }) {
|
|
18
18
|
sourceCodeLocation,
|
19
19
|
recorder,
|
20
20
|
templateOffset,
|
21
|
+
childNodes,
|
21
22
|
});
|
22
23
|
});
|
23
24
|
}
|
24
25
|
exports.migrateLabel = migrateLabel;
|
25
|
-
function migrateValue({ valueAttr, sourceCodeLocation, recorder, templateOffset, }) {
|
26
|
-
var _a
|
26
|
+
function migrateValue({ valueAttr, sourceCodeLocation, recorder, templateOffset, childNodes, }) {
|
27
|
+
var _a;
|
27
28
|
const attrValue = valueAttr === null || valueAttr === void 0 ? void 0 : valueAttr.value;
|
28
|
-
const
|
29
|
+
const { startTag, endTag } = sourceCodeLocation;
|
30
|
+
const insertTo = startTag === null || startTag === void 0 ? void 0 : startTag.endOffset;
|
29
31
|
if (!attrValue || !insertTo) {
|
30
32
|
return;
|
31
33
|
}
|
32
|
-
|
33
|
-
|
34
|
+
const onlyTextContent = childNodes.length && childNodes.every((node) => node.nodeName === '#text');
|
35
|
+
if (onlyTextContent && startTag && endTag) {
|
36
|
+
const content = `<span tuiTitle><span tuiSubtitle>${valueAttr.name === 'tuilabel' ? attrValue : `{{ ${attrValue} }}`}</span>`;
|
37
|
+
recorder.insertRight(templateOffset + insertTo, content);
|
38
|
+
recorder.insertLeft(templateOffset + endTag.startOffset, '</span>');
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
recorder.insertRight(insertTo + templateOffset, valueAttr.name === 'tuilabel' ? attrValue : `{{ ${attrValue} }}`);
|
42
|
+
}
|
43
|
+
const attrOffset = (_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[valueAttr.name];
|
34
44
|
if (attrOffset) {
|
35
45
|
const { startOffset, endOffset } = attrOffset;
|
36
46
|
recorder.remove(templateOffset + startOffset, endOffset - startOffset);
|
@@ -4,7 +4,6 @@ exports.updatePackages = exports.TUI_EVENT_PLUGINS_VERSION = exports.TUI_DOMPURI
|
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const version_1 = require("../../../../constants/version");
|
6
6
|
const constants_1 = require("../../../constants");
|
7
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
8
7
|
const steps_1 = require("../../steps");
|
9
8
|
exports.TUI_POLYMORPHEUS_VERSION = '^4.7.3';
|
10
9
|
exports.TUI_DOMPURIFY_VERSION = '^4.7.3';
|
@@ -47,7 +46,7 @@ function updatePackages({ tree }) {
|
|
47
46
|
}
|
48
47
|
catch (e) {
|
49
48
|
const error = e;
|
50
|
-
(0,
|
49
|
+
(0, ng_morph_1.errorLog)(`ATTENTION: An error occurred during migration: ${error.message}\n${error.stack}`);
|
51
50
|
}
|
52
51
|
}
|
53
52
|
exports.updatePackages = updatePackages;
|
@@ -3,15 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.replaceModulesWithProviders = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const add_unique_import_1 = require("../../../../utils/add-unique-import");
|
6
|
-
const colored_log_1 = require("../../../../utils/colored-log");
|
7
6
|
const get_named_import_references_1 = require("../../../../utils/get-named-import-references");
|
8
7
|
const import_manipulations_1 = require("../../../../utils/import-manipulations");
|
9
8
|
const replaceModulesWithProviders = (options, list) => {
|
10
9
|
!options['skip-logs'] &&
|
11
|
-
(0,
|
10
|
+
(0, ng_morph_1.infoLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.REPLACE_SYMBOL} replacing modules with providers...`);
|
12
11
|
list.forEach(replaceModule);
|
13
12
|
!options['skip-logs'] &&
|
14
|
-
(0,
|
13
|
+
(0, ng_morph_1.successLog)(`${ng_morph_1.SMALL_TAB_SYMBOL}${ng_morph_1.SUCCESS_SYMBOL} modules replaced \n`);
|
15
14
|
};
|
16
15
|
exports.replaceModulesWithProviders = replaceModulesWithProviders;
|
17
16
|
function replaceModule({ from, to }) {
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setupProgressLogger = void 0;
|
4
4
|
/// <reference types="node" />
|
5
5
|
const node_readline_1 = require("node:readline");
|
6
|
-
const
|
6
|
+
const ng_morph_1 = require("ng-morph");
|
7
7
|
const is_ci_1 = require("./is-ci");
|
8
8
|
function setupProgressLogger({ total, prefix = '', tabs = 2, }) {
|
9
9
|
let i = 1;
|
@@ -12,11 +12,11 @@ function setupProgressLogger({ total, prefix = '', tabs = 2, }) {
|
|
12
12
|
return;
|
13
13
|
}
|
14
14
|
const isLast = i === total;
|
15
|
-
const progressLog = `(${i} / ${total}) ${prefix} ${isLast ?
|
15
|
+
const progressLog = `(${i} / ${total}) ${prefix} ${isLast ? ng_morph_1.SUCCESS_SYMBOL : message}`;
|
16
16
|
i = incrementIndex ? i + 1 : i;
|
17
17
|
(0, node_readline_1.clearLine)(process.stdout, 0);
|
18
18
|
(0, node_readline_1.cursorTo)(process.stdout, 0);
|
19
|
-
process.stdout.write(
|
19
|
+
process.stdout.write(ng_morph_1.SMALL_TAB_SYMBOL.repeat(tabs) + progressLog);
|
20
20
|
if (isLast && incrementIndex) {
|
21
21
|
process.stdout.write('\n');
|
22
22
|
}
|
package/tokens/window-size.d.ts
CHANGED
@@ -1,11 +0,0 @@
|
|
1
|
-
export declare function processLog(message: string): void;
|
2
|
-
export declare function errorLog(message: string): void;
|
3
|
-
export declare function successLog(message: string): void;
|
4
|
-
export declare function infoLog(message: string): void;
|
5
|
-
export declare function titleLog(message: string): void;
|
6
|
-
export declare const SMALL_TAB_SYMBOL = " ";
|
7
|
-
export declare const START_SYMBOL = "\uD83D\uDE80";
|
8
|
-
export declare const FINISH_SYMBOL = "\uD83C\uDFC6";
|
9
|
-
export declare const REPLACE_SYMBOL = "\u26A1\uFE0F";
|
10
|
-
export declare const PROCESSING_SYMBOL = "> ";
|
11
|
-
export declare const SUCCESS_SYMBOL = "\u2705 ";
|
@@ -1,29 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.SUCCESS_SYMBOL = exports.PROCESSING_SYMBOL = exports.REPLACE_SYMBOL = exports.FINISH_SYMBOL = exports.START_SYMBOL = exports.SMALL_TAB_SYMBOL = exports.titleLog = exports.infoLog = exports.successLog = exports.errorLog = exports.processLog = void 0;
|
4
|
-
function processLog(message) {
|
5
|
-
console.info('\x1B[36m%s\x1B[0m', message);
|
6
|
-
}
|
7
|
-
exports.processLog = processLog;
|
8
|
-
function errorLog(message) {
|
9
|
-
console.info('\x1B[31m%s\x1B[0m', message);
|
10
|
-
}
|
11
|
-
exports.errorLog = errorLog;
|
12
|
-
function successLog(message) {
|
13
|
-
console.info('\x1B[32m%s\x1B[0m', message);
|
14
|
-
}
|
15
|
-
exports.successLog = successLog;
|
16
|
-
function infoLog(message) {
|
17
|
-
console.info('\x1B[34m%s\x1B[0m', message);
|
18
|
-
}
|
19
|
-
exports.infoLog = infoLog;
|
20
|
-
function titleLog(message) {
|
21
|
-
console.info('\x1B[35m', message);
|
22
|
-
}
|
23
|
-
exports.titleLog = titleLog;
|
24
|
-
exports.SMALL_TAB_SYMBOL = ' '; // @note: if you use \t then we have big gaps
|
25
|
-
exports.START_SYMBOL = '🚀';
|
26
|
-
exports.FINISH_SYMBOL = '🏆';
|
27
|
-
exports.REPLACE_SYMBOL = '⚡️';
|
28
|
-
exports.PROCESSING_SYMBOL = '> ';
|
29
|
-
exports.SUCCESS_SYMBOL = '✅ ';
|