Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(demo): add example about how disable default hotkeys #1579

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading