@univerjs/core 0.2.4-alpha.0 → 0.2.4

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 (31) hide show
  1. package/lib/cjs/index.js +9 -11
  2. package/lib/es/index.js +4133 -5118
  3. package/lib/types/docs/data-model/text-x/text-x.d.ts +1 -0
  4. package/lib/types/index.d.ts +0 -1
  5. package/lib/types/services/__tests__/index.d.ts +7 -7
  6. package/lib/types/services/authz-io/type.d.ts +1 -1
  7. package/lib/types/services/command/command.service.d.ts +2 -2
  8. package/lib/types/services/config/config.service.d.ts +1 -1
  9. package/lib/types/services/context/context.service.d.ts +1 -1
  10. package/lib/types/services/instance/instance.service.d.ts +2 -2
  11. package/lib/types/services/lifecycle/lifecycle.d.ts +1 -1
  12. package/lib/types/services/lifecycle/lifecycle.service.d.ts +1 -1
  13. package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
  14. package/lib/types/services/log/log.service.d.ts +1 -1
  15. package/lib/types/services/permission/type.d.ts +1 -1
  16. package/lib/types/services/plugin/plugin-override.d.ts +1 -1
  17. package/lib/types/services/plugin/plugin.d.ts +1 -1
  18. package/lib/types/services/plugin/plugin.service.d.ts +1 -1
  19. package/lib/types/services/resource-loader/type.d.ts +1 -1
  20. package/lib/types/services/resource-manager/type.d.ts +2 -2
  21. package/lib/types/services/snapshot/snapshot-server.service.d.ts +1 -1
  22. package/lib/types/services/undoredo/undoredo.service.d.ts +2 -2
  23. package/lib/types/shared/lifecycle.d.ts +1 -1
  24. package/lib/types/shared/lru/lru-map.d.ts +1 -1
  25. package/lib/types/shared/rxjs.d.ts +1 -1
  26. package/lib/types/sheets/view-model.d.ts +1 -1
  27. package/lib/types/types/interfaces/i-document-data.d.ts +3 -0
  28. package/lib/types/univer.d.ts +1 -1
  29. package/lib/umd/index.js +9 -11
  30. package/package.json +4 -4
  31. package/lib/types/common/di.d.ts +0 -17
@@ -16,6 +16,7 @@ export declare class TextX {
16
16
  insert(len: number, body: IDocumentBody, segmentId?: string): this;
17
17
  retain(len: number, segmentId?: string, body?: IDocumentBody, coverType?: UpdateDocsAttributeType): this;
18
18
  delete(len: number, segmentId?: string): this;
19
+ empty(): this;
19
20
  serialize(): TextXAction[];
20
21
  push(...args: TextXAction[]): this;
21
22
  protected trimEndUselessRetainAction(): this;
@@ -110,4 +110,3 @@ export { normalizeBody, getCustomRangeSlice, getCustomDecorationSlice } from './
110
110
  export { updateAttributeByDelete } from './docs/data-model/text-x/apply-utils/delete-apply';
111
111
  export { updateAttributeByInsert } from './docs/data-model/text-x/apply-utils/insert-apply';
112
112
  export { nameCharacterCheck } from './shared/name';
113
- export * from './common/di';
@@ -1,15 +1,15 @@
1
1
  import { ICommandService, Univer } from '@univerjs/core';
2
- import { Dependency } from '../../common/di';
2
+ import { Dependency } from '@wendellhu/redi';
3
3
 
4
4
  export declare const createTestBed: (dependencies?: Dependency[]) => {
5
5
  univer: Univer;
6
6
  get: {
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;
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;
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('@univerjs/core').IdentifierDecorator<IAuthzIoService>;
20
+ export declare const IAuthzIoService: import('@wendellhu/redi').IdentifierDecorator<IAuthzIoService>;
@@ -1,4 +1,4 @@
1
- import { IAccessor, IDisposable, Injector } from '../../common/di';
1
+ import { IAccessor, IDisposable, Injector } from '@wendellhu/redi';
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('../../common/di').IdentifierDecorator<ICommandService>;
114
+ export declare const ICommandService: import('@wendellhu/redi').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('../../common/di').IdentifierDecorator<IConfigService>;
6
+ export declare const IConfigService: import('@wendellhu/redi').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('../../common/di').IdentifierDecorator<IContextService>;
12
+ export declare const IContextService: import('@wendellhu/redi').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';
1
2
  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('../../common/di').IdentifierDecorator<IUniverInstanceService>;
50
+ export declare const IUniverInstanceService: import('@wendellhu/redi').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 '../../common/di';
1
+ import { Ctor, DependencyIdentifier } from '@wendellhu/redi';
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';
1
2
  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('../../common/di').IdentifierDecorator<ILocalStorageService>;
16
+ export declare const ILocalStorageService: import('@wendellhu/redi').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('../../common/di').IdentifierDecorator<ILogService>;
18
+ export declare const ILogService: import('@wendellhu/redi').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('../../common/di').IdentifierDecorator<IPermissionService>;
43
+ export declare const IPermissionService: import('@wendellhu/redi').IdentifierDecorator<IPermissionService>;
@@ -1,4 +1,4 @@
1
- import { Dependency, DependencyIdentifier, DependencyItem } from '../../common/di';
1
+ import { Dependency, DependencyIdentifier, DependencyItem } from '@wendellhu/redi';
2
2
 
3
3
  export type NullableDependencyPair<T> = [DependencyIdentifier<T>, DependencyItem<T> | null];
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Ctor, Injector } from '../../common/di';
1
+ import { Ctor, Injector } from '@wendellhu/redi';
2
2
  import { Disposable } from '../../shared';
3
3
  import { UniverInstanceType } from '../../common/unit';
4
4
 
@@ -1,4 +1,4 @@
1
- import { IDisposable, Injector } from '../../common/di';
1
+ import { IDisposable, Injector } from '@wendellhu/redi';
2
2
  import { Disposable } from '../../shared/lifecycle';
3
3
  import { UniverInstanceType } from '../../common/unit';
4
4
  import { LifecycleInitializerService, LifecycleService } from '../lifecycle/lifecycle.service';
@@ -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('../../common/di').IdentifierDecorator<IResourceLoaderService>;
10
+ export declare const IResourceLoaderService: import('@wendellhu/redi').IdentifierDecorator<IResourceLoaderService>;
@@ -1,6 +1,6 @@
1
+ import { IDisposable } from '@wendellhu/redi';
1
2
  import { Observable } from 'rxjs';
2
3
  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('@univerjs/core').IdentifierDecorator<IResourceManagerService>;
26
+ export declare const IResourceManagerService: import('@wendellhu/redi').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('../../common/di').IdentifierDecorator<ISnapshotServerService>;
9
+ export declare const ISnapshotServerService: import('@wendellhu/redi').IdentifierDecorator<ISnapshotServerService>;
10
10
  export interface ISnapshotServerService {
11
11
  /** Load snapshot from a database. */
12
12
  getUnitOnRev: (context: ILogContext, params: IGetUnitOnRevRequest) => Promise<IGetUnitOnRevResponse>;
@@ -1,5 +1,5 @@
1
+ import { IAccessor, IDisposable } from '@wendellhu/redi';
1
2
  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('../../common/di').IdentifierDecorator<IUndoRedoService>;
47
+ export declare const IUndoRedoService: import('@wendellhu/redi').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';
1
2
  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 '../../common/di';
1
+ import { IDisposable } from '@wendellhu/redi';
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';
1
2
  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 '../common/di';
1
+ import { IDisposable } from '@wendellhu/redi';
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';
@@ -30,6 +30,7 @@ export interface IReferenceSource {
30
30
  lists?: ILists;
31
31
  drawings?: IDrawings;
32
32
  drawingsOrder?: string[];
33
+ headerFooterDrawingsOrder?: string[];
33
34
  }
34
35
  export interface IDocumentSettings {
35
36
  zoomRatio?: number;
@@ -758,5 +759,7 @@ export interface ITransformState extends IAbsoluteTransform, IRotationSkewFlipTr
758
759
  export interface IDrawingParam extends IDrawingSearch {
759
760
  drawingType: DrawingType;
760
761
  transform?: Nullable<ITransformState>;
762
+ transforms?: Nullable<ITransformState[]>;
763
+ isMultiTransform?: BooleanNumber;
761
764
  groupId?: string;
762
765
  }
@@ -1,4 +1,4 @@
1
- import { Injector } from './common/di';
1
+ import { Injector } from '@wendellhu/redi';
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';