@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/durable.cjs CHANGED
@@ -112,6 +112,59 @@ var InMemoryClaimStore = class {
112
112
  function isSettled(status) {
113
113
  return status !== void 0 && SETTLED.includes(status);
114
114
  }
115
+
116
+ // src/components/FlowEditor/human-fields.ts
117
+ var HUMAN_FIELD_TYPE_ALIASES = {
118
+ text: "text",
119
+ string: "text",
120
+ str: "text",
121
+ input: "text",
122
+ textarea: "textarea",
123
+ long_text: "textarea",
124
+ longtext: "textarea",
125
+ "long-text": "textarea",
126
+ multiline: "textarea",
127
+ paragraph: "textarea",
128
+ markdown: "textarea",
129
+ number: "number",
130
+ numeric: "number",
131
+ integer: "number",
132
+ int: "number",
133
+ float: "number",
134
+ decimal: "number",
135
+ select: "select",
136
+ enum: "select",
137
+ choice: "select",
138
+ choices: "select",
139
+ dropdown: "select",
140
+ options: "select",
141
+ radio: "select",
142
+ switch: "switch",
143
+ bool: "switch",
144
+ boolean: "switch",
145
+ checkbox: "switch",
146
+ toggle: "switch",
147
+ date: "date",
148
+ datetime: "datetime",
149
+ "datetime-local": "datetime",
150
+ datetimelocal: "datetime",
151
+ timestamp: "datetime",
152
+ time: "time",
153
+ email: "email",
154
+ "e-mail": "email",
155
+ url: "url",
156
+ uri: "url",
157
+ link: "url",
158
+ tel: "tel",
159
+ phone: "tel",
160
+ telephone: "tel",
161
+ password: "password",
162
+ secret: "password"
163
+ };
164
+ function humanFieldType(raw) {
165
+ if (typeof raw !== "string") return "text";
166
+ return HUMAN_FIELD_TYPE_ALIASES[raw.trim().toLowerCase()] ?? "text";
167
+ }
115
168
  function RichInputPreview({ config }) {
116
169
  const title = typeof config.title === "string" && config.title.trim() !== "" ? config.title : "Untitled step";
117
170
  config.document;
@@ -9679,6 +9732,20 @@ var subflowExecutor = async (ctx) => {
9679
9732
  };
9680
9733
 
9681
9734
  // src/registry/builtin.ts
9735
+ var HUMAN_FIELD_OUTPUT_TYPE = {
9736
+ text: "string",
9737
+ textarea: "string",
9738
+ select: "string",
9739
+ date: "string",
9740
+ datetime: "string",
9741
+ time: "string",
9742
+ email: "string",
9743
+ url: "string",
9744
+ tel: "string",
9745
+ password: "string",
9746
+ number: "number",
9747
+ switch: "boolean"
9748
+ };
9682
9749
  function casePorts(cases) {
9683
9750
  const byPort = /* @__PURE__ */ new Map();
9684
9751
  if (cases && typeof cases === "object" && !Array.isArray(cases)) {
@@ -9776,7 +9843,17 @@ var KINDS = [
9776
9843
  name: "@particle-academy/user_input",
9777
9844
  // The keys an author declared on THIS node — the case a static list cannot
9778
9845
  // express, and the one issue #5 named.
9779
- outputShape: (config) => (config.fields ?? []).filter((f) => typeof f.key === "string" && f.key !== "").map((f) => ({ path: f.key, type: "string", description: f.label })),
9846
+ //
9847
+ // The TYPE comes from the same normalizer the form renders with, so the
9848
+ // variable picker agrees with what the run actually resolves. It used to say
9849
+ // `string` for every field, which was wrong the moment a field was a number
9850
+ // or a switch — the picker told an author `{{ $json.age }}` was text while
9851
+ // the form handed the next node a number.
9852
+ outputShape: (config) => (config.fields ?? []).filter((f) => typeof f.key === "string" && f.key !== "").map((f) => ({
9853
+ path: f.key,
9854
+ type: HUMAN_FIELD_OUTPUT_TYPE[humanFieldType(f.type)],
9855
+ description: f.label
9856
+ })),
9780
9857
  aliases: ["user_input", "@fancy/user_input"],
9781
9858
  pausesForHuman: "input",
9782
9859
  category: "human",
@@ -9803,14 +9880,38 @@ var KINDS = [
9803
9880
  key: "type",
9804
9881
  label: "Type",
9805
9882
  default: "text",
9883
+ // Every control `HumanPrompt` can render. A type the form supports
9884
+ // but the panel cannot select is reachable only by hand-editing the
9885
+ // workflow JSON — which is the audience this panel exists for.
9806
9886
  options: [
9807
9887
  { value: "text", label: "Text" },
9808
9888
  { value: "textarea", label: "Long text" },
9809
9889
  { value: "number", label: "Number" },
9810
9890
  { value: "select", label: "Select" },
9811
- { value: "switch", label: "Switch" }
9891
+ { value: "switch", label: "Switch (yes / no)" },
9892
+ { value: "date", label: "Date" },
9893
+ { value: "datetime", label: "Date + time" },
9894
+ { value: "time", label: "Time" },
9895
+ { value: "email", label: "Email" },
9896
+ { value: "url", label: "URL" },
9897
+ { value: "tel", label: "Phone" },
9898
+ { value: "password", label: "Password" }
9812
9899
  ]
9813
9900
  },
9901
+ {
9902
+ // Without this a panel-authored select had nothing to choose from,
9903
+ // so it rendered an empty dropdown — the type was declarable and
9904
+ // unusable in the same breath.
9905
+ type: "keyvalue",
9906
+ key: "options",
9907
+ label: "Choices",
9908
+ description: "Select fields only. Left is the value the flow receives, right is what the person sees.",
9909
+ keyLabel: "Value",
9910
+ valueLabel: "Label",
9911
+ keyPlaceholder: "small",
9912
+ valuePlaceholder: "Small",
9913
+ addLabel: "Add choice"
9914
+ },
9814
9915
  { type: "switch", key: "required", label: "Required", default: false }
9815
9916
  ],
9816
9917
  default: [{ key: "answer", label: "Your answer", type: "textarea", required: true }]