@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-sheet",
|
|
3
|
-
"version": "0.9.1-
|
|
3
|
+
"version": "0.9.1-staging.ee54ba693a",
|
|
4
4
|
"description": "Braneframe sketch plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -49,6 +49,11 @@
|
|
|
49
49
|
"node": "./dist/lib/neutral/SheetPlugin.node.mjs",
|
|
50
50
|
"default": "./dist/lib/neutral/SheetPlugin.mjs"
|
|
51
51
|
},
|
|
52
|
+
"#skills": {
|
|
53
|
+
"source": "./src/skills/index.ts",
|
|
54
|
+
"types": "./dist/types/src/skills/index.d.ts",
|
|
55
|
+
"default": "./dist/lib/neutral/skills/index.mjs"
|
|
56
|
+
},
|
|
52
57
|
"#testing": "./src/testing/index.ts",
|
|
53
58
|
"#translations": {
|
|
54
59
|
"source": "./src/translations.ts",
|
|
@@ -94,70 +99,71 @@
|
|
|
94
99
|
"@lezer/common": "^1.5.2",
|
|
95
100
|
"@lezer/highlight": "^1.2.3",
|
|
96
101
|
"codemirror-lang-spreadsheet": "^1.3.0",
|
|
97
|
-
"@dxos/app-framework": "0.9.1-
|
|
98
|
-
"@dxos/app-toolkit": "0.9.1-
|
|
99
|
-
"@dxos/client": "0.9.1-
|
|
100
|
-
"@dxos/compute": "0.9.1-
|
|
101
|
-
"@dxos/
|
|
102
|
-
"@dxos/context": "0.9.1-
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/echo
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/
|
|
110
|
-
"@dxos/log": "0.9.1-
|
|
111
|
-
"@dxos/
|
|
112
|
-
"@dxos/plugin-
|
|
113
|
-
"@dxos/
|
|
114
|
-
"@dxos/plugin-
|
|
115
|
-
"@dxos/plugin-
|
|
116
|
-
"@dxos/
|
|
117
|
-
"@dxos/react-
|
|
118
|
-
"@dxos/
|
|
119
|
-
"@dxos/react-ui-attention": "0.9.1-
|
|
120
|
-
"@dxos/react-
|
|
121
|
-
"@dxos/
|
|
122
|
-
"@dxos/react-ui-grid": "0.9.1-
|
|
123
|
-
"@dxos/react-ui-
|
|
124
|
-
"@dxos/react-ui-menu": "0.9.1-
|
|
125
|
-
"@dxos/
|
|
126
|
-
"@dxos/
|
|
127
|
-
"@dxos/
|
|
128
|
-
"@dxos/util": "0.9.1-
|
|
102
|
+
"@dxos/app-framework": "0.9.1-staging.ee54ba693a",
|
|
103
|
+
"@dxos/app-toolkit": "0.9.1-staging.ee54ba693a",
|
|
104
|
+
"@dxos/client": "0.9.1-staging.ee54ba693a",
|
|
105
|
+
"@dxos/compute": "0.9.1-staging.ee54ba693a",
|
|
106
|
+
"@dxos/compute-hyperformula": "0.9.1-staging.ee54ba693a",
|
|
107
|
+
"@dxos/context": "0.9.1-staging.ee54ba693a",
|
|
108
|
+
"@dxos/async": "0.9.1-staging.ee54ba693a",
|
|
109
|
+
"@dxos/crypto": "0.9.1-staging.ee54ba693a",
|
|
110
|
+
"@dxos/echo": "0.9.1-staging.ee54ba693a",
|
|
111
|
+
"@dxos/debug": "0.9.1-staging.ee54ba693a",
|
|
112
|
+
"@dxos/invariant": "0.9.1-staging.ee54ba693a",
|
|
113
|
+
"@dxos/echo-react": "0.9.1-staging.ee54ba693a",
|
|
114
|
+
"@dxos/lit-grid": "0.9.1-staging.ee54ba693a",
|
|
115
|
+
"@dxos/log": "0.9.1-staging.ee54ba693a",
|
|
116
|
+
"@dxos/keys": "0.9.1-staging.ee54ba693a",
|
|
117
|
+
"@dxos/plugin-client": "0.9.1-staging.ee54ba693a",
|
|
118
|
+
"@dxos/plugin-comments": "0.9.1-staging.ee54ba693a",
|
|
119
|
+
"@dxos/plugin-graph": "0.9.1-staging.ee54ba693a",
|
|
120
|
+
"@dxos/plugin-markdown": "0.9.1-staging.ee54ba693a",
|
|
121
|
+
"@dxos/echo-doc": "0.9.1-staging.ee54ba693a",
|
|
122
|
+
"@dxos/react-hooks": "0.9.1-staging.ee54ba693a",
|
|
123
|
+
"@dxos/react-client": "0.9.1-staging.ee54ba693a",
|
|
124
|
+
"@dxos/react-ui-attention": "0.9.1-staging.ee54ba693a",
|
|
125
|
+
"@dxos/react-ui-form": "0.9.1-staging.ee54ba693a",
|
|
126
|
+
"@dxos/plugin-space": "0.9.1-staging.ee54ba693a",
|
|
127
|
+
"@dxos/react-ui-grid": "0.9.1-staging.ee54ba693a",
|
|
128
|
+
"@dxos/react-ui-list": "0.9.1-staging.ee54ba693a",
|
|
129
|
+
"@dxos/react-ui-menu": "0.9.1-staging.ee54ba693a",
|
|
130
|
+
"@dxos/schema": "0.9.1-staging.ee54ba693a",
|
|
131
|
+
"@dxos/types": "0.9.1-staging.ee54ba693a",
|
|
132
|
+
"@dxos/ui-editor": "0.9.1-staging.ee54ba693a",
|
|
133
|
+
"@dxos/util": "0.9.1-staging.ee54ba693a",
|
|
134
|
+
"@dxos/react-ui-editor": "0.9.1-staging.ee54ba693a"
|
|
129
135
|
},
|
|
130
136
|
"devDependencies": {
|
|
131
137
|
"@effect-atom/atom-react": "^0.5.0",
|
|
132
|
-
"@effect/platform": "0.96.
|
|
138
|
+
"@effect/platform": "0.96.2",
|
|
133
139
|
"@lezer/generator": "^1.8.0",
|
|
134
140
|
"@tldraw/indices": "^2.0.0-alpha.14",
|
|
135
141
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
136
|
-
"@types/react": "~19.2.
|
|
142
|
+
"@types/react": "~19.2.17",
|
|
137
143
|
"@types/react-dom": "~19.2.3",
|
|
138
|
-
"effect": "3.21.
|
|
139
|
-
"react": "~19.2.
|
|
140
|
-
"react-dom": "~19.2.
|
|
144
|
+
"effect": "3.21.4",
|
|
145
|
+
"react": "~19.2.7",
|
|
146
|
+
"react-dom": "~19.2.7",
|
|
141
147
|
"vite": "^8.0.16",
|
|
142
|
-
"@dxos/
|
|
143
|
-
"@dxos/
|
|
144
|
-
"@dxos/
|
|
145
|
-
"@dxos/
|
|
146
|
-
"@dxos/
|
|
147
|
-
"@dxos/react-ui": "0.9.1-
|
|
148
|
-
"@dxos/storybook-utils": "0.9.1-
|
|
149
|
-
"@dxos/test-utils": "0.9.1-
|
|
150
|
-
"@dxos/ui-
|
|
151
|
-
"@dxos/ui-
|
|
148
|
+
"@dxos/echo-generator": "0.9.1-staging.ee54ba693a",
|
|
149
|
+
"@dxos/lit-grid": "0.9.1-staging.ee54ba693a",
|
|
150
|
+
"@dxos/plugin-testing": "0.9.1-staging.ee54ba693a",
|
|
151
|
+
"@dxos/random": "0.9.1-staging.ee54ba693a",
|
|
152
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a",
|
|
153
|
+
"@dxos/react-ui-syntax-highlighter": "0.9.1-staging.ee54ba693a",
|
|
154
|
+
"@dxos/storybook-utils": "0.9.1-staging.ee54ba693a",
|
|
155
|
+
"@dxos/test-utils": "0.9.1-staging.ee54ba693a",
|
|
156
|
+
"@dxos/ui-types": "0.9.1-staging.ee54ba693a",
|
|
157
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
|
|
152
158
|
},
|
|
153
159
|
"peerDependencies": {
|
|
154
160
|
"@effect-atom/atom-react": "^0.5.0",
|
|
155
|
-
"@effect/platform": "0.96.
|
|
156
|
-
"effect": "3.21.
|
|
157
|
-
"react": "~19.2.
|
|
158
|
-
"react-dom": "~19.2.
|
|
159
|
-
"@dxos/
|
|
160
|
-
"@dxos/ui
|
|
161
|
+
"@effect/platform": "0.96.2",
|
|
162
|
+
"effect": "3.21.4",
|
|
163
|
+
"react": "~19.2.7",
|
|
164
|
+
"react-dom": "~19.2.7",
|
|
165
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a",
|
|
166
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a"
|
|
161
167
|
},
|
|
162
168
|
"publishConfig": {
|
|
163
169
|
"access": "public"
|
package/src/SheetPlugin.tsx
CHANGED
|
@@ -9,16 +9,15 @@ import { MarkdownEvents } from '@dxos/plugin-markdown';
|
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
AnchorSort,
|
|
12
|
-
AppGraphBuilder,
|
|
13
|
-
NavigationResolver,
|
|
14
12
|
CommentConfig,
|
|
15
13
|
ComputeGraphRegistry,
|
|
16
14
|
CreateObject,
|
|
17
15
|
Markdown,
|
|
18
16
|
OperationHandler,
|
|
19
|
-
UndoMappings,
|
|
20
17
|
ReactSurface,
|
|
21
18
|
SheetState,
|
|
19
|
+
SkillDefinition,
|
|
20
|
+
UndoMappings,
|
|
22
21
|
} from '#capabilities';
|
|
23
22
|
import { meta } from '#meta';
|
|
24
23
|
import { translations } from '#translations';
|
|
@@ -28,8 +27,7 @@ import { Sheet } from '#types';
|
|
|
28
27
|
import pluginSpec from '../PLUGIN.mdl?raw';
|
|
29
28
|
|
|
30
29
|
export const SheetPlugin = Plugin.define(meta).pipe(
|
|
31
|
-
AppPlugin.
|
|
32
|
-
AppPlugin.addNavigationResolverModule({ activate: NavigationResolver }),
|
|
30
|
+
AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }),
|
|
33
31
|
AppPlugin.addCommentConfigModule({ activate: CommentConfig }),
|
|
34
32
|
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
35
33
|
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
@@ -11,12 +11,7 @@ import { Type } from '@dxos/echo';
|
|
|
11
11
|
import { SheetOperation } from '#types';
|
|
12
12
|
import { Sheet } from '#types';
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
const activate: () => Effect.Effect<
|
|
16
|
-
Capability.Capability<typeof AppCapabilities.CommentConfig>,
|
|
17
|
-
never,
|
|
18
|
-
Capability.Service
|
|
19
|
-
> = Effect.fnUntraced(function* () {
|
|
14
|
+
const activate = Effect.fnUntraced(function* () {
|
|
20
15
|
const config: AppCapabilities.CommentConfig = {
|
|
21
16
|
id: Type.getTypename(Sheet.Sheet),
|
|
22
17
|
comments: 'anchored',
|
|
@@ -12,8 +12,6 @@ import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
|
12
12
|
|
|
13
13
|
import { Sheet } from '#types';
|
|
14
14
|
|
|
15
|
-
import { getSheetsPath } from '../paths';
|
|
16
|
-
|
|
17
15
|
export default Capability.makeModule(
|
|
18
16
|
Effect.fnUntraced(function* () {
|
|
19
17
|
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
@@ -24,8 +22,7 @@ export default Capability.makeModule(
|
|
|
24
22
|
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
25
23
|
object,
|
|
26
24
|
target: options.target,
|
|
27
|
-
|
|
28
|
-
targetNodeId: options.targetNodeId ?? getSheetsPath(options.db.spaceId),
|
|
25
|
+
targetNodeId: options.targetNodeId,
|
|
29
26
|
});
|
|
30
27
|
}),
|
|
31
28
|
});
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
import { Capability } from '@dxos/app-framework';
|
|
6
6
|
import { OperationHandlerSet } from '@dxos/compute';
|
|
7
7
|
|
|
8
|
-
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
-
export const NavigationResolver = Capability.lazy('NavigationResolver', () => import('./navigation-resolver'));
|
|
10
8
|
export const AnchorSort = Capability.lazy('AnchorSort', () => import('./anchor-sort'));
|
|
11
9
|
export const CommentConfig = Capability.lazy('CommentConfig', () => import('./comment-config'));
|
|
12
10
|
export const ComputeGraphRegistry = Capability.lazy('ComputeGraphRegistry', () => import('./compute-graph-registry'));
|
|
@@ -18,4 +16,5 @@ export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHan
|
|
|
18
16
|
);
|
|
19
17
|
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
20
18
|
export const SheetState = Capability.lazy('SheetState', () => import('./state'));
|
|
19
|
+
export const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));
|
|
21
20
|
export const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
|
|
10
|
+
import { SheetSkill } from '#skills';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule(() =>
|
|
13
|
+
Effect.succeed(Capability.contributes(AppCapabilities.SkillDefinition, SheetSkill)),
|
|
14
|
+
);
|
|
@@ -7,7 +7,7 @@ import { SheetRoot } from '../SheetRoot';
|
|
|
7
7
|
import { SheetStatusbar } from '../SheetStatusbar';
|
|
8
8
|
import { SheetToolbar } from '../SheetToolbar';
|
|
9
9
|
|
|
10
|
-
export {
|
|
10
|
+
export { type SheetContextValue, type SheetRootProps, useSheetContext } from '../SheetRoot';
|
|
11
11
|
export { type SheetContentProps } from '../SheetContent';
|
|
12
12
|
export { type SheetToolbarProps } from '../SheetToolbar';
|
|
13
13
|
export { type SheetStatusbarProps } from '../SheetStatusbar';
|
|
@@ -9,7 +9,7 @@ import { Client } from '@dxos/client';
|
|
|
9
9
|
import { defaultFunctions } from '@dxos/compute-hyperformula';
|
|
10
10
|
import { getRegisteredFunctionNames } from '@dxos/compute-hyperformula/testing';
|
|
11
11
|
import { Obj } from '@dxos/echo';
|
|
12
|
-
import {
|
|
12
|
+
import { Doc } from '@dxos/echo-doc';
|
|
13
13
|
import { useAsyncEffect } from '@dxos/react-hooks';
|
|
14
14
|
import { CellEditor, type CellEditorProps } from '@dxos/react-ui-grid';
|
|
15
15
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
@@ -54,7 +54,7 @@ const AutomergeStory = ({ value, ...props }: CellEditorProps) => {
|
|
|
54
54
|
|
|
55
55
|
const functionNames = getRegisteredFunctionNames();
|
|
56
56
|
const functions = defaultFunctions.filter(({ name }) => functionNames.includes(name));
|
|
57
|
-
const accessor =
|
|
57
|
+
const accessor = Doc.createAccessor(object, ['cells', cell, 'value']);
|
|
58
58
|
return [automerge(accessor), sheetExtension({ functions })];
|
|
59
59
|
}, [object]);
|
|
60
60
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { inRange } from '@dxos/compute-hyperformula';
|
|
8
|
-
import {
|
|
8
|
+
import { Doc } from '@dxos/echo-doc';
|
|
9
9
|
import { cellClassesForFieldType, parseValue } from '@dxos/react-ui-form';
|
|
10
10
|
import {
|
|
11
11
|
type DxGridAxisMeta,
|
|
@@ -144,7 +144,7 @@ export const useSheetModelDxGridProps = (
|
|
|
144
144
|
const [rows, setRows] = useState<DxGridAxisMeta>(createDxGridRows(model));
|
|
145
145
|
|
|
146
146
|
useEffect(() => {
|
|
147
|
-
const cellsAccessor =
|
|
147
|
+
const cellsAccessor = Doc.createAccessor(model.sheet, ['cells']);
|
|
148
148
|
if (dxGrid) {
|
|
149
149
|
dxGrid.getCells = cellGetter(model);
|
|
150
150
|
}
|
|
@@ -160,8 +160,8 @@ export const useSheetModelDxGridProps = (
|
|
|
160
160
|
}, [model, dxGrid]);
|
|
161
161
|
|
|
162
162
|
useEffect(() => {
|
|
163
|
-
const columnMetaAccessor =
|
|
164
|
-
const rowMetaAccessor =
|
|
163
|
+
const columnMetaAccessor = Doc.createAccessor(model.sheet, ['columnMeta']);
|
|
164
|
+
const rowMetaAccessor = Doc.createAccessor(model.sheet, ['rowMeta']);
|
|
165
165
|
const handleColumnMetaUpdate = () => {
|
|
166
166
|
setColumns(createDxGridColumns(model));
|
|
167
167
|
};
|
|
@@ -37,7 +37,7 @@ export const RangeList = ({ sheet: sheetProp }: RangeListProps) => {
|
|
|
37
37
|
<Input.Root>
|
|
38
38
|
<Input.Label>{t('range-list.heading')}</Input.Label>
|
|
39
39
|
</Input.Root>
|
|
40
|
-
{sheet.ranges.length
|
|
40
|
+
{sheet.ranges.length === 0 ? (
|
|
41
41
|
<Message.Root>
|
|
42
42
|
<Message.Title>{t('no-ranges.message')}</Message.Title>
|
|
43
43
|
</Message.Root>
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { CollectionModel } from '@dxos/app-toolkit';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Obj } from '@dxos/echo';
|
|
10
|
+
|
|
11
|
+
import { Sheet, SheetOperation } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof SheetOperation.Create> = SheetOperation.Create.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ name, rows, columns }) {
|
|
16
|
+
const object = yield* Database.add(Sheet.make({ name, rows, columns }));
|
|
17
|
+
yield* CollectionModel.add({ object }).pipe(Effect.catchTag('EntityNotFoundError', () => Effect.void));
|
|
18
|
+
yield* Database.flush();
|
|
19
|
+
return { id: Obj.getURI(object) };
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default handler;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { addressFromA1Notation, addressToA1Notation, isFormula } from '@dxos/compute-hyperformula';
|
|
9
|
+
import { Database } from '@dxos/echo';
|
|
10
|
+
|
|
11
|
+
import { SheetOperation, addressFromIndex, addressToIndex, mapFormulaIndicesToRefs } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof SheetOperation.GetValues> = SheetOperation.GetValues.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ sheet: sheetRef, range }) {
|
|
16
|
+
const sheet = yield* Database.load(sheetRef);
|
|
17
|
+
|
|
18
|
+
let fromRow: number;
|
|
19
|
+
let fromCol: number;
|
|
20
|
+
let toRow: number;
|
|
21
|
+
let toCol: number;
|
|
22
|
+
|
|
23
|
+
if (range) {
|
|
24
|
+
const [fromPart, toPart = fromPart] = range.split(':');
|
|
25
|
+
const from = addressFromA1Notation(fromPart);
|
|
26
|
+
const to = addressFromA1Notation(toPart);
|
|
27
|
+
fromRow = from.row;
|
|
28
|
+
fromCol = from.col;
|
|
29
|
+
toRow = to.row;
|
|
30
|
+
toCol = to.col;
|
|
31
|
+
} else {
|
|
32
|
+
let minRow = Infinity;
|
|
33
|
+
let minCol = Infinity;
|
|
34
|
+
let maxRow = -1;
|
|
35
|
+
let maxCol = -1;
|
|
36
|
+
for (const key of Object.keys(sheet.cells)) {
|
|
37
|
+
const cellValue = sheet.cells[key]?.value;
|
|
38
|
+
if (cellValue !== undefined && cellValue !== null) {
|
|
39
|
+
const { row, col } = addressFromIndex(sheet, key);
|
|
40
|
+
if (row < minRow) {
|
|
41
|
+
minRow = row;
|
|
42
|
+
}
|
|
43
|
+
if (row > maxRow) {
|
|
44
|
+
maxRow = row;
|
|
45
|
+
}
|
|
46
|
+
if (col < minCol) {
|
|
47
|
+
minCol = col;
|
|
48
|
+
}
|
|
49
|
+
if (col > maxCol) {
|
|
50
|
+
maxCol = col;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
fromRow = minRow === Infinity ? 0 : minRow;
|
|
55
|
+
fromCol = minCol === Infinity ? 0 : minCol;
|
|
56
|
+
toRow = maxRow;
|
|
57
|
+
toCol = maxCol;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (toRow < 0) {
|
|
61
|
+
return { values: [], range: 'A1:A1' };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const values: (unknown | null)[][] = [];
|
|
65
|
+
for (let row = fromRow; row <= toRow; row++) {
|
|
66
|
+
const rowValues: (unknown | null)[] = [];
|
|
67
|
+
for (let col = fromCol; col <= toCol; col++) {
|
|
68
|
+
const idx = addressToIndex(sheet, { row, col });
|
|
69
|
+
const rawValue = sheet.cells[idx]?.value ?? null;
|
|
70
|
+
const value =
|
|
71
|
+
rawValue !== null && isFormula(String(rawValue)) ? mapFormulaIndicesToRefs(sheet, rawValue) : rawValue;
|
|
72
|
+
rowValues.push(value);
|
|
73
|
+
}
|
|
74
|
+
values.push(rowValues);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const actualRange = `${addressToA1Notation({ row: fromRow, col: fromCol })}:${addressToA1Notation({ row: toRow, col: toCol })}`;
|
|
78
|
+
return { values, range: actualRange };
|
|
79
|
+
}),
|
|
80
|
+
),
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
export default handler;
|
package/src/operations/index.ts
CHANGED
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
6
|
|
|
7
7
|
export const SheetOperationHandlerSet = OperationHandlerSet.lazy(
|
|
8
|
+
() => import('./create'),
|
|
8
9
|
() => import('./drop-axis'),
|
|
10
|
+
() => import('./get-values'),
|
|
9
11
|
() => import('./insert-axis'),
|
|
10
12
|
() => import('./restore-axis'),
|
|
11
13
|
() => import('./scroll-to-anchor'),
|
|
14
|
+
() => import('./set-values'),
|
|
12
15
|
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { addressFromA1Notation, isFormula } from '@dxos/compute-hyperformula';
|
|
9
|
+
import { Database, Obj } from '@dxos/echo';
|
|
10
|
+
|
|
11
|
+
import { SheetOperation, addressToIndex, mapFormulaRefsToIndices } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof SheetOperation.SetValues> = SheetOperation.SetValues.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ sheet: sheetRef, cells }) {
|
|
16
|
+
const sheet = yield* Database.load(sheetRef);
|
|
17
|
+
Obj.update(sheet, (sheet) => {
|
|
18
|
+
for (const [address, value] of Object.entries(cells)) {
|
|
19
|
+
const cell = addressFromA1Notation(address);
|
|
20
|
+
const idx = addressToIndex(sheet, cell);
|
|
21
|
+
const stored = isFormula(String(value)) ? mapFormulaRefsToIndices(sheet, String(value)) : value;
|
|
22
|
+
sheet.cells[idx] = { value: stored };
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export default handler;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Skill, Template } from '@dxos/compute';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
import { Sheet, SheetOperation } from '#types';
|
|
9
|
+
|
|
10
|
+
const operations = [SheetOperation.Create, SheetOperation.GetValues, SheetOperation.SetValues];
|
|
11
|
+
|
|
12
|
+
const make = () =>
|
|
13
|
+
Skill.make({
|
|
14
|
+
key: Sheet.SKILL_KEY,
|
|
15
|
+
name: 'Sheet',
|
|
16
|
+
tools: Skill.toolDefinitions({ operations }),
|
|
17
|
+
agentCanEnable: true,
|
|
18
|
+
instructions: Template.make({
|
|
19
|
+
source: trim`
|
|
20
|
+
You are an expert at working with spreadsheets.
|
|
21
|
+
The context object represents a Sheet — a collaborative spreadsheet backed by ECHO.
|
|
22
|
+
|
|
23
|
+
## Reading data
|
|
24
|
+
|
|
25
|
+
Use the \`getValues\` tool to read cell values from the sheet.
|
|
26
|
+
It returns a 2D array indexed [row][col] and the A1 range it covers.
|
|
27
|
+
Omit the \`range\` parameter to read the entire occupied area, or pass a range like "A1:C5" to read a subset.
|
|
28
|
+
|
|
29
|
+
## Writing data
|
|
30
|
+
|
|
31
|
+
Use \`setValues\` to write one or more cells at once.
|
|
32
|
+
Pass a map of A1 addresses to values, e.g. \`{ "A1": "Name", "B1": 42, "C1": "=SUM(A1:A5)" }\`.
|
|
33
|
+
Cell values can be plain scalars (string, number, boolean) or formula strings starting with "=".
|
|
34
|
+
Formula examples: "=SUM(A1:A5)", "=A1*B1", "=IF(C2>0,\"yes\",\"no\")".
|
|
35
|
+
Over 400 HyperFormula functions are available: arithmetic, statistical, text, date/time, financial, logical.
|
|
36
|
+
|
|
37
|
+
`,
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const skill: Skill.Definition = {
|
|
42
|
+
key: Sheet.SKILL_KEY,
|
|
43
|
+
make,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default skill;
|
package/src/types/Sheet.ts
CHANGED
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
import * as Schema from 'effect/Schema';
|
|
8
8
|
|
|
9
|
+
import { AppAnnotation } from '@dxos/app-toolkit';
|
|
9
10
|
import { addressFromA1Notation, isFormula } from '@dxos/compute-hyperformula';
|
|
10
|
-
import {
|
|
11
|
+
import { Annotation, DXN, Obj, Type } from '@dxos/echo';
|
|
11
12
|
import { FormInputAnnotation } from '@dxos/echo/Annotation';
|
|
13
|
+
import { CollectionItemAnnotation } from '@dxos/schema';
|
|
12
14
|
|
|
13
15
|
import { addressToIndex, initialize, mapFormulaRefsToIndices } from './util';
|
|
14
16
|
|
|
17
|
+
export const SKILL_KEY = 'org.dxos.skill.sheet';
|
|
18
|
+
|
|
15
19
|
export type SheetSize = {
|
|
16
20
|
rows: number;
|
|
17
21
|
columns: number;
|
|
@@ -42,32 +46,33 @@ export const RowColumnMeta = Schema.Struct({
|
|
|
42
46
|
|
|
43
47
|
// TODO(burdon): Reconcile col/column (across packages).
|
|
44
48
|
// TODO(burdon): Index to all updates when rows/columns are inserted/deleted.
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Sparse map of cells referenced by index.
|
|
49
|
-
cells: Schema.Record({ key: Schema.String, value: CellValue }).pipe(FormInputAnnotation.set(false)),
|
|
49
|
+
export class Sheet extends Type.makeObject<Sheet>(DXN.make('org.dxos.type.sheet', '0.1.0'))(
|
|
50
|
+
Schema.Struct({
|
|
51
|
+
name: Schema.optional(Schema.String),
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
// Sparse map of cells referenced by index.
|
|
54
|
+
cells: Schema.Record({ key: Schema.String, value: CellValue }).pipe(FormInputAnnotation.set(false)),
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
// Ordered row indices.
|
|
57
|
+
rows: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
// Ordered column indices.
|
|
60
|
+
columns: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),
|
|
59
61
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
// Row metadata referenced by index.
|
|
63
|
+
rowMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}).pipe(
|
|
66
|
-
Annotation.IconAnnotation.set({ icon: 'ph--grid-nine--regular', hue: 'indigo' }),
|
|
67
|
-
Type.makeObject(DXN.make('org.dxos.type.sheet', '0.1.0')),
|
|
68
|
-
);
|
|
65
|
+
// Column metadata referenced by index.
|
|
66
|
+
columnMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),
|
|
69
67
|
|
|
70
|
-
|
|
68
|
+
// Cell formatting referenced by indexed range.
|
|
69
|
+
ranges: Schema.Array(Range).pipe(FormInputAnnotation.set(false)),
|
|
70
|
+
}).pipe(
|
|
71
|
+
Annotation.IconAnnotation.set({ icon: 'ph--grid-nine--regular', hue: 'indigo' }),
|
|
72
|
+
AppAnnotation.SkillsAnnotation.set([SKILL_KEY]),
|
|
73
|
+
CollectionItemAnnotation.set(true),
|
|
74
|
+
),
|
|
75
|
+
) {}
|
|
71
76
|
|
|
72
77
|
export type SheetProps = {
|
|
73
78
|
name?: string;
|