@worktile/theia 14.1.8 → 14.2.1

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 (99) hide show
  1. package/components/listbox/listbox.d.ts +85 -0
  2. package/components/listbox/listbox.type.d.ts +5 -0
  3. package/components/plugin-menu/plugin-menu.component.d.ts +39 -0
  4. package/components/plugin-menu/plugin-menu.component.scss +50 -0
  5. package/components/table-select/table-select.component.d.ts +2 -2
  6. package/components/table-select/table-select.component.scss +1 -1
  7. package/components/toolbar/toolbar.component.d.ts +4 -3
  8. package/components/toolbar-dropdown/toolbar-dropdown.component.d.ts +5 -1
  9. package/components/toolbar-dropdown/toolbar-dropdown.component.scss +0 -11
  10. package/components/toolbar-group/toolbar-group.component.d.ts +1 -1
  11. package/components/toolbar-group/toolbar-group.component.scss +2 -3
  12. package/components/toolbar-item/toolbar-item.component.d.ts +2 -7
  13. package/constants/index.d.ts +1 -0
  14. package/constants/node-types.d.ts +2 -1
  15. package/constants/plugin-menu.d.ts +24 -0
  16. package/constants/toolbar.d.ts +0 -5
  17. package/core/utils/index.d.ts +1 -0
  18. package/core/utils/plugin-menu.d.ts +10 -0
  19. package/editor.component.d.ts +6 -2
  20. package/editor.module.d.ts +53 -49
  21. package/esm2020/components/listbox/listbox.mjs +341 -0
  22. package/esm2020/components/listbox/listbox.type.mjs +5 -0
  23. package/esm2020/components/plugin-menu/plugin-menu.component.mjs +102 -0
  24. package/esm2020/components/table-select/table-select.component.mjs +7 -11
  25. package/esm2020/components/toolbar/toolbar.component.mjs +31 -29
  26. package/esm2020/components/toolbar-dropdown/toolbar-dropdown.component.mjs +25 -6
  27. package/esm2020/components/toolbar-group/toolbar-group.component.mjs +5 -5
  28. package/esm2020/components/toolbar-item/toolbar-item.component.mjs +29 -70
  29. package/esm2020/constants/index.mjs +2 -1
  30. package/esm2020/constants/node-types.mjs +2 -1
  31. package/esm2020/constants/plugin-menu.mjs +272 -0
  32. package/esm2020/constants/toolbar.mjs +5 -23
  33. package/esm2020/core/create-toolbar.mjs +5 -6
  34. package/esm2020/core/utils/index.mjs +2 -1
  35. package/esm2020/core/utils/plugin-menu.mjs +33 -0
  36. package/esm2020/editor.component.mjs +26 -23
  37. package/esm2020/editor.module.mjs +38 -9
  38. package/esm2020/interfaces/editor.mjs +1 -1
  39. package/esm2020/interfaces/plugins/index.mjs +2 -1
  40. package/esm2020/interfaces/plugins/plugin-key.mjs +2 -1
  41. package/esm2020/interfaces/plugins/plugin-menu.mjs +19 -0
  42. package/esm2020/interfaces/plugins/plugins.mjs +1 -1
  43. package/esm2020/interfaces/toolbar.mjs +1 -1
  44. package/esm2020/plugins/blockquote/blockquote.plugin.mjs +15 -1
  45. package/esm2020/plugins/code/code.component.mjs +3 -4
  46. package/esm2020/plugins/code/code.plugin.mjs +15 -1
  47. package/esm2020/plugins/color/toolbar-item.component.mjs +2 -2
  48. package/esm2020/plugins/common/common.plugin.mjs +20 -0
  49. package/esm2020/plugins/deserializers/deserialize-html.plugin.mjs +11 -3
  50. package/esm2020/plugins/deserializers/deserialize-md.plugin.mjs +11 -3
  51. package/esm2020/plugins/heading/heading.plugin.mjs +49 -2
  52. package/esm2020/plugins/hr/hr.plugin.mjs +15 -1
  53. package/esm2020/plugins/image/image.editor.mjs +17 -1
  54. package/esm2020/plugins/image/image.plugin.mjs +15 -1
  55. package/esm2020/plugins/indent/indent.plugin.mjs +3 -2
  56. package/esm2020/plugins/index.mjs +3 -1
  57. package/esm2020/plugins/link/link.plugin.mjs +15 -2
  58. package/esm2020/plugins/list/list.plugin.mjs +26 -2
  59. package/esm2020/plugins/quick-insert/components/quick-insert.component.mjs +43 -19
  60. package/esm2020/plugins/quick-insert/quick-insert.editor.mjs +41 -26
  61. package/esm2020/plugins/quick-insert/quick-insert.plugin.mjs +62 -35
  62. package/esm2020/plugins/table/table.plugin.mjs +16 -1
  63. package/esm2020/plugins/table/toolbar-item.component.mjs +4 -3
  64. package/esm2020/plugins/todo-item/todo-item.plugin.mjs +15 -2
  65. package/esm2020/public-api.mjs +3 -1
  66. package/esm2020/services/toolbar.service.mjs +4 -5
  67. package/esm2020/utils/blob.mjs +16 -0
  68. package/esm2020/utils/fragment.mjs +9 -1
  69. package/esm2020/utils/index.mjs +2 -1
  70. package/esm2020/utils/weak-maps.mjs +2 -2
  71. package/fesm2015/worktile-theia.mjs +1568 -595
  72. package/fesm2015/worktile-theia.mjs.map +1 -1
  73. package/fesm2020/worktile-theia.mjs +1559 -588
  74. package/fesm2020/worktile-theia.mjs.map +1 -1
  75. package/interfaces/editor.d.ts +2 -0
  76. package/interfaces/plugins/index.d.ts +1 -0
  77. package/interfaces/plugins/plugin-key.d.ts +2 -1
  78. package/interfaces/plugins/plugin-menu.d.ts +26 -0
  79. package/interfaces/plugins/plugins.d.ts +6 -1
  80. package/interfaces/toolbar.d.ts +1 -3
  81. package/package.json +1 -1
  82. package/plugins/code/code.component.d.ts +1 -2
  83. package/plugins/common/common.plugin.d.ts +1 -0
  84. package/plugins/image/image.editor.d.ts +2 -0
  85. package/plugins/link/link.component.scss +0 -12
  86. package/plugins/quick-insert/components/quick-insert.component.d.ts +8 -7
  87. package/plugins/quick-insert/components/quick-insert.component.scss +0 -4
  88. package/plugins/quick-insert/quick-insert.editor.d.ts +7 -4
  89. package/plugins/quick-insert/quick-insert.plugin.d.ts +2 -2
  90. package/public-api.d.ts +2 -0
  91. package/services/toolbar.service.d.ts +1 -1
  92. package/styles/index.scss +1 -1
  93. package/utils/blob.d.ts +1 -0
  94. package/utils/fragment.d.ts +1 -0
  95. package/utils/index.d.ts +1 -0
  96. package/utils/weak-maps.d.ts +1 -1
  97. package/esm2020/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.mjs +0 -80
  98. package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.d.ts +0 -28
  99. package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.scss +0 -23
@@ -1,15 +1,15 @@
1
1
  import * as i2 from '@angular/common';
2
2
  import { DOCUMENT, CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Component, ChangeDetectionStrategy, HostBinding, InjectionToken, Pipe, TemplateRef, ViewChild, Directive, Input, ViewContainerRef, HostListener, Inject, Injectable, ChangeDetectorRef, ElementRef, EventEmitter, forwardRef, Output, NgModule } from '@angular/core';
4
+ import { Component, ChangeDetectionStrategy, HostBinding, InjectionToken, Pipe, TemplateRef, ViewChild, Directive, Input, HostListener, ViewContainerRef, Inject, Injectable, ChangeDetectorRef, ElementRef, EventEmitter, forwardRef, Output, NgModule, Optional, SkipSelf, ContentChildren } from '@angular/core';
5
5
  import * as i2$2 from '@angular/forms';
6
6
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
7
7
  import * as i1 from 'slate-angular';
8
- import { BaseElementComponent, BaseTextComponent, NODE_TO_PARENT, NODE_TO_INDEX, AngularEditor, hotkeys, isComponentType, ELEMENT_TO_COMPONENT, IS_SAFARI, hasBlockCard, isCardLeft, FAKE_RIGHT_BLOCK_CARD_OFFSET, getPlainText as getPlainText$1, EDITOR_TO_ELEMENT, withAngular, SlateModule } from 'slate-angular';
8
+ import { BaseElementComponent, BaseTextComponent, NODE_TO_PARENT, NODE_TO_INDEX, AngularEditor, hotkeys, ELEMENT_TO_COMPONENT, IS_SAFARI, hasBlockCard, isCardLeft, FAKE_RIGHT_BLOCK_CARD_OFFSET, getPlainText as getPlainText$1, EDITOR_TO_ELEMENT, withAngular, SlateModule } from 'slate-angular';
9
9
  import { Element as Element$1, Editor, Range, Node, Span, Path, Text, Point, Transforms, Operation, createEditor } from 'slate';
10
10
  import { __rest, __awaiter } from 'tslib';
11
11
  import { map, cloneDeep, assign, defaults, groupBy, uniq, debounce } from 'lodash';
12
- import { isObject, isArray } from 'ngx-tethys/util';
12
+ import { isObject, isArray, isString } from 'ngx-tethys/util';
13
13
  import { TheiaConverter } from '@atinc/selene';
14
14
  import { HistoryEditor, withHistory } from 'slate-history';
15
15
  import * as i1$1 from 'ngx-tethys/popover';
@@ -22,7 +22,7 @@ import * as i5 from 'ngx-tethys/action';
22
22
  import { ThyActionModule } from 'ngx-tethys/action';
23
23
  import * as i6 from 'ngx-tethys/dropdown';
24
24
  import { ThyDropdownModule } from 'ngx-tethys/dropdown';
25
- import * as i3$1 from 'ngx-tethys/tooltip';
25
+ import * as i8 from 'ngx-tethys/tooltip';
26
26
  import { ThyTooltipModule } from 'ngx-tethys/tooltip';
27
27
  import * as i12 from 'ngx-tethys/divider';
28
28
  import { ThyDividerComponent, ThyDividerModule } from 'ngx-tethys/divider';
@@ -51,21 +51,25 @@ import { ThyProgressModule } from 'ngx-tethys/progress';
51
51
  import isUrl from 'is-url';
52
52
  import * as i1$4 from 'ngx-tethys/button';
53
53
  import { ThyButtonModule } from 'ngx-tethys/button';
54
- import * as i3$2 from 'ngx-tethys/form';
54
+ import * as i3$1 from 'ngx-tethys/form';
55
55
  import { ThyFormModule } from 'ngx-tethys/form';
56
56
  import * as i4$1 from 'ngx-tethys/shared';
57
57
  import { ThySharedModule } from 'ngx-tethys/shared';
58
- import * as i2$3 from 'ngx-tethys/list';
59
- import { ThyListModule } from 'ngx-tethys/list';
58
+ import * as i7 from 'ngx-tethys/empty';
59
+ import { ThyEmptyModule } from 'ngx-tethys/empty';
60
60
  import * as i6$1 from '@angular/cdk/scrolling';
61
61
  import { ScrollingModule } from '@angular/cdk/scrolling';
62
62
  import { coerceCssPixelValue } from '@angular/cdk/coercion';
63
63
  import { PortalInjector, ComponentPortal } from '@angular/cdk/portal';
64
+ import * as i3$2 from '@angular/platform-browser';
64
65
  import { ThyAutocompleteModule } from 'ngx-tethys/autocomplete';
65
66
  import { ThyAvatarModule } from 'ngx-tethys/avatar';
66
67
  import { ThyDialogModule } from 'ngx-tethys/dialog';
68
+ import { ThyListModule } from 'ngx-tethys/list';
67
69
  import { ThyNavModule } from 'ngx-tethys/nav';
68
70
  import { ThySelectModule } from 'ngx-tethys/select';
71
+ import { ThyMenuModule } from 'ngx-tethys/menu';
72
+ import { LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW } from '@angular/cdk/keycodes';
69
73
 
70
74
  class TheBaseElementComponent extends BaseElementComponent {
71
75
  ngOnInit() {
@@ -222,6 +226,7 @@ var ToolbarActionTypes;
222
226
  ToolbarActionTypes["tableRemove"] = "table-remove";
223
227
  ToolbarActionTypes["tableDeleteRows"] = "table-delete-rows";
224
228
  ToolbarActionTypes["tableDeleteColumns"] = "table-delete-columns";
229
+ ToolbarActionTypes["group"] = "group";
225
230
  })(ToolbarActionTypes || (ToolbarActionTypes = {}));
226
231
  const MarkProps = [
227
232
  MarkTypes.backgroundColor,
@@ -350,22 +355,17 @@ var DropdownMode;
350
355
  DropdownMode["icon"] = "icon-mode";
351
356
  DropdownMode["text"] = "text-mode";
352
357
  })(DropdownMode || (DropdownMode = {}));
353
- var ToolbarItemMode;
354
- (function (ToolbarItemMode) {
355
- ToolbarItemMode[ToolbarItemMode["horizontal"] = 0] = "horizontal";
356
- ToolbarItemMode[ToolbarItemMode["vertical"] = 1] = "vertical";
357
- })(ToolbarItemMode || (ToolbarItemMode = {}));
358
358
  const DefaultGlobalToolbarDefinition = [
359
359
  ElementKinds.headingList,
360
360
  ToolbarActionTypes.split,
361
361
  MarkTypes.bold,
362
362
  MarkTypes.italic,
363
- MarkTypes.underline,
364
- MarkTypes.strike,
365
- ElementKinds.inlineCode,
363
+ ToolbarActionTypes.group,
364
+ ToolbarActionTypes.split,
366
365
  MarkTypes.color,
367
366
  MarkTypes.backgroundColor,
368
367
  ToolbarActionTypes.split,
368
+ ElementKinds.indent,
369
369
  ToolbarActionTypes.alignType,
370
370
  ToolbarActionTypes.verticalAlign,
371
371
  ToolbarActionTypes.split,
@@ -393,23 +393,281 @@ const DefaultInlineToolbarDefinition = [
393
393
  ToolbarActionTypes.split,
394
394
  ElementKinds.link
395
395
  ];
396
- const DefaultQuickToolbarDefinition = [
396
+ const ToolbarMoreGroup = {
397
+ key: 'more',
398
+ icon: 'more'
399
+ };
400
+
401
+ const DefaultPluginMenu = [
397
402
  ...STANDARD_HEADING_TYPES,
398
- ToolbarActionTypes.split,
399
403
  ElementKinds.numberedList,
400
404
  ElementKinds.bulletedList,
401
- ToolbarActionTypes.split,
402
405
  ElementKinds.link,
406
+ { groupName: '基础' },
403
407
  ElementKinds.image,
404
408
  ElementKinds.table,
405
409
  ElementKinds.blockquote,
406
410
  ElementKinds.hr,
407
411
  ElementKinds.code
408
412
  ];
409
- const ToolbarMoreGroup = {
410
- key: 'more',
411
- icon: 'more'
412
- };
413
+ var ThePluginMenuItemType;
414
+ (function (ThePluginMenuItemType) {
415
+ ThePluginMenuItemType["icon"] = "iconMenu";
416
+ ThePluginMenuItemType["group"] = "groupMenu";
417
+ })(ThePluginMenuItemType || (ThePluginMenuItemType = {}));
418
+ var PluginMenuIcons;
419
+ (function (PluginMenuIcons) {
420
+ PluginMenuIcons["heading_1"] = "the-icon-heading-one";
421
+ PluginMenuIcons["heading_2"] = "the-icon-heading-two";
422
+ PluginMenuIcons["heading_3"] = "the-icon-heading-three";
423
+ PluginMenuIcons["heading_4"] = "the-icon-heading-four";
424
+ PluginMenuIcons["numberedList"] = "the-icon-numbered-list";
425
+ PluginMenuIcons["bulletedList"] = "the-icon-bulleted-list";
426
+ PluginMenuIcons["link"] = "the-icon-link";
427
+ PluginMenuIcons["image"] = "the-icon-image";
428
+ PluginMenuIcons["blockquote"] = "the-icon-block-quote";
429
+ PluginMenuIcons["code"] = "the-icon-code";
430
+ PluginMenuIcons["table"] = "the-icon-table";
431
+ PluginMenuIcons["hr"] = "the-icon-hr";
432
+ })(PluginMenuIcons || (PluginMenuIcons = {}));
433
+ const PluginMenuSvgs = [
434
+ {
435
+ key: PluginMenuIcons.image,
436
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
437
+ <title>图片</title>
438
+ <g id="图片" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
439
+ <g id="icon">
440
+ <path d="M32,0 C34.209139,0 36,1.790861 36,4 L36,32 C36,34.209139 34.209139,36 32,36 L4,36 C1.790861,36 0,34.209139 0,32 L0,4 C0,1.790861 1.790861,0 4,0 L32,0 Z M32,1 L4,1 C2.40231912,1 1.09633912,2.24891996 1.00509269,3.82372721 L1,4 L1,32 C1,33.5976809 2.24891996,34.9036609 3.82372721,34.9949073 L4,35 L32,35 C33.5976809,35 34.9036609,33.75108 34.9949073,32.1762728 L35,32 L35,4 C35,2.40231912 33.75108,1.09633912 32.1762728,1.00509269 L32,1 Z" id="矩形" fill="#EEEEEE" fill-rule="nonzero"></path>
441
+ <g id="编组" transform="translate(8.500000, 10.000000)">
442
+ <path d="M0,1 C0,0.447715 0.447715,0 1,0 L18,0 C18.5523,0 19,0.447715 19,1 L19,15 C19,15.5523 18.5523,16 18,16 L1,16 C0.447715,16 0,15.5523 0,15 L0,1 Z" id="路径" fill="#EEEEEE"></path>
443
+ <path d="M4.5,7 C5.60453333,7 6.5,6.10453333 6.5,5 C6.5,3.89546667 5.60453333,3 4.5,3 C3.39546667,3 2.5,3.89546667 2.5,5 C2.5,6.10453333 3.39546667,7 4.5,7 Z" id="路径" fill="#F6C659"></path>
444
+ <path d="M5,9 L7.5,11 L10.5,7.5 L19,13 L19,15 C19,15.5523 18.5523,16 18,16 L1,16 C0.447715,16 0,15.5523 0,15 L0,13 L5,9 Z" id="路径" fill="#6698FF"></path>
445
+ <path d="M5,9 L7.488,10.99 L3.165,16 L1,16 C0.447715,16 0,15.5523 0,15 L0,13 L5,9 Z" id="形状结合" fill="#CAD9F8"></path>
446
+ </g>
447
+ </g>
448
+ </g>
449
+ </svg>`
450
+ },
451
+ {
452
+ key: PluginMenuIcons.blockquote,
453
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
454
+ <title>引用</title>
455
+ <defs>
456
+ <rect id="path-1" x="1" y="1" width="34" height="34" rx="4"></rect>
457
+ </defs>
458
+ <g id="引用" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
459
+ <g id="矩形">
460
+ <path d="M32,0 C34.209139,0 36,1.790861 36,4 L36,32 C36,34.209139 34.209139,36 32,36 L4,36 C1.790861,36 0,34.209139 0,32 L0,4 C0,1.790861 1.790861,0 4,0 L32,0 Z M32,1 L4,1 C2.40231912,1 1.09633912,2.24891996 1.00509269,3.82372721 L1,4 L1,32 C1,33.5976809 2.24891996,34.9036609 3.82372721,34.9949073 L4,35 L32,35 C33.5976809,35 34.9036609,33.75108 34.9949073,32.1762728 L35,32 L35,4 C35,2.40231912 33.75108,1.09633912 32.1762728,1.00509269 L32,1 Z" id="蒙版" fill="#EEEEEE" fill-rule="nonzero"></path>
461
+ <mask id="mask-2" fill="white">
462
+ <use xlink:href="#path-1"></use>
463
+ </mask>
464
+ <use id="蒙版" fill="#FFFFFF" xlink:href="#path-1"></use>
465
+ <g id="编组-34" mask="url(#mask-2)">
466
+ <g transform="translate(7.000000, 7.600000)">
467
+ <path d="M-9.3,9.9 L10.5,9.9 C10.8313708,9.9 11.1,10.1686292 11.1,10.5 C11.1,10.8313708 10.8313708,11.1 10.5,11.1 L-9.3,11.1 C-9.63137085,11.1 -9.9,10.8313708 -9.9,10.5 C-9.9,10.1686292 -9.63137085,9.9 -9.3,9.9 Z" id="矩形备份-86" fill="#AAAAAA" transform="translate(0.600000, 10.500000) rotate(-270.000000) translate(-0.600000, -10.500000) "></path>
468
+ <path d="M12.0569495,0.107381518 C9.05340743,2.09055298 7.38481149,4.39881214 7.05114973,7.03213028 C6.53171396,11.1315969 10.097464,13.1381708 11.9041919,11.3352765 C13.7109198,9.53238214 12.6278961,7.24401116 11.3196447,6.61849713 C10.0113932,5.99294208 9.21135004,6.21080993 9.35090591,5.37489124 C9.49046177,4.53901356 11.3517118,2.22140491 12.9868965,1.14207129 C13.0953823,1.04722312 13.1366628,0.863185692 13.0322053,0.723558362 C12.9634843,0.631744678 12.8287146,0.451664378 12.6278961,0.18330516 C12.4522847,-0.0513630698 12.2840519,-0.042579465 12.0569495,0.107381518 Z M19.9642908,0.107381518 C16.9607886,2.09055298 15.2921807,4.39881214 14.9585069,7.03213028 C14.4390911,11.1315969 18.0048451,13.1381708 19.811573,11.3352765 C21.618301,9.53238214 20.5352773,7.24401116 19.2270258,6.61849713 C17.9187744,5.99294208 17.1186913,6.21080993 17.2582871,5.37489124 C17.3978429,4.53901356 19.259093,2.22140491 20.8942776,1.14207129 C21.0027635,1.04722312 21.0440439,0.863185692 20.9395466,0.723558362 C20.8708654,0.631744678 20.7360957,0.451664378 20.5352773,0.18330516 C20.3596658,-0.0513630698 20.191433,-0.042579465 19.9642908,0.107381518 Z" id="形状结合" fill="#CACACA" transform="translate(14.000000, 6.000000) rotate(-180.000000) translate(-14.000000, -6.000000) "></path>
469
+ <path d="M6.6,20.4 L15.7517228,20.4 C16.0830937,20.4 16.3517228,20.6686292 16.3517228,21 C16.3517228,21.3313708 16.0830937,21.6 15.7517228,21.6 L6.6,21.6 C6.26862915,21.6 6,21.3313708 6,21 C6,20.6686292 6.26862915,20.4 6.6,20.4 Z" id="矩形备份-88" fill="#CACACA"></path>
470
+ <rect id="矩形备份-87" fill="#CACACA" x="6" y="15.4" width="16" height="1.2" rx="0.6"></rect>
471
+ </g>
472
+ </g>
473
+ </g>
474
+ </g>
475
+ </svg>`
476
+ },
477
+ {
478
+ key: PluginMenuIcons.code,
479
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
480
+ <title>代码块</title>
481
+ <defs>
482
+ <rect id="path-1" x="1" y="1" width="34" height="34" rx="4"></rect>
483
+ </defs>
484
+ <g id="代码块" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
485
+ <g id="icon">
486
+ <path d="M32,0 C34.209139,0 36,1.790861 36,4 L36,32 C36,34.209139 34.209139,36 32,36 L4,36 C1.790861,36 0,34.209139 0,32 L0,4 C0,1.790861 1.790861,0 4,0 L32,0 Z M32,1 L4,1 C2.40231912,1 1.09633912,2.24891996 1.00509269,3.82372721 L1,4 L1,32 C1,33.5976809 2.24891996,34.9036609 3.82372721,34.9949073 L4,35 L32,35 C33.5976809,35 34.9036609,33.75108 34.9949073,32.1762728 L35,32 L35,4 C35,2.40231912 33.75108,1.09633912 32.1762728,1.00509269 L32,1 Z" id="蒙版" fill="#EEEEEE" fill-rule="nonzero"></path>
487
+ <mask id="mask-2" fill="white">
488
+ <use xlink:href="#path-1"></use>
489
+ </mask>
490
+ <use id="蒙版" fill="#FFFFFF" xlink:href="#path-1"></use>
491
+ <g id="编组-24" mask="url(#mask-2)">
492
+ <g transform="translate(6.000000, 6.000000)">
493
+ <rect id="矩形备份-60" fill="#F5F5F5" x="0" y="0" width="43" height="24" rx="2"></rect>
494
+ <path d="M2,0 L6,0 L6,0 L6,24 L2,24 C0.8954305,24 1.3527075e-16,23.1045695 0,22 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 Z" id="矩形备份-60" fill="#EEEEEE"></path>
495
+ <path d="M2.6,4 L3.4,4 C3.73137085,4 4,4.26862915 4,4.6 C4,4.93137085 3.73137085,5.2 3.4,5.2 L2.6,5.2 C2.26862915,5.2 2,4.93137085 2,4.6 C2,4.26862915 2.26862915,4 2.6,4 Z M2.6,9 L3.4,9 C3.73137085,9 4,9.26862915 4,9.6 C4,9.93137085 3.73137085,10.2 3.4,10.2 L2.6,10.2 C2.26862915,10.2 2,9.93137085 2,9.6 C2,9.26862915 2.26862915,9 2.6,9 Z M2.6,14 L3.4,14 C3.73137085,14 4,14.2686292 4,14.6 C4,14.9313708 3.73137085,15.2 3.4,15.2 L2.6,15.2 C2.26862915,15.2 2,14.9313708 2,14.6 C2,14.2686292 2.26862915,14 2.6,14 Z M2.6,19 L3.4,19 C3.73137085,19 4,19.2686292 4,19.6 C4,19.9313708 3.73137085,20.2 3.4,20.2 L2.6,20.2 C2.26862915,20.2 2,19.9313708 2,19.6 C2,19.2686292 2.26862915,19 2.6,19 Z" id="形状结合" fill="#CACACA"></path>
496
+ <path d="M10.6,4 L23.8215948,4 C24.1529656,4 24.4215948,4.26862915 24.4215948,4.6 C24.4215948,4.93137085 24.1529656,5.2 23.8215948,5.2 L10.6,5.2 C10.2686292,5.2 10,4.93137085 10,4.6 C10,4.26862915 10.2686292,4 10.6,4 Z" id="矩形备份-61" fill="#CACACA"></path>
497
+ <path d="M15.6,9 L23.9488547,9 C24.2802256,9 24.5488547,9.26862915 24.5488547,9.6 C24.5488547,9.93137085 24.2802256,10.2 23.9488547,10.2 L15.6,10.2 C15.2686292,10.2 15,9.93137085 15,9.6 C15,9.26862915 15.2686292,9 15.6,9 Z" id="矩形备份-63" fill="#FF7575"></path>
498
+ <path d="M10.6,14 L21.7142342,14 C22.0456051,14 22.3142342,14.2686292 22.3142342,14.6 C22.3142342,14.9313708 22.0456051,15.2 21.7142342,15.2 L10.6,15.2 C10.2686292,15.2 10,14.9313708 10,14.6 C10,14.2686292 10.2686292,14 10.6,14 Z" id="矩形备份-65" fill="#CACACA"></path>
499
+ <path d="M13.6,19 L29.1044747,19 C29.4358456,19 29.7044747,19.2686292 29.7044747,19.6 C29.7044747,19.9313708 29.4358456,20.2 29.1044747,20.2 L13.6,20.2 C13.2686292,20.2 13,19.9313708 13,19.6 C13,19.2686292 13.2686292,19 13.6,19 Z" id="矩形备份-66" fill="#6698FF"></path>
500
+ </g>
501
+ </g>
502
+ </g>
503
+ </g>
504
+ </svg>`
505
+ },
506
+ {
507
+ key: PluginMenuIcons.table,
508
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
509
+ <title>表格</title>
510
+ <g id="表格" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
511
+ <g id="icon">
512
+ <path d="M32,0 C34.209139,0 36,1.790861 36,4 L36,32 C36,34.209139 34.209139,36 32,36 L4,36 C1.790861,36 0,34.209139 0,32 L0,4 C0,1.790861 1.790861,0 4,0 L32,0 Z M32,1 L4,1 C2.40231912,1 1.09633912,2.24891996 1.00509269,3.82372721 L1,4 L1,32 C1,33.5976809 2.24891996,34.9036609 3.82372721,34.9949073 L4,35 L32,35 C33.5976809,35 34.9036609,33.75108 34.9949073,32.1762728 L35,32 L35,4 C35,2.40231912 33.75108,1.09633912 32.1762728,1.00509269 L32,1 Z" id="矩形" fill="#EEEEEE" fill-rule="nonzero"></path>
513
+ <g id="编组-36" transform="translate(6.800000, 8.800000)">
514
+ <path d="M20.2,0 L2.2,0 C0.98497355,0 0,0.98497355 0,2.2 L0,16.2 C0,17.4150264 0.98497355,18.4 2.2,18.4 L20.2,18.4 C21.4150264,18.4 22.4,17.4150264 22.4,16.2 L22.4,2.2 C22.4,0.98497355 21.4150264,0 20.2,0 Z M20.2,1.2 C20.7522847,1.2 21.2,1.64771525 21.2,2.2 L21.2,16.2 C21.2,16.7522847 20.7522847,17.2 20.2,17.2 L2.2,17.2 C1.64771525,17.2 1.2,16.7522847 1.2,16.2 L1.2,2.2 C1.2,1.64771525 1.64771525,1.2 2.2,1.2 L20.2,1.2 Z" id="矩形" fill="#D8D8D8" fill-rule="nonzero"></path>
515
+ <path d="M2.2,1.2 L20.2,1.2 C20.7522847,1.2 21.2,1.64771525 21.2,2.2 L21.2,5.7 L21.2,5.7 L1.2,5.7 L1.2,2.2 C1.2,1.64771525 1.64771525,1.2 2.2,1.2 Z" id="矩形" fill="#EEEEEE"></path>
516
+ <path d="M21.2,5.2 L21.2,6.4 L15.3,6.4 L15.3,11.2 L21.2,11.2 L21.2,12.4 L15.3,12.4 L15.3,17.3 L14.1,17.3 L14.1,12.4 L8.3,12.4 L8.3,17.3 L7.1,17.3 L7.1,12.4 L1.2,12.4 L1.2,11.2 L7.1,11.2 L7.1,6.4 L1.2,6.4 L1.2,5.2 L21.2,5.2 Z M14.1,6.4 L8.3,6.4 L8.3,11.2 L14.1,11.2 L14.1,6.4 Z" id="形状结合" fill="#D8D8D8"></path>
517
+ <path d="M9.8,8.11197815 L12.6,8.11197815 C12.9313708,8.11197815 13.2,8.3806073 13.2,8.71197815 C13.2,9.043349 12.9313708,9.31197815 12.6,9.31197815 L9.8,9.31197815 C9.46862915,9.31197815 9.2,9.043349 9.2,8.71197815 C9.2,8.3806073 9.46862915,8.11197815 9.8,8.11197815 Z" id="矩形" fill="#6698FF"></path>
518
+ <path d="M16.8,14.1134683 L19.6,14.1134683 C19.9313708,14.1134683 20.2,14.3820974 20.2,14.7134683 C20.2,15.0448391 19.9313708,15.3134683 19.6,15.3134683 L16.8,15.3134683 C16.4686292,15.3134683 16.2,15.0448391 16.2,14.7134683 C16.2,14.3820974 16.4686292,14.1134683 16.8,14.1134683 Z" id="矩形备份-71" fill="#FF7575"></path>
519
+ </g>
520
+ </g>
521
+ </g>
522
+ </svg>`
523
+ },
524
+ {
525
+ key: PluginMenuIcons.hr,
526
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
527
+ <title>分割线</title>
528
+ <defs>
529
+ <rect id="path-1" x="1" y="1" width="34" height="34" rx="4"></rect>
530
+ </defs>
531
+ <g id="分割线" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
532
+ <g id="矩形备份-60">
533
+ <path d="M32,0 C34.209139,0 36,1.790861 36,4 L36,32 C36,34.209139 34.209139,36 32,36 L4,36 C1.790861,36 0,34.209139 0,32 L0,4 C0,1.790861 1.790861,0 4,0 L32,0 Z M32,1 L4,1 C2.40231912,1 1.09633912,2.24891996 1.00509269,3.82372721 L1,4 L1,32 C1,33.5976809 2.24891996,34.9036609 3.82372721,34.9949073 L4,35 L32,35 C33.5976809,35 34.9036609,33.75108 34.9949073,32.1762728 L35,32 L35,4 C35,2.40231912 33.75108,1.09633912 32.1762728,1.00509269 L32,1 Z" id="蒙版" fill="#EEEEEE" fill-rule="nonzero"></path>
534
+ <mask id="mask-2" fill="white">
535
+ <use xlink:href="#path-1"></use>
536
+ </mask>
537
+ <use id="蒙版" fill="#FFFFFF" xlink:href="#path-1"></use>
538
+ <g id="编组-33" mask="url(#mask-2)">
539
+ <g transform="translate(7.000000, 7.500000)">
540
+ <path d="M3.6,0 L17.5238673,0 C17.8552382,1.87571599e-15 18.1238673,0.26862915 18.1238673,0.6 C18.1238673,0.93137085 17.8552382,1.2 17.5238673,1.2 L3.6,1.2 C3.26862915,1.2 3,0.93137085 3,0.6 C3,0.26862915 3.26862915,1.7189414e-16 3.6,0 Z" id="矩形备份-81" fill="#CACACA"></path>
541
+ <path d="M6.47613265,15 L20.4,15 C20.7313708,15 21,15.2686292 21,15.6 C21,15.9313708 20.7313708,16.2 20.4,16.2 L6.47613265,16.2 C6.1447618,16.2 5.87613265,15.9313708 5.87613265,15.6 C5.87613265,15.2686292 6.1447618,15 6.47613265,15 Z" id="矩形备份-84" fill="#CACACA"></path>
542
+ <path d="M5.49677721,5 L14.6485,5 C14.9798709,5 15.2485,5.26862915 15.2485,5.6 C15.2485,5.93137085 14.9798709,6.2 14.6485,6.2 L5.49677721,6.2 C5.16540636,6.2 4.89677721,5.93137085 4.89677721,5.6 C4.89677721,5.26862915 5.16540636,5 5.49677721,5 Z" id="矩形备份-82" fill="#CACACA"></path>
543
+ <path d="M2.55871088,20 L11.7104337,20 C12.0418046,20 12.3104337,20.2686292 12.3104337,20.6 C12.3104337,20.9313708 12.0418046,21.2 11.7104337,21.2 L2.55871088,21.2 C2.22734003,21.2 1.95871088,20.9313708 1.95871088,20.6 C1.95871088,20.2686292 2.22734003,20 2.55871088,20 Z" id="矩形备份-85" fill="#CACACA"></path>
544
+ <path d="M0.6,10 L20.4,10 C20.7313708,10 21,10.2686292 21,10.6 C21,10.9313708 20.7313708,11.2 20.4,11.2 L0.6,11.2 C0.26862915,11.2 4.05812251e-17,10.9313708 0,10.6 C-4.05812251e-17,10.2686292 0.26862915,10 0.6,10 Z" id="矩形备份-83" fill="#AAAAAA"></path>
545
+ </g>
546
+ </g>
547
+ </g>
548
+ </g>
549
+ </svg>`
550
+ },
551
+ {
552
+ key: PluginMenuIcons.heading_1,
553
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
554
+ <title>H1</title>
555
+ <g id="H1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
556
+ <g id="icon">
557
+ <rect id="矩形" stroke="#EEEEEE" fill="#FFFFFF" x="0.5" y="0.5" width="35" height="35" rx="4"></rect>
558
+ <g id="1.Base基础/1.icon图标/11.editor/header-1" transform="translate(9.000000, 7.000000)" fill="#666666">
559
+ <path d="M7.6,0 C7.93137085,-6.08718376e-17 8.2,0.26862915 8.2,0.6 L8.2,11.4 C8.2,11.7313708 7.93137085,12 7.6,12 C7.26862915,12 7,11.7313708 7,11.4 L7,6.4 L1.2,6.4 L1.2,11.4 C1.2,11.7313708 0.93137085,12 0.6,12 C0.26862915,12 1.51603528e-16,11.7313708 0,11.4 L0,0.6 C7.04410774e-17,0.26862915 0.26862915,-1.61172767e-16 0.6,0 C0.93137085,-6.08718376e-17 1.2,0.26862915 1.2,0.6 L1.2,5.2 L7,5.2 L7,0.6 C7,0.26862915 7.26862915,-1.61172767e-16 7.6,0 Z M12.6,4.03849355 C12.9313708,4.03849355 13.2,4.3071227 13.2,4.63849355 L13.2,10.7994936 L14.3,10.8 C14.5761424,10.8 14.8,11.0238576 14.8,11.3 L14.8,11.5 C14.8,11.7761424 14.5761424,12 14.3,12 L10.8,12 C10.5238576,12 10.3,11.7761424 10.3,11.5 L10.3,11.3 C10.3,11.0238576 10.5238576,10.8 10.8,10.8 L12,10.7994936 L11.9992076,5.99749355 L11.4573367,6.503957 C11.2420362,6.70484511 10.9182139,6.71678064 10.6901851,6.54683893 L10.6095636,6.47459911 C10.6095239,6.47455657 10.6094842,6.47451403 10.6094445,6.47447147 C10.3834309,6.23210152 10.3966345,5.85241672 10.6389386,5.62633256 L12.1456416,4.22048943 C12.1994667,4.1702674 12.2600744,4.13185491 12.3242723,4.1051414 L12.4103536,4.06908195 C12.4699613,4.04923872 12.5337258,4.03849355 12.6,4.03849355 Z" id="形状结合"></path>
560
+ </g>
561
+ <path d="M8.6,28 L18.4,28 C18.7313708,28 19,28.2686292 19,28.6 C19,28.9313708 18.7313708,29.2 18.4,29.2 L8.6,29.2 C8.26862915,29.2 8,28.9313708 8,28.6 C8,28.2686292 8.26862915,28 8.6,28 Z M8.6,24 L27.4,24 C27.7313708,24 28,24.2686292 28,24.6 C28,24.9313708 27.7313708,25.2 27.4,25.2 L8.6,25.2 C8.26862915,25.2 8,24.9313708 8,24.6 C8,24.2686292 8.26862915,24 8.6,24 Z" id="形状结合" fill="#CACACA"></path>
562
+ </g>
563
+ </g>
564
+ </svg>`
565
+ },
566
+ {
567
+ key: PluginMenuIcons.heading_2,
568
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
569
+ <title>H2</title>
570
+ <g id="H2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
571
+ <g id="icon">
572
+ <rect id="矩形" stroke="#EEEEEE" fill="#FFFFFF" x="0.5" y="0.5" width="35" height="35" rx="4"></rect>
573
+ <g id="1.Base基础/1.icon图标/11.editor/header-1" transform="translate(8.000000, 5.000000)" fill="#666666">
574
+ <path d="M8.6,2 C8.93137085,2 9.2,2.26862915 9.2,2.6 L9.2,13.4 C9.2,13.7313708 8.93137085,14 8.6,14 C8.26862915,14 8,13.7313708 8,13.4 L7.999,8.4 L2.2,8.4 L2.2,13.4 C2.2,13.7313708 1.93137085,14 1.6,14 C1.26862915,14 1,13.7313708 1,13.4 L1,2.6 C1,2.26862915 1.26862915,2 1.6,2 C1.93137085,2 2.2,2.26862915 2.2,2.6 L2.2,7.2 L7.999,7.2 L8,2.6 C8,2.26862915 8.26862915,2 8.6,2 Z M10.6050397,12.9143577 C10.5088932,13.5872926 11.0315636,13.9150843 11.673969,13.8576252 L14.7346207,13.8600109 C15.0659915,13.8600109 15.3346207,13.5913818 15.3346207,13.2600109 C15.3346207,12.9286401 15.0659915,12.6600109 14.7346207,12.6600109 L11.8578688,12.6600109 C11.9286468,12.324783 12.0484495,12.1022143 12.3451123,11.7834278 C12.3790085,11.7470038 12.4146387,11.7109747 12.4520606,11.6753577 C12.4981091,11.6315301 12.5450179,11.590446 12.5935631,11.5512355 C12.734276,11.4375804 12.8707598,11.3503175 13.1225647,11.206769 C13.9119415,10.7567625 14.2357153,10.5238408 14.7581338,9.92598498 C15.7545688,8.78566459 15.3845816,6.90006903 13.8145208,6.29898616 C13.1088388,6.02882249 12.2294594,6.13691231 11.509755,6.55397744 C11.1947054,6.73654711 10.9257925,6.99181908 10.7050302,7.31345899 C10.5175098,7.5866672 10.5869735,7.96016156 10.8601817,8.147682 C11.1333899,8.33520244 11.5068842,8.26573878 11.6944047,7.99253057 C11.8168882,7.81407796 11.9552234,7.68276 12.1114244,7.59224233 C12.5322515,7.34837511 13.037157,7.28631413 13.3854792,7.41966599 C14.146101,7.71086283 14.3210515,8.60247738 13.8545136,9.13638345 C13.4412636,9.6093069 13.2103422,9.77543093 12.5282596,10.1642713 C12.2246758,10.3373378 12.0423445,10.4539139 11.8395486,10.6177142 C11.7659434,10.6771658 11.6945757,10.7396718 11.6247531,10.8061268 C11.5697738,10.8584544 11.5170831,10.911735 11.4666494,10.9659299 C11.1108509,11.3482621 10.877698,11.762253 10.7425697,12.192387 C10.6922909,12.3524319 10.6581826,12.5062255 10.6351917,12.6597188 C10.6238114,12.7356971 10.6061737,12.8994638 10.6050397,12.9143577 Z" id="形状结合"></path>
575
+ </g>
576
+ <path d="M8.6,28 L18.4,28 C18.7313708,28 19,28.2686292 19,28.6 C19,28.9313708 18.7313708,29.2 18.4,29.2 L8.6,29.2 C8.26862915,29.2 8,28.9313708 8,28.6 C8,28.2686292 8.26862915,28 8.6,28 Z M8.6,24 L27.4,24 C27.7313708,24 28,24.2686292 28,24.6 C28,24.9313708 27.7313708,25.2 27.4,25.2 L8.6,25.2 C8.26862915,25.2 8,24.9313708 8,24.6 C8,24.2686292 8.26862915,24 8.6,24 Z" id="形状结合" fill="#CACACA"></path>
577
+ </g>
578
+ </g>
579
+ </svg>`
580
+ },
581
+ {
582
+ key: PluginMenuIcons.heading_3,
583
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
584
+ <title>H3</title>
585
+ <g id="H3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
586
+ <g id="icon">
587
+ <rect id="矩形" stroke="#EEEEEE" fill="#FFFFFF" x="0.5" y="0.5" width="35" height="35" rx="4"></rect>
588
+ <g id="1.Base基础/1.icon图标/11.editor/header-1" transform="translate(8.000000, 5.000000)" fill="#666666">
589
+ <path d="M8.6,2 C8.93137085,2 9.2,2.26862915 9.2,2.6 L9.2,13.4 C9.2,13.7313708 8.93137085,14 8.6,14 C8.26862915,14 8,13.7313708 8,13.4 L7.999,8.4 L2.2,8.4 L2.2,13.4 C2.2,13.7313708 1.93137085,14 1.6,14 C1.26862915,14 1,13.7313708 1,13.4 L1,2.6 C1,2.26862915 1.26862915,2 1.6,2 C1.93137085,2 2.2,2.26862915 2.2,2.6 L2.2,7.2 L7.999,7.2 L8,2.6 C8,2.26862915 8.26862915,2 8.6,2 Z M14.8321775,7.18983161 C15.1357692,6.79527134 14.854493,6.22394171 14.356652,6.22394171 L11.0241938,6.22394171 C10.6928229,6.22394171 10.4241938,6.49257086 10.4241938,6.82394171 C10.4241938,7.15531256 10.6928229,7.42394171 11.0241938,7.42394171 L13.137929,7.42394171 L11.8506572,9.09693329 C11.7699456,9.20182941 11.7261828,9.33046927 11.7261828,9.46282318 L11.7261828,9.82922943 C11.7261828,10.1666497 12.0043217,10.4377176 12.3416301,10.4290305 C12.6787875,10.4203474 12.9830249,10.4540644 13.2547454,10.5294651 C13.7397835,10.6640601 14.0222167,11.2257408 13.8341992,11.8813236 C13.6970249,12.3596256 13.2389994,12.6238282 12.6183411,12.6238282 C12.0434265,12.6238282 11.4646434,12.41278 10.8719286,11.9820919 C10.6038559,11.7873006 10.2286305,11.8467069 10.0338391,12.1147796 C9.8390478,12.3828523 9.89845407,12.7580777 10.1665268,12.952869 C10.9617588,13.5307135 11.7826635,13.8238282 12.6183411,13.8238282 C13.7784713,13.8238282 14.6856352,13.2653796 14.9876983,12.2121406 C15.3629178,10.9038183 14.7001971,9.6852239 13.575613,9.37315895 C13.4583717,9.34062522 13.3380638,9.31356451 13.2147084,9.29196113 L14.8321775,7.18983161 Z" id="形状结合"></path>
590
+ </g>
591
+ <path d="M8.6,28 L18.4,28 C18.7313708,28 19,28.2686292 19,28.6 C19,28.9313708 18.7313708,29.2 18.4,29.2 L8.6,29.2 C8.26862915,29.2 8,28.9313708 8,28.6 C8,28.2686292 8.26862915,28 8.6,28 Z M8.6,24 L27.4,24 C27.7313708,24 28,24.2686292 28,24.6 C28,24.9313708 27.7313708,25.2 27.4,25.2 L8.6,25.2 C8.26862915,25.2 8,24.9313708 8,24.6 C8,24.2686292 8.26862915,24 8.6,24 Z" id="形状结合" fill="#CACACA"></path>
592
+ </g>
593
+ </g>
594
+ </svg>`
595
+ },
596
+ {
597
+ key: PluginMenuIcons.heading_4,
598
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
599
+ <title>H4</title>
600
+ <g id="H4" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
601
+ <g id="icon">
602
+ <rect id="矩形" stroke="#EEEEEE" fill="#FFFFFF" x="0.5" y="0.5" width="35" height="35" rx="4"></rect>
603
+ <g id="1.Base基础/1.icon图标/11.editor/header-1" transform="translate(8.000000, 5.000000)" fill="#666666">
604
+ <path d="M8.6,2 C8.93137085,2 9.2,2.26862915 9.2,2.6 L9.2,13.4 C9.2,13.7313708 8.93137085,14 8.6,14 C8.26862915,14 8,13.7313708 8,13.4 L7.999,8.4 L2.2,8.4 L2.2,13.4 C2.2,13.7313708 1.93137085,14 1.6,14 C1.26862915,14 1,13.7313708 1,13.4 L1,2.6 C1,2.26862915 1.26862915,2 1.6,2 C1.93137085,2 2.2,2.26862915 2.2,2.6 L2.2,7.2 L7.999,7.2 L8,2.6 C8,2.26862915 8.26862915,2 8.6,2 Z M13.4093228,5.91341961 C13.7406441,5.91915017 14.0045876,6.19238469 13.998857,6.52370599 L13.998857,6.52370599 L13.9382755,9.99126303 L14.8179917,9.99134588 C15.1162255,9.99134588 15.3636385,10.2089355 15.4101387,10.4940228 L15.4179917,10.5913459 C15.4179917,10.9227167 15.1493626,11.1913459 14.8179917,11.1913459 L14.8179917,11.1913459 L13.9182755,11.191263 L13.8794422,13.4278503 C13.8742847,13.7260395 13.652449,13.9696526 13.3666002,14.0112157 L13.2691559,14.0173845 C12.9378346,14.0116539 12.6738911,13.7384194 12.6796217,13.4070981 L12.6796217,13.4070981 L12.7172755,11.191263 L10.5912754,11.1913459 C10.1454143,11.1913459 9.86643429,10.7287014 10.0448619,10.3426594 L10.0902034,10.2613052 L12.776267,6.18328918 C12.9048512,5.9880711 13.1278997,5.89246083 13.3452953,5.91706111 Z M12.7382755,9.99126303 L12.7662755,8.38026303 L11.7049365,9.99134588 L12.7382755,9.99126303 Z" id="形状结合"></path>
605
+ </g>
606
+ <path d="M8.6,28 L18.4,28 C18.7313708,28 19,28.2686292 19,28.6 C19,28.9313708 18.7313708,29.2 18.4,29.2 L8.6,29.2 C8.26862915,29.2 8,28.9313708 8,28.6 C8,28.2686292 8.26862915,28 8.6,28 Z M8.6,24 L27.4,24 C27.7313708,24 28,24.2686292 28,24.6 C28,24.9313708 27.7313708,25.2 27.4,25.2 L8.6,25.2 C8.26862915,25.2 8,24.9313708 8,24.6 C8,24.2686292 8.26862915,24 8.6,24 Z" id="形状结合" fill="#CACACA"></path>
607
+ </g>
608
+ </g>
609
+ </svg>`
610
+ },
611
+ {
612
+ key: PluginMenuIcons.bulletedList,
613
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
614
+ <title>无序列表</title>
615
+ <g id="无序列表" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
616
+ <g id="icon">
617
+ <rect id="矩形" stroke="#EEEEEE" fill="#FFFFFF" x="0.5" y="0.5" width="35" height="35" rx="4"></rect>
618
+ <g id="1.icon图标/11.editor/-save备份-32" transform="translate(8.000000, 9.000000)">
619
+ <circle id="椭圆形" fill="#666666" cx="1.5" cy="1.5" r="1.5"></circle>
620
+ <circle id="椭圆形备份" fill="#666666" cx="1.5" cy="9" r="1.5"></circle>
621
+ <circle id="椭圆形备份-2" fill="#666666" cx="1.5" cy="16.5" r="1.5"></circle>
622
+ <g id="编组-2" transform="translate(7.000000, 1.000000)" fill="#CACACA">
623
+ <path d="M0.59981695,7.55958265 L8.40018305,7.55958265 C8.7314528,7.55958265 9,7.82812984 9,8.1593996 C9,8.49066935 8.7314528,8.75921655 8.40018305,8.75921655 L0.59981695,8.75921655 C0.268547196,8.75921655 4.05688444e-17,8.49066935 0,8.1593996 C-4.05688444e-17,7.82812984 0.268547196,7.55958265 0.59981695,7.55958265 Z" id="矩形备份-74"></path>
624
+ <path d="M0.59981695,0 L12.400183,0 C12.7314528,-2.44215884e-15 13,0.268547196 13,0.59981695 C13,0.931086705 12.7314528,1.1996339 12.400183,1.1996339 L0.59981695,1.1996339 C0.268547196,1.1996339 4.05688444e-17,0.931086705 0,0.59981695 C-4.05688444e-17,0.268547196 0.268547196,6.08532667e-17 0.59981695,0 Z" id="矩形备份-75"></path>
625
+ <path d="M0.59981695,15 L12.400183,15 C12.7314528,15 13,15.2685472 13,15.599817 C13,15.9310867 12.7314528,16.1996339 12.400183,16.1996339 L0.59981695,16.1996339 C0.268547196,16.1996339 4.05688444e-17,15.9310867 0,15.599817 C-4.05688444e-17,15.2685472 0.268547196,15 0.59981695,15 Z" id="矩形备份-77"></path>
626
+ </g>
627
+ </g>
628
+ </g>
629
+ </g>
630
+ </svg>`
631
+ },
632
+ {
633
+ key: PluginMenuIcons.numberedList,
634
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
635
+ <title>有序列表</title>
636
+ <g id="有序列表" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
637
+ <g id="icon">
638
+ <rect id="矩形" stroke="#EEEEEE" fill="#FFFFFF" x="0.5" y="0.5" width="35" height="35" rx="4"></rect>
639
+ <g id="1.icon图标/11.editor/-save备份-32" transform="translate(8.000000, 8.000000)">
640
+ <path d="M1.29125304,1.43706144 L1.29125304,4.74230276 L2.58250608,4.74230276 L2.58250608,0 L1.57819816,0 L0,1.00594301 L0.57389024,2.01188602 L1.29125304,1.43706144 Z M0.14347256,8.47866252 L1.00430792,9.19719324 C1.14778048,8.90978095 1.4347256,8.76607481 1.57819816,8.76607481 C1.72167072,8.76607481 1.72167072,8.76607481 1.86514328,8.90978095 C2.00861584,9.0534871 2.00861584,9.0534871 2.00861584,9.19719324 C2.00861584,9.34089938 2.00861584,9.48460553 1.86514328,9.62831167 C1.72167072,9.77201782 1.57819816,9.91572396 1.4347256,10.2031362 L0.14347256,11.6401977 L0.14347256,12.5024346 L3.29986888,12.5024346 L3.29986888,11.3527854 L1.86514328,11.3527854 L2.43903352,10.7779608 C2.8694512,10.3468424 3.15639632,10.0594301 3.15639632,9.77201782 C3.29986888,9.48460553 3.29986888,9.34089938 3.29986888,9.0534871 C3.29986888,8.62236866 3.15639632,8.33495637 2.8694512,8.04754408 C2.58250608,7.7601318 2.1520884,7.61642565 1.72167072,7.61642565 C1.00430792,7.61642565 0.43041768,7.90383794 0.14347256,8.47866252 Z M2.72597864,17.6758558 C3.15639632,17.3884435 3.29986888,17.1010312 3.29986888,16.5262066 C3.29986888,16.0950882 3.15639632,15.8076759 2.8694512,15.5202636 C2.58250608,15.2328513 2.1520884,15.2328513 1.72167072,15.2328513 C1.4347256,15.2328513 1.00430792,15.3765574 0.7173628,15.5202636 C0.43041768,15.6639697 0.28694512,15.951382 0.14347256,16.2387943 L1.14778048,16.8136189 C1.29125304,16.5262066 1.4347256,16.3825005 1.72167072,16.3825005 C1.86514328,16.3825005 2.00861584,16.3825005 2.00861584,16.5262066 C2.1520884,16.5262066 2.1520884,16.6699127 2.1520884,16.8136189 C2.1520884,16.957325 2.1520884,16.957325 2.00861584,17.1010312 C1.86514328,17.1010312 1.86514328,17.2447373 1.72167072,17.2447373 L1.29125304,17.2447373 L1.29125304,18.2506803 L1.57819816,18.2506803 C1.72167072,18.2506803 1.86514328,18.2506803 2.00861584,18.3943865 C2.1520884,18.5380926 2.1520884,18.5380926 2.1520884,18.6817988 C2.1520884,18.8255049 2.1520884,18.9692111 2.00861584,18.9692111 C1.86514328,19.1129172 1.86514328,19.1129172 1.72167072,19.1129172 C1.4347256,19.1129172 1.29125304,18.9692111 1.14778048,18.6817988 L1.687539e-14,18.9692111 C0.14347256,19.2566233 0.28694512,19.5440356 0.7173628,19.8314479 C1.00430792,19.9751541 1.4347256,20.1188602 1.86514328,20.1188602 C2.29556096,20.1188602 2.72597864,19.9751541 3.01292376,19.6877418 C3.29986888,19.4003295 3.44334144,19.1129172 3.44334144,18.6817988 C3.44334144,18.2506803 3.15639632,17.8195619 2.72597864,17.6758558 Z" id="合并形状" fill="#666666" fill-rule="nonzero"></path>
641
+ <g id="编组-2" transform="translate(7.000000, 2.000000)" fill="#CACACA">
642
+ <path d="M0.59981695,7.55958265 L8.40018305,7.55958265 C8.7314528,7.55958265 9,7.82812984 9,8.1593996 C9,8.49066935 8.7314528,8.75921655 8.40018305,8.75921655 L0.59981695,8.75921655 C0.268547196,8.75921655 4.05688444e-17,8.49066935 0,8.1593996 C-4.05688444e-17,7.82812984 0.268547196,7.55958265 0.59981695,7.55958265 Z" id="矩形备份-74"></path>
643
+ <path d="M0.59981695,0 L12.400183,0 C12.7314528,-2.44215884e-15 13,0.268547196 13,0.59981695 C13,0.931086705 12.7314528,1.1996339 12.400183,1.1996339 L0.59981695,1.1996339 C0.268547196,1.1996339 4.05688444e-17,0.931086705 0,0.59981695 C-4.05688444e-17,0.268547196 0.268547196,6.08532667e-17 0.59981695,0 Z" id="矩形备份-75"></path>
644
+ <path d="M0.59981695,15 L12.400183,15 C12.7314528,15 13,15.2685472 13,15.599817 C13,15.9310867 12.7314528,16.1996339 12.400183,16.1996339 L0.59981695,16.1996339 C0.268547196,16.1996339 4.05688444e-17,15.9310867 0,15.599817 C-4.05688444e-17,15.2685472 0.268547196,15 0.59981695,15 Z" id="矩形备份-77"></path>
645
+ </g>
646
+ </g>
647
+ </g>
648
+ </g>
649
+ </svg>`
650
+ },
651
+ {
652
+ key: PluginMenuIcons.link,
653
+ svg: `<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
654
+ <title>链接</title>
655
+ <g id="链接" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
656
+ <g id="icon">
657
+ <rect id="矩形" stroke="#EEEEEE" fill="#FFFFFF" x="0.5" y="0.5" width="35" height="35" rx="4"></rect>
658
+ <g id="编组-5" transform="translate(5.000000, 10.000000)">
659
+ <path d="M18.6642225,7.87948239 L21.6075695,7.87948239 C21.9389404,7.87948239 22.2075695,8.14811154 22.2075695,8.47948239 C22.2075695,8.81085324 21.9389404,9.07948239 21.6075695,9.07948239 L18.6642225,9.07948239 C18.3328516,9.07948239 18.0642225,8.81085324 18.0642225,8.47948239 C18.0642225,8.14811154 18.3328516,7.87948239 18.6642225,7.87948239 Z" id="矩形备份-76" fill="#73D897"></path>
660
+ <path d="M18.6642225,2.29271731 L24.4,2.29271731 C24.7313708,2.29271731 25,2.56134646 25,2.89271731 C25,3.22408816 24.7313708,3.49271731 24.4,3.49271731 L18.6642225,3.49271731 C18.3328516,3.49271731 18.0642225,3.22408816 18.0642225,2.89271731 C18.0642225,2.56134646 18.3328516,2.29271731 18.6642225,2.29271731 Z" id="矩形备份-89" fill="#6698FF"></path>
661
+ <path d="M18.6642225,13.4662475 L24.4,13.4662475 C24.7313708,13.4662475 25,13.7348766 25,14.0662475 C25,14.3976183 24.7313708,14.6662475 24.4,14.6662475 L18.6642225,14.6662475 C18.3328516,14.6662475 18.0642225,14.3976183 18.0642225,14.0662475 C18.0642225,13.7348766 18.3328516,13.4662475 18.6642225,13.4662475 Z" id="矩形备份-91" fill="#FF7575"></path>
662
+ <g id="1.Base基础/1.icon图标/11.editor/link-insert" transform="translate(-1.000000, -1.000000)" fill="#DDDDDD">
663
+ <path d="M9.25269168,6.12928454 C11.4618307,6.12928454 13.2526917,7.92014554 13.2526917,10.1292845 L13.2526917,14.1292845 C13.2526917,16.3384235 11.4618307,18.1292845 9.25269168,18.1292845 C7.04355269,18.1292845 5.25269168,16.3384235 5.25269168,14.1292845 L5.25269168,13.1292845 L6.45269168,13.1292845 L6.45269168,14.1292845 C6.45269168,15.6756818 7.70629439,16.9292845 9.25269168,16.9292845 C10.799089,16.9292845 12.0526917,15.6756818 12.0526917,14.1292845 L12.0526917,10.1292845 C12.0526917,8.58288724 10.799089,7.32928454 9.25269168,7.32928454 L9.25269168,6.12928454 Z M9.25269168,0.129284535 C11.4618307,0.129284535 13.2526917,1.92014554 13.2526917,4.12928454 L13.2526917,5.12928454 L12.0526917,5.12928454 L12.0526917,4.12928454 C12.0526917,2.58288724 10.799089,1.32928454 9.25269168,1.32928454 C7.70629439,1.32928454 6.45269168,2.58288724 6.45269168,4.12928454 L6.45269168,8.12928454 C6.45269168,9.67568184 7.70629439,10.9292845 9.25269168,10.9292845 L9.25269168,12.1292845 C7.04355269,12.1292845 5.25269168,10.3384235 5.25269168,8.12928454 L5.25269168,4.12928454 C5.25269168,1.92014554 7.04355269,0.129284535 9.25269168,0.129284535 Z" id="形状结合" transform="translate(9.252692, 9.129285) rotate(46.000000) translate(-9.252692, -9.129285) "></path>
664
+ </g>
665
+ </g>
666
+ </g>
667
+ </g>
668
+ </svg>`
669
+ }
670
+ ];
413
671
 
414
672
  class ElementStylePipe {
415
673
  transform(element, align) {
@@ -1160,6 +1418,14 @@ function filterTextFormat(node) {
1160
1418
  }
1161
1419
  });
1162
1420
  }
1421
+ function recursionNodes(nodes, callback) {
1422
+ nodes.forEach(element => {
1423
+ if (Element$1.isElement(element)) {
1424
+ recursionNodes(element.children, callback);
1425
+ }
1426
+ callback(element);
1427
+ });
1428
+ }
1163
1429
 
1164
1430
  const isAcrossBlocks = (editor, fragment) => {
1165
1431
  const startBlock = getStartBlock(editor, fragment[0]);
@@ -1458,6 +1724,58 @@ const pluginsByKey = (editor, plugins) => {
1458
1724
  });
1459
1725
  };
1460
1726
 
1727
+ const ThePluginMenu = {
1728
+ isMenuGroup(value) {
1729
+ if (value instanceof Object && !value.key) {
1730
+ return true;
1731
+ }
1732
+ else {
1733
+ return false;
1734
+ }
1735
+ },
1736
+ isMenuItem(value) {
1737
+ if (value.key) {
1738
+ return true;
1739
+ }
1740
+ else {
1741
+ return false;
1742
+ }
1743
+ }
1744
+ };
1745
+
1746
+ /**
1747
+ * 构建插入菜单,用于绑定界面
1748
+ * @param editor
1749
+ * @param items
1750
+ * @returns
1751
+ */
1752
+ const buildPluginMenu = (menuItemMap, items) => {
1753
+ return items
1754
+ .map(item => {
1755
+ if (ThePluginMenu.isMenuGroup(item)) {
1756
+ return item;
1757
+ }
1758
+ else {
1759
+ return menuItemMap.get(item);
1760
+ }
1761
+ })
1762
+ .filter(item => !!item);
1763
+ };
1764
+ const buildPluginMenuItemMap = (editor) => {
1765
+ const map = new Map();
1766
+ const pluginMenuItems = editor === null || editor === void 0 ? void 0 : editor.plugins.reduce((ret, current) => {
1767
+ var _a;
1768
+ ret.push(...((_a = current === null || current === void 0 ? void 0 : current.menuItems) !== null && _a !== void 0 ? _a : []));
1769
+ return ret;
1770
+ }, []);
1771
+ pluginMenuItems.forEach(menuItem => {
1772
+ if (menuItem) {
1773
+ map.set(menuItem.key, menuItem);
1774
+ }
1775
+ });
1776
+ return map;
1777
+ };
1778
+
1461
1779
  const withTheia = (editor, plugins = []) => {
1462
1780
  let e = editor;
1463
1781
  e.renderElement = (element) => null;
@@ -1593,6 +1911,7 @@ var PluginKeys;
1593
1911
  PluginKeys["quickInsert"] = "quick-insert";
1594
1912
  PluginKeys["paintFormat"] = "paint-format";
1595
1913
  PluginKeys["mention"] = "mention";
1914
+ PluginKeys["internalCommon"] = "internalCommon";
1596
1915
  })(PluginKeys || (PluginKeys = {}));
1597
1916
 
1598
1917
  function idCreator(length = 5) {
@@ -1664,7 +1983,7 @@ function dataSerializing(mode, value) {
1664
1983
 
1665
1984
  const THE_EDITOR_UUID = new WeakMap();
1666
1985
  const THE_EDITOR_CONVERSION_HINT_REF = new WeakMap();
1667
- const THE_EDITOR_QUICK_TOOLBAR_REF = new WeakMap();
1986
+ const THE_PLUGIN_MENU_REF = new WeakMap();
1668
1987
  const THE_EDITOR_ORIGIN_ANCHOR = new WeakMap();
1669
1988
  const THE_EDITOR_POPOVER_REF = new WeakMap();
1670
1989
 
@@ -1836,11 +2155,26 @@ const autoScrollViewHandle = (editor, scrollContainer) => {
1836
2155
  previousHeight = currentHeight;
1837
2156
  };
1838
2157
 
1839
- const toolbarInitialize = (toolbarItems, global = DefaultGlobalToolbarDefinition, inline = DefaultInlineToolbarDefinition, quick = DefaultQuickToolbarDefinition) => {
2158
+ const base64toBlob = (b64Data, contentType = '', sliceSize = 512) => {
2159
+ const byteCharacters = atob(b64Data);
2160
+ const byteArrays = [];
2161
+ for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
2162
+ const slice = byteCharacters.slice(offset, offset + sliceSize);
2163
+ const byteNumbers = new Array(slice.length);
2164
+ for (let i = 0; i < slice.length; i++) {
2165
+ byteNumbers[i] = slice.charCodeAt(i);
2166
+ }
2167
+ const byteArray = new Uint8Array(byteNumbers);
2168
+ byteArrays.push(byteArray);
2169
+ }
2170
+ const blob = new Blob(byteArrays, { type: contentType });
2171
+ return blob;
2172
+ };
2173
+
2174
+ const toolbarInitialize = (toolbarItems, global = DefaultGlobalToolbarDefinition, inline = DefaultInlineToolbarDefinition) => {
1840
2175
  const toolbarDefinition = {
1841
2176
  global,
1842
- inline,
1843
- quick
2177
+ inline
1844
2178
  };
1845
2179
  const toolbarOperations = new Map();
1846
2180
  toolbarItems.forEach(i => toolbarOperations.set(i.key, i));
@@ -1882,7 +2216,7 @@ const createToolbar = (editor, toolbar) => {
1882
2216
  prevItems.push(...((_a = nextPlugin === null || nextPlugin === void 0 ? void 0 : nextPlugin.toolbarItems) !== null && _a !== void 0 ? _a : []));
1883
2217
  return prevItems;
1884
2218
  }, []);
1885
- const toolbarOption = toolbarInitialize(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);
2219
+ const toolbarOption = toolbarInitialize(toolbarItems, toolbar === null || toolbar === void 0 ? void 0 : toolbar.global, toolbar === null || toolbar === void 0 ? void 0 : toolbar.inline);
1886
2220
  const globalToolbarClass = ['the-global-toolbar', getToolbarClass(editor)];
1887
2221
  const toolbarEntity = toolbarOption.toolbarEntity;
1888
2222
  return {
@@ -2113,11 +2447,22 @@ class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
2113
2447
  this.viewContainerRef = viewContainerRef;
2114
2448
  this.overlay = overlay;
2115
2449
  this.className = 'the-toolbar-dropdown-container';
2450
+ this.activeKeys = [];
2116
2451
  this.dropdownMode = DropdownMode;
2117
2452
  }
2118
2453
  get isOpen() {
2119
2454
  return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
2120
2455
  }
2456
+ get activeIcon() {
2457
+ var _a;
2458
+ if (this.toolbarItem.dropdownFixedIcon) {
2459
+ return this.toolbarItem.icon;
2460
+ }
2461
+ return (_a = this.activeMenuItem) === null || _a === void 0 ? void 0 : _a.icon;
2462
+ }
2463
+ get activeDropdown() {
2464
+ return this.toolbarItem.dropdownFixedIcon && !!this.activeKeys.length;
2465
+ }
2121
2466
  ngOnInit() {
2122
2467
  var _a, _b, _c, _d;
2123
2468
  if (!this.activeMenuItem) {
@@ -2127,6 +2472,14 @@ class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
2127
2472
  (_c = (_b = this.elementRef.nativeElement) === null || _b === void 0 ? void 0 : _b.classList) === null || _c === void 0 ? void 0 : _c.add(`${(_d = this.toolbarItem) === null || _d === void 0 ? void 0 : _d.key}`);
2128
2473
  }
2129
2474
  }
2475
+ selectionChange(editor) {
2476
+ super.selectionChange(editor);
2477
+ for (const menu of this.menus) {
2478
+ if ((menu === null || menu === void 0 ? void 0 : menu.active) && (menu === null || menu === void 0 ? void 0 : menu.active(editor))) {
2479
+ this.activeKeys.push(menu.key);
2480
+ }
2481
+ }
2482
+ }
2130
2483
  toggleDropdown(event) {
2131
2484
  var _a;
2132
2485
  super.execute(event);
@@ -2164,7 +2517,7 @@ class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
2164
2517
  outsideClosable: true,
2165
2518
  backdropClosable: true,
2166
2519
  hasBackdrop: false,
2167
- offset: 10,
2520
+ offset: 4,
2168
2521
  minWidth: 0,
2169
2522
  viewContainerRef: this.viewContainerRef,
2170
2523
  scrollStrategy: this.overlay.scrollStrategies.reposition()
@@ -2184,9 +2537,9 @@ class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
2184
2537
  overlayX: 'start',
2185
2538
  overlayY: 'bottom',
2186
2539
  offsetX: 0,
2187
- offsetY: -15
2540
+ offsetY: -4
2188
2541
  };
2189
- const bottomPosition = Object.assign(Object.assign({}, topPosition), { overlayY: 'top', offsetY: 42 });
2542
+ const bottomPosition = Object.assign(Object.assign({}, topPosition), { originY: 'bottom', overlayY: 'top', offsetY: 4 });
2190
2543
  return this.overlay
2191
2544
  .position()
2192
2545
  .flexibleConnectedTo(this.elementRef)
@@ -2197,10 +2550,10 @@ class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
2197
2550
  }
2198
2551
  }
2199
2552
  TheToolbarDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheToolbarDropdownComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2$1.Overlay }], target: i0.ɵɵFactoryTarget.Component });
2200
- TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { itemMousedownHandle: "itemMousedownHandle" }, host: { properties: { "class": "this.className" } }, 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, template: "<a\n *ngIf=\"mode === dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"icon-mode link-with-down\"\n thyAction\n [thyActionIcon]=\"activeMenuItem?.icon\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n<a\n *ngIf=\"mode !== dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"text-mode\"\n thyAction\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <span class=\"show-text\">{{ activeMenuItem?.name }}</span>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n href=\"javascript:;\"\n thyDropdownMenuItem\n [ngStyle]=\"menu?.styles\"\n [thyDropdownMenuItemActive]=\"menu.key === activeMenuItem?.key && !toolbarItem?.dropdownFixedIcon\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"itemMousedown($event, menu)\"\n >\n <thy-icon *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyDropdownMenuItemIcon [thyIconName]=\"menu.icon\"></thy-icon>\n <span *ngIf=\"menu.name\" thyDropdownMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-dropdown-menu-divider *ngIf=\"menu.key === 'split'\"></thy-dropdown-menu-divider>\n </ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i6.ThyDropdownMenuDividerComponent, selector: "thy-dropdown-menu-divider" }, { kind: "directive", type: i6.ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "directive", type: i6.ThyDropdownMenuItemNameDirective, selector: "[thyDropdownMenuItemName]" }, { kind: "directive", type: i6.ThyDropdownMenuItemIconDirective, selector: "[thyDropdownMenuItemIcon]" }, { kind: "directive", type: i6.ThyDropdownMenuItemActiveDirective, selector: "[thyDropdownMenuItemActive]", inputs: ["thyDropdownMenuItemActive"] }] });
2553
+ TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { itemMousedownHandle: "itemMousedownHandle" }, host: { properties: { "class": "this.className" } }, 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, template: "<a\n *ngIf=\"mode === dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"icon-mode\"\n thyAction\n [thyActionIcon]=\"activeIcon\"\n [thyActionActive]=\"activeDropdown\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <thy-icon *ngIf=\"!toolbarItem.isHideDropdownActionIcon\" class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n<a\n *ngIf=\"mode !== dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"text-mode\"\n thyAction\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <span class=\"show-text\">{{ activeMenuItem?.name }}</span>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n class=\"d-flex justify-content-between text-secondary\"\n href=\"javascript:;\"\n thyDropdownMenuItem\n [ngStyle]=\"menu?.styles\"\n [thyDropdownMenuItemActive]=\"activeKeys.includes(menu.key)\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"itemMousedown($event, menu)\"\n >\n <div class=\"d-flex align-items-center\">\n <thy-icon *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyDropdownMenuItemIcon [thyIconName]=\"menu.icon\"></thy-icon>\n <span *ngIf=\"menu.name\" thyDropdownMenuItemName>{{ menu.name }}</span>\n </div>\n <div class=\"menu-item-right font-size-sm text-muted\" *ngIf=\"menu.shortcutKey\">{{ menu.shortcutKey }}</div>\n </a>\n <thy-dropdown-menu-divider *ngIf=\"menu.key === 'split'\"></thy-dropdown-menu-divider>\n </ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i6.ThyDropdownMenuDividerComponent, selector: "thy-dropdown-menu-divider" }, { kind: "directive", type: i6.ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "directive", type: i6.ThyDropdownMenuItemNameDirective, selector: "[thyDropdownMenuItemName]" }, { kind: "directive", type: i6.ThyDropdownMenuItemIconDirective, selector: "[thyDropdownMenuItemIcon]" }, { kind: "directive", type: i6.ThyDropdownMenuItemActiveDirective, selector: "[thyDropdownMenuItemActive]", inputs: ["thyDropdownMenuItemActive"] }] });
2201
2554
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheToolbarDropdownComponent, decorators: [{
2202
2555
  type: Component,
2203
- args: [{ selector: 'the-toolbar-dropdown', template: "<a\n *ngIf=\"mode === dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"icon-mode link-with-down\"\n thyAction\n [thyActionIcon]=\"activeMenuItem?.icon\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n<a\n *ngIf=\"mode !== dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"text-mode\"\n thyAction\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <span class=\"show-text\">{{ activeMenuItem?.name }}</span>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n href=\"javascript:;\"\n thyDropdownMenuItem\n [ngStyle]=\"menu?.styles\"\n [thyDropdownMenuItemActive]=\"menu.key === activeMenuItem?.key && !toolbarItem?.dropdownFixedIcon\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"itemMousedown($event, menu)\"\n >\n <thy-icon *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyDropdownMenuItemIcon [thyIconName]=\"menu.icon\"></thy-icon>\n <span *ngIf=\"menu.name\" thyDropdownMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-dropdown-menu-divider *ngIf=\"menu.key === 'split'\"></thy-dropdown-menu-divider>\n </ng-container>\n </div>\n</ng-template>\n" }]
2556
+ args: [{ selector: 'the-toolbar-dropdown', template: "<a\n *ngIf=\"mode === dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"icon-mode\"\n thyAction\n [thyActionIcon]=\"activeIcon\"\n [thyActionActive]=\"activeDropdown\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <thy-icon *ngIf=\"!toolbarItem.isHideDropdownActionIcon\" class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n<a\n *ngIf=\"mode !== dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"text-mode\"\n thyAction\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <span class=\"show-text\">{{ activeMenuItem?.name }}</span>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n class=\"d-flex justify-content-between text-secondary\"\n href=\"javascript:;\"\n thyDropdownMenuItem\n [ngStyle]=\"menu?.styles\"\n [thyDropdownMenuItemActive]=\"activeKeys.includes(menu.key)\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"itemMousedown($event, menu)\"\n >\n <div class=\"d-flex align-items-center\">\n <thy-icon *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyDropdownMenuItemIcon [thyIconName]=\"menu.icon\"></thy-icon>\n <span *ngIf=\"menu.name\" thyDropdownMenuItemName>{{ menu.name }}</span>\n </div>\n <div class=\"menu-item-right font-size-sm text-muted\" *ngIf=\"menu.shortcutKey\">{{ menu.shortcutKey }}</div>\n </a>\n <thy-dropdown-menu-divider *ngIf=\"menu.key === 'split'\"></thy-dropdown-menu-divider>\n </ng-container>\n </div>\n</ng-template>\n" }]
2204
2557
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2$1.Overlay }]; }, propDecorators: { className: [{
2205
2558
  type: HostBinding,
2206
2559
  args: ['class']
@@ -2221,19 +2574,12 @@ class TheToolbarItemComponent extends TheBaseToolbarItem {
2221
2574
  constructor(ngZone) {
2222
2575
  super();
2223
2576
  this.ngZone = ngZone;
2224
- this.ToolbarItemMode = ToolbarItemMode;
2225
2577
  this.className = 'the-toolbar-item';
2226
- this.itemMode = ToolbarItemMode.horizontal;
2227
2578
  }
2228
2579
  toggleDropdown(event) {
2229
2580
  super.execute(event);
2230
2581
  }
2231
- ngOnInit() {
2232
- var _a, _b;
2233
- if (((_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.quickItemComponent) && isComponentType((_b = this.toolbarItem) === null || _b === void 0 ? void 0 : _b.quickItemComponent)) {
2234
- this.renderToolbarItem();
2235
- }
2236
- }
2582
+ ngOnInit() { }
2237
2583
  preventDefault(event) {
2238
2584
  event.preventDefault();
2239
2585
  event.stopPropagation();
@@ -2246,75 +2592,44 @@ class TheToolbarItemComponent extends TheBaseToolbarItem {
2246
2592
  }
2247
2593
  (_c = this.toolbarItem) === null || _c === void 0 ? void 0 : _c.execute(this.editor);
2248
2594
  }
2249
- renderToolbarItem() {
2250
- this.ngZone.run(() => {
2251
- const toolbarItemRef = this.toolbarContainer.createComponent(this.toolbarItem.quickItemComponent);
2252
- toolbarItemRef.instance.editor = this.editor;
2253
- toolbarItemRef.instance.item = this.toolbarItem;
2254
- toolbarItemRef.instance.itemMode = ToolbarItemMode.vertical;
2255
- });
2256
- }
2257
2595
  }
2258
2596
  TheToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheToolbarItemComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2259
- TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { itemMode: "itemMode" }, host: { listeners: { "mousedown": "toggleDropdown($event)" }, properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `
2260
- <ng-container *ngIf="itemMode === ToolbarItemMode.horizontal; else selectionItem">
2261
- <a
2262
- href="javascript:;"
2263
- thyAction
2264
- [thyActionIcon]="toolbarItem.icon"
2265
- [thyActionActive]="active"
2266
- [thyTooltip]="tooltip"
2267
- [thyTooltipTemplateContext]="{ name: toolbarItem.name, shortcutKey: toolbarItem.shortcutKey }"
2268
- thyTooltipPlacement="top"
2269
- (mousedown)="preventDefault($event)"
2270
- (click)="execute($event)"
2271
- ></a>
2272
- </ng-container>
2273
- <ng-template #selectionItem>
2274
- <ng-container *ngIf="!toolbarItem?.quickItemComponent">
2275
- <thy-icon [thyIconName]="toolbarItem?.icon" [thyIconRotate]="0" class="quick-toolbar-icon"></thy-icon>
2276
- <span class="quick-toolbar-name">{{ toolbarItem?.name }}</span>
2277
- </ng-container>
2278
- </ng-template>
2597
+ TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheToolbarItemComponent, selector: "the-toolbar-item", host: { listeners: { "mousedown": "toggleDropdown($event)" }, properties: { "class": "this.className" } }, usesInheritance: true, ngImport: i0, template: `
2598
+ <a
2599
+ href="javascript:;"
2600
+ thyAction
2601
+ [thyActionIcon]="toolbarItem.icon"
2602
+ [thyActionActive]="active"
2603
+ [thyTooltip]="tooltip"
2604
+ [thyTooltipTemplateContext]="{ name: toolbarItem.name, shortcutKey: toolbarItem.shortcutKey }"
2605
+ thyTooltipPlacement="top"
2606
+ (mousedown)="preventDefault($event)"
2607
+ (click)="execute($event)"
2608
+ ></a>
2279
2609
  <ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>
2280
- <ng-container #toolbarContainer></ng-container>
2281
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i3$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }] });
2610
+ `, isInline: true, dependencies: [{ kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }] });
2282
2611
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheToolbarItemComponent, decorators: [{
2283
2612
  type: Component,
2284
2613
  args: [{
2285
2614
  selector: 'the-toolbar-item',
2286
2615
  template: `
2287
- <ng-container *ngIf="itemMode === ToolbarItemMode.horizontal; else selectionItem">
2288
- <a
2289
- href="javascript:;"
2290
- thyAction
2291
- [thyActionIcon]="toolbarItem.icon"
2292
- [thyActionActive]="active"
2293
- [thyTooltip]="tooltip"
2294
- [thyTooltipTemplateContext]="{ name: toolbarItem.name, shortcutKey: toolbarItem.shortcutKey }"
2295
- thyTooltipPlacement="top"
2296
- (mousedown)="preventDefault($event)"
2297
- (click)="execute($event)"
2298
- ></a>
2299
- </ng-container>
2300
- <ng-template #selectionItem>
2301
- <ng-container *ngIf="!toolbarItem?.quickItemComponent">
2302
- <thy-icon [thyIconName]="toolbarItem?.icon" [thyIconRotate]="0" class="quick-toolbar-icon"></thy-icon>
2303
- <span class="quick-toolbar-name">{{ toolbarItem?.name }}</span>
2304
- </ng-container>
2305
- </ng-template>
2616
+ <a
2617
+ href="javascript:;"
2618
+ thyAction
2619
+ [thyActionIcon]="toolbarItem.icon"
2620
+ [thyActionActive]="active"
2621
+ [thyTooltip]="tooltip"
2622
+ [thyTooltipTemplateContext]="{ name: toolbarItem.name, shortcutKey: toolbarItem.shortcutKey }"
2623
+ thyTooltipPlacement="top"
2624
+ (mousedown)="preventDefault($event)"
2625
+ (click)="execute($event)"
2626
+ ></a>
2306
2627
  <ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>
2307
- <ng-container #toolbarContainer></ng-container>
2308
2628
  `
2309
2629
  }]
2310
2630
  }], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { className: [{
2311
2631
  type: HostBinding,
2312
2632
  args: ['class']
2313
- }], itemMode: [{
2314
- type: Input
2315
- }], toolbarContainer: [{
2316
- type: ViewChild,
2317
- args: ['toolbarContainer', { read: ViewContainerRef, static: true }]
2318
2633
  }], toggleDropdown: [{
2319
2634
  type: HostListener,
2320
2635
  args: ['mousedown', ['$event']]
@@ -2374,7 +2689,12 @@ class TheToolbarComponent {
2374
2689
  });
2375
2690
  this.resizeObserver.observe(editableElement);
2376
2691
  }
2692
+ isTableActive() {
2693
+ const [table] = Editor.nodes(this.editor, { match: n => Element$1.isElement(n) && n.type === ElementKinds.table });
2694
+ return !!table;
2695
+ }
2377
2696
  selectionChange(editor) {
2697
+ this.renderToolbarView();
2378
2698
  const toolbarItems = [...this.toolbarItems, this.moreGroupMenu];
2379
2699
  for (const item of toolbarItems) {
2380
2700
  if (item.key !== ToolbarActionTypes.split) {
@@ -2405,7 +2725,7 @@ class TheToolbarComponent {
2405
2725
  /**
2406
2726
  * calculation display toolbar and more grouped toolbars
2407
2727
  *
2408
- * ┌──────────────────────────────────────── GoolbarToolbarView ───────────────────────────────────┐
2728
+ * ┌──────────────────────────────────────── GlobalToolbarView ───────────────────────────────────┐
2409
2729
  * | ┌─────────────────────────────────────── #children ─────────────────────────────────────────┐ |
2410
2730
  * | | ┌─────── #itemsView ────────┐ ┌──────────────────────┐ ┌── #groupedItemsDropdown ───┐ | |
2411
2731
  * | | | #ungroupedItems | | ToolbarSeparatorView | | #groupedItems | | |
@@ -2413,53 +2733,49 @@ class TheToolbarComponent {
2413
2733
  * | | \---------- only when toolbar items overflow --------/ | |
2414
2734
  * | └───────────────────────────────────────────────────────────────────────────────────────────┘ |
2415
2735
  * └───────────────────────────────────────────────────────────────────────────────────────────────┘
2416
- * split width: 17px
2417
- * item width: default item: 35px; dropdown item: 42px
2736
+ * split width: 13px
2737
+ * item width: default item: 32px; dropdown item: 48px
2418
2738
  * default paddingRight: 4px
2419
2739
  * set aside 50px
2420
2740
  */
2421
2741
  toolbarItemsCompose() {
2422
2742
  let elementWidth = this.isMore ? this.elementWidth : null;
2423
2743
  // dropdown item + paddingRight
2424
- const maxItemWidth = 46;
2744
+ const maxItemWidth = 52;
2425
2745
  // default item + paddingRight
2426
2746
  const defaultItemWidth = 36;
2427
- const splitWidth = 17;
2428
- const splitPadding = 8;
2429
- // special type
2430
- const headingWidth = 75;
2431
- const fontSizeWidth = 52;
2432
2747
  const items = [];
2433
2748
  const group = [];
2434
- for (const item of this.toolbarItems) {
2749
+ for (let i = 0; i < this.toolbarItems.length; i++) {
2750
+ const item = this.toolbarItems[i];
2435
2751
  if (!this.isMore) {
2436
2752
  items.push(item);
2437
2753
  continue;
2438
2754
  }
2439
- // not enough free space
2440
- const allowRender = elementWidth && elementWidth > maxItemWidth;
2441
- if (allowRender && item.key === ToolbarActionTypes.split) {
2442
- items.push(item);
2443
- elementWidth -= splitWidth;
2444
- elementWidth -= splitPadding;
2445
- continue;
2755
+ let itemWidth = defaultItemWidth;
2756
+ switch (item.key) {
2757
+ case ElementKinds.headingList:
2758
+ itemWidth = 74;
2759
+ break;
2760
+ case ToolbarActionTypes.split:
2761
+ itemWidth = 13;
2762
+ break;
2763
+ case ToolbarActionTypes.verticalAlign:
2764
+ itemWidth = this.isTableActive() ? maxItemWidth : 0;
2765
+ break;
2766
+ default:
2767
+ const isCustomComponent = (item === null || item === void 0 ? void 0 : item.type) === ToolbarItemType.dropdown || !!(item === null || item === void 0 ? void 0 : item.iconComponent);
2768
+ itemWidth = isCustomComponent ? maxItemWidth : defaultItemWidth;
2446
2769
  }
2770
+ const remainingWidth = i === this.toolbarItems.length - 1 ? itemWidth : itemWidth + defaultItemWidth;
2771
+ const allowRender = elementWidth && elementWidth >= remainingWidth;
2772
+ elementWidth -= itemWidth;
2447
2773
  if (allowRender) {
2448
2774
  items.push(item);
2449
2775
  }
2450
2776
  else {
2451
2777
  group.push(item);
2452
2778
  }
2453
- if (item.key === ElementKinds.headingList) {
2454
- elementWidth -= headingWidth;
2455
- continue;
2456
- }
2457
- if (item.key === MarkTypes.fontSize) {
2458
- elementWidth -= fontSizeWidth;
2459
- continue;
2460
- }
2461
- const isCustomComponent = (item === null || item === void 0 ? void 0 : item.type) === ToolbarItemType.dropdown || !!(item === null || item === void 0 ? void 0 : item.iconComponent);
2462
- elementWidth -= isCustomComponent ? maxItemWidth : defaultItemWidth;
2463
2779
  }
2464
2780
  return {
2465
2781
  items: this.pureToolbarItems(items),
@@ -4722,6 +5038,19 @@ const createBlockquotePlugin = createPluginFactory({
4722
5038
  execute: editor => BlockquoteEditor.toggleBlockquote(editor)
4723
5039
  }
4724
5040
  ],
5041
+ menuItems: [
5042
+ {
5043
+ key: ElementKinds.blockquote,
5044
+ type: ThePluginMenuItemType.group,
5045
+ keywords: 'yy,yinyong,quote,引用',
5046
+ active: editor => isBlockActive(editor, ElementKinds.blockquote),
5047
+ execute: editor => BlockquoteEditor.toggleBlockquote(editor),
5048
+ name: '引用',
5049
+ description: '引用内容',
5050
+ menuIcon: PluginMenuIcons.blockquote,
5051
+ displayKey: '/yy'
5052
+ }
5053
+ ],
4725
5054
  options: {
4726
5055
  allowParentTypes: [ElementKinds.tableCell]
4727
5056
  }
@@ -4746,7 +5075,6 @@ class TheCodeComponent extends TheBaseElementComponent {
4746
5075
  return { key: item.value, name: item.showName };
4747
5076
  });
4748
5077
  this.destroy$ = new Subject();
4749
- this.ToolbarItemMode = ToolbarItemMode;
4750
5078
  this.isHightLight = false;
4751
5079
  this.resizeHeight = null;
4752
5080
  this.options = {
@@ -4988,7 +5316,7 @@ class TheCodeComponent extends TheBaseElementComponent {
4988
5316
  }
4989
5317
  }
4990
5318
  TheCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheCodeComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$2.ThyNotifyService }, { token: TheContextService }, { token: i0.NgZone }, { token: THE_MODE_TOKEN }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2$1.Overlay }], target: i0.ɵɵFactoryTarget.Component });
4991
- TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "toolbar", first: true, predicate: ["toolbar"], descendants: true, read: TemplateRef, static: true }, { propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }, { propertyName: "toolbarDropdownComponent", first: true, predicate: TheToolbarDropdownComponent, descendants: true, read: TheToolbarDropdownComponent }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsedAndNonReadonly, readonly: options.readOnly, active: isHightLight && isCollapsedAndNonReadonly }\"\n>\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 >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsedAndNonReadonly\"></thy-resize-handle>\n</div>\n\n<ng-template #toolbar>\n <thy-actions thySize=\"xxs\" (mousedown)=\"preventDefault($event)\">\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a href=\"javascript:;\" thyAction thyActionIcon=\"copy\" thyTooltip=\"\u590D\u5236\" thyTooltipPlacement=\"top\" (mousedown)=\"onCopy($event)\"></a>\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n </thy-actions>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "directive", type: i9.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { kind: "component", type: i9.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }, { kind: "component", type: i10.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i5.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i12.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "component", type: i13.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "options", "delayRefreshTime"], outputs: ["focusChange"] }, { kind: "component", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["itemMousedownHandle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5319
+ TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "toolbar", first: true, predicate: ["toolbar"], descendants: true, read: TemplateRef, static: true }, { propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }, { propertyName: "toolbarDropdownComponent", first: true, predicate: TheToolbarDropdownComponent, descendants: true, read: TheToolbarDropdownComponent }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsedAndNonReadonly, readonly: options.readOnly, active: isHightLight && isCollapsedAndNonReadonly }\"\n>\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 >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsedAndNonReadonly\"></thy-resize-handle>\n</div>\n\n<ng-template #toolbar>\n <thy-actions thySize=\"xxs\" (mousedown)=\"preventDefault($event)\">\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a href=\"javascript:;\" thyAction thyActionIcon=\"copy\" thyTooltip=\"\u590D\u5236\" thyTooltipPlacement=\"top\" (mousedown)=\"onCopy($event)\"></a>\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n </thy-actions>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "directive", type: i9.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { kind: "component", type: i9.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection", "thyLine"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }, { kind: "component", type: i10.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i5.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i12.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "component", type: i13.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "options", "delayRefreshTime"], outputs: ["focusChange"] }, { kind: "component", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["itemMousedownHandle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4992
5320
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheCodeComponent, decorators: [{
4993
5321
  type: Component,
4994
5322
  args: [{ selector: 'div[theCode]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsedAndNonReadonly, readonly: options.readOnly, active: isHightLight && isCollapsedAndNonReadonly }\"\n>\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 >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsedAndNonReadonly\"></thy-resize-handle>\n</div>\n\n<ng-template #toolbar>\n <thy-actions thySize=\"xxs\" (mousedown)=\"preventDefault($event)\">\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a href=\"javascript:;\" thyAction thyActionIcon=\"copy\" thyTooltip=\"\u590D\u5236\" thyTooltipPlacement=\"top\" (mousedown)=\"onCopy($event)\"></a>\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n </thy-actions>\n</ng-template>\n" }]
@@ -5039,6 +5367,19 @@ const createCodePlugin = createPluginFactory({
5039
5367
  execute: editor => CodeEditor.insertCode(editor)
5040
5368
  }
5041
5369
  ],
5370
+ menuItems: [
5371
+ {
5372
+ key: ElementKinds.code,
5373
+ type: ThePluginMenuItemType.group,
5374
+ keywords: 'dmk,daimakuai,code,代码块',
5375
+ active: editor => isBlockActive(editor, ElementKinds.code),
5376
+ execute: editor => CodeEditor.insertCode(editor),
5377
+ name: '代码块',
5378
+ description: '支持插入多种语言代码块',
5379
+ menuIcon: PluginMenuIcons.code,
5380
+ displayKey: '/dmk'
5381
+ }
5382
+ ],
5042
5383
  options: {
5043
5384
  allowParentTypes: [ElementKinds.tableCell]
5044
5385
  }
@@ -5192,7 +5533,7 @@ class TheColorToolbarItemComponent extends TheBaseToolbarItem {
5192
5533
  origin: event.currentTarget,
5193
5534
  backdropClosable: false,
5194
5535
  placement: 'bottomLeft',
5195
- offset: 10,
5536
+ offset: 0,
5196
5537
  minWidth: 0,
5197
5538
  hasBackdrop: false,
5198
5539
  insideClosable: false,
@@ -5224,7 +5565,7 @@ TheColorToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14
5224
5565
  ></thy-icon>
5225
5566
  <thy-icon class="link-down-icon font-size-sm text-desc ml-1" thyIconName="caret-down"></thy-icon>
5226
5567
  </a>
5227
- `, isInline: true, dependencies: [{ kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i3$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }] });
5568
+ `, isInline: true, dependencies: [{ kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }] });
5228
5569
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheColorToolbarItemComponent, decorators: [{
5229
5570
  type: Component,
5230
5571
  args: [{
@@ -5623,6 +5964,23 @@ const createBlockCardPlugin = createPluginFactory({
5623
5964
  withOverrides: withBlockCard
5624
5965
  });
5625
5966
 
5967
+ const createCommonPlugin = createPluginFactory({
5968
+ key: PluginKeys.internalCommon,
5969
+ toolbarItems: [
5970
+ {
5971
+ key: ToolbarActionTypes.group,
5972
+ name: '更多',
5973
+ icon: 'more',
5974
+ type: ToolbarItemType.dropdown,
5975
+ dropdownMode: DropdownMode.icon,
5976
+ dropdownItemKey: ToolbarActionTypes.group,
5977
+ dropdownFixedIcon: true,
5978
+ isHideDropdownActionIcon: true,
5979
+ includes: [MarkTypes.underline, MarkTypes.strike, ElementKinds.inlineCode]
5980
+ }
5981
+ ]
5982
+ });
5983
+
5626
5984
  const withGetFragment = (editor) => {
5627
5985
  var _a, _b;
5628
5986
  const { getFragment } = editor;
@@ -5913,6 +6271,74 @@ const createTransformsPlugin = createPluginFactory({
5913
6271
  withOverrides: withTransforms
5914
6272
  });
5915
6273
 
6274
+ const ImageEditor = {
6275
+ openUpload(editor) {
6276
+ const inputFile = document.createElement('input');
6277
+ inputFile.setAttribute('type', 'file');
6278
+ inputFile.setAttribute('accept', 'image/*');
6279
+ inputFile.setAttribute('multiple', 'true');
6280
+ inputFile.onchange = (event) => {
6281
+ ImageEditor.insertImages(editor, event.target.files);
6282
+ };
6283
+ inputFile.click();
6284
+ },
6285
+ insertImages(editor, imageFiles) {
6286
+ const contextService = editor.injector.get(TheContextService);
6287
+ const imageNodes = [];
6288
+ const text = { text: '' };
6289
+ for (const image of imageFiles) {
6290
+ const verify = ImageEditor.verifyImage(editor, image);
6291
+ if (verify) {
6292
+ const url = URL.createObjectURL(image);
6293
+ contextService.addUploadingFiles({ url, file: image });
6294
+ imageNodes.push({ type: ElementKinds.image, url, children: [text] });
6295
+ }
6296
+ }
6297
+ if (imageNodes.length > 0) {
6298
+ insertElements(editor, imageNodes);
6299
+ }
6300
+ },
6301
+ handleBase64ImageElement(editor, image) {
6302
+ if (isString(image.originUrl) && image.originUrl.includes('base64')) {
6303
+ const indexSplit = image.originUrl.indexOf(',');
6304
+ const base64 = image.originUrl.slice(indexSplit + 1);
6305
+ const contentType = image.originUrl.substring(0, image.originUrl.indexOf(';'));
6306
+ const blob = base64toBlob(base64, contentType);
6307
+ const blobUrl = URL.createObjectURL(blob);
6308
+ image.thumbUrl = blobUrl;
6309
+ image.originUrl = blobUrl;
6310
+ image.url = blobUrl;
6311
+ const contextService = editor.injector.get(TheContextService);
6312
+ contextService.addUploadingFiles({ url: blobUrl, file: new File([blob], '') });
6313
+ }
6314
+ },
6315
+ verifyImage(editor, image) {
6316
+ if (!PICTURE_ACCEPTED_UPLOAD_MIME.includes(image.type)) {
6317
+ editor.onError({
6318
+ code: ErrorCodes.IMAGE_ERR_MIME_FORMAT
6319
+ });
6320
+ return false;
6321
+ }
6322
+ if (image.size / 1000000 >= PICTURE_ACCEPTED_UPLOAD_SIZE) {
6323
+ editor.onError({
6324
+ code: ErrorCodes.IMAGE_ERR_SIZE_LIMIT
6325
+ });
6326
+ return false;
6327
+ }
6328
+ return true;
6329
+ },
6330
+ isImageActive(editor) {
6331
+ const [match] = Editor.nodes(editor, {
6332
+ match: n => Element$1.isElement(n) && n.type === ElementKinds.image,
6333
+ universal: true
6334
+ });
6335
+ return !!match;
6336
+ },
6337
+ setImageNode(editor, path, partial) {
6338
+ Transforms.setNodes(editor, partial, { at: path });
6339
+ }
6340
+ };
6341
+
5916
6342
  const withDeserializeHTML = (editor) => {
5917
6343
  const { insertData } = editor;
5918
6344
  editor.insertData = (data) => {
@@ -5934,6 +6360,13 @@ const withDeserializeHTML = (editor) => {
5934
6360
  }
5935
6361
  // 过滤 text 节点的 color/background-color 属性
5936
6362
  fragment.forEach(node => filterTextFormat(node));
6363
+ // base 64 图片处理
6364
+ recursionNodes(fragment, (node) => {
6365
+ const isImage = Element$1.isElement(node) && node.type === ElementKinds.image;
6366
+ if (isImage) {
6367
+ ImageEditor.handleBase64ImageElement(editor, node);
6368
+ }
6369
+ });
5937
6370
  Transforms.insertFragment(editor, fragment);
5938
6371
  return;
5939
6372
  }
@@ -6031,6 +6464,13 @@ const withDeserializeMd = (editor) => {
6031
6464
  editor.undo();
6032
6465
  setTimeout(() => {
6033
6466
  Transforms.select(editor, oldRange);
6467
+ // base 64 图片处理
6468
+ recursionNodes(fragment, (node) => {
6469
+ const isImage = Element$1.isElement(node) && node.type === ElementKinds.image;
6470
+ if (isImage) {
6471
+ ImageEditor.handleBase64ImageElement(editor, node);
6472
+ }
6473
+ });
6034
6474
  Transforms.insertFragment(editor, fragment);
6035
6475
  AngularEditor.focus(editor);
6036
6476
  });
@@ -6228,6 +6668,7 @@ const createHeadingPlugin = createPluginFactory({
6228
6668
  key: ElementKinds.headingList,
6229
6669
  name: '正文',
6230
6670
  type: ToolbarItemType.dropdown,
6671
+ dropdownMode: DropdownMode.text,
6231
6672
  dropdownItemKey: ElementKinds.paragraph,
6232
6673
  includes: [ElementKinds.paragraph, ...STANDARD_HEADING_TYPES]
6233
6674
  },
@@ -6271,6 +6712,52 @@ const createHeadingPlugin = createPluginFactory({
6271
6712
  active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_4)
6272
6713
  }
6273
6714
  ],
6715
+ menuItems: [
6716
+ {
6717
+ key: ElementKinds.heading_1,
6718
+ type: ThePluginMenuItemType.icon,
6719
+ execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_1),
6720
+ active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_1),
6721
+ name: '标题1',
6722
+ displayKey: '/h1',
6723
+ icon: 'header-1',
6724
+ menuIcon: PluginMenuIcons.heading_1,
6725
+ keywords: 'h,H,bt,BT,标题,h1'
6726
+ },
6727
+ {
6728
+ key: ElementKinds.heading_2,
6729
+ type: ThePluginMenuItemType.icon,
6730
+ execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_2),
6731
+ active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_2),
6732
+ name: '标题2',
6733
+ icon: 'header-2',
6734
+ displayKey: '/h2',
6735
+ menuIcon: PluginMenuIcons.heading_2,
6736
+ keywords: 'h,H,bt,BT,标题,h2'
6737
+ },
6738
+ {
6739
+ key: ElementKinds.heading_3,
6740
+ type: ThePluginMenuItemType.icon,
6741
+ execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_3),
6742
+ active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_3),
6743
+ name: '标题3',
6744
+ icon: 'header-3',
6745
+ displayKey: '/h3',
6746
+ menuIcon: PluginMenuIcons.heading_3,
6747
+ keywords: 'h,H,bt,BT,标题,h3'
6748
+ },
6749
+ {
6750
+ key: ElementKinds.heading_4,
6751
+ type: ThePluginMenuItemType.icon,
6752
+ execute: editor => HeadingEditor.setHeading(editor, ElementKinds.heading_4),
6753
+ active: editor => HeadingEditor.isHeadingActive(editor, ElementKinds.heading_4),
6754
+ name: '标题4',
6755
+ icon: 'header-4',
6756
+ displayKey: '/h4',
6757
+ menuIcon: PluginMenuIcons.heading_4,
6758
+ keywords: 'h,H,bt,BT,标题,h4'
6759
+ }
6760
+ ],
6274
6761
  options: headingOptions
6275
6762
  });
6276
6763
 
@@ -6353,65 +6840,24 @@ const createHrPlugin = createPluginFactory({
6353
6840
  execute: editor => HrEditor.insertHr(editor)
6354
6841
  }
6355
6842
  ],
6843
+ menuItems: [
6844
+ {
6845
+ key: ElementKinds.hr,
6846
+ keywords: 'fengexian,fgx,divider,分割线',
6847
+ type: ThePluginMenuItemType.group,
6848
+ active: editor => isBlockActive(editor, ElementKinds.hr),
6849
+ execute: editor => HrEditor.insertHr(editor),
6850
+ name: '分割线',
6851
+ menuIcon: PluginMenuIcons.hr,
6852
+ description: '使用水平线分隔内容',
6853
+ displayKey: '/fgx'
6854
+ }
6855
+ ],
6356
6856
  options: {
6357
6857
  allowParentTypes: [ElementKinds.tableCell]
6358
6858
  }
6359
6859
  });
6360
6860
 
6361
- const ImageEditor = {
6362
- openUpload(editor) {
6363
- const inputFile = document.createElement('input');
6364
- inputFile.setAttribute('type', 'file');
6365
- inputFile.setAttribute('accept', 'image/*');
6366
- inputFile.setAttribute('multiple', 'true');
6367
- inputFile.onchange = (event) => {
6368
- ImageEditor.insertImages(editor, event.target.files);
6369
- };
6370
- inputFile.click();
6371
- },
6372
- insertImages(editor, imageFiles) {
6373
- const contextService = editor.injector.get(TheContextService);
6374
- const imageNodes = [];
6375
- const text = { text: '' };
6376
- for (const image of imageFiles) {
6377
- const verify = ImageEditor.verifyImage(editor, image);
6378
- if (verify) {
6379
- const url = URL.createObjectURL(image);
6380
- contextService.addUploadingFiles({ url, file: image });
6381
- imageNodes.push({ type: ElementKinds.image, url, children: [text] });
6382
- }
6383
- }
6384
- if (imageNodes.length > 0) {
6385
- insertElements(editor, imageNodes);
6386
- }
6387
- },
6388
- verifyImage(editor, image) {
6389
- if (!PICTURE_ACCEPTED_UPLOAD_MIME.includes(image.type)) {
6390
- editor.onError({
6391
- code: ErrorCodes.IMAGE_ERR_MIME_FORMAT
6392
- });
6393
- return false;
6394
- }
6395
- if (image.size / 1000000 >= PICTURE_ACCEPTED_UPLOAD_SIZE) {
6396
- editor.onError({
6397
- code: ErrorCodes.IMAGE_ERR_SIZE_LIMIT
6398
- });
6399
- return false;
6400
- }
6401
- return true;
6402
- },
6403
- isImageActive(editor) {
6404
- const [match] = Editor.nodes(editor, {
6405
- match: n => Element$1.isElement(n) && n.type === ElementKinds.image,
6406
- universal: true
6407
- });
6408
- return !!match;
6409
- },
6410
- setImageNode(editor, path, partial) {
6411
- Transforms.setNodes(editor, partial, { at: path });
6412
- }
6413
- };
6414
-
6415
6861
  class TheImageComponent extends TheBaseElementComponent {
6416
6862
  constructor(elementRef, imageUploaderService, cdr, theContextService, thyPopover, overlay, thyImageService, viewContainerRef) {
6417
6863
  super(elementRef, cdr);
@@ -6748,7 +7194,7 @@ class TheImageComponent extends TheBaseElementComponent {
6748
7194
  }
6749
7195
  }
6750
7196
  TheImageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheImageComponent, deps: [{ token: i0.ElementRef }, { token: THE_UPLOAD_SERVICE_TOKEN }, { token: i0.ChangeDetectorRef }, { token: TheContextService }, { token: i1$1.ThyPopover }, { token: i2$1.Overlay }, { token: i4.ThyImageService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
6751
- TheImageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl\" class=\"image-content\" [class.pointer]=\"!selection\">\n <img\n #img\n thyImage\n [ngStyle]=\"{ 'width.px': imageBindingWidth }\"\n [class.image-collapsed]=\"selection && !uploading\"\n class=\"main-image\"\n (load)=\"imageLoaded($event)\"\n (mousedown)=\"preventDefault($event)\"\n [thySrc]=\"imageEntry.thumbUrl\"\n [thyPreviewSrc]=\"imageEntry.thumbUrl\"\n [thyOriginSrc]=\"imageEntry.originUrl\"\n [thyImageMeta]=\"{ name: imageEntry.name, size: imageEntry.size }\"\n [alt]=\"imageEntry.name\"\n />\n <div *ngIf=\"isCollapsedAndNonReadonly\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsedAndNonReadonly\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsedAndNonReadonly\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsedAndNonReadonly\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsedAndNonReadonly\" (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\" [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\n<ng-template #layoutToolbar>\n <thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyAction\n [thyType]=\"item.key === 'remove' ? 'danger' : 'primary'\"\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"layoutActive(item.key)\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <thy-divider *ngIf=\"item.key === 'split'\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n </ng-container>\n </thy-actions>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i3$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i9$1.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips"] }, { kind: "directive", type: i4.ThyImageDirective, selector: "img[thyImage]", inputs: ["thySrc", "thyPreviewSrc", "thyOriginSrc", "thyImageMeta", "thyDisablePreview", "thyResolveSize"], exportAs: ["thyImage"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i5.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i12.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }] });
7197
+ TheImageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl\" class=\"image-content\" [class.pointer]=\"!selection\">\n <img\n #img\n thyImage\n [ngStyle]=\"{ 'width.px': imageBindingWidth }\"\n [class.image-collapsed]=\"selection && !uploading\"\n class=\"main-image\"\n (load)=\"imageLoaded($event)\"\n (mousedown)=\"preventDefault($event)\"\n [thySrc]=\"imageEntry.thumbUrl\"\n [thyPreviewSrc]=\"imageEntry.thumbUrl\"\n [thyOriginSrc]=\"imageEntry.originUrl\"\n [thyImageMeta]=\"{ name: imageEntry.name, size: imageEntry.size }\"\n [alt]=\"imageEntry.name\"\n />\n <div *ngIf=\"isCollapsedAndNonReadonly\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsedAndNonReadonly\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsedAndNonReadonly\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsedAndNonReadonly\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsedAndNonReadonly\" (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\" [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\n<ng-template #layoutToolbar>\n <thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyAction\n [thyType]=\"item.key === 'remove' ? 'danger' : 'primary'\"\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"layoutActive(item.key)\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <thy-divider *ngIf=\"item.key === 'split'\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n </ng-container>\n </thy-actions>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i9$1.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips"] }, { kind: "directive", type: i4.ThyImageDirective, selector: "img[thyImage]", inputs: ["thySrc", "thyPreviewSrc", "thyOriginSrc", "thyImageMeta", "thyDisablePreview", "thyResolveSize"], exportAs: ["thyImage"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i5.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i12.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }] });
6752
7198
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheImageComponent, decorators: [{
6753
7199
  type: Component,
6754
7200
  args: [{ selector: 'the-image, [theImage]', template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl\" class=\"image-content\" [class.pointer]=\"!selection\">\n <img\n #img\n thyImage\n [ngStyle]=\"{ 'width.px': imageBindingWidth }\"\n [class.image-collapsed]=\"selection && !uploading\"\n class=\"main-image\"\n (load)=\"imageLoaded($event)\"\n (mousedown)=\"preventDefault($event)\"\n [thySrc]=\"imageEntry.thumbUrl\"\n [thyPreviewSrc]=\"imageEntry.thumbUrl\"\n [thyOriginSrc]=\"imageEntry.originUrl\"\n [thyImageMeta]=\"{ name: imageEntry.name, size: imageEntry.size }\"\n [alt]=\"imageEntry.name\"\n />\n <div *ngIf=\"isCollapsedAndNonReadonly\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsedAndNonReadonly\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsedAndNonReadonly\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsedAndNonReadonly\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsedAndNonReadonly\" (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\" [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\n<ng-template #layoutToolbar>\n <thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyAction\n [thyType]=\"item.key === 'remove' ? 'danger' : 'primary'\"\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"layoutActive(item.key)\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <thy-divider *ngIf=\"item.key === 'split'\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n </ng-container>\n </thy-actions>\n</ng-template>\n" }]
@@ -6815,6 +7261,19 @@ const createImagePlugin = createPluginFactory({
6815
7261
  active: editor => ImageEditor.isImageActive(editor)
6816
7262
  }
6817
7263
  ],
7264
+ menuItems: [
7265
+ {
7266
+ key: ElementKinds.image,
7267
+ keywords: 'tp,tupian,image,图片',
7268
+ execute: editor => ImageEditor.openUpload(editor),
7269
+ active: editor => ImageEditor.isImageActive(editor),
7270
+ name: '图片',
7271
+ menuIcon: PluginMenuIcons.image,
7272
+ description: '支持jpg、jpeg等格式图像',
7273
+ type: ThePluginMenuItemType.group,
7274
+ displayKey: '/tp'
7275
+ }
7276
+ ],
6818
7277
  options: {
6819
7278
  allowParentTypes: [ElementKinds.listItem, ElementKinds.tableCell, ElementKinds.blockquote],
6820
7279
  imageTypes: ['image/png', 'image/jpeg', 'image/gif', 'image/bmp']
@@ -6962,6 +7421,7 @@ const createIndentPlugin = createPluginFactory({
6962
7421
  key: ElementKinds.indent,
6963
7422
  includes: [Indents.indentRight, Indents.indentLeft],
6964
7423
  type: ToolbarItemType.dropdown,
7424
+ icon: 'float-left',
6965
7425
  dropdownMode: DropdownMode.icon,
6966
7426
  dropdownItemKey: Indents.indentRight,
6967
7427
  dropdownFixedIcon: true
@@ -6977,7 +7437,7 @@ const createIndentPlugin = createPluginFactory({
6977
7437
  key: Indents.indentLeft,
6978
7438
  name: '减少缩进',
6979
7439
  icon: 'float-right',
6980
- shortcutKey: 'Shift+Tab/BackSpace',
7440
+ shortcutKey: 'Shift+Tab',
6981
7441
  execute: editor => IndentEditor.cancelIndent(editor)
6982
7442
  }
6983
7443
  ],
@@ -7266,7 +7726,7 @@ class TheLinkEditComponent {
7266
7726
  }
7267
7727
  }
7268
7728
  TheLinkEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheLinkEditComponent, deps: [{ token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
7269
- TheLinkEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", 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, template: "<form thyForm #linkForm=\"thyForm\" [thyFormValidatorConfig]=\"validatorConfig\" name=\"linkForm\">\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input thyInput placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\" required name=\"text\" [(ngModel)]=\"text\" thyAutofocus type=\"text\" />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input name=\"link\" thyInput placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\" required type=\"text\" #linkControl=\"ngModel\" [(ngModel)]=\"link\" />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button thyButton=\"link-secondary\" thySize=\"sm\" (click)=\"closePopover()\">\u53D6\u6D88</button>\n <button thyButton=\"primary-square\" thySize=\"sm\" (thyFormSubmit)=\"applyLink(linkForm)\">\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n", dependencies: [{ kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$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]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { kind: "component", type: i3$2.ThyFormGroupComponent, selector: "thy-form-group", inputs: ["thyLabelText", "thyLabelTextTranslateKey", "thyLabelRequired", "thyLabelPaddingTopClear", "thyFeedbackIcon", "thyTipsMode", "thyTips", "thyTipsTranslateKey", "thyRowFill"] }, { kind: "directive", type: i3$2.ThyFormSubmitDirective, selector: "[thyFormSubmit],[thy-form-submit]", outputs: ["thyFormSubmit"] }, { kind: "component", type: i3$2.ThyFormGroupFooterComponent, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { kind: "directive", type: i4$1.ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutoSelect", "thyAutofocus"] }, { kind: "directive", type: i5$1.ThyInputDirective, selector: "[thyInput]", inputs: ["thySize", "thyAutocomplete"] }, { kind: "component", type: i1$4.ThyButtonComponent, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thyBlock"] }] });
7729
+ TheLinkEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", 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, template: "<form thyForm #linkForm=\"thyForm\" [thyFormValidatorConfig]=\"validatorConfig\" name=\"linkForm\">\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input thyInput placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\" required name=\"text\" [(ngModel)]=\"text\" thyAutofocus type=\"text\" />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input name=\"link\" thyInput placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\" required type=\"text\" #linkControl=\"ngModel\" [(ngModel)]=\"link\" />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button thyButton=\"link-secondary\" thySize=\"sm\" (click)=\"closePopover()\">\u53D6\u6D88</button>\n <button thyButton=\"primary-square\" thySize=\"sm\" (thyFormSubmit)=\"applyLink(linkForm)\">\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n", dependencies: [{ kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$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]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { kind: "component", type: i3$1.ThyFormGroupComponent, selector: "thy-form-group", inputs: ["thyLabelText", "thyLabelTextTranslateKey", "thyLabelRequired", "thyLabelPaddingTopClear", "thyFeedbackIcon", "thyTipsMode", "thyTips", "thyTipsTranslateKey", "thyRowFill"] }, { kind: "directive", type: i3$1.ThyFormSubmitDirective, selector: "[thyFormSubmit],[thy-form-submit]", outputs: ["thyFormSubmit"] }, { kind: "component", type: i3$1.ThyFormGroupFooterComponent, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { kind: "directive", type: i4$1.ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutoSelect", "thyAutofocus"] }, { kind: "directive", type: i5$1.ThyInputDirective, selector: "[thyInput]", inputs: ["thySize", "thyAutocomplete"] }, { kind: "component", type: i1$4.ThyButtonComponent, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thyBlock"] }] });
7270
7730
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheLinkEditComponent, decorators: [{
7271
7731
  type: Component,
7272
7732
  args: [{ selector: 'the-link-edit', template: "<form thyForm #linkForm=\"thyForm\" [thyFormValidatorConfig]=\"validatorConfig\" name=\"linkForm\">\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input thyInput placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\" required name=\"text\" [(ngModel)]=\"text\" thyAutofocus type=\"text\" />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input name=\"link\" thyInput placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\" required type=\"text\" #linkControl=\"ngModel\" [(ngModel)]=\"link\" />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button thyButton=\"link-secondary\" thySize=\"sm\" (click)=\"closePopover()\">\u53D6\u6D88</button>\n <button thyButton=\"primary-square\" thySize=\"sm\" (thyFormSubmit)=\"applyLink(linkForm)\">\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n" }]
@@ -7490,6 +7950,19 @@ const createLinkPlugin = createPluginFactory({
7490
7950
  active: editor => LinkEditor.isLinkActive(editor)
7491
7951
  }
7492
7952
  ],
7953
+ menuItems: [
7954
+ {
7955
+ key: ElementKinds.link,
7956
+ keywords: 'lj,linajie,link,链接',
7957
+ execute: editor => LinkEditor.insertLink(editor),
7958
+ active: editor => LinkEditor.isLinkActive(editor),
7959
+ type: ThePluginMenuItemType.icon,
7960
+ name: '链接',
7961
+ displayKey: '/lj',
7962
+ icon: 'link-insert',
7963
+ menuIcon: PluginMenuIcons.link
7964
+ }
7965
+ ],
7493
7966
  options: {
7494
7967
  disabledOperateTypes: [ElementKinds.image, ...DISABLED_OPERATE_TYPES]
7495
7968
  }
@@ -8470,6 +8943,30 @@ const createListPlugin = createPluginFactory({
8470
8943
  active: editor => ListEditor.isActive(editor, ElementKinds.bulletedList)
8471
8944
  }
8472
8945
  ],
8946
+ menuItems: [
8947
+ {
8948
+ key: ElementKinds.numberedList,
8949
+ keywords: 'yxlb,youxuliebiao,numberedlist,有序列表',
8950
+ execute: editor => ListEditor.toggleList(editor, ElementKinds.numberedList),
8951
+ active: editor => ListEditor.isActive(editor, ElementKinds.numberedList),
8952
+ type: ThePluginMenuItemType.icon,
8953
+ name: '有序列表',
8954
+ displayKey: '/yxlb',
8955
+ icon: 'list-ordered',
8956
+ menuIcon: PluginMenuIcons.numberedList
8957
+ },
8958
+ {
8959
+ key: ElementKinds.bulletedList,
8960
+ keywords: 'wxlb,wuxuliebiao,bulletedlist,无序列表',
8961
+ execute: editor => ListEditor.toggleList(editor, ElementKinds.bulletedList),
8962
+ active: editor => ListEditor.isActive(editor, ElementKinds.bulletedList),
8963
+ type: ThePluginMenuItemType.icon,
8964
+ name: '无序列表',
8965
+ displayKey: '/wxlb',
8966
+ icon: 'list-bullet',
8967
+ menuIcon: PluginMenuIcons.bulletedList
8968
+ }
8969
+ ],
8473
8970
  options: listOptions
8474
8971
  });
8475
8972
 
@@ -9071,198 +9568,443 @@ const createPaintFormatPlugin = createPluginFactory({
9071
9568
  ]
9072
9569
  });
9073
9570
 
9074
- class TheQuickToolbarComponent extends mixinUnsubscribe(MixinBase) {
9075
- constructor(elementRef, cdr) {
9571
+ class TheBaseSuggestion {
9572
+ handleMousedown(event) {
9573
+ event.preventDefault();
9574
+ }
9575
+ }
9576
+ TheBaseSuggestion.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheBaseSuggestion, deps: [], target: i0.ɵɵFactoryTarget.Directive });
9577
+ TheBaseSuggestion.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: TheBaseSuggestion, inputs: { editor: "editor", type: "type", keywords: "keywords" }, host: { listeners: { "mousedown": "handleMousedown($event)" } }, ngImport: i0 });
9578
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheBaseSuggestion, decorators: [{
9579
+ type: Directive
9580
+ }], propDecorators: { editor: [{
9581
+ type: Input
9582
+ }], type: [{
9583
+ type: Input
9584
+ }], keywords: [{
9585
+ type: Input
9586
+ }], handleMousedown: [{
9587
+ type: HostListener,
9588
+ args: ['mousedown', ['$event']]
9589
+ }] } });
9590
+
9591
+ class TheVerticalToolbarItemComponent extends TheBaseToolbarDropdown {
9592
+ constructor(elementRef, thyPopover, viewContainerRef) {
9076
9593
  super();
9077
9594
  this.elementRef = elementRef;
9078
- this.cdr = cdr;
9079
- this.ToolbarItemMode = ToolbarItemMode;
9080
- this.ToolbarActionTypes = ToolbarActionTypes;
9595
+ this.thyPopover = thyPopover;
9596
+ this.viewContainerRef = viewContainerRef;
9597
+ this.isHide = true;
9081
9598
  }
9082
- handleMouseDown(event) {
9599
+ get isOpened() {
9600
+ return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
9601
+ }
9602
+ handleDocumentMouseDown(event) {
9083
9603
  if (!this.elementRef.nativeElement.contains(event.target)) {
9084
- QuickInsertEditor.closeQuickInsertToolbar(this.editor);
9085
- }
9086
- else {
9087
- event.preventDefault();
9604
+ this.close();
9088
9605
  }
9089
9606
  }
9090
- handleEnter() {
9091
- QuickInsertEditor.closeQuickInsertToolbar(this.editor);
9092
- }
9093
- handleEsc() {
9094
- QuickInsertEditor.closeQuickInsertToolbar(this.editor);
9607
+ ngOnInit() { }
9608
+ menusActive(editor) {
9609
+ return this.menus.find(i => {
9610
+ var _a;
9611
+ if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.selection) && (i === null || i === void 0 ? void 0 : i.active)) {
9612
+ return i === null || i === void 0 ? void 0 : i.active(editor);
9613
+ }
9614
+ });
9095
9615
  }
9096
- ngOnInit() {
9097
- this.editorElement = AngularEditor.toDOMNode(this.editor, this.editor);
9616
+ execute(event) {
9617
+ var _a, _b;
9618
+ super.execute(event);
9619
+ if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.readOnly) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
9620
+ return;
9621
+ }
9622
+ this.openPopover();
9098
9623
  }
9099
- stopPropagation(event) {
9624
+ itemMousedown(event, item) {
9100
9625
  event.preventDefault();
9101
- }
9102
- selectionChange(event) {
9103
- this.removeHotKey();
9104
- const toolbarItem = this.quickToolbarItems.find(item => item.key === event.value);
9105
- if (toolbarItem === null || toolbarItem === void 0 ? void 0 : toolbarItem.execute) {
9106
- toolbarItem.execute(this.editor);
9626
+ event.stopPropagation();
9627
+ this.close();
9628
+ if (item === null || item === void 0 ? void 0 : item.execute) {
9629
+ item === null || item === void 0 ? void 0 : item.execute(this.editor);
9107
9630
  }
9108
9631
  }
9109
- removeHotKey() {
9632
+ openPopover() {
9110
9633
  var _a;
9111
- const hotkey = (_a = getPluginOptions(this.editor, PluginKeys.quickInsert)) === null || _a === void 0 ? void 0 : _a.hotkey;
9112
- const node = Node.get(this.editor, this.editor.selection.anchor.path);
9113
- if (node && hotkey === node.text) {
9114
- Editor.deleteBackward(this.editor);
9115
- }
9634
+ this.dropdownPopoverRef = this.thyPopover.open(this.template, {
9635
+ origin: this.elementRef,
9636
+ panelClass: ['the-toolbar-dropdown-popover', (_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key],
9637
+ placement: 'bottomLeft',
9638
+ offset: 10,
9639
+ minWidth: 0,
9640
+ viewContainerRef: this.viewContainerRef,
9641
+ insideClosable: false,
9642
+ backdropClosable: false,
9643
+ hasBackdrop: false
9644
+ });
9116
9645
  }
9117
- ngOnDestroy() {
9118
- super.ngOnDestroy();
9646
+ close() {
9647
+ if (this.dropdownPopoverRef) {
9648
+ this.dropdownPopoverRef.close();
9649
+ }
9119
9650
  }
9120
9651
  }
9121
- TheQuickToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheQuickToolbarComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
9122
- TheQuickToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheQuickToolbarComponent, selector: "the-quick-toolbar", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "document: mousedown": "handleMouseDown($event)", "document: keydown.enter": "handleEnter()", "document: keydown.escape": "handleEsc()" } }, usesInheritance: true, ngImport: i0, 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\" [toolbarItem]=\"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 <thy-divider class=\"my-1 mx-5\"></thy-divider>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$3.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { kind: "component", type: i4$1.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { kind: "component", type: i12.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "component", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["itemMode"] }] });
9123
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheQuickToolbarComponent, decorators: [{
9652
+ TheVerticalToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheVerticalToolbarItemComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
9653
+ TheVerticalToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", 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: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: "<a\n href=\"javascript:;\"\n class=\"icon-mode link-with-down\"\n thyAction\n [thyActionIcon]=\"activeMenuItem?.icon\"\n [thyActionActive]=\"isOpened\"\n [thyTooltip]=\"toolbarItem?.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n href=\"javascript:;\"\n thyDropdownMenuItem\n [thyDropdownMenuItemActive]=\"menu.key === activeMenuItem?.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <thy-icon *ngIf=\"menu.icon\" thyDropdownMenuItemIcon [thyIconName]=\"menu?.icon\"></thy-icon>\n <span thyDropdownMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "directive", type: i6.ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "directive", type: i6.ThyDropdownMenuItemNameDirective, selector: "[thyDropdownMenuItemName]" }, { kind: "directive", type: i6.ThyDropdownMenuItemIconDirective, selector: "[thyDropdownMenuItemIcon]" }, { kind: "directive", type: i6.ThyDropdownMenuItemActiveDirective, selector: "[thyDropdownMenuItemActive]", inputs: ["thyDropdownMenuItemActive"] }] });
9654
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheVerticalToolbarItemComponent, decorators: [{
9124
9655
  type: Component,
9125
- args: [{ selector: 'the-quick-toolbar', 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\" [toolbarItem]=\"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 <thy-divider class=\"my-1 mx-5\"></thy-divider>\n</ng-template>\n" }]
9126
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { editor: [{
9127
- type: Input
9128
- }], quickToolbarItems: [{
9129
- type: Input
9130
- }], handleMouseDown: [{
9656
+ args: [{ selector: 'the-toolbar-vertical-align-item', host: {
9657
+ class: 'the-toolbar-dropdown-container verticalAlign',
9658
+ '[class.hide]': '!active'
9659
+ }, template: "<a\n href=\"javascript:;\"\n class=\"icon-mode link-with-down\"\n thyAction\n [thyActionIcon]=\"activeMenuItem?.icon\"\n [thyActionActive]=\"isOpened\"\n [thyTooltip]=\"toolbarItem?.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n href=\"javascript:;\"\n thyDropdownMenuItem\n [thyDropdownMenuItemActive]=\"menu.key === activeMenuItem?.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <thy-icon *ngIf=\"menu.icon\" thyDropdownMenuItemIcon [thyIconName]=\"menu?.icon\"></thy-icon>\n <span thyDropdownMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </div>\n</ng-template>\n" }]
9660
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThyPopover }, { type: i0.ViewContainerRef }]; }, propDecorators: { template: [{
9661
+ type: ViewChild,
9662
+ args: ['VerticalAlignItems', { read: TemplateRef, static: true }]
9663
+ }], handleDocumentMouseDown: [{
9131
9664
  type: HostListener,
9132
9665
  args: ['document: mousedown', ['$event']]
9133
- }], handleEnter: [{
9134
- type: HostListener,
9135
- args: ['document: keydown.enter']
9136
- }], handleEsc: [{
9137
- type: HostListener,
9138
- args: ['document: keydown.escape']
9139
9666
  }] } });
9140
9667
 
9141
- const QuickInsertEditor = {
9142
- openQuickInsertToolbar(editor, quickToolbarItems, origin) {
9143
- if (QuickInsertEditor.isOpenedToolbar(editor)) {
9144
- return;
9145
- }
9146
- if (!origin) {
9147
- const [block] = getBlockAbove(editor);
9148
- const rootNode = AngularEditor.toDOMNode(editor, block);
9149
- origin = rootNode.querySelector('[data-slate-leaf="true"]');
9150
- }
9151
- const overlay = editor.injector.get(Overlay);
9152
- const viewContainerRef = editor.injector.get(ViewContainerRef);
9153
- const thyPopover = editor.injector.get(ThyPopover);
9154
- const quickToolbarRef = thyPopover.open(TheQuickToolbarComponent, {
9155
- initialState: {
9156
- editor,
9157
- quickToolbarItems
9158
- },
9159
- origin,
9160
- viewContainerRef: viewContainerRef,
9161
- backdropClosable: true,
9162
- placement: 'bottomLeft',
9163
- offset: 4,
9164
- hasBackdrop: false,
9165
- insideClosable: true,
9166
- minWidth: 0,
9167
- panelClass: 'the-quick-toolbar-container',
9168
- scrollStrategy: overlay.scrollStrategies.reposition(),
9169
- manualClosure: true
9170
- });
9171
- quickToolbarRef.componentInstance.cdr.markForCheck();
9172
- THE_EDITOR_QUICK_TOOLBAR_REF.set(editor, quickToolbarRef);
9173
- },
9174
- closeQuickInsertToolbar(editor) {
9175
- const quickToolbarRef = THE_EDITOR_QUICK_TOOLBAR_REF.get(editor);
9176
- if (quickToolbarRef) {
9177
- quickToolbarRef.close();
9178
- THE_EDITOR_QUICK_TOOLBAR_REF.set(editor, null);
9668
+ const VerticalAlignEditor = {
9669
+ isVerticalActive(editor, alignment) {
9670
+ const tableCellAlign = TableEditor.isVerticalAlignActive(editor, alignment);
9671
+ if (tableCellAlign !== null) {
9672
+ return tableCellAlign;
9179
9673
  }
9674
+ return false;
9180
9675
  },
9181
- isOpenedToolbar(editor) {
9182
- const quickToolbarRef = THE_EDITOR_QUICK_TOOLBAR_REF.get(editor);
9183
- return !!quickToolbarRef;
9184
- }
9185
- };
9186
-
9187
- const withQuickInsert = (editor) => {
9188
- const { onKeydown, deleteBackward, onChange } = editor;
9189
- let pressingQuickInsertHotkey = false;
9190
- editor.onKeydown = (event) => {
9191
- const options = getPluginOptions(editor, PluginKeys.quickInsert);
9192
- const { hotkey, allowHotkeyInTypes } = options;
9193
- if (event.key === hotkey) {
9194
- const types = [...(allowHotkeyInTypes || [])];
9195
- const [block] = getBlockAbove(editor);
9196
- if (isPureEmptyParagraph(editor, block) && allowOpenQuickToolbar(editor, types)) {
9197
- pressingQuickInsertHotkey = true;
9198
- }
9199
- }
9200
- const quickToolbarRef = THE_EDITOR_QUICK_TOOLBAR_REF.get(editor);
9201
- const isMoveUp = hotkeys.isMoveUp(event);
9202
- const isMoveDown = hotkeys.isMoveDown(event);
9203
- if (quickToolbarRef && (isMoveUp || isMoveDown)) {
9676
+ setVerticalAlign(editor, alignment) {
9677
+ if (TableEditor.setVerticalAlign(editor, alignment)) {
9204
9678
  return;
9205
9679
  }
9206
- onKeydown(event);
9207
- };
9208
- editor.deleteBackward = unit => {
9209
- if (QuickInsertEditor.isOpenedToolbar(editor)) {
9210
- QuickInsertEditor.closeQuickInsertToolbar(editor);
9211
- }
9212
- deleteBackward(unit);
9213
- };
9214
- editor.onChange = () => {
9215
- var _a, _b;
9216
- onChange();
9217
- if (editor.selection) {
9218
- const hotkey = (_a = getPluginOptions(editor, PluginKeys.quickInsert)) === null || _a === void 0 ? void 0 : _a.hotkey;
9219
- const [block] = getBlockAbove(editor);
9220
- // quick insert plus
9221
- const editorComponent = editor.injector.get(TheEditorComponent);
9222
- (_b = editorComponent.quickInsertInstance) === null || _b === void 0 ? void 0 : _b.checkStatus();
9223
- if (pressingQuickInsertHotkey && Node.string(block) === hotkey) {
9224
- QuickInsertEditor.openQuickInsertToolbar(editor, editorComponent.quickToolbarItems);
9225
- pressingQuickInsertHotkey = false;
9226
- return;
9227
- }
9228
- else {
9229
- pressingQuickInsertHotkey = false;
9230
- }
9231
- if (QuickInsertEditor.isOpenedToolbar(editor) && !isPureEmptyParagraph(editor, block) && Node.string(block) !== hotkey) {
9232
- QuickInsertEditor.closeQuickInsertToolbar(editor);
9233
- }
9234
- }
9235
- };
9236
- return editor;
9237
- };
9238
- const createQuickInsertPlugin = createPluginFactory({
9239
- key: PluginKeys.quickInsert,
9240
- withOverrides: withQuickInsert,
9241
- options: {
9242
- hotkey: '/',
9243
- disabledPlus: true
9244
- }
9245
- });
9246
- const allowOpenQuickToolbar = (editor, allowTypes) => {
9247
- const [, path] = getBlockAbove(editor);
9248
- const parentNode = Node.parent(editor, path);
9249
- if (path.length === 1 || (parentNode && allowTypes.includes(parentNode.type))) {
9250
- return true;
9251
9680
  }
9252
- return false;
9253
9681
  };
9254
-
9255
- const withSoftBreak = (editor) => {
9256
- var _a, _b;
9257
- const { onKeydown } = editor;
9258
- const rules = (_b = (_a = getPluginOptions(editor, PluginKeys.softBreak)) === null || _a === void 0 ? void 0 : _a.rules) !== null && _b !== void 0 ? _b : [];
9259
- editor.onKeydown = (event) => {
9260
- const entry = getBlockAbove(editor);
9261
- rules.forEach(({ hotkey, query }) => {
9262
- if (isKeyHotkey(hotkey, event) && isNodeType(entry, query)) {
9263
- event.preventDefault();
9264
- editor.insertText('\n');
9265
- }
9682
+ const createVerticalAlignPlugin = createPluginFactory({
9683
+ key: PluginKeys.verticalAlign,
9684
+ toolbarItems: [
9685
+ {
9686
+ key: ToolbarActionTypes.verticalAlign,
9687
+ name: '垂直对齐',
9688
+ type: ToolbarItemType.dropdown,
9689
+ dropdownMode: DropdownMode.icon,
9690
+ iconComponent: TheVerticalToolbarItemComponent,
9691
+ includes: [ToolbarActionTypes.verticalAlignTop, ToolbarActionTypes.verticalAlignMiddle, ToolbarActionTypes.verticalAlignBottom],
9692
+ active: editor => TableEditor.isActive(editor)
9693
+ },
9694
+ {
9695
+ key: ToolbarActionTypes.verticalAlignTop,
9696
+ icon: 'align-top',
9697
+ name: '顶部对齐',
9698
+ execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.top),
9699
+ active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.top)
9700
+ },
9701
+ {
9702
+ key: ToolbarActionTypes.verticalAlignMiddle,
9703
+ icon: 'align-middle',
9704
+ name: '垂直居中',
9705
+ execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.middle),
9706
+ active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.middle)
9707
+ },
9708
+ {
9709
+ key: ToolbarActionTypes.verticalAlignBottom,
9710
+ icon: 'align-bottom',
9711
+ name: '底部对齐',
9712
+ execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.bottom),
9713
+ active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.bottom)
9714
+ }
9715
+ ]
9716
+ });
9717
+
9718
+ class TheTableSelectComponent {
9719
+ constructor(popoverRef) {
9720
+ this.popoverRef = popoverRef;
9721
+ this.beforeInsert = () => { };
9722
+ this.tableData = new Array(10);
9723
+ this.maxRowIndex = -1;
9724
+ this.maxColIndex = -1;
9725
+ }
9726
+ ngOnInit() { }
9727
+ onSelectCells(rowIndex, colIndex) {
9728
+ this.maxRowIndex = rowIndex;
9729
+ this.maxColIndex = colIndex;
9730
+ }
9731
+ executeTable(event) {
9732
+ event.preventDefault();
9733
+ event.stopPropagation();
9734
+ this.beforeInsert();
9735
+ const opts = new TableOptions(this.optionsParam);
9736
+ insertTable(opts, this.editor, this.maxRowIndex + 1, this.maxColIndex + 1);
9737
+ if (this.popoverRef) {
9738
+ this.popoverRef.close();
9739
+ this.maxColIndex = -1;
9740
+ this.maxRowIndex = -1;
9741
+ }
9742
+ }
9743
+ }
9744
+ TheTableSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheTableSelectComponent, deps: [{ token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
9745
+ TheTableSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheTableSelectComponent, selector: "table-select", inputs: { optionsParam: "optionsParam", editor: "editor", beforeInsert: "beforeInsert" }, ngImport: i0, template: "<div class=\"table-selector-container\">\n <div *ngFor=\"let item of tableData; let rowIndex = index\" class=\"selector-row\" (mousedown)=\"executeTable($event)\">\n <span\n *ngFor=\"let item of tableData; let colIndex = index\"\n [ngClass]=\"{ 'active-cell': rowIndex <= maxRowIndex && colIndex <= maxColIndex, 'selector-cell': true }\"\n (mouseenter)=\"onSelectCells(rowIndex, colIndex)\"\n >\n </span>\n </div>\n <span class=\"selector-text\">{{ maxRowIndex + 1 }} x {{ maxColIndex + 1 }}</span>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
9746
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheTableSelectComponent, decorators: [{
9747
+ type: Component,
9748
+ args: [{ selector: 'table-select', template: "<div class=\"table-selector-container\">\n <div *ngFor=\"let item of tableData; let rowIndex = index\" class=\"selector-row\" (mousedown)=\"executeTable($event)\">\n <span\n *ngFor=\"let item of tableData; let colIndex = index\"\n [ngClass]=\"{ 'active-cell': rowIndex <= maxRowIndex && colIndex <= maxColIndex, 'selector-cell': true }\"\n (mouseenter)=\"onSelectCells(rowIndex, colIndex)\"\n >\n </span>\n </div>\n <span class=\"selector-text\">{{ maxRowIndex + 1 }} x {{ maxColIndex + 1 }}</span>\n</div>\n" }]
9749
+ }], ctorParameters: function () { return [{ type: i1$1.ThyPopoverRef }]; }, propDecorators: { optionsParam: [{
9750
+ type: Input
9751
+ }], editor: [{
9752
+ type: Input
9753
+ }], beforeInsert: [{
9754
+ type: Input
9755
+ }] } });
9756
+
9757
+ class ThePluginMenuComponent extends mixinUnsubscribe(MixinBase) {
9758
+ constructor(elementRef, cdr) {
9759
+ super();
9760
+ this.elementRef = elementRef;
9761
+ this.cdr = cdr;
9762
+ this.ThePluginMenu = ThePluginMenu;
9763
+ this.groupMenu = [];
9764
+ this.iconMenu = [];
9765
+ this.ThePluginMenuItemType = ThePluginMenuItemType;
9766
+ this.thyMessage = '暂无数据';
9767
+ this.searchGroup = {
9768
+ groupName: '搜索结果'
9769
+ };
9770
+ this.expandPopoverOptions = {
9771
+ placement: 'rightTop',
9772
+ width: '266px'
9773
+ };
9774
+ this.containerClassName = `the-plugin-menu-container`;
9775
+ this.removeKeywords = () => {
9776
+ var _a;
9777
+ const hotkey = (_a = getPluginOptions(this.editor, PluginKeys.quickInsert)) === null || _a === void 0 ? void 0 : _a.hotkey;
9778
+ const node = Node.get(this.editor, this.editor.selection.anchor.path);
9779
+ if (node && node.text.includes(hotkey)) {
9780
+ Editor.deleteBackward(this.editor, { unit: 'block' });
9781
+ }
9782
+ };
9783
+ }
9784
+ ngOnInit() {
9785
+ this.editorElement = AngularEditor.toDOMNode(this.editor, this.editor);
9786
+ let currentMenu = this.editor.options.menu ? this.editor.options.menu : DefaultPluginMenu;
9787
+ const menuItemsMap = buildPluginMenuItemMap(this.editor);
9788
+ this.pluginMenu = buildPluginMenu(menuItemsMap, currentMenu);
9789
+ this.buildMenus();
9790
+ }
9791
+ buildMenus() {
9792
+ if (this.keyWords) {
9793
+ this.iconMenu = [];
9794
+ this.groupMenu = this.pluginMenu.filter((item) => {
9795
+ return (item === null || item === void 0 ? void 0 : item.keywords) && (item === null || item === void 0 ? void 0 : item.keywords.includes(this.keyWords));
9796
+ });
9797
+ if (this.groupMenu.length > 0) {
9798
+ this.groupMenu.unshift(this.searchGroup);
9799
+ }
9800
+ }
9801
+ else {
9802
+ this.iconMenu = this.pluginMenu.filter((item) => {
9803
+ return (item === null || item === void 0 ? void 0 : item.type) === ThePluginMenuItemType.icon;
9804
+ });
9805
+ this.groupMenu = this.pluginMenu.filter((item) => {
9806
+ return (item === null || item === void 0 ? void 0 : item.type) !== ThePluginMenuItemType.icon;
9807
+ });
9808
+ }
9809
+ this.cdr.detectChanges();
9810
+ }
9811
+ executeItem(event, menuItem) {
9812
+ event.preventDefault();
9813
+ event.stopPropagation();
9814
+ this.removeKeywords();
9815
+ const toolbarItem = this.pluginMenu.find((item) => item.key === menuItem.key);
9816
+ if (toolbarItem.execute) {
9817
+ toolbarItem.execute(this.editor);
9818
+ }
9819
+ QuickInsertEditor.closeMenu(this.editor);
9820
+ }
9821
+ updateKeywords(keywords) {
9822
+ this.keyWords = keywords.toLowerCase().trim();
9823
+ this.buildMenus();
9824
+ }
9825
+ ngOnDestroy() {
9826
+ super.ngOnDestroy();
9827
+ }
9828
+ }
9829
+ ThePluginMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ThePluginMenuComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
9830
+ ThePluginMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: ThePluginMenuComponent, selector: "the-plugin-menu", inputs: { editor: "editor" }, host: { properties: { "class": "this.containerClassName" } }, usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"groupMenu.length > 0; else thyEmpty\" class=\"thy-dropdown-menu py-2\">\n <div class=\"icon-menu d-flex px-5 py-1\">\n <ng-container *ngFor=\"let item of iconMenu\">\n <a\n *ngIf=\"item.type === ThePluginMenuItemType.icon\"\n href=\"javascript:;\"\n class=\"mt-2\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n (mousedown)=\"executeItem($event, item)\"\n ></a>\n </ng-container>\n </div>\n\n <thy-divider *ngIf=\"this.iconMenu?.length\" class=\"my-2\"></thy-divider>\n\n <ng-container *ngFor=\"let item of groupMenu\">\n <ng-container *ngIf=\"ThePluginMenu.isMenuItem(item) && !item.isExpanded\">\n <div thyDropdownMenuItem class=\"insert-menu-item mb-1 py-0\" (mousedown)=\"executeItem($event, item)\">\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n <span *ngIf=\"!item?.isExpanded\" class=\"menu-item-display-key font-size-sm text-placeholder\">\n {{ item.displayKey }}</span\n >\n {{ item.name }}\n </div>\n <div class=\"text-muted font-size-sm\">{{ item.description }}</div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"ThePluginMenu.isMenuItem(item) && item.isExpanded\" #hasExpanded>\n <div\n [thyDropdown]=\"expand\"\n thyTrigger=\"hover\"\n thyDropdownMenuItem\n [thyPopoverOptions]=\"expandPopoverOptions\"\n class=\"insert-menu-item mb-1 py-0\"\n (mousedown)=\"executeItem($event, item)\"\n >\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n <span *ngIf=\"!item?.isExpanded\" class=\"menu-item-display-key font-size-sm text-placeholder\">\n {{ item.displayKey }}</span\n >\n {{ item.name }}\n </div>\n <div class=\"text-muted font-size-sm\">{{ item.description }}</div>\n </div>\n <div *ngIf=\"item?.isExpanded\">\n <thy-icon class=\"text-muted\" thyIconName=\"angle-right\"></thy-icon>\n </div>\n </div>\n <thy-dropdown-menu class=\"expand-menu\" #expand>\n <div class=\"the-plugin-menu-container\">\n <div *ngFor=\"let child of item.children\" thyDropdownMenuItem class=\"insert-menu-item mb-1 py-0\">\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"child.menuIcon\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n <span class=\"menu-item-display-key font-size-sm text-placeholder\"> {{ child.displayKey }}</span>\n {{ child.name }}\n </div>\n <div class=\"text-muted font-size-sm\">{{ child.description }}</div>\n </div>\n </div>\n </div>\n <table-select\n *ngIf=\"item.key === 'table'\"\n class=\"plugin-menu-table the-table-selector-panel\"\n [editor]=\"editor\"\n [beforeInsert]=\"removeKeywords\"\n ></table-select>\n </thy-dropdown-menu>\n </ng-container>\n\n <ng-container *ngIf=\"!ThePluginMenu.isMenuItem(item)\" #menuGroup>\n <thy-dropdown-menu-group class=\"font-size-sm\" [thyTitle]=\"item.groupName\"></thy-dropdown-menu-group>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #thyEmpty>\n <div class=\"empty d-flex align-items-center justify-content-center\">\n <thy-empty [thyMessage]=\"thyMessage\"></thy-empty>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i12.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "directive", type: i6.ThyDropdownDirective, selector: "[thyDropdown]", inputs: ["thyDropdownMenu", "thyDropdown", "thyTrigger", "thyActiveClass", "thyPopoverOptions"], outputs: ["thyActiveChange"] }, { kind: "component", type: i6.ThyDropdownMenuComponent, selector: "thy-dropdown-menu", inputs: ["thyWidth"] }, { kind: "component", type: i6.ThyDropdownMenuGroupComponent, selector: "thy-dropdown-menu-group", inputs: ["thyTitle"] }, { kind: "directive", type: i6.ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "component", type: i7.ThyEmptyComponent, selector: "thy-empty", inputs: ["thyMessage", "thyTranslationKey", "thyTranslationValues", "thyEntityName", "thyEntityNameTranslateKey", "thyIconName", "thySize", "thyMarginTop", "thyTopAuto", "thyContainer", "thyImageUrl", "thyImageLoading", "thyImageFetchPriority", "thyDescription"] }, { kind: "component", type: TheTableSelectComponent, selector: "table-select", inputs: ["optionsParam", "editor", "beforeInsert"] }] });
9831
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ThePluginMenuComponent, decorators: [{
9832
+ type: Component,
9833
+ args: [{ selector: 'the-plugin-menu', template: "<div *ngIf=\"groupMenu.length > 0; else thyEmpty\" class=\"thy-dropdown-menu py-2\">\n <div class=\"icon-menu d-flex px-5 py-1\">\n <ng-container *ngFor=\"let item of iconMenu\">\n <a\n *ngIf=\"item.type === ThePluginMenuItemType.icon\"\n href=\"javascript:;\"\n class=\"mt-2\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n (mousedown)=\"executeItem($event, item)\"\n ></a>\n </ng-container>\n </div>\n\n <thy-divider *ngIf=\"this.iconMenu?.length\" class=\"my-2\"></thy-divider>\n\n <ng-container *ngFor=\"let item of groupMenu\">\n <ng-container *ngIf=\"ThePluginMenu.isMenuItem(item) && !item.isExpanded\">\n <div thyDropdownMenuItem class=\"insert-menu-item mb-1 py-0\" (mousedown)=\"executeItem($event, item)\">\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n <span *ngIf=\"!item?.isExpanded\" class=\"menu-item-display-key font-size-sm text-placeholder\">\n {{ item.displayKey }}</span\n >\n {{ item.name }}\n </div>\n <div class=\"text-muted font-size-sm\">{{ item.description }}</div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"ThePluginMenu.isMenuItem(item) && item.isExpanded\" #hasExpanded>\n <div\n [thyDropdown]=\"expand\"\n thyTrigger=\"hover\"\n thyDropdownMenuItem\n [thyPopoverOptions]=\"expandPopoverOptions\"\n class=\"insert-menu-item mb-1 py-0\"\n (mousedown)=\"executeItem($event, item)\"\n >\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n <span *ngIf=\"!item?.isExpanded\" class=\"menu-item-display-key font-size-sm text-placeholder\">\n {{ item.displayKey }}</span\n >\n {{ item.name }}\n </div>\n <div class=\"text-muted font-size-sm\">{{ item.description }}</div>\n </div>\n <div *ngIf=\"item?.isExpanded\">\n <thy-icon class=\"text-muted\" thyIconName=\"angle-right\"></thy-icon>\n </div>\n </div>\n <thy-dropdown-menu class=\"expand-menu\" #expand>\n <div class=\"the-plugin-menu-container\">\n <div *ngFor=\"let child of item.children\" thyDropdownMenuItem class=\"insert-menu-item mb-1 py-0\">\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"child.menuIcon\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n <span class=\"menu-item-display-key font-size-sm text-placeholder\"> {{ child.displayKey }}</span>\n {{ child.name }}\n </div>\n <div class=\"text-muted font-size-sm\">{{ child.description }}</div>\n </div>\n </div>\n </div>\n <table-select\n *ngIf=\"item.key === 'table'\"\n class=\"plugin-menu-table the-table-selector-panel\"\n [editor]=\"editor\"\n [beforeInsert]=\"removeKeywords\"\n ></table-select>\n </thy-dropdown-menu>\n </ng-container>\n\n <ng-container *ngIf=\"!ThePluginMenu.isMenuItem(item)\" #menuGroup>\n <thy-dropdown-menu-group class=\"font-size-sm\" [thyTitle]=\"item.groupName\"></thy-dropdown-menu-group>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #thyEmpty>\n <div class=\"empty d-flex align-items-center justify-content-center\">\n <thy-empty [thyMessage]=\"thyMessage\"></thy-empty>\n </div>\n</ng-template>\n" }]
9834
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { containerClassName: [{
9835
+ type: HostBinding,
9836
+ args: ['class']
9837
+ }], editor: [{
9838
+ type: Input
9839
+ }] } });
9840
+
9841
+ const QuickInsertEditor = {
9842
+ openMenu(editor) {
9843
+ if (QuickInsertEditor.isOpenedMenu(editor)) {
9844
+ return;
9845
+ }
9846
+ const [block] = getBlockAbove(editor);
9847
+ const rootNode = AngularEditor.toDOMNode(editor, block);
9848
+ const origin = rootNode.querySelector('[data-slate-leaf="true"]');
9849
+ const overlay = editor.injector.get(Overlay);
9850
+ const viewContainerRef = editor.injector.get(ViewContainerRef);
9851
+ const thyPopover = editor.injector.get(ThyPopover);
9852
+ const pluginMenuRef = thyPopover.open(ThePluginMenuComponent, {
9853
+ initialState: {
9854
+ editor
9855
+ },
9856
+ origin,
9857
+ viewContainerRef: viewContainerRef,
9858
+ backdropClosable: true,
9859
+ placement: 'bottomLeft',
9860
+ offset: 4,
9861
+ hasBackdrop: false,
9862
+ insideClosable: true,
9863
+ outsideClosable: true,
9864
+ manualClosure: true,
9865
+ minWidth: 0,
9866
+ scrollStrategy: overlay.scrollStrategies.reposition()
9867
+ });
9868
+ QuickInsertEditor.updatePluginMenuRef(editor, pluginMenuRef);
9869
+ pluginMenuRef.afterClosed().subscribe(() => {
9870
+ QuickInsertEditor.updatePluginMenuRef(editor, null);
9871
+ });
9872
+ pluginMenuRef.componentInstance.cdr.markForCheck();
9873
+ return pluginMenuRef;
9874
+ },
9875
+ updateKeywords(editor, keywords) {
9876
+ const pluginMenuRef = THE_PLUGIN_MENU_REF.get(editor);
9877
+ if (pluginMenuRef) {
9878
+ pluginMenuRef.componentInstance.updateKeywords(keywords);
9879
+ }
9880
+ },
9881
+ updatePluginMenuRef(editor, pluginMenuRef) {
9882
+ if (pluginMenuRef) {
9883
+ THE_PLUGIN_MENU_REF.set(editor, pluginMenuRef);
9884
+ }
9885
+ else {
9886
+ THE_PLUGIN_MENU_REF.set(editor, null);
9887
+ }
9888
+ },
9889
+ closeMenu(editor) {
9890
+ const pluginMenuRef = THE_PLUGIN_MENU_REF.get(editor);
9891
+ if (pluginMenuRef) {
9892
+ pluginMenuRef.close();
9893
+ QuickInsertEditor.updatePluginMenuRef(editor, null);
9894
+ }
9895
+ },
9896
+ isOpenedMenu(editor) {
9897
+ const pluginMenuRef = THE_PLUGIN_MENU_REF.get(editor);
9898
+ return !!pluginMenuRef;
9899
+ }
9900
+ };
9901
+
9902
+ const withQuickInsert = (editor) => {
9903
+ const { onKeydown, onChange, insertText, insertBreak, deleteBackward } = editor;
9904
+ let openMenuFromHotkey = false;
9905
+ editor.onKeydown = (event) => {
9906
+ const isOpenMenu = QuickInsertEditor.isOpenedMenu(editor);
9907
+ const isMoveUp = hotkeys.isMoveUp(event);
9908
+ const isMoveDown = hotkeys.isMoveDown(event);
9909
+ const isMoveForward = hotkeys.isMoveForward(event);
9910
+ const isMoveBackward = hotkeys.isMoveBackward(event);
9911
+ // 阻止方向键默认行为
9912
+ if (isOpenMenu && (isMoveUp || isMoveDown || isMoveForward || isMoveBackward)) {
9913
+ event.preventDefault();
9914
+ return;
9915
+ }
9916
+ onKeydown(event);
9917
+ };
9918
+ editor.insertText = (text) => {
9919
+ const options = getPluginOptions(editor, PluginKeys.quickInsert);
9920
+ const [block] = getBlockAbove(editor);
9921
+ const { hotkey, allowHotkeyInTypes } = options;
9922
+ // 基于插入内容对比,避免 keydown 判断时无法区分中文「、」和英文「/」热键
9923
+ if (text === hotkey) {
9924
+ const types = [...(allowHotkeyInTypes || [])];
9925
+ if (isPureEmptyParagraph(editor, block) && allowOpenInsertMenu(editor, types)) {
9926
+ openMenuFromHotkey = true;
9927
+ QuickInsertEditor.openMenu(editor);
9928
+ }
9929
+ }
9930
+ insertText(text);
9931
+ };
9932
+ editor.onChange = () => {
9933
+ onChange();
9934
+ if (editor.selection) {
9935
+ const [block] = getBlockAbove(editor);
9936
+ const isOpenMenu = QuickInsertEditor.isOpenedMenu(editor);
9937
+ if (openMenuFromHotkey && !isOpenMenu) {
9938
+ openMenuFromHotkey = false;
9939
+ }
9940
+ if (isOpenMenu) {
9941
+ if (!Range.isCollapsed(editor.selection)) {
9942
+ QuickInsertEditor.closeMenu(editor);
9943
+ return;
9944
+ }
9945
+ // 更新搜索
9946
+ const options = getPluginOptions(editor, PluginKeys.quickInsert);
9947
+ const { hotkey } = options;
9948
+ const keywords = Node.string(block);
9949
+ const filterKeywords = openMenuFromHotkey && keywords.startsWith(hotkey) ? keywords.substring(1) : keywords;
9950
+ QuickInsertEditor.updateKeywords(editor, filterKeywords);
9951
+ }
9952
+ }
9953
+ };
9954
+ // 拦截行为处理菜单的关闭(避免协同编辑出现异常)
9955
+ editor.deleteBackward = unit => {
9956
+ const isOpenMenu = QuickInsertEditor.isOpenedMenu(editor);
9957
+ if (isOpenMenu) {
9958
+ const [block] = getBlockAbove(editor);
9959
+ const options = getPluginOptions(editor, PluginKeys.quickInsert);
9960
+ const { hotkey } = options;
9961
+ if (isPureEmptyParagraph(editor, block)) {
9962
+ QuickInsertEditor.closeMenu(editor);
9963
+ }
9964
+ else if (openMenuFromHotkey && Node.string(block) === hotkey) {
9965
+ QuickInsertEditor.closeMenu(editor);
9966
+ }
9967
+ }
9968
+ deleteBackward(unit);
9969
+ };
9970
+ // 拦截行为处理菜单的关闭(避免协同编辑出现异常)
9971
+ editor.insertBreak = () => {
9972
+ const isOpenMenu = QuickInsertEditor.isOpenedMenu(editor);
9973
+ if (isOpenMenu) {
9974
+ QuickInsertEditor.closeMenu(editor);
9975
+ }
9976
+ insertBreak();
9977
+ };
9978
+ return editor;
9979
+ };
9980
+ const createQuickInsertPlugin = createPluginFactory({
9981
+ key: PluginKeys.quickInsert,
9982
+ withOverrides: withQuickInsert,
9983
+ options: {
9984
+ hotkey: '/',
9985
+ disabledPlus: true
9986
+ }
9987
+ });
9988
+ const allowOpenInsertMenu = (editor, allowTypes) => {
9989
+ const [, path] = getBlockAbove(editor);
9990
+ const parentNode = Node.parent(editor, path);
9991
+ if (path.length === 1 || (parentNode && allowTypes.includes(parentNode.type))) {
9992
+ return true;
9993
+ }
9994
+ return false;
9995
+ };
9996
+
9997
+ const withSoftBreak = (editor) => {
9998
+ var _a, _b;
9999
+ const { onKeydown } = editor;
10000
+ const rules = (_b = (_a = getPluginOptions(editor, PluginKeys.softBreak)) === null || _a === void 0 ? void 0 : _a.rules) !== null && _b !== void 0 ? _b : [];
10001
+ editor.onKeydown = (event) => {
10002
+ const entry = getBlockAbove(editor);
10003
+ rules.forEach(({ hotkey, query }) => {
10004
+ if (isKeyHotkey(hotkey, event) && isNodeType(entry, query)) {
10005
+ event.preventDefault();
10006
+ editor.insertText('\n');
10007
+ }
9266
10008
  });
9267
10009
  onKeydown(event);
9268
10010
  };
@@ -10186,7 +10928,7 @@ class TheTableToolbarComponent {
10186
10928
  }
10187
10929
  }
10188
10930
  TheTableToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheTableToolbarComponent, deps: [{ token: i0.NgZone }, { token: TheColorSelectService }, { token: i1$1.ThyPopover }, { token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
10189
- TheTableToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isFromControls: "isFromControls", tableElement: "tableElement" }, ngImport: i0, template: "<thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a\n *ngIf=\"item.visibility\"\n href=\"javascript:;\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n (mousedown)=\"item.actionHandle()\"\n ></a>\n </ng-container>\n <thy-divider *ngIf=\"hasDivider\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"> </thy-divider>\n <a href=\"javascript:;\" thyAction thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <a\n href=\"javascript:;\"\n *ngIf=\"tableStore.isSelectedTable && tableOptions?.showFullscreen\"\n thyAction\n thyTooltip=\"\u5168\u5C4F\"\n (mousedown)=\"setFullscreen($event)\"\n >\n <thy-icon thyIconName=\"arrows-alt\"></thy-icon>\n </a>\n\n <ng-container *ngIf=\"tableStore.isSelectedTable\">\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a href=\"javascript:;\" class=\"link-with-down\" thyAction (mousedown)=\"mousedown($event)\" (click)=\"openTableOptionMenu($event)\">\n <span>\u8868\u683C\u9009\u9879</span>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n </ng-container>\n\n <ng-container *ngIf=\"tableOptions?.showFullscreen ? deleteIcon : deleteIcon && !tableStore.isSelectedTable\">\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n [thyActionIcon]=\"deleteIcon\"\n [thyTooltip]=\"iconName\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n </ng-container>\n</thy-actions>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i3$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i5.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i12.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }] });
10931
+ TheTableToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isFromControls: "isFromControls", tableElement: "tableElement" }, ngImport: i0, template: "<thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a\n *ngIf=\"item.visibility\"\n href=\"javascript:;\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n (mousedown)=\"item.actionHandle()\"\n ></a>\n </ng-container>\n <thy-divider *ngIf=\"hasDivider\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"> </thy-divider>\n <a href=\"javascript:;\" thyAction thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <a\n href=\"javascript:;\"\n *ngIf=\"tableStore.isSelectedTable && tableOptions?.showFullscreen\"\n thyAction\n thyTooltip=\"\u5168\u5C4F\"\n (mousedown)=\"setFullscreen($event)\"\n >\n <thy-icon thyIconName=\"arrows-alt\"></thy-icon>\n </a>\n\n <ng-container *ngIf=\"tableStore.isSelectedTable\">\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a href=\"javascript:;\" class=\"link-with-down\" thyAction (mousedown)=\"mousedown($event)\" (click)=\"openTableOptionMenu($event)\">\n <span>\u8868\u683C\u9009\u9879</span>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n </ng-container>\n\n <ng-container *ngIf=\"tableOptions?.showFullscreen ? deleteIcon : deleteIcon && !tableStore.isSelectedTable\">\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n [thyActionIcon]=\"deleteIcon\"\n [thyTooltip]=\"iconName\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n </ng-container>\n</thy-actions>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i5.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i12.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }] });
10190
10932
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheTableToolbarComponent, decorators: [{
10191
10933
  type: Component,
10192
10934
  args: [{ selector: 'the-table-toolbar', template: "<thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a\n *ngIf=\"item.visibility\"\n href=\"javascript:;\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n (mousedown)=\"item.actionHandle()\"\n ></a>\n </ng-container>\n <thy-divider *ngIf=\"hasDivider\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"> </thy-divider>\n <a href=\"javascript:;\" thyAction thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <a\n href=\"javascript:;\"\n *ngIf=\"tableStore.isSelectedTable && tableOptions?.showFullscreen\"\n thyAction\n thyTooltip=\"\u5168\u5C4F\"\n (mousedown)=\"setFullscreen($event)\"\n >\n <thy-icon thyIconName=\"arrows-alt\"></thy-icon>\n </a>\n\n <ng-container *ngIf=\"tableStore.isSelectedTable\">\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a href=\"javascript:;\" class=\"link-with-down\" thyAction (mousedown)=\"mousedown($event)\" (click)=\"openTableOptionMenu($event)\">\n <span>\u8868\u683C\u9009\u9879</span>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n </ng-container>\n\n <ng-container *ngIf=\"tableOptions?.showFullscreen ? deleteIcon : deleteIcon && !tableStore.isSelectedTable\">\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n [thyActionIcon]=\"deleteIcon\"\n [thyTooltip]=\"iconName\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n </ng-container>\n</thy-actions>\n" }]
@@ -10711,7 +11453,7 @@ class TheInsertMarkComponent {
10711
11453
  ngOnDestroy() { }
10712
11454
  }
10713
11455
  TheInsertMarkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheInsertMarkComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
10714
- TheInsertMarkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: { type: "type", at: "at", tableStore: "tableStore" }, ngImport: i0, 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", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
11456
+ TheInsertMarkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: { type: "type", at: "at", tableStore: "tableStore" }, ngImport: i0, 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", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
10715
11457
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheInsertMarkComponent, decorators: [{
10716
11458
  type: Component,
10717
11459
  args: [{ selector: 'the-table-insert-mark', 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" }]
@@ -12300,49 +13042,6 @@ const normalizeTable = (table) => {
12300
13042
  return table;
12301
13043
  };
12302
13044
 
12303
- class TheTableSelectComponent {
12304
- constructor(popoverRef) {
12305
- this.popoverRef = popoverRef;
12306
- this.tableData = new Array(10);
12307
- this.maxRowIndex = -1;
12308
- this.maxColIndex = -1;
12309
- }
12310
- handleDocumentMouseDown(event) {
12311
- if (!document.querySelector('.table-selector-container').contains(event.target)) {
12312
- this.popoverRef.close();
12313
- }
12314
- }
12315
- ngOnInit() { }
12316
- onSelectCells(rowIndex, colIndex) {
12317
- this.maxRowIndex = rowIndex;
12318
- this.maxColIndex = colIndex;
12319
- }
12320
- executeTable(event) {
12321
- event.preventDefault();
12322
- event.stopPropagation();
12323
- const opts = new TableOptions(this.optionsParam);
12324
- insertTable(opts, this.editor, this.maxRowIndex + 1, this.maxColIndex + 1);
12325
- if (this.popoverRef) {
12326
- this.popoverRef.close();
12327
- this.maxColIndex = -1;
12328
- this.maxRowIndex = -1;
12329
- }
12330
- }
12331
- }
12332
- TheTableSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheTableSelectComponent, deps: [{ token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
12333
- TheTableSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheTableSelectComponent, selector: "table-select", inputs: { optionsParam: "optionsParam", editor: "editor" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" } }, ngImport: i0, template: "<div class=\"table-selector-container\">\n <div *ngFor=\"let item of tableData; let rowIndex = index\" class=\"selector-row\" (mousedown)=\"executeTable($event)\">\n <span\n *ngFor=\"let item of tableData; let colIndex = index\"\n [ngClass]=\"{ 'active-cell': rowIndex <= maxRowIndex && colIndex <= maxColIndex, 'selector-cell': true }\"\n (mouseenter)=\"onSelectCells(rowIndex, colIndex)\"\n >\n </span>\n </div>\n <span class=\"selector-text\">{{ maxRowIndex + 1 }} x {{ maxColIndex + 1 }}</span>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
12334
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheTableSelectComponent, decorators: [{
12335
- type: Component,
12336
- args: [{ selector: 'table-select', template: "<div class=\"table-selector-container\">\n <div *ngFor=\"let item of tableData; let rowIndex = index\" class=\"selector-row\" (mousedown)=\"executeTable($event)\">\n <span\n *ngFor=\"let item of tableData; let colIndex = index\"\n [ngClass]=\"{ 'active-cell': rowIndex <= maxRowIndex && colIndex <= maxColIndex, 'selector-cell': true }\"\n (mouseenter)=\"onSelectCells(rowIndex, colIndex)\"\n >\n </span>\n </div>\n <span class=\"selector-text\">{{ maxRowIndex + 1 }} x {{ maxColIndex + 1 }}</span>\n</div>\n" }]
12337
- }], ctorParameters: function () { return [{ type: i1$1.ThyPopoverRef }]; }, propDecorators: { optionsParam: [{
12338
- type: Input
12339
- }], editor: [{
12340
- type: Input
12341
- }], handleDocumentMouseDown: [{
12342
- type: HostListener,
12343
- args: ['document: mousedown', ['$event']]
12344
- }] } });
12345
-
12346
13045
  class TheTableToolbarItemComponent extends TheBaseToolbarItem {
12347
13046
  constructor(thyPopover, overlay) {
12348
13047
  super();
@@ -12378,10 +13077,11 @@ class TheTableToolbarItemComponent extends TheBaseToolbarItem {
12378
13077
  minWidth: 0,
12379
13078
  backdropClosable: false,
12380
13079
  hasBackdrop: false,
13080
+ outsideClosable: true,
12381
13081
  insideClosable: false,
12382
13082
  placement: 'bottomLeft',
12383
- offset: 10,
12384
- panelClass: 'the-table-selector-pannel',
13083
+ offset: 0,
13084
+ panelClass: 'the-table-selector-panel',
12385
13085
  scrollStrategy: this.overlay.scrollStrategies.reposition()
12386
13086
  });
12387
13087
  return this.tableSelectRef;
@@ -12402,7 +13102,7 @@ TheTableToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14
12402
13102
  >
12403
13103
  <thy-icon class="link-down-icon font-size-sm text-desc ml-1" thyIconName="caret-down"> </thy-icon>
12404
13104
  </a>
12405
- `, isInline: true, dependencies: [{ kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i3$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }] });
13105
+ `, isInline: true, dependencies: [{ kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }] });
12406
13106
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheTableToolbarItemComponent, decorators: [{
12407
13107
  type: Component,
12408
13108
  args: [{
@@ -12825,8 +13525,22 @@ const createTablePlugin = createPluginFactory({
12825
13525
  active: editor => TableEditor.isActive(editor)
12826
13526
  }
12827
13527
  ],
12828
- options: {
12829
- showFullscreen: true,
13528
+ menuItems: [
13529
+ {
13530
+ key: ElementKinds.table,
13531
+ keywords: 'biaoge,bg,table,表格',
13532
+ execute: editor => TableEditor.insertTable(editor),
13533
+ active: editor => TableEditor.isActive(editor),
13534
+ name: '表格',
13535
+ type: ThePluginMenuItemType.group,
13536
+ menuIcon: PluginMenuIcons.table,
13537
+ description: '结构化呈现数据信息',
13538
+ displayKey: '/bg',
13539
+ isExpanded: true
13540
+ }
13541
+ ],
13542
+ options: {
13543
+ showFullscreen: true,
12830
13544
  setFullscreen: (editor, event, element) => {
12831
13545
  event.preventDefault();
12832
13546
  }
@@ -12957,141 +13671,28 @@ const createTodoItemPlugin = createPluginFactory({
12957
13671
  active: editor => TodoItemEditor.isActive(editor)
12958
13672
  }
12959
13673
  ],
13674
+ menuItems: [
13675
+ {
13676
+ key: ElementKinds.checkItem,
13677
+ keywords: 'dbsx,daibanshixiang,todolist,待办事项',
13678
+ execute: editor => TodoItemEditor.insertTodoItem(editor),
13679
+ active: editor => TodoItemEditor.isActive(editor),
13680
+ type: ThePluginMenuItemType.icon,
13681
+ name: '待办事项',
13682
+ displayKey: '/dbsx',
13683
+ icon: 'list-check',
13684
+ menuIcon: PluginMenuIcons.numberedList
13685
+ }
13686
+ ],
12960
13687
  options: {
12961
13688
  allowParentTypes: [ElementKinds.tableCell, ElementKinds.blockquote],
12962
13689
  editableWithReadonly: false
12963
13690
  }
12964
13691
  });
12965
13692
 
12966
- class TheVerticalToolbarItemComponent extends TheBaseToolbarDropdown {
12967
- constructor(elementRef, thyPopover, viewContainerRef) {
12968
- super();
12969
- this.elementRef = elementRef;
12970
- this.thyPopover = thyPopover;
12971
- this.viewContainerRef = viewContainerRef;
12972
- this.isHide = true;
12973
- }
12974
- get isOpened() {
12975
- return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
12976
- }
12977
- handleDocumentMouseDown(event) {
12978
- if (!this.elementRef.nativeElement.contains(event.target)) {
12979
- this.close();
12980
- }
12981
- }
12982
- ngOnInit() { }
12983
- menusActive(editor) {
12984
- return this.menus.find(i => {
12985
- var _a;
12986
- if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.selection) && (i === null || i === void 0 ? void 0 : i.active)) {
12987
- return i === null || i === void 0 ? void 0 : i.active(editor);
12988
- }
12989
- });
12990
- }
12991
- execute(event) {
12992
- var _a, _b;
12993
- super.execute(event);
12994
- if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.readOnly) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
12995
- return;
12996
- }
12997
- this.openPopover();
12998
- }
12999
- itemMousedown(event, item) {
13000
- event.preventDefault();
13001
- event.stopPropagation();
13002
- this.close();
13003
- if (item === null || item === void 0 ? void 0 : item.execute) {
13004
- item === null || item === void 0 ? void 0 : item.execute(this.editor);
13005
- }
13006
- }
13007
- openPopover() {
13008
- var _a;
13009
- this.dropdownPopoverRef = this.thyPopover.open(this.template, {
13010
- origin: this.elementRef,
13011
- panelClass: ['the-toolbar-dropdown-popover', (_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key],
13012
- placement: 'bottomLeft',
13013
- offset: 10,
13014
- minWidth: 0,
13015
- viewContainerRef: this.viewContainerRef,
13016
- insideClosable: false,
13017
- backdropClosable: false,
13018
- hasBackdrop: false
13019
- });
13020
- }
13021
- close() {
13022
- if (this.dropdownPopoverRef) {
13023
- this.dropdownPopoverRef.close();
13024
- }
13025
- }
13026
- }
13027
- TheVerticalToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheVerticalToolbarItemComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
13028
- TheVerticalToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", 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: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: "<a\n href=\"javascript:;\"\n class=\"icon-mode link-with-down\"\n thyAction\n [thyActionIcon]=\"activeMenuItem?.icon\"\n [thyActionActive]=\"isOpened\"\n [thyTooltip]=\"toolbarItem?.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n href=\"javascript:;\"\n thyDropdownMenuItem\n [thyDropdownMenuItemActive]=\"menu.key === activeMenuItem?.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <thy-icon *ngIf=\"menu.icon\" thyDropdownMenuItemIcon [thyIconName]=\"menu?.icon\"></thy-icon>\n <span thyDropdownMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i3$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "directive", type: i6.ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "directive", type: i6.ThyDropdownMenuItemNameDirective, selector: "[thyDropdownMenuItemName]" }, { kind: "directive", type: i6.ThyDropdownMenuItemIconDirective, selector: "[thyDropdownMenuItemIcon]" }, { kind: "directive", type: i6.ThyDropdownMenuItemActiveDirective, selector: "[thyDropdownMenuItemActive]", inputs: ["thyDropdownMenuItemActive"] }] });
13029
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheVerticalToolbarItemComponent, decorators: [{
13030
- type: Component,
13031
- args: [{ selector: 'the-toolbar-vertical-align-item', host: {
13032
- class: 'the-toolbar-dropdown-container verticalAlign',
13033
- '[class.hide]': '!active'
13034
- }, template: "<a\n href=\"javascript:;\"\n class=\"icon-mode link-with-down\"\n thyAction\n [thyActionIcon]=\"activeMenuItem?.icon\"\n [thyActionActive]=\"isOpened\"\n [thyTooltip]=\"toolbarItem?.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon class=\"font-size-sm text-desc ml-1\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n href=\"javascript:;\"\n thyDropdownMenuItem\n [thyDropdownMenuItemActive]=\"menu.key === activeMenuItem?.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <thy-icon *ngIf=\"menu.icon\" thyDropdownMenuItemIcon [thyIconName]=\"menu?.icon\"></thy-icon>\n <span thyDropdownMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </div>\n</ng-template>\n" }]
13035
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThyPopover }, { type: i0.ViewContainerRef }]; }, propDecorators: { template: [{
13036
- type: ViewChild,
13037
- args: ['VerticalAlignItems', { read: TemplateRef, static: true }]
13038
- }], handleDocumentMouseDown: [{
13039
- type: HostListener,
13040
- args: ['document: mousedown', ['$event']]
13041
- }] } });
13042
-
13043
- const VerticalAlignEditor = {
13044
- isVerticalActive(editor, alignment) {
13045
- const tableCellAlign = TableEditor.isVerticalAlignActive(editor, alignment);
13046
- if (tableCellAlign !== null) {
13047
- return tableCellAlign;
13048
- }
13049
- return false;
13050
- },
13051
- setVerticalAlign(editor, alignment) {
13052
- if (TableEditor.setVerticalAlign(editor, alignment)) {
13053
- return;
13054
- }
13055
- }
13056
- };
13057
- const createVerticalAlignPlugin = createPluginFactory({
13058
- key: PluginKeys.verticalAlign,
13059
- toolbarItems: [
13060
- {
13061
- key: ToolbarActionTypes.verticalAlign,
13062
- name: '垂直对齐',
13063
- type: ToolbarItemType.dropdown,
13064
- dropdownMode: DropdownMode.icon,
13065
- iconComponent: TheVerticalToolbarItemComponent,
13066
- includes: [ToolbarActionTypes.verticalAlignTop, ToolbarActionTypes.verticalAlignMiddle, ToolbarActionTypes.verticalAlignBottom],
13067
- active: editor => TableEditor.isActive(editor)
13068
- },
13069
- {
13070
- key: ToolbarActionTypes.verticalAlignTop,
13071
- icon: 'align-top',
13072
- name: '顶部对齐',
13073
- execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.top),
13074
- active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.top)
13075
- },
13076
- {
13077
- key: ToolbarActionTypes.verticalAlignMiddle,
13078
- icon: 'align-middle',
13079
- name: '垂直居中',
13080
- execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.middle),
13081
- active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.middle)
13082
- },
13083
- {
13084
- key: ToolbarActionTypes.verticalAlignBottom,
13085
- icon: 'align-bottom',
13086
- name: '底部对齐',
13087
- execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.bottom),
13088
- active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.bottom)
13089
- }
13090
- ]
13091
- });
13092
-
13093
13693
  const internalPlugins = () => [
13094
13694
  createTheHistoryPlugin(),
13695
+ createCommonPlugin(),
13095
13696
  createAutoInsertDataPlugin(),
13096
13697
  createRemoveEmptyPlugin(),
13097
13698
  createRemoveVoidPlugin(),
@@ -13286,8 +13887,8 @@ class TheQuickInsertComponent {
13286
13887
  this.renderer = renderer;
13287
13888
  this.elementRef = elementRef;
13288
13889
  this.cdr = cdr;
13890
+ this.className = 'the-quick-insert';
13289
13891
  this.isVisible = false;
13290
- this.isHide = true;
13291
13892
  this.defaultIconName = 'plus-circle-thin';
13292
13893
  this.iconNameFill = 'plus-circle-thin-fill';
13293
13894
  this.displayIconName = this.defaultIconName;
@@ -13296,16 +13897,38 @@ class TheQuickInsertComponent {
13296
13897
  event.preventDefault();
13297
13898
  event.stopPropagation();
13298
13899
  }
13900
+ ngOnInit() {
13901
+ const { onChange } = this.editor;
13902
+ this.editor.onChange = () => {
13903
+ onChange();
13904
+ if (this.editor && this.editor.options && !this.editor.options.readonly) {
13905
+ // wait isOpenedMenu is updated
13906
+ setTimeout(() => {
13907
+ this.checkStatus();
13908
+ }, 0);
13909
+ }
13910
+ };
13911
+ }
13299
13912
  checkStatus() {
13300
13913
  var _a;
13301
13914
  const { editor } = this;
13302
- if (this.isVisible && isCleanEmptyParagraph(editor) && !this.hasExcludeAttribute() && !this.isRichMediaScope()) {
13915
+ if (this.isVisible &&
13916
+ !QuickInsertEditor.isOpenedMenu(editor) &&
13917
+ isCleanEmptyParagraph(editor) &&
13918
+ !this.hasExcludeAttribute() &&
13919
+ !this.isRichMediaScope()) {
13303
13920
  const block = Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
13304
13921
  const rootNode = AngularEditor.toDOMNode(editor, block);
13305
13922
  this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
13306
13923
  return;
13307
13924
  }
13308
- this.isHide = true;
13925
+ this.addHiddenClass();
13926
+ }
13927
+ addHiddenClass() {
13928
+ this.elementRef.nativeElement.classList.add('d-none');
13929
+ }
13930
+ removeHiddenClass() {
13931
+ this.elementRef.nativeElement.classList.remove('d-none');
13309
13932
  }
13310
13933
  isRichMediaScope() {
13311
13934
  var _a;
@@ -13326,9 +13949,9 @@ class TheQuickInsertComponent {
13326
13949
  return fontSizeMark;
13327
13950
  }
13328
13951
  updatePosition(left, top) {
13329
- this.isHide = false;
13330
13952
  this.renderer.setStyle(this.elementRef.nativeElement, 'top', `${top}px`);
13331
13953
  this.renderer.setStyle(this.elementRef.nativeElement, 'left', `${left}px`);
13954
+ this.removeHiddenClass();
13332
13955
  }
13333
13956
  mouseEnter(event) {
13334
13957
  this.displayIconName = this.iconNameFill;
@@ -13341,24 +13964,26 @@ class TheQuickInsertComponent {
13341
13964
  handleClick(event) {
13342
13965
  event.stopPropagation();
13343
13966
  event.preventDefault();
13344
- if (QuickInsertEditor.isOpenedToolbar(this.editor)) {
13345
- QuickInsertEditor.closeQuickInsertToolbar(this.editor);
13346
- return;
13347
- }
13348
- QuickInsertEditor.openQuickInsertToolbar(this.editor, this.quickToolbarItems, this.iconElement.nativeElement);
13967
+ // avoid popover is closed immediately
13968
+ setTimeout(() => {
13969
+ QuickInsertEditor.openMenu(this.editor)
13970
+ .afterClosed()
13971
+ .subscribe(() => {
13972
+ this.checkStatus();
13973
+ });
13974
+ this.checkStatus();
13975
+ }, 100);
13349
13976
  }
13350
13977
  }
13351
13978
  TheQuickInsertComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheQuickInsertComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
13352
- TheQuickInsertComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems", isVisible: "isVisible" }, host: { listeners: { "mousedown": "handleMousedownNativeElement($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-quick-insert" }, viewQueries: [{ propertyName: "iconElement", first: true, predicate: ["iconElement"], descendants: true, read: ElementRef }], ngImport: i0, 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", dependencies: [{ kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }] });
13979
+ TheQuickInsertComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: { editor: "editor", isVisible: "isVisible" }, host: { listeners: { "mousedown": "handleMousedownNativeElement($event)" }, properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "iconElement", first: true, predicate: ["iconElement"], descendants: true, read: ElementRef }], ngImport: i0, 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", dependencies: [{ kind: "component", type: i3.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }] });
13353
13980
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheQuickInsertComponent, decorators: [{
13354
13981
  type: Component,
13355
- args: [{ selector: '[theQuickInsert]', host: {
13356
- class: 'the-quick-insert',
13357
- '[class.hide]': 'isHide'
13358
- }, 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" }]
13359
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { editor: [{
13360
- type: Input
13361
- }], quickToolbarItems: [{
13982
+ args: [{ selector: '[theQuickInsert]', 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" }]
13983
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { className: [{
13984
+ type: HostBinding,
13985
+ args: ['class']
13986
+ }], editor: [{
13362
13987
  type: Input
13363
13988
  }], isVisible: [{
13364
13989
  type: Input
@@ -13371,13 +13996,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
13371
13996
  }] } });
13372
13997
 
13373
13998
  class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
13374
- constructor(theContextService, viewContainerRef, elementRef, ngZone, cdr) {
13999
+ constructor(theContextService, viewContainerRef, elementRef, ngZone, cdr, iconRegistry, domSanitizer) {
13375
14000
  super();
13376
14001
  this.theContextService = theContextService;
13377
14002
  this.viewContainerRef = viewContainerRef;
13378
14003
  this.elementRef = elementRef;
13379
14004
  this.ngZone = ngZone;
13380
14005
  this.cdr = cdr;
14006
+ this.iconRegistry = iconRegistry;
14007
+ this.domSanitizer = domSanitizer;
13381
14008
  this.visibleQuickInsertPlus = true;
13382
14009
  this.thePlugins = [];
13383
14010
  this.theOnSave = new EventEmitter();
@@ -13487,12 +14114,9 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
13487
14114
  var _a, _b;
13488
14115
  return ((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.maxHeight) ? `${(_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.maxHeight}px` : null;
13489
14116
  }
13490
- get quickToolbarItems() {
13491
- var _a;
13492
- return (_a = this.toolbarEntity) === null || _a === void 0 ? void 0 : _a.quick;
13493
- }
13494
14117
  ngOnInit() {
13495
14118
  this.initialize();
14119
+ this.initializeMenuIcon();
13496
14120
  this.theContextService.uploadingStatus$.subscribe(isUploading => {
13497
14121
  if (isUploading) {
13498
14122
  this.theUploadingStatus.emit(true);
@@ -13564,6 +14188,11 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
13564
14188
  this.theOptions = Object.assign(Object.assign({}, this.theOptions), { mode: TheDataMode.html });
13565
14189
  }
13566
14190
  }
14191
+ initializeMenuIcon() {
14192
+ PluginMenuSvgs.forEach(menuItem => {
14193
+ this.iconRegistry.addSvgIconLiteral(menuItem.key, this.domSanitizer.bypassSecurityTrustHtml(menuItem.svg));
14194
+ });
14195
+ }
13567
14196
  applyAutoFocus() {
13568
14197
  var _a, _b, _c;
13569
14198
  if (!((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled) && !((_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.readonly)) {
@@ -13601,16 +14230,12 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
13601
14230
  this.onTouchedCallback = fn;
13602
14231
  }
13603
14232
  valueChange(value) {
13604
- var _a, _b, _c, _d, _e, _f;
14233
+ var _a, _b, _c, _d, _e;
13605
14234
  const isEditable = !((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.readonly) && !((_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.disabled);
13606
14235
  (_c = this.theGlobalToolbarInstance) === null || _c === void 0 ? void 0 : _c.selectionChange(this.editor);
13607
- // quick insert button
13608
- if (isEditable) {
13609
- (_d = this.quickInsertInstance) === null || _d === void 0 ? void 0 : _d.checkStatus();
13610
- }
13611
14236
  // auto scroll view
13612
- const scrollContainer = (_e = this.theOptions) === null || _e === void 0 ? void 0 : _e.scrollContainer;
13613
- const maxHeight = (_f = this.theOptions) === null || _f === void 0 ? void 0 : _f.maxHeight;
14237
+ const scrollContainer = (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.scrollContainer;
14238
+ const maxHeight = (_e = this.theOptions) === null || _e === void 0 ? void 0 : _e.maxHeight;
13614
14239
  if (isEditable && (scrollContainer || maxHeight)) {
13615
14240
  const container = maxHeight ? DEFAULT_SCROLL_CONTAINER : scrollContainer;
13616
14241
  this.autoScrollView(this.editor, container);
@@ -13729,7 +14354,7 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
13729
14354
  };
13730
14355
  }
13731
14356
  }
13732
- TheEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheEditorComponent, deps: [{ token: TheContextService }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
14357
+ TheEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheEditorComponent, deps: [{ token: TheContextService }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i3.ThyIconRegistry }, { token: i3$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
13733
14358
  TheEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheEditorComponent, selector: "the-editor, theEditor", inputs: { theOptions: "theOptions", thePlugins: "thePlugins", theGlobalToolbar: "theGlobalToolbar", theDecorate: "theDecorate", theOnError: "theOnError" }, outputs: { theOnSave: "theOnSave", theOnDOMEvent: "theOnDOMEvent", theEditorCreated: "theEditorCreated", theUploadingStatus: "theUploadingStatus" }, host: { properties: { "class.the-editor-readonly": "theOptions?.readonly" }, classAttribute: "the-editor" }, providers: [
13734
14359
  TheContextService,
13735
14360
  TheColorSelectService,
@@ -13738,7 +14363,7 @@ TheEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ver
13738
14363
  useExisting: forwardRef(() => TheEditorComponent),
13739
14364
  multi: true
13740
14365
  }
13741
- ], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n cdkScrollable\n thyImageGroup\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 [placeholder]=\"theOptions?.placeholder\"\n [placeholderDecorate]=\"theOptions?.placeholderDecorate ? theOptions?.placeholderDecorate : null\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar\n *ngIf=\"!theOptions?.readonly && theOptions?.inlineToolbarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\" [isVisible]=\"visibleQuickInsertPlus\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6$1.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "component", type: i1.SlateEditableComponent, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "placeholderDecorate", "isStrictDecorate", "trackBy", "readonly", "placeholder", "beforeInput", "blur", "click", "compositionEnd", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.ThyImageGroupComponent, selector: "thy-image-group, [thyImageGroup]" }, { kind: "component", type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { kind: "component", type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { kind: "component", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems", "isVisible"] }, { kind: "component", type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
14366
+ ], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n cdkScrollable\n thyImageGroup\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 [placeholder]=\"theOptions?.placeholder\"\n [placeholderDecorate]=\"theOptions?.placeholderDecorate ? theOptions?.placeholderDecorate : null\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar\n *ngIf=\"!theOptions?.readonly && theOptions?.inlineToolbarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [isVisible]=\"visibleQuickInsertPlus\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6$1.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "component", type: i1.SlateEditableComponent, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "placeholderDecorate", "isStrictDecorate", "trackBy", "readonly", "placeholder", "beforeInput", "blur", "click", "compositionEnd", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.ThyImageGroupComponent, selector: "thy-image-group, [thyImageGroup]" }, { kind: "component", type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { kind: "component", type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { kind: "component", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "isVisible"] }, { kind: "component", type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
13742
14367
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheEditorComponent, decorators: [{
13743
14368
  type: Component,
13744
14369
  args: [{ selector: 'the-editor, theEditor', providers: [
@@ -13752,8 +14377,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
13752
14377
  ], host: {
13753
14378
  class: 'the-editor',
13754
14379
  '[class.the-editor-readonly]': 'theOptions?.readonly'
13755
- }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n cdkScrollable\n thyImageGroup\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 [placeholder]=\"theOptions?.placeholder\"\n [placeholderDecorate]=\"theOptions?.placeholderDecorate ? theOptions?.placeholderDecorate : null\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar\n *ngIf=\"!theOptions?.readonly && theOptions?.inlineToolbarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\" [isVisible]=\"visibleQuickInsertPlus\"></div>\n <the-template #templateInstance></the-template>\n</div>\n" }]
13756
- }], ctorParameters: function () { return [{ type: TheContextService }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { theOptions: [{
14380
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n cdkScrollable\n thyImageGroup\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 [placeholder]=\"theOptions?.placeholder\"\n [placeholderDecorate]=\"theOptions?.placeholderDecorate ? theOptions?.placeholderDecorate : null\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar\n *ngIf=\"!theOptions?.readonly && theOptions?.inlineToolbarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [isVisible]=\"visibleQuickInsertPlus\"></div>\n <the-template #templateInstance></the-template>\n</div>\n" }]
14381
+ }], ctorParameters: function () { return [{ type: TheContextService }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i3.ThyIconRegistry }, { type: i3$2.DomSanitizer }]; }, propDecorators: { theOptions: [{
13757
14382
  type: Input
13758
14383
  }], thePlugins: [{
13759
14384
  type: Input
@@ -13837,7 +14462,7 @@ class TheToolbarGroupComponent {
13837
14462
  }
13838
14463
  ngOnInit() { }
13839
14464
  ngOnDestroy() {
13840
- this.colseGroup();
14465
+ this.closeGroup();
13841
14466
  }
13842
14467
  toggleGroupMenus(event) {
13843
14468
  var _a;
@@ -13845,7 +14470,7 @@ class TheToolbarGroupComponent {
13845
14470
  return;
13846
14471
  }
13847
14472
  if (this.isOpened) {
13848
- this.colseGroup();
14473
+ this.closeGroup();
13849
14474
  }
13850
14475
  else {
13851
14476
  this.openGroup(event);
@@ -13876,7 +14501,7 @@ class TheToolbarGroupComponent {
13876
14501
  this.active = true;
13877
14502
  this.groupPopoverRef = this.thyPopover.open(this.groupTemplate, {
13878
14503
  panelClass: 'the-toolbar-group-container',
13879
- offset: 10,
14504
+ offset: 0,
13880
14505
  minWidth: 0,
13881
14506
  placement: 'bottomRight',
13882
14507
  origin: event.currentTarget,
@@ -13889,14 +14514,14 @@ class TheToolbarGroupComponent {
13889
14514
  this.activeChange();
13890
14515
  });
13891
14516
  }
13892
- colseGroup() {
14517
+ closeGroup() {
13893
14518
  if (this.isOpened) {
13894
14519
  this.groupPopoverRef.close();
13895
14520
  }
13896
14521
  }
13897
14522
  }
13898
14523
  TheToolbarGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheToolbarGroupComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
13899
- TheToolbarGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheToolbarGroupComponent, selector: "the-toolbar-group", inputs: { menus: "menus", item: "item" }, host: { listeners: { "mousedown": "mousedownHandler($event)", "click": "clickHandle($event)" }, properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "groupTemplate", first: true, predicate: ["groupTemplate"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<a\n href=\"javascript:;\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"active\"\n [thyTooltip]=\"item?.name\"\n thyTooltipPlacement=\"top\"\n></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i3$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }] });
14524
+ TheToolbarGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TheToolbarGroupComponent, selector: "the-toolbar-group", inputs: { menus: "menus", item: "item" }, host: { listeners: { "mousedown": "mousedownHandler($event)", "click": "clickHandle($event)" }, properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "groupTemplate", first: true, predicate: ["groupTemplate"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<a\n href=\"javascript:;\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"active\"\n [thyTooltip]=\"item?.name\"\n thyTooltipPlacement=\"top\"\n></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i5.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }] });
13900
14525
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheToolbarGroupComponent, decorators: [{
13901
14526
  type: Component,
13902
14527
  args: [{ selector: 'the-toolbar-group', template: "<a\n href=\"javascript:;\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"active\"\n [thyTooltip]=\"item?.name\"\n thyTooltipPlacement=\"top\"\n></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n" }]
@@ -13918,6 +14543,349 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
13918
14543
  args: ['click', ['$event']]
13919
14544
  }] } });
13920
14545
 
14546
+ const THE_LISTBOX_PARENT_OPTION_TOKEN = new InjectionToken('THE_LISTBOX_PARENT_OPTION_TOKEN');
14547
+ const THE_LISTBOX_PARENT_GROUP_TOKEN = new InjectionToken('THE_LISTBOX_PARENT_GROUP_TOKEN');
14548
+ const THE_LISTBOX_TOKEN = new InjectionToken('THE_LISTBOX_TOKEN');
14549
+
14550
+ class TheListboxOptionDirective {
14551
+ constructor(parentOption, parentGroup, elementRef) {
14552
+ this.parentOption = parentOption;
14553
+ this.parentGroup = parentGroup;
14554
+ this.elementRef = elementRef;
14555
+ this._active = false;
14556
+ this.className = 'the-listbox-option';
14557
+ }
14558
+ get hasChild() {
14559
+ return this._options.length > 0;
14560
+ }
14561
+ get firstChild() {
14562
+ return this._options.first;
14563
+ }
14564
+ ngOnInit() { }
14565
+ ngAfterContentInit() { }
14566
+ getGroups() {
14567
+ const groups = [];
14568
+ this._options.forEach(option => {
14569
+ if (option.parentOption && option.parentOption === this && !groups.includes(option.parentGroup)) {
14570
+ groups.push(option.parentGroup);
14571
+ }
14572
+ });
14573
+ return groups;
14574
+ }
14575
+ setActive(active) {
14576
+ this._active = active;
14577
+ if (active) {
14578
+ this.elementRef.nativeElement.classList.add('active');
14579
+ }
14580
+ else {
14581
+ this.elementRef.nativeElement.classList.remove('active');
14582
+ }
14583
+ }
14584
+ getActive() {
14585
+ return this._active;
14586
+ }
14587
+ }
14588
+ TheListboxOptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheListboxOptionDirective, deps: [{ token: THE_LISTBOX_PARENT_OPTION_TOKEN, optional: true, skipSelf: true }, { token: THE_LISTBOX_PARENT_GROUP_TOKEN }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
14589
+ TheListboxOptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: TheListboxOptionDirective, selector: "[theListboxOpton]", host: { properties: { "class": "this.className" } }, providers: [
14590
+ {
14591
+ provide: THE_LISTBOX_PARENT_OPTION_TOKEN,
14592
+ useExisting: TheListboxOptionDirective
14593
+ }
14594
+ ], queries: [{ propertyName: "_options", predicate: TheListboxOptionDirective, descendants: true }], exportAs: ["theListboxOpton"], ngImport: i0 });
14595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheListboxOptionDirective, decorators: [{
14596
+ type: Directive,
14597
+ args: [{
14598
+ selector: '[theListboxOpton]',
14599
+ exportAs: 'theListboxOpton',
14600
+ providers: [
14601
+ {
14602
+ provide: THE_LISTBOX_PARENT_OPTION_TOKEN,
14603
+ useExisting: TheListboxOptionDirective
14604
+ }
14605
+ ]
14606
+ }]
14607
+ }], ctorParameters: function () {
14608
+ return [{ type: TheListboxOptionDirective, decorators: [{
14609
+ type: Inject,
14610
+ args: [THE_LISTBOX_PARENT_OPTION_TOKEN]
14611
+ }, {
14612
+ type: Optional
14613
+ }, {
14614
+ type: SkipSelf
14615
+ }] }, { type: TheListboxGroupDirective, decorators: [{
14616
+ type: Inject,
14617
+ args: [THE_LISTBOX_PARENT_GROUP_TOKEN]
14618
+ }] }, { type: i0.ElementRef }];
14619
+ }, propDecorators: { className: [{
14620
+ type: HostBinding,
14621
+ args: ['class']
14622
+ }], _options: [{
14623
+ type: ContentChildren,
14624
+ args: [TheListboxOptionDirective, { descendants: true }]
14625
+ }] } });
14626
+ class TheListboxGroupDirective {
14627
+ constructor(parentOption, theListBox) {
14628
+ this.parentOption = parentOption;
14629
+ this.theListBox = theListBox;
14630
+ this.className = 'the-listbox-group';
14631
+ this.options = [];
14632
+ /**
14633
+ * 大于 1 表示水平分组,小于等于 1 表示垂直分组
14634
+ */
14635
+ this.horizontalColumn = 1;
14636
+ }
14637
+ ngOnInit() { }
14638
+ ngAfterContentInit() {
14639
+ this.filterOptions();
14640
+ }
14641
+ filterOptions() {
14642
+ this.options = this._options.filter(_option => {
14643
+ if (_option.parentGroup && _option.parentGroup === this) {
14644
+ return true;
14645
+ }
14646
+ else {
14647
+ return false;
14648
+ }
14649
+ });
14650
+ }
14651
+ getSiblingGroups() {
14652
+ if (this.parentOption) {
14653
+ return this.parentOption.getGroups();
14654
+ }
14655
+ else {
14656
+ return this.theListBox.groups;
14657
+ }
14658
+ }
14659
+ getFirst() {
14660
+ return this.options[0];
14661
+ }
14662
+ getLast() {
14663
+ return this.options[this.options.length - 1];
14664
+ }
14665
+ }
14666
+ TheListboxGroupDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheListboxGroupDirective, deps: [{ token: THE_LISTBOX_PARENT_OPTION_TOKEN, optional: true, skipSelf: true }, { token: THE_LISTBOX_TOKEN }], target: i0.ɵɵFactoryTarget.Directive });
14667
+ TheListboxGroupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: TheListboxGroupDirective, selector: "[theListboxGroup]", inputs: { horizontalColumn: "horizontalColumn" }, host: { properties: { "class": "this.className" } }, providers: [
14668
+ {
14669
+ provide: THE_LISTBOX_PARENT_GROUP_TOKEN,
14670
+ useExisting: TheListboxGroupDirective
14671
+ }
14672
+ ], queries: [{ propertyName: "_options", predicate: TheListboxOptionDirective, descendants: true }], exportAs: ["theListboxGroup"], ngImport: i0 });
14673
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheListboxGroupDirective, decorators: [{
14674
+ type: Directive,
14675
+ args: [{
14676
+ selector: '[theListboxGroup]',
14677
+ exportAs: 'theListboxGroup',
14678
+ providers: [
14679
+ {
14680
+ provide: THE_LISTBOX_PARENT_GROUP_TOKEN,
14681
+ useExisting: TheListboxGroupDirective
14682
+ }
14683
+ ]
14684
+ }]
14685
+ }], ctorParameters: function () {
14686
+ return [{ type: TheListboxOptionDirective, decorators: [{
14687
+ type: Inject,
14688
+ args: [THE_LISTBOX_PARENT_OPTION_TOKEN]
14689
+ }, {
14690
+ type: Optional
14691
+ }, {
14692
+ type: SkipSelf
14693
+ }] }, { type: TheListboxDirective, decorators: [{
14694
+ type: Inject,
14695
+ args: [THE_LISTBOX_TOKEN]
14696
+ }] }];
14697
+ }, propDecorators: { className: [{
14698
+ type: HostBinding,
14699
+ args: ['class']
14700
+ }], _options: [{
14701
+ type: ContentChildren,
14702
+ args: [TheListboxOptionDirective, { descendants: true }]
14703
+ }], horizontalColumn: [{
14704
+ type: Input
14705
+ }] } });
14706
+ class TheListboxDirective {
14707
+ constructor(ngZone, elementRef) {
14708
+ this.ngZone = ngZone;
14709
+ this.elementRef = elementRef;
14710
+ this.className = 'the-listbox-container';
14711
+ this.groups = [];
14712
+ this.theActiveOptionChange = new EventEmitter();
14713
+ }
14714
+ ngOnInit() { }
14715
+ ngAfterContentInit() {
14716
+ this.filterGroups();
14717
+ if (this.groups.length > 0) {
14718
+ this.setActiveItem(null, this.groups[0].getFirst(), 'init');
14719
+ }
14720
+ this._optionChangesSubscription = this._groups.changes.subscribe(() => {
14721
+ this.filterGroups();
14722
+ this.setActiveItem(null, this.groups[0].getFirst(), 'init');
14723
+ });
14724
+ this.ngZone.runOutsideAngular(() => {
14725
+ this._keyboardSubscription = fromEvent(this.keyboardContainer || this.elementRef.nativeElement, 'keydown').subscribe(event => {
14726
+ this.handleKeydown(event);
14727
+ });
14728
+ });
14729
+ }
14730
+ filterGroups() {
14731
+ this.groups = this._groups.filter(group => {
14732
+ if (!group.parentOption) {
14733
+ return true;
14734
+ }
14735
+ else {
14736
+ return false;
14737
+ }
14738
+ });
14739
+ }
14740
+ handleKeydown(event) {
14741
+ const { keyCode } = event;
14742
+ switch (keyCode) {
14743
+ case DOWN_ARROW:
14744
+ this.setNextLineActive();
14745
+ event.preventDefault();
14746
+ break;
14747
+ case UP_ARROW:
14748
+ this.setPreviousLineActive();
14749
+ event.preventDefault();
14750
+ break;
14751
+ case RIGHT_ARROW:
14752
+ this.setNextItemActive();
14753
+ event.preventDefault();
14754
+ break;
14755
+ case LEFT_ARROW:
14756
+ this.setPreviousItemActive();
14757
+ event.preventDefault();
14758
+ break;
14759
+ }
14760
+ }
14761
+ /**
14762
+ * ←
14763
+ */
14764
+ setPreviousItemActive() {
14765
+ if (this.activeOption.parentOption) {
14766
+ this.setActiveItem(this.activeOption, this.activeOption.parentOption, 'parent');
14767
+ }
14768
+ else {
14769
+ const groupOptions = this.activeOption.parentGroup.options;
14770
+ let optionIndex = groupOptions.indexOf(this.activeOption);
14771
+ let newOptionIndex = optionIndex - 1;
14772
+ if (newOptionIndex >= 0) {
14773
+ this.setActiveItem(this.activeOption, groupOptions[newOptionIndex], 'turn');
14774
+ }
14775
+ else {
14776
+ this.enterPreviousGroup();
14777
+ }
14778
+ }
14779
+ }
14780
+ /**
14781
+ * ↓ 键
14782
+ */
14783
+ setNextLineActive() {
14784
+ const groupOptions = this.activeOption.parentGroup.options;
14785
+ let optionIndex = groupOptions.indexOf(this.activeOption);
14786
+ let newOptionIndex = optionIndex + this.activeOption.parentGroup.horizontalColumn;
14787
+ if (newOptionIndex <= groupOptions.length - 1) {
14788
+ this.setActiveItem(this.activeOption, groupOptions[newOptionIndex], 'turn');
14789
+ }
14790
+ else {
14791
+ this.enterNextGroup();
14792
+ }
14793
+ }
14794
+ /**
14795
+ * → 键
14796
+ */
14797
+ setNextItemActive() {
14798
+ if (this.activeOption.hasChild) {
14799
+ this.setActiveItem(this.activeOption, this.activeOption.firstChild, 'child');
14800
+ }
14801
+ else {
14802
+ const groupOptions = this.activeOption.parentGroup.options;
14803
+ let optionIndex = groupOptions.indexOf(this.activeOption);
14804
+ let newOptionIndex = optionIndex + 1;
14805
+ if (newOptionIndex <= groupOptions.length - 1) {
14806
+ this.setActiveItem(this.activeOption, groupOptions[newOptionIndex], 'turn');
14807
+ }
14808
+ else {
14809
+ this.enterNextGroup();
14810
+ }
14811
+ }
14812
+ }
14813
+ /**
14814
+ * ↑ 键
14815
+ */
14816
+ setPreviousLineActive() {
14817
+ const groupOptions = this.activeOption.parentGroup.options;
14818
+ let optionIndex = groupOptions.indexOf(this.activeOption);
14819
+ let newOptionIndex = optionIndex - this.activeOption.parentGroup.horizontalColumn;
14820
+ if (newOptionIndex >= 0) {
14821
+ this.setActiveItem(this.activeOption, groupOptions[newOptionIndex], 'turn');
14822
+ }
14823
+ else {
14824
+ this.enterPreviousGroup();
14825
+ }
14826
+ }
14827
+ enterNextGroup() {
14828
+ const groups = this.activeOption.parentGroup.getSiblingGroups();
14829
+ const groupIndex = groups.indexOf(this.activeOption.parentGroup);
14830
+ let newGroupIndex = groupIndex + 1;
14831
+ if (newGroupIndex > groups.length - 1) {
14832
+ newGroupIndex = 0;
14833
+ }
14834
+ this.setActiveItem(this.activeOption, groups[newGroupIndex].getFirst(), 'turn');
14835
+ }
14836
+ enterPreviousGroup() {
14837
+ const groups = this.activeOption.parentGroup.getSiblingGroups();
14838
+ const groupIndex = groups.indexOf(this.activeOption.parentGroup);
14839
+ let newGroupIndex = groupIndex - 1;
14840
+ if (newGroupIndex < 0) {
14841
+ newGroupIndex = groups.length - 1;
14842
+ }
14843
+ this.setActiveItem(this.activeOption, groups[newGroupIndex].getLast(), 'turn');
14844
+ }
14845
+ setActiveItem(previous, option, type) {
14846
+ if (previous) {
14847
+ previous.setActive(false);
14848
+ }
14849
+ option.setActive(true);
14850
+ this.activeOption = option;
14851
+ this.theActiveOptionChange.emit({ option, type });
14852
+ }
14853
+ ngOnDestroy() {
14854
+ this._optionChangesSubscription.unsubscribe();
14855
+ this._keyboardSubscription.unsubscribe();
14856
+ }
14857
+ }
14858
+ TheListboxDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheListboxDirective, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
14859
+ TheListboxDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: TheListboxDirective, selector: "[theListBox]", inputs: { keyboardContainer: "keyboardContainer" }, outputs: { theActiveOptionChange: "theActiveOptionChange" }, host: { properties: { "class": "this.className" } }, providers: [
14860
+ {
14861
+ provide: THE_LISTBOX_TOKEN,
14862
+ useExisting: TheListboxDirective
14863
+ }
14864
+ ], queries: [{ propertyName: "_groups", predicate: TheListboxGroupDirective, descendants: true }], exportAs: ["theListBox"], ngImport: i0 });
14865
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheListboxDirective, decorators: [{
14866
+ type: Directive,
14867
+ args: [{
14868
+ selector: '[theListBox]',
14869
+ exportAs: 'theListBox',
14870
+ providers: [
14871
+ {
14872
+ provide: THE_LISTBOX_TOKEN,
14873
+ useExisting: TheListboxDirective
14874
+ }
14875
+ ]
14876
+ }]
14877
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { className: [{
14878
+ type: HostBinding,
14879
+ args: ['class']
14880
+ }], _groups: [{
14881
+ type: ContentChildren,
14882
+ args: [TheListboxGroupDirective, { descendants: true }]
14883
+ }], keyboardContainer: [{
14884
+ type: Input
14885
+ }], theActiveOptionChange: [{
14886
+ type: Output
14887
+ }] } });
14888
+
13921
14889
  const TETHYS = [
13922
14890
  ThyIconModule,
13923
14891
  ThyAvatarModule,
@@ -13939,7 +14907,9 @@ const TETHYS = [
13939
14907
  ThyDialogModule,
13940
14908
  ThyActionModule,
13941
14909
  ThyDividerModule,
13942
- ThyDropdownModule
14910
+ ThyDropdownModule,
14911
+ ThyMenuModule,
14912
+ ThyEmptyModule
13943
14913
  ];
13944
14914
  const COMPONENTS = [
13945
14915
  TheToolbarComponent,
@@ -13950,7 +14920,7 @@ const COMPONENTS = [
13950
14920
  TheTextComponent,
13951
14921
  TheDefaultElementComponent,
13952
14922
  TheQuickInsertComponent,
13953
- TheQuickToolbarComponent,
14923
+ ThePluginMenuComponent,
13954
14924
  TheColorSelectComponent,
13955
14925
  TheColorToolbarItemComponent,
13956
14926
  TheContextMenuComponent,
@@ -13959,7 +14929,10 @@ const COMPONENTS = [
13959
14929
  TheTableToolbarItemComponent,
13960
14930
  TheConversionHintComponent,
13961
14931
  TheVerticalToolbarItemComponent,
13962
- TheTableOptionsComponent
14932
+ TheTableOptionsComponent,
14933
+ TheListboxOptionDirective,
14934
+ TheListboxGroupDirective,
14935
+ TheListboxDirective
13963
14936
  ];
13964
14937
  const PLUGIN_COMPONENTS = [
13965
14938
  TheImageComponent,
@@ -13992,7 +14965,7 @@ TheEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
13992
14965
  TheTextComponent,
13993
14966
  TheDefaultElementComponent,
13994
14967
  TheQuickInsertComponent,
13995
- TheQuickToolbarComponent,
14968
+ ThePluginMenuComponent,
13996
14969
  TheColorSelectComponent,
13997
14970
  TheColorToolbarItemComponent,
13998
14971
  TheContextMenuComponent,
@@ -14001,7 +14974,10 @@ TheEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
14001
14974
  TheTableToolbarItemComponent,
14002
14975
  TheConversionHintComponent,
14003
14976
  TheVerticalToolbarItemComponent,
14004
- TheTableOptionsComponent, TheImageComponent,
14977
+ TheTableOptionsComponent,
14978
+ TheListboxOptionDirective,
14979
+ TheListboxGroupDirective,
14980
+ TheListboxDirective, TheImageComponent,
14005
14981
  TheTemplateComponent,
14006
14982
  TheHrComponent,
14007
14983
  TheBlockquoteComponent,
@@ -14037,7 +15013,16 @@ TheEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
14037
15013
  ThyDialogModule,
14038
15014
  ThyActionModule,
14039
15015
  ThyDividerModule,
14040
- ThyDropdownModule, CodemirrorModule, TheColumnSizeModule], exports: [TheEditorComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarItemComponent, TheDefaultElementComponent] });
15016
+ ThyDropdownModule,
15017
+ ThyMenuModule,
15018
+ ThyEmptyModule, CodemirrorModule, TheColumnSizeModule], exports: [TheEditorComponent,
15019
+ TheToolbarComponent,
15020
+ TheToolbarDropdownComponent,
15021
+ TheToolbarItemComponent,
15022
+ TheDefaultElementComponent,
15023
+ TheListboxOptionDirective,
15024
+ TheListboxGroupDirective,
15025
+ TheListboxDirective] });
14041
15026
  TheEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheEditorModule, providers: [
14042
15027
  {
14043
15028
  provide: TheToolbarGroupToken,
@@ -14050,7 +15035,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
14050
15035
  args: [{
14051
15036
  declarations: [TheEditorComponent, ...PIPES, ...COMPONENTS, ...PLUGIN_COMPONENTS],
14052
15037
  imports: [CommonModule, ScrollingModule, SlateModule, FormsModule, ...TETHYS, CodemirrorModule, TheColumnSizeModule],
14053
- exports: [TheEditorComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarItemComponent, TheDefaultElementComponent],
15038
+ exports: [
15039
+ TheEditorComponent,
15040
+ TheToolbarComponent,
15041
+ TheToolbarDropdownComponent,
15042
+ TheToolbarItemComponent,
15043
+ TheDefaultElementComponent,
15044
+ TheListboxOptionDirective,
15045
+ TheListboxGroupDirective,
15046
+ TheListboxDirective
15047
+ ],
14054
15048
  providers: [
14055
15049
  {
14056
15050
  provide: TheToolbarGroupToken,
@@ -14061,32 +15055,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
14061
15055
  }]
14062
15056
  }] });
14063
15057
 
14064
- class TheBaseSuggestion {
14065
- handleMousedown(event) {
14066
- event.preventDefault();
14067
- }
14068
- }
14069
- TheBaseSuggestion.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheBaseSuggestion, deps: [], target: i0.ɵɵFactoryTarget.Directive });
14070
- TheBaseSuggestion.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: TheBaseSuggestion, inputs: { editor: "editor", type: "type", keywords: "keywords" }, host: { listeners: { "mousedown": "handleMousedown($event)" } }, ngImport: i0 });
14071
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheBaseSuggestion, decorators: [{
14072
- type: Directive
14073
- }], propDecorators: { editor: [{
14074
- type: Input
14075
- }], type: [{
14076
- type: Input
14077
- }], keywords: [{
14078
- type: Input
14079
- }], handleMousedown: [{
14080
- type: HostListener,
14081
- args: ['mousedown', ['$event']]
14082
- }] } });
14083
-
14084
15058
  class TheToolbarService {
14085
- initialize(toolbarItems, global = DefaultGlobalToolbarDefinition, inline = DefaultInlineToolbarDefinition, quick = DefaultQuickToolbarDefinition) {
15059
+ initialize(toolbarItems, global = DefaultGlobalToolbarDefinition, inline = DefaultInlineToolbarDefinition) {
14086
15060
  const toolbarDefinition = {
14087
15061
  global,
14088
- inline,
14089
- quick
15062
+ inline
14090
15063
  };
14091
15064
  const toolbarOperations = new Map();
14092
15065
  toolbarItems.forEach(i => toolbarOperations.set(i.key, i));
@@ -14140,5 +15113,5 @@ const withTestPlugin = (plugins, initValue) => {
14140
15113
  * Generated bundle index. Do not edit.
14141
15114
  */
14142
15115
 
14143
- export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETE_BACKWARD_TYPES, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, COMPONENTS, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, ColorEditor, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DISABLED_OPERATE_TYPES, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultQuickToolbarDefinition, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeadingEditor, HrEditor, IS_MAC, ImageEditor, IndentEditor, Indents, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LayoutTypes, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, MentionEditor, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, PluginKeys, QuickInsertEditor, STANDARD_HEADING_TYPES, TAB_SPACE, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_ORIGIN_ANCHOR, THE_EDITOR_POPOVER_REF, THE_EDITOR_QUICK_TOOLBAR_REF, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_MODE_PROVIDER, THE_MODE_TOKEN, THE_UPLOAD_SERVICE_TOKEN, TableEditor, TheBaseElementComponent, TheBaseSuggestion, TheBaseToolbarDropdown, TheBaseToolbarItem, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheMode, TheModeConfig, index$1 as TheQueries, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarGroupComponent, TheToolbarGroupToken, TheToolbarItemComponent, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemMode, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, ZERO_WIDTH_CHAR, autoFocus, autoScrollViewHandle, coercePixelsFromCssValue, combinePlugins, createEmptyParagraph, createMentionPlugin, createPluginFactory, createToolbar, createVerticalAlignPlugin, dataDeserialize, dataSerializing, deleteElementKey, extractFragment, filterTextFormat, flattenDeepPlugins, getColsTotalWidth, getEditorUUID, getElementClassByPrefix, getElementHeight, getElementWidth, getEndBlock, getPlugin, getPluginOptions, getPlugins, getRowsTotalHeight, getStartBlock, getToolbarClass, headingOptions, htmlToTheia, idCreator, inValidTypes, internalPlugins, isCleanEmptyParagraph, isDirectionKeydown, isPureEmptyParagraph, mergeArray, mergeDeepPlugins, mergeElementOptions, mergeOptions, nestedStructureByKey, plainToTheia, pluginsByKey, setEditorUUID, useElementStyle, withMention, withTestPlugin, withTheia };
15116
+ export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETE_BACKWARD_TYPES, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, COMPONENTS, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, ColorEditor, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DISABLED_OPERATE_TYPES, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultPluginMenu, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeadingEditor, HrEditor, IS_MAC, ImageEditor, IndentEditor, Indents, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LayoutTypes, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, MentionEditor, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, PluginKeys, PluginMenuIcons, PluginMenuSvgs, QuickInsertEditor, STANDARD_HEADING_TYPES, TAB_SPACE, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_ORIGIN_ANCHOR, THE_EDITOR_POPOVER_REF, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_LISTBOX_PARENT_GROUP_TOKEN, THE_LISTBOX_PARENT_OPTION_TOKEN, THE_LISTBOX_TOKEN, THE_MODE_PROVIDER, THE_MODE_TOKEN, THE_PLUGIN_MENU_REF, THE_UPLOAD_SERVICE_TOKEN, TableEditor, TheBaseElementComponent, TheBaseSuggestion, TheBaseToolbarDropdown, TheBaseToolbarItem, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheListboxDirective, TheListboxGroupDirective, TheListboxOptionDirective, TheMode, TheModeConfig, ThePluginMenu, ThePluginMenuItemType, index$1 as TheQueries, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarGroupComponent, TheToolbarGroupToken, TheToolbarItemComponent, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, ZERO_WIDTH_CHAR, autoFocus, autoScrollViewHandle, base64toBlob, buildPluginMenu, buildPluginMenuItemMap, coercePixelsFromCssValue, combinePlugins, createEmptyParagraph, createMentionPlugin, createPluginFactory, createToolbar, createVerticalAlignPlugin, dataDeserialize, dataSerializing, deleteElementKey, extractFragment, filterTextFormat, flattenDeepPlugins, getColsTotalWidth, getEditorUUID, getElementClassByPrefix, getElementHeight, getElementWidth, getEndBlock, getPlugin, getPluginOptions, getPlugins, getRowsTotalHeight, getStartBlock, getToolbarClass, headingOptions, htmlToTheia, idCreator, inValidTypes, internalPlugins, isCleanEmptyParagraph, isDirectionKeydown, isPureEmptyParagraph, mergeArray, mergeDeepPlugins, mergeElementOptions, mergeOptions, nestedStructureByKey, plainToTheia, pluginsByKey, recursionNodes, setEditorUUID, useElementStyle, withMention, withTestPlugin, withTheia };
14144
15117
  //# sourceMappingURL=worktile-theia.mjs.map