@univerjs/core 1.0.0-alpha.6 → 1.0.0-alpha.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/facade.js +6 -138
- package/lib/cjs/index.js +379 -510
- package/lib/es/facade.js +8 -134
- package/lib/es/index.js +372 -508
- package/lib/facade.js +8 -134
- package/lib/index.js +372 -508
- package/lib/types/bases/index.d.ts +1 -1
- package/lib/types/bases/typedef.d.ts +31 -0
- package/lib/types/docs/data-model/paragraph-style.d.ts +7 -1
- package/lib/types/docs/data-model/rich-text-builder.d.ts +11 -1
- package/lib/types/docs/data-model/text-x/build-utils/data-stream-change.d.ts +3 -3
- package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +1 -1
- package/lib/types/docs/data-model/text-x/utils.d.ts +1 -0
- package/lib/types/docs/data-model/types.d.ts +0 -2
- package/lib/types/facade/f-univer.d.ts +1 -22
- package/lib/types/facade/index.d.ts +0 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/context/context.d.ts +1 -2
- package/lib/types/services/instance/instance.service.d.ts +0 -8
- package/lib/types/services/region/region.service.d.ts +28 -0
- package/lib/types/shared/common.d.ts +0 -5
- package/lib/types/shared/object-matrix.d.ts +0 -14
- package/lib/types/shared/rectangle.d.ts +0 -15
- package/lib/types/shared/tools.d.ts +0 -2
- package/lib/types/sheets/sheet-skeleton.d.ts +2 -6
- package/lib/types/sheets/typedef.d.ts +0 -14
- package/lib/types/sheets/workbook.d.ts +0 -2
- package/lib/types/sheets/worksheet.d.ts +0 -6
- package/lib/types/types/const/page-size.d.ts +2 -0
- package/lib/types/types/enum/theme-color-type.d.ts +0 -4
- package/lib/types/types/interfaces/i-cell-custom-render.d.ts +0 -2
- package/lib/types/types/interfaces/i-document-data-interceptor.d.ts +2 -0
- package/lib/types/types/interfaces/i-document-data.d.ts +93 -12
- package/lib/types/types/interfaces/i-style-data.d.ts +43 -0
- package/lib/types/univer.d.ts +5 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +21 -21
- package/package.json +4 -4
- package/lib/types/facade/f-hooks.d.ts +0 -74
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
export { BaseDataModel } from './base-data-model';
|
|
17
17
|
export { createDefaultBaseTableSnapshot, getEmptySnapshot as getBasesEmptySnapshot, type ICreateDefaultBaseTableSnapshotOptions, } from './empty-snapshot';
|
|
18
18
|
export { BaseFieldType, BaseFilterConjunction, BaseFilterOperator, BaseSortDirection, BaseViewType } from './typedef';
|
|
19
|
-
export type { BaseCellMatrix, BaseCellPrimitiveValue, CellValue as BaseCellValue, BaseCellValueType, BaseHitTestResult, BaseId, PrimitiveCellValue as BasePrimitiveCellValue, BaseSelection, BaseSnapshot, BaseViewProjection, FieldConfig, FieldId, FieldSnapshot, IBaseCellData, IBaseInvalidation, IBaseRect, IBaseResources, IBaseSnapshot, IBaseViewColorCondition, IBaseViewport, ICalendarEventResizeSelection, ICalendarEventSelection, ICalendarProjection, ICalendarViewConfig, ICardLayoutConfig, IFieldCapabilities, IFieldSnapshot, IFilterCondition, IFilterConfig, IGalleryCardSelection, IGalleryProjection, IGalleryViewConfig, IGanttBarSelection, IGanttCellSelection, IGanttProjection, IGanttTimeColumn, IGanttViewConfig, IGridCellSelection, IGridFieldSelection, IGridGroupSelection, IGridProjection, IGridRecordSelection, IGridViewConfig, IGroupConfig, IInvalidViewProjection, IKanbanCardSelection, IKanbanColumnSetting, IKanbanFieldCardSetting, IKanbanProjection, IKanbanViewConfig, IProjectedField, IProjectedGroup, IProjectedRow, IRecordSnapshot, ISortConfig, ITableSnapshot, IValidationResult, IViewFieldSetting, IViewProjection, IViewSnapshot, KanbanCardLayoutMode, RecordId, RecordSnapshot, TableId, TableSnapshot, ViewId, ViewSnapshot, ViewSpecificConfig, } from './typedef';
|
|
19
|
+
export type { BaseCellMatrix, BaseCellPrimitiveValue, CellValue as BaseCellValue, BaseCellValueType, BaseHitTestResult, BaseId, PrimitiveCellValue as BasePrimitiveCellValue, BaseSelection, BaseSnapshot, BaseViewProjection, FieldConfig, FieldId, FieldSnapshot, IBaseAttachment, IBaseCellData, IBaseInvalidation, IBaseRect, IBaseResources, IBaseSnapshot, IBaseViewColorCondition, IBaseViewport, ICalendarEventResizeSelection, ICalendarEventSelection, ICalendarProjection, ICalendarViewConfig, ICardLayoutConfig, IFieldCapabilities, IFieldSnapshot, IFilterCondition, IFilterConfig, IGalleryCardSelection, IGalleryProjection, IGalleryViewConfig, IGanttBarSelection, IGanttCellSelection, IGanttProjection, IGanttTimeColumn, IGanttViewConfig, IGridCellSelection, IGridFieldSelection, IGridGroupSelection, IGridProjection, IGridRecordSelection, IGridViewConfig, IGroupConfig, IInvalidViewProjection, IKanbanCardSelection, IKanbanColumnSetting, IKanbanFieldCardSetting, IKanbanProjection, IKanbanViewConfig, IProjectedField, IProjectedGroup, IProjectedRow, IRecordSnapshot, ISortConfig, ITableSnapshot, IValidationResult, IViewFieldSetting, IViewProjection, IViewSnapshot, KanbanCardLayoutMode, RecordId, RecordSnapshot, TableId, TableSnapshot, ViewId, ViewSnapshot, ViewSpecificConfig, } from './typedef';
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { ImageSourceType } from '../services/image-io/image-io.service';
|
|
17
|
+
import type { IResources } from '../services/resource-manager/type';
|
|
16
18
|
import type { CellValueType, LocaleType } from '../types/enum';
|
|
17
19
|
import type { IDocumentData } from '../types/interfaces';
|
|
18
20
|
export type BaseId = string;
|
|
@@ -38,6 +40,26 @@ export interface IBaseResources {
|
|
|
38
40
|
attachmentSets?: Record<string, string[]>;
|
|
39
41
|
attachments?: Record<string, Record<string, unknown>>;
|
|
40
42
|
}
|
|
43
|
+
export interface IBaseAttachment {
|
|
44
|
+
/** Stable attachment identifier. Use the uploaded file id for remote attachments. */
|
|
45
|
+
id: string;
|
|
46
|
+
/** Display name, including the file extension when available. */
|
|
47
|
+
name: string;
|
|
48
|
+
/** MIME type used to classify and preview the attachment. */
|
|
49
|
+
mimeType?: string;
|
|
50
|
+
/** File size in bytes. */
|
|
51
|
+
size?: number;
|
|
52
|
+
/** Image width in pixels when known. */
|
|
53
|
+
width?: number;
|
|
54
|
+
/** Image height in pixels when known. */
|
|
55
|
+
height?: number;
|
|
56
|
+
/** How to interpret `source`, for example UUID, URL, or Base64 data. */
|
|
57
|
+
sourceType?: ImageSourceType;
|
|
58
|
+
/** Canonical attachment source: an uploaded file id, URL, or Base64 data URL. */
|
|
59
|
+
source?: string;
|
|
60
|
+
/** Optional preview source when it is distinct from the canonical attachment source. */
|
|
61
|
+
thumbnail?: string;
|
|
62
|
+
}
|
|
41
63
|
export declare enum BaseFieldType {
|
|
42
64
|
Text = "text",
|
|
43
65
|
SingleSelect = "singleSelect",
|
|
@@ -90,6 +112,7 @@ export interface IBaseSnapshot {
|
|
|
90
112
|
createdAt: number;
|
|
91
113
|
updatedAt: number;
|
|
92
114
|
createdBy?: string;
|
|
115
|
+
resources?: IResources;
|
|
93
116
|
}
|
|
94
117
|
export interface ITableSnapshot {
|
|
95
118
|
id: TableId;
|
|
@@ -443,6 +466,14 @@ export interface IGridCellSelection {
|
|
|
443
466
|
viewId: ViewId;
|
|
444
467
|
recordId: RecordId;
|
|
445
468
|
fieldId: FieldId;
|
|
469
|
+
mode?: 'cell' | 'row' | 'column';
|
|
470
|
+
anchorRecordId?: RecordId;
|
|
471
|
+
focusRecordId?: RecordId;
|
|
472
|
+
anchorFieldId?: FieldId;
|
|
473
|
+
focusFieldId?: FieldId;
|
|
474
|
+
selectedRecordIds?: RecordId[];
|
|
475
|
+
showBorder?: boolean;
|
|
476
|
+
virtual?: boolean;
|
|
446
477
|
}
|
|
447
478
|
export interface IGridGroupSelection {
|
|
448
479
|
type: 'grid-group';
|
|
@@ -14,9 +14,15 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Nullable } from '../../shared';
|
|
17
|
-
import type { IDocumentStyle, IParagraphStyle } from '../../types/interfaces';
|
|
17
|
+
import type { IDocStyles, IDocumentStyle, IParagraphStyle } from '../../types/interfaces';
|
|
18
18
|
export interface IResolveDocumentParagraphStyleOptions {
|
|
19
|
+
/** Exclude document-level outer spacing while retaining all other defaults. */
|
|
19
20
|
excludeDocumentOuterSpacing?: boolean;
|
|
21
|
+
/** Preserve the legacy Modern Doc spacing defaults when no explicit flavor is available. */
|
|
20
22
|
useLegacyModernDefaults?: boolean;
|
|
23
|
+
/** Named document styles keyed by stable style id. */
|
|
24
|
+
styles?: IDocStyles;
|
|
25
|
+
/** Named paragraph style referenced by the paragraph. */
|
|
26
|
+
paragraphStyleId?: string;
|
|
21
27
|
}
|
|
22
28
|
export declare function resolveDocumentParagraphStyle(documentStyle: Nullable<IDocumentStyle>, paragraphStyle: Nullable<IParagraphStyle>, options?: IResolveDocumentParagraphStyleOptions): IParagraphStyle;
|
|
@@ -32,7 +32,9 @@ export declare function normalizeData(data: IDocumentData): IDocumentData;
|
|
|
32
32
|
* Agent-friendly text style aliases accepted by `RichTextBuilder.span()`.
|
|
33
33
|
*
|
|
34
34
|
* The readable aliases can be combined in one object and apply only to the appended span. Native `ITextStyle` fields
|
|
35
|
-
* remain available for advanced document integrations.
|
|
35
|
+
* remain available for advanced document integrations. Drawing effects such as `glow` and `outerShadow` are
|
|
36
|
+
* especially useful when the resulting rich text is attached to a Shape; standalone document products may not expose
|
|
37
|
+
* dedicated controls for them.
|
|
36
38
|
*
|
|
37
39
|
* @example
|
|
38
40
|
* ```ts
|
|
@@ -43,6 +45,14 @@ export declare function normalizeData(data: IDocumentData): IDocumentData;
|
|
|
43
45
|
* italic: true,
|
|
44
46
|
* color: '#dc2626',
|
|
45
47
|
* background: '#fee2e2',
|
|
48
|
+
* glow: { color: '#f97316', radius: 6 },
|
|
49
|
+
* outerShadow: {
|
|
50
|
+
* color: '#000000',
|
|
51
|
+
* opacity: 0.35,
|
|
52
|
+
* blurRadius: 4,
|
|
53
|
+
* distance: 3,
|
|
54
|
+
* direction: 45,
|
|
55
|
+
* },
|
|
46
56
|
* });
|
|
47
57
|
* ```
|
|
48
58
|
*/
|
|
@@ -20,9 +20,9 @@ export interface IDataStreamChange {
|
|
|
20
20
|
insertLength: number;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Finds one contiguous dataStream change. Pure structural insertions
|
|
24
|
-
* anchored by their
|
|
23
|
+
* Finds one contiguous dataStream change. Pure structural insertions and deletions
|
|
24
|
+
* are anchored by their stable ids before falling back to string comparison.
|
|
25
25
|
* This prevents an adjacent identical sentinel from being mistaken for an
|
|
26
|
-
* unchanged prefix and keeps the
|
|
26
|
+
* unchanged prefix and keeps the structure metadata aligned with the TextX body.
|
|
27
27
|
*/
|
|
28
28
|
export declare function getSingleDataStreamChange(previousBody: IDocumentBody | undefined, nextBody: IDocumentBody | undefined): IDataStreamChange | null;
|
|
@@ -70,7 +70,7 @@ export declare class BuildTextUtils {
|
|
|
70
70
|
export { getSingleDataStreamChange } from './data-stream-change';
|
|
71
71
|
export type { IDataStreamChange } from './data-stream-change';
|
|
72
72
|
export { getCustomBlockIdsInSelections } from './drawings';
|
|
73
|
-
export { getParagraphContentStartOffset, getParagraphContentStartOffsets, getParagraphFollowingBlockOffset } from './paragraph';
|
|
73
|
+
export { getParagraphContentStartOffset, getParagraphContentStartOffsets, getParagraphFollowingBlockOffset, } from './paragraph';
|
|
74
74
|
export { containsInteriorInsertionOffset, containsStreamIndex, getBlockRangeInterval, getColumnGroupRangeInterval, getCustomBlockInterval, getCustomRangeInterval, getExclusiveRangeInterval, getInclusiveRangeInterval, getTableCellTokenInterval, getTableRangeInterval, getTableRowTokenInterval, intersectsOperationalIntervals, shiftExclusiveRangeOnDelete, shiftExclusiveRangeOnInsert, shiftInclusiveRangeOnDelete, shiftInclusiveRangeOnInsert, } from './range-interval';
|
|
75
75
|
export type { IDocOperationalInterval } from './range-interval';
|
|
76
76
|
export type { IAddCustomRangeTextXParam, IDeleteCustomRangeParam, IReplaceSelectionTextXParams } from './text-x-utils';
|
|
@@ -37,6 +37,7 @@ export declare function getColumnGroupSlice(body: IDocumentBody, startOffset: nu
|
|
|
37
37
|
export declare function getParagraphsSlice(body: IDocumentBody, startOffset: number, endOffset: number, type?: SliceBodyType): {
|
|
38
38
|
startIndex: number;
|
|
39
39
|
paragraphId: string;
|
|
40
|
+
styleId?: string;
|
|
40
41
|
paragraphStyle?: import("../../..").IParagraphStyle;
|
|
41
42
|
bullet?: import("../../..").IBullet;
|
|
42
43
|
}[] | undefined;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
16
|
+
import type { IDisposable, IDocumentData, IExecutionOptions, ILanguagePack, IParagraphStyle, ITextDecoration, ITextStyle, LifecycleStages } from '@univerjs/core';
|
|
17
17
|
import type { Subscription } from 'rxjs';
|
|
18
18
|
import type { IEventParamConfig } from './f-event';
|
|
19
19
|
import { Disposable, ICommandService, Injector, IUniverInstanceService, LifecycleService, ParagraphStyleBuilder, ParagraphStyleValue, RichTextBuilder, RichTextValue, TextDecorationBuilder, TextStyleBuilder, TextStyleValue, Univer } from '@univerjs/core';
|
|
@@ -21,7 +21,6 @@ import { FBlob } from './f-blob';
|
|
|
21
21
|
import { FEnum } from './f-enum';
|
|
22
22
|
import { FEventName } from './f-event';
|
|
23
23
|
import { FEventRegistry } from './f-event-registry';
|
|
24
|
-
import { FHooks } from './f-hooks';
|
|
25
24
|
import { FUserManager } from './f-usermanager';
|
|
26
25
|
import { FUtil } from './f-util';
|
|
27
26
|
/**
|
|
@@ -164,20 +163,6 @@ export declare class FUniver extends Disposable {
|
|
|
164
163
|
* ```
|
|
165
164
|
*/
|
|
166
165
|
getLocales(): ILanguagePack | undefined;
|
|
167
|
-
/**
|
|
168
|
-
* Register a callback that will be triggered before invoking a command.
|
|
169
|
-
* @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeCommandExecute, (event) => {})` instead.
|
|
170
|
-
* @param {CommandListener} callback The callback.
|
|
171
|
-
* @returns {IDisposable} The disposable instance.
|
|
172
|
-
*/
|
|
173
|
-
onBeforeCommandExecute(callback: CommandListener): IDisposable;
|
|
174
|
-
/**
|
|
175
|
-
* Register a callback that will be triggered when a command is invoked.
|
|
176
|
-
* @deprecated use `univerAPI.addEvent(univerAPI.Event.CommandExecuted, (event) => {})` instead.
|
|
177
|
-
* @param {CommandListener} callback The callback.
|
|
178
|
-
* @returns {IDisposable} The disposable instance.
|
|
179
|
-
*/
|
|
180
|
-
onCommandExecuted(callback: CommandListener): IDisposable;
|
|
181
166
|
/**
|
|
182
167
|
* Execute a command with the given id and parameters.
|
|
183
168
|
* @param id Identifier of the command.
|
|
@@ -210,12 +195,6 @@ export declare class FUniver extends Disposable {
|
|
|
210
195
|
* ```
|
|
211
196
|
*/
|
|
212
197
|
syncExecuteCommand<P extends object = object, R = boolean>(id: string, params?: P, options?: IExecutionOptions): R;
|
|
213
|
-
/**
|
|
214
|
-
* Get hooks.
|
|
215
|
-
* @deprecated use `addEvent` instead.
|
|
216
|
-
* @returns {FHooks} FHooks instance
|
|
217
|
-
*/
|
|
218
|
-
getHooks(): FHooks;
|
|
219
198
|
get Enum(): FEnum;
|
|
220
199
|
get Event(): FEventName;
|
|
221
200
|
get Util(): FUtil;
|
|
@@ -17,6 +17,5 @@ export { FBase, FBaseInitialable } from './f-base';
|
|
|
17
17
|
export { FBlob, type IFBlobSource } from './f-blob';
|
|
18
18
|
export { FEnum } from './f-enum';
|
|
19
19
|
export { FEventName, type IEventBase, type IEventParamConfig } from './f-event';
|
|
20
|
-
export { FHooks } from './f-hooks';
|
|
21
20
|
export { FUniver } from './f-univer';
|
|
22
21
|
export { FUtil } from './f-util';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export { mergeOverrideWithDependencies } from './services/plugin/plugin-override
|
|
|
76
76
|
export type { DependencyOverride } from './services/plugin/plugin-override';
|
|
77
77
|
export type { PluginCtor } from './services/plugin/plugin.service';
|
|
78
78
|
export { DependentOn, Plugin, PluginService } from './services/plugin/plugin.service';
|
|
79
|
+
export { RegionService } from './services/region/region.service';
|
|
79
80
|
export { IResourceLoaderService } from './services/resource-loader/type';
|
|
80
81
|
export { ResourceManagerService } from './services/resource-manager/resource-manager.service';
|
|
81
82
|
export type { IResourceHook, IResources } from './services/resource-manager/type';
|
|
@@ -17,8 +17,7 @@ export declare const FOCUSING_UNIT = "FOCUSING_UNIT";
|
|
|
17
17
|
export declare const FOCUSING_SHEET = "FOCUSING_SHEET";
|
|
18
18
|
export declare const FOCUSING_DOC = "FOCUSING_DOC";
|
|
19
19
|
export declare const FOCUSING_SLIDE = "FOCUSING_SLIDE";
|
|
20
|
-
|
|
21
|
-
export declare const FOCUSING_EDITOR_BUT_HIDDEN = "FOCUSING_EDITOR_BUT_HIDDEN";
|
|
20
|
+
export declare const FOCUSING_BOARD = "FOCUSING_BOARD";
|
|
22
21
|
export declare const EDITOR_ACTIVATED = "EDITOR_ACTIVATED";
|
|
23
22
|
export declare const FOCUSING_EDITOR_INPUT_FORMULA = "FOCUSING_EDITOR_INPUT_FORMULA";
|
|
24
23
|
/** The focusing state of the formula editor (Fx bar). */
|
|
@@ -19,9 +19,7 @@ import type { UnitModel } from '../../common/unit';
|
|
|
19
19
|
import type { Nullable } from '../../shared';
|
|
20
20
|
import { Injector } from '../../common/di';
|
|
21
21
|
import { UniverInstanceType } from '../../common/unit';
|
|
22
|
-
import { DocumentDataModel } from '../../docs/data-model/document-data-model';
|
|
23
22
|
import { Disposable } from '../../shared/lifecycle';
|
|
24
|
-
import { Workbook } from '../../sheets/workbook';
|
|
25
23
|
import { IContextService } from '../context/context.service';
|
|
26
24
|
import { ILogService } from '../log/log.service';
|
|
27
25
|
export type UnitCtor = new (...args: any[]) => UnitModel;
|
|
@@ -98,13 +96,9 @@ export interface IUniverInstanceService {
|
|
|
98
96
|
/** Dispose a unit */
|
|
99
97
|
disposeUnit(unitId: string): boolean;
|
|
100
98
|
registerCtorForType<T extends UnitModel>(type: UniverInstanceType, ctor: new (...args: any[]) => T): IDisposable;
|
|
101
|
-
/** @deprecated */
|
|
102
|
-
changeDoc(unitId: string, doc: DocumentDataModel): void;
|
|
103
99
|
getUnit<T extends UnitModel>(id: string, type?: UniverInstanceType): Nullable<T>;
|
|
104
100
|
getAllUnitsForType<T>(type: UniverInstanceType): T[];
|
|
105
101
|
getUnitType(unitId: string): UniverInstanceType;
|
|
106
|
-
/** @deprecated */
|
|
107
|
-
getUniverSheetInstance(unitId: string): Nullable<Workbook>;
|
|
108
102
|
}
|
|
109
103
|
export declare const IUniverInstanceService: import("@wendellhu/redi").IdentifierDecorator<IUniverInstanceService>;
|
|
110
104
|
export declare class UniverInstanceService extends Disposable implements IUniverInstanceService {
|
|
@@ -143,9 +137,7 @@ export declare class UniverInstanceService extends Disposable implements IUniver
|
|
|
143
137
|
getTypeOfUnitDisposed$<T extends UnitModel<object, number>>(type: UniverInstanceType): Observable<T>;
|
|
144
138
|
getUnit<T extends UnitModel = UnitModel>(id: string, type?: UniverInstanceType): Nullable<T>;
|
|
145
139
|
getUnitCreateOptions(unitId: string): Nullable<ICreateUnitOptions>;
|
|
146
|
-
getUniverSheetInstance(unitId: string): Nullable<Workbook>;
|
|
147
140
|
getAllUnitsForType<T>(type: UniverInstanceType): T[];
|
|
148
|
-
changeDoc(unitId: string, doc: DocumentDataModel): void;
|
|
149
141
|
private readonly _focused$;
|
|
150
142
|
readonly focused$: Observable<Nullable<string>>;
|
|
151
143
|
get focused(): Nullable<UnitModel>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { Observable } from 'rxjs';
|
|
17
|
+
import type { LocaleType } from '../../types/enum/locale-type';
|
|
18
|
+
import { Disposable } from '../../shared/lifecycle';
|
|
19
|
+
import { LocaleService } from '../locale/locale.service';
|
|
20
|
+
export declare class RegionService extends Disposable {
|
|
21
|
+
private readonly _localeService;
|
|
22
|
+
private readonly _currentRegion$;
|
|
23
|
+
readonly currentRegion$: Observable<LocaleType>;
|
|
24
|
+
private _hasExplicitRegion;
|
|
25
|
+
constructor(_localeService: LocaleService);
|
|
26
|
+
setRegion(region: LocaleType): void;
|
|
27
|
+
getCurrentRegion(): LocaleType;
|
|
28
|
+
}
|
|
@@ -25,11 +25,6 @@ import type { Nullable } from './types';
|
|
|
25
25
|
* @returns IRangeWithCoord
|
|
26
26
|
*/
|
|
27
27
|
export declare function convertCellToRange(cellInfo: ICellWithCoord): IRangeWithCoord;
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated use `convertCellToRange` instead
|
|
30
|
-
*/
|
|
31
|
-
declare const makeCellToSelection: typeof convertCellToRange;
|
|
32
|
-
export { makeCellToSelection };
|
|
33
28
|
export declare function makeCellRangeToRangeData(cellInfo: Nullable<ISelectionCell>): Nullable<IRange>;
|
|
34
29
|
export declare function isEmptyCell(cell: Nullable<ICellData>): boolean;
|
|
35
30
|
export declare function isCellCoverable(cell: Nullable<ICellDataForSheetInterceptor>): boolean;
|
|
@@ -54,12 +54,6 @@ export declare class ObjectMatrix<T> {
|
|
|
54
54
|
hasValue(): boolean;
|
|
55
55
|
getValue(row: number, column: number): Nullable<T>;
|
|
56
56
|
setValue(row: number, column: number, value: T): void;
|
|
57
|
-
/**
|
|
58
|
-
* !!
|
|
59
|
-
* Please +1 ‘!’, who fell into this pit.
|
|
60
|
-
* @deprecated use `realDelete` or `splice`
|
|
61
|
-
*/
|
|
62
|
-
deleteValue(row: number, column: number): void;
|
|
63
57
|
realDeleteValue(row: number, column: number): void;
|
|
64
58
|
setRow(rowNumber: number, row: IObjectArrayPrimitiveType<T>): void;
|
|
65
59
|
moveRows(start: number, count: number, target: number): void;
|
|
@@ -106,15 +100,7 @@ export declare class ObjectMatrix<T> {
|
|
|
106
100
|
toNativeArray(): T[];
|
|
107
101
|
toArray(): T[][];
|
|
108
102
|
toFullArray(): T[][];
|
|
109
|
-
/**
|
|
110
|
-
* @deprecated Use getMatrix as a substitute.
|
|
111
|
-
*/
|
|
112
|
-
toJSON(): IObjectMatrixPrimitiveType<T>;
|
|
113
103
|
clone(): IObjectMatrixPrimitiveType<T>;
|
|
114
|
-
/**
|
|
115
|
-
* @deprecated Use clone as a substitute.
|
|
116
|
-
*/
|
|
117
|
-
getData(): IObjectMatrixPrimitiveType<T>;
|
|
118
104
|
getArrayData(): IObjectMatrixPrimitiveType<T>;
|
|
119
105
|
/**
|
|
120
106
|
* the function can only be used in all the row and column are positive integer
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IRange, IRectLTRB } from '../sheets/typedef';
|
|
17
|
-
import type { Nullable } from './types';
|
|
18
17
|
/**
|
|
19
18
|
* This class provides a set of methods to calculate and manipulate rectangular ranges (IRange).
|
|
20
19
|
* A range represents a rectangular area in a grid, defined by start/end rows and columns.
|
|
@@ -106,20 +105,6 @@ export declare class Rectangle {
|
|
|
106
105
|
* ```
|
|
107
106
|
*/
|
|
108
107
|
static doAnyRangesIntersect(src: IRange[], target: IRange[]): boolean;
|
|
109
|
-
/**
|
|
110
|
-
* Gets the intersection range between two ranges
|
|
111
|
-
* @param src
|
|
112
|
-
* @param target
|
|
113
|
-
* @deprecated use `getIntersectRange` instead
|
|
114
|
-
* @example
|
|
115
|
-
* ```typescript
|
|
116
|
-
* const range1 = { startRow: 0, startColumn: 0, endRow: 2, endColumn: 2 };
|
|
117
|
-
* const range2 = { startRow: 1, startColumn: 1, endRow: 3, endColumn: 3 };
|
|
118
|
-
* const intersection = Rectangle.getIntersects(range1, range2);
|
|
119
|
-
* // intersection = { startRow: 1, startColumn: 1, endRow: 2, endColumn: 2 }
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
static getIntersects(src: IRange, target: IRange): Nullable<IRange>;
|
|
123
108
|
/**
|
|
124
109
|
* Checks if one range completely contains another range
|
|
125
110
|
* @param src
|
|
@@ -22,8 +22,6 @@ export declare class Tools {
|
|
|
22
22
|
static deleteNull(obj: any): any;
|
|
23
23
|
static getSystemType(): string;
|
|
24
24
|
static getBrowserType(): string;
|
|
25
|
-
/** @deprecated This method is deprecated, please use `import { merge } from '@univerjs/core` instead */
|
|
26
|
-
static deepMerge(target: any, ...sources: any[]): any;
|
|
27
25
|
static diffValue(one: any, two: any): boolean;
|
|
28
26
|
static deepClone<T = unknown>(value: T): T;
|
|
29
27
|
static getValueType(value: any): string;
|
|
@@ -81,8 +81,8 @@ export declare class SheetSkeleton extends Skeleton {
|
|
|
81
81
|
protected readonly _configService: IConfigService;
|
|
82
82
|
protected _injector: Injector;
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
85
|
-
* `ViewModel` will
|
|
84
|
+
* Avoid using `IWorksheetData` directly when an API is provided by `Worksheet`, otherwise
|
|
85
|
+
* `ViewModel` will not work.
|
|
86
86
|
*/
|
|
87
87
|
protected _worksheetData: IWorksheetData;
|
|
88
88
|
protected _renderRawFormula: boolean;
|
|
@@ -95,10 +95,6 @@ export declare class SheetSkeleton extends Skeleton {
|
|
|
95
95
|
constructor(worksheet: Worksheet, _styles: Styles, _localeService: LocaleService, _contextService: IContextService, _configService: IConfigService, _injector: Injector);
|
|
96
96
|
initConfig(): void;
|
|
97
97
|
resetCache(): void;
|
|
98
|
-
/**
|
|
99
|
-
* @deprecated should never expose a property that is provided by another module!
|
|
100
|
-
*/
|
|
101
|
-
getWorksheetConfig(): IWorksheetData;
|
|
102
98
|
/**
|
|
103
99
|
* Get which Workbook and Worksheet this skeleton is attached to.
|
|
104
100
|
* @returns [unitId, sheetId]
|
|
@@ -97,11 +97,8 @@ export interface IWorksheetData {
|
|
|
97
97
|
freeze: IFreeze;
|
|
98
98
|
rowCount: number;
|
|
99
99
|
columnCount: number;
|
|
100
|
-
/** @deprecated */
|
|
101
100
|
zoomRatio: number;
|
|
102
|
-
/** @deprecated */
|
|
103
101
|
scrollTop: number;
|
|
104
|
-
/** @deprecated */
|
|
105
102
|
scrollLeft: number;
|
|
106
103
|
defaultColumnWidth: number;
|
|
107
104
|
defaultRowHeight: number;
|
|
@@ -486,12 +483,6 @@ export interface ISingleCell {
|
|
|
486
483
|
}
|
|
487
484
|
export interface IRangeWithCoord extends IPosition, IRange {
|
|
488
485
|
}
|
|
489
|
-
/**
|
|
490
|
-
* @deprecated use ICellWithCoord instead.
|
|
491
|
-
*/
|
|
492
|
-
export interface ISelectionCellWithMergeInfo extends IPosition, ISingleCell {
|
|
493
|
-
mergeInfo: IRangeWithCoord;
|
|
494
|
-
}
|
|
495
486
|
/**
|
|
496
487
|
* SingleCell & coordinate and mergeRange.
|
|
497
488
|
*/
|
|
@@ -586,11 +577,6 @@ export interface ITextRangeParam extends ITextRange {
|
|
|
586
577
|
isActive?: boolean;
|
|
587
578
|
rangeType?: DOC_RANGE_TYPE;
|
|
588
579
|
}
|
|
589
|
-
/**
|
|
590
|
-
* Determines whether the cell(row, column) is within the range of the merged cells.
|
|
591
|
-
* @deprecated please use worksheet.getCellInfoInMergeData instead
|
|
592
|
-
*/
|
|
593
|
-
export declare function getCellInfoInMergeData(row: number, column: number, mergeData?: IRange[]): ISelectionCell;
|
|
594
580
|
export type ICellDataWithSpanAndDisplay = ICellData & {
|
|
595
581
|
rowSpan?: number;
|
|
596
582
|
colSpan?: number;
|
|
@@ -71,8 +71,6 @@ export declare class Workbook extends UnitModel<IWorkbookData, UniverInstanceTyp
|
|
|
71
71
|
* @memberof Workbook
|
|
72
72
|
*/
|
|
73
73
|
getSnapshot(): IWorkbookData;
|
|
74
|
-
/** @deprecated use use name property instead */
|
|
75
|
-
getName(): string;
|
|
76
74
|
setName(name: string): void;
|
|
77
75
|
getUnitId(): string;
|
|
78
76
|
getRev(): number;
|
|
@@ -192,12 +192,6 @@ export declare class Worksheet {
|
|
|
192
192
|
* @returns name of the sheet
|
|
193
193
|
*/
|
|
194
194
|
getName(): string;
|
|
195
|
-
/**
|
|
196
|
-
* Returns WorkSheet Clone Object
|
|
197
|
-
* @returns WorkSheet Clone Object
|
|
198
|
-
* @deprecated
|
|
199
|
-
*/
|
|
200
|
-
clone(): Worksheet;
|
|
201
195
|
/**
|
|
202
196
|
* Get the merged cell list of the sheet.
|
|
203
197
|
* @returns {IRange[]} merged cell list
|
|
@@ -23,3 +23,5 @@ export declare enum ModernDocumentWidthMode {
|
|
|
23
23
|
}
|
|
24
24
|
export declare const MODERN_DOCUMENT_WIDTH: Record<ModernDocumentWidthMode, number>;
|
|
25
25
|
export declare const MODERN_DOCUMENT_DEFAULT_MARGIN: number;
|
|
26
|
+
/** Default margin for a paginated Traditional document, in 96-DPI layout pixels. */
|
|
27
|
+
export declare const TRADITIONAL_DOCUMENT_DEFAULT_MARGIN = 72;
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
17
|
* Theme color type enum
|
|
18
|
-
*
|
|
19
|
-
* @deprecated
|
|
20
18
|
*/
|
|
21
19
|
export declare enum ThemeColorType {
|
|
22
20
|
/**
|
|
@@ -43,8 +41,6 @@ export declare enum ThemeColorType {
|
|
|
43
41
|
}
|
|
44
42
|
/**
|
|
45
43
|
* Preset theme names.
|
|
46
|
-
*
|
|
47
|
-
* @deprecated
|
|
48
44
|
*/
|
|
49
45
|
export declare enum ThemeColors {
|
|
50
46
|
OFFICE = "Office",
|
|
@@ -32,8 +32,6 @@ export interface ICellRenderContext {
|
|
|
32
32
|
/**
|
|
33
33
|
* @debt This shouldn't exist in core package.
|
|
34
34
|
* @ignore
|
|
35
|
-
*
|
|
36
|
-
* @deprecated This interface is subject to change in the future.
|
|
37
35
|
*/
|
|
38
36
|
export interface ICellCustomRender {
|
|
39
37
|
drawWith(ctx: CanvasRenderingContext2D, info: ICellRenderContext, skeleton: any, spreadsheets: any): void;
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
import type { ICustomDecoration, ICustomRange, IParagraph } from './i-document-data';
|
|
17
17
|
export interface ICustomRangeForInterceptor extends ICustomRange {
|
|
18
18
|
active?: boolean;
|
|
19
|
+
glyphAscentEm?: number;
|
|
20
|
+
glyphDescentEm?: number;
|
|
19
21
|
glyphWidthEm?: number;
|
|
20
22
|
show?: boolean;
|
|
21
23
|
}
|