Skip to content

Commit

Permalink
chore(demo): add example about how disable default hotkeys (#1579)
Browse files Browse the repository at this point in the history
Co-authored-by: taiga-family-bot <[email protected]>
  • Loading branch information
splincode and taiga-family-bot authored Nov 18, 2024
1 parent 09a38be commit 4f59c9f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
4 changes: 4 additions & 0 deletions projects/demo/src/app/pages/font/examples/4/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<tui-editor
[formControl]="control"
[tools]="builtInTools"
/>
30 changes: 30 additions & 0 deletions projects/demo/src/app/pages/font/examples/4/index.ts
Original file line number Diff line number Diff line change
@@ -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('<p>Hello</p>');
}
7 changes: 7 additions & 0 deletions projects/demo/src/app/pages/font/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,11 @@
[component]="component3"
[content]="example3"
/>

<tui-doc-example
id="disable-hotkeys"
heading="Disable default font hotkeys"
[component]="component4"
[content]="example4"
/>
</tui-doc-page>
6 changes: 6 additions & 0 deletions projects/demo/src/app/pages/font/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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'),
};
}
1 change: 0 additions & 1 deletion projects/editor/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 4f59c9f

Please sign in to comment.