@fileverse-dev/dsheet 2.1.5 → 3.0.1-formula-1

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 (132) hide show
  1. package/dist/{constants-yStXQJiK.js → constants-Cdz6oSCq.js} +5 -7
  2. package/dist/constants.js +1 -1
  3. package/dist/editor/components/api-key-modal/api-key-input.d.ts +5 -0
  4. package/dist/editor/components/api-key-modal/api-key-modal.d.ts +7 -0
  5. package/dist/editor/components/api-key-modal/rate-limit-info.d.ts +4 -0
  6. package/dist/editor/components/comments/comment-actions-dropdown.d.ts +19 -0
  7. package/dist/editor/components/comments/comment-cell-popup.d.ts +4 -0
  8. package/dist/editor/components/comments/comment-input.d.ts +4 -0
  9. package/dist/editor/components/comments/comment-item.d.ts +4 -0
  10. package/dist/editor/components/comments/comment-sidebar-empty.d.ts +4 -0
  11. package/dist/editor/components/comments/comment-sidebar.d.ts +4 -0
  12. package/dist/editor/components/comments/ens/ens-cache.d.ts +10 -0
  13. package/dist/editor/components/comments/ens/use-ens-status.d.ts +10 -0
  14. package/dist/editor/components/comments/use-comment-cell-popup.d.ts +12 -0
  15. package/dist/editor/components/comments/use-comment-permissions.d.ts +15 -0
  16. package/dist/editor/components/editor-workbook-sync.d.ts +1 -1
  17. package/dist/editor/components/editor-workbook.d.ts +11 -17
  18. package/dist/editor/components/sidebar/editor-right-sidebar.d.ts +20 -0
  19. package/dist/editor/components/sidebar/right-sidebar.d.ts +14 -0
  20. package/dist/editor/components/sidebar/sidebar-context.d.ts +17 -0
  21. package/dist/editor/components/sidebar/sidebar-portal-registry.d.ts +20 -0
  22. package/dist/editor/components/sidebar/use-right-panels.d.ts +12 -0
  23. package/dist/editor/components/sidebars/conditional-format.d.ts +2 -0
  24. package/dist/editor/components/sidebars/data-verification.d.ts +2 -0
  25. package/dist/editor/components/sidebars/function/function-categories-logic.d.ts +11 -0
  26. package/dist/editor/components/sidebars/function/function-categories.d.ts +6 -0
  27. package/dist/editor/components/sidebars/function/function-metadata.d.ts +7 -0
  28. package/dist/editor/components/sidebars/function/functionList.d.ts +8 -0
  29. package/dist/editor/components/sidebars/function/types.d.ts +24 -0
  30. package/dist/editor/components/sidebars/function/use-functions.d.ts +20 -0
  31. package/dist/editor/components/sidebars/function-content.d.ts +8 -0
  32. package/dist/editor/components/sidebars/named-ranges.d.ts +2 -0
  33. package/dist/editor/components/sidebars/template-ui.d.ts +22 -0
  34. package/dist/editor/components/sidebars/templates.d.ts +9 -0
  35. package/dist/editor/components/smart-contract/error-toast.d.ts +11 -0
  36. package/dist/editor/components/smart-contract/modal/abi-input-section.d.ts +11 -0
  37. package/dist/editor/components/smart-contract/modal/contract-name-section.d.ts +13 -0
  38. package/dist/editor/components/smart-contract/modal/file-upload-section.d.ts +12 -0
  39. package/dist/editor/components/smart-contract/modal/import-section.d.ts +8 -0
  40. package/dist/editor/components/smart-contract/modal/modal-header.d.ts +17 -0
  41. package/dist/editor/components/smart-contract/smart-contract-list-item.d.ts +8 -0
  42. package/dist/editor/components/smart-contract/smart-contract-modal-ui.d.ts +33 -0
  43. package/dist/editor/components/smart-contract/smart-contract-modal.d.ts +12 -0
  44. package/dist/editor/components/smart-contract/smart-contract-reading-intro.d.ts +4 -0
  45. package/dist/editor/components/smart-contract/smart-contract-view-list.d.ts +6 -0
  46. package/dist/editor/components/smart-contract/use-address-validation.d.ts +5 -0
  47. package/dist/editor/components/smart-contract/use-modal-outside-click.d.ts +18 -0
  48. package/dist/editor/components/smart-contract/use-smart-contract-modal.d.ts +38 -0
  49. package/dist/editor/constants/shared-constants.d.ts +0 -2
  50. package/dist/editor/contexts/editor-context.d.ts +20 -5
  51. package/dist/editor/dsheet-editor.d.ts +1 -1
  52. package/dist/editor/hooks/live-query/use-live-query.d.ts +4 -2
  53. package/dist/editor/hooks/use-celldata-compaction.d.ts +23 -0
  54. package/dist/editor/hooks/use-editor-data.d.ts +4 -2
  55. package/dist/editor/hooks/use-smart-contract.d.ts +26 -0
  56. package/dist/editor/hooks/use-xlsx-import-impl.d.ts +8 -1
  57. package/dist/editor/hooks/use-xlsx-import.d.ts +2 -1
  58. package/dist/editor/types/comments.d.ts +134 -0
  59. package/dist/editor/types/smart-contract.d.ts +88 -0
  60. package/dist/editor/types.d.ts +39 -32
  61. package/dist/editor/utils/after-update-cell.d.ts +13 -8
  62. package/dist/editor/utils/api-key-storage.d.ts +6 -0
  63. package/dist/editor/utils/api-keys-local-storage.d.ts +19 -0
  64. package/dist/editor/utils/cell-comment-marker.d.ts +30 -0
  65. package/dist/editor/utils/comment-key-utils.d.ts +7 -0
  66. package/dist/editor/utils/compact-committed-celldata.d.ts +28 -0
  67. package/dist/editor/utils/config-ydoc-update.d.ts +20 -0
  68. package/dist/editor/utils/csv-import.d.ts +3 -1
  69. package/dist/editor/utils/data-block-error-handler.d.ts +21 -0
  70. package/dist/editor/utils/datablock-error-utils.d.ts +1 -0
  71. package/dist/editor/utils/defined-names-ydoc.d.ts +31 -0
  72. package/dist/editor/utils/sheet-editor-safe.d.ts +26 -0
  73. package/dist/editor/utils/smart-contract/constants.d.ts +488 -0
  74. package/dist/editor/utils/smart-contract/error-helper.d.ts +20 -0
  75. package/dist/editor/utils/smart-contract/helpers.d.ts +4 -0
  76. package/dist/editor/utils/smart-contract/reading-utils.d.ts +34 -0
  77. package/dist/editor/utils/smart-contract/signature-utils.d.ts +9 -0
  78. package/dist/editor/utils/spreadsheet-import.d.ts +12 -0
  79. package/dist/editor/utils/update-ydoc.d.ts +2 -2
  80. package/dist/editor/utils/xlsx-defined-names.d.ts +41 -0
  81. package/dist/executeStringFunction-DMPoSj5F.js +32826 -0
  82. package/dist/formula.js +1 -1
  83. package/dist/index-DAVuAF9T.js +55303 -0
  84. package/dist/index.d.ts +11 -1
  85. package/dist/index.es.js +55 -49
  86. package/dist/jszip.min-CEyB-71x.js +2319 -0
  87. package/dist/sheet-engine/core/api/cell.d.ts +0 -20
  88. package/dist/sheet-engine/core/api/common.d.ts +2 -1
  89. package/dist/sheet-engine/core/api/index.d.ts +1 -0
  90. package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.d.ts +17 -0
  91. package/dist/sheet-engine/core/api/sheet.d.ts +5 -0
  92. package/dist/sheet-engine/core/context.d.ts +8 -1
  93. package/dist/sheet-engine/core/index.d.ts +2 -2
  94. package/dist/sheet-engine/core/modules/formula-async-eval.d.ts +53 -0
  95. package/dist/sheet-engine/core/modules/formula-eval.worker.d.ts +1 -0
  96. package/dist/sheet-engine/core/modules/formula-range-cache.d.ts +20 -0
  97. package/dist/sheet-engine/core/modules/formula-snapshot-eval.d.ts +51 -0
  98. package/dist/sheet-engine/core/modules/formula-transitive-deps.d.ts +7 -0
  99. package/dist/sheet-engine/core/modules/formula-worker-bridge.d.ts +17 -0
  100. package/dist/sheet-engine/core/modules/formula-worker-types.d.ts +24 -0
  101. package/dist/sheet-engine/core/modules/formula.d.ts +53 -1
  102. package/dist/sheet-engine/core/modules/index.d.ts +5 -2
  103. package/dist/sheet-engine/core/modules/namedRanges.d.ts +53 -0
  104. package/dist/sheet-engine/core/modules/sheet-metadata-hooks.d.ts +4 -0
  105. package/dist/sheet-engine/core/modules/sheet.d.ts +17 -1
  106. package/dist/sheet-engine/core/paste/paste-border-utils.d.ts +23 -0
  107. package/dist/sheet-engine/core/settings.d.ts +3 -1
  108. package/dist/sheet-engine/core/theme.d.ts +67 -0
  109. package/dist/sheet-engine/core/types.d.ts +20 -0
  110. package/dist/sheet-engine/core/utils/border-config-utils.d.ts +16 -0
  111. package/dist/sheet-engine/core/utils/cell-persist-utils.d.ts +10 -0
  112. package/dist/sheet-engine/core/utils/range-format.d.ts +71 -0
  113. package/dist/sheet-engine/core/utils/ydoc-celldata-changes.d.ts +40 -0
  114. package/dist/sheet-engine/react/components/NamedRanges/index.d.ts +4 -0
  115. package/dist/sheet-engine/react/components/SheetOverlay/Icon.d.ts +5 -4
  116. package/dist/sheet-engine/react/components/SheetOverlay/LucideIcon.d.ts +4 -4
  117. package/dist/sheet-engine/react/components/SidebarPanelPortals/index.d.ts +17 -0
  118. package/dist/sheet-engine/react/components/Workbook/api.d.ts +8 -1
  119. package/dist/sheet-engine/react/components/Workbook/index.d.ts +11 -1
  120. package/dist/sheet-engine/react/components/index.d.ts +1 -0
  121. package/dist/sheet-engine/react/utils/datepickerStyles.d.ts +1 -1
  122. package/dist/style.css +1 -1
  123. package/dist/use-xlsx-import-impl-DzthrhwA.js +1595 -0
  124. package/dist/xlsx-defined-names-D2KoICbm.js +117 -0
  125. package/dist/xlsx-export-impl-b2z4De4f.js +818 -0
  126. package/package.json +6 -4
  127. package/dist/executeStringFunction-BkmJj04p.js +0 -27295
  128. package/dist/index-Drl8OuI3.js +0 -52659
  129. package/dist/sheet-engine/react/components/Toolbar/conditionalFormatPortal.d.ts +0 -7
  130. package/dist/sheet-engine/react/components/Toolbar/dataVerificationPortal.d.ts +0 -6
  131. package/dist/use-xlsx-import-impl-DC_BfAcT.js +0 -1527
  132. package/dist/xlsx-export-impl-DP_eK3zS.js +0 -3126
@@ -0,0 +1,117 @@
1
+ import { i as w } from "./executeStringFunction-DMPoSj5F.js";
2
+ import { J as x } from "./jszip.min-CEyB-71x.js";
3
+ function g(o) {
4
+ return o.startsWith("_xlnm.");
5
+ }
6
+ function S(o) {
7
+ return /[^A-Za-z0-9_]/.test(o) ? `'${o.replace(/'/g, "''")}'` : o;
8
+ }
9
+ function p(o, e) {
10
+ return `$${w(e)}$${o + 1}`;
11
+ }
12
+ function I(o, e) {
13
+ const l = S(o), a = p(e.row[0], e.column[0]), n = p(e.row[1], e.column[1]), r = a === n ? a : `${a}:${n}`;
14
+ return `${l}!${r}`;
15
+ }
16
+ function $(o) {
17
+ const e = String(o || "").trim();
18
+ if (!e) return null;
19
+ let l = "", a = e;
20
+ const n = e.lastIndexOf("!");
21
+ if (n >= 0) {
22
+ let i = e.slice(0, n);
23
+ a = e.slice(n + 1), i.startsWith("'") && i.endsWith("'") && (i = i.slice(1, -1).replace(/''/g, "'")), l = i;
24
+ }
25
+ const r = a.split(":"), d = (i) => {
26
+ const t = i.trim().replace(/\$/g, "").match(/^([A-Za-z]+)(\d+)$/);
27
+ if (!t) return null;
28
+ const u = t[1].toUpperCase();
29
+ let m = 0;
30
+ for (let f = 0; f < u.length; f += 1)
31
+ m = m * 26 + (u.charCodeAt(f) - 64);
32
+ return { row: parseInt(t[2], 10) - 1, col: m - 1 };
33
+ }, c = d(r[0]);
34
+ if (!c) return null;
35
+ const s = r.length > 1 ? d(r[1]) : c;
36
+ return s ? {
37
+ sheetName: l,
38
+ range: {
39
+ row: [Math.min(c.row, s.row), Math.max(c.row, s.row)],
40
+ column: [Math.min(c.col, s.col), Math.max(c.col, s.col)]
41
+ }
42
+ } : null;
43
+ }
44
+ function b() {
45
+ return `dn_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
46
+ }
47
+ function k(o, e) {
48
+ var r, d, c, s, i;
49
+ const l = new Map(
50
+ e.filter((t) => t.id && t.name).map((t) => [String(t.name), t.id])
51
+ ), a = [], n = /* @__PURE__ */ new Set();
52
+ for (const t of o) {
53
+ if (!(t != null && t.name) || g(t.name) || n.has(t.name.toLowerCase())) continue;
54
+ const u = (r = t.ranges) == null ? void 0 : r[0];
55
+ if (!u) continue;
56
+ const m = $(u);
57
+ if (!m) continue;
58
+ let f = m.sheetName && l.get(m.sheetName) || void 0;
59
+ if (!f && t.localSheetId != null && ((d = e[t.localSheetId]) != null && d.id) && (f = e[t.localSheetId].id), !f && ((c = e[0]) != null && c.id) && (f = e[0].id), !f) continue;
60
+ const h = t.localSheetId != null && ((s = e[t.localSheetId]) != null && s.id) ? "sheet" : "workbook";
61
+ a.push({
62
+ id: b(),
63
+ name: t.name,
64
+ sheetId: f,
65
+ range: m.range,
66
+ scope: h,
67
+ localSheetId: h === "sheet" ? (i = e[t.localSheetId]) == null ? void 0 : i.id : void 0
68
+ }), n.add(t.name.toLowerCase());
69
+ }
70
+ return a;
71
+ }
72
+ function D(o, e, l) {
73
+ if (!(e != null && e.length)) return;
74
+ const a = new Map(
75
+ l.filter((n) => n.id && n.name).map((n) => [n.id, n.name])
76
+ );
77
+ for (const n of e) {
78
+ if (!(n != null && n.name) || g(n.name)) continue;
79
+ const r = a.get(n.sheetId);
80
+ if (r)
81
+ try {
82
+ o.definedNames.add(
83
+ I(r, n.range),
84
+ n.name
85
+ );
86
+ } catch {
87
+ }
88
+ }
89
+ }
90
+ async function A(o) {
91
+ var e;
92
+ try {
93
+ const l = await x.loadAsync(o), a = l.file("xl/workbook.xml") || ((e = l.file(/xl\/workbook\.xml$/i)) == null ? void 0 : e[0]) || null;
94
+ if (!a) return [];
95
+ const n = await a.async("text"), r = [], d = /<definedName\b([^>]*)>([\s\S]*?)<\/definedName>/gi;
96
+ let c = d.exec(n);
97
+ for (; c; ) {
98
+ const s = c[1] || "", i = (c[2] || "").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').trim(), t = s.match(/\bname="([^"]+)"/i), u = s.match(/\blocalSheetId="(\d+)"/i), m = t == null ? void 0 : t[1];
99
+ m && i && r.push({
100
+ name: m,
101
+ ranges: [i],
102
+ localSheetId: u ? parseInt(u[1], 10) : void 0
103
+ }), c = d.exec(n);
104
+ }
105
+ return r;
106
+ } catch {
107
+ return [];
108
+ }
109
+ }
110
+ export {
111
+ D as applyDefinedNamesToExcelWorkbook,
112
+ I as encodeDefinedNameExcelRef,
113
+ k as excelEntriesToDefinedNames,
114
+ g as isExcelSystemDefinedName,
115
+ A as parseDefinedNamesFromXlsxBuffer,
116
+ $ as parseExcelDefinedNameRef
117
+ };