@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.
@@ -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://collab.tiptap.dev
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://collab.tiptap.dev
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
- debounce: (id: string, func: Function, debounce: number, maxDebounce: number) => any;
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: () => (id: string, func: Function, debounce: number, maxDebounce: number) => any;
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.8.1",
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.8.1",
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://collab.tiptap.dev
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://collab.tiptap.dev
12
+ * A Hocuspocus Cloud App ID, get one here: https://cloud.tiptap.dev
13
13
  */
14
14
  appId: string,
15
15
  }