@worktile/theia 2.1.8 → 2.1.12

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.
@@ -506,73 +506,6 @@
506
506
  var VOID_BLOCK_TYPES = [exports.ElementKinds.image, exports.ElementKinds.hr];
507
507
  var BLOCK_DELETEBACKWARD_TYPES = [exports.ElementKinds.tableCell];
508
508
 
509
- var TheToolbarGroupToken = new i0.InjectionToken('the-toolbar-group-token');
510
- var QUICK_TOOLBAR_HOTKEY = '/';
511
- exports.DropdownMode = void 0;
512
- (function (DropdownMode) {
513
- DropdownMode["icon"] = "icon-mode";
514
- DropdownMode["text"] = "text-mode";
515
- })(exports.DropdownMode || (exports.DropdownMode = {}));
516
- exports.ToolbarItemMode = void 0;
517
- (function (ToolbarItemMode) {
518
- ToolbarItemMode[ToolbarItemMode["horizontal"] = 0] = "horizontal";
519
- ToolbarItemMode[ToolbarItemMode["vertical"] = 1] = "vertical";
520
- })(exports.ToolbarItemMode || (exports.ToolbarItemMode = {}));
521
- var DefaultGlobalToolbarDefinition = [
522
- exports.ElementKinds.headingList,
523
- exports.ToolbarActionTypes.split,
524
- exports.MarkTypes.bold,
525
- exports.MarkTypes.italic,
526
- exports.MarkTypes.underline,
527
- exports.MarkTypes.strike,
528
- exports.ElementKinds.inlineCode,
529
- exports.MarkTypes.color,
530
- exports.MarkTypes.backgroundColor,
531
- exports.ToolbarActionTypes.split,
532
- exports.ToolbarActionTypes.alignType,
533
- exports.ToolbarActionTypes.verticalAlign,
534
- exports.ToolbarActionTypes.split,
535
- exports.ElementKinds.numberedList,
536
- exports.ElementKinds.bulletedList,
537
- exports.ToolbarActionTypes.split,
538
- exports.ElementKinds.link,
539
- exports.ElementKinds.image,
540
- exports.ElementKinds.table,
541
- exports.ElementKinds.blockquote,
542
- exports.ElementKinds.code
543
- ];
544
- var DefaultInlineToolbarDefinition = [
545
- exports.ToolbarActionTypes.clean,
546
- exports.ToolbarActionTypes.split,
547
- exports.MarkTypes.bold,
548
- exports.MarkTypes.italic,
549
- exports.MarkTypes.underline,
550
- exports.MarkTypes.strike,
551
- exports.ElementKinds.inlineCode,
552
- exports.MarkTypes.color,
553
- exports.MarkTypes.backgroundColor,
554
- exports.ToolbarActionTypes.split,
555
- exports.ToolbarActionTypes.alignType,
556
- exports.ToolbarActionTypes.split,
557
- exports.ElementKinds.link
558
- ];
559
- var DefaultQuickToolbarDefinition = __spreadArray(__spreadArray([], __read(STANDARD_HEADING_TYPES)), [
560
- exports.ToolbarActionTypes.split,
561
- exports.ElementKinds.numberedList,
562
- exports.ElementKinds.bulletedList,
563
- exports.ToolbarActionTypes.split,
564
- exports.ElementKinds.link,
565
- exports.ElementKinds.image,
566
- exports.ElementKinds.table,
567
- exports.ElementKinds.blockquote,
568
- exports.ElementKinds.hr,
569
- exports.ElementKinds.code
570
- ]);
571
- var ToolbarMoreGroup = {
572
- key: 'more',
573
- icon: 'more'
574
- };
575
-
576
509
  exports.ErrorCodes = void 0;
577
510
  (function (ErrorCodes) {
578
511
  ErrorCodes[ErrorCodes["UNKNOW_ERROR"] = 1000] = "UNKNOW_ERROR";
@@ -665,6 +598,73 @@
665
598
  };
666
599
  var CODEMIRROR_PADDING_TOP = 10;
667
600
 
601
+ var TheToolbarGroupToken = new i0.InjectionToken('the-toolbar-group-token');
602
+ var QUICK_TOOLBAR_HOTKEY = '/';
603
+ exports.DropdownMode = void 0;
604
+ (function (DropdownMode) {
605
+ DropdownMode["icon"] = "icon-mode";
606
+ DropdownMode["text"] = "text-mode";
607
+ })(exports.DropdownMode || (exports.DropdownMode = {}));
608
+ exports.ToolbarItemMode = void 0;
609
+ (function (ToolbarItemMode) {
610
+ ToolbarItemMode[ToolbarItemMode["horizontal"] = 0] = "horizontal";
611
+ ToolbarItemMode[ToolbarItemMode["vertical"] = 1] = "vertical";
612
+ })(exports.ToolbarItemMode || (exports.ToolbarItemMode = {}));
613
+ var DefaultGlobalToolbarDefinition = [
614
+ exports.ElementKinds.headingList,
615
+ exports.ToolbarActionTypes.split,
616
+ exports.MarkTypes.bold,
617
+ exports.MarkTypes.italic,
618
+ exports.MarkTypes.underline,
619
+ exports.MarkTypes.strike,
620
+ exports.ElementKinds.inlineCode,
621
+ exports.MarkTypes.color,
622
+ exports.MarkTypes.backgroundColor,
623
+ exports.ToolbarActionTypes.split,
624
+ exports.ToolbarActionTypes.alignType,
625
+ exports.ToolbarActionTypes.verticalAlign,
626
+ exports.ToolbarActionTypes.split,
627
+ exports.ElementKinds.numberedList,
628
+ exports.ElementKinds.bulletedList,
629
+ exports.ToolbarActionTypes.split,
630
+ exports.ElementKinds.link,
631
+ exports.ElementKinds.image,
632
+ exports.ElementKinds.table,
633
+ exports.ElementKinds.blockquote,
634
+ exports.ElementKinds.code
635
+ ];
636
+ var DefaultInlineToolbarDefinition = [
637
+ exports.ToolbarActionTypes.clean,
638
+ exports.ToolbarActionTypes.split,
639
+ exports.MarkTypes.bold,
640
+ exports.MarkTypes.italic,
641
+ exports.MarkTypes.underline,
642
+ exports.MarkTypes.strike,
643
+ exports.ElementKinds.inlineCode,
644
+ exports.MarkTypes.color,
645
+ exports.MarkTypes.backgroundColor,
646
+ exports.ToolbarActionTypes.split,
647
+ exports.ToolbarActionTypes.alignType,
648
+ exports.ToolbarActionTypes.split,
649
+ exports.ElementKinds.link
650
+ ];
651
+ var DefaultQuickToolbarDefinition = __spreadArray(__spreadArray([], __read(STANDARD_HEADING_TYPES)), [
652
+ exports.ToolbarActionTypes.split,
653
+ exports.ElementKinds.numberedList,
654
+ exports.ElementKinds.bulletedList,
655
+ exports.ToolbarActionTypes.split,
656
+ exports.ElementKinds.link,
657
+ exports.ElementKinds.image,
658
+ exports.ElementKinds.table,
659
+ exports.ElementKinds.blockquote,
660
+ exports.ElementKinds.hr,
661
+ exports.ElementKinds.code
662
+ ]);
663
+ var ToolbarMoreGroup = {
664
+ key: 'more',
665
+ icon: 'more'
666
+ };
667
+
668
668
  var TheTextComponent = /** @class */ (function (_super) {
669
669
  __extends(TheTextComponent, _super);
670
670
  function TheTextComponent(elementRef, renderer2, cdr) {
@@ -2833,7 +2833,7 @@
2833
2833
  height: value.element.height,
2834
2834
  thumbUrl: value.element.thumbUrl,
2835
2835
  originUrl: value.element.originUrl,
2836
- align: value.element.align || exports.Alignment.center
2836
+ align: value.element.align || exports.Alignment.left
2837
2837
  };
2838
2838
  }
2839
2839
  };
@@ -2883,6 +2883,7 @@
2883
2883
  this.imageEntry = {
2884
2884
  height: height,
2885
2885
  width: width,
2886
+ align: this.imageEntry.align || exports.Alignment.center,
2886
2887
  thumbUrl: this.sanitizer.bypassSecurityTrustResourceUrl(URL.createObjectURL(file))
2887
2888
  };
2888
2889
  this.uploading = true;
@@ -2999,7 +3000,7 @@
2999
3000
  return TheImageComponent;
3000
3001
  }(TheBaseElementComponent));
3001
3002
  TheImageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheImageComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$2.DomSanitizer }, { token: THE_UPLOAD_SERVICE_TOKEN }, { token: i0__namespace.ChangeDetectorRef }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
3002
- TheImageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align || 'center'\">\n <div\n #imageContent\n *ngIf=\"imageEntry.thumbUrl\"\n class=\"image-content\"\n [class.pointer]=\"!selection\"\n [ngStyle]=\"{ width: imageEntry.width + 'px', height: imageEntry.height + 'px' }\"\n >\n <img #img class=\"main-image\" [src]=\"imageEntry.thumbUrl\" [alt]=\"imageEntry.name\" />\n <div *ngIf=\"selection\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"></thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" (mousedown)=\"preview($event)\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n", components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i4__namespace.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
3003
+ TheImageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div\n #imageContent\n *ngIf=\"imageEntry.thumbUrl\"\n class=\"image-content\"\n [class.pointer]=\"!selection\"\n [ngStyle]=\"{ width: imageEntry.width + 'px', height: imageEntry.height + 'px' }\"\n >\n <img #img class=\"main-image\" [src]=\"imageEntry.thumbUrl\" [alt]=\"imageEntry.name\" />\n <div *ngIf=\"selection\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"></thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" (mousedown)=\"preview($event)\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n", components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i4__namespace.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
3003
3004
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheImageComponent, decorators: [{
3004
3005
  type: i0.Component,
3005
3006
  args: [{
@@ -5105,6 +5106,15 @@
5105
5106
  return editor;
5106
5107
  };
5107
5108
 
5109
+ var isInline = function (editor, path) {
5110
+ var _a;
5111
+ var _b = __read(slate.Editor.nodes(editor, {
5112
+ at: path ? path : (_a = editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path,
5113
+ match: function (n) { return slate.Element.isElement(n) && slate.Editor.isInline(editor, n) && !slate.Editor.isVoid(editor, n); }
5114
+ }), 1), inlineNode = _b[0];
5115
+ return !!inlineNode;
5116
+ };
5117
+
5108
5118
  var withMoveSelection = function (editor) {
5109
5119
  var onClick = editor.onClick, deleteBackward = editor.deleteBackward, onKeydown = editor.onKeydown;
5110
5120
  editor.onClick = function (event) {
@@ -5137,6 +5147,50 @@
5137
5147
  }
5138
5148
  deleteBackward(unit);
5139
5149
  };
5150
+ editor.onKeydown = function (event) {
5151
+ var selection = editor.selection;
5152
+ if (!selection || !selection.anchor || !selection.focus) {
5153
+ onKeydown(event);
5154
+ return;
5155
+ }
5156
+ var isMoveBackward = i1.hotkeys.isMoveBackward(event);
5157
+ var isMoveForward = i1.hotkeys.isMoveForward(event);
5158
+ var isCollapsed$1 = selection && isCollapsed(selection);
5159
+ var isInlineNode = isInline(editor);
5160
+ if (isCollapsed$1 && isMoveForward) {
5161
+ var isInlineCodeBefore = false;
5162
+ if (!isInlineNode) {
5163
+ try {
5164
+ var path = slate.Editor.after(editor, selection).path;
5165
+ if (path) {
5166
+ isInlineCodeBefore = isInline(editor, path);
5167
+ }
5168
+ }
5169
+ catch (error) { }
5170
+ }
5171
+ if (isInlineNode || isInlineCodeBefore) {
5172
+ event.preventDefault();
5173
+ slate.Transforms.move(editor, { unit: 'offset' });
5174
+ return;
5175
+ }
5176
+ }
5177
+ if (isCollapsed$1 && isMoveBackward) {
5178
+ var isInlineCodeAfter = false;
5179
+ if (!isInlineNode) {
5180
+ try {
5181
+ var path = slate.Editor.before(editor, selection).path;
5182
+ isInlineCodeAfter = isInline(editor, path);
5183
+ }
5184
+ catch (error) { }
5185
+ }
5186
+ if (isInlineNode || isInlineCodeAfter) {
5187
+ event.preventDefault();
5188
+ slate.Transforms.move(editor, { unit: 'offset', reverse: true });
5189
+ return;
5190
+ }
5191
+ }
5192
+ onKeydown(event);
5193
+ };
5140
5194
  return editor;
5141
5195
  };
5142
5196
 
@@ -6333,7 +6387,7 @@
6333
6387
  return;
6334
6388
  }
6335
6389
  var props = {
6336
- align: alignment
6390
+ align: alignment !== exports.Alignment.left ? alignment : null
6337
6391
  };
6338
6392
  slate.Transforms.setNodes(editor, props, {
6339
6393
  at: editor.selection,
@@ -7299,7 +7353,7 @@
7299
7353
  this.options = Object.assign(Object.assign({}, this.options), { lineWrapping: this.element.autoWrap || false });
7300
7354
  };
7301
7355
  TheCodeComponent.prototype.useHeight = function () {
7302
- if (this.element.height) {
7356
+ if (this.element.height && this.config.mode !== 'print') {
7303
7357
  this.resizeHeight = this.element.height;
7304
7358
  this.maxHeight = this.element.height;
7305
7359
  }
@@ -7736,12 +7790,12 @@
7736
7790
  return TheLinkComponent;
7737
7791
  }(TheBaseLinkComponent));
7738
7792
  TheLinkComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheLinkComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
7739
- TheLinkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheLinkComponent, selector: "span[theLink]", usesInheritance: true, ngImport: i0__namespace, template: "\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
7793
+ TheLinkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheLinkComponent, selector: "span[theLink]", usesInheritance: true, ngImport: i0__namespace, template: " <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
7740
7794
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheLinkComponent, decorators: [{
7741
7795
  type: i0.Component,
7742
7796
  args: [{
7743
7797
  selector: 'span[theLink]',
7744
- template: "\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>"
7798
+ template: " <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>"
7745
7799
  }]
7746
7800
  }] });
7747
7801
  var TheReadonlyLinkComponent = /** @class */ (function (_super) {
@@ -11498,7 +11552,7 @@
11498
11552
  TheVerticalToolbarItemComponent.prototype.execute = function (event) {
11499
11553
  var _a, _b;
11500
11554
  _super.prototype.execute.call(this, event);
11501
- if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11555
+ if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.readOnly) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11502
11556
  return;
11503
11557
  }
11504
11558
  this.openPopover();
@@ -11532,7 +11586,7 @@
11532
11586
  return TheVerticalToolbarItemComponent;
11533
11587
  }(TheToolbarBaseItemComponent));
11534
11588
  TheVerticalToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$6.ThyPopover }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
11535
- TheVerticalToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", inputs: { item: "item", menus: "menus", editor: "editor", toolbarItem: "toolbarItem" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.hide": "!active" }, classAttribute: "the-toolbar-dropdown-container verticalAlign" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["VerticalAlignItems"], descendants: true, read: i0.TemplateRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a\n thyIconNavLink\n class=\"icon-mode link-with-down\"\n [thyTooltip]=\"toolbarItem?.name\"\n [thyIconNavLinkActive]=\"isOpened\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu?.key\"\n [ngStyle]=\"menu?.styles\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span *ngIf=\"menu.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu?.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: 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.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: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
11589
+ TheVerticalToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", inputs: { item: "item", menus: "menus", editor: "editor", toolbarItem: "toolbarItem" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.hide": "!active" }, classAttribute: "the-toolbar-dropdown-container verticalAlign" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["VerticalAlignItems"], descendants: true, read: i0.TemplateRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a\n thyIconNavLink\n class=\"icon-mode link-with-down\"\n [thyTooltip]=\"toolbarItem?.name\"\n [thyIconNavLinkActive]=\"isOpened\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu?.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span *ngIf=\"menu.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu?.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: 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.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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
11536
11590
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, decorators: [{
11537
11591
  type: i0.Component,
11538
11592
  args: [{
@@ -11985,7 +12039,8 @@
11985
12039
  return;
11986
12040
  }
11987
12041
  // unset fontSize
11988
- if (FontSizeEditor.unsetFontSize(editor, size, fontSizeMark, isDefaultFontSize)) {
12042
+ if (isDefaultFontSize && Number(defaultFontSize) === fontSizeMark) {
12043
+ FontSizeEditor.unsetFontSize(editor, size);
11989
12044
  return;
11990
12045
  }
11991
12046
  FontSizeEditor.setFontSizeMark(editor, size);
@@ -11998,21 +12053,17 @@
11998
12053
  // set paragraph text fontSize
11999
12054
  slate.Editor.addMark(editor, exports.MarkTypes.fontSize, Number(size));
12000
12055
  },
12001
- unsetFontSize: function (editor, size, fontSizeMark, isDefaultFontSize) {
12056
+ unsetFontSize: function (editor, size) {
12002
12057
  var _a;
12003
12058
  var isTable = TableEditor.isActive(editor);
12004
- if (fontSizeMark && isDefaultFontSize) {
12005
- // unset Table selectedCells fontSize
12006
- if (isTable && TableEditor.toggleMark(editor, true, exports.MarkTypes.fontSize, Number(size))) {
12007
- return true;
12008
- }
12009
- // unset paragraph text fontSize
12010
- setMarks(editor, (_a = {},
12011
- _a[exports.MarkTypes.fontSize] = null,
12012
- _a), editor.selection);
12013
- return true;
12059
+ // unset Table selectedCells fontSize
12060
+ if (isTable && TableEditor.toggleMark(editor, true, exports.MarkTypes.fontSize, Number(size))) {
12061
+ return;
12014
12062
  }
12015
- return false;
12063
+ // unset paragraph text fontSize
12064
+ setMarks(editor, (_a = {},
12065
+ _a[exports.MarkTypes.fontSize] = null,
12066
+ _a), editor.selection);
12016
12067
  },
12017
12068
  isFontSizeActive: function (editor, size) {
12018
12069
  if (editor.selection) {
@@ -12140,42 +12191,6 @@
12140
12191
  insertText(text);
12141
12192
  }
12142
12193
  };
12143
- editor.onKeydown = function (event) {
12144
- var selection = editor.selection;
12145
- if (!selection || !selection.anchor || !selection.focus) {
12146
- onKeydown(event);
12147
- return;
12148
- }
12149
- var isMoveBackward = i1.hotkeys.isMoveBackward(event);
12150
- var isMoveForward = i1.hotkeys.isMoveForward(event);
12151
- var isCollapsed$1 = selection && isCollapsed(selection);
12152
- var isInlineCode = InlineCodeEditor.isInlineCodeActive(editor);
12153
- if (isCollapsed$1 && isMoveForward) {
12154
- var isInlineCodeBefore = false;
12155
- if (!isInlineCode) {
12156
- var path = slate.Editor.after(editor, selection).path;
12157
- isInlineCodeBefore = InlineCodeEditor.isInlineCodeActive(editor, path);
12158
- }
12159
- if (isInlineCode || isInlineCodeBefore) {
12160
- event.preventDefault();
12161
- slate.Transforms.move(editor, { unit: 'offset' });
12162
- return;
12163
- }
12164
- }
12165
- if (isCollapsed$1 && isMoveBackward) {
12166
- var isInlineCodeAfter = false;
12167
- if (!isInlineCode) {
12168
- var path = slate.Editor.before(editor, selection).path;
12169
- isInlineCodeAfter = InlineCodeEditor.isInlineCodeActive(editor, path);
12170
- }
12171
- if (isInlineCode || isInlineCodeAfter) {
12172
- event.preventDefault();
12173
- slate.Transforms.move(editor, { unit: 'offset', reverse: true });
12174
- return;
12175
- }
12176
- }
12177
- onKeydown(event);
12178
- };
12179
12194
  editor = withRemoveEmptyNodes({ type: exports.ElementKinds.inlineCode })(editor);
12180
12195
  return editor;
12181
12196
  };
@@ -13105,6 +13120,9 @@
13105
13120
  });
13106
13121
  this.toolbarCalculate();
13107
13122
  setTimeout(function () {
13123
+ // You need to wait for the editor rendering to complete
13124
+ // before triggering the external toolbar assignment detection
13125
+ _this.globalToolbarInit();
13108
13126
  _this.theEditorCreated.emit(_this.editor);
13109
13127
  _this.applyAutoFocus();
13110
13128
  });
@@ -13133,11 +13151,14 @@
13133
13151
  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);
13134
13152
  this.globalToolbarClass = ['the-global-toolbar', getToolbarClass(this.editor)];
13135
13153
  this.toolbarEntity = toolbarOption.toolbarEntity;
13154
+ };
13155
+ TheEditorComponent.prototype.globalToolbarInit = function () {
13156
+ var _a, _b;
13136
13157
  if (this.theGlobalToolbar) {
13137
13158
  this.theGlobalToolbarInstance.editor = this.editor;
13138
- this.theGlobalToolbarInstance.toolbarItems = toolbarOption.toolbarEntity.global;
13159
+ this.theGlobalToolbarInstance.toolbarItems = this.toolbarEntity.global;
13139
13160
  this.theGlobalToolbarInstance.containerClass = this.globalToolbarClass;
13140
- this.theGlobalToolbarInstance.align = toolbar === null || toolbar === void 0 ? void 0 : toolbar.align;
13161
+ this.theGlobalToolbarInstance.align = (_b = (_a = this === null || this === void 0 ? void 0 : this.theOptions) === null || _a === void 0 ? void 0 : _a.toolbar) === null || _b === void 0 ? void 0 : _b.align;
13141
13162
  this.theGlobalToolbarInstance.setToolbarClass();
13142
13163
  this.theGlobalToolbarInstance.renderToolbarView();
13143
13164
  }
@@ -13296,7 +13317,7 @@
13296
13317
  useExisting: i0.forwardRef(function () { return TheEditorComponent; }),
13297
13318
  multi: true
13298
13319
  }
13299
- ], 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__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 [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 *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div\n #quickInsert\n theQuickInsert\n [editor]=\"editor\"\n [quickToolbarItems]=\"quickToolbarItems\"\n [isVisible]=\"theOptions?.quickInsertVisible\"\n ></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", "isVisible"] }, { 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"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
13320
+ ], 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__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 [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?.inlineToobarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div\n #quickInsert\n theQuickInsert\n [editor]=\"editor\"\n [quickToolbarItems]=\"quickToolbarItems\"\n [isVisible]=\"theOptions?.quickInsertVisible\"\n ></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", "isVisible"] }, { 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"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
13300
13321
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheEditorComponent, decorators: [{
13301
13322
  type: i0.Component,
13302
13323
  args: [{