@fileverse-dev/dsheet 4.1.2 → 4.1.4

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 (58) hide show
  1. package/README.md +1 -1
  2. package/dist/{constants-CRFfbkoQ.js → constants-8Ij49Lxv.js} +79 -22
  3. package/dist/constants.d.ts +2 -2
  4. package/dist/constants.js +3 -3
  5. package/dist/crypto-constants-CY-Whjwy.js +333 -0
  6. package/dist/editor/components/editor-workbook-controls.d.ts +11 -0
  7. package/dist/editor/components/editor-workbook-controls.test.d.ts +1 -0
  8. package/dist/editor/components/editor-workbook.d.ts +5 -1
  9. package/dist/editor/components/permission-chip-model.d.ts +34 -0
  10. package/dist/editor/components/permission-chip.d.ts +5 -1
  11. package/dist/editor/components/permission-chip.test.d.ts +1 -0
  12. package/dist/editor/contexts/editor-context.d.ts +11 -2
  13. package/dist/editor/dsheet-editor.d.ts +3 -2
  14. package/dist/editor/hooks/collaboration-lifecycle.d.ts +35 -0
  15. package/dist/editor/hooks/collaboration-lifecycle.test.d.ts +1 -0
  16. package/dist/editor/hooks/use-collab-awareness.d.ts +3 -6
  17. package/dist/editor/hooks/use-editor-data.d.ts +2 -2
  18. package/dist/editor/hooks/use-editor-sync.d.ts +6 -2
  19. package/dist/editor/types.d.ts +29 -3
  20. package/dist/editor/utils/detach-workbook-data.d.ts +8 -0
  21. package/dist/editor/utils/detach-workbook-data.test.d.ts +1 -0
  22. package/dist/editor/utils/editor-handle.d.ts +11 -0
  23. package/dist/editor/utils/editor-handle.test.d.ts +1 -0
  24. package/dist/{executeStringFunction-BhS7NspU.js → executeStringFunction-adhsb5GH.js} +1 -1
  25. package/dist/formula.js +1 -1
  26. package/dist/{index-CufCBExa.js → index-CRzwkPJq.js} +28208 -28025
  27. package/dist/index.d.ts +3 -1
  28. package/dist/index.es.js +55 -51
  29. package/dist/persistence-utils-BXFajzvq.js +98 -0
  30. package/dist/persistence-utils.d.ts +6 -0
  31. package/dist/persistence-utils.test.d.ts +1 -0
  32. package/dist/persistence.js +1 -1
  33. package/dist/sheet-engine/react/components/Toolbar/index.d.ts +1 -0
  34. package/dist/sheet-engine/react/components/Workbook/index.d.ts +1 -0
  35. package/dist/style.css +1 -1
  36. package/dist/sync-local/SyncManager.d.ts +54 -9
  37. package/dist/sync-local/crypto/room-key.d.ts +2 -0
  38. package/dist/sync-local/crypto/room-key.test.d.ts +1 -0
  39. package/dist/sync-local/floor.d.ts +8 -0
  40. package/dist/sync-local/floor.test.d.ts +1 -0
  41. package/dist/sync-local/index.d.ts +1 -1
  42. package/dist/sync-local/presence.d.ts +13 -0
  43. package/dist/sync-local/presence.test.d.ts +1 -0
  44. package/dist/sync-local/session-tools.d.ts +31 -0
  45. package/dist/sync-local/session-tools.test.d.ts +1 -0
  46. package/dist/sync-local/socketClient.d.ts +75 -8
  47. package/dist/sync-local/types/index.d.ts +111 -15
  48. package/dist/sync-local/useSyncManager.d.ts +4 -0
  49. package/dist/template-data-list-ahkAKadB.js +117921 -0
  50. package/dist/{use-xlsx-import-impl-BrpzMELW.js → use-xlsx-import-impl-tzKWGisi.js} +4 -4
  51. package/dist/{xlsx-defined-names-DR03Ea-E.js → xlsx-defined-names-CflXuPTO.js} +2 -2
  52. package/dist/{xlsx-export-impl-wJaTTBGt.js → xlsx-export-impl-CkJLfQwm.js} +4 -4
  53. package/dist/{xlsx-hyperlink-inline-53h_A_BI.js → xlsx-hyperlink-inline-DWLdqDYy.js} +2 -2
  54. package/package.json +3 -3
  55. package/dist/crypto-constants-ZTlAYRUf.js +0 -1165
  56. package/dist/persistence-utils-DsM_MOB1.js +0 -89
  57. package/dist/sync-local/utils/objectToFile.d.ts +0 -1
  58. package/dist/template-data-list-RKnVLsuf.js +0 -502876
@@ -1,89 +0,0 @@
1
- import * as c from "yjs";
2
- const u = typeof Buffer == "function";
3
- typeof TextDecoder == "function" && new TextDecoder();
4
- typeof TextEncoder == "function" && new TextEncoder();
5
- const b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", s = Array.prototype.slice.call(b), l = ((t) => {
6
- let e = {};
7
- return t.forEach((r, o) => e[r] = o), e;
8
- })(s), g = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, f = String.fromCharCode.bind(String), h = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : (t) => new Uint8Array(Array.prototype.slice.call(t, 0)), S = (t) => t.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" : "_"), A = (t) => t.replace(/[^A-Za-z0-9\+\/]/g, ""), E = (t) => {
9
- let e, r, o, n, a = "";
10
- const p = t.length % 3;
11
- for (let i = 0; i < t.length; ) {
12
- if ((r = t.charCodeAt(i++)) > 255 || (o = t.charCodeAt(i++)) > 255 || (n = t.charCodeAt(i++)) > 255)
13
- throw new TypeError("invalid character found");
14
- e = r << 16 | o << 8 | n, a += s[e >> 18 & 63] + s[e >> 12 & 63] + s[e >> 6 & 63] + s[e & 63];
15
- }
16
- return p ? a.slice(0, p - 3) + "===".substring(p) : a;
17
- }, U = typeof btoa == "function" ? (t) => btoa(t) : u ? (t) => Buffer.from(t, "binary").toString("base64") : E, d = u ? (t) => Buffer.from(t).toString("base64") : (t) => {
18
- let r = [];
19
- for (let o = 0, n = t.length; o < n; o += 4096)
20
- r.push(f.apply(null, t.subarray(o, o + 4096)));
21
- return U(r.join(""));
22
- }, m = (t, e = !1) => e ? S(d(t)) : d(t), _ = (t) => {
23
- if (t = t.replace(/\s+/g, ""), !g.test(t))
24
- throw new TypeError("malformed base64.");
25
- t += "==".slice(2 - (t.length & 3));
26
- let e, r, o, n = [];
27
- for (let a = 0; a < t.length; )
28
- e = l[t.charAt(a++)] << 18 | l[t.charAt(a++)] << 12 | (r = l[t.charAt(a++)]) << 6 | (o = l[t.charAt(a++)]), r === 64 ? n.push(f(e >> 16 & 255)) : o === 64 ? n.push(f(e >> 16 & 255, e >> 8 & 255)) : n.push(f(e >> 16 & 255, e >> 8 & 255, e & 255));
29
- return n.join("");
30
- }, w = typeof atob == "function" ? (t) => atob(A(t)) : u ? (t) => Buffer.from(t, "base64").toString("binary") : _, D = u ? (t) => h(Buffer.from(t, "base64")) : (t) => h(w(t).split("").map((e) => e.charCodeAt(0))), T = (t) => D(C(t)), C = (t) => A(t.replace(/[-_]/g, (e) => e == "-" ? "+" : "/")), P = 8e3, x = (t) => t instanceof Error ? t : new Error(String(t)), v = async (t, e) => {
31
- let r;
32
- try {
33
- return await Promise.race([
34
- t,
35
- new Promise((o, n) => {
36
- r = setTimeout(
37
- () => n(new Error("dSheet IndexedDB operation timed out")),
38
- e
39
- );
40
- })
41
- ]);
42
- } finally {
43
- r && clearTimeout(r);
44
- }
45
- }, y = (t, e, r) => ({
46
- dsheetId: t,
47
- status: e,
48
- encodedState: null,
49
- stateVector: null,
50
- ...r ? { error: x(r) } : {}
51
- }), B = (t, e) => {
52
- const r = c.encodeStateAsUpdate(e);
53
- return {
54
- dsheetId: t,
55
- status: r.length <= 2 ? "empty" : "available",
56
- encodedState: m(r),
57
- stateVector: m(c.encodeStateVector(e))
58
- };
59
- }, z = (t, e, r) => {
60
- if (!r)
61
- return y(
62
- t,
63
- "unavailable",
64
- new Error("dSheet document is not ready")
65
- );
66
- let o;
67
- const n = new c.Doc();
68
- try {
69
- o = T(e), c.applyUpdate(n, o);
70
- } catch (a) {
71
- return y(t, "corrupt", a);
72
- } finally {
73
- n.destroy();
74
- }
75
- try {
76
- return c.applyUpdate(r, o, "dsheet-package-ingress"), B(t, r);
77
- } catch (a) {
78
- return y(t, "corrupt", a);
79
- }
80
- };
81
- export {
82
- P as D,
83
- m as f,
84
- z as m,
85
- B as s,
86
- T as t,
87
- y as u,
88
- v as w
89
- };
@@ -1 +0,0 @@
1
- export declare const objectToFile: (data: Record<string, unknown>, fileName: string) => File;