@worktile/theia 1.2.10 → 1.2.14

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 (42) hide show
  1. package/bundles/worktile-theia.umd.js +208 -134
  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 +4 -2
  5. package/components/inline-toolbar/inline-toolbar.component.scss +6 -5
  6. package/components/toolbar/toolbar.component.d.ts +2 -1
  7. package/custom-types.d.ts +2 -0
  8. package/editor.component.d.ts +2 -0
  9. package/esm2015/components/column-resize/column-resize.directive.js +1 -1
  10. package/esm2015/components/inline-toolbar/inline-toolbar.component.js +27 -11
  11. package/esm2015/components/toolbar/toolbar.component.js +7 -6
  12. package/esm2015/components/toolbar-group/toolbar-group.component.js +1 -1
  13. package/esm2015/custom-types.js +1 -1
  14. package/esm2015/editor.component.js +28 -14
  15. package/esm2015/interfaces/editor.js +1 -1
  16. package/esm2015/plugins/deserializers/deserialize-html.plugin.js +12 -4
  17. package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -2
  18. package/esm2015/plugins/index.js +2 -2
  19. package/esm2015/plugins/placeholder/placeholder.component.js +21 -14
  20. package/esm2015/plugins/quick-insert/components/quick-insert.component.js +7 -6
  21. package/esm2015/plugins/quick-insert/quick-insert.plugint.js +3 -2
  22. package/esm2015/plugins/table/table.plugin.js +34 -55
  23. package/esm2015/plugins/table/table.types.js +1 -1
  24. package/esm2015/plugins/table/utils/normalize-table.js +31 -0
  25. package/esm2015/queries/is-container-type.js +2 -2
  26. package/esm2015/services/context.service.js +10 -2
  27. package/esm2015/transforms/index.js +2 -3
  28. package/esm2015/utils/auto-focus.js +2 -2
  29. package/esm2015/utils/fragment.js +24 -2
  30. package/fesm2015/worktile-theia.js +188 -125
  31. package/fesm2015/worktile-theia.js.map +1 -1
  32. package/interfaces/editor.d.ts +2 -0
  33. package/package.json +1 -1
  34. package/plugins/placeholder/placeholder.component.d.ts +4 -2
  35. package/plugins/table/table.types.d.ts +7 -0
  36. package/plugins/table/utils/normalize-table.d.ts +2 -0
  37. package/services/context.service.d.ts +2 -0
  38. package/styles/editor.scss +3 -3
  39. package/transforms/index.d.ts +1 -2
  40. package/utils/fragment.d.ts +5 -0
  41. package/esm2015/transforms/insert-elements.js +0 -22
  42. package/transforms/insert-elements.d.ts +0 -2
@@ -1040,7 +1040,10 @@ const extractFragment = (data, deleteKey = ELEMENT_UNIQUE_ID) => {
1040
1040
  const fragment = data.getData(`application/${CLIPBOARD_FORMAT_KEY}`);
1041
1041
  if (fragment) {
1042
1042
  const decoded = decodeURIComponent(window.atob(fragment));
1043
- const nodes = JSON.parse(decoded);
1043
+ let nodes = JSON.parse(decoded);
1044
+ if (!Array.isArray(nodes)) {
1045
+ nodes = [nodes];
1046
+ }
1044
1047
  // delete key to avoid duplicate keys
1045
1048
  if (deleteKey) {
1046
1049
  deleteElementKey(nodes, deleteKey);
@@ -1060,6 +1063,25 @@ function deleteElementKey(nodes, key) {
1060
1063
  });
1061
1064
  return nodes;
1062
1065
  }
1066
+ /**
1067
+ * 删除 text 节点的 颜色/背景色
1068
+ * @param node
1069
+ */
1070
+ function deleteColorAndBackgroundColorOfText(node) {
1071
+ node.children.forEach((child) => {
1072
+ if (Text.isText(child)) {
1073
+ if (child['color']) {
1074
+ delete child['color'];
1075
+ }
1076
+ if (child['background-color']) {
1077
+ delete child['background-color'];
1078
+ }
1079
+ }
1080
+ else {
1081
+ deleteColorAndBackgroundColorOfText(child);
1082
+ }
1083
+ });
1084
+ }
1063
1085
 
1064
1086
  const isAcrossBlocks = (editor, fragment) => {
1065
1087
  const startBlock = getStartBlock(editor, fragment[0]);
@@ -1172,7 +1194,7 @@ const getSelectionMarks = (editor) => {
1172
1194
  return marks;
1173
1195
  };
1174
1196
 
1175
- const isContainer = (editor, value) => Element$1.isElement(value) && editor.isContainer(value);
1197
+ const isContainer = (editor, value) => Element$1.isElement(value) && editor.isContainer && editor.isContainer(value);
1176
1198
 
1177
1199
  const getContainerBlocks = (editor) => {
1178
1200
  const containerNode = Editor.above(editor, {
@@ -1441,26 +1463,6 @@ const setEndSelection = (editor) => {
1441
1463
  AngularEditor.focus(editor);
1442
1464
  };
1443
1465
 
1444
- const insertTheElements = (editor, nodes) => {
1445
- if (Range.isExpanded(editor.selection)) {
1446
- Editor.deleteFragment(editor);
1447
- }
1448
- const isEmptyParagraph$1 = isEmptyParagraph(editor, editor.selection.anchor);
1449
- const parentPath = Path.parent(editor.selection.anchor.path);
1450
- Editor.withoutNormalizing(editor, () => {
1451
- Transforms.insertNodes(editor, nodes);
1452
- if (parentPath.length && isEmptyParagraph$1) {
1453
- Transforms.delete(editor, { at: parentPath });
1454
- const lastPath = parentPath.pop();
1455
- Transforms.select(editor, Editor.end(editor, [...parentPath, lastPath + nodes.length - 1]));
1456
- }
1457
- else {
1458
- const lastPath = parentPath.pop();
1459
- Transforms.select(editor, Editor.end(editor, [...parentPath, lastPath + nodes.length]));
1460
- }
1461
- });
1462
- };
1463
-
1464
1466
  const THE_EDITOR_UUID = new WeakMap();
1465
1467
  const THE_EDITOR_CONVERSION_HINT_REF = new WeakMap();
1466
1468
  const THE_EDITOR_QUICK_TOOLBAR_REF = new WeakMap();
@@ -1525,7 +1527,6 @@ var index = /*#__PURE__*/Object.freeze({
1525
1527
  splitNode: splitNode,
1526
1528
  deleteElement: deleteElement,
1527
1529
  setEndSelection: setEndSelection,
1528
- insertTheElements: insertTheElements,
1529
1530
  closeConversionHint: closeConversionHint,
1530
1531
  handleContinualDeleteBackward: handleContinualDeleteBackward,
1531
1532
  handleContinualInsertBreak: handleContinualInsertBreak
@@ -1991,7 +1992,7 @@ const withDeserializeMd = (options) => (editor) => {
1991
1992
  editor.undo();
1992
1993
  setTimeout(() => {
1993
1994
  Transforms.select(editor, oldRange);
1994
- insertTheElements(editor, fragment);
1995
+ Transforms.insertFragment(editor, fragment);
1995
1996
  AngularEditor.focus(editor);
1996
1997
  });
1997
1998
  return;
@@ -2232,10 +2233,18 @@ class TheContextService {
2232
2233
  }
2233
2234
  getOptions() {
2234
2235
  if (!this.options.width) {
2235
- this.options.width = this.options.nativeElement.querySelector('.slate-editable-container').firstElementChild.offsetWidth;
2236
+ const firstElementChild = this.getFirstElementChild();
2237
+ this.options.width = firstElementChild.offsetWidth;
2236
2238
  }
2237
2239
  return this.options;
2238
2240
  }
2241
+ getEditableElement() {
2242
+ return this.options.nativeElement.querySelector('.the-editor-typo');
2243
+ }
2244
+ getFirstElementChild() {
2245
+ const editableElement = this.getEditableElement();
2246
+ return editableElement === null || editableElement === void 0 ? void 0 : editableElement.firstElementChild;
2247
+ }
2239
2248
  setUploadFileList(file) {
2240
2249
  this.fileList.push(file);
2241
2250
  }
@@ -9763,6 +9772,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
9763
9772
  args: ['cellInner', { static: true }]
9764
9773
  }] } });
9765
9774
 
9775
+ const normalizeTable = (table) => {
9776
+ const normalizedNodes = [];
9777
+ const rowHeight = table.children.length;
9778
+ const columnWidth = table.children[0].children.length;
9779
+ table.children.forEach((row, rowIndex) => {
9780
+ row.children.forEach((cell, columnIndex) => {
9781
+ // case 1
9782
+ if (cell.colspan || cell.rowspan) {
9783
+ const rowspan = cell.rowspan || 1;
9784
+ const colspan = cell.colspan || 1;
9785
+ if (rowspan > rowHeight - rowIndex) {
9786
+ cell.rowspan = rowHeight - rowIndex;
9787
+ }
9788
+ if (colspan > columnWidth - columnIndex) {
9789
+ cell.colspan = columnWidth - columnIndex;
9790
+ }
9791
+ return;
9792
+ }
9793
+ // case 2
9794
+ if (cell.hidden && !normalizedNodes.includes(cell)) {
9795
+ const origin = calcOriginSpan(table, rowIndex, columnIndex);
9796
+ if (!origin) {
9797
+ delete table.children[rowIndex].children[columnIndex].hidden;
9798
+ }
9799
+ }
9800
+ });
9801
+ });
9802
+ return table;
9803
+ };
9804
+
9766
9805
  const withTable = (editor) => {
9767
9806
  const { deleteBackward, deleteForward, onKeydown, setFragmentData, insertData, normalizeNode, isBlockCard, renderElement, deleteCutData, isContainer } = editor;
9768
9807
  editor.deleteBackward = unit => {
@@ -9940,67 +9979,45 @@ const withTable = (editor) => {
9940
9979
  return;
9941
9980
  }
9942
9981
  const { selection } = editor;
9943
- const element = TablePosition.create(opts, editor, selection.anchor.path);
9944
- const tableComponent = ELEMENT_TO_COMPONENT.get(element.table);
9982
+ const tablePosition = TablePosition.create(opts, editor, selection.anchor.path);
9983
+ const tableComponent = ELEMENT_TO_COMPONENT.get(tablePosition.table);
9945
9984
  const cells = tableComponent.tableStore.selectedCells;
9946
- const tableContent = {};
9947
- let contents;
9948
- let cellNode;
9949
- let fragment;
9950
- if (cells.length > 0) {
9951
- const selectNodes = getSelectCellNode(editor, cells);
9952
- const selectedColumnsIndex = tableComponent.tableStore.selectedColumnsIndex || [];
9953
- const selectedRowsIndex = tableComponent.tableStore.selectedRowsIndex || [];
9985
+ let tableFragment = null;
9986
+ if (tableComponent.tableStore.selectedRowsIndex.length > 0) {
9987
+ const rows = tablePosition.table.children.slice(tableComponent.tableStore.selectedRowsIndex[0], tableComponent.tableStore.selectedRowsIndex[tableComponent.tableStore.selectedRowsIndex.length - 1] + 1);
9988
+ tableFragment = Object.assign(Object.assign({}, tablePosition.table), { children: rows });
9989
+ }
9990
+ else if (cells.length > 0) {
9991
+ const tempRows = {};
9954
9992
  for (const cell of cells) {
9955
9993
  const { row, col } = cell;
9956
- const cellPath = [...element.tableEntry[1], row, col];
9957
- cellNode = Node.get(editor, cellPath);
9958
- const cellRange = Editor.range(editor, cellPath);
9959
- const domRange = AngularEditor.toDOMRange(editor, cellRange);
9960
- if (!contents) {
9961
- contents = domRange.cloneContents();
9962
- }
9963
- else {
9964
- contents.append(domRange.cloneContents());
9965
- }
9966
- if ((selectedColumnsIndex.length === 1 && cellNode.colspan > 1) ||
9967
- (selectedRowsIndex.length === 1 && cellNode.rowspan > 1)) {
9968
- cellNode = Object.assign(Object.assign({}, cellNode), { colspan: selectedColumnsIndex.length === 1 ? null : cellNode.colspan, rowspan: selectedRowsIndex.length === 1 ? null : cellNode.rowspan });
9969
- }
9970
- if (cellNode.hidden) {
9971
- const origin = calcOriginSpan(element.table, row, col);
9972
- const selectedOrigin = origin && selectNodes.filter(item => item.node.key === origin.key);
9973
- if (!selectedOrigin || !selectedOrigin.length) {
9974
- cellNode = Object.assign(Object.assign({}, cellNode), { hidden: null });
9975
- }
9976
- }
9977
- if (!tableContent[row]) {
9978
- tableContent[row] = [];
9994
+ const cellPath = [...tablePosition.tableEntry[1], row, col];
9995
+ const cellNode = Node.get(editor, cellPath);
9996
+ if (!tempRows[row]) {
9997
+ tempRows[row] = [];
9979
9998
  }
9980
- tableContent[row].push(cellNode);
9999
+ tempRows[row].push(cellNode);
9981
10000
  }
9982
- const tableFragment = [
10001
+ const rows = Object.values(tempRows).map((item) => {
10002
+ return {
10003
+ type: ElementKinds.tableRow,
10004
+ children: item
10005
+ };
10006
+ });
10007
+ tableFragment =
9983
10008
  {
9984
10009
  type: ElementKinds.table,
9985
- children: Object.values(tableContent).map((item) => {
9986
- return {
9987
- type: ElementKinds.tableRow,
9988
- children: item
9989
- };
9990
- })
9991
- }
9992
- ];
9993
- fragment = tableFragment;
9994
- const stringObj = JSON.stringify(fragment);
10010
+ children: rows
10011
+ };
10012
+ }
10013
+ if (tableFragment) {
10014
+ tableFragment = normalizeTable(_.cloneDeep(tableFragment));
10015
+ tableFragment = [tableFragment];
10016
+ const stringObj = JSON.stringify(tableFragment);
9995
10017
  const encoded = window.btoa(encodeURIComponent(stringObj));
9996
10018
  unit.setData(`application/${CLIPBOARD_FORMAT_KEY}`, encoded);
9997
- const div = document.createElement('div');
9998
- div.appendChild(contents);
9999
- div.setAttribute('hidden', 'true');
10000
- document.body.appendChild(div);
10001
- unit.setData('text/html', div.innerHTML);
10002
- unit.setData('text/plain', getPlainText$1(div));
10003
- document.body.removeChild(div);
10019
+ // unit.setData('text/html', div.innerHTML);
10020
+ unit.setData('text/plain', Node.string(tableFragment));
10004
10021
  return;
10005
10022
  }
10006
10023
  setFragmentData(unit);
@@ -10164,7 +10181,15 @@ const withDeserializeHMTL = (editor) => {
10164
10181
  insertData(data);
10165
10182
  return;
10166
10183
  }
10167
- insertTheElements(editor, fragment);
10184
+ // 识出纯图片并且粘贴板中存在文件则不进行处理, hook 直接右键复制图片的场景,流转到上传图片流程
10185
+ // 后续需要做识别html图片后自动上传处理
10186
+ if (fragment.length === 1 && fragment[0].type === ElementKinds.image && data.files.length > 0) {
10187
+ insertData(data);
10188
+ return;
10189
+ }
10190
+ // 过滤 text 节点的 color/background-color 属性
10191
+ fragment.forEach((node) => deleteColorAndBackgroundColorOfText(node));
10192
+ Transforms.insertFragment(editor, fragment);
10168
10193
  return;
10169
10194
  }
10170
10195
  insertData(data);
@@ -10677,10 +10702,11 @@ const withQuickInsert = (editor) => {
10677
10702
  deleteBackward(unit);
10678
10703
  };
10679
10704
  editor.onChange = () => {
10705
+ var _a;
10680
10706
  onChange();
10681
10707
  if (editor.selection) {
10682
10708
  const editorComponent = editor.injector.get(TheEditorComponent);
10683
- editorComponent.quickInsertInstance.checkStatus();
10709
+ (_a = editorComponent.quickInsertInstance) === null || _a === void 0 ? void 0 : _a.checkStatus();
10684
10710
  const block = Node.ancestor(editor, [editor.selection.anchor.path[0]]);
10685
10711
  if (!isCleanEmptyParagraph(editor) && Node.string(block) !== QUICK_TOOLBAR_HOTKEY) {
10686
10712
  QuickInsertEditor.closeQuickToolbar(editor);
@@ -10715,9 +10741,9 @@ const internalPlugins = [
10715
10741
  withMoveSelection,
10716
10742
  withInsertParagraphNodes(),
10717
10743
  withGetFragment(),
10744
+ withImage,
10718
10745
  withDeserializeHMTL,
10719
10746
  withDeserializeMd(),
10720
- withImage,
10721
10747
  withQuickInsert
10722
10748
  ];
10723
10749
  const internalToolbarItems = [
@@ -10821,8 +10847,8 @@ const autoFocus = (editor, isFocus) => {
10821
10847
  setTimeout(() => {
10822
10848
  if (editor && editor.children.length > 0 && isFocus) {
10823
10849
  HistoryEditor.withoutMerging(editor, () => {
10824
- AngularEditor.focus(editor);
10825
10850
  Transforms.select(editor, Editor.start(editor, [0]));
10851
+ AngularEditor.focus(editor);
10826
10852
  });
10827
10853
  }
10828
10854
  });
@@ -10863,6 +10889,7 @@ class TheToolbarComponent {
10863
10889
  this.ngZone = ngZone;
10864
10890
  this.toolbarGroupComponent = toolbarGroupComponent;
10865
10891
  this.toolbarItems = [];
10892
+ this.containerClass = [];
10866
10893
  this.isMore = true;
10867
10894
  this.components = new Map();
10868
10895
  this.moreGroupMenu = ToolbarMoreGroup;
@@ -10888,9 +10915,8 @@ class TheToolbarComponent {
10888
10915
  }
10889
10916
  }
10890
10917
  setToolbarClass() {
10891
- if (this.editor) {
10892
- const toolbarClass = getToolbarClass(this.editor);
10893
- this.elementRef.nativeElement.classList.add(toolbarClass);
10918
+ if (this.editor && !!this.containerClass.length) {
10919
+ this.elementRef.nativeElement.classList.add(...this.containerClass);
10894
10920
  }
10895
10921
  }
10896
10922
  resizeElement() {
@@ -11060,7 +11086,7 @@ class TheToolbarComponent {
11060
11086
  }
11061
11087
  }
11062
11088
  TheToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: TheToolbarGroupToken }], target: i0.ɵɵFactoryTarget.Component });
11063
- TheToolbarComponent.ɵcmp = i0.ɵɵ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: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, 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.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
11089
+ TheToolbarComponent.ɵcmp = i0.ɵɵ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: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, 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.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
11064
11090
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarComponent, decorators: [{
11065
11091
  type: Component,
11066
11092
  args: [{
@@ -11079,6 +11105,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
11079
11105
  type: Input
11080
11106
  }], align: [{
11081
11107
  type: Input
11108
+ }], containerClass: [{
11109
+ type: Input
11082
11110
  }], isMore: [{
11083
11111
  type: Input
11084
11112
  }], afterTemplate: [{
@@ -11089,11 +11117,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
11089
11117
  }] } });
11090
11118
 
11091
11119
  class TheInlineToolbarComponent {
11092
- constructor(elementRef, scrollDispatcher, cdr, ngZone) {
11120
+ constructor(elementRef, scrollDispatcher, cdr, ngZone, contextService) {
11093
11121
  this.elementRef = elementRef;
11094
11122
  this.scrollDispatcher = scrollDispatcher;
11095
11123
  this.cdr = cdr;
11096
11124
  this.ngZone = ngZone;
11125
+ this.contextService = contextService;
11097
11126
  this.destroy$ = new Subject();
11098
11127
  }
11099
11128
  ngOnInit() {
@@ -11127,7 +11156,10 @@ class TheInlineToolbarComponent {
11127
11156
  }
11128
11157
  const { editor } = this;
11129
11158
  const { selection } = editor;
11130
- if (!selection || !AngularEditor.isFocused(editor) || Range.isCollapsed(selection) || Editor.string(editor, selection) === '') {
11159
+ if (!selection ||
11160
+ !AngularEditor.isFocused(editor) ||
11161
+ Range.isCollapsed(selection) ||
11162
+ Editor.string(editor, selection) === '') {
11131
11163
  inlineToolbar.removeAttribute('style');
11132
11164
  return;
11133
11165
  }
@@ -11150,17 +11182,28 @@ class TheInlineToolbarComponent {
11150
11182
  boundary = range.startContainer.getBoundingClientRect();
11151
11183
  }
11152
11184
  }
11185
+ const editableElement = this.contextService.getEditableElement();
11186
+ const editableRect = editableElement.getBoundingClientRect();
11153
11187
  const toolbarHeight = toolbarElement.offsetHeight;
11154
11188
  const toolbarWidth = toolbarElement.offsetWidth;
11155
11189
  const halfOffsetWidth = toolbarWidth / 2;
11156
11190
  const defaultLeft = -halfOffsetWidth;
11191
+ const offsetLeft = boundary.left - editableRect.left;
11192
+ const isTopLeft = offsetLeft - 30 > halfOffsetWidth; // 30: editable padding left
11193
+ const isTopRight = editableRect.width - offsetLeft - boundary.width / 2 < halfOffsetWidth;
11157
11194
  const positions = {};
11158
11195
  positions.top = boundary.top - toolbarHeight;
11159
- positions.left = boundary.left + boundary.width / 2 + defaultLeft;
11160
11196
  positions.right = 'initial';
11161
- ['top', 'left', 'right'].forEach(key => {
11197
+ positions.left = boundary.left;
11198
+ if (isTopLeft) {
11199
+ positions.left = boundary.left + boundary.width / 2 + defaultLeft;
11200
+ }
11201
+ if (isTopRight) {
11202
+ positions.left = boundary.right - toolbarWidth;
11203
+ }
11204
+ for (let key of Object.keys(positions)) {
11162
11205
  toolbarElement.style[key] = positions[key] + (isNaN(positions[key]) ? '' : 'px');
11163
- });
11206
+ }
11164
11207
  toolbarElement.style.opacity = '1';
11165
11208
  }
11166
11209
  ngOnDestroy() {
@@ -11168,14 +11211,14 @@ class TheInlineToolbarComponent {
11168
11211
  this.destroy$.complete();
11169
11212
  }
11170
11213
  }
11171
- TheInlineToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheInlineToolbarComponent, deps: [{ token: i0.ElementRef }, { token: i2$1.ScrollDispatcher }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
11214
+ TheInlineToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheInlineToolbarComponent, deps: [{ token: i0.ElementRef }, { token: i2$1.ScrollDispatcher }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: TheContextService }], target: i0.ɵɵFactoryTarget.Component });
11172
11215
  TheInlineToolbarComponent.ɵcmp = i0.ɵɵ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, template: `<the-toolbar
11173
11216
  #inlineToolbar
11174
11217
  class="the-inline-toolbar"
11175
11218
  [editor]="editor"
11176
11219
  [toolbarItems]="toolbarItems"
11177
11220
  [isMore]="false"
11178
- ></the-toolbar> `, isInline: true, components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "isMore", "afterTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11221
+ ></the-toolbar> `, isInline: true, components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11179
11222
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheInlineToolbarComponent, decorators: [{
11180
11223
  type: Component,
11181
11224
  args: [{
@@ -11192,7 +11235,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
11192
11235
  },
11193
11236
  changeDetection: ChangeDetectionStrategy.OnPush
11194
11237
  }]
11195
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2$1.ScrollDispatcher }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }]; }, propDecorators: { editor: [{
11238
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2$1.ScrollDispatcher }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: TheContextService }]; }, propDecorators: { editor: [{
11196
11239
  type: Input
11197
11240
  }], toolbarItems: [{
11198
11241
  type: Input
@@ -11216,13 +11259,14 @@ class TheQuickInsertComponent {
11216
11259
  event.stopPropagation();
11217
11260
  }
11218
11261
  checkStatus() {
11219
- var _a;
11220
11262
  const { editor } = this;
11221
11263
  if (isCleanEmptyParagraph(editor)) {
11222
- const block = Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
11223
- const rootNode = AngularEditor.toDOMNode(editor, block);
11224
- this.isHide = false;
11225
- this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
11264
+ setTimeout(() => {
11265
+ var _a;
11266
+ const block = Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
11267
+ const rootNode = AngularEditor.toDOMNode(editor, block);
11268
+ this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
11269
+ });
11226
11270
  return;
11227
11271
  }
11228
11272
  this.isHide = true;
@@ -11271,9 +11315,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
11271
11315
  }] } });
11272
11316
 
11273
11317
  class ThePlaceholderComponent {
11274
- constructor(renderer, elementRef) {
11318
+ constructor(renderer, elementRef, contextService) {
11275
11319
  this.renderer = renderer;
11276
11320
  this.elementRef = elementRef;
11321
+ this.contextService = contextService;
11277
11322
  this.isHide = true;
11278
11323
  }
11279
11324
  handleCompositionStart() {
@@ -11288,20 +11333,25 @@ class ThePlaceholderComponent {
11288
11333
  }
11289
11334
  }
11290
11335
  checkStatus() {
11291
- var _a, _b, _c;
11336
+ var _a, _b;
11292
11337
  const { editor } = this;
11338
+ const isEmptyShow = typeof ((_a = this.options) === null || _a === void 0 ? void 0 : _a.isEmptyShowPlaceholder) === 'undefined' ? true : this.options.isEmptyShowPlaceholder;
11339
+ const isMustShow = (_b = this.options) === null || _b === void 0 ? void 0 : _b.isMustShowPlaceholder;
11293
11340
  // empty content and no selection processing
11294
- if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.autoFocus) && !(editor === null || editor === void 0 ? void 0 : editor.selection) && isEmptyContent(editor.children)) {
11295
- // normal top is 28, but margin-top: -41px is set when maxHeight is set, so top is 69
11296
- const firstTop = ((_b = this.options) === null || _b === void 0 ? void 0 : _b.maxHeight) ? 69 : 28;
11297
- this.updatePosition(30, firstTop);
11341
+ if (isEmptyShow && isEmptyContent(editor.children)) {
11342
+ const firstElementChild = this.contextService.getFirstElementChild();
11343
+ const offsetTop = firstElementChild.offsetTop;
11344
+ const offsetLeft = firstElementChild.offsetLeft;
11345
+ this.updatePosition(offsetLeft, offsetTop);
11298
11346
  return;
11299
11347
  }
11300
- if (isCleanEmptyParagraph(editor)) {
11301
- const block = Node.ancestor(editor, [(_c = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _c === void 0 ? void 0 : _c.anchor.path[0]]);
11302
- const rootNode = AngularEditor.toDOMNode(editor, block);
11303
- this.isHide = false;
11304
- this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
11348
+ if (isMustShow && isCleanEmptyParagraph(editor)) {
11349
+ setTimeout(() => {
11350
+ var _a;
11351
+ const block = Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
11352
+ const rootNode = AngularEditor.toDOMNode(editor, block);
11353
+ this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
11354
+ });
11305
11355
  return;
11306
11356
  }
11307
11357
  this.isHide = true;
@@ -11315,7 +11365,7 @@ class ThePlaceholderComponent {
11315
11365
  this.isHide = true;
11316
11366
  }
11317
11367
  }
11318
- ThePlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: ThePlaceholderComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
11368
+ ThePlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: ThePlaceholderComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: TheContextService }], target: i0.ɵɵFactoryTarget.Component });
11319
11369
  ThePlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: { editor: "editor", options: "options" }, host: { listeners: { "document:compositionstart": "handleCompositionStart()", "document:compositionend": "handleCompositionEnd($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-placeholder" }, ngImport: i0, template: `{{ options?.placeholder }}`, isInline: true });
11320
11370
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: ThePlaceholderComponent, decorators: [{
11321
11371
  type: Component,
@@ -11327,7 +11377,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
11327
11377
  '[class.hide]': 'isHide'
11328
11378
  }
11329
11379
  }]
11330
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { editor: [{
11380
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: TheContextService }]; }, propDecorators: { editor: [{
11331
11381
  type: Input
11332
11382
  }], options: [{
11333
11383
  type: Input
@@ -11502,6 +11552,12 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
11502
11552
  this.onSlaCompositionEnd = (event) => { };
11503
11553
  this.onSlaDragStart = (event) => { };
11504
11554
  this.onSlaDragOver = (event) => { };
11555
+ this.onDrop = (event) => {
11556
+ event.stopPropagation();
11557
+ this.theOnDOMEvent.emit({
11558
+ nativeEvent: event
11559
+ });
11560
+ };
11505
11561
  }
11506
11562
  get theGlobalToolbarInstance() {
11507
11563
  return this.theGlobalToolbar ? this.theGlobalToolbar : this.globalToolbarInstance;
@@ -11519,15 +11575,18 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
11519
11575
  this.onErrorHandler();
11520
11576
  }
11521
11577
  ngOnChanges(changes) {
11522
- var _a, _b, _c;
11578
+ var _a, _b, _c, _d, _e;
11523
11579
  const options = changes.theOptions;
11524
11580
  if (options) {
11525
11581
  this.initializeOptions();
11526
11582
  }
11583
+ if (options && ((_a = options.currentValue) === null || _a === void 0 ? void 0 : _a.readonly) !== ((_b = options.previousValue) === null || _b === void 0 ? void 0 : _b.readonly)) {
11584
+ this.applyAutoFocus();
11585
+ }
11527
11586
  if (changes['theDecorate']) {
11528
11587
  this.generateDecorate();
11529
11588
  }
11530
- 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))) {
11589
+ 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))) {
11531
11590
  Transforms.deselect(this.editor);
11532
11591
  }
11533
11592
  }
@@ -11544,7 +11603,9 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
11544
11603
  this.theContextService.initialize({ nativeElement: this.elementRef.nativeElement, viewContainerRef: this.viewContainerRef });
11545
11604
  this.toolbarCalculate();
11546
11605
  setTimeout(() => {
11606
+ var _a;
11547
11607
  this.theEditorCreated.emit(this.editor);
11608
+ (_a = this.placeholderInstance) === null || _a === void 0 ? void 0 : _a.checkStatus();
11548
11609
  this.applyAutoFocus();
11549
11610
  });
11550
11611
  }
@@ -11560,9 +11621,9 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
11560
11621
  }
11561
11622
  }
11562
11623
  applyAutoFocus() {
11563
- var _a, _b, _c, _d;
11564
- 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)) {
11565
- autoFocus(this.editor, (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.autoFocus);
11624
+ var _a, _b, _c;
11625
+ if (!((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled) && !((_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.readonly)) {
11626
+ autoFocus(this.editor, (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.autoFocus);
11566
11627
  }
11567
11628
  }
11568
11629
  toolbarCalculate() {
@@ -11570,10 +11631,12 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
11570
11631
  const toolbar = (_a = this === null || this === void 0 ? void 0 : this.theOptions) === null || _a === void 0 ? void 0 : _a.toolbar;
11571
11632
  const toolbarItems = toolbarCompose(toolbar === null || toolbar === void 0 ? void 0 : toolbar.toolbarItems);
11572
11633
  const 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);
11634
+ this.globalToolbarClass = ['the-global-toolbar', getToolbarClass(this.editor)];
11573
11635
  this.toolbarEntity = toolbarOption.toolbarEntity;
11574
11636
  if (this.theGlobalToolbar) {
11575
11637
  this.theGlobalToolbarInstance.editor = this.editor;
11576
11638
  this.theGlobalToolbarInstance.toolbarItems = toolbarOption.toolbarEntity.global;
11639
+ this.theGlobalToolbarInstance.containerClass = this.globalToolbarClass;
11577
11640
  this.theGlobalToolbarInstance.align = toolbar === null || toolbar === void 0 ? void 0 : toolbar.align;
11578
11641
  this.theGlobalToolbarInstance.setToolbarClass();
11579
11642
  this.theGlobalToolbarInstance.renderToolbarView();
@@ -11592,14 +11655,14 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
11592
11655
  this.onTouchedCallback = fn;
11593
11656
  }
11594
11657
  valueChange(value) {
11595
- var _a, _b, _c, _d;
11658
+ var _a, _b, _c, _d, _e, _f;
11596
11659
  (_a = this.theGlobalToolbarInstance) === null || _a === void 0 ? void 0 : _a.statusChange(this.editor);
11597
- this.quickInsertInstance.checkStatus();
11598
- this.placeholderInstance.checkStatus();
11660
+ (_b = this.quickInsertInstance) === null || _b === void 0 ? void 0 : _b.checkStatus();
11661
+ (_c = this.placeholderInstance) === null || _c === void 0 ? void 0 : _c.checkStatus();
11599
11662
  // auto scroll view
11600
- const scrollContainer = (_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.scrollContainer;
11601
- const maxHeight = (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.maxHeight;
11602
- if (!((_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.readonly) && (scrollContainer || maxHeight)) {
11663
+ const scrollContainer = (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.scrollContainer;
11664
+ const maxHeight = (_e = this.theOptions) === null || _e === void 0 ? void 0 : _e.maxHeight;
11665
+ if (!((_f = this.theOptions) === null || _f === void 0 ? void 0 : _f.readonly) && (scrollContainer || maxHeight)) {
11603
11666
  const container = maxHeight ? DEFAULT_SCROLL_CONTAINER : scrollContainer;
11604
11667
  this.autoScrollView(this.editor, container);
11605
11668
  }
@@ -11724,7 +11787,7 @@ TheEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
11724
11787
  useExisting: forwardRef(() => TheEditorComponent),
11725
11788
  multi: true
11726
11789
  }
11727
- ], 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 }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, 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 [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 (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\" [options]=\"theOptions\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "isMore", "afterTemplate"] }, { type: i1.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", "options"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
11790
+ ], 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, 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\" [options]=\"theOptions\"></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.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", "options"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
11728
11791
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheEditorComponent, decorators: [{
11729
11792
  type: Component,
11730
11793
  args: [{
@@ -11769,7 +11832,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
11769
11832
  args: ['globalToolbar']
11770
11833
  }], quickInsertInstance: [{
11771
11834
  type: ViewChild,
11772
- args: ['quickInsert']
11835
+ args: ['quickInsert', { static: true }]
11773
11836
  }], placeholderInstance: [{
11774
11837
  type: ViewChild,
11775
11838
  args: ['placeholder']
@@ -11888,7 +11951,7 @@ class TheToolbarGroupComponent {
11888
11951
  }
11889
11952
  }
11890
11953
  TheToolbarGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarGroupComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
11891
- TheToolbarGroupComponent.ɵcmp = i0.ɵɵ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: TemplateRef, static: true }], ngImport: i0, 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.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "isMore", "afterTemplate"] }], directives: [{ type: i7.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
11954
+ TheToolbarGroupComponent.ɵcmp = i0.ɵɵ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: TemplateRef, static: true }], ngImport: i0, 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.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i7.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
11892
11955
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarGroupComponent, decorators: [{
11893
11956
  type: Component,
11894
11957
  args: [{