@dxos/plugin-pipeline 0.8.4-main.dfabb4ec29 → 0.8.4-main.effb148878
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/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.workerd.mjs +16 -0
- package/dist/lib/neutral/PipelinePlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/{PipelineProperties-RRPQ3V6I.mjs → PipelineProperties-NFNEU3NR.mjs} +41 -40
- package/dist/lib/neutral/PipelineProperties-NFNEU3NR.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +2 -2
- package/dist/lib/neutral/chunk-OVZ2ASS7.mjs +33 -0
- package/dist/lib/neutral/chunk-OVZ2ASS7.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +19 -18
- 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-4W5YLCHT.mjs} +3 -3
- package/dist/lib/neutral/react-surface-4W5YLCHT.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.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.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -42
- package/src/PipelinePlugin.workerd.ts +16 -0
- package/src/capabilities/create-object.ts +2 -1
- package/src/capabilities/react-surface.tsx +2 -2
- package/src/components/PipelineComponent/PipelineColumn.tsx +21 -22
- 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} +12 -14
- 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 +49 -56
- package/src/containers/index.ts +1 -1
- package/src/hooks/usePipelineBoardModel.ts +5 -5
- package/src/meta.ts +14 -2
- package/src/translations.ts +2 -1
- 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.effb148878",
|
|
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
|
},
|
|
@@ -85,33 +87,33 @@
|
|
|
85
87
|
"@radix-ui/react-context": "1.1.1",
|
|
86
88
|
"@radix-ui/react-slot": "1.1.2",
|
|
87
89
|
"effect": "3.20.0",
|
|
88
|
-
"@dxos/app-
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
94
|
-
"@dxos/echo
|
|
95
|
-
"@dxos/
|
|
96
|
-
"@dxos/echo-query": "0.8.4-main.
|
|
97
|
-
"@dxos/plugin-
|
|
98
|
-
"@dxos/plugin-
|
|
99
|
-
"@dxos/plugin-
|
|
100
|
-
"@dxos/plugin-
|
|
101
|
-
"@dxos/plugin-
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/react-client": "0.8.4-main.
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/react-ui-components": "0.8.4-main.
|
|
106
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
107
|
-
"@dxos/react-ui-
|
|
108
|
-
"@dxos/react-ui-
|
|
109
|
-
"@dxos/react-ui-
|
|
110
|
-
"@dxos/react-ui-
|
|
111
|
-
"@dxos/
|
|
112
|
-
"@dxos/
|
|
113
|
-
"@dxos/util": "0.8.4-main.
|
|
114
|
-
"@dxos/
|
|
90
|
+
"@dxos/app-framework": "0.8.4-main.effb148878",
|
|
91
|
+
"@dxos/app-toolkit": "0.8.4-main.effb148878",
|
|
92
|
+
"@dxos/assistant-toolkit": "0.8.4-main.effb148878",
|
|
93
|
+
"@dxos/async": "0.8.4-main.effb148878",
|
|
94
|
+
"@dxos/compute": "0.8.4-main.effb148878",
|
|
95
|
+
"@dxos/devtools": "0.8.4-main.effb148878",
|
|
96
|
+
"@dxos/echo": "0.8.4-main.effb148878",
|
|
97
|
+
"@dxos/echo-atom": "0.8.4-main.effb148878",
|
|
98
|
+
"@dxos/echo-query": "0.8.4-main.effb148878",
|
|
99
|
+
"@dxos/plugin-deck": "0.8.4-main.effb148878",
|
|
100
|
+
"@dxos/plugin-inbox": "0.8.4-main.effb148878",
|
|
101
|
+
"@dxos/plugin-client": "0.8.4-main.effb148878",
|
|
102
|
+
"@dxos/plugin-graph": "0.8.4-main.effb148878",
|
|
103
|
+
"@dxos/plugin-space": "0.8.4-main.effb148878",
|
|
104
|
+
"@dxos/log": "0.8.4-main.effb148878",
|
|
105
|
+
"@dxos/react-client": "0.8.4-main.effb148878",
|
|
106
|
+
"@dxos/plugin-markdown": "0.8.4-main.effb148878",
|
|
107
|
+
"@dxos/react-ui-components": "0.8.4-main.effb148878",
|
|
108
|
+
"@dxos/react-ui-form": "0.8.4-main.effb148878",
|
|
109
|
+
"@dxos/react-ui-attention": "0.8.4-main.effb148878",
|
|
110
|
+
"@dxos/react-ui-list": "0.8.4-main.effb148878",
|
|
111
|
+
"@dxos/react-ui-stack": "0.8.4-main.effb148878",
|
|
112
|
+
"@dxos/react-ui-menu": "0.8.4-main.effb148878",
|
|
113
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.effb148878",
|
|
114
|
+
"@dxos/types": "0.8.4-main.effb148878",
|
|
115
|
+
"@dxos/util": "0.8.4-main.effb148878",
|
|
116
|
+
"@dxos/schema": "0.8.4-main.effb148878"
|
|
115
117
|
},
|
|
116
118
|
"devDependencies": {
|
|
117
119
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -119,25 +121,25 @@
|
|
|
119
121
|
"@types/react-dom": "~19.2.3",
|
|
120
122
|
"react": "~19.2.3",
|
|
121
123
|
"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/plugin-
|
|
127
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
128
|
-
"@dxos/
|
|
129
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
130
|
-
"@dxos/
|
|
131
|
-
"@dxos/
|
|
132
|
-
"@dxos/
|
|
124
|
+
"vite": "^8.0.14",
|
|
125
|
+
"@dxos/echo-db": "0.8.4-main.effb148878",
|
|
126
|
+
"@dxos/plugin-attention": "0.8.4-main.effb148878",
|
|
127
|
+
"@dxos/plugin-inbox": "0.8.4-main.effb148878",
|
|
128
|
+
"@dxos/plugin-preview": "0.8.4-main.effb148878",
|
|
129
|
+
"@dxos/plugin-theme": "0.8.4-main.effb148878",
|
|
130
|
+
"@dxos/random": "0.8.4-main.effb148878",
|
|
131
|
+
"@dxos/react-ui": "0.8.4-main.effb148878",
|
|
132
|
+
"@dxos/storybook-utils": "0.8.4-main.effb148878",
|
|
133
|
+
"@dxos/ui-theme": "0.8.4-main.effb148878",
|
|
134
|
+
"@dxos/plugin-testing": "0.8.4-main.effb148878"
|
|
133
135
|
},
|
|
134
136
|
"peerDependencies": {
|
|
135
137
|
"@effect-atom/atom-react": "^0.5.0",
|
|
136
138
|
"effect": "3.20.0",
|
|
137
139
|
"react": "~19.2.3",
|
|
138
140
|
"react-dom": "~19.2.3",
|
|
139
|
-
"@dxos/
|
|
140
|
-
"@dxos/ui
|
|
141
|
+
"@dxos/ui-theme": "0.8.4-main.effb148878",
|
|
142
|
+
"@dxos/react-ui": "0.8.4-main.effb148878"
|
|
141
143
|
},
|
|
142
144
|
"publishConfig": {
|
|
143
145
|
"access": "public"
|
|
@@ -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({
|
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
import { useComposedRefs } from '@radix-ui/react-compose-refs';
|
|
6
6
|
import * as Function from 'effect/Function';
|
|
7
7
|
import * as Option from 'effect/Option';
|
|
8
|
-
import type * as Schema from 'effect/Schema';
|
|
9
8
|
import React, { forwardRef, useMemo, useRef, useState } from 'react';
|
|
10
9
|
|
|
11
10
|
import { resolveSchemaWithRegistry } from '@dxos/app-toolkit/query';
|
|
12
|
-
import { Annotation,
|
|
13
|
-
import {
|
|
11
|
+
import { Annotation, Filter, Obj, Query, Type } from '@dxos/echo';
|
|
12
|
+
import { useObject } from '@dxos/react-client/echo';
|
|
14
13
|
import { Panel, Toolbar, useAsyncEffect, useTranslation } from '@dxos/react-ui';
|
|
15
14
|
import { Card } from '@dxos/react-ui';
|
|
16
15
|
import { Menu } from '@dxos/react-ui-menu';
|
|
@@ -37,9 +36,9 @@ export const PipelineColumn = ({ data: column, location, classNames, debug }: Pi
|
|
|
37
36
|
// Subscribe to the view target for reactivity.
|
|
38
37
|
const [viewSnapshot] = useObject(column.view);
|
|
39
38
|
const view = column.view.target;
|
|
40
|
-
const
|
|
39
|
+
const db = view && Obj.getDatabase(view);
|
|
41
40
|
const { Item } = usePipeline(PIPELINE_COLUMN_NAME);
|
|
42
|
-
const [
|
|
41
|
+
const [type, setType] = useState<Type.AnyEntity>();
|
|
43
42
|
const query = useMemo(() => {
|
|
44
43
|
if (!view) {
|
|
45
44
|
return Query.select(Filter.nothing());
|
|
@@ -51,24 +50,23 @@ export const PipelineColumn = ({ data: column, location, classNames, debug }: Pi
|
|
|
51
50
|
}, [JSON.stringify(viewSnapshot?.query.ast)]);
|
|
52
51
|
|
|
53
52
|
useAsyncEffect(async () => {
|
|
54
|
-
if (!query || !
|
|
53
|
+
if (!query || !db) {
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
}, [
|
|
57
|
+
const type = await resolveSchemaWithRegistry(db.schemaRegistry, query.ast);
|
|
58
|
+
setType(() => type);
|
|
59
|
+
}, [db, query]);
|
|
61
60
|
|
|
62
61
|
const projectionModel = useMemo(() => {
|
|
63
|
-
if (!
|
|
62
|
+
if (!type || !view) {
|
|
64
63
|
return undefined;
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
//
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, [schema, view]);
|
|
66
|
+
// Use the live jsonSchema reference for reactivity.
|
|
67
|
+
const change = createEchoChangeCallback(view, Type.getDatabase(type) != null ? type : undefined);
|
|
68
|
+
return new ProjectionModel({ view, baseSchema: type.jsonSchema, change });
|
|
69
|
+
}, [type, view]);
|
|
72
70
|
|
|
73
71
|
const PipelineTile = useMemo(() => {
|
|
74
72
|
return forwardRef<HTMLDivElement, Pick<MosaicTileProps<Obj.Unknown>, 'classNames' | 'location' | 'data' | 'debug'>>(
|
|
@@ -122,11 +120,12 @@ const ItemTile = forwardRef<HTMLDivElement, ItemTileProps>(
|
|
|
122
120
|
const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);
|
|
123
121
|
const { Item } = usePipeline(ITEM_TILE_NAME);
|
|
124
122
|
const icon = Function.pipe(
|
|
125
|
-
Obj.
|
|
123
|
+
Obj.getType(data),
|
|
126
124
|
Option.fromNullable,
|
|
125
|
+
Option.map(Type.getSchema),
|
|
127
126
|
Option.flatMap(Annotation.IconAnnotation.get),
|
|
128
127
|
Option.map(({ icon }) => icon),
|
|
129
|
-
Option.getOrElse(() => 'ph--
|
|
128
|
+
Option.getOrElse(() => 'ph--circle-dashed--regular'),
|
|
130
129
|
);
|
|
131
130
|
|
|
132
131
|
return (
|
|
@@ -134,9 +133,9 @@ const ItemTile = forwardRef<HTMLDivElement, ItemTileProps>(
|
|
|
134
133
|
<Mosaic.Tile asChild id={data.id} data={data} location={location} debug={debug}>
|
|
135
134
|
<Focus.Item asChild>
|
|
136
135
|
<Card.Root classNames={classNames} ref={composedRef}>
|
|
137
|
-
<Card.
|
|
136
|
+
<Card.Header>
|
|
138
137
|
<Card.Icon icon={icon} />
|
|
139
|
-
<Card.Title>{Obj.getLabel(data)}</Card.Title>
|
|
138
|
+
<Card.Title>{Obj.getLabel(data, { fallback: 'typename' })}</Card.Title>
|
|
140
139
|
{/* TODO(wittjosiah): Reconcile with Card.Menu. */}
|
|
141
140
|
<Card.IconBlock padding>
|
|
142
141
|
<Menu.Trigger asChild>
|
|
@@ -149,10 +148,10 @@ const ItemTile = forwardRef<HTMLDivElement, ItemTileProps>(
|
|
|
149
148
|
</Menu.Trigger>
|
|
150
149
|
<Menu.Content />
|
|
151
150
|
</Card.IconBlock>
|
|
152
|
-
</Card.
|
|
153
|
-
<Card.
|
|
151
|
+
</Card.Header>
|
|
152
|
+
<Card.Body>
|
|
154
153
|
<Item {...itemProps} />
|
|
155
|
-
</Card.
|
|
154
|
+
</Card.Body>
|
|
156
155
|
</Card.Root>
|
|
157
156
|
</Focus.Item>
|
|
158
157
|
</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, 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,10 +110,10 @@ const meta = {
|
|
|
112
110
|
);
|
|
113
111
|
yield* Feed.append(messageFeed, messages);
|
|
114
112
|
|
|
115
|
-
const messageQueueDxn = Feed.
|
|
113
|
+
const messageQueueDxn = Feed.getQueueUri(messageFeed)!;
|
|
116
114
|
const messageView = ViewModel.make({
|
|
117
115
|
query: Query.select(Filter.type(Message.Message)).from({
|
|
118
|
-
|
|
116
|
+
feeds: [messageQueueDxn],
|
|
119
117
|
}),
|
|
120
118
|
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
121
119
|
});
|
|
@@ -168,7 +166,7 @@ const meta = {
|
|
|
168
166
|
yield* Database.add(
|
|
169
167
|
Obj.make(Organization.Organization, {
|
|
170
168
|
[Obj.Meta]: {
|
|
171
|
-
tags: random.datatype.boolean() ? [
|
|
169
|
+
tags: random.datatype.boolean() ? [tagUri] : [],
|
|
172
170
|
},
|
|
173
171
|
name: random.company.name(),
|
|
174
172
|
website: random.internet.url(),
|
|
@@ -183,7 +181,7 @@ const meta = {
|
|
|
183
181
|
yield* Database.add(
|
|
184
182
|
Obj.make(Task.Task, {
|
|
185
183
|
[Obj.Meta]: {
|
|
186
|
-
tags: random.datatype.boolean() ? [
|
|
184
|
+
tags: random.datatype.boolean() ? [tagUri] : [],
|
|
187
185
|
},
|
|
188
186
|
title: random.lorem.sentence(),
|
|
189
187
|
status: random.helpers.arrayElement(['todo', 'in-progress', 'done']) as any,
|
|
@@ -221,7 +219,7 @@ const meta = {
|
|
|
221
219
|
layout: 'fullscreen',
|
|
222
220
|
translations: [...translations, ...stackTranslations],
|
|
223
221
|
},
|
|
224
|
-
} satisfies Meta<typeof
|
|
222
|
+
} satisfies Meta<typeof PipelineArticle>;
|
|
225
223
|
|
|
226
224
|
export default meta;
|
|
227
225
|
|
|
@@ -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();
|