@univerjs/core 0.2.6 → 0.2.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.
- package/lib/cjs/index.js +9 -9
- package/lib/es/index.js +2025 -244
- package/lib/types/common/const.d.ts +1 -1
- package/lib/types/common/equal.d.ts +0 -1
- package/lib/types/common/error.d.ts +18 -0
- package/lib/types/common/interceptor.d.ts +0 -1
- package/lib/types/common/unit.d.ts +3 -1
- package/lib/types/docs/data-model/document-data-model.d.ts +4 -4
- package/lib/types/docs/data-model/empty-snapshot.d.ts +0 -1
- package/lib/types/docs/data-model/json-x/json-x.d.ts +2 -2
- package/lib/types/docs/data-model/preset-list-type.d.ts +54 -5
- package/lib/types/docs/data-model/replacement.d.ts +0 -1
- package/lib/types/docs/data-model/text-x/__tests__/transform-position.spec.d.ts +16 -0
- package/lib/types/docs/data-model/text-x/__tests__/transform.spec.d.ts +16 -0
- package/lib/types/docs/data-model/text-x/action-iterator.d.ts +0 -1
- package/lib/types/docs/data-model/text-x/action-types.d.ts +0 -1
- package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +2 -3
- package/lib/types/docs/data-model/text-x/apply-utils/delete-apply.d.ts +0 -1
- package/lib/types/docs/data-model/text-x/apply-utils/insert-apply.d.ts +0 -1
- package/lib/types/docs/data-model/text-x/apply-utils/update-apply.d.ts +0 -1
- package/lib/types/docs/data-model/text-x/apply.d.ts +0 -1
- package/lib/types/docs/data-model/text-x/text-x.d.ts +31 -2
- package/lib/types/docs/data-model/text-x/transform-utils.d.ts +2 -0
- package/lib/types/docs/data-model/text-x/utils.d.ts +0 -1
- package/lib/types/docs/data-model/types.d.ts +12 -10
- package/lib/types/index.d.ts +2 -1
- package/lib/types/observer/observable.d.ts +0 -1
- package/lib/types/services/__tests__/index.d.ts +0 -1
- package/lib/types/services/authz-io/authz-io-local.service.d.ts +2 -3
- package/lib/types/services/authz-io/type.d.ts +0 -1
- package/lib/types/services/command/command.service.d.ts +0 -1
- package/lib/types/services/config/config.service.d.ts +0 -1
- package/lib/types/services/context/context.d.ts +3 -1
- package/lib/types/services/context/context.service.d.ts +0 -1
- package/lib/types/services/error/error.service.d.ts +0 -1
- package/lib/types/services/instance/instance.service.d.ts +18 -7
- package/lib/types/services/lifecycle/lifecycle.d.ts +0 -1
- package/lib/types/services/lifecycle/lifecycle.service.d.ts +0 -1
- package/lib/types/services/locale/locale.service.d.ts +0 -1
- package/lib/types/services/log/log.service.d.ts +0 -1
- package/lib/types/services/permission/permission.service.d.ts +0 -1
- package/lib/types/services/permission/type.d.ts +0 -1
- package/lib/types/services/plugin/plugin-override.d.ts +0 -1
- package/lib/types/services/plugin/plugin.d.ts +0 -1
- package/lib/types/services/plugin/plugin.service.d.ts +0 -1
- package/lib/types/services/resource-loader/resource-loader.service.d.ts +0 -1
- package/lib/types/services/resource-loader/type.d.ts +0 -1
- package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -7
- package/lib/types/services/resource-manager/type.d.ts +8 -5
- package/lib/types/services/snapshot/__tests__/snapshot-mock.d.ts +0 -1
- package/lib/types/services/snapshot/snapshot-server.service.d.ts +0 -1
- package/lib/types/services/snapshot/snapshot-transform.d.ts +3 -1
- package/lib/types/services/snapshot/snapshot-utils.d.ts +0 -1
- package/lib/types/services/theme/theme.service.d.ts +0 -1
- package/lib/types/services/undoredo/undoredo.service.d.ts +0 -1
- package/lib/types/services/user-manager/const.d.ts +0 -1
- package/lib/types/shared/after-init-apply.d.ts +0 -1
- package/lib/types/shared/check-if-move.d.ts +0 -1
- package/lib/types/shared/clipboard.d.ts +0 -1
- package/lib/types/shared/color/color.d.ts +0 -1
- package/lib/types/shared/common.d.ts +0 -1
- package/lib/types/shared/compare.d.ts +0 -1
- package/lib/types/shared/doc-tool.d.ts +0 -1
- package/lib/types/shared/index.d.ts +1 -0
- package/lib/types/shared/lifecycle.d.ts +0 -1
- package/lib/types/shared/lru/lru-map.d.ts +0 -1
- package/lib/types/shared/numfmt.d.ts +2 -0
- package/lib/types/shared/object-matrix-query.d.ts +0 -1
- package/lib/types/shared/object-matrix.d.ts +6 -1
- package/lib/types/shared/range.d.ts +0 -1
- package/lib/types/shared/rectangle.d.ts +0 -1
- package/lib/types/shared/rxjs.d.ts +0 -1
- package/lib/types/shared/shape.d.ts +6 -0
- package/lib/types/shared/tools.d.ts +11 -1
- package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +0 -1
- package/lib/types/sheets/column-manager.d.ts +0 -1
- package/lib/types/sheets/empty-snapshot.d.ts +0 -1
- package/lib/types/sheets/range.d.ts +0 -1
- package/lib/types/sheets/row-manager.d.ts +0 -1
- package/lib/types/sheets/sheet-snapshot-utils.d.ts +0 -1
- package/lib/types/sheets/styles.d.ts +0 -1
- package/lib/types/sheets/view-model.d.ts +0 -1
- package/lib/types/sheets/workbook.d.ts +1 -1
- package/lib/types/sheets/worksheet.d.ts +0 -1
- package/lib/types/slides/slide-model.d.ts +18 -4
- package/lib/types/types/const/const.d.ts +1 -1
- package/lib/types/types/interfaces/i-cell-custom-render.d.ts +0 -1
- package/lib/types/types/interfaces/i-cell-data.d.ts +0 -1
- package/lib/types/types/interfaces/i-cell-validation-data.d.ts +0 -1
- package/lib/types/types/interfaces/i-column-data.d.ts +0 -1
- package/lib/types/types/interfaces/i-data-validation.d.ts +0 -1
- package/lib/types/types/interfaces/i-document-data-interceptor.d.ts +5 -2
- package/lib/types/types/interfaces/i-document-data.d.ts +93 -47
- package/lib/types/types/interfaces/i-placeholder.d.ts +0 -1
- package/lib/types/types/interfaces/i-row-data.d.ts +0 -1
- package/lib/types/types/interfaces/i-selection-data.d.ts +0 -1
- package/lib/types/types/interfaces/i-shape-properties.d.ts +0 -1
- package/lib/types/types/interfaces/i-slide-data.d.ts +0 -1
- package/lib/types/types/interfaces/i-style-data.d.ts +0 -1
- package/lib/types/types/interfaces/i-univer-data.d.ts +0 -1
- package/lib/types/types/interfaces/i-workbook-data.d.ts +6 -6
- package/lib/types/types/interfaces/i-worksheet-data.d.ts +0 -1
- package/lib/types/univer.d.ts +0 -1
- package/lib/umd/index.js +9 -9
- package/package.json +11 -7
|
@@ -3,7 +3,6 @@ import { IAbsoluteTransform, ISize } from '../../shared/shape';
|
|
|
3
3
|
import { BooleanNumber, CellValueType, HorizontalAlign, LocaleType, TextDirection, VerticalAlign, WrapStrategy } from '../enum';
|
|
4
4
|
import { IExtraModelData } from './i-extra-model-data';
|
|
5
5
|
import { IColorStyle, IStyleBase } from './i-style-data';
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* Properties of document
|
|
9
8
|
*/
|
|
@@ -25,6 +24,7 @@ export interface IDocumentData extends IReferenceSource, IExtraModelData {
|
|
|
25
24
|
disabled?: boolean;
|
|
26
25
|
}
|
|
27
26
|
export interface IReferenceSource {
|
|
27
|
+
tableSource?: ITables;
|
|
28
28
|
footers?: IFooters;
|
|
29
29
|
headers?: IHeaders;
|
|
30
30
|
lists?: ILists;
|
|
@@ -47,6 +47,9 @@ export interface IHeaders {
|
|
|
47
47
|
export interface IFooters {
|
|
48
48
|
[footerId: string]: IFooterData;
|
|
49
49
|
}
|
|
50
|
+
export interface ITables {
|
|
51
|
+
[tableId: string]: ITable;
|
|
52
|
+
}
|
|
50
53
|
/**
|
|
51
54
|
* Set of lists
|
|
52
55
|
*/
|
|
@@ -97,7 +100,7 @@ export interface IDocumentBody {
|
|
|
97
100
|
paragraphs?: IParagraph[];
|
|
98
101
|
sectionBreaks?: ISectionBreak[];
|
|
99
102
|
customBlocks?: ICustomBlock[];
|
|
100
|
-
tables?:
|
|
103
|
+
tables?: ICustomTable[];
|
|
101
104
|
customRanges?: ICustomRange[];
|
|
102
105
|
customDecorations?: ICustomDecoration[];
|
|
103
106
|
/**
|
|
@@ -144,7 +147,8 @@ export interface IListData {
|
|
|
144
147
|
* Contains properties describing the look and feel of a list bullet at a given level of nesting.
|
|
145
148
|
*/
|
|
146
149
|
export interface INestingLevel {
|
|
147
|
-
paragraphProperties?:
|
|
150
|
+
paragraphProperties?: IParagraphStyle;
|
|
151
|
+
paragraphTextStyle?: ITextStyle;
|
|
148
152
|
bulletAlignment: BulletAlignment;
|
|
149
153
|
glyphFormat: string;
|
|
150
154
|
textStyle?: ITextStyle;
|
|
@@ -622,79 +626,120 @@ export declare enum TabStopAlignment {
|
|
|
622
626
|
export interface IShading {
|
|
623
627
|
backgroundColor: IColorStyle;
|
|
624
628
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
629
|
+
export interface IDistFromText {
|
|
630
|
+
distT: number;
|
|
631
|
+
distB: number;
|
|
632
|
+
distL: number;
|
|
633
|
+
distR: number;
|
|
634
|
+
}
|
|
635
|
+
export interface ITableAnchor {
|
|
636
|
+
positionH: IObjectPositionH;
|
|
637
|
+
positionV: IObjectPositionV;
|
|
638
|
+
}
|
|
639
|
+
export declare enum TableSizeType {
|
|
640
|
+
UNSPECIFIED = 0,
|
|
641
|
+
SPECIFIED = 1
|
|
642
|
+
}
|
|
643
|
+
export interface IWidthInTableSize {
|
|
644
|
+
type: TableSizeType;
|
|
645
|
+
width: INumberUnit;
|
|
646
|
+
}
|
|
647
|
+
export declare enum TableAlignmentType {
|
|
648
|
+
START = 0,
|
|
649
|
+
CENTER = 1,
|
|
650
|
+
END = 2
|
|
651
|
+
}
|
|
652
|
+
export declare enum TableLayoutType {
|
|
653
|
+
AUTO_FIT = 0,
|
|
654
|
+
FIXED = 1
|
|
655
|
+
}
|
|
656
|
+
export declare enum TableTextWrapType {
|
|
657
|
+
NONE = 0,
|
|
658
|
+
WRAP = 1
|
|
659
|
+
}
|
|
660
|
+
export interface ICustomTable {
|
|
661
|
+
startIndex: number;
|
|
662
|
+
endIndex: number;
|
|
663
|
+
tableId: string;
|
|
631
664
|
}
|
|
632
665
|
/**
|
|
633
666
|
* Properties of table
|
|
634
667
|
*/
|
|
635
668
|
export interface ITable {
|
|
636
|
-
startIndex: number;
|
|
637
|
-
endIndex: number;
|
|
638
|
-
rows: number;
|
|
639
|
-
columns: number;
|
|
640
669
|
tableRows: ITableRow[];
|
|
641
|
-
|
|
642
|
-
|
|
670
|
+
tableColumns: ITableColumn[];
|
|
671
|
+
align: TableAlignmentType;
|
|
672
|
+
indent: INumberUnit;
|
|
673
|
+
textWrap: TableTextWrapType;
|
|
674
|
+
position: ITableAnchor;
|
|
675
|
+
dist: IDistFromText;
|
|
676
|
+
size: IWidthInTableSize;
|
|
677
|
+
tableId: string;
|
|
678
|
+
cellMargin?: ITableCellMargin;
|
|
679
|
+
layout?: TableLayoutType;
|
|
680
|
+
overlap?: BooleanNumber;
|
|
681
|
+
description?: string;
|
|
682
|
+
}
|
|
683
|
+
export declare enum TableCellHeightRule {
|
|
684
|
+
AUTO = 0,
|
|
685
|
+
AT_LEAST = 1,
|
|
686
|
+
EXACT = 2
|
|
687
|
+
}
|
|
688
|
+
export interface ITableColumn {
|
|
689
|
+
size: IWidthInTableSize;
|
|
690
|
+
}
|
|
691
|
+
export interface ITableRowSize {
|
|
692
|
+
val: INumberUnit;
|
|
693
|
+
hRule: TableCellHeightRule;
|
|
643
694
|
}
|
|
644
695
|
/**
|
|
645
696
|
* Properties of row of table
|
|
646
697
|
*/
|
|
647
698
|
export interface ITableRow {
|
|
648
|
-
st: number;
|
|
649
|
-
ed: number;
|
|
650
699
|
tableCells: ITableCell[];
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
*/
|
|
656
|
-
export interface ITableRowStyle {
|
|
657
|
-
minRowHeight: number;
|
|
700
|
+
trHeight: ITableRowSize;
|
|
701
|
+
cantSplit?: BooleanNumber;
|
|
702
|
+
isFirstRow?: BooleanNumber;
|
|
703
|
+
repeatHeaderRow?: BooleanNumber;
|
|
658
704
|
}
|
|
659
705
|
/**
|
|
660
706
|
* Properties of table cell
|
|
661
707
|
*/
|
|
662
708
|
export interface ITableCell {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
contentAlignment: ContentAlignment;
|
|
709
|
+
margin?: ITableCellMargin;
|
|
710
|
+
rowSpan?: number;
|
|
711
|
+
columnSpan?: number;
|
|
712
|
+
backgroundColor?: IColorStyle;
|
|
713
|
+
borderLeft?: ITableCellBorder;
|
|
714
|
+
borderRight?: ITableCellBorder;
|
|
715
|
+
borderTop?: ITableCellBorder;
|
|
716
|
+
borderBottom?: ITableCellBorder;
|
|
717
|
+
size?: IWidthInTableSize;
|
|
718
|
+
tcFitText?: BooleanNumber;
|
|
719
|
+
vAlign?: VerticalAlignmentType;
|
|
720
|
+
}
|
|
721
|
+
export interface ITableCellMargin {
|
|
722
|
+
start: INumberUnit;
|
|
723
|
+
end: INumberUnit;
|
|
724
|
+
top: INumberUnit;
|
|
725
|
+
bottom: INumberUnit;
|
|
681
726
|
}
|
|
682
727
|
/**
|
|
683
728
|
* Properties of cell border
|
|
684
729
|
*/
|
|
685
730
|
export interface ITableCellBorder {
|
|
686
731
|
color: IColorStyle;
|
|
687
|
-
width:
|
|
732
|
+
width: INumberUnit;
|
|
688
733
|
dashStyle: DashStyleType;
|
|
689
734
|
}
|
|
690
735
|
/**
|
|
691
736
|
* The content alignments for a Shape or TableCell. The supported alignments correspond to predefined text anchoring types from the ECMA-376 standard.
|
|
692
737
|
*/
|
|
693
|
-
export declare enum
|
|
738
|
+
export declare enum VerticalAlignmentType {
|
|
694
739
|
CONTENT_ALIGNMENT_UNSPECIFIED = 0,// An unspecified content alignment. The content alignment is inherited from the parent if one exists.
|
|
695
|
-
|
|
740
|
+
BOTH = 1,
|
|
696
741
|
TOP = 2,// An alignment that aligns the content to the top of the content holder. Corresponds to ECMA-376 ST_TextAnchoringType 't'.
|
|
697
|
-
|
|
742
|
+
CENTER = 3,// An alignment that aligns the content to the middle of the content holder. Corresponds to ECMA-376 ST_TextAnchoringType 'ctr'.
|
|
698
743
|
BOTTOM = 4
|
|
699
744
|
}
|
|
700
745
|
/**
|
|
@@ -745,7 +790,8 @@ export declare enum NumberUnitType {
|
|
|
745
790
|
POINT = 0,
|
|
746
791
|
LINE = 1,
|
|
747
792
|
CHARACTER = 2,
|
|
748
|
-
PIXEL = 3
|
|
793
|
+
PIXEL = 3,
|
|
794
|
+
PERCENT = 4
|
|
749
795
|
}
|
|
750
796
|
export declare enum AlignTypeH {
|
|
751
797
|
CENTER = 0,
|
|
@@ -9,7 +9,6 @@ import { IPlaceholder } from './i-placeholder';
|
|
|
9
9
|
import { IShapeProperties } from './i-shape-properties';
|
|
10
10
|
import { IColorStyle, IStyleBase, IStyleData } from './i-style-data';
|
|
11
11
|
import { IWorksheetData } from './i-worksheet-data';
|
|
12
|
-
|
|
13
12
|
export interface ISlideData extends IReferenceSource, IExtraModelData {
|
|
14
13
|
id: string;
|
|
15
14
|
locale?: LocaleType;
|
|
@@ -2,7 +2,6 @@ import { Nullable } from '../../shared/types';
|
|
|
2
2
|
import { BorderStyleTypes } from '../enum/border-style-types';
|
|
3
3
|
import { BaselineOffset, BooleanNumber, HorizontalAlign, TextDecoration, TextDirection, VerticalAlign, WrapStrategy } from '../enum/text-style';
|
|
4
4
|
import { ThemeColorType } from '../enum/theme-color-type';
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* Properties of text decoration
|
|
8
7
|
*/
|
|
@@ -3,7 +3,6 @@ import { DependencyOverride } from '../../services/plugin/plugin-override';
|
|
|
3
3
|
import { IStyleSheet } from '../../services/theme/theme.service';
|
|
4
4
|
import { ILocales } from '../../shared/locale';
|
|
5
5
|
import { LocaleType } from '../enum';
|
|
6
|
-
|
|
7
6
|
export interface IUniverData {
|
|
8
7
|
theme: IStyleSheet;
|
|
9
8
|
locale: LocaleType;
|
|
@@ -3,7 +3,11 @@ import { LocaleType } from '../enum';
|
|
|
3
3
|
import { IExtraModelData } from './i-extra-model-data';
|
|
4
4
|
import { IStyleData } from './i-style-data';
|
|
5
5
|
import { IWorksheetData } from './i-worksheet-data';
|
|
6
|
-
|
|
6
|
+
export type Resources = Array<{
|
|
7
|
+
id?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
data: string;
|
|
10
|
+
}>;
|
|
7
11
|
/**
|
|
8
12
|
* Properties of a workbook's configuration
|
|
9
13
|
*/
|
|
@@ -31,9 +35,5 @@ export interface IWorkbookData extends IExtraModelData {
|
|
|
31
35
|
sheets: {
|
|
32
36
|
[sheetId: string]: Partial<IWorksheetData>;
|
|
33
37
|
};
|
|
34
|
-
resources?:
|
|
35
|
-
id?: string;
|
|
36
|
-
name: string;
|
|
37
|
-
data: string;
|
|
38
|
-
}>;
|
|
38
|
+
resources?: Resources;
|
|
39
39
|
}
|
package/lib/types/univer.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { LocaleType } from './types/enum/locale-type';
|
|
|
6
6
|
import { IDocumentData, ISlideData, IUniverData, IWorkbookData } from './types/interfaces';
|
|
7
7
|
import { UnitModel, UnitType } from './common/unit';
|
|
8
8
|
import { Plugin, PluginCtor } from './services/plugin/plugin';
|
|
9
|
-
|
|
10
9
|
export declare class Univer {
|
|
11
10
|
private _startedTypes;
|
|
12
11
|
private _injector;
|