@dxos/plugin-pipeline 0.8.4-main.3fbcb4aa9b → 0.8.4-main.43cb759274
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/{PipelineContainer-7MK2SS76.mjs → PipelineArticle-6JIVXMYF.mjs} +4 -4
- package/dist/lib/neutral/PipelineArticle-6JIVXMYF.mjs.map +7 -0
- package/dist/lib/neutral/PipelinePlugin.mjs +12 -0
- package/dist/lib/neutral/PipelinePlugin.mjs.map +4 -4
- package/dist/lib/neutral/PipelinePlugin.workerd.mjs +16 -0
- package/dist/lib/neutral/PipelinePlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/{PipelineProperties-RRPQ3V6I.mjs → PipelineProperties-JXY3AVOY.mjs} +43 -44
- package/dist/lib/neutral/PipelineProperties-JXY3AVOY.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +2 -2
- 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 +19 -22
- package/dist/lib/neutral/components/index.mjs.map +3 -3
- package/dist/lib/neutral/containers/index.mjs +3 -3
- package/dist/lib/neutral/containers/index.mjs.map +3 -3
- package/dist/lib/neutral/{create-object-ZJYFACOI.mjs → create-object-6Z4MMGX4.mjs} +3 -2
- package/dist/lib/neutral/create-object-6Z4MMGX4.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +5 -5
- package/dist/lib/neutral/hooks/index.mjs.map +3 -3
- package/dist/lib/neutral/index.mjs +1 -1
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +1 -1
- package/dist/lib/neutral/{react-surface-TW6TRMO6.mjs → react-surface-QG7QSZSS.mjs} +4 -4
- package/dist/lib/neutral/react-surface-QG7QSZSS.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +2 -1
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/types/src/PipelinePlugin.d.ts.map +1 -1
- 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/create-object.d.ts.map +1 -1
- package/dist/types/src/components/PipelineComponent/PipelineColumn.d.ts.map +1 -1
- package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts.map +1 -1
- 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/{PipelineContainer/PipelineContainer.stories.d.ts → PipelineArticle/PipelineArticle.stories.d.ts} +1 -1
- 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/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -45
- package/src/PipelinePlugin.tsx +6 -0
- package/src/PipelinePlugin.workerd.ts +16 -0
- package/src/capabilities/create-object.ts +2 -1
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/components/PipelineComponent/PipelineColumn.tsx +20 -30
- package/src/components/PipelineComponent/PipelineComponent.stories.tsx +2 -4
- package/src/components/PipelineComponent/PipelineComponent.tsx +1 -1
- package/src/containers/{PipelineContainer/PipelineContainer.stories.tsx → PipelineArticle/PipelineArticle.stories.tsx} +11 -16
- package/src/containers/{PipelineContainer/PipelineContainer.tsx → PipelineArticle/PipelineArticle.tsx} +2 -2
- package/src/containers/PipelineArticle/index.ts +5 -0
- package/src/containers/PipelineProperties/PipelineProperties.tsx +53 -56
- package/src/containers/index.ts +1 -1
- package/src/hooks/usePipelineBoardModel.ts +5 -5
- package/src/meta.ts +19 -6
- package/src/translations.ts +2 -1
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/neutral/PipelineContainer-7MK2SS76.mjs.map +0 -7
- package/dist/lib/neutral/PipelineProperties-RRPQ3V6I.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ULB5DKWO.mjs +0 -21
- package/dist/lib/neutral/chunk-ULB5DKWO.mjs.map +0 -7
- package/dist/lib/neutral/create-object-ZJYFACOI.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-TW6TRMO6.mjs.map +0 -7
- 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.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-pipeline",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.43cb759274",
|
|
4
4
|
"description": "Pipeline plugin for Composer",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,7 +8,7 @@
|
|
|
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",
|
|
@@ -40,10 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"#plugin": {
|
|
42
42
|
"source": {
|
|
43
|
+
"workerd": "./src/PipelinePlugin.workerd.ts",
|
|
43
44
|
"node": "./src/PipelinePlugin.node.ts",
|
|
44
45
|
"default": "./src/PipelinePlugin.tsx"
|
|
45
46
|
},
|
|
46
47
|
"types": "./dist/types/src/PipelinePlugin.d.ts",
|
|
48
|
+
"workerd": "./dist/lib/neutral/PipelinePlugin.workerd.mjs",
|
|
47
49
|
"node": "./dist/lib/neutral/PipelinePlugin.node.mjs",
|
|
48
50
|
"default": "./dist/lib/neutral/PipelinePlugin.mjs"
|
|
49
51
|
},
|
|
@@ -64,6 +66,7 @@
|
|
|
64
66
|
"types": "./dist/types/src/index.d.ts",
|
|
65
67
|
"default": "./dist/lib/neutral/index.mjs"
|
|
66
68
|
},
|
|
69
|
+
"./assets/PLUGIN.mdl": "./PLUGIN.mdl",
|
|
67
70
|
"./plugin": {
|
|
68
71
|
"source": "./src/plugin.ts",
|
|
69
72
|
"types": "./dist/types/src/plugin.d.ts",
|
|
@@ -78,40 +81,38 @@
|
|
|
78
81
|
"types": "dist/types/src/index.d.ts",
|
|
79
82
|
"files": [
|
|
80
83
|
"dist",
|
|
81
|
-
"src"
|
|
84
|
+
"src",
|
|
85
|
+
"PLUGIN.mdl"
|
|
82
86
|
],
|
|
83
87
|
"dependencies": {
|
|
84
88
|
"@radix-ui/react-compose-refs": "1.1.1",
|
|
85
89
|
"@radix-ui/react-context": "1.1.1",
|
|
86
90
|
"@radix-ui/react-slot": "1.1.2",
|
|
87
|
-
"effect": "3.
|
|
88
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
94
|
-
"@dxos/echo-query": "0.8.4-main.
|
|
95
|
-
"@dxos/
|
|
96
|
-
"@dxos/log": "0.8.4-main.
|
|
97
|
-
"@dxos/
|
|
98
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
99
|
-
"@dxos/plugin-
|
|
100
|
-
"@dxos/plugin-
|
|
101
|
-
"@dxos/plugin-
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/react-ui-
|
|
105
|
-
"@dxos/react-ui-
|
|
106
|
-
"@dxos/react-
|
|
107
|
-
"@dxos/react-ui-mosaic": "0.8.4-main.
|
|
108
|
-
"@dxos/react-ui-
|
|
109
|
-
"@dxos/
|
|
110
|
-
"@dxos/
|
|
111
|
-
"@dxos/
|
|
112
|
-
"@dxos/schema": "0.8.4-main.3fbcb4aa9b",
|
|
113
|
-
"@dxos/react-ui-menu": "0.8.4-main.3fbcb4aa9b",
|
|
114
|
-
"@dxos/util": "0.8.4-main.3fbcb4aa9b"
|
|
91
|
+
"effect": "3.21.2",
|
|
92
|
+
"@dxos/app-framework": "0.8.4-main.43cb759274",
|
|
93
|
+
"@dxos/compute": "0.8.4-main.43cb759274",
|
|
94
|
+
"@dxos/devtools": "0.8.4-main.43cb759274",
|
|
95
|
+
"@dxos/echo": "0.8.4-main.43cb759274",
|
|
96
|
+
"@dxos/echo-atom": "0.8.4-main.43cb759274",
|
|
97
|
+
"@dxos/app-toolkit": "0.8.4-main.43cb759274",
|
|
98
|
+
"@dxos/echo-query": "0.8.4-main.43cb759274",
|
|
99
|
+
"@dxos/keys": "0.8.4-main.43cb759274",
|
|
100
|
+
"@dxos/log": "0.8.4-main.43cb759274",
|
|
101
|
+
"@dxos/plugin-graph": "0.8.4-main.43cb759274",
|
|
102
|
+
"@dxos/plugin-client": "0.8.4-main.43cb759274",
|
|
103
|
+
"@dxos/plugin-inbox": "0.8.4-main.43cb759274",
|
|
104
|
+
"@dxos/plugin-markdown": "0.8.4-main.43cb759274",
|
|
105
|
+
"@dxos/plugin-space": "0.8.4-main.43cb759274",
|
|
106
|
+
"@dxos/react-ui-attention": "0.8.4-main.43cb759274",
|
|
107
|
+
"@dxos/react-client": "0.8.4-main.43cb759274",
|
|
108
|
+
"@dxos/react-ui-form": "0.8.4-main.43cb759274",
|
|
109
|
+
"@dxos/react-ui-list": "0.8.4-main.43cb759274",
|
|
110
|
+
"@dxos/react-ui-menu": "0.8.4-main.43cb759274",
|
|
111
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.43cb759274",
|
|
112
|
+
"@dxos/react-ui-stack": "0.8.4-main.43cb759274",
|
|
113
|
+
"@dxos/util": "0.8.4-main.43cb759274",
|
|
114
|
+
"@dxos/types": "0.8.4-main.43cb759274",
|
|
115
|
+
"@dxos/schema": "0.8.4-main.43cb759274"
|
|
115
116
|
},
|
|
116
117
|
"devDependencies": {
|
|
117
118
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -119,25 +120,25 @@
|
|
|
119
120
|
"@types/react-dom": "~19.2.3",
|
|
120
121
|
"react": "~19.2.3",
|
|
121
122
|
"react-dom": "~19.2.3",
|
|
122
|
-
"vite": "^8.0.
|
|
123
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
124
|
-
"@dxos/plugin-
|
|
125
|
-
"@dxos/plugin-
|
|
126
|
-
"@dxos/
|
|
127
|
-
"@dxos/plugin-
|
|
128
|
-
"@dxos/
|
|
129
|
-
"@dxos/
|
|
130
|
-
"@dxos/
|
|
131
|
-
"@dxos/
|
|
132
|
-
"@dxos/
|
|
123
|
+
"vite": "^8.0.14",
|
|
124
|
+
"@dxos/echo-db": "0.8.4-main.43cb759274",
|
|
125
|
+
"@dxos/plugin-attention": "0.8.4-main.43cb759274",
|
|
126
|
+
"@dxos/plugin-inbox": "0.8.4-main.43cb759274",
|
|
127
|
+
"@dxos/plugin-preview": "0.8.4-main.43cb759274",
|
|
128
|
+
"@dxos/plugin-testing": "0.8.4-main.43cb759274",
|
|
129
|
+
"@dxos/plugin-theme": "0.8.4-main.43cb759274",
|
|
130
|
+
"@dxos/random": "0.8.4-main.43cb759274",
|
|
131
|
+
"@dxos/react-ui": "0.8.4-main.43cb759274",
|
|
132
|
+
"@dxos/storybook-utils": "0.8.4-main.43cb759274",
|
|
133
|
+
"@dxos/ui-theme": "0.8.4-main.43cb759274"
|
|
133
134
|
},
|
|
134
135
|
"peerDependencies": {
|
|
135
136
|
"@effect-atom/atom-react": "^0.5.0",
|
|
136
|
-
"effect": "3.
|
|
137
|
+
"effect": "3.21.2",
|
|
137
138
|
"react": "~19.2.3",
|
|
138
139
|
"react-dom": "~19.2.3",
|
|
139
|
-
"@dxos/ui
|
|
140
|
-
"@dxos/
|
|
140
|
+
"@dxos/react-ui": "0.8.4-main.43cb759274",
|
|
141
|
+
"@dxos/ui-theme": "0.8.4-main.43cb759274"
|
|
141
142
|
},
|
|
142
143
|
"publishConfig": {
|
|
143
144
|
"access": "public"
|
package/src/PipelinePlugin.tsx
CHANGED
|
@@ -10,12 +10,18 @@ import { AppGraphBuilder, CreateObject, ReactSurface } from '#capabilities';
|
|
|
10
10
|
import { meta } from '#meta';
|
|
11
11
|
import { translations } from '#translations';
|
|
12
12
|
|
|
13
|
+
// eslint-disable-next-line import/no-relative-packages
|
|
14
|
+
import pluginSpec from '../PLUGIN.mdl?raw';
|
|
15
|
+
|
|
13
16
|
export const PipelinePlugin = Plugin.define(meta).pipe(
|
|
14
17
|
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
15
18
|
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
16
19
|
AppPlugin.addSchemaModule({ schema: [Pipeline.Pipeline] }),
|
|
17
20
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
18
21
|
AppPlugin.addTranslationsModule({ translations }),
|
|
22
|
+
AppPlugin.addPluginAssetModule({
|
|
23
|
+
asset: { pluginId: meta.id, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },
|
|
24
|
+
}),
|
|
19
25
|
Plugin.make,
|
|
20
26
|
);
|
|
21
27
|
|
|
@@ -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;
|
|
@@ -6,6 +6,7 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Type } from '@dxos/echo';
|
|
9
10
|
import { SpaceOperation } from '@dxos/plugin-space';
|
|
10
11
|
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
11
12
|
import { Pipeline } from '@dxos/types';
|
|
@@ -13,7 +14,7 @@ import { Pipeline } from '@dxos/types';
|
|
|
13
14
|
export default Capability.makeModule(
|
|
14
15
|
Effect.fnUntraced(function* () {
|
|
15
16
|
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
16
|
-
id: Pipeline.Pipeline
|
|
17
|
+
id: Type.getTypename(Pipeline.Pipeline),
|
|
17
18
|
createObject: (props, options) =>
|
|
18
19
|
Effect.gen(function* () {
|
|
19
20
|
const object = Pipeline.make(props);
|
|
@@ -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';
|
|
@@ -37,9 +34,9 @@ export const PipelineColumn = ({ data: column, location, classNames, debug }: Pi
|
|
|
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'>>(
|
|
@@ -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';
|
|
@@ -26,7 +24,7 @@ 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>;
|
|
@@ -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
|
|
|
@@ -8,9 +8,7 @@ import * as Layer from 'effect/Layer';
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
-
import { Filter, Ref } from '@dxos/
|
|
12
|
-
import { Database, Feed, JsonSchema, Obj, Query, Tag } from '@dxos/echo';
|
|
13
|
-
import { Collection, View } from '@dxos/echo';
|
|
11
|
+
import { Collection, Database, Feed, Filter, JsonSchema, Obj, Query, Ref, Scope, Tag, View } from '@dxos/echo';
|
|
14
12
|
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
15
13
|
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
16
14
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
@@ -28,7 +26,7 @@ import { Message, Organization, Person, Pipeline, Task } from '@dxos/types';
|
|
|
28
26
|
import { translations } from '#translations';
|
|
29
27
|
|
|
30
28
|
import PipelineProperties from '../PipelineProperties';
|
|
31
|
-
import {
|
|
29
|
+
import { PipelineArticle } from './PipelineArticle';
|
|
32
30
|
|
|
33
31
|
random.seed(0);
|
|
34
32
|
|
|
@@ -43,14 +41,14 @@ const DefaultStory = () => {
|
|
|
43
41
|
|
|
44
42
|
return (
|
|
45
43
|
<div className='grow grid grid-cols-[1fr_350px] overflow-hidden h-full w-full'>
|
|
46
|
-
<
|
|
44
|
+
<PipelineArticle role='article' subject={pipeline} attendableId='test' />
|
|
47
45
|
<PipelineProperties pipeline={pipeline} classNames='border-s border-separator' />
|
|
48
46
|
</div>
|
|
49
47
|
);
|
|
50
48
|
};
|
|
51
49
|
|
|
52
50
|
const meta = {
|
|
53
|
-
title: 'plugins/plugin-pipeline/containers/
|
|
51
|
+
title: 'plugins/plugin-pipeline/containers/PipelineArticle',
|
|
54
52
|
render: DefaultStory,
|
|
55
53
|
decorators: [
|
|
56
54
|
withLayout({ layout: 'fullscreen' }),
|
|
@@ -75,7 +73,7 @@ const meta = {
|
|
|
75
73
|
|
|
76
74
|
yield* Effect.gen(function* () {
|
|
77
75
|
const tag = yield* Database.add(Tag.make({ label: 'important', hue: 'green' }));
|
|
78
|
-
const
|
|
76
|
+
const tagUri = Obj.getURI(tag);
|
|
79
77
|
|
|
80
78
|
// Create a view for Contacts.
|
|
81
79
|
const personView = ViewModel.make({
|
|
@@ -85,13 +83,13 @@ const meta = {
|
|
|
85
83
|
|
|
86
84
|
// Create a view for Organizations.
|
|
87
85
|
const organizationView = ViewModel.make({
|
|
88
|
-
query: Query.select(Filter.type(Organization.Organization)).select(Filter.tag(
|
|
86
|
+
query: Query.select(Filter.type(Organization.Organization)).select(Filter.tag(tagUri)),
|
|
89
87
|
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
90
88
|
});
|
|
91
89
|
|
|
92
90
|
// Create a view for Tasks.
|
|
93
91
|
const taskView = ViewModel.make({
|
|
94
|
-
query: Query.select(Filter.type(Task.Task)).select(Filter.tag(
|
|
92
|
+
query: Query.select(Filter.type(Task.Task)).select(Filter.tag(tagUri)),
|
|
95
93
|
jsonSchema: JsonSchema.toJsonSchema(Task.Task),
|
|
96
94
|
});
|
|
97
95
|
|
|
@@ -112,11 +110,8 @@ const meta = {
|
|
|
112
110
|
);
|
|
113
111
|
yield* Feed.append(messageFeed, messages);
|
|
114
112
|
|
|
115
|
-
const messageQueueDxn = Feed.getQueueDxn(messageFeed)!.toString();
|
|
116
113
|
const messageView = ViewModel.make({
|
|
117
|
-
query: Query.select(Filter.type(Message.Message)).from(
|
|
118
|
-
queues: [messageQueueDxn],
|
|
119
|
-
}),
|
|
114
|
+
query: Query.select(Filter.type(Message.Message)).from(Scope.feed(Obj.getURI(messageFeed))),
|
|
120
115
|
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
121
116
|
});
|
|
122
117
|
|
|
@@ -168,7 +163,7 @@ const meta = {
|
|
|
168
163
|
yield* Database.add(
|
|
169
164
|
Obj.make(Organization.Organization, {
|
|
170
165
|
[Obj.Meta]: {
|
|
171
|
-
tags: random.datatype.boolean() ? [
|
|
166
|
+
tags: random.datatype.boolean() ? [tagUri] : [],
|
|
172
167
|
},
|
|
173
168
|
name: random.company.name(),
|
|
174
169
|
website: random.internet.url(),
|
|
@@ -183,7 +178,7 @@ const meta = {
|
|
|
183
178
|
yield* Database.add(
|
|
184
179
|
Obj.make(Task.Task, {
|
|
185
180
|
[Obj.Meta]: {
|
|
186
|
-
tags: random.datatype.boolean() ? [
|
|
181
|
+
tags: random.datatype.boolean() ? [tagUri] : [],
|
|
187
182
|
},
|
|
188
183
|
title: random.lorem.sentence(),
|
|
189
184
|
status: random.helpers.arrayElement(['todo', 'in-progress', 'done']) as any,
|
|
@@ -221,7 +216,7 @@ const meta = {
|
|
|
221
216
|
layout: 'fullscreen',
|
|
222
217
|
translations: [...translations, ...stackTranslations],
|
|
223
218
|
},
|
|
224
|
-
} satisfies Meta<typeof
|
|
219
|
+
} satisfies Meta<typeof PipelineArticle>;
|
|
225
220
|
|
|
226
221
|
export default meta;
|
|
227
222
|
|
|
@@ -24,9 +24,9 @@ import { usePipelineBoardModel } from '#hooks';
|
|
|
24
24
|
|
|
25
25
|
const PIPELINE_ITEM = 'PipelineItem';
|
|
26
26
|
|
|
27
|
-
export type
|
|
27
|
+
export type PipelineArticleProps = AppSurface.ObjectArticleProps<Pipeline.Pipeline>;
|
|
28
28
|
|
|
29
|
-
export const
|
|
29
|
+
export const PipelineArticle = ({ role, subject: pipeline, attendableId }: PipelineArticleProps) => {
|
|
30
30
|
const registry = useCapability(Capabilities.AtomRegistry);
|
|
31
31
|
const model = usePipelineBoardModel(pipeline, registry);
|
|
32
32
|
const { invokePromise } = useOperationInvoker();
|