@dxos/plugin-pipeline 0.8.4-main.c351d160a8 → 0.8.4-main.fcfe5033a5

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 (77) hide show
  1. package/dist/lib/browser/index.mjs +54 -43
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/types/src/PipelinePlugin.d.ts.map +1 -1
  5. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  6. package/dist/types/src/capabilities/index.d.ts +3 -3
  7. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  8. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  9. package/dist/types/src/components/PipelineComponent/PipelineColumn.d.ts.map +1 -1
  10. package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts +18 -16
  11. package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts.map +1 -1
  12. package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts +21 -21
  13. package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts.map +1 -1
  14. package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts +2 -2
  15. package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts.map +1 -1
  16. package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts +29 -29
  17. package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts.map +1 -1
  18. package/dist/types/src/containers/PipelineContainer/index.d.ts +1 -2
  19. package/dist/types/src/containers/PipelineContainer/index.d.ts.map +1 -1
  20. package/dist/types/src/containers/PipelineProperties/PipelineProperties.d.ts +11 -0
  21. package/dist/types/src/containers/PipelineProperties/PipelineProperties.d.ts.map +1 -0
  22. package/dist/types/src/containers/PipelineProperties/index.d.ts +2 -0
  23. package/dist/types/src/containers/PipelineProperties/index.d.ts.map +1 -0
  24. package/dist/types/src/containers/index.d.ts +1 -1
  25. package/dist/types/src/containers/index.d.ts.map +1 -1
  26. package/dist/types/src/hooks/usePipelineBoardModel.d.ts.map +1 -1
  27. package/dist/types/src/translations.d.ts +22 -22
  28. package/dist/types/src/translations.d.ts.map +1 -1
  29. package/dist/types/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +52 -43
  31. package/src/PipelinePlugin.tsx +16 -4
  32. package/src/capabilities/app-graph-builder.ts +40 -0
  33. package/src/capabilities/index.ts +4 -3
  34. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +12 -14
  35. package/src/components/PipelineComponent/PipelineColumn.tsx +54 -30
  36. package/src/components/PipelineComponent/PipelineComponent.stories.tsx +16 -16
  37. package/src/components/PipelineComponent/PipelineComponent.tsx +22 -13
  38. package/src/containers/PipelineContainer/PipelineContainer.stories.tsx +29 -29
  39. package/src/containers/PipelineContainer/PipelineContainer.tsx +9 -9
  40. package/src/containers/PipelineContainer/index.ts +1 -3
  41. package/src/containers/{PipelineObjectSettings/PipelineObjectSettings.tsx → PipelineProperties/PipelineProperties.tsx} +10 -11
  42. package/src/containers/PipelineProperties/index.ts +5 -0
  43. package/src/containers/index.ts +1 -1
  44. package/src/hooks/usePipelineBoardModel.ts +1 -1
  45. package/src/translations.ts +22 -22
  46. package/dist/lib/browser/PipelineContainer-V5KGYEQR.mjs +0 -318
  47. package/dist/lib/browser/PipelineContainer-V5KGYEQR.mjs.map +0 -7
  48. package/dist/lib/browser/PipelineObjectSettings-QFMIKJH5.mjs +0 -220
  49. package/dist/lib/browser/PipelineObjectSettings-QFMIKJH5.mjs.map +0 -7
  50. package/dist/lib/browser/app-graph-builder-QQKBLYFD.mjs +0 -56
  51. package/dist/lib/browser/app-graph-builder-QQKBLYFD.mjs.map +0 -7
  52. package/dist/lib/browser/chunk-3A235GUD.mjs +0 -21
  53. package/dist/lib/browser/chunk-3A235GUD.mjs.map +0 -7
  54. package/dist/lib/browser/react-surface-7PY3UOEA.mjs +0 -61
  55. package/dist/lib/browser/react-surface-7PY3UOEA.mjs.map +0 -7
  56. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  57. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  58. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  59. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -2
  60. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  61. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  62. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  63. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  64. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  65. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  66. package/dist/types/src/containers/PipelineObjectSettings/PipelineObjectSettings.d.ts +0 -11
  67. package/dist/types/src/containers/PipelineObjectSettings/PipelineObjectSettings.d.ts.map +0 -1
  68. package/dist/types/src/containers/PipelineObjectSettings/index.d.ts +0 -3
  69. package/dist/types/src/containers/PipelineObjectSettings/index.d.ts.map +0 -1
  70. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -49
  71. package/src/capabilities/app-graph-builder/index.ts +0 -7
  72. package/src/capabilities/operation-resolver/index.ts +0 -5
  73. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -9
  74. package/src/capabilities/react-surface/index.ts +0 -7
  75. package/src/containers/PipelineObjectSettings/index.ts +0 -7
  76. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  77. /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.c351d160a8",
3
+ "version": "0.8.4-main.fcfe5033a5",
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
- "effect": "3.19.16",
43
- "@dxos/async": "0.8.4-main.c351d160a8",
44
- "@dxos/app-toolkit": "0.8.4-main.c351d160a8",
45
- "@dxos/assistant-toolkit": "0.8.4-main.c351d160a8",
46
- "@dxos/devtools": "0.8.4-main.c351d160a8",
47
- "@dxos/echo-atom": "0.8.4-main.c351d160a8",
48
- "@dxos/echo-query": "0.8.4-main.c351d160a8",
49
- "@dxos/functions": "0.8.4-main.c351d160a8",
50
- "@dxos/echo": "0.8.4-main.c351d160a8",
51
- "@dxos/operation": "0.8.4-main.c351d160a8",
52
- "@dxos/log": "0.8.4-main.c351d160a8",
53
- "@dxos/plugin-client": "0.8.4-main.c351d160a8",
54
- "@dxos/plugin-deck": "0.8.4-main.c351d160a8",
55
- "@dxos/plugin-inbox": "0.8.4-main.c351d160a8",
56
- "@dxos/plugin-graph": "0.8.4-main.c351d160a8",
57
- "@dxos/plugin-space": "0.8.4-main.c351d160a8",
58
- "@dxos/plugin-markdown": "0.8.4-main.c351d160a8",
59
- "@dxos/react-client": "0.8.4-main.c351d160a8",
60
- "@dxos/react-ui-attention": "0.8.4-main.c351d160a8",
61
- "@dxos/react-ui-list": "0.8.4-main.c351d160a8",
62
- "@dxos/react-ui-form": "0.8.4-main.c351d160a8",
63
- "@dxos/react-ui-menu": "0.8.4-main.c351d160a8",
64
- "@dxos/react-ui-mosaic": "0.8.4-main.c351d160a8",
65
- "@dxos/schema": "0.8.4-main.c351d160a8",
66
- "@dxos/react-ui-stack": "0.8.4-main.c351d160a8",
67
- "@dxos/types": "0.8.4-main.c351d160a8",
68
- "@dxos/util": "0.8.4-main.c351d160a8",
69
- "@dxos/react-ui-components": "0.8.4-main.c351d160a8",
70
- "@dxos/app-framework": "0.8.4-main.c351d160a8"
50
+ "@radix-ui/react-slot": "1.1.2",
51
+ "effect": "3.20.0",
52
+ "@dxos/assistant-toolkit": "0.8.4-main.fcfe5033a5",
53
+ "@dxos/app-framework": "0.8.4-main.fcfe5033a5",
54
+ "@dxos/app-toolkit": "0.8.4-main.fcfe5033a5",
55
+ "@dxos/devtools": "0.8.4-main.fcfe5033a5",
56
+ "@dxos/echo": "0.8.4-main.fcfe5033a5",
57
+ "@dxos/echo-query": "0.8.4-main.fcfe5033a5",
58
+ "@dxos/echo-atom": "0.8.4-main.fcfe5033a5",
59
+ "@dxos/async": "0.8.4-main.fcfe5033a5",
60
+ "@dxos/functions": "0.8.4-main.fcfe5033a5",
61
+ "@dxos/log": "0.8.4-main.fcfe5033a5",
62
+ "@dxos/plugin-deck": "0.8.4-main.fcfe5033a5",
63
+ "@dxos/plugin-graph": "0.8.4-main.fcfe5033a5",
64
+ "@dxos/plugin-client": "0.8.4-main.fcfe5033a5",
65
+ "@dxos/plugin-markdown": "0.8.4-main.fcfe5033a5",
66
+ "@dxos/plugin-inbox": "0.8.4-main.fcfe5033a5",
67
+ "@dxos/plugin-space": "0.8.4-main.fcfe5033a5",
68
+ "@dxos/react-ui-attention": "0.8.4-main.fcfe5033a5",
69
+ "@dxos/react-ui-form": "0.8.4-main.fcfe5033a5",
70
+ "@dxos/react-ui-list": "0.8.4-main.fcfe5033a5",
71
+ "@dxos/react-client": "0.8.4-main.fcfe5033a5",
72
+ "@dxos/react-ui-components": "0.8.4-main.fcfe5033a5",
73
+ "@dxos/react-ui-menu": "0.8.4-main.fcfe5033a5",
74
+ "@dxos/react-ui-mosaic": "0.8.4-main.fcfe5033a5",
75
+ "@dxos/schema": "0.8.4-main.fcfe5033a5",
76
+ "@dxos/react-ui-stack": "0.8.4-main.fcfe5033a5",
77
+ "@dxos/types": "0.8.4-main.fcfe5033a5",
78
+ "@dxos/util": "0.8.4-main.fcfe5033a5",
79
+ "@dxos/operation": "0.8.4-main.fcfe5033a5"
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.c351d160a8",
80
- "@dxos/plugin-attention": "0.8.4-main.c351d160a8",
81
- "@dxos/plugin-inbox": "0.8.4-main.c351d160a8",
82
- "@dxos/plugin-preview": "0.8.4-main.c351d160a8",
83
- "@dxos/plugin-testing": "0.8.4-main.c351d160a8",
84
- "@dxos/plugin-theme": "0.8.4-main.c351d160a8",
85
- "@dxos/react-ui": "0.8.4-main.c351d160a8",
86
- "@dxos/storybook-utils": "0.8.4-main.c351d160a8",
87
- "@dxos/ui-theme": "0.8.4-main.c351d160a8",
88
- "@dxos/random": "0.8.4-main.c351d160a8"
88
+ "@dxos/echo-db": "0.8.4-main.fcfe5033a5",
89
+ "@dxos/plugin-inbox": "0.8.4-main.fcfe5033a5",
90
+ "@dxos/plugin-attention": "0.8.4-main.fcfe5033a5",
91
+ "@dxos/plugin-preview": "0.8.4-main.fcfe5033a5",
92
+ "@dxos/plugin-testing": "0.8.4-main.fcfe5033a5",
93
+ "@dxos/plugin-theme": "0.8.4-main.fcfe5033a5",
94
+ "@dxos/random": "0.8.4-main.fcfe5033a5",
95
+ "@dxos/react-ui": "0.8.4-main.fcfe5033a5",
96
+ "@dxos/storybook-utils": "0.8.4-main.fcfe5033a5",
97
+ "@dxos/ui-theme": "0.8.4-main.fcfe5033a5"
89
98
  },
90
99
  "peerDependencies": {
91
100
  "@effect-atom/atom-react": "^0.5.0",
92
- "effect": "3.19.16",
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.c351d160a8",
96
- "@dxos/ui-theme": "0.8.4-main.c351d160a8"
104
+ "@dxos/react-ui": "0.8.4-main.fcfe5033a5",
105
+ "@dxos/ui-theme": "0.8.4-main.fcfe5033a5"
97
106
  },
98
107
  "publishConfig": {
99
108
  "access": "public"
@@ -8,11 +8,14 @@ import * as Option from 'effect/Option';
8
8
  import { Plugin } from '@dxos/app-framework';
9
9
  import { AppPlugin } from '@dxos/app-toolkit';
10
10
  import { Annotation } from '@dxos/echo';
11
+ import { Operation } from '@dxos/operation';
12
+ import { SpaceOperation } from '@dxos/plugin-space/operations';
11
13
  import { type CreateObject } from '@dxos/plugin-space/types';
12
14
  import { Pipeline } from '@dxos/types';
13
15
 
14
- import { AppGraphBuilder, OperationResolver, ReactSurface } from './capabilities';
15
- import { meta } from './meta';
16
+ import { AppGraphBuilder, ReactSurface } from '#capabilities';
17
+ import { meta } from '#meta';
18
+
16
19
  import { translations } from './translations';
17
20
 
18
21
  export const PipelinePlugin = Plugin.define(meta).pipe(
@@ -23,11 +26,20 @@ export const PipelinePlugin = Plugin.define(meta).pipe(
23
26
  metadata: {
24
27
  icon: Annotation.IconAnnotation.get(Pipeline.Pipeline).pipe(Option.getOrThrow).icon,
25
28
  iconHue: Annotation.IconAnnotation.get(Pipeline.Pipeline).pipe(Option.getOrThrow).hue ?? 'white',
26
- createObject: ((props) => Effect.sync(() => Pipeline.make(props))) satisfies CreateObject,
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,
27
39
  },
28
40
  },
29
41
  }),
30
- AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
42
+
31
43
  AppPlugin.addSchemaModule({ schema: [Pipeline.Pipeline] }),
32
44
  AppPlugin.addSurfaceModule({ activate: ReactSurface }),
33
45
  AppPlugin.addTranslationsModule({ translations }),
@@ -0,0 +1,40 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities, AppNode } from '@dxos/app-toolkit';
9
+ import { GraphBuilder } from '@dxos/plugin-graph';
10
+ import { Pipeline } from '@dxos/types';
11
+
12
+ import { meta } from '#meta';
13
+
14
+ export default Capability.makeModule(
15
+ Effect.fnUntraced(function* () {
16
+ const extensions = yield* Effect.all([
17
+ GraphBuilder.createTypeExtension({
18
+ id: 'triggers',
19
+ type: Pipeline.Pipeline,
20
+ connector: () =>
21
+ Effect.succeed([
22
+ AppNode.makeCompanion({
23
+ id: 'invocations',
24
+ label: ['pipeline-invocations.label', { ns: meta.id }],
25
+ icon: 'ph--clock-countdown--regular',
26
+ data: 'invocations',
27
+ }),
28
+ AppNode.makeCompanion({
29
+ id: 'automation',
30
+ label: ['pipeline-automation.label', { ns: meta.id }],
31
+ icon: 'ph--lightning--regular',
32
+ data: 'automation',
33
+ }),
34
+ ]),
35
+ }),
36
+ ]);
37
+
38
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
39
+ }),
40
+ );
@@ -2,6 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './app-graph-builder';
6
- export * from './operation-resolver';
7
- export * from './react-surface';
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'));
@@ -7,31 +7,30 @@ import React from 'react';
7
7
 
8
8
  import { Capabilities, Capability } from '@dxos/app-framework';
9
9
  import { Surface } from '@dxos/app-framework/ui';
10
+ import { AppSurface } from '@dxos/app-toolkit/ui';
10
11
  import { InvocationTraceContainer } from '@dxos/devtools';
11
12
  import { Obj } from '@dxos/echo';
12
13
  import { Panel } from '@dxos/react-ui';
13
14
  import { Pipeline } from '@dxos/types';
14
15
 
15
- import { PipelineContainer, PipelineObjectSettings } from '../../containers';
16
- import { meta } from '../../meta';
16
+ import { PipelineContainer, PipelineProperties } from '#containers';
17
17
 
18
18
  export default Capability.makeModule(() =>
19
19
  Effect.succeed(
20
20
  Capability.contributes(Capabilities.ReactSurface, [
21
21
  Surface.create({
22
- id: meta.id,
23
- role: 'article',
24
- filter: (data): data is { attendableId: string; subject: Pipeline.Pipeline } =>
25
- typeof data.attendableId === 'string' && Obj.instanceOf(Pipeline.Pipeline, data.subject),
22
+ id: 'root',
23
+ filter: AppSurface.object(AppSurface.Article, Pipeline.Pipeline),
26
24
  component: ({ data, role }) => (
27
25
  <PipelineContainer role={role} subject={data.subject} attendableId={data.attendableId} />
28
26
  ),
29
27
  }),
30
28
  Surface.create({
31
- id: `${meta.id}.companion.invocations`,
32
- role: 'article',
33
- filter: (data): data is { companionTo: Pipeline.Pipeline } =>
34
- Obj.instanceOf(Pipeline.Pipeline, data.companionTo) && data.subject === 'invocations',
29
+ id: 'companion.invocations',
30
+ filter: AppSurface.allOf(
31
+ AppSurface.literal(AppSurface.Article, 'invocations'),
32
+ AppSurface.companion(AppSurface.Article, Pipeline.Pipeline),
33
+ ),
35
34
  component: ({ data, role }) => {
36
35
  const db = Obj.getDatabase(data.companionTo);
37
36
  // TODO(wittjosiah): Filter the invocations to those relevant to the project.
@@ -45,10 +44,9 @@ export default Capability.makeModule(() =>
45
44
  },
46
45
  }),
47
46
  Surface.create({
48
- id: `${meta.id}.object-settings`,
49
- role: 'object-settings',
50
- filter: (data): data is { subject: Pipeline.Pipeline } => Obj.instanceOf(Pipeline.Pipeline, data.subject),
51
- component: ({ data }) => <PipelineObjectSettings pipeline={data.subject} />,
47
+ id: 'object-properties',
48
+ filter: AppSurface.object(AppSurface.ObjectProperties, Pipeline.Pipeline),
49
+ component: ({ data }) => <PipelineProperties pipeline={data.subject} />,
52
50
  }),
53
51
  ]),
54
52
  ),
@@ -8,16 +8,17 @@ import * as Option from 'effect/Option';
8
8
  import type * as Schema from 'effect/Schema';
9
9
  import React, { forwardRef, useMemo, useRef, useState } from 'react';
10
10
 
11
+ import { resolveSchemaWithRegistry } from '@dxos/app-toolkit/query';
11
12
  import { Annotation, JsonSchema, Obj, Query, Type } from '@dxos/echo';
12
- import { resolveSchemaWithRegistry } from '@dxos/plugin-space';
13
13
  import { Filter, getSpace, useObject } from '@dxos/react-client/echo';
14
- import { useAsyncEffect, useTranslation } from '@dxos/react-ui';
14
+ import { Panel, Toolbar, useAsyncEffect, useTranslation } from '@dxos/react-ui';
15
15
  import { Card } from '@dxos/react-ui';
16
+ import { Menu } from '@dxos/react-ui-menu';
16
17
  import { Board, Focus, Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';
17
18
  import { ProjectionModel, createEchoChangeCallback } from '@dxos/schema';
18
19
  import { type Pipeline } from '@dxos/types';
19
20
 
20
- import { meta } from '../../meta';
21
+ import { meta } from '#meta';
21
22
 
22
23
  import { type ItemProps, usePipeline } from './PipelineComponent';
23
24
 
@@ -69,27 +70,37 @@ export const PipelineColumn = ({ data: column, location, classNames, debug }: Pi
69
70
  return new ProjectionModel({ view, baseSchema: jsonSchema, change });
70
71
  }, [schema, view]);
71
72
 
72
- const Tile = useMemo(() => {
73
+ const PipelineTile = useMemo(() => {
73
74
  return forwardRef<HTMLDivElement, Pick<MosaicTileProps<Obj.Unknown>, 'classNames' | 'location' | 'data' | 'debug'>>(
74
- (props, ref) => <ItemTile {...props} ref={ref} itemProps={{ item: props.data, projectionModel }} />,
75
+ (props, ref) => <ItemTile {...props} itemProps={{ item: props.data, projectionModel }} ref={ref} />,
75
76
  );
76
- }, [Item, projectionModel]);
77
+ }, [projectionModel]);
77
78
 
78
79
  if (!view) {
79
80
  return null;
80
81
  }
81
82
 
82
83
  return (
83
- <Board.Column.Root
84
- data={column}
85
- location={location}
86
- classNames={['group/column grid h-full overflow-hidden grid-rows-[var(--dx-rail-action)_1fr]', classNames]}
87
- debug={debug}
88
- dragHandleRef={dragHandleRef}
89
- >
90
- <Board.Column.Header label={column.name || t('untitled view title')} dragHandleRef={dragHandleRef} />
91
- <Board.Column.Body data={column} Tile={Tile} />
92
- </Board.Column.Root>
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>
93
104
  );
94
105
  };
95
106
 
@@ -119,20 +130,33 @@ const ItemTile = forwardRef<HTMLDivElement, ItemTileProps>(
119
130
  );
120
131
 
121
132
  return (
122
- <Mosaic.Tile asChild id={data.id} data={data} location={location} debug={debug}>
123
- <Focus.Group asChild>
124
- <Card.Root classNames={classNames} ref={composedRef}>
125
- <Card.Toolbar>
126
- <Card.Icon icon={icon} />
127
- <Card.Title>{Obj.getLabel(data)}</Card.Title>
128
- <Card.Menu />
129
- </Card.Toolbar>
130
- <Card.Content>
131
- <Item {...itemProps} />
132
- </Card.Content>
133
- </Card.Root>
134
- </Focus.Group>
135
- </Mosaic.Tile>
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>
136
160
  );
137
161
  },
138
162
  );
@@ -9,20 +9,20 @@ import React, { useCallback, useContext, useEffect, useMemo } from 'react';
9
9
  import { Filter, Ref } from '@dxos/client/echo';
10
10
  import { JsonSchema, Obj, Query } from '@dxos/echo';
11
11
  import { Collection, View } from '@dxos/echo';
12
- import { faker } from '@dxos/random';
12
+ import { random } from '@dxos/random';
13
13
  import { useQuery } from '@dxos/react-client/echo';
14
14
  import { useClientStory, withClientProvider } from '@dxos/react-client/testing';
15
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
16
15
  import { Form, omitId } from '@dxos/react-ui-form';
17
16
  import { withMosaic } from '@dxos/react-ui-mosaic/testing';
17
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
18
18
  import { ViewModel } from '@dxos/schema';
19
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 '../../hooks';
24
- import { translations } from '../../translations';
23
+ import { usePipelineBoardModel } from '#hooks';
25
24
 
25
+ import { translations } from '../../translations';
26
26
  import { type ItemProps, PipelineComponent } from './PipelineComponent';
27
27
 
28
28
  const StorybookProjectItem = ({ item, projectionModel }: ItemProps) => {
@@ -64,10 +64,10 @@ const DefaultStory = () => {
64
64
  fields: ['fullName'],
65
65
  });
66
66
 
67
- Obj.change(pipeline, (p) => {
68
- p.columns.push({
67
+ Obj.change(pipeline, (pipeline) => {
68
+ pipeline.columns.push({
69
69
  name: 'New Contacts',
70
- view: Ref.make(view) as (typeof p.columns)[number]['view'],
70
+ view: Ref.make(view) as (typeof pipeline.columns)[number]['view'],
71
71
  order: [],
72
72
  });
73
73
  });
@@ -108,10 +108,10 @@ const MutationsStory = () => {
108
108
  fields: ['fullName'],
109
109
  });
110
110
 
111
- Obj.change(pipeline, (p) => {
112
- p.columns.push({
111
+ Obj.change(pipeline, (pipeline) => {
112
+ pipeline.columns.push({
113
113
  name: 'New Contacts',
114
- view: Ref.make(view) as (typeof p.columns)[number]['view'],
114
+ view: Ref.make(view) as (typeof pipeline.columns)[number]['view'],
115
115
  order: [],
116
116
  });
117
117
  });
@@ -125,19 +125,19 @@ const MutationsStory = () => {
125
125
  }
126
126
 
127
127
  const interval = setInterval(() => {
128
- const factory = createObjectFactory(space.db, faker as any);
128
+ const factory = createObjectFactory(space.db, random as any);
129
129
  const p = Math.random();
130
130
 
131
131
  if (p < 0.4) {
132
132
  // Append to the name
133
- const contactToAdjust = faker.helpers.arrayElement(contacts);
134
- Obj.change(contactToAdjust, (c) => {
135
- c.fullName = (c.fullName ?? '') + ' X';
133
+ const contactToAdjust = random.helpers.arrayElement(contacts);
134
+ Obj.change(contactToAdjust, (contactToAdjust) => {
135
+ contactToAdjust.fullName = (contactToAdjust.fullName ?? '') + ' X';
136
136
  });
137
137
  return;
138
138
  } else if (p < 0.7 && contacts.length > 1) {
139
139
  // Remove a contact (30% chance, but only if we have more than 1)
140
- const contactToRemove = faker.helpers.arrayElement(contacts);
140
+ const contactToRemove = random.helpers.arrayElement(contacts);
141
141
  space.db.remove(contactToRemove);
142
142
  } else {
143
143
  // Add a new contact (30% chance)
@@ -195,7 +195,7 @@ const meta = {
195
195
  );
196
196
 
197
197
  // Generate random contacts.
198
- const factory = createObjectFactory(space.db, faker as any);
198
+ const factory = createObjectFactory(space.db, random as any);
199
199
  await factory([{ type: Person.Person, count: 12 }]);
200
200
  },
201
201
  }),
@@ -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 '../../meta';
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 = ({ model, children, ...props }: PipelineContentProps) => (
63
- <Board.Root {...props} model={model}>
64
- {children}
65
- </Board.Root>
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 }: PipelineColumnsProps) => {
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, (p) => mutate(p.columns)),
100
+ onChange: (mutate) => Obj.change(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: ToolbarRootProps) => {
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 column label')} onClick={onAddColumn} />
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