@dxos/plugin-sheet 0.8.3 → 0.8.4-main.1068cf700f

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 (297) hide show
  1. package/dist/lib/browser/SheetContainer-6DNFC4TY.mjs +397 -0
  2. package/dist/lib/browser/SheetContainer-6DNFC4TY.mjs.map +7 -0
  3. package/dist/lib/browser/anchor-sort-AMMLA66W.mjs +24 -0
  4. package/dist/lib/browser/anchor-sort-AMMLA66W.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-EDWHV64N.mjs +1473 -0
  6. package/dist/lib/browser/chunk-EDWHV64N.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-FJRLDX7Z.mjs → chunk-IFLWVS2V.mjs} +7 -7
  8. package/dist/lib/browser/chunk-IFLWVS2V.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-KE3AKN5W.mjs +397 -0
  10. package/dist/lib/browser/chunk-KE3AKN5W.mjs.map +7 -0
  11. package/dist/lib/browser/compute-graph-registry-RC5L7RE4.mjs +21 -0
  12. package/dist/lib/browser/compute-graph-registry-RC5L7RE4.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +80 -89
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/markdown-D2T2DOVX.mjs +29 -0
  16. package/dist/lib/browser/markdown-D2T2DOVX.mjs.map +7 -0
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/operation-resolver-P2RX75DA.mjs +79 -0
  19. package/dist/lib/browser/operation-resolver-P2RX75DA.mjs.map +7 -0
  20. package/dist/lib/browser/react-surface-45CRAB5G.mjs +51 -0
  21. package/dist/lib/browser/react-surface-45CRAB5G.mjs.map +7 -0
  22. package/dist/lib/browser/types/index.mjs +7 -12
  23. package/dist/lib/node-esm/SheetContainer-7H5R7M54.mjs +398 -0
  24. package/dist/lib/node-esm/SheetContainer-7H5R7M54.mjs.map +7 -0
  25. package/dist/lib/node-esm/anchor-sort-VHMBRX2E.mjs +25 -0
  26. package/dist/lib/node-esm/anchor-sort-VHMBRX2E.mjs.map +7 -0
  27. package/dist/lib/node-esm/chunk-6J5L47IB.mjs +398 -0
  28. package/dist/lib/node-esm/chunk-6J5L47IB.mjs.map +7 -0
  29. package/dist/lib/node-esm/chunk-AYSEWH7N.mjs +1474 -0
  30. package/dist/lib/node-esm/chunk-AYSEWH7N.mjs.map +7 -0
  31. package/dist/lib/node-esm/{chunk-NMCVJWDT.mjs → chunk-PPOYR7DK.mjs} +7 -7
  32. package/dist/lib/node-esm/chunk-PPOYR7DK.mjs.map +7 -0
  33. package/dist/lib/node-esm/compute-graph-registry-ZGXVLVGD.mjs +22 -0
  34. package/dist/lib/node-esm/compute-graph-registry-ZGXVLVGD.mjs.map +7 -0
  35. package/dist/lib/node-esm/index.mjs +80 -89
  36. package/dist/lib/node-esm/index.mjs.map +4 -4
  37. package/dist/lib/node-esm/markdown-PTV72DLO.mjs +30 -0
  38. package/dist/lib/node-esm/markdown-PTV72DLO.mjs.map +7 -0
  39. package/dist/lib/node-esm/meta.json +1 -1
  40. package/dist/lib/node-esm/operation-resolver-WPIWQ5IO.mjs +80 -0
  41. package/dist/lib/node-esm/operation-resolver-WPIWQ5IO.mjs.map +7 -0
  42. package/dist/lib/node-esm/react-surface-ITV2L6HK.mjs +52 -0
  43. package/dist/lib/node-esm/react-surface-ITV2L6HK.mjs.map +7 -0
  44. package/dist/lib/node-esm/types/index.mjs +7 -12
  45. package/dist/types/src/SheetPlugin.d.ts +2 -1
  46. package/dist/types/src/SheetPlugin.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts +6 -0
  48. package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/anchor-sort/index.d.ts +3 -0
  50. package/dist/types/src/capabilities/anchor-sort/index.d.ts.map +1 -0
  51. package/dist/types/src/capabilities/compute-graph-registry/compute-graph-registry.d.ts +5 -0
  52. package/dist/types/src/capabilities/compute-graph-registry/compute-graph-registry.d.ts.map +1 -0
  53. package/dist/types/src/capabilities/compute-graph-registry/index.d.ts +3 -0
  54. package/dist/types/src/capabilities/compute-graph-registry/index.d.ts.map +1 -0
  55. package/dist/types/src/capabilities/index.d.ts +5 -11
  56. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
  58. package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
  59. package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
  60. package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
  61. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  62. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  63. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  64. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  65. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  66. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  67. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  68. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  69. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -1
  70. package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts +9 -4
  71. package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
  72. package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -1
  73. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +51 -3
  74. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -1
  75. package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts +11 -20
  76. package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +1 -1
  77. package/dist/types/src/components/GridSheet/util.d.ts +1 -1
  78. package/dist/types/src/components/GridSheet/util.d.ts.map +1 -1
  79. package/dist/types/src/components/RangeList/RangeList.d.ts +2 -2
  80. package/dist/types/src/components/RangeList/RangeList.d.ts.map +1 -1
  81. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +5 -6
  82. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +1 -1
  83. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +54 -5
  84. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -1
  85. package/dist/types/src/components/SheetContext/SheetContext.d.ts +3 -3
  86. package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +1 -1
  87. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts +3 -4
  88. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
  89. package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts +88 -4
  90. package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
  91. package/dist/types/src/components/SheetToolbar/align.d.ts +13 -20
  92. package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
  93. package/dist/types/src/components/SheetToolbar/style.d.ts +12 -18
  94. package/dist/types/src/components/SheetToolbar/style.d.ts.map +1 -1
  95. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts +14 -1
  96. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts.map +1 -1
  97. package/dist/types/src/components/index.d.ts +1 -1
  98. package/dist/types/src/components/index.d.ts.map +1 -1
  99. package/dist/types/src/extensions/compute.d.ts +1 -1
  100. package/dist/types/src/extensions/compute.d.ts.map +1 -1
  101. package/dist/types/src/extensions/compute.stories.d.ts +10 -13
  102. package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
  103. package/dist/types/src/extensions/editor/index.d.ts +1 -1
  104. package/dist/types/src/extensions/editor/index.d.ts.map +1 -1
  105. package/dist/types/src/extensions/editor/{extension.d.ts → sheet-extension.d.ts} +1 -1
  106. package/dist/types/src/extensions/editor/sheet-extension.d.ts.map +1 -0
  107. package/dist/types/src/extensions/editor/sheet-extension.test.d.ts +2 -0
  108. package/dist/types/src/extensions/editor/sheet-extension.test.d.ts.map +1 -0
  109. package/dist/types/src/index.d.ts +1 -1
  110. package/dist/types/src/index.d.ts.map +1 -1
  111. package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
  112. package/dist/types/src/meta.d.ts +2 -3
  113. package/dist/types/src/meta.d.ts.map +1 -1
  114. package/dist/types/src/model/sheet-model.d.ts +6 -6
  115. package/dist/types/src/model/sheet-model.d.ts.map +1 -1
  116. package/dist/types/src/model/testing.d.ts +2 -2
  117. package/dist/types/src/model/testing.d.ts.map +1 -1
  118. package/dist/types/src/model/useSheetModel.d.ts +2 -2
  119. package/dist/types/src/model/useSheetModel.d.ts.map +1 -1
  120. package/dist/types/src/playwright/playwright.config.d.ts +3 -0
  121. package/dist/types/src/playwright/playwright.config.d.ts.map +1 -0
  122. package/dist/types/src/{testing/playwright → playwright}/sheet-manager.d.ts +1 -1
  123. package/dist/types/src/playwright/sheet-manager.d.ts.map +1 -0
  124. package/dist/types/src/playwright/sheet.spec.d.ts.map +1 -0
  125. package/dist/types/src/serializer.d.ts +2 -2
  126. package/dist/types/src/serializer.d.ts.map +1 -1
  127. package/dist/types/src/testing/data.d.ts +2 -2
  128. package/dist/types/src/testing/data.d.ts.map +1 -1
  129. package/dist/types/src/testing/testing.d.ts +27 -3
  130. package/dist/types/src/testing/testing.d.ts.map +1 -1
  131. package/dist/types/src/translations.d.ts +8 -62
  132. package/dist/types/src/translations.d.ts.map +1 -1
  133. package/dist/types/src/types/Sheet.d.ts +76 -0
  134. package/dist/types/src/types/Sheet.d.ts.map +1 -0
  135. package/dist/types/src/types/capabilities.d.ts +6 -0
  136. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  137. package/dist/types/src/types/index.d.ts +2 -1
  138. package/dist/types/src/types/index.d.ts.map +1 -1
  139. package/dist/types/src/types/sheet-range-types.d.ts +2 -2
  140. package/dist/types/src/types/sheet-range-types.d.ts.map +1 -1
  141. package/dist/types/src/types/types.d.ts +92 -75
  142. package/dist/types/src/types/types.d.ts.map +1 -1
  143. package/dist/types/src/types/util.d.ts +10 -10
  144. package/dist/types/src/types/util.d.ts.map +1 -1
  145. package/dist/types/tsconfig.tsbuildinfo +1 -1
  146. package/package.json +83 -73
  147. package/src/SheetPlugin.tsx +53 -65
  148. package/src/capabilities/anchor-sort/anchor-sort.ts +27 -0
  149. package/src/capabilities/anchor-sort/index.ts +7 -0
  150. package/src/capabilities/compute-graph-registry/compute-graph-registry.ts +27 -0
  151. package/src/capabilities/compute-graph-registry/index.ts +7 -0
  152. package/src/capabilities/index.ts +5 -9
  153. package/src/capabilities/markdown/index.ts +7 -0
  154. package/src/capabilities/markdown/markdown.ts +30 -0
  155. package/src/capabilities/operation-resolver/index.ts +7 -0
  156. package/src/capabilities/operation-resolver/operation-resolver.ts +77 -0
  157. package/src/capabilities/react-surface/index.ts +7 -0
  158. package/src/capabilities/react-surface/react-surface.tsx +43 -0
  159. package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +1 -1
  160. package/src/components/ComputeGraph/compute-graph.stories.tsx +21 -20
  161. package/src/components/FunctionEditor/FunctionEditor.tsx +2 -2
  162. package/src/components/GridSheet/GridSheet.stories.tsx +23 -17
  163. package/src/components/GridSheet/GridSheet.tsx +63 -52
  164. package/src/components/GridSheet/SheetCellEditor.stories.tsx +44 -43
  165. package/src/components/GridSheet/util.ts +17 -11
  166. package/src/components/RangeList/RangeList.tsx +13 -10
  167. package/src/components/SheetContainer/SheetContainer.stories.tsx +71 -47
  168. package/src/components/SheetContainer/SheetContainer.tsx +30 -18
  169. package/src/components/SheetContext/SheetContext.tsx +9 -9
  170. package/src/components/SheetToolbar/SheetToolbar.stories.tsx +19 -13
  171. package/src/components/SheetToolbar/SheetToolbar.tsx +52 -42
  172. package/src/components/SheetToolbar/align.ts +46 -20
  173. package/src/components/SheetToolbar/style.ts +48 -18
  174. package/src/components/SheetToolbar/useToolbarState.ts +22 -5
  175. package/src/extensions/compute.stories.tsx +43 -30
  176. package/src/extensions/compute.ts +3 -4
  177. package/src/extensions/editor/index.ts +1 -1
  178. package/src/extensions/editor/{extension.test.ts → sheet-extension.test.ts} +1 -1
  179. package/src/extensions/editor/{extension.ts → sheet-extension.ts} +7 -4
  180. package/src/index.ts +1 -1
  181. package/src/integrations/thread-ranges.ts +43 -51
  182. package/src/meta.ts +9 -7
  183. package/src/model/sheet-model.test.ts +5 -4
  184. package/src/model/sheet-model.ts +85 -53
  185. package/src/model/testing.ts +4 -4
  186. package/src/model/useSheetModel.ts +2 -2
  187. package/src/playwright/playwright.config.ts +17 -0
  188. package/src/{testing/playwright → playwright}/sheet-manager.ts +1 -1
  189. package/src/{testing/playwright → playwright}/sheet.spec.ts +3 -2
  190. package/src/sanity.test.ts +4 -5
  191. package/src/serializer.ts +4 -4
  192. package/src/testing/data.ts +2 -2
  193. package/src/testing/testing.tsx +11 -5
  194. package/src/translations.ts +10 -7
  195. package/src/types/Sheet.ts +97 -0
  196. package/src/types/capabilities.ts +14 -0
  197. package/src/types/index.ts +2 -1
  198. package/src/types/sheet-range-types.ts +2 -2
  199. package/src/types/types.ts +84 -49
  200. package/src/types/util.ts +14 -41
  201. package/dist/lib/browser/SheetContainer-BDZXBB5U.mjs +0 -351
  202. package/dist/lib/browser/SheetContainer-BDZXBB5U.mjs.map +0 -7
  203. package/dist/lib/browser/anchor-sort-NYYZLRAA.mjs +0 -24
  204. package/dist/lib/browser/anchor-sort-NYYZLRAA.mjs.map +0 -7
  205. package/dist/lib/browser/chunk-5TA43LO4.mjs +0 -847
  206. package/dist/lib/browser/chunk-5TA43LO4.mjs.map +0 -7
  207. package/dist/lib/browser/chunk-D3G4UGEK.mjs +0 -18
  208. package/dist/lib/browser/chunk-D3G4UGEK.mjs.map +0 -7
  209. package/dist/lib/browser/chunk-FJRLDX7Z.mjs.map +0 -7
  210. package/dist/lib/browser/chunk-I7FZ4TWJ.mjs +0 -892
  211. package/dist/lib/browser/chunk-I7FZ4TWJ.mjs.map +0 -7
  212. package/dist/lib/browser/chunk-IR42IS3F.mjs +0 -15
  213. package/dist/lib/browser/chunk-IR42IS3F.mjs.map +0 -7
  214. package/dist/lib/browser/compute-graph-registry-IXGGJJBU.mjs +0 -30
  215. package/dist/lib/browser/compute-graph-registry-IXGGJJBU.mjs.map +0 -7
  216. package/dist/lib/browser/intent-resolver-IBBI6B74.mjs +0 -56
  217. package/dist/lib/browser/intent-resolver-IBBI6B74.mjs.map +0 -7
  218. package/dist/lib/browser/markdown-T4TUP4BF.mjs +0 -26
  219. package/dist/lib/browser/markdown-T4TUP4BF.mjs.map +0 -7
  220. package/dist/lib/browser/react-surface-UI46P43F.mjs +0 -53
  221. package/dist/lib/browser/react-surface-UI46P43F.mjs.map +0 -7
  222. package/dist/lib/node/SheetContainer-VWPM3HYJ.cjs +0 -351
  223. package/dist/lib/node/SheetContainer-VWPM3HYJ.cjs.map +0 -7
  224. package/dist/lib/node/anchor-sort-A7NABMJM.cjs +0 -39
  225. package/dist/lib/node/anchor-sort-A7NABMJM.cjs.map +0 -7
  226. package/dist/lib/node/chunk-FIM6EZ6M.cjs +0 -256
  227. package/dist/lib/node/chunk-FIM6EZ6M.cjs.map +0 -7
  228. package/dist/lib/node/chunk-JSIDCZHB.cjs +0 -41
  229. package/dist/lib/node/chunk-JSIDCZHB.cjs.map +0 -7
  230. package/dist/lib/node/chunk-LJWWS53Z.cjs +0 -34
  231. package/dist/lib/node/chunk-LJWWS53Z.cjs.map +0 -7
  232. package/dist/lib/node/chunk-N7FSEUIN.cjs +0 -927
  233. package/dist/lib/node/chunk-N7FSEUIN.cjs.map +0 -7
  234. package/dist/lib/node/chunk-ST3WA73J.cjs +0 -855
  235. package/dist/lib/node/chunk-ST3WA73J.cjs.map +0 -7
  236. package/dist/lib/node/compute-graph-registry-ARLDHPFW.cjs +0 -56
  237. package/dist/lib/node/compute-graph-registry-ARLDHPFW.cjs.map +0 -7
  238. package/dist/lib/node/index.cjs +0 -173
  239. package/dist/lib/node/index.cjs.map +0 -7
  240. package/dist/lib/node/intent-resolver-2657YDOU.cjs +0 -69
  241. package/dist/lib/node/intent-resolver-2657YDOU.cjs.map +0 -7
  242. package/dist/lib/node/markdown-DBPOAYI7.cjs +0 -40
  243. package/dist/lib/node/markdown-DBPOAYI7.cjs.map +0 -7
  244. package/dist/lib/node/meta.json +0 -1
  245. package/dist/lib/node/react-surface-XQEIRKWU.cjs +0 -71
  246. package/dist/lib/node/react-surface-XQEIRKWU.cjs.map +0 -7
  247. package/dist/lib/node/types/index.cjs +0 -84
  248. package/dist/lib/node/types/index.cjs.map +0 -7
  249. package/dist/lib/node-esm/SheetContainer-V632Q4HA.mjs +0 -352
  250. package/dist/lib/node-esm/SheetContainer-V632Q4HA.mjs.map +0 -7
  251. package/dist/lib/node-esm/anchor-sort-JTNZOE67.mjs +0 -25
  252. package/dist/lib/node-esm/anchor-sort-JTNZOE67.mjs.map +0 -7
  253. package/dist/lib/node-esm/chunk-C4IKYVTV.mjs +0 -893
  254. package/dist/lib/node-esm/chunk-C4IKYVTV.mjs.map +0 -7
  255. package/dist/lib/node-esm/chunk-IQ76YE6M.mjs +0 -16
  256. package/dist/lib/node-esm/chunk-IQ76YE6M.mjs.map +0 -7
  257. package/dist/lib/node-esm/chunk-NMCVJWDT.mjs.map +0 -7
  258. package/dist/lib/node-esm/chunk-SOC52B67.mjs +0 -848
  259. package/dist/lib/node-esm/chunk-SOC52B67.mjs.map +0 -7
  260. package/dist/lib/node-esm/chunk-Y6ND5HWX.mjs +0 -20
  261. package/dist/lib/node-esm/chunk-Y6ND5HWX.mjs.map +0 -7
  262. package/dist/lib/node-esm/compute-graph-registry-7PDWXMHF.mjs +0 -31
  263. package/dist/lib/node-esm/compute-graph-registry-7PDWXMHF.mjs.map +0 -7
  264. package/dist/lib/node-esm/intent-resolver-M2HNR7PJ.mjs +0 -57
  265. package/dist/lib/node-esm/intent-resolver-M2HNR7PJ.mjs.map +0 -7
  266. package/dist/lib/node-esm/markdown-WWUJ3E5F.mjs +0 -27
  267. package/dist/lib/node-esm/markdown-WWUJ3E5F.mjs.map +0 -7
  268. package/dist/lib/node-esm/react-surface-OLXO2MVB.mjs +0 -54
  269. package/dist/lib/node-esm/react-surface-OLXO2MVB.mjs.map +0 -7
  270. package/dist/types/src/capabilities/anchor-sort.d.ts +0 -6
  271. package/dist/types/src/capabilities/anchor-sort.d.ts.map +0 -1
  272. package/dist/types/src/capabilities/capabilities.d.ts +0 -5
  273. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  274. package/dist/types/src/capabilities/compute-graph-registry.d.ts +0 -4
  275. package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +0 -1
  276. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  277. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  278. package/dist/types/src/capabilities/markdown.d.ts +0 -6
  279. package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
  280. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  281. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  282. package/dist/types/src/extensions/editor/extension.d.ts.map +0 -1
  283. package/dist/types/src/extensions/editor/extension.test.d.ts +0 -2
  284. package/dist/types/src/extensions/editor/extension.test.d.ts.map +0 -1
  285. package/dist/types/src/testing/playwright/sheet-manager.d.ts.map +0 -1
  286. package/dist/types/src/testing/playwright/sheet.spec.d.ts.map +0 -1
  287. package/dist/types/src/types/schema.d.ts +0 -37
  288. package/dist/types/src/types/schema.d.ts.map +0 -1
  289. package/src/capabilities/anchor-sort.ts +0 -22
  290. package/src/capabilities/capabilities.ts +0 -14
  291. package/src/capabilities/compute-graph-registry.ts +0 -28
  292. package/src/capabilities/intent-resolver.ts +0 -38
  293. package/src/capabilities/markdown.ts +0 -22
  294. package/src/capabilities/react-surface.tsx +0 -39
  295. package/src/testing/playwright/playwright.config.cts +0 -18
  296. package/src/types/schema.ts +0 -60
  297. /package/dist/types/src/{testing/playwright → playwright}/sheet.spec.d.ts +0 -0
@@ -2,28 +2,63 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
- import { type Meta } from '@storybook/react';
5
+ import { type Meta } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
8
7
  import React from 'react';
9
8
 
10
- import { Capabilities, contributes, createResolver, IntentPlugin } from '@dxos/app-framework';
9
+ import { Capabilities, Capability } from '@dxos/app-framework';
11
10
  import { withPluginManager } from '@dxos/app-framework/testing';
12
- import { GraphPlugin } from '@dxos/plugin-graph';
13
- import { fullyQualifiedId, useSpace } from '@dxos/react-client/echo';
11
+ import { Obj } from '@dxos/echo';
12
+ import { OperationResolver } from '@dxos/operation';
13
+ import { corePlugins } from '@dxos/plugin-testing';
14
+ import { useSpace } from '@dxos/react-client/echo';
14
15
  import { withClientProvider } from '@dxos/react-client/testing';
16
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
15
17
  import { AttendableContainer } from '@dxos/react-ui-attention';
16
- import { withAttention } from '@dxos/react-ui-attention/testing';
17
- import { withTheme, withLayout } from '@dxos/storybook-utils';
18
18
 
19
- import { SheetContainer } from './SheetContainer';
20
19
  import { createTestCells, useTestSheet, withComputeGraphDecorator } from '../../testing';
21
- import translations from '../../translations';
22
- import { SheetAction, SheetType } from '../../types';
20
+ import { translations } from '../../translations';
21
+ import { Sheet, SheetOperation } from '../../types';
23
22
  import { useComputeGraph } from '../ComputeGraph';
24
23
  import { RangeList } from '../RangeList';
25
24
 
26
- export const Basic = () => {
25
+ import { SheetContainer } from './SheetContainer';
26
+
27
+ const meta = {
28
+ title: 'plugins/plugin-sheet/SheetContainer',
29
+ component: SheetContainer,
30
+ decorators: [
31
+ withTheme(),
32
+ withLayout({ layout: 'fullscreen' }),
33
+ withClientProvider({ types: [Sheet.Sheet], createSpace: true }),
34
+ withComputeGraphDecorator(),
35
+ // TODO(wittjosiah): Consider whether we should refactor component so story doesn't need to depend on intents.
36
+ withPluginManager({
37
+ plugins: [...corePlugins()],
38
+ capabilities: [
39
+ Capability.contributes(Capabilities.OperationResolver, [
40
+ OperationResolver.make({
41
+ operation: SheetOperation.DropAxis,
42
+ handler: ({ model, axis, axisIndex }) =>
43
+ Effect.sync(() => {
44
+ model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
45
+ // Return stub output for story purposes.
46
+ return { axis, axisIndex, index: 0, axisMeta: null, values: [] };
47
+ }),
48
+ }),
49
+ ]),
50
+ ],
51
+ }),
52
+ ],
53
+ parameters: {
54
+ layout: 'fullscreen',
55
+ translations,
56
+ },
57
+ } satisfies Meta<typeof SheetContainer>;
58
+
59
+ export default meta;
60
+
61
+ export const Default = () => {
27
62
  const space = useSpace();
28
63
  const graph = useComputeGraph(space);
29
64
  const sheet = useTestSheet(space, graph, { cells: createTestCells() });
@@ -32,12 +67,31 @@ export const Basic = () => {
32
67
  }
33
68
 
34
69
  return (
35
- <AttendableContainer id={fullyQualifiedId(sheet)} classNames='contents'>
36
- <SheetContainer space={space} sheet={sheet} role='article' ignoreAttention />
70
+ <AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
71
+ <SheetContainer role='article' space={space} subject={sheet} ignoreAttention />
37
72
  </AttendableContainer>
38
73
  );
39
74
  };
40
75
 
76
+ export const Section = () => {
77
+ const space = useSpace();
78
+ const graph = useComputeGraph(space);
79
+ const sheet = useTestSheet(space, graph, { cells: createTestCells() });
80
+ if (!sheet || !space) {
81
+ return null;
82
+ }
83
+
84
+ return (
85
+ <div className='is-full flex justify-center'>
86
+ <div className='is-[40rem]'>
87
+ <AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
88
+ <SheetContainer role='section' space={space} subject={sheet} ignoreAttention />
89
+ </AttendableContainer>
90
+ </div>
91
+ </div>
92
+ );
93
+ };
94
+
41
95
  export const Spec = () => {
42
96
  const space = useSpace();
43
97
  const graph = useComputeGraph(space);
@@ -47,9 +101,9 @@ export const Spec = () => {
47
101
  }
48
102
 
49
103
  return (
50
- <AttendableContainer id={fullyQualifiedId(sheet)} classNames='contents'>
51
- <div role='none' className='grid grid-rows-[66%_33%] grid-cols-1'>
52
- <SheetContainer space={space} sheet={sheet} role='article' ignoreAttention />
104
+ <AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
105
+ <div role='none' className='is-full grid grid-cols-[1fr_20rem]'>
106
+ <SheetContainer role='article' space={space} subject={sheet} ignoreAttention />
53
107
  <div role='none' data-testid='grid.range-list'>
54
108
  <RangeList sheet={sheet} />
55
109
  </div>
@@ -57,33 +111,3 @@ export const Spec = () => {
57
111
  </AttendableContainer>
58
112
  );
59
113
  };
60
-
61
- const meta: Meta = {
62
- title: 'plugins/plugin-sheet/SheetContainer',
63
- component: SheetContainer,
64
- decorators: [
65
- withClientProvider({ types: [SheetType], createSpace: true }),
66
- withComputeGraphDecorator(),
67
- withTheme,
68
- withLayout({ fullscreen: true, classNames: 'grid' }),
69
- withAttention,
70
- // TODO(wittjosiah): Consider whether we should refactor component so story doesn't need to depend on intents.
71
- withPluginManager({
72
- plugins: [IntentPlugin(), GraphPlugin()],
73
- capabilities: [
74
- contributes(
75
- Capabilities.IntentResolver,
76
- createResolver({
77
- intent: SheetAction.DropAxis,
78
- resolve: ({ model, axis, axisIndex }) => {
79
- model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
80
- },
81
- }),
82
- ),
83
- ],
84
- }),
85
- ],
86
- parameters: { translations },
87
- };
88
-
89
- export default meta;
@@ -2,35 +2,47 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import React from 'react';
5
+ import React, { Fragment } from 'react';
6
6
 
7
- import { fullyQualifiedId, type Space } from '@dxos/react-client/echo';
8
- import { StackItem } from '@dxos/react-ui-stack';
7
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
8
+ import { Obj } from '@dxos/echo';
9
+ import { type Space } from '@dxos/react-client/echo';
10
+ import { Flex, type FlexProps, Layout } from '@dxos/react-ui';
9
11
 
10
- import { type SheetType } from '../../types';
12
+ import { type Sheet } from '../../types';
11
13
  import { useComputeGraph } from '../ComputeGraph';
12
14
  import { FunctionEditor } from '../FunctionEditor';
13
15
  import { GridSheet } from '../GridSheet';
14
16
  import { SheetProvider } from '../SheetContext';
15
17
  import { SheetToolbar } from '../SheetToolbar';
16
18
 
17
- export type SheetContainerProps = {
18
- space: Space;
19
- sheet: SheetType;
20
- role?: string;
21
- ignoreAttention?: boolean;
22
- };
19
+ export type SheetContainerProps = SurfaceComponentProps<
20
+ Sheet.Sheet,
21
+ {
22
+ space: Space;
23
+ ignoreAttention?: boolean;
24
+ }
25
+ >;
23
26
 
24
- export const SheetContainer = ({ space, sheet, role, ignoreAttention }: SheetContainerProps) => {
27
+ export const SheetContainer = ({ role, subject: sheet, space, ignoreAttention }: SheetContainerProps) => {
25
28
  const graph = useComputeGraph(space);
29
+ if (!graph) {
30
+ return null;
31
+ }
32
+
33
+ const Root = role === 'section' ? Container : Fragment;
26
34
 
27
- return graph ? (
35
+ return (
28
36
  <SheetProvider sheet={sheet} graph={graph} ignoreAttention={ignoreAttention}>
29
- <StackItem.Content toolbar statusbar {...(role === 'section' && { classNames: 'aspect-video' })}>
30
- <SheetToolbar id={fullyQualifiedId(sheet)} />
31
- <GridSheet />
32
- <FunctionEditor />
33
- </StackItem.Content>
37
+ <Root>
38
+ <Layout.Main toolbar statusbar>
39
+ <SheetToolbar id={Obj.getDXN(sheet).toString()} />
40
+ <GridSheet />
41
+ <FunctionEditor />
42
+ </Layout.Main>
43
+ </Root>
34
44
  </SheetProvider>
35
- ) : null;
45
+ );
36
46
  };
47
+
48
+ const Container = (props: FlexProps) => <Flex {...props} classNames='aspect-square' />;
@@ -4,9 +4,9 @@
4
4
 
5
5
  import React, { type PropsWithChildren, createContext, useCallback, useContext, useState } from 'react';
6
6
 
7
- import { type ComputeGraph, type CellAddress, type CellRange, type CompleteCellRange } from '@dxos/compute';
7
+ import { type CellAddress, type CellRange, type CompleteCellRange, type ComputeGraph } from '@dxos/compute';
8
+ import { Obj } from '@dxos/echo';
8
9
  import { invariant } from '@dxos/invariant';
9
- import { fullyQualifiedId } from '@dxos/react-client/echo';
10
10
  import {
11
11
  Grid,
12
12
  type GridContentProps,
@@ -16,7 +16,7 @@ import {
16
16
  } from '@dxos/react-ui-grid';
17
17
 
18
18
  import { type SheetModel, useSheetModel } from '../../model';
19
- import { type SheetType } from '../../types';
19
+ import { type Sheet } from '../../types';
20
20
 
21
21
  export type SheetContextValue = {
22
22
  id: string;
@@ -56,12 +56,12 @@ export const useSheetContext = (): SheetContextValue => {
56
56
  };
57
57
 
58
58
  const SheetProviderImpl = ({
59
+ __gridScope,
60
+ children,
61
+ ignoreAttention,
59
62
  model,
60
63
  onInfo,
61
- ignoreAttention,
62
- children,
63
- __gridScope,
64
- }: GridScopedProps<PropsWithChildren<Pick<SheetContextValue, 'onInfo' | 'model' | 'ignoreAttention'>>>) => {
64
+ }: GridScopedProps<PropsWithChildren<Pick<SheetContextValue, 'ignoreAttention' | 'model' | 'onInfo'>>>) => {
65
65
  const { id, editing, setEditing } = useGridContext('SheetProvider', __gridScope);
66
66
 
67
67
  const [cursor, setCursorInternal] = useState<CellAddress>();
@@ -114,7 +114,7 @@ const SheetProviderImpl = ({
114
114
 
115
115
  export type SheetProviderProps = {
116
116
  graph: ComputeGraph;
117
- sheet: SheetType;
117
+ sheet: Sheet.Sheet;
118
118
  readonly?: boolean;
119
119
  ignoreAttention?: boolean;
120
120
  } & Pick<SheetContextValue, 'onInfo'>;
@@ -130,7 +130,7 @@ export const SheetProvider = ({
130
130
  const model = useSheetModel(graph, sheet, { readonly });
131
131
 
132
132
  return !model ? null : (
133
- <Grid.Root id={fullyQualifiedId(sheet)}>
133
+ <Grid.Root id={Obj.getDXN(sheet).toString()}>
134
134
  <SheetProviderImpl model={model} onInfo={onInfo} ignoreAttention={ignoreAttention}>
135
135
  {children}
136
136
  </SheetProviderImpl>
@@ -2,28 +2,34 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
- import { type Meta } from '@storybook/react';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
10
- import { withLayout, withTheme } from '@dxos/storybook-utils';
8
+ import { withTheme } from '@dxos/react-ui/testing';
9
+
10
+ import { translations } from '../../translations';
11
11
 
12
12
  import { SheetToolbar } from './SheetToolbar';
13
- import translations from '../../translations';
14
13
 
15
14
  const DefaultStory = () => {
16
- return <SheetToolbar id='test' />;
15
+ // TODO(wittjosiah): Depends on SheetProvider.
16
+ // return <SheetToolbar id='test' />;
17
+ return <>TODO</>;
17
18
  };
18
19
 
19
- export const Default = {};
20
-
21
- const meta: Meta = {
20
+ const meta = {
22
21
  title: 'plugins/plugin-sheet/Toolbar',
23
- component: SheetToolbar,
22
+ component: SheetToolbar as any,
24
23
  render: DefaultStory,
25
- decorators: [withTheme, withLayout()],
26
- parameters: { translations, layout: 'fullscreen' },
27
- };
24
+ decorators: [withTheme()],
25
+ parameters: {
26
+ layout: 'fullscreen',
27
+ translations,
28
+ },
29
+ } satisfies Meta<typeof DefaultStory>;
28
30
 
29
31
  export default meta;
32
+
33
+ type Story = StoryObj<typeof meta>;
34
+
35
+ export const Default: Story = {};
@@ -2,83 +2,93 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Rx } from '@effect-rx/rx-react';
6
- import React, { type PropsWithChildren, useMemo } from 'react';
5
+ import { Atom, type Registry, RegistryContext } from '@effect-atom/atom-react';
6
+ import React, { type PropsWithChildren, useContext, useMemo } from 'react';
7
7
 
8
- import { useAppGraph } from '@dxos/app-framework';
8
+ import { useAppGraph } from '@dxos/app-toolkit/ui';
9
9
  import { type CompleteCellRange } from '@dxos/compute';
10
- import { type ThemedClassName } from '@dxos/react-ui';
11
10
  import {
12
- type ActionGraphEdges,
13
- type ActionGraphNodes,
14
11
  type ActionGraphProps,
15
- createGapSeparator,
16
12
  MenuProvider,
17
- rxFromSignal,
18
13
  ToolbarMenu,
14
+ createGapSeparator,
19
15
  useMenuActions,
20
16
  } from '@dxos/react-ui-menu';
21
17
 
22
- import { createAlign, useAlignState } from './align';
23
- import { createStyle, useStyleState } from './style';
24
- import { type ToolbarState, useToolbarState } from './useToolbarState';
25
18
  import { type SheetModel } from '../../model';
26
19
  import { useSheetContext } from '../SheetContext';
27
20
 
28
- //
29
- // Root
30
- //
21
+ import { createAlign, useAlignState } from './align';
22
+ import { createStyle, useStyleState } from './style';
23
+ import { type ToolbarStateAtom, useToolbarState } from './useToolbarState';
31
24
 
32
- export type SheetToolbarProps = ThemedClassName<PropsWithChildren<{ id: string }>>;
25
+ type ToolbarActionsContext = {
26
+ model: SheetModel;
27
+ stateAtom: ToolbarStateAtom;
28
+ registry: Registry.Registry;
29
+ cursorFallbackRange?: CompleteCellRange;
30
+ customActions?: Atom.Atom<ActionGraphProps>;
31
+ };
33
32
 
34
- const createToolbarActions = (
35
- model: SheetModel,
36
- state: ToolbarState,
37
- cursorFallbackRange?: CompleteCellRange,
38
- customActions?: Rx.Rx<ActionGraphProps>,
39
- ) => {
40
- return Rx.make((get) => {
41
- const align = get(rxFromSignal(() => createAlign(model, state, cursorFallbackRange)));
42
- const style = get(rxFromSignal(() => createStyle(model, state, cursorFallbackRange)));
33
+ const createToolbarActions = ({
34
+ model,
35
+ stateAtom,
36
+ registry,
37
+ cursorFallbackRange,
38
+ customActions,
39
+ }: ToolbarActionsContext): Atom.Atom<ActionGraphProps> => {
40
+ return Atom.make((get) => {
41
+ const state = get(stateAtom);
42
+ const context = { model, state, stateAtom, registry, cursorFallbackRange };
43
+ const align = createAlign(context);
44
+ const style = createStyle(context);
43
45
  const gap = createGapSeparator();
44
- const nodes: ActionGraphNodes = [...align.nodes, ...style.nodes, ...gap.nodes];
45
- const edges: ActionGraphEdges = [...align.edges, ...style.edges, ...gap.edges];
46
+
47
+ const graph: ActionGraphProps = {
48
+ nodes: [...align.nodes, ...style.nodes, ...gap.nodes],
49
+ edges: [...align.edges, ...style.edges, ...gap.edges],
50
+ };
51
+
46
52
  if (customActions) {
47
53
  const custom = get(customActions);
48
- nodes.push(...custom.nodes);
49
- edges.push(...custom.edges);
54
+ graph.nodes.push(...custom.nodes);
55
+ graph.edges.push(...custom.edges);
50
56
  }
51
- return {
52
- nodes,
53
- edges,
54
- };
57
+
58
+ return graph;
55
59
  });
56
60
  };
57
61
 
58
- export const SheetToolbar = ({ id, classNames }: SheetToolbarProps) => {
62
+ export type SheetToolbarProps = PropsWithChildren<{ id: string }>;
63
+
64
+ export const SheetToolbar = ({ id }: SheetToolbarProps) => {
59
65
  const { model, cursorFallbackRange } = useSheetContext();
60
- const state = useToolbarState({});
61
- useAlignState(state);
62
- useStyleState(state);
66
+ const stateAtom = useToolbarState({});
67
+ const registry = useContext(RegistryContext);
68
+ useAlignState(stateAtom);
69
+ useStyleState(stateAtom);
63
70
 
64
71
  const { graph } = useAppGraph();
65
72
  const customActions = useMemo(() => {
66
- return Rx.make((get) => {
73
+ return Atom.make((get) => {
67
74
  const actions = get(graph.actions(id));
68
75
  const nodes = actions.filter((action) => action.properties.disposition === 'toolbar');
69
- return { nodes, edges: nodes.map((node) => ({ source: 'root', target: node.id })) };
76
+ return {
77
+ nodes,
78
+ edges: nodes.map((node) => ({ source: 'root', target: node.id })),
79
+ };
70
80
  });
71
- }, [graph]);
81
+ }, [graph, id]);
72
82
 
73
83
  const actionsCreator = useMemo(
74
- () => createToolbarActions(model, state, cursorFallbackRange, customActions),
75
- [model, state, cursorFallbackRange, customActions],
84
+ () => createToolbarActions({ model, stateAtom, registry, cursorFallbackRange, customActions }),
85
+ [model, stateAtom, registry, cursorFallbackRange, customActions],
76
86
  );
77
87
  const menu = useMenuActions(actionsCreator);
78
88
 
79
89
  return (
80
90
  <MenuProvider {...menu} attendableId={id}>
81
- <ToolbarMenu classNames={classNames} />
91
+ <ToolbarMenu />
82
92
  </MenuProvider>
83
93
  );
84
94
  };
@@ -2,17 +2,25 @@
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
8
  import { type CompleteCellRange, inRange } from '@dxos/compute';
8
- import { createMenuAction, createMenuItemGroup, type ToolbarMenuActionGroupProperties } from '@dxos/react-ui-menu';
9
+ import { Obj } from '@dxos/echo';
10
+ import {
11
+ type ActionGraphProps,
12
+ type ToolbarMenuActionGroupProperties,
13
+ createMenuAction,
14
+ createMenuItemGroup,
15
+ } from '@dxos/react-ui-menu';
9
16
 
10
- import { type ToolbarState } from './useToolbarState';
11
- import { SHEET_PLUGIN } from '../../meta';
17
+ import { meta } from '../../meta';
12
18
  import { type SheetModel } from '../../model';
13
- import { type AlignKey, alignKey, type AlignValue, rangeFromIndex, rangeToIndex } from '../../types';
19
+ import { type AlignKey, type AlignValue, alignKey, rangeFromIndex, rangeToIndex } from '../../types';
14
20
  import { useSheetContext } from '../SheetContext';
15
21
 
22
+ import { type ToolbarState, type ToolbarStateAtom } from './useToolbarState';
23
+
16
24
  export type AlignAction = { key: AlignKey; value: AlignValue };
17
25
 
18
26
  export type AlignState = { [alignKey]: AlignValue | undefined };
@@ -23,29 +31,40 @@ const aligns: Record<AlignValue, string> = {
23
31
  end: 'ph--text-align-right--regular',
24
32
  };
25
33
 
26
- export const useAlignState = (state: Partial<AlignState>) => {
34
+ export const useAlignState = (stateAtom: ToolbarStateAtom) => {
35
+ const registry = useContext(RegistryContext);
27
36
  const { cursor, model } = useSheetContext();
28
37
  useEffect(() => {
29
38
  // TODO(thure): Can this O(n) call be memoized?
30
- state[alignKey] = (
39
+ const alignValue = (
31
40
  cursor
32
41
  ? model.sheet.ranges?.findLast(
33
42
  ({ range, key }) => key === alignKey && inRange(rangeFromIndex(model.sheet, range), cursor),
34
43
  )?.value
35
44
  : undefined
36
45
  ) as AlignValue | undefined;
37
- }, [cursor, model.sheet]);
46
+ const prev = registry.get(stateAtom);
47
+ registry.set(stateAtom, { ...prev, [alignKey]: alignValue });
48
+ }, [cursor, model.sheet, registry, stateAtom]);
38
49
  };
39
50
 
40
51
  const createAlignGroupAction = (value?: AlignValue) =>
41
52
  createMenuItemGroup('align', {
42
- label: ['align label', { ns: SHEET_PLUGIN }],
53
+ label: ['align label', { ns: meta.id }],
43
54
  variant: 'toggleGroup',
44
55
  selectCardinality: 'single',
45
56
  value: `${alignKey}--${value}`,
46
57
  } as ToolbarMenuActionGroupProperties);
47
58
 
48
- const createAlignActions = (model: SheetModel, state: ToolbarState, cursorFallbackRange?: CompleteCellRange) =>
59
+ type AlignActionsContext = {
60
+ model: SheetModel;
61
+ state: ToolbarState;
62
+ stateAtom: ToolbarStateAtom;
63
+ registry: Registry.Registry;
64
+ cursorFallbackRange?: CompleteCellRange;
65
+ };
66
+
67
+ const createAlignActions = ({ model, state, stateAtom, registry, cursorFallbackRange }: AlignActionsContext) =>
49
68
  Object.entries(aligns).map(([alignValue, icon]) => {
50
69
  return createMenuAction<AlignAction>(
51
70
  `${alignKey}--${alignValue}`,
@@ -63,31 +82,38 @@ const createAlignActions = (model: SheetModel, state: ToolbarState, cursorFallba
63
82
  key: alignKey,
64
83
  value: alignValue as AlignValue,
65
84
  };
85
+ const currentState = registry.get(stateAtom);
66
86
  if (index < 0) {
67
- model.sheet.ranges?.push(nextRangeEntity);
68
- state[alignKey] = nextRangeEntity.value;
87
+ Obj.change(model.sheet, (obj) => {
88
+ obj.ranges?.push(nextRangeEntity);
89
+ });
90
+ registry.set(stateAtom, { ...currentState, [alignKey]: nextRangeEntity.value });
69
91
  } else if (model.sheet.ranges![index].value === nextRangeEntity.value) {
70
- model.sheet.ranges?.splice(index, 1);
71
- state[alignKey] = undefined;
92
+ Obj.change(model.sheet, (obj) => {
93
+ obj.ranges?.splice(index, 1);
94
+ });
95
+ registry.set(stateAtom, { ...currentState, [alignKey]: undefined });
72
96
  } else {
73
- model.sheet.ranges?.splice(index, 1, nextRangeEntity);
74
- state[alignKey] = nextRangeEntity.value;
97
+ Obj.change(model.sheet, (obj) => {
98
+ obj.ranges?.splice(index, 1, nextRangeEntity);
99
+ });
100
+ registry.set(stateAtom, { ...currentState, [alignKey]: nextRangeEntity.value });
75
101
  }
76
102
  },
77
103
  {
78
104
  key: alignKey,
79
105
  value: alignValue as AlignValue,
80
106
  checked: state[alignKey] === alignValue,
81
- label: [`range value ${alignValue} label`, { ns: SHEET_PLUGIN }],
107
+ label: [`range value ${alignValue} label`, { ns: meta.id }],
82
108
  icon,
83
109
  testId: `grid.toolbar.${alignKey}.${alignValue}`,
84
110
  },
85
111
  );
86
112
  });
87
113
 
88
- export const createAlign = (model: SheetModel, state: ToolbarState, cursorFallbackRange?: CompleteCellRange) => {
89
- const alignGroup = createAlignGroupAction(state[alignKey]);
90
- const alignActions = createAlignActions(model, state, cursorFallbackRange);
114
+ export const createAlign = (context: AlignActionsContext): ActionGraphProps => {
115
+ const alignGroup = createAlignGroupAction(context.state[alignKey]);
116
+ const alignActions = createAlignActions(context);
91
117
  return {
92
118
  nodes: [alignGroup, ...alignActions],
93
119
  edges: [