@univerjs/core 0.6.7 → 0.6.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 +8 -10
- package/lib/es/index.js +3644 -3592
- package/lib/facade.js +1428 -0
- package/lib/index.js +18092 -0
- package/lib/types/docs/data-model/document-data-model.d.ts +1 -0
- package/lib/types/docs/data-model/preset-list-type.d.ts +3 -1
- package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +11 -1
- package/lib/types/docs/data-model/text-x/build-utils/paragraph.d.ts +13 -1
- package/lib/types/docs/data-model/text-x/build-utils/selection.d.ts +4 -0
- package/lib/types/shared/lifecycle.d.ts +1 -1
- package/lib/types/shared/tools.d.ts +1 -0
- package/lib/types/sheets/worksheet.d.ts +9 -8
- package/lib/types/types/const/const.d.ts +4 -0
- package/lib/types/types/interfaces/i-document-data.d.ts +3 -4
- package/lib/umd/index.js +8 -10
- package/package.json +2 -2
|
@@ -43,6 +43,7 @@ declare class DocumentDataModelSimple extends UnitModel<IDocumentData, UniverIns
|
|
|
43
43
|
setZoomRatio(zoomRatio?: number): void;
|
|
44
44
|
setDisabled(disabled: boolean): void;
|
|
45
45
|
getDisabled(): boolean | undefined;
|
|
46
|
+
getTitle(): string | undefined;
|
|
46
47
|
}
|
|
47
48
|
export declare class DocumentDataModel extends DocumentDataModelSimple {
|
|
48
49
|
private _unitId;
|
|
@@ -6,7 +6,8 @@ export declare enum QuickListType {
|
|
|
6
6
|
ORDER_LIST_QUICK_4 = "i.",
|
|
7
7
|
ORDER_LIST_QUICK_5 = "A.",
|
|
8
8
|
ORDER_LIST_QUICK_6 = "I.",
|
|
9
|
-
ORDER_LIST_QUICK_7 = "01."
|
|
9
|
+
ORDER_LIST_QUICK_7 = "01.",
|
|
10
|
+
BULLET_LIST = "*"
|
|
10
11
|
}
|
|
11
12
|
export declare enum PresetListType {
|
|
12
13
|
BULLET_LIST = "BULLET_LIST",
|
|
@@ -56,4 +57,5 @@ export declare const QuickListTypeMap: {
|
|
|
56
57
|
"A.": PresetListType;
|
|
57
58
|
"I.": PresetListType;
|
|
58
59
|
"01.": PresetListType;
|
|
60
|
+
"*": PresetListType;
|
|
59
61
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { addCustomDecorationTextX, deleteCustomDecorationTextX } from './custom-decoration';
|
|
2
2
|
import { copyCustomRange, getCustomRangesInterestsWithSelection, isIntersecting } from './custom-range';
|
|
3
|
-
import { isSegmentIntersects, makeSelection, normalizeSelection } from './selection';
|
|
3
|
+
import { getParagraphsInRange, getParagraphsInRanges, isSegmentIntersects, makeSelection, normalizeSelection, transformParagraphs } from './selection';
|
|
4
4
|
import { addCustomRangeTextX, deleteCustomRangeTextX, deleteSelectionTextX, retainSelectionTextX } from './text-x-utils';
|
|
5
5
|
export declare class BuildTextUtils {
|
|
6
6
|
static customRange: {
|
|
@@ -24,6 +24,8 @@ export declare class BuildTextUtils {
|
|
|
24
24
|
};
|
|
25
25
|
static range: {
|
|
26
26
|
isIntersects: typeof isSegmentIntersects;
|
|
27
|
+
getParagraphsInRange: typeof getParagraphsInRange;
|
|
28
|
+
getParagraphsInRanges: typeof getParagraphsInRanges;
|
|
27
29
|
};
|
|
28
30
|
static transform: {
|
|
29
31
|
getPlainText: (dataStream: string) => string;
|
|
@@ -37,6 +39,14 @@ export declare class BuildTextUtils {
|
|
|
37
39
|
toggleChecklist: (params: import('./paragraph').IToggleChecklistParagraphParams) => false | import('../text-x').TextX;
|
|
38
40
|
changeNestLevel: (params: import('./paragraph').IChangeParagraphBulletNestLevelParams) => import('../text-x').TextX;
|
|
39
41
|
};
|
|
42
|
+
style: {
|
|
43
|
+
set: (params: import('./paragraph').ISetParagraphStyleParams) => import('../text-x').TextX;
|
|
44
|
+
};
|
|
45
|
+
util: {
|
|
46
|
+
transform: typeof transformParagraphs;
|
|
47
|
+
getParagraphsInRange: typeof getParagraphsInRange;
|
|
48
|
+
getParagraphsInRanges: typeof getParagraphsInRanges;
|
|
49
|
+
};
|
|
40
50
|
};
|
|
41
51
|
static drawing: {
|
|
42
52
|
add: (param: import('./drawings').IAddDrawingParam) => false | import('ot-json1').JSONOp;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITextRange } from '../../../../sheets/typedef';
|
|
2
|
+
import { ICustomTable, IParagraph, IParagraphStyle, ITextStyle } from '../../../../types/interfaces';
|
|
2
3
|
import { DocumentDataModel } from '../../document-data-model';
|
|
3
4
|
import { TextX } from '../text-x';
|
|
4
5
|
export interface ISwitchParagraphBulletParams {
|
|
@@ -29,3 +30,14 @@ export interface IChangeParagraphBulletNestLevelParams {
|
|
|
29
30
|
}
|
|
30
31
|
export declare function hasParagraphInTable(paragraph: IParagraph, tables: ICustomTable[]): boolean;
|
|
31
32
|
export declare const changeParagraphBulletNestLevel: (params: IChangeParagraphBulletNestLevelParams) => TextX;
|
|
33
|
+
export interface ISetParagraphStyleParams {
|
|
34
|
+
textRanges: readonly ITextRange[];
|
|
35
|
+
segmentId?: string;
|
|
36
|
+
document: DocumentDataModel;
|
|
37
|
+
style: IParagraphStyle;
|
|
38
|
+
paragraphTextRun?: ITextStyle;
|
|
39
|
+
cursor?: number;
|
|
40
|
+
deleteLen?: number;
|
|
41
|
+
textX?: TextX;
|
|
42
|
+
}
|
|
43
|
+
export declare const setParagraphStyle: (params: ISetParagraphStyleParams) => TextX;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ITextRange } from '../../../../sheets/typedef';
|
|
2
|
+
import { IParagraph, IParagraphRange } from '../../../../types/interfaces';
|
|
2
3
|
export declare function makeSelection(startOffset: number, endOffset?: number): ITextRange;
|
|
3
4
|
export declare function normalizeSelection(selection: ITextRange): ITextRange;
|
|
4
5
|
export declare function isSegmentIntersects(start: number, end: number, start2: number, end2: number): boolean;
|
|
6
|
+
export declare function getParagraphsInRange(activeRange: ITextRange, paragraphs: IParagraph[]): IParagraphRange[];
|
|
7
|
+
export declare function getParagraphsInRanges(ranges: readonly ITextRange[], paragraphs: IParagraph[]): IParagraphRange[];
|
|
8
|
+
export declare function transformParagraphs(paragraphs: IParagraph[]): IParagraphRange[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SubscriptionLike, Subject, Subscription } from 'rxjs';
|
|
2
2
|
import { IDisposable } from '../common/di';
|
|
3
3
|
type DisposableLike = IDisposable | SubscriptionLike | (() => void);
|
|
4
4
|
export declare function toDisposable(disposable: IDisposable): IDisposable;
|
|
@@ -4,6 +4,7 @@ import { IKeyValue, Nullable } from './types';
|
|
|
4
4
|
* Universal tool library
|
|
5
5
|
*/
|
|
6
6
|
export declare class Tools {
|
|
7
|
+
static deleteNull(obj: any): any;
|
|
7
8
|
static stringAt(index: number): string;
|
|
8
9
|
static indexAt(code: string): number;
|
|
9
10
|
static deleteBlank(value?: string): string | undefined;
|
|
@@ -90,14 +90,6 @@ export declare class Worksheet {
|
|
|
90
90
|
* @param {string|Nullable<IStyleData>} style The style to be set
|
|
91
91
|
*/
|
|
92
92
|
setRowStyle(row: number, style: string | Nullable<IStyleData>): void;
|
|
93
|
-
/**
|
|
94
|
-
* this function is used to mixin default style to cell raw{number}
|
|
95
|
-
* @param {number} row The row index
|
|
96
|
-
* @param {number} col The column index
|
|
97
|
-
* @param cellRaw The cell raw data
|
|
98
|
-
* @param {boolean} isRowStylePrecedeColumnStyle The priority of row style and column style
|
|
99
|
-
*/
|
|
100
|
-
mixinDefaultStyleToCellRaw(row: number, col: number, cellRaw: Nullable<ICellData>, isRowStylePrecedeColumnStyle: boolean): void;
|
|
101
93
|
/**
|
|
102
94
|
* Get the default style of the worksheet.
|
|
103
95
|
* @returns {Nullable<IStyleData>} Default Style
|
|
@@ -110,6 +102,15 @@ export declare class Worksheet {
|
|
|
110
102
|
*/
|
|
111
103
|
setDefaultCellStyle(style: Nullable<IStyleData> | string): void;
|
|
112
104
|
getCellStyle(row: number, col: number): Nullable<IStyleData>;
|
|
105
|
+
/**
|
|
106
|
+
* Get the composed style of the cell. If you want to get the style of the cell without merging row style,
|
|
107
|
+
* col style and default style, please use {@link getCellStyle} instead.
|
|
108
|
+
*
|
|
109
|
+
* @param {number} row The row index of the cell
|
|
110
|
+
* @param {number} col The column index of the cell
|
|
111
|
+
* @returns {IStyleData} The composed style of the cell
|
|
112
|
+
*/
|
|
113
|
+
getComposedCellStyle(row: number, col: number, rowPriority?: boolean): IStyleData;
|
|
113
114
|
/**
|
|
114
115
|
* Returns WorkSheet Cell Data Matrix
|
|
115
116
|
* @returns WorkSheet Cell Data Matrix
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Nullable } from '../../shared';
|
|
2
|
+
import { IParagraphStyle, ITextStyle, NamedStyleType } from '../interfaces';
|
|
1
3
|
import { BooleanNumber, HorizontalAlign, TextDirection, VerticalAlign, WrapStrategy } from '../enum';
|
|
2
4
|
/**
|
|
3
5
|
* Used as an illegal range array return value
|
|
@@ -146,3 +148,5 @@ export declare const DEFAULT_SLIDE: {
|
|
|
146
148
|
};
|
|
147
149
|
};
|
|
148
150
|
export declare const SHEET_EDITOR_UNITS: string[];
|
|
151
|
+
export declare const NAMED_STYLE_MAP: Record<NamedStyleType, Nullable<ITextStyle>>;
|
|
152
|
+
export declare const NAMED_STYLE_SPACE_MAP: Record<NamedStyleType, Nullable<IParagraphStyle>>;
|
|
@@ -585,8 +585,7 @@ export declare enum NamedStyleType {
|
|
|
585
585
|
HEADING_2 = 5,// Heading 2.
|
|
586
586
|
HEADING_3 = 6,// Heading 3.
|
|
587
587
|
HEADING_4 = 7,// Heading 4.
|
|
588
|
-
HEADING_5 = 8
|
|
589
|
-
HEADING_6 = 9
|
|
588
|
+
HEADING_5 = 8
|
|
590
589
|
}
|
|
591
590
|
export declare enum SpacingRule {
|
|
592
591
|
/**
|
|
@@ -750,8 +749,8 @@ export interface ITableCellMargin {
|
|
|
750
749
|
*/
|
|
751
750
|
export interface ITableCellBorder {
|
|
752
751
|
color: IColorStyle;
|
|
753
|
-
width
|
|
754
|
-
dashStyle
|
|
752
|
+
width?: INumberUnit;
|
|
753
|
+
dashStyle?: DashStyleType;
|
|
755
754
|
}
|
|
756
755
|
/**
|
|
757
756
|
* The content alignments for a Shape or TableCell. The supported alignments correspond to predefined text anchoring types from the ECMA-376 standard.
|