@dxos/plugin-sheet 0.9.1-staging.ee54ba693a → 0.11.0

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 (227) hide show
  1. package/dist/lib/SheetPlugin.mjs +32 -0
  2. package/dist/lib/SheetPlugin.mjs.map +1 -0
  3. package/dist/lib/SheetPlugin.node.mjs +11 -0
  4. package/dist/lib/SheetPlugin.node.mjs.map +1 -0
  5. package/dist/lib/SheetPlugin.workerd.mjs +11 -0
  6. package/dist/lib/SheetPlugin.workerd.mjs.map +1 -0
  7. package/dist/lib/capabilities/node.mjs +10 -0
  8. package/dist/lib/capabilities/node.mjs.map +1 -0
  9. package/dist/lib/capabilities.mjs +16 -0
  10. package/dist/lib/capabilities.mjs.map +1 -0
  11. package/dist/lib/chunk-RangeList.mjs +47 -0
  12. package/dist/lib/chunk-RangeList.mjs.map +1 -0
  13. package/dist/lib/chunk-SheetArticle.mjs +58 -0
  14. package/dist/lib/chunk-SheetArticle.mjs.map +1 -0
  15. package/dist/lib/chunk-anchor-sort.mjs +18 -0
  16. package/dist/lib/chunk-anchor-sort.mjs.map +1 -0
  17. package/dist/lib/chunk-comment-config.mjs +18 -0
  18. package/dist/lib/chunk-comment-config.mjs.map +1 -0
  19. package/dist/lib/chunk-compute-graph-registry.mjs +24 -0
  20. package/dist/lib/chunk-compute-graph-registry.mjs.map +1 -0
  21. package/dist/lib/chunk-create-object.mjs +24 -0
  22. package/dist/lib/chunk-create-object.mjs.map +1 -0
  23. package/dist/lib/chunk-create.mjs +20 -0
  24. package/dist/lib/chunk-create.mjs.map +1 -0
  25. package/dist/lib/chunk-drop-axis.mjs +18 -0
  26. package/dist/lib/chunk-drop-axis.mjs.map +1 -0
  27. package/dist/lib/chunk-extensions.mjs +246 -0
  28. package/dist/lib/chunk-extensions.mjs.map +1 -0
  29. package/dist/lib/chunk-get-values.mjs +73 -0
  30. package/dist/lib/chunk-get-values.mjs.map +1 -0
  31. package/dist/lib/chunk-insert-axis.mjs +11 -0
  32. package/dist/lib/chunk-insert-axis.mjs.map +1 -0
  33. package/dist/lib/chunk-markdown-extension.mjs +22 -0
  34. package/dist/lib/chunk-markdown-extension.mjs.map +1 -0
  35. package/dist/lib/{neutral/chunk-WTSCOM64.mjs → chunk-meta.mjs} +20 -28
  36. package/dist/lib/chunk-meta.mjs.map +1 -0
  37. package/dist/lib/chunk-operation-handler.mjs +11 -0
  38. package/dist/lib/chunk-operation-handler.mjs.map +1 -0
  39. package/dist/lib/chunk-react-surface.mjs +27 -0
  40. package/dist/lib/chunk-react-surface.mjs.map +1 -0
  41. package/dist/lib/chunk-restore-axis.mjs +11 -0
  42. package/dist/lib/chunk-restore-axis.mjs.map +1 -0
  43. package/dist/lib/chunk-scroll-to-anchor.mjs +20 -0
  44. package/dist/lib/chunk-scroll-to-anchor.mjs.map +1 -0
  45. package/dist/lib/chunk-set-values.mjs +20 -0
  46. package/dist/lib/chunk-set-values.mjs.map +1 -0
  47. package/dist/lib/{neutral/skill-definition-U3KQCFOI.mjs → chunk-skill-definition.mjs} +6 -8
  48. package/dist/lib/chunk-skill-definition.mjs.map +1 -0
  49. package/dist/lib/chunk-state.mjs +27 -0
  50. package/dist/lib/chunk-state.mjs.map +1 -0
  51. package/dist/lib/chunk-thread-ranges.mjs +59 -0
  52. package/dist/lib/chunk-thread-ranges.mjs.map +1 -0
  53. package/dist/lib/chunk-types.mjs +355 -0
  54. package/dist/lib/chunk-types.mjs.map +1 -0
  55. package/dist/lib/chunk-undo-mappings.mjs +22 -0
  56. package/dist/lib/chunk-undo-mappings.mjs.map +1 -0
  57. package/dist/lib/components.mjs +1377 -0
  58. package/dist/lib/components.mjs.map +1 -0
  59. package/dist/lib/containers.mjs +8 -0
  60. package/dist/lib/containers.mjs.map +1 -0
  61. package/dist/lib/index.mjs +4 -0
  62. package/dist/lib/meta.mjs +2 -0
  63. package/dist/lib/operations/node.mjs +7 -0
  64. package/dist/lib/operations/node.mjs.map +1 -0
  65. package/dist/lib/operations.mjs +7 -0
  66. package/dist/lib/operations.mjs.map +1 -0
  67. package/dist/lib/plugin.mjs +9 -0
  68. package/dist/lib/plugin.mjs.map +1 -0
  69. package/dist/lib/skills.mjs +42 -0
  70. package/dist/lib/skills.mjs.map +1 -0
  71. package/dist/lib/testing.mjs +59 -0
  72. package/dist/lib/testing.mjs.map +1 -0
  73. package/dist/lib/translations.mjs +50 -0
  74. package/dist/lib/translations.mjs.map +1 -0
  75. package/dist/lib/types.mjs +2 -0
  76. package/dist/types/src/capabilities/anchor-sort.d.ts +1 -1
  77. package/dist/types/src/capabilities/compute-graph-registry.d.ts +1 -1
  78. package/dist/types/src/capabilities/create-object.d.ts +1 -1
  79. package/dist/types/src/capabilities/markdown-extension.d.ts +1 -1
  80. package/dist/types/src/capabilities/node.d.ts +7 -0
  81. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  82. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  83. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  84. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/skill-definition.d.ts +1 -1
  86. package/dist/types/src/capabilities/state.d.ts +1 -1
  87. package/dist/types/src/capabilities/undo-mappings.d.ts +1 -1
  88. package/dist/types/src/components/ComputeGraph/ComputeGraphContext.d.ts +11 -0
  89. package/dist/types/src/components/ComputeGraph/ComputeGraphContext.d.ts.map +1 -0
  90. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts +1 -10
  91. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -1
  92. package/dist/types/src/components/ComputeGraph/index.d.ts +1 -0
  93. package/dist/types/src/components/ComputeGraph/index.d.ts.map +1 -1
  94. package/dist/types/src/components/Sheet/Sheet.d.ts +4 -4
  95. package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -1
  96. package/dist/types/src/components/SheetContent/SheetContent.d.ts +1 -1
  97. package/dist/types/src/components/SheetContent/SheetContent.d.ts.map +1 -1
  98. package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts +1 -1
  99. package/dist/types/src/components/SheetRoot/SheetContext.d.ts +4 -0
  100. package/dist/types/src/components/SheetRoot/SheetContext.d.ts.map +1 -0
  101. package/dist/types/src/components/SheetRoot/SheetRoot.d.ts +0 -1
  102. package/dist/types/src/components/SheetRoot/SheetRoot.d.ts.map +1 -1
  103. package/dist/types/src/components/SheetRoot/index.d.ts +1 -0
  104. package/dist/types/src/components/SheetRoot/index.d.ts.map +1 -1
  105. package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts +1 -1
  106. package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts.map +1 -1
  107. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts +1 -1
  108. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
  109. package/dist/types/src/components/index.d.ts +1 -0
  110. package/dist/types/src/components/index.d.ts.map +1 -1
  111. package/dist/types/src/containers/RangeList/RangeList.d.ts +4 -1
  112. package/dist/types/src/containers/RangeList/RangeList.d.ts.map +1 -1
  113. package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts +4 -5
  114. package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts.map +1 -1
  115. package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts +4 -1
  116. package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts.map +1 -1
  117. package/dist/types/src/extensions/editor/sheet-extension.d.ts.map +1 -1
  118. package/dist/types/src/operations/node.d.ts +3 -0
  119. package/dist/types/src/operations/node.d.ts.map +1 -0
  120. package/dist/types/src/operations/scroll-to-anchor.d.ts.map +1 -1
  121. package/dist/types/src/plugin.d.ts +1 -1
  122. package/dist/types/src/plugin.d.ts.map +1 -1
  123. package/dist/types/src/testing/testing.d.ts +8 -2
  124. package/dist/types/src/testing/testing.d.ts.map +1 -1
  125. package/dist/types/src/types/SheetOperation.d.ts +1 -1
  126. package/dist/types/src/types/SheetOperation.d.ts.map +1 -1
  127. package/dist/types/tsconfig.tsbuildinfo +1 -1
  128. package/dx.config.ts +1 -0
  129. package/package.json +75 -67
  130. package/src/capabilities/node.ts +18 -0
  131. package/src/capabilities/{react-surface.tsx → react-surface.ts} +6 -18
  132. package/src/components/ComputeGraph/ComputeGraphContext.ts +35 -0
  133. package/src/components/ComputeGraph/ComputeGraphContextProvider.tsx +2 -27
  134. package/src/components/ComputeGraph/compute-graph.stories.tsx +1 -1
  135. package/src/components/ComputeGraph/index.ts +2 -0
  136. package/src/components/Sheet/Sheet.tsx +1 -1
  137. package/src/components/SheetRoot/SheetContext.ts +19 -0
  138. package/src/components/SheetRoot/SheetRoot.tsx +2 -9
  139. package/src/components/SheetRoot/index.ts +2 -0
  140. package/src/components/SheetStatusbar/SheetStatusbar.tsx +1 -1
  141. package/src/components/SheetToolbar/SheetToolbar.tsx +9 -9
  142. package/src/components/index.ts +1 -0
  143. package/src/containers/RangeList/RangeList.tsx +2 -0
  144. package/src/containers/SheetArticle/SheetArticle.stories.tsx +15 -24
  145. package/src/containers/SheetArticle/SheetArticle.tsx +23 -11
  146. package/src/extensions/editor/sheet-extension.ts +61 -2
  147. package/src/integrations/thread-ranges.ts +4 -4
  148. package/src/operations/node.ts +18 -0
  149. package/src/operations/scroll-to-anchor.ts +3 -2
  150. package/src/plugin.ts +1 -1
  151. package/src/testing/testing.tsx +11 -5
  152. package/src/types/SheetOperation.ts +6 -2
  153. package/dist/lib/neutral/RangeList-EIJTFS7P.mjs +0 -53
  154. package/dist/lib/neutral/RangeList-EIJTFS7P.mjs.map +0 -7
  155. package/dist/lib/neutral/SheetArticle-IUPQYGUU.mjs +0 -34
  156. package/dist/lib/neutral/SheetArticle-IUPQYGUU.mjs.map +0 -7
  157. package/dist/lib/neutral/SheetPlugin.mjs +0 -61
  158. package/dist/lib/neutral/SheetPlugin.mjs.map +0 -7
  159. package/dist/lib/neutral/SheetPlugin.node.mjs +0 -27
  160. package/dist/lib/neutral/SheetPlugin.node.mjs.map +0 -7
  161. package/dist/lib/neutral/SheetPlugin.workerd.mjs +0 -21
  162. package/dist/lib/neutral/SheetPlugin.workerd.mjs.map +0 -7
  163. package/dist/lib/neutral/anchor-sort-2POWTKTD.mjs +0 -22
  164. package/dist/lib/neutral/anchor-sort-2POWTKTD.mjs.map +0 -7
  165. package/dist/lib/neutral/capabilities/index.mjs +0 -27
  166. package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
  167. package/dist/lib/neutral/chunk-ERHMBRSU.mjs +0 -234
  168. package/dist/lib/neutral/chunk-ERHMBRSU.mjs.map +0 -7
  169. package/dist/lib/neutral/chunk-HEN74ZWI.mjs +0 -83
  170. package/dist/lib/neutral/chunk-HEN74ZWI.mjs.map +0 -7
  171. package/dist/lib/neutral/chunk-HY4DM35G.mjs +0 -466
  172. package/dist/lib/neutral/chunk-HY4DM35G.mjs.map +0 -7
  173. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
  174. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
  175. package/dist/lib/neutral/chunk-TDGEOMRG.mjs +0 -8
  176. package/dist/lib/neutral/chunk-TDGEOMRG.mjs.map +0 -7
  177. package/dist/lib/neutral/chunk-WTSCOM64.mjs.map +0 -7
  178. package/dist/lib/neutral/comment-config-4CIQFYM2.mjs +0 -22
  179. package/dist/lib/neutral/comment-config-4CIQFYM2.mjs.map +0 -7
  180. package/dist/lib/neutral/components/index.mjs +0 -1552
  181. package/dist/lib/neutral/components/index.mjs.map +0 -7
  182. package/dist/lib/neutral/compute-graph-registry-YYINTFC2.mjs +0 -26
  183. package/dist/lib/neutral/compute-graph-registry-YYINTFC2.mjs.map +0 -7
  184. package/dist/lib/neutral/containers/index.mjs +0 -11
  185. package/dist/lib/neutral/containers/index.mjs.map +0 -7
  186. package/dist/lib/neutral/create-I3TKMPQO.mjs +0 -30
  187. package/dist/lib/neutral/create-I3TKMPQO.mjs.map +0 -7
  188. package/dist/lib/neutral/create-object-5WEY5XZJ.mjs +0 -27
  189. package/dist/lib/neutral/create-object-5WEY5XZJ.mjs.map +0 -7
  190. package/dist/lib/neutral/drop-axis-JPFU5CJO.mjs +0 -23
  191. package/dist/lib/neutral/drop-axis-JPFU5CJO.mjs.map +0 -7
  192. package/dist/lib/neutral/get-values-7YWQTH65.mjs +0 -92
  193. package/dist/lib/neutral/get-values-7YWQTH65.mjs.map +0 -7
  194. package/dist/lib/neutral/index.mjs +0 -66
  195. package/dist/lib/neutral/index.mjs.map +0 -7
  196. package/dist/lib/neutral/insert-axis-WD6ZC3UA.mjs +0 -16
  197. package/dist/lib/neutral/insert-axis-WD6ZC3UA.mjs.map +0 -7
  198. package/dist/lib/neutral/markdown-extension-HTJDICGT.mjs +0 -28
  199. package/dist/lib/neutral/markdown-extension-HTJDICGT.mjs.map +0 -7
  200. package/dist/lib/neutral/meta.json +0 -1
  201. package/dist/lib/neutral/meta.mjs +0 -8
  202. package/dist/lib/neutral/meta.mjs.map +0 -7
  203. package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs +0 -13
  204. package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs.map +0 -7
  205. package/dist/lib/neutral/operations/index.mjs +0 -8
  206. package/dist/lib/neutral/operations/index.mjs.map +0 -7
  207. package/dist/lib/neutral/plugin.mjs +0 -16
  208. package/dist/lib/neutral/plugin.mjs.map +0 -7
  209. package/dist/lib/neutral/react-surface-TJT6F2E4.mjs +0 -40
  210. package/dist/lib/neutral/react-surface-TJT6F2E4.mjs.map +0 -7
  211. package/dist/lib/neutral/restore-axis-RLPX7P3G.mjs +0 -16
  212. package/dist/lib/neutral/restore-axis-RLPX7P3G.mjs.map +0 -7
  213. package/dist/lib/neutral/scroll-to-anchor-6FJJQWZC.mjs +0 -33
  214. package/dist/lib/neutral/scroll-to-anchor-6FJJQWZC.mjs.map +0 -7
  215. package/dist/lib/neutral/set-values-5DVOVLJH.mjs +0 -30
  216. package/dist/lib/neutral/set-values-5DVOVLJH.mjs.map +0 -7
  217. package/dist/lib/neutral/skill-definition-U3KQCFOI.mjs.map +0 -7
  218. package/dist/lib/neutral/state-HPA27MX2.mjs +0 -29
  219. package/dist/lib/neutral/state-HPA27MX2.mjs.map +0 -7
  220. package/dist/lib/neutral/testing/index.mjs +0 -103
  221. package/dist/lib/neutral/testing/index.mjs.map +0 -7
  222. package/dist/lib/neutral/translations.mjs +0 -56
  223. package/dist/lib/neutral/translations.mjs.map +0 -7
  224. package/dist/lib/neutral/types/index.mjs +0 -58
  225. package/dist/lib/neutral/types/index.mjs.map +0 -7
  226. package/dist/lib/neutral/undo-mappings-O75AYIRG.mjs +0 -31
  227. package/dist/lib/neutral/undo-mappings-O75AYIRG.mjs.map +0 -7
@@ -0,0 +1,32 @@
1
+ import { ActivationEvent, ActivationEvents, Plugin } from "@dxos/app-framework";
2
+ import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
3
+ import { meta } from "#meta";
4
+ import { ClientEvents } from "@dxos/plugin-client";
5
+ import { MarkdownEvents } from "@dxos/plugin-markdown";
6
+ import { AnchorSort, CommentConfig, ComputeGraphRegistry, CreateObject, Markdown, OperationHandler, ReactSurface, SheetState, SkillDefinition, UndoMappings } from "#capabilities";
7
+ import { translations } from "#translations";
8
+ import { Sheet } from "#types";
9
+ //#endregion
10
+ //#region src/SheetPlugin.tsx
11
+ var SheetPlugin = Plugin.define(meta).pipe(AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }), AppPlugin.addCommentConfigModule({ activate: CommentConfig }), AppPlugin.addCreateObjectModule({ activate: CreateObject }), AppPlugin.addOperationHandlerModule({ activate: OperationHandler }), AppPlugin.addUndoMappingsModule({ activate: UndoMappings }), AppPlugin.addSchemaModule({ schema: [Sheet.Sheet] }), AppPlugin.addSurfaceModule({ activate: ReactSurface }), AppPlugin.addTranslationsModule({ translations }), Plugin.addModule({
12
+ activatesOn: AppActivationEvents.SetupSettings,
13
+ activate: SheetState
14
+ }), Plugin.addModule({
15
+ activatesOn: ActivationEvent.allOf(ClientEvents.ClientReady, ActivationEvents.ProcessManagerReady),
16
+ activate: ComputeGraphRegistry
17
+ }), Plugin.addModule({
18
+ activatesOn: MarkdownEvents.SetupExtensions,
19
+ activate: Markdown
20
+ }), Plugin.addModule({
21
+ activatesOn: AppActivationEvents.AppGraphReady,
22
+ activate: AnchorSort
23
+ }), AppPlugin.addPluginAssetModule({ asset: {
24
+ pluginId: meta.profile.key,
25
+ path: "PLUGIN.mdl",
26
+ content: "---\nid: org.dxos.plugin.sheet\nname: SheetPlugin\nversion: 0.1.0\n---\n\nSpreadsheet plugin for `DXOS` Composer — a full-featured grid backed by ECHO for local-first, real-time collaborative data entry, formula evaluation, and structured data display.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype CellValue\n fields:\n value: any # scalar: string | number | boolean | formula string\n```\n\n```mdl\ntype RowColumnMeta\n fields:\n size?: number # pixel width/height; absent means default\n```\n\n```mdl\ntype Range\n fields:\n range: string # A1-notation range (e.g. \"A1:C3\")\n key: string # formatting key: alignment | comment | style\n value: string # formatting value (e.g. \"center\", \"highlight\")\n```\n\n```mdl\ntype Axis\n literals: row | col\n```\n\n```mdl\ntype Sheet\n typename: org.dxos.type.sheet\n fields:\n name?: string\n cells: Map<string, CellValue> # sparse map keyed by internal cell index\n rows: string[] # ordered row indices\n columns: string[] # ordered column indices\n rowMeta: Map<string, RowColumnMeta>\n columnMeta: Map<string, RowColumnMeta>\n ranges: Range[] # range-based formatting annotations\n```\n\n## Components\n\n```mdl\ncomponent SheetArticle\n desc: Primary spreadsheet view rendered inside an article or section role surface.\n props:\n subject: Sheet\n attendableId: string\n space: Space\n registry: ComputeGraphRegistry\n state:\n selected?: CellAddress\n activeRefs?: GridContentProps['activeRefs']\n slots:\n toolbar?: ReactNode\n actions:\n selectCell(address: CellAddress)\n editCell(address: CellAddress, value: any)\n insertRow(index: number)\n insertColumn(index: number)\n dropRow(axisIndex: string)\n dropColumn(axisIndex: string)\n layout: |\n ┌───────────────────────────────────┐\n │ [toolbar slot] │\n ├───┬───┬───┬───┬───────────────────┤\n │ │ A │ B │ C │ … column header │\n ├───┼───┼───┼───┤ │\n │ 1 │ │ │ │ cell grid │\n ├───┼───┼───┼───┤ │\n │ 2 │ │ │ │ │\n │ … │ │ │ │ │\n └───┴───┴───┴───┴───────────────────┘\n```\n\n```mdl\ncomponent RangeList\n desc: Object-properties panel listing named ranges and formatting annotations on a Sheet.\n props:\n sheet: Sheet\n state:\n selected?: Range\n actions:\n addRange(range: Range)\n removeRange(range: Range)\n updateRange(range: Range)\n```\n\n## Operations\n\n```mdl\nop insertAxis\n desc: Inserts one or more rows or columns at the given index in the sheet model.\n input:\n model: SheetModel\n axis: Axis\n index: number\n count?: number # defaults to 1\n output: void\n effects: [echo:write]\n```\n\n```mdl\nop dropAxis\n desc: Removes a row or column by axis index, returning data needed to restore it (undo).\n input:\n model: SheetModel\n axis: Axis\n axisIndex: string\n output: DropAxisOutput # axis, axisIndex, index, axisMeta, values\n effects: [echo:write]\n```\n\n```mdl\nop restoreAxis\n desc: Restores a previously dropped row or column (undo of dropAxis).\n input:\n model: SheetModel\n axis: Axis\n axisIndex: string # original axis index to restore\n index: number # original position\n axisMeta: RowColumnMeta\n values: any[] # cell values to re-insert\n output: void\n effects: [echo:write]\n```\n\n```mdl\nop scrollToAnchor\n desc: Programmatically scrolls and highlights a cell range in an active grid instance.\n input:\n subject: string # attendable ID of the target sheet\n cursor: string # A1-notation cell or range\n ref?: any # active refs for highlight overlay\n output: void\n effects: [ui:scroll]\n```\n\n## Features\n\n```mdl\nfeat F-1: Sheet Object\n\n req F-1.1: A Sheet is an ECHO object with typename org.dxos.type.sheet persisted in the user's space.\n req F-1.2: Cells are stored in a sparse map keyed by internal row/column indices.\n req F-1.3: Row and column order is maintained via ordered index arrays; insertion/deletion preserves existing cell references.\n req F-1.4: Range-based formatting annotations are stored as a flat array on the Sheet object.\n```\n\n```mdl\nfeat F-2: Formula Evaluation\n\n req F-2.1: Formulas are prefixed with \"=\" and evaluated by the HyperFormula engine via the ComputeGraph.\n req F-2.2: Over 400 built-in functions are available (arithmetic, statistical, text, date/time, financial, logical).\n req F-2.3:\n when: a cell value changes\n then: all dependent formula cells are recomputed reactively\n req F-2.4: Cell references in stored formulas are translated to internal indices; A1-notation is converted on read/write.\n```\n\n```mdl\nfeat F-3: Row and Column Management\n\n req F-3.1:\n when: op:insertAxis is called\n then: a new row or column is inserted at the specified index; existing cells shift accordingly\n\n req F-3.2:\n when: op:dropAxis is called\n then: the row or column is removed and undo data returned; op:restoreAxis reverses the operation\n\n req F-3.3: Row and column sizes are persisted in rowMeta/columnMeta; absent size means default grid size.\n```\n\n```mdl\nfeat F-4: Cell Formatting\n\n req F-4.1: Ranges support alignment values: start | center | end.\n req F-4.2: Ranges support comment annotations displayed as a visual overlay on the cell.\n req F-4.3: Ranges support style values: highlight | softwrap.\n req F-4.4: RangeList in the object-properties surface allows users to view and manage range annotations.\n```\n\n```mdl\nfeat F-5: Collaborative Editing\n\n req F-5.1: All cell edits are written through ECHO and replicated to peers in real time.\n req F-5.2:\n when: a peer writes a cell value\n then: the local grid re-renders with the updated value without full reload\n\n req F-5.3: ComputeGraphRegistry manages per-space HyperFormula instances so all peers share the same formula graph.\n```\n\n```mdl\nfeat F-6: Markdown Integration\n\n req F-6.1: SheetPlugin contributes a CodeMirror extension to plugin-markdown via MarkdownCapabilities.ExtensionProvider.\n req F-6.2:\n when: the extension is active in a document that belongs to a space\n then: formula references inside Markdown fenced code blocks resolve against the space's ComputeGraph\n```\n\n```mdl\nfeat F-7: Anchor Navigation\n\n req F-7.1:\n when: op:scrollToAnchor is invoked with a sheet attendable ID and cursor\n then: the corresponding SheetArticle scrolls to the target cell and applies the active-ref highlight\n\n req F-7.2: AnchorSort contributes a sort comparator so sheet anchors appear in canonical order in navigation menus.\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create sheet and enter a value\n given: a new Sheet is created in a space\n when: user types \"42\" into cell A1\n then:\n - Sheet.cells contains an entry for the A1 index with value 42\n - grid displays \"42\" in the A1 cell\n```\n\n```mdl\ntest T-2: Formula evaluation\n given: A1 = 10, A2 = 20\n when: user enters \"=A1+A2\" in A3\n then:\n - A3 displays 30\n - changing A1 to 15 causes A3 to update to 35\n```\n\n```mdl\ntest T-3: Insert and drop row\n given: a Sheet with values in rows 1 and 2\n when: op:insertAxis runs with axis=row, index=1\n then:\n - a blank row is inserted between existing rows 1 and 2\n - existing cell references remain valid\n\n when: op:dropAxis runs on the inserted row\n then:\n - the row is removed\n - op:restoreAxis re-inserts the row with its original values\n```\n\n```mdl\ntest T-4: Range formatting\n given: a Sheet open in SheetArticle\n when: user applies \"highlight\" style to range B2:C4\n then:\n - Sheet.ranges contains an entry with range=\"B2:C4\", key=\"style\", value=\"highlight\"\n - cells in B2:C4 render with the highlight background class\n```\n\n```mdl\ntest T-5: Real-time collaboration\n given: two peers have the same Sheet open\n when: peer A sets cell D5 to \"hello\"\n then:\n - peer B's grid displays \"hello\" in D5 without reload\n```\n\n```mdl\ntest T-6: Scroll to anchor\n given: a SheetArticle is mounted with attendableId \"sheet-1\"\n when: op:scrollToAnchor runs with subject=\"sheet-1\", cursor=\"E10\"\n then:\n - the grid scrolls so that E10 is visible\n - E10 is highlighted via activeRefs\n```\n\n---\n\n## Appendix: Extension Definitions\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap\n literals?: UnionList\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap\n state?: FieldMap\n slots?: FieldMap\n actions?: ActionMap\n emits?: EventMap\n layout?: CodeBlock\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap\n output?: TypeExpr\n errors?: ErrorMap\n effects?: EffectList\n requires?: ServiceList\n note?: Prose\n```\n",
27
+ mimeType: "application/x-mdl"
28
+ } }), Plugin.make);
29
+ //#endregion
30
+ export { SheetPlugin, SheetPlugin as default };
31
+
32
+ //# sourceMappingURL=SheetPlugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SheetPlugin.mjs","names":[],"sources":["../../src/SheetPlugin.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { ActivationEvent, ActivationEvents, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { ClientEvents } from '@dxos/plugin-client';\nimport { MarkdownEvents } from '@dxos/plugin-markdown';\n\nimport {\n AnchorSort,\n CommentConfig,\n ComputeGraphRegistry,\n CreateObject,\n Markdown,\n OperationHandler,\n ReactSurface,\n SheetState,\n SkillDefinition,\n UndoMappings,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Sheet } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const SheetPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }),\n AppPlugin.addCommentConfigModule({ activate: CommentConfig }),\n AppPlugin.addCreateObjectModule({ activate: CreateObject }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addUndoMappingsModule({ activate: UndoMappings }),\n AppPlugin.addSchemaModule({ schema: [Sheet.Sheet] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n activatesOn: AppActivationEvents.SetupSettings,\n activate: SheetState,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(ClientEvents.ClientReady, ActivationEvents.ProcessManagerReady),\n activate: ComputeGraphRegistry,\n }),\n Plugin.addModule({\n activatesOn: MarkdownEvents.SetupExtensions,\n activate: Markdown,\n }),\n Plugin.addModule({\n // TODO(wittjosiah): More relevant event?\n activatesOn: AppActivationEvents.AppGraphReady,\n activate: AnchorSort,\n }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default SheetPlugin;\n"],"mappings":";;;;;;;;;;AA4BA,IAAa,cAAc,OAAO,OAAO,IAAI,CAAC,CAAC,KAC7C,UAAU,yBAAyB,EAAE,UAAU,gBAAgB,CAAC,GAChE,UAAU,uBAAuB,EAAE,UAAU,cAAc,CAAC,GAC5D,UAAU,sBAAsB,EAAE,UAAU,aAAa,CAAC,GAC1D,UAAU,0BAA0B,EAAE,UAAU,iBAAiB,CAAC,GAClE,UAAU,sBAAsB,EAAE,UAAU,aAAa,CAAC,GAC1D,UAAU,gBAAgB,EAAE,QAAQ,CAAC,MAAM,KAAK,EAAE,CAAC,GACnD,UAAU,iBAAiB,EAAE,UAAU,aAAa,CAAC,GACrD,UAAU,sBAAsB,EAAE,aAAa,CAAC,GAChD,OAAO,UAAU;CACf,aAAa,oBAAoB;CACjC,UAAU;AACZ,CAAC,GACD,OAAO,UAAU;CACf,aAAa,gBAAgB,MAAM,aAAa,aAAa,iBAAiB,mBAAmB;CACjG,UAAU;AACZ,CAAC,GACD,OAAO,UAAU;CACf,aAAa,eAAe;CAC5B,UAAU;AACZ,CAAC,GACD,OAAO,UAAU;CAEf,aAAa,oBAAoB;CACjC,UAAU;AACZ,CAAC,GACD,UAAU,qBAAqB,EAC7B,OAAO;CAAE,UAAU,KAAK,QAAQ;CAAK,MAAM;CAAc,SAAS;CAAY,UAAU;AAAoB,EAC9G,CAAC,GACD,OAAO,IACT"}
@@ -0,0 +1,11 @@
1
+ import { Plugin } from "@dxos/app-framework";
2
+ import { AppPlugin } from "@dxos/app-toolkit";
3
+ import { meta } from "#meta";
4
+ import { CommentConfig, CreateObject, OperationHandler, UndoMappings } from "#capabilities";
5
+ import { Sheet } from "#types";
6
+ //#region src/SheetPlugin.node.ts
7
+ var SheetPlugin = Plugin.define(meta).pipe(AppPlugin.addCommentConfigModule({ activate: CommentConfig }), AppPlugin.addCreateObjectModule({ activate: CreateObject }), AppPlugin.addOperationHandlerModule({ activate: OperationHandler }), AppPlugin.addUndoMappingsModule({ activate: UndoMappings }), AppPlugin.addSchemaModule({ schema: [Sheet.Sheet] }), Plugin.make);
8
+ //#endregion
9
+ export { SheetPlugin, SheetPlugin as default };
10
+
11
+ //# sourceMappingURL=SheetPlugin.node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SheetPlugin.node.mjs","names":[],"sources":["../../src/SheetPlugin.node.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { CommentConfig, CreateObject, OperationHandler, UndoMappings } from '#capabilities';\nimport { meta } from '#meta';\nimport { Sheet } from '#types';\n\nexport const SheetPlugin = Plugin.define(meta).pipe(\n AppPlugin.addCommentConfigModule({ activate: CommentConfig }),\n AppPlugin.addCreateObjectModule({ activate: CreateObject }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addUndoMappingsModule({ activate: UndoMappings }),\n AppPlugin.addSchemaModule({ schema: [Sheet.Sheet] }),\n Plugin.make,\n);\n\nexport default SheetPlugin;\n"],"mappings":";;;;;;AAWA,IAAa,cAAc,OAAO,OAAO,IAAI,CAAC,CAAC,KAC7C,UAAU,uBAAuB,EAAE,UAAU,cAAc,CAAC,GAC5D,UAAU,sBAAsB,EAAE,UAAU,aAAa,CAAC,GAC1D,UAAU,0BAA0B,EAAE,UAAU,iBAAiB,CAAC,GAClE,UAAU,sBAAsB,EAAE,UAAU,aAAa,CAAC,GAC1D,UAAU,gBAAgB,EAAE,QAAQ,CAAC,MAAM,KAAK,EAAE,CAAC,GACnD,OAAO,IACT"}
@@ -0,0 +1,11 @@
1
+ import { Plugin } from "@dxos/app-framework";
2
+ import { AppPlugin } from "@dxos/app-toolkit";
3
+ import { meta } from "#meta";
4
+ import { OperationHandler } from "#capabilities";
5
+ import { Sheet } from "#types";
6
+ //#region src/SheetPlugin.workerd.ts
7
+ var SheetPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationHandlerModule({ activate: OperationHandler }), AppPlugin.addSchemaModule({ schema: [Sheet.Sheet] }), Plugin.make);
8
+ //#endregion
9
+ export { SheetPlugin, SheetPlugin as default };
10
+
11
+ //# sourceMappingURL=SheetPlugin.workerd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SheetPlugin.workerd.mjs","names":[],"sources":["../../src/SheetPlugin.workerd.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { OperationHandler } from '#capabilities';\nimport { meta } from '#meta';\nimport { Sheet } from '#types';\n\nexport const SheetPlugin = Plugin.define(meta).pipe(\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSchemaModule({ schema: [Sheet.Sheet] }),\n Plugin.make,\n);\n\nexport default SheetPlugin;\n"],"mappings":";;;;;;AAWA,IAAa,cAAc,OAAO,OAAO,IAAI,CAAC,CAAC,KAC7C,UAAU,0BAA0B,EAAE,UAAU,iBAAiB,CAAC,GAClE,UAAU,gBAAgB,EAAE,QAAQ,CAAC,MAAM,KAAK,EAAE,CAAC,GACnD,OAAO,IACT"}
@@ -0,0 +1,10 @@
1
+ import { Capability } from "@dxos/app-framework";
2
+ //#region src/capabilities/node.ts
3
+ var CommentConfig = Capability.lazy("CommentConfig", () => import("../chunk-comment-config.mjs"));
4
+ var CreateObject = Capability.lazy("CreateObject", () => import("../chunk-create-object.mjs"));
5
+ var OperationHandler = Capability.lazy("OperationHandler", () => import("../chunk-operation-handler.mjs"));
6
+ var UndoMappings = Capability.lazy("UndoMappings", () => import("../chunk-undo-mappings.mjs"));
7
+ //#endregion
8
+ export { CommentConfig, CreateObject, OperationHandler, UndoMappings };
9
+
10
+ //# sourceMappingURL=node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.mjs","names":[],"sources":["../../../src/capabilities/node.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { OperationHandlerSet } from '@dxos/compute';\n\n// The capabilities `SheetPlugin.node` activates, and only those. `Capability.lazy` defers the\n// import at runtime but a bundler still walks it, so listing the React surfaces here would pull\n// the plugin's components into every node and bun build.\n\nexport const CommentConfig = Capability.lazy('CommentConfig', () => import('./comment-config'));\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));\n"],"mappings":";;AAWA,IAAa,gBAAgB,WAAW,KAAK,uBAAuB,OAAO,8BAAmB;AAC9F,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,6BAAkB;AAC3F,IAAa,mBAAmB,WAAW,KACzC,0BACM,OAAO,iCACf;AACA,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,6BAAkB"}
@@ -0,0 +1,16 @@
1
+ import { Capability } from "@dxos/app-framework";
2
+ //#region src/capabilities/index.ts
3
+ var AnchorSort = Capability.lazy("AnchorSort", () => import("./chunk-anchor-sort.mjs"));
4
+ var CommentConfig = Capability.lazy("CommentConfig", () => import("./chunk-comment-config.mjs"));
5
+ var ComputeGraphRegistry = Capability.lazy("ComputeGraphRegistry", () => import("./chunk-compute-graph-registry.mjs"));
6
+ var CreateObject = Capability.lazy("CreateObject", () => import("./chunk-create-object.mjs"));
7
+ var Markdown = Capability.lazy("MarkdownExtension", () => import("./chunk-markdown-extension.mjs"));
8
+ var OperationHandler = Capability.lazy("OperationHandler", () => import("./chunk-operation-handler.mjs"));
9
+ var ReactSurface = Capability.lazy("ReactSurface", () => import("./chunk-react-surface.mjs"));
10
+ var SheetState = Capability.lazy("SheetState", () => import("./chunk-state.mjs"));
11
+ var SkillDefinition = Capability.lazy("SkillDefinition", () => import("./chunk-skill-definition.mjs"));
12
+ var UndoMappings = Capability.lazy("UndoMappings", () => import("./chunk-undo-mappings.mjs"));
13
+ //#endregion
14
+ export { AnchorSort, CommentConfig, ComputeGraphRegistry, CreateObject, Markdown, OperationHandler, ReactSurface, SheetState, SkillDefinition, UndoMappings };
15
+
16
+ //# sourceMappingURL=capabilities.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const AnchorSort = Capability.lazy('AnchorSort', () => import('./anchor-sort'));\nexport const CommentConfig = Capability.lazy('CommentConfig', () => import('./comment-config'));\nexport const ComputeGraphRegistry = Capability.lazy('ComputeGraphRegistry', () => import('./compute-graph-registry'));\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const Markdown = Capability.lazy('MarkdownExtension', () => import('./markdown-extension'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const SheetState = Capability.lazy('SheetState', () => import('./state'));\nexport const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));\nexport const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));\n"],"mappings":";;AAOA,IAAa,aAAa,WAAW,KAAK,oBAAoB,OAAO,0BAAgB;AACrF,IAAa,gBAAgB,WAAW,KAAK,uBAAuB,OAAO,6BAAmB;AAC9F,IAAa,uBAAuB,WAAW,KAAK,8BAA8B,OAAO,qCAA2B;AACpH,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,WAAW,WAAW,KAAK,2BAA2B,OAAO,iCAAuB;AACjG,IAAa,mBAAmB,WAAW,KACzC,0BACM,OAAO,gCACf;AACA,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,aAAa,WAAW,KAAK,oBAAoB,OAAO,oBAAU;AAC/E,IAAa,kBAAkB,WAAW,KAAK,yBAAyB,OAAO,+BAAqB;AACpG,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB"}
@@ -0,0 +1,47 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { rangeToA1Notation } from "@dxos/compute-hyperformula";
3
+ import { meta } from "#meta";
4
+ import { Sheet, rangeFromIndex } from "#types";
5
+ import { useCallback } from "react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { Input, Message, useTranslation } from "@dxos/react-ui";
8
+ import { useObject } from "@dxos/echo-react";
9
+ import { OrderedList } from "@dxos/react-ui-list";
10
+ //#region src/containers/RangeList/RangeList.tsx
11
+ var RangeList = ({ sheet: sheetProp }) => {
12
+ const { t } = useTranslation(meta.profile.key);
13
+ const [sheet, updateSheet] = useObject(sheetProp);
14
+ const handleDeleteRange = useCallback((range) => {
15
+ const index = sheet.ranges.findIndex((sheetRange) => sheetRange === range);
16
+ updateSheet((sheet) => {
17
+ sheet.ranges.splice(index, 1);
18
+ });
19
+ }, [sheet, updateSheet]);
20
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Input.Root, { children: /* @__PURE__ */ jsx(Input.Label, { children: t("range-list.heading") }) }), sheet.ranges.length === 0 ? /* @__PURE__ */ jsx(Message.Root, { children: /* @__PURE__ */ jsx(Message.Title, { children: t("no-ranges.message") }) }) : /* @__PURE__ */ jsx(OrderedList.Root, {
21
+ items: sheet.ranges,
22
+ isItem: Schema.is(Sheet.Range),
23
+ children: ({ items: ranges }) => /* @__PURE__ */ jsx(OrderedList.Content, { children: ranges.map((range) => {
24
+ const id = range.range;
25
+ return /* @__PURE__ */ jsxs(OrderedList.Item, {
26
+ id,
27
+ item: range,
28
+ hover: true,
29
+ classNames: "flex items-center cursor-pointer",
30
+ onClick: () => void 0,
31
+ children: [/* @__PURE__ */ jsx("div", {
32
+ className: "flex grow items-center truncate px-2",
33
+ children: t("range.title", {
34
+ position: rangeToA1Notation(rangeFromIndex(sheetProp, range.range)),
35
+ key: t(`range-key.${range.key}.label`),
36
+ value: t(`range-value.${range.value}.label`)
37
+ })
38
+ }), /* @__PURE__ */ jsx(OrderedList.DeleteButton, { onClick: () => handleDeleteRange(range) })]
39
+ }, id);
40
+ }) })
41
+ })] });
42
+ };
43
+ RangeList.displayName = "RangeList";
44
+ //#endregion
45
+ export { RangeList as default };
46
+
47
+ //# sourceMappingURL=chunk-RangeList.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-RangeList.mjs","names":[],"sources":["../../src/containers/RangeList/RangeList.tsx"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport React, { useCallback } from 'react';\n\nimport { rangeToA1Notation } from '@dxos/compute-hyperformula';\nimport { useObject } from '@dxos/echo-react';\nimport { Input, Message, useTranslation } from '@dxos/react-ui';\nimport { OrderedList } from '@dxos/react-ui-list';\n\nimport { meta } from '#meta';\nimport { rangeFromIndex } from '#types';\nimport { Sheet } from '#types';\n\nexport type RangeListProps = {\n sheet: Sheet.Sheet;\n};\n\nexport const RangeList = ({ sheet: sheetProp }: RangeListProps) => {\n const { t } = useTranslation(meta.profile.key);\n const [sheet, updateSheet] = useObject(sheetProp);\n // TODO(thure): Implement similar to comments, #8121\n const handleSelectRange = (range: Sheet.Range) => {};\n const handleDeleteRange = useCallback(\n (range: Sheet.Range) => {\n const index = sheet.ranges.findIndex((sheetRange) => sheetRange === range);\n updateSheet((sheet) => {\n sheet.ranges.splice(index, 1);\n });\n },\n [sheet, updateSheet],\n );\n return (\n <>\n <Input.Root>\n <Input.Label>{t('range-list.heading')}</Input.Label>\n </Input.Root>\n {sheet.ranges.length === 0 ? (\n <Message.Root>\n <Message.Title>{t('no-ranges.message')}</Message.Title>\n </Message.Root>\n ) : (\n <OrderedList.Root<Sheet.Range> items={sheet.ranges} isItem={Schema.is(Sheet.Range)}>\n {({ items: ranges }) => (\n <OrderedList.Content>\n {ranges.map((range) => {\n // Use the range's underlying cell range string as the stable id so deletes /\n // re-renders don't shift row identity by array position. Reorder is not\n // wired (DX-8121); add `OrderedList.DragHandle` + a real id strategy when it\n // lands. We avoid `OrderedList.Title` because there's no disclosure panel\n // for it to control here.\n const id = range.range;\n return (\n <OrderedList.Item\n key={id}\n id={id}\n item={range}\n hover\n classNames='flex items-center cursor-pointer'\n onClick={() => handleSelectRange(range)}\n >\n <div className='flex grow items-center truncate px-2'>\n {t('range.title', {\n position: rangeToA1Notation(rangeFromIndex(sheetProp, range.range)),\n key: t(`range-key.${range.key}.label`),\n value: t(`range-value.${range.value}.label`),\n })}\n </div>\n <OrderedList.DeleteButton onClick={() => handleDeleteRange(range)} />\n </OrderedList.Item>\n );\n })}\n </OrderedList.Content>\n )}\n </OrderedList.Root>\n )}\n </>\n );\n};\n\nRangeList.displayName = 'RangeList';\n"],"mappings":";;;;;;;;;;AAoBA,IAAa,aAAa,EAAE,OAAO,gBAAgC;CACjE,MAAM,EAAE,MAAM,eAAe,KAAK,QAAQ,GAAG;CAC7C,MAAM,CAAC,OAAO,eAAe,UAAU,SAAS;CAGhD,MAAM,oBAAoB,aACvB,UAAuB;EACtB,MAAM,QAAQ,MAAM,OAAO,WAAW,eAAe,eAAe,KAAK;EACzE,aAAa,UAAU;GACrB,MAAM,OAAO,OAAO,OAAO,CAAC;EAC9B,CAAC;CACH,GACA,CAAC,OAAO,WAAW,CACrB;CACA,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAM,MAAP,EAAA,UACE,oBAAC,MAAM,OAAP,EAAA,UAAc,EAAE,oBAAoB,EAAe,CAAA,EACzC,CAAA,GACX,MAAM,OAAO,WAAW,IACvB,oBAAC,QAAQ,MAAT,EAAA,UACE,oBAAC,QAAQ,OAAT,EAAA,UAAgB,EAAE,mBAAmB,EAAiB,CAAA,EAC1C,CAAA,IAEd,oBAAC,YAAY,MAAb;EAA+B,OAAO,MAAM;EAAQ,QAAQ,OAAO,GAAG,MAAM,KAAK;aAC7E,EAAE,OAAO,aACT,oBAAC,YAAY,SAAb,EAAA,UACG,OAAO,KAAK,UAAU;GAMrB,MAAM,KAAK,MAAM;GACjB,OACE,qBAAC,YAAY,MAAb;IAEM;IACJ,MAAM;IACN,OAAA;IACA,YAAW;IACX,eAAe,KAAA;cANjB,CAQE,oBAAC,OAAD;KAAK,WAAU;eACZ,EAAE,eAAe;MAChB,UAAU,kBAAkB,eAAe,WAAW,MAAM,KAAK,CAAC;MAClE,KAAK,EAAE,aAAa,MAAM,IAAI,OAAO;MACrC,OAAO,EAAE,eAAe,MAAM,MAAM,OAAO;KAC7C,CAAC;IACE,CAAA,GACL,oBAAC,YAAY,cAAb,EAA0B,eAAe,kBAAkB,KAAK,EAAI,CAAA,CACpD;MAfX,EAeW;EAEtB,CAAC,EACkB,CAAA;CAEP,CAAA,CAEpB,EAAA,CAAA;AAEN;AAEA,UAAU,cAAc"}
@@ -0,0 +1,58 @@
1
+ import { SheetCapabilities } from "#types";
2
+ import "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useCapability } from "@dxos/app-framework/ui";
5
+ import { Panel } from "@dxos/react-ui";
6
+ import { ComputeGraphContextProvider, Sheet as Sheet$1, useComputeGraph } from "#components";
7
+ import { AppSurface } from "@dxos/app-toolkit/ui";
8
+ import { getSpace } from "@dxos/react-client/echo";
9
+ //#region src/containers/SheetArticle/SheetArticle.tsx
10
+ /**
11
+ * Resolves the compute-graph registry capability and the sheet's space, then scopes the article to
12
+ * that registry. A sheet outside a space has no graph to evaluate against.
13
+ */
14
+ var SheetArticle = ({ subject, ...props }) => {
15
+ const registry = useCapability(SheetCapabilities.ComputeGraphRegistry);
16
+ const space = getSpace(subject);
17
+ if (!space) return null;
18
+ return /* @__PURE__ */ jsx(ComputeGraphContextProvider, {
19
+ registry,
20
+ children: /* @__PURE__ */ jsx(SheetArticleInner, {
21
+ ...props,
22
+ subject,
23
+ space
24
+ })
25
+ });
26
+ };
27
+ var SheetArticleInner = ({ role, subject: sheet, attendableId, space, ignoreAttention }) => {
28
+ const graph = useComputeGraph(space);
29
+ if (!graph) return null;
30
+ return /* @__PURE__ */ jsx(Sheet$1.Root, {
31
+ graph,
32
+ sheet,
33
+ attendableId,
34
+ ignoreAttention,
35
+ children: /* @__PURE__ */ jsxs(Panel.Root, {
36
+ classNames: role === AppSurface.Section.role && "aspect-square",
37
+ children: [
38
+ /* @__PURE__ */ jsx(Panel.Toolbar, {
39
+ asChild: true,
40
+ children: /* @__PURE__ */ jsx(Sheet$1.Toolbar, {})
41
+ }),
42
+ /* @__PURE__ */ jsx(Panel.Content, {
43
+ asChild: true,
44
+ children: /* @__PURE__ */ jsx(Sheet$1.Content, {})
45
+ }),
46
+ /* @__PURE__ */ jsx(Panel.Statusbar, {
47
+ asChild: true,
48
+ children: /* @__PURE__ */ jsx(Sheet$1.Statusbar, {})
49
+ })
50
+ ]
51
+ })
52
+ });
53
+ };
54
+ SheetArticle.displayName = "SheetArticle";
55
+ //#endregion
56
+ export { SheetArticle as default };
57
+
58
+ //# sourceMappingURL=chunk-SheetArticle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-SheetArticle.mjs","names":[],"sources":["../../src/containers/SheetArticle/SheetArticle.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { type Space, getSpace } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\n\nimport { ComputeGraphContextProvider, Sheet, useComputeGraph } from '#components';\nimport { SheetCapabilities, type Sheet as SheetType } from '#types';\n\nexport type SheetArticleProps = AppSurface.ObjectArticleProps<\n SheetType.Sheet,\n {\n ignoreAttention?: boolean;\n }\n>;\n\n/**\n * Resolves the compute-graph registry capability and the sheet's space, then scopes the article to\n * that registry. A sheet outside a space has no graph to evaluate against.\n */\nexport const SheetArticle = ({ subject, ...props }: SheetArticleProps) => {\n const registry = useCapability(SheetCapabilities.ComputeGraphRegistry);\n const space = getSpace(subject);\n if (!space) {\n return null;\n }\n\n return (\n <ComputeGraphContextProvider registry={registry}>\n <SheetArticleInner {...props} subject={subject} space={space} />\n </ComputeGraphContextProvider>\n );\n};\n\nconst SheetArticleInner = ({\n role,\n subject: sheet,\n attendableId,\n space,\n ignoreAttention,\n}: SheetArticleProps & { space: Space }) => {\n const graph = useComputeGraph(space);\n if (!graph) {\n return null;\n }\n\n return (\n <Sheet.Root graph={graph} sheet={sheet} attendableId={attendableId!} ignoreAttention={ignoreAttention}>\n <Panel.Root classNames={role === AppSurface.Section.role && 'aspect-square'}>\n <Panel.Toolbar asChild>\n <Sheet.Toolbar />\n </Panel.Toolbar>\n <Panel.Content asChild>\n <Sheet.Content />\n </Panel.Content>\n <Panel.Statusbar asChild>\n <Sheet.Statusbar />\n </Panel.Statusbar>\n </Panel.Root>\n </Sheet.Root>\n );\n};\n\nSheetArticle.displayName = 'SheetArticle';\n"],"mappings":";;;;;;;;;;;;;AAyBA,IAAa,gBAAgB,EAAE,SAAS,GAAG,YAA+B;CACxE,MAAM,WAAW,cAAc,kBAAkB,oBAAoB;CACrE,MAAM,QAAQ,SAAS,OAAO;CAC9B,IAAI,CAAC,OACH,OAAO;CAGT,OACE,oBAAC,6BAAD;EAAuC;YACrC,oBAAC,mBAAD;GAAmB,GAAI;GAAgB;GAAgB;EAAQ,CAAA;CACpC,CAAA;AAEjC;AAEA,IAAM,qBAAqB,EACzB,MACA,SAAS,OACT,cACA,OACA,sBAC0C;CAC1C,MAAM,QAAQ,gBAAgB,KAAK;CACnC,IAAI,CAAC,OACH,OAAO;CAGT,OACE,oBAAC,QAAM,MAAP;EAAmB;EAAc;EAAqB;EAAgC;YACpF,qBAAC,MAAM,MAAP;GAAY,YAAY,SAAS,WAAW,QAAQ,QAAQ;aAA5D;IACE,oBAAC,MAAM,SAAP;KAAe,SAAA;eACb,oBAAC,QAAM,SAAP,CAAgB,CAAA;IACH,CAAA;IACf,oBAAC,MAAM,SAAP;KAAe,SAAA;eACb,oBAAC,QAAM,SAAP,CAAgB,CAAA;IACH,CAAA;IACf,oBAAC,MAAM,WAAP;KAAiB,SAAA;eACf,oBAAC,QAAM,WAAP,CAAkB,CAAA;IACH,CAAA;GACP;;CACF,CAAA;AAEhB;AAEA,aAAa,cAAc"}
@@ -0,0 +1,18 @@
1
+ import { Capability } from "@dxos/app-framework";
2
+ import { AppCapabilities } from "@dxos/app-toolkit";
3
+ import { Relation, Type } from "@dxos/echo";
4
+ import { Sheet, compareIndexPositions } from "#types";
5
+ import * as Effect from "effect/Effect";
6
+ //#region src/capabilities/anchor-sort.ts
7
+ var anchor_sort_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(AppCapabilities.AnchorSort, {
8
+ key: Type.getTypename(Sheet.Sheet),
9
+ sort: (anchorA, anchorB) => {
10
+ const sheet = Relation.getTarget(anchorA);
11
+ if (sheet !== Relation.getTarget(anchorB)) return 0;
12
+ return !anchorA.anchor || !anchorB.anchor ? 0 : compareIndexPositions(sheet, anchorA.anchor, anchorB.anchor);
13
+ }
14
+ })));
15
+ //#endregion
16
+ export { anchor_sort_default as default };
17
+
18
+ //# sourceMappingURL=chunk-anchor-sort.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-anchor-sort.mjs","names":[],"sources":["../../src/capabilities/anchor-sort.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Relation, Type } from '@dxos/echo';\n\nimport { Sheet, compareIndexPositions } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(AppCapabilities.AnchorSort, {\n key: Type.getTypename(Sheet.Sheet),\n sort: (anchorA, anchorB) => {\n const sheet = Relation.getTarget(anchorA) as Sheet.Sheet;\n if (sheet !== Relation.getTarget(anchorB)) {\n return 0;\n }\n\n return !anchorA.anchor || !anchorB.anchor ? 0 : compareIndexPositions(sheet, anchorA.anchor, anchorB.anchor);\n },\n }),\n ),\n);\n"],"mappings":";;;;;;AAYA,IAAA,sBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,YAAY,gBAAgB,YAAY;CACjD,KAAK,KAAK,YAAY,MAAM,KAAK;CACjC,OAAO,SAAS,YAAY;EAC1B,MAAM,QAAQ,SAAS,UAAU,OAAO;EACxC,IAAI,UAAU,SAAS,UAAU,OAAO,GACtC,OAAO;EAGT,OAAO,CAAC,QAAQ,UAAU,CAAC,QAAQ,SAAS,IAAI,sBAAsB,OAAO,QAAQ,QAAQ,QAAQ,MAAM;CAC7G;AACF,CAAC,CACH,CACF"}
@@ -0,0 +1,18 @@
1
+ import { Capability } from "@dxos/app-framework";
2
+ import { AppCapabilities } from "@dxos/app-toolkit";
3
+ import { Type } from "@dxos/echo";
4
+ import { Sheet, SheetOperation } from "#types";
5
+ import * as Effect from "effect/Effect";
6
+ //#region src/capabilities/comment-config.ts
7
+ var activate = Effect.fnUntraced(function* () {
8
+ const config = {
9
+ id: Type.getTypename(Sheet.Sheet),
10
+ comments: "anchored",
11
+ scrollToAnchor: SheetOperation.ScrollToAnchor
12
+ };
13
+ return Capability.contributes(AppCapabilities.CommentConfig, config);
14
+ });
15
+ //#endregion
16
+ export { activate as default };
17
+
18
+ //# sourceMappingURL=chunk-comment-config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-comment-config.mjs","names":[],"sources":["../../src/capabilities/comment-config.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Type } from '@dxos/echo';\n\nimport { SheetOperation } from '#types';\nimport { Sheet } from '#types';\n\nconst activate = Effect.fnUntraced(function* () {\n const config: AppCapabilities.CommentConfig = {\n id: Type.getTypename(Sheet.Sheet),\n comments: 'anchored',\n scrollToAnchor: SheetOperation.ScrollToAnchor,\n };\n return Capability.contributes(AppCapabilities.CommentConfig, config);\n});\n\nexport default activate;\n"],"mappings":";;;;;;AAaA,IAAM,WAAW,OAAO,WAAW,aAAa;CAC9C,MAAM,SAAwC;EAC5C,IAAI,KAAK,YAAY,MAAM,KAAK;EAChC,UAAU;EACV,gBAAgB,eAAe;CACjC;CACA,OAAO,WAAW,YAAY,gBAAgB,eAAe,MAAM;AACrE,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Capabilities, Capability } from "@dxos/app-framework";
2
+ import { Operation, ServiceResolver } from "@dxos/compute";
3
+ import { SheetCapabilities } from "#types";
4
+ import * as Effect from "effect/Effect";
5
+ //#region src/capabilities/compute-graph-registry.ts
6
+ /**
7
+ * Builds the per-space compute graph registry by adapting the shared
8
+ * {@link Capabilities.ProcessManagerRuntime} into a
9
+ * {@link FunctionsRuntimeProvider} that resolves {@link Operation.Service}
10
+ * from the space's service layer.
11
+ */
12
+ var compute_graph_registry_default = Capability.makeModule(Effect.fnUntraced(function* () {
13
+ const processManagerRuntime = yield* Capability.get(Capabilities.ProcessManagerRuntime);
14
+ const { defaultPlugins, ComputeGraphRegistry } = yield* Effect.tryPromise(() => import("@dxos/compute-hyperformula"));
15
+ const computeGraphRegistry = new ComputeGraphRegistry({
16
+ plugins: defaultPlugins,
17
+ computeRuntime: { getRuntime: (spaceId) => ({ runPromise: (effect) => processManagerRuntime.runPromise(effect.pipe(Effect.provide(ServiceResolver.provide({ space: spaceId }, Operation.Service)))) }) }
18
+ });
19
+ return Capability.contributes(SheetCapabilities.ComputeGraphRegistry, computeGraphRegistry);
20
+ }));
21
+ //#endregion
22
+ export { compute_graph_registry_default as default };
23
+
24
+ //# sourceMappingURL=chunk-compute-graph-registry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-compute-graph-registry.mjs","names":[],"sources":["../../src/capabilities/compute-graph-registry.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Operation, ServiceResolver } from '@dxos/compute';\nimport { type SpaceId } from '@dxos/keys';\n\nimport { SheetCapabilities } from '#types';\n\n/**\n * Builds the per-space compute graph registry by adapting the shared\n * {@link Capabilities.ProcessManagerRuntime} into a\n * {@link FunctionsRuntimeProvider} that resolves {@link Operation.Service}\n * from the space's service layer.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const processManagerRuntime = yield* Capability.get(Capabilities.ProcessManagerRuntime);\n\n // Async import removes direct dependency on hyperformula.\n const { defaultPlugins, ComputeGraphRegistry } = yield* Effect.tryPromise(\n () => import('@dxos/compute-hyperformula'),\n );\n\n const computeGraphRegistry = new ComputeGraphRegistry({\n plugins: defaultPlugins,\n computeRuntime: {\n getRuntime: (spaceId: SpaceId) => ({\n runPromise: <A, E>(effect: Effect.Effect<A, E, Operation.Service>) =>\n processManagerRuntime.runPromise(\n effect.pipe(Effect.provide(ServiceResolver.provide({ space: spaceId }, Operation.Service))),\n ),\n }),\n },\n });\n\n return Capability.contributes(SheetCapabilities.ComputeGraphRegistry, computeGraphRegistry);\n }),\n);\n"],"mappings":";;;;;;;;;;;AAkBA,IAAA,iCAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,wBAAwB,OAAO,WAAW,IAAI,aAAa,qBAAqB;CAGtF,MAAM,EAAE,gBAAgB,yBAAyB,OAAO,OAAO,iBACvD,OAAO,6BACf;CAEA,MAAM,uBAAuB,IAAI,qBAAqB;EACpD,SAAS;EACT,gBAAgB,EACd,aAAa,aAAsB,EACjC,aAAmB,WACjB,sBAAsB,WACpB,OAAO,KAAK,OAAO,QAAQ,gBAAgB,QAAQ,EAAE,OAAO,QAAQ,GAAG,UAAU,OAAO,CAAC,CAAC,CAC5F,EACJ,GACF;CACF,CAAC;CAED,OAAO,WAAW,YAAY,kBAAkB,sBAAsB,oBAAoB;AAC5F,CAAC,CACH"}
@@ -0,0 +1,24 @@
1
+ import { Capability } from "@dxos/app-framework";
2
+ import { Operation } from "@dxos/compute";
3
+ import { Type } from "@dxos/echo";
4
+ import { Sheet } from "#types";
5
+ import * as Effect from "effect/Effect";
6
+ import { SpaceCapabilities, SpaceOperation } from "@dxos/plugin-space";
7
+ //#region src/capabilities/create-object.ts
8
+ var create_object_default = Capability.makeModule(Effect.fnUntraced(function* () {
9
+ return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
10
+ id: Type.getTypename(Sheet.Sheet),
11
+ createObject: (props, options) => Effect.gen(function* () {
12
+ const object = Sheet.make(props);
13
+ return yield* Operation.invoke(SpaceOperation.AddObject, {
14
+ object,
15
+ target: options.target,
16
+ targetNodeId: options.targetNodeId
17
+ });
18
+ })
19
+ });
20
+ }));
21
+ //#endregion
22
+ export { create_object_default as default };
23
+
24
+ //# sourceMappingURL=chunk-create-object.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-create-object.mjs","names":[],"sources":["../../src/capabilities/create-object.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Type } from '@dxos/echo';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\n\nimport { Sheet } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {\n id: Type.getTypename(Sheet.Sheet),\n createObject: (props, options) =>\n Effect.gen(function* () {\n const object = Sheet.make(props);\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n targetNodeId: options.targetNodeId,\n });\n }),\n });\n }),\n);\n"],"mappings":";;;;;;;AAcA,IAAA,wBAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,OAAO,WAAW,YAAY,kBAAkB,mBAAmB;EACjE,IAAI,KAAK,YAAY,MAAM,KAAK;EAChC,eAAe,OAAO,YACpB,OAAO,IAAI,aAAa;GACtB,MAAM,SAAS,MAAM,KAAK,KAAK;GAC/B,OAAO,OAAO,UAAU,OAAO,eAAe,WAAW;IACvD;IACA,QAAQ,QAAQ;IAChB,cAAc,QAAQ;GACxB,CAAC;EACH,CAAC;CACL,CAAC;AACH,CAAC,CACH"}
@@ -0,0 +1,20 @@
1
+ import { p as make, t as Create } from "./chunk-types.mjs";
2
+ import { Operation } from "@dxos/compute";
3
+ import { CollectionModel } from "@dxos/app-toolkit";
4
+ import { Database, Obj } from "@dxos/echo";
5
+ import * as Effect from "effect/Effect";
6
+ //#region src/operations/create.ts
7
+ var handler = Create.pipe(Operation.withHandler(Effect.fn(function* ({ name, rows, columns }) {
8
+ const object = yield* Database.add(make({
9
+ name,
10
+ rows,
11
+ columns
12
+ }));
13
+ yield* CollectionModel.add({ object }).pipe(Effect.catchTag("EntityNotFoundError", () => Effect.void));
14
+ yield* Database.flush();
15
+ return { id: Obj.getURI(object) };
16
+ })));
17
+ //#endregion
18
+ export { handler as default };
19
+
20
+ //# sourceMappingURL=chunk-create.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-create.mjs","names":[],"sources":["../../src/operations/create.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { CollectionModel } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj } from '@dxos/echo';\n\nimport { Sheet, SheetOperation } from '../types';\n\nconst handler: Operation.WithHandler<typeof SheetOperation.Create> = SheetOperation.Create.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ name, rows, columns }) {\n const object = yield* Database.add(Sheet.make({ name, rows, columns }));\n yield* CollectionModel.add({ object }).pipe(Effect.catchTag('EntityNotFoundError', () => Effect.void));\n yield* Database.flush();\n return { id: Obj.getURI(object) };\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;AAYA,IAAM,UAAA,OAAqF,KACzF,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,MAAM,MAAM,WAAW;CAC5C,MAAM,SAAS,OAAO,SAAS,IAAI,KAAW;EAAE;EAAM;EAAM;CAAQ,CAAC,CAAC;CACtE,OAAO,gBAAgB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,SAAS,6BAA6B,OAAO,IAAI,CAAC;CACrG,OAAO,SAAS,MAAM;CACtB,OAAO,EAAE,IAAI,IAAI,OAAO,MAAM,EAAE;AAClC,CAAC,CACH,CACF"}
@@ -0,0 +1,18 @@
1
+ import { n as DropAxis } from "./chunk-types.mjs";
2
+ import { Operation } from "@dxos/compute";
3
+ import * as Effect from "effect/Effect";
4
+ //#region src/operations/drop-axis.ts
5
+ var handler = DropAxis.pipe(Operation.withHandler(({ model, axis, axisIndex }) => Effect.sync(() => {
6
+ const undoData = model[axis === "col" ? "dropColumn" : "dropRow"](axisIndex);
7
+ return {
8
+ axis: undoData.axis,
9
+ axisIndex: undoData.axisIndex,
10
+ index: undoData.index,
11
+ axisMeta: undoData.axisMeta,
12
+ values: undoData.values
13
+ };
14
+ })));
15
+ //#endregion
16
+ export { handler as default };
17
+
18
+ //# sourceMappingURL=chunk-drop-axis.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-drop-axis.mjs","names":[],"sources":["../../src/operations/drop-axis.ts"],"sourcesContent":["//\n\nimport * as Effect from 'effect/Effect';\n// Copyright 2025 DXOS.org\n//\n\nimport { Operation } from '@dxos/compute';\n\nimport { SheetOperation } from '../types';\n\nconst handler: Operation.WithHandler<typeof SheetOperation.DropAxis> = SheetOperation.DropAxis.pipe(\n Operation.withHandler(({ model, axis, axisIndex }) =>\n Effect.sync(() => {\n const undoData = model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);\n return {\n axis: undoData.axis,\n axisIndex: undoData.axisIndex,\n index: undoData.index,\n axisMeta: undoData.axisMeta,\n values: undoData.values,\n };\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;AAUA,IAAM,UAAA,SAAyF,KAC7F,UAAU,aAAa,EAAE,OAAO,MAAM,gBACpC,OAAO,WAAW;CAChB,MAAM,WAAW,MAAM,SAAS,QAAQ,eAAe,UAAU,CAAC,SAAS;CAC3E,OAAO;EACL,MAAM,SAAS;EACf,WAAW,SAAS;EACpB,OAAO,SAAS;EAChB,UAAU,SAAS;EACnB,QAAQ,SAAS;CACnB;AACF,CAAC,CACH,CACF"}