@worktile/theia 14.3.12 → 14.3.14
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/esm2020/plugins/indent/indent.editor.mjs +4 -3
- package/esm2020/plugins/indent/on-keydown-indent.mjs +3 -2
- package/esm2020/plugins/table/components/table.component.mjs +95 -66
- package/esm2020/plugins/table/components/toolbar/table-options.component.mjs +3 -6
- package/esm2020/plugins/table/table.editor.mjs +9 -31
- package/esm2020/plugins/table/table.store.mjs +22 -37
- package/esm2020/plugins/table/utils/handle-cell.mjs +19 -1
- package/esm2020/plugins/table/utils/set-menu-cell-invisibility.mjs +3 -3
- package/esm2020/services/context.service.mjs +3 -2
- package/esm2020/services/table-contextmenu.service.mjs +3 -3
- package/fesm2015/worktile-theia.mjs +5717 -5743
- package/fesm2015/worktile-theia.mjs.map +1 -1
- package/fesm2020/worktile-theia.mjs +5703 -5731
- package/fesm2020/worktile-theia.mjs.map +1 -1
- package/package.json +1 -1
- package/plugins/indent/indent.editor.d.ts +1 -1
- package/plugins/table/components/table.component.d.ts +10 -5
- package/plugins/table/components/table.component.scss +18 -16
- package/plugins/table/table.editor.d.ts +2 -3
- package/plugins/table/table.store.d.ts +4 -4
- package/plugins/table/utils/handle-cell.d.ts +4 -0
- package/esm2020/utils/os-name.mjs +0 -33
- package/utils/os-name.d.ts +0 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { Editor, Element } from 'slate';
|
|
|
2
2
|
import { TheEditor } from '../../interfaces';
|
|
3
3
|
import { CustomElementKinds } from '../../custom-types';
|
|
4
4
|
export declare const IndentEditor: {
|
|
5
|
-
getAllowedTypes(editor: TheEditor): (import("
|
|
5
|
+
getAllowedTypes(editor: TheEditor): (import("../../constants").ElementKinds.image | import("../../constants").ElementKinds.paragraph | import("../../constants").ElementKinds.heading_1 | import("../../constants").ElementKinds.heading_2 | import("../../constants").ElementKinds.heading_3 | import("../../constants").ElementKinds.heading_4 | import("../../constants").ElementKinds.heading_5 | import("../../constants").ElementKinds.heading_6 | import("../../constants").ElementKinds.numberedList | import("../../constants").ElementKinds.bulletedList | import("../../constants").ElementKinds.listItem | import("../../constants").ElementKinds.checkItem | import("../../constants").ElementKinds.table | import("../../constants").ElementKinds.tableRow | import("../../constants").ElementKinds.tableCell | import("../../constants").ElementKinds.code | import("../../constants").ElementKinds.blockquote | import("../../constants").ElementKinds.hr | import("../../constants").ElementKinds.link | import("../../constants").ElementKinds.inlineCode)[];
|
|
6
6
|
setIndent(editor: TheEditor): void;
|
|
7
7
|
cancelIndent(editor: Editor): void;
|
|
8
8
|
setTextIndent(editor: TheEditor, kinds: CustomElementKinds[], textIndent: number): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnInit, ElementRef, OnDestroy, ChangeDetectorRef, NgZone, AfterViewInit, Renderer2, QueryList } from '@angular/core';
|
|
2
|
-
import { Subject
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
3
|
import { Editor } from 'slate';
|
|
4
4
|
import { TheBaseElementComponent, ThePluginOption } from '../../../interfaces';
|
|
5
5
|
import { TableCellElement, TableElement } from '../../../custom-types';
|
|
@@ -9,6 +9,7 @@ import { TableStore } from '../table.store';
|
|
|
9
9
|
import { TableService } from '../table.service';
|
|
10
10
|
import { ThePluginTableOption, TheTableColumn } from '../table.types';
|
|
11
11
|
import { TableFreezeColumnPipe, TableFreezeRowPipe } from '../table.pipe';
|
|
12
|
+
import { TheContextService } from '../../../services/context.service';
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
13
14
|
export declare class TheTableComponent extends TheBaseElementComponent<TableElement, Editor> implements OnInit, AfterViewInit, OnDestroy {
|
|
14
15
|
eventDispatcher: TableCellEventDispatcher;
|
|
@@ -21,7 +22,9 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
|
|
|
21
22
|
private freezeColumnPipe;
|
|
22
23
|
freezeRowPipe: TableFreezeRowPipe;
|
|
23
24
|
private renderer;
|
|
25
|
+
private contextService;
|
|
24
26
|
headerRow: boolean;
|
|
27
|
+
isSelectedAllCell: boolean;
|
|
25
28
|
destroy$: Subject<any>;
|
|
26
29
|
rowControls: {
|
|
27
30
|
height: number;
|
|
@@ -32,11 +35,11 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
|
|
|
32
35
|
tablePluginOptions: ThePluginOption<ThePluginTableOption>;
|
|
33
36
|
isStickyTop: boolean;
|
|
34
37
|
scrollContainerTop: number;
|
|
35
|
-
|
|
38
|
+
tableWrapperMarginTop: number;
|
|
39
|
+
previousScrollContainer: string;
|
|
36
40
|
get columns(): TheTableColumn[];
|
|
37
41
|
get nativeElement(): HTMLElement;
|
|
38
42
|
get tbodyNativeElement(): HTMLElement;
|
|
39
|
-
get isSelectedAllCell(): boolean;
|
|
40
43
|
tableWrapper: ElementRef<HTMLElement>;
|
|
41
44
|
theTableElement: ElementRef;
|
|
42
45
|
tbodyElement: ElementRef;
|
|
@@ -45,7 +48,7 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
|
|
|
45
48
|
rowControlsButtonWrapper: QueryList<ElementRef<HTMLElement>>;
|
|
46
49
|
handleMousedown(event: MouseEvent): void;
|
|
47
50
|
onContextChange(): void;
|
|
48
|
-
constructor(elementRef: ElementRef<HTMLElement>, eventDispatcher: TableCellEventDispatcher, resizeNotifier: ColumnResizeNotifierSource, tableStore: TableStore, cdr: ChangeDetectorRef, ngZone: NgZone, tableService: TableService, theTableContextMenuService: TheTableContextMenuService, freezeColumnPipe: TableFreezeColumnPipe, freezeRowPipe: TableFreezeRowPipe, renderer: Renderer2);
|
|
51
|
+
constructor(elementRef: ElementRef<HTMLElement>, eventDispatcher: TableCellEventDispatcher, resizeNotifier: ColumnResizeNotifierSource, tableStore: TableStore, cdr: ChangeDetectorRef, ngZone: NgZone, tableService: TableService, theTableContextMenuService: TheTableContextMenuService, freezeColumnPipe: TableFreezeColumnPipe, freezeRowPipe: TableFreezeRowPipe, renderer: Renderer2, contextService: TheContextService);
|
|
49
52
|
ngOnInit(): void;
|
|
50
53
|
getWrapperWidth(): number;
|
|
51
54
|
/**
|
|
@@ -90,8 +93,10 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
|
|
|
90
93
|
onRowMousedown(event: MouseEvent, index: number): void;
|
|
91
94
|
onSelectTable(event: MouseEvent): void;
|
|
92
95
|
listenTableContextMenuEvent(): void;
|
|
93
|
-
|
|
96
|
+
listenOnSelectedCells(): void;
|
|
94
97
|
listenKeydownSelectEvents(): void;
|
|
98
|
+
listenTableWrapperScroll(): void;
|
|
99
|
+
updateStickyRowScrollLeft(): void;
|
|
95
100
|
trackByFnRowControls(index: number): number;
|
|
96
101
|
trackByFnColControls(index: number): number;
|
|
97
102
|
ngOnDestroy(): void;
|
|
@@ -78,7 +78,7 @@ $top-cell-z-index: 13;
|
|
|
78
78
|
&.dangerous-cell {
|
|
79
79
|
&::after {
|
|
80
80
|
@include mixins.cellInset;
|
|
81
|
-
z-index:
|
|
81
|
+
z-index: 10;
|
|
82
82
|
border: 1px solid variables.$danger;
|
|
83
83
|
background: rgba($color: variables.$danger, $alpha: 0.1);
|
|
84
84
|
}
|
|
@@ -127,19 +127,6 @@ $top-cell-z-index: 13;
|
|
|
127
127
|
@include mixins.tableLeftShadow;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
&.the-numberd-table {
|
|
131
|
-
&.the-table-left-shadow {
|
|
132
|
-
&::before {
|
|
133
|
-
left: 44px;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.the-table-wrapper {
|
|
138
|
-
margin-left: -44px;
|
|
139
|
-
padding-left: 44px;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
130
|
.the-table-wrapper {
|
|
144
131
|
padding-top: 10px;
|
|
145
132
|
margin-top: -10px;
|
|
@@ -166,7 +153,7 @@ $top-cell-z-index: 13;
|
|
|
166
153
|
grid-auto-flow: column;
|
|
167
154
|
box-sizing: content-box;
|
|
168
155
|
background: variables.$white;
|
|
169
|
-
border-bottom: $controls-border;
|
|
156
|
+
// border-bottom: $controls-border;
|
|
170
157
|
overflow-x: hidden;
|
|
171
158
|
box-shadow: 0 6px 4px -4px rgba(0, 0, 0, 0.1);
|
|
172
159
|
|
|
@@ -229,6 +216,21 @@ $top-cell-z-index: 13;
|
|
|
229
216
|
|
|
230
217
|
}
|
|
231
218
|
|
|
219
|
+
.the-numberd-table {
|
|
220
|
+
.the-table-container {
|
|
221
|
+
&.the-table-left-shadow {
|
|
222
|
+
&::before {
|
|
223
|
+
left: 44px;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.the-table-wrapper {
|
|
229
|
+
margin-left: -44px;
|
|
230
|
+
padding-left: 44px;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
232
234
|
.the-table-with-controls {
|
|
233
235
|
.the-table {
|
|
234
236
|
margin-top: 13px;
|
|
@@ -377,7 +379,7 @@ $top-cell-z-index: 13;
|
|
|
377
379
|
&.the-table-with-sticky-row {
|
|
378
380
|
.slate-element-table-row.the-sticky-row {
|
|
379
381
|
z-index: 115;
|
|
380
|
-
padding-top:
|
|
382
|
+
padding-top: 0;
|
|
381
383
|
}
|
|
382
384
|
.the-table-row-controls-inner {
|
|
383
385
|
.the-table-row-controls-button-wrap {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Editor, NodeEntry, Path, Range, Node } from 'slate';
|
|
2
2
|
import { TableOptions } from './table.types';
|
|
3
|
-
import { Alignment, VerticalAlignment } from '../../constants';
|
|
3
|
+
import { Alignment, Indents, VerticalAlignment } from '../../constants';
|
|
4
4
|
import { TheEditor } from '../../interfaces';
|
|
5
5
|
import { CustomElement, TableElement } from '../../custom-types';
|
|
6
6
|
export declare const TableEditor: {
|
|
@@ -24,6 +24,5 @@ export declare const TableEditor: {
|
|
|
24
24
|
hasHeaderRowCell(editor: TheEditor): NodeEntry<Node>;
|
|
25
25
|
hasHeaderColumnCell(editor: TheEditor): boolean;
|
|
26
26
|
selectOriginCell(editor: TheEditor, table: TableElement, rowIndex: number, columnIndex: number, isStart: boolean): void;
|
|
27
|
-
|
|
28
|
-
cancelIndent(editor: TheEditor): boolean;
|
|
27
|
+
handleIndent(editor: TheEditor, indentType: Indents): boolean;
|
|
29
28
|
};
|
|
@@ -30,6 +30,7 @@ export declare class TableStore {
|
|
|
30
30
|
get selectedCells(): CellPosition[];
|
|
31
31
|
get dangerousCells(): CellPosition[];
|
|
32
32
|
constructor();
|
|
33
|
+
isSelectedAllCell: () => boolean;
|
|
33
34
|
getTableEntry(): import("slate").NodeEntry<TableElement>;
|
|
34
35
|
getTablePath(): import("slate").Path;
|
|
35
36
|
setSelectedCells(cells: CellPosition[], pos: TablePosition): void;
|
|
@@ -74,11 +75,10 @@ export declare class TableStore {
|
|
|
74
75
|
getSelectedCellBackgroundColor(): string;
|
|
75
76
|
clearSelectedCellsContent(): void;
|
|
76
77
|
mergeCell(editor: Editor): void;
|
|
77
|
-
setTableOptions(editor: Editor,
|
|
78
|
-
|
|
79
|
-
removeDangerousRows(): void;
|
|
78
|
+
setTableOptions(editor: Editor, newOptions: TheTableOptions): void;
|
|
79
|
+
removeDangerousColumnsOrRows(): void;
|
|
80
80
|
createTablePosition(): TablePosition;
|
|
81
|
-
removeColumnOrRows(): void;
|
|
81
|
+
removeColumnOrRows(selectedRowIndexs?: number[], selectedColumnIndexs?: number[]): void;
|
|
82
82
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableStore, never>;
|
|
83
83
|
static ɵprov: i0.ɵɵInjectableDeclaration<TableStore>;
|
|
84
84
|
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { CellPosition } from '../table.types';
|
|
2
|
+
import { Editor, Path } from 'slate';
|
|
3
|
+
import { Indents } from '../../../constants';
|
|
4
|
+
import { CustomElement } from '../../../custom-types';
|
|
2
5
|
export declare function sortCell(cells: CellPosition[]): void;
|
|
6
|
+
export declare function setCellIndent(editor: Editor, indentType: Indents, child: CustomElement, at: Path): void;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export const getOsName = () => {
|
|
2
|
-
const userAgent = navigator.userAgent.toLowerCase();
|
|
3
|
-
let name = 'Unknown';
|
|
4
|
-
if (userAgent.indexOf('win') > -1) {
|
|
5
|
-
name = 'Windows';
|
|
6
|
-
}
|
|
7
|
-
else if (userAgent.indexOf('iphone') > -1) {
|
|
8
|
-
name = 'Iphone';
|
|
9
|
-
}
|
|
10
|
-
else if (userAgent.indexOf('mac') > -1) {
|
|
11
|
-
name = 'Mac';
|
|
12
|
-
}
|
|
13
|
-
else if (userAgent.indexOf('x11') > -1 ||
|
|
14
|
-
userAgent.indexOf('unix') > -1 ||
|
|
15
|
-
userAgent.indexOf('sunname') > -1 ||
|
|
16
|
-
userAgent.indexOf('bsd') > -1) {
|
|
17
|
-
name = 'Unix';
|
|
18
|
-
}
|
|
19
|
-
else if (userAgent.indexOf('linux') > -1) {
|
|
20
|
-
if (userAgent.indexOf('android') > -1) {
|
|
21
|
-
name = 'Android';
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
name = 'Linux';
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
name = 'Unknown';
|
|
29
|
-
}
|
|
30
|
-
return name;
|
|
31
|
-
};
|
|
32
|
-
export const isMac = () => getOsName() === 'Mac';
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3MtbmFtZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3NyYy91dGlscy9vcy1uYW1lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxNQUFNLFNBQVMsR0FBRyxHQUFHLEVBQUU7SUFDMUIsTUFBTSxTQUFTLEdBQUcsU0FBUyxDQUF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PSAnQW5kcm9pZCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBuYW1lID0gJ0xpbnV4JztcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIG5hbWUgPSAnVW5rbm93bic7XG4gICAgfVxuICAgIHJldHVybiBuYW1lO1xufTtcblxuZXhwb3J0IGNvbnN0IGlzTWFjID0gKCkgPT4gZ2V0T3NOYW1lKCkgPT09ICdNYWMnO1xuIl19
|
package/utils/os-name.d.ts
DELETED