@dxos/plugin-sheet 0.9.1-main.c7dcc2e112 → 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.
- package/dist/lib/neutral/{RangeList-7NS3MU5O.mjs → RangeList-EIJTFS7P.mjs} +2 -2
- package/dist/lib/neutral/{RangeList-7NS3MU5O.mjs.map → RangeList-EIJTFS7P.mjs.map} +2 -2
- package/dist/lib/neutral/SheetPlugin.mjs +3 -5
- package/dist/lib/neutral/SheetPlugin.mjs.map +3 -3
- package/dist/lib/neutral/capabilities/index.mjs +4 -6
- package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
- package/dist/lib/neutral/{chunk-2EZJRMC4.mjs → chunk-HY4DM35G.mjs} +98 -6
- package/dist/lib/neutral/chunk-HY4DM35G.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TDGEOMRG.mjs +8 -0
- package/dist/lib/neutral/{chunk-ZJEI77EI.mjs.map → chunk-TDGEOMRG.mjs.map} +2 -2
- package/dist/lib/neutral/{comment-config-WGXXX5FG.mjs → comment-config-4CIQFYM2.mjs} +1 -1
- package/dist/lib/neutral/comment-config-4CIQFYM2.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +7 -7
- package/dist/lib/neutral/components/index.mjs.map +3 -3
- package/dist/lib/neutral/containers/index.mjs +1 -1
- package/dist/lib/neutral/create-I3TKMPQO.mjs +30 -0
- package/dist/lib/neutral/create-I3TKMPQO.mjs.map +7 -0
- package/dist/lib/neutral/{create-object-RR5OBY5H.mjs → create-object-5WEY5XZJ.mjs} +2 -6
- package/dist/lib/neutral/create-object-5WEY5XZJ.mjs.map +7 -0
- package/dist/lib/neutral/{drop-axis-PRINKF5X.mjs → drop-axis-JPFU5CJO.mjs} +2 -2
- package/dist/lib/neutral/get-values-7YWQTH65.mjs +92 -0
- package/dist/lib/neutral/get-values-7YWQTH65.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +2 -8
- package/dist/lib/neutral/{insert-axis-FCSVF6OW.mjs → insert-axis-WD6ZC3UA.mjs} +2 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +1 -1
- package/dist/lib/neutral/{restore-axis-2RUGHTNA.mjs → restore-axis-RLPX7P3G.mjs} +2 -2
- package/dist/lib/neutral/{scroll-to-anchor-7BAFVTIM.mjs → scroll-to-anchor-6FJJQWZC.mjs} +2 -2
- package/dist/lib/neutral/set-values-5DVOVLJH.mjs +30 -0
- package/dist/lib/neutral/set-values-5DVOVLJH.mjs.map +7 -0
- package/dist/lib/neutral/skill-definition-U3KQCFOI.mjs +12 -0
- package/dist/lib/neutral/skill-definition-U3KQCFOI.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +1 -1
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/anchor-sort.d.ts +1 -2
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -1
- package/dist/types/src/capabilities/comment-config.d.ts +1 -2
- package/dist/types/src/capabilities/comment-config.d.ts.map +1 -1
- package/dist/types/src/capabilities/compute-graph-registry.d.ts +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -7
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown-extension.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
- package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +1 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/undo-mappings.d.ts +2 -2
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/Sheet.d.ts +1 -1
- package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +1 -25
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/get-values.d.ts +5 -0
- package/dist/types/src/operations/get-values.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/set-values.d.ts +5 -0
- package/dist/types/src/operations/set-values.d.ts.map +1 -0
- package/dist/types/src/skills/index.d.ts +2 -0
- package/dist/types/src/skills/index.d.ts.map +1 -0
- package/dist/types/src/skills/sheet-skill.d.ts +4 -0
- package/dist/types/src/skills/sheet-skill.d.ts.map +1 -0
- package/dist/types/src/testing/testing.d.ts +1 -25
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/types/Sheet.d.ts +7 -28
- package/dist/types/src/types/Sheet.d.ts.map +1 -1
- package/dist/types/src/types/SheetOperation.d.ts +22 -0
- package/dist/types/src/types/SheetOperation.d.ts.map +1 -1
- package/dist/types/src/types/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +60 -54
- package/src/SheetPlugin.tsx +3 -5
- package/src/capabilities/comment-config.ts +1 -6
- package/src/capabilities/create-object.ts +1 -4
- package/src/capabilities/index.ts +1 -2
- package/src/capabilities/skill-definition.ts +14 -0
- package/src/components/Sheet/Sheet.tsx +1 -1
- package/src/components/SheetContent/SheetCellEditor.stories.tsx +2 -2
- package/src/components/SheetContent/util.ts +4 -4
- package/src/containers/RangeList/RangeList.tsx +1 -1
- package/src/index.ts +0 -1
- package/src/operations/create.ts +24 -0
- package/src/operations/get-values.ts +83 -0
- package/src/operations/index.ts +3 -0
- package/src/operations/set-values.ts +29 -0
- package/src/skills/index.ts +5 -0
- package/src/skills/sheet-skill.ts +46 -0
- package/src/types/Sheet.ts +26 -21
- package/src/types/SheetOperation.ts +61 -0
- package/src/types/util.ts +8 -1
- package/dist/lib/neutral/app-graph-builder-PXTENKOB.mjs +0 -66
- package/dist/lib/neutral/app-graph-builder-PXTENKOB.mjs.map +0 -7
- package/dist/lib/neutral/chunk-2EZJRMC4.mjs.map +0 -7
- package/dist/lib/neutral/chunk-QT3L3OR2.mjs +0 -10
- package/dist/lib/neutral/chunk-QT3L3OR2.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZJEI77EI.mjs +0 -8
- package/dist/lib/neutral/comment-config-WGXXX5FG.mjs.map +0 -7
- package/dist/lib/neutral/create-object-RR5OBY5H.mjs.map +0 -7
- package/dist/lib/neutral/navigation-resolver-F5LR3IIW.mjs +0 -14
- package/dist/lib/neutral/navigation-resolver-F5LR3IIW.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/navigation-resolver.d.ts +0 -6
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +0 -1
- package/dist/types/src/paths.d.ts +0 -3
- package/dist/types/src/paths.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -61
- package/src/capabilities/navigation-resolver.ts +0 -19
- package/src/paths.ts +0 -11
- /package/dist/lib/neutral/{drop-axis-PRINKF5X.mjs.map → drop-axis-JPFU5CJO.mjs.map} +0 -0
- /package/dist/lib/neutral/{insert-axis-FCSVF6OW.mjs.map → insert-axis-WD6ZC3UA.mjs.map} +0 -0
- /package/dist/lib/neutral/{restore-axis-2RUGHTNA.mjs.map → restore-axis-RLPX7P3G.mjs.map} +0 -0
- /package/dist/lib/neutral/{scroll-to-anchor-7BAFVTIM.mjs.map → scroll-to-anchor-6FJJQWZC.mjs.map} +0 -0
|
@@ -24,7 +24,7 @@ var RangeList = ({ sheet: sheetProp }) => {
|
|
|
24
24
|
sheet,
|
|
25
25
|
updateSheet
|
|
26
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
|
|
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
28
|
items: sheet.ranges,
|
|
29
29
|
isItem: Schema.is(Sheet.Range)
|
|
30
30
|
}, ({ items: ranges }) => /* @__PURE__ */ React.createElement(OrderedList.Content, null, ranges.map((range) => {
|
|
@@ -50,4 +50,4 @@ var RangeList = ({ sheet: sheetProp }) => {
|
|
|
50
50
|
export {
|
|
51
51
|
RangeList as default
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=RangeList-
|
|
53
|
+
//# sourceMappingURL=RangeList-EIJTFS7P.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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
|
|
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,EAAEC,EAAC,IAAKR,eAAeE,KAAKO,QAAQC,GAAG;AAC7C,QAAM,CAACJ,OAAOK,WAAAA,IAAed,UAAUU,SAAAA;AAEvC,QAAMK,oBAAoB,CAACC,UAAAA;EAAwB;AACnD,QAAMC,oBAAoBnB,YACxB,CAACkB,UAAAA;AACC,UAAME,QAAQT,MAAMU,OAAOC,UAAU,CAACC,eAAeA,eAAeL,KAAAA;AACpEF,gBAAY,CAACL,WAAAA;AACXA,MAAAA,OAAMU,OAAOG,OAAOJ,OAAO,CAAA;IAC7B,CAAA;EACF,GACA;IAACT;IAAOK;GAAY;AAEtB,SACE,sBAAA,cAAA,MAAA,UAAA,MACE,sBAAA,cAACb,MAAMsB,MAAI,MACT,sBAAA,cAACtB,MAAMuB,OAAK,MAAEb,EAAE,oBAAA,CAAA,CAAA,GAEjBF,MAAMU,OAAOM,
|
|
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,EAAEC,EAAC,IAAKR,eAAeE,KAAKO,QAAQC,GAAG;AAC7C,QAAM,CAACJ,OAAOK,WAAAA,IAAed,UAAUU,SAAAA;AAEvC,QAAMK,oBAAoB,CAACC,UAAAA;EAAwB;AACnD,QAAMC,oBAAoBnB,YACxB,CAACkB,UAAAA;AACC,UAAME,QAAQT,MAAMU,OAAOC,UAAU,CAACC,eAAeA,eAAeL,KAAAA;AACpEF,gBAAY,CAACL,WAAAA;AACXA,MAAAA,OAAMU,OAAOG,OAAOJ,OAAO,CAAA;IAC7B,CAAA;EACF,GACA;IAACT;IAAOK;GAAY;AAEtB,SACE,sBAAA,cAAA,MAAA,UAAA,MACE,sBAAA,cAACb,MAAMsB,MAAI,MACT,sBAAA,cAACtB,MAAMuB,OAAK,MAAEb,EAAE,oBAAA,CAAA,CAAA,GAEjBF,MAAMU,OAAOM,WAAW,IACvB,sBAAA,cAACvB,QAAQqB,MAAI,MACX,sBAAA,cAACrB,QAAQwB,OAAK,MAAEf,EAAE,mBAAA,CAAA,CAAA,IAGpB,sBAAA,cAACP,YAAYmB,MAAI;IAAcI,OAAOlB,MAAMU;IAAQS,QAAeC,UAAGtB,MAAMuB,KAAK;KAC9E,CAAC,EAAEH,OAAOR,OAAM,MACf,sBAAA,cAACf,YAAY2B,SAAO,MACjBZ,OAAOa,IAAI,CAAChB,UAAAA;AAMX,UAAMiB,KAAKjB,MAAMA;AACjB,WACE,sBAAA,cAACZ,YAAY8B,MAAI;MACfrB,KAAKoB;MACLA;MACAE,MAAMnB;MACNoB,OAAAA;MACAC,YAAW;MACXC,SAAS,MAAMvB,kBAAkBC,KAAAA;OAEjC,sBAAA,cAACuB,OAAAA;MAAIC,WAAU;OACZ7B,EAAE,eAAe;MAChB8B,UAAU1C,kBAAkBO,eAAeI,WAAWM,MAAMA,KAAK,CAAA;MACjEH,KAAKF,EAAE,aAAaK,MAAMH,GAAG,QAAQ;MACrC6B,OAAO/B,EAAE,eAAeK,MAAM0B,KAAK,QAAQ;IAC7C,CAAA,CAAA,GAEF,sBAAA,cAACtC,YAAYuC,cAAY;MAACL,SAAS,MAAMrB,kBAAkBD,KAAAA;;EAGjE,CAAA,CAAA,CAAA,CAAA;AAOd;",
|
|
6
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
7
|
}
|
|
@@ -5,7 +5,7 @@ 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,
|
|
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";
|
|
@@ -14,10 +14,8 @@ import { Sheet } from "#types";
|
|
|
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.
|
|
18
|
-
activate:
|
|
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({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
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 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.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,
|
|
6
|
-
"names": ["ActivationEvent", "ActivationEvents", "Plugin", "AppActivationEvents", "AppPlugin", "ClientEvents", "MarkdownEvents", "AnchorSort", "
|
|
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
|
+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AAelD;",
|
|
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-PXTENKOB.mjs"));
|
|
6
|
-
var NavigationResolver = Capability.lazy("NavigationResolver", () => import("../navigation-resolver-F5LR3IIW.mjs"));
|
|
7
5
|
var AnchorSort = Capability.lazy("AnchorSort", () => import("../anchor-sort-2POWTKTD.mjs"));
|
|
8
|
-
var CommentConfig = Capability.lazy("CommentConfig", () => import("../comment-config-
|
|
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-
|
|
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
11
|
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-TJT6F2E4.mjs"));
|
|
14
12
|
var SheetState = Capability.lazy("SheetState", () => import("../state-HPA27MX2.mjs"));
|
|
13
|
+
var SkillDefinition = Capability.lazy("SkillDefinition", () => import("../skill-definition-U3KQCFOI.mjs"));
|
|
15
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 { OperationHandlerSet } from '@dxos/compute';\n\nexport const
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,kBAAkB;AAGpB,IAAMC,
|
|
6
|
-
"names": ["Capability", "
|
|
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 {
|
|
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
|
-
|
|
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
|
-
}),
|
|
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,
|
|
@@ -235,15 +246,19 @@ var GridInstances = Capability.make(`${meta.profile.key}.capability.grid-instanc
|
|
|
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
264
|
var makeKey = (name) => DXN2.make(`${meta2.profile.key}.operation.${name}`);
|
|
@@ -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-
|
|
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
|
+
"mappings": ";;;;;AAQO,IAAMA,WAAW;AAIjB,IAAMC,aAAa;AAInB,IAAMC,WAAW;AAKjB,IAAMC,wBAAwB,CAAC,EAAEC,KAAKC,MAAK,MAAiC;AACjF,UAAQD,KAAAA;IACN,KAAKJ;AACH,cAAQK,OAAAA;QACN,KAAK;AACH,iBAAO;QACT,KAAK;AACH,iBAAO;QACT,KAAK;AACH,iBAAO;QACT;AACE,iBAAOC;MACX;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AA;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
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/comment-config.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Type } from '@dxos/echo';\n\nimport { SheetOperation } from '#types';\nimport { Sheet } from '#types';\n\nconst activate = Effect.fnUntraced(function* () {\n const config: AppCapabilities.CommentConfig = {\n id: Type.getTypename(Sheet.Sheet),\n comments: 'anchored',\n scrollToAnchor: SheetOperation.ScrollToAnchor,\n };\n return Capability.contributes(AppCapabilities.CommentConfig, config);\n});\n\nexport default activate;\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAChC,SAASC,YAAY;AAErB,SAASC,sBAAsB;AAC/B,SAASC,aAAa;AAEtB,IAAMC,WAAkBC,kBAAW,aAAA;AACjC,QAAMC,SAAwC;IAC5CC,IAAIN,KAAKO,YAAYL,MAAMA,KAAK;IAChCM,UAAU;IACVC,gBAAgBR,eAAeS;EACjC;AACA,SAAOZ,WAAWa,YAAYZ,gBAAgBa,eAAeP,MAAAA;AAC/D,CAAA;AAEA,IAAA,yBAAeF;",
|
|
6
|
+
"names": ["Effect", "Capability", "AppCapabilities", "Type", "SheetOperation", "Sheet", "activate", "fnUntraced", "config", "id", "getTypename", "comments", "scrollToAnchor", "ScrollToAnchor", "contributes", "CommentConfig"]
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useSelectThreadOnCellFocus
|
|
3
|
-
} from "../chunk-HEN74ZWI.mjs";
|
|
4
1
|
import {
|
|
5
2
|
rangeExtension,
|
|
6
3
|
sheetExtension
|
|
7
4
|
} from "../chunk-ERHMBRSU.mjs";
|
|
5
|
+
import {
|
|
6
|
+
useSelectThreadOnCellFocus
|
|
7
|
+
} from "../chunk-HEN74ZWI.mjs";
|
|
8
8
|
import "../chunk-J5LGTIGS.mjs";
|
|
9
9
|
|
|
10
10
|
// src/components/ComputeGraph/ComputeGraphContextProvider.tsx
|
|
@@ -628,7 +628,7 @@ var SheetProviderImpl = ({ __gridScope, children, attendableId, ignoreAttention,
|
|
|
628
628
|
// src/components/SheetContent/util.ts
|
|
629
629
|
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
630
630
|
import { inRange } from "@dxos/compute-hyperformula";
|
|
631
|
-
import {
|
|
631
|
+
import { Doc } from "@dxos/echo-doc";
|
|
632
632
|
import { cellClassesForFieldType, parseValue } from "@dxos/react-ui-form";
|
|
633
633
|
import { colToA1Notation, commentedClassName, rowToA1Notation } from "@dxos/react-ui-grid";
|
|
634
634
|
import { mx } from "@dxos/ui-theme";
|
|
@@ -749,7 +749,7 @@ var useSheetModelDxGridProps = (dxGrid, model) => {
|
|
|
749
749
|
const [columns, setColumns] = useState3(createDxGridColumns(model));
|
|
750
750
|
const [rows, setRows] = useState3(createDxGridRows(model));
|
|
751
751
|
useEffect2(() => {
|
|
752
|
-
const cellsAccessor =
|
|
752
|
+
const cellsAccessor = Doc.createAccessor(model.sheet, [
|
|
753
753
|
"cells"
|
|
754
754
|
]);
|
|
755
755
|
if (dxGrid) {
|
|
@@ -769,10 +769,10 @@ var useSheetModelDxGridProps = (dxGrid, model) => {
|
|
|
769
769
|
dxGrid
|
|
770
770
|
]);
|
|
771
771
|
useEffect2(() => {
|
|
772
|
-
const columnMetaAccessor =
|
|
772
|
+
const columnMetaAccessor = Doc.createAccessor(model.sheet, [
|
|
773
773
|
"columnMeta"
|
|
774
774
|
]);
|
|
775
|
-
const rowMetaAccessor =
|
|
775
|
+
const rowMetaAccessor = Doc.createAccessor(model.sheet, [
|
|
776
776
|
"rowMeta"
|
|
777
777
|
]);
|
|
778
778
|
const handleColumnMetaUpdate = () => {
|