@dxos/plugin-pipeline 0.8.4-main.c85a9c8dae → 0.8.4-main.effb148878
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/PipelineArticle-6JIVXMYF.mjs +69 -0
- package/dist/lib/neutral/PipelineArticle-6JIVXMYF.mjs.map +7 -0
- package/dist/lib/neutral/PipelinePlugin.mjs +26 -0
- package/dist/lib/neutral/PipelinePlugin.mjs.map +7 -0
- package/dist/lib/neutral/PipelinePlugin.node.mjs +21 -0
- package/dist/lib/neutral/PipelinePlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/PipelinePlugin.workerd.mjs +16 -0
- package/dist/lib/neutral/PipelinePlugin.workerd.mjs.map +7 -0
- package/dist/lib/{browser/PipelineObjectSettings-D36OYVHW.mjs → neutral/PipelineProperties-NFNEU3NR.mjs} +56 -69
- package/dist/lib/neutral/PipelineProperties-NFNEU3NR.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-ZLGRWRJU.mjs +44 -0
- package/dist/lib/neutral/app-graph-builder-ZLGRWRJU.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-OVZ2ASS7.mjs +33 -0
- package/dist/lib/neutral/chunk-OVZ2ASS7.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +207 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-6Z4MMGX4.mjs +26 -0
- package/dist/lib/neutral/create-object-6Z4MMGX4.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +70 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +7 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +11 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-surface-ZGQVH4VX.mjs → neutral/react-surface-4W5YLCHT.mjs} +15 -26
- package/dist/lib/neutral/react-surface-4W5YLCHT.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +39 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +1 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/PipelinePlugin.d.ts +1 -0
- package/dist/types/src/PipelinePlugin.d.ts.map +1 -1
- package/dist/types/src/PipelinePlugin.node.d.ts +4 -0
- package/dist/types/src/PipelinePlugin.node.d.ts.map +1 -0
- package/dist/types/src/PipelinePlugin.test.d.ts +2 -0
- package/dist/types/src/PipelinePlugin.test.d.ts.map +1 -0
- package/dist/types/src/PipelinePlugin.workerd.d.ts +4 -0
- package/dist/types/src/PipelinePlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +9 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/{PipelineColumn.d.ts → PipelineComponent/PipelineColumn.d.ts} +4 -4
- package/dist/types/src/components/PipelineComponent/PipelineColumn.d.ts.map +1 -0
- package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts +53 -0
- package/dist/types/src/components/PipelineComponent/PipelineComponent.d.ts.map +1 -0
- package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts +62 -0
- package/dist/types/src/components/PipelineComponent/PipelineComponent.stories.d.ts.map +1 -0
- package/dist/types/src/components/PipelineComponent/index.d.ts +3 -0
- package/dist/types/src/components/PipelineComponent/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/PipelineArticle/PipelineArticle.d.ts +6 -0
- package/dist/types/src/containers/PipelineArticle/PipelineArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PipelineArticle/PipelineArticle.stories.d.ts +76 -0
- package/dist/types/src/containers/PipelineArticle/PipelineArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/PipelineArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PipelineArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PipelineProperties/PipelineProperties.d.ts +11 -0
- package/dist/types/src/containers/PipelineProperties/PipelineProperties.d.ts.map +1 -0
- package/dist/types/src/containers/PipelineProperties/index.d.ts +2 -0
- package/dist/types/src/containers/PipelineProperties/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +2 -2
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/usePipelineBoardModel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/templates/research.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +44 -25
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +103 -57
- package/src/PipelinePlugin.node.ts +19 -0
- package/src/PipelinePlugin.test.ts +27 -0
- package/src/PipelinePlugin.tsx +7 -31
- package/src/PipelinePlugin.workerd.ts +16 -0
- package/src/capabilities/app-graph-builder.ts +40 -0
- package/src/capabilities/create-object.ts +30 -0
- package/src/capabilities/index.ts +5 -3
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +16 -15
- package/src/components/PipelineComponent/PipelineColumn.tsx +163 -0
- package/src/components/{PipelineComponent.stories.tsx → PipelineComponent/PipelineComponent.stories.tsx} +21 -21
- package/src/components/{PipelineComponent.tsx → PipelineComponent/PipelineComponent.tsx} +22 -13
- package/src/components/PipelineComponent/index.ts +6 -0
- package/src/components/index.ts +0 -1
- package/src/containers/{PipelineContainer/PipelineContainer.stories.tsx → PipelineArticle/PipelineArticle.stories.tsx} +44 -45
- package/src/containers/{PipelineContainer/PipelineContainer.tsx → PipelineArticle/PipelineArticle.tsx} +14 -17
- package/src/containers/PipelineArticle/index.ts +5 -0
- package/src/containers/{PipelineObjectSettings/PipelineObjectSettings.tsx → PipelineProperties/PipelineProperties.tsx} +68 -75
- package/src/containers/PipelineProperties/index.ts +5 -0
- package/src/containers/index.ts +2 -2
- package/src/hooks/usePipelineBoardModel.ts +6 -6
- package/src/index.ts +0 -1
- package/src/meta.ts +15 -3
- package/src/plugin.ts +9 -0
- package/src/templates/research.ts +8 -7
- package/src/translations.ts +24 -22
- package/src/types/index.ts +0 -3
- package/dist/lib/browser/PipelineContainer-2ZYSZATA.mjs +0 -320
- package/dist/lib/browser/PipelineContainer-2ZYSZATA.mjs.map +0 -7
- package/dist/lib/browser/PipelineObjectSettings-D36OYVHW.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-NUJB33F7.mjs +0 -65
- package/dist/lib/browser/app-graph-builder-NUJB33F7.mjs.map +0 -7
- package/dist/lib/browser/chunk-N6FZHYWT.mjs +0 -42
- package/dist/lib/browser/chunk-N6FZHYWT.mjs.map +0 -7
- package/dist/lib/browser/chunk-QWNKLHBY.mjs +0 -28
- package/dist/lib/browser/chunk-QWNKLHBY.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -109
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-ZGQVH4VX.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -2
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/PipelineColumn.d.ts.map +0 -1
- package/dist/types/src/components/PipelineComponent.d.ts +0 -47
- package/dist/types/src/components/PipelineComponent.d.ts.map +0 -1
- package/dist/types/src/components/PipelineComponent.stories.d.ts +0 -42
- package/dist/types/src/components/PipelineComponent.stories.d.ts.map +0 -1
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts +0 -6
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.d.ts.map +0 -1
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts +0 -56
- package/dist/types/src/containers/PipelineContainer/PipelineContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/PipelineContainer/index.d.ts +0 -3
- package/dist/types/src/containers/PipelineContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/PipelineObjectSettings/PipelineObjectSettings.d.ts +0 -11
- package/dist/types/src/containers/PipelineObjectSettings/PipelineObjectSettings.d.ts.map +0 -1
- package/dist/types/src/containers/PipelineObjectSettings/index.d.ts +0 -3
- package/dist/types/src/containers/PipelineObjectSettings/index.d.ts.map +0 -1
- package/dist/types/src/types/PipelineAction.d.ts +0 -25
- package/dist/types/src/types/PipelineAction.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -51
- 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 -29
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/components/PipelineColumn.tsx +0 -133
- package/src/containers/PipelineContainer/index.ts +0 -7
- package/src/containers/PipelineObjectSettings/index.ts +0 -7
- package/src/types/PipelineAction.ts +0 -29
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/capabilities/app-graph-builder.ts
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { Capability } from "@dxos/app-framework";
|
|
4
|
+
import { AppCapabilities, AppNode } from "@dxos/app-toolkit";
|
|
5
|
+
import { GraphBuilder } from "@dxos/plugin-graph";
|
|
6
|
+
import { Pipeline } from "@dxos/types";
|
|
7
|
+
import { meta } from "#meta";
|
|
8
|
+
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
9
|
+
const extensions = yield* Effect.all([
|
|
10
|
+
GraphBuilder.createTypeExtension({
|
|
11
|
+
id: "triggers",
|
|
12
|
+
type: Pipeline.Pipeline,
|
|
13
|
+
connector: () => Effect.succeed([
|
|
14
|
+
AppNode.makeCompanion({
|
|
15
|
+
id: "invocations",
|
|
16
|
+
label: [
|
|
17
|
+
"pipeline-invocations.label",
|
|
18
|
+
{
|
|
19
|
+
ns: meta.id
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
icon: "ph--clock-countdown--regular",
|
|
23
|
+
data: "invocations"
|
|
24
|
+
}),
|
|
25
|
+
AppNode.makeCompanion({
|
|
26
|
+
id: "automation",
|
|
27
|
+
label: [
|
|
28
|
+
"pipeline-automation.label",
|
|
29
|
+
{
|
|
30
|
+
ns: meta.id
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
icon: "ph--lightning--regular",
|
|
34
|
+
data: "automation"
|
|
35
|
+
})
|
|
36
|
+
])
|
|
37
|
+
})
|
|
38
|
+
]);
|
|
39
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
40
|
+
}));
|
|
41
|
+
export {
|
|
42
|
+
app_graph_builder_default as default
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=app-graph-builder-ZLGRWRJU.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode } from '@dxos/app-toolkit';\nimport { GraphBuilder } from '@dxos/plugin-graph';\nimport { Pipeline } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n GraphBuilder.createTypeExtension({\n id: 'triggers',\n type: Pipeline.Pipeline,\n connector: () =>\n Effect.succeed([\n AppNode.makeCompanion({\n id: 'invocations',\n label: ['pipeline-invocations.label', { ns: meta.id }],\n icon: 'ph--clock-countdown--regular',\n data: 'invocations',\n }),\n AppNode.makeCompanion({\n id: 'automation',\n label: ['pipeline-automation.label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n data: 'automation',\n }),\n ]),\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,eAAe;AACzC,SAASC,oBAAoB;AAC7B,SAASC,gBAAgB;AAEzB,SAASC,YAAY;AAErB,IAAA,4BAAeL,WAAWM,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAcC,WAAI;IACnCN,aAAaO,oBAAoB;MAC/BC,IAAI;MACJC,MAAMR,SAASA;MACfS,WAAW,MACFC,eAAQ;QACbZ,QAAQa,cAAc;UACpBJ,IAAI;UACJK,OAAO;YAAC;YAA8B;cAAEC,IAAIZ,KAAKM;YAAG;;UACpDO,MAAM;UACNC,MAAM;QACR,CAAA;QACAjB,QAAQa,cAAc;UACpBJ,IAAI;UACJK,OAAO;YAAC;YAA6B;cAAEC,IAAIZ,KAAKM;YAAG;;UACnDO,MAAM;UACNC,MAAM;QACR,CAAA;OACD;IACL,CAAA;GACD;AAED,SAAOnB,WAAWoB,YAAYnB,gBAAgBoB,iBAAiBb,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capability", "AppCapabilities", "AppNode", "GraphBuilder", "Pipeline", "meta", "makeModule", "fnUntraced", "extensions", "all", "createTypeExtension", "id", "type", "connector", "succeed", "makeCompanion", "label", "ns", "icon", "data", "contributes", "AppGraphBuilder"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/capabilities/index.ts
|
|
2
|
+
import { Capability } from "@dxos/app-framework";
|
|
3
|
+
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-ZLGRWRJU.mjs"));
|
|
4
|
+
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-6Z4MMGX4.mjs"));
|
|
5
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-4W5YLCHT.mjs"));
|
|
6
|
+
export {
|
|
7
|
+
AppGraphBuilder,
|
|
8
|
+
CreateObject,
|
|
9
|
+
ReactSurface
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/capabilities/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,kBAAkB;AAEpB,IAAMC,kBAAkBD,WAAWE,KAAK,mBAAmB,MAAM,OAAO,mCAAA,CAAA;AACxE,IAAMC,eAAeH,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAME,eAAeJ,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "AppGraphBuilder", "lazy", "CreateObject", "ReactSurface"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/meta.ts
|
|
2
|
+
import { trim } from "@dxos/util";
|
|
3
|
+
var meta = {
|
|
4
|
+
id: "org.dxos.plugin.pipeline",
|
|
5
|
+
name: "Pipelines",
|
|
6
|
+
author: "DXOS",
|
|
7
|
+
description: trim`
|
|
8
|
+
A multi-column Kanban-style pipeline plugin for DXOS Composer.
|
|
9
|
+
Each Pipeline holds an ordered set of Columns; each Column is backed by a ViewModel whose query
|
|
10
|
+
can select any ECHO object type — messages, contacts, documents, or custom types — from the active space.
|
|
11
|
+
|
|
12
|
+
Columns are fully configurable through the Settings companion panel, where users can add, rename,
|
|
13
|
+
reorder, and delete columns and edit the underlying query and projection for each column.
|
|
14
|
+
Objects can be dragged between columns and the full pipeline state, including column order and
|
|
15
|
+
per-column item order, persists collaboratively via ECHO.
|
|
16
|
+
|
|
17
|
+
A built-in Research template scaffolds a four-column pipeline wired to the Mailbox, Contacts,
|
|
18
|
+
Organizations, and Notes objects in the space, providing an out-of-the-box CRM-style workflow.
|
|
19
|
+
Pipeline articles also expose Invocations and Automation companion tabs for AI-driven automation.
|
|
20
|
+
`,
|
|
21
|
+
icon: "ph--path--regular",
|
|
22
|
+
iconHue: "purple",
|
|
23
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-pipeline",
|
|
24
|
+
spec: "PLUGIN.mdl",
|
|
25
|
+
tags: [
|
|
26
|
+
"labs"
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
meta
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=chunk-OVZ2ASS7.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.pipeline',\n name: 'Pipelines',\n author: 'DXOS',\n description: trim`\n A multi-column Kanban-style pipeline plugin for DXOS Composer.\n Each Pipeline holds an ordered set of Columns; each Column is backed by a ViewModel whose query\n can select any ECHO object type — messages, contacts, documents, or custom types — from the active space.\n\n Columns are fully configurable through the Settings companion panel, where users can add, rename,\n reorder, and delete columns and edit the underlying query and projection for each column.\n Objects can be dragged between columns and the full pipeline state, including column order and\n per-column item order, persists collaboratively via ECHO.\n\n A built-in Research template scaffolds a four-column pipeline wired to the Mailbox, Contacts,\n Organizations, and Notes objects in the space, providing an out-of-the-box CRM-style workflow.\n Pipeline articles also expose Invocations and Automation companion tabs for AI-driven automation.\n `,\n icon: 'ph--path--regular',\n iconHue: 'purple',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-pipeline',\n spec: 'PLUGIN.mdl',\n tags: ['labs'],\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC,aAAaL;;;;;;;;;;;;;;EAcbM,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,MAAM;IAAC;;AACT;",
|
|
6
|
+
"names": ["trim", "meta", "id", "name", "author", "description", "icon", "iconHue", "source", "spec", "tags"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
// src/components/PipelineComponent/PipelineColumn.tsx
|
|
2
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
3
|
+
import * as Function from "effect/Function";
|
|
4
|
+
import * as Option from "effect/Option";
|
|
5
|
+
import React2, { forwardRef, useMemo, useRef, useState } from "react";
|
|
6
|
+
import { resolveSchemaWithRegistry } from "@dxos/app-toolkit/query";
|
|
7
|
+
import { Annotation, Filter, Obj as Obj2, Query, Type } from "@dxos/echo";
|
|
8
|
+
import { useObject } from "@dxos/react-client/echo";
|
|
9
|
+
import { Panel, Toolbar as Toolbar2, useAsyncEffect, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
10
|
+
import { Card } from "@dxos/react-ui";
|
|
11
|
+
import { Menu } from "@dxos/react-ui-menu";
|
|
12
|
+
import { Board as Board2, Focus, Mosaic } from "@dxos/react-ui-mosaic";
|
|
13
|
+
import { ProjectionModel, createEchoChangeCallback } from "@dxos/schema";
|
|
14
|
+
import { meta as meta2 } from "#meta";
|
|
15
|
+
|
|
16
|
+
// src/components/PipelineComponent/PipelineComponent.tsx
|
|
17
|
+
import { useAtomValue } from "@effect-atom/atom-react";
|
|
18
|
+
import { createContext } from "@radix-ui/react-context";
|
|
19
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
20
|
+
import React from "react";
|
|
21
|
+
import { Obj } from "@dxos/echo";
|
|
22
|
+
import { Toolbar, useTranslation } from "@dxos/react-ui";
|
|
23
|
+
import { composable, composableProps, slottable } from "@dxos/react-ui";
|
|
24
|
+
import { Board, useBoard, useEventHandlerAdapter } from "@dxos/react-ui-mosaic";
|
|
25
|
+
import { meta } from "#meta";
|
|
26
|
+
var itemNoOp = ({ item }) => /* @__PURE__ */ React.createElement("span", null, item.id);
|
|
27
|
+
var PIPELINE_ROOT = "Pipeline.Root";
|
|
28
|
+
var [PipelineRootContext, usePipeline] = createContext(PIPELINE_ROOT, {
|
|
29
|
+
Item: itemNoOp
|
|
30
|
+
});
|
|
31
|
+
var PipelineRoot = ({ children, ...contextValue }) => /* @__PURE__ */ React.createElement(PipelineRootContext, contextValue, children);
|
|
32
|
+
PipelineRoot.displayName = PIPELINE_ROOT;
|
|
33
|
+
var PIPELINE_CONTENT_NAME = "Pipeline.Content";
|
|
34
|
+
var PipelineContent = slottable(({ asChild, model, children, ...props }, forwardedRef) => {
|
|
35
|
+
const Comp = asChild ? Slot : "div";
|
|
36
|
+
return /* @__PURE__ */ React.createElement(Board.Root, {
|
|
37
|
+
model
|
|
38
|
+
}, /* @__PURE__ */ React.createElement(Comp, {
|
|
39
|
+
...composableProps(props),
|
|
40
|
+
ref: forwardedRef
|
|
41
|
+
}, children));
|
|
42
|
+
});
|
|
43
|
+
PipelineContent.displayName = PIPELINE_CONTENT_NAME;
|
|
44
|
+
var PIPELINE_COLUMNS_NAME = "Pipeline.Columns";
|
|
45
|
+
var PipelineColumns = composable(({ pipeline, ...props }) => {
|
|
46
|
+
const { model } = useBoard(PIPELINE_COLUMNS_NAME);
|
|
47
|
+
const columns = useAtomValue(model.columns);
|
|
48
|
+
const eventHandler = useEventHandlerAdapter({
|
|
49
|
+
id: pipeline.id,
|
|
50
|
+
// TODO(wittjosiah): Cast because columns array is readonly.
|
|
51
|
+
items: columns,
|
|
52
|
+
getId: model.getColumnId,
|
|
53
|
+
get: (data) => data,
|
|
54
|
+
make: (object) => object,
|
|
55
|
+
canDrop: ({ source }) => model.isColumn(source.data),
|
|
56
|
+
onChange: (mutate) => Obj.update(pipeline, (pipeline2) => mutate(pipeline2.columns))
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ React.createElement(Board.Content, {
|
|
59
|
+
...props,
|
|
60
|
+
id: "pipeline",
|
|
61
|
+
eventHandler,
|
|
62
|
+
Tile: PipelineColumn
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
PipelineColumns.displayName = PIPELINE_COLUMNS_NAME;
|
|
66
|
+
var PIPELINE_TOOLBAR_NAME = "Pipeline.Toolbar";
|
|
67
|
+
var PipelineToolbar = composable(({ children, ...props }, forwardedRef) => {
|
|
68
|
+
const { t } = useTranslation(meta.id);
|
|
69
|
+
const { onAddColumn } = usePipeline(PIPELINE_TOOLBAR_NAME);
|
|
70
|
+
return /* @__PURE__ */ React.createElement(Toolbar.Root, {
|
|
71
|
+
...composableProps(props),
|
|
72
|
+
ref: forwardedRef
|
|
73
|
+
}, /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
|
|
74
|
+
icon: "ph--plus--regular",
|
|
75
|
+
iconOnly: true,
|
|
76
|
+
label: t("add-column.label"),
|
|
77
|
+
onClick: onAddColumn
|
|
78
|
+
}));
|
|
79
|
+
});
|
|
80
|
+
PipelineToolbar.displayName = PIPELINE_TOOLBAR_NAME;
|
|
81
|
+
var PipelineComponent = {
|
|
82
|
+
Root: PipelineRoot,
|
|
83
|
+
Content: PipelineContent,
|
|
84
|
+
Columns: PipelineColumns,
|
|
85
|
+
Toolbar: PipelineToolbar
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// src/components/PipelineComponent/PipelineColumn.tsx
|
|
89
|
+
var PIPELINE_COLUMN_NAME = "PipelineColumn";
|
|
90
|
+
var PipelineColumn = ({ data: column, location, classNames, debug }) => {
|
|
91
|
+
const { t } = useTranslation2(meta2.id);
|
|
92
|
+
const [dragHandle, setDragHandle] = useState(null);
|
|
93
|
+
const [viewSnapshot] = useObject(column.view);
|
|
94
|
+
const view = column.view.target;
|
|
95
|
+
const db = view && Obj2.getDatabase(view);
|
|
96
|
+
const { Item } = usePipeline(PIPELINE_COLUMN_NAME);
|
|
97
|
+
const [type, setType] = useState();
|
|
98
|
+
const query = useMemo(() => {
|
|
99
|
+
if (!view) {
|
|
100
|
+
return Query.select(Filter.nothing());
|
|
101
|
+
} else {
|
|
102
|
+
return Query.fromAst(JSON.parse(JSON.stringify(viewSnapshot?.query.ast)));
|
|
103
|
+
}
|
|
104
|
+
}, [
|
|
105
|
+
JSON.stringify(viewSnapshot?.query.ast)
|
|
106
|
+
]);
|
|
107
|
+
useAsyncEffect(async () => {
|
|
108
|
+
if (!query || !db) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const type2 = await resolveSchemaWithRegistry(db.schemaRegistry, query.ast);
|
|
112
|
+
setType(() => type2);
|
|
113
|
+
}, [
|
|
114
|
+
db,
|
|
115
|
+
query
|
|
116
|
+
]);
|
|
117
|
+
const projectionModel = useMemo(() => {
|
|
118
|
+
if (!type || !view) {
|
|
119
|
+
return void 0;
|
|
120
|
+
}
|
|
121
|
+
const change = createEchoChangeCallback(view, Type.getDatabase(type) != null ? type : void 0);
|
|
122
|
+
return new ProjectionModel({
|
|
123
|
+
view,
|
|
124
|
+
baseSchema: type.jsonSchema,
|
|
125
|
+
change
|
|
126
|
+
});
|
|
127
|
+
}, [
|
|
128
|
+
type,
|
|
129
|
+
view
|
|
130
|
+
]);
|
|
131
|
+
const PipelineTile = useMemo(() => {
|
|
132
|
+
return /* @__PURE__ */ forwardRef((props, ref) => /* @__PURE__ */ React2.createElement(ItemTile, {
|
|
133
|
+
...props,
|
|
134
|
+
itemProps: {
|
|
135
|
+
item: props.data,
|
|
136
|
+
projectionModel
|
|
137
|
+
},
|
|
138
|
+
ref
|
|
139
|
+
}));
|
|
140
|
+
}, [
|
|
141
|
+
projectionModel
|
|
142
|
+
]);
|
|
143
|
+
if (!view) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
return /* @__PURE__ */ React2.createElement(Panel.Root, {
|
|
147
|
+
asChild: true
|
|
148
|
+
}, /* @__PURE__ */ React2.createElement(Board2.Column.Root, {
|
|
149
|
+
debug,
|
|
150
|
+
data: column,
|
|
151
|
+
location,
|
|
152
|
+
classNames,
|
|
153
|
+
dragHandle
|
|
154
|
+
}, /* @__PURE__ */ React2.createElement(Panel.Toolbar, {
|
|
155
|
+
asChild: true
|
|
156
|
+
}, /* @__PURE__ */ React2.createElement(Board2.Column.Header, {
|
|
157
|
+
classNames: "_opacity-10",
|
|
158
|
+
label: column.name || t("untitled-view.title"),
|
|
159
|
+
dragHandleRef: setDragHandle
|
|
160
|
+
})), /* @__PURE__ */ React2.createElement(Panel.Content, {
|
|
161
|
+
asChild: true
|
|
162
|
+
}, /* @__PURE__ */ React2.createElement(Board2.Column.Body, {
|
|
163
|
+
data: column,
|
|
164
|
+
Tile: PipelineTile
|
|
165
|
+
}))));
|
|
166
|
+
};
|
|
167
|
+
PipelineColumn.displayName = PIPELINE_COLUMN_NAME;
|
|
168
|
+
var ITEM_TILE_NAME = "ItemTile";
|
|
169
|
+
var ItemTile = /* @__PURE__ */ forwardRef(({ classNames, data, location, debug, itemProps }, forwardedRef) => {
|
|
170
|
+
const rootRef = useRef(null);
|
|
171
|
+
const composedRef = useComposedRefs(rootRef, forwardedRef);
|
|
172
|
+
const { Item } = usePipeline(ITEM_TILE_NAME);
|
|
173
|
+
const icon = Function.pipe(Obj2.getType(data), Option.fromNullable, Option.map(Type.getSchema), Option.flatMap(Annotation.IconAnnotation.get), Option.map(({ icon: icon2 }) => icon2), Option.getOrElse(() => "ph--circle-dashed--regular"));
|
|
174
|
+
return /* @__PURE__ */ React2.createElement(Menu.Root, null, /* @__PURE__ */ React2.createElement(Mosaic.Tile, {
|
|
175
|
+
asChild: true,
|
|
176
|
+
id: data.id,
|
|
177
|
+
data,
|
|
178
|
+
location,
|
|
179
|
+
debug
|
|
180
|
+
}, /* @__PURE__ */ React2.createElement(Focus.Item, {
|
|
181
|
+
asChild: true
|
|
182
|
+
}, /* @__PURE__ */ React2.createElement(Card.Root, {
|
|
183
|
+
classNames,
|
|
184
|
+
ref: composedRef
|
|
185
|
+
}, /* @__PURE__ */ React2.createElement(Card.Header, null, /* @__PURE__ */ React2.createElement(Card.Icon, {
|
|
186
|
+
icon
|
|
187
|
+
}), /* @__PURE__ */ React2.createElement(Card.Title, null, Obj2.getLabel(data, {
|
|
188
|
+
fallback: "typename"
|
|
189
|
+
})), /* @__PURE__ */ React2.createElement(Card.IconBlock, {
|
|
190
|
+
padding: true
|
|
191
|
+
}, /* @__PURE__ */ React2.createElement(Menu.Trigger, {
|
|
192
|
+
asChild: true
|
|
193
|
+
}, /* @__PURE__ */ React2.createElement(Toolbar2.IconButton, {
|
|
194
|
+
iconOnly: true,
|
|
195
|
+
variant: "ghost",
|
|
196
|
+
icon: "ph--dots-three-vertical--regular",
|
|
197
|
+
label: "Actions"
|
|
198
|
+
})), /* @__PURE__ */ React2.createElement(Menu.Content, null))), /* @__PURE__ */ React2.createElement(Card.Body, null, /* @__PURE__ */ React2.createElement(Item, itemProps))))));
|
|
199
|
+
});
|
|
200
|
+
ItemTile.displayName = ITEM_TILE_NAME;
|
|
201
|
+
export {
|
|
202
|
+
PipelineColumn,
|
|
203
|
+
PipelineComponent,
|
|
204
|
+
PipelineToolbar,
|
|
205
|
+
usePipeline
|
|
206
|
+
};
|
|
207
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/PipelineComponent/PipelineColumn.tsx", "../../../../src/components/PipelineComponent/PipelineComponent.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\nimport React, { forwardRef, useMemo, useRef, useState } from 'react';\n\nimport { resolveSchemaWithRegistry } from '@dxos/app-toolkit/query';\nimport { Annotation, Filter, Obj, Query, Type } from '@dxos/echo';\nimport { useObject } from '@dxos/react-client/echo';\nimport { Panel, Toolbar, useAsyncEffect, useTranslation } from '@dxos/react-ui';\nimport { Card } from '@dxos/react-ui';\nimport { Menu } from '@dxos/react-ui-menu';\nimport { Board, Focus, Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';\nimport { ProjectionModel, createEchoChangeCallback } from '@dxos/schema';\nimport { type Pipeline } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nimport { type ItemProps, usePipeline } from './PipelineComponent';\n\n//\n// PipelineColumn\n//\n\nconst PIPELINE_COLUMN_NAME = 'PipelineColumn';\n\nexport type PipelineColumnProps = Pick<MosaicTileProps<Pipeline.Column>, 'classNames' | 'location' | 'data' | 'debug'>;\n\n// TODO(wittjosiah): Support item DnD reordering (ordering needs to be stored on the view presentation collection).\nexport const PipelineColumn = ({ data: column, location, classNames, debug }: PipelineColumnProps) => {\n const { t } = useTranslation(meta.id);\n const [dragHandle, setDragHandle] = useState<HTMLButtonElement | null>(null);\n // Subscribe to the view target for reactivity.\n const [viewSnapshot] = useObject(column.view);\n const view = column.view.target;\n const db = view && Obj.getDatabase(view);\n const { Item } = usePipeline(PIPELINE_COLUMN_NAME);\n const [type, setType] = useState<Type.AnyEntity>();\n const query = useMemo(() => {\n if (!view) {\n return Query.select(Filter.nothing());\n } else {\n // NOTE: Snapshot is required to prevent signal read in prohibited scope.\n // TODO(wittjosiah): Without stringify, filter.filters remains a proxied array.\n return Query.fromAst(JSON.parse(JSON.stringify(viewSnapshot?.query.ast)));\n }\n }, [JSON.stringify(viewSnapshot?.query.ast)]);\n\n useAsyncEffect(async () => {\n if (!query || !db) {\n return;\n }\n\n const type = await resolveSchemaWithRegistry(db.schemaRegistry, query.ast);\n setType(() => type);\n }, [db, query]);\n\n const projectionModel = useMemo(() => {\n if (!type || !view) {\n return undefined;\n }\n\n // Use the live jsonSchema reference for reactivity.\n const change = createEchoChangeCallback(view, Type.getDatabase(type) != null ? type : undefined);\n return new ProjectionModel({ view, baseSchema: type.jsonSchema, change });\n }, [type, view]);\n\n const PipelineTile = useMemo(() => {\n return forwardRef<HTMLDivElement, Pick<MosaicTileProps<Obj.Unknown>, 'classNames' | 'location' | 'data' | 'debug'>>(\n (props, ref) => <ItemTile {...props} itemProps={{ item: props.data, projectionModel }} ref={ref} />,\n );\n }, [projectionModel]);\n\n if (!view) {\n return null;\n }\n\n return (\n <Panel.Root asChild>\n <Board.Column.Root\n debug={debug}\n data={column}\n location={location}\n classNames={classNames}\n dragHandle={dragHandle}\n >\n <Panel.Toolbar asChild>\n <Board.Column.Header\n classNames='_opacity-10'\n label={column.name || t('untitled-view.title')}\n dragHandleRef={setDragHandle}\n />\n </Panel.Toolbar>\n <Panel.Content asChild>\n <Board.Column.Body data={column} Tile={PipelineTile} />\n </Panel.Content>\n </Board.Column.Root>\n </Panel.Root>\n );\n};\n\nPipelineColumn.displayName = PIPELINE_COLUMN_NAME;\n\n//\n// ItemTile\n//\n\nconst ITEM_TILE_NAME = 'ItemTile';\n\ntype ItemTileProps = Pick<MosaicTileProps<Obj.Unknown>, 'classNames' | 'location' | 'data' | 'debug'> & {\n itemProps: ItemProps;\n};\n\nconst ItemTile = forwardRef<HTMLDivElement, ItemTileProps>(\n ({ classNames, data, location, debug, itemProps }, forwardedRef) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);\n const { Item } = usePipeline(ITEM_TILE_NAME);\n const icon = Function.pipe(\n Obj.getType(data),\n Option.fromNullable,\n Option.map(Type.getSchema),\n Option.flatMap(Annotation.IconAnnotation.get),\n Option.map(({ icon }) => icon),\n Option.getOrElse(() => 'ph--circle-dashed--regular'),\n );\n\n return (\n <Menu.Root>\n <Mosaic.Tile asChild id={data.id} data={data} location={location} debug={debug}>\n <Focus.Item asChild>\n <Card.Root classNames={classNames} ref={composedRef}>\n <Card.Header>\n <Card.Icon icon={icon} />\n <Card.Title>{Obj.getLabel(data, { fallback: 'typename' })}</Card.Title>\n {/* TODO(wittjosiah): Reconcile with Card.Menu. */}\n <Card.IconBlock padding>\n <Menu.Trigger asChild>\n <Toolbar.IconButton\n iconOnly\n variant='ghost'\n icon='ph--dots-three-vertical--regular'\n label='Actions'\n />\n </Menu.Trigger>\n <Menu.Content />\n </Card.IconBlock>\n </Card.Header>\n <Card.Body>\n <Item {...itemProps} />\n </Card.Body>\n </Card.Root>\n </Focus.Item>\n </Mosaic.Tile>\n </Menu.Root>\n );\n },\n);\n\nItemTile.displayName = ITEM_TILE_NAME;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport { createContext } from '@radix-ui/react-context';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type FC, type PropsWithChildren } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { Toolbar, type ToolbarRootProps, useTranslation } from '@dxos/react-ui';\nimport { composable, composableProps, slottable } from '@dxos/react-ui';\nimport { Board, type BoardModel, useBoard, useEventHandlerAdapter } from '@dxos/react-ui-mosaic';\nimport { type ProjectionModel } from '@dxos/schema';\nimport { type Pipeline } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nimport { PipelineColumn } from './PipelineColumn';\n\ntype ItemProps = {\n item: Obj.Unknown;\n projectionModel?: ProjectionModel;\n};\n\nconst itemNoOp = ({ item }: ItemProps) => <span>{item.id}</span>;\n\n//\n// Root\n//\n\ntype PipelineContextValue = {\n Item: FC<ItemProps>;\n // TODO(wittjosiah): Support adding items.\n // If the created item doesn't match the current query, it will not be visible.\n // TODO(wittjosiah): onAddItem?: (schema: Schema.Schema.AnyNoContext) => void;\n onAddColumn?: () => void;\n};\n\ntype PipelineRootProps = PropsWithChildren<PipelineContextValue>;\n\nconst PIPELINE_ROOT = 'Pipeline.Root';\n\nconst [PipelineRootContext, usePipeline] = createContext<PipelineContextValue>(PIPELINE_ROOT, {\n Item: itemNoOp,\n});\n\nconst PipelineRoot = ({ children, ...contextValue }: PipelineRootProps) => (\n <PipelineRootContext {...contextValue}>{children}</PipelineRootContext>\n);\n\nPipelineRoot.displayName = PIPELINE_ROOT;\n\n//\n// Content\n//\n\nconst PIPELINE_CONTENT_NAME = 'Pipeline.Content';\n\ntype PipelineContentProps = PropsWithChildren<{\n model: BoardModel<Pipeline.Column, Obj.Unknown>;\n}>;\n\nconst PipelineContent = slottable<HTMLDivElement, PipelineContentProps>(\n ({ asChild, model, children, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : 'div';\n return (\n <Board.Root model={model}>\n <Comp {...composableProps(props)} ref={forwardedRef}>\n {children}\n </Comp>\n </Board.Root>\n );\n },\n);\n\nPipelineContent.displayName = PIPELINE_CONTENT_NAME;\n\n//\n// Columns\n//\n\nconst PIPELINE_COLUMNS_NAME = 'Pipeline.Columns';\n\ntype PipelineColumnsProps = {\n pipeline: Pipeline.Pipeline;\n};\n\nconst PipelineColumns = composable<HTMLDivElement, PipelineColumnsProps>(({ pipeline, ...props }) => {\n const { model } = useBoard(PIPELINE_COLUMNS_NAME);\n const columns = useAtomValue(model.columns);\n const eventHandler = useEventHandlerAdapter<Pipeline.Column, Obj.Unknown>({\n id: pipeline.id,\n // TODO(wittjosiah): Cast because columns array is readonly.\n items: columns as any,\n getId: model.getColumnId,\n get: (data) => data as unknown as Obj.Unknown,\n make: (object) => object as unknown as Pipeline.Column,\n canDrop: ({ source }) => model.isColumn(source.data),\n onChange: (mutate) => Obj.update(pipeline, (pipeline) => mutate(pipeline.columns)),\n });\n\n return <Board.Content {...props} id='pipeline' eventHandler={eventHandler} Tile={PipelineColumn} />;\n});\n\nPipelineColumns.displayName = PIPELINE_COLUMNS_NAME;\n\n//\n// Toolbar\n//\n\nconst PIPELINE_TOOLBAR_NAME = 'Pipeline.Toolbar';\n\nexport const PipelineToolbar = composable<HTMLDivElement, ToolbarRootProps>(({ children, ...props }, forwardedRef) => {\n const { t } = useTranslation(meta.id);\n const { onAddColumn } = usePipeline(PIPELINE_TOOLBAR_NAME);\n\n return (\n <Toolbar.Root {...composableProps(props)} ref={forwardedRef}>\n <Toolbar.IconButton icon='ph--plus--regular' iconOnly label={t('add-column.label')} onClick={onAddColumn} />\n </Toolbar.Root>\n );\n});\n\nPipelineToolbar.displayName = PIPELINE_TOOLBAR_NAME;\n\n//\n// Project\n//\n\nexport const PipelineComponent = {\n Root: PipelineRoot,\n Content: PipelineContent,\n Columns: PipelineColumns,\n Toolbar: PipelineToolbar,\n};\n\nexport { usePipeline };\n\nexport type { ItemProps, PipelineContextValue, PipelineRootProps, PipelineContentProps, PipelineColumnsProps };\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,uBAAuB;AAChC,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AACxB,OAAOC,UAASC,YAAYC,SAASC,QAAQC,gBAAgB;AAE7D,SAASC,iCAAiC;AAC1C,SAASC,YAAYC,QAAQC,OAAAA,MAAKC,OAAOC,YAAY;AACrD,SAASC,iBAAiB;AAC1B,SAASC,OAAOC,WAAAA,UAASC,gBAAgBC,kBAAAA,uBAAsB;AAC/D,SAASC,YAAY;AACrB,SAASC,YAAY;AACrB,SAASC,SAAAA,QAAOC,OAAOC,cAAoC;AAC3D,SAASC,iBAAiBC,gCAAgC;AAG1D,SAASC,QAAAA,aAAY;;;ACfrB,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB;AAC9B,SAASC,YAAY;AACrB,OAAOC,WAAgD;AAEvD,SAASC,WAAW;AACpB,SAASC,SAAgCC,sBAAsB;AAC/D,SAASC,YAAYC,iBAAiBC,iBAAiB;AACvD,SAASC,OAAwBC,UAAUC,8BAA8B;AAIzE,SAASC,YAAY;AASrB,IAAMC,WAAW,CAAC,EAAEC,KAAI,MAAkB,sBAAA,cAACC,QAAAA,MAAMD,KAAKE,EAAE;AAgBxD,IAAMC,gBAAgB;AAEtB,IAAM,CAACC,qBAAqBC,WAAAA,IAAeC,cAAoCH,eAAe;EAC5FI,MAAMR;AACR,CAAA;AAEA,IAAMS,eAAe,CAAC,EAAEC,UAAU,GAAGC,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", "useState", "resolveSchemaWithRegistry", "Annotation", "Filter", "Obj", "Query", "Type", "useObject", "Panel", "Toolbar", "useAsyncEffect", "useTranslation", "Card", "Menu", "Board", "Focus", "Mosaic", "ProjectionModel", "createEchoChangeCallback", "meta", "useAtomValue", "createContext", "Slot", "React", "Obj", "Toolbar", "useTranslation", "composable", "composableProps", "slottable", "Board", "useBoard", "useEventHandlerAdapter", "meta", "itemNoOp", "item", "span", "id", "PIPELINE_ROOT", "PipelineRootContext", "usePipeline", "createContext", "Item", "PipelineRoot", "children", "contextValue", "displayName", "PIPELINE_CONTENT_NAME", "PipelineContent", "slottable", "asChild", "model", "props", "forwardedRef", "Comp", "Slot", "Board", "Root", "composableProps", "ref", "PIPELINE_COLUMNS_NAME", "PipelineColumns", "composable", "pipeline", "useBoard", "columns", "useAtomValue", "eventHandler", "useEventHandlerAdapter", "items", "getId", "getColumnId", "get", "data", "make", "object", "canDrop", "source", "isColumn", "onChange", "mutate", "Obj", "update", "Content", "Tile", "PipelineColumn", "PIPELINE_TOOLBAR_NAME", "PipelineToolbar", "t", "useTranslation", "meta", "onAddColumn", "Toolbar", "IconButton", "icon", "iconOnly", "label", "onClick", "PipelineComponent", "Columns", "PIPELINE_COLUMN_NAME", "PipelineColumn", "data", "column", "location", "classNames", "debug", "t", "useTranslation", "meta", "id", "dragHandle", "setDragHandle", "useState", "viewSnapshot", "useObject", "view", "target", "db", "Obj", "getDatabase", "Item", "usePipeline", "type", "setType", "query", "useMemo", "Query", "select", "Filter", "nothing", "fromAst", "JSON", "parse", "stringify", "ast", "useAsyncEffect", "resolveSchemaWithRegistry", "schemaRegistry", "projectionModel", "undefined", "change", "createEchoChangeCallback", "Type", "ProjectionModel", "baseSchema", "jsonSchema", "PipelineTile", "forwardRef", "props", "ref", "React", "ItemTile", "itemProps", "item", "Panel", "Root", "asChild", "Board", "Column", "Toolbar", "Header", "label", "name", "dragHandleRef", "Content", "Body", "Tile", "displayName", "ITEM_TILE_NAME", "forwardedRef", "rootRef", "useRef", "composedRef", "useComposedRefs", "icon", "pipe", "getType", "fromNullable", "map", "getSchema", "flatMap", "Annotation", "IconAnnotation", "get", "getOrElse", "Menu", "Mosaic", "Focus", "Card", "Icon", "Title", "getLabel", "fallback", "IconBlock", "padding", "Trigger", "IconButton", "iconOnly", "variant"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/containers/index.ts
|
|
2
|
+
import { lazy } from "react";
|
|
3
|
+
var PipelineArticle = lazy(() => import("../PipelineArticle-6JIVXMYF.mjs"));
|
|
4
|
+
var PipelineProperties = lazy(() => import("../PipelineProperties-NFNEU3NR.mjs"));
|
|
5
|
+
export {
|
|
6
|
+
PipelineArticle,
|
|
7
|
+
PipelineProperties
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/containers/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const PipelineArticle: ComponentType<any> = lazy(() => import('./PipelineArticle'));\nexport const PipelineProperties: ComponentType<any> = lazy(() => import('./PipelineProperties'));\n"],
|
|
5
|
+
"mappings": ";AAIA,SAA6BA,YAAY;AAElC,IAAMC,kBAAsCD,KAAK,MAAM,OAAO,iCAAA,CAAA;AAC9D,IAAME,qBAAyCF,KAAK,MAAM,OAAO,oCAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "PipelineArticle", "PipelineProperties"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/capabilities/create-object.ts
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { Capability } from "@dxos/app-framework";
|
|
4
|
+
import { Operation } from "@dxos/compute";
|
|
5
|
+
import { Type } from "@dxos/echo";
|
|
6
|
+
import { SpaceOperation } from "@dxos/plugin-space";
|
|
7
|
+
import { SpaceCapabilities } from "@dxos/plugin-space";
|
|
8
|
+
import { Pipeline } from "@dxos/types";
|
|
9
|
+
var create_object_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
10
|
+
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
11
|
+
id: Type.getTypename(Pipeline.Pipeline),
|
|
12
|
+
createObject: (props, options) => Effect.gen(function* () {
|
|
13
|
+
const object = Pipeline.make(props);
|
|
14
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
15
|
+
object,
|
|
16
|
+
target: options.target,
|
|
17
|
+
hidden: true,
|
|
18
|
+
targetNodeId: options.targetNodeId
|
|
19
|
+
});
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}));
|
|
23
|
+
export {
|
|
24
|
+
create_object_default as default
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=create-object-6Z4MMGX4.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/create-object.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Type } from '@dxos/echo';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { Pipeline } from '@dxos/types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {\n id: Type.getTypename(Pipeline.Pipeline),\n createObject: (props, options) =>\n Effect.gen(function* () {\n const object = Pipeline.make(props);\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n hidden: true,\n targetNodeId: options.targetNodeId,\n });\n }),\n });\n }),\n);\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,yBAAyB;AAClC,SAASC,gBAAgB;AAEzB,IAAA,wBAAeL,WAAWM,WACjBC,kBAAW,aAAA;AAChB,SAAOP,WAAWQ,YAAYJ,kBAAkBK,mBAAmB;IACjEC,IAAIR,KAAKS,YAAYN,SAASA,QAAQ;IACtCO,cAAc,CAACC,OAAOC,YACbC,WAAI,aAAA;AACT,YAAMC,SAASX,SAASY,KAAKJ,KAAAA;AAC7B,aAAO,OAAOZ,UAAUiB,OAAOf,eAAegB,WAAW;QACvDH;QACAI,QAAQN,QAAQM;QAChBC,QAAQ;QACRC,cAAcR,QAAQQ;MACxB,CAAA;IACF,CAAA;EACJ,CAAA;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capability", "Operation", "Type", "SpaceOperation", "SpaceCapabilities", "Pipeline", "makeModule", "fnUntraced", "contributes", "CreateObjectEntry", "id", "getTypename", "createObject", "props", "options", "gen", "object", "make", "invoke", "AddObject", "target", "hidden", "targetNodeId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/hooks/usePipelineBoardModel.ts
|
|
2
|
+
import { Atom } from "@effect-atom/atom-react";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { getQueryTarget } from "@dxos/app-toolkit/query";
|
|
6
|
+
import { Obj, Query } from "@dxos/echo";
|
|
7
|
+
import { AtomObj, AtomQuery } from "@dxos/echo-atom";
|
|
8
|
+
import { getSpace, isSpace } from "@dxos/react-client/echo";
|
|
9
|
+
import { Pipeline } from "@dxos/types";
|
|
10
|
+
var usePipelineBoardModel = (pipeline, registry) => useMemo(() => {
|
|
11
|
+
if (pipeline == null) {
|
|
12
|
+
return emptyPipelineModel;
|
|
13
|
+
}
|
|
14
|
+
const space = getSpace(pipeline);
|
|
15
|
+
const columnsAtom = AtomObj.makeProperty(pipeline, "columns");
|
|
16
|
+
const columnAtomFamily = Atom.family((viewKey) => Atom.make((get) => {
|
|
17
|
+
const columns = get(columnsAtom);
|
|
18
|
+
return columns.find((c) => c.view.uri === viewKey);
|
|
19
|
+
}));
|
|
20
|
+
const itemsAtomFamily = Atom.family((viewKey) => Atom.make((get) => {
|
|
21
|
+
const column = get(columnAtomFamily(viewKey));
|
|
22
|
+
if (column == null) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
const viewSnapshot = get(AtomObj.make(column.view));
|
|
26
|
+
if (!viewSnapshot?.query?.ast) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
const query = Query.fromAst(JSON.parse(JSON.stringify(viewSnapshot.query.ast)));
|
|
30
|
+
const queryTarget = space ? getQueryTarget(query.ast, space) : void 0;
|
|
31
|
+
if (!queryTarget) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
const raw = get(AtomQuery.make(queryTarget, query));
|
|
35
|
+
return isSpace(queryTarget) ? raw : [
|
|
36
|
+
...raw
|
|
37
|
+
].reverse();
|
|
38
|
+
}));
|
|
39
|
+
return {
|
|
40
|
+
getColumnId: (data) => data.view.uri,
|
|
41
|
+
getItemId: (data) => data.id,
|
|
42
|
+
isColumn: (obj) => Schema.is(Pipeline.Column)(obj),
|
|
43
|
+
isItem: (obj) => Obj.isObject(obj),
|
|
44
|
+
columns: columnsAtom,
|
|
45
|
+
items: (column) => itemsAtomFamily(column.view.uri),
|
|
46
|
+
getColumns: () => [
|
|
47
|
+
...registry.get(columnsAtom)
|
|
48
|
+
],
|
|
49
|
+
getItems: (column) => registry.get(itemsAtomFamily(column.view.uri)) ?? []
|
|
50
|
+
};
|
|
51
|
+
}, [
|
|
52
|
+
pipeline,
|
|
53
|
+
registry
|
|
54
|
+
]);
|
|
55
|
+
var emptyColumnsAtom = Atom.make(() => []);
|
|
56
|
+
var emptyItemsAtom = Atom.make(() => []);
|
|
57
|
+
var emptyPipelineModel = {
|
|
58
|
+
getColumnId: (data) => data.view.uri,
|
|
59
|
+
getItemId: (data) => data.id,
|
|
60
|
+
isColumn: (obj) => Schema.is(Pipeline.Column)(obj),
|
|
61
|
+
isItem: (obj) => Obj.isObject(obj),
|
|
62
|
+
columns: emptyColumnsAtom,
|
|
63
|
+
items: () => emptyItemsAtom,
|
|
64
|
+
getColumns: () => [],
|
|
65
|
+
getItems: () => []
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
usePipelineBoardModel
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/hooks/usePipelineBoardModel.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom, type Registry } from '@effect-atom/atom-react';\nimport * as Schema from 'effect/Schema';\nimport { useMemo } from 'react';\n\nimport { getQueryTarget } from '@dxos/app-toolkit/query';\nimport { Obj, Query } from '@dxos/echo';\nimport { AtomObj, AtomQuery } from '@dxos/echo-atom';\nimport { getSpace, isSpace } from '@dxos/react-client/echo';\nimport { type BoardModel } from '@dxos/react-ui-mosaic';\nimport { Pipeline } from '@dxos/types';\n\nexport const usePipelineBoardModel = (\n pipeline: Pipeline.Pipeline | undefined,\n registry: Registry.Registry,\n): BoardModel<Pipeline.Column, Obj.Unknown> =>\n useMemo<BoardModel<Pipeline.Column, Obj.Unknown>>(() => {\n if (pipeline == null) {\n return emptyPipelineModel;\n }\n\n const space = getSpace(pipeline);\n const columnsAtom = AtomObj.makeProperty(pipeline, 'columns');\n const columnAtomFamily = Atom.family<string, Atom.Atom<Pipeline.Column | undefined>>((viewKey: string) =>\n Atom.make((get) => {\n const columns = get(columnsAtom);\n return columns.find((c) => c.view.uri === viewKey);\n }),\n );\n\n const itemsAtomFamily = Atom.family<string, Atom.Atom<Obj.Unknown[]>>((viewKey: string) =>\n Atom.make((get) => {\n const column = get(columnAtomFamily(viewKey));\n if (column == null) {\n return [];\n }\n const viewSnapshot = get(AtomObj.make(column.view));\n if (!viewSnapshot?.query?.ast) {\n return [];\n }\n const query = Query.fromAst(JSON.parse(JSON.stringify(viewSnapshot.query.ast)));\n const queryTarget = space ? getQueryTarget(query.ast, space) : undefined;\n if (!queryTarget) {\n return [];\n }\n const raw = get(AtomQuery.make(queryTarget, query));\n return isSpace(queryTarget) ? raw : [...raw].reverse();\n }),\n );\n\n return {\n getColumnId: (data) => (data as Pipeline.Column).view.uri,\n getItemId: (data) => (data as Obj.Unknown).id,\n isColumn: (obj: unknown): obj is Pipeline.Column => Schema.is(Pipeline.Column)(obj),\n isItem: (obj: unknown): obj is Obj.Unknown => Obj.isObject(obj),\n columns: columnsAtom,\n items: (column) => itemsAtomFamily(column.view.uri),\n getColumns: () => [...registry.get(columnsAtom)],\n getItems: (column) => registry.get(itemsAtomFamily(column.view.uri)) ?? [],\n };\n }, [pipeline, registry]);\n\nconst emptyColumnsAtom = Atom.make(() => [] as Pipeline.Column[]);\n\nconst emptyItemsAtom = Atom.make(() => [] as Obj.Unknown[]);\n\nconst emptyPipelineModel: BoardModel<Pipeline.Column, Obj.Unknown> = {\n getColumnId: (data) => (data as Pipeline.Column).view.uri,\n getItemId: (data) => (data as Obj.Unknown).id,\n isColumn: (obj: unknown): obj is Pipeline.Column => Schema.is(Pipeline.Column)(obj),\n isItem: (obj): obj is Obj.Unknown => Obj.isObject(obj),\n columns: emptyColumnsAtom,\n items: () => emptyItemsAtom,\n getColumns: () => [],\n getItems: () => [],\n};\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,YAA2B;AACpC,YAAYC,YAAY;AACxB,SAASC,eAAe;AAExB,SAASC,sBAAsB;AAC/B,SAASC,KAAKC,aAAa;AAC3B,SAASC,SAASC,iBAAiB;AACnC,SAASC,UAAUC,eAAe;AAElC,SAASC,gBAAgB;AAElB,IAAMC,wBAAwB,CACnCC,UACA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3DvB,SAASP;IACTmC,OAAO,CAACtB,WAAWD,gBAAgBC,OAAOH,KAAKC,GAAG;IAClDyB,YAAY,MAAM;SAAIvC,SAASS,IAAIN,WAAAA;;IACnCqC,UAAU,CAACxB,WAAWhB,SAASS,IAAIM,gBAAgBC,OAAOH,KAAKC,GAAG,CAAA,KAAM,CAAA;EAC1E;AACF,GAAG;EAACf;EAAUC;CAAS;AAEzB,IAAMyC,mBAAmBtD,KAAKqB,KAAK,MAAM,CAAA,CAAE;AAE3C,IAAMkC,iBAAiBvD,KAAKqB,KAAK,MAAM,CAAA,CAAE;AAEzC,IAAMP,qBAA+D;EACnE2B,aAAa,CAACC,SAAUA,KAAyBhB,KAAKC;EACtDgB,WAAW,CAACD,SAAUA,KAAqBE;EAC3CC,UAAU,CAACC,QAAgDC,UAAGrC,SAASsC,MAAM,EAAEF,GAAAA;EAC/EG,QAAQ,CAACH,QAA4B1C,IAAI8C,SAASJ,GAAAA;EAClDvB,SAAS+B;EACTH,OAAO,MAAMI;EACbH,YAAY,MAAM,CAAA;EAClBC,UAAU,MAAM,CAAA;AAClB;",
|
|
6
|
+
"names": ["Atom", "Schema", "useMemo", "getQueryTarget", "Obj", "Query", "AtomObj", "AtomQuery", "getSpace", "isSpace", "Pipeline", "usePipelineBoardModel", "pipeline", "registry", "emptyPipelineModel", "space", "columnsAtom", "makeProperty", "columnAtomFamily", "family", "viewKey", "make", "get", "columns", "find", "c", "view", "uri", "itemsAtomFamily", "column", "viewSnapshot", "query", "ast", "fromAst", "JSON", "parse", "stringify", "queryTarget", "undefined", "raw", "reverse", "getColumnId", "data", "getItemId", "id", "isColumn", "obj", "is", "Column", "isItem", "isObject", "items", "getColumns", "getItems", "emptyColumnsAtom", "emptyItemsAtom"]
|
|
7
|
+
}
|