@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/schema.js CHANGED
@@ -1,5 +1,5 @@
1
- export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-PU3CLTAG.js';
2
- import './chunk-JOXMAWAI.js';
1
+ export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-FH6MWLKD.js';
2
+ import './chunk-CIBW5ATA.js';
3
3
  import './chunk-F5RPRB7A.js';
4
4
  import './chunk-USL4FMFU.js';
5
5
  //# sourceMappingURL=schema.js.map
package/dist/screens.cjs CHANGED
@@ -9196,6 +9196,59 @@ function SubgraphNodeInner(props) {
9196
9196
  ] }) });
9197
9197
  }
9198
9198
  var SubgraphNode = ReactExports.memo(SubgraphNodeInner);
9199
+
9200
+ // src/components/FlowEditor/human-fields.ts
9201
+ var HUMAN_FIELD_TYPE_ALIASES = {
9202
+ text: "text",
9203
+ string: "text",
9204
+ str: "text",
9205
+ input: "text",
9206
+ textarea: "textarea",
9207
+ long_text: "textarea",
9208
+ longtext: "textarea",
9209
+ "long-text": "textarea",
9210
+ multiline: "textarea",
9211
+ paragraph: "textarea",
9212
+ markdown: "textarea",
9213
+ number: "number",
9214
+ numeric: "number",
9215
+ integer: "number",
9216
+ int: "number",
9217
+ float: "number",
9218
+ decimal: "number",
9219
+ select: "select",
9220
+ enum: "select",
9221
+ choice: "select",
9222
+ choices: "select",
9223
+ dropdown: "select",
9224
+ options: "select",
9225
+ radio: "select",
9226
+ switch: "switch",
9227
+ bool: "switch",
9228
+ boolean: "switch",
9229
+ checkbox: "switch",
9230
+ toggle: "switch",
9231
+ date: "date",
9232
+ datetime: "datetime",
9233
+ "datetime-local": "datetime",
9234
+ datetimelocal: "datetime",
9235
+ timestamp: "datetime",
9236
+ time: "time",
9237
+ email: "email",
9238
+ "e-mail": "email",
9239
+ url: "url",
9240
+ uri: "url",
9241
+ link: "url",
9242
+ tel: "tel",
9243
+ phone: "tel",
9244
+ telephone: "tel",
9245
+ password: "password",
9246
+ secret: "password"
9247
+ };
9248
+ function humanFieldType(raw) {
9249
+ if (typeof raw !== "string") return "text";
9250
+ return HUMAN_FIELD_TYPE_ALIASES[raw.trim().toLowerCase()] ?? "text";
9251
+ }
9199
9252
  function RichInputPreview({ config }) {
9200
9253
  const title = typeof config.title === "string" && config.title.trim() !== "" ? config.title : "Untitled step";
9201
9254
  config.document;
@@ -9761,6 +9814,20 @@ var subflowExecutor = async (ctx) => {
9761
9814
  };
9762
9815
 
9763
9816
  // src/registry/builtin.ts
9817
+ var HUMAN_FIELD_OUTPUT_TYPE = {
9818
+ text: "string",
9819
+ textarea: "string",
9820
+ select: "string",
9821
+ date: "string",
9822
+ datetime: "string",
9823
+ time: "string",
9824
+ email: "string",
9825
+ url: "string",
9826
+ tel: "string",
9827
+ password: "string",
9828
+ number: "number",
9829
+ switch: "boolean"
9830
+ };
9764
9831
  function casePorts(cases) {
9765
9832
  const byPort = /* @__PURE__ */ new Map();
9766
9833
  if (cases && typeof cases === "object" && !Array.isArray(cases)) {
@@ -9858,7 +9925,17 @@ var KINDS = [
9858
9925
  name: "@particle-academy/user_input",
9859
9926
  // The keys an author declared on THIS node — the case a static list cannot
9860
9927
  // express, and the one issue #5 named.
9861
- outputShape: (config) => (config.fields ?? []).filter((f) => typeof f.key === "string" && f.key !== "").map((f) => ({ path: f.key, type: "string", description: f.label })),
9928
+ //
9929
+ // The TYPE comes from the same normalizer the form renders with, so the
9930
+ // variable picker agrees with what the run actually resolves. It used to say
9931
+ // `string` for every field, which was wrong the moment a field was a number
9932
+ // or a switch — the picker told an author `{{ $json.age }}` was text while
9933
+ // the form handed the next node a number.
9934
+ outputShape: (config) => (config.fields ?? []).filter((f) => typeof f.key === "string" && f.key !== "").map((f) => ({
9935
+ path: f.key,
9936
+ type: HUMAN_FIELD_OUTPUT_TYPE[humanFieldType(f.type)],
9937
+ description: f.label
9938
+ })),
9862
9939
  aliases: ["user_input", "@fancy/user_input"],
9863
9940
  pausesForHuman: "input",
9864
9941
  category: "human",
@@ -9885,14 +9962,38 @@ var KINDS = [
9885
9962
  key: "type",
9886
9963
  label: "Type",
9887
9964
  default: "text",
9965
+ // Every control `HumanPrompt` can render. A type the form supports
9966
+ // but the panel cannot select is reachable only by hand-editing the
9967
+ // workflow JSON — which is the audience this panel exists for.
9888
9968
  options: [
9889
9969
  { value: "text", label: "Text" },
9890
9970
  { value: "textarea", label: "Long text" },
9891
9971
  { value: "number", label: "Number" },
9892
9972
  { value: "select", label: "Select" },
9893
- { value: "switch", label: "Switch" }
9973
+ { value: "switch", label: "Switch (yes / no)" },
9974
+ { value: "date", label: "Date" },
9975
+ { value: "datetime", label: "Date + time" },
9976
+ { value: "time", label: "Time" },
9977
+ { value: "email", label: "Email" },
9978
+ { value: "url", label: "URL" },
9979
+ { value: "tel", label: "Phone" },
9980
+ { value: "password", label: "Password" }
9894
9981
  ]
9895
9982
  },
9983
+ {
9984
+ // Without this a panel-authored select had nothing to choose from,
9985
+ // so it rendered an empty dropdown — the type was declarable and
9986
+ // unusable in the same breath.
9987
+ type: "keyvalue",
9988
+ key: "options",
9989
+ label: "Choices",
9990
+ description: "Select fields only. Left is the value the flow receives, right is what the person sees.",
9991
+ keyLabel: "Value",
9992
+ valueLabel: "Label",
9993
+ keyPlaceholder: "small",
9994
+ valuePlaceholder: "Small",
9995
+ addLabel: "Add choice"
9996
+ },
9896
9997
  { type: "switch", key: "required", label: "Required", default: false }
9897
9998
  ],
9898
9999
  default: [{ key: "answer", label: "Your answer", type: "textarea", required: true }]