@worktile/theia 15.1.6 → 15.1.8

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.
Files changed (76) hide show
  1. package/esm2020/components/action/prevent-default.mjs +3 -3
  2. package/esm2020/components/column-resize/column-resize-notifier.mjs +3 -3
  3. package/esm2020/components/column-resize/column-resize.directive.mjs +3 -3
  4. package/esm2020/components/column-resize/column-resize.module.mjs +8 -8
  5. package/esm2020/components/column-resize/event-dispatcher.mjs +3 -3
  6. package/esm2020/components/column-resize/overlay-handle.component.mjs +3 -3
  7. package/esm2020/components/column-resize/resizing.store.mjs +3 -3
  8. package/esm2020/components/contextmenu/contextmenu.component.mjs +3 -3
  9. package/esm2020/components/conversion-hint/conversion-hint.component.mjs +3 -3
  10. package/esm2020/components/element/element.component.mjs +3 -3
  11. package/esm2020/components/inline-toolbar/inline-toolbar.component.mjs +3 -3
  12. package/esm2020/components/listbox/listbox.mjs +9 -9
  13. package/esm2020/components/plugin-menu/plugin-menu.component.mjs +3 -3
  14. package/esm2020/components/table-select/table-select.component.mjs +3 -3
  15. package/esm2020/components/template/template.component.mjs +3 -3
  16. package/esm2020/components/text/text.component.mjs +3 -3
  17. package/esm2020/components/toolbar/toolbar.component.mjs +3 -3
  18. package/esm2020/components/toolbar-dropdown/toolbar-dropdown.component.mjs +3 -3
  19. package/esm2020/components/toolbar-group/toolbar-group.component.mjs +3 -3
  20. package/esm2020/components/toolbar-item/toolbar-item.component.mjs +3 -3
  21. package/esm2020/core/toolbar-item/base-toolbar-item.mjs +6 -6
  22. package/esm2020/editor.component.mjs +3 -3
  23. package/esm2020/editor.module.mjs +4 -4
  24. package/esm2020/interfaces/image.mjs +1 -1
  25. package/esm2020/interfaces/view-base.mjs +3 -3
  26. package/esm2020/pipes.mjs +6 -6
  27. package/esm2020/plugins/blockquote/blockquote.component.mjs +3 -3
  28. package/esm2020/plugins/code/code.component.mjs +3 -3
  29. package/esm2020/plugins/color/toolbar-item.component.mjs +3 -3
  30. package/esm2020/plugins/common/common.plugin.mjs +1 -1
  31. package/esm2020/plugins/hr/hr.component.mjs +3 -3
  32. package/esm2020/plugins/image/image.component.mjs +10 -6
  33. package/esm2020/plugins/inline-code/inline-code.component.mjs +3 -3
  34. package/esm2020/plugins/link/edit/link-edit.component.mjs +3 -3
  35. package/esm2020/plugins/link/hover/link-hover.component.mjs +3 -3
  36. package/esm2020/plugins/link/link.component.mjs +6 -6
  37. package/esm2020/plugins/list/components/bulleted-list.component.mjs +3 -3
  38. package/esm2020/plugins/list/components/list-item.component.mjs +3 -3
  39. package/esm2020/plugins/list/components/numbered-list.component.mjs +3 -3
  40. package/esm2020/plugins/mention/suggestion.component.mjs +3 -3
  41. package/esm2020/plugins/quick-insert/components/quick-insert.component.mjs +3 -3
  42. package/esm2020/plugins/table/components/insert-mark/insert-mark.component.mjs +3 -3
  43. package/esm2020/plugins/table/components/row/row.component.mjs +27 -6
  44. package/esm2020/plugins/table/components/table.component.mjs +41 -59
  45. package/esm2020/plugins/table/components/td/td.component.mjs +3 -3
  46. package/esm2020/plugins/table/components/toolbar/table-options.component.mjs +3 -3
  47. package/esm2020/plugins/table/components/toolbar/table-toolbar.component.mjs +5 -5
  48. package/esm2020/plugins/table/table.editor.mjs +11 -10
  49. package/esm2020/plugins/table/table.pipe.mjs +6 -6
  50. package/esm2020/plugins/table/table.service.mjs +3 -3
  51. package/esm2020/plugins/table/table.store.mjs +10 -9
  52. package/esm2020/plugins/table/table.types.mjs +2 -2
  53. package/esm2020/plugins/table/toolbar-item.component.mjs +3 -3
  54. package/esm2020/plugins/table/utils/get-grid-columns.mjs +58 -4
  55. package/esm2020/plugins/table/utils/is-header-row.mjs +14 -0
  56. package/esm2020/plugins/table/utils/set-cells-background-color.mjs +14 -14
  57. package/esm2020/plugins/todo-item/todo-item.component.mjs +3 -3
  58. package/esm2020/plugins/vertical-align/toolbar-item.component.mjs +3 -3
  59. package/esm2020/services/context.service.mjs +3 -3
  60. package/esm2020/services/table-contextmenu.service.mjs +3 -3
  61. package/esm2020/services/toolbar.service.mjs +3 -3
  62. package/fesm2015/worktile-theia.mjs +345 -273
  63. package/fesm2015/worktile-theia.mjs.map +1 -1
  64. package/fesm2020/worktile-theia.mjs +340 -270
  65. package/fesm2020/worktile-theia.mjs.map +1 -1
  66. package/interfaces/image.d.ts +1 -0
  67. package/package.json +1 -1
  68. package/plugins/image/image.component.d.ts +1 -0
  69. package/plugins/table/components/row/row.component.d.ts +4 -0
  70. package/plugins/table/components/table.component.d.ts +2 -11
  71. package/plugins/table/components/table.component.scss +42 -6
  72. package/plugins/table/table.editor.d.ts +4 -4
  73. package/plugins/table/table.store.d.ts +1 -0
  74. package/plugins/table/table.types.d.ts +1 -1
  75. package/plugins/table/utils/get-grid-columns.d.ts +14 -0
  76. package/plugins/table/utils/is-header-row.d.ts +6 -0
@@ -29,4 +29,5 @@ export declare const THE_UPLOAD_SERVICE_TOKEN: InjectionToken<TheImageUploaderSe
29
29
  export interface ImagePluginOptions {
30
30
  allowParentTypes?: CustomElementKinds[];
31
31
  imageTypes?: string[];
32
+ disablePreview?: boolean;
32
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/theia",
3
- "version": "15.1.6",
3
+ "version": "15.1.8",
4
4
  "description": "theia editor",
5
5
  "author": "YanDong <nanianqiumo@foxmail.com>",
6
6
  "homepage": "https://github.com/atinc/theia#readme",
@@ -29,6 +29,7 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
29
29
  file: File;
30
30
  };
31
31
  layoutDefaultWidth: number;
32
+ disablePreview: boolean;
32
33
  layoutOptions: LayoutOption[];
33
34
  private uploadingSubscription;
34
35
  private mouseMoveSubscription;
@@ -1,16 +1,20 @@
1
1
  import { ChangeDetectorRef, ElementRef, OnInit, Renderer2 } from '@angular/core';
2
2
  import { TableRowElement } from '../../../../custom-types';
3
3
  import { TheBaseElementComponent } from '../../../../interfaces/view-base';
4
+ import { TablePosition } from '../../utils';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class TheTableRowComponent extends TheBaseElementComponent<TableRowElement> implements OnInit {
6
7
  elementRef: ElementRef<HTMLElement>;
7
8
  cdr: ChangeDetectorRef;
8
9
  private renderer;
9
10
  height: string;
11
+ numberedColumn: boolean;
12
+ rowNumber: number | string;
10
13
  constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, renderer: Renderer2);
11
14
  onContextChange(): void;
12
15
  ngOnInit(): void;
13
16
  useHeight(): void;
17
+ setNumberColumn(ps: TablePosition, rowIndex: number): void;
14
18
  static ɵfac: i0.ɵɵFactoryDeclaration<TheTableRowComponent, never>;
15
19
  static ɵcmp: i0.ɵɵComponentDeclaration<TheTableRowComponent, "tr[theTableRow]", never, {}, {}, never, never, false, never>;
16
20
  }
@@ -41,8 +41,7 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
41
41
  isRightShadow: boolean;
42
42
  isLeftShadow: boolean;
43
43
  previousScrollContainer: string;
44
- printColumns: TheTableColumn[];
45
- get columns(): TheTableColumn[];
44
+ columns: TheTableColumn[];
46
45
  get nativeElement(): HTMLElement;
47
46
  get tbodyNativeElement(): HTMLElement;
48
47
  tableWrapper: ElementRef<HTMLElement>;
@@ -60,17 +59,9 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
60
59
  onContextChange(): void;
61
60
  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, config: TheModeConfig);
62
61
  ngOnInit(): void;
63
- /**
64
- * 打印模式下,按照原宽度比例基于当前表格宽度计算列宽
65
- */
66
- calcPrintColumnsWidth(): void;
67
62
  getWrapperWidth(): number;
68
- /**
69
- * compatible with old data
70
- * @returns
71
- */
72
- getHeaderRow(): boolean;
73
63
  ngAfterViewInit(): void;
64
+ getColumnGroups(): void;
74
65
  setHeaderRowShadow(): void;
75
66
  calcHeaderRowShadow(): {
76
67
  height: any;
@@ -214,7 +214,7 @@ $top-cell-z-index: 13;
214
214
  .the-table-row-controls {
215
215
  top: 1px;
216
216
  }
217
- &.the-numberd-table {
217
+ &.the-numbered-table {
218
218
  .the-table-row-controls {
219
219
  top: 1px;
220
220
  left: 1px;
@@ -224,7 +224,7 @@ $top-cell-z-index: 13;
224
224
  width: 44px;
225
225
  }
226
226
  }
227
- &.the-table-with-controls.the-numberd-table {
227
+ &.the-table-with-controls.the-numbered-table {
228
228
  .the-table-row-controls-wrapper {
229
229
  .the-table-corner-controls {
230
230
  width: 74px; // width + insert-mask: 55px + 19px
@@ -287,7 +287,7 @@ $top-cell-z-index: 13;
287
287
  }
288
288
  }
289
289
 
290
- .the-numberd-table:not(.the-table-with-sticky-column) {
290
+ .the-numbered-table:not(.the-table-with-sticky-column) {
291
291
  .the-table-container {
292
292
  &.the-table-left-shadow {
293
293
  &::before {
@@ -447,7 +447,7 @@ $top-cell-z-index: 13;
447
447
  }
448
448
  }
449
449
 
450
- &.the-numberd-table {
450
+ &.the-numbered-table {
451
451
  .the-table-wrapper {
452
452
  margin-left: -55px;
453
453
  padding-left: 55px;
@@ -475,7 +475,7 @@ $top-cell-z-index: 13;
475
475
  }
476
476
  }
477
477
  }
478
- &.the-numberd-table {
478
+ &.the-numbered-table {
479
479
  .the-table-row-controls {
480
480
  left: 0;
481
481
  }
@@ -689,7 +689,7 @@ $top-cell-z-index: 13;
689
689
  }
690
690
  }
691
691
 
692
- .the-numberd-table {
692
+ .the-numbered-table {
693
693
  .the-table-container {
694
694
  padding-left: 44px;
695
695
  }
@@ -735,3 +735,39 @@ $top-cell-z-index: 13;
735
735
  }
736
736
  }
737
737
  }
738
+
739
+ /* table readonly mode */
740
+ .the-editor-readonly {
741
+ .slate-element-table {
742
+ .the-table-row-controls-wrapper {
743
+ display: none;
744
+ }
745
+ .the-table-container {
746
+ padding-left: 0;
747
+ }
748
+ .the-numbered-table:not(.the-table-with-sticky-column) .the-table-wrapper {
749
+ padding-left: 0;
750
+ }
751
+ .the-table-number-col {
752
+ position: sticky;
753
+ left: 0;
754
+ width: 45px;
755
+ }
756
+ .the-table-number-column {
757
+ position: sticky !important;
758
+ left: 0;
759
+ z-index: $top-cell-z-index;
760
+ background-color: variables.$gray-100;
761
+ text-align: center;
762
+ }
763
+ // 存在序列号、标题列时,正确设置标题列 sticky left
764
+ .the-table-numbered .the-sticky-cell {
765
+ left: 45px;
766
+ z-index: $top-cell-z-index;
767
+ }
768
+ // 滑动时阴影偏移到序号列 td 上
769
+ &:not(.the-table-with-sticky-column) .the-table-container.the-table-left-shadow::before {
770
+ left: 45px;
771
+ }
772
+ }
773
+ }
@@ -1,4 +1,4 @@
1
- import { Editor, NodeEntry, Path, Range } from 'slate';
1
+ import { Editor, NodeEntry, Path, Range, Location } from 'slate';
2
2
  import { TableOptions } from './table.types';
3
3
  import { Alignment, Indents, VerticalAlignment } from '../../constants';
4
4
  import { TheEditor } from '../../interfaces';
@@ -22,9 +22,9 @@ export declare const TableEditor: {
22
22
  toggleMark(editor: TheEditor, isActive: boolean, format: string | string[], value?: string | number | boolean): boolean;
23
23
  clearMark(editor: TheEditor): boolean;
24
24
  handleSelectedCells(editor: TheEditor, handle: (cellPath: Path, cellRange: Range) => void): boolean;
25
- hasHeaderRow(editor: TheEditor): boolean;
26
- hasHeaderColumn(editor: TheEditor): boolean;
27
- isActiveHeader(editor: TheEditor): boolean;
25
+ hasHeaderRow(editor: TheEditor, location?: Location): boolean;
26
+ hasHeaderColumn(editor: TheEditor, location?: Location): boolean;
27
+ isActiveHeader(editor: TheEditor, location?: Location): boolean;
28
28
  hasHeaderRowCell(editor: TheEditor): boolean;
29
29
  hasHeaderColumnCell(editor: TheEditor): boolean;
30
30
  selectOriginCell(editor: TheEditor, table: TableElement, rowIndex: number, columnIndex: number, isStart: boolean): void;
@@ -25,6 +25,7 @@ export declare class TableStore {
25
25
  isPrepareSelecting: boolean;
26
26
  isCellSelecting: boolean;
27
27
  isRightClicking: boolean;
28
+ isFocusedInput: boolean;
28
29
  pointerSelection: boolean;
29
30
  maxCol: number;
30
31
  get dangerousCells(): CellPosition[];
@@ -26,7 +26,7 @@ export declare const TABLE_INSERT_MASK = 19;
26
26
  export declare const TABLE_BORDER = 1;
27
27
  export declare const TABLE_PADDING = 8;
28
28
  export declare const TABLE_CONTROL = 11;
29
- export declare const TABLE_NUMBER_COLUMN = 44;
29
+ export declare const TABLE_NUMBER_COLUMN = 45;
30
30
  export declare const TableWithStickyRowClass = "the-table-with-sticky-row";
31
31
  export interface TheTableColumn {
32
32
  width: number;
@@ -1,3 +1,4 @@
1
+ import { TableElement } from '../../../custom-types';
1
2
  /**
2
3
  * 获取标题行网格列宽值
3
4
  * @param editor
@@ -7,3 +8,16 @@
7
8
  */
8
9
  export declare const getGridColumns: (headerRow: HTMLElement, cellsWidth: number[]) => string;
9
10
  export declare const getColumnsWidth: (cellRow: HTMLElement, isColgroup?: boolean) => any[];
11
+ /**
12
+ * 计算表格列宽
13
+ * 1. 编辑模式下,返回原始列宽
14
+ * 2. 预览模式下,返回基于当前表格宽度计算的列宽
15
+ * a. 打印模式下,按照原宽度比例基于当前表格宽度计算列宽
16
+ * b. 非打印模式下计算
17
+ * @param isReadonly
18
+ * @param element
19
+ * @param tableWidth
20
+ * @param mode
21
+ * @returns number[]
22
+ */
23
+ export declare const calcColumnGroups: (isReadonly: boolean, element: TableElement, tableWidth: number, mode: string) => import("../table.types").TheTableColumn[];
@@ -0,0 +1,6 @@
1
+ import { TableElement } from '../../../custom-types';
2
+ /**
3
+ * compatible with old data
4
+ * @returns
5
+ */
6
+ export declare function isHeaderRow(element: TableElement): boolean;