@kopexa/tiptap 17.8.0 → 17.8.1

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 CHANGED
@@ -208,7 +208,7 @@ function CollaborationProvider({
208
208
  (0, import_react3.useEffect)(() => {
209
209
  const remote = remoteRef.current;
210
210
  if (!remote) return;
211
- if (enableLocalPersistence) {
211
+ if (enableLocalPersistence && !localRef.current) {
212
212
  const local = new import_y_indexeddb.IndexeddbPersistence(documentId, ydoc);
213
213
  local.on("synced", () => setLocalSynced(true));
214
214
  localRef.current = local;
@@ -262,12 +262,19 @@ function CollaborationProvider({
262
262
  remote.off("authenticationFailed", onAuthFailed);
263
263
  remote.off("synced", onSynced);
264
264
  remote.off("status", onStatus);
265
- remote.destroy();
265
+ remote.disconnect();
266
266
  (_a = localRef.current) == null ? void 0 : _a.destroy();
267
267
  localRef.current = null;
268
- remoteRef.current = null;
268
+ setReady(false);
269
269
  };
270
270
  }, [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
+ }, []);
271
278
  (0, import_react3.useEffect)(() => {
272
279
  var _a;
273
280
  const awareness = (_a = remoteRef.current) == null ? void 0 : _a.awareness;
package/dist/index.mjs CHANGED
@@ -153,7 +153,7 @@ function CollaborationProvider({
153
153
  useEffect2(() => {
154
154
  const remote = remoteRef.current;
155
155
  if (!remote) return;
156
- if (enableLocalPersistence) {
156
+ if (enableLocalPersistence && !localRef.current) {
157
157
  const local = new IndexeddbPersistence(documentId, ydoc);
158
158
  local.on("synced", () => setLocalSynced(true));
159
159
  localRef.current = local;
@@ -207,12 +207,19 @@ function CollaborationProvider({
207
207
  remote.off("authenticationFailed", onAuthFailed);
208
208
  remote.off("synced", onSynced);
209
209
  remote.off("status", onStatus);
210
- remote.destroy();
210
+ remote.disconnect();
211
211
  (_a = localRef.current) == null ? void 0 : _a.destroy();
212
212
  localRef.current = null;
213
- remoteRef.current = null;
213
+ setReady(false);
214
214
  };
215
215
  }, [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
+ }, []);
216
223
  useEffect2(() => {
217
224
  var _a;
218
225
  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.0",
3
+ "version": "17.8.1",
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.23.0"
31
+ "@kopexa/theme": "17.23.1"
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.49",
70
- "@kopexa/chip": "17.1.46",
71
- "@kopexa/callout": "17.0.49",
72
- "@kopexa/dialog": "17.2.14",
73
- "@kopexa/dropdown-menu": "17.0.49",
74
- "@kopexa/editor-utils": "17.1.0",
75
- "@kopexa/extension-code": "17.0.49",
76
- "@kopexa/extension-table": "17.1.1",
69
+ "@kopexa/button": "17.0.50",
70
+ "@kopexa/chip": "17.1.47",
71
+ "@kopexa/callout": "17.0.50",
72
+ "@kopexa/editor-utils": "17.1.1",
73
+ "@kopexa/extension-code": "17.0.50",
77
74
  "@kopexa/extension-pages": "17.0.45",
78
- "@kopexa/extension-controlref": "17.1.31",
79
- "@kopexa/icons": "17.7.14",
80
- "@kopexa/input": "17.0.49",
81
- "@kopexa/popover": "17.2.14",
82
- "@kopexa/switch": "17.2.14",
83
- "@kopexa/select": "17.2.14",
84
- "@kopexa/label": "17.0.49",
85
- "@kopexa/shared-utils": "17.0.49",
86
- "@kopexa/separator": "17.0.49",
87
- "@kopexa/react-utils": "17.0.49",
88
- "@kopexa/tabs": "17.0.49",
89
- "@kopexa/toolbar": "17.2.14",
90
- "@kopexa/use-composed-ref": "17.0.49",
91
- "@kopexa/use-is-mobile": "17.0.49"
75
+ "@kopexa/dropdown-menu": "17.0.50",
76
+ "@kopexa/extension-controlref": "17.1.32",
77
+ "@kopexa/icons": "17.7.15",
78
+ "@kopexa/dialog": "17.2.15",
79
+ "@kopexa/extension-table": "17.1.2",
80
+ "@kopexa/label": "17.0.50",
81
+ "@kopexa/input": "17.0.50",
82
+ "@kopexa/popover": "17.2.15",
83
+ "@kopexa/switch": "17.2.15",
84
+ "@kopexa/select": "17.2.15",
85
+ "@kopexa/separator": "17.0.50",
86
+ "@kopexa/shared-utils": "17.0.50",
87
+ "@kopexa/react-utils": "17.0.50",
88
+ "@kopexa/tabs": "17.0.50",
89
+ "@kopexa/use-composed-ref": "17.0.50",
90
+ "@kopexa/use-is-mobile": "17.0.50",
91
+ "@kopexa/toolbar": "17.2.15"
92
92
  },
93
93
  "clean-package": "../../../clean-package.config.json",
94
94
  "module": "dist/index.mjs",