@dxos/plugin-sheet 0.8.4-main.fd6878d → 0.8.4-staging.60fe92afc8

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 (393) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +359 -0
  3. package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs +46 -0
  4. package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs.map +7 -0
  5. package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs +33 -0
  6. package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs.map +7 -0
  7. package/dist/lib/neutral/SheetPlugin.mjs +63 -0
  8. package/dist/lib/neutral/SheetPlugin.mjs.map +7 -0
  9. package/dist/lib/neutral/SheetPlugin.node.mjs +27 -0
  10. package/dist/lib/neutral/SheetPlugin.node.mjs.map +7 -0
  11. package/dist/lib/neutral/SheetPlugin.workerd.mjs +21 -0
  12. package/dist/lib/neutral/SheetPlugin.workerd.mjs.map +7 -0
  13. package/dist/lib/neutral/anchor-sort-2POWTKTD.mjs +22 -0
  14. package/dist/lib/neutral/anchor-sort-2POWTKTD.mjs.map +7 -0
  15. package/dist/lib/neutral/app-graph-builder-2QP6GYB2.mjs +67 -0
  16. package/dist/lib/neutral/app-graph-builder-2QP6GYB2.mjs.map +7 -0
  17. package/dist/lib/neutral/capabilities/index.mjs +29 -0
  18. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  19. package/dist/lib/neutral/chunk-BGR7FVNF.mjs +8 -0
  20. package/dist/lib/neutral/chunk-BGR7FVNF.mjs.map +7 -0
  21. package/dist/lib/{browser/chunk-VTTKAHAY.mjs → neutral/chunk-ERHMBRSU.mjs} +16 -16
  22. package/dist/lib/neutral/chunk-ERHMBRSU.mjs.map +7 -0
  23. package/dist/lib/neutral/chunk-FQHTXKMF.mjs +34 -0
  24. package/dist/lib/neutral/chunk-FQHTXKMF.mjs.map +7 -0
  25. package/dist/lib/neutral/chunk-HEN74ZWI.mjs +83 -0
  26. package/dist/lib/neutral/chunk-HEN74ZWI.mjs.map +7 -0
  27. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  28. package/dist/lib/neutral/chunk-KUWATEHB.mjs +374 -0
  29. package/dist/lib/neutral/chunk-KUWATEHB.mjs.map +7 -0
  30. package/dist/lib/neutral/chunk-S2UNH6VD.mjs +10 -0
  31. package/dist/lib/neutral/chunk-S2UNH6VD.mjs.map +7 -0
  32. package/dist/lib/neutral/comment-config-WGXXX5FG.mjs +22 -0
  33. package/dist/lib/neutral/comment-config-WGXXX5FG.mjs.map +7 -0
  34. package/dist/lib/neutral/components/index.mjs +1552 -0
  35. package/dist/lib/neutral/components/index.mjs.map +7 -0
  36. package/dist/lib/neutral/compute-graph-registry-YYINTFC2.mjs +26 -0
  37. package/dist/lib/neutral/compute-graph-registry-YYINTFC2.mjs.map +7 -0
  38. package/dist/lib/neutral/containers/index.mjs +11 -0
  39. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  40. package/dist/lib/neutral/create-object-TDQQ24IB.mjs +31 -0
  41. package/dist/lib/neutral/create-object-TDQQ24IB.mjs.map +7 -0
  42. package/dist/lib/neutral/drop-axis-WSWFOLQN.mjs +23 -0
  43. package/dist/lib/neutral/drop-axis-WSWFOLQN.mjs.map +7 -0
  44. package/dist/lib/{node-esm/types → neutral}/index.mjs +22 -13
  45. package/dist/lib/neutral/insert-axis-6UQJTIWC.mjs +16 -0
  46. package/dist/lib/neutral/insert-axis-6UQJTIWC.mjs.map +7 -0
  47. package/dist/lib/neutral/markdown-extension-HTJDICGT.mjs +28 -0
  48. package/dist/lib/neutral/markdown-extension-HTJDICGT.mjs.map +7 -0
  49. package/dist/lib/neutral/meta.json +1 -0
  50. package/dist/lib/neutral/meta.mjs +8 -0
  51. package/dist/lib/neutral/meta.mjs.map +7 -0
  52. package/dist/lib/neutral/navigation-resolver-FXEZYO7G.mjs +14 -0
  53. package/dist/lib/neutral/navigation-resolver-FXEZYO7G.mjs.map +7 -0
  54. package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs +13 -0
  55. package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs.map +7 -0
  56. package/dist/lib/neutral/operations/index.mjs +8 -0
  57. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  58. package/dist/lib/neutral/plugin.mjs +16 -0
  59. package/dist/lib/neutral/plugin.mjs.map +7 -0
  60. package/dist/lib/neutral/react-surface-4H3PC4WG.mjs +44 -0
  61. package/dist/lib/neutral/react-surface-4H3PC4WG.mjs.map +7 -0
  62. package/dist/lib/neutral/restore-axis-AMMVTPS3.mjs +16 -0
  63. package/dist/lib/neutral/restore-axis-AMMVTPS3.mjs.map +7 -0
  64. package/dist/lib/neutral/scroll-to-anchor-FK2CXCQR.mjs +33 -0
  65. package/dist/lib/neutral/scroll-to-anchor-FK2CXCQR.mjs.map +7 -0
  66. package/dist/lib/neutral/state-HPA27MX2.mjs +29 -0
  67. package/dist/lib/neutral/state-HPA27MX2.mjs.map +7 -0
  68. package/dist/lib/neutral/testing/index.mjs +103 -0
  69. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  70. package/dist/lib/neutral/translations.mjs +56 -0
  71. package/dist/lib/neutral/translations.mjs.map +7 -0
  72. package/dist/lib/{browser → neutral}/types/index.mjs +8 -12
  73. package/dist/lib/neutral/types/index.mjs.map +7 -0
  74. package/dist/lib/neutral/undo-mappings-3FQLSTCZ.mjs +31 -0
  75. package/dist/lib/neutral/undo-mappings-3FQLSTCZ.mjs.map +7 -0
  76. package/dist/types/src/SheetPlugin.d.ts +3 -1
  77. package/dist/types/src/SheetPlugin.d.ts.map +1 -1
  78. package/dist/types/src/SheetPlugin.node.d.ts +4 -0
  79. package/dist/types/src/SheetPlugin.node.d.ts.map +1 -0
  80. package/dist/types/src/SheetPlugin.test.d.ts +2 -0
  81. package/dist/types/src/SheetPlugin.test.d.ts.map +1 -0
  82. package/dist/types/src/SheetPlugin.workerd.d.ts +4 -0
  83. package/dist/types/src/SheetPlugin.workerd.d.ts.map +1 -0
  84. package/dist/types/src/capabilities/anchor-sort.d.ts +4 -4
  85. package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -1
  86. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  87. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  88. package/dist/types/src/capabilities/comment-config.d.ts +6 -0
  89. package/dist/types/src/capabilities/comment-config.d.ts.map +1 -0
  90. package/dist/types/src/capabilities/compute-graph-registry.d.ts +9 -2
  91. package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +1 -1
  92. package/dist/types/src/capabilities/create-object.d.ts +11 -0
  93. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  94. package/dist/types/src/capabilities/index.d.ts +19 -11
  95. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  96. package/dist/types/src/capabilities/markdown-extension.d.ts +5 -0
  97. package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -0
  98. package/dist/types/src/capabilities/navigation-resolver.d.ts +6 -0
  99. package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -0
  100. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  101. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  102. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  103. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  104. package/dist/types/src/capabilities/state.d.ts +6 -0
  105. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  106. package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
  107. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
  108. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts +1 -1
  109. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -1
  110. package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts +9 -4
  111. package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
  112. package/dist/types/src/components/Sheet/Sheet.d.ts +17 -0
  113. package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -0
  114. package/dist/types/src/components/Sheet/index.d.ts +2 -0
  115. package/dist/types/src/components/Sheet/index.d.ts.map +1 -0
  116. package/dist/types/src/components/SheetContent/SheetCellEditor.stories.d.ts +16 -0
  117. package/dist/types/src/components/SheetContent/SheetCellEditor.stories.d.ts.map +1 -0
  118. package/dist/types/src/components/SheetContent/SheetContent.d.ts +6 -0
  119. package/dist/types/src/components/SheetContent/SheetContent.d.ts.map +1 -0
  120. package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts +93 -0
  121. package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts.map +1 -0
  122. package/dist/types/src/components/SheetContent/index.d.ts +2 -0
  123. package/dist/types/src/components/SheetContent/index.d.ts.map +1 -0
  124. package/dist/types/src/components/{GridSheet → SheetContent}/util.d.ts +1 -1
  125. package/dist/types/src/components/SheetContent/util.d.ts.map +1 -0
  126. package/dist/types/src/components/{SheetContext/SheetContext.d.ts → SheetRoot/SheetRoot.d.ts} +9 -7
  127. package/dist/types/src/components/SheetRoot/SheetRoot.d.ts.map +1 -0
  128. package/dist/types/src/components/SheetRoot/index.d.ts +2 -0
  129. package/dist/types/src/components/SheetRoot/index.d.ts.map +1 -0
  130. package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts +6 -0
  131. package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts.map +1 -0
  132. package/dist/types/src/components/SheetStatusbar/index.d.ts +2 -0
  133. package/dist/types/src/components/SheetStatusbar/index.d.ts.map +1 -0
  134. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts +5 -6
  135. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
  136. package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts +92 -4
  137. package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
  138. package/dist/types/src/components/SheetToolbar/align.d.ts +14 -21
  139. package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
  140. package/dist/types/src/components/SheetToolbar/style.d.ts +14 -20
  141. package/dist/types/src/components/SheetToolbar/style.d.ts.map +1 -1
  142. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts +14 -1
  143. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts.map +1 -1
  144. package/dist/types/src/components/index.d.ts +1 -4
  145. package/dist/types/src/components/index.d.ts.map +1 -1
  146. package/dist/types/src/containers/RangeList/RangeList.d.ts +7 -0
  147. package/dist/types/src/containers/RangeList/RangeList.d.ts.map +1 -0
  148. package/dist/types/src/containers/RangeList/index.d.ts +2 -0
  149. package/dist/types/src/containers/RangeList/index.d.ts.map +1 -0
  150. package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts +12 -0
  151. package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts.map +1 -0
  152. package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts +92 -0
  153. package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts.map +1 -0
  154. package/dist/types/src/containers/SheetArticle/index.d.ts +2 -0
  155. package/dist/types/src/containers/SheetArticle/index.d.ts.map +1 -0
  156. package/dist/types/src/containers/index.d.ts +4 -0
  157. package/dist/types/src/containers/index.d.ts.map +1 -0
  158. package/dist/types/src/extensions/compute.d.ts +2 -2
  159. package/dist/types/src/extensions/compute.d.ts.map +1 -1
  160. package/dist/types/src/extensions/compute.stories.d.ts +10 -13
  161. package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
  162. package/dist/types/src/extensions/editor/index.d.ts +1 -1
  163. package/dist/types/src/extensions/editor/index.d.ts.map +1 -1
  164. package/dist/types/src/extensions/editor/{extension.d.ts → sheet-extension.d.ts} +2 -2
  165. package/dist/types/src/extensions/editor/sheet-extension.d.ts.map +1 -0
  166. package/dist/types/src/extensions/editor/sheet-extension.test.d.ts +2 -0
  167. package/dist/types/src/extensions/editor/sheet-extension.test.d.ts.map +1 -0
  168. package/dist/types/src/index.d.ts +3 -2
  169. package/dist/types/src/index.d.ts.map +1 -1
  170. package/dist/types/src/integrations/thread-ranges.d.ts +1 -3
  171. package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
  172. package/dist/types/src/meta.d.ts +2 -3
  173. package/dist/types/src/meta.d.ts.map +1 -1
  174. package/dist/types/src/model/sheet-model.d.ts +31 -7
  175. package/dist/types/src/model/sheet-model.d.ts.map +1 -1
  176. package/dist/types/src/model/testing.d.ts +2 -2
  177. package/dist/types/src/model/testing.d.ts.map +1 -1
  178. package/dist/types/src/model/useSheetModel.d.ts +3 -3
  179. package/dist/types/src/model/useSheetModel.d.ts.map +1 -1
  180. package/dist/types/src/operations/drop-axis.d.ts +5 -0
  181. package/dist/types/src/operations/drop-axis.d.ts.map +1 -0
  182. package/dist/types/src/operations/index.d.ts +3 -0
  183. package/dist/types/src/operations/index.d.ts.map +1 -0
  184. package/dist/types/src/operations/insert-axis.d.ts +5 -0
  185. package/dist/types/src/operations/insert-axis.d.ts.map +1 -0
  186. package/dist/types/src/operations/restore-axis.d.ts +5 -0
  187. package/dist/types/src/operations/restore-axis.d.ts.map +1 -0
  188. package/dist/types/src/operations/scroll-to-anchor.d.ts +5 -0
  189. package/dist/types/src/operations/scroll-to-anchor.d.ts.map +1 -0
  190. package/dist/types/src/paths.d.ts +3 -0
  191. package/dist/types/src/paths.d.ts.map +1 -0
  192. package/dist/types/src/playwright/playwright.config.d.ts.map +1 -1
  193. package/dist/types/src/playwright/sheet-manager.d.ts.map +1 -1
  194. package/dist/types/src/plugin.d.ts +4 -0
  195. package/dist/types/src/plugin.d.ts.map +1 -0
  196. package/dist/types/src/serializer.d.ts +3 -3
  197. package/dist/types/src/serializer.d.ts.map +1 -1
  198. package/dist/types/src/testing/data.d.ts +2 -2
  199. package/dist/types/src/testing/data.d.ts.map +1 -1
  200. package/dist/types/src/testing/testing.d.ts +28 -4
  201. package/dist/types/src/testing/testing.d.ts.map +1 -1
  202. package/dist/types/src/translations.d.ts +74 -38
  203. package/dist/types/src/translations.d.ts.map +1 -1
  204. package/dist/types/src/types/Sheet.d.ts +75 -0
  205. package/dist/types/src/types/Sheet.d.ts.map +1 -0
  206. package/dist/types/src/types/SheetCapabilities.d.ts +16 -0
  207. package/dist/types/src/types/SheetCapabilities.d.ts.map +1 -0
  208. package/dist/types/src/types/SheetOperation.d.ts +45 -0
  209. package/dist/types/src/types/SheetOperation.d.ts.map +1 -0
  210. package/dist/types/src/types/index.d.ts +3 -1
  211. package/dist/types/src/types/index.d.ts.map +1 -1
  212. package/dist/types/src/types/sheet-range-types.d.ts +2 -2
  213. package/dist/types/src/types/sheet-range-types.d.ts.map +1 -1
  214. package/dist/types/src/types/types.d.ts +3 -78
  215. package/dist/types/src/types/types.d.ts.map +1 -1
  216. package/dist/types/src/types/util.d.ts +11 -11
  217. package/dist/types/src/types/util.d.ts.map +1 -1
  218. package/dist/types/tsconfig.tsbuildinfo +1 -1
  219. package/package.json +132 -98
  220. package/src/SheetPlugin.node.ts +21 -0
  221. package/src/SheetPlugin.test.ts +30 -0
  222. package/src/SheetPlugin.tsx +55 -68
  223. package/src/SheetPlugin.workerd.ts +18 -0
  224. package/src/capabilities/anchor-sort.ts +20 -15
  225. package/src/capabilities/app-graph-builder.ts +63 -0
  226. package/src/capabilities/comment-config.ts +28 -0
  227. package/src/capabilities/compute-graph-registry.ts +34 -20
  228. package/src/capabilities/create-object.ts +33 -0
  229. package/src/capabilities/index.ts +22 -8
  230. package/src/capabilities/markdown-extension.ts +31 -0
  231. package/src/capabilities/navigation-resolver.ts +16 -0
  232. package/src/capabilities/operation-handler.ts +16 -0
  233. package/src/capabilities/react-surface.tsx +38 -29
  234. package/src/capabilities/state.ts +29 -0
  235. package/src/capabilities/undo-mappings.ts +30 -0
  236. package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +1 -1
  237. package/src/components/ComputeGraph/compute-graph.stories.tsx +35 -27
  238. package/src/components/Sheet/Sheet.tsx +20 -0
  239. package/src/components/Sheet/index.ts +5 -0
  240. package/src/components/SheetContent/SheetCellEditor.stories.tsx +95 -0
  241. package/src/components/SheetContent/SheetContent.stories.tsx +60 -0
  242. package/src/components/{GridSheet/GridSheet.tsx → SheetContent/SheetContent.tsx} +88 -58
  243. package/src/components/{RangeList → SheetContent}/index.ts +1 -1
  244. package/src/components/{GridSheet → SheetContent}/util.ts +17 -10
  245. package/src/components/{SheetContext/SheetContext.tsx → SheetRoot/SheetRoot.tsx} +55 -42
  246. package/src/components/{GridSheet → SheetRoot}/index.ts +1 -1
  247. package/src/components/{FunctionEditor/FunctionEditor.tsx → SheetStatusbar/SheetStatusbar.tsx} +20 -7
  248. package/src/components/{FunctionEditor → SheetStatusbar}/index.ts +1 -1
  249. package/src/components/SheetToolbar/SheetToolbar.stories.tsx +19 -14
  250. package/src/components/SheetToolbar/SheetToolbar.tsx +61 -56
  251. package/src/components/SheetToolbar/align.ts +50 -25
  252. package/src/components/SheetToolbar/style.ts +52 -22
  253. package/src/components/SheetToolbar/useToolbarState.ts +22 -5
  254. package/src/components/index.ts +1 -7
  255. package/src/containers/RangeList/RangeList.tsx +65 -0
  256. package/src/containers/RangeList/index.ts +5 -0
  257. package/src/containers/SheetArticle/SheetArticle.stories.tsx +110 -0
  258. package/src/containers/SheetArticle/SheetArticle.tsx +57 -0
  259. package/src/containers/SheetArticle/index.ts +5 -0
  260. package/src/containers/index.ts +8 -0
  261. package/src/extensions/compute.stories.tsx +49 -36
  262. package/src/extensions/compute.ts +3 -4
  263. package/src/extensions/editor/index.ts +1 -1
  264. package/src/extensions/editor/{extension.test.ts → sheet-extension.test.ts} +2 -2
  265. package/src/extensions/editor/{extension.ts → sheet-extension.ts} +18 -15
  266. package/src/index.ts +3 -2
  267. package/src/integrations/thread-ranges.ts +20 -62
  268. package/src/meta.ts +22 -8
  269. package/src/model/sheet-model.test.ts +34 -6
  270. package/src/model/sheet-model.ts +84 -52
  271. package/src/model/testing.ts +5 -5
  272. package/src/model/useSheetModel.ts +4 -3
  273. package/src/operations/drop-axis.ts +26 -0
  274. package/src/operations/index.ts +12 -0
  275. package/src/operations/insert-axis.ts +19 -0
  276. package/src/operations/restore-axis.ts +19 -0
  277. package/src/operations/scroll-to-anchor.ts +30 -0
  278. package/src/paths.ts +11 -0
  279. package/src/playwright/playwright.config.ts +1 -1
  280. package/src/playwright/sheet.spec.ts +4 -3
  281. package/src/plugin.ts +11 -0
  282. package/src/sanity.test.ts +9 -3
  283. package/src/serializer.ts +4 -12
  284. package/src/testing/data.ts +2 -2
  285. package/src/testing/testing.tsx +13 -7
  286. package/src/translations.ts +43 -36
  287. package/src/types/Sheet.ts +97 -0
  288. package/src/types/SheetCapabilities.ts +26 -0
  289. package/src/types/SheetOperation.ts +84 -0
  290. package/src/types/index.ts +4 -1
  291. package/src/types/sheet-range-types.ts +5 -5
  292. package/src/types/types.ts +6 -52
  293. package/src/types/util.ts +15 -42
  294. package/src/vite-env.d.ts +10 -0
  295. package/dist/lib/browser/SheetContainer-JZNFXBW3.mjs +0 -351
  296. package/dist/lib/browser/SheetContainer-JZNFXBW3.mjs.map +0 -7
  297. package/dist/lib/browser/anchor-sort-VRX3YZKT.mjs +0 -24
  298. package/dist/lib/browser/anchor-sort-VRX3YZKT.mjs.map +0 -7
  299. package/dist/lib/browser/chunk-6AKBCBL4.mjs +0 -18
  300. package/dist/lib/browser/chunk-6AKBCBL4.mjs.map +0 -7
  301. package/dist/lib/browser/chunk-BVTHIA5U.mjs +0 -847
  302. package/dist/lib/browser/chunk-BVTHIA5U.mjs.map +0 -7
  303. package/dist/lib/browser/chunk-ELAASQ5H.mjs +0 -899
  304. package/dist/lib/browser/chunk-ELAASQ5H.mjs.map +0 -7
  305. package/dist/lib/browser/chunk-KJWZUQVA.mjs +0 -15
  306. package/dist/lib/browser/chunk-KJWZUQVA.mjs.map +0 -7
  307. package/dist/lib/browser/chunk-VTTKAHAY.mjs.map +0 -7
  308. package/dist/lib/browser/compute-graph-registry-6YJHXORG.mjs +0 -30
  309. package/dist/lib/browser/compute-graph-registry-6YJHXORG.mjs.map +0 -7
  310. package/dist/lib/browser/index.mjs +0 -155
  311. package/dist/lib/browser/index.mjs.map +0 -7
  312. package/dist/lib/browser/intent-resolver-SSLPTP5O.mjs +0 -56
  313. package/dist/lib/browser/intent-resolver-SSLPTP5O.mjs.map +0 -7
  314. package/dist/lib/browser/markdown-3VPZYNGU.mjs +0 -26
  315. package/dist/lib/browser/markdown-3VPZYNGU.mjs.map +0 -7
  316. package/dist/lib/browser/meta.json +0 -1
  317. package/dist/lib/browser/react-surface-Y7KTPJW2.mjs +0 -53
  318. package/dist/lib/browser/react-surface-Y7KTPJW2.mjs.map +0 -7
  319. package/dist/lib/node-esm/SheetContainer-GOIBAE2P.mjs +0 -352
  320. package/dist/lib/node-esm/SheetContainer-GOIBAE2P.mjs.map +0 -7
  321. package/dist/lib/node-esm/anchor-sort-YM2UBIKL.mjs +0 -25
  322. package/dist/lib/node-esm/anchor-sort-YM2UBIKL.mjs.map +0 -7
  323. package/dist/lib/node-esm/chunk-3K5VNYOF.mjs +0 -20
  324. package/dist/lib/node-esm/chunk-3K5VNYOF.mjs.map +0 -7
  325. package/dist/lib/node-esm/chunk-4L5CIB7E.mjs +0 -900
  326. package/dist/lib/node-esm/chunk-4L5CIB7E.mjs.map +0 -7
  327. package/dist/lib/node-esm/chunk-56HYMW55.mjs +0 -848
  328. package/dist/lib/node-esm/chunk-56HYMW55.mjs.map +0 -7
  329. package/dist/lib/node-esm/chunk-6SK5LJ5S.mjs +0 -16
  330. package/dist/lib/node-esm/chunk-6SK5LJ5S.mjs.map +0 -7
  331. package/dist/lib/node-esm/chunk-FXRXBHWM.mjs +0 -236
  332. package/dist/lib/node-esm/chunk-FXRXBHWM.mjs.map +0 -7
  333. package/dist/lib/node-esm/compute-graph-registry-ET5KJNLV.mjs +0 -31
  334. package/dist/lib/node-esm/compute-graph-registry-ET5KJNLV.mjs.map +0 -7
  335. package/dist/lib/node-esm/index.mjs +0 -156
  336. package/dist/lib/node-esm/index.mjs.map +0 -7
  337. package/dist/lib/node-esm/intent-resolver-5P6DBGK2.mjs +0 -57
  338. package/dist/lib/node-esm/intent-resolver-5P6DBGK2.mjs.map +0 -7
  339. package/dist/lib/node-esm/markdown-SFDGQWYE.mjs +0 -27
  340. package/dist/lib/node-esm/markdown-SFDGQWYE.mjs.map +0 -7
  341. package/dist/lib/node-esm/meta.json +0 -1
  342. package/dist/lib/node-esm/react-surface-6Z5FAOBH.mjs +0 -54
  343. package/dist/lib/node-esm/react-surface-6Z5FAOBH.mjs.map +0 -7
  344. package/dist/types/src/capabilities/capabilities.d.ts +0 -5
  345. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  346. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  347. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  348. package/dist/types/src/capabilities/markdown.d.ts +0 -6
  349. package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
  350. package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts +0 -3
  351. package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts.map +0 -1
  352. package/dist/types/src/components/FunctionEditor/index.d.ts +0 -2
  353. package/dist/types/src/components/FunctionEditor/index.d.ts.map +0 -1
  354. package/dist/types/src/components/GridSheet/GridSheet.d.ts +0 -3
  355. package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +0 -1
  356. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +0 -7
  357. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +0 -1
  358. package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts +0 -25
  359. package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +0 -1
  360. package/dist/types/src/components/GridSheet/index.d.ts +0 -2
  361. package/dist/types/src/components/GridSheet/index.d.ts.map +0 -1
  362. package/dist/types/src/components/GridSheet/util.d.ts.map +0 -1
  363. package/dist/types/src/components/RangeList/RangeList.d.ts +0 -7
  364. package/dist/types/src/components/RangeList/RangeList.d.ts.map +0 -1
  365. package/dist/types/src/components/RangeList/index.d.ts +0 -2
  366. package/dist/types/src/components/RangeList/index.d.ts.map +0 -1
  367. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +0 -11
  368. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +0 -1
  369. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +0 -8
  370. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +0 -1
  371. package/dist/types/src/components/SheetContainer/index.d.ts +0 -3
  372. package/dist/types/src/components/SheetContainer/index.d.ts.map +0 -1
  373. package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +0 -1
  374. package/dist/types/src/components/SheetContext/index.d.ts +0 -2
  375. package/dist/types/src/components/SheetContext/index.d.ts.map +0 -1
  376. package/dist/types/src/extensions/editor/extension.d.ts.map +0 -1
  377. package/dist/types/src/extensions/editor/extension.test.d.ts +0 -2
  378. package/dist/types/src/extensions/editor/extension.test.d.ts.map +0 -1
  379. package/dist/types/src/types/schema.d.ts +0 -37
  380. package/dist/types/src/types/schema.d.ts.map +0 -1
  381. package/src/capabilities/capabilities.ts +0 -14
  382. package/src/capabilities/intent-resolver.ts +0 -38
  383. package/src/capabilities/markdown.ts +0 -23
  384. package/src/components/GridSheet/GridSheet.stories.tsx +0 -54
  385. package/src/components/GridSheet/SheetCellEditor.stories.tsx +0 -93
  386. package/src/components/RangeList/RangeList.tsx +0 -60
  387. package/src/components/SheetContainer/SheetContainer.stories.tsx +0 -90
  388. package/src/components/SheetContainer/SheetContainer.tsx +0 -36
  389. package/src/components/SheetContainer/index.ts +0 -7
  390. package/src/components/SheetContext/index.ts +0 -5
  391. package/src/types/schema.ts +0 -61
  392. /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  393. /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
@@ -2,27 +2,41 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginContext, contributes } from '@dxos/app-framework';
6
- import { ClientCapabilities } from '@dxos/plugin-client';
5
+ import * as Effect from 'effect/Effect';
7
6
 
8
- import { SheetCapabilities } from './capabilities';
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { Operation, ServiceResolver } from '@dxos/compute';
9
+ import { type SpaceId } from '@dxos/keys';
9
10
 
10
- const isSecure = (protocol: string) => {
11
- return protocol === 'https:' || protocol === 'wss:';
12
- };
11
+ import { SheetCapabilities } from '#types';
13
12
 
14
- export default async (context: PluginContext) => {
15
- const client = context.getCapability(ClientCapabilities.Client);
16
- let remoteFunctionUrl: string | undefined;
17
- if (client.config.values.runtime?.services?.edge?.url) {
18
- const url = new URL('/functions', client.config.values.runtime?.services?.edge?.url);
19
- url.protocol = isSecure(url.protocol) ? 'https' : 'http';
20
- remoteFunctionUrl = url.toString();
21
- }
13
+ /**
14
+ * Builds the per-space compute graph registry by adapting the shared
15
+ * {@link Capabilities.ProcessManagerRuntime} into a
16
+ * {@link FunctionsRuntimeProvider} that resolves {@link Operation.Service}
17
+ * from the space's service layer.
18
+ */
19
+ export default Capability.makeModule(
20
+ Effect.fnUntraced(function* () {
21
+ const processManagerRuntime = yield* Capability.get(Capabilities.ProcessManagerRuntime);
22
22
 
23
- // TODO(wittjosiah): This can probably be a module level import now due to lazy capability loading.
24
- // Async import removes direct dependency on hyperformula.
25
- const { defaultPlugins, ComputeGraphRegistry } = await import('@dxos/compute');
26
- const computeGraphRegistry = new ComputeGraphRegistry({ plugins: defaultPlugins, remoteFunctionUrl });
27
- return contributes(SheetCapabilities.ComputeGraphRegistry, computeGraphRegistry);
28
- };
23
+ // Async import removes direct dependency on hyperformula.
24
+ const { defaultPlugins, ComputeGraphRegistry } = yield* Effect.tryPromise(
25
+ () => import('@dxos/compute-hyperformula'),
26
+ );
27
+
28
+ const computeGraphRegistry = new ComputeGraphRegistry({
29
+ plugins: defaultPlugins,
30
+ computeRuntime: {
31
+ getRuntime: (spaceId: SpaceId) => ({
32
+ runPromise: <A, E>(effect: Effect.Effect<A, E, Operation.Service>) =>
33
+ processManagerRuntime.runPromise(
34
+ effect.pipe(Effect.provide(ServiceResolver.provide({ space: spaceId }, Operation.Service))),
35
+ ),
36
+ }),
37
+ },
38
+ });
39
+
40
+ return Capability.contributes(SheetCapabilities.ComputeGraphRegistry, computeGraphRegistry);
41
+ }),
42
+ );
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { Operation } from '@dxos/compute';
9
+ import { Type } from '@dxos/echo';
10
+ import { SpaceOperation } from '@dxos/plugin-space';
11
+ import { SpaceCapabilities } from '@dxos/plugin-space';
12
+
13
+ import { Sheet } from '#types';
14
+
15
+ import { getSheetsPath } from '../paths';
16
+
17
+ export default Capability.makeModule(
18
+ Effect.fnUntraced(function* () {
19
+ return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
20
+ id: Type.getTypename(Sheet.Sheet),
21
+ createObject: (props, options) =>
22
+ Effect.gen(function* () {
23
+ const object = Sheet.make(props);
24
+ return yield* Operation.invoke(SpaceOperation.AddObject, {
25
+ object,
26
+ target: options.target,
27
+ hidden: true,
28
+ targetNodeId: options.targetNodeId ?? getSheetsPath(options.db.spaceId),
29
+ });
30
+ }),
31
+ });
32
+ }),
33
+ );
@@ -2,12 +2,26 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
5
+ import { Capability } from '@dxos/app-framework';
6
+ import { type AppCapabilities } from '@dxos/app-toolkit';
7
+ import { OperationHandlerSet } from '@dxos/compute';
6
8
 
7
- export const AnchorSort = lazy(() => import('./anchor-sort'));
8
- export const ComputeGraphRegistry = lazy(() => import('./compute-graph-registry'));
9
- export const IntentResolver = lazy(() => import('./intent-resolver'));
10
- export const Markdown = lazy(() => import('./markdown'));
11
- export const ReactSurface = lazy(() => import('./react-surface'));
12
-
13
- export * from './capabilities';
9
+ export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
10
+ export const NavigationResolver = Capability.lazy('NavigationResolver', () => import('./navigation-resolver'));
11
+ export const AnchorSort = Capability.lazy('AnchorSort', () => import('./anchor-sort'));
12
+ // The contributed capability type references Operation types from @dxos/compute, so the lazy
13
+ // wrapper needs an explicit annotation to keep the inferred type portable (TS2883).
14
+ export const CommentConfig: Capability.LazyCapability<
15
+ void,
16
+ Capability.Capability<typeof AppCapabilities.CommentConfig>
17
+ > = Capability.lazy('CommentConfig', () => import('./comment-config'));
18
+ export const ComputeGraphRegistry = Capability.lazy('ComputeGraphRegistry', () => import('./compute-graph-registry'));
19
+ export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
20
+ export const Markdown = Capability.lazy('MarkdownExtension', () => import('./markdown-extension'));
21
+ export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
22
+ 'OperationHandler',
23
+ () => import('./operation-handler'),
24
+ );
25
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
26
+ export const SheetState = Capability.lazy('SheetState', () => import('./state'));
27
+ export const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));
@@ -0,0 +1,31 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { getSpace } from '@dxos/client/echo';
9
+ import { MarkdownCapabilities } from '@dxos/plugin-markdown/types';
10
+
11
+ import { SheetCapabilities } from '#types';
12
+
13
+ import { computeGraphFacet } from '../extensions';
14
+
15
+ export default Capability.makeModule(
16
+ Effect.fnUntraced(function* () {
17
+ // Get context for lazy capability access in callbacks.
18
+ const capabilities = yield* Capability.Service;
19
+
20
+ return Capability.contributes(MarkdownCapabilities.ExtensionProvider, [
21
+ ({ document: doc }) => {
22
+ const computeGraphRegistry = capabilities.get(SheetCapabilities.ComputeGraphRegistry);
23
+ const space = getSpace(doc);
24
+ if (space) {
25
+ const computeGraph = computeGraphRegistry.getOrCreateGraph(space);
26
+ return computeGraphFacet.of(computeGraph);
27
+ }
28
+ },
29
+ ]);
30
+ }),
31
+ );
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities, createTypeSectionPathResolver } from '@dxos/app-toolkit';
9
+
10
+ import { Sheet } from '#types';
11
+
12
+ export default Capability.makeModule(
13
+ Effect.fnUntraced(function* () {
14
+ return Capability.contributes(AppCapabilities.NavigationPathResolver, createTypeSectionPathResolver(Sheet.Sheet));
15
+ }),
16
+ );
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import type { OperationHandlerSet } from '@dxos/compute';
9
+
10
+ import { SheetOperationHandlerSet } from '#operations';
11
+
12
+ export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
13
+ Effect.fnUntraced(function* () {
14
+ return Capability.contributes(Capabilities.OperationHandler, SheetOperationHandlerSet);
15
+ }),
16
+ );
@@ -2,39 +2,48 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import * as Effect from 'effect/Effect';
5
6
  import React from 'react';
6
7
 
7
- import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface, useCapability } from '@dxos/app-framework/ui';
10
+ import { AppSurface } from '@dxos/app-toolkit/ui';
8
11
  import { Obj } from '@dxos/echo';
9
12
  import { getSpace } from '@dxos/react-client/echo';
10
13
 
11
- import { ComputeGraphContextProvider, RangeList, SheetContainer } from '../components';
12
- import { SHEET_PLUGIN } from '../meta';
13
- import { SheetType } from '../types';
14
+ import { RangeList, SheetArticle } from '#containers';
15
+ import { Sheet, SheetCapabilities } from '#types';
14
16
 
15
- import { SheetCapabilities } from './capabilities';
17
+ export default Capability.makeModule(() =>
18
+ Effect.succeed(
19
+ Capability.contributes(Capabilities.ReactSurface, [
20
+ Surface.create({
21
+ id: 'sheet',
22
+ // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
23
+ role: ['article', 'section'],
24
+ filter: (data): data is { attendableId: string; subject: Sheet.Sheet } =>
25
+ typeof data.attendableId === 'string' &&
26
+ Obj.instanceOf(Sheet.Sheet, data.subject) &&
27
+ !!Obj.getDatabase(data.subject),
28
+ component: ({ data, role }) => {
29
+ const computeGraphRegistry = useCapability(SheetCapabilities.ComputeGraphRegistry);
16
30
 
17
- export default () =>
18
- contributes(Capabilities.ReactSurface, [
19
- createSurface({
20
- id: `${SHEET_PLUGIN}/sheet`,
21
- role: ['article', 'section'],
22
- filter: (data): data is { subject: SheetType } =>
23
- Obj.instanceOf(SheetType, data.subject) && !!getSpace(data.subject),
24
- component: ({ data, role }) => {
25
- const computeGraphRegistry = useCapability(SheetCapabilities.ComputeGraphRegistry);
26
-
27
- return (
28
- <ComputeGraphContextProvider registry={computeGraphRegistry}>
29
- <SheetContainer space={getSpace(data.subject)!} sheet={data.subject} role={role} />
30
- </ComputeGraphContextProvider>
31
- );
32
- },
33
- }),
34
- createSurface({
35
- id: `${SHEET_PLUGIN}/object-settings`,
36
- role: 'object-settings',
37
- filter: (data): data is { subject: SheetType } => Obj.instanceOf(SheetType, data.subject),
38
- component: ({ data }) => <RangeList sheet={data.subject} />,
39
- }),
40
- ]);
31
+ return (
32
+ <SheetArticle
33
+ role={role}
34
+ subject={data.subject}
35
+ attendableId={data.attendableId}
36
+ space={getSpace(data.subject)!}
37
+ registry={computeGraphRegistry}
38
+ />
39
+ );
40
+ },
41
+ }),
42
+ Surface.create({
43
+ id: 'objectProperties',
44
+ filter: AppSurface.object(AppSurface.ObjectProperties, Sheet.Sheet),
45
+ component: ({ data }) => <RangeList sheet={data.subject} />,
46
+ }),
47
+ ]),
48
+ ),
49
+ );
@@ -0,0 +1,29 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+
9
+ import { SheetCapabilities } from '#types';
10
+
11
+ const createGridRegistry = (): SheetCapabilities.GridRegistry => {
12
+ const grids = new Map<string, SheetCapabilities.GridEntry>();
13
+ return {
14
+ register: (attendableId, grid, setActiveRefs) => {
15
+ grids.set(attendableId, { grid, setActiveRefs });
16
+ },
17
+ unregister: (attendableId) => {
18
+ grids.delete(attendableId);
19
+ },
20
+ get: (attendableId) => grids.get(attendableId),
21
+ };
22
+ };
23
+
24
+ export default Capability.makeModule(
25
+ Effect.fnUntraced(function* () {
26
+ const gridInstances = createGridRegistry();
27
+ return Capability.contributes(SheetCapabilities.GridInstances, gridInstances);
28
+ }),
29
+ );
@@ -0,0 +1,30 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability, UndoMapping } from '@dxos/app-framework';
8
+
9
+ import { meta } from '#meta';
10
+ import { SheetOperation } from '#types';
11
+
12
+ export default Capability.makeModule(() =>
13
+ Effect.succeed(
14
+ Capability.contributes(Capabilities.UndoMapping, [
15
+ UndoMapping.make({
16
+ operation: SheetOperation.DropAxis,
17
+ inverse: SheetOperation.RestoreAxis,
18
+ deriveContext: (input, output) => ({
19
+ model: input.model,
20
+ axis: output.axis,
21
+ axisIndex: output.axisIndex,
22
+ index: output.index,
23
+ axisMeta: output.axisMeta,
24
+ values: output.values,
25
+ }),
26
+ message: ['axis-dropped.label', { ns: meta.id }],
27
+ }),
28
+ ]),
29
+ ),
30
+ );
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React, { type PropsWithChildren, createContext, useContext } from 'react';
6
6
 
7
- import { type ComputeGraph, type ComputeGraphRegistry } from '@dxos/compute';
7
+ import { type ComputeGraph, type ComputeGraphRegistry } from '@dxos/compute-hyperformula';
8
8
  import { raise } from '@dxos/debug';
9
9
  import { type Space } from '@dxos/react-client/echo';
10
10
  import { useAsyncState } from '@dxos/react-hooks';
@@ -2,38 +2,36 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
- import { type Meta } from '@storybook/react-vite';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React, { useEffect, useRef, useState } from 'react';
9
7
 
10
- import { testFunctionPlugins } from '@dxos/compute/testing';
8
+ import { Operation } from '@dxos/compute';
9
+ import { testFunctionPlugins } from '@dxos/compute-hyperformula/testing';
11
10
  import { Filter, Obj } from '@dxos/echo';
12
- import { FunctionType } from '@dxos/functions';
13
- import { useSpace } from '@dxos/react-client/echo';
11
+ import { useSpaces } from '@dxos/react-client/echo';
14
12
  import { withClientProvider } from '@dxos/react-client/testing';
15
13
  import { Button, Input, Toolbar } from '@dxos/react-ui';
16
- import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
17
- import { withTheme } from '@dxos/storybook-utils';
14
+ import { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';
15
+ import { withTheme } from '@dxos/react-ui/testing';
18
16
 
19
- import { useSheetModel } from '../../model';
20
- import { withComputeGraphDecorator } from '../../testing';
21
- import { SheetType, createSheet } from '../../types';
17
+ import { withComputeGraphDecorator } from '#testing';
18
+ import { Sheet } from '#types';
22
19
 
20
+ import { useSheetModel } from '../../model';
23
21
  import { useComputeGraph } from './ComputeGraphContextProvider';
24
22
 
25
23
  const FUNCTION_NAME = 'TEST';
26
24
 
27
- const Story = () => {
28
- const space = useSpace();
25
+ const DefaultStory = () => {
26
+ const [space] = useSpaces();
29
27
  const graph = useComputeGraph(space);
30
- const [sheet, setSheet] = useState<SheetType>();
28
+ const [sheet, setSheet] = useState<Sheet.Sheet>();
31
29
  const [text, setText] = useState(`${FUNCTION_NAME}(100)`);
32
30
  const [result, setResult] = useState<any>();
33
31
  const model = useSheetModel(graph, sheet);
34
32
  useEffect(() => {
35
33
  if (space) {
36
- const sheet = space.db.add(createSheet());
34
+ const sheet = space.db.add(Sheet.make());
37
35
  setSheet(sheet);
38
36
  }
39
37
  }, [space]);
@@ -46,14 +44,20 @@ const Story = () => {
46
44
  setResult({ functions: { standard: f1.length, echo: f2.length } });
47
45
  });
48
46
 
49
- space.db.add(Obj.make(FunctionType, { name: 'test', version: '0.0.1', binding: FUNCTION_NAME }));
47
+ space.db.add(
48
+ Obj.make(Operation.PersistentOperation, {
49
+ [Obj.Meta]: { version: '0.0.1' },
50
+ name: 'test',
51
+ binding: FUNCTION_NAME,
52
+ }),
53
+ );
50
54
  }
51
55
  }, [space, graph]);
52
56
 
53
57
  const inputRef = useRef<HTMLInputElement | null>(null);
54
58
  const handleTest = async () => {
55
59
  if (space && graph) {
56
- const { objects } = await space.db.query(Filter.type(FunctionType)).run();
60
+ const objects = await space.db.query(Filter.type(Operation.PersistentOperation)).run();
57
61
  const mapped = graph.mapFunctionBindingToId(text);
58
62
  const unmapped = graph.mapFunctionBindingFromId(mapped);
59
63
  const internal = graph.mapFormulaToNative(text);
@@ -76,23 +80,27 @@ const Story = () => {
76
80
  </Input.Root>
77
81
  <Button onClick={handleTest}>Test</Button>
78
82
  </Toolbar.Root>
79
- <SyntaxHighlighter language='json'>
80
- {JSON.stringify({ space: space?.id, graph: graph?.id, sheet: sheet?.id, model: model?.id, result }, null, 2)}
81
- </SyntaxHighlighter>
83
+ <JsonHighlighter data={{ space: space?.id, graph: graph?.id, sheet: sheet?.id, model: model?.id, result }} />
82
84
  </div>
83
85
  );
84
86
  };
85
87
 
86
- export const Default = {};
88
+ export const Default: Story = {};
87
89
 
88
- const meta: Meta = {
89
- title: 'plugins/plugin-sheet/functions',
90
+ const meta = {
91
+ title: 'plugins/plugin-sheet/components/functions',
92
+ render: DefaultStory,
90
93
  decorators: [
91
- withClientProvider({ types: [FunctionType, SheetType], createIdentity: true, createSpace: true }),
94
+ withTheme(),
95
+ withClientProvider({
96
+ types: [Operation.PersistentOperation, Sheet.Sheet],
97
+ createIdentity: true,
98
+ createSpace: true,
99
+ }),
92
100
  withComputeGraphDecorator({ plugins: testFunctionPlugins }),
93
- withTheme,
94
101
  ],
95
- render: (args: any) => <Story {...args} />,
96
- };
102
+ } satisfies Meta<typeof DefaultStory>;
97
103
 
98
104
  export default meta;
105
+
106
+ type Story = StoryObj<typeof meta>;
@@ -0,0 +1,20 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { SheetContent } from '../SheetContent';
6
+ import { SheetRoot } from '../SheetRoot';
7
+ import { SheetStatusbar } from '../SheetStatusbar';
8
+ import { SheetToolbar } from '../SheetToolbar';
9
+
10
+ export { useSheetContext, type SheetContextValue, type SheetRootProps } from '../SheetRoot';
11
+ export { type SheetContentProps } from '../SheetContent';
12
+ export { type SheetToolbarProps } from '../SheetToolbar';
13
+ export { type SheetStatusbarProps } from '../SheetStatusbar';
14
+
15
+ export const Sheet = {
16
+ Root: SheetRoot,
17
+ Toolbar: SheetToolbar,
18
+ Content: SheetContent,
19
+ Statusbar: SheetStatusbar,
20
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './Sheet';
@@ -0,0 +1,95 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import React, { useMemo, useState } from 'react';
7
+
8
+ import { Client } from '@dxos/client';
9
+ import { defaultFunctions } from '@dxos/compute-hyperformula';
10
+ import { getRegisteredFunctionNames } from '@dxos/compute-hyperformula/testing';
11
+ import { Obj } from '@dxos/echo';
12
+ import { createDocAccessor } from '@dxos/echo-client';
13
+ import { useAsyncEffect } from '@dxos/react-hooks';
14
+ import { CellEditor, type CellEditorProps } from '@dxos/react-ui-grid';
15
+ import { withTheme } from '@dxos/react-ui/testing';
16
+ import { automerge } from '@dxos/ui-editor';
17
+
18
+ import { Sheet } from '#types';
19
+
20
+ import { sheetExtension } from '../../extensions';
21
+
22
+ const DefaultStory = ({ value, ...props }: CellEditorProps) => {
23
+ const extensions = useMemo(() => {
24
+ const functionNames = getRegisteredFunctionNames();
25
+ const functions = defaultFunctions.filter(({ name }) => functionNames.includes(name));
26
+ return [sheetExtension({ functions })];
27
+ }, []);
28
+
29
+ return <CellEditor {...props} value={value} extensions={extensions} />;
30
+ };
31
+
32
+ const AutomergeStory = ({ value, ...props }: CellEditorProps) => {
33
+ const cell = 'A1';
34
+ const [object, setObject] = useState<Sheet.Sheet>();
35
+ useAsyncEffect(async () => {
36
+ const client = new Client({ types: [Sheet.Sheet] });
37
+ await client.initialize();
38
+ await client.halo.createIdentity();
39
+ const space = await client.spaces.create();
40
+
41
+ const sheet = Sheet.make();
42
+ Obj.update(sheet, (sheet) => {
43
+ sheet.name = 'Test';
44
+ sheet.cells[cell] = { value };
45
+ });
46
+ space.db.add(sheet);
47
+ setObject(sheet);
48
+ }, [value]);
49
+
50
+ const extensions = useMemo(() => {
51
+ if (!object) {
52
+ return [];
53
+ }
54
+
55
+ const functionNames = getRegisteredFunctionNames();
56
+ const functions = defaultFunctions.filter(({ name }) => functionNames.includes(name));
57
+ const accessor = createDocAccessor(object, ['cells', cell, 'value']);
58
+ return [automerge(accessor), sheetExtension({ functions })];
59
+ }, [object]);
60
+
61
+ return <CellEditor {...props} value={value} extensions={extensions} />;
62
+ };
63
+
64
+ const meta = {
65
+ title: 'plugins/plugin-sheet/components/CellEditor',
66
+
67
+ decorators: [withTheme()],
68
+ component: CellEditor,
69
+ render: DefaultStory,
70
+ } satisfies Meta<typeof DefaultStory>;
71
+
72
+ export default meta;
73
+
74
+ type Story = StoryObj<typeof meta>;
75
+
76
+ export const Default: Story = {};
77
+
78
+ export const AutoComplete: Story = {
79
+ args: {
80
+ value: '=SUM',
81
+ },
82
+ };
83
+
84
+ export const Formatting: Story = {
85
+ args: {
86
+ value: '=SUM(A1:A2, 100, TRUE, "100", SUM(A1:A2, B1:B2))',
87
+ },
88
+ };
89
+
90
+ export const Automerge: Story = {
91
+ render: AutomergeStory,
92
+ args: {
93
+ value: '=SUM(A1:A2, 100, TRUE, "100", SUM(A1:A2, B1:B2))',
94
+ },
95
+ };
@@ -0,0 +1,60 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import React from 'react';
7
+
8
+ import { ProcessManagerPlugin } from '@dxos/app-framework';
9
+ import { withPluginManager } from '@dxos/app-framework/testing';
10
+ import { testFunctionPlugins } from '@dxos/compute-hyperformula/testing';
11
+ import { useSpaces } from '@dxos/react-client/echo';
12
+ import { withClientProvider } from '@dxos/react-client/testing';
13
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
14
+
15
+ import { createTestCells, useTestSheet, withComputeGraphDecorator } from '#testing';
16
+ import { translations } from '#translations';
17
+ import { Sheet } from '#types';
18
+
19
+ import { useComputeGraph } from '../ComputeGraph';
20
+ import { SheetRoot } from '../SheetRoot';
21
+ import { SheetContent } from './SheetContent';
22
+
23
+ export const Basic = () => {
24
+ const [space] = useSpaces();
25
+ const graph = useComputeGraph(space);
26
+ const sheet = useTestSheet(space, graph, { cells: createTestCells() });
27
+ if (!sheet || !graph) {
28
+ return null;
29
+ }
30
+
31
+ return (
32
+ <SheetRoot graph={graph} sheet={sheet} attendableId='test' ignoreAttention>
33
+ <div className='grid h-full w-full'>
34
+ <SheetContent />
35
+ </div>
36
+ </SheetRoot>
37
+ );
38
+ };
39
+
40
+ const meta = {
41
+ title: 'plugins/plugin-sheet/components/SheetContent',
42
+ component: SheetContent,
43
+ decorators: [
44
+ withTheme(),
45
+ withLayout({ layout: 'fullscreen' }),
46
+ withClientProvider({ types: [Sheet.Sheet], createSpace: true }),
47
+ withComputeGraphDecorator({ plugins: testFunctionPlugins }),
48
+ withPluginManager({
49
+ plugins: [ProcessManagerPlugin()],
50
+ }),
51
+ ],
52
+ parameters: {
53
+ layout: 'fullscreen',
54
+ translations,
55
+ },
56
+ } satisfies Meta<typeof SheetContent>;
57
+
58
+ export default meta;
59
+
60
+ type Story = StoryObj<typeof meta>;