diff --git a/projects/demo/src/modules/app/app.routes.ts b/projects/demo/src/modules/app/app.routes.ts
index 4090bf1114be..fab19c101c93 100644
--- a/projects/demo/src/modules/app/app.routes.ts
+++ b/projects/demo/src/modules/app/app.routes.ts
@@ -1018,6 +1018,18 @@ export const ROUTES = [
title: `Editor — Draggable groups`,
},
},
+ {
+ path: `editor/filled-groups`,
+ loadChildren: async () =>
+ (
+ await import(
+ `../components/editor/filled-groups/editor-filled-groups.module`
+ )
+ ).ExampleTuiEditorFilledGroupsModule,
+ data: {
+ title: `Editor — Filled groups`,
+ },
+ },
{
path: `editor/nested-groups`,
loadChildren: async () =>
diff --git a/projects/demo/src/modules/app/pages.ts b/projects/demo/src/modules/app/pages.ts
index e7d45b0d3fc3..ba5bf3ace55c 100644
--- a/projects/demo/src/modules/app/pages.ts
+++ b/projects/demo/src/modules/app/pages.ts
@@ -912,6 +912,12 @@ export const pages: TuiDocPages = [
keywords: `editor, draggable, groups, wysiwyg, редактор, текст, html, rich, text`,
route: `/editor/draggable-groups`,
},
+ {
+ section: $localize`Editor`,
+ title: `Filled groups`,
+ keywords: `editor, filled, groups, wysiwyg, редактор, заливка, текст, html, rich, text`,
+ route: `/editor/filled-groups`,
+ },
{
section: $localize`Editor`,
title: `Nested groups`,
diff --git a/projects/demo/src/modules/components/editor/filled-groups/editor-filled-groups.component.html b/projects/demo/src/modules/components/editor/filled-groups/editor-filled-groups.component.html
new file mode 100644
index 000000000000..0173c9e8f9b1
--- /dev/null
+++ b/projects/demo/src/modules/components/editor/filled-groups/editor-filled-groups.component.html
@@ -0,0 +1,35 @@
+
+ Rich Text Editor based on
+
+ TipTap Editor
+
+ for using with Angular forms. For safety reasons use a
+
+ sanitizer
+
+ with this component.
+
{{ control.value }}
diff --git a/projects/demo/src/modules/components/editor/filled-groups/examples/1/index.less b/projects/demo/src/modules/components/editor/filled-groups/examples/1/index.less new file mode 100644 index 000000000000..a895f131f3f5 --- /dev/null +++ b/projects/demo/src/modules/components/editor/filled-groups/examples/1/index.less @@ -0,0 +1,10 @@ +.my-editor { + min-height: 30rem; +} + +tui-editor-socket [data-type='group'] { + flex-direction: column; + padding: 0.5rem; + margin: 0.5rem 0; + border: 2px dotted var(--tui-link); +} diff --git a/projects/demo/src/modules/components/editor/filled-groups/examples/1/index.ts b/projects/demo/src/modules/components/editor/filled-groups/examples/1/index.ts new file mode 100644 index 000000000000..646ccfa2351d --- /dev/null +++ b/projects/demo/src/modules/components/editor/filled-groups/examples/1/index.ts @@ -0,0 +1,46 @@ +import {Component, ViewEncapsulation} from '@angular/core'; +import {FormControl} from '@angular/forms'; +import {changeDetection} from '@demo/emulate/change-detection'; +import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; +import {TuiDestroyService} from '@taiga-ui/cdk'; + +@Component({ + selector: `tui-editor-filled-group-example-1`, + templateUrl: `./index.html`, + styleUrls: [`./index.less`], + providers: [ + TuiDestroyService, + { + provide: TUI_EDITOR_EXTENSIONS, + useValue: [ + import(`@taiga-ui/addon-editor/extensions/starter-kit`).then( + ({StarterKit}) => StarterKit, + ), + import(`@taiga-ui/addon-editor/extensions/group`).then( + ({createGroupExtension}) => + createGroupExtension({ + nested: false, + draggable: false, + createOnEnter: true, + // @note: you can override css styles with your own classes + groupNodeClass: `filled-group`, + groupPointerNodeClass: ``, // anyway element doesn't exists if `draggable` is false + }), + ), + ], + }, + ], + encapsulation: ViewEncapsulation.None, + changeDetection, +}) +export class TuiEditorFilledGroupExample1 { + readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Group]; + + control = new FormControl(``); + + constructor() { + this.control.patchValue( + `This is a boring paragraph.
And another draggable paragraph.
Let’s finish with a boring paragraph.