@fileverse-dev/dsheet 4.0.6 → 4.1.1-edit-mode-14

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 (48) hide show
  1. package/dist/editor/components/editor-workbook-controls.d.ts +11 -0
  2. package/dist/editor/components/editor-workbook-controls.test.d.ts +1 -0
  3. package/dist/editor/components/editor-workbook.d.ts +5 -1
  4. package/dist/editor/components/permission-chip-model.d.ts +34 -0
  5. package/dist/editor/components/permission-chip.d.ts +5 -1
  6. package/dist/editor/components/permission-chip.test.d.ts +1 -0
  7. package/dist/editor/contexts/editor-context.d.ts +11 -2
  8. package/dist/editor/dsheet-editor.d.ts +3 -2
  9. package/dist/editor/hooks/collaboration-lifecycle.d.ts +35 -0
  10. package/dist/editor/hooks/collaboration-lifecycle.test.d.ts +1 -0
  11. package/dist/editor/hooks/use-collab-awareness.d.ts +3 -6
  12. package/dist/editor/hooks/use-editor-data.d.ts +2 -2
  13. package/dist/editor/hooks/use-editor-sync.d.ts +6 -2
  14. package/dist/editor/types.d.ts +29 -3
  15. package/dist/editor/utils/detach-workbook-data.d.ts +8 -0
  16. package/dist/editor/utils/detach-workbook-data.test.d.ts +1 -0
  17. package/dist/editor/utils/editor-handle.d.ts +11 -0
  18. package/dist/editor/utils/editor-handle.test.d.ts +1 -0
  19. package/dist/{index-CQUhZB3J.js → index-DzwlrPIa.js} +19873 -18770
  20. package/dist/index.d.ts +3 -1
  21. package/dist/index.es.js +52 -48
  22. package/dist/persistence-utils-BXFajzvq.js +98 -0
  23. package/dist/persistence-utils.d.ts +6 -0
  24. package/dist/persistence-utils.test.d.ts +1 -0
  25. package/dist/persistence.js +1 -1
  26. package/dist/sheet-engine/react/components/Toolbar/index.d.ts +1 -0
  27. package/dist/sheet-engine/react/components/Workbook/index.d.ts +1 -0
  28. package/dist/style.css +1 -1
  29. package/dist/sync-local/SyncManager.d.ts +54 -9
  30. package/dist/sync-local/crypto/room-key.d.ts +2 -0
  31. package/dist/sync-local/crypto/room-key.test.d.ts +1 -0
  32. package/dist/sync-local/floor.d.ts +8 -0
  33. package/dist/sync-local/floor.test.d.ts +1 -0
  34. package/dist/sync-local/index.d.ts +1 -1
  35. package/dist/sync-local/presence.d.ts +11 -0
  36. package/dist/sync-local/presence.test.d.ts +1 -0
  37. package/dist/sync-local/session-tools.d.ts +31 -0
  38. package/dist/sync-local/session-tools.test.d.ts +1 -0
  39. package/dist/sync-local/socketClient.d.ts +74 -8
  40. package/dist/sync-local/types/index.d.ts +111 -15
  41. package/dist/sync-local/useSyncManager.d.ts +4 -0
  42. package/dist/{use-xlsx-import-impl-DNTnmzDN.js → use-xlsx-import-impl-CeDHNaXi.js} +3 -3
  43. package/dist/{xlsx-defined-names-BHxDk83p.js → xlsx-defined-names-CPlC1afa.js} +1 -1
  44. package/dist/{xlsx-export-impl-r3bDoVjv.js → xlsx-export-impl-SyIbZKQB.js} +3 -3
  45. package/dist/{xlsx-hyperlink-inline-B5IR_SOR.js → xlsx-hyperlink-inline-Ch9f11g5.js} +1 -1
  46. package/package.json +6 -4
  47. package/dist/persistence-utils-DsM_MOB1.js +0 -89
  48. package/dist/sync-local/utils/objectToFile.d.ts +0 -1
@@ -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;