@univerjs/core 0.1.9 → 0.1.11

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 (72) hide show
  1. package/lib/cjs/index.js +8 -8
  2. package/lib/es/index.js +1319 -1286
  3. package/lib/types/common/unit.d.ts +1 -1
  4. package/lib/types/docs/data-model/action-types.d.ts +1 -1
  5. package/lib/types/docs/data-model/apply-utils/update-apply.d.ts +1 -1
  6. package/lib/types/docs/data-model/document-data-model.d.ts +4 -5
  7. package/lib/types/docs/data-model/empty-snapshot.d.ts +1 -1
  8. package/lib/types/docs/data-model/text-x/text-x.d.ts +2 -2
  9. package/lib/types/docs/data-model/text-x/utils.d.ts +2 -2
  10. package/lib/types/docs/data-model/types.d.ts +2 -1
  11. package/lib/types/index.d.ts +1 -0
  12. package/lib/types/observer/observable-hooks.d.ts +1 -1
  13. package/lib/types/services/command/command.service.d.ts +2 -2
  14. package/lib/types/services/context/context.service.d.ts +1 -1
  15. package/lib/types/services/floating-object/floating-object-manager.service.d.ts +6 -6
  16. package/lib/types/services/instance/instance.service.d.ts +7 -7
  17. package/lib/types/services/lifecycle/lifecycle.service.d.ts +4 -4
  18. package/lib/types/services/locale/locale.service.d.ts +3 -3
  19. package/lib/types/services/permission/permission.service.d.ts +4 -4
  20. package/lib/types/services/permission/univer.permission.service.d.ts +2 -2
  21. package/lib/types/services/plugin/__tests__/plugin-override.spec.d.ts +16 -0
  22. package/lib/types/services/plugin/plugin-holder.d.ts +5 -5
  23. package/lib/types/services/plugin/plugin-override.d.ts +4 -3
  24. package/lib/types/services/plugin/plugin.d.ts +3 -3
  25. package/lib/types/services/plugin/plugin.service.d.ts +3 -3
  26. package/lib/types/services/resource-loader/resource-loader.service.d.ts +5 -5
  27. package/lib/types/services/resource-loader/type.d.ts +1 -1
  28. package/lib/types/services/resource-manager/resource-manager.service.d.ts +2 -2
  29. package/lib/types/services/resource-manager/type.d.ts +3 -3
  30. package/lib/types/services/snapshot/__tests__/snapshot-mock.d.ts +3 -3
  31. package/lib/types/services/snapshot/snapshot-server.service.d.ts +1 -1
  32. package/lib/types/services/snapshot/snapshot-transform.d.ts +4 -4
  33. package/lib/types/services/snapshot/snapshot-utils.d.ts +5 -5
  34. package/lib/types/services/theme/theme.service.d.ts +1 -1
  35. package/lib/types/services/undoredo/undoredo.service.d.ts +6 -6
  36. package/lib/types/services/user-manager/user-manager.service.d.ts +16 -0
  37. package/lib/types/shared/after-init-apply.d.ts +3 -0
  38. package/lib/types/shared/color/color.d.ts +1 -1
  39. package/lib/types/shared/common.d.ts +5 -5
  40. package/lib/types/shared/index.d.ts +1 -0
  41. package/lib/types/shared/lifecycle.d.ts +3 -3
  42. package/lib/types/shared/object-matrix-query.d.ts +1 -1
  43. package/lib/types/shared/object-matrix.d.ts +1 -1
  44. package/lib/types/shared/rectangle.d.ts +1 -1
  45. package/lib/types/shared/rxjs.d.ts +1 -1
  46. package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +1 -1
  47. package/lib/types/sheets/column-manager.d.ts +2 -2
  48. package/lib/types/sheets/empty-snapshot.d.ts +1 -1
  49. package/lib/types/sheets/range.d.ts +4 -4
  50. package/lib/types/sheets/row-manager.d.ts +3 -3
  51. package/lib/types/sheets/styles.d.ts +1 -1
  52. package/lib/types/sheets/view-model.d.ts +3 -3
  53. package/lib/types/sheets/workbook.d.ts +6 -6
  54. package/lib/types/sheets/worksheet.d.ts +7 -7
  55. package/lib/types/slides/slide-model.d.ts +1 -2
  56. package/lib/types/types/enum/locale-type.d.ts +2 -1
  57. package/lib/types/types/interfaces/i-cell-custom-render.d.ts +3 -3
  58. package/lib/types/types/interfaces/i-cell-data.d.ts +5 -5
  59. package/lib/types/types/interfaces/i-cell-validation-data.d.ts +1 -1
  60. package/lib/types/types/interfaces/i-data-validation.d.ts +5 -5
  61. package/lib/types/types/interfaces/i-document-data.d.ts +23 -18
  62. package/lib/types/types/interfaces/i-extra-model-data.d.ts +0 -6
  63. package/lib/types/types/interfaces/i-selection-data.d.ts +1 -1
  64. package/lib/types/types/interfaces/i-shape-properties.d.ts +1 -1
  65. package/lib/types/types/interfaces/i-slide-data.d.ts +10 -10
  66. package/lib/types/types/interfaces/i-style-data.d.ts +3 -3
  67. package/lib/types/types/interfaces/i-univer-data.d.ts +4 -4
  68. package/lib/types/types/interfaces/i-workbook-data.d.ts +4 -4
  69. package/lib/types/types/interfaces/i-worksheet-data.d.ts +6 -6
  70. package/lib/types/univer.d.ts +7 -7
  71. package/lib/umd/index.js +8 -8
  72. package/package.json +8 -8
@@ -1,9 +1,9 @@
1
- import { Worksheet } from './worksheet';
2
- import { Styles } from './styles';
3
- import { UnitModel, UniverInstanceType } from '../common/unit';
4
- import { IGridRange, IRangeType, IWorkbookData, IWorksheetData } from '../types/interfaces';
5
- import { Nullable } from '../shared';
6
1
  import { ILogService } from '../services/log/log.service';
2
+ import { Nullable } from '../shared';
3
+ import { IGridRange, IRangeType, IWorkbookData, IWorksheetData } from '../types/interfaces';
4
+ import { UnitModel, UniverInstanceType } from '../common/unit';
5
+ import { Styles } from './styles';
6
+ import { Worksheet } from './worksheet';
7
7
 
8
8
  export declare function getWorksheetUID(workbook: Workbook, worksheet: Worksheet): string;
9
9
  /**
@@ -43,6 +43,7 @@ export declare class Workbook extends UnitModel<IWorkbookData, UniverInstanceTyp
43
43
  static isIRangeType(range: IRangeType | IRangeType[]): boolean;
44
44
  getSnapshot(): IWorkbookData;
45
45
  getName(): string;
46
+ setName(name: string): void;
46
47
  getUnitId(): string;
47
48
  getRev(): number;
48
49
  incrementRev(): void;
@@ -52,7 +53,6 @@ export declare class Workbook extends UnitModel<IWorkbookData, UniverInstanceTyp
52
53
  * Add a Worksheet into Workbook.
53
54
  */
54
55
  addWorksheet(id: string, index: number, worksheetSnapshot: Partial<IWorksheetData>): boolean;
55
- getParentRenderUnitId(): string | undefined;
56
56
  getSheetOrders(): Readonly<string[]>;
57
57
  getWorksheets(): Map<string, Worksheet>;
58
58
  getActiveSpreadsheet(): Workbook;
@@ -1,11 +1,11 @@
1
- import { SheetViewModel } from './view-model';
2
- import { Styles } from './styles';
3
- import { RowManager } from './row-manager';
4
- import { Range } from './range';
5
- import { ColumnManager } from './column-manager';
6
- import { ICellData, ICellDataForSheetInterceptor, IFreeze, IRange, IWorksheetData } from '../types/interfaces';
7
- import { BooleanNumber } from '../types/enum';
8
1
  import { Nullable, ObjectMatrix } from '../shared';
2
+ import { BooleanNumber } from '../types/enum';
3
+ import { ICellData, ICellDataForSheetInterceptor, IFreeze, IRange, IWorksheetData } from '../types/interfaces';
4
+ import { ColumnManager } from './column-manager';
5
+ import { Range } from './range';
6
+ import { RowManager } from './row-manager';
7
+ import { Styles } from './styles';
8
+ import { SheetViewModel } from './view-model';
9
9
 
10
10
  /**
11
11
  * The model of a Worksheet.
@@ -1,5 +1,5 @@
1
- import { ISlideData, ISlidePage } from '../types/interfaces';
2
1
  import { UnitModel, UniverInstanceType } from '../common/unit';
2
+ import { ISlideData, ISlidePage } from '../types/interfaces';
3
3
 
4
4
  export declare class SlideDataModel extends UnitModel<ISlideData, UniverInstanceType.UNIVER_SLIDE> {
5
5
  type: UniverInstanceType.UNIVER_SLIDE;
@@ -7,7 +7,6 @@ export declare class SlideDataModel extends UnitModel<ISlideData, UniverInstance
7
7
  private _unitId;
8
8
  constructor(snapshot: Partial<ISlideData>);
9
9
  getContainer(): string | undefined;
10
- getParentRenderUnitId(): string | undefined;
11
10
  getSnapshot(): ISlideData;
12
11
  getUnitId(): string;
13
12
  getPages(): {
@@ -15,6 +15,7 @@
15
15
  */
16
16
  export declare enum LocaleType {
17
17
  EN_US = "enUS",
18
- ZH_CN = "zhCN"
18
+ ZH_CN = "zhCN",
19
+ RU_RU = "ruRU"
19
20
  }
20
21
  export type LocaleTypes = `${LocaleType}`;
@@ -1,7 +1,7 @@
1
- import { ICellDataForSheetInterceptor } from './i-cell-data';
2
- import { IStyleData } from './i-style-data';
3
- import { ISelectionCellWithCoord } from './i-selection-data';
4
1
  import { Nullable } from '../../shared';
2
+ import { ISelectionCellWithCoord } from './i-selection-data';
3
+ import { IStyleData } from './i-style-data';
4
+ import { ICellDataForSheetInterceptor } from './i-cell-data';
5
5
 
6
6
  export interface ICellRenderContext {
7
7
  data: ICellDataForSheetInterceptor;
@@ -1,9 +1,9 @@
1
- import { ICellValidationData } from './i-cell-validation-data';
2
- import { IStyleData } from './i-style-data';
3
- import { IDocumentData } from './i-document-data';
4
- import { ICellCustomRender } from './i-cell-custom-render';
5
- import { CellValueType } from '../enum/text-style';
6
1
  import { Nullable } from '../../shared/types';
2
+ import { CellValueType } from '../enum/text-style';
3
+ import { ICellCustomRender } from './i-cell-custom-render';
4
+ import { IDocumentData } from './i-document-data';
5
+ import { IStyleData } from './i-style-data';
6
+ import { ICellValidationData } from './i-cell-validation-data';
7
7
 
8
8
  /**
9
9
  * Cell value type
@@ -1,5 +1,5 @@
1
- import { IDataValidationRule } from './i-data-validation';
2
1
  import { DataValidationStatus } from '../enum/data-validation-status';
2
+ import { IDataValidationRule } from './i-data-validation';
3
3
 
4
4
  export interface ICellValidationData {
5
5
  ruleId: string;
@@ -1,9 +1,9 @@
1
- import { IRange } from './i-range';
2
- import { DataValidationRenderMode } from '../enum/data-validation-render-mode';
3
- import { DataValidationErrorStyle } from '../enum/data-validation-error-style';
4
- import { DataValidationImeMode } from '../enum/data-validation-ime-mode';
5
- import { DataValidationType } from '../enum/data-validation-type';
6
1
  import { DataValidationOperator } from '../enum/data-validation-operator';
2
+ import { DataValidationType } from '../enum/data-validation-type';
3
+ import { DataValidationImeMode } from '../enum/data-validation-ime-mode';
4
+ import { DataValidationErrorStyle } from '../enum/data-validation-error-style';
5
+ import { DataValidationRenderMode } from '../enum/data-validation-render-mode';
6
+ import { IRange } from './i-range';
7
7
 
8
8
  export interface IDataValidationRuleBase {
9
9
  type: DataValidationType;
@@ -1,7 +1,7 @@
1
- import { IColorStyle, IStyleBase } from './i-style-data';
2
- import { IExtraModelData } from './i-extra-model-data';
3
- import { BooleanNumber, CellValueType, HorizontalAlign, LocaleType, TextDirection, VerticalAlign, WrapStrategy } from '../enum';
4
1
  import { ISize } from '../../services/floating-object/floating-object-interfaces';
2
+ import { BooleanNumber, CellValueType, HorizontalAlign, LocaleType, TextDirection, VerticalAlign, WrapStrategy } from '../enum';
3
+ import { IExtraModelData } from './i-extra-model-data';
4
+ import { IColorStyle, IStyleBase } from './i-style-data';
5
5
 
6
6
  /**
7
7
  * Properties of document
@@ -252,6 +252,10 @@ export interface IDocumentLayout {
252
252
  characterSpacingControl?: characterSpacingControlType;
253
253
  paragraphLineGapDefault?: number;
254
254
  spaceWidthEastAsian?: BooleanNumber;
255
+ autoHyphenation?: BooleanNumber;
256
+ consecutiveHyphenLimit?: number;
257
+ doNotHyphenateCaps?: BooleanNumber;
258
+ hyphenationZone?: number;
255
259
  }
256
260
  export declare enum GridType {
257
261
  DEFAULT = 0,
@@ -409,8 +413,8 @@ export declare enum PositionedObjectLayoutType {
409
413
  */
410
414
  export interface IObjectTransform {
411
415
  size: ISize;
412
- positionH: ObjectPositionH;
413
- positionV: ObjectPositionV;
416
+ positionH: IObjectPositionH;
417
+ positionV: IObjectPositionV;
414
418
  angle: number;
415
419
  }
416
420
  /**
@@ -456,6 +460,7 @@ export interface IParagraphStyle extends IIndentStart {
456
460
  wordWrap?: BooleanNumber;
457
461
  widowControl?: BooleanNumber;
458
462
  shading?: IShading;
463
+ suppressHyphenation?: BooleanNumber;
459
464
  }
460
465
  /**
461
466
  * Types of name style
@@ -609,37 +614,37 @@ export interface INumberUnit {
609
614
  v: number;
610
615
  u: NumberUnitType;
611
616
  }
612
- export interface ObjectPositionH {
617
+ export interface IObjectPositionH {
613
618
  relativeFrom: ObjectRelativeFromH;
614
619
  align?: AlignTypeH;
615
620
  posOffset?: number;
616
621
  percent?: number;
617
622
  }
618
- export interface ObjectPositionV {
623
+ export interface IObjectPositionV {
619
624
  relativeFrom: ObjectRelativeFromV;
620
625
  align?: AlignTypeV;
621
626
  posOffset?: number;
622
627
  percent?: number;
623
628
  }
624
629
  export declare enum ObjectRelativeFromH {
625
- CHARACTER = 0,
630
+ PAGE = 0,
626
631
  COLUMN = 1,
627
- INSIDE_MARGIN = 2,
628
- LEFT_MARGIN = 3,
629
- MARGIN = 4,
632
+ CHARACTER = 2,
633
+ MARGIN = 3,
634
+ INSIDE_MARGIN = 4,
630
635
  OUTSIDE_MARGIN = 5,
631
- PAGE = 6,
636
+ LEFT_MARGIN = 6,
632
637
  RIGHT_MARGIN = 7
633
638
  }
634
639
  export declare enum ObjectRelativeFromV {
635
- BOTTOM_MARGIN = 0,
636
- INSIDE_MARGIN = 1,
640
+ PAGE = 0,
641
+ PARAGRAPH = 1,
637
642
  LINE = 2,
638
643
  MARGIN = 3,
639
- OUTSIDE_MARGIN = 4,
640
- PAGE = 5,
641
- PARAGRAPH = 6,
642
- TOP_MARGIN = 7
644
+ TOP_MARGIN = 4,
645
+ BOTTOM_MARGIN = 5,
646
+ INSIDE_MARGIN = 6,
647
+ OUTSIDE_MARGIN = 7
643
648
  }
644
649
  export declare enum NumberUnitType {
645
650
  POINT = 0,
@@ -24,10 +24,4 @@ export interface IExtraModelData {
24
24
  * default is null
25
25
  */
26
26
  container?: string;
27
- /**
28
- * Specify the unitID of the parent render. In this case, the scene will enter
29
- * the sceneViewer and become a child application of the parent scene.
30
- * default is null
31
- */
32
- parentRenderUnitId?: string;
33
27
  }
@@ -1,5 +1,5 @@
1
- import { IRange } from './i-range';
2
1
  import { Nullable } from '../../shared/types';
2
+ import { IRange } from './i-range';
3
3
 
4
4
  /**
5
5
  * Properties of selection data
@@ -1,5 +1,5 @@
1
- import { IColorStyle } from './i-style-data';
2
1
  import { BorderStyleTypes } from '../enum/border-style-types';
2
+ import { IColorStyle } from './i-style-data';
3
3
 
4
4
  /**
5
5
  * ShapeProperties
@@ -1,14 +1,14 @@
1
- import { IWorksheetData } from './i-worksheet-data';
2
- import { IColorStyle, IStyleBase, IStyleData } from './i-style-data';
3
- import { IShapeProperties } from './i-shape-properties';
4
- import { IPlaceholder } from './i-placeholder';
5
- import { IImageProperties } from './i-image-properties';
6
- import { IExtraModelData } from './i-extra-model-data';
7
- import { ICustomBlock, IDocumentData, ILists } from './i-document-data';
8
- import { ShapeType } from '../enum/shape-type';
9
- import { LocaleType, ThemeColorType } from '../enum';
10
- import { IKeyType, Nullable } from '../../shared/types';
11
1
  import { ISize, ITransformState } from '../../services/floating-object/floating-object-interfaces';
2
+ import { IKeyType, Nullable } from '../../shared/types';
3
+ import { LocaleType, ThemeColorType } from '../enum';
4
+ import { ShapeType } from '../enum/shape-type';
5
+ import { ICustomBlock, IDocumentData, ILists } from './i-document-data';
6
+ import { IExtraModelData } from './i-extra-model-data';
7
+ import { IImageProperties } from './i-image-properties';
8
+ import { IPlaceholder } from './i-placeholder';
9
+ import { IShapeProperties } from './i-shape-properties';
10
+ import { IColorStyle, IStyleBase, IStyleData } from './i-style-data';
11
+ import { IWorksheetData } from './i-worksheet-data';
12
12
 
13
13
  export interface ISlideData extends IReferenceSource, IExtraModelData {
14
14
  id: string;
@@ -1,7 +1,7 @@
1
- import { ThemeColorType } from '../enum/theme-color-type';
2
- import { BaselineOffset, BooleanNumber, HorizontalAlign, TextDecoration, TextDirection, VerticalAlign, WrapStrategy } from '../enum/text-style';
3
- import { BorderStyleTypes } from '../enum/border-style-types';
4
1
  import { Nullable } from '../../shared/types';
2
+ import { BorderStyleTypes } from '../enum/border-style-types';
3
+ import { BaselineOffset, BooleanNumber, HorizontalAlign, TextDecoration, TextDirection, VerticalAlign, WrapStrategy } from '../enum/text-style';
4
+ import { ThemeColorType } from '../enum/theme-color-type';
5
5
 
6
6
  /**
7
7
  * Properties of text decoration
@@ -1,8 +1,8 @@
1
- import { LocaleType } from '../enum';
2
- import { ILocales } from '../../shared/locale';
3
- import { IStyleSheet } from '../../services/theme/theme.service';
4
- import { DependencyOverride } from '../../services/plugin/plugin-override';
5
1
  import { LogLevel } from '../../services/log/log.service';
2
+ import { DependencyOverride } from '../../services/plugin/plugin-override';
3
+ import { IStyleSheet } from '../../services/theme/theme.service';
4
+ import { ILocales } from '../../shared/locale';
5
+ import { LocaleType } from '../enum';
6
6
 
7
7
  export interface IUniverData {
8
8
  theme: IStyleSheet;
@@ -1,8 +1,8 @@
1
- import { IWorksheetData } from './i-worksheet-data';
2
- import { IStyleData } from './i-style-data';
3
- import { IExtraModelData } from './i-extra-model-data';
4
- import { LocaleType } from '../enum';
5
1
  import { IKeyType, Nullable } from '../../shared/types';
2
+ import { LocaleType } from '../enum';
3
+ import { IExtraModelData } from './i-extra-model-data';
4
+ import { IStyleData } from './i-style-data';
5
+ import { IWorksheetData } from './i-worksheet-data';
6
6
 
7
7
  /**
8
8
  * Properties of a workbook's configuration
@@ -1,10 +1,10 @@
1
- import { IRowData } from './i-row-data';
2
- import { IRange, IRangeType } from './i-range';
3
- import { IFreeze } from './i-freeze';
4
- import { IColumnData } from './i-column-data';
5
- import { ICellData } from './i-cell-data';
6
- import { BooleanNumber } from '../enum';
7
1
  import { IObjectArrayPrimitiveType, IObjectMatrixPrimitiveType } from '../../shared/object-matrix';
2
+ import { BooleanNumber } from '../enum';
3
+ import { ICellData } from './i-cell-data';
4
+ import { IColumnData } from './i-column-data';
5
+ import { IFreeze } from './i-freeze';
6
+ import { IRange, IRangeType } from './i-range';
7
+ import { IRowData } from './i-row-data';
8
8
 
9
9
  /**
10
10
  * Snapshot of a worksheet.
@@ -1,11 +1,11 @@
1
- import { Plugin, PluginCtor } from './services/plugin/plugin';
2
- import { UnitModel, UnitType } from './common/unit';
3
- import { IDocumentData, ISlideData, IUniverData, IWorkbookData } from './types/interfaces';
4
- import { LocaleType } from './types/enum/locale-type';
5
- import { SlideDataModel } from './slides/slide-model';
6
- import { Workbook } from './sheets/workbook';
7
- import { DocumentDataModel } from './docs/data-model/document-data-model';
8
1
  import { Injector } from '@wendellhu/redi';
2
+ import { DocumentDataModel } from './docs/data-model/document-data-model';
3
+ import { Workbook } from './sheets/workbook';
4
+ import { SlideDataModel } from './slides/slide-model';
5
+ import { LocaleType } from './types/enum/locale-type';
6
+ import { IDocumentData, ISlideData, IUniverData, IWorkbookData } from './types/interfaces';
7
+ import { UnitModel, UnitType } from './common/unit';
8
+ import { Plugin, PluginCtor } from './services/plugin/plugin';
9
9
 
10
10
  export declare class Univer {
11
11
  private _startedTypes;