@taiga-ui/cdk 4.5.0-canary.50decb3 → 4.5.0-canary.538706d
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/esm2022/directives/obscured/obscured.service.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/constants/taiga-styles.d.ts +0 -2
- package/schematics/constants/taiga-styles.js +1 -3
- package/schematics/ng-add/index.js +4 -7
- package/schematics/ng-add/schema.d.ts +0 -1
- package/schematics/ng-add/schema.json +0 -9
- package/schematics/ng-add/steps/add-taiga-modules.js +2 -0
- package/schematics/ng-add/steps/add-taiga-styles.js +1 -4
- package/schematics/ng-update/v4/index.js +2 -0
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +0 -41
- package/schematics/ng-update/v4/steps/migrate-editor.d.ts +5 -0
- package/schematics/ng-update/v4/steps/migrate-editor.js +77 -0
- package/schematics/ng-update/v4/steps/update-packages.d.ts +0 -1
- package/schematics/ng-update/v4/steps/update-packages.js +1 -6
@@ -1,6 +1,6 @@
|
|
1
1
|
import { inject, Injectable } from '@angular/core';
|
2
2
|
import { WA_ANIMATION_FRAME } from '@ng-web-apis/common';
|
3
|
-
import { tuiZoneOptimized } from '@taiga-ui/cdk/observables';
|
3
|
+
import { tuiZonefreeScheduler, tuiZoneOptimized } from '@taiga-ui/cdk/observables';
|
4
4
|
import { tuiGetElementObscures, tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
5
5
|
import { distinctUntilChanged, map, Observable, startWith, throttleTime } from 'rxjs';
|
6
6
|
import * as i0 from "@angular/core";
|
@@ -12,7 +12,7 @@ class TuiObscuredService extends Observable {
|
|
12
12
|
constructor() {
|
13
13
|
super((subscriber) => this.obscured$.subscribe(subscriber));
|
14
14
|
this.el = tuiInjectElement();
|
15
|
-
this.obscured$ = inject(WA_ANIMATION_FRAME).pipe(throttleTime(100), map(() => tuiGetElementObscures(this.el)), startWith(null), distinctUntilChanged(), tuiZoneOptimized());
|
15
|
+
this.obscured$ = inject(WA_ANIMATION_FRAME).pipe(throttleTime(100, tuiZonefreeScheduler()), map(() => tuiGetElementObscures(this.el)), startWith(null), distinctUntilChanged(), tuiZoneOptimized());
|
16
16
|
}
|
17
17
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiObscuredService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
18
18
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiObscuredService }); }
|
@@ -21,4 +21,4 @@ export { TuiObscuredService };
|
|
21
21
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiObscuredService, decorators: [{
|
22
22
|
type: Injectable
|
23
23
|
}], ctorParameters: function () { return []; } });
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2JzY3VyZWQuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nkay9kaXJlY3RpdmVzL29ic2N1cmVkL29ic2N1cmVkLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLE1BQU0sRUFBRSxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDakQsT0FBTyxFQUFDLGtCQUFrQixFQUFDLE1BQU0scUJBQXFCLENBQUM7QUFDdkQsT0FBTyxFQUFDLG9CQUFvQixFQUFFLGdCQUFnQixFQUFDLE1BQU0sMkJBQTJCLENBQUM7QUFDakYsT0FBTyxFQUFDLHFCQUFxQixFQUFFLGdCQ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Y3JpYmUoc3Vic2NyaWJlcikpO1xuICAgIH1cbn1cbiJdfQ==
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { inject, Injectable, Directive, Output, Input } from '@angular/core';
|
3
3
|
import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
|
4
|
-
import { tuiZoneOptimized, tuiIfMap } from '@taiga-ui/cdk/observables';
|
4
|
+
import { tuiZonefreeScheduler, tuiZoneOptimized, tuiIfMap } from '@taiga-ui/cdk/observables';
|
5
5
|
import { Observable, throttleTime, map, startWith, distinctUntilChanged, Subject } from 'rxjs';
|
6
6
|
import { WA_ANIMATION_FRAME } from '@ng-web-apis/common';
|
7
7
|
import { tuiInjectElement, tuiGetElementObscures } from '@taiga-ui/cdk/utils/dom';
|
@@ -14,7 +14,7 @@ class TuiObscuredService extends Observable {
|
|
14
14
|
constructor() {
|
15
15
|
super((subscriber) => this.obscured$.subscribe(subscriber));
|
16
16
|
this.el = tuiInjectElement();
|
17
|
-
this.obscured$ = inject(WA_ANIMATION_FRAME).pipe(throttleTime(100), map(() => tuiGetElementObscures(this.el)), startWith(null), distinctUntilChanged(), tuiZoneOptimized());
|
17
|
+
this.obscured$ = inject(WA_ANIMATION_FRAME).pipe(throttleTime(100, tuiZonefreeScheduler()), map(() => tuiGetElementObscures(this.el)), startWith(null), distinctUntilChanged(), tuiZoneOptimized());
|
18
18
|
}
|
19
19
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiObscuredService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
20
20
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiObscuredService }); }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-obscured.mjs","sources":["../../../projects/cdk/directives/obscured/obscured.service.ts","../../../projects/cdk/directives/obscured/obscured.directive.ts","../../../projects/cdk/directives/obscured/taiga-ui-cdk-directives-obscured.ts"],"sourcesContent":["import {inject, Injectable} from '@angular/core';\nimport {WA_ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {tuiGetElementObscures, tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {distinctUntilChanged, map, Observable, startWith, throttleTime} from 'rxjs';\n\n/**\n * Service that monitors element visibility by polling and returning\n * either null or an array of elements that overlap given element edges\n */\n@Injectable()\nexport class TuiObscuredService extends Observable<readonly Element[] | null> {\n private readonly el = tuiInjectElement();\n private readonly obscured$ = inject(WA_ANIMATION_FRAME).pipe(\n throttleTime(100),\n map(() => tuiGetElementObscures(this.el)),\n startWith(null),\n distinctUntilChanged(),\n tuiZoneOptimized(),\n );\n\n constructor() {\n super((subscriber) => this.obscured$.subscribe(subscriber));\n }\n}\n","import {Directive, inject, Input, Output} from '@angular/core';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {tuiIfMap} from '@taiga-ui/cdk/observables';\nimport {map, Subject} from 'rxjs';\n\nimport {TuiObscuredService} from './obscured.service';\n\n/**\n * Directive that monitors element visibility\n */\n@Directive({\n standalone: true,\n selector: '[tuiObscured]',\n providers: [TuiObscuredService],\n})\nexport class TuiObscured {\n private readonly activeZone = inject(TuiActiveZone, {optional: true});\n private readonly enabled$ = new Subject<boolean>();\n private readonly obscured$ = inject(TuiObscuredService, {self: true}).pipe(\n map((by) => !!by?.every((el) => !this.activeZone?.contains(el))),\n );\n\n @Output()\n public readonly tuiObscured = this.enabled$.pipe(tuiIfMap(() => this.obscured$));\n\n @Input()\n public set tuiObscuredEnabled(enabled: boolean) {\n this.enabled$.next(enabled);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAMA;;;AAGG;AACH,MACa,kBAAmB,SAAQ,UAAqC,CAAA;AAUzE,IAAA,WAAA,GAAA;AACI,QAAA,KAAK,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QAV/C,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE,CAAC;AACxB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CACxD,YAAY,CAAC,GAAG,CAAC,
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-obscured.mjs","sources":["../../../projects/cdk/directives/obscured/obscured.service.ts","../../../projects/cdk/directives/obscured/obscured.directive.ts","../../../projects/cdk/directives/obscured/taiga-ui-cdk-directives-obscured.ts"],"sourcesContent":["import {inject, Injectable} from '@angular/core';\nimport {WA_ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {tuiZonefreeScheduler, tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {tuiGetElementObscures, tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {distinctUntilChanged, map, Observable, startWith, throttleTime} from 'rxjs';\n\n/**\n * Service that monitors element visibility by polling and returning\n * either null or an array of elements that overlap given element edges\n */\n@Injectable()\nexport class TuiObscuredService extends Observable<readonly Element[] | null> {\n private readonly el = tuiInjectElement();\n private readonly obscured$ = inject(WA_ANIMATION_FRAME).pipe(\n throttleTime(100, tuiZonefreeScheduler()),\n map(() => tuiGetElementObscures(this.el)),\n startWith(null),\n distinctUntilChanged(),\n tuiZoneOptimized(),\n );\n\n constructor() {\n super((subscriber) => this.obscured$.subscribe(subscriber));\n }\n}\n","import {Directive, inject, Input, Output} from '@angular/core';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {tuiIfMap} from '@taiga-ui/cdk/observables';\nimport {map, Subject} from 'rxjs';\n\nimport {TuiObscuredService} from './obscured.service';\n\n/**\n * Directive that monitors element visibility\n */\n@Directive({\n standalone: true,\n selector: '[tuiObscured]',\n providers: [TuiObscuredService],\n})\nexport class TuiObscured {\n private readonly activeZone = inject(TuiActiveZone, {optional: true});\n private readonly enabled$ = new Subject<boolean>();\n private readonly obscured$ = inject(TuiObscuredService, {self: true}).pipe(\n map((by) => !!by?.every((el) => !this.activeZone?.contains(el))),\n );\n\n @Output()\n public readonly tuiObscured = this.enabled$.pipe(tuiIfMap(() => this.obscured$));\n\n @Input()\n public set tuiObscuredEnabled(enabled: boolean) {\n this.enabled$.next(enabled);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAMA;;;AAGG;AACH,MACa,kBAAmB,SAAQ,UAAqC,CAAA;AAUzE,IAAA,WAAA,GAAA;AACI,QAAA,KAAK,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QAV/C,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE,CAAC;AACxB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CACxD,YAAY,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC,EACzC,GAAG,CAAC,MAAM,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EACzC,SAAS,CAAC,IAAI,CAAC,EACf,oBAAoB,EAAE,EACtB,gBAAgB,EAAE,CACrB,CAAC;KAID;+GAZQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;mHAAlB,kBAAkB,EAAA,CAAA,CAAA,EAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;;;ACHX;;AAEG;AACH,MAKa,WAAW,CAAA;AALxB,IAAA,WAAA,GAAA;QAMqB,IAAU,CAAA,UAAA,GAAG,MAAM,CAAC,aAAa,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CA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KAAK;;;ACzBV;;AAEG;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@taiga-ui/cdk",
|
3
|
-
"version": "4.5.0-canary.
|
3
|
+
"version": "4.5.0-canary.538706d",
|
4
4
|
"description": "Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance",
|
5
5
|
"keywords": [
|
6
6
|
"angular",
|
@@ -1,4 +1,2 @@
|
|
1
|
-
export declare const TAIGA_GLOBAL_OLD_STYLE = "node_modules/@taiga-ui/core/styles/taiga-ui-global.less";
|
2
|
-
export declare const TAIGA_GLOBAL_NEW_STYLE = "node_modules/@taiga-ui/styles/taiga-ui-global.less";
|
3
1
|
export declare const TAIGA_THEME_STYLE = "node_modules/@taiga-ui/core/styles/taiga-ui-theme.less";
|
4
2
|
export declare const TAIGA_THEME_FONTS = "node_modules/@taiga-ui/core/styles/taiga-ui-fonts.less";
|
@@ -1,7 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.TAIGA_THEME_FONTS = exports.TAIGA_THEME_STYLE =
|
4
|
-
exports.TAIGA_GLOBAL_OLD_STYLE = 'node_modules/@taiga-ui/core/styles/taiga-ui-global.less';
|
5
|
-
exports.TAIGA_GLOBAL_NEW_STYLE = 'node_modules/@taiga-ui/styles/taiga-ui-global.less';
|
3
|
+
exports.TAIGA_THEME_FONTS = exports.TAIGA_THEME_STYLE = void 0;
|
6
4
|
exports.TAIGA_THEME_STYLE = 'node_modules/@taiga-ui/core/styles/taiga-ui-theme.less';
|
7
5
|
exports.TAIGA_THEME_FONTS = 'node_modules/@taiga-ui/core/styles/taiga-ui-fonts.less';
|
@@ -14,14 +14,11 @@ function addDependencies(tree, options) {
|
|
14
14
|
type: ng_morph_1.NodeDependencyType.Default,
|
15
15
|
});
|
16
16
|
});
|
17
|
+
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|
18
|
+
name: '@taiga-ui/event-plugins',
|
19
|
+
version: '^4.0.2',
|
20
|
+
});
|
17
21
|
removeTaigaSchematicsPackage(tree);
|
18
|
-
if (options.addGlobalStyles) {
|
19
|
-
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|
20
|
-
name: '@taiga-ui/styles',
|
21
|
-
version: versions_1.TAIGA_VERSION,
|
22
|
-
type: ng_morph_1.NodeDependencyType.Default,
|
23
|
-
});
|
24
|
-
}
|
25
22
|
if (packages.includes('addon-table') || packages.includes('addon-mobile')) {
|
26
23
|
addAngularCdkDep(tree);
|
27
24
|
}
|
@@ -11,15 +11,6 @@
|
|
11
11
|
"$source": "projectName"
|
12
12
|
}
|
13
13
|
},
|
14
|
-
"addGlobalStyles": {
|
15
|
-
"description": "Setting up global styles",
|
16
|
-
"type": "boolean",
|
17
|
-
"default": false,
|
18
|
-
"x-prompt": {
|
19
|
-
"message": "Do you want to use global Taiga UI classes, such as 'tui-space', 'tui-skeleton', etc?",
|
20
|
-
"type": "confirmation"
|
21
|
-
}
|
22
|
-
},
|
23
14
|
"addons": {
|
24
15
|
"description": "Setting up additional packages",
|
25
16
|
"type": "array",
|
@@ -19,6 +19,8 @@ function addTuiModules({ mainClass, context, }) {
|
|
19
19
|
(0, ng_morph_1.addImportToNgModule)(mainClass, module.name, { unique: true });
|
20
20
|
(0, add_unique_import_1.addUniqueImport)(mainModulePath, module.name, module.packageName);
|
21
21
|
});
|
22
|
+
(0, ng_morph_1.addProviderToNgModule)(mainClass, 'NG_EVENT_PLUGINS', { unique: true });
|
23
|
+
(0, add_unique_import_1.addUniqueImport)(mainModulePath, 'NG_EVENT_PLUGINS', '@taiga-ui/event-plugins');
|
22
24
|
context.logger.info(`${modules.map((module) => module.name)} was added to ${mainModulePath}`);
|
23
25
|
}
|
24
26
|
function addTuiEntitiesToStandalone({ bootstrapFunction, options, context, }) {
|
@@ -6,10 +6,7 @@ const angular_json_manipulations_1 = require("../../utils/angular-json-manipulat
|
|
6
6
|
function addTaigaStyles(options) {
|
7
7
|
return (_, context) => {
|
8
8
|
const taigaLocalStyles = [taiga_styles_1.TAIGA_THEME_STYLE, taiga_styles_1.TAIGA_THEME_FONTS];
|
9
|
-
|
10
|
-
? [...taigaLocalStyles, taiga_styles_1.TAIGA_GLOBAL_NEW_STYLE]
|
11
|
-
: taigaLocalStyles;
|
12
|
-
return (0, angular_json_manipulations_1.addStylesToAngularJson)(options, context, taigaStyles);
|
9
|
+
return (0, angular_json_manipulations_1.addStylesToAngularJson)(options, context, taigaLocalStyles);
|
13
10
|
};
|
14
11
|
}
|
15
12
|
exports.addTaigaStyles = addTaigaStyles;
|
@@ -16,11 +16,13 @@ const steps_2 = require("./steps");
|
|
16
16
|
const constants_1 = require("./steps/constants");
|
17
17
|
const modules_to_replace_1 = require("./steps/constants/modules-to-replace");
|
18
18
|
const types_1 = require("./steps/constants/types");
|
19
|
+
const migrate_editor_1 = require("./steps/migrate-editor");
|
19
20
|
const migrate_root_1 = require("./steps/migrate-root");
|
20
21
|
const replace_modules_with_providers_1 = require("./steps/utils/replace-modules-with-providers");
|
21
22
|
function main(options) {
|
22
23
|
return (tree, context) => {
|
23
24
|
const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
|
25
|
+
(0, migrate_editor_1.migrateEditor)(fileSystem, options);
|
24
26
|
(0, steps_1.replaceEnums)(options, enums_1.ENUMS_TO_REPLACE);
|
25
27
|
(0, migrate_root_1.migrateRoot)(fileSystem, options);
|
26
28
|
(0, replace_services_1.replaceServices)(options, constants_1.SERVICES_TO_REPLACE);
|
@@ -587,47 +587,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
587
587
|
moduleSpecifier: '@taiga-ui/kit',
|
588
588
|
},
|
589
589
|
},
|
590
|
-
{
|
591
|
-
from: { name: 'TuiEditorModule', moduleSpecifier: '@tinkoff/tui-editor' },
|
592
|
-
to: [
|
593
|
-
{ name: 'TuiEditor', moduleSpecifier: '@taiga-ui/editor' },
|
594
|
-
{ name: 'TuiEditorSocket', moduleSpecifier: '@taiga-ui/editor' },
|
595
|
-
],
|
596
|
-
},
|
597
|
-
{
|
598
|
-
from: { name: 'TuiEditorSocketModule', moduleSpecifier: '@tinkoff/tui-editor' },
|
599
|
-
to: { name: 'TuiEditorSocket', moduleSpecifier: '@taiga-ui/editor' },
|
600
|
-
},
|
601
|
-
{
|
602
|
-
from: { name: 'TuiToolbarModule', moduleSpecifier: '@tinkoff/tui-editor' },
|
603
|
-
to: { name: 'TuiToolbar', moduleSpecifier: '@taiga-ui/editor' },
|
604
|
-
},
|
605
|
-
{
|
606
|
-
from: { name: 'defaultEditorExtensions', moduleSpecifier: '@tinkoff/tui-editor' },
|
607
|
-
to: { name: 'TUI_EDITOR_DEFAULT_EXTENSIONS', moduleSpecifier: '@taiga-ui/editor' },
|
608
|
-
},
|
609
|
-
{
|
610
|
-
from: {
|
611
|
-
name: 'TUI_EDITOR_DEFAULT_EXTENSIONS',
|
612
|
-
moduleSpecifier: '@tinkoff/tui-editor',
|
613
|
-
},
|
614
|
-
to: { name: 'TUI_EDITOR_DEFAULT_EXTENSIONS', moduleSpecifier: '@taiga-ui/editor' },
|
615
|
-
},
|
616
|
-
{
|
617
|
-
from: [
|
618
|
-
{ name: 'defaultEditorTools', moduleSpecifier: '@tinkoff/tui-editor' },
|
619
|
-
{ name: 'TUI_EDITOR_DEFAULT_TOOLS', moduleSpecifier: '@tinkoff/tui-editor' },
|
620
|
-
],
|
621
|
-
to: { name: 'TUI_EDITOR_DEFAULT_TOOLS', moduleSpecifier: '@taiga-ui/editor' },
|
622
|
-
},
|
623
|
-
{
|
624
|
-
from: { name: 'TuiColorPickerModule', moduleSpecifier: '@tinkoff/tui-editor' },
|
625
|
-
to: { name: 'TuiColorPickerModule', moduleSpecifier: '@taiga-ui/legacy' },
|
626
|
-
},
|
627
|
-
{
|
628
|
-
from: { name: 'TuiInputColorModule', moduleSpecifier: '@tinkoff/tui-editor' },
|
629
|
-
to: { name: 'TuiInputColorModule', moduleSpecifier: '@taiga-ui/legacy' },
|
630
|
-
},
|
631
590
|
{
|
632
591
|
from: { name: 'TuiFadeModule', moduleSpecifier: '@taiga-ui/experimental' },
|
633
592
|
to: {
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/// <reference lib="es2021" />
|
2
|
+
import { type DevkitFileSystem } from 'ng-morph';
|
3
|
+
import type { TuiSchema } from '../../../ng-add/schema';
|
4
|
+
export declare const TUI_EDITOR_VERSION = "^4.0.0";
|
5
|
+
export declare function migrateEditor(fileSystem: DevkitFileSystem, options: TuiSchema): void;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateEditor = exports.TUI_EDITOR_VERSION = void 0;
|
4
|
+
/// <reference lib="es2021" />
|
5
|
+
const ng_morph_1 = require("ng-morph");
|
6
|
+
const ng_morph_2 = require("ng-morph");
|
7
|
+
const file_globs_1 = require("../../../constants/file-globs");
|
8
|
+
const colored_log_1 = require("../../../utils/colored-log");
|
9
|
+
const replace_identifier_1 = require("../../steps/replace-identifier");
|
10
|
+
const replace_package_name_1 = require("../../steps/replace-package-name");
|
11
|
+
exports.TUI_EDITOR_VERSION = '^4.0.0';
|
12
|
+
function migrateEditor(fileSystem, options) {
|
13
|
+
const moduleSpecifier = ['@tinkoff/tui-editor', '@taiga-ui/addon-editor'];
|
14
|
+
const hasEditor = moduleSpecifier.every((pkg) => !(0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, pkg));
|
15
|
+
if (hasEditor) {
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
!options['skip-logs'] &&
|
19
|
+
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating editor...`);
|
20
|
+
(0, replace_identifier_1.replaceIdentifiers)(options, [
|
21
|
+
{
|
22
|
+
from: { name: 'TuiEditorModule', moduleSpecifier },
|
23
|
+
to: [
|
24
|
+
{ name: 'TuiEditor', moduleSpecifier: '@taiga-ui/editor' },
|
25
|
+
{ name: 'TuiEditorSocket', moduleSpecifier: '@taiga-ui/editor' },
|
26
|
+
],
|
27
|
+
},
|
28
|
+
{
|
29
|
+
from: { name: 'TuiEditorSocketModule', moduleSpecifier },
|
30
|
+
to: { name: 'TuiEditorSocket', moduleSpecifier: '@taiga-ui/editor' },
|
31
|
+
},
|
32
|
+
{
|
33
|
+
from: { name: 'TuiToolbarModule', moduleSpecifier },
|
34
|
+
to: { name: 'TuiToolbar', moduleSpecifier: '@taiga-ui/editor' },
|
35
|
+
},
|
36
|
+
{
|
37
|
+
from: { name: 'defaultEditorExtensions', moduleSpecifier },
|
38
|
+
to: {
|
39
|
+
name: 'TUI_EDITOR_DEFAULT_EXTENSIONS',
|
40
|
+
moduleSpecifier: '@taiga-ui/editor',
|
41
|
+
},
|
42
|
+
},
|
43
|
+
{
|
44
|
+
from: { name: 'TUI_EDITOR_DEFAULT_EXTENSIONS', moduleSpecifier },
|
45
|
+
to: {
|
46
|
+
name: 'TUI_EDITOR_DEFAULT_EXTENSIONS',
|
47
|
+
moduleSpecifier: '@taiga-ui/editor',
|
48
|
+
},
|
49
|
+
},
|
50
|
+
{
|
51
|
+
from: [
|
52
|
+
{ name: 'defaultEditorTools', moduleSpecifier },
|
53
|
+
{
|
54
|
+
name: 'TUI_EDITOR_DEFAULT_TOOLS',
|
55
|
+
moduleSpecifier: '@tinkoff/tui-editor',
|
56
|
+
},
|
57
|
+
],
|
58
|
+
to: { name: 'TUI_EDITOR_DEFAULT_TOOLS', moduleSpecifier: '@taiga-ui/editor' },
|
59
|
+
},
|
60
|
+
{
|
61
|
+
from: { name: 'TuiColorPickerModule', moduleSpecifier },
|
62
|
+
to: { name: 'TuiColorPickerModule', moduleSpecifier: '@taiga-ui/legacy' },
|
63
|
+
},
|
64
|
+
{
|
65
|
+
from: { name: 'TuiInputColorModule', moduleSpecifier },
|
66
|
+
to: { name: 'TuiInputColorModule', moduleSpecifier: '@taiga-ui/legacy' },
|
67
|
+
},
|
68
|
+
]);
|
69
|
+
(0, ng_morph_2.getSourceFiles)(file_globs_1.ALL_TS_FILES).forEach((sourceFile) => sourceFile.replaceWithText(sourceFile
|
70
|
+
.getFullText()
|
71
|
+
.replaceAll(/import\(['"`](@tinkoff|@taiga-ui)\/(tui-editor|addon-editor)\/(.*)['"`]\)/g, "import('@taiga-ui/editor')")));
|
72
|
+
(0, ng_morph_2.saveActiveProject)();
|
73
|
+
moduleSpecifier.forEach((pkg) => (0, replace_package_name_1.replacePackageName)(pkg, { name: '@taiga-ui/editor', version: exports.TUI_EDITOR_VERSION }, fileSystem.tree));
|
74
|
+
(0, ng_morph_2.saveActiveProject)();
|
75
|
+
!options['skip-logs'] && (0, colored_log_1.titleLog)(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
|
76
|
+
}
|
77
|
+
exports.migrateEditor = migrateEditor;
|
@@ -4,5 +4,4 @@ import type { TuiSchema } from '../../../ng-add/schema';
|
|
4
4
|
export declare const TUI_POLYMORPHEUS_VERSION = "^4.6.4";
|
5
5
|
export declare const TUI_DOMPURIFY_VERSION = "^4.1.2";
|
6
6
|
export declare const TUI_EVENT_PLUGINS_VERSION = "^4.0.1";
|
7
|
-
export declare const TUI_EDITOR_VERSION = "^2.5.0";
|
8
7
|
export declare function updatePackages({ tree }: DevkitFileSystem, _: TuiSchema): void;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.updatePackages = exports.
|
3
|
+
exports.updatePackages = exports.TUI_EVENT_PLUGINS_VERSION = exports.TUI_DOMPURIFY_VERSION = exports.TUI_POLYMORPHEUS_VERSION = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const version_1 = require("../../../../constants/version");
|
6
6
|
const constants_1 = require("../../../constants");
|
@@ -8,7 +8,6 @@ const steps_1 = require("../../steps");
|
|
8
8
|
exports.TUI_POLYMORPHEUS_VERSION = '^4.6.4';
|
9
9
|
exports.TUI_DOMPURIFY_VERSION = '^4.1.2';
|
10
10
|
exports.TUI_EVENT_PLUGINS_VERSION = '^4.0.1';
|
11
|
-
exports.TUI_EDITOR_VERSION = '^2.5.0';
|
12
11
|
function updatePackages({ tree }, _) {
|
13
12
|
const packagesToRemove = ['@taiga-ui/addon-tablebars', '@taiga-ui/addon-preview'];
|
14
13
|
packagesToRemove.forEach((pkg) => {
|
@@ -26,10 +25,6 @@ function updatePackages({ tree }, _) {
|
|
26
25
|
name: '@taiga-ui/event-plugins',
|
27
26
|
version: exports.TUI_EVENT_PLUGINS_VERSION,
|
28
27
|
}, tree);
|
29
|
-
(0, steps_1.replacePackageName)('@tinkoff/tui-editor', {
|
30
|
-
name: '@taiga-ui/editor',
|
31
|
-
version: exports.TUI_EDITOR_VERSION,
|
32
|
-
}, tree);
|
33
28
|
const cdk = (0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/cdk');
|
34
29
|
if (!(0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/event-plugins')) {
|
35
30
|
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|