@particle-academy/fancy-flow 0.52.0 → 0.53.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 (39) hide show
  1. package/dist/{chunk-JOXMAWAI.js → chunk-CIBW5ATA.js} +148 -5
  2. package/dist/chunk-CIBW5ATA.js.map +1 -0
  3. package/dist/{chunk-PEX3ZGCO.js → chunk-FG3C7LIG.js} +3 -3
  4. package/dist/{chunk-PEX3ZGCO.js.map → chunk-FG3C7LIG.js.map} +1 -1
  5. package/dist/{chunk-PU3CLTAG.js → chunk-FH6MWLKD.js} +3 -3
  6. package/dist/{chunk-PU3CLTAG.js.map → chunk-FH6MWLKD.js.map} +1 -1
  7. package/dist/{chunk-PWIHOR57.js → chunk-FTGVVKWX.js} +4 -4
  8. package/dist/{chunk-PWIHOR57.js.map → chunk-FTGVVKWX.js.map} +1 -1
  9. package/dist/{chunk-I7ZDPY7C.js → chunk-VWANLNL5.js} +3 -3
  10. package/dist/{chunk-I7ZDPY7C.js.map → chunk-VWANLNL5.js.map} +1 -1
  11. package/dist/{chunk-RR7A6IUW.js → chunk-WCFRKXH5.js} +3 -3
  12. package/dist/{chunk-RR7A6IUW.js.map → chunk-WCFRKXH5.js.map} +1 -1
  13. package/dist/durable.cjs +103 -2
  14. package/dist/durable.cjs.map +1 -1
  15. package/dist/durable.js +1 -1
  16. package/dist/engine.cjs +103 -2
  17. package/dist/engine.cjs.map +1 -1
  18. package/dist/engine.js +3 -3
  19. package/dist/index.cjs +218 -37
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.js +84 -46
  22. package/dist/index.js.map +1 -1
  23. package/dist/registry.cjs +103 -2
  24. package/dist/registry.cjs.map +1 -1
  25. package/dist/registry.js +2 -2
  26. package/dist/runtime.cjs +103 -2
  27. package/dist/runtime.cjs.map +1 -1
  28. package/dist/runtime.js +3 -3
  29. package/dist/schema.cjs +103 -2
  30. package/dist/schema.cjs.map +1 -1
  31. package/dist/schema.js +2 -2
  32. package/dist/screens.cjs +103 -2
  33. package/dist/screens.cjs.map +1 -1
  34. package/dist/screens.js +4 -4
  35. package/dist/ux.cjs +103 -2
  36. package/dist/ux.cjs.map +1 -1
  37. package/dist/ux.js +1 -1
  38. package/package.json +1 -1
  39. package/dist/chunk-JOXMAWAI.js.map +0 -1
package/dist/registry.js CHANGED
@@ -1,6 +1,6 @@
1
- export { ANY_PORT_TYPE, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility } from './chunk-I7ZDPY7C.js';
1
+ export { ANY_PORT_TYPE, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility } from './chunk-VWANLNL5.js';
2
2
  export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, decodePause, encodePause, isPause, pauseForHuman } from './chunk-UEOE6B52.js';
3
- export { BUILTIN_KINDS, DEFAULT_MAX_DEPTH, categoryAccent, clearNodeKindOverrides, declaredRoutes, defaultConfigFor, ensureBuiltinKinds, getNodeKind, kindIds, listNodeKinds, llmRouterExecutor as llmBranchExecutor, llmRouterExecutor, nodeConfig, onNodeKindsChanged, overrideNodeKind, registerBuiltinKinds, registerNodeKind, resolveFallbackPort, resolveKindId, resolveNodePorts, resolvePortSpec, subflowExecutor, subflowMode, subflowPorts, validateConfig } from './chunk-JOXMAWAI.js';
3
+ export { BUILTIN_KINDS, DEFAULT_MAX_DEPTH, categoryAccent, clearNodeKindOverrides, declaredRoutes, defaultConfigFor, ensureBuiltinKinds, getNodeKind, kindIds, listNodeKinds, llmRouterExecutor as llmBranchExecutor, llmRouterExecutor, nodeConfig, onNodeKindsChanged, overrideNodeKind, registerBuiltinKinds, registerNodeKind, resolveFallbackPort, resolveKindId, resolveNodePorts, resolvePortSpec, subflowExecutor, subflowMode, subflowPorts, validateConfig } from './chunk-CIBW5ATA.js';
4
4
  export { RichInputPreview, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerRichInputAdapter } from './chunk-F5RPRB7A.js';
5
5
  export { capabilityStatus, getLlmClient, getWorkflowResolver, isResolutionFailure, registerLlmClient, registerWorkflowResolver } from './chunk-USL4FMFU.js';
6
6
  //# sourceMappingURL=registry.js.map
package/dist/runtime.cjs CHANGED
@@ -9,6 +9,59 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
9
  var ReactExports__default = /*#__PURE__*/_interopDefault(ReactExports);
10
10
 
11
11
  // src/registry/builtin.ts
12
+
13
+ // src/components/FlowEditor/human-fields.ts
14
+ var HUMAN_FIELD_TYPE_ALIASES = {
15
+ text: "text",
16
+ string: "text",
17
+ str: "text",
18
+ input: "text",
19
+ textarea: "textarea",
20
+ long_text: "textarea",
21
+ longtext: "textarea",
22
+ "long-text": "textarea",
23
+ multiline: "textarea",
24
+ paragraph: "textarea",
25
+ markdown: "textarea",
26
+ number: "number",
27
+ numeric: "number",
28
+ integer: "number",
29
+ int: "number",
30
+ float: "number",
31
+ decimal: "number",
32
+ select: "select",
33
+ enum: "select",
34
+ choice: "select",
35
+ choices: "select",
36
+ dropdown: "select",
37
+ options: "select",
38
+ radio: "select",
39
+ switch: "switch",
40
+ bool: "switch",
41
+ boolean: "switch",
42
+ checkbox: "switch",
43
+ toggle: "switch",
44
+ date: "date",
45
+ datetime: "datetime",
46
+ "datetime-local": "datetime",
47
+ datetimelocal: "datetime",
48
+ timestamp: "datetime",
49
+ time: "time",
50
+ email: "email",
51
+ "e-mail": "email",
52
+ url: "url",
53
+ uri: "url",
54
+ link: "url",
55
+ tel: "tel",
56
+ phone: "tel",
57
+ telephone: "tel",
58
+ password: "password",
59
+ secret: "password"
60
+ };
61
+ function humanFieldType(raw) {
62
+ if (typeof raw !== "string") return "text";
63
+ return HUMAN_FIELD_TYPE_ALIASES[raw.trim().toLowerCase()] ?? "text";
64
+ }
12
65
  function RichInputPreview({ config }) {
13
66
  const title = typeof config.title === "string" && config.title.trim() !== "" ? config.title : "Untitled step";
14
67
  config.document;
@@ -9179,6 +9232,20 @@ var subflowExecutor = async (ctx) => {
9179
9232
  };
9180
9233
 
9181
9234
  // src/registry/builtin.ts
9235
+ var HUMAN_FIELD_OUTPUT_TYPE = {
9236
+ text: "string",
9237
+ textarea: "string",
9238
+ select: "string",
9239
+ date: "string",
9240
+ datetime: "string",
9241
+ time: "string",
9242
+ email: "string",
9243
+ url: "string",
9244
+ tel: "string",
9245
+ password: "string",
9246
+ number: "number",
9247
+ switch: "boolean"
9248
+ };
9182
9249
  function casePorts(cases) {
9183
9250
  const byPort = /* @__PURE__ */ new Map();
9184
9251
  if (cases && typeof cases === "object" && !Array.isArray(cases)) {
@@ -9276,7 +9343,17 @@ var KINDS = [
9276
9343
  name: "@particle-academy/user_input",
9277
9344
  // The keys an author declared on THIS node — the case a static list cannot
9278
9345
  // express, and the one issue #5 named.
9279
- outputShape: (config) => (config.fields ?? []).filter((f) => typeof f.key === "string" && f.key !== "").map((f) => ({ path: f.key, type: "string", description: f.label })),
9346
+ //
9347
+ // The TYPE comes from the same normalizer the form renders with, so the
9348
+ // variable picker agrees with what the run actually resolves. It used to say
9349
+ // `string` for every field, which was wrong the moment a field was a number
9350
+ // or a switch — the picker told an author `{{ $json.age }}` was text while
9351
+ // the form handed the next node a number.
9352
+ outputShape: (config) => (config.fields ?? []).filter((f) => typeof f.key === "string" && f.key !== "").map((f) => ({
9353
+ path: f.key,
9354
+ type: HUMAN_FIELD_OUTPUT_TYPE[humanFieldType(f.type)],
9355
+ description: f.label
9356
+ })),
9280
9357
  aliases: ["user_input", "@fancy/user_input"],
9281
9358
  pausesForHuman: "input",
9282
9359
  category: "human",
@@ -9303,14 +9380,38 @@ var KINDS = [
9303
9380
  key: "type",
9304
9381
  label: "Type",
9305
9382
  default: "text",
9383
+ // Every control `HumanPrompt` can render. A type the form supports
9384
+ // but the panel cannot select is reachable only by hand-editing the
9385
+ // workflow JSON — which is the audience this panel exists for.
9306
9386
  options: [
9307
9387
  { value: "text", label: "Text" },
9308
9388
  { value: "textarea", label: "Long text" },
9309
9389
  { value: "number", label: "Number" },
9310
9390
  { value: "select", label: "Select" },
9311
- { value: "switch", label: "Switch" }
9391
+ { value: "switch", label: "Switch (yes / no)" },
9392
+ { value: "date", label: "Date" },
9393
+ { value: "datetime", label: "Date + time" },
9394
+ { value: "time", label: "Time" },
9395
+ { value: "email", label: "Email" },
9396
+ { value: "url", label: "URL" },
9397
+ { value: "tel", label: "Phone" },
9398
+ { value: "password", label: "Password" }
9312
9399
  ]
9313
9400
  },
9401
+ {
9402
+ // Without this a panel-authored select had nothing to choose from,
9403
+ // so it rendered an empty dropdown — the type was declarable and
9404
+ // unusable in the same breath.
9405
+ type: "keyvalue",
9406
+ key: "options",
9407
+ label: "Choices",
9408
+ description: "Select fields only. Left is the value the flow receives, right is what the person sees.",
9409
+ keyLabel: "Value",
9410
+ valueLabel: "Label",
9411
+ keyPlaceholder: "small",
9412
+ valuePlaceholder: "Small",
9413
+ addLabel: "Add choice"
9414
+ },
9314
9415
  { type: "switch", key: "required", label: "Required", default: false }
9315
9416
  ],
9316
9417
  default: [{ key: "answer", label: "Your answer", type: "textarea", required: true }]