@worktile/theia 15.1.5 → 15.1.7

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.
@@ -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.5",
3
+ "version": "15.1.7",
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
  }
@@ -65,11 +65,6 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
65
65
  */
66
66
  calcPrintColumnsWidth(): void;
67
67
  getWrapperWidth(): number;
68
- /**
69
- * compatible with old data
70
- * @returns
71
- */
72
- getHeaderRow(): boolean;
73
68
  ngAfterViewInit(): void;
74
69
  setHeaderRowShadow(): void;
75
70
  calcHeaderRowShadow(): {
@@ -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,45 @@ $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-sticky-row {
752
+ grid-template-columns: 45px;
753
+ }
754
+ .the-table-number-col {
755
+ position: sticky;
756
+ left: 0;
757
+ width: 45px;
758
+ }
759
+ .the-table-number-column {
760
+ position: sticky !important;
761
+ left: 0;
762
+ z-index: $top-cell-z-index;
763
+ background-color: variables.$gray-100;
764
+ border: 1px solid variables.$gray-300;
765
+ border-bottom: none;
766
+ text-align: center;
767
+ grid-template-columns: 45px;
768
+ }
769
+ // 存在序列号、标题列时,正确设置标题列 sticky left
770
+ .the-table-numbered .the-sticky-cell {
771
+ left: 45px;
772
+ z-index: $top-cell-z-index;
773
+ }
774
+ // 滑动时阴影偏移到序号列 td 上
775
+ &:not(.the-table-with-sticky-column) .the-table-container.the-table-left-shadow::before {
776
+ left: 45px;
777
+ }
778
+ }
779
+ }
@@ -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;
@@ -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;