@univerjs-pro/collaboration 0.1.12 → 0.1.13

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 (20) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +1 -1
  3. package/lib/types/controllers/doc-transform/algorithms/doc-algo.d.ts +2 -1
  4. package/lib/types/controllers/doc-transform/json-x-pro/json-x-pro.d.ts +6 -0
  5. package/lib/types/controllers/doc-transform/text-x-pro/text-x-pro.d.ts +4 -2
  6. package/lib/types/controllers/sheet-transform/algorithms/add-worksheet-merge/insert-col.algo.d.ts +1 -1
  7. package/lib/types/controllers/sheet-transform/algorithms/add-worksheet-merge/insert-row.algo.d.ts +1 -1
  8. package/lib/types/controllers/sheet-transform/algorithms/add-worksheet-merge/move-col.algo.d.ts +1 -1
  9. package/lib/types/controllers/sheet-transform/algorithms/add-worksheet-merge/move-range.algo.d.ts +1 -1
  10. package/lib/types/controllers/sheet-transform/algorithms/add-worksheet-merge/move-row.algo.d.ts +1 -1
  11. package/lib/types/controllers/sheet-transform/algorithms/add-worksheet-merge/remove-col.algo.d.ts +1 -1
  12. package/lib/types/controllers/sheet-transform/algorithms/add-worksheet-merge/remove-row.algo.d.ts +1 -1
  13. package/lib/types/controllers/sheet-transform/algorithms/add-worksheet-merge/remove-worksheet-merge.algo.d.ts +1 -1
  14. package/lib/types/controllers/sheet-transform/algorithms/add-worksheet-merge/set-range-values.algo.d.ts +1 -1
  15. package/lib/types/controllers/sheet-transform/algorithms/remove-worksheet-merge/insert-row.algo.d.ts +1 -1
  16. package/lib/types/index.d.ts +1 -1
  17. package/lib/types/models/changeset.d.ts +3 -2
  18. package/lib/types/models/collaboration-events.d.ts +2 -1
  19. package/lib/umd/index.js +1 -1
  20. package/package.json +18 -18
@@ -1,4 +1,5 @@
1
+ import { IRichTextEditingMutationParams } from '@univerjs/docs';
1
2
  import { IMutationTransformAlgorithm } from '../../../services/transform/transform.service';
2
3
 
3
4
  export declare const RichTextEditingMutationWithSelf: IMutationTransformAlgorithm;
4
- export declare const DocAlgorithms: Array<IMutationTransformAlgorithm<any, any>>;
5
+ export declare const DocAlgorithms: Array<IMutationTransformAlgorithm<IRichTextEditingMutationParams, IRichTextEditingMutationParams>>;
@@ -0,0 +1,6 @@
1
+ import { JSONXActions, TPriority, JSON1, JSONX } from '@univerjs/core';
2
+
3
+ export declare class JSONXPro extends JSONX {
4
+ static transform(thisActions: JSONXActions, otherActions: JSONXActions, priority: TPriority): JSON1.JSONOpList | null | undefined;
5
+ static transformPosition(thisActions: JSONXActions, index: number, priority?: TPriority): number;
6
+ }
@@ -1,6 +1,8 @@
1
- import { TextXAction, TextX } from '@univerjs/core';
1
+ import { TextXAction, TPriority, TextX } from '@univerjs/core';
2
2
 
3
3
  export declare class TextXPro extends TextX {
4
+ static name: string;
5
+ static id: string;
4
6
  /**
5
7
  * |(this↓ \| other→) | **insert** | **retain** | **delete** |
6
8
  * | ---------------- | ---------- | ---------- | ---------- |
@@ -25,7 +27,7 @@ export declare class TextXPro extends TextX {
25
27
  * 1) If the other body attribute does not exist, directly retain length
26
28
  * 2) If the other body property exists, then execute the TransformBody logic to override it
27
29
  */
28
- static transform(thisActions: TextXAction[], otherActions: TextXAction[], priority?: boolean): TextXAction[];
30
+ static transform(thisActions: TextXAction[], otherActions: TextXAction[], priority?: TPriority): TextXAction[];
29
31
  /**
30
32
  * Used to transform selection. Why not named transformSelection?
31
33
  * Because Univer Doc supports multiple Selections in one document, user need to encapsulate transformSelections at the application layer.
@@ -1,6 +1,6 @@
1
1
  import { IAddWorksheetMergeMutationParams, IInsertColMutationParams, IInsertRowMutationParams, IMoveRangeMutationParams, IRemoveColMutationParams, IRemoveRowsMutationParams, IRemoveWorksheetMergeMutationParams } from '@univerjs/sheets';
2
2
  import { IMutationInfo } from '@univerjs/core';
3
- import { IMutationTransformAlgorithm } from '../../../..';
3
+ import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
4
4
 
5
5
  export type IMutationInfoArrWithMergeAndRowCol = Array<IMutationInfo<IInsertRowMutationParams> | IMutationInfo<IInsertColMutationParams> | IMutationInfo<IRemoveRowsMutationParams> | IMutationInfo<IRemoveColMutationParams> | IMutationInfo<IAddWorksheetMergeMutationParams> | IMutationInfo<IRemoveWorksheetMergeMutationParams> | IMutationInfo<IMoveRangeMutationParams>>;
6
6
  export declare const addWorksheetMergeMutationWithInsertColMutation: IMutationTransformAlgorithm<IAddWorksheetMergeMutationParams, IInsertColMutationParams>;
@@ -1,6 +1,6 @@
1
1
  import { IAddWorksheetMergeMutationParams, IInsertColMutationParams, IInsertRowMutationParams, IRemoveColMutationParams, IRemoveRowsMutationParams, IRemoveWorksheetMergeMutationParams } from '@univerjs/sheets';
2
2
  import { IMutationInfo } from '@univerjs/core';
3
- import { IMutationTransformAlgorithm } from '../../../..';
3
+ import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
4
4
 
5
5
  export type IMutationInfoArrWithMergeAndRowCol = Array<IMutationInfo<IInsertRowMutationParams> | IMutationInfo<IInsertColMutationParams> | IMutationInfo<IRemoveRowsMutationParams> | IMutationInfo<IRemoveColMutationParams> | IMutationInfo<IAddWorksheetMergeMutationParams> | IMutationInfo<IRemoveWorksheetMergeMutationParams>>;
6
6
  export declare const addWorksheetMergeMutationWithInsertRowMutation: IMutationTransformAlgorithm<IAddWorksheetMergeMutationParams, IInsertRowMutationParams>;
@@ -1,4 +1,4 @@
1
1
  import { IAddWorksheetMergeMutationParams, IMoveColumnsMutationParams } from '@univerjs/sheets';
2
- import { IMutationTransformAlgorithm } from '../../../..';
2
+ import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
3
3
 
4
4
  export declare const addWorksheetMergeMutationWithMoveColMutation: IMutationTransformAlgorithm<IAddWorksheetMergeMutationParams, IMoveColumnsMutationParams>;
@@ -1,4 +1,4 @@
1
1
  import { IAddWorksheetMergeMutationParams, IMoveRangeMutationParams } from '@univerjs/sheets';
2
- import { IMutationTransformAlgorithm } from '../../../..';
2
+ import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
3
3
 
4
4
  export declare const addWorksheetMergeMutationWithMoveRangeMutation: IMutationTransformAlgorithm<IAddWorksheetMergeMutationParams, IMoveRangeMutationParams>;
@@ -1,4 +1,4 @@
1
1
  import { IAddWorksheetMergeMutationParams, IMoveRowsMutationParams } from '@univerjs/sheets';
2
- import { IMutationTransformAlgorithm } from '../../../..';
2
+ import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
3
3
 
4
4
  export declare const addWorksheetMergeMutationWithMoveRowMutation: IMutationTransformAlgorithm<IAddWorksheetMergeMutationParams, IMoveRowsMutationParams>;
@@ -1,4 +1,4 @@
1
1
  import { IAddWorksheetMergeMutationParams, IRemoveColMutationParams } from '@univerjs/sheets';
2
- import { IMutationTransformAlgorithm } from '../../../..';
2
+ import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
3
3
 
4
4
  export declare const addWorksheetMergeMutationWithRemoveColMutation: IMutationTransformAlgorithm<IAddWorksheetMergeMutationParams, IRemoveColMutationParams>;
@@ -1,4 +1,4 @@
1
1
  import { IAddWorksheetMergeMutationParams, IRemoveRowsMutationParams } from '@univerjs/sheets';
2
- import { IMutationTransformAlgorithm } from '../../../..';
2
+ import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
3
3
 
4
4
  export declare const addWorksheetMergeMutationWithRemoveRowMutation: IMutationTransformAlgorithm<IAddWorksheetMergeMutationParams, IRemoveRowsMutationParams>;
@@ -1,4 +1,4 @@
1
1
  import { IAddWorksheetMergeMutationParams, IRemoveWorksheetMergeMutationParams } from '@univerjs/sheets';
2
- import { IMutationTransformAlgorithm } from '../../../..';
2
+ import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
3
3
 
4
4
  export declare const addWorksheetMergeMutationWithRemoveWorksheetMergeMutation: IMutationTransformAlgorithm<IAddWorksheetMergeMutationParams, IRemoveWorksheetMergeMutationParams>;
@@ -1,4 +1,4 @@
1
1
  import { IAddWorksheetMergeMutationParams, ISetRangeValuesMutationParams } from '@univerjs/sheets';
2
- import { IMutationTransformAlgorithm } from '../../../..';
2
+ import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
3
3
 
4
4
  export declare const addWorksheetMergeMutationWithSetRangeValues: IMutationTransformAlgorithm<IAddWorksheetMergeMutationParams, ISetRangeValuesMutationParams>;
@@ -1,4 +1,4 @@
1
1
  import { IInsertRowMutationParams, IRemoveWorksheetMergeMutationParams } from '@univerjs/sheets';
2
- import { IMutationTransformAlgorithm } from '../../../..';
2
+ import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
3
3
 
4
4
  export declare const removeWorksheetMergeMutationWithInsertRowMutation: IMutationTransformAlgorithm<IRemoveWorksheetMergeMutationParams, IInsertRowMutationParams>;
@@ -1,6 +1,6 @@
1
1
  export { SheetTransformController } from './controllers/sheet-transform/sheet-transform.controller';
2
2
  export { DocTransformController } from './controllers/doc-transform/doc-transform.controller';
3
- export { type IChangeset, parseChangesetToProtocol, parseMutationToProtocol, parseProtocolChangeset, parseProtocolMutation, } from './models/changeset';
3
+ export { type IChangeset, parseProtocolCommand, parseChangesetToProtocol, parseMutationToProtocol, parseProtocolChangeset, parseProtocolMutation, } from './models/changeset';
4
4
  export { CollaborationEvent, type IAcknowledgedChangeset, type IAcknowledgementEvent, type ICollaborationEvent, type ICollaborationUser, type IFetchingMissEvent, type IFetchOperationsEvent, type INewChangesetsEvent, type INewHostEvent, type IOperationEvent, type IPseudoFetchMissingResultEvent, type IRejectedChangeset, type IRejectionEvent, type IRequestHostEvent, type ISubmitChangesetEvent, type ITerminateEvent, type IUpdateCursorEvent, type IUserJoinEvent, type IUserLeaveEvent, type IUserSelectionEvent, } from './models/collaboration-events';
5
5
  export { type ICombRequestEvent, type ICombResponseEvent, type IHeartbeatRequestEvent, type IHeartbeatResponseEvent, type IHelloRequestEvent, type IHelloResponseEvent, type IIngestQuestEvent, type IJoinRequestEvent, type IJoinResponseEvent, type ILeaveRequestEvent, type IRecvResponseEvent, } from './models/socket-events';
6
6
  export { CollaborationPlugin } from './plugin';
@@ -1,5 +1,5 @@
1
- import { IMutationInfo } from '@univerjs/core';
2
- import { IChangeset as IProtocolChangeset, IMutation as IProtocolMutation, UniverType } from '@univerjs/protocol';
1
+ import { ICommandInfo, IMutationInfo } from '@univerjs/core';
2
+ import { IChangeset as IProtocolChangeset, ICommand as IProtocolCommand, IMutation as IProtocolMutation, UniverType } from '@univerjs/protocol';
3
3
 
4
4
  export interface IChangeset {
5
5
  unitID: string;
@@ -11,6 +11,7 @@ export interface IChangeset {
11
11
  memberID: string;
12
12
  }
13
13
  export declare function parseProtocolChangeset(protocolChangeset: IProtocolChangeset): IChangeset;
14
+ export declare function parseProtocolCommand(protocolCommands: IProtocolCommand[]): ICommandInfo[];
14
15
  export declare function parseChangesetToProtocol(changeset: IChangeset): IProtocolChangeset;
15
16
  export declare function parseProtocolMutation(mutation: IProtocolMutation): IMutationInfo;
16
17
  export declare function parseMutationToProtocol(mutation: IMutationInfo): IProtocolMutation;
@@ -86,7 +86,8 @@ export declare enum CollaborationEvent {
86
86
  /**
87
87
  * This type will be returned if an error is reported.
88
88
  */
89
- MSG_FOR_ERROR = "error_msg"
89
+ MSG_FOR_ERROR = "error_msg",
90
+ PERMISSION_REJ = "permission_rej"
90
91
  }
91
92
  /**
92
93
  * Awaiting mutations were acknowledged by the server.