@dxos/plugin-sheet 0.6.13 → 0.6.14-staging.9e90729

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 (330) hide show
  1. package/dist/lib/browser/SheetContainer-JBB7W52Y.mjs +280 -0
  2. package/dist/lib/browser/SheetContainer-JBB7W52Y.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-D5AGLXJP.mjs → chunk-2ZK3YMZG.mjs} +621 -675
  4. package/dist/lib/browser/chunk-2ZK3YMZG.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-3QWIMZZJ.mjs +65 -0
  6. package/dist/lib/browser/chunk-3QWIMZZJ.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-D3QTX46O.mjs +14 -0
  8. package/dist/lib/browser/chunk-D3QTX46O.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-XXDHBYZQ.mjs +1455 -0
  10. package/dist/lib/browser/chunk-XXDHBYZQ.mjs.map +7 -0
  11. package/dist/lib/browser/compute-graph-ZQKB6QVP.mjs +35 -0
  12. package/dist/lib/browser/compute-graph-ZQKB6QVP.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +139 -65
  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 +6 -12
  18. package/dist/lib/node/SheetContainer-L37HUFCF.cjs +286 -0
  19. package/dist/lib/node/SheetContainer-L37HUFCF.cjs.map +7 -0
  20. package/dist/lib/node/chunk-7AWAC3R3.cjs +1441 -0
  21. package/dist/lib/node/chunk-7AWAC3R3.cjs.map +7 -0
  22. package/dist/lib/node/chunk-QIFIGEKV.cjs +37 -0
  23. package/dist/lib/node/chunk-QIFIGEKV.cjs.map +7 -0
  24. package/dist/lib/node/{chunk-5KKJ4NPP.cjs → chunk-QNFMTK3X.cjs} +638 -674
  25. package/dist/lib/node/chunk-QNFMTK3X.cjs.map +7 -0
  26. package/dist/lib/node/{chunk-DSYKOI4E.cjs → chunk-V7E5JZBD.cjs} +31 -51
  27. package/dist/lib/node/chunk-V7E5JZBD.cjs.map +7 -0
  28. package/dist/lib/node/compute-graph-RJB6OVW6.cjs +57 -0
  29. package/dist/lib/node/compute-graph-RJB6OVW6.cjs.map +7 -0
  30. package/dist/lib/node/index.cjs +148 -73
  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 +9 -15
  36. package/dist/lib/node/types.cjs.map +2 -2
  37. package/dist/lib/node-esm/SheetContainer-CLKFEM35.mjs +281 -0
  38. package/dist/lib/node-esm/SheetContainer-CLKFEM35.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-3JYJEOCF.mjs +1456 -0
  40. package/dist/lib/node-esm/chunk-3JYJEOCF.mjs.map +7 -0
  41. package/dist/lib/node-esm/chunk-JBTORSST.mjs +3182 -0
  42. package/dist/lib/node-esm/chunk-JBTORSST.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-SPQFLYC2.mjs +66 -0
  44. package/dist/lib/node-esm/chunk-SPQFLYC2.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-VCYJWE3O.mjs +16 -0
  46. package/dist/lib/node-esm/chunk-VCYJWE3O.mjs.map +7 -0
  47. package/dist/lib/node-esm/compute-graph-VKRG526N.mjs +36 -0
  48. package/dist/lib/node-esm/compute-graph-VKRG526N.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +323 -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 +17 -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/ComputeGraph/ComputeGraphContextProvider.d.ts +13 -0
  58. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -0
  59. package/dist/types/src/components/ComputeGraph/index.d.ts +1 -3
  60. package/dist/types/src/components/ComputeGraph/index.d.ts.map +1 -1
  61. package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts +3 -0
  62. package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts.map +1 -0
  63. package/dist/types/src/components/FunctionEditor/index.d.ts +2 -0
  64. package/dist/types/src/components/FunctionEditor/index.d.ts.map +1 -0
  65. package/dist/types/src/components/GridSheet/GridSheet.d.ts +3 -0
  66. package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -0
  67. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +6 -0
  68. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -0
  69. package/dist/types/src/components/{CellEditor/CellEditor.stories.d.ts → GridSheet/SheetCellEditor.stories.d.ts} +5 -9
  70. package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +1 -0
  71. package/dist/types/src/components/GridSheet/index.d.ts +2 -0
  72. package/dist/types/src/components/GridSheet/index.d.ts.map +1 -0
  73. package/dist/types/src/components/GridSheet/util.d.ts +16 -0
  74. package/dist/types/src/components/GridSheet/util.d.ts.map +1 -0
  75. package/dist/types/src/components/RangeList/RangeList.d.ts +9 -0
  76. package/dist/types/src/components/RangeList/RangeList.d.ts.map +1 -0
  77. package/dist/types/src/components/RangeList/index.d.ts +2 -0
  78. package/dist/types/src/components/RangeList/index.d.ts.map +1 -0
  79. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +6 -0
  80. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +1 -0
  81. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +6 -0
  82. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -0
  83. package/dist/types/src/components/SheetContainer/index.d.ts +3 -0
  84. package/dist/types/src/components/SheetContainer/index.d.ts.map +1 -0
  85. package/dist/types/src/components/SheetContext/SheetContext.d.ts +28 -0
  86. package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +1 -0
  87. package/dist/types/src/components/SheetContext/index.d.ts +2 -0
  88. package/dist/types/src/components/SheetContext/index.d.ts.map +1 -0
  89. package/dist/types/src/components/Toolbar/Toolbar.d.ts +33 -9
  90. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
  91. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +4 -32
  92. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
  93. package/dist/types/src/components/index.d.ts +5 -4
  94. package/dist/types/src/components/index.d.ts.map +1 -1
  95. package/dist/types/src/compute-graph/compute-graph-registry.d.ts +34 -0
  96. package/dist/types/src/compute-graph/compute-graph-registry.d.ts.map +1 -0
  97. package/dist/types/src/compute-graph/compute-graph.d.ts +64 -0
  98. package/dist/types/src/compute-graph/compute-graph.d.ts.map +1 -0
  99. package/dist/types/src/compute-graph/compute-graph.stories.d.ts +6 -0
  100. package/dist/types/src/compute-graph/compute-graph.stories.d.ts.map +1 -0
  101. package/dist/types/src/compute-graph/compute-graph.test.d.ts +2 -0
  102. package/dist/types/src/compute-graph/compute-graph.test.d.ts.map +1 -0
  103. package/dist/types/src/compute-graph/compute-node.d.ts +26 -0
  104. package/dist/types/src/compute-graph/compute-node.d.ts.map +1 -0
  105. package/dist/types/src/{components/ComputeGraph → compute-graph/functions}/async-function.d.ts +14 -5
  106. package/dist/types/src/compute-graph/functions/async-function.d.ts.map +1 -0
  107. package/dist/types/src/compute-graph/functions/edge-function.d.ts +21 -0
  108. package/dist/types/src/compute-graph/functions/edge-function.d.ts.map +1 -0
  109. package/dist/types/src/{model/functions.d.ts → compute-graph/functions/function-defs.d.ts} +1 -1
  110. package/dist/types/src/compute-graph/functions/function-defs.d.ts.map +1 -0
  111. package/dist/types/src/compute-graph/functions/index.d.ts +4 -0
  112. package/dist/types/src/compute-graph/functions/index.d.ts.map +1 -0
  113. package/dist/types/src/compute-graph/hyperformula.test.d.ts +2 -0
  114. package/dist/types/src/compute-graph/hyperformula.test.d.ts.map +1 -0
  115. package/dist/types/src/compute-graph/index.d.ts +5 -0
  116. package/dist/types/src/compute-graph/index.d.ts.map +1 -0
  117. package/dist/types/src/compute-graph/testing/index.d.ts +3 -0
  118. package/dist/types/src/compute-graph/testing/index.d.ts.map +1 -0
  119. package/dist/types/src/compute-graph/testing/test-builder.d.ts +15 -0
  120. package/dist/types/src/compute-graph/testing/test-builder.d.ts.map +1 -0
  121. package/dist/types/src/compute-graph/testing/test-plugin.d.ts +36 -0
  122. package/dist/types/src/compute-graph/testing/test-plugin.d.ts.map +1 -0
  123. package/dist/types/src/compute-graph/util.d.ts +2 -0
  124. package/dist/types/src/compute-graph/util.d.ts.map +1 -0
  125. package/dist/types/src/defs/index.d.ts +4 -0
  126. package/dist/types/src/defs/index.d.ts.map +1 -0
  127. package/dist/types/src/defs/sheet-range-types.d.ts +13 -0
  128. package/dist/types/src/defs/sheet-range-types.d.ts.map +1 -0
  129. package/dist/types/src/defs/types.d.ts +28 -0
  130. package/dist/types/src/defs/types.d.ts.map +1 -0
  131. package/dist/types/src/defs/types.test.d.ts.map +1 -0
  132. package/dist/types/src/defs/util.d.ts +39 -0
  133. package/dist/types/src/defs/util.d.ts.map +1 -0
  134. package/dist/types/src/extensions/compute.d.ts +6 -0
  135. package/dist/types/src/extensions/compute.d.ts.map +1 -0
  136. package/dist/types/src/extensions/compute.stories.d.ts +21 -0
  137. package/dist/types/src/extensions/compute.stories.d.ts.map +1 -0
  138. package/dist/types/src/extensions/editor/extension.d.ts +39 -0
  139. package/dist/types/src/extensions/editor/extension.d.ts.map +1 -0
  140. package/dist/types/src/extensions/editor/extension.test.d.ts.map +1 -0
  141. package/dist/types/src/extensions/editor/index.d.ts +2 -0
  142. package/dist/types/src/extensions/editor/index.d.ts.map +1 -0
  143. package/dist/types/src/extensions/index.d.ts +3 -0
  144. package/dist/types/src/extensions/index.d.ts.map +1 -0
  145. package/dist/types/src/index.d.ts +1 -1
  146. package/dist/types/src/index.d.ts.map +1 -1
  147. package/dist/types/src/integrations/index.d.ts +2 -0
  148. package/dist/types/src/integrations/index.d.ts.map +1 -0
  149. package/dist/types/src/integrations/thread-ranges.d.ts +8 -0
  150. package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -0
  151. package/dist/types/src/meta.d.ts +3 -9
  152. package/dist/types/src/meta.d.ts.map +1 -1
  153. package/dist/types/src/model/index.d.ts +2 -3
  154. package/dist/types/src/model/index.d.ts.map +1 -1
  155. package/dist/types/src/model/{model.d.ts → sheet-model.d.ts} +13 -67
  156. package/dist/types/src/model/sheet-model.d.ts.map +1 -0
  157. package/dist/types/src/model/sheet-model.test.d.ts +2 -0
  158. package/dist/types/src/model/sheet-model.test.d.ts.map +1 -0
  159. package/dist/types/src/model/useSheetModel.d.ts +8 -0
  160. package/dist/types/src/model/useSheetModel.d.ts.map +1 -0
  161. package/dist/types/src/sanity.test.d.ts +2 -0
  162. package/dist/types/src/sanity.test.d.ts.map +1 -0
  163. package/dist/types/src/serializer.d.ts +4 -0
  164. package/dist/types/src/serializer.d.ts.map +1 -0
  165. package/dist/types/src/testing/index.d.ts +2 -0
  166. package/dist/types/src/testing/index.d.ts.map +1 -0
  167. package/dist/types/src/testing/testing.d.ts +8 -0
  168. package/dist/types/src/testing/testing.d.ts.map +1 -0
  169. package/dist/types/src/translations.d.ts +23 -12
  170. package/dist/types/src/translations.d.ts.map +1 -1
  171. package/dist/types/src/types.d.ts +100 -41
  172. package/dist/types/src/types.d.ts.map +1 -1
  173. package/dist/vendor/hyperformula.mjs +37145 -0
  174. package/package.json +60 -61
  175. package/src/SheetPlugin.tsx +69 -78
  176. package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +37 -0
  177. package/src/components/ComputeGraph/index.ts +1 -3
  178. package/src/components/FunctionEditor/FunctionEditor.tsx +45 -0
  179. package/src/components/FunctionEditor/index.ts +5 -0
  180. package/src/components/GridSheet/GridSheet.stories.tsx +46 -0
  181. package/src/components/GridSheet/GridSheet.tsx +296 -0
  182. package/src/components/{CellEditor/CellEditor.stories.tsx → GridSheet/SheetCellEditor.stories.tsx} +18 -15
  183. package/src/components/GridSheet/index.ts +5 -0
  184. package/src/components/GridSheet/util.ts +164 -0
  185. package/src/components/RangeList/RangeList.tsx +38 -0
  186. package/src/components/RangeList/index.ts +5 -0
  187. package/src/components/SheetContainer/SheetContainer.stories.tsx +43 -0
  188. package/src/components/SheetContainer/SheetContainer.tsx +27 -0
  189. package/src/components/SheetContainer/index.ts +7 -0
  190. package/src/components/SheetContext/SheetContext.tsx +127 -0
  191. package/src/components/SheetContext/index.ts +5 -0
  192. package/src/components/Toolbar/Toolbar.stories.tsx +9 -6
  193. package/src/components/Toolbar/Toolbar.tsx +240 -111
  194. package/src/components/index.ts +5 -3
  195. package/src/compute-graph/compute-graph-registry.ts +90 -0
  196. package/src/compute-graph/compute-graph.stories.tsx +97 -0
  197. package/src/compute-graph/compute-graph.test.ts +87 -0
  198. package/src/compute-graph/compute-graph.ts +245 -0
  199. package/src/compute-graph/compute-node.ts +62 -0
  200. package/src/{components/ComputeGraph → compute-graph/functions}/async-function.ts +25 -15
  201. package/src/{components/ComputeGraph → compute-graph/functions}/edge-function.ts +16 -14
  202. package/src/compute-graph/functions/index.ts +7 -0
  203. package/src/compute-graph/hyperformula.test.ts +14 -0
  204. package/src/compute-graph/index.ts +8 -0
  205. package/src/compute-graph/testing/index.ts +6 -0
  206. package/src/compute-graph/testing/test-builder.ts +54 -0
  207. package/src/{components/ComputeGraph/custom.ts → compute-graph/testing/test-plugin.ts} +44 -14
  208. package/src/compute-graph/util.ts +8 -0
  209. package/src/defs/index.ts +7 -0
  210. package/src/defs/sheet-range-types.ts +47 -0
  211. package/src/{model → defs}/types.test.ts +8 -9
  212. package/src/defs/types.ts +86 -0
  213. package/src/defs/util.ts +135 -0
  214. package/src/extensions/compute.stories.tsx +155 -0
  215. package/src/extensions/compute.ts +147 -0
  216. package/src/{components/CellEditor → extensions/editor}/extension.test.ts +4 -6
  217. package/src/{components/CellEditor → extensions/editor}/extension.ts +51 -27
  218. package/src/{components/CellEditor → extensions/editor}/index.ts +0 -1
  219. package/src/extensions/index.ts +6 -0
  220. package/src/index.ts +2 -2
  221. package/src/integrations/index.ts +5 -0
  222. package/src/integrations/thread-ranges.ts +101 -0
  223. package/src/meta.ts +14 -0
  224. package/src/model/index.ts +2 -3
  225. package/src/model/sheet-model.test.ts +57 -0
  226. package/src/model/sheet-model.ts +423 -0
  227. package/src/model/useSheetModel.ts +40 -0
  228. package/src/sanity.test.ts +40 -0
  229. package/src/serializer.ts +27 -0
  230. package/src/{components/Sheet → testing}/index.ts +1 -1
  231. package/src/testing/testing.tsx +68 -0
  232. package/src/translations.ts +12 -1
  233. package/src/types.ts +41 -46
  234. package/dist/lib/browser/SheetContainer-U4H5D34A.mjs +0 -1772
  235. package/dist/lib/browser/SheetContainer-U4H5D34A.mjs.map +0 -7
  236. package/dist/lib/browser/chunk-APHOLYUB.mjs +0 -175
  237. package/dist/lib/browser/chunk-APHOLYUB.mjs.map +0 -7
  238. package/dist/lib/browser/chunk-D5AGLXJP.mjs.map +0 -7
  239. package/dist/lib/browser/chunk-FUAGSXA4.mjs +0 -82
  240. package/dist/lib/browser/chunk-FUAGSXA4.mjs.map +0 -7
  241. package/dist/lib/browser/chunk-JRL5LGCE.mjs +0 -18
  242. package/dist/lib/browser/chunk-JRL5LGCE.mjs.map +0 -7
  243. package/dist/lib/browser/chunk-NU4PBN33.mjs +0 -8
  244. package/dist/lib/browser/chunk-NU4PBN33.mjs.map +0 -7
  245. package/dist/lib/browser/testing.mjs +0 -92
  246. package/dist/lib/browser/testing.mjs.map +0 -7
  247. package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs +0 -1765
  248. package/dist/lib/node/SheetContainer-AXQV3ZT5.cjs.map +0 -7
  249. package/dist/lib/node/chunk-5KKJ4NPP.cjs.map +0 -7
  250. package/dist/lib/node/chunk-BJ6ZD7MN.cjs +0 -51
  251. package/dist/lib/node/chunk-BJ6ZD7MN.cjs.map +0 -7
  252. package/dist/lib/node/chunk-CN3RPESU.cjs +0 -202
  253. package/dist/lib/node/chunk-CN3RPESU.cjs.map +0 -7
  254. package/dist/lib/node/chunk-DSYKOI4E.cjs.map +0 -7
  255. package/dist/lib/node/chunk-PYXHNAAK.cjs +0 -40
  256. package/dist/lib/node/chunk-PYXHNAAK.cjs.map +0 -7
  257. package/dist/lib/node/testing.cjs +0 -111
  258. package/dist/lib/node/testing.cjs.map +0 -7
  259. package/dist/types/src/components/CellEditor/CellEditor.d.ts +0 -14
  260. package/dist/types/src/components/CellEditor/CellEditor.d.ts.map +0 -1
  261. package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts.map +0 -1
  262. package/dist/types/src/components/CellEditor/extension.d.ts +0 -19
  263. package/dist/types/src/components/CellEditor/extension.d.ts.map +0 -1
  264. package/dist/types/src/components/CellEditor/extension.test.d.ts.map +0 -1
  265. package/dist/types/src/components/CellEditor/index.d.ts +0 -3
  266. package/dist/types/src/components/CellEditor/index.d.ts.map +0 -1
  267. package/dist/types/src/components/ComputeGraph/async-function.d.ts.map +0 -1
  268. package/dist/types/src/components/ComputeGraph/custom.d.ts +0 -21
  269. package/dist/types/src/components/ComputeGraph/custom.d.ts.map +0 -1
  270. package/dist/types/src/components/ComputeGraph/edge-function.d.ts +0 -20
  271. package/dist/types/src/components/ComputeGraph/edge-function.d.ts.map +0 -1
  272. package/dist/types/src/components/ComputeGraph/graph-context.d.ts +0 -12
  273. package/dist/types/src/components/ComputeGraph/graph-context.d.ts.map +0 -1
  274. package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts +0 -2
  275. package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts.map +0 -1
  276. package/dist/types/src/components/ComputeGraph/graph.d.ts +0 -26
  277. package/dist/types/src/components/ComputeGraph/graph.d.ts.map +0 -1
  278. package/dist/types/src/components/Sheet/Sheet.d.ts +0 -55
  279. package/dist/types/src/components/Sheet/Sheet.d.ts.map +0 -1
  280. package/dist/types/src/components/Sheet/Sheet.stories.d.ts +0 -54
  281. package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +0 -1
  282. package/dist/types/src/components/Sheet/formatting.d.ts +0 -14
  283. package/dist/types/src/components/Sheet/formatting.d.ts.map +0 -1
  284. package/dist/types/src/components/Sheet/grid.d.ts +0 -52
  285. package/dist/types/src/components/Sheet/grid.d.ts.map +0 -1
  286. package/dist/types/src/components/Sheet/index.d.ts +0 -2
  287. package/dist/types/src/components/Sheet/index.d.ts.map +0 -1
  288. package/dist/types/src/components/Sheet/nav.d.ts +0 -29
  289. package/dist/types/src/components/Sheet/nav.d.ts.map +0 -1
  290. package/dist/types/src/components/Sheet/sheet-context.d.ts +0 -25
  291. package/dist/types/src/components/Sheet/sheet-context.d.ts.map +0 -1
  292. package/dist/types/src/components/Sheet/util.d.ts +0 -18
  293. package/dist/types/src/components/Sheet/util.d.ts.map +0 -1
  294. package/dist/types/src/components/SheetContainer.d.ts +0 -9
  295. package/dist/types/src/components/SheetContainer.d.ts.map +0 -1
  296. package/dist/types/src/components/Toolbar/common.d.ts +0 -20
  297. package/dist/types/src/components/Toolbar/common.d.ts.map +0 -1
  298. package/dist/types/src/model/functions.d.ts.map +0 -1
  299. package/dist/types/src/model/model.browser.test.d.ts +0 -2
  300. package/dist/types/src/model/model.browser.test.d.ts.map +0 -1
  301. package/dist/types/src/model/model.d.ts.map +0 -1
  302. package/dist/types/src/model/types.d.ts +0 -17
  303. package/dist/types/src/model/types.d.ts.map +0 -1
  304. package/dist/types/src/model/types.test.d.ts.map +0 -1
  305. package/dist/types/src/model/util.d.ts +0 -15
  306. package/dist/types/src/model/util.d.ts.map +0 -1
  307. package/dist/types/src/testing.d.ts +0 -9
  308. package/dist/types/src/testing.d.ts.map +0 -1
  309. package/src/components/CellEditor/CellEditor.tsx +0 -113
  310. package/src/components/ComputeGraph/graph-context.tsx +0 -50
  311. package/src/components/ComputeGraph/graph.browser.test.ts +0 -50
  312. package/src/components/ComputeGraph/graph.ts +0 -62
  313. package/src/components/Sheet/Sheet.stories.tsx +0 -287
  314. package/src/components/Sheet/Sheet.tsx +0 -1160
  315. package/src/components/Sheet/formatting.ts +0 -106
  316. package/src/components/Sheet/grid.ts +0 -191
  317. package/src/components/Sheet/nav.ts +0 -157
  318. package/src/components/Sheet/sheet-context.tsx +0 -150
  319. package/src/components/Sheet/util.ts +0 -56
  320. package/src/components/SheetContainer.tsx +0 -34
  321. package/src/components/Toolbar/common.tsx +0 -72
  322. package/src/meta.tsx +0 -18
  323. package/src/model/model.browser.test.ts +0 -100
  324. package/src/model/model.ts +0 -550
  325. package/src/model/types.ts +0 -71
  326. package/src/model/util.ts +0 -36
  327. package/src/testing.ts +0 -50
  328. /package/dist/types/src/{model → defs}/types.test.d.ts +0 -0
  329. /package/dist/types/src/{components/CellEditor → extensions/editor}/extension.test.d.ts +0 -0
  330. /package/src/{model/functions.ts → compute-graph/functions/function-defs.ts} +0 -0
@@ -0,0 +1,127 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React, { type PropsWithChildren, createContext, useCallback, useContext, useState } from 'react';
6
+
7
+ import { invariant } from '@dxos/invariant';
8
+ import { fullyQualifiedId } from '@dxos/react-client/echo';
9
+ import {
10
+ Grid,
11
+ type GridContentProps,
12
+ type GridEditing,
13
+ type GridScopedProps,
14
+ useGridContext,
15
+ } from '@dxos/react-ui-grid';
16
+
17
+ import { type ComputeGraph } from '../../compute-graph';
18
+ import { type CellAddress, type CellRange, type CompleteCellRange } from '../../defs';
19
+ import { type SheetModel, useSheetModel } from '../../model';
20
+ import { type SheetType } from '../../types';
21
+
22
+ export type SheetContextValue = {
23
+ id: string;
24
+
25
+ model: SheetModel;
26
+
27
+ // Cursor state.
28
+ // TODO(burdon): Cursor and range should use indices.
29
+ cursor?: CellAddress;
30
+ setCursor: (cell: CellAddress | undefined) => void;
31
+ range?: CellRange;
32
+ setRange: (range: CellRange | undefined) => void;
33
+ cursorFallbackRange?: CompleteCellRange;
34
+
35
+ // Editing state (undefined if not editing).
36
+ editing: GridEditing;
37
+ setEditing: (editing: GridEditing) => void;
38
+
39
+ // Active refs
40
+ activeRefs: GridContentProps['activeRefs'];
41
+ setActiveRefs: (activeRefs: GridContentProps['activeRefs']) => void;
42
+
43
+ // Events.
44
+ // TODO(burdon): Generalize.
45
+ onInfo?: () => void;
46
+ };
47
+
48
+ const SheetContext = createContext<SheetContextValue | undefined>(undefined);
49
+
50
+ export const useSheetContext = (): SheetContextValue => {
51
+ const context = useContext(SheetContext);
52
+ invariant(context);
53
+ return context;
54
+ };
55
+
56
+ const SheetProviderImpl = ({
57
+ model,
58
+ onInfo,
59
+ children,
60
+ __gridScope,
61
+ }: GridScopedProps<PropsWithChildren<Pick<SheetContextValue, 'onInfo' | 'model'>>>) => {
62
+ const { id, editing, setEditing } = useGridContext('SheetProvider', __gridScope);
63
+
64
+ const [cursor, setCursorInternal] = useState<CellAddress>();
65
+ const [range, setRangeInternal] = useState<CellRange>();
66
+ const [cursorFallbackRange, setCursorFallbackRange] = useState<CompleteCellRange>();
67
+ const [activeRefs, setActiveRefs] = useState<GridContentProps['activeRefs']>('');
68
+
69
+ const setCursor = useCallback(
70
+ (nextCursor?: CellAddress) => {
71
+ setCursorInternal(nextCursor);
72
+ setCursorFallbackRange(
73
+ range?.to ? (range as CompleteCellRange) : nextCursor ? { from: nextCursor!, to: nextCursor! } : undefined,
74
+ );
75
+ },
76
+ [range],
77
+ );
78
+ const setRange = useCallback(
79
+ (nextRange?: CellRange) => {
80
+ setRangeInternal(nextRange);
81
+ setCursorFallbackRange(
82
+ nextRange?.to ? (nextRange as CompleteCellRange) : cursor ? { from: cursor!, to: cursor! } : undefined,
83
+ );
84
+ },
85
+ [cursor],
86
+ );
87
+
88
+ return (
89
+ <SheetContext.Provider
90
+ value={{
91
+ id,
92
+ model,
93
+ editing,
94
+ setEditing,
95
+ cursor,
96
+ setCursor,
97
+ range,
98
+ setRange,
99
+ cursorFallbackRange,
100
+ activeRefs,
101
+ setActiveRefs,
102
+ // TODO(burdon): Change to event.
103
+ onInfo,
104
+ }}
105
+ >
106
+ {children}
107
+ </SheetContext.Provider>
108
+ );
109
+ };
110
+
111
+ export type SheetProviderProps = {
112
+ graph: ComputeGraph;
113
+ sheet: SheetType;
114
+ readonly?: boolean;
115
+ } & Pick<SheetContextValue, 'onInfo'>;
116
+
117
+ export const SheetProvider = ({ children, graph, sheet, readonly, onInfo }: PropsWithChildren<SheetProviderProps>) => {
118
+ const model = useSheetModel(graph, sheet, { readonly });
119
+
120
+ return !model ? null : (
121
+ <Grid.Root id={fullyQualifiedId(sheet)}>
122
+ <SheetProviderImpl model={model} onInfo={onInfo}>
123
+ {children}
124
+ </SheetProviderImpl>
125
+ </Grid.Root>
126
+ );
127
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export * from './SheetContext';
@@ -4,6 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
+ import { type Meta } from '@storybook/react';
7
8
  import React from 'react';
8
9
 
9
10
  import { textBlockWidth } from '@dxos/react-ui-theme';
@@ -12,7 +13,7 @@ import { withLayout, withTheme } from '@dxos/storybook-utils';
12
13
  import { Toolbar } from './Toolbar';
13
14
  import translations from '../../translations';
14
15
 
15
- const Story = () => {
16
+ const DefaultStory = () => {
16
17
  return (
17
18
  <Toolbar.Root classNames={textBlockWidth}>
18
19
  <Toolbar.Alignment />
@@ -20,12 +21,14 @@ const Story = () => {
20
21
  );
21
22
  };
22
23
 
23
- export default {
24
- title: 'plugin-sheet/Toolbar',
25
- component: Toolbar,
24
+ export const Default = {};
25
+
26
+ const meta: Meta<typeof Toolbar.Root> = {
27
+ title: 'plugins/plugin-sheet/Toolbar',
28
+ component: Toolbar.Root,
29
+ render: DefaultStory,
26
30
  decorators: [withTheme, withLayout({ tooltips: true })],
27
31
  parameters: { translations, layout: 'fullscreen' },
28
- render: (args: any) => <Story {...args} />,
29
32
  };
30
33
 
31
- export const Default = {};
34
+ export default meta;
@@ -2,167 +2,269 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import {
6
- type Icon,
7
- Calendar,
8
- ChatText,
9
- CurrencyDollar,
10
- Eraser,
11
- HighlighterCircle,
12
- TextAlignCenter,
13
- TextAlignLeft,
14
- TextAlignRight,
15
- } from '@phosphor-icons/react';
16
5
  import { createContext } from '@radix-ui/react-context';
17
- import React, { type PropsWithChildren } from 'react';
6
+ import React, { type PropsWithChildren, useCallback, useMemo } from 'react';
18
7
 
8
+ import { useIntentDispatcher } from '@dxos/app-framework';
19
9
  import {
20
- DensityProvider,
21
- ElevationProvider,
10
+ Icon,
22
11
  Toolbar as NaturalToolbar,
12
+ Tooltip,
13
+ type ToolbarToggleGroupItemProps as NaturalToolbarToggleGroupItemProps,
14
+ type ToolbarButtonProps as NaturalToolbarButtonProps,
15
+ type ToolbarToggleProps as NaturalToolbarToggleProps,
23
16
  type ThemedClassName,
24
17
  useTranslation,
25
18
  } from '@dxos/react-ui';
19
+ import { useAttention } from '@dxos/react-ui-attention';
20
+ import { nonNullable } from '@dxos/util';
26
21
 
27
- import { ToolbarButton, ToolbarSeparator, ToolbarToggleButton } from './common';
22
+ import {
23
+ type AlignKey,
24
+ type AlignValue,
25
+ type CommentKey,
26
+ type CommentValue,
27
+ inRange,
28
+ rangeFromIndex,
29
+ rangeToIndex,
30
+ type StyleKey,
31
+ type StyleValue,
32
+ } from '../../defs';
33
+ import { completeCellRangeToThreadCursor } from '../../integrations';
28
34
  import { SHEET_PLUGIN } from '../../meta';
29
- import { type Formatting } from '../../types';
35
+ import { type SheetType } from '../../types';
36
+ import { useSheetContext } from '../SheetContext';
30
37
 
31
38
  //
32
- // Root
39
+ // Buttons
33
40
  //
34
41
 
35
- export type ToolbarActionType = 'clear' | 'highlight' | 'left' | 'center' | 'right' | 'date' | 'currency';
42
+ const buttonStyles = 'min-bs-0 p-2';
43
+ const tooltipProps = { side: 'bottom' as const, classNames: 'z-10' };
44
+
45
+ const ToolbarSeparator = () => <div role='separator' className='grow' />;
46
+
47
+ //
48
+ // ToolbarItem
49
+ //
36
50
 
37
- export type ToolbarAction = {
38
- type: ToolbarActionType;
51
+ type ToolbarItemProps =
52
+ | (NaturalToolbarButtonProps & { itemType: 'button'; icon: string })
53
+ | (NaturalToolbarToggleGroupItemProps & { itemType: 'toggleGroupItem'; icon: string })
54
+ | (NaturalToolbarToggleProps & { itemType: 'toggle'; icon: string });
55
+
56
+ export const ToolbarItem = ({ itemType, icon, children, ...props }: ToolbarItemProps) => {
57
+ const Invoker =
58
+ itemType === 'toggleGroupItem'
59
+ ? NaturalToolbar.ToggleGroupItem
60
+ : itemType === 'toggle'
61
+ ? NaturalToolbar.Toggle
62
+ : NaturalToolbar.Button;
63
+ return (
64
+ <Tooltip.Root>
65
+ <Tooltip.Trigger asChild>
66
+ {/* TODO(thure): type the props spread better. */}
67
+ <Invoker variant='ghost' {...(props as any)} classNames={buttonStyles}>
68
+ <Icon icon={icon} size={5} />
69
+ <span className='sr-only'>{children}</span>
70
+ </Invoker>
71
+ </Tooltip.Trigger>
72
+ <Tooltip.Portal>
73
+ <Tooltip.Content {...tooltipProps}>
74
+ {children}
75
+ <Tooltip.Arrow />
76
+ </Tooltip.Content>
77
+ </Tooltip.Portal>
78
+ </Tooltip.Root>
79
+ );
39
80
  };
40
81
 
41
- export type ToolbarActionHandler = ({ type }: ToolbarAction) => void;
82
+ //
83
+ // Root
84
+ //
85
+
86
+ type AlignAction = { key: AlignKey; value: AlignValue };
87
+ type CommentAction = { key: CommentKey; value: CommentValue; cellContent?: string };
88
+ type StyleAction = { key: StyleKey; value: StyleValue };
89
+
90
+ export type ToolbarAction = StyleAction | AlignAction | CommentAction;
91
+
92
+ export type ToolbarActionType = ToolbarAction['key'];
93
+
94
+ export type ToolbarActionHandler = (action: ToolbarAction) => void;
42
95
 
43
96
  export type ToolbarProps = ThemedClassName<
44
97
  PropsWithChildren<{
45
- onAction?: ToolbarActionHandler;
98
+ role?: string;
46
99
  }>
47
100
  >;
48
101
 
49
- const [ToolbarContextProvider, useToolbarContext] = createContext<ToolbarProps>('Toolbar');
102
+ const [ToolbarContextProvider, useToolbarContext] = createContext<{ onAction: (action: ToolbarAction) => void }>(
103
+ 'Toolbar',
104
+ );
105
+
106
+ // TODO(Zan): Factor out, copied this from MarkdownPlugin.
107
+ const sectionToolbarLayout =
108
+ 'bs-[--rail-action] bg-[--sticky-bg] sticky block-start-0 __-block-start-px transition-opacity';
109
+
110
+ type Range = SheetType['ranges'][number];
111
+
112
+ const ToolbarRoot = ({ children, role, classNames }: ToolbarProps) => {
113
+ const { id, model, cursorFallbackRange, cursor } = useSheetContext();
114
+ const { hasAttention } = useAttention(id);
115
+ const dispatch = useIntentDispatcher();
116
+
117
+ // TODO(Zan): Externalize the toolbar action handler. E.g., Toolbar/keys should both fire events.
118
+ const handleAction = useCallback(
119
+ (action: ToolbarAction) => {
120
+ switch (action.key) {
121
+ case 'align':
122
+ if (cursor && cursorFallbackRange) {
123
+ const index = model.sheet.ranges?.findIndex(
124
+ (range) => range.key === action.key && inRange(rangeFromIndex(model.sheet, range.range), cursor),
125
+ );
126
+ const nextRangeEntity = {
127
+ range: rangeToIndex(model.sheet, cursorFallbackRange),
128
+ key: action.key,
129
+ value: action.value,
130
+ };
131
+ if (index < 0) {
132
+ model.sheet.ranges?.push(nextRangeEntity);
133
+ } else {
134
+ model.sheet.ranges?.splice(index, 1, nextRangeEntity);
135
+ }
136
+ }
137
+ break;
138
+ case 'style':
139
+ if (action.value === 'unset') {
140
+ const index = model.sheet.ranges?.findIndex((range) => range.key === action.key);
141
+ if (index >= 0) {
142
+ model.sheet.ranges?.splice(index, 1);
143
+ }
144
+ } else if (cursorFallbackRange) {
145
+ model.sheet.ranges?.push({
146
+ range: rangeToIndex(model.sheet, cursorFallbackRange),
147
+ key: action.key,
148
+ value: action.value,
149
+ });
150
+ }
151
+ break;
152
+ case 'comment': {
153
+ // TODO(Zan): We shouldn't hardcode the action ID.
154
+ if (cursorFallbackRange) {
155
+ void dispatch({
156
+ action: 'dxos.org/plugin/thread/action/create',
157
+ data: {
158
+ cursor: completeCellRangeToThreadCursor(cursorFallbackRange),
159
+ name: action.cellContent,
160
+ subject: model.sheet,
161
+ },
162
+ });
163
+ }
164
+ }
165
+ }
166
+ },
167
+ [model.sheet, cursorFallbackRange, cursor, dispatch],
168
+ );
50
169
 
51
- const ToolbarRoot = ({ children, onAction, classNames }: ToolbarProps) => {
52
170
  return (
53
- <ToolbarContextProvider onAction={onAction}>
54
- <DensityProvider density='fine'>
55
- <ElevationProvider elevation='chrome'>
56
- <NaturalToolbar.Root classNames={['is-full shrink-0 overflow-x-auto overflow-y-hidden p-1', classNames]}>
57
- {children}
58
- </NaturalToolbar.Root>
59
- </ElevationProvider>
60
- </DensityProvider>
171
+ <ToolbarContextProvider onAction={handleAction}>
172
+ <NaturalToolbar.Root
173
+ classNames={[
174
+ ...(role === 'section'
175
+ ? ['z-[2] group-focus-within/section:visible', !hasAttention && 'invisible', sectionToolbarLayout]
176
+ : ['attention-surface']),
177
+ classNames,
178
+ ]}
179
+ >
180
+ {children}
181
+ </NaturalToolbar.Root>
61
182
  </ToolbarContextProvider>
62
183
  );
63
184
  };
64
185
 
65
186
  // TODO(burdon): Generalize.
66
187
  // TODO(burdon): Detect and display current state.
67
- type ButtonProps = {
68
- type: ToolbarActionType;
69
- Icon: Icon;
70
- getState: (state: Formatting) => boolean;
71
- disabled?: (state: Formatting) => boolean;
188
+ type ButtonProps<T> = {
189
+ value: T;
190
+ icon: string;
191
+ disabled?: (state: Range) => boolean;
72
192
  };
73
193
 
74
194
  //
75
195
  // Alignment
76
196
  //
77
197
 
78
- const formatOptions: ButtonProps[] = [
79
- { type: 'date', Icon: Calendar, getState: (state) => false },
80
- { type: 'currency', Icon: CurrencyDollar, getState: (state) => false },
81
- ];
82
-
83
- const Format = () => {
84
- const { onAction } = useToolbarContext('Format');
85
- const { t } = useTranslation(SHEET_PLUGIN);
86
-
87
- return (
88
- <NaturalToolbar.ToggleGroup
89
- type='single'
90
- // value={cellStyles.filter(({ getState }) => state && getState(state)).map(({ type }) => type)}
91
- >
92
- {formatOptions.map(({ type, getState, Icon }) => (
93
- <ToolbarToggleButton
94
- key={type}
95
- value={type}
96
- Icon={Icon}
97
- // disabled={state?.blockType === 'codeblock'}
98
- // onClick={state ? () => onAction?.({ type, data: !getState(state) }) : undefined}
99
- onClick={() => onAction?.({ type })}
100
- >
101
- {t(`toolbar ${type} label`)}
102
- </ToolbarToggleButton>
103
- ))}
104
- </NaturalToolbar.ToggleGroup>
105
- );
106
- };
107
-
108
- const alignmentOptions: ButtonProps[] = [
109
- { type: 'left', Icon: TextAlignLeft, getState: (state) => false },
110
- { type: 'center', Icon: TextAlignCenter, getState: (state) => false },
111
- { type: 'right', Icon: TextAlignRight, getState: (state) => false },
198
+ const alignmentOptions: ButtonProps<AlignValue>[] = [
199
+ { value: 'start', icon: 'ph--text-align-left--regular' },
200
+ { value: 'center', icon: 'ph--text-align-center--regular' },
201
+ { value: 'end', icon: 'ph--text-align-right--regular' },
112
202
  ];
113
203
 
114
204
  const Alignment = () => {
205
+ const { cursor, model } = useSheetContext();
115
206
  const { onAction } = useToolbarContext('Alignment');
116
207
  const { t } = useTranslation(SHEET_PLUGIN);
117
208
 
209
+ const value = useMemo(
210
+ () =>
211
+ cursor
212
+ ? model.sheet.ranges?.find(
213
+ ({ range, key }) => key === 'alignment' && inRange(rangeFromIndex(model.sheet, range), cursor),
214
+ )?.value
215
+ : undefined,
216
+ [cursor, model.sheet.ranges],
217
+ );
218
+
118
219
  return (
119
220
  <NaturalToolbar.ToggleGroup
120
221
  type='single'
121
- // value={cellStyles.filter(({ getState }) => state && getState(state)).map(({ type }) => type)}
222
+ value={value}
223
+ onValueChange={(value: AlignValue) => onAction?.({ key: 'align', value })}
122
224
  >
123
- {alignmentOptions.map(({ type, getState, Icon }) => (
124
- <ToolbarToggleButton
125
- key={type}
126
- value={type}
127
- Icon={Icon}
128
- // disabled={state?.blockType === 'codeblock'}
129
- // onClick={state ? () => onAction?.({ type, data: !getState(state) }) : undefined}
130
- onClick={() => onAction?.({ type })}
131
- >
132
- {t(`toolbar ${type} label`)}
133
- </ToolbarToggleButton>
225
+ {alignmentOptions.map(({ value, icon }) => (
226
+ <ToolbarItem itemType='toggleGroupItem' key={value} value={value} icon={icon}>
227
+ {t(`toolbar ${value} label`)}
228
+ </ToolbarItem>
134
229
  ))}
135
230
  </NaturalToolbar.ToggleGroup>
136
231
  );
137
232
  };
138
233
 
139
- const styleOptions: ButtonProps[] = [
140
- { type: 'clear', Icon: Eraser, getState: (state) => false },
141
- { type: 'highlight', Icon: HighlighterCircle, getState: (state) => false },
142
- ];
234
+ const styleOptions: ButtonProps<StyleValue>[] = [{ value: 'highlight', icon: 'ph--highlighter--regular' }];
143
235
 
144
236
  const Styles = () => {
145
- const { onAction } = useToolbarContext('Alignment');
237
+ const { cursor, model } = useSheetContext();
238
+ const { onAction } = useToolbarContext('Styles');
146
239
  const { t } = useTranslation(SHEET_PLUGIN);
147
240
 
241
+ const activeValues = useMemo(
242
+ () =>
243
+ cursor
244
+ ? model.sheet.ranges
245
+ ?.filter(({ range, key }) => key === 'style' && inRange(rangeFromIndex(model.sheet, range), cursor))
246
+ .reduce((acc, { value }) => {
247
+ acc.add(value);
248
+ return acc;
249
+ }, new Set())
250
+ : undefined,
251
+ [cursor, model.sheet.ranges],
252
+ );
253
+
148
254
  return (
149
- <NaturalToolbar.ToggleGroup
150
- type='single'
151
- // value={cellStyles.filter(({ getState }) => state && getState(state)).map(({ type }) => type)}
152
- >
153
- {styleOptions.map(({ type, getState, Icon }) => (
154
- <ToolbarToggleButton
155
- key={type}
156
- value={type}
157
- Icon={Icon}
158
- // disabled={state?.blockType === 'codeblock'}
159
- // onClick={state ? () => onAction?.({ type, data: !getState(state) }) : undefined}
160
- onClick={() => onAction?.({ type })}
255
+ <>
256
+ {styleOptions.map(({ value, icon }) => (
257
+ <ToolbarItem
258
+ itemType='toggle'
259
+ key={value}
260
+ pressed={activeValues?.has(value)}
261
+ onPressedChange={(nextPressed: boolean) => onAction?.({ key: 'style', value: nextPressed ? value : 'unset' })}
262
+ icon={icon}
161
263
  >
162
- {t(`toolbar ${type} label`)}
163
- </ToolbarToggleButton>
264
+ {t(`toolbar ${value} label`)}
265
+ </ToolbarItem>
164
266
  ))}
165
- </NaturalToolbar.ToggleGroup>
267
+ </>
166
268
  );
167
269
  };
168
270
 
@@ -171,18 +273,46 @@ const Styles = () => {
171
273
  //
172
274
 
173
275
  const Actions = () => {
174
- // const { onAction } = useToolbarContext('Actions');
276
+ const { onAction } = useToolbarContext('Actions');
277
+ const { cursorFallbackRange, cursor, model } = useSheetContext();
175
278
  const { t } = useTranslation(SHEET_PLUGIN);
279
+
280
+ const overlapsCommentAnchor = (model.sheet.threads ?? [])
281
+ .filter(nonNullable)
282
+ .filter((thread) => thread.status !== 'resolved')
283
+ .some((thread) => {
284
+ if (!cursorFallbackRange) {
285
+ return false;
286
+ }
287
+ return rangeToIndex(model.sheet, cursorFallbackRange) === thread.anchor;
288
+ });
289
+
290
+ const tooltipLabelKey = !cursor
291
+ ? 'no cursor label'
292
+ : overlapsCommentAnchor
293
+ ? 'selection overlaps existing comment label'
294
+ : 'comment label';
295
+
176
296
  return (
177
- <ToolbarButton
297
+ <ToolbarItem
298
+ itemType='button'
178
299
  value='comment'
179
- Icon={ChatText}
300
+ icon='ph--chat-text--regular'
180
301
  data-testid='editor.toolbar.comment'
181
- // onClick={() => onAction?.({ type: 'comment' })}
182
- // disabled={!state || state.comment || !state.selection}
302
+ onClick={() => {
303
+ if (!(cursorFallbackRange && cursor)) {
304
+ return;
305
+ }
306
+ return onAction?.({
307
+ key: 'comment',
308
+ value: rangeToIndex(model.sheet, cursorFallbackRange),
309
+ cellContent: model.getCellText(cursor),
310
+ });
311
+ }}
312
+ disabled={!cursor || overlapsCommentAnchor}
183
313
  >
184
- {t('comment label')}
185
- </ToolbarButton>
314
+ {t(tooltipLabelKey)}
315
+ </ToolbarItem>
186
316
  );
187
317
  };
188
318
 
@@ -190,7 +320,6 @@ export const Toolbar = {
190
320
  Root: ToolbarRoot,
191
321
  Separator: ToolbarSeparator,
192
322
  Alignment,
193
- Format,
194
323
  Styles,
195
324
  Actions,
196
325
  };
@@ -2,9 +2,11 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import React from 'react';
5
+ import { lazy } from 'react';
6
6
 
7
7
  export * from './ComputeGraph';
8
+ export * from './GridSheet';
9
+ export * from './RangeList';
10
+ export * from './SheetContext';
8
11
 
9
- // Lazily load components for content surfaces.
10
- export const SheetContainer = React.lazy(() => import('./SheetContainer'));
12
+ export const SheetContainer = lazy(() => import('./SheetContainer'));