@worktile/theia 2.4.3 → 2.4.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 +50 -24
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/editor.module.d.ts +2 -1
- package/esm2015/editor.component.js +2 -1
- package/esm2015/interfaces/editor.js +1 -1
- package/esm2015/plugins/quick-insert/quick-insert.editor.js +4 -3
- package/esm2015/plugins/quick-insert/quick-insert.plugin.js +23 -6
- package/esm2015/plugins/table/components/insert-mark/insert-mark.component.js +4 -4
- package/esm2015/plugins/table/components/table.component.js +2 -2
- package/esm2015/plugins/table/components/td/td.component.js +5 -7
- package/esm2015/plugins/table/table.service.js +6 -6
- package/esm2015/plugins/todo-item/todo-item.component.js +15 -7
- package/esm2015/utils/is-clean-empty-paragraph.js +4 -1
- package/fesm2015/worktile-theia.js +50 -25
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/editor.d.ts +4 -1
- package/package.json +1 -1
- package/plugins/quick-insert/quick-insert.plugin.d.ts +2 -0
- package/plugins/table/components/table.component.scss +43 -42
- package/plugins/todo-item/todo-item.component.d.ts +3 -1
- package/utils/is-clean-empty-paragraph.d.ts +2 -1
|
@@ -1772,6 +1772,9 @@ const isCleanEmptyParagraph = (editor) => {
|
|
|
1772
1772
|
return false;
|
|
1773
1773
|
}
|
|
1774
1774
|
const block = Node.ancestor(editor, [editor.selection.anchor.path[0]]);
|
|
1775
|
+
return isPureEmptyParagraph(editor, block);
|
|
1776
|
+
};
|
|
1777
|
+
const isPureEmptyParagraph = (editor, block) => {
|
|
1775
1778
|
const textIndent = 'textIndent';
|
|
1776
1779
|
const align = 'align';
|
|
1777
1780
|
const hasTextIndent = block[textIndent];
|
|
@@ -3567,10 +3570,11 @@ const withList = ({ validLiChildrenTypes } = {}) => (editor) => {
|
|
|
3567
3570
|
};
|
|
3568
3571
|
|
|
3569
3572
|
class TheTodoItemComponent extends TheBaseElementComponent {
|
|
3570
|
-
constructor(elementRef, cdr) {
|
|
3573
|
+
constructor(elementRef, cdr, ctxService) {
|
|
3571
3574
|
super(elementRef, cdr);
|
|
3572
3575
|
this.elementRef = elementRef;
|
|
3573
3576
|
this.cdr = cdr;
|
|
3577
|
+
this.ctxService = ctxService;
|
|
3574
3578
|
this.checkItemClass = true;
|
|
3575
3579
|
}
|
|
3576
3580
|
get level() {
|
|
@@ -3581,13 +3585,18 @@ class TheTodoItemComponent extends TheBaseElementComponent {
|
|
|
3581
3585
|
super.ngOnInit();
|
|
3582
3586
|
}
|
|
3583
3587
|
onCheck(checked) {
|
|
3584
|
-
|
|
3588
|
+
const options = this.ctxService.getTheOptions();
|
|
3589
|
+
const noBindReadonly = options.noBindReadonlyPlugins && options.noBindReadonlyPlugins.includes(ElementKinds.checkItem);
|
|
3590
|
+
if (!noBindReadonly && this.readonly) {
|
|
3585
3591
|
return false;
|
|
3586
3592
|
}
|
|
3593
|
+
else {
|
|
3594
|
+
setNode(this.editor, { checked }, this.element);
|
|
3595
|
+
}
|
|
3587
3596
|
setNode(this.editor, { checked }, this.element);
|
|
3588
3597
|
}
|
|
3589
3598
|
}
|
|
3590
|
-
TheTodoItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheTodoItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3599
|
+
TheTodoItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheTodoItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: TheContextService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3591
3600
|
TheTodoItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTodoItemComponent, selector: "div[theTodoItem]", host: { properties: { "class.the-check-item": "this.checkItemClass", "attr.the-level": "this.level" } }, usesInheritance: true, ngImport: i0, template: `
|
|
3592
3601
|
<span contenteditable="false" class="todo-item-status">
|
|
3593
3602
|
<input #checkbox type="checkbox" [checked]="element.checked" (click)="onCheck(checkbox.checked)" />
|
|
@@ -3605,7 +3614,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
3605
3614
|
<span><slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children></span>
|
|
3606
3615
|
`
|
|
3607
3616
|
}]
|
|
3608
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { checkItemClass: [{
|
|
3617
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: TheContextService }]; }, propDecorators: { checkItemClass: [{
|
|
3609
3618
|
type: HostBinding,
|
|
3610
3619
|
args: ['class.the-check-item']
|
|
3611
3620
|
}], level: [{
|
|
@@ -8735,7 +8744,7 @@ class TableService {
|
|
|
8735
8744
|
offset: this.offset,
|
|
8736
8745
|
hasBackdrop: this.hasBackdrop,
|
|
8737
8746
|
insideClosable: this.insideClosable,
|
|
8738
|
-
panelClass: 'the-table-toolbar-wrap',
|
|
8747
|
+
panelClass: 'the-temp-table-toolbar-wrap',
|
|
8739
8748
|
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
8740
8749
|
manualClosure: true
|
|
8741
8750
|
});
|
|
@@ -8745,15 +8754,15 @@ class TableService {
|
|
|
8745
8754
|
if (origin instanceof HTMLTableCellElement && origin.tagName !== 'TH') {
|
|
8746
8755
|
const { selectedRowsIndex, selectedColumnsIndex, focusCellPath, isSelectedTable, focusCellElement } = this.tableStore;
|
|
8747
8756
|
const [row, col] = focusCellPath.slice(-2);
|
|
8748
|
-
const tableElement = focusCellElement.closest('.the-table-container');
|
|
8757
|
+
const tableElement = focusCellElement.closest('.the-temp-table-container');
|
|
8749
8758
|
if (isSelectedTable && col === 0 && row === 0) {
|
|
8750
|
-
return tableElement.querySelector('.the-table-corner-controls');
|
|
8759
|
+
return tableElement.querySelector('.the-temp-table-corner-controls');
|
|
8751
8760
|
}
|
|
8752
8761
|
if (selectedColumnsIndex.length > 0 && row === 0) {
|
|
8753
|
-
return tableElement.querySelectorAll('.the-table-col-controls')[col];
|
|
8762
|
+
return tableElement.querySelectorAll('.the-temp-table-col-controls')[col];
|
|
8754
8763
|
}
|
|
8755
8764
|
if (selectedRowsIndex.length > 0 && col === 0) {
|
|
8756
|
-
return tableElement.querySelectorAll('.the-table-row-controls-button-wrap')[row];
|
|
8765
|
+
return tableElement.querySelectorAll('.the-temp-table-row-controls-button-wrap')[row];
|
|
8757
8766
|
}
|
|
8758
8767
|
}
|
|
8759
8768
|
return origin;
|
|
@@ -8854,13 +8863,13 @@ class TheInsertMarkComponent {
|
|
|
8854
8863
|
const tableWrapper = tableComponent.tableWrapper.nativeElement;
|
|
8855
8864
|
const tableElement = tableComponent.theTableElement.nativeElement;
|
|
8856
8865
|
let result = 0;
|
|
8857
|
-
const rowControl = tableComponent.nativeElement.querySelector('.the-table-row-controls');
|
|
8866
|
+
const rowControl = tableComponent.nativeElement.querySelector('.the-temp-table-row-controls');
|
|
8858
8867
|
let rowControlWidth = 11;
|
|
8859
8868
|
if (rowControl) {
|
|
8860
8869
|
rowControlWidth = rowControl.getBoundingClientRect().width;
|
|
8861
8870
|
}
|
|
8862
8871
|
if (this.type === 'row') {
|
|
8863
|
-
result = tableWrapper.offsetWidth + rowControlWidth;
|
|
8872
|
+
result = tableWrapper.offsetWidth + rowControlWidth - 2;
|
|
8864
8873
|
}
|
|
8865
8874
|
else {
|
|
8866
8875
|
result = tableElement.offsetHeight - 1;
|
|
@@ -8871,7 +8880,7 @@ class TheInsertMarkComponent {
|
|
|
8871
8880
|
ngOnDestroy() { }
|
|
8872
8881
|
}
|
|
8873
8882
|
TheInsertMarkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheInsertMarkComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
8874
|
-
TheInsertMarkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: { type: "type", at: "at", tableStore: "tableStore" }, ngImport: i0, template: "<div\n [thyTooltip]=\"!disabled && tooltipContent\"\n class=\"the-table-controls-insert-wrapper\"\n [ngClass]=\"{ disabled: disabled }\"\n contenteditable=\"false\"\n (mousedown)=\"onMouseDown($event)\"\n (mouseenter)=\"onMouseEnter($event)\"\n (mouseleave)=\"onMouseLeave($event)\"\n>\n <div\n class=\"the-table-controls-insert-line\"\n *ngIf=\"dotWrapperHovered\"\n [attr.data-dot-type]=\"type\"\n [ngStyle]=\"{ height: type === 'column' && insertLength, width: type === 'row' && insertLength }\"\n ></div>\n</div>\n", directives: [{ type: i5.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
8883
|
+
TheInsertMarkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: { type: "type", at: "at", tableStore: "tableStore" }, ngImport: i0, template: "<div\n [thyTooltip]=\"!disabled && tooltipContent\"\n class=\"the-temp-table-controls-insert-wrapper\"\n [ngClass]=\"{ disabled: disabled }\"\n contenteditable=\"false\"\n (mousedown)=\"onMouseDown($event)\"\n (mouseenter)=\"onMouseEnter($event)\"\n (mouseleave)=\"onMouseLeave($event)\"\n>\n <div\n class=\"the-temp-table-controls-insert-line\"\n *ngIf=\"dotWrapperHovered\"\n [attr.data-dot-type]=\"type\"\n [ngStyle]=\"{ height: type === 'column' && insertLength, width: type === 'row' && insertLength }\"\n ></div>\n</div>\n", directives: [{ type: i5.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
8875
8884
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheInsertMarkComponent, decorators: [{
|
|
8876
8885
|
type: Component,
|
|
8877
8886
|
args: [{
|
|
@@ -9350,7 +9359,7 @@ TheTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
|
|
|
9350
9359
|
provide: TheTableToken,
|
|
9351
9360
|
useExisting: TheTableComponent
|
|
9352
9361
|
}
|
|
9353
|
-
], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"the-table-container\"\n theColumnResize\n [ngClass]=\"{\n 'the-table-with-controls': isInTable,\n 'the-numbered-column-container': element?.options?.numberedColumn,\n 'the-table-selection-hide': tableStore.isCellSelecting || tableStore.isRightClicking\n }\"\n>\n <div\n class=\"the-table-row-controls-wrapper\"\n [ngClass]=\"{\n 'the-table-focus': isInTable\n }\"\n >\n <div\n class=\"the-table-corner-controls\"\n [ngClass]=\"{\n visible: !readonly && isInTable,\n active: isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\">\n <div\n class=\"the-table-row-controls-button-wrap\"\n *ngFor=\"let control of rowControls; let i = index; trackBy: trackByFnRowCotrols\"\n [ngClass]=\"{\n active: tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n <ng-container *ngIf=\"!readonly && isInTable && !element?.options?.numberedColumn\">\n <button\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n type=\"button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"element?.options?.numberedColumn\">\n <div\n [contentEditable]=\"false\"\n contenteditable=\"false\"\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">{{ i + 1 }}</p>\n </div>\n </ng-container>\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n </div>\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable [ngClass]=\"{ 'the-table-with-controls': isInTable }\">\n <colgroup *ngIf=\"columns\">\n <col *ngFor=\"let col of columns\" [ngStyle]=\"{ width: col.width + 'px' }\" />\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper\">\n <th\n class=\"the-table-col-controls\"\n [ngClass]=\"{\n active: tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n (mousedown)=\"onColMouseDown($event, i)\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColCotrols\"\n >\n <the-table-insert-mark *ngIf=\"isInTable\" type=\"column\" [at]=\"i + 1\" [tableStore]=\"tableStore\">\n </the-table-insert-mark>\n </th>\n </tr>\n </thead>\n <tbody #tbody>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"> </slate-children>\n </tbody>\n </table>\n </div>\n</div>\n", components: [{ type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: ["type", "at", "tableStore"] }, { type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }], directives: [{ type: TheColumnResizeDirective, selector: "div[theColumnResize]" }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
9362
|
+
], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<!-- \u7C7B\u540D the-temp-*: \u4E34\u65F6\u89E3\u51B3\u56E0\u53D7portal\u5F71\u54CD\u8868\u683C\u6837\u5F0F\u95EE\u9898\uFF0C\u540E\u671F\u6539\u56DEthe-* -->\n<div\n class=\"the-temp-table-container\"\n theColumnResize\n [ngClass]=\"{\n 'the-temp-table-with-controls': isInTable,\n 'the-temp-numbered-column-container': element?.options?.numberedColumn,\n 'the-temp-table-selection-hide': tableStore.isCellSelecting || tableStore.isRightClicking\n }\"\n>\n <div\n class=\"the-temp-table-row-controls-wrapper\"\n [ngClass]=\"{\n 'the-temp-table-focus': isInTable\n }\"\n >\n <div\n class=\"the-temp-table-corner-controls\"\n [ngClass]=\"{\n visible: !readonly && isInTable,\n active: isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-temp-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-temp-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-temp-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-temp-table-row-controls\">\n <div class=\"the-temp-table-row-controls-inner\">\n <div\n class=\"the-temp-table-row-controls-button-wrap\"\n *ngFor=\"let control of rowControls; let i = index; trackBy: trackByFnRowCotrols\"\n [ngClass]=\"{\n active: tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n <ng-container *ngIf=\"!readonly && isInTable && !element?.options?.numberedColumn\">\n <button\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n type=\"button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-temp-table-row-controls-button the-temp-table-controls-button\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"element?.options?.numberedColumn\">\n <div\n [contentEditable]=\"false\"\n contenteditable=\"false\"\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n class=\"the-temp-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">{{ i + 1 }}</p>\n </div>\n </ng-container>\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n </div>\n </div>\n </div>\n </div>\n <div class=\"the-temp-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-temp-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-temp-table\" #theTable [ngClass]=\"{ 'the-temp-table-with-controls': isInTable }\">\n <colgroup *ngIf=\"columns\">\n <col *ngFor=\"let col of columns\" [ngStyle]=\"{ width: col.width + 'px' }\" />\n </colgroup>\n <thead>\n <tr class=\"the-temp-table-col-controls-wrapper\">\n <th\n class=\"the-temp-table-col-controls\"\n [ngClass]=\"{\n active: tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n (mousedown)=\"onColMouseDown($event, i)\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColCotrols\"\n >\n <the-table-insert-mark *ngIf=\"isInTable\" type=\"column\" [at]=\"i + 1\" [tableStore]=\"tableStore\">\n </the-table-insert-mark>\n </th>\n </tr>\n </thead>\n <tbody #tbody>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"> </slate-children>\n </tbody>\n </table>\n </div>\n</div>\n", components: [{ type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: ["type", "at", "tableStore"] }, { type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }], directives: [{ type: TheColumnResizeDirective, selector: "div[theColumnResize]" }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
9354
9363
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheTableComponent, decorators: [{
|
|
9355
9364
|
type: Component,
|
|
9356
9365
|
args: [{
|
|
@@ -10207,12 +10216,12 @@ class TheTdComponent extends TheBaseElementComponent {
|
|
|
10207
10216
|
}
|
|
10208
10217
|
updateOverlayHandleRowSize() {
|
|
10209
10218
|
const tableElement = this.tableComponent.nativeElement;
|
|
10210
|
-
const rowControl = tableElement.querySelector('.the-table-row-controls');
|
|
10219
|
+
const rowControl = tableElement.querySelector('.the-temp-table-row-controls');
|
|
10211
10220
|
let rowControlWidth = 11;
|
|
10212
10221
|
if (rowControl) {
|
|
10213
10222
|
rowControlWidth = rowControl.getBoundingClientRect().width;
|
|
10214
10223
|
}
|
|
10215
|
-
const width = this.tableComponent.tableWrapper.nativeElement.offsetWidth + rowControlWidth;
|
|
10224
|
+
const width = this.tableComponent.tableWrapper.nativeElement.offsetWidth + rowControlWidth - 2;
|
|
10216
10225
|
this.overlayRef.addPanelClass(this.rowResizeClass);
|
|
10217
10226
|
this.overlayRef.updateSize({ width, height: OVERLAY_INIT_SIZE });
|
|
10218
10227
|
}
|
|
@@ -10404,8 +10413,7 @@ class TheTdComponent extends TheBaseElementComponent {
|
|
|
10404
10413
|
applyTopRows(rows, deltaY, rowIndex) {
|
|
10405
10414
|
while (deltaY < 0 && rows[rowIndex]) {
|
|
10406
10415
|
const rowOffsetHeight = getElementHeight(rows[rowIndex]);
|
|
10407
|
-
|
|
10408
|
-
if (rowOffsetHeight > this.tableOptions.minHeightPx && rowOffsetHeight === rowStyleHeight) {
|
|
10416
|
+
if (rowOffsetHeight > this.tableOptions.minHeightPx) {
|
|
10409
10417
|
if (this.resizingStore.isResizing(deltaY, this.isXAxisHover)) {
|
|
10410
10418
|
this.resizingStore.storeResizingRow(rows[rowIndex]);
|
|
10411
10419
|
}
|
|
@@ -10425,8 +10433,7 @@ class TheTdComponent extends TheBaseElementComponent {
|
|
|
10425
10433
|
applyBottomRows(rows, deltaY, rowIndex) {
|
|
10426
10434
|
while (rows[rowIndex] && deltaY > 0) {
|
|
10427
10435
|
const rowOffsetHeight = getElementHeight(rows[rowIndex]);
|
|
10428
|
-
|
|
10429
|
-
if (rowOffsetHeight > this.tableOptions.minHeightPx && rowOffsetHeight === rowStyleHeight) {
|
|
10436
|
+
if (rowOffsetHeight > this.tableOptions.minHeightPx) {
|
|
10430
10437
|
if (this.resizingStore.isResizing(deltaY, this.isXAxisHover)) {
|
|
10431
10438
|
this.resizingStore.storeResizingRow(rows[rowIndex]);
|
|
10432
10439
|
}
|
|
@@ -11376,7 +11383,8 @@ const QuickInsertEditor = {
|
|
|
11376
11383
|
return;
|
|
11377
11384
|
}
|
|
11378
11385
|
if (!origin) {
|
|
11379
|
-
const
|
|
11386
|
+
const [block,] = getBlockAbove(editor);
|
|
11387
|
+
const rootNode = AngularEditor.toDOMNode(editor, block);
|
|
11380
11388
|
origin = rootNode.querySelector('[data-slate-leaf="true"]');
|
|
11381
11389
|
}
|
|
11382
11390
|
const overlay = editor.injector.get(Overlay);
|
|
@@ -11418,8 +11426,13 @@ const withQuickInsert = (editor) => {
|
|
|
11418
11426
|
const { onKeydown, deleteBackward, onChange } = editor;
|
|
11419
11427
|
let presseingQuickInsertHotkey = false;
|
|
11420
11428
|
editor.onKeydown = (event) => {
|
|
11421
|
-
|
|
11422
|
-
|
|
11429
|
+
var _a;
|
|
11430
|
+
if (event.key === QUICK_TOOLBAR_HOTKEY) {
|
|
11431
|
+
const types = [...(((_a = editor.options) === null || _a === void 0 ? void 0 : _a.triggerQuickToolbarTypes) || [])];
|
|
11432
|
+
const [block,] = getBlockAbove(editor);
|
|
11433
|
+
if (isPureEmptyParagraph(editor, block) && allowOpenQuickToolbar(editor, types)) {
|
|
11434
|
+
presseingQuickInsertHotkey = true;
|
|
11435
|
+
}
|
|
11423
11436
|
}
|
|
11424
11437
|
onKeydown(event);
|
|
11425
11438
|
};
|
|
@@ -11433,7 +11446,7 @@ const withQuickInsert = (editor) => {
|
|
|
11433
11446
|
var _a;
|
|
11434
11447
|
onChange();
|
|
11435
11448
|
if (editor.selection) {
|
|
11436
|
-
const block =
|
|
11449
|
+
const [block, path] = getBlockAbove(editor);
|
|
11437
11450
|
// quick insert plus
|
|
11438
11451
|
const editorComponent = editor.injector.get(TheEditorComponent);
|
|
11439
11452
|
(_a = editorComponent.quickInsertInstance) === null || _a === void 0 ? void 0 : _a.checkStatus();
|
|
@@ -11442,13 +11455,24 @@ const withQuickInsert = (editor) => {
|
|
|
11442
11455
|
presseingQuickInsertHotkey = false;
|
|
11443
11456
|
return;
|
|
11444
11457
|
}
|
|
11445
|
-
|
|
11458
|
+
else {
|
|
11459
|
+
presseingQuickInsertHotkey = false;
|
|
11460
|
+
}
|
|
11461
|
+
if (QuickInsertEditor.isOpenedToolbar(editor) && !isPureEmptyParagraph(editor, block) && Node.string(block) !== QUICK_TOOLBAR_HOTKEY) {
|
|
11446
11462
|
QuickInsertEditor.closeQuickInsertToolbar(editor);
|
|
11447
11463
|
}
|
|
11448
11464
|
}
|
|
11449
11465
|
};
|
|
11450
11466
|
return editor;
|
|
11451
11467
|
};
|
|
11468
|
+
const allowOpenQuickToolbar = (editor, allowTypes) => {
|
|
11469
|
+
const [block, path] = getBlockAbove(editor);
|
|
11470
|
+
const parentNode = Node.parent(editor, path);
|
|
11471
|
+
if (path.length === 1 || (parentNode && allowTypes.includes(parentNode.type))) {
|
|
11472
|
+
return true;
|
|
11473
|
+
}
|
|
11474
|
+
return false;
|
|
11475
|
+
};
|
|
11452
11476
|
|
|
11453
11477
|
const withSoftBreak = (options = { rules: [{ hotkey: 'shift+enter' }] }) => (editor) => {
|
|
11454
11478
|
const { onKeydown } = editor;
|
|
@@ -12821,6 +12845,7 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
12821
12845
|
this.editor.extraElementOptions = (_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.extraElementOptions;
|
|
12822
12846
|
this.editor.extraAutoFormatRules = (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.extraAutoFormatRules;
|
|
12823
12847
|
this.editor.extraIndentOptions = (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.extraIndentOptions;
|
|
12848
|
+
this.editor.options = this.theOptions;
|
|
12824
12849
|
setEditorUUID(this.editor, idCreator());
|
|
12825
12850
|
this.theContextService.initialize({
|
|
12826
12851
|
theOptions: this.theOptions,
|
|
@@ -13365,5 +13390,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
13365
13390
|
* Generated bundle index. Do not edit.
|
|
13366
13391
|
*/
|
|
13367
13392
|
|
|
13368
|
-
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, Indents, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LayoutTypes, 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, ZERO_WIDTH_CHAR, coercePixelsFromCssValue, createEmptyParagraph, dataDeserialize, dataSerializing, getColsTotalWidth, getElementClassByPrefix, getElementHeight, getElementWidth, getRowsTotalHeight, getToolbarClass, htmlToTheia, inValidTypes, isCleanEmptyParagraph, mergeElementOptions, plainToTheia, toolbarCompose, useElementStyle, withTheEditor };
|
|
13393
|
+
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, Indents, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LayoutTypes, 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, ZERO_WIDTH_CHAR, coercePixelsFromCssValue, createEmptyParagraph, dataDeserialize, dataSerializing, getColsTotalWidth, getElementClassByPrefix, getElementHeight, getElementWidth, getRowsTotalHeight, getToolbarClass, htmlToTheia, inValidTypes, isCleanEmptyParagraph, isPureEmptyParagraph, mergeElementOptions, plainToTheia, toolbarCompose, useElementStyle, withTheEditor };
|
|
13369
13394
|
//# sourceMappingURL=worktile-theia.js.map
|