@univerjs/core 0.2.2 → 0.2.4-alpha.0

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 (47) hide show
  1. package/README.md +17 -8
  2. package/lib/cjs/index.js +11 -9
  3. package/lib/es/index.js +5302 -4223
  4. package/lib/types/common/__tests__/url.spec.d.ts +16 -0
  5. package/lib/types/common/di.d.ts +17 -0
  6. package/lib/types/common/url.d.ts +1 -0
  7. package/lib/types/docs/data-model/document-data-model.d.ts +2 -1
  8. package/lib/types/docs/data-model/preset-list-type.d.ts +3 -29
  9. package/lib/types/docs/data-model/text-x/utils.d.ts +6 -1
  10. package/lib/types/index.d.ts +3 -2
  11. package/lib/types/services/__tests__/index.d.ts +7 -7
  12. package/lib/types/services/authz-io/authz-io-local.service.d.ts +1 -0
  13. package/lib/types/services/authz-io/type.d.ts +1 -1
  14. package/lib/types/services/command/command.service.d.ts +5 -3
  15. package/lib/types/services/config/config.service.d.ts +1 -1
  16. package/lib/types/services/context/context.service.d.ts +1 -1
  17. package/lib/types/services/instance/instance.service.d.ts +2 -2
  18. package/lib/types/services/lifecycle/lifecycle.d.ts +1 -1
  19. package/lib/types/services/lifecycle/lifecycle.service.d.ts +3 -3
  20. package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
  21. package/lib/types/services/log/log.service.d.ts +1 -1
  22. package/lib/types/services/permission/type.d.ts +1 -1
  23. package/lib/types/services/plugin/plugin-override.d.ts +1 -1
  24. package/lib/types/services/plugin/plugin.d.ts +1 -1
  25. package/lib/types/services/plugin/plugin.service.d.ts +3 -1
  26. package/lib/types/services/resource-loader/type.d.ts +1 -1
  27. package/lib/types/services/resource-manager/type.d.ts +2 -2
  28. package/lib/types/services/snapshot/snapshot-server.service.d.ts +1 -1
  29. package/lib/types/services/undoredo/undoredo.service.d.ts +2 -2
  30. package/lib/types/services/user-manager/user-manager.service.d.ts +1 -0
  31. package/lib/types/shared/__tests__/rxjs.spec.d.ts +16 -0
  32. package/lib/types/shared/common.d.ts +1 -1
  33. package/lib/types/shared/lifecycle.d.ts +8 -1
  34. package/lib/types/shared/lru/lru-map.d.ts +1 -1
  35. package/lib/types/shared/rxjs.d.ts +5 -1
  36. package/lib/types/shared/tools.d.ts +7 -0
  37. package/lib/types/sheets/view-model.d.ts +1 -1
  38. package/lib/types/sheets/workbook.d.ts +10 -4
  39. package/lib/types/types/enum/locale-type.d.ts +3 -1
  40. package/lib/types/types/interfaces/i-data-validation.d.ts +19 -4
  41. package/lib/types/types/interfaces/i-document-data-interceptor.d.ts +10 -0
  42. package/lib/types/types/interfaces/i-document-data.d.ts +29 -21
  43. package/lib/types/types/interfaces/i-range.d.ts +27 -12
  44. package/lib/types/types/interfaces/index.d.ts +1 -0
  45. package/lib/types/univer.d.ts +1 -1
  46. package/lib/umd/index.js +11 -9
  47. package/package.json +7 -7
@@ -99,6 +99,11 @@ export interface IDocumentBody {
99
99
  tables?: ITable[];
100
100
  customRanges?: ICustomRange[];
101
101
  customDecorations?: ICustomDecoration[];
102
+ /**
103
+ * for copy/paste, data of custom-range and other module
104
+ * it won't save to disk
105
+ */
106
+ payloads?: Record<string, string>;
102
107
  }
103
108
  export interface IDocStyle {
104
109
  name: string;
@@ -202,15 +207,14 @@ export interface ICustomRange {
202
207
  endIndex: number;
203
208
  rangeId: string;
204
209
  rangeType: CustomRangeType;
210
+ /**
211
+ * display as a whole-entity
212
+ */
213
+ wholeEntity?: boolean;
205
214
  }
206
- export interface ICustomRangeForInterceptor extends ICustomRange {
207
- active?: boolean;
208
- show?: boolean;
209
- }
210
- export interface ICustomDecorationForInterceptor extends ICustomDecoration {
211
- active?: boolean;
212
- show?: boolean;
213
- }
215
+ /**
216
+ * @deprecated
217
+ */
214
218
  export declare enum CustomRangeType {
215
219
  HYPERLINK = 0,
216
220
  FIELD = 1,// 17.16 Fields and Hyperlinks
@@ -218,7 +222,8 @@ export declare enum CustomRangeType {
218
222
  BOOKMARK = 3,
219
223
  COMMENT = 4,
220
224
  CUSTOM = 5,
221
- MENTION = 6
225
+ MENTION = 6,
226
+ UNI_FORMULA = 7
222
227
  }
223
228
  /**
224
229
  * Custom Block
@@ -271,9 +276,6 @@ export interface IDocStyleBase extends IMargin {
271
276
  renderConfig?: IDocumentRenderConfig;
272
277
  }
273
278
  export interface IDocumentLayout {
274
- charSpace?: number;
275
- linePitch?: number;
276
- gridType?: GridType;
277
279
  defaultTabStop?: number;
278
280
  characterSpacingControl?: characterSpacingControlType;
279
281
  paragraphLineGapDefault?: number;
@@ -317,6 +319,9 @@ export interface IDocumentRenderConfig {
317
319
  isRenderStyle?: BooleanNumber;
318
320
  }
319
321
  export interface ISectionBreakBase {
322
+ charSpace?: number;
323
+ linePitch?: number;
324
+ gridType?: GridType;
320
325
  columnProperties?: ISectionColumnProperties[];
321
326
  columnSeparatorType?: ColumnSeparatorType;
322
327
  contentDirection?: TextDirection;
@@ -458,9 +463,9 @@ export interface ITextStyle extends IStyleBase {
458
463
  sa?: number;
459
464
  }
460
465
  export interface IIndentStart {
461
- indentFirstLine?: INumberUnit | number;
462
- hanging?: INumberUnit | number;
463
- indentStart?: INumberUnit | number;
466
+ indentFirstLine?: INumberUnit;
467
+ hanging?: INumberUnit;
468
+ indentStart?: INumberUnit;
464
469
  tabStops?: ITabStop[];
465
470
  }
466
471
  /**
@@ -474,14 +479,14 @@ export interface IParagraphStyle extends IIndentStart {
474
479
  direction?: TextDirection;
475
480
  spacingRule?: SpacingRule;
476
481
  snapToGrid?: BooleanNumber;
477
- spaceAbove?: INumberUnit | number;
478
- spaceBelow?: INumberUnit | number;
482
+ spaceAbove?: INumberUnit;
483
+ spaceBelow?: INumberUnit;
479
484
  borderBetween?: IParagraphBorder;
480
485
  borderTop?: IParagraphBorder;
481
486
  borderBottom?: IParagraphBorder;
482
487
  borderLeft?: IParagraphBorder;
483
488
  borderRight?: IParagraphBorder;
484
- indentEnd?: INumberUnit | number;
489
+ indentEnd?: INumberUnit;
485
490
  keepLines?: BooleanNumber;
486
491
  keepNext?: BooleanNumber;
487
492
  wordWrap?: BooleanNumber;
@@ -639,7 +644,7 @@ export declare enum FontStyleType {
639
644
  }
640
645
  export interface INumberUnit {
641
646
  v: number;
642
- u: NumberUnitType;
647
+ u?: NumberUnitType;
643
648
  }
644
649
  export interface IObjectPositionH {
645
650
  relativeFrom: ObjectRelativeFromH;
@@ -676,14 +681,17 @@ export declare enum ObjectRelativeFromV {
676
681
  export declare enum NumberUnitType {
677
682
  POINT = 0,
678
683
  LINE = 1,
679
- CHARACTER = 2
684
+ CHARACTER = 2,
685
+ PIXEL = 3
680
686
  }
681
687
  export declare enum AlignTypeH {
682
688
  CENTER = 0,
683
689
  INSIDE = 1,
684
690
  LEFT = 2,
685
691
  OUTSIDE = 3,
686
- RIGHT = 4
692
+ RIGHT = 4,
693
+ BOTH = 5,
694
+ DISTRIBUTE = 6
687
695
  }
688
696
  export declare enum AlignTypeV {
689
697
  BOTTOM = 0,
@@ -31,7 +31,19 @@ export declare enum AbsoluteRefType {
31
31
  COLUMN = 2,
32
32
  ALL = 3
33
33
  }
34
- export interface IRowRange {
34
+ interface IRangeLocation {
35
+ /**
36
+ * Id of the Workbook the range belongs to.
37
+ * When this field is not defined, it should be considered as the range in the currently activated worksheet.
38
+ */
39
+ unitId?: string;
40
+ /**
41
+ * Id of the Worksheet the range belongs to.
42
+ * When this field is not defined, it should be considered as the range in the currently activated worksheet.
43
+ */
44
+ sheetId?: string;
45
+ }
46
+ export interface IRowRange extends IRangeLocation {
35
47
  /**
36
48
  * The start row (inclusive) of the range
37
49
  * startRow
@@ -43,6 +55,18 @@ export interface IRowRange {
43
55
  */
44
56
  endRow: number;
45
57
  }
58
+ export interface IColumnRange extends IRangeLocation {
59
+ /**
60
+ * The start column (inclusive) of the range
61
+ * startColumn
62
+ */
63
+ startColumn: number;
64
+ /**
65
+ * The end column (exclusive) of the range
66
+ * endColumn
67
+ */
68
+ endColumn: number;
69
+ }
46
70
  /**
47
71
  * Range data structure
48
72
  *
@@ -58,17 +82,7 @@ export interface IRowRange {
58
82
  *
59
83
  * means "A1:B2"
60
84
  */
61
- export interface IRange extends IRowRange {
62
- /**
63
- * The start column (inclusive) of the range
64
- * startColumn
65
- */
66
- startColumn: number;
67
- /**
68
- * The end column (exclusive) of the range
69
- * endColumn
70
- */
71
- endColumn: number;
85
+ export interface IRange extends IRowRange, IColumnRange {
72
86
  rangeType?: RANGE_TYPE;
73
87
  startAbsoluteRefType?: AbsoluteRefType;
74
88
  endAbsoluteRefType?: AbsoluteRefType;
@@ -191,3 +205,4 @@ export interface IRectLTRB {
191
205
  width?: number;
192
206
  height?: number;
193
207
  }
208
+ export {};
@@ -16,6 +16,7 @@
16
16
  export * from './i-cell-data';
17
17
  export * from './i-column-data';
18
18
  export * from './i-document-data';
19
+ export * from './i-document-data-interceptor';
19
20
  export * from './i-freeze';
20
21
  export * from './i-image-properties';
21
22
  export * from './i-placeholder';
@@ -1,4 +1,4 @@
1
- import { Injector } from '@wendellhu/redi';
1
+ import { Injector } from './common/di';
2
2
  import { DocumentDataModel } from './docs/data-model/document-data-model';
3
3
  import { Workbook } from './sheets/workbook';
4
4
  import { SlideDataModel } from './slides/slide-model';