@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
@@ -410,6 +410,7 @@
410
410
  ElementKinds["link"] = "link";
411
411
  ElementKinds["default"] = "paragraph";
412
412
  ElementKinds["inlineCode"] = "inline-code";
413
+ ElementKinds["indent"] = "indent";
413
414
  })(exports.ElementKinds || (exports.ElementKinds = {}));
414
415
  exports.Alignment = void 0;
415
416
  (function (Alignment) {
@@ -451,6 +452,11 @@
451
452
  exports.FontSizes.fontSize40,
452
453
  exports.FontSizes.fontSize48
453
454
  ];
455
+ exports.Indents = void 0;
456
+ (function (Indents) {
457
+ Indents["indentRight"] = "indent-right";
458
+ Indents["indentLeft"] = "indent-left";
459
+ })(exports.Indents || (exports.Indents = {}));
454
460
  exports.MarkTypes = void 0;
455
461
  (function (MarkTypes) {
456
462
  MarkTypes["bold"] = "bold";
@@ -506,73 +512,6 @@
506
512
  var VOID_BLOCK_TYPES = [exports.ElementKinds.image, exports.ElementKinds.hr];
507
513
  var BLOCK_DELETEBACKWARD_TYPES = [exports.ElementKinds.tableCell];
508
514
 
509
- var TheToolbarGroupToken = new i0.InjectionToken('the-toolbar-group-token');
510
- var QUICK_TOOLBAR_HOTKEY = '/';
511
- exports.DropdownMode = void 0;
512
- (function (DropdownMode) {
513
- DropdownMode["icon"] = "icon-mode";
514
- DropdownMode["text"] = "text-mode";
515
- })(exports.DropdownMode || (exports.DropdownMode = {}));
516
- exports.ToolbarItemMode = void 0;
517
- (function (ToolbarItemMode) {
518
- ToolbarItemMode[ToolbarItemMode["horizontal"] = 0] = "horizontal";
519
- ToolbarItemMode[ToolbarItemMode["vertical"] = 1] = "vertical";
520
- })(exports.ToolbarItemMode || (exports.ToolbarItemMode = {}));
521
- var DefaultGlobalToolbarDefinition = [
522
- exports.ElementKinds.headingList,
523
- exports.ToolbarActionTypes.split,
524
- exports.MarkTypes.bold,
525
- exports.MarkTypes.italic,
526
- exports.MarkTypes.underline,
527
- exports.MarkTypes.strike,
528
- exports.ElementKinds.inlineCode,
529
- exports.MarkTypes.color,
530
- exports.MarkTypes.backgroundColor,
531
- exports.ToolbarActionTypes.split,
532
- exports.ToolbarActionTypes.alignType,
533
- exports.ToolbarActionTypes.verticalAlign,
534
- exports.ToolbarActionTypes.split,
535
- exports.ElementKinds.numberedList,
536
- exports.ElementKinds.bulletedList,
537
- exports.ToolbarActionTypes.split,
538
- exports.ElementKinds.link,
539
- exports.ElementKinds.image,
540
- exports.ElementKinds.table,
541
- exports.ElementKinds.blockquote,
542
- exports.ElementKinds.code
543
- ];
544
- var DefaultInlineToolbarDefinition = [
545
- exports.ToolbarActionTypes.clean,
546
- exports.ToolbarActionTypes.split,
547
- exports.MarkTypes.bold,
548
- exports.MarkTypes.italic,
549
- exports.MarkTypes.underline,
550
- exports.MarkTypes.strike,
551
- exports.ElementKinds.inlineCode,
552
- exports.MarkTypes.color,
553
- exports.MarkTypes.backgroundColor,
554
- exports.ToolbarActionTypes.split,
555
- exports.ToolbarActionTypes.alignType,
556
- exports.ToolbarActionTypes.split,
557
- exports.ElementKinds.link
558
- ];
559
- var DefaultQuickToolbarDefinition = __spreadArray(__spreadArray([], __read(STANDARD_HEADING_TYPES)), [
560
- exports.ToolbarActionTypes.split,
561
- exports.ElementKinds.numberedList,
562
- exports.ElementKinds.bulletedList,
563
- exports.ToolbarActionTypes.split,
564
- exports.ElementKinds.link,
565
- exports.ElementKinds.image,
566
- exports.ElementKinds.table,
567
- exports.ElementKinds.blockquote,
568
- exports.ElementKinds.hr,
569
- exports.ElementKinds.code
570
- ]);
571
- var ToolbarMoreGroup = {
572
- key: 'more',
573
- icon: 'more'
574
- };
575
-
576
515
  exports.ErrorCodes = void 0;
577
516
  (function (ErrorCodes) {
578
517
  ErrorCodes[ErrorCodes["UNKNOW_ERROR"] = 1000] = "UNKNOW_ERROR";
@@ -665,6 +604,73 @@
665
604
  };
666
605
  var CODEMIRROR_PADDING_TOP = 10;
667
606
 
607
+ var TheToolbarGroupToken = new i0.InjectionToken('the-toolbar-group-token');
608
+ var QUICK_TOOLBAR_HOTKEY = '/';
609
+ exports.DropdownMode = void 0;
610
+ (function (DropdownMode) {
611
+ DropdownMode["icon"] = "icon-mode";
612
+ DropdownMode["text"] = "text-mode";
613
+ })(exports.DropdownMode || (exports.DropdownMode = {}));
614
+ exports.ToolbarItemMode = void 0;
615
+ (function (ToolbarItemMode) {
616
+ ToolbarItemMode[ToolbarItemMode["horizontal"] = 0] = "horizontal";
617
+ ToolbarItemMode[ToolbarItemMode["vertical"] = 1] = "vertical";
618
+ })(exports.ToolbarItemMode || (exports.ToolbarItemMode = {}));
619
+ var DefaultGlobalToolbarDefinition = [
620
+ exports.ElementKinds.headingList,
621
+ exports.ToolbarActionTypes.split,
622
+ exports.MarkTypes.bold,
623
+ exports.MarkTypes.italic,
624
+ exports.MarkTypes.underline,
625
+ exports.MarkTypes.strike,
626
+ exports.ElementKinds.inlineCode,
627
+ exports.MarkTypes.color,
628
+ exports.MarkTypes.backgroundColor,
629
+ exports.ToolbarActionTypes.split,
630
+ exports.ToolbarActionTypes.alignType,
631
+ exports.ToolbarActionTypes.verticalAlign,
632
+ exports.ToolbarActionTypes.split,
633
+ exports.ElementKinds.numberedList,
634
+ exports.ElementKinds.bulletedList,
635
+ exports.ToolbarActionTypes.split,
636
+ exports.ElementKinds.link,
637
+ exports.ElementKinds.image,
638
+ exports.ElementKinds.table,
639
+ exports.ElementKinds.blockquote,
640
+ exports.ElementKinds.code
641
+ ];
642
+ var DefaultInlineToolbarDefinition = [
643
+ exports.ToolbarActionTypes.clean,
644
+ exports.ToolbarActionTypes.split,
645
+ exports.MarkTypes.bold,
646
+ exports.MarkTypes.italic,
647
+ exports.MarkTypes.underline,
648
+ exports.MarkTypes.strike,
649
+ exports.ElementKinds.inlineCode,
650
+ exports.MarkTypes.color,
651
+ exports.MarkTypes.backgroundColor,
652
+ exports.ToolbarActionTypes.split,
653
+ exports.ToolbarActionTypes.alignType,
654
+ exports.ToolbarActionTypes.split,
655
+ exports.ElementKinds.link
656
+ ];
657
+ var DefaultQuickToolbarDefinition = __spreadArray(__spreadArray([], __read(STANDARD_HEADING_TYPES)), [
658
+ exports.ToolbarActionTypes.split,
659
+ exports.ElementKinds.numberedList,
660
+ exports.ElementKinds.bulletedList,
661
+ exports.ToolbarActionTypes.split,
662
+ exports.ElementKinds.link,
663
+ exports.ElementKinds.image,
664
+ exports.ElementKinds.table,
665
+ exports.ElementKinds.blockquote,
666
+ exports.ElementKinds.hr,
667
+ exports.ElementKinds.code
668
+ ]);
669
+ var ToolbarMoreGroup = {
670
+ key: 'more',
671
+ icon: 'more'
672
+ };
673
+
668
674
  var TheTextComponent = /** @class */ (function (_super) {
669
675
  __extends(TheTextComponent, _super);
670
676
  function TheTextComponent(elementRef, renderer2, cdr) {
@@ -689,10 +695,7 @@
689
695
  }
690
696
  }
691
697
  var fontSize = this.text[exports.MarkTypes.fontSize];
692
- if (fontSize) {
693
- var attr = "the-" + exports.MarkTypes.fontSize;
694
- this.renderer2.setAttribute(this.elementRef.nativeElement, attr, fontSize);
695
- }
698
+ this.renderer2.setAttribute(this.elementRef.nativeElement, "the-" + exports.MarkTypes.fontSize, fontSize ? fontSize : null);
696
699
  if (this.text[exports.MarkTypes.color]) {
697
700
  this.renderer2.setStyle(this.elementRef.nativeElement, 'color', this.text[exports.MarkTypes.color]);
698
701
  }
@@ -753,10 +756,18 @@
753
756
  function TheDefaultElementComponent() {
754
757
  return _super !== null && _super.apply(this, arguments) || this;
755
758
  }
759
+ Object.defineProperty(TheDefaultElementComponent.prototype, "indent", {
760
+ get: function () {
761
+ var _a;
762
+ return (_a = this.element) === null || _a === void 0 ? void 0 : _a.indent;
763
+ },
764
+ enumerable: false,
765
+ configurable: true
766
+ });
756
767
  return TheDefaultElementComponent;
757
768
  }(TheBaseElementComponent));
758
769
  TheDefaultElementComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheDefaultElementComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
759
- TheDefaultElementComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheDefaultElementComponent, selector: "[theDefaultElement]", usesInheritance: true, ngImport: i0__namespace, template: '<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>', isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
770
+ TheDefaultElementComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheDefaultElementComponent, selector: "[theDefaultElement]", host: { properties: { "attr.the-indent": "this.indent" } }, usesInheritance: true, ngImport: i0__namespace, template: '<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>', isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
760
771
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheDefaultElementComponent, decorators: [{
761
772
  type: i0.Component,
762
773
  args: [{
@@ -764,7 +775,10 @@
764
775
  template: '<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>',
765
776
  changeDetection: i0.ChangeDetectionStrategy.OnPush
766
777
  }]
767
- }] });
778
+ }], propDecorators: { indent: [{
779
+ type: i0.HostBinding,
780
+ args: ['attr.the-indent']
781
+ }] } });
768
782
 
769
783
  var TheEditor = Object.assign({}, i1.AngularEditor);
770
784
  exports.TheDataMode = void 0;
@@ -2080,6 +2094,13 @@
2080
2094
  slate.Transforms.setNodes(editor, { type: exports.ElementKinds.paragraph, checked: undefined }, // todo remove checked
2081
2095
  { at: path });
2082
2096
  }
2097
+ else if (slate.Element.isElement(node) && node.type === exports.ElementKinds.paragraph) {
2098
+ var textIndent = node.textIndent;
2099
+ if (textIndent) {
2100
+ slate.Transforms.setNodes(editor, { textIndent: undefined }, // remove textIndent
2101
+ { at: path });
2102
+ }
2103
+ }
2083
2104
  if (slate.Node.parent(editor, path).type !== exports.ElementKinds.listItem) {
2084
2105
  slate.Transforms.wrapNodes(editor, { type: exports.ElementKinds.listItem, children: [] }, {
2085
2106
  at: path,
@@ -3134,86 +3155,6 @@
3134
3155
  return editor;
3135
3156
  };
3136
3157
 
3137
- var onKeydownIndent = function (editor, event, kinds) {
3138
- var selection = editor.selection;
3139
- if (event.key === 'Tab') {
3140
- event.preventDefault();
3141
- var isExpanded = slate.Range.isExpanded(selection);
3142
- var nodes = Array.from(slate.Editor.nodes(editor, {
3143
- mode: 'highest',
3144
- match: indentNodeMatch(kinds)
3145
- }));
3146
- var startBlock = nodes[0];
3147
- if (startBlock && (isExpanded || slate.Editor.isStart(editor, selection.anchor, [startBlock[1][0]]))) {
3148
- if (!editor.isVoid(startBlock[0])) {
3149
- if (event.shiftKey) {
3150
- return cancelTextIntent(editor, startBlock[0], kinds);
3151
- }
3152
- var textIndent = startBlock[0].textIndent;
3153
- textIndent = textIndent ? textIndent : 0;
3154
- textIndent += 2;
3155
- if (textIndent < 50) {
3156
- slate.Transforms.setNodes(editor, { textIndent: textIndent }, {
3157
- mode: 'highest',
3158
- match: indentNodeMatch(kinds)
3159
- });
3160
- return true;
3161
- }
3162
- }
3163
- }
3164
- else {
3165
- editor.insertText(TAB_SPACE);
3166
- return true;
3167
- }
3168
- }
3169
- if (selection && slate.Range.isCollapsed(selection) && event.key === 'Backspace') {
3170
- var nodes = Array.from(slate.Editor.nodes(editor, {
3171
- mode: 'highest',
3172
- match: indentNodeMatch(kinds)
3173
- }));
3174
- var startBlock = nodes[0];
3175
- if (startBlock && slate.Editor.isStart(editor, selection.anchor, [startBlock[1][0]])) {
3176
- return cancelTextIntent(editor, startBlock[0], kinds);
3177
- }
3178
- }
3179
- return false;
3180
- };
3181
- var indentNodeMatch = function (kinds) { return function (node) { return slate.Element.isElement(node) && kinds.includes(node.type); }; };
3182
- function cancelTextIntent(editor, anchorBlock, kinds) {
3183
- var textIndent = anchorBlock.textIndent;
3184
- if (textIndent > 2) {
3185
- // prevent deleteBackward function
3186
- event.preventDefault();
3187
- textIndent -= 2;
3188
- slate.Transforms.setNodes(editor, { textIndent: textIndent }, {
3189
- mode: 'highest',
3190
- match: indentNodeMatch(kinds)
3191
- });
3192
- return true;
3193
- }
3194
- if (textIndent === 2) {
3195
- // prevent deleteBackward function
3196
- event.preventDefault();
3197
- slate.Transforms.setNodes(editor, { textIndent: null }, {
3198
- mode: 'highest',
3199
- match: function (node) { return slate.Element.isElement(node) && kinds.includes(node.type); }
3200
- });
3201
- return true;
3202
- }
3203
- return false;
3204
- }
3205
-
3206
- var withIndent = function (kinds) { return function (editor) {
3207
- var onKeydown = editor.onKeydown;
3208
- editor.onKeydown = function (event) {
3209
- var isContinue = !onKeydownIndent(editor, event, kinds);
3210
- if (isContinue) {
3211
- onKeydown(event);
3212
- }
3213
- };
3214
- return editor;
3215
- }; };
3216
-
3217
3158
  var isList = function (n) {
3218
3159
  return __spreadArray([], __read(LIST_BLOCK_TYPES)).includes(n.type);
3219
3160
  };
@@ -3783,58 +3724,12 @@
3783
3724
  }
3784
3725
  }
3785
3726
 
3786
- var ElementStylePipe = /** @class */ (function () {
3787
- function ElementStylePipe() {
3788
- }
3789
- ElementStylePipe.prototype.transform = function (element, align) {
3790
- var style = {};
3791
- if (element.align || align) {
3792
- style.textAlign = element.align || align || exports.Alignment.left;
3793
- }
3794
- if (element.textIndent) {
3795
- style.textIndent = element.textIndent + 'em';
3796
- }
3797
- return style;
3798
- };
3799
- return ElementStylePipe;
3800
- }());
3801
- ElementStylePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementStylePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
3802
- ElementStylePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementStylePipe, name: "elementStyle" });
3803
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementStylePipe, decorators: [{
3804
- type: i0.Pipe,
3805
- args: [{
3806
- name: 'elementStyle'
3807
- }]
3808
- }] });
3809
- var ElementClassPipe = /** @class */ (function () {
3810
- function ElementClassPipe() {
3811
- }
3812
- ElementClassPipe.prototype.transform = function (element) {
3813
- var classStr = '';
3814
- var prefix = 'indent';
3815
- if (element.textIndent) {
3816
- classStr += prefix + "-" + element.textIndent;
3817
- }
3818
- return classStr;
3819
- };
3820
- return ElementClassPipe;
3821
- }());
3822
- ElementClassPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementClassPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
3823
- ElementClassPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementClassPipe, name: "elementClass" });
3824
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementClassPipe, decorators: [{
3825
- type: i0.Pipe,
3826
- args: [{
3827
- name: 'elementClass'
3828
- }]
3829
- }] });
3830
-
3831
3727
  var TheNumberedListComponent = /** @class */ (function (_super) {
3832
3728
  __extends(TheNumberedListComponent, _super);
3833
- function TheNumberedListComponent(elementRef, cdr, elementClassPipe) {
3729
+ function TheNumberedListComponent(elementRef, cdr) {
3834
3730
  var _this = _super.call(this, elementRef, cdr) || this;
3835
3731
  _this.elementRef = elementRef;
3836
3732
  _this.cdr = cdr;
3837
- _this.elementClassPipe = elementClassPipe;
3838
3733
  return _this;
3839
3734
  }
3840
3735
  Object.defineProperty(TheNumberedListComponent.prototype, "start", {
@@ -3844,9 +3739,10 @@
3844
3739
  enumerable: false,
3845
3740
  configurable: true
3846
3741
  });
3847
- Object.defineProperty(TheNumberedListComponent.prototype, "class", {
3742
+ Object.defineProperty(TheNumberedListComponent.prototype, "level", {
3848
3743
  get: function () {
3849
- return this.elementClassPipe.transform(this.element);
3744
+ var _a;
3745
+ return (_a = this.element) === null || _a === void 0 ? void 0 : _a.indent;
3850
3746
  },
3851
3747
  enumerable: false,
3852
3748
  configurable: true
@@ -3859,35 +3755,34 @@
3859
3755
  };
3860
3756
  return TheNumberedListComponent;
3861
3757
  }(TheBaseElementComponent));
3862
- TheNumberedListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheNumberedListComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: ElementClassPipe }], target: i0__namespace.ɵɵFactoryTarget.Component });
3863
- TheNumberedListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
3758
+ TheNumberedListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheNumberedListComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
3759
+ TheNumberedListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
3864
3760
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheNumberedListComponent, decorators: [{
3865
3761
  type: i0.Component,
3866
3762
  args: [{
3867
3763
  selector: 'ol[theOl]',
3868
- template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>",
3869
- providers: [ElementClassPipe]
3764
+ template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>"
3870
3765
  }]
3871
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: ElementClassPipe }]; }, propDecorators: { start: [{
3766
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { start: [{
3872
3767
  type: i0.HostBinding,
3873
3768
  args: ['attr.start']
3874
- }], class: [{
3769
+ }], level: [{
3875
3770
  type: i0.HostBinding,
3876
- args: ['class']
3771
+ args: ['attr.the-level']
3877
3772
  }] } });
3878
3773
 
3879
3774
  var TheBulletedListComponent = /** @class */ (function (_super) {
3880
3775
  __extends(TheBulletedListComponent, _super);
3881
- function TheBulletedListComponent(elementRef, cdr, elementClassPipe) {
3776
+ function TheBulletedListComponent(elementRef, cdr) {
3882
3777
  var _this = _super.call(this, elementRef, cdr) || this;
3883
3778
  _this.elementRef = elementRef;
3884
3779
  _this.cdr = cdr;
3885
- _this.elementClassPipe = elementClassPipe;
3886
3780
  return _this;
3887
3781
  }
3888
- Object.defineProperty(TheBulletedListComponent.prototype, "class", {
3782
+ Object.defineProperty(TheBulletedListComponent.prototype, "level", {
3889
3783
  get: function () {
3890
- return this.elementClassPipe.transform(this.element);
3784
+ var _a;
3785
+ return (_a = this.element) === null || _a === void 0 ? void 0 : _a.indent;
3891
3786
  },
3892
3787
  enumerable: false,
3893
3788
  configurable: true
@@ -3900,18 +3795,17 @@
3900
3795
  };
3901
3796
  return TheBulletedListComponent;
3902
3797
  }(TheBaseElementComponent));
3903
- TheBulletedListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheBulletedListComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: ElementClassPipe }], target: i0__namespace.ɵɵFactoryTarget.Component });
3904
- TheBulletedListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
3798
+ TheBulletedListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheBulletedListComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
3799
+ TheBulletedListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
3905
3800
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheBulletedListComponent, decorators: [{
3906
3801
  type: i0.Component,
3907
3802
  args: [{
3908
3803
  selector: 'ul[theUl]',
3909
- template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>",
3910
- providers: [ElementClassPipe]
3804
+ template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>"
3911
3805
  }]
3912
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: ElementClassPipe }]; }, propDecorators: { class: [{
3806
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { level: [{
3913
3807
  type: i0.HostBinding,
3914
- args: ['class']
3808
+ args: ['attr.the-level']
3915
3809
  }] } });
3916
3810
 
3917
3811
  var TheListItemComponent = /** @class */ (function (_super) {
@@ -4244,52 +4138,6 @@
4244
4138
  };
4245
4139
  };
4246
4140
 
4247
- /** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
4248
- function coercePixelsFromCssValue(cssValue) {
4249
- var match = cssValue.match(/(\d+)px/);
4250
- if (match) {
4251
- return Number(match[1]);
4252
- }
4253
- }
4254
- function getElementWidth(element) {
4255
- // Optimization: Check style.width first as we probably set it already before reading
4256
- // offsetWidth which triggers layout.
4257
- return coercePixelsFromCssValue(element.style.width) || element.offsetWidth;
4258
- }
4259
- function getElementHeight(element) {
4260
- return Math.round(element.getBoundingClientRect().height);
4261
- }
4262
- function getColsTotalWidth(cols) {
4263
- return cols.reduce(function (total, col) {
4264
- return total + getElementWidth(col);
4265
- }, 0);
4266
- }
4267
- function getRowsTotalHeight(rows) {
4268
- return rows.reduce(function (total, row) {
4269
- return total + getElementHeight(row);
4270
- }, 0);
4271
- }
4272
- function useElementStyle(el, element) {
4273
- if (element.align) {
4274
- el.style.textAlign = element.align || exports.Alignment.left;
4275
- }
4276
- if (element.textIndent) {
4277
- el.style.textIndent = element.textIndent + 'em';
4278
- }
4279
- if (element.verticalAlign) {
4280
- el.style.verticalAlign = element.verticalAlign;
4281
- }
4282
- }
4283
- function getElementClassByPrefix(el, prefix) {
4284
- var matchClass = null;
4285
- el.classList.forEach(function (value, key) {
4286
- if (value.includes(prefix)) {
4287
- matchClass = value;
4288
- }
4289
- });
4290
- return matchClass;
4291
- }
4292
-
4293
4141
  var TheTodoItemComponent = /** @class */ (function (_super) {
4294
4142
  __extends(TheTodoItemComponent, _super);
4295
4143
  function TheTodoItemComponent(elementRef, cdr) {
@@ -4299,15 +4147,16 @@
4299
4147
  _this.checkItemClass = true;
4300
4148
  return _this;
4301
4149
  }
4302
- TheTodoItemComponent.prototype.onContextChange = function () {
4303
- _super.prototype.onContextChange.call(this);
4304
- if (this.initialized) {
4305
- this.useIndentClass(this.elementRef.nativeElement, this.element);
4306
- }
4307
- };
4150
+ Object.defineProperty(TheTodoItemComponent.prototype, "level", {
4151
+ get: function () {
4152
+ var _a;
4153
+ return (_a = this.element) === null || _a === void 0 ? void 0 : _a.indent;
4154
+ },
4155
+ enumerable: false,
4156
+ configurable: true
4157
+ });
4308
4158
  TheTodoItemComponent.prototype.ngOnInit = function () {
4309
4159
  _super.prototype.ngOnInit.call(this);
4310
- this.useIndentClass(this.elementRef.nativeElement, this.element);
4311
4160
  };
4312
4161
  TheTodoItemComponent.prototype.onCheck = function (checked) {
4313
4162
  if (this.readonly) {
@@ -4315,27 +4164,10 @@
4315
4164
  }
4316
4165
  setNode(this.editor, { checked: checked }, this.element);
4317
4166
  };
4318
- TheTodoItemComponent.prototype.useIndentClass = function (el, element) {
4319
- var prefix = 'indent';
4320
- if (element.textIndent) {
4321
- var oldClass = getElementClassByPrefix(el, prefix);
4322
- if (oldClass) {
4323
- el.classList.remove(oldClass);
4324
- }
4325
- var newClassName = prefix + "-" + element.textIndent;
4326
- el.classList.add(newClassName);
4327
- }
4328
- else {
4329
- var oldClass = getElementClassByPrefix(el, prefix);
4330
- if (oldClass) {
4331
- el.classList.remove(oldClass);
4332
- }
4333
- }
4334
- };
4335
4167
  return TheTodoItemComponent;
4336
4168
  }(TheBaseElementComponent));
4337
4169
  TheTodoItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTodoItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
4338
- TheTodoItemComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, template: "\n <span contenteditable=\"false\" class=\"todo-item-status\">\n <input #checkbox type=\"checkbox\" [checked]=\"element.checked\" (click)=\"onCheck(checkbox.checked)\" />\n </span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n ", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
4170
+ TheTodoItemComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, template: "\n <span contenteditable=\"false\" class=\"todo-item-status\">\n <input #checkbox type=\"checkbox\" [checked]=\"element.checked\" (click)=\"onCheck(checkbox.checked)\" />\n </span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n ", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
4339
4171
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTodoItemComponent, decorators: [{
4340
4172
  type: i0.Component,
4341
4173
  args: [{
@@ -4345,6 +4177,9 @@
4345
4177
  }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { checkItemClass: [{
4346
4178
  type: i0.HostBinding,
4347
4179
  args: ['class.the-check-item']
4180
+ }], level: [{
4181
+ type: i0.HostBinding,
4182
+ args: ['attr.the-level']
4348
4183
  }] } });
4349
4184
 
4350
4185
  var withTodoItem = function (editor) {
@@ -4983,7 +4818,7 @@
4983
4818
  return;
4984
4819
  }
4985
4820
  // → + right-block-card
4986
- if ((isMoveForward && !isCardLeftCursor)) {
4821
+ if (isMoveForward && !isCardLeftCursor) {
4987
4822
  nativeEvent.preventDefault();
4988
4823
  var _c = __read(i1.AngularEditor.toSlateCardEntry(editor, anchorNode), 2), path = _c[1];
4989
4824
  var nextPath = slate.Path.next(path);
@@ -8693,14 +8528,60 @@
8693
8528
  });
8694
8529
  this.changeCells();
8695
8530
  }
8696
- };
8697
- return TableStore;
8698
- }());
8699
- TableStore.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TableStore, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
8700
- TableStore.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TableStore });
8701
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TableStore, decorators: [{
8702
- type: i0.Injectable
8703
- }], ctorParameters: function () { return []; } });
8531
+ };
8532
+ return TableStore;
8533
+ }());
8534
+ TableStore.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TableStore, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
8535
+ TableStore.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TableStore });
8536
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TableStore, decorators: [{
8537
+ type: i0.Injectable
8538
+ }], ctorParameters: function () { return []; } });
8539
+
8540
+ /** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
8541
+ function coercePixelsFromCssValue(cssValue) {
8542
+ var match = cssValue.match(/(\d+)px/);
8543
+ if (match) {
8544
+ return Number(match[1]);
8545
+ }
8546
+ }
8547
+ function getElementWidth(element) {
8548
+ // Optimization: Check style.width first as we probably set it already before reading
8549
+ // offsetWidth which triggers layout.
8550
+ return coercePixelsFromCssValue(element.style.width) || element.offsetWidth;
8551
+ }
8552
+ function getElementHeight(element) {
8553
+ return Math.round(element.getBoundingClientRect().height);
8554
+ }
8555
+ function getColsTotalWidth(cols) {
8556
+ return cols.reduce(function (total, col) {
8557
+ return total + getElementWidth(col);
8558
+ }, 0);
8559
+ }
8560
+ function getRowsTotalHeight(rows) {
8561
+ return rows.reduce(function (total, row) {
8562
+ return total + getElementHeight(row);
8563
+ }, 0);
8564
+ }
8565
+ function useElementStyle(el, element) {
8566
+ if (element.align) {
8567
+ el.style.textAlign = element.align || exports.Alignment.left;
8568
+ }
8569
+ if (element.textIndent) {
8570
+ el.style.textIndent = element.textIndent + 'em';
8571
+ }
8572
+ if (element.verticalAlign) {
8573
+ el.style.verticalAlign = element.verticalAlign;
8574
+ }
8575
+ }
8576
+ function getElementClassByPrefix(el, prefix) {
8577
+ var matchClass = null;
8578
+ el.classList.forEach(function (value, key) {
8579
+ if (value.includes(prefix)) {
8580
+ matchClass = value;
8581
+ }
8582
+ });
8583
+ return matchClass;
8584
+ }
8704
8585
 
8705
8586
  function splitCell(editor) {
8706
8587
  var opts = new TableOptions$1();
@@ -11552,7 +11433,7 @@
11552
11433
  TheVerticalToolbarItemComponent.prototype.execute = function (event) {
11553
11434
  var _a, _b;
11554
11435
  _super.prototype.execute.call(this, event);
11555
- if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11436
+ if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.readOnly) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11556
11437
  return;
11557
11438
  }
11558
11439
  this.openPopover();
@@ -11586,7 +11467,7 @@
11586
11467
  return TheVerticalToolbarItemComponent;
11587
11468
  }(TheToolbarBaseItemComponent));
11588
11469
  TheVerticalToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$6.ThyPopover }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
11589
- TheVerticalToolbarItemComponent.ɵcmp = i0__namespace.ɵɵ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: i0.TemplateRef, static: true }], usesInheritance: true, ngImport: i0__namespace, 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__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
11470
+ TheVerticalToolbarItemComponent.ɵcmp = i0__namespace.ɵɵ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: i0.TemplateRef, static: true }], usesInheritance: true, ngImport: i0__namespace, 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__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
11590
11471
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, decorators: [{
11591
11472
  type: i0.Component,
11592
11473
  args: [{
@@ -11870,14 +11751,17 @@
11870
11751
  }
11871
11752
  TheQuickToolbarComponent.prototype.handleMouseDown = function (event) {
11872
11753
  if (!this.elementRef.nativeElement.contains(event.target)) {
11873
- this.popoverRef.close();
11754
+ QuickInsertEditor.closeQuickToolbar(this.editor);
11874
11755
  }
11875
11756
  else {
11876
11757
  event.preventDefault();
11877
11758
  }
11878
11759
  };
11879
11760
  TheQuickToolbarComponent.prototype.handleEnter = function () {
11880
- this.popoverRef.close();
11761
+ QuickInsertEditor.closeQuickToolbar(this.editor);
11762
+ };
11763
+ TheQuickToolbarComponent.prototype.handleEsc = function () {
11764
+ QuickInsertEditor.closeQuickToolbar(this.editor);
11881
11765
  };
11882
11766
  TheQuickToolbarComponent.prototype.ngOnInit = function () {
11883
11767
  this.editorElement = i1.AngularEditor.toDOMNode(this.editor, this.editor);
@@ -11894,7 +11778,7 @@
11894
11778
  };
11895
11779
  TheQuickToolbarComponent.prototype.removeHotKey = function () {
11896
11780
  var node = slate.Node.get(this.editor, this.editor.selection.anchor.path);
11897
- if (node && slate.Text.equals({ text: QUICK_TOOLBAR_HOTKEY }, node)) {
11781
+ if (node && QUICK_TOOLBAR_HOTKEY === node.text) {
11898
11782
  slate.Editor.deleteBackward(this.editor);
11899
11783
  }
11900
11784
  };
@@ -11904,7 +11788,7 @@
11904
11788
  return TheQuickToolbarComponent;
11905
11789
  }(core.mixinUnsubscribe(core.MixinBase)));
11906
11790
  TheQuickToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheQuickToolbarComponent, deps: [{ token: i1__namespace$3.ThyPopoverRef }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
11907
- TheQuickToolbarComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace$2.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5__namespace$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__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
11791
+ TheQuickToolbarComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace$2.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5__namespace$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__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
11908
11792
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheQuickToolbarComponent, decorators: [{
11909
11793
  type: i0.Component,
11910
11794
  args: [{
@@ -11921,6 +11805,9 @@
11921
11805
  }], handleEnter: [{
11922
11806
  type: i0.HostListener,
11923
11807
  args: ['document: keydown.enter']
11808
+ }], handleEsc: [{
11809
+ type: i0.HostListener,
11810
+ args: ['document: keydown.escape']
11924
11811
  }] } });
11925
11812
 
11926
11813
  var OperationTypes = ['insert_text', 'remove_node', 'merge_node'];
@@ -12039,7 +11926,7 @@
12039
11926
  return;
12040
11927
  }
12041
11928
  // unset fontSize
12042
- if (isDefaultFontSize && Number(defaultFontSize) === fontSizeMark) {
11929
+ if (isDefaultFontSize) {
12043
11930
  FontSizeEditor.unsetFontSize(editor, size);
12044
11931
  return;
12045
11932
  }
@@ -12139,7 +12026,7 @@
12139
12026
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
12140
12027
  // Put this at the start and end of an inline component to work around this Chromium bug:
12141
12028
  // https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
12142
- _this.inlineChromiumBugfix = '$' + String.fromCodePoint(160);
12029
+ _this.inlineChromiumBugfix = String.fromCodePoint(160);
12143
12030
  return _this;
12144
12031
  }
12145
12032
  return TheInlineCodeComponent;
@@ -12195,6 +12082,300 @@
12195
12082
  return editor;
12196
12083
  };
12197
12084
 
12085
+ var TheIndentToolbarComponent = /** @class */ (function (_super) {
12086
+ __extends(TheIndentToolbarComponent, _super);
12087
+ function TheIndentToolbarComponent(elementRef, thyPopover, viewContainerRef, overlay) {
12088
+ var _this = _super.call(this) || this;
12089
+ _this.elementRef = elementRef;
12090
+ _this.thyPopover = thyPopover;
12091
+ _this.viewContainerRef = viewContainerRef;
12092
+ _this.overlay = overlay;
12093
+ _this.mode = exports.DropdownMode.text;
12094
+ _this.dropdownMode = exports.DropdownMode;
12095
+ _this.disabled = false;
12096
+ return _this;
12097
+ }
12098
+ Object.defineProperty(TheIndentToolbarComponent.prototype, "isOpen", {
12099
+ get: function () {
12100
+ return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
12101
+ },
12102
+ enumerable: false,
12103
+ configurable: true
12104
+ });
12105
+ TheIndentToolbarComponent.prototype.toggleDropdown = function (event) {
12106
+ var _a;
12107
+ _super.prototype.execute.call(this, event);
12108
+ if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled) {
12109
+ return;
12110
+ }
12111
+ this.openDropdownPopover();
12112
+ };
12113
+ TheIndentToolbarComponent.prototype.handleDocumentMouseDown = function (event) {
12114
+ if (!this.elementRef.nativeElement.contains(event.target)) {
12115
+ this.closeDropdownPopover();
12116
+ }
12117
+ };
12118
+ Object.defineProperty(TheIndentToolbarComponent.prototype, "disabledState", {
12119
+ get: function () {
12120
+ return this.disabled;
12121
+ },
12122
+ enumerable: false,
12123
+ configurable: true
12124
+ });
12125
+ TheIndentToolbarComponent.prototype.ngOnInit = function () {
12126
+ var _a;
12127
+ if (!this.activeMenu) {
12128
+ this.activeMenu = this.menus[0];
12129
+ }
12130
+ if (this.toolbarItem) {
12131
+ this.elementRef.nativeElement.classList.add("" + ((_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key));
12132
+ }
12133
+ };
12134
+ TheIndentToolbarComponent.prototype.statusChange = function (editor) {
12135
+ var _a, _b;
12136
+ 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;
12137
+ };
12138
+ TheIndentToolbarComponent.prototype.itemMousedown = function (event, item) {
12139
+ _super.prototype.execute.call(this, event);
12140
+ this.closeDropdownPopover();
12141
+ if (item === null || item === void 0 ? void 0 : item.execute) {
12142
+ item === null || item === void 0 ? void 0 : item.execute(this.editor);
12143
+ }
12144
+ };
12145
+ TheIndentToolbarComponent.prototype.openDropdownPopover = function () {
12146
+ var _a;
12147
+ this.dropdownPopoverRef = this.thyPopover.open(this.dropdownTemplate, {
12148
+ origin: this.elementRef,
12149
+ panelClass: ['the-toolbar-dropdown-popover', (_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key],
12150
+ placement: 'bottomLeft',
12151
+ insideClosable: false,
12152
+ backdropClosable: true,
12153
+ hasBackdrop: false,
12154
+ offset: 10,
12155
+ viewContainerRef: this.viewContainerRef,
12156
+ scrollStrategy: this.overlay.scrollStrategies.reposition()
12157
+ });
12158
+ };
12159
+ TheIndentToolbarComponent.prototype.closeDropdownPopover = function () {
12160
+ var _a;
12161
+ if (this.dropdownPopoverRef) {
12162
+ (_a = this.dropdownPopoverRef) === null || _a === void 0 ? void 0 : _a.close();
12163
+ }
12164
+ };
12165
+ return TheIndentToolbarComponent;
12166
+ }(TheToolbarBaseItemComponent));
12167
+ TheIndentToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheIndentToolbarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }, { token: i2__namespace.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Component });
12168
+ TheIndentToolbarComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
12169
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheIndentToolbarComponent, decorators: [{
12170
+ type: i0.Component,
12171
+ args: [{
12172
+ selector: 'the-indent-toolbar-item',
12173
+ templateUrl: './toolbar-item.component.html',
12174
+ host: {
12175
+ class: 'the-toolbar-dropdown-container'
12176
+ }
12177
+ }]
12178
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i1__namespace$3.ThyPopover }, { type: i0__namespace.ViewContainerRef }, { type: i2__namespace.Overlay }]; }, propDecorators: { toolbarItem: [{
12179
+ type: i0.Input
12180
+ }], menus: [{
12181
+ type: i0.Input
12182
+ }], mode: [{
12183
+ type: i0.Input
12184
+ }], item: [{
12185
+ type: i0.Input
12186
+ }], dropdownTemplate: [{
12187
+ type: i0.ViewChild,
12188
+ args: ['dropdownTemplate', { static: true }]
12189
+ }], toggleDropdown: [{
12190
+ type: i0.HostListener,
12191
+ args: ['mousedown', ['$event']]
12192
+ }], handleDocumentMouseDown: [{
12193
+ type: i0.HostListener,
12194
+ args: ['document: mousedown', ['$event']]
12195
+ }], disabledState: [{
12196
+ type: i0.HostBinding,
12197
+ args: ['class.disabled']
12198
+ }] } });
12199
+
12200
+ var MaxIndent = 13;
12201
+ var includesIndentTypes = __spreadArray([
12202
+ exports.ElementKinds.checkItem,
12203
+ exports.ElementKinds.numberedList,
12204
+ exports.ElementKinds.bulletedList,
12205
+ exports.ElementKinds.paragraph
12206
+ ], __read(HEADING_TYPES));
12207
+ var IndentEditor = {
12208
+ setIndent: function (editor) {
12209
+ var nodes = Array.from(slate.Editor.nodes(editor, {
12210
+ mode: 'highest',
12211
+ match: function (n) { return slate.Element.isElement(n) && includesIndentTypes.includes(n.type); }
12212
+ }));
12213
+ var _a = __read(nodes, 1), startBlock = _a[0];
12214
+ if (startBlock) {
12215
+ var _b = __read(startBlock, 1), indent = _b[0].indent;
12216
+ indent = indent ? indent : 0;
12217
+ indent += 1;
12218
+ if (indent <= MaxIndent) {
12219
+ slate.Transforms.setNodes(editor, { indent: indent }, {
12220
+ mode: 'highest',
12221
+ match: function (n) { return slate.Element.isElement(n) && includesIndentTypes.includes(n.type); }
12222
+ });
12223
+ }
12224
+ }
12225
+ },
12226
+ cancelIndent: function (editor) {
12227
+ var nodes = Array.from(slate.Editor.nodes(editor, {
12228
+ mode: 'highest',
12229
+ match: function (n) { return slate.Element.isElement(n) && includesIndentTypes.includes(n.type); }
12230
+ }));
12231
+ var _a = __read(nodes, 1), startBlock = _a[0];
12232
+ if (startBlock) {
12233
+ var _b = __read(startBlock, 1), indent = _b[0].indent;
12234
+ indent = indent === 1 ? null : (indent -= 1);
12235
+ slate.Transforms.setNodes(editor, { indent: indent }, {
12236
+ mode: 'highest',
12237
+ match: function (n) { return slate.Element.isElement(n) && includesIndentTypes.includes(n.type); }
12238
+ });
12239
+ }
12240
+ },
12241
+ setTextIndent: function (editor, kinds, textIndent) {
12242
+ slate.Transforms.setNodes(editor, { textIndent: textIndent }, {
12243
+ mode: 'highest',
12244
+ match: function (node) { return slate.Element.isElement(node) && kinds.includes(node.type); }
12245
+ });
12246
+ },
12247
+ cancelTextIntent: function (editor, event, anchorBlock, kinds) {
12248
+ var textIndent = anchorBlock.textIndent, indent = anchorBlock.indent;
12249
+ if (indent) {
12250
+ event.preventDefault();
12251
+ IndentEditor.cancelIndent(editor);
12252
+ return true;
12253
+ }
12254
+ if (!indent && textIndent > 2) {
12255
+ event.preventDefault();
12256
+ textIndent -= 2;
12257
+ IndentEditor.setTextIndent(editor, kinds, textIndent);
12258
+ return true;
12259
+ }
12260
+ if (!indent && textIndent === 2) {
12261
+ event.preventDefault();
12262
+ IndentEditor.setTextIndent(editor, kinds, null);
12263
+ return true;
12264
+ }
12265
+ return false;
12266
+ },
12267
+ isDisabled: function (editor) {
12268
+ if (editor.selection) {
12269
+ var disableGroup = HEADING_TYPES;
12270
+ var anchorBlock$1 = anchorBlock(editor);
12271
+ return anchorBlock$1 && disableGroup.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
12272
+ }
12273
+ return false;
12274
+ }
12275
+ };
12276
+
12277
+ var IndentOptions = [
12278
+ {
12279
+ key: exports.ElementKinds.indent,
12280
+ includes: [exports.Indents.indentRight, exports.Indents.indentLeft],
12281
+ iconComponent: TheIndentToolbarComponent,
12282
+ disable: function (editor) { return IndentEditor.isDisabled(editor); }
12283
+ },
12284
+ {
12285
+ key: exports.Indents.indentRight,
12286
+ name: '增加缩进',
12287
+ icon: 'indent',
12288
+ execute: function (editor) { return IndentEditor.setIndent(editor); }
12289
+ },
12290
+ {
12291
+ key: exports.Indents.indentLeft,
12292
+ name: '减少缩进',
12293
+ icon: 'outdent',
12294
+ type: exports.ToolbarItemType.toolDropdown,
12295
+ execute: function (editor) { return IndentEditor.cancelIndent(editor); }
12296
+ }
12297
+ ];
12298
+
12299
+ var onKeydownTextIndent = function (editor, event, kinds) {
12300
+ var selection = editor.selection;
12301
+ var isExpanded = slate.Range.isExpanded(selection);
12302
+ var nodes = Array.from(slate.Editor.nodes(editor, {
12303
+ mode: 'highest',
12304
+ match: function (node) { return slate.Element.isElement(node) && kinds.includes(node.type); }
12305
+ }));
12306
+ var _a = __read(nodes, 1), startBlock = _a[0];
12307
+ if (!startBlock) {
12308
+ return false;
12309
+ }
12310
+ var _b = __read(startBlock, 2), block = _b[0], path = _b[1];
12311
+ var currentPath = [path[0]];
12312
+ var isStart = slate.Editor.isStart(editor, selection.anchor, currentPath);
12313
+ var textIndentDisable = [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList, exports.ElementKinds.checkItem];
12314
+ if (isHotkey__default["default"]('Tab', event)) {
12315
+ event.preventDefault();
12316
+ if (startBlock && (isExpanded || isStart)) {
12317
+ if (!editor.isVoid(block)) {
12318
+ var textIndent = block.textIndent, type = block.type;
12319
+ // do not apply first-line indentation for lists
12320
+ if (!textIndent && !textIndentDisable.includes(type)) {
12321
+ IndentEditor.setTextIndent(editor, kinds, 2);
12322
+ return true;
12323
+ }
12324
+ else {
12325
+ IndentEditor.setIndent(editor);
12326
+ return true;
12327
+ }
12328
+ }
12329
+ }
12330
+ else {
12331
+ editor.insertText(TAB_SPACE);
12332
+ return true;
12333
+ }
12334
+ }
12335
+ if (isHotkey__default["default"]('shift+Tab', event)) {
12336
+ if (startBlock && (isExpanded || isStart)) {
12337
+ if (!editor.isVoid(block)) {
12338
+ return IndentEditor.cancelTextIntent(editor, event, block, kinds);
12339
+ }
12340
+ }
12341
+ }
12342
+ if (selection && slate.Range.isCollapsed(selection) && i1.hotkeys.isDeleteBackward(event)) {
12343
+ if (startBlock && isStart) {
12344
+ return IndentEditor.cancelTextIntent(editor, event, block, kinds);
12345
+ }
12346
+ }
12347
+ return false;
12348
+ };
12349
+
12350
+ var withIndent = function (kinds) { return function (editor) {
12351
+ var onKeydown = editor.onKeydown;
12352
+ editor.onKeydown = function (event) {
12353
+ var HOTKEYS = {
12354
+ 'mod+]': exports.Indents.indentRight,
12355
+ 'mod+[': exports.Indents.indentLeft
12356
+ };
12357
+ for (var hotkey in HOTKEYS) {
12358
+ if (isHotkey__default["default"](hotkey, event)) {
12359
+ event.preventDefault();
12360
+ var mark = HOTKEYS[hotkey];
12361
+ switch (mark) {
12362
+ case exports.Indents.indentRight:
12363
+ IndentEditor.setIndent(editor);
12364
+ break;
12365
+ case exports.Indents.indentLeft:
12366
+ IndentEditor.cancelIndent(editor);
12367
+ break;
12368
+ }
12369
+ }
12370
+ }
12371
+ var isContinue = !onKeydownTextIndent(editor, event, kinds);
12372
+ if (isContinue) {
12373
+ onKeydown(event);
12374
+ }
12375
+ };
12376
+ return editor;
12377
+ }; };
12378
+
12198
12379
  var internalPlugins = [
12199
12380
  withTheHistory,
12200
12381
  withAutoInsertData(),
@@ -12237,7 +12418,7 @@
12237
12418
  withQuickInsert,
12238
12419
  withInlineCode
12239
12420
  ];
12240
- var internalToolbarItems = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(AlignOptions)), __read(MarkOptions)), __read(ColorOptions)), __read(HeadingOptions)), __read(FontSizeOptions)), __read(TodoItemOptions)), __read(ListOptions)), __read(ImageOptions)), __read(HrOptions)), __read(BlockquoteOptions)), __read(CodeOptions)), __read(LinkOptions)), __read(TableOptions)), __read(VerticalAlignOptions)), __read(PaintFormatOptions)), __read(InlineCodeOptions));
12421
+ var internalToolbarItems = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(AlignOptions)), __read(MarkOptions)), __read(ColorOptions)), __read(HeadingOptions)), __read(FontSizeOptions)), __read(TodoItemOptions)), __read(ListOptions)), __read(ImageOptions)), __read(HrOptions)), __read(BlockquoteOptions)), __read(CodeOptions)), __read(LinkOptions)), __read(TableOptions)), __read(VerticalAlignOptions)), __read(PaintFormatOptions)), __read(InlineCodeOptions)), __read(IndentOptions));
12241
12422
  var toolbarCompose = function (toolbarItems) {
12242
12423
  if (toolbarItems === void 0) { toolbarItems = []; }
12243
12424
  return __spreadArray(__spreadArray([], __read(internalToolbarItems)), __read(toolbarItems));
@@ -12884,6 +13065,51 @@
12884
13065
  args: ['mousedown', ['$event']]
12885
13066
  }] } });
12886
13067
 
13068
+ var ElementStylePipe = /** @class */ (function () {
13069
+ function ElementStylePipe() {
13070
+ }
13071
+ ElementStylePipe.prototype.transform = function (element, align) {
13072
+ var style = {};
13073
+ if (element.align || align) {
13074
+ style.textAlign = element.align || align || exports.Alignment.left;
13075
+ }
13076
+ if (element.textIndent) {
13077
+ style.textIndent = element.textIndent + 'em';
13078
+ }
13079
+ return style;
13080
+ };
13081
+ return ElementStylePipe;
13082
+ }());
13083
+ ElementStylePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementStylePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
13084
+ ElementStylePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementStylePipe, name: "elementStyle" });
13085
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementStylePipe, decorators: [{
13086
+ type: i0.Pipe,
13087
+ args: [{
13088
+ name: 'elementStyle'
13089
+ }]
13090
+ }] });
13091
+ var ElementClassPipe = /** @class */ (function () {
13092
+ function ElementClassPipe() {
13093
+ }
13094
+ ElementClassPipe.prototype.transform = function (element) {
13095
+ var classStr = '';
13096
+ var prefix = 'indent';
13097
+ if (element.textIndent) {
13098
+ classStr += prefix + "-" + element.textIndent;
13099
+ }
13100
+ return classStr;
13101
+ };
13102
+ return ElementClassPipe;
13103
+ }());
13104
+ ElementClassPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementClassPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
13105
+ ElementClassPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementClassPipe, name: "elementClass" });
13106
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementClassPipe, decorators: [{
13107
+ type: i0.Pipe,
13108
+ args: [{
13109
+ name: 'elementClass'
13110
+ }]
13111
+ }] });
13112
+
12887
13113
  var TheTemplateComponent = /** @class */ (function () {
12888
13114
  function TheTemplateComponent() {
12889
13115
  var _this = this;
@@ -13558,7 +13784,8 @@
13558
13784
  TheTableSelectComponent,
13559
13785
  TheTableToolbarItemComponent,
13560
13786
  TheConversionHintComponent,
13561
- TheVerticalToolbarItemComponent
13787
+ TheVerticalToolbarItemComponent,
13788
+ TheIndentToolbarComponent
13562
13789
  ];
13563
13790
  var PLUGIN_COMPONENTS = [
13564
13791
  TheImageComponent,
@@ -13604,7 +13831,8 @@
13604
13831
  TheTableSelectComponent,
13605
13832
  TheTableToolbarItemComponent,
13606
13833
  TheConversionHintComponent,
13607
- TheVerticalToolbarItemComponent, TheImageComponent,
13834
+ TheVerticalToolbarItemComponent,
13835
+ TheIndentToolbarComponent, TheImageComponent,
13608
13836
  TheTemplateComponent,
13609
13837
  TheHrComponent,
13610
13838
  TheBlockquoteComponent,