@particle-academy/fancy-flow 0.52.0 → 0.54.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.
Files changed (49) hide show
  1. package/dist/{ConfigFieldRenderer-Bc9Txnql.d.cts → HumanPrompt-CPl-Spmp.d.cts} +75 -1
  2. package/dist/{ConfigFieldRenderer-Bt3RGT7Z.d.ts → HumanPrompt-DlJSFi3F.d.ts} +75 -1
  3. package/dist/{chunk-JOXMAWAI.js → chunk-CIBW5ATA.js} +148 -5
  4. package/dist/chunk-CIBW5ATA.js.map +1 -0
  5. package/dist/{chunk-PEX3ZGCO.js → chunk-FG3C7LIG.js} +3 -3
  6. package/dist/{chunk-PEX3ZGCO.js.map → chunk-FG3C7LIG.js.map} +1 -1
  7. package/dist/{chunk-PU3CLTAG.js → chunk-FH6MWLKD.js} +3 -3
  8. package/dist/{chunk-PU3CLTAG.js.map → chunk-FH6MWLKD.js.map} +1 -1
  9. package/dist/{chunk-PWIHOR57.js → chunk-FTGVVKWX.js} +4 -4
  10. package/dist/{chunk-PWIHOR57.js.map → chunk-FTGVVKWX.js.map} +1 -1
  11. package/dist/{chunk-I7ZDPY7C.js → chunk-VWANLNL5.js} +3 -3
  12. package/dist/{chunk-I7ZDPY7C.js.map → chunk-VWANLNL5.js.map} +1 -1
  13. package/dist/{chunk-RR7A6IUW.js → chunk-WCFRKXH5.js} +3 -3
  14. package/dist/{chunk-RR7A6IUW.js.map → chunk-WCFRKXH5.js.map} +1 -1
  15. package/dist/durable.cjs +103 -2
  16. package/dist/durable.cjs.map +1 -1
  17. package/dist/durable.js +1 -1
  18. package/dist/engine.cjs +103 -2
  19. package/dist/engine.cjs.map +1 -1
  20. package/dist/engine.js +3 -3
  21. package/dist/fields/react-fancy.cjs +66 -0
  22. package/dist/fields/react-fancy.cjs.map +1 -1
  23. package/dist/fields/react-fancy.d.cts +35 -2
  24. package/dist/fields/react-fancy.d.ts +35 -2
  25. package/dist/fields/react-fancy.js +67 -2
  26. package/dist/fields/react-fancy.js.map +1 -1
  27. package/dist/index.cjs +245 -44
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +13 -2
  30. package/dist/index.d.ts +13 -2
  31. package/dist/index.js +111 -53
  32. package/dist/index.js.map +1 -1
  33. package/dist/registry.cjs +103 -2
  34. package/dist/registry.cjs.map +1 -1
  35. package/dist/registry.js +2 -2
  36. package/dist/runtime.cjs +103 -2
  37. package/dist/runtime.cjs.map +1 -1
  38. package/dist/runtime.js +3 -3
  39. package/dist/schema.cjs +103 -2
  40. package/dist/schema.cjs.map +1 -1
  41. package/dist/schema.js +2 -2
  42. package/dist/screens.cjs +103 -2
  43. package/dist/screens.cjs.map +1 -1
  44. package/dist/screens.js +4 -4
  45. package/dist/ux.cjs +103 -2
  46. package/dist/ux.cjs.map +1 -1
  47. package/dist/ux.js +1 -1
  48. package/package.json +1 -1
  49. package/dist/chunk-JOXMAWAI.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -5,8 +5,8 @@ import { ConnectionValidatorOptions } from './registry/index.cjs';
5
5
  export { ANY_PORT_TYPE, BUILTIN_KINDS, PortCompatibility, RegistryNode, RichInputAdapter, RichInputPreview, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerBuiltinKinds, registerRichInputAdapter, resolveNodePorts, resolvePortSpec } from './registry/index.cjs';
6
6
  import { a as FlowNode, F as FlowGraph, g as NodeRunStatus, E as ExecutorRegistry } from './types-JFYjPJAG.cjs';
7
7
  export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, d as FlowEdge, e as FlowNodeData, f as FlowNodeKind, N as NodeExecutor, h as NoteNodeData, O as OutputNodeData, P as PortDescriptor, R as RunEvent, S as SubgraphNodeData, T as TriggerNodeData } from './types-JFYjPJAG.cjs';
8
- import { C as ConfigFieldRenderFn } from './ConfigFieldRenderer-Bc9Txnql.cjs';
9
- export { a as ConfigFieldRenderContext, b as ConfigFieldRenderer, c as ConfigFieldRendererProps } from './ConfigFieldRenderer-Bc9Txnql.cjs';
8
+ import { C as ConfigFieldRenderFn, H as HumanFieldRenderers } from './HumanPrompt-CPl-Spmp.cjs';
9
+ export { a as ConfigFieldRenderContext, b as ConfigFieldRenderer, c as ConfigFieldRendererProps } from './HumanPrompt-CPl-Spmp.cjs';
10
10
  import { WorkflowSchema, WorkflowMetadata } from './schema/index.cjs';
11
11
  export { ImportIssue, ImportOptions, ImportResult, WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, WorkflowSchemaEdge, WorkflowSchemaNode, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './schema/index.cjs';
12
12
  import { AutoLayoutOptions } from './layout/index.cjs';
@@ -321,6 +321,17 @@ type FlowEditorProps = {
321
321
  value?: FlowGraph;
322
322
  /** Executor registry passed to runFlow. Each kind name maps to an executor. */
323
323
  executors?: ExecutorRegistry;
324
+ /**
325
+ * Host controls for the `user_input` / `human_approval` pause form, keyed by
326
+ * canonical field type. A renderer returning `null` declines that field and
327
+ * falls through to the built-in, so a PARTIAL map is safe to spread.
328
+ *
329
+ * The built-ins are native `--ff-*`-themed elements because react-fancy is an
330
+ * OPTIONAL peer and this component ships in the main entry. A host that has
331
+ * react-fancy opts into its primitives with
332
+ * `humanFieldRenderers` from `@particle-academy/fancy-flow/fields/react-fancy`.
333
+ */
334
+ humanFieldRenderers?: HumanFieldRenderers;
324
335
  /** Saved metadata for export. */
325
336
  metadata?: WorkflowMetadata;
326
337
  /** Show the palette sidebar. Default true. */
package/dist/index.d.ts CHANGED
@@ -5,8 +5,8 @@ import { ConnectionValidatorOptions } from './registry/index.js';
5
5
  export { ANY_PORT_TYPE, BUILTIN_KINDS, PortCompatibility, RegistryNode, RichInputAdapter, RichInputPreview, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerBuiltinKinds, registerRichInputAdapter, resolveNodePorts, resolvePortSpec } from './registry/index.js';
6
6
  import { a as FlowNode, F as FlowGraph, g as NodeRunStatus, E as ExecutorRegistry } from './types-JFYjPJAG.js';
7
7
  export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, d as FlowEdge, e as FlowNodeData, f as FlowNodeKind, N as NodeExecutor, h as NoteNodeData, O as OutputNodeData, P as PortDescriptor, R as RunEvent, S as SubgraphNodeData, T as TriggerNodeData } from './types-JFYjPJAG.js';
8
- import { C as ConfigFieldRenderFn } from './ConfigFieldRenderer-Bt3RGT7Z.js';
9
- export { a as ConfigFieldRenderContext, b as ConfigFieldRenderer, c as ConfigFieldRendererProps } from './ConfigFieldRenderer-Bt3RGT7Z.js';
8
+ import { C as ConfigFieldRenderFn, H as HumanFieldRenderers } from './HumanPrompt-DlJSFi3F.js';
9
+ export { a as ConfigFieldRenderContext, b as ConfigFieldRenderer, c as ConfigFieldRendererProps } from './HumanPrompt-DlJSFi3F.js';
10
10
  import { WorkflowSchema, WorkflowMetadata } from './schema/index.js';
11
11
  export { ImportIssue, ImportOptions, ImportResult, WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, WorkflowSchemaEdge, WorkflowSchemaNode, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './schema/index.js';
12
12
  import { AutoLayoutOptions } from './layout/index.js';
@@ -321,6 +321,17 @@ type FlowEditorProps = {
321
321
  value?: FlowGraph;
322
322
  /** Executor registry passed to runFlow. Each kind name maps to an executor. */
323
323
  executors?: ExecutorRegistry;
324
+ /**
325
+ * Host controls for the `user_input` / `human_approval` pause form, keyed by
326
+ * canonical field type. A renderer returning `null` declines that field and
327
+ * falls through to the built-in, so a PARTIAL map is safe to spread.
328
+ *
329
+ * The built-ins are native `--ff-*`-themed elements because react-fancy is an
330
+ * OPTIONAL peer and this component ships in the main entry. A host that has
331
+ * react-fancy opts into its primitives with
332
+ * `humanFieldRenderers` from `@particle-academy/fancy-flow/fields/react-fancy`.
333
+ */
334
+ humanFieldRenderers?: HumanFieldRenderers;
324
335
  /** Saved metadata for export. */
325
336
  metadata?: WorkflowMetadata;
326
337
  /** Show the palette sidebar. Default true. */
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
- import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-PWIHOR57.js';
2
- export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-PWIHOR57.js';
3
- import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-PEX3ZGCO.js';
4
- export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-PEX3ZGCO.js';
5
- export { runCohort } from './chunk-RR7A6IUW.js';
1
+ import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-FTGVVKWX.js';
2
+ export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-FTGVVKWX.js';
3
+ import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-FG3C7LIG.js';
4
+ export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-FG3C7LIG.js';
5
+ export { runCohort } from './chunk-WCFRKXH5.js';
6
6
  export { evaluateConfig, evaluateExpression, resolvePath, text, truthy } from './chunk-BHM5HGXH.js';
7
- import { buildNodeTypes } from './chunk-I7ZDPY7C.js';
8
- export { ANY_PORT_TYPE, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility } from './chunk-I7ZDPY7C.js';
7
+ import { buildNodeTypes } from './chunk-VWANLNL5.js';
8
+ export { ANY_PORT_TYPE, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility } from './chunk-VWANLNL5.js';
9
9
  export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, decodePause, encodePause, isPause, pauseForHuman } from './chunk-UEOE6B52.js';
10
- import { workflowToBlob, importWorkflow, exportWorkflow } from './chunk-PU3CLTAG.js';
11
- export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-PU3CLTAG.js';
12
- import { ReactFlowProvider, useReactFlow, onNodeKindsChanged, listNodeKinds, getNodeKind, defaultConfigFor, FlowEditorProvider, addEdge, applyEdgeChanges, applyNodeChanges, Position, ensureBuiltinKinds, validateConfig, categoryAccent, Handle } from './chunk-JOXMAWAI.js';
13
- export { BUILTIN_KINDS, LaneNode, NoteNode, categoryAccent, clearNodeKindOverrides, defaultConfigFor, ensureBuiltinKinds, getNodeKind, listNodeKinds, onNodeKindsChanged, overrideNodeKind, registerBuiltinKinds, registerNodeKind, resolveNodePorts, resolvePortSpec, runFlow, useFlowEditor, useFlowEditorOptional, validateConfig } from './chunk-JOXMAWAI.js';
10
+ import { workflowToBlob, importWorkflow, exportWorkflow } from './chunk-FH6MWLKD.js';
11
+ export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-FH6MWLKD.js';
12
+ import { ReactFlowProvider, useReactFlow, humanInputFields, onNodeKindsChanged, listNodeKinds, getNodeKind, defaultConfigFor, FlowEditorProvider, addEdge, applyEdgeChanges, applyNodeChanges, Position, ensureBuiltinKinds, validateConfig, categoryAccent, Handle } from './chunk-CIBW5ATA.js';
13
+ export { BUILTIN_KINDS, LaneNode, NoteNode, categoryAccent, clearNodeKindOverrides, defaultConfigFor, ensureBuiltinKinds, getNodeKind, listNodeKinds, onNodeKindsChanged, overrideNodeKind, registerBuiltinKinds, registerNodeKind, resolveNodePorts, resolvePortSpec, runFlow, useFlowEditor, useFlowEditorOptional, validateConfig } from './chunk-CIBW5ATA.js';
14
14
  import { getRichInputAdapter } from './chunk-F5RPRB7A.js';
15
15
  export { RichInputPreview, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerRichInputAdapter } from './chunk-F5RPRB7A.js';
16
16
  import './chunk-USL4FMFU.js';
@@ -974,27 +974,35 @@ function formatTime(at) {
974
974
  const d = new Date(at);
975
975
  return `${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${Math.floor(d.getMilliseconds() / 100)}`;
976
976
  }
977
- function humanInputFields(config) {
978
- const raw = Array.isArray(config?.fields) ? config.fields : [];
979
- const fields = raw.filter((f) => f && typeof f === "object" && typeof f.key === "string" && f.key).map((f) => ({
980
- key: f.key,
981
- label: typeof f.label === "string" && f.label ? f.label : f.key,
982
- type: ["text", "textarea", "number", "select", "switch"].includes(f.type) ? f.type : "text",
983
- required: !!f.required,
984
- placeholder: typeof f.placeholder === "string" ? f.placeholder : void 0,
985
- options: Array.isArray(f.options) ? f.options : void 0,
986
- default: f.default
987
- }));
988
- if (fields.length) return fields;
989
- const title = typeof config?.title === "string" && config.title ? config.title : "Your answer";
990
- return [{ key: "value", label: title, type: "textarea", required: true }];
991
- }
977
+ var INPUT_TYPE = {
978
+ text: "text",
979
+ number: "number",
980
+ date: "date",
981
+ datetime: "datetime-local",
982
+ time: "time",
983
+ email: "email",
984
+ url: "url",
985
+ tel: "tel",
986
+ password: "password"
987
+ };
992
988
  function initialValues(fields) {
993
989
  const v = {};
994
- for (const f of fields) v[f.key] = f.type === "switch" ? !!f.default : f.default ?? "";
990
+ for (const f of fields) {
991
+ if (f.type === "switch") {
992
+ v[f.key] = !!f.default;
993
+ } else if (f.type === "number") {
994
+ v[f.key] = typeof f.default === "number" ? f.default : f.default === void 0 || f.default === "" ? "" : Number(f.default);
995
+ } else {
996
+ v[f.key] = f.default ?? "";
997
+ }
998
+ }
995
999
  return v;
996
1000
  }
997
- function HumanPrompt({ request, onCancel }) {
1001
+ function HumanPrompt({
1002
+ request,
1003
+ onCancel,
1004
+ fieldRenderers
1005
+ }) {
998
1006
  const firstRef = useRef(null);
999
1007
  useEffect(() => {
1000
1008
  firstRef.current?.focus();
@@ -1006,7 +1014,7 @@ function HumanPrompt({ request, onCancel }) {
1006
1014
  }, [onCancel]);
1007
1015
  return /* @__PURE__ */ jsx("div", { className: "ff-prompt-overlay", role: "dialog", "aria-modal": "true", "aria-label": request.title, children: /* @__PURE__ */ jsxs("div", { className: "ff-prompt", onClick: (e) => e.stopPropagation(), children: [
1008
1016
  /* @__PURE__ */ jsx("div", { className: "ff-prompt__title", children: request.title }),
1009
- request.kind === "approval" ? /* @__PURE__ */ jsx(ApprovalBody, { request, onCancel }) : /* @__PURE__ */ jsx(InputBody, { request, onCancel, firstRef })
1017
+ request.kind === "approval" ? /* @__PURE__ */ jsx(ApprovalBody, { request, onCancel }) : /* @__PURE__ */ jsx(InputBody, { request, onCancel, firstRef, fieldRenderers })
1010
1018
  ] }) });
1011
1019
  }
1012
1020
  function ApprovalBody({ request, onCancel }) {
@@ -1022,10 +1030,13 @@ function ApprovalBody({ request, onCancel }) {
1022
1030
  function InputBody({
1023
1031
  request,
1024
1032
  onCancel,
1025
- firstRef
1033
+ firstRef,
1034
+ fieldRenderers
1026
1035
  }) {
1027
1036
  const [values, setValues] = useState(() => initialValues(request.fields));
1028
1037
  const set = (k, v) => setValues((prev) => ({ ...prev, [k]: v }));
1038
+ const uid = useId();
1039
+ const fieldId = (key) => `${uid}-${key}`;
1029
1040
  const missing = request.fields.filter((f) => f.required && (values[f.key] === void 0 || values[f.key] === ""));
1030
1041
  const submit = () => {
1031
1042
  if (missing.length === 0) request.resolve(values);
@@ -1044,12 +1055,22 @@ function InputBody({
1044
1055
  }
1045
1056
  },
1046
1057
  children: [
1047
- /* @__PURE__ */ jsx("div", { className: "ff-prompt__fields", children: request.fields.map((f, i) => /* @__PURE__ */ jsxs("label", { className: "ff-prompt__field", children: [
1048
- /* @__PURE__ */ jsxs("span", { className: "ff-prompt__label", children: [
1058
+ /* @__PURE__ */ jsx("div", { className: "ff-prompt__fields", children: request.fields.map((f, i) => /* @__PURE__ */ jsxs("div", { className: "ff-prompt__field", children: [
1059
+ /* @__PURE__ */ jsxs("label", { className: "ff-prompt__label", htmlFor: fieldId(f.key), children: [
1049
1060
  f.label ?? f.key,
1050
- f.required && /* @__PURE__ */ jsx("span", { className: "ff-prompt__req", children: " *" })
1061
+ f.required && /* @__PURE__ */ jsx("span", { className: "ff-prompt__req", "aria-hidden": "true", children: " *" })
1051
1062
  ] }),
1052
- renderControl(f, values[f.key], (v) => set(f.key, v), i === 0 ? firstRef : void 0)
1063
+ /* @__PURE__ */ jsx(
1064
+ FieldControl,
1065
+ {
1066
+ field: f,
1067
+ id: fieldId(f.key),
1068
+ value: values[f.key],
1069
+ onChange: (v) => set(f.key, v),
1070
+ autoFocusRef: i === 0 ? firstRef : void 0,
1071
+ renderers: fieldRenderers
1072
+ }
1073
+ )
1053
1074
  ] }, f.key)) }),
1054
1075
  /* @__PURE__ */ jsxs("div", { className: "ff-prompt__actions", children: [
1055
1076
  /* @__PURE__ */ jsx("button", { type: "button", className: "ff-prompt__btn ff-prompt__btn--ghost", onClick: onCancel, children: "Cancel" }),
@@ -1059,45 +1080,74 @@ function InputBody({
1059
1080
  }
1060
1081
  );
1061
1082
  }
1062
- function renderControl(f, value, onChange, ref) {
1063
- const common = { className: "ff-prompt__input", placeholder: f.placeholder };
1064
- if (f.type === "textarea") {
1083
+ function FieldControl({
1084
+ field,
1085
+ id,
1086
+ value,
1087
+ onChange,
1088
+ autoFocusRef,
1089
+ renderers
1090
+ }) {
1091
+ const override = renderers?.[field.type ?? "text"];
1092
+ if (override) {
1093
+ const rendered = override({ field, id, value, onChange, autoFocusRef });
1094
+ if (rendered !== null && rendered !== void 0) return /* @__PURE__ */ jsx(Fragment, { children: rendered });
1095
+ }
1096
+ const handle = { id, "data-ff-field": field.key };
1097
+ if (field.type === "textarea") {
1065
1098
  return /* @__PURE__ */ jsx(
1066
1099
  "textarea",
1067
1100
  {
1068
- ...common,
1069
- ref,
1101
+ ...handle,
1102
+ className: "ff-prompt__input",
1103
+ placeholder: field.placeholder,
1104
+ ref: autoFocusRef,
1070
1105
  rows: 3,
1071
1106
  value: String(value ?? ""),
1072
1107
  onChange: (e) => onChange(e.target.value)
1073
1108
  }
1074
1109
  );
1075
1110
  }
1076
- if (f.type === "switch") {
1111
+ if (field.type === "switch") {
1077
1112
  return /* @__PURE__ */ jsx(
1078
1113
  "input",
1079
1114
  {
1115
+ ...handle,
1080
1116
  type: "checkbox",
1081
1117
  className: "ff-prompt__switch",
1118
+ ref: autoFocusRef,
1082
1119
  checked: !!value,
1083
1120
  onChange: (e) => onChange(e.target.checked)
1084
1121
  }
1085
1122
  );
1086
1123
  }
1087
- if (f.type === "select" && f.options && f.options.length) {
1088
- return /* @__PURE__ */ jsxs("select", { className: "ff-prompt__input", value: String(value ?? ""), onChange: (e) => onChange(e.target.value), children: [
1089
- /* @__PURE__ */ jsx("option", { value: "", disabled: true, children: "Choose\u2026" }),
1090
- f.options.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, children: o.label }, o.value))
1091
- ] });
1124
+ if (field.type === "select") {
1125
+ const options = field.options ?? [];
1126
+ return /* @__PURE__ */ jsxs(
1127
+ "select",
1128
+ {
1129
+ ...handle,
1130
+ className: "ff-prompt__input",
1131
+ ref: autoFocusRef,
1132
+ value: String(value ?? ""),
1133
+ onChange: (e) => onChange(e.target.value),
1134
+ children: [
1135
+ /* @__PURE__ */ jsx("option", { value: "", disabled: true, children: options.length ? "Choose\u2026" : "No choices configured" }),
1136
+ options.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, children: o.label }, o.value))
1137
+ ]
1138
+ }
1139
+ );
1092
1140
  }
1093
1141
  return /* @__PURE__ */ jsx(
1094
1142
  "input",
1095
1143
  {
1096
- ...common,
1097
- ref,
1098
- type: f.type === "number" ? "number" : "text",
1144
+ ...handle,
1145
+ className: "ff-prompt__input",
1146
+ placeholder: field.placeholder,
1147
+ ref: autoFocusRef,
1148
+ type: INPUT_TYPE[field.type ?? "text"] ?? "text",
1099
1149
  value: String(value ?? ""),
1100
- onChange: (e) => onChange(f.type === "number" ? e.target.value === "" ? "" : Number(e.target.value) : e.target.value)
1150
+ onChange: (e) => onChange(field.type === "number" ? e.target.value === "" ? "" : Number(e.target.value) : e.target.value)
1101
1151
  }
1102
1152
  );
1103
1153
  }
@@ -1130,6 +1180,7 @@ function FlowEditorInner({
1130
1180
  onDelete,
1131
1181
  onEdgeDelete,
1132
1182
  confirmDelete,
1183
+ humanFieldRenderers,
1133
1184
  apiRef
1134
1185
  }) {
1135
1186
  const internal = useFlowState(initial);
@@ -1666,10 +1717,17 @@ function FlowEditorInner({
1666
1717
  }
1667
1718
  ),
1668
1719
  showFeed && (slots.feed ? slots.feed(api) : /* @__PURE__ */ jsx(FlowRunFeed, { entries: runner.feed, running: api.running, className: "ff-editor__feed" })),
1669
- prompt && /* @__PURE__ */ jsx(HumanPrompt, { request: prompt, onCancel: () => {
1670
- setPrompt(null);
1671
- runner.cancel();
1672
- } })
1720
+ prompt && /* @__PURE__ */ jsx(
1721
+ HumanPrompt,
1722
+ {
1723
+ request: prompt,
1724
+ onCancel: () => {
1725
+ setPrompt(null);
1726
+ runner.cancel();
1727
+ },
1728
+ fieldRenderers: humanFieldRenderers
1729
+ }
1730
+ )
1673
1731
  ] }),
1674
1732
  showPanel && (slots.panel ? slots.panel(api) : /* @__PURE__ */ jsxs("div", { className: "ff-editor__panel-wrap", children: [
1675
1733
  /* @__PURE__ */ jsx(