From 4f59c9f5d8bd1c63bff741e398d48e3f3e1df3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=98=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Mon, 18 Nov 2024 16:33:29 +0300 Subject: [PATCH] chore(demo): add example about how disable default hotkeys (#1579) Co-authored-by: taiga-family-bot --- .../src/app/pages/font/examples/4/index.html | 4 +++ .../src/app/pages/font/examples/4/index.ts | 30 +++++++++++++++++++ projects/demo/src/app/pages/font/index.html | 7 +++++ projects/demo/src/app/pages/font/index.ts | 6 ++++ projects/editor/index.ts | 1 - 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 projects/demo/src/app/pages/font/examples/4/index.html create mode 100644 projects/demo/src/app/pages/font/examples/4/index.ts diff --git a/projects/demo/src/app/pages/font/examples/4/index.html b/projects/demo/src/app/pages/font/examples/4/index.html new file mode 100644 index 000000000..e0865c948 --- /dev/null +++ b/projects/demo/src/app/pages/font/examples/4/index.html @@ -0,0 +1,4 @@ + diff --git a/projects/demo/src/app/pages/font/examples/4/index.ts b/projects/demo/src/app/pages/font/examples/4/index.ts new file mode 100644 index 000000000..58161d395 --- /dev/null +++ b/projects/demo/src/app/pages/font/examples/4/index.ts @@ -0,0 +1,30 @@ +import {ChangeDetectionStrategy, Component} from '@angular/core'; +import {FormControl, ReactiveFormsModule} from '@angular/forms'; +import {TUI_EDITOR_EXTENSIONS, TuiEditor, TuiEditorTool} from '@taiga-ui/editor'; + +@Component({ + standalone: true, + imports: [ReactiveFormsModule, TuiEditor], + templateUrl: './index.html', + changeDetection: ChangeDetectionStrategy.OnPush, + providers: [ + { + provide: TUI_EDITOR_EXTENSIONS, + useValue: [ + import('@taiga-ui/editor').then(({TuiStarterKit}) => + TuiStarterKit.configure({ + // Configure default tiptap extensions + bold: false, + italic: false, + strike: false, + }), + ), + ], + }, + ], +}) +export default class Example { + protected readonly builtInTools = [TuiEditorTool.Undo]; + + protected control = new FormControl('

Hello

'); +} diff --git a/projects/demo/src/app/pages/font/index.html b/projects/demo/src/app/pages/font/index.html index ee498f7b9..02bfb4272 100644 --- a/projects/demo/src/app/pages/font/index.html +++ b/projects/demo/src/app/pages/font/index.html @@ -24,4 +24,11 @@ [component]="component3" [content]="example3" /> + + diff --git a/projects/demo/src/app/pages/font/index.ts b/projects/demo/src/app/pages/font/index.ts index 637a1e22d..5e897cdcb 100644 --- a/projects/demo/src/app/pages/font/index.ts +++ b/projects/demo/src/app/pages/font/index.ts @@ -11,6 +11,7 @@ export default class Example { protected readonly component1 = import('./examples/1'); protected readonly component2 = import('./examples/2'); protected readonly component3 = import('./examples/3'); + protected readonly component4 = import('./examples/4'); protected readonly example1 = { TypeScript: import('./examples/1/index.ts?raw'), @@ -33,4 +34,9 @@ export default class Example { './examples/3/font-size-tool/index.html?raw' ), }; + + protected readonly example4 = { + TypeScript: import('./examples/4/index.ts?raw'), + HTML: import('./examples/4/index.html?raw'), + }; } diff --git a/projects/editor/index.ts b/projects/editor/index.ts index d2863e5c2..9d846885d 100644 --- a/projects/editor/index.ts +++ b/projects/editor/index.ts @@ -1,5 +1,4 @@ export * from '@taiga-ui/editor/common'; -export * from '@taiga-ui/editor/common'; export * from '@taiga-ui/editor/components'; export * from '@taiga-ui/editor/directives'; export * from '@taiga-ui/editor/extensions';