@dxos/plugin-pipeline 0.8.4-main.6fa680abb7 → 0.8.4-main.7996785055
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/{PipelineContainer-FAOVECDX.mjs → PipelineContainer-LY2P4JPA.mjs} +70 -43
- package/dist/lib/browser/PipelineContainer-LY2P4JPA.mjs.map +7 -0
- package/dist/lib/browser/{PipelineObjectSettings-JFOS6Z37.mjs → PipelineObjectSettings-QFMIKJH5.mjs} +6 -6
- package/dist/lib/browser/PipelineObjectSettings-QFMIKJH5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +18 -13
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-XD6PVALN.mjs → react-surface-QVPKOGEI.mjs} +4 -4
- package/dist/lib/browser/{react-surface-XD6PVALN.mjs.map → react-surface-QVPKOGEI.mjs.map} +1 -1
- package/dist/types/src/PipelinePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +0 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- 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.map +1 -1
- 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/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -43
- package/src/PipelinePlugin.tsx +18 -5
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/react-surface/react-surface.tsx +1 -1
- package/src/components/PipelineComponent/PipelineColumn.tsx +62 -31
- package/src/components/PipelineComponent/PipelineComponent.stories.tsx +12 -10
- package/src/components/PipelineComponent/PipelineComponent.tsx +20 -11
- package/src/containers/PipelineContainer/PipelineContainer.stories.tsx +9 -8
- package/src/containers/PipelineContainer/PipelineContainer.tsx +5 -5
- package/src/containers/PipelineObjectSettings/PipelineObjectSettings.tsx +7 -5
- package/dist/lib/browser/PipelineContainer-FAOVECDX.mjs.map +0 -7
- package/dist/lib/browser/PipelineObjectSettings-JFOS6Z37.mjs.map +0 -7
- 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/src/capabilities/operation-resolver/index.ts +0 -5
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -9
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.7996785055",
|
|
4
4
|
"description": "Pipeline plugin for Composer",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -39,35 +39,36 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@radix-ui/react-compose-refs": "1.1.1",
|
|
41
41
|
"@radix-ui/react-context": "1.1.1",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"@dxos/app-
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/async": "0.8.4-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/log": "0.8.4-main.
|
|
52
|
-
"@dxos/echo-query": "0.8.4-main.
|
|
53
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/plugin-
|
|
58
|
-
"@dxos/plugin-
|
|
59
|
-
"@dxos/plugin-
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/react-
|
|
62
|
-
"@dxos/react-
|
|
63
|
-
"@dxos/react-ui-
|
|
64
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
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.
|
|
42
|
+
"@radix-ui/react-slot": "1.1.2",
|
|
43
|
+
"effect": "3.20.0",
|
|
44
|
+
"@dxos/app-framework": "0.8.4-main.7996785055",
|
|
45
|
+
"@dxos/app-toolkit": "0.8.4-main.7996785055",
|
|
46
|
+
"@dxos/assistant-toolkit": "0.8.4-main.7996785055",
|
|
47
|
+
"@dxos/async": "0.8.4-main.7996785055",
|
|
48
|
+
"@dxos/devtools": "0.8.4-main.7996785055",
|
|
49
|
+
"@dxos/echo": "0.8.4-main.7996785055",
|
|
50
|
+
"@dxos/functions": "0.8.4-main.7996785055",
|
|
51
|
+
"@dxos/log": "0.8.4-main.7996785055",
|
|
52
|
+
"@dxos/echo-query": "0.8.4-main.7996785055",
|
|
53
|
+
"@dxos/plugin-client": "0.8.4-main.7996785055",
|
|
54
|
+
"@dxos/echo-atom": "0.8.4-main.7996785055",
|
|
55
|
+
"@dxos/operation": "0.8.4-main.7996785055",
|
|
56
|
+
"@dxos/plugin-deck": "0.8.4-main.7996785055",
|
|
57
|
+
"@dxos/plugin-graph": "0.8.4-main.7996785055",
|
|
58
|
+
"@dxos/plugin-inbox": "0.8.4-main.7996785055",
|
|
59
|
+
"@dxos/plugin-markdown": "0.8.4-main.7996785055",
|
|
60
|
+
"@dxos/plugin-space": "0.8.4-main.7996785055",
|
|
61
|
+
"@dxos/react-ui-attention": "0.8.4-main.7996785055",
|
|
62
|
+
"@dxos/react-client": "0.8.4-main.7996785055",
|
|
63
|
+
"@dxos/react-ui-components": "0.8.4-main.7996785055",
|
|
64
|
+
"@dxos/react-ui-form": "0.8.4-main.7996785055",
|
|
65
|
+
"@dxos/react-ui-list": "0.8.4-main.7996785055",
|
|
66
|
+
"@dxos/react-ui-menu": "0.8.4-main.7996785055",
|
|
67
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.7996785055",
|
|
68
|
+
"@dxos/react-ui-stack": "0.8.4-main.7996785055",
|
|
69
|
+
"@dxos/schema": "0.8.4-main.7996785055",
|
|
70
|
+
"@dxos/util": "0.8.4-main.7996785055",
|
|
71
|
+
"@dxos/types": "0.8.4-main.7996785055"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
73
74
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -76,24 +77,24 @@
|
|
|
76
77
|
"react": "~19.2.3",
|
|
77
78
|
"react-dom": "~19.2.3",
|
|
78
79
|
"vite": "^7.1.11",
|
|
79
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
80
|
-
"@dxos/plugin-
|
|
81
|
-
"@dxos/plugin-
|
|
82
|
-
"@dxos/plugin-
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
80
|
+
"@dxos/echo-db": "0.8.4-main.7996785055",
|
|
81
|
+
"@dxos/plugin-attention": "0.8.4-main.7996785055",
|
|
82
|
+
"@dxos/plugin-preview": "0.8.4-main.7996785055",
|
|
83
|
+
"@dxos/plugin-theme": "0.8.4-main.7996785055",
|
|
84
|
+
"@dxos/plugin-testing": "0.8.4-main.7996785055",
|
|
85
|
+
"@dxos/react-ui": "0.8.4-main.7996785055",
|
|
86
|
+
"@dxos/random": "0.8.4-main.7996785055",
|
|
87
|
+
"@dxos/storybook-utils": "0.8.4-main.7996785055",
|
|
88
|
+
"@dxos/plugin-inbox": "0.8.4-main.7996785055",
|
|
89
|
+
"@dxos/ui-theme": "0.8.4-main.7996785055"
|
|
89
90
|
},
|
|
90
91
|
"peerDependencies": {
|
|
91
92
|
"@effect-atom/atom-react": "^0.5.0",
|
|
92
|
-
"effect": "3.
|
|
93
|
+
"effect": "3.20.0",
|
|
93
94
|
"react": "~19.2.3",
|
|
94
95
|
"react-dom": "~19.2.3",
|
|
95
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
96
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
96
|
+
"@dxos/react-ui": "0.8.4-main.7996785055",
|
|
97
|
+
"@dxos/ui-theme": "0.8.4-main.7996785055"
|
|
97
98
|
},
|
|
98
99
|
"publishConfig": {
|
|
99
100
|
"access": "public"
|
package/src/PipelinePlugin.tsx
CHANGED
|
@@ -3,13 +3,17 @@
|
|
|
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 { AppGraphBuilder,
|
|
16
|
+
import { AppGraphBuilder, ReactSurface } from './capabilities';
|
|
13
17
|
import { meta } from './meta';
|
|
14
18
|
import { translations } from './translations';
|
|
15
19
|
|
|
@@ -19,13 +23,22 @@ export const PipelinePlugin = Plugin.define(meta).pipe(
|
|
|
19
23
|
metadata: {
|
|
20
24
|
id: Pipeline.Pipeline.typename,
|
|
21
25
|
metadata: {
|
|
22
|
-
icon:
|
|
23
|
-
iconHue: '
|
|
24
|
-
createObject: ((props
|
|
26
|
+
icon: Annotation.IconAnnotation.get(Pipeline.Pipeline).pipe(Option.getOrThrow).icon,
|
|
27
|
+
iconHue: Annotation.IconAnnotation.get(Pipeline.Pipeline).pipe(Option.getOrThrow).hue ?? 'white',
|
|
28
|
+
createObject: ((props, options) =>
|
|
29
|
+
Effect.gen(function* () {
|
|
30
|
+
const object = Pipeline.make(props);
|
|
31
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
32
|
+
object,
|
|
33
|
+
target: options.target,
|
|
34
|
+
hidden: true,
|
|
35
|
+
targetNodeId: options.targetNodeId,
|
|
36
|
+
});
|
|
37
|
+
})) satisfies CreateObject,
|
|
25
38
|
},
|
|
26
39
|
},
|
|
27
40
|
}),
|
|
28
|
-
|
|
41
|
+
|
|
29
42
|
AppPlugin.addSchemaModule({ schema: [Pipeline.Pipeline] }),
|
|
30
43
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
31
44
|
AppPlugin.addTranslationsModule({ translations }),
|
|
@@ -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,14 +3,15 @@
|
|
|
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 { Annotation, JsonSchema, Obj, Query, Type } from '@dxos/echo';
|
|
11
12
|
import { resolveSchemaWithRegistry } from '@dxos/plugin-space';
|
|
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';
|
|
@@ -19,6 +20,7 @@ import { type Pipeline } from '@dxos/types';
|
|
|
19
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';
|
|
@@ -26,11 +26,13 @@ import { translations } from '../../translations';
|
|
|
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,6 +12,7 @@ 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
17
|
import { meta } from '../../meta';
|
|
16
18
|
|
|
@@ -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, { role: 'none' })} 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}>
|
|
119
|
+
<Toolbar.Root {...composableProps(props)} ref={forwardedRef}>
|
|
111
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(),
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
type SurfaceComponentProps,
|
|
15
15
|
useObjectMenuItems,
|
|
16
16
|
} from '@dxos/app-toolkit/ui';
|
|
17
|
-
import {
|
|
18
|
-
import { DeckOperation } from '@dxos/plugin-deck/
|
|
17
|
+
import { companionSegment } from '@dxos/app-toolkit';
|
|
18
|
+
import { DeckOperation } from '@dxos/plugin-deck/operations';
|
|
19
19
|
import { Panel } from '@dxos/react-ui';
|
|
20
20
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
21
21
|
import { useMenu } from '@dxos/react-ui-menu';
|
|
@@ -37,19 +37,19 @@ export const PipelineContainer = ({ role, subject: pipeline, attendableId }: Pip
|
|
|
37
37
|
const handleColumnAdd = useCallback(
|
|
38
38
|
() =>
|
|
39
39
|
invokePromise(DeckOperation.ChangeCompanion, {
|
|
40
|
-
companion:
|
|
40
|
+
companion: companionSegment('settings'),
|
|
41
41
|
}),
|
|
42
42
|
[invokePromise],
|
|
43
43
|
);
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
46
|
<PipelineComponent.Root Item={PipelineItem} onAddColumn={handleColumnAdd}>
|
|
47
|
-
<Panel.Root role={role}
|
|
47
|
+
<Panel.Root role={role}>
|
|
48
48
|
<Panel.Toolbar asChild>
|
|
49
49
|
<PipelineComponent.Toolbar disabled={!hasAttention} />
|
|
50
50
|
</Panel.Toolbar>
|
|
51
51
|
<Panel.Content asChild>
|
|
52
|
-
<PipelineComponent.Content model={model}>
|
|
52
|
+
<PipelineComponent.Content asChild model={model}>
|
|
53
53
|
<PipelineComponent.Columns pipeline={pipeline} />
|
|
54
54
|
</PipelineComponent.Content>
|
|
55
55
|
</Panel.Content>
|
|
@@ -14,7 +14,7 @@ import { IconButton, type ThemedClassName, useAsyncEffect, useTranslation } from
|
|
|
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
|
-
import { Pipeline
|
|
17
|
+
import { Pipeline } from '@dxos/types';
|
|
18
18
|
import { mx, osTranslations, subtleHover } from '@dxos/ui-theme';
|
|
19
19
|
import { arrayMove } from '@dxos/util';
|
|
20
20
|
|
|
@@ -145,13 +145,13 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
const newView = ViewModel.make({
|
|
148
|
-
query: Query.select(Filter.
|
|
149
|
-
jsonSchema: JsonSchema.toJsonSchema(
|
|
148
|
+
query: Query.select(Filter.nothing()),
|
|
149
|
+
jsonSchema: JsonSchema.toJsonSchema(Schema.Struct({})),
|
|
150
150
|
});
|
|
151
151
|
space.db.add(newView);
|
|
152
152
|
updateColumns((columns) => {
|
|
153
153
|
columns.push({
|
|
154
|
-
name: '
|
|
154
|
+
name: '',
|
|
155
155
|
// Type assertion needed due to QueryAST type variance.
|
|
156
156
|
view: Ref.make(newView) as (typeof columns)[number]['view'],
|
|
157
157
|
order: [],
|
|
@@ -182,7 +182,9 @@ export const PipelineObjectSettings = ({ classNames, pipeline }: PipelineObjectS
|
|
|
182
182
|
>
|
|
183
183
|
<div role='none' className={mx(subtleHover, listItemGrid, 'rounded-xs cursor-pointer min-h-10')}>
|
|
184
184
|
<List.ItemDragHandle />
|
|
185
|
-
<List.ItemTitle onClick={() => handleToggleField(column)}>
|
|
185
|
+
<List.ItemTitle onClick={() => handleToggleField(column)}>
|
|
186
|
+
{column.name || t('untitled view title')}
|
|
187
|
+
</List.ItemTitle>
|
|
186
188
|
<List.ItemDeleteButton
|
|
187
189
|
label={t('delete view label')}
|
|
188
190
|
autoHide={false}
|