@worktile/theia 2.1.0 → 2.1.4

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 (48) hide show
  1. package/bundles/worktile-theia.umd.js +238 -172
  2. package/bundles/worktile-theia.umd.js.map +1 -1
  3. package/components/toolbar/toolbar.component.d.ts +4 -1
  4. package/components/toolbar/toolbar.component.scss +2 -0
  5. package/components/toolbar-dropdown/toolbar-dropdown.component.d.ts +7 -5
  6. package/components/toolbar-dropdown/toolbar-dropdown.component.scss +2 -0
  7. package/components/toolbar-item/toolbar-item.component.d.ts +3 -0
  8. package/constants/default.d.ts +0 -1
  9. package/constants/node-types.d.ts +15 -0
  10. package/editor.module.d.ts +43 -45
  11. package/esm2015/components/inline-toolbar/inline-toolbar.component.js +1 -1
  12. package/esm2015/components/toolbar/toolbar.component.js +18 -6
  13. package/esm2015/components/toolbar-dropdown/toolbar-dropdown.component.js +14 -5
  14. package/esm2015/components/toolbar-group/toolbar-group.component.js +1 -1
  15. package/esm2015/components/toolbar-item/toolbar-item.component.js +20 -6
  16. package/esm2015/constants/default.js +1 -2
  17. package/esm2015/constants/node-types.js +29 -1
  18. package/esm2015/editor.component.js +7 -6
  19. package/esm2015/editor.module.js +3 -6
  20. package/esm2015/interfaces/editor.js +1 -1
  21. package/esm2015/interfaces/toolbar.js +1 -1
  22. package/esm2015/plugins/align/options.js +2 -1
  23. package/esm2015/plugins/code/code.component.js +2 -2
  24. package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -2
  25. package/esm2015/plugins/font-size/font-size.editor.js +47 -0
  26. package/esm2015/plugins/font-size/options.js +20 -6
  27. package/esm2015/plugins/heading/heading.editor.js +13 -2
  28. package/esm2015/plugins/heading/options.js +2 -1
  29. package/esm2015/plugins/list/components/list-item.component.js +43 -1
  30. package/esm2015/plugins/mark/mark.plugin.js +15 -10
  31. package/esm2015/plugins/table/table.editor.js +1 -1
  32. package/esm2015/services/toolbar.service.js +2 -2
  33. package/fesm2015/worktile-theia.js +202 -144
  34. package/fesm2015/worktile-theia.js.map +1 -1
  35. package/interfaces/editor.d.ts +3 -1
  36. package/interfaces/toolbar.d.ts +2 -1
  37. package/package.json +1 -1
  38. package/plugins/code/code.component.scss +1 -1
  39. package/plugins/font-size/font-size.editor.d.ts +8 -0
  40. package/plugins/font-size/options.d.ts +0 -1
  41. package/plugins/font-size/toolbar-item.component.scss +1 -11
  42. package/plugins/heading/heading.editor.d.ts +1 -1
  43. package/plugins/list/components/list-item.component.d.ts +4 -0
  44. package/plugins/table/table.editor.d.ts +1 -1
  45. package/styles/editor.scss +18 -1
  46. package/styles/typo.scss +2 -1
  47. package/esm2015/plugins/font-size/toolbar-item.component.js +0 -129
  48. package/plugins/font-size/toolbar-item.component.d.ts +0 -35
@@ -375,7 +375,6 @@
375
375
  var A_TAG_REL_ATTR = 'noopener noreferrer nofollow external ugc';
376
376
  var LINK_DEFAULT_TEXT = '链接';
377
377
  var TAB_SPACE = ' ';
378
- var ZERO_WIDTH_CHAR = '\u200B';
379
378
  var CLIPBOARD_FORMAT_KEY = 'x-theia-fragment';
380
379
  var DEFAULT_SCROLL_CONTAINER = '.the-editable-container';
381
380
  var ELEMENT_UNIQUE_ID = 'key';
@@ -422,6 +421,34 @@
422
421
  VerticalAlignment["middle"] = "middle";
423
422
  VerticalAlignment["bottom"] = "bottom";
424
423
  })(exports.VerticalAlignment || (exports.VerticalAlignment = {}));
424
+ exports.FontSizes = void 0;
425
+ (function (FontSizes) {
426
+ FontSizes["fontSize12"] = "12";
427
+ FontSizes["fontSize13"] = "13";
428
+ FontSizes["fontSize14"] = "14";
429
+ FontSizes["fontSize15"] = "15";
430
+ FontSizes["fontSize16"] = "16";
431
+ FontSizes["fontSize18"] = "18";
432
+ FontSizes["fontSize20"] = "20";
433
+ FontSizes["fontSize24"] = "24";
434
+ FontSizes["fontSize28"] = "28";
435
+ FontSizes["fontSize32"] = "32";
436
+ FontSizes["fontSize40"] = "40";
437
+ FontSizes["fontSize48"] = "48";
438
+ })(exports.FontSizes || (exports.FontSizes = {}));
439
+ var FontSizeTypes = [
440
+ exports.FontSizes.fontSize12,
441
+ exports.FontSizes.fontSize13,
442
+ exports.FontSizes.fontSize14,
443
+ exports.FontSizes.fontSize15,
444
+ exports.FontSizes.fontSize16,
445
+ exports.FontSizes.fontSize20,
446
+ exports.FontSizes.fontSize24,
447
+ exports.FontSizes.fontSize28,
448
+ exports.FontSizes.fontSize32,
449
+ exports.FontSizes.fontSize40,
450
+ exports.FontSizes.fontSize48
451
+ ];
425
452
  exports.MarkTypes = void 0;
426
453
  (function (MarkTypes) {
427
454
  MarkTypes["bold"] = "bold";
@@ -2421,7 +2448,7 @@
2421
2448
  editor: editor,
2422
2449
  conversion: function () {
2423
2450
  try {
2424
- var html = marked__default["default"](plainFragment, { gfm: true });
2451
+ var html = marked__default["default"](plainFragment.replace(/\n```/g, "\n\n```"), { gfm: true });
2425
2452
  var htmlDom = new DOMParser().parseFromString(html, 'text/html');
2426
2453
  var fragment_1 = selene.TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
2427
2454
  if (!isUnformatted(fragment_1)) {
@@ -3811,9 +3838,59 @@
3811
3838
  TheListItemComponent.prototype.ngOnInit = function () {
3812
3839
  _super.prototype.ngOnInit.call(this);
3813
3840
  };
3841
+ TheListItemComponent.prototype.onContextChange = function () {
3842
+ _super.prototype.onContextChange.call(this);
3843
+ this.applyFontSize();
3844
+ };
3814
3845
  TheListItemComponent.prototype.ngOnDestroy = function () {
3815
3846
  _super.prototype.ngOnDestroy.call(this);
3816
3847
  };
3848
+ TheListItemComponent.prototype.applyFontSize = function () {
3849
+ var e_1, _c;
3850
+ var _a, _b;
3851
+ var firstText;
3852
+ try {
3853
+ for (var _d = __values(slate.Node.descendants(this.element)), _e = _d.next(); !_e.done; _e = _d.next()) {
3854
+ var entry = _e.value;
3855
+ var node = entry[0];
3856
+ if (slate.Text.isText(node) && !firstText) {
3857
+ firstText = node;
3858
+ break;
3859
+ }
3860
+ }
3861
+ }
3862
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3863
+ finally {
3864
+ try {
3865
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
3866
+ }
3867
+ finally { if (e_1) throw e_1.error; }
3868
+ }
3869
+ if (!firstText) {
3870
+ return;
3871
+ }
3872
+ var text = firstText.text, rest = __rest(firstText, ["text"]);
3873
+ var size = rest[exports.MarkTypes.fontSize];
3874
+ if (size) {
3875
+ var sizeClass = "font-size-" + size;
3876
+ var isContains = (_b = (_a = this.elementRef.nativeElement) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.contains(sizeClass);
3877
+ if (isContains) {
3878
+ return;
3879
+ }
3880
+ this.clearFontSize();
3881
+ this.elementRef.nativeElement.classList.add(sizeClass);
3882
+ this.fontSizeClass = sizeClass;
3883
+ }
3884
+ else {
3885
+ this.clearFontSize();
3886
+ }
3887
+ };
3888
+ TheListItemComponent.prototype.clearFontSize = function () {
3889
+ if (this.fontSizeClass) {
3890
+ this.elementRef.nativeElement.classList.remove(this.fontSizeClass);
3891
+ this.fontSizeClass = null;
3892
+ }
3893
+ };
3817
3894
  return TheListItemComponent;
3818
3895
  }(TheBaseElementComponent));
3819
3896
  TheListItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheListItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
@@ -4322,11 +4399,14 @@
4322
4399
  delete marks[key];
4323
4400
  editor.marks = marks;
4324
4401
  var text = slate.Editor.string(e, selection.anchor.path);
4325
- if (text === ZERO_WIDTH_CHAR) {
4326
- slate.Transforms.unsetNodes(e, key, { at: selection.anchor.path });
4402
+ if (text !== '') {
4403
+ slate.Editor.setNormalizing(editor, false);
4404
+ e.insertText('');
4405
+ editor.marks = marks;
4406
+ slate.Editor.setNormalizing(editor, true);
4327
4407
  }
4328
- if (text !== ZERO_WIDTH_CHAR && text !== '') {
4329
- e.insertText(ZERO_WIDTH_CHAR);
4408
+ else {
4409
+ slate.Transforms.unsetNodes(e, key, { at: selection.anchor.path });
4330
4410
  }
4331
4411
  if (shouldChange) {
4332
4412
  editor.onChange();
@@ -4345,11 +4425,14 @@
4345
4425
  var marks = Object.assign(Object.assign({}, (slate.Editor.marks(e) || {})), (_b = {}, _b[key] = value, _b));
4346
4426
  editor.marks = marks;
4347
4427
  var text = slate.Editor.string(e, selection.anchor.path);
4348
- if (text === ZERO_WIDTH_CHAR) {
4349
- slate.Transforms.setNodes(e, (_c = {}, _c[key] = value, _c), { at: selection.anchor.path });
4428
+ if (text !== '') {
4429
+ slate.Editor.setNormalizing(editor, false);
4430
+ e.insertText('');
4431
+ editor.marks = marks;
4432
+ slate.Editor.setNormalizing(editor, true);
4350
4433
  }
4351
- if (text !== ZERO_WIDTH_CHAR && text !== '') {
4352
- e.insertText(ZERO_WIDTH_CHAR);
4434
+ else {
4435
+ slate.Transforms.setNodes(e, (_c = {}, _c[key] = value, _c), { at: selection.anchor.path });
4353
4436
  }
4354
4437
  }
4355
4438
  }
@@ -6018,6 +6101,7 @@
6018
6101
  var HeadingEditor = {
6019
6102
  setHeading: function (editor, heading) {
6020
6103
  slate.Editor.withoutNormalizing(editor, function () {
6104
+ var _a;
6021
6105
  var types = [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList, exports.ElementKinds.listItem];
6022
6106
  slate.Transforms.unwrapNodes(editor, {
6023
6107
  at: editor.selection,
@@ -6026,6 +6110,15 @@
6026
6110
  split: true
6027
6111
  });
6028
6112
  slate.Transforms.setNodes(editor, { type: heading });
6113
+ var entry = anchorBlockEntry(editor);
6114
+ var unMarks = (_a = {},
6115
+ _a[exports.MarkTypes.fontSize] = null,
6116
+ _a);
6117
+ if (entry) {
6118
+ setMarks(editor, unMarks, entry[1]);
6119
+ return;
6120
+ }
6121
+ setMarks(editor, unMarks, editor.selection);
6029
6122
  });
6030
6123
  },
6031
6124
  isHeadingActive: function (editor, heading) {
@@ -6042,6 +6135,7 @@
6042
6135
  name: '正文',
6043
6136
  key: exports.ElementKinds.headingList,
6044
6137
  type: exports.ToolbarItemType.toolDropdown,
6138
+ dropdownItemKey: exports.ElementKinds.paragraph,
6045
6139
  includes: __spreadArray([exports.ElementKinds.paragraph], __read(STANDARD_HEADING_TYPES))
6046
6140
  },
6047
6141
  {
@@ -6136,6 +6230,7 @@
6136
6230
  key: exports.ToolbarActionTypes.alignType,
6137
6231
  type: exports.ToolbarItemType.toolDropdown,
6138
6232
  dropdownMode: exports.DropdownMode.icon,
6233
+ dropdownItemKey: exports.ToolbarActionTypes.alignLeft,
6139
6234
  includes: [exports.ToolbarActionTypes.alignLeft, exports.ToolbarActionTypes.alignCenter, exports.ToolbarActionTypes.alignRight],
6140
6235
  name: '对齐方式'
6141
6236
  },
@@ -6734,6 +6829,7 @@
6734
6829
  _this.overlay = overlay;
6735
6830
  _this.mode = exports.DropdownMode.text;
6736
6831
  _this.dropdownMode = exports.DropdownMode;
6832
+ _this.disabled = false;
6737
6833
  return _this;
6738
6834
  }
6739
6835
  Object.defineProperty(TheToolbarDropdownComponent.prototype, "item", {
@@ -6757,7 +6853,7 @@
6757
6853
  TheToolbarDropdownComponent.prototype.toggleDropdown = function (event) {
6758
6854
  var _a;
6759
6855
  _super.prototype.execute.call(this, event);
6760
- if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) {
6856
+ if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled) {
6761
6857
  return;
6762
6858
  }
6763
6859
  this.openDropdownPopover();
@@ -6767,6 +6863,13 @@
6767
6863
  this.closeDropdownPopover();
6768
6864
  }
6769
6865
  };
6866
+ Object.defineProperty(TheToolbarDropdownComponent.prototype, "disabledState", {
6867
+ get: function () {
6868
+ return this.disabled;
6869
+ },
6870
+ enumerable: false,
6871
+ configurable: true
6872
+ });
6770
6873
  TheToolbarDropdownComponent.prototype.ngOnInit = function () {
6771
6874
  var _a;
6772
6875
  if (!this.template) {
@@ -6780,12 +6883,14 @@
6780
6883
  }
6781
6884
  };
6782
6885
  TheToolbarDropdownComponent.prototype.statusChange = function (editor) {
6886
+ var _a, _b;
6887
+ this.disabled = ((_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.disable) ? (_b = this.toolbarItem) === null || _b === void 0 ? void 0 : _b.disable(editor) : false;
6783
6888
  var activeItem = this.menus.find(function (i) {
6784
6889
  if (i === null || i === void 0 ? void 0 : i.active) {
6785
6890
  return i === null || i === void 0 ? void 0 : i.active(editor);
6786
6891
  }
6787
6892
  });
6788
- this.activeMenu = activeItem ? activeItem : this.menus[0];
6893
+ this.activeMenu = activeItem ? activeItem : this.item;
6789
6894
  };
6790
6895
  TheToolbarDropdownComponent.prototype.itemMousedown = function (event, item) {
6791
6896
  _super.prototype.execute.call(this, event);
@@ -6840,7 +6945,7 @@
6840
6945
  return TheToolbarDropdownComponent;
6841
6946
  }(TheToolbarBaseItemComponent));
6842
6947
  TheToolbarDropdownComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarDropdownComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }, { token: i2__namespace.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Component });
6843
- TheToolbarDropdownComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item", itemMousedownHandle: "itemMousedownHandle" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenu?.name }}</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i5__namespace$2.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
6948
+ TheToolbarDropdownComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item", itemMousedownHandle: "itemMousedownHandle" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenu?.name }}</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i5__namespace$2.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
6844
6949
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarDropdownComponent, decorators: [{
6845
6950
  type: i0.Component,
6846
6951
  args: [{
@@ -6875,6 +6980,9 @@
6875
6980
  }], handleDocumentMouseDown: [{
6876
6981
  type: i0.HostListener,
6877
6982
  args: ['document: mousedown', ['$event']]
6983
+ }], disabledState: [{
6984
+ type: i0.HostBinding,
6985
+ args: ['class.disabled']
6878
6986
  }] } });
6879
6987
 
6880
6988
  var NavSplitLineComponent = /** @class */ (function () {
@@ -7087,7 +7195,7 @@
7087
7195
  return TheCodeComponent;
7088
7196
  }(TheBaseElementComponent));
7089
7197
  TheCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheCodeComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$4.ThyNotifyService }, { token: TheContextService }, { token: i0__namespace.NgZone }, { token: THE_CODE_MODE_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
7090
- TheCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: i8.CodeMirrorComponent }], usesInheritance: true, ngImport: i0__namespace, template: "<div contenteditable=\"false\" class=\"the-code-block-operation\" *ngIf=\"isFocusCode && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"> </the-toolbar-dropdown>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n class=\"remove-link\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\n <span class=\"auto-wrap d-flex align-items-center\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex\"\n [(ngModel)]=\"element.autoWrap\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n </thy-icon-nav>\n</div>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n<div\n thyResizable\n [thyMinHeight]=\"42\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\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=\"isFocusCode && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["toolbarItem", "menus", "mode", "item", "itemMousedownHandle"] }, { type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i6__namespace$1.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i8__namespace.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }, { type: i9__namespace.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9__namespace.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
7198
+ TheCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: i8.CodeMirrorComponent }], usesInheritance: true, ngImport: i0__namespace, template: "<div contenteditable=\"false\" class=\"the-code-block-operation\" *ngIf=\"isFocusCode && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"> </the-toolbar-dropdown>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n class=\"remove-link\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\n <span class=\"auto-wrap d-flex align-items-center\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n </thy-icon-nav>\n</div>\n\n<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>\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=\"isFocusCode && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["toolbarItem", "menus", "mode", "item", "itemMousedownHandle"] }, { type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i6__namespace$1.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i8__namespace.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }, { type: i9__namespace.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9__namespace.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
7091
7199
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheCodeComponent, decorators: [{
7092
7200
  type: i0.Component,
7093
7201
  args: [{
@@ -11514,8 +11622,19 @@
11514
11622
  _this.itemMode = exports.ToolbarItemMode.horizontal;
11515
11623
  _this.ToolbarItemMode = exports.ToolbarItemMode;
11516
11624
  _this.active = false;
11625
+ _this.disabled = false;
11517
11626
  return _this;
11518
11627
  }
11628
+ TheToolbarItemComponent.prototype.toggleDropdown = function (event) {
11629
+ _super.prototype.execute.call(this, event);
11630
+ };
11631
+ Object.defineProperty(TheToolbarItemComponent.prototype, "disabledState", {
11632
+ get: function () {
11633
+ return this.disabled;
11634
+ },
11635
+ enumerable: false,
11636
+ configurable: true
11637
+ });
11519
11638
  TheToolbarItemComponent.prototype.ngOnInit = function () {
11520
11639
  var _a, _b;
11521
11640
  if (((_a = this.item) === null || _a === void 0 ? void 0 : _a.quickItemComponent) && i1.isComponentType((_b = this.item) === null || _b === void 0 ? void 0 : _b.quickItemComponent)) {
@@ -11523,13 +11642,14 @@
11523
11642
  }
11524
11643
  };
11525
11644
  TheToolbarItemComponent.prototype.statusChange = function (editor) {
11526
- var _a, _b;
11527
- this.active = ((_a = this.item) === null || _a === void 0 ? void 0 : _a.active) ? (_b = this.item) === null || _b === void 0 ? void 0 : _b.active(editor) : false;
11645
+ var _a, _b, _c, _d;
11646
+ this.disabled = ((_a = this.item) === null || _a === void 0 ? void 0 : _a.disable) ? (_b = this.item) === null || _b === void 0 ? void 0 : _b.disable(editor) : false;
11647
+ this.active = ((_c = this.item) === null || _c === void 0 ? void 0 : _c.active) ? (_d = this.item) === null || _d === void 0 ? void 0 : _d.active(editor) : false;
11528
11648
  };
11529
11649
  TheToolbarItemComponent.prototype.execute = function (event) {
11530
11650
  var _a, _b, _c;
11531
11651
  _super.prototype.execute.call(this, event);
11532
- if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11652
+ if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled || !((_b = this.item) === null || _b === void 0 ? void 0 : _b.execute)) {
11533
11653
  return;
11534
11654
  }
11535
11655
  (_c = this.item) === null || _c === void 0 ? void 0 : _c.execute(this.editor);
@@ -11547,7 +11667,7 @@
11547
11667
  return TheToolbarItemComponent;
11548
11668
  }(TheToolbarBaseItemComponent));
11549
11669
  TheToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, deps: [{ token: i0__namespace.NgZone }, { token: i0__namespace.ComponentFactoryResolver }], target: i0__namespace.ɵɵFactoryTarget.Component });
11550
- TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor", itemMode: "itemMode" }, host: { classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "\n <ng-container *ngIf=\"itemMode === ToolbarItemMode.horizontal; else selectionItem\">\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"tooltip\"\n [thyTooltipTemplateContext]=\"{ name: item.name, shortcutKey: item.shortcutKey }\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n </ng-container>\n <ng-template #selectionItem>\n <ng-container *ngIf=\"!item?.quickItemComponent\">\n <thy-icon [thyIconName]=\"item?.icon\" [thyIconRotate]=\"0\" class=\"quick-toolbar-icon\"></thy-icon>\n <span class=\"quick-toolbar-name\">{{ item?.name }}</span>\n </ng-container>\n </ng-template>\n <ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>\n <ng-container #toolbarContainer></ng-container>\n ", isInline: true, components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
11670
+ TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor", itemMode: "itemMode" }, host: { listeners: { "mousedown": "toggleDropdown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "\n <ng-container *ngIf=\"itemMode === ToolbarItemMode.horizontal; else selectionItem\">\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"tooltip\"\n [thyTooltipTemplateContext]=\"{ name: item.name, shortcutKey: item.shortcutKey }\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n </ng-container>\n <ng-template #selectionItem>\n <ng-container *ngIf=\"!item?.quickItemComponent\">\n <thy-icon [thyIconName]=\"item?.icon\" [thyIconRotate]=\"0\" class=\"quick-toolbar-icon\"></thy-icon>\n <span class=\"quick-toolbar-name\">{{ item?.name }}</span>\n </ng-container>\n </ng-template>\n <ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>\n <ng-container #toolbarContainer></ng-container>\n ", isInline: true, components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
11551
11671
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, decorators: [{
11552
11672
  type: i0.Component,
11553
11673
  args: [{
@@ -11566,6 +11686,12 @@
11566
11686
  }], toolbarContainer: [{
11567
11687
  type: i0.ViewChild,
11568
11688
  args: ['toolbarContainer', { read: i0.ViewContainerRef, static: true }]
11689
+ }], toggleDropdown: [{
11690
+ type: i0.HostListener,
11691
+ args: ['mousedown', ['$event']]
11692
+ }], disabledState: [{
11693
+ type: i0.HostBinding,
11694
+ args: ['class.disabled']
11569
11695
  }] } });
11570
11696
 
11571
11697
  var TheQuickToolbarComponent = /** @class */ (function (_super) {
@@ -11738,140 +11864,69 @@
11738
11864
  };
11739
11865
  };
11740
11866
 
11741
- var TheFontSizeToolbarItemComponent = /** @class */ (function (_super) {
11742
- __extends(TheFontSizeToolbarItemComponent, _super);
11743
- function TheFontSizeToolbarItemComponent(elementRef, thyPopover, viewContainerRef, overlay) {
11744
- var _this = _super.call(this) || this;
11745
- _this.elementRef = elementRef;
11746
- _this.thyPopover = thyPopover;
11747
- _this.viewContainerRef = viewContainerRef;
11748
- _this.overlay = overlay;
11749
- _this.fontSizes = FontSizes;
11750
- _this.disabled = false;
11751
- _this.disableGroup = HEADING_TYPES;
11752
- _this.toolbarItemContainer = true;
11753
- _this.fontSizeToolbarItem = true;
11754
- return _this;
11755
- }
11756
- Object.defineProperty(TheFontSizeToolbarItemComponent.prototype, "isOpen", {
11757
- get: function () {
11758
- return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
11759
- },
11760
- enumerable: false,
11761
- configurable: true
11762
- });
11763
- Object.defineProperty(TheFontSizeToolbarItemComponent.prototype, "disableClass", {
11764
- get: function () {
11765
- return this.disabled;
11766
- },
11767
- enumerable: false,
11768
- configurable: true
11769
- });
11770
- TheFontSizeToolbarItemComponent.prototype.toggleDropdown = function (event) {
11771
- var _a;
11772
- _super.prototype.execute.call(this, event);
11773
- if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled) {
11867
+ var FontSizeEditor = {
11868
+ setFontSize: function (editor, size) {
11869
+ if (TableEditor.toggleMark(editor, false, exports.MarkTypes.fontSize, Number(size))) {
11774
11870
  return;
11775
11871
  }
11776
- this.openDropdownPopover();
11777
- };
11778
- TheFontSizeToolbarItemComponent.prototype.handleDocumentMouseDown = function (event) {
11779
- if (!this.elementRef.nativeElement.contains(event.target)) {
11780
- this.closeDropdownPopover();
11781
- }
11782
- };
11783
- TheFontSizeToolbarItemComponent.prototype.ngOnInit = function () {
11784
- this.activeSize = this.fontSizes[2];
11785
- };
11786
- TheFontSizeToolbarItemComponent.prototype.statusChange = function (editor) {
11872
+ slate.Editor.addMark(editor, exports.MarkTypes.fontSize, Number(size));
11873
+ },
11874
+ isFontSizeActive: function (editor, size) {
11787
11875
  if (editor.selection) {
11788
11876
  var anchorBlock$1 = anchorBlock(editor);
11789
- if (anchorBlock$1 && this.disableGroup.includes(anchorBlock$1.type)) {
11790
- this.activeSize = null;
11791
- this.disabled = true;
11792
- return;
11877
+ switch (anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type) {
11878
+ case exports.ElementKinds.heading_1:
11879
+ return size === exports.FontSizes.fontSize28;
11880
+ case exports.ElementKinds.heading_2:
11881
+ return size === exports.FontSizes.fontSize24;
11882
+ case exports.ElementKinds.heading_3:
11883
+ return size === exports.FontSizes.fontSize20;
11884
+ case exports.ElementKinds.heading_4:
11885
+ return size === exports.FontSizes.fontSize18;
11886
+ case exports.ElementKinds.heading_5:
11887
+ return size === exports.FontSizes.fontSize16;
11888
+ case exports.ElementKinds.heading_6:
11889
+ return size === exports.FontSizes.fontSize14;
11890
+ case exports.ElementKinds.paragraph:
11891
+ var marks = getSelectionMarks(editor);
11892
+ var fontSizeMark = marks[exports.MarkTypes.fontSize];
11893
+ return Number(size) === fontSizeMark;
11894
+ default:
11895
+ return false;
11793
11896
  }
11794
- var marks = getSelectionMarks(editor);
11795
- var fontSizeMark = marks[exports.MarkTypes.fontSize];
11796
- this.activeSize = fontSizeMark ? fontSizeMark : this.fontSizes[2];
11797
- this.disabled = false;
11798
- }
11799
- };
11800
- TheFontSizeToolbarItemComponent.prototype.itemMousedown = function (event, size) {
11801
- var _a, _b;
11802
- _super.prototype.execute.call(this, event);
11803
- this.closeDropdownPopover();
11804
- if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.readOnly)) {
11805
- return;
11806
- }
11807
- var anchorBlock$1 = anchorBlock(this.editor);
11808
- if (anchorBlock$1 && this.disableGroup.includes(anchorBlock$1.type)) {
11809
- return;
11810
11897
  }
11811
- slate.Editor.addMark(this.editor, exports.MarkTypes.fontSize, size);
11812
- };
11813
- TheFontSizeToolbarItemComponent.prototype.openDropdownPopover = function () {
11814
- var _a;
11815
- this.dropdownPopoverRef = this.thyPopover.open(this.dropdownTemplate, {
11816
- origin: this.elementRef,
11817
- panelClass: ['the-toolbar-dropdown-popover', (_a = this.item) === null || _a === void 0 ? void 0 : _a.key],
11818
- placement: 'bottomLeft',
11819
- insideClosable: false,
11820
- backdropClosable: true,
11821
- hasBackdrop: false,
11822
- offset: 10,
11823
- viewContainerRef: this.viewContainerRef,
11824
- scrollStrategy: this.overlay.scrollStrategies.reposition()
11825
- });
11826
- };
11827
- TheFontSizeToolbarItemComponent.prototype.closeDropdownPopover = function () {
11828
- var _a;
11829
- if (this.dropdownPopoverRef) {
11830
- (_a = this.dropdownPopoverRef) === null || _a === void 0 ? void 0 : _a.close();
11898
+ return false;
11899
+ },
11900
+ isDisabled: function (editor) {
11901
+ if (editor.selection) {
11902
+ var disableGroup = HEADING_TYPES;
11903
+ var anchorBlock$1 = anchorBlock(editor);
11904
+ return anchorBlock$1 && disableGroup.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
11831
11905
  }
11832
- };
11833
- return TheFontSizeToolbarItemComponent;
11834
- }(TheToolbarBaseItemComponent));
11835
- TheFontSizeToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheFontSizeToolbarItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }, { token: i2__namespace.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Component });
11836
- TheFontSizeToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheFontSizeToolbarItemComponent, selector: "the-font-size-toolbar-item", inputs: { editor: "editor", item: "item" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.the-toolbar-dropdown-container": "this.toolbarItemContainer", "class.the-font-size-toolbar-item": "this.fontSizeToolbarItem", "class.disabled": "this.disableClass" } }, viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\">\n <span *ngIf=\"activeSize\" class=\"show-text\">{{ activeSize }}</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let size of fontSizes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"size === activeSize\"\n (mousedown)=\"itemMousedown($event, size)\"\n >\n <span thyActionMenuItemName>{{ size }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
11837
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheFontSizeToolbarItemComponent, decorators: [{
11838
- type: i0.Component,
11839
- args: [{
11840
- selector: 'the-font-size-toolbar-item',
11841
- templateUrl: './toolbar-item.component.html'
11842
- }]
11843
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i1__namespace$3.ThyPopover }, { type: i0__namespace.ViewContainerRef }, { type: i2__namespace.Overlay }]; }, propDecorators: { editor: [{
11844
- type: i0.Input
11845
- }], item: [{
11846
- type: i0.Input
11847
- }], dropdownTemplate: [{
11848
- type: i0.ViewChild,
11849
- args: ['dropdownTemplate', { static: true }]
11850
- }], toolbarItemContainer: [{
11851
- type: i0.HostBinding,
11852
- args: ['class.the-toolbar-dropdown-container']
11853
- }], fontSizeToolbarItem: [{
11854
- type: i0.HostBinding,
11855
- args: ['class.the-font-size-toolbar-item']
11856
- }], disableClass: [{
11857
- type: i0.HostBinding,
11858
- args: ['class.disabled']
11859
- }], toggleDropdown: [{
11860
- type: i0.HostListener,
11861
- args: ['mousedown', ['$event']]
11862
- }], handleDocumentMouseDown: [{
11863
- type: i0.HostListener,
11864
- args: ['document: mousedown', ['$event']]
11865
- }] } });
11906
+ return false;
11907
+ }
11908
+ };
11866
11909
 
11867
- var FontSizes = [12, 13, 14, 15, 16, 19, 22, 24, 29, 32, 40, 48];
11868
- var FontSizeOptions = [
11910
+ var sizeOptions = function () {
11911
+ return FontSizeTypes.map(function (fontSize) {
11912
+ return {
11913
+ key: fontSize,
11914
+ name: fontSize,
11915
+ execute: function (editor) { return FontSizeEditor.setFontSize(editor, fontSize); },
11916
+ active: function (editor) { return FontSizeEditor.isFontSizeActive(editor, fontSize); }
11917
+ };
11918
+ });
11919
+ };
11920
+ var FontSizeOptions = __spreadArray([
11869
11921
  {
11870
11922
  key: exports.MarkTypes.fontSize,
11871
11923
  name: '字号',
11872
- iconComponent: TheFontSizeToolbarItemComponent
11924
+ type: exports.ToolbarItemType.toolDropdown,
11925
+ dropdownItemKey: exports.FontSizes.fontSize14,
11926
+ includes: FontSizeTypes,
11927
+ disable: function (editor) { return FontSizeEditor.isDisabled(editor); }
11873
11928
  }
11874
- ];
11929
+ ], __read(sizeOptions()));
11875
11930
 
11876
11931
  var internalPlugins = [
11877
11932
  withTheHistory,
@@ -12076,9 +12131,9 @@
12076
12131
  }
12077
12132
  };
12078
12133
  TheToolbarComponent.prototype.setToolbarClass = function () {
12079
- var _a;
12134
+ var _b;
12080
12135
  if (this.editor && !!this.containerClass.length) {
12081
- (_a = this.elementRef.nativeElement.classList).add.apply(_a, __spreadArray([], __read(this.containerClass)));
12136
+ (_b = this.elementRef.nativeElement.classList).add.apply(_b, __spreadArray([], __read(this.containerClass)));
12082
12137
  }
12083
12138
  };
12084
12139
  TheToolbarComponent.prototype.resizeElement = function () {
@@ -12086,7 +12141,7 @@
12086
12141
  var editableElement = this.elementRef.nativeElement;
12087
12142
  // @ts-ignore
12088
12143
  this.resizeObserver = new ResizeObserver(function (entries) {
12089
- var e_1, _a;
12144
+ var e_1, _b;
12090
12145
  try {
12091
12146
  for (var entries_1 = __values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {
12092
12147
  var entry = entries_1_1.value;
@@ -12100,7 +12155,7 @@
12100
12155
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
12101
12156
  finally {
12102
12157
  try {
12103
- if (entries_1_1 && !entries_1_1.done && (_a = entries_1.return)) _a.call(entries_1);
12158
+ if (entries_1_1 && !entries_1_1.done && (_b = entries_1.return)) _b.call(entries_1);
12104
12159
  }
12105
12160
  finally { if (e_1) throw e_1.error; }
12106
12161
  }
@@ -12108,7 +12163,7 @@
12108
12163
  this.resizeObserver.observe(editableElement);
12109
12164
  };
12110
12165
  TheToolbarComponent.prototype.statusChange = function (editor) {
12111
- var e_2, _a;
12166
+ var e_2, _b;
12112
12167
  var toolbarItems = __spreadArray(__spreadArray([], __read(this.toolbarItems)), [this.moreGroupMenu]);
12113
12168
  try {
12114
12169
  for (var toolbarItems_1 = __values(toolbarItems), toolbarItems_1_1 = toolbarItems_1.next(); !toolbarItems_1_1.done; toolbarItems_1_1 = toolbarItems_1.next()) {
@@ -12124,7 +12179,7 @@
12124
12179
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
12125
12180
  finally {
12126
12181
  try {
12127
- if (toolbarItems_1_1 && !toolbarItems_1_1.done && (_a = toolbarItems_1.return)) _a.call(toolbarItems_1);
12182
+ if (toolbarItems_1_1 && !toolbarItems_1_1.done && (_b = toolbarItems_1.return)) _b.call(toolbarItems_1);
12128
12183
  }
12129
12184
  finally { if (e_2) throw e_2.error; }
12130
12185
  }
@@ -12136,7 +12191,7 @@
12136
12191
  var toolbarItems = this.toolbarItemsCompose();
12137
12192
  var items = toolbarItems.items, group = toolbarItems.group;
12138
12193
  this.ngZone.run(function () {
12139
- var e_3, _a;
12194
+ var e_3, _b;
12140
12195
  try {
12141
12196
  for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
12142
12197
  var item = items_1_1.value;
@@ -12150,7 +12205,7 @@
12150
12205
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
12151
12206
  finally {
12152
12207
  try {
12153
- if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
12208
+ if (items_1_1 && !items_1_1.done && (_b = items_1.return)) _b.call(items_1);
12154
12209
  }
12155
12210
  finally { if (e_3) throw e_3.error; }
12156
12211
  }
@@ -12173,7 +12228,7 @@
12173
12228
  * set aside 50px
12174
12229
  */
12175
12230
  TheToolbarComponent.prototype.toolbarItemsCompose = function () {
12176
- var e_4, _a;
12231
+ var e_4, _b;
12177
12232
  var elementWidth = this.isMore ? this.elementWidth : null;
12178
12233
  var maxItemWidth = 50;
12179
12234
  var defaultItemWidth = 35;
@@ -12183,8 +12238,8 @@
12183
12238
  var items = [];
12184
12239
  var group = [];
12185
12240
  try {
12186
- for (var _b = __values(this.toolbarItems), _c = _b.next(); !_c.done; _c = _b.next()) {
12187
- var item = _c.value;
12241
+ for (var _c = __values(this.toolbarItems), _d = _c.next(); !_d.done; _d = _c.next()) {
12242
+ var item = _d.value;
12188
12243
  if (!this.isMore) {
12189
12244
  items.push(item);
12190
12245
  continue;
@@ -12213,7 +12268,7 @@
12213
12268
  catch (e_4_1) { e_4 = { error: e_4_1 }; }
12214
12269
  finally {
12215
12270
  try {
12216
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
12271
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
12217
12272
  }
12218
12273
  finally { if (e_4) throw e_4.error; }
12219
12274
  }
@@ -12226,12 +12281,12 @@
12226
12281
  * externally designated more group
12227
12282
  */
12228
12283
  TheToolbarComponent.prototype.toolbarItemsAndMoreCompose = function () {
12229
- var e_5, _a;
12284
+ var e_5, _b;
12230
12285
  var items = [];
12231
12286
  var group = [];
12232
12287
  try {
12233
- for (var _b = __values(this.toolbarItems), _c = _b.next(); !_c.done; _c = _b.next()) {
12234
- var item = _c.value;
12288
+ for (var _c = __values(this.toolbarItems), _d = _c.next(); !_d.done; _d = _c.next()) {
12289
+ var item = _d.value;
12235
12290
  if (item.key === exports.ToolbarActionTypes.split) {
12236
12291
  items.push(item);
12237
12292
  continue;
@@ -12242,7 +12297,7 @@
12242
12297
  catch (e_5_1) { e_5 = { error: e_5_1 }; }
12243
12298
  finally {
12244
12299
  try {
12245
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
12300
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
12246
12301
  }
12247
12302
  finally { if (e_5) throw e_5.error; }
12248
12303
  }
@@ -12269,14 +12324,15 @@
12269
12324
  });
12270
12325
  };
12271
12326
  TheToolbarComponent.prototype.createToolbarItem = function (item) {
12272
- var iconComponent = item.iconComponent, type = item.type, dropdownMode = item.dropdownMode, args = __rest(item, ["iconComponent", "type", "dropdownMode"]);
12327
+ var iconComponent = item.iconComponent, type = item.type, dropdownMode = item.dropdownMode, dropdownItemKey = item.dropdownItemKey, includes = item.includes, args = __rest(item, ["iconComponent", "type", "dropdownMode", "dropdownItemKey", "includes"]);
12273
12328
  var viewComponent = this.viewComponentType(type);
12329
+ var dropdownItem = this.getDropdownItem(item);
12274
12330
  var factory = this.cfr.resolveComponentFactory(iconComponent ? iconComponent : viewComponent);
12275
12331
  var compRef = this.toolbarContainer.createComponent(factory);
12276
12332
  compRef.instance.editor = this.editor;
12277
12333
  compRef.instance.toolbarItem = item;
12278
- compRef.instance.menus = args.includes;
12279
- compRef.instance.item = (args === null || args === void 0 ? void 0 : args.includes) && args.includes.length > 0 ? args.includes[0] : args;
12334
+ compRef.instance.menus = includes;
12335
+ compRef.instance.item = includes && dropdownItem ? dropdownItem : args;
12280
12336
  compRef.instance.mode = dropdownMode;
12281
12337
  this.components.set(item.key, compRef);
12282
12338
  };
@@ -12303,10 +12359,19 @@
12303
12359
  }
12304
12360
  return TheToolbarItemComponent;
12305
12361
  };
12362
+ TheToolbarComponent.prototype.getDropdownItem = function (item) {
12363
+ var _a;
12364
+ var dropdownKey = item === null || item === void 0 ? void 0 : item.dropdownItemKey;
12365
+ // modify the fontsize option externally
12366
+ if (item.key === exports.MarkTypes.fontSize && this.fontSize) {
12367
+ dropdownKey = this.fontSize;
12368
+ }
12369
+ return (_a = item === null || item === void 0 ? void 0 : item.includes) === null || _a === void 0 ? void 0 : _a.find(function (item) { return item.key === dropdownKey; });
12370
+ };
12306
12371
  return TheToolbarComponent;
12307
12372
  }());
12308
12373
  TheToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarComponent, deps: [{ token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }, { token: TheToolbarGroupToken }], target: i0__namespace.ɵɵFactoryTarget.Component });
12309
- TheToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarComponent, selector: "the-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems", align: "align", containerClass: "containerClass", isMore: "isMore", afterTemplate: "afterTemplate" }, host: { classAttribute: "the-toolbar-container" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<thy-icon-nav [style.justifyContent]=\"align\">\n <ng-container #toolbarContainer></ng-container>\n <ng-content></ng-content>\n <ng-template *ngIf=\"afterTemplate\" [ngTemplateOutlet]=\"afterTemplate\"></ng-template>\n</thy-icon-nav>\n", components: [{ type: i3__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
12374
+ TheToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarComponent, selector: "the-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems", align: "align", fontSize: "fontSize", containerClass: "containerClass", isMore: "isMore", afterTemplate: "afterTemplate" }, host: { classAttribute: "the-toolbar-container" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<thy-icon-nav [style.justifyContent]=\"align\">\n <ng-container #toolbarContainer></ng-container>\n <ng-content></ng-content>\n <ng-template *ngIf=\"afterTemplate\" [ngTemplateOutlet]=\"afterTemplate\"></ng-template>\n</thy-icon-nav>\n", components: [{ type: i3__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
12310
12375
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarComponent, decorators: [{
12311
12376
  type: i0.Component,
12312
12377
  args: [{
@@ -12327,6 +12392,8 @@
12327
12392
  type: i0.Input
12328
12393
  }], align: [{
12329
12394
  type: i0.Input
12395
+ }], fontSize: [{
12396
+ type: i0.Input
12330
12397
  }], containerClass: [{
12331
12398
  type: i0.Input
12332
12399
  }], isMore: [{
@@ -12447,7 +12514,7 @@
12447
12514
  return TheInlineToolbarComponent;
12448
12515
  }());
12449
12516
  TheInlineToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i2__namespace.ScrollDispatcher }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
12450
- TheInlineToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems" }, host: { properties: { "class.hide": "toolbarItems.length === 0" } }, viewQueries: [{ propertyName: "inlineToolbar", first: true, predicate: ["inlineToolbar"], descendants: true }], ngImport: i0__namespace, template: "<the-toolbar\n #inlineToolbar\n class=\"the-inline-toolbar\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarItems\"\n [isMore]=\"false\"\n ></the-toolbar> ", isInline: true, components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
12517
+ TheInlineToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems" }, host: { properties: { "class.hide": "toolbarItems.length === 0" } }, viewQueries: [{ propertyName: "inlineToolbar", first: true, predicate: ["inlineToolbar"], descendants: true }], ngImport: i0__namespace, template: "<the-toolbar\n #inlineToolbar\n class=\"the-inline-toolbar\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarItems\"\n [isMore]=\"false\"\n ></the-toolbar> ", isInline: true, components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "fontSize", "containerClass", "isMore", "afterTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
12451
12518
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, decorators: [{
12452
12519
  type: i0.Component,
12453
12520
  args: [{
@@ -12709,14 +12776,14 @@
12709
12776
  return leaf ? leaf : null;
12710
12777
  };
12711
12778
  _this.renderText = function (text) {
12712
- if (text.text.length === 0) {
12713
- return;
12714
- }
12715
12779
  for (var key in exports.MarkTypes) {
12716
12780
  if (text[exports.MarkTypes[key]]) {
12717
12781
  return TheTextComponent;
12718
12782
  }
12719
12783
  }
12784
+ if (text.text.length === 0) {
12785
+ return;
12786
+ }
12720
12787
  };
12721
12788
  _this.onKeyDown = function (event) {
12722
12789
  shortcuts(_this.editor, event);
@@ -12872,7 +12939,7 @@
12872
12939
  }
12873
12940
  };
12874
12941
  TheEditorComponent.prototype.toolbarCalculate = function () {
12875
- var _a;
12942
+ var _a, _b;
12876
12943
  var toolbar = (_a = this === null || this === void 0 ? void 0 : this.theOptions) === null || _a === void 0 ? void 0 : _a.toolbar;
12877
12944
  var toolbarItems = toolbarCompose(toolbar === null || toolbar === void 0 ? void 0 : toolbar.toolbarItems);
12878
12945
  var toolbarOption = this.toolbarService.initialize(toolbarItems, toolbar === null || toolbar === void 0 ? void 0 : toolbar.global, toolbar === null || toolbar === void 0 ? void 0 : toolbar.inline, toolbar === null || toolbar === void 0 ? void 0 : toolbar.quick);
@@ -12883,6 +12950,7 @@
12883
12950
  this.theGlobalToolbarInstance.toolbarItems = toolbarOption.toolbarEntity.global;
12884
12951
  this.theGlobalToolbarInstance.containerClass = this.globalToolbarClass;
12885
12952
  this.theGlobalToolbarInstance.align = toolbar === null || toolbar === void 0 ? void 0 : toolbar.align;
12953
+ this.theGlobalToolbarInstance.fontSize = (_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.fontSize;
12886
12954
  this.theGlobalToolbarInstance.setToolbarClass();
12887
12955
  this.theGlobalToolbarInstance.renderToolbarView();
12888
12956
  }
@@ -13037,7 +13105,7 @@
13037
13105
  useExisting: i0.forwardRef(function () { return TheEditorComponent; }),
13038
13106
  multi: true
13039
13107
  }
13040
- ], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\"></div>\n <div #placeholder thePlaceholder [editor]=\"editor\" [options]=\"theOptions\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { type: i1__namespace.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"] }, { type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems"] }, { type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: ["editor", "options"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
13108
+ ], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n [fontSize]=\"theOptions?.fontSize\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\"></div>\n <div #placeholder thePlaceholder [editor]=\"editor\" [options]=\"theOptions\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "fontSize", "containerClass", "isMore", "afterTemplate"] }, { type: i1__namespace.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"] }, { type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems"] }, { type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: ["editor", "options"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
13041
13109
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheEditorComponent, decorators: [{
13042
13110
  type: i0.Component,
13043
13111
  args: [{
@@ -13218,7 +13286,7 @@
13218
13286
  return TheToolbarGroupComponent;
13219
13287
  }());
13220
13288
  TheToolbarGroupComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarGroupComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
13221
- TheToolbarGroupComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarGroupComponent, selector: "the-toolbar-group", inputs: { menus: "menus", item: "item" }, host: { listeners: { "mousedown": "mousedownHandler($event)", "click": "clickHandle($event)" }, classAttribute: "the-toolbar-group" }, viewQueries: [{ propertyName: "groupTemplate", first: true, predicate: ["groupTemplate"], descendants: true, read: i0.TemplateRef, static: true }], ngImport: i0__namespace, template: "<a thyIconNavLink [thyIconNavLinkIcon]=\"item.icon\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\" [thyIconNavLinkActive]=\"active\"></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n", components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
13289
+ TheToolbarGroupComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarGroupComponent, selector: "the-toolbar-group", inputs: { menus: "menus", item: "item" }, host: { listeners: { "mousedown": "mousedownHandler($event)", "click": "clickHandle($event)" }, classAttribute: "the-toolbar-group" }, viewQueries: [{ propertyName: "groupTemplate", first: true, predicate: ["groupTemplate"], descendants: true, read: i0.TemplateRef, static: true }], ngImport: i0__namespace, template: "<a thyIconNavLink [thyIconNavLinkIcon]=\"item.icon\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\" [thyIconNavLinkActive]=\"active\"></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n", components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "fontSize", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
13222
13290
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarGroupComponent, decorators: [{
13223
13291
  type: i0.Component,
13224
13292
  args: [{
@@ -13280,8 +13348,7 @@
13280
13348
  TheTableSelectComponent,
13281
13349
  TheTableToolbarItemComponent,
13282
13350
  TheConversionHintComponent,
13283
- TheVerticalToolbarItemComponent,
13284
- TheFontSizeToolbarItemComponent
13351
+ TheVerticalToolbarItemComponent
13285
13352
  ];
13286
13353
  var PLUGIN_COMPONENTS = [
13287
13354
  TheImageComponent,
@@ -13327,8 +13394,7 @@
13327
13394
  TheTableSelectComponent,
13328
13395
  TheTableToolbarItemComponent,
13329
13396
  TheConversionHintComponent,
13330
- TheVerticalToolbarItemComponent,
13331
- TheFontSizeToolbarItemComponent, TheImageComponent,
13397
+ TheVerticalToolbarItemComponent, TheImageComponent,
13332
13398
  TheTemplateComponent,
13333
13399
  TheHrComponent,
13334
13400
  TheBlockquoteComponent,
@@ -13415,6 +13481,7 @@
13415
13481
  exports.DefaultInlineToolbarDefinition = DefaultInlineToolbarDefinition;
13416
13482
  exports.DefaultQuickToolbarDefinition = DefaultQuickToolbarDefinition;
13417
13483
  exports.ELEMENT_UNIQUE_ID = ELEMENT_UNIQUE_ID;
13484
+ exports.FontSizeTypes = FontSizeTypes;
13418
13485
  exports.HEADING_TYPES = HEADING_TYPES;
13419
13486
  exports.HeadingEditor = HeadingEditor;
13420
13487
  exports.HrEditor = HrEditor;
@@ -13462,7 +13529,6 @@
13462
13529
  exports.ToolbarMoreGroup = ToolbarMoreGroup;
13463
13530
  exports.VOID_BLOCK_TYPES = VOID_BLOCK_TYPES;
13464
13531
  exports.VerticalAlignEditor = VerticalAlignEditor;
13465
- exports.ZERO_WIDTH_CHAR = ZERO_WIDTH_CHAR;
13466
13532
  exports.createEmptyParagraph = createEmptyParagraph;
13467
13533
  exports.dataDeserialize = dataDeserialize;
13468
13534
  exports.dataSerializing = dataSerializing;