jsfe 1.39.1 → 1.40.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.
@@ -1 +1 @@
1
- {"version":3,"file":"form-client.d.ts","sourceRoot":"","sources":["../../src/forms/form-client.js"],"names":[],"mappings":"AA2BA,iGAAiG;AACjG;;;;;SAiEC;AAED,+GAA+G;AAC/G;;;;SAgCC;AAED;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BC;AA5JD,qCAAsC,eAAe,CAAC"}
1
+ {"version":3,"file":"form-client.d.ts","sourceRoot":"","sources":["../../src/forms/form-client.js"],"names":[],"mappings":"AA2BA,iGAAiG;AACjG;;;;;SAmEC;AAED,+GAA+G;AAC/G;;;;SAgCC;AAED;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BC;AA9JD,qCAAsC,eAAe,CAAC"}
@@ -58,7 +58,7 @@ export function projectForm(session, flows) {
58
58
  const members = fields(input.any_of, state, prefix, depth + 1).map(field => ({ ...field, required: false }));
59
59
  const groupLabel = language === 'es' ? input.label_es || input.label : input.label;
60
60
  if (members.length)
61
- out.push({ name: input.name, path, kind: 'alternatives', label: groupLabel || '', required, exclusive: input.exclusive === true, fields: members });
61
+ out.push({ name: input.name, path, kind: 'alternatives', label: groupLabel || '', required, exclusive: input.exclusive === true, ...(isCurrent ? { current: true } : {}), fields: members });
62
62
  }
63
63
  else if (input.form && input.schema) {
64
64
  if (input.prepare && !state.prepared?.[input.name])
@@ -68,7 +68,7 @@ export function projectForm(session, flows) {
68
68
  const virtual = child || { values: state.values?.[input.name] || {}, data: snapshot?.data || {}, prepared: snapshot?.prepared || {}, errors: {} };
69
69
  const nested = fields(child?.specs || input.schema.inputs, virtual, path + '.', depth + 1);
70
70
  if (nested.length)
71
- out.push({ name: input.name, path, kind: 'group', label: label(input, language), required, fields: nested });
71
+ out.push({ name: input.name, path, kind: 'group', label: label(input, language), required, ...(isCurrent ? { current: true } : {}), fields: nested });
72
72
  }
73
73
  else if (input.profile) {
74
74
  const profile = input.profile;
@@ -103,6 +103,9 @@ export function projectForm(session, flows) {
103
103
  field.value = state.values[input.name];
104
104
  if (state.errors?.[input.name])
105
105
  field.error = String(state.errors[input.name]);
106
+ // The field the conversation is asking for now, so a client can point at it on a redrawn form.
107
+ if (isCurrent)
108
+ field.current = true;
106
109
  out.push(field);
107
110
  }
108
111
  }
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:a953832e13337486b1aa6d9ea0eef7279c549109af33081d13f92e5265e48e20";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:66fc7813afb500bc0554e498473cb92a02100e37f3283ccfd6d84471fbd304ee";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.39.1",
3
+ "version": "1.40.0",
4
4
  "description": "TypeScript workflow engine for conversational/automation apps: multi-flow orchestration, interrupt/resume, stack-based control, robust errors, and flexible tool/REST integration.",
5
5
  "license": "MIT",
6
6
  "author": "Ron Pinkas",