Skip to content

Commit

Permalink
chore(schematics): migrate TUI_EDITOR_DEFAULT_EDITOR_TOOLS (#9128)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Sep 23, 2024
1 parent 5c49413 commit 5e35e70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 5 additions & 4 deletions projects/cdk/schematics/ng-update/v4/steps/migrate-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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';
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 5e35e70

Please sign in to comment.