@taiga-ui/cdk 4.6.0 → 4.7.0-canary.88a8f5b
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 -1
- 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 +1 -1
- package/esm2022/constants/used-icons.mjs +3 -2
- package/esm2022/constants/version.mjs +2 -2
- package/esm2022/services/scroll.service.mjs +5 -3
- package/esm2022/tokens/active-element.mjs +5 -4
- package/esm2022/tokens/environment.mjs +7 -3
- package/esm2022/utils/browser/is-safari.mjs +2 -2
- package/esm2022/utils/color/hex-to-rgba.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +3 -2
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-services.mjs +4 -2
- package/fesm2022/taiga-ui-cdk-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-tokens.mjs +10 -5
- package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-browser.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-utils-browser.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-color.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-utils-color.mjs.map +1 -1
- package/package.json +362 -362
- package/schematics/ng-update/v4/index.js +3 -1
- package/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.js +1 -1
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +20 -20
- package/schematics/ng-update/v4/steps/constants/modules-to-remove.js +8 -0
- package/schematics/ng-update/v4/steps/migrate-providers-from.d.ts +2 -0
- package/schematics/ng-update/v4/steps/migrate-providers-from.js +32 -0
- package/schematics/ng-update/v4/steps/templates/migrate-button-appearance.js +2 -2
- package/schematics/ng-update/v4/steps/update-packages.d.ts +1 -2
- package/schematics/ng-update/v4/steps/update-packages.js +14 -12
- package/services/scroll.service.d.ts +1 -0
@@ -18,11 +18,13 @@ const modules_to_replace_1 = require("./steps/constants/modules-to-replace");
|
|
18
18
|
const types_1 = require("./steps/constants/types");
|
19
19
|
const drop_universal_mock_1 = require("./steps/drop-universal-mock");
|
20
20
|
const migrate_editor_1 = require("./steps/migrate-editor");
|
21
|
+
const migrate_providers_from_1 = require("./steps/migrate-providers-from");
|
21
22
|
const migrate_root_1 = require("./steps/migrate-root");
|
22
23
|
const replace_modules_with_providers_1 = require("./steps/utils/replace-modules-with-providers");
|
23
24
|
function main(options) {
|
24
25
|
return (tree, context) => {
|
25
26
|
const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
|
27
|
+
(0, migrate_providers_from_1.migrateImportProvidersFrom)(options);
|
26
28
|
(0, migrate_editor_1.migrateEditor)(fileSystem, options);
|
27
29
|
(0, steps_1.replaceEnums)(options, enums_1.ENUMS_TO_REPLACE);
|
28
30
|
(0, migrate_root_1.migrateRoot)(fileSystem, options);
|
@@ -49,7 +51,7 @@ function main(options) {
|
|
49
51
|
(0, steps_2.removeDuplicates)(options);
|
50
52
|
(0, steps_2.migrateStyles)();
|
51
53
|
(0, steps_2.migrateProprietary)(fileSystem, options);
|
52
|
-
(0, steps_2.updatePackages)(fileSystem
|
54
|
+
(0, steps_2.updatePackages)(fileSystem);
|
53
55
|
fileSystem.commitEdits();
|
54
56
|
(0, ng_morph_1.saveActiveProject)();
|
55
57
|
context.addTask(new tasks_1.NodePackageInstallTask());
|
@@ -42,7 +42,7 @@ exports.ATTR_WITH_VALUES_TO_REPLACE = [
|
|
42
42
|
},
|
43
43
|
{
|
44
44
|
attrNames: ['[pseudoInvalid]'],
|
45
|
-
newAttrName: '[
|
45
|
+
newAttrName: '[tuiAppearanceMode]',
|
46
46
|
withTagNames: hasPseudoInvalid,
|
47
47
|
valueReplacer: (condition) => `${condition} ? 'invalid' : null`,
|
48
48
|
},
|
@@ -1311,6 +1311,26 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
1311
1311
|
spreadInModule: true,
|
1312
1312
|
},
|
1313
1313
|
},
|
1314
|
+
{
|
1315
|
+
from: {
|
1316
|
+
name: 'TuiPreviewDialogModule',
|
1317
|
+
moduleSpecifier: '@taiga-ui/addon-preview',
|
1318
|
+
},
|
1319
|
+
to: {
|
1320
|
+
name: 'TuiPreviewDialog',
|
1321
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1322
|
+
},
|
1323
|
+
},
|
1324
|
+
{
|
1325
|
+
from: {
|
1326
|
+
name: 'TuiPreviewDialogService',
|
1327
|
+
moduleSpecifier: '@taiga-ui/addon-preview',
|
1328
|
+
},
|
1329
|
+
to: {
|
1330
|
+
name: 'TuiPreviewDialogService',
|
1331
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1332
|
+
},
|
1333
|
+
},
|
1314
1334
|
{
|
1315
1335
|
from: {
|
1316
1336
|
name: 'TuiBlockStatusModule',
|
@@ -1376,26 +1396,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
1376
1396
|
spreadInModule: true,
|
1377
1397
|
},
|
1378
1398
|
},
|
1379
|
-
{
|
1380
|
-
from: {
|
1381
|
-
name: 'TuiPreviewDialogModule',
|
1382
|
-
moduleSpecifier: '@taiga-ui/addon-preview',
|
1383
|
-
},
|
1384
|
-
to: {
|
1385
|
-
name: 'TuiPreviewDialog',
|
1386
|
-
moduleSpecifier: '@taiga-ui/kit',
|
1387
|
-
},
|
1388
|
-
},
|
1389
|
-
{
|
1390
|
-
from: {
|
1391
|
-
name: 'TuiPreviewDialogService',
|
1392
|
-
moduleSpecifier: '@taiga-ui/addon-preview',
|
1393
|
-
},
|
1394
|
-
to: {
|
1395
|
-
name: 'TuiPreviewDialogService',
|
1396
|
-
moduleSpecifier: '@taiga-ui/kit',
|
1397
|
-
},
|
1398
|
-
},
|
1399
1399
|
{
|
1400
1400
|
from: {
|
1401
1401
|
name: 'PolymorpheusModule',
|
@@ -22,6 +22,10 @@ exports.MODULES_TO_REMOVE = [
|
|
22
22
|
name: 'TuiPromptModule',
|
23
23
|
moduleSpecifier: '@taiga-ui/kit',
|
24
24
|
},
|
25
|
+
{
|
26
|
+
name: 'TuiPdfViewerModule',
|
27
|
+
moduleSpecifier: '@taiga-ui/kit',
|
28
|
+
},
|
25
29
|
{
|
26
30
|
name: 'TuiThemeTinkoff2023NightModule',
|
27
31
|
moduleSpecifier: '@taiga-ui/proprietary-core',
|
@@ -46,4 +50,8 @@ exports.MODULES_TO_REMOVE = [
|
|
46
50
|
name: 'TuiMobileTabsModule',
|
47
51
|
moduleSpecifier: '@taiga-ui/addon-mobile',
|
48
52
|
},
|
53
|
+
{
|
54
|
+
name: 'TuiPreviewActionModule',
|
55
|
+
moduleSpecifier: '@taiga-ui/addon-preview',
|
56
|
+
},
|
49
57
|
];
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateImportProvidersFrom = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const colored_log_1 = require("../../../utils/colored-log");
|
6
|
+
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
|
+
function migrateImportProvidersFrom(options) {
|
8
|
+
!options['skip-logs'] &&
|
9
|
+
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} updating importProvidersFrom`);
|
10
|
+
const refs = [
|
11
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('TuiDialogModule', '@taiga-ui/core'),
|
12
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('TuiAlertModule', '@taiga-ui/core'),
|
13
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('TuiPushModule', '@taiga-ui/kit'),
|
14
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('TuiPdfViewerModule', '@taiga-ui/kit'),
|
15
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('TuiPreviewModule', '@taiga-ui/addon-preview'),
|
16
|
+
];
|
17
|
+
for (const ref of refs) {
|
18
|
+
if (ref.wasForgotten()) {
|
19
|
+
return;
|
20
|
+
}
|
21
|
+
const callExpression = ref.getParentWhile(ng_morph_1.Node.isCallExpression);
|
22
|
+
if ((callExpression === null || callExpression === void 0 ? void 0 : callExpression.getExpression().getText()) === 'importProvidersFrom') {
|
23
|
+
const node = callExpression
|
24
|
+
.getArguments()
|
25
|
+
.find((arg) => arg.getText() === ref.getText());
|
26
|
+
if (node) {
|
27
|
+
callExpression.removeArgument(node);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
exports.migrateImportProvidersFrom = migrateImportProvidersFrom;
|
@@ -27,7 +27,7 @@ function migrateButtonAppearance({ resource, recorder, fileSystem, }) {
|
|
27
27
|
(0, remove_attrs_1.removeAttrs)([whiteBlockActiveAttr], sourceCodeLocation, recorder, templateOffset);
|
28
28
|
const { startOffset } = ((_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[whiteBlockActiveAttr.name]) || { startOffset: 0, endOffset: 0 };
|
29
29
|
recorder.insertLeft(startOffset + templateOffset, ` ${appearanceInputName}="whiteblock"`);
|
30
|
-
recorder.insertLeft(startOffset + templateOffset, '
|
30
|
+
recorder.insertLeft(startOffset + templateOffset, ' tuiAppearanceMode="checked"');
|
31
31
|
}
|
32
32
|
});
|
33
33
|
const elementWithConditionAppearance = elements.find(({ attrs }) => attrs.some(({ name, value }) => name === `[${appearanceInputName}]` && !value.trim().startsWith("'")));
|
@@ -37,5 +37,5 @@ function migrateButtonAppearance({ resource, recorder, fileSystem, }) {
|
|
37
37
|
}
|
38
38
|
exports.migrateButtonAppearance = migrateButtonAppearance;
|
39
39
|
function addTodo(recorder, templateOffset) {
|
40
|
-
recorder.insertRight(templateOffset, '<!-- Taiga migration TODO: tuiButton "whiteblock-active" appearance is no longer available. Use \'appearance="whiteblock"
|
40
|
+
recorder.insertRight(templateOffset, '<!-- Taiga migration TODO: tuiButton "whiteblock-active" appearance is no longer available. Use \'appearance="whiteblock" tuiAppearanceMode="checked"\' -->\n');
|
41
41
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
/// <reference lib="es2021" />
|
2
2
|
import type { DevkitFileSystem } from 'ng-morph';
|
3
|
-
import type { TuiSchema } from '../../../ng-add/schema';
|
4
3
|
export declare const TUI_POLYMORPHEUS_VERSION = "^4.6.4";
|
5
4
|
export declare const TUI_DOMPURIFY_VERSION = "^4.1.2";
|
6
5
|
export declare const TUI_EVENT_PLUGINS_VERSION = "^4.0.1";
|
7
|
-
export declare function updatePackages({ tree }: DevkitFileSystem
|
6
|
+
export declare function updatePackages({ tree }: DevkitFileSystem): void;
|
@@ -4,11 +4,12 @@ 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");
|
7
8
|
const steps_1 = require("../../steps");
|
8
9
|
exports.TUI_POLYMORPHEUS_VERSION = '^4.6.4';
|
9
10
|
exports.TUI_DOMPURIFY_VERSION = '^4.1.2';
|
10
11
|
exports.TUI_EVENT_PLUGINS_VERSION = '^4.0.1';
|
11
|
-
function updatePackages({ tree }
|
12
|
+
function updatePackages({ tree }) {
|
12
13
|
const packagesToRemove = ['@taiga-ui/addon-tablebars', '@taiga-ui/addon-preview'];
|
13
14
|
packagesToRemove.forEach((pkg) => {
|
14
15
|
(0, ng_morph_1.removePackageJsonDependency)(tree, pkg);
|
@@ -33,19 +34,20 @@ function updatePackages({ tree }, _) {
|
|
33
34
|
type: cdk === null || cdk === void 0 ? void 0 : cdk.type,
|
34
35
|
});
|
35
36
|
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
try {
|
38
|
+
['@taiga-ui/layout', '@taiga-ui/legacy'].forEach((moduleSpecifier) => {
|
39
|
+
if ((0, ng_morph_1.getImports)(constants_1.ALL_TS_FILES, { moduleSpecifier }).length) {
|
40
|
+
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|
41
|
+
name: moduleSpecifier,
|
42
|
+
version: version_1.TUI_VERSION,
|
43
|
+
type: cdk === null || cdk === void 0 ? void 0 : cdk.type,
|
44
|
+
});
|
45
|
+
}
|
41
46
|
});
|
42
47
|
}
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
version: version_1.TUI_VERSION,
|
47
|
-
type: cdk === null || cdk === void 0 ? void 0 : cdk.type,
|
48
|
-
});
|
48
|
+
catch (e) {
|
49
|
+
const error = e;
|
50
|
+
(0, colored_log_1.errorLog)(`ATTENTION: An error occurred during migration: ${error.message}\n${error.stack}`);
|
49
51
|
}
|
50
52
|
}
|
51
53
|
exports.updatePackages = updatePackages;
|
@@ -3,6 +3,7 @@ import * as i0 from "@angular/core";
|
|
3
3
|
export declare class TuiScrollService {
|
4
4
|
private readonly performanceRef;
|
5
5
|
private readonly animationFrame$;
|
6
|
+
private readonly zone;
|
6
7
|
scroll$(elementOrWindow: Element | Window, scrollTop: number, scrollLeft?: number, duration?: number): Observable<[number, number]>;
|
7
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiScrollService, never>;
|
8
9
|
static ɵprov: i0.ɵɵInjectableDeclaration<TuiScrollService>;
|