@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.cjs CHANGED
@@ -30,6 +30,59 @@ function resolveNodePorts(node, kind) {
30
30
  outputs: data?.outputs ?? resolvePortSpec(kind?.outputs, config)
31
31
  };
32
32
  }
33
+
34
+ // src/components/FlowEditor/human-fields.ts
35
+ var HUMAN_FIELD_TYPE_ALIASES = {
36
+ text: "text",
37
+ string: "text",
38
+ str: "text",
39
+ input: "text",
40
+ textarea: "textarea",
41
+ long_text: "textarea",
42
+ longtext: "textarea",
43
+ "long-text": "textarea",
44
+ multiline: "textarea",
45
+ paragraph: "textarea",
46
+ markdown: "textarea",
47
+ number: "number",
48
+ numeric: "number",
49
+ integer: "number",
50
+ int: "number",
51
+ float: "number",
52
+ decimal: "number",
53
+ select: "select",
54
+ enum: "select",
55
+ choice: "select",
56
+ choices: "select",
57
+ dropdown: "select",
58
+ options: "select",
59
+ radio: "select",
60
+ switch: "switch",
61
+ bool: "switch",
62
+ boolean: "switch",
63
+ checkbox: "switch",
64
+ toggle: "switch",
65
+ date: "date",
66
+ datetime: "datetime",
67
+ "datetime-local": "datetime",
68
+ datetimelocal: "datetime",
69
+ timestamp: "datetime",
70
+ time: "time",
71
+ email: "email",
72
+ "e-mail": "email",
73
+ url: "url",
74
+ uri: "url",
75
+ link: "url",
76
+ tel: "tel",
77
+ phone: "tel",
78
+ telephone: "tel",
79
+ password: "password",
80
+ secret: "password"
81
+ };
82
+ function humanFieldType(raw) {
83
+ if (typeof raw !== "string") return "text";
84
+ return HUMAN_FIELD_TYPE_ALIASES[raw.trim().toLowerCase()] ?? "text";
85
+ }
33
86
  var adapter = null;
34
87
  var listeners = /* @__PURE__ */ new Set();
35
88
  function registerRichInputAdapter(next) {
@@ -9718,6 +9771,20 @@ var subflowExecutor = async (ctx) => {
9718
9771
  };
9719
9772
 
9720
9773
  // src/registry/builtin.ts
9774
+ var HUMAN_FIELD_OUTPUT_TYPE = {
9775
+ text: "string",
9776
+ textarea: "string",
9777
+ select: "string",
9778
+ date: "string",
9779
+ datetime: "string",
9780
+ time: "string",
9781
+ email: "string",
9782
+ url: "string",
9783
+ tel: "string",
9784
+ password: "string",
9785
+ number: "number",
9786
+ switch: "boolean"
9787
+ };
9721
9788
  function casePorts(cases) {
9722
9789
  const byPort = /* @__PURE__ */ new Map();
9723
9790
  if (cases && typeof cases === "object" && !Array.isArray(cases)) {
@@ -9815,7 +9882,17 @@ var KINDS = [
9815
9882
  name: "@particle-academy/user_input",
9816
9883
  // The keys an author declared on THIS node — the case a static list cannot
9817
9884
  // express, and the one issue #5 named.
9818
- outputShape: (config) => (config.fields ?? []).filter((f) => typeof f.key === "string" && f.key !== "").map((f) => ({ path: f.key, type: "string", description: f.label })),
9885
+ //
9886
+ // The TYPE comes from the same normalizer the form renders with, so the
9887
+ // variable picker agrees with what the run actually resolves. It used to say
9888
+ // `string` for every field, which was wrong the moment a field was a number
9889
+ // or a switch — the picker told an author `{{ $json.age }}` was text while
9890
+ // the form handed the next node a number.
9891
+ outputShape: (config) => (config.fields ?? []).filter((f) => typeof f.key === "string" && f.key !== "").map((f) => ({
9892
+ path: f.key,
9893
+ type: HUMAN_FIELD_OUTPUT_TYPE[humanFieldType(f.type)],
9894
+ description: f.label
9895
+ })),
9819
9896
  aliases: ["user_input", "@fancy/user_input"],
9820
9897
  pausesForHuman: "input",
9821
9898
  category: "human",
@@ -9842,14 +9919,38 @@ var KINDS = [
9842
9919
  key: "type",
9843
9920
  label: "Type",
9844
9921
  default: "text",
9922
+ // Every control `HumanPrompt` can render. A type the form supports
9923
+ // but the panel cannot select is reachable only by hand-editing the
9924
+ // workflow JSON — which is the audience this panel exists for.
9845
9925
  options: [
9846
9926
  { value: "text", label: "Text" },
9847
9927
  { value: "textarea", label: "Long text" },
9848
9928
  { value: "number", label: "Number" },
9849
9929
  { value: "select", label: "Select" },
9850
- { value: "switch", label: "Switch" }
9930
+ { value: "switch", label: "Switch (yes / no)" },
9931
+ { value: "date", label: "Date" },
9932
+ { value: "datetime", label: "Date + time" },
9933
+ { value: "time", label: "Time" },
9934
+ { value: "email", label: "Email" },
9935
+ { value: "url", label: "URL" },
9936
+ { value: "tel", label: "Phone" },
9937
+ { value: "password", label: "Password" }
9851
9938
  ]
9852
9939
  },
9940
+ {
9941
+ // Without this a panel-authored select had nothing to choose from,
9942
+ // so it rendered an empty dropdown — the type was declarable and
9943
+ // unusable in the same breath.
9944
+ type: "keyvalue",
9945
+ key: "options",
9946
+ label: "Choices",
9947
+ description: "Select fields only. Left is the value the flow receives, right is what the person sees.",
9948
+ keyLabel: "Value",
9949
+ valueLabel: "Label",
9950
+ keyPlaceholder: "small",
9951
+ valuePlaceholder: "Small",
9952
+ addLabel: "Add choice"
9953
+ },
9853
9954
  { type: "switch", key: "required", label: "Required", default: false }
9854
9955
  ],
9855
9956
  default: [{ key: "answer", label: "Your answer", type: "textarea", required: true }]