@dxos/plugin-pipeline 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
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/{browser/PipelineObjectSettings-D36OYVHW.mjs → neutral/PipelineProperties-JXY3AVOY.mjs} +58 -73
- package/dist/lib/neutral/PipelineProperties-JXY3AVOY.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 +70 -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/{browser/react-surface-ZGQVH4VX.mjs → neutral/react-surface-QG7QSZSS.mjs} +15 -26
- 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 +1 -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 -0
- 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 +9 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/{PipelineColumn.d.ts → PipelineComponent/PipelineColumn.d.ts} +4 -4
- package/dist/types/src/components/PipelineComponent/PipelineColumn.d.ts.map +1 -0
- package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts +53 -0
- package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts.map +1 -0
- package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts +62 -0
- package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts.map +1 -0
- package/dist/types/src/components/PipelineComponent/index.d.ts +3 -0
- package/dist/types/src/components/PipelineComponent/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.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 +11 -0
- package/dist/types/src/containers/PipelineProperties/PipelineProperties.d.ts.map +1 -0
- package/dist/types/src/containers/PipelineProperties/index.d.ts +2 -0
- package/dist/types/src/containers/PipelineProperties/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +2 -2
- 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 -25
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +103 -58
- package/src/PipelinePlugin.node.ts +19 -0
- package/src/PipelinePlugin.test.ts +27 -0
- package/src/PipelinePlugin.tsx +12 -30
- package/src/PipelinePlugin.workerd.ts +16 -0
- package/src/capabilities/app-graph-builder.ts +40 -0
- package/src/capabilities/create-object.ts +30 -0
- package/src/capabilities/index.ts +5 -3
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +16 -15
- package/src/components/PipelineComponent/PipelineColumn.tsx +154 -0
- package/src/components/{PipelineComponent.stories.tsx → PipelineComponent/PipelineComponent.stories.tsx} +21 -21
- package/src/components/{PipelineComponent.tsx → PipelineComponent/PipelineComponent.tsx} +22 -13
- package/src/components/PipelineComponent/index.ts +6 -0
- package/src/components/index.ts +0 -1
- package/src/containers/{PipelineContainer/PipelineContainer.stories.tsx → PipelineArticle/PipelineArticle.stories.tsx} +43 -47
- package/src/containers/{PipelineContainer/PipelineContainer.tsx → PipelineArticle/PipelineArticle.tsx} +14 -17
- package/src/containers/PipelineArticle/index.ts +5 -0
- package/src/containers/{PipelineObjectSettings/PipelineObjectSettings.tsx → PipelineProperties/PipelineProperties.tsx} +72 -75
- package/src/containers/PipelineProperties/index.ts +5 -0
- package/src/containers/index.ts +2 -2
- package/src/hooks/usePipelineBoardModel.ts +6 -6
- package/src/index.ts +0 -1
- package/src/meta.ts +19 -6
- package/src/plugin.ts +9 -0
- package/src/templates/research.ts +8 -7
- package/src/translations.ts +24 -22
- package/src/types/index.ts +0 -3
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/PipelineContainer-2ZYSZATA.mjs +0 -320
- package/dist/lib/browser/PipelineContainer-2ZYSZATA.mjs.map +0 -7
- package/dist/lib/browser/PipelineObjectSettings-D36OYVHW.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-NUJB33F7.mjs +0 -65
- package/dist/lib/browser/app-graph-builder-NUJB33F7.mjs.map +0 -7
- package/dist/lib/browser/chunk-N6FZHYWT.mjs +0 -42
- package/dist/lib/browser/chunk-N6FZHYWT.mjs.map +0 -7
- package/dist/lib/browser/chunk-QWNKLHBY.mjs +0 -28
- package/dist/lib/browser/chunk-QWNKLHBY.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -109
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-ZGQVH4VX.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -2
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/PipelineColumn.d.ts.map +0 -1
- package/dist/types/src/components/PipelineComponent.d.ts +0 -47
- package/dist/types/src/components/PipelineComponent.d.ts.map +0 -1
- package/dist/types/src/components/PipelineComponent.stories.d.ts +0 -42
- package/dist/types/src/components/PipelineComponent.stories.d.ts.map +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 -56
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/PipelineContainer/index.d.ts +0 -3
- package/dist/types/src/containers/PipelineContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/PipelineObjectSettings/PipelineObjectSettings.d.ts +0 -11
- package/dist/types/src/containers/PipelineObjectSettings/PipelineObjectSettings.d.ts.map +0 -1
- package/dist/types/src/containers/PipelineObjectSettings/index.d.ts +0 -3
- package/dist/types/src/containers/PipelineObjectSettings/index.d.ts.map +0 -1
- package/dist/types/src/types/PipelineAction.d.ts +0 -25
- package/dist/types/src/types/PipelineAction.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -51
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -5
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -29
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/components/PipelineColumn.tsx +0 -133
- package/src/containers/PipelineContainer/index.ts +0 -7
- package/src/containers/PipelineObjectSettings/index.ts +0 -7
- package/src/types/PipelineAction.ts +0 -29
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
|
@@ -5,66 +5,61 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { resolveSchemaWithRegistry } from '@dxos/app-toolkit/query';
|
|
9
|
+
import { useTypeOptions } from '@dxos/app-toolkit/ui';
|
|
10
|
+
import { EID, Filter, JsonSchema, Obj, Query, type QueryAST, Ref, Scope, Tag, type Type } from '@dxos/echo';
|
|
9
11
|
import { type JsonPath, type Mutable } from '@dxos/echo/internal';
|
|
10
|
-
import {
|
|
11
|
-
import { resolveSchemaWithRegistry } from '@dxos/plugin-space';
|
|
12
|
-
import { getSpace, useObject, useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { useObject, useQuery } from '@dxos/react-client/echo';
|
|
13
13
|
import { IconButton, type ThemedClassName, useAsyncEffect, useTranslation } from '@dxos/react-ui';
|
|
14
14
|
import { Form, ViewEditor } from '@dxos/react-ui-form';
|
|
15
15
|
import { List } from '@dxos/react-ui-list';
|
|
16
16
|
import { type ProjectionModel, ViewModel } from '@dxos/schema';
|
|
17
|
-
import { Pipeline
|
|
18
|
-
import { mx, osTranslations
|
|
17
|
+
import { Pipeline } from '@dxos/types';
|
|
18
|
+
import { mx, osTranslations } from '@dxos/ui-theme';
|
|
19
19
|
import { arrayMove } from '@dxos/util';
|
|
20
20
|
|
|
21
|
-
import { meta } from '
|
|
21
|
+
import { meta } from '#meta';
|
|
22
22
|
|
|
23
23
|
const listGrid = 'grid grid-cols-[min-content_1fr_min-content_min-content_min-content]';
|
|
24
24
|
const listItemGrid = 'grid grid-cols-subgrid col-span-5';
|
|
25
25
|
|
|
26
26
|
const ColumnFormSchema = Pipeline.Column.pipe(Schema.mutable, Schema.pick('name'));
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
export type PipelineObjectSettingsProps = ThemedClassName<{
|
|
28
|
+
export type PipelinePropertiesProps = ThemedClassName<{
|
|
30
29
|
pipeline: Pipeline.Pipeline;
|
|
31
30
|
}>;
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
33
|
* Supports editing the pipeline view.
|
|
35
34
|
*/
|
|
36
|
-
export const
|
|
35
|
+
export const PipelineProperties = ({ classNames, pipeline }: PipelinePropertiesProps) => {
|
|
37
36
|
const { t } = useTranslation(meta.id);
|
|
38
|
-
const
|
|
37
|
+
const db = Obj.getDatabase(pipeline);
|
|
39
38
|
const [expandedId, setExpandedId] = useState<string>();
|
|
40
39
|
const [columns, updateColumns] = useObject(pipeline, 'columns');
|
|
41
|
-
const column = useMemo(
|
|
42
|
-
() => columns.find((column) => column.view.dxn.toString() === expandedId),
|
|
43
|
-
[columns, expandedId],
|
|
44
|
-
);
|
|
40
|
+
const column = useMemo(() => columns.find((column) => column.view.uri === expandedId), [columns, expandedId]);
|
|
45
41
|
const [view, updateView] = useObject(column?.view);
|
|
46
|
-
const [
|
|
42
|
+
const [type, setType] = useState<Type.AnyEntity>();
|
|
47
43
|
const projectionRef = useRef<ProjectionModel>(null);
|
|
48
|
-
const tags = useQuery(
|
|
44
|
+
const tags = useQuery(db, Filter.type(Tag.Tag));
|
|
49
45
|
const types = useTypeOptions({
|
|
50
|
-
|
|
46
|
+
db,
|
|
51
47
|
annotation: {
|
|
52
48
|
location: ['database', 'runtime'],
|
|
53
49
|
kind: ['user'],
|
|
54
|
-
registered: ['registered', 'unregistered'],
|
|
55
50
|
},
|
|
56
51
|
});
|
|
57
52
|
|
|
58
53
|
useAsyncEffect(async () => {
|
|
59
|
-
if (!view?.query || !
|
|
54
|
+
if (!view?.query || !db) {
|
|
60
55
|
return;
|
|
61
56
|
}
|
|
62
57
|
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
|
|
58
|
+
const foundType = await resolveSchemaWithRegistry(db, view.query.ast);
|
|
59
|
+
if (foundType && foundType !== type) {
|
|
60
|
+
setType(() => foundType);
|
|
66
61
|
}
|
|
67
|
-
}, [
|
|
62
|
+
}, [db, view, type]);
|
|
68
63
|
|
|
69
64
|
const handleMove = useCallback(
|
|
70
65
|
(fromIndex: number, toIndex: number) =>
|
|
@@ -75,32 +70,36 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
75
70
|
);
|
|
76
71
|
|
|
77
72
|
const handleQueryChanged = useCallback(
|
|
78
|
-
async (newQuery: QueryAST.Query, target?:
|
|
79
|
-
if (!view || !
|
|
73
|
+
async (newQuery: QueryAST.Query, target?: EID.EID) => {
|
|
74
|
+
if (!view || !db) {
|
|
80
75
|
return;
|
|
81
76
|
}
|
|
82
77
|
|
|
83
|
-
const queue = target
|
|
84
|
-
const query = queue
|
|
78
|
+
const queue = target;
|
|
79
|
+
const query = queue
|
|
80
|
+
? Query.fromAst(newQuery).from([
|
|
81
|
+
Scope.feed(`dxn:queue:data:${EID.getSpaceId(queue)}:${EID.getEntityId(queue)}`),
|
|
82
|
+
])
|
|
83
|
+
: Query.fromAst(newQuery);
|
|
85
84
|
updateView((view) => {
|
|
86
85
|
view.query.ast = query.ast as Mutable<typeof query.ast>;
|
|
87
86
|
});
|
|
88
|
-
const
|
|
89
|
-
if (!
|
|
87
|
+
const newType = await resolveSchemaWithRegistry(db, query.ast);
|
|
88
|
+
if (!newType) {
|
|
90
89
|
return;
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
const newView = ViewModel.make({
|
|
94
93
|
query,
|
|
95
|
-
jsonSchema:
|
|
94
|
+
jsonSchema: newType.jsonSchema,
|
|
96
95
|
});
|
|
97
96
|
updateView((view) => {
|
|
98
97
|
view.projection = Obj.getSnapshot(newView).projection as Mutable<typeof view.projection>;
|
|
99
98
|
});
|
|
100
99
|
|
|
101
|
-
|
|
100
|
+
setType(() => newType);
|
|
102
101
|
},
|
|
103
|
-
[view, updateView,
|
|
102
|
+
[db, view, updateView, type],
|
|
104
103
|
);
|
|
105
104
|
|
|
106
105
|
const handleColumnValuesChanged = useCallback(
|
|
@@ -120,14 +119,12 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
120
119
|
);
|
|
121
120
|
|
|
122
121
|
const handleToggleField = useCallback((column: Pipeline.Column) => {
|
|
123
|
-
setExpandedId((prevExpandedId) =>
|
|
124
|
-
prevExpandedId === column.view.dxn.toString() ? undefined : column.view.dxn.toString(),
|
|
125
|
-
);
|
|
122
|
+
setExpandedId((prevExpandedId) => (prevExpandedId === column.view.uri ? undefined : column.view.uri));
|
|
126
123
|
}, []);
|
|
127
124
|
|
|
128
125
|
const handleDelete = useCallback(
|
|
129
126
|
async (column: Pipeline.Column) => {
|
|
130
|
-
if (column.view.
|
|
127
|
+
if (column.view.uri === expandedId) {
|
|
131
128
|
setExpandedId(undefined);
|
|
132
129
|
}
|
|
133
130
|
|
|
@@ -136,39 +133,39 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
136
133
|
updateColumns((columns) => {
|
|
137
134
|
columns.splice(index, 1);
|
|
138
135
|
});
|
|
139
|
-
|
|
136
|
+
db?.remove(viewToRemove);
|
|
140
137
|
},
|
|
141
|
-
[expandedId, columns, updateColumns,
|
|
138
|
+
[expandedId, columns, updateColumns, db],
|
|
142
139
|
);
|
|
143
140
|
|
|
144
141
|
const handleAdd = useCallback(() => {
|
|
145
|
-
if (!
|
|
142
|
+
if (!db) {
|
|
146
143
|
return;
|
|
147
144
|
}
|
|
148
145
|
const newView = ViewModel.make({
|
|
149
|
-
query: Query.select(Filter.
|
|
150
|
-
jsonSchema: JsonSchema.toJsonSchema(
|
|
146
|
+
query: Query.select(Filter.nothing()),
|
|
147
|
+
jsonSchema: JsonSchema.toJsonSchema(Schema.Struct({})),
|
|
151
148
|
});
|
|
152
|
-
|
|
149
|
+
db.add(newView);
|
|
153
150
|
updateColumns((columns) => {
|
|
154
151
|
columns.push({
|
|
155
|
-
name: '
|
|
152
|
+
name: '',
|
|
156
153
|
// Type assertion needed due to QueryAST type variance.
|
|
157
154
|
view: Ref.make(newView) as (typeof columns)[number]['view'],
|
|
158
155
|
order: [],
|
|
159
156
|
});
|
|
160
157
|
});
|
|
161
158
|
setExpandedId(newView.id);
|
|
162
|
-
}, [
|
|
159
|
+
}, [db, updateColumns]);
|
|
163
160
|
|
|
164
161
|
return (
|
|
165
|
-
<div
|
|
166
|
-
<h2 className='text-sm text-description py-1'>{t('views
|
|
162
|
+
<div className={mx('py-form-padding overflow-y-auto', classNames)}>
|
|
163
|
+
<h2 className='text-sm text-description py-1'>{t('views.label')}</h2>
|
|
167
164
|
|
|
168
165
|
<List.Root<Pipeline.Column>
|
|
169
166
|
items={columns}
|
|
170
167
|
isItem={Schema.is(Pipeline.Column)}
|
|
171
|
-
getId={(column) => column.view.
|
|
168
|
+
getId={(column) => column.view.uri}
|
|
172
169
|
onMove={handleMove}
|
|
173
170
|
>
|
|
174
171
|
{({ items: columns }) => (
|
|
@@ -176,16 +173,18 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
176
173
|
<div role='list' className={mx(listGrid)}>
|
|
177
174
|
{columns.map((column) => (
|
|
178
175
|
<List.Item<Pipeline.Column>
|
|
179
|
-
key={column.view.
|
|
176
|
+
key={column.view.uri}
|
|
180
177
|
item={column}
|
|
181
178
|
classNames={listItemGrid}
|
|
182
|
-
aria-expanded={expandedId === column.view.
|
|
179
|
+
aria-expanded={expandedId === column.view.uri}
|
|
183
180
|
>
|
|
184
|
-
<div
|
|
181
|
+
<div className={mx(listItemGrid, 'dx-hover rounded-xs cursor-pointer min-h-10')}>
|
|
185
182
|
<List.ItemDragHandle />
|
|
186
|
-
<List.ItemTitle onClick={() => handleToggleField(column)}>
|
|
183
|
+
<List.ItemTitle onClick={() => handleToggleField(column)}>
|
|
184
|
+
{column.name || t('untitled-view.title')}
|
|
185
|
+
</List.ItemTitle>
|
|
187
186
|
<List.ItemDeleteButton
|
|
188
|
-
label={t('delete
|
|
187
|
+
label={t('delete-view.label')}
|
|
189
188
|
autoHide={false}
|
|
190
189
|
onClick={() => handleDelete(column)}
|
|
191
190
|
data-testid='view.delete'
|
|
@@ -193,17 +192,13 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
193
192
|
<IconButton
|
|
194
193
|
iconOnly
|
|
195
194
|
variant='ghost'
|
|
196
|
-
label={t('toggle
|
|
197
|
-
icon={
|
|
198
|
-
expandedId === column.view.dxn.toString()
|
|
199
|
-
? 'ph--caret-down--regular'
|
|
200
|
-
: 'ph--caret-right--regular'
|
|
201
|
-
}
|
|
195
|
+
label={t('toggle-expand.label', { ns: osTranslations })}
|
|
196
|
+
icon={expandedId === column.view.uri ? 'ph--caret-down--regular' : 'ph--caret-right--regular'}
|
|
202
197
|
onClick={() => handleToggleField(column)}
|
|
203
198
|
/>
|
|
204
199
|
</div>
|
|
205
|
-
{expandedId === column.view.
|
|
206
|
-
<div
|
|
200
|
+
{expandedId === column.view.uri && column?.view.target && (
|
|
201
|
+
<div className='col-span-5 my-2 border border-separator rounded-md'>
|
|
207
202
|
<Form.Root
|
|
208
203
|
schema={ColumnFormSchema}
|
|
209
204
|
values={column}
|
|
@@ -213,18 +208,20 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
213
208
|
<Form.FieldSet />
|
|
214
209
|
</Form.Content>
|
|
215
210
|
</Form.Root>
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
211
|
+
{type && (
|
|
212
|
+
<ViewEditor
|
|
213
|
+
ref={projectionRef}
|
|
214
|
+
mode='tag'
|
|
215
|
+
readonly
|
|
216
|
+
type={type}
|
|
217
|
+
view={column.view.target}
|
|
218
|
+
registry={db?.graph.registry}
|
|
219
|
+
db={db}
|
|
220
|
+
tags={tags}
|
|
221
|
+
types={types}
|
|
222
|
+
onQueryChanged={handleQueryChanged}
|
|
223
|
+
/>
|
|
224
|
+
)}
|
|
228
225
|
</div>
|
|
229
226
|
)}
|
|
230
227
|
</List.Item>
|
|
@@ -234,8 +231,8 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
234
231
|
)}
|
|
235
232
|
</List.Root>
|
|
236
233
|
|
|
237
|
-
<div
|
|
238
|
-
<IconButton icon='ph--plus--regular' label={t('add
|
|
234
|
+
<div className='my-form-padding'>
|
|
235
|
+
<IconButton icon='ph--plus--regular' label={t('add-view.label')} onClick={handleAdd} classNames='w-full' />
|
|
239
236
|
</div>
|
|
240
237
|
</div>
|
|
241
238
|
);
|
package/src/containers/index.ts
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
7
|
+
export const PipelineArticle: ComponentType<any> = lazy(() => import('./PipelineArticle'));
|
|
8
|
+
export const PipelineProperties: ComponentType<any> = lazy(() => import('./PipelineProperties'));
|
|
@@ -6,9 +6,9 @@ import { Atom, type Registry } from '@effect-atom/atom-react';
|
|
|
6
6
|
import * as Schema from 'effect/Schema';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
|
|
9
|
+
import { getQueryTarget } from '@dxos/app-toolkit/query';
|
|
9
10
|
import { Obj, Query } from '@dxos/echo';
|
|
10
11
|
import { AtomObj, AtomQuery } from '@dxos/echo-atom';
|
|
11
|
-
import { getQueryTarget } from '@dxos/plugin-space';
|
|
12
12
|
import { getSpace, isSpace } from '@dxos/react-client/echo';
|
|
13
13
|
import { type BoardModel } from '@dxos/react-ui-mosaic';
|
|
14
14
|
import { Pipeline } from '@dxos/types';
|
|
@@ -27,7 +27,7 @@ export const usePipelineBoardModel = (
|
|
|
27
27
|
const columnAtomFamily = Atom.family<string, Atom.Atom<Pipeline.Column | undefined>>((viewKey: string) =>
|
|
28
28
|
Atom.make((get) => {
|
|
29
29
|
const columns = get(columnsAtom);
|
|
30
|
-
return columns.find((c) => c.view.
|
|
30
|
+
return columns.find((c) => c.view.uri === viewKey);
|
|
31
31
|
}),
|
|
32
32
|
);
|
|
33
33
|
|
|
@@ -52,14 +52,14 @@ export const usePipelineBoardModel = (
|
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
return {
|
|
55
|
-
getColumnId: (data) => (data as Pipeline.Column).view.
|
|
55
|
+
getColumnId: (data) => (data as Pipeline.Column).view.uri,
|
|
56
56
|
getItemId: (data) => (data as Obj.Unknown).id,
|
|
57
57
|
isColumn: (obj: unknown): obj is Pipeline.Column => Schema.is(Pipeline.Column)(obj),
|
|
58
58
|
isItem: (obj: unknown): obj is Obj.Unknown => Obj.isObject(obj),
|
|
59
59
|
columns: columnsAtom,
|
|
60
|
-
items: (column) => itemsAtomFamily(column.view.
|
|
60
|
+
items: (column) => itemsAtomFamily(column.view.uri),
|
|
61
61
|
getColumns: () => [...registry.get(columnsAtom)],
|
|
62
|
-
getItems: (column) => registry.get(itemsAtomFamily(column.view.
|
|
62
|
+
getItems: (column) => registry.get(itemsAtomFamily(column.view.uri)) ?? [],
|
|
63
63
|
};
|
|
64
64
|
}, [pipeline, registry]);
|
|
65
65
|
|
|
@@ -68,7 +68,7 @@ const emptyColumnsAtom = Atom.make(() => [] as Pipeline.Column[]);
|
|
|
68
68
|
const emptyItemsAtom = Atom.make(() => [] as Obj.Unknown[]);
|
|
69
69
|
|
|
70
70
|
const emptyPipelineModel: BoardModel<Pipeline.Column, Obj.Unknown> = {
|
|
71
|
-
getColumnId: (data) => (data as Pipeline.Column).view.
|
|
71
|
+
getColumnId: (data) => (data as Pipeline.Column).view.uri,
|
|
72
72
|
getItemId: (data) => (data as Obj.Unknown).id,
|
|
73
73
|
isColumn: (obj: unknown): obj is Pipeline.Column => Schema.is(Pipeline.Column)(obj),
|
|
74
74
|
isItem: (obj): obj is Obj.Unknown => Obj.isObject(obj),
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,18 +2,31 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
6
7
|
import { trim } from '@dxos/util';
|
|
7
8
|
|
|
8
|
-
export const meta
|
|
9
|
-
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.pipeline'),
|
|
10
11
|
name: 'Pipelines',
|
|
12
|
+
author: 'DXOS',
|
|
11
13
|
description: trim`
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
A multi-column Kanban-style pipeline plugin for DXOS Composer.
|
|
15
|
+
Each Pipeline holds an ordered set of Columns; each Column is backed by a ViewModel whose query
|
|
16
|
+
can select any ECHO object type — messages, contacts, documents, or custom types — from the active space.
|
|
17
|
+
|
|
18
|
+
Columns are fully configurable through the Settings companion panel, where users can add, rename,
|
|
19
|
+
reorder, and delete columns and edit the underlying query and projection for each column.
|
|
20
|
+
Objects can be dragged between columns and the full pipeline state, including column order and
|
|
21
|
+
per-column item order, persists collaboratively via ECHO.
|
|
22
|
+
|
|
23
|
+
A built-in Research template scaffolds a four-column pipeline wired to the Mailbox, Contacts,
|
|
24
|
+
Organizations, and Notes objects in the space, providing an out-of-the-box CRM-style workflow.
|
|
25
|
+
Pipeline articles also expose Invocations and Automation companion tabs for AI-driven automation.
|
|
14
26
|
`,
|
|
15
27
|
icon: 'ph--path--regular',
|
|
16
28
|
iconHue: 'purple',
|
|
17
29
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-pipeline',
|
|
30
|
+
spec: 'PLUGIN.mdl',
|
|
18
31
|
tags: ['labs'],
|
|
19
|
-
};
|
|
32
|
+
});
|
package/src/plugin.ts
ADDED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Database,
|
|
6
|
-
import { Mailbox } from '@dxos/plugin-inbox
|
|
7
|
-
import { Markdown } from '@dxos/plugin-markdown
|
|
5
|
+
import { type Database, Filter, JsonSchema, Query, Ref } from '@dxos/echo';
|
|
6
|
+
import { Mailbox } from '@dxos/plugin-inbox';
|
|
7
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
8
8
|
import { ViewModel } from '@dxos/schema';
|
|
9
9
|
import { Message, Organization, Person, Pipeline } from '@dxos/types';
|
|
10
10
|
|
|
@@ -12,14 +12,15 @@ export const createResearchProject = async (
|
|
|
12
12
|
db: Database.Database,
|
|
13
13
|
name?: string,
|
|
14
14
|
): Promise<Pipeline.Pipeline | null> => {
|
|
15
|
-
const
|
|
16
|
-
const mailbox =
|
|
17
|
-
|
|
15
|
+
const mailboxes = await db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
16
|
+
const mailbox = mailboxes[0];
|
|
17
|
+
const feed = await mailbox?.feed?.tryLoad();
|
|
18
|
+
if (!mailbox || !feed) {
|
|
18
19
|
return null;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const mailboxView = ViewModel.make({
|
|
22
|
-
query: Query.select(Filter.type(Message.Message)).from(
|
|
23
|
+
query: Query.select(Filter.type(Message.Message)).from(feed),
|
|
23
24
|
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
24
25
|
});
|
|
25
26
|
|
package/src/translations.ts
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
|
+
import { Type } from '@dxos/echo';
|
|
1
2
|
import { type Resource } from '@dxos/react-ui';
|
|
2
3
|
import { Pipeline } from '@dxos/types';
|
|
3
4
|
//
|
|
4
5
|
// Copyright 2023 DXOS.org
|
|
5
6
|
//
|
|
6
7
|
|
|
7
|
-
import { meta } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
8
9
|
|
|
9
10
|
export const translations = [
|
|
10
11
|
{
|
|
11
12
|
'en-US': {
|
|
12
|
-
[Pipeline.Pipeline
|
|
13
|
-
'typename
|
|
14
|
-
'typename
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'object
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'object
|
|
13
|
+
[Type.getTypename(Pipeline.Pipeline)]: {
|
|
14
|
+
'typename.label': 'Pipeline',
|
|
15
|
+
'typename.label_zero': 'Pipelines',
|
|
16
|
+
'typename.label_one': 'Pipeline',
|
|
17
|
+
'typename.label_other': 'Pipelines',
|
|
18
|
+
'object-name.placeholder': 'New pipeline',
|
|
19
|
+
'add-object.label': 'Add pipeline',
|
|
20
|
+
'rename-object.label': 'Rename pipeline',
|
|
21
|
+
'delete-object.label': 'Delete pipeline',
|
|
22
|
+
'object-deleted.label': 'Pipeline deleted',
|
|
21
23
|
},
|
|
22
24
|
[meta.id]: {
|
|
23
|
-
'plugin
|
|
24
|
-
'add
|
|
25
|
-
'add
|
|
26
|
-
'untitled
|
|
27
|
-
'enumerating
|
|
28
|
-
'editing
|
|
29
|
-
'views
|
|
30
|
-
'pipeline
|
|
31
|
-
'pipeline
|
|
32
|
-
'toggle
|
|
33
|
-
'delete
|
|
34
|
-
'add
|
|
25
|
+
'plugin.name': 'Pipelines',
|
|
26
|
+
'add-column.label': 'Add column',
|
|
27
|
+
'add-card.label': 'Add object',
|
|
28
|
+
'untitled-view.title': 'New view',
|
|
29
|
+
'enumerating-tab.label': 'List',
|
|
30
|
+
'editing-tab.label': 'Edit',
|
|
31
|
+
'views.label': 'Views',
|
|
32
|
+
'pipeline-invocations.label': 'Invocations',
|
|
33
|
+
'pipeline-automation.label': 'Automations',
|
|
34
|
+
'toggle-expand.label': 'Toggle expand',
|
|
35
|
+
'delete-view.label': 'Delete view',
|
|
36
|
+
'add-view.label': 'Add view',
|
|
35
37
|
},
|
|
36
38
|
},
|
|
37
39
|
},
|
package/src/types/index.ts
CHANGED