@worktile/theia 2.1.11 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/bundles/worktile-theia.umd.js +538 -310
  2. package/bundles/worktile-theia.umd.js.map +1 -1
  3. package/components/element/element.component.d.ts +1 -0
  4. package/constants/index.d.ts +1 -2
  5. package/constants/node-types.d.ts +6 -1
  6. package/custom-types.d.ts +1 -0
  7. package/editor.module.d.ts +44 -44
  8. package/esm2015/components/element/element.component.js +11 -4
  9. package/esm2015/components/text/text.component.js +2 -5
  10. package/esm2015/constants/index.js +2 -3
  11. package/esm2015/constants/node-types.js +7 -1
  12. package/esm2015/custom-types.js +1 -1
  13. package/esm2015/editor.component.js +1 -1
  14. package/esm2015/editor.module.js +6 -3
  15. package/esm2015/interfaces/editor.js +1 -1
  16. package/esm2015/plugins/common/block-card.plugin.js +2 -2
  17. package/esm2015/plugins/font-size/font-size.editor.js +2 -2
  18. package/esm2015/plugins/indent/indent.editor.js +81 -0
  19. package/esm2015/plugins/indent/indent.plugin.js +24 -3
  20. package/esm2015/plugins/indent/on-keydown-indent.js +40 -54
  21. package/esm2015/plugins/indent/options.js +26 -0
  22. package/esm2015/plugins/indent/toolbar-item.component.js +115 -0
  23. package/esm2015/plugins/index.js +5 -3
  24. package/esm2015/plugins/inline-code/inline-code.component.js +2 -2
  25. package/esm2015/plugins/list/components/bulleted-list.component.js +11 -14
  26. package/esm2015/plugins/list/components/numbered-list.component.js +12 -15
  27. package/esm2015/plugins/list/list.editor.js +8 -1
  28. package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +13 -6
  29. package/esm2015/plugins/todo-item/todo-item.component.js +8 -26
  30. package/esm2015/plugins/vertical-align/toolbar-item.component.js +3 -3
  31. package/fesm2015/worktile-theia.js +514 -303
  32. package/fesm2015/worktile-theia.js.map +1 -1
  33. package/interfaces/editor.d.ts +1 -1
  34. package/package.json +1 -1
  35. package/plugins/indent/indent.editor.d.ts +10 -0
  36. package/plugins/indent/indent.plugin.d.ts +2 -1
  37. package/plugins/indent/on-keydown-indent.d.ts +1 -1
  38. package/plugins/indent/options.d.ts +2 -0
  39. package/plugins/indent/toolbar-item.component.d.ts +36 -0
  40. package/plugins/inline-code/inline-code.component.scss +2 -1
  41. package/plugins/list/components/bulleted-list.component.d.ts +2 -4
  42. package/plugins/list/components/numbered-list.component.d.ts +2 -4
  43. package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.d.ts +1 -0
  44. package/plugins/todo-item/todo-item.component.d.ts +2 -3
  45. package/plugins/todo-item/todo-item.component.scss +0 -3
  46. package/styles/editor.scss +27 -0
  47. package/styles/typo.scss +0 -5
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Component, ChangeDetectionStrategy, Input, HostListener, ViewContainerRef, ChangeDetectorRef, Injectable, Inject, ViewChild, Pipe, HostBinding, Directive, ElementRef, TemplateRef, EventEmitter, forwardRef, Output, NgModule } from '@angular/core';
2
+ import { InjectionToken, Component, ChangeDetectionStrategy, HostBinding, Input, HostListener, ViewContainerRef, ChangeDetectorRef, Injectable, Inject, ViewChild, Directive, ElementRef, TemplateRef, Pipe, EventEmitter, forwardRef, Output, NgModule } from '@angular/core';
3
3
  import * as i6 from '@angular/common';
4
4
  import { DOCUMENT, CommonModule } from '@angular/common';
5
5
  import * as i4$2 from '@angular/forms';
@@ -100,6 +100,7 @@ var ElementKinds;
100
100
  ElementKinds["link"] = "link";
101
101
  ElementKinds["default"] = "paragraph";
102
102
  ElementKinds["inlineCode"] = "inline-code";
103
+ ElementKinds["indent"] = "indent";
103
104
  })(ElementKinds || (ElementKinds = {}));
104
105
  var Alignment;
105
106
  (function (Alignment) {
@@ -141,6 +142,11 @@ const FontSizeTypes = [
141
142
  FontSizes.fontSize40,
142
143
  FontSizes.fontSize48
143
144
  ];
145
+ var Indents;
146
+ (function (Indents) {
147
+ Indents["indentRight"] = "indent-right";
148
+ Indents["indentLeft"] = "indent-left";
149
+ })(Indents || (Indents = {}));
144
150
  var MarkTypes;
145
151
  (function (MarkTypes) {
146
152
  MarkTypes["bold"] = "bold";
@@ -196,74 +202,6 @@ const LIST_BLOCK_TYPES = [ElementKinds.numberedList, ElementKinds.bulletedList];
196
202
  const VOID_BLOCK_TYPES = [ElementKinds.image, ElementKinds.hr];
197
203
  const BLOCK_DELETEBACKWARD_TYPES = [ElementKinds.tableCell];
198
204
 
199
- const TheToolbarGroupToken = new InjectionToken('the-toolbar-group-token');
200
- const QUICK_TOOLBAR_HOTKEY = '/';
201
- var DropdownMode;
202
- (function (DropdownMode) {
203
- DropdownMode["icon"] = "icon-mode";
204
- DropdownMode["text"] = "text-mode";
205
- })(DropdownMode || (DropdownMode = {}));
206
- var ToolbarItemMode;
207
- (function (ToolbarItemMode) {
208
- ToolbarItemMode[ToolbarItemMode["horizontal"] = 0] = "horizontal";
209
- ToolbarItemMode[ToolbarItemMode["vertical"] = 1] = "vertical";
210
- })(ToolbarItemMode || (ToolbarItemMode = {}));
211
- const DefaultGlobalToolbarDefinition = [
212
- ElementKinds.headingList,
213
- ToolbarActionTypes.split,
214
- MarkTypes.bold,
215
- MarkTypes.italic,
216
- MarkTypes.underline,
217
- MarkTypes.strike,
218
- ElementKinds.inlineCode,
219
- MarkTypes.color,
220
- MarkTypes.backgroundColor,
221
- ToolbarActionTypes.split,
222
- ToolbarActionTypes.alignType,
223
- ToolbarActionTypes.verticalAlign,
224
- ToolbarActionTypes.split,
225
- ElementKinds.numberedList,
226
- ElementKinds.bulletedList,
227
- ToolbarActionTypes.split,
228
- ElementKinds.link,
229
- ElementKinds.image,
230
- ElementKinds.table,
231
- ElementKinds.blockquote,
232
- ElementKinds.code
233
- ];
234
- const DefaultInlineToolbarDefinition = [
235
- ToolbarActionTypes.clean,
236
- ToolbarActionTypes.split,
237
- MarkTypes.bold,
238
- MarkTypes.italic,
239
- MarkTypes.underline,
240
- MarkTypes.strike,
241
- ElementKinds.inlineCode,
242
- MarkTypes.color,
243
- MarkTypes.backgroundColor,
244
- ToolbarActionTypes.split,
245
- ToolbarActionTypes.alignType,
246
- ToolbarActionTypes.split,
247
- ElementKinds.link
248
- ];
249
- const DefaultQuickToolbarDefinition = [
250
- ...STANDARD_HEADING_TYPES,
251
- ToolbarActionTypes.split,
252
- ElementKinds.numberedList,
253
- ElementKinds.bulletedList,
254
- ToolbarActionTypes.split,
255
- ElementKinds.link,
256
- ElementKinds.image,
257
- ElementKinds.table,
258
- ElementKinds.blockquote,
259
- ElementKinds.hr,
260
- ElementKinds.code
261
- ];
262
- const ToolbarMoreGroup = {
263
- key: 'more',
264
- icon: 'more'
265
- };
266
-
267
205
  var ErrorCodes;
268
206
  (function (ErrorCodes) {
269
207
  ErrorCodes[ErrorCodes["UNKNOW_ERROR"] = 1000] = "UNKNOW_ERROR";
@@ -353,6 +291,74 @@ const THE_CODE_MODE_PROVIDER = {
353
291
  };
354
292
  const CODEMIRROR_PADDING_TOP = 10;
355
293
 
294
+ const TheToolbarGroupToken = new InjectionToken('the-toolbar-group-token');
295
+ const QUICK_TOOLBAR_HOTKEY = '/';
296
+ var DropdownMode;
297
+ (function (DropdownMode) {
298
+ DropdownMode["icon"] = "icon-mode";
299
+ DropdownMode["text"] = "text-mode";
300
+ })(DropdownMode || (DropdownMode = {}));
301
+ var ToolbarItemMode;
302
+ (function (ToolbarItemMode) {
303
+ ToolbarItemMode[ToolbarItemMode["horizontal"] = 0] = "horizontal";
304
+ ToolbarItemMode[ToolbarItemMode["vertical"] = 1] = "vertical";
305
+ })(ToolbarItemMode || (ToolbarItemMode = {}));
306
+ const DefaultGlobalToolbarDefinition = [
307
+ ElementKinds.headingList,
308
+ ToolbarActionTypes.split,
309
+ MarkTypes.bold,
310
+ MarkTypes.italic,
311
+ MarkTypes.underline,
312
+ MarkTypes.strike,
313
+ ElementKinds.inlineCode,
314
+ MarkTypes.color,
315
+ MarkTypes.backgroundColor,
316
+ ToolbarActionTypes.split,
317
+ ToolbarActionTypes.alignType,
318
+ ToolbarActionTypes.verticalAlign,
319
+ ToolbarActionTypes.split,
320
+ ElementKinds.numberedList,
321
+ ElementKinds.bulletedList,
322
+ ToolbarActionTypes.split,
323
+ ElementKinds.link,
324
+ ElementKinds.image,
325
+ ElementKinds.table,
326
+ ElementKinds.blockquote,
327
+ ElementKinds.code
328
+ ];
329
+ const DefaultInlineToolbarDefinition = [
330
+ ToolbarActionTypes.clean,
331
+ ToolbarActionTypes.split,
332
+ MarkTypes.bold,
333
+ MarkTypes.italic,
334
+ MarkTypes.underline,
335
+ MarkTypes.strike,
336
+ ElementKinds.inlineCode,
337
+ MarkTypes.color,
338
+ MarkTypes.backgroundColor,
339
+ ToolbarActionTypes.split,
340
+ ToolbarActionTypes.alignType,
341
+ ToolbarActionTypes.split,
342
+ ElementKinds.link
343
+ ];
344
+ const DefaultQuickToolbarDefinition = [
345
+ ...STANDARD_HEADING_TYPES,
346
+ ToolbarActionTypes.split,
347
+ ElementKinds.numberedList,
348
+ ElementKinds.bulletedList,
349
+ ToolbarActionTypes.split,
350
+ ElementKinds.link,
351
+ ElementKinds.image,
352
+ ElementKinds.table,
353
+ ElementKinds.blockquote,
354
+ ElementKinds.hr,
355
+ ElementKinds.code
356
+ ];
357
+ const ToolbarMoreGroup = {
358
+ key: 'more',
359
+ icon: 'more'
360
+ };
361
+
356
362
  class TheTextComponent extends BaseTextComponent {
357
363
  constructor(elementRef, renderer2, cdr) {
358
364
  super(elementRef, cdr);
@@ -374,10 +380,7 @@ class TheTextComponent extends BaseTextComponent {
374
380
  }
375
381
  }
376
382
  const fontSize = this.text[MarkTypes.fontSize];
377
- if (fontSize) {
378
- const attr = `the-${MarkTypes.fontSize}`;
379
- this.renderer2.setAttribute(this.elementRef.nativeElement, attr, fontSize);
380
- }
383
+ this.renderer2.setAttribute(this.elementRef.nativeElement, `the-${MarkTypes.fontSize}`, fontSize ? fontSize : null);
381
384
  if (this.text[MarkTypes.color]) {
382
385
  this.renderer2.setStyle(this.elementRef.nativeElement, 'color', this.text[MarkTypes.color]);
383
386
  }
@@ -428,9 +431,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
428
431
  }] });
429
432
 
430
433
  class TheDefaultElementComponent extends TheBaseElementComponent {
434
+ get indent() {
435
+ var _a;
436
+ return (_a = this.element) === null || _a === void 0 ? void 0 : _a.indent;
437
+ }
431
438
  }
432
439
  TheDefaultElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheDefaultElementComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
433
- TheDefaultElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheDefaultElementComponent, selector: "[theDefaultElement]", usesInheritance: true, ngImport: i0, template: '<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>', isInline: true, components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
440
+ TheDefaultElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheDefaultElementComponent, selector: "[theDefaultElement]", host: { properties: { "attr.the-indent": "this.indent" } }, usesInheritance: true, ngImport: i0, template: '<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>', isInline: true, components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
434
441
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheDefaultElementComponent, decorators: [{
435
442
  type: Component,
436
443
  args: [{
@@ -438,7 +445,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
438
445
  template: '<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>',
439
446
  changeDetection: ChangeDetectionStrategy.OnPush
440
447
  }]
441
- }] });
448
+ }], propDecorators: { indent: [{
449
+ type: HostBinding,
450
+ args: ['attr.the-indent']
451
+ }] } });
442
452
 
443
453
  const TheEditor = Object.assign({}, AngularEditor);
444
454
  var TheDataMode;
@@ -1671,6 +1681,13 @@ const ListEditor = {
1671
1681
  Transforms.setNodes(editor, { type: ElementKinds.paragraph, checked: undefined }, // todo remove checked
1672
1682
  { at: path });
1673
1683
  }
1684
+ else if (Element$1.isElement(node) && node.type === ElementKinds.paragraph) {
1685
+ let { textIndent } = node;
1686
+ if (textIndent) {
1687
+ Transforms.setNodes(editor, { textIndent: undefined }, // remove textIndent
1688
+ { at: path });
1689
+ }
1690
+ }
1674
1691
  if (Node.parent(editor, path).type !== ElementKinds.listItem) {
1675
1692
  Transforms.wrapNodes(editor, { type: ElementKinds.listItem, children: [] }, {
1676
1693
  at: path,
@@ -2671,86 +2688,6 @@ const withImage = (editor) => {
2671
2688
  return editor;
2672
2689
  };
2673
2690
 
2674
- const onKeydownIndent = (editor, event, kinds) => {
2675
- const { selection } = editor;
2676
- if (event.key === 'Tab') {
2677
- event.preventDefault();
2678
- const isExpanded = Range.isExpanded(selection);
2679
- const nodes = Array.from(Editor.nodes(editor, {
2680
- mode: 'highest',
2681
- match: indentNodeMatch(kinds)
2682
- }));
2683
- const startBlock = nodes[0];
2684
- if (startBlock && (isExpanded || Editor.isStart(editor, selection.anchor, [startBlock[1][0]]))) {
2685
- if (!editor.isVoid(startBlock[0])) {
2686
- if (event.shiftKey) {
2687
- return cancelTextIntent(editor, startBlock[0], kinds);
2688
- }
2689
- let { textIndent } = startBlock[0];
2690
- textIndent = textIndent ? textIndent : 0;
2691
- textIndent += 2;
2692
- if (textIndent < 50) {
2693
- Transforms.setNodes(editor, { textIndent }, {
2694
- mode: 'highest',
2695
- match: indentNodeMatch(kinds)
2696
- });
2697
- return true;
2698
- }
2699
- }
2700
- }
2701
- else {
2702
- editor.insertText(TAB_SPACE);
2703
- return true;
2704
- }
2705
- }
2706
- if (selection && Range.isCollapsed(selection) && event.key === 'Backspace') {
2707
- const nodes = Array.from(Editor.nodes(editor, {
2708
- mode: 'highest',
2709
- match: indentNodeMatch(kinds)
2710
- }));
2711
- const startBlock = nodes[0];
2712
- if (startBlock && Editor.isStart(editor, selection.anchor, [startBlock[1][0]])) {
2713
- return cancelTextIntent(editor, startBlock[0], kinds);
2714
- }
2715
- }
2716
- return false;
2717
- };
2718
- const indentNodeMatch = (kinds) => node => Element$1.isElement(node) && kinds.includes(node.type);
2719
- function cancelTextIntent(editor, anchorBlock, kinds) {
2720
- let { textIndent } = anchorBlock;
2721
- if (textIndent > 2) {
2722
- // prevent deleteBackward function
2723
- event.preventDefault();
2724
- textIndent -= 2;
2725
- Transforms.setNodes(editor, { textIndent }, {
2726
- mode: 'highest',
2727
- match: indentNodeMatch(kinds)
2728
- });
2729
- return true;
2730
- }
2731
- if (textIndent === 2) {
2732
- // prevent deleteBackward function
2733
- event.preventDefault();
2734
- Transforms.setNodes(editor, { textIndent: null }, {
2735
- mode: 'highest',
2736
- match: node => Element$1.isElement(node) && kinds.includes(node.type)
2737
- });
2738
- return true;
2739
- }
2740
- return false;
2741
- }
2742
-
2743
- const withIndent = (kinds) => (editor) => {
2744
- const { onKeydown } = editor;
2745
- editor.onKeydown = (event) => {
2746
- const isContinue = !onKeydownIndent(editor, event, kinds);
2747
- if (isContinue) {
2748
- onKeydown(event);
2749
- }
2750
- };
2751
- return editor;
2752
- };
2753
-
2754
2691
  const isList = (n) => {
2755
2692
  return [...LIST_BLOCK_TYPES].includes(n.type);
2756
2693
  };
@@ -3310,57 +3247,18 @@ function onKeyDownList(e, editor) {
3310
3247
  }
3311
3248
  }
3312
3249
 
3313
- class ElementStylePipe {
3314
- transform(element, align) {
3315
- const style = {};
3316
- if (element.align || align) {
3317
- style.textAlign = element.align || align || Alignment.left;
3318
- }
3319
- if (element.textIndent) {
3320
- style.textIndent = element.textIndent + 'em';
3321
- }
3322
- return style;
3323
- }
3324
- }
3325
- ElementStylePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementStylePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3326
- ElementStylePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementStylePipe, name: "elementStyle" });
3327
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementStylePipe, decorators: [{
3328
- type: Pipe,
3329
- args: [{
3330
- name: 'elementStyle'
3331
- }]
3332
- }] });
3333
- class ElementClassPipe {
3334
- transform(element) {
3335
- let classStr = '';
3336
- const prefix = 'indent';
3337
- if (element.textIndent) {
3338
- classStr += `${prefix}-${element.textIndent}`;
3339
- }
3340
- return classStr;
3341
- }
3342
- }
3343
- ElementClassPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3344
- ElementClassPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementClassPipe, name: "elementClass" });
3345
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementClassPipe, decorators: [{
3346
- type: Pipe,
3347
- args: [{
3348
- name: 'elementClass'
3349
- }]
3350
- }] });
3351
-
3352
3250
  class TheNumberedListComponent extends TheBaseElementComponent {
3353
- constructor(elementRef, cdr, elementClassPipe) {
3251
+ constructor(elementRef, cdr) {
3354
3252
  super(elementRef, cdr);
3355
3253
  this.elementRef = elementRef;
3356
3254
  this.cdr = cdr;
3357
- this.elementClassPipe = elementClassPipe;
3358
3255
  }
3359
3256
  get start() {
3360
3257
  return this.element.start;
3361
3258
  }
3362
- get class() {
3363
- return this.elementClassPipe.transform(this.element);
3259
+ get level() {
3260
+ var _a;
3261
+ return (_a = this.element) === null || _a === void 0 ? void 0 : _a.indent;
3364
3262
  }
3365
3263
  ngOnInit() {
3366
3264
  super.ngOnInit();
@@ -3369,32 +3267,31 @@ class TheNumberedListComponent extends TheBaseElementComponent {
3369
3267
  super.ngOnDestroy();
3370
3268
  }
3371
3269
  }
3372
- TheNumberedListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheNumberedListComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: ElementClassPipe }], target: i0.ɵɵFactoryTarget.Component });
3373
- TheNumberedListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheNumberedListComponent, selector: "ol[theOl]", host: { properties: { "attr.start": "this.start", "class": "this.class" } }, providers: [ElementClassPipe], usesInheritance: true, ngImport: i0, template: `<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>`, isInline: true, components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
3270
+ TheNumberedListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheNumberedListComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3271
+ TheNumberedListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheNumberedListComponent, selector: "ol[theOl]", host: { properties: { "attr.start": "this.start", "attr.the-level": "this.level" } }, usesInheritance: true, ngImport: i0, template: `<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>`, isInline: true, components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
3374
3272
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheNumberedListComponent, decorators: [{
3375
3273
  type: Component,
3376
3274
  args: [{
3377
3275
  selector: 'ol[theOl]',
3378
- template: `<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>`,
3379
- providers: [ElementClassPipe]
3276
+ template: `<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>`
3380
3277
  }]
3381
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: ElementClassPipe }]; }, propDecorators: { start: [{
3278
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { start: [{
3382
3279
  type: HostBinding,
3383
3280
  args: ['attr.start']
3384
- }], class: [{
3281
+ }], level: [{
3385
3282
  type: HostBinding,
3386
- args: ['class']
3283
+ args: ['attr.the-level']
3387
3284
  }] } });
3388
3285
 
3389
3286
  class TheBulletedListComponent extends TheBaseElementComponent {
3390
- constructor(elementRef, cdr, elementClassPipe) {
3287
+ constructor(elementRef, cdr) {
3391
3288
  super(elementRef, cdr);
3392
3289
  this.elementRef = elementRef;
3393
3290
  this.cdr = cdr;
3394
- this.elementClassPipe = elementClassPipe;
3395
3291
  }
3396
- get class() {
3397
- return this.elementClassPipe.transform(this.element);
3292
+ get level() {
3293
+ var _a;
3294
+ return (_a = this.element) === null || _a === void 0 ? void 0 : _a.indent;
3398
3295
  }
3399
3296
  ngOnInit() {
3400
3297
  super.ngOnInit();
@@ -3403,18 +3300,17 @@ class TheBulletedListComponent extends TheBaseElementComponent {
3403
3300
  super.ngOnDestroy();
3404
3301
  }
3405
3302
  }
3406
- TheBulletedListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheBulletedListComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: ElementClassPipe }], target: i0.ɵɵFactoryTarget.Component });
3407
- TheBulletedListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheBulletedListComponent, selector: "ul[theUl]", host: { properties: { "class": "this.class" } }, providers: [ElementClassPipe], usesInheritance: true, ngImport: i0, template: `<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>`, isInline: true, components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
3303
+ TheBulletedListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheBulletedListComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3304
+ TheBulletedListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheBulletedListComponent, selector: "ul[theUl]", host: { properties: { "attr.the-level": "this.level" } }, usesInheritance: true, ngImport: i0, template: `<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>`, isInline: true, components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
3408
3305
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheBulletedListComponent, decorators: [{
3409
3306
  type: Component,
3410
3307
  args: [{
3411
3308
  selector: 'ul[theUl]',
3412
- template: `<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>`,
3413
- providers: [ElementClassPipe]
3309
+ template: `<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>`
3414
3310
  }]
3415
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: ElementClassPipe }]; }, propDecorators: { class: [{
3311
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { level: [{
3416
3312
  type: HostBinding,
3417
- args: ['class']
3313
+ args: ['attr.the-level']
3418
3314
  }] } });
3419
3315
 
3420
3316
  class TheListItemComponent extends TheBaseElementComponent {
@@ -3730,52 +3626,6 @@ const withList = ({ validLiChildrenTypes } = {}) => (editor) => {
3730
3626
  return editor;
3731
3627
  };
3732
3628
 
3733
- /** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
3734
- function coercePixelsFromCssValue(cssValue) {
3735
- const match = cssValue.match(/(\d+)px/);
3736
- if (match) {
3737
- return Number(match[1]);
3738
- }
3739
- }
3740
- function getElementWidth(element) {
3741
- // Optimization: Check style.width first as we probably set it already before reading
3742
- // offsetWidth which triggers layout.
3743
- return coercePixelsFromCssValue(element.style.width) || element.offsetWidth;
3744
- }
3745
- function getElementHeight(element) {
3746
- return Math.round(element.getBoundingClientRect().height);
3747
- }
3748
- function getColsTotalWidth(cols) {
3749
- return cols.reduce((total, col) => {
3750
- return total + getElementWidth(col);
3751
- }, 0);
3752
- }
3753
- function getRowsTotalHeight(rows) {
3754
- return rows.reduce((total, row) => {
3755
- return total + getElementHeight(row);
3756
- }, 0);
3757
- }
3758
- function useElementStyle(el, element) {
3759
- if (element.align) {
3760
- el.style.textAlign = element.align || Alignment.left;
3761
- }
3762
- if (element.textIndent) {
3763
- el.style.textIndent = element.textIndent + 'em';
3764
- }
3765
- if (element.verticalAlign) {
3766
- el.style.verticalAlign = element.verticalAlign;
3767
- }
3768
- }
3769
- function getElementClassByPrefix(el, prefix) {
3770
- let matchClass = null;
3771
- el.classList.forEach((value, key) => {
3772
- if (value.includes(prefix)) {
3773
- matchClass = value;
3774
- }
3775
- });
3776
- return matchClass;
3777
- }
3778
-
3779
3629
  class TheTodoItemComponent extends TheBaseElementComponent {
3780
3630
  constructor(elementRef, cdr) {
3781
3631
  super(elementRef, cdr);
@@ -3783,15 +3633,12 @@ class TheTodoItemComponent extends TheBaseElementComponent {
3783
3633
  this.cdr = cdr;
3784
3634
  this.checkItemClass = true;
3785
3635
  }
3786
- onContextChange() {
3787
- super.onContextChange();
3788
- if (this.initialized) {
3789
- this.useIndentClass(this.elementRef.nativeElement, this.element);
3790
- }
3636
+ get level() {
3637
+ var _a;
3638
+ return (_a = this.element) === null || _a === void 0 ? void 0 : _a.indent;
3791
3639
  }
3792
3640
  ngOnInit() {
3793
3641
  super.ngOnInit();
3794
- this.useIndentClass(this.elementRef.nativeElement, this.element);
3795
3642
  }
3796
3643
  onCheck(checked) {
3797
3644
  if (this.readonly) {
@@ -3799,26 +3646,9 @@ class TheTodoItemComponent extends TheBaseElementComponent {
3799
3646
  }
3800
3647
  setNode(this.editor, { checked }, this.element);
3801
3648
  }
3802
- useIndentClass(el, element) {
3803
- const prefix = 'indent';
3804
- if (element.textIndent) {
3805
- const oldClass = getElementClassByPrefix(el, prefix);
3806
- if (oldClass) {
3807
- el.classList.remove(oldClass);
3808
- }
3809
- const newClassName = `${prefix}-${element.textIndent}`;
3810
- el.classList.add(newClassName);
3811
- }
3812
- else {
3813
- const oldClass = getElementClassByPrefix(el, prefix);
3814
- if (oldClass) {
3815
- el.classList.remove(oldClass);
3816
- }
3817
- }
3818
- }
3819
3649
  }
3820
3650
  TheTodoItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheTodoItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3821
- TheTodoItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTodoItemComponent, selector: "div[theTodoItem]", host: { properties: { "class.the-check-item": "this.checkItemClass" } }, usesInheritance: true, ngImport: i0, template: `
3651
+ TheTodoItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTodoItemComponent, selector: "div[theTodoItem]", host: { properties: { "class.the-check-item": "this.checkItemClass", "attr.the-level": "this.level" } }, usesInheritance: true, ngImport: i0, template: `
3822
3652
  <span contenteditable="false" class="todo-item-status">
3823
3653
  <input #checkbox type="checkbox" [checked]="element.checked" (click)="onCheck(checkbox.checked)" />
3824
3654
  </span>
@@ -3838,6 +3668,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
3838
3668
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { checkItemClass: [{
3839
3669
  type: HostBinding,
3840
3670
  args: ['class.the-check-item']
3671
+ }], level: [{
3672
+ type: HostBinding,
3673
+ args: ['attr.the-level']
3841
3674
  }] } });
3842
3675
 
3843
3676
  const withTodoItem = (editor) => {
@@ -4450,7 +4283,7 @@ const withBlockCard = (editor) => {
4450
4283
  return;
4451
4284
  }
4452
4285
  // → + right-block-card
4453
- if ((isMoveForward && !isCardLeftCursor)) {
4286
+ if (isMoveForward && !isCardLeftCursor) {
4454
4287
  nativeEvent.preventDefault();
4455
4288
  const [, path] = AngularEditor.toSlateCardEntry(editor, anchorNode);
4456
4289
  const nextPath = Path.next(path);
@@ -8010,11 +7843,57 @@ class TableStore {
8010
7843
  }
8011
7844
  }
8012
7845
  }
8013
- TableStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TableStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
8014
- TableStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TableStore });
8015
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TableStore, decorators: [{
8016
- type: Injectable
8017
- }], ctorParameters: function () { return []; } });
7846
+ TableStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TableStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
7847
+ TableStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TableStore });
7848
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TableStore, decorators: [{
7849
+ type: Injectable
7850
+ }], ctorParameters: function () { return []; } });
7851
+
7852
+ /** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
7853
+ function coercePixelsFromCssValue(cssValue) {
7854
+ const match = cssValue.match(/(\d+)px/);
7855
+ if (match) {
7856
+ return Number(match[1]);
7857
+ }
7858
+ }
7859
+ function getElementWidth(element) {
7860
+ // Optimization: Check style.width first as we probably set it already before reading
7861
+ // offsetWidth which triggers layout.
7862
+ return coercePixelsFromCssValue(element.style.width) || element.offsetWidth;
7863
+ }
7864
+ function getElementHeight(element) {
7865
+ return Math.round(element.getBoundingClientRect().height);
7866
+ }
7867
+ function getColsTotalWidth(cols) {
7868
+ return cols.reduce((total, col) => {
7869
+ return total + getElementWidth(col);
7870
+ }, 0);
7871
+ }
7872
+ function getRowsTotalHeight(rows) {
7873
+ return rows.reduce((total, row) => {
7874
+ return total + getElementHeight(row);
7875
+ }, 0);
7876
+ }
7877
+ function useElementStyle(el, element) {
7878
+ if (element.align) {
7879
+ el.style.textAlign = element.align || Alignment.left;
7880
+ }
7881
+ if (element.textIndent) {
7882
+ el.style.textIndent = element.textIndent + 'em';
7883
+ }
7884
+ if (element.verticalAlign) {
7885
+ el.style.verticalAlign = element.verticalAlign;
7886
+ }
7887
+ }
7888
+ function getElementClassByPrefix(el, prefix) {
7889
+ let matchClass = null;
7890
+ el.classList.forEach((value, key) => {
7891
+ if (value.includes(prefix)) {
7892
+ matchClass = value;
7893
+ }
7894
+ });
7895
+ return matchClass;
7896
+ }
8018
7897
 
8019
7898
  function splitCell(editor) {
8020
7899
  const opts = new TableOptions$1();
@@ -10682,7 +10561,7 @@ class TheVerticalToolbarItemComponent extends TheToolbarBaseItemComponent {
10682
10561
  execute(event) {
10683
10562
  var _a, _b;
10684
10563
  super.execute(event);
10685
- if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
10564
+ if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.readOnly) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
10686
10565
  return;
10687
10566
  }
10688
10567
  this.openPopover();
@@ -10715,7 +10594,7 @@ class TheVerticalToolbarItemComponent extends TheToolbarBaseItemComponent {
10715
10594
  }
10716
10595
  }
10717
10596
  TheVerticalToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheVerticalToolbarItemComponent, deps: [{ token: i0.ElementRef }, { token: i1$6.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
10718
- TheVerticalToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", inputs: { item: "item", menus: "menus", editor: "editor", toolbarItem: "toolbarItem" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.hide": "!active" }, classAttribute: "the-toolbar-dropdown-container verticalAlign" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["VerticalAlignItems"], descendants: true, read: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: "<a\n thyIconNavLink\n class=\"icon-mode link-with-down\"\n [thyTooltip]=\"toolbarItem?.name\"\n [thyIconNavLinkActive]=\"isOpened\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu?.key\"\n [ngStyle]=\"menu?.styles\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span *ngIf=\"menu.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu?.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
10597
+ TheVerticalToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", inputs: { item: "item", menus: "menus", editor: "editor", toolbarItem: "toolbarItem" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.hide": "!active" }, classAttribute: "the-toolbar-dropdown-container verticalAlign" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["VerticalAlignItems"], descendants: true, read: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: "<a\n thyIconNavLink\n class=\"icon-mode link-with-down\"\n [thyTooltip]=\"toolbarItem?.name\"\n [thyIconNavLinkActive]=\"isOpened\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu?.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span *ngIf=\"menu.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu?.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
10719
10598
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheVerticalToolbarItemComponent, decorators: [{
10720
10599
  type: Component,
10721
10600
  args: [{
@@ -11007,14 +10886,17 @@ class TheQuickToolbarComponent extends mixinUnsubscribe(MixinBase) {
11007
10886
  }
11008
10887
  handleMouseDown(event) {
11009
10888
  if (!this.elementRef.nativeElement.contains(event.target)) {
11010
- this.popoverRef.close();
10889
+ QuickInsertEditor.closeQuickToolbar(this.editor);
11011
10890
  }
11012
10891
  else {
11013
10892
  event.preventDefault();
11014
10893
  }
11015
10894
  }
11016
10895
  handleEnter() {
11017
- this.popoverRef.close();
10896
+ QuickInsertEditor.closeQuickToolbar(this.editor);
10897
+ }
10898
+ handleEsc() {
10899
+ QuickInsertEditor.closeQuickToolbar(this.editor);
11018
10900
  }
11019
10901
  ngOnInit() {
11020
10902
  this.editorElement = AngularEditor.toDOMNode(this.editor, this.editor);
@@ -11031,7 +10913,7 @@ class TheQuickToolbarComponent extends mixinUnsubscribe(MixinBase) {
11031
10913
  }
11032
10914
  removeHotKey() {
11033
10915
  const node = Node.get(this.editor, this.editor.selection.anchor.path);
11034
- if (node && Text.equals({ text: QUICK_TOOLBAR_HOTKEY }, node)) {
10916
+ if (node && QUICK_TOOLBAR_HOTKEY === node.text) {
11035
10917
  Editor.deleteBackward(this.editor);
11036
10918
  }
11037
10919
  }
@@ -11040,7 +10922,7 @@ class TheQuickToolbarComponent extends mixinUnsubscribe(MixinBase) {
11040
10922
  }
11041
10923
  }
11042
10924
  TheQuickToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheQuickToolbarComponent, deps: [{ token: i1$3.ThyPopoverRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
11043
- TheQuickToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickToolbarComponent, selector: "the-quick-toolbar", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "document: mousedown": "handleMouseDown($event)", "document: keydown.enter": "handleEnter()" } }, usesInheritance: true, ngImport: i0, template: "<thy-selection-list\n class=\"the-quick-toolbar\"\n [thyBindKeyEventContainer]=\"editorElement\"\n (thySelectionChange)=\"selectionChange($event)\"\n [thyMultiple]=\"false\"\n>\n <ng-container *ngFor=\"let item of quickToolbarItems\">\n <ng-container *ngIf=\"item.key !== ToolbarActionTypes.split; else splitLine\">\n <thy-list-option [thyValue]=\"item?.key\" (mousedown)=\"stopPropagation($event)\">\n <the-toolbar-item [editor]=\"editor\" [item]=\"item\" [itemMode]=\"ToolbarItemMode.vertical\"></the-toolbar-item>\n </thy-list-option>\n </ng-container>\n </ng-container>\n</thy-selection-list>\n\n<ng-template #splitLine>\n <nav-split-line [mode]=\"ToolbarItemMode.horizontal\"></nav-split-line>\n</ng-template>\n", components: [{ type: i2$2.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5$3.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["item", "editor", "itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
10925
+ TheQuickToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickToolbarComponent, selector: "the-quick-toolbar", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "document: mousedown": "handleMouseDown($event)", "document: keydown.enter": "handleEnter()", "document: keydown.escape": "handleEsc()" } }, usesInheritance: true, ngImport: i0, template: "<thy-selection-list\n class=\"the-quick-toolbar\"\n [thyBindKeyEventContainer]=\"editorElement\"\n (thySelectionChange)=\"selectionChange($event)\"\n [thyMultiple]=\"false\"\n>\n <ng-container *ngFor=\"let item of quickToolbarItems\">\n <ng-container *ngIf=\"item.key !== ToolbarActionTypes.split; else splitLine\">\n <thy-list-option [thyValue]=\"item?.key\" (mousedown)=\"stopPropagation($event)\">\n <the-toolbar-item [editor]=\"editor\" [item]=\"item\" [itemMode]=\"ToolbarItemMode.vertical\"></the-toolbar-item>\n </thy-list-option>\n </ng-container>\n </ng-container>\n</thy-selection-list>\n\n<ng-template #splitLine>\n <nav-split-line [mode]=\"ToolbarItemMode.horizontal\"></nav-split-line>\n</ng-template>\n", components: [{ type: i2$2.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5$3.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["item", "editor", "itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
11044
10926
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheQuickToolbarComponent, decorators: [{
11045
10927
  type: Component,
11046
10928
  args: [{
@@ -11057,6 +10939,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
11057
10939
  }], handleEnter: [{
11058
10940
  type: HostListener,
11059
10941
  args: ['document: keydown.enter']
10942
+ }], handleEsc: [{
10943
+ type: HostListener,
10944
+ args: ['document: keydown.escape']
11060
10945
  }] } });
11061
10946
 
11062
10947
  const OperationTypes = ['insert_text', 'remove_node', 'merge_node'];
@@ -11170,7 +11055,7 @@ const FontSizeEditor = {
11170
11055
  return;
11171
11056
  }
11172
11057
  // unset fontSize
11173
- if (isDefaultFontSize && Number(defaultFontSize) === fontSizeMark) {
11058
+ if (isDefaultFontSize) {
11174
11059
  FontSizeEditor.unsetFontSize(editor, size);
11175
11060
  return;
11176
11061
  }
@@ -11269,7 +11154,7 @@ class TheInlineCodeComponent extends TheBaseElementComponent {
11269
11154
  super(...arguments);
11270
11155
  // Put this at the start and end of an inline component to work around this Chromium bug:
11271
11156
  // https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
11272
- this.inlineChromiumBugfix = '$' + String.fromCodePoint(160);
11157
+ this.inlineChromiumBugfix = String.fromCodePoint(160);
11273
11158
  }
11274
11159
  }
11275
11160
  TheInlineCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheInlineCodeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
@@ -11327,6 +11212,290 @@ const withInlineCode = (editor) => {
11327
11212
  return editor;
11328
11213
  };
11329
11214
 
11215
+ class TheIndentToolbarComponent extends TheToolbarBaseItemComponent {
11216
+ constructor(elementRef, thyPopover, viewContainerRef, overlay) {
11217
+ super();
11218
+ this.elementRef = elementRef;
11219
+ this.thyPopover = thyPopover;
11220
+ this.viewContainerRef = viewContainerRef;
11221
+ this.overlay = overlay;
11222
+ this.mode = DropdownMode.text;
11223
+ this.dropdownMode = DropdownMode;
11224
+ this.disabled = false;
11225
+ }
11226
+ get isOpen() {
11227
+ return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
11228
+ }
11229
+ toggleDropdown(event) {
11230
+ var _a;
11231
+ super.execute(event);
11232
+ if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled) {
11233
+ return;
11234
+ }
11235
+ this.openDropdownPopover();
11236
+ }
11237
+ handleDocumentMouseDown(event) {
11238
+ if (!this.elementRef.nativeElement.contains(event.target)) {
11239
+ this.closeDropdownPopover();
11240
+ }
11241
+ }
11242
+ get disabledState() {
11243
+ return this.disabled;
11244
+ }
11245
+ ngOnInit() {
11246
+ var _a;
11247
+ if (!this.activeMenu) {
11248
+ this.activeMenu = this.menus[0];
11249
+ }
11250
+ if (this.toolbarItem) {
11251
+ this.elementRef.nativeElement.classList.add(`${(_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key}`);
11252
+ }
11253
+ }
11254
+ statusChange(editor) {
11255
+ var _a, _b;
11256
+ this.disabled = ((_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.disable) ? (_b = this.toolbarItem) === null || _b === void 0 ? void 0 : _b.disable(editor) : false;
11257
+ }
11258
+ itemMousedown(event, item) {
11259
+ super.execute(event);
11260
+ this.closeDropdownPopover();
11261
+ if (item === null || item === void 0 ? void 0 : item.execute) {
11262
+ item === null || item === void 0 ? void 0 : item.execute(this.editor);
11263
+ }
11264
+ }
11265
+ openDropdownPopover() {
11266
+ var _a;
11267
+ this.dropdownPopoverRef = this.thyPopover.open(this.dropdownTemplate, {
11268
+ origin: this.elementRef,
11269
+ panelClass: ['the-toolbar-dropdown-popover', (_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key],
11270
+ placement: 'bottomLeft',
11271
+ insideClosable: false,
11272
+ backdropClosable: true,
11273
+ hasBackdrop: false,
11274
+ offset: 10,
11275
+ viewContainerRef: this.viewContainerRef,
11276
+ scrollStrategy: this.overlay.scrollStrategies.reposition()
11277
+ });
11278
+ }
11279
+ closeDropdownPopover() {
11280
+ var _a;
11281
+ if (this.dropdownPopoverRef) {
11282
+ (_a = this.dropdownPopoverRef) === null || _a === void 0 ? void 0 : _a.close();
11283
+ }
11284
+ }
11285
+ }
11286
+ TheIndentToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheIndentToolbarComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2.Overlay }], target: i0.ɵɵFactoryTarget.Component });
11287
+ TheIndentToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheIndentToolbarComponent, selector: "the-indent-toolbar-item", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a thyActionMenuItem href=\"javascript:;\" (mousedown)=\"itemMousedown($event, menu)\">\n <span thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
11288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheIndentToolbarComponent, decorators: [{
11289
+ type: Component,
11290
+ args: [{
11291
+ selector: 'the-indent-toolbar-item',
11292
+ templateUrl: './toolbar-item.component.html',
11293
+ host: {
11294
+ class: 'the-toolbar-dropdown-container'
11295
+ }
11296
+ }]
11297
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$3.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2.Overlay }]; }, propDecorators: { toolbarItem: [{
11298
+ type: Input
11299
+ }], menus: [{
11300
+ type: Input
11301
+ }], mode: [{
11302
+ type: Input
11303
+ }], item: [{
11304
+ type: Input
11305
+ }], dropdownTemplate: [{
11306
+ type: ViewChild,
11307
+ args: ['dropdownTemplate', { static: true }]
11308
+ }], toggleDropdown: [{
11309
+ type: HostListener,
11310
+ args: ['mousedown', ['$event']]
11311
+ }], handleDocumentMouseDown: [{
11312
+ type: HostListener,
11313
+ args: ['document: mousedown', ['$event']]
11314
+ }], disabledState: [{
11315
+ type: HostBinding,
11316
+ args: ['class.disabled']
11317
+ }] } });
11318
+
11319
+ const MaxIndent = 13;
11320
+ const includesIndentTypes = [
11321
+ ElementKinds.checkItem,
11322
+ ElementKinds.numberedList,
11323
+ ElementKinds.bulletedList,
11324
+ ElementKinds.paragraph,
11325
+ ...HEADING_TYPES
11326
+ ];
11327
+ const IndentEditor = {
11328
+ setIndent(editor) {
11329
+ const nodes = Array.from(Editor.nodes(editor, {
11330
+ mode: 'highest',
11331
+ match: n => Element$1.isElement(n) && includesIndentTypes.includes(n.type)
11332
+ }));
11333
+ const [startBlock] = nodes;
11334
+ if (startBlock) {
11335
+ let [{ indent }] = startBlock;
11336
+ indent = indent ? indent : 0;
11337
+ indent += 1;
11338
+ if (indent <= MaxIndent) {
11339
+ Transforms.setNodes(editor, { indent }, {
11340
+ mode: 'highest',
11341
+ match: n => Element$1.isElement(n) && includesIndentTypes.includes(n.type)
11342
+ });
11343
+ }
11344
+ }
11345
+ },
11346
+ cancelIndent(editor) {
11347
+ const nodes = Array.from(Editor.nodes(editor, {
11348
+ mode: 'highest',
11349
+ match: n => Element$1.isElement(n) && includesIndentTypes.includes(n.type)
11350
+ }));
11351
+ const [startBlock] = nodes;
11352
+ if (startBlock) {
11353
+ let [{ indent }] = startBlock;
11354
+ indent = indent === 1 ? null : (indent -= 1);
11355
+ Transforms.setNodes(editor, { indent }, {
11356
+ mode: 'highest',
11357
+ match: n => Element$1.isElement(n) && includesIndentTypes.includes(n.type)
11358
+ });
11359
+ }
11360
+ },
11361
+ setTextIndent(editor, kinds, textIndent) {
11362
+ Transforms.setNodes(editor, { textIndent }, {
11363
+ mode: 'highest',
11364
+ match: node => Element$1.isElement(node) && kinds.includes(node.type)
11365
+ });
11366
+ },
11367
+ cancelTextIntent(editor, event, anchorBlock, kinds) {
11368
+ let { textIndent, indent } = anchorBlock;
11369
+ if (indent) {
11370
+ event.preventDefault();
11371
+ IndentEditor.cancelIndent(editor);
11372
+ return true;
11373
+ }
11374
+ if (!indent && textIndent > 2) {
11375
+ event.preventDefault();
11376
+ textIndent -= 2;
11377
+ IndentEditor.setTextIndent(editor, kinds, textIndent);
11378
+ return true;
11379
+ }
11380
+ if (!indent && textIndent === 2) {
11381
+ event.preventDefault();
11382
+ IndentEditor.setTextIndent(editor, kinds, null);
11383
+ return true;
11384
+ }
11385
+ return false;
11386
+ },
11387
+ isDisabled(editor) {
11388
+ if (editor.selection) {
11389
+ const disableGroup = HEADING_TYPES;
11390
+ const anchorBlock$1 = anchorBlock(editor);
11391
+ return anchorBlock$1 && disableGroup.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
11392
+ }
11393
+ return false;
11394
+ }
11395
+ };
11396
+
11397
+ const IndentOptions = [
11398
+ {
11399
+ key: ElementKinds.indent,
11400
+ includes: [Indents.indentRight, Indents.indentLeft],
11401
+ iconComponent: TheIndentToolbarComponent,
11402
+ disable: editor => IndentEditor.isDisabled(editor)
11403
+ },
11404
+ {
11405
+ key: Indents.indentRight,
11406
+ name: '增加缩进',
11407
+ icon: 'indent',
11408
+ execute: editor => IndentEditor.setIndent(editor)
11409
+ },
11410
+ {
11411
+ key: Indents.indentLeft,
11412
+ name: '减少缩进',
11413
+ icon: 'outdent',
11414
+ type: ToolbarItemType.toolDropdown,
11415
+ execute: editor => IndentEditor.cancelIndent(editor)
11416
+ }
11417
+ ];
11418
+
11419
+ const onKeydownTextIndent = (editor, event, kinds) => {
11420
+ const { selection } = editor;
11421
+ const isExpanded = Range.isExpanded(selection);
11422
+ const nodes = Array.from(Editor.nodes(editor, {
11423
+ mode: 'highest',
11424
+ match: node => Element$1.isElement(node) && kinds.includes(node.type)
11425
+ }));
11426
+ const [startBlock] = nodes;
11427
+ if (!startBlock) {
11428
+ return false;
11429
+ }
11430
+ const [block, path] = startBlock;
11431
+ const currentPath = [path[0]];
11432
+ const isStart = Editor.isStart(editor, selection.anchor, currentPath);
11433
+ const textIndentDisable = [ElementKinds.bulletedList, ElementKinds.numberedList, ElementKinds.checkItem];
11434
+ if (isHotkey('Tab', event)) {
11435
+ event.preventDefault();
11436
+ if (startBlock && (isExpanded || isStart)) {
11437
+ if (!editor.isVoid(block)) {
11438
+ let { textIndent, type } = block;
11439
+ // do not apply first-line indentation for lists
11440
+ if (!textIndent && !textIndentDisable.includes(type)) {
11441
+ IndentEditor.setTextIndent(editor, kinds, 2);
11442
+ return true;
11443
+ }
11444
+ else {
11445
+ IndentEditor.setIndent(editor);
11446
+ return true;
11447
+ }
11448
+ }
11449
+ }
11450
+ else {
11451
+ editor.insertText(TAB_SPACE);
11452
+ return true;
11453
+ }
11454
+ }
11455
+ if (isHotkey('shift+Tab', event)) {
11456
+ if (startBlock && (isExpanded || isStart)) {
11457
+ if (!editor.isVoid(block)) {
11458
+ return IndentEditor.cancelTextIntent(editor, event, block, kinds);
11459
+ }
11460
+ }
11461
+ }
11462
+ if (selection && Range.isCollapsed(selection) && hotkeys.isDeleteBackward(event)) {
11463
+ if (startBlock && isStart) {
11464
+ return IndentEditor.cancelTextIntent(editor, event, block, kinds);
11465
+ }
11466
+ }
11467
+ return false;
11468
+ };
11469
+
11470
+ const withIndent = (kinds) => (editor) => {
11471
+ const { onKeydown } = editor;
11472
+ editor.onKeydown = (event) => {
11473
+ const HOTKEYS = {
11474
+ 'mod+]': Indents.indentRight,
11475
+ 'mod+[': Indents.indentLeft
11476
+ };
11477
+ for (const hotkey in HOTKEYS) {
11478
+ if (isHotkey(hotkey, event)) {
11479
+ event.preventDefault();
11480
+ const mark = HOTKEYS[hotkey];
11481
+ switch (mark) {
11482
+ case Indents.indentRight:
11483
+ IndentEditor.setIndent(editor);
11484
+ break;
11485
+ case Indents.indentLeft:
11486
+ IndentEditor.cancelIndent(editor);
11487
+ break;
11488
+ }
11489
+ }
11490
+ }
11491
+ const isContinue = !onKeydownTextIndent(editor, event, kinds);
11492
+ if (isContinue) {
11493
+ onKeydown(event);
11494
+ }
11495
+ };
11496
+ return editor;
11497
+ };
11498
+
11330
11499
  const internalPlugins = [
11331
11500
  withTheHistory,
11332
11501
  withAutoInsertData(),
@@ -11385,7 +11554,8 @@ const internalToolbarItems = [
11385
11554
  ...TableOptions,
11386
11555
  ...VerticalAlignOptions,
11387
11556
  ...PaintFormatOptions,
11388
- ...InlineCodeOptions
11557
+ ...InlineCodeOptions,
11558
+ ...IndentOptions
11389
11559
  ];
11390
11560
  const toolbarCompose = (toolbarItems = []) => {
11391
11561
  return [...internalToolbarItems, ...toolbarItems];
@@ -11962,6 +12132,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
11962
12132
  args: ['mousedown', ['$event']]
11963
12133
  }] } });
11964
12134
 
12135
+ class ElementStylePipe {
12136
+ transform(element, align) {
12137
+ const style = {};
12138
+ if (element.align || align) {
12139
+ style.textAlign = element.align || align || Alignment.left;
12140
+ }
12141
+ if (element.textIndent) {
12142
+ style.textIndent = element.textIndent + 'em';
12143
+ }
12144
+ return style;
12145
+ }
12146
+ }
12147
+ ElementStylePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementStylePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
12148
+ ElementStylePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementStylePipe, name: "elementStyle" });
12149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementStylePipe, decorators: [{
12150
+ type: Pipe,
12151
+ args: [{
12152
+ name: 'elementStyle'
12153
+ }]
12154
+ }] });
12155
+ class ElementClassPipe {
12156
+ transform(element) {
12157
+ let classStr = '';
12158
+ const prefix = 'indent';
12159
+ if (element.textIndent) {
12160
+ classStr += `${prefix}-${element.textIndent}`;
12161
+ }
12162
+ return classStr;
12163
+ }
12164
+ }
12165
+ ElementClassPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
12166
+ ElementClassPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementClassPipe, name: "elementClass" });
12167
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ElementClassPipe, decorators: [{
12168
+ type: Pipe,
12169
+ args: [{
12170
+ name: 'elementClass'
12171
+ }]
12172
+ }] });
12173
+
11965
12174
  class TheTemplateComponent {
11966
12175
  constructor() {
11967
12176
  this.renderElement = (element) => {
@@ -12597,7 +12806,8 @@ const COMPONENTS = [
12597
12806
  TheTableSelectComponent,
12598
12807
  TheTableToolbarItemComponent,
12599
12808
  TheConversionHintComponent,
12600
- TheVerticalToolbarItemComponent
12809
+ TheVerticalToolbarItemComponent,
12810
+ TheIndentToolbarComponent
12601
12811
  ];
12602
12812
  const PLUGIN_COMPONENTS = [
12603
12813
  TheImageComponent,
@@ -12640,7 +12850,8 @@ TheEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
12640
12850
  TheTableSelectComponent,
12641
12851
  TheTableToolbarItemComponent,
12642
12852
  TheConversionHintComponent,
12643
- TheVerticalToolbarItemComponent, TheImageComponent,
12853
+ TheVerticalToolbarItemComponent,
12854
+ TheIndentToolbarComponent, TheImageComponent,
12644
12855
  TheTemplateComponent,
12645
12856
  TheHrComponent,
12646
12857
  TheBlockquoteComponent,
@@ -12706,5 +12917,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
12706
12917
  * Generated bundle index. Do not edit.
12707
12918
  */
12708
12919
 
12709
- export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETEBACKWARD_TYPES, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, COMPONENTS, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, CodeMode, ColorEditor, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultQuickToolbarDefinition, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeadingEditor, HrEditor, IS_MAC, ImageEditor, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, QUICK_TOOLBAR_HOTKEY, QuickInsertEditor, STANDARD_HEADING_TYPES, TAB_SPACE, THE_CODE_MODE_PROVIDER, THE_CODE_MODE_TOKEN, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_QUICK_TOOLBAR_REF, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_UPLOAD_SERVICE_TOKEN, TableEditor, TheBaseElementComponent, TheCodeConfig, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheMode, index$1 as TheQueries, TheToolbarBaseItemComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarGroupComponent, TheToolbarGroupToken, TheToolbarItemComponent, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemMode, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, ZERO_WIDTH_CHAR, createEmptyParagraph, dataDeserialize, dataSerializing, getToolbarClass, htmlToTheia, inValidTypes, isCleanEmptyParagraph, plainToTheia, toolbarCompose, withTheEditor };
12920
+ export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETEBACKWARD_TYPES, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, COMPONENTS, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, CodeMode, ColorEditor, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultQuickToolbarDefinition, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeadingEditor, HrEditor, IS_MAC, ImageEditor, Indents, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, QUICK_TOOLBAR_HOTKEY, QuickInsertEditor, STANDARD_HEADING_TYPES, TAB_SPACE, THE_CODE_MODE_PROVIDER, THE_CODE_MODE_TOKEN, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_QUICK_TOOLBAR_REF, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_UPLOAD_SERVICE_TOKEN, TableEditor, TheBaseElementComponent, TheCodeConfig, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheMode, index$1 as TheQueries, TheToolbarBaseItemComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarGroupComponent, TheToolbarGroupToken, TheToolbarItemComponent, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemMode, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, ZERO_WIDTH_CHAR, createEmptyParagraph, dataDeserialize, dataSerializing, getToolbarClass, htmlToTheia, inValidTypes, isCleanEmptyParagraph, plainToTheia, toolbarCompose, withTheEditor };
12710
12921
  //# sourceMappingURL=worktile-theia.js.map