@dxos/plugin-sheet 0.6.12 → 0.6.13-main.548ca8d

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 (325) hide show
  1. package/dist/lib/browser/SheetContainer-NDNIS44E.mjs +265 -0
  2. package/dist/lib/browser/SheetContainer-NDNIS44E.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-AQSGDA4X.mjs +1614 -0
  4. package/dist/lib/browser/chunk-AQSGDA4X.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-D3QTX46O.mjs +14 -0
  6. package/dist/lib/browser/chunk-D3QTX46O.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-GKI67SEF.mjs +69 -0
  8. package/dist/lib/browser/chunk-GKI67SEF.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-GSV5QNLD.mjs +2966 -0
  10. package/dist/lib/browser/chunk-GSV5QNLD.mjs.map +7 -0
  11. package/dist/lib/browser/graph-M4IQ76QX.mjs +33 -0
  12. package/dist/lib/browser/graph-M4IQ76QX.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +93 -62
  14. package/dist/lib/browser/index.mjs.map +3 -3
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/meta.mjs +1 -1
  17. package/dist/lib/browser/types.mjs +4 -10
  18. package/dist/lib/node/SheetContainer-YSQGJD7K.cjs +276 -0
  19. package/dist/lib/node/SheetContainer-YSQGJD7K.cjs.map +7 -0
  20. package/dist/lib/node/{chunk-5KKJ4NPP.cjs → chunk-5XPK2V4A.cjs} +418 -678
  21. package/dist/lib/node/chunk-5XPK2V4A.cjs.map +7 -0
  22. package/dist/lib/node/chunk-6F43RV45.cjs +1610 -0
  23. package/dist/lib/node/chunk-6F43RV45.cjs.map +7 -0
  24. package/dist/lib/node/{chunk-DSYKOI4E.cjs → chunk-ER3PM7GD.cjs} +29 -45
  25. package/dist/lib/node/chunk-ER3PM7GD.cjs.map +7 -0
  26. package/dist/lib/node/chunk-QIFIGEKV.cjs +37 -0
  27. package/dist/lib/node/chunk-QIFIGEKV.cjs.map +7 -0
  28. package/dist/lib/node/graph-Q3N2X26H.cjs +55 -0
  29. package/dist/lib/node/graph-Q3N2X26H.cjs.map +7 -0
  30. package/dist/lib/node/index.cjs +105 -69
  31. package/dist/lib/node/index.cjs.map +3 -3
  32. package/dist/lib/node/meta.cjs +3 -3
  33. package/dist/lib/node/meta.cjs.map +1 -1
  34. package/dist/lib/node/meta.json +1 -1
  35. package/dist/lib/node/types.cjs +8 -14
  36. package/dist/lib/node/types.cjs.map +2 -2
  37. package/dist/lib/node-esm/SheetContainer-M7WRMZDU.mjs +266 -0
  38. package/dist/lib/node-esm/SheetContainer-M7WRMZDU.mjs.map +7 -0
  39. package/dist/lib/{browser/chunk-D5AGLXJP.mjs → node-esm/chunk-5WPZCXNS.mjs} +411 -678
  40. package/dist/lib/node-esm/chunk-5WPZCXNS.mjs.map +7 -0
  41. package/dist/lib/node-esm/chunk-ELTFPX5B.mjs +1615 -0
  42. package/dist/lib/node-esm/chunk-ELTFPX5B.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-VCYJWE3O.mjs +16 -0
  44. package/dist/lib/node-esm/chunk-VCYJWE3O.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-ZVLLQ2PJ.mjs +70 -0
  46. package/dist/lib/node-esm/chunk-ZVLLQ2PJ.mjs.map +7 -0
  47. package/dist/lib/node-esm/graph-SMPUMOV2.mjs +34 -0
  48. package/dist/lib/node-esm/graph-SMPUMOV2.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +280 -0
  50. package/dist/lib/node-esm/index.mjs.map +7 -0
  51. package/dist/lib/node-esm/meta.json +1 -0
  52. package/dist/lib/node-esm/meta.mjs +10 -0
  53. package/dist/lib/node-esm/meta.mjs.map +7 -0
  54. package/dist/lib/node-esm/types.mjs +17 -0
  55. package/dist/lib/node-esm/types.mjs.map +7 -0
  56. package/dist/types/src/SheetPlugin.d.ts.map +1 -1
  57. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts +11 -0
  58. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -0
  59. package/dist/types/src/components/ComputeGraph/index.d.ts +1 -3
  60. package/dist/types/src/components/ComputeGraph/index.d.ts.map +1 -1
  61. package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts +3 -0
  62. package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts.map +1 -0
  63. package/dist/types/src/components/FunctionEditor/index.d.ts +2 -0
  64. package/dist/types/src/components/FunctionEditor/index.d.ts.map +1 -0
  65. package/dist/types/src/components/GridSheet/GridSheet.d.ts +3 -0
  66. package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -0
  67. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +9 -0
  68. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -0
  69. package/dist/types/src/components/{CellEditor/CellEditor.stories.d.ts → GridSheet/SheetCellEditor.stories.d.ts} +4 -4
  70. package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +1 -0
  71. package/dist/types/src/components/GridSheet/index.d.ts +2 -0
  72. package/dist/types/src/components/GridSheet/index.d.ts.map +1 -0
  73. package/dist/types/src/components/GridSheet/util.d.ts +16 -0
  74. package/dist/types/src/components/GridSheet/util.d.ts.map +1 -0
  75. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +6 -0
  76. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +1 -0
  77. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +11 -0
  78. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -0
  79. package/dist/types/src/components/SheetContainer/index.d.ts +3 -0
  80. package/dist/types/src/components/SheetContainer/index.d.ts.map +1 -0
  81. package/dist/types/src/components/SheetContext/SheetContext.d.ts +27 -0
  82. package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +1 -0
  83. package/dist/types/src/components/SheetContext/index.d.ts +2 -0
  84. package/dist/types/src/components/SheetContext/index.d.ts.map +1 -0
  85. package/dist/types/src/components/Toolbar/Toolbar.d.ts +36 -6
  86. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
  87. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +19 -14
  88. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
  89. package/dist/types/src/components/index.d.ts +3 -2
  90. package/dist/types/src/components/index.d.ts.map +1 -1
  91. package/dist/types/src/defs/index.d.ts +3 -0
  92. package/dist/types/src/defs/index.d.ts.map +1 -0
  93. package/dist/types/src/{model → defs}/types.d.ts +8 -3
  94. package/dist/types/src/defs/types.d.ts.map +1 -0
  95. package/dist/types/src/defs/types.test.d.ts.map +1 -0
  96. package/dist/types/src/defs/util.d.ts +43 -0
  97. package/dist/types/src/defs/util.d.ts.map +1 -0
  98. package/dist/types/src/extensions/compute.d.ts +6 -0
  99. package/dist/types/src/extensions/compute.d.ts.map +1 -0
  100. package/dist/types/src/extensions/compute.stories.d.ts +26 -0
  101. package/dist/types/src/extensions/compute.stories.d.ts.map +1 -0
  102. package/dist/types/src/{components/CellEditor → extensions/editor}/extension.d.ts +1 -1
  103. package/dist/types/src/extensions/editor/extension.d.ts.map +1 -0
  104. package/dist/types/src/extensions/editor/extension.test.d.ts.map +1 -0
  105. package/dist/types/src/extensions/editor/index.d.ts +2 -0
  106. package/dist/types/src/extensions/editor/index.d.ts.map +1 -0
  107. package/dist/types/src/extensions/index.d.ts +3 -0
  108. package/dist/types/src/extensions/index.d.ts.map +1 -0
  109. package/dist/types/src/graph/compute-graph-registry.d.ts +34 -0
  110. package/dist/types/src/graph/compute-graph-registry.d.ts.map +1 -0
  111. package/dist/types/src/graph/compute-graph.d.ts +64 -0
  112. package/dist/types/src/graph/compute-graph.d.ts.map +1 -0
  113. package/dist/types/src/graph/compute-graph.stories.d.ts +10 -0
  114. package/dist/types/src/graph/compute-graph.stories.d.ts.map +1 -0
  115. package/dist/types/src/graph/compute-graph.test.d.ts +2 -0
  116. package/dist/types/src/graph/compute-graph.test.d.ts.map +1 -0
  117. package/dist/types/src/graph/compute-node.d.ts +26 -0
  118. package/dist/types/src/graph/compute-node.d.ts.map +1 -0
  119. package/dist/types/src/{components/ComputeGraph → graph/functions}/async-function.d.ts +14 -5
  120. package/dist/types/src/graph/functions/async-function.d.ts.map +1 -0
  121. package/dist/types/src/graph/functions/edge-function.d.ts +21 -0
  122. package/dist/types/src/graph/functions/edge-function.d.ts.map +1 -0
  123. package/dist/types/src/{model/functions.d.ts → graph/functions/function-defs.d.ts} +1 -1
  124. package/dist/types/src/graph/functions/function-defs.d.ts.map +1 -0
  125. package/dist/types/src/graph/functions/index.d.ts +4 -0
  126. package/dist/types/src/graph/functions/index.d.ts.map +1 -0
  127. package/dist/types/src/graph/hyperformula.test.d.ts +2 -0
  128. package/dist/types/src/graph/hyperformula.test.d.ts.map +1 -0
  129. package/dist/types/src/graph/index.d.ts +5 -0
  130. package/dist/types/src/graph/index.d.ts.map +1 -0
  131. package/dist/types/src/graph/testing/index.d.ts +3 -0
  132. package/dist/types/src/graph/testing/index.d.ts.map +1 -0
  133. package/dist/types/src/graph/testing/test-builder.d.ts +15 -0
  134. package/dist/types/src/graph/testing/test-builder.d.ts.map +1 -0
  135. package/dist/types/src/graph/testing/test-plugin.d.ts +36 -0
  136. package/dist/types/src/graph/testing/test-plugin.d.ts.map +1 -0
  137. package/dist/types/src/graph/util.d.ts +2 -0
  138. package/dist/types/src/graph/util.d.ts.map +1 -0
  139. package/dist/types/src/hooks/hooks.stories.d.ts +11 -0
  140. package/dist/types/src/hooks/hooks.stories.d.ts.map +1 -0
  141. package/dist/types/src/hooks/index.d.ts +5 -0
  142. package/dist/types/src/hooks/index.d.ts.map +1 -0
  143. package/dist/types/src/hooks/threads.d.ts +8 -0
  144. package/dist/types/src/hooks/threads.d.ts.map +1 -0
  145. package/dist/types/src/hooks/useComputeGraph.d.ts +7 -0
  146. package/dist/types/src/hooks/useComputeGraph.d.ts.map +1 -0
  147. package/dist/types/src/hooks/useFormattingModel.d.ts +3 -0
  148. package/dist/types/src/hooks/useFormattingModel.d.ts.map +1 -0
  149. package/dist/types/src/hooks/useSheetModel.d.ts +8 -0
  150. package/dist/types/src/hooks/useSheetModel.d.ts.map +1 -0
  151. package/dist/types/src/meta.d.ts +3 -9
  152. package/dist/types/src/meta.d.ts.map +1 -1
  153. package/dist/types/src/model/decorations.d.ts +25 -0
  154. package/dist/types/src/model/decorations.d.ts.map +1 -0
  155. package/dist/types/src/model/formatting-model.d.ts +19 -0
  156. package/dist/types/src/model/formatting-model.d.ts.map +1 -0
  157. package/dist/types/src/model/index.d.ts +3 -3
  158. package/dist/types/src/model/index.d.ts.map +1 -1
  159. package/dist/types/src/model/{model.d.ts → sheet-model.d.ts} +13 -67
  160. package/dist/types/src/model/sheet-model.d.ts.map +1 -0
  161. package/dist/types/src/model/sheet-model.test.d.ts +2 -0
  162. package/dist/types/src/model/sheet-model.test.d.ts.map +1 -0
  163. package/dist/types/src/sanity.test.d.ts +2 -0
  164. package/dist/types/src/sanity.test.d.ts.map +1 -0
  165. package/dist/types/src/testing/index.d.ts +2 -0
  166. package/dist/types/src/testing/index.d.ts.map +1 -0
  167. package/dist/types/src/testing/testing.d.ts +8 -0
  168. package/dist/types/src/testing/testing.d.ts.map +1 -0
  169. package/dist/types/src/translations.d.ts +17 -12
  170. package/dist/types/src/translations.d.ts.map +1 -1
  171. package/dist/types/src/types.d.ts +98 -32
  172. package/dist/types/src/types.d.ts.map +1 -1
  173. package/dist/vendor/hyperformula.mjs +37145 -0
  174. package/package.json +57 -52
  175. package/src/SheetPlugin.tsx +52 -74
  176. package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +20 -0
  177. package/src/components/ComputeGraph/index.ts +1 -3
  178. package/src/components/FunctionEditor/FunctionEditor.tsx +45 -0
  179. package/src/components/FunctionEditor/index.ts +5 -0
  180. package/src/components/GridSheet/GridSheet.stories.tsx +41 -0
  181. package/src/components/GridSheet/GridSheet.tsx +161 -0
  182. package/src/components/{CellEditor/CellEditor.stories.tsx → GridSheet/SheetCellEditor.stories.tsx} +8 -8
  183. package/src/components/GridSheet/index.ts +5 -0
  184. package/src/components/GridSheet/util.ts +144 -0
  185. package/src/components/SheetContainer/SheetContainer.stories.tsx +40 -0
  186. package/src/components/SheetContainer/SheetContainer.tsx +52 -0
  187. package/src/components/SheetContainer/index.ts +7 -0
  188. package/src/components/SheetContext/SheetContext.tsx +108 -0
  189. package/src/components/SheetContext/index.ts +5 -0
  190. package/src/components/Toolbar/Toolbar.tsx +167 -85
  191. package/src/components/index.ts +2 -0
  192. package/src/defs/index.ts +6 -0
  193. package/src/{model → defs}/types.test.ts +8 -9
  194. package/src/{model → defs}/types.ts +24 -14
  195. package/src/defs/util.ts +151 -0
  196. package/src/extensions/compute.stories.tsx +151 -0
  197. package/src/extensions/compute.ts +147 -0
  198. package/src/{components/CellEditor → extensions/editor}/extension.test.ts +4 -6
  199. package/src/{components/CellEditor → extensions/editor}/extension.ts +5 -6
  200. package/src/{components/CellEditor → extensions/editor}/index.ts +0 -1
  201. package/src/extensions/index.ts +6 -0
  202. package/src/graph/compute-graph-registry.ts +90 -0
  203. package/src/graph/compute-graph.stories.tsx +93 -0
  204. package/src/graph/compute-graph.test.ts +87 -0
  205. package/src/graph/compute-graph.ts +242 -0
  206. package/src/graph/compute-node.ts +63 -0
  207. package/src/{components/ComputeGraph → graph/functions}/async-function.ts +25 -15
  208. package/src/{components/ComputeGraph → graph/functions}/edge-function.ts +16 -14
  209. package/src/graph/functions/index.ts +7 -0
  210. package/src/graph/hyperformula.test.ts +14 -0
  211. package/src/graph/index.ts +8 -0
  212. package/src/graph/testing/index.ts +6 -0
  213. package/src/graph/testing/test-builder.ts +54 -0
  214. package/src/{components/ComputeGraph/custom.ts → graph/testing/test-plugin.ts} +44 -14
  215. package/src/graph/util.ts +8 -0
  216. package/src/hooks/hooks.stories.tsx +50 -0
  217. package/src/hooks/index.ts +8 -0
  218. package/src/hooks/threads.ts +147 -0
  219. package/src/hooks/useComputeGraph.ts +28 -0
  220. package/src/hooks/useFormattingModel.ts +11 -0
  221. package/src/hooks/useSheetModel.ts +40 -0
  222. package/src/meta.ts +14 -0
  223. package/src/model/decorations.ts +64 -0
  224. package/src/{components/Sheet/formatting.ts → model/formatting-model.ts} +30 -20
  225. package/src/model/index.ts +3 -3
  226. package/src/model/sheet-model.test.ts +57 -0
  227. package/src/model/sheet-model.ts +418 -0
  228. package/src/sanity.test.ts +40 -0
  229. package/src/{components/Sheet → testing}/index.ts +1 -1
  230. package/src/testing/testing.tsx +68 -0
  231. package/src/translations.ts +6 -1
  232. package/src/types.ts +40 -41
  233. package/dist/lib/browser/SheetContainer-U4H5D34A.mjs +0 -1772
  234. package/dist/lib/browser/SheetContainer-U4H5D34A.mjs.map +0 -7
  235. package/dist/lib/browser/chunk-APHOLYUB.mjs +0 -175
  236. package/dist/lib/browser/chunk-APHOLYUB.mjs.map +0 -7
  237. package/dist/lib/browser/chunk-D5AGLXJP.mjs.map +0 -7
  238. package/dist/lib/browser/chunk-FUAGSXA4.mjs +0 -82
  239. package/dist/lib/browser/chunk-FUAGSXA4.mjs.map +0 -7
  240. package/dist/lib/browser/chunk-JRL5LGCE.mjs +0 -18
  241. package/dist/lib/browser/chunk-JRL5LGCE.mjs.map +0 -7
  242. package/dist/lib/browser/chunk-NU4PBN33.mjs +0 -8
  243. package/dist/lib/browser/chunk-NU4PBN33.mjs.map +0 -7
  244. package/dist/lib/browser/testing.mjs +0 -92
  245. package/dist/lib/browser/testing.mjs.map +0 -7
  246. package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs +0 -1765
  247. package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs.map +0 -7
  248. package/dist/lib/node/chunk-5KKJ4NPP.cjs.map +0 -7
  249. package/dist/lib/node/chunk-BJ6ZD7MN.cjs +0 -51
  250. package/dist/lib/node/chunk-BJ6ZD7MN.cjs.map +0 -7
  251. package/dist/lib/node/chunk-CN3RPESU.cjs +0 -202
  252. package/dist/lib/node/chunk-CN3RPESU.cjs.map +0 -7
  253. package/dist/lib/node/chunk-DSYKOI4E.cjs.map +0 -7
  254. package/dist/lib/node/chunk-PYXHNAAK.cjs +0 -40
  255. package/dist/lib/node/chunk-PYXHNAAK.cjs.map +0 -7
  256. package/dist/lib/node/testing.cjs +0 -111
  257. package/dist/lib/node/testing.cjs.map +0 -7
  258. package/dist/types/src/components/CellEditor/CellEditor.d.ts +0 -14
  259. package/dist/types/src/components/CellEditor/CellEditor.d.ts.map +0 -1
  260. package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts.map +0 -1
  261. package/dist/types/src/components/CellEditor/extension.d.ts.map +0 -1
  262. package/dist/types/src/components/CellEditor/extension.test.d.ts.map +0 -1
  263. package/dist/types/src/components/CellEditor/index.d.ts +0 -3
  264. package/dist/types/src/components/CellEditor/index.d.ts.map +0 -1
  265. package/dist/types/src/components/ComputeGraph/async-function.d.ts.map +0 -1
  266. package/dist/types/src/components/ComputeGraph/custom.d.ts +0 -21
  267. package/dist/types/src/components/ComputeGraph/custom.d.ts.map +0 -1
  268. package/dist/types/src/components/ComputeGraph/edge-function.d.ts +0 -20
  269. package/dist/types/src/components/ComputeGraph/edge-function.d.ts.map +0 -1
  270. package/dist/types/src/components/ComputeGraph/graph-context.d.ts +0 -12
  271. package/dist/types/src/components/ComputeGraph/graph-context.d.ts.map +0 -1
  272. package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts +0 -2
  273. package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts.map +0 -1
  274. package/dist/types/src/components/ComputeGraph/graph.d.ts +0 -26
  275. package/dist/types/src/components/ComputeGraph/graph.d.ts.map +0 -1
  276. package/dist/types/src/components/Sheet/Sheet.d.ts +0 -55
  277. package/dist/types/src/components/Sheet/Sheet.d.ts.map +0 -1
  278. package/dist/types/src/components/Sheet/Sheet.stories.d.ts +0 -54
  279. package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +0 -1
  280. package/dist/types/src/components/Sheet/formatting.d.ts +0 -14
  281. package/dist/types/src/components/Sheet/formatting.d.ts.map +0 -1
  282. package/dist/types/src/components/Sheet/grid.d.ts +0 -52
  283. package/dist/types/src/components/Sheet/grid.d.ts.map +0 -1
  284. package/dist/types/src/components/Sheet/index.d.ts +0 -2
  285. package/dist/types/src/components/Sheet/index.d.ts.map +0 -1
  286. package/dist/types/src/components/Sheet/nav.d.ts +0 -29
  287. package/dist/types/src/components/Sheet/nav.d.ts.map +0 -1
  288. package/dist/types/src/components/Sheet/sheet-context.d.ts +0 -25
  289. package/dist/types/src/components/Sheet/sheet-context.d.ts.map +0 -1
  290. package/dist/types/src/components/Sheet/util.d.ts +0 -18
  291. package/dist/types/src/components/Sheet/util.d.ts.map +0 -1
  292. package/dist/types/src/components/SheetContainer.d.ts +0 -9
  293. package/dist/types/src/components/SheetContainer.d.ts.map +0 -1
  294. package/dist/types/src/components/Toolbar/common.d.ts +0 -20
  295. package/dist/types/src/components/Toolbar/common.d.ts.map +0 -1
  296. package/dist/types/src/model/functions.d.ts.map +0 -1
  297. package/dist/types/src/model/model.browser.test.d.ts +0 -2
  298. package/dist/types/src/model/model.browser.test.d.ts.map +0 -1
  299. package/dist/types/src/model/model.d.ts.map +0 -1
  300. package/dist/types/src/model/types.d.ts.map +0 -1
  301. package/dist/types/src/model/types.test.d.ts.map +0 -1
  302. package/dist/types/src/model/util.d.ts +0 -15
  303. package/dist/types/src/model/util.d.ts.map +0 -1
  304. package/dist/types/src/testing.d.ts +0 -9
  305. package/dist/types/src/testing.d.ts.map +0 -1
  306. package/src/components/CellEditor/CellEditor.tsx +0 -113
  307. package/src/components/ComputeGraph/graph-context.tsx +0 -50
  308. package/src/components/ComputeGraph/graph.browser.test.ts +0 -50
  309. package/src/components/ComputeGraph/graph.ts +0 -62
  310. package/src/components/Sheet/Sheet.stories.tsx +0 -287
  311. package/src/components/Sheet/Sheet.tsx +0 -1160
  312. package/src/components/Sheet/grid.ts +0 -191
  313. package/src/components/Sheet/nav.ts +0 -157
  314. package/src/components/Sheet/sheet-context.tsx +0 -150
  315. package/src/components/Sheet/util.ts +0 -56
  316. package/src/components/SheetContainer.tsx +0 -34
  317. package/src/components/Toolbar/common.tsx +0 -72
  318. package/src/meta.tsx +0 -18
  319. package/src/model/model.browser.test.ts +0 -100
  320. package/src/model/model.ts +0 -550
  321. package/src/model/util.ts +0 -36
  322. package/src/testing.ts +0 -50
  323. /package/dist/types/src/{model → defs}/types.test.d.ts +0 -0
  324. /package/dist/types/src/{components/CellEditor → extensions/editor}/extension.test.d.ts +0 -0
  325. /package/src/{model/functions.ts → graph/functions/function-defs.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/components/GridSheet/util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAwC,MAAM,OAAO,CAAC;AAGpF,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAOnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEpE,eAAO,MAAM,iCAAiC,UAAW,MAAM,KAAG,WAMjE,CAAC;AA6CF,eAAO,MAAM,YAAY,QAAS,MAAM;;;;CAItC,CAAC;AAEH,eAAO,MAAM,YAAY,QAAS,MAAM;;;CAA2D,CAAC;AA0BpG,eAAO,MAAM,wBAAwB,cACxB,gBAAgB,CAAC,aAAa,GAAG,IAAI,CAAC,SAC1C,UAAU,cACL,eAAe,KAC1B,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,MAAM,CAkC3C,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { type SheetProviderProps } from '../SheetContext';
3
+ export declare const SheetContainer: ({ graph, sheet, role }: SheetProviderProps & {
4
+ role?: string;
5
+ }) => React.JSX.Element;
6
+ //# sourceMappingURL=SheetContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SheetContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/SheetContainer/SheetContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAM3C,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGzE,eAAO,MAAM,cAAc,2BAA4B,kBAAkB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,sBAsC5F,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ component: ({ graph, sheet, role }: import("..").SheetProviderProps & {
5
+ role?: string;
6
+ }) => React.JSX.Element;
7
+ decorators: import("@storybook/react").Decorator[];
8
+ };
9
+ export default _default;
10
+ export declare const Basic: () => React.JSX.Element | null;
11
+ //# sourceMappingURL=SheetContainer.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SheetContainer.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/SheetContainer/SheetContainer.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;YASQ,CAAC;;;;AAEnC,wBAaE;AAEF,eAAO,MAAM,KAAK,gCASjB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { SheetContainer } from './SheetContainer';
2
+ export default SheetContainer;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/SheetContainer/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAe,cAAc,CAAC"}
@@ -0,0 +1,27 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import { type GridEditing } from '@dxos/react-ui-grid';
3
+ import { type CellAddress, type CellRange } from '../../defs';
4
+ import { type ComputeGraph } from '../../graph';
5
+ import { type FormattingModel, type SheetModel, createDecorations } from '../../model';
6
+ import { type SheetType } from '../../types';
7
+ export type SheetContextValue = {
8
+ id: string;
9
+ model: SheetModel;
10
+ formatting: FormattingModel;
11
+ cursor?: CellAddress;
12
+ setCursor: (cell: CellAddress | undefined) => void;
13
+ range?: CellRange;
14
+ setRange: (range: CellRange | undefined) => void;
15
+ editing: GridEditing;
16
+ setEditing: (editing: GridEditing) => void;
17
+ onInfo?: () => void;
18
+ decorations: ReturnType<typeof createDecorations>;
19
+ };
20
+ export declare const useSheetContext: () => SheetContextValue;
21
+ export type SheetProviderProps = {
22
+ graph: ComputeGraph;
23
+ sheet: SheetType;
24
+ readonly?: boolean;
25
+ } & Pick<SheetContextValue, 'onInfo'>;
26
+ export declare const SheetProvider: ({ children, graph, sheet, readonly, onInfo }: PropsWithChildren<SheetProviderProps>) => React.JSX.Element | null;
27
+ //# sourceMappingURL=SheetContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SheetContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/SheetContext/SheetContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAgD,MAAM,OAAO,CAAC;AAIpG,OAAO,EAA8C,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnG,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IAEX,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,EAAE,eAAe,CAAC;IAI5B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAC;IACnD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IAGjD,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAI3C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAGpB,WAAW,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;CACnD,CAAC;AAIF,eAAO,MAAM,eAAe,QAAO,iBAIlC,CAAC;AA2CF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AAEtC,eAAO,MAAM,aAAa,iDAAkD,iBAAiB,CAAC,kBAAkB,CAAC,6BAWhH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './SheetContext';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/SheetContext/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC"}
@@ -1,16 +1,46 @@
1
1
  import React, { type PropsWithChildren } from 'react';
2
- import { type ThemedClassName } from '@dxos/react-ui';
3
- export type ToolbarActionType = 'clear' | 'highlight' | 'left' | 'center' | 'right' | 'date' | 'currency';
4
- export type ToolbarAction = {
5
- type: ToolbarActionType;
2
+ import { type ToolbarToggleGroupItemProps as NaturalToolbarToggleGroupItemProps, type ToolbarButtonProps as NaturalToolbarButtonProps, type ToolbarToggleProps as NaturalToolbarToggleProps, type ThemedClassName } from '@dxos/react-ui';
3
+ type ToolbarItemProps = (NaturalToolbarButtonProps & {
4
+ itemType: 'button';
5
+ icon: string;
6
+ }) | (NaturalToolbarToggleGroupItemProps & {
7
+ itemType: 'toggleGroupItem';
8
+ icon: string;
9
+ }) | (NaturalToolbarToggleProps & {
10
+ itemType: 'toggle';
11
+ icon: string;
12
+ });
13
+ export declare const ToolbarItem: ({ itemType, icon, children, ...props }: ToolbarItemProps) => React.JSX.Element;
14
+ type AlignValue = 'left' | 'center' | 'right' | 'unset';
15
+ type AlignAction = {
16
+ type: 'align';
17
+ value: AlignValue;
6
18
  };
7
- export type ToolbarActionHandler = ({ type }: ToolbarAction) => void;
19
+ type CommentAction = {
20
+ type: 'comment';
21
+ anchor: string;
22
+ cellContent?: string;
23
+ };
24
+ type FormatValue = 'date' | 'currency' | 'unset';
25
+ type FormatAction = {
26
+ type: 'format';
27
+ value: FormatValue;
28
+ };
29
+ type StyleValue = 'highlight' | 'unset';
30
+ type StyleAction = {
31
+ type: 'style';
32
+ value: StyleValue;
33
+ };
34
+ export type ToolbarAction = StyleAction | AlignAction | FormatAction | CommentAction;
35
+ export type ToolbarActionType = ToolbarAction['type'];
36
+ export type ToolbarActionHandler = (action: ToolbarAction) => void;
8
37
  export type ToolbarProps = ThemedClassName<PropsWithChildren<{
9
38
  onAction?: ToolbarActionHandler;
39
+ role?: string;
10
40
  }>>;
11
41
  declare const useToolbarContext: (consumerName: string) => ToolbarProps;
12
42
  export declare const Toolbar: {
13
- Root: ({ children, onAction, classNames }: ToolbarProps) => React.JSX.Element;
43
+ Root: ({ children, onAction, role, classNames }: ToolbarProps) => React.JSX.Element;
14
44
  Separator: () => React.JSX.Element;
15
45
  Alignment: () => React.JSX.Element;
16
46
  Format: () => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Tool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C,YAAY;;;;;;CA8K1E,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -3,29 +3,34 @@ import React from 'react';
3
3
  declare const _default: {
4
4
  title: string;
5
5
  component: {
6
- Root: ({ children, onAction, classNames }: import("./Toolbar").ToolbarProps) => React.JSX.Element;
6
+ Root: ({ children, onAction, role, classNames }: import("./Toolbar").ToolbarProps) => React.JSX.Element;
7
7
  Separator: () => React.JSX.Element;
8
8
  Alignment: () => React.JSX.Element;
9
9
  Format: () => React.JSX.Element;
10
10
  Styles: () => React.JSX.Element;
11
11
  Actions: () => React.JSX.Element;
12
12
  };
13
- decorators: import("@storybook/react/*").Decorator[];
13
+ decorators: import("@storybook/react").Decorator[];
14
14
  parameters: {
15
- translations: {
16
- 'en-US': {
17
- "dxos.org/plugin/sheet": {
18
- 'plugin name': string;
19
- 'sheet title placeholder': string;
20
- 'create sheet label': string;
21
- 'create sheet section label': string;
22
- 'cell placeholder': string;
23
- 'toolbar left label': string;
24
- 'toolbar left center': string;
25
- 'toolbar left right': string;
15
+ translations: readonly [{
16
+ readonly 'en-US': {
17
+ readonly "dxos.org/plugin/sheet": {
18
+ readonly 'plugin name': "Sheets";
19
+ readonly 'sheet title placeholder': "New sheet";
20
+ readonly 'create sheet label': "Create sheet";
21
+ readonly 'create sheet section label': "Create sheet";
22
+ readonly 'cell placeholder': "Cell value...";
23
+ readonly 'toolbar left label': "Align left";
24
+ readonly 'toolbar left center': "Align center";
25
+ readonly 'toolbar left right': "Align right";
26
+ readonly 'selection overlaps existing comment label': "Selected cell already has a comment";
27
+ readonly 'comment label': "Add comment";
28
+ readonly 'comment ranges not supported label': "Commenting on ranges is not yet supported";
29
+ readonly 'no cursor label': "Select a cell to comment";
30
+ readonly 'open comment for sheet cell': "View comments for cell";
26
31
  };
27
32
  };
28
- }[];
33
+ }];
29
34
  layout: string;
30
35
  };
31
36
  render: (args: any) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Toolbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAqBT,GAAG;;AALpB,wBAME;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
1
+ {"version":3,"file":"Toolbar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Toolbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAqBT,GAAG;;AALpB,wBAME;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  export * from './ComputeGraph';
3
- export declare const SheetContainer: React.LazyExoticComponent<({ sheet, space, role, remoteFunctionUrl, }: import("./Sheet").SheetRootProps & {
3
+ export * from './GridSheet';
4
+ export * from './SheetContext';
5
+ export declare const SheetContainer: React.LazyExoticComponent<({ graph, sheet, role }: import("./SheetContext").SheetProviderProps & {
4
6
  role?: string;
5
- coordinate?: import("packages/sdk/app-framework/dist/types/src").LayoutCoordinate;
6
7
  }) => React.JSX.Element>;
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,cAAc,gBAAgB,CAAC;AAG/B,eAAO,MAAM,cAAc;QAC2E,CAAC;cAAoB,CAAC;wBADlD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAG/B,eAAO,MAAM,cAAc;QAC6I,CAAC;wBAD/F,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './types';
2
+ export * from './util';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/defs/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
@@ -1,15 +1,20 @@
1
+ export declare const DEFAULT_ROWS = 50;
2
+ export declare const DEFAULT_COLUMNS = 26;
3
+ export declare const MAX_ROWS = 500;
1
4
  export declare const MAX_COLUMNS: number;
2
5
  export type CellAddress = {
3
- column: number;
6
+ col: number;
4
7
  row: number;
5
8
  };
6
9
  export type CellRange = {
7
10
  from: CellAddress;
8
11
  to?: CellAddress;
9
12
  };
13
+ export type CellIndex = string;
14
+ export type CellContentValue = number | string | boolean | null;
10
15
  export declare const posEquals: (a: CellAddress | undefined, b: CellAddress | undefined) => boolean;
11
- export declare const columnLetter: (column: number) => string;
12
- export declare const addressToA1Notation: ({ column, row }: CellAddress) => string;
16
+ export declare const columnLetter: (col: number) => string;
17
+ export declare const addressToA1Notation: ({ col, row }: CellAddress) => string;
13
18
  export declare const addressFromA1Notation: (ref: string) => CellAddress;
14
19
  export declare const rangeToA1Notation: (range: CellRange) => string;
15
20
  export declare const rangeFromA1Notation: (ref: string) => CellRange;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/defs/types.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,eAAO,MAAM,QAAQ,MAAM,CAAC;AAC5B,eAAO,MAAM,WAAW,QAAS,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,EAAE,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAEhE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEhE,eAAO,MAAM,SAAS,MAAO,WAAW,GAAG,SAAS,KAAK,WAAW,GAAG,SAAS,YAE/E,CAAC;AAEF,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MAM1C,CAAC;AAEF,eAAO,MAAM,mBAAmB,iBAAkB,WAAW,KAAG,MAE/D,CAAC;AAGF,eAAO,MAAM,qBAAqB,QAAS,MAAM,KAAG,WAOnD,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAW,SAAS,WAIjD,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,SAGjD,CAAC;AAEF,eAAO,MAAM,OAAO,UAAW,SAAS,GAAG,SAAS,QAAQ,WAAW,KAAG,OAuBzE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../../../src/defs/types.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ import { type CellAddress, type CellRange } from './types';
2
+ import { type CreateSheetOptions, type SheetSize, SheetType } from '../types';
3
+ export declare class ApiError extends Error {
4
+ }
5
+ export declare class ReadonlyException extends ApiError {
6
+ }
7
+ export declare class RangeException extends ApiError {
8
+ constructor(n: number);
9
+ }
10
+ /**
11
+ * With a string length of 8, the chance of a collision is 0.02% for a sheet with 10,000 strings.
12
+ */
13
+ export declare const createIndex: (length?: number) => string;
14
+ export declare const createIndices: (length: number) => string[];
15
+ export declare const insertIndices: (indices: string[], i: number, n: number, max: number) => void;
16
+ export declare const initialize: (sheet: SheetType, { rows, columns }?: Partial<SheetSize>) => void;
17
+ export declare const createSheet: ({ name, cells, ...size }?: CreateSheetOptions) => SheetType;
18
+ /**
19
+ * E.g., "A1" => "CA2@CB3".
20
+ */
21
+ export declare const addressToIndex: (sheet: SheetType, cell: CellAddress) => string;
22
+ /**
23
+ * E.g., "CA2@CB3" => "A1".
24
+ */
25
+ export declare const addressFromIndex: (sheet: SheetType, idx: string) => CellAddress;
26
+ /**
27
+ * E.g., "A1:B2" => "CA2@CB3:CC4@CD5".
28
+ */
29
+ export declare const rangeToIndex: (sheet: SheetType, range: CellRange) => string;
30
+ /**
31
+ * E.g., "CA2@CB3:CC4@CD5" => "A1:B2".
32
+ */
33
+ export declare const rangeFromIndex: (sheet: SheetType, idx: string) => CellRange;
34
+ /**
35
+ * Find closest cell to cursor.
36
+ */
37
+ export declare const closest: (cursor: CellAddress, cells: CellAddress[]) => CellAddress | undefined;
38
+ /**
39
+ * Compares the positions of two cell indexes in a sheet.
40
+ * Sorts primarily by row, then by column if rows are equal.
41
+ */
42
+ export declare const compareIndexPositions: (sheet: SheetType, indexA: string, indexB: string) => number;
43
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/defs/util.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,SAAS,EAKf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG9E,qBAAa,QAAS,SAAQ,KAAK;CAAG;AAEtC,qBAAa,iBAAkB,SAAQ,QAAQ;CAAG;AAElD,qBAAa,cAAe,SAAQ,QAAQ;gBAC9B,CAAC,EAAE,MAAM;CAGtB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,uBAAiB,MAKxC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAAM,EAAqD,CAAC;AAE3G,eAAO,MAAM,aAAa,YAAa,MAAM,EAAE,KAAK,MAAM,KAAK,MAAM,OAAO,MAAM,SAOjF,CAAC;AAEF,eAAO,MAAM,UAAU,UACd,SAAS,sBACoC,OAAO,CAAC,SAAS,CAAC,SAQvE,CAAC;AAEF,eAAO,MAAM,WAAW,8BAA8B,kBAAkB,KAAQ,SAqB/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,UAAW,SAAS,QAAQ,WAAW,KAAG,MAEpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,UAAW,SAAS,OAAO,MAAM,KAAG,WAMhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,SAAS,SAAS,SAAS,KAAG,MAEjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,UAAW,SAAS,OAAO,MAAM,KAAG,SAG9D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,WAAY,WAAW,SAAS,WAAW,EAAE,KAAG,WAAW,GAAG,SAajF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UAAW,SAAS,UAAU,MAAM,UAAU,MAAM,KAAG,MAUxF,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type Extension } from '@codemirror/state';
2
+ import { type ComputeGraph } from '../graph';
3
+ export declare const computeGraphFacet: import("@codemirror/state").Facet<ComputeGraph, ComputeGraph>;
4
+ export type ComputeOptions = {};
5
+ export declare const compute: (options?: ComputeOptions) => Extension;
6
+ //# sourceMappingURL=compute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../../../../src/extensions/compute.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,KAAK,YAAY,EAAqC,MAAM,UAAU,CAAC;AAQhF,eAAO,MAAM,iBAAiB,+DAAmC,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG,EAAE,CAAC;AAEhC,eAAO,MAAM,OAAO,aAAa,cAAc,KAAQ,SAgGtD,CAAC"}
@@ -0,0 +1,26 @@
1
+ import '@dxos-theme';
2
+ import React from 'react';
3
+ type EditorProps = {
4
+ text?: string;
5
+ };
6
+ declare const _default: {
7
+ title: string;
8
+ decorators: import("@storybook/react").Decorator[];
9
+ parameters: {
10
+ layout: string;
11
+ };
12
+ };
13
+ export default _default;
14
+ export declare const Default: {
15
+ render: ({ text }: EditorProps) => React.JSX.Element;
16
+ args: {
17
+ text: string;
18
+ };
19
+ };
20
+ export declare const Graph: {
21
+ render: (props: EditorProps) => React.JSX.Element;
22
+ args: {
23
+ text: string;
24
+ };
25
+ };
26
+ //# sourceMappingURL=compute.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute.stories.d.ts","sourceRoot":"","sources":["../../../../src/extensions/compute.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AACrB,OAAO,KAA6B,MAAM,OAAO,CAAC;AAyBlD,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;;;;;;;;AAkEF,wBASE;AAGF,eAAO,MAAM,OAAO;uBArEM,WAAW;;;;CA2FpC,CAAC;AAEF,eAAO,MAAM,KAAK;oBA7CI,WAAW;;;;CA6DhC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type Extension } from '@codemirror/state';
2
- import { type FunctionDefinition } from '../../model';
2
+ import { type FunctionDefinition } from '../../graph';
3
3
  export type SheetExtensionOptions = {
4
4
  functions?: FunctionDefinition[];
5
5
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/editor/extension.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AASnD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAyCtD,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAClC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,kBAAwB,qBAAqB,KAAG,SAwH1E,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAIxD;;GAEG;AACH,eAAO,MAAM,cAAc,WAAY,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,KAAG,SA8D9E,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension.test.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/editor/extension.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './extension';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/editor/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './compute';
2
+ export * from './editor';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/extensions/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { FunctionPluginDefinition } from 'hyperformula';
2
+ import type { ConfigParams } from 'hyperformula/typings/ConfigParams';
3
+ import type { FunctionTranslationsPackage } from 'hyperformula/typings/interpreter';
4
+ import { type SpaceId, type Space } from '@dxos/client/echo';
5
+ import { Resource } from '@dxos/context';
6
+ import { ComputeGraph } from './compute-graph';
7
+ import { type FunctionContextOptions } from './functions';
8
+ export type ComputeGraphPlugin = {
9
+ plugin: FunctionPluginDefinition;
10
+ translations: FunctionTranslationsPackage;
11
+ };
12
+ export type ComputeGraphOptions = {
13
+ plugins?: ComputeGraphPlugin[];
14
+ } & Partial<FunctionContextOptions> & Partial<ConfigParams>;
15
+ export declare const defaultOptions: ComputeGraphOptions;
16
+ export declare const defaultPlugins: ComputeGraphPlugin[];
17
+ /**
18
+ * Manages a collection of ComputeGraph instances for each space.
19
+ *
20
+ * [ComputePlugin] => [ComputeGraphRegistry] => [ComputeGraph(Space)] => [ComputeNode(Object)]
21
+ *
22
+ * NOTE: The ComputeGraphRegistry manages the hierarchy of resources via its root Context.
23
+ * NOTE: The package.json file defines the packaged #hyperformula module.
24
+ */
25
+ export declare class ComputeGraphRegistry extends Resource {
26
+ private readonly _graphs;
27
+ private readonly _options;
28
+ constructor(options?: ComputeGraphOptions);
29
+ getGraph(spaceId: SpaceId): ComputeGraph | undefined;
30
+ getOrCreateGraph(space: Space): ComputeGraph;
31
+ createGraph(space: Space): ComputeGraph;
32
+ protected _close(): Promise<void>;
33
+ }
34
+ //# sourceMappingURL=compute-graph-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-graph-registry.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-graph-registry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAGpF,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAsD,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE9G,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,wBAAwB,CAAC;IACjC,YAAY,EAAE,2BAA2B,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAChC,GAAG,OAAO,CAAC,sBAAsB,CAAC,GACjC,OAAO,CAAC,YAAY,CAAC,CAAC;AAExB,eAAO,MAAM,cAAc,EAAE,mBAE5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,kBAAkB,EAK9C,CAAC;AAEF;;;;;;;GAOG;AAEH,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAE5D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;gBAEnC,OAAO,GAAE,mBAAiD;IAQtE,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS;IAIpD,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,YAAY;IAU5C,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,YAAY;cAQd,MAAM;CAMhC"}
@@ -0,0 +1,64 @@
1
+ import { Event } from '@dxos/async';
2
+ import { type Space } from '@dxos/client/echo';
3
+ import { Resource } from '@dxos/context';
4
+ import { type HyperFormula } from '#hyperformula';
5
+ import { ComputeNode } from './compute-node';
6
+ import { FunctionContext, type FunctionContextOptions, type FunctionDefinition } from './functions';
7
+ type ObjectRef = {
8
+ type: string;
9
+ id: string;
10
+ };
11
+ /**
12
+ * Marker for sheets that are managed by an ECHO object.
13
+ * Sheet ID: `dxos.org/type/SheetType@1234`
14
+ */
15
+ export declare const createSheetName: ({ type, id }: ObjectRef) => string;
16
+ export declare const parseSheetName: (name: string) => Partial<ObjectRef>;
17
+ export type ComputeGraphEvent = 'functionsUpdated';
18
+ /**
19
+ * Per-space compute and dependency graph.
20
+ * Consists of multiple ComputeNode (corresponding to a HyperFormula sheet).
21
+ * Manages the set of custom functions.
22
+ * HyperFormula manages the dependency graph.
23
+ */
24
+ export declare class ComputeGraph extends Resource {
25
+ private readonly _hf;
26
+ private readonly _space?;
27
+ private readonly _options?;
28
+ readonly id: string;
29
+ private readonly _nodes;
30
+ private _remoteFunctions;
31
+ readonly update: Event<{
32
+ type: ComputeGraphEvent;
33
+ }>;
34
+ readonly context: FunctionContext;
35
+ constructor(_hf: HyperFormula, _space?: Space | undefined, _options?: Partial<FunctionContextOptions> | undefined);
36
+ get hf(): HyperFormula;
37
+ getFunctions({ standard, echo }?: {
38
+ standard?: boolean;
39
+ echo?: boolean;
40
+ }): FunctionDefinition[];
41
+ /**
42
+ * Get or create cell representing a sheet.
43
+ */
44
+ getOrCreateNode(name: string): ComputeNode;
45
+ /**
46
+ * Map bound value to custom function invocation.
47
+ * E.g., "HELLO(...args)" => "EDGE("HELLO", ...args)".
48
+ */
49
+ mapFormulaToNative(formula: string): string;
50
+ /**
51
+ * Map from binding to fully qualified ECHO ID (to store).
52
+ * E.g., HELLO() => spaceId:objectId()
53
+ */
54
+ mapFunctionBindingToId(formula: string): string;
55
+ /**
56
+ * Map from fully qualified ECHO ID to binding (from store).
57
+ * E.g., spaceId:objectId() => HELLO()
58
+ */
59
+ mapFunctionBindingFromId(formula: string): string;
60
+ protected _open(): Promise<void>;
61
+ protected _close(): Promise<void>;
62
+ }
63
+ export {};
64
+ //# sourceMappingURL=compute-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-graph.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-graph.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,KAAK,EAA4B,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQzC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAEL,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAExB,MAAM,aAAa,CAAC;AAQrB,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC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
+ decorators: import("@storybook/react").Decorator[];
6
+ render: (args: any) => React.JSX.Element;
7
+ };
8
+ export default _default;
9
+ export declare const Default: {};
10
+ //# sourceMappingURL=compute-graph.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-graph.stories.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-graph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAsC,MAAM,OAAO,CAAC;;;;mBAmF1C,GAAG;;AAPpB,wBAQE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=compute-graph.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-graph.test.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-graph.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { type Listeners } from 'hyperformula/typings/Emitter';
2
+ import { type ExportedCellChange } from 'hyperformula/typings/Exporter';
3
+ import { Event } from '@dxos/async';
4
+ import { Resource } from '@dxos/context';
5
+ import { type ComputeGraph } from './compute-graph';
6
+ import { type CellAddress } from '../defs';
7
+ import { type CellScalarValue } from '../types';
8
+ export type ComputeNodeEvent = {
9
+ type: keyof Listeners;
10
+ change?: ExportedCellChange;
11
+ };
12
+ /**
13
+ * Individual "sheet" (typically corresponds to an ECHO object).
14
+ */
15
+ export declare class ComputeNode extends Resource {
16
+ private readonly _graph;
17
+ readonly sheetId: number;
18
+ readonly update: Event<ComputeNodeEvent>;
19
+ constructor(_graph: ComputeGraph, sheetId: number);
20
+ get graph(): ComputeGraph;
21
+ clear(): void;
22
+ getValue(cell: CellAddress): CellScalarValue;
23
+ setValue(cell: CellAddress, value: CellScalarValue): void;
24
+ protected _open(): Promise<void>;
25
+ }
26
+ //# sourceMappingURL=compute-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-node.d.ts","sourceRoot":"","sources":["../../../../src/graph/compute-node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAEF;;GAEG;AAEH,qBAAa,WAAY,SAAQ,QAAQ;IAIrC,OAAO,CAAC,QAAQ,CAAC,MAAM;aACP,OAAO,EAAE,MAAM;IAJjC,SAAgB,MAAM,0BAAiC;gBAGpC,MAAM,EAAE,YAAY,EACrB,OAAO,EAAE,MAAM;IAKjC,IAAI,KAAK,iBAER;IAED,KAAK;IAIL,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe;IAS5C,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe;cAOzB,KAAK;CAI/B"}
@@ -1,17 +1,23 @@
1
- import { FunctionPlugin, type HyperFormula } from 'hyperformula';
1
+ import { type SimpleCellAddress } from 'hyperformula/typings/Cell';
2
2
  import { type InterpreterState } from 'hyperformula/typings/interpreter/InterpreterState';
3
3
  import { type InterpreterValue } from 'hyperformula/typings/interpreter/InterpreterValue';
4
4
  import { type ProcedureAst } from 'hyperformula/typings/parser';
5
5
  import { type UnsubscribeCallback } from '@dxos/async';
6
6
  import { type Space } from '@dxos/client/echo';
7
+ import { FunctionPlugin, type HyperFormula } from '#hyperformula';
7
8
  export type AsyncFunction = (...args: any) => Promise<InterpreterValue>;
9
+ export type FunctionUpdateEvent = {
10
+ name: string;
11
+ cell: SimpleCellAddress;
12
+ };
8
13
  export type FunctionOptions = {
9
14
  ttl?: number;
10
15
  };
11
16
  export type FunctionContextOptions = {
12
17
  defaultTtl: number;
13
- recalculationDelay: number;
18
+ debounceDelay: number;
14
19
  remoteFunctionUrl: string;
20
+ onUpdate?: (update: FunctionUpdateEvent) => void;
15
21
  };
16
22
  export declare const defaultFunctionContextOptions: FunctionContextOptions;
17
23
  /**
@@ -32,7 +38,7 @@ export declare class FunctionContext {
32
38
  private _invocations;
33
39
  private readonly _options;
34
40
  private readonly _onUpdate;
35
- constructor(_hf: HyperFormula, _space: Space | undefined, onUpdate: (context: FunctionContext) => void, _options?: Partial<FunctionContextOptions>);
41
+ constructor(_hf: HyperFormula, _space: Space | undefined, _options?: Partial<FunctionContextOptions>);
36
42
  get space(): Space | undefined;
37
43
  get remoteFunctionUrl(): string;
38
44
  get info(): {
@@ -50,8 +56,11 @@ export declare class FunctionContext {
50
56
  /**
51
57
  * Base class for async functions.
52
58
  */
53
- export declare class FunctionPluginAsync extends FunctionPlugin {
59
+ export declare class AsyncFunctionPlugin extends FunctionPlugin {
54
60
  get context(): FunctionContext;
55
- runAsyncFunction(ast: ProcedureAst, state: InterpreterState, cb: AsyncFunction, options?: FunctionOptions): import("hyperformula/typings/interpreter/InterpreterValue").RawInterpreterValue;
61
+ /**
62
+ * Immediately returns cached value then runs the async function.
63
+ */
64
+ protected runAsyncFunction(ast: ProcedureAst, state: InterpreterState, cb: AsyncFunction, options?: FunctionOptions): import("hyperformula/typings/interpreter/InterpreterValue").RawInterpreterValue;
56
65
  }
57
66
  //# sourceMappingURL=async-function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async-function.d.ts","sourceRoot":"","sources":["../../../../../src/graph/functions/async-function.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAA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