@worktile/theia 20.1.0-next.13 → 20.1.0-next.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.
@@ -10,7 +10,7 @@ import { cloneDeep, map, assign, defaults, groupBy, uniq, isEqual } from 'lodash
10
10
  export { assign, cloneDeep, debounce, defaults, groupBy, isEqual, map, uniq } from 'lodash';
11
11
  import { Editor, Element, Span, Range, Path, Node, Point, Text, Transforms, Operation, createEditor } from 'slate';
12
12
  import * as i4 from 'slate-angular';
13
- import { FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, getClipboardData, AngularEditor, hotkeys, getPlainText as getPlainText$1, createClipboardData, setClipboardData, BaseElementComponent, IS_SAFARI, ELEMENT_TO_COMPONENT, SlateModule, getBlockCardByNativeElement, SLATE_BLOCK_CARD_CLASS_NAME, EDITOR_TO_VIRTUAL_SCROLL_SELECTION, BaseElementFlavour, hasBlockCard, isCardLeft, ELEMENT_KEY_TO_HEIGHTS, DefaultTextFlavour, defaultScrollSelectionIntoView, getDataTransferClipboard, SLATE_DEBUG_KEY, withAngular } from 'slate-angular';
13
+ import { FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, getClipboardData, AngularEditor, hotkeys, getPlainText as getPlainText$1, createClipboardData, setClipboardData, BaseElementComponent, IS_SAFARI, ELEMENT_TO_COMPONENT, SlateModule, getBlockCardByNativeElement, SLATE_BLOCK_CARD_CLASS_NAME, EDITOR_TO_VIRTUAL_SCROLL_SELECTION, BaseElementFlavour, hasBlockCard, isCardLeft, ELEMENT_KEY_TO_HEIGHTS, getRealHeightByElement, DefaultTextFlavour, defaultScrollSelectionIntoView, getDataTransferClipboard, SLATE_DEBUG_KEY, withAngular } from 'slate-angular';
14
14
  import { HistoryEditor, withHistory } from 'slate-history';
15
15
  import { NODE_TO_PARENT, NODE_TO_INDEX, NODE_TO_ELEMENT, DOMEditor, EDITOR_TO_ELEMENT } from 'slate-dom';
16
16
  import { TheiaConverter } from '@atinc/selene';
@@ -7091,7 +7091,7 @@ class TheCode extends TheBaseElement {
7091
7091
  this.destroy$ = new Subject();
7092
7092
  this.isHightLight = false;
7093
7093
  this.resizeHeight = null;
7094
- this.options = {
7094
+ this.options = signal({
7095
7095
  mode: DEFAULT_LANGUAGE.value,
7096
7096
  lineNumbers: false,
7097
7097
  readonly: false,
@@ -7099,7 +7099,7 @@ class TheCode extends TheBaseElement {
7099
7099
  lineWiseCopyCut: true,
7100
7100
  lineWrapping: false,
7101
7101
  cursorBlinkRate: 500
7102
- };
7102
+ }, ...(ngDevMode ? [{ debugName: "options" }] : []));
7103
7103
  this.resizeBounds = null;
7104
7104
  this.isDelayRender = signal(false, ...(ngDevMode ? [{ debugName: "isDelayRender" }] : []));
7105
7105
  this.thyNotifyService = inject(ThyNotifyService);
@@ -7108,7 +7108,7 @@ class TheCode extends TheBaseElement {
7108
7108
  this.thyPopover = inject(ThyPopover);
7109
7109
  this.overlay = inject(Overlay);
7110
7110
  this.onChangeLanguage = item => {
7111
- this.options = { ...this.options, mode: item.key };
7111
+ this.options.set({ ...this.options(), mode: item.key });
7112
7112
  this.activeLanguage = item;
7113
7113
  CodeEditor.setCodeAttribute(this.editor, { language: item.key }, this.element);
7114
7114
  };
@@ -7128,13 +7128,13 @@ class TheCode extends TheBaseElement {
7128
7128
  this.closeToolbar();
7129
7129
  }
7130
7130
  if (this.initialized) {
7131
- if (this.options.readonly !== this.readonly) {
7131
+ if (this.options().readonly !== this.readonly) {
7132
7132
  this.useReadonly();
7133
7133
  }
7134
- if (this.options.mode !== this.element.language) {
7134
+ if (this.options().mode !== this.element.language) {
7135
7135
  this.useMode();
7136
7136
  }
7137
- if (this.options.lineWrapping !== this.element.autoWrap) {
7137
+ if (this.options().lineWrapping !== this.element.autoWrap) {
7138
7138
  this.useAutoWrap();
7139
7139
  }
7140
7140
  if (this.resizeHeight !== this.element.height) {
@@ -7171,9 +7171,13 @@ class TheCode extends TheBaseElement {
7171
7171
  }
7172
7172
  }
7173
7173
  ngAfterViewInit() {
7174
- if (this.isCollapsedAndNonReadonly) {
7175
- this.useAutofocus();
7176
- }
7174
+ this.codemirror.view.requestMeasure({
7175
+ read: view => {
7176
+ if (this.isCollapsedAndNonReadonly) {
7177
+ this.useAutofocus();
7178
+ }
7179
+ }
7180
+ });
7177
7181
  }
7178
7182
  initMaxHeight() {
7179
7183
  this.maxHeight = isPrintMode(this.editor) ? 0 : 350 - CODEMIRROR_PADDING_TOP * 2;
@@ -7226,7 +7230,7 @@ class TheCode extends TheBaseElement {
7226
7230
  }
7227
7231
  }
7228
7232
  useMode() {
7229
- this.options = { ...this.options, mode: this.element.language };
7233
+ this.options.set({ ...this.options(), mode: this.element.language });
7230
7234
  const menuItem = this.menus.find(i => i.key === this.element.language);
7231
7235
  if (menuItem) {
7232
7236
  this.activeLanguage = menuItem;
@@ -7235,7 +7239,7 @@ class TheCode extends TheBaseElement {
7235
7239
  useAutoWrap() {
7236
7240
  const isPrint = isPrintMode(this.editor);
7237
7241
  const lineWrapping = isPrint ? true : this.element.autoWrap || false;
7238
- this.options = { ...this.options, lineWrapping };
7242
+ this.options.set({ ...this.options(), lineWrapping });
7239
7243
  }
7240
7244
  useHeight() {
7241
7245
  if (this.element.height && !isPrintMode(this.editor)) {
@@ -7244,10 +7248,10 @@ class TheCode extends TheBaseElement {
7244
7248
  }
7245
7249
  }
7246
7250
  useReadonly() {
7247
- this.options = { ...this.options, readonly: this.readonly, cursorBlinkRate: this.readonly ? -1 : 500 };
7251
+ this.options.set({ ...this.options(), readonly: this.readonly, cursorBlinkRate: this.readonly ? -1 : 500 });
7248
7252
  }
7249
7253
  useAutofocus() {
7250
- this.options = { ...this.options, autofocus: true };
7254
+ this.options.set({ ...this.options(), autofocus: true });
7251
7255
  }
7252
7256
  onResize({ height }) {
7253
7257
  this.resizeHeight = height;
@@ -7259,7 +7263,7 @@ class TheCode extends TheBaseElement {
7259
7263
  }
7260
7264
  onChangeWrap(value) {
7261
7265
  this.isHightLight = false;
7262
- this.options = { ...this.options, lineWrapping: value || false };
7266
+ this.options.set({ ...this.options(), lineWrapping: value || false });
7263
7267
  CodeEditor.setCodeAttribute(this.editor, { autoWrap: value ? value : null }, this.element);
7264
7268
  }
7265
7269
  ngOnDestroy() {
@@ -7267,7 +7271,7 @@ class TheCode extends TheBaseElement {
7267
7271
  this.destroy$.complete();
7268
7272
  }
7269
7273
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TheCode, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
7270
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: TheCode, isStandalone: true, selector: "div[theCode]", host: { classAttribute: "the-code-container" }, viewQueries: [{ propertyName: "toolbar", first: true, predicate: ["toolbar"], descendants: true, read: TemplateRef, static: true }, { propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }, { propertyName: "toolbarDropdown", first: true, predicate: TheToolbarDropdown, descendants: true, read: TheToolbarDropdown }], usesInheritance: true, ngImport: i0, template: "<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsedAndNonReadonly, readonly: options.readonly, active: isHightLight && isCollapsedAndNonReadonly }\"\n>\n <ng-codemirror\n #codemirror\n [isDelayRender]=\"isDelayRender()\"\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n >\n </ng-codemirror>\n @if (isCollapsedAndNonReadonly) {\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\"></thy-resize-handle>\n }\n</div>\n\n<ng-template #toolbar>\n <thy-actions thySize=\"xxs\" thePreventDefault>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>{{ locale().autoWrap }}</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a\n href=\"javascript:;\"\n thyAction\n thyActionIcon=\"copy\"\n [thyTooltip]=\"locale().copy\"\n thyTooltipPlacement=\"top\"\n (click)=\"onCopy($event)\"\n ></a>\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\" thyColor=\"light\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n [thyTooltip]=\"locale().delete\"\n thyTooltipPlacement=\"top\"\n (click)=\"onDelete($event)\"\n ></a>\n </thy-actions>\n</ng-template>\n", dependencies: [{ kind: "directive", type: ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeStart", "thyResizeEnd"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: SlateModule }, { kind: "ngmodule", type: CodemirrorModule }, { kind: "component", type: i2$2.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["options", "extensions", "languages", "isDelayRender"], outputs: ["focusChange"] }, { kind: "component", type: ThySwitch, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled", "thyLoading"], outputs: ["thyChange"] }, { kind: "component", type: ThyAction, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: ThyDivider, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "component", type: ThyActions, selector: "thy-actions", inputs: ["thySize"] }, { kind: "directive", type: ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: ThyResizeHandle, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection", "thyLine"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }, { kind: "component", type: TheToolbarDropdown, selector: "the-toolbar-dropdown" }, { kind: "directive", type: ThePreventDefaultDirective, selector: "[thePreventDefault]", exportAs: ["thePreventDefault"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7274
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: TheCode, isStandalone: true, selector: "div[theCode]", host: { classAttribute: "the-code-container" }, viewQueries: [{ propertyName: "toolbar", first: true, predicate: ["toolbar"], descendants: true, read: TemplateRef, static: true }, { propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }, { propertyName: "toolbarDropdown", first: true, predicate: TheToolbarDropdown, descendants: true, read: TheToolbarDropdown }], usesInheritance: true, ngImport: i0, template: "<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsedAndNonReadonly, readonly: options().readonly, active: isHightLight && isCollapsedAndNonReadonly }\"\n>\n <ng-codemirror\n #codemirror\n [isDelayRender]=\"isDelayRender()\"\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options()\"\n [ngModel]=\"code\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n >\n </ng-codemirror>\n @if (isCollapsedAndNonReadonly) {\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\"></thy-resize-handle>\n }\n</div>\n\n<ng-template #toolbar>\n <thy-actions thySize=\"xxs\" thePreventDefault>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>{{ locale().autoWrap }}</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a\n href=\"javascript:;\"\n thyAction\n thyActionIcon=\"copy\"\n [thyTooltip]=\"locale().copy\"\n thyTooltipPlacement=\"top\"\n (click)=\"onCopy($event)\"\n ></a>\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\" thyColor=\"light\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n [thyTooltip]=\"locale().delete\"\n thyTooltipPlacement=\"top\"\n (click)=\"onDelete($event)\"\n ></a>\n </thy-actions>\n</ng-template>\n", dependencies: [{ kind: "directive", type: ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeStart", "thyResizeEnd"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: SlateModule }, { kind: "ngmodule", type: CodemirrorModule }, { kind: "component", type: i2$2.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["options", "extensions", "languages", "isDelayRender"], outputs: ["focusChange"] }, { kind: "component", type: ThySwitch, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled", "thyLoading"], outputs: ["thyChange"] }, { kind: "component", type: ThyAction, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: ThyDivider, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "component", type: ThyActions, selector: "thy-actions", inputs: ["thySize"] }, { kind: "directive", type: ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: ThyResizeHandle, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection", "thyLine"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }, { kind: "component", type: TheToolbarDropdown, selector: "the-toolbar-dropdown" }, { kind: "directive", type: ThePreventDefaultDirective, selector: "[thePreventDefault]", exportAs: ["thePreventDefault"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7271
7275
  }
7272
7276
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TheCode, decorators: [{
7273
7277
  type: Component,
@@ -7290,7 +7294,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
7290
7294
  ThyResizeHandle,
7291
7295
  TheToolbarDropdown,
7292
7296
  ThePreventDefaultDirective
7293
- ], template: "<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsedAndNonReadonly, readonly: options.readonly, active: isHightLight && isCollapsedAndNonReadonly }\"\n>\n <ng-codemirror\n #codemirror\n [isDelayRender]=\"isDelayRender()\"\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n >\n </ng-codemirror>\n @if (isCollapsedAndNonReadonly) {\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\"></thy-resize-handle>\n }\n</div>\n\n<ng-template #toolbar>\n <thy-actions thySize=\"xxs\" thePreventDefault>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>{{ locale().autoWrap }}</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a\n href=\"javascript:;\"\n thyAction\n thyActionIcon=\"copy\"\n [thyTooltip]=\"locale().copy\"\n thyTooltipPlacement=\"top\"\n (click)=\"onCopy($event)\"\n ></a>\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\" thyColor=\"light\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n [thyTooltip]=\"locale().delete\"\n thyTooltipPlacement=\"top\"\n (click)=\"onDelete($event)\"\n ></a>\n </thy-actions>\n</ng-template>\n" }]
7297
+ ], template: "<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsedAndNonReadonly, readonly: options().readonly, active: isHightLight && isCollapsedAndNonReadonly }\"\n>\n <ng-codemirror\n #codemirror\n [isDelayRender]=\"isDelayRender()\"\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options()\"\n [ngModel]=\"code\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n >\n </ng-codemirror>\n @if (isCollapsedAndNonReadonly) {\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\"></thy-resize-handle>\n }\n</div>\n\n<ng-template #toolbar>\n <thy-actions thySize=\"xxs\" thePreventDefault>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>{{ locale().autoWrap }}</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a\n href=\"javascript:;\"\n thyAction\n thyActionIcon=\"copy\"\n [thyTooltip]=\"locale().copy\"\n thyTooltipPlacement=\"top\"\n (click)=\"onCopy($event)\"\n ></a>\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\" thyColor=\"light\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n [thyTooltip]=\"locale().delete\"\n thyTooltipPlacement=\"top\"\n (click)=\"onDelete($event)\"\n ></a>\n </thy-actions>\n</ng-template>\n" }]
7294
7298
  }], propDecorators: { toolbar: [{
7295
7299
  type: ViewChild,
7296
7300
  args: ['toolbar', { read: TemplateRef, static: true }]
@@ -14379,13 +14383,12 @@ class TheImage extends TheBaseElement {
14379
14383
  if (!AngularEditor.isEnabledVirtualScroll(this.editor)) {
14380
14384
  return;
14381
14385
  }
14382
- const heights = ELEMENT_KEY_TO_HEIGHTS.get(this.editor);
14383
- const key = AngularEditor.findKey(this.editor, this.element);
14384
- if (heights && heights.get(key.id)) {
14386
+ const realHeight = getRealHeightByElement(this.editor, this.element, 0);
14387
+ if (realHeight > 0) {
14385
14388
  const blockCard = getBlockCardByNativeElement(this.nativeElement);
14386
14389
  if (blockCard) {
14387
14390
  const style = getComputedStyle(blockCard);
14388
- blockCard.style.minHeight = heights.get(key.id) - parseFloat(style.marginTop) - parseFloat(style.marginBottom) + 'px';
14391
+ blockCard.style.minHeight = realHeight - parseFloat(style.marginTop) - parseFloat(style.marginBottom) + 'px';
14389
14392
  }
14390
14393
  }
14391
14394
  }
@@ -14394,8 +14397,12 @@ class TheImage extends TheBaseElement {
14394
14397
  return;
14395
14398
  }
14396
14399
  const blockCard = getBlockCardByNativeElement(this.nativeElement);
14397
- if (blockCard) {
14400
+ if (blockCard && blockCard.style.minHeight) {
14398
14401
  blockCard.style.minHeight = '';
14402
+ return true;
14403
+ }
14404
+ else {
14405
+ return false;
14399
14406
  }
14400
14407
  }
14401
14408
  setImagePluginOptions() {
@@ -14635,13 +14642,15 @@ class TheImage extends TheBaseElement {
14635
14642
  .withPositions([bottomPosition]);
14636
14643
  }
14637
14644
  imageLoaded(event) {
14638
- this.clearMinHeight();
14639
14645
  const img = event.target;
14640
14646
  this.naturalWidth = img.naturalWidth;
14641
14647
  this.naturalHeight = img.naturalHeight;
14642
14648
  if (AngularEditor.isEnabledVirtualScroll(this.editor)) {
14643
14649
  this.imageLoadedCacheHeightTimer = setTimeout(() => {
14644
- this.cacheImageHeight(this.getRealHeight());
14650
+ const result = this.clearMinHeight();
14651
+ if (!result) {
14652
+ this.cacheImageHeight(this.getRealHeight());
14653
+ }
14645
14654
  }, 0);
14646
14655
  }
14647
14656
  }