@hocuspocus/extension-logger 2.9.0 → 2.9.2-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/packages/provider/src/TiptapCollabProvider.d.ts +21 -2
- package/dist/packages/provider/src/TiptapCollabProviderWebsocket.d.ts +5 -1
- package/dist/packages/provider/src/types.d.ts +14 -0
- package/dist/packages/server/src/Hocuspocus.d.ts +1 -1
- package/dist/packages/server/src/Server.d.ts +1 -1
- package/dist/playground/frontend/vite.config.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { AbstractType, YArrayEvent } from 'yjs';
|
|
2
2
|
import { HocuspocusProvider, HocuspocusProviderConfiguration } from './HocuspocusProvider.js';
|
|
3
3
|
import { TiptapCollabProviderWebsocket } from './TiptapCollabProviderWebsocket.js';
|
|
4
|
-
import type { THistoryVersion } from './types';
|
|
5
|
-
export type TiptapCollabProviderConfiguration = Required<Pick<HocuspocusProviderConfiguration, 'name'>> & Partial<HocuspocusProviderConfiguration> & (Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'websocketProvider'>> | Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'appId'>>);
|
|
4
|
+
import type { TCollabComment, TCollabThread, THistoryVersion } from './types.js';
|
|
5
|
+
export type TiptapCollabProviderConfiguration = Required<Pick<HocuspocusProviderConfiguration, 'name'>> & Partial<HocuspocusProviderConfiguration> & (Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'websocketProvider'>> | Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'appId'>> | Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'baseUrl'>>);
|
|
6
6
|
export interface AdditionalTiptapCollabProviderConfiguration {
|
|
7
7
|
/**
|
|
8
8
|
* A Hocuspocus Cloud App ID, get one here: https://cloud.tiptap.dev
|
|
9
9
|
*/
|
|
10
10
|
appId?: string;
|
|
11
|
+
/**
|
|
12
|
+
* If you are using the on-premise version of TiptapCollab, put your baseUrl here (e.g. https://collab.yourdomain.com)
|
|
13
|
+
*/
|
|
14
|
+
baseUrl?: string;
|
|
11
15
|
websocketProvider?: TiptapCollabProviderWebsocket;
|
|
12
16
|
}
|
|
13
17
|
export declare class TiptapCollabProvider extends HocuspocusProvider {
|
|
@@ -36,4 +40,19 @@ export declare class TiptapCollabProvider extends HocuspocusProvider {
|
|
|
36
40
|
isAutoVersioning(): boolean;
|
|
37
41
|
enableAutoVersioning(): 1;
|
|
38
42
|
disableAutoVersioning(): 0;
|
|
43
|
+
private getYThreads;
|
|
44
|
+
getThreads<Data, CommentData>(): TCollabThread<Data, CommentData>[];
|
|
45
|
+
private getThreadIndex;
|
|
46
|
+
getThread<Data, CommentData>(id: string): TCollabThread<Data, CommentData> | null;
|
|
47
|
+
private getYThread;
|
|
48
|
+
createThread(data: TCollabThread): TCollabThread | null;
|
|
49
|
+
updateThread(id: TCollabThread['id'], data: Pick<TCollabThread, 'data'>): TCollabThread | null;
|
|
50
|
+
deleteThread(id: TCollabThread['id']): void;
|
|
51
|
+
getThreadComments(threadId: TCollabThread['id']): TCollabComment[] | null;
|
|
52
|
+
getThreadComment(threadId: TCollabThread['id'], commentId: TCollabComment['id']): TCollabComment | null;
|
|
53
|
+
addComment(threadId: TCollabThread['id'], data: TCollabComment): TCollabThread | null;
|
|
54
|
+
updateComment(threadId: TCollabThread['id'], commentId: TCollabComment['id'], data: TCollabComment): TCollabThread | null;
|
|
55
|
+
deleteComment(threadId: TCollabThread['id'], commentId: TCollabComment['id']): TCollabThread | null;
|
|
56
|
+
watchThreads(callback: () => void): void;
|
|
57
|
+
unwatchThreads(callback: () => void): void;
|
|
39
58
|
}
|
|
@@ -4,7 +4,11 @@ export interface AdditionalTiptapCollabProviderWebsocketConfiguration {
|
|
|
4
4
|
/**
|
|
5
5
|
* A Hocuspocus Cloud App ID, get one here: https://cloud.tiptap.dev
|
|
6
6
|
*/
|
|
7
|
-
appId
|
|
7
|
+
appId?: string;
|
|
8
|
+
/**
|
|
9
|
+
* If you are using the on-premise version of TiptapCollab, put your baseUrl here (e.g. https://collab.yourdomain.com)
|
|
10
|
+
*/
|
|
11
|
+
baseUrl?: string;
|
|
8
12
|
}
|
|
9
13
|
export declare class TiptapCollabProviderWebsocket extends HocuspocusProviderWebsocket {
|
|
10
14
|
constructor(configuration: TiptapCollabProviderWebsocketConfiguration);
|
|
@@ -84,6 +84,20 @@ export type StatesArray = {
|
|
|
84
84
|
clientId: number;
|
|
85
85
|
[key: string | number]: any;
|
|
86
86
|
}[];
|
|
87
|
+
export type TCollabThread<Data = any, CommentData = any> = {
|
|
88
|
+
id: string;
|
|
89
|
+
createdAt: number;
|
|
90
|
+
updatedAt: number;
|
|
91
|
+
comments: TCollabComment<CommentData>[];
|
|
92
|
+
data: Data;
|
|
93
|
+
};
|
|
94
|
+
export type TCollabComment<Data = any> = {
|
|
95
|
+
id: string;
|
|
96
|
+
createdAt: number;
|
|
97
|
+
updatedAt: number;
|
|
98
|
+
data: Data;
|
|
99
|
+
content: any;
|
|
100
|
+
};
|
|
87
101
|
export type THistoryVersion = {
|
|
88
102
|
name?: string;
|
|
89
103
|
version: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IncomingMessage } from 'http';
|
|
3
3
|
import WebSocket, { AddressInfo } from 'ws';
|
|
4
|
-
import { Server as HocuspocusServer } from './Server';
|
|
4
|
+
import { Server as HocuspocusServer } from './Server.js';
|
|
5
5
|
import { Debugger } from './Debugger.js';
|
|
6
6
|
import { DirectConnection } from './DirectConnection.js';
|
|
7
7
|
import Document from './Document.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IncomingMessage, Server as HTTPServer, ServerResponse } from 'http';
|
|
3
3
|
import { WebSocketServer } from 'ws';
|
|
4
|
-
import { Hocuspocus } from './Hocuspocus';
|
|
4
|
+
import { Hocuspocus } from './Hocuspocus.js';
|
|
5
5
|
export declare class Server {
|
|
6
6
|
httpServer: HTTPServer;
|
|
7
7
|
webSocketServer: WebSocketServer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vite").
|
|
1
|
+
declare const _default: import("vite").UserConfig;
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/extension-logger",
|
|
3
|
-
"version": "2.9.0",
|
|
3
|
+
"version": "2.9.2-rc.0",
|
|
4
4
|
"description": "hocuspocus logging extension",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@hocuspocus/server": "^2.9.0"
|
|
32
|
+
"@hocuspocus/server": "^2.9.2-rc.0"
|
|
33
33
|
},
|
|
34
34
|
"gitHead": "b3454a4ca289a84ddfb7fa5607a2d4b8d5c37e9d"
|
|
35
35
|
}
|