@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,16 +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 { SHEET_PLUGIN } from '../../meta';
17
+ import { meta } from '../../meta';
11
18
  import { type SheetModel } from '../../model';
12
- import { rangeFromIndex, rangeToIndex, type StyleKey, type StyleValue } from '../../types';
19
+ import { type StyleKey, type StyleValue, rangeFromIndex, rangeToIndex } from '../../types';
13
20
  import { useSheetContext } from '../SheetContext';
14
21
 
22
+ import { type ToolbarState, type ToolbarStateAtom } from './useToolbarState';
23
+
15
24
  export type StyleState = Partial<Record<StyleValue, boolean>>;
16
25
 
17
26
  export type StyleAction = { key: StyleKey; value: StyleValue };
@@ -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,27 +103,31 @@ 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.change(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.change(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: SHEET_PLUGIN }],
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: [
@@ -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,31 +2,32 @@
2
2
  // Copyright 2023 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, { useEffect, useMemo } from 'react';
9
7
 
8
+ import { OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
9
+ import { withPluginManager } from '@dxos/app-framework/testing';
10
10
  import { PublicKey } from '@dxos/keys';
11
11
  import { useSpace } 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';
15
+ import { useTextEditor } from '@dxos/react-ui-editor';
14
16
  import {
15
17
  createBasicExtensions,
16
18
  createMarkdownExtensions,
17
19
  createThemeExtensions,
18
20
  decorateMarkdown,
19
21
  documentId,
20
- useTextEditor,
21
- } from '@dxos/react-ui-editor';
22
- import { withTheme, withLayout } from '@dxos/storybook-utils';
22
+ } from '@dxos/ui-editor';
23
23
  import { isNonNullable } from '@dxos/util';
24
24
 
25
- import { compute, computeGraphFacet } from './compute';
26
25
  import { GridSheet, SheetProvider, useComputeGraph } from '../components';
27
26
  import { useSheetModel } from '../model';
28
27
  import { useTestSheet, withComputeGraphDecorator } from '../testing';
29
- import { SheetType } from '../types';
28
+ import { Sheet } from '../types';
29
+
30
+ import { compute, computeGraphFacet } from './compute';
30
31
 
31
32
  const str = (...lines: string[]) => lines.join('\n');
32
33
 
@@ -41,7 +42,7 @@ type EditorProps = {
41
42
 
42
43
  const SHEET_NAME = 'Test Sheet';
43
44
 
44
- const EditorStory = ({ text }: EditorProps) => {
45
+ const DefaultStory = ({ text }: EditorProps) => {
45
46
  const id = useMemo(() => PublicKey.random(), []);
46
47
  const { themeMode } = useThemeContext();
47
48
  const space = useSpace();
@@ -51,7 +52,7 @@ const EditorStory = ({ text }: EditorProps) => {
51
52
  initialValue: text,
52
53
  extensions: [
53
54
  createBasicExtensions(),
54
- createMarkdownExtensions({ themeMode }),
55
+ createMarkdownExtensions(),
55
56
  createThemeExtensions({ themeMode, syntaxHighlighting: true }),
56
57
  documentId.of(id.toHex()),
57
58
  computeGraph && computeGraphFacet.of(computeGraph),
@@ -62,7 +63,7 @@ const EditorStory = ({ text }: EditorProps) => {
62
63
  [computeGraph, themeMode],
63
64
  );
64
65
 
65
- return <div className='w-[40rem] overflow-hidden' ref={parentRef} {...focusAttributes} />;
66
+ return <div className='is-[40rem] overflow-hidden' ref={parentRef} {...focusAttributes} />;
66
67
  };
67
68
 
68
69
  const Grid = () => {
@@ -72,7 +73,12 @@ const Grid = () => {
72
73
  const model = useSheetModel(graph, sheet);
73
74
  useEffect(() => {
74
75
  if (model) {
75
- 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
+ });
76
82
  }
77
83
  }, [model]);
78
84
 
@@ -81,7 +87,7 @@ const Grid = () => {
81
87
  }
82
88
 
83
89
  return (
84
- <div className='flex w-[40rem] overflow-hidden'>
90
+ <div className='flex is-[40rem] overflow-hidden'>
85
91
  <SheetProvider graph={graph} sheet={sheet}>
86
92
  <GridSheet />
87
93
  </SheetProvider>
@@ -92,15 +98,35 @@ const Grid = () => {
92
98
  const GraphStory = (props: EditorProps) => {
93
99
  return (
94
100
  <div className='grid grid-rows-2'>
95
- <EditorStory {...props} />
101
+ <DefaultStory {...props} />
96
102
  <Grid />
97
103
  </div>
98
104
  );
99
105
  };
100
106
 
107
+ const meta = {
108
+ title: 'plugins/plugin-sheet/extensions',
109
+ decorators: [
110
+ withTheme(),
111
+ withClientProvider({
112
+ types: [Sheet.Sheet],
113
+ createIdentity: true,
114
+ createSpace: true,
115
+ }),
116
+ // TODO(wittjosiah): Try to write story which does not depend on plugin manager.
117
+ withPluginManager({ plugins: [OperationPlugin(), RuntimePlugin()] }),
118
+ withComputeGraphDecorator(),
119
+ ],
120
+ parameters: {
121
+ layout: 'fullscreen',
122
+ },
123
+ } satisfies Meta;
124
+
125
+ export default meta;
126
+
101
127
  // TODO(burdon): Inline formulae.
102
- export const Default = {
103
- render: EditorStory,
128
+ export const Default: StoryObj<typeof DefaultStory> = {
129
+ render: DefaultStory,
104
130
  args: {
105
131
  text: str(
106
132
  //
@@ -123,7 +149,7 @@ export const Default = {
123
149
  },
124
150
  };
125
151
 
126
- export const Graph = {
152
+ export const Graph: StoryObj<typeof GraphStory> = {
127
153
  render: GraphStory,
128
154
  args: {
129
155
  text: str(
@@ -140,16 +166,3 @@ export const Graph = {
140
166
  ),
141
167
  },
142
168
  };
143
-
144
- const meta: Meta = {
145
- title: 'plugins/plugin-sheet/extensions',
146
- decorators: [
147
- withClientProvider({ types: [SheetType], createIdentity: true, createSpace: true }),
148
- withComputeGraphDecorator(),
149
- withTheme,
150
- withLayout({ fullscreen: true, classNames: 'justify-center' }),
151
- ],
152
- parameters: { layout: 'fullscreen' },
153
- };
154
-
155
- export default meta;
@@ -16,14 +16,14 @@ import { Decoration, EditorView, ViewPlugin, WidgetType } from '@codemirror/view
16
16
 
17
17
  import { type CleanupFn, debounce } from '@dxos/async';
18
18
  import {
19
- createSheetName,
20
19
  type CellAddress,
21
20
  type CellScalarValue,
22
21
  type ComputeGraph,
23
22
  type ComputeNode,
23
+ createSheetName,
24
24
  } from '@dxos/compute';
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
 
@@ -34,7 +34,7 @@ export const computeGraphFacet = singleValueFacet<ComputeGraph>();
34
34
 
35
35
  export type ComputeOptions = {};
36
36
 
37
- export const compute = (options: ComputeOptions = {}): Extension => {
37
+ export const compute = (_options: ComputeOptions = {}): Extension => {
38
38
  let computeNode: ComputeNode | undefined;
39
39
 
40
40
  const update = (state: EditorState, current?: RangeSet<Decoration>) => {
@@ -53,7 +53,6 @@ export const compute = (options: ComputeOptions = {}): Extension => {
53
53
  const text = node.node.getChild('CodeText');
54
54
  if (type === LANGUAGE_TAG && text) {
55
55
  const formula = state.sliceDoc(text.from, text.to);
56
-
57
56
  const iter = current?.iter(node.node.from);
58
57
  if (iter?.value && iter?.value.spec.formula === formula) {
59
58
  // Add existing widget.
@@ -2,4 +2,4 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- export * from './extension';
5
+ export * from './sheet-extension';
@@ -10,7 +10,7 @@ import { describe, expect, test } from 'vitest';
10
10
 
11
11
  import { defaultFunctions } from '@dxos/compute';
12
12
 
13
- import { sheetExtension } from './extension';
13
+ import { sheetExtension } from './sheet-extension';
14
14
 
15
15
  describe('formula parser', () => {
16
16
  const {
@@ -20,8 +20,8 @@ import { spreadsheet } from 'codemirror-lang-spreadsheet';
20
20
 
21
21
  import { type FunctionDefinition } from '@dxos/compute';
22
22
  import { RANGE_NOTATION } from '@dxos/compute';
23
- import { singleValueFacet } from '@dxos/react-ui-editor';
24
- import { mx } from '@dxos/react-ui-theme';
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
@@ -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) ?? {};
@@ -166,7 +169,7 @@ 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]',
172
+ '!-left-[1px] !top-[33px] !-m-0 border !border-bs-0 [&>ul]:!min-w-[198px]',
170
173
  '[&>ul>li[aria-selected]]:!bg-accentSurface',
171
174
  'border-separator',
172
175
  ),
package/src/index.ts CHANGED
@@ -2,6 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export { SheetCapabilities } from './capabilities';
5
+ export { SheetCapabilities } from './types';
6
6
  export * from './meta';
7
7
  export * from './SheetPlugin';
@@ -2,28 +2,23 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema, pipe } from 'effect';
5
+ import * as Effect from 'effect/Effect';
6
6
  import { useCallback, useEffect, useMemo } from 'react';
7
7
 
8
- import {
9
- createIntent,
10
- createResolver,
11
- LayoutAction,
12
- useIntentResolver,
13
- useIntentDispatcher,
14
- chain,
15
- } from '@dxos/app-framework';
8
+ import { useOperationInvoker, useOperationResolver } from '@dxos/app-framework/ui';
9
+ import { LayoutOperation } from '@dxos/app-toolkit';
16
10
  import { debounce } from '@dxos/async';
17
11
  import { type CellAddress, type CompleteCellRange, inRange } from '@dxos/compute';
18
12
  import { Obj, Relation } from '@dxos/echo';
19
- import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
20
- import { ThreadAction, ThreadType } from '@dxos/plugin-thread/types';
21
- import { Filter, fullyQualifiedId, getSpace, Query, useQuery } from '@dxos/react-client/echo';
22
- import { type DxGridElement, type DxGridPosition, type GridContentProps } from '@dxos/react-ui-grid';
23
- import { AnchoredTo } from '@dxos/schema';
13
+ import { OperationResolver } from '@dxos/operation';
14
+ import { ATTENDABLE_PATH_SEPARATOR, DeckOperation } from '@dxos/plugin-deck/types';
15
+ import { ThreadOperation } from '@dxos/plugin-thread/types';
16
+ import { Filter, Query, useQuery } from '@dxos/react-client/echo';
17
+ import { type DxGridElement, type GridContentProps } from '@dxos/react-ui-grid';
18
+ import { AnchoredTo, Thread } from '@dxos/types';
24
19
 
25
20
  import { useSheetContext } from '../components';
26
- import { SHEET_PLUGIN } from '../meta';
21
+ import { meta } from '../meta';
27
22
 
28
23
  export const completeCellRangeToThreadCursor = (range: CompleteCellRange): string => {
29
24
  return `${range.from.col},${range.from.row},${range.to.col},${range.to.row}`;
@@ -44,43 +39,37 @@ export const parseThreadAnchorAsCellRange = (cursor: string): CompleteCellRange
44
39
 
45
40
  export const useUpdateFocusedCellOnThreadSelection = (grid: DxGridElement | null) => {
46
41
  const { model, setActiveRefs } = useSheetContext();
47
- const scrollIntoViewResolver = useMemo(
42
+ const sheetId = Obj.getDXN(model.sheet).toString();
43
+
44
+ const scrollIntoViewHandler = useMemo(
48
45
  () =>
49
- createResolver({
50
- intent: LayoutAction.ScrollIntoView,
46
+ OperationResolver.make({
47
+ operation: LayoutOperation.ScrollIntoView,
51
48
  position: 'hoist',
52
- filter: (
53
- data,
54
- ): data is {
55
- part: 'current';
56
- subject: string;
57
- options: { cursor: string; ref: GridContentProps['activeRefs'] };
58
- } => {
59
- if (!Schema.is(LayoutAction.ScrollIntoView.fields.input)(data)) {
60
- return false;
61
- }
62
-
63
- return data.subject === fullyQualifiedId(model.sheet) && !!data.options?.cursor;
64
- },
65
- resolve: ({ options: { cursor, ref } }) => {
66
- setActiveRefs(ref);
67
- // TODO(Zan): Everywhere we refer to the cursor in a thread context should change to `anchor`.
68
- const range = parseThreadAnchorAsCellRange(cursor!);
69
- range && grid?.setFocus({ ...range.to, plane: 'grid' }, true);
70
- },
49
+ filter: (input) => input.subject === sheetId && !!input.cursor,
50
+ handler: (input) =>
51
+ Effect.sync(() => {
52
+ const { cursor, ref } = input;
53
+ if (cursor) {
54
+ setActiveRefs(ref as GridContentProps['activeRefs']);
55
+ // TODO(Zan): Everywhere we refer to the cursor in a thread context should change to `anchor`.
56
+ const range = parseThreadAnchorAsCellRange(cursor);
57
+ range && grid?.setFocus({ ...range.to, plane: 'grid' }, true);
58
+ }
59
+ }),
71
60
  }),
72
- [model.sheet, setActiveRefs],
61
+ [sheetId, setActiveRefs, grid],
73
62
  );
74
63
 
75
- useIntentResolver(SHEET_PLUGIN, scrollIntoViewResolver);
64
+ useOperationResolver(meta.id, scrollIntoViewHandler);
76
65
  };
77
66
 
78
67
  export const useSelectThreadOnCellFocus = () => {
79
68
  const { model, cursor } = useSheetContext();
80
- const { dispatchPromise: dispatch } = useIntentDispatcher();
69
+ const { invokePromise } = useOperationInvoker();
81
70
 
82
- const space = getSpace(model.sheet);
83
- const anchors = useQuery(space, Query.select(Filter.ids(model.sheet.id)).targetOf(AnchoredTo));
71
+ const db = Obj.getDatabase(model.sheet);
72
+ const anchors = useQuery(db, Query.select(Filter.id(model.sheet.id)).targetOf(AnchoredTo.AnchoredTo));
84
73
 
85
74
  const selectClosestThread = useCallback(
86
75
  (cellAddress: CellAddress) => {
@@ -90,7 +79,7 @@ export const useSelectThreadOnCellFocus = () => {
90
79
 
91
80
  const closestThread = anchors.find((anchor) => {
92
81
  const source = Relation.getSource(anchor);
93
- if (anchor.anchor && Obj.instanceOf(ThreadType, source)) {
82
+ if (anchor.anchor && Obj.instanceOf(Thread.Thread, source)) {
94
83
  const range = parseThreadAnchorAsCellRange(anchor.anchor);
95
84
  return range ? inRange(range, cellAddress) : false;
96
85
  } else {
@@ -99,25 +88,28 @@ export const useSelectThreadOnCellFocus = () => {
99
88
  });
100
89
 
101
90
  if (closestThread) {
102
- const primary = fullyQualifiedId(model.sheet);
103
- const intent = pipe(
104
- createIntent(ThreadAction.Select, { current: fullyQualifiedId(closestThread) }),
105
- chain(DeckAction.ChangeCompanion, { primary, companion: `${primary}${ATTENDABLE_PATH_SEPARATOR}comments` }),
106
- );
107
- void dispatch(intent);
91
+ const primary = Obj.getDXN(model.sheet).toString();
92
+ void (async () => {
93
+ await invokePromise(ThreadOperation.Select, { current: Relation.getDXN(closestThread).toString() });
94
+ await invokePromise(DeckOperation.ChangeCompanion, {
95
+ primary,
96
+ companion: `${primary}${ATTENDABLE_PATH_SEPARATOR}comments`,
97
+ });
98
+ })();
108
99
  }
109
100
  },
110
- [dispatch, anchors],
101
+ [invokePromise, anchors],
111
102
  );
112
103
 
113
104
  const debounced = useMemo(() => {
114
- return debounce((cellCoords: DxGridPosition) => requestAnimationFrame(() => selectClosestThread(cellCoords)), 50);
105
+ return debounce((cellCoords: CellAddress) => requestAnimationFrame(() => selectClosestThread(cellCoords)), 50);
115
106
  }, [selectClosestThread]);
116
107
 
117
108
  useEffect(() => {
118
109
  if (!cursor) {
119
110
  return;
120
111
  }
112
+
121
113
  debounced(cursor);
122
114
  }, [cursor, debounced]);
123
115
  };
package/src/meta.ts CHANGED
@@ -2,16 +2,18 @@
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
+ import { trim } from '@dxos/util';
6
7
 
7
- export const SHEET_PLUGIN = 'dxos.org/plugin/sheet';
8
-
9
- export const meta: PluginMeta = {
10
- id: SHEET_PLUGIN,
8
+ export const meta: Plugin.Meta = {
9
+ id: 'dxos.org/plugin/sheet',
11
10
  name: 'Sheet',
12
- description:
13
- 'Sheets in Composer are simple spreadsheets which allow you to leverage custom functions inside of cell grids. Leverage more than 400 pre-built formulas like Sum, Average, Count, Max, Min along with many others. You can also deploy your own custom functions using the Scripts plugin. ',
11
+ description: trim`
12
+ Full-featured spreadsheet application with over 400 built-in formulas for calculations and data analysis.
13
+ Create custom JavaScript functions and integrate with AI agents for advanced automation.
14
+ `,
14
15
  icon: 'ph--grid-nine--regular',
16
+ iconHue: 'indigo',
15
17
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-sheet',
16
18
  screenshots: ['https://dxos.network/plugin-details-sheet-dark.png'],
17
19
  };
@@ -7,17 +7,18 @@ import { afterEach, beforeEach, describe, expect, onTestFinished, test } from 'v
7
7
  import { Trigger } from '@dxos/async';
8
8
  import { type CellScalarValue, addressFromA1Notation, isFormula } from '@dxos/compute';
9
9
  import { TestBuilder, testFunctionPlugins } from '@dxos/compute/testing';
10
- import { FunctionType } from '@dxos/functions';
10
+ import { Function } from '@dxos/functions';
11
11
  import { log } from '@dxos/log';
12
12
 
13
+ import { Sheet, mapFormulaIndicesToRefs, mapFormulaRefsToIndices } from '../types';
14
+
13
15
  import { SheetModel } from './sheet-model';
14
16
  import { createTestGrid } from './testing';
15
- import { createSheet, mapFormulaIndicesToRefs, mapFormulaRefsToIndices } from '../types';
16
17
 
17
18
  describe('SheetModel', () => {
18
19
  let testBuilder: TestBuilder;
19
20
  beforeEach(async () => {
20
- testBuilder = new TestBuilder({ types: [FunctionType], plugins: testFunctionPlugins });
21
+ testBuilder = new TestBuilder({ types: [Function.Function], plugins: testFunctionPlugins });
21
22
  await testBuilder.open();
22
23
  });
23
24
  afterEach(async () => {
@@ -30,7 +31,7 @@ describe('SheetModel', () => {
30
31
  await graph.open();
31
32
 
32
33
  // TODO(burdon): Create via factory.
33
- const sheet = createSheet({ rows: 5, columns: 5 });
34
+ const sheet = Sheet.make({ rows: 5, columns: 5 });
34
35
  const model = new SheetModel(graph, sheet);
35
36
  await model.open();
36
37
  testBuilder.ctx.onDispose(() => model.close());