@univerjs/core 1.3.1 → 1.5.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.
- package/README.md +7 -5
- package/lib/cjs/facade.js +20 -35
- package/lib/cjs/index.js +448 -592
- package/lib/es/facade.js +20 -35
- package/lib/es/index.js +448 -593
- package/lib/facade.js +20 -35
- package/lib/index.js +448 -593
- package/lib/types/bases/typedef.d.ts +25 -25
- package/lib/types/common/interceptor.d.ts +6 -3
- package/lib/types/common/regexp/index.d.ts +4 -4
- package/lib/types/docs/data-model/paragraph-style.d.ts +5 -2
- package/lib/types/docs/data-model/preset-list-type.d.ts +8 -8
- package/lib/types/docs/data-model/rich-text-builder.d.ts +1 -1
- package/lib/types/docs/data-model/text-x/build-utils/custom-range.d.ts +1 -1
- package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +15 -13
- package/lib/types/docs/data-model/text-x/utils.d.ts +20 -20
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/lifecycle/lifecycle.d.ts +4 -4
- package/lib/types/services/resource-loader/type.d.ts +2 -2
- package/lib/types/services/user-manager/user-manager.service.d.ts +2 -2
- package/lib/types/shared/common.d.ts +1 -0
- package/lib/types/shared/r-tree.d.ts +3 -1
- package/lib/types/shared/sort-rules.d.ts +2 -2
- package/lib/types/sheets/sheet-skeleton.d.ts +12 -4
- package/lib/types/sheets/typedef.d.ts +8 -3
- package/lib/types/types/enum/sheet-types.d.ts +2 -1
- package/lib/types/types/interfaces/i-document-data.d.ts +1 -5
- package/lib/types/types/interfaces/i-drawing.d.ts +3 -1
- package/lib/types/types/interfaces/index.d.ts +0 -3
- package/lib/types/univer.d.ts +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +26 -26
- package/package.json +8 -8
- package/lib/types/slides/slide-data-model.d.ts +0 -27
- package/lib/types/types/enum/place-holder-type.d.ts +0 -34
- package/lib/types/types/interfaces/i-image-properties.d.ts +0 -34
- package/lib/types/types/interfaces/i-placeholder.d.ts +0 -21
- package/lib/types/types/interfaces/i-shape-properties.d.ts +0 -30
|
@@ -148,11 +148,11 @@ export type BaseDateHourCycle = 'h12' | 'h24';
|
|
|
148
148
|
/** Where a Base conditional color is painted when its condition matches. */
|
|
149
149
|
export declare const BaseConditionalColorTarget: {
|
|
150
150
|
/** Paint only the cell in the rule's field. */
|
|
151
|
-
readonly CELL:
|
|
151
|
+
readonly CELL: 'cell';
|
|
152
152
|
/** Paint the complete record row. */
|
|
153
|
-
readonly ROW:
|
|
153
|
+
readonly ROW: 'row';
|
|
154
154
|
/** Paint the rule's field column unconditionally; operator, operand, and date mode are ignored. */
|
|
155
|
-
readonly COLUMN:
|
|
155
|
+
readonly COLUMN: 'column';
|
|
156
156
|
};
|
|
157
157
|
export type BaseConditionalColorTarget = typeof BaseConditionalColorTarget[keyof typeof BaseConditionalColorTarget];
|
|
158
158
|
/**
|
|
@@ -164,16 +164,16 @@ export type BaseConditionalColorTarget = typeof BaseConditionalColorTarget[keyof
|
|
|
164
164
|
* before/after, and empty checks. Checkbox fields support equality only.
|
|
165
165
|
*/
|
|
166
166
|
export declare const BaseConditionalColorOperator: {
|
|
167
|
-
readonly IS:
|
|
168
|
-
readonly IS_NOT:
|
|
169
|
-
readonly CONTAINS:
|
|
170
|
-
readonly NOT_CONTAINS:
|
|
171
|
-
readonly IS_EMPTY:
|
|
172
|
-
readonly IS_NOT_EMPTY:
|
|
173
|
-
readonly GREATER_THAN:
|
|
174
|
-
readonly LESS_THAN:
|
|
175
|
-
readonly BEFORE:
|
|
176
|
-
readonly AFTER:
|
|
167
|
+
readonly IS: 'is';
|
|
168
|
+
readonly IS_NOT: 'isNot';
|
|
169
|
+
readonly CONTAINS: 'contains';
|
|
170
|
+
readonly NOT_CONTAINS: 'notContains';
|
|
171
|
+
readonly IS_EMPTY: 'isEmpty';
|
|
172
|
+
readonly IS_NOT_EMPTY: 'isNotEmpty';
|
|
173
|
+
readonly GREATER_THAN: 'greaterThan';
|
|
174
|
+
readonly LESS_THAN: 'lessThan';
|
|
175
|
+
readonly BEFORE: 'before';
|
|
176
|
+
readonly AFTER: 'after';
|
|
177
177
|
};
|
|
178
178
|
export type BaseConditionalColorOperator = typeof BaseConditionalColorOperator[keyof typeof BaseConditionalColorOperator];
|
|
179
179
|
/**
|
|
@@ -184,18 +184,18 @@ export type BaseConditionalColorOperator = typeof BaseConditionalColorOperator[k
|
|
|
184
184
|
* dates after its end. Relative windows do not use an operand; `EXACT` does.
|
|
185
185
|
*/
|
|
186
186
|
export declare const BaseConditionalDateMode: {
|
|
187
|
-
readonly EXACT:
|
|
188
|
-
readonly TODAY:
|
|
189
|
-
readonly TOMORROW:
|
|
190
|
-
readonly YESTERDAY:
|
|
191
|
-
readonly THIS_WEEK:
|
|
192
|
-
readonly LAST_WEEK:
|
|
193
|
-
readonly THIS_MONTH:
|
|
194
|
-
readonly LAST_MONTH:
|
|
195
|
-
readonly PAST_7_DAYS:
|
|
196
|
-
readonly NEXT_7_DAYS:
|
|
197
|
-
readonly PAST_30_DAYS:
|
|
198
|
-
readonly NEXT_30_DAYS:
|
|
187
|
+
readonly EXACT: 'exact';
|
|
188
|
+
readonly TODAY: 'today';
|
|
189
|
+
readonly TOMORROW: 'tomorrow';
|
|
190
|
+
readonly YESTERDAY: 'yesterday';
|
|
191
|
+
readonly THIS_WEEK: 'thisWeek';
|
|
192
|
+
readonly LAST_WEEK: 'lastWeek';
|
|
193
|
+
readonly THIS_MONTH: 'thisMonth';
|
|
194
|
+
readonly LAST_MONTH: 'lastMonth';
|
|
195
|
+
readonly PAST_7_DAYS: 'past7';
|
|
196
|
+
readonly NEXT_7_DAYS: 'next7';
|
|
197
|
+
readonly PAST_30_DAYS: 'past30';
|
|
198
|
+
readonly NEXT_30_DAYS: 'next30';
|
|
199
199
|
};
|
|
200
200
|
export type BaseConditionalDateMode = typeof BaseConditionalDateMode[keyof typeof BaseConditionalDateMode];
|
|
201
201
|
/**
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Nullable } from '../shared/types';
|
|
17
|
+
import { Disposable } from '../shared/lifecycle';
|
|
17
18
|
export type InterceptorHandler<M = unknown, C = unknown> = (value: Nullable<M>, context: C, next: (value: Nullable<M>) => Nullable<M>) => Nullable<M>;
|
|
18
19
|
export declare enum InterceptorEffectEnum {
|
|
19
20
|
Style = 1,// 1<< 0
|
|
@@ -38,7 +39,7 @@ export type IComposeInterceptors<T = any, C = any> = (interceptors: Array<IInter
|
|
|
38
39
|
* A helper to compose a certain type of interceptors.
|
|
39
40
|
*/
|
|
40
41
|
export declare const composeInterceptors: <T, C>(interceptors: Array<IInterceptor<T, C>>) => ReturnType<IComposeInterceptors<T, C>>;
|
|
41
|
-
export declare class InterceptorManager<P extends Record<string, IInterceptor<any, any>>> {
|
|
42
|
+
export declare class InterceptorManager<P extends Record<string, IInterceptor<any, any>>> extends Disposable {
|
|
42
43
|
private _interceptorsByName;
|
|
43
44
|
private _interceptorPoints;
|
|
44
45
|
constructor(interceptorPoints: P);
|
|
@@ -48,8 +49,9 @@ export declare class InterceptorManager<P extends Record<string, IInterceptor<an
|
|
|
48
49
|
* @param filter A callback function to filter the interceptors.
|
|
49
50
|
* @returns It will return a composed interceptor function. If you will perform the interceptor repeatedly,
|
|
50
51
|
* you should cache the result instead of calling this function multiple times.
|
|
52
|
+
* A cached chain cannot start a new call after this manager is disposed.
|
|
51
53
|
*/
|
|
52
|
-
fetchThroughInterceptors<T, C>(name: IInterceptor<T, C>, filter?: (interceptor: IInterceptor<any, any>) => boolean): (
|
|
54
|
+
fetchThroughInterceptors<T, C>(name: IInterceptor<T, C>, filter?: (interceptor: IInterceptor<any, any>) => boolean): (initialValue: Nullable<T>, context: C) => Nullable<T>;
|
|
53
55
|
intercept<T extends IInterceptor<any, any>>(name: T, interceptor: T): () => boolean;
|
|
54
56
|
getInterceptPoints(): P;
|
|
55
57
|
dispose(): void;
|
|
@@ -66,7 +68,7 @@ export interface IAsyncInterceptor<M, C> {
|
|
|
66
68
|
}
|
|
67
69
|
export type IComposeAsyncInterceptors<T = any, C = any> = (interceptors: Array<IAsyncInterceptor<T, C>>) => (initValue: Nullable<T>, initContext: C) => Promise<Nullable<T>>;
|
|
68
70
|
export declare const composeAsyncInterceptors: <T, C>(interceptors: Array<IAsyncInterceptor<T, C>>) => ((initialValue: Nullable<T>, context: C) => Promise<Nullable<T>>);
|
|
69
|
-
export declare class AsyncInterceptorManager<P extends Record<string, IAsyncInterceptor<any, any>>> {
|
|
71
|
+
export declare class AsyncInterceptorManager<P extends Record<string, IAsyncInterceptor<any, any>>> extends Disposable {
|
|
70
72
|
private _asyncInterceptorsByName;
|
|
71
73
|
private _asyncInterceptorPoints;
|
|
72
74
|
constructor(asyncInterceptorPoints: P);
|
|
@@ -76,6 +78,7 @@ export declare class AsyncInterceptorManager<P extends Record<string, IAsyncInte
|
|
|
76
78
|
* @param filter A callback function to filter the interceptors.
|
|
77
79
|
* @returns It will return a composed interceptor function. If you will perform the interceptor repeatedly,
|
|
78
80
|
* you should cache the result instead of calling this function multiple times.
|
|
81
|
+
* A cached chain cannot start a new call after this manager is disposed.
|
|
79
82
|
*/
|
|
80
83
|
fetchThroughAsyncInterceptors<T, C>(name: IAsyncInterceptor<T, C>, filter?: (interceptor: IAsyncInterceptor<any, any>) => boolean): (initialValue: Nullable<T>, context: C) => Promise<Nullable<T>>;
|
|
81
84
|
interceptAsync<T extends IAsyncInterceptor<any, any>>(name: T, interceptor: T): Promise<() => boolean>;
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Charset } from './charset';
|
|
16
|
+
import { Charset, charset } from './charset';
|
|
17
17
|
import { createFromWildcard, createLiteralRegExp, escapeRegExp } from './escape';
|
|
18
18
|
import { createRegExpFromSafeFragment } from './factory';
|
|
19
|
-
import { Or } from './or';
|
|
19
|
+
import { Or, or } from './or';
|
|
20
20
|
/**
|
|
21
21
|
* Namespace-style public API for regex helpers.
|
|
22
22
|
*
|
|
@@ -28,8 +28,8 @@ import { Or } from './or';
|
|
|
28
28
|
export declare const regexp: {
|
|
29
29
|
Charset: typeof Charset;
|
|
30
30
|
Or: typeof Or;
|
|
31
|
-
charset:
|
|
32
|
-
or:
|
|
31
|
+
charset: typeof charset;
|
|
32
|
+
or: typeof or;
|
|
33
33
|
createRegExpFromSafeFragment: typeof createRegExpFromSafeFragment;
|
|
34
34
|
escapeRegExp: typeof escapeRegExp;
|
|
35
35
|
createLiteralRegExp: typeof createLiteralRegExp;
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { Nullable } from '../../shared';
|
|
17
|
-
import type { IDocStyles, IDocumentStyle, IParagraphStyle } from '../../types/interfaces';
|
|
16
|
+
import type { Nullable } from '../../shared/types';
|
|
17
|
+
import type { IDocStyles, IDocumentData, IDocumentStyle, IParagraph, IParagraphStyle } from '../../types/interfaces/i-document-data';
|
|
18
|
+
import { BooleanNumber } from '../../types/enum/text-style';
|
|
18
19
|
export interface IResolveDocumentParagraphStyleOptions {
|
|
19
20
|
/** Exclude document-level outer spacing while retaining all other defaults. */
|
|
20
21
|
excludeDocumentOuterSpacing?: boolean;
|
|
@@ -26,3 +27,5 @@ export interface IResolveDocumentParagraphStyleOptions {
|
|
|
26
27
|
paragraphStyleId?: string;
|
|
27
28
|
}
|
|
28
29
|
export declare function resolveDocumentParagraphStyle(documentStyle: Nullable<IDocumentStyle>, paragraphStyle: Nullable<IParagraphStyle>, options?: IResolveDocumentParagraphStyleOptions): IParagraphStyle;
|
|
30
|
+
/** Resolves word splitting without materializing inherited defaults in the snapshot. */
|
|
31
|
+
export declare function resolveDocumentParagraphWordWrap(document: IDocumentData, paragraph?: IParagraph): BooleanNumber;
|
|
@@ -78,12 +78,12 @@ export declare enum PresetListType {
|
|
|
78
78
|
}
|
|
79
79
|
export declare const PRESET_LIST_TYPE: Record<string, IListData>;
|
|
80
80
|
export declare const QuickListTypeMap: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
[QuickListType.ORDER_LIST_QUICK_1]: PresetListType;
|
|
82
|
+
[QuickListType.ORDER_LIST_QUICK_2]: PresetListType;
|
|
83
|
+
[QuickListType.ORDER_LIST_QUICK_3]: PresetListType;
|
|
84
|
+
[QuickListType.ORDER_LIST_QUICK_4]: PresetListType;
|
|
85
|
+
[QuickListType.ORDER_LIST_QUICK_5]: PresetListType;
|
|
86
|
+
[QuickListType.ORDER_LIST_QUICK_6]: PresetListType;
|
|
87
|
+
[QuickListType.ORDER_LIST_QUICK_7]: PresetListType;
|
|
88
|
+
[QuickListType.BULLET_LIST]: PresetListType;
|
|
89
89
|
};
|
|
@@ -1346,10 +1346,10 @@ export declare class RichTextValue {
|
|
|
1346
1346
|
* ```
|
|
1347
1347
|
*/
|
|
1348
1348
|
getTextRuns(): {
|
|
1349
|
-
ts: TextStyleValue | null;
|
|
1350
1349
|
st: number;
|
|
1351
1350
|
ed: number;
|
|
1352
1351
|
sId?: string;
|
|
1352
|
+
ts: TextStyleValue | null;
|
|
1353
1353
|
}[];
|
|
1354
1354
|
/**
|
|
1355
1355
|
* Gets the links of the current RichTextValue instance
|
|
@@ -26,12 +26,12 @@ import type { CustomRangeType, ICustomRange, IDocumentBody } from '../../../../t
|
|
|
26
26
|
export declare function isIntersecting(line1Start: number, line1End: number, line2Start: number, line2End: number): boolean;
|
|
27
27
|
export declare function getCustomRangesInterestsWithSelection(range: ITextRange, customRanges: ICustomRange[]): ICustomRange<Record<string, any>>[];
|
|
28
28
|
export declare function copyCustomRange(range: ICustomRange): {
|
|
29
|
-
rangeId: string;
|
|
30
29
|
startIndex: number;
|
|
31
30
|
endIndex: number;
|
|
32
31
|
rangeType: CustomRangeType | number;
|
|
33
32
|
wholeEntity?: boolean;
|
|
34
33
|
properties?: Record<string, any> | undefined;
|
|
34
|
+
rangeId: string;
|
|
35
35
|
};
|
|
36
36
|
export declare function excludePointsFromRange(range: [number, number], points: number[]): [number, number][];
|
|
37
37
|
export declare function getIntersectingCustomRanges(startIndex: number, endIndex: number, customRanges: ICustomRange[], rangeType?: CustomRangeType): {
|
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { addCustomDecorationTextX, deleteCustomDecorationTextX } from './custom-decoration';
|
|
17
17
|
import { copyCustomRange, getCustomRangesInterestsWithSelection, isIntersecting } from './custom-range';
|
|
18
|
-
import { removeDrawingReferences } from './drawings';
|
|
18
|
+
import { addDrawing, removeDrawingReferences } from './drawings';
|
|
19
|
+
import { changeParagraphBulletNestLevel, setParagraphBullet, setParagraphStyle, switchParagraphBullet, toggleChecklistParagraph } from './paragraph';
|
|
20
|
+
import { fromPlainText, getPlainText, isEmptyDocument } from './parse';
|
|
19
21
|
import { getParagraphsInRange, getParagraphsInRanges, isSegmentIntersects, makeSelection, normalizeSelection, transformParagraphs } from './selection';
|
|
20
|
-
import { addCustomRangeTextX, deleteCustomRangeTextX, deleteSelectionTextX, retainSelectionTextX } from './text-x-utils';
|
|
22
|
+
import { addCustomRangeTextX, deleteCustomRangeTextX, deleteSelectionTextX, replaceSelectionTextRuns, replaceSelectionTextX, retainSelectionTextX } from './text-x-utils';
|
|
21
23
|
export declare class BuildTextUtils {
|
|
22
24
|
static customRange: {
|
|
23
25
|
add: typeof addCustomRangeTextX;
|
|
@@ -31,11 +33,11 @@ export declare class BuildTextUtils {
|
|
|
31
33
|
delete: typeof deleteCustomDecorationTextX;
|
|
32
34
|
};
|
|
33
35
|
static selection: {
|
|
34
|
-
replace:
|
|
36
|
+
replace: typeof replaceSelectionTextX;
|
|
35
37
|
makeSelection: typeof makeSelection;
|
|
36
38
|
normalizeSelection: typeof normalizeSelection;
|
|
37
39
|
delete: typeof deleteSelectionTextX;
|
|
38
|
-
replaceTextRuns:
|
|
40
|
+
replaceTextRuns: typeof replaceSelectionTextRuns;
|
|
39
41
|
retain: typeof retainSelectionTextX;
|
|
40
42
|
};
|
|
41
43
|
static range: {
|
|
@@ -44,19 +46,19 @@ export declare class BuildTextUtils {
|
|
|
44
46
|
getParagraphsInRanges: typeof getParagraphsInRanges;
|
|
45
47
|
};
|
|
46
48
|
static transform: {
|
|
47
|
-
getPlainText:
|
|
48
|
-
fromPlainText:
|
|
49
|
-
isEmptyDocument:
|
|
49
|
+
getPlainText: typeof getPlainText;
|
|
50
|
+
fromPlainText: typeof fromPlainText;
|
|
51
|
+
isEmptyDocument: typeof isEmptyDocument;
|
|
50
52
|
};
|
|
51
53
|
static paragraph: {
|
|
52
54
|
bullet: {
|
|
53
|
-
set:
|
|
54
|
-
switch:
|
|
55
|
-
toggleChecklist:
|
|
56
|
-
changeNestLevel:
|
|
55
|
+
set: typeof setParagraphBullet;
|
|
56
|
+
switch: typeof switchParagraphBullet;
|
|
57
|
+
toggleChecklist: typeof toggleChecklistParagraph;
|
|
58
|
+
changeNestLevel: typeof changeParagraphBulletNestLevel;
|
|
57
59
|
};
|
|
58
60
|
style: {
|
|
59
|
-
set:
|
|
61
|
+
set: typeof setParagraphStyle;
|
|
60
62
|
};
|
|
61
63
|
util: {
|
|
62
64
|
transform: typeof transformParagraphs;
|
|
@@ -65,7 +67,7 @@ export declare class BuildTextUtils {
|
|
|
65
67
|
};
|
|
66
68
|
};
|
|
67
69
|
static drawing: {
|
|
68
|
-
add:
|
|
70
|
+
add: typeof addDrawing;
|
|
69
71
|
remove: typeof removeDrawingReferences;
|
|
70
72
|
};
|
|
71
73
|
}
|
|
@@ -29,14 +29,13 @@ export declare enum SliceStructuralRangeMode {
|
|
|
29
29
|
}
|
|
30
30
|
export declare function getTextRunSlice(body: IDocumentBody, startOffset: number, endOffset: number, returnEmptyTextRuns?: boolean): ITextRun[] | undefined;
|
|
31
31
|
export declare function getTableSlice(body: IDocumentBody, startOffset: number, endOffset: number, mode?: SliceStructuralRangeMode): {
|
|
32
|
+
tableId: string;
|
|
32
33
|
startIndex: number;
|
|
33
34
|
endIndex: number;
|
|
34
|
-
tableId: string;
|
|
35
35
|
}[];
|
|
36
36
|
export declare function getBlockRangeSlice(body: IDocumentBody, startOffset: number, endOffset: number, mode?: SliceStructuralRangeMode): IDocumentBlockRange[];
|
|
37
37
|
export declare function getColumnGroupSlice(body: IDocumentBody, startOffset: number, endOffset: number, mode?: SliceStructuralRangeMode): ICustomColumnGroup[];
|
|
38
38
|
export declare function getParagraphsSlice(body: IDocumentBody, startOffset: number, endOffset: number, type?: SliceBodyType): {
|
|
39
|
-
startIndex: number;
|
|
40
39
|
paragraphId: string;
|
|
41
40
|
headingCollapsed?: boolean;
|
|
42
41
|
styleId?: string;
|
|
@@ -44,10 +43,21 @@ export declare function getParagraphsSlice(body: IDocumentBody, startOffset: num
|
|
|
44
43
|
bullet?: import("../../..").IBullet;
|
|
45
44
|
sourceBullet?: import("../../..").IBullet | null;
|
|
46
45
|
directBullet?: import("../../..").IBullet | null;
|
|
46
|
+
startIndex: number;
|
|
47
47
|
}[] | undefined;
|
|
48
48
|
export declare function getSectionBreakSlice(body: IDocumentBody, startOffset: number, endOffset: number): {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
marginTop?: number;
|
|
50
|
+
marginBottom?: number;
|
|
51
|
+
marginRight?: number;
|
|
52
|
+
marginLeft?: number;
|
|
53
|
+
defaultHeaderId?: string;
|
|
54
|
+
defaultFooterId?: string;
|
|
55
|
+
evenPageHeaderId?: string;
|
|
56
|
+
evenPageFooterId?: string;
|
|
57
|
+
firstPageHeaderId?: string;
|
|
58
|
+
firstPageFooterId?: string;
|
|
59
|
+
useFirstPageHeaderFooter?: import("../../..").BooleanNumber;
|
|
60
|
+
evenAndOddHeaders?: import("../../..").BooleanNumber;
|
|
51
61
|
pageBorders?: import("../../..").IPageBorders;
|
|
52
62
|
pageNumberStart?: number;
|
|
53
63
|
pageSize?: import("../../..").ISize;
|
|
@@ -56,10 +66,6 @@ export declare function getSectionBreakSlice(body: IDocumentBody, startOffset: n
|
|
|
56
66
|
marginHeader?: number;
|
|
57
67
|
marginFooter?: number;
|
|
58
68
|
renderConfig?: import("../../..").IDocumentRenderConfig;
|
|
59
|
-
marginTop?: number;
|
|
60
|
-
marginBottom?: number;
|
|
61
|
-
marginRight?: number;
|
|
62
|
-
marginLeft?: number;
|
|
63
69
|
noteProperties?: import("../../..").INoteProperties;
|
|
64
70
|
suppressEndnotes?: boolean;
|
|
65
71
|
charSpace?: number;
|
|
@@ -71,23 +77,17 @@ export declare function getSectionBreakSlice(body: IDocumentBody, startOffset: n
|
|
|
71
77
|
sectionType?: import("../../..").SectionType;
|
|
72
78
|
sectionTypeNext?: import("../../..").SectionType;
|
|
73
79
|
textDirection?: import("../../..").TextDirectionType;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
evenPageHeaderId?: string;
|
|
77
|
-
evenPageFooterId?: string;
|
|
78
|
-
firstPageHeaderId?: string;
|
|
79
|
-
firstPageFooterId?: string;
|
|
80
|
-
useFirstPageHeaderFooter?: import("../../..").BooleanNumber;
|
|
81
|
-
evenAndOddHeaders?: import("../../..").BooleanNumber;
|
|
80
|
+
sectionId: string;
|
|
81
|
+
startIndex: number;
|
|
82
82
|
}[] | undefined;
|
|
83
83
|
export declare function getCustomBlockSlice(body: IDocumentBody, startOffset: number, endOffset: number): {
|
|
84
|
-
startIndex: number;
|
|
85
84
|
blockType?: import("../../..").BlockType;
|
|
86
85
|
blockId: string;
|
|
87
|
-
noteType?:
|
|
86
|
+
noteType?: 'footnote' | 'endnote' | 'separator' | 'continuationSeparator';
|
|
88
87
|
noteId?: string;
|
|
89
88
|
docxRawXml?: string;
|
|
90
89
|
docxExportTs?: import("../../..").ITextStyle;
|
|
90
|
+
startIndex: number;
|
|
91
91
|
}[] | undefined;
|
|
92
92
|
export declare function getBodySlice(body: IDocumentBody, startOffset: number, endOffset: number, returnEmptyArray?: boolean, type?: SliceBodyType, structuralRangeMode?: SliceStructuralRangeMode): IDocumentBody;
|
|
93
93
|
export declare function getBodySliceForTextXAction(body: IDocumentBody, startOffset: number, endOffset: number, returnEmptyArray?: boolean, type?: SliceBodyType): IDocumentBody;
|
|
@@ -99,12 +99,12 @@ export declare function getCustomRangeSlice(body: IDocumentBody, startOffset: nu
|
|
|
99
99
|
rightOffset?: undefined;
|
|
100
100
|
} | {
|
|
101
101
|
customRanges: {
|
|
102
|
-
startIndex: number;
|
|
103
|
-
endIndex: number;
|
|
104
102
|
rangeId: string;
|
|
105
103
|
rangeType: CustomRangeType | number;
|
|
106
104
|
wholeEntity?: boolean;
|
|
107
105
|
properties?: Record<string, any> | undefined;
|
|
106
|
+
startIndex: number;
|
|
107
|
+
endIndex: number;
|
|
108
108
|
}[];
|
|
109
109
|
leftOffset: number;
|
|
110
110
|
rightOffset: number;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export { mergeSets } from './common/set';
|
|
|
42
42
|
export { UnitModel, UniverInstanceType } from './common/unit';
|
|
43
43
|
export { isSafeUrl, normalizeUrl, resolveWithBasePath } from './common/url';
|
|
44
44
|
export * from './docs';
|
|
45
|
+
export { resolveDocumentParagraphWordWrap } from './docs/data-model/paragraph-style';
|
|
45
46
|
export { getSdtBindingKey, getSdtBindingValue } from './docs/sdt-binding';
|
|
46
47
|
export { EventState, EventSubject, fromEventSubject } from './observer/observable';
|
|
47
48
|
export type { IEventObserver } from './observer/observable';
|
|
@@ -36,8 +36,8 @@ export declare enum LifecycleStages {
|
|
|
36
36
|
Steady = 3
|
|
37
37
|
}
|
|
38
38
|
export declare const LifecycleNameMap: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
[LifecycleStages.Starting]: string;
|
|
40
|
+
[LifecycleStages.Ready]: string;
|
|
41
|
+
[LifecycleStages.Rendered]: string;
|
|
42
|
+
[LifecycleStages.Steady]: string;
|
|
43
43
|
};
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import type { IResources } from '../resource-manager/type';
|
|
17
17
|
export declare const IResourceLoaderService: import("@wendellhu/redi").IdentifierDecorator<IResourceLoaderService>;
|
|
18
18
|
export interface IResourceLoaderService {
|
|
19
|
-
saveUnit<T = object>(unitId: string): T & {
|
|
19
|
+
saveUnit<T = object>(unitId: string): (T & {
|
|
20
20
|
resources: IResources;
|
|
21
|
-
} | null;
|
|
21
|
+
}) | null;
|
|
22
22
|
}
|
|
@@ -23,10 +23,10 @@ export declare class UserManagerService extends Disposable {
|
|
|
23
23
|
private _model;
|
|
24
24
|
private _userChange$;
|
|
25
25
|
userChange$: import("rxjs").Observable<{
|
|
26
|
-
type:
|
|
26
|
+
type: 'add' | 'delete';
|
|
27
27
|
user: IUser;
|
|
28
28
|
} | {
|
|
29
|
-
type:
|
|
29
|
+
type: 'clear';
|
|
30
30
|
}>;
|
|
31
31
|
private _currentUser$;
|
|
32
32
|
/**
|
|
@@ -59,6 +59,7 @@ export declare function isValidRange(range: IRange, worksheet?: Worksheet): bool
|
|
|
59
59
|
export declare function cellToRange(row: number, col: number): IRange;
|
|
60
60
|
/**
|
|
61
61
|
* Covert cell value to cell data.
|
|
62
|
+
* A formula or content value also clears the shared formula id of the cell it replaces.
|
|
62
63
|
* @param {CellValue | ICellData} value - The cell value.
|
|
63
64
|
* @returns {ICellData} The cell data.
|
|
64
65
|
*/
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { BBox } from 'rbush';
|
|
17
|
-
import type { IUnitRange } from '../sheets/typedef';
|
|
18
17
|
import RBush from 'rbush';
|
|
18
|
+
import type { IUnitRange } from '../sheets/typedef';
|
|
19
19
|
type StringOrNumber = string | number;
|
|
20
20
|
export interface IRTreeItem extends IUnitRange {
|
|
21
21
|
id: StringOrNumber;
|
|
@@ -56,6 +56,8 @@ export declare class RTree {
|
|
|
56
56
|
private _removeRTreeItem;
|
|
57
57
|
remove(search: IRTreeItem): void;
|
|
58
58
|
bulkRemove(searchList: IRTreeItem[]): void;
|
|
59
|
+
private _bulkRemoveFromSheet;
|
|
60
|
+
private _removeSparseRanges;
|
|
59
61
|
clear(): void;
|
|
60
62
|
toJSON(): IRTreeData;
|
|
61
63
|
fromJSON(data: IRTreeData): void;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare function sortRules(oa: any, ob: any):
|
|
17
|
-
export declare function sortRulesByDesc(oa: any, ob: any):
|
|
16
|
+
export declare function sortRules(oa: any, ob: any): -1 | 0 | 1;
|
|
17
|
+
export declare function sortRulesByDesc(oa: any, ob: any): -1 | 0 | 1;
|
|
18
18
|
/**
|
|
19
19
|
*
|
|
20
20
|
* @param key compare key
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IObjectArrayPrimitiveType
|
|
17
|
-
import type {
|
|
16
|
+
import type { IObjectArrayPrimitiveType } from '../shared/object-matrix';
|
|
17
|
+
import type { Nullable } from '../shared/types';
|
|
18
|
+
import type { IDocumentData, IDocumentRenderConfig } from '../types/interfaces/i-document-data';
|
|
19
|
+
import type { IPaddingData } from '../types/interfaces/i-style-data';
|
|
18
20
|
import type { Styles } from './styles';
|
|
19
21
|
import type { ICellData, ICellInfo, ICellWithCoord, IPosition, IRange, ISelectionCell, IWorksheetData } from './typedef';
|
|
20
22
|
import type { Worksheet } from './worksheet';
|
|
@@ -23,10 +25,10 @@ import { DocumentDataModel } from '../docs/data-model/document-data-model';
|
|
|
23
25
|
import { IConfigService } from '../services/config/config.service';
|
|
24
26
|
import { IContextService } from '../services/context/context.service';
|
|
25
27
|
import { LocaleService } from '../services/locale/locale.service';
|
|
26
|
-
import { ObjectMatrix } from '../shared';
|
|
27
28
|
import { ImageCacheMap } from '../shared/cache/image-cache';
|
|
29
|
+
import { ObjectMatrix } from '../shared/object-matrix';
|
|
28
30
|
import { Skeleton } from '../skeleton';
|
|
29
|
-
import { HorizontalAlign } from '../types/enum';
|
|
31
|
+
import { HorizontalAlign } from '../types/enum/text-style';
|
|
30
32
|
/**
|
|
31
33
|
* Configuration for a single gap (visual separator between rows or columns).
|
|
32
34
|
* The gap area is rendered with a background color and diagonal stripes.
|
|
@@ -258,6 +260,8 @@ export declare class SheetSkeleton extends Skeleton {
|
|
|
258
260
|
* @param scaleX render scene scale x-axis, scene.getAncestorScale
|
|
259
261
|
* @param scaleY render scene scale y-axis, scene.getAncestorScale
|
|
260
262
|
* @param scrollXY render viewportScroll {x, y}
|
|
263
|
+
* @param scrollXY.x horizontal scroll offset
|
|
264
|
+
* @param scrollXY.y vertical scroll offset
|
|
261
265
|
* @param options {IGetRowColByPosOptions}
|
|
262
266
|
* @returns {ICellWithCoord} Selection data with coordinates
|
|
263
267
|
*/
|
|
@@ -326,6 +330,8 @@ export declare function getCellWithCoordByIndexCore(row: number, column: number,
|
|
|
326
330
|
* @param offsetX Offset value from PointerEvent in canvas element.
|
|
327
331
|
* @param scaleX from scene.getAncestorScale
|
|
328
332
|
* @param scrollXY Scroll value of viewport
|
|
333
|
+
* @param scrollXY.x horizontal scroll offset
|
|
334
|
+
* @param scrollXY.y vertical scroll offset
|
|
329
335
|
* @returns {number} x in sheet coordinate.
|
|
330
336
|
*/
|
|
331
337
|
export declare function getTransformOffsetX(offsetX: number, scaleX: number, scrollXY: {
|
|
@@ -336,6 +342,8 @@ export declare function getTransformOffsetX(offsetX: number, scaleX: number, scr
|
|
|
336
342
|
* @param offsetY
|
|
337
343
|
* @param scaleY
|
|
338
344
|
* @param scrollXY
|
|
345
|
+
* @param scrollXY.x horizontal scroll offset
|
|
346
|
+
* @param scrollXY.y vertical scroll offset
|
|
339
347
|
*/
|
|
340
348
|
export declare function getTransformOffsetY(offsetY: number, scaleY: number, scrollXY: {
|
|
341
349
|
x: number;
|
|
@@ -16,14 +16,15 @@
|
|
|
16
16
|
import type { ImageSourceType } from '../services/image-io/image-io.service';
|
|
17
17
|
import type { IResources } from '../services/resource-manager/type';
|
|
18
18
|
import type { IObjectArrayPrimitiveType, IObjectMatrixPrimitiveType, Nullable } from '../shared';
|
|
19
|
-
import type { BooleanNumber } from '../types/enum';
|
|
20
19
|
import type { DateSystem } from '../types/enum/date-system';
|
|
21
20
|
import type { LocaleType } from '../types/enum/locale-type';
|
|
22
|
-
import type {
|
|
21
|
+
import type { SheetTypes } from '../types/enum/sheet-types';
|
|
22
|
+
import type { BooleanNumber } from '../types/enum/text-style';
|
|
23
23
|
import type { ICellCustomRender } from '../types/interfaces/i-cell-custom-render';
|
|
24
|
+
import type { IDocumentData } from '../types/interfaces/i-document-data';
|
|
24
25
|
import type { IStyleData } from '../types/interfaces/i-style-data';
|
|
25
26
|
import type { IWorkbookCalculationSettings } from './calculation-settings';
|
|
26
|
-
import { CellValueType } from '../types/enum';
|
|
27
|
+
import { CellValueType } from '../types/enum/text-style';
|
|
27
28
|
/**
|
|
28
29
|
* Snapshot of a workbook.
|
|
29
30
|
*/
|
|
@@ -106,6 +107,8 @@ export interface IWorksheetBackgroundImage {
|
|
|
106
107
|
* Snapshot of a worksheet.
|
|
107
108
|
*/
|
|
108
109
|
export interface IWorksheetData {
|
|
110
|
+
/** Sheet kind. Historical snapshots without this field use SheetTypes.GRID. */
|
|
111
|
+
type?: SheetTypes;
|
|
109
112
|
/**
|
|
110
113
|
* Id of the worksheet. This should be unique and immutable across the lifecycle of the worksheet.
|
|
111
114
|
*/
|
|
@@ -124,6 +127,8 @@ export interface IWorksheetData {
|
|
|
124
127
|
rowCount: number;
|
|
125
128
|
columnCount: number;
|
|
126
129
|
zoomRatio: number;
|
|
130
|
+
/** CHART view mode: omitted historical snapshots use fixed zoom; TRUE continuously fits the primary chart. */
|
|
131
|
+
zoomToFit?: BooleanNumber;
|
|
127
132
|
scrollTop: number;
|
|
128
133
|
scrollLeft: number;
|
|
129
134
|
defaultColumnWidth: number;
|
|
@@ -902,11 +902,6 @@ export interface IDocDrawingPosition {
|
|
|
902
902
|
/** Vertical flip persisted with the document drawing transform. */
|
|
903
903
|
flipY?: boolean;
|
|
904
904
|
}
|
|
905
|
-
/**
|
|
906
|
-
* ChartProperties
|
|
907
|
-
*/
|
|
908
|
-
export interface IChartProperties {
|
|
909
|
-
}
|
|
910
905
|
/**
|
|
911
906
|
* Properties of text style
|
|
912
907
|
*/
|
|
@@ -1086,6 +1081,7 @@ export interface IParagraphProperties extends IIndentStart {
|
|
|
1086
1081
|
* OOXML: 17.3.1.23 `pageBreakBefore`.
|
|
1087
1082
|
*/
|
|
1088
1083
|
pageBreakBefore?: BooleanNumber;
|
|
1084
|
+
/** Allow words to split across lines. Absent inherits; DOCX w:wordWrap uses the inverse value. */
|
|
1089
1085
|
wordWrap?: BooleanNumber;
|
|
1090
1086
|
/**
|
|
1091
1087
|
* Avoids leaving a single measured first or last line on a separate page
|
|
@@ -92,7 +92,9 @@ export declare enum DrawingTypeEnum {
|
|
|
92
92
|
/**
|
|
93
93
|
* Spreadsheet Timeline control.
|
|
94
94
|
*/
|
|
95
|
-
DRAWING_TIMELINE = 11
|
|
95
|
+
DRAWING_TIMELINE = 11,
|
|
96
|
+
/** Independent Office attachment; its preview image is separate from its original file. */
|
|
97
|
+
DRAWING_OLE = 12
|
|
96
98
|
}
|
|
97
99
|
export type DrawingType = DrawingTypeEnum | number;
|
|
98
100
|
export interface IDrawingSpace {
|
|
@@ -16,9 +16,6 @@
|
|
|
16
16
|
export * from './i-document-data';
|
|
17
17
|
export * from './i-document-data-interceptor';
|
|
18
18
|
export * from './i-drawing';
|
|
19
|
-
export * from './i-image-properties';
|
|
20
19
|
export * from './i-mention';
|
|
21
20
|
export * from './i-need-check-disposable';
|
|
22
|
-
export * from './i-placeholder';
|
|
23
|
-
export * from './i-shape-properties';
|
|
24
21
|
export * from './i-style-data';
|
package/lib/types/univer.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type { UnitModel } from './common/unit';
|
|
|
19
19
|
import type { LogLevel } from './services/log/log.service';
|
|
20
20
|
import type { DependencyOverride } from './services/plugin/plugin-override';
|
|
21
21
|
import type { Plugin, PluginCtor } from './services/plugin/plugin.service';
|
|
22
|
-
import type { ILocales } from './shared';
|
|
22
|
+
import type { ILocales } from './shared/locale';
|
|
23
23
|
import type { LocaleType } from './types/enum/locale-type';
|
|
24
24
|
import { Injector } from './common/di';
|
|
25
25
|
import { UniverInstanceType } from './common/unit';
|