@hocuspocus/provider 2.8.1 → 2.9.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 +2 -3
- package/dist/hocuspocus-provider.cjs.map +1 -1
- package/dist/hocuspocus-provider.esm.js +2 -3
- package/dist/hocuspocus-provider.esm.js.map +1 -1
- package/dist/packages/provider/src/TiptapCollabProvider.d.ts +1 -1
- package/dist/packages/provider/src/TiptapCollabProviderWebsocket.d.ts +1 -1
- package/dist/packages/server/src/Hocuspocus.d.ts +5 -1
- package/dist/packages/server/src/util/debounce.d.ts +5 -1
- package/package.json +2 -2
- package/src/HocuspocusProvider.ts +2 -2
- package/src/TiptapCollabProvider.ts +1 -1
- package/src/TiptapCollabProviderWebsocket.ts +1 -1
|
@@ -5,7 +5,7 @@ import type { THistoryVersion } from './types';
|
|
|
5
5
|
export type TiptapCollabProviderConfiguration = Required<Pick<HocuspocusProviderConfiguration, 'name'>> & Partial<HocuspocusProviderConfiguration> & (Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'websocketProvider'>> | Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'appId'>>);
|
|
6
6
|
export interface AdditionalTiptapCollabProviderConfiguration {
|
|
7
7
|
/**
|
|
8
|
-
* A Hocuspocus Cloud App ID, get one here: https://
|
|
8
|
+
* A Hocuspocus Cloud App ID, get one here: https://cloud.tiptap.dev
|
|
9
9
|
*/
|
|
10
10
|
appId?: string;
|
|
11
11
|
websocketProvider?: TiptapCollabProviderWebsocket;
|
|
@@ -2,7 +2,7 @@ import { CompleteHocuspocusProviderWebsocketConfiguration, HocuspocusProviderWeb
|
|
|
2
2
|
export type TiptapCollabProviderWebsocketConfiguration = Partial<CompleteHocuspocusProviderWebsocketConfiguration> & AdditionalTiptapCollabProviderWebsocketConfiguration;
|
|
3
3
|
export interface AdditionalTiptapCollabProviderWebsocketConfiguration {
|
|
4
4
|
/**
|
|
5
|
-
* A Hocuspocus Cloud App ID, get one here: https://
|
|
5
|
+
* A Hocuspocus Cloud App ID, get one here: https://cloud.tiptap.dev
|
|
6
6
|
*/
|
|
7
7
|
appId: string;
|
|
8
8
|
}
|
|
@@ -29,7 +29,11 @@ export declare class Hocuspocus {
|
|
|
29
29
|
documents: Map<string, Document>;
|
|
30
30
|
server?: HocuspocusServer;
|
|
31
31
|
debugger: Debugger;
|
|
32
|
-
|
|
32
|
+
debouncer: {
|
|
33
|
+
debounce: (id: string, func: Function, debounce: number, maxDebounce: number) => any;
|
|
34
|
+
isDebounced: (id: string) => boolean;
|
|
35
|
+
executeNow: (id: string) => any;
|
|
36
|
+
};
|
|
33
37
|
constructor(configuration?: Partial<Configuration>);
|
|
34
38
|
/**
|
|
35
39
|
* Configure the server
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export declare const useDebounce: () =>
|
|
1
|
+
export declare const useDebounce: () => {
|
|
2
|
+
debounce: (id: string, func: Function, debounce: number, maxDebounce: number) => any;
|
|
3
|
+
isDebounced: (id: string) => boolean;
|
|
4
|
+
executeNow: (id: string) => any;
|
|
5
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/provider",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "hocuspocus provider",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@hocuspocus/common": "^2.
|
|
32
|
+
"@hocuspocus/common": "^2.9.0",
|
|
33
33
|
"@lifeomic/attempt": "^3.0.2",
|
|
34
34
|
"lib0": "^0.2.87",
|
|
35
35
|
"ws": "^8.14.2"
|
|
@@ -477,9 +477,10 @@ export class HocuspocusProvider extends EventEmitter {
|
|
|
477
477
|
|
|
478
478
|
if (this.awareness) {
|
|
479
479
|
removeAwarenessStates(this.awareness, [this.document.clientID], 'provider destroy')
|
|
480
|
+
this.awareness.off('update', this.awarenessUpdateHandler)
|
|
481
|
+
this.awareness.destroy()
|
|
480
482
|
}
|
|
481
483
|
|
|
482
|
-
this.awareness?.off('update', this.awarenessUpdateHandler)
|
|
483
484
|
this.document.off('update', this.documentUpdateHandler)
|
|
484
485
|
|
|
485
486
|
this.removeAllListeners()
|
|
@@ -519,7 +520,6 @@ export class HocuspocusProvider extends EventEmitter {
|
|
|
519
520
|
this.authorizedScope = scope
|
|
520
521
|
|
|
521
522
|
this.emit('authenticated')
|
|
522
|
-
this.startSync()
|
|
523
523
|
}
|
|
524
524
|
|
|
525
525
|
get broadcastChannel() {
|
|
@@ -15,7 +15,7 @@ export type TiptapCollabProviderConfiguration =
|
|
|
15
15
|
|
|
16
16
|
export interface AdditionalTiptapCollabProviderConfiguration {
|
|
17
17
|
/**
|
|
18
|
-
* A Hocuspocus Cloud App ID, get one here: https://
|
|
18
|
+
* A Hocuspocus Cloud App ID, get one here: https://cloud.tiptap.dev
|
|
19
19
|
*/
|
|
20
20
|
appId?: string,
|
|
21
21
|
|
|
@@ -9,7 +9,7 @@ export type TiptapCollabProviderWebsocketConfiguration =
|
|
|
9
9
|
|
|
10
10
|
export interface AdditionalTiptapCollabProviderWebsocketConfiguration {
|
|
11
11
|
/**
|
|
12
|
-
* A Hocuspocus Cloud App ID, get one here: https://
|
|
12
|
+
* A Hocuspocus Cloud App ID, get one here: https://cloud.tiptap.dev
|
|
13
13
|
*/
|
|
14
14
|
appId: string,
|
|
15
15
|
}
|