@fileverse-dev/dsheet 0.0.84 → 0.0.85

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 +38 -39
  2. package/package.json +2 -2
package/dist/index.es.js CHANGED
@@ -6905,31 +6905,30 @@ const aJ = (e, r, t, a) => {
6905
6905
  };
6906
6906
  return delete s.data, s;
6907
6907
  }), iJ = (e, r, t, a, n, o = !1, i, s, u) => {
6908
- const [l, c] = _t([]), [f, d] = _t(!1), h = Vt([]), p = Vt(!1), m = Vt(!1), v = Vt(!0), g = Vt(!1), y = Vt(null), b = Vt(!1), F = Vt(!1);
6908
+ const [l, c] = _t([]), [f, d] = _t(!1), h = Vt([]), p = Vt(!1), m = Vt(!1), v = Vt(!0), g = Vt(!1), y = Vt(null), b = Vt(!1);
6909
6909
  Jt(() => {
6910
6910
  if (!(!(n != null && n.length) || !e.current || !r))
6911
6911
  try {
6912
- const A = e.current, S = BY(n), x = new sf();
6913
- V3(x, S);
6914
- const N = x.getArray(r);
6915
- if (Array.from(N).length > 0) {
6916
- V3(A, S);
6917
- const j = A.getArray(r), O = Array.from(j);
6918
- h.current = O, m.current = !0, d(!0), b.current = !0, a && a((E) => E + 1);
6919
- }
6920
- x.destroy();
6921
- } catch (A) {
6922
- console.error("[DSheet] Error processing portal content:", A);
6912
+ const w = e.current, A = BY(n), S = new sf();
6913
+ V3(S, A);
6914
+ const x = S.getArray(r);
6915
+ if (Array.from(x).length > 0) {
6916
+ V3(w, A);
6917
+ const D = w.getArray(r), j = Array.from(D);
6918
+ h.current = j, m.current = !0, d(!0), b.current = !0, a && a((O) => O + 1);
6919
+ }
6920
+ S.destroy();
6921
+ } catch (w) {
6922
+ console.error("[DSheet] Error processing portal content:", w);
6923
6923
  }
6924
6924
  }, [n, r, e, o]), Jt(() => {
6925
6925
  if (!(!u || !e.current || !r))
6926
6926
  try {
6927
- const A = e.current.getArray(r), S = Array.from(A);
6928
- S.length > 0 && u && !F.current && (S.forEach((x) => {
6929
- const N = x.celldata;
6927
+ const w = e.current.getArray(r), A = Array.from(w);
6928
+ A.length > 0 && u && A.forEach((S, x) => {
6929
+ const N = S.celldata;
6930
6930
  N == null || N.forEach((D) => {
6931
- const j = u[`${D.r}_${D.c}`];
6932
- j && j.sheetId === x.id ? D.v && (D.v = {
6931
+ u[`${x}_${D.r}_${D.c}`] ? D.v && (D.v = {
6933
6932
  ...D.v,
6934
6933
  ps: tJ
6935
6934
  }) : D.v && (D.v = {
@@ -6937,46 +6936,46 @@ const aJ = (e, r, t, a) => {
6937
6936
  ps: void 0
6938
6937
  });
6939
6938
  });
6940
- }), F.current = !0);
6941
- } catch (A) {
6942
- console.error("[DSheet] Error processing comment data:", A);
6939
+ });
6940
+ } catch (w) {
6941
+ console.error("[DSheet] Error processing comment data:", w);
6943
6942
  }
6944
6943
  }, [u, r, e, o, f]), Jt(() => {
6945
6944
  !e.current || !r || s === "synced" && (() => {
6946
- var N, D;
6945
+ var x, N;
6947
6946
  if (m.current)
6948
6947
  return;
6949
- const S = (N = e.current) == null ? void 0 : N.getArray(r), x = Array.from(S || []);
6950
- if (x.length === 0)
6948
+ const A = (x = e.current) == null ? void 0 : x.getArray(r), S = Array.from(A || []);
6949
+ if (S.length === 0)
6951
6950
  if (o)
6952
6951
  d(!0), b.current;
6953
6952
  else {
6954
- const j = LE;
6955
- (D = e.current) == null || D.transact(() => {
6956
- S == null || S.delete(0, S.length), S == null || S.insert(0, j);
6957
- }), h.current = j;
6953
+ const D = LE;
6954
+ (N = e.current) == null || N.transact(() => {
6955
+ A == null || A.delete(0, A.length), A == null || A.insert(0, D);
6956
+ }), h.current = D;
6958
6957
  }
6959
6958
  else
6960
- h.current = x, a && a((j) => j + 1);
6959
+ h.current = S, a && a((D) => D + 1);
6961
6960
  m.current = !0, d(!0);
6962
6961
  })();
6963
6962
  }, [r, o, s]), Jt(() => {
6964
6963
  if (!e.current || !r) return;
6965
- const A = e.current.getArray(r), S = () => {
6964
+ const w = e.current.getArray(r), A = () => {
6966
6965
  if (g.current)
6967
6966
  return;
6968
6967
  p.current = !0;
6969
- const x = Array.from(A);
6970
- h.current = x, y.current !== null && window.clearTimeout(y.current), y.current = window.setTimeout(() => {
6971
- a && a((N) => N + 1), y.current = null;
6968
+ const S = Array.from(w);
6969
+ h.current = S, y.current !== null && window.clearTimeout(y.current), y.current = window.setTimeout(() => {
6970
+ a && a((x) => x + 1), y.current = null;
6972
6971
  }, 50);
6973
6972
  };
6974
- return A.observe(S), () => {
6975
- A.unobserve(S), y.current !== null && window.clearTimeout(y.current);
6973
+ return w.observe(A), () => {
6974
+ w.unobserve(A), y.current !== null && window.clearTimeout(y.current);
6976
6975
  };
6977
6976
  }, [e, r]);
6978
- const w = Ut(
6979
- (A) => {
6977
+ const F = Ut(
6978
+ (w) => {
6980
6979
  if (v.current) {
6981
6980
  v.current = !1;
6982
6981
  return;
@@ -6985,9 +6984,9 @@ const aJ = (e, r, t, a) => {
6985
6984
  p.current = !1;
6986
6985
  return;
6987
6986
  }
6988
- g.current = !0, aJ(e.current, r, A, t.current), setTimeout(() => {
6987
+ g.current = !0, aJ(e.current, r, w, t.current), setTimeout(() => {
6989
6988
  g.current = !1;
6990
- }, 50), i && i(A);
6989
+ }, 50), i && i(w);
6991
6990
  },
6992
6991
  [r, i]
6993
6992
  );
@@ -6997,7 +6996,7 @@ const aJ = (e, r, t, a) => {
6997
6996
  currentDataRef: h,
6998
6997
  remoteUpdateRef: p,
6999
6998
  isDataLoaded: f,
7000
- handleChange: w
6999
+ handleChange: F
7001
7000
  };
7002
7001
  }, oJ = 1200, lJ = 2500, tg = 3e4, Eb = (e) => {
7003
7002
  if (e.shouldConnect && e.ws === null) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/dsheet",
3
3
  "private": false,
4
4
  "description": "DSheet",
5
- "version": "0.0.84",
5
+ "version": "0.0.85",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {
@@ -82,4 +82,4 @@
82
82
  "typescript": "^5.2.2",
83
83
  "vite": "^5.0.0"
84
84
  }
85
- }
85
+ }