@worktile/theia 3.0.1 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/worktile-theia.umd.js +313 -377
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/components/toolbar/toolbar.component.d.ts +1 -2
- package/components/toolbar-dropdown/toolbar-dropdown.component.d.ts +3 -13
- package/components/toolbar-group/toolbar-group.component.d.ts +2 -2
- package/components/toolbar-item/toolbar-item.component.d.ts +3 -11
- package/core/toolbar-item/base-toolbar-item.d.ts +29 -0
- package/core/utils/index.d.ts +1 -0
- package/core/utils/merge-array.d.ts +1 -0
- package/editor.module.d.ts +42 -44
- package/esm2015/components/inline-toolbar/inline-toolbar.component.js +2 -2
- package/esm2015/components/toolbar/toolbar.component.js +14 -24
- package/esm2015/components/toolbar-dropdown/toolbar-dropdown.component.js +11 -41
- package/esm2015/components/toolbar-group/toolbar-group.component.js +4 -4
- package/esm2015/components/toolbar-item/toolbar-item.component.js +24 -41
- package/esm2015/constants/auto-format-rules.js +19 -2
- package/esm2015/core/toolbar-item/base-toolbar-item.js +92 -0
- package/esm2015/core/utils/index.js +2 -1
- package/esm2015/core/utils/merge-array.js +18 -0
- package/esm2015/core/utils/merge-deep-plugins.js +1 -3
- package/esm2015/core/utils/merge-options.js +9 -8
- package/esm2015/editor.component.js +4 -3
- package/esm2015/editor.module.js +1 -4
- package/esm2015/interfaces/plugins/plugins.js +1 -1
- package/esm2015/interfaces/toolbar.js +2 -2
- package/esm2015/plugins/align/align.editor.js +3 -7
- package/esm2015/plugins/align/align.plugin.js +7 -4
- package/esm2015/plugins/autoformat/autoformat.plugin.js +1 -1
- package/esm2015/plugins/code/code.component.js +3 -3
- package/esm2015/plugins/color/color.plugin.js +6 -3
- package/esm2015/plugins/color/toolbar-item.component.js +14 -23
- package/esm2015/plugins/deserializers/deserialize-html.plugin.js +3 -3
- package/esm2015/plugins/font-size/font-size.editor.js +7 -13
- package/esm2015/plugins/heading/heading.editor.js +2 -1
- package/esm2015/plugins/heading/heading.plugin.js +2 -2
- package/esm2015/plugins/indent/indent.editor.js +1 -10
- package/esm2015/plugins/indent/indent.plugin.js +8 -7
- package/esm2015/plugins/index.js +2 -2
- package/esm2015/plugins/inline-code/inline-code.plugin.js +5 -2
- package/esm2015/plugins/link/link.plugin.js +5 -2
- package/esm2015/plugins/mark/mark.plugin.js +6 -3
- package/esm2015/plugins/public-api.js +1 -2
- package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +2 -2
- package/esm2015/plugins/table/components/table.component.js +4 -1
- package/esm2015/plugins/table/toolbar-item.component.js +10 -20
- package/esm2015/plugins/vertical-align/toolbar-item.component.js +6 -20
- package/esm2015/plugins/vertical-align/vertical-align.editor.js +2 -2
- package/esm2015/public-api.js +2 -2
- package/esm2015/queries/get-insert-elements-path.js +1 -1
- package/esm2015/queries/get-plugin-key-by-toolbar-key.js +10 -0
- package/esm2015/queries/get-toolbar-disabled.js +14 -0
- package/esm2015/queries/index.js +4 -2
- package/esm2015/utils/fragment.js +7 -4
- package/fesm2015/worktile-theia.js +277 -342
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/plugins/plugins.d.ts +8 -2
- package/interfaces/toolbar.d.ts +2 -1
- package/package.json +1 -1
- package/plugins/autoformat/autoformat.plugin.d.ts +1 -1
- package/plugins/code/code.component.d.ts +1 -1
- package/plugins/color/toolbar-item.component.d.ts +3 -9
- package/plugins/font-size/font-size.editor.d.ts +0 -1
- package/plugins/heading/heading.plugin.d.ts +3 -3
- package/plugins/indent/indent.editor.d.ts +0 -1
- package/plugins/index.d.ts +1 -1
- package/plugins/public-api.d.ts +0 -1
- package/plugins/table/toolbar-item.component.d.ts +3 -9
- package/plugins/vertical-align/toolbar-item.component.d.ts +5 -13
- package/public-api.d.ts +1 -1
- package/queries/get-plugin-key-by-toolbar-key.d.ts +3 -0
- package/queries/get-toolbar-disabled.d.ts +4 -0
- package/queries/index.d.ts +3 -1
- package/utils/fragment.d.ts +2 -2
- package/components/toolbar-base-item/toolbar-base-item.component.d.ts +0 -11
- package/esm2015/components/toolbar-base-item/toolbar-base-item.component.js +0 -24
- package/esm2015/plugins/indent/toolbar-item.component.js +0 -115
- package/plugins/indent/toolbar-item.component.d.ts +0 -36
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, Component, ChangeDetectionStrategy, HostBinding, Injectable, Input, HostListener, ViewContainerRef, ChangeDetectorRef, Inject, ViewChild, Directive, ElementRef, TemplateRef, Pipe, EventEmitter, forwardRef, Output, NgModule } from '@angular/core';
|
|
3
3
|
import * as i10 from '@angular/common';
|
|
4
4
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
5
|
-
import * as i4
|
|
5
|
+
import * as i4 from '@angular/forms';
|
|
6
6
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
7
7
|
import * as i1 from 'slate-angular';
|
|
8
8
|
import { BaseTextComponent, BaseElementComponent, AngularEditor, NODE_TO_PARENT, NODE_TO_INDEX, IS_SAFARI, hotkeys, getPlainText as getPlainText$1, ELEMENT_TO_COMPONENT, hasBlockCard, isCardLeft, FAKE_RIGHT_BLOCK_CARD_OFFSET, isComponentType, EDITOR_TO_ELEMENT, withAngular, SlateModule } from 'slate-angular';
|
|
@@ -13,7 +13,7 @@ import { HistoryEditor, withHistory } from 'slate-history';
|
|
|
13
13
|
import { fromEvent, timer, Subject, combineLatest, Observable, BehaviorSubject, merge, ReplaySubject } from 'rxjs';
|
|
14
14
|
import * as i1$1 from 'ngx-tethys/popover';
|
|
15
15
|
import { ThyPopover } from 'ngx-tethys/popover';
|
|
16
|
-
import * as
|
|
16
|
+
import * as i3 from 'ngx-tethys/icon';
|
|
17
17
|
import { ThyIconModule } from 'ngx-tethys/icon';
|
|
18
18
|
import * as i5 from 'ngx-tethys/input';
|
|
19
19
|
import { ThyInputModule } from 'ngx-tethys/input';
|
|
@@ -33,7 +33,7 @@ import { ThyUploadStatus } from 'ngx-tethys/uploader';
|
|
|
33
33
|
import * as i1$3 from '@angular/platform-browser';
|
|
34
34
|
import * as i6 from 'ngx-tethys/progress';
|
|
35
35
|
import { ThyProgressModule } from 'ngx-tethys/progress';
|
|
36
|
-
import * as i3 from 'ngx-tethys/nav';
|
|
36
|
+
import * as i3$1 from 'ngx-tethys/nav';
|
|
37
37
|
import { ThyNavModule } from 'ngx-tethys/nav';
|
|
38
38
|
import * as i5$1 from 'ngx-tethys/tooltip';
|
|
39
39
|
import { ThyTooltipModule } from 'ngx-tethys/tooltip';
|
|
@@ -482,7 +482,7 @@ const THE_MODE_PROVIDER = {
|
|
|
482
482
|
var ToolbarItemType;
|
|
483
483
|
(function (ToolbarItemType) {
|
|
484
484
|
ToolbarItemType["default"] = "default";
|
|
485
|
-
ToolbarItemType["
|
|
485
|
+
ToolbarItemType["dropdown"] = "dropdown";
|
|
486
486
|
})(ToolbarItemType || (ToolbarItemType = {}));
|
|
487
487
|
var ToolbarAlignment;
|
|
488
488
|
(function (ToolbarAlignment) {
|
|
@@ -700,7 +700,7 @@ class TheColorSelectComponent {
|
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
TheColorSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheColorSelectComponent, deps: [{ token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
703
|
-
TheColorSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheColorSelectComponent, selector: "the-color-select", inputs: { selectedColor: "selectedColor", selectAction: "selectAction", showCustom: "showCustom", colors: "colors", option: "option" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)", "keydown": "handleKeydown($event)" } }, ngImport: i0, template: "<div class=\"color-container\">\n <div class=\"colors\">\n <div *ngFor=\"let row of selectColors; let rowIndex = index\">\n <span\n class=\"color-item\"\n *ngFor=\"let _color of row.rowValue; let i = index\"\n [ngClass]=\"_color.classMaps\"\n (mousedown)=\"_selectColor($event, _color.value)\"\n >\n <span [ngStyle]=\"{ background: _color.value }\">\n <thy-icon thyIconName=\"check\" [ngStyle]=\"{ color: row.tickColor }\"></thy-icon>\n </span>\n </span>\n </div>\n </div>\n <div *ngIf=\"option.showCustom\" class=\"select-color\">\n <span class=\"color\" [ngStyle]=\"{ background: selectedColor }\"></span>\n #\n <input\n thyInput\n maxlength=\"6\"\n (keydown.enter)=\"customInputColorEnter($event)\"\n onkeyup=\"value=value.replace(/[^0-9A-Fa-f]/g,'')\"\n class=\"value\"\n [(ngModel)]=\"customColor\"\n (ngModelChange)=\"colorChange(false)\"\n />\n </div>\n</div>\n", components: [{ type:
|
|
703
|
+
TheColorSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheColorSelectComponent, selector: "the-color-select", inputs: { selectedColor: "selectedColor", selectAction: "selectAction", showCustom: "showCustom", colors: "colors", option: "option" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)", "keydown": "handleKeydown($event)" } }, ngImport: i0, template: "<div class=\"color-container\">\n <div class=\"colors\">\n <div *ngFor=\"let row of selectColors; let rowIndex = index\">\n <span\n class=\"color-item\"\n *ngFor=\"let _color of row.rowValue; let i = index\"\n [ngClass]=\"_color.classMaps\"\n (mousedown)=\"_selectColor($event, _color.value)\"\n >\n <span [ngStyle]=\"{ background: _color.value }\">\n <thy-icon thyIconName=\"check\" [ngStyle]=\"{ color: row.tickColor }\"></thy-icon>\n </span>\n </span>\n </div>\n </div>\n <div *ngIf=\"option.showCustom\" class=\"select-color\">\n <span class=\"color\" [ngStyle]=\"{ background: selectedColor }\"></span>\n #\n <input\n thyInput\n maxlength=\"6\"\n (keydown.enter)=\"customInputColorEnter($event)\"\n onkeyup=\"value=value.replace(/[^0-9A-Fa-f]/g,'')\"\n class=\"value\"\n [(ngModel)]=\"customColor\"\n (ngModelChange)=\"colorChange(false)\"\n />\n </div>\n</div>\n", components: [{ type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.ThyInputDirective, selector: "[thyInput]", inputs: ["thySize", "thyAutocomplete"] }, { type: i4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
704
704
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheColorSelectComponent, decorators: [{
|
|
705
705
|
type: Component,
|
|
706
706
|
args: [{
|
|
@@ -1001,10 +1001,10 @@ function deleteElementKey(nodes, key) {
|
|
|
1001
1001
|
return nodes;
|
|
1002
1002
|
}
|
|
1003
1003
|
/**
|
|
1004
|
-
*
|
|
1004
|
+
* 过滤文本格式:颜色/背景色/字体大小
|
|
1005
1005
|
* @param node
|
|
1006
1006
|
*/
|
|
1007
|
-
function
|
|
1007
|
+
function filterTextFormat(node) {
|
|
1008
1008
|
node.children.forEach((child) => {
|
|
1009
1009
|
if (Text.isText(child)) {
|
|
1010
1010
|
if (child['color']) {
|
|
@@ -1013,9 +1013,12 @@ function deleteColorAndBackgroundColorOfText(node) {
|
|
|
1013
1013
|
if (child['background-color']) {
|
|
1014
1014
|
delete child['background-color'];
|
|
1015
1015
|
}
|
|
1016
|
+
if (child['font-size']) {
|
|
1017
|
+
delete child['font-size'];
|
|
1018
|
+
}
|
|
1016
1019
|
}
|
|
1017
1020
|
else {
|
|
1018
|
-
|
|
1021
|
+
filterTextFormat(child);
|
|
1019
1022
|
}
|
|
1020
1023
|
});
|
|
1021
1024
|
}
|
|
@@ -1088,19 +1091,36 @@ const getPlugin = (editor, key) => editor.pluginsByKey[key];
|
|
|
1088
1091
|
|
|
1089
1092
|
const getPluginOptions = (editor, key) => { var _a, _b; return (_b = (_a = getPlugin(editor, key)) === null || _a === void 0 ? void 0 : _a.options) !== null && _b !== void 0 ? _b : {}; };
|
|
1090
1093
|
|
|
1094
|
+
const mergeArray = (origin, source) => {
|
|
1095
|
+
if (!Array.isArray(source))
|
|
1096
|
+
return source;
|
|
1097
|
+
for (let i = 0; i < source.length; i++) {
|
|
1098
|
+
const value = source[i];
|
|
1099
|
+
if (isObject(value) && (value === null || value === void 0 ? void 0 : value.key) && origin.some((item) => (item === null || item === void 0 ? void 0 : item.key) === (value === null || value === void 0 ? void 0 : value.key))) {
|
|
1100
|
+
let index = origin.findIndex((item) => (item === null || item === void 0 ? void 0 : item.key) === (value === null || value === void 0 ? void 0 : value.key));
|
|
1101
|
+
origin[index] = Object.assign(Object.assign({}, origin[index]), value);
|
|
1102
|
+
continue;
|
|
1103
|
+
}
|
|
1104
|
+
if (origin.includes(source[i]))
|
|
1105
|
+
continue;
|
|
1106
|
+
origin.push(source[i]);
|
|
1107
|
+
}
|
|
1108
|
+
return origin;
|
|
1109
|
+
};
|
|
1110
|
+
|
|
1091
1111
|
const mergeOptions = (plugin, override) => {
|
|
1092
1112
|
const { options } = plugin;
|
|
1093
|
-
const newOptions =
|
|
1094
|
-
for (let option in options) {
|
|
1095
|
-
if (Array.isArray(options[option])) {
|
|
1096
|
-
newOptions[option] =
|
|
1113
|
+
const newOptions = options;
|
|
1114
|
+
for (let option in override.options) {
|
|
1115
|
+
if (Array.isArray(override.options[option]) && newOptions[option]) {
|
|
1116
|
+
newOptions[option] = mergeArray(newOptions[option], override.options[option]);
|
|
1097
1117
|
continue;
|
|
1098
1118
|
}
|
|
1099
|
-
if (isObject(options[option])) {
|
|
1100
|
-
newOptions[option] = _.assign(
|
|
1119
|
+
if (isObject(override.options[option]) && newOptions[option]) {
|
|
1120
|
+
newOptions[option] = _.assign(newOptions[option], override.options[option]);
|
|
1101
1121
|
continue;
|
|
1102
1122
|
}
|
|
1103
|
-
newOptions[option] = override.options[option]
|
|
1123
|
+
newOptions[option] = override.options[option];
|
|
1104
1124
|
}
|
|
1105
1125
|
plugin.options = newOptions;
|
|
1106
1126
|
};
|
|
@@ -1122,7 +1142,6 @@ const mergeDeepPlugins = (editor, _plugins) => {
|
|
|
1122
1142
|
newPlugins.forEach(p => {
|
|
1123
1143
|
if (editor.pluginsByKey[p.key]) {
|
|
1124
1144
|
mergeOptions(p, plugin.overrideByKey[p.key]);
|
|
1125
|
-
editor.pluginsByKey[p.key] = _.defaultsDeep(p, plugin.overrideByKey[p.key]);
|
|
1126
1145
|
}
|
|
1127
1146
|
});
|
|
1128
1147
|
}
|
|
@@ -2013,6 +2032,28 @@ const isContainNestedType = (editor, types) => {
|
|
|
2013
2032
|
return false;
|
|
2014
2033
|
};
|
|
2015
2034
|
|
|
2035
|
+
const getToolbarItemDisabled = (editor, key, customTypes) => {
|
|
2036
|
+
var _a, _b;
|
|
2037
|
+
if (editor.selection) {
|
|
2038
|
+
let disabledOperateTypes = (_b = (_a = getPluginOptions(editor, key)) === null || _a === void 0 ? void 0 : _a.disabledOperateTypes) !== null && _b !== void 0 ? _b : [];
|
|
2039
|
+
if (customTypes === null || customTypes === void 0 ? void 0 : customTypes.length) {
|
|
2040
|
+
disabledOperateTypes = Array.from(new Set([...disabledOperateTypes, ...customTypes]));
|
|
2041
|
+
}
|
|
2042
|
+
const anchorNode = anchorBlock(editor);
|
|
2043
|
+
return anchorNode && disabledOperateTypes.includes(anchorNode === null || anchorNode === void 0 ? void 0 : anchorNode.type);
|
|
2044
|
+
}
|
|
2045
|
+
};
|
|
2046
|
+
|
|
2047
|
+
const getPluginKeyByToolbarKey = (editor, toolbarKey) => {
|
|
2048
|
+
for (let key in editor.pluginsByKey) {
|
|
2049
|
+
const toolbarItems = editor.pluginsByKey[key].toolbarItems;
|
|
2050
|
+
if (toolbarItems && toolbarItems.some(item => item.key === toolbarKey)) {
|
|
2051
|
+
toolbarKey = key;
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
return toolbarKey;
|
|
2055
|
+
};
|
|
2056
|
+
|
|
2016
2057
|
var index$1 = /*#__PURE__*/Object.freeze({
|
|
2017
2058
|
__proto__: null,
|
|
2018
2059
|
getLastNode: getLastNode,
|
|
@@ -2069,7 +2110,9 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
2069
2110
|
findPath: findPath,
|
|
2070
2111
|
findNode: findNode,
|
|
2071
2112
|
findDescendant: findDescendant,
|
|
2072
|
-
someNode: someNode
|
|
2113
|
+
someNode: someNode,
|
|
2114
|
+
getToolbarItemDisabled: getToolbarItemDisabled,
|
|
2115
|
+
getPluginKeyByToolbarKey: getPluginKeyByToolbarKey
|
|
2073
2116
|
});
|
|
2074
2117
|
|
|
2075
2118
|
const insertElements = (editor, elements) => {
|
|
@@ -3029,7 +3072,7 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
3029
3072
|
}
|
|
3030
3073
|
}
|
|
3031
3074
|
TheImageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheImageComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.DomSanitizer }, { token: THE_UPLOAD_SERVICE_TOKEN }, { token: i0.ChangeDetectorRef }, { token: TheContextService }, { token: i1$1.ThyPopover }, { token: i2.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3032
|
-
TheImageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div\n #imageContent\n *ngIf=\"imageEntry.thumbUrl\"\n class=\"image-content\"\n [class.pointer]=\"!selection\"\n [ngStyle]=\"{\n 'width.px':\n imageEntry?.layout && imageEntry?.width > layoutDefaultWidth && !imageEntry?.reSized\n ? layoutDefaultWidth\n : imageEntry.width,\n 'height.px': imageEntry.height\n }\"\n >\n <img #img class=\"main-image\" [src]=\"imageEntry.thumbUrl\" [alt]=\"imageEntry.name\" />\n <div *ngIf=\"selection\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"></thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" (mousedown)=\"preview($event)\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n\n<ng-template #layoutToolbar>\n <div class=\"the-block-toolbar-popover\" contenteditable=\"false\">\n <thy-icon-nav>\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyIconNavLink\n [ngClass]=\"{ 'remove-link': item.key === 'remove' }\"\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n [thyIconNavLinkActive]=\"layoutActive(item.key)\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <nav-split-line *ngIf=\"item.key === 'split'\"></nav-split-line>\n </ng-container>\n </thy-icon-nav>\n </div>\n</ng-template>\n", components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i6.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips"] }, { type:
|
|
3075
|
+
TheImageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div\n #imageContent\n *ngIf=\"imageEntry.thumbUrl\"\n class=\"image-content\"\n [class.pointer]=\"!selection\"\n [ngStyle]=\"{\n 'width.px':\n imageEntry?.layout && imageEntry?.width > layoutDefaultWidth && !imageEntry?.reSized\n ? layoutDefaultWidth\n : imageEntry.width,\n 'height.px': imageEntry.height\n }\"\n >\n <img #img class=\"main-image\" [src]=\"imageEntry.thumbUrl\" [alt]=\"imageEntry.name\" />\n <div *ngIf=\"selection\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"></thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" (mousedown)=\"preview($event)\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n\n<ng-template #layoutToolbar>\n <div class=\"the-block-toolbar-popover\" contenteditable=\"false\">\n <thy-icon-nav>\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyIconNavLink\n [ngClass]=\"{ 'remove-link': item.key === 'remove' }\"\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n [thyIconNavLinkActive]=\"layoutActive(item.key)\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <nav-split-line *ngIf=\"item.key === 'split'\"></nav-split-line>\n </ng-container>\n </thy-icon-nav>\n </div>\n</ng-template>\n", components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i6.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips"] }, { type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i3$1.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i3$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
3033
3076
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheImageComponent, decorators: [{
|
|
3034
3077
|
type: Component,
|
|
3035
3078
|
args: [{
|
|
@@ -5359,12 +5402,7 @@ const AlignEditor = {
|
|
|
5359
5402
|
var _a;
|
|
5360
5403
|
const contextService = (_a = editor === null || editor === void 0 ? void 0 : editor.injector) === null || _a === void 0 ? void 0 : _a.get(TheContextService);
|
|
5361
5404
|
const { theOptions: { richMedia } } = contextService.getOptions();
|
|
5362
|
-
|
|
5363
|
-
const disableGroup = [ElementKinds.image];
|
|
5364
|
-
const anchorBlock$1 = anchorBlock(editor);
|
|
5365
|
-
return anchorBlock$1 && disableGroup.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
|
|
5366
|
-
}
|
|
5367
|
-
return false;
|
|
5405
|
+
return getToolbarItemDisabled(editor, PluginKeys.align, richMedia ? [ElementKinds.image] : []);
|
|
5368
5406
|
},
|
|
5369
5407
|
setAlign(editor, alignment) {
|
|
5370
5408
|
if (TableEditor.setAlign(editor, alignment)) {
|
|
@@ -5404,7 +5442,7 @@ const createAlignPlugin = createPluginFactory({
|
|
|
5404
5442
|
toolbarItems: [
|
|
5405
5443
|
{
|
|
5406
5444
|
key: ToolbarActionTypes.alignType,
|
|
5407
|
-
type: ToolbarItemType.
|
|
5445
|
+
type: ToolbarItemType.dropdown,
|
|
5408
5446
|
dropdownMode: DropdownMode.icon,
|
|
5409
5447
|
dropdownItemKey: ToolbarActionTypes.alignLeft,
|
|
5410
5448
|
includes: [ToolbarActionTypes.alignLeft, ToolbarActionTypes.alignCenter, ToolbarActionTypes.alignRight],
|
|
@@ -5432,11 +5470,15 @@ const createAlignPlugin = createPluginFactory({
|
|
|
5432
5470
|
execute: editor => AlignEditor.setAlign(editor, Alignment.right),
|
|
5433
5471
|
active: editor => AlignEditor.isActive(editor, Alignment.right)
|
|
5434
5472
|
}
|
|
5435
|
-
]
|
|
5473
|
+
],
|
|
5474
|
+
options: {
|
|
5475
|
+
disabledOperateTypes: [ElementKinds.code]
|
|
5476
|
+
}
|
|
5436
5477
|
});
|
|
5437
5478
|
|
|
5438
5479
|
const headingOptions = {
|
|
5439
5480
|
allowParentTypes: [ElementKinds.tableCell, ElementKinds.blockquote],
|
|
5481
|
+
disabledOperateTypes: [ElementKinds.image, ElementKinds.code],
|
|
5440
5482
|
cleanupTypes: [ElementKinds.bulletedList, ElementKinds.numberedList, ElementKinds.listItem]
|
|
5441
5483
|
};
|
|
5442
5484
|
const HeadingEditor = {
|
|
@@ -5514,7 +5556,7 @@ const createHeadingPlugin = createPluginFactory({
|
|
|
5514
5556
|
{
|
|
5515
5557
|
key: ElementKinds.headingList,
|
|
5516
5558
|
name: '正文',
|
|
5517
|
-
type: ToolbarItemType.
|
|
5559
|
+
type: ToolbarItemType.dropdown,
|
|
5518
5560
|
dropdownItemKey: ElementKinds.paragraph,
|
|
5519
5561
|
includes: [ElementKinds.paragraph, ...STANDARD_HEADING_TYPES]
|
|
5520
5562
|
},
|
|
@@ -5678,7 +5720,10 @@ const createMarkPlugin = createPluginFactory({
|
|
|
5678
5720
|
execute: editor => MarkEditor.toggleMark(editor, MarkTypes.underline),
|
|
5679
5721
|
active: editor => MarkEditor.isMarkActive(editor, MarkTypes.underline)
|
|
5680
5722
|
}
|
|
5681
|
-
]
|
|
5723
|
+
],
|
|
5724
|
+
options: {
|
|
5725
|
+
disabledOperateTypes: [ElementKinds.image, ElementKinds.code]
|
|
5726
|
+
}
|
|
5682
5727
|
});
|
|
5683
5728
|
|
|
5684
5729
|
const withNodeID = (e) => {
|
|
@@ -5939,6 +5984,7 @@ const CodeEditor = {
|
|
|
5939
5984
|
|
|
5940
5985
|
const defaultAutoFormatRules = [
|
|
5941
5986
|
{
|
|
5987
|
+
key: ElementKinds.heading_1,
|
|
5942
5988
|
type: ElementKinds.heading_1,
|
|
5943
5989
|
markup: '#',
|
|
5944
5990
|
format: (editor) => {
|
|
@@ -5946,6 +5992,7 @@ const defaultAutoFormatRules = [
|
|
|
5946
5992
|
}
|
|
5947
5993
|
},
|
|
5948
5994
|
{
|
|
5995
|
+
key: ElementKinds.heading_2,
|
|
5949
5996
|
type: ElementKinds.heading_2,
|
|
5950
5997
|
markup: '##',
|
|
5951
5998
|
format: (editor) => {
|
|
@@ -5953,6 +6000,7 @@ const defaultAutoFormatRules = [
|
|
|
5953
6000
|
}
|
|
5954
6001
|
},
|
|
5955
6002
|
{
|
|
6003
|
+
key: ElementKinds.heading_3,
|
|
5956
6004
|
type: ElementKinds.heading_3,
|
|
5957
6005
|
markup: '###',
|
|
5958
6006
|
format: (editor) => {
|
|
@@ -5960,6 +6008,7 @@ const defaultAutoFormatRules = [
|
|
|
5960
6008
|
}
|
|
5961
6009
|
},
|
|
5962
6010
|
{
|
|
6011
|
+
key: ElementKinds.heading_4,
|
|
5963
6012
|
type: ElementKinds.heading_4,
|
|
5964
6013
|
markup: '####',
|
|
5965
6014
|
format: (editor) => {
|
|
@@ -5967,6 +6016,7 @@ const defaultAutoFormatRules = [
|
|
|
5967
6016
|
}
|
|
5968
6017
|
},
|
|
5969
6018
|
{
|
|
6019
|
+
key: ElementKinds.heading_5,
|
|
5970
6020
|
type: ElementKinds.heading_5,
|
|
5971
6021
|
markup: '#####',
|
|
5972
6022
|
format: (editor) => {
|
|
@@ -5974,6 +6024,7 @@ const defaultAutoFormatRules = [
|
|
|
5974
6024
|
}
|
|
5975
6025
|
},
|
|
5976
6026
|
{
|
|
6027
|
+
key: ElementKinds.heading_6,
|
|
5977
6028
|
type: ElementKinds.heading_6,
|
|
5978
6029
|
markup: '######',
|
|
5979
6030
|
format: (editor) => {
|
|
@@ -5981,6 +6032,7 @@ const defaultAutoFormatRules = [
|
|
|
5981
6032
|
}
|
|
5982
6033
|
},
|
|
5983
6034
|
{
|
|
6035
|
+
key: ElementKinds.blockquote,
|
|
5984
6036
|
type: ElementKinds.blockquote,
|
|
5985
6037
|
markup: ['>'],
|
|
5986
6038
|
format: (editor) => {
|
|
@@ -5988,30 +6040,35 @@ const defaultAutoFormatRules = [
|
|
|
5988
6040
|
}
|
|
5989
6041
|
},
|
|
5990
6042
|
{
|
|
6043
|
+
key: MarkTypes.bold,
|
|
5991
6044
|
type: MarkTypes.bold,
|
|
5992
6045
|
between: ['**', '**'],
|
|
5993
6046
|
mode: 'inline',
|
|
5994
6047
|
insertTrigger: true
|
|
5995
6048
|
},
|
|
5996
6049
|
{
|
|
6050
|
+
key: `${MarkTypes.bold}__`,
|
|
5997
6051
|
type: MarkTypes.bold,
|
|
5998
6052
|
between: ['__', '__'],
|
|
5999
6053
|
mode: 'inline',
|
|
6000
6054
|
insertTrigger: true
|
|
6001
6055
|
},
|
|
6002
6056
|
{
|
|
6057
|
+
key: MarkTypes.italic,
|
|
6003
6058
|
type: MarkTypes.italic,
|
|
6004
6059
|
between: ['*', '*'],
|
|
6005
6060
|
mode: 'inline',
|
|
6006
6061
|
insertTrigger: true
|
|
6007
6062
|
},
|
|
6008
6063
|
{
|
|
6064
|
+
key: `${MarkTypes.italic}_`,
|
|
6009
6065
|
type: MarkTypes.italic,
|
|
6010
6066
|
between: ['_', '_'],
|
|
6011
6067
|
mode: 'inline',
|
|
6012
6068
|
insertTrigger: true
|
|
6013
6069
|
},
|
|
6014
6070
|
{
|
|
6071
|
+
key: ElementKinds.inlineCode,
|
|
6015
6072
|
type: ElementKinds.inlineCode,
|
|
6016
6073
|
between: ['`', '`'],
|
|
6017
6074
|
mode: 'inline',
|
|
@@ -6021,12 +6078,14 @@ const defaultAutoFormatRules = [
|
|
|
6021
6078
|
}
|
|
6022
6079
|
},
|
|
6023
6080
|
{
|
|
6081
|
+
key: MarkTypes.strike,
|
|
6024
6082
|
type: MarkTypes.strike,
|
|
6025
6083
|
between: ['~~', '~~'],
|
|
6026
6084
|
mode: 'inline',
|
|
6027
6085
|
insertTrigger: true
|
|
6028
6086
|
},
|
|
6029
6087
|
{
|
|
6088
|
+
key: ElementKinds.code,
|
|
6030
6089
|
type: ElementKinds.code,
|
|
6031
6090
|
markup: '```',
|
|
6032
6091
|
format: (editor) => {
|
|
@@ -6034,6 +6093,7 @@ const defaultAutoFormatRules = [
|
|
|
6034
6093
|
}
|
|
6035
6094
|
},
|
|
6036
6095
|
{
|
|
6096
|
+
key: ElementKinds.listItem,
|
|
6037
6097
|
type: ElementKinds.listItem,
|
|
6038
6098
|
markup: [],
|
|
6039
6099
|
match: (editor) => {
|
|
@@ -6044,8 +6104,8 @@ const defaultAutoFormatRules = [
|
|
|
6044
6104
|
}
|
|
6045
6105
|
},
|
|
6046
6106
|
{
|
|
6047
|
-
type: ElementKinds.listItem,
|
|
6048
6107
|
key: ElementKinds.numberedList,
|
|
6108
|
+
type: ElementKinds.listItem,
|
|
6049
6109
|
markup: [],
|
|
6050
6110
|
match: (editor, textFromBlockStart) => {
|
|
6051
6111
|
return isParagraph(editor) && /^-?\d+(\.|\))$/.test(textFromBlockStart) ? [textFromBlockStart] : [];
|
|
@@ -6062,6 +6122,7 @@ const defaultAutoFormatRules = [
|
|
|
6062
6122
|
}
|
|
6063
6123
|
},
|
|
6064
6124
|
{
|
|
6125
|
+
key: ElementKinds.checkItem,
|
|
6065
6126
|
type: ElementKinds.checkItem,
|
|
6066
6127
|
markup: [],
|
|
6067
6128
|
match: (editor) => {
|
|
@@ -6072,6 +6133,7 @@ const defaultAutoFormatRules = [
|
|
|
6072
6133
|
}
|
|
6073
6134
|
},
|
|
6074
6135
|
{
|
|
6136
|
+
key: ElementKinds.hr,
|
|
6075
6137
|
type: ElementKinds.hr,
|
|
6076
6138
|
markup: '---',
|
|
6077
6139
|
insertTrigger: true
|
|
@@ -6742,7 +6804,19 @@ const createRemoveVoidPlugin = createPluginFactory({
|
|
|
6742
6804
|
withOverrides: withRemoveVoid
|
|
6743
6805
|
});
|
|
6744
6806
|
|
|
6745
|
-
class
|
|
6807
|
+
class TheBaseToolbarItem {
|
|
6808
|
+
set toolbarItem(value) {
|
|
6809
|
+
this._toolbarItem = value;
|
|
6810
|
+
}
|
|
6811
|
+
get toolbarItem() {
|
|
6812
|
+
return this._toolbarItem;
|
|
6813
|
+
}
|
|
6814
|
+
get disabledState() {
|
|
6815
|
+
return this.disabled;
|
|
6816
|
+
}
|
|
6817
|
+
get activeState() {
|
|
6818
|
+
return this.active;
|
|
6819
|
+
}
|
|
6746
6820
|
execute(event) {
|
|
6747
6821
|
var _a;
|
|
6748
6822
|
event.preventDefault();
|
|
@@ -6754,30 +6828,76 @@ class TheToolbarBaseItemComponent {
|
|
|
6754
6828
|
AngularEditor.focus(this.editor);
|
|
6755
6829
|
}
|
|
6756
6830
|
}
|
|
6831
|
+
selectionChange(editor) {
|
|
6832
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6833
|
+
if (editor.selection) {
|
|
6834
|
+
this.active = ((_a = this._toolbarItem) === null || _a === void 0 ? void 0 : _a.active) ? (_b = this._toolbarItem) === null || _b === void 0 ? void 0 : _b.active(editor) : false;
|
|
6835
|
+
if ((_c = this._toolbarItem) === null || _c === void 0 ? void 0 : _c.disable) {
|
|
6836
|
+
this.disabled = ((_d = this._toolbarItem) === null || _d === void 0 ? void 0 : _d.disable) ? (_e = this._toolbarItem) === null || _e === void 0 ? void 0 : _e.disable(editor) : false;
|
|
6837
|
+
}
|
|
6838
|
+
else {
|
|
6839
|
+
const pluginKey = getPluginKeyByToolbarKey(editor, (_f = this._toolbarItem) === null || _f === void 0 ? void 0 : _f.key);
|
|
6840
|
+
this.disabled = pluginKey && getToolbarItemDisabled(editor, pluginKey);
|
|
6841
|
+
}
|
|
6842
|
+
}
|
|
6843
|
+
}
|
|
6757
6844
|
}
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type:
|
|
6845
|
+
TheBaseToolbarItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheBaseToolbarItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6846
|
+
TheBaseToolbarItem.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: TheBaseToolbarItem, inputs: { toolbarItem: "toolbarItem", editor: "editor" }, host: { properties: { "class.disabled": "this.disabledState", "class.active": "this.activeState" } }, ngImport: i0 });
|
|
6847
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheBaseToolbarItem, decorators: [{
|
|
6761
6848
|
type: Directive
|
|
6762
|
-
}]
|
|
6849
|
+
}], propDecorators: { toolbarItem: [{
|
|
6850
|
+
type: Input
|
|
6851
|
+
}], editor: [{
|
|
6852
|
+
type: Input
|
|
6853
|
+
}], disabledState: [{
|
|
6854
|
+
type: HostBinding,
|
|
6855
|
+
args: ['class.disabled']
|
|
6856
|
+
}], activeState: [{
|
|
6857
|
+
type: HostBinding,
|
|
6858
|
+
args: ['class.active']
|
|
6859
|
+
}] } });
|
|
6860
|
+
class TheBaseToolbarDropdown extends TheBaseToolbarItem {
|
|
6861
|
+
constructor() {
|
|
6862
|
+
super(...arguments);
|
|
6863
|
+
this.mode = DropdownMode.text;
|
|
6864
|
+
}
|
|
6865
|
+
get defaultDropdownItem() {
|
|
6866
|
+
const activeItem = this.dropdownItemKey && this.menus.find((item) => item.key === this.dropdownItemKey);
|
|
6867
|
+
return activeItem ? activeItem : this.menus[0];
|
|
6868
|
+
}
|
|
6869
|
+
selectionChange(editor) {
|
|
6870
|
+
super.selectionChange(editor);
|
|
6871
|
+
const activeItem = this.menus.find(i => {
|
|
6872
|
+
if (i === null || i === void 0 ? void 0 : i.active) {
|
|
6873
|
+
return i === null || i === void 0 ? void 0 : i.active(editor);
|
|
6874
|
+
}
|
|
6875
|
+
});
|
|
6876
|
+
if (!this.toolbarItem.dropdownFixedIcon) {
|
|
6877
|
+
this.activeMenuItem = activeItem ? activeItem : this.defaultDropdownItem;
|
|
6878
|
+
}
|
|
6879
|
+
}
|
|
6880
|
+
}
|
|
6881
|
+
TheBaseToolbarDropdown.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheBaseToolbarDropdown, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
6882
|
+
TheBaseToolbarDropdown.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: TheBaseToolbarDropdown, inputs: { menus: "menus", mode: "mode", dropdownItemKey: "dropdownItemKey" }, usesInheritance: true, ngImport: i0 });
|
|
6883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheBaseToolbarDropdown, decorators: [{
|
|
6884
|
+
type: Directive
|
|
6885
|
+
}], propDecorators: { menus: [{
|
|
6886
|
+
type: Input
|
|
6887
|
+
}], mode: [{
|
|
6888
|
+
type: Input
|
|
6889
|
+
}], dropdownItemKey: [{
|
|
6890
|
+
type: Input
|
|
6891
|
+
}] } });
|
|
6763
6892
|
|
|
6764
|
-
class TheToolbarDropdownComponent extends
|
|
6893
|
+
class TheToolbarDropdownComponent extends TheBaseToolbarDropdown {
|
|
6765
6894
|
constructor(elementRef, thyPopover, viewContainerRef, overlay) {
|
|
6766
6895
|
super();
|
|
6767
6896
|
this.elementRef = elementRef;
|
|
6768
6897
|
this.thyPopover = thyPopover;
|
|
6769
6898
|
this.viewContainerRef = viewContainerRef;
|
|
6770
6899
|
this.overlay = overlay;
|
|
6771
|
-
this.mode = DropdownMode.text;
|
|
6772
6900
|
this.dropdownMode = DropdownMode;
|
|
6773
|
-
this.disabled = false;
|
|
6774
|
-
}
|
|
6775
|
-
set item(i) {
|
|
6776
|
-
this._item = i;
|
|
6777
|
-
this.activeMenu = i;
|
|
6778
|
-
}
|
|
6779
|
-
get item() {
|
|
6780
|
-
return this._item;
|
|
6781
6901
|
}
|
|
6782
6902
|
get isOpen() {
|
|
6783
6903
|
return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
|
|
@@ -6795,34 +6915,24 @@ class TheToolbarDropdownComponent extends TheToolbarBaseItemComponent {
|
|
|
6795
6915
|
this.closeDropdownPopover();
|
|
6796
6916
|
}
|
|
6797
6917
|
}
|
|
6798
|
-
get disabledState() {
|
|
6799
|
-
return this.disabled;
|
|
6800
|
-
}
|
|
6801
6918
|
ngOnInit() {
|
|
6802
6919
|
var _a;
|
|
6803
6920
|
if (!this.template) {
|
|
6804
6921
|
this.template = this.mode === this.dropdownMode.icon ? this.iconModeTemplate : this.textModeTemplate;
|
|
6805
6922
|
}
|
|
6806
|
-
if (!this.
|
|
6807
|
-
this.
|
|
6923
|
+
if (!this.activeMenuItem) {
|
|
6924
|
+
this.activeMenuItem = this.defaultDropdownItem;
|
|
6808
6925
|
}
|
|
6809
6926
|
if (this.toolbarItem) {
|
|
6810
6927
|
this.elementRef.nativeElement.classList.add(`${(_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key}`);
|
|
6811
6928
|
}
|
|
6812
6929
|
}
|
|
6813
|
-
statusChange(editor) {
|
|
6814
|
-
var _a, _b;
|
|
6815
|
-
this.disabled = ((_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.disable) ? (_b = this.toolbarItem) === null || _b === void 0 ? void 0 : _b.disable(editor) : false;
|
|
6816
|
-
const activeItem = this.menus.find(i => {
|
|
6817
|
-
if (i === null || i === void 0 ? void 0 : i.active) {
|
|
6818
|
-
return i === null || i === void 0 ? void 0 : i.active(editor);
|
|
6819
|
-
}
|
|
6820
|
-
});
|
|
6821
|
-
this.activeMenu = activeItem ? activeItem : this.item;
|
|
6822
|
-
}
|
|
6823
6930
|
itemMousedown(event, item) {
|
|
6824
6931
|
super.execute(event);
|
|
6825
6932
|
this.closeDropdownPopover();
|
|
6933
|
+
if (!this.toolbarItem.dropdownFixedIcon) {
|
|
6934
|
+
this.activeMenuItem = item;
|
|
6935
|
+
}
|
|
6826
6936
|
if (this.itemMousedownHandle) {
|
|
6827
6937
|
this.itemMousedownHandle(item);
|
|
6828
6938
|
return;
|
|
@@ -6872,7 +6982,7 @@ class TheToolbarDropdownComponent extends TheToolbarBaseItemComponent {
|
|
|
6872
6982
|
}
|
|
6873
6983
|
}
|
|
6874
6984
|
TheToolbarDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarDropdownComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
6875
|
-
TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: {
|
|
6985
|
+
TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { itemMousedownHandle: "itemMousedownHandle" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenuItem?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenuItem?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenuItem?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenuItem?.name }}</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenuItem.key && !toolbarItem.dropdownFixedIcon\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i2$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i2$1.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i10.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2$1.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i2$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
6876
6986
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarDropdownComponent, decorators: [{
|
|
6877
6987
|
type: Component,
|
|
6878
6988
|
args: [{
|
|
@@ -6882,15 +6992,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
6882
6992
|
class: 'the-toolbar-dropdown-container'
|
|
6883
6993
|
}
|
|
6884
6994
|
}]
|
|
6885
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2.Overlay }]; }, propDecorators: {
|
|
6886
|
-
type: Input
|
|
6887
|
-
}], menus: [{
|
|
6888
|
-
type: Input
|
|
6889
|
-
}], mode: [{
|
|
6890
|
-
type: Input
|
|
6891
|
-
}], item: [{
|
|
6892
|
-
type: Input
|
|
6893
|
-
}], itemMousedownHandle: [{
|
|
6995
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2.Overlay }]; }, propDecorators: { itemMousedownHandle: [{
|
|
6894
6996
|
type: Input
|
|
6895
6997
|
}], iconModeTemplate: [{
|
|
6896
6998
|
type: ViewChild,
|
|
@@ -6907,9 +7009,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
6907
7009
|
}], handleDocumentMouseDown: [{
|
|
6908
7010
|
type: HostListener,
|
|
6909
7011
|
args: ['document: mousedown', ['$event']]
|
|
6910
|
-
}], disabledState: [{
|
|
6911
|
-
type: HostBinding,
|
|
6912
|
-
args: ['class.disabled']
|
|
6913
7012
|
}] } });
|
|
6914
7013
|
|
|
6915
7014
|
class TheCodeComponent extends TheBaseElementComponent {
|
|
@@ -6942,7 +7041,7 @@ class TheCodeComponent extends TheBaseElementComponent {
|
|
|
6942
7041
|
};
|
|
6943
7042
|
this.actives = this.menus[0];
|
|
6944
7043
|
this.resizeBounds = null;
|
|
6945
|
-
this.
|
|
7044
|
+
this.onChangeLanguage = item => {
|
|
6946
7045
|
this.options = Object.assign(Object.assign({}, this.options), { mode: item.key });
|
|
6947
7046
|
this.actives = item;
|
|
6948
7047
|
CodeEditor.setCodeAttribute(this.editor, this.element, { language: item.key });
|
|
@@ -7114,7 +7213,7 @@ class TheCodeComponent extends TheBaseElementComponent {
|
|
|
7114
7213
|
}
|
|
7115
7214
|
}
|
|
7116
7215
|
TheCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", 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 });
|
|
7117
|
-
TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }], usesInheritance: true, ngImport: i0, template: "<div contenteditable=\"false\" class=\"the-code-block-operation\" *ngIf=\"isCollapsed && codemirror && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [
|
|
7216
|
+
TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }], usesInheritance: true, ngImport: i0, template: "<div contenteditable=\"false\" class=\"the-code-block-operation\" *ngIf=\"isCollapsed && codemirror && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [toolbarItem]=\"actives\" [itemMousedownHandle]=\"onChangeLanguage\"> </the-toolbar-dropdown>\n <span class=\"auto-wrap d-flex align-items-center\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n class=\"remove-link\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n </thy-icon-nav>\n</div>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [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.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["itemMousedownHandle"] }, { type: i5$2.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i3$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i8.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }, { type: i9.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i10.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: i5$1.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: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7118
7217
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheCodeComponent, decorators: [{
|
|
7119
7218
|
type: Component,
|
|
7120
7219
|
args: [{
|
|
@@ -7360,7 +7459,7 @@ class TheLinkEditComponent {
|
|
|
7360
7459
|
}
|
|
7361
7460
|
}
|
|
7362
7461
|
TheLinkEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheLinkEditComponent, deps: [{ token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
7363
|
-
TheLinkEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheLinkEditComponent, selector: "the-link-edit", inputs: { tag: "tag", node: "node", link: "link", text: "text", originSelection: "originSelection" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class": "this.className" } }, ngImport: i0, template: "<form\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig\"\n name=\"linkForm\"\n>\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\"\n required\n name=\"text\"\n [(ngModel)]=\"text\"\n thyAutofocus\n type=\"text\"\n />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input\n name=\"link\"\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\"\n required\n type=\"text\"\n #linkControl=\"ngModel\"\n [(ngModel)]=\"link\"\n />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button\n thyButton=\"link-secondary\"\n thySize=\"sm\"\n (click)=\"closePopover()\"\n >\u53D6\u6D88</button>\n <button\n thyButton=\"primary-square\"\n thySize=\"sm\"\n (thyFormSubmit)=\"applyLink(linkForm)\"\n >\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n", components: [{ type: i2$2.ThyFormGroupComponent, selector: "thy-form-group", inputs: ["thyLabelText", "thyLabelTextTranslateKey", "thyLabelRequired", "thyLabelPaddingTopClear", "thyFeedbackIcon", "thyTipsMode", "thyTips", "thyTipsTranslateKey", "thyRowFill"] }, { type: i2$2.ThyFormGroupFooterComponent, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { type: i1$5.ThyButtonComponent, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thySquare", "thyBlock"] }], directives: [{ type: i4
|
|
7462
|
+
TheLinkEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheLinkEditComponent, selector: "the-link-edit", inputs: { tag: "tag", node: "node", link: "link", text: "text", originSelection: "originSelection" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class": "this.className" } }, ngImport: i0, template: "<form\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig\"\n name=\"linkForm\"\n>\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\"\n required\n name=\"text\"\n [(ngModel)]=\"text\"\n thyAutofocus\n type=\"text\"\n />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input\n name=\"link\"\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\"\n required\n type=\"text\"\n #linkControl=\"ngModel\"\n [(ngModel)]=\"link\"\n />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button\n thyButton=\"link-secondary\"\n thySize=\"sm\"\n (click)=\"closePopover()\"\n >\u53D6\u6D88</button>\n <button\n thyButton=\"primary-square\"\n thySize=\"sm\"\n (thyFormSubmit)=\"applyLink(linkForm)\"\n >\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n", components: [{ type: i2$2.ThyFormGroupComponent, selector: "thy-form-group", inputs: ["thyLabelText", "thyLabelTextTranslateKey", "thyLabelRequired", "thyLabelPaddingTopClear", "thyFeedbackIcon", "thyTipsMode", "thyTips", "thyTipsTranslateKey", "thyRowFill"] }, { type: i2$2.ThyFormGroupFooterComponent, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { type: i1$5.ThyButtonComponent, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thySquare", "thyBlock"] }], directives: [{ type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$2.ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { type: i5$3.ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutoSelect", "thyAutofocus"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.ThyInputDirective, selector: "[thyInput]", inputs: ["thySize", "thyAutocomplete"] }, { type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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: i2$2.ThyFormSubmitDirective, selector: "[thyFormSubmit],[thy-form-submit]", outputs: ["thyFormSubmit"] }] });
|
|
7364
7463
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheLinkEditComponent, decorators: [{
|
|
7365
7464
|
type: Component,
|
|
7366
7465
|
args: [{
|
|
@@ -7584,7 +7683,10 @@ const createLinkPlugin = createPluginFactory({
|
|
|
7584
7683
|
execute: editor => LinkEditor.insertLink(editor),
|
|
7585
7684
|
active: editor => LinkEditor.isLinkActive(editor)
|
|
7586
7685
|
}
|
|
7587
|
-
]
|
|
7686
|
+
],
|
|
7687
|
+
options: {
|
|
7688
|
+
disabledOperateTypes: [ElementKinds.image, ElementKinds.code]
|
|
7689
|
+
}
|
|
7588
7690
|
});
|
|
7589
7691
|
|
|
7590
7692
|
/**
|
|
@@ -8394,7 +8496,7 @@ TheTableOptionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0
|
|
|
8394
8496
|
</a>
|
|
8395
8497
|
</ng-container>
|
|
8396
8498
|
</thy-action-menu>
|
|
8397
|
-
`, isInline: true, components: [{ type: i2$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type:
|
|
8499
|
+
`, isInline: true, components: [{ type: i2$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.ThyActionMenuItemExtendIconDirective, selector: "[thyActionMenuItemExtendIcon]" }] });
|
|
8398
8500
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheTableOptionsComponent, decorators: [{
|
|
8399
8501
|
type: Component,
|
|
8400
8502
|
args: [{
|
|
@@ -8548,7 +8650,7 @@ class TheTableToolbarComponent {
|
|
|
8548
8650
|
}
|
|
8549
8651
|
}
|
|
8550
8652
|
TheTableToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheTableToolbarComponent, deps: [{ token: i0.NgZone }, { token: TheColorSelectService }, { token: i1$1.ThyPopover }, { token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
8551
|
-
TheTableToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isActiveSelect: "isActiveSelect" }, ngImport: i0, template: "<thy-icon-nav>\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a href=\"javascript:;\" thyIconNavLink *ngIf=\"!item.invisibility\" [thyTooltip]=\"item.name\" (mousedown)=\"item.actionHandle()\">\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n </a>\n </ng-container>\n <nav-split-line *ngIf=\"!isActiveSelect && isShowSplitLine\"></nav-split-line>\n <a href=\"javascript:;\" thyIconNavLink thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <nav-split-line *ngIf=\"tableStore.isSelectedTable\"></nav-split-line>\n <button\n thyButton=\"default\"\n *ngIf=\"tableStore.isSelectedTable\"\n class=\"mr-2\"\n thySize=\"md\"\n class=\"table-options\"\n (mousedown)=\"openTableOptionMenu($event)\"\n >\n <span>\u8868\u683C\u9009\u9879</span>\n <thy-icon thyIconName=\"caret-down\"></thy-icon>\n </button>\n <nav-split-line *ngIf=\"deleteIcon\"></nav-split-line>\n <a\n *ngIf=\"deleteIcon\"\n href=\"javascript:;\"\n thyIconNavLink\n [thyTooltip]=\"iconName\"\n class=\"danger\"\n [thyIconNavLinkIcon]=\"deleteIcon\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n</thy-icon-nav>\n", components: [{ type: i3.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
8653
|
+
TheTableToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isActiveSelect: "isActiveSelect" }, ngImport: i0, template: "<thy-icon-nav>\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a href=\"javascript:;\" thyIconNavLink *ngIf=\"!item.invisibility\" [thyTooltip]=\"item.name\" (mousedown)=\"item.actionHandle()\">\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n </a>\n </ng-container>\n <nav-split-line *ngIf=\"!isActiveSelect && isShowSplitLine\"></nav-split-line>\n <a href=\"javascript:;\" thyIconNavLink thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <nav-split-line *ngIf=\"tableStore.isSelectedTable\"></nav-split-line>\n <button\n thyButton=\"default\"\n *ngIf=\"tableStore.isSelectedTable\"\n class=\"mr-2\"\n thySize=\"md\"\n class=\"table-options\"\n (mousedown)=\"openTableOptionMenu($event)\"\n >\n <span>\u8868\u683C\u9009\u9879</span>\n <thy-icon thyIconName=\"caret-down\"></thy-icon>\n </button>\n <nav-split-line *ngIf=\"deleteIcon\"></nav-split-line>\n <a\n *ngIf=\"deleteIcon\"\n href=\"javascript:;\"\n thyIconNavLink\n [thyTooltip]=\"iconName\"\n class=\"danger\"\n [thyIconNavLinkIcon]=\"deleteIcon\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n</thy-icon-nav>\n", components: [{ type: i3$1.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i3$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i1$5.ThyButtonComponent, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thySquare", "thyBlock"] }], directives: [{ type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
8552
8654
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheTableToolbarComponent, decorators: [{
|
|
8553
8655
|
type: Component,
|
|
8554
8656
|
args: [{
|
|
@@ -8611,7 +8713,7 @@ class TheContextMenuComponent {
|
|
|
8611
8713
|
ngOnInit() { }
|
|
8612
8714
|
}
|
|
8613
8715
|
TheContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheContextMenuComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
8614
|
-
TheContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheContextMenuComponent, selector: "the-contextmenu", inputs: { menuEntities: "menuEntities", actionHandle: "actionHandle", activeHandle: "activeHandle", deactiveHandle: "deactiveHandle" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)" }, properties: { "class.the-overlay-menu-wrap": "this.wrap" } }, ngImport: i0, template: "<thy-action-menu>\n <ng-container *ngFor=\"let menuItem of menuEntities\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n *ngIf=\"!menuItem.invisibility\"\n (mousedown)=\"itemMousedown($event, menuItem)\"\n (mouseenter)=\"itemMouseenter($event, menuItem)\"\n (mouseleave)=\"itemMouseleave($event, menuItem)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon\n *ngIf=\"menuItem.backgroundColor; else elseIcon\"\n [thyIconName]=\"menuItem.icon\"\n thyIconType=\"twotone\"\n [thyTwotoneColor]=\"menuItem.backgroundColor\"\n ></thy-icon>\n <ng-template #elseIcon>\n <thy-icon [thyIconName]=\"menuItem.icon\"></thy-icon>\n </ng-template>\n </span>\n <span thyActionMenuItemName>{{ menuItem.name }}</span>\n <span *ngIf=\"menuItem.extendIcon\" thyActionMenuItemExtendIcon>\n <thy-icon thyIconName=\"{{ menuItem.extendIcon }}\"></thy-icon>\n </span>\n </a>\n <thy-action-menu-divider *ngIf=\"menuItem.divider\"></thy-action-menu-divider>\n </ng-container>\n</thy-action-menu>\n", components: [{ type: i2$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type:
|
|
8716
|
+
TheContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheContextMenuComponent, selector: "the-contextmenu", inputs: { menuEntities: "menuEntities", actionHandle: "actionHandle", activeHandle: "activeHandle", deactiveHandle: "deactiveHandle" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)" }, properties: { "class.the-overlay-menu-wrap": "this.wrap" } }, ngImport: i0, template: "<thy-action-menu>\n <ng-container *ngFor=\"let menuItem of menuEntities\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n *ngIf=\"!menuItem.invisibility\"\n (mousedown)=\"itemMousedown($event, menuItem)\"\n (mouseenter)=\"itemMouseenter($event, menuItem)\"\n (mouseleave)=\"itemMouseleave($event, menuItem)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon\n *ngIf=\"menuItem.backgroundColor; else elseIcon\"\n [thyIconName]=\"menuItem.icon\"\n thyIconType=\"twotone\"\n [thyTwotoneColor]=\"menuItem.backgroundColor\"\n ></thy-icon>\n <ng-template #elseIcon>\n <thy-icon [thyIconName]=\"menuItem.icon\"></thy-icon>\n </ng-template>\n </span>\n <span thyActionMenuItemName>{{ menuItem.name }}</span>\n <span *ngIf=\"menuItem.extendIcon\" thyActionMenuItemExtendIcon>\n <thy-icon thyIconName=\"{{ menuItem.extendIcon }}\"></thy-icon>\n </span>\n </a>\n <thy-action-menu-divider *ngIf=\"menuItem.divider\"></thy-action-menu-divider>\n </ng-container>\n</thy-action-menu>\n", components: [{ type: i2$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i2$1.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i2$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }, { type: i2$1.ThyActionMenuItemExtendIconDirective, selector: "[thyActionMenuItemExtendIcon]" }] });
|
|
8615
8717
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheContextMenuComponent, decorators: [{
|
|
8616
8718
|
type: Component,
|
|
8617
8719
|
args: [{
|
|
@@ -9323,6 +9425,9 @@ class TheTableComponent extends TheBaseElementComponent {
|
|
|
9323
9425
|
image.onload = () => {
|
|
9324
9426
|
resolve(true);
|
|
9325
9427
|
};
|
|
9428
|
+
image.onerror = () => {
|
|
9429
|
+
resolve(true);
|
|
9430
|
+
};
|
|
9326
9431
|
image.src = item.getAttribute('src');
|
|
9327
9432
|
});
|
|
9328
9433
|
imageResolves.push(imageLoad);
|
|
@@ -10705,27 +10810,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
10705
10810
|
args: ['document: mousedown', ['$event']]
|
|
10706
10811
|
}] } });
|
|
10707
10812
|
|
|
10708
|
-
class TheTableToolbarItemComponent extends
|
|
10813
|
+
class TheTableToolbarItemComponent extends TheBaseToolbarItem {
|
|
10709
10814
|
constructor(thyPopover, overlay) {
|
|
10710
10815
|
super();
|
|
10711
10816
|
this.thyPopover = thyPopover;
|
|
10712
10817
|
this.overlay = overlay;
|
|
10713
|
-
this.active = false;
|
|
10714
10818
|
}
|
|
10715
10819
|
get isOpenTableSelect() {
|
|
10716
10820
|
return this.tableSelectRef && this.tableSelectRef.componentInstance;
|
|
10717
10821
|
}
|
|
10718
|
-
statusChange(editor) {
|
|
10719
|
-
var _a;
|
|
10720
|
-
this.active = (_a = this.item) === null || _a === void 0 ? void 0 : _a.active(editor);
|
|
10721
|
-
}
|
|
10722
10822
|
execute(event) {
|
|
10723
10823
|
var _a;
|
|
10724
10824
|
super.execute(event);
|
|
10725
10825
|
if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
10726
10826
|
return;
|
|
10727
10827
|
}
|
|
10728
|
-
const type = this.item.key;
|
|
10729
10828
|
this.toggleTableSelect(event);
|
|
10730
10829
|
}
|
|
10731
10830
|
toggleTableSelect(event, optionsParam) {
|
|
@@ -10751,19 +10850,19 @@ class TheTableToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
|
10751
10850
|
}
|
|
10752
10851
|
}
|
|
10753
10852
|
TheTableToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheTableToolbarItemComponent, deps: [{ token: i1$6.ThyPopover }, { token: i2.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
10754
|
-
TheTableToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTableToolbarItemComponent, selector: "the-table-toolbar-item",
|
|
10853
|
+
TheTableToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTableToolbarItemComponent, selector: "the-table-toolbar-item", host: { classAttribute: "the-toolbar-dropdown-container" }, usesInheritance: true, ngImport: i0, template: `
|
|
10755
10854
|
<a
|
|
10756
10855
|
thyIconNavLink
|
|
10757
10856
|
class="link-with-down"
|
|
10758
|
-
[thyTooltip]="
|
|
10857
|
+
[thyTooltip]="toolbarItem?.name"
|
|
10759
10858
|
thyTooltipPlacement="top"
|
|
10760
10859
|
[thyIconNavLinkActive]="active"
|
|
10761
10860
|
(mousedown)="execute($event)"
|
|
10762
10861
|
>
|
|
10763
|
-
<thy-icon [thyIconName]="
|
|
10862
|
+
<thy-icon [thyIconName]="toolbarItem.icon"></thy-icon>
|
|
10764
10863
|
<thy-icon class="link-down-icon font-size-sm text-desc table-down-icon" thyIconName="caret-down"> </thy-icon>
|
|
10765
10864
|
</a>
|
|
10766
|
-
`, isInline: true, components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
10865
|
+
`, isInline: true, components: [{ type: i3$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
10767
10866
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheTableToolbarItemComponent, decorators: [{
|
|
10768
10867
|
type: Component,
|
|
10769
10868
|
args: [{
|
|
@@ -10772,12 +10871,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
10772
10871
|
<a
|
|
10773
10872
|
thyIconNavLink
|
|
10774
10873
|
class="link-with-down"
|
|
10775
|
-
[thyTooltip]="
|
|
10874
|
+
[thyTooltip]="toolbarItem?.name"
|
|
10776
10875
|
thyTooltipPlacement="top"
|
|
10777
10876
|
[thyIconNavLinkActive]="active"
|
|
10778
10877
|
(mousedown)="execute($event)"
|
|
10779
10878
|
>
|
|
10780
|
-
<thy-icon [thyIconName]="
|
|
10879
|
+
<thy-icon [thyIconName]="toolbarItem.icon"></thy-icon>
|
|
10781
10880
|
<thy-icon class="link-down-icon font-size-sm text-desc table-down-icon" thyIconName="caret-down"> </thy-icon>
|
|
10782
10881
|
</a>
|
|
10783
10882
|
`,
|
|
@@ -10785,11 +10884,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
10785
10884
|
class: 'the-toolbar-dropdown-container'
|
|
10786
10885
|
}
|
|
10787
10886
|
}]
|
|
10788
|
-
}], ctorParameters: function () { return [{ type: i1$6.ThyPopover }, { type: i2.Overlay }]; }
|
|
10789
|
-
type: Input
|
|
10790
|
-
}], editor: [{
|
|
10791
|
-
type: Input
|
|
10792
|
-
}] } });
|
|
10887
|
+
}], ctorParameters: function () { return [{ type: i1$6.ThyPopover }, { type: i2.Overlay }]; } });
|
|
10793
10888
|
|
|
10794
10889
|
const withTable = (editor) => {
|
|
10795
10890
|
const { deleteBackward, deleteForward, onKeydown, setFragmentData, insertData, normalizeNode, isBlockCard, renderElement, deleteCutData, isContainer, onChange } = editor;
|
|
@@ -11234,7 +11329,7 @@ const withDeserializeHMTL = (editor) => {
|
|
|
11234
11329
|
return;
|
|
11235
11330
|
}
|
|
11236
11331
|
// 过滤 text 节点的 color/background-color 属性
|
|
11237
|
-
fragment.forEach(node =>
|
|
11332
|
+
fragment.forEach(node => filterTextFormat(node));
|
|
11238
11333
|
Transforms.insertFragment(editor, fragment);
|
|
11239
11334
|
return;
|
|
11240
11335
|
}
|
|
@@ -11247,73 +11342,63 @@ const createDeserializeHMTLPlugin = createPluginFactory({
|
|
|
11247
11342
|
withOverrides: withDeserializeHMTL
|
|
11248
11343
|
});
|
|
11249
11344
|
|
|
11250
|
-
class TheToolbarItemComponent extends
|
|
11345
|
+
class TheToolbarItemComponent extends TheBaseToolbarItem {
|
|
11251
11346
|
constructor(ngZone, cfr) {
|
|
11252
11347
|
super();
|
|
11253
11348
|
this.ngZone = ngZone;
|
|
11254
11349
|
this.cfr = cfr;
|
|
11255
11350
|
this.itemMode = ToolbarItemMode.horizontal;
|
|
11256
11351
|
this.ToolbarItemMode = ToolbarItemMode;
|
|
11257
|
-
this.active = false;
|
|
11258
|
-
this.disabled = false;
|
|
11259
11352
|
}
|
|
11260
11353
|
toggleDropdown(event) {
|
|
11261
11354
|
super.execute(event);
|
|
11262
11355
|
}
|
|
11263
|
-
get disabledState() {
|
|
11264
|
-
return this.disabled;
|
|
11265
|
-
}
|
|
11266
11356
|
ngOnInit() {
|
|
11267
11357
|
var _a, _b;
|
|
11268
|
-
if (((_a = this.
|
|
11358
|
+
if (((_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.quickItemComponent) && isComponentType((_b = this.toolbarItem) === null || _b === void 0 ? void 0 : _b.quickItemComponent)) {
|
|
11269
11359
|
this.renderToolbarItem();
|
|
11270
11360
|
}
|
|
11271
11361
|
}
|
|
11272
|
-
statusChange(editor) {
|
|
11273
|
-
var _a, _b, _c, _d;
|
|
11274
|
-
this.disabled = ((_a = this.item) === null || _a === void 0 ? void 0 : _a.disable) ? (_b = this.item) === null || _b === void 0 ? void 0 : _b.disable(editor) : false;
|
|
11275
|
-
this.active = ((_c = this.item) === null || _c === void 0 ? void 0 : _c.active) ? (_d = this.item) === null || _d === void 0 ? void 0 : _d.active(editor) : false;
|
|
11276
|
-
}
|
|
11277
11362
|
execute(event) {
|
|
11278
11363
|
var _a, _b, _c;
|
|
11279
11364
|
super.execute(event);
|
|
11280
|
-
if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled || !((_b = this.
|
|
11365
|
+
if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled || !((_b = this.toolbarItem) === null || _b === void 0 ? void 0 : _b.execute)) {
|
|
11281
11366
|
return;
|
|
11282
11367
|
}
|
|
11283
|
-
(_c = this.
|
|
11368
|
+
(_c = this.toolbarItem) === null || _c === void 0 ? void 0 : _c.execute(this.editor);
|
|
11284
11369
|
}
|
|
11285
11370
|
renderToolbarItem() {
|
|
11286
11371
|
this.ngZone.run(() => {
|
|
11287
|
-
const toolbarItemFactory = this.cfr.resolveComponentFactory(this.
|
|
11288
|
-
const
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11372
|
+
const toolbarItemFactory = this.cfr.resolveComponentFactory(this.toolbarItem.quickItemComponent);
|
|
11373
|
+
const toolbarItemRef = this.toolbarContainer.createComponent(toolbarItemFactory);
|
|
11374
|
+
toolbarItemRef.instance.editor = this.editor;
|
|
11375
|
+
toolbarItemRef.instance.item = this.toolbarItem;
|
|
11376
|
+
toolbarItemRef.instance.itemMode = ToolbarItemMode.vertical;
|
|
11292
11377
|
});
|
|
11293
11378
|
}
|
|
11294
11379
|
}
|
|
11295
11380
|
TheToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarItemComponent, deps: [{ token: i0.NgZone }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component });
|
|
11296
|
-
TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: {
|
|
11381
|
+
TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { itemMode: "itemMode" }, host: { listeners: { "mousedown": "toggleDropdown($event)" }, classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
11297
11382
|
<ng-container *ngIf="itemMode === ToolbarItemMode.horizontal; else selectionItem">
|
|
11298
11383
|
<a
|
|
11299
11384
|
thyIconNavLink
|
|
11300
|
-
[thyIconNavLinkIcon]="
|
|
11385
|
+
[thyIconNavLinkIcon]="toolbarItem.icon"
|
|
11301
11386
|
[thyTooltip]="tooltip"
|
|
11302
|
-
[thyTooltipTemplateContext]="{ name:
|
|
11387
|
+
[thyTooltipTemplateContext]="{ name: toolbarItem.name, shortcutKey: toolbarItem.shortcutKey }"
|
|
11303
11388
|
thyTooltipPlacement="top"
|
|
11304
11389
|
[thyIconNavLinkActive]="active"
|
|
11305
11390
|
(mousedown)="execute($event)"
|
|
11306
11391
|
></a>
|
|
11307
11392
|
</ng-container>
|
|
11308
11393
|
<ng-template #selectionItem>
|
|
11309
|
-
<ng-container *ngIf="!
|
|
11310
|
-
<thy-icon [thyIconName]="
|
|
11311
|
-
<span class="quick-toolbar-name">{{
|
|
11394
|
+
<ng-container *ngIf="!toolbarItem?.quickItemComponent">
|
|
11395
|
+
<thy-icon [thyIconName]="toolbarItem?.icon" [thyIconRotate]="0" class="quick-toolbar-icon"></thy-icon>
|
|
11396
|
+
<span class="quick-toolbar-name">{{ toolbarItem?.name }}</span>
|
|
11312
11397
|
</ng-container>
|
|
11313
11398
|
</ng-template>
|
|
11314
11399
|
<ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>
|
|
11315
11400
|
<ng-container #toolbarContainer></ng-container>
|
|
11316
|
-
`, isInline: true, components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
11401
|
+
`, isInline: true, components: [{ type: i3$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
11317
11402
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarItemComponent, decorators: [{
|
|
11318
11403
|
type: Component,
|
|
11319
11404
|
args: [{
|
|
@@ -11322,18 +11407,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
11322
11407
|
<ng-container *ngIf="itemMode === ToolbarItemMode.horizontal; else selectionItem">
|
|
11323
11408
|
<a
|
|
11324
11409
|
thyIconNavLink
|
|
11325
|
-
[thyIconNavLinkIcon]="
|
|
11410
|
+
[thyIconNavLinkIcon]="toolbarItem.icon"
|
|
11326
11411
|
[thyTooltip]="tooltip"
|
|
11327
|
-
[thyTooltipTemplateContext]="{ name:
|
|
11412
|
+
[thyTooltipTemplateContext]="{ name: toolbarItem.name, shortcutKey: toolbarItem.shortcutKey }"
|
|
11328
11413
|
thyTooltipPlacement="top"
|
|
11329
11414
|
[thyIconNavLinkActive]="active"
|
|
11330
11415
|
(mousedown)="execute($event)"
|
|
11331
11416
|
></a>
|
|
11332
11417
|
</ng-container>
|
|
11333
11418
|
<ng-template #selectionItem>
|
|
11334
|
-
<ng-container *ngIf="!
|
|
11335
|
-
<thy-icon [thyIconName]="
|
|
11336
|
-
<span class="quick-toolbar-name">{{
|
|
11419
|
+
<ng-container *ngIf="!toolbarItem?.quickItemComponent">
|
|
11420
|
+
<thy-icon [thyIconName]="toolbarItem?.icon" [thyIconRotate]="0" class="quick-toolbar-icon"></thy-icon>
|
|
11421
|
+
<span class="quick-toolbar-name">{{ toolbarItem?.name }}</span>
|
|
11337
11422
|
</ng-container>
|
|
11338
11423
|
</ng-template>
|
|
11339
11424
|
<ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>
|
|
@@ -11343,11 +11428,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
11343
11428
|
class: 'the-toolbar-item'
|
|
11344
11429
|
}
|
|
11345
11430
|
}]
|
|
11346
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: {
|
|
11347
|
-
type: Input
|
|
11348
|
-
}], item: [{
|
|
11349
|
-
type: Input
|
|
11350
|
-
}], itemMode: [{
|
|
11431
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { itemMode: [{
|
|
11351
11432
|
type: Input
|
|
11352
11433
|
}], toolbarContainer: [{
|
|
11353
11434
|
type: ViewChild,
|
|
@@ -11355,9 +11436,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
11355
11436
|
}], toggleDropdown: [{
|
|
11356
11437
|
type: HostListener,
|
|
11357
11438
|
args: ['mousedown', ['$event']]
|
|
11358
|
-
}], disabledState: [{
|
|
11359
|
-
type: HostBinding,
|
|
11360
|
-
args: ['class.disabled']
|
|
11361
11439
|
}] } });
|
|
11362
11440
|
|
|
11363
11441
|
class TheQuickToolbarComponent extends mixinUnsubscribe(MixinBase) {
|
|
@@ -11408,7 +11486,7 @@ class TheQuickToolbarComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
11408
11486
|
}
|
|
11409
11487
|
}
|
|
11410
11488
|
TheQuickToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheQuickToolbarComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
11411
|
-
TheQuickToolbarComponent.ɵcmp = i0.ɵɵ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, 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\" [
|
|
11489
|
+
TheQuickToolbarComponent.ɵcmp = i0.ɵɵ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, 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\" [toolbarItem]=\"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: i1$7.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5$3.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
11412
11490
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheQuickToolbarComponent, decorators: [{
|
|
11413
11491
|
type: Component,
|
|
11414
11492
|
args: [{
|
|
@@ -11648,112 +11726,11 @@ const createInlineCodePlugin = createPluginFactory({
|
|
|
11648
11726
|
execute: editor => InlineCodeEditor.toggleInlineCode(editor),
|
|
11649
11727
|
active: editor => InlineCodeEditor.isInlineCodeActive(editor)
|
|
11650
11728
|
}
|
|
11651
|
-
]
|
|
11652
|
-
|
|
11653
|
-
|
|
11654
|
-
class TheIndentToolbarComponent extends TheToolbarBaseItemComponent {
|
|
11655
|
-
constructor(elementRef, thyPopover, viewContainerRef, overlay) {
|
|
11656
|
-
super();
|
|
11657
|
-
this.elementRef = elementRef;
|
|
11658
|
-
this.thyPopover = thyPopover;
|
|
11659
|
-
this.viewContainerRef = viewContainerRef;
|
|
11660
|
-
this.overlay = overlay;
|
|
11661
|
-
this.mode = DropdownMode.text;
|
|
11662
|
-
this.dropdownMode = DropdownMode;
|
|
11663
|
-
this.disabled = false;
|
|
11664
|
-
}
|
|
11665
|
-
get isOpen() {
|
|
11666
|
-
return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
|
|
11667
|
-
}
|
|
11668
|
-
toggleDropdown(event) {
|
|
11669
|
-
var _a;
|
|
11670
|
-
super.execute(event);
|
|
11671
|
-
if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled) {
|
|
11672
|
-
return;
|
|
11673
|
-
}
|
|
11674
|
-
this.openDropdownPopover();
|
|
11675
|
-
}
|
|
11676
|
-
handleDocumentMouseDown(event) {
|
|
11677
|
-
if (!this.elementRef.nativeElement.contains(event.target)) {
|
|
11678
|
-
this.closeDropdownPopover();
|
|
11679
|
-
}
|
|
11680
|
-
}
|
|
11681
|
-
get disabledState() {
|
|
11682
|
-
return this.disabled;
|
|
11683
|
-
}
|
|
11684
|
-
ngOnInit() {
|
|
11685
|
-
var _a;
|
|
11686
|
-
if (!this.activeMenu) {
|
|
11687
|
-
this.activeMenu = this.menus[0];
|
|
11688
|
-
}
|
|
11689
|
-
if (this.toolbarItem) {
|
|
11690
|
-
this.elementRef.nativeElement.classList.add(`${(_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key}`);
|
|
11691
|
-
}
|
|
11692
|
-
}
|
|
11693
|
-
statusChange(editor) {
|
|
11694
|
-
var _a, _b;
|
|
11695
|
-
this.disabled = ((_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.disable) ? (_b = this.toolbarItem) === null || _b === void 0 ? void 0 : _b.disable(editor) : false;
|
|
11696
|
-
}
|
|
11697
|
-
itemMousedown(event, item) {
|
|
11698
|
-
super.execute(event);
|
|
11699
|
-
this.closeDropdownPopover();
|
|
11700
|
-
if (item === null || item === void 0 ? void 0 : item.execute) {
|
|
11701
|
-
item === null || item === void 0 ? void 0 : item.execute(this.editor);
|
|
11702
|
-
}
|
|
11703
|
-
}
|
|
11704
|
-
openDropdownPopover() {
|
|
11705
|
-
var _a;
|
|
11706
|
-
this.dropdownPopoverRef = this.thyPopover.open(this.dropdownTemplate, {
|
|
11707
|
-
origin: this.elementRef,
|
|
11708
|
-
panelClass: ['the-toolbar-dropdown-popover', (_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key],
|
|
11709
|
-
placement: 'bottomLeft',
|
|
11710
|
-
insideClosable: false,
|
|
11711
|
-
backdropClosable: true,
|
|
11712
|
-
hasBackdrop: false,
|
|
11713
|
-
offset: 10,
|
|
11714
|
-
viewContainerRef: this.viewContainerRef,
|
|
11715
|
-
scrollStrategy: this.overlay.scrollStrategies.reposition()
|
|
11716
|
-
});
|
|
11717
|
-
}
|
|
11718
|
-
closeDropdownPopover() {
|
|
11719
|
-
var _a;
|
|
11720
|
-
if (this.dropdownPopoverRef) {
|
|
11721
|
-
(_a = this.dropdownPopoverRef) === null || _a === void 0 ? void 0 : _a.close();
|
|
11722
|
-
}
|
|
11729
|
+
],
|
|
11730
|
+
options: {
|
|
11731
|
+
disabledOperateTypes: [ElementKinds.image, ElementKinds.code]
|
|
11723
11732
|
}
|
|
11724
|
-
}
|
|
11725
|
-
TheIndentToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheIndentToolbarComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
11726
|
-
TheIndentToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheIndentToolbarComponent, selector: "the-indent-toolbar-item", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyTooltip]=\"tooltip\"\n [thyTooltipTemplateContext]=\"{ name: menu.name, shortcutKey: menu.shortcutKey }\"\n thyTooltipPlacement=\"right\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span 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\n<ng-template #tooltip let-data>{{ data?.shortcutKey }}</ng-template>\n", components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i2$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i2$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
11727
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheIndentToolbarComponent, decorators: [{
|
|
11728
|
-
type: Component,
|
|
11729
|
-
args: [{
|
|
11730
|
-
selector: 'the-indent-toolbar-item',
|
|
11731
|
-
templateUrl: './toolbar-item.component.html',
|
|
11732
|
-
host: {
|
|
11733
|
-
class: 'the-toolbar-dropdown-container'
|
|
11734
|
-
}
|
|
11735
|
-
}]
|
|
11736
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2.Overlay }]; }, propDecorators: { toolbarItem: [{
|
|
11737
|
-
type: Input
|
|
11738
|
-
}], menus: [{
|
|
11739
|
-
type: Input
|
|
11740
|
-
}], mode: [{
|
|
11741
|
-
type: Input
|
|
11742
|
-
}], item: [{
|
|
11743
|
-
type: Input
|
|
11744
|
-
}], dropdownTemplate: [{
|
|
11745
|
-
type: ViewChild,
|
|
11746
|
-
args: ['dropdownTemplate', { static: true }]
|
|
11747
|
-
}], toggleDropdown: [{
|
|
11748
|
-
type: HostListener,
|
|
11749
|
-
args: ['mousedown', ['$event']]
|
|
11750
|
-
}], handleDocumentMouseDown: [{
|
|
11751
|
-
type: HostListener,
|
|
11752
|
-
args: ['document: mousedown', ['$event']]
|
|
11753
|
-
}], disabledState: [{
|
|
11754
|
-
type: HostBinding,
|
|
11755
|
-
args: ['class.disabled']
|
|
11756
|
-
}] } });
|
|
11733
|
+
});
|
|
11757
11734
|
|
|
11758
11735
|
const IndentEditor = {
|
|
11759
11736
|
getAllowedTypes(editor) {
|
|
@@ -11822,14 +11799,6 @@ const IndentEditor = {
|
|
|
11822
11799
|
return true;
|
|
11823
11800
|
}
|
|
11824
11801
|
return false;
|
|
11825
|
-
},
|
|
11826
|
-
isDisabled(editor) {
|
|
11827
|
-
if (editor.selection) {
|
|
11828
|
-
const allowedTypes = IndentEditor.getAllowedTypes(editor);
|
|
11829
|
-
const anchorBlock$1 = anchorBlock(editor);
|
|
11830
|
-
return anchorBlock$1 && !allowedTypes.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
|
|
11831
|
-
}
|
|
11832
|
-
return false;
|
|
11833
11802
|
}
|
|
11834
11803
|
};
|
|
11835
11804
|
|
|
@@ -11903,8 +11872,10 @@ const createIndentPlugin = createPluginFactory({
|
|
|
11903
11872
|
{
|
|
11904
11873
|
key: ElementKinds.indent,
|
|
11905
11874
|
includes: [Indents.indentRight, Indents.indentLeft],
|
|
11906
|
-
|
|
11907
|
-
|
|
11875
|
+
type: ToolbarItemType.dropdown,
|
|
11876
|
+
dropdownMode: DropdownMode.icon,
|
|
11877
|
+
dropdownItemKey: Indents.indentRight,
|
|
11878
|
+
dropdownFixedIcon: true
|
|
11908
11879
|
},
|
|
11909
11880
|
{
|
|
11910
11881
|
key: Indents.indentRight,
|
|
@@ -11918,7 +11889,6 @@ const createIndentPlugin = createPluginFactory({
|
|
|
11918
11889
|
name: '减少缩进',
|
|
11919
11890
|
icon: 'float-right',
|
|
11920
11891
|
shortcutKey: 'Shift+Tab/BackSpace',
|
|
11921
|
-
type: ToolbarItemType.toolDropdown,
|
|
11922
11892
|
execute: editor => IndentEditor.cancelIndent(editor)
|
|
11923
11893
|
}
|
|
11924
11894
|
],
|
|
@@ -11931,7 +11901,8 @@ const createIndentPlugin = createPluginFactory({
|
|
|
11931
11901
|
ElementKinds.paragraph,
|
|
11932
11902
|
...HEADING_TYPES
|
|
11933
11903
|
],
|
|
11934
|
-
disableIndentTypes: [ElementKinds.bulletedList, ElementKinds.numberedList, ElementKinds.checkItem]
|
|
11904
|
+
disableIndentTypes: [ElementKinds.bulletedList, ElementKinds.numberedList, ElementKinds.checkItem],
|
|
11905
|
+
disabledOperateTypes: [ElementKinds.image, ElementKinds.code]
|
|
11935
11906
|
}
|
|
11936
11907
|
});
|
|
11937
11908
|
|
|
@@ -11996,14 +11967,6 @@ const FontSizeEditor = {
|
|
|
11996
11967
|
}
|
|
11997
11968
|
}
|
|
11998
11969
|
return false;
|
|
11999
|
-
},
|
|
12000
|
-
isDisabled(editor) {
|
|
12001
|
-
if (editor.selection) {
|
|
12002
|
-
const disableGroup = HEADING_TYPES;
|
|
12003
|
-
const anchorBlock$1 = anchorBlock(editor);
|
|
12004
|
-
return anchorBlock$1 && disableGroup.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
|
|
12005
|
-
}
|
|
12006
|
-
return false;
|
|
12007
11970
|
}
|
|
12008
11971
|
};
|
|
12009
11972
|
const sizeOptions = () => {
|
|
@@ -12022,23 +11985,24 @@ const createFontSizePlugin = createPluginFactory({
|
|
|
12022
11985
|
{
|
|
12023
11986
|
key: MarkTypes.fontSize,
|
|
12024
11987
|
name: '字号',
|
|
12025
|
-
type: ToolbarItemType.
|
|
11988
|
+
type: ToolbarItemType.dropdown,
|
|
12026
11989
|
dropdownItemKey: FontSizes.fontSize14,
|
|
12027
|
-
includes: FontSizeTypes
|
|
12028
|
-
disable: editor => FontSizeEditor.isDisabled(editor)
|
|
11990
|
+
includes: FontSizeTypes
|
|
12029
11991
|
},
|
|
12030
11992
|
...sizeOptions()
|
|
12031
|
-
]
|
|
11993
|
+
],
|
|
11994
|
+
options: {
|
|
11995
|
+
disabledOperateTypes: [...HEADING_TYPES, ElementKinds.image, ElementKinds.code]
|
|
11996
|
+
}
|
|
12032
11997
|
});
|
|
12033
11998
|
|
|
12034
|
-
class TheVerticalToolbarItemComponent extends
|
|
11999
|
+
class TheVerticalToolbarItemComponent extends TheBaseToolbarDropdown {
|
|
12035
12000
|
constructor(elementRef, thyPopover, viewContainerRef) {
|
|
12036
12001
|
super();
|
|
12037
12002
|
this.elementRef = elementRef;
|
|
12038
12003
|
this.thyPopover = thyPopover;
|
|
12039
12004
|
this.viewContainerRef = viewContainerRef;
|
|
12040
12005
|
this.isHide = true;
|
|
12041
|
-
this.active = false;
|
|
12042
12006
|
}
|
|
12043
12007
|
get isOpened() {
|
|
12044
12008
|
return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
|
|
@@ -12049,11 +12013,6 @@ class TheVerticalToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
|
12049
12013
|
}
|
|
12050
12014
|
}
|
|
12051
12015
|
ngOnInit() { }
|
|
12052
|
-
statusChange(editor) {
|
|
12053
|
-
var _a, _b;
|
|
12054
|
-
this.active = ((_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.active) ? (_b = this.toolbarItem) === null || _b === void 0 ? void 0 : _b.active(editor) : false;
|
|
12055
|
-
this.activeMenu = this.menusActive(editor);
|
|
12056
|
-
}
|
|
12057
12016
|
menusActive(editor) {
|
|
12058
12017
|
return this.menus.find(i => {
|
|
12059
12018
|
var _a;
|
|
@@ -12098,7 +12057,7 @@ class TheVerticalToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
|
12098
12057
|
}
|
|
12099
12058
|
}
|
|
12100
12059
|
TheVerticalToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheVerticalToolbarItemComponent, deps: [{ token: i0.ElementRef }, { token: i1$6.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
12101
|
-
TheVerticalToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item",
|
|
12060
|
+
TheVerticalToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", 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: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, 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]=\"activeMenuItem?.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 === activeMenuItem?.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$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i2$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2$1.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i2$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
12102
12061
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheVerticalToolbarItemComponent, decorators: [{
|
|
12103
12062
|
type: Component,
|
|
12104
12063
|
args: [{
|
|
@@ -12109,15 +12068,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
12109
12068
|
'[class.hide]': '!active'
|
|
12110
12069
|
}
|
|
12111
12070
|
}]
|
|
12112
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$6.ThyPopover }, { type: i0.ViewContainerRef }]; }, propDecorators: {
|
|
12113
|
-
type: Input
|
|
12114
|
-
}], menus: [{
|
|
12115
|
-
type: Input
|
|
12116
|
-
}], editor: [{
|
|
12117
|
-
type: Input
|
|
12118
|
-
}], toolbarItem: [{
|
|
12119
|
-
type: Input
|
|
12120
|
-
}], template: [{
|
|
12071
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$6.ThyPopover }, { type: i0.ViewContainerRef }]; }, propDecorators: { template: [{
|
|
12121
12072
|
type: ViewChild,
|
|
12122
12073
|
args: ['VerticalAlignItems', { read: TemplateRef, static: true }]
|
|
12123
12074
|
}], handleDocumentMouseDown: [{
|
|
@@ -12145,7 +12096,7 @@ const createVerticalAlignPlugin = createPluginFactory({
|
|
|
12145
12096
|
{
|
|
12146
12097
|
key: ToolbarActionTypes.verticalAlign,
|
|
12147
12098
|
name: '垂直对齐',
|
|
12148
|
-
type: ToolbarItemType.
|
|
12099
|
+
type: ToolbarItemType.dropdown,
|
|
12149
12100
|
dropdownMode: DropdownMode.icon,
|
|
12150
12101
|
iconComponent: TheVerticalToolbarItemComponent,
|
|
12151
12102
|
includes: [ToolbarActionTypes.verticalAlignTop, ToolbarActionTypes.verticalAlignMiddle, ToolbarActionTypes.verticalAlignBottom],
|
|
@@ -12326,26 +12277,21 @@ const ColorEditor = {
|
|
|
12326
12277
|
}
|
|
12327
12278
|
};
|
|
12328
12279
|
|
|
12329
|
-
class TheColorToolbarItemComponent extends
|
|
12280
|
+
class TheColorToolbarItemComponent extends TheBaseToolbarItem {
|
|
12330
12281
|
constructor(thyPopover) {
|
|
12331
12282
|
super();
|
|
12332
12283
|
this.thyPopover = thyPopover;
|
|
12333
|
-
this.active = false;
|
|
12334
12284
|
}
|
|
12335
12285
|
get isOpenColorSelect() {
|
|
12336
12286
|
return this.colorSelectRef && this.colorSelectRef.componentInstance;
|
|
12337
12287
|
}
|
|
12338
|
-
statusChange(editor) {
|
|
12339
|
-
var _a;
|
|
12340
|
-
this.active = (_a = this.item) === null || _a === void 0 ? void 0 : _a.active(editor);
|
|
12341
|
-
}
|
|
12342
12288
|
execute(event) {
|
|
12343
12289
|
var _a;
|
|
12344
12290
|
super.execute(event);
|
|
12345
|
-
if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
12291
|
+
if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled) {
|
|
12346
12292
|
return;
|
|
12347
12293
|
}
|
|
12348
|
-
const type = this.
|
|
12294
|
+
const type = this.toolbarItem.key;
|
|
12349
12295
|
this.toggleColorSelect(event, type);
|
|
12350
12296
|
}
|
|
12351
12297
|
toggleColorSelect(event, type) {
|
|
@@ -12385,19 +12331,19 @@ class TheColorToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
|
12385
12331
|
}
|
|
12386
12332
|
}
|
|
12387
12333
|
TheColorToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheColorToolbarItemComponent, deps: [{ token: i1$1.ThyPopover }], target: i0.ɵɵFactoryTarget.Component });
|
|
12388
|
-
TheColorToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheColorToolbarItemComponent, selector: "the-color-toolbar-item",
|
|
12334
|
+
TheColorToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheColorToolbarItemComponent, selector: "the-color-toolbar-item", host: { classAttribute: "the-toolbar-item" }, usesInheritance: true, ngImport: i0, template: `
|
|
12389
12335
|
<a
|
|
12390
12336
|
class="link-width-down"
|
|
12391
12337
|
thyIconNavLink
|
|
12392
12338
|
[ngStyle]="{
|
|
12393
|
-
width:
|
|
12339
|
+
width: toolbarItem.key === 'color' ? '42px' : 'auto'
|
|
12394
12340
|
}"
|
|
12395
|
-
[thyTooltip]="
|
|
12341
|
+
[thyTooltip]="toolbarItem.name"
|
|
12396
12342
|
[thyIconNavLinkActive]="active"
|
|
12397
12343
|
thyTooltipPlacement="top"
|
|
12398
12344
|
(mousedown)="execute($event)"
|
|
12399
12345
|
>
|
|
12400
|
-
<thy-icon [thyIconName]="
|
|
12346
|
+
<thy-icon [thyIconName]="toolbarItem.icon" thyIconType="twotone" [thyTwotoneColor]="active"></thy-icon>
|
|
12401
12347
|
<thy-icon
|
|
12402
12348
|
[ngClass]="{
|
|
12403
12349
|
'link-down-icon': true,
|
|
@@ -12407,7 +12353,7 @@ TheColorToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12
|
|
|
12407
12353
|
thyIconName="caret-down"
|
|
12408
12354
|
></thy-icon>
|
|
12409
12355
|
</a>
|
|
12410
|
-
`, isInline: true, components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
12356
|
+
`, isInline: true, components: [{ type: i3$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
12411
12357
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheColorToolbarItemComponent, decorators: [{
|
|
12412
12358
|
type: Component,
|
|
12413
12359
|
args: [{
|
|
@@ -12417,14 +12363,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
12417
12363
|
class="link-width-down"
|
|
12418
12364
|
thyIconNavLink
|
|
12419
12365
|
[ngStyle]="{
|
|
12420
|
-
width:
|
|
12366
|
+
width: toolbarItem.key === 'color' ? '42px' : 'auto'
|
|
12421
12367
|
}"
|
|
12422
|
-
[thyTooltip]="
|
|
12368
|
+
[thyTooltip]="toolbarItem.name"
|
|
12423
12369
|
[thyIconNavLinkActive]="active"
|
|
12424
12370
|
thyTooltipPlacement="top"
|
|
12425
12371
|
(mousedown)="execute($event)"
|
|
12426
12372
|
>
|
|
12427
|
-
<thy-icon [thyIconName]="
|
|
12373
|
+
<thy-icon [thyIconName]="toolbarItem.icon" thyIconType="twotone" [thyTwotoneColor]="active"></thy-icon>
|
|
12428
12374
|
<thy-icon
|
|
12429
12375
|
[ngClass]="{
|
|
12430
12376
|
'link-down-icon': true,
|
|
@@ -12439,11 +12385,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
12439
12385
|
class: 'the-toolbar-item'
|
|
12440
12386
|
}
|
|
12441
12387
|
}]
|
|
12442
|
-
}], ctorParameters: function () { return [{ type: i1$1.ThyPopover }]; }
|
|
12443
|
-
type: Input
|
|
12444
|
-
}], editor: [{
|
|
12445
|
-
type: Input
|
|
12446
|
-
}] } });
|
|
12388
|
+
}], ctorParameters: function () { return [{ type: i1$1.ThyPopover }]; } });
|
|
12447
12389
|
|
|
12448
12390
|
const createColorPlugin = createPluginFactory({
|
|
12449
12391
|
key: PluginKeys.color,
|
|
@@ -12462,10 +12404,13 @@ const createColorPlugin = createPluginFactory({
|
|
|
12462
12404
|
iconComponent: TheColorToolbarItemComponent,
|
|
12463
12405
|
active: editor => ColorEditor.getActiveColor(editor, MarkTypes.backgroundColor)
|
|
12464
12406
|
}
|
|
12465
|
-
]
|
|
12407
|
+
],
|
|
12408
|
+
options: {
|
|
12409
|
+
disabledOperateTypes: [ElementKinds.image, ElementKinds.code]
|
|
12410
|
+
}
|
|
12466
12411
|
});
|
|
12467
12412
|
|
|
12468
|
-
const internalPlugins = [
|
|
12413
|
+
const internalPlugins = () => [
|
|
12469
12414
|
createTheHistoryPlugin(),
|
|
12470
12415
|
createAutoInsertDataPlugin(),
|
|
12471
12416
|
createRemoveEmptyPlugin(),
|
|
@@ -12544,7 +12489,7 @@ class TheToolbarComponent {
|
|
|
12544
12489
|
ngOnInit() {
|
|
12545
12490
|
this.setToolbarClass();
|
|
12546
12491
|
this.renderToolbarView();
|
|
12547
|
-
this.
|
|
12492
|
+
this.selectionChange(this.editor);
|
|
12548
12493
|
if (this.isMore) {
|
|
12549
12494
|
this.resizeElement();
|
|
12550
12495
|
}
|
|
@@ -12579,13 +12524,13 @@ class TheToolbarComponent {
|
|
|
12579
12524
|
});
|
|
12580
12525
|
this.resizeObserver.observe(editableElement);
|
|
12581
12526
|
}
|
|
12582
|
-
|
|
12527
|
+
selectionChange(editor) {
|
|
12583
12528
|
const toolbarItems = [...this.toolbarItems, this.moreGroupMenu];
|
|
12584
12529
|
for (const item of toolbarItems) {
|
|
12585
12530
|
if (item.key !== ToolbarActionTypes.split) {
|
|
12586
12531
|
const itemComponent = this.components.get(item.key);
|
|
12587
|
-
if (itemComponent) {
|
|
12588
|
-
itemComponent.instance.
|
|
12532
|
+
if (itemComponent && itemComponent.instance.selectionChange) {
|
|
12533
|
+
itemComponent.instance.selectionChange(editor);
|
|
12589
12534
|
}
|
|
12590
12535
|
}
|
|
12591
12536
|
}
|
|
@@ -12653,7 +12598,7 @@ class TheToolbarComponent {
|
|
|
12653
12598
|
elementWidth -= headingWidth;
|
|
12654
12599
|
continue;
|
|
12655
12600
|
}
|
|
12656
|
-
const isCustomComponent = (item === null || item === void 0 ? void 0 : item.type) === ToolbarItemType.
|
|
12601
|
+
const isCustomComponent = (item === null || item === void 0 ? void 0 : item.type) === ToolbarItemType.dropdown || !!(item === null || item === void 0 ? void 0 : item.iconComponent);
|
|
12657
12602
|
elementWidth -= isCustomComponent ? maxItemWidth : defaultItemWidth;
|
|
12658
12603
|
}
|
|
12659
12604
|
return {
|
|
@@ -12699,15 +12644,17 @@ class TheToolbarComponent {
|
|
|
12699
12644
|
createToolbarItem(item) {
|
|
12700
12645
|
const { iconComponent, type, dropdownMode, dropdownItemKey, includes } = item, args = __rest(item, ["iconComponent", "type", "dropdownMode", "dropdownItemKey", "includes"]);
|
|
12701
12646
|
const viewComponent = this.viewComponentType(type);
|
|
12702
|
-
const dropdownItem = this.getDropdownItem(item);
|
|
12703
12647
|
const factory = this.cfr.resolveComponentFactory(iconComponent ? iconComponent : viewComponent);
|
|
12704
12648
|
const compRef = this.toolbarContainer.createComponent(factory);
|
|
12705
12649
|
compRef.instance.editor = this.editor;
|
|
12706
12650
|
compRef.instance.toolbarItem = item;
|
|
12707
|
-
compRef.instance.menus = includes;
|
|
12708
|
-
compRef.instance.item = includes && dropdownItem ? dropdownItem : args;
|
|
12709
|
-
compRef.instance.mode = dropdownMode;
|
|
12710
12651
|
this.components.set(item.key, compRef);
|
|
12652
|
+
if (item.type === ToolbarItemType.dropdown) {
|
|
12653
|
+
const dropdownRef = compRef;
|
|
12654
|
+
dropdownRef.instance.dropdownItemKey = item.dropdownItemKey;
|
|
12655
|
+
dropdownRef.instance.menus = includes;
|
|
12656
|
+
dropdownRef.instance.mode = dropdownMode;
|
|
12657
|
+
}
|
|
12711
12658
|
}
|
|
12712
12659
|
createToolbarSplit() {
|
|
12713
12660
|
const navSplitLineFactory = this.cfr.resolveComponentFactory(NavSplitLineComponent);
|
|
@@ -12727,25 +12674,14 @@ class TheToolbarComponent {
|
|
|
12727
12674
|
if (type === ToolbarItemType.default) {
|
|
12728
12675
|
return TheToolbarItemComponent;
|
|
12729
12676
|
}
|
|
12730
|
-
if (type === ToolbarItemType.
|
|
12677
|
+
if (type === ToolbarItemType.dropdown) {
|
|
12731
12678
|
return TheToolbarDropdownComponent;
|
|
12732
12679
|
}
|
|
12733
12680
|
return TheToolbarItemComponent;
|
|
12734
12681
|
}
|
|
12735
|
-
getDropdownItem(item) {
|
|
12736
|
-
var _a, _b, _c;
|
|
12737
|
-
let dropdownKey = item === null || item === void 0 ? void 0 : item.dropdownItemKey;
|
|
12738
|
-
// modify the fontsize option externally
|
|
12739
|
-
const contextService = (_b = (_a = this.editor) === null || _a === void 0 ? void 0 : _a.injector) === null || _b === void 0 ? void 0 : _b.get(TheContextService);
|
|
12740
|
-
const fontSize = contextService === null || contextService === void 0 ? void 0 : contextService.getDefaultFontSize();
|
|
12741
|
-
if (contextService && item.key === MarkTypes.fontSize && fontSize) {
|
|
12742
|
-
dropdownKey = fontSize;
|
|
12743
|
-
}
|
|
12744
|
-
return (_c = item === null || item === void 0 ? void 0 : item.includes) === null || _c === void 0 ? void 0 : _c.find((item) => item.key === dropdownKey);
|
|
12745
|
-
}
|
|
12746
12682
|
}
|
|
12747
12683
|
TheToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: TheToolbarGroupToken }], target: i0.ɵɵFactoryTarget.Component });
|
|
12748
|
-
TheToolbarComponent.ɵcmp = i0.ɵɵ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: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, 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.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
12684
|
+
TheToolbarComponent.ɵcmp = i0.ɵɵ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: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, 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$1.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
12749
12685
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarComponent, decorators: [{
|
|
12750
12686
|
type: Component,
|
|
12751
12687
|
args: [{
|
|
@@ -12798,7 +12734,7 @@ class TheInlineToolbarComponent {
|
|
|
12798
12734
|
.subscribe(() => {
|
|
12799
12735
|
var _a;
|
|
12800
12736
|
this.updateInlineToolbar();
|
|
12801
|
-
(_a = this.inlineToolbar) === null || _a === void 0 ? void 0 : _a.
|
|
12737
|
+
(_a = this.inlineToolbar) === null || _a === void 0 ? void 0 : _a.selectionChange(this.editor);
|
|
12802
12738
|
this.cdr.detectChanges();
|
|
12803
12739
|
});
|
|
12804
12740
|
});
|
|
@@ -12971,7 +12907,7 @@ class TheQuickInsertComponent {
|
|
|
12971
12907
|
}
|
|
12972
12908
|
}
|
|
12973
12909
|
TheQuickInsertComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheQuickInsertComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
12974
|
-
TheQuickInsertComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems", isVisible: "isVisible" }, host: { listeners: { "mousedown": "handleMousedownNativeElement($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-quick-insert" }, viewQueries: [{ propertyName: "iconElement", first: true, predicate: ["iconElement"], descendants: true, read: ElementRef }], ngImport: i0, template: "<thy-icon\n #iconElement\n [thyIconName]=\"displayIconName\"\n class=\"quick-insert-icon text-desc font-size-xlg\"\n (mouseenter)=\"mouseEnter($event)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousedown)=\"handleClick($event)\"\n></thy-icon>\n", components: [{ type:
|
|
12910
|
+
TheQuickInsertComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems", isVisible: "isVisible" }, host: { listeners: { "mousedown": "handleMousedownNativeElement($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-quick-insert" }, viewQueries: [{ propertyName: "iconElement", first: true, predicate: ["iconElement"], descendants: true, read: ElementRef }], ngImport: i0, template: "<thy-icon\n #iconElement\n [thyIconName]=\"displayIconName\"\n class=\"quick-insert-icon text-desc font-size-xlg\"\n (mouseenter)=\"mouseEnter($event)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousedown)=\"handleClick($event)\"\n></thy-icon>\n", components: [{ type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }] });
|
|
12975
12911
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheQuickInsertComponent, decorators: [{
|
|
12976
12912
|
type: Component,
|
|
12977
12913
|
args: [{
|
|
@@ -13239,7 +13175,8 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
13239
13175
|
}
|
|
13240
13176
|
initialize() {
|
|
13241
13177
|
var _a, _b;
|
|
13242
|
-
const
|
|
13178
|
+
const defaultPlugins = internalPlugins();
|
|
13179
|
+
const plugins = [...defaultPlugins, ...this.thePlugins];
|
|
13243
13180
|
this.editor = withTheia(withHistory(withAngular(createEditor(), CLIPBOARD_FORMAT_KEY)), plugins);
|
|
13244
13181
|
this.generateDecorate();
|
|
13245
13182
|
this.editor.disabled = (_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled;
|
|
@@ -13310,7 +13247,7 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
13310
13247
|
valueChange(value) {
|
|
13311
13248
|
var _a, _b, _c, _d, _e, _f;
|
|
13312
13249
|
const isEditable = !((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.readonly) && !((_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.disabled);
|
|
13313
|
-
(_c = this.theGlobalToolbarInstance) === null || _c === void 0 ? void 0 : _c.
|
|
13250
|
+
(_c = this.theGlobalToolbarInstance) === null || _c === void 0 ? void 0 : _c.selectionChange(this.editor);
|
|
13314
13251
|
// quick insert button
|
|
13315
13252
|
if (isEditable) {
|
|
13316
13253
|
(_d = this.quickInsertInstance) === null || _d === void 0 ? void 0 : _d.checkStatus();
|
|
@@ -13445,7 +13382,7 @@ TheEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
|
|
|
13445
13382
|
useExisting: forwardRef(() => TheEditorComponent),
|
|
13446
13383
|
multi: true
|
|
13447
13384
|
}
|
|
13448
|
-
], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [placeholder]=\"theOptions?.placeholder\"\n [placeholderDecorate]=\"theOptions?.placeholderDecorate ? theOptions?.placeholderDecorate : null\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar\n *ngIf=\"!theOptions?.readonly && theOptions?.inlineToobarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div\n #quickInsert\n theQuickInsert\n [editor]=\"editor\"\n [quickToolbarItems]=\"quickToolbarItems\"\n [isVisible]=\"theOptions?.quickInsertVisible\"\n ></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { type: i1.SlateEditableComponent, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "placeholderDecorate", "isStrictDecorate", "trackBy", "readonly", "placeholder", "beforeInput", "blur", "click", "compositionEnd", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems", "isVisible"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4
|
|
13385
|
+
], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [placeholder]=\"theOptions?.placeholder\"\n [placeholderDecorate]=\"theOptions?.placeholderDecorate ? theOptions?.placeholderDecorate : null\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar\n *ngIf=\"!theOptions?.readonly && theOptions?.inlineToobarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div\n #quickInsert\n theQuickInsert\n [editor]=\"editor\"\n [quickToolbarItems]=\"quickToolbarItems\"\n [isVisible]=\"theOptions?.quickInsertVisible\"\n ></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { type: i1.SlateEditableComponent, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "placeholderDecorate", "isStrictDecorate", "trackBy", "readonly", "placeholder", "beforeInput", "blur", "click", "compositionEnd", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems", "isVisible"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
13449
13386
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheEditorComponent, decorators: [{
|
|
13450
13387
|
type: Component,
|
|
13451
13388
|
args: [{
|
|
@@ -13531,7 +13468,7 @@ class TheToolbarGroupComponent {
|
|
|
13531
13468
|
}
|
|
13532
13469
|
set item(i) {
|
|
13533
13470
|
this._item = i;
|
|
13534
|
-
this.
|
|
13471
|
+
this.activeMenuItem = i;
|
|
13535
13472
|
}
|
|
13536
13473
|
get item() {
|
|
13537
13474
|
return this._item;
|
|
@@ -13562,9 +13499,9 @@ class TheToolbarGroupComponent {
|
|
|
13562
13499
|
this.openGroup(event);
|
|
13563
13500
|
}
|
|
13564
13501
|
}
|
|
13565
|
-
|
|
13502
|
+
selectionChange(editor) {
|
|
13566
13503
|
const activeItem = this.menusActive(editor);
|
|
13567
|
-
this.
|
|
13504
|
+
this.activeMenuItem = activeItem ? activeItem : null;
|
|
13568
13505
|
this.activeChange();
|
|
13569
13506
|
this.colseGroup();
|
|
13570
13507
|
}
|
|
@@ -13606,7 +13543,7 @@ class TheToolbarGroupComponent {
|
|
|
13606
13543
|
}
|
|
13607
13544
|
}
|
|
13608
13545
|
TheToolbarGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarGroupComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
13609
|
-
TheToolbarGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarGroupComponent, selector: "the-toolbar-group", inputs: { menus: "menus", item: "item" }, host: { listeners: { "mousedown": "mousedownHandler($event)", "click": "clickHandle($event)" }, classAttribute: "the-toolbar-group" }, viewQueries: [{ propertyName: "groupTemplate", first: true, predicate: ["groupTemplate"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<a thyIconNavLink [thyIconNavLinkIcon]=\"item.icon\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\" [thyIconNavLinkActive]=\"active\"></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n", components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
13546
|
+
TheToolbarGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarGroupComponent, selector: "the-toolbar-group", inputs: { menus: "menus", item: "item" }, host: { listeners: { "mousedown": "mousedownHandler($event)", "click": "clickHandle($event)" }, classAttribute: "the-toolbar-group" }, viewQueries: [{ propertyName: "groupTemplate", first: true, predicate: ["groupTemplate"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<a thyIconNavLink [thyIconNavLinkIcon]=\"item.icon\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\" [thyIconNavLinkActive]=\"active\"></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n", components: [{ type: i3$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
13610
13547
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarGroupComponent, decorators: [{
|
|
13611
13548
|
type: Component,
|
|
13612
13549
|
args: [{
|
|
@@ -13669,7 +13606,6 @@ const COMPONENTS = [
|
|
|
13669
13606
|
TheTableToolbarItemComponent,
|
|
13670
13607
|
TheConversionHintComponent,
|
|
13671
13608
|
TheVerticalToolbarItemComponent,
|
|
13672
|
-
TheIndentToolbarComponent,
|
|
13673
13609
|
TheTableOptionsComponent
|
|
13674
13610
|
];
|
|
13675
13611
|
const PLUGIN_COMPONENTS = [
|
|
@@ -13713,7 +13649,6 @@ TheEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
13713
13649
|
TheTableToolbarItemComponent,
|
|
13714
13650
|
TheConversionHintComponent,
|
|
13715
13651
|
TheVerticalToolbarItemComponent,
|
|
13716
|
-
TheIndentToolbarComponent,
|
|
13717
13652
|
TheTableOptionsComponent, TheImageComponent,
|
|
13718
13653
|
TheTemplateComponent,
|
|
13719
13654
|
TheHrComponent,
|
|
@@ -13824,5 +13759,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
13824
13759
|
* Generated bundle index. Do not edit.
|
|
13825
13760
|
*/
|
|
13826
13761
|
|
|
13827
|
-
export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETEBACKWARD_TYPES, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, COMPONENTS, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, ColorEditor, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultQuickToolbarDefinition, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeadingEditor, HrEditor, IS_MAC, ImageEditor, IndentEditor, Indents, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LayoutTypes, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, PluginKeys, QuickInsertEditor, STANDARD_HEADING_TYPES, TAB_SPACE, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_QUICK_TOOLBAR_REF, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_MODE_PROVIDER, THE_MODE_TOKEN, THE_UPLOAD_SERVICE_TOKEN, TableEditor, TheBaseElementComponent, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent,
|
|
13762
|
+
export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETEBACKWARD_TYPES, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, COMPONENTS, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, ColorEditor, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultQuickToolbarDefinition, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeadingEditor, HrEditor, IS_MAC, ImageEditor, IndentEditor, Indents, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LayoutTypes, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, PluginKeys, QuickInsertEditor, STANDARD_HEADING_TYPES, TAB_SPACE, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_QUICK_TOOLBAR_REF, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_MODE_PROVIDER, THE_MODE_TOKEN, THE_UPLOAD_SERVICE_TOKEN, TableEditor, TheBaseElementComponent, TheBaseToolbarDropdown, TheBaseToolbarItem, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheMode, TheModeConfig, index$1 as TheQueries, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarGroupComponent, TheToolbarGroupToken, TheToolbarItemComponent, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemMode, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, ZERO_WIDTH_CHAR, autoFocus, autoScrollViewHandle, coercePixelsFromCssValue, combinePlugins, createEmptyParagraph, createPluginFactory, createToolbar, createVerticalAlignPlugin, dataDeserialize, dataSerializing, deleteElementKey, extractFragment, filterTextFormat, flattenDeepPlugins, getColsTotalWidth, getEditorUUID, getElementClassByPrefix, getElementHeight, getElementWidth, getEndBlock, getPlugin, getPluginOptions, getPlugins, getRowsTotalHeight, getStartBlock, getToolbarClass, headingOptions, htmlToTheia, idCreator, inValidTypes, internalPlugins, isCleanEmptyParagraph, isPureEmptyParagraph, mergeArray, mergeDeepPlugins, mergeElementOptions, mergeOptions, nestedStructureByKey, plainToTheia, pluginsByKey, setEditorUUID, useElementStyle, withTheia };
|
|
13828
13763
|
//# sourceMappingURL=worktile-theia.js.map
|