@dxos/plugin-sheet 0.6.13 → 0.6.14-main.1366248

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 (330) hide show
  1. package/dist/lib/browser/SheetContainer-JZEKRM4Z.mjs +297 -0
  2. package/dist/lib/browser/SheetContainer-JZEKRM4Z.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-BVUN7SHF.mjs +67 -0
  4. package/dist/lib/browser/chunk-BVUN7SHF.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-G2FUL6PK.mjs +1671 -0
  6. package/dist/lib/browser/chunk-G2FUL6PK.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-RABELMEQ.mjs +15 -0
  8. package/dist/lib/browser/chunk-RABELMEQ.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-D5AGLXJP.mjs → chunk-VMSX6Z4X.mjs} +659 -675
  10. package/dist/lib/browser/chunk-VMSX6Z4X.mjs.map +7 -0
  11. package/dist/lib/browser/compute-graph-GGWUX644.mjs +35 -0
  12. package/dist/lib/browser/compute-graph-GGWUX644.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +168 -67
  14. package/dist/lib/browser/index.mjs.map +4 -4
  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 +6 -12
  18. package/dist/lib/node/SheetContainer-PJE74VO4.cjs +300 -0
  19. package/dist/lib/node/SheetContainer-PJE74VO4.cjs.map +7 -0
  20. package/dist/lib/node/chunk-2ZVZI2KJ.cjs +38 -0
  21. package/dist/lib/node/chunk-2ZVZI2KJ.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-DSYKOI4E.cjs → chunk-AWKOWDMI.cjs} +34 -52
  23. package/dist/lib/node/chunk-AWKOWDMI.cjs.map +7 -0
  24. package/dist/lib/node/{chunk-5KKJ4NPP.cjs → chunk-O7XR4R7Y.cjs} +678 -674
  25. package/dist/lib/node/chunk-O7XR4R7Y.cjs.map +7 -0
  26. package/dist/lib/node/chunk-STZ7S7RF.cjs +1656 -0
  27. package/dist/lib/node/chunk-STZ7S7RF.cjs.map +7 -0
  28. package/dist/lib/node/compute-graph-KGWA2QLE.cjs +57 -0
  29. package/dist/lib/node/compute-graph-KGWA2QLE.cjs.map +7 -0
  30. package/dist/lib/node/index.cjs +178 -75
  31. package/dist/lib/node/index.cjs.map +4 -4
  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 +9 -15
  36. package/dist/lib/node/types.cjs.map +2 -2
  37. package/dist/lib/node-esm/SheetContainer-R73XEXHU.mjs +298 -0
  38. package/dist/lib/node-esm/SheetContainer-R73XEXHU.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-BM2Q3FFC.mjs +17 -0
  40. package/dist/lib/node-esm/chunk-BM2Q3FFC.mjs.map +7 -0
  41. package/dist/lib/node-esm/chunk-CR4K75EL.mjs +3220 -0
  42. package/dist/lib/node-esm/chunk-CR4K75EL.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-UIBWRHW7.mjs +68 -0
  44. package/dist/lib/node-esm/chunk-UIBWRHW7.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-V5N3Y2O5.mjs +1672 -0
  46. package/dist/lib/node-esm/chunk-V5N3Y2O5.mjs.map +7 -0
  47. package/dist/lib/node-esm/compute-graph-2SCZT7N5.mjs +36 -0
  48. package/dist/lib/node-esm/compute-graph-2SCZT7N5.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +350 -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 +13 -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 +6 -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} +5 -9
  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 +15 -0
  74. package/dist/types/src/components/GridSheet/util.d.ts.map +1 -0
  75. package/dist/types/src/components/RangeList/RangeList.d.ts +7 -0
  76. package/dist/types/src/components/RangeList/RangeList.d.ts.map +1 -0
  77. package/dist/types/src/components/RangeList/index.d.ts +2 -0
  78. package/dist/types/src/components/RangeList/index.d.ts.map +1 -0
  79. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +9 -0
  80. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +1 -0
  81. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +6 -0
  82. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -0
  83. package/dist/types/src/components/SheetContainer/index.d.ts +3 -0
  84. package/dist/types/src/components/SheetContainer/index.d.ts.map +1 -0
  85. package/dist/types/src/components/SheetContext/SheetContext.d.ts +28 -0
  86. package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +1 -0
  87. package/dist/types/src/components/SheetContext/index.d.ts +2 -0
  88. package/dist/types/src/components/SheetContext/index.d.ts.map +1 -0
  89. package/dist/types/src/components/Toolbar/Toolbar.d.ts +36 -9
  90. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
  91. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +4 -32
  92. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
  93. package/dist/types/src/components/index.d.ts +7 -4
  94. package/dist/types/src/components/index.d.ts.map +1 -1
  95. package/dist/types/src/compute-graph/compute-graph-registry.d.ts +34 -0
  96. package/dist/types/src/compute-graph/compute-graph-registry.d.ts.map +1 -0
  97. package/dist/types/src/compute-graph/compute-graph.d.ts +64 -0
  98. package/dist/types/src/compute-graph/compute-graph.d.ts.map +1 -0
  99. package/dist/types/src/compute-graph/compute-graph.stories.d.ts +6 -0
  100. package/dist/types/src/compute-graph/compute-graph.stories.d.ts.map +1 -0
  101. package/dist/types/src/compute-graph/compute-graph.test.d.ts +2 -0
  102. package/dist/types/src/compute-graph/compute-graph.test.d.ts.map +1 -0
  103. package/dist/types/src/compute-graph/compute-node.d.ts +26 -0
  104. package/dist/types/src/compute-graph/compute-node.d.ts.map +1 -0
  105. package/dist/types/src/{components/ComputeGraph → compute-graph/functions}/async-function.d.ts +14 -5
  106. package/dist/types/src/compute-graph/functions/async-function.d.ts.map +1 -0
  107. package/dist/types/src/compute-graph/functions/edge-function.d.ts +21 -0
  108. package/dist/types/src/compute-graph/functions/edge-function.d.ts.map +1 -0
  109. package/dist/types/src/{model/functions.d.ts → compute-graph/functions/function-defs.d.ts} +1 -1
  110. package/dist/types/src/compute-graph/functions/function-defs.d.ts.map +1 -0
  111. package/dist/types/src/compute-graph/functions/index.d.ts +4 -0
  112. package/dist/types/src/compute-graph/functions/index.d.ts.map +1 -0
  113. package/dist/types/src/compute-graph/hyperformula.test.d.ts +2 -0
  114. package/dist/types/src/compute-graph/hyperformula.test.d.ts.map +1 -0
  115. package/dist/types/src/compute-graph/index.d.ts +5 -0
  116. package/dist/types/src/compute-graph/index.d.ts.map +1 -0
  117. package/dist/types/src/compute-graph/testing/index.d.ts +3 -0
  118. package/dist/types/src/compute-graph/testing/index.d.ts.map +1 -0
  119. package/dist/types/src/compute-graph/testing/test-builder.d.ts +15 -0
  120. package/dist/types/src/compute-graph/testing/test-builder.d.ts.map +1 -0
  121. package/dist/types/src/compute-graph/testing/test-plugin.d.ts +36 -0
  122. package/dist/types/src/compute-graph/testing/test-plugin.d.ts.map +1 -0
  123. package/dist/types/src/compute-graph/util.d.ts +2 -0
  124. package/dist/types/src/compute-graph/util.d.ts.map +1 -0
  125. package/dist/types/src/defs/index.d.ts +4 -0
  126. package/dist/types/src/defs/index.d.ts.map +1 -0
  127. package/dist/types/src/defs/sheet-range-types.d.ts +13 -0
  128. package/dist/types/src/defs/sheet-range-types.d.ts.map +1 -0
  129. package/dist/types/src/defs/types.d.ts +28 -0
  130. package/dist/types/src/defs/types.d.ts.map +1 -0
  131. package/dist/types/src/defs/types.test.d.ts.map +1 -0
  132. package/dist/types/src/defs/util.d.ts +39 -0
  133. package/dist/types/src/defs/util.d.ts.map +1 -0
  134. package/dist/types/src/extensions/compute.d.ts +6 -0
  135. package/dist/types/src/extensions/compute.d.ts.map +1 -0
  136. package/dist/types/src/extensions/compute.stories.d.ts +21 -0
  137. package/dist/types/src/extensions/compute.stories.d.ts.map +1 -0
  138. package/dist/types/src/extensions/editor/extension.d.ts +39 -0
  139. package/dist/types/src/extensions/editor/extension.d.ts.map +1 -0
  140. package/dist/types/src/extensions/editor/extension.test.d.ts.map +1 -0
  141. package/dist/types/src/extensions/editor/index.d.ts +2 -0
  142. package/dist/types/src/extensions/editor/index.d.ts.map +1 -0
  143. package/dist/types/src/extensions/index.d.ts +3 -0
  144. package/dist/types/src/extensions/index.d.ts.map +1 -0
  145. package/dist/types/src/index.d.ts +1 -1
  146. package/dist/types/src/index.d.ts.map +1 -1
  147. package/dist/types/src/integrations/index.d.ts +2 -0
  148. package/dist/types/src/integrations/index.d.ts.map +1 -0
  149. package/dist/types/src/integrations/thread-ranges.d.ts +7 -0
  150. package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -0
  151. package/dist/types/src/meta.d.ts +4 -9
  152. package/dist/types/src/meta.d.ts.map +1 -1
  153. package/dist/types/src/model/index.d.ts +2 -3
  154. package/dist/types/src/model/index.d.ts.map +1 -1
  155. package/dist/types/src/model/{model.d.ts → sheet-model.d.ts} +22 -69
  156. package/dist/types/src/model/sheet-model.d.ts.map +1 -0
  157. package/dist/types/src/model/sheet-model.test.d.ts +2 -0
  158. package/dist/types/src/model/sheet-model.test.d.ts.map +1 -0
  159. package/dist/types/src/model/useSheetModel.d.ts +8 -0
  160. package/dist/types/src/model/useSheetModel.d.ts.map +1 -0
  161. package/dist/types/src/sanity.test.d.ts +2 -0
  162. package/dist/types/src/sanity.test.d.ts.map +1 -0
  163. package/dist/types/src/serializer.d.ts +4 -0
  164. package/dist/types/src/serializer.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 +32 -12
  170. package/dist/types/src/translations.d.ts.map +1 -1
  171. package/dist/types/src/types.d.ts +132 -43
  172. package/dist/types/src/types.d.ts.map +1 -1
  173. package/dist/vendor/hyperformula.mjs +37145 -0
  174. package/package.json +60 -61
  175. package/src/SheetPlugin.tsx +89 -78
  176. package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +37 -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 +46 -0
  181. package/src/components/GridSheet/GridSheet.tsx +358 -0
  182. package/src/components/{CellEditor/CellEditor.stories.tsx → GridSheet/SheetCellEditor.stories.tsx} +18 -15
  183. package/src/components/GridSheet/index.ts +5 -0
  184. package/src/components/GridSheet/util.ts +170 -0
  185. package/src/components/RangeList/RangeList.tsx +53 -0
  186. package/src/components/RangeList/index.ts +5 -0
  187. package/src/components/SheetContainer/SheetContainer.stories.tsx +45 -0
  188. package/src/components/SheetContainer/SheetContainer.tsx +33 -0
  189. package/src/components/SheetContainer/index.ts +7 -0
  190. package/src/components/SheetContext/SheetContext.tsx +127 -0
  191. package/src/components/SheetContext/index.ts +5 -0
  192. package/src/components/Toolbar/Toolbar.stories.tsx +9 -6
  193. package/src/components/Toolbar/Toolbar.tsx +265 -111
  194. package/src/components/index.ts +5 -3
  195. package/src/compute-graph/compute-graph-registry.ts +90 -0
  196. package/src/compute-graph/compute-graph.stories.tsx +97 -0
  197. package/src/compute-graph/compute-graph.test.ts +87 -0
  198. package/src/compute-graph/compute-graph.ts +260 -0
  199. package/src/compute-graph/compute-node.ts +62 -0
  200. package/src/{components/ComputeGraph → compute-graph/functions}/async-function.ts +26 -15
  201. package/src/{components/ComputeGraph → compute-graph/functions}/edge-function.ts +21 -17
  202. package/src/compute-graph/functions/index.ts +7 -0
  203. package/src/compute-graph/hyperformula.test.ts +14 -0
  204. package/src/compute-graph/index.ts +8 -0
  205. package/src/compute-graph/testing/index.ts +6 -0
  206. package/src/compute-graph/testing/test-builder.ts +54 -0
  207. package/src/{components/ComputeGraph/custom.ts → compute-graph/testing/test-plugin.ts} +44 -14
  208. package/src/compute-graph/util.ts +8 -0
  209. package/src/defs/index.ts +7 -0
  210. package/src/defs/sheet-range-types.ts +49 -0
  211. package/src/{model → defs}/types.test.ts +8 -9
  212. package/src/defs/types.ts +86 -0
  213. package/src/defs/util.ts +136 -0
  214. package/src/extensions/compute.stories.tsx +155 -0
  215. package/src/extensions/compute.ts +147 -0
  216. package/src/{components/CellEditor → extensions/editor}/extension.test.ts +4 -6
  217. package/src/{components/CellEditor → extensions/editor}/extension.ts +51 -27
  218. package/src/{components/CellEditor → extensions/editor}/index.ts +0 -1
  219. package/src/extensions/index.ts +6 -0
  220. package/src/index.ts +2 -2
  221. package/src/integrations/index.ts +5 -0
  222. package/src/integrations/thread-ranges.ts +101 -0
  223. package/src/meta.ts +15 -0
  224. package/src/model/index.ts +2 -3
  225. package/src/model/sheet-model.test.ts +59 -0
  226. package/src/model/sheet-model.ts +495 -0
  227. package/src/model/useSheetModel.ts +40 -0
  228. package/src/sanity.test.ts +40 -0
  229. package/src/serializer.ts +27 -0
  230. package/src/{components/Sheet → testing}/index.ts +1 -1
  231. package/src/testing/testing.tsx +68 -0
  232. package/src/translations.ts +24 -4
  233. package/src/types.ts +62 -47
  234. package/dist/lib/browser/SheetContainer-U4H5D34A.mjs +0 -1772
  235. package/dist/lib/browser/SheetContainer-U4H5D34A.mjs.map +0 -7
  236. package/dist/lib/browser/chunk-APHOLYUB.mjs +0 -175
  237. package/dist/lib/browser/chunk-APHOLYUB.mjs.map +0 -7
  238. package/dist/lib/browser/chunk-D5AGLXJP.mjs.map +0 -7
  239. package/dist/lib/browser/chunk-FUAGSXA4.mjs +0 -82
  240. package/dist/lib/browser/chunk-FUAGSXA4.mjs.map +0 -7
  241. package/dist/lib/browser/chunk-JRL5LGCE.mjs +0 -18
  242. package/dist/lib/browser/chunk-JRL5LGCE.mjs.map +0 -7
  243. package/dist/lib/browser/chunk-NU4PBN33.mjs +0 -8
  244. package/dist/lib/browser/chunk-NU4PBN33.mjs.map +0 -7
  245. package/dist/lib/browser/testing.mjs +0 -92
  246. package/dist/lib/browser/testing.mjs.map +0 -7
  247. package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs +0 -1765
  248. package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs.map +0 -7
  249. package/dist/lib/node/chunk-5KKJ4NPP.cjs.map +0 -7
  250. package/dist/lib/node/chunk-BJ6ZD7MN.cjs +0 -51
  251. package/dist/lib/node/chunk-BJ6ZD7MN.cjs.map +0 -7
  252. package/dist/lib/node/chunk-CN3RPESU.cjs +0 -202
  253. package/dist/lib/node/chunk-CN3RPESU.cjs.map +0 -7
  254. package/dist/lib/node/chunk-DSYKOI4E.cjs.map +0 -7
  255. package/dist/lib/node/chunk-PYXHNAAK.cjs +0 -40
  256. package/dist/lib/node/chunk-PYXHNAAK.cjs.map +0 -7
  257. package/dist/lib/node/testing.cjs +0 -111
  258. package/dist/lib/node/testing.cjs.map +0 -7
  259. package/dist/types/src/components/CellEditor/CellEditor.d.ts +0 -14
  260. package/dist/types/src/components/CellEditor/CellEditor.d.ts.map +0 -1
  261. package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts.map +0 -1
  262. package/dist/types/src/components/CellEditor/extension.d.ts +0 -19
  263. package/dist/types/src/components/CellEditor/extension.d.ts.map +0 -1
  264. package/dist/types/src/components/CellEditor/extension.test.d.ts.map +0 -1
  265. package/dist/types/src/components/CellEditor/index.d.ts +0 -3
  266. package/dist/types/src/components/CellEditor/index.d.ts.map +0 -1
  267. package/dist/types/src/components/ComputeGraph/async-function.d.ts.map +0 -1
  268. package/dist/types/src/components/ComputeGraph/custom.d.ts +0 -21
  269. package/dist/types/src/components/ComputeGraph/custom.d.ts.map +0 -1
  270. package/dist/types/src/components/ComputeGraph/edge-function.d.ts +0 -20
  271. package/dist/types/src/components/ComputeGraph/edge-function.d.ts.map +0 -1
  272. package/dist/types/src/components/ComputeGraph/graph-context.d.ts +0 -12
  273. package/dist/types/src/components/ComputeGraph/graph-context.d.ts.map +0 -1
  274. package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts +0 -2
  275. package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts.map +0 -1
  276. package/dist/types/src/components/ComputeGraph/graph.d.ts +0 -26
  277. package/dist/types/src/components/ComputeGraph/graph.d.ts.map +0 -1
  278. package/dist/types/src/components/Sheet/Sheet.d.ts +0 -55
  279. package/dist/types/src/components/Sheet/Sheet.d.ts.map +0 -1
  280. package/dist/types/src/components/Sheet/Sheet.stories.d.ts +0 -54
  281. package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +0 -1
  282. package/dist/types/src/components/Sheet/formatting.d.ts +0 -14
  283. package/dist/types/src/components/Sheet/formatting.d.ts.map +0 -1
  284. package/dist/types/src/components/Sheet/grid.d.ts +0 -52
  285. package/dist/types/src/components/Sheet/grid.d.ts.map +0 -1
  286. package/dist/types/src/components/Sheet/index.d.ts +0 -2
  287. package/dist/types/src/components/Sheet/index.d.ts.map +0 -1
  288. package/dist/types/src/components/Sheet/nav.d.ts +0 -29
  289. package/dist/types/src/components/Sheet/nav.d.ts.map +0 -1
  290. package/dist/types/src/components/Sheet/sheet-context.d.ts +0 -25
  291. package/dist/types/src/components/Sheet/sheet-context.d.ts.map +0 -1
  292. package/dist/types/src/components/Sheet/util.d.ts +0 -18
  293. package/dist/types/src/components/Sheet/util.d.ts.map +0 -1
  294. package/dist/types/src/components/SheetContainer.d.ts +0 -9
  295. package/dist/types/src/components/SheetContainer.d.ts.map +0 -1
  296. package/dist/types/src/components/Toolbar/common.d.ts +0 -20
  297. package/dist/types/src/components/Toolbar/common.d.ts.map +0 -1
  298. package/dist/types/src/model/functions.d.ts.map +0 -1
  299. package/dist/types/src/model/model.browser.test.d.ts +0 -2
  300. package/dist/types/src/model/model.browser.test.d.ts.map +0 -1
  301. package/dist/types/src/model/model.d.ts.map +0 -1
  302. package/dist/types/src/model/types.d.ts +0 -17
  303. package/dist/types/src/model/types.d.ts.map +0 -1
  304. package/dist/types/src/model/types.test.d.ts.map +0 -1
  305. package/dist/types/src/model/util.d.ts +0 -15
  306. package/dist/types/src/model/util.d.ts.map +0 -1
  307. package/dist/types/src/testing.d.ts +0 -9
  308. package/dist/types/src/testing.d.ts.map +0 -1
  309. package/src/components/CellEditor/CellEditor.tsx +0 -113
  310. package/src/components/ComputeGraph/graph-context.tsx +0 -50
  311. package/src/components/ComputeGraph/graph.browser.test.ts +0 -50
  312. package/src/components/ComputeGraph/graph.ts +0 -62
  313. package/src/components/Sheet/Sheet.stories.tsx +0 -287
  314. package/src/components/Sheet/Sheet.tsx +0 -1160
  315. package/src/components/Sheet/formatting.ts +0 -106
  316. package/src/components/Sheet/grid.ts +0 -191
  317. package/src/components/Sheet/nav.ts +0 -157
  318. package/src/components/Sheet/sheet-context.tsx +0 -150
  319. package/src/components/Sheet/util.ts +0 -56
  320. package/src/components/SheetContainer.tsx +0 -34
  321. package/src/components/Toolbar/common.tsx +0 -72
  322. package/src/meta.tsx +0 -18
  323. package/src/model/model.browser.test.ts +0 -100
  324. package/src/model/model.ts +0 -550
  325. package/src/model/types.ts +0 -71
  326. package/src/model/util.ts +0 -36
  327. package/src/testing.ts +0 -50
  328. /package/dist/types/src/{model → defs}/types.test.d.ts +0 -0
  329. /package/dist/types/src/{components/CellEditor → extensions/editor}/extension.test.d.ts +0 -0
  330. /package/src/{model/functions.ts → compute-graph/functions/function-defs.ts} +0 -0
@@ -1,55 +0,0 @@
1
- import React, { type CSSProperties, type PropsWithChildren } from 'react';
2
- import { type ThemedClassName } from '@dxos/react-ui';
3
- import { type GridLayoutProps, type SizeMap } from './grid';
4
- import { type GridSize } from './nav';
5
- import { type SheetContextProps } from './sheet-context';
6
- import { type CellIndex, type CellAddress } from '../../model';
7
- type SheetRootProps = SheetContextProps;
8
- type SheetMainProps = ThemedClassName<Partial<GridSize>>;
9
- type ResizeProps = {
10
- sizes?: SizeMap;
11
- onResize?: (idx: CellIndex, size: number, save?: boolean) => void;
12
- };
13
- type MoveProps = {
14
- onMove?: (from: number, to: number) => void;
15
- };
16
- type RowColumnSelection = {
17
- selected?: number;
18
- onSelect?: (selected: number) => void;
19
- };
20
- type SheetRowsProps = {
21
- rows: CellIndex[];
22
- } & RowColumnSelection & ResizeProps & MoveProps;
23
- type SheetColumnsProps = {
24
- columns: CellIndex[];
25
- } & RowColumnSelection & ResizeProps & MoveProps;
26
- type SheetGridProps = GridLayoutProps & {
27
- size: GridSize;
28
- };
29
- type SheetCellProps = {
30
- id: string;
31
- cell: CellAddress;
32
- style: CSSProperties;
33
- active: boolean;
34
- onSelect?: (selected: CellAddress, edit: boolean) => void;
35
- };
36
- export declare const Sheet: {
37
- Root: ({ children, ...props }: PropsWithChildren<SheetContextProps>) => React.JSX.Element;
38
- Main: React.ForwardRefExoticComponent<Omit<Partial<GridSize>, "className"> & {
39
- classNames?: import("@dxos/react-ui").ClassNameValue;
40
- } & React.RefAttributes<HTMLDivElement>>;
41
- Rows: React.ForwardRefExoticComponent<{
42
- rows: CellIndex[];
43
- } & RowColumnSelection & ResizeProps & MoveProps & React.RefAttributes<HTMLDivElement>>;
44
- Columns: React.ForwardRefExoticComponent<{
45
- columns: CellIndex[];
46
- } & RowColumnSelection & ResizeProps & MoveProps & React.RefAttributes<HTMLDivElement>>;
47
- Grid: React.ForwardRefExoticComponent<GridLayoutProps & {
48
- size: GridSize;
49
- } & React.RefAttributes<HTMLDivElement>>;
50
- Cell: ({ id, cell, style, active, onSelect }: SheetCellProps) => React.JSX.Element;
51
- StatusBar: () => React.JSX.Element;
52
- Debug: () => React.JSX.Element;
53
- };
54
- export type { SheetRootProps, SheetMainProps, SheetRowsProps, SheetColumnsProps, SheetGridProps, SheetCellProps };
55
- //# sourceMappingURL=Sheet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EACZ,KAAK,aAAa,EAElB,KAAK,iBAAiB,EAOvB,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,OAAO,EAYb,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,KAAK,QAAQ,EAA6C,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,KAAK,iBAAiB,EAAyC,MAAM,iBAAiB,CAAC;AAEhG,OAAO,EACL,KAAK,SAAS,EACd,KAAK,WAAW,EAKjB,MAAM,aAAa,CAAC;AAuDrB,KAAK,cAAc,GAAG,iBAAiB,CAAC;AAUxC,KAAK,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AA2NzD,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACnE,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAgBF,KAAK,cAAc,GAAG;IAAE,IAAI,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG,kBAAkB,GAAG,WAAW,GAAG,SAAS,CAAC;AAkK3F,KAAK,iBAAiB,GAAG;IAAE,OAAO,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG,kBAAkB,GAAG,WAAW,GAAG,SAAS,CAAC;AAmKjG,KAAK,cAAc,GAAG,eAAe,GAAG;IACtC,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AA+RF,KAAK,cAAc,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3D,CAAC;AAkJF,eAAO,MAAM,KAAK;mCA7/ByB,iBAAiB,CAAC,iBAAiB,CAAC;;;;;cA+PjD,SAAS,EAAE;;;iBAkKL,SAAS,EAAE;;;cAoKvC,QAAQ;;kDAwS0C,cAAc;;;CAyJvE,CAAC;AAEF,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC"}
@@ -1,54 +0,0 @@
1
- import '@dxos-theme';
2
- import { type Decorator } from '@storybook/react';
3
- import React from 'react';
4
- import { type SizeMap } from './grid';
5
- declare const _default: {
6
- title: string;
7
- component: {
8
- Root: ({ children, ...props }: React.PropsWithChildren<import("./sheet-context").SheetContextProps>) => React.JSX.Element;
9
- Main: React.ForwardRefExoticComponent<Omit<Partial<import("./nav").GridSize>, "className"> & {
10
- classNames?: import("@dxos/react-ui").ClassNameValue;
11
- } & React.RefAttributes<HTMLDivElement>>;
12
- Rows: React.ForwardRefExoticComponent<{
13
- rows: import("../../model").CellIndex[];
14
- } & {
15
- selected?: number;
16
- onSelect?: (selected: number) => void;
17
- } & {
18
- sizes?: SizeMap;
19
- onResize?: (idx: import("../../model").CellIndex, size: number, save?: boolean) => void;
20
- } & {
21
- onMove?: (from: number, to: number) => void;
22
- } & React.RefAttributes<HTMLDivElement>>;
23
- Columns: React.ForwardRefExoticComponent<{
24
- columns: import("../../model").CellIndex[];
25
- } & {
26
- selected?: number;
27
- onSelect?: (selected: number) => void;
28
- } & {
29
- sizes?: SizeMap;
30
- onResize?: (idx: import("../../model").CellIndex, size: number, save?: boolean) => void;
31
- } & {
32
- onMove?: (from: number, to: number) => void;
33
- } & React.RefAttributes<HTMLDivElement>>;
34
- Grid: React.ForwardRefExoticComponent<import("./grid").GridLayoutProps & {
35
- size: import("./nav").GridSize;
36
- } & React.RefAttributes<HTMLDivElement>>;
37
- Cell: ({ id, cell, style, active, onSelect }: import("./Sheet").SheetCellProps) => React.JSX.Element;
38
- StatusBar: () => React.JSX.Element;
39
- Debug: () => React.JSX.Element;
40
- };
41
- decorators: Decorator[];
42
- };
43
- export default _default;
44
- export declare const Default: () => React.JSX.Element | null;
45
- export declare const Debug: () => React.JSX.Element | null;
46
- export declare const Rows: () => React.JSX.Element | null;
47
- export declare const Columns: () => React.JSX.Element | null;
48
- export declare const Main: () => React.JSX.Element | null;
49
- /**
50
- * Scrolling container with fixed border that overlaps the border of inner elements.
51
- */
52
- export declare const ScrollLayout: () => React.JSX.Element;
53
- export declare const GridLayout: () => React.JSX.Element;
54
- //# sourceMappingURL=Sheet.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Sheet.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/Sheet.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAA0C,MAAM,OAAO,CAAC;AAW/D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;;;;;;;;;;;;;;;gFA6Q0nF,CAAC;;;;;;;;;;;gFAAD,CAAC;;;;;;;;;;;;;AAtKjqF,wBAIE;AAEF,eAAO,MAAM,OAAO,gCAanB,CAAC;AAEF,eAAO,MAAM,KAAK,gCAajB,CAAC;AAEF,eAAO,MAAM,IAAI,gCAiBhB,CAAC;AAEF,eAAO,MAAM,OAAO,gCAiBnB,CAAC;AAEF,eAAO,MAAM,IAAI,gCAqBhB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,yBAkBxB,CAAC;AAEF,eAAO,MAAM,UAAU,yBActB,CAAC"}
@@ -1,14 +0,0 @@
1
- import { type ClassNameValue } from '@dxos/react-ui-types';
2
- import { type SheetModel, type CellAddress } from '../../model';
3
- export declare class FormattingModel {
4
- private readonly model;
5
- constructor(model: SheetModel);
6
- /**
7
- * Get formatted string value and className for cell.
8
- */
9
- getFormatting(cell: CellAddress): {
10
- value?: string;
11
- classNames?: ClassNameValue;
12
- };
13
- }
14
- //# sourceMappingURL=formatting.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/formatting.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAW,MAAM,aAAa,CAAC;AAGzE,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,UAAU;IAE9C;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,cAAc,CAAA;KAAE;CA0FlF"}
@@ -1,52 +0,0 @@
1
- import { type MouseEvent } from 'react';
2
- import { type CellAddress, type CellIndex } from '../../model';
3
- export type SizeMap = Record<string, number>;
4
- export type RowPosition = {
5
- row: number;
6
- } & Pick<DOMRect, 'top' | 'height'>;
7
- export type ColumnPosition = {
8
- column: number;
9
- } & Pick<DOMRect, 'left' | 'width'>;
10
- export declare const axisWidth = "calc(var(--rail-size)-2px)";
11
- export declare const axisHeight = 34;
12
- export declare const minWidth = 40;
13
- export declare const maxWidth = 800;
14
- export declare const minHeight = 34;
15
- export declare const maxHeight = 400;
16
- export declare const defaultWidth = 200;
17
- export declare const defaultHeight = 34;
18
- /**
19
- * Cell nodes are identified by their A1 notation.
20
- */
21
- export declare const CELL_DATA_KEY = "cell";
22
- export type GridLayoutProps = {
23
- rows: CellIndex[];
24
- columns: CellIndex[];
25
- rowSizes?: SizeMap;
26
- columnSizes?: SizeMap;
27
- };
28
- export type GridLayout = {
29
- width: number;
30
- height: number;
31
- rowRange: RowPosition[];
32
- columnRange: ColumnPosition[];
33
- };
34
- /**
35
- * Calculates the grid geometry for the current viewport.
36
- */
37
- export declare const useGridLayout: ({ scroller, size, rows, columns, rowSizes, columnSizes, }: GridLayoutProps & {
38
- scroller: HTMLDivElement | null;
39
- size: {
40
- width: number;
41
- height: number;
42
- };
43
- }) => GridLayout;
44
- /**
45
- * Find child node at mouse pointer.
46
- */
47
- export declare const getCellAtPointer: (event: MouseEvent) => CellAddress | undefined;
48
- /**
49
- * Get element.
50
- */
51
- export declare const getCellElement: (root: HTMLElement, cell: CellAddress) => HTMLElement | null;
52
- //# sourceMappingURL=grid.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/grid.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAA8C,MAAM,aAAa,CAAC;AAK3G,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;AAC5E,MAAM,MAAM,cAAc,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;AAElF,eAAO,MAAM,SAAS,+BAA+B,CAAC;AACtD,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,eAAO,MAAM,QAAQ,MAAM,CAAC;AAE5B,eAAO,MAAM,SAAS,KAAa,CAAC;AACpC,eAAO,MAAM,SAAS,MAAM,CAAC;AAE7B,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,KAAY,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,8DAOvB,eAAe,GAAG;IACnB,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC,KAAG,UA4GH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,UAAW,UAAU,KAAG,WAAW,GAAG,SASlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,SAAU,WAAW,QAAQ,WAAW,KAAG,WAAW,GAAG,IAGnF,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './Sheet';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC"}
@@ -1,29 +0,0 @@
1
- import { type KeyboardEvent, type MouseEventHandler } from 'react';
2
- import { type CellAddress, type CellRange } from '../../model';
3
- export type GridSize = {
4
- numRows: number;
5
- numColumns: number;
6
- };
7
- /**
8
- * Calculate next range based on arrow keys.
9
- */
10
- export declare const handleNav: (ev: KeyboardEvent<HTMLInputElement>, cursor: CellAddress | undefined, range: CellRange | undefined, size: GridSize) => {
11
- cursor?: CellAddress;
12
- range?: CellRange;
13
- };
14
- /**
15
- * Calculate next cell based on arrow keys.
16
- */
17
- export declare const handleArrowNav: (ev: Pick<KeyboardEvent<HTMLInputElement>, "key" | "metaKey">, cursor: CellAddress | undefined, { numRows, numColumns }: GridSize) => CellAddress | undefined;
18
- /**
19
- * Hook to manage range drag handlers.
20
- */
21
- export declare const useRangeSelect: (cb: (event: "start" | "move" | "end", range: CellRange | undefined) => void) => {
22
- range: CellRange | undefined;
23
- handlers: {
24
- onMouseDown: MouseEventHandler<HTMLDivElement>;
25
- onMouseMove: MouseEventHandler<HTMLDivElement>;
26
- onMouseUp: MouseEventHandler<HTMLDivElement>;
27
- };
28
- };
29
- //# sourceMappingURL=nav.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/nav.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAG7E,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAa,MAAM,aAAa,CAAC;AAE1E,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,OAChB,aAAa,CAAC,gBAAgB,CAAC,UAC3B,WAAW,GAAG,SAAS,SACxB,SAAS,GAAG,SAAS,QACtB,QAAQ,KACb;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAoC3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,OACrB,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,UACpD,WAAW,GAAG,SAAS,2BACN,QAAQ,KAChC,WAAW,GAAG,SAmChB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,cAAc,OACrB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,KAC1E;IACD,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE;QACR,WAAW,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;QAC/C,WAAW,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;QAC/C,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;KAC9C,CAAC;CAwCH,CAAC"}
@@ -1,25 +0,0 @@
1
- import React, { type PropsWithChildren } from 'react';
2
- import { type Space } from '@dxos/react-client/echo';
3
- import { FormattingModel } from './formatting';
4
- import { type CellAddress, type CellRange, SheetModel } from '../../model';
5
- import { type SheetType } from '../../types';
6
- import { type FunctionContextOptions } from '../ComputeGraph';
7
- export type SheetContextType = {
8
- model: SheetModel;
9
- formatting: FormattingModel;
10
- cursor?: CellAddress;
11
- setCursor: (cell: CellAddress | undefined) => void;
12
- range?: CellRange;
13
- setRange: (range: CellRange | undefined) => void;
14
- editing: boolean;
15
- setEditing: (editing: boolean) => void;
16
- onInfo?: () => void;
17
- };
18
- export declare const useSheetContext: () => SheetContextType;
19
- export type SheetContextProps = {
20
- sheet: SheetType;
21
- space: Space;
22
- readonly?: boolean;
23
- } & Pick<SheetContextType, 'onInfo'> & Partial<FunctionContextOptions>;
24
- export declare const SheetContextProvider: ({ children, sheet, space, readonly, onInfo, ...options }: PropsWithChildren<SheetContextProps>) => React.JSX.Element | null;
25
- //# sourceMappingURL=sheet-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sheet-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/sheet-context.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAkD,MAAM,OAAO,CAAC;AAItG,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAoB,UAAU,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAO9D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,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,OAAO,CAAC;IACjB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAIvC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAIF,eAAO,MAAM,eAAe,QAAO,gBAIlC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAClC,OAAO,CAAC,sBAAsB,CAAC,CAAC;AA2ClC,eAAO,MAAM,oBAAoB,6DAO9B,iBAAiB,CAAC,iBAAiB,CAAC,6BA8CtC,CAAC"}
@@ -1,18 +0,0 @@
1
- /**
2
- * Gets the relative client rect of an element within a parent container.
3
- * NOTE: This is stable even when the parent is scrolling.
4
- * https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect
5
- * @param root Parent container (e.g., scrollable container).
6
- * @param element
7
- */
8
- export declare const getRelativeClientRect: (root: HTMLElement, element: HTMLElement) => DOMRect;
9
- /**
10
- * Union of two rectangles.
11
- */
12
- export declare const getRectUnion: (b1: DOMRect, b2: DOMRect) => Pick<DOMRect, "left" | "top" | "width" | "height">;
13
- /**
14
- * Scroll to cell.
15
- * We need to correct for the DOM `scrollIntoView` function which doesn't show the border.
16
- */
17
- export declare const scrollIntoView: (scrollContainer: HTMLElement, el: HTMLElement) => void;
18
- //# sourceMappingURL=util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/util.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,SAAU,WAAW,WAAW,WAAW,KAAG,OAS/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,OAAQ,OAAO,MAAM,OAAO,KAAG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAOxG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,oBAAqB,WAAW,MAAM,WAAW,SAiB3E,CAAC"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { type LayoutCoordinate } from '@dxos/app-framework';
3
- import { type SheetRootProps } from './Sheet';
4
- declare const SheetContainer: ({ sheet, space, role, remoteFunctionUrl, }: SheetRootProps & {
5
- role?: string;
6
- coordinate?: LayoutCoordinate;
7
- }) => React.JSX.Element;
8
- export default SheetContainer;
9
- //# sourceMappingURL=SheetContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SheetContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/SheetContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAErD,QAAA,MAAM,cAAc,+CAKjB,cAAc,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAAE,sBAenE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,20 +0,0 @@
1
- import { type Icon } from '@phosphor-icons/react';
2
- import React from 'react';
3
- import { type ToolbarButtonProps as NaturalToolbarButtonProps, type ToolbarToggleGroupItemProps as NaturalToolbarToggleGroupItemProps } from '@dxos/react-ui';
4
- export declare const iconStyles: string;
5
- export declare const buttonStyles = "min-bs-0 p-2";
6
- export declare const tooltipProps: {
7
- side: "top";
8
- classNames: string;
9
- };
10
- export declare const ToolbarSeparator: () => React.JSX.Element;
11
- type ToolbarButtonProps = NaturalToolbarButtonProps & {
12
- Icon: Icon;
13
- };
14
- export declare const ToolbarButton: ({ Icon, children, ...props }: ToolbarButtonProps) => React.JSX.Element;
15
- export type ToolbarToggleButtonProps = NaturalToolbarToggleGroupItemProps & {
16
- Icon: Icon;
17
- };
18
- export declare const ToolbarToggleButton: ({ Icon, children, ...props }: ToolbarToggleButtonProps) => React.JSX.Element;
19
- export {};
20
- //# sourceMappingURL=common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/common.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAGL,KAAK,kBAAkB,IAAI,yBAAyB,EACpD,KAAK,2BAA2B,IAAI,kCAAkC,EACvE,MAAM,gBAAgB,CAAC;AAKxB,eAAO,MAAM,UAAU,QAAa,CAAC;AACrC,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,YAAY;;;CAA+C,CAAC;AAEzE,eAAO,MAAM,gBAAgB,yBAAkD,CAAC;AAMhF,KAAK,kBAAkB,GAAG,yBAAyB,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAErE,eAAO,MAAM,aAAa,iCAAkC,kBAAkB,sBAiB7E,CAAC;AAMF,MAAM,MAAM,wBAAwB,GAAG,kCAAkC,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAE3F,eAAO,MAAM,mBAAmB,iCAAkC,wBAAwB,sBAiBzF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../../src/model/functions.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,EA42EhD,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=model.browser.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.browser.test.d.ts","sourceRoot":"","sources":["../../../../src/model/model.browser.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../src/model/model.ts"],"names":[],"mappings":"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"}
@@ -1,17 +0,0 @@
1
- export declare const MAX_COLUMNS: number;
2
- export type CellAddress = {
3
- column: number;
4
- row: number;
5
- };
6
- export type CellRange = {
7
- from: CellAddress;
8
- to?: CellAddress;
9
- };
10
- 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;
13
- export declare const addressFromA1Notation: (ref: string) => CellAddress;
14
- export declare const rangeToA1Notation: (range: CellRange) => string;
15
- export declare const rangeFromA1Notation: (ref: string) => CellRange;
16
- export declare const inRange: (range: CellRange | undefined, cell: CellAddress) => boolean;
17
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/model/types.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,QAAU,CAAC;AAEnC,MAAM,MAAM,WAAW,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1D,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,EAAE,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAEhE,eAAO,MAAM,SAAS,MAAO,WAAW,GAAG,SAAS,KAAK,WAAW,GAAG,SAAS,YAE/E,CAAC;AAEF,eAAO,MAAM,YAAY,WAAY,MAAM,KAAG,MAM7C,CAAC;AAEF,eAAO,MAAM,mBAAmB,oBAAqB,WAAW,KAAG,MAElE,CAAC;AAEF,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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../../../src/model/types.test.ts"],"names":[],"mappings":""}
@@ -1,15 +0,0 @@
1
- export declare class ApiError extends Error {
2
- }
3
- export declare class ReadonlyException extends ApiError {
4
- }
5
- export declare class RangeException extends ApiError {
6
- constructor(n: number);
7
- }
8
- /**
9
- * With a string length of 8, the chance of a collision is 0.02% for a sheet with 10,000 strings.
10
- */
11
- export declare const createIndex: (length?: number) => string;
12
- export declare const createIndices: (length: number) => string[];
13
- export declare const pickOne: <T>(values: T[]) => T;
14
- export declare const pickSome: <T>(values: T[], n?: number) => T[];
15
- //# sourceMappingURL=util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/model/util.ts"],"names":[],"mappings":"AAOA,qBAAa,QAAS,SAAQ,KAAK;CAAG;AACtC,qBAAa,iBAAkB,SAAQ,QAAQ;CAAG;AAClD,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;AAG3G,eAAO,MAAM,OAAO,GAAI,CAAC,UAAU,CAAC,EAAE,KAAG,CAAsD,CAAC;AAChG,eAAO,MAAM,QAAQ,GAAI,CAAC,UAAU,CAAC,EAAE,iBAAU,CAAC,EAMjD,CAAC"}
@@ -1,9 +0,0 @@
1
- import { type ComputeGraph } from './components';
2
- import { type CellValue } from './types';
3
- export declare const testSheetName = "test";
4
- export declare const createCells: () => Record<string, CellValue>;
5
- export declare const createTestSheet: ({ name, graph, }?: {
6
- name?: string;
7
- graph?: ComputeGraph;
8
- }) => Promise<import("./types").SheetType>;
9
- //# sourceMappingURL=testing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,cAAc,CAAC;AAErE,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,eAAO,MAAM,WAAW,QAAO,MAAM,CAAC,MAAM,EAAE,SAAS,CA0BrD,CAAC;AAEH,eAAO,MAAM,eAAe,sBAGzB;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAA;CAAE,yCAQzC,CAAC"}
@@ -1,113 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { type Extension } from '@codemirror/state';
6
- import { EditorView, keymap } from '@codemirror/view';
7
- import React, { type DOMAttributes, type KeyboardEvent } from 'react';
8
-
9
- import { useThemeContext } from '@dxos/react-ui';
10
- import {
11
- type UseTextEditorProps,
12
- createBasicExtensions,
13
- createThemeExtensions,
14
- preventNewline,
15
- useTextEditor,
16
- } from '@dxos/react-ui-editor';
17
-
18
- export type EditorKeysProps = {
19
- onClose: (value: string | undefined) => void;
20
- onNav?: (value: string | undefined, ev: Pick<KeyboardEvent<HTMLInputElement>, 'key'>) => void;
21
- };
22
-
23
- export const editorKeys = ({ onNav, onClose }: EditorKeysProps): Extension => {
24
- return keymap.of([
25
- {
26
- key: 'ArrowUp',
27
- run: (editor) => {
28
- const value = editor.state.doc.toString();
29
- onNav?.(value, { key: 'ArrowUp' });
30
- return !!onNav;
31
- },
32
- },
33
- {
34
- key: 'ArrowDown',
35
- run: (editor) => {
36
- const value = editor.state.doc.toString();
37
- onNav?.(value, { key: 'ArrowDown' });
38
- return !!onNav;
39
- },
40
- },
41
- {
42
- key: 'ArrowLeft',
43
- run: (editor) => {
44
- const value = editor.state.doc.toString();
45
- onNav?.(value, { key: 'ArrowLeft' });
46
- return !!onNav;
47
- },
48
- },
49
- {
50
- key: 'ArrowRight',
51
- run: (editor) => {
52
- const value = editor.state.doc.toString();
53
- onNav?.(value, { key: 'ArrowRight' });
54
- return !!onNav;
55
- },
56
- },
57
- {
58
- key: 'Enter',
59
- run: (editor) => {
60
- onClose(editor.state.doc.toString());
61
- return true;
62
- },
63
- },
64
- {
65
- key: 'Escape',
66
- run: () => {
67
- onClose(undefined);
68
- return true;
69
- },
70
- },
71
- ]);
72
- };
73
-
74
- export type CellEditorProps = {
75
- value?: string;
76
- extension?: Extension;
77
- } & Pick<UseTextEditorProps, 'autoFocus'> &
78
- Pick<DOMAttributes<HTMLInputElement>, 'onBlur' | 'onKeyDown'>;
79
-
80
- export const CellEditor = ({ value, extension, autoFocus, onBlur }: CellEditorProps) => {
81
- const { themeMode } = useThemeContext();
82
- const { parentRef } = useTextEditor(() => {
83
- return {
84
- autoFocus,
85
- initialValue: value,
86
- selection: { anchor: value?.length ?? 0 },
87
- extensions: [
88
- extension ?? [],
89
- preventNewline,
90
- EditorView.focusChangeEffect.of((_, focusing) => {
91
- if (!focusing) {
92
- onBlur?.({ type: 'blur' } as any);
93
- }
94
- return null;
95
- }),
96
- createBasicExtensions({ lineWrapping: false }),
97
- createThemeExtensions({
98
- themeMode,
99
- slots: {
100
- editor: {
101
- className: 'flex w-full [&>.cm-scroller]:scrollbar-none',
102
- },
103
- content: {
104
- className: '!px-2 !py-1',
105
- },
106
- },
107
- }),
108
- ],
109
- };
110
- }, [extension]);
111
-
112
- return <div ref={parentRef} className='flex w-full' />;
113
- };
@@ -1,50 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import React, { createContext, type PropsWithChildren, useContext, useEffect } from 'react';
6
-
7
- import { type Space } from '@dxos/react-client/echo';
8
-
9
- import { type FunctionContextOptions } from './async-function';
10
- import { CustomPlugin, CustomPluginTranslations } from './custom';
11
- import { EdgeFunctionPlugin, EdgeFunctionPluginTranslations } from './edge-function';
12
- import { createComputeGraph, type ComputeGraph } from './graph';
13
-
14
- export type ComputeGraphContextType = {
15
- graphs: Record<string, ComputeGraph>;
16
- setGraph: (key: string, graph: ComputeGraph) => void;
17
- };
18
-
19
- export const ComputeGraphContext = createContext<ComputeGraphContextType>({ graphs: {}, setGraph: () => {} });
20
-
21
- export const ComputeGraphContextProvider = ({
22
- children,
23
- graphs,
24
- setGraph,
25
- }: PropsWithChildren<ComputeGraphContextType>) => {
26
- return <ComputeGraphContext.Provider value={{ graphs, setGraph }}>{children}</ComputeGraphContext.Provider>;
27
- };
28
-
29
- export const useComputeGraph = (space: Space, options?: Partial<FunctionContextOptions>): ComputeGraph => {
30
- const { graphs, setGraph } = useContext(ComputeGraphContext);
31
- const graph =
32
- graphs[space.id] ??
33
- createComputeGraph(
34
- [
35
- { plugin: EdgeFunctionPlugin, translations: EdgeFunctionPluginTranslations },
36
- // TODO(wittjosiah): Remove. Needed for current test sheet generated data.
37
- { plugin: CustomPlugin, translations: CustomPluginTranslations },
38
- ],
39
- space,
40
- options,
41
- );
42
-
43
- useEffect(() => {
44
- if (!graphs[space.id]) {
45
- setGraph(space.id, graph);
46
- }
47
- }, [space]);
48
-
49
- return graph;
50
- };
@@ -1,50 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { expect } from 'chai';
6
- import { describe, test } from 'vitest';
7
-
8
- import { Trigger } from '@dxos/async';
9
-
10
- import { CustomPlugin, CustomPluginTranslations } from './custom';
11
- import { createComputeGraph } from './graph';
12
- import { addressFromA1Notation, SheetModel } from '../../model';
13
- import { type CellScalarValue, createSheet } from '../../types';
14
-
15
- /**
16
- * VITEST_ENV=chrome p vitest --watch
17
- * NOTE: Browser test required for hyperformula due to raw translation files.
18
- */
19
- describe('compute graph', () => {
20
- const createModel = async () => {
21
- const graph = createComputeGraph([{ plugin: CustomPlugin, translations: CustomPluginTranslations }]);
22
- const sheet = createSheet();
23
- const model = new SheetModel(graph, sheet, undefined, { rows: 5, columns: 5 });
24
- graph.update.on(() => model.update.emit());
25
- return { graph, model };
26
- };
27
-
28
- test('async function', async () => {
29
- const { graph, model } = await createModel();
30
-
31
- // Triggers function.
32
- model.setValue(addressFromA1Notation('A1'), '=TEST()');
33
-
34
- const trigger = new Trigger<CellScalarValue>();
35
- model.update.on(() => {
36
- const value = model.getValue(addressFromA1Notation('A1'));
37
- trigger.wake(value);
38
- });
39
-
40
- // Get initial value (i.e., null).
41
- const v1 = model.getValue(addressFromA1Notation('A1'));
42
- expect(v1).to.be.null;
43
- expect(graph.context.info.invocations.TEST).to.eq(undefined);
44
-
45
- // Wait until async update triggered.
46
- const v2 = await trigger.wait();
47
- expect(v2).not.to.be.null;
48
- expect(graph.context.info.invocations.TEST).to.eq(1);
49
- });
50
- });