@dxos/plugin-sheet 0.6.11 → 0.6.12-main.568932b

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 (277) hide show
  1. package/dist/lib/browser/SheetContainer-T2QWJOFD.mjs +262 -0
  2. package/dist/lib/browser/SheetContainer-T2QWJOFD.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-FUAGSXA4.mjs → chunk-5ZMVZYGB.mjs} +24 -19
  4. package/dist/lib/browser/chunk-5ZMVZYGB.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-GSV5QNLD.mjs +2966 -0
  6. package/dist/lib/browser/chunk-GSV5QNLD.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-JRL5LGCE.mjs → chunk-QILRZNE5.mjs} +2 -5
  8. package/dist/lib/browser/chunk-QILRZNE5.mjs.map +7 -0
  9. package/dist/lib/browser/{SheetContainer-U4H5D34A.mjs → chunk-ZL2V5UJR.mjs} +1182 -249
  10. package/dist/lib/browser/chunk-ZL2V5UJR.mjs.map +7 -0
  11. package/dist/lib/browser/graph-M4IQ76QX.mjs +33 -0
  12. package/dist/lib/browser/graph-M4IQ76QX.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +96 -60
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/meta.mjs +1 -1
  17. package/dist/lib/browser/types.mjs +4 -6
  18. package/dist/lib/node/SheetContainer-PV5ET4UJ.cjs +280 -0
  19. package/dist/lib/node/SheetContainer-PV5ET4UJ.cjs.map +7 -0
  20. package/dist/lib/node/{SheetContainer-AXQV3ZT5.cjs → chunk-2K53Z2TU.cjs} +1212 -287
  21. package/dist/lib/node/chunk-2K53Z2TU.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-5KKJ4NPP.cjs → chunk-5XPK2V4A.cjs} +418 -678
  23. package/dist/lib/node/chunk-5XPK2V4A.cjs.map +7 -0
  24. package/dist/lib/node/{chunk-BJ6ZD7MN.cjs → chunk-BNARJ5GM.cjs} +5 -18
  25. package/dist/lib/node/chunk-BNARJ5GM.cjs.map +7 -0
  26. package/dist/lib/node/{chunk-DSYKOI4E.cjs → chunk-STAVQ2JE.cjs} +28 -24
  27. package/dist/lib/node/chunk-STAVQ2JE.cjs.map +7 -0
  28. package/dist/lib/node/graph-Q3N2X26H.cjs +55 -0
  29. package/dist/lib/node/graph-Q3N2X26H.cjs.map +7 -0
  30. package/dist/lib/node/index.cjs +106 -66
  31. package/dist/lib/node/index.cjs.map +4 -4
  32. package/dist/lib/node/meta.cjs +3 -3
  33. package/dist/lib/node/meta.cjs.map +1 -1
  34. package/dist/lib/node/meta.json +1 -1
  35. package/dist/lib/node/types.cjs +10 -12
  36. package/dist/lib/node/types.cjs.map +2 -2
  37. package/dist/lib/node-esm/SheetContainer-FOZD2WLT.mjs +263 -0
  38. package/dist/lib/node-esm/SheetContainer-FOZD2WLT.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-2HAM45RC.mjs +88 -0
  40. package/dist/lib/node-esm/chunk-2HAM45RC.mjs.map +7 -0
  41. package/dist/lib/{browser/chunk-D5AGLXJP.mjs → node-esm/chunk-5WPZCXNS.mjs} +411 -678
  42. package/dist/lib/node-esm/chunk-5WPZCXNS.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-IU2L277A.mjs +17 -0
  44. package/dist/lib/node-esm/chunk-IU2L277A.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-QEUCIHIN.mjs +2706 -0
  46. package/dist/lib/node-esm/chunk-QEUCIHIN.mjs.map +7 -0
  47. package/dist/lib/node-esm/graph-SMPUMOV2.mjs +34 -0
  48. package/dist/lib/node-esm/graph-SMPUMOV2.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +285 -0
  50. package/dist/lib/node-esm/index.mjs.map +7 -0
  51. package/dist/lib/node-esm/meta.json +1 -0
  52. package/dist/lib/node-esm/meta.mjs +10 -0
  53. package/dist/lib/node-esm/meta.mjs.map +7 -0
  54. package/dist/lib/node-esm/types.mjs +21 -0
  55. package/dist/lib/node-esm/types.mjs.map +7 -0
  56. package/dist/types/src/SheetPlugin.d.ts.map +1 -1
  57. package/dist/types/src/components/CellEditor/CellEditor.d.ts +23 -3
  58. package/dist/types/src/components/CellEditor/CellEditor.d.ts.map +1 -1
  59. package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts +2 -2
  60. package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts.map +1 -1
  61. package/dist/types/src/components/CellEditor/extension.d.ts +1 -1
  62. package/dist/types/src/components/CellEditor/extension.d.ts.map +1 -1
  63. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts +11 -0
  64. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -0
  65. package/dist/types/src/components/ComputeGraph/index.d.ts +1 -3
  66. package/dist/types/src/components/ComputeGraph/index.d.ts.map +1 -1
  67. package/dist/types/src/components/GridSheet/GridSheet.d.ts +10 -0
  68. package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -0
  69. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +9 -0
  70. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -0
  71. package/dist/types/src/components/GridSheet/util.d.ts +16 -0
  72. package/dist/types/src/components/GridSheet/util.d.ts.map +1 -0
  73. package/dist/types/src/components/Sheet/Sheet.d.ts +1 -1
  74. package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -1
  75. package/dist/types/src/components/Sheet/Sheet.stories.d.ts +5 -6
  76. package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +1 -1
  77. package/dist/types/src/components/Sheet/decorations.d.ts +24 -0
  78. package/dist/types/src/components/Sheet/decorations.d.ts.map +1 -0
  79. package/dist/types/src/components/Sheet/grid.d.ts +2 -2
  80. package/dist/types/src/components/Sheet/grid.d.ts.map +1 -1
  81. package/dist/types/src/components/Sheet/nav.d.ts +3 -3
  82. package/dist/types/src/components/Sheet/nav.d.ts.map +1 -1
  83. package/dist/types/src/components/Sheet/sheet-context.d.ts +8 -7
  84. package/dist/types/src/components/Sheet/sheet-context.d.ts.map +1 -1
  85. package/dist/types/src/components/Sheet/threads.d.ts +2 -0
  86. package/dist/types/src/components/Sheet/threads.d.ts.map +1 -0
  87. package/dist/types/src/components/SheetContainer.d.ts +2 -3
  88. package/dist/types/src/components/SheetContainer.d.ts.map +1 -1
  89. package/dist/types/src/components/Toolbar/Toolbar.d.ts +19 -3
  90. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
  91. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +18 -13
  92. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
  93. package/dist/types/src/components/index.d.ts +2 -2
  94. package/dist/types/src/components/index.d.ts.map +1 -1
  95. package/dist/types/src/defs/index.d.ts +3 -0
  96. package/dist/types/src/defs/index.d.ts.map +1 -0
  97. package/dist/types/src/{model → defs}/types.d.ts +8 -3
  98. package/dist/types/src/defs/types.d.ts.map +1 -0
  99. package/dist/types/src/defs/types.test.d.ts.map +1 -0
  100. package/dist/types/src/defs/util.d.ts +43 -0
  101. package/dist/types/src/defs/util.d.ts.map +1 -0
  102. package/dist/types/src/extensions/compute.d.ts +6 -0
  103. package/dist/types/src/extensions/compute.d.ts.map +1 -0
  104. package/dist/types/src/extensions/compute.stories.d.ts +26 -0
  105. package/dist/types/src/extensions/compute.stories.d.ts.map +1 -0
  106. package/dist/types/src/extensions/index.d.ts +2 -0
  107. package/dist/types/src/extensions/index.d.ts.map +1 -0
  108. package/dist/types/src/graph/compute-graph-registry.d.ts +34 -0
  109. package/dist/types/src/graph/compute-graph-registry.d.ts.map +1 -0
  110. package/dist/types/src/graph/compute-graph.d.ts +64 -0
  111. package/dist/types/src/graph/compute-graph.d.ts.map +1 -0
  112. package/dist/types/src/graph/compute-graph.stories.d.ts +10 -0
  113. package/dist/types/src/graph/compute-graph.stories.d.ts.map +1 -0
  114. package/dist/types/src/graph/compute-graph.test.d.ts +2 -0
  115. package/dist/types/src/graph/compute-graph.test.d.ts.map +1 -0
  116. package/dist/types/src/graph/compute-node.d.ts +26 -0
  117. package/dist/types/src/graph/compute-node.d.ts.map +1 -0
  118. package/dist/types/src/{components/ComputeGraph → graph/functions}/async-function.d.ts +14 -5
  119. package/dist/types/src/graph/functions/async-function.d.ts.map +1 -0
  120. package/dist/types/src/graph/functions/edge-function.d.ts +21 -0
  121. package/dist/types/src/graph/functions/edge-function.d.ts.map +1 -0
  122. package/dist/types/src/{model/functions.d.ts → graph/functions/function-defs.d.ts} +1 -1
  123. package/dist/types/src/graph/functions/function-defs.d.ts.map +1 -0
  124. package/dist/types/src/graph/functions/index.d.ts +4 -0
  125. package/dist/types/src/graph/functions/index.d.ts.map +1 -0
  126. package/dist/types/src/graph/hyperformula.test.d.ts +2 -0
  127. package/dist/types/src/graph/hyperformula.test.d.ts.map +1 -0
  128. package/dist/types/src/graph/index.d.ts +5 -0
  129. package/dist/types/src/graph/index.d.ts.map +1 -0
  130. package/dist/types/src/graph/testing/index.d.ts +3 -0
  131. package/dist/types/src/graph/testing/index.d.ts.map +1 -0
  132. package/dist/types/src/graph/testing/test-builder.d.ts +15 -0
  133. package/dist/types/src/graph/testing/test-builder.d.ts.map +1 -0
  134. package/dist/types/src/graph/testing/test-plugin.d.ts +36 -0
  135. package/dist/types/src/graph/testing/test-plugin.d.ts.map +1 -0
  136. package/dist/types/src/graph/util.d.ts +2 -0
  137. package/dist/types/src/graph/util.d.ts.map +1 -0
  138. package/dist/types/src/hooks/hooks.stories.d.ts +11 -0
  139. package/dist/types/src/hooks/hooks.stories.d.ts.map +1 -0
  140. package/dist/types/src/hooks/index.d.ts +4 -0
  141. package/dist/types/src/hooks/index.d.ts.map +1 -0
  142. package/dist/types/src/hooks/useComputeGraph.d.ts +7 -0
  143. package/dist/types/src/hooks/useComputeGraph.d.ts.map +1 -0
  144. package/dist/types/src/hooks/useFormattingModel.d.ts +3 -0
  145. package/dist/types/src/hooks/useFormattingModel.d.ts.map +1 -0
  146. package/dist/types/src/hooks/useSheetModel.d.ts +8 -0
  147. package/dist/types/src/hooks/useSheetModel.d.ts.map +1 -0
  148. package/dist/types/src/meta.d.ts +1 -4
  149. package/dist/types/src/meta.d.ts.map +1 -1
  150. package/dist/types/src/model/formatting-model.d.ts +16 -0
  151. package/dist/types/src/model/formatting-model.d.ts.map +1 -0
  152. package/dist/types/src/model/index.d.ts +2 -3
  153. package/dist/types/src/model/index.d.ts.map +1 -1
  154. package/dist/types/src/model/{model.d.ts → sheet-model.d.ts} +10 -65
  155. package/dist/types/src/model/sheet-model.d.ts.map +1 -0
  156. package/dist/types/src/model/sheet-model.test.d.ts +2 -0
  157. package/dist/types/src/model/sheet-model.test.d.ts.map +1 -0
  158. package/dist/types/src/sanity.test.d.ts +2 -0
  159. package/dist/types/src/sanity.test.d.ts.map +1 -0
  160. package/dist/types/src/testing/index.d.ts +2 -0
  161. package/dist/types/src/testing/index.d.ts.map +1 -0
  162. package/dist/types/src/testing/testing.d.ts +8 -0
  163. package/dist/types/src/testing/testing.d.ts.map +1 -0
  164. package/dist/types/src/translations.d.ts +17 -12
  165. package/dist/types/src/translations.d.ts.map +1 -1
  166. package/dist/types/src/types.d.ts +86 -5
  167. package/dist/types/src/types.d.ts.map +1 -1
  168. package/dist/vendor/hyperformula.mjs +37145 -0
  169. package/package.json +55 -47
  170. package/src/SheetPlugin.tsx +50 -73
  171. package/src/components/CellEditor/CellEditor.stories.tsx +6 -6
  172. package/src/components/CellEditor/CellEditor.tsx +59 -9
  173. package/src/components/CellEditor/extension.test.ts +4 -6
  174. package/src/components/CellEditor/extension.ts +5 -6
  175. package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +20 -0
  176. package/src/components/ComputeGraph/index.ts +1 -3
  177. package/src/components/GridSheet/GridSheet.stories.tsx +36 -0
  178. package/src/components/GridSheet/GridSheet.tsx +171 -0
  179. package/src/components/GridSheet/util.ts +148 -0
  180. package/src/components/Sheet/Sheet.stories.tsx +52 -88
  181. package/src/components/Sheet/Sheet.tsx +87 -32
  182. package/src/components/Sheet/decorations.ts +62 -0
  183. package/src/components/Sheet/grid.ts +3 -3
  184. package/src/components/Sheet/nav.ts +19 -19
  185. package/src/components/Sheet/sheet-context.tsx +18 -80
  186. package/src/components/Sheet/threads.tsx +205 -0
  187. package/src/components/SheetContainer.tsx +68 -16
  188. package/src/components/Toolbar/Toolbar.tsx +53 -12
  189. package/src/components/index.ts +1 -0
  190. package/src/defs/index.ts +6 -0
  191. package/src/{model → defs}/types.test.ts +8 -9
  192. package/src/{model → defs}/types.ts +24 -14
  193. package/src/defs/util.ts +151 -0
  194. package/src/extensions/compute.stories.tsx +151 -0
  195. package/src/extensions/compute.ts +147 -0
  196. package/src/extensions/index.ts +5 -0
  197. package/src/graph/compute-graph-registry.ts +90 -0
  198. package/src/graph/compute-graph.stories.tsx +93 -0
  199. package/src/graph/compute-graph.test.ts +87 -0
  200. package/src/graph/compute-graph.ts +242 -0
  201. package/src/graph/compute-node.ts +63 -0
  202. package/src/{components/ComputeGraph → graph/functions}/async-function.ts +25 -15
  203. package/src/{components/ComputeGraph → graph/functions}/edge-function.ts +16 -14
  204. package/src/graph/functions/index.ts +7 -0
  205. package/src/graph/hyperformula.test.ts +14 -0
  206. package/src/graph/index.ts +8 -0
  207. package/src/graph/testing/index.ts +6 -0
  208. package/src/graph/testing/test-builder.ts +54 -0
  209. package/src/{components/ComputeGraph/custom.ts → graph/testing/test-plugin.ts} +44 -14
  210. package/src/graph/util.ts +8 -0
  211. package/src/hooks/hooks.stories.tsx +50 -0
  212. package/src/hooks/index.ts +7 -0
  213. package/src/hooks/useComputeGraph.ts +28 -0
  214. package/src/hooks/useFormattingModel.ts +11 -0
  215. package/src/hooks/useSheetModel.ts +40 -0
  216. package/src/meta.tsx +1 -5
  217. package/src/{components/Sheet/formatting.ts → model/formatting-model.ts} +20 -13
  218. package/src/model/index.ts +2 -3
  219. package/src/model/sheet-model.test.ts +57 -0
  220. package/src/model/sheet-model.ts +416 -0
  221. package/src/sanity.test.ts +40 -0
  222. package/src/testing/index.ts +5 -0
  223. package/src/testing/testing.tsx +68 -0
  224. package/src/translations.ts +6 -1
  225. package/src/types.ts +35 -10
  226. package/dist/lib/browser/SheetContainer-U4H5D34A.mjs.map +0 -7
  227. package/dist/lib/browser/chunk-APHOLYUB.mjs +0 -175
  228. package/dist/lib/browser/chunk-APHOLYUB.mjs.map +0 -7
  229. package/dist/lib/browser/chunk-D5AGLXJP.mjs.map +0 -7
  230. package/dist/lib/browser/chunk-FUAGSXA4.mjs.map +0 -7
  231. package/dist/lib/browser/chunk-JRL5LGCE.mjs.map +0 -7
  232. package/dist/lib/browser/chunk-NU4PBN33.mjs +0 -8
  233. package/dist/lib/browser/chunk-NU4PBN33.mjs.map +0 -7
  234. package/dist/lib/browser/testing.mjs +0 -92
  235. package/dist/lib/browser/testing.mjs.map +0 -7
  236. package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs.map +0 -7
  237. package/dist/lib/node/chunk-5KKJ4NPP.cjs.map +0 -7
  238. package/dist/lib/node/chunk-BJ6ZD7MN.cjs.map +0 -7
  239. package/dist/lib/node/chunk-CN3RPESU.cjs +0 -202
  240. package/dist/lib/node/chunk-CN3RPESU.cjs.map +0 -7
  241. package/dist/lib/node/chunk-DSYKOI4E.cjs.map +0 -7
  242. package/dist/lib/node/chunk-PYXHNAAK.cjs +0 -40
  243. package/dist/lib/node/chunk-PYXHNAAK.cjs.map +0 -7
  244. package/dist/lib/node/testing.cjs +0 -111
  245. package/dist/lib/node/testing.cjs.map +0 -7
  246. package/dist/types/src/components/ComputeGraph/async-function.d.ts.map +0 -1
  247. package/dist/types/src/components/ComputeGraph/custom.d.ts +0 -21
  248. package/dist/types/src/components/ComputeGraph/custom.d.ts.map +0 -1
  249. package/dist/types/src/components/ComputeGraph/edge-function.d.ts +0 -20
  250. package/dist/types/src/components/ComputeGraph/edge-function.d.ts.map +0 -1
  251. package/dist/types/src/components/ComputeGraph/graph-context.d.ts +0 -12
  252. package/dist/types/src/components/ComputeGraph/graph-context.d.ts.map +0 -1
  253. package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts +0 -2
  254. package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts.map +0 -1
  255. package/dist/types/src/components/ComputeGraph/graph.d.ts +0 -26
  256. package/dist/types/src/components/ComputeGraph/graph.d.ts.map +0 -1
  257. package/dist/types/src/components/Sheet/formatting.d.ts +0 -14
  258. package/dist/types/src/components/Sheet/formatting.d.ts.map +0 -1
  259. package/dist/types/src/model/functions.d.ts.map +0 -1
  260. package/dist/types/src/model/model.browser.test.d.ts +0 -2
  261. package/dist/types/src/model/model.browser.test.d.ts.map +0 -1
  262. package/dist/types/src/model/model.d.ts.map +0 -1
  263. package/dist/types/src/model/types.d.ts.map +0 -1
  264. package/dist/types/src/model/types.test.d.ts.map +0 -1
  265. package/dist/types/src/model/util.d.ts +0 -15
  266. package/dist/types/src/model/util.d.ts.map +0 -1
  267. package/dist/types/src/testing.d.ts +0 -9
  268. package/dist/types/src/testing.d.ts.map +0 -1
  269. package/src/components/ComputeGraph/graph-context.tsx +0 -50
  270. package/src/components/ComputeGraph/graph.browser.test.ts +0 -50
  271. package/src/components/ComputeGraph/graph.ts +0 -62
  272. package/src/model/model.browser.test.ts +0 -100
  273. package/src/model/model.ts +0 -550
  274. package/src/model/util.ts +0 -36
  275. package/src/testing.ts +0 -50
  276. /package/dist/types/src/{model → defs}/types.test.d.ts +0 -0
  277. /package/src/{model/functions.ts → graph/functions/function-defs.ts} +0 -0
package/package.json CHANGED
@@ -1,37 +1,39 @@
1
1
  {
2
2
  "name": "@dxos/plugin-sheet",
3
- "version": "0.6.11",
3
+ "version": "0.6.12-main.568932b",
4
4
  "description": "Braneframe sketch plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
7
  "license": "MIT",
8
8
  "author": "DXOS.org",
9
+ "imports": {
10
+ "#hyperformula": {
11
+ "types": "hyperformula",
12
+ "default": "./dist/vendor/hyperformula.mjs"
13
+ }
14
+ },
9
15
  "exports": {
10
16
  ".": {
11
17
  "browser": "./dist/lib/browser/index.mjs",
12
18
  "node": {
13
- "default": "./dist/lib/node/index.cjs"
19
+ "require": "./dist/lib/node/index.cjs",
20
+ "default": "./dist/lib/node-esm/index.mjs"
14
21
  },
15
22
  "types": "./dist/types/src/index.d.ts"
16
23
  },
17
24
  "./meta": {
18
25
  "browser": "./dist/lib/browser/meta.mjs",
19
26
  "node": {
20
- "default": "./dist/lib/node/meta.cjs"
27
+ "require": "./dist/lib/node/meta.cjs",
28
+ "default": "./dist/lib/node-esm/meta.mjs"
21
29
  },
22
30
  "types": "./dist/types/src/meta.d.ts"
23
31
  },
24
- "./testing": {
25
- "browser": "./dist/lib/browser/testing.mjs",
26
- "node": {
27
- "default": "./dist/lib/node/testing.cjs"
28
- },
29
- "types": "./dist/types/src/testing.d.ts"
30
- },
31
32
  "./types": {
32
33
  "browser": "./dist/lib/browser/types.mjs",
33
34
  "node": {
34
- "default": "./dist/lib/node/types.cjs"
35
+ "require": "./dist/lib/node/types.cjs",
36
+ "default": "./dist/lib/node-esm/types.mjs"
35
37
  },
36
38
  "types": "./dist/types/src/types.d.ts"
37
39
  }
@@ -55,16 +57,17 @@
55
57
  "src"
56
58
  ],
57
59
  "dependencies": {
58
- "@codemirror/autocomplete": "^6.18.0",
59
- "@codemirror/language": "^6.10.2",
60
+ "@codemirror/autocomplete": "^6.18.1",
61
+ "@codemirror/language": "^6.10.3",
60
62
  "@codemirror/state": "^6.4.1",
61
- "@codemirror/view": "^6.29.1",
63
+ "@codemirror/view": "^6.34.1",
62
64
  "@dnd-kit/core": "^6.0.5",
63
65
  "@dnd-kit/modifiers": "^6.0.0",
64
66
  "@dnd-kit/sortable": "^7.0.1",
65
67
  "@dnd-kit/utilities": "^3.2.0",
66
- "@lezer/common": "^1.2.1",
67
- "@lezer/highlight": "^1.2.0",
68
+ "@effect/schema": "^0.75.1",
69
+ "@lezer/common": "^1.2.2",
70
+ "@lezer/highlight": "^1.2.1",
68
71
  "@lezer/lezer": "^1.1.2",
69
72
  "@lezer/lr": "^1.4.2",
70
73
  "@preact/signals-core": "^1.6.0",
@@ -76,25 +79,29 @@
76
79
  "re-resizable": "^6.9.17",
77
80
  "react-markdown": "^8.0.5",
78
81
  "react-resize-detector": "^11.0.1",
79
- "@dxos/app-framework": "0.6.11",
80
- "@dxos/async": "0.6.11",
81
- "@dxos/context": "0.6.11",
82
- "@dxos/client": "0.6.11",
83
- "@dxos/crypto": "0.6.11",
84
- "@dxos/debug": "0.6.11",
85
- "@dxos/echo-schema": "0.6.11",
86
- "@dxos/invariant": "0.6.11",
87
- "@dxos/keys": "0.6.11",
88
- "@dxos/plugin-client": "0.6.11",
89
- "@dxos/log": "0.6.11",
90
- "@dxos/plugin-graph": "0.6.11",
91
- "@dxos/plugin-script": "0.6.11",
92
- "@dxos/plugin-space": "0.6.11",
93
- "@dxos/plugin-stack": "0.6.11",
94
- "@dxos/react-ui-attention": "0.6.11",
95
- "@dxos/react-client": "0.6.11",
96
- "@dxos/react-ui-editor": "0.6.11",
97
- "@dxos/util": "0.6.11"
82
+ "@dxos/app-framework": "0.6.12-main.568932b",
83
+ "@dxos/async": "0.6.12-main.568932b",
84
+ "@dxos/client": "0.6.12-main.568932b",
85
+ "@dxos/crypto": "0.6.12-main.568932b",
86
+ "@dxos/context": "0.6.12-main.568932b",
87
+ "@dxos/debug": "0.6.12-main.568932b",
88
+ "@dxos/echo-schema": "0.6.12-main.568932b",
89
+ "@dxos/invariant": "0.6.12-main.568932b",
90
+ "@dxos/plugin-attention": "0.6.12-main.568932b",
91
+ "@dxos/keys": "0.6.12-main.568932b",
92
+ "@dxos/log": "0.6.12-main.568932b",
93
+ "@dxos/plugin-client": "0.6.12-main.568932b",
94
+ "@dxos/plugin-graph": "0.6.12-main.568932b",
95
+ "@dxos/plugin-markdown": "0.6.12-main.568932b",
96
+ "@dxos/plugin-space": "0.6.12-main.568932b",
97
+ "@dxos/react-client": "0.6.12-main.568932b",
98
+ "@dxos/plugin-stack": "0.6.12-main.568932b",
99
+ "@dxos/react-hooks": "0.6.12-main.568932b",
100
+ "@dxos/react-ui-editor": "0.6.12-main.568932b",
101
+ "@dxos/react-ui-attention": "0.6.12-main.568932b",
102
+ "@dxos/plugin-script": "0.6.12-main.568932b",
103
+ "@dxos/react-ui-grid": "0.6.12-main.568932b",
104
+ "@dxos/util": "0.6.12-main.568932b"
98
105
  },
99
106
  "devDependencies": {
100
107
  "@lezer/generator": "^1.7.1",
@@ -106,20 +113,21 @@
106
113
  "@types/react-window": "^1.8.8",
107
114
  "react": "~18.2.0",
108
115
  "react-dom": "~18.2.0",
109
- "vite": "^5.3.4",
110
- "@dxos/echo-generator": "0.6.11",
111
- "@dxos/random": "0.6.11",
112
- "@dxos/react-ui": "0.6.11",
113
- "@dxos/react-ui-types": "0.6.11",
114
- "@dxos/storybook-utils": "0.6.11",
115
- "@dxos/react-ui-theme": "0.6.11"
116
+ "vite": "5.4.7",
117
+ "@dxos/echo-generator": "0.6.12-main.568932b",
118
+ "@dxos/random": "0.6.12-main.568932b",
119
+ "@dxos/react-ui": "0.6.12-main.568932b",
120
+ "@dxos/react-ui-syntax-highlighter": "0.6.12-main.568932b",
121
+ "@dxos/react-ui-theme": "0.6.12-main.568932b",
122
+ "@dxos/react-ui-types": "0.6.12-main.568932b",
123
+ "@dxos/storybook-utils": "0.6.12-main.568932b"
116
124
  },
117
- "optionalDependencies": {
125
+ "peerDependencies": {
118
126
  "@phosphor-icons/react": "^2.1.5",
119
- "react": "^18.0.0",
120
- "react-dom": "^18.0.0",
121
- "@dxos/react-ui-theme": "0.6.11",
122
- "@dxos/react-ui": "0.6.11"
127
+ "react": "~18.2.0",
128
+ "react-dom": "~18.2.0",
129
+ "@dxos/react-ui": "0.6.12-main.568932b",
130
+ "@dxos/react-ui-theme": "0.6.12-main.568932b"
123
131
  },
124
132
  "publishConfig": {
125
133
  "access": "public"
@@ -2,84 +2,71 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type IconProps, GridNine } from '@phosphor-icons/react';
5
+ import { GridNine } from '@phosphor-icons/react';
6
6
  import React from 'react';
7
7
 
8
- import {
9
- NavigationAction,
10
- parseIntentPlugin,
11
- resolvePlugin,
12
- type PluginDefinition,
13
- type LayoutCoordinate,
14
- } from '@dxos/app-framework';
15
- import { create } from '@dxos/echo-schema';
8
+ import { NavigationAction, parseIntentPlugin, resolvePlugin, type PluginDefinition } from '@dxos/app-framework';
9
+ import { invariant } from '@dxos/invariant';
16
10
  import { parseClientPlugin } from '@dxos/plugin-client';
17
- import { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';
11
+ import { createExtension, isActionGroup, type ActionGroup } from '@dxos/plugin-graph';
18
12
  import { FunctionType } from '@dxos/plugin-script/types';
19
13
  import { SpaceAction } from '@dxos/plugin-space';
20
14
  import { getSpace, isEchoObject } from '@dxos/react-client/echo';
21
15
 
22
- import {
23
- createComputeGraph,
24
- CustomPlugin,
25
- CustomPluginTranslations,
26
- SheetContainer,
27
- type ComputeGraph,
28
- } from './components';
29
- // TODO(wittjosiah): Refactor. These are not exported from ./components due to depending on ECHO.
30
- import { EdgeFunctionPlugin, EdgeFunctionPluginTranslations } from './components/ComputeGraph/edge-function';
31
- import { ComputeGraphContextProvider } from './components/ComputeGraph/graph-context';
16
+ import { ComputeGraphContextProvider, SheetContainer } from './components';
17
+ import { compareIndexPositions, createSheet } from './defs';
18
+ import { computeGraphFacet } from './extensions';
19
+ import { type ComputeGraphRegistry } from './graph';
20
+ import { useComputeGraph } from './hooks';
32
21
  import meta, { SHEET_PLUGIN } from './meta';
33
- import { SheetModel } from './model';
34
22
  import translations from './translations';
35
- import { createSheet, SheetAction, type SheetPluginProvides, SheetType } from './types';
23
+ import { SheetAction, SheetType, type SheetPluginProvides } from './types';
36
24
 
37
25
  export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
38
- let remoteFunctionUrl: string | undefined;
39
-
40
- const graphs = create<Record<string, ComputeGraph>>({});
41
- const setGraph = (key: string, graph: ComputeGraph) => {
42
- graphs[key] = graph;
43
- };
26
+ let computeGraphRegistry: ComputeGraphRegistry | undefined;
44
27
 
45
28
  return {
46
29
  meta,
47
30
  ready: async (plugins) => {
48
31
  const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
49
- if (!client) {
50
- return;
51
- }
52
-
32
+ invariant(client);
33
+ let remoteFunctionUrl: string | undefined;
53
34
  if (client.config.values.runtime?.services?.edge?.url) {
54
35
  const url = new URL('/functions', client.config.values.runtime?.services?.edge?.url);
55
36
  url.protocol = 'https';
56
37
  remoteFunctionUrl = url.toString();
57
38
  }
39
+
40
+ // Async import removes direct dependency on hyperformula.
41
+ const { ComputeGraphRegistry } = await import('./graph');
42
+ computeGraphRegistry = new ComputeGraphRegistry({ remoteFunctionUrl });
58
43
  },
59
44
  provides: {
60
45
  context: ({ children }) => {
61
- return (
62
- <ComputeGraphContextProvider graphs={graphs} setGraph={setGraph}>
63
- {children}
64
- </ComputeGraphContextProvider>
65
- );
46
+ invariant(computeGraphRegistry);
47
+ return <ComputeGraphContextProvider registry={computeGraphRegistry}>{children}</ComputeGraphContextProvider>;
66
48
  },
67
49
  metadata: {
68
50
  records: {
69
51
  [SheetType.typename]: {
70
- label: (object: any) => (object instanceof SheetType ? object.title : undefined),
52
+ label: (object: any) => (object instanceof SheetType ? object.name : undefined),
71
53
  placeholder: ['sheet title placeholder', { ns: SHEET_PLUGIN }],
72
- icon: (props: IconProps) => <GridNine {...props} />,
73
- iconSymbol: 'ph--grid-nine--regular',
54
+ icon: 'ph--grid-nine--regular',
74
55
  },
75
56
  },
76
57
  },
77
58
  translations,
78
59
  echo: {
79
60
  // TODO(wittjosiah): Factor out to common package/plugin.
80
- // FunctionType is currently registered here in case script plugin isn't enabled.
61
+ // FunctionType is currently registered here in case script plugin isn't enabled.
81
62
  schema: [SheetType, FunctionType],
82
63
  },
64
+ space: {
65
+ onSpaceCreate: {
66
+ label: ['create sheet label', { ns: SHEET_PLUGIN }],
67
+ action: SheetAction.CREATE,
68
+ },
69
+ },
83
70
  graph: {
84
71
  builder: (plugins) => {
85
72
  const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
@@ -113,8 +100,7 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
113
100
  },
114
101
  properties: {
115
102
  label: ['create sheet label', { ns: SHEET_PLUGIN }],
116
- icon: (props: IconProps) => <GridNine {...props} />,
117
- iconSymbol: 'ph--grid-nine--regular',
103
+ icon: 'ph--grid-nine--regular',
118
104
  testId: 'sheetPlugin.createObject',
119
105
  },
120
106
  },
@@ -123,6 +109,16 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
123
109
  });
124
110
  },
125
111
  },
112
+ markdown: {
113
+ extensions: ({ document: doc }) => {
114
+ invariant(computeGraphRegistry);
115
+ const space = getSpace(doc);
116
+ if (space) {
117
+ const computeGraph = computeGraphRegistry.getOrCreateGraph(space);
118
+ return computeGraphFacet.of(computeGraph);
119
+ }
120
+ },
121
+ },
126
122
  stack: {
127
123
  creators: [
128
124
  {
@@ -138,23 +134,20 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
138
134
  },
139
135
  ],
140
136
  },
137
+ thread: {
138
+ predicate: (data) => data instanceof SheetType,
139
+ createSort: (sheet) => (indexA, indexB) =>
140
+ !indexA || !indexB ? 0 : compareIndexPositions(sheet, indexA, indexB),
141
+ },
141
142
  surface: {
142
- component: ({ data, role = 'never' }) => {
143
- // TODO(burdon): Standardize wrapper (with room for toolbar).
144
- const space = isEchoObject(data.object) && getSpace(data.object);
145
- if (space && data.object instanceof SheetType) {
143
+ component: ({ data, role }) => {
144
+ const space = isEchoObject(data.object) ? getSpace(data.object) : undefined;
145
+ const graph = useComputeGraph(space);
146
+ if (graph && data.object instanceof SheetType) {
146
147
  switch (role) {
147
148
  case 'article':
148
149
  case 'section': {
149
- return (
150
- <SheetContainer
151
- sheet={data.object}
152
- space={space}
153
- role={role}
154
- coordinate={data.coordinate as LayoutCoordinate}
155
- remoteFunctionUrl={remoteFunctionUrl}
156
- />
157
- );
150
+ return <SheetContainer graph={graph} sheet={data.object} role={role} />;
158
151
  }
159
152
  }
160
153
  }
@@ -166,23 +159,7 @@ export const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {
166
159
  resolver: async (intent) => {
167
160
  switch (intent.action) {
168
161
  case SheetAction.CREATE: {
169
- const space = intent.data?.space;
170
- const sheet = createSheet();
171
- const graph =
172
- graphs[space.id] ??
173
- createComputeGraph(
174
- [
175
- { plugin: EdgeFunctionPlugin, translations: EdgeFunctionPluginTranslations },
176
- // TODO(wittjosiah): Remove. Needed for current test sheet generated data.
177
- { plugin: CustomPlugin, translations: CustomPluginTranslations },
178
- ],
179
- space,
180
- { remoteFunctionUrl },
181
- );
182
- const model = new SheetModel(graph, sheet);
183
- await model.initialize();
184
- await model.destroy();
185
- return { data: sheet };
162
+ return { data: createSheet() };
186
163
  }
187
164
  }
188
165
  },
@@ -4,7 +4,6 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { HyperFormula } from 'hyperformula';
8
7
  import React, { useEffect, useMemo, useState } from 'react';
9
8
 
10
9
  import { Client } from '@dxos/client';
@@ -12,10 +11,12 @@ import { createDocAccessor, type EchoReactiveObject } from '@dxos/client/echo';
12
11
  import { automerge } from '@dxos/react-ui-editor';
13
12
  import { withTheme } from '@dxos/storybook-utils';
14
13
 
14
+ import { HyperFormula } from '#hyperformula';
15
15
  import { CellEditor, type CellEditorProps } from './CellEditor';
16
16
  import { sheetExtension } from './extension';
17
- import { defaultFunctions } from '../../model';
18
- import { createSheet, SheetType } from '../../types';
17
+ import { createSheet } from '../../defs';
18
+ import { defaultFunctions } from '../../graph';
19
+ import { SheetType } from '../../types';
19
20
 
20
21
  export default {
21
22
  title: 'plugin-sheet/CellEditor',
@@ -41,14 +42,13 @@ const AutomergeStory = ({ value, ...props }: StoryProps) => {
41
42
  const [object, setObject] = useState<EchoReactiveObject<SheetType>>();
42
43
  useEffect(() => {
43
44
  setTimeout(async () => {
44
- const client = new Client();
45
+ const client = new Client({ types: [SheetType] });
45
46
  await client.initialize();
46
47
  await client.halo.createIdentity();
47
48
  const space = await client.spaces.create();
48
- client.addTypes([SheetType]);
49
49
 
50
50
  const sheet = createSheet();
51
- sheet.title = 'Test';
51
+ sheet.name = 'Test';
52
52
  sheet.cells[cell] = { value };
53
53
  space.db.add(sheet);
54
54
  setObject(sheet);
@@ -14,10 +14,13 @@ import {
14
14
  preventNewline,
15
15
  useTextEditor,
16
16
  } from '@dxos/react-ui-editor';
17
+ import { type GridEditBox } from '@dxos/react-ui-grid';
18
+
19
+ type EditorKeyEvent = Pick<KeyboardEvent<HTMLInputElement>, 'key'> & { shift?: boolean };
17
20
 
18
21
  export type EditorKeysProps = {
19
- onClose: (value: string | undefined) => void;
20
- onNav?: (value: string | undefined, ev: Pick<KeyboardEvent<HTMLInputElement>, 'key'>) => void;
22
+ onClose: (value: string | undefined, event: EditorKeyEvent) => void;
23
+ onNav?: (value: string | undefined, event: EditorKeyEvent) => void;
21
24
  };
22
25
 
23
26
  export const editorKeys = ({ onNav, onClose }: EditorKeysProps): Extension => {
@@ -57,14 +60,29 @@ export const editorKeys = ({ onNav, onClose }: EditorKeysProps): Extension => {
57
60
  {
58
61
  key: 'Enter',
59
62
  run: (editor) => {
60
- onClose(editor.state.doc.toString());
63
+ onClose(editor.state.doc.toString(), { key: 'Enter' });
64
+ return true;
65
+ },
66
+ shift: (editor) => {
67
+ onClose(editor.state.doc.toString(), { key: 'Enter', shift: true });
68
+ return true;
69
+ },
70
+ },
71
+ {
72
+ key: 'Tab',
73
+ run: (editor) => {
74
+ onClose(editor.state.doc.toString(), { key: 'Tab' });
75
+ return true;
76
+ },
77
+ shift: (editor) => {
78
+ onClose(editor.state.doc.toString(), { key: 'Tab', shift: true });
61
79
  return true;
62
80
  },
63
81
  },
64
82
  {
65
83
  key: 'Escape',
66
84
  run: () => {
67
- onClose(undefined);
85
+ onClose(undefined, { key: 'Escape' });
68
86
  return true;
69
87
  },
70
88
  },
@@ -74,10 +92,35 @@ export const editorKeys = ({ onNav, onClose }: EditorKeysProps): Extension => {
74
92
  export type CellEditorProps = {
75
93
  value?: string;
76
94
  extension?: Extension;
95
+ variant?: keyof typeof editorVariants;
96
+ box?: GridEditBox;
97
+ gridId?: string;
77
98
  } & Pick<UseTextEditorProps, 'autoFocus'> &
78
99
  Pick<DOMAttributes<HTMLInputElement>, 'onBlur' | 'onKeyDown'>;
79
100
 
80
- export const CellEditor = ({ value, extension, autoFocus, onBlur }: CellEditorProps) => {
101
+ const editorVariants = {
102
+ // TODO(thure): remove when legacy is no longer used.
103
+ legacy: {
104
+ root: 'flex w-full',
105
+ editor: 'flex w-full [&>.cm-scroller]:scrollbar-none',
106
+ content: '!px-2 !py-1',
107
+ },
108
+ grid: {
109
+ root: 'absolute z-[1]',
110
+ editor: '[&>.cm-scroller]:scrollbar-none tabular-nums',
111
+ content: '!border !border-transparent !p-0.5',
112
+ },
113
+ };
114
+
115
+ export const CellEditor = ({
116
+ value,
117
+ extension,
118
+ autoFocus,
119
+ onBlur,
120
+ variant = 'legacy',
121
+ box,
122
+ gridId,
123
+ }: CellEditorProps) => {
81
124
  const { themeMode } = useThemeContext();
82
125
  const { parentRef } = useTextEditor(() => {
83
126
  return {
@@ -98,16 +141,23 @@ export const CellEditor = ({ value, extension, autoFocus, onBlur }: CellEditorPr
98
141
  themeMode,
99
142
  slots: {
100
143
  editor: {
101
- className: 'flex w-full [&>.cm-scroller]:scrollbar-none',
144
+ className: editorVariants[variant].editor,
102
145
  },
103
146
  content: {
104
- className: '!px-2 !py-1',
147
+ className: editorVariants[variant].content,
105
148
  },
106
149
  },
107
150
  }),
108
151
  ],
109
152
  };
110
- }, [extension]);
153
+ }, [extension, autoFocus, value, variant, onBlur]);
111
154
 
112
- return <div ref={parentRef} className='flex w-full' />;
155
+ return (
156
+ <div
157
+ ref={parentRef}
158
+ className={editorVariants[variant].root}
159
+ style={box}
160
+ {...(gridId && { 'data-grid': gridId })}
161
+ />
162
+ );
113
163
  };
@@ -4,14 +4,12 @@
4
4
 
5
5
  import { CompletionContext, type CompletionSource } from '@codemirror/autocomplete';
6
6
  import { EditorState } from '@codemirror/state';
7
- // @ts-ignore
8
7
  import { testTree } from '@lezer/generator/test';
9
- import { expect } from 'chai';
10
8
  import { spreadsheet } from 'codemirror-lang-spreadsheet';
11
- import { describe, test } from 'vitest';
9
+ import { describe, expect, test } from 'vitest';
12
10
 
13
11
  import { sheetExtension } from './extension';
14
- import { defaultFunctions } from '../../model/functions';
12
+ import { defaultFunctions } from '../../graph';
15
13
 
16
14
  describe('formula parser', () => {
17
15
  const {
@@ -37,8 +35,8 @@ describe('formula parser', () => {
37
35
  extensions: sheetExtension({ functions }),
38
36
  });
39
37
 
40
- const [f] = state.languageDataAt<CompletionSource>('autocomplete', text.length);
41
- const result = await f(new CompletionContext(state, text.length, true));
38
+ const [fn] = state.languageDataAt<CompletionSource>('autocomplete', text.length);
39
+ const result = await fn(new CompletionContext(state, text.length, true));
42
40
  expect(result?.options).to.have.length(1);
43
41
  });
44
42
  });
@@ -12,15 +12,16 @@ import {
12
12
  startCompletion,
13
13
  } from '@codemirror/autocomplete';
14
14
  import { HighlightStyle, type Language, syntaxHighlighting } from '@codemirror/language';
15
- import { type Extension, Facet } from '@codemirror/state';
15
+ import { type Extension } from '@codemirror/state';
16
16
  import { type EditorView, ViewPlugin, type ViewUpdate, keymap } from '@codemirror/view';
17
17
  import { type SyntaxNode } from '@lezer/common';
18
18
  import { tags } from '@lezer/highlight';
19
19
  import { spreadsheet } from 'codemirror-lang-spreadsheet';
20
20
 
21
+ import { singleValueFacet } from '@dxos/react-ui-editor/state';
21
22
  import { mx } from '@dxos/react-ui-theme';
22
23
 
23
- import { type FunctionDefinition } from '../../model';
24
+ import { type FunctionDefinition } from '../../graph';
24
25
 
25
26
  /**
26
27
  * https://codemirror.net/examples/styling
@@ -59,7 +60,7 @@ const highlightStyles = HighlightStyle.define([
59
60
  },
60
61
  ]);
61
62
 
62
- const languageFacet = Facet.define<Language>();
63
+ const languageFacet = singleValueFacet<Language>();
63
64
 
64
65
  export type SheetExtensionOptions = {
65
66
  functions?: FunctionDefinition[];
@@ -165,8 +166,6 @@ export const sheetExtension = ({ functions = [] }: SheetExtensionOptions): Exten
165
166
  icons: false,
166
167
  tooltipClass: () =>
167
168
  mx(
168
- // TODO(burdon): Factor out fragments.
169
- // TODO(burdon): Size to make width same as column.
170
169
  '!-left-[1px] !top-[33px] !-m-0 border !border-t-0 [&>ul]:!min-w-[198px]',
171
170
  '[&>ul>li[aria-selected]]:!bg-accentSurface',
172
171
  'border-separator',
@@ -231,7 +230,7 @@ export const rangeExtension = (onInit: (notifier: CellRangeNotifier) => void): E
231
230
 
232
231
  // Find first Range or cell at cursor.
233
232
  activeRange = undefined;
234
- const [language] = view.state.facet(languageFacet);
233
+ const language = view.state.facet(languageFacet);
235
234
  const { topNode } = language.parser.parse(view.state.doc.toString());
236
235
  visitTree(topNode, ({ type, from, to }) => {
237
236
  if (from <= anchor && to >= anchor) {
@@ -0,0 +1,20 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React, { createContext, type PropsWithChildren } from 'react';
6
+
7
+ import { type ComputeGraphRegistry } from '../../graph';
8
+
9
+ export type ComputeGraphContextType = {
10
+ registry: ComputeGraphRegistry;
11
+ };
12
+
13
+ /**
14
+ * The compute graph context manages a ComputeGraph for each space.
15
+ */
16
+ export const ComputeGraphContext = createContext<ComputeGraphContextType | undefined>(undefined);
17
+
18
+ export const ComputeGraphContextProvider = ({ registry, children }: PropsWithChildren<ComputeGraphContextType>) => {
19
+ return <ComputeGraphContext.Provider value={{ registry }}>{children}</ComputeGraphContext.Provider>;
20
+ };
@@ -2,6 +2,4 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- export * from './async-function';
6
- export * from './custom';
7
- export * from './graph';
5
+ export * from './ComputeGraphContextProvider';
@@ -0,0 +1,36 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { useSpace } from '@dxos/react-client/echo';
8
+ import { withClientProvider } from '@dxos/react-client/testing';
9
+ import { withTheme, withLayout } from '@dxos/storybook-utils';
10
+
11
+ import { GridSheet } from './GridSheet';
12
+ import { useComputeGraph } from '../../hooks';
13
+ import { useTestSheet, withComputeGraphDecorator } from '../../testing';
14
+ import { SheetType } from '../../types';
15
+
16
+ export default {
17
+ title: 'plugin-sheet/GridSheet',
18
+ component: GridSheet,
19
+ decorators: [
20
+ withClientProvider({ types: [SheetType], createSpace: true }),
21
+ withComputeGraphDecorator(),
22
+ withTheme,
23
+ withLayout({ fullscreen: true, tooltips: true }),
24
+ ],
25
+ };
26
+
27
+ export const Basic = () => {
28
+ const space = useSpace();
29
+ const graph = useComputeGraph(space);
30
+ const sheet = useTestSheet(space, graph);
31
+ if (!sheet || !space) {
32
+ return null;
33
+ }
34
+
35
+ return <GridSheet graph={graph} sheet={sheet} />;
36
+ };