@worktile/theia 2.4.2 → 2.4.5

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 (38) hide show
  1. package/bundles/worktile-theia.umd.js +231 -143
  2. package/bundles/worktile-theia.umd.js.map +1 -1
  3. package/editor.module.d.ts +2 -1
  4. package/esm2015/editor.component.js +4 -2
  5. package/esm2015/interfaces/editor.js +1 -1
  6. package/esm2015/plugins/indent/indent.editor.js +11 -13
  7. package/esm2015/plugins/indent/indent.plugin.js +15 -2
  8. package/esm2015/plugins/indent/on-keydown-indent.js +3 -5
  9. package/esm2015/plugins/index.js +1 -1
  10. package/esm2015/plugins/quick-insert/components/quick-insert.component.js +6 -2
  11. package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +14 -15
  12. package/esm2015/plugins/quick-insert/quick-insert.editor.js +18 -27
  13. package/esm2015/plugins/quick-insert/quick-insert.plugin.js +43 -15
  14. package/esm2015/plugins/table/components/insert-mark/insert-mark.component.js +4 -4
  15. package/esm2015/plugins/table/components/table.component.js +2 -2
  16. package/esm2015/plugins/table/components/td/td.component.js +5 -7
  17. package/esm2015/plugins/table/table.service.js +6 -6
  18. package/esm2015/plugins/todo-item/todo-item.component.js +15 -7
  19. package/esm2015/queries/get-directly-parent.js +12 -0
  20. package/esm2015/queries/index.js +4 -2
  21. package/esm2015/queries/is-types-in-parent.js +16 -0
  22. package/esm2015/transforms/insert-element-next.js +24 -3
  23. package/esm2015/utils/is-clean-empty-paragraph.js +4 -1
  24. package/fesm2015/worktile-theia.js +227 -140
  25. package/fesm2015/worktile-theia.js.map +1 -1
  26. package/interfaces/editor.d.ts +11 -1
  27. package/package.json +1 -1
  28. package/plugins/indent/indent.plugin.d.ts +1 -0
  29. package/plugins/indent/on-keydown-indent.d.ts +1 -1
  30. package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.d.ts +3 -4
  31. package/plugins/quick-insert/quick-insert.editor.d.ts +3 -4
  32. package/plugins/quick-insert/quick-insert.plugin.d.ts +2 -0
  33. package/plugins/table/components/table.component.scss +43 -42
  34. package/plugins/todo-item/todo-item.component.d.ts +3 -1
  35. package/queries/get-directly-parent.d.ts +2 -0
  36. package/queries/index.d.ts +3 -1
  37. package/queries/is-types-in-parent.d.ts +2 -0
  38. package/utils/is-clean-empty-paragraph.d.ts +2 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('slate-angular'), require('ngx-tethys/core'), require('is-hotkey'), require('slate'), require('slate-history'), require('marked'), require('@atinc/selene'), require('ngx-tethys/popover'), require('lodash'), require('@angular/cdk/overlay'), require('ngx-tethys/alert'), require('rxjs/operators'), require('ngx-tethys/uploader'), require('rxjs'), require('@angular/platform-browser'), require('ngx-tethys/progress'), require('ngx-tethys/icon'), require('ngx-tethys/nav'), require('ngx-tethys/tooltip'), require('ngx-tethys/input'), require('ng-codemirror'), require('ngx-tethys/notify'), require('ngx-tethys/action-menu'), require('ngx-tethys/switch'), require('ngx-tethys/resizable'), require('is-url'), require('ngx-tethys/button'), require('ngx-tethys/form'), require('ngx-tethys/shared'), require('ngx-tethys'), require('@angular/cdk/coercion'), require('@angular/cdk/portal'), require('ngx-tethys/list'), require('ngx-tethys/autocomplete'), require('ngx-tethys/avatar'), require('ngx-tethys/select')) :
3
3
  typeof define === 'function' && define.amd ? define('@worktile/theia', ['exports', '@angular/core', '@angular/common', '@angular/forms', 'slate-angular', 'ngx-tethys/core', 'is-hotkey', 'slate', 'slate-history', 'marked', '@atinc/selene', 'ngx-tethys/popover', 'lodash', '@angular/cdk/overlay', 'ngx-tethys/alert', 'rxjs/operators', 'ngx-tethys/uploader', 'rxjs', '@angular/platform-browser', 'ngx-tethys/progress', 'ngx-tethys/icon', 'ngx-tethys/nav', 'ngx-tethys/tooltip', 'ngx-tethys/input', 'ng-codemirror', 'ngx-tethys/notify', 'ngx-tethys/action-menu', 'ngx-tethys/switch', 'ngx-tethys/resizable', 'is-url', 'ngx-tethys/button', 'ngx-tethys/form', 'ngx-tethys/shared', 'ngx-tethys', '@angular/cdk/coercion', '@angular/cdk/portal', 'ngx-tethys/list', 'ngx-tethys/autocomplete', 'ngx-tethys/avatar', 'ngx-tethys/select'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.theia = {}), global.ng.core, global.ng.common, global.ng.forms, global.i1, global.core, global.isHotkey, global.slate, global.slateHistory, global.marked, global.selene, global.i1$2, global._lodash, global.ng.cdk.overlay, global.i1$1, global.rxjs.operators, global.uploader, global.rxjs, global.ng.platformBrowser, global.i6, global.i3, global.i3$1, global.i5, global.i5$1, global.i8, global.i1$4, global.i2$1, global.i6$1, global.i9, global.isUrl, global.i1$5, global.i2$2, global.i5$2, global.i1$6, global.ng.cdk.coercion, global.ng.cdk.portal, global.i2$3, global.autocomplete, global.avatar, global.select));
5
- })(this, (function (exports, i0, i10, i4, i1, core, isHotkey, slate, slateHistory, marked, selene, i1$2, _lodash, i2, i1$1, operators, uploader, rxjs, i1$3, i6, i3, i3$1, i5, i5$1, i8, i1$4, i2$1, i6$1, i9, isUrl, i1$5, i2$2, i5$2, i1$6, coercion, portal, i2$3, autocomplete, avatar, select) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.theia = {}), global.ng.core, global.ng.common, global.ng.forms, global.i1, global.core, global.isHotkey, global.slate, global.slateHistory, global.marked, global.selene, global.i1$2, global._lodash, global.ng.cdk.overlay, global.i1$1, global.rxjs.operators, global.uploader, global.rxjs, global.ng.platformBrowser, global.i6, global.i3, global.i3$1, global.i5, global.i5$1, global.i8, global.i1$4, global.i2$1, global.i6$1, global.i9, global.isUrl, global.i1$5, global.i2$2, global.i5$2, global.i1$6, global.ng.cdk.coercion, global.ng.cdk.portal, global.i1$7, global.autocomplete, global.avatar, global.select));
5
+ })(this, (function (exports, i0, i10, i4, i1, core, isHotkey, slate, slateHistory, marked, selene, i1$2, _lodash, i2, i1$1, operators, uploader, rxjs, i1$3, i6, i3, i3$1, i5, i5$1, i8, i1$4, i2$1, i6$1, i9, isUrl, i1$5, i2$2, i5$2, i1$6, coercion, portal, i1$7, autocomplete, avatar, select) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -50,7 +50,7 @@
50
50
  var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
51
51
  var i5__namespace$2 = /*#__PURE__*/_interopNamespace(i5$2);
52
52
  var i1__namespace$6 = /*#__PURE__*/_interopNamespace(i1$6);
53
- var i2__namespace$3 = /*#__PURE__*/_interopNamespace(i2$3);
53
+ var i1__namespace$7 = /*#__PURE__*/_interopNamespace(i1$7);
54
54
 
55
55
  /*! *****************************************************************************
56
56
  Copyright (c) Microsoft Corporation.
@@ -1716,6 +1716,30 @@
1716
1716
  return !containerNode ? CONTAINER_BLOCKS : __spreadArray(__spreadArray([], __read(CONTAINER_BLOCKS)), [containerNode[0].type]);
1717
1717
  };
1718
1718
 
1719
+ var getDirectlyParent = function (editor) {
1720
+ var _a = __read(getBlockAbove(editor), 2), anchorPath = _a[1];
1721
+ if (!anchorPath)
1722
+ return;
1723
+ var parentEntry = getParent(editor, anchorPath);
1724
+ if (!parentEntry)
1725
+ return;
1726
+ return parentEntry;
1727
+ };
1728
+
1729
+ var isTypesInParent = function (editor, types) {
1730
+ if (!Array.isArray(types)) {
1731
+ types = [types];
1732
+ }
1733
+ var _a = __read(getBlockAbove(editor), 2), anchorPath = _a[1];
1734
+ if (!anchorPath)
1735
+ return false;
1736
+ var parentEntry = slate.Editor.above(editor, { match: function (n) { return types.includes(n.type); } });
1737
+ if (!parentEntry)
1738
+ return false;
1739
+ var _b = __read(parentEntry, 1), parentNode = _b[0];
1740
+ return types.includes(parentNode.type);
1741
+ };
1742
+
1719
1743
  var index$1 = /*#__PURE__*/Object.freeze({
1720
1744
  __proto__: null,
1721
1745
  getLastNode: getLastNode,
@@ -1743,6 +1767,7 @@
1743
1767
  getPlainText: getPlainText,
1744
1768
  getSelectionMarks: getSelectionMarks,
1745
1769
  getContainerBlocks: getContainerBlocks,
1770
+ getDirectlyParent: getDirectlyParent,
1746
1771
  isAncestor: isAncestor,
1747
1772
  isCollapsed: isCollapsed,
1748
1773
  isEmptyParagraph: isEmptyParagraph,
@@ -1765,6 +1790,7 @@
1765
1790
  isEmptyContent: isEmptyContent,
1766
1791
  isEmptyParagraphByPath: isEmptyParagraphByPath,
1767
1792
  isContainer: isContainer,
1793
+ isTypesInParent: isTypesInParent,
1768
1794
  anchorBlock: anchorBlock,
1769
1795
  anchorBlockEntry: anchorBlockEntry,
1770
1796
  anchorInlineEntry: anchorInlineEntry,
@@ -1776,11 +1802,32 @@
1776
1802
  });
1777
1803
 
1778
1804
  var insertElementNext = function (editor, node) {
1805
+ var _a;
1779
1806
  if (slate.Range.isExpanded(editor.selection)) {
1780
1807
  slate.Editor.deleteFragment(editor);
1781
1808
  }
1782
- var anchorBlockPath = anchorBlockEntry(editor)[1];
1783
- var isEmpty = isEmptyParagraph(editor);
1809
+ var allowContainerOperateTypes = ((_a = editor.options) === null || _a === void 0 ? void 0 : _a.allowContainerOperateTypes) || [];
1810
+ var isAllowContainerInsert = isTypesInParent(editor, allowContainerOperateTypes);
1811
+ var isBlockCardCursor$1 = isBlockCardCursor(editor);
1812
+ var containerBlocks = getContainerBlocks(editor);
1813
+ var isContainer = isNodeTypeIn(editor, containerBlocks, { at: editor.selection });
1814
+ var _b = __read(anchorBlockEntry(editor), 2), anchorBlock = _b[0], anchorBlockPath = _b[1];
1815
+ var isEmpty = slate.Editor.isEmpty(editor, anchorBlock);
1816
+ if (isAllowContainerInsert && isContainer && !isBlockCardCursor$1) {
1817
+ var _c = __read(slate.Editor.above(editor, {
1818
+ match: function (n) { return slate.Editor.isBlock(editor, n) && allowContainerOperateTypes.includes(n.type); },
1819
+ at: editor.selection
1820
+ }), 2), containerPath_1 = _c[1];
1821
+ slate.Editor.withoutNormalizing(editor, function () {
1822
+ var containerPathFirstPath = anchorBlockPath.slice(0, containerPath_1.length + 1);
1823
+ slate.Transforms.insertNodes(editor, node, { at: slate.Path.next(containerPathFirstPath) });
1824
+ slate.Transforms.select(editor, slate.Editor.start(editor, slate.Path.next(containerPathFirstPath)));
1825
+ if (isEmpty) {
1826
+ slate.Transforms.removeNodes(editor, { at: anchorBlockPath });
1827
+ }
1828
+ });
1829
+ return;
1830
+ }
1784
1831
  var nextPath = slate.Path.next([anchorBlockPath[0]]);
1785
1832
  slate.Transforms.insertNodes(editor, node, { at: nextPath });
1786
1833
  if (isEmpty && anchorBlockPath.length === 1) {
@@ -2145,6 +2192,9 @@
2145
2192
  return false;
2146
2193
  }
2147
2194
  var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
2195
+ return isPureEmptyParagraph(editor, block);
2196
+ };
2197
+ var isPureEmptyParagraph = function (editor, block) {
2148
2198
  var textIndent = 'textIndent';
2149
2199
  var align = 'align';
2150
2200
  var hasTextIndent = block[textIndent];
@@ -4044,10 +4094,11 @@
4044
4094
 
4045
4095
  var TheTodoItemComponent = /** @class */ (function (_super) {
4046
4096
  __extends(TheTodoItemComponent, _super);
4047
- function TheTodoItemComponent(elementRef, cdr) {
4097
+ function TheTodoItemComponent(elementRef, cdr, ctxService) {
4048
4098
  var _this = _super.call(this, elementRef, cdr) || this;
4049
4099
  _this.elementRef = elementRef;
4050
4100
  _this.cdr = cdr;
4101
+ _this.ctxService = ctxService;
4051
4102
  _this.checkItemClass = true;
4052
4103
  return _this;
4053
4104
  }
@@ -4063,14 +4114,19 @@
4063
4114
  _super.prototype.ngOnInit.call(this);
4064
4115
  };
4065
4116
  TheTodoItemComponent.prototype.onCheck = function (checked) {
4066
- if (this.readonly) {
4117
+ var options = this.ctxService.getTheOptions();
4118
+ var noBindReadonly = options.noBindReadonlyPlugins && options.noBindReadonlyPlugins.includes(exports.ElementKinds.checkItem);
4119
+ if (!noBindReadonly && this.readonly) {
4067
4120
  return false;
4068
4121
  }
4122
+ else {
4123
+ setNode(this.editor, { checked: checked }, this.element);
4124
+ }
4069
4125
  setNode(this.editor, { checked: checked }, this.element);
4070
4126
  };
4071
4127
  return TheTodoItemComponent;
4072
4128
  }(TheBaseElementComponent));
4073
- 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 });
4129
+ 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 }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
4074
4130
  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 <span><slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children></span>\n ", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
4075
4131
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTodoItemComponent, decorators: [{
4076
4132
  type: i0.Component,
@@ -4078,7 +4134,7 @@
4078
4134
  selector: 'div[theTodoItem]',
4079
4135
  template: "\n <span contenteditable=\"false\" class=\"todo-item-status\">\n <input #checkbox type=\"checkbox\" [checked]=\"element.checked\" (click)=\"onCheck(checkbox.checked)\" />\n </span>\n <span><slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children></span>\n "
4080
4136
  }]
4081
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { checkItemClass: [{
4137
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: TheContextService }]; }, propDecorators: { checkItemClass: [{
4082
4138
  type: i0.HostBinding,
4083
4139
  args: ['class.the-check-item']
4084
4140
  }], level: [{
@@ -9401,7 +9457,7 @@
9401
9457
  offset: this.offset,
9402
9458
  hasBackdrop: this.hasBackdrop,
9403
9459
  insideClosable: this.insideClosable,
9404
- panelClass: 'the-table-toolbar-wrap',
9460
+ panelClass: 'the-temp-table-toolbar-wrap',
9405
9461
  scrollStrategy: this.overlay.scrollStrategies.reposition(),
9406
9462
  manualClosure: true
9407
9463
  });
@@ -9411,15 +9467,15 @@
9411
9467
  if (origin instanceof HTMLTableCellElement && origin.tagName !== 'TH') {
9412
9468
  var _a = this.tableStore, selectedRowsIndex = _a.selectedRowsIndex, selectedColumnsIndex = _a.selectedColumnsIndex, focusCellPath = _a.focusCellPath, isSelectedTable = _a.isSelectedTable, focusCellElement = _a.focusCellElement;
9413
9469
  var _b = __read(focusCellPath.slice(-2), 2), row = _b[0], col = _b[1];
9414
- var tableElement = focusCellElement.closest('.the-table-container');
9470
+ var tableElement = focusCellElement.closest('.the-temp-table-container');
9415
9471
  if (isSelectedTable && col === 0 && row === 0) {
9416
- return tableElement.querySelector('.the-table-corner-controls');
9472
+ return tableElement.querySelector('.the-temp-table-corner-controls');
9417
9473
  }
9418
9474
  if (selectedColumnsIndex.length > 0 && row === 0) {
9419
- return tableElement.querySelectorAll('.the-table-col-controls')[col];
9475
+ return tableElement.querySelectorAll('.the-temp-table-col-controls')[col];
9420
9476
  }
9421
9477
  if (selectedRowsIndex.length > 0 && col === 0) {
9422
- return tableElement.querySelectorAll('.the-table-row-controls-button-wrap')[row];
9478
+ return tableElement.querySelectorAll('.the-temp-table-row-controls-button-wrap')[row];
9423
9479
  }
9424
9480
  }
9425
9481
  return origin;
@@ -9531,13 +9587,13 @@
9531
9587
  var tableWrapper = tableComponent.tableWrapper.nativeElement;
9532
9588
  var tableElement = tableComponent.theTableElement.nativeElement;
9533
9589
  var result = 0;
9534
- var rowControl = tableComponent.nativeElement.querySelector('.the-table-row-controls');
9590
+ var rowControl = tableComponent.nativeElement.querySelector('.the-temp-table-row-controls');
9535
9591
  var rowControlWidth = 11;
9536
9592
  if (rowControl) {
9537
9593
  rowControlWidth = rowControl.getBoundingClientRect().width;
9538
9594
  }
9539
9595
  if (this.type === 'row') {
9540
- result = tableWrapper.offsetWidth + rowControlWidth;
9596
+ result = tableWrapper.offsetWidth + rowControlWidth - 2;
9541
9597
  }
9542
9598
  else {
9543
9599
  result = tableElement.offsetHeight - 1;
@@ -9549,7 +9605,7 @@
9549
9605
  return TheInsertMarkComponent;
9550
9606
  }());
9551
9607
  TheInsertMarkComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInsertMarkComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
9552
- TheInsertMarkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: { type: "type", at: "at", tableStore: "tableStore" }, ngImport: i0__namespace, template: "<div\n [thyTooltip]=\"!disabled && tooltipContent\"\n class=\"the-table-controls-insert-wrapper\"\n [ngClass]=\"{ disabled: disabled }\"\n contenteditable=\"false\"\n (mousedown)=\"onMouseDown($event)\"\n (mouseenter)=\"onMouseEnter($event)\"\n (mouseleave)=\"onMouseLeave($event)\"\n>\n <div\n class=\"the-table-controls-insert-line\"\n *ngIf=\"dotWrapperHovered\"\n [attr.data-dot-type]=\"type\"\n [ngStyle]=\"{ height: type === 'column' && insertLength, width: type === 'row' && insertLength }\"\n ></div>\n</div>\n", directives: [{ type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
9608
+ TheInsertMarkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: { type: "type", at: "at", tableStore: "tableStore" }, ngImport: i0__namespace, template: "<div\n [thyTooltip]=\"!disabled && tooltipContent\"\n class=\"the-temp-table-controls-insert-wrapper\"\n [ngClass]=\"{ disabled: disabled }\"\n contenteditable=\"false\"\n (mousedown)=\"onMouseDown($event)\"\n (mouseenter)=\"onMouseEnter($event)\"\n (mouseleave)=\"onMouseLeave($event)\"\n>\n <div\n class=\"the-temp-table-controls-insert-line\"\n *ngIf=\"dotWrapperHovered\"\n [attr.data-dot-type]=\"type\"\n [ngStyle]=\"{ height: type === 'column' && insertLength, width: type === 'row' && insertLength }\"\n ></div>\n</div>\n", directives: [{ type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
9553
9609
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInsertMarkComponent, decorators: [{
9554
9610
  type: i0.Component,
9555
9611
  args: [{
@@ -10063,7 +10119,7 @@
10063
10119
  provide: TheTableToken,
10064
10120
  useExisting: TheTableComponent
10065
10121
  }
10066
- ], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: i0.ElementRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<div\n class=\"the-table-container\"\n theColumnResize\n [ngClass]=\"{\n 'the-table-with-controls': isInTable,\n 'the-numbered-column-container': element?.options?.numberedColumn,\n 'the-table-selection-hide': tableStore.isCellSelecting || tableStore.isRightClicking\n }\"\n>\n <div\n class=\"the-table-row-controls-wrapper\"\n [ngClass]=\"{\n 'the-table-focus': isInTable\n }\"\n >\n <div\n class=\"the-table-corner-controls\"\n [ngClass]=\"{\n visible: !readonly && isInTable,\n active: isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\">\n <div\n class=\"the-table-row-controls-button-wrap\"\n *ngFor=\"let control of rowControls; let i = index; trackBy: trackByFnRowCotrols\"\n [ngClass]=\"{\n active: tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n <ng-container *ngIf=\"!readonly && isInTable && !element?.options?.numberedColumn\">\n <button\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n type=\"button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"element?.options?.numberedColumn\">\n <div\n [contentEditable]=\"false\"\n contenteditable=\"false\"\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">{{ i + 1 }}</p>\n </div>\n </ng-container>\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n </div>\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable [ngClass]=\"{ 'the-table-with-controls': isInTable }\">\n <colgroup *ngIf=\"columns\">\n <col *ngFor=\"let col of columns\" [ngStyle]=\"{ width: col.width + 'px' }\" />\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper\">\n <th\n class=\"the-table-col-controls\"\n [ngClass]=\"{\n active: tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n (mousedown)=\"onColMouseDown($event, i)\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColCotrols\"\n >\n <the-table-insert-mark *ngIf=\"isInTable\" type=\"column\" [at]=\"i + 1\" [tableStore]=\"tableStore\">\n </the-table-insert-mark>\n </th>\n </tr>\n </thead>\n <tbody #tbody>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"> </slate-children>\n </tbody>\n </table>\n </div>\n</div>\n", components: [{ type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: ["type", "at", "tableStore"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }], directives: [{ type: TheColumnResizeDirective, selector: "div[theColumnResize]" }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
10122
+ ], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: i0.ElementRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<!-- \u7C7B\u540D the-temp-*: \u4E34\u65F6\u89E3\u51B3\u56E0\u53D7portal\u5F71\u54CD\u8868\u683C\u6837\u5F0F\u95EE\u9898\uFF0C\u540E\u671F\u6539\u56DEthe-* -->\n<div\n class=\"the-temp-table-container\"\n theColumnResize\n [ngClass]=\"{\n 'the-temp-table-with-controls': isInTable,\n 'the-temp-numbered-column-container': element?.options?.numberedColumn,\n 'the-temp-table-selection-hide': tableStore.isCellSelecting || tableStore.isRightClicking\n }\"\n>\n <div\n class=\"the-temp-table-row-controls-wrapper\"\n [ngClass]=\"{\n 'the-temp-table-focus': isInTable\n }\"\n >\n <div\n class=\"the-temp-table-corner-controls\"\n [ngClass]=\"{\n visible: !readonly && isInTable,\n active: isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-temp-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-temp-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-temp-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-temp-table-row-controls\">\n <div class=\"the-temp-table-row-controls-inner\">\n <div\n class=\"the-temp-table-row-controls-button-wrap\"\n *ngFor=\"let control of rowControls; let i = index; trackBy: trackByFnRowCotrols\"\n [ngClass]=\"{\n active: tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n <ng-container *ngIf=\"!readonly && isInTable && !element?.options?.numberedColumn\">\n <button\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n type=\"button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-temp-table-row-controls-button the-temp-table-controls-button\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"element?.options?.numberedColumn\">\n <div\n [contentEditable]=\"false\"\n contenteditable=\"false\"\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n class=\"the-temp-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">{{ i + 1 }}</p>\n </div>\n </ng-container>\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n </div>\n </div>\n </div>\n </div>\n <div class=\"the-temp-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-temp-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-temp-table\" #theTable [ngClass]=\"{ 'the-temp-table-with-controls': isInTable }\">\n <colgroup *ngIf=\"columns\">\n <col *ngFor=\"let col of columns\" [ngStyle]=\"{ width: col.width + 'px' }\" />\n </colgroup>\n <thead>\n <tr class=\"the-temp-table-col-controls-wrapper\">\n <th\n class=\"the-temp-table-col-controls\"\n [ngClass]=\"{\n active: tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n (mousedown)=\"onColMouseDown($event, i)\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColCotrols\"\n >\n <the-table-insert-mark *ngIf=\"isInTable\" type=\"column\" [at]=\"i + 1\" [tableStore]=\"tableStore\">\n </the-table-insert-mark>\n </th>\n </tr>\n </thead>\n <tbody #tbody>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"> </slate-children>\n </tbody>\n </table>\n </div>\n</div>\n", components: [{ type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: ["type", "at", "tableStore"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }], directives: [{ type: TheColumnResizeDirective, selector: "div[theColumnResize]" }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
10067
10123
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTableComponent, decorators: [{
10068
10124
  type: i0.Component,
10069
10125
  args: [{
@@ -11006,12 +11062,12 @@
11006
11062
  };
11007
11063
  TheTdComponent.prototype.updateOverlayHandleRowSize = function () {
11008
11064
  var tableElement = this.tableComponent.nativeElement;
11009
- var rowControl = tableElement.querySelector('.the-table-row-controls');
11065
+ var rowControl = tableElement.querySelector('.the-temp-table-row-controls');
11010
11066
  var rowControlWidth = 11;
11011
11067
  if (rowControl) {
11012
11068
  rowControlWidth = rowControl.getBoundingClientRect().width;
11013
11069
  }
11014
- var width = this.tableComponent.tableWrapper.nativeElement.offsetWidth + rowControlWidth;
11070
+ var width = this.tableComponent.tableWrapper.nativeElement.offsetWidth + rowControlWidth - 2;
11015
11071
  this.overlayRef.addPanelClass(this.rowResizeClass);
11016
11072
  this.overlayRef.updateSize({ width: width, height: OVERLAY_INIT_SIZE });
11017
11073
  };
@@ -11204,8 +11260,7 @@
11204
11260
  TheTdComponent.prototype.applyTopRows = function (rows, deltaY, rowIndex) {
11205
11261
  while (deltaY < 0 && rows[rowIndex]) {
11206
11262
  var rowOffsetHeight = getElementHeight(rows[rowIndex]);
11207
- var rowStyleHeight = coercePixelsFromCssValue(rows[rowIndex].style.height);
11208
- if (rowOffsetHeight > this.tableOptions.minHeightPx && rowOffsetHeight === rowStyleHeight) {
11263
+ if (rowOffsetHeight > this.tableOptions.minHeightPx) {
11209
11264
  if (this.resizingStore.isResizing(deltaY, this.isXAxisHover)) {
11210
11265
  this.resizingStore.storeResizingRow(rows[rowIndex]);
11211
11266
  }
@@ -11225,8 +11280,7 @@
11225
11280
  TheTdComponent.prototype.applyBottomRows = function (rows, deltaY, rowIndex) {
11226
11281
  while (rows[rowIndex] && deltaY > 0) {
11227
11282
  var rowOffsetHeight = getElementHeight(rows[rowIndex]);
11228
- var rowStyleHeight = coercePixelsFromCssValue(rows[rowIndex].style.height);
11229
- if (rowOffsetHeight > this.tableOptions.minHeightPx && rowOffsetHeight === rowStyleHeight) {
11283
+ if (rowOffsetHeight > this.tableOptions.minHeightPx) {
11230
11284
  if (this.resizingStore.isResizing(deltaY, this.isXAxisHover)) {
11231
11285
  this.resizingStore.storeResizingRow(rows[rowIndex]);
11232
11286
  }
@@ -12118,27 +12172,27 @@
12118
12172
 
12119
12173
  var TheQuickToolbarComponent = /** @class */ (function (_super) {
12120
12174
  __extends(TheQuickToolbarComponent, _super);
12121
- function TheQuickToolbarComponent(popoverRef, elementRef) {
12175
+ function TheQuickToolbarComponent(elementRef, cdr) {
12122
12176
  var _this = _super.call(this) || this;
12123
- _this.popoverRef = popoverRef;
12124
12177
  _this.elementRef = elementRef;
12178
+ _this.cdr = cdr;
12125
12179
  _this.ToolbarItemMode = exports.ToolbarItemMode;
12126
12180
  _this.ToolbarActionTypes = exports.ToolbarActionTypes;
12127
12181
  return _this;
12128
12182
  }
12129
12183
  TheQuickToolbarComponent.prototype.handleMouseDown = function (event) {
12130
12184
  if (!this.elementRef.nativeElement.contains(event.target)) {
12131
- QuickInsertEditor.closeQuickToolbar(this.editor);
12185
+ QuickInsertEditor.closeQuickInsertToolbar(this.editor);
12132
12186
  }
12133
12187
  else {
12134
12188
  event.preventDefault();
12135
12189
  }
12136
12190
  };
12137
12191
  TheQuickToolbarComponent.prototype.handleEnter = function () {
12138
- QuickInsertEditor.closeQuickToolbar(this.editor);
12192
+ QuickInsertEditor.closeQuickInsertToolbar(this.editor);
12139
12193
  };
12140
12194
  TheQuickToolbarComponent.prototype.handleEsc = function () {
12141
- QuickInsertEditor.closeQuickToolbar(this.editor);
12195
+ QuickInsertEditor.closeQuickInsertToolbar(this.editor);
12142
12196
  };
12143
12197
  TheQuickToolbarComponent.prototype.ngOnInit = function () {
12144
12198
  this.editorElement = i1.AngularEditor.toDOMNode(this.editor, this.editor);
@@ -12164,15 +12218,15 @@
12164
12218
  };
12165
12219
  return TheQuickToolbarComponent;
12166
12220
  }(core.mixinUnsubscribe(core.MixinBase)));
12167
- 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 });
12168
- 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$3.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5__namespace$2.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["editor", "item", "itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
12221
+ TheQuickToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheQuickToolbarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
12222
+ 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: i1__namespace$7.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5__namespace$2.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["editor", "item", "itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
12169
12223
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheQuickToolbarComponent, decorators: [{
12170
12224
  type: i0.Component,
12171
12225
  args: [{
12172
12226
  selector: 'the-quick-toolbar',
12173
12227
  templateUrl: 'quick-toolbar.component.html'
12174
12228
  }]
12175
- }], ctorParameters: function () { return [{ type: i1__namespace$3.ThyPopoverRef }, { type: i0__namespace.ElementRef }]; }, propDecorators: { editor: [{
12229
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { editor: [{
12176
12230
  type: i0.Input
12177
12231
  }], quickToolbarItems: [{
12178
12232
  type: i0.Input
@@ -12187,16 +12241,23 @@
12187
12241
  args: ['document: keydown.escape']
12188
12242
  }] } });
12189
12243
 
12190
- var OperationTypes = ['insert_text', 'remove_node', 'merge_node'];
12191
12244
  var QuickInsertEditor = {
12192
- openQuickToolbar: function (editor, toolbarItems, origin) {
12245
+ openQuickInsertToolbar: function (editor, quickToolbarItems, origin) {
12246
+ if (QuickInsertEditor.isOpenedToolbar(editor)) {
12247
+ return;
12248
+ }
12249
+ if (!origin) {
12250
+ var _a = __read(getBlockAbove(editor), 1), block = _a[0];
12251
+ var rootNode = i1.AngularEditor.toDOMNode(editor, block);
12252
+ origin = rootNode.querySelector('[data-slate-leaf="true"]');
12253
+ }
12193
12254
  var overlay = editor.injector.get(i2.Overlay);
12194
12255
  var viewContainerRef = editor.injector.get(i0.ViewContainerRef);
12195
12256
  var thyPopover = editor.injector.get(i1$2.ThyPopover);
12196
12257
  var quickToolbarRef = thyPopover.open(TheQuickToolbarComponent, {
12197
12258
  initialState: {
12198
12259
  editor: editor,
12199
- quickToolbarItems: toolbarItems
12260
+ quickToolbarItems: quickToolbarItems
12200
12261
  },
12201
12262
  origin: origin,
12202
12263
  viewContainerRef: viewContainerRef,
@@ -12209,53 +12270,45 @@
12209
12270
  scrollStrategy: overlay.scrollStrategies.reposition(),
12210
12271
  manualClosure: true
12211
12272
  });
12273
+ quickToolbarRef.componentInstance.cdr.markForCheck();
12212
12274
  THE_EDITOR_QUICK_TOOLBAR_REF.set(editor, quickToolbarRef);
12213
12275
  },
12214
- closeQuickToolbar: function (editor) {
12276
+ closeQuickInsertToolbar: function (editor) {
12215
12277
  var quickToolbarRef = THE_EDITOR_QUICK_TOOLBAR_REF.get(editor);
12216
12278
  if (quickToolbarRef) {
12217
12279
  quickToolbarRef.close();
12218
12280
  THE_EDITOR_QUICK_TOOLBAR_REF.set(editor, null);
12219
12281
  }
12220
12282
  },
12221
- isOpenToolbar: function (editor, opTypes) {
12222
- if (opTypes === void 0) { opTypes = OperationTypes; }
12223
- var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
12224
- if (!isCollapsedCursor) {
12225
- return false;
12226
- }
12227
- var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
12228
- var undos = editor.history.undos;
12229
- var lastBatch = undos[undos.length - 1];
12230
- var lastOp = lastBatch && lastBatch[lastBatch.length - 1];
12231
- if (lastOp &&
12232
- block.children.length === 1 &&
12233
- block.type === exports.ElementKinds.paragraph &&
12234
- slate.Node.string(block) === QUICK_TOOLBAR_HOTKEY &&
12235
- opTypes.includes(lastOp.type) &&
12236
- (lastOp.text === QUICK_TOOLBAR_HOTKEY || lastOp.text === undefined)) {
12237
- return true;
12238
- }
12239
- return false;
12283
+ isOpenedToolbar: function (editor) {
12284
+ var quickToolbarRef = THE_EDITOR_QUICK_TOOLBAR_REF.get(editor);
12285
+ return !!quickToolbarRef;
12240
12286
  }
12241
12287
  };
12242
12288
 
12243
12289
  var withQuickInsert = function (editor) {
12244
12290
  var onKeydown = editor.onKeydown, deleteBackward = editor.deleteBackward, onChange = editor.onChange;
12291
+ var presseingQuickInsertHotkey = false;
12245
12292
  editor.onKeydown = function (event) {
12246
- if (event.key === QUICK_TOOLBAR_HOTKEY && isCleanEmptyParagraph(editor)) {
12247
- var rootNode = i1.AngularEditor.toDOMNode(editor, slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]));
12248
- var theEditorComponent = editor.injector.get(TheEditorComponent);
12249
- var quickToolbars = theEditorComponent.quickToolbarItems;
12250
- var leafElement = rootNode.querySelector('[data-slate-leaf="true"]');
12251
- var origin = leafElement || rootNode;
12252
- QuickInsertEditor.openQuickToolbar(editor, quickToolbars, origin);
12293
+ var _a;
12294
+ if (event.key === QUICK_TOOLBAR_HOTKEY) {
12295
+ var types = __spreadArray([], __read((((_a = editor.options) === null || _a === void 0 ? void 0 : _a.allowContainerOperateTypes) || [])));
12296
+ var _b = __read(getBlockAbove(editor), 1), block = _b[0];
12297
+ if (isPureEmptyParagraph(editor, block) && allowOpenQuickToolbar(editor, types)) {
12298
+ presseingQuickInsertHotkey = true;
12299
+ }
12300
+ }
12301
+ var quickToolbarRef = THE_EDITOR_QUICK_TOOLBAR_REF.get(editor);
12302
+ var isMoveUp = i1.hotkeys.isMoveUp(event);
12303
+ var isMoveDown = i1.hotkeys.isMoveDown(event);
12304
+ if (quickToolbarRef && (isMoveUp || isMoveDown)) {
12305
+ return;
12253
12306
  }
12254
12307
  onKeydown(event);
12255
12308
  };
12256
12309
  editor.deleteBackward = function (unit) {
12257
- if (!QuickInsertEditor.isOpenToolbar(editor, ['remove_text'])) {
12258
- QuickInsertEditor.closeQuickToolbar(editor);
12310
+ if (QuickInsertEditor.isOpenedToolbar(editor)) {
12311
+ QuickInsertEditor.closeQuickInsertToolbar(editor);
12259
12312
  }
12260
12313
  deleteBackward(unit);
12261
12314
  };
@@ -12263,16 +12316,35 @@
12263
12316
  var _a;
12264
12317
  onChange();
12265
12318
  if (editor.selection) {
12319
+ var _b = __read(getBlockAbove(editor), 2), block = _b[0], path = _b[1];
12320
+ // quick insert plus
12266
12321
  var editorComponent = editor.injector.get(TheEditorComponent);
12267
12322
  (_a = editorComponent.quickInsertInstance) === null || _a === void 0 ? void 0 : _a.checkStatus();
12268
- var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
12269
- if (!isCleanEmptyParagraph(editor) && slate.Node.string(block) !== QUICK_TOOLBAR_HOTKEY) {
12270
- QuickInsertEditor.closeQuickToolbar(editor);
12323
+ if (presseingQuickInsertHotkey && slate.Node.string(block) === QUICK_TOOLBAR_HOTKEY) {
12324
+ QuickInsertEditor.openQuickInsertToolbar(editor, editorComponent.quickToolbarItems);
12325
+ presseingQuickInsertHotkey = false;
12326
+ return;
12327
+ }
12328
+ else {
12329
+ presseingQuickInsertHotkey = false;
12330
+ }
12331
+ if (QuickInsertEditor.isOpenedToolbar(editor) &&
12332
+ !isPureEmptyParagraph(editor, block) &&
12333
+ slate.Node.string(block) !== QUICK_TOOLBAR_HOTKEY) {
12334
+ QuickInsertEditor.closeQuickInsertToolbar(editor);
12271
12335
  }
12272
12336
  }
12273
12337
  };
12274
12338
  return editor;
12275
12339
  };
12340
+ var allowOpenQuickToolbar = function (editor, allowTypes) {
12341
+ var _b = __read(getBlockAbove(editor), 2), block = _b[0], path = _b[1];
12342
+ var parentNode = slate.Node.parent(editor, path);
12343
+ if (path.length === 1 || (parentNode && allowTypes.includes(parentNode.type))) {
12344
+ return true;
12345
+ }
12346
+ return false;
12347
+ };
12276
12348
 
12277
12349
  var withSoftBreak = function (options) {
12278
12350
  if (options === void 0) { options = { rules: [{ hotkey: 'shift+enter' }] }; }
@@ -12576,6 +12648,78 @@
12576
12648
  args: ['class.disabled']
12577
12649
  }] } });
12578
12650
 
12651
+ var onKeydownTextIndent = function (editor, event, kinds, textIndentDisabled) {
12652
+ var selection = editor.selection;
12653
+ var isExpanded = slate.Range.isExpanded(selection);
12654
+ var nodes = Array.from(slate.Editor.nodes(editor, {
12655
+ mode: 'highest',
12656
+ match: function (node) { return slate.Element.isElement(node) && kinds.includes(node.type); }
12657
+ }));
12658
+ var _a = __read(nodes, 1), startBlock = _a[0];
12659
+ if (!startBlock) {
12660
+ return false;
12661
+ }
12662
+ var _b = __read(startBlock, 2), block = _b[0], path = _b[1];
12663
+ var isStart = slate.Editor.isStart(editor, selection.anchor, path);
12664
+ if (isHotkey.isKeyHotkey('Tab', event)) {
12665
+ event.preventDefault();
12666
+ if (startBlock && (isExpanded || isStart)) {
12667
+ if (!editor.isVoid(block)) {
12668
+ var textIndent = block.textIndent, type = block.type;
12669
+ // do not apply first-line indentation for lists
12670
+ if (!textIndent && !textIndentDisabled.includes(type)) {
12671
+ IndentEditor.setTextIndent(editor, kinds, 2);
12672
+ return true;
12673
+ }
12674
+ else {
12675
+ IndentEditor.setIndent(editor);
12676
+ return true;
12677
+ }
12678
+ }
12679
+ }
12680
+ else {
12681
+ editor.insertText(TAB_SPACE);
12682
+ return true;
12683
+ }
12684
+ }
12685
+ if (isHotkey.isKeyHotkey('shift+Tab', event)) {
12686
+ if (startBlock && (isExpanded || isStart)) {
12687
+ if (!editor.isVoid(block)) {
12688
+ return IndentEditor.cancelTextIntent(editor, event, block, kinds);
12689
+ }
12690
+ }
12691
+ }
12692
+ if (selection && slate.Range.isCollapsed(selection) && i1.hotkeys.isDeleteBackward(event)) {
12693
+ if (startBlock && isStart) {
12694
+ return IndentEditor.cancelTextIntent(editor, event, block, kinds);
12695
+ }
12696
+ }
12697
+ return false;
12698
+ };
12699
+
12700
+ var withIndent = function (kinds) { return function (editor) {
12701
+ var onKeydown = editor.onKeydown;
12702
+ editor.onKeydown = function (event) {
12703
+ var _a, _b, _c, _d;
12704
+ var indentTypes = kinds;
12705
+ var disableIndentTypes = [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList, exports.ElementKinds.checkItem];
12706
+ if ((_b = (_a = editor.extraIndentOptions) === null || _a === void 0 ? void 0 : _a.indentTypes) === null || _b === void 0 ? void 0 : _b.length) {
12707
+ indentTypes = mergIndentTypes(kinds, editor.extraIndentOptions.indentTypes);
12708
+ }
12709
+ if ((_d = (_c = editor.extraIndentOptions) === null || _c === void 0 ? void 0 : _c.disabledIndentTypes) === null || _d === void 0 ? void 0 : _d.length) {
12710
+ disableIndentTypes = mergIndentTypes(disableIndentTypes, editor.extraIndentOptions.disabledIndentTypes);
12711
+ }
12712
+ var isContinue = !onKeydownTextIndent(editor, event, indentTypes, disableIndentTypes);
12713
+ if (isContinue) {
12714
+ onKeydown(event);
12715
+ }
12716
+ };
12717
+ return editor;
12718
+ }; };
12719
+ var mergIndentTypes = function (defaultTypes, indentTypes) {
12720
+ return Array.from(new Set(__spreadArray(__spreadArray([], __read(defaultTypes)), __read(indentTypes))));
12721
+ };
12722
+
12579
12723
  var MaxIndent = 11;
12580
12724
  var includesIndentTypes = __spreadArray([
12581
12725
  exports.ElementKinds.checkItem,
@@ -12583,11 +12727,15 @@
12583
12727
  exports.ElementKinds.bulletedList,
12584
12728
  exports.ElementKinds.paragraph
12585
12729
  ], __read(HEADING_TYPES));
12730
+ var getIndentTypes = function (editor) {
12731
+ var indentTypes = editor.extraIndentOptions ? editor.extraIndentOptions.indentTypes : [];
12732
+ return mergIndentTypes(includesIndentTypes, indentTypes);
12733
+ };
12586
12734
  var IndentEditor = {
12587
12735
  setIndent: function (editor) {
12588
12736
  var nodes = Array.from(slate.Editor.nodes(editor, {
12589
12737
  mode: 'highest',
12590
- match: function (n) { return slate.Element.isElement(n) && includesIndentTypes.includes(n.type); }
12738
+ match: function (n) { return slate.Element.isElement(n) && getIndentTypes(editor).includes(n.type); }
12591
12739
  }));
12592
12740
  var _a = __read(nodes, 1), startBlock = _a[0];
12593
12741
  if (startBlock) {
@@ -12597,7 +12745,7 @@
12597
12745
  if (indent <= MaxIndent) {
12598
12746
  slate.Transforms.setNodes(editor, { indent: indent }, {
12599
12747
  mode: 'highest',
12600
- match: function (n) { return slate.Element.isElement(n) && includesIndentTypes.includes(n.type); }
12748
+ match: function (n) { return slate.Element.isElement(n) && getIndentTypes(editor).includes(n.type); }
12601
12749
  });
12602
12750
  }
12603
12751
  }
@@ -12605,7 +12753,7 @@
12605
12753
  cancelIndent: function (editor) {
12606
12754
  var nodes = Array.from(slate.Editor.nodes(editor, {
12607
12755
  mode: 'highest',
12608
- match: function (n) { return slate.Element.isElement(n) && includesIndentTypes.includes(n.type); }
12756
+ match: function (n) { return slate.Element.isElement(n) && getIndentTypes(editor).includes(n.type); }
12609
12757
  }));
12610
12758
  var _a = __read(nodes, 1), startBlock = _a[0];
12611
12759
  if (startBlock) {
@@ -12613,7 +12761,7 @@
12613
12761
  indent = indent === 1 ? null : (indent -= 1);
12614
12762
  slate.Transforms.setNodes(editor, { indent: indent }, {
12615
12763
  mode: 'highest',
12616
- match: function (n) { return slate.Element.isElement(n) && includesIndentTypes.includes(n.type); }
12764
+ match: function (n) { return slate.Element.isElement(n) && getIndentTypes(editor).includes(n.type); }
12617
12765
  });
12618
12766
  }
12619
12767
  },
@@ -12645,14 +12793,8 @@
12645
12793
  },
12646
12794
  isDisabled: function (editor) {
12647
12795
  if (editor.selection) {
12648
- var allowGroup = __spreadArray([
12649
- exports.ElementKinds.paragraph,
12650
- exports.ElementKinds.numberedList,
12651
- exports.ElementKinds.bulletedList,
12652
- exports.ElementKinds.checkItem
12653
- ], __read(HEADING_TYPES));
12654
12796
  var anchorBlock$1 = anchorBlock(editor);
12655
- return anchorBlock$1 && !allowGroup.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
12797
+ return anchorBlock$1 && !getIndentTypes(editor).includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
12656
12798
  }
12657
12799
  return false;
12658
12800
  }
@@ -12682,67 +12824,6 @@
12682
12824
  }
12683
12825
  ];
12684
12826
 
12685
- var onKeydownTextIndent = function (editor, event, kinds) {
12686
- var selection = editor.selection;
12687
- var isExpanded = slate.Range.isExpanded(selection);
12688
- var nodes = Array.from(slate.Editor.nodes(editor, {
12689
- mode: 'highest',
12690
- match: function (node) { return slate.Element.isElement(node) && kinds.includes(node.type); }
12691
- }));
12692
- var _a = __read(nodes, 1), startBlock = _a[0];
12693
- if (!startBlock) {
12694
- return false;
12695
- }
12696
- var _b = __read(startBlock, 2), block = _b[0], path = _b[1];
12697
- var isStart = slate.Editor.isStart(editor, selection.anchor, path);
12698
- var textIndentDisable = [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList, exports.ElementKinds.checkItem];
12699
- if (isHotkey.isKeyHotkey('Tab', event)) {
12700
- event.preventDefault();
12701
- if (startBlock && (isExpanded || isStart)) {
12702
- if (!editor.isVoid(block)) {
12703
- var textIndent = block.textIndent, type = block.type;
12704
- // do not apply first-line indentation for lists
12705
- if (!textIndent && !textIndentDisable.includes(type)) {
12706
- IndentEditor.setTextIndent(editor, kinds, 2);
12707
- return true;
12708
- }
12709
- else {
12710
- IndentEditor.setIndent(editor);
12711
- return true;
12712
- }
12713
- }
12714
- }
12715
- else {
12716
- editor.insertText(TAB_SPACE);
12717
- return true;
12718
- }
12719
- }
12720
- if (isHotkey.isKeyHotkey('shift+Tab', event)) {
12721
- if (startBlock && (isExpanded || isStart)) {
12722
- if (!editor.isVoid(block)) {
12723
- return IndentEditor.cancelTextIntent(editor, event, block, kinds);
12724
- }
12725
- }
12726
- }
12727
- if (selection && slate.Range.isCollapsed(selection) && i1.hotkeys.isDeleteBackward(event)) {
12728
- if (startBlock && isStart) {
12729
- return IndentEditor.cancelTextIntent(editor, event, block, kinds);
12730
- }
12731
- }
12732
- return false;
12733
- };
12734
-
12735
- var withIndent = function (kinds) { return function (editor) {
12736
- var onKeydown = editor.onKeydown;
12737
- editor.onKeydown = function (event) {
12738
- var isContinue = !onKeydownTextIndent(editor, event, kinds);
12739
- if (isContinue) {
12740
- onKeydown(event);
12741
- }
12742
- };
12743
- return editor;
12744
- }; };
12745
-
12746
12827
  var internalPlugins = [
12747
12828
  withTheHistory,
12748
12829
  withAutoInsertData(),
@@ -13417,7 +13498,11 @@
13417
13498
  TheQuickInsertComponent.prototype.handleClick = function (event) {
13418
13499
  event.stopPropagation();
13419
13500
  event.preventDefault();
13420
- QuickInsertEditor.openQuickToolbar(this.editor, this.quickToolbarItems, this.iconElement.nativeElement);
13501
+ if (QuickInsertEditor.isOpenedToolbar(this.editor)) {
13502
+ QuickInsertEditor.closeQuickInsertToolbar(this.editor);
13503
+ return;
13504
+ }
13505
+ QuickInsertEditor.openQuickInsertToolbar(this.editor, this.quickToolbarItems, this.iconElement.nativeElement);
13421
13506
  };
13422
13507
  return TheQuickInsertComponent;
13423
13508
  }());
@@ -13714,12 +13799,14 @@
13714
13799
  };
13715
13800
  TheEditorComponent.prototype.initialize = function () {
13716
13801
  var _this = this;
13717
- var _a, _b, _c;
13802
+ var _a, _b, _c, _d;
13718
13803
  this.editor = withTheEditor(this.thePlugins, slateHistory.withHistory(i1.withAngular(slate.createEditor(), CLIPBOARD_FORMAT_KEY)));
13719
13804
  this.generateDecorate();
13720
13805
  this.editor.disabled = (_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled;
13721
13806
  this.editor.extraElementOptions = (_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.extraElementOptions;
13722
13807
  this.editor.extraAutoFormatRules = (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.extraAutoFormatRules;
13808
+ this.editor.extraIndentOptions = (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.extraIndentOptions;
13809
+ this.editor.options = this.theOptions;
13723
13810
  setEditorUUID(this.editor, idCreator());
13724
13811
  this.theContextService.initialize({
13725
13812
  theOptions: this.theOptions,
@@ -14144,7 +14231,7 @@
14144
14231
  i3$1.ThyNavModule,
14145
14232
  i2$2.ThyFormModule,
14146
14233
  i5$2.ThySharedModule,
14147
- i2$3.ThyListModule,
14234
+ i1$7.ThyListModule,
14148
14235
  i5.ThyTooltipModule,
14149
14236
  i6.ThyProgressModule,
14150
14237
  autocomplete.ThyAutocompleteModule,
@@ -14245,7 +14332,7 @@
14245
14332
  i3$1.ThyNavModule,
14246
14333
  i2$2.ThyFormModule,
14247
14334
  i5$2.ThySharedModule,
14248
- i2$3.ThyListModule,
14335
+ i1$7.ThyListModule,
14249
14336
  i5.ThyTooltipModule,
14250
14337
  i6.ThyProgressModule,
14251
14338
  autocomplete.ThyAutocompleteModule,
@@ -14372,6 +14459,7 @@
14372
14459
  exports.htmlToTheia = htmlToTheia;
14373
14460
  exports.inValidTypes = inValidTypes;
14374
14461
  exports.isCleanEmptyParagraph = isCleanEmptyParagraph;
14462
+ exports.isPureEmptyParagraph = isPureEmptyParagraph;
14375
14463
  exports.mergeElementOptions = mergeElementOptions;
14376
14464
  exports.plainToTheia = plainToTheia;
14377
14465
  exports.toolbarCompose = toolbarCompose;