@fileverse-dev/dsheet 4.0.4 → 4.0.5-edit-mode-2

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 (70) hide show
  1. package/dist/editor/components/permission-chip-model.d.ts +20 -0
  2. package/dist/editor/components/permission-chip.d.ts +2 -1
  3. package/dist/editor/components/permission-chip.test.d.ts +1 -0
  4. package/dist/editor/components/sidebar/use-right-panels.d.ts +1 -1
  5. package/dist/editor/components/sidebars/named-ranges.d.ts +2 -0
  6. package/dist/editor/contexts/editor-context.d.ts +13 -5
  7. package/dist/editor/dsheet-editor.d.ts +3 -2
  8. package/dist/editor/hooks/collaboration-lifecycle.d.ts +30 -0
  9. package/dist/editor/hooks/collaboration-lifecycle.test.d.ts +1 -0
  10. package/dist/editor/hooks/use-celldata-compaction.d.ts +2 -3
  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 +7 -3
  14. package/dist/editor/types.d.ts +21 -6
  15. package/dist/editor/utils/compact-committed-celldata.d.ts +11 -10
  16. package/dist/editor/utils/defined-names-ydoc.d.ts +31 -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/editor/utils/import-compaction.d.ts +25 -0
  20. package/dist/editor/utils/xlsx-defined-names.d.ts +41 -0
  21. package/dist/editor/utils/xlsx-import-pipeline.d.ts +28 -0
  22. package/dist/{executeStringFunction-CsLQk-dm.js → executeStringFunction-B6fhDKyN.js} +6985 -6477
  23. package/dist/formula.js +1 -1
  24. package/dist/{index-DvwJ-8x8.js → index-CH7IOLtg.js} +19885 -18452
  25. package/dist/index.d.ts +3 -1
  26. package/dist/index.es.js +51 -47
  27. package/dist/persistence-utils-BXFajzvq.js +98 -0
  28. package/dist/persistence-utils.d.ts +8 -2
  29. package/dist/persistence-utils.test.d.ts +1 -0
  30. package/dist/persistence.js +1 -1
  31. package/dist/sheet-engine/core/api/common.d.ts +1 -0
  32. package/dist/sheet-engine/core/context.d.ts +3 -1
  33. package/dist/sheet-engine/core/index.d.ts +2 -2
  34. package/dist/sheet-engine/core/modules/formula-snapshot-eval.d.ts +11 -0
  35. package/dist/sheet-engine/core/modules/formula.d.ts +27 -0
  36. package/dist/sheet-engine/core/modules/index.d.ts +3 -2
  37. package/dist/sheet-engine/core/modules/namedRanges.d.ts +53 -0
  38. package/dist/sheet-engine/core/paste/paste-border-utils.d.ts +2 -0
  39. package/dist/sheet-engine/core/settings.d.ts +2 -0
  40. package/dist/sheet-engine/core/types.d.ts +21 -0
  41. package/dist/sheet-engine/react/components/NamedRanges/index.d.ts +4 -0
  42. package/dist/sheet-engine/react/components/Workbook/api.d.ts +1 -0
  43. package/dist/sheet-engine/react/components/Workbook/index.d.ts +1 -0
  44. package/dist/style.css +1 -1
  45. package/dist/sync-local/SyncManager.d.ts +54 -9
  46. package/dist/sync-local/crypto/room-key.d.ts +2 -0
  47. package/dist/sync-local/crypto/room-key.test.d.ts +1 -0
  48. package/dist/sync-local/floor.d.ts +8 -0
  49. package/dist/sync-local/floor.test.d.ts +1 -0
  50. package/dist/sync-local/index.d.ts +1 -1
  51. package/dist/sync-local/presence.d.ts +11 -0
  52. package/dist/sync-local/presence.test.d.ts +1 -0
  53. package/dist/sync-local/session-tools.d.ts +31 -0
  54. package/dist/sync-local/session-tools.test.d.ts +1 -0
  55. package/dist/sync-local/socketClient.d.ts +74 -8
  56. package/dist/sync-local/types/index.d.ts +111 -15
  57. package/dist/sync-local/useSyncManager.d.ts +4 -0
  58. package/dist/use-xlsx-import-impl-DOcZ33dx.js +1898 -0
  59. package/dist/worker/dsheet-worker-client.d.ts +14 -0
  60. package/dist/worker/dsheet-worker.d.ts +14 -0
  61. package/dist/xlsx-defined-names-Cr9azhIk.js +117 -0
  62. package/dist/xlsx-export-impl-B6j84v9Z.js +831 -0
  63. package/dist/xlsx-hyperlink-inline-3ydwc_lu.js +2512 -0
  64. package/package.json +2 -1
  65. package/dist/persistence-utils-DsM_MOB1.js +0 -89
  66. package/dist/sync-local/utils/objectToFile.d.ts +0 -1
  67. package/dist/use-xlsx-import-impl-I69dMglI.js +0 -1549
  68. package/dist/xlsx-export-impl-Bg7Suzh-.js +0 -3138
  69. package/dist/xlsx-hyperlink-inline-DzewAypN.js +0 -71
  70. package/dist/xlsx-image-utils-Cvg0qxRA.js +0 -126
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/dsheet",
3
3
  "private": false,
4
4
  "description": "DSheet",
5
- "version": "4.0.4",
5
+ "version": "4.0.5-edit-mode-2",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {
@@ -69,6 +69,7 @@
69
69
  "@tippyjs/react": "^4.2.6",
70
70
  "@ucans/ucans": "^0.12.0",
71
71
  "classnames": "^2.5.1",
72
+ "comlink": "^4.4.2",
72
73
  "dayjs": "^1.11.0",
73
74
  "exceljs": "^4.4.0",
74
75
  "immer": "^9.0.12",
@@ -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;