@dxos/plugin-pipeline 0.8.4-main.c351d160a8 → 0.8.4-main.dfabb4ec29
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/dist/lib/neutral/PipelineContainer-7MK2SS76.mjs +69 -0
- package/dist/lib/neutral/PipelineContainer-7MK2SS76.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/{browser/PipelineObjectSettings-QFMIKJH5.mjs → neutral/PipelineProperties-RRPQ3V6I.mjs} +12 -22
- package/dist/lib/neutral/PipelineProperties-RRPQ3V6I.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-ULB5DKWO.mjs} +1 -1
- package/dist/lib/{browser/chunk-3A235GUD.mjs.map → neutral/chunk-ULB5DKWO.mjs.map} +2 -2
- package/dist/lib/neutral/components/index.mjs +206 -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-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-7PY3UOEA.mjs → neutral/react-surface-TW6TRMO6.mjs} +11 -23
- package/dist/lib/neutral/react-surface-TW6TRMO6.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/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/PipelineContainer/PipelineContainer.d.ts +2 -2
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts.map +1 -1
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts +52 -33
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/PipelineContainer/index.d.ts +1 -2
- package/dist/types/src/containers/PipelineContainer/index.d.ts.map +1 -1
- 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 +1 -1
- 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/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 -56
- package/src/PipelinePlugin.node.ts +19 -0
- package/src/PipelinePlugin.test.ts +27 -0
- package/src/PipelinePlugin.tsx +6 -19
- package/src/capabilities/app-graph-builder.ts +40 -0
- package/src/capabilities/create-object.ts +29 -0
- package/src/capabilities/index.ts +5 -3
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +12 -14
- package/src/components/PipelineComponent/PipelineColumn.tsx +55 -31
- package/src/components/PipelineComponent/PipelineComponent.stories.tsx +16 -16
- package/src/components/PipelineComponent/PipelineComponent.tsx +22 -13
- package/src/containers/PipelineContainer/PipelineContainer.stories.tsx +34 -33
- package/src/containers/PipelineContainer/PipelineContainer.tsx +11 -13
- package/src/containers/PipelineContainer/index.ts +1 -3
- package/src/containers/{PipelineObjectSettings/PipelineObjectSettings.tsx → PipelineProperties/PipelineProperties.tsx} +14 -15
- package/src/containers/PipelineProperties/index.ts +5 -0
- package/src/containers/index.ts +1 -1
- package/src/hooks/usePipelineBoardModel.ts +1 -1
- package/src/index.ts +0 -1
- package/src/plugin.ts +9 -0
- package/src/templates/research.ts +2 -2
- package/src/translations.ts +22 -22
- 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/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/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/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
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
6
|
import { createContext } from '@radix-ui/react-context';
|
|
7
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
7
8
|
import React, { type FC, type PropsWithChildren } from 'react';
|
|
8
9
|
|
|
9
10
|
import { Obj } from '@dxos/echo';
|
|
@@ -11,8 +12,9 @@ import { Toolbar, type ToolbarRootProps, useTranslation } from '@dxos/react-ui';
|
|
|
11
12
|
import { Board, type BoardModel, useBoard, useEventHandlerAdapter } from '@dxos/react-ui-mosaic';
|
|
12
13
|
import { type ProjectionModel } from '@dxos/schema';
|
|
13
14
|
import { type Pipeline } from '@dxos/types';
|
|
15
|
+
import { composable, composableProps, slottable } from '@dxos/ui-theme';
|
|
14
16
|
|
|
15
|
-
import { meta } from '
|
|
17
|
+
import { meta } from '#meta';
|
|
16
18
|
|
|
17
19
|
import { PipelineColumn } from './PipelineColumn';
|
|
18
20
|
|
|
@@ -59,10 +61,17 @@ type PipelineContentProps = PropsWithChildren<{
|
|
|
59
61
|
model: BoardModel<Pipeline.Column, Obj.Unknown>;
|
|
60
62
|
}>;
|
|
61
63
|
|
|
62
|
-
const PipelineContent =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
const PipelineContent = slottable<HTMLDivElement, PipelineContentProps>(
|
|
65
|
+
({ asChild, model, children, ...props }, forwardedRef) => {
|
|
66
|
+
const Comp = asChild ? Slot : 'div';
|
|
67
|
+
return (
|
|
68
|
+
<Board.Root model={model}>
|
|
69
|
+
<Comp {...composableProps(props)} ref={forwardedRef}>
|
|
70
|
+
{children}
|
|
71
|
+
</Comp>
|
|
72
|
+
</Board.Root>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
66
75
|
);
|
|
67
76
|
|
|
68
77
|
PipelineContent.displayName = PIPELINE_CONTENT_NAME;
|
|
@@ -77,7 +86,7 @@ type PipelineColumnsProps = {
|
|
|
77
86
|
pipeline: Pipeline.Pipeline;
|
|
78
87
|
};
|
|
79
88
|
|
|
80
|
-
const PipelineColumns = ({ pipeline }
|
|
89
|
+
const PipelineColumns = composable<HTMLDivElement, PipelineColumnsProps>(({ pipeline, ...props }) => {
|
|
81
90
|
const { model } = useBoard(PIPELINE_COLUMNS_NAME);
|
|
82
91
|
const columns = useAtomValue(model.columns);
|
|
83
92
|
const eventHandler = useEventHandlerAdapter<Pipeline.Column, Obj.Unknown>({
|
|
@@ -88,11 +97,11 @@ const PipelineColumns = ({ pipeline }: PipelineColumnsProps) => {
|
|
|
88
97
|
get: (data) => data as unknown as Obj.Unknown,
|
|
89
98
|
make: (object) => object as unknown as Pipeline.Column,
|
|
90
99
|
canDrop: ({ source }) => model.isColumn(source.data),
|
|
91
|
-
onChange: (mutate) => Obj.
|
|
100
|
+
onChange: (mutate) => Obj.update(pipeline, (pipeline) => mutate(pipeline.columns)),
|
|
92
101
|
});
|
|
93
102
|
|
|
94
|
-
return <Board.Content id='pipeline' eventHandler={eventHandler} Tile={PipelineColumn} />;
|
|
95
|
-
};
|
|
103
|
+
return <Board.Content {...props} id='pipeline' eventHandler={eventHandler} Tile={PipelineColumn} />;
|
|
104
|
+
});
|
|
96
105
|
|
|
97
106
|
PipelineColumns.displayName = PIPELINE_COLUMNS_NAME;
|
|
98
107
|
|
|
@@ -102,16 +111,16 @@ PipelineColumns.displayName = PIPELINE_COLUMNS_NAME;
|
|
|
102
111
|
|
|
103
112
|
const PIPELINE_TOOLBAR_NAME = 'Pipeline.Toolbar';
|
|
104
113
|
|
|
105
|
-
export const PipelineToolbar = (props
|
|
114
|
+
export const PipelineToolbar = composable<HTMLDivElement, ToolbarRootProps>(({ children, ...props }, forwardedRef) => {
|
|
106
115
|
const { t } = useTranslation(meta.id);
|
|
107
116
|
const { onAddColumn } = usePipeline(PIPELINE_TOOLBAR_NAME);
|
|
108
117
|
|
|
109
118
|
return (
|
|
110
|
-
<Toolbar.Root {...props}>
|
|
111
|
-
<Toolbar.IconButton icon='ph--plus--regular' iconOnly label={t('add
|
|
119
|
+
<Toolbar.Root {...composableProps(props)} ref={forwardedRef}>
|
|
120
|
+
<Toolbar.IconButton icon='ph--plus--regular' iconOnly label={t('add-column.label')} onClick={onAddColumn} />
|
|
112
121
|
</Toolbar.Root>
|
|
113
122
|
);
|
|
114
|
-
};
|
|
123
|
+
});
|
|
115
124
|
|
|
116
125
|
PipelineToolbar.displayName = PIPELINE_TOOLBAR_NAME;
|
|
117
126
|
|
|
@@ -12,24 +12,25 @@ import { Filter, Ref } from '@dxos/client/echo';
|
|
|
12
12
|
import { Database, Feed, JsonSchema, Obj, Query, Tag } from '@dxos/echo';
|
|
13
13
|
import { Collection, View } from '@dxos/echo';
|
|
14
14
|
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
15
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
15
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
16
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
17
|
+
import { InboxPlugin } from '@dxos/plugin-inbox/plugin';
|
|
18
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
18
19
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
19
|
-
import {
|
|
20
|
+
import { random } from '@dxos/random';
|
|
20
21
|
import { useDatabase, useQuery } from '@dxos/react-client/echo';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
22
|
+
import { translations as stackTranslations } from '@dxos/react-ui-stack/translations';
|
|
23
|
+
import { withLayout } from '@dxos/react-ui/testing';
|
|
23
24
|
import { ViewModel } from '@dxos/schema';
|
|
24
25
|
import { createObjectFactory } from '@dxos/schema/testing';
|
|
25
26
|
import { Message, Organization, Person, Pipeline, Task } from '@dxos/types';
|
|
26
27
|
|
|
27
|
-
import { translations } from '
|
|
28
|
-
import PipelineObjectSettings from '../PipelineObjectSettings';
|
|
28
|
+
import { translations } from '#translations';
|
|
29
29
|
|
|
30
|
+
import PipelineProperties from '../PipelineProperties';
|
|
30
31
|
import { PipelineContainer } from './PipelineContainer';
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
random.seed(0);
|
|
33
34
|
|
|
34
35
|
const DefaultStory = () => {
|
|
35
36
|
const db = useDatabase();
|
|
@@ -43,7 +44,7 @@ const DefaultStory = () => {
|
|
|
43
44
|
return (
|
|
44
45
|
<div className='grow grid grid-cols-[1fr_350px] overflow-hidden h-full w-full'>
|
|
45
46
|
<PipelineContainer role='article' subject={pipeline} attendableId='test' />
|
|
46
|
-
<
|
|
47
|
+
<PipelineProperties pipeline={pipeline} classNames='border-s border-separator' />
|
|
47
48
|
</div>
|
|
48
49
|
);
|
|
49
50
|
};
|
|
@@ -52,7 +53,6 @@ const meta = {
|
|
|
52
53
|
title: 'plugins/plugin-pipeline/containers/PipelineContainer',
|
|
53
54
|
render: DefaultStory,
|
|
54
55
|
decorators: [
|
|
55
|
-
withTheme(),
|
|
56
56
|
withLayout({ layout: 'fullscreen' }),
|
|
57
57
|
withPluginManager({
|
|
58
58
|
plugins: [
|
|
@@ -71,10 +71,7 @@ const meta = {
|
|
|
71
71
|
Message.Message,
|
|
72
72
|
],
|
|
73
73
|
onClientInitialized: Effect.fnUntraced(function* ({ client }) {
|
|
74
|
-
yield*
|
|
75
|
-
yield* Effect.promise(() => client.spaces.waitUntilReady());
|
|
76
|
-
const space = client.spaces.default;
|
|
77
|
-
yield* Effect.promise(() => space.waitUntilReady());
|
|
74
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
78
75
|
|
|
79
76
|
yield* Effect.gen(function* () {
|
|
80
77
|
const tag = yield* Database.add(Tag.make({ label: 'important', hue: 'green' }));
|
|
@@ -108,9 +105,9 @@ const meta = {
|
|
|
108
105
|
const messageFeed = yield* Database.add(Feed.make({ name: 'Messages' }));
|
|
109
106
|
const messages = Array.from({ length: 20 }).map(() =>
|
|
110
107
|
Obj.make(Message.Message, {
|
|
111
|
-
created:
|
|
108
|
+
created: random.date.recent().toISOString(),
|
|
112
109
|
sender: { role: 'user' },
|
|
113
|
-
blocks: [{ _tag: 'text' as const, text:
|
|
110
|
+
blocks: [{ _tag: 'text' as const, text: random.lorem.sentences(2) }],
|
|
114
111
|
}),
|
|
115
112
|
);
|
|
116
113
|
yield* Feed.append(messageFeed, messages);
|
|
@@ -127,9 +124,9 @@ const meta = {
|
|
|
127
124
|
const taskFeed = yield* Database.add(Feed.make({ name: 'Tasks' }));
|
|
128
125
|
const feedTasks = Array.from({ length: 10 }).map(() =>
|
|
129
126
|
Obj.make(Task.Task, {
|
|
130
|
-
title:
|
|
131
|
-
status:
|
|
132
|
-
priority:
|
|
127
|
+
title: random.lorem.sentence(),
|
|
128
|
+
status: random.helpers.arrayElement(['todo', 'in-progress', 'done']) as any,
|
|
129
|
+
priority: random.helpers.arrayElement(['low', 'medium', 'high']) as any,
|
|
133
130
|
}),
|
|
134
131
|
);
|
|
135
132
|
yield* Feed.append(taskFeed, feedTasks);
|
|
@@ -171,12 +168,12 @@ const meta = {
|
|
|
171
168
|
yield* Database.add(
|
|
172
169
|
Obj.make(Organization.Organization, {
|
|
173
170
|
[Obj.Meta]: {
|
|
174
|
-
tags:
|
|
171
|
+
tags: random.datatype.boolean() ? [tagDxn] : [],
|
|
175
172
|
},
|
|
176
|
-
name:
|
|
177
|
-
website:
|
|
178
|
-
description:
|
|
179
|
-
image:
|
|
173
|
+
name: random.company.name(),
|
|
174
|
+
website: random.internet.url(),
|
|
175
|
+
description: random.lorem.paragraph(),
|
|
176
|
+
image: random.image.url(),
|
|
180
177
|
}),
|
|
181
178
|
);
|
|
182
179
|
}
|
|
@@ -186,29 +183,33 @@ const meta = {
|
|
|
186
183
|
yield* Database.add(
|
|
187
184
|
Obj.make(Task.Task, {
|
|
188
185
|
[Obj.Meta]: {
|
|
189
|
-
tags:
|
|
186
|
+
tags: random.datatype.boolean() ? [tagDxn] : [],
|
|
190
187
|
},
|
|
191
|
-
title:
|
|
192
|
-
status:
|
|
193
|
-
priority:
|
|
188
|
+
title: random.lorem.sentence(),
|
|
189
|
+
status: random.helpers.arrayElement(['todo', 'in-progress', 'done']) as any,
|
|
190
|
+
priority: random.helpers.arrayElement(['low', 'medium', 'high']) as any,
|
|
194
191
|
}),
|
|
195
192
|
);
|
|
196
193
|
}
|
|
197
194
|
|
|
198
195
|
// Generate sample Contacts.
|
|
199
|
-
const factory = createObjectFactory(
|
|
196
|
+
const factory = createObjectFactory(personalSpace.db, random as any);
|
|
200
197
|
yield* Effect.promise(() => factory([{ type: Person.Person, count: 12 }]));
|
|
201
198
|
|
|
202
199
|
// Generate sample Projects.
|
|
203
200
|
for (const _ of Array.from({ length: 20 })) {
|
|
204
201
|
yield* Database.add(
|
|
205
202
|
Pipeline.make({
|
|
206
|
-
name:
|
|
207
|
-
description:
|
|
203
|
+
name: random.commerce.productName(),
|
|
204
|
+
description: random.lorem.sentence(),
|
|
208
205
|
}),
|
|
209
206
|
);
|
|
210
207
|
}
|
|
211
|
-
}).pipe(
|
|
208
|
+
}).pipe(
|
|
209
|
+
Effect.provide(
|
|
210
|
+
Layer.merge(Database.layer(personalSpace.db), createFeedServiceLayer(personalSpace.queues)),
|
|
211
|
+
),
|
|
212
|
+
);
|
|
212
213
|
}),
|
|
213
214
|
}),
|
|
214
215
|
InboxPlugin(),
|
|
@@ -5,28 +5,26 @@
|
|
|
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 { COMPANION_PREFIX } from '@dxos/app-toolkit';
|
|
18
|
-
import { DeckOperation } from '@dxos/plugin-deck/types';
|
|
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 PipelineContainerProps =
|
|
27
|
+
export type PipelineContainerProps = AppSurface.ObjectArticleProps<Pipeline.Pipeline>;
|
|
30
28
|
|
|
31
29
|
export const PipelineContainer = ({ role, subject: pipeline, attendableId }: PipelineContainerProps) => {
|
|
32
30
|
const registry = useCapability(Capabilities.AtomRegistry);
|
|
@@ -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
|
);
|
|
@@ -49,7 +47,7 @@ export const PipelineContainer = ({ role, subject: pipeline, attendableId }: Pip
|
|
|
49
47
|
<PipelineComponent.Toolbar disabled={!hasAttention} />
|
|
50
48
|
</Panel.Toolbar>
|
|
51
49
|
<Panel.Content asChild>
|
|
52
|
-
<PipelineComponent.Content model={model}>
|
|
50
|
+
<PipelineComponent.Content asChild model={model}>
|
|
53
51
|
<PipelineComponent.Columns pipeline={pipeline} />
|
|
54
52
|
</PipelineComponent.Content>
|
|
55
53
|
</Panel.Content>
|
|
@@ -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,10 +5,10 @@
|
|
|
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 { useTypeOptions } from '@dxos/plugin-space';
|
|
11
|
-
import { resolveSchemaWithRegistry } from '@dxos/plugin-space';
|
|
12
12
|
import { getSpace, 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';
|
|
@@ -18,22 +18,21 @@ import { Pipeline } from '@dxos/types';
|
|
|
18
18
|
import { mx, osTranslations, subtleHover } 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
37
|
const space = getSpace(pipeline);
|
|
39
38
|
const [expandedId, setExpandedId] = useState<string>();
|
|
@@ -161,8 +160,8 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
161
160
|
}, [space, 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(subtleHover, listItemGrid, '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}
|
|
@@ -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
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
7
|
export const PipelineContainer: ComponentType<any> = lazy(() => import('./PipelineContainer'));
|
|
8
|
-
export const
|
|
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/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
|
},
|