@veltdev/sdk 1.0.23 → 1.0.24
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/app/models/data/document-paths.data.model.d.ts +2 -0
- package/app/models/data/live-state-data-map.data.model.d.ts +16 -2
- package/app/models/data/live-state-data.data.model.d.ts +17 -0
- package/app/models/element/live-state-sync-element.model.d.ts +92 -0
- package/app/utils/constants.d.ts +5 -0
- package/package.json +1 -1
- package/velt.js +2 -2
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import { LiveStateData } from "./live-state-data.data.model";
|
|
1
|
+
import { LiveStateData, SingleEditorLiveStateData } from "./live-state-data.data.model";
|
|
2
2
|
export declare class LiveStateDataMap {
|
|
3
3
|
/**
|
|
4
4
|
* Map of all unique LiveStateData set by you on the given document.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
custom?: {
|
|
7
|
+
[liveStateDataId: string]: LiveStateData;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Map of all unique LiveStateData set by the default editor on the given document.
|
|
11
|
+
*/
|
|
12
|
+
default?: {
|
|
13
|
+
singleEditor?: SingleEditorLiveStateData;
|
|
14
|
+
autoSyncState?: {
|
|
15
|
+
current?: LiveStateData;
|
|
16
|
+
history?: {
|
|
17
|
+
[liveStateDataId: string]: LiveStateData;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
7
21
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import { User } from "./user.data.model";
|
|
1
2
|
export declare class LiveStateData {
|
|
3
|
+
/**
|
|
4
|
+
* Unique identifier to identify the document you are syncing.
|
|
5
|
+
* This id is md5 of liveStateDataId.
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
2
8
|
/**
|
|
3
9
|
* Unique identifier to identify the state data you are syncing.
|
|
4
10
|
*/
|
|
@@ -8,4 +14,15 @@ export declare class LiveStateData {
|
|
|
8
14
|
*
|
|
9
15
|
*/
|
|
10
16
|
data: string | number | boolean | JSON;
|
|
17
|
+
lastUpdated: any;
|
|
18
|
+
updatedBy: User;
|
|
19
|
+
}
|
|
20
|
+
export declare class SingleEditorLiveStateData {
|
|
21
|
+
editor?: User | null;
|
|
22
|
+
requestEditorAccess?: {
|
|
23
|
+
user: User;
|
|
24
|
+
requestedAt: any;
|
|
25
|
+
status: 'pending' | 'accepted' | 'rejected';
|
|
26
|
+
waitTime: number;
|
|
27
|
+
} | null;
|
|
11
28
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents the synchronization element for live state.
|
|
5
|
+
*/
|
|
6
|
+
export declare class LiveStateSyncElement {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Gets live state data based on the provided ID.
|
|
10
|
+
*/
|
|
11
|
+
getLiveStateData: (liveStateDataId: string) => any;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Gets live state data as an observable based on the provided ID.
|
|
15
|
+
*/
|
|
16
|
+
getLiveStateData$: (liveStateDataId: string) => Observable<any>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Sets live state data for the provided ID and data.
|
|
20
|
+
*/
|
|
21
|
+
setLiveStateData: (liveStateDataId: string, liveStateData: any) => any;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Enables the single editor mode.
|
|
25
|
+
*/
|
|
26
|
+
enableSingleEditorMode: () => void;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Disables the single editor mode.
|
|
30
|
+
*/
|
|
31
|
+
disableSingleEditorMode: () => void;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Checks if the current user is an editor. Returns an observable.
|
|
35
|
+
*/
|
|
36
|
+
isUserEditor$: () => Observable<boolean | null>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Sets the current user as an editor.
|
|
40
|
+
*/
|
|
41
|
+
setUserAsEditor: () => void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Resets the user access.
|
|
45
|
+
*/
|
|
46
|
+
resetUserAccess: () => void;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Constructor for LiveStateSyncElement.
|
|
50
|
+
*/
|
|
51
|
+
constructor();
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Private method for getting live state data.
|
|
55
|
+
*/
|
|
56
|
+
private _getLiveStateData;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Private method for getting live state data as an observable.
|
|
60
|
+
*/
|
|
61
|
+
private _getLiveStateData$;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Private method for setting live state data.
|
|
65
|
+
*/
|
|
66
|
+
private _setLiveStateData;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Private method to enable single editor mode.
|
|
70
|
+
*/
|
|
71
|
+
private _enableSingleEditorMode;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Private method to disable single editor mode.
|
|
75
|
+
*/
|
|
76
|
+
private _disableSingleEditorMode;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Private method to check if the user is an editor.
|
|
80
|
+
*/
|
|
81
|
+
private _isUserEditor$;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Private method to set user as an editor.
|
|
85
|
+
*/
|
|
86
|
+
private _setUserAsEditor;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Private method to reset user access.
|
|
90
|
+
*/
|
|
91
|
+
private _resetUserAccess;
|
|
92
|
+
}
|
package/app/utils/constants.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export declare class Constants {
|
|
|
25
25
|
static FIREBASE_PARTIAL_PATH_RECORDER: string;
|
|
26
26
|
static FIREBASE_PARTIAL_PATH_FOLLOW_ALONG: string;
|
|
27
27
|
static FIREBASE_PARTIAL_PATH_SYNC_VIDEO_PLAYER: string;
|
|
28
|
+
static FIREBASE_PARTIAL_PATH_LIVE_STATE: string;
|
|
28
29
|
static FIREBASE_PARTIAL_PATH_IAM: string;
|
|
29
30
|
static FIREBASE_PARTIAL_PATH_USERS: string;
|
|
30
31
|
static FIREBASE_PARTIAL_PATH_USER_REQUESTS: string;
|
|
@@ -233,6 +234,9 @@ export declare class Constants {
|
|
|
233
234
|
SYNC_VIDEO_PLAYER: string;
|
|
234
235
|
VELT_INLINE_COMMENT_ID: string;
|
|
235
236
|
VELT_PDF_VIEWER: string;
|
|
237
|
+
VELT_SYNC_STATE: string;
|
|
238
|
+
VELT_SYNC_ACCESS: string;
|
|
239
|
+
VELT_SYNC_DISABLED_STATE: string;
|
|
236
240
|
};
|
|
237
241
|
static INJECTION_STYLE_PROPS: {
|
|
238
242
|
/**
|
|
@@ -291,6 +295,7 @@ export declare class Constants {
|
|
|
291
295
|
static VELT_COLOR: string;
|
|
292
296
|
static VELT_MIN_ARROW_LENGTH: number;
|
|
293
297
|
static VELT_ARROW_VIEWPORT_PADDING: number;
|
|
298
|
+
static LIVE_STATE_REQUEST_EDITOR_ACCESS_WAIT_TIME: number;
|
|
294
299
|
static CURSOR: {
|
|
295
300
|
COMMENT_PIN: string;
|
|
296
301
|
TAG_PIN: string;
|