@dxos/plugin-pipeline 0.8.4-main.7996785055 → 0.8.4-main.8baae0fced
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/PipelineArticle-6JIVXMYF.mjs +69 -0
- package/dist/lib/neutral/PipelineArticle-6JIVXMYF.mjs.map +7 -0
- package/dist/lib/neutral/PipelinePlugin.mjs +26 -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-GED4FJSS.mjs} +32 -41
- package/dist/lib/neutral/PipelineProperties-GED4FJSS.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/{browser/chunk-3A235GUD.mjs → neutral/chunk-CNUFCMUC.mjs} +2 -1
- package/dist/lib/neutral/chunk-CNUFCMUC.mjs.map +7 -0
- package/dist/lib/{browser/PipelineContainer-LY2P4JPA.mjs → neutral/components/index.mjs} +23 -162
- 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-ZJYFACOI.mjs +25 -0
- package/dist/lib/neutral/create-object-ZJYFACOI.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-QVPKOGEI.mjs → neutral/react-surface-4W5YLCHT.mjs} +12 -24
- package/dist/lib/neutral/react-surface-4W5YLCHT.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +38 -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 -2
- 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 +8 -20
- 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.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/templates/research.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +44 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +100 -55
- package/src/PipelinePlugin.node.ts +19 -0
- package/src/PipelinePlugin.test.ts +27 -0
- package/src/PipelinePlugin.tsx +6 -30
- package/src/PipelinePlugin.workerd.ts +16 -0
- package/src/capabilities/app-graph-builder.ts +40 -0
- package/src/capabilities/create-object.ts +29 -0
- package/src/capabilities/index.ts +5 -2
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +13 -15
- package/src/components/PipelineComponent/PipelineColumn.tsx +13 -13
- package/src/components/PipelineComponent/PipelineComponent.stories.tsx +17 -19
- package/src/components/PipelineComponent/PipelineComponent.tsx +4 -4
- package/src/containers/{PipelineContainer/PipelineContainer.stories.tsx → PipelineArticle/PipelineArticle.stories.tsx} +36 -38
- package/src/containers/{PipelineContainer/PipelineContainer.tsx → PipelineArticle/PipelineArticle.tsx} +11 -13
- package/src/containers/PipelineArticle/index.ts +5 -0
- package/src/containers/{PipelineObjectSettings/PipelineObjectSettings.tsx → PipelineProperties/PipelineProperties.tsx} +33 -34
- package/src/containers/PipelineProperties/index.ts +5 -0
- package/src/containers/index.ts +2 -2
- package/src/hooks/usePipelineBoardModel.ts +1 -1
- package/src/index.ts +0 -1
- package/src/meta.ts +1 -0
- package/src/plugin.ts +9 -0
- package/src/templates/research.ts +2 -2
- package/src/translations.ts +22 -22
- package/dist/lib/browser/PipelineContainer-LY2P4JPA.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.map +0 -7
- package/dist/lib/browser/index.mjs +0 -90
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-QVPKOGEI.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/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/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
|
@@ -14,7 +14,7 @@ import { type ProjectionModel } from '@dxos/schema';
|
|
|
14
14
|
import { type Pipeline } from '@dxos/types';
|
|
15
15
|
import { composable, composableProps, slottable } from '@dxos/ui-theme';
|
|
16
16
|
|
|
17
|
-
import { meta } from '
|
|
17
|
+
import { meta } from '#meta';
|
|
18
18
|
|
|
19
19
|
import { PipelineColumn } from './PipelineColumn';
|
|
20
20
|
|
|
@@ -66,7 +66,7 @@ const PipelineContent = slottable<HTMLDivElement, PipelineContentProps>(
|
|
|
66
66
|
const Comp = asChild ? Slot : 'div';
|
|
67
67
|
return (
|
|
68
68
|
<Board.Root model={model}>
|
|
69
|
-
<Comp {...composableProps(props
|
|
69
|
+
<Comp {...composableProps(props)} ref={forwardedRef}>
|
|
70
70
|
{children}
|
|
71
71
|
</Comp>
|
|
72
72
|
</Board.Root>
|
|
@@ -97,7 +97,7 @@ const PipelineColumns = composable<HTMLDivElement, PipelineColumnsProps>(({ pipe
|
|
|
97
97
|
get: (data) => data as unknown as Obj.Unknown,
|
|
98
98
|
make: (object) => object as unknown as Pipeline.Column,
|
|
99
99
|
canDrop: ({ source }) => model.isColumn(source.data),
|
|
100
|
-
onChange: (mutate) => Obj.
|
|
100
|
+
onChange: (mutate) => Obj.update(pipeline, (pipeline) => mutate(pipeline.columns)),
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
return <Board.Content {...props} id='pipeline' eventHandler={eventHandler} Tile={PipelineColumn} />;
|
|
@@ -117,7 +117,7 @@ export const PipelineToolbar = composable<HTMLDivElement, ToolbarRootProps>(({ c
|
|
|
117
117
|
|
|
118
118
|
return (
|
|
119
119
|
<Toolbar.Root {...composableProps(props)} ref={forwardedRef}>
|
|
120
|
-
<Toolbar.IconButton icon='ph--plus--regular' iconOnly label={t('add
|
|
120
|
+
<Toolbar.IconButton icon='ph--plus--regular' iconOnly label={t('add-column.label')} onClick={onAddColumn} />
|
|
121
121
|
</Toolbar.Root>
|
|
122
122
|
);
|
|
123
123
|
});
|
|
@@ -8,29 +8,27 @@ 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
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
16
14
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
17
|
-
import { InboxPlugin } from '@dxos/plugin-inbox';
|
|
18
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
15
|
+
import { InboxPlugin } from '@dxos/plugin-inbox/testing';
|
|
16
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
19
17
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
20
|
-
import {
|
|
18
|
+
import { random } from '@dxos/random';
|
|
21
19
|
import { useDatabase, useQuery } from '@dxos/react-client/echo';
|
|
20
|
+
import { translations as stackTranslations } from '@dxos/react-ui-stack/translations';
|
|
22
21
|
import { withLayout } from '@dxos/react-ui/testing';
|
|
23
|
-
import { translations as stackTranslations } from '@dxos/react-ui-stack';
|
|
24
22
|
import { ViewModel } from '@dxos/schema';
|
|
25
23
|
import { createObjectFactory } from '@dxos/schema/testing';
|
|
26
24
|
import { Message, Organization, Person, Pipeline, Task } from '@dxos/types';
|
|
27
25
|
|
|
28
|
-
import { translations } from '
|
|
29
|
-
import PipelineObjectSettings from '../PipelineObjectSettings';
|
|
26
|
+
import { translations } from '#translations';
|
|
30
27
|
|
|
31
|
-
import
|
|
28
|
+
import PipelineProperties from '../PipelineProperties';
|
|
29
|
+
import { PipelineArticle } from './PipelineArticle';
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
random.seed(0);
|
|
34
32
|
|
|
35
33
|
const DefaultStory = () => {
|
|
36
34
|
const db = useDatabase();
|
|
@@ -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
|
-
<
|
|
47
|
-
<
|
|
44
|
+
<PipelineArticle role='article' subject={pipeline} attendableId='test' />
|
|
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 tagDXN = Obj.getDXN(tag).toString();
|
|
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(tagDXN)),
|
|
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(tagDXN)),
|
|
95
93
|
jsonSchema: JsonSchema.toJsonSchema(Task.Task),
|
|
96
94
|
});
|
|
97
95
|
|
|
@@ -105,17 +103,17 @@ const meta = {
|
|
|
105
103
|
const messageFeed = yield* Database.add(Feed.make({ name: 'Messages' }));
|
|
106
104
|
const messages = Array.from({ length: 20 }).map(() =>
|
|
107
105
|
Obj.make(Message.Message, {
|
|
108
|
-
created:
|
|
106
|
+
created: random.date.recent().toISOString(),
|
|
109
107
|
sender: { role: 'user' },
|
|
110
|
-
blocks: [{ _tag: 'text' as const, text:
|
|
108
|
+
blocks: [{ _tag: 'text' as const, text: random.lorem.sentences(2) }],
|
|
111
109
|
}),
|
|
112
110
|
);
|
|
113
111
|
yield* Feed.append(messageFeed, messages);
|
|
114
112
|
|
|
115
|
-
const
|
|
113
|
+
const messageQueueDXN = Feed.getQueueDxn(messageFeed)!.toString();
|
|
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
|
});
|
|
@@ -124,9 +122,9 @@ const meta = {
|
|
|
124
122
|
const taskFeed = yield* Database.add(Feed.make({ name: 'Tasks' }));
|
|
125
123
|
const feedTasks = Array.from({ length: 10 }).map(() =>
|
|
126
124
|
Obj.make(Task.Task, {
|
|
127
|
-
title:
|
|
128
|
-
status:
|
|
129
|
-
priority:
|
|
125
|
+
title: random.lorem.sentence(),
|
|
126
|
+
status: random.helpers.arrayElement(['todo', 'in-progress', 'done']) as any,
|
|
127
|
+
priority: random.helpers.arrayElement(['low', 'medium', 'high']) as any,
|
|
130
128
|
}),
|
|
131
129
|
);
|
|
132
130
|
yield* Feed.append(taskFeed, feedTasks);
|
|
@@ -168,12 +166,12 @@ const meta = {
|
|
|
168
166
|
yield* Database.add(
|
|
169
167
|
Obj.make(Organization.Organization, {
|
|
170
168
|
[Obj.Meta]: {
|
|
171
|
-
tags:
|
|
169
|
+
tags: random.datatype.boolean() ? [tagDXN] : [],
|
|
172
170
|
},
|
|
173
|
-
name:
|
|
174
|
-
website:
|
|
175
|
-
description:
|
|
176
|
-
image:
|
|
171
|
+
name: random.company.name(),
|
|
172
|
+
website: random.internet.url(),
|
|
173
|
+
description: random.lorem.paragraph(),
|
|
174
|
+
image: random.image.url(),
|
|
177
175
|
}),
|
|
178
176
|
);
|
|
179
177
|
}
|
|
@@ -183,25 +181,25 @@ const meta = {
|
|
|
183
181
|
yield* Database.add(
|
|
184
182
|
Obj.make(Task.Task, {
|
|
185
183
|
[Obj.Meta]: {
|
|
186
|
-
tags:
|
|
184
|
+
tags: random.datatype.boolean() ? [tagDXN] : [],
|
|
187
185
|
},
|
|
188
|
-
title:
|
|
189
|
-
status:
|
|
190
|
-
priority:
|
|
186
|
+
title: random.lorem.sentence(),
|
|
187
|
+
status: random.helpers.arrayElement(['todo', 'in-progress', 'done']) as any,
|
|
188
|
+
priority: random.helpers.arrayElement(['low', 'medium', 'high']) as any,
|
|
191
189
|
}),
|
|
192
190
|
);
|
|
193
191
|
}
|
|
194
192
|
|
|
195
193
|
// Generate sample Contacts.
|
|
196
|
-
const factory = createObjectFactory(personalSpace.db,
|
|
194
|
+
const factory = createObjectFactory(personalSpace.db, random as any);
|
|
197
195
|
yield* Effect.promise(() => factory([{ type: Person.Person, count: 12 }]));
|
|
198
196
|
|
|
199
197
|
// Generate sample Projects.
|
|
200
198
|
for (const _ of Array.from({ length: 20 })) {
|
|
201
199
|
yield* Database.add(
|
|
202
200
|
Pipeline.make({
|
|
203
|
-
name:
|
|
204
|
-
description:
|
|
201
|
+
name: random.commerce.productName(),
|
|
202
|
+
description: random.lorem.sentence(),
|
|
205
203
|
}),
|
|
206
204
|
);
|
|
207
205
|
}
|
|
@@ -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
|
|
|
@@ -5,30 +5,28 @@
|
|
|
5
5
|
import React, { useCallback, useEffect } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
-
import { useCapability } from '@dxos/app-framework/ui';
|
|
9
|
-
import {
|
|
10
|
-
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
+
import { Surface, useCapability, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
11
10
|
import {
|
|
11
|
+
AppSurface,
|
|
12
12
|
OBJECT_ACTIONS_CONTRIBUTION_ID,
|
|
13
13
|
OBJECT_ACTIONS_CONTRIBUTION_PRIORITY,
|
|
14
|
-
type SurfaceComponentProps,
|
|
15
14
|
useObjectMenuItems,
|
|
16
15
|
} from '@dxos/app-toolkit/ui';
|
|
17
|
-
import { companionSegment } from '@dxos/app-toolkit';
|
|
18
|
-
import { DeckOperation } from '@dxos/plugin-deck/operations';
|
|
19
16
|
import { Panel } from '@dxos/react-ui';
|
|
17
|
+
import { linkedSegment } from '@dxos/react-ui-attention';
|
|
20
18
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
21
19
|
import { useMenu } from '@dxos/react-ui-menu';
|
|
22
20
|
import { type Pipeline } from '@dxos/types';
|
|
23
21
|
|
|
24
|
-
import { type ItemProps, PipelineComponent } from '
|
|
25
|
-
import { usePipelineBoardModel } from '
|
|
22
|
+
import { type ItemProps, PipelineComponent } from '#components';
|
|
23
|
+
import { usePipelineBoardModel } from '#hooks';
|
|
26
24
|
|
|
27
25
|
const PIPELINE_ITEM = 'PipelineItem';
|
|
28
26
|
|
|
29
|
-
export type
|
|
27
|
+
export type PipelineArticleProps = AppSurface.ObjectArticleProps<Pipeline.Pipeline>;
|
|
30
28
|
|
|
31
|
-
export const
|
|
29
|
+
export const PipelineArticle = ({ role, subject: pipeline, attendableId }: PipelineArticleProps) => {
|
|
32
30
|
const registry = useCapability(Capabilities.AtomRegistry);
|
|
33
31
|
const model = usePipelineBoardModel(pipeline, registry);
|
|
34
32
|
const { invokePromise } = useOperationInvoker();
|
|
@@ -36,8 +34,8 @@ export const PipelineContainer = ({ role, subject: pipeline, attendableId }: Pip
|
|
|
36
34
|
|
|
37
35
|
const handleColumnAdd = useCallback(
|
|
38
36
|
() =>
|
|
39
|
-
invokePromise(
|
|
40
|
-
|
|
37
|
+
invokePromise(LayoutOperation.UpdateCompanion, {
|
|
38
|
+
subject: linkedSegment('settings'),
|
|
41
39
|
}),
|
|
42
40
|
[invokePromise],
|
|
43
41
|
);
|
|
@@ -75,7 +73,7 @@ const PipelineItem = ({ item, projectionModel }: ItemProps) => {
|
|
|
75
73
|
|
|
76
74
|
return (
|
|
77
75
|
<Surface.Surface
|
|
78
|
-
|
|
76
|
+
type={AppSurface.Card}
|
|
79
77
|
data={{
|
|
80
78
|
subject: item,
|
|
81
79
|
projection: projectionModel,
|
|
@@ -5,37 +5,36 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
|
+
import { resolveSchemaWithRegistry } from '@dxos/app-toolkit/query';
|
|
9
|
+
import { useTypeOptions } from '@dxos/app-toolkit/ui';
|
|
8
10
|
import { DXN, Filter, JsonSchema, Obj, Query, type QueryAST, Ref, Tag } 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
40
|
const column = useMemo(
|
|
@@ -45,9 +44,9 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
45
44
|
const [view, updateView] = useObject(column?.view);
|
|
46
45
|
const [schema, setSchema] = useState<Schema.Schema.AnyNoContext>(() => Schema.Struct({}));
|
|
47
46
|
const projectionRef = useRef<ProjectionModel>(null);
|
|
48
|
-
const tags = useQuery(
|
|
47
|
+
const tags = useQuery(db, Filter.type(Tag.Tag));
|
|
49
48
|
const types = useTypeOptions({
|
|
50
|
-
|
|
49
|
+
db,
|
|
51
50
|
annotation: {
|
|
52
51
|
location: ['database', 'runtime'],
|
|
53
52
|
kind: ['user'],
|
|
@@ -55,15 +54,15 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
55
54
|
});
|
|
56
55
|
|
|
57
56
|
useAsyncEffect(async () => {
|
|
58
|
-
if (!view?.query || !
|
|
57
|
+
if (!view?.query || !db) {
|
|
59
58
|
return;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
const foundSchema = await resolveSchemaWithRegistry(
|
|
61
|
+
const foundSchema = await resolveSchemaWithRegistry(db.schemaRegistry, view.query.ast);
|
|
63
62
|
if (foundSchema && foundSchema !== schema) {
|
|
64
63
|
setSchema(() => foundSchema);
|
|
65
64
|
}
|
|
66
|
-
}, [
|
|
65
|
+
}, [db, view, schema]);
|
|
67
66
|
|
|
68
67
|
const handleMove = useCallback(
|
|
69
68
|
(fromIndex: number, toIndex: number) =>
|
|
@@ -75,16 +74,16 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
75
74
|
|
|
76
75
|
const handleQueryChanged = useCallback(
|
|
77
76
|
async (newQuery: QueryAST.Query, target?: string) => {
|
|
78
|
-
if (!view || !
|
|
77
|
+
if (!view || !db) {
|
|
79
78
|
return;
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
const queue = target && DXN.tryParse(target) ? target : undefined;
|
|
83
|
-
const query = queue ? Query.fromAst(newQuery).from({
|
|
82
|
+
const query = queue ? Query.fromAst(newQuery).from({ feeds: [queue] }) : Query.fromAst(newQuery);
|
|
84
83
|
updateView((view) => {
|
|
85
84
|
view.query.ast = query.ast as Mutable<typeof query.ast>;
|
|
86
85
|
});
|
|
87
|
-
const newSchema = await resolveSchemaWithRegistry(
|
|
86
|
+
const newSchema = await resolveSchemaWithRegistry(db.schemaRegistry, query.ast);
|
|
88
87
|
if (!newSchema) {
|
|
89
88
|
return;
|
|
90
89
|
}
|
|
@@ -99,7 +98,7 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
99
98
|
|
|
100
99
|
setSchema(() => newSchema);
|
|
101
100
|
},
|
|
102
|
-
[view, updateView, schema],
|
|
101
|
+
[db, view, updateView, schema],
|
|
103
102
|
);
|
|
104
103
|
|
|
105
104
|
const handleColumnValuesChanged = useCallback(
|
|
@@ -135,20 +134,20 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
135
134
|
updateColumns((columns) => {
|
|
136
135
|
columns.splice(index, 1);
|
|
137
136
|
});
|
|
138
|
-
|
|
137
|
+
db?.remove(viewToRemove);
|
|
139
138
|
},
|
|
140
|
-
[expandedId, columns, updateColumns,
|
|
139
|
+
[expandedId, columns, updateColumns, db],
|
|
141
140
|
);
|
|
142
141
|
|
|
143
142
|
const handleAdd = useCallback(() => {
|
|
144
|
-
if (!
|
|
143
|
+
if (!db) {
|
|
145
144
|
return;
|
|
146
145
|
}
|
|
147
146
|
const newView = ViewModel.make({
|
|
148
147
|
query: Query.select(Filter.nothing()),
|
|
149
148
|
jsonSchema: JsonSchema.toJsonSchema(Schema.Struct({})),
|
|
150
149
|
});
|
|
151
|
-
|
|
150
|
+
db.add(newView);
|
|
152
151
|
updateColumns((columns) => {
|
|
153
152
|
columns.push({
|
|
154
153
|
name: '',
|
|
@@ -158,11 +157,11 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
158
157
|
});
|
|
159
158
|
});
|
|
160
159
|
setExpandedId(newView.id);
|
|
161
|
-
}, [
|
|
160
|
+
}, [db, updateColumns]);
|
|
162
161
|
|
|
163
162
|
return (
|
|
164
|
-
<div
|
|
165
|
-
<h2 className='text-sm text-description py-1'>{t('views
|
|
163
|
+
<div className={mx('py-form-padding overflow-y-auto', classNames)}>
|
|
164
|
+
<h2 className='text-sm text-description py-1'>{t('views.label')}</h2>
|
|
166
165
|
|
|
167
166
|
<List.Root<Pipeline.Column>
|
|
168
167
|
items={columns}
|
|
@@ -180,13 +179,13 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
180
179
|
classNames={listItemGrid}
|
|
181
180
|
aria-expanded={expandedId === column.view.dxn.toString()}
|
|
182
181
|
>
|
|
183
|
-
<div
|
|
182
|
+
<div className={mx(listItemGrid, 'dx-hover rounded-xs cursor-pointer min-h-10')}>
|
|
184
183
|
<List.ItemDragHandle />
|
|
185
184
|
<List.ItemTitle onClick={() => handleToggleField(column)}>
|
|
186
|
-
{column.name || t('untitled
|
|
185
|
+
{column.name || t('untitled-view.title')}
|
|
187
186
|
</List.ItemTitle>
|
|
188
187
|
<List.ItemDeleteButton
|
|
189
|
-
label={t('delete
|
|
188
|
+
label={t('delete-view.label')}
|
|
190
189
|
autoHide={false}
|
|
191
190
|
onClick={() => handleDelete(column)}
|
|
192
191
|
data-testid='view.delete'
|
|
@@ -194,7 +193,7 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
194
193
|
<IconButton
|
|
195
194
|
iconOnly
|
|
196
195
|
variant='ghost'
|
|
197
|
-
label={t('toggle
|
|
196
|
+
label={t('toggle-expand.label', { ns: osTranslations })}
|
|
198
197
|
icon={
|
|
199
198
|
expandedId === column.view.dxn.toString()
|
|
200
199
|
? 'ph--caret-down--regular'
|
|
@@ -204,7 +203,7 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
204
203
|
/>
|
|
205
204
|
</div>
|
|
206
205
|
{expandedId === column.view.dxn.toString() && column?.view.target && (
|
|
207
|
-
<div
|
|
206
|
+
<div className='col-span-5 my-2 border border-separator rounded-md'>
|
|
208
207
|
<Form.Root
|
|
209
208
|
schema={ColumnFormSchema}
|
|
210
209
|
values={column}
|
|
@@ -220,8 +219,8 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
220
219
|
readonly
|
|
221
220
|
schema={schema}
|
|
222
221
|
view={column.view.target}
|
|
223
|
-
registry={
|
|
224
|
-
db={
|
|
222
|
+
registry={db?.schemaRegistry}
|
|
223
|
+
db={db}
|
|
225
224
|
tags={tags}
|
|
226
225
|
types={types}
|
|
227
226
|
onQueryChanged={handleQueryChanged}
|
|
@@ -235,8 +234,8 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
235
234
|
)}
|
|
236
235
|
</List.Root>
|
|
237
236
|
|
|
238
|
-
<div
|
|
239
|
-
<IconButton icon='ph--plus--regular' label={t('add
|
|
237
|
+
<div className='my-form-padding'>
|
|
238
|
+
<IconButton icon='ph--plus--regular' label={t('add-view.label')} onClick={handleAdd} classNames='w-full' />
|
|
240
239
|
</div>
|
|
241
240
|
</div>
|
|
242
241
|
);
|
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';
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { trim } from '@dxos/util';
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
9
|
id: 'org.dxos.plugin.pipeline',
|
|
10
10
|
name: 'Pipelines',
|
|
11
|
+
author: 'DXOS',
|
|
11
12
|
description: trim`
|
|
12
13
|
Pipelines for organizing tasks, milestones, and deliverables.
|
|
13
14
|
Track progress across multiple pipelines and coordinate team activities in a structured environment.
|
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
|
@@ -4,35 +4,35 @@ import { Pipeline } from '@dxos/types';
|
|
|
4
4
|
// Copyright 2023 DXOS.org
|
|
5
5
|
//
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
12
|
[Pipeline.Pipeline.typename]: {
|
|
13
|
-
'typename
|
|
14
|
-
'typename
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'object
|
|
18
|
-
'add
|
|
19
|
-
'rename
|
|
20
|
-
'delete
|
|
21
|
-
'object
|
|
13
|
+
'typename.label': 'Pipeline',
|
|
14
|
+
'typename.label_zero': 'Pipelines',
|
|
15
|
+
'typename.label_one': 'Pipeline',
|
|
16
|
+
'typename.label_other': 'Pipelines',
|
|
17
|
+
'object-name.placeholder': 'New pipeline',
|
|
18
|
+
'add-object.label': 'Add pipeline',
|
|
19
|
+
'rename-object.label': 'Rename pipeline',
|
|
20
|
+
'delete-object.label': 'Delete pipeline',
|
|
21
|
+
'object-deleted.label': 'Pipeline deleted',
|
|
22
22
|
},
|
|
23
23
|
[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
|
|
24
|
+
'plugin.name': 'Pipelines',
|
|
25
|
+
'add-column.label': 'Add column',
|
|
26
|
+
'add-card.label': 'Add object',
|
|
27
|
+
'untitled-view.title': 'New view',
|
|
28
|
+
'enumerating-tab.label': 'List',
|
|
29
|
+
'editing-tab.label': 'Edit',
|
|
30
|
+
'views.label': 'Views',
|
|
31
|
+
'pipeline-invocations.label': 'Invocations',
|
|
32
|
+
'pipeline-automation.label': 'Automations',
|
|
33
|
+
'toggle-expand.label': 'Toggle expand',
|
|
34
|
+
'delete-view.label': 'Delete view',
|
|
35
|
+
'add-view.label': 'Add view',
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
},
|