@dxos/plugin-sheet 0.8.4-main.1da679c → 0.8.4-main.21d9917

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 (245) hide show
  1. package/dist/lib/browser/SheetContainer-ESCXPI7Y.mjs +397 -0
  2. package/dist/lib/browser/SheetContainer-ESCXPI7Y.mjs.map +7 -0
  3. package/dist/lib/browser/anchor-sort-JBRMW6OY.mjs +23 -0
  4. package/dist/lib/browser/anchor-sort-JBRMW6OY.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-2SAGT3BB.mjs +397 -0
  6. package/dist/lib/browser/chunk-2SAGT3BB.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-SSN4HYJL.mjs → chunk-IFLWVS2V.mjs} +9 -9
  8. package/dist/lib/browser/chunk-IFLWVS2V.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-W6N44ONZ.mjs +1470 -0
  10. package/dist/lib/browser/chunk-W6N44ONZ.mjs.map +7 -0
  11. package/dist/lib/browser/compute-graph-registry-DL2PX7TF.mjs +21 -0
  12. package/dist/lib/browser/compute-graph-registry-DL2PX7TF.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +71 -82
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/markdown-BC4KBDUO.mjs +29 -0
  16. package/dist/lib/browser/markdown-BC4KBDUO.mjs.map +7 -0
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/operation-resolver-FJ4UWZUM.mjs +79 -0
  19. package/dist/lib/browser/operation-resolver-FJ4UWZUM.mjs.map +7 -0
  20. package/dist/lib/browser/react-surface-5BXM6TJ3.mjs +51 -0
  21. package/dist/lib/browser/react-surface-5BXM6TJ3.mjs.map +7 -0
  22. package/dist/lib/browser/types/index.mjs +7 -12
  23. package/dist/lib/node-esm/SheetContainer-YVIDJKP4.mjs +398 -0
  24. package/dist/lib/node-esm/SheetContainer-YVIDJKP4.mjs.map +7 -0
  25. package/dist/lib/node-esm/anchor-sort-C3XFPI6S.mjs +24 -0
  26. package/dist/lib/node-esm/anchor-sort-C3XFPI6S.mjs.map +7 -0
  27. package/dist/lib/node-esm/chunk-IMWGSIDG.mjs +398 -0
  28. package/dist/lib/node-esm/chunk-IMWGSIDG.mjs.map +7 -0
  29. package/dist/lib/node-esm/{chunk-IK4O7FUJ.mjs → chunk-PPOYR7DK.mjs} +9 -9
  30. package/dist/lib/node-esm/chunk-PPOYR7DK.mjs.map +7 -0
  31. package/dist/lib/node-esm/chunk-S7RYX7DG.mjs +1471 -0
  32. package/dist/lib/node-esm/chunk-S7RYX7DG.mjs.map +7 -0
  33. package/dist/lib/node-esm/compute-graph-registry-VXH55GDI.mjs +22 -0
  34. package/dist/lib/node-esm/compute-graph-registry-VXH55GDI.mjs.map +7 -0
  35. package/dist/lib/node-esm/index.mjs +71 -82
  36. package/dist/lib/node-esm/index.mjs.map +4 -4
  37. package/dist/lib/node-esm/markdown-6DGZCJRM.mjs +30 -0
  38. package/dist/lib/node-esm/markdown-6DGZCJRM.mjs.map +7 -0
  39. package/dist/lib/node-esm/meta.json +1 -1
  40. package/dist/lib/node-esm/operation-resolver-OGXEUWHA.mjs +80 -0
  41. package/dist/lib/node-esm/operation-resolver-OGXEUWHA.mjs.map +7 -0
  42. package/dist/lib/node-esm/react-surface-RLHC6B77.mjs +52 -0
  43. package/dist/lib/node-esm/react-surface-RLHC6B77.mjs.map +7 -0
  44. package/dist/lib/node-esm/types/index.mjs +7 -12
  45. package/dist/types/src/SheetPlugin.d.ts +2 -1
  46. package/dist/types/src/SheetPlugin.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts +5 -0
  48. package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/anchor-sort/index.d.ts +3 -0
  50. package/dist/types/src/capabilities/anchor-sort/index.d.ts.map +1 -0
  51. package/dist/types/src/capabilities/compute-graph-registry/compute-graph-registry.d.ts +5 -0
  52. package/dist/types/src/capabilities/compute-graph-registry/compute-graph-registry.d.ts.map +1 -0
  53. package/dist/types/src/capabilities/compute-graph-registry/index.d.ts +3 -0
  54. package/dist/types/src/capabilities/compute-graph-registry/index.d.ts.map +1 -0
  55. package/dist/types/src/capabilities/index.d.ts +5 -9
  56. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
  58. package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
  59. package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
  60. package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
  61. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  62. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  63. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  64. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  65. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  66. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  67. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  68. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  69. package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts +0 -1
  70. package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
  71. package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -1
  72. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +4 -3
  73. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -1
  74. package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts +2 -3
  75. package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +1 -1
  76. package/dist/types/src/components/GridSheet/util.d.ts.map +1 -1
  77. package/dist/types/src/components/RangeList/RangeList.d.ts +2 -2
  78. package/dist/types/src/components/RangeList/RangeList.d.ts.map +1 -1
  79. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +5 -6
  80. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +1 -1
  81. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +8 -6
  82. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -1
  83. package/dist/types/src/components/SheetContext/SheetContext.d.ts +2 -2
  84. package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +1 -1
  85. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts +3 -4
  86. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
  87. package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts +3 -2
  88. package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
  89. package/dist/types/src/components/SheetToolbar/align.d.ts +12 -19
  90. package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
  91. package/dist/types/src/components/SheetToolbar/style.d.ts +12 -18
  92. package/dist/types/src/components/SheetToolbar/style.d.ts.map +1 -1
  93. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts +14 -1
  94. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts.map +1 -1
  95. package/dist/types/src/components/index.d.ts +1 -1
  96. package/dist/types/src/components/index.d.ts.map +1 -1
  97. package/dist/types/src/extensions/compute.stories.d.ts +2 -3
  98. package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
  99. package/dist/types/src/extensions/editor/sheet-extension.d.ts.map +1 -1
  100. package/dist/types/src/index.d.ts +1 -1
  101. package/dist/types/src/index.d.ts.map +1 -1
  102. package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
  103. package/dist/types/src/meta.d.ts +2 -3
  104. package/dist/types/src/meta.d.ts.map +1 -1
  105. package/dist/types/src/model/sheet-model.d.ts +6 -6
  106. package/dist/types/src/model/sheet-model.d.ts.map +1 -1
  107. package/dist/types/src/model/testing.d.ts +2 -2
  108. package/dist/types/src/model/testing.d.ts.map +1 -1
  109. package/dist/types/src/model/useSheetModel.d.ts +2 -2
  110. package/dist/types/src/model/useSheetModel.d.ts.map +1 -1
  111. package/dist/types/src/serializer.d.ts +2 -2
  112. package/dist/types/src/serializer.d.ts.map +1 -1
  113. package/dist/types/src/testing/data.d.ts +2 -2
  114. package/dist/types/src/testing/data.d.ts.map +1 -1
  115. package/dist/types/src/testing/testing.d.ts +27 -3
  116. package/dist/types/src/testing/testing.d.ts.map +1 -1
  117. package/dist/types/src/translations.d.ts +3 -2
  118. package/dist/types/src/translations.d.ts.map +1 -1
  119. package/dist/types/src/types/Sheet.d.ts +76 -0
  120. package/dist/types/src/types/Sheet.d.ts.map +1 -0
  121. package/dist/types/src/types/capabilities.d.ts +6 -0
  122. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  123. package/dist/types/src/types/index.d.ts +2 -1
  124. package/dist/types/src/types/index.d.ts.map +1 -1
  125. package/dist/types/src/types/sheet-range-types.d.ts +2 -2
  126. package/dist/types/src/types/sheet-range-types.d.ts.map +1 -1
  127. package/dist/types/src/types/types.d.ts +92 -75
  128. package/dist/types/src/types/types.d.ts.map +1 -1
  129. package/dist/types/src/types/util.d.ts +9 -10
  130. package/dist/types/src/types/util.d.ts.map +1 -1
  131. package/dist/types/tsconfig.tsbuildinfo +1 -1
  132. package/package.json +79 -72
  133. package/src/SheetPlugin.tsx +51 -64
  134. package/src/capabilities/anchor-sort/anchor-sort.ts +26 -0
  135. package/src/capabilities/anchor-sort/index.ts +7 -0
  136. package/src/capabilities/compute-graph-registry/compute-graph-registry.ts +27 -0
  137. package/src/capabilities/compute-graph-registry/index.ts +7 -0
  138. package/src/capabilities/index.ts +5 -9
  139. package/src/capabilities/markdown/index.ts +7 -0
  140. package/src/capabilities/markdown/markdown.ts +30 -0
  141. package/src/capabilities/operation-resolver/index.ts +7 -0
  142. package/src/capabilities/operation-resolver/operation-resolver.ts +77 -0
  143. package/src/capabilities/react-surface/index.ts +7 -0
  144. package/src/capabilities/react-surface/react-surface.tsx +43 -0
  145. package/src/components/ComputeGraph/compute-graph.stories.tsx +10 -12
  146. package/src/components/FunctionEditor/FunctionEditor.tsx +2 -2
  147. package/src/components/GridSheet/GridSheet.stories.tsx +14 -11
  148. package/src/components/GridSheet/GridSheet.tsx +32 -25
  149. package/src/components/GridSheet/SheetCellEditor.stories.tsx +14 -12
  150. package/src/components/GridSheet/util.ts +11 -5
  151. package/src/components/RangeList/RangeList.tsx +13 -10
  152. package/src/components/SheetContainer/SheetContainer.stories.tsx +68 -47
  153. package/src/components/SheetContainer/SheetContainer.tsx +30 -18
  154. package/src/components/SheetContext/SheetContext.tsx +8 -8
  155. package/src/components/SheetToolbar/SheetToolbar.stories.tsx +9 -6
  156. package/src/components/SheetToolbar/SheetToolbar.tsx +39 -30
  157. package/src/components/SheetToolbar/align.ts +44 -19
  158. package/src/components/SheetToolbar/style.ts +47 -17
  159. package/src/components/SheetToolbar/useToolbarState.ts +22 -5
  160. package/src/extensions/compute.stories.tsx +29 -17
  161. package/src/extensions/compute.ts +1 -1
  162. package/src/extensions/editor/sheet-extension.ts +7 -4
  163. package/src/index.ts +1 -1
  164. package/src/integrations/thread-ranges.ts +40 -49
  165. package/src/meta.ts +9 -7
  166. package/src/model/sheet-model.test.ts +4 -4
  167. package/src/model/sheet-model.ts +78 -48
  168. package/src/model/testing.ts +4 -4
  169. package/src/model/useSheetModel.ts +2 -2
  170. package/src/playwright/playwright.config.ts +1 -1
  171. package/src/playwright/sheet.spec.ts +1 -0
  172. package/src/sanity.test.ts +3 -4
  173. package/src/serializer.ts +4 -4
  174. package/src/testing/data.ts +2 -2
  175. package/src/testing/testing.tsx +11 -5
  176. package/src/translations.ts +3 -2
  177. package/src/types/Sheet.ts +106 -0
  178. package/src/types/capabilities.ts +14 -0
  179. package/src/types/index.ts +2 -1
  180. package/src/types/sheet-range-types.ts +2 -2
  181. package/src/types/types.ts +83 -49
  182. package/src/types/util.ts +10 -38
  183. package/dist/lib/browser/SheetContainer-OUN6AARA.mjs +0 -350
  184. package/dist/lib/browser/SheetContainer-OUN6AARA.mjs.map +0 -7
  185. package/dist/lib/browser/anchor-sort-CAYLDDRF.mjs +0 -24
  186. package/dist/lib/browser/anchor-sort-CAYLDDRF.mjs.map +0 -7
  187. package/dist/lib/browser/chunk-6AKBCBL4.mjs +0 -18
  188. package/dist/lib/browser/chunk-6AKBCBL4.mjs.map +0 -7
  189. package/dist/lib/browser/chunk-KJWZUQVA.mjs +0 -15
  190. package/dist/lib/browser/chunk-KJWZUQVA.mjs.map +0 -7
  191. package/dist/lib/browser/chunk-SSN4HYJL.mjs.map +0 -7
  192. package/dist/lib/browser/chunk-X4EWLDT3.mjs +0 -851
  193. package/dist/lib/browser/chunk-X4EWLDT3.mjs.map +0 -7
  194. package/dist/lib/browser/chunk-XSXUU6FO.mjs +0 -906
  195. package/dist/lib/browser/chunk-XSXUU6FO.mjs.map +0 -7
  196. package/dist/lib/browser/compute-graph-registry-WHF3BJTJ.mjs +0 -30
  197. package/dist/lib/browser/compute-graph-registry-WHF3BJTJ.mjs.map +0 -7
  198. package/dist/lib/browser/intent-resolver-LKZXAJRJ.mjs +0 -56
  199. package/dist/lib/browser/intent-resolver-LKZXAJRJ.mjs.map +0 -7
  200. package/dist/lib/browser/markdown-XKFA4Z2M.mjs +0 -26
  201. package/dist/lib/browser/markdown-XKFA4Z2M.mjs.map +0 -7
  202. package/dist/lib/browser/react-surface-N6NYHHT3.mjs +0 -53
  203. package/dist/lib/browser/react-surface-N6NYHHT3.mjs.map +0 -7
  204. package/dist/lib/node-esm/SheetContainer-NFLLTGNV.mjs +0 -351
  205. package/dist/lib/node-esm/SheetContainer-NFLLTGNV.mjs.map +0 -7
  206. package/dist/lib/node-esm/anchor-sort-4R2ID6GE.mjs +0 -25
  207. package/dist/lib/node-esm/anchor-sort-4R2ID6GE.mjs.map +0 -7
  208. package/dist/lib/node-esm/chunk-3K5VNYOF.mjs +0 -20
  209. package/dist/lib/node-esm/chunk-3K5VNYOF.mjs.map +0 -7
  210. package/dist/lib/node-esm/chunk-6SK5LJ5S.mjs +0 -16
  211. package/dist/lib/node-esm/chunk-6SK5LJ5S.mjs.map +0 -7
  212. package/dist/lib/node-esm/chunk-IK4O7FUJ.mjs.map +0 -7
  213. package/dist/lib/node-esm/chunk-ODP4L4OV.mjs +0 -907
  214. package/dist/lib/node-esm/chunk-ODP4L4OV.mjs.map +0 -7
  215. package/dist/lib/node-esm/chunk-PYF4ZJXN.mjs +0 -852
  216. package/dist/lib/node-esm/chunk-PYF4ZJXN.mjs.map +0 -7
  217. package/dist/lib/node-esm/compute-graph-registry-3IUZXRXJ.mjs +0 -31
  218. package/dist/lib/node-esm/compute-graph-registry-3IUZXRXJ.mjs.map +0 -7
  219. package/dist/lib/node-esm/intent-resolver-JHH6ZVJ4.mjs +0 -57
  220. package/dist/lib/node-esm/intent-resolver-JHH6ZVJ4.mjs.map +0 -7
  221. package/dist/lib/node-esm/markdown-NOKROLCG.mjs +0 -27
  222. package/dist/lib/node-esm/markdown-NOKROLCG.mjs.map +0 -7
  223. package/dist/lib/node-esm/react-surface-TYBS4DOF.mjs +0 -54
  224. package/dist/lib/node-esm/react-surface-TYBS4DOF.mjs.map +0 -7
  225. package/dist/types/src/capabilities/anchor-sort.d.ts +0 -6
  226. package/dist/types/src/capabilities/anchor-sort.d.ts.map +0 -1
  227. package/dist/types/src/capabilities/capabilities.d.ts +0 -5
  228. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  229. package/dist/types/src/capabilities/compute-graph-registry.d.ts +0 -4
  230. package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +0 -1
  231. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  232. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  233. package/dist/types/src/capabilities/markdown.d.ts +0 -4
  234. package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
  235. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  236. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  237. package/dist/types/src/types/schema.d.ts +0 -37
  238. package/dist/types/src/types/schema.d.ts.map +0 -1
  239. package/src/capabilities/anchor-sort.ts +0 -22
  240. package/src/capabilities/capabilities.ts +0 -14
  241. package/src/capabilities/compute-graph-registry.ts +0 -28
  242. package/src/capabilities/intent-resolver.ts +0 -38
  243. package/src/capabilities/markdown.ts +0 -23
  244. package/src/capabilities/react-surface.tsx +0 -40
  245. package/src/types/schema.ts +0 -61
@@ -1,907 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- SHEET_PLUGIN
4
- } from "./chunk-3K5VNYOF.mjs";
5
-
6
- // src/types/schema.ts
7
- import { Schema } from "effect";
8
- import { Type } from "@dxos/echo";
9
- var CellValue = Schema.Struct({
10
- // TODO(burdon): How to store dates (datetime, date, time), percentages, etc.
11
- // Consider import/export; natural access for other plugins. Special handling for currency (precision).
12
- // TODO(burdon): Automerge (long string) or short string or number.
13
- value: Schema.Any
14
- });
15
- var Range = Schema.Struct({
16
- range: Schema.String,
17
- key: Schema.String,
18
- value: Schema.String
19
- });
20
- var RowColumnMeta = Schema.Struct({
21
- size: Schema.optional(Schema.Number)
22
- });
23
- var SheetType = Schema.Struct({
24
- name: Schema.optional(Schema.String),
25
- // Sparse map of cells referenced by index.
26
- cells: Schema.mutable(Schema.Record({
27
- key: Schema.String,
28
- value: Schema.mutable(CellValue)
29
- })),
30
- // Ordered row indices.
31
- rows: Schema.mutable(Schema.Array(Schema.String)),
32
- // Ordered column indices.
33
- columns: Schema.mutable(Schema.Array(Schema.String)),
34
- // Row metadata referenced by index.
35
- rowMeta: Schema.mutable(Schema.Record({
36
- key: Schema.String,
37
- value: Schema.mutable(RowColumnMeta)
38
- })),
39
- // Column metadata referenced by index.
40
- columnMeta: Schema.mutable(Schema.Record({
41
- key: Schema.String,
42
- value: Schema.mutable(RowColumnMeta)
43
- })),
44
- // Cell formatting referenced by indexed range.
45
- ranges: Schema.mutable(Schema.Array(Range))
46
- }).pipe(Type.Obj({
47
- typename: "dxos.org/type/Sheet",
48
- version: "0.1.0"
49
- }));
50
-
51
- // src/types/sheet-range-types.ts
52
- var alignKey = "alignment";
53
- var commentKey = "comment";
54
- var styleKey = "style";
55
- var cellClassNameForRange = ({ key, value }) => {
56
- switch (key) {
57
- case alignKey:
58
- switch (value) {
59
- case "start":
60
- return "text-start";
61
- case "center":
62
- return "text-center";
63
- case "end":
64
- return "text-end";
65
- default:
66
- return void 0;
67
- }
68
- case commentKey:
69
- return "bg-gridComment";
70
- case styleKey:
71
- switch (value) {
72
- case "highlight":
73
- return "!bg-gridHighlight";
74
- case "softwrap":
75
- return "!whitespace-normal";
76
- default:
77
- return void 0;
78
- }
79
- default:
80
- return void 0;
81
- }
82
- };
83
-
84
- // src/types/types.ts
85
- import { Schema as Schema2 } from "effect";
86
-
87
- // src/model/sheet-model.ts
88
- import { Event } from "@dxos/async";
89
- import { DetailedCellError, ExportedCellChange, addressFromA1Notation, addressToA1Notation, createSheetName, isFormula } from "@dxos/compute";
90
- import { Resource } from "@dxos/context";
91
- import { Obj } from "@dxos/echo";
92
- import { FormatEnum, TypeEnum } from "@dxos/echo-schema";
93
- import { invariant } from "@dxos/invariant";
94
- import { PublicKey } from "@dxos/keys";
95
- import { log } from "@dxos/log";
96
- function _define_property(obj, key, value) {
97
- if (key in obj) {
98
- Object.defineProperty(obj, key, {
99
- value,
100
- enumerable: true,
101
- configurable: true,
102
- writable: true
103
- });
104
- } else {
105
- obj[key] = value;
106
- }
107
- return obj;
108
- }
109
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-sheet/src/model/sheet-model.ts";
110
- var typeMap = {
111
- BOOLEAN: {
112
- type: TypeEnum.Boolean
113
- },
114
- NUMBER_RAW: {
115
- type: TypeEnum.Number
116
- },
117
- NUMBER_PERCENT: {
118
- type: TypeEnum.Number,
119
- format: FormatEnum.Percent
120
- },
121
- NUMBER_CURRENCY: {
122
- type: TypeEnum.Number,
123
- format: FormatEnum.Currency
124
- },
125
- NUMBER_DATETIME: {
126
- type: TypeEnum.String,
127
- format: FormatEnum.DateTime
128
- },
129
- NUMBER_DATE: {
130
- type: TypeEnum.String,
131
- format: FormatEnum.Date
132
- },
133
- NUMBER_TIME: {
134
- type: TypeEnum.String,
135
- format: FormatEnum.Time
136
- }
137
- };
138
- var getTopLeft = (range) => {
139
- const to = range.to ?? range.from;
140
- return {
141
- row: Math.min(range.from.row, to.row),
142
- col: Math.min(range.from.col, to.col)
143
- };
144
- };
145
- var toSimpleCellAddress = (sheet, cell) => ({
146
- sheet,
147
- row: cell.row,
148
- col: cell.col
149
- });
150
- var toModelRange = (sheet, range) => ({
151
- start: toSimpleCellAddress(sheet, range.from),
152
- end: toSimpleCellAddress(sheet, range.to ?? range.from)
153
- });
154
- var SheetModel = class extends Resource {
155
- get graph() {
156
- return this._graph;
157
- }
158
- get sheet() {
159
- return this._sheet;
160
- }
161
- get readonly() {
162
- return this._options.readonly;
163
- }
164
- get bounds() {
165
- return {
166
- rows: this._sheet.rows.length,
167
- columns: this._sheet.columns.length
168
- };
169
- }
170
- /**
171
- * Initialize sheet and engine.
172
- */
173
- async _open() {
174
- log("initialize", {
175
- id: this.id
176
- }, {
177
- F: __dxlog_file,
178
- L: 124,
179
- S: this,
180
- C: (f, a) => f(...a)
181
- });
182
- initialize(this._sheet);
183
- this._graph.update.on((event) => {
184
- if (event.type === "functionsUpdated") {
185
- this.reset();
186
- }
187
- });
188
- this._node = this._graph.getOrCreateNode(createSheetName({
189
- type: Obj.getTypename(this._sheet),
190
- id: this._sheet.id
191
- }));
192
- await this._node.open();
193
- const unsubscribe = this._node.update.on((event) => this.update.emit(event));
194
- this._ctx.onDispose(unsubscribe);
195
- this.reset();
196
- }
197
- /**
198
- * Update engine.
199
- * NOTE: This resets the undo history.
200
- * @deprecated
201
- */
202
- reset() {
203
- invariant(this._node, void 0, {
204
- F: __dxlog_file,
205
- L: 152,
206
- S: this,
207
- A: [
208
- "this._node",
209
- ""
210
- ]
211
- });
212
- this._node.graph.hf.clearSheet(this._node.sheetId);
213
- Object.entries(this._sheet.cells).forEach(([key, { value }]) => {
214
- invariant(this._node, void 0, {
215
- F: __dxlog_file,
216
- L: 155,
217
- S: this,
218
- A: [
219
- "this._node",
220
- ""
221
- ]
222
- });
223
- const { col, row } = addressFromIndex(this._sheet, key);
224
- if (isFormula(value)) {
225
- const binding = this._graph.mapFunctionBindingFromId(mapFormulaIndicesToRefs(this._sheet, value));
226
- if (binding) {
227
- value = this._graph.mapFormulaToNative(binding);
228
- } else {
229
- value = "";
230
- }
231
- }
232
- this._node.graph.hf.setCellContents({
233
- sheet: this._node.sheetId,
234
- row,
235
- col
236
- }, value);
237
- });
238
- }
239
- /**
240
- * Recalculate formulas.
241
- * NOTE: This resets the undo history.
242
- * https://hyperformula.handsontable.com/guide/volatile-functions.html#volatile-actions
243
- * @deprecated
244
- */
245
- // TODO(burdon): Remove.
246
- recalculate() {
247
- this._node?.graph.hf.rebuildAndRecalculate();
248
- }
249
- insertRows(i, n = 1) {
250
- const idx = insertIndices(this._sheet.rows, i, n, MAX_ROWS);
251
- this.reset();
252
- return idx;
253
- }
254
- insertColumns(i, n = 1) {
255
- const idx = insertIndices(this._sheet.columns, i, n, MAX_COLS);
256
- this.reset();
257
- return idx;
258
- }
259
- dropRow(rowIndex) {
260
- const range = {
261
- from: addressFromIndex(this._sheet, `${this._sheet.columns[0]}@${rowIndex}`),
262
- to: addressFromIndex(this._sheet, `${this._sheet.columns[this._sheet.columns.length - 1]}@${rowIndex}`)
263
- };
264
- const values = this.getCellValues(range).flat();
265
- const index = this._sheet.rows.indexOf(rowIndex);
266
- this.clear(range);
267
- this._sheet.rows.splice(index, 1);
268
- delete this._sheet.rowMeta[rowIndex];
269
- this.reset();
270
- return {
271
- axis: "row",
272
- index,
273
- axisIndex: rowIndex,
274
- axisMeta: this._sheet.rowMeta[rowIndex],
275
- values
276
- };
277
- }
278
- dropColumn(colIndex) {
279
- const range = {
280
- from: addressFromIndex(this._sheet, `${colIndex}@${this._sheet.rows[0]}`),
281
- to: addressFromIndex(this._sheet, `${colIndex}@${this._sheet.rows[this._sheet.rows.length - 1]}`)
282
- };
283
- const values = this.getCellValues(range).flat();
284
- const index = this._sheet.columns.indexOf(colIndex);
285
- this.clear(range);
286
- this._sheet.columns.splice(index, 1);
287
- delete this._sheet.columnMeta[colIndex];
288
- this.reset();
289
- return {
290
- axis: "col",
291
- index,
292
- axisIndex: colIndex,
293
- axisMeta: this._sheet.rowMeta[colIndex],
294
- values
295
- };
296
- }
297
- restoreRow({ index, axisIndex, axisMeta, values }) {
298
- this._sheet.rows.splice(index, 0, axisIndex);
299
- values.forEach((value, col) => {
300
- if (value) {
301
- this._sheet.cells[`${this._sheet.columns[col]}@${axisIndex}`] = {
302
- value
303
- };
304
- }
305
- });
306
- if (axisMeta) {
307
- this._sheet.rowMeta[axisIndex] = axisMeta;
308
- }
309
- this.reset();
310
- }
311
- restoreColumn({ index, axisIndex, axisMeta, values }) {
312
- this._sheet.columns.splice(index, 0, axisIndex);
313
- values.forEach((value, row) => {
314
- if (value) {
315
- this._sheet.cells[`${axisIndex}@${this._sheet.rows[row]}`] = {
316
- value
317
- };
318
- }
319
- });
320
- if (axisMeta) {
321
- this._sheet.columnMeta[axisIndex] = axisMeta;
322
- }
323
- this.reset();
324
- }
325
- //
326
- // Undoable actions.
327
- // TODO(burdon): Group undoable methods; consistently update hf/sheet.
328
- //
329
- /**
330
- * Clear range of values.
331
- */
332
- clear(range) {
333
- invariant(this._node, void 0, {
334
- F: __dxlog_file,
335
- L: 258,
336
- S: this,
337
- A: [
338
- "this._node",
339
- ""
340
- ]
341
- });
342
- const topLeft = getTopLeft(range);
343
- const values = this._iterRange(range, () => null);
344
- this._node.graph.hf.setCellContents(toSimpleCellAddress(this._node.sheetId, topLeft), values);
345
- this._iterRange(range, (cell) => {
346
- const idx = addressToIndex(this._sheet, cell);
347
- delete this._sheet.cells[idx];
348
- });
349
- }
350
- cut(range) {
351
- invariant(this._node, void 0, {
352
- F: __dxlog_file,
353
- L: 269,
354
- S: this,
355
- A: [
356
- "this._node",
357
- ""
358
- ]
359
- });
360
- this._node.graph.hf.cut(toModelRange(this._node.sheetId, range));
361
- this._iterRange(range, (cell) => {
362
- const idx = addressToIndex(this._sheet, cell);
363
- delete this._sheet.cells[idx];
364
- });
365
- }
366
- copy(range) {
367
- invariant(this._node, void 0, {
368
- F: __dxlog_file,
369
- L: 278,
370
- S: this,
371
- A: [
372
- "this._node",
373
- ""
374
- ]
375
- });
376
- this._node.graph.hf.copy(toModelRange(this._node.sheetId, range));
377
- }
378
- paste(cell) {
379
- invariant(this._node, void 0, {
380
- F: __dxlog_file,
381
- L: 283,
382
- S: this,
383
- A: [
384
- "this._node",
385
- ""
386
- ]
387
- });
388
- if (!this._node.graph.hf.isClipboardEmpty()) {
389
- const changes = this._node.graph.hf.paste(toSimpleCellAddress(this._node.sheetId, cell));
390
- for (const change of changes) {
391
- if (change instanceof ExportedCellChange) {
392
- const { address, newValue } = change;
393
- const idx = addressToIndex(this._sheet, {
394
- row: address.row,
395
- col: address.col
396
- });
397
- this._sheet.cells[idx] = {
398
- value: newValue
399
- };
400
- }
401
- }
402
- }
403
- }
404
- // TODO(burdon): Display undo/redo state.
405
- undo() {
406
- invariant(this._node, void 0, {
407
- F: __dxlog_file,
408
- L: 298,
409
- S: this,
410
- A: [
411
- "this._node",
412
- ""
413
- ]
414
- });
415
- if (this._node.graph.hf.isThereSomethingToUndo()) {
416
- this._node.graph.hf.undo();
417
- }
418
- }
419
- redo() {
420
- invariant(this._node, void 0, {
421
- F: __dxlog_file,
422
- L: 306,
423
- S: this,
424
- A: [
425
- "this._node",
426
- ""
427
- ]
428
- });
429
- if (this._node.graph.hf.isThereSomethingToRedo()) {
430
- this._node.graph.hf.redo();
431
- }
432
- }
433
- /**
434
- * Get value from sheet.
435
- */
436
- getCellValue(cell) {
437
- const idx = addressToIndex(this._sheet, cell);
438
- return this._sheet.cells[idx]?.value ?? null;
439
- }
440
- /**
441
- * Get value as a string for editing.
442
- */
443
- getCellText(cell) {
444
- const value = this.getCellValue(cell);
445
- if (value == null) {
446
- return void 0;
447
- }
448
- if (isFormula(value)) {
449
- return this._graph.mapFunctionBindingFromId(mapFormulaIndicesToRefs(this._sheet, value));
450
- } else {
451
- return String(value);
452
- }
453
- }
454
- /**
455
- * Get array of raw values from sheet.
456
- */
457
- getCellValues(range) {
458
- return this._iterRange(range, (cell) => this.getCellValue(cell));
459
- }
460
- /**
461
- * Gets the regular or computed value from the engine.
462
- */
463
- getValue(cell) {
464
- invariant(this._node, void 0, {
465
- F: __dxlog_file,
466
- L: 349,
467
- S: this,
468
- A: [
469
- "this._node",
470
- ""
471
- ]
472
- });
473
- const address = toSimpleCellAddress(this._node.sheetId, cell);
474
- const value = this._node.graph.hf.getCellValue(address);
475
- if (value instanceof DetailedCellError) {
476
- log.warn("cell error", {
477
- cell,
478
- error: value
479
- }, {
480
- F: __dxlog_file,
481
- L: 354,
482
- S: this,
483
- C: (f, a) => f(...a)
484
- });
485
- return value.toString();
486
- }
487
- return value;
488
- }
489
- /**
490
- * Get value type.
491
- */
492
- getValueDescription(cell) {
493
- invariant(this._node, void 0, {
494
- F: __dxlog_file,
495
- L: 365,
496
- S: this,
497
- A: [
498
- "this._node",
499
- ""
500
- ]
501
- });
502
- const addr = toSimpleCellAddress(this._node.sheetId, cell);
503
- const type = this._node.graph.hf.getCellValueDetailedType(addr);
504
- return typeMap[type];
505
- }
506
- /**
507
- * Sets the value, updating the sheet and engine.
508
- */
509
- setValue(cell, value) {
510
- invariant(this._node, void 0, {
511
- F: __dxlog_file,
512
- L: 375,
513
- S: this,
514
- A: [
515
- "this._node",
516
- ""
517
- ]
518
- });
519
- if (this._options.readonly) {
520
- throw new ReadonlyException();
521
- }
522
- let refresh = false;
523
- if (cell.row >= this._sheet.rows.length) {
524
- insertIndices(this._sheet.rows, cell.row, 1, MAX_ROWS);
525
- refresh = true;
526
- }
527
- if (cell.col >= this._sheet.columns.length) {
528
- insertIndices(this._sheet.columns, cell.col, 1, MAX_COLS);
529
- refresh = true;
530
- }
531
- if (refresh) {
532
- this.reset();
533
- }
534
- this._node.graph.hf.setCellContents({
535
- sheet: this._node.sheetId,
536
- row: cell.row,
537
- col: cell.col
538
- }, [
539
- [
540
- isFormula(value) ? this._graph.mapFormulaToNative(value) : value
541
- ]
542
- ]);
543
- const idx = addressToIndex(this._sheet, cell);
544
- if (value === void 0 || value === null) {
545
- delete this._sheet.cells[idx];
546
- } else {
547
- if (isFormula(value)) {
548
- value = this._graph.mapFunctionBindingToId(mapFormulaRefsToIndices(this._sheet, value));
549
- }
550
- this._sheet.cells[idx] = {
551
- value
552
- };
553
- }
554
- }
555
- /**
556
- * Sets values from a simple map.
557
- */
558
- setValues(values) {
559
- Object.entries(values).forEach(([key, { value }]) => {
560
- this.setValue(addressFromA1Notation(key), value);
561
- });
562
- }
563
- /**
564
- * Iterate range.
565
- */
566
- _iterRange(range, cb) {
567
- const to = range.to ?? range.from;
568
- const rowRange = [
569
- Math.min(range.from.row, to.row),
570
- Math.max(range.from.row, to.row)
571
- ];
572
- const columnRange = [
573
- Math.min(range.from.col, to.col),
574
- Math.max(range.from.col, to.col)
575
- ];
576
- const rows = [];
577
- for (let row = rowRange[0]; row <= rowRange[1]; row++) {
578
- const rowCells = [];
579
- for (let column = columnRange[0]; column <= columnRange[1]; column++) {
580
- const value = cb({
581
- row,
582
- col: column
583
- });
584
- if (value !== void 0) {
585
- rowCells.push(value);
586
- }
587
- }
588
- rows.push(rowCells);
589
- }
590
- return rows;
591
- }
592
- // TODO(burdon): Delete index.
593
- _deleteIndices(indices, i, n) {
594
- throw new Error("Not implemented");
595
- }
596
- // TODO(burdon): Move. Cannot use fractional without changing. Switch back to using unique IDs?
597
- _moveIndices(indices, i, j, n) {
598
- throw new Error("Not implemented");
599
- }
600
- /**
601
- * Map from indices to A1 notation.
602
- */
603
- mapFormulaIndicesToRefs(formula) {
604
- invariant(isFormula(formula), void 0, {
605
- F: __dxlog_file,
606
- L: 460,
607
- S: this,
608
- A: [
609
- "isFormula(formula)",
610
- ""
611
- ]
612
- });
613
- return formula.replace(/([a-zA-Z0-9]+)@([a-zA-Z0-9]+)/g, (idx) => {
614
- return addressToA1Notation(addressFromIndex(this._sheet, idx));
615
- });
616
- }
617
- //
618
- // Values
619
- //
620
- /**
621
- * https://hyperformula.handsontable.com/guide/date-and-time-handling.html#example
622
- * https://hyperformula.handsontable.com/api/interfaces/configparams.html#nulldate
623
- * NOTE: TODAY() is number of FULL days since nullDate. It will typically be -1 days from NOW().
624
- */
625
- toLocalDate(num) {
626
- const { year, month, day, hours, minutes, seconds } = this.toDateTime(num);
627
- return new Date(year, month - 1, day, hours, minutes, seconds);
628
- }
629
- toDateTime(num) {
630
- invariant(this._node, void 0, {
631
- F: __dxlog_file,
632
- L: 481,
633
- S: this,
634
- A: [
635
- "this._node",
636
- ""
637
- ]
638
- });
639
- return this._node.graph.hf.numberToDateTime(num);
640
- }
641
- toDate(num) {
642
- invariant(this._node, void 0, {
643
- F: __dxlog_file,
644
- L: 486,
645
- S: this,
646
- A: [
647
- "this._node",
648
- ""
649
- ]
650
- });
651
- return this._node.graph.hf.numberToDate(num);
652
- }
653
- toTime(num) {
654
- invariant(this._node, void 0, {
655
- F: __dxlog_file,
656
- L: 491,
657
- S: this,
658
- A: [
659
- "this._node",
660
- ""
661
- ]
662
- });
663
- return this._node.graph.hf.numberToTime(num);
664
- }
665
- constructor(_graph, _sheet, _options = {}) {
666
- super(), _define_property(this, "_graph", void 0), _define_property(this, "_sheet", void 0), _define_property(this, "_options", void 0), _define_property(this, "id", void 0), // Wraps compute node.
667
- _define_property(this, "update", void 0), _define_property(this, "_node", void 0), this._graph = _graph, this._sheet = _sheet, this._options = _options, this.id = `model-${PublicKey.random().truncate()}`, this.update = new Event();
668
- }
669
- };
670
-
671
- // src/model/useSheetModel.ts
672
- import { useEffect, useState } from "react";
673
- var useSheetModel = (graph, sheet, { readonly } = {}) => {
674
- const [model, setModel] = useState();
675
- useEffect(() => {
676
- if (!graph || !sheet) {
677
- return;
678
- }
679
- let model2;
680
- const t = setTimeout(async () => {
681
- model2 = new SheetModel(graph, sheet, {
682
- readonly
683
- });
684
- await model2.open();
685
- setModel(model2);
686
- });
687
- return () => {
688
- clearTimeout(t);
689
- void model2?.close();
690
- };
691
- }, [
692
- graph,
693
- sheet,
694
- readonly
695
- ]);
696
- return model;
697
- };
698
-
699
- // src/types/types.ts
700
- (function(SheetAction2) {
701
- const SHEET_ACTION = `${SHEET_PLUGIN}/action`;
702
- class Create extends Schema2.TaggedClass()(`${SHEET_ACTION}/create`, {
703
- input: Schema2.Struct({
704
- name: Schema2.optional(Schema2.String)
705
- }),
706
- output: Schema2.Struct({
707
- object: SheetType
708
- })
709
- }) {
710
- }
711
- SheetAction2.Create = Create;
712
- const Axis = Schema2.Union(Schema2.Literal("row"), Schema2.Literal("col"));
713
- class InsertAxis extends Schema2.TaggedClass()(`${SHEET_ACTION}/axis-insert`, {
714
- input: Schema2.Struct({
715
- // TODO(wittjosiah): Schema.instanceOf(SheetModel) throws when running tests.
716
- model: Schema2.Any.pipe(Schema2.filter((model) => model instanceof SheetModel)),
717
- axis: Axis,
718
- index: Schema2.Number,
719
- count: Schema2.optional(Schema2.Number)
720
- }),
721
- output: Schema2.Void
722
- }) {
723
- }
724
- SheetAction2.InsertAxis = InsertAxis;
725
- SheetAction2.RestoreAxis = Schema2.Struct({
726
- axis: Axis,
727
- axisIndex: Schema2.String,
728
- index: Schema2.Number,
729
- axisMeta: RowColumnMeta,
730
- values: Schema2.Array(Schema2.Any)
731
- });
732
- class DropAxis extends Schema2.TaggedClass()(`${SHEET_ACTION}/axis-drop`, {
733
- input: Schema2.Struct({
734
- // TODO(wittjosiah): Schema.instanceOf(SheetModel) throws when running tests.
735
- model: Schema2.Any.pipe(Schema2.filter((model) => model instanceof SheetModel)),
736
- axis: Axis,
737
- axisIndex: Schema2.String,
738
- deletionData: Schema2.optional(SheetAction2.RestoreAxis)
739
- }),
740
- output: Schema2.Void
741
- }) {
742
- }
743
- SheetAction2.DropAxis = DropAxis;
744
- })(SheetAction || (SheetAction = {}));
745
- var SheetAction;
746
-
747
- // src/types/util.ts
748
- import { addressFromA1Notation as addressFromA1Notation2, addressToA1Notation as addressToA1Notation2, isFormula as isFormula2 } from "@dxos/compute";
749
- import { randomBytes } from "@dxos/crypto";
750
- import { Obj as Obj2 } from "@dxos/echo";
751
- import { invariant as invariant2 } from "@dxos/invariant";
752
- var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-sheet/src/types/util.ts";
753
- var MAX_ROWS = 500;
754
- var MAX_COLS = 676;
755
- var DEFAULT_ROWS = 50;
756
- var DEFAULT_COLS = 26;
757
- var ApiError = class extends Error {
758
- };
759
- var ReadonlyException = class extends ApiError {
760
- };
761
- var RangeException = class extends ApiError {
762
- constructor(n) {
763
- super();
764
- }
765
- };
766
- var createIndex = (length = 8) => {
767
- const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
768
- const charactersLength = characters.length;
769
- const randomBuffer = randomBytes(length);
770
- return Array.from(randomBuffer, (byte) => characters[byte % charactersLength]).join("");
771
- };
772
- var createIndices = (length) => Array.from({
773
- length
774
- }).map(() => createIndex());
775
- var insertIndices = (indices, i, n, max) => {
776
- if (i + n > max) {
777
- throw new RangeException(i + n);
778
- }
779
- const idx = createIndices(n);
780
- indices.splice(i, 0, ...idx);
781
- return idx;
782
- };
783
- var initialize = (sheet, { rows = DEFAULT_ROWS, columns = DEFAULT_COLS } = {}) => {
784
- if (!sheet.rows.length) {
785
- insertIndices(sheet.rows, 0, rows, MAX_ROWS);
786
- }
787
- if (!sheet.columns.length) {
788
- insertIndices(sheet.columns, 0, columns, MAX_COLS);
789
- }
790
- };
791
- var createSheet = ({ name, cells, ...size } = {}) => {
792
- const sheet = Obj2.make(SheetType, {
793
- name,
794
- cells: {},
795
- rows: [],
796
- columns: [],
797
- rowMeta: {},
798
- columnMeta: {},
799
- ranges: []
800
- });
801
- initialize(sheet, size);
802
- if (cells) {
803
- Object.entries(cells).forEach(([key, { value }]) => {
804
- const idx = addressToIndex(sheet, addressFromA1Notation2(key));
805
- if (isFormula2(value)) {
806
- value = mapFormulaRefsToIndices(sheet, value);
807
- }
808
- sheet.cells[idx] = {
809
- value
810
- };
811
- });
812
- }
813
- return sheet;
814
- };
815
- var addressToIndex = (sheet, cell) => {
816
- return `${sheet.columns[cell.col]}@${sheet.rows[cell.row]}`;
817
- };
818
- var addressFromIndex = (sheet, idx) => {
819
- const [column, row] = idx.split("@");
820
- return {
821
- col: sheet.columns.indexOf(column),
822
- row: sheet.rows.indexOf(row)
823
- };
824
- };
825
- var rangeToIndex = (sheet, range) => {
826
- return [
827
- range.from,
828
- range.to ?? range.from
829
- ].map((cell) => addressToIndex(sheet, cell)).join(":");
830
- };
831
- var rangeFromIndex = (sheet, idx) => {
832
- const [from, to] = idx.split(":").map((index) => addressFromIndex(sheet, index));
833
- return {
834
- from,
835
- to
836
- };
837
- };
838
- var compareIndexPositions = (sheet, indexA, indexB) => {
839
- const { row: rowA, col: columnA } = addressFromIndex(sheet, indexA);
840
- const { row: rowB, col: columnB } = addressFromIndex(sheet, indexB);
841
- if (rowA !== rowB) {
842
- return rowA - rowB;
843
- } else {
844
- return columnA - columnB;
845
- }
846
- };
847
- var mapFormulaRefsToIndices = (sheet, formula) => {
848
- invariant2(isFormula2(formula), void 0, {
849
- F: __dxlog_file2,
850
- L: 152,
851
- S: void 0,
852
- A: [
853
- "isFormula(formula)",
854
- ""
855
- ]
856
- });
857
- return formula.replace(/([a-zA-Z]+)([0-9]+)/g, (match) => {
858
- return addressToIndex(sheet, addressFromA1Notation2(match));
859
- });
860
- };
861
- var mapFormulaIndicesToRefs = (sheet, formula) => {
862
- invariant2(isFormula2(formula), void 0, {
863
- F: __dxlog_file2,
864
- L: 162,
865
- S: void 0,
866
- A: [
867
- "isFormula(formula)",
868
- ""
869
- ]
870
- });
871
- return formula.replace(/([a-zA-Z0-9]+)@([a-zA-Z0-9]+)/g, (idx) => {
872
- return addressToA1Notation2(addressFromIndex(sheet, idx));
873
- });
874
- };
875
-
876
- export {
877
- CellValue,
878
- Range,
879
- RowColumnMeta,
880
- SheetType,
881
- alignKey,
882
- commentKey,
883
- styleKey,
884
- cellClassNameForRange,
885
- useSheetModel,
886
- SheetAction,
887
- MAX_ROWS,
888
- MAX_COLS,
889
- DEFAULT_ROWS,
890
- DEFAULT_COLS,
891
- ApiError,
892
- ReadonlyException,
893
- RangeException,
894
- createIndex,
895
- createIndices,
896
- insertIndices,
897
- initialize,
898
- createSheet,
899
- addressToIndex,
900
- addressFromIndex,
901
- rangeToIndex,
902
- rangeFromIndex,
903
- compareIndexPositions,
904
- mapFormulaRefsToIndices,
905
- mapFormulaIndicesToRefs
906
- };
907
- //# sourceMappingURL=chunk-ODP4L4OV.mjs.map