@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.
- package/composite-core/index.d.ts +130 -2
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +328 -141
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs +21 -1
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +557 -59
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +20 -0
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/forms-core/index.d.ts +16 -1
- package/generation-core/index.d.ts +173 -13
- package/package.json +1 -1
- package/src/composite-core/consent.ts +235 -0
- package/src/composite-core/public-api.ts +1 -0
- package/src/forms-core/form-presets.ts +28 -0
- package/src/generation-core/audit-site.ts +167 -17
- package/src/generation-core/compose-site.ts +190 -8
- package/src/generation-core/legal.ts +213 -0
- package/src/generation-core/public-api.ts +1 -0
- package/src/generation-core/site-spec.generated.ts +41 -8
- package/src/generation-core/site-tree.ts +5 -1
- package/styles/iox-design.css +2 -0
|
@@ -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
|
//
|