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

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 (157) hide show
  1. package/dist/lib/neutral/RangeList-EIJTFS7P.mjs +53 -0
  2. package/dist/lib/neutral/RangeList-EIJTFS7P.mjs.map +7 -0
  3. package/dist/lib/neutral/{SheetArticle-5AJRM3V3.mjs → SheetArticle-IUPQYGUU.mjs} +3 -2
  4. package/dist/lib/neutral/SheetArticle-IUPQYGUU.mjs.map +7 -0
  5. package/dist/lib/neutral/SheetPlugin.mjs +5 -7
  6. package/dist/lib/neutral/SheetPlugin.mjs.map +4 -4
  7. package/dist/lib/neutral/capabilities/index.mjs +6 -8
  8. package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
  9. package/dist/lib/neutral/{chunk-KUWATEHB.mjs → chunk-HY4DM35G.mjs} +101 -9
  10. package/dist/lib/neutral/chunk-HY4DM35G.mjs.map +7 -0
  11. package/dist/lib/neutral/chunk-TDGEOMRG.mjs +8 -0
  12. package/dist/lib/neutral/{chunk-BGR7FVNF.mjs.map → chunk-TDGEOMRG.mjs.map} +2 -2
  13. package/dist/lib/neutral/chunk-WTSCOM64.mjs +45 -0
  14. package/dist/lib/neutral/chunk-WTSCOM64.mjs.map +7 -0
  15. package/dist/lib/neutral/{comment-config-WGXXX5FG.mjs → comment-config-4CIQFYM2.mjs} +1 -1
  16. package/dist/lib/neutral/comment-config-4CIQFYM2.mjs.map +7 -0
  17. package/dist/lib/neutral/components/index.mjs +14 -14
  18. package/dist/lib/neutral/components/index.mjs.map +3 -3
  19. package/dist/lib/neutral/containers/index.mjs +2 -2
  20. package/dist/lib/neutral/create-I3TKMPQO.mjs +30 -0
  21. package/dist/lib/neutral/create-I3TKMPQO.mjs.map +7 -0
  22. package/dist/lib/neutral/{create-object-TDQQ24IB.mjs → create-object-5WEY5XZJ.mjs} +2 -6
  23. package/dist/lib/neutral/create-object-5WEY5XZJ.mjs.map +7 -0
  24. package/dist/lib/neutral/{drop-axis-WSWFOLQN.mjs → drop-axis-JPFU5CJO.mjs} +2 -2
  25. package/dist/lib/neutral/get-values-7YWQTH65.mjs +92 -0
  26. package/dist/lib/neutral/get-values-7YWQTH65.mjs.map +7 -0
  27. package/dist/lib/neutral/index.mjs +3 -9
  28. package/dist/lib/neutral/{insert-axis-6UQJTIWC.mjs → insert-axis-WD6ZC3UA.mjs} +2 -2
  29. package/dist/lib/neutral/meta.json +1 -1
  30. package/dist/lib/neutral/meta.mjs +1 -1
  31. package/dist/lib/neutral/operations/index.mjs +1 -1
  32. package/dist/lib/neutral/plugin.mjs +2 -2
  33. package/dist/lib/neutral/{react-surface-4H3PC4WG.mjs → react-surface-TJT6F2E4.mjs} +2 -6
  34. package/dist/lib/neutral/react-surface-TJT6F2E4.mjs.map +7 -0
  35. package/dist/lib/neutral/{restore-axis-AMMVTPS3.mjs → restore-axis-RLPX7P3G.mjs} +2 -2
  36. package/dist/lib/neutral/{scroll-to-anchor-FK2CXCQR.mjs → scroll-to-anchor-6FJJQWZC.mjs} +2 -2
  37. package/dist/lib/neutral/set-values-5DVOVLJH.mjs +30 -0
  38. package/dist/lib/neutral/set-values-5DVOVLJH.mjs.map +7 -0
  39. package/dist/lib/neutral/skill-definition-U3KQCFOI.mjs +12 -0
  40. package/dist/lib/neutral/skill-definition-U3KQCFOI.mjs.map +7 -0
  41. package/dist/lib/neutral/translations.mjs +1 -1
  42. package/dist/lib/neutral/translations.mjs.map +3 -3
  43. package/dist/lib/neutral/types/index.mjs +1 -1
  44. package/dist/lib/neutral/{undo-mappings-3FQLSTCZ.mjs → undo-mappings-O75AYIRG.mjs} +2 -2
  45. package/dist/lib/neutral/{undo-mappings-3FQLSTCZ.mjs.map → undo-mappings-O75AYIRG.mjs.map} +3 -3
  46. package/dist/types/dx.config.d.ts +28 -0
  47. package/dist/types/dx.config.d.ts.map +1 -0
  48. package/dist/types/src/SheetPlugin.d.ts.map +1 -1
  49. package/dist/types/src/capabilities/anchor-sort.d.ts +1 -2
  50. package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -1
  51. package/dist/types/src/capabilities/comment-config.d.ts +1 -2
  52. package/dist/types/src/capabilities/comment-config.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/compute-graph-registry.d.ts +1 -1
  54. package/dist/types/src/capabilities/create-object.d.ts +1 -7
  55. package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
  56. package/dist/types/src/capabilities/index.d.ts +9 -16
  57. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  58. package/dist/types/src/capabilities/markdown-extension.d.ts +1 -1
  59. package/dist/types/src/capabilities/react-surface.d.ts +2 -2
  60. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  61. package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
  62. package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
  63. package/dist/types/src/capabilities/state.d.ts +1 -2
  64. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  65. package/dist/types/src/capabilities/undo-mappings.d.ts +2 -2
  66. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
  67. package/dist/types/src/components/Sheet/Sheet.d.ts +1 -1
  68. package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -1
  69. package/dist/types/src/containers/RangeList/RangeList.d.ts.map +1 -1
  70. package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts +1 -1
  71. package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts.map +1 -1
  72. package/dist/types/src/index.d.ts +0 -1
  73. package/dist/types/src/index.d.ts.map +1 -1
  74. package/dist/types/src/meta.d.ts +32 -2
  75. package/dist/types/src/meta.d.ts.map +1 -1
  76. package/dist/types/src/model/sheet-model.d.ts +1 -25
  77. package/dist/types/src/model/sheet-model.d.ts.map +1 -1
  78. package/dist/types/src/operations/create.d.ts +5 -0
  79. package/dist/types/src/operations/create.d.ts.map +1 -0
  80. package/dist/types/src/operations/get-values.d.ts +5 -0
  81. package/dist/types/src/operations/get-values.d.ts.map +1 -0
  82. package/dist/types/src/operations/index.d.ts.map +1 -1
  83. package/dist/types/src/operations/set-values.d.ts +5 -0
  84. package/dist/types/src/operations/set-values.d.ts.map +1 -0
  85. package/dist/types/src/skills/index.d.ts +2 -0
  86. package/dist/types/src/skills/index.d.ts.map +1 -0
  87. package/dist/types/src/skills/sheet-skill.d.ts +4 -0
  88. package/dist/types/src/skills/sheet-skill.d.ts.map +1 -0
  89. package/dist/types/src/testing/testing.d.ts +1 -25
  90. package/dist/types/src/testing/testing.d.ts.map +1 -1
  91. package/dist/types/src/types/Sheet.d.ts +7 -28
  92. package/dist/types/src/types/Sheet.d.ts.map +1 -1
  93. package/dist/types/src/types/SheetCapabilities.d.ts.map +1 -1
  94. package/dist/types/src/types/SheetOperation.d.ts +22 -0
  95. package/dist/types/src/types/SheetOperation.d.ts.map +1 -1
  96. package/dist/types/src/types/util.d.ts.map +1 -1
  97. package/dist/types/tsconfig.tsbuildinfo +1 -1
  98. package/dx.config.ts +31 -0
  99. package/package.json +61 -54
  100. package/src/SheetPlugin.test.ts +1 -1
  101. package/src/SheetPlugin.tsx +4 -6
  102. package/src/capabilities/comment-config.ts +1 -6
  103. package/src/capabilities/create-object.ts +1 -4
  104. package/src/capabilities/index.ts +2 -9
  105. package/src/capabilities/react-surface.tsx +4 -5
  106. package/src/capabilities/skill-definition.ts +14 -0
  107. package/src/capabilities/undo-mappings.ts +1 -1
  108. package/src/components/Sheet/Sheet.tsx +1 -1
  109. package/src/components/SheetContent/SheetCellEditor.stories.tsx +2 -2
  110. package/src/components/SheetContent/SheetContent.tsx +1 -1
  111. package/src/components/SheetContent/util.ts +7 -7
  112. package/src/components/SheetToolbar/align.ts +2 -2
  113. package/src/components/SheetToolbar/style.ts +1 -1
  114. package/src/containers/RangeList/RangeList.tsx +36 -20
  115. package/src/containers/SheetArticle/SheetArticle.tsx +2 -2
  116. package/src/index.ts +0 -1
  117. package/src/meta.ts +2 -24
  118. package/src/operations/create.ts +24 -0
  119. package/src/operations/get-values.ts +83 -0
  120. package/src/operations/index.ts +3 -0
  121. package/src/operations/set-values.ts +29 -0
  122. package/src/skills/index.ts +5 -0
  123. package/src/skills/sheet-skill.ts +46 -0
  124. package/src/translations.ts +1 -1
  125. package/src/types/Sheet.ts +26 -21
  126. package/src/types/SheetCapabilities.ts +2 -2
  127. package/src/types/SheetOperation.ts +62 -1
  128. package/src/types/util.ts +8 -1
  129. package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs +0 -46
  130. package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs.map +0 -7
  131. package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs.map +0 -7
  132. package/dist/lib/neutral/app-graph-builder-2QP6GYB2.mjs +0 -67
  133. package/dist/lib/neutral/app-graph-builder-2QP6GYB2.mjs.map +0 -7
  134. package/dist/lib/neutral/chunk-BGR7FVNF.mjs +0 -8
  135. package/dist/lib/neutral/chunk-FQHTXKMF.mjs +0 -34
  136. package/dist/lib/neutral/chunk-FQHTXKMF.mjs.map +0 -7
  137. package/dist/lib/neutral/chunk-KUWATEHB.mjs.map +0 -7
  138. package/dist/lib/neutral/chunk-S2UNH6VD.mjs +0 -10
  139. package/dist/lib/neutral/chunk-S2UNH6VD.mjs.map +0 -7
  140. package/dist/lib/neutral/comment-config-WGXXX5FG.mjs.map +0 -7
  141. package/dist/lib/neutral/create-object-TDQQ24IB.mjs.map +0 -7
  142. package/dist/lib/neutral/navigation-resolver-FXEZYO7G.mjs +0 -14
  143. package/dist/lib/neutral/navigation-resolver-FXEZYO7G.mjs.map +0 -7
  144. package/dist/lib/neutral/react-surface-4H3PC4WG.mjs.map +0 -7
  145. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -6
  146. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  147. package/dist/types/src/capabilities/navigation-resolver.d.ts +0 -6
  148. package/dist/types/src/capabilities/navigation-resolver.d.ts.map +0 -1
  149. package/dist/types/src/paths.d.ts +0 -3
  150. package/dist/types/src/paths.d.ts.map +0 -1
  151. package/src/capabilities/app-graph-builder.ts +0 -63
  152. package/src/capabilities/navigation-resolver.ts +0 -16
  153. package/src/paths.ts +0 -11
  154. /package/dist/lib/neutral/{drop-axis-WSWFOLQN.mjs.map → drop-axis-JPFU5CJO.mjs.map} +0 -0
  155. /package/dist/lib/neutral/{insert-axis-6UQJTIWC.mjs.map → insert-axis-WD6ZC3UA.mjs.map} +0 -0
  156. /package/dist/lib/neutral/{restore-axis-AMMVTPS3.mjs.map → restore-axis-RLPX7P3G.mjs.map} +0 -0
  157. /package/dist/lib/neutral/{scroll-to-anchor-FK2CXCQR.mjs.map → scroll-to-anchor-6FJJQWZC.mjs.map} +0 -0
@@ -0,0 +1,53 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/containers/RangeList/RangeList.tsx
4
+ import * as Schema from "effect/Schema";
5
+ import React, { useCallback } from "react";
6
+ import { rangeToA1Notation } from "@dxos/compute-hyperformula";
7
+ import { useObject } from "@dxos/echo-react";
8
+ import { Input, Message, useTranslation } from "@dxos/react-ui";
9
+ import { OrderedList } from "@dxos/react-ui-list";
10
+ import { meta } from "#meta";
11
+ import { rangeFromIndex } from "#types";
12
+ import { Sheet } from "#types";
13
+ var RangeList = ({ sheet: sheetProp }) => {
14
+ const { t } = useTranslation(meta.profile.key);
15
+ const [sheet, updateSheet] = useObject(sheetProp);
16
+ const handleSelectRange = (range) => {
17
+ };
18
+ const handleDeleteRange = useCallback((range) => {
19
+ const index = sheet.ranges.findIndex((sheetRange) => sheetRange === range);
20
+ updateSheet((sheet2) => {
21
+ sheet2.ranges.splice(index, 1);
22
+ });
23
+ }, [
24
+ sheet,
25
+ updateSheet
26
+ ]);
27
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Label, null, t("range-list.heading"))), sheet.ranges.length === 0 ? /* @__PURE__ */ React.createElement(Message.Root, null, /* @__PURE__ */ React.createElement(Message.Title, null, t("no-ranges.message"))) : /* @__PURE__ */ React.createElement(OrderedList.Root, {
28
+ items: sheet.ranges,
29
+ isItem: Schema.is(Sheet.Range)
30
+ }, ({ items: ranges }) => /* @__PURE__ */ React.createElement(OrderedList.Content, null, ranges.map((range) => {
31
+ const id = range.range;
32
+ return /* @__PURE__ */ React.createElement(OrderedList.Item, {
33
+ key: id,
34
+ id,
35
+ item: range,
36
+ hover: true,
37
+ classNames: "flex items-center cursor-pointer",
38
+ onClick: () => handleSelectRange(range)
39
+ }, /* @__PURE__ */ React.createElement("div", {
40
+ className: "flex grow items-center truncate px-2"
41
+ }, t("range.title", {
42
+ position: rangeToA1Notation(rangeFromIndex(sheetProp, range.range)),
43
+ key: t(`range-key.${range.key}.label`),
44
+ value: t(`range-value.${range.value}.label`)
45
+ })), /* @__PURE__ */ React.createElement(OrderedList.DeleteButton, {
46
+ onClick: () => handleDeleteRange(range)
47
+ }));
48
+ }))));
49
+ };
50
+ export {
51
+ RangeList as default
52
+ };
53
+ //# sourceMappingURL=RangeList-EIJTFS7P.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/containers/RangeList/RangeList.tsx"],
4
+ "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"],
5
+ "mappings": ";;;AAIA,YAAYA,YAAY;AACxB,OAAOC,SAASC,mBAAmB;AAEnC,SAASC,yBAAyB;AAClC,SAASC,iBAAiB;AAC1B,SAASC,OAAOC,SAASC,sBAAsB;AAC/C,SAASC,mBAAmB;AAE5B,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,aAAa;AAMf,IAAMC,YAAY,CAAC,EAAEC,OAAOC,UAAS,MAAkB;AAC5D,QAAM,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AC7C,CAAA,CAAA,GAEF,sBAAA,cAACtC,YAAYuC,cAAY;MAACL,SAAS,MAAMrB,kBAAkBD,KAAAA;;EAGjE,CAAA,CAAA,CAAA,CAAA;AAOd;",
6
+ "names": ["Schema", "React", "useCallback", "rangeToA1Notation", "useObject", "Input", "Message", "useTranslation", "OrderedList", "meta", "rangeFromIndex", "Sheet", "RangeList", "sheet", "sheetProp", "t", "profile", "key", "updateSheet", "handleSelectRange", "range", "handleDeleteRange", "index", "ranges", "findIndex", "sheetRange", "splice", "Root", "Label", "length", "Title", "items", "isItem", "is", "Range", "Content", "map", "id", "Item", "item", "hover", "classNames", "onClick", "div", "className", "position", "value", "DeleteButton"]
7
+ }
@@ -2,6 +2,7 @@ import "./chunk-J5LGTIGS.mjs";
2
2
 
3
3
  // src/containers/SheetArticle/SheetArticle.tsx
4
4
  import React from "react";
5
+ import { AppSurface } from "@dxos/app-toolkit/ui";
5
6
  import { Panel } from "@dxos/react-ui";
6
7
  import { ComputeGraphContextProvider, Sheet, useComputeGraph } from "#components";
7
8
  var SheetArticle = ({ registry, ...props }) => /* @__PURE__ */ React.createElement(ComputeGraphContextProvider, {
@@ -18,7 +19,7 @@ var SheetArticleInner = ({ role, subject: sheet, attendableId, space, ignoreAtte
18
19
  attendableId,
19
20
  ignoreAttention
20
21
  }, /* @__PURE__ */ React.createElement(Panel.Root, {
21
- classNames: role === "section" && "aspect-aquare"
22
+ classNames: role === AppSurface.Section.role && "aspect-square"
22
23
  }, /* @__PURE__ */ React.createElement(Panel.Toolbar, {
23
24
  asChild: true
24
25
  }, /* @__PURE__ */ React.createElement(Sheet.Toolbar, null)), /* @__PURE__ */ React.createElement(Panel.Content, {
@@ -30,4 +31,4 @@ var SheetArticleInner = ({ role, subject: sheet, attendableId, space, ignoreAtte
30
31
  export {
31
32
  SheetArticle as default
32
33
  };
33
- //# sourceMappingURL=SheetArticle-5AJRM3V3.mjs.map
34
+ //# sourceMappingURL=SheetArticle-IUPQYGUU.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/containers/SheetArticle/SheetArticle.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { type ComputeGraphRegistry } from '@dxos/compute-hyperformula';\nimport { type Space } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\n\nimport { ComputeGraphContextProvider, Sheet, useComputeGraph } from '#components';\nimport { type Sheet as SheetType } from '#types';\n\nexport type SheetArticleProps = AppSurface.ObjectArticleProps<\n SheetType.Sheet,\n {\n space: Space;\n registry: ComputeGraphRegistry;\n ignoreAttention?: boolean;\n }\n>;\n\nexport const SheetArticle = ({ registry, ...props }: SheetArticleProps) => (\n <ComputeGraphContextProvider registry={registry}>\n <SheetArticleInner {...props} />\n </ComputeGraphContextProvider>\n);\n\nconst SheetArticleInner = ({\n role,\n subject: sheet,\n attendableId,\n space,\n ignoreAttention,\n}: Omit<SheetArticleProps, 'registry'>) => {\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"],
5
+ "mappings": ";;;AAIA,OAAOA,WAAW;AAElB,SAASC,kBAAkB;AAG3B,SAASC,aAAa;AAEtB,SAASC,6BAA6BC,OAAOC,uBAAuB;AAY7D,IAAMC,eAAe,CAAC,EAAEC,UAAU,GAAGC,MAAAA,MAC1C,sBAAA,cAACL,6BAAAA;EAA4BI;GAC3B,sBAAA,cAACE,mBAAsBD,KAAAA,CAAAA;AAI3B,IAAMC,oBAAoB,CAAC,EACzBC,MACAC,SAASC,OACTC,cACAC,OACAC,gBAAe,MACqB;AACpC,QAAMC,QAAQX,gBAAgBS,KAAAA;AAC9B,MAAI,CAACE,OAAO;AACV,WAAO;EACT;AAEA,SACE,sBAAA,cAACZ,MAAMa,MAAI;IAACD;IAAcJ;IAAcC;IAA6BE;KACnE,sBAAA,cAACb,MAAMe,MAAI;IAACC,YAAYR,SAAST,WAAWkB,QAAQT,QAAQ;KAC1D,sBAAA,cAACR,MAAMkB,SAAO;IAACC,SAAAA;KACb,sBAAA,cAACjB,MAAMgB,SAAO,IAAA,CAAA,GAEhB,sBAAA,cAAClB,MAAMoB,SAAO;IAACD,SAAAA;KACb,sBAAA,cAACjB,MAAMkB,SAAO,IAAA,CAAA,GAEhB,sBAAA,cAACpB,MAAMqB,WAAS;IAACF,SAAAA;KACf,sBAAA,cAACjB,MAAMmB,WAAS,IAAA,CAAA,CAAA,CAAA;AAK1B;",
6
+ "names": ["React", "AppSurface", "Panel", "ComputeGraphContextProvider", "Sheet", "useComputeGraph", "SheetArticle", "registry", "props", "SheetArticleInner", "role", "subject", "sheet", "attendableId", "space", "ignoreAttention", "graph", "Root", "classNames", "Section", "Toolbar", "asChild", "Content", "Statusbar"]
7
+ }
@@ -5,19 +5,17 @@ import { ActivationEvent, ActivationEvents, Plugin } from "@dxos/app-framework";
5
5
  import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
6
6
  import { ClientEvents } from "@dxos/plugin-client";
7
7
  import { MarkdownEvents } from "@dxos/plugin-markdown";
8
- import { AnchorSort, AppGraphBuilder, NavigationResolver, CommentConfig, ComputeGraphRegistry, CreateObject, Markdown, OperationHandler, UndoMappings, ReactSurface, SheetState } from "#capabilities";
8
+ import { AnchorSort, CommentConfig, ComputeGraphRegistry, CreateObject, Markdown, OperationHandler, ReactSurface, SheetState, SkillDefinition, UndoMappings } from "#capabilities";
9
9
  import { meta } from "#meta";
10
10
  import { translations } from "#translations";
11
11
  import { Sheet } from "#types";
12
12
 
13
- // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-sheet/PLUGIN.mdl?raw
13
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-sheet/PLUGIN.mdl
14
14
  var PLUGIN_default = '---\nid: org.dxos.plugin.sheet\nname: SheetPlugin\nversion: 0.1.0\n---\n\nSpreadsheet plugin for `DXOS` Composer \u2014 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 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [toolbar slot] \u2502\n \u251C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 \u2502 A \u2502 B \u2502 C \u2502 \u2026 column header \u2502\n \u251C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2524 \u2502\n \u2502 1 \u2502 \u2502 \u2502 \u2502 cell grid \u2502\n \u251C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2524 \u2502\n \u2502 2 \u2502 \u2502 \u2502 \u2502 \u2502\n \u2502 \u2026 \u2502 \u2502 \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\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';
15
15
 
16
16
  // src/SheetPlugin.tsx
17
- var SheetPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
18
- activate: AppGraphBuilder
19
- }), AppPlugin.addNavigationResolverModule({
20
- activate: NavigationResolver
17
+ var SheetPlugin = Plugin.define(meta).pipe(AppPlugin.addSkillDefinitionModule({
18
+ activate: SkillDefinition
21
19
  }), AppPlugin.addCommentConfigModule({
22
20
  activate: CommentConfig
23
21
  }), AppPlugin.addCreateObjectModule({
@@ -49,7 +47,7 @@ var SheetPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
49
47
  activate: AnchorSort
50
48
  }), AppPlugin.addPluginAssetModule({
51
49
  asset: {
52
- pluginId: meta.id,
50
+ pluginId: meta.profile.key,
53
51
  path: "PLUGIN.mdl",
54
52
  content: PLUGIN_default,
55
53
  mimeType: "application/x-mdl"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/SheetPlugin.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-sheet/PLUGIN.mdl?raw"],
4
- "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 AppGraphBuilder,\n NavigationResolver,\n CommentConfig,\n ComputeGraphRegistry,\n CreateObject,\n Markdown,\n OperationHandler,\n UndoMappings,\n ReactSurface,\n SheetState,\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.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addNavigationResolverModule({ activate: NavigationResolver }),\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.id, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default SheetPlugin;\n", "---\nid: org.dxos.plugin.sheet\nname: SheetPlugin\nversion: 0.1.0\n---\n\nSpreadsheet plugin for `DXOS` Composer \u2014 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 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [toolbar slot] \u2502\n \u251C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 \u2502 A \u2502 B \u2502 C \u2502 \u2026 column header \u2502\n \u251C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2524 \u2502\n \u2502 1 \u2502 \u2502 \u2502 \u2502 cell grid \u2502\n \u251C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2524 \u2502\n \u2502 2 \u2502 \u2502 \u2502 \u2502 \u2502\n \u2502 \u2026 \u2502 \u2502 \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\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"],
5
- "mappings": ";;;AAIA,SAASA,iBAAiBC,kBAAkBC,cAAc;AAC1D,SAASC,qBAAqBC,iBAAiB;AAC/C,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;AAE/B,SACEC,YACAC,iBACAC,oBACAC,eACAC,sBACAC,cACAC,UACAC,kBACAC,cACAC,cACAC,kBACK;AACP,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,aAAa;;;ACxBtB;;;AD6BO,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CC,UAAUC,kBAAkB;EAAEC,UAAUC;AAAgB,CAAA,GACxDH,UAAUI,4BAA4B;EAAEF,UAAUG;AAAmB,CAAA,GACrEL,UAAUM,uBAAuB;EAAEJ,UAAUK;AAAc,CAAA,GAC3DP,UAAUQ,sBAAsB;EAAEN,UAAUO;AAAa,CAAA,GACzDT,UAAUU,0BAA0B;EAAER,UAAUS;AAAiB,CAAA,GACjEX,UAAUY,sBAAsB;EAAEV,UAAUW;AAAa,CAAA,GACzDb,UAAUc,gBAAgB;EAAEC,QAAQ;IAACC,MAAMA;;AAAO,CAAA,GAClDhB,UAAUiB,iBAAiB;EAAEf,UAAUgB;AAAa,CAAA,GACpDlB,UAAUmB,sBAAsB;EAAEC;AAAa,CAAA,GAC/CxB,OAAOyB,UAAU;EACfC,aAAaC,oBAAoBC;EACjCtB,UAAUuB;AACZ,CAAA,GACA7B,OAAOyB,UAAU;EACfC,aAAaI,gBAAgBC,MAAMC,aAAaC,aAAaC,iBAAiBC,mBAAmB;EACjG7B,UAAU8B;AACZ,CAAA,GACApC,OAAOyB,UAAU;EACfC,aAAaW,eAAeC;EAC5BhC,UAAUiC;AACZ,CAAA,GACAvC,OAAOyB,UAAU;;EAEfC,aAAaC,oBAAoBa;EACjClC,UAAUmC;AACZ,CAAA,GACArC,UAAUsC,qBAAqB;EAC7BC,OAAO;IAAEC,UAAU1C,KAAK2C;IAAIC,MAAM;IAAcC,SAASC;IAAYC,UAAU;EAAoB;AACrG,CAAA,GACAjD,OAAOkD,IAAI;AAGb,IAAA,sBAAenD;",
6
- "names": ["ActivationEvent", "ActivationEvents", "Plugin", "AppActivationEvents", "AppPlugin", "ClientEvents", "MarkdownEvents", "AnchorSort", "AppGraphBuilder", "NavigationResolver", "CommentConfig", "ComputeGraphRegistry", "CreateObject", "Markdown", "OperationHandler", "UndoMappings", "ReactSurface", "SheetState", "meta", "translations", "Sheet", "SheetPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addAppGraphModule", "activate", "AppGraphBuilder", "addNavigationResolverModule", "NavigationResolver", "addCommentConfigModule", "CommentConfig", "addCreateObjectModule", "CreateObject", "addOperationHandlerModule", "OperationHandler", "addUndoMappingsModule", "UndoMappings", "addSchemaModule", "schema", "Sheet", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "addModule", "activatesOn", "AppActivationEvents", "SetupSettings", "SheetState", "ActivationEvent", "allOf", "ClientEvents", "ClientReady", "ActivationEvents", "ProcessManagerReady", "ComputeGraphRegistry", "MarkdownEvents", "SetupExtensions", "Markdown", "AppGraphReady", "AnchorSort", "addPluginAssetModule", "asset", "pluginId", "id", "path", "content", "pluginSpec", "mimeType", "make"]
3
+ "sources": ["../../../src/SheetPlugin.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-sheet/PLUGIN.mdl"],
4
+ "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", "---\nid: org.dxos.plugin.sheet\nname: SheetPlugin\nversion: 0.1.0\n---\n\nSpreadsheet plugin for `DXOS` Composer \u2014 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 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [toolbar slot] \u2502\n \u251C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 \u2502 A \u2502 B \u2502 C \u2502 \u2026 column header \u2502\n \u251C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2524 \u2502\n \u2502 1 \u2502 \u2502 \u2502 \u2502 cell grid \u2502\n \u251C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2524 \u2502\n \u2502 2 \u2502 \u2502 \u2502 \u2502 \u2502\n \u2502 \u2026 \u2502 \u2502 \u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\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"],
5
+ "mappings": ";;;AAIA,SAASA,iBAAiBC,kBAAkBC,cAAc;AAC1D,SAASC,qBAAqBC,iBAAiB;AAC/C,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;AAE/B,SACEC,YACAC,eACAC,sBACAC,cACAC,UACAC,kBACAC,cACAC,YACAC,iBACAC,oBACK;AACP,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,aAAa;;;ACvBtB;;;AD4BO,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CC,UAAUC,yBAAyB;EAAEC,UAAUC;AAAgB,CAAA,GAC/DH,UAAUI,uBAAuB;EAAEF,UAAUG;AAAc,CAAA,GAC3DL,UAAUM,sBAAsB;EAAEJ,UAAUK;AAAa,CAAA,GACzDP,UAAUQ,0BAA0B;EAAEN,UAAUO;AAAiB,CAAA,GACjET,UAAUU,sBAAsB;EAAER,UAAUS;AAAa,CAAA,GACzDX,UAAUY,gBAAgB;EAAEC,QAAQ;IAACC,MAAMA;;AAAO,CAAA,GAClDd,UAAUe,iBAAiB;EAAEb,UAAUc;AAAa,CAAA,GACpDhB,UAAUiB,sBAAsB;EAAEC;AAAa,CAAA,GAC/CtB,OAAOuB,UAAU;EACfC,aAAaC,oBAAoBC;EACjCpB,UAAUqB;AACZ,CAAA,GACA3B,OAAOuB,UAAU;EACfC,aAAaI,gBAAgBC,MAAMC,aAAaC,aAAaC,iBAAiBC,mBAAmB;EACjG3B,UAAU4B;AACZ,CAAA,GACAlC,OAAOuB,UAAU;EACfC,aAAaW,eAAeC;EAC5B9B,UAAU+B;AACZ,CAAA,GACArC,OAAOuB,UAAU;;EAEfC,aAAaC,oBAAoBa;EACjChC,UAAUiC;AACZ,CAAA,GACAnC,UAAUoC,qBAAqB;EAC7BC,OAAO;IAAEC,UAAUxC,KAAKyC,QAAQC;IAAKC,MAAM;IAAcC,SAASC;IAAYC,UAAU;EAAoB;AAC9G,CAAA,GACAhD,OAAOiD,IAAI;AAGb,IAAA,sBAAelD;",
6
+ "names": ["ActivationEvent", "ActivationEvents", "Plugin", "AppActivationEvents", "AppPlugin", "ClientEvents", "MarkdownEvents", "AnchorSort", "CommentConfig", "ComputeGraphRegistry", "CreateObject", "Markdown", "OperationHandler", "ReactSurface", "SheetState", "SkillDefinition", "UndoMappings", "meta", "translations", "Sheet", "SheetPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addSkillDefinitionModule", "activate", "SkillDefinition", "addCommentConfigModule", "CommentConfig", "addCreateObjectModule", "CreateObject", "addOperationHandlerModule", "OperationHandler", "addUndoMappingsModule", "UndoMappings", "addSchemaModule", "schema", "Sheet", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "addModule", "activatesOn", "AppActivationEvents", "SetupSettings", "SheetState", "ActivationEvent", "allOf", "ClientEvents", "ClientReady", "ActivationEvents", "ProcessManagerReady", "ComputeGraphRegistry", "MarkdownEvents", "SetupExtensions", "Markdown", "AppGraphReady", "AnchorSort", "addPluginAssetModule", "asset", "pluginId", "profile", "key", "path", "content", "pluginSpec", "mimeType", "make"]
7
7
  }
@@ -2,28 +2,26 @@ import "../chunk-J5LGTIGS.mjs";
2
2
 
3
3
  // src/capabilities/index.ts
4
4
  import { Capability } from "@dxos/app-framework";
5
- var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-2QP6GYB2.mjs"));
6
- var NavigationResolver = Capability.lazy("NavigationResolver", () => import("../navigation-resolver-FXEZYO7G.mjs"));
7
5
  var AnchorSort = Capability.lazy("AnchorSort", () => import("../anchor-sort-2POWTKTD.mjs"));
8
- var CommentConfig = Capability.lazy("CommentConfig", () => import("../comment-config-WGXXX5FG.mjs"));
6
+ var CommentConfig = Capability.lazy("CommentConfig", () => import("../comment-config-4CIQFYM2.mjs"));
9
7
  var ComputeGraphRegistry = Capability.lazy("ComputeGraphRegistry", () => import("../compute-graph-registry-YYINTFC2.mjs"));
10
- var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-TDQQ24IB.mjs"));
8
+ var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-5WEY5XZJ.mjs"));
11
9
  var Markdown = Capability.lazy("MarkdownExtension", () => import("../markdown-extension-HTJDICGT.mjs"));
12
10
  var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-TB6LFV2H.mjs"));
13
- var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-4H3PC4WG.mjs"));
11
+ var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-TJT6F2E4.mjs"));
14
12
  var SheetState = Capability.lazy("SheetState", () => import("../state-HPA27MX2.mjs"));
15
- var UndoMappings = Capability.lazy("UndoMappings", () => import("../undo-mappings-3FQLSTCZ.mjs"));
13
+ var SkillDefinition = Capability.lazy("SkillDefinition", () => import("../skill-definition-U3KQCFOI.mjs"));
14
+ var UndoMappings = Capability.lazy("UndoMappings", () => import("../undo-mappings-O75AYIRG.mjs"));
16
15
  export {
17
16
  AnchorSort,
18
- AppGraphBuilder,
19
17
  CommentConfig,
20
18
  ComputeGraphRegistry,
21
19
  CreateObject,
22
20
  Markdown,
23
- NavigationResolver,
24
21
  OperationHandler,
25
22
  ReactSurface,
26
23
  SheetState,
24
+ SkillDefinition,
27
25
  UndoMappings
28
26
  };
29
27
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/capabilities/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { type AppCapabilities } from '@dxos/app-toolkit';\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const NavigationResolver = Capability.lazy('NavigationResolver', () => import('./navigation-resolver'));\nexport const AnchorSort = Capability.lazy('AnchorSort', () => import('./anchor-sort'));\n// The contributed capability type references Operation types from @dxos/compute, so the lazy\n// wrapper needs an explicit annotation to keep the inferred type portable (TS2883).\nexport const CommentConfig: Capability.LazyCapability<\n void,\n Capability.Capability<typeof AppCapabilities.CommentConfig>\n> = 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 UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));\n"],
5
- "mappings": ";;;AAIA,SAASA,kBAAkB;AAIpB,IAAMC,kBAAkBD,WAAWE,KAAK,mBAAmB,MAAM,OAAO,mCAAA,CAAA;AACxE,IAAMC,qBAAqBH,WAAWE,KAAK,sBAAsB,MAAM,OAAO,qCAAA,CAAA;AAC9E,IAAME,aAAaJ,WAAWE,KAAK,cAAc,MAAM,OAAO,6BAAA,CAAA;AAG9D,IAAMG,gBAGTL,WAAWE,KAAK,iBAAiB,MAAM,OAAO,gCAAA,CAAA;AAC3C,IAAMI,uBAAuBN,WAAWE,KAAK,wBAAwB,MAAM,OAAO,wCAAA,CAAA;AAClF,IAAMK,eAAeP,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMM,WAAWR,WAAWE,KAAK,qBAAqB,MAAM,OAAO,oCAAA,CAAA;AACnE,IAAMO,mBAAmBT,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;AAER,IAAMQ,eAAeV,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMS,aAAaX,WAAWE,KAAK,cAAc,MAAM,OAAO,uBAAA,CAAA;AAC9D,IAAMU,eAAeZ,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
6
- "names": ["Capability", "AppGraphBuilder", "lazy", "NavigationResolver", "AnchorSort", "CommentConfig", "ComputeGraphRegistry", "CreateObject", "Markdown", "OperationHandler", "ReactSurface", "SheetState", "UndoMappings"]
4
+ "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"],
5
+ "mappings": ";;;AAIA,SAASA,kBAAkB;AAGpB,IAAMC,aAAaD,WAAWE,KAAK,cAAc,MAAM,OAAO,6BAAA,CAAA;AAC9D,IAAMC,gBAAgBH,WAAWE,KAAK,iBAAiB,MAAM,OAAO,gCAAA,CAAA;AACpE,IAAME,uBAAuBJ,WAAWE,KAAK,wBAAwB,MAAM,OAAO,wCAAA,CAAA;AAClF,IAAMG,eAAeL,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMI,WAAWN,WAAWE,KAAK,qBAAqB,MAAM,OAAO,oCAAA,CAAA;AACnE,IAAMK,mBAAmBP,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;AAER,IAAMM,eAAeR,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMO,aAAaT,WAAWE,KAAK,cAAc,MAAM,OAAO,uBAAA,CAAA;AAC9D,IAAMQ,kBAAkBV,WAAWE,KAAK,mBAAmB,MAAM,OAAO,kCAAA,CAAA;AACxE,IAAMS,eAAeX,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
6
+ "names": ["Capability", "AnchorSort", "lazy", "CommentConfig", "ComputeGraphRegistry", "CreateObject", "Markdown", "OperationHandler", "ReactSurface", "SheetState", "SkillDefinition", "UndoMappings"]
7
7
  }
@@ -44,13 +44,16 @@ __export(Sheet_exports, {
44
44
  CellValue: () => CellValue,
45
45
  Range: () => Range,
46
46
  RowColumnMeta: () => RowColumnMeta,
47
+ SKILL_KEY: () => SKILL_KEY,
47
48
  Sheet: () => Sheet,
48
49
  make: () => make
49
50
  });
50
51
  import * as Schema from "effect/Schema";
52
+ import { AppAnnotation } from "@dxos/app-toolkit";
51
53
  import { addressFromA1Notation as addressFromA1Notation2, isFormula as isFormula2 } from "@dxos/compute-hyperformula";
52
- import { DXN, Annotation, Obj, Type } from "@dxos/echo";
54
+ import { Annotation, DXN, Obj, Type } from "@dxos/echo";
53
55
  import { FormInputAnnotation } from "@dxos/echo/Annotation";
56
+ import { CollectionItemAnnotation } from "@dxos/schema";
54
57
 
55
58
  // src/types/util.ts
56
59
  import { addressFromA1Notation, addressToA1Notation, isFormula } from "@dxos/compute-hyperformula";
@@ -129,7 +132,11 @@ var compareIndexPositions = (sheet, indexA, indexB) => {
129
132
  var mapFormulaRefsToIndices = (sheet, formula) => {
130
133
  assertArgument(isFormula(formula), "formula");
131
134
  return formula.replace(/([a-zA-Z]+)([0-9]+)/g, (match) => {
132
- return addressToIndex(sheet, addressFromA1Notation(match));
135
+ const cell = addressFromA1Notation(match);
136
+ if (cell.col < 0 || cell.row < 0 || cell.col >= sheet.columns.length || cell.row >= sheet.rows.length) {
137
+ return match;
138
+ }
139
+ return addressToIndex(sheet, cell);
133
140
  });
134
141
  };
135
142
  var mapFormulaIndicesToRefs = (sheet, formula) => {
@@ -140,6 +147,7 @@ var mapFormulaIndicesToRefs = (sheet, formula) => {
140
147
  };
141
148
 
142
149
  // src/types/Sheet.ts
150
+ var SKILL_KEY = "org.dxos.skill.sheet";
143
151
  var CellValue = Schema.Struct({
144
152
  // TODO(burdon): How to store dates (datetime, date, time), percentages, etc.
145
153
  // Consider import/export; natural access for other plugins. Special handling for currency (precision).
@@ -154,7 +162,7 @@ var Range = Schema.Struct({
154
162
  var RowColumnMeta = Schema.Struct({
155
163
  size: Schema.optional(Schema.Number)
156
164
  });
157
- var Sheet = Schema.Struct({
165
+ var Sheet = class extends Type.makeObject(DXN.make("org.dxos.type.sheet", "0.1.0"))(Schema.Struct({
158
166
  name: Schema.optional(Schema.String),
159
167
  // Sparse map of cells referenced by index.
160
168
  cells: Schema.Record({
@@ -180,7 +188,10 @@ var Sheet = Schema.Struct({
180
188
  }).pipe(Annotation.IconAnnotation.set({
181
189
  icon: "ph--grid-nine--regular",
182
190
  hue: "indigo"
183
- }), Type.makeObject(DXN.make("org.dxos.type.sheet", "0.1.0")));
191
+ }), AppAnnotation.SkillsAnnotation.set([
192
+ SKILL_KEY
193
+ ]), CollectionItemAnnotation.set(true))) {
194
+ };
184
195
  var make = ({ name, cells = {}, ...size } = {}) => {
185
196
  const sheet = Obj.make(Sheet, {
186
197
  name,
@@ -229,24 +240,28 @@ __export(SheetCapabilities_exports, {
229
240
  });
230
241
  import { Capability } from "@dxos/app-framework";
231
242
  import { meta } from "#meta";
232
- var ComputeGraphRegistry = Capability.make(`${meta.id}.capability.compute-graph-registry`);
233
- var GridInstances = Capability.make(`${meta.id}.capability.grid-instances`);
243
+ var ComputeGraphRegistry = Capability.make(`${meta.profile.key}.capability.compute-graph-registry`);
244
+ var GridInstances = Capability.make(`${meta.profile.key}.capability.grid-instances`);
234
245
 
235
246
  // src/types/SheetOperation.ts
236
247
  var SheetOperation_exports = {};
237
248
  __export(SheetOperation_exports, {
249
+ Create: () => Create,
238
250
  DropAxis: () => DropAxis,
239
251
  DropAxisOutput: () => DropAxisOutput,
252
+ GetValues: () => GetValues,
240
253
  InsertAxis: () => InsertAxis,
241
254
  RestoreAxis: () => RestoreAxis,
242
- ScrollToAnchor: () => ScrollToAnchor
255
+ ScrollToAnchor: () => ScrollToAnchor,
256
+ SetValues: () => SetValues
243
257
  });
244
258
  import * as Schema3 from "effect/Schema";
245
259
  import { Capability as Capability2 } from "@dxos/app-framework";
246
260
  import { Operation } from "@dxos/compute";
261
+ import { Database, Ref } from "@dxos/echo";
247
262
  import { DXN as DXN2 } from "@dxos/keys";
248
263
  import { meta as meta2 } from "#meta";
249
- var makeKey = (name) => DXN2.make(`${meta2.id}.operation.${name}`);
264
+ var makeKey = (name) => DXN2.make(`${meta2.profile.key}.operation.${name}`);
250
265
  var Axis = Schema3.Union(Schema3.Literal("row"), Schema3.Literal("col"));
251
266
  var InsertAxis = Operation.make({
252
267
  meta: {
@@ -314,6 +329,83 @@ var ScrollToAnchor = Operation.make({
314
329
  }),
315
330
  output: Schema3.Void
316
331
  });
332
+ var Create = Operation.make({
333
+ meta: {
334
+ key: DXN2.make("org.dxos.function.sheet.create"),
335
+ name: "Create",
336
+ description: "Creates a new sheet and adds it to the space.",
337
+ icon: "ph--grid-nine--regular"
338
+ },
339
+ input: Schema3.Struct({
340
+ name: Schema3.optional(Schema3.String).annotations({
341
+ description: "Display name for the sheet."
342
+ }),
343
+ rows: Schema3.optional(Schema3.Number).annotations({
344
+ description: "Initial number of rows (default 50)."
345
+ }),
346
+ columns: Schema3.optional(Schema3.Number).annotations({
347
+ description: "Initial number of columns (default 26)."
348
+ })
349
+ }),
350
+ output: Schema3.Struct({
351
+ id: Schema3.String.annotations({
352
+ description: "The DXN of the created sheet."
353
+ })
354
+ }),
355
+ services: [
356
+ Database.Service
357
+ ]
358
+ });
359
+ var GetValues = Operation.make({
360
+ meta: {
361
+ key: makeKey("rangeGet"),
362
+ name: "Get Range Values",
363
+ description: "Returns cell values from a sheet as a 2D array. Defaults to the entire occupied area.",
364
+ icon: "ph--table--regular"
365
+ },
366
+ input: Schema3.Struct({
367
+ sheet: Ref.Ref(Sheet).annotations({
368
+ description: "The sheet to read from."
369
+ }),
370
+ range: Schema3.optional(Schema3.String).annotations({
371
+ description: 'Range in A1 notation (e.g. "A1:C5"). Omit to return the entire occupied area.'
372
+ })
373
+ }),
374
+ output: Schema3.Struct({
375
+ values: Schema3.Array(Schema3.Array(Schema3.Any)).annotations({
376
+ description: "2D array of cell values indexed [row][col]. Empty cells are null. Formulas are shown in A1 notation."
377
+ }),
378
+ range: Schema3.String.annotations({
379
+ description: 'The A1 range actually returned (e.g. "A1:E5").'
380
+ })
381
+ }),
382
+ services: [
383
+ Database.Service
384
+ ]
385
+ });
386
+ var SetValues = Operation.make({
387
+ meta: {
388
+ key: makeKey("rangeSet"),
389
+ name: "Set Range Values",
390
+ description: "Sets multiple cell values in a sheet at once.",
391
+ icon: "ph--pencil--regular"
392
+ },
393
+ input: Schema3.Struct({
394
+ sheet: Ref.Ref(Sheet).annotations({
395
+ description: "The sheet to write to."
396
+ }),
397
+ cells: Schema3.Record({
398
+ key: Schema3.String,
399
+ value: Schema3.Any
400
+ }).annotations({
401
+ description: 'Map of A1 address to value (e.g. { "A1": "Name", "B1": 42, "C1": "=A1+B1" }).'
402
+ })
403
+ }),
404
+ output: Schema3.Void,
405
+ services: [
406
+ Database.Service
407
+ ]
408
+ });
317
409
  var RestoreAxis = Operation.make({
318
410
  meta: {
319
411
  key: makeKey("restoreAxis"),
@@ -371,4 +463,4 @@ export {
371
463
  SheetCapabilities_exports,
372
464
  SheetOperation_exports
373
465
  };
374
- //# sourceMappingURL=chunk-KUWATEHB.mjs.map
466
+ //# sourceMappingURL=chunk-HY4DM35G.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/sheet-range-types.ts", "../../../src/types/types.ts", "../../../src/types/Sheet.ts", "../../../src/types/util.ts", "../../../src/types/SheetCapabilities.ts", "../../../src/types/SheetOperation.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type ClassNameValue } from '@dxos/react-ui';\n\nimport { type Sheet } from '../types';\n\nexport const alignKey = 'alignment';\nexport type AlignKey = typeof alignKey;\nexport type AlignValue = 'start' | 'center' | 'end';\n\nexport const commentKey = 'comment';\nexport type CommentKey = typeof commentKey;\nexport type CommentValue = string;\n\nexport const styleKey = 'style';\nexport type StyleKey = typeof styleKey;\nexport type StyleValue = 'highlight' | 'softwrap';\n\n// TODO(burdon): Reconcile with plugin-table.\nexport const cellClassNameForRange = ({ key, value }: Sheet.Sheet['ranges'][number]): ClassNameValue => {\n switch (key) {\n case alignKey:\n switch (value) {\n case 'start':\n return 'text-start';\n case 'center':\n return 'text-center';\n case 'end':\n return 'text-end';\n default:\n return undefined;\n }\n\n case commentKey:\n return 'bg-grid-comment';\n\n case styleKey:\n switch (value) {\n case 'highlight':\n return 'bg-grid-highlight!';\n case 'softwrap':\n return 'whitespace-normal!';\n default:\n return undefined;\n }\n\n default:\n return undefined;\n }\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Sheet from './Sheet';\n\n// TODO(wittjosiah): Factor out. This is `DxGridAxis` from `@dxos/react-ui-grid`.\nconst ActionAxis = Schema.Union(Schema.Literal('row'), Schema.Literal('col'));\n\nexport namespace SheetAction {\n export const RestoreAxis = Schema.Struct({\n axis: ActionAxis,\n axisIndex: Schema.String,\n index: Schema.Number,\n axisMeta: Sheet.RowColumnMeta,\n values: Schema.Array(Schema.Any),\n });\n\n export type RestoreAxis = Schema.Schema.Type<typeof RestoreAxis>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { AppAnnotation } from '@dxos/app-toolkit';\nimport { addressFromA1Notation, isFormula } from '@dxos/compute-hyperformula';\nimport { Annotation, DXN, Obj, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/Annotation';\nimport { CollectionItemAnnotation } from '@dxos/schema';\n\nimport { addressToIndex, initialize, mapFormulaRefsToIndices } from './util';\n\nexport const SKILL_KEY = 'org.dxos.skill.sheet';\n\nexport type SheetSize = {\n rows: number;\n columns: number;\n};\n\nexport const CellValue = Schema.Struct({\n // TODO(burdon): How to store dates (datetime, date, time), percentages, etc.\n // Consider import/export; natural access for other plugins. Special handling for currency (precision).\n // TODO(burdon): Automerge (long string) or short string or number.\n value: Schema.Any,\n});\n\nexport type CellValue = Schema.Schema.Type<typeof CellValue>;\n\n// TODO(burdon): IMPORTANT: Reconcile with Field definition.\nexport const Range = Schema.Struct({\n range: Schema.String,\n key: Schema.String,\n value: Schema.String,\n});\n\nexport type Range = Schema.Schema.Type<typeof Range>;\n\n// TODO(burdon): Visibility, locked, frozen, etc.\nexport const RowColumnMeta = Schema.Struct({\n size: Schema.optional(Schema.Number),\n});\n\n// TODO(burdon): Reconcile col/column (across packages).\n// TODO(burdon): Index to all updates when rows/columns are inserted/deleted.\nexport class Sheet extends Type.makeObject<Sheet>(DXN.make('org.dxos.type.sheet', '0.1.0'))(\n Schema.Struct({\n name: Schema.optional(Schema.String),\n\n // Sparse map of cells referenced by index.\n cells: Schema.Record({ key: Schema.String, value: CellValue }).pipe(FormInputAnnotation.set(false)),\n\n // Ordered row indices.\n rows: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),\n\n // Ordered column indices.\n columns: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),\n\n // Row metadata referenced by index.\n rowMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),\n\n // Column metadata referenced by index.\n columnMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),\n\n // Cell formatting referenced by indexed range.\n ranges: Schema.Array(Range).pipe(FormInputAnnotation.set(false)),\n }).pipe(\n Annotation.IconAnnotation.set({ icon: 'ph--grid-nine--regular', hue: 'indigo' }),\n AppAnnotation.SkillsAnnotation.set([SKILL_KEY]),\n CollectionItemAnnotation.set(true),\n ),\n) {}\n\nexport type SheetProps = {\n name?: string;\n cells?: Record<string, CellValue>;\n} & Partial<SheetSize>;\n\nexport const make = ({ name, cells = {}, ...size }: SheetProps = {}) => {\n const sheet = Obj.make(Sheet, { name, cells: {}, rows: [], columns: [], rowMeta: {}, columnMeta: {}, ranges: [] });\n\n // Initialize and set cells within Obj.update to satisfy change context requirements.\n Obj.update(sheet, (sheet) => {\n initialize(sheet, size);\n\n if (cells) {\n Object.entries(cells).forEach(([key, { value }]) => {\n const idx = addressToIndex(sheet, addressFromA1Notation(key));\n if (isFormula(value)) {\n value = mapFormulaRefsToIndices(sheet, value);\n }\n\n sheet.cells[idx] = { value };\n });\n }\n });\n\n return sheet;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n type CellAddress,\n type CellRange,\n type CompleteCellRange,\n addressFromA1Notation,\n addressToA1Notation,\n isFormula,\n} from '@dxos/compute-hyperformula';\nimport { randomBytes } from '@dxos/crypto';\nimport { type Obj } from '@dxos/echo';\nimport { assertArgument } from '@dxos/invariant';\n\nimport { type Sheet } from '../types';\n\nexport const MAX_ROWS = 500;\nexport const MAX_COLS = 676; // 26^2;\n\nexport const DEFAULT_ROWS = 50;\nexport const DEFAULT_COLS = 26;\n\n// TODO(burdon): Factor out from dxos/protocols to new common package.\nexport class ApiError extends Error {}\n\nexport class ReadonlyException extends ApiError {}\n\nexport class RangeException extends ApiError {\n constructor(n: number) {\n super();\n }\n}\n\n/**\n * With a string length of 8, the chance of a collision is 0.02% for a sheet with 10,000 strings.\n */\nexport const createIndex = (length = 8): string => {\n const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const charactersLength = characters.length;\n const randomBuffer = randomBytes(length);\n return Array.from(randomBuffer, (byte) => characters[byte % charactersLength]).join('');\n};\n\nexport const createIndices = (length: number): string[] => Array.from({ length }).map(() => createIndex());\n\nexport const insertIndices = (indices: string[], i: number, n: number, max: number) => {\n if (i + n > max) {\n throw new RangeException(i + n);\n }\n\n const idx = createIndices(n);\n indices.splice(i, 0, ...idx);\n return idx;\n};\n\nexport const initialize = (\n sheet: Obj.Mutable<Sheet.Sheet>,\n { rows = DEFAULT_ROWS, columns = DEFAULT_COLS }: Partial<Sheet.SheetSize> = {},\n) => {\n if (!sheet.rows.length) {\n insertIndices(sheet.rows, 0, rows, MAX_ROWS);\n }\n if (!sheet.columns.length) {\n insertIndices(sheet.columns, 0, columns, MAX_COLS);\n }\n};\n\n/**\n * E.g., \"A1\" => \"CA2@CB3\".\n */\nexport const addressToIndex = (sheet: Sheet.Sheet, cell: CellAddress): string => {\n return `${sheet.columns[cell.col]}@${sheet.rows[cell.row]}`;\n};\n\n/**\n * E.g., \"CA2@CB3\" => \"A1\".\n */\nexport const addressFromIndex = (sheet: Sheet.Sheet, idx: string): CellAddress => {\n const [column, row] = idx.split('@');\n return {\n col: sheet.columns.indexOf(column),\n row: sheet.rows.indexOf(row),\n };\n};\n\n/**\n * E.g., \"A1:B2\" => \"CA2@CB3:CC4@CD5\".\n */\nexport const rangeToIndex = (sheet: Sheet.Sheet, range: CellRange): string => {\n return [range.from, range.to ?? range.from].map((cell) => addressToIndex(sheet, cell)).join(':');\n};\n\n/**\n * E.g., \"CA2@CB3:CC4@CD5\" => \"A1:B2\".\n */\nexport const rangeFromIndex = (sheet: Sheet.Sheet, idx: string): CompleteCellRange => {\n const [from, to] = idx.split(':').map((index) => addressFromIndex(sheet, index));\n return { from, to };\n};\n\n/**\n * Compares the positions of two cell indexes in a sheet.\n * Sorts primarily by row, then by column if rows are equal.\n */\nexport const compareIndexPositions = (sheet: Sheet.Sheet, indexA: string, indexB: string): number => {\n const { row: rowA, col: columnA } = addressFromIndex(sheet, indexA);\n const { row: rowB, col: columnB } = addressFromIndex(sheet, indexB);\n\n // Sort by row first, then by column.\n if (rowA !== rowB) {\n return rowA - rowB;\n } else {\n return columnA - columnB;\n }\n};\n\n// TODO(burdon): Tests.\n\n/**\n * Map from A1 notation to indices.\n */\nexport const mapFormulaRefsToIndices = (sheet: Sheet.Sheet, formula: string): string => {\n assertArgument(isFormula(formula), 'formula');\n return formula.replace(/([a-zA-Z]+)([0-9]+)/g, (match) => {\n const cell = addressFromA1Notation(match);\n // Skip tokens whose parsed address falls outside the sheet bounds or is negative — they are\n // function names (e.g. LOG10, ATAN2) or malformed refs (e.g. A0 → row -1) rather than valid\n // cell references.\n if (cell.col < 0 || cell.row < 0 || cell.col >= sheet.columns.length || cell.row >= sheet.rows.length) {\n return match;\n }\n return addressToIndex(sheet, cell);\n });\n};\n\n/**\n * Map from indices to A1 notation.\n */\nexport const mapFormulaIndicesToRefs = (sheet: Sheet.Sheet, formula: string): string => {\n assertArgument(isFormula(formula), 'formula');\n return formula.replace(/([a-zA-Z0-9]+)@([a-zA-Z0-9]+)/g, (idx) => {\n return addressToA1Notation(addressFromIndex(sheet, idx));\n });\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { Capability } from '@dxos/app-framework';\nimport { type ComputeGraphRegistry as ComputeGraphRegistryType } from '@dxos/compute-hyperformula';\nimport { type DxGridElement, type GridContentProps } from '@dxos/react-ui-grid';\n\nimport { meta } from '#meta';\n\nexport type GridEntry = { grid: DxGridElement; setActiveRefs: (refs: GridContentProps['activeRefs']) => void };\n\nexport type GridRegistry = {\n register: (attendableId: string, grid: DxGridElement, setActiveRefs: GridEntry['setActiveRefs']) => void;\n unregister: (attendableId: string) => void;\n get: (attendableId: string) => GridEntry | undefined;\n};\n\nexport const ComputeGraphRegistry = Capability.make<ComputeGraphRegistryType>(\n `${meta.profile.key}.capability.compute-graph-registry`,\n);\n\n/** Registry of active grid instances keyed by attendable ID. */\nexport const GridInstances = Capability.make<GridRegistry>(`${meta.profile.key}.capability.grid-instances`);\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Database, Ref } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\n\nimport { meta } from '#meta';\n\nimport * as Sheet from './Sheet';\n\nconst makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);\n\n// TODO(wittjosiah): Factor out. This is `DxGridAxis` from `@dxos/react-ui-grid`.\nconst Axis = Schema.Union(Schema.Literal('row'), Schema.Literal('col'));\n\nexport const InsertAxis = Operation.make({\n meta: { key: makeKey('axisInsert'), name: 'Insert Axis', icon: 'ph--plus--regular' },\n input: Schema.Struct({\n model: Schema.Any,\n axis: Axis,\n index: Schema.Number,\n count: Schema.optional(Schema.Number),\n }),\n output: Schema.Void,\n});\n\nexport const DropAxisOutput = Schema.Struct({\n axis: Axis.annotations({ description: 'The axis type (row or col).' }),\n axisIndex: Schema.String.annotations({ description: 'The dropped axis index.' }),\n index: Schema.Number.annotations({ description: 'The position the axis was at.' }),\n axisMeta: Schema.Any.annotations({ description: 'The row/column metadata.' }),\n values: Schema.Array(Schema.Any).annotations({ description: 'The cell values that were dropped.' }),\n});\n\nexport type DropAxisOutput = Schema.Schema.Type<typeof DropAxisOutput>;\n\nexport const DropAxis = Operation.make({\n meta: { key: makeKey('axisDrop'), name: 'Drop Axis', icon: 'ph--trash--regular' },\n input: Schema.Struct({\n model: Schema.Any,\n axis: Axis,\n axisIndex: Schema.String,\n }),\n output: DropAxisOutput,\n});\n\nexport const ScrollToAnchor = Operation.make({\n meta: {\n key: makeKey('scrollToAnchor'),\n name: 'Scroll To Anchor',\n icon: 'ph--anchor-simple--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n subject: Schema.String.annotations({ description: 'Attendable ID of the sheet.' }),\n cursor: Schema.String.annotations({ description: 'Cell range coordinates.' }),\n ref: Schema.optional(Schema.Any.annotations({ description: 'Active refs for highlighting.' })),\n }),\n output: Schema.Void,\n});\n\nexport const Create = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.sheet.create'),\n name: 'Create',\n description: 'Creates a new sheet and adds it to the space.',\n icon: 'ph--grid-nine--regular',\n },\n input: Schema.Struct({\n name: Schema.optional(Schema.String).annotations({ description: 'Display name for the sheet.' }),\n rows: Schema.optional(Schema.Number).annotations({ description: 'Initial number of rows (default 50).' }),\n columns: Schema.optional(Schema.Number).annotations({ description: 'Initial number of columns (default 26).' }),\n }),\n output: Schema.Struct({\n id: Schema.String.annotations({ description: 'The DXN of the created sheet.' }),\n }),\n services: [Database.Service],\n});\n\nexport const GetValues = Operation.make({\n meta: {\n key: makeKey('rangeGet'),\n name: 'Get Range Values',\n description: 'Returns cell values from a sheet as a 2D array. Defaults to the entire occupied area.',\n icon: 'ph--table--regular',\n },\n input: Schema.Struct({\n sheet: Ref.Ref(Sheet.Sheet).annotations({ description: 'The sheet to read from.' }),\n range: Schema.optional(Schema.String).annotations({\n description: 'Range in A1 notation (e.g. \"A1:C5\"). Omit to return the entire occupied area.',\n }),\n }),\n output: Schema.Struct({\n values: Schema.Array(Schema.Array(Schema.Any)).annotations({\n description:\n '2D array of cell values indexed [row][col]. Empty cells are null. Formulas are shown in A1 notation.',\n }),\n range: Schema.String.annotations({ description: 'The A1 range actually returned (e.g. \"A1:E5\").' }),\n }),\n services: [Database.Service],\n});\n\nexport const SetValues = Operation.make({\n meta: {\n key: makeKey('rangeSet'),\n name: 'Set Range Values',\n description: 'Sets multiple cell values in a sheet at once.',\n icon: 'ph--pencil--regular',\n },\n input: Schema.Struct({\n sheet: Ref.Ref(Sheet.Sheet).annotations({ description: 'The sheet to write to.' }),\n cells: Schema.Record({ key: Schema.String, value: Schema.Any }).annotations({\n description: 'Map of A1 address to value (e.g. { \"A1\": \"Name\", \"B1\": 42, \"C1\": \"=A1+B1\" }).',\n }),\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n\n/**\n * Restore a dropped axis (inverse of DropAxis).\n */\nexport const RestoreAxis = Operation.make({\n meta: {\n key: makeKey('restoreAxis'),\n name: 'Restore Axis',\n icon: 'ph--clock-counter-clockwise--regular',\n },\n input: Schema.Struct({\n model: Schema.Any.annotations({ description: 'The sheet model.' }),\n axis: Axis.annotations({ description: 'The axis type (row or col).' }),\n axisIndex: Schema.String.annotations({ description: 'The axis index to restore.' }),\n index: Schema.Number.annotations({ description: 'The position to restore at.' }),\n axisMeta: Schema.Any.annotations({ description: 'The row/column metadata.' }),\n values: Schema.Array(Schema.Any).annotations({ description: 'The cell values to restore.' }),\n }),\n output: Schema.Void,\n});\n"],
5
+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MkB,cAAc3C,UAAUR,KAAK;EACxCC,MAAM;IACJE,KAAKN,QAAQ,aAAA;IACbC,MAAM;IACNW,MAAM;EACR;EACAC,OAAcC,eAAO;IACnBC,OAAcC,YAAIS,YAAY;MAAEC,aAAa;IAAmB,CAAA;IAChET,MAAMV,KAAKkB,YAAY;MAAEC,aAAa;IAA8B,CAAA;IACpEC,WAAkBC,eAAOH,YAAY;MAAEC,aAAa;IAA6B,CAAA;IACjFR,OAAcC,eAAOM,YAAY;MAAEC,aAAa;IAA8B,CAAA;IAC9EG,UAAiBb,YAAIS,YAAY;MAAEC,aAAa;IAA2B,CAAA;IAC3EI,QAAeC,cAAaf,WAAG,EAAES,YAAY;MAAEC,aAAa;IAA8B,CAAA;EAC5F,CAAA;EACAJ,QAAeC;AACjB,CAAA;",
6
+ "names": ["alignKey", "commentKey", "styleKey", "cellClassNameForRange", "key", "value", "undefined", "Schema", "Schema", "AppAnnotation", "addressFromA1Notation", "isFormula", "Annotation", "DXN", "Obj", "Type", "FormInputAnnotation", "CollectionItemAnnotation", "addressFromA1Notation", "addressToA1Notation", "isFormula", "randomBytes", "assertArgument", "MAX_ROWS", "MAX_COLS", "DEFAULT_ROWS", "DEFAULT_COLS", "ApiError", "Error", "ReadonlyException", "RangeException", "n", "createIndex", "length", "characters", "charactersLength", "randomBuffer", "Array", "from", "byte", "join", "createIndices", "map", "insertIndices", "indices", "i", "max", "idx", "splice", "initialize", "sheet", "rows", "columns", "addressToIndex", "cell", "col", "row", "addressFromIndex", "column", "split", "indexOf", "rangeToIndex", "range", "to", "rangeFromIndex", "index", "compareIndexPositions", "indexA", "indexB", "rowA", "columnA", "rowB", "columnB", "mapFormulaRefsToIndices", "formula", "replace", "match", "mapFormulaIndicesToRefs", "SKILL_KEY", "CellValue", "Struct", "value", "Any", "Range", "range", "String", "key", "RowColumnMeta", "size", "optional", "Number", "Sheet", "Type", "makeObject", "DXN", "make", "name", "cells", "Record", "pipe", "FormInputAnnotation", "set", "rows", "Array", "columns", "rowMeta", "columnMeta", "ranges", "Annotation", "IconAnnotation", "icon", "hue", "AppAnnotation", "SkillsAnnotation", "CollectionItemAnnotation", "sheet", "Obj", "update", "initialize", "Object", "entries", "forEach", "idx", "addressToIndex", "addressFromA1Notation", "isFormula", "mapFormulaRefsToIndices", "ActionAxis", "Union", "Literal", "SheetAction", "RestoreAxis", "Struct", "axis", "axisIndex", "String", "index", "Number", "axisMeta", "RowColumnMeta", "values", "Array", "Any", "Capability", "meta", "ComputeGraphRegistry", "make", "profile", "key", "GridInstances", "Schema", "Capability", "Operation", "Database", "Ref", "DXN", "meta", "makeKey", "name", "DXN", "make", "meta", "profile", "key", "Axis", "Union", "Literal", "InsertAxis", "Operation", "icon", "input", "Struct", "model", "Any", "axis", "index", "Number", "count", "optional", "output", "Void", "DropAxisOutput", "annotations", "description", "axisIndex", "String", "axisMeta", "values", "Array", "DropAxis", "ScrollToAnchor", "services", "Capability", "Service", "subject", "cursor", "ref", "Create", "rows", "columns", "id", "Database", "GetValues", "sheet", "Ref", "Sheet", "range", "SetValues", "cells", "Record", "value", "RestoreAxis"]
7
+ }
@@ -0,0 +1,8 @@
1
+ // src/operations/index.ts
2
+ import { OperationHandlerSet } from "@dxos/compute";
3
+ var SheetOperationHandlerSet = OperationHandlerSet.lazy(() => import("./create-I3TKMPQO.mjs"), () => import("./drop-axis-JPFU5CJO.mjs"), () => import("./get-values-7YWQTH65.mjs"), () => import("./insert-axis-WD6ZC3UA.mjs"), () => import("./restore-axis-RLPX7P3G.mjs"), () => import("./scroll-to-anchor-6FJJQWZC.mjs"), () => import("./set-values-5DVOVLJH.mjs"));
4
+
5
+ export {
6
+ SheetOperationHandlerSet
7
+ };
8
+ //# sourceMappingURL=chunk-TDGEOMRG.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/operations/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const SheetOperationHandlerSet = OperationHandlerSet.lazy(\n () => import('./drop-axis'),\n () => import('./insert-axis'),\n () => import('./restore-axis'),\n () => import('./scroll-to-anchor'),\n);\n"],
5
- "mappings": ";AAIA,SAASA,2BAA2B;AAE7B,IAAMC,2BAA2BD,oBAAoBE,KAC1D,MAAM,OAAO,0BAAA,GACb,MAAM,OAAO,4BAAA,GACb,MAAM,OAAO,6BAAA,GACb,MAAM,OAAO,iCAAA,CAAA;",
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const SheetOperationHandlerSet = OperationHandlerSet.lazy(\n () => import('./create'),\n () => import('./drop-axis'),\n () => import('./get-values'),\n () => import('./insert-axis'),\n () => import('./restore-axis'),\n () => import('./scroll-to-anchor'),\n () => import('./set-values'),\n);\n"],
5
+ "mappings": ";AAIA,SAASA,2BAA2B;AAE7B,IAAMC,2BAA2BD,oBAAoBE,KAC1D,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,0BAAA,GACb,MAAM,OAAO,2BAAA,GACb,MAAM,OAAO,4BAAA,GACb,MAAM,OAAO,6BAAA,GACb,MAAM,OAAO,iCAAA,GACb,MAAM,OAAO,2BAAA,CAAA;",
6
6
  "names": ["OperationHandlerSet", "SheetOperationHandlerSet", "lazy"]
7
7
  }