@dxos/plugin-sheet 0.8.4-main.72ec0f3 → 0.8.4-main.765dc60934

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 (350) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs +46 -0
  3. package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs.map +7 -0
  4. package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs +33 -0
  5. package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs.map +7 -0
  6. package/dist/lib/neutral/SheetPlugin.mjs +48 -0
  7. package/dist/lib/neutral/SheetPlugin.mjs.map +7 -0
  8. package/dist/lib/neutral/SheetPlugin.node.mjs +27 -0
  9. package/dist/lib/neutral/SheetPlugin.node.mjs.map +7 -0
  10. package/dist/lib/neutral/anchor-sort-TTCKGX7V.mjs +22 -0
  11. package/dist/lib/neutral/anchor-sort-TTCKGX7V.mjs.map +7 -0
  12. package/dist/lib/neutral/capabilities/index.mjs +25 -0
  13. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  14. package/dist/lib/{browser/chunk-7VEWYJJN.mjs → neutral/chunk-4SBAIU6F.mjs} +15 -15
  15. package/dist/lib/neutral/chunk-4SBAIU6F.mjs.map +7 -0
  16. package/dist/lib/neutral/chunk-FZWVUKE2.mjs +8 -0
  17. package/dist/lib/neutral/chunk-FZWVUKE2.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  19. package/dist/lib/neutral/chunk-KC2SMDNF.mjs +373 -0
  20. package/dist/lib/neutral/chunk-KC2SMDNF.mjs.map +7 -0
  21. package/dist/lib/neutral/chunk-YFY6U524.mjs +83 -0
  22. package/dist/lib/neutral/chunk-YFY6U524.mjs.map +7 -0
  23. package/dist/lib/{browser/chunk-FWFAAGXL.mjs → neutral/chunk-ZWOQCLH7.mjs} +2 -9
  24. package/dist/lib/neutral/chunk-ZWOQCLH7.mjs.map +7 -0
  25. package/dist/lib/neutral/comment-config-ZBWNCJMZ.mjs +20 -0
  26. package/dist/lib/neutral/comment-config-ZBWNCJMZ.mjs.map +7 -0
  27. package/dist/lib/neutral/components/index.mjs +1551 -0
  28. package/dist/lib/neutral/components/index.mjs.map +7 -0
  29. package/dist/lib/neutral/compute-graph-registry-IEQBF5XZ.mjs +20 -0
  30. package/dist/lib/neutral/compute-graph-registry-IEQBF5XZ.mjs.map +7 -0
  31. package/dist/lib/neutral/containers/index.mjs +11 -0
  32. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  33. package/dist/lib/neutral/create-object-OKQAXJCW.mjs +27 -0
  34. package/dist/lib/neutral/create-object-OKQAXJCW.mjs.map +7 -0
  35. package/dist/lib/neutral/drop-axis-G6UOXG54.mjs +23 -0
  36. package/dist/lib/neutral/drop-axis-G6UOXG54.mjs.map +7 -0
  37. package/dist/lib/{node-esm/types → neutral}/index.mjs +14 -3
  38. package/dist/lib/neutral/insert-axis-ZFFNG22G.mjs +16 -0
  39. package/dist/lib/neutral/insert-axis-ZFFNG22G.mjs.map +7 -0
  40. package/dist/lib/neutral/markdown-I2AKJYPF.mjs +28 -0
  41. package/dist/lib/neutral/markdown-I2AKJYPF.mjs.map +7 -0
  42. package/dist/lib/neutral/meta.json +1 -0
  43. package/dist/lib/neutral/meta.mjs +8 -0
  44. package/dist/lib/neutral/meta.mjs.map +7 -0
  45. package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs +13 -0
  46. package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs.map +7 -0
  47. package/dist/lib/neutral/operations/index.mjs +8 -0
  48. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  49. package/dist/lib/neutral/plugin.mjs +16 -0
  50. package/dist/lib/neutral/plugin.mjs.map +7 -0
  51. package/dist/lib/neutral/react-surface-VSTQNVPT.mjs +44 -0
  52. package/dist/lib/neutral/react-surface-VSTQNVPT.mjs.map +7 -0
  53. package/dist/lib/neutral/restore-axis-44DM6N54.mjs +16 -0
  54. package/dist/lib/neutral/restore-axis-44DM6N54.mjs.map +7 -0
  55. package/dist/lib/neutral/scroll-to-anchor-QPOGMAQG.mjs +33 -0
  56. package/dist/lib/neutral/scroll-to-anchor-QPOGMAQG.mjs.map +7 -0
  57. package/dist/lib/neutral/state-HPA27MX2.mjs +29 -0
  58. package/dist/lib/neutral/state-HPA27MX2.mjs.map +7 -0
  59. package/dist/lib/neutral/testing/index.mjs +103 -0
  60. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  61. package/dist/lib/neutral/translations.mjs +55 -0
  62. package/dist/lib/neutral/translations.mjs.map +7 -0
  63. package/dist/lib/{browser → neutral}/types/index.mjs +6 -2
  64. package/dist/lib/neutral/types/index.mjs.map +7 -0
  65. package/dist/lib/neutral/undo-mappings-3FQLSTCZ.mjs +31 -0
  66. package/dist/lib/neutral/undo-mappings-3FQLSTCZ.mjs.map +7 -0
  67. package/dist/types/src/SheetPlugin.d.ts +3 -1
  68. package/dist/types/src/SheetPlugin.d.ts.map +1 -1
  69. package/dist/types/src/SheetPlugin.node.d.ts +4 -0
  70. package/dist/types/src/SheetPlugin.node.d.ts.map +1 -0
  71. package/dist/types/src/SheetPlugin.test.d.ts +2 -0
  72. package/dist/types/src/SheetPlugin.test.d.ts.map +1 -0
  73. package/dist/types/src/capabilities/anchor-sort.d.ts +4 -2
  74. package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/comment-config.d.ts +12 -0
  76. package/dist/types/src/capabilities/comment-config.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/compute-graph-registry.d.ts +3 -2
  78. package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +1 -1
  79. package/dist/types/src/capabilities/create-object.d.ts +11 -0
  80. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/index.d.ts +23 -6
  82. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  83. package/dist/types/src/capabilities/markdown.d.ts +3 -2
  84. package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  86. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  87. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  88. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/state.d.ts +6 -0
  90. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
  92. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
  93. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts +1 -1
  94. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -1
  95. package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
  96. package/dist/types/src/components/Sheet/Sheet.d.ts +17 -0
  97. package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -0
  98. package/dist/types/src/components/Sheet/index.d.ts +2 -0
  99. package/dist/types/src/components/Sheet/index.d.ts.map +1 -0
  100. package/dist/types/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.d.ts +1 -1
  101. package/dist/types/src/components/SheetContent/SheetCellEditor.stories.d.ts.map +1 -0
  102. package/dist/types/src/components/SheetContent/SheetContent.d.ts +6 -0
  103. package/dist/types/src/components/SheetContent/SheetContent.d.ts.map +1 -0
  104. package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts +93 -0
  105. package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts.map +1 -0
  106. package/dist/types/src/components/SheetContent/index.d.ts +2 -0
  107. package/dist/types/src/components/SheetContent/index.d.ts.map +1 -0
  108. package/dist/types/src/components/{GridSheet → SheetContent}/util.d.ts +1 -1
  109. package/dist/types/src/components/SheetContent/util.d.ts.map +1 -0
  110. package/dist/types/src/components/{SheetContext/SheetContext.d.ts → SheetRoot/SheetRoot.d.ts} +8 -6
  111. package/dist/types/src/components/SheetRoot/SheetRoot.d.ts.map +1 -0
  112. package/dist/types/src/components/SheetRoot/index.d.ts +2 -0
  113. package/dist/types/src/components/SheetRoot/index.d.ts.map +1 -0
  114. package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts +6 -0
  115. package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts.map +1 -0
  116. package/dist/types/src/components/SheetStatusbar/index.d.ts +2 -0
  117. package/dist/types/src/components/SheetStatusbar/index.d.ts.map +1 -0
  118. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts +5 -5
  119. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
  120. package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts +72 -66
  121. package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
  122. package/dist/types/src/components/SheetToolbar/align.d.ts +14 -21
  123. package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
  124. package/dist/types/src/components/SheetToolbar/style.d.ts +14 -20
  125. package/dist/types/src/components/SheetToolbar/style.d.ts.map +1 -1
  126. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts +14 -1
  127. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts.map +1 -1
  128. package/dist/types/src/components/index.d.ts +1 -4
  129. package/dist/types/src/components/index.d.ts.map +1 -1
  130. package/dist/types/src/containers/RangeList/RangeList.d.ts +7 -0
  131. package/dist/types/src/containers/RangeList/RangeList.d.ts.map +1 -0
  132. package/dist/types/src/containers/RangeList/index.d.ts +2 -0
  133. package/dist/types/src/containers/RangeList/index.d.ts.map +1 -0
  134. package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts +12 -0
  135. package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts.map +1 -0
  136. package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts +92 -0
  137. package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts.map +1 -0
  138. package/dist/types/src/containers/SheetArticle/index.d.ts +2 -0
  139. package/dist/types/src/containers/SheetArticle/index.d.ts.map +1 -0
  140. package/dist/types/src/containers/index.d.ts +4 -0
  141. package/dist/types/src/containers/index.d.ts.map +1 -0
  142. package/dist/types/src/extensions/compute.d.ts +1 -1
  143. package/dist/types/src/extensions/compute.d.ts.map +1 -1
  144. package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
  145. package/dist/types/src/extensions/editor/sheet-extension.d.ts +1 -1
  146. package/dist/types/src/extensions/editor/sheet-extension.d.ts.map +1 -1
  147. package/dist/types/src/index.d.ts +2 -2
  148. package/dist/types/src/index.d.ts.map +1 -1
  149. package/dist/types/src/integrations/thread-ranges.d.ts +1 -3
  150. package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
  151. package/dist/types/src/meta.d.ts +2 -2
  152. package/dist/types/src/meta.d.ts.map +1 -1
  153. package/dist/types/src/model/sheet-model.d.ts +4 -4
  154. package/dist/types/src/model/sheet-model.d.ts.map +1 -1
  155. package/dist/types/src/model/testing.d.ts +1 -1
  156. package/dist/types/src/model/testing.d.ts.map +1 -1
  157. package/dist/types/src/model/useSheetModel.d.ts +2 -2
  158. package/dist/types/src/model/useSheetModel.d.ts.map +1 -1
  159. package/dist/types/src/operations/drop-axis.d.ts +5 -0
  160. package/dist/types/src/operations/drop-axis.d.ts.map +1 -0
  161. package/dist/types/src/operations/index.d.ts +3 -0
  162. package/dist/types/src/operations/index.d.ts.map +1 -0
  163. package/dist/types/src/operations/insert-axis.d.ts +5 -0
  164. package/dist/types/src/operations/insert-axis.d.ts.map +1 -0
  165. package/dist/types/src/operations/restore-axis.d.ts +5 -0
  166. package/dist/types/src/operations/restore-axis.d.ts.map +1 -0
  167. package/dist/types/src/operations/scroll-to-anchor.d.ts +5 -0
  168. package/dist/types/src/operations/scroll-to-anchor.d.ts.map +1 -0
  169. package/dist/types/src/playwright/playwright.config.d.ts.map +1 -1
  170. package/dist/types/src/playwright/sheet-manager.d.ts.map +1 -1
  171. package/dist/types/src/plugin.d.ts +4 -0
  172. package/dist/types/src/plugin.d.ts.map +1 -0
  173. package/dist/types/src/serializer.d.ts +2 -2
  174. package/dist/types/src/serializer.d.ts.map +1 -1
  175. package/dist/types/src/testing/data.d.ts +1 -1
  176. package/dist/types/src/testing/data.d.ts.map +1 -1
  177. package/dist/types/src/testing/testing.d.ts +17 -17
  178. package/dist/types/src/testing/testing.d.ts.map +1 -1
  179. package/dist/types/src/translations.d.ts +74 -38
  180. package/dist/types/src/translations.d.ts.map +1 -1
  181. package/dist/types/src/types/Sheet.d.ts +41 -35
  182. package/dist/types/src/types/Sheet.d.ts.map +1 -1
  183. package/dist/types/src/types/SheetCapabilities.d.ts +16 -0
  184. package/dist/types/src/types/SheetCapabilities.d.ts.map +1 -0
  185. package/dist/types/src/types/SheetOperation.d.ts +45 -0
  186. package/dist/types/src/types/SheetOperation.d.ts.map +1 -0
  187. package/dist/types/src/types/index.d.ts +3 -1
  188. package/dist/types/src/types/index.d.ts.map +1 -1
  189. package/dist/types/src/types/sheet-range-types.d.ts +1 -1
  190. package/dist/types/src/types/sheet-range-types.d.ts.map +1 -1
  191. package/dist/types/src/types/types.d.ts +2 -68
  192. package/dist/types/src/types/types.d.ts.map +1 -1
  193. package/dist/types/src/types/util.d.ts +3 -2
  194. package/dist/types/src/types/util.d.ts.map +1 -1
  195. package/dist/types/tsconfig.tsbuildinfo +1 -1
  196. package/package.json +130 -81
  197. package/src/SheetPlugin.node.ts +21 -0
  198. package/src/SheetPlugin.test.ts +30 -0
  199. package/src/SheetPlugin.tsx +37 -68
  200. package/src/capabilities/anchor-sort.ts +19 -13
  201. package/src/capabilities/comment-config.ts +24 -0
  202. package/src/capabilities/compute-graph-registry.ts +19 -13
  203. package/src/capabilities/create-object.ts +30 -0
  204. package/src/capabilities/index.ts +16 -8
  205. package/src/capabilities/markdown.ts +21 -13
  206. package/src/capabilities/operation-handler.ts +16 -0
  207. package/src/capabilities/react-surface.tsx +38 -30
  208. package/src/capabilities/state.ts +29 -0
  209. package/src/capabilities/undo-mappings.ts +30 -0
  210. package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +1 -1
  211. package/src/components/ComputeGraph/compute-graph.stories.tsx +25 -17
  212. package/src/components/Sheet/Sheet.tsx +20 -0
  213. package/src/components/Sheet/index.ts +5 -0
  214. package/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.tsx +14 -10
  215. package/src/components/{GridSheet/GridSheet.stories.tsx → SheetContent/SheetContent.stories.tsx} +21 -20
  216. package/src/components/{GridSheet/GridSheet.tsx → SheetContent/SheetContent.tsx} +68 -50
  217. package/src/components/{RangeList → SheetContent}/index.ts +1 -1
  218. package/src/components/{GridSheet → SheetContent}/util.ts +8 -7
  219. package/src/components/{SheetContext/SheetContext.tsx → SheetRoot/SheetRoot.tsx} +55 -42
  220. package/src/components/{GridSheet → SheetRoot}/index.ts +1 -1
  221. package/src/components/{FunctionEditor/FunctionEditor.tsx → SheetStatusbar/SheetStatusbar.tsx} +20 -8
  222. package/src/components/{FunctionEditor → SheetStatusbar}/index.ts +1 -1
  223. package/src/components/SheetToolbar/SheetToolbar.stories.tsx +5 -5
  224. package/src/components/SheetToolbar/SheetToolbar.tsx +46 -39
  225. package/src/components/SheetToolbar/align.ts +50 -25
  226. package/src/components/SheetToolbar/style.ts +52 -22
  227. package/src/components/SheetToolbar/useToolbarState.ts +22 -5
  228. package/src/components/index.ts +1 -7
  229. package/src/{components → containers}/RangeList/RangeList.tsx +23 -18
  230. package/src/containers/RangeList/index.ts +5 -0
  231. package/src/containers/SheetArticle/SheetArticle.stories.tsx +110 -0
  232. package/src/containers/SheetArticle/SheetArticle.tsx +57 -0
  233. package/src/containers/SheetArticle/index.ts +5 -0
  234. package/src/containers/index.ts +8 -0
  235. package/src/extensions/compute.stories.tsx +31 -21
  236. package/src/extensions/compute.ts +2 -2
  237. package/src/extensions/editor/sheet-extension.test.ts +1 -1
  238. package/src/extensions/editor/sheet-extension.ts +18 -15
  239. package/src/index.ts +2 -2
  240. package/src/integrations/thread-ranges.ts +19 -56
  241. package/src/meta.ts +3 -3
  242. package/src/model/sheet-model.test.ts +5 -5
  243. package/src/model/sheet-model.ts +80 -48
  244. package/src/model/testing.ts +2 -2
  245. package/src/model/useSheetModel.ts +3 -2
  246. package/src/operations/drop-axis.ts +26 -0
  247. package/src/operations/index.ts +12 -0
  248. package/src/operations/insert-axis.ts +19 -0
  249. package/src/operations/restore-axis.ts +19 -0
  250. package/src/operations/scroll-to-anchor.ts +30 -0
  251. package/src/playwright/playwright.config.ts +1 -1
  252. package/src/playwright/sheet.spec.ts +4 -3
  253. package/src/plugin.ts +11 -0
  254. package/src/sanity.test.ts +10 -3
  255. package/src/serializer.ts +3 -3
  256. package/src/testing/data.ts +1 -1
  257. package/src/testing/testing.tsx +4 -4
  258. package/src/translations.ts +41 -35
  259. package/src/types/Sheet.ts +32 -32
  260. package/src/types/SheetCapabilities.ts +26 -0
  261. package/src/types/SheetOperation.ts +75 -0
  262. package/src/types/index.ts +4 -1
  263. package/src/types/sheet-range-types.ts +3 -3
  264. package/src/types/types.ts +4 -40
  265. package/src/types/util.ts +3 -2
  266. package/dist/lib/browser/SheetContainer-66BNB3XG.mjs +0 -349
  267. package/dist/lib/browser/SheetContainer-66BNB3XG.mjs.map +0 -7
  268. package/dist/lib/browser/anchor-sort-FCQ5OZZK.mjs +0 -23
  269. package/dist/lib/browser/anchor-sort-FCQ5OZZK.mjs.map +0 -7
  270. package/dist/lib/browser/chunk-73AV3NH6.mjs +0 -15
  271. package/dist/lib/browser/chunk-73AV3NH6.mjs.map +0 -7
  272. package/dist/lib/browser/chunk-7VEWYJJN.mjs.map +0 -7
  273. package/dist/lib/browser/chunk-DVJ3QW3F.mjs +0 -907
  274. package/dist/lib/browser/chunk-DVJ3QW3F.mjs.map +0 -7
  275. package/dist/lib/browser/chunk-FWFAAGXL.mjs.map +0 -7
  276. package/dist/lib/browser/chunk-OU5KTWY3.mjs +0 -852
  277. package/dist/lib/browser/chunk-OU5KTWY3.mjs.map +0 -7
  278. package/dist/lib/browser/compute-graph-registry-AP5RA7W3.mjs +0 -21
  279. package/dist/lib/browser/compute-graph-registry-AP5RA7W3.mjs.map +0 -7
  280. package/dist/lib/browser/index.mjs +0 -154
  281. package/dist/lib/browser/index.mjs.map +0 -7
  282. package/dist/lib/browser/intent-resolver-66OAYVQF.mjs +0 -56
  283. package/dist/lib/browser/intent-resolver-66OAYVQF.mjs.map +0 -7
  284. package/dist/lib/browser/markdown-B6VKYY2S.mjs +0 -26
  285. package/dist/lib/browser/markdown-B6VKYY2S.mjs.map +0 -7
  286. package/dist/lib/browser/meta.json +0 -1
  287. package/dist/lib/browser/react-surface-5GYLVSMR.mjs +0 -54
  288. package/dist/lib/browser/react-surface-5GYLVSMR.mjs.map +0 -7
  289. package/dist/lib/node-esm/SheetContainer-NWEQETAY.mjs +0 -350
  290. package/dist/lib/node-esm/SheetContainer-NWEQETAY.mjs.map +0 -7
  291. package/dist/lib/node-esm/anchor-sort-ZE7IS7SH.mjs +0 -24
  292. package/dist/lib/node-esm/anchor-sort-ZE7IS7SH.mjs.map +0 -7
  293. package/dist/lib/node-esm/chunk-44YTKTMP.mjs +0 -16
  294. package/dist/lib/node-esm/chunk-44YTKTMP.mjs.map +0 -7
  295. package/dist/lib/node-esm/chunk-4H2EHVWE.mjs +0 -908
  296. package/dist/lib/node-esm/chunk-4H2EHVWE.mjs.map +0 -7
  297. package/dist/lib/node-esm/chunk-4MT3JJU2.mjs +0 -853
  298. package/dist/lib/node-esm/chunk-4MT3JJU2.mjs.map +0 -7
  299. package/dist/lib/node-esm/chunk-4QV4AGWK.mjs +0 -236
  300. package/dist/lib/node-esm/chunk-4QV4AGWK.mjs.map +0 -7
  301. package/dist/lib/node-esm/chunk-HILDMVPL.mjs +0 -29
  302. package/dist/lib/node-esm/chunk-HILDMVPL.mjs.map +0 -7
  303. package/dist/lib/node-esm/compute-graph-registry-UMQ5UYCL.mjs +0 -22
  304. package/dist/lib/node-esm/compute-graph-registry-UMQ5UYCL.mjs.map +0 -7
  305. package/dist/lib/node-esm/index.mjs +0 -155
  306. package/dist/lib/node-esm/index.mjs.map +0 -7
  307. package/dist/lib/node-esm/intent-resolver-VNKIMQQT.mjs +0 -57
  308. package/dist/lib/node-esm/intent-resolver-VNKIMQQT.mjs.map +0 -7
  309. package/dist/lib/node-esm/markdown-VKY7HXU2.mjs +0 -27
  310. package/dist/lib/node-esm/markdown-VKY7HXU2.mjs.map +0 -7
  311. package/dist/lib/node-esm/meta.json +0 -1
  312. package/dist/lib/node-esm/react-surface-RK32YZWR.mjs +0 -55
  313. package/dist/lib/node-esm/react-surface-RK32YZWR.mjs.map +0 -7
  314. package/dist/types/src/capabilities/capabilities.d.ts +0 -5
  315. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  316. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  317. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  318. package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts +0 -3
  319. package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts.map +0 -1
  320. package/dist/types/src/components/FunctionEditor/index.d.ts +0 -2
  321. package/dist/types/src/components/FunctionEditor/index.d.ts.map +0 -1
  322. package/dist/types/src/components/GridSheet/GridSheet.d.ts +0 -3
  323. package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +0 -1
  324. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +0 -54
  325. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +0 -1
  326. package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +0 -1
  327. package/dist/types/src/components/GridSheet/index.d.ts +0 -2
  328. package/dist/types/src/components/GridSheet/index.d.ts.map +0 -1
  329. package/dist/types/src/components/GridSheet/util.d.ts.map +0 -1
  330. package/dist/types/src/components/RangeList/RangeList.d.ts +0 -7
  331. package/dist/types/src/components/RangeList/RangeList.d.ts.map +0 -1
  332. package/dist/types/src/components/RangeList/index.d.ts +0 -2
  333. package/dist/types/src/components/RangeList/index.d.ts.map +0 -1
  334. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +0 -11
  335. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +0 -1
  336. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +0 -55
  337. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +0 -1
  338. package/dist/types/src/components/SheetContainer/index.d.ts +0 -3
  339. package/dist/types/src/components/SheetContainer/index.d.ts.map +0 -1
  340. package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +0 -1
  341. package/dist/types/src/components/SheetContext/index.d.ts +0 -2
  342. package/dist/types/src/components/SheetContext/index.d.ts.map +0 -1
  343. package/src/capabilities/capabilities.ts +0 -14
  344. package/src/capabilities/intent-resolver.ts +0 -38
  345. package/src/components/SheetContainer/SheetContainer.stories.tsx +0 -93
  346. package/src/components/SheetContainer/SheetContainer.tsx +0 -41
  347. package/src/components/SheetContainer/index.ts +0 -7
  348. package/src/components/SheetContext/index.ts +0 -5
  349. /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  350. /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
@@ -18,10 +18,10 @@ import { type SyntaxNode } from '@lezer/common';
18
18
  import { tags } from '@lezer/highlight';
19
19
  import { spreadsheet } from 'codemirror-lang-spreadsheet';
20
20
 
21
- import { type FunctionDefinition } from '@dxos/compute';
22
- import { RANGE_NOTATION } from '@dxos/compute';
23
- import { singleValueFacet } from '@dxos/react-ui-editor';
24
- import { mx } from '@dxos/react-ui-theme';
21
+ import { type FunctionDefinition } from '@dxos/compute-hyperformula';
22
+ import { RANGE_NOTATION } from '@dxos/compute-hyperformula';
23
+ import { singleValueFacet } from '@dxos/ui-editor';
24
+ import { mx } from '@dxos/ui-theme';
25
25
 
26
26
  /**
27
27
  * https://codemirror.net/examples/styling
@@ -33,30 +33,30 @@ const highlightStyles = HighlightStyle.define([
33
33
  // Function.
34
34
  {
35
35
  tag: tags.name,
36
- class: 'text-accentText',
36
+ class: 'text-accent-text',
37
37
  },
38
38
  // Range.
39
39
  {
40
40
  tag: tags.tagName,
41
- class: 'text-pinkText',
41
+ class: 'text-pink-text',
42
42
  },
43
43
  // Values.
44
44
  {
45
45
  tag: tags.number,
46
- class: 'text-tealText',
46
+ class: 'text-teal-text',
47
47
  },
48
48
  {
49
49
  tag: tags.bool,
50
- class: 'text-tealText',
50
+ class: 'text-teal-text',
51
51
  },
52
52
  {
53
53
  tag: tags.string,
54
- class: 'text-tealText',
54
+ class: 'text-teal-text',
55
55
  },
56
56
  // Error.
57
57
  {
58
58
  tag: tags.invalid,
59
- class: 'text-unAccent',
59
+ class: 'text-un-accent',
60
60
  },
61
61
  ]);
62
62
 
@@ -75,7 +75,10 @@ export type SheetExtensionOptions = {
75
75
  * https://hyperformula.handsontable.com/guide/key-concepts.html#grammar
76
76
  */
77
77
  export const sheetExtension = ({ debug, functions = [] }: SheetExtensionOptions): Extension => {
78
- const { extension, language } = spreadsheet({ idiom: 'en-US', decimalSeparator: '.' });
78
+ const { extension, language } = spreadsheet({
79
+ idiom: 'en-US',
80
+ decimalSeparator: '.',
81
+ });
79
82
 
80
83
  const createCompletion = (name: string) => {
81
84
  const { section = 'Custom', description, syntax } = functions.find((value) => value.name === name) ?? {};
@@ -94,7 +97,7 @@ export const sheetExtension = ({ debug, functions = [] }: SheetExtensionOptions)
94
97
 
95
98
  const title = document.createElement('h2');
96
99
  title.innerText = name;
97
- title.className = 'text-lg font-mono text-accentText';
100
+ title.className = 'text-lg font-mono text-accent-text';
98
101
  root.appendChild(title);
99
102
 
100
103
  if (description) {
@@ -107,7 +110,7 @@ export const sheetExtension = ({ debug, functions = [] }: SheetExtensionOptions)
107
110
  if (syntax) {
108
111
  const detail = document.createElement('pre');
109
112
  detail.innerText = syntax;
110
- detail.className = 'whitespace-pre-wrap text-greenText';
113
+ detail.className = 'whitespace-pre-wrap text-green-text';
111
114
  root.appendChild(detail);
112
115
  }
113
116
 
@@ -166,8 +169,8 @@ export const sheetExtension = ({ debug, functions = [] }: SheetExtensionOptions)
166
169
  icons: false,
167
170
  tooltipClass: () =>
168
171
  mx(
169
- '!-left-[1px] !top-[33px] !-m-0 border !border-t-0 [&>ul]:!min-w-[198px]',
170
- '[&>ul>li[aria-selected]]:!bg-accentSurface',
172
+ '!-left-[1px] !top-[33px] !-m-0 border border-h-0! [&>ul]:!min-w-[198px]',
173
+ '[&>ul>li[aria-selected]]:!bg-accent-surface',
171
174
  'border-separator',
172
175
  ),
173
176
  }),
package/src/index.ts CHANGED
@@ -2,6 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export { SheetCapabilities } from './capabilities';
6
5
  export * from './meta';
7
- export * from './SheetPlugin';
6
+ export * from './operations';
7
+ export * from './types';
@@ -2,23 +2,19 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import * as Function from 'effect/Function';
6
- import * as Schema from 'effect/Schema';
7
5
  import { useCallback, useEffect, useMemo } from 'react';
8
6
 
9
- import { LayoutAction, chain, createIntent, createResolver } from '@dxos/app-framework';
10
- import { useIntentDispatcher, useIntentResolver } from '@dxos/app-framework/react';
7
+ import { useOperationInvoker } from '@dxos/app-framework/ui';
8
+ import { LayoutOperation } from '@dxos/app-toolkit';
11
9
  import { debounce } from '@dxos/async';
12
- import { type CellAddress, type CompleteCellRange, inRange } from '@dxos/compute';
13
- import { Obj, Relation } from '@dxos/echo';
14
- import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
15
- import { Thread, ThreadAction } from '@dxos/plugin-thread/types';
16
- import { Filter, Query, getSpace, useQuery } from '@dxos/react-client/echo';
17
- import { type DxGridElement, type GridContentProps } from '@dxos/react-ui-grid';
18
- import { AnchoredTo } from '@dxos/types';
10
+ import { type CellAddress, type CompleteCellRange, inRange } from '@dxos/compute-hyperformula';
11
+ import { Filter, Obj, Query, Relation } from '@dxos/echo';
12
+ import { ThreadOperation } from '@dxos/plugin-thread';
13
+ import { useQuery } from '@dxos/react-client/echo';
14
+ import { linkedSegment } from '@dxos/react-ui-attention';
15
+ import { AnchoredTo, Thread } from '@dxos/types';
19
16
 
20
- import { useSheetContext } from '../components';
21
- import { meta } from '../meta';
17
+ import { useSheetContext } from '#components';
22
18
 
23
19
  export const completeCellRangeToThreadCursor = (range: CompleteCellRange): string => {
24
20
  return `${range.from.col},${range.from.row},${range.to.col},${range.to.row}`;
@@ -37,45 +33,12 @@ export const parseThreadAnchorAsCellRange = (cursor: string): CompleteCellRange
37
33
  }
38
34
  };
39
35
 
40
- export const useUpdateFocusedCellOnThreadSelection = (grid: DxGridElement | null) => {
41
- const { model, setActiveRefs } = useSheetContext();
42
- const scrollIntoViewResolver = useMemo(
43
- () =>
44
- createResolver({
45
- intent: LayoutAction.ScrollIntoView,
46
- position: 'hoist',
47
- filter: (
48
- data,
49
- ): data is {
50
- part: 'current';
51
- subject: string;
52
- options: { cursor: string; ref: GridContentProps['activeRefs'] };
53
- } => {
54
- if (!Schema.is(LayoutAction.ScrollIntoView.fields.input)(data)) {
55
- return false;
56
- }
57
-
58
- return data.subject === Obj.getDXN(model.sheet).toString() && !!data.options?.cursor;
59
- },
60
- resolve: ({ options: { cursor, ref } }) => {
61
- setActiveRefs(ref);
62
- // TODO(Zan): Everywhere we refer to the cursor in a thread context should change to `anchor`.
63
- const range = parseThreadAnchorAsCellRange(cursor!);
64
- range && grid?.setFocus({ ...range.to, plane: 'grid' }, true);
65
- },
66
- }),
67
- [model.sheet, setActiveRefs],
68
- );
69
-
70
- useIntentResolver(meta.id, scrollIntoViewResolver);
71
- };
72
-
73
36
  export const useSelectThreadOnCellFocus = () => {
74
37
  const { model, cursor } = useSheetContext();
75
- const { dispatchPromise: dispatch } = useIntentDispatcher();
38
+ const { invokePromise } = useOperationInvoker();
76
39
 
77
- const space = getSpace(model.sheet);
78
- const anchors = useQuery(space, Query.select(Filter.ids(model.sheet.id)).targetOf(AnchoredTo.AnchoredTo));
40
+ const db = Obj.getDatabase(model.sheet);
41
+ const anchors = useQuery(db, Query.select(Filter.id(model.sheet.id)).targetOf(AnchoredTo.AnchoredTo));
79
42
 
80
43
  const selectClosestThread = useCallback(
81
44
  (cellAddress: CellAddress) => {
@@ -94,15 +57,15 @@ export const useSelectThreadOnCellFocus = () => {
94
57
  });
95
58
 
96
59
  if (closestThread) {
97
- const primary = Obj.getDXN(model.sheet).toString();
98
- const intent = Function.pipe(
99
- createIntent(ThreadAction.Select, { current: Obj.getDXN(closestThread).toString() }),
100
- chain(DeckAction.ChangeCompanion, { primary, companion: `${primary}${ATTENDABLE_PATH_SEPARATOR}comments` }),
101
- );
102
- void dispatch(intent);
60
+ void (async () => {
61
+ await invokePromise(ThreadOperation.Select, { current: Relation.getDXN(closestThread).toString() });
62
+ await invokePromise(LayoutOperation.UpdateCompanion, {
63
+ subject: linkedSegment('comments'),
64
+ });
65
+ })();
103
66
  }
104
67
  },
105
- [dispatch, anchors],
68
+ [invokePromise, anchors],
106
69
  );
107
70
 
108
71
  const debounced = useMemo(() => {
package/src/meta.ts CHANGED
@@ -2,11 +2,11 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
- export const meta: PluginMeta = {
9
- id: 'dxos.org/plugin/sheet',
8
+ export const meta: Plugin.Meta = {
9
+ id: 'org.dxos.plugin.sheet',
10
10
  name: 'Sheet',
11
11
  description: trim`
12
12
  Full-featured spreadsheet application with over 400 built-in formulas for calculations and data analysis.
@@ -5,12 +5,12 @@
5
5
  import { afterEach, beforeEach, describe, expect, onTestFinished, test } from 'vitest';
6
6
 
7
7
  import { Trigger } from '@dxos/async';
8
- import { type CellScalarValue, addressFromA1Notation, isFormula } from '@dxos/compute';
9
- import { TestBuilder, testFunctionPlugins } from '@dxos/compute/testing';
10
- import { Function } from '@dxos/functions';
8
+ import { Operation } from '@dxos/compute';
9
+ import { type CellScalarValue, addressFromA1Notation, isFormula } from '@dxos/compute-hyperformula';
10
+ import { TestBuilder, testFunctionPlugins } from '@dxos/compute-hyperformula/testing';
11
11
  import { log } from '@dxos/log';
12
12
 
13
- import { Sheet, mapFormulaIndicesToRefs, mapFormulaRefsToIndices } from '../types';
13
+ import { Sheet, mapFormulaIndicesToRefs, mapFormulaRefsToIndices } from '#types';
14
14
 
15
15
  import { SheetModel } from './sheet-model';
16
16
  import { createTestGrid } from './testing';
@@ -18,7 +18,7 @@ import { createTestGrid } from './testing';
18
18
  describe('SheetModel', () => {
19
19
  let testBuilder: TestBuilder;
20
20
  beforeEach(async () => {
21
- testBuilder = new TestBuilder({ types: [Function.Function], plugins: testFunctionPlugins });
21
+ testBuilder = new TestBuilder({ types: [Operation.PersistentOperation], plugins: testFunctionPlugins });
22
22
  await testBuilder.open();
23
23
  });
24
24
  afterEach(async () => {
@@ -20,10 +20,10 @@ import {
20
20
  addressToA1Notation,
21
21
  createSheetName,
22
22
  isFormula,
23
- } from '@dxos/compute';
23
+ } from '@dxos/compute-hyperformula';
24
24
  import { Resource } from '@dxos/context';
25
25
  import { Obj } from '@dxos/echo';
26
- import { FormatEnum, TypeEnum } from '@dxos/echo/internal';
26
+ import { Format, TypeEnum } from '@dxos/echo/internal';
27
27
  import { invariant } from '@dxos/invariant';
28
28
  import { PublicKey } from '@dxos/keys';
29
29
  import { log } from '@dxos/log';
@@ -38,22 +38,22 @@ import {
38
38
  insertIndices,
39
39
  mapFormulaIndicesToRefs,
40
40
  mapFormulaRefsToIndices,
41
- } from '../types';
42
- import { type Sheet, type SheetAction } from '../types';
41
+ } from '#types';
42
+ import { type Sheet, type SheetAction } from '#types';
43
43
 
44
44
  // TODO(burdon): Move to compute.
45
45
  // Map sheet types to system types.
46
46
  // https://hyperformula.handsontable.com/guide/types-of-values.html
47
47
  // - https://github.com/handsontable/hyperformula/blob/master/src/Cell.ts (CellValueType)
48
48
  // - https://github.com/handsontable/hyperformula/blob/master/src/interpreter/InterpreterValue.ts (NumberType)
49
- const typeMap: Record<string, { type: TypeEnum; format?: FormatEnum }> = {
49
+ const typeMap: Record<string, { type: TypeEnum; format?: Format.TypeFormat }> = {
50
50
  BOOLEAN: { type: TypeEnum.Boolean },
51
51
  NUMBER_RAW: { type: TypeEnum.Number },
52
- NUMBER_PERCENT: { type: TypeEnum.Number, format: FormatEnum.Percent },
53
- NUMBER_CURRENCY: { type: TypeEnum.Number, format: FormatEnum.Currency },
54
- NUMBER_DATETIME: { type: TypeEnum.String, format: FormatEnum.DateTime },
55
- NUMBER_DATE: { type: TypeEnum.String, format: FormatEnum.Date },
56
- NUMBER_TIME: { type: TypeEnum.String, format: FormatEnum.Time },
52
+ NUMBER_PERCENT: { type: TypeEnum.Number, format: Format.TypeFormat.Percent },
53
+ NUMBER_CURRENCY: { type: TypeEnum.Number, format: Format.TypeFormat.Currency },
54
+ NUMBER_DATETIME: { type: TypeEnum.String, format: Format.TypeFormat.DateTime },
55
+ NUMBER_DATE: { type: TypeEnum.String, format: Format.TypeFormat.Date },
56
+ NUMBER_TIME: { type: TypeEnum.String, format: Format.TypeFormat.Time },
57
57
  };
58
58
 
59
59
  const getTopLeft = (range: CellRange): CellAddress => {
@@ -122,7 +122,9 @@ export class SheetModel extends Resource {
122
122
  */
123
123
  protected override async _open(): Promise<void> {
124
124
  log('initialize', { id: this.id });
125
- initialize(this._sheet);
125
+ Obj.update(this._sheet, (obj) => {
126
+ initialize(obj);
127
+ });
126
128
 
127
129
  this._graph.update.on((event) => {
128
130
  if (event.type === 'functionsUpdated') {
@@ -181,13 +183,19 @@ export class SheetModel extends Resource {
181
183
  }
182
184
 
183
185
  insertRows(i: number, n = 1): string[] {
184
- const idx = insertIndices(this._sheet.rows, i, n, MAX_ROWS);
186
+ let idx: string[] = [];
187
+ Obj.update(this._sheet, (obj) => {
188
+ idx = insertIndices(obj.rows, i, n, MAX_ROWS);
189
+ });
185
190
  this.reset();
186
191
  return idx;
187
192
  }
188
193
 
189
194
  insertColumns(i: number, n = 1): string[] {
190
- const idx = insertIndices(this._sheet.columns, i, n, MAX_COLS);
195
+ let idx: string[] = [];
196
+ Obj.update(this._sheet, (obj) => {
197
+ idx = insertIndices(obj.columns, i, n, MAX_COLS);
198
+ });
191
199
  this.reset();
192
200
  return idx;
193
201
  }
@@ -200,8 +208,10 @@ export class SheetModel extends Resource {
200
208
  const values = this.getCellValues(range).flat();
201
209
  const index = this._sheet.rows.indexOf(rowIndex);
202
210
  this.clear(range);
203
- this._sheet.rows.splice(index, 1);
204
- delete this._sheet.rowMeta[rowIndex];
211
+ Obj.update(this._sheet, (obj) => {
212
+ obj.rows.splice(index, 1);
213
+ delete obj.rowMeta[rowIndex];
214
+ });
205
215
  this.reset();
206
216
  return { axis: 'row', index, axisIndex: rowIndex, axisMeta: this._sheet.rowMeta[rowIndex], values };
207
217
  }
@@ -214,35 +224,43 @@ export class SheetModel extends Resource {
214
224
  const values = this.getCellValues(range).flat();
215
225
  const index = this._sheet.columns.indexOf(colIndex);
216
226
  this.clear(range);
217
- this._sheet.columns.splice(index, 1);
218
- delete this._sheet.columnMeta[colIndex];
227
+ Obj.update(this._sheet, (obj) => {
228
+ obj.columns.splice(index, 1);
229
+ delete obj.columnMeta[colIndex];
230
+ });
219
231
  this.reset();
220
232
  return { axis: 'col', index, axisIndex: colIndex, axisMeta: this._sheet.rowMeta[colIndex], values };
221
233
  }
222
234
 
223
235
  restoreRow({ index, axisIndex, axisMeta, values }: SheetAction.RestoreAxis): void {
224
- this._sheet.rows.splice(index, 0, axisIndex);
225
- values.forEach((value, col) => {
226
- if (value) {
227
- this._sheet.cells[`${this._sheet.columns[col]}@${axisIndex}`] = { value };
236
+ Obj.update(this._sheet, (obj) => {
237
+ obj.rows.splice(index, 0, axisIndex);
238
+ values.forEach((value, col) => {
239
+ if (value) {
240
+ obj.cells[`${obj.columns[col]}@${axisIndex}`] = { value };
241
+ }
242
+ });
243
+
244
+ if (axisMeta) {
245
+ obj.rowMeta[axisIndex] = axisMeta;
228
246
  }
229
247
  });
230
- if (axisMeta) {
231
- this._sheet.rowMeta[axisIndex] = axisMeta;
232
- }
233
248
  this.reset();
234
249
  }
235
250
 
236
251
  restoreColumn({ index, axisIndex, axisMeta, values }: SheetAction.RestoreAxis): void {
237
- this._sheet.columns.splice(index, 0, axisIndex);
238
- values.forEach((value, row) => {
239
- if (value) {
240
- this._sheet.cells[`${axisIndex}@${this._sheet.rows[row]}`] = { value };
252
+ Obj.update(this._sheet, (obj) => {
253
+ obj.columns.splice(index, 0, axisIndex);
254
+ values.forEach((value, row) => {
255
+ if (value) {
256
+ obj.cells[`${axisIndex}@${obj.rows[row]}`] = { value };
257
+ }
258
+ });
259
+
260
+ if (axisMeta) {
261
+ obj.columnMeta[axisIndex] = axisMeta;
241
262
  }
242
263
  });
243
- if (axisMeta) {
244
- this._sheet.columnMeta[axisIndex] = axisMeta;
245
- }
246
264
  this.reset();
247
265
  }
248
266
 
@@ -259,18 +277,22 @@ export class SheetModel extends Resource {
259
277
  const topLeft = getTopLeft(range);
260
278
  const values = this._iterRange(range, () => null);
261
279
  this._node.graph.hf.setCellContents(toSimpleCellAddress(this._node.sheetId, topLeft), values);
262
- this._iterRange(range, (cell) => {
263
- const idx = addressToIndex(this._sheet, cell);
264
- delete this._sheet.cells[idx];
280
+ Obj.update(this._sheet, (obj) => {
281
+ this._iterRange(range, (cell) => {
282
+ const idx = addressToIndex(this._sheet, cell);
283
+ delete obj.cells[idx];
284
+ });
265
285
  });
266
286
  }
267
287
 
268
288
  cut(range: CellRange): void {
269
289
  invariant(this._node);
270
290
  this._node.graph.hf.cut(toModelRange(this._node.sheetId, range));
271
- this._iterRange(range, (cell) => {
272
- const idx = addressToIndex(this._sheet, cell);
273
- delete this._sheet.cells[idx];
291
+ Obj.update(this._sheet, (obj) => {
292
+ this._iterRange(range, (cell) => {
293
+ const idx = addressToIndex(this._sheet, cell);
294
+ delete obj.cells[idx];
295
+ });
274
296
  });
275
297
  }
276
298
 
@@ -283,13 +305,15 @@ export class SheetModel extends Resource {
283
305
  invariant(this._node);
284
306
  if (!this._node.graph.hf.isClipboardEmpty()) {
285
307
  const changes = this._node.graph.hf.paste(toSimpleCellAddress(this._node.sheetId, cell));
286
- for (const change of changes) {
287
- if (change instanceof ExportedCellChange) {
288
- const { address, newValue } = change;
289
- const idx = addressToIndex(this._sheet, { row: address.row, col: address.col });
290
- this._sheet.cells[idx] = { value: newValue };
308
+ Obj.update(this._sheet, (obj) => {
309
+ for (const change of changes) {
310
+ if (change instanceof ExportedCellChange) {
311
+ const { address, newValue } = change;
312
+ const idx = addressToIndex(this._sheet, { row: address.row, col: address.col });
313
+ obj.cells[idx] = { value: newValue };
314
+ }
291
315
  }
292
- }
316
+ });
293
317
  }
294
318
  }
295
319
 
@@ -361,7 +385,7 @@ export class SheetModel extends Resource {
361
385
  /**
362
386
  * Get value type.
363
387
  */
364
- getValueDescription(cell: CellAddress): { type: TypeEnum; format?: FormatEnum } | undefined {
388
+ getValueDescription(cell: CellAddress): { type: TypeEnum; format?: Format.TypeFormat } | undefined {
365
389
  invariant(this._node);
366
390
  const addr = toSimpleCellAddress(this._node.sheetId, cell);
367
391
  const type = this._node.graph.hf.getCellValueDetailedType(addr);
@@ -380,11 +404,15 @@ export class SheetModel extends Resource {
380
404
  // Reallocate if > current bounds.
381
405
  let refresh = false;
382
406
  if (cell.row >= this._sheet.rows.length) {
383
- insertIndices(this._sheet.rows, cell.row, 1, MAX_ROWS);
407
+ Obj.update(this._sheet, (obj) => {
408
+ insertIndices(obj.rows, cell.row, 1, MAX_ROWS);
409
+ });
384
410
  refresh = true;
385
411
  }
386
412
  if (cell.col >= this._sheet.columns.length) {
387
- insertIndices(this._sheet.columns, cell.col, 1, MAX_COLS);
413
+ Obj.update(this._sheet, (obj) => {
414
+ insertIndices(obj.columns, cell.col, 1, MAX_COLS);
415
+ });
388
416
  refresh = true;
389
417
  }
390
418
 
@@ -401,13 +429,17 @@ export class SheetModel extends Resource {
401
429
  // Insert into sheet.
402
430
  const idx = addressToIndex(this._sheet, cell);
403
431
  if (value === undefined || value === null) {
404
- delete this._sheet.cells[idx];
432
+ Obj.update(this._sheet, (obj) => {
433
+ delete obj.cells[idx];
434
+ });
405
435
  } else {
406
436
  if (isFormula(value)) {
407
437
  value = this._graph.mapFunctionBindingToId(mapFormulaRefsToIndices(this._sheet, value));
408
438
  }
409
439
 
410
- this._sheet.cells[idx] = { value };
440
+ Obj.update(this._sheet, (obj) => {
441
+ obj.cells[idx] = { value };
442
+ });
411
443
  }
412
444
  }
413
445
 
@@ -2,9 +2,9 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { addressToA1Notation } from '@dxos/compute';
5
+ import { addressToA1Notation } from '@dxos/compute-hyperformula';
6
6
 
7
- import { Sheet } from '../types';
7
+ import { Sheet } from '#types';
8
8
 
9
9
  // TODO(burdon): Create testing endpoint.
10
10
  // TODO(burdon): Move to react-ui-sheet.
@@ -4,10 +4,11 @@
4
4
 
5
5
  import { useEffect, useState } from 'react';
6
6
 
7
- import { type ComputeGraph } from '@dxos/compute';
7
+ import { type ComputeGraph } from '@dxos/compute-hyperformula';
8
+
9
+ import { type Sheet } from '#types';
8
10
 
9
11
  import { SheetModel } from '../model';
10
- import { type Sheet } from '../types';
11
12
 
12
13
  export type UseSheetModelOptions = {
13
14
  readonly?: boolean;
@@ -0,0 +1,26 @@
1
+ //
2
+
3
+ import * as Effect from 'effect/Effect';
4
+ // Copyright 2025 DXOS.org
5
+ //
6
+
7
+ import { Operation } from '@dxos/compute';
8
+
9
+ import { SheetOperation } from '../types';
10
+
11
+ const handler: Operation.WithHandler<typeof SheetOperation.DropAxis> = SheetOperation.DropAxis.pipe(
12
+ Operation.withHandler(({ model, axis, axisIndex }) =>
13
+ Effect.sync(() => {
14
+ const undoData = model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
15
+ return {
16
+ axis: undoData.axis,
17
+ axisIndex: undoData.axisIndex,
18
+ index: undoData.index,
19
+ axisMeta: undoData.axisMeta,
20
+ values: undoData.values,
21
+ };
22
+ }),
23
+ ),
24
+ );
25
+
26
+ export default handler;
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/compute';
6
+
7
+ export const SheetOperationHandlerSet = OperationHandlerSet.lazy(
8
+ () => import('./drop-axis'),
9
+ () => import('./insert-axis'),
10
+ () => import('./restore-axis'),
11
+ () => import('./scroll-to-anchor'),
12
+ );
@@ -0,0 +1,19 @@
1
+ //
2
+
3
+ import * as Effect from 'effect/Effect';
4
+ // Copyright 2025 DXOS.org
5
+ //
6
+
7
+ import { Operation } from '@dxos/compute';
8
+
9
+ import { SheetOperation } from '../types';
10
+
11
+ const handler: Operation.WithHandler<typeof SheetOperation.InsertAxis> = SheetOperation.InsertAxis.pipe(
12
+ Operation.withHandler(({ model, axis, index, count }) =>
13
+ Effect.sync(() => {
14
+ model[axis === 'col' ? 'insertColumns' : 'insertRows'](index, count);
15
+ }),
16
+ ),
17
+ );
18
+
19
+ export default handler;
@@ -0,0 +1,19 @@
1
+ //
2
+
3
+ import * as Effect from 'effect/Effect';
4
+ // Copyright 2025 DXOS.org
5
+ //
6
+
7
+ import { Operation } from '@dxos/compute';
8
+
9
+ import { SheetOperation } from '../types';
10
+
11
+ const handler: Operation.WithHandler<typeof SheetOperation.RestoreAxis> = SheetOperation.RestoreAxis.pipe(
12
+ Operation.withHandler(({ model, axis, ...restoreData }) =>
13
+ Effect.sync(() => {
14
+ model[axis === 'col' ? 'restoreColumn' : 'restoreRow'](restoreData);
15
+ }),
16
+ ),
17
+ );
18
+
19
+ export default handler;
@@ -0,0 +1,30 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { parseThreadAnchorAsCellRange } from '../integrations/thread-ranges';
11
+ import { SheetCapabilities, SheetOperation } from '../types';
12
+
13
+ const handler: Operation.WithHandler<typeof SheetOperation.ScrollToAnchor> = SheetOperation.ScrollToAnchor.pipe(
14
+ Operation.withHandler(
15
+ Effect.fnUntraced(function* ({ subject, cursor, ref }) {
16
+ const gridInstances = yield* Capability.get(SheetCapabilities.GridInstances);
17
+ const entry = gridInstances.get(subject);
18
+ if (!entry) {
19
+ return;
20
+ }
21
+ entry.setActiveRefs(ref);
22
+ const range = parseThreadAnchorAsCellRange(cursor);
23
+ if (range) {
24
+ entry.grid.setFocus({ ...range.to, plane: 'grid' }, true);
25
+ }
26
+ }),
27
+ ),
28
+ );
29
+
30
+ export default handler;
@@ -10,7 +10,7 @@ export default defineConfig({
10
10
  ...e2ePreset(import.meta.dirname),
11
11
  // TODO(wittjosiah): Avoid hard-coding ports.
12
12
  webServer: {
13
- command: 'moon run storybook:serve-e2e -- --port=9005',
13
+ command: 'pnpm storybook dev --ci --quiet --port=9005 --config-dir=.storybook',
14
14
  port: 9005,
15
15
  reuseExistingServer: false,
16
16
  },