@univerjs-pro/collaboration-client-ui 1.0.0-alpha.1 → 1.0.0-alpha.3
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/README.md +6 -3
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/controllers/clipboard/docs/image/image-paste.controller.d.ts +1 -2
- package/lib/types/controllers/collab-cursor/board-collab-cursor-entity.d.ts +31 -0
- package/lib/types/controllers/collab-cursor/board-collab-cursor-render.controller.d.ts +21 -0
- package/lib/types/controllers/collab-cursor/collab-cursor.controller.d.ts +3 -2
- package/lib/types/controllers/collab-cursor/slide-collab-cursor-entity.d.ts +1 -1
- package/lib/types/controllers/collab-status/collab-status.controller.d.ts +11 -0
- package/lib/types/index.d.ts +0 -2
- package/lib/types/models/cursor.d.ts +12 -8
- package/lib/types/views/shapes/sheet-collab-cursor.shape.d.ts +2 -0
- package/lib/types/views/shapes/slide-collab-cursor.shape.d.ts +2 -2
- package/lib/types/views/shapes/text-bubble.shape.d.ts +1 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +23 -22
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { RxDisposable } from '@univerjs/core';
|
|
1
|
+
import { IImageIoService, RxDisposable } from '@univerjs/core';
|
|
2
2
|
import { IDocClipboardService } from '@univerjs/docs-ui';
|
|
3
|
-
import { IImageIoService } from '@univerjs/drawing';
|
|
4
3
|
export declare class ImagePasteController extends RxDisposable {
|
|
5
4
|
private _docClipboardService;
|
|
6
5
|
private _imageIoService;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ICollaborationUser } from '@univerjs-pro/collaboration';
|
|
2
|
+
import type { CollaborationSession } from '@univerjs-pro/collaboration-client';
|
|
3
|
+
import type { IBoardCollabCursor, IBoardCollabSelectionPayload } from '../../models/cursor';
|
|
4
|
+
import { IBoardElementStateService } from '@univerjs-pro/boards-ui';
|
|
5
|
+
import { MemberService } from '@univerjs-pro/collaboration-client';
|
|
6
|
+
import { RxDisposable } from '@univerjs/core';
|
|
7
|
+
import { ColorAssignService } from '../../services/color-assign/color-assign.service';
|
|
8
|
+
export declare function parseBoardCursorSelection(selection: string): IBoardCollabSelectionPayload | null;
|
|
9
|
+
export declare class BoardCollabCursorEntity extends RxDisposable {
|
|
10
|
+
readonly unitID: string;
|
|
11
|
+
private readonly _session;
|
|
12
|
+
private readonly _colorAssignService;
|
|
13
|
+
private readonly _memberService;
|
|
14
|
+
private readonly _boardElementStateService;
|
|
15
|
+
private _online;
|
|
16
|
+
private _init;
|
|
17
|
+
private _cursorInfo$;
|
|
18
|
+
cursorInfo$: import("rxjs").Observable<Map<string, import("../../models/cursor").IElementCollabCursor>>;
|
|
19
|
+
get cursorInfo(): Readonly<Map<string, IBoardCollabCursor>>;
|
|
20
|
+
private _roomMembers$;
|
|
21
|
+
roomMembers$: import("rxjs").Observable<ICollaborationUser[]>;
|
|
22
|
+
get roomMembers(): Readonly<ICollaborationUser[]>;
|
|
23
|
+
constructor(unitID: string, _session: CollaborationSession, _colorAssignService: ColorAssignService, _memberService: MemberService, _boardElementStateService: IBoardElementStateService);
|
|
24
|
+
dispose(): void;
|
|
25
|
+
init(): void;
|
|
26
|
+
private _onCursorUpdate;
|
|
27
|
+
private _onCursorDelete;
|
|
28
|
+
private _updateLocalCursor;
|
|
29
|
+
private _toggleOnline;
|
|
30
|
+
private _toggleOffline;
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BoardModel } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
import { RxDisposable, ThemeService } from '@univerjs/core';
|
|
4
|
+
import { CollabCursorController } from './collab-cursor.controller';
|
|
5
|
+
export declare class BoardCollabCursorRenderController extends RxDisposable implements IRenderModule {
|
|
6
|
+
private readonly _context;
|
|
7
|
+
private readonly _collabCursorController;
|
|
8
|
+
private readonly _themeService;
|
|
9
|
+
private _cursors;
|
|
10
|
+
private _renderScheduled;
|
|
11
|
+
private _isApplyingOverlays;
|
|
12
|
+
private _latestCursors;
|
|
13
|
+
constructor(_context: IRenderContext<BoardModel>, _collabCursorController: CollabCursorController, _themeService: ThemeService);
|
|
14
|
+
dispose(): void;
|
|
15
|
+
private _init;
|
|
16
|
+
private _scheduleRender;
|
|
17
|
+
private _render;
|
|
18
|
+
private _removeCollabCursors;
|
|
19
|
+
private _getSceneObjectByKey;
|
|
20
|
+
private _getObjectBounds;
|
|
21
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Observable } from 'rxjs';
|
|
2
|
-
import type { IDocCollabCursor, ISheetCollabCursor, ISlideCollabCursor } from '../../models/cursor';
|
|
2
|
+
import type { IBoardCollabCursor, IDocCollabCursor, ISheetCollabCursor, ISlideCollabCursor } from '../../models/cursor';
|
|
3
3
|
import { CollaborationSessionService } from '@univerjs-pro/collaboration-client';
|
|
4
4
|
import { Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
5
5
|
/**
|
|
@@ -15,9 +15,10 @@ export declare class CollabCursorController extends RxDisposable {
|
|
|
15
15
|
private readonly _entityInit$;
|
|
16
16
|
constructor(_univerInstanceService: IUniverInstanceService, _injector: Injector, _collabSessionService: CollaborationSessionService);
|
|
17
17
|
dispose(): void;
|
|
18
|
-
getCollabCursors$(unitID: string): Observable<Map<string, ISheetCollabCursor> | Map<string, IDocCollabCursor> | Map<string, ISlideCollabCursor>>;
|
|
18
|
+
getCollabCursors$(unitID: string): Observable<Map<string, ISheetCollabCursor> | Map<string, IDocCollabCursor> | Map<string, ISlideCollabCursor> | Map<string, IBoardCollabCursor>>;
|
|
19
19
|
private _init;
|
|
20
20
|
private _startSheetCollabCursor;
|
|
21
21
|
private _startDocCollabCursor;
|
|
22
22
|
private _startSlideCollabCursor;
|
|
23
|
+
private _startBoardCollabCursor;
|
|
23
24
|
}
|
|
@@ -18,7 +18,7 @@ export declare class SlideCollabCursorEntity extends RxDisposable {
|
|
|
18
18
|
private _online;
|
|
19
19
|
private _init;
|
|
20
20
|
private _cursorInfo$;
|
|
21
|
-
cursorInfo$: import("rxjs").Observable<Map<string,
|
|
21
|
+
cursorInfo$: import("rxjs").Observable<Map<string, import("../../models/cursor").IElementCollabCursor>>;
|
|
22
22
|
get cursorInfo(): Readonly<Map<string, ISlideCollabCursor>>;
|
|
23
23
|
private _roomMembers$;
|
|
24
24
|
roomMembers$: import("rxjs").Observable<ICollaborationUser[]>;
|
|
@@ -15,4 +15,15 @@ export declare class DesktopCollaborationStatusDisplayController extends Disposa
|
|
|
15
15
|
private _initStatusListener;
|
|
16
16
|
protected _initStatusComponent(): void;
|
|
17
17
|
}
|
|
18
|
+
export declare class BoardCollaborationStatusDisplayController extends Disposable {
|
|
19
|
+
private readonly _univerInstanceService;
|
|
20
|
+
private readonly _injector;
|
|
21
|
+
private readonly _collaborationController;
|
|
22
|
+
private readonly _uiPartsService;
|
|
23
|
+
protected readonly _status$: BehaviorSubject<CollaborationStatus>;
|
|
24
|
+
constructor(_univerInstanceService: IUniverInstanceService, _injector: Injector, _collaborationController: CollaborationController, _uiPartsService: IUIPartsService);
|
|
25
|
+
private _initStatusListener;
|
|
26
|
+
protected _initStatusComponent(): void;
|
|
27
|
+
}
|
|
18
28
|
export declare function getCollaborationStatusUnitId(univerInstanceService: IUniverInstanceService): string | null;
|
|
29
|
+
export declare function getBoardCollaborationStatusUnitId(univerInstanceService: IUniverInstanceService): string | null;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import './global.css';
|
|
2
2
|
export type { IUniverCollaborationClientUIConfig } from './config/config';
|
|
3
3
|
export { DesktopCollaborationStatusDisplayController } from './controllers/collab-status/collab-status.controller';
|
|
4
|
-
export { CollaborationDataLoaderController } from './controllers/data-loader/data-loader.controller';
|
|
5
4
|
export { UniverCollaborationClientUIPlugin } from './plugin';
|
|
6
5
|
export { BrowserCollaborationSocketService } from './services/collaboration-socket/collaboration-socket.service';
|
|
7
6
|
export { RemoteUniscriptService } from './services/remote-uniscript/remote-uniscript.service';
|
|
8
7
|
export { WebBrowserSingleActiveUnitService } from './services/single-active-unit/single-active-unit.service';
|
|
9
8
|
export { IURLService } from './services/url/url.service';
|
|
10
|
-
export { WebURLService } from './services/url/web-url.service';
|
|
11
9
|
export { SheetCollabCursorShape } from './views/shapes/sheet-collab-cursor.shape';
|
|
12
10
|
export type { ISheetCollabCursorShapeProps } from './views/shapes/sheet-collab-cursor.shape';
|
|
@@ -34,26 +34,30 @@ export interface IDocCollabCursor {
|
|
|
34
34
|
/** The deserialized ranges of collab cursor. */
|
|
35
35
|
ranges: ITextRangeWithStyle[];
|
|
36
36
|
}
|
|
37
|
-
export interface
|
|
38
|
-
kind:
|
|
37
|
+
export interface IElementCollabSelectionPayload<TKind extends string = string> {
|
|
38
|
+
kind: TKind;
|
|
39
39
|
unitId: string;
|
|
40
40
|
subUnitId: string;
|
|
41
41
|
selectedIds: string[];
|
|
42
42
|
focusedId: string | null;
|
|
43
43
|
}
|
|
44
|
-
export interface
|
|
44
|
+
export interface IElementCollabCursor {
|
|
45
45
|
/** Stroke color of this collab cursor */
|
|
46
46
|
color: string;
|
|
47
47
|
/** Displayed user name of this cursor */
|
|
48
48
|
name: string;
|
|
49
|
-
/**
|
|
49
|
+
/** Host unit ID */
|
|
50
50
|
unitId: string;
|
|
51
|
-
/**
|
|
51
|
+
/** Host page ID */
|
|
52
52
|
subUnitId: string;
|
|
53
|
-
/** Remote selected
|
|
53
|
+
/** Remote selected element IDs */
|
|
54
54
|
selectedIds: string[];
|
|
55
|
-
/** Remote focused
|
|
55
|
+
/** Remote focused element ID */
|
|
56
56
|
focusedId: string | null;
|
|
57
|
-
/** Serialized
|
|
57
|
+
/** Serialized selection payload */
|
|
58
58
|
selection: string;
|
|
59
59
|
}
|
|
60
|
+
export type ISlideCollabSelectionPayload = IElementCollabSelectionPayload<'slide-element-selection'>;
|
|
61
|
+
export type ISlideCollabCursor = IElementCollabCursor;
|
|
62
|
+
export type IBoardCollabSelectionPayload = IElementCollabSelectionPayload<'board-element-selection'>;
|
|
63
|
+
export type IBoardCollabCursor = IElementCollabCursor;
|
|
@@ -11,6 +11,7 @@ export interface ISheetCollabCursorShapeProps extends IShapeProps, ISheetCollabC
|
|
|
11
11
|
showText?: boolean;
|
|
12
12
|
backgroundColor?: string;
|
|
13
13
|
offsetY?: number;
|
|
14
|
+
labelHorizontalPosition?: 'left' | 'right';
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Render a single collaborated cursor on the canvas.
|
|
@@ -29,6 +30,7 @@ export declare class SheetCollabCursorShape<T extends ISheetCollabCursorShapePro
|
|
|
29
30
|
private _blinkIntervalTimer?;
|
|
30
31
|
private _isBlinkVisible;
|
|
31
32
|
private _offsetY?;
|
|
33
|
+
private _labelHorizontalPosition;
|
|
32
34
|
constructor(key?: string, props?: T);
|
|
33
35
|
setOffsetY(offsetY: number): void;
|
|
34
36
|
setShapeProps(props: Partial<ISheetCollabCursorShapeProps>): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IShapeProps } from '@univerjs/engine-render';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IElementCollabCursor } from '../../models/cursor';
|
|
3
3
|
import { Shape } from '@univerjs/engine-render';
|
|
4
4
|
export declare const SLIDE_COLLAB_CURSOR_ZINDEX = 5002;
|
|
5
|
-
export interface ISlideCollabCursorShapeProps extends IShapeProps,
|
|
5
|
+
export interface ISlideCollabCursorShapeProps extends IShapeProps, IElementCollabCursor {
|
|
6
6
|
showText?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare class SlideCollabCursorShape<T extends ISlideCollabCursorShapeProps = ISlideCollabCursorShapeProps> extends Shape<T> {
|
|
@@ -4,6 +4,7 @@ export declare const COLLAB_CURSOR_LABEL_HEIGHT = 20;
|
|
|
4
4
|
export declare const COLLAB_CURSOR_LABEL_MAX_WIDTH = 200;
|
|
5
5
|
export declare const COLLAB_CURSOR_LABEL_TEXT_PADDING_LR = 4;
|
|
6
6
|
export declare const COLLAB_CURSOR_LABEL_TEXT_PADDING_TB = 5;
|
|
7
|
+
export declare function getTextBubbleWidth(ctx: CanvasRenderingContext2D, text: string): number;
|
|
7
8
|
export interface ITextBubbleShapeProps extends IShapeProps {
|
|
8
9
|
color: string;
|
|
9
10
|
text: string;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x3830(_0x14f2be,_0x47c019){_0x14f2be=_0x14f2be-0x1d2;var _0x19f416=_0x19f4();var _0x38302d=_0x19f416[_0x14f2be];return _0x38302d;}function _0x19f4(){var _0x1c00e6=['1762568HcePzs','runOnServer','FUniver','_injector','@univerjs-pro/collaboration-client-ui','460074HPPkyy','17092MnMVWE','2425353HnGMOg','822900ZYmmAH','amd','27mMTLKf','UniverCoreFacade','UniverProCollaborationClientUi','4162715Lcsycs','63zkmJGL','896748MtRKrs','extend','object','@univerjs/core/facade','RemoteUniscriptService'];_0x19f4=function(){return _0x1c00e6;};return _0x19f4();}(function(_0xb220ee,_0x5653c2){var _0x1025b6=_0x3830,_0x4fd7bb=_0xb220ee();while(!![]){try{var _0x156be8=-parseInt(_0x1025b6(0x1e3))/0x1+parseInt(_0x1025b6(0x1d9))/0x2+parseInt(_0x1025b6(0x1e2))/0x3*(-parseInt(_0x1025b6(0x1da))/0x4)+parseInt(_0x1025b6(0x1e1))/0x5+parseInt(_0x1025b6(0x1dc))/0x6+-parseInt(_0x1025b6(0x1db))/0x7+-parseInt(_0x1025b6(0x1d4))/0x8*(-parseInt(_0x1025b6(0x1de))/0x9);if(_0x156be8===_0x5653c2)break;else _0x4fd7bb['push'](_0x4fd7bb['shift']());}catch(_0x1f96c6){_0x4fd7bb['push'](_0x4fd7bb['shift']());}}}(_0x19f4,0x80d75),function(_0x3d301a,_0xbbc4a6){var _0x2b23e7=_0x3830;typeof exports==_0x2b23e7(0x1e5)&&typeof module<'u'?_0xbbc4a6(require('@univerjs-pro/collaboration-client-ui'),require('@univerjs/core/facade')):typeof define=='function'&&define[_0x2b23e7(0x1dd)]?define([_0x2b23e7(0x1d8),_0x2b23e7(0x1d2)],_0xbbc4a6):(_0x3d301a=typeof globalThis<'u'?globalThis:_0x3d301a||self,_0xbbc4a6(_0x3d301a[_0x2b23e7(0x1e0)],_0x3d301a[_0x2b23e7(0x1df)]));}(this,function(_0x5826be,_0x4427a9){var _0x1f6980=_0x3830,_0x458ac7=class extends _0x4427a9[_0x1f6980(0x1d6)]{[_0x1f6980(0x1d5)](_0x5c1d64,_0x5e9c2d,..._0x225380){var _0xfa19d3=_0x1f6980;return this[_0xfa19d3(0x1d7)]['get'](_0x5826be[_0xfa19d3(0x1d3)])[_0xfa19d3(0x1d5)](_0x5c1d64,_0x5e9c2d,{},..._0x225380);}};_0x4427a9[_0x1f6980(0x1d6)][_0x1f6980(0x1e4)](_0x458ac7);}));
|