@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
@@ -2,15 +2,24 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { useEffect } from 'react';
5
+ import { type Registry, RegistryContext } from '@effect-atom/atom-react';
6
+ import { useContext, useEffect } from 'react';
6
7
 
7
- import { type CompleteCellRange, inRange } from '@dxos/compute';
8
- import { type ToolbarMenuActionGroupProperties, createMenuAction, createMenuItemGroup } from '@dxos/react-ui-menu';
8
+ import { type CompleteCellRange, inRange } from '@dxos/compute-hyperformula';
9
+ import { Obj } from '@dxos/echo';
10
+ import {
11
+ type ActionGraphProps,
12
+ type ToolbarMenuActionGroupProperties,
13
+ createMenuAction,
14
+ createMenuItemGroup,
15
+ } from '@dxos/react-ui-menu';
16
+
17
+ import { meta } from '#meta';
18
+ import { type StyleKey, type StyleValue, rangeFromIndex, rangeToIndex } from '#types';
9
19
 
10
- import { meta } from '../../meta';
11
20
  import { type SheetModel } from '../../model';
12
- import { type StyleKey, type StyleValue, rangeFromIndex, rangeToIndex } from '../../types';
13
- import { useSheetContext } from '../SheetContext';
21
+ import { useSheetContext } from '../SheetRoot';
22
+ import { type ToolbarState, type ToolbarStateAtom } from './useToolbarState';
14
23
 
15
24
  export type StyleState = Partial<Record<StyleValue, boolean>>;
16
25
 
@@ -21,22 +30,30 @@ const styles: Record<StyleValue, string> = {
21
30
  softwrap: 'ph--paragraph--regular',
22
31
  };
23
32
 
24
- export const useStyleState = (state: StyleState) => {
33
+ export const useStyleState = (stateAtom: ToolbarStateAtom) => {
34
+ const registry = useContext(RegistryContext);
25
35
  const { cursorFallbackRange, model } = useSheetContext();
26
36
 
27
37
  useEffect(() => {
28
- state.highlight = false;
29
- state.softwrap = false;
38
+ let highlight = false;
39
+ let softwrap = false;
30
40
  if (cursorFallbackRange && model.sheet.ranges) {
31
41
  model.sheet.ranges
32
42
  .filter(
33
43
  ({ range, key }) => key === 'style' && inRange(rangeFromIndex(model.sheet, range), cursorFallbackRange.from),
34
44
  )
35
45
  .forEach(({ value }) => {
36
- state[value as StyleValue] = true;
46
+ if (value === 'highlight') {
47
+ highlight = true;
48
+ }
49
+ if (value === 'softwrap') {
50
+ softwrap = true;
51
+ }
37
52
  });
38
53
  }
39
- }, [cursorFallbackRange, model.sheet]);
54
+ const prev = registry.get(stateAtom);
55
+ registry.set(stateAtom, { ...prev, highlight, softwrap });
56
+ }, [cursorFallbackRange, model.sheet, registry, stateAtom]);
40
57
  };
41
58
 
42
59
  const createStyleGroup = (state: StyleState) => {
@@ -49,7 +66,15 @@ const createStyleGroup = (state: StyleState) => {
49
66
  } as ToolbarMenuActionGroupProperties);
50
67
  };
51
68
 
52
- const createStyleActions = (model: SheetModel, state: StyleState, cursorFallbackRange?: CompleteCellRange) =>
69
+ type StyleActionsContext = {
70
+ model: SheetModel;
71
+ state: ToolbarState;
72
+ stateAtom: ToolbarStateAtom;
73
+ registry: Registry.Registry;
74
+ cursorFallbackRange?: CompleteCellRange;
75
+ };
76
+
77
+ const createStyleActions = ({ model, state, stateAtom, registry, cursorFallbackRange }: StyleActionsContext) =>
53
78
  Object.entries(styles).map(([styleValue, icon]) => {
54
79
  return createMenuAction<StyleAction>(
55
80
  `style--${styleValue}`,
@@ -67,6 +92,7 @@ const createStyleActions = (model: SheetModel, state: StyleState, cursorFallback
67
92
  key: 'style',
68
93
  value: styleValue as StyleValue,
69
94
  };
95
+ const currentState = registry.get(stateAtom);
70
96
  if (
71
97
  model.sheet.ranges
72
98
  .filter(
@@ -77,32 +103,36 @@ const createStyleActions = (model: SheetModel, state: StyleState, cursorFallback
77
103
  ) {
78
104
  // this value should be unset
79
105
  if (index >= 0) {
80
- model.sheet.ranges?.splice(index, 1);
106
+ Obj.update(model.sheet, (obj) => {
107
+ obj.ranges?.splice(index, 1);
108
+ });
81
109
  }
82
- state[nextRangeEntity.value] = false;
110
+ registry.set(stateAtom, { ...currentState, [nextRangeEntity.value]: false });
83
111
  } else {
84
- model.sheet.ranges?.push(nextRangeEntity);
85
- state[nextRangeEntity.value] = true;
112
+ Obj.update(model.sheet, (obj) => {
113
+ obj.ranges?.push(nextRangeEntity);
114
+ });
115
+ registry.set(stateAtom, { ...currentState, [nextRangeEntity.value]: true });
86
116
  }
87
117
  },
88
118
  {
89
119
  key: 'style',
90
120
  value: styleValue as StyleValue,
91
121
  icon,
92
- label: [`range value ${styleValue} label`, { ns: meta.id }],
122
+ label: [`range-value.${styleValue}.label`, { ns: meta.id }],
93
123
  checked: !!state[styleValue as StyleValue],
94
124
  },
95
125
  );
96
126
  });
97
127
 
98
- export const createStyle = (model: SheetModel, state: StyleState, cursorFallbackRange?: CompleteCellRange) => {
99
- const styleGroupAction = createStyleGroup(state);
100
- const styleActions = createStyleActions(model, state, cursorFallbackRange);
128
+ export const createStyle = (context: StyleActionsContext): ActionGraphProps => {
129
+ const styleGroupAction = createStyleGroup(context.state);
130
+ const styleActions = createStyleActions(context);
101
131
  return {
102
132
  nodes: [styleGroupAction, ...styleActions],
103
133
  edges: [
104
- { source: 'root', target: 'style' },
105
- ...styleActions.map(({ id }) => ({ source: styleGroupAction.id, target: id })),
134
+ { source: 'root', target: 'style', relation: 'child' },
135
+ ...styleActions.map(({ id }) => ({ source: styleGroupAction.id, target: id, relation: 'child' })),
106
136
  ],
107
137
  };
108
138
  };
@@ -2,15 +2,32 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { useMemo } from 'react';
6
-
7
- import { live } from '@dxos/live-object';
5
+ import { Atom, type Registry, RegistryContext, useAtomValue } from '@effect-atom/atom-react';
6
+ import { useContext, useMemo } from 'react';
8
7
 
9
8
  import { type AlignState } from './align';
10
9
  import { type StyleState } from './style';
11
10
 
12
11
  export type ToolbarState = Partial<StyleState & AlignState>;
12
+ export type ToolbarStateAtom = Atom.Writable<ToolbarState>;
13
+
14
+ /**
15
+ * Creates a reactive toolbar state Atom.
16
+ */
17
+ export const useToolbarState = (initialState: ToolbarState = {}): ToolbarStateAtom => {
18
+ return useMemo(() => Atom.make<ToolbarState>(initialState).pipe(Atom.keepAlive), []);
19
+ };
20
+
21
+ /**
22
+ * Hook to read the current toolbar state value.
23
+ */
24
+ export const useToolbarStateValue = (stateAtom: ToolbarStateAtom): ToolbarState => {
25
+ return useAtomValue(stateAtom);
26
+ };
13
27
 
14
- export const useToolbarState = (initialState: ToolbarState = {}) => {
15
- return useMemo(() => live<ToolbarState>(initialState), []);
28
+ /**
29
+ * Hook to get the registry for updating toolbar state.
30
+ */
31
+ export const useToolbarStateRegistry = (): Registry.Registry => {
32
+ return useContext(RegistryContext);
16
33
  };
@@ -2,11 +2,5 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from 'react';
6
-
7
5
  export * from './ComputeGraph';
8
- export * from './GridSheet';
9
- export * from './RangeList';
10
- export * from './SheetContext';
11
-
12
- export const SheetContainer = lazy(() => import('./SheetContainer'));
6
+ export * from './Sheet';
@@ -5,48 +5,53 @@
5
5
  import * as Schema from 'effect/Schema';
6
6
  import React, { useCallback } from 'react';
7
7
 
8
- import { rangeToA1Notation } from '@dxos/compute';
9
- import { Callout, useTranslation } from '@dxos/react-ui';
8
+ import { rangeToA1Notation } from '@dxos/compute-hyperformula';
9
+ import { useObject } from '@dxos/echo-react';
10
+ import { Input, Message, useTranslation } from '@dxos/react-ui';
10
11
  import { List } from '@dxos/react-ui-list';
11
- import { ghostHover } from '@dxos/react-ui-theme';
12
12
 
13
- import { meta } from '../../meta';
14
- import { rangeFromIndex } from '../../types';
15
- import { Sheet } from '../../types';
13
+ import { meta } from '#meta';
14
+ import { rangeFromIndex } from '#types';
15
+ import { Sheet } from '#types';
16
16
 
17
17
  export type RangeListProps = {
18
18
  sheet: Sheet.Sheet;
19
19
  };
20
20
 
21
- export const RangeList = ({ sheet }: RangeListProps) => {
21
+ export const RangeList = ({ sheet: sheetProp }: RangeListProps) => {
22
22
  const { t } = useTranslation(meta.id);
23
+ const [sheet, updateSheet] = useObject(sheetProp);
23
24
  // TODO(thure): Implement similar to comments, #8121
24
25
  const handleSelectRange = (range: Sheet.Range) => {};
25
26
  const handleDeleteRange = useCallback(
26
27
  (range: Sheet.Range) => {
27
28
  const index = sheet.ranges.findIndex((sheetRange) => sheetRange === range);
28
- sheet.ranges.splice(index, 1);
29
+ updateSheet((sheet) => {
30
+ sheet.ranges.splice(index, 1);
31
+ });
29
32
  },
30
- [sheet],
33
+ [sheet, updateSheet],
31
34
  );
32
35
  return (
33
36
  <>
34
- <h2 className='mbs-cardSpacingBlock mbe-labelSpacingBlock text-sm font-semibold'>{t('range list heading')}</h2>
37
+ <Input.Root>
38
+ <Input.Label>{t('range-list.heading')}</Input.Label>
39
+ </Input.Root>
35
40
  {sheet.ranges.length < 1 ? (
36
- <Callout.Root>
37
- <Callout.Title>{t('no ranges message')}</Callout.Title>
38
- </Callout.Root>
41
+ <Message.Root>
42
+ <Message.Title>{t('no-ranges.message')}</Message.Title>
43
+ </Message.Root>
39
44
  ) : (
40
45
  <List.Root<Sheet.Range> items={sheet.ranges} isItem={Schema.is(Sheet.Range)}>
41
46
  {({ items: ranges }) =>
42
47
  ranges.map((range, i) => (
43
- <List.Item key={i} item={range} classNames={['p-2', ghostHover]}>
48
+ <List.Item key={i} item={range}>
44
49
  <List.ItemDragHandle />
45
50
  <List.ItemTitle onClick={() => handleSelectRange(range)}>
46
- {t('range title', {
47
- position: rangeToA1Notation(rangeFromIndex(sheet, range.range)),
48
- key: t(`range key ${range.key} label`),
49
- value: t(`range value ${range.value} label`),
51
+ {t('range.title', {
52
+ position: rangeToA1Notation(rangeFromIndex(sheetProp, range.range)),
53
+ key: t(`range-key.${range.key}.label`),
54
+ value: t(`range-value.${range.value}.label`),
50
55
  })}
51
56
  </List.ItemTitle>
52
57
  <List.ItemDeleteButton onClick={() => handleDeleteRange(range)} />
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { RangeList as default } from './RangeList';
@@ -0,0 +1,110 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { type Meta } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
7
+ import React, { useContext } from 'react';
8
+
9
+ import { Capabilities, Capability } from '@dxos/app-framework';
10
+ import { withPluginManager } from '@dxos/app-framework/testing';
11
+ import { Operation, OperationHandlerSet } from '@dxos/compute';
12
+ import { Obj } from '@dxos/echo';
13
+ import { corePlugins } from '@dxos/plugin-testing';
14
+ import { useSpaces } from '@dxos/react-client/echo';
15
+ import { withClientProvider } from '@dxos/react-client/testing';
16
+ import { AttendableContainer } from '@dxos/react-ui-attention';
17
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
18
+
19
+ import { ComputeGraphContext, useComputeGraph } from '#components';
20
+ import { createTestCells, useTestSheet, withComputeGraphDecorator } from '#testing';
21
+ import { translations } from '#translations';
22
+ import { SheetOperation } from '#types';
23
+ import { Sheet } from '#types';
24
+
25
+ import RangeList from '../RangeList';
26
+ import { SheetArticle } from './SheetArticle';
27
+
28
+ const meta = {
29
+ title: 'plugins/plugin-sheet/containers/SheetArticle',
30
+ component: SheetArticle,
31
+ decorators: [
32
+ withTheme(),
33
+ withLayout({ layout: 'fullscreen' }),
34
+ withClientProvider({ types: [Sheet.Sheet], createSpace: true }),
35
+ withComputeGraphDecorator(),
36
+ withPluginManager({
37
+ plugins: [...corePlugins()],
38
+ capabilities: [
39
+ Capability.contributes(
40
+ Capabilities.OperationHandler,
41
+ OperationHandlerSet.make(
42
+ Operation.withHandler(SheetOperation.DropAxis, ({ model, axis, axisIndex }) =>
43
+ Effect.sync(() => {
44
+ model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
45
+ return { axis, axisIndex, index: 0, axisMeta: null, values: [] };
46
+ }),
47
+ ),
48
+ ),
49
+ ),
50
+ ],
51
+ }),
52
+ ],
53
+ parameters: {
54
+ layout: 'fullscreen',
55
+ translations,
56
+ },
57
+ } satisfies Meta<typeof SheetArticle>;
58
+
59
+ export default meta;
60
+
61
+ export const Default = () => {
62
+ const [space] = useSpaces();
63
+ const graph = useComputeGraph(space);
64
+ const { registry } = useContext(ComputeGraphContext) ?? {};
65
+ const sheet = useTestSheet(space, graph, { cells: createTestCells() });
66
+ if (!sheet || !space || !registry) {
67
+ return null;
68
+ }
69
+
70
+ return (
71
+ <AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
72
+ <SheetArticle
73
+ role='article'
74
+ space={space}
75
+ subject={sheet}
76
+ attendableId='test'
77
+ registry={registry}
78
+ ignoreAttention
79
+ />
80
+ </AttendableContainer>
81
+ );
82
+ };
83
+
84
+ export const Spec = () => {
85
+ const [space] = useSpaces();
86
+ const graph = useComputeGraph(space);
87
+ const { registry } = useContext(ComputeGraphContext) ?? {};
88
+ const sheet = useTestSheet(space, graph, { cells: { A1: { value: 'Ready' } } });
89
+ if (!sheet || !space || !registry) {
90
+ return null;
91
+ }
92
+
93
+ return (
94
+ <AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
95
+ <div className='w-full grid grid-cols-[1fr_20rem]'>
96
+ <SheetArticle
97
+ role='article'
98
+ space={space}
99
+ subject={sheet}
100
+ attendableId='test'
101
+ registry={registry}
102
+ ignoreAttention
103
+ />
104
+ <div data-testid='grid.range-list'>
105
+ <RangeList sheet={sheet} />
106
+ </div>
107
+ </div>
108
+ </AttendableContainer>
109
+ );
110
+ };
@@ -0,0 +1,57 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type AppSurface } from '@dxos/app-toolkit/ui';
8
+ import { type ComputeGraphRegistry } from '@dxos/compute-hyperformula';
9
+ import { type Space } from '@dxos/react-client/echo';
10
+ import { Panel } from '@dxos/react-ui';
11
+
12
+ import { ComputeGraphContextProvider, Sheet, useComputeGraph } from '#components';
13
+ import { type Sheet as SheetType } from '#types';
14
+
15
+ export type SheetArticleProps = AppSurface.ObjectArticleProps<
16
+ SheetType.Sheet,
17
+ {
18
+ space: Space;
19
+ registry: ComputeGraphRegistry;
20
+ ignoreAttention?: boolean;
21
+ }
22
+ >;
23
+
24
+ export const SheetArticle = ({ registry, ...props }: SheetArticleProps) => (
25
+ <ComputeGraphContextProvider registry={registry}>
26
+ <SheetArticleInner {...props} />
27
+ </ComputeGraphContextProvider>
28
+ );
29
+
30
+ const SheetArticleInner = ({
31
+ role,
32
+ subject: sheet,
33
+ attendableId,
34
+ space,
35
+ ignoreAttention,
36
+ }: Omit<SheetArticleProps, 'registry'>) => {
37
+ const graph = useComputeGraph(space);
38
+ if (!graph) {
39
+ return null;
40
+ }
41
+
42
+ return (
43
+ <Sheet.Root graph={graph} sheet={sheet} attendableId={attendableId!} ignoreAttention={ignoreAttention}>
44
+ <Panel.Root classNames={role === 'section' && 'aspect-aquare'}>
45
+ <Panel.Toolbar asChild>
46
+ <Sheet.Toolbar />
47
+ </Panel.Toolbar>
48
+ <Panel.Content asChild>
49
+ <Sheet.Content />
50
+ </Panel.Content>
51
+ <Panel.Statusbar asChild>
52
+ <Sheet.Statusbar />
53
+ </Panel.Statusbar>
54
+ </Panel.Root>
55
+ </Sheet.Root>
56
+ );
57
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export { SheetArticle as default } from './SheetArticle';
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const RangeList: ComponentType<any> = lazy(() => import('./RangeList'));
8
+ export const SheetArticle: ComponentType<any> = lazy(() => import('./SheetArticle'));
@@ -5,28 +5,28 @@
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useEffect, useMemo } from 'react';
7
7
 
8
- import { IntentPlugin } from '@dxos/app-framework';
8
+ import { OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
9
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
10
  import { PublicKey } from '@dxos/keys';
11
- import { useSpace } from '@dxos/react-client/echo';
11
+ import { useSpaces } from '@dxos/react-client/echo';
12
12
  import { withClientProvider } from '@dxos/react-client/testing';
13
13
  import { useThemeContext } from '@dxos/react-ui';
14
- import { withTheme } from '@dxos/react-ui/testing';
14
+ import { useTextEditor } from '@dxos/react-ui-editor';
15
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
15
16
  import {
16
17
  createBasicExtensions,
17
18
  createMarkdownExtensions,
18
19
  createThemeExtensions,
19
20
  decorateMarkdown,
20
21
  documentId,
21
- useTextEditor,
22
- } from '@dxos/react-ui-editor';
22
+ } from '@dxos/ui-editor';
23
23
  import { isNonNullable } from '@dxos/util';
24
24
 
25
- import { GridSheet, SheetProvider, useComputeGraph } from '../components';
26
- import { useSheetModel } from '../model';
27
- import { useTestSheet, withComputeGraphDecorator } from '../testing';
28
- import { Sheet } from '../types';
25
+ import { Sheet, useComputeGraph } from '#components';
26
+ import { useTestSheet, withComputeGraphDecorator } from '#testing';
27
+ import { Sheet as SheetType } from '#types';
29
28
 
29
+ import { useSheetModel } from '../model';
30
30
  import { compute, computeGraphFacet } from './compute';
31
31
 
32
32
  const str = (...lines: string[]) => lines.join('\n');
@@ -45,7 +45,7 @@ const SHEET_NAME = 'Test Sheet';
45
45
  const DefaultStory = ({ text }: EditorProps) => {
46
46
  const id = useMemo(() => PublicKey.random(), []);
47
47
  const { themeMode } = useThemeContext();
48
- const space = useSpace();
48
+ const [space] = useSpaces();
49
49
  const computeGraph = useComputeGraph(space);
50
50
  const { parentRef, focusAttributes } = useTextEditor(
51
51
  () => ({
@@ -63,17 +63,22 @@ const DefaultStory = ({ text }: EditorProps) => {
63
63
  [computeGraph, themeMode],
64
64
  );
65
65
 
66
- return <div className='is-[40rem] overflow-hidden' ref={parentRef} {...focusAttributes} />;
66
+ return <div className='w-[40rem] overflow-hidden' ref={parentRef} {...focusAttributes} />;
67
67
  };
68
68
 
69
69
  const Grid = () => {
70
- const space = useSpace();
70
+ const [space] = useSpaces();
71
71
  const graph = useComputeGraph(space);
72
72
  const sheet = useTestSheet(space, graph, { name: SHEET_NAME });
73
73
  const model = useSheetModel(graph, sheet);
74
74
  useEffect(() => {
75
75
  if (model) {
76
- model.setValues({ A1: { value: 100 }, A2: { value: 200 }, A3: { value: 300 }, A5: { value: '=SUM(A1:A3)' } });
76
+ model.setValues({
77
+ A1: { value: 100 },
78
+ A2: { value: 200 },
79
+ A3: { value: 300 },
80
+ A5: { value: '=SUM(A1:A3)' },
81
+ });
77
82
  }
78
83
  }, [model]);
79
84
 
@@ -82,10 +87,10 @@ const Grid = () => {
82
87
  }
83
88
 
84
89
  return (
85
- <div className='flex is-[40rem] overflow-hidden'>
86
- <SheetProvider graph={graph} sheet={sheet}>
87
- <GridSheet />
88
- </SheetProvider>
90
+ <div className='flex w-[40rem] overflow-hidden'>
91
+ <Sheet.Root graph={graph} sheet={sheet} attendableId='test'>
92
+ <Sheet.Content />
93
+ </Sheet.Root>
89
94
  </div>
90
95
  );
91
96
  };
@@ -100,12 +105,17 @@ const GraphStory = (props: EditorProps) => {
100
105
  };
101
106
 
102
107
  const meta = {
103
- title: 'plugins/plugin-sheet/extensions',
108
+ title: 'plugins/plugin-sheet/extensions/compute',
104
109
  decorators: [
105
- withTheme,
106
- withClientProvider({ types: [Sheet.Sheet], createIdentity: true, createSpace: true }),
110
+ withTheme(),
111
+ withLayout({ layout: 'fullscreen' }),
112
+ withClientProvider({
113
+ types: [SheetType.Sheet],
114
+ createIdentity: true,
115
+ createSpace: true,
116
+ }),
107
117
  // TODO(wittjosiah): Try to write story which does not depend on plugin manager.
108
- withPluginManager({ plugins: [IntentPlugin()] }),
118
+ withPluginManager({ plugins: [OperationPlugin(), RuntimePlugin()] }),
109
119
  withComputeGraphDecorator(),
110
120
  ],
111
121
  parameters: {
@@ -21,9 +21,9 @@ import {
21
21
  type ComputeGraph,
22
22
  type ComputeNode,
23
23
  createSheetName,
24
- } from '@dxos/compute';
24
+ } from '@dxos/compute-hyperformula';
25
25
  import { invariant } from '@dxos/invariant';
26
- import { documentId, singleValueFacet } from '@dxos/react-ui-editor';
26
+ import { documentId, singleValueFacet } from '@dxos/ui-editor';
27
27
 
28
28
  const LANGUAGE_TAG = 'dx';
29
29
 
@@ -8,7 +8,7 @@ import { testTree } from '@lezer/generator/test';
8
8
  import { spreadsheet } from 'codemirror-lang-spreadsheet';
9
9
  import { describe, expect, test } from 'vitest';
10
10
 
11
- import { defaultFunctions } from '@dxos/compute';
11
+ import { defaultFunctions } from '@dxos/compute-hyperformula';
12
12
 
13
13
  import { sheetExtension } from './sheet-extension';
14
14