@worktile/theia 20.1.0-next.1 → 20.1.0-next.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/fesm2022/worktile-theia.mjs +30 -46
- package/fesm2022/worktile-theia.mjs.map +1 -1
- package/index.d.ts +0 -3
- package/package.json +2 -2
|
@@ -13327,7 +13327,7 @@ const createBlockCardPlugin = createPluginFactory({
|
|
|
13327
13327
|
});
|
|
13328
13328
|
|
|
13329
13329
|
const withInternalCommon = (editor) => {
|
|
13330
|
-
const { globalMousedown, onKeydown } = editor;
|
|
13330
|
+
const { globalMousedown, onKeydown, selectAll } = editor;
|
|
13331
13331
|
editor.globalMousedown = (event) => {
|
|
13332
13332
|
const target = event.target;
|
|
13333
13333
|
if (isColorIndicator(target)) {
|
|
@@ -13350,6 +13350,34 @@ const withInternalCommon = (editor) => {
|
|
|
13350
13350
|
}
|
|
13351
13351
|
onKeydown(event);
|
|
13352
13352
|
};
|
|
13353
|
+
editor.selectAll = () => {
|
|
13354
|
+
let node = null;
|
|
13355
|
+
if (!editor.selection) {
|
|
13356
|
+
setEndSelection(editor);
|
|
13357
|
+
}
|
|
13358
|
+
const [start, end] = Range.edges(editor.selection);
|
|
13359
|
+
const selectionRange = Editor.range(editor, start, end);
|
|
13360
|
+
const containerBlocks = getContainerBlocks(editor);
|
|
13361
|
+
for (let i = 0; i < containerBlocks.length; i++) {
|
|
13362
|
+
[node] = getNodesByType(editor, containerBlocks[i]);
|
|
13363
|
+
if (node) {
|
|
13364
|
+
const [, path] = node;
|
|
13365
|
+
const isStartParent = Path.equals(path, start.path.slice(0, path.length));
|
|
13366
|
+
const isEndParent = Path.equals(path, end.path.slice(0, path.length));
|
|
13367
|
+
if (isStartParent && isEndParent) {
|
|
13368
|
+
const nodeRange = Editor.range(editor, path);
|
|
13369
|
+
if (!Range.equals(nodeRange, selectionRange)) {
|
|
13370
|
+
Transforms.select(editor, nodeRange);
|
|
13371
|
+
break;
|
|
13372
|
+
}
|
|
13373
|
+
node = null;
|
|
13374
|
+
}
|
|
13375
|
+
}
|
|
13376
|
+
}
|
|
13377
|
+
if (!node) {
|
|
13378
|
+
Transforms.select(editor, []);
|
|
13379
|
+
}
|
|
13380
|
+
};
|
|
13353
13381
|
return editor;
|
|
13354
13382
|
};
|
|
13355
13383
|
const createCommonPlugin = (locale) => createPluginFactory({
|
|
@@ -14273,7 +14301,6 @@ class TheImage extends TheBaseElement {
|
|
|
14273
14301
|
}
|
|
14274
14302
|
];
|
|
14275
14303
|
this.dragable = false;
|
|
14276
|
-
this.resolveImageHeight = null;
|
|
14277
14304
|
this.beforeContextChange = (value) => {
|
|
14278
14305
|
if (value.element !== this.element && value.element.thumbUrl) {
|
|
14279
14306
|
let thumbUrl = value.element.thumbUrl;
|
|
@@ -14571,11 +14598,6 @@ class TheImage extends TheBaseElement {
|
|
|
14571
14598
|
const img = event.target;
|
|
14572
14599
|
this.naturalWidth = img.naturalWidth;
|
|
14573
14600
|
this.naturalHeight = img.naturalHeight;
|
|
14574
|
-
setTimeout(() => {
|
|
14575
|
-
const blockCard = getBlockCardByNativeElement(this.nativeElement);
|
|
14576
|
-
const style = getComputedStyle(blockCard);
|
|
14577
|
-
this.resolveImageHeight?.(blockCard.offsetHeight + parseFloat(style.marginTop) + parseFloat(style.marginBottom));
|
|
14578
|
-
}, 0);
|
|
14579
14601
|
}
|
|
14580
14602
|
imageError(event) {
|
|
14581
14603
|
const img = event.target;
|
|
@@ -14622,11 +14644,6 @@ class TheImage extends TheBaseElement {
|
|
|
14622
14644
|
});
|
|
14623
14645
|
}
|
|
14624
14646
|
}
|
|
14625
|
-
getRealHeight() {
|
|
14626
|
-
return new Promise(resolve => {
|
|
14627
|
-
this.resolveImageHeight = resolve;
|
|
14628
|
-
});
|
|
14629
|
-
}
|
|
14630
14647
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TheImage, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.ThyImageGroup }, { token: THE_IMAGE_SERVICE_TOKEN }, { token: TheContextService }, { token: i1.ThyPopover }, { token: i2.Overlay }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14631
14648
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: TheImage, isStandalone: true, selector: "the-image, [theImage]", providers: [ThyImageService], viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }, { propertyName: "imageDirective", first: true, predicate: ThyImageDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"the-image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n @if (imageEntry.thumbUrl) {\n <div #imageContent class=\"image-content\" contenteditable=\"false\" [class.cursor-pointer]=\"!selection\">\n <img\n #img\n thyImage\n class=\"main-image\"\n [class.image-collapsed]=\"selection && !uploading\"\n [ngStyle]=\"{ 'width.px': imageBindingWidth }\"\n [alt]=\"imageEntry.name\"\n [thySrc]=\"imageEntry.thumbUrl\"\n [thyPreviewSrc]=\"imageEntry.thumbUrl\"\n [thyOriginSrc]=\"imageEntry.originUrl\"\n [thyDisablePreview]=\"disablePreview\"\n [thyImageMeta]=\"{ name: imageEntry.name, size: imageEntry.size }\"\n (load)=\"imageLoaded($event)\"\n (mousedown)=\"preventDefault($event)\"\n (error)=\"imageError($event)\"\n (click)=\"imageClick($event)\"\n />\n @if (isCollapsedAndNonReadonly) {\n <div class=\"image-profile\" [class.outline]=\"selection\">\n @if (!loadImageError) {\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n }\n </div>\n }\n <ng-template [ngTemplateOutlet]=\"imageUploading\"></ng-template>\n @if (!uploading) {\n <div class=\"layer\" [class.readonly]=\"readonly\"></div>\n }\n </div>\n } @else {\n @if (!imageEntry.thumbUrl) {\n <div class=\"image-loading cursor-pointer\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n }\n <ng-template [ngTemplateOutlet]=\"imageUploading\"></ng-template>\n }\n</div>\n\n<ng-template #layoutToolbar>\n <thy-actions thySize=\"xxs\">\n @for (item of layoutOptions; track $index) {\n @if (item.key !== 'split') {\n <a\n href=\"javascript:;\"\n thyAction\n [thyType]=\"item.key === 'remove' ? 'danger' : 'primary'\"\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"layoutActive(item.key)\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n }\n @if (item.key === 'split') {\n <thy-divider class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\" thyColor=\"light\"></thy-divider>\n }\n }\n </thy-actions>\n</ng-template>\n\n<ng-template #imageUploading>\n @if (uploading) {\n <div 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 }\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: ThyImageDirective, selector: "img[thyImage]", inputs: ["thySrc", "thyPreviewSrc", "thyOriginSrc", "thyImageMeta", "thyDisablePreview", "thyResolveSize"], exportAs: ["thyImage"] }, { kind: "component", type: ThyAction, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: ThyDivider, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "component", type: ThyActions, selector: "thy-actions", inputs: ["thySize"] }, { kind: "directive", type: ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: ThyProgress, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips", "thyShape", "thyGapDegree", "thyGapPosition", "thyStrokeWidth"] }] }); }
|
|
14632
14649
|
}
|
|
@@ -18261,9 +18278,6 @@ class TheEditorComponent {
|
|
|
18261
18278
|
event.preventDefault();
|
|
18262
18279
|
return;
|
|
18263
18280
|
}
|
|
18264
|
-
if (isKeyHotkey('mod+a', event) && !event.defaultPrevented) {
|
|
18265
|
-
this.handleSelectAll(event);
|
|
18266
|
-
}
|
|
18267
18281
|
};
|
|
18268
18282
|
this.onClick = (event) => {
|
|
18269
18283
|
AngularEditor.onClick(this.editor, event);
|
|
@@ -18361,7 +18375,7 @@ class TheEditorComponent {
|
|
|
18361
18375
|
return;
|
|
18362
18376
|
}
|
|
18363
18377
|
const { scrollTop, clientHeight } = this.scrollContainerElement;
|
|
18364
|
-
if (localStorage.getItem(SLATE_DEBUG_KEY)) {
|
|
18378
|
+
if (localStorage.getItem(SLATE_DEBUG_KEY + '__SCROLL_TOP')) {
|
|
18365
18379
|
console.log(`theia: scroll event fired from user: ${scrollTop}`);
|
|
18366
18380
|
}
|
|
18367
18381
|
this.virtualConfig.update(config => ({
|
|
@@ -18569,36 +18583,6 @@ class TheEditorComponent {
|
|
|
18569
18583
|
mousedown(event) {
|
|
18570
18584
|
this.editor.mousedown(event);
|
|
18571
18585
|
}
|
|
18572
|
-
handleSelectAll(event) {
|
|
18573
|
-
let node = null;
|
|
18574
|
-
if (!this.editor.selection) {
|
|
18575
|
-
setEndSelection(this.editor);
|
|
18576
|
-
}
|
|
18577
|
-
const [start, end] = Range.edges(this.editor.selection);
|
|
18578
|
-
const selectionRange = Editor.range(this.editor, start, end);
|
|
18579
|
-
const containerBlocks = getContainerBlocks(this.editor);
|
|
18580
|
-
for (let i = 0; i < containerBlocks.length; i++) {
|
|
18581
|
-
[node] = getNodesByType(this.editor, containerBlocks[i]);
|
|
18582
|
-
if (node) {
|
|
18583
|
-
const [, path] = node;
|
|
18584
|
-
const isStartParent = Path.equals(path, start.path.slice(0, path.length));
|
|
18585
|
-
const isEndParent = Path.equals(path, end.path.slice(0, path.length));
|
|
18586
|
-
if (isStartParent && isEndParent) {
|
|
18587
|
-
const nodeRange = Editor.range(this.editor, path);
|
|
18588
|
-
if (!Range.equals(nodeRange, selectionRange)) {
|
|
18589
|
-
Transforms.select(this.editor, nodeRange);
|
|
18590
|
-
break;
|
|
18591
|
-
}
|
|
18592
|
-
node = null;
|
|
18593
|
-
}
|
|
18594
|
-
}
|
|
18595
|
-
}
|
|
18596
|
-
if (!node) {
|
|
18597
|
-
Transforms.select(this.editor, []);
|
|
18598
|
-
}
|
|
18599
|
-
event.preventDefault();
|
|
18600
|
-
return;
|
|
18601
|
-
}
|
|
18602
18586
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TheEditorComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.DestroyRef }, { token: i0.ElementRef }, { token: i0.Injector }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: TheContextService }, { token: i2$5.ThyIconRegistry }, { token: THE_PRESET_CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
18603
18587
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: TheEditorComponent, isStandalone: true, selector: "the-editor, theEditor", inputs: { theOptions: "theOptions", thePlugins: "thePlugins", theGlobalToolbar: "theGlobalToolbar", theDecorate: "theDecorate", theOnError: "theOnError" }, outputs: { theOnSave: "theOnSave", theOnDOMEvent: "theOnDOMEvent", theEditorCreated: "theEditorCreated", theUploadingStatus: "theUploadingStatus" }, host: { properties: { "class.the-editor-readonly": "editor.options?.readonly", "class.the-mobile-editor": "isMobileMode" }, classAttribute: "the-editor" }, providers: [
|
|
18604
18588
|
TheContextService,
|