@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.
@@ -1325,6 +1325,7 @@ const FORM_PRESETS = /* @__PURE__ */ Object.freeze([
1325
1325
  { label: 'Email', control: 'email', required: true },
1326
1326
  { label: 'Message', control: 'textarea', required: true, rows: 5 },
1327
1327
  ],
1328
+ actions: [{ type: 'email', config: { toOwner: true } }],
1328
1329
  submitLabel: 'Send message',
1329
1330
  successText: 'Thanks — we’ll be in touch shortly.',
1330
1331
  errorText: 'We couldn’t send your message. Please try again — your answers are still here.',
@@ -1371,6 +1372,7 @@ const FORM_PRESETS = /* @__PURE__ */ Object.freeze([
1371
1372
  { label: 'People', control: 'number', required: true },
1372
1373
  { label: 'Notes', control: 'textarea', rows: 3, help: 'Allergies, access needs, anything useful' },
1373
1374
  ],
1375
+ actions: [{ type: 'email', config: { toOwner: true } }],
1374
1376
  submitLabel: 'Request a booking',
1375
1377
  successText: 'Request received — we’ll confirm by email.',
1376
1378
  errorText: 'We couldn’t send your request. Please try again.',
@@ -1401,6 +1403,24 @@ const FORM_PRESETS = /* @__PURE__ */ Object.freeze([
1401
1403
  function formPresetById(id) {
1402
1404
  return FORM_PRESETS.find(p => p.id === id);
1403
1405
  }
1406
+ /** The config key of an email step that goes to the studio owner's account address (iox-cms#84). */
1407
+ const EMAIL_TO_OWNER = 'toOwner';
1408
+ /** True for an email step that goes to the studio owner — ONE reading for the server's delivery and the builder's panel. */
1409
+ function emailsOwner(action) {
1410
+ return action?.type === 'email' && action.config?.[EMAIL_TO_OWNER] === true;
1411
+ }
1412
+ /**
1413
+ * A preset's `actions` trait, as a Form stamped from it holds it: `store` first, then the preset's own steps — fresh
1414
+ * objects every call (a stamped node is edited in place). Null when the preset has no step of its own, so the Form keeps
1415
+ * its type's default (`[store]`). The builder's tray (`buildFormPreset`) and the composer (`stampPresetForm`) both
1416
+ * write this — ONE recipe (R-H9).
1417
+ */
1418
+ function presetFormActions(def) {
1419
+ if (!def?.actions?.length)
1420
+ return null;
1421
+ const copy = (a) => ({ ...a, ...(a.config ? { config: { ...a.config } } : {}) });
1422
+ return [{ ...STORE_ACTION }, ...def.actions.filter(a => a.type !== STORE_ACTION.type).map(copy)];
1423
+ }
1404
1424
 
1405
1425
  // Where form content may NOT render (Doron, 2026-10-20): inside a link or a button.
1406
1426
  //
@@ -1686,5 +1706,5 @@ function dateHtml(p, options, describedBy) {
1686
1706
  * Generated bundle index. Do not edit.
1687
1707
  */
1688
1708
 
1689
- export { CALENDAR_ROWS, CHANNEL_KINDS, CHOICE_MESSAGE_KEYS, CalendarKey, ChannelKind, ChoiceAppearance, ControlType, DATE_EMPTY_ATTRIBUTE, DATE_ICON_SVG, DATE_MAX_ATTRIBUTE, DATE_MESSAGE_KEYS, DATE_MIN_ATTRIBUTE, DATE_PICKER_WORDS, DEFAULT_EN_MESSAGES, FIELD_GROUP_NODE_TYPE, FIELD_NODE_TYPE, FORM_ACTIONS_ROLE, FORM_AFTER_SEND_ATTRIBUTE, FORM_AFTER_SEND_TRAIT, FORM_ANNOUNCER_ATTRIBUTE, FORM_CHANNEL_ROLE, FORM_CONTENT_TYPES, FORM_ERROR_KEYS, FORM_FIELDS_ATTRIBUTE, FORM_HONEYPOT_CLASS, FORM_NODE_TYPE, FORM_PRESETS, FORM_STATE_ATTRIBUTE, FeedbackTiming, FormAfterSend, FormPresetId, FormRenderState, HONEYPOT_FIELD, IMPLIED_PATTERN, INITIAL_FORM_STATE, INTERACTIVE_HOST_TAGS, InteractiveTag, MESSAGE_NAMESPACE, OPTION_CONTROLS, PATTERN_MESSAGE_KEYS, PATTERN_PRESETS, PATTERN_PRESET_OPTIONS, PatternPreset, RENDERED_AT_FIELD, RULE_DESCRIPTORS, RULE_MESSAGE_KEYS, RuleName, RuleParamKind, STORE_ACTION, SUBMIT_BUTTON_NODE_TYPE, SUBMIT_CHECK_SVG, SUBMIT_KEEP_ENABLED_ATTRIBUTE, SUBMIT_MESSAGE_KEYS, SubmitLabelClass, addDaysIso, addMonthsIso, addableRules, applyServerErrors, baseFieldName, calendarKeyTarget, calendarMonth, channelHref, channelOpensNewTab, choiceAppearanceOf, clampIso, clientFormSpec, collectFieldNodes, collectFormSpec, dateBoundRules, dateOfIso, datePickerWords, deriveFieldName, failureAnnouncement, fieldDateRange, fieldHtml, fieldOptionsOf, fieldSpecOf, findFormContentInHosts, firstInvalidField, formAfterSend, formChromeHtml, formContentInHost, formFieldNameMap, formFieldNames, formPresetById, formatDateInWords, inputTypeOf, interpretSubmitResponse, isChannelFilled, isDateBoundParams, isDateField, isFormContent, isInteractiveHost, isIsoDate, isMultiValueField, isoOfDate, normaliseAnswers, onFieldBlur, onFieldChange, onSubmitAttempt, parseChannelHref, parseClientFormSpec, parseDateBound, parseFieldOptions, planFormPresetIds, resetFormState, resolveDateBound, rulesFor, sentWord, shouldShowError, submitButtonLabelsHtml, submitButtonView, submitEndpointPath, submitOutcome, todayIso, uniqueFieldName, uniqueFieldNames, validateField, validateForm, weekStartFor, withAntiSpamFields };
1709
+ export { CALENDAR_ROWS, CHANNEL_KINDS, CHOICE_MESSAGE_KEYS, CalendarKey, ChannelKind, ChoiceAppearance, ControlType, DATE_EMPTY_ATTRIBUTE, DATE_ICON_SVG, DATE_MAX_ATTRIBUTE, DATE_MESSAGE_KEYS, DATE_MIN_ATTRIBUTE, DATE_PICKER_WORDS, DEFAULT_EN_MESSAGES, EMAIL_TO_OWNER, FIELD_GROUP_NODE_TYPE, FIELD_NODE_TYPE, FORM_ACTIONS_ROLE, FORM_AFTER_SEND_ATTRIBUTE, FORM_AFTER_SEND_TRAIT, FORM_ANNOUNCER_ATTRIBUTE, FORM_CHANNEL_ROLE, FORM_CONTENT_TYPES, FORM_ERROR_KEYS, FORM_FIELDS_ATTRIBUTE, FORM_HONEYPOT_CLASS, FORM_NODE_TYPE, FORM_PRESETS, FORM_STATE_ATTRIBUTE, FeedbackTiming, FormAfterSend, FormPresetId, FormRenderState, HONEYPOT_FIELD, IMPLIED_PATTERN, INITIAL_FORM_STATE, INTERACTIVE_HOST_TAGS, InteractiveTag, MESSAGE_NAMESPACE, OPTION_CONTROLS, PATTERN_MESSAGE_KEYS, PATTERN_PRESETS, PATTERN_PRESET_OPTIONS, PatternPreset, RENDERED_AT_FIELD, RULE_DESCRIPTORS, RULE_MESSAGE_KEYS, RuleName, RuleParamKind, STORE_ACTION, SUBMIT_BUTTON_NODE_TYPE, SUBMIT_CHECK_SVG, SUBMIT_KEEP_ENABLED_ATTRIBUTE, SUBMIT_MESSAGE_KEYS, SubmitLabelClass, addDaysIso, addMonthsIso, addableRules, applyServerErrors, baseFieldName, calendarKeyTarget, calendarMonth, channelHref, channelOpensNewTab, choiceAppearanceOf, clampIso, clientFormSpec, collectFieldNodes, collectFormSpec, dateBoundRules, dateOfIso, datePickerWords, deriveFieldName, emailsOwner, failureAnnouncement, fieldDateRange, fieldHtml, fieldOptionsOf, fieldSpecOf, findFormContentInHosts, firstInvalidField, formAfterSend, formChromeHtml, formContentInHost, formFieldNameMap, formFieldNames, formPresetById, formatDateInWords, inputTypeOf, interpretSubmitResponse, isChannelFilled, isDateBoundParams, isDateField, isFormContent, isInteractiveHost, isIsoDate, isMultiValueField, isoOfDate, normaliseAnswers, onFieldBlur, onFieldChange, onSubmitAttempt, parseChannelHref, parseClientFormSpec, parseDateBound, parseFieldOptions, planFormPresetIds, presetFormActions, resetFormState, resolveDateBound, rulesFor, sentWord, shouldShowError, submitButtonLabelsHtml, submitButtonView, submitEndpointPath, submitOutcome, todayIso, uniqueFieldName, uniqueFieldNames, validateField, validateForm, weekStartFor, withAntiSpamFields };
1690
1710
  //# sourceMappingURL=vectoriox-iox-ui-forms-core.mjs.map