@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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { truthy } from './chunk-BHM5HGXH.js';
2
2
  import { pauseForHuman, decodePause } from './chunk-UEOE6B52.js';
3
- import { getNodeKind, runFlow, resolveKindId, kindIds, RunIdentity } from './chunk-JOXMAWAI.js';
3
+ import { getNodeKind, runFlow, resolveKindId, kindIds, RunIdentity } from './chunk-CIBW5ATA.js';
4
4
  import './chunk-F5RPRB7A.js';
5
5
  import './chunk-USL4FMFU.js';
6
6
 
package/dist/engine.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;
@@ -9191,6 +9244,20 @@ var subflowExecutor = async (ctx) => {
9191
9244
  };
9192
9245
 
9193
9246
  // src/registry/builtin.ts
9247
+ var HUMAN_FIELD_OUTPUT_TYPE = {
9248
+ text: "string",
9249
+ textarea: "string",
9250
+ select: "string",
9251
+ date: "string",
9252
+ datetime: "string",
9253
+ time: "string",
9254
+ email: "string",
9255
+ url: "string",
9256
+ tel: "string",
9257
+ password: "string",
9258
+ number: "number",
9259
+ switch: "boolean"
9260
+ };
9194
9261
  function casePorts(cases) {
9195
9262
  const byPort = /* @__PURE__ */ new Map();
9196
9263
  if (cases && typeof cases === "object" && !Array.isArray(cases)) {
@@ -9288,7 +9355,17 @@ var KINDS = [
9288
9355
  name: "@particle-academy/user_input",
9289
9356
  // The keys an author declared on THIS node — the case a static list cannot
9290
9357
  // express, and the one issue #5 named.
9291
- outputShape: (config) => (config.fields ?? []).filter((f) => typeof f.key === "string" && f.key !== "").map((f) => ({ path: f.key, type: "string", description: f.label })),
9358
+ //
9359
+ // The TYPE comes from the same normalizer the form renders with, so the
9360
+ // variable picker agrees with what the run actually resolves. It used to say
9361
+ // `string` for every field, which was wrong the moment a field was a number
9362
+ // or a switch — the picker told an author `{{ $json.age }}` was text while
9363
+ // the form handed the next node a number.
9364
+ outputShape: (config) => (config.fields ?? []).filter((f) => typeof f.key === "string" && f.key !== "").map((f) => ({
9365
+ path: f.key,
9366
+ type: HUMAN_FIELD_OUTPUT_TYPE[humanFieldType(f.type)],
9367
+ description: f.label
9368
+ })),
9292
9369
  aliases: ["user_input", "@fancy/user_input"],
9293
9370
  pausesForHuman: "input",
9294
9371
  category: "human",
@@ -9315,14 +9392,38 @@ var KINDS = [
9315
9392
  key: "type",
9316
9393
  label: "Type",
9317
9394
  default: "text",
9395
+ // Every control `HumanPrompt` can render. A type the form supports
9396
+ // but the panel cannot select is reachable only by hand-editing the
9397
+ // workflow JSON — which is the audience this panel exists for.
9318
9398
  options: [
9319
9399
  { value: "text", label: "Text" },
9320
9400
  { value: "textarea", label: "Long text" },
9321
9401
  { value: "number", label: "Number" },
9322
9402
  { value: "select", label: "Select" },
9323
- { value: "switch", label: "Switch" }
9403
+ { value: "switch", label: "Switch (yes / no)" },
9404
+ { value: "date", label: "Date" },
9405
+ { value: "datetime", label: "Date + time" },
9406
+ { value: "time", label: "Time" },
9407
+ { value: "email", label: "Email" },
9408
+ { value: "url", label: "URL" },
9409
+ { value: "tel", label: "Phone" },
9410
+ { value: "password", label: "Password" }
9324
9411
  ]
9325
9412
  },
9413
+ {
9414
+ // Without this a panel-authored select had nothing to choose from,
9415
+ // so it rendered an empty dropdown — the type was declarable and
9416
+ // unusable in the same breath.
9417
+ type: "keyvalue",
9418
+ key: "options",
9419
+ label: "Choices",
9420
+ description: "Select fields only. Left is the value the flow receives, right is what the person sees.",
9421
+ keyLabel: "Value",
9422
+ valueLabel: "Label",
9423
+ keyPlaceholder: "small",
9424
+ valuePlaceholder: "Small",
9425
+ addLabel: "Add choice"
9426
+ },
9326
9427
  { type: "switch", key: "required", label: "Required", default: false }
9327
9428
  ],
9328
9429
  default: [{ key: "answer", label: "Your answer", type: "textarea", required: true }]