@worktile/theia 2.1.0 → 2.1.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 +238 -172
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/components/toolbar/toolbar.component.d.ts +4 -1
- package/components/toolbar/toolbar.component.scss +2 -0
- package/components/toolbar-dropdown/toolbar-dropdown.component.d.ts +7 -5
- package/components/toolbar-dropdown/toolbar-dropdown.component.scss +2 -0
- package/components/toolbar-item/toolbar-item.component.d.ts +3 -0
- package/constants/default.d.ts +0 -1
- package/constants/node-types.d.ts +15 -0
- package/editor.module.d.ts +43 -45
- package/esm2015/components/inline-toolbar/inline-toolbar.component.js +1 -1
- package/esm2015/components/toolbar/toolbar.component.js +18 -6
- package/esm2015/components/toolbar-dropdown/toolbar-dropdown.component.js +14 -5
- package/esm2015/components/toolbar-group/toolbar-group.component.js +1 -1
- package/esm2015/components/toolbar-item/toolbar-item.component.js +20 -6
- package/esm2015/constants/default.js +1 -2
- package/esm2015/constants/node-types.js +29 -1
- package/esm2015/editor.component.js +7 -6
- package/esm2015/editor.module.js +3 -6
- package/esm2015/interfaces/editor.js +1 -1
- package/esm2015/interfaces/toolbar.js +1 -1
- package/esm2015/plugins/align/options.js +2 -1
- package/esm2015/plugins/code/code.component.js +2 -2
- package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -2
- package/esm2015/plugins/font-size/font-size.editor.js +47 -0
- package/esm2015/plugins/font-size/options.js +20 -6
- package/esm2015/plugins/heading/heading.editor.js +13 -2
- package/esm2015/plugins/heading/options.js +2 -1
- package/esm2015/plugins/list/components/list-item.component.js +43 -1
- package/esm2015/plugins/mark/mark.plugin.js +15 -10
- package/esm2015/plugins/table/table.editor.js +1 -1
- package/esm2015/services/toolbar.service.js +2 -2
- package/fesm2015/worktile-theia.js +202 -144
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/editor.d.ts +3 -1
- package/interfaces/toolbar.d.ts +2 -1
- package/package.json +1 -1
- package/plugins/code/code.component.scss +1 -1
- package/plugins/font-size/font-size.editor.d.ts +8 -0
- package/plugins/font-size/options.d.ts +0 -1
- package/plugins/font-size/toolbar-item.component.scss +1 -11
- package/plugins/heading/heading.editor.d.ts +1 -1
- package/plugins/list/components/list-item.component.d.ts +4 -0
- package/plugins/table/table.editor.d.ts +1 -1
- package/styles/editor.scss +18 -1
- package/styles/typo.scss +2 -1
- package/esm2015/plugins/font-size/toolbar-item.component.js +0 -129
- package/plugins/font-size/toolbar-item.component.d.ts +0 -35
|
@@ -65,7 +65,6 @@ const PICTURE_ACCEPTED_UPLOAD_SIZE = 20;
|
|
|
65
65
|
const A_TAG_REL_ATTR = 'noopener noreferrer nofollow external ugc';
|
|
66
66
|
const LINK_DEFAULT_TEXT = '链接';
|
|
67
67
|
const TAB_SPACE = ' ';
|
|
68
|
-
const ZERO_WIDTH_CHAR = '\u200B';
|
|
69
68
|
const CLIPBOARD_FORMAT_KEY = 'x-theia-fragment';
|
|
70
69
|
const DEFAULT_SCROLL_CONTAINER = '.the-editable-container';
|
|
71
70
|
const ELEMENT_UNIQUE_ID = 'key';
|
|
@@ -112,6 +111,34 @@ var VerticalAlignment;
|
|
|
112
111
|
VerticalAlignment["middle"] = "middle";
|
|
113
112
|
VerticalAlignment["bottom"] = "bottom";
|
|
114
113
|
})(VerticalAlignment || (VerticalAlignment = {}));
|
|
114
|
+
var FontSizes;
|
|
115
|
+
(function (FontSizes) {
|
|
116
|
+
FontSizes["fontSize12"] = "12";
|
|
117
|
+
FontSizes["fontSize13"] = "13";
|
|
118
|
+
FontSizes["fontSize14"] = "14";
|
|
119
|
+
FontSizes["fontSize15"] = "15";
|
|
120
|
+
FontSizes["fontSize16"] = "16";
|
|
121
|
+
FontSizes["fontSize18"] = "18";
|
|
122
|
+
FontSizes["fontSize20"] = "20";
|
|
123
|
+
FontSizes["fontSize24"] = "24";
|
|
124
|
+
FontSizes["fontSize28"] = "28";
|
|
125
|
+
FontSizes["fontSize32"] = "32";
|
|
126
|
+
FontSizes["fontSize40"] = "40";
|
|
127
|
+
FontSizes["fontSize48"] = "48";
|
|
128
|
+
})(FontSizes || (FontSizes = {}));
|
|
129
|
+
const FontSizeTypes = [
|
|
130
|
+
FontSizes.fontSize12,
|
|
131
|
+
FontSizes.fontSize13,
|
|
132
|
+
FontSizes.fontSize14,
|
|
133
|
+
FontSizes.fontSize15,
|
|
134
|
+
FontSizes.fontSize16,
|
|
135
|
+
FontSizes.fontSize20,
|
|
136
|
+
FontSizes.fontSize24,
|
|
137
|
+
FontSizes.fontSize28,
|
|
138
|
+
FontSizes.fontSize32,
|
|
139
|
+
FontSizes.fontSize40,
|
|
140
|
+
FontSizes.fontSize48
|
|
141
|
+
];
|
|
115
142
|
var MarkTypes;
|
|
116
143
|
(function (MarkTypes) {
|
|
117
144
|
MarkTypes["bold"] = "bold";
|
|
@@ -2002,7 +2029,7 @@ const withDeserializeMd = (options) => (editor) => {
|
|
|
2002
2029
|
editor,
|
|
2003
2030
|
conversion: () => {
|
|
2004
2031
|
try {
|
|
2005
|
-
const html = marked(plainFragment, { gfm: true });
|
|
2032
|
+
const html = marked(plainFragment.replace(/\n```/g, "\n\n```"), { gfm: true });
|
|
2006
2033
|
const htmlDom = new DOMParser().parseFromString(html, 'text/html');
|
|
2007
2034
|
const fragment = TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
|
|
2008
2035
|
if (!isUnformatted(fragment)) {
|
|
@@ -3313,9 +3340,48 @@ class TheListItemComponent extends TheBaseElementComponent {
|
|
|
3313
3340
|
ngOnInit() {
|
|
3314
3341
|
super.ngOnInit();
|
|
3315
3342
|
}
|
|
3343
|
+
onContextChange() {
|
|
3344
|
+
super.onContextChange();
|
|
3345
|
+
this.applyFontSize();
|
|
3346
|
+
}
|
|
3316
3347
|
ngOnDestroy() {
|
|
3317
3348
|
super.ngOnDestroy();
|
|
3318
3349
|
}
|
|
3350
|
+
applyFontSize() {
|
|
3351
|
+
var _a, _b;
|
|
3352
|
+
let firstText;
|
|
3353
|
+
for (const entry of Node.descendants(this.element)) {
|
|
3354
|
+
const node = entry[0];
|
|
3355
|
+
if (Text.isText(node) && !firstText) {
|
|
3356
|
+
firstText = node;
|
|
3357
|
+
break;
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
if (!firstText) {
|
|
3361
|
+
return;
|
|
3362
|
+
}
|
|
3363
|
+
const { text } = firstText, rest = __rest(firstText, ["text"]);
|
|
3364
|
+
const size = rest[MarkTypes.fontSize];
|
|
3365
|
+
if (size) {
|
|
3366
|
+
const sizeClass = `font-size-${size}`;
|
|
3367
|
+
const isContains = (_b = (_a = this.elementRef.nativeElement) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.contains(sizeClass);
|
|
3368
|
+
if (isContains) {
|
|
3369
|
+
return;
|
|
3370
|
+
}
|
|
3371
|
+
this.clearFontSize();
|
|
3372
|
+
this.elementRef.nativeElement.classList.add(sizeClass);
|
|
3373
|
+
this.fontSizeClass = sizeClass;
|
|
3374
|
+
}
|
|
3375
|
+
else {
|
|
3376
|
+
this.clearFontSize();
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
clearFontSize() {
|
|
3380
|
+
if (this.fontSizeClass) {
|
|
3381
|
+
this.elementRef.nativeElement.classList.remove(this.fontSizeClass);
|
|
3382
|
+
this.fontSizeClass = null;
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3319
3385
|
}
|
|
3320
3386
|
TheListItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheListItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3321
3387
|
TheListItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheListItemComponent, selector: "li[theLi]", usesInheritance: true, ngImport: i0, template: `<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>`, isInline: true, components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
@@ -3832,11 +3898,14 @@ const withMark = () => (editor) => {
|
|
|
3832
3898
|
delete marks[key];
|
|
3833
3899
|
editor.marks = marks;
|
|
3834
3900
|
const text = Editor.string(e, selection.anchor.path);
|
|
3835
|
-
if (text
|
|
3836
|
-
|
|
3901
|
+
if (text !== '') {
|
|
3902
|
+
Editor.setNormalizing(editor, false);
|
|
3903
|
+
e.insertText('');
|
|
3904
|
+
editor.marks = marks;
|
|
3905
|
+
Editor.setNormalizing(editor, true);
|
|
3837
3906
|
}
|
|
3838
|
-
|
|
3839
|
-
e.
|
|
3907
|
+
else {
|
|
3908
|
+
Transforms.unsetNodes(e, key, { at: selection.anchor.path });
|
|
3840
3909
|
}
|
|
3841
3910
|
if (shouldChange) {
|
|
3842
3911
|
editor.onChange();
|
|
@@ -3854,11 +3923,14 @@ const withMark = () => (editor) => {
|
|
|
3854
3923
|
const marks = Object.assign(Object.assign({}, (Editor.marks(e) || {})), { [key]: value });
|
|
3855
3924
|
editor.marks = marks;
|
|
3856
3925
|
const text = Editor.string(e, selection.anchor.path);
|
|
3857
|
-
if (text
|
|
3858
|
-
|
|
3926
|
+
if (text !== '') {
|
|
3927
|
+
Editor.setNormalizing(editor, false);
|
|
3928
|
+
e.insertText('');
|
|
3929
|
+
editor.marks = marks;
|
|
3930
|
+
Editor.setNormalizing(editor, true);
|
|
3859
3931
|
}
|
|
3860
|
-
|
|
3861
|
-
e.
|
|
3932
|
+
else {
|
|
3933
|
+
Transforms.setNodes(e, { [key]: value }, { at: selection.anchor.path });
|
|
3862
3934
|
}
|
|
3863
3935
|
}
|
|
3864
3936
|
}
|
|
@@ -5450,6 +5522,15 @@ const HeadingEditor = {
|
|
|
5450
5522
|
split: true
|
|
5451
5523
|
});
|
|
5452
5524
|
Transforms.setNodes(editor, { type: heading });
|
|
5525
|
+
const entry = anchorBlockEntry(editor);
|
|
5526
|
+
const unMarks = {
|
|
5527
|
+
[MarkTypes.fontSize]: null
|
|
5528
|
+
};
|
|
5529
|
+
if (entry) {
|
|
5530
|
+
setMarks(editor, unMarks, entry[1]);
|
|
5531
|
+
return;
|
|
5532
|
+
}
|
|
5533
|
+
setMarks(editor, unMarks, editor.selection);
|
|
5453
5534
|
});
|
|
5454
5535
|
},
|
|
5455
5536
|
isHeadingActive(editor, heading) {
|
|
@@ -5466,6 +5547,7 @@ const HeadingOptions = [
|
|
|
5466
5547
|
name: '正文',
|
|
5467
5548
|
key: ElementKinds.headingList,
|
|
5468
5549
|
type: ToolbarItemType.toolDropdown,
|
|
5550
|
+
dropdownItemKey: ElementKinds.paragraph,
|
|
5469
5551
|
includes: [ElementKinds.paragraph, ...STANDARD_HEADING_TYPES]
|
|
5470
5552
|
},
|
|
5471
5553
|
{
|
|
@@ -5560,6 +5642,7 @@ const AlignOptions = [
|
|
|
5560
5642
|
key: ToolbarActionTypes.alignType,
|
|
5561
5643
|
type: ToolbarItemType.toolDropdown,
|
|
5562
5644
|
dropdownMode: DropdownMode.icon,
|
|
5645
|
+
dropdownItemKey: ToolbarActionTypes.alignLeft,
|
|
5563
5646
|
includes: [ToolbarActionTypes.alignLeft, ToolbarActionTypes.alignCenter, ToolbarActionTypes.alignRight],
|
|
5564
5647
|
name: '对齐方式'
|
|
5565
5648
|
},
|
|
@@ -6176,6 +6259,7 @@ class TheToolbarDropdownComponent extends TheToolbarBaseItemComponent {
|
|
|
6176
6259
|
this.overlay = overlay;
|
|
6177
6260
|
this.mode = DropdownMode.text;
|
|
6178
6261
|
this.dropdownMode = DropdownMode;
|
|
6262
|
+
this.disabled = false;
|
|
6179
6263
|
}
|
|
6180
6264
|
set item(i) {
|
|
6181
6265
|
this._item = i;
|
|
@@ -6190,7 +6274,7 @@ class TheToolbarDropdownComponent extends TheToolbarBaseItemComponent {
|
|
|
6190
6274
|
toggleDropdown(event) {
|
|
6191
6275
|
var _a;
|
|
6192
6276
|
super.execute(event);
|
|
6193
|
-
if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
6277
|
+
if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled) {
|
|
6194
6278
|
return;
|
|
6195
6279
|
}
|
|
6196
6280
|
this.openDropdownPopover();
|
|
@@ -6200,6 +6284,9 @@ class TheToolbarDropdownComponent extends TheToolbarBaseItemComponent {
|
|
|
6200
6284
|
this.closeDropdownPopover();
|
|
6201
6285
|
}
|
|
6202
6286
|
}
|
|
6287
|
+
get disabledState() {
|
|
6288
|
+
return this.disabled;
|
|
6289
|
+
}
|
|
6203
6290
|
ngOnInit() {
|
|
6204
6291
|
var _a;
|
|
6205
6292
|
if (!this.template) {
|
|
@@ -6213,12 +6300,14 @@ class TheToolbarDropdownComponent extends TheToolbarBaseItemComponent {
|
|
|
6213
6300
|
}
|
|
6214
6301
|
}
|
|
6215
6302
|
statusChange(editor) {
|
|
6303
|
+
var _a, _b;
|
|
6304
|
+
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;
|
|
6216
6305
|
const activeItem = this.menus.find(i => {
|
|
6217
6306
|
if (i === null || i === void 0 ? void 0 : i.active) {
|
|
6218
6307
|
return i === null || i === void 0 ? void 0 : i.active(editor);
|
|
6219
6308
|
}
|
|
6220
6309
|
});
|
|
6221
|
-
this.activeMenu = activeItem ? activeItem : this.
|
|
6310
|
+
this.activeMenu = activeItem ? activeItem : this.item;
|
|
6222
6311
|
}
|
|
6223
6312
|
itemMousedown(event, item) {
|
|
6224
6313
|
super.execute(event);
|
|
@@ -6272,7 +6361,7 @@ class TheToolbarDropdownComponent extends TheToolbarBaseItemComponent {
|
|
|
6272
6361
|
}
|
|
6273
6362
|
}
|
|
6274
6363
|
TheToolbarDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarDropdownComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
6275
|
-
TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item", 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]=\"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</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenu?.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 === activeMenu.key\"\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.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i5$2.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i6.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: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
6364
|
+
TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item", itemMousedownHandle: "itemMousedownHandle" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.disabled": "this.disabledState" }, 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]=\"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</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenu?.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 === activeMenu.key\"\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.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i5$2.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i6.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: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
6276
6365
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarDropdownComponent, decorators: [{
|
|
6277
6366
|
type: Component,
|
|
6278
6367
|
args: [{
|
|
@@ -6307,6 +6396,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
6307
6396
|
}], handleDocumentMouseDown: [{
|
|
6308
6397
|
type: HostListener,
|
|
6309
6398
|
args: ['document: mousedown', ['$event']]
|
|
6399
|
+
}], disabledState: [{
|
|
6400
|
+
type: HostBinding,
|
|
6401
|
+
args: ['class.disabled']
|
|
6310
6402
|
}] } });
|
|
6311
6403
|
|
|
6312
6404
|
class NavSplitLineComponent {
|
|
@@ -6499,7 +6591,7 @@ class TheCodeComponent extends TheBaseElementComponent {
|
|
|
6499
6591
|
}
|
|
6500
6592
|
}
|
|
6501
6593
|
TheCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheCodeComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$4.ThyNotifyService }, { token: TheContextService }, { token: i0.NgZone }, { token: THE_CODE_MODE_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
6502
|
-
TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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=\"isFocusCode && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"> </the-toolbar-dropdown>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\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 <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\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)]=\"
|
|
6594
|
+
TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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=\"isFocusCode && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"> </the-toolbar-dropdown>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\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 <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\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 </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>\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=\"isFocusCode && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["toolbarItem", "menus", "mode", "item", "itemMousedownHandle"] }, { type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i6$1.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { 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: i6.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"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6503
6595
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheCodeComponent, decorators: [{
|
|
6504
6596
|
type: Component,
|
|
6505
6597
|
args: [{
|
|
@@ -10632,6 +10724,13 @@ class TheToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
|
10632
10724
|
this.itemMode = ToolbarItemMode.horizontal;
|
|
10633
10725
|
this.ToolbarItemMode = ToolbarItemMode;
|
|
10634
10726
|
this.active = false;
|
|
10727
|
+
this.disabled = false;
|
|
10728
|
+
}
|
|
10729
|
+
toggleDropdown(event) {
|
|
10730
|
+
super.execute(event);
|
|
10731
|
+
}
|
|
10732
|
+
get disabledState() {
|
|
10733
|
+
return this.disabled;
|
|
10635
10734
|
}
|
|
10636
10735
|
ngOnInit() {
|
|
10637
10736
|
var _a, _b;
|
|
@@ -10640,13 +10739,14 @@ class TheToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
|
10640
10739
|
}
|
|
10641
10740
|
}
|
|
10642
10741
|
statusChange(editor) {
|
|
10643
|
-
var _a, _b;
|
|
10644
|
-
this.
|
|
10742
|
+
var _a, _b, _c, _d;
|
|
10743
|
+
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;
|
|
10744
|
+
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;
|
|
10645
10745
|
}
|
|
10646
10746
|
execute(event) {
|
|
10647
10747
|
var _a, _b, _c;
|
|
10648
10748
|
super.execute(event);
|
|
10649
|
-
if (
|
|
10749
|
+
if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled || !((_b = this.item) === null || _b === void 0 ? void 0 : _b.execute)) {
|
|
10650
10750
|
return;
|
|
10651
10751
|
}
|
|
10652
10752
|
(_c = this.item) === null || _c === void 0 ? void 0 : _c.execute(this.editor);
|
|
@@ -10662,7 +10762,7 @@ class TheToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
|
10662
10762
|
}
|
|
10663
10763
|
}
|
|
10664
10764
|
TheToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarItemComponent, deps: [{ token: i0.NgZone }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component });
|
|
10665
|
-
TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor", itemMode: "itemMode" }, host: { classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
10765
|
+
TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor", itemMode: "itemMode" }, host: { listeners: { "mousedown": "toggleDropdown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
10666
10766
|
<ng-container *ngIf="itemMode === ToolbarItemMode.horizontal; else selectionItem">
|
|
10667
10767
|
<a
|
|
10668
10768
|
thyIconNavLink
|
|
@@ -10721,6 +10821,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
10721
10821
|
}], toolbarContainer: [{
|
|
10722
10822
|
type: ViewChild,
|
|
10723
10823
|
args: ['toolbarContainer', { read: ViewContainerRef, static: true }]
|
|
10824
|
+
}], toggleDropdown: [{
|
|
10825
|
+
type: HostListener,
|
|
10826
|
+
args: ['mousedown', ['$event']]
|
|
10827
|
+
}], disabledState: [{
|
|
10828
|
+
type: HostBinding,
|
|
10829
|
+
args: ['class.disabled']
|
|
10724
10830
|
}] } });
|
|
10725
10831
|
|
|
10726
10832
|
class TheQuickToolbarComponent extends mixinUnsubscribe(MixinBase) {
|
|
@@ -10885,128 +10991,69 @@ const withSoftBreak = (options = { rules: [{ hotkey: 'shift+enter' }] }) => (edi
|
|
|
10885
10991
|
return editor;
|
|
10886
10992
|
};
|
|
10887
10993
|
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
this.elementRef = elementRef;
|
|
10892
|
-
this.thyPopover = thyPopover;
|
|
10893
|
-
this.viewContainerRef = viewContainerRef;
|
|
10894
|
-
this.overlay = overlay;
|
|
10895
|
-
this.fontSizes = FontSizes;
|
|
10896
|
-
this.disabled = false;
|
|
10897
|
-
this.disableGroup = HEADING_TYPES;
|
|
10898
|
-
this.toolbarItemContainer = true;
|
|
10899
|
-
this.fontSizeToolbarItem = true;
|
|
10900
|
-
}
|
|
10901
|
-
get isOpen() {
|
|
10902
|
-
return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
|
|
10903
|
-
}
|
|
10904
|
-
get disableClass() {
|
|
10905
|
-
return this.disabled;
|
|
10906
|
-
}
|
|
10907
|
-
toggleDropdown(event) {
|
|
10908
|
-
var _a;
|
|
10909
|
-
super.execute(event);
|
|
10910
|
-
if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled) {
|
|
10994
|
+
const FontSizeEditor = {
|
|
10995
|
+
setFontSize(editor, size) {
|
|
10996
|
+
if (TableEditor.toggleMark(editor, false, MarkTypes.fontSize, Number(size))) {
|
|
10911
10997
|
return;
|
|
10912
10998
|
}
|
|
10913
|
-
|
|
10914
|
-
}
|
|
10915
|
-
|
|
10916
|
-
if (!this.elementRef.nativeElement.contains(event.target)) {
|
|
10917
|
-
this.closeDropdownPopover();
|
|
10918
|
-
}
|
|
10919
|
-
}
|
|
10920
|
-
ngOnInit() {
|
|
10921
|
-
this.activeSize = this.fontSizes[2];
|
|
10922
|
-
}
|
|
10923
|
-
statusChange(editor) {
|
|
10999
|
+
Editor.addMark(editor, MarkTypes.fontSize, Number(size));
|
|
11000
|
+
},
|
|
11001
|
+
isFontSizeActive(editor, size) {
|
|
10924
11002
|
if (editor.selection) {
|
|
10925
11003
|
const anchorBlock$1 = anchorBlock(editor);
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10929
|
-
|
|
11004
|
+
switch (anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type) {
|
|
11005
|
+
case ElementKinds.heading_1:
|
|
11006
|
+
return size === FontSizes.fontSize28;
|
|
11007
|
+
case ElementKinds.heading_2:
|
|
11008
|
+
return size === FontSizes.fontSize24;
|
|
11009
|
+
case ElementKinds.heading_3:
|
|
11010
|
+
return size === FontSizes.fontSize20;
|
|
11011
|
+
case ElementKinds.heading_4:
|
|
11012
|
+
return size === FontSizes.fontSize18;
|
|
11013
|
+
case ElementKinds.heading_5:
|
|
11014
|
+
return size === FontSizes.fontSize16;
|
|
11015
|
+
case ElementKinds.heading_6:
|
|
11016
|
+
return size === FontSizes.fontSize14;
|
|
11017
|
+
case ElementKinds.paragraph:
|
|
11018
|
+
const marks = getSelectionMarks(editor);
|
|
11019
|
+
const fontSizeMark = marks[MarkTypes.fontSize];
|
|
11020
|
+
return Number(size) === fontSizeMark;
|
|
11021
|
+
default:
|
|
11022
|
+
return false;
|
|
10930
11023
|
}
|
|
10931
|
-
const marks = getSelectionMarks(editor);
|
|
10932
|
-
const fontSizeMark = marks[MarkTypes.fontSize];
|
|
10933
|
-
this.activeSize = fontSizeMark ? fontSizeMark : this.fontSizes[2];
|
|
10934
|
-
this.disabled = false;
|
|
10935
|
-
}
|
|
10936
|
-
}
|
|
10937
|
-
itemMousedown(event, size) {
|
|
10938
|
-
var _a, _b;
|
|
10939
|
-
super.execute(event);
|
|
10940
|
-
this.closeDropdownPopover();
|
|
10941
|
-
if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.readOnly)) {
|
|
10942
|
-
return;
|
|
10943
11024
|
}
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
var _a;
|
|
10952
|
-
this.dropdownPopoverRef = this.thyPopover.open(this.dropdownTemplate, {
|
|
10953
|
-
origin: this.elementRef,
|
|
10954
|
-
panelClass: ['the-toolbar-dropdown-popover', (_a = this.item) === null || _a === void 0 ? void 0 : _a.key],
|
|
10955
|
-
placement: 'bottomLeft',
|
|
10956
|
-
insideClosable: false,
|
|
10957
|
-
backdropClosable: true,
|
|
10958
|
-
hasBackdrop: false,
|
|
10959
|
-
offset: 10,
|
|
10960
|
-
viewContainerRef: this.viewContainerRef,
|
|
10961
|
-
scrollStrategy: this.overlay.scrollStrategies.reposition()
|
|
10962
|
-
});
|
|
10963
|
-
}
|
|
10964
|
-
closeDropdownPopover() {
|
|
10965
|
-
var _a;
|
|
10966
|
-
if (this.dropdownPopoverRef) {
|
|
10967
|
-
(_a = this.dropdownPopoverRef) === null || _a === void 0 ? void 0 : _a.close();
|
|
11025
|
+
return false;
|
|
11026
|
+
},
|
|
11027
|
+
isDisabled(editor) {
|
|
11028
|
+
if (editor.selection) {
|
|
11029
|
+
const disableGroup = HEADING_TYPES;
|
|
11030
|
+
const anchorBlock$1 = anchorBlock(editor);
|
|
11031
|
+
return anchorBlock$1 && disableGroup.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
|
|
10968
11032
|
}
|
|
11033
|
+
return false;
|
|
10969
11034
|
}
|
|
10970
|
-
}
|
|
10971
|
-
TheFontSizeToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheFontSizeToolbarItemComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
10972
|
-
TheFontSizeToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheFontSizeToolbarItemComponent, selector: "the-font-size-toolbar-item", inputs: { editor: "editor", item: "item" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.the-toolbar-dropdown-container": "this.toolbarItemContainer", "class.the-font-size-toolbar-item": "this.fontSizeToolbarItem", "class.disabled": "this.disableClass" } }, viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\">\n <span *ngIf=\"activeSize\" class=\"show-text\">{{ activeSize }}</span>\n <thy-icon class=\"text-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\">\n <ng-container *ngFor=\"let size of fontSizes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"size === activeSize\"\n (mousedown)=\"itemMousedown($event, size)\"\n >\n <span thyActionMenuItemName>{{ size }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.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: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i5$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
10973
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheFontSizeToolbarItemComponent, decorators: [{
|
|
10974
|
-
type: Component,
|
|
10975
|
-
args: [{
|
|
10976
|
-
selector: 'the-font-size-toolbar-item',
|
|
10977
|
-
templateUrl: './toolbar-item.component.html'
|
|
10978
|
-
}]
|
|
10979
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$3.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2.Overlay }]; }, propDecorators: { editor: [{
|
|
10980
|
-
type: Input
|
|
10981
|
-
}], item: [{
|
|
10982
|
-
type: Input
|
|
10983
|
-
}], dropdownTemplate: [{
|
|
10984
|
-
type: ViewChild,
|
|
10985
|
-
args: ['dropdownTemplate', { static: true }]
|
|
10986
|
-
}], toolbarItemContainer: [{
|
|
10987
|
-
type: HostBinding,
|
|
10988
|
-
args: ['class.the-toolbar-dropdown-container']
|
|
10989
|
-
}], fontSizeToolbarItem: [{
|
|
10990
|
-
type: HostBinding,
|
|
10991
|
-
args: ['class.the-font-size-toolbar-item']
|
|
10992
|
-
}], disableClass: [{
|
|
10993
|
-
type: HostBinding,
|
|
10994
|
-
args: ['class.disabled']
|
|
10995
|
-
}], toggleDropdown: [{
|
|
10996
|
-
type: HostListener,
|
|
10997
|
-
args: ['mousedown', ['$event']]
|
|
10998
|
-
}], handleDocumentMouseDown: [{
|
|
10999
|
-
type: HostListener,
|
|
11000
|
-
args: ['document: mousedown', ['$event']]
|
|
11001
|
-
}] } });
|
|
11035
|
+
};
|
|
11002
11036
|
|
|
11003
|
-
const
|
|
11037
|
+
const sizeOptions = () => {
|
|
11038
|
+
return FontSizeTypes.map(fontSize => {
|
|
11039
|
+
return {
|
|
11040
|
+
key: fontSize,
|
|
11041
|
+
name: fontSize,
|
|
11042
|
+
execute: editor => FontSizeEditor.setFontSize(editor, fontSize),
|
|
11043
|
+
active: editor => FontSizeEditor.isFontSizeActive(editor, fontSize)
|
|
11044
|
+
};
|
|
11045
|
+
});
|
|
11046
|
+
};
|
|
11004
11047
|
const FontSizeOptions = [
|
|
11005
11048
|
{
|
|
11006
11049
|
key: MarkTypes.fontSize,
|
|
11007
11050
|
name: '字号',
|
|
11008
|
-
|
|
11009
|
-
|
|
11051
|
+
type: ToolbarItemType.toolDropdown,
|
|
11052
|
+
dropdownItemKey: FontSizes.fontSize14,
|
|
11053
|
+
includes: FontSizeTypes,
|
|
11054
|
+
disable: editor => FontSizeEditor.isDisabled(editor)
|
|
11055
|
+
},
|
|
11056
|
+
...sizeOptions()
|
|
11010
11057
|
];
|
|
11011
11058
|
|
|
11012
11059
|
const internalPlugins = [
|
|
@@ -11127,7 +11174,7 @@ class TheToolbarService {
|
|
|
11127
11174
|
return entity;
|
|
11128
11175
|
}
|
|
11129
11176
|
getToolbarItemByKeys(keys, toolbarItems) {
|
|
11130
|
-
return keys.map(key => {
|
|
11177
|
+
return keys.map((key) => {
|
|
11131
11178
|
if (key === `split`) {
|
|
11132
11179
|
return { key: `split` };
|
|
11133
11180
|
}
|
|
@@ -11355,14 +11402,15 @@ class TheToolbarComponent {
|
|
|
11355
11402
|
});
|
|
11356
11403
|
}
|
|
11357
11404
|
createToolbarItem(item) {
|
|
11358
|
-
const { iconComponent, type, dropdownMode } = item, args = __rest(item, ["iconComponent", "type", "dropdownMode"]);
|
|
11405
|
+
const { iconComponent, type, dropdownMode, dropdownItemKey, includes } = item, args = __rest(item, ["iconComponent", "type", "dropdownMode", "dropdownItemKey", "includes"]);
|
|
11359
11406
|
const viewComponent = this.viewComponentType(type);
|
|
11407
|
+
const dropdownItem = this.getDropdownItem(item);
|
|
11360
11408
|
const factory = this.cfr.resolveComponentFactory(iconComponent ? iconComponent : viewComponent);
|
|
11361
11409
|
const compRef = this.toolbarContainer.createComponent(factory);
|
|
11362
11410
|
compRef.instance.editor = this.editor;
|
|
11363
11411
|
compRef.instance.toolbarItem = item;
|
|
11364
|
-
compRef.instance.menus =
|
|
11365
|
-
compRef.instance.item =
|
|
11412
|
+
compRef.instance.menus = includes;
|
|
11413
|
+
compRef.instance.item = includes && dropdownItem ? dropdownItem : args;
|
|
11366
11414
|
compRef.instance.mode = dropdownMode;
|
|
11367
11415
|
this.components.set(item.key, compRef);
|
|
11368
11416
|
}
|
|
@@ -11389,9 +11437,18 @@ class TheToolbarComponent {
|
|
|
11389
11437
|
}
|
|
11390
11438
|
return TheToolbarItemComponent;
|
|
11391
11439
|
}
|
|
11440
|
+
getDropdownItem(item) {
|
|
11441
|
+
var _a;
|
|
11442
|
+
let dropdownKey = item === null || item === void 0 ? void 0 : item.dropdownItemKey;
|
|
11443
|
+
// modify the fontsize option externally
|
|
11444
|
+
if (item.key === MarkTypes.fontSize && this.fontSize) {
|
|
11445
|
+
dropdownKey = this.fontSize;
|
|
11446
|
+
}
|
|
11447
|
+
return (_a = item === null || item === void 0 ? void 0 : item.includes) === null || _a === void 0 ? void 0 : _a.find((item) => item.key === dropdownKey);
|
|
11448
|
+
}
|
|
11392
11449
|
}
|
|
11393
11450
|
TheToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: TheToolbarGroupToken }], target: i0.ɵɵFactoryTarget.Component });
|
|
11394
|
-
TheToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
11451
|
+
TheToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarComponent, selector: "the-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems", align: "align", fontSize: "fontSize", 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: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
11395
11452
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarComponent, decorators: [{
|
|
11396
11453
|
type: Component,
|
|
11397
11454
|
args: [{
|
|
@@ -11410,6 +11467,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
11410
11467
|
type: Input
|
|
11411
11468
|
}], align: [{
|
|
11412
11469
|
type: Input
|
|
11470
|
+
}], fontSize: [{
|
|
11471
|
+
type: Input
|
|
11413
11472
|
}], containerClass: [{
|
|
11414
11473
|
type: Input
|
|
11415
11474
|
}], isMore: [{
|
|
@@ -11523,7 +11582,7 @@ TheInlineToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
|
|
|
11523
11582
|
[editor]="editor"
|
|
11524
11583
|
[toolbarItems]="toolbarItems"
|
|
11525
11584
|
[isMore]="false"
|
|
11526
|
-
></the-toolbar> `, isInline: true, components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11585
|
+
></the-toolbar> `, isInline: true, components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "fontSize", "containerClass", "isMore", "afterTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11527
11586
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheInlineToolbarComponent, decorators: [{
|
|
11528
11587
|
type: Component,
|
|
11529
11588
|
args: [{
|
|
@@ -11784,14 +11843,14 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
11784
11843
|
return leaf ? leaf : null;
|
|
11785
11844
|
};
|
|
11786
11845
|
this.renderText = (text) => {
|
|
11787
|
-
if (text.text.length === 0) {
|
|
11788
|
-
return;
|
|
11789
|
-
}
|
|
11790
11846
|
for (const key in MarkTypes) {
|
|
11791
11847
|
if (text[MarkTypes[key]]) {
|
|
11792
11848
|
return TheTextComponent;
|
|
11793
11849
|
}
|
|
11794
11850
|
}
|
|
11851
|
+
if (text.text.length === 0) {
|
|
11852
|
+
return;
|
|
11853
|
+
}
|
|
11795
11854
|
};
|
|
11796
11855
|
this.onKeyDown = (event) => {
|
|
11797
11856
|
shortcuts(this.editor, event);
|
|
@@ -11933,7 +11992,7 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
11933
11992
|
}
|
|
11934
11993
|
}
|
|
11935
11994
|
toolbarCalculate() {
|
|
11936
|
-
var _a;
|
|
11995
|
+
var _a, _b;
|
|
11937
11996
|
const toolbar = (_a = this === null || this === void 0 ? void 0 : this.theOptions) === null || _a === void 0 ? void 0 : _a.toolbar;
|
|
11938
11997
|
const toolbarItems = toolbarCompose(toolbar === null || toolbar === void 0 ? void 0 : toolbar.toolbarItems);
|
|
11939
11998
|
const toolbarOption = this.toolbarService.initialize(toolbarItems, toolbar === null || toolbar === void 0 ? void 0 : toolbar.global, toolbar === null || toolbar === void 0 ? void 0 : toolbar.inline, toolbar === null || toolbar === void 0 ? void 0 : toolbar.quick);
|
|
@@ -11944,6 +12003,7 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
11944
12003
|
this.theGlobalToolbarInstance.toolbarItems = toolbarOption.toolbarEntity.global;
|
|
11945
12004
|
this.theGlobalToolbarInstance.containerClass = this.globalToolbarClass;
|
|
11946
12005
|
this.theGlobalToolbarInstance.align = toolbar === null || toolbar === void 0 ? void 0 : toolbar.align;
|
|
12006
|
+
this.theGlobalToolbarInstance.fontSize = (_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.fontSize;
|
|
11947
12007
|
this.theGlobalToolbarInstance.setToolbarClass();
|
|
11948
12008
|
this.theGlobalToolbarInstance.renderToolbarView();
|
|
11949
12009
|
}
|
|
@@ -12093,7 +12153,7 @@ TheEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
|
|
|
12093
12153
|
useExisting: forwardRef(() => TheEditorComponent),
|
|
12094
12154
|
multi: true
|
|
12095
12155
|
}
|
|
12096
|
-
], 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 }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: 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 [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\"></div>\n <div #placeholder thePlaceholder [editor]=\"editor\" [options]=\"theOptions\"></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"] }, { type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: ["editor", "options"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
12156
|
+
], 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 }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: 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 [fontSize]=\"theOptions?.fontSize\"\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 [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\"></div>\n <div #placeholder thePlaceholder [editor]=\"editor\" [options]=\"theOptions\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "fontSize", "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"] }, { type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: ["editor", "options"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
12097
12157
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheEditorComponent, decorators: [{
|
|
12098
12158
|
type: Component,
|
|
12099
12159
|
args: [{
|
|
@@ -12257,7 +12317,7 @@ class TheToolbarGroupComponent {
|
|
|
12257
12317
|
}
|
|
12258
12318
|
}
|
|
12259
12319
|
TheToolbarGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarGroupComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
12260
|
-
TheToolbarGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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"] }] });
|
|
12320
|
+
TheToolbarGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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", "fontSize", "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"] }] });
|
|
12261
12321
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarGroupComponent, decorators: [{
|
|
12262
12322
|
type: Component,
|
|
12263
12323
|
args: [{
|
|
@@ -12319,8 +12379,7 @@ const COMPONENTS = [
|
|
|
12319
12379
|
TheTableSelectComponent,
|
|
12320
12380
|
TheTableToolbarItemComponent,
|
|
12321
12381
|
TheConversionHintComponent,
|
|
12322
|
-
TheVerticalToolbarItemComponent
|
|
12323
|
-
TheFontSizeToolbarItemComponent
|
|
12382
|
+
TheVerticalToolbarItemComponent
|
|
12324
12383
|
];
|
|
12325
12384
|
const PLUGIN_COMPONENTS = [
|
|
12326
12385
|
TheImageComponent,
|
|
@@ -12363,8 +12422,7 @@ TheEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
12363
12422
|
TheTableSelectComponent,
|
|
12364
12423
|
TheTableToolbarItemComponent,
|
|
12365
12424
|
TheConversionHintComponent,
|
|
12366
|
-
TheVerticalToolbarItemComponent,
|
|
12367
|
-
TheFontSizeToolbarItemComponent, TheImageComponent,
|
|
12425
|
+
TheVerticalToolbarItemComponent, TheImageComponent,
|
|
12368
12426
|
TheTemplateComponent,
|
|
12369
12427
|
TheHrComponent,
|
|
12370
12428
|
TheBlockquoteComponent,
|
|
@@ -12430,5 +12488,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
12430
12488
|
* Generated bundle index. Do not edit.
|
|
12431
12489
|
*/
|
|
12432
12490
|
|
|
12433
|
-
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, CodeMode, ColorEditor, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultQuickToolbarDefinition, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, HEADING_TYPES, HeadingEditor, HrEditor, IS_MAC, ImageEditor, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, QUICK_TOOLBAR_HOTKEY, QuickInsertEditor, STANDARD_HEADING_TYPES, TAB_SPACE, THE_CODE_MODE_PROVIDER, THE_CODE_MODE_TOKEN, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_QUICK_TOOLBAR_REF, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_UPLOAD_SERVICE_TOKEN, TableEditor, TheBaseElementComponent, TheCodeConfig, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheMode, index$1 as TheQueries, TheToolbarBaseItemComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarGroupComponent, TheToolbarGroupToken, TheToolbarItemComponent, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemMode, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment,
|
|
12491
|
+
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, CodeMode, 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, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, QUICK_TOOLBAR_HOTKEY, QuickInsertEditor, STANDARD_HEADING_TYPES, TAB_SPACE, THE_CODE_MODE_PROVIDER, THE_CODE_MODE_TOKEN, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_QUICK_TOOLBAR_REF, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_UPLOAD_SERVICE_TOKEN, TableEditor, TheBaseElementComponent, TheCodeConfig, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheMode, index$1 as TheQueries, TheToolbarBaseItemComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarGroupComponent, TheToolbarGroupToken, TheToolbarItemComponent, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemMode, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, createEmptyParagraph, dataDeserialize, dataSerializing, getToolbarClass, htmlToTheia, inValidTypes, plainToTheia, toolbarCompose, withTheEditor };
|
|
12434
12492
|
//# sourceMappingURL=worktile-theia.js.map
|