@fileverse-dev/dsheet 4.1.3 → 4.1.5

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 (53) hide show
  1. package/README.md +1 -1
  2. package/dist/{constants-5ZxHFftQ.js → constants-8Ij49Lxv.js} +79 -22
  3. package/dist/constants.d.ts +2 -2
  4. package/dist/constants.js +3 -3
  5. package/dist/editor/components/editor-workbook-controls.d.ts +11 -0
  6. package/dist/editor/components/editor-workbook-controls.test.d.ts +1 -0
  7. package/dist/editor/components/editor-workbook.d.ts +5 -1
  8. package/dist/editor/components/permission-chip-model.d.ts +34 -0
  9. package/dist/editor/components/permission-chip.d.ts +5 -1
  10. package/dist/editor/components/permission-chip.test.d.ts +1 -0
  11. package/dist/editor/contexts/editor-context.d.ts +11 -2
  12. package/dist/editor/dsheet-editor.d.ts +3 -2
  13. package/dist/editor/hooks/collaboration-lifecycle.d.ts +35 -0
  14. package/dist/editor/hooks/collaboration-lifecycle.test.d.ts +1 -0
  15. package/dist/editor/hooks/use-collab-awareness.d.ts +3 -6
  16. package/dist/editor/hooks/use-editor-data.d.ts +2 -2
  17. package/dist/editor/hooks/use-editor-sync.d.ts +6 -2
  18. package/dist/editor/types.d.ts +29 -3
  19. package/dist/editor/utils/detach-workbook-data.d.ts +8 -0
  20. package/dist/editor/utils/detach-workbook-data.test.d.ts +1 -0
  21. package/dist/editor/utils/editor-handle.d.ts +11 -0
  22. package/dist/editor/utils/editor-handle.test.d.ts +1 -0
  23. package/dist/{index-C-29uy7d.js → index-DgOrT4Bq.js} +23764 -23294
  24. package/dist/index.d.ts +3 -1
  25. package/dist/index.es.js +55 -51
  26. package/dist/persistence-utils-BXFajzvq.js +98 -0
  27. package/dist/persistence-utils.d.ts +6 -0
  28. package/dist/persistence-utils.test.d.ts +1 -0
  29. package/dist/persistence.js +1 -1
  30. package/dist/sheet-engine/react/components/Toolbar/index.d.ts +1 -0
  31. package/dist/sheet-engine/react/components/Workbook/index.d.ts +1 -0
  32. package/dist/style.css +1 -1
  33. package/dist/sync-local/SyncManager.d.ts +54 -9
  34. package/dist/sync-local/crypto/room-key.d.ts +2 -0
  35. package/dist/sync-local/crypto/room-key.test.d.ts +1 -0
  36. package/dist/sync-local/floor.d.ts +8 -0
  37. package/dist/sync-local/floor.test.d.ts +1 -0
  38. package/dist/sync-local/index.d.ts +1 -1
  39. package/dist/sync-local/presence.d.ts +13 -0
  40. package/dist/sync-local/presence.test.d.ts +1 -0
  41. package/dist/sync-local/session-tools.d.ts +31 -0
  42. package/dist/sync-local/session-tools.test.d.ts +1 -0
  43. package/dist/sync-local/socketClient.d.ts +75 -8
  44. package/dist/sync-local/types/index.d.ts +111 -15
  45. package/dist/sync-local/useSyncManager.d.ts +4 -0
  46. package/dist/{template-data-list-ahkAKadB.js → template-data-list-BYOIK_Nd.js} +0 -330
  47. package/dist/{use-xlsx-import-impl-DB8XoHgC.js → use-xlsx-import-impl-W4lqUzHR.js} +3 -3
  48. package/dist/{xlsx-defined-names-Cz6m4fA3.js → xlsx-defined-names-CnACRdTA.js} +1 -1
  49. package/dist/{xlsx-export-impl-C1LcpSSe.js → xlsx-export-impl-DWszDsoF.js} +3 -3
  50. package/dist/{xlsx-hyperlink-inline-iNImgoxT.js → xlsx-hyperlink-inline-C9nJfbRm.js} +1 -1
  51. package/package.json +2 -2
  52. package/dist/persistence-utils-DsM_MOB1.js +0 -89
  53. package/dist/sync-local/utils/objectToFile.d.ts +0 -1
@@ -53421,336 +53421,6 @@ const l = [
53421
53421
  }
53422
53422
  }
53423
53423
  ]
53424
- },
53425
- {
53426
- name: "Invoice",
53427
- status: 0,
53428
- order: 1,
53429
- id: "8f3c4e10-df59-411d-bfe8-807994899b89",
53430
- row: 500,
53431
- column: 36,
53432
- config: {
53433
- rowlen: {
53434
- 1: 49,
53435
- 2: 0,
53436
- 3: 0,
53437
- 4: 0,
53438
- 6: 50,
53439
- 7: 0,
53440
- 8: 0,
53441
- 9: 0,
53442
- 10: 0,
53443
- 11: 0,
53444
- 12: 0,
53445
- 13: 0,
53446
- 16: 0,
53447
- 17: 0,
53448
- 18: 0,
53449
- 19: 0,
53450
- 20: 0,
53451
- 21: 0,
53452
- 22: 0,
53453
- 23: 0,
53454
- 24: 0
53455
- },
53456
- merge: {
53457
- "1_0": {
53458
- rs: 1,
53459
- cs: 4,
53460
- r: 1,
53461
- c: 0
53462
- },
53463
- "6_0": {
53464
- rs: 1,
53465
- cs: 4,
53466
- r: 6,
53467
- c: 0
53468
- },
53469
- "7_0": {
53470
- rs: 1,
53471
- cs: 2,
53472
- r: 7,
53473
- c: 0
53474
- },
53475
- "8_0": {
53476
- rs: 1,
53477
- cs: 2,
53478
- r: 8,
53479
- c: 0
53480
- },
53481
- "8_2": {
53482
- rs: 1,
53483
- cs: 2,
53484
- r: 8,
53485
- c: 2
53486
- },
53487
- "8_4": {
53488
- rs: 1,
53489
- cs: 2,
53490
- r: 8,
53491
- c: 4
53492
- },
53493
- "9_0": {
53494
- rs: 1,
53495
- cs: 2,
53496
- r: 9,
53497
- c: 0
53498
- },
53499
- "9_2": {
53500
- rs: 1,
53501
- cs: 2,
53502
- r: 9,
53503
- c: 2
53504
- },
53505
- "9_4": {
53506
- rs: 1,
53507
- cs: 2,
53508
- r: 9,
53509
- c: 4
53510
- },
53511
- "10_0": {
53512
- rs: 1,
53513
- cs: 2,
53514
- r: 10,
53515
- c: 0
53516
- },
53517
- "10_2": {
53518
- rs: 1,
53519
- cs: 2,
53520
- r: 10,
53521
- c: 2
53522
- },
53523
- "10_4": {
53524
- rs: 1,
53525
- cs: 2,
53526
- r: 10,
53527
- c: 4
53528
- },
53529
- "11_0": {
53530
- rs: 1,
53531
- cs: 2,
53532
- r: 11,
53533
- c: 0
53534
- },
53535
- "11_2": {
53536
- rs: 1,
53537
- cs: 2,
53538
- r: 11,
53539
- c: 2
53540
- },
53541
- "11_4": {
53542
- rs: 1,
53543
- cs: 2,
53544
- r: 11,
53545
- c: 4
53546
- },
53547
- "12_0": {
53548
- rs: 1,
53549
- cs: 2,
53550
- r: 12,
53551
- c: 0
53552
- },
53553
- "12_2": {
53554
- rs: 1,
53555
- cs: 2,
53556
- r: 12,
53557
- c: 2
53558
- },
53559
- "12_4": {
53560
- rs: 1,
53561
- cs: 2,
53562
- r: 12,
53563
- c: 4
53564
- },
53565
- "13_0": {
53566
- rs: 1,
53567
- cs: 2,
53568
- r: 13,
53569
- c: 0
53570
- },
53571
- "13_2": {
53572
- rs: 1,
53573
- cs: 2,
53574
- r: 13,
53575
- c: 2
53576
- },
53577
- "13_4": {
53578
- rs: 1,
53579
- cs: 2,
53580
- r: 13,
53581
- c: 4
53582
- },
53583
- "16_0": {
53584
- rs: 1,
53585
- cs: 3,
53586
- r: 16,
53587
- c: 0
53588
- },
53589
- "17_0": {
53590
- rs: 1,
53591
- cs: 3,
53592
- r: 17,
53593
- c: 0
53594
- },
53595
- "18_0": {
53596
- rs: 1,
53597
- cs: 3,
53598
- r: 18,
53599
- c: 0
53600
- },
53601
- "19_0": {
53602
- rs: 1,
53603
- cs: 3,
53604
- r: 19,
53605
- c: 0
53606
- },
53607
- "20_0": {
53608
- rs: 1,
53609
- cs: 3,
53610
- r: 20,
53611
- c: 0
53612
- },
53613
- "22_1": {
53614
- rs: 1,
53615
- cs: 3,
53616
- r: 22,
53617
- c: 1
53618
- },
53619
- "23_1": {
53620
- rs: 1,
53621
- cs: 3,
53622
- r: 23,
53623
- c: 1
53624
- },
53625
- "24_4": {
53626
- rs: 1,
53627
- cs: 2,
53628
- r: 24,
53629
- c: 4
53630
- }
53631
- },
53632
- customHeight: {
53633
- 1: 1,
53634
- 6: 1
53635
- },
53636
- borderInfo: [
53637
- {
53638
- rangeType: "cell",
53639
- value: {
53640
- row_index: 21,
53641
- col_index: 0,
53642
- b: {
53643
- style: 1,
53644
- color: "rgb(183, 183, 183)"
53645
- }
53646
- }
53647
- },
53648
- {
53649
- rangeType: "cell",
53650
- value: {
53651
- row_index: 21,
53652
- col_index: 1,
53653
- b: {
53654
- style: 1,
53655
- color: "rgb(183, 183, 183)"
53656
- }
53657
- }
53658
- },
53659
- {
53660
- rangeType: "cell",
53661
- value: {
53662
- row_index: 21,
53663
- col_index: 2,
53664
- b: {
53665
- style: 1,
53666
- color: "rgb(183, 183, 183)"
53667
- }
53668
- }
53669
- },
53670
- {
53671
- rangeType: "cell",
53672
- value: {
53673
- row_index: 21,
53674
- col_index: 3,
53675
- b: {
53676
- style: 1,
53677
- color: "rgb(183, 183, 183)"
53678
- }
53679
- }
53680
- },
53681
- {
53682
- rangeType: "cell",
53683
- value: {
53684
- row_index: 21,
53685
- col_index: 4,
53686
- b: {
53687
- style: 1,
53688
- color: "rgb(183, 183, 183)"
53689
- }
53690
- }
53691
- },
53692
- {
53693
- rangeType: "cell",
53694
- value: {
53695
- row_index: 21,
53696
- col_index: 5,
53697
- b: {
53698
- style: 1,
53699
- color: "rgb(183, 183, 183)"
53700
- }
53701
- }
53702
- }
53703
- ]
53704
- },
53705
- pivotTable: null,
53706
- isPivotTable: !1,
53707
- zoomRatio: 1,
53708
- luckysheet_select_save: [
53709
- {
53710
- left: 606,
53711
- width: 100,
53712
- top: 299,
53713
- height: 21,
53714
- left_move: 606,
53715
- width_move: 100,
53716
- top_move: 299,
53717
- height_move: 21,
53718
- row: [
53719
- 11,
53720
- 11
53721
- ],
53722
- column: [
53723
- 6,
53724
- 6
53725
- ],
53726
- row_focus: 11,
53727
- column_focus: 6
53728
- }
53729
- ],
53730
- luckysheet_selection_range: [],
53731
- calcChain: [
53732
- {
53733
- r: 17,
53734
- c: 5,
53735
- id: "8f3c4e10-df59-411d-bfe8-807994899b89"
53736
- },
53737
- {
53738
- r: 18,
53739
- c: 5,
53740
- id: "8f3c4e10-df59-411d-bfe8-807994899b89"
53741
- },
53742
- {
53743
- r: 22,
53744
- c: 5,
53745
- id: "8f3c4e10-df59-411d-bfe8-807994899b89"
53746
- },
53747
- {
53748
- r: 24,
53749
- c: 4,
53750
- id: "8f3c4e10-df59-411d-bfe8-807994899b89"
53751
- }
53752
- ],
53753
- celldata: []
53754
53424
  }
53755
53425
  ], e = [
53756
53426
  {
@@ -1,10 +1,10 @@
1
1
  import * as BZ from "yjs";
2
- import { i as Yl, a as ul, s as eZ, r as hl, y as Il, b as pl, m as Rl } from "./index-C-29uy7d.js";
2
+ import { i as Yl, a as ul, s as eZ, r as hl, y as Il, b as pl, m as Rl } from "./index-DgOrT4Bq.js";
3
3
  import { g as sl } from "./executeStringFunction-adhsb5GH.js";
4
4
  import { Workbook as al } from "exceljs";
5
5
  import Kl from "luckyexcel";
6
- import { e as Jl, b as xl, n as Ml } from "./xlsx-hyperlink-inline-iNImgoxT.js";
7
- import { parseDefinedNamesFromXlsxBuffer as Sl, excelEntriesToDefinedNames as OZ } from "./xlsx-defined-names-Cz6m4fA3.js";
6
+ import { e as Jl, b as xl, n as Ml } from "./xlsx-hyperlink-inline-C9nJfbRm.js";
7
+ import { parseDefinedNamesFromXlsxBuffer as Sl, excelEntriesToDefinedNames as OZ } from "./xlsx-defined-names-CnACRdTA.js";
8
8
  import { toast as fZ } from "@fileverse/ui";
9
9
  var Zl = { exports: {} };
10
10
  (function(c) {
@@ -1,5 +1,5 @@
1
1
  import { i as w } from "./executeStringFunction-adhsb5GH.js";
2
- import { J as x } from "./xlsx-hyperlink-inline-iNImgoxT.js";
2
+ import { J as x } from "./xlsx-hyperlink-inline-C9nJfbRm.js";
3
3
  function g(o) {
4
4
  return o.startsWith("_xlnm.");
5
5
  }
@@ -1,9 +1,9 @@
1
1
  import { utils as F, write as it } from "xlsx-js-style";
2
2
  import { Workbook as ct } from "exceljs";
3
3
  import { toast as nt } from "@fileverse/ui";
4
- import { J as ft, c as X, g as ut, a as pt } from "./xlsx-hyperlink-inline-iNImgoxT.js";
4
+ import { J as ft, c as X, g as ut, a as pt } from "./xlsx-hyperlink-inline-C9nJfbRm.js";
5
5
  import { b as dt } from "./executeStringFunction-adhsb5GH.js";
6
- import { e as ht } from "./index-C-29uy7d.js";
6
+ import { e as ht } from "./index-DgOrT4Bq.js";
7
7
  const mt = {
8
8
  1: "thin",
9
9
  2: "hair",
@@ -810,7 +810,7 @@ const Y = (e) => {
810
810
  D
811
811
  );
812
812
  });
813
- const { applyDefinedNamesToExcelWorkbook: ot } = await import("./xlsx-defined-names-Cz6m4fA3.js");
813
+ const { applyDefinedNamesToExcelWorkbook: ot } = await import("./xlsx-defined-names-CnACRdTA.js");
814
814
  ot(
815
815
  j,
816
816
  (T = (a = (d = e.current).getWorkbookContext) == null ? void 0 : a.call(d)) == null ? void 0 : T.definedNames,
@@ -1,5 +1,5 @@
1
1
  import { g as Rt, c as yt } from "./executeStringFunction-adhsb5GH.js";
2
- import { c as wt } from "./index-C-29uy7d.js";
2
+ import { c as wt } from "./index-DgOrT4Bq.js";
3
3
  function jt(J, nt) {
4
4
  const g = J.getImages();
5
5
  if (!g.length) return [];
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.1.3",
5
+ "version": "4.1.5",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {
@@ -58,7 +58,7 @@
58
58
  ]
59
59
  },
60
60
  "dependencies": {
61
- "@fileverse-dev/dsheets-templates": "^0.0.33",
61
+ "@fileverse-dev/dsheets-templates": "0.0.34",
62
62
  "@fileverse-dev/formulajs": "4.4.55",
63
63
  "@fileverse/crypto": "^0.0.22",
64
64
  "@fileverse/ens": "^0.0.4",
@@ -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;