@vectoriox/iox-ui 5.128.0 → 5.129.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.
@@ -5193,6 +5193,7 @@ const FORM_PRESETS = /* @__PURE__ */ Object.freeze([
5193
5193
  { label: 'Email', control: 'email', required: true },
5194
5194
  { label: 'Message', control: 'textarea', required: true, rows: 5 },
5195
5195
  ],
5196
+ actions: [{ type: 'email', config: { toOwner: true } }],
5196
5197
  submitLabel: 'Send message',
5197
5198
  successText: 'Thanks — we’ll be in touch shortly.',
5198
5199
  errorText: 'We couldn’t send your message. Please try again — your answers are still here.',
@@ -5239,6 +5240,7 @@ const FORM_PRESETS = /* @__PURE__ */ Object.freeze([
5239
5240
  { label: 'People', control: 'number', required: true },
5240
5241
  { label: 'Notes', control: 'textarea', rows: 3, help: 'Allergies, access needs, anything useful' },
5241
5242
  ],
5243
+ actions: [{ type: 'email', config: { toOwner: true } }],
5242
5244
  submitLabel: 'Request a booking',
5243
5245
  successText: 'Request received — we’ll confirm by email.',
5244
5246
  errorText: 'We couldn’t send your request. Please try again.',
@@ -5269,6 +5271,24 @@ const FORM_PRESETS = /* @__PURE__ */ Object.freeze([
5269
5271
  function formPresetById(id) {
5270
5272
  return FORM_PRESETS.find(p => p.id === id);
5271
5273
  }
5274
+ /** The config key of an email step that goes to the studio owner's account address (iox-cms#84). */
5275
+ const EMAIL_TO_OWNER = 'toOwner';
5276
+ /** True for an email step that goes to the studio owner — ONE reading for the server's delivery and the builder's panel. */
5277
+ function emailsOwner(action) {
5278
+ return action?.type === 'email' && action.config?.[EMAIL_TO_OWNER] === true;
5279
+ }
5280
+ /**
5281
+ * A preset's `actions` trait, as a Form stamped from it holds it: `store` first, then the preset's own steps — fresh
5282
+ * objects every call (a stamped node is edited in place). Null when the preset has no step of its own, so the Form keeps
5283
+ * its type's default (`[store]`). The builder's tray (`buildFormPreset`) and the composer (`stampPresetForm`) both
5284
+ * write this — ONE recipe (R-H9).
5285
+ */
5286
+ function presetFormActions(def) {
5287
+ if (!def?.actions?.length)
5288
+ return null;
5289
+ const copy = (a) => ({ ...a, ...(a.config ? { config: { ...a.config } } : {}) });
5290
+ return [{ ...STORE_ACTION }, ...def.actions.filter(a => a.type !== STORE_ACTION.type).map(copy)];
5291
+ }
5272
5292
 
5273
5293
  // Where form content may NOT render (Doron, 2026-10-20): inside a link or a button.
5274
5294
  //