@dxos/plugin-pipeline 0.8.4-main.c351d160a8 → 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-QFMIKJH5.mjs → neutral/PipelineProperties-JXY3AVOY.mjs} +54 -65
- 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-7PY3UOEA.mjs → neutral/react-surface-QG7QSZSS.mjs} +12 -24
- 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 -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/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 +22 -16
- 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 +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 -26
- package/dist/types/src/translations.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 -19
- 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} +13 -15
- package/src/components/PipelineComponent/PipelineColumn.tsx +69 -55
- package/src/components/PipelineComponent/PipelineComponent.stories.tsx +18 -20
- package/src/components/PipelineComponent/PipelineComponent.tsx +22 -13
- package/src/containers/{PipelineContainer/PipelineContainer.stories.tsx → PipelineArticle/PipelineArticle.stories.tsx} +43 -47
- package/src/containers/{PipelineContainer/PipelineContainer.tsx → PipelineArticle/PipelineArticle.tsx} +12 -14
- package/src/containers/PipelineArticle/index.ts +5 -0
- package/src/containers/{PipelineObjectSettings/PipelineObjectSettings.tsx → PipelineProperties/PipelineProperties.tsx} +66 -70
- 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 +2 -2
- package/src/translations.ts +24 -23
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/PipelineContainer-V5KGYEQR.mjs +0 -318
- package/dist/lib/browser/PipelineContainer-V5KGYEQR.mjs.map +0 -7
- package/dist/lib/browser/PipelineObjectSettings-QFMIKJH5.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-QQKBLYFD.mjs +0 -56
- package/dist/lib/browser/app-graph-builder-QQKBLYFD.mjs.map +0 -7
- package/dist/lib/browser/chunk-3A235GUD.mjs +0 -21
- package/dist/lib/browser/chunk-3A235GUD.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -87
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-7PY3UOEA.mjs.map +0 -7
- 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/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 -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/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -49
- 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 -9
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/containers/PipelineContainer/index.ts +0 -7
- package/src/containers/PipelineObjectSettings/index.ts +0 -7
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/types/index.mjs +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,49 +5,45 @@
|
|
|
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
17
|
import { Pipeline } from '@dxos/types';
|
|
18
|
-
import { mx, osTranslations
|
|
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'],
|
|
@@ -55,15 +51,15 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
55
51
|
});
|
|
56
52
|
|
|
57
53
|
useAsyncEffect(async () => {
|
|
58
|
-
if (!view?.query || !
|
|
54
|
+
if (!view?.query || !db) {
|
|
59
55
|
return;
|
|
60
56
|
}
|
|
61
57
|
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
|
|
58
|
+
const foundType = await resolveSchemaWithRegistry(db, view.query.ast);
|
|
59
|
+
if (foundType && foundType !== type) {
|
|
60
|
+
setType(() => foundType);
|
|
65
61
|
}
|
|
66
|
-
}, [
|
|
62
|
+
}, [db, view, type]);
|
|
67
63
|
|
|
68
64
|
const handleMove = useCallback(
|
|
69
65
|
(fromIndex: number, toIndex: number) =>
|
|
@@ -74,32 +70,36 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
74
70
|
);
|
|
75
71
|
|
|
76
72
|
const handleQueryChanged = useCallback(
|
|
77
|
-
async (newQuery: QueryAST.Query, target?:
|
|
78
|
-
if (!view || !
|
|
73
|
+
async (newQuery: QueryAST.Query, target?: EID.EID) => {
|
|
74
|
+
if (!view || !db) {
|
|
79
75
|
return;
|
|
80
76
|
}
|
|
81
77
|
|
|
82
|
-
const queue = target
|
|
83
|
-
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);
|
|
84
84
|
updateView((view) => {
|
|
85
85
|
view.query.ast = query.ast as Mutable<typeof query.ast>;
|
|
86
86
|
});
|
|
87
|
-
const
|
|
88
|
-
if (!
|
|
87
|
+
const newType = await resolveSchemaWithRegistry(db, query.ast);
|
|
88
|
+
if (!newType) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
const newView = ViewModel.make({
|
|
93
93
|
query,
|
|
94
|
-
jsonSchema:
|
|
94
|
+
jsonSchema: newType.jsonSchema,
|
|
95
95
|
});
|
|
96
96
|
updateView((view) => {
|
|
97
97
|
view.projection = Obj.getSnapshot(newView).projection as Mutable<typeof view.projection>;
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
setType(() => newType);
|
|
101
101
|
},
|
|
102
|
-
[view, updateView,
|
|
102
|
+
[db, view, updateView, type],
|
|
103
103
|
);
|
|
104
104
|
|
|
105
105
|
const handleColumnValuesChanged = useCallback(
|
|
@@ -119,14 +119,12 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
119
119
|
);
|
|
120
120
|
|
|
121
121
|
const handleToggleField = useCallback((column: Pipeline.Column) => {
|
|
122
|
-
setExpandedId((prevExpandedId) =>
|
|
123
|
-
prevExpandedId === column.view.dxn.toString() ? undefined : column.view.dxn.toString(),
|
|
124
|
-
);
|
|
122
|
+
setExpandedId((prevExpandedId) => (prevExpandedId === column.view.uri ? undefined : column.view.uri));
|
|
125
123
|
}, []);
|
|
126
124
|
|
|
127
125
|
const handleDelete = useCallback(
|
|
128
126
|
async (column: Pipeline.Column) => {
|
|
129
|
-
if (column.view.
|
|
127
|
+
if (column.view.uri === expandedId) {
|
|
130
128
|
setExpandedId(undefined);
|
|
131
129
|
}
|
|
132
130
|
|
|
@@ -135,20 +133,20 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
135
133
|
updateColumns((columns) => {
|
|
136
134
|
columns.splice(index, 1);
|
|
137
135
|
});
|
|
138
|
-
|
|
136
|
+
db?.remove(viewToRemove);
|
|
139
137
|
},
|
|
140
|
-
[expandedId, columns, updateColumns,
|
|
138
|
+
[expandedId, columns, updateColumns, db],
|
|
141
139
|
);
|
|
142
140
|
|
|
143
141
|
const handleAdd = useCallback(() => {
|
|
144
|
-
if (!
|
|
142
|
+
if (!db) {
|
|
145
143
|
return;
|
|
146
144
|
}
|
|
147
145
|
const newView = ViewModel.make({
|
|
148
146
|
query: Query.select(Filter.nothing()),
|
|
149
147
|
jsonSchema: JsonSchema.toJsonSchema(Schema.Struct({})),
|
|
150
148
|
});
|
|
151
|
-
|
|
149
|
+
db.add(newView);
|
|
152
150
|
updateColumns((columns) => {
|
|
153
151
|
columns.push({
|
|
154
152
|
name: '',
|
|
@@ -158,16 +156,16 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
158
156
|
});
|
|
159
157
|
});
|
|
160
158
|
setExpandedId(newView.id);
|
|
161
|
-
}, [
|
|
159
|
+
}, [db, updateColumns]);
|
|
162
160
|
|
|
163
161
|
return (
|
|
164
|
-
<div
|
|
165
|
-
<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>
|
|
166
164
|
|
|
167
165
|
<List.Root<Pipeline.Column>
|
|
168
166
|
items={columns}
|
|
169
167
|
isItem={Schema.is(Pipeline.Column)}
|
|
170
|
-
getId={(column) => column.view.
|
|
168
|
+
getId={(column) => column.view.uri}
|
|
171
169
|
onMove={handleMove}
|
|
172
170
|
>
|
|
173
171
|
{({ items: columns }) => (
|
|
@@ -175,18 +173,18 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
175
173
|
<div role='list' className={mx(listGrid)}>
|
|
176
174
|
{columns.map((column) => (
|
|
177
175
|
<List.Item<Pipeline.Column>
|
|
178
|
-
key={column.view.
|
|
176
|
+
key={column.view.uri}
|
|
179
177
|
item={column}
|
|
180
178
|
classNames={listItemGrid}
|
|
181
|
-
aria-expanded={expandedId === column.view.
|
|
179
|
+
aria-expanded={expandedId === column.view.uri}
|
|
182
180
|
>
|
|
183
|
-
<div
|
|
181
|
+
<div className={mx(listItemGrid, 'dx-hover rounded-xs cursor-pointer min-h-10')}>
|
|
184
182
|
<List.ItemDragHandle />
|
|
185
183
|
<List.ItemTitle onClick={() => handleToggleField(column)}>
|
|
186
|
-
{column.name || t('untitled
|
|
184
|
+
{column.name || t('untitled-view.title')}
|
|
187
185
|
</List.ItemTitle>
|
|
188
186
|
<List.ItemDeleteButton
|
|
189
|
-
label={t('delete
|
|
187
|
+
label={t('delete-view.label')}
|
|
190
188
|
autoHide={false}
|
|
191
189
|
onClick={() => handleDelete(column)}
|
|
192
190
|
data-testid='view.delete'
|
|
@@ -194,17 +192,13 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
194
192
|
<IconButton
|
|
195
193
|
iconOnly
|
|
196
194
|
variant='ghost'
|
|
197
|
-
label={t('toggle
|
|
198
|
-
icon={
|
|
199
|
-
expandedId === column.view.dxn.toString()
|
|
200
|
-
? 'ph--caret-down--regular'
|
|
201
|
-
: 'ph--caret-right--regular'
|
|
202
|
-
}
|
|
195
|
+
label={t('toggle-expand.label', { ns: osTranslations })}
|
|
196
|
+
icon={expandedId === column.view.uri ? 'ph--caret-down--regular' : 'ph--caret-right--regular'}
|
|
203
197
|
onClick={() => handleToggleField(column)}
|
|
204
198
|
/>
|
|
205
199
|
</div>
|
|
206
|
-
{expandedId === column.view.
|
|
207
|
-
<div
|
|
200
|
+
{expandedId === column.view.uri && column?.view.target && (
|
|
201
|
+
<div className='col-span-5 my-2 border border-separator rounded-md'>
|
|
208
202
|
<Form.Root
|
|
209
203
|
schema={ColumnFormSchema}
|
|
210
204
|
values={column}
|
|
@@ -214,18 +208,20 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
214
208
|
<Form.FieldSet />
|
|
215
209
|
</Form.Content>
|
|
216
210
|
</Form.Root>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
+
)}
|
|
229
225
|
</div>
|
|
230
226
|
)}
|
|
231
227
|
</List.Item>
|
|
@@ -235,8 +231,8 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
235
231
|
)}
|
|
236
232
|
</List.Root>
|
|
237
233
|
|
|
238
|
-
<div
|
|
239
|
-
<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' />
|
|
240
236
|
</div>
|
|
241
237
|
</div>
|
|
242
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
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
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
|
|
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
|
|
package/src/translations.ts
CHANGED
|
@@ -1,38 +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
|
-
'add
|
|
19
|
-
'rename
|
|
20
|
-
'delete
|
|
21
|
-
'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',
|
|
22
23
|
},
|
|
23
24
|
[meta.id]: {
|
|
24
|
-
'plugin
|
|
25
|
-
'add
|
|
26
|
-
'add
|
|
27
|
-
'untitled
|
|
28
|
-
'enumerating
|
|
29
|
-
'editing
|
|
30
|
-
'views
|
|
31
|
-
'pipeline
|
|
32
|
-
'pipeline
|
|
33
|
-
'toggle
|
|
34
|
-
'delete
|
|
35
|
-
'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',
|
|
36
37
|
},
|
|
37
38
|
},
|
|
38
39
|
},
|