@worktile/theia 2.1.11 → 2.1.15

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) {
@@ -689,10 +689,7 @@
689
689
  }
690
690
  }
691
691
  var fontSize = this.text[exports.MarkTypes.fontSize];
692
- if (fontSize) {
693
- var attr = "the-" + exports.MarkTypes.fontSize;
694
- this.renderer2.setAttribute(this.elementRef.nativeElement, attr, fontSize);
695
- }
692
+ this.renderer2.setAttribute(this.elementRef.nativeElement, "the-" + exports.MarkTypes.fontSize, fontSize ? fontSize : null);
696
693
  if (this.text[exports.MarkTypes.color]) {
697
694
  this.renderer2.setStyle(this.elementRef.nativeElement, 'color', this.text[exports.MarkTypes.color]);
698
695
  }
@@ -2080,6 +2077,13 @@
2080
2077
  slate.Transforms.setNodes(editor, { type: exports.ElementKinds.paragraph, checked: undefined }, // todo remove checked
2081
2078
  { at: path });
2082
2079
  }
2080
+ else if (slate.Element.isElement(node) && node.type === exports.ElementKinds.paragraph) {
2081
+ var textIndent = node.textIndent;
2082
+ if (textIndent) {
2083
+ slate.Transforms.setNodes(editor, { textIndent: undefined }, // remove textIndent
2084
+ { at: path });
2085
+ }
2086
+ }
2083
2087
  if (slate.Node.parent(editor, path).type !== exports.ElementKinds.listItem) {
2084
2088
  slate.Transforms.wrapNodes(editor, { type: exports.ElementKinds.listItem, children: [] }, {
2085
2089
  at: path,
@@ -7335,10 +7339,41 @@
7335
7339
  }
7336
7340
  i1.AngularEditor.focus(this.editor);
7337
7341
  slate.Transforms.select(this.editor, i1.AngularEditor.findPath(this.editor, this.element));
7338
- document.execCommand('copy');
7339
- this.thyNotifyService.success('复制成功');
7342
+ if (i1.IS_SAFARI) {
7343
+ this.safariCopy();
7344
+ return;
7345
+ }
7346
+ document.execCommand('copy') ? this.thyNotifyService.success('复制成功') : this.thyNotifyService.error('复制失败');
7340
7347
  i1.AngularEditor.deselect(this.editor);
7341
7348
  };
7349
+ TheCodeComponent.prototype.safariCopy = function () {
7350
+ var currentElement = i1.AngularEditor.toDOMNode(this.editor, this.element);
7351
+ var blockCard = currentElement.closest('.slate-block-card');
7352
+ var span = document.createElement('pre');
7353
+ span.appendChild(blockCard.cloneNode(true));
7354
+ span.textContent = this.element.content;
7355
+ if (this.element.language) {
7356
+ span.setAttribute('data-language', this.element.language);
7357
+ }
7358
+ if (this.element.autoWrap) {
7359
+ span.setAttribute('data-auto-wrap', String(this.element.autoWrap));
7360
+ }
7361
+ if (this.element.height) {
7362
+ span.setAttribute('data-height', String(this.element.height));
7363
+ }
7364
+ document.body.appendChild(span);
7365
+ var selection = window.getSelection();
7366
+ var range = document.createRange();
7367
+ if (selection) {
7368
+ selection.removeAllRanges();
7369
+ range.selectNode(span);
7370
+ selection.addRange(range);
7371
+ document.execCommand('copy') ? this.thyNotifyService.success('复制成功') : this.thyNotifyService.error('复制失败');
7372
+ selection.removeAllRanges();
7373
+ document.body.removeChild(span);
7374
+ i1.AngularEditor.deselect(this.editor);
7375
+ }
7376
+ };
7342
7377
  TheCodeComponent.prototype.focusChange = function (codeMirrorFocused) {
7343
7378
  if (codeMirrorFocused) {
7344
7379
  this.isHightLight = false;
@@ -7784,7 +7819,7 @@
7784
7819
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
7785
7820
  // Put this at the start and end of an inline component to work around this Chromium bug:
7786
7821
  // https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
7787
- _this.inlineChromiumBugfix = '$' + String.fromCodePoint(160);
7822
+ _this.inlineChromiumBugfix = String.fromCodePoint(160);
7788
7823
  return _this;
7789
7824
  }
7790
7825
  return TheLinkComponent;
@@ -10030,7 +10065,7 @@
10030
10065
  ColumnResizingStore.prototype.restoreTopRows = function (deltaY) {
10031
10066
  var index = this.resizeRows.length - 1;
10032
10067
  while (index >= 0 && deltaY > 0) {
10033
- var currentHeight = coercePixelsFromCssValue(this.resizeRows[index].rowElement.style.height);
10068
+ var currentHeight = this.resizeRows[index].rowElement.getBoundingClientRect().height;
10034
10069
  if (this.resizeRows[index].baseHeight > currentHeight) {
10035
10070
  if (this.resizeRows[index].baseHeight > currentHeight + deltaY) {
10036
10071
  this.resizeRows[index].rowElement.style.height = coercion.coerceCssPixelValue(currentHeight + deltaY);
@@ -10691,10 +10726,23 @@
10691
10726
  .pipe(takeUntilDestroyed, operators.filter(function (columnSize) { return columnSize.tableCell === _this.elementRef.nativeElement; }))
10692
10727
  .subscribe(function (_c) {
10693
10728
  var deltaSize = _c.deltaSize, previousSize = _c.previousSize, completeImmediately = _c.completeImmediately;
10694
- _this.elementRef.nativeElement.classList.add(OVERLAY_ACTIVE_CLASS);
10695
- _this.applySize(deltaSize, previousSize);
10696
- if (completeImmediately) {
10697
- _this._completeResizeOperation();
10729
+ var _d = _this.elementRef.nativeElement.getBoundingClientRect(), top = _d.top, left = _d.left, height = _d.height, width = _d.width;
10730
+ var clientY = event.clientY, clientX = event.clientX;
10731
+ var isApplySize = false;
10732
+ if (_this.isXAxisHover) {
10733
+ var cellWidth = _this.hoverdDirection === 'left' ? 0 : width;
10734
+ isApplySize = deltaSize > 0 && left + cellWidth - clientX <= 0;
10735
+ }
10736
+ else {
10737
+ var cellHeight = _this.hoverdDirection === 'bottom' ? 0 : height;
10738
+ isApplySize = deltaSize > 0 && top + cellHeight - clientY <= 0;
10739
+ }
10740
+ if (isApplySize || deltaSize < 0) {
10741
+ _this.elementRef.nativeElement.classList.add(OVERLAY_ACTIVE_CLASS);
10742
+ _this.applySize(deltaSize, previousSize);
10743
+ if (completeImmediately) {
10744
+ _this._completeResizeOperation();
10745
+ }
10698
10746
  }
10699
10747
  });
10700
10748
  rxjs.merge(this.resizeNotifier.resizeCanceled, this.resizeNotifier.resizeCompleted)
@@ -11552,7 +11600,7 @@
11552
11600
  TheVerticalToolbarItemComponent.prototype.execute = function (event) {
11553
11601
  var _a, _b;
11554
11602
  _super.prototype.execute.call(this, event);
11555
- if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11603
+ if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.readOnly) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
11556
11604
  return;
11557
11605
  }
11558
11606
  this.openPopover();
@@ -11586,7 +11634,7 @@
11586
11634
  return TheVerticalToolbarItemComponent;
11587
11635
  }(TheToolbarBaseItemComponent));
11588
11636
  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 });
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 [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]" }] });
11637
+ 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]" }] });
11590
11638
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, decorators: [{
11591
11639
  type: i0.Component,
11592
11640
  args: [{
@@ -11831,7 +11879,7 @@
11831
11879
  return TheToolbarItemComponent;
11832
11880
  }(TheToolbarBaseItemComponent));
11833
11881
  TheToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarItemComponent, deps: [{ token: i0__namespace.NgZone }, { token: i0__namespace.ComponentFactoryResolver }], target: i0__namespace.ɵɵFactoryTarget.Component });
11834
- TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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"] }] });
11882
+ TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { editor: "editor", item: "item", 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"] }] });
11835
11883
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarItemComponent, decorators: [{
11836
11884
  type: i0.Component,
11837
11885
  args: [{
@@ -11841,9 +11889,9 @@
11841
11889
  class: 'the-toolbar-item'
11842
11890
  }
11843
11891
  }]
11844
- }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: i0__namespace.ComponentFactoryResolver }]; }, propDecorators: { item: [{
11892
+ }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: i0__namespace.ComponentFactoryResolver }]; }, propDecorators: { editor: [{
11845
11893
  type: i0.Input
11846
- }], editor: [{
11894
+ }], item: [{
11847
11895
  type: i0.Input
11848
11896
  }], itemMode: [{
11849
11897
  type: i0.Input
@@ -11870,14 +11918,17 @@
11870
11918
  }
11871
11919
  TheQuickToolbarComponent.prototype.handleMouseDown = function (event) {
11872
11920
  if (!this.elementRef.nativeElement.contains(event.target)) {
11873
- this.popoverRef.close();
11921
+ QuickInsertEditor.closeQuickToolbar(this.editor);
11874
11922
  }
11875
11923
  else {
11876
11924
  event.preventDefault();
11877
11925
  }
11878
11926
  };
11879
11927
  TheQuickToolbarComponent.prototype.handleEnter = function () {
11880
- this.popoverRef.close();
11928
+ QuickInsertEditor.closeQuickToolbar(this.editor);
11929
+ };
11930
+ TheQuickToolbarComponent.prototype.handleEsc = function () {
11931
+ QuickInsertEditor.closeQuickToolbar(this.editor);
11881
11932
  };
11882
11933
  TheQuickToolbarComponent.prototype.ngOnInit = function () {
11883
11934
  this.editorElement = i1.AngularEditor.toDOMNode(this.editor, this.editor);
@@ -11894,7 +11945,7 @@
11894
11945
  };
11895
11946
  TheQuickToolbarComponent.prototype.removeHotKey = function () {
11896
11947
  var node = slate.Node.get(this.editor, this.editor.selection.anchor.path);
11897
- if (node && slate.Text.equals({ text: QUICK_TOOLBAR_HOTKEY }, node)) {
11948
+ if (node && QUICK_TOOLBAR_HOTKEY === node.text) {
11898
11949
  slate.Editor.deleteBackward(this.editor);
11899
11950
  }
11900
11951
  };
@@ -11904,7 +11955,7 @@
11904
11955
  return TheQuickToolbarComponent;
11905
11956
  }(core.mixinUnsubscribe(core.MixinBase)));
11906
11957
  TheQuickToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheQuickToolbarComponent, deps: [{ token: i1__namespace$3.ThyPopoverRef }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
11907
- TheQuickToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickToolbarComponent, selector: "the-quick-toolbar", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "document: mousedown": "handleMouseDown($event)", "document: keydown.enter": "handleEnter()" } }, usesInheritance: true, ngImport: i0__namespace, template: "<thy-selection-list\n class=\"the-quick-toolbar\"\n [thyBindKeyEventContainer]=\"editorElement\"\n (thySelectionChange)=\"selectionChange($event)\"\n [thyMultiple]=\"false\"\n>\n <ng-container *ngFor=\"let item of quickToolbarItems\">\n <ng-container *ngIf=\"item.key !== ToolbarActionTypes.split; else splitLine\">\n <thy-list-option [thyValue]=\"item?.key\" (mousedown)=\"stopPropagation($event)\">\n <the-toolbar-item [editor]=\"editor\" [item]=\"item\" [itemMode]=\"ToolbarItemMode.vertical\"></the-toolbar-item>\n </thy-list-option>\n </ng-container>\n </ng-container>\n</thy-selection-list>\n\n<ng-template #splitLine>\n <nav-split-line [mode]=\"ToolbarItemMode.horizontal\"></nav-split-line>\n</ng-template>\n", components: [{ type: i2__namespace$2.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5__namespace$3.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["item", "editor", "itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
11958
+ TheQuickToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickToolbarComponent, selector: "the-quick-toolbar", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "document: mousedown": "handleMouseDown($event)", "document: keydown.enter": "handleEnter()", "document: keydown.escape": "handleEsc()" } }, usesInheritance: true, ngImport: i0__namespace, template: "<thy-selection-list\n class=\"the-quick-toolbar\"\n [thyBindKeyEventContainer]=\"editorElement\"\n (thySelectionChange)=\"selectionChange($event)\"\n [thyMultiple]=\"false\"\n>\n <ng-container *ngFor=\"let item of quickToolbarItems\">\n <ng-container *ngIf=\"item.key !== ToolbarActionTypes.split; else splitLine\">\n <thy-list-option [thyValue]=\"item?.key\" (mousedown)=\"stopPropagation($event)\">\n <the-toolbar-item [editor]=\"editor\" [item]=\"item\" [itemMode]=\"ToolbarItemMode.vertical\"></the-toolbar-item>\n </thy-list-option>\n </ng-container>\n </ng-container>\n</thy-selection-list>\n\n<ng-template #splitLine>\n <nav-split-line [mode]=\"ToolbarItemMode.horizontal\"></nav-split-line>\n</ng-template>\n", components: [{ type: i2__namespace$2.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5__namespace$3.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["editor", "item", "itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
11908
11959
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheQuickToolbarComponent, decorators: [{
11909
11960
  type: i0.Component,
11910
11961
  args: [{
@@ -11921,6 +11972,9 @@
11921
11972
  }], handleEnter: [{
11922
11973
  type: i0.HostListener,
11923
11974
  args: ['document: keydown.enter']
11975
+ }], handleEsc: [{
11976
+ type: i0.HostListener,
11977
+ args: ['document: keydown.escape']
11924
11978
  }] } });
11925
11979
 
11926
11980
  var OperationTypes = ['insert_text', 'remove_node', 'merge_node'];
@@ -12039,7 +12093,7 @@
12039
12093
  return;
12040
12094
  }
12041
12095
  // unset fontSize
12042
- if (isDefaultFontSize && Number(defaultFontSize) === fontSizeMark) {
12096
+ if (isDefaultFontSize) {
12043
12097
  FontSizeEditor.unsetFontSize(editor, size);
12044
12098
  return;
12045
12099
  }
@@ -12139,18 +12193,18 @@
12139
12193
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
12140
12194
  // Put this at the start and end of an inline component to work around this Chromium bug:
12141
12195
  // https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
12142
- _this.inlineChromiumBugfix = '$' + String.fromCodePoint(160);
12196
+ _this.inlineChromiumBugfix = String.fromCodePoint(160);
12143
12197
  return _this;
12144
12198
  }
12145
12199
  return TheInlineCodeComponent;
12146
12200
  }(TheBaseElementComponent));
12147
12201
  TheInlineCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInlineCodeComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
12148
- TheInlineCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", 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"] }] });
12202
+ TheInlineCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", 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"] }] });
12149
12203
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInlineCodeComponent, decorators: [{
12150
12204
  type: i0.Component,
12151
12205
  args: [{
12152
12206
  selector: 'span[theInlineCode]',
12153
- 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>"
12207
+ 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>"
12154
12208
  }]
12155
12209
  }] });
12156
12210
 
@@ -12372,8 +12426,9 @@
12372
12426
  };
12373
12427
 
12374
12428
  var TheToolbarComponent = /** @class */ (function () {
12375
- function TheToolbarComponent(cfr, elementRef, ngZone, toolbarGroupComponent) {
12429
+ function TheToolbarComponent(cfr, cdr, elementRef, ngZone, toolbarGroupComponent) {
12376
12430
  this.cfr = cfr;
12431
+ this.cdr = cdr;
12377
12432
  this.elementRef = elementRef;
12378
12433
  this.ngZone = ngZone;
12379
12434
  this.toolbarGroupComponent = toolbarGroupComponent;
@@ -12484,6 +12539,7 @@
12484
12539
  }
12485
12540
  _this.createMoreGroup(group);
12486
12541
  });
12542
+ this.cdr.markForCheck();
12487
12543
  };
12488
12544
  /**
12489
12545
  * calculation display toolbar and more grouped toolbars
@@ -12645,7 +12701,7 @@
12645
12701
  };
12646
12702
  return TheToolbarComponent;
12647
12703
  }());
12648
- TheToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", 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 });
12704
+ TheToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarComponent, deps: [{ token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }, { token: TheToolbarGroupToken }], target: i0__namespace.ɵɵFactoryTarget.Component });
12649
12705
  TheToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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"] }] });
12650
12706
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarComponent, decorators: [{
12651
12707
  type: i0.Component,
@@ -12657,7 +12713,7 @@
12657
12713
  }
12658
12714
  }]
12659
12715
  }], ctorParameters: function () {
12660
- return [{ type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ElementRef }, { type: i0__namespace.NgZone }, { type: undefined, decorators: [{
12716
+ return [{ type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.ElementRef }, { type: i0__namespace.NgZone }, { type: undefined, decorators: [{
12661
12717
  type: i0.Inject,
12662
12718
  args: [TheToolbarGroupToken]
12663
12719
  }] }];