@dxos/plugin-sheet 0.9.0 → 0.9.1-staging.ee54ba693a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/neutral/RangeList-EIJTFS7P.mjs +53 -0
- package/dist/lib/neutral/RangeList-EIJTFS7P.mjs.map +7 -0
- package/dist/lib/neutral/{SheetArticle-5AJRM3V3.mjs → SheetArticle-IUPQYGUU.mjs} +3 -2
- package/dist/lib/neutral/SheetArticle-IUPQYGUU.mjs.map +7 -0
- package/dist/lib/neutral/SheetPlugin.mjs +5 -7
- package/dist/lib/neutral/SheetPlugin.mjs.map +4 -4
- package/dist/lib/neutral/capabilities/index.mjs +6 -8
- package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
- package/dist/lib/neutral/{chunk-KUWATEHB.mjs → chunk-HY4DM35G.mjs} +101 -9
- package/dist/lib/neutral/chunk-HY4DM35G.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TDGEOMRG.mjs +8 -0
- package/dist/lib/neutral/{chunk-BGR7FVNF.mjs.map → chunk-TDGEOMRG.mjs.map} +2 -2
- package/dist/lib/neutral/chunk-WTSCOM64.mjs +45 -0
- package/dist/lib/neutral/chunk-WTSCOM64.mjs.map +7 -0
- 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 +14 -14
- package/dist/lib/neutral/components/index.mjs.map +3 -3
- package/dist/lib/neutral/containers/index.mjs +2 -2
- 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-TDQQ24IB.mjs → create-object-5WEY5XZJ.mjs} +2 -6
- package/dist/lib/neutral/create-object-5WEY5XZJ.mjs.map +7 -0
- package/dist/lib/neutral/{drop-axis-WSWFOLQN.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 +3 -9
- package/dist/lib/neutral/{insert-axis-6UQJTIWC.mjs → insert-axis-WD6ZC3UA.mjs} +2 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/{react-surface-4H3PC4WG.mjs → react-surface-TJT6F2E4.mjs} +2 -6
- package/dist/lib/neutral/react-surface-TJT6F2E4.mjs.map +7 -0
- package/dist/lib/neutral/{restore-axis-AMMVTPS3.mjs → restore-axis-RLPX7P3G.mjs} +2 -2
- package/dist/lib/neutral/{scroll-to-anchor-FK2CXCQR.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/translations.mjs +1 -1
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/lib/neutral/types/index.mjs +1 -1
- package/dist/lib/neutral/{undo-mappings-3FQLSTCZ.mjs → undo-mappings-O75AYIRG.mjs} +2 -2
- package/dist/lib/neutral/{undo-mappings-3FQLSTCZ.mjs.map → undo-mappings-O75AYIRG.mjs.map} +3 -3
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- 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 +9 -16
- 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 +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +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/containers/RangeList/RangeList.d.ts.map +1 -1
- package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts +1 -1
- package/dist/types/src/containers/SheetArticle/SheetArticle.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 +32 -2
- 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/SheetCapabilities.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/dx.config.ts +31 -0
- package/package.json +61 -54
- package/src/SheetPlugin.test.ts +1 -1
- package/src/SheetPlugin.tsx +4 -6
- package/src/capabilities/comment-config.ts +1 -6
- package/src/capabilities/create-object.ts +1 -4
- package/src/capabilities/index.ts +2 -9
- package/src/capabilities/react-surface.tsx +4 -5
- package/src/capabilities/skill-definition.ts +14 -0
- package/src/capabilities/undo-mappings.ts +1 -1
- package/src/components/Sheet/Sheet.tsx +1 -1
- package/src/components/SheetContent/SheetCellEditor.stories.tsx +2 -2
- package/src/components/SheetContent/SheetContent.tsx +1 -1
- package/src/components/SheetContent/util.ts +7 -7
- package/src/components/SheetToolbar/align.ts +2 -2
- package/src/components/SheetToolbar/style.ts +1 -1
- package/src/containers/RangeList/RangeList.tsx +36 -20
- package/src/containers/SheetArticle/SheetArticle.tsx +2 -2
- package/src/index.ts +0 -1
- package/src/meta.ts +2 -24
- 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/translations.ts +1 -1
- package/src/types/Sheet.ts +26 -21
- package/src/types/SheetCapabilities.ts +2 -2
- package/src/types/SheetOperation.ts +62 -1
- package/src/types/util.ts +8 -1
- package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs +0 -46
- package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs.map +0 -7
- package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-2QP6GYB2.mjs +0 -67
- package/dist/lib/neutral/app-graph-builder-2QP6GYB2.mjs.map +0 -7
- package/dist/lib/neutral/chunk-BGR7FVNF.mjs +0 -8
- package/dist/lib/neutral/chunk-FQHTXKMF.mjs +0 -34
- package/dist/lib/neutral/chunk-FQHTXKMF.mjs.map +0 -7
- package/dist/lib/neutral/chunk-KUWATEHB.mjs.map +0 -7
- package/dist/lib/neutral/chunk-S2UNH6VD.mjs +0 -10
- package/dist/lib/neutral/chunk-S2UNH6VD.mjs.map +0 -7
- package/dist/lib/neutral/comment-config-WGXXX5FG.mjs.map +0 -7
- package/dist/lib/neutral/create-object-TDQQ24IB.mjs.map +0 -7
- package/dist/lib/neutral/navigation-resolver-FXEZYO7G.mjs +0 -14
- package/dist/lib/neutral/navigation-resolver-FXEZYO7G.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-4H3PC4WG.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 -63
- package/src/capabilities/navigation-resolver.ts +0 -16
- package/src/paths.ts +0 -11
- /package/dist/lib/neutral/{drop-axis-WSWFOLQN.mjs.map → drop-axis-JPFU5CJO.mjs.map} +0 -0
- /package/dist/lib/neutral/{insert-axis-6UQJTIWC.mjs.map → insert-axis-WD6ZC3UA.mjs.map} +0 -0
- /package/dist/lib/neutral/{restore-axis-AMMVTPS3.mjs.map → restore-axis-RLPX7P3G.mjs.map} +0 -0
- /package/dist/lib/neutral/{scroll-to-anchor-FK2CXCQR.mjs.map → scroll-to-anchor-6FJJQWZC.mjs.map} +0 -0
package/dx.config.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Config2 } from '@dxos/app-framework/config';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
export default Config2.make({
|
|
9
|
+
plugin: {
|
|
10
|
+
key: 'org.dxos.plugin.sheet',
|
|
11
|
+
name: 'Sheet',
|
|
12
|
+
author: 'DXOS',
|
|
13
|
+
description: trim`
|
|
14
|
+
Full-featured spreadsheet for DXOS Composer backed by ECHO for local-first, real-time collaborative editing.
|
|
15
|
+
Cells, row/column metadata, and range-based formatting are all stored as ECHO objects and replicated to peers instantly.
|
|
16
|
+
|
|
17
|
+
Formula evaluation is powered by HyperFormula, providing over 400 built-in functions covering arithmetic, statistics,
|
|
18
|
+
text manipulation, date/time, financial, and logical operations. Formulas are stored with internal cell indices and
|
|
19
|
+
translated to A1-notation on display, keeping references stable across row and column insertions.
|
|
20
|
+
|
|
21
|
+
The plugin integrates with plugin-markdown to expose formula results inside document fenced code blocks, and
|
|
22
|
+
contributes anchor-navigation support so other plugins can scroll and highlight specific cell ranges by DXN reference.
|
|
23
|
+
AI agents can invoke sheet operations — insert/drop axes, scroll to anchor, and read or write cell values — through
|
|
24
|
+
the standard operations framework.
|
|
25
|
+
`,
|
|
26
|
+
icon: { key: 'ph--grid-nine--regular', hue: 'indigo' },
|
|
27
|
+
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-sheet',
|
|
28
|
+
spec: 'PLUGIN.mdl',
|
|
29
|
+
screenshots: [{ dark: 'https://dxos.network/plugin-details-sheet-dark.png' }],
|
|
30
|
+
},
|
|
31
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-sheet",
|
|
3
|
-
"version": "0.9.
|
|
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",
|
|
@@ -82,6 +87,7 @@
|
|
|
82
87
|
"types": "dist/types/src/index.d.ts",
|
|
83
88
|
"files": [
|
|
84
89
|
"dist",
|
|
90
|
+
"dx.config.ts",
|
|
85
91
|
"src",
|
|
86
92
|
"PLUGIN.mdl"
|
|
87
93
|
],
|
|
@@ -93,70 +99,71 @@
|
|
|
93
99
|
"@lezer/common": "^1.5.2",
|
|
94
100
|
"@lezer/highlight": "^1.2.3",
|
|
95
101
|
"codemirror-lang-spreadsheet": "^1.3.0",
|
|
96
|
-
"@dxos/app-framework": "0.9.
|
|
97
|
-
"@dxos/
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/
|
|
100
|
-
"@dxos/
|
|
101
|
-
"@dxos/
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/crypto": "0.9.
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/echo-react": "0.9.
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/
|
|
110
|
-
"@dxos/
|
|
111
|
-
"@dxos/
|
|
112
|
-
"@dxos/plugin-
|
|
113
|
-
"@dxos/plugin-graph": "0.9.
|
|
114
|
-
"@dxos/plugin-
|
|
115
|
-
"@dxos/
|
|
116
|
-
"@dxos/react-
|
|
117
|
-
"@dxos/
|
|
118
|
-
"@dxos/react-
|
|
119
|
-
"@dxos/react-ui-
|
|
120
|
-
"@dxos/
|
|
121
|
-
"@dxos/react-ui-
|
|
122
|
-
"@dxos/react-ui-list": "0.9.
|
|
123
|
-
"@dxos/react-ui-
|
|
124
|
-
"@dxos/
|
|
125
|
-
"@dxos/types": "0.9.
|
|
126
|
-
"@dxos/ui-editor": "0.9.
|
|
127
|
-
"@dxos/util": "0.9.
|
|
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"
|
|
128
135
|
},
|
|
129
136
|
"devDependencies": {
|
|
130
137
|
"@effect-atom/atom-react": "^0.5.0",
|
|
131
|
-
"@effect/platform": "0.96.
|
|
138
|
+
"@effect/platform": "0.96.2",
|
|
132
139
|
"@lezer/generator": "^1.8.0",
|
|
133
140
|
"@tldraw/indices": "^2.0.0-alpha.14",
|
|
134
141
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
135
|
-
"@types/react": "~19.2.
|
|
142
|
+
"@types/react": "~19.2.17",
|
|
136
143
|
"@types/react-dom": "~19.2.3",
|
|
137
|
-
"effect": "3.21.
|
|
138
|
-
"react": "~19.2.
|
|
139
|
-
"react-dom": "~19.2.
|
|
144
|
+
"effect": "3.21.4",
|
|
145
|
+
"react": "~19.2.7",
|
|
146
|
+
"react-dom": "~19.2.7",
|
|
140
147
|
"vite": "^8.0.16",
|
|
141
|
-
"@dxos/echo-generator": "0.9.
|
|
142
|
-
"@dxos/lit-grid": "0.9.
|
|
143
|
-
"@dxos/plugin-testing": "0.9.
|
|
144
|
-
"@dxos/random": "0.9.
|
|
145
|
-
"@dxos/react-ui": "0.9.
|
|
146
|
-
"@dxos/
|
|
147
|
-
"@dxos/
|
|
148
|
-
"@dxos/test-utils": "0.9.
|
|
149
|
-
"@dxos/ui-
|
|
150
|
-
"@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"
|
|
151
158
|
},
|
|
152
159
|
"peerDependencies": {
|
|
153
160
|
"@effect-atom/atom-react": "^0.5.0",
|
|
154
|
-
"@effect/platform": "0.96.
|
|
155
|
-
"effect": "3.21.
|
|
156
|
-
"react": "~19.2.
|
|
157
|
-
"react-dom": "~19.2.
|
|
158
|
-
"@dxos/
|
|
159
|
-
"@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"
|
|
160
167
|
},
|
|
161
168
|
"publishConfig": {
|
|
162
169
|
"access": "public"
|
package/src/SheetPlugin.test.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { SheetPlugin } from '#plugin';
|
|
|
12
12
|
|
|
13
13
|
import { meta } from './meta';
|
|
14
14
|
|
|
15
|
-
const moduleId = (name: string) => `${meta.
|
|
15
|
+
const moduleId = (name: string) => `${meta.profile.key}.module.${name}`;
|
|
16
16
|
|
|
17
17
|
describe('SheetPlugin', () => {
|
|
18
18
|
test('modules activate on the expected events', async ({ expect }) => {
|
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 }),
|
|
@@ -55,7 +53,7 @@ export const SheetPlugin = Plugin.define(meta).pipe(
|
|
|
55
53
|
activate: AnchorSort,
|
|
56
54
|
}),
|
|
57
55
|
AppPlugin.addPluginAssetModule({
|
|
58
|
-
asset: { pluginId: meta.
|
|
56
|
+
asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },
|
|
59
57
|
}),
|
|
60
58
|
Plugin.make,
|
|
61
59
|
);
|
|
@@ -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
|
});
|
|
@@ -3,18 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capability } from '@dxos/app-framework';
|
|
6
|
-
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
7
6
|
import { OperationHandlerSet } from '@dxos/compute';
|
|
8
7
|
|
|
9
|
-
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
10
|
-
export const NavigationResolver = Capability.lazy('NavigationResolver', () => import('./navigation-resolver'));
|
|
11
8
|
export const AnchorSort = Capability.lazy('AnchorSort', () => import('./anchor-sort'));
|
|
12
|
-
|
|
13
|
-
// wrapper needs an explicit annotation to keep the inferred type portable (TS2883).
|
|
14
|
-
export const CommentConfig: Capability.LazyCapability<
|
|
15
|
-
void,
|
|
16
|
-
Capability.Capability<typeof AppCapabilities.CommentConfig>
|
|
17
|
-
> = Capability.lazy('CommentConfig', () => import('./comment-config'));
|
|
9
|
+
export const CommentConfig = Capability.lazy('CommentConfig', () => import('./comment-config'));
|
|
18
10
|
export const ComputeGraphRegistry = Capability.lazy('ComputeGraphRegistry', () => import('./compute-graph-registry'));
|
|
19
11
|
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
20
12
|
export const Markdown = Capability.lazy('MarkdownExtension', () => import('./markdown-extension'));
|
|
@@ -24,4 +16,5 @@ export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHan
|
|
|
24
16
|
);
|
|
25
17
|
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
26
18
|
export const SheetState = Capability.lazy('SheetState', () => import('./state'));
|
|
19
|
+
export const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));
|
|
27
20
|
export const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));
|
|
@@ -20,11 +20,10 @@ export default Capability.makeModule(() =>
|
|
|
20
20
|
Surface.create({
|
|
21
21
|
id: 'sheet',
|
|
22
22
|
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
!!Obj.getDatabase(data.subject),
|
|
23
|
+
filter: AppSurface.oneOf(
|
|
24
|
+
AppSurface.object(AppSurface.Article, Sheet.Sheet, (data) => !!Obj.getDatabase(data.subject)),
|
|
25
|
+
AppSurface.object(AppSurface.Section, Sheet.Sheet, (data) => !!Obj.getDatabase(data.subject)),
|
|
26
|
+
),
|
|
28
27
|
component: ({ data, role }) => {
|
|
29
28
|
const computeGraphRegistry = useCapability(SheetCapabilities.ComputeGraphRegistry);
|
|
30
29
|
|
|
@@ -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
|
|
|
@@ -75,7 +75,7 @@ const sheetRowDefault = {
|
|
|
75
75
|
export type SheetContentProps = {};
|
|
76
76
|
|
|
77
77
|
export const SheetContent = composable<HTMLDivElement, SheetContentProps>((props, forwardedRef) => {
|
|
78
|
-
const { t } = useTranslation(meta.
|
|
78
|
+
const { t } = useTranslation(meta.profile.key);
|
|
79
79
|
const {
|
|
80
80
|
id,
|
|
81
81
|
attendableId,
|
|
@@ -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,
|
|
@@ -97,13 +97,13 @@ const gridCellGetter = (model: SheetModel) => {
|
|
|
97
97
|
|
|
98
98
|
export const rowLabelCell = (row: number) => ({
|
|
99
99
|
value: rowToA1Notation(row),
|
|
100
|
-
className: '
|
|
100
|
+
className: 'bg-axis-surface! text-axis-text text-end pe-1',
|
|
101
101
|
resizeHandle: 'row',
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
export const colLabelCell = (col: number) => ({
|
|
105
105
|
value: colToA1Notation(col),
|
|
106
|
-
className: '
|
|
106
|
+
className: 'bg-axis-surface! text-axis-text',
|
|
107
107
|
resizeHandle: 'col',
|
|
108
108
|
});
|
|
109
109
|
|
|
@@ -115,7 +115,7 @@ const cellGetter = (model: SheetModel) => {
|
|
|
115
115
|
return getGridCells(nextBounds);
|
|
116
116
|
case 'fixedStartStart': {
|
|
117
117
|
return {
|
|
118
|
-
'0,0': { className: '
|
|
118
|
+
'0,0': { className: 'bg-axis-surface!' },
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
case 'frozenColsStart':
|
|
@@ -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
|
};
|
|
@@ -50,7 +50,7 @@ export const useAlignState = (stateAtom: ToolbarStateAtom) => {
|
|
|
50
50
|
|
|
51
51
|
const createAlignGroupAction = (value?: AlignValue) =>
|
|
52
52
|
createMenuItemGroup('align', {
|
|
53
|
-
label: ['align.label', { ns: meta.
|
|
53
|
+
label: ['align.label', { ns: meta.profile.key }],
|
|
54
54
|
variant: 'toggleGroup',
|
|
55
55
|
selectCardinality: 'single',
|
|
56
56
|
value: `${alignKey}--${value}`,
|
|
@@ -104,7 +104,7 @@ const createAlignActions = ({ model, state, stateAtom, registry, cursorFallbackR
|
|
|
104
104
|
key: alignKey,
|
|
105
105
|
value: alignValue as AlignValue,
|
|
106
106
|
checked: state[alignKey] === alignValue,
|
|
107
|
-
label: [`range-value.${alignValue}.label`, { ns: meta.
|
|
107
|
+
label: [`range-value.${alignValue}.label`, { ns: meta.profile.key }],
|
|
108
108
|
icon,
|
|
109
109
|
testId: `grid.toolbar.${alignKey}.${alignValue}`,
|
|
110
110
|
},
|
|
@@ -119,7 +119,7 @@ const createStyleActions = ({ model, state, stateAtom, registry, cursorFallbackR
|
|
|
119
119
|
key: 'style',
|
|
120
120
|
value: styleValue as StyleValue,
|
|
121
121
|
icon,
|
|
122
|
-
label: [`range-value.${styleValue}.label`, { ns: meta.
|
|
122
|
+
label: [`range-value.${styleValue}.label`, { ns: meta.profile.key }],
|
|
123
123
|
checked: !!state[styleValue as StyleValue],
|
|
124
124
|
},
|
|
125
125
|
);
|
|
@@ -8,7 +8,7 @@ import React, { useCallback } from 'react';
|
|
|
8
8
|
import { rangeToA1Notation } from '@dxos/compute-hyperformula';
|
|
9
9
|
import { useObject } from '@dxos/echo-react';
|
|
10
10
|
import { Input, Message, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import {
|
|
11
|
+
import { OrderedList } from '@dxos/react-ui-list';
|
|
12
12
|
|
|
13
13
|
import { meta } from '#meta';
|
|
14
14
|
import { rangeFromIndex } from '#types';
|
|
@@ -19,7 +19,7 @@ export type RangeListProps = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export const RangeList = ({ sheet: sheetProp }: RangeListProps) => {
|
|
22
|
-
const { t } = useTranslation(meta.
|
|
22
|
+
const { t } = useTranslation(meta.profile.key);
|
|
23
23
|
const [sheet, updateSheet] = useObject(sheetProp);
|
|
24
24
|
// TODO(thure): Implement similar to comments, #8121
|
|
25
25
|
const handleSelectRange = (range: Sheet.Range) => {};
|
|
@@ -37,28 +37,44 @@ 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>
|
|
44
44
|
) : (
|
|
45
|
-
<
|
|
46
|
-
{({ items: ranges }) =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
45
|
+
<OrderedList.Root<Sheet.Range> items={sheet.ranges} isItem={Schema.is(Sheet.Range)}>
|
|
46
|
+
{({ items: ranges }) => (
|
|
47
|
+
<OrderedList.Content>
|
|
48
|
+
{ranges.map((range) => {
|
|
49
|
+
// Use the range's underlying cell range string as the stable id so deletes /
|
|
50
|
+
// re-renders don't shift row identity by array position. Reorder is not
|
|
51
|
+
// wired (DX-8121); add `OrderedList.DragHandle` + a real id strategy when it
|
|
52
|
+
// lands. We avoid `OrderedList.Title` because there's no disclosure panel
|
|
53
|
+
// for it to control here.
|
|
54
|
+
const id = range.range;
|
|
55
|
+
return (
|
|
56
|
+
<OrderedList.Item
|
|
57
|
+
key={id}
|
|
58
|
+
id={id}
|
|
59
|
+
item={range}
|
|
60
|
+
hover
|
|
61
|
+
classNames='flex items-center cursor-pointer'
|
|
62
|
+
onClick={() => handleSelectRange(range)}
|
|
63
|
+
>
|
|
64
|
+
<div className='flex grow items-center truncate px-2'>
|
|
65
|
+
{t('range.title', {
|
|
66
|
+
position: rangeToA1Notation(rangeFromIndex(sheetProp, range.range)),
|
|
67
|
+
key: t(`range-key.${range.key}.label`),
|
|
68
|
+
value: t(`range-value.${range.value}.label`),
|
|
69
|
+
})}
|
|
70
|
+
</div>
|
|
71
|
+
<OrderedList.DeleteButton onClick={() => handleDeleteRange(range)} />
|
|
72
|
+
</OrderedList.Item>
|
|
73
|
+
);
|
|
74
|
+
})}
|
|
75
|
+
</OrderedList.Content>
|
|
76
|
+
)}
|
|
77
|
+
</OrderedList.Root>
|
|
62
78
|
)}
|
|
63
79
|
</>
|
|
64
80
|
);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { type ComputeGraphRegistry } from '@dxos/compute-hyperformula';
|
|
9
9
|
import { type Space } from '@dxos/react-client/echo';
|
|
10
10
|
import { Panel } from '@dxos/react-ui';
|
|
@@ -41,7 +41,7 @@ const SheetArticleInner = ({
|
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
43
|
<Sheet.Root graph={graph} sheet={sheet} attendableId={attendableId!} ignoreAttention={ignoreAttention}>
|
|
44
|
-
<Panel.Root classNames={role ===
|
|
44
|
+
<Panel.Root classNames={role === AppSurface.Section.role && 'aspect-square'}>
|
|
45
45
|
<Panel.Toolbar asChild>
|
|
46
46
|
<Sheet.Toolbar />
|
|
47
47
|
</Panel.Toolbar>
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -3,29 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
|
-
import { DXN } from '@dxos/keys';
|
|
7
|
-
import { trim } from '@dxos/util';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
key: DXN.make('org.dxos.plugin.sheet'),
|
|
11
|
-
name: 'Sheet',
|
|
12
|
-
author: 'DXOS',
|
|
13
|
-
description: trim`
|
|
14
|
-
Full-featured spreadsheet for DXOS Composer backed by ECHO for local-first, real-time collaborative editing.
|
|
15
|
-
Cells, row/column metadata, and range-based formatting are all stored as ECHO objects and replicated to peers instantly.
|
|
7
|
+
import config from '../dx.config';
|
|
16
8
|
|
|
17
|
-
|
|
18
|
-
text manipulation, date/time, financial, and logical operations. Formulas are stored with internal cell indices and
|
|
19
|
-
translated to A1-notation on display, keeping references stable across row and column insertions.
|
|
20
|
-
|
|
21
|
-
The plugin integrates with plugin-markdown to expose formula results inside document fenced code blocks, and
|
|
22
|
-
contributes anchor-navigation support so other plugins can scroll and highlight specific cell ranges by DXN reference.
|
|
23
|
-
AI agents can invoke sheet operations — insert/drop axes, scroll to anchor, and read or write cell values — through
|
|
24
|
-
the standard operations framework.
|
|
25
|
-
`,
|
|
26
|
-
icon: 'ph--grid-nine--regular',
|
|
27
|
-
iconHue: 'indigo',
|
|
28
|
-
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-sheet',
|
|
29
|
-
spec: 'PLUGIN.mdl',
|
|
30
|
-
screenshots: ['https://dxos.network/plugin-details-sheet-dark.png'],
|
|
31
|
-
});
|
|
9
|
+
export const meta = Plugin.getMetaFromConfig(config);
|
|
@@ -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;
|