@fileverse-dev/ddoc 3.2.2-sg-2 → 3.2.2-sg-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.
Files changed (2) hide show
  1. package/dist/index.es.js +28 -18
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -184065,37 +184065,47 @@ const CKe = { status: "idle" }, _Ke = (e) => {
184065
184065
  onLocalUpdate: e,
184066
184066
  ignoredOrigins: [d]
184067
184067
  }), F = Te(async () => {
184068
- const w = d.current;
184069
- if (w && await w.destroy(), t && n) {
184068
+ const k = d.current;
184069
+ if (k && await k.destroy(), t && n) {
184070
184070
  a(!1);
184071
184071
  try {
184072
- const k = new x$e(n, i);
184073
- d.current = k, await k.whenSynced, a(!0);
184074
- } catch (k) {
184075
- console.error("IndexedDB initialization failed:", k), d.current = null, a(!0), o == null || o(
184076
- k instanceof Error ? k : new Error(String(k))
184072
+ const E = new x$e(n, i);
184073
+ d.current = E, await E.whenSynced, a(!0);
184074
+ } catch (E) {
184075
+ console.error("IndexedDB initialization failed:", E), d.current = null, a(!0), o == null || o(
184076
+ E instanceof Error ? E : new Error(String(E))
184077
184077
  );
184078
184078
  }
184079
184079
  } else
184080
184080
  a(!0);
184081
184081
  }, [t, n, i, o]), x = je(
184082
184082
  null
184083
- ), D = Te(() => {
184084
- x.current && (clearTimeout(x.current), x.current = null), e == null || e(Xn(lo(i)), "");
184085
- }, [i, e]);
184083
+ ), D = je(e);
184084
+ _e(() => {
184085
+ D.current = e;
184086
+ }, [e]);
184087
+ const w = Te(() => {
184088
+ var k;
184089
+ x.current && (clearTimeout(x.current), x.current = null), (k = D.current) == null || k.call(D, Xn(lo(i)), "");
184090
+ }, [i]);
184086
184091
  return _e(() => {
184087
- const w = (k, E) => {
184088
- if (E === "self" || E === d.current)
184092
+ const k = (E, A) => {
184093
+ if (A === "self" || A === d.current)
184089
184094
  return;
184090
- const A = Xn(k);
184095
+ const O = Xn(E);
184091
184096
  x.current && clearTimeout(x.current), x.current = setTimeout(() => {
184092
- x.current = null, e == null || e(Xn(lo(i)), A);
184097
+ var j;
184098
+ x.current = null, (j = D.current) == null || j.call(
184099
+ D,
184100
+ Xn(lo(i)),
184101
+ O
184102
+ );
184093
184103
  }, 300);
184094
184104
  };
184095
- return i && i.on("update", w), () => {
184096
- i == null || i.off("update", w), x.current && clearTimeout(x.current);
184105
+ return i && i.on("update", k), () => {
184106
+ i == null || i.off("update", k);
184097
184107
  };
184098
- }, [e, i]), {
184108
+ }, [i]), {
184099
184109
  ydoc: i,
184100
184110
  onConnect: p,
184101
184111
  isReady: h,
@@ -184106,7 +184116,7 @@ const CKe = { status: "idle" }, _Ke = (e) => {
184106
184116
  isIndexeddbSynced: s,
184107
184117
  initialiseYjsIndexedDbProvider: F,
184108
184118
  refreshYjsIndexedDbProvider: F,
184109
- flushPendingUpdate: D,
184119
+ flushPendingUpdate: w,
184110
184120
  collabState: y
184111
184121
  };
184112
184122
  }, Xee = ({
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "3.2.2-sg-2",
5
+ "version": "3.2.2-sg-3",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {