@kopexa/tiptap 17.8.1 → 17.8.3
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/index.js +13 -11
- package/dist/index.mjs +13 -11
- package/package.json +24 -24
package/dist/index.js
CHANGED
|
@@ -183,6 +183,7 @@ function CollaborationProvider({
|
|
|
183
183
|
}
|
|
184
184
|
const ydoc = ydocRef.current;
|
|
185
185
|
const localRef = (0, import_react3.useRef)(null);
|
|
186
|
+
const destroyTimeoutRef = (0, import_react3.useRef)(null);
|
|
186
187
|
const [status, setStatus] = (0, import_react3.useState)("connecting");
|
|
187
188
|
const [remoteSynced, setRemoteSynced] = (0, import_react3.useState)(false);
|
|
188
189
|
const [localSynced, setLocalSynced] = (0, import_react3.useState)(!enableLocalPersistence);
|
|
@@ -206,6 +207,10 @@ function CollaborationProvider({
|
|
|
206
207
|
}
|
|
207
208
|
const provider = remoteRef.current;
|
|
208
209
|
(0, import_react3.useEffect)(() => {
|
|
210
|
+
if (destroyTimeoutRef.current) {
|
|
211
|
+
clearTimeout(destroyTimeoutRef.current);
|
|
212
|
+
destroyTimeoutRef.current = null;
|
|
213
|
+
}
|
|
209
214
|
const remote = remoteRef.current;
|
|
210
215
|
if (!remote) return;
|
|
211
216
|
if (enableLocalPersistence && !localRef.current) {
|
|
@@ -255,7 +260,6 @@ function CollaborationProvider({
|
|
|
255
260
|
remote.connect();
|
|
256
261
|
setReady(true);
|
|
257
262
|
return () => {
|
|
258
|
-
var _a;
|
|
259
263
|
if (awareness && updateUsers) {
|
|
260
264
|
awareness.off("change", updateUsers);
|
|
261
265
|
}
|
|
@@ -263,18 +267,16 @@ function CollaborationProvider({
|
|
|
263
267
|
remote.off("synced", onSynced);
|
|
264
268
|
remote.off("status", onStatus);
|
|
265
269
|
remote.disconnect();
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
270
|
+
const localPersistence = localRef.current;
|
|
271
|
+
destroyTimeoutRef.current = setTimeout(() => {
|
|
272
|
+
localPersistence == null ? void 0 : localPersistence.destroy();
|
|
273
|
+
localRef.current = null;
|
|
274
|
+
remote.destroy();
|
|
275
|
+
remoteRef.current = null;
|
|
276
|
+
destroyTimeoutRef.current = null;
|
|
277
|
+
}, 0);
|
|
269
278
|
};
|
|
270
279
|
}, [documentId, ydoc, enableLocalPersistence]);
|
|
271
|
-
(0, import_react3.useEffect)(() => {
|
|
272
|
-
return () => {
|
|
273
|
-
var _a;
|
|
274
|
-
(_a = remoteRef.current) == null ? void 0 : _a.destroy();
|
|
275
|
-
remoteRef.current = null;
|
|
276
|
-
};
|
|
277
|
-
}, []);
|
|
278
280
|
(0, import_react3.useEffect)(() => {
|
|
279
281
|
var _a;
|
|
280
282
|
const awareness = (_a = remoteRef.current) == null ? void 0 : _a.awareness;
|
package/dist/index.mjs
CHANGED
|
@@ -128,6 +128,7 @@ function CollaborationProvider({
|
|
|
128
128
|
}
|
|
129
129
|
const ydoc = ydocRef.current;
|
|
130
130
|
const localRef = useRef2(null);
|
|
131
|
+
const destroyTimeoutRef = useRef2(null);
|
|
131
132
|
const [status, setStatus] = useState2("connecting");
|
|
132
133
|
const [remoteSynced, setRemoteSynced] = useState2(false);
|
|
133
134
|
const [localSynced, setLocalSynced] = useState2(!enableLocalPersistence);
|
|
@@ -151,6 +152,10 @@ function CollaborationProvider({
|
|
|
151
152
|
}
|
|
152
153
|
const provider = remoteRef.current;
|
|
153
154
|
useEffect2(() => {
|
|
155
|
+
if (destroyTimeoutRef.current) {
|
|
156
|
+
clearTimeout(destroyTimeoutRef.current);
|
|
157
|
+
destroyTimeoutRef.current = null;
|
|
158
|
+
}
|
|
154
159
|
const remote = remoteRef.current;
|
|
155
160
|
if (!remote) return;
|
|
156
161
|
if (enableLocalPersistence && !localRef.current) {
|
|
@@ -200,7 +205,6 @@ function CollaborationProvider({
|
|
|
200
205
|
remote.connect();
|
|
201
206
|
setReady(true);
|
|
202
207
|
return () => {
|
|
203
|
-
var _a;
|
|
204
208
|
if (awareness && updateUsers) {
|
|
205
209
|
awareness.off("change", updateUsers);
|
|
206
210
|
}
|
|
@@ -208,18 +212,16 @@ function CollaborationProvider({
|
|
|
208
212
|
remote.off("synced", onSynced);
|
|
209
213
|
remote.off("status", onStatus);
|
|
210
214
|
remote.disconnect();
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
215
|
+
const localPersistence = localRef.current;
|
|
216
|
+
destroyTimeoutRef.current = setTimeout(() => {
|
|
217
|
+
localPersistence == null ? void 0 : localPersistence.destroy();
|
|
218
|
+
localRef.current = null;
|
|
219
|
+
remote.destroy();
|
|
220
|
+
remoteRef.current = null;
|
|
221
|
+
destroyTimeoutRef.current = null;
|
|
222
|
+
}, 0);
|
|
214
223
|
};
|
|
215
224
|
}, [documentId, ydoc, enableLocalPersistence]);
|
|
216
|
-
useEffect2(() => {
|
|
217
|
-
return () => {
|
|
218
|
-
var _a;
|
|
219
|
-
(_a = remoteRef.current) == null ? void 0 : _a.destroy();
|
|
220
|
-
remoteRef.current = null;
|
|
221
|
-
};
|
|
222
|
-
}, []);
|
|
223
225
|
useEffect2(() => {
|
|
224
226
|
var _a;
|
|
225
227
|
const awareness = (_a = remoteRef.current) == null ? void 0 : _a.awareness;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopexa/tiptap",
|
|
3
|
-
"version": "17.8.
|
|
3
|
+
"version": "17.8.3",
|
|
4
4
|
"description": "our tiptap components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tiptap"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"motion": ">=12.23.6",
|
|
29
29
|
"react": ">=19.0.0-rc.0",
|
|
30
30
|
"react-dom": ">=19.0.0-rc.0",
|
|
31
|
-
"@kopexa/theme": "17.
|
|
31
|
+
"@kopexa/theme": "17.24.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@floating-ui/dom": "^1.7.4",
|
|
@@ -66,29 +66,29 @@
|
|
|
66
66
|
"react-intl": "^7.1.14",
|
|
67
67
|
"y-indexeddb": "^9.0.12",
|
|
68
68
|
"yjs": "^13.6.0",
|
|
69
|
-
"@kopexa/button": "17.0.
|
|
70
|
-
"@kopexa/chip": "17.1.
|
|
71
|
-
"@kopexa/
|
|
72
|
-
"@kopexa/
|
|
73
|
-
"@kopexa/
|
|
69
|
+
"@kopexa/button": "17.0.52",
|
|
70
|
+
"@kopexa/chip": "17.1.49",
|
|
71
|
+
"@kopexa/dropdown-menu": "17.0.52",
|
|
72
|
+
"@kopexa/callout": "17.0.52",
|
|
73
|
+
"@kopexa/editor-utils": "17.1.3",
|
|
74
|
+
"@kopexa/dialog": "17.2.17",
|
|
75
|
+
"@kopexa/extension-code": "17.0.52",
|
|
76
|
+
"@kopexa/extension-controlref": "17.1.34",
|
|
74
77
|
"@kopexa/extension-pages": "17.0.45",
|
|
75
|
-
"@kopexa/
|
|
76
|
-
"@kopexa/
|
|
77
|
-
"@kopexa/
|
|
78
|
-
"@kopexa/
|
|
79
|
-
"@kopexa/
|
|
80
|
-
"@kopexa/label": "17.0.
|
|
81
|
-
"@kopexa/
|
|
82
|
-
"@kopexa/
|
|
83
|
-
"@kopexa/
|
|
84
|
-
"@kopexa/
|
|
85
|
-
"@kopexa/
|
|
86
|
-
"@kopexa/
|
|
87
|
-
"@kopexa/
|
|
88
|
-
"@kopexa/
|
|
89
|
-
"@kopexa/use-composed-ref": "17.0.50",
|
|
90
|
-
"@kopexa/use-is-mobile": "17.0.50",
|
|
91
|
-
"@kopexa/toolbar": "17.2.15"
|
|
78
|
+
"@kopexa/extension-table": "17.1.4",
|
|
79
|
+
"@kopexa/icons": "17.7.17",
|
|
80
|
+
"@kopexa/input": "17.0.52",
|
|
81
|
+
"@kopexa/popover": "17.2.17",
|
|
82
|
+
"@kopexa/select": "17.2.17",
|
|
83
|
+
"@kopexa/label": "17.0.52",
|
|
84
|
+
"@kopexa/react-utils": "17.0.52",
|
|
85
|
+
"@kopexa/switch": "17.2.17",
|
|
86
|
+
"@kopexa/separator": "17.0.52",
|
|
87
|
+
"@kopexa/tabs": "17.0.52",
|
|
88
|
+
"@kopexa/shared-utils": "17.0.52",
|
|
89
|
+
"@kopexa/toolbar": "17.2.17",
|
|
90
|
+
"@kopexa/use-is-mobile": "17.0.52",
|
|
91
|
+
"@kopexa/use-composed-ref": "17.0.52"
|
|
92
92
|
},
|
|
93
93
|
"clean-package": "../../../clean-package.config.json",
|
|
94
94
|
"module": "dist/index.mjs",
|