@particle-academy/fancy-flow 0.8.0 → 0.9.0
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/README.md +93 -0
- package/dist/{chunk-BCXECQUC.js → chunk-6GGFEZH7.js} +3 -3
- package/dist/{chunk-BCXECQUC.js.map → chunk-6GGFEZH7.js.map} +1 -1
- package/dist/{chunk-M2XKGQQL.js → chunk-6RHAQ2LP.js} +228 -17
- package/dist/chunk-6RHAQ2LP.js.map +1 -0
- package/dist/{chunk-WNVBXXOL.js → chunk-CPSOC27D.js} +43 -2
- package/dist/chunk-CPSOC27D.js.map +1 -0
- package/dist/{chunk-NVULCEDX.js → chunk-HNBO4HP3.js} +8 -4
- package/dist/chunk-HNBO4HP3.js.map +1 -0
- package/dist/chunk-TITD5W4Y.js +26 -0
- package/dist/chunk-TITD5W4Y.js.map +1 -0
- package/dist/{chunk-QSSQRQN4.js → chunk-VEI743ZX.js} +3 -3
- package/dist/{chunk-QSSQRQN4.js.map → chunk-VEI743ZX.js.map} +1 -1
- package/dist/engine.cjs +32 -2
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.js +3 -1
- package/dist/index.cjs +717 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -6
- package/dist/index.d.ts +45 -6
- package/dist/index.js +415 -23
- package/dist/index.js.map +1 -1
- package/dist/registry/index.d.cts +111 -4
- package/dist/registry/index.d.ts +111 -4
- package/dist/registry.cjs +313 -31
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +3 -2
- package/dist/runtime.cjs +32 -2
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +4 -2
- package/dist/schema.cjs +41 -0
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +2 -2
- package/dist/styles.css +191 -0
- package/dist/styles.css.map +1 -1
- package/dist/types-BocBFh6l.d.ts +221 -0
- package/dist/types-DKqaUjF_.d.cts +221 -0
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.d.cts +1 -1
- package/dist/ux.d.ts +1 -1
- package/dist/ux.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-M2XKGQQL.js.map +0 -1
- package/dist/chunk-NVULCEDX.js.map +0 -1
- package/dist/chunk-WNVBXXOL.js.map +0 -1
- package/dist/types-C0wdN6QX.d.cts +0 -121
- package/dist/types-DnMe9Vsf.d.ts +0 -121
package/dist/registry.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { BUILTIN_KINDS, RegistryNode, buildNodeTypes, registerBuiltinKinds } from './chunk-
|
|
1
|
+
export { BUILTIN_KINDS, RegistryNode, RichInputPreview, buildNodeTypes, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerBuiltinKinds, registerRichInputAdapter } from './chunk-6RHAQ2LP.js';
|
|
2
2
|
import './chunk-NF6NPY5N.js';
|
|
3
|
-
export {
|
|
3
|
+
export { nodeConfig, resolveNodePorts, resolvePortSpec } from './chunk-TITD5W4Y.js';
|
|
4
|
+
export { categoryAccent, defaultConfigFor, getNodeKind, listNodeKinds, onNodeKindsChanged, registerNodeKind, validateConfig } from './chunk-CPSOC27D.js';
|
|
4
5
|
//# sourceMappingURL=registry.js.map
|
|
5
6
|
//# sourceMappingURL=registry.js.map
|
package/dist/runtime.cjs
CHANGED
|
@@ -8,6 +8,35 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
8
8
|
|
|
9
9
|
var ReactExports__default = /*#__PURE__*/_interopDefault(ReactExports);
|
|
10
10
|
|
|
11
|
+
// src/registry/registry.ts
|
|
12
|
+
var kinds = /* @__PURE__ */ new Map();
|
|
13
|
+
function getNodeKind(name) {
|
|
14
|
+
return kinds.get(name) ?? null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// src/registry/ports.ts
|
|
18
|
+
function resolvePortSpec(spec, config) {
|
|
19
|
+
if (spec === void 0) return void 0;
|
|
20
|
+
if (typeof spec !== "function") return spec;
|
|
21
|
+
try {
|
|
22
|
+
const resolved = spec(config);
|
|
23
|
+
return Array.isArray(resolved) ? resolved : void 0;
|
|
24
|
+
} catch {
|
|
25
|
+
return void 0;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function nodeConfig(node) {
|
|
29
|
+
return node.data?.config ?? {};
|
|
30
|
+
}
|
|
31
|
+
function resolveNodePorts(node, kind) {
|
|
32
|
+
const config = nodeConfig(node);
|
|
33
|
+
const data = node.data;
|
|
34
|
+
return {
|
|
35
|
+
inputs: data?.inputs ?? resolvePortSpec(kind?.inputs, config),
|
|
36
|
+
outputs: data?.outputs ?? resolvePortSpec(kind?.outputs, config)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
11
40
|
// src/runtime/run-flow.ts
|
|
12
41
|
async function runFlow(graph, executors, onEvent = () => {
|
|
13
42
|
}, options = {}) {
|
|
@@ -139,8 +168,9 @@ function activatedPorts(node, result) {
|
|
|
139
168
|
return { ports: [r.branch], value: r.value ?? r };
|
|
140
169
|
}
|
|
141
170
|
}
|
|
142
|
-
const
|
|
143
|
-
|
|
171
|
+
const kind = getNodeKind(node.data?.kind ?? node.type ?? "") ?? void 0;
|
|
172
|
+
const declared = resolveNodePorts(node, kind).outputs?.map((p) => p.id);
|
|
173
|
+
return { ports: declared?.length ? declared : ["out"], value: result };
|
|
144
174
|
}
|
|
145
175
|
function useFlowRun({ maxFeed = 200 } = {}) {
|
|
146
176
|
const [statuses, setStatuses] = ReactExports.useState({});
|