@dxos/plugin-pipeline 0.8.4-main.52d7546f51 → 0.8.4-main.74a063c4e0

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.
Files changed (112) hide show
  1. package/dist/lib/browser/index.mjs +63 -74
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/types/index.mjs +0 -9
  5. package/dist/types/src/PipelinePlugin.d.ts.map +1 -1
  6. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  7. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  8. package/dist/types/src/capabilities/index.d.ts +3 -3
  9. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  10. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  11. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  12. package/dist/types/src/components/PipelineComponent/PipelineColumn.d.ts +9 -0
  13. package/dist/types/src/components/PipelineComponent/PipelineColumn.d.ts.map +1 -0
  14. package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts +65 -0
  15. package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts.map +1 -0
  16. package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts +43 -0
  17. package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts.map +1 -0
  18. package/dist/types/src/components/PipelineComponent/index.d.ts +3 -0
  19. package/dist/types/src/components/PipelineComponent/index.d.ts.map +1 -0
  20. package/dist/types/src/components/index.d.ts +1 -4
  21. package/dist/types/src/components/index.d.ts.map +1 -1
  22. package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts +6 -0
  23. package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts.map +1 -0
  24. package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts +57 -0
  25. package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts.map +1 -0
  26. package/dist/types/src/containers/PipelineContainer/index.d.ts +2 -0
  27. package/dist/types/src/containers/PipelineContainer/index.d.ts.map +1 -0
  28. package/dist/types/src/{components/PipelineSettings.d.ts → containers/PipelineObjectSettings/PipelineObjectSettings.d.ts} +1 -2
  29. package/dist/types/src/containers/PipelineObjectSettings/PipelineObjectSettings.d.ts.map +1 -0
  30. package/dist/types/src/containers/PipelineObjectSettings/index.d.ts +2 -0
  31. package/dist/types/src/containers/PipelineObjectSettings/index.d.ts.map +1 -0
  32. package/dist/types/src/containers/index.d.ts +4 -0
  33. package/dist/types/src/containers/index.d.ts.map +1 -0
  34. package/dist/types/src/hooks/index.d.ts +2 -0
  35. package/dist/types/src/hooks/index.d.ts.map +1 -0
  36. package/dist/types/src/hooks/usePipelineBoardModel.d.ts +6 -0
  37. package/dist/types/src/hooks/usePipelineBoardModel.d.ts.map +1 -0
  38. package/dist/types/src/templates/research.d.ts.map +1 -1
  39. package/dist/types/src/translations.d.ts +22 -21
  40. package/dist/types/src/translations.d.ts.map +1 -1
  41. package/dist/types/src/types/index.d.ts +0 -2
  42. package/dist/types/src/types/index.d.ts.map +1 -1
  43. package/dist/types/tsconfig.tsbuildinfo +1 -1
  44. package/package.json +53 -41
  45. package/src/PipelinePlugin.tsx +20 -19
  46. package/src/capabilities/app-graph-builder.ts +40 -0
  47. package/src/capabilities/index.ts +4 -3
  48. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +20 -14
  49. package/src/components/PipelineComponent/PipelineColumn.tsx +164 -0
  50. package/src/components/{PipelineComponent.stories.tsx → PipelineComponent/PipelineComponent.stories.tsx} +45 -30
  51. package/src/components/PipelineComponent/PipelineComponent.tsx +140 -0
  52. package/src/components/PipelineComponent/index.ts +6 -0
  53. package/src/components/index.ts +1 -7
  54. package/src/containers/PipelineContainer/PipelineContainer.stories.tsx +229 -0
  55. package/src/containers/PipelineContainer/PipelineContainer.tsx +86 -0
  56. package/src/containers/PipelineContainer/index.ts +5 -0
  57. package/src/{components/PipelineSettings.tsx → containers/PipelineObjectSettings/PipelineObjectSettings.tsx} +75 -63
  58. package/src/containers/PipelineObjectSettings/index.ts +5 -0
  59. package/src/containers/index.ts +8 -0
  60. package/src/hooks/index.ts +5 -0
  61. package/src/hooks/usePipelineBoardModel.ts +79 -0
  62. package/src/meta.ts +1 -1
  63. package/src/templates/research.ts +14 -15
  64. package/src/translations.ts +22 -21
  65. package/src/types/index.ts +0 -3
  66. package/dist/lib/browser/PipelineContainer-I3TPA7ZN.mjs +0 -217
  67. package/dist/lib/browser/PipelineContainer-I3TPA7ZN.mjs.map +0 -7
  68. package/dist/lib/browser/PipelineSettings-YSGSJHBT.mjs +0 -212
  69. package/dist/lib/browser/PipelineSettings-YSGSJHBT.mjs.map +0 -7
  70. package/dist/lib/browser/app-graph-builder-NUJB33F7.mjs +0 -65
  71. package/dist/lib/browser/app-graph-builder-NUJB33F7.mjs.map +0 -7
  72. package/dist/lib/browser/chunk-7GVESVYR.mjs +0 -42
  73. package/dist/lib/browser/chunk-7GVESVYR.mjs.map +0 -7
  74. package/dist/lib/browser/chunk-QWNKLHBY.mjs +0 -28
  75. package/dist/lib/browser/chunk-QWNKLHBY.mjs.map +0 -7
  76. package/dist/lib/browser/react-surface-JMMCTIL3.mjs +0 -57
  77. package/dist/lib/browser/react-surface-JMMCTIL3.mjs.map +0 -7
  78. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
  79. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  80. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  81. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  82. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -2
  83. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  84. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  85. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  86. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  87. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  88. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  89. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  90. package/dist/types/src/components/PipelineColumn.d.ts +0 -10
  91. package/dist/types/src/components/PipelineColumn.d.ts.map +0 -1
  92. package/dist/types/src/components/PipelineComponent.d.ts +0 -38
  93. package/dist/types/src/components/PipelineComponent.d.ts.map +0 -1
  94. package/dist/types/src/components/PipelineComponent.stories.d.ts +0 -42
  95. package/dist/types/src/components/PipelineComponent.stories.d.ts.map +0 -1
  96. package/dist/types/src/components/PipelineContainer.d.ts +0 -7
  97. package/dist/types/src/components/PipelineContainer.d.ts.map +0 -1
  98. package/dist/types/src/components/PipelineContainer.stories.d.ts +0 -56
  99. package/dist/types/src/components/PipelineContainer.stories.d.ts.map +0 -1
  100. package/dist/types/src/components/PipelineSettings.d.ts.map +0 -1
  101. package/dist/types/src/types/PipelineAction.d.ts +0 -25
  102. package/dist/types/src/types/PipelineAction.d.ts.map +0 -1
  103. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -51
  104. package/src/capabilities/app-graph-builder/index.ts +0 -7
  105. package/src/capabilities/operation-resolver/index.ts +0 -5
  106. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -29
  107. package/src/capabilities/react-surface/index.ts +0 -7
  108. package/src/components/PipelineColumn.tsx +0 -145
  109. package/src/components/PipelineComponent.tsx +0 -103
  110. package/src/components/PipelineContainer.stories.tsx +0 -226
  111. package/src/components/PipelineContainer.tsx +0 -57
  112. package/src/types/PipelineAction.ts +0 -29
@@ -1,103 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { createContext } from '@radix-ui/react-context';
6
- import React, { type FC } from 'react';
7
-
8
- import { type Obj } from '@dxos/echo';
9
- import { useObject } from '@dxos/react-client/echo';
10
- import { Toolbar, type ToolbarRootProps, useTranslation } from '@dxos/react-ui';
11
- import { Stack } from '@dxos/react-ui-stack';
12
- import { type ProjectionModel } from '@dxos/schema';
13
- import { type Pipeline as PipelineType } from '@dxos/types';
14
-
15
- import { meta } from '../meta';
16
-
17
- import { PipelineColumn } from './PipelineColumn';
18
-
19
- type ItemProps = {
20
- item: Obj.Unknown;
21
- projectionModel?: ProjectionModel;
22
- };
23
-
24
- const itemNoOp = ({ item }: ItemProps) => <span>{item.id}</span>;
25
-
26
- type PipelineContextValue = {
27
- Item: FC<ItemProps>;
28
- // TODO(wittjosiah): Support adding items.
29
- // If the created item doesn't match the current query, it will not be visible.
30
- // onAddItem?: (schema: Schema.Schema.AnyNoContext) => void;
31
- onAddColumn?: () => void;
32
- };
33
-
34
- //
35
- // Root
36
- //
37
-
38
- type PipelineRootProps = PipelineContextValue;
39
-
40
- const PIPELINE_ROOT = 'Pipeline.Root';
41
-
42
- const [PipelineRoot, usePipeline] = createContext<PipelineContextValue>(PIPELINE_ROOT, {
43
- Item: itemNoOp,
44
- });
45
-
46
- PipelineRoot.displayName = PIPELINE_ROOT;
47
-
48
- //
49
- // Content
50
- //
51
-
52
- const PIPELINE_CONTENT_NAME = 'Pipeline.Content';
53
-
54
- type PipelineContentProps = {
55
- pipeline: PipelineType.Pipeline;
56
- };
57
-
58
- const PipelineContent = ({ pipeline }: PipelineContentProps) => {
59
- const [columns] = useObject(pipeline, 'columns');
60
-
61
- return (
62
- <Stack orientation='horizontal' size='contain' rail={false}>
63
- {columns.map((column) => {
64
- return <PipelineColumn key={column.view.dxn.toString()} column={column} />;
65
- })}
66
- </Stack>
67
- );
68
- };
69
-
70
- PipelineContent.displayName = PIPELINE_CONTENT_NAME;
71
-
72
- //
73
- // Toolbar
74
- //
75
-
76
- const PIPELINE_TOOLBAR_NAME = 'Pipeline.Toolbar';
77
-
78
- export const PipelineToolbar = (props: ToolbarRootProps) => {
79
- const { t } = useTranslation(meta.id);
80
- const { onAddColumn } = usePipeline(PIPELINE_TOOLBAR_NAME);
81
-
82
- return (
83
- <Toolbar.Root {...props}>
84
- <Toolbar.IconButton icon='ph--plus--regular' iconOnly label={t('add column label')} onClick={onAddColumn} />
85
- </Toolbar.Root>
86
- );
87
- };
88
-
89
- PipelineToolbar.displayName = PIPELINE_TOOLBAR_NAME;
90
-
91
- //
92
- // Project
93
- //
94
-
95
- export const PipelineComponent = {
96
- Root: PipelineRoot,
97
- Content: PipelineContent,
98
- Toolbar: PipelineToolbar,
99
- };
100
-
101
- export { usePipeline };
102
-
103
- export type { ItemProps, PipelineContextValue, PipelineRootProps };
@@ -1,226 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import * as Effect from 'effect/Effect';
7
- import React from 'react';
8
-
9
- import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { Filter, Ref } from '@dxos/client/echo';
11
- import { Obj, Query, Tag, Type } from '@dxos/echo';
12
- import { ClientPlugin } from '@dxos/plugin-client';
13
- import { InboxPlugin } from '@dxos/plugin-inbox';
14
- import { PreviewPlugin } from '@dxos/plugin-preview';
15
- import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
16
- import { faker } from '@dxos/random';
17
- import { useDatabase, useQuery } from '@dxos/react-client/echo';
18
- import { withTheme } from '@dxos/react-ui/testing';
19
- import { translations as stackTranslations } from '@dxos/react-ui-stack';
20
- import { Stack } from '@dxos/react-ui-stack';
21
- import { Collection, View } from '@dxos/schema';
22
- import { createObjectFactory } from '@dxos/schema/testing';
23
- import { Message, Organization, Person, Pipeline, Task } from '@dxos/types';
24
-
25
- import { translations } from '../translations';
26
-
27
- import { PipelineContainer } from './PipelineContainer';
28
- import { PipelineObjectSettings } from './PipelineSettings';
29
-
30
- faker.seed(0);
31
-
32
- const DefaultStory = () => {
33
- const db = useDatabase();
34
- const pipelines = useQuery(db, Filter.type(Pipeline.Pipeline));
35
- const pipeline = pipelines[0];
36
-
37
- if (!pipeline) {
38
- return <p>Loading…</p>;
39
- }
40
-
41
- return (
42
- <Stack orientation='horizontal' size='split' rail={false} classNames='pli-0'>
43
- <PipelineContainer role='article' subject={pipeline} />
44
- <PipelineObjectSettings pipeline={pipeline} classNames='border-is border-separator' />
45
- </Stack>
46
- );
47
- };
48
-
49
- const meta = {
50
- title: 'plugins/plugin-pipeline/PipelineContainer',
51
- render: DefaultStory,
52
- decorators: [
53
- withTheme(),
54
- withPluginManager({
55
- plugins: [
56
- ...corePlugins(),
57
- StorybookPlugin({}),
58
- ClientPlugin({
59
- types: [
60
- Tag.Tag,
61
- Pipeline.Pipeline,
62
- View.View,
63
- Collection.Collection,
64
- Organization.Organization,
65
- Task.Task,
66
- Person.Person,
67
- Message.Message,
68
- ],
69
- onClientInitialized: ({ client }) =>
70
- Effect.gen(function* () {
71
- yield* Effect.promise(() => client.halo.createIdentity());
72
- yield* Effect.promise(() => client.spaces.waitUntilReady());
73
- const space = client.spaces.default;
74
- yield* Effect.promise(() => space.waitUntilReady());
75
-
76
- const tag = space.db.add(Tag.make({ label: 'important', hue: 'green' }));
77
- const tagDxn = Obj.getDXN(tag).toString();
78
-
79
- // Create a view for Contacts.
80
- const personView = View.make({
81
- query: Query.select(Filter.type(Person.Person)),
82
- jsonSchema: Type.toJsonSchema(Person.Person),
83
- });
84
-
85
- // Create a view for Organizations.
86
- const organizationView = View.make({
87
- query: Query.select(Filter.type(Organization.Organization)).select(Filter.tag(tagDxn)),
88
- jsonSchema: Type.toJsonSchema(Organization.Organization),
89
- });
90
-
91
- // Create a view for Tasks.
92
- const taskView = View.make({
93
- query: Query.select(Filter.type(Task.Task)).select(Filter.tag(tagDxn)),
94
- jsonSchema: Type.toJsonSchema(Task.Task),
95
- });
96
-
97
- // Create a view for Project-Projects.
98
- const projectView = View.make({
99
- query: Query.select(Filter.type(Pipeline.Pipeline)),
100
- jsonSchema: Type.toJsonSchema(Pipeline.Pipeline),
101
- });
102
-
103
- // Create a view for Messages.
104
- const messageQueue = space.queues.create();
105
- const messageView = View.make({
106
- query: Query.select(Filter.type(Message.Message)).options({
107
- queues: [messageQueue.dxn.toString()],
108
- }),
109
- jsonSchema: Type.toJsonSchema(Message.Message),
110
- });
111
-
112
- // Create pipline with columns.
113
- const pipeline = Pipeline.make({
114
- columns: [
115
- {
116
- name: 'Contacts',
117
- view: Ref.make(personView),
118
- order: [],
119
- },
120
- {
121
- name: 'Organizations',
122
- view: Ref.make(organizationView),
123
- order: [],
124
- },
125
- {
126
- name: 'Tasks',
127
- view: Ref.make(taskView),
128
- order: [],
129
- },
130
- {
131
- name: 'Projects',
132
- view: Ref.make(projectView),
133
- order: [],
134
- },
135
- {
136
- name: 'Messages',
137
- view: Ref.make(messageView),
138
- order: [],
139
- },
140
- ],
141
- });
142
-
143
- // Add pipeline to space.
144
- space.db.add(pipeline);
145
-
146
- // Generate sample Organizations
147
- Array.from({ length: 5 }).forEach(() => {
148
- const org = Obj.make(
149
- Organization.Organization,
150
- {
151
- name: faker.company.name(),
152
- website: faker.internet.url(),
153
- description: faker.lorem.paragraph(),
154
- image: faker.image.url(),
155
- },
156
- {
157
- tags: faker.datatype.boolean() ? [Obj.getDXN(tag).toString()] : [],
158
- },
159
- );
160
- space.db.add(org);
161
- });
162
-
163
- // Generate sample Tasks
164
- Array.from({ length: 8 }).forEach(() => {
165
- const task = Obj.make(
166
- Task.Task,
167
- {
168
- title: faker.lorem.sentence(),
169
- status: faker.helpers.arrayElement(['todo', 'in-progress', 'done']) as any,
170
- priority: faker.helpers.arrayElement(['low', 'medium', 'high']) as any,
171
- },
172
- {
173
- tags: faker.datatype.boolean() ? [Obj.getDXN(tag).toString()] : [],
174
- },
175
- );
176
- space.db.add(task);
177
- });
178
-
179
- // Generate sample Contacts
180
- const factory = createObjectFactory(space.db, faker as any);
181
- yield* Effect.promise(() => factory([{ type: Person.Person, count: 12 }]));
182
-
183
- // Generate sample Projects
184
- Array.from({ length: 3 }).forEach(() => {
185
- const nestedProject = Pipeline.make({
186
- name: faker.commerce.productName(),
187
- description: faker.lorem.sentence(),
188
- });
189
- space.db.add(nestedProject);
190
- });
191
-
192
- // Generate sample Messages
193
- const messages = Array.from({ length: 6 }).map(() => {
194
- const message = Obj.make(Message.Message, {
195
- created: faker.date.recent().toISOString(),
196
- sender: { role: 'user' },
197
- blocks: [
198
- {
199
- _tag: 'text' as const,
200
- text: faker.lorem.sentences(2),
201
- },
202
- ],
203
- });
204
- return message;
205
- });
206
-
207
- yield* Effect.promise(() => messageQueue.append(messages));
208
- }),
209
- }),
210
-
211
- InboxPlugin(),
212
- PreviewPlugin(),
213
- ],
214
- }),
215
- ],
216
- parameters: {
217
- layout: 'fullscreen',
218
- translations: [...translations, ...stackTranslations],
219
- },
220
- } satisfies Meta<typeof PipelineContainer>;
221
-
222
- export default meta;
223
-
224
- type Story = StoryObj<typeof meta>;
225
-
226
- export const Default: Story = {};
@@ -1,57 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { useCallback } from 'react';
6
-
7
- import { useOperationInvoker } from '@dxos/app-framework/ui';
8
- import { Surface } from '@dxos/app-framework/ui';
9
- import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
10
- import { Obj } from '@dxos/echo';
11
- import { ATTENDABLE_PATH_SEPARATOR, DeckOperation } from '@dxos/plugin-deck/types';
12
- import { Layout } from '@dxos/react-ui';
13
- import { useAttention } from '@dxos/react-ui-attention';
14
- import { type Pipeline as PipelineType } from '@dxos/types';
15
-
16
- import { type ItemProps, PipelineComponent } from './PipelineComponent';
17
-
18
- export type PipelineContainerProps = SurfaceComponentProps<PipelineType.Pipeline>;
19
-
20
- export const PipelineContainer = ({ role, subject: pipeline }: PipelineContainerProps) => {
21
- const { invokePromise } = useOperationInvoker();
22
- const attendableId = Obj.getDXN(pipeline).toString();
23
- const { hasAttention } = useAttention(attendableId);
24
-
25
- const handleColumnAdd = useCallback(
26
- () =>
27
- invokePromise(DeckOperation.ChangeCompanion, {
28
- primary: attendableId,
29
- companion: `${attendableId}${ATTENDABLE_PATH_SEPARATOR}settings`,
30
- }),
31
- [invokePromise, attendableId],
32
- );
33
-
34
- return (
35
- <Layout.Main role={role} toolbar>
36
- <PipelineComponent.Root Item={PipelineItem} onAddColumn={handleColumnAdd}>
37
- <PipelineComponent.Toolbar disabled={!hasAttention} />
38
- <PipelineComponent.Content pipeline={pipeline} />
39
- </PipelineComponent.Root>
40
- </Layout.Main>
41
- );
42
- };
43
-
44
- const PipelineItem = ({ item, projectionModel }: ItemProps) => {
45
- return (
46
- <Surface.Surface
47
- role='card--content'
48
- data={{
49
- subject: item,
50
- projection: projectionModel,
51
- }}
52
- limit={1}
53
- />
54
- );
55
- };
56
-
57
- export default PipelineContainer;
@@ -1,29 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Schema from 'effect/Schema';
6
-
7
- import { Capability } from '@dxos/app-framework';
8
- import { Operation } from '@dxos/operation';
9
- import { SpaceSchema } from '@dxos/react-client/echo';
10
- import { Collection } from '@dxos/schema';
11
-
12
- import { meta } from '../meta';
13
-
14
- const PIPELINE_OPERATION = `${meta.id}/operation`;
15
-
16
- export namespace PipelineOperation {
17
- export const OnCreateSpace = Operation.make({
18
- meta: { key: `${PIPELINE_OPERATION}/on-create-space`, name: 'On Create Space' },
19
- services: [Capability.Service],
20
- schema: {
21
- input: Schema.Struct({
22
- space: SpaceSchema,
23
- rootCollection: Collection.Collection,
24
- isDefault: Schema.optional(Schema.Boolean),
25
- }),
26
- output: Schema.Void,
27
- },
28
- });
29
- }