@worktile/theia 1.2.6 → 1.2.10

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 (186) hide show
  1. package/bundles/worktile-theia.umd.js +1151 -478
  2. package/bundles/worktile-theia.umd.js.map +1 -1
  3. package/components/inline-toolbar/inline-toolbar.component.d.ts +24 -0
  4. package/components/inline-toolbar/inline-toolbar.component.scss +18 -0
  5. package/components/nav-split-line/nav-split-line.component.d.ts +6 -1
  6. package/components/toolbar-dropdown/toolbar-dropdown.component.scss +3 -0
  7. package/components/toolbar-item/toolbar-item.component.d.ts +14 -5
  8. package/constants/code.d.ts +7 -7
  9. package/constants/default.d.ts +1 -1
  10. package/constants/node-types.d.ts +8 -8
  11. package/constants/toolbar.d.ts +6 -2
  12. package/custom-types.d.ts +5 -1
  13. package/editor.component.d.ts +6 -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/conversion-hint/conversion-hint.component.js +2 -2
  17. package/esm2015/components/inline-toolbar/inline-toolbar.component.js +123 -0
  18. package/esm2015/components/nav-split-line/nav-split-line.component.js +26 -5
  19. package/esm2015/components/toolbar/toolbar.component.js +7 -9
  20. package/esm2015/components/toolbar-base-item/toolbar-base-item.component.js +4 -3
  21. package/esm2015/components/toolbar-dropdown/toolbar-dropdown.component.js +1 -1
  22. package/esm2015/components/toolbar-item/toolbar-item.component.js +70 -24
  23. package/esm2015/constants/auto-format-rules.js +2 -2
  24. package/esm2015/constants/code.js +7 -7
  25. package/esm2015/constants/default.js +2 -2
  26. package/esm2015/constants/node-types.js +1 -2
  27. package/esm2015/constants/toolbar.js +38 -5
  28. package/esm2015/custom-types.js +1 -1
  29. package/esm2015/editor.component.js +26 -21
  30. package/esm2015/editor.module.js +20 -8
  31. package/esm2015/interfaces/editor.js +2 -4
  32. package/esm2015/interfaces/toolbar.js +1 -1
  33. package/esm2015/interfaces/valid-children-types.js +8 -2
  34. package/esm2015/plugins/align/align.editor.js +5 -2
  35. package/esm2015/plugins/align/align.plugin.js +2 -2
  36. package/esm2015/plugins/autoformat/autoformat.plugin.js +2 -2
  37. package/esm2015/plugins/autoformat/transforms/auto-format-inline.js +2 -2
  38. package/esm2015/plugins/blockquote/blockquote.editor.js +2 -2
  39. package/esm2015/plugins/blockquote/blockquote.plugin.js +11 -29
  40. package/esm2015/plugins/blockquote/options.js +2 -2
  41. package/esm2015/plugins/code/code.component.js +14 -9
  42. package/esm2015/plugins/code/code.editor.js +2 -2
  43. package/esm2015/plugins/code/options.js +2 -2
  44. package/esm2015/plugins/color/color.editor.js +4 -1
  45. package/esm2015/plugins/common/auto-insert-data..js +4 -5
  46. package/esm2015/plugins/common/block-card.plugin.js +8 -4
  47. package/esm2015/plugins/common/get-fragment.plugin.js +5 -5
  48. package/esm2015/plugins/common/move-selection.plugin.js +2 -2
  49. package/esm2015/plugins/common/remove-empty.plugin.js +2 -2
  50. package/esm2015/plugins/common/remove-void.plugin.js +2 -2
  51. package/esm2015/plugins/common/reset-type.plugin.js +2 -2
  52. package/esm2015/plugins/deserializers/deserialize-html.plugin.js +9 -2
  53. package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -2
  54. package/esm2015/plugins/heading/heading.plugin.js +2 -2
  55. package/esm2015/plugins/heading/options.js +2 -2
  56. package/esm2015/plugins/hr/hr.editor.js +2 -2
  57. package/esm2015/plugins/hr/options.js +2 -2
  58. package/esm2015/plugins/image/image.component.js +10 -10
  59. package/esm2015/plugins/image/image.editor.js +10 -4
  60. package/esm2015/plugins/image/image.plugin.js +1 -2
  61. package/esm2015/plugins/indent/indent.plugin.js +1 -1
  62. package/esm2015/plugins/indent/on-keydown-indent.js +1 -1
  63. package/esm2015/plugins/index.js +9 -5
  64. package/esm2015/plugins/link/edit/link-edit.component.js +3 -2
  65. package/esm2015/plugins/link/link.plugin.js +7 -2
  66. package/esm2015/plugins/list/list.editor.js +3 -3
  67. package/esm2015/plugins/list/list.plugin.js +11 -11
  68. package/esm2015/plugins/list/normalizers/normalize-no.js +3 -3
  69. package/esm2015/plugins/list/on-key-down-list.js +2 -2
  70. package/esm2015/plugins/list/queries/get-list-item-entry.js +2 -2
  71. package/esm2015/plugins/list/queries/get-start-list-item.js +9 -2
  72. package/esm2015/plugins/list/queries/is-in-list.js +2 -2
  73. package/esm2015/plugins/list/queries/is-node-type-list.js +1 -1
  74. package/esm2015/plugins/list/queries/is-selection-at-list-item-start.js +2 -2
  75. package/esm2015/plugins/list/queries/is-selection-in-same-list-item.js +17 -0
  76. package/esm2015/plugins/list/transforms/insert-list-data.js +2 -2
  77. package/esm2015/plugins/list/transforms/insert-list-item.js +2 -2
  78. package/esm2015/plugins/list/transforms/move-list-item-sublist-items-to-list-item-sublist.js +2 -2
  79. package/esm2015/plugins/list/transforms/move-list-item-sublist-items-to-list.js +2 -2
  80. package/esm2015/plugins/list/transforms/move-list-item-up.js +2 -2
  81. package/esm2015/plugins/list/transforms/unwrap-list.js +2 -2
  82. package/esm2015/plugins/mark/mark.editor.js +6 -2
  83. package/esm2015/plugins/node-id/node-id.plugin.js +9 -4
  84. package/esm2015/plugins/normalizers/insert-paragraph-nodes.js +2 -2
  85. package/esm2015/plugins/normalizers/trailing-node.plugin.js +2 -2
  86. package/esm2015/plugins/paint-format/options.js +54 -0
  87. package/esm2015/plugins/paint-format/paint-format.editor.js +67 -0
  88. package/esm2015/plugins/placeholder/placeholder.component.js +75 -0
  89. package/esm2015/plugins/public-api.js +2 -1
  90. package/esm2015/plugins/quick-insert/components/quick-insert.component.js +76 -0
  91. package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +75 -0
  92. package/esm2015/plugins/quick-insert/quick-insert.editor.js +61 -0
  93. package/esm2015/plugins/quick-insert/quick-insert.plugint.js +37 -0
  94. package/esm2015/plugins/table/components/row/row.component.js +3 -1
  95. package/esm2015/plugins/table/components/table.component.js +11 -7
  96. package/esm2015/plugins/table/components/td/td.component.js +2 -1
  97. package/esm2015/plugins/table/components/toolbar/table-toolbar.component.js +5 -4
  98. package/esm2015/plugins/table/table.editor.js +3 -3
  99. package/esm2015/plugins/table/table.plugin.js +8 -7
  100. package/esm2015/plugins/table/toolbar-item.component.js +3 -3
  101. package/esm2015/plugins/table/transforms/insert-table.js +3 -3
  102. package/esm2015/plugins/table/utils/calc-anchor-position.js +6 -5
  103. package/esm2015/plugins/table/utils/merge-cell.js +3 -3
  104. package/esm2015/plugins/table/utils/split-cell.js +3 -3
  105. package/esm2015/plugins/todo-item/todo-item.component.js +2 -2
  106. package/esm2015/plugins/todo-item/todo-item.editor.js +2 -2
  107. package/esm2015/plugins/todo-item/todo-item.plugin.js +2 -2
  108. package/esm2015/plugins/vertical-align/toolbar-item.component.js +12 -4
  109. package/esm2015/public-api.js +4 -3
  110. package/esm2015/queries/get-container-blocks.js +3 -3
  111. package/esm2015/queries/get-selection-nodes-by-type.js +1 -1
  112. package/esm2015/queries/index.js +2 -58
  113. package/esm2015/queries/is-block-active.js +1 -1
  114. package/esm2015/queries/is-include-types.js +1 -1
  115. package/esm2015/services/context.service.js +9 -2
  116. package/esm2015/services/toolbar.service.js +5 -5
  117. package/esm2015/transforms/apply-deep-to-nodes.js +2 -2
  118. package/esm2015/transforms/delete-element.js +2 -2
  119. package/esm2015/transforms/handle-continual-delete-backward.js +18 -0
  120. package/esm2015/transforms/handle-continual-insert-break.js +23 -0
  121. package/esm2015/transforms/index.js +4 -20
  122. package/esm2015/transforms/insert-element-next.js +2 -2
  123. package/esm2015/transforms/insert-elements.js +2 -2
  124. package/esm2015/transforms/move-children.js +2 -2
  125. package/esm2015/transforms/on-keydown-reset-block-type.js +2 -2
  126. package/esm2015/transforms/set-node.js +2 -2
  127. package/esm2015/transforms/split-node.js +2 -2
  128. package/esm2015/transforms/un-wrap.js +1 -1
  129. package/esm2015/utils/auto-focus.js +2 -2
  130. package/esm2015/utils/fragment.js +3 -3
  131. package/esm2015/utils/is-clean-empty-paragraph.js +32 -0
  132. package/esm2015/utils/weak-maps.js +2 -1
  133. package/fesm2015/worktile-theia.js +1195 -534
  134. package/fesm2015/worktile-theia.js.map +1 -1
  135. package/interfaces/editor.d.ts +1 -96
  136. package/interfaces/toolbar.d.ts +3 -2
  137. package/interfaces/valid-children-types.d.ts +4 -4
  138. package/package.json +1 -1
  139. package/plugins/code/code.component.d.ts +3 -2
  140. package/plugins/color/color.editor.d.ts +1 -1
  141. package/plugins/common/get-fragment.plugin.d.ts +2 -2
  142. package/plugins/image/image.component.d.ts +1 -0
  143. package/plugins/image/image.component.scss +11 -1
  144. package/plugins/indent/indent.plugin.d.ts +2 -2
  145. package/plugins/indent/on-keydown-indent.d.ts +2 -2
  146. package/plugins/list/queries/get-start-list-item.d.ts +8 -2
  147. package/plugins/list/queries/is-selection-in-same-list-item.d.ts +5 -0
  148. package/plugins/mark/mark.editor.d.ts +1 -1
  149. package/plugins/normalizers/insert-paragraph-nodes.d.ts +2 -2
  150. package/plugins/normalizers/trailing-node.plugin.d.ts +2 -2
  151. package/plugins/paint-format/options.d.ts +2 -0
  152. package/plugins/paint-format/paint-format.editor.d.ts +7 -0
  153. package/{components → plugins}/placeholder/placeholder.component.d.ts +5 -6
  154. package/{components → plugins}/placeholder/placeholder.component.scss +0 -0
  155. package/plugins/public-api.d.ts +1 -0
  156. package/plugins/quick-insert/components/quick-insert.component.d.ts +25 -0
  157. package/plugins/quick-insert/components/quick-insert.component.scss +21 -0
  158. package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.d.ts +29 -0
  159. package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.scss +21 -0
  160. package/plugins/quick-insert/quick-insert.editor.d.ts +8 -0
  161. package/plugins/quick-insert/quick-insert.plugint.d.ts +2 -0
  162. package/plugins/table/components/table.component.d.ts +1 -0
  163. package/plugins/table/components/table.component.scss +1 -1
  164. package/plugins/table/toolbar-item.component.d.ts +1 -2
  165. package/plugins/table/utils/split-cell.d.ts +1 -2
  166. package/plugins/todo-item/todo-item.component.scss +0 -6
  167. package/plugins/vertical-align/toolbar-item.component.d.ts +1 -0
  168. package/public-api.d.ts +3 -2
  169. package/queries/get-container-blocks.d.ts +2 -2
  170. package/queries/get-selection-nodes-by-type.d.ts +2 -2
  171. package/queries/index.d.ts +55 -73
  172. package/queries/is-block-active.d.ts +2 -2
  173. package/queries/is-include-types.d.ts +2 -2
  174. package/services/context.service.d.ts +9 -0
  175. package/services/toolbar.service.d.ts +1 -1
  176. package/styles/editor.scss +41 -15
  177. package/styles/index.scss +5 -2
  178. package/styles/typo.scss +4 -2
  179. package/transforms/handle-continual-delete-backward.d.ts +3 -0
  180. package/transforms/handle-continual-insert-break.d.ts +3 -0
  181. package/transforms/index.d.ts +20 -27
  182. package/transforms/split-node.d.ts +2 -2
  183. package/transforms/un-wrap.d.ts +2 -2
  184. package/utils/is-clean-empty-paragraph.d.ts +8 -0
  185. package/utils/weak-maps.d.ts +1 -0
  186. package/esm2015/components/placeholder/placeholder.component.js +0 -88
@@ -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.i5$1, global.i5$3, global.i1$4, global.i5$2, global.isUrl, global.i1$5, global.i2$2, global.i5$4, 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, i5$1, i5$3, i1$4, i5$2, isUrl, i1$5, i2$2, i5$4, 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
 
@@ -39,15 +39,16 @@
39
39
  var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
40
40
  var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
41
41
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2$1);
42
- var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
43
- var i5__namespace$3 = /*#__PURE__*/_interopNamespace(i5$3);
44
- var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$4);
42
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
45
43
  var i5__namespace$2 = /*#__PURE__*/_interopNamespace(i5$2);
44
+ var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$4);
45
+ var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
46
46
  var isUrl__default = /*#__PURE__*/_interopDefaultLegacy(isUrl);
47
47
  var i1__namespace$5 = /*#__PURE__*/_interopNamespace(i1$5);
48
48
  var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
49
- var i5__namespace$4 = /*#__PURE__*/_interopNamespace(i5$4);
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.
@@ -368,7 +369,7 @@
368
369
  }
369
370
 
370
371
  var PICTURE_ACCEPTED_UPLOAD_MIME = ['image/png', 'image/jpeg', 'image/gif', 'image/bmp'];
371
- var PICTURE_ACCEPTED_UPLOAD_SIZE = 10;
372
+ var PICTURE_ACCEPTED_UPLOAD_SIZE = 20;
372
373
  var A_TAG_REL_ATTR = 'noopener noreferrer nofollow external ugc';
373
374
  var LINK_DEFAULT_TEXT = '链接';
374
375
  var TAB_SPACE = ' ';
@@ -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,
@@ -497,6 +502,7 @@
497
502
  exports.ToolbarActionTypes.split,
498
503
  exports.ElementKinds.numberedList,
499
504
  exports.ElementKinds.bulletedList,
505
+ exports.ElementKinds.checkItem,
500
506
  exports.ToolbarActionTypes.split,
501
507
  exports.ElementKinds.link,
502
508
  exports.ElementKinds.image,
@@ -504,8 +510,34 @@
504
510
  exports.ElementKinds.blockquote,
505
511
  exports.ElementKinds.code
506
512
  ];
507
- var DefaultInlineToolbarDefinition = [];
508
- 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
+ ]);
509
541
  var ToolbarMoreGroup = {
510
542
  key: 'more',
511
543
  icon: 'more'
@@ -585,20 +617,20 @@
585
617
  value: 'htmlmixed'
586
618
  }
587
619
  ];
588
- var EditorMode = {
620
+ var CodeMode = {
589
621
  default: 'default',
590
622
  print: 'print'
591
623
  };
592
- var TheEditorConfig = /** @class */ (function () {
593
- function TheEditorConfig() {
624
+ var TheCodeMode = /** @class */ (function () {
625
+ function TheCodeMode() {
594
626
  }
595
- return TheEditorConfig;
627
+ return TheCodeMode;
596
628
  }());
597
- var THE_EDITOR_CONFIG_TOKEN = new i0.InjectionToken('the-editor-config');
598
- var THE_EDITOR_CONFIG_PROVIDER = {
599
- provide: THE_EDITOR_CONFIG_TOKEN,
629
+ var THE_CODE_MODE_TOKEN = new i0.InjectionToken('the-code-mode');
630
+ var THE_CODE_MODE_PROVIDER = {
631
+ provide: THE_CODE_MODE_TOKEN,
600
632
  useValue: {
601
- mode: EditorMode.default
633
+ mode: CodeMode.default
602
634
  }
603
635
  };
604
636
  var CODEMIRROR_PADDING_TOP = 10;
@@ -699,6 +731,73 @@
699
731
  }]
700
732
  }] });
701
733
 
734
+ var TheEditor = Object.assign({}, i1.AngularEditor);
735
+ exports.TheDataMode = void 0;
736
+ (function (TheDataMode) {
737
+ TheDataMode["json"] = "json";
738
+ TheDataMode["html"] = "html";
739
+ })(exports.TheDataMode || (exports.TheDataMode = {}));
740
+
741
+ exports.ToolbarItemType = void 0;
742
+ (function (ToolbarItemType) {
743
+ ToolbarItemType["default"] = "default";
744
+ ToolbarItemType["toolDropdown"] = "tool-dropdown";
745
+ })(exports.ToolbarItemType || (exports.ToolbarItemType = {}));
746
+ exports.ToolbarAlignment = void 0;
747
+ (function (ToolbarAlignment) {
748
+ ToolbarAlignment["left"] = "start";
749
+ ToolbarAlignment["center"] = "center";
750
+ ToolbarAlignment["right"] = "end";
751
+ })(exports.ToolbarAlignment || (exports.ToolbarAlignment = {}));
752
+
753
+ var THE_UPLOAD_SERVICE_TOKEN = new i0.InjectionToken('THE_UPLOAD_SERVICE_TOKEN');
754
+
755
+ var inValidTypes = [
756
+ exports.ElementKinds.table,
757
+ exports.ElementKinds.tableCell,
758
+ exports.ElementKinds.blockquote,
759
+ exports.ElementKinds.hr,
760
+ exports.ElementKinds.code
761
+ ];
762
+ var DefaultElementOptions = [
763
+ {
764
+ type: exports.ElementKinds.bulletedList,
765
+ inValidChildrenTypes: __spreadArray(__spreadArray([], __read(inValidTypes)), __read(HEADING_TYPES))
766
+ },
767
+ {
768
+ type: exports.ElementKinds.numberedList,
769
+ inValidChildrenTypes: __spreadArray(__spreadArray([], __read(inValidTypes)), __read(HEADING_TYPES))
770
+ },
771
+ {
772
+ type: exports.ElementKinds.listItem,
773
+ inValidChildrenTypes: __spreadArray(__spreadArray([], __read(inValidTypes)), __read(HEADING_TYPES))
774
+ },
775
+ {
776
+ type: exports.ElementKinds.blockquote,
777
+ inValidChildrenTypes: inValidTypes
778
+ },
779
+ {
780
+ type: exports.ElementKinds.table,
781
+ inValidChildrenTypes: [exports.ElementKinds.table]
782
+ },
783
+ {
784
+ type: exports.ElementKinds.tableCell,
785
+ inValidChildrenTypes: [exports.ElementKinds.table, exports.ElementKinds.tableCell]
786
+ }
787
+ ];
788
+
789
+ function idCreator(length) {
790
+ if (length === void 0) { length = 5; }
791
+ // remove numeral
792
+ var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
793
+ var maxPosition = $chars.length;
794
+ var key = '';
795
+ for (var i = 0; i < length; i++) {
796
+ key += $chars.charAt(Math.floor(Math.random() * maxPosition));
797
+ }
798
+ return key;
799
+ }
800
+
702
801
  var isAncestor = function (node) { return slate.Element.isElement(node) || slate.Editor.isEditor(node); };
703
802
 
704
803
  var getLastChild$1 = function (node, level) {
@@ -1317,6 +1416,7 @@
1317
1416
  return fragment;
1318
1417
  };
1319
1418
  var extractFragment = function (data, deleteKey) {
1419
+ if (deleteKey === void 0) { deleteKey = ELEMENT_UNIQUE_ID; }
1320
1420
  var fragment = data.getData("application/" + CLIPBOARD_FORMAT_KEY);
1321
1421
  if (fragment) {
1322
1422
  var decoded = decodeURIComponent(window.atob(fragment));
@@ -1474,13 +1574,14 @@
1474
1574
  var getContainerBlocks = function (editor) {
1475
1575
  var containerNode = slate.Editor.above(editor, {
1476
1576
  match: function (node) {
1477
- return slate.Element.isElement(node) && TheEditor.isContainer(editor, node) && !CONTAINER_BLOCKS.includes(node.type);
1577
+ return slate.Element.isElement(node) && isContainer(editor, node) && !CONTAINER_BLOCKS.includes(node.type);
1478
1578
  }
1479
1579
  });
1480
1580
  return !containerNode ? CONTAINER_BLOCKS : __spreadArray(__spreadArray([], __read(CONTAINER_BLOCKS)), [containerNode[0].type]);
1481
1581
  };
1482
1582
 
1483
- var TheQueries = {
1583
+ var index$1 = /*#__PURE__*/Object.freeze({
1584
+ __proto__: null,
1484
1585
  getLastNode: getLastNode,
1485
1586
  getAnchorBlockEntry: getAnchorBlockEntry,
1486
1587
  getAboveByType: getAboveByType,
@@ -1536,7 +1637,7 @@
1536
1637
  findNode: findNode,
1537
1638
  findDescendant: findDescendant,
1538
1639
  someNode: someNode
1539
- };
1640
+ });
1540
1641
 
1541
1642
  var setMarks = function (editor, marks, at) {
1542
1643
  slate.Transforms.setNodes(editor, marks, {
@@ -1572,8 +1673,8 @@
1572
1673
  if (slate.Range.isExpanded(editor.selection)) {
1573
1674
  slate.Editor.deleteFragment(editor);
1574
1675
  }
1575
- var anchorBlockPath = TheQueries.anchorBlockEntry(editor)[1];
1576
- var isEmpty = TheQueries.isEmptyParagraph(editor);
1676
+ var anchorBlockPath = anchorBlockEntry(editor)[1];
1677
+ var isEmpty = isEmptyParagraph(editor);
1577
1678
  var nextPath = slate.Path.next([anchorBlockPath[0]]);
1578
1679
  slate.Transforms.insertNodes(editor, node, { at: nextPath });
1579
1680
  if (isEmpty && anchorBlockPath.length === 1) {
@@ -1586,7 +1687,7 @@
1586
1687
  };
1587
1688
 
1588
1689
  var setNode = function (editor, props, origin) {
1589
- slate.Transforms.setNodes(editor, props, { at: TheQueries.findPath(editor, origin) });
1690
+ slate.Transforms.setNodes(editor, props, { at: findPath(editor, origin) });
1590
1691
  };
1591
1692
 
1592
1693
  /**
@@ -1608,7 +1709,7 @@
1608
1709
  rules.forEach(function (_a) {
1609
1710
  var types = _a.types, defaultType = _a.defaultType, hotkey = _a.hotkey, predicate = _a.predicate, onReset = _a.onReset;
1610
1711
  if (!event || (hotkey && isHotkey__default["default"](hotkey, event))) {
1611
- if (predicate(editor) && TheQueries.isNodeTypeIn(editor, types)) {
1712
+ if (predicate(editor) && isNodeTypeIn(editor, types)) {
1612
1713
  if (event !== null) {
1613
1714
  event.preventDefault();
1614
1715
  }
@@ -1635,7 +1736,7 @@
1635
1736
  return moved;
1636
1737
  for (var i = parentNode.children.length - 1; i >= start; i--) {
1637
1738
  var childPath = __spreadArray(__spreadArray([], __read(parentPath)), [i]);
1638
- var childNode = TheQueries.getNode(editor, childPath);
1739
+ var childNode = getNode(editor, childPath);
1639
1740
  if (!match || (childNode && match([childNode, childPath]))) {
1640
1741
  slate.Transforms.moveNodes(editor, { at: childPath, to: to });
1641
1742
  moved++;
@@ -1644,18 +1745,6 @@
1644
1745
  return moved;
1645
1746
  };
1646
1747
 
1647
- function idCreator(length) {
1648
- if (length === void 0) { length = 5; }
1649
- // remove numeral
1650
- var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
1651
- var maxPosition = $chars.length;
1652
- var key = '';
1653
- for (var i = 0; i < length; i++) {
1654
- key += $chars.charAt(Math.floor(Math.random() * maxPosition));
1655
- }
1656
- return key;
1657
- }
1658
-
1659
1748
  var createEmptyParagraph = function () {
1660
1749
  return {
1661
1750
  type: exports.ElementKinds.paragraph,
@@ -1678,7 +1767,7 @@
1678
1767
  var applyDeepToNodes = function (_a) {
1679
1768
  var node = _a.node, source = _a.source, apply = _a.apply, query = _a.query;
1680
1769
  var entry = [node, []];
1681
- if (TheQueries.isNodeType(entry, query)) {
1770
+ if (isNodeType(entry, query)) {
1682
1771
  if (source instanceof Function) {
1683
1772
  apply(node, source());
1684
1773
  }
@@ -1686,7 +1775,7 @@
1686
1775
  apply(node, source);
1687
1776
  }
1688
1777
  }
1689
- if (!TheQueries.isAncestor(node)) {
1778
+ if (!isAncestor(node)) {
1690
1779
  return;
1691
1780
  }
1692
1781
  node.children.forEach(function (child) {
@@ -1713,7 +1802,7 @@
1713
1802
 
1714
1803
  var splitNode = function (editor, indivisibleTypes) {
1715
1804
  var selection = editor.selection;
1716
- var indivisibleType = indivisibleTypes && indivisibleTypes.find(function (item) { return TheQueries.getAboveByType(editor, item, { mode: 'highest' }); });
1805
+ var indivisibleType = indivisibleTypes && indivisibleTypes.find(function (item) { return getAboveByType(editor, item, { mode: 'highest' }); });
1717
1806
  var splitPath;
1718
1807
  if (!indivisibleType) {
1719
1808
  slate.Transforms.splitNodes(editor, {
@@ -1728,7 +1817,7 @@
1728
1817
  mode: 'highest',
1729
1818
  match: function (data) {
1730
1819
  if (data.type && !indivisibleTypes.includes(data.type)) {
1731
- var _a = __read(TheQueries.getNodesByType(editor, data.type, { at: selection }), 1), node = _a[0];
1820
+ var _a = __read(getNodesByType(editor, data.type, { at: selection }), 1), node = _a[0];
1732
1821
  var parentNode = slate.Editor.parent(editor, node[1]);
1733
1822
  if (indivisibleTypes.includes(parentNode[0].type)) {
1734
1823
  splitPath = node[1];
@@ -1742,7 +1831,7 @@
1742
1831
  };
1743
1832
 
1744
1833
  var deleteElement = function (editor, element) {
1745
- var at = TheQueries.findPath(editor, element);
1834
+ var at = findPath(editor, element);
1746
1835
  slate.Transforms.insertNodes(editor, createEmptyParagraph(), { at: at });
1747
1836
  i1.AngularEditor.focus(editor);
1748
1837
  slate.Transforms.select(editor, at);
@@ -1760,11 +1849,11 @@
1760
1849
  if (slate.Range.isExpanded(editor.selection)) {
1761
1850
  slate.Editor.deleteFragment(editor);
1762
1851
  }
1763
- var isEmptyParagraph = TheQueries.isEmptyParagraph(editor, editor.selection.anchor);
1852
+ var isEmptyParagraph$1 = isEmptyParagraph(editor, editor.selection.anchor);
1764
1853
  var parentPath = slate.Path.parent(editor.selection.anchor.path);
1765
1854
  slate.Editor.withoutNormalizing(editor, function () {
1766
1855
  slate.Transforms.insertNodes(editor, nodes);
1767
- if (parentPath.length && isEmptyParagraph) {
1856
+ if (parentPath.length && isEmptyParagraph$1) {
1768
1857
  slate.Transforms.delete(editor, { at: parentPath });
1769
1858
  var lastPath = parentPath.pop();
1770
1859
  slate.Transforms.select(editor, slate.Editor.end(editor, __spreadArray(__spreadArray([], __read(parentPath)), [lastPath + nodes.length - 1])));
@@ -1778,6 +1867,7 @@
1778
1867
 
1779
1868
  var THE_EDITOR_UUID = new WeakMap();
1780
1869
  var THE_EDITOR_CONVERSION_HINT_REF = new WeakMap();
1870
+ var THE_EDITOR_QUICK_TOOLBAR_REF = new WeakMap();
1781
1871
 
1782
1872
  var closeConversionHint = function (editor) {
1783
1873
  var hintRef = THE_EDITOR_CONVERSION_HINT_REF.get(editor);
@@ -1786,7 +1876,44 @@
1786
1876
  }
1787
1877
  };
1788
1878
 
1789
- var TheTransforms = {
1879
+ function handleContinualDeleteBackward(editor, aboveResult, type) {
1880
+ var highestBlock = aboveResult[0];
1881
+ var lowestBlock = anchorBlock(editor);
1882
+ var wrapBlockType = highestBlock.type;
1883
+ if (lowestBlock && slate.Editor.isStart(editor, editor.selection.anchor, aboveResult[1])) {
1884
+ if (wrapBlockType === type) {
1885
+ if (highestBlock.children[0] === lowestBlock) {
1886
+ unWrap(editor, wrapBlockType);
1887
+ return true;
1888
+ }
1889
+ }
1890
+ }
1891
+ return false;
1892
+ }
1893
+
1894
+ function handleContinualInsertBreak(editor, lowestBlock, type) {
1895
+ var isEmpty = slate.Editor.isEmpty(editor, lowestBlock);
1896
+ var isEnd = slate.Editor.isEnd(editor, editor.selection.anchor, editor.selection.focus.path);
1897
+ var aboveResult = slate.Editor.above(editor, {
1898
+ match: function (n) { return slate.Editor.isBlock(editor, n) && n.type === type; }
1899
+ });
1900
+ if (isEnd) {
1901
+ editor.marks = {};
1902
+ }
1903
+ if (aboveResult && aboveResult[0] && isEnd && isEmpty) {
1904
+ var wrapBlock = aboveResult[0];
1905
+ if (wrapBlock.type === type) {
1906
+ if (wrapBlock.children[wrapBlock.children.length - 1] === lowestBlock) {
1907
+ unWrap(editor, wrapBlock.type);
1908
+ return true;
1909
+ }
1910
+ }
1911
+ }
1912
+ return false;
1913
+ }
1914
+
1915
+ var index = /*#__PURE__*/Object.freeze({
1916
+ __proto__: null,
1790
1917
  setMarks: setMarks,
1791
1918
  clearMarks: clearMarks,
1792
1919
  insertElement: insertElement,
@@ -1803,57 +1930,10 @@
1803
1930
  deleteElement: deleteElement,
1804
1931
  setEndSelection: setEndSelection,
1805
1932
  insertTheElements: insertTheElements,
1806
- closeConversionHint: closeConversionHint
1807
- };
1808
-
1809
- var TheEditor = Object.assign(Object.assign(Object.assign({}, i1.AngularEditor), TheQueries), TheTransforms);
1810
- exports.TheDataMode = void 0;
1811
- (function (TheDataMode) {
1812
- TheDataMode["json"] = "json";
1813
- TheDataMode["html"] = "html";
1814
- })(exports.TheDataMode || (exports.TheDataMode = {}));
1815
-
1816
- exports.ToolbarItemType = void 0;
1817
- (function (ToolbarItemType) {
1818
- ToolbarItemType["default"] = "default";
1819
- ToolbarItemType["toolDropdown"] = "tool-dropdown";
1820
- })(exports.ToolbarItemType || (exports.ToolbarItemType = {}));
1821
- exports.ToolbarAlignment = void 0;
1822
- (function (ToolbarAlignment) {
1823
- ToolbarAlignment["left"] = "start";
1824
- ToolbarAlignment["center"] = "center";
1825
- ToolbarAlignment["right"] = "end";
1826
- })(exports.ToolbarAlignment || (exports.ToolbarAlignment = {}));
1827
-
1828
- var THE_UPLOAD_SERVICE_TOKEN = new i0.InjectionToken('THE_UPLOAD_SERVICE_TOKEN');
1829
-
1830
- var inValidTypes = [exports.ElementKinds.table, exports.ElementKinds.tableCell, exports.ElementKinds.blockquote, exports.ElementKinds.hr, exports.ElementKinds.code];
1831
- var DefaultElementOptions = [
1832
- {
1833
- type: exports.ElementKinds.bulletedList,
1834
- inValidChildrenTypes: __spreadArray(__spreadArray([], __read(inValidTypes)), __read(HEADING_TYPES))
1835
- },
1836
- {
1837
- type: exports.ElementKinds.numberedList,
1838
- inValidChildrenTypes: __spreadArray(__spreadArray([], __read(inValidTypes)), __read(HEADING_TYPES))
1839
- },
1840
- {
1841
- type: exports.ElementKinds.listItem,
1842
- inValidChildrenTypes: __spreadArray(__spreadArray([], __read(inValidTypes)), __read(HEADING_TYPES))
1843
- },
1844
- {
1845
- type: exports.ElementKinds.blockquote,
1846
- inValidChildrenTypes: inValidTypes
1847
- },
1848
- {
1849
- type: exports.ElementKinds.table,
1850
- inValidChildrenTypes: [exports.ElementKinds.table]
1851
- },
1852
- {
1853
- type: exports.ElementKinds.tableCell,
1854
- inValidChildrenTypes: [exports.ElementKinds.table, exports.ElementKinds.tableCell]
1855
- }
1856
- ];
1933
+ closeConversionHint: closeConversionHint,
1934
+ handleContinualDeleteBackward: handleContinualDeleteBackward,
1935
+ handleContinualInsertBreak: handleContinualInsertBreak
1936
+ });
1857
1937
 
1858
1938
  var isNodeTypeList = function (n) {
1859
1939
  return [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList].includes(n.type);
@@ -1924,8 +2004,8 @@
1924
2004
  },
1925
2005
  unwrapList: function (editor) {
1926
2006
  slate.Editor.withoutNormalizing(editor, function () {
1927
- TheTransforms.unwrapNodesByType(editor, [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList], { split: true, mode: 'all' });
1928
- TheTransforms.unwrapNodesByType(editor, [exports.ElementKinds.listItem], { split: true, mode: 'all' });
2007
+ unwrapNodesByType(editor, [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList], { split: true, mode: 'all' });
2008
+ unwrapNodesByType(editor, [exports.ElementKinds.listItem], { split: true, mode: 'all' });
1929
2009
  });
1930
2010
  },
1931
2011
  wrapList: function (editor, type) {
@@ -1943,11 +2023,11 @@
1943
2023
  });
1944
2024
  },
1945
2025
  isActive: function (editor, type) {
1946
- var _a = __read(TheQueries.getNodesByType(editor, type), 1), match = _a[0];
2026
+ var _a = __read(getNodesByType(editor, type), 1), match = _a[0];
1947
2027
  return !!match;
1948
2028
  },
1949
2029
  getActiveList: function (editor) {
1950
- var _a = __read(TheQueries.getNodesByType(editor, LIST_BLOCK_TYPES), 1), match = _a[0];
2030
+ var _a = __read(getNodesByType(editor, LIST_BLOCK_TYPES), 1), match = _a[0];
1951
2031
  return match;
1952
2032
  },
1953
2033
  buildListItem: function (editor) {
@@ -1991,7 +2071,7 @@
1991
2071
 
1992
2072
  var TodoItemEditor = {
1993
2073
  isActive: function (editor) {
1994
- var _a = __read(TheQueries.getNodesByType(editor, exports.ElementKinds.checkItem), 1), match = _a[0];
2074
+ var _a = __read(getNodesByType(editor, exports.ElementKinds.checkItem), 1), match = _a[0];
1995
2075
  return !!match;
1996
2076
  },
1997
2077
  insertTodoItem: function (editor) {
@@ -2019,7 +2099,7 @@
2019
2099
 
2020
2100
  var BlockquoteEditor = {
2021
2101
  toggleBlockquote: function (editor) {
2022
- if (!TheQueries.isParagraph(editor)) {
2102
+ if (!isParagraph(editor)) {
2023
2103
  slate.Transforms.insertNodes(editor, {
2024
2104
  type: exports.ElementKinds.paragraph,
2025
2105
  mode: 'text',
@@ -2030,7 +2110,7 @@
2030
2110
  ]
2031
2111
  });
2032
2112
  }
2033
- var isActive = TheQueries.isBlockActive(editor, exports.ElementKinds.blockquote);
2113
+ var isActive = isBlockActive(editor, exports.ElementKinds.blockquote);
2034
2114
  if (!isActive) {
2035
2115
  slate.Transforms.wrapNodes(editor, { type: exports.ElementKinds.blockquote, children: [] }, {
2036
2116
  mode: 'lowest'
@@ -2119,7 +2199,7 @@
2119
2199
  type: exports.ElementKinds.listItem,
2120
2200
  markup: [],
2121
2201
  match: function (editor) {
2122
- return TheQueries.isParagraph(editor) ? ['*', '-', '+'] : [];
2202
+ return isParagraph(editor) ? ['*', '-', '+'] : [];
2123
2203
  },
2124
2204
  format: function (editor) {
2125
2205
  ListEditor.toggleList(editor, exports.ElementKinds.bulletedList);
@@ -2129,7 +2209,7 @@
2129
2209
  type: exports.ElementKinds.listItem,
2130
2210
  markup: [],
2131
2211
  match: function (editor, textFromBlockStart) {
2132
- return TheQueries.isParagraph(editor) && /^-?\d+(\.|\))$/.test(textFromBlockStart) ? [textFromBlockStart] : [];
2212
+ return isParagraph(editor) && /^-?\d+(\.|\))$/.test(textFromBlockStart) ? [textFromBlockStart] : [];
2133
2213
  },
2134
2214
  format: function (editor, markup) {
2135
2215
  var startIndex = 1;
@@ -2146,7 +2226,7 @@
2146
2226
  type: exports.ElementKinds.checkItem,
2147
2227
  markup: [],
2148
2228
  match: function (editor) {
2149
- return TheQueries.isParagraph(editor) ? ['[]'] : [];
2229
+ return isParagraph(editor) ? ['[]'] : [];
2150
2230
  },
2151
2231
  format: function (editor) {
2152
2232
  TodoItemEditor.insertTodoItem(editor);
@@ -2209,7 +2289,7 @@
2209
2289
  var _this = this;
2210
2290
  this.closeTimer = setInterval(function () {
2211
2291
  clearInterval(_this.closeTimer);
2212
- TheTransforms.closeConversionHint(_this.editor);
2292
+ closeConversionHint(_this.editor);
2213
2293
  }, this.duration);
2214
2294
  };
2215
2295
  TheConversionHintComponent.prototype.clearCloseTimer = function () {
@@ -2300,7 +2380,7 @@
2300
2380
  var withDeserializeMd = function (options) { return function (editor) {
2301
2381
  var insertData = editor.insertData, onKeydown = editor.onKeydown;
2302
2382
  editor.onKeydown = function (event) {
2303
- TheTransforms.closeConversionHint(editor);
2383
+ closeConversionHint(editor);
2304
2384
  onKeydown(event);
2305
2385
  };
2306
2386
  editor.insertData = function (data) {
@@ -2310,7 +2390,7 @@
2310
2390
  var plainFragment = data.getData('text/plain');
2311
2391
  var slateFragment = data.getData("application/" + CLIPBOARD_FORMAT_KEY);
2312
2392
  var oldRange = editor.selection;
2313
- TheTransforms.closeConversionHint(editor);
2393
+ closeConversionHint(editor);
2314
2394
  if (plainFragment && isMarkdownStynx(plainFragment) && !slateFragment) {
2315
2395
  setTimeout(function () {
2316
2396
  var overlay = editor.injector.get(i2.Overlay);
@@ -2328,11 +2408,11 @@
2328
2408
  var htmlDom = new DOMParser().parseFromString(html, 'text/html');
2329
2409
  var fragment_1 = selene.TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
2330
2410
  if (!isUnformatted(fragment_1)) {
2331
- TheTransforms.closeConversionHint(editor);
2411
+ closeConversionHint(editor);
2332
2412
  editor.undo();
2333
2413
  setTimeout(function () {
2334
2414
  slate.Transforms.select(editor, oldRange);
2335
- TheTransforms.insertTheElements(editor, fragment_1);
2415
+ insertTheElements(editor, fragment_1);
2336
2416
  i1.AngularEditor.focus(editor);
2337
2417
  });
2338
2418
  return;
@@ -2410,13 +2490,13 @@
2410
2490
  allElementOptions = Object.values(extraInfo);
2411
2491
  }
2412
2492
  var indivisibleTypes = allElementOptions.filter(function (item) { return item.isIndivisible; }).map(function (item) { return item.type; });
2413
- var fragment = extractFragment(data, ELEMENT_UNIQUE_ID);
2493
+ var fragment = extractFragment(data);
2414
2494
  if (fragment) {
2415
- if (TheQueries.isAcrossBlocks(editor, fragment) || slate.Editor.isVoid(editor, fragment[0])) {
2495
+ if (isAcrossBlocks(editor, fragment) || slate.Editor.isVoid(editor, fragment[0])) {
2416
2496
  var selection = editor.selection;
2417
2497
  var _b = __read(slate.Editor.edges(editor, selection), 1), start_1 = _b[0];
2418
2498
  // query whether there is a node to be verified
2419
- var tryVerifyNode_1 = allElementOptions.find(function (item) { return TheQueries.getAboveByType(editor, item.type, { at: start_1, mode: 'lowest' }); });
2499
+ var tryVerifyNode_1 = allElementOptions.find(function (item) { return getAboveByType(editor, item.type, { at: start_1, mode: 'lowest' }); });
2420
2500
  if (tryVerifyNode_1) {
2421
2501
  // is exist invalid element type in fragment
2422
2502
  var invalidIndex = fragment.findIndex(function (item) { return tryVerifyNode_1.inValidChildrenTypes.includes(item.type); });
@@ -2430,7 +2510,7 @@
2430
2510
  });
2431
2511
  }
2432
2512
  // split node
2433
- var path = TheTransforms.splitNode(editor, indivisibleTypes);
2513
+ var path = splitNode(editor, indivisibleTypes);
2434
2514
  slate.Transforms.insertNodes(editor, invalidFragmentData_1, {
2435
2515
  at: slate.Path.next(path)
2436
2516
  });
@@ -2439,10 +2519,10 @@
2439
2519
  }
2440
2520
  }
2441
2521
  slate.Editor.withoutNormalizing(editor, function () {
2442
- var isEmptyParagraph = TheQueries.isEmptyParagraph(editor, editor.selection.anchor);
2522
+ var isEmptyParagraph$1 = isEmptyParagraph(editor, editor.selection.anchor);
2443
2523
  var emptyPath = slate.Path.parent(editor.selection.anchor.path);
2444
2524
  slate.Transforms.insertNodes(editor, fragment);
2445
- if (isEmptyParagraph) {
2525
+ if (isEmptyParagraph$1) {
2446
2526
  slate.Transforms.delete(editor, { at: emptyPath });
2447
2527
  var lastPath = emptyPath.pop();
2448
2528
  slate.Transforms.select(editor, __spreadArray(__spreadArray([], __read(emptyPath)), [lastPath + fragment.length - 1]));
@@ -2483,16 +2563,16 @@
2483
2563
  var deleteBackward = editor.deleteBackward, deleteForward = editor.deleteForward;
2484
2564
  editor.deleteBackward = function (unit) {
2485
2565
  var selection = editor.selection;
2486
- var anchorBlock = TheQueries.anchorBlock(editor);
2487
- if (!anchorBlock) {
2566
+ var anchorBlock$1 = anchorBlock(editor);
2567
+ if (!anchorBlock$1) {
2488
2568
  deleteBackward(unit);
2489
2569
  return;
2490
2570
  }
2491
2571
  // delete empty paragraphs or empty headings, the default operation is to delete before the void node
2492
2572
  var parentPath = slate.Path.parent(editor.selection.anchor.path);
2493
- var isEmptyHeading = HEADING_TYPES.includes(anchorBlock.type) && slate.Editor.isEmpty(editor, anchorBlock);
2494
- var isEmptyParagraph = TheQueries.isEmptyParagraph(editor, editor.selection.anchor);
2495
- if ((isEmptyParagraph || isEmptyHeading) &&
2573
+ var isEmptyHeading = HEADING_TYPES.includes(anchorBlock$1.type) && slate.Editor.isEmpty(editor, anchorBlock$1);
2574
+ var isEmptyParagraph$1 = isEmptyParagraph(editor, editor.selection.anchor);
2575
+ if ((isEmptyParagraph$1 || isEmptyHeading) &&
2496
2576
  parentPath[parentPath.length - 1] > 0 &&
2497
2577
  slate.Editor.isVoid(editor, slate.Node.get(editor, slate.Path.previous(parentPath)))) {
2498
2578
  slate.Transforms.delete(editor, { at: editor.selection.anchor.path.slice(0, editor.selection.anchor.path.length - 1) });
@@ -2513,10 +2593,10 @@
2513
2593
  deleteBackward(unit);
2514
2594
  };
2515
2595
  editor.deleteForward = function (unit) {
2516
- var anchorBlockEntry = TheQueries.anchorBlockEntry(editor);
2517
- if (anchorBlockEntry &&
2518
- TheQueries.isAncestorEmpty(editor, anchorBlockEntry[0]) &&
2519
- TheQueries.getNode(editor, slate.Path.next(anchorBlockEntry[1]))) {
2596
+ var anchorBlockEntry$1 = anchorBlockEntry(editor);
2597
+ if (anchorBlockEntry$1 &&
2598
+ isAncestorEmpty(editor, anchorBlockEntry$1[0]) &&
2599
+ getNode(editor, slate.Path.next(anchorBlockEntry$1[1]))) {
2520
2600
  var pathRef = slate.Editor.pathRef(editor, slate.Path.parent(editor.selection.anchor.path));
2521
2601
  slateHistory.HistoryEditor.withoutMerging(editor, function () {
2522
2602
  slate.Transforms.move(editor);
@@ -2534,7 +2614,7 @@
2534
2614
  editor.onKeydown = function (event) {
2535
2615
  var selection = editor.selection;
2536
2616
  if (i1.IS_SAFARI && selection && slate.Range.isCollapsed(selection) && i1.hotkeys.isDeleteBackward(event)) {
2537
- var blockEntry = TheQueries.getAboveByType(editor, BLOCK_DELETEBACKWARD_TYPES);
2617
+ var blockEntry = getAboveByType(editor, BLOCK_DELETEBACKWARD_TYPES);
2538
2618
  if (blockEntry && blockEntry[0]) {
2539
2619
  var isStart = slate.Editor.isStart(editor, selection.anchor, blockEntry[1]);
2540
2620
  if (isStart) {
@@ -2558,6 +2638,7 @@
2558
2638
  function TheContextService(ngZone) {
2559
2639
  var _this = this;
2560
2640
  this.ngZone = ngZone;
2641
+ this.fileList = [];
2561
2642
  this.paintFormatStatus = {
2562
2643
  isActive: false,
2563
2644
  marks: {}
@@ -2573,10 +2654,16 @@
2573
2654
  };
2574
2655
  TheContextService.prototype.getOptions = function () {
2575
2656
  if (!this.options.width) {
2576
- this.options.width = this.options.nativeElement.querySelector('.slate-editable-container').offsetWidth - 30;
2657
+ this.options.width = this.options.nativeElement.querySelector('.slate-editable-container').firstElementChild.offsetWidth;
2577
2658
  }
2578
2659
  return this.options;
2579
2660
  };
2661
+ TheContextService.prototype.setUploadFileList = function (file) {
2662
+ this.fileList.push(file);
2663
+ };
2664
+ TheContextService.prototype.removeUploadImage = function (file) {
2665
+ this.fileList.splice(this.fileList.findIndex(function (item) { return item.file === file; }), 1);
2666
+ };
2580
2667
  return TheContextService;
2581
2668
  }());
2582
2669
  TheContextService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheContextService, deps: [{ token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
@@ -2601,7 +2688,6 @@
2601
2688
  _this.beforeContextChange = function (value) {
2602
2689
  if (value.element !== _this.element && value.element.thumbUrl) {
2603
2690
  _this.imageEntry = {
2604
- file: undefined,
2605
2691
  name: value.element.name,
2606
2692
  width: value.element.width,
2607
2693
  height: value.element.height,
@@ -2614,8 +2700,11 @@
2614
2700
  return _this;
2615
2701
  }
2616
2702
  TheImageComponent.prototype.ngOnInit = function () {
2617
- if (this.element.file instanceof File) {
2618
- this.uploadImage(this.element.file);
2703
+ var _this = this;
2704
+ var _a;
2705
+ this.file = (_a = this.theContextService.fileList.find(function (item) { return item.url === _this.element.url; })) === null || _a === void 0 ? void 0 : _a.file;
2706
+ if (this.file && this.file instanceof File) {
2707
+ this.uploadImage(this.file);
2619
2708
  }
2620
2709
  _super.prototype.ngOnInit.call(this);
2621
2710
  };
@@ -2629,7 +2718,7 @@
2629
2718
  this.mouseUpSubscription = this.theContextService.onMouseUp$.subscribe(function (e) { return _this.endDrag(e); });
2630
2719
  this.uploadingSubscription = this.imageUploaderService
2631
2720
  .getUploadingItems$()
2632
- .pipe(operators.map(function (fileUploadingItem) { return _this.element.file && fileUploadingItem.find(function (item) { return item.file === _this.element.file; }); }))
2721
+ .pipe(operators.map(function (fileUploadingItem) { return _this.file && fileUploadingItem.find(function (item) { return item.file === _this.file; }); }))
2633
2722
  .subscribe(function (uploadingItem) {
2634
2723
  if (!uploadingItem || !uploadingItem.result) {
2635
2724
  return;
@@ -2644,13 +2733,13 @@
2644
2733
  };
2645
2734
  TheImageComponent.prototype.uploadImage = function (file) {
2646
2735
  return __awaiter(this, void 0, void 0, function () {
2647
- var _a, width, height, _b, uploadFileEntity, path, thumbUrl, originUrl, imageInfo;
2736
+ var _b, width, height, _c, uploadFileEntity, path, thumbUrl, originUrl, imageInfo;
2648
2737
  var _this = this;
2649
- return __generator(this, function (_c) {
2650
- switch (_c.label) {
2738
+ return __generator(this, function (_d) {
2739
+ switch (_d.label) {
2651
2740
  case 0: return [4 /*yield*/, this.resolveImageSize(file, this.theContextService.getOptions().width)];
2652
2741
  case 1:
2653
- _a = _c.sent(), width = _a.width, height = _a.height;
2742
+ _b = _d.sent(), width = _b.width, height = _b.height;
2654
2743
  this.imageEntry = {
2655
2744
  height: height,
2656
2745
  width: width,
@@ -2659,7 +2748,7 @@
2659
2748
  this.uploading = true;
2660
2749
  return [4 /*yield*/, this.imageUploaderService.uploadFileHandle([file]).toPromise()];
2661
2750
  case 2:
2662
- _b = __read.apply(void 0, [_c.sent(), 1]), uploadFileEntity = _b[0];
2751
+ _c = __read.apply(void 0, [_d.sent(), 1]), uploadFileEntity = _c[0];
2663
2752
  path = i1.AngularEditor.findPath(this.editor, this.element);
2664
2753
  thumbUrl = uploadFileEntity.thumbUrl, originUrl = uploadFileEntity.originUrl;
2665
2754
  imageInfo = {
@@ -2668,10 +2757,9 @@
2668
2757
  height: this.imageEntry.height,
2669
2758
  thumbUrl: thumbUrl,
2670
2759
  originUrl: originUrl,
2671
- align: this.imageEntry.align || exports.Alignment.center,
2672
- file: undefined
2760
+ align: this.imageEntry.align || exports.Alignment.center
2673
2761
  };
2674
- slateHistory.HistoryEditor.withoutSaving(this.editor, function () { return slate.Transforms.setNodes(_this.editor, Object.assign({ type: exports.ElementKinds.image, voids: true }, imageInfo), { at: path }); });
2762
+ slateHistory.HistoryEditor.withoutSaving(this.editor, function () { return slate.Transforms.setNodes(_this.editor, Object.assign({ type: exports.ElementKinds.image, url: null }, imageInfo), { at: path }); });
2675
2763
  return [2 /*return*/];
2676
2764
  }
2677
2765
  });
@@ -2719,7 +2807,7 @@
2719
2807
  if (this.element.align === 'center') {
2720
2808
  offsetX = offsetX * 2;
2721
2809
  }
2722
- var _a = this.element, width = _a.width, height = _a.height;
2810
+ var _b = this.element, width = _b.width, height = _b.height;
2723
2811
  if (axis.includes('x')) {
2724
2812
  width = offsetX + internalWidth;
2725
2813
  if (width >= maxWidth) {
@@ -2756,7 +2844,7 @@
2756
2844
  if (this.dragable) {
2757
2845
  this.dragable = false;
2758
2846
  this.mouseMoveSubscription.unsubscribe();
2759
- slate.Transforms.setNodes(this.editor, Object.assign({ type: exports.ElementKinds.image, voids: true }, this.imageEntry), { at: this.selection });
2847
+ slate.Transforms.setNodes(this.editor, Object.assign({ type: exports.ElementKinds.image }, this.imageEntry), { at: this.selection });
2760
2848
  }
2761
2849
  };
2762
2850
  TheImageComponent.prototype.cancelUpload = function (event) {
@@ -2771,7 +2859,7 @@
2771
2859
  return TheImageComponent;
2772
2860
  }(TheBaseElementComponent));
2773
2861
  TheImageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheImageComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$2.DomSanitizer }, { token: THE_UPLOAD_SERVICE_TOKEN }, { token: i0__namespace.ChangeDetectorRef }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2774
- TheImageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align || 'center'\">\n <div\n #imageContent\n *ngIf=\"imageEntry.thumbUrl\"\n class=\"image-content\"\n [class.pointer]=\"!selection\"\n [ngStyle]=\"{ width: imageEntry.width + 'px', height: imageEntry.height + 'px' }\"\n >\n <img #img class=\"main-image\" [src]=\"imageEntry.thumbUrl\" [alt]=\"imageEntry.name\" />\n <div *ngIf=\"selection\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"></thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" (mousedown)=\"preview($event)\" [class.readonly]=\"readonly\"></div>\n </div>\n</div>\n", components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i4__namespace.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thyTips", "thyValue", "thySize", "thyMax"] }, { 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: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
2862
+ TheImageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align || 'center'\">\n <div\n #imageContent\n *ngIf=\"imageEntry.thumbUrl\"\n class=\"image-content\"\n [class.pointer]=\"!selection\"\n [ngStyle]=\"{ width: imageEntry.width + 'px', height: imageEntry.height + 'px' }\"\n >\n <img #img class=\"main-image\" [src]=\"imageEntry.thumbUrl\" [alt]=\"imageEntry.name\" />\n <div *ngIf=\"selection\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"></thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" (mousedown)=\"preview($event)\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n", components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i4__namespace.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thyTips", "thyValue", "thySize", "thyMax"] }, { 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: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
2775
2863
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheImageComponent, decorators: [{
2776
2864
  type: i0.Component,
2777
2865
  args: [{
@@ -2803,6 +2891,7 @@
2803
2891
  },
2804
2892
  insertImages: function (editor, imageFiles) {
2805
2893
  var e_1, _a;
2894
+ var contextService = editor.injector.get(TheContextService);
2806
2895
  var imageNodes = [];
2807
2896
  var text = { text: '' };
2808
2897
  try {
@@ -2811,7 +2900,11 @@
2811
2900
  var verify = ImageEditor.verifyImage(editor, image);
2812
2901
  if (verify) {
2813
2902
  var url = URL.createObjectURL(image);
2814
- imageNodes.push({ type: exports.ElementKinds.image, url: url, file: image, children: [text] });
2903
+ contextService.setUploadFileList({
2904
+ url: url,
2905
+ file: image
2906
+ });
2907
+ imageNodes.push({ type: exports.ElementKinds.image, url: url, children: [text] });
2815
2908
  }
2816
2909
  }
2817
2910
  }
@@ -2825,7 +2918,7 @@
2825
2918
  if (imageNodes.length > 0) {
2826
2919
  var at = editor.selection;
2827
2920
  slate.Transforms.insertNodes(editor, imageNodes, { at: at });
2828
- if (TheQueries.isCollapsed(editor.selection) && TheQueries.isEmptyParagraph(editor)) {
2921
+ if (isCollapsed(editor.selection) && isEmptyParagraph(editor)) {
2829
2922
  slate.Transforms.removeNodes(editor, { at: at });
2830
2923
  slate.Transforms.select(editor, at);
2831
2924
  }
@@ -2848,7 +2941,7 @@
2848
2941
  },
2849
2942
  isImageActive: function (editor) {
2850
2943
  var _a = __read(slate.Editor.nodes(editor, {
2851
- match: function (n) { return slate.Element.isElement(n) && n.type === 'image'; },
2944
+ match: function (n) { return slate.Element.isElement(n) && n.type === exports.ElementKinds.image; },
2852
2945
  universal: true
2853
2946
  }), 1), match = _a[0];
2854
2947
  return !!match;
@@ -2862,7 +2955,6 @@
2862
2955
  };
2863
2956
  editor.insertData = function (data) {
2864
2957
  var e_1, _a;
2865
- // TODO:: 底层有点问题,粘贴多张图片时只能识别一张
2866
2958
  if (data.files.length) {
2867
2959
  var imageFiles = [];
2868
2960
  try {
@@ -2987,7 +3079,7 @@
2987
3079
 
2988
3080
  var isInList = function (editor, at) {
2989
3081
  if (at === void 0) { at = editor.selection; }
2990
- return TheQueries.isNodeTypeIn(editor, [exports.ElementKinds.numberedList, exports.ElementKinds.bulletedList], { at: at });
3082
+ return isNodeTypeIn(editor, [exports.ElementKinds.numberedList, exports.ElementKinds.bulletedList], { at: at });
2991
3083
  };
2992
3084
 
2993
3085
  /**
@@ -3002,13 +3094,19 @@
3002
3094
  return [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList];
3003
3095
  };
3004
3096
 
3097
+ /**
3098
+ * 获取 List 中 ListItems,过滤掉空列表嵌套
3099
+ * @param node
3100
+ * @param initialValue
3101
+ * @returns
3102
+ */
3005
3103
  var getStartListItem = function (node, initialValue) {
3006
3104
  if (!initialValue) {
3007
3105
  initialValue = [];
3008
3106
  }
3009
3107
  if (node) {
3010
3108
  return node.reduce(function (result, current) {
3011
- if (current.type == exports.ElementKinds.listItem && current.children[0].type === exports.ElementKinds.default) {
3109
+ if ((current.type === exports.ElementKinds.listItem && !getListTypes().includes(current.children[0].type))) {
3012
3110
  result.push(current);
3013
3111
  }
3014
3112
  else {
@@ -3057,18 +3155,18 @@
3057
3155
  */
3058
3156
  var getListItemEntry = function (editor, _a) {
3059
3157
  var _b = _a === void 0 ? {} : _a, _c = _b.at, at = _c === void 0 ? editor.selection : _c;
3060
- if (at && TheQueries.isNodeTypeIn(editor, exports.ElementKinds.listItem, { at: at })) {
3061
- var selectionParent = TheQueries.getParent(editor, at);
3158
+ if (at && isNodeTypeIn(editor, exports.ElementKinds.listItem, { at: at })) {
3159
+ var selectionParent = getParent(editor, at);
3062
3160
  if (!selectionParent)
3063
3161
  return;
3064
3162
  var _d = __read(selectionParent, 2), paragraphPath = _d[1];
3065
- var listItem = TheQueries.getAboveByType(editor, exports.ElementKinds.listItem, { at: at }) || TheQueries.getParent(editor, paragraphPath);
3163
+ var listItem = getAboveByType(editor, exports.ElementKinds.listItem, { at: at }) || getParent(editor, paragraphPath);
3066
3164
  if (!listItem)
3067
3165
  return;
3068
3166
  var _e = __read(listItem, 2), listItemNode = _e[0], listItemPath = _e[1];
3069
3167
  if (listItemNode.type !== exports.ElementKinds.listItem)
3070
3168
  return;
3071
- var list = TheQueries.getParent(editor, listItemPath);
3169
+ var list = getParent(editor, listItemPath);
3072
3170
  if (!list || !isList(list[0]))
3073
3171
  return;
3074
3172
  return {
@@ -3082,9 +3180,9 @@
3082
3180
  * Is the selection focus at the start of its parent block.
3083
3181
  */
3084
3182
  var isSelectionAtListItemStart = function (editor) {
3085
- var listItemEntry = TheQueries.getAboveByType(editor, [exports.ElementKinds.listItem]);
3183
+ var listItemEntry = getAboveByType(editor, [exports.ElementKinds.listItem]);
3086
3184
  if (listItemEntry) {
3087
- return TheQueries.isStart(editor, editor.selection.focus, listItemEntry[1]);
3185
+ return isStart(editor, editor.selection.focus, listItemEntry[1]);
3088
3186
  }
3089
3187
  return false;
3090
3188
  };
@@ -3094,7 +3192,7 @@
3094
3192
  var children = fromList.children;
3095
3193
  var _b = __read(toListItemEntry, 2), toListItem = _b[0], toListItemPath = _b[1];
3096
3194
  var nextListItemPath = slate.Path.next(toListItemPath);
3097
- var toListItemIsEmptyParagraph = TheQueries.isEmptyParagraph(editor, editor.selection.anchor);
3195
+ var toListItemIsEmptyParagraph = isEmptyParagraph(editor, editor.selection.anchor);
3098
3196
  var hasSubList = hasListInListItem(toListItem);
3099
3197
  var selectPath = __spreadArray([], __read(toListItemPath));
3100
3198
  var liIndex = selectPath.pop();
@@ -3166,7 +3264,7 @@
3166
3264
  var list = _a.list, listItem = _a.listItem;
3167
3265
  var _b = __read(list, 2), listNode = _b[0], listPath = _b[1];
3168
3266
  var _c = __read(listItem, 2), listItemPath = _c[1];
3169
- var listParentEntry = TheQueries.getParent(editor, listPath);
3267
+ var listParentEntry = getParent(editor, listPath);
3170
3268
  if (!listParentEntry)
3171
3269
  return;
3172
3270
  var _d = __read(listParentEntry, 2), listParentNode = _d[0], listParentPath = _d[1];
@@ -3215,8 +3313,8 @@
3215
3313
  type: exports.ElementKinds.listItem,
3216
3314
  children: []
3217
3315
  }, { at: nextPath });
3218
- var moveStartPath = TheQueries.findPath(editor, behindNode[0]);
3219
- var moveEndPath = TheQueries.findPath(editor, behindNode[behindNode.length - 1]);
3316
+ var moveStartPath = findPath(editor, behindNode[0]);
3317
+ var moveEndPath = findPath(editor, behindNode[behindNode.length - 1]);
3220
3318
  var moveRange = slate.Editor.range(editor, moveStartPath, moveEndPath);
3221
3319
  slate.Transforms.moveNodes(editor, {
3222
3320
  at: moveRange,
@@ -3238,8 +3336,8 @@
3238
3336
  * Insert list item if selection in li>p.
3239
3337
  */
3240
3338
  var insertListItem = function (editor) {
3241
- if (editor.selection && !TheQueries.isRangeAtRoot(editor.selection)) {
3242
- var paragraphEntry = TheQueries.getAboveByType(editor, exports.ElementKinds.paragraph);
3339
+ if (editor.selection && !isRangeAtRoot(editor.selection)) {
3340
+ var paragraphEntry = getAboveByType(editor, exports.ElementKinds.paragraph);
3243
3341
  if (!paragraphEntry) {
3244
3342
  return;
3245
3343
  }
@@ -3251,7 +3349,7 @@
3251
3349
  if (!slate.Range.isCollapsed(editor.selection)) {
3252
3350
  slate.Transforms.delete(editor);
3253
3351
  }
3254
- var isEnd = TheQueries.isBlockTextEmptyAfterSelection(editor);
3352
+ var isEnd = isBlockTextEmptyAfterSelection(editor);
3255
3353
  var nextNodePath_1 = slate.Path.next(paragraphPath);
3256
3354
  var nextListItemPath_1 = slate.Path.next(listItemPath);
3257
3355
  var nextEnd = slate.Editor.end(editor, listItemPath);
@@ -3286,7 +3384,7 @@
3286
3384
  /**
3287
3385
  * If there is a list in the list item, move it to the next list item
3288
3386
  */
3289
- if (TheQueries.getNode(editor, nextNodePath_1)) {
3387
+ if (getNode(editor, nextNodePath_1)) {
3290
3388
  slate.Transforms.moveNodes(editor, {
3291
3389
  at: slate.Editor.range(editor, nextNodePath_1, nextEnd),
3292
3390
  to: nextListItemPath_1.concat(1),
@@ -3302,8 +3400,8 @@
3302
3400
 
3303
3401
  var unwrapList = function (editor) {
3304
3402
  slate.Editor.withoutNormalizing(editor, function () {
3305
- TheTransforms.unwrapNodesByType(editor, exports.ElementKinds.listItem);
3306
- TheTransforms.unwrapNodesByType(editor, [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList], { split: true });
3403
+ unwrapNodesByType(editor, exports.ElementKinds.listItem);
3404
+ unwrapNodesByType(editor, [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList], { split: true });
3307
3405
  });
3308
3406
  };
3309
3407
 
@@ -3333,7 +3431,7 @@
3333
3431
  var toListItemSublist = getListItemSublist(toListItem, options);
3334
3432
  var to;
3335
3433
  if (!toListItemSublist) {
3336
- var fromList = TheQueries.getParent(editor, fromListItemPath);
3434
+ var fromList = getParent(editor, fromListItemPath);
3337
3435
  if (!fromList)
3338
3436
  return 0;
3339
3437
  var _e = __read(fromList, 1), fromListNode = _e[0];
@@ -3347,7 +3445,7 @@
3347
3445
  to = toListItemSublistPath.concat([0]);
3348
3446
  }
3349
3447
  else {
3350
- to = slate.Path.next(TheQueries.getLastChildPath(toListItemSublist));
3448
+ to = slate.Path.next(getLastChildPath(toListItemSublist));
3351
3449
  }
3352
3450
  var moved = moveChildren(editor, {
3353
3451
  at: slate.Path.previous(fromListItemSublistPath),
@@ -3385,9 +3483,9 @@
3385
3483
  * 如果为同类型list,则把nextList children移动到当前list的尾部, 并删除nextList
3386
3484
  */
3387
3485
  var nextPath = slate.Path.next(listPath);
3388
- var nextNode = TheQueries.getNode(editor, nextPath);
3486
+ var nextNode = getNode(editor, nextPath);
3389
3487
  if (nextNode && slate.Element.isElement(nextNode) && slate.Element.isElement(listNode) && nextNode.type === listNode.type) {
3390
- TheTransforms.moveChildren(editor, {
3488
+ moveChildren(editor, {
3391
3489
  at: [nextNode, nextPath],
3392
3490
  to: listPath.concat(listNode.children.length)
3393
3491
  });
@@ -3399,11 +3497,11 @@
3399
3497
  * 获取prevList判断是否为同类型list
3400
3498
  * 如果为同类型list,则把当前list children移动到prevList的尾部, 并删除当前List
3401
3499
  */
3402
- var currentListNode = TheQueries.getNode(editor, listPath);
3500
+ var currentListNode = getNode(editor, listPath);
3403
3501
  var prevPath = slate.Path.previous(listPath);
3404
- var prevNode = TheQueries.getNode(editor, prevPath);
3502
+ var prevNode = getNode(editor, prevPath);
3405
3503
  if (prevNode && slate.Element.isElement(prevNode) && slate.Element.isElement(currentListNode) && prevNode.type === currentListNode.type) {
3406
- TheTransforms.moveChildren(editor, {
3504
+ moveChildren(editor, {
3407
3505
  at: [currentListNode, listPath],
3408
3506
  to: prevPath.concat(prevNode.children.length)
3409
3507
  });
@@ -3453,7 +3551,7 @@
3453
3551
  */
3454
3552
  var moveListItemSublistItemsToList = function (editor, _a) {
3455
3553
  var fromListItem = _a.fromListItem, toList = _a.toList, location = _a.location;
3456
- var fromListItemSublist = TheQueries.findDescendant(editor, {
3554
+ var fromListItemSublist = findDescendant(editor, {
3457
3555
  at: fromListItem[1],
3458
3556
  match: {
3459
3557
  type: getListTypes()
@@ -3462,7 +3560,7 @@
3462
3560
  if (!fromListItemSublist)
3463
3561
  return 0;
3464
3562
  var _b = __read(fromListItemSublist, 2), fromListItemSublistPath = _b[1];
3465
- var lastChildPath = TheQueries.getLastChildPath(toList);
3563
+ var lastChildPath = getLastChildPath(toList);
3466
3564
  var moved;
3467
3565
  slate.Editor.withoutNormalizing(editor, function () {
3468
3566
  moved = moveChildren(editor, {
@@ -3533,7 +3631,7 @@
3533
3631
  }
3534
3632
  // move down with tab
3535
3633
  var tab = !e.shiftKey;
3536
- if (tab && !TheQueries.isFirstChild(listItemPath)) {
3634
+ if (tab && !isFirstChild(listItemPath)) {
3537
3635
  moveListItemDown(editor, { list: list, listItem: listItem });
3538
3636
  return true;
3539
3637
  }
@@ -3698,6 +3796,20 @@
3698
3796
  }]
3699
3797
  }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; } });
3700
3798
 
3799
+ /**
3800
+ * Is the selection in same li
3801
+ */
3802
+ var isSelectionInSameListItem = function (editor) {
3803
+ var selection = editor.selection;
3804
+ if (!selection) {
3805
+ return false;
3806
+ }
3807
+ var _a = __read(slate.Range.edges(selection), 2), start = _a[0], end = _a[1];
3808
+ var startListItemEntry = getAboveByType(editor, exports.ElementKinds.listItem, { at: start.path });
3809
+ var endListItemEntry = getAboveByType(editor, exports.ElementKinds.listItem, { at: end.path });
3810
+ return startListItemEntry && endListItemEntry && slate.Path.equals(startListItemEntry[1], endListItemEntry[1]);
3811
+ };
3812
+
3701
3813
  var withList = function (_a) {
3702
3814
  var _b = _a === void 0 ? {} : _a, validLiChildrenTypes = _b.validLiChildrenTypes;
3703
3815
  return function (editor) {
@@ -3708,7 +3820,7 @@
3708
3820
  onReset: function (_editor) { return unwrapList(_editor); }
3709
3821
  };
3710
3822
  editor.insertBreak = function () {
3711
- var node = TheQueries.anchorBlock(editor);
3823
+ var node = anchorBlock(editor);
3712
3824
  if (!node) {
3713
3825
  insertBreak();
3714
3826
  return;
@@ -3749,14 +3861,14 @@
3749
3861
  }
3750
3862
  }
3751
3863
  // 如果选择的listItem为空则将其向上移动
3752
- if (isStart_1 && TheQueries.isBlockAboveEmpty(editor)) {
3864
+ if (isStart_1 && isBlockAboveEmpty(editor)) {
3753
3865
  moved_1 = moveListItemUp(editor, { list: list, listItem: listItem });
3754
3866
  if (moved_1)
3755
3867
  return;
3756
3868
  }
3757
- var didReset = TheTransforms.onKeyDownResetBlockType({
3869
+ var didReset = onKeyDownResetBlockType({
3758
3870
  rules: [
3759
- Object.assign(Object.assign({}, resetBlockTypesListRule), { predicate: function () { return !moved_1 && isStart_1 && TheQueries.isBlockAboveEmpty(editor); } })
3871
+ Object.assign(Object.assign({}, resetBlockTypesListRule), { predicate: function () { return !moved_1 && isStart_1 && isBlockAboveEmpty(editor); } })
3760
3872
  ]
3761
3873
  })(null, editor);
3762
3874
  if (didReset) {
@@ -3782,15 +3894,14 @@
3782
3894
  var fragmentElement = fragmentData[0];
3783
3895
  if (getListTypes().includes(fragmentElement.type)) {
3784
3896
  var startNodes = getStartListItem([fragmentElement.children[0]]);
3785
- // 复制列表中的图片时startNodes长度为零
3786
- if (startNodes.length === 0) {
3787
- setFragmentData(unit);
3788
- return;
3789
- }
3790
3897
  var children = startNodes.concat(fragmentElement.children.slice(1));
3791
3898
  var fragmentNodes = [
3792
3899
  Object.assign(Object.assign({}, fragmentElement), { children: children })
3793
3900
  ];
3901
+ if (isSelectionInSameListItem(editor)) {
3902
+ // 仅仅复制列表中的内容
3903
+ fragmentNodes = children[0].children;
3904
+ }
3794
3905
  var fragment = fragmentNodes.concat(fragmentData.slice(1));
3795
3906
  var domRange = i1.AngularEditor.toDOMRange(editor, selection);
3796
3907
  var contents = domRange.cloneContents();
@@ -3815,17 +3926,17 @@
3815
3926
  var list = res.list, listItem_1 = res.listItem;
3816
3927
  var _a = __read(list, 2), listPath_1 = _a[1];
3817
3928
  var _b = __read(listItem_1, 2), listItemNode_1 = _b[0], listItemPath_1 = _b[1];
3818
- var previousListItemPath_1 = TheQueries.getPreviousPath(listItemPath_1);
3929
+ var previousListItemPath_1 = getPreviousPath(listItemPath_1);
3819
3930
  if (previousListItemPath_1) {
3820
3931
  var beforePoint = slate.Editor.before(editor, listItemPath_1);
3821
3932
  var parentPath = slate.Path.parent(beforePoint.path);
3822
3933
  var parentNode = slate.Node.get(editor, parentPath);
3823
3934
  if (slate.Editor.isVoid(editor, parentNode)) {
3824
3935
  slate.Editor.withoutNormalizing(editor, function () {
3825
- TheTransforms.unwrapNodesByType(editor, [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList], {
3936
+ unwrapNodesByType(editor, [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList], {
3826
3937
  split: true
3827
3938
  });
3828
- TheTransforms.unwrapNodesByType(editor, exports.ElementKinds.listItem);
3939
+ unwrapNodesByType(editor, exports.ElementKinds.listItem);
3829
3940
  });
3830
3941
  return;
3831
3942
  }
@@ -3849,7 +3960,7 @@
3849
3960
  var beforePoint = slate.Editor.before(editor, listItemPath_1);
3850
3961
  var startPoint = slate.Editor.start(editor, listItemPath_1);
3851
3962
  var endPoint = slate.Editor.end(editor, listItemPath_1);
3852
- var isInFirstChild = !isListNested(editor, listPath_1) && TheQueries.isFirstChild(listItemPath_1);
3963
+ var isInFirstChild = !isListNested(editor, listPath_1) && isFirstChild(listItemPath_1);
3853
3964
  var to = isInFirstChild ? listPath_1 : slate.Path.next(slate.Path.parent(beforePoint.path));
3854
3965
  // TODO: types
3855
3966
  slate.Transforms.moveNodes(editor, {
@@ -3865,7 +3976,7 @@
3865
3976
  return;
3866
3977
  }
3867
3978
  // deprecated
3868
- if (!isListNested(editor, listPath_1) && TheQueries.isFirstChild(listItemPath_1)) {
3979
+ if (!isListNested(editor, listPath_1) && isFirstChild(listItemPath_1)) {
3869
3980
  unwrapList(editor);
3870
3981
  return;
3871
3982
  }
@@ -3874,7 +3985,7 @@
3874
3985
  };
3875
3986
  editor.insertData = function (data) {
3876
3987
  var text = data.getData('text/plain');
3877
- var fragment = extractFragment(data, ELEMENT_UNIQUE_ID);
3988
+ var fragment = extractFragment(data);
3878
3989
  var aboveEntry = slate.Editor.above(editor, {
3879
3990
  match: function (n) { return slate.Editor.isBlock(editor, n) && n.type === exports.ElementKinds.listItem; }
3880
3991
  });
@@ -3983,7 +4094,7 @@
3983
4094
  if (this.readonly) {
3984
4095
  return false;
3985
4096
  }
3986
- TheTransforms.setNode(this.editor, { checked: checked }, this.element);
4097
+ setNode(this.editor, { checked: checked }, this.element);
3987
4098
  };
3988
4099
  TheTodoItemComponent.prototype.useIndentClass = function (el, element) {
3989
4100
  var prefix = 'indent';
@@ -4027,7 +4138,7 @@
4027
4138
  }), 1), match = _a[0];
4028
4139
  if (match) {
4029
4140
  var _b = __read(match, 2), path = _b[1];
4030
- var block = TheQueries.anchorBlock(editor);
4141
+ var block = anchorBlock(editor);
4031
4142
  if (block && slate.Editor.isStart(editor, selection.anchor, path) && slate.Editor.isEmpty(editor, block)) {
4032
4143
  slate.Transforms.setNodes(editor, {
4033
4144
  type: exports.ElementKinds.default,
@@ -4040,8 +4151,8 @@
4040
4151
  }
4041
4152
  }
4042
4153
  insertBreak();
4043
- var anchorBlock = TheQueries.anchorBlock(editor);
4044
- if (anchorBlock && anchorBlock.type === exports.ElementKinds.checkItem) {
4154
+ var anchorBlock$1 = anchorBlock(editor);
4155
+ if (anchorBlock$1 && anchorBlock$1.type === exports.ElementKinds.checkItem) {
4045
4156
  slate.Transforms.setNodes(editor, { checked: false });
4046
4157
  }
4047
4158
  };
@@ -4125,7 +4236,7 @@
4125
4236
  var deleteBackward = editor.deleteBackward;
4126
4237
  editor.deleteBackward = function (unit) {
4127
4238
  var anchor = editor.selection.anchor;
4128
- var node = TheQueries.anchorBlock(editor);
4239
+ var node = anchorBlock(editor);
4129
4240
  var isVoid = slate.Editor.isVoid(editor, node);
4130
4241
  var alignTypes = [exports.Alignment.center, exports.Alignment.right];
4131
4242
  var startLine = slate.Editor.start(editor, anchor.path);
@@ -4144,7 +4255,7 @@
4144
4255
  var insertBreak = editor.insertBreak;
4145
4256
  editor.insertBreak = function () {
4146
4257
  var selection = editor.selection;
4147
- var anchorBlock = TheQueries.getAnchorBlockEntry(editor);
4258
+ var anchorBlock = getAnchorBlockEntry(editor);
4148
4259
  if (anchorBlock && slate.Range.isCollapsed(selection) && anchorBlock[0].type.startsWith('heading')) {
4149
4260
  if (slate.Editor.isStart(editor, selection.anchor, anchorBlock[1])) {
4150
4261
  insertBreak();
@@ -4220,7 +4331,7 @@
4220
4331
  var _b = _a === void 0 ? {} : _a, _c = _b.idKey, idKey = _c === void 0 ? 'id' : _c, _d = _b.idCreator, idCreator = _d === void 0 ? function () { return Date.now(); } : _d, _e = _b.filterText, filterText = _e === void 0 ? true : _e, _f = _b.filter, filter = _f === void 0 ? function () { return true; } : _f;
4221
4332
  return function (e) {
4222
4333
  var editor = e;
4223
- var apply = editor.apply;
4334
+ var apply = editor.apply, getFragment = editor.getFragment;
4224
4335
  var idPropsCreator = function () {
4225
4336
  var _a;
4226
4337
  return (_a = {}, _a[idKey] = idCreator(), _a);
@@ -4231,7 +4342,7 @@
4231
4342
  if (operation.type === 'insert_node') {
4232
4343
  var newFilter = function (entry) {
4233
4344
  var _a = __read(entry, 1), _node = _a[0];
4234
- return filter(entry) && filterText ? slate.Element.isElement(_node) : TheQueries.isDescendant(_node);
4345
+ return filter(entry) && filterText ? slate.Element.isElement(_node) : isDescendant(_node);
4235
4346
  };
4236
4347
  // fix can not find path by orign node
4237
4348
  var node = operation.node;
@@ -4239,7 +4350,7 @@
4239
4350
  node = _.cloneDeep(node);
4240
4351
  }
4241
4352
  // it will not overwrite ids once it's set as it's read-only
4242
- TheTransforms.mergeDeepToNodes({
4353
+ mergeDeepToNodes({
4243
4354
  node: node,
4244
4355
  source: idPropsCreator,
4245
4356
  query: {
@@ -4263,6 +4374,10 @@
4263
4374
  }
4264
4375
  return apply(operation);
4265
4376
  };
4377
+ editor.getFragment = function () {
4378
+ var fragment = _.cloneDeep(getFragment());
4379
+ return deleteElementKey(fragment, idKey);
4380
+ };
4266
4381
  return editor;
4267
4382
  };
4268
4383
  };
@@ -4288,14 +4403,14 @@
4288
4403
  var endMarkup = between ? between[1] : '';
4289
4404
  var endMarkupPointBefore = selection.anchor;
4290
4405
  if (endMarkup) {
4291
- endMarkupPointBefore = TheQueries.getPointBefore(editor, selection, {
4406
+ endMarkupPointBefore = getPointBefore(editor, selection, {
4292
4407
  matchString: endMarkup
4293
4408
  });
4294
4409
  if (!endMarkupPointBefore) {
4295
4410
  return false;
4296
4411
  }
4297
4412
  }
4298
- var startMarkupPointAfter = TheQueries.getPointBefore(editor, endMarkupPointBefore, {
4413
+ var startMarkupPointAfter = getPointBefore(editor, endMarkupPointBefore, {
4299
4414
  matchString: startMarkup,
4300
4415
  skipInvalid: true,
4301
4416
  afterMatch: true
@@ -4309,14 +4424,14 @@
4309
4424
  focus: endMarkupPointBefore
4310
4425
  };
4311
4426
  if (!ignoreTrim) {
4312
- var markupText = TheQueries.getText(editor, markupRange);
4427
+ var markupText = getText(editor, markupRange);
4313
4428
  if (markupText.trim() !== markupText) {
4314
4429
  return false;
4315
4430
  }
4316
4431
  }
4317
4432
  // delete end markup
4318
4433
  if (endMarkup) {
4319
- endMarkupPointBefore = TheQueries.getPointBefore(editor, selection, {
4434
+ endMarkupPointBefore = getPointBefore(editor, selection, {
4320
4435
  matchString: endMarkup
4321
4436
  });
4322
4437
  slate.Transforms.delete(editor, {
@@ -4332,7 +4447,7 @@
4332
4447
  slate.Transforms.collapse(editor, { edge: 'end' });
4333
4448
  editor.removeMark(type, false);
4334
4449
  // delete start markup
4335
- var startMarkupPointBefore = TheQueries.getPointBefore(editor, selection, {
4450
+ var startMarkupPointBefore = getPointBefore(editor, selection, {
4336
4451
  matchString: startMarkup,
4337
4452
  skipInvalid: true
4338
4453
  });
@@ -4352,7 +4467,7 @@
4352
4467
  editor.insertText = function (text) {
4353
4468
  var e_1, _c;
4354
4469
  var _a;
4355
- if (!TheQueries.isCollapsed(editor.selection)) {
4470
+ if (!isCollapsed(editor.selection)) {
4356
4471
  return insertText(text);
4357
4472
  }
4358
4473
  var _loop_1 = function (_b) {
@@ -4369,15 +4484,15 @@
4369
4484
  var markups = castArray(markup);
4370
4485
  var markupRange = void 0;
4371
4486
  if (triggerAtBlockStart) {
4372
- markupRange = TheQueries.getRangeFromBlockStart(editor);
4487
+ markupRange = getRangeFromBlockStart(editor);
4373
4488
  // Don't autoformat if there is void nodes.
4374
- var hasVoidNode = TheQueries.someNode(editor, {
4489
+ var hasVoidNode = someNode(editor, {
4375
4490
  at: markupRange,
4376
4491
  match: function (n) { return slate.Editor.isVoid(editor, n); }
4377
4492
  });
4378
4493
  if (hasVoidNode)
4379
4494
  return "continue";
4380
- var textFromBlockStart = TheQueries.getText(editor, markupRange);
4495
+ var textFromBlockStart = getText(editor, markupRange);
4381
4496
  if (match) {
4382
4497
  markups = match(editor, textFromBlockStart);
4383
4498
  }
@@ -4385,13 +4500,13 @@
4385
4500
  return "continue";
4386
4501
  }
4387
4502
  else {
4388
- markupRange = TheQueries.getRangeBefore(editor, editor.selection, {
4503
+ markupRange = getRangeBefore(editor, editor.selection, {
4389
4504
  matchString: markup,
4390
4505
  skipInvalid: true
4391
4506
  });
4392
4507
  if (!markupRange)
4393
4508
  return "continue";
4394
- var blockAbovePath = (_a = TheQueries.getBlockAbove(editor)) === null || _a === void 0 ? void 0 : _a[1];
4509
+ var blockAbovePath = (_a = getBlockAbove(editor)) === null || _a === void 0 ? void 0 : _a[1];
4395
4510
  if (!blockAbovePath)
4396
4511
  return "continue";
4397
4512
  // If the markup is not at the start, insert break before autoformatting.
@@ -4401,7 +4516,7 @@
4401
4516
  }
4402
4517
  if (!allowSameTypeAbove) {
4403
4518
  // Don't autoformat if already in a block of the same type.
4404
- var isBelowSameBlockType = TheQueries.someNode(editor, { match: { type: type } });
4519
+ var isBelowSameBlockType = someNode(editor, { match: { type: type } });
4405
4520
  if (isBelowSameBlockType)
4406
4521
  return "continue";
4407
4522
  }
@@ -4463,9 +4578,9 @@
4463
4578
  editor.normalizeNode = function (_b) {
4464
4579
  var _c = __read(_b, 2), currentNode = _c[0], currentPath = _c[1];
4465
4580
  if (!currentPath.length) {
4466
- var entry = TheQueries.getLastNode(editor, level);
4581
+ var entry = getLastNode(editor, level);
4467
4582
  var _d = __read(entry, 2), lastNode = _d[0], lastPath = _d[1];
4468
- if (slate.Element.isElement(lastNode) && lastNode.type !== type && TheQueries.isNodeType(entry, query)) {
4583
+ if (slate.Element.isElement(lastNode) && lastNode.type !== type && isNodeType(entry, query)) {
4469
4584
  editor.insertNodes({
4470
4585
  type: type,
4471
4586
  children: [{ text: '' }]
@@ -4487,7 +4602,7 @@
4487
4602
  var isLeftCursor = i1.isCardLeft(anchorNode);
4488
4603
  var cardEntry = i1.AngularEditor.toSlateCardEntry(editor, anchorNode);
4489
4604
  var cursorRootPath = cardEntry[1];
4490
- TheTransforms.insertParagraph(editor, isLeftCursor ? cursorRootPath : slate.Path.next(cursorRootPath));
4605
+ insertParagraph(editor, isLeftCursor ? cursorRootPath : slate.Path.next(cursorRootPath));
4491
4606
  if (!isLeftCursor) {
4492
4607
  slate.Transforms.select(editor, slate.Path.next(cursorRootPath));
4493
4608
  }
@@ -4507,7 +4622,7 @@
4507
4622
  if (!previousPath_1) {
4508
4623
  return;
4509
4624
  }
4510
- if (previousPath_1 && TheQueries.isEmptyParagraphByPath(editor, previousPath_1)) {
4625
+ if (previousPath_1 && isEmptyParagraphByPath(editor, previousPath_1)) {
4511
4626
  slate.Transforms.removeNodes(editor, {
4512
4627
  at: previousPath_1
4513
4628
  });
@@ -4519,18 +4634,22 @@
4519
4634
  return;
4520
4635
  }
4521
4636
  else {
4522
- TheTransforms.insertParagraph(editor, cursorRootPath);
4637
+ insertParagraph(editor, cursorRootPath);
4523
4638
  slate.Transforms.select(editor, cursorRootPath);
4524
4639
  slate.Transforms.removeNodes(editor, { at: slate.Path.next(cursorRootPath) });
4525
4640
  return;
4526
4641
  }
4527
4642
  }
4528
- var blockCard = TheQueries.getBlockCardAbove(editor);
4643
+ var blockCard = getBlockCardAbove(editor);
4529
4644
  var beforePoint = slate.Editor.before(editor, editor.selection.anchor);
4530
- var beforeBlockCard = TheQueries.getBlockCardAbove(editor, { at: beforePoint });
4645
+ var beforeBlockCard = getBlockCardAbove(editor, { at: beforePoint });
4531
4646
  if (!blockCard && beforeBlockCard) {
4532
- if (TheQueries.isBlockAboveEmpty(editor)) {
4647
+ if (isBlockAboveEmpty(editor)) {
4533
4648
  var _a = __read(slate.Editor.parent(editor, editor.selection.anchor.path), 2), node = _a[0], path = _a[1];
4649
+ slateHistory.HistoryEditor.withoutMerging(editor, function () {
4650
+ var rightCursor = { path: beforeBlockCard[1], offset: i1.FAKE_RIGHT_BLOCK_CARD_OFFSET };
4651
+ slate.Transforms.select(editor, { anchor: rightCursor, focus: rightCursor });
4652
+ });
4534
4653
  slate.Transforms.delete(editor, { at: path });
4535
4654
  return;
4536
4655
  }
@@ -4549,7 +4668,7 @@
4549
4668
  var cardEntry = i1.AngularEditor.toSlateCardEntry(editor, anchorNode);
4550
4669
  var cursorRootPath = cardEntry[1];
4551
4670
  if (isLeftCursor) {
4552
- TheTransforms.insertParagraph(editor, cursorRootPath);
4671
+ insertParagraph(editor, cursorRootPath);
4553
4672
  slate.Transforms.select(editor, cursorRootPath);
4554
4673
  slate.Transforms.removeNodes(editor, { at: slate.Path.next(cursorRootPath) });
4555
4674
  return;
@@ -4562,11 +4681,11 @@
4562
4681
  return;
4563
4682
  }
4564
4683
  }
4565
- var blockCard = TheQueries.getBlockCardAbove(editor);
4684
+ var blockCard = getBlockCardAbove(editor);
4566
4685
  var afterPoint = slate.Editor.after(editor, editor.selection.anchor);
4567
- var afterBlockCard = TheQueries.getBlockCardAbove(editor, { at: afterPoint });
4686
+ var afterBlockCard = getBlockCardAbove(editor, { at: afterPoint });
4568
4687
  if (!blockCard && afterBlockCard) {
4569
- if (TheQueries.isBlockAboveEmpty(editor)) {
4688
+ if (isBlockAboveEmpty(editor)) {
4570
4689
  slateHistory.HistoryEditor.withoutMerging(editor, function () {
4571
4690
  var leftCursor = { path: afterBlockCard[1], offset: -1 };
4572
4691
  slate.Transforms.select(editor, { anchor: leftCursor, focus: leftCursor });
@@ -4588,7 +4707,7 @@
4588
4707
  var isMoveUp = i1.hotkeys.isMoveUp(nativeEvent);
4589
4708
  var isMoveDown = i1.hotkeys.isMoveDown(nativeEvent);
4590
4709
  var isCollapsed = selection && slate.Range.isCollapsed(selection);
4591
- var anchorEntry = TheQueries.anchorBlockEntry(editor);
4710
+ var anchorEntry = anchorBlockEntry(editor);
4592
4711
  // block card cursor
4593
4712
  if (anchorNode && i1.hasBlockCard(domSelection)) {
4594
4713
  var isCardLeftCursor = i1.isCardLeft(anchorNode);
@@ -4729,7 +4848,7 @@
4729
4848
  // fix deleteBackward on the start of inline block
4730
4849
  // deleteBackward logic bug
4731
4850
  if (inlineBlockEntry && !slate.Editor.isVoid(editor, inlineBlockEntry[0]) && selection.anchor.offset === 0) {
4732
- var beforePoint = TheQueries.getPointBefore(editor, selection.focus);
4851
+ var beforePoint = getPointBefore(editor, selection.focus);
4733
4852
  slate.Transforms.select(editor, beforePoint);
4734
4853
  }
4735
4854
  deleteBackward(unit);
@@ -4743,11 +4862,11 @@
4743
4862
  var getFragment = editor.getFragment;
4744
4863
  editor.getFragment = function () {
4745
4864
  var selection = editor.selection;
4746
- var containerBlocks = __spreadArray(__spreadArray([], __read(elementKinds)), __read(TheQueries.getContainerBlocks(editor)));
4865
+ var containerBlocks = __spreadArray(__spreadArray([], __read(elementKinds)), __read(getContainerBlocks(editor)));
4747
4866
  if (selection && selection.anchor.path[0] === selection.focus.path[0]) {
4748
- var fragmentData = slate.Node.fragment(editor, selection);
4749
- var nodes = TheQueries.getSelectionNodesByType(editor, fragmentData, containerBlocks);
4750
- return nodes && slate.Element.isElement(nodes) ? nodes.children : getFragment();
4867
+ var fragmentData = getFragment();
4868
+ var nodes = getSelectionNodesByType(editor, fragmentData, containerBlocks);
4869
+ return nodes && slate.Element.isElement(nodes) ? nodes.children : fragmentData;
4751
4870
  }
4752
4871
  return getFragment();
4753
4872
  };
@@ -5342,7 +5461,7 @@
5342
5461
  }
5343
5462
  // Create the table node
5344
5463
  var table = createTable(opts, columns, rows, getCellContent);
5345
- TheEditor.insertElement(editor, table);
5464
+ insertElement(editor, table);
5346
5465
  }
5347
5466
 
5348
5467
  /**
@@ -5662,7 +5781,7 @@
5662
5781
  MarkProps.forEach(function (key) {
5663
5782
  unsetMarks[key] = null;
5664
5783
  });
5665
- TheEditor.setMarks(editor, unsetMarks, cellRange);
5784
+ setMarks(editor, unsetMarks, cellRange);
5666
5785
  });
5667
5786
  },
5668
5787
  handleSelectedCells: function (editor, handle) {
@@ -5700,7 +5819,11 @@
5700
5819
 
5701
5820
  var MarkEditor = {
5702
5821
  isMarkActive: function (editor, format) {
5703
- var node = slate.Node.get(editor, editor.selection.anchor.path);
5822
+ var _a, _b;
5823
+ if (!(editor === null || editor === void 0 ? void 0 : editor.selection)) {
5824
+ return;
5825
+ }
5826
+ var node = slate.Node.get(editor, (_b = (_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor) === null || _b === void 0 ? void 0 : _b.path);
5704
5827
  if (!slate.Text.isText(node)) {
5705
5828
  return false;
5706
5829
  }
@@ -5788,7 +5911,7 @@
5788
5911
 
5789
5912
  var HrEditor = {
5790
5913
  insertHr: function (editor) {
5791
- TheTransforms.insertElement(editor, { type: exports.ElementKinds.hr, children: [{ text: '' }] });
5914
+ insertElement(editor, { type: exports.ElementKinds.hr, children: [{ text: '' }] });
5792
5915
  }
5793
5916
  };
5794
5917
 
@@ -5797,7 +5920,7 @@
5797
5920
  key: exports.ElementKinds.hr,
5798
5921
  icon: 'horizontal-line',
5799
5922
  name: '分割线',
5800
- active: function (editor) { return TheQueries.isBlockActive(editor, exports.ElementKinds.hr); },
5923
+ active: function (editor) { return isBlockActive(editor, exports.ElementKinds.hr); },
5801
5924
  execute: function (editor) { return HrEditor.insertHr(editor); }
5802
5925
  }
5803
5926
  ];
@@ -5836,7 +5959,7 @@
5836
5959
  name: '正文',
5837
5960
  styles: { height: '40px' },
5838
5961
  execute: function (editor) { return slate.Transforms.setNodes(editor, { type: exports.ElementKinds.paragraph }); },
5839
- active: function (editor) { return TheQueries.isParagraph(editor); }
5962
+ active: function (editor) { return isParagraph(editor); }
5840
5963
  },
5841
5964
  {
5842
5965
  key: exports.ElementKinds.heading_1,
@@ -5877,18 +6000,21 @@
5877
6000
  key: exports.ElementKinds.blockquote,
5878
6001
  icon: 'blockquote',
5879
6002
  name: '引用',
5880
- active: function (editor) { return TheQueries.isBlockActive(editor, exports.ElementKinds.blockquote); },
6003
+ active: function (editor) { return isBlockActive(editor, exports.ElementKinds.blockquote); },
5881
6004
  execute: function (editor) { return BlockquoteEditor.toggleBlockquote(editor); }
5882
6005
  }
5883
6006
  ];
5884
6007
 
5885
6008
  var AlignEditor = {
5886
6009
  isActive: function (editor, alignment) {
6010
+ if (!(editor === null || editor === void 0 ? void 0 : editor.selection)) {
6011
+ return;
6012
+ }
5887
6013
  var tableCellAlign = TableEditor.isAlignActive(editor, alignment);
5888
6014
  if (tableCellAlign !== null) {
5889
6015
  return tableCellAlign;
5890
6016
  }
5891
- var blockElement = TheQueries.anchorBlock(editor);
6017
+ var blockElement = anchorBlock(editor);
5892
6018
  if (blockElement) {
5893
6019
  var align = blockElement.align;
5894
6020
  if (!align && alignment === exports.Alignment.left) {
@@ -5981,39 +6107,21 @@
5981
6107
  if (!aboveResult) {
5982
6108
  return deleteBackward(unit);
5983
6109
  }
5984
- var highestBlock = aboveResult[0];
5985
- var lowestBlock = TheQueries.anchorBlock(editor);
5986
- var wrapBlockType = highestBlock.type;
5987
- if (lowestBlock && slate.Editor.isStart(editor, editor.selection.anchor, aboveResult[1])) {
5988
- if (wrapBlockType === exports.ElementKinds.blockquote) {
5989
- if (highestBlock.children[0] === lowestBlock) {
5990
- return TheTransforms.unWrap(editor, wrapBlockType);
5991
- }
5992
- }
6110
+ var hasHandled = handleContinualDeleteBackward(editor, aboveResult, exports.ElementKinds.blockquote);
6111
+ if (hasHandled) {
6112
+ return;
5993
6113
  }
5994
- deleteBackward(unit);
6114
+ return deleteBackward(unit);
5995
6115
  };
5996
6116
  editor.insertBreak = function () {
5997
- var lowestBlock = TheQueries.anchorBlock(editor);
6117
+ var lowestBlock = anchorBlock(editor);
5998
6118
  if (!lowestBlock) {
5999
6119
  insertBreak();
6000
6120
  return;
6001
6121
  }
6002
- var isEmpty = slate.Editor.isEmpty(editor, lowestBlock);
6003
- var isEnd = slate.Editor.isEnd(editor, editor.selection.anchor, editor.selection.focus.path);
6004
- var aboveResult = slate.Editor.above(editor, {
6005
- match: function (n) { return slate.Editor.isBlock(editor, n) && n.type === exports.ElementKinds.blockquote; }
6006
- });
6007
- if (isEnd) {
6008
- editor.marks = {};
6009
- }
6010
- if (aboveResult && aboveResult[0] && isEnd && isEmpty) {
6011
- var wrapBlock = aboveResult[0];
6012
- if (wrapBlock.type === exports.ElementKinds.blockquote) {
6013
- if (wrapBlock.children[wrapBlock.children.length - 1] === lowestBlock) {
6014
- return TheTransforms.unWrap(editor, wrapBlock.type);
6015
- }
6016
- }
6122
+ var hasHandled = handleContinualInsertBreak(editor, lowestBlock, exports.ElementKinds.blockquote);
6123
+ if (hasHandled) {
6124
+ return;
6017
6125
  }
6018
6126
  var voidEntry = slate.Editor.above(editor, {
6019
6127
  match: function (n) { return slate.Editor.isBlock(editor, n) && slate.Editor.isVoid(editor, n); }
@@ -6022,7 +6130,7 @@
6022
6130
  slate.Transforms.insertNodes(editor, createEmptyParagraph());
6023
6131
  return;
6024
6132
  }
6025
- insertBreak();
6133
+ return insertBreak();
6026
6134
  };
6027
6135
  editor.isContainer = function (element) {
6028
6136
  return element.type === exports.ElementKinds.blockquote ? true : isContainer(element);
@@ -6141,6 +6249,7 @@
6141
6249
  }
6142
6250
  };
6143
6251
  TheColorSelectComponent.prototype._selectColor = function (event, color) {
6252
+ event.preventDefault();
6144
6253
  event.stopPropagation();
6145
6254
  if (this.option.specialColor && color === this.option.specialColor) {
6146
6255
  color = '';
@@ -6172,7 +6281,7 @@
6172
6281
  return TheColorSelectComponent;
6173
6282
  }());
6174
6283
  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 });
6175
- 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 });
6284
+ 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 });
6176
6285
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheColorSelectComponent, decorators: [{
6177
6286
  type: i0.Component,
6178
6287
  args: [{
@@ -6254,6 +6363,9 @@
6254
6363
  var ColorEditor = {
6255
6364
  getActiveColor: function (editor, type) {
6256
6365
  var _a;
6366
+ if (!(editor === null || editor === void 0 ? void 0 : editor.selection)) {
6367
+ return;
6368
+ }
6257
6369
  var node = slate.Node.get(editor, (_a = editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path);
6258
6370
  if (!slate.Text.isText(node)) {
6259
6371
  return undefined;
@@ -6292,10 +6404,11 @@
6292
6404
  function TheToolbarBaseItemComponent() {
6293
6405
  }
6294
6406
  TheToolbarBaseItemComponent.prototype.execute = function (event) {
6407
+ var _a;
6295
6408
  event.preventDefault();
6296
6409
  event.stopPropagation();
6297
- if (!this.itemMousedownHandle && !this.editor.selection) {
6298
- var lastNode = TheQueries.getLastNode(this.editor, 1);
6410
+ if (!this.itemMousedownHandle && !((_a = this.editor) === null || _a === void 0 ? void 0 : _a.selection)) {
6411
+ var lastNode = getLastNode(this.editor, 1);
6299
6412
  var end = slate.Editor.end(this.editor, lastNode[1]);
6300
6413
  slate.Transforms.select(this.editor, end);
6301
6414
  i1.AngularEditor.focus(this.editor);
@@ -6376,7 +6489,7 @@
6376
6489
  return TheColorToolbarItemComponent;
6377
6490
  }(TheToolbarBaseItemComponent));
6378
6491
  TheColorToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheColorToolbarItemComponent, deps: [{ token: i1__namespace$3.ThyPopover }], target: i0__namespace.ɵɵFactoryTarget.Component });
6379
- TheColorToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheColorToolbarItemComponent, selector: "the-color-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-item" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <a\n class=\"link-width-down\"\n thyIconNavLink\n [ngStyle]=\"{\n width: item.key === 'color' ? '42px' : 'auto'\n }\"\n [thyTooltip]=\"item.name\"\n [thyIconNavLinkActive]=\"active\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n >\n <thy-icon [thyIconName]=\"item.icon\" thyIconType=\"twotone\" [thyTwotoneColor]=\"active\"></thy-icon>\n <thy-icon\n [ngClass]=\"{\n 'link-down-icon': true,\n 'font-size-sm': true,\n 'text-desc': true\n }\"\n thyIconName=\"caret-down\"\n ></thy-icon>\n </a>\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.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
6492
+ TheColorToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheColorToolbarItemComponent, selector: "the-color-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-item" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <a\n class=\"link-width-down\"\n thyIconNavLink\n [ngStyle]=\"{\n width: item.key === 'color' ? '42px' : 'auto'\n }\"\n [thyTooltip]=\"item.name\"\n [thyIconNavLinkActive]=\"active\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n >\n <thy-icon [thyIconName]=\"item.icon\" thyIconType=\"twotone\" [thyTwotoneColor]=\"active\"></thy-icon>\n <thy-icon\n [ngClass]=\"{\n 'link-down-icon': true,\n 'font-size-sm': true,\n 'text-desc': true\n }\"\n thyIconName=\"caret-down\"\n ></thy-icon>\n </a>\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.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
6380
6493
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheColorToolbarItemComponent, decorators: [{
6381
6494
  type: i0.Component,
6382
6495
  args: [{
@@ -6412,7 +6525,7 @@
6412
6525
  var withRemoveVoid = function (editor) {
6413
6526
  var deleteBackward = editor.deleteBackward, deleteForward = editor.deleteForward, onKeydown = editor.onKeydown;
6414
6527
  var deleteBlockVoid = function (e) {
6415
- var aboveEntry = TheQueries.getAbove(e);
6528
+ var aboveEntry = getAbove(e);
6416
6529
  var canDelete = aboveEntry && slate.Editor.isBlock(e, aboveEntry[0]) && slate.Editor.isVoid(e, aboveEntry[0]);
6417
6530
  if (canDelete) {
6418
6531
  slate.Transforms.insertNodes(e, createEmptyParagraph(), { at: slate.Path.next(aboveEntry[1]) });
@@ -6428,7 +6541,7 @@
6428
6541
  deleteBackward(unit);
6429
6542
  };
6430
6543
  editor.onKeydown = function (event) {
6431
- var aboveEntry = TheQueries.getAbove(editor);
6544
+ var aboveEntry = getAbove(editor);
6432
6545
  if (aboveEntry && slate.Editor.isVoid(editor, aboveEntry[0]) && slate.Editor.isInline(editor, aboveEntry[0])) {
6433
6546
  if (i1.hotkeys.isDeleteBackward(event) || i1.hotkeys.isDeleteForward(event)) {
6434
6547
  event.preventDefault();
@@ -6512,7 +6625,7 @@
6512
6625
  language: DEFAULT_LANGUAGE.value,
6513
6626
  children: [{ text: '' }]
6514
6627
  };
6515
- TheTransforms.insertElement(editor, codeElement);
6628
+ insertElement(editor, codeElement);
6516
6629
  }
6517
6630
  }
6518
6631
  };
@@ -6522,7 +6635,7 @@
6522
6635
  key: exports.ElementKinds.code,
6523
6636
  icon: 'code-syntax',
6524
6637
  name: '代码块',
6525
- active: function (editor) { return TheQueries.isBlockActive(editor, exports.ElementKinds.code); },
6638
+ active: function (editor) { return isBlockActive(editor, exports.ElementKinds.code); },
6526
6639
  execute: function (editor) { return CodeEditor.insertCode(editor); }
6527
6640
  }
6528
6641
  ];
@@ -6643,7 +6756,7 @@
6643
6756
  return TheToolbarDropdownComponent;
6644
6757
  }(TheToolbarBaseItemComponent));
6645
6758
  TheToolbarDropdownComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarDropdownComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }, { token: i2__namespace$1.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Component });
6646
- TheToolbarDropdownComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item", itemMousedownHandle: "itemMousedownHandle" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenu?.name }}</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", 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"] }, { type: i5__namespace$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i5__namespace$2.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
6759
+ TheToolbarDropdownComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item", itemMousedownHandle: "itemMousedownHandle" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenu?.name }}</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", 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"] }, { type: i5__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i5__namespace$1.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$1.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
6647
6760
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarDropdownComponent, decorators: [{
6648
6761
  type: i0.Component,
6649
6762
  args: [{
@@ -6682,15 +6795,16 @@
6682
6795
 
6683
6796
  var TheCodeComponent = /** @class */ (function (_super) {
6684
6797
  __extends(TheCodeComponent, _super);
6685
- function TheCodeComponent(elementRef, cdr, thyNotifyService, ngZone) {
6798
+ function TheCodeComponent(elementRef, cdr, thyNotifyService, ngZone, mode) {
6686
6799
  var _this = _super.call(this, elementRef, cdr) || this;
6687
6800
  _this.elementRef = elementRef;
6688
6801
  _this.cdr = cdr;
6689
6802
  _this.thyNotifyService = thyNotifyService;
6690
6803
  _this.ngZone = ngZone;
6804
+ _this.mode = mode;
6691
6805
  _this.startRenderCodemirror = false;
6692
6806
  _this.dropdownMode = exports.DropdownMode;
6693
- _this.maxHeight = 350 - CODEMIRROR_PADDING_TOP * 2;
6807
+ _this.maxHeight = _this.mode === CodeMode.default ? 350 - CODEMIRROR_PADDING_TOP * 2 : 0;
6694
6808
  _this.codeMirrorFocused = false;
6695
6809
  _this.menus = CODE_MODES.map(function (item) {
6696
6810
  return { key: item.value, name: item.showName };
@@ -6701,7 +6815,7 @@
6701
6815
  readOnly: false,
6702
6816
  autofocus: false,
6703
6817
  lineWiseCopyCut: true,
6704
- lineWrapping: false,
6818
+ lineWrapping: _this.mode === CodeMode.default ? false : true,
6705
6819
  cursorBlinkRate: 500
6706
6820
  };
6707
6821
  _this.actives = _this.menus[0];
@@ -6777,7 +6891,7 @@
6777
6891
  };
6778
6892
  TheCodeComponent.prototype.onDelete = function (event) {
6779
6893
  event.preventDefault();
6780
- TheTransforms.deleteElement(this.editor, this.element);
6894
+ deleteElement(this.editor, this.element);
6781
6895
  };
6782
6896
  TheCodeComponent.prototype.onCopy = function (event) {
6783
6897
  var _this = this;
@@ -6809,8 +6923,8 @@
6809
6923
  };
6810
6924
  return TheCodeComponent;
6811
6925
  }(TheBaseElementComponent));
6812
- TheCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheCodeComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$4.ThyNotifyService }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
6813
- TheCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: i5$3.CodeMirrorComponent }], usesInheritance: true, ngImport: i0__namespace, template: "<div contenteditable=\"false\" class=\"the-block-operation\" *ngIf=\"codeMirrorFocused && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"></the-toolbar-dropdown>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n class=\"remove-link\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n </thy-icon-nav>\n</div>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n<ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n></ng-codemirror>\n", components: [{ type: i2__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["toolbarItem", "menus", "mode", "item", "itemMousedownHandle"] }, { type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i5__namespace$3.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.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"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
6926
+ TheCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheCodeComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$4.ThyNotifyService }, { token: i0__namespace.NgZone }, { token: THE_CODE_MODE_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
6927
+ TheCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: i5$2.CodeMirrorComponent }], usesInheritance: true, ngImport: i0__namespace, template: "<div contenteditable=\"false\" class=\"the-block-operation\" *ngIf=\"codeMirrorFocused && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"></the-toolbar-dropdown>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n class=\"remove-link\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n </thy-icon-nav>\n</div>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n<ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n></ng-codemirror>\n", components: [{ type: i2__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["toolbarItem", "menus", "mode", "item", "itemMousedownHandle"] }, { type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i5__namespace$2.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }], 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"] }, { 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"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
6814
6928
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheCodeComponent, decorators: [{
6815
6929
  type: i0.Component,
6816
6930
  args: [{
@@ -6818,9 +6932,14 @@
6818
6932
  templateUrl: './code.component.html',
6819
6933
  changeDetection: i0.ChangeDetectionStrategy.OnPush
6820
6934
  }]
6821
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace$4.ThyNotifyService }, { type: i0__namespace.NgZone }]; }, propDecorators: { codemirror: [{
6935
+ }], ctorParameters: function () {
6936
+ return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace$4.ThyNotifyService }, { type: i0__namespace.NgZone }, { type: CodeMode, decorators: [{
6937
+ type: i0.Inject,
6938
+ args: [THE_CODE_MODE_TOKEN]
6939
+ }] }];
6940
+ }, propDecorators: { codemirror: [{
6822
6941
  type: i0.ViewChild,
6823
- args: ['codemirror', { read: i5$3.CodeMirrorComponent, static: false }]
6942
+ args: ['codemirror', { read: i5$2.CodeMirrorComponent, static: false }]
6824
6943
  }] } });
6825
6944
 
6826
6945
  var withCode = function (editor) {
@@ -7014,7 +7133,7 @@
7014
7133
  TheLinkEditComponent.prototype.applyLink = function (form) {
7015
7134
  var link = this.link.trim();
7016
7135
  if (this.linkRegExp(link)) {
7017
- var linkPath = TheEditor.findPath(this.editor, this.node);
7136
+ var linkPath = findPath(this.editor, this.node);
7018
7137
  if (this.originLink !== link) {
7019
7138
  slate.Transforms.setNodes(this.editor, { url: link }, { at: linkPath });
7020
7139
  }
@@ -7034,7 +7153,7 @@
7034
7153
  return TheLinkEditComponent;
7035
7154
  }());
7036
7155
  TheLinkEditComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheLinkEditComponent, deps: [{ token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
7037
- TheLinkEditComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheLinkEditComponent, selector: "the-link-edit", inputs: { tag: "tag", node: "node", link: "link", text: "text", originSelection: "originSelection" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class": "this.className" } }, ngImport: i0__namespace, template: "<form\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig\"\n name=\"linkForm\"\n>\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\"\n required\n name=\"text\"\n [(ngModel)]=\"text\"\n thyAutofocus\n type=\"text\"\n />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input\n name=\"link\"\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\"\n required\n type=\"text\"\n #linkControl=\"ngModel\"\n [(ngModel)]=\"link\"\n />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button\n thyButton=\"link-secondary\"\n thySize=\"sm\"\n (click)=\"closePopover()\"\n >\u53D6\u6D88</button>\n <button\n thyButton=\"primary-square\"\n thySize=\"sm\"\n (thyFormSubmit)=\"applyLink(linkForm)\"\n >\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n", components: [{ type: i2__namespace$2.ThyFormGroupComponent, selector: "thy-form-group", inputs: ["thyLabelText", "thyLabelTextTranslateKey", "thyLabelRequired", "thyLabelPaddingTopClear", "thyFeedbackIcon", "thyTips", "thyTipsTranslateKey", "thyRowFill"] }, { type: i2__namespace$2.ThyFormGroupFooterComponent, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { type: i1__namespace$5.ThyButtonComponent, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thySquare", "thyBlock"] }], directives: [{ type: i4__namespace$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4__namespace$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4__namespace$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2__namespace$2.ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { type: i5__namespace$4.ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutoSelect", "thyAutofocus"] }, { 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.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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"] }, { type: i2__namespace$2.ThyFormSubmitDirective, selector: "[thyFormSubmit],[thy-form-submit]", outputs: ["thyFormSubmit"] }] });
7156
+ TheLinkEditComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheLinkEditComponent, selector: "the-link-edit", inputs: { tag: "tag", node: "node", link: "link", text: "text", originSelection: "originSelection" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class": "this.className" } }, ngImport: i0__namespace, template: "<form\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig\"\n name=\"linkForm\"\n>\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\"\n required\n name=\"text\"\n [(ngModel)]=\"text\"\n thyAutofocus\n type=\"text\"\n />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input\n name=\"link\"\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\"\n required\n type=\"text\"\n #linkControl=\"ngModel\"\n [(ngModel)]=\"link\"\n />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button\n thyButton=\"link-secondary\"\n thySize=\"sm\"\n (click)=\"closePopover()\"\n >\u53D6\u6D88</button>\n <button\n thyButton=\"primary-square\"\n thySize=\"sm\"\n (thyFormSubmit)=\"applyLink(linkForm)\"\n >\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n", components: [{ type: i2__namespace$2.ThyFormGroupComponent, selector: "thy-form-group", inputs: ["thyLabelText", "thyLabelTextTranslateKey", "thyLabelRequired", "thyLabelPaddingTopClear", "thyFeedbackIcon", "thyTips", "thyTipsTranslateKey", "thyRowFill"] }, { type: i2__namespace$2.ThyFormGroupFooterComponent, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { type: i1__namespace$5.ThyButtonComponent, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thySquare", "thyBlock"] }], directives: [{ type: i4__namespace$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4__namespace$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4__namespace$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2__namespace$2.ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { type: i5__namespace$3.ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutoSelect", "thyAutofocus"] }, { 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.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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"] }, { type: i2__namespace$2.ThyFormSubmitDirective, selector: "[thyFormSubmit],[thy-form-submit]", outputs: ["thyFormSubmit"] }] });
7038
7157
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheLinkEditComponent, decorators: [{
7039
7158
  type: i0.Component,
7040
7159
  args: [{
@@ -7261,6 +7380,7 @@
7261
7380
  editor.insertText = function (text) {
7262
7381
  if (text && isUrl__default["default"](text)) {
7263
7382
  LinkEditor.wrapLink(editor, text, text);
7383
+ slate.Transforms.move(editor, { distance: 1, unit: "offset" });
7264
7384
  }
7265
7385
  else {
7266
7386
  insertText(text);
@@ -7268,8 +7388,10 @@
7268
7388
  };
7269
7389
  editor.insertData = function (data) {
7270
7390
  var text = data.getData('text/plain');
7271
- if (text && isUrl__default["default"](text)) {
7391
+ var fragment = data.getData("application/" + CLIPBOARD_FORMAT_KEY);
7392
+ if (text && isUrl__default["default"](text) && !fragment) {
7272
7393
  LinkEditor.wrapLink(editor, text, text);
7394
+ slate.Transforms.move(editor, { distance: 1, unit: "offset" });
7273
7395
  }
7274
7396
  else {
7275
7397
  insertData(data);
@@ -7359,9 +7481,9 @@
7359
7481
  return;
7360
7482
  }
7361
7483
  var type = this.item.key;
7362
- this.toggleTableSelect(event, type);
7484
+ this.toggleTableSelect(event);
7363
7485
  };
7364
- TheTableToolbarItemComponent.prototype.toggleTableSelect = function (event, type, optionsParam) {
7486
+ TheTableToolbarItemComponent.prototype.toggleTableSelect = function (event, optionsParam) {
7365
7487
  if (this.isOpenTableSelect) {
7366
7488
  this.tableSelectRef.close();
7367
7489
  return;
@@ -7385,7 +7507,7 @@
7385
7507
  return TheTableToolbarItemComponent;
7386
7508
  }(TheToolbarBaseItemComponent));
7387
7509
  TheTableToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheTableToolbarItemComponent, deps: [{ token: i1__namespace$6.ThyPopover }, { token: i2__namespace$1.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Component });
7388
- TheTableToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheTableToolbarItemComponent, selector: "the-table-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-dropdown-container" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <a\n thyIconNavLink\n class=\"link-with-down\"\n [thyTooltip]=\"item?.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n >\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n <thy-icon class=\"link-down-icon font-size-sm text-desc table-down-icon\" thyIconName=\"caret-down\"> </thy-icon>\n </a>\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: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
7510
+ TheTableToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheTableToolbarItemComponent, selector: "the-table-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-dropdown-container" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <a\n thyIconNavLink\n class=\"link-with-down\"\n [thyTooltip]=\"item?.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n >\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n <thy-icon class=\"link-down-icon font-size-sm text-desc table-down-icon\" thyIconName=\"caret-down\"> </thy-icon>\n </a>\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: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
7389
7511
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheTableToolbarItemComponent, decorators: [{
7390
7512
  type: i0.Component,
7391
7513
  args: [{
@@ -7554,7 +7676,7 @@
7554
7676
  selectCellNodes.forEach(function (cell, index) {
7555
7677
  var row = cell.row, node = cell.node;
7556
7678
  if (node) {
7557
- var cellPath = TheEditor.findPath(editor, node);
7679
+ var cellPath = findPath(editor, node);
7558
7680
  if (index === 0) {
7559
7681
  leftTopCellPath = cellPath;
7560
7682
  }
@@ -8136,7 +8258,7 @@
8136
8258
  table.children.map(function (row, rowIndex) {
8137
8259
  row.children.map(function (col, colIndex) {
8138
8260
  if (rowIndex >= cellRow && rowIndex <= rowSpanIndex && colIndex >= cellCol && colIndex <= colSpanIndex) {
8139
- var path = TheEditor.findPath(editor, col);
8261
+ var path = findPath(editor, col);
8140
8262
  slate.Transforms.setNodes(editor, { colspan: null, rowspan: null, hidden: null }, { at: path });
8141
8263
  }
8142
8264
  });
@@ -8157,6 +8279,49 @@
8157
8279
  });
8158
8280
  }
8159
8281
 
8282
+ var NavSplitLineComponent = /** @class */ (function () {
8283
+ function NavSplitLineComponent() {
8284
+ this.mode = exports.ToolbarItemMode.vertical;
8285
+ this.theNavSplitLine = true;
8286
+ }
8287
+ Object.defineProperty(NavSplitLineComponent.prototype, "horizontal", {
8288
+ get: function () {
8289
+ return this.mode === exports.ToolbarItemMode.horizontal;
8290
+ },
8291
+ enumerable: false,
8292
+ configurable: true
8293
+ });
8294
+ Object.defineProperty(NavSplitLineComponent.prototype, "vertical", {
8295
+ get: function () {
8296
+ return this.mode === exports.ToolbarItemMode.vertical;
8297
+ },
8298
+ enumerable: false,
8299
+ configurable: true
8300
+ });
8301
+ NavSplitLineComponent.prototype.ngOnInit = function () { };
8302
+ return NavSplitLineComponent;
8303
+ }());
8304
+ NavSplitLineComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: NavSplitLineComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
8305
+ 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 });
8306
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: NavSplitLineComponent, decorators: [{
8307
+ type: i0.Component,
8308
+ args: [{
8309
+ selector: 'nav-split-line',
8310
+ template: ''
8311
+ }]
8312
+ }], ctorParameters: function () { return []; }, propDecorators: { mode: [{
8313
+ type: i0.Input
8314
+ }], theNavSplitLine: [{
8315
+ type: i0.HostBinding,
8316
+ args: ['class.the-nav-split-line']
8317
+ }], horizontal: [{
8318
+ type: i0.HostBinding,
8319
+ args: ['class.horizontal']
8320
+ }], vertical: [{
8321
+ type: i0.HostBinding,
8322
+ args: ['class.vertical']
8323
+ }] } });
8324
+
8160
8325
  var TheTableToolbarComponent = /** @class */ (function () {
8161
8326
  function TheTableToolbarComponent(ngZone, colorSelectService, popoverRef) {
8162
8327
  var _this = this;
@@ -8278,7 +8443,7 @@
8278
8443
  return TheTableToolbarComponent;
8279
8444
  }());
8280
8445
  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 });
8281
- 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\"\n (mousedown)=\"item.actionHandle()\">\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n </a>\n </ng-container>\n <span class=\"nav-split-line\" *ngIf=\"!isActiveSelect && isShowSplitLine\"></span>\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 <span class=\"nav-split-line\" *ngIf=\"deleteIcon\"></span>\n <a *ngIf=\"deleteIcon\" href=\"javascript:;\" thyIconNavLink [thyTooltip]=\"iconName\" class=\"danger\"\n [thyIconNavLinkIcon]=\"deleteIcon\" (mousedown)=\"onDelete($event)\" (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"></a>\n</thy-icon-nav>", 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"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
8446
+ 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"] }] });
8282
8447
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheTableToolbarComponent, decorators: [{
8283
8448
  type: i0.Component,
8284
8449
  args: [{
@@ -8342,7 +8507,7 @@
8342
8507
  return TheContextMenuComponent;
8343
8508
  }());
8344
8509
  TheContextMenuComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheContextMenuComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
8345
- TheContextMenuComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheContextMenuComponent, selector: "the-contextmenu", inputs: { menuEntities: "menuEntities", actionHandle: "actionHandle", activeHandle: "activeHandle", deactiveHandle: "deactiveHandle" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)" }, properties: { "class.the-overlay-menu-wrap": "this.wrap" } }, ngImport: i0__namespace, template: "<thy-action-menu>\n <ng-container *ngFor=\"let menuItem of menuEntities\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n *ngIf=\"!menuItem.invisibility\"\n (mousedown)=\"itemMousedown($event, menuItem)\"\n (mouseenter)=\"itemMouseenter($event, menuItem)\"\n (mouseleave)=\"itemMouseleave($event, menuItem)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon\n *ngIf=\"menuItem.backgroundColor; else elseIcon\"\n [thyIconName]=\"menuItem.icon\"\n thyIconType=\"twotone\"\n [thyTwotoneColor]=\"menuItem.backgroundColor\"\n ></thy-icon>\n <ng-template #elseIcon>\n <thy-icon [thyIconName]=\"menuItem.icon\"></thy-icon>\n </ng-template>\n </span>\n <span thyActionMenuItemName>{{ menuItem.name }}</span>\n <span *ngIf=\"menuItem.extendIcon\" thyActionMenuItemExtendIcon>\n <thy-icon thyIconName=\"{{ menuItem.extendIcon }}\"></thy-icon>\n </span>\n </a>\n <thy-action-menu-divider *ngIf=\"menuItem.divider\"></thy-action-menu-divider>\n </ng-container>\n</thy-action-menu>\n", components: [{ type: i5__namespace$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$2.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }, { type: i5__namespace$2.ThyActionMenuItemExtendIconDirective, selector: "[thyActionMenuItemExtendIcon]" }] });
8510
+ TheContextMenuComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheContextMenuComponent, selector: "the-contextmenu", inputs: { menuEntities: "menuEntities", actionHandle: "actionHandle", activeHandle: "activeHandle", deactiveHandle: "deactiveHandle" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)" }, properties: { "class.the-overlay-menu-wrap": "this.wrap" } }, ngImport: i0__namespace, template: "<thy-action-menu>\n <ng-container *ngFor=\"let menuItem of menuEntities\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n *ngIf=\"!menuItem.invisibility\"\n (mousedown)=\"itemMousedown($event, menuItem)\"\n (mouseenter)=\"itemMouseenter($event, menuItem)\"\n (mouseleave)=\"itemMouseleave($event, menuItem)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon\n *ngIf=\"menuItem.backgroundColor; else elseIcon\"\n [thyIconName]=\"menuItem.icon\"\n thyIconType=\"twotone\"\n [thyTwotoneColor]=\"menuItem.backgroundColor\"\n ></thy-icon>\n <ng-template #elseIcon>\n <thy-icon [thyIconName]=\"menuItem.icon\"></thy-icon>\n </ng-template>\n </span>\n <span thyActionMenuItemName>{{ menuItem.name }}</span>\n <span *ngIf=\"menuItem.extendIcon\" thyActionMenuItemExtendIcon>\n <thy-icon thyIconName=\"{{ menuItem.extendIcon }}\"></thy-icon>\n </span>\n </a>\n <thy-action-menu-divider *ngIf=\"menuItem.divider\"></thy-action-menu-divider>\n </ng-container>\n</thy-action-menu>\n", components: [{ type: i5__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$1.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }, { type: i5__namespace$1.ThyActionMenuItemExtendIconDirective, selector: "[thyActionMenuItemExtendIcon]" }] });
8346
8511
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheContextMenuComponent, decorators: [{
8347
8512
  type: i0.Component,
8348
8513
  args: [{
@@ -8745,7 +8910,7 @@
8745
8910
  return TheInsertMarkComponent;
8746
8911
  }());
8747
8912
  TheInsertMarkComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInsertMarkComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
8748
- TheInsertMarkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: { type: "type", at: "at", tableStore: "tableStore" }, ngImport: i0__namespace, template: "<div\n [thyTooltip]=\"!disabled && tooltipContent\"\n class=\"the-table-controls-insert-wrapper\"\n [ngClass]=\"{ disabled: disabled }\"\n contenteditable=\"false\"\n (mousedown)=\"onMouseDown($event)\"\n (mouseenter)=\"onMouseEnter($event)\"\n (mouseleave)=\"onMouseLeave($event)\"\n>\n <div\n class=\"the-table-controls-insert-line\"\n *ngIf=\"dotWrapperHovered\"\n [attr.data-dot-type]=\"type\"\n [ngStyle]=\"{ height: type === 'column' && insertLength, width: type === 'row' && insertLength }\"\n ></div>\n</div>\n", directives: [{ type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
8913
+ TheInsertMarkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: { type: "type", at: "at", tableStore: "tableStore" }, ngImport: i0__namespace, template: "<div\n [thyTooltip]=\"!disabled && tooltipContent\"\n class=\"the-table-controls-insert-wrapper\"\n [ngClass]=\"{ disabled: disabled }\"\n contenteditable=\"false\"\n (mousedown)=\"onMouseDown($event)\"\n (mouseenter)=\"onMouseEnter($event)\"\n (mouseleave)=\"onMouseLeave($event)\"\n>\n <div\n class=\"the-table-controls-insert-line\"\n *ngIf=\"dotWrapperHovered\"\n [attr.data-dot-type]=\"type\"\n [ngStyle]=\"{ height: type === 'column' && insertLength, width: type === 'row' && insertLength }\"\n ></div>\n</div>\n", directives: [{ type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
8749
8914
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInsertMarkComponent, decorators: [{
8750
8915
  type: i0.Component,
8751
8916
  args: [{
@@ -8987,9 +9152,12 @@
8987
9152
  TheTableComponent.prototype.useRowControls = function () {
8988
9153
  if (this.selection) {
8989
9154
  this.rowControls = this.calculateRowControls();
8990
- this.cdr.detectChanges();
9155
+ this.cdr.markForCheck();
8991
9156
  }
8992
9157
  };
9158
+ TheTableComponent.prototype.detectChanges = function () {
9159
+ this.cdr.detectChanges();
9160
+ };
8993
9161
  TheTableComponent.prototype.calculateMinRowSpanCellForRows = function () {
8994
9162
  var table = this.element;
8995
9163
  var cells = table.children.map(function (row, index) {
@@ -9146,7 +9314,7 @@
9146
9314
  var columns = tr_1.children.map(function (cell) {
9147
9315
  return { width: Math.round(tableWidth_1 / tr_1.children.length) - tr_1.children.length };
9148
9316
  });
9149
- TheEditor.setNode(this.editor, { columns: columns }, this.element);
9317
+ setNode(this.editor, { columns: columns }, this.element);
9150
9318
  }
9151
9319
  };
9152
9320
  TheTableComponent.prototype.initializeRows = function () {
@@ -9154,7 +9322,7 @@
9154
9322
  this.element.children.map(function (row) {
9155
9323
  if (!row.height) {
9156
9324
  var element = TheEditor.toDOMNode(_this.editor, row);
9157
- TheEditor.setNode(_this.editor, { height: getElementHeight(element) }, row);
9325
+ setNode(_this.editor, { height: getElementHeight(element) }, row);
9158
9326
  }
9159
9327
  });
9160
9328
  };
@@ -9162,9 +9330,9 @@
9162
9330
  var _this = this;
9163
9331
  var rowElements = this.nativeElement.querySelector('tbody').children;
9164
9332
  if (rowElements) {
9165
- __spreadArray([], __read(rowElements)).map(function (row, index) {
9333
+ __spreadArray([], __read(rowElements)).map(function (row, index$1) {
9166
9334
  var height = getElementHeight(row);
9167
- TheEditor.setNode(_this.editor, { height: height }, _this.element.children[index]);
9335
+ setNode(_this.editor, { height: height }, _this.element.children[index$1]);
9168
9336
  });
9169
9337
  }
9170
9338
  };
@@ -9173,7 +9341,7 @@
9173
9341
  var columns = cols.map(function (col) {
9174
9342
  return { width: getElementWidth(col) };
9175
9343
  });
9176
- TheEditor.setNode(this.editor, { columns: columns }, this.element);
9344
+ setNode(this.editor, { columns: columns }, this.element);
9177
9345
  };
9178
9346
  TheTableComponent.prototype.onRowMouseDown = function (event, index) {
9179
9347
  event.stopPropagation();
@@ -9258,7 +9426,7 @@
9258
9426
  provide: TheTableToken,
9259
9427
  useExisting: TheTableComponent
9260
9428
  }
9261
- ], 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"] }] });
9429
+ ], 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"] }] });
9262
9430
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheTableComponent, decorators: [{
9263
9431
  type: i0.Component,
9264
9432
  args: [{
@@ -9317,9 +9485,9 @@
9317
9485
  function calculateAnchorPositionInCell(editor) {
9318
9486
  var isFirstLine = false;
9319
9487
  var isLastLine = false;
9320
- var anchorBlock = TheEditor.anchorBlock(editor);
9321
- var anchorBlockPath = TheEditor.findPath(editor, anchorBlock);
9322
- var anchorBlockDom = TheEditor.toDOMNode(editor, anchorBlock);
9488
+ var anchorBlock$1 = anchorBlock(editor);
9489
+ var anchorBlockPath = findPath(editor, anchorBlock$1);
9490
+ var anchorBlockDom = i1.AngularEditor.toDOMNode(editor, anchorBlock$1);
9323
9491
  var valueRangeRect = anchorBlockDom.getBoundingClientRect();
9324
9492
  var anchorBlockHeight = window.getComputedStyle(anchorBlockDom).lineHeight;
9325
9493
  var nativeSelection = window.getSelection();
@@ -9346,11 +9514,13 @@
9346
9514
  _super.prototype.onContextChange.call(this);
9347
9515
  if (this.initialized) {
9348
9516
  this.useBackground();
9517
+ this.useHeight();
9349
9518
  }
9350
9519
  };
9351
9520
  TheTableRowComponent.prototype.ngOnInit = function () {
9352
9521
  _super.prototype.ngOnInit.call(this);
9353
9522
  this.useBackground();
9523
+ this.useHeight();
9354
9524
  };
9355
9525
  TheTableRowComponent.prototype.useBackground = function () {
9356
9526
  if (this.element.header && !this.backgroundColor) {
@@ -10173,6 +10343,7 @@
10173
10343
  this.applyRowSize(deltaSize);
10174
10344
  }
10175
10345
  this.tableComponent.useRowControls();
10346
+ this.tableComponent.detectChanges();
10176
10347
  this.updateOverlayHandleSizeAndOffset();
10177
10348
  };
10178
10349
  TheTdComponent.prototype._createOverlayForHandle = function () {
@@ -10446,8 +10617,8 @@
10446
10617
  if (startBlockPath.length <= startPosition.cellEntry[1].length + 1 &&
10447
10618
  startBlockPath.pop() === 0 &&
10448
10619
  selection.anchor.offset === 0 &&
10449
- TheEditor.isStart(editor, selection.anchor, startBlockPath) &&
10450
- !slate.Editor.isVoid(editor, TheEditor.anchorBlock(editor))) {
10620
+ isStart(editor, selection.anchor, startBlockPath) &&
10621
+ !slate.Editor.isVoid(editor, anchorBlock(editor))) {
10451
10622
  return;
10452
10623
  }
10453
10624
  deleteBackward(unit);
@@ -10487,11 +10658,11 @@
10487
10658
  var _a = calculateAnchorPositionInCell(editor), isFirstLine = _a.isFirstLine, isLastLine = _a.isLastLine;
10488
10659
  startPath.pop();
10489
10660
  endPath.pop();
10490
- if ((TheEditor.anchorBlockEntry(editor)[1].toString() !== startPath.toString() || !isFirstLine) && isMoveUp) {
10661
+ if ((anchorBlockEntry(editor)[1].toString() !== startPath.toString() || !isFirstLine) && isMoveUp) {
10491
10662
  onKeydown(event);
10492
10663
  return;
10493
10664
  }
10494
- if ((TheEditor.anchorBlockEntry(editor)[1].toString() !== endPath.toString() || !isLastLine) && isMoveDown) {
10665
+ if ((anchorBlockEntry(editor)[1].toString() !== endPath.toString() || !isLastLine) && isMoveDown) {
10495
10666
  onKeydown(event);
10496
10667
  return;
10497
10668
  }
@@ -10687,7 +10858,7 @@
10687
10858
  setFragmentData(unit);
10688
10859
  };
10689
10860
  editor.insertData = function (data) {
10690
- var fragment = extractFragment(data, ELEMENT_UNIQUE_ID);
10861
+ var fragment = extractFragment(data);
10691
10862
  if (fragment) {
10692
10863
  var opts = new TableOptions$1();
10693
10864
  var selection = editor.selection;
@@ -10822,7 +10993,7 @@
10822
10993
  var _b = __read(_a, 2), currentNode = _b[0], currentPath = _b[1];
10823
10994
  if (slate.Text.isText(currentNode) && currentPath.length) {
10824
10995
  var _c = __read(slate.Editor.parent(editor, currentPath), 1), node = _c[0];
10825
- var containerBlocks = __spreadArray(__spreadArray([], __read(types)), __read(TheQueries.getContainerBlocks(editor)));
10996
+ var containerBlocks = __spreadArray(__spreadArray([], __read(types)), __read(getContainerBlocks(editor)));
10826
10997
  if (slate.Element.isElement(node) && containerBlocks.includes(node.type)) {
10827
10998
  var paragraph = createEmptyParagraph();
10828
10999
  paragraph.children[0].text = currentNode.text;
@@ -10844,7 +11015,12 @@
10844
11015
  if (html && !slateFragment) {
10845
11016
  var htmlDom = new DOMParser().parseFromString(html, 'text/html');
10846
11017
  var fragment = selene.TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
10847
- TheTransforms.insertTheElements(editor, fragment);
11018
+ // 无法识别HTML内容时后退一下:识别纯文本
11019
+ if (fragment.length === 1 && slate.Editor.isEmpty(editor, fragment[0]) && fragment[0].type === exports.ElementKinds.paragraph) {
11020
+ insertData(data);
11021
+ return;
11022
+ }
11023
+ insertTheElements(editor, fragment);
10848
11024
  return;
10849
11025
  }
10850
11026
  insertData(data);
@@ -10885,6 +11061,11 @@
10885
11061
  enumerable: false,
10886
11062
  configurable: true
10887
11063
  });
11064
+ TheVerticalToolbarItemComponent.prototype.handleDocumentMouseDown = function (event) {
11065
+ if (!this.elementRef.nativeElement.contains(event.target)) {
11066
+ this.close();
11067
+ }
11068
+ };
10888
11069
  TheVerticalToolbarItemComponent.prototype.ngOnInit = function () { };
10889
11070
  TheVerticalToolbarItemComponent.prototype.statusChange = function (editor) {
10890
11071
  var _a, _b;
@@ -10925,7 +11106,7 @@
10925
11106
  offset: 10,
10926
11107
  viewContainerRef: this.viewContainerRef,
10927
11108
  insideClosable: false,
10928
- backdropClosable: true,
11109
+ backdropClosable: false,
10929
11110
  hasBackdrop: false
10930
11111
  });
10931
11112
  };
@@ -10937,7 +11118,7 @@
10937
11118
  return TheVerticalToolbarItemComponent;
10938
11119
  }(TheToolbarBaseItemComponent));
10939
11120
  TheVerticalToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$6.ThyPopover }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
10940
- TheVerticalToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", inputs: { item: "item", menus: "menus", editor: "editor", toolbarItem: "toolbarItem" }, host: { properties: { "class.hide": "!active" }, classAttribute: "the-toolbar-dropdown-container verticalAlign" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["VerticalAlignItems"], descendants: true, read: i0.TemplateRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a\n thyIconNavLink\n class=\"icon-mode link-with-down\"\n [thyTooltip]=\"toolbarItem?.name\"\n [thyIconNavLinkActive]=\"isOpened\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a thyActionMenuItem href=\"javascript:;\" (mousedown)=\"itemMousedown($event, menu)\" [ngStyle]=\"menu?.styles\">\n <span *ngIf=\"menu.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu?.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: 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: i5__namespace$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
11121
+ TheVerticalToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", inputs: { item: "item", menus: "menus", editor: "editor", toolbarItem: "toolbarItem" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.hide": "!active" }, classAttribute: "the-toolbar-dropdown-container verticalAlign" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["VerticalAlignItems"], descendants: true, read: i0.TemplateRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a\n thyIconNavLink\n class=\"icon-mode link-with-down\"\n [thyTooltip]=\"toolbarItem?.name\"\n [thyIconNavLinkActive]=\"isOpened\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu?.key\"\n [ngStyle]=\"menu?.styles\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span *ngIf=\"menu.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu?.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: 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: i5__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$1.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
10941
11122
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, decorators: [{
10942
11123
  type: i0.Component,
10943
11124
  args: [{
@@ -10959,6 +11140,9 @@
10959
11140
  }], template: [{
10960
11141
  type: i0.ViewChild,
10961
11142
  args: ['VerticalAlignItems', { read: i0.TemplateRef, static: true }]
11143
+ }], handleDocumentMouseDown: [{
11144
+ type: i0.HostListener,
11145
+ args: ['document: mousedown', ['$event']]
10962
11146
  }] } });
10963
11147
 
10964
11148
  var VerticalAlignOptions = [
@@ -10994,13 +11178,383 @@
10994
11178
  }
10995
11179
  ];
10996
11180
 
11181
+ var PaintFormatEditor = {
11182
+ formatBrush: function (editor) {
11183
+ var e_1, _a;
11184
+ var contextService = editor.injector.get(TheContextService);
11185
+ var obj = {};
11186
+ try {
11187
+ for (var MarkProps_1 = __values(MarkProps), MarkProps_1_1 = MarkProps_1.next(); !MarkProps_1_1.done; MarkProps_1_1 = MarkProps_1.next()) {
11188
+ var key = MarkProps_1_1.value;
11189
+ var k = contextService.paintFormatStatus.marks[key];
11190
+ obj[key] = k || null;
11191
+ }
11192
+ }
11193
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
11194
+ finally {
11195
+ try {
11196
+ if (MarkProps_1_1 && !MarkProps_1_1.done && (_a = MarkProps_1.return)) _a.call(MarkProps_1);
11197
+ }
11198
+ finally { if (e_1) throw e_1.error; }
11199
+ }
11200
+ var block = anchorBlock(editor);
11201
+ if (block && slate.Range.isCollapsed(editor.selection)) {
11202
+ // TODO:: 在撤销时有bug, 临时使用withoutSaving处理
11203
+ slateHistory.HistoryEditor.withoutSaving(editor, function () {
11204
+ var path = TheEditor.findPath(editor, block);
11205
+ setMarks(editor, obj, path);
11206
+ });
11207
+ }
11208
+ else {
11209
+ setMarks(editor, obj);
11210
+ }
11211
+ PaintFormatEditor.cancelFormatBrushStatus(editor);
11212
+ },
11213
+ isActive: function (editor) {
11214
+ var contextService = editor.injector.get(TheContextService);
11215
+ var res = contextService.paintFormatStatus.isActive;
11216
+ return res;
11217
+ },
11218
+ enableFormatBrush: function (editor) {
11219
+ var contextService = editor.injector.get(TheContextService);
11220
+ if (contextService.paintFormatStatus.isActive) {
11221
+ return PaintFormatEditor.cancelFormatBrushStatus(editor);
11222
+ }
11223
+ contextService.paintFormatStatus = {
11224
+ isActive: true,
11225
+ marks: getSelectionMarks(editor)
11226
+ };
11227
+ var element = i1.EDITOR_TO_ELEMENT.get(editor);
11228
+ element.classList.add('pointer-paint');
11229
+ contextService.onMouseUp$
11230
+ .pipe(operators.skip(1), operators.filter(function (event) { return element.contains(event.target); }), operators.take(1))
11231
+ .subscribe(function (event) {
11232
+ if (contextService.paintFormatStatus.isActive) {
11233
+ PaintFormatEditor.formatBrush(editor);
11234
+ }
11235
+ });
11236
+ editor.onChange();
11237
+ },
11238
+ cancelFormatBrushStatus: function (editor) {
11239
+ var contextService = editor.injector.get(TheContextService);
11240
+ contextService.paintFormatStatus = {
11241
+ isActive: false,
11242
+ marks: {}
11243
+ };
11244
+ var element = i1.EDITOR_TO_ELEMENT.get(editor);
11245
+ element.classList.remove('pointer-paint');
11246
+ editor.onChange();
11247
+ }
11248
+ };
11249
+
11250
+ var PaintFormatOptions = [
11251
+ {
11252
+ key: exports.ToolbarActionTypes.undo,
11253
+ icon: 'undo',
11254
+ name: '撤销',
11255
+ execute: function (editor) { return editor.undo(); }
11256
+ },
11257
+ {
11258
+ key: exports.ToolbarActionTypes.redo,
11259
+ icon: 'redo',
11260
+ name: '重做',
11261
+ execute: function (editor) { return editor.redo(); }
11262
+ },
11263
+ {
11264
+ key: exports.ToolbarActionTypes.paintformat,
11265
+ icon: 'paintformat',
11266
+ name: '格式刷',
11267
+ execute: PaintFormatEditor.enableFormatBrush,
11268
+ active: PaintFormatEditor.isActive
11269
+ },
11270
+ {
11271
+ key: exports.ToolbarActionTypes.clean,
11272
+ icon: 'clean',
11273
+ name: '清除格式',
11274
+ execute: function (editor) {
11275
+ var e_1, _a;
11276
+ var selection = editor.selection;
11277
+ if (!selection) {
11278
+ return;
11279
+ }
11280
+ if (TableEditor.clearMark(editor)) {
11281
+ return;
11282
+ }
11283
+ if (slate.Range.isCollapsed(selection)) {
11284
+ var marks = slate.Editor.marks(editor);
11285
+ try {
11286
+ for (var _b = __values(Object.keys(marks)), _c = _b.next(); !_c.done; _c = _b.next()) {
11287
+ var key = _c.value;
11288
+ slate.Editor.removeMark(editor, key);
11289
+ }
11290
+ }
11291
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
11292
+ finally {
11293
+ try {
11294
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
11295
+ }
11296
+ finally { if (e_1) throw e_1.error; }
11297
+ }
11298
+ }
11299
+ else {
11300
+ var unsetMarks_1 = {};
11301
+ MarkProps.forEach(function (key) {
11302
+ unsetMarks_1[key] = null;
11303
+ });
11304
+ setMarks(editor, unsetMarks_1);
11305
+ }
11306
+ }
11307
+ }
11308
+ ];
11309
+
11310
+ /**
11311
+ * whether the current node is a clean paragraph
11312
+ * @param editor
11313
+ * @param text
11314
+ * @returns boolean
11315
+ */
11316
+ var isCleanEmptyParagraph = function (editor) {
11317
+ var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
11318
+ if (!isCollapsedCursor) {
11319
+ return false;
11320
+ }
11321
+ var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
11322
+ var textIndent = 'textIndent';
11323
+ var align = 'align';
11324
+ var hasTextIndent = block[textIndent];
11325
+ var hasAlign = block[align];
11326
+ if (slate.Node.string(block) === '' &&
11327
+ slate.Element.isElement(block) &&
11328
+ block.type === exports.ElementKinds.paragraph &&
11329
+ block.children.length === 1 &&
11330
+ slate.Text.isText(block.children[0]) &&
11331
+ !slate.Editor.isVoid(editor, block) &&
11332
+ !hasTextIndent &&
11333
+ !hasAlign) {
11334
+ return true;
11335
+ }
11336
+ return false;
11337
+ };
11338
+
11339
+ var TheToolbarItemComponent = /** @class */ (function (_super) {
11340
+ __extends(TheToolbarItemComponent, _super);
11341
+ function TheToolbarItemComponent(ngZone, cfr) {
11342
+ var _this = _super.call(this) || this;
11343
+ _this.ngZone = ngZone;
11344
+ _this.cfr = cfr;
11345
+ _this.itemMode = exports.ToolbarItemMode.horizontal;
11346
+ _this.ToolbarItemMode = exports.ToolbarItemMode;
11347
+ _this.active = false;
11348
+ return _this;
11349
+ }
11350
+ TheToolbarItemComponent.prototype.ngOnInit = function () {
11351
+ var _a, _b;
11352
+ 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)) {
11353
+ this.renderToolbarItem();
11354
+ }
11355
+ };
11356
+ TheToolbarItemComponent.prototype.statusChange = function (editor) {
11357
+ var _a, _b;
11358
+ 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;
11359
+ };
11360
+ TheToolbarItemComponent.prototype.execute = function (event) {
11361
+ var _a, _b, _c;
11362
+ _super.prototype.execute.call(this, event);
11363
+ if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11364
+ return;
11365
+ }
11366
+ (_c = this.item) === null || _c === void 0 ? void 0 : _c.execute(this.editor);
11367
+ };
11368
+ TheToolbarItemComponent.prototype.renderToolbarItem = function () {
11369
+ var _this = this;
11370
+ this.ngZone.run(function () {
11371
+ var toolbarItemFactory = _this.cfr.resolveComponentFactory(_this.item.quickItemComponent);
11372
+ var tollbarItemRef = _this.toolbarContainer.createComponent(toolbarItemFactory);
11373
+ tollbarItemRef.instance.editor = _this.editor;
11374
+ tollbarItemRef.instance.item = _this.item;
11375
+ tollbarItemRef.instance.itemMode = exports.ToolbarItemMode.vertical;
11376
+ });
11377
+ };
11378
+ return TheToolbarItemComponent;
11379
+ }(TheToolbarBaseItemComponent));
11380
+ 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 });
11381
+ 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"] }] });
11382
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, decorators: [{
11383
+ type: i0.Component,
11384
+ args: [{
11385
+ selector: 'the-toolbar-item',
11386
+ 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 ",
11387
+ host: {
11388
+ class: 'the-toolbar-item'
11389
+ }
11390
+ }]
11391
+ }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: i0__namespace.ComponentFactoryResolver }]; }, propDecorators: { item: [{
11392
+ type: i0.Input
11393
+ }], editor: [{
11394
+ type: i0.Input
11395
+ }], itemMode: [{
11396
+ type: i0.Input
11397
+ }], toolbarContainer: [{
11398
+ type: i0.ViewChild,
11399
+ args: ['toolbarContainer', { read: i0.ViewContainerRef, static: true }]
11400
+ }] } });
11401
+
11402
+ var TheQuickToolbarComponent = /** @class */ (function (_super) {
11403
+ __extends(TheQuickToolbarComponent, _super);
11404
+ function TheQuickToolbarComponent(popoverRef, elementRef) {
11405
+ var _this = _super.call(this) || this;
11406
+ _this.popoverRef = popoverRef;
11407
+ _this.elementRef = elementRef;
11408
+ _this.ToolbarItemMode = exports.ToolbarItemMode;
11409
+ _this.ToolbarActionTypes = exports.ToolbarActionTypes;
11410
+ return _this;
11411
+ }
11412
+ TheQuickToolbarComponent.prototype.handleMouseDown = function (event) {
11413
+ if (!this.elementRef.nativeElement.contains(event.target)) {
11414
+ this.popoverRef.close();
11415
+ }
11416
+ else {
11417
+ event.preventDefault();
11418
+ }
11419
+ };
11420
+ TheQuickToolbarComponent.prototype.handleEnter = function () {
11421
+ this.popoverRef.close();
11422
+ };
11423
+ TheQuickToolbarComponent.prototype.ngOnInit = function () {
11424
+ this.editorElement = i1.AngularEditor.toDOMNode(this.editor, this.editor);
11425
+ };
11426
+ TheQuickToolbarComponent.prototype.stopPropagation = function (event) {
11427
+ event.preventDefault();
11428
+ };
11429
+ TheQuickToolbarComponent.prototype.selectionChange = function (event) {
11430
+ this.removeHotKey();
11431
+ var toolbarItem = this.quickToolbarItems.find(function (item) { return item.key === event.value; });
11432
+ if (toolbarItem === null || toolbarItem === void 0 ? void 0 : toolbarItem.execute) {
11433
+ toolbarItem.execute(this.editor);
11434
+ }
11435
+ };
11436
+ TheQuickToolbarComponent.prototype.removeHotKey = function () {
11437
+ var node = slate.Node.get(this.editor, this.editor.selection.anchor.path);
11438
+ if (node && slate.Text.equals({ text: QUICK_TOOLBAR_HOTKEY }, node)) {
11439
+ slate.Editor.deleteBackward(this.editor);
11440
+ }
11441
+ };
11442
+ TheQuickToolbarComponent.prototype.ngOnDestroy = function () {
11443
+ _super.prototype.ngOnDestroy.call(this);
11444
+ };
11445
+ return TheQuickToolbarComponent;
11446
+ }(core.mixinUnsubscribe(core.MixinBase)));
11447
+ 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 });
11448
+ 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"] }] });
11449
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickToolbarComponent, decorators: [{
11450
+ type: i0.Component,
11451
+ args: [{
11452
+ selector: 'the-quick-toolbar',
11453
+ templateUrl: 'quick-toolbar.component.html'
11454
+ }]
11455
+ }], ctorParameters: function () { return [{ type: i1__namespace$3.ThyPopoverRef }, { type: i0__namespace.ElementRef }]; }, propDecorators: { editor: [{
11456
+ type: i0.Input
11457
+ }], quickToolbarItems: [{
11458
+ type: i0.Input
11459
+ }], handleMouseDown: [{
11460
+ type: i0.HostListener,
11461
+ args: ['document: mousedown', ['$event']]
11462
+ }], handleEnter: [{
11463
+ type: i0.HostListener,
11464
+ args: ['document: keydown.enter']
11465
+ }] } });
11466
+
11467
+ var OperationTypes = ['insert_text', 'remove_node', 'merge_node'];
11468
+ var QuickInsertEditor = {
11469
+ openQuickToolbar: function (editor, toolbarItems, origin) {
11470
+ var overlay = editor.injector.get(i2.Overlay);
11471
+ var viewContainerRef = editor.injector.get(i0.ViewContainerRef);
11472
+ var thyPopover = editor.injector.get(i1$2.ThyPopover);
11473
+ var quickToolbarRef = thyPopover.open(TheQuickToolbarComponent, {
11474
+ initialState: {
11475
+ editor: editor,
11476
+ quickToolbarItems: toolbarItems
11477
+ },
11478
+ origin: origin,
11479
+ viewContainerRef: viewContainerRef,
11480
+ backdropClosable: true,
11481
+ placement: 'bottomLeft',
11482
+ offset: 4,
11483
+ hasBackdrop: false,
11484
+ insideClosable: true,
11485
+ panelClass: 'the-quick-toolbar-container',
11486
+ scrollStrategy: overlay.scrollStrategies.reposition(),
11487
+ manualClosure: true
11488
+ });
11489
+ THE_EDITOR_QUICK_TOOLBAR_REF.set(editor, quickToolbarRef);
11490
+ },
11491
+ closeQuickToolbar: function (editor) {
11492
+ var quickToolbarRef = THE_EDITOR_QUICK_TOOLBAR_REF.get(editor);
11493
+ if (quickToolbarRef) {
11494
+ quickToolbarRef.close();
11495
+ THE_EDITOR_QUICK_TOOLBAR_REF.set(editor, null);
11496
+ }
11497
+ },
11498
+ isOpenToolbar: function (editor, opTypes) {
11499
+ if (opTypes === void 0) { opTypes = OperationTypes; }
11500
+ var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
11501
+ if (!isCollapsedCursor) {
11502
+ return false;
11503
+ }
11504
+ var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
11505
+ var undos = editor.history.undos;
11506
+ var lastBatch = undos[undos.length - 1];
11507
+ var lastOp = lastBatch && lastBatch[lastBatch.length - 1];
11508
+ if (lastOp &&
11509
+ block.children.length === 1 &&
11510
+ block.type === exports.ElementKinds.paragraph &&
11511
+ slate.Node.string(block) === QUICK_TOOLBAR_HOTKEY &&
11512
+ opTypes.includes(lastOp.type) &&
11513
+ (lastOp.text === QUICK_TOOLBAR_HOTKEY || lastOp.text === undefined)) {
11514
+ return true;
11515
+ }
11516
+ return false;
11517
+ }
11518
+ };
11519
+
11520
+ var withQuickInsert = function (editor) {
11521
+ var onKeydown = editor.onKeydown, deleteBackward = editor.deleteBackward, onChange = editor.onChange;
11522
+ editor.onKeydown = function (event) {
11523
+ if (event.key === QUICK_TOOLBAR_HOTKEY && isCleanEmptyParagraph(editor)) {
11524
+ var rootNode = i1.AngularEditor.toDOMNode(editor, slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]));
11525
+ var theEditorComponent = editor.injector.get(TheEditorComponent);
11526
+ var quickToolbars = theEditorComponent.quickToolbarItems;
11527
+ QuickInsertEditor.openQuickToolbar(editor, quickToolbars, rootNode);
11528
+ }
11529
+ onKeydown(event);
11530
+ };
11531
+ editor.deleteBackward = function (unit) {
11532
+ if (!QuickInsertEditor.isOpenToolbar(editor, ['remove_text'])) {
11533
+ QuickInsertEditor.closeQuickToolbar(editor);
11534
+ }
11535
+ deleteBackward(unit);
11536
+ };
11537
+ editor.onChange = function () {
11538
+ onChange();
11539
+ if (editor.selection) {
11540
+ var editorComponent = editor.injector.get(TheEditorComponent);
11541
+ editorComponent.quickInsertInstance.checkStatus();
11542
+ var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
11543
+ if (!isCleanEmptyParagraph(editor) && slate.Node.string(block) !== QUICK_TOOLBAR_HOTKEY) {
11544
+ QuickInsertEditor.closeQuickToolbar(editor);
11545
+ }
11546
+ }
11547
+ };
11548
+ return editor;
11549
+ };
11550
+
10997
11551
  var internalPlugins = [
10998
11552
  withTheHistory,
10999
11553
  withAutoInsertData(),
11000
11554
  withRemoveEmpty,
11001
11555
  withRemoveVoid,
11556
+ withBlockCard,
11002
11557
  withResetType,
11003
- withImage,
11004
11558
  withIndent(__spreadArray([exports.ElementKinds.checkItem, exports.ElementKinds.numberedList, exports.ElementKinds.bulletedList, exports.ElementKinds.paragraph], __read(HEADING_TYPES))),
11005
11559
  withList({ validLiChildrenTypes: [exports.ElementKinds.image] }),
11006
11560
  withLink,
@@ -11021,9 +11575,10 @@
11021
11575
  withGetFragment(),
11022
11576
  withDeserializeHMTL,
11023
11577
  withDeserializeMd(),
11024
- withBlockCard // should in the front of list、resettype、todo、deserialize-html
11578
+ withImage,
11579
+ withQuickInsert
11025
11580
  ];
11026
- 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));
11581
+ 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));
11027
11582
  var toolbarCompose = function (toolbarItems) {
11028
11583
  if (toolbarItems === void 0) { toolbarItems = []; }
11029
11584
  return __spreadArray(__spreadArray([], __read(internalToolbarItems)), __read(toolbarItems));
@@ -11032,7 +11587,7 @@
11032
11587
  var e = editor;
11033
11588
  e.renderElement = function (element) { return null; };
11034
11589
  e.renderLeaf = function (text) { return null; };
11035
- e.insertElement = function (element) { return TheTransforms.insertElementNext(e, element); };
11590
+ e.insertElement = function (element) { return insertElementNext(e, element); };
11036
11591
  e.isContainer = function (value) { return false; };
11037
11592
  e.extraElementOptions = [];
11038
11593
  e.disabled = false;
@@ -11064,14 +11619,14 @@
11064
11619
  var TheToolbarService = /** @class */ (function () {
11065
11620
  function TheToolbarService() {
11066
11621
  }
11067
- TheToolbarService.prototype.initialize = function (toolbarItems, global, inline, block) {
11622
+ TheToolbarService.prototype.initialize = function (toolbarItems, global, inline, quick) {
11068
11623
  if (global === void 0) { global = DefaultGlobalToolbarDefinition; }
11069
11624
  if (inline === void 0) { inline = DefaultInlineToolbarDefinition; }
11070
- if (block === void 0) { block = DefaultBlockToolbarDefinition; }
11625
+ if (quick === void 0) { quick = DefaultQuickToolbarDefinition; }
11071
11626
  var toolbarDefinition = {
11072
11627
  global: global,
11073
- block: block,
11074
- inline: inline
11628
+ inline: inline,
11629
+ quick: quick
11075
11630
  };
11076
11631
  var toolbarOperations = new Map();
11077
11632
  toolbarItems.forEach(function (i) { return toolbarOperations.set(i.key, i); });
@@ -11115,7 +11670,7 @@
11115
11670
 
11116
11671
  var autoFocus = function (editor, isFocus) {
11117
11672
  setTimeout(function () {
11118
- if (editor && isFocus) {
11673
+ if (editor && editor.children.length > 0 && isFocus) {
11119
11674
  slateHistory.HistoryEditor.withoutMerging(editor, function () {
11120
11675
  i1.AngularEditor.focus(editor);
11121
11676
  slate.Transforms.select(editor, slate.Editor.start(editor, [0]));
@@ -11152,60 +11707,6 @@
11152
11707
  previousHeight = currentHeight;
11153
11708
  };
11154
11709
 
11155
- var TheToolbarItemComponent = /** @class */ (function (_super) {
11156
- __extends(TheToolbarItemComponent, _super);
11157
- function TheToolbarItemComponent() {
11158
- var _this = _super.call(this) || this;
11159
- _this.active = false;
11160
- return _this;
11161
- }
11162
- TheToolbarItemComponent.prototype.statusChange = function (editor) {
11163
- var _a, _b;
11164
- 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;
11165
- };
11166
- TheToolbarItemComponent.prototype.execute = function (event) {
11167
- var _a, _b, _c;
11168
- _super.prototype.execute.call(this, event);
11169
- if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11170
- return;
11171
- }
11172
- (_c = this.item) === null || _c === void 0 ? void 0 : _c.execute(this.editor);
11173
- };
11174
- return TheToolbarItemComponent;
11175
- }(TheToolbarBaseItemComponent));
11176
- TheToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
11177
- 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: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
11178
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, decorators: [{
11179
- type: i0.Component,
11180
- args: [{
11181
- selector: 'the-toolbar-item',
11182
- 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 ",
11183
- host: {
11184
- class: 'the-toolbar-item'
11185
- }
11186
- }]
11187
- }], ctorParameters: function () { return []; }, propDecorators: { item: [{
11188
- type: i0.Input
11189
- }], editor: [{
11190
- type: i0.Input
11191
- }] } });
11192
-
11193
- var NavSplitLineComponent = /** @class */ (function () {
11194
- function NavSplitLineComponent() {
11195
- }
11196
- NavSplitLineComponent.prototype.ngOnInit = function () { };
11197
- return NavSplitLineComponent;
11198
- }());
11199
- NavSplitLineComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: NavSplitLineComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
11200
- 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 });
11201
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: NavSplitLineComponent, decorators: [{
11202
- type: i0.Component,
11203
- args: [{
11204
- selector: 'nav-split-line',
11205
- template: ''
11206
- }]
11207
- }], ctorParameters: function () { return []; } });
11208
-
11209
11710
  var TheToolbarComponent = /** @class */ (function () {
11210
11711
  function TheToolbarComponent(cfr, elementRef, ngZone, toolbarGroupComponent) {
11211
11712
  this.cfr = cfr;
@@ -11271,26 +11772,24 @@
11271
11772
  };
11272
11773
  TheToolbarComponent.prototype.statusChange = function (editor) {
11273
11774
  var e_2, _a;
11274
- if (editor === null || editor === void 0 ? void 0 : editor.selection) {
11275
- var toolbarItems = __spreadArray(__spreadArray([], __read(this.toolbarItems)), [this.moreGroupMenu]);
11276
- try {
11277
- for (var toolbarItems_1 = __values(toolbarItems), toolbarItems_1_1 = toolbarItems_1.next(); !toolbarItems_1_1.done; toolbarItems_1_1 = toolbarItems_1.next()) {
11278
- var item = toolbarItems_1_1.value;
11279
- if (item.key !== exports.ToolbarActionTypes.split) {
11280
- var itemComponent = this.components.get(item.key);
11281
- if (itemComponent) {
11282
- itemComponent.instance.statusChange(editor);
11283
- }
11775
+ var toolbarItems = __spreadArray(__spreadArray([], __read(this.toolbarItems)), [this.moreGroupMenu]);
11776
+ try {
11777
+ for (var toolbarItems_1 = __values(toolbarItems), toolbarItems_1_1 = toolbarItems_1.next(); !toolbarItems_1_1.done; toolbarItems_1_1 = toolbarItems_1.next()) {
11778
+ var item = toolbarItems_1_1.value;
11779
+ if (item.key !== exports.ToolbarActionTypes.split) {
11780
+ var itemComponent = this.components.get(item.key);
11781
+ if (itemComponent) {
11782
+ itemComponent.instance.statusChange(editor);
11284
11783
  }
11285
11784
  }
11286
11785
  }
11287
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
11288
- finally {
11289
- try {
11290
- if (toolbarItems_1_1 && !toolbarItems_1_1.done && (_a = toolbarItems_1.return)) _a.call(toolbarItems_1);
11291
- }
11292
- finally { if (e_2) throw e_2.error; }
11786
+ }
11787
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
11788
+ finally {
11789
+ try {
11790
+ if (toolbarItems_1_1 && !toolbarItems_1_1.done && (_a = toolbarItems_1.return)) _a.call(toolbarItems_1);
11293
11791
  }
11792
+ finally { if (e_2) throw e_2.error; }
11294
11793
  }
11295
11794
  };
11296
11795
  TheToolbarComponent.prototype.renderToolbarView = function () {
@@ -11500,56 +11999,214 @@
11500
11999
  args: ['toolbarContainer', { read: i0.ViewContainerRef, static: true }]
11501
12000
  }] } });
11502
12001
 
12002
+ var TheInlineToolbarComponent = /** @class */ (function () {
12003
+ function TheInlineToolbarComponent(elementRef, scrollDispatcher, cdr, ngZone) {
12004
+ this.elementRef = elementRef;
12005
+ this.scrollDispatcher = scrollDispatcher;
12006
+ this.cdr = cdr;
12007
+ this.ngZone = ngZone;
12008
+ this.destroy$ = new rxjs.Subject();
12009
+ }
12010
+ TheInlineToolbarComponent.prototype.ngOnInit = function () {
12011
+ var _this = this;
12012
+ this.scrollDispatcher
12013
+ .scrolled()
12014
+ .pipe(operators.takeUntil(this.destroy$))
12015
+ .subscribe(function () {
12016
+ _this.updateInlineToolbar();
12017
+ _this.cdr.detectChanges();
12018
+ });
12019
+ this.ngZone.runOutsideAngular(function () {
12020
+ 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; })))
12021
+ .pipe(operators.debounceTime(200), operators.takeUntil(_this.destroy$))
12022
+ .subscribe(function () {
12023
+ var _a;
12024
+ _this.updateInlineToolbar();
12025
+ (_a = _this.inlineToolbar) === null || _a === void 0 ? void 0 : _a.statusChange(_this.editor);
12026
+ _this.cdr.detectChanges();
12027
+ });
12028
+ });
12029
+ };
12030
+ TheInlineToolbarComponent.prototype.updateInlineToolbar = function () {
12031
+ var inlineToolbar = this.elementRef.nativeElement.firstElementChild;
12032
+ if (!this.editor.selection) {
12033
+ inlineToolbar.removeAttribute('style');
12034
+ return;
12035
+ }
12036
+ var anchorBlock$1 = anchorBlock(this.editor);
12037
+ if (!inlineToolbar || !anchorBlock$1) {
12038
+ return;
12039
+ }
12040
+ var editor = this.editor;
12041
+ var selection = editor.selection;
12042
+ if (!selection || !i1.AngularEditor.isFocused(editor) || slate.Range.isCollapsed(selection) || slate.Editor.string(editor, selection) === '') {
12043
+ inlineToolbar.removeAttribute('style');
12044
+ return;
12045
+ }
12046
+ if (!THE_INLINE_TOOLBAR_TYPES.includes(anchorBlock$1.type)) {
12047
+ return;
12048
+ }
12049
+ var native = window.getSelection();
12050
+ if (native.type !== 'None') {
12051
+ var range = native.getRangeAt(0);
12052
+ this.updatePosition(inlineToolbar, range);
12053
+ }
12054
+ };
12055
+ TheInlineToolbarComponent.prototype.updatePosition = function (toolbarElement, range) {
12056
+ var boundary = range.getBoundingClientRect();
12057
+ if (!boundary || (boundary.height === 0 && boundary.width === 0 && range.startContainer === range.endContainer)) {
12058
+ if (range.startContainer.nodeType === 1 && range.startContainer.querySelector('img')) {
12059
+ boundary = range.startContainer.querySelector('img').getBoundingClientRect();
12060
+ }
12061
+ else {
12062
+ boundary = range.startContainer.getBoundingClientRect();
12063
+ }
12064
+ }
12065
+ var toolbarHeight = toolbarElement.offsetHeight;
12066
+ var toolbarWidth = toolbarElement.offsetWidth;
12067
+ var halfOffsetWidth = toolbarWidth / 2;
12068
+ var defaultLeft = -halfOffsetWidth;
12069
+ var positions = {};
12070
+ positions.top = boundary.top - toolbarHeight;
12071
+ positions.left = boundary.left + boundary.width / 2 + defaultLeft;
12072
+ positions.right = 'initial';
12073
+ ['top', 'left', 'right'].forEach(function (key) {
12074
+ toolbarElement.style[key] = positions[key] + (isNaN(positions[key]) ? '' : 'px');
12075
+ });
12076
+ toolbarElement.style.opacity = '1';
12077
+ };
12078
+ TheInlineToolbarComponent.prototype.ngOnDestroy = function () {
12079
+ this.destroy$.next();
12080
+ this.destroy$.complete();
12081
+ };
12082
+ return TheInlineToolbarComponent;
12083
+ }());
12084
+ 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 }], target: i0__namespace.ɵɵFactoryTarget.Component });
12085
+ 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", "isMore", "afterTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
12086
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, decorators: [{
12087
+ type: i0.Component,
12088
+ args: [{
12089
+ selector: 'the-inline-toolbar',
12090
+ template: "<the-toolbar\n #inlineToolbar\n class=\"the-inline-toolbar\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarItems\"\n [isMore]=\"false\"\n ></the-toolbar> ",
12091
+ host: {
12092
+ '[class.hide]': 'toolbarItems.length === 0'
12093
+ },
12094
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
12095
+ }]
12096
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i2__namespace$1.ScrollDispatcher }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }]; }, propDecorators: { editor: [{
12097
+ type: i0.Input
12098
+ }], toolbarItems: [{
12099
+ type: i0.Input
12100
+ }], inlineToolbar: [{
12101
+ type: i0.ViewChild,
12102
+ args: ['inlineToolbar']
12103
+ }] } });
12104
+
12105
+ var TheQuickInsertComponent = /** @class */ (function () {
12106
+ function TheQuickInsertComponent(renderer, elementRef, cdr) {
12107
+ this.renderer = renderer;
12108
+ this.elementRef = elementRef;
12109
+ this.cdr = cdr;
12110
+ this.isHide = true;
12111
+ this.defaultIconName = 'plus-circle-thin';
12112
+ this.iconNameFill = 'plus-circle-thin-fill';
12113
+ this.displayIconName = this.defaultIconName;
12114
+ }
12115
+ TheQuickInsertComponent.prototype.handleMousedownNativeElement = function (event) {
12116
+ event.preventDefault();
12117
+ event.stopPropagation();
12118
+ };
12119
+ TheQuickInsertComponent.prototype.checkStatus = function () {
12120
+ var _a;
12121
+ var editor = this.editor;
12122
+ if (isCleanEmptyParagraph(editor)) {
12123
+ 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]]);
12124
+ var rootNode = i1.AngularEditor.toDOMNode(editor, block);
12125
+ this.isHide = false;
12126
+ this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
12127
+ return;
12128
+ }
12129
+ this.isHide = true;
12130
+ };
12131
+ TheQuickInsertComponent.prototype.updatePosition = function (left, top) {
12132
+ this.isHide = false;
12133
+ this.renderer.setStyle(this.elementRef.nativeElement, 'top', top + "px");
12134
+ this.renderer.setStyle(this.elementRef.nativeElement, 'left', left + "px");
12135
+ };
12136
+ TheQuickInsertComponent.prototype.mouseEnter = function (event) {
12137
+ this.displayIconName = this.iconNameFill;
12138
+ this.cdr.markForCheck();
12139
+ };
12140
+ TheQuickInsertComponent.prototype.mouseLeave = function (event) {
12141
+ this.displayIconName = this.defaultIconName;
12142
+ this.cdr.markForCheck();
12143
+ };
12144
+ TheQuickInsertComponent.prototype.handleClick = function (event) {
12145
+ event.stopPropagation();
12146
+ event.preventDefault();
12147
+ QuickInsertEditor.openQuickToolbar(this.editor, this.quickToolbarItems, this.iconElement.nativeElement);
12148
+ };
12149
+ return TheQuickInsertComponent;
12150
+ }());
12151
+ 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 });
12152
+ 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"] }] });
12153
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickInsertComponent, decorators: [{
12154
+ type: i0.Component,
12155
+ args: [{
12156
+ selector: '[theQuickInsert]',
12157
+ templateUrl: './quick-insert.component.html',
12158
+ host: {
12159
+ class: 'the-quick-insert',
12160
+ '[class.hide]': 'isHide'
12161
+ }
12162
+ }]
12163
+ }], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { editor: [{
12164
+ type: i0.Input
12165
+ }], quickToolbarItems: [{
12166
+ type: i0.Input
12167
+ }], iconElement: [{
12168
+ type: i0.ViewChild,
12169
+ args: ['iconElement', { read: i0.ElementRef, static: false }]
12170
+ }], handleMousedownNativeElement: [{
12171
+ type: i0.HostListener,
12172
+ args: ['mousedown', ['$event']]
12173
+ }] } });
12174
+
11503
12175
  var ThePlaceholderComponent = /** @class */ (function () {
11504
12176
  function ThePlaceholderComponent(renderer, elementRef) {
11505
12177
  this.renderer = renderer;
11506
12178
  this.elementRef = elementRef;
11507
12179
  this.isHide = true;
11508
12180
  }
11509
- Object.defineProperty(ThePlaceholderComponent.prototype, "selection", {
11510
- get: function () {
11511
- return this.editor.selection;
11512
- },
11513
- enumerable: false,
11514
- configurable: true
11515
- });
11516
12181
  ThePlaceholderComponent.prototype.handleCompositionStart = function () {
11517
- this.hide();
12182
+ var _a;
12183
+ if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.selection) {
12184
+ this.hide();
12185
+ }
11518
12186
  };
11519
12187
  ThePlaceholderComponent.prototype.handleCompositionEnd = function (event) {
11520
12188
  if (!event.data) {
11521
12189
  this.checkStatus();
11522
12190
  }
11523
12191
  };
11524
- ThePlaceholderComponent.prototype.checkStatus = function (value) {
12192
+ ThePlaceholderComponent.prototype.checkStatus = function () {
12193
+ var _a, _b, _c;
11525
12194
  var editor = this.editor;
11526
- var children = value ? value : editor.children;
11527
12195
  // empty content and no selection processing
11528
- if (this.autoFocus && !this.selection && TheQueries.isEmptyContent(children)) {
11529
- this.updatePosition(30, 51);
11530
- this.isHide = false;
12196
+ if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.autoFocus) && !(editor === null || editor === void 0 ? void 0 : editor.selection) && isEmptyContent(editor.children)) {
12197
+ // normal top is 28, but margin-top: -41px is set when maxHeight is set, so top is 69
12198
+ var firstTop = ((_b = this.options) === null || _b === void 0 ? void 0 : _b.maxHeight) ? 69 : 28;
12199
+ this.updatePosition(30, firstTop);
11531
12200
  return;
11532
12201
  }
11533
- if (i1.AngularEditor.isFocused(editor) && this.selection && slate.Range.isCollapsed(this.selection)) {
11534
- var block = slate.Node.ancestor(editor, [this.selection.anchor.path[0]]);
11535
- var textIndent = 'textIndent';
11536
- var align = 'align';
11537
- var hasTextIndent = block[textIndent];
11538
- var hasAlign = block[align];
11539
- if (slate.Node.string(block) === '' &&
11540
- slate.Element.isElement(block) &&
11541
- block.type === exports.ElementKinds.paragraph &&
11542
- block.children.length === 1 &&
11543
- slate.Text.isText(block.children[0]) &&
11544
- !slate.Editor.isVoid(editor, block) &&
11545
- !hasTextIndent &&
11546
- !hasAlign) {
11547
- var rootNode = i1.AngularEditor.toDOMNode(this.editor, block);
11548
- this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
11549
- return;
11550
- }
12202
+ if (isCleanEmptyParagraph(editor)) {
12203
+ var block = slate.Node.ancestor(editor, [(_c = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _c === void 0 ? void 0 : _c.anchor.path[0]]);
12204
+ var rootNode = i1.AngularEditor.toDOMNode(editor, block);
12205
+ this.isHide = false;
12206
+ this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
12207
+ return;
11551
12208
  }
11552
- this.hide();
12209
+ this.isHide = true;
11553
12210
  };
11554
12211
  ThePlaceholderComponent.prototype.updatePosition = function (left, top) {
11555
12212
  this.isHide = false;
@@ -11562,12 +12219,12 @@
11562
12219
  return ThePlaceholderComponent;
11563
12220
  }());
11564
12221
  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 });
11565
- 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 });
12222
+ ThePlaceholderComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, template: "{{ options?.placeholder }}", isInline: true });
11566
12223
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, decorators: [{
11567
12224
  type: i0.Component,
11568
12225
  args: [{
11569
12226
  selector: 'div[thePlaceholder]',
11570
- template: "{{ placeholder }}",
12227
+ template: "{{ options?.placeholder }}",
11571
12228
  host: {
11572
12229
  class: 'the-placeholder',
11573
12230
  '[class.hide]': 'isHide'
@@ -11575,9 +12232,7 @@
11575
12232
  }]
11576
12233
  }], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }]; }, propDecorators: { editor: [{
11577
12234
  type: i0.Input
11578
- }], autoFocus: [{
11579
- type: i0.Input
11580
- }], placeholder: [{
12235
+ }], options: [{
11581
12236
  type: i0.Input
11582
12237
  }], handleCompositionStart: [{
11583
12238
  type: i0.HostListener,
@@ -11663,7 +12318,6 @@
11663
12318
  _this.theOnDOMEvent = new i0.EventEmitter();
11664
12319
  _this.theEditorCreated = new i0.EventEmitter();
11665
12320
  _this._plugins = [];
11666
- _this.globalToolbarItems = [];
11667
12321
  _this.autoScrollView = _.debounce(function (editor, scrollContainer) {
11668
12322
  return autoScrollViewHandle(editor, scrollContainer);
11669
12323
  }, 80);
@@ -11754,9 +12408,6 @@
11754
12408
  _this.onSlaCompositionEnd = function (event) { };
11755
12409
  _this.onSlaDragStart = function (event) { };
11756
12410
  _this.onSlaDragOver = function (event) { };
11757
- _this.trackBy = function (element) {
11758
- return element.key;
11759
- };
11760
12411
  return _this;
11761
12412
  }
11762
12413
  Object.defineProperty(TheEditorComponent.prototype, "theGlobalToolbarInstance", {
@@ -11774,6 +12425,14 @@
11774
12425
  enumerable: false,
11775
12426
  configurable: true
11776
12427
  });
12428
+ Object.defineProperty(TheEditorComponent.prototype, "quickToolbarItems", {
12429
+ get: function () {
12430
+ var _a;
12431
+ return (_a = this.toolbarEntity) === null || _a === void 0 ? void 0 : _a.quick;
12432
+ },
12433
+ enumerable: false,
12434
+ configurable: true
12435
+ });
11777
12436
  TheEditorComponent.prototype.ngOnInit = function () {
11778
12437
  this.initialize();
11779
12438
  this.onErrorHandler();
@@ -11830,8 +12489,8 @@
11830
12489
  var _a;
11831
12490
  var toolbar = (_a = this === null || this === void 0 ? void 0 : this.theOptions) === null || _a === void 0 ? void 0 : _a.toolbar;
11832
12491
  var toolbarItems = toolbarCompose(toolbar === null || toolbar === void 0 ? void 0 : toolbar.toolbarItems);
11833
- 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);
11834
- this.globalToolbarItems = toolbarOption.toolbarEntity.global;
12492
+ 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);
12493
+ this.toolbarEntity = toolbarOption.toolbarEntity;
11835
12494
  if (this.theGlobalToolbar) {
11836
12495
  this.theGlobalToolbarInstance.editor = this.editor;
11837
12496
  this.theGlobalToolbarInstance.toolbarItems = toolbarOption.toolbarEntity.global;
@@ -11841,11 +12500,10 @@
11841
12500
  }
11842
12501
  };
11843
12502
  TheEditorComponent.prototype.writeValue = function (value) {
11844
- var _a, _b;
12503
+ var _a;
11845
12504
  var data = dataDeserialize((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.mode, value);
11846
12505
  // data-deserialize
11847
12506
  this.editorValue = data;
11848
- (_b = this.placeholderInstance) === null || _b === void 0 ? void 0 : _b.checkStatus(data);
11849
12507
  };
11850
12508
  TheEditorComponent.prototype.registerOnChange = function (fn) {
11851
12509
  this.onChangeCallback = fn;
@@ -11854,13 +12512,14 @@
11854
12512
  this.onTouchedCallback = fn;
11855
12513
  };
11856
12514
  TheEditorComponent.prototype.valueChange = function (value) {
11857
- var _a, _b, _c, _d, _e;
12515
+ var _a, _b, _c, _d;
11858
12516
  (_a = this.theGlobalToolbarInstance) === null || _a === void 0 ? void 0 : _a.statusChange(this.editor);
11859
- (_b = this.placeholderInstance) === null || _b === void 0 ? void 0 : _b.checkStatus();
12517
+ this.quickInsertInstance.checkStatus();
12518
+ this.placeholderInstance.checkStatus();
11860
12519
  // auto scroll view
11861
- var scrollContainer = (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.scrollContainer;
11862
- var maxHeight = (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.maxHeight;
11863
- if (!((_e = this.theOptions) === null || _e === void 0 ? void 0 : _e.readonly) && (scrollContainer || maxHeight)) {
12520
+ var scrollContainer = (_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.scrollContainer;
12521
+ var maxHeight = (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.maxHeight;
12522
+ if (!((_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.readonly) && (scrollContainer || maxHeight)) {
11864
12523
  var container = maxHeight ? DEFAULT_SCROLL_CONTAINER : scrollContainer;
11865
12524
  this.autoScrollView(this.editor, container);
11866
12525
  }
@@ -11926,7 +12585,7 @@
11926
12585
  var blockCardEntry = i1.AngularEditor.toSlateCardEntry(this.editor, relativeBlockCardElement.firstElementChild);
11927
12586
  if (blockCardEntry && blockCardEntry[1]) {
11928
12587
  var rootNodePath = blockCardEntry[1].slice(0, 1);
11929
- var rootNode = TheQueries.getNode(this.editor, rootNodePath);
12588
+ var rootNode = getNode(this.editor, rootNodePath);
11930
12589
  if (this.editor.isBlockCard(rootNode)) {
11931
12590
  event.preventDefault();
11932
12591
  i1.AngularEditor.moveBlockCard(this.editor, rootNode, { direction: event.x < centerX ? 'left' : 'right' });
@@ -11936,18 +12595,18 @@
11936
12595
  }
11937
12596
  };
11938
12597
  TheEditorComponent.prototype.handleSelectAll = function () {
11939
- var _f;
12598
+ var _e;
11940
12599
  var node;
11941
12600
  if (!this.editor.selection) {
11942
- TheTransforms.setEndSelection(this.editor);
12601
+ setEndSelection(this.editor);
11943
12602
  }
11944
- var _g = __read(slate.Range.edges(this.editor.selection), 2), start = _g[0], end = _g[1];
12603
+ var _f = __read(slate.Range.edges(this.editor.selection), 2), start = _f[0], end = _f[1];
11945
12604
  var selectionRange = slate.Editor.range(this.editor, start, end);
11946
- var containerBlocks = TheQueries.getContainerBlocks(this.editor);
12605
+ var containerBlocks = getContainerBlocks(this.editor);
11947
12606
  for (var i = 0; i < containerBlocks.length; i++) {
11948
- _f = __read(TheQueries.getNodesByType(this.editor, containerBlocks[i]), 1), node = _f[0];
12607
+ _e = __read(getNodesByType(this.editor, containerBlocks[i]), 1), node = _e[0];
11949
12608
  if (node) {
11950
- var _h = __read(node, 2), path = _h[1];
12609
+ var _g = __read(node, 2), path = _g[1];
11951
12610
  var isStartParent = slate.Path.equals(path, start.path.slice(0, path.length));
11952
12611
  var isEndParent = slate.Path.equals(path, end.path.slice(0, path.length));
11953
12612
  if (isStartParent && isEndParent) {
@@ -11990,7 +12649,7 @@
11990
12649
  useExisting: i0.forwardRef(function () { return TheEditorComponent; }),
11991
12650
  multi: true
11992
12651
  }
11993
- ], 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 }\"\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"] }] });
12652
+ ], 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__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 [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__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", "options"] }, { 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"] }] });
11994
12653
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheEditorComponent, decorators: [{
11995
12654
  type: i0.Component,
11996
12655
  args: [{
@@ -12033,6 +12692,9 @@
12033
12692
  }], globalToolbarInstance: [{
12034
12693
  type: i0.ViewChild,
12035
12694
  args: ['globalToolbar']
12695
+ }], quickInsertInstance: [{
12696
+ type: i0.ViewChild,
12697
+ args: ['quickInsert']
12036
12698
  }], placeholderInstance: [{
12037
12699
  type: i0.ViewChild,
12038
12700
  args: ['placeholder']
@@ -12168,7 +12830,7 @@
12168
12830
  return TheToolbarGroupComponent;
12169
12831
  }());
12170
12832
  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 });
12171
- 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: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
12833
+ 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"] }] });
12172
12834
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarGroupComponent, decorators: [{
12173
12835
  type: i0.Component,
12174
12836
  args: [{
@@ -12198,12 +12860,12 @@
12198
12860
  avatar.ThyAvatarModule,
12199
12861
  i2$1.ThyNavModule,
12200
12862
  i2$2.ThyFormModule,
12201
- i5$4.ThySharedModule,
12202
- list.ThyListModule,
12203
- i5$1.ThyTooltipModule,
12863
+ i5$3.ThySharedModule,
12864
+ i2$3.ThyListModule,
12865
+ i7.ThyTooltipModule,
12204
12866
  i4.ThyProgressModule,
12205
12867
  autocomplete.ThyAutocompleteModule,
12206
- i5$2.ThyActionMenuModule,
12868
+ i5$1.ThyActionMenuModule,
12207
12869
  i5.ThyInputModule,
12208
12870
  select.ThySelectModule,
12209
12871
  i1$5.ThyButtonModule,
@@ -12215,10 +12877,12 @@
12215
12877
  TheToolbarDropdownComponent,
12216
12878
  TheToolbarGroupComponent,
12217
12879
  TheToolbarItemComponent,
12880
+ TheInlineToolbarComponent,
12218
12881
  NavSplitLineComponent,
12219
12882
  TheTextComponent,
12220
12883
  TheDefaultElementComponent,
12221
- ThePlaceholderComponent,
12884
+ TheQuickInsertComponent,
12885
+ TheQuickToolbarComponent,
12222
12886
  TheColorSelectComponent,
12223
12887
  TheColorToolbarItemComponent,
12224
12888
  TheContextMenuComponent,
@@ -12245,7 +12909,8 @@
12245
12909
  TheTableToolbarComponent,
12246
12910
  TheTableComponent,
12247
12911
  TheTableRowComponent,
12248
- TheTdComponent
12912
+ TheTdComponent,
12913
+ ThePlaceholderComponent
12249
12914
  ];
12250
12915
  var PIPES = [ElementStylePipe, ElementClassPipe];
12251
12916
  var TheEditorModule = /** @class */ (function () {
@@ -12258,10 +12923,12 @@
12258
12923
  TheToolbarDropdownComponent,
12259
12924
  TheToolbarGroupComponent,
12260
12925
  TheToolbarItemComponent,
12926
+ TheInlineToolbarComponent,
12261
12927
  NavSplitLineComponent,
12262
12928
  TheTextComponent,
12263
12929
  TheDefaultElementComponent,
12264
- ThePlaceholderComponent,
12930
+ TheQuickInsertComponent,
12931
+ TheQuickToolbarComponent,
12265
12932
  TheColorSelectComponent,
12266
12933
  TheColorToolbarItemComponent,
12267
12934
  TheContextMenuComponent,
@@ -12285,39 +12952,42 @@
12285
12952
  TheTableToolbarComponent,
12286
12953
  TheTableComponent,
12287
12954
  TheTableRowComponent,
12288
- TheTdComponent], imports: [i6.CommonModule, i1.SlateModule, i4$2.FormsModule, i4$1.ThyIconModule,
12955
+ TheTdComponent,
12956
+ ThePlaceholderComponent], imports: [i6.CommonModule, i1.SlateModule, i4$2.FormsModule, i4$1.ThyIconModule,
12289
12957
  avatar.ThyAvatarModule,
12290
12958
  i2$1.ThyNavModule,
12291
12959
  i2$2.ThyFormModule,
12292
- i5$4.ThySharedModule,
12293
- list.ThyListModule,
12294
- i5$1.ThyTooltipModule,
12960
+ i5$3.ThySharedModule,
12961
+ i2$3.ThyListModule,
12962
+ i7.ThyTooltipModule,
12295
12963
  i4.ThyProgressModule,
12296
12964
  autocomplete.ThyAutocompleteModule,
12297
- i5$2.ThyActionMenuModule,
12965
+ i5$1.ThyActionMenuModule,
12298
12966
  i5.ThyInputModule,
12299
12967
  select.ThySelectModule,
12300
12968
  i1$5.ThyButtonModule,
12301
12969
  i1$4.ThyNotifyModule,
12302
- i1$1.ThyAlertModule, i5$3.CodemirrorModule, TheColumnSizeModule], exports: [TheEditorComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarItemComponent, TheDefaultElementComponent] });
12970
+ i1$1.ThyAlertModule, i5$2.CodemirrorModule, TheColumnSizeModule], exports: [TheEditorComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarItemComponent, TheDefaultElementComponent] });
12303
12971
  TheEditorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheEditorModule, providers: [
12304
12972
  {
12305
12973
  provide: TheToolbarGroupToken,
12306
12974
  useValue: TheToolbarGroupComponent
12307
- }
12308
- ], imports: [__spreadArray(__spreadArray([i6.CommonModule, i1.SlateModule, i4$2.FormsModule], __read(TETHYS)), [i5$3.CodemirrorModule, TheColumnSizeModule])] });
12975
+ },
12976
+ THE_CODE_MODE_PROVIDER
12977
+ ], imports: [__spreadArray(__spreadArray([i6.CommonModule, i1.SlateModule, i4$2.FormsModule], __read(TETHYS)), [i5$2.CodemirrorModule, TheColumnSizeModule])] });
12309
12978
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheEditorModule, decorators: [{
12310
12979
  type: i0.NgModule,
12311
12980
  args: [{
12312
12981
  declarations: __spreadArray(__spreadArray(__spreadArray([TheEditorComponent], __read(PIPES)), __read(COMPONENTS)), __read(PLUGIN_COMPONENTS)),
12313
- imports: __spreadArray(__spreadArray([i6.CommonModule, i1.SlateModule, i4$2.FormsModule], __read(TETHYS)), [i5$3.CodemirrorModule, TheColumnSizeModule]),
12982
+ imports: __spreadArray(__spreadArray([i6.CommonModule, i1.SlateModule, i4$2.FormsModule], __read(TETHYS)), [i5$2.CodemirrorModule, TheColumnSizeModule]),
12314
12983
  exports: [TheEditorComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarItemComponent, TheDefaultElementComponent],
12315
12984
  entryComponents: __spreadArray(__spreadArray([], __read(COMPONENTS)), __read(PLUGIN_COMPONENTS)),
12316
12985
  providers: [
12317
12986
  {
12318
12987
  provide: TheToolbarGroupToken,
12319
12988
  useValue: TheToolbarGroupComponent
12320
- }
12989
+ },
12990
+ THE_CODE_MODE_PROVIDER
12321
12991
  ]
12322
12992
  }]
12323
12993
  }] });
@@ -12335,7 +13005,6 @@
12335
13005
  exports.AlignEditor = AlignEditor;
12336
13006
  exports.BLOCK_DELETEBACKWARD_TYPES = BLOCK_DELETEBACKWARD_TYPES;
12337
13007
  exports.BLOCK_INSERT_ORIGIN = BLOCK_INSERT_ORIGIN;
12338
- exports.BLOCK_TOOLBAR_HOTKEY = BLOCK_TOOLBAR_HOTKEY;
12339
13008
  exports.BlockquoteEditor = BlockquoteEditor;
12340
13009
  exports.CLIPBOARD_FORMAT_KEY = CLIPBOARD_FORMAT_KEY;
12341
13010
  exports.CODEMIRROR_PADDING_TOP = CODEMIRROR_PADDING_TOP;
@@ -12343,15 +13012,15 @@
12343
13012
  exports.COMPONENTS = COMPONENTS;
12344
13013
  exports.CONTAINER_BLOCKS = CONTAINER_BLOCKS;
12345
13014
  exports.CodeEditor = CodeEditor;
13015
+ exports.CodeMode = CodeMode;
12346
13016
  exports.ColorEditor = ColorEditor;
12347
13017
  exports.DEFAULT_LANGUAGE = DEFAULT_LANGUAGE;
12348
13018
  exports.DEFAULT_SCROLL_CONTAINER = DEFAULT_SCROLL_CONTAINER;
12349
- exports.DefaultBlockToolbarDefinition = DefaultBlockToolbarDefinition;
12350
13019
  exports.DefaultElementOptions = DefaultElementOptions;
12351
13020
  exports.DefaultGlobalToolbarDefinition = DefaultGlobalToolbarDefinition;
12352
13021
  exports.DefaultInlineToolbarDefinition = DefaultInlineToolbarDefinition;
13022
+ exports.DefaultQuickToolbarDefinition = DefaultQuickToolbarDefinition;
12353
13023
  exports.ELEMENT_UNIQUE_ID = ELEMENT_UNIQUE_ID;
12354
- exports.EditorMode = EditorMode;
12355
13024
  exports.HEADING_TYPES = HEADING_TYPES;
12356
13025
  exports.HeadingEditor = HeadingEditor;
12357
13026
  exports.HrEditor = HrEditor;
@@ -12365,31 +13034,35 @@
12365
13034
  exports.PICTURE_ACCEPTED_UPLOAD_MIME = PICTURE_ACCEPTED_UPLOAD_MIME;
12366
13035
  exports.PICTURE_ACCEPTED_UPLOAD_SIZE = PICTURE_ACCEPTED_UPLOAD_SIZE;
12367
13036
  exports.PLUGIN_COMPONENTS = PLUGIN_COMPONENTS;
13037
+ exports.QUICK_TOOLBAR_HOTKEY = QUICK_TOOLBAR_HOTKEY;
13038
+ exports.QuickInsertEditor = QuickInsertEditor;
12368
13039
  exports.STANDARD_HEADING_TYPES = STANDARD_HEADING_TYPES;
12369
13040
  exports.TAB_SPACE = TAB_SPACE;
12370
- exports.THE_EDITOR_CONFIG_PROVIDER = THE_EDITOR_CONFIG_PROVIDER;
12371
- exports.THE_EDITOR_CONFIG_TOKEN = THE_EDITOR_CONFIG_TOKEN;
13041
+ exports.THE_CODE_MODE_PROVIDER = THE_CODE_MODE_PROVIDER;
13042
+ exports.THE_CODE_MODE_TOKEN = THE_CODE_MODE_TOKEN;
12372
13043
  exports.THE_EDITOR_CONVERSION_HINT_REF = THE_EDITOR_CONVERSION_HINT_REF;
13044
+ exports.THE_EDITOR_QUICK_TOOLBAR_REF = THE_EDITOR_QUICK_TOOLBAR_REF;
12373
13045
  exports.THE_EDITOR_UUID = THE_EDITOR_UUID;
12374
13046
  exports.THE_INLINE_TOOLBAR_TYPES = THE_INLINE_TOOLBAR_TYPES;
12375
13047
  exports.THE_UPLOAD_SERVICE_TOKEN = THE_UPLOAD_SERVICE_TOKEN;
12376
13048
  exports.TableEditor = TableEditor;
12377
13049
  exports.TheBaseElementComponent = TheBaseElementComponent;
13050
+ exports.TheCodeMode = TheCodeMode;
12378
13051
  exports.TheContextService = TheContextService;
12379
13052
  exports.TheDefaultElementComponent = TheDefaultElementComponent;
12380
13053
  exports.TheEditor = TheEditor;
12381
13054
  exports.TheEditorComponent = TheEditorComponent;
12382
- exports.TheEditorConfig = TheEditorConfig;
12383
13055
  exports.TheEditorModule = TheEditorModule;
12384
13056
  exports.TheImageComponent = TheImageComponent;
12385
- exports.TheQueries = TheQueries;
13057
+ exports.TheQueries = index$1;
13058
+ exports.TheToolbarBaseItemComponent = TheToolbarBaseItemComponent;
12386
13059
  exports.TheToolbarComponent = TheToolbarComponent;
12387
13060
  exports.TheToolbarDropdownComponent = TheToolbarDropdownComponent;
12388
13061
  exports.TheToolbarGroupComponent = TheToolbarGroupComponent;
12389
13062
  exports.TheToolbarGroupToken = TheToolbarGroupToken;
12390
13063
  exports.TheToolbarItemComponent = TheToolbarItemComponent;
12391
13064
  exports.TheToolbarService = TheToolbarService;
12392
- exports.TheTransforms = TheTransforms;
13065
+ exports.TheTransforms = index;
12393
13066
  exports.TodoItemEditor = TodoItemEditor;
12394
13067
  exports.ToolbarMoreGroup = ToolbarMoreGroup;
12395
13068
  exports.VOID_BLOCK_TYPES = VOID_BLOCK_TYPES;