From 0820ec612bf633e474b5595d5a6c167dec1a9f99 Mon Sep 17 00:00:00 2001 From: splincode Date: Sun, 22 Sep 2024 23:31:05 +0300 Subject: [PATCH] chore(schematics): migrate `TUI_EDITOR_DEFAULT_EDITOR_TOOLS` --- .../cdk/schematics/ng-update/v4/steps/migrate-editor.ts | 9 +++++---- .../v4/tests/schematic-migrate-addon-editor.spec.ts | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-editor.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-editor.ts index 8c82cecde5d0..9b434de0adeb 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-editor.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-editor.ts @@ -62,13 +62,14 @@ export function migrateEditor(fileSystem: DevkitFileSystem, options: TuiSchema): { from: [ {name: 'defaultEditorTools', moduleSpecifier}, - { - name: 'TUI_EDITOR_DEFAULT_TOOLS', - moduleSpecifier: '@tinkoff/tui-editor', - }, + {name: 'TUI_EDITOR_DEFAULT_TOOLS', moduleSpecifier}, ], to: {name: 'TUI_EDITOR_DEFAULT_TOOLS', moduleSpecifier: '@taiga-ui/editor'}, }, + { + from: {name: 'TUI_EDITOR_DEFAULT_EDITOR_TOOLS', moduleSpecifier}, + to: {name: 'TUI_EDITOR_DEFAULT_TOOLS', moduleSpecifier: '@taiga-ui/editor'}, + }, { from: {name: 'TuiColorPickerModule', moduleSpecifier}, to: {name: 'TuiColorPickerModule', moduleSpecifier: '@taiga-ui/legacy'}, diff --git a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-addon-editor.spec.ts b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-addon-editor.spec.ts index c257ac14b1f9..313ff9dbfe0f 100644 --- a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-addon-editor.spec.ts +++ b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-addon-editor.spec.ts @@ -23,7 +23,7 @@ import { } from '@taiga-ui/core'; import {NgDompurifySanitizer} from '@tinkoff/ng-dompurify'; import {TUI_EDITOR_DEFAULT_EXTENSIONS, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; -import {TuiEditorModule, TuiEditorTool} from '@tinkoff/tui-editor'; +import {TuiEditorModule, TuiEditorTool, TUI_EDITOR_DEFAULT_EDITOR_TOOLS} from '@tinkoff/tui-editor'; @Component({ standalone: true, @@ -49,10 +49,11 @@ import {TuiEditorModule, TuiEditorTool} from '@tinkoff/tui-editor'; }) export class Test { protected readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Img]; + protected readonly allTools = TUI_EDITOR_DEFAULT_EDITOR_TOOLS; }`; const COMPONENT_AFTER = `import { TUI_SANITIZER } from "@taiga-ui/legacy"; -import { TuiEditor, TuiEditorSocket, TUI_EDITOR_DEFAULT_EXTENSIONS } from "@taiga-ui/editor"; +import { TuiEditor, TuiEditorSocket, TUI_EDITOR_DEFAULT_EXTENSIONS, TUI_EDITOR_DEFAULT_TOOLS } from "@taiga-ui/editor"; import { TuiRoot, TuiAlert, TuiDialog } from '@taiga-ui/core'; import {NgDompurifySanitizer} from '@taiga-ui/dompurify'; @@ -83,6 +84,7 @@ import {TuiEditorTool} from '@taiga-ui/editor'; }) export class Test { protected readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Img]; + protected readonly allTools = TUI_EDITOR_DEFAULT_TOOLS; } `.trim();