@dxos/plugin-pipeline 0.8.4-main.6fa680abb7 → 0.8.4-main.bcb3aa67d6
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/browser/index.mjs +58 -45
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/PipelinePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +3 -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.map +1 -1
- package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts +34 -16
- package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts.map +1 -1
- package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts +21 -21
- 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 +29 -29
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/PipelineObjectSettings/PipelineObjectSettings.d.ts.map +1 -1
- package/dist/types/src/hooks/usePipelineBoardModel.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +22 -22
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +52 -43
- package/src/PipelinePlugin.tsx +20 -6
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +10 -19
- package/src/capabilities/index.ts +4 -3
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +3 -3
- package/src/components/PipelineComponent/PipelineColumn.tsx +64 -33
- package/src/components/PipelineComponent/PipelineComponent.stories.tsx +13 -11
- package/src/components/PipelineComponent/PipelineComponent.tsx +22 -13
- package/src/containers/PipelineContainer/PipelineContainer.stories.tsx +9 -8
- package/src/containers/PipelineContainer/PipelineContainer.tsx +9 -9
- package/src/containers/PipelineObjectSettings/PipelineObjectSettings.tsx +14 -13
- package/src/hooks/usePipelineBoardModel.ts +1 -1
- package/src/translations.ts +22 -22
- package/dist/lib/browser/PipelineContainer-FAOVECDX.mjs +0 -318
- package/dist/lib/browser/PipelineContainer-FAOVECDX.mjs.map +0 -7
- package/dist/lib/browser/PipelineObjectSettings-JFOS6Z37.mjs +0 -220
- package/dist/lib/browser/PipelineObjectSettings-JFOS6Z37.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/react-surface-XD6PVALN.mjs +0 -61
- package/dist/lib/browser/react-surface-XD6PVALN.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/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/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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-pipeline",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.bcb3aa67d6",
|
|
4
4
|
"description": "Pipeline plugin for Composer",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
17
|
+
"#components": "./src/components/index.ts",
|
|
18
|
+
"#containers": "./src/containers/index.ts",
|
|
19
|
+
"#hooks": "./src/hooks/index.ts",
|
|
20
|
+
"#meta": "./src/meta.ts",
|
|
21
|
+
"#types": "./src/types/index.ts"
|
|
22
|
+
},
|
|
15
23
|
"exports": {
|
|
16
24
|
".": {
|
|
17
25
|
"source": "./src/index.ts",
|
|
@@ -39,35 +47,36 @@
|
|
|
39
47
|
"dependencies": {
|
|
40
48
|
"@radix-ui/react-compose-refs": "1.1.1",
|
|
41
49
|
"@radix-ui/react-context": "1.1.1",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"@dxos/app-
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/echo": "0.8.4-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/echo-atom": "0.8.4-main.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/plugin-
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/plugin-inbox": "0.8.4-main.
|
|
58
|
-
"@dxos/plugin-
|
|
59
|
-
"@dxos/plugin-
|
|
60
|
-
"@dxos/react-
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/react-ui-
|
|
63
|
-
"@dxos/react-ui-
|
|
64
|
-
"@dxos/react-ui-
|
|
65
|
-
"@dxos/react-ui-
|
|
66
|
-
"@dxos/react-ui-menu": "0.8.4-main.
|
|
67
|
-
"@dxos/react-ui-mosaic": "0.8.4-main.
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/schema": "0.8.4-main.
|
|
70
|
-
"@dxos/util": "0.8.4-main.
|
|
50
|
+
"@radix-ui/react-slot": "1.1.2",
|
|
51
|
+
"effect": "3.20.0",
|
|
52
|
+
"@dxos/app-framework": "0.8.4-main.bcb3aa67d6",
|
|
53
|
+
"@dxos/app-toolkit": "0.8.4-main.bcb3aa67d6",
|
|
54
|
+
"@dxos/assistant-toolkit": "0.8.4-main.bcb3aa67d6",
|
|
55
|
+
"@dxos/devtools": "0.8.4-main.bcb3aa67d6",
|
|
56
|
+
"@dxos/echo": "0.8.4-main.bcb3aa67d6",
|
|
57
|
+
"@dxos/async": "0.8.4-main.bcb3aa67d6",
|
|
58
|
+
"@dxos/echo-atom": "0.8.4-main.bcb3aa67d6",
|
|
59
|
+
"@dxos/echo-query": "0.8.4-main.bcb3aa67d6",
|
|
60
|
+
"@dxos/log": "0.8.4-main.bcb3aa67d6",
|
|
61
|
+
"@dxos/functions": "0.8.4-main.bcb3aa67d6",
|
|
62
|
+
"@dxos/operation": "0.8.4-main.bcb3aa67d6",
|
|
63
|
+
"@dxos/plugin-client": "0.8.4-main.bcb3aa67d6",
|
|
64
|
+
"@dxos/plugin-graph": "0.8.4-main.bcb3aa67d6",
|
|
65
|
+
"@dxos/plugin-inbox": "0.8.4-main.bcb3aa67d6",
|
|
66
|
+
"@dxos/plugin-space": "0.8.4-main.bcb3aa67d6",
|
|
67
|
+
"@dxos/plugin-deck": "0.8.4-main.bcb3aa67d6",
|
|
68
|
+
"@dxos/react-client": "0.8.4-main.bcb3aa67d6",
|
|
69
|
+
"@dxos/plugin-markdown": "0.8.4-main.bcb3aa67d6",
|
|
70
|
+
"@dxos/react-ui-attention": "0.8.4-main.bcb3aa67d6",
|
|
71
|
+
"@dxos/react-ui-form": "0.8.4-main.bcb3aa67d6",
|
|
72
|
+
"@dxos/react-ui-components": "0.8.4-main.bcb3aa67d6",
|
|
73
|
+
"@dxos/react-ui-list": "0.8.4-main.bcb3aa67d6",
|
|
74
|
+
"@dxos/react-ui-menu": "0.8.4-main.bcb3aa67d6",
|
|
75
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.bcb3aa67d6",
|
|
76
|
+
"@dxos/react-ui-stack": "0.8.4-main.bcb3aa67d6",
|
|
77
|
+
"@dxos/schema": "0.8.4-main.bcb3aa67d6",
|
|
78
|
+
"@dxos/util": "0.8.4-main.bcb3aa67d6",
|
|
79
|
+
"@dxos/types": "0.8.4-main.bcb3aa67d6"
|
|
71
80
|
},
|
|
72
81
|
"devDependencies": {
|
|
73
82
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -76,24 +85,24 @@
|
|
|
76
85
|
"react": "~19.2.3",
|
|
77
86
|
"react-dom": "~19.2.3",
|
|
78
87
|
"vite": "^7.1.11",
|
|
79
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
80
|
-
"@dxos/plugin-
|
|
81
|
-
"@dxos/plugin-
|
|
82
|
-
"@dxos/plugin-preview": "0.8.4-main.
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/plugin-
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/ui
|
|
88
|
+
"@dxos/echo-db": "0.8.4-main.bcb3aa67d6",
|
|
89
|
+
"@dxos/plugin-attention": "0.8.4-main.bcb3aa67d6",
|
|
90
|
+
"@dxos/plugin-inbox": "0.8.4-main.bcb3aa67d6",
|
|
91
|
+
"@dxos/plugin-preview": "0.8.4-main.bcb3aa67d6",
|
|
92
|
+
"@dxos/plugin-testing": "0.8.4-main.bcb3aa67d6",
|
|
93
|
+
"@dxos/random": "0.8.4-main.bcb3aa67d6",
|
|
94
|
+
"@dxos/storybook-utils": "0.8.4-main.bcb3aa67d6",
|
|
95
|
+
"@dxos/plugin-theme": "0.8.4-main.bcb3aa67d6",
|
|
96
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6",
|
|
97
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6"
|
|
89
98
|
},
|
|
90
99
|
"peerDependencies": {
|
|
91
100
|
"@effect-atom/atom-react": "^0.5.0",
|
|
92
|
-
"effect": "3.
|
|
101
|
+
"effect": "3.20.0",
|
|
93
102
|
"react": "~19.2.3",
|
|
94
103
|
"react-dom": "~19.2.3",
|
|
95
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
96
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
104
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
105
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
|
|
97
106
|
},
|
|
98
107
|
"publishConfig": {
|
|
99
108
|
"access": "public"
|
package/src/PipelinePlugin.tsx
CHANGED
|
@@ -3,29 +3,43 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
6
7
|
|
|
7
8
|
import { Plugin } from '@dxos/app-framework';
|
|
8
9
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
+
import { Annotation } from '@dxos/echo';
|
|
11
|
+
import { Operation } from '@dxos/operation';
|
|
9
12
|
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
13
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
10
14
|
import { Pipeline } from '@dxos/types';
|
|
11
15
|
|
|
12
|
-
import {
|
|
13
|
-
import { meta } from './meta';
|
|
16
|
+
import { meta } from '#meta';
|
|
14
17
|
import { translations } from './translations';
|
|
15
18
|
|
|
19
|
+
import { AppGraphBuilder, ReactSurface } from '#capabilities';
|
|
20
|
+
|
|
16
21
|
export const PipelinePlugin = Plugin.define(meta).pipe(
|
|
17
22
|
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
18
23
|
AppPlugin.addMetadataModule({
|
|
19
24
|
metadata: {
|
|
20
25
|
id: Pipeline.Pipeline.typename,
|
|
21
26
|
metadata: {
|
|
22
|
-
icon:
|
|
23
|
-
iconHue: '
|
|
24
|
-
createObject: ((props
|
|
27
|
+
icon: Annotation.IconAnnotation.get(Pipeline.Pipeline).pipe(Option.getOrThrow).icon,
|
|
28
|
+
iconHue: Annotation.IconAnnotation.get(Pipeline.Pipeline).pipe(Option.getOrThrow).hue ?? 'white',
|
|
29
|
+
createObject: ((props, options) =>
|
|
30
|
+
Effect.gen(function* () {
|
|
31
|
+
const object = Pipeline.make(props);
|
|
32
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
33
|
+
object,
|
|
34
|
+
target: options.target,
|
|
35
|
+
hidden: true,
|
|
36
|
+
targetNodeId: options.targetNodeId,
|
|
37
|
+
});
|
|
38
|
+
})) satisfies CreateObject,
|
|
25
39
|
},
|
|
26
40
|
},
|
|
27
41
|
}),
|
|
28
|
-
|
|
42
|
+
|
|
29
43
|
AppPlugin.addSchemaModule({ schema: [Pipeline.Pipeline] }),
|
|
30
44
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
31
45
|
AppPlugin.addTranslationsModule({ translations }),
|
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
|
-
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
-
import { PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
8
|
+
import { AppCapabilities, AppNode } from '@dxos/app-toolkit';
|
|
10
9
|
import { GraphBuilder } from '@dxos/plugin-graph';
|
|
11
10
|
import { Pipeline } from '@dxos/types';
|
|
12
11
|
|
|
13
|
-
import { meta } from '
|
|
12
|
+
import { meta } from '#meta';
|
|
14
13
|
|
|
15
14
|
export default Capability.makeModule(
|
|
16
15
|
Effect.fnUntraced(function* () {
|
|
@@ -20,26 +19,18 @@ export default Capability.makeModule(
|
|
|
20
19
|
type: Pipeline.Pipeline,
|
|
21
20
|
connector: () =>
|
|
22
21
|
Effect.succeed([
|
|
23
|
-
{
|
|
22
|
+
AppNode.makeCompanion({
|
|
24
23
|
id: 'invocations',
|
|
25
|
-
|
|
24
|
+
label: ['pipeline-invocations.label', { ns: meta.id }],
|
|
25
|
+
icon: 'ph--clock-countdown--regular',
|
|
26
26
|
data: 'invocations',
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
icon: 'ph--clock-countdown--regular',
|
|
30
|
-
disposition: 'hidden',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
{
|
|
27
|
+
}),
|
|
28
|
+
AppNode.makeCompanion({
|
|
34
29
|
id: 'automation',
|
|
35
|
-
|
|
30
|
+
label: ['pipeline-automation.label', { ns: meta.id }],
|
|
31
|
+
icon: 'ph--lightning--regular',
|
|
36
32
|
data: 'automation',
|
|
37
|
-
|
|
38
|
-
label: ['pipeline automation label', { ns: meta.id }],
|
|
39
|
-
icon: 'ph--lightning--regular',
|
|
40
|
-
disposition: 'hidden',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
33
|
+
}),
|
|
43
34
|
]),
|
|
44
35
|
}),
|
|
45
36
|
]);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
8
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -12,8 +12,8 @@ import { Obj } from '@dxos/echo';
|
|
|
12
12
|
import { Panel } from '@dxos/react-ui';
|
|
13
13
|
import { Pipeline } from '@dxos/types';
|
|
14
14
|
|
|
15
|
-
import { PipelineContainer, PipelineObjectSettings } from '
|
|
16
|
-
import { meta } from '
|
|
15
|
+
import { PipelineContainer, PipelineObjectSettings } from '#containers';
|
|
16
|
+
import { meta } from '#meta';
|
|
17
17
|
|
|
18
18
|
export default Capability.makeModule(() =>
|
|
19
19
|
Effect.succeed(
|
|
@@ -36,7 +36,7 @@ export default Capability.makeModule(() =>
|
|
|
36
36
|
const db = Obj.getDatabase(data.companionTo);
|
|
37
37
|
// TODO(wittjosiah): Filter the invocations to those relevant to the project.
|
|
38
38
|
return (
|
|
39
|
-
<Panel.Root role={role} className='dx-
|
|
39
|
+
<Panel.Root role={role} className='dx-document'>
|
|
40
40
|
<Panel.Content asChild>
|
|
41
41
|
<InvocationTraceContainer db={db} detailAxis='block' />
|
|
42
42
|
</Panel.Content>
|
|
@@ -3,22 +3,24 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { useComposedRefs } from '@radix-ui/react-compose-refs';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
6
8
|
import type * as Schema from 'effect/Schema';
|
|
7
9
|
import React, { forwardRef, useMemo, useRef, useState } from 'react';
|
|
8
10
|
|
|
9
|
-
import {
|
|
10
|
-
import { JsonSchema, Obj, Query, Type } from '@dxos/echo';
|
|
11
|
-
import { resolveSchemaWithRegistry } from '@dxos/plugin-space';
|
|
11
|
+
import { resolveSchemaWithRegistry } from '@dxos/app-toolkit/query';
|
|
12
|
+
import { Annotation, JsonSchema, Obj, Query, Type } from '@dxos/echo';
|
|
12
13
|
import { Filter, getSpace, useObject } from '@dxos/react-client/echo';
|
|
13
|
-
import { useAsyncEffect, useTranslation } from '@dxos/react-ui';
|
|
14
|
+
import { Panel, Toolbar, useAsyncEffect, useTranslation } from '@dxos/react-ui';
|
|
14
15
|
import { Card } from '@dxos/react-ui';
|
|
15
16
|
import { Board, Focus, Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';
|
|
16
17
|
import { ProjectionModel, createEchoChangeCallback } from '@dxos/schema';
|
|
17
18
|
import { type Pipeline } from '@dxos/types';
|
|
18
19
|
|
|
19
|
-
import { meta } from '
|
|
20
|
+
import { meta } from '#meta';
|
|
20
21
|
|
|
21
22
|
import { type ItemProps, usePipeline } from './PipelineComponent';
|
|
23
|
+
import { Menu } from '@dxos/react-ui-menu';
|
|
22
24
|
|
|
23
25
|
//
|
|
24
26
|
// PipelineColumn
|
|
@@ -68,27 +70,37 @@ export const PipelineColumn = ({ data: column, location, classNames, debug }: Pi
|
|
|
68
70
|
return new ProjectionModel({ view, baseSchema: jsonSchema, change });
|
|
69
71
|
}, [schema, view]);
|
|
70
72
|
|
|
71
|
-
const
|
|
73
|
+
const PipelineTile = useMemo(() => {
|
|
72
74
|
return forwardRef<HTMLDivElement, Pick<MosaicTileProps<Obj.Unknown>, 'classNames' | 'location' | 'data' | 'debug'>>(
|
|
73
|
-
(props, ref) => <ItemTile {...props}
|
|
75
|
+
(props, ref) => <ItemTile {...props} itemProps={{ item: props.data, projectionModel }} ref={ref} />,
|
|
74
76
|
);
|
|
75
|
-
}, [
|
|
77
|
+
}, [projectionModel]);
|
|
76
78
|
|
|
77
79
|
if (!view) {
|
|
78
80
|
return null;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
return (
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
<Panel.Root asChild>
|
|
85
|
+
<Board.Column.Root
|
|
86
|
+
debug={debug}
|
|
87
|
+
data={column}
|
|
88
|
+
location={location}
|
|
89
|
+
classNames={classNames}
|
|
90
|
+
dragHandleRef={dragHandleRef}
|
|
91
|
+
>
|
|
92
|
+
<Panel.Toolbar asChild>
|
|
93
|
+
<Board.Column.Header
|
|
94
|
+
classNames='_opacity-10'
|
|
95
|
+
label={column.name || t('untitled-view.title')}
|
|
96
|
+
dragHandleRef={dragHandleRef}
|
|
97
|
+
/>
|
|
98
|
+
</Panel.Toolbar>
|
|
99
|
+
<Panel.Content asChild>
|
|
100
|
+
<Board.Column.Body data={column} Tile={PipelineTile} />
|
|
101
|
+
</Panel.Content>
|
|
102
|
+
</Board.Column.Root>
|
|
103
|
+
</Panel.Root>
|
|
92
104
|
);
|
|
93
105
|
};
|
|
94
106
|
|
|
@@ -109,23 +121,42 @@ const ItemTile = forwardRef<HTMLDivElement, ItemTileProps>(
|
|
|
109
121
|
const rootRef = useRef<HTMLDivElement>(null);
|
|
110
122
|
const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);
|
|
111
123
|
const { Item } = usePipeline(ITEM_TILE_NAME);
|
|
112
|
-
const
|
|
124
|
+
const icon = Function.pipe(
|
|
125
|
+
Obj.getSchema(data),
|
|
126
|
+
Option.fromNullable,
|
|
127
|
+
Option.flatMap(Annotation.IconAnnotation.get),
|
|
128
|
+
Option.map(({ icon }) => icon),
|
|
129
|
+
Option.getOrElse(() => 'ph--placeholder--regular'),
|
|
130
|
+
);
|
|
113
131
|
|
|
114
132
|
return (
|
|
115
|
-
<
|
|
116
|
-
<
|
|
117
|
-
<
|
|
118
|
-
<Card.
|
|
119
|
-
<Card.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
133
|
+
<Menu.Root>
|
|
134
|
+
<Mosaic.Tile asChild id={data.id} data={data} location={location} debug={debug}>
|
|
135
|
+
<Focus.Item asChild>
|
|
136
|
+
<Card.Root classNames={classNames} ref={composedRef}>
|
|
137
|
+
<Card.Toolbar>
|
|
138
|
+
<Card.Icon icon={icon} />
|
|
139
|
+
<Card.Title>{Obj.getLabel(data)}</Card.Title>
|
|
140
|
+
{/* TODO(wittjosiah): Reconcile with Card.Menu. */}
|
|
141
|
+
<Card.IconBlock padding>
|
|
142
|
+
<Menu.Trigger asChild>
|
|
143
|
+
<Toolbar.IconButton
|
|
144
|
+
iconOnly
|
|
145
|
+
variant='ghost'
|
|
146
|
+
icon='ph--dots-three-vertical--regular'
|
|
147
|
+
label='Actions'
|
|
148
|
+
/>
|
|
149
|
+
</Menu.Trigger>
|
|
150
|
+
<Menu.Content />
|
|
151
|
+
</Card.IconBlock>
|
|
152
|
+
</Card.Toolbar>
|
|
153
|
+
<Card.Content>
|
|
154
|
+
<Item {...itemProps} />
|
|
155
|
+
</Card.Content>
|
|
156
|
+
</Card.Root>
|
|
157
|
+
</Focus.Item>
|
|
158
|
+
</Mosaic.Tile>
|
|
159
|
+
</Menu.Root>
|
|
129
160
|
);
|
|
130
161
|
},
|
|
131
162
|
);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { RegistryContext } from '@effect-atom/atom-react';
|
|
6
6
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
|
-
import React, { useCallback, useContext, useEffect } from 'react';
|
|
7
|
+
import React, { useCallback, useContext, useEffect, useMemo } from 'react';
|
|
8
8
|
|
|
9
9
|
import { Filter, Ref } from '@dxos/client/echo';
|
|
10
10
|
import { JsonSchema, Obj, Query } from '@dxos/echo';
|
|
@@ -20,17 +20,19 @@ import { createObjectFactory } from '@dxos/schema/testing';
|
|
|
20
20
|
import { withRegistry } from '@dxos/storybook-utils';
|
|
21
21
|
import { Person, Pipeline } from '@dxos/types';
|
|
22
22
|
|
|
23
|
-
import { usePipelineBoardModel } from '
|
|
23
|
+
import { usePipelineBoardModel } from '#hooks';
|
|
24
24
|
import { translations } from '../../translations';
|
|
25
25
|
|
|
26
26
|
import { type ItemProps, PipelineComponent } from './PipelineComponent';
|
|
27
27
|
|
|
28
28
|
const StorybookProjectItem = ({ item, projectionModel }: ItemProps) => {
|
|
29
|
+
const personSchema = useMemo(() => omitId(Person.Person), []);
|
|
30
|
+
|
|
29
31
|
if (Obj.instanceOf(Person.Person, item)) {
|
|
30
32
|
const contact = item as Obj.OfShape<Person.Person>;
|
|
31
33
|
|
|
32
34
|
return (
|
|
33
|
-
<Form.Root schema={
|
|
35
|
+
<Form.Root schema={personSchema} projection={projectionModel} values={contact} autoSave>
|
|
34
36
|
<Form.Viewport>
|
|
35
37
|
<Form.Content>
|
|
36
38
|
<Form.FieldSet />
|
|
@@ -62,10 +64,10 @@ const DefaultStory = () => {
|
|
|
62
64
|
fields: ['fullName'],
|
|
63
65
|
});
|
|
64
66
|
|
|
65
|
-
Obj.change(pipeline, (
|
|
66
|
-
|
|
67
|
+
Obj.change(pipeline, (obj) => {
|
|
68
|
+
obj.columns.push({
|
|
67
69
|
name: 'New Contacts',
|
|
68
|
-
view: Ref.make(view) as (typeof
|
|
70
|
+
view: Ref.make(view) as (typeof obj.columns)[number]['view'],
|
|
69
71
|
order: [],
|
|
70
72
|
});
|
|
71
73
|
});
|
|
@@ -106,10 +108,10 @@ const MutationsStory = () => {
|
|
|
106
108
|
fields: ['fullName'],
|
|
107
109
|
});
|
|
108
110
|
|
|
109
|
-
Obj.change(pipeline, (
|
|
110
|
-
|
|
111
|
+
Obj.change(pipeline, (obj) => {
|
|
112
|
+
obj.columns.push({
|
|
111
113
|
name: 'New Contacts',
|
|
112
|
-
view: Ref.make(view) as (typeof
|
|
114
|
+
view: Ref.make(view) as (typeof obj.columns)[number]['view'],
|
|
113
115
|
order: [],
|
|
114
116
|
});
|
|
115
117
|
});
|
|
@@ -129,8 +131,8 @@ const MutationsStory = () => {
|
|
|
129
131
|
if (p < 0.4) {
|
|
130
132
|
// Append to the name
|
|
131
133
|
const contactToAdjust = faker.helpers.arrayElement(contacts);
|
|
132
|
-
Obj.change(contactToAdjust, (
|
|
133
|
-
|
|
134
|
+
Obj.change(contactToAdjust, (obj) => {
|
|
135
|
+
obj.fullName = (obj.fullName ?? '') + ' X';
|
|
134
136
|
});
|
|
135
137
|
return;
|
|
136
138
|
} else if (p < 0.7 && contacts.length > 1) {
|
|
@@ -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.change(pipeline, (
|
|
100
|
+
onChange: (mutate) => Obj.change(pipeline, (obj) => mutate(obj.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
|
|
|
@@ -13,12 +13,13 @@ 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
15
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
16
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
16
17
|
import { InboxPlugin } from '@dxos/plugin-inbox';
|
|
17
18
|
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
18
19
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
19
20
|
import { faker } from '@dxos/random';
|
|
20
21
|
import { useDatabase, useQuery } from '@dxos/react-client/echo';
|
|
21
|
-
import { withLayout
|
|
22
|
+
import { withLayout } from '@dxos/react-ui/testing';
|
|
22
23
|
import { translations as stackTranslations } from '@dxos/react-ui-stack';
|
|
23
24
|
import { ViewModel } from '@dxos/schema';
|
|
24
25
|
import { createObjectFactory } from '@dxos/schema/testing';
|
|
@@ -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' }));
|
|
@@ -196,7 +193,7 @@ const meta = {
|
|
|
196
193
|
}
|
|
197
194
|
|
|
198
195
|
// Generate sample Contacts.
|
|
199
|
-
const factory = createObjectFactory(
|
|
196
|
+
const factory = createObjectFactory(personalSpace.db, faker as any);
|
|
200
197
|
yield* Effect.promise(() => factory([{ type: Person.Person, count: 12 }]));
|
|
201
198
|
|
|
202
199
|
// Generate sample Projects.
|
|
@@ -208,7 +205,11 @@ const meta = {
|
|
|
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(),
|