@dxos/plugin-pipeline 0.8.4-main.fcfe5033a5 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/PLUGIN.mdl +345 -0
- package/README.md +1 -1
- package/dist/lib/neutral/PipelineArticle-6JIVXMYF.mjs +69 -0
- package/dist/lib/neutral/PipelineArticle-6JIVXMYF.mjs.map +7 -0
- package/dist/lib/neutral/PipelinePlugin.mjs +38 -0
- package/dist/lib/neutral/PipelinePlugin.mjs.map +7 -0
- package/dist/lib/neutral/PipelinePlugin.node.mjs +21 -0
- package/dist/lib/neutral/PipelinePlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/PipelinePlugin.workerd.mjs +16 -0
- package/dist/lib/neutral/PipelinePlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/PipelineProperties-JZQYG2CN.mjs +209 -0
- package/dist/lib/neutral/PipelineProperties-JZQYG2CN.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-ZLGRWRJU.mjs +44 -0
- package/dist/lib/neutral/app-graph-builder-ZLGRWRJU.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CYXDAAKN.mjs +35 -0
- package/dist/lib/neutral/chunk-CYXDAAKN.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +203 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-6Z4MMGX4.mjs +26 -0
- package/dist/lib/neutral/create-object-6Z4MMGX4.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +69 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +7 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +11 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-QG7QSZSS.mjs +49 -0
- package/dist/lib/neutral/react-surface-QG7QSZSS.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +39 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/PipelinePlugin.d.ts +1 -0
- package/dist/types/src/PipelinePlugin.d.ts.map +1 -1
- package/dist/types/src/PipelinePlugin.node.d.ts +4 -0
- package/dist/types/src/PipelinePlugin.node.d.ts.map +1 -0
- package/dist/types/src/PipelinePlugin.test.d.ts +2 -0
- package/dist/types/src/PipelinePlugin.test.d.ts.map +1 -0
- package/dist/types/src/PipelinePlugin.workerd.d.ts +4 -0
- package/dist/types/src/PipelinePlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/PipelineComponent/PipelineColumn.d.ts +4 -4
- package/dist/types/src/components/PipelineComponent/PipelineColumn.d.ts.map +1 -1
- package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts +4 -0
- package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts.map +1 -1
- package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts +44 -25
- package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts.map +1 -1
- package/dist/types/src/containers/PipelineArticle/PipelineArticle.d.ts +6 -0
- package/dist/types/src/containers/PipelineArticle/PipelineArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PipelineArticle/PipelineArticle.stories.d.ts +76 -0
- package/dist/types/src/containers/PipelineArticle/PipelineArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/PipelineArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PipelineArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PipelineProperties/PipelineProperties.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/usePipelineBoardModel.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 +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/templates/research.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +44 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +100 -64
- package/src/PipelinePlugin.node.ts +19 -0
- package/src/PipelinePlugin.test.ts +27 -0
- package/src/PipelinePlugin.tsx +10 -29
- package/src/PipelinePlugin.workerd.ts +16 -0
- package/src/capabilities/create-object.ts +30 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/components/PipelineComponent/PipelineColumn.tsx +23 -33
- package/src/components/PipelineComponent/PipelineComponent.stories.tsx +6 -8
- package/src/components/PipelineComponent/PipelineComponent.tsx +2 -2
- package/src/containers/{PipelineContainer/PipelineContainer.stories.tsx → PipelineArticle/PipelineArticle.stories.tsx} +18 -22
- package/src/containers/{PipelineContainer/PipelineContainer.tsx → PipelineArticle/PipelineArticle.tsx} +6 -8
- package/src/containers/PipelineArticle/index.ts +5 -0
- package/src/containers/PipelineProperties/PipelineProperties.tsx +45 -53
- package/src/containers/index.ts +1 -1
- package/src/hooks/usePipelineBoardModel.ts +8 -9
- package/src/index.ts +0 -1
- package/src/meta.ts +19 -6
- package/src/plugin.ts +9 -0
- package/src/templates/research.ts +2 -2
- package/src/translations.ts +2 -1
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/index.mjs +0 -98
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts +0 -6
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts.map +0 -1
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts +0 -57
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/PipelineContainer/index.d.ts +0 -2
- package/dist/types/src/containers/PipelineContainer/index.d.ts.map +0 -1
- package/src/containers/PipelineContainer/index.ts +0 -5
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/types/index.mjs +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-pipeline",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Pipeline plugin for Composer",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,75 +8,111 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/dxos/dxos"
|
|
10
10
|
},
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
|
-
"#capabilities":
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"#
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#components": {
|
|
22
|
+
"source": "./src/components/index.ts",
|
|
23
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#containers": {
|
|
27
|
+
"source": "./src/containers/index.ts",
|
|
28
|
+
"types": "./dist/types/src/containers/index.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/containers/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"#hooks": {
|
|
32
|
+
"source": "./src/hooks/index.ts",
|
|
33
|
+
"types": "./dist/types/src/hooks/index.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/hooks/index.mjs"
|
|
35
|
+
},
|
|
36
|
+
"#meta": {
|
|
37
|
+
"source": "./src/meta.ts",
|
|
38
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
39
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
40
|
+
},
|
|
41
|
+
"#plugin": {
|
|
42
|
+
"source": {
|
|
43
|
+
"workerd": "./src/PipelinePlugin.workerd.ts",
|
|
44
|
+
"node": "./src/PipelinePlugin.node.ts",
|
|
45
|
+
"default": "./src/PipelinePlugin.tsx"
|
|
46
|
+
},
|
|
47
|
+
"types": "./dist/types/src/PipelinePlugin.d.ts",
|
|
48
|
+
"workerd": "./dist/lib/neutral/PipelinePlugin.workerd.mjs",
|
|
49
|
+
"node": "./dist/lib/neutral/PipelinePlugin.node.mjs",
|
|
50
|
+
"default": "./dist/lib/neutral/PipelinePlugin.mjs"
|
|
51
|
+
},
|
|
52
|
+
"#translations": {
|
|
53
|
+
"source": "./src/translations.ts",
|
|
54
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
55
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
56
|
+
},
|
|
57
|
+
"#types": {
|
|
58
|
+
"source": "./src/types/index.ts",
|
|
59
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
60
|
+
"default": "./dist/lib/neutral/types/index.mjs"
|
|
61
|
+
}
|
|
22
62
|
},
|
|
23
63
|
"exports": {
|
|
24
64
|
".": {
|
|
25
65
|
"source": "./src/index.ts",
|
|
26
66
|
"types": "./dist/types/src/index.d.ts",
|
|
27
|
-
"
|
|
67
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
28
68
|
},
|
|
29
|
-
"./
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
69
|
+
"./assets/PLUGIN.mdl": "./PLUGIN.mdl",
|
|
70
|
+
"./plugin": {
|
|
71
|
+
"source": "./src/plugin.ts",
|
|
72
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
73
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
74
|
+
},
|
|
75
|
+
"./translations": {
|
|
76
|
+
"source": "./src/translations.ts",
|
|
77
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
78
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
33
79
|
}
|
|
34
80
|
},
|
|
35
81
|
"types": "dist/types/src/index.d.ts",
|
|
36
|
-
"typesVersions": {
|
|
37
|
-
"*": {
|
|
38
|
-
"types": [
|
|
39
|
-
"dist/types/src/types/index.d.ts"
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
82
|
"files": [
|
|
44
83
|
"dist",
|
|
45
|
-
"src"
|
|
84
|
+
"src",
|
|
85
|
+
"PLUGIN.mdl"
|
|
46
86
|
],
|
|
47
87
|
"dependencies": {
|
|
48
88
|
"@radix-ui/react-compose-refs": "1.1.1",
|
|
49
89
|
"@radix-ui/react-context": "1.1.1",
|
|
50
90
|
"@radix-ui/react-slot": "1.1.2",
|
|
51
|
-
"effect": "3.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/plugin-
|
|
63
|
-
"@dxos/plugin-
|
|
64
|
-
"@dxos/plugin-
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/react-ui-
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/react-ui-
|
|
71
|
-
"@dxos/react-
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/react-ui-stack": "0.8.4-main.fcfe5033a5",
|
|
77
|
-
"@dxos/types": "0.8.4-main.fcfe5033a5",
|
|
78
|
-
"@dxos/util": "0.8.4-main.fcfe5033a5",
|
|
79
|
-
"@dxos/operation": "0.8.4-main.fcfe5033a5"
|
|
91
|
+
"effect": "3.21.3",
|
|
92
|
+
"@dxos/app-toolkit": "0.9.0",
|
|
93
|
+
"@dxos/compute": "0.9.0",
|
|
94
|
+
"@dxos/echo": "0.9.0",
|
|
95
|
+
"@dxos/echo-query": "0.9.0",
|
|
96
|
+
"@dxos/devtools": "0.9.0",
|
|
97
|
+
"@dxos/app-framework": "0.9.0",
|
|
98
|
+
"@dxos/effect": "0.9.0",
|
|
99
|
+
"@dxos/keys": "0.9.0",
|
|
100
|
+
"@dxos/log": "0.9.0",
|
|
101
|
+
"@dxos/plugin-client": "0.9.0",
|
|
102
|
+
"@dxos/plugin-graph": "0.9.0",
|
|
103
|
+
"@dxos/plugin-markdown": "0.9.0",
|
|
104
|
+
"@dxos/plugin-inbox": "0.9.0",
|
|
105
|
+
"@dxos/react-client": "0.9.0",
|
|
106
|
+
"@dxos/react-ui-attention": "0.9.0",
|
|
107
|
+
"@dxos/react-ui-form": "0.9.0",
|
|
108
|
+
"@dxos/react-ui-list": "0.9.0",
|
|
109
|
+
"@dxos/plugin-space": "0.9.0",
|
|
110
|
+
"@dxos/react-ui-menu": "0.9.0",
|
|
111
|
+
"@dxos/react-ui-mosaic": "0.9.0",
|
|
112
|
+
"@dxos/schema": "0.9.0",
|
|
113
|
+
"@dxos/react-ui-stack": "0.9.0",
|
|
114
|
+
"@dxos/types": "0.9.0",
|
|
115
|
+
"@dxos/util": "0.9.0"
|
|
80
116
|
},
|
|
81
117
|
"devDependencies": {
|
|
82
118
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -84,25 +120,25 @@
|
|
|
84
120
|
"@types/react-dom": "~19.2.3",
|
|
85
121
|
"react": "~19.2.3",
|
|
86
122
|
"react-dom": "~19.2.3",
|
|
87
|
-
"vite": "^
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/plugin-
|
|
90
|
-
"@dxos/plugin-attention": "0.
|
|
91
|
-
"@dxos/plugin-
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
94
|
-
"@dxos/
|
|
95
|
-
"@dxos/react-ui": "0.
|
|
96
|
-
"@dxos/
|
|
97
|
-
"@dxos/
|
|
123
|
+
"vite": "^8.0.16",
|
|
124
|
+
"@dxos/plugin-inbox": "0.9.0",
|
|
125
|
+
"@dxos/plugin-preview": "0.9.0",
|
|
126
|
+
"@dxos/plugin-attention": "0.9.0",
|
|
127
|
+
"@dxos/plugin-theme": "0.9.0",
|
|
128
|
+
"@dxos/echo-client": "0.9.0",
|
|
129
|
+
"@dxos/random": "0.9.0",
|
|
130
|
+
"@dxos/plugin-testing": "0.9.0",
|
|
131
|
+
"@dxos/react-ui": "0.9.0",
|
|
132
|
+
"@dxos/ui-theme": "0.9.0",
|
|
133
|
+
"@dxos/storybook-utils": "0.9.0"
|
|
98
134
|
},
|
|
99
135
|
"peerDependencies": {
|
|
100
136
|
"@effect-atom/atom-react": "^0.5.0",
|
|
101
|
-
"effect": "3.
|
|
137
|
+
"effect": "3.21.3",
|
|
102
138
|
"react": "~19.2.3",
|
|
103
139
|
"react-dom": "~19.2.3",
|
|
104
|
-
"@dxos/react-ui": "0.
|
|
105
|
-
"@dxos/ui-theme": "0.
|
|
140
|
+
"@dxos/react-ui": "0.9.0",
|
|
141
|
+
"@dxos/ui-theme": "0.9.0"
|
|
106
142
|
},
|
|
107
143
|
"publishConfig": {
|
|
108
144
|
"access": "public"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
import { Pipeline } from '@dxos/types';
|
|
8
|
+
|
|
9
|
+
import { AppGraphBuilder, CreateObject } from '#capabilities';
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
|
|
12
|
+
export const PipelinePlugin = Plugin.define(meta).pipe(
|
|
13
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
14
|
+
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
15
|
+
AppPlugin.addSchemaModule({ schema: [Pipeline.Pipeline] }),
|
|
16
|
+
Plugin.make,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default PipelinePlugin;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
8
|
+
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
9
|
+
|
|
10
|
+
import { PipelinePlugin } from '#plugin';
|
|
11
|
+
|
|
12
|
+
import { meta } from './meta';
|
|
13
|
+
|
|
14
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
15
|
+
|
|
16
|
+
describe('PipelinePlugin', () => {
|
|
17
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
18
|
+
await using harness = await createComposerTestApp({
|
|
19
|
+
plugins: [ClientPlugin({}), PipelinePlugin()],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// After autoStart: AppGraphBuilder, CreateObject, schema all auto-cascade.
|
|
23
|
+
expect(harness.manager.getActive()).toEqual(
|
|
24
|
+
expect.arrayContaining([moduleId('AppGraphBuilder'), moduleId('CreateObject'), moduleId('schema')]),
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
});
|
package/src/PipelinePlugin.tsx
CHANGED
|
@@ -2,46 +2,27 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Option from 'effect/Option';
|
|
7
|
-
|
|
8
5
|
import { Plugin } from '@dxos/app-framework';
|
|
9
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
-
import { Annotation } from '@dxos/echo';
|
|
11
|
-
import { Operation } from '@dxos/operation';
|
|
12
|
-
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
13
|
-
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
14
7
|
import { Pipeline } from '@dxos/types';
|
|
15
8
|
|
|
16
|
-
import { AppGraphBuilder, ReactSurface } from '#capabilities';
|
|
9
|
+
import { AppGraphBuilder, CreateObject, ReactSurface } from '#capabilities';
|
|
17
10
|
import { meta } from '#meta';
|
|
11
|
+
import { translations } from '#translations';
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
// eslint-disable-next-line import/no-relative-packages
|
|
14
|
+
import pluginSpec from '../PLUGIN.mdl?raw';
|
|
20
15
|
|
|
21
16
|
export const PipelinePlugin = Plugin.define(meta).pipe(
|
|
22
17
|
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
23
|
-
AppPlugin.
|
|
24
|
-
metadata: {
|
|
25
|
-
id: Pipeline.Pipeline.typename,
|
|
26
|
-
metadata: {
|
|
27
|
-
icon: Annotation.IconAnnotation.get(Pipeline.Pipeline).pipe(Option.getOrThrow).icon,
|
|
28
|
-
iconHue: Annotation.IconAnnotation.get(Pipeline.Pipeline).pipe(Option.getOrThrow).hue ?? 'white',
|
|
29
|
-
createObject: ((props, options) =>
|
|
30
|
-
Effect.gen(function* () {
|
|
31
|
-
const object = Pipeline.make(props);
|
|
32
|
-
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
33
|
-
object,
|
|
34
|
-
target: options.target,
|
|
35
|
-
hidden: true,
|
|
36
|
-
targetNodeId: options.targetNodeId,
|
|
37
|
-
});
|
|
38
|
-
})) satisfies CreateObject,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
}),
|
|
42
|
-
|
|
18
|
+
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
43
19
|
AppPlugin.addSchemaModule({ schema: [Pipeline.Pipeline] }),
|
|
44
20
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
45
21
|
AppPlugin.addTranslationsModule({ translations }),
|
|
22
|
+
AppPlugin.addPluginAssetModule({
|
|
23
|
+
asset: { pluginId: meta.id, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },
|
|
24
|
+
}),
|
|
46
25
|
Plugin.make,
|
|
47
26
|
);
|
|
27
|
+
|
|
28
|
+
export default PipelinePlugin;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
import { Pipeline } from '@dxos/types';
|
|
8
|
+
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
|
|
11
|
+
export const PipelinePlugin = Plugin.define(meta).pipe(
|
|
12
|
+
AppPlugin.addSchemaModule({ schema: [Pipeline.Pipeline] }),
|
|
13
|
+
Plugin.make,
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default PipelinePlugin;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Type } from '@dxos/echo';
|
|
10
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
11
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
12
|
+
import { Pipeline } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
17
|
+
id: Type.getTypename(Pipeline.Pipeline),
|
|
18
|
+
createObject: (props, options) =>
|
|
19
|
+
Effect.gen(function* () {
|
|
20
|
+
const object = Pipeline.make(props);
|
|
21
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
22
|
+
object,
|
|
23
|
+
target: options.target,
|
|
24
|
+
hidden: true,
|
|
25
|
+
targetNodeId: options.targetNodeId,
|
|
26
|
+
});
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
}),
|
|
30
|
+
);
|
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
import { Capability } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
8
|
+
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
8
9
|
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -13,7 +13,7 @@ import { Obj } from '@dxos/echo';
|
|
|
13
13
|
import { Panel } from '@dxos/react-ui';
|
|
14
14
|
import { Pipeline } from '@dxos/types';
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import { PipelineArticle, PipelineProperties } from '#containers';
|
|
17
17
|
|
|
18
18
|
export default Capability.makeModule(() =>
|
|
19
19
|
Effect.succeed(
|
|
@@ -22,7 +22,7 @@ export default Capability.makeModule(() =>
|
|
|
22
22
|
id: 'root',
|
|
23
23
|
filter: AppSurface.object(AppSurface.Article, Pipeline.Pipeline),
|
|
24
24
|
component: ({ data, role }) => (
|
|
25
|
-
<
|
|
25
|
+
<PipelineArticle role={role} subject={data.subject} attendableId={data.attendableId} />
|
|
26
26
|
),
|
|
27
27
|
}),
|
|
28
28
|
Surface.create({
|
|
@@ -44,7 +44,7 @@ export default Capability.makeModule(() =>
|
|
|
44
44
|
},
|
|
45
45
|
}),
|
|
46
46
|
Surface.create({
|
|
47
|
-
id: '
|
|
47
|
+
id: 'objectProperties',
|
|
48
48
|
filter: AppSurface.object(AppSurface.ObjectProperties, Pipeline.Pipeline),
|
|
49
49
|
component: ({ data }) => <PipelineProperties pipeline={data.subject} />,
|
|
50
50
|
}),
|
|
@@ -3,14 +3,11 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { useComposedRefs } from '@radix-ui/react-compose-refs';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
8
|
-
import type * as Schema from 'effect/Schema';
|
|
9
6
|
import React, { forwardRef, useMemo, useRef, useState } from 'react';
|
|
10
7
|
|
|
11
8
|
import { resolveSchemaWithRegistry } from '@dxos/app-toolkit/query';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
9
|
+
import { Filter, Obj, Query, Type } from '@dxos/echo';
|
|
10
|
+
import { useObject } from '@dxos/react-client/echo';
|
|
14
11
|
import { Panel, Toolbar, useAsyncEffect, useTranslation } from '@dxos/react-ui';
|
|
15
12
|
import { Card } from '@dxos/react-ui';
|
|
16
13
|
import { Menu } from '@dxos/react-ui-menu';
|
|
@@ -33,13 +30,13 @@ export type PipelineColumnProps = Pick<MosaicTileProps<Pipeline.Column>, 'classN
|
|
|
33
30
|
// TODO(wittjosiah): Support item DnD reordering (ordering needs to be stored on the view presentation collection).
|
|
34
31
|
export const PipelineColumn = ({ data: column, location, classNames, debug }: PipelineColumnProps) => {
|
|
35
32
|
const { t } = useTranslation(meta.id);
|
|
36
|
-
const
|
|
33
|
+
const [dragHandle, setDragHandle] = useState<HTMLButtonElement | null>(null);
|
|
37
34
|
// Subscribe to the view target for reactivity.
|
|
38
35
|
const [viewSnapshot] = useObject(column.view);
|
|
39
36
|
const view = column.view.target;
|
|
40
|
-
const
|
|
37
|
+
const db = view && Obj.getDatabase(view);
|
|
41
38
|
const { Item } = usePipeline(PIPELINE_COLUMN_NAME);
|
|
42
|
-
const [
|
|
39
|
+
const [type, setType] = useState<Type.AnyEntity>();
|
|
43
40
|
const query = useMemo(() => {
|
|
44
41
|
if (!view) {
|
|
45
42
|
return Query.select(Filter.nothing());
|
|
@@ -51,24 +48,23 @@ export const PipelineColumn = ({ data: column, location, classNames, debug }: Pi
|
|
|
51
48
|
}, [JSON.stringify(viewSnapshot?.query.ast)]);
|
|
52
49
|
|
|
53
50
|
useAsyncEffect(async () => {
|
|
54
|
-
if (!query || !
|
|
51
|
+
if (!query || !db) {
|
|
55
52
|
return;
|
|
56
53
|
}
|
|
57
54
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
}, [
|
|
55
|
+
const type = await resolveSchemaWithRegistry(db, query.ast);
|
|
56
|
+
setType(() => type);
|
|
57
|
+
}, [db, query]);
|
|
61
58
|
|
|
62
59
|
const projectionModel = useMemo(() => {
|
|
63
|
-
if (!
|
|
60
|
+
if (!type || !view) {
|
|
64
61
|
return undefined;
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
//
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, [schema, view]);
|
|
64
|
+
// Use the live jsonSchema reference for reactivity.
|
|
65
|
+
const change = createEchoChangeCallback(view, Type.getDatabase(type) != null ? type : undefined);
|
|
66
|
+
return new ProjectionModel({ view, baseSchema: type.jsonSchema, change });
|
|
67
|
+
}, [type, view]);
|
|
72
68
|
|
|
73
69
|
const PipelineTile = useMemo(() => {
|
|
74
70
|
return forwardRef<HTMLDivElement, Pick<MosaicTileProps<Obj.Unknown>, 'classNames' | 'location' | 'data' | 'debug'>>(
|
|
@@ -87,13 +83,13 @@ export const PipelineColumn = ({ data: column, location, classNames, debug }: Pi
|
|
|
87
83
|
data={column}
|
|
88
84
|
location={location}
|
|
89
85
|
classNames={classNames}
|
|
90
|
-
|
|
86
|
+
dragHandle={dragHandle}
|
|
91
87
|
>
|
|
92
88
|
<Panel.Toolbar asChild>
|
|
93
89
|
<Board.Column.Header
|
|
94
90
|
classNames='_opacity-10'
|
|
95
91
|
label={column.name || t('untitled-view.title')}
|
|
96
|
-
dragHandleRef={
|
|
92
|
+
dragHandleRef={setDragHandle}
|
|
97
93
|
/>
|
|
98
94
|
</Panel.Toolbar>
|
|
99
95
|
<Panel.Content asChild>
|
|
@@ -121,24 +117,18 @@ const ItemTile = forwardRef<HTMLDivElement, ItemTileProps>(
|
|
|
121
117
|
const rootRef = useRef<HTMLDivElement>(null);
|
|
122
118
|
const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);
|
|
123
119
|
const { Item } = usePipeline(ITEM_TILE_NAME);
|
|
124
|
-
const icon =
|
|
125
|
-
Obj.getSchema(data),
|
|
126
|
-
Option.fromNullable,
|
|
127
|
-
Option.flatMap(Annotation.IconAnnotation.get),
|
|
128
|
-
Option.map(({ icon }) => icon),
|
|
129
|
-
Option.getOrElse(() => 'ph--placeholder--regular'),
|
|
130
|
-
);
|
|
120
|
+
const icon = Obj.getIcon(data)?.icon ?? 'ph--circle-dashed--regular';
|
|
131
121
|
|
|
132
122
|
return (
|
|
133
123
|
<Menu.Root>
|
|
134
124
|
<Mosaic.Tile asChild id={data.id} data={data} location={location} debug={debug}>
|
|
135
125
|
<Focus.Item asChild>
|
|
136
126
|
<Card.Root classNames={classNames} ref={composedRef}>
|
|
137
|
-
<Card.
|
|
127
|
+
<Card.Header>
|
|
138
128
|
<Card.Icon icon={icon} />
|
|
139
|
-
<Card.Title>{Obj.getLabel(data)}</Card.Title>
|
|
129
|
+
<Card.Title>{Obj.getLabel(data, { fallback: 'typename' })}</Card.Title>
|
|
140
130
|
{/* TODO(wittjosiah): Reconcile with Card.Menu. */}
|
|
141
|
-
<Card.IconBlock
|
|
131
|
+
<Card.IconBlock>
|
|
142
132
|
<Menu.Trigger asChild>
|
|
143
133
|
<Toolbar.IconButton
|
|
144
134
|
iconOnly
|
|
@@ -149,10 +139,10 @@ const ItemTile = forwardRef<HTMLDivElement, ItemTileProps>(
|
|
|
149
139
|
</Menu.Trigger>
|
|
150
140
|
<Menu.Content />
|
|
151
141
|
</Card.IconBlock>
|
|
152
|
-
</Card.
|
|
153
|
-
<Card.
|
|
142
|
+
</Card.Header>
|
|
143
|
+
<Card.Body>
|
|
154
144
|
<Item {...itemProps} />
|
|
155
|
-
</Card.
|
|
145
|
+
</Card.Body>
|
|
156
146
|
</Card.Root>
|
|
157
147
|
</Focus.Item>
|
|
158
148
|
</Mosaic.Tile>
|
|
@@ -6,9 +6,7 @@ import { RegistryContext } from '@effect-atom/atom-react';
|
|
|
6
6
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
7
|
import React, { useCallback, useContext, useEffect, useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
import { Filter, Ref } from '@dxos/
|
|
10
|
-
import { JsonSchema, Obj, Query } from '@dxos/echo';
|
|
11
|
-
import { Collection, View } from '@dxos/echo';
|
|
9
|
+
import { Collection, Filter, JsonSchema, Obj, Query, Ref, Type, View } from '@dxos/echo';
|
|
12
10
|
import { random } from '@dxos/random';
|
|
13
11
|
import { useQuery } from '@dxos/react-client/echo';
|
|
14
12
|
import { useClientStory, withClientProvider } from '@dxos/react-client/testing';
|
|
@@ -21,12 +19,12 @@ import { withRegistry } from '@dxos/storybook-utils';
|
|
|
21
19
|
import { Person, Pipeline } from '@dxos/types';
|
|
22
20
|
|
|
23
21
|
import { usePipelineBoardModel } from '#hooks';
|
|
22
|
+
import { translations } from '#translations';
|
|
24
23
|
|
|
25
|
-
import { translations } from '../../translations';
|
|
26
24
|
import { type ItemProps, PipelineComponent } from './PipelineComponent';
|
|
27
25
|
|
|
28
26
|
const StorybookProjectItem = ({ item, projectionModel }: ItemProps) => {
|
|
29
|
-
const personSchema = useMemo(() => omitId(Person.Person), []);
|
|
27
|
+
const personSchema = useMemo(() => omitId(Type.getSchema(Person.Person)), []);
|
|
30
28
|
|
|
31
29
|
if (Obj.instanceOf(Person.Person, item)) {
|
|
32
30
|
const contact = item as Obj.OfShape<Person.Person>;
|
|
@@ -64,7 +62,7 @@ const DefaultStory = () => {
|
|
|
64
62
|
fields: ['fullName'],
|
|
65
63
|
});
|
|
66
64
|
|
|
67
|
-
Obj.
|
|
65
|
+
Obj.update(pipeline, (pipeline) => {
|
|
68
66
|
pipeline.columns.push({
|
|
69
67
|
name: 'New Contacts',
|
|
70
68
|
view: Ref.make(view) as (typeof pipeline.columns)[number]['view'],
|
|
@@ -108,7 +106,7 @@ const MutationsStory = () => {
|
|
|
108
106
|
fields: ['fullName'],
|
|
109
107
|
});
|
|
110
108
|
|
|
111
|
-
Obj.
|
|
109
|
+
Obj.update(pipeline, (pipeline) => {
|
|
112
110
|
pipeline.columns.push({
|
|
113
111
|
name: 'New Contacts',
|
|
114
112
|
view: Ref.make(view) as (typeof pipeline.columns)[number]['view'],
|
|
@@ -131,7 +129,7 @@ const MutationsStory = () => {
|
|
|
131
129
|
if (p < 0.4) {
|
|
132
130
|
// Append to the name
|
|
133
131
|
const contactToAdjust = random.helpers.arrayElement(contacts);
|
|
134
|
-
Obj.
|
|
132
|
+
Obj.update(contactToAdjust, (contactToAdjust) => {
|
|
135
133
|
contactToAdjust.fullName = (contactToAdjust.fullName ?? '') + ' X';
|
|
136
134
|
});
|
|
137
135
|
return;
|
|
@@ -9,10 +9,10 @@ import React, { type FC, type PropsWithChildren } from 'react';
|
|
|
9
9
|
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
11
11
|
import { Toolbar, type ToolbarRootProps, useTranslation } from '@dxos/react-ui';
|
|
12
|
+
import { composable, composableProps, slottable } from '@dxos/react-ui';
|
|
12
13
|
import { Board, type BoardModel, useBoard, useEventHandlerAdapter } from '@dxos/react-ui-mosaic';
|
|
13
14
|
import { type ProjectionModel } from '@dxos/schema';
|
|
14
15
|
import { type Pipeline } from '@dxos/types';
|
|
15
|
-
import { composable, composableProps, slottable } from '@dxos/ui-theme';
|
|
16
16
|
|
|
17
17
|
import { meta } from '#meta';
|
|
18
18
|
|
|
@@ -97,7 +97,7 @@ const PipelineColumns = composable<HTMLDivElement, PipelineColumnsProps>(({ pipe
|
|
|
97
97
|
get: (data) => data as unknown as Obj.Unknown,
|
|
98
98
|
make: (object) => object as unknown as Pipeline.Column,
|
|
99
99
|
canDrop: ({ source }) => model.isColumn(source.data),
|
|
100
|
-
onChange: (mutate) => Obj.
|
|
100
|
+
onChange: (mutate) => Obj.update(pipeline, (pipeline) => mutate(pipeline.columns)),
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
return <Board.Content {...props} id='pipeline' eventHandler={eventHandler} Tile={PipelineColumn} />;
|