@particle-academy/fancy-flow 0.9.0 → 0.10.1
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 +28 -17
- package/dist/{chunk-6GGFEZH7.js → chunk-2DMBJN2O.js} +14 -5
- package/dist/chunk-2DMBJN2O.js.map +1 -0
- package/dist/chunk-F5RPRB7A.js +56 -0
- package/dist/chunk-F5RPRB7A.js.map +1 -0
- package/dist/{chunk-6RHAQ2LP.js → chunk-NCPQDVUE.js} +5 -54
- package/dist/chunk-NCPQDVUE.js.map +1 -0
- package/dist/index.cjs +15 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/registry/index.d.cts +25 -24
- package/dist/registry/index.d.ts +25 -24
- package/dist/registry.cjs +4 -5
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -1
- package/dist/rich-input.cjs +56 -0
- package/dist/rich-input.cjs.map +1 -0
- package/dist/rich-input.d.cts +27 -0
- package/dist/rich-input.d.ts +27 -0
- package/dist/rich-input.js +37 -0
- package/dist/rich-input.js.map +1 -0
- package/dist/schema/index.d.cts +17 -1
- package/dist/schema/index.d.ts +17 -1
- package/dist/schema.cjs +34 -3
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +2 -1
- package/package.json +24 -2
- package/dist/chunk-6GGFEZH7.js.map +0 -1
- package/dist/chunk-6RHAQ2LP.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { a as NodeKindDefinition, P as PortSpec } from '../types-DKqaUjF_.cjs';
|
|
|
2
2
|
export { C as ConfigField, b as CredentialConfigField, D as DocumentConfigField, E as ExpressionConfigField, J as JsonConfigField, K as KeyValueConfigField, N as NodeCategory, c as NumberConfigField, R as RenderBodyContext, d as RepeaterConfigField, e as RepeaterRowField, S as SelectConfigField, f as SwitchConfigField, T as TextConfigField, g as TextareaConfigField } from '../types-DKqaUjF_.cjs';
|
|
3
3
|
import { F as FlowNode, P as PortDescriptor } from '../types-BS3Gwnkq.cjs';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
-
import { ReactNode } from 'react';
|
|
5
|
+
import { ComponentType, ReactNode } from 'react';
|
|
6
6
|
import { NodeProps, NodeTypes } from '@xyflow/react';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -45,31 +45,30 @@ declare function resolveNodePorts(node: Pick<FlowNode, "data">, kind?: Pick<Node
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Rich user input — the
|
|
48
|
+
* Rich user input — the injection point.
|
|
49
49
|
*
|
|
50
50
|
* `rich_user_input` pauses a run on a fully authored page (long-form content,
|
|
51
51
|
* required reading + confirmation, multi-section forms) rather than a flat
|
|
52
|
-
* field list.
|
|
53
|
-
*
|
|
54
|
-
* FauxClient) — neither of which fancy-flow depends on.
|
|
52
|
+
* field list. That page IS a fancy-cms document — fancy-flow defines no
|
|
53
|
+
* document schema of its own and never re-implements one.
|
|
55
54
|
*
|
|
56
|
-
*
|
|
55
|
+
* The wiring ships in the box. Import the subpath once and the node lights up:
|
|
57
56
|
*
|
|
58
|
-
* ```
|
|
59
|
-
* import
|
|
60
|
-
* import { StagesViewer } from "@particle-academy/fancy-cms-ui";
|
|
61
|
-
* import { registerRichInputAdapter } from "@particle-academy/fancy-flow";
|
|
62
|
-
*
|
|
63
|
-
* registerRichInputAdapter({
|
|
64
|
-
* FauxClient,
|
|
65
|
-
* renderDocument: (doc) => <StagesViewer doc={doc} />,
|
|
66
|
-
* });
|
|
57
|
+
* ```ts
|
|
58
|
+
* import "@particle-academy/fancy-flow/rich-input";
|
|
67
59
|
* ```
|
|
68
60
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* workflow editor should not
|
|
61
|
+
* That module registers fancy-cms's `PageDoc` + `CmsPage` renderer + `Editor`
|
|
62
|
+
* against this seam. It lives on a separate entry so `@particle-academy/
|
|
63
|
+
* fancy-cms-ui` and `@particle-academy/react-fancy` stay OPTIONAL peers — most
|
|
64
|
+
* flows never use a rich input, and a workflow editor should not drag a CMS
|
|
65
|
+
* into every install.
|
|
66
|
+
*
|
|
67
|
+
* The seam stays public so a host can substitute a different document engine,
|
|
68
|
+
* but that is the escape hatch, not the expected path.
|
|
69
|
+
*
|
|
70
|
+
* Until something registers, the node still registers and still round-trips
|
|
71
|
+
* its config — it renders a "how to enable" body rather than an empty card.
|
|
73
72
|
*/
|
|
74
73
|
type RichInputAdapter = {
|
|
75
74
|
/**
|
|
@@ -77,11 +76,13 @@ type RichInputAdapter = {
|
|
|
77
76
|
* frame that mimics a browser window or device and scales its content down
|
|
78
77
|
* to fit. Used to preview the authored page inside the node card.
|
|
79
78
|
*/
|
|
80
|
-
FauxClient?:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
FauxClient?: ComponentType<any>;
|
|
80
|
+
/**
|
|
81
|
+
* Props for the frame — e.g. `{ variant: "browser", width: 1280, scale: "fit" }`
|
|
82
|
+
* so a full-width page renders at its real width and scales down into the
|
|
83
|
+
* node card instead of reflowing to a cramped layout that misrepresents it.
|
|
84
|
+
*/
|
|
85
|
+
frameProps?: Record<string, unknown>;
|
|
85
86
|
/** Render the stored document read-only, for the in-node preview. */
|
|
86
87
|
renderDocument?: (doc: unknown) => ReactNode;
|
|
87
88
|
/** Editor mounted in the config panel via `renderDocumentField`. */
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { a as NodeKindDefinition, P as PortSpec } from '../types-BocBFh6l.js';
|
|
|
2
2
|
export { C as ConfigField, b as CredentialConfigField, D as DocumentConfigField, E as ExpressionConfigField, J as JsonConfigField, K as KeyValueConfigField, N as NodeCategory, c as NumberConfigField, R as RenderBodyContext, d as RepeaterConfigField, e as RepeaterRowField, S as SelectConfigField, f as SwitchConfigField, T as TextConfigField, g as TextareaConfigField } from '../types-BocBFh6l.js';
|
|
3
3
|
import { F as FlowNode, P as PortDescriptor } from '../types-BS3Gwnkq.js';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
-
import { ReactNode } from 'react';
|
|
5
|
+
import { ComponentType, ReactNode } from 'react';
|
|
6
6
|
import { NodeProps, NodeTypes } from '@xyflow/react';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -45,31 +45,30 @@ declare function resolveNodePorts(node: Pick<FlowNode, "data">, kind?: Pick<Node
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Rich user input — the
|
|
48
|
+
* Rich user input — the injection point.
|
|
49
49
|
*
|
|
50
50
|
* `rich_user_input` pauses a run on a fully authored page (long-form content,
|
|
51
51
|
* required reading + confirmation, multi-section forms) rather than a flat
|
|
52
|
-
* field list.
|
|
53
|
-
*
|
|
54
|
-
* FauxClient) — neither of which fancy-flow depends on.
|
|
52
|
+
* field list. That page IS a fancy-cms document — fancy-flow defines no
|
|
53
|
+
* document schema of its own and never re-implements one.
|
|
55
54
|
*
|
|
56
|
-
*
|
|
55
|
+
* The wiring ships in the box. Import the subpath once and the node lights up:
|
|
57
56
|
*
|
|
58
|
-
* ```
|
|
59
|
-
* import
|
|
60
|
-
* import { StagesViewer } from "@particle-academy/fancy-cms-ui";
|
|
61
|
-
* import { registerRichInputAdapter } from "@particle-academy/fancy-flow";
|
|
62
|
-
*
|
|
63
|
-
* registerRichInputAdapter({
|
|
64
|
-
* FauxClient,
|
|
65
|
-
* renderDocument: (doc) => <StagesViewer doc={doc} />,
|
|
66
|
-
* });
|
|
57
|
+
* ```ts
|
|
58
|
+
* import "@particle-academy/fancy-flow/rich-input";
|
|
67
59
|
* ```
|
|
68
60
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* workflow editor should not
|
|
61
|
+
* That module registers fancy-cms's `PageDoc` + `CmsPage` renderer + `Editor`
|
|
62
|
+
* against this seam. It lives on a separate entry so `@particle-academy/
|
|
63
|
+
* fancy-cms-ui` and `@particle-academy/react-fancy` stay OPTIONAL peers — most
|
|
64
|
+
* flows never use a rich input, and a workflow editor should not drag a CMS
|
|
65
|
+
* into every install.
|
|
66
|
+
*
|
|
67
|
+
* The seam stays public so a host can substitute a different document engine,
|
|
68
|
+
* but that is the escape hatch, not the expected path.
|
|
69
|
+
*
|
|
70
|
+
* Until something registers, the node still registers and still round-trips
|
|
71
|
+
* its config — it renders a "how to enable" body rather than an empty card.
|
|
73
72
|
*/
|
|
74
73
|
type RichInputAdapter = {
|
|
75
74
|
/**
|
|
@@ -77,11 +76,13 @@ type RichInputAdapter = {
|
|
|
77
76
|
* frame that mimics a browser window or device and scales its content down
|
|
78
77
|
* to fit. Used to preview the authored page inside the node card.
|
|
79
78
|
*/
|
|
80
|
-
FauxClient?:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
FauxClient?: ComponentType<any>;
|
|
80
|
+
/**
|
|
81
|
+
* Props for the frame — e.g. `{ variant: "browser", width: 1280, scale: "fit" }`
|
|
82
|
+
* so a full-width page renders at its real width and scales down into the
|
|
83
|
+
* node card instead of reflowing to a cramped layout that misrepresents it.
|
|
84
|
+
*/
|
|
85
|
+
frameProps?: Record<string, unknown>;
|
|
85
86
|
/** Render the stored document read-only, for the in-node preview. */
|
|
86
87
|
renderDocument?: (doc: unknown) => ReactNode;
|
|
87
88
|
/** Editor mounted in the config panel via `renderDocumentField`. */
|
package/dist/registry.cjs
CHANGED
|
@@ -60,15 +60,14 @@ function RichInputPreview({ config }) {
|
|
|
60
60
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ff-rich-preview", children: [
|
|
61
61
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-rich-preview__title", children: title }),
|
|
62
62
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ff-rich-preview__unavailable", children: [
|
|
63
|
-
"
|
|
64
|
-
" ",
|
|
63
|
+
"Add ",
|
|
65
64
|
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "@particle-academy/fancy-cms-ui" }),
|
|
66
65
|
" +",
|
|
67
66
|
" ",
|
|
68
67
|
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "@particle-academy/react-fancy" }),
|
|
69
|
-
", then
|
|
68
|
+
", then",
|
|
70
69
|
" ",
|
|
71
|
-
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "
|
|
70
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: 'import "@particle-academy/fancy-flow/rich-input"' }),
|
|
72
71
|
"."
|
|
73
72
|
] })
|
|
74
73
|
] });
|
|
@@ -77,7 +76,7 @@ function RichInputPreview({ config }) {
|
|
|
77
76
|
const Frame = a.FauxClient;
|
|
78
77
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ff-rich-preview", children: [
|
|
79
78
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-rich-preview__title", children: title }),
|
|
80
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ff-rich-preview__frame", children: Frame ? /* @__PURE__ */ jsxRuntime.jsx(Frame, { variant: "browser", children: body }) : body })
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ff-rich-preview__frame", children: Frame ? /* @__PURE__ */ jsxRuntime.jsx(Frame, { ...a.frameProps ?? { variant: "browser" }, children: body }) : body })
|
|
81
80
|
] });
|
|
82
81
|
}
|
|
83
82
|
|