@fileverse-dev/dsheet 3.0.2-patch.2 → 3.0.2-patch.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/editor/contexts/editor-context.d.ts +1 -0
- package/dist/editor/hooks/use-editor-sync.d.ts +2 -1
- package/dist/editor/types.d.ts +1 -0
- package/dist/{index-Biq3hJno.js → index-QXaCiKEu.js} +5753 -5742
- package/dist/index.es.js +1 -1
- package/dist/{persistence-utils-ySfLnGiT.js → persistence-utils-EM6EHJYw.js} +39 -25
- package/dist/persistence-utils.d.ts +1 -0
- package/dist/persistence.js +1 -1
- package/dist/{use-xlsx-import-impl-BQYFALtb.js → use-xlsx-import-impl-CAu1_1ci.js} +1 -1
- package/dist/{xlsx-export-impl-CqCiaiT9.js → xlsx-export-impl-jffVaI-3.js} +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as s, a as t, b as o, S as r, d as l, i as n, e as i, T as d, f as S, g as c, h, j as m, k as p, l as C, n as u, o as E, p as F, q as g, s as x, t as R, u as L, v as f, w as A, x as I, z as w, A as T, B as b, D as v, E as M, F as D, G as k, H as V, I as X, J as z, K as P, L as U, M as _, N as y } from "./index-
|
|
1
|
+
import { C as s, a as t, b as o, S as r, d as l, i as n, e as i, T as d, f as S, g as c, h, j as m, k as p, l as C, n as u, o as E, p as F, q as g, s as x, t as R, u as L, v as f, w as A, x as I, z as w, A as T, B as b, D as v, E as M, F as D, G as k, H as V, I as X, J as z, K as P, L as U, M as _, N as y } from "./index-QXaCiKEu.js";
|
|
2
2
|
import { bW as G, bX as H, bY as O, c0 as j, bi as J, e as K, f as N, h as Y, a as q, cm as W, as as Z, cu as Q } from "./executeStringFunction-C5hEkx9z.js";
|
|
3
3
|
import { FLVURL as ee } from "@fileverse-dev/formulajs";
|
|
4
4
|
import { E as se, S as te } from "./constants-Q8nzbvQO.js";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import * as h from "yjs";
|
|
2
2
|
import { storeState as g } from "y-indexeddb";
|
|
3
|
-
const
|
|
3
|
+
const u = typeof Buffer == "function";
|
|
4
4
|
typeof TextDecoder == "function" && new TextDecoder();
|
|
5
5
|
typeof TextEncoder == "function" && new TextEncoder();
|
|
6
6
|
const S = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", s = Array.prototype.slice.call(S), i = ((t) => {
|
|
7
7
|
let e = {};
|
|
8
8
|
return t.forEach((r, o) => e[r] = o), e;
|
|
9
|
-
})(s), E = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, l = String.fromCharCode.bind(String), m = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : (t) => new Uint8Array(Array.prototype.slice.call(t, 0)),
|
|
9
|
+
})(s), E = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, l = String.fromCharCode.bind(String), m = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : (t) => new Uint8Array(Array.prototype.slice.call(t, 0)), w = (t) => t.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" : "_"), b = (t) => t.replace(/[^A-Za-z0-9\+\/]/g, ""), _ = (t) => {
|
|
10
10
|
let e, r, o, n, a = "";
|
|
11
|
-
const
|
|
11
|
+
const y = t.length % 3;
|
|
12
12
|
for (let c = 0; c < t.length; ) {
|
|
13
13
|
if ((r = t.charCodeAt(c++)) > 255 || (o = t.charCodeAt(c++)) > 255 || (n = t.charCodeAt(c++)) > 255)
|
|
14
14
|
throw new TypeError("invalid character found");
|
|
15
15
|
e = r << 16 | o << 8 | n, a += s[e >> 18 & 63] + s[e >> 12 & 63] + s[e >> 6 & 63] + s[e & 63];
|
|
16
16
|
}
|
|
17
|
-
return
|
|
18
|
-
},
|
|
17
|
+
return y ? a.slice(0, y - 3) + "===".substring(y) : a;
|
|
18
|
+
}, U = typeof btoa == "function" ? (t) => btoa(t) : u ? (t) => Buffer.from(t, "binary").toString("base64") : _, p = u ? (t) => Buffer.from(t).toString("base64") : (t) => {
|
|
19
19
|
let r = [];
|
|
20
20
|
for (let o = 0, n = t.length; o < n; o += 4096)
|
|
21
21
|
r.push(l.apply(null, t.subarray(o, o + 4096)));
|
|
22
|
-
return
|
|
23
|
-
},
|
|
22
|
+
return U(r.join(""));
|
|
23
|
+
}, d = (t, e = !1) => e ? w(p(t)) : p(t), D = (t) => {
|
|
24
24
|
if (t = t.replace(/\s+/g, ""), !E.test(t))
|
|
25
25
|
throw new TypeError("malformed base64.");
|
|
26
26
|
t += "==".slice(2 - (t.length & 3));
|
|
@@ -28,7 +28,7 @@ const S = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", s
|
|
|
28
28
|
for (let a = 0; a < t.length; )
|
|
29
29
|
e = i[t.charAt(a++)] << 18 | i[t.charAt(a++)] << 12 | (r = i[t.charAt(a++)]) << 6 | (o = i[t.charAt(a++)]), r === 64 ? n.push(l(e >> 16 & 255)) : o === 64 ? n.push(l(e >> 16 & 255, e >> 8 & 255)) : n.push(l(e >> 16 & 255, e >> 8 & 255, e & 255));
|
|
30
30
|
return n.join("");
|
|
31
|
-
},
|
|
31
|
+
}, T = typeof atob == "function" ? (t) => atob(b(t)) : u ? (t) => Buffer.from(t, "base64").toString("binary") : D, x = u ? (t) => m(Buffer.from(t, "base64")) : (t) => m(T(t).split("").map((e) => e.charCodeAt(0))), C = (t) => x(B(t)), B = (t) => b(t.replace(/[-_]/g, (e) => e == "-" ? "+" : "/")), P = 8e3, A = (t) => t instanceof Error ? t : new Error(String(t)), v = async (t, e) => {
|
|
32
32
|
let r;
|
|
33
33
|
try {
|
|
34
34
|
return await Promise.race([
|
|
@@ -43,47 +43,61 @@ const S = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", s
|
|
|
43
43
|
} finally {
|
|
44
44
|
r && clearTimeout(r);
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, f = (t, e, r) => ({
|
|
47
47
|
dsheetId: t,
|
|
48
48
|
status: e,
|
|
49
49
|
encodedState: null,
|
|
50
50
|
stateVector: null,
|
|
51
51
|
...r ? { error: A(r) } : {}
|
|
52
|
-
}),
|
|
52
|
+
}), z = (t, e) => {
|
|
53
53
|
const r = h.encodeStateAsUpdate(e);
|
|
54
54
|
return {
|
|
55
55
|
dsheetId: t,
|
|
56
56
|
status: r.length <= 2 ? "empty" : "available",
|
|
57
|
-
encodedState:
|
|
58
|
-
stateVector:
|
|
57
|
+
encodedState: d(r),
|
|
58
|
+
stateVector: d(h.encodeStateVector(e))
|
|
59
59
|
};
|
|
60
|
-
},
|
|
60
|
+
}, Z = async (t, e, r, o = {}) => {
|
|
61
61
|
if (!e || !r)
|
|
62
|
-
return
|
|
62
|
+
return f(
|
|
63
63
|
t,
|
|
64
64
|
"unavailable",
|
|
65
65
|
new Error("dSheet IndexedDB persistence is not ready")
|
|
66
66
|
);
|
|
67
|
-
const n =
|
|
67
|
+
const n = z(t, e);
|
|
68
68
|
try {
|
|
69
|
-
return await
|
|
69
|
+
return await v(
|
|
70
70
|
g(r, !1),
|
|
71
|
-
o.timeoutMs ??
|
|
71
|
+
o.timeoutMs ?? P
|
|
72
72
|
), n;
|
|
73
73
|
} catch (a) {
|
|
74
|
-
return
|
|
74
|
+
return f(
|
|
75
75
|
t,
|
|
76
76
|
/timed out/i.test(A(a).message) ? "timed-out" : "unavailable",
|
|
77
77
|
a
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
|
+
}, V = async (t, e, r, o, n = {}) => {
|
|
81
|
+
if (!r || !(o != null && o.synced))
|
|
82
|
+
return f(
|
|
83
|
+
t,
|
|
84
|
+
"unavailable",
|
|
85
|
+
new Error("dSheet IndexedDB persistence is not ready")
|
|
86
|
+
);
|
|
87
|
+
try {
|
|
88
|
+
h.applyUpdate(r, C(e), "dsheet-package-ingress");
|
|
89
|
+
} catch (a) {
|
|
90
|
+
return f(t, "corrupt", a);
|
|
91
|
+
}
|
|
92
|
+
return Z(t, r, o, n);
|
|
80
93
|
};
|
|
81
94
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
95
|
+
P as D,
|
|
96
|
+
Z as a,
|
|
97
|
+
d as f,
|
|
98
|
+
V as m,
|
|
99
|
+
z as s,
|
|
100
|
+
C as t,
|
|
101
|
+
f as u,
|
|
102
|
+
v as w
|
|
89
103
|
};
|
|
@@ -16,3 +16,4 @@ export declare const withDsheetPersistenceTimeout: <T>(promise: Promise<T>, time
|
|
|
16
16
|
export declare const unavailableDsheetContentSnapshot: (dsheetId: string, status: Exclude<DSheetContentStatus, "available" | "empty">, error?: unknown) => DSheetContentSnapshot;
|
|
17
17
|
export declare const snapshotDsheetDocument: (dsheetId: string, doc: Y.Doc) => DSheetContentSnapshot;
|
|
18
18
|
export declare const flushDsheetContentPersistence: (dsheetId: string, doc: Y.Doc | null, persistence: IndexeddbPersistence | null, options?: DSheetContentReadOptions) => Promise<DSheetContentSnapshot>;
|
|
19
|
+
export declare const mergeDsheetContentPersistence: (dsheetId: string, encodedState: string, doc: Y.Doc | null, persistence: IndexeddbPersistence | null, options?: DSheetContentReadOptions) => Promise<DSheetContentSnapshot>;
|
package/dist/persistence.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as D, f as h, D as b, u as y, w as g, a as S, s as v } from "./persistence-utils-
|
|
1
|
+
import { t as D, f as h, D as b, u as y, w as g, a as S, s as v } from "./persistence-utils-EM6EHJYw.js";
|
|
2
2
|
import * as u from "yjs";
|
|
3
3
|
import { clearDocument as E, IndexeddbPersistence as x } from "y-indexeddb";
|
|
4
4
|
const m = /* @__PURE__ */ new Map(), M = (e) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as Ze } from "./executeStringFunction-C5hEkx9z.js";
|
|
2
2
|
import * as Je from "yjs";
|
|
3
|
-
import { m as Qe, y as Ke, r as et } from "./index-
|
|
3
|
+
import { m as Qe, y as Ke, r as et } from "./index-QXaCiKEu.js";
|
|
4
4
|
import { n as tt } from "./xlsx-hyperlink-inline-DzewAypN.js";
|
|
5
5
|
import { toast as Ie } from "@fileverse/ui";
|
|
6
6
|
var ze = { exports: {} };
|
|
@@ -3,7 +3,7 @@ import { Workbook as Pt } from "exceljs";
|
|
|
3
3
|
import { toast as Ut } from "@fileverse/ui";
|
|
4
4
|
import { addFortuneImagesToWorksheet as Lt } from "./xlsx-image-utils-Cvg0qxRA.js";
|
|
5
5
|
import { g as jt, c as xt } from "./executeStringFunction-C5hEkx9z.js";
|
|
6
|
-
import { c as Ct } from "./index-
|
|
6
|
+
import { c as Ct } from "./index-QXaCiKEu.js";
|
|
7
7
|
import { c as zt, g as Wt } from "./xlsx-hyperlink-inline-DzewAypN.js";
|
|
8
8
|
const Mt = {
|
|
9
9
|
1: "thin",
|