@worktile/theia 1.2.9 → 1.2.13

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 (92) hide show
  1. package/bundles/worktile-theia.umd.js +886 -225
  2. package/bundles/worktile-theia.umd.js.map +1 -1
  3. package/components/column-resize/column-resize.directive.d.ts +3 -3
  4. package/components/inline-toolbar/inline-toolbar.component.d.ts +26 -0
  5. package/components/inline-toolbar/inline-toolbar.component.scss +19 -0
  6. package/components/nav-split-line/nav-split-line.component.d.ts +6 -1
  7. package/components/toolbar/toolbar.component.d.ts +2 -1
  8. package/components/toolbar-dropdown/toolbar-dropdown.component.scss +3 -0
  9. package/components/toolbar-item/toolbar-item.component.d.ts +14 -5
  10. package/constants/node-types.d.ts +0 -1
  11. package/constants/toolbar.d.ts +6 -2
  12. package/custom-types.d.ts +3 -0
  13. package/editor.component.d.ts +8 -4
  14. package/editor.module.d.ts +59 -52
  15. package/esm2015/components/color-select/color-select.component.js +3 -2
  16. package/esm2015/components/column-resize/column-resize.directive.js +1 -1
  17. package/esm2015/components/inline-toolbar/inline-toolbar.component.js +139 -0
  18. package/esm2015/components/nav-split-line/nav-split-line.component.js +26 -5
  19. package/esm2015/components/toolbar/toolbar.component.js +7 -6
  20. package/esm2015/components/toolbar-base-item/toolbar-base-item.component.js +3 -2
  21. package/esm2015/components/toolbar-group/toolbar-group.component.js +1 -1
  22. package/esm2015/components/toolbar-item/toolbar-item.component.js +70 -24
  23. package/esm2015/constants/node-types.js +1 -2
  24. package/esm2015/constants/toolbar.js +37 -5
  25. package/esm2015/custom-types.js +1 -1
  26. package/esm2015/editor.component.js +40 -23
  27. package/esm2015/editor.module.js +15 -6
  28. package/esm2015/interfaces/toolbar.js +1 -1
  29. package/esm2015/plugins/deserializers/deserialize-html.plugin.js +12 -3
  30. package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -2
  31. package/esm2015/plugins/image/image.plugin.js +1 -2
  32. package/esm2015/plugins/index.js +8 -4
  33. package/esm2015/plugins/link/link.plugin.js +7 -2
  34. package/esm2015/plugins/list/list.plugin.js +7 -7
  35. package/esm2015/plugins/list/queries/get-start-list-item.js +9 -2
  36. package/esm2015/plugins/list/queries/is-selection-in-same-list-item.js +17 -0
  37. package/esm2015/plugins/paint-format/options.js +54 -0
  38. package/esm2015/plugins/paint-format/paint-format.editor.js +67 -0
  39. package/esm2015/plugins/placeholder/placeholder.component.js +79 -0
  40. package/esm2015/plugins/public-api.js +2 -1
  41. package/esm2015/plugins/quick-insert/components/quick-insert.component.js +77 -0
  42. package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +75 -0
  43. package/esm2015/plugins/quick-insert/quick-insert.editor.js +61 -0
  44. package/esm2015/plugins/quick-insert/quick-insert.plugint.js +38 -0
  45. package/esm2015/plugins/table/components/row/row.component.js +3 -1
  46. package/esm2015/plugins/table/components/table.component.js +6 -3
  47. package/esm2015/plugins/table/components/td/td.component.js +2 -1
  48. package/esm2015/plugins/table/components/toolbar/table-toolbar.component.js +1 -1
  49. package/esm2015/plugins/table/table.plugin.js +34 -55
  50. package/esm2015/plugins/table/table.types.js +1 -1
  51. package/esm2015/plugins/table/utils/normalize-table.js +31 -0
  52. package/esm2015/public-api.js +2 -1
  53. package/esm2015/queries/is-container-type.js +2 -2
  54. package/esm2015/services/context.service.js +10 -2
  55. package/esm2015/services/toolbar.service.js +5 -5
  56. package/esm2015/transforms/index.js +2 -3
  57. package/esm2015/utils/auto-focus.js +3 -3
  58. package/esm2015/utils/fragment.js +24 -2
  59. package/esm2015/utils/is-clean-empty-paragraph.js +32 -0
  60. package/esm2015/utils/weak-maps.js +2 -1
  61. package/fesm2015/worktile-theia.js +865 -223
  62. package/fesm2015/worktile-theia.js.map +1 -1
  63. package/interfaces/toolbar.d.ts +3 -2
  64. package/package.json +1 -1
  65. package/plugins/list/queries/get-start-list-item.d.ts +8 -2
  66. package/plugins/list/queries/is-selection-in-same-list-item.d.ts +5 -0
  67. package/plugins/paint-format/options.d.ts +2 -0
  68. package/plugins/paint-format/paint-format.editor.d.ts +7 -0
  69. package/{components → plugins}/placeholder/placeholder.component.d.ts +6 -6
  70. package/{components → plugins}/placeholder/placeholder.component.scss +0 -0
  71. package/plugins/public-api.d.ts +1 -0
  72. package/plugins/quick-insert/components/quick-insert.component.d.ts +25 -0
  73. package/plugins/quick-insert/components/quick-insert.component.scss +21 -0
  74. package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.d.ts +29 -0
  75. package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.scss +21 -0
  76. package/plugins/quick-insert/quick-insert.editor.d.ts +8 -0
  77. package/plugins/quick-insert/quick-insert.plugint.d.ts +2 -0
  78. package/plugins/table/components/table.component.d.ts +1 -0
  79. package/plugins/table/table.types.d.ts +7 -0
  80. package/plugins/table/utils/normalize-table.d.ts +2 -0
  81. package/public-api.d.ts +1 -0
  82. package/services/context.service.d.ts +2 -0
  83. package/services/toolbar.service.d.ts +1 -1
  84. package/styles/editor.scss +33 -11
  85. package/styles/index.scss +5 -2
  86. package/transforms/index.d.ts +1 -2
  87. package/utils/fragment.d.ts +5 -0
  88. package/utils/is-clean-empty-paragraph.d.ts +8 -0
  89. package/utils/weak-maps.d.ts +1 -0
  90. package/esm2015/components/placeholder/placeholder.component.js +0 -88
  91. package/esm2015/transforms/insert-elements.js +0 -22
  92. package/transforms/insert-elements.d.ts +0 -2
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
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('lodash'), require('marked'), require('@atinc/selene'), require('ngx-tethys/popover'), require('@angular/cdk/overlay'), require('ngx-tethys/alert'), require('rxjs/operators'), require('ngx-tethys/uploader'), require('@angular/platform-browser'), require('rxjs'), require('ngx-tethys/progress'), require('ngx-tethys/icon'), require('ngx-tethys/input'), require('ngx-tethys/nav'), require('ngx-tethys/tooltip'), require('ng-codemirror'), require('ngx-tethys/notify'), require('ngx-tethys/action-menu'), 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/autocomplete'), require('ngx-tethys/avatar'), require('ngx-tethys/list'), require('ngx-tethys/select')) :
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', 'lodash', 'marked', '@atinc/selene', 'ngx-tethys/popover', '@angular/cdk/overlay', 'ngx-tethys/alert', 'rxjs/operators', 'ngx-tethys/uploader', '@angular/platform-browser', 'rxjs', 'ngx-tethys/progress', 'ngx-tethys/icon', 'ngx-tethys/input', 'ngx-tethys/nav', 'ngx-tethys/tooltip', 'ng-codemirror', 'ngx-tethys/notify', 'ngx-tethys/action-menu', 'is-url', 'ngx-tethys/button', 'ngx-tethys/form', 'ngx-tethys/shared', 'ngx-tethys', '@angular/cdk/coercion', '@angular/cdk/portal', 'ngx-tethys/autocomplete', 'ngx-tethys/avatar', 'ngx-tethys/list', '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._lodash, global.marked, global.selene, global.i1$2, global.ng.cdk.overlay, global.i1$1, global.rxjs.operators, global.uploader, global.ng.platformBrowser, global.rxjs, global.i4, global.i4$1, global.i5, global.i2$1, global.i7, global.i5$2, global.i1$4, global.i5$1, global.isUrl, global.i1$5, global.i2$2, global.i5$3, global.i1$6, global.ng.cdk.coercion, global.ng.cdk.portal, global.autocomplete, global.avatar, global.list, global.select));
5
- })(this, (function (exports, i0, i6, i4$2, i1, core, isHotkey, slate, slateHistory, _lodash, marked, selene, i1$2, i2, i1$1, operators, uploader, i1$3, rxjs, i4, i4$1, i5, i2$1, i7, i5$2, i1$4, i5$1, isUrl, i1$5, i2$2, i5$3, i1$6, coercion, portal, autocomplete, avatar, list, select) { 'use strict';
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('lodash'), require('marked'), require('@atinc/selene'), require('ngx-tethys/popover'), require('@angular/cdk/overlay'), require('ngx-tethys/alert'), require('rxjs/operators'), require('ngx-tethys/uploader'), require('@angular/platform-browser'), require('rxjs'), require('ngx-tethys/progress'), require('ngx-tethys/icon'), require('ngx-tethys/input'), require('ngx-tethys/nav'), require('ngx-tethys/tooltip'), require('ng-codemirror'), require('ngx-tethys/notify'), require('ngx-tethys/action-menu'), 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
+ 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', 'lodash', 'marked', '@atinc/selene', 'ngx-tethys/popover', '@angular/cdk/overlay', 'ngx-tethys/alert', 'rxjs/operators', 'ngx-tethys/uploader', '@angular/platform-browser', 'rxjs', 'ngx-tethys/progress', 'ngx-tethys/icon', 'ngx-tethys/input', 'ngx-tethys/nav', 'ngx-tethys/tooltip', 'ng-codemirror', 'ngx-tethys/notify', 'ngx-tethys/action-menu', '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._lodash, global.marked, global.selene, global.i1$2, global.ng.cdk.overlay, global.i1$1, global.rxjs.operators, global.uploader, global.ng.platformBrowser, global.rxjs, global.i4, global.i4$1, global.i5, global.i2$1, global.i7, global.i5$2, global.i1$4, global.i5$1, global.isUrl, global.i1$5, global.i2$2, global.i5$3, 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, i6, i4$2, i1, core, isHotkey, slate, slateHistory, _lodash, marked, selene, i1$2, i2, i1$1, operators, uploader, i1$3, rxjs, i4, i4$1, i5, i2$1, i7, i5$2, i1$4, i5$1, isUrl, i1$5, i2$2, i5$3, i1$6, coercion, portal, i2$3, 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
 
@@ -48,6 +48,7 @@
48
48
  var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
49
49
  var i5__namespace$3 = /*#__PURE__*/_interopNamespace(i5$3);
50
50
  var i1__namespace$6 = /*#__PURE__*/_interopNamespace(i1$6);
51
+ var i2__namespace$3 = /*#__PURE__*/_interopNamespace(i2$3);
51
52
 
52
53
  /*! *****************************************************************************
53
54
  Copyright (c) Microsoft Corporation.
@@ -433,7 +434,6 @@
433
434
  exports.ToolbarActionTypes = void 0;
434
435
  (function (ToolbarActionTypes) {
435
436
  ToolbarActionTypes["split"] = "split";
436
- ToolbarActionTypes["save"] = "save";
437
437
  ToolbarActionTypes["undo"] = "undo";
438
438
  ToolbarActionTypes["redo"] = "redo";
439
439
  ToolbarActionTypes["paintformat"] = "paintformat";
@@ -475,12 +475,17 @@
475
475
  var BLOCK_DELETEBACKWARD_TYPES = [exports.ElementKinds.tableCell];
476
476
 
477
477
  var TheToolbarGroupToken = new i0.InjectionToken('the-toolbar-group-token');
478
- var BLOCK_TOOLBAR_HOTKEY = '/';
478
+ var QUICK_TOOLBAR_HOTKEY = '/';
479
479
  exports.DropdownMode = void 0;
480
480
  (function (DropdownMode) {
481
481
  DropdownMode["icon"] = "icon-mode";
482
482
  DropdownMode["text"] = "text-mode";
483
483
  })(exports.DropdownMode || (exports.DropdownMode = {}));
484
+ exports.ToolbarItemMode = void 0;
485
+ (function (ToolbarItemMode) {
486
+ ToolbarItemMode[ToolbarItemMode["horizontal"] = 0] = "horizontal";
487
+ ToolbarItemMode[ToolbarItemMode["vertical"] = 1] = "vertical";
488
+ })(exports.ToolbarItemMode || (exports.ToolbarItemMode = {}));
484
489
  var DefaultGlobalToolbarDefinition = [
485
490
  exports.ElementKinds.headingList,
486
491
  exports.ToolbarActionTypes.split,
@@ -505,8 +510,34 @@
505
510
  exports.ElementKinds.blockquote,
506
511
  exports.ElementKinds.code
507
512
  ];
508
- var DefaultInlineToolbarDefinition = [];
509
- var DefaultBlockToolbarDefinition = [exports.ElementKinds.image];
513
+ var DefaultInlineToolbarDefinition = [
514
+ exports.ToolbarActionTypes.clean,
515
+ exports.ToolbarActionTypes.split,
516
+ exports.MarkTypes.bold,
517
+ exports.MarkTypes.italic,
518
+ exports.MarkTypes.underline,
519
+ exports.MarkTypes.strike,
520
+ exports.MarkTypes.codeLine,
521
+ exports.MarkTypes.color,
522
+ exports.MarkTypes.backgroundColor,
523
+ exports.ToolbarActionTypes.split,
524
+ exports.ToolbarActionTypes.alignType,
525
+ exports.ToolbarActionTypes.split,
526
+ exports.ElementKinds.link
527
+ ];
528
+ var DefaultQuickToolbarDefinition = __spreadArray(__spreadArray([], __read(STANDARD_HEADING_TYPES)), [
529
+ exports.ToolbarActionTypes.split,
530
+ exports.ElementKinds.numberedList,
531
+ exports.ElementKinds.bulletedList,
532
+ exports.ElementKinds.checkItem,
533
+ exports.ToolbarActionTypes.split,
534
+ exports.ElementKinds.link,
535
+ exports.ElementKinds.image,
536
+ exports.ElementKinds.table,
537
+ exports.ElementKinds.blockquote,
538
+ exports.ElementKinds.hr,
539
+ exports.ElementKinds.code
540
+ ]);
510
541
  var ToolbarMoreGroup = {
511
542
  key: 'more',
512
543
  icon: 'more'
@@ -1390,6 +1421,9 @@
1390
1421
  if (fragment) {
1391
1422
  var decoded = decodeURIComponent(window.atob(fragment));
1392
1423
  var nodes = JSON.parse(decoded);
1424
+ if (!Array.isArray(nodes)) {
1425
+ nodes = [nodes];
1426
+ }
1393
1427
  // delete key to avoid duplicate keys
1394
1428
  if (deleteKey) {
1395
1429
  deleteElementKey(nodes, deleteKey);
@@ -1409,6 +1443,25 @@
1409
1443
  });
1410
1444
  return nodes;
1411
1445
  }
1446
+ /**
1447
+ * 删除 text 节点的 颜色/背景色
1448
+ * @param node
1449
+ */
1450
+ function deleteColorAndBackgroundColorOfText(node) {
1451
+ node.children.forEach(function (child) {
1452
+ if (slate.Text.isText(child)) {
1453
+ if (child['color']) {
1454
+ delete child['color'];
1455
+ }
1456
+ if (child['background-color']) {
1457
+ delete child['background-color'];
1458
+ }
1459
+ }
1460
+ else {
1461
+ deleteColorAndBackgroundColorOfText(child);
1462
+ }
1463
+ });
1464
+ }
1412
1465
 
1413
1466
  var isAcrossBlocks = function (editor, fragment) {
1414
1467
  var startBlock = getStartBlock(editor, fragment[0]);
@@ -1538,7 +1591,7 @@
1538
1591
  return marks;
1539
1592
  };
1540
1593
 
1541
- var isContainer = function (editor, value) { return slate.Element.isElement(value) && editor.isContainer(value); };
1594
+ var isContainer = function (editor, value) { return slate.Element.isElement(value) && editor.isContainer && editor.isContainer(value); };
1542
1595
 
1543
1596
  var getContainerBlocks = function (editor) {
1544
1597
  var containerNode = slate.Editor.above(editor, {
@@ -1814,28 +1867,9 @@
1814
1867
  i1.AngularEditor.focus(editor);
1815
1868
  };
1816
1869
 
1817
- var insertTheElements = function (editor, nodes) {
1818
- if (slate.Range.isExpanded(editor.selection)) {
1819
- slate.Editor.deleteFragment(editor);
1820
- }
1821
- var isEmptyParagraph$1 = isEmptyParagraph(editor, editor.selection.anchor);
1822
- var parentPath = slate.Path.parent(editor.selection.anchor.path);
1823
- slate.Editor.withoutNormalizing(editor, function () {
1824
- slate.Transforms.insertNodes(editor, nodes);
1825
- if (parentPath.length && isEmptyParagraph$1) {
1826
- slate.Transforms.delete(editor, { at: parentPath });
1827
- var lastPath = parentPath.pop();
1828
- slate.Transforms.select(editor, slate.Editor.end(editor, __spreadArray(__spreadArray([], __read(parentPath)), [lastPath + nodes.length - 1])));
1829
- }
1830
- else {
1831
- var lastPath = parentPath.pop();
1832
- slate.Transforms.select(editor, slate.Editor.end(editor, __spreadArray(__spreadArray([], __read(parentPath)), [lastPath + nodes.length])));
1833
- }
1834
- });
1835
- };
1836
-
1837
1870
  var THE_EDITOR_UUID = new WeakMap();
1838
1871
  var THE_EDITOR_CONVERSION_HINT_REF = new WeakMap();
1872
+ var THE_EDITOR_QUICK_TOOLBAR_REF = new WeakMap();
1839
1873
 
1840
1874
  var closeConversionHint = function (editor) {
1841
1875
  var hintRef = THE_EDITOR_CONVERSION_HINT_REF.get(editor);
@@ -1897,7 +1931,6 @@
1897
1931
  splitNode: splitNode,
1898
1932
  deleteElement: deleteElement,
1899
1933
  setEndSelection: setEndSelection,
1900
- insertTheElements: insertTheElements,
1901
1934
  closeConversionHint: closeConversionHint,
1902
1935
  handleContinualDeleteBackward: handleContinualDeleteBackward,
1903
1936
  handleContinualInsertBreak: handleContinualInsertBreak
@@ -2380,7 +2413,7 @@
2380
2413
  editor.undo();
2381
2414
  setTimeout(function () {
2382
2415
  slate.Transforms.select(editor, oldRange);
2383
- insertTheElements(editor, fragment_1);
2416
+ slate.Transforms.insertFragment(editor, fragment_1);
2384
2417
  i1.AngularEditor.focus(editor);
2385
2418
  });
2386
2419
  return;
@@ -2622,10 +2655,18 @@
2622
2655
  };
2623
2656
  TheContextService.prototype.getOptions = function () {
2624
2657
  if (!this.options.width) {
2625
- this.options.width = this.options.nativeElement.querySelector('.slate-editable-container').offsetWidth - 30;
2658
+ var firstElementChild = this.getFirstElementChild();
2659
+ this.options.width = firstElementChild.offsetWidth;
2626
2660
  }
2627
2661
  return this.options;
2628
2662
  };
2663
+ TheContextService.prototype.getEditableElement = function () {
2664
+ return this.options.nativeElement.querySelector('.the-editor-typo');
2665
+ };
2666
+ TheContextService.prototype.getFirstElementChild = function () {
2667
+ var editableElement = this.getEditableElement();
2668
+ return editableElement === null || editableElement === void 0 ? void 0 : editableElement.firstElementChild;
2669
+ };
2629
2670
  TheContextService.prototype.setUploadFileList = function (file) {
2630
2671
  this.fileList.push(file);
2631
2672
  };
@@ -2923,7 +2964,6 @@
2923
2964
  };
2924
2965
  editor.insertData = function (data) {
2925
2966
  var e_1, _a;
2926
- // TODO:: 底层有点问题,粘贴多张图片时只能识别一张
2927
2967
  if (data.files.length) {
2928
2968
  var imageFiles = [];
2929
2969
  try {
@@ -3063,13 +3103,19 @@
3063
3103
  return [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList];
3064
3104
  };
3065
3105
 
3106
+ /**
3107
+ * 获取 List 中 ListItems,过滤掉空列表嵌套
3108
+ * @param node
3109
+ * @param initialValue
3110
+ * @returns
3111
+ */
3066
3112
  var getStartListItem = function (node, initialValue) {
3067
3113
  if (!initialValue) {
3068
3114
  initialValue = [];
3069
3115
  }
3070
3116
  if (node) {
3071
3117
  return node.reduce(function (result, current) {
3072
- if (current.type == exports.ElementKinds.listItem && current.children[0].type === exports.ElementKinds.default) {
3118
+ if ((current.type === exports.ElementKinds.listItem && !getListTypes().includes(current.children[0].type))) {
3073
3119
  result.push(current);
3074
3120
  }
3075
3121
  else {
@@ -3759,6 +3805,20 @@
3759
3805
  }]
3760
3806
  }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; } });
3761
3807
 
3808
+ /**
3809
+ * Is the selection in same li
3810
+ */
3811
+ var isSelectionInSameListItem = function (editor) {
3812
+ var selection = editor.selection;
3813
+ if (!selection) {
3814
+ return false;
3815
+ }
3816
+ var _a = __read(slate.Range.edges(selection), 2), start = _a[0], end = _a[1];
3817
+ var startListItemEntry = getAboveByType(editor, exports.ElementKinds.listItem, { at: start.path });
3818
+ var endListItemEntry = getAboveByType(editor, exports.ElementKinds.listItem, { at: end.path });
3819
+ return startListItemEntry && endListItemEntry && slate.Path.equals(startListItemEntry[1], endListItemEntry[1]);
3820
+ };
3821
+
3762
3822
  var withList = function (_a) {
3763
3823
  var _b = _a === void 0 ? {} : _a, validLiChildrenTypes = _b.validLiChildrenTypes;
3764
3824
  return function (editor) {
@@ -3843,15 +3903,14 @@
3843
3903
  var fragmentElement = fragmentData[0];
3844
3904
  if (getListTypes().includes(fragmentElement.type)) {
3845
3905
  var startNodes = getStartListItem([fragmentElement.children[0]]);
3846
- // 复制列表中的图片时startNodes长度为零
3847
- if (startNodes.length === 0) {
3848
- setFragmentData(unit);
3849
- return;
3850
- }
3851
3906
  var children = startNodes.concat(fragmentElement.children.slice(1));
3852
3907
  var fragmentNodes = [
3853
3908
  Object.assign(Object.assign({}, fragmentElement), { children: children })
3854
3909
  ];
3910
+ if (isSelectionInSameListItem(editor)) {
3911
+ // 仅仅复制列表中的内容
3912
+ fragmentNodes = children[0].children;
3913
+ }
3855
3914
  var fragment = fragmentNodes.concat(fragmentData.slice(1));
3856
3915
  var domRange = i1.AngularEditor.toDOMRange(editor, selection);
3857
3916
  var contents = domRange.cloneContents();
@@ -6199,6 +6258,7 @@
6199
6258
  }
6200
6259
  };
6201
6260
  TheColorSelectComponent.prototype._selectColor = function (event, color) {
6261
+ event.preventDefault();
6202
6262
  event.stopPropagation();
6203
6263
  if (this.option.specialColor && color === this.option.specialColor) {
6204
6264
  color = '';
@@ -6230,7 +6290,7 @@
6230
6290
  return TheColorSelectComponent;
6231
6291
  }());
6232
6292
  TheColorSelectComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheColorSelectComponent, deps: [{ token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
6233
- TheColorSelectComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheColorSelectComponent, selector: "the-color-select", inputs: { selectedColor: "selectedColor", selectAction: "selectAction", showCustom: "showCustom", colors: "colors", option: "option" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)", "keydown": "handleKeydown($event)" } }, ngImport: i0__namespace, template: "<div class=\"color-container\">\n <div class=\"colors\">\n <div *ngFor=\"let row of selectColors; let rowIndex = index\">\n <span\n class=\"color-item\"\n *ngFor=\"let _color of row.rowValue; let i = index\"\n [ngClass]=\"_color.classMaps\"\n (mousedown)=\"_selectColor($event, _color.value)\"\n >\n <span [ngStyle]=\"{ background: _color.value }\">\n <thy-icon\n thyIconName=\"check\"\n [ngStyle]=\"{ color: row.tickColor }\"\n ></thy-icon>\n </span>\n </span>\n </div>\n </div>\n <div\n *ngIf=\"option.showCustom\"\n class=\"select-color\"\n >\n <span\n class=\"color\"\n [ngStyle]=\"{ background: selectedColor }\"\n ></span>\n #\n <input\n thyInput\n maxlength=\"6\"\n (keydown.enter)=\"customInputColorEnter($event)\"\n onkeyup=\"value=value.replace(/[^0-9A-Fa-f]/g,'')\"\n class=\"value\"\n [(ngModel)]=\"customColor\"\n (ngModelChange)=\"colorChange(false)\"\n />\n </div>\n</div>\n", components: [{ type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace.ThyInputDirective, selector: "[thyInput]", inputs: ["thySize", "thyAutocomplete"] }, { type: i4__namespace$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
6293
+ TheColorSelectComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheColorSelectComponent, selector: "the-color-select", inputs: { selectedColor: "selectedColor", selectAction: "selectAction", showCustom: "showCustom", colors: "colors", option: "option" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)", "keydown": "handleKeydown($event)" } }, ngImport: i0__namespace, template: "<div class=\"color-container\">\n <div class=\"colors\">\n <div *ngFor=\"let row of selectColors; let rowIndex = index\">\n <span\n class=\"color-item\"\n *ngFor=\"let _color of row.rowValue; let i = index\"\n [ngClass]=\"_color.classMaps\"\n (mousedown)=\"_selectColor($event, _color.value)\"\n >\n <span [ngStyle]=\"{ background: _color.value }\">\n <thy-icon thyIconName=\"check\" [ngStyle]=\"{ color: row.tickColor }\"></thy-icon>\n </span>\n </span>\n </div>\n </div>\n <div *ngIf=\"option.showCustom\" class=\"select-color\">\n <span class=\"color\" [ngStyle]=\"{ background: selectedColor }\"></span>\n #\n <input\n thyInput\n maxlength=\"6\"\n (keydown.enter)=\"customInputColorEnter($event)\"\n onkeyup=\"value=value.replace(/[^0-9A-Fa-f]/g,'')\"\n class=\"value\"\n [(ngModel)]=\"customColor\"\n (ngModelChange)=\"colorChange(false)\"\n />\n </div>\n</div>\n", components: [{ type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace.ThyInputDirective, selector: "[thyInput]", inputs: ["thySize", "thyAutocomplete"] }, { type: i4__namespace$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
6234
6294
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheColorSelectComponent, decorators: [{
6235
6295
  type: i0.Component,
6236
6296
  args: [{
@@ -6353,9 +6413,10 @@
6353
6413
  function TheToolbarBaseItemComponent() {
6354
6414
  }
6355
6415
  TheToolbarBaseItemComponent.prototype.execute = function (event) {
6416
+ var _a;
6356
6417
  event.preventDefault();
6357
6418
  event.stopPropagation();
6358
- if (!this.itemMousedownHandle && !this.editor.selection) {
6419
+ if (!this.itemMousedownHandle && !((_a = this.editor) === null || _a === void 0 ? void 0 : _a.selection)) {
6359
6420
  var lastNode = getLastNode(this.editor, 1);
6360
6421
  var end = slate.Editor.end(this.editor, lastNode[1]);
6361
6422
  slate.Transforms.select(this.editor, end);
@@ -7328,6 +7389,7 @@
7328
7389
  editor.insertText = function (text) {
7329
7390
  if (text && isUrl__default["default"](text)) {
7330
7391
  LinkEditor.wrapLink(editor, text, text);
7392
+ slate.Transforms.move(editor, { distance: 1, unit: "offset" });
7331
7393
  }
7332
7394
  else {
7333
7395
  insertText(text);
@@ -7335,8 +7397,10 @@
7335
7397
  };
7336
7398
  editor.insertData = function (data) {
7337
7399
  var text = data.getData('text/plain');
7338
- if (text && isUrl__default["default"](text)) {
7400
+ var fragment = data.getData("application/" + CLIPBOARD_FORMAT_KEY);
7401
+ if (text && isUrl__default["default"](text) && !fragment) {
7339
7402
  LinkEditor.wrapLink(editor, text, text);
7403
+ slate.Transforms.move(editor, { distance: 1, unit: "offset" });
7340
7404
  }
7341
7405
  else {
7342
7406
  insertData(data);
@@ -8226,19 +8290,46 @@
8226
8290
 
8227
8291
  var NavSplitLineComponent = /** @class */ (function () {
8228
8292
  function NavSplitLineComponent() {
8293
+ this.mode = exports.ToolbarItemMode.vertical;
8294
+ this.theNavSplitLine = true;
8229
8295
  }
8296
+ Object.defineProperty(NavSplitLineComponent.prototype, "horizontal", {
8297
+ get: function () {
8298
+ return this.mode === exports.ToolbarItemMode.horizontal;
8299
+ },
8300
+ enumerable: false,
8301
+ configurable: true
8302
+ });
8303
+ Object.defineProperty(NavSplitLineComponent.prototype, "vertical", {
8304
+ get: function () {
8305
+ return this.mode === exports.ToolbarItemMode.vertical;
8306
+ },
8307
+ enumerable: false,
8308
+ configurable: true
8309
+ });
8230
8310
  NavSplitLineComponent.prototype.ngOnInit = function () { };
8231
8311
  return NavSplitLineComponent;
8232
8312
  }());
8233
8313
  NavSplitLineComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: NavSplitLineComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
8234
- NavSplitLineComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: NavSplitLineComponent, selector: "nav-split-line", ngImport: i0__namespace, template: '', isInline: true });
8314
+ NavSplitLineComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: NavSplitLineComponent, selector: "nav-split-line", inputs: { mode: "mode" }, host: { properties: { "class.the-nav-split-line": "this.theNavSplitLine", "class.horizontal": "this.horizontal", "class.vertical": "this.vertical" } }, ngImport: i0__namespace, template: '', isInline: true });
8235
8315
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: NavSplitLineComponent, decorators: [{
8236
8316
  type: i0.Component,
8237
8317
  args: [{
8238
8318
  selector: 'nav-split-line',
8239
8319
  template: ''
8240
8320
  }]
8241
- }], ctorParameters: function () { return []; } });
8321
+ }], ctorParameters: function () { return []; }, propDecorators: { mode: [{
8322
+ type: i0.Input
8323
+ }], theNavSplitLine: [{
8324
+ type: i0.HostBinding,
8325
+ args: ['class.the-nav-split-line']
8326
+ }], horizontal: [{
8327
+ type: i0.HostBinding,
8328
+ args: ['class.horizontal']
8329
+ }], vertical: [{
8330
+ type: i0.HostBinding,
8331
+ args: ['class.vertical']
8332
+ }] } });
8242
8333
 
8243
8334
  var TheTableToolbarComponent = /** @class */ (function () {
8244
8335
  function TheTableToolbarComponent(ngZone, colorSelectService, popoverRef) {
@@ -8361,7 +8452,7 @@
8361
8452
  return TheTableToolbarComponent;
8362
8453
  }());
8363
8454
  TheTableToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheTableToolbarComponent, deps: [{ token: i0__namespace.NgZone }, { token: TheColorSelectService }, { token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
8364
- TheTableToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isActiveSelect: "isActiveSelect" }, ngImport: i0__namespace, template: "<thy-icon-nav>\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a href=\"javascript:;\" thyIconNavLink *ngIf=\"!item.invisibility\" [thyTooltip]=\"item.name\" (mousedown)=\"item.actionHandle()\">\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n </a>\n </ng-container>\n <nav-split-line *ngIf=\"!isActiveSelect && isShowSplitLine\"></nav-split-line>\n <a href=\"javascript:;\" thyIconNavLink thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <nav-split-line *ngIf=\"deleteIcon\"></nav-split-line>\n <a\n *ngIf=\"deleteIcon\"\n href=\"javascript:;\"\n thyIconNavLink\n [thyTooltip]=\"iconName\"\n class=\"danger\"\n [thyIconNavLinkIcon]=\"deleteIcon\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n</thy-icon-nav>\n", components: [{ type: i2__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: NavSplitLineComponent, selector: "nav-split-line" }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
8455
+ TheTableToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isActiveSelect: "isActiveSelect" }, ngImport: i0__namespace, template: "<thy-icon-nav>\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a href=\"javascript:;\" thyIconNavLink *ngIf=\"!item.invisibility\" [thyTooltip]=\"item.name\" (mousedown)=\"item.actionHandle()\">\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n </a>\n </ng-container>\n <nav-split-line *ngIf=\"!isActiveSelect && isShowSplitLine\"></nav-split-line>\n <a href=\"javascript:;\" thyIconNavLink thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <nav-split-line *ngIf=\"deleteIcon\"></nav-split-line>\n <a\n *ngIf=\"deleteIcon\"\n href=\"javascript:;\"\n thyIconNavLink\n [thyTooltip]=\"iconName\"\n class=\"danger\"\n [thyIconNavLinkIcon]=\"deleteIcon\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n</thy-icon-nav>\n", components: [{ type: i2__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { 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"] }, { type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
8365
8456
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheTableToolbarComponent, decorators: [{
8366
8457
  type: i0.Component,
8367
8458
  args: [{
@@ -9070,9 +9161,12 @@
9070
9161
  TheTableComponent.prototype.useRowControls = function () {
9071
9162
  if (this.selection) {
9072
9163
  this.rowControls = this.calculateRowControls();
9073
- this.cdr.detectChanges();
9164
+ this.cdr.markForCheck();
9074
9165
  }
9075
9166
  };
9167
+ TheTableComponent.prototype.detectChanges = function () {
9168
+ this.cdr.detectChanges();
9169
+ };
9076
9170
  TheTableComponent.prototype.calculateMinRowSpanCellForRows = function () {
9077
9171
  var table = this.element;
9078
9172
  var cells = table.children.map(function (row, index) {
@@ -9341,7 +9435,7 @@
9341
9435
  provide: TheTableToken,
9342
9436
  useExisting: TheTableComponent
9343
9437
  }
9344
- ], 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-table-selection-hide': tableStore.isCellSelecting || tableStore.isRightClicking\n }\"\n>\n <div class=\"the-table-row-controls-wrapper\" *ngIf=\"!readonly\">\n <div>\n <div\n class=\"the-table-corner-controls\"\n [ngClass]=\"{ active: isSelectedAllCell, dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0 }\"\n >\n <button type=\"button\" class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></button>\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 <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 <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>\n <div class=\"the-table-wrapper\" #tableWrapper>\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 (mousedown)=\"onColMouseDown($event, i)\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColCotrols\"\n >\n <the-table-insert-mark\n *ngIf=\"isInTable\"\n type=\"column\"\n [at]=\"i + 1\"\n [tableStore]=\"tableStore\"\n ></the-table-insert-mark>\n <div\n class=\"the-table-col-controls-inner\"\n [ngClass]=\"{\n active: tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n ></div>\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: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
9438
+ ], 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-table-selection-hide': tableStore.isCellSelecting || tableStore.isRightClicking\n }\"\n>\n <div class=\"the-table-row-controls-wrapper\" *ngIf=\"!readonly && isInTable\">\n <div>\n <div\n class=\"the-table-corner-controls\"\n [ngClass]=\"{ active: isSelectedAllCell, dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0 }\"\n >\n <button type=\"button\" class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></button>\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 <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 <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>\n <div class=\"the-table-wrapper\" #tableWrapper>\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 (mousedown)=\"onColMouseDown($event, i)\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColCotrols\"\n >\n <the-table-insert-mark\n *ngIf=\"isInTable\"\n type=\"column\"\n [at]=\"i + 1\"\n [tableStore]=\"tableStore\"\n ></the-table-insert-mark>\n <div\n class=\"the-table-col-controls-inner\"\n [ngClass]=\"{\n active: tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n ></div>\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: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
9345
9439
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheTableComponent, decorators: [{
9346
9440
  type: i0.Component,
9347
9441
  args: [{
@@ -9429,11 +9523,13 @@
9429
9523
  _super.prototype.onContextChange.call(this);
9430
9524
  if (this.initialized) {
9431
9525
  this.useBackground();
9526
+ this.useHeight();
9432
9527
  }
9433
9528
  };
9434
9529
  TheTableRowComponent.prototype.ngOnInit = function () {
9435
9530
  _super.prototype.ngOnInit.call(this);
9436
9531
  this.useBackground();
9532
+ this.useHeight();
9437
9533
  };
9438
9534
  TheTableRowComponent.prototype.useBackground = function () {
9439
9535
  if (this.element.header && !this.backgroundColor) {
@@ -10256,6 +10352,7 @@
10256
10352
  this.applyRowSize(deltaSize);
10257
10353
  }
10258
10354
  this.tableComponent.useRowControls();
10355
+ this.tableComponent.detectChanges();
10259
10356
  this.updateOverlayHandleSizeAndOffset();
10260
10357
  };
10261
10358
  TheTdComponent.prototype._createOverlayForHandle = function () {
@@ -10513,6 +10610,36 @@
10513
10610
  args: ['cellInner', { static: true }]
10514
10611
  }] } });
10515
10612
 
10613
+ var normalizeTable = function (table) {
10614
+ var normalizedNodes = [];
10615
+ var rowHeight = table.children.length;
10616
+ var columnWidth = table.children[0].children.length;
10617
+ table.children.forEach(function (row, rowIndex) {
10618
+ row.children.forEach(function (cell, columnIndex) {
10619
+ // case 1
10620
+ if (cell.colspan || cell.rowspan) {
10621
+ var rowspan = cell.rowspan || 1;
10622
+ var colspan = cell.colspan || 1;
10623
+ if (rowspan > rowHeight - rowIndex) {
10624
+ cell.rowspan = rowHeight - rowIndex;
10625
+ }
10626
+ if (colspan > columnWidth - columnIndex) {
10627
+ cell.colspan = columnWidth - columnIndex;
10628
+ }
10629
+ return;
10630
+ }
10631
+ // case 2
10632
+ if (cell.hidden && !normalizedNodes.includes(cell)) {
10633
+ var origin = calcOriginSpan(table, rowIndex, columnIndex);
10634
+ if (!origin) {
10635
+ delete table.children[rowIndex].children[columnIndex].hidden;
10636
+ }
10637
+ }
10638
+ });
10639
+ });
10640
+ return table;
10641
+ };
10642
+
10516
10643
  var withTable = function (editor) {
10517
10644
  var deleteBackward = editor.deleteBackward, deleteForward = editor.deleteForward, onKeydown = editor.onKeydown, setFragmentData = editor.setFragmentData, insertData = editor.insertData, normalizeNode = editor.normalizeNode, isBlockCard = editor.isBlockCard, renderElement = editor.renderElement, deleteCutData = editor.deleteCutData, isContainer = editor.isContainer;
10518
10645
  editor.deleteBackward = function (unit) {
@@ -10691,49 +10818,26 @@
10691
10818
  return;
10692
10819
  }
10693
10820
  var selection = editor.selection;
10694
- var element = TablePosition.create(opts, editor, selection.anchor.path);
10695
- var tableComponent = i1.ELEMENT_TO_COMPONENT.get(element.table);
10821
+ var tablePosition = TablePosition.create(opts, editor, selection.anchor.path);
10822
+ var tableComponent = i1.ELEMENT_TO_COMPONENT.get(tablePosition.table);
10696
10823
  var cells = tableComponent.tableStore.selectedCells;
10697
- var tableContent = {};
10698
- var contents;
10699
- var cellNode;
10700
- var fragment;
10701
- if (cells.length > 0) {
10702
- var selectNodes = getSelectCellNode(editor, cells);
10703
- var selectedColumnsIndex = tableComponent.tableStore.selectedColumnsIndex || [];
10704
- var selectedRowsIndex = tableComponent.tableStore.selectedRowsIndex || [];
10705
- var _loop_1 = function (cell) {
10706
- var row = cell.row, col = cell.col;
10707
- var cellPath = __spreadArray(__spreadArray([], __read(element.tableEntry[1])), [row, col]);
10708
- cellNode = slate.Node.get(editor, cellPath);
10709
- var cellRange = slate.Editor.range(editor, cellPath);
10710
- var domRange = i1.AngularEditor.toDOMRange(editor, cellRange);
10711
- if (!contents) {
10712
- contents = domRange.cloneContents();
10713
- }
10714
- else {
10715
- contents.append(domRange.cloneContents());
10716
- }
10717
- if ((selectedColumnsIndex.length === 1 && cellNode.colspan > 1) ||
10718
- (selectedRowsIndex.length === 1 && cellNode.rowspan > 1)) {
10719
- cellNode = Object.assign(Object.assign({}, cellNode), { colspan: selectedColumnsIndex.length === 1 ? null : cellNode.colspan, rowspan: selectedRowsIndex.length === 1 ? null : cellNode.rowspan });
10720
- }
10721
- if (cellNode.hidden) {
10722
- var origin_1 = calcOriginSpan(element.table, row, col);
10723
- var selectedOrigin = origin_1 && selectNodes.filter(function (item) { return item.node.key === origin_1.key; });
10724
- if (!selectedOrigin || !selectedOrigin.length) {
10725
- cellNode = Object.assign(Object.assign({}, cellNode), { hidden: null });
10726
- }
10727
- }
10728
- if (!tableContent[row]) {
10729
- tableContent[row] = [];
10730
- }
10731
- tableContent[row].push(cellNode);
10732
- };
10824
+ var tableFragment = null;
10825
+ if (tableComponent.tableStore.selectedRowsIndex.length > 0) {
10826
+ var rows = tablePosition.table.children.slice(tableComponent.tableStore.selectedRowsIndex[0], tableComponent.tableStore.selectedRowsIndex[tableComponent.tableStore.selectedRowsIndex.length - 1] + 1);
10827
+ tableFragment = Object.assign(Object.assign({}, tablePosition.table), { children: rows });
10828
+ }
10829
+ else if (cells.length > 0) {
10830
+ var tempRows = {};
10733
10831
  try {
10734
10832
  for (var cells_1 = __values(cells), cells_1_1 = cells_1.next(); !cells_1_1.done; cells_1_1 = cells_1.next()) {
10735
10833
  var cell = cells_1_1.value;
10736
- _loop_1(cell);
10834
+ var row = cell.row, col = cell.col;
10835
+ var cellPath = __spreadArray(__spreadArray([], __read(tablePosition.tableEntry[1])), [row, col]);
10836
+ var cellNode = slate.Node.get(editor, cellPath);
10837
+ if (!tempRows[row]) {
10838
+ tempRows[row] = [];
10839
+ }
10840
+ tempRows[row].push(cellNode);
10737
10841
  }
10738
10842
  }
10739
10843
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -10743,28 +10847,26 @@
10743
10847
  }
10744
10848
  finally { if (e_1) throw e_1.error; }
10745
10849
  }
10746
- var tableFragment = [
10850
+ var rows = Object.values(tempRows).map(function (item) {
10851
+ return {
10852
+ type: exports.ElementKinds.tableRow,
10853
+ children: item
10854
+ };
10855
+ });
10856
+ tableFragment =
10747
10857
  {
10748
10858
  type: exports.ElementKinds.table,
10749
- children: Object.values(tableContent).map(function (item) {
10750
- return {
10751
- type: exports.ElementKinds.tableRow,
10752
- children: item
10753
- };
10754
- })
10755
- }
10756
- ];
10757
- fragment = tableFragment;
10758
- var stringObj = JSON.stringify(fragment);
10859
+ children: rows
10860
+ };
10861
+ }
10862
+ if (tableFragment) {
10863
+ tableFragment = normalizeTable(_.cloneDeep(tableFragment));
10864
+ tableFragment = [tableFragment];
10865
+ var stringObj = JSON.stringify(tableFragment);
10759
10866
  var encoded = window.btoa(encodeURIComponent(stringObj));
10760
10867
  unit.setData("application/" + CLIPBOARD_FORMAT_KEY, encoded);
10761
- var div = document.createElement('div');
10762
- div.appendChild(contents);
10763
- div.setAttribute('hidden', 'true');
10764
- document.body.appendChild(div);
10765
- unit.setData('text/html', div.innerHTML);
10766
- unit.setData('text/plain', i1.getPlainText(div));
10767
- document.body.removeChild(div);
10868
+ // unit.setData('text/html', div.innerHTML);
10869
+ unit.setData('text/plain', slate.Node.string(tableFragment));
10768
10870
  return;
10769
10871
  }
10770
10872
  setFragmentData(unit);
@@ -10927,7 +11029,14 @@
10927
11029
  if (html && !slateFragment) {
10928
11030
  var htmlDom = new DOMParser().parseFromString(html, 'text/html');
10929
11031
  var fragment = selene.TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
10930
- insertTheElements(editor, fragment);
11032
+ // 无法识别HTML内容时后退一下:识别纯文本
11033
+ if (fragment.length === 1 && slate.Editor.isEmpty(editor, fragment[0]) && fragment[0].type === exports.ElementKinds.paragraph) {
11034
+ insertData(data);
11035
+ return;
11036
+ }
11037
+ // 过滤 text 节点的 color/background-color 属性
11038
+ fragment.forEach(function (node) { return deleteColorAndBackgroundColorOfText(node); });
11039
+ slate.Transforms.insertFragment(editor, fragment);
10931
11040
  return;
10932
11041
  }
10933
11042
  insertData(data);
@@ -11085,6 +11194,377 @@
11085
11194
  }
11086
11195
  ];
11087
11196
 
11197
+ var PaintFormatEditor = {
11198
+ formatBrush: function (editor) {
11199
+ var e_1, _a;
11200
+ var contextService = editor.injector.get(TheContextService);
11201
+ var obj = {};
11202
+ try {
11203
+ for (var MarkProps_1 = __values(MarkProps), MarkProps_1_1 = MarkProps_1.next(); !MarkProps_1_1.done; MarkProps_1_1 = MarkProps_1.next()) {
11204
+ var key = MarkProps_1_1.value;
11205
+ var k = contextService.paintFormatStatus.marks[key];
11206
+ obj[key] = k || null;
11207
+ }
11208
+ }
11209
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
11210
+ finally {
11211
+ try {
11212
+ if (MarkProps_1_1 && !MarkProps_1_1.done && (_a = MarkProps_1.return)) _a.call(MarkProps_1);
11213
+ }
11214
+ finally { if (e_1) throw e_1.error; }
11215
+ }
11216
+ var block = anchorBlock(editor);
11217
+ if (block && slate.Range.isCollapsed(editor.selection)) {
11218
+ // TODO:: 在撤销时有bug, 临时使用withoutSaving处理
11219
+ slateHistory.HistoryEditor.withoutSaving(editor, function () {
11220
+ var path = TheEditor.findPath(editor, block);
11221
+ setMarks(editor, obj, path);
11222
+ });
11223
+ }
11224
+ else {
11225
+ setMarks(editor, obj);
11226
+ }
11227
+ PaintFormatEditor.cancelFormatBrushStatus(editor);
11228
+ },
11229
+ isActive: function (editor) {
11230
+ var contextService = editor.injector.get(TheContextService);
11231
+ var res = contextService.paintFormatStatus.isActive;
11232
+ return res;
11233
+ },
11234
+ enableFormatBrush: function (editor) {
11235
+ var contextService = editor.injector.get(TheContextService);
11236
+ if (contextService.paintFormatStatus.isActive) {
11237
+ return PaintFormatEditor.cancelFormatBrushStatus(editor);
11238
+ }
11239
+ contextService.paintFormatStatus = {
11240
+ isActive: true,
11241
+ marks: getSelectionMarks(editor)
11242
+ };
11243
+ var element = i1.EDITOR_TO_ELEMENT.get(editor);
11244
+ element.classList.add('pointer-paint');
11245
+ contextService.onMouseUp$
11246
+ .pipe(operators.skip(1), operators.filter(function (event) { return element.contains(event.target); }), operators.take(1))
11247
+ .subscribe(function (event) {
11248
+ if (contextService.paintFormatStatus.isActive) {
11249
+ PaintFormatEditor.formatBrush(editor);
11250
+ }
11251
+ });
11252
+ editor.onChange();
11253
+ },
11254
+ cancelFormatBrushStatus: function (editor) {
11255
+ var contextService = editor.injector.get(TheContextService);
11256
+ contextService.paintFormatStatus = {
11257
+ isActive: false,
11258
+ marks: {}
11259
+ };
11260
+ var element = i1.EDITOR_TO_ELEMENT.get(editor);
11261
+ element.classList.remove('pointer-paint');
11262
+ editor.onChange();
11263
+ }
11264
+ };
11265
+
11266
+ var PaintFormatOptions = [
11267
+ {
11268
+ key: exports.ToolbarActionTypes.undo,
11269
+ icon: 'undo',
11270
+ name: '撤销',
11271
+ execute: function (editor) { return editor.undo(); }
11272
+ },
11273
+ {
11274
+ key: exports.ToolbarActionTypes.redo,
11275
+ icon: 'redo',
11276
+ name: '重做',
11277
+ execute: function (editor) { return editor.redo(); }
11278
+ },
11279
+ {
11280
+ key: exports.ToolbarActionTypes.paintformat,
11281
+ icon: 'paintformat',
11282
+ name: '格式刷',
11283
+ execute: PaintFormatEditor.enableFormatBrush,
11284
+ active: PaintFormatEditor.isActive
11285
+ },
11286
+ {
11287
+ key: exports.ToolbarActionTypes.clean,
11288
+ icon: 'clean',
11289
+ name: '清除格式',
11290
+ execute: function (editor) {
11291
+ var e_1, _a;
11292
+ var selection = editor.selection;
11293
+ if (!selection) {
11294
+ return;
11295
+ }
11296
+ if (TableEditor.clearMark(editor)) {
11297
+ return;
11298
+ }
11299
+ if (slate.Range.isCollapsed(selection)) {
11300
+ var marks = slate.Editor.marks(editor);
11301
+ try {
11302
+ for (var _b = __values(Object.keys(marks)), _c = _b.next(); !_c.done; _c = _b.next()) {
11303
+ var key = _c.value;
11304
+ slate.Editor.removeMark(editor, key);
11305
+ }
11306
+ }
11307
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
11308
+ finally {
11309
+ try {
11310
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
11311
+ }
11312
+ finally { if (e_1) throw e_1.error; }
11313
+ }
11314
+ }
11315
+ else {
11316
+ var unsetMarks_1 = {};
11317
+ MarkProps.forEach(function (key) {
11318
+ unsetMarks_1[key] = null;
11319
+ });
11320
+ setMarks(editor, unsetMarks_1);
11321
+ }
11322
+ }
11323
+ }
11324
+ ];
11325
+
11326
+ /**
11327
+ * whether the current node is a clean paragraph
11328
+ * @param editor
11329
+ * @param text
11330
+ * @returns boolean
11331
+ */
11332
+ var isCleanEmptyParagraph = function (editor) {
11333
+ var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
11334
+ if (!isCollapsedCursor) {
11335
+ return false;
11336
+ }
11337
+ var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
11338
+ var textIndent = 'textIndent';
11339
+ var align = 'align';
11340
+ var hasTextIndent = block[textIndent];
11341
+ var hasAlign = block[align];
11342
+ if (slate.Node.string(block) === '' &&
11343
+ slate.Element.isElement(block) &&
11344
+ block.type === exports.ElementKinds.paragraph &&
11345
+ block.children.length === 1 &&
11346
+ slate.Text.isText(block.children[0]) &&
11347
+ !slate.Editor.isVoid(editor, block) &&
11348
+ !hasTextIndent &&
11349
+ !hasAlign) {
11350
+ return true;
11351
+ }
11352
+ return false;
11353
+ };
11354
+
11355
+ var TheToolbarItemComponent = /** @class */ (function (_super) {
11356
+ __extends(TheToolbarItemComponent, _super);
11357
+ function TheToolbarItemComponent(ngZone, cfr) {
11358
+ var _this = _super.call(this) || this;
11359
+ _this.ngZone = ngZone;
11360
+ _this.cfr = cfr;
11361
+ _this.itemMode = exports.ToolbarItemMode.horizontal;
11362
+ _this.ToolbarItemMode = exports.ToolbarItemMode;
11363
+ _this.active = false;
11364
+ return _this;
11365
+ }
11366
+ TheToolbarItemComponent.prototype.ngOnInit = function () {
11367
+ var _a, _b;
11368
+ if (((_a = this.item) === null || _a === void 0 ? void 0 : _a.quickItemComponent) && i1.isComponentType((_b = this.item) === null || _b === void 0 ? void 0 : _b.quickItemComponent)) {
11369
+ this.renderToolbarItem();
11370
+ }
11371
+ };
11372
+ TheToolbarItemComponent.prototype.statusChange = function (editor) {
11373
+ var _a, _b;
11374
+ this.active = ((_a = this.item) === null || _a === void 0 ? void 0 : _a.active) ? (_b = this.item) === null || _b === void 0 ? void 0 : _b.active(editor) : false;
11375
+ };
11376
+ TheToolbarItemComponent.prototype.execute = function (event) {
11377
+ var _a, _b, _c;
11378
+ _super.prototype.execute.call(this, event);
11379
+ if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11380
+ return;
11381
+ }
11382
+ (_c = this.item) === null || _c === void 0 ? void 0 : _c.execute(this.editor);
11383
+ };
11384
+ TheToolbarItemComponent.prototype.renderToolbarItem = function () {
11385
+ var _this = this;
11386
+ this.ngZone.run(function () {
11387
+ var toolbarItemFactory = _this.cfr.resolveComponentFactory(_this.item.quickItemComponent);
11388
+ var tollbarItemRef = _this.toolbarContainer.createComponent(toolbarItemFactory);
11389
+ tollbarItemRef.instance.editor = _this.editor;
11390
+ tollbarItemRef.instance.item = _this.item;
11391
+ tollbarItemRef.instance.itemMode = exports.ToolbarItemMode.vertical;
11392
+ });
11393
+ };
11394
+ return TheToolbarItemComponent;
11395
+ }(TheToolbarBaseItemComponent));
11396
+ TheToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, deps: [{ token: i0__namespace.NgZone }, { token: i0__namespace.ComponentFactoryResolver }], target: i0__namespace.ɵɵFactoryTarget.Component });
11397
+ TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor", itemMode: "itemMode" }, host: { classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "\n <ng-container *ngIf=\"itemMode === ToolbarItemMode.horizontal; else selectionItem\">\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n </ng-container>\n <ng-template #selectionItem>\n <ng-container *ngIf=\"!item?.quickItemComponent\">\n <thy-icon [thyIconName]=\"item?.icon\" [thyIconRotate]=\"0\" class=\"quick-toolbar-icon\"></thy-icon>\n <span class=\"quick-toolbar-name\">{{ item?.name }}</span>\n </ng-container>\n </ng-template>\n <ng-container #toolbarContainer></ng-container>\n ", isInline: true, components: [{ type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
11398
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, decorators: [{
11399
+ type: i0.Component,
11400
+ args: [{
11401
+ selector: 'the-toolbar-item',
11402
+ template: "\n <ng-container *ngIf=\"itemMode === ToolbarItemMode.horizontal; else selectionItem\">\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n </ng-container>\n <ng-template #selectionItem>\n <ng-container *ngIf=\"!item?.quickItemComponent\">\n <thy-icon [thyIconName]=\"item?.icon\" [thyIconRotate]=\"0\" class=\"quick-toolbar-icon\"></thy-icon>\n <span class=\"quick-toolbar-name\">{{ item?.name }}</span>\n </ng-container>\n </ng-template>\n <ng-container #toolbarContainer></ng-container>\n ",
11403
+ host: {
11404
+ class: 'the-toolbar-item'
11405
+ }
11406
+ }]
11407
+ }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: i0__namespace.ComponentFactoryResolver }]; }, propDecorators: { item: [{
11408
+ type: i0.Input
11409
+ }], editor: [{
11410
+ type: i0.Input
11411
+ }], itemMode: [{
11412
+ type: i0.Input
11413
+ }], toolbarContainer: [{
11414
+ type: i0.ViewChild,
11415
+ args: ['toolbarContainer', { read: i0.ViewContainerRef, static: true }]
11416
+ }] } });
11417
+
11418
+ var TheQuickToolbarComponent = /** @class */ (function (_super) {
11419
+ __extends(TheQuickToolbarComponent, _super);
11420
+ function TheQuickToolbarComponent(popoverRef, elementRef) {
11421
+ var _this = _super.call(this) || this;
11422
+ _this.popoverRef = popoverRef;
11423
+ _this.elementRef = elementRef;
11424
+ _this.ToolbarItemMode = exports.ToolbarItemMode;
11425
+ _this.ToolbarActionTypes = exports.ToolbarActionTypes;
11426
+ return _this;
11427
+ }
11428
+ TheQuickToolbarComponent.prototype.handleMouseDown = function (event) {
11429
+ if (!this.elementRef.nativeElement.contains(event.target)) {
11430
+ this.popoverRef.close();
11431
+ }
11432
+ else {
11433
+ event.preventDefault();
11434
+ }
11435
+ };
11436
+ TheQuickToolbarComponent.prototype.handleEnter = function () {
11437
+ this.popoverRef.close();
11438
+ };
11439
+ TheQuickToolbarComponent.prototype.ngOnInit = function () {
11440
+ this.editorElement = i1.AngularEditor.toDOMNode(this.editor, this.editor);
11441
+ };
11442
+ TheQuickToolbarComponent.prototype.stopPropagation = function (event) {
11443
+ event.preventDefault();
11444
+ };
11445
+ TheQuickToolbarComponent.prototype.selectionChange = function (event) {
11446
+ this.removeHotKey();
11447
+ var toolbarItem = this.quickToolbarItems.find(function (item) { return item.key === event.value; });
11448
+ if (toolbarItem === null || toolbarItem === void 0 ? void 0 : toolbarItem.execute) {
11449
+ toolbarItem.execute(this.editor);
11450
+ }
11451
+ };
11452
+ TheQuickToolbarComponent.prototype.removeHotKey = function () {
11453
+ var node = slate.Node.get(this.editor, this.editor.selection.anchor.path);
11454
+ if (node && slate.Text.equals({ text: QUICK_TOOLBAR_HOTKEY }, node)) {
11455
+ slate.Editor.deleteBackward(this.editor);
11456
+ }
11457
+ };
11458
+ TheQuickToolbarComponent.prototype.ngOnDestroy = function () {
11459
+ _super.prototype.ngOnDestroy.call(this);
11460
+ };
11461
+ return TheQuickToolbarComponent;
11462
+ }(core.mixinUnsubscribe(core.MixinBase)));
11463
+ TheQuickToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickToolbarComponent, deps: [{ token: i1__namespace$3.ThyPopoverRef }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
11464
+ TheQuickToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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$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$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"] }] });
11465
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickToolbarComponent, decorators: [{
11466
+ type: i0.Component,
11467
+ args: [{
11468
+ selector: 'the-quick-toolbar',
11469
+ templateUrl: 'quick-toolbar.component.html'
11470
+ }]
11471
+ }], ctorParameters: function () { return [{ type: i1__namespace$3.ThyPopoverRef }, { type: i0__namespace.ElementRef }]; }, propDecorators: { editor: [{
11472
+ type: i0.Input
11473
+ }], quickToolbarItems: [{
11474
+ type: i0.Input
11475
+ }], handleMouseDown: [{
11476
+ type: i0.HostListener,
11477
+ args: ['document: mousedown', ['$event']]
11478
+ }], handleEnter: [{
11479
+ type: i0.HostListener,
11480
+ args: ['document: keydown.enter']
11481
+ }] } });
11482
+
11483
+ var OperationTypes = ['insert_text', 'remove_node', 'merge_node'];
11484
+ var QuickInsertEditor = {
11485
+ openQuickToolbar: function (editor, toolbarItems, origin) {
11486
+ var overlay = editor.injector.get(i2.Overlay);
11487
+ var viewContainerRef = editor.injector.get(i0.ViewContainerRef);
11488
+ var thyPopover = editor.injector.get(i1$2.ThyPopover);
11489
+ var quickToolbarRef = thyPopover.open(TheQuickToolbarComponent, {
11490
+ initialState: {
11491
+ editor: editor,
11492
+ quickToolbarItems: toolbarItems
11493
+ },
11494
+ origin: origin,
11495
+ viewContainerRef: viewContainerRef,
11496
+ backdropClosable: true,
11497
+ placement: 'bottomLeft',
11498
+ offset: 4,
11499
+ hasBackdrop: false,
11500
+ insideClosable: true,
11501
+ panelClass: 'the-quick-toolbar-container',
11502
+ scrollStrategy: overlay.scrollStrategies.reposition(),
11503
+ manualClosure: true
11504
+ });
11505
+ THE_EDITOR_QUICK_TOOLBAR_REF.set(editor, quickToolbarRef);
11506
+ },
11507
+ closeQuickToolbar: function (editor) {
11508
+ var quickToolbarRef = THE_EDITOR_QUICK_TOOLBAR_REF.get(editor);
11509
+ if (quickToolbarRef) {
11510
+ quickToolbarRef.close();
11511
+ THE_EDITOR_QUICK_TOOLBAR_REF.set(editor, null);
11512
+ }
11513
+ },
11514
+ isOpenToolbar: function (editor, opTypes) {
11515
+ if (opTypes === void 0) { opTypes = OperationTypes; }
11516
+ var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
11517
+ if (!isCollapsedCursor) {
11518
+ return false;
11519
+ }
11520
+ var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
11521
+ var undos = editor.history.undos;
11522
+ var lastBatch = undos[undos.length - 1];
11523
+ var lastOp = lastBatch && lastBatch[lastBatch.length - 1];
11524
+ if (lastOp &&
11525
+ block.children.length === 1 &&
11526
+ block.type === exports.ElementKinds.paragraph &&
11527
+ slate.Node.string(block) === QUICK_TOOLBAR_HOTKEY &&
11528
+ opTypes.includes(lastOp.type) &&
11529
+ (lastOp.text === QUICK_TOOLBAR_HOTKEY || lastOp.text === undefined)) {
11530
+ return true;
11531
+ }
11532
+ return false;
11533
+ }
11534
+ };
11535
+
11536
+ var withQuickInsert = function (editor) {
11537
+ var onKeydown = editor.onKeydown, deleteBackward = editor.deleteBackward, onChange = editor.onChange;
11538
+ editor.onKeydown = function (event) {
11539
+ if (event.key === QUICK_TOOLBAR_HOTKEY && isCleanEmptyParagraph(editor)) {
11540
+ var rootNode = i1.AngularEditor.toDOMNode(editor, slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]));
11541
+ var theEditorComponent = editor.injector.get(TheEditorComponent);
11542
+ var quickToolbars = theEditorComponent.quickToolbarItems;
11543
+ QuickInsertEditor.openQuickToolbar(editor, quickToolbars, rootNode);
11544
+ }
11545
+ onKeydown(event);
11546
+ };
11547
+ editor.deleteBackward = function (unit) {
11548
+ if (!QuickInsertEditor.isOpenToolbar(editor, ['remove_text'])) {
11549
+ QuickInsertEditor.closeQuickToolbar(editor);
11550
+ }
11551
+ deleteBackward(unit);
11552
+ };
11553
+ editor.onChange = function () {
11554
+ var _a;
11555
+ onChange();
11556
+ if (editor.selection) {
11557
+ var editorComponent = editor.injector.get(TheEditorComponent);
11558
+ (_a = editorComponent.quickInsertInstance) === null || _a === void 0 ? void 0 : _a.checkStatus();
11559
+ var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
11560
+ if (!isCleanEmptyParagraph(editor) && slate.Node.string(block) !== QUICK_TOOLBAR_HOTKEY) {
11561
+ QuickInsertEditor.closeQuickToolbar(editor);
11562
+ }
11563
+ }
11564
+ };
11565
+ return editor;
11566
+ };
11567
+
11088
11568
  var internalPlugins = [
11089
11569
  withTheHistory,
11090
11570
  withAutoInsertData(),
@@ -11092,7 +11572,6 @@
11092
11572
  withRemoveVoid,
11093
11573
  withBlockCard,
11094
11574
  withResetType,
11095
- withImage,
11096
11575
  withIndent(__spreadArray([exports.ElementKinds.checkItem, exports.ElementKinds.numberedList, exports.ElementKinds.bulletedList, exports.ElementKinds.paragraph], __read(HEADING_TYPES))),
11097
11576
  withList({ validLiChildrenTypes: [exports.ElementKinds.image] }),
11098
11577
  withLink,
@@ -11112,9 +11591,11 @@
11112
11591
  withInsertParagraphNodes(),
11113
11592
  withGetFragment(),
11114
11593
  withDeserializeHMTL,
11115
- withDeserializeMd()
11594
+ withDeserializeMd(),
11595
+ withImage,
11596
+ withQuickInsert
11116
11597
  ];
11117
- var internalToolbarItems = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(AlignOptions)), __read(MarkOptions)), __read(ColorOptions)), __read(HeadingOptions)), __read(TodoItemOptions)), __read(ListOptions)), __read(ImageOptions)), __read(HrOptions)), __read(BlockquoteOptions)), __read(CodeOptions)), __read(LinkOptions)), __read(TableOptions)), __read(VerticalAlignOptions));
11598
+ var internalToolbarItems = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(AlignOptions)), __read(MarkOptions)), __read(ColorOptions)), __read(HeadingOptions)), __read(TodoItemOptions)), __read(ListOptions)), __read(ImageOptions)), __read(HrOptions)), __read(BlockquoteOptions)), __read(CodeOptions)), __read(LinkOptions)), __read(TableOptions)), __read(VerticalAlignOptions)), __read(PaintFormatOptions));
11118
11599
  var toolbarCompose = function (toolbarItems) {
11119
11600
  if (toolbarItems === void 0) { toolbarItems = []; }
11120
11601
  return __spreadArray(__spreadArray([], __read(internalToolbarItems)), __read(toolbarItems));
@@ -11155,14 +11636,14 @@
11155
11636
  var TheToolbarService = /** @class */ (function () {
11156
11637
  function TheToolbarService() {
11157
11638
  }
11158
- TheToolbarService.prototype.initialize = function (toolbarItems, global, inline, block) {
11639
+ TheToolbarService.prototype.initialize = function (toolbarItems, global, inline, quick) {
11159
11640
  if (global === void 0) { global = DefaultGlobalToolbarDefinition; }
11160
11641
  if (inline === void 0) { inline = DefaultInlineToolbarDefinition; }
11161
- if (block === void 0) { block = DefaultBlockToolbarDefinition; }
11642
+ if (quick === void 0) { quick = DefaultQuickToolbarDefinition; }
11162
11643
  var toolbarDefinition = {
11163
11644
  global: global,
11164
- block: block,
11165
- inline: inline
11645
+ inline: inline,
11646
+ quick: quick
11166
11647
  };
11167
11648
  var toolbarOperations = new Map();
11168
11649
  toolbarItems.forEach(function (i) { return toolbarOperations.set(i.key, i); });
@@ -11206,10 +11687,10 @@
11206
11687
 
11207
11688
  var autoFocus = function (editor, isFocus) {
11208
11689
  setTimeout(function () {
11209
- if (editor && isFocus) {
11690
+ if (editor && editor.children.length > 0 && isFocus) {
11210
11691
  slateHistory.HistoryEditor.withoutMerging(editor, function () {
11211
- i1.AngularEditor.focus(editor);
11212
11692
  slate.Transforms.select(editor, slate.Editor.start(editor, [0]));
11693
+ i1.AngularEditor.focus(editor);
11213
11694
  });
11214
11695
  }
11215
11696
  });
@@ -11243,44 +11724,6 @@
11243
11724
  previousHeight = currentHeight;
11244
11725
  };
11245
11726
 
11246
- var TheToolbarItemComponent = /** @class */ (function (_super) {
11247
- __extends(TheToolbarItemComponent, _super);
11248
- function TheToolbarItemComponent() {
11249
- var _this = _super.call(this) || this;
11250
- _this.active = false;
11251
- return _this;
11252
- }
11253
- TheToolbarItemComponent.prototype.statusChange = function (editor) {
11254
- var _a, _b;
11255
- this.active = ((_a = this.item) === null || _a === void 0 ? void 0 : _a.active) ? (_b = this.item) === null || _b === void 0 ? void 0 : _b.active(editor) : false;
11256
- };
11257
- TheToolbarItemComponent.prototype.execute = function (event) {
11258
- var _a, _b, _c;
11259
- _super.prototype.execute.call(this, event);
11260
- if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11261
- return;
11262
- }
11263
- (_c = this.item) === null || _c === void 0 ? void 0 : _c.execute(this.editor);
11264
- };
11265
- return TheToolbarItemComponent;
11266
- }(TheToolbarBaseItemComponent));
11267
- TheToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
11268
- TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-item" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n ", isInline: true, components: [{ type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }], directives: [{ type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
11269
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, decorators: [{
11270
- type: i0.Component,
11271
- args: [{
11272
- selector: 'the-toolbar-item',
11273
- template: "\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n ",
11274
- host: {
11275
- class: 'the-toolbar-item'
11276
- }
11277
- }]
11278
- }], ctorParameters: function () { return []; }, propDecorators: { item: [{
11279
- type: i0.Input
11280
- }], editor: [{
11281
- type: i0.Input
11282
- }] } });
11283
-
11284
11727
  var TheToolbarComponent = /** @class */ (function () {
11285
11728
  function TheToolbarComponent(cfr, elementRef, ngZone, toolbarGroupComponent) {
11286
11729
  this.cfr = cfr;
@@ -11288,6 +11731,7 @@
11288
11731
  this.ngZone = ngZone;
11289
11732
  this.toolbarGroupComponent = toolbarGroupComponent;
11290
11733
  this.toolbarItems = [];
11734
+ this.containerClass = [];
11291
11735
  this.isMore = true;
11292
11736
  this.components = new Map();
11293
11737
  this.moreGroupMenu = ToolbarMoreGroup;
@@ -11313,9 +11757,9 @@
11313
11757
  }
11314
11758
  };
11315
11759
  TheToolbarComponent.prototype.setToolbarClass = function () {
11316
- if (this.editor) {
11317
- var toolbarClass = getToolbarClass(this.editor);
11318
- this.elementRef.nativeElement.classList.add(toolbarClass);
11760
+ var _a;
11761
+ if (this.editor && !!this.containerClass.length) {
11762
+ (_a = this.elementRef.nativeElement.classList).add.apply(_a, __spreadArray([], __read(this.containerClass)));
11319
11763
  }
11320
11764
  };
11321
11765
  TheToolbarComponent.prototype.resizeElement = function () {
@@ -11543,7 +11987,7 @@
11543
11987
  return TheToolbarComponent;
11544
11988
  }());
11545
11989
  TheToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarComponent, deps: [{ token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }, { token: TheToolbarGroupToken }], target: i0__namespace.ɵɵFactoryTarget.Component });
11546
- TheToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarComponent, selector: "the-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems", align: "align", isMore: "isMore", afterTemplate: "afterTemplate" }, host: { classAttribute: "the-toolbar-container" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<thy-icon-nav [style.justifyContent]=\"align\">\n <ng-container #toolbarContainer></ng-container>\n <ng-content></ng-content>\n <ng-template *ngIf=\"afterTemplate\" [ngTemplateOutlet]=\"afterTemplate\"></ng-template>\n</thy-icon-nav>\n", components: [{ type: i2__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
11990
+ TheToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarComponent, selector: "the-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems", align: "align", containerClass: "containerClass", isMore: "isMore", afterTemplate: "afterTemplate" }, host: { classAttribute: "the-toolbar-container" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<thy-icon-nav [style.justifyContent]=\"align\">\n <ng-container #toolbarContainer></ng-container>\n <ng-content></ng-content>\n <ng-template *ngIf=\"afterTemplate\" [ngTemplateOutlet]=\"afterTemplate\"></ng-template>\n</thy-icon-nav>\n", components: [{ type: i2__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
11547
11991
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarComponent, decorators: [{
11548
11992
  type: i0.Component,
11549
11993
  args: [{
@@ -11564,6 +12008,8 @@
11564
12008
  type: i0.Input
11565
12009
  }], align: [{
11566
12010
  type: i0.Input
12011
+ }], containerClass: [{
12012
+ type: i0.Input
11567
12013
  }], isMore: [{
11568
12014
  type: i0.Input
11569
12015
  }], afterTemplate: [{
@@ -11573,56 +12019,246 @@
11573
12019
  args: ['toolbarContainer', { read: i0.ViewContainerRef, static: true }]
11574
12020
  }] } });
11575
12021
 
12022
+ var TheInlineToolbarComponent = /** @class */ (function () {
12023
+ function TheInlineToolbarComponent(elementRef, scrollDispatcher, cdr, ngZone, contextService) {
12024
+ this.elementRef = elementRef;
12025
+ this.scrollDispatcher = scrollDispatcher;
12026
+ this.cdr = cdr;
12027
+ this.ngZone = ngZone;
12028
+ this.contextService = contextService;
12029
+ this.destroy$ = new rxjs.Subject();
12030
+ }
12031
+ TheInlineToolbarComponent.prototype.ngOnInit = function () {
12032
+ var _this = this;
12033
+ this.scrollDispatcher
12034
+ .scrolled()
12035
+ .pipe(operators.takeUntil(this.destroy$))
12036
+ .subscribe(function () {
12037
+ _this.updateInlineToolbar();
12038
+ _this.cdr.detectChanges();
12039
+ });
12040
+ this.ngZone.runOutsideAngular(function () {
12041
+ rxjs.merge(rxjs.fromEvent(document, 'mouseup').pipe(operators.filter(function (e) { return e.button !== 2; })), rxjs.fromEvent(document, 'keyup').pipe(operators.filter(function (e) { return !e.shiftKey; })))
12042
+ .pipe(operators.debounceTime(200), operators.takeUntil(_this.destroy$))
12043
+ .subscribe(function () {
12044
+ var _a;
12045
+ _this.updateInlineToolbar();
12046
+ (_a = _this.inlineToolbar) === null || _a === void 0 ? void 0 : _a.statusChange(_this.editor);
12047
+ _this.cdr.detectChanges();
12048
+ });
12049
+ });
12050
+ };
12051
+ TheInlineToolbarComponent.prototype.updateInlineToolbar = function () {
12052
+ var inlineToolbar = this.elementRef.nativeElement.firstElementChild;
12053
+ if (!this.editor.selection) {
12054
+ inlineToolbar.removeAttribute('style');
12055
+ return;
12056
+ }
12057
+ var anchorBlock$1 = anchorBlock(this.editor);
12058
+ if (!inlineToolbar || !anchorBlock$1) {
12059
+ return;
12060
+ }
12061
+ var editor = this.editor;
12062
+ var selection = editor.selection;
12063
+ if (!selection ||
12064
+ !i1.AngularEditor.isFocused(editor) ||
12065
+ slate.Range.isCollapsed(selection) ||
12066
+ slate.Editor.string(editor, selection) === '') {
12067
+ inlineToolbar.removeAttribute('style');
12068
+ return;
12069
+ }
12070
+ if (!THE_INLINE_TOOLBAR_TYPES.includes(anchorBlock$1.type)) {
12071
+ return;
12072
+ }
12073
+ var native = window.getSelection();
12074
+ if (native.type !== 'None') {
12075
+ var range = native.getRangeAt(0);
12076
+ this.updatePosition(inlineToolbar, range);
12077
+ }
12078
+ };
12079
+ TheInlineToolbarComponent.prototype.updatePosition = function (toolbarElement, range) {
12080
+ var e_1, _b;
12081
+ var boundary = range.getBoundingClientRect();
12082
+ if (!boundary || (boundary.height === 0 && boundary.width === 0 && range.startContainer === range.endContainer)) {
12083
+ if (range.startContainer.nodeType === 1 && range.startContainer.querySelector('img')) {
12084
+ boundary = range.startContainer.querySelector('img').getBoundingClientRect();
12085
+ }
12086
+ else {
12087
+ boundary = range.startContainer.getBoundingClientRect();
12088
+ }
12089
+ }
12090
+ var editableElement = this.contextService.getEditableElement();
12091
+ var editableRect = editableElement.getBoundingClientRect();
12092
+ var toolbarHeight = toolbarElement.offsetHeight;
12093
+ var toolbarWidth = toolbarElement.offsetWidth;
12094
+ var halfOffsetWidth = toolbarWidth / 2;
12095
+ var defaultLeft = -halfOffsetWidth;
12096
+ var offsetLeft = boundary.left - editableRect.left;
12097
+ var isTopLeft = offsetLeft - 30 > halfOffsetWidth; // 30: editable padding left
12098
+ var isTopRight = editableRect.width - offsetLeft - boundary.width / 2 < halfOffsetWidth;
12099
+ var positions = {};
12100
+ positions.top = boundary.top - toolbarHeight;
12101
+ positions.right = 'initial';
12102
+ positions.left = boundary.left;
12103
+ if (isTopLeft) {
12104
+ positions.left = boundary.left + boundary.width / 2 + defaultLeft;
12105
+ }
12106
+ if (isTopRight) {
12107
+ positions.left = boundary.right - toolbarWidth;
12108
+ }
12109
+ try {
12110
+ for (var _c = __values(Object.keys(positions)), _d = _c.next(); !_d.done; _d = _c.next()) {
12111
+ var key = _d.value;
12112
+ toolbarElement.style[key] = positions[key] + (isNaN(positions[key]) ? '' : 'px');
12113
+ }
12114
+ }
12115
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
12116
+ finally {
12117
+ try {
12118
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
12119
+ }
12120
+ finally { if (e_1) throw e_1.error; }
12121
+ }
12122
+ toolbarElement.style.opacity = '1';
12123
+ };
12124
+ TheInlineToolbarComponent.prototype.ngOnDestroy = function () {
12125
+ this.destroy$.next();
12126
+ this.destroy$.complete();
12127
+ };
12128
+ return TheInlineToolbarComponent;
12129
+ }());
12130
+ TheInlineToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i2__namespace$1.ScrollDispatcher }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
12131
+ TheInlineToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems" }, host: { properties: { "class.hide": "toolbarItems.length === 0" } }, viewQueries: [{ propertyName: "inlineToolbar", first: true, predicate: ["inlineToolbar"], descendants: true }], ngImport: i0__namespace, template: "<the-toolbar\n #inlineToolbar\n class=\"the-inline-toolbar\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarItems\"\n [isMore]=\"false\"\n ></the-toolbar> ", isInline: true, components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
12132
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, decorators: [{
12133
+ type: i0.Component,
12134
+ args: [{
12135
+ selector: 'the-inline-toolbar',
12136
+ template: "<the-toolbar\n #inlineToolbar\n class=\"the-inline-toolbar\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarItems\"\n [isMore]=\"false\"\n ></the-toolbar> ",
12137
+ host: {
12138
+ '[class.hide]': 'toolbarItems.length === 0'
12139
+ },
12140
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
12141
+ }]
12142
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i2__namespace$1.ScrollDispatcher }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }, { type: TheContextService }]; }, propDecorators: { editor: [{
12143
+ type: i0.Input
12144
+ }], toolbarItems: [{
12145
+ type: i0.Input
12146
+ }], inlineToolbar: [{
12147
+ type: i0.ViewChild,
12148
+ args: ['inlineToolbar']
12149
+ }] } });
12150
+
12151
+ var TheQuickInsertComponent = /** @class */ (function () {
12152
+ function TheQuickInsertComponent(renderer, elementRef, cdr) {
12153
+ this.renderer = renderer;
12154
+ this.elementRef = elementRef;
12155
+ this.cdr = cdr;
12156
+ this.isHide = true;
12157
+ this.defaultIconName = 'plus-circle-thin';
12158
+ this.iconNameFill = 'plus-circle-thin-fill';
12159
+ this.displayIconName = this.defaultIconName;
12160
+ }
12161
+ TheQuickInsertComponent.prototype.handleMousedownNativeElement = function (event) {
12162
+ event.preventDefault();
12163
+ event.stopPropagation();
12164
+ };
12165
+ TheQuickInsertComponent.prototype.checkStatus = function () {
12166
+ var _this = this;
12167
+ var editor = this.editor;
12168
+ if (isCleanEmptyParagraph(editor)) {
12169
+ setTimeout(function () {
12170
+ var _a;
12171
+ var block = slate.Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
12172
+ var rootNode = i1.AngularEditor.toDOMNode(editor, block);
12173
+ _this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
12174
+ });
12175
+ return;
12176
+ }
12177
+ this.isHide = true;
12178
+ };
12179
+ TheQuickInsertComponent.prototype.updatePosition = function (left, top) {
12180
+ this.isHide = false;
12181
+ this.renderer.setStyle(this.elementRef.nativeElement, 'top', top + "px");
12182
+ this.renderer.setStyle(this.elementRef.nativeElement, 'left', left + "px");
12183
+ };
12184
+ TheQuickInsertComponent.prototype.mouseEnter = function (event) {
12185
+ this.displayIconName = this.iconNameFill;
12186
+ this.cdr.markForCheck();
12187
+ };
12188
+ TheQuickInsertComponent.prototype.mouseLeave = function (event) {
12189
+ this.displayIconName = this.defaultIconName;
12190
+ this.cdr.markForCheck();
12191
+ };
12192
+ TheQuickInsertComponent.prototype.handleClick = function (event) {
12193
+ event.stopPropagation();
12194
+ event.preventDefault();
12195
+ QuickInsertEditor.openQuickToolbar(this.editor, this.quickToolbarItems, this.iconElement.nativeElement);
12196
+ };
12197
+ return TheQuickInsertComponent;
12198
+ }());
12199
+ TheQuickInsertComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickInsertComponent, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
12200
+ TheQuickInsertComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "mousedown": "handleMousedownNativeElement($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-quick-insert" }, viewQueries: [{ propertyName: "iconElement", first: true, predicate: ["iconElement"], descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<thy-icon\n #iconElement\n [thyIconName]=\"displayIconName\"\n class=\"quick-insert-icon text-desc font-size-xlg\"\n (mouseenter)=\"mouseEnter($event)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousedown)=\"handleClick($event)\"\n></thy-icon>\n", components: [{ type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }] });
12201
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickInsertComponent, decorators: [{
12202
+ type: i0.Component,
12203
+ args: [{
12204
+ selector: '[theQuickInsert]',
12205
+ templateUrl: './quick-insert.component.html',
12206
+ host: {
12207
+ class: 'the-quick-insert',
12208
+ '[class.hide]': 'isHide'
12209
+ }
12210
+ }]
12211
+ }], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { editor: [{
12212
+ type: i0.Input
12213
+ }], quickToolbarItems: [{
12214
+ type: i0.Input
12215
+ }], iconElement: [{
12216
+ type: i0.ViewChild,
12217
+ args: ['iconElement', { read: i0.ElementRef, static: false }]
12218
+ }], handleMousedownNativeElement: [{
12219
+ type: i0.HostListener,
12220
+ args: ['mousedown', ['$event']]
12221
+ }] } });
12222
+
11576
12223
  var ThePlaceholderComponent = /** @class */ (function () {
11577
- function ThePlaceholderComponent(renderer, elementRef) {
12224
+ function ThePlaceholderComponent(renderer, elementRef, contextService) {
11578
12225
  this.renderer = renderer;
11579
12226
  this.elementRef = elementRef;
12227
+ this.contextService = contextService;
11580
12228
  this.isHide = true;
11581
12229
  }
11582
- Object.defineProperty(ThePlaceholderComponent.prototype, "selection", {
11583
- get: function () {
11584
- return this.editor.selection;
11585
- },
11586
- enumerable: false,
11587
- configurable: true
11588
- });
11589
12230
  ThePlaceholderComponent.prototype.handleCompositionStart = function () {
11590
- this.hide();
12231
+ var _a;
12232
+ if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.selection) {
12233
+ this.hide();
12234
+ }
11591
12235
  };
11592
12236
  ThePlaceholderComponent.prototype.handleCompositionEnd = function (event) {
11593
12237
  if (!event.data) {
11594
12238
  this.checkStatus();
11595
12239
  }
11596
12240
  };
11597
- ThePlaceholderComponent.prototype.checkStatus = function (value) {
12241
+ ThePlaceholderComponent.prototype.checkStatus = function () {
12242
+ var _this = this;
11598
12243
  var editor = this.editor;
11599
- var children = value ? value : editor.children;
11600
12244
  // empty content and no selection processing
11601
- if (this.autoFocus && !this.selection && isEmptyContent(children)) {
11602
- this.updatePosition(30, 51);
11603
- this.isHide = false;
12245
+ if (!editor.selection && isEmptyContent(editor.children)) {
12246
+ var firstElementChild = this.contextService.getFirstElementChild();
12247
+ var offsetTop = firstElementChild.offsetTop;
12248
+ var offsetLeft = firstElementChild.offsetLeft;
12249
+ this.updatePosition(offsetLeft, offsetTop);
11604
12250
  return;
11605
12251
  }
11606
- if (i1.AngularEditor.isFocused(editor) && this.selection && slate.Range.isCollapsed(this.selection)) {
11607
- var block = slate.Node.ancestor(editor, [this.selection.anchor.path[0]]);
11608
- var textIndent = 'textIndent';
11609
- var align = 'align';
11610
- var hasTextIndent = block[textIndent];
11611
- var hasAlign = block[align];
11612
- if (slate.Node.string(block) === '' &&
11613
- slate.Element.isElement(block) &&
11614
- block.type === exports.ElementKinds.paragraph &&
11615
- block.children.length === 1 &&
11616
- slate.Text.isText(block.children[0]) &&
11617
- !slate.Editor.isVoid(editor, block) &&
11618
- !hasTextIndent &&
11619
- !hasAlign) {
11620
- var rootNode = i1.AngularEditor.toDOMNode(this.editor, block);
11621
- this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
11622
- return;
11623
- }
12252
+ if (isCleanEmptyParagraph(editor)) {
12253
+ setTimeout(function () {
12254
+ var _a;
12255
+ var block = slate.Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
12256
+ var rootNode = i1.AngularEditor.toDOMNode(editor, block);
12257
+ _this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
12258
+ });
12259
+ return;
11624
12260
  }
11625
- this.hide();
12261
+ this.isHide = true;
11626
12262
  };
11627
12263
  ThePlaceholderComponent.prototype.updatePosition = function (left, top) {
11628
12264
  this.isHide = false;
@@ -11634,8 +12270,8 @@
11634
12270
  };
11635
12271
  return ThePlaceholderComponent;
11636
12272
  }());
11637
- ThePlaceholderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
11638
- ThePlaceholderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: { editor: "editor", autoFocus: "autoFocus", placeholder: "placeholder" }, host: { listeners: { "document:compositionstart": "handleCompositionStart()", "document:compositionend": "handleCompositionEnd($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-placeholder" }, ngImport: i0__namespace, template: "{{ placeholder }}", isInline: true });
12273
+ ThePlaceholderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
12274
+ ThePlaceholderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: { editor: "editor", placeholder: "placeholder" }, host: { listeners: { "document:compositionstart": "handleCompositionStart()", "document:compositionend": "handleCompositionEnd($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-placeholder" }, ngImport: i0__namespace, template: "{{ placeholder }}", isInline: true });
11639
12275
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, decorators: [{
11640
12276
  type: i0.Component,
11641
12277
  args: [{
@@ -11646,9 +12282,7 @@
11646
12282
  '[class.hide]': 'isHide'
11647
12283
  }
11648
12284
  }]
11649
- }], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }]; }, propDecorators: { editor: [{
11650
- type: i0.Input
11651
- }], autoFocus: [{
12285
+ }], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }, { type: TheContextService }]; }, propDecorators: { editor: [{
11652
12286
  type: i0.Input
11653
12287
  }], placeholder: [{
11654
12288
  type: i0.Input
@@ -11736,7 +12370,6 @@
11736
12370
  _this.theOnDOMEvent = new i0.EventEmitter();
11737
12371
  _this.theEditorCreated = new i0.EventEmitter();
11738
12372
  _this._plugins = [];
11739
- _this.globalToolbarItems = [];
11740
12373
  _this.autoScrollView = _.debounce(function (editor, scrollContainer) {
11741
12374
  return autoScrollViewHandle(editor, scrollContainer);
11742
12375
  }, 80);
@@ -11827,8 +12460,11 @@
11827
12460
  _this.onSlaCompositionEnd = function (event) { };
11828
12461
  _this.onSlaDragStart = function (event) { };
11829
12462
  _this.onSlaDragOver = function (event) { };
11830
- _this.trackBy = function (element) {
11831
- return element.key;
12463
+ _this.onDrop = function (event) {
12464
+ event.stopPropagation();
12465
+ _this.theOnDOMEvent.emit({
12466
+ nativeEvent: event
12467
+ });
11832
12468
  };
11833
12469
  return _this;
11834
12470
  }
@@ -11847,20 +12483,31 @@
11847
12483
  enumerable: false,
11848
12484
  configurable: true
11849
12485
  });
12486
+ Object.defineProperty(TheEditorComponent.prototype, "quickToolbarItems", {
12487
+ get: function () {
12488
+ var _a;
12489
+ return (_a = this.toolbarEntity) === null || _a === void 0 ? void 0 : _a.quick;
12490
+ },
12491
+ enumerable: false,
12492
+ configurable: true
12493
+ });
11850
12494
  TheEditorComponent.prototype.ngOnInit = function () {
11851
12495
  this.initialize();
11852
12496
  this.onErrorHandler();
11853
12497
  };
11854
12498
  TheEditorComponent.prototype.ngOnChanges = function (changes) {
11855
- var _a, _b, _c;
12499
+ var _a, _b, _c, _d, _e;
11856
12500
  var options = changes.theOptions;
11857
12501
  if (options) {
11858
12502
  this.initializeOptions();
11859
12503
  }
12504
+ if (((_a = options.currentValue) === null || _a === void 0 ? void 0 : _a.readonly) !== ((_b = options.previousValue) === null || _b === void 0 ? void 0 : _b.readonly)) {
12505
+ this.applyAutoFocus();
12506
+ }
11860
12507
  if (changes['theDecorate']) {
11861
12508
  this.generateDecorate();
11862
12509
  }
11863
- if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.selection) && (((_b = options === null || options === void 0 ? void 0 : options.currentValue) === null || _b === void 0 ? void 0 : _b.readonly) || ((_c = options === null || options === void 0 ? void 0 : options.currentValue) === null || _c === void 0 ? void 0 : _c.disabled))) {
12510
+ if (((_c = this.editor) === null || _c === void 0 ? void 0 : _c.selection) && (((_d = options === null || options === void 0 ? void 0 : options.currentValue) === null || _d === void 0 ? void 0 : _d.readonly) || ((_e = options === null || options === void 0 ? void 0 : options.currentValue) === null || _e === void 0 ? void 0 : _e.disabled))) {
11864
12511
  slate.Transforms.deselect(this.editor);
11865
12512
  }
11866
12513
  };
@@ -11894,31 +12541,32 @@
11894
12541
  }
11895
12542
  };
11896
12543
  TheEditorComponent.prototype.applyAutoFocus = function () {
11897
- var _a, _b, _c, _d;
11898
- if (((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.autoFocus) && !((_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.readonly) && !((_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.disabled)) {
11899
- autoFocus(this.editor, (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.autoFocus);
12544
+ var _a, _b, _c;
12545
+ if (!((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled) && !((_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.readonly)) {
12546
+ autoFocus(this.editor, (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.autoFocus);
11900
12547
  }
11901
12548
  };
11902
12549
  TheEditorComponent.prototype.toolbarCalculate = function () {
11903
12550
  var _a;
11904
12551
  var toolbar = (_a = this === null || this === void 0 ? void 0 : this.theOptions) === null || _a === void 0 ? void 0 : _a.toolbar;
11905
12552
  var toolbarItems = toolbarCompose(toolbar === null || toolbar === void 0 ? void 0 : toolbar.toolbarItems);
11906
- var toolbarOption = this.toolbarService.initialize(toolbarItems, toolbar === null || toolbar === void 0 ? void 0 : toolbar.global, toolbar === null || toolbar === void 0 ? void 0 : toolbar.block, toolbar === null || toolbar === void 0 ? void 0 : toolbar.inline);
11907
- this.globalToolbarItems = toolbarOption.toolbarEntity.global;
12553
+ var toolbarOption = this.toolbarService.initialize(toolbarItems, toolbar === null || toolbar === void 0 ? void 0 : toolbar.global, toolbar === null || toolbar === void 0 ? void 0 : toolbar.inline, toolbar === null || toolbar === void 0 ? void 0 : toolbar.quick);
12554
+ this.globalToolbarClass = ['the-global-toolbar', getToolbarClass(this.editor)];
12555
+ this.toolbarEntity = toolbarOption.toolbarEntity;
11908
12556
  if (this.theGlobalToolbar) {
11909
12557
  this.theGlobalToolbarInstance.editor = this.editor;
11910
12558
  this.theGlobalToolbarInstance.toolbarItems = toolbarOption.toolbarEntity.global;
12559
+ this.theGlobalToolbarInstance.containerClass = this.globalToolbarClass;
11911
12560
  this.theGlobalToolbarInstance.align = toolbar === null || toolbar === void 0 ? void 0 : toolbar.align;
11912
12561
  this.theGlobalToolbarInstance.setToolbarClass();
11913
12562
  this.theGlobalToolbarInstance.renderToolbarView();
11914
12563
  }
11915
12564
  };
11916
12565
  TheEditorComponent.prototype.writeValue = function (value) {
11917
- var _a, _b;
12566
+ var _a;
11918
12567
  var data = dataDeserialize((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.mode, value);
11919
12568
  // data-deserialize
11920
12569
  this.editorValue = data;
11921
- (_b = this.placeholderInstance) === null || _b === void 0 ? void 0 : _b.checkStatus(data);
11922
12570
  };
11923
12571
  TheEditorComponent.prototype.registerOnChange = function (fn) {
11924
12572
  this.onChangeCallback = fn;
@@ -11927,13 +12575,14 @@
11927
12575
  this.onTouchedCallback = fn;
11928
12576
  };
11929
12577
  TheEditorComponent.prototype.valueChange = function (value) {
11930
- var _a, _b, _c, _d, _e;
12578
+ var _a, _b, _c, _d, _e, _f;
11931
12579
  (_a = this.theGlobalToolbarInstance) === null || _a === void 0 ? void 0 : _a.statusChange(this.editor);
11932
- (_b = this.placeholderInstance) === null || _b === void 0 ? void 0 : _b.checkStatus();
12580
+ (_b = this.quickInsertInstance) === null || _b === void 0 ? void 0 : _b.checkStatus();
12581
+ (_c = this.placeholderInstance) === null || _c === void 0 ? void 0 : _c.checkStatus();
11933
12582
  // auto scroll view
11934
- var scrollContainer = (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.scrollContainer;
11935
- var maxHeight = (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.maxHeight;
11936
- if (!((_e = this.theOptions) === null || _e === void 0 ? void 0 : _e.readonly) && (scrollContainer || maxHeight)) {
12583
+ var scrollContainer = (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.scrollContainer;
12584
+ var maxHeight = (_e = this.theOptions) === null || _e === void 0 ? void 0 : _e.maxHeight;
12585
+ if (!((_f = this.theOptions) === null || _f === void 0 ? void 0 : _f.readonly) && (scrollContainer || maxHeight)) {
11937
12586
  var container = maxHeight ? DEFAULT_SCROLL_CONTAINER : scrollContainer;
11938
12587
  this.autoScrollView(this.editor, container);
11939
12588
  }
@@ -12009,18 +12658,18 @@
12009
12658
  }
12010
12659
  };
12011
12660
  TheEditorComponent.prototype.handleSelectAll = function () {
12012
- var _f;
12661
+ var _g;
12013
12662
  var node;
12014
12663
  if (!this.editor.selection) {
12015
12664
  setEndSelection(this.editor);
12016
12665
  }
12017
- var _g = __read(slate.Range.edges(this.editor.selection), 2), start = _g[0], end = _g[1];
12666
+ var _h = __read(slate.Range.edges(this.editor.selection), 2), start = _h[0], end = _h[1];
12018
12667
  var selectionRange = slate.Editor.range(this.editor, start, end);
12019
12668
  var containerBlocks = getContainerBlocks(this.editor);
12020
12669
  for (var i = 0; i < containerBlocks.length; i++) {
12021
- _f = __read(getNodesByType(this.editor, containerBlocks[i]), 1), node = _f[0];
12670
+ _g = __read(getNodesByType(this.editor, containerBlocks[i]), 1), node = _g[0];
12022
12671
  if (node) {
12023
- var _h = __read(node, 2), path = _h[1];
12672
+ var _j = __read(node, 2), path = _j[1];
12024
12673
  var isStartParent = slate.Path.equals(path, start.path.slice(0, path.length));
12025
12674
  var isEndParent = slate.Path.equals(path, end.path.slice(0, path.length));
12026
12675
  if (isStartParent && isEndParent) {
@@ -12063,7 +12712,7 @@
12063
12712
  useExisting: i0.forwardRef(function () { return TheEditorComponent; }),
12064
12713
  multi: true
12065
12714
  }
12066
- ], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"globalToolbarItems\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [trackBy]=\"trackBy\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <div\n *ngIf=\"theOptions?.placeholder\"\n #placeholder\n thePlaceholder\n [editor]=\"editor\"\n [autoFocus]=\"theOptions?.placeholder?.autoFocus\"\n [placeholder]=\"theOptions?.placeholder\"\n ></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "isMore", "afterTemplate"] }, { type: i1__namespace.SlateEditableComponent, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "isStrictDecorate", "trackBy", "readonly", "beforeInput", "blur", "click", "compositionEnd", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: ["editor", "autoFocus", "placeholder"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
12715
+ ], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\"></div>\n <div #placeholder thePlaceholder [editor]=\"editor\" [placeholder]=\"theOptions?.placeholder\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { type: i1__namespace.SlateEditableComponent, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "isStrictDecorate", "trackBy", "readonly", "beforeInput", "blur", "click", "compositionEnd", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems"] }, { type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: ["editor", "placeholder"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
12067
12716
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheEditorComponent, decorators: [{
12068
12717
  type: i0.Component,
12069
12718
  args: [{
@@ -12106,6 +12755,9 @@
12106
12755
  }], globalToolbarInstance: [{
12107
12756
  type: i0.ViewChild,
12108
12757
  args: ['globalToolbar']
12758
+ }], quickInsertInstance: [{
12759
+ type: i0.ViewChild,
12760
+ args: ['quickInsert', { static: true }]
12109
12761
  }], placeholderInstance: [{
12110
12762
  type: i0.ViewChild,
12111
12763
  args: ['placeholder']
@@ -12241,7 +12893,7 @@
12241
12893
  return TheToolbarGroupComponent;
12242
12894
  }());
12243
12895
  TheToolbarGroupComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarGroupComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
12244
- TheToolbarGroupComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarGroupComponent, selector: "the-toolbar-group", inputs: { menus: "menus", item: "item" }, host: { listeners: { "mousedown": "mousedownHandler($event)", "click": "clickHandle($event)" }, classAttribute: "the-toolbar-group" }, viewQueries: [{ propertyName: "groupTemplate", first: true, predicate: ["groupTemplate"], descendants: true, read: i0.TemplateRef, static: true }], ngImport: i0__namespace, template: "<a thyIconNavLink [thyIconNavLinkIcon]=\"item.icon\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\" [thyIconNavLinkActive]=\"active\"></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n", components: [{ type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "isMore", "afterTemplate"] }], directives: [{ type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
12896
+ TheToolbarGroupComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarGroupComponent, selector: "the-toolbar-group", inputs: { menus: "menus", item: "item" }, host: { listeners: { "mousedown": "mousedownHandler($event)", "click": "clickHandle($event)" }, classAttribute: "the-toolbar-group" }, viewQueries: [{ propertyName: "groupTemplate", first: true, predicate: ["groupTemplate"], descendants: true, read: i0.TemplateRef, static: true }], ngImport: i0__namespace, template: "<a thyIconNavLink [thyIconNavLinkIcon]=\"item.icon\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\" [thyIconNavLinkActive]=\"active\"></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n", components: [{ type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
12245
12897
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarGroupComponent, decorators: [{
12246
12898
  type: i0.Component,
12247
12899
  args: [{
@@ -12272,7 +12924,7 @@
12272
12924
  i2$1.ThyNavModule,
12273
12925
  i2$2.ThyFormModule,
12274
12926
  i5$3.ThySharedModule,
12275
- list.ThyListModule,
12927
+ i2$3.ThyListModule,
12276
12928
  i7.ThyTooltipModule,
12277
12929
  i4.ThyProgressModule,
12278
12930
  autocomplete.ThyAutocompleteModule,
@@ -12288,10 +12940,12 @@
12288
12940
  TheToolbarDropdownComponent,
12289
12941
  TheToolbarGroupComponent,
12290
12942
  TheToolbarItemComponent,
12943
+ TheInlineToolbarComponent,
12291
12944
  NavSplitLineComponent,
12292
12945
  TheTextComponent,
12293
12946
  TheDefaultElementComponent,
12294
- ThePlaceholderComponent,
12947
+ TheQuickInsertComponent,
12948
+ TheQuickToolbarComponent,
12295
12949
  TheColorSelectComponent,
12296
12950
  TheColorToolbarItemComponent,
12297
12951
  TheContextMenuComponent,
@@ -12318,7 +12972,8 @@
12318
12972
  TheTableToolbarComponent,
12319
12973
  TheTableComponent,
12320
12974
  TheTableRowComponent,
12321
- TheTdComponent
12975
+ TheTdComponent,
12976
+ ThePlaceholderComponent
12322
12977
  ];
12323
12978
  var PIPES = [ElementStylePipe, ElementClassPipe];
12324
12979
  var TheEditorModule = /** @class */ (function () {
@@ -12331,10 +12986,12 @@
12331
12986
  TheToolbarDropdownComponent,
12332
12987
  TheToolbarGroupComponent,
12333
12988
  TheToolbarItemComponent,
12989
+ TheInlineToolbarComponent,
12334
12990
  NavSplitLineComponent,
12335
12991
  TheTextComponent,
12336
12992
  TheDefaultElementComponent,
12337
- ThePlaceholderComponent,
12993
+ TheQuickInsertComponent,
12994
+ TheQuickToolbarComponent,
12338
12995
  TheColorSelectComponent,
12339
12996
  TheColorToolbarItemComponent,
12340
12997
  TheContextMenuComponent,
@@ -12358,12 +13015,13 @@
12358
13015
  TheTableToolbarComponent,
12359
13016
  TheTableComponent,
12360
13017
  TheTableRowComponent,
12361
- TheTdComponent], imports: [i6.CommonModule, i1.SlateModule, i4$2.FormsModule, i4$1.ThyIconModule,
13018
+ TheTdComponent,
13019
+ ThePlaceholderComponent], imports: [i6.CommonModule, i1.SlateModule, i4$2.FormsModule, i4$1.ThyIconModule,
12362
13020
  avatar.ThyAvatarModule,
12363
13021
  i2$1.ThyNavModule,
12364
13022
  i2$2.ThyFormModule,
12365
13023
  i5$3.ThySharedModule,
12366
- list.ThyListModule,
13024
+ i2$3.ThyListModule,
12367
13025
  i7.ThyTooltipModule,
12368
13026
  i4.ThyProgressModule,
12369
13027
  autocomplete.ThyAutocompleteModule,
@@ -12410,7 +13068,6 @@
12410
13068
  exports.AlignEditor = AlignEditor;
12411
13069
  exports.BLOCK_DELETEBACKWARD_TYPES = BLOCK_DELETEBACKWARD_TYPES;
12412
13070
  exports.BLOCK_INSERT_ORIGIN = BLOCK_INSERT_ORIGIN;
12413
- exports.BLOCK_TOOLBAR_HOTKEY = BLOCK_TOOLBAR_HOTKEY;
12414
13071
  exports.BlockquoteEditor = BlockquoteEditor;
12415
13072
  exports.CLIPBOARD_FORMAT_KEY = CLIPBOARD_FORMAT_KEY;
12416
13073
  exports.CODEMIRROR_PADDING_TOP = CODEMIRROR_PADDING_TOP;
@@ -12422,10 +13079,10 @@
12422
13079
  exports.ColorEditor = ColorEditor;
12423
13080
  exports.DEFAULT_LANGUAGE = DEFAULT_LANGUAGE;
12424
13081
  exports.DEFAULT_SCROLL_CONTAINER = DEFAULT_SCROLL_CONTAINER;
12425
- exports.DefaultBlockToolbarDefinition = DefaultBlockToolbarDefinition;
12426
13082
  exports.DefaultElementOptions = DefaultElementOptions;
12427
13083
  exports.DefaultGlobalToolbarDefinition = DefaultGlobalToolbarDefinition;
12428
13084
  exports.DefaultInlineToolbarDefinition = DefaultInlineToolbarDefinition;
13085
+ exports.DefaultQuickToolbarDefinition = DefaultQuickToolbarDefinition;
12429
13086
  exports.ELEMENT_UNIQUE_ID = ELEMENT_UNIQUE_ID;
12430
13087
  exports.HEADING_TYPES = HEADING_TYPES;
12431
13088
  exports.HeadingEditor = HeadingEditor;
@@ -12440,11 +13097,14 @@
12440
13097
  exports.PICTURE_ACCEPTED_UPLOAD_MIME = PICTURE_ACCEPTED_UPLOAD_MIME;
12441
13098
  exports.PICTURE_ACCEPTED_UPLOAD_SIZE = PICTURE_ACCEPTED_UPLOAD_SIZE;
12442
13099
  exports.PLUGIN_COMPONENTS = PLUGIN_COMPONENTS;
13100
+ exports.QUICK_TOOLBAR_HOTKEY = QUICK_TOOLBAR_HOTKEY;
13101
+ exports.QuickInsertEditor = QuickInsertEditor;
12443
13102
  exports.STANDARD_HEADING_TYPES = STANDARD_HEADING_TYPES;
12444
13103
  exports.TAB_SPACE = TAB_SPACE;
12445
13104
  exports.THE_CODE_MODE_PROVIDER = THE_CODE_MODE_PROVIDER;
12446
13105
  exports.THE_CODE_MODE_TOKEN = THE_CODE_MODE_TOKEN;
12447
13106
  exports.THE_EDITOR_CONVERSION_HINT_REF = THE_EDITOR_CONVERSION_HINT_REF;
13107
+ exports.THE_EDITOR_QUICK_TOOLBAR_REF = THE_EDITOR_QUICK_TOOLBAR_REF;
12448
13108
  exports.THE_EDITOR_UUID = THE_EDITOR_UUID;
12449
13109
  exports.THE_INLINE_TOOLBAR_TYPES = THE_INLINE_TOOLBAR_TYPES;
12450
13110
  exports.THE_UPLOAD_SERVICE_TOKEN = THE_UPLOAD_SERVICE_TOKEN;
@@ -12458,6 +13118,7 @@
12458
13118
  exports.TheEditorModule = TheEditorModule;
12459
13119
  exports.TheImageComponent = TheImageComponent;
12460
13120
  exports.TheQueries = index$1;
13121
+ exports.TheToolbarBaseItemComponent = TheToolbarBaseItemComponent;
12461
13122
  exports.TheToolbarComponent = TheToolbarComponent;
12462
13123
  exports.TheToolbarDropdownComponent = TheToolbarDropdownComponent;
12463
13124
  exports.TheToolbarGroupComponent = TheToolbarGroupComponent;