@univerjs/core 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +9 -9
- package/lib/es/index.js +1249 -1219
- package/lib/types/docs/data-model/types.d.ts +2 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/floating-object/floating-object-manager.service.d.ts +3 -3
- package/lib/types/services/plugin/__tests__/plugin-override.spec.d.ts +16 -0
- package/lib/types/services/plugin/plugin-override.d.ts +4 -3
- package/lib/types/services/user-manager/user-manager.service.d.ts +16 -0
- package/lib/types/shared/after-init-apply.d.ts +3 -0
- package/lib/types/shared/index.d.ts +1 -0
- package/lib/types/types/interfaces/i-document-data.d.ts +15 -15
- package/lib/umd/index.js +8 -8
- package/package.json +2 -2
package/lib/types/index.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export { type IStyleSheet, ThemeService } from './services/theme/theme.service';
|
|
|
59
59
|
export { type IUndoRedoCommandInfos, type IUndoRedoCommandInfosByInterceptor, type IUndoRedoItem, IUndoRedoService, type IUndoRedoStatus, LocalUndoRedoService, RedoCommand, UndoCommand, RedoCommandId, UndoCommandId, } from './services/undoredo/undoredo.service';
|
|
60
60
|
export * from './shared';
|
|
61
61
|
export { fromCallback } from './shared/rxjs';
|
|
62
|
+
export { UserManagerService } from './services/user-manager/user-manager.service';
|
|
62
63
|
export type { IComposeInterceptors, IInterceptor, InterceptorHandler } from './common/interceptor';
|
|
63
64
|
export { composeInterceptors, createInterceptorKey, InterceptorManager } from './common/interceptor';
|
|
64
65
|
export { normalizeTextRuns } from './docs/data-model/apply-utils/common';
|
|
@@ -12,6 +12,7 @@ export interface IFloatingObjectManagerSearchItemParam extends IFloatingObjectMa
|
|
|
12
12
|
floatingObjectId: string;
|
|
13
13
|
}
|
|
14
14
|
export interface IFloatingObjectManagerParam extends IFloatingObjectManagerSearchItemParam {
|
|
15
|
+
behindText?: boolean;
|
|
15
16
|
floatingObject: ITransformState;
|
|
16
17
|
}
|
|
17
18
|
export type FloatingObjects = Map<string, ITransformState>;
|
|
@@ -26,8 +27,7 @@ export interface IFloatingObjectManagerService {
|
|
|
26
27
|
clear(search: IFloatingObjectManagerSearchParam): void;
|
|
27
28
|
addOrUpdate(insertParam: IFloatingObjectManagerParam): void;
|
|
28
29
|
remove(searchItem: IFloatingObjectManagerSearchItemParam): void;
|
|
29
|
-
|
|
30
|
-
remove(searchItem: IFloatingObjectManagerSearchItemParam): void;
|
|
30
|
+
batchAddOrUpdate(insertParam: IFloatingObjectManagerParam[]): void;
|
|
31
31
|
pluginUpdateRefresh(searchObjects: IFloatingObjectManagerParam[]): void;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -70,7 +70,7 @@ export declare class FloatingObjectManagerService implements IDisposable, IFloat
|
|
|
70
70
|
dispose(): void;
|
|
71
71
|
clear(search: IFloatingObjectManagerSearchParam): void;
|
|
72
72
|
addOrUpdate(insertParam: IFloatingObjectManagerParam): void;
|
|
73
|
-
|
|
73
|
+
batchAddOrUpdate(insertParams: IFloatingObjectManagerParam[]): void;
|
|
74
74
|
remove(searchItem: IFloatingObjectManagerSearchItemParam): void;
|
|
75
75
|
pluginUpdateRefresh(updateObjects: IFloatingObjectManagerParam[]): void;
|
|
76
76
|
private _getFloatingObjects;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Dependency,
|
|
1
|
+
import { Dependency, DependencyIdentifier, DependencyItem } from '@wendellhu/redi';
|
|
2
2
|
|
|
3
|
+
export type NullableDependencyPair<T> = [DependencyIdentifier<T>, DependencyItem<T> | null];
|
|
3
4
|
/**
|
|
4
|
-
* Overrides the dependencies
|
|
5
|
+
* Overrides the dependencies defined in the plugin. Only dependencies that are identified by `IdentifierDecorator` can be overridden.
|
|
5
6
|
* If you override a dependency with `null`, the original dependency will be removed.
|
|
6
7
|
*/
|
|
7
|
-
export type DependencyOverride =
|
|
8
|
+
export type DependencyOverride = NullableDependencyPair<any>[];
|
|
8
9
|
export declare function mergeOverrideWithDependencies(dependencies: Dependency[], override?: DependencyOverride): Dependency[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IUser } from '@univerjs/protocol';
|
|
2
|
+
|
|
3
|
+
export declare class UserManagerService {
|
|
4
|
+
private _model;
|
|
5
|
+
private _userChange$;
|
|
6
|
+
userChange$: import('rxjs').Observable<{
|
|
7
|
+
type: 'add' | 'delete';
|
|
8
|
+
user: IUser;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'clear';
|
|
11
|
+
}>;
|
|
12
|
+
addUser(user: IUser): void;
|
|
13
|
+
getUser(userId: string, callBack?: () => void): IUser | undefined;
|
|
14
|
+
delete(userId: string): void;
|
|
15
|
+
clear(): void;
|
|
16
|
+
}
|
|
@@ -409,8 +409,8 @@ export declare enum PositionedObjectLayoutType {
|
|
|
409
409
|
*/
|
|
410
410
|
export interface IObjectTransform {
|
|
411
411
|
size: ISize;
|
|
412
|
-
positionH:
|
|
413
|
-
positionV:
|
|
412
|
+
positionH: IObjectPositionH;
|
|
413
|
+
positionV: IObjectPositionV;
|
|
414
414
|
angle: number;
|
|
415
415
|
}
|
|
416
416
|
/**
|
|
@@ -609,37 +609,37 @@ export interface INumberUnit {
|
|
|
609
609
|
v: number;
|
|
610
610
|
u: NumberUnitType;
|
|
611
611
|
}
|
|
612
|
-
export interface
|
|
612
|
+
export interface IObjectPositionH {
|
|
613
613
|
relativeFrom: ObjectRelativeFromH;
|
|
614
614
|
align?: AlignTypeH;
|
|
615
615
|
posOffset?: number;
|
|
616
616
|
percent?: number;
|
|
617
617
|
}
|
|
618
|
-
export interface
|
|
618
|
+
export interface IObjectPositionV {
|
|
619
619
|
relativeFrom: ObjectRelativeFromV;
|
|
620
620
|
align?: AlignTypeV;
|
|
621
621
|
posOffset?: number;
|
|
622
622
|
percent?: number;
|
|
623
623
|
}
|
|
624
624
|
export declare enum ObjectRelativeFromH {
|
|
625
|
-
|
|
625
|
+
PAGE = 0,
|
|
626
626
|
COLUMN = 1,
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
627
|
+
CHARACTER = 2,
|
|
628
|
+
MARGIN = 3,
|
|
629
|
+
INSIDE_MARGIN = 4,
|
|
630
630
|
OUTSIDE_MARGIN = 5,
|
|
631
|
-
|
|
631
|
+
LEFT_MARGIN = 6,
|
|
632
632
|
RIGHT_MARGIN = 7
|
|
633
633
|
}
|
|
634
634
|
export declare enum ObjectRelativeFromV {
|
|
635
|
-
|
|
636
|
-
|
|
635
|
+
PAGE = 0,
|
|
636
|
+
PARAGRAPH = 1,
|
|
637
637
|
LINE = 2,
|
|
638
638
|
MARGIN = 3,
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
639
|
+
TOP_MARGIN = 4,
|
|
640
|
+
BOTTOM_MARGIN = 5,
|
|
641
|
+
INSIDE_MARGIN = 6,
|
|
642
|
+
OUTSIDE_MARGIN = 7
|
|
643
643
|
}
|
|
644
644
|
export declare enum NumberUnitType {
|
|
645
645
|
POINT = 0,
|