@hocuspocus/provider 2.13.1 → 2.13.4-rc.0
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/dist/hocuspocus-provider.cjs +6 -1
- package/dist/hocuspocus-provider.cjs.map +1 -1
- package/dist/hocuspocus-provider.esm.js +6 -1
- package/dist/hocuspocus-provider.esm.js.map +1 -1
- package/dist/packages/provider/src/TiptapCollabProviderWebsocket.d.ts +4 -0
- package/dist/packages/server/src/Hocuspocus.d.ts +1 -1
- package/package.json +3 -3
- package/src/TiptapCollabProviderWebsocket.ts +13 -1
|
@@ -9,6 +9,10 @@ export interface AdditionalTiptapCollabProviderWebsocketConfiguration {
|
|
|
9
9
|
* If you are using the on-premise version of TiptapCollab, put your baseUrl here (e.g. https://collab.yourdomain.com)
|
|
10
10
|
*/
|
|
11
11
|
baseUrl?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Only fill this if you are using Tiptap Collab HA.
|
|
14
|
+
*/
|
|
15
|
+
shardKey?: string;
|
|
12
16
|
}
|
|
13
17
|
export declare class TiptapCollabProviderWebsocket extends HocuspocusProviderWebsocket {
|
|
14
18
|
constructor(configuration: TiptapCollabProviderWebsocketConfiguration);
|
|
@@ -89,7 +89,7 @@ export declare class Hocuspocus {
|
|
|
89
89
|
*/
|
|
90
90
|
createDocument(documentName: string, request: Partial<Pick<IncomingMessage, 'headers' | 'url'>>, socketId: string, connection: ConnectionConfiguration, context?: any): Promise<Document>;
|
|
91
91
|
loadDocument(documentName: string, request: Partial<Pick<IncomingMessage, 'headers' | 'url'>>, socketId: string, connection: ConnectionConfiguration, context?: any): Promise<Document>;
|
|
92
|
-
storeDocumentHooks(document: Document, hookPayload: onStoreDocumentPayload):
|
|
92
|
+
storeDocumentHooks(document: Document, hookPayload: onStoreDocumentPayload, immediately?: boolean): any;
|
|
93
93
|
/**
|
|
94
94
|
* Run the given hook on all configured extensions.
|
|
95
95
|
* Runs the given callback after each hook.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/provider",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.4-rc.0",
|
|
4
4
|
"description": "hocuspocus provider",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@hocuspocus/common": "^2.13.
|
|
32
|
+
"@hocuspocus/common": "^2.13.4-rc.0",
|
|
33
33
|
"@lifeomic/attempt": "^3.0.2",
|
|
34
34
|
"lib0": "^0.2.87",
|
|
35
|
-
"ws": "^8.
|
|
35
|
+
"ws": "^8.17.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"y-protocols": "^1.0.6",
|
|
@@ -17,10 +17,22 @@ export interface AdditionalTiptapCollabProviderWebsocketConfiguration {
|
|
|
17
17
|
* If you are using the on-premise version of TiptapCollab, put your baseUrl here (e.g. https://collab.yourdomain.com)
|
|
18
18
|
*/
|
|
19
19
|
baseUrl?: string
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Only fill this if you are using Tiptap Collab HA.
|
|
23
|
+
*/
|
|
24
|
+
shardKey?: string
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
export class TiptapCollabProviderWebsocket extends HocuspocusProviderWebsocket {
|
|
23
28
|
constructor(configuration: TiptapCollabProviderWebsocketConfiguration) {
|
|
24
|
-
|
|
29
|
+
let url = configuration.baseUrl ?? `wss://${configuration.appId}.collab.tiptap.cloud`
|
|
30
|
+
|
|
31
|
+
if (configuration.shardKey) {
|
|
32
|
+
url += url.includes('?') ? '&' : '?'
|
|
33
|
+
url += `shard=${configuration.shardKey}`
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
super({ ...configuration as HocuspocusProviderWebsocketConfiguration, url })
|
|
25
37
|
}
|
|
26
38
|
}
|