@worktile/theia 13.0.9 → 13.0.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.
- package/components/inline-toolbar/inline-toolbar.component.scss +1 -0
- package/components/toolbar/toolbar.component.d.ts +1 -0
- package/components/toolbar-dropdown/toolbar-dropdown.component.d.ts +1 -1
- package/components/toolbar-item/toolbar-item.component.d.ts +3 -1
- package/esm2020/components/toolbar/toolbar.component.mjs +6 -3
- package/esm2020/components/toolbar-dropdown/toolbar-dropdown.component.mjs +10 -14
- package/esm2020/components/toolbar-group/toolbar-group.component.mjs +3 -2
- package/esm2020/components/toolbar-item/toolbar-item.component.mjs +17 -11
- package/esm2020/core/toolbar-item/base-toolbar-item.mjs +1 -1
- package/esm2020/plugins/code/code.component.mjs +7 -3
- package/esm2020/plugins/image/image.component.mjs +8 -4
- package/esm2020/services/context.service.mjs +1 -5
- package/fesm2015/worktile-theia.mjs +45 -36
- package/fesm2015/worktile-theia.mjs.map +1 -1
- package/fesm2020/worktile-theia.mjs +44 -35
- package/fesm2020/worktile-theia.mjs.map +1 -1
- package/package.json +1 -1
- package/plugins/code/code.component.d.ts +3 -1
- package/services/context.service.d.ts +0 -1
- package/styles/variables.scss +1 -1
|
@@ -41,10 +41,10 @@ import * as i4$2 from 'ngx-tethys/tooltip';
|
|
|
41
41
|
import { ThyTooltipModule } from 'ngx-tethys/tooltip';
|
|
42
42
|
import * as i8 from 'ng-codemirror';
|
|
43
43
|
import { CodeMirrorComponent, CodemirrorModule } from 'ng-codemirror';
|
|
44
|
-
import * as i1$4 from 'ngx-tethys/notify';
|
|
45
|
-
import { ThyNotifyModule } from 'ngx-tethys/notify';
|
|
46
44
|
import * as i5$2 from 'ngx-tethys/dropdown';
|
|
47
45
|
import { ThyDropdownModule } from 'ngx-tethys/dropdown';
|
|
46
|
+
import * as i1$4 from 'ngx-tethys/notify';
|
|
47
|
+
import { ThyNotifyModule } from 'ngx-tethys/notify';
|
|
48
48
|
import * as i5$3 from 'ngx-tethys/switch';
|
|
49
49
|
import { ThySwitchModule } from 'ngx-tethys/switch';
|
|
50
50
|
import * as i9 from 'ngx-tethys/resizable';
|
|
@@ -612,10 +612,6 @@ class TheContextService {
|
|
|
612
612
|
const editableElement = this.getEditableElement();
|
|
613
613
|
return editableElement === null || editableElement === void 0 ? void 0 : editableElement.firstElementChild;
|
|
614
614
|
}
|
|
615
|
-
layoutDefaultWidth() {
|
|
616
|
-
const firstElementChild = this.getFirstElementChild();
|
|
617
|
-
return 0.48 * firstElementChild.clientWidth;
|
|
618
|
-
}
|
|
619
615
|
addUploadingFiles(file) {
|
|
620
616
|
this.uploadingFiles.push(file);
|
|
621
617
|
}
|
|
@@ -2818,13 +2814,13 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
2818
2814
|
}
|
|
2819
2815
|
get imageBindingWidth() {
|
|
2820
2816
|
var _a, _b, _c;
|
|
2821
|
-
|
|
2817
|
+
const currentWidth = ((_a = this.imageEntry) === null || _a === void 0 ? void 0 : _a.width) || this.naturalWidth;
|
|
2818
|
+
return ((_b = this.imageEntry) === null || _b === void 0 ? void 0 : _b.layout) && currentWidth > this.layoutDefaultWidth && !((_c = this.imageEntry) === null || _c === void 0 ? void 0 : _c.reSized)
|
|
2822
2819
|
? this.layoutDefaultWidth
|
|
2823
2820
|
: this.imageEntry.width;
|
|
2824
2821
|
}
|
|
2825
2822
|
ngOnInit() {
|
|
2826
2823
|
var _a;
|
|
2827
|
-
this.layoutDefaultWidth = this.theContextService.layoutDefaultWidth();
|
|
2828
2824
|
this.fileItem = this.theContextService.uploadingFiles.find(item => item.url === this.element.url);
|
|
2829
2825
|
if (((_a = this.fileItem) === null || _a === void 0 ? void 0 : _a.file) && this.fileItem.file instanceof File) {
|
|
2830
2826
|
this.uploadImage(this.fileItem.file);
|
|
@@ -2845,6 +2841,10 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
2845
2841
|
ngOnDestroy() {
|
|
2846
2842
|
this.uploadingSubscription.unsubscribe();
|
|
2847
2843
|
this.mouseUpSubscription.unsubscribe();
|
|
2844
|
+
this.theContextService.removeUploadImage(this.fileItem);
|
|
2845
|
+
if (this.uploading) {
|
|
2846
|
+
this.theContextService.uploadingStatus$.next(false);
|
|
2847
|
+
}
|
|
2848
2848
|
super.ngOnDestroy();
|
|
2849
2849
|
}
|
|
2850
2850
|
ngAfterViewInit() {
|
|
@@ -2902,7 +2902,7 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
2902
2902
|
printerPositionY: event.pageY,
|
|
2903
2903
|
internalWidth: imgElement.width || this.imageEntry.width,
|
|
2904
2904
|
internalHeight: imgElement.height || this.imageEntry.height,
|
|
2905
|
-
maxWidth: this.theContextService.
|
|
2905
|
+
maxWidth: this.theContextService.getFirstElementChild().clientWidth
|
|
2906
2906
|
};
|
|
2907
2907
|
this.mouseMoveSubscription = this.theContextService.onMouseMove$.subscribe(e => this.mouseMoveHandle(e, options));
|
|
2908
2908
|
}
|
|
@@ -6911,18 +6911,13 @@ class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
|
|
|
6911
6911
|
get isOpen() {
|
|
6912
6912
|
return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
|
|
6913
6913
|
}
|
|
6914
|
-
handleDocumentMouseDown(event) {
|
|
6915
|
-
if (!this.elementRef.nativeElement.contains(event.target)) {
|
|
6916
|
-
this.closeDropdownPopover();
|
|
6917
|
-
}
|
|
6918
|
-
}
|
|
6919
6914
|
ngOnInit() {
|
|
6920
|
-
var _a;
|
|
6915
|
+
var _a, _b, _c, _d;
|
|
6921
6916
|
if (!this.activeMenuItem) {
|
|
6922
6917
|
this.activeMenuItem = this.defaultDropdownItem;
|
|
6923
6918
|
}
|
|
6924
|
-
if (this.toolbarItem) {
|
|
6925
|
-
this.elementRef.nativeElement.classList.add(`${(
|
|
6919
|
+
if (this.toolbarItem && ((_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key)) {
|
|
6920
|
+
(_c = (_b = this.elementRef.nativeElement) === null || _b === void 0 ? void 0 : _b.classList) === null || _c === void 0 ? void 0 : _c.add(`${(_d = this.toolbarItem) === null || _d === void 0 ? void 0 : _d.key}`);
|
|
6926
6921
|
}
|
|
6927
6922
|
}
|
|
6928
6923
|
toggleDropdown(event) {
|
|
@@ -6947,6 +6942,9 @@ class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
|
|
|
6947
6942
|
item === null || item === void 0 ? void 0 : item.execute(this.editor);
|
|
6948
6943
|
}
|
|
6949
6944
|
}
|
|
6945
|
+
preventDefault(event) {
|
|
6946
|
+
event.preventDefault();
|
|
6947
|
+
}
|
|
6950
6948
|
openDropdownPopover(event) {
|
|
6951
6949
|
var _a, _b;
|
|
6952
6950
|
this.dropdownPopoverRef = this.thyPopover.open(this.dropdownTemplate, {
|
|
@@ -6955,6 +6953,7 @@ class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
|
|
|
6955
6953
|
originActiveClass: 'active',
|
|
6956
6954
|
placement: 'bottomLeft',
|
|
6957
6955
|
insideClosable: false,
|
|
6956
|
+
outsideClosable: true,
|
|
6958
6957
|
backdropClosable: true,
|
|
6959
6958
|
hasBackdrop: false,
|
|
6960
6959
|
offset: 10,
|
|
@@ -6990,10 +6989,10 @@ class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
|
|
|
6990
6989
|
}
|
|
6991
6990
|
}
|
|
6992
6991
|
TheToolbarDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TheToolbarDropdownComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2$1.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
6993
|
-
TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { itemMousedownHandle: "itemMousedownHandle" }, host: {
|
|
6992
|
+
TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { itemMousedownHandle: "itemMousedownHandle" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<a\n *ngIf=\"mode === dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"icon-mode link-with-down\"\n thyAction\n [thyActionIcon]=\"activeMenuItem?.icon\"\n [thyTooltip]=\"activeMenuItem?.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n<a\n *ngIf=\"mode !== dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"text-mode\"\n thyAction\n [thyTooltip]=\"activeMenuItem?.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <span class=\"show-text\">{{ activeMenuItem?.name }}</span>\n <thy-icon class=\"font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n href=\"javascript:;\"\n thyDropdownMenuItem\n [ngStyle]=\"menu?.styles\"\n [thyDropdownMenuItemActive]=\"menu.key === activeMenuItem?.key && !toolbarItem?.dropdownFixedIcon\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"itemMousedown($event, menu)\"\n >\n <thy-icon *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyDropdownMenuItemIcon [thyIconName]=\"menu.icon\"></thy-icon>\n <span *ngIf=\"menu.name\" thyDropdownMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-dropdown-menu-divider *ngIf=\"menu.key === 'split'\"></thy-dropdown-menu-divider>\n </ng-container>\n </div>\n</ng-template>\n", components: [{ type: i3$1.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { type: i2.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.ThyDropdownMenuDividerComponent, selector: "thy-dropdown-menu-divider" }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$2.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$2.ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5$2.ThyDropdownMenuItemActiveDirective, selector: "[thyDropdownMenuItemActive]", inputs: ["thyDropdownMenuItemActive"] }, { type: i5$2.ThyDropdownMenuItemIconDirective, selector: "[thyDropdownMenuItemIcon]" }, { type: i5$2.ThyDropdownMenuItemNameDirective, selector: "[thyDropdownMenuItemName]" }] });
|
|
6994
6993
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TheToolbarDropdownComponent, decorators: [{
|
|
6995
6994
|
type: Component,
|
|
6996
|
-
args: [{ selector: 'the-toolbar-dropdown', template: "<a\n *ngIf=\"mode === dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"icon-mode link-with-down\"\n thyAction\n [thyActionIcon]=\"activeMenuItem?.icon\"\n [thyTooltip]=\"activeMenuItem?.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"toggleDropdown($event)\"\n>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n<a\n *ngIf=\"mode !== dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"text-mode\"\n thyAction\n [thyTooltip]=\"activeMenuItem?.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"toggleDropdown($event)\"\n>\n <span class=\"show-text\">{{ activeMenuItem?.name }}</span>\n <thy-icon class=\"font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n href=\"javascript:;\"\n thyDropdownMenuItem\n [thyDropdownMenuItemActive]=\"menu.key === activeMenuItem?.key && !toolbarItem?.dropdownFixedIcon\"\n (mousedown)=\"
|
|
6995
|
+
args: [{ selector: 'the-toolbar-dropdown', template: "<a\n *ngIf=\"mode === dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"icon-mode link-with-down\"\n thyAction\n [thyActionIcon]=\"activeMenuItem?.icon\"\n [thyTooltip]=\"activeMenuItem?.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n<a\n *ngIf=\"mode !== dropdownMode.icon\"\n href=\"javascript:;\"\n class=\"text-mode\"\n thyAction\n [thyTooltip]=\"activeMenuItem?.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"toggleDropdown($event)\"\n>\n <span class=\"show-text\">{{ activeMenuItem?.name }}</span>\n <thy-icon class=\"font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <div class=\"thy-dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n href=\"javascript:;\"\n thyDropdownMenuItem\n [ngStyle]=\"menu?.styles\"\n [thyDropdownMenuItemActive]=\"menu.key === activeMenuItem?.key && !toolbarItem?.dropdownFixedIcon\"\n (mousedown)=\"preventDefault($event)\"\n (click)=\"itemMousedown($event, menu)\"\n >\n <thy-icon *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyDropdownMenuItemIcon [thyIconName]=\"menu.icon\"></thy-icon>\n <span *ngIf=\"menu.name\" thyDropdownMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-dropdown-menu-divider *ngIf=\"menu.key === 'split'\"></thy-dropdown-menu-divider>\n </ng-container>\n </div>\n</ng-template>\n" }]
|
|
6997
6996
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2$1.Overlay }]; }, propDecorators: { className: [{
|
|
6998
6997
|
type: HostBinding,
|
|
6999
6998
|
args: ['class']
|
|
@@ -7008,9 +7007,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
7008
7007
|
}], dropdownTemplate: [{
|
|
7009
7008
|
type: ViewChild,
|
|
7010
7009
|
args: ['dropdownTemplate', { static: true }]
|
|
7011
|
-
}], handleDocumentMouseDown: [{
|
|
7012
|
-
type: HostListener,
|
|
7013
|
-
args: ['document: mousedown', ['$event']]
|
|
7014
7010
|
}] } });
|
|
7015
7011
|
|
|
7016
7012
|
class TheCodeComponent extends TheBaseElementComponent {
|
|
@@ -7218,10 +7214,10 @@ class TheCodeComponent extends TheBaseElementComponent {
|
|
|
7218
7214
|
}
|
|
7219
7215
|
}
|
|
7220
7216
|
TheCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TheCodeComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$4.ThyNotifyService }, { token: TheContextService }, { token: i0.NgZone }, { token: THE_MODE_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
7221
|
-
TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }], usesInheritance: true, ngImport: i0, template: "<thy-actions
|
|
7217
|
+
TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }, { propertyName: "toolbarDropdownComponent", first: true, predicate: TheToolbarDropdownComponent, descendants: true, read: TheToolbarDropdownComponent }], usesInheritance: true, ngImport: i0, template: "<thy-actions\n *ngIf=\"(isCollapsed && codemirror && !options.readOnly) || toolbarDropdownComponent?.isOpen\"\n contenteditable=\"false\"\n class=\"the-code-block-operation\"\n thySize=\"xxs\"\n>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a href=\"javascript:;\" thyAction thyActionIcon=\"copy\" thyTooltip=\"\u590D\u5236\" thyTooltipPlacement=\"top\" (mousedown)=\"onCopy($event)\"></a>\n <thy-divider class=\"mx-2 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n</thy-actions>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsed, readonly: options.readOnly, active: isHightLight && isCollapsed }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsed && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3$1.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["itemMousedownHandle"] }, { type: i5$3.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i3$1.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { type: i4$1.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i8.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "options", "delayRefreshTime"], outputs: ["focusChange"] }, { type: i9.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4$2.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i9.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7222
7218
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TheCodeComponent, decorators: [{
|
|
7223
7219
|
type: Component,
|
|
7224
|
-
args: [{ selector: 'div[theCode]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<thy-actions
|
|
7220
|
+
args: [{ selector: 'div[theCode]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<thy-actions\n *ngIf=\"(isCollapsed && codemirror && !options.readOnly) || toolbarDropdownComponent?.isOpen\"\n contenteditable=\"false\"\n class=\"the-code-block-operation\"\n thySize=\"xxs\"\n>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center px-2 text-secondary\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex ml-1\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a href=\"javascript:;\" thyAction thyActionIcon=\"copy\" thyTooltip=\"\u590D\u5236\" thyTooltipPlacement=\"top\" (mousedown)=\"onCopy($event)\"></a>\n <thy-divider class=\"mx-2 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n thyActionIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n</thy-actions>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsed, readonly: options.readOnly, active: isHightLight && isCollapsed }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsed && !options.readOnly\"></thy-resize-handle>\n</div>\n" }]
|
|
7225
7221
|
}], ctorParameters: function () {
|
|
7226
7222
|
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$4.ThyNotifyService }, { type: TheContextService }, { type: i0.NgZone }, { type: TheModeConfig, decorators: [{
|
|
7227
7223
|
type: Inject,
|
|
@@ -7230,6 +7226,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
7230
7226
|
}, propDecorators: { codemirror: [{
|
|
7231
7227
|
type: ViewChild,
|
|
7232
7228
|
args: ['codemirror', { read: CodeMirrorComponent, static: false }]
|
|
7229
|
+
}], toolbarDropdownComponent: [{
|
|
7230
|
+
type: ViewChild,
|
|
7231
|
+
args: [TheToolbarDropdownComponent, { read: TheToolbarDropdownComponent, static: false }]
|
|
7233
7232
|
}] } });
|
|
7234
7233
|
|
|
7235
7234
|
const withCode = (editor) => {
|
|
@@ -11307,8 +11306,9 @@ class TheToolbarItemComponent extends TheBaseToolbarItem {
|
|
|
11307
11306
|
constructor(ngZone) {
|
|
11308
11307
|
super();
|
|
11309
11308
|
this.ngZone = ngZone;
|
|
11310
|
-
this.itemMode = ToolbarItemMode.horizontal;
|
|
11311
11309
|
this.ToolbarItemMode = ToolbarItemMode;
|
|
11310
|
+
this.className = 'the-toolbar-item';
|
|
11311
|
+
this.itemMode = ToolbarItemMode.horizontal;
|
|
11312
11312
|
}
|
|
11313
11313
|
toggleDropdown(event) {
|
|
11314
11314
|
super.execute(event);
|
|
@@ -11319,6 +11319,9 @@ class TheToolbarItemComponent extends TheBaseToolbarItem {
|
|
|
11319
11319
|
this.renderToolbarItem();
|
|
11320
11320
|
}
|
|
11321
11321
|
}
|
|
11322
|
+
preventDefault(event) {
|
|
11323
|
+
event.preventDefault();
|
|
11324
|
+
}
|
|
11322
11325
|
execute(event) {
|
|
11323
11326
|
var _a, _b, _c;
|
|
11324
11327
|
super.execute(event);
|
|
@@ -11337,7 +11340,7 @@ class TheToolbarItemComponent extends TheBaseToolbarItem {
|
|
|
11337
11340
|
}
|
|
11338
11341
|
}
|
|
11339
11342
|
TheToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TheToolbarItemComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
11340
|
-
TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { itemMode: "itemMode" }, host: { listeners: { "mousedown": "toggleDropdown($event)" },
|
|
11343
|
+
TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { itemMode: "itemMode" }, host: { listeners: { "mousedown": "toggleDropdown($event)" }, properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
11341
11344
|
<ng-container *ngIf="itemMode === ToolbarItemMode.horizontal; else selectionItem">
|
|
11342
11345
|
<a
|
|
11343
11346
|
href="javascript:;"
|
|
@@ -11347,7 +11350,8 @@ TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
|
|
|
11347
11350
|
[thyTooltip]="tooltip"
|
|
11348
11351
|
[thyTooltipTemplateContext]="{ name: toolbarItem.name, shortcutKey: toolbarItem.shortcutKey }"
|
|
11349
11352
|
thyTooltipPlacement="top"
|
|
11350
|
-
(mousedown)="
|
|
11353
|
+
(mousedown)="preventDefault($event)"
|
|
11354
|
+
(click)="execute($event)"
|
|
11351
11355
|
></a>
|
|
11352
11356
|
</ng-container>
|
|
11353
11357
|
<ng-template #selectionItem>
|
|
@@ -11373,7 +11377,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
11373
11377
|
[thyTooltip]="tooltip"
|
|
11374
11378
|
[thyTooltipTemplateContext]="{ name: toolbarItem.name, shortcutKey: toolbarItem.shortcutKey }"
|
|
11375
11379
|
thyTooltipPlacement="top"
|
|
11376
|
-
(mousedown)="
|
|
11380
|
+
(mousedown)="preventDefault($event)"
|
|
11381
|
+
(click)="execute($event)"
|
|
11377
11382
|
></a>
|
|
11378
11383
|
</ng-container>
|
|
11379
11384
|
<ng-template #selectionItem>
|
|
@@ -11384,12 +11389,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
11384
11389
|
</ng-template>
|
|
11385
11390
|
<ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>
|
|
11386
11391
|
<ng-container #toolbarContainer></ng-container>
|
|
11387
|
-
|
|
11388
|
-
host: {
|
|
11389
|
-
class: 'the-toolbar-item'
|
|
11390
|
-
}
|
|
11392
|
+
`
|
|
11391
11393
|
}]
|
|
11392
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: {
|
|
11394
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { className: [{
|
|
11395
|
+
type: HostBinding,
|
|
11396
|
+
args: ['class']
|
|
11397
|
+
}], itemMode: [{
|
|
11393
11398
|
type: Input
|
|
11394
11399
|
}], toolbarContainer: [{
|
|
11395
11400
|
type: ViewChild,
|
|
@@ -12534,12 +12539,15 @@ class TheToolbarComponent {
|
|
|
12534
12539
|
* └───────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
12535
12540
|
* split width: 17px
|
|
12536
12541
|
* item width: default item: 35px; dropdown item: 42px
|
|
12542
|
+
* default paddingRight: 4px
|
|
12537
12543
|
* set aside 50px
|
|
12538
12544
|
*/
|
|
12539
12545
|
toolbarItemsCompose() {
|
|
12540
12546
|
let elementWidth = this.isMore ? this.elementWidth : null;
|
|
12541
|
-
|
|
12542
|
-
const
|
|
12547
|
+
// dropdown item + paddingRight
|
|
12548
|
+
const maxItemWidth = 46;
|
|
12549
|
+
// default item + paddingRight
|
|
12550
|
+
const defaultItemWidth = 36;
|
|
12543
12551
|
const splitWidth = 17;
|
|
12544
12552
|
const splitPadding = 8;
|
|
12545
12553
|
// special type
|
|
@@ -13505,7 +13513,8 @@ class TheToolbarGroupComponent {
|
|
|
13505
13513
|
origin: event.currentTarget,
|
|
13506
13514
|
viewContainerRef: this.viewContainerRef,
|
|
13507
13515
|
hasBackdrop: false,
|
|
13508
|
-
outsideClosable: true
|
|
13516
|
+
outsideClosable: true,
|
|
13517
|
+
manualClosure: true
|
|
13509
13518
|
});
|
|
13510
13519
|
this.groupPopoverRef.afterClosed().subscribe(() => {
|
|
13511
13520
|
this.activeChange();
|