@worktile/theia 14.1.1 → 14.1.3
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/editor.component.d.ts +1 -0
- package/esm2020/core/utils/combine-plugins.mjs +2 -2
- package/esm2020/editor.component.mjs +11 -5
- package/esm2020/interfaces/editor.mjs +1 -1
- package/esm2020/interfaces/plugins/plugins.mjs +1 -1
- package/esm2020/plugins/mention/mention.editor.mjs +4 -7
- package/esm2020/plugins/quick-insert/quick-insert.plugin.mjs +1 -1
- package/fesm2015/worktile-theia.mjs +11 -8
- package/fesm2015/worktile-theia.mjs.map +1 -1
- package/fesm2020/worktile-theia.mjs +11 -8
- package/fesm2020/worktile-theia.mjs.map +1 -1
- package/interfaces/editor.d.ts +0 -1
- package/interfaces/plugins/plugins.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/quick-insert/quick-insert.plugin.d.ts +1 -0
|
@@ -1434,7 +1434,7 @@ const mergeOptions = (plugin, override) => {
|
|
|
1434
1434
|
const combinePlugins = (editor) => {
|
|
1435
1435
|
// withOverrides
|
|
1436
1436
|
editor.plugins.forEach((plugin) => {
|
|
1437
|
-
if (plugin.withOverrides) {
|
|
1437
|
+
if (plugin.withOverrides && !plugin.options.disabled) {
|
|
1438
1438
|
editor = plugin.withOverrides(editor, plugin);
|
|
1439
1439
|
}
|
|
1440
1440
|
});
|
|
@@ -8653,7 +8653,6 @@ const MentionEditor = {
|
|
|
8653
8653
|
const mentions = getPluginOptions(editor, PluginKeys.mention)?.mentions;
|
|
8654
8654
|
const currentMention = mentions.find(m => m.type === type);
|
|
8655
8655
|
const suggestionComponent = currentMention?.suggestion;
|
|
8656
|
-
const isParagraphStart = Editor.isStart(editor, selection?.anchor, anchorBlockEntry(editor)[1]);
|
|
8657
8656
|
const popoverRef = thyPopover.open(suggestionComponent, {
|
|
8658
8657
|
origin,
|
|
8659
8658
|
initialState: {
|
|
@@ -8672,9 +8671,7 @@ const MentionEditor = {
|
|
|
8672
8671
|
popoverRef?.afterClosed().subscribe(() => {
|
|
8673
8672
|
MentionEditor.close(editor);
|
|
8674
8673
|
});
|
|
8675
|
-
|
|
8676
|
-
popoverRef?.getOverlayRef().updatePositionStrategy(MentionEditor.createPositionStrategy(editor));
|
|
8677
|
-
}
|
|
8674
|
+
popoverRef?.getOverlayRef().updatePositionStrategy(MentionEditor.createPositionStrategy(editor));
|
|
8678
8675
|
THE_EDITOR_POPOVER_REF.set(editor, popoverRef);
|
|
8679
8676
|
cdr.markForCheck();
|
|
8680
8677
|
},
|
|
@@ -8707,7 +8704,7 @@ const MentionEditor = {
|
|
|
8707
8704
|
return !!match;
|
|
8708
8705
|
},
|
|
8709
8706
|
createPositionStrategy(editor) {
|
|
8710
|
-
const textElement = AngularEditor.toDOMNode(editor,
|
|
8707
|
+
const textElement = AngularEditor.toDOMNode(editor, anchorBlockEntry(editor)[0]);
|
|
8711
8708
|
const nativeRange = AngularEditor.toDOMRange(editor, editor.selection);
|
|
8712
8709
|
const rectCursor = nativeRange.getBoundingClientRect();
|
|
8713
8710
|
const rectTextElement = textElement.getBoundingClientRect();
|
|
@@ -13356,6 +13353,7 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
13356
13353
|
this.elementRef = elementRef;
|
|
13357
13354
|
this.ngZone = ngZone;
|
|
13358
13355
|
this.cdr = cdr;
|
|
13356
|
+
this.visibleQuickInsertPlus = true;
|
|
13359
13357
|
this.thePlugins = [];
|
|
13360
13358
|
this.theOnSave = new EventEmitter();
|
|
13361
13359
|
this.theOnDOMEvent = new EventEmitter();
|
|
@@ -13525,6 +13523,11 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
13525
13523
|
this.theEditorCreated.emit(this.editor);
|
|
13526
13524
|
this.applyAutoFocus();
|
|
13527
13525
|
});
|
|
13526
|
+
const quickInsertPlugin = getPluginOptions(this.editor, PluginKeys.quickInsert);
|
|
13527
|
+
// quickInsert
|
|
13528
|
+
if (quickInsertPlugin.disabled || quickInsertPlugin.disabledPlus) {
|
|
13529
|
+
this.visibleQuickInsertPlus = false;
|
|
13530
|
+
}
|
|
13528
13531
|
}
|
|
13529
13532
|
initializeOptions() {
|
|
13530
13533
|
if (!this.theOptions) {
|
|
@@ -13707,7 +13710,7 @@ TheEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ver
|
|
|
13707
13710
|
useExisting: forwardRef(() => TheEditorComponent),
|
|
13708
13711
|
multi: true
|
|
13709
13712
|
}
|
|
13710
|
-
], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n thyImageGroup\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?.inlineToolbarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div
|
|
13713
|
+
], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n thyImageGroup\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?.inlineToolbarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\" [isVisible]=\"visibleQuickInsertPlus\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", 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"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$1.ThyImageGroupComponent, selector: "thy-image-group, [thyImageGroup]" }, { kind: "component", type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { kind: "component", type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { kind: "component", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems", "isVisible"] }, { kind: "component", type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
13711
13714
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TheEditorComponent, decorators: [{
|
|
13712
13715
|
type: Component,
|
|
13713
13716
|
args: [{ selector: 'the-editor, theEditor', providers: [
|
|
@@ -13721,7 +13724,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
13721
13724
|
], host: {
|
|
13722
13725
|
class: 'the-editor',
|
|
13723
13726
|
'[class.the-editor-readonly]': 'theOptions?.readonly'
|
|
13724
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, 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 thyImageGroup\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?.inlineToolbarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div
|
|
13727
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, 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 thyImageGroup\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?.inlineToolbarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\" [isVisible]=\"visibleQuickInsertPlus\"></div>\n <the-template #templateInstance></the-template>\n</div>\n" }]
|
|
13725
13728
|
}], ctorParameters: function () { return [{ type: TheContextService }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { theOptions: [{
|
|
13726
13729
|
type: Input
|
|
13727
13730
|
}], thePlugins: [{
|