@univerjs/core 0.2.4 → 0.2.6

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 (37) hide show
  1. package/lib/cjs/index.js +11 -9
  2. package/lib/es/index.js +7813 -6138
  3. package/lib/types/common/const.d.ts +1 -0
  4. package/lib/types/common/di.d.ts +17 -0
  5. package/lib/types/common/json.d.ts +18 -0
  6. package/lib/types/docs/data-model/document-data-model.d.ts +3 -0
  7. package/lib/types/index.d.ts +4 -2
  8. package/lib/types/observer/observable.d.ts +2 -1
  9. package/lib/types/services/__tests__/index.d.ts +7 -7
  10. package/lib/types/services/authz-io/type.d.ts +1 -1
  11. package/lib/types/services/command/command.service.d.ts +2 -2
  12. package/lib/types/services/config/config.service.d.ts +1 -1
  13. package/lib/types/services/context/context.service.d.ts +1 -1
  14. package/lib/types/services/instance/instance.service.d.ts +2 -2
  15. package/lib/types/services/lifecycle/lifecycle.d.ts +1 -1
  16. package/lib/types/services/lifecycle/lifecycle.service.d.ts +1 -1
  17. package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
  18. package/lib/types/services/log/log.service.d.ts +1 -1
  19. package/lib/types/services/permission/type.d.ts +1 -1
  20. package/lib/types/services/plugin/plugin-override.d.ts +1 -1
  21. package/lib/types/services/plugin/plugin.d.ts +2 -2
  22. package/lib/types/services/plugin/plugin.service.d.ts +2 -1
  23. package/lib/types/services/resource-loader/type.d.ts +1 -1
  24. package/lib/types/services/resource-manager/type.d.ts +2 -2
  25. package/lib/types/services/snapshot/snapshot-server.service.d.ts +1 -1
  26. package/lib/types/services/snapshot/snapshot-utils.d.ts +2 -2
  27. package/lib/types/services/undoredo/undoredo.service.d.ts +2 -2
  28. package/lib/types/shared/lifecycle.d.ts +1 -1
  29. package/lib/types/shared/lru/lru-map.d.ts +1 -1
  30. package/lib/types/shared/rxjs.d.ts +1 -1
  31. package/lib/types/sheets/view-model.d.ts +1 -1
  32. package/lib/types/slides/slide-model.d.ts +7 -0
  33. package/lib/types/types/enum/text-style.d.ts +3 -1
  34. package/lib/types/types/interfaces/i-document-data.d.ts +74 -12
  35. package/lib/types/univer.d.ts +1 -1
  36. package/lib/umd/index.js +11 -9
  37. package/package.json +7 -7
@@ -15,6 +15,7 @@
15
15
  */
16
16
  export declare const DOCS_NORMAL_EDITOR_UNIT_ID_KEY = "__INTERNAL_EDITOR__DOCS_NORMAL";
17
17
  export declare const DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY = "__INTERNAL_EDITOR__DOCS_FORMULA_BAR";
18
+ export declare const DOCS_ZEN_EDITOR_UNIT_ID_KEY = "__defaultDocumentZenEditorSpecialUnitId_20231218__";
18
19
  export declare const DEFAULT_EMPTY_DOCUMENT_VALUE = "\r\n";
19
20
  export declare function createInternalEditorID(id: string): string;
20
21
  export declare function isInternalEditorID(id: string): boolean;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
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
+ export * from '@wendellhu/redi';
17
+ export * from '@wendellhu/redi/react-bindings';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
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
+ export type Serializable = {
17
+ [property: string]: Serializable;
18
+ } | readonly Serializable[] | string | number | boolean | null;
@@ -41,7 +41,10 @@ export declare class DocumentDataModel extends DocumentDataModelSimple {
41
41
  private _unitId;
42
42
  headerModelMap: Map<string, DocumentDataModel>;
43
43
  footerModelMap: Map<string, DocumentDataModel>;
44
+ private _name$;
45
+ readonly name$: import('rxjs').Observable<string>;
44
46
  constructor(snapshot: Partial<IDocumentData>);
47
+ setName(name: string): void;
45
48
  dispose(): void;
46
49
  getDrawings(): IDrawings | undefined;
47
50
  getDrawingsOrder(): string[] | undefined;
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export type { Serializable } from './common/json';
16
17
  export { DEFAULT_DOCUMENT_SUB_COMPONENT_ID } from './docs/data-model/subdocument';
17
18
  export { type UnitType, UnitModel, UniverInstanceType } from './common/unit';
18
19
  export { Registry, RegistryAsMap } from './common/registry';
@@ -22,7 +23,7 @@ export { isNumeric, isSafeNumeric } from './common/number';
22
23
  export { isBooleanString } from './common/boolean';
23
24
  export { dedupe, remove, rotate, groupBy, makeArray } from './common/array';
24
25
  export { mergeSets } from './common/set';
25
- export { DEFAULT_EMPTY_DOCUMENT_VALUE, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, createInternalEditorID, isInternalEditorID, } from './common/const';
26
+ export { DEFAULT_EMPTY_DOCUMENT_VALUE, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOCS_ZEN_EDITOR_UNIT_ID_KEY, createInternalEditorID, isInternalEditorID, } from './common/const';
26
27
  export { throttle } from './common/function';
27
28
  export { MemoryCursor } from './common/memory-cursor';
28
29
  export { requestImmediateMacroTask } from './common/request-immediate-macro-task';
@@ -37,7 +38,7 @@ export type { TPriority } from './docs/data-model/text-x/text-x';
37
38
  export { JSONX, JSON1 } from './docs/data-model/json-x/json-x';
38
39
  export type { JSONXActions, JSONXPath } from './docs/data-model/json-x/json-x';
39
40
  export { replaceInDocumentBody } from './docs/data-model/replacement';
40
- export { type IEventObserver, EventState, EventSubject } from './observer/observable';
41
+ export { type IEventObserver, EventState, EventSubject, fromEventSubject } from './observer/observable';
41
42
  export { Plugin } from './services/plugin/plugin';
42
43
  export { PluginService, DependentOn } from './services/plugin/plugin.service';
43
44
  export { type CommandListener, CommandService, CommandType, type ICommand, type ICommandInfo, ICommandService, type IExecutionOptions, type IMultiCommand, type IMutation, type IMutationCommonParams, type IMutationInfo, type IOperation, type IOperationInfo, NilCommand, sequenceExecute, sequenceExecuteAsync, } from './services/command/command.service';
@@ -110,3 +111,4 @@ export { normalizeBody, getCustomRangeSlice, getCustomDecorationSlice } from './
110
111
  export { updateAttributeByDelete } from './docs/data-model/text-x/apply-utils/delete-apply';
111
112
  export { updateAttributeByInsert } from './docs/data-model/text-x/apply-utils/insert-apply';
112
113
  export { nameCharacterCheck } from './shared/name';
114
+ export * from './common/di';
@@ -1,4 +1,4 @@
1
- import { Observer as RxObserver, Subscription, Subject } from 'rxjs';
1
+ import { Observer as RxObserver, Subscription, Observable, Subject } from 'rxjs';
2
2
 
3
3
  /**
4
4
  * A class serves as a medium between the observable and its observers
@@ -44,4 +44,5 @@ export declare class EventSubject<T> extends Subject<[T, EventState]> {
44
44
  clearObservers(): void;
45
45
  emitEvent(event: T): INotifyObserversReturn;
46
46
  }
47
+ export declare function fromEventSubject<T>(subject$: EventSubject<T>): Observable<T>;
47
48
  export {};
@@ -1,15 +1,15 @@
1
1
  import { ICommandService, Univer } from '@univerjs/core';
2
- import { Dependency } from '@wendellhu/redi';
2
+ import { Dependency } from '../../common/di';
3
3
 
4
4
  export declare const createTestBed: (dependencies?: Dependency[]) => {
5
5
  univer: Univer;
6
6
  get: {
7
- <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
8
- <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
9
- <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
10
- <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
11
- <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
12
- <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
7
+ <T>(id: import('@univerjs/core').DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
8
+ <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
9
+ <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
10
+ <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
11
+ <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
12
+ <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
13
13
  };
14
14
  workbook: import('@univerjs/core').Workbook;
15
15
  unitId: string;
@@ -17,4 +17,4 @@ export interface IAuthzIoService {
17
17
  createCollaborator(config: ICreateCollaboratorRequest, context?: ILogContext): Promise<void>;
18
18
  putCollaborators(config: IPutCollaboratorsRequest, context?: ILogContext): Promise<void>;
19
19
  }
20
- export declare const IAuthzIoService: import('@wendellhu/redi').IdentifierDecorator<IAuthzIoService>;
20
+ export declare const IAuthzIoService: import('@univerjs/core').IdentifierDecorator<IAuthzIoService>;
@@ -1,4 +1,4 @@
1
- import { IAccessor, IDisposable, Injector } from '@wendellhu/redi';
1
+ import { IAccessor, IDisposable, Injector } from '../../common/di';
2
2
  import { Disposable } from '../../shared/lifecycle';
3
3
  import { IContextService } from '../context/context.service';
4
4
  import { ILogService } from '../log/log.service';
@@ -111,7 +111,7 @@ export interface ICommandService {
111
111
  */
112
112
  beforeCommandExecuted(listener: CommandListener): IDisposable;
113
113
  }
114
- export declare const ICommandService: import('@wendellhu/redi').IdentifierDecorator<ICommandService>;
114
+ export declare const ICommandService: import('../../common/di').IdentifierDecorator<ICommandService>;
115
115
  /**
116
116
  * The registry of commands.
117
117
  */
@@ -3,7 +3,7 @@ import { Nullable } from '../../shared/types';
3
3
  /**
4
4
  * IConfig provides universal configuration for the whole application.
5
5
  */
6
- export declare const IConfigService: import('@wendellhu/redi').IdentifierDecorator<IConfigService>;
6
+ export declare const IConfigService: import('../../common/di').IdentifierDecorator<IConfigService>;
7
7
  export interface IConfigService {
8
8
  getConfig<T>(id: string, defaultValue: T): T;
9
9
  getConfig<T>(id: string): Nullable<T>;
@@ -9,7 +9,7 @@ export interface IContextService {
9
9
  setContextValue(key: string, value: boolean): void;
10
10
  subscribeContextValue$(key: string): Observable<boolean>;
11
11
  }
12
- export declare const IContextService: import('@wendellhu/redi').IdentifierDecorator<IContextService>;
12
+ export declare const IContextService: import('../../common/di').IdentifierDecorator<IContextService>;
13
13
  export declare class ContextService extends Disposable implements IContextService {
14
14
  private _contextChanged$;
15
15
  readonly contextChanged$: Observable<{
@@ -1,5 +1,5 @@
1
- import { IDisposable, Injector } from '@wendellhu/redi';
2
1
  import { Observable } from 'rxjs';
2
+ import { IDisposable, Injector } from '../../common/di';
3
3
  import { DocumentDataModel } from '../../docs/data-model/document-data-model';
4
4
  import { Nullable } from '../../shared';
5
5
  import { Disposable } from '../../shared/lifecycle';
@@ -47,7 +47,7 @@ export interface IUniverInstanceService {
47
47
  /** @deprecated */
48
48
  getCurrentUniverDocInstance(): Nullable<DocumentDataModel>;
49
49
  }
50
- export declare const IUniverInstanceService: import('@wendellhu/redi').IdentifierDecorator<IUniverInstanceService>;
50
+ export declare const IUniverInstanceService: import('../../common/di').IdentifierDecorator<IUniverInstanceService>;
51
51
  export declare class UniverInstanceService extends Disposable implements IUniverInstanceService {
52
52
  private readonly _injector;
53
53
  private readonly _contextService;
@@ -1,4 +1,4 @@
1
- import { Ctor, DependencyIdentifier } from '@wendellhu/redi';
1
+ import { Ctor, DependencyIdentifier } from '../../common/di';
2
2
 
3
3
  /**
4
4
  * This enum defines multiple lifecycle stages in Univer SDK.
@@ -1,5 +1,5 @@
1
- import { Injector } from '@wendellhu/redi';
2
1
  import { Observable } from 'rxjs';
2
+ import { Injector } from '../../common/di';
3
3
  import { Disposable } from '../../shared/lifecycle';
4
4
  import { ILogService } from '../log/log.service';
5
5
  import { LifecycleStages } from './lifecycle';
@@ -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
- export declare const ILocalStorageService: import('@wendellhu/redi').IdentifierDecorator<ILocalStorageService>;
16
+ export declare const ILocalStorageService: import('../../common/di').IdentifierDecorator<ILocalStorageService>;
17
17
  export type LocalStorageValueTypes = string;
18
18
  export interface ILocalStorageService {
19
19
  getItem<T>(key: string): Promise<T | null>;
@@ -15,7 +15,7 @@ export interface ILogService {
15
15
  error(...args: ArgsType): void;
16
16
  setLogLevel(enabled: LogLevel): void;
17
17
  }
18
- export declare const ILogService: import('@wendellhu/redi').IdentifierDecorator<ILogService>;
18
+ export declare const ILogService: import('../../common/di').IdentifierDecorator<ILogService>;
19
19
  export declare class DesktopLogService extends Disposable implements ILogService {
20
20
  private _logLevel;
21
21
  debug(...args: ArgsType): void;
@@ -40,4 +40,4 @@ export interface IPermissionService {
40
40
  composePermission(permissionId: string[]): IPermissionPoint<unknown>[];
41
41
  getAllPermissionPoint(): Map<string, Observable<IPermissionPoint<unknown>>>;
42
42
  }
43
- export declare const IPermissionService: import('@wendellhu/redi').IdentifierDecorator<IPermissionService>;
43
+ export declare const IPermissionService: import('../../common/di').IdentifierDecorator<IPermissionService>;
@@ -1,4 +1,4 @@
1
- import { Dependency, DependencyIdentifier, DependencyItem } from '@wendellhu/redi';
1
+ import { Dependency, DependencyIdentifier, DependencyItem } from '../../common/di';
2
2
 
3
3
  export type NullableDependencyPair<T> = [DependencyIdentifier<T>, DependencyItem<T> | null];
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Ctor, Injector } from '@wendellhu/redi';
1
+ import { Ctor, Injector } from '../../common/di';
2
2
  import { Disposable } from '../../shared';
3
3
  import { UniverInstanceType } from '../../common/unit';
4
4
 
@@ -15,7 +15,7 @@ export declare abstract class Plugin extends Disposable {
15
15
  static pluginName: string;
16
16
  static type: UniverInstanceType;
17
17
  protected abstract _injector: Injector;
18
- onStarting(injector: Injector): void;
18
+ onStarting(_injector?: Injector): void;
19
19
  onReady(): void;
20
20
  onRendered(): void;
21
21
  onSteady(): void;
@@ -1,4 +1,4 @@
1
- import { IDisposable, Injector } from '@wendellhu/redi';
1
+ import { IDisposable, Injector } from '../../common/di';
2
2
  import { Disposable } from '../../shared/lifecycle';
3
3
  import { UniverInstanceType } from '../../common/unit';
4
4
  import { LifecycleInitializerService, LifecycleService } from '../lifecycle/lifecycle.service';
@@ -49,6 +49,7 @@ export declare class PluginHolder extends Disposable {
49
49
  protected readonly _lifecycleInitializerService: LifecycleInitializerService;
50
50
  protected _started: boolean;
51
51
  get started(): boolean;
52
+ private _warnedAboutOnStartingDeprecation;
52
53
  /** Plugin constructors waiting to be initialized. */
53
54
  protected readonly _pluginRegistry: PluginRegistry;
54
55
  /** Stores initialized plugin instances. */
@@ -7,4 +7,4 @@ export interface IResourceLoaderService {
7
7
  saveWorkbook: (workbook: Workbook) => IWorkbookData;
8
8
  saveDoc: (doc: DocumentDataModel) => IDocumentData;
9
9
  }
10
- export declare const IResourceLoaderService: import('@wendellhu/redi').IdentifierDecorator<IResourceLoaderService>;
10
+ export declare const IResourceLoaderService: import('../../common/di').IdentifierDecorator<IResourceLoaderService>;
@@ -1,6 +1,6 @@
1
- import { IDisposable } from '@wendellhu/redi';
2
1
  import { Observable } from 'rxjs';
3
2
  import { UniverInstanceType } from '@univerjs/core';
3
+ import { IDisposable } from '../../common/di';
4
4
  import { IWorkbookData } from '../../types/interfaces/i-workbook-data';
5
5
 
6
6
  type IBusinessName = 'SHEET' | 'DOC';
@@ -23,5 +23,5 @@ export interface IResourceManagerService {
23
23
  loadResources: (unitId: string, resources: IWorkbookData['resources']) => void;
24
24
  unloadResources(unitId: string): void;
25
25
  }
26
- export declare const IResourceManagerService: import('@wendellhu/redi').IdentifierDecorator<IResourceManagerService>;
26
+ export declare const IResourceManagerService: import('@univerjs/core').IdentifierDecorator<IResourceManagerService>;
27
27
  export {};
@@ -6,7 +6,7 @@ import { ILogContext } from '../log/context';
6
6
  * or load snapshots. This service should be implemented by the host environment.
7
7
  * And it shouldn't contain any business logic.
8
8
  */
9
- export declare const ISnapshotServerService: import('@wendellhu/redi').IdentifierDecorator<ISnapshotServerService>;
9
+ export declare const ISnapshotServerService: import('../../common/di').IdentifierDecorator<ISnapshotServerService>;
10
10
  export interface ISnapshotServerService {
11
11
  /** Load snapshot from a database. */
12
12
  getUnitOnRev: (context: ILogContext, params: IGetUnitOnRevRequest) => Promise<IGetUnitOnRevResponse>;
@@ -13,8 +13,8 @@ export declare const textDecoder: TextDecoder;
13
13
  export declare function encodeWorksheetOtherMetas(worksheet: Partial<IWorksheetData>): Uint8Array;
14
14
  export declare function encodeWorkbookOtherMetas(workbook: IWorkbookData): Uint8Array;
15
15
  export declare function encodeDocOriginalMeta(document: IDocumentData): Uint8Array;
16
- export declare function decodeWorksheetOtherMetas(buffer: Uint8Array): Partial<IWorksheetData>;
17
- export declare function decodeWorkbookOtherMetas(buffer: Uint8Array): Partial<IWorkbookData>;
16
+ export declare function decodeWorksheetOtherMetas(buffer: Uint8Array | string): Partial<IWorksheetData>;
17
+ export declare function decodeWorkbookOtherMetas(buffer: Uint8Array | string): Partial<IWorkbookData>;
18
18
  export declare function decodePartOfCellData(buffer: Uint8Array | string): IObjectMatrixPrimitiveType<ICellData>;
19
19
  export declare function decodeDocOriginalMeta(buffer: Uint8Array | string): Partial<IDocumentData>;
20
20
  export declare function splitCellDataToBlocks(cellData: IObjectMatrixPrimitiveType<ICellData>, maxColumn: number): ISheetBlock[];
@@ -1,5 +1,5 @@
1
- import { IAccessor, IDisposable } from '@wendellhu/redi';
2
1
  import { Observable, BehaviorSubject } from 'rxjs';
2
+ import { IAccessor, IDisposable } from '../../common/di';
3
3
  import { Disposable } from '../../shared/lifecycle';
4
4
  import { IMutationInfo, CommandType, ICommandService } from '../command/command.service';
5
5
  import { IContextService } from '../context/context.service';
@@ -44,7 +44,7 @@ export interface IUndoRedoCommandInfos {
44
44
  undos: IMutationInfo[];
45
45
  redos: IMutationInfo[];
46
46
  }
47
- export declare const IUndoRedoService: import('@wendellhu/redi').IdentifierDecorator<IUndoRedoService>;
47
+ export declare const IUndoRedoService: import('../../common/di').IdentifierDecorator<IUndoRedoService>;
48
48
  export interface IUndoRedoStatus {
49
49
  undos: number;
50
50
  redos: number;
@@ -1,5 +1,5 @@
1
- import { IDisposable } from '@wendellhu/redi';
2
1
  import { Subscription, SubscriptionLike, Subject } from 'rxjs';
2
+ import { IDisposable } from '../common/di';
3
3
 
4
4
  type DisposableLike = IDisposable | SubscriptionLike | (() => void);
5
5
  export declare function toDisposable(disposable: IDisposable): IDisposable;
@@ -1,4 +1,4 @@
1
- import { IDisposable } from '@wendellhu/redi';
1
+ import { IDisposable } from '../../common/di';
2
2
 
3
3
  declare const NEWER: unique symbol;
4
4
  declare const OLDER: unique symbol;
@@ -1,5 +1,5 @@
1
- import { IDisposable } from '@wendellhu/redi';
2
1
  import { Observable } from 'rxjs';
2
+ import { IDisposable } from '../common/di';
3
3
 
4
4
  type CallbackFn<T extends readonly unknown[]> = (cb: (...args: T) => void) => IDisposable;
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { IDisposable } from '@wendellhu/redi';
1
+ import { IDisposable } from '../common/di';
2
2
  import { Nullable } from '../common/type-util';
3
3
  import { Disposable } from '../shared/lifecycle';
4
4
  import { ICellData, ICellDataForSheetInterceptor } from '../types/interfaces/i-cell-data';
@@ -1,8 +1,12 @@
1
1
  import { UnitModel, UniverInstanceType } from '../common/unit';
2
+ import { Nullable } from '../shared';
2
3
  import { ISlideData, ISlidePage } from '../types/interfaces';
3
4
 
4
5
  export declare class SlideDataModel extends UnitModel<ISlideData, UniverInstanceType.UNIVER_SLIDE> {
5
6
  type: UniverInstanceType.UNIVER_SLIDE;
7
+ private readonly _activePage$;
8
+ private get _activePage();
9
+ readonly activePage$: import('rxjs').Observable<Nullable<ISlidePage>>;
6
10
  private _snapshot;
7
11
  private _unitId;
8
12
  constructor(snapshot: Partial<ISlideData>);
@@ -20,4 +24,7 @@ export declare class SlideDataModel extends UnitModel<ISlideData, UniverInstance
20
24
  getElement(pageId: string, elementId: string): import('../types/interfaces').IPageElement | undefined;
21
25
  getPageSize(): import('../shared').ISize;
22
26
  addPage(): ISlidePage;
27
+ setActivePage(page: Nullable<ISlidePage>): void;
28
+ getActivePage(): Nullable<ISlidePage>;
29
+ updatePage(pageId: string, page: ISlidePage): void;
23
30
  }
@@ -49,7 +49,9 @@ export declare enum HorizontalAlign {
49
49
  LEFT = 1,// The text is explicitly aligned to the left of the cell.
50
50
  CENTER = 2,// The text is explicitly aligned to the center of the cell.
51
51
  RIGHT = 3,// The text is explicitly aligned to the right of the cell.
52
- JUSTIFIED = 4
52
+ JUSTIFIED = 4,// The paragraph is justified.
53
+ BOTH = 5,// The paragraph is justified.
54
+ DISTRIBUTED = 6
53
55
  }
54
56
  /**
55
57
  * An enum that specifies the vertical alignment of text.
@@ -143,12 +143,13 @@ export interface IListData {
143
143
  /**
144
144
  * Contains properties describing the look and feel of a list bullet at a given level of nesting.
145
145
  */
146
- export interface INestingLevel extends IIndentStart {
146
+ export interface INestingLevel {
147
+ paragraphProperties?: IParagraphProperties;
147
148
  bulletAlignment: BulletAlignment;
148
149
  glyphFormat: string;
149
- textStyle: ITextStyle;
150
+ textStyle?: ITextStyle;
150
151
  startNumber: number;
151
- glyphType?: GlyphType | string;
152
+ glyphType?: GlyphType;
152
153
  glyphSymbol?: string;
153
154
  }
154
155
  /**
@@ -163,14 +164,71 @@ export declare enum FollowNumberWithType {
163
164
  * An enumeration of the supported glyph types.
164
165
  */
165
166
  export declare enum GlyphType {
166
- GLYPH_TYPE_UNSPECIFIED = 0,// The glyph type is unspecified or unsupported.
167
+ BULLET = 0,// The glyph type is unspecified or unsupported.
167
168
  NONE = 1,// An empty string.
168
169
  DECIMAL = 2,// A number, like 1, 2, or 3.
169
- ZERO_DECIMAL = 3,// A number where single digit numbers are prefixed with a zero, like 01, 02, or 03. Numbers with more than one digit are not prefixed with a zero.
170
- UPPER_ALPHA = 4,// An uppercase letter, like A, B, or C.
171
- ALPHA = 5,// A lowercase letter, like a, b, or c.
170
+ DECIMAL_ZERO = 3,// A number where single digit numbers are prefixed with a zero, like 01, 02, or 03. Numbers with more than one digit are not prefixed with a zero.
171
+ UPPER_LETTER = 4,// An uppercase letter, like A, B, or C.
172
+ LOWER_LETTER = 5,// A lowercase letter, like a, b, or c.
172
173
  UPPER_ROMAN = 6,// An uppercase Roman numeral, like I, II, or III.
173
- ROMAN = 7
174
+ LOWER_ROMAN = 7,// A lowercase Roman numeral, like i, ii, or iii.
175
+ /**
176
+ * Not yet achieved, aligned with Excel's standards.
177
+ * 17.18.59 ST_NumberFormat (Numbering Format)
178
+ */
179
+ ORDINAL = 8,
180
+ CARDINAL_TEXT = 9,
181
+ ORDINAL_TEXT = 10,
182
+ HEX = 11,
183
+ CHICAGO = 12,
184
+ IDEOGRAPH_DIGITAL = 13,
185
+ JAPANESE_COUNTING = 14,
186
+ AIUEO = 15,
187
+ IROHA = 16,
188
+ DECIMAL_FULL_WIDTH = 17,
189
+ DECIMAL_HALF_WIDTH = 18,
190
+ JAPANESE_LEGAL = 19,
191
+ JAPANESE_DIGITAL_TEN_THOUSAND = 20,
192
+ DECIMAL_ENCLOSED_CIRCLE = 21,
193
+ DECIMAL_FULL_WIDTH2 = 22,
194
+ AIUEO_FULL_WIDTH = 23,
195
+ IROHA_FULL_WIDTH = 24,
196
+ GANADA = 25,
197
+ CHOSUNG = 26,
198
+ DECIMAL_ENCLOSED_FULLSTOP = 27,
199
+ DECIMAL_ENCLOSED_PAREN = 28,
200
+ DECIMAL_ENCLOSED_CIRCLE_CHINESE = 29,
201
+ IDEOGRAPH_ENCLOSED_CIRCLE = 30,
202
+ IDEOGRAPH_TRADITIONAL = 31,
203
+ IDEOGRAPH_ZODIAC = 32,
204
+ IDEOGRAPH_ZODIAC_TRADITIONAL = 33,
205
+ TAIWANESE_COUNTING = 34,
206
+ IDEOGRAPH_LEGAL_TRADITIONAL = 35,
207
+ TAIWANESE_COUNTING_THOUSAND = 36,
208
+ TAIWANESE_DIGITAL = 37,
209
+ CHINESE_COUNTING = 38,
210
+ CHINESE_LEGAL_SIMPLIFIED = 39,
211
+ CHINESE_COUNTING_THOUSAND = 40,
212
+ KOREAN_DIGITAL = 41,
213
+ KOREAN_COUNTING = 42,
214
+ KOREAN_LEGAL = 43,
215
+ KOREAN_DIGITAL2 = 44,
216
+ VIETNAMESE_COUNTING = 45,
217
+ RUSSIAN_LOWER = 46,
218
+ RUSSIAN_UPPER = 47,
219
+ NUMBER_IN_DASH = 48,
220
+ HEBREW1 = 49,
221
+ HEBREW2 = 50,
222
+ ARABIC_ALPHA = 51,
223
+ ARABIC_ABJAD = 52,
224
+ HINDI_VOWELS = 53,
225
+ HINDI_CONSONANTS = 54,
226
+ HINDI_NUMBERS = 55,
227
+ HINDI_COUNTING = 56,
228
+ THAI_LETTERS = 57,
229
+ THAI_NUMBERS = 58,
230
+ THAI_COUNTING = 59,
231
+ CUSTOM = 60
174
232
  }
175
233
  /**
176
234
  * The types of alignment for a bullet.
@@ -179,7 +237,8 @@ export declare enum BulletAlignment {
179
237
  BULLET_ALIGNMENT_UNSPECIFIED = 0,// The bullet alignment is unspecified.
180
238
  START = 1,// The bullet is aligned to the start of the space allotted for rendering the bullet. Left-aligned for LTR text, right-aligned otherwise.
181
239
  CENTER = 2,// The bullet is aligned to the center of the space allotted for rendering the bullet.
182
- END = 3
240
+ END = 3,// The bullet is aligned to the end of the space allotted for rendering the bullet. Right-aligned for LTR text, left-aligned otherwise.
241
+ BOTH = 4
183
242
  }
184
243
  export interface IMargin {
185
244
  marginTop?: number;
@@ -393,7 +452,7 @@ export interface IBullet {
393
452
  listType: string;
394
453
  listId: string;
395
454
  nestingLevel: number;
396
- textStyle: ITextStyle;
455
+ textStyle?: ITextStyle;
397
456
  }
398
457
  /**
399
458
  * Properties of Drawing
@@ -468,11 +527,15 @@ export interface IIndentStart {
468
527
  hanging?: INumberUnit;
469
528
  indentStart?: INumberUnit;
470
529
  tabStops?: ITabStop[];
530
+ indentEnd?: INumberUnit;
471
531
  }
472
532
  /**
473
533
  * Properties of paragraph style
474
534
  */
475
- export interface IParagraphStyle extends IIndentStart {
535
+ export interface IParagraphStyle extends IParagraphProperties {
536
+ textStyle?: ITextStyle;
537
+ }
538
+ export interface IParagraphProperties extends IIndentStart {
476
539
  headingId?: string;
477
540
  namedStyleType?: NamedStyleType;
478
541
  horizontalAlign?: HorizontalAlign;
@@ -487,7 +550,6 @@ export interface IParagraphStyle extends IIndentStart {
487
550
  borderBottom?: IParagraphBorder;
488
551
  borderLeft?: IParagraphBorder;
489
552
  borderRight?: IParagraphBorder;
490
- indentEnd?: INumberUnit;
491
553
  keepLines?: BooleanNumber;
492
554
  keepNext?: BooleanNumber;
493
555
  wordWrap?: BooleanNumber;
@@ -1,4 +1,4 @@
1
- import { Injector } from '@wendellhu/redi';
1
+ import { Injector } from './common/di';
2
2
  import { DocumentDataModel } from './docs/data-model/document-data-model';
3
3
  import { Workbook } from './sheets/workbook';
4
4
  import { SlideDataModel } from './slides/slide-model';