@worktile/theia 2.1.7 → 2.1.11
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 +101 -41
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/editor.component.d.ts +1 -0
- package/editor.module.d.ts +2 -2
- package/esm2015/components/toolbar/toolbar.component.js +1 -1
- package/esm2015/editor.component.js +10 -4
- package/esm2015/interfaces/editor.js +1 -1
- package/esm2015/plugins/align/align.editor.js +2 -2
- package/esm2015/plugins/code/code.component.js +2 -2
- package/esm2015/plugins/common/move-selection.plugin.js +48 -3
- package/esm2015/plugins/font-size/font-size.editor.js +11 -14
- package/esm2015/plugins/image/image.component.js +4 -3
- package/esm2015/plugins/inline-code/inline-code.component.js +14 -15
- package/esm2015/plugins/inline-code/inline-code.editor.js +7 -3
- package/esm2015/plugins/inline-code/inline-code.plugin.js +2 -2
- package/esm2015/plugins/link/link.component.js +13 -3
- package/esm2015/utils/is-inline.js +10 -0
- package/fesm2015/worktile-theia.js +110 -40
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/editor.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/font-size/font-size.editor.d.ts +1 -1
- package/plugins/inline-code/inline-code.component.d.ts +2 -7
- package/plugins/inline-code/inline-code.editor.d.ts +2 -2
- package/plugins/link/link.component.d.ts +1 -0
- package/styles/editor.scss +11 -0
- package/utils/is-inline.d.ts +2 -0
|
@@ -2197,8 +2197,12 @@
|
|
|
2197
2197
|
unwrapInlineCode: function (editor) {
|
|
2198
2198
|
slate.Transforms.unwrapNodes(editor, { match: function (n) { return slate.Element.isElement(n) && n.type === exports.ElementKinds.inlineCode; } });
|
|
2199
2199
|
},
|
|
2200
|
-
isInlineCodeActive: function (editor) {
|
|
2201
|
-
var _a
|
|
2200
|
+
isInlineCodeActive: function (editor, path) {
|
|
2201
|
+
var _a;
|
|
2202
|
+
var _b = __read(slate.Editor.nodes(editor, {
|
|
2203
|
+
at: path ? path : (_a = editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path,
|
|
2204
|
+
match: function (n) { return slate.Element.isElement(n) && n.type === exports.ElementKinds.inlineCode; }
|
|
2205
|
+
}), 1), inlineCode = _b[0];
|
|
2202
2206
|
return !!inlineCode;
|
|
2203
2207
|
}
|
|
2204
2208
|
};
|
|
@@ -2829,7 +2833,7 @@
|
|
|
2829
2833
|
height: value.element.height,
|
|
2830
2834
|
thumbUrl: value.element.thumbUrl,
|
|
2831
2835
|
originUrl: value.element.originUrl,
|
|
2832
|
-
align: value.element.align || exports.Alignment.
|
|
2836
|
+
align: value.element.align || exports.Alignment.left
|
|
2833
2837
|
};
|
|
2834
2838
|
}
|
|
2835
2839
|
};
|
|
@@ -2879,6 +2883,7 @@
|
|
|
2879
2883
|
this.imageEntry = {
|
|
2880
2884
|
height: height,
|
|
2881
2885
|
width: width,
|
|
2886
|
+
align: this.imageEntry.align || exports.Alignment.center,
|
|
2882
2887
|
thumbUrl: this.sanitizer.bypassSecurityTrustResourceUrl(URL.createObjectURL(file))
|
|
2883
2888
|
};
|
|
2884
2889
|
this.uploading = true;
|
|
@@ -2995,7 +3000,7 @@
|
|
|
2995
3000
|
return TheImageComponent;
|
|
2996
3001
|
}(TheBaseElementComponent));
|
|
2997
3002
|
TheImageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheImageComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$2.DomSanitizer }, { token: THE_UPLOAD_SERVICE_TOKEN }, { token: i0__namespace.ChangeDetectorRef }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2998
|
-
TheImageComponent.ɵcmp = i0__namespace.ɵɵ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 }], usesInheritance: true, ngImport: i0__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align
|
|
3003
|
+
TheImageComponent.ɵcmp = i0__namespace.ɵɵ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 }], usesInheritance: true, ngImport: i0__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\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]=\"{ width: imageEntry.width + 'px', height: imageEntry.height + 'px' }\"\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", components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i4__namespace.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
2999
3004
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheImageComponent, decorators: [{
|
|
3000
3005
|
type: i0.Component,
|
|
3001
3006
|
args: [{
|
|
@@ -5101,8 +5106,17 @@
|
|
|
5101
5106
|
return editor;
|
|
5102
5107
|
};
|
|
5103
5108
|
|
|
5109
|
+
var isInline = function (editor, path) {
|
|
5110
|
+
var _a;
|
|
5111
|
+
var _b = __read(slate.Editor.nodes(editor, {
|
|
5112
|
+
at: path ? path : (_a = editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path,
|
|
5113
|
+
match: function (n) { return slate.Element.isElement(n) && slate.Editor.isInline(editor, n) && !slate.Editor.isVoid(editor, n); }
|
|
5114
|
+
}), 1), inlineNode = _b[0];
|
|
5115
|
+
return !!inlineNode;
|
|
5116
|
+
};
|
|
5117
|
+
|
|
5104
5118
|
var withMoveSelection = function (editor) {
|
|
5105
|
-
var onClick = editor.onClick, deleteBackward = editor.deleteBackward;
|
|
5119
|
+
var onClick = editor.onClick, deleteBackward = editor.deleteBackward, onKeydown = editor.onKeydown;
|
|
5106
5120
|
editor.onClick = function (event) {
|
|
5107
5121
|
var domSelection = window.getSelection();
|
|
5108
5122
|
if (domSelection && !domSelection.isCollapsed && event.detail >= 2 && editor.selection) {
|
|
@@ -5133,6 +5147,50 @@
|
|
|
5133
5147
|
}
|
|
5134
5148
|
deleteBackward(unit);
|
|
5135
5149
|
};
|
|
5150
|
+
editor.onKeydown = function (event) {
|
|
5151
|
+
var selection = editor.selection;
|
|
5152
|
+
if (!selection || !selection.anchor || !selection.focus) {
|
|
5153
|
+
onKeydown(event);
|
|
5154
|
+
return;
|
|
5155
|
+
}
|
|
5156
|
+
var isMoveBackward = i1.hotkeys.isMoveBackward(event);
|
|
5157
|
+
var isMoveForward = i1.hotkeys.isMoveForward(event);
|
|
5158
|
+
var isCollapsed$1 = selection && isCollapsed(selection);
|
|
5159
|
+
var isInlineNode = isInline(editor);
|
|
5160
|
+
if (isCollapsed$1 && isMoveForward) {
|
|
5161
|
+
var isInlineCodeBefore = false;
|
|
5162
|
+
if (!isInlineNode) {
|
|
5163
|
+
try {
|
|
5164
|
+
var path = slate.Editor.after(editor, selection).path;
|
|
5165
|
+
if (path) {
|
|
5166
|
+
isInlineCodeBefore = isInline(editor, path);
|
|
5167
|
+
}
|
|
5168
|
+
}
|
|
5169
|
+
catch (error) { }
|
|
5170
|
+
}
|
|
5171
|
+
if (isInlineNode || isInlineCodeBefore) {
|
|
5172
|
+
event.preventDefault();
|
|
5173
|
+
slate.Transforms.move(editor, { unit: 'offset' });
|
|
5174
|
+
return;
|
|
5175
|
+
}
|
|
5176
|
+
}
|
|
5177
|
+
if (isCollapsed$1 && isMoveBackward) {
|
|
5178
|
+
var isInlineCodeAfter = false;
|
|
5179
|
+
if (!isInlineNode) {
|
|
5180
|
+
try {
|
|
5181
|
+
var path = slate.Editor.before(editor, selection).path;
|
|
5182
|
+
isInlineCodeAfter = isInline(editor, path);
|
|
5183
|
+
}
|
|
5184
|
+
catch (error) { }
|
|
5185
|
+
}
|
|
5186
|
+
if (isInlineNode || isInlineCodeAfter) {
|
|
5187
|
+
event.preventDefault();
|
|
5188
|
+
slate.Transforms.move(editor, { unit: 'offset', reverse: true });
|
|
5189
|
+
return;
|
|
5190
|
+
}
|
|
5191
|
+
}
|
|
5192
|
+
onKeydown(event);
|
|
5193
|
+
};
|
|
5136
5194
|
return editor;
|
|
5137
5195
|
};
|
|
5138
5196
|
|
|
@@ -6329,7 +6387,7 @@
|
|
|
6329
6387
|
return;
|
|
6330
6388
|
}
|
|
6331
6389
|
var props = {
|
|
6332
|
-
align: alignment
|
|
6390
|
+
align: alignment !== exports.Alignment.left ? alignment : null
|
|
6333
6391
|
};
|
|
6334
6392
|
slate.Transforms.setNodes(editor, props, {
|
|
6335
6393
|
at: editor.selection,
|
|
@@ -7295,7 +7353,7 @@
|
|
|
7295
7353
|
this.options = Object.assign(Object.assign({}, this.options), { lineWrapping: this.element.autoWrap || false });
|
|
7296
7354
|
};
|
|
7297
7355
|
TheCodeComponent.prototype.useHeight = function () {
|
|
7298
|
-
if (this.element.height) {
|
|
7356
|
+
if (this.element.height && this.config.mode !== 'print') {
|
|
7299
7357
|
this.resizeHeight = this.element.height;
|
|
7300
7358
|
this.maxHeight = this.element.height;
|
|
7301
7359
|
}
|
|
@@ -7723,17 +7781,21 @@
|
|
|
7723
7781
|
var TheLinkComponent = /** @class */ (function (_super) {
|
|
7724
7782
|
__extends(TheLinkComponent, _super);
|
|
7725
7783
|
function TheLinkComponent() {
|
|
7726
|
-
|
|
7784
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
7785
|
+
// Put this at the start and end of an inline component to work around this Chromium bug:
|
|
7786
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
|
|
7787
|
+
_this.inlineChromiumBugfix = '$' + String.fromCodePoint(160);
|
|
7788
|
+
return _this;
|
|
7727
7789
|
}
|
|
7728
7790
|
return TheLinkComponent;
|
|
7729
7791
|
}(TheBaseLinkComponent));
|
|
7730
7792
|
TheLinkComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheLinkComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7731
|
-
TheLinkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheLinkComponent, selector: "span[theLink]", usesInheritance: true, ngImport: i0__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
7793
|
+
TheLinkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheLinkComponent, selector: "span[theLink]", usesInheritance: true, ngImport: i0__namespace, template: " <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
7732
7794
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheLinkComponent, decorators: [{
|
|
7733
7795
|
type: i0.Component,
|
|
7734
7796
|
args: [{
|
|
7735
7797
|
selector: 'span[theLink]',
|
|
7736
|
-
template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>"
|
|
7798
|
+
template: " <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>"
|
|
7737
7799
|
}]
|
|
7738
7800
|
}] });
|
|
7739
7801
|
var TheReadonlyLinkComponent = /** @class */ (function (_super) {
|
|
@@ -11977,7 +12039,8 @@
|
|
|
11977
12039
|
return;
|
|
11978
12040
|
}
|
|
11979
12041
|
// unset fontSize
|
|
11980
|
-
if (
|
|
12042
|
+
if (isDefaultFontSize && Number(defaultFontSize) === fontSizeMark) {
|
|
12043
|
+
FontSizeEditor.unsetFontSize(editor, size);
|
|
11981
12044
|
return;
|
|
11982
12045
|
}
|
|
11983
12046
|
FontSizeEditor.setFontSizeMark(editor, size);
|
|
@@ -11990,21 +12053,17 @@
|
|
|
11990
12053
|
// set paragraph text fontSize
|
|
11991
12054
|
slate.Editor.addMark(editor, exports.MarkTypes.fontSize, Number(size));
|
|
11992
12055
|
},
|
|
11993
|
-
unsetFontSize: function (editor, size
|
|
12056
|
+
unsetFontSize: function (editor, size) {
|
|
11994
12057
|
var _a;
|
|
11995
12058
|
var isTable = TableEditor.isActive(editor);
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
return true;
|
|
12000
|
-
}
|
|
12001
|
-
// unset paragraph text fontSize
|
|
12002
|
-
setMarks(editor, (_a = {},
|
|
12003
|
-
_a[exports.MarkTypes.fontSize] = null,
|
|
12004
|
-
_a), editor.selection);
|
|
12005
|
-
return true;
|
|
12059
|
+
// unset Table selectedCells fontSize
|
|
12060
|
+
if (isTable && TableEditor.toggleMark(editor, true, exports.MarkTypes.fontSize, Number(size))) {
|
|
12061
|
+
return;
|
|
12006
12062
|
}
|
|
12007
|
-
|
|
12063
|
+
// unset paragraph text fontSize
|
|
12064
|
+
setMarks(editor, (_a = {},
|
|
12065
|
+
_a[exports.MarkTypes.fontSize] = null,
|
|
12066
|
+
_a), editor.selection);
|
|
12008
12067
|
},
|
|
12009
12068
|
isFontSizeActive: function (editor, size) {
|
|
12010
12069
|
if (editor.selection) {
|
|
@@ -12076,32 +12135,27 @@
|
|
|
12076
12135
|
|
|
12077
12136
|
var TheInlineCodeComponent = /** @class */ (function (_super) {
|
|
12078
12137
|
__extends(TheInlineCodeComponent, _super);
|
|
12079
|
-
function TheInlineCodeComponent(
|
|
12080
|
-
var _this = _super.
|
|
12081
|
-
|
|
12082
|
-
|
|
12138
|
+
function TheInlineCodeComponent() {
|
|
12139
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
12140
|
+
// Put this at the start and end of an inline component to work around this Chromium bug:
|
|
12141
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
|
|
12142
|
+
_this.inlineChromiumBugfix = '$' + String.fromCodePoint(160);
|
|
12083
12143
|
return _this;
|
|
12084
12144
|
}
|
|
12085
|
-
TheInlineCodeComponent.prototype.ngOnInit = function () {
|
|
12086
|
-
_super.prototype.ngOnInit.call(this);
|
|
12087
|
-
};
|
|
12088
|
-
TheInlineCodeComponent.prototype.ngOnDestroy = function () {
|
|
12089
|
-
_super.prototype.ngOnDestroy.call(this);
|
|
12090
|
-
};
|
|
12091
12145
|
return TheInlineCodeComponent;
|
|
12092
12146
|
}(TheBaseElementComponent));
|
|
12093
|
-
TheInlineCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInlineCodeComponent, deps:
|
|
12094
|
-
TheInlineCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", usesInheritance: true, ngImport: i0__namespace, template:
|
|
12147
|
+
TheInlineCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInlineCodeComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12148
|
+
TheInlineCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", usesInheritance: true, ngImport: i0__namespace, template: " <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
12095
12149
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInlineCodeComponent, decorators: [{
|
|
12096
12150
|
type: i0.Component,
|
|
12097
12151
|
args: [{
|
|
12098
12152
|
selector: 'span[theInlineCode]',
|
|
12099
|
-
template:
|
|
12153
|
+
template: " <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>"
|
|
12100
12154
|
}]
|
|
12101
|
-
}]
|
|
12155
|
+
}] });
|
|
12102
12156
|
|
|
12103
12157
|
var withInlineCode = function (editor) {
|
|
12104
|
-
var isInline = editor.isInline, renderElement = editor.renderElement, insertText = editor.insertText;
|
|
12158
|
+
var isInline = editor.isInline, renderElement = editor.renderElement, insertText = editor.insertText, onKeydown = editor.onKeydown;
|
|
12105
12159
|
editor.isInline = function (element) {
|
|
12106
12160
|
return element.type === exports.ElementKinds.inlineCode ? true : isInline(element);
|
|
12107
12161
|
};
|
|
@@ -13066,6 +13120,9 @@
|
|
|
13066
13120
|
});
|
|
13067
13121
|
this.toolbarCalculate();
|
|
13068
13122
|
setTimeout(function () {
|
|
13123
|
+
// You need to wait for the editor rendering to complete
|
|
13124
|
+
// before triggering the external toolbar assignment detection
|
|
13125
|
+
_this.globalToolbarInit();
|
|
13069
13126
|
_this.theEditorCreated.emit(_this.editor);
|
|
13070
13127
|
_this.applyAutoFocus();
|
|
13071
13128
|
});
|
|
@@ -13094,11 +13151,14 @@
|
|
|
13094
13151
|
var 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);
|
|
13095
13152
|
this.globalToolbarClass = ['the-global-toolbar', getToolbarClass(this.editor)];
|
|
13096
13153
|
this.toolbarEntity = toolbarOption.toolbarEntity;
|
|
13154
|
+
};
|
|
13155
|
+
TheEditorComponent.prototype.globalToolbarInit = function () {
|
|
13156
|
+
var _a, _b;
|
|
13097
13157
|
if (this.theGlobalToolbar) {
|
|
13098
13158
|
this.theGlobalToolbarInstance.editor = this.editor;
|
|
13099
|
-
this.theGlobalToolbarInstance.toolbarItems =
|
|
13159
|
+
this.theGlobalToolbarInstance.toolbarItems = this.toolbarEntity.global;
|
|
13100
13160
|
this.theGlobalToolbarInstance.containerClass = this.globalToolbarClass;
|
|
13101
|
-
this.theGlobalToolbarInstance.align =
|
|
13161
|
+
this.theGlobalToolbarInstance.align = (_b = (_a = this === null || this === void 0 ? void 0 : this.theOptions) === null || _a === void 0 ? void 0 : _a.toolbar) === null || _b === void 0 ? void 0 : _b.align;
|
|
13102
13162
|
this.theGlobalToolbarInstance.setToolbarClass();
|
|
13103
13163
|
this.theGlobalToolbarInstance.renderToolbarView();
|
|
13104
13164
|
}
|
|
@@ -13257,7 +13317,7 @@
|
|
|
13257
13317
|
useExisting: i0.forwardRef(function () { return TheEditorComponent; }),
|
|
13258
13318
|
multi: true
|
|
13259
13319
|
}
|
|
13260
|
-
], 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__namespace, 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
|
|
13320
|
+
], 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__namespace, 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__namespace.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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
13261
13321
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheEditorComponent, decorators: [{
|
|
13262
13322
|
type: i0.Component,
|
|
13263
13323
|
args: [{
|