@vectoriox/iox-builder 11.23.0 → 11.25.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.
|
@@ -19,8 +19,8 @@ import { DialogModule } from 'primeng/dialog';
|
|
|
19
19
|
import * as i2$1 from '@vectoriox/iox-ui';
|
|
20
20
|
import { nodeCssId, needsGroupName, resolveBoundValue, STRUCTURAL_STATES as STRUCTURAL_STATES$1, VALIDATION_STATES as VALIDATION_STATES$1, VALIDATION_STATE_CLASS as VALIDATION_STATE_CLASS$1, DEFAULT_WIDTH_BY_TYPE, TEXT_DIRECTION_KEY, TEXT_ALIGN_KEY, TextAlign, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, LinkType, MAX_LINES_KEY, A11yTrait, BREAKPOINTS, Breakpoint, withSchemeInk, stripSuppressedProps, DeclarationContext, planPartRule, gateHoverRule, planResponsiveRules, resolveStyleProps, planStateRule, splitOuterProps, OUTER_STYLE_PROPS, compileTokenCssBlocks, catalogFontId, fontsForTokens, GOOGLE_FONTS_FILE_ORIGIN, googleFontHref, compileDeclarations, isLastEmittedStateKey, wrapInBreakpointQuery, BreakpointQueryKind, NEW_NODE_STYLE_DEFAULTS, defaultElementStyleFor, applyElementStyle, planDataSource, dataSourcePlanToRequest, normalizeCollectionResult, resolveRepeaterItems, getByPath, computeRelative, PROGRESS_ATTRIBUTE, interactionMarkerAttributes, cascadeChain, attachScrollProgress, ContextStore, ENTRANCE_ACTION_TYPES, EXIT_ACTION_TYPES, ComponentInstanceRegistryService, syncInteractionMarkers, entranceStartsHidden, isActionEnabled, restoreCountUp, SCROLL_PROGRESS_TRIGGER, armInteractionCounts, splitPressFeedback, isHoverPointer, isContextAction, contextActionEffect, resolveContextValue, effectiveActionType, INTERACTION_HIDDEN_ATTRIBUTE, COUNT_UP_ACTION, motionAllowed, settleInteraction, settleModeFor, playInteraction, resolveInteractionEasing, entranceDelay, repeatedRowIndex, entrancePreStateStyle, buildInteractionKeyframes, showToast, declaredInputNames, emptyImagePlaceholder, syncNodeDesignClasses, nodeTraitValue, syncNodeA11yAttributes, nodeA11yAttributes, safeSetInput, colorSchemeOf, withStateTransitions, composeVirtualTraits, stateNamesIn, partClassName, switchElementStyle, releaseElementStyle, countOverrides, setOverride, breakpointDef, breakpointForWidth, FormRenderState, collectContextSlotKeys, withContextSlots, needsAccessibleName, resolveInputs, setInputOverride, barReserveClass, compilePageStyle, nodeUsesContext, attachTooltips, showToastDesign, TOOLTIP_ATTRIBUTE, hidingHeadersIn, HeaderRuntime, isScrolled, SCROLLED_ATTRIBUTE, syncSubmitButtons, IS_PREVIEW, buttonBlockHref, layerFrame, rectInLayer, placeFloating, FloatingAlign, popoverSide, bootSlider, IoxPageModule, PALETTE_PRESETS, elementStyleById, PART_CLASS_NAMES } from '@vectoriox/iox-ui';
|
|
21
21
|
export { ComponentInstanceRegistryService, VIRTUAL_TRAIT_KEYS, composeVirtualTraits } from '@vectoriox/iox-ui';
|
|
22
|
-
import { StructureEdit, isAccordionPart, isDisclosurePart, isSliderPart, isTabsPart, isSegmentedPart, structureRefusal, StructureRefusal, SegmentedRole, SEGMENTED_MAX_OPTIONS, AccordionRole, SEGMENTED_MIN_OPTIONS, isExclusiveItemPart, TabsRole, ITEM_OPEN_STATE, readStyle, isSegmentedRoot, segmentedDefaultOn, segmentedOptions, isTabsRoot, isTabsFromContent, tabsTriggers, isAccordionRoot, isAccordionFromContent, accordionItems, initialAccordionOpen, accordionBehaviour, exclusiveItemLabel, exclusiveRootOf, tabTriggerOf, tabLabel, removeTabPair, tabPanelOf, tabsListOf, tabsPanelsOf, nextTabKey, CompositeBehaviourTrait, ACCORDION_DEFAULT_ONS, TabsBehaviourTrait, TABS_ACTIVATE_ONS, TABS_ORIENTATIONS, MarqueeTrait, MarqueeSpeed, MarqueeDirection, DisclosureRole, isExclusiveTrigger, onCompositeItemState, isCompositeItemOn, runAccountAction, ShopActionType, runShopAction, runCompositeItemAction, shouldScrollToItem, rowIndexOf as rowIndexOf$1, slideIndexForRow, isMarqueeRoot, compositeScopeId, compositeRowKeys, isExclusiveRoot, ExclusiveRuntime, exclusiveDefaultOf, exclusiveLabelOf, exclusiveBehaviourOf, exclusiveKindOf, compositeKindOfRole, AccordionRuntime, isToggleKind, MarqueeRuntime, closestAccordionItem, isAnyCompositeRoot, SceneRole, isExclusiveList, buildCardRecipe, buildBadge, buildChip, buildAccordionRecipe, buildDisclosureRecipe, buildTabsRecipe, buildSegmentedRecipe, buildLightboxRecipe, buildMarqueeRecipe, buildCounterRecipe, buildReadingBarRecipe, SHOP_RECIPES, ShopRecipe, ACCOUNT_RECIPES, AccountRecipe, NO_ELEMENT_STYLE, CompositeKind, SliderRole, accordionItemLabel, segmentedOptionLabel, isExclusivePanels, isLockedPart, attachShop, ShopRole, attachAccount, AccountRole, accordionRootOf, accordionItemOf, addAccordionItem, addTabPair, segmentedAddRefusal, addSegmentedOption, isCompositeItem, accordionHeadingLevel, isCompositePanel, isCompositeTrigger, splitSliderChildren, hasSliderParts, SLIDE_CAPTION_TRAIT, SLIDER_SCROLL_PLAYS_TRAIT, SLIDER_PLACEMENT_TRAIT, SliderPlacement, SliderFlag } from '@vectoriox/iox-ui/composite-core';
|
|
23
|
-
import { formContentInHost, isInteractiveHost, findFormContentInHosts, FORM_CHANNEL_ROLE, channelHref, channelOpensNewTab, FORM_ACTIONS_ROLE, SUBMIT_BUTTON_NODE_TYPE, FORM_AFTER_SEND_TRAIT, FormAfterSend } from '@vectoriox/iox-ui/forms-core';
|
|
22
|
+
import { StructureEdit, isAccordionPart, isDisclosurePart, isSliderPart, isTabsPart, isSegmentedPart, structureRefusal, StructureRefusal, SegmentedRole, SEGMENTED_MAX_OPTIONS, AccordionRole, SEGMENTED_MIN_OPTIONS, isExclusiveItemPart, TabsRole, ITEM_OPEN_STATE, readStyle, isSegmentedRoot, segmentedDefaultOn, segmentedOptions, isTabsRoot, isTabsFromContent, tabsTriggers, isAccordionRoot, isAccordionFromContent, accordionItems, initialAccordionOpen, accordionBehaviour, exclusiveItemLabel, exclusiveRootOf, tabTriggerOf, tabLabel, removeTabPair, tabPanelOf, tabsListOf, tabsPanelsOf, nextTabKey, CompositeBehaviourTrait, ACCORDION_DEFAULT_ONS, TabsBehaviourTrait, TABS_ACTIVATE_ONS, TABS_ORIENTATIONS, MarqueeTrait, MarqueeSpeed, MarqueeDirection, DisclosureRole, isExclusiveTrigger, onCompositeItemState, isCompositeItemOn, runAccountAction, ShopActionType, runShopAction, runCompositeItemAction, shouldScrollToItem, rowIndexOf as rowIndexOf$1, slideIndexForRow, isMarqueeRoot, compositeScopeId, compositeRowKeys, isExclusiveRoot, ExclusiveRuntime, exclusiveDefaultOf, exclusiveLabelOf, exclusiveBehaviourOf, exclusiveKindOf, compositeKindOfRole, AccordionRuntime, isToggleKind, MarqueeRuntime, closestAccordionItem, isAnyCompositeRoot, SceneRole, isExclusiveList, buildCardRecipe, buildBadge, buildChip, buildAccordionRecipe, buildDisclosureRecipe, buildTabsRecipe, buildSegmentedRecipe, buildLightboxRecipe, buildMarqueeRecipe, buildCounterRecipe, buildReadingBarRecipe, SHOP_RECIPES, ShopRecipe, ACCOUNT_RECIPES, AccountRecipe, NO_ELEMENT_STYLE, CompositeKind, SliderRole, accordionItemLabel, segmentedOptionLabel, isExclusivePanels, isLockedPart, attachShop, ShopRole, attachAccount, AccountRole, accordionRootOf, accordionItemOf, addAccordionItem, addTabPair, segmentedAddRefusal, addSegmentedOption, isCompositeItem, accordionHeadingLevel, isCompositePanel, isCompositeTrigger, splitSliderChildren, hasSliderParts, buildConsentRecipe, SLIDE_CAPTION_TRAIT, SLIDER_SCROLL_PLAYS_TRAIT, SLIDER_PLACEMENT_TRAIT, SliderPlacement, SliderFlag } from '@vectoriox/iox-ui/composite-core';
|
|
23
|
+
import { formContentInHost, isInteractiveHost, findFormContentInHosts, presetFormActions, FORM_CHANNEL_ROLE, channelHref, channelOpensNewTab, FORM_ACTIONS_ROLE, SUBMIT_BUTTON_NODE_TYPE, FORM_AFTER_SEND_TRAIT, FormAfterSend } from '@vectoriox/iox-ui/forms-core';
|
|
24
24
|
import { Subject, BehaviorSubject, of, forkJoin } from 'rxjs';
|
|
25
25
|
import interact from 'interactjs';
|
|
26
26
|
import { HeaderTrait, HeaderBehaviour, HeaderEdge, MenuTrait, MenuForm, MenuReveal, MenuHover, MenuPhoneForm, MenuButtonKind, pageOpeningScheme, menuDialogAttributes, MenuAttribute } from '@vectoriox/iox-ui/design-core';
|
|
@@ -1111,6 +1111,8 @@ function regenerateNodeIds(root, opts = {}) {
|
|
|
1111
1111
|
const assign = (node) => {
|
|
1112
1112
|
const oldId = node.id;
|
|
1113
1113
|
node.id = freshId();
|
|
1114
|
+
// A copy is the owner's: the build's section stamp stays with the original (RD-D17).
|
|
1115
|
+
delete node.composed;
|
|
1114
1116
|
reissueIdentityTraits(node);
|
|
1115
1117
|
if (node.itemKey) {
|
|
1116
1118
|
if (!keyMap.has(node.itemKey))
|
|
@@ -1169,6 +1171,11 @@ function remapNodeReferences(node, idMap) {
|
|
|
1169
1171
|
}
|
|
1170
1172
|
(node.children || []).forEach(child => remapNodeReferences(child, idMap));
|
|
1171
1173
|
}
|
|
1174
|
+
/** A saved block or symbol is the owner's: drop every section stamp in the subtree (site-redesign RD-D17). */
|
|
1175
|
+
function dropSectionStamps(node) {
|
|
1176
|
+
delete node.composed;
|
|
1177
|
+
(node.children || []).forEach(dropSectionStamps);
|
|
1178
|
+
}
|
|
1172
1179
|
|
|
1173
1180
|
/**
|
|
1174
1181
|
* The text on the drop indicator's chip — "into Card grid · position 2 of 3" (B2).
|
|
@@ -11248,6 +11255,7 @@ class BuilderComponent {
|
|
|
11248
11255
|
case ToolbarAction.SaveAsBlock: {
|
|
11249
11256
|
const blockClone = JSON.parse(JSON.stringify(node));
|
|
11250
11257
|
this._stripGlobalFlags(blockClone);
|
|
11258
|
+
dropSectionStamps(blockClone);
|
|
11251
11259
|
this.pendingBlockNode = blockClone;
|
|
11252
11260
|
this.saveBlockName = '';
|
|
11253
11261
|
this.showSaveBlockDialog = true;
|
|
@@ -14368,6 +14376,11 @@ function buildFormPreset(def, createConfig) {
|
|
|
14368
14376
|
setTrait(form, 'name', def.formName);
|
|
14369
14377
|
// A fresh id per insert: two forms on one page must never share a submissions stream.
|
|
14370
14378
|
setTrait(form, 'formId', `${def.id}-${Math.random().toString(36).slice(2, 8)}`);
|
|
14379
|
+
// What happens after a send: the preset's own steps after storing (a contact or booking form emails the studio owner —
|
|
14380
|
+
// iox-cms#84). forms-core decides, the composer stamps the SAME list; a preset with none keeps the Form's default.
|
|
14381
|
+
const actions = presetFormActions(def);
|
|
14382
|
+
if (actions)
|
|
14383
|
+
setTrait(form, 'actions', actions);
|
|
14371
14384
|
const children = [];
|
|
14372
14385
|
for (const spec of def.fields) {
|
|
14373
14386
|
const field = createConfig('Field');
|
|
@@ -14638,207 +14651,25 @@ function buildPalettePreset(def, createConfig) {
|
|
|
14638
14651
|
return node;
|
|
14639
14652
|
}
|
|
14640
14653
|
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
for (const [prop, value] of Object.entries(styles))
|
|
14645
|
-
setStyleTrait(node, prop, value);
|
|
14646
|
-
return node;
|
|
14647
|
-
}
|
|
14648
|
-
/**
|
|
14649
|
-
* THE CONSENT PRESET (consent plan C3) — the banner as builder elements, which is the whole bet:
|
|
14650
|
-
* Wix ships a banner you cannot design, Webflow ships a design system and no banner; ours is a
|
|
14651
|
-
* Dialog made of ordinary nodes, so it arrives flavored, stylable, translatable and RTL-correct
|
|
14652
|
-
* like everything else on the canvas.
|
|
14653
|
-
*
|
|
14654
|
-
* Three roots, inserted as GLOBAL elements (D-C5 — site-wide by construction):
|
|
14655
|
-
* 1. the banner Dialog (`consentRole` — the live runtime opens it when `needsPrompt` says so),
|
|
14656
|
-
* 2. the preferences Dialog (per-category Allow/Refuse, recorded immediately — state-free),
|
|
14657
|
-
* 3. a small "Cookie settings" element — the withdrawal path (§7.3), free once actions exist.
|
|
14658
|
-
*
|
|
14659
|
-
* Design rules carried in the tree (§7): Accept and Reject are the SAME component with the same
|
|
14660
|
-
* defaults on the same row — reject is as easy as accept; the three categories are named on the
|
|
14661
|
-
* first layer; `closeOnBackdrop` is OFF — clicking away is not consent; the X stays, because the
|
|
14662
|
-
* live runtime records a close-without-decision as a "no".
|
|
14663
|
-
*
|
|
14664
|
-
* The TEXTS are the customer's (D-C7). These strings are neutral mechanism-microcopy seeded for
|
|
14665
|
-
* editing — never policy language, which we do not write (§8).
|
|
14666
|
-
*/
|
|
14667
|
-
const click = (actions) => ({
|
|
14668
|
-
id: generateNodeId(),
|
|
14669
|
-
trigger: 'click',
|
|
14670
|
-
actions: actions.map(a => ({
|
|
14671
|
-
target: 'self', duration: 0, delay: 0, easing: 'ease', ...a,
|
|
14672
|
-
})),
|
|
14673
|
-
});
|
|
14674
|
-
const TOKEN = (name, fallback) => `var(--iox-${name}, ${fallback})`;
|
|
14675
|
-
function button$1(label, createConfig, interaction, styles = {}) {
|
|
14676
|
-
const btn = createConfig('ButtonBlock');
|
|
14677
|
-
const text = textNode(label, createConfig);
|
|
14678
|
-
if (!btn || !text)
|
|
14679
|
-
return null;
|
|
14680
|
-
setTrait(btn, 'tag', 'button');
|
|
14681
|
-
setStyleTrait(text, 'fontSize', 'inherit');
|
|
14682
|
-
setStyleTrait(text, 'fontWeight', 'inherit');
|
|
14683
|
-
setStyleTrait(text, 'color', 'inherit');
|
|
14684
|
-
for (const [prop, value] of Object.entries(styles))
|
|
14685
|
-
setStyleTrait(btn, prop, value);
|
|
14686
|
-
btn.children = [text];
|
|
14687
|
-
btn.interactions = [interaction];
|
|
14688
|
-
return btn;
|
|
14689
|
-
}
|
|
14690
|
-
/** The C1/C2 board button voices — Swiss by fallback, the brand's the moment tokens seed. */
|
|
14691
|
-
// width:'auto' + flexShrink:'0' on every voice: a consent button never stretches to its row's
|
|
14692
|
-
// height nor shrinks until its label wraps — both happened on the canvas (Rule 0, 2026-10-10).
|
|
14693
|
-
const SOLID = {
|
|
14694
|
-
backgroundColor: TOKEN('brand-500', '#1f1d1b'), color: TOKEN('brandInk', '#ffffff'),
|
|
14695
|
-
fontSize: '12px', fontWeight: '600', padding: '9px 16px',
|
|
14696
|
-
borderRadius: TOKEN('radius-control', '4px'),
|
|
14697
|
-
width: 'auto', flexShrink: '0',
|
|
14698
|
-
};
|
|
14699
|
-
const OUTLINED = {
|
|
14700
|
-
backgroundColor: 'transparent', color: TOKEN('ink', '#1f1d1b'),
|
|
14701
|
-
borderWidth: '1px', borderStyle: 'solid', borderColor: TOKEN('ink', '#1f1d1b'),
|
|
14702
|
-
fontSize: '12px', fontWeight: '600', padding: '8px 16px',
|
|
14703
|
-
borderRadius: TOKEN('radius-control', '4px'),
|
|
14704
|
-
width: 'auto', flexShrink: '0',
|
|
14705
|
-
};
|
|
14706
|
-
const QUIET = {
|
|
14707
|
-
backgroundColor: 'transparent', color: TOKEN('inkMuted', '#4a453f'),
|
|
14708
|
-
fontSize: '11px', fontWeight: '400', padding: '2px 4px', textDecoration: 'underline',
|
|
14709
|
-
width: 'auto', flexShrink: '0',
|
|
14710
|
-
};
|
|
14711
|
-
function row(createConfig, styles, children) {
|
|
14712
|
-
const container = createConfig('Container');
|
|
14713
|
-
if (!container || children.some(c => !c))
|
|
14714
|
-
return null;
|
|
14715
|
-
// The Container config defaults (minHeight 200px — the canvas droppability affordance) are
|
|
14716
|
-
// serialized with the node, so a preset box must OWN its height or every card ships 200px
|
|
14717
|
-
// tall with dead space (Rule 0 catch, 2026-10-10). Callers may still override.
|
|
14718
|
-
setStyleTrait(container, 'minHeight', 'auto');
|
|
14719
|
-
for (const [prop, value] of Object.entries(styles))
|
|
14720
|
-
setStyleTrait(container, prop, value);
|
|
14721
|
-
container.children = children;
|
|
14722
|
-
return container;
|
|
14723
|
-
}
|
|
14654
|
+
const NO_BASELINE = () => ({});
|
|
14655
|
+
/** The tail of `builderCompositeFactory`'s error for a type the registry does not have. */
|
|
14656
|
+
const UNREGISTERED = 'is not a registered component type';
|
|
14724
14657
|
/** Build the three roots. Null when any type is missing — a half-built banner never ships. */
|
|
14725
|
-
function buildConsentPreset(createConfig) {
|
|
14726
|
-
const
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
return
|
|
14730
|
-
|
|
14731
|
-
|
|
14732
|
-
|
|
14733
|
-
|
|
14734
|
-
|
|
14735
|
-
|
|
14736
|
-
|
|
14737
|
-
|
|
14738
|
-
|
|
14739
|
-
|
|
14740
|
-
setStyleTrait(banner, 'backgroundColor', TOKEN('surface', '#ffffff'));
|
|
14741
|
-
setStyleTrait(banner, 'borderWidth', '1px');
|
|
14742
|
-
setStyleTrait(banner, 'borderStyle', 'solid');
|
|
14743
|
-
setStyleTrait(banner, 'borderColor', TOKEN('ink', '#1f1d1b'));
|
|
14744
|
-
setStyleTrait(banner, 'boxShadow', 'none');
|
|
14745
|
-
const heading = text$1('Cookies on this site', { fontSize: '13px', fontWeight: '600', color: TOKEN('ink', '#1f1d1b') }, createConfig);
|
|
14746
|
-
// The first layer NAMES the three categories (plan §7) — the board does it in the copy.
|
|
14747
|
-
const body = text$1('We use analytics and marketing cookies only if you allow them. Necessary ones always run.', { fontSize: '11px', color: TOKEN('inkMuted', '#4a453f'), lineHeight: '1.5', maxWidth: '330px' }, createConfig);
|
|
14748
|
-
// width:'auto' throughout — the Container default is 100%, and two 100%-wide columns
|
|
14749
|
-
// cannot share the bar's row (they wrap into a stack; Rule 0 catch, 2026-10-10).
|
|
14750
|
-
const textCol = row(createConfig, { display: 'flex', flexDirection: 'column', gap: '4px', flexGrow: '1', width: 'auto' }, [heading, body]);
|
|
14751
|
-
const accept = button$1('Accept all', createConfig, click([
|
|
14752
|
-
{ type: 'grantConsent' },
|
|
14753
|
-
{ type: 'closeDialog', target: banner.id },
|
|
14754
|
-
]), SOLID);
|
|
14755
|
-
const reject = button$1('Reject all', createConfig, click([
|
|
14756
|
-
{ type: 'denyConsent' },
|
|
14757
|
-
{ type: 'closeDialog', target: banner.id },
|
|
14758
|
-
]), OUTLINED);
|
|
14759
|
-
const prefs = button$1('Preferences', createConfig, click([
|
|
14760
|
-
{ type: 'openConsentPreferences', target: preferences.id },
|
|
14761
|
-
]), QUIET);
|
|
14762
|
-
const acceptRejectRow = row(createConfig, { display: 'flex', gap: '7px', alignItems: 'center', width: 'auto' }, [accept, reject]);
|
|
14763
|
-
const buttonsCol = row(createConfig, { display: 'flex', flexDirection: 'column', gap: '7px', alignItems: 'center', width: 'auto', flexShrink: '0' }, [acceptRejectRow, prefs]);
|
|
14764
|
-
const bannerRow = row(createConfig, { display: 'flex', gap: '18px', alignItems: 'center', flexWrap: 'wrap' }, [textCol, buttonsCol]);
|
|
14765
|
-
if (!bannerRow)
|
|
14766
|
-
return null;
|
|
14767
|
-
banner.children = [bannerRow];
|
|
14768
|
-
// ── the preferences modal ────────────────────────────────────────────────
|
|
14769
|
-
preferences.label = 'Consent preferences';
|
|
14770
|
-
setTrait(preferences, 'closeOnBackdrop', true);
|
|
14771
|
-
setTrait(preferences, 'showCloseButton', true);
|
|
14772
|
-
setStyleTrait(preferences, 'width', 'min(480px, calc(100vw - 48px))');
|
|
14773
|
-
setStyleTrait(preferences, 'padding', '18px 20px');
|
|
14774
|
-
setStyleTrait(preferences, 'display', 'flex');
|
|
14775
|
-
setStyleTrait(preferences, 'flexDirection', 'column');
|
|
14776
|
-
setStyleTrait(preferences, 'gap', '12px');
|
|
14777
|
-
const prefsHeading = text$1('Your privacy choices', { fontSize: '16px', fontWeight: '600', color: TOKEN('ink', '#1f1d1b') }, createConfig);
|
|
14778
|
-
const prefsSub = text$1('Change these any time from “Cookie settings” in the footer.', { fontSize: '12px', color: TOKEN('inkMuted', '#6b6560') }, createConfig);
|
|
14779
|
-
const CARD = {
|
|
14780
|
-
display: 'flex', gap: '12px', alignItems: 'flex-start',
|
|
14781
|
-
borderWidth: '1px', borderStyle: 'solid', borderColor: TOKEN('line', '#e6e3e1'),
|
|
14782
|
-
borderRadius: TOKEN('radius-surface', '8px'), padding: '12px 14px',
|
|
14783
|
-
};
|
|
14784
|
-
const nameText = (s) => text$1(s, { fontSize: '13px', fontWeight: '600', color: TOKEN('ink', '#1f1d1b') }, createConfig);
|
|
14785
|
-
const descText = (s) => text$1(s, { fontSize: '11px', color: TOKEN('inkMuted', '#6b6560'), lineHeight: '1.5' }, createConfig);
|
|
14786
|
-
const textColOf = (name, desc) => row(createConfig, { display: 'flex', flexDirection: 'column', gap: '2px', flexGrow: '1', width: 'auto' }, [nameText(name), descText(desc)]);
|
|
14787
|
-
const alwaysOn = text$1('ALWAYS ON', {
|
|
14788
|
-
fontSize: '10px', fontWeight: '600', color: TOKEN('inkMuted', '#6b6560'),
|
|
14789
|
-
borderWidth: '1px', borderStyle: 'solid', borderColor: TOKEN('line', '#e6e3e1'),
|
|
14790
|
-
borderRadius: '999px', padding: '3px 8px',
|
|
14791
|
-
width: 'auto', flexShrink: '0', // a chip hugs its word (Text defaults to 100%)
|
|
14792
|
-
}, createConfig);
|
|
14793
|
-
const necessaryCard = row(createConfig, CARD, [
|
|
14794
|
-
textColOf('Necessary', 'Keeps the site working: your session, your language, this very choice. Always on.'),
|
|
14795
|
-
alwaysOn,
|
|
14796
|
-
]);
|
|
14797
|
-
// Board C2's switches, for real: a Field in switch clothing whose NAME carries the
|
|
14798
|
-
// category ('consent-<category>') — the engine's consent runtime binds checked-state to
|
|
14799
|
-
// the decision and records on change. State lives in the cookie, never in the tree.
|
|
14800
|
-
const categoryCard = (category, name, desc) => {
|
|
14801
|
-
const sw = createConfig('Field');
|
|
14802
|
-
if (!sw)
|
|
14803
|
-
return null;
|
|
14804
|
-
setTrait(sw, 'label', name);
|
|
14805
|
-
setTrait(sw, 'labelHidden', true); // the card's own texts carry the words
|
|
14806
|
-
setTrait(sw, 'control', 'switch');
|
|
14807
|
-
setTrait(sw, 'name', `consent-${category}`);
|
|
14808
|
-
setStyleTrait(sw, 'width', 'auto');
|
|
14809
|
-
setStyleTrait(sw, 'flexShrink', '0');
|
|
14810
|
-
return row(createConfig, CARD, [textColOf(name, desc), sw]);
|
|
14811
|
-
};
|
|
14812
|
-
const analyticsCard = categoryCard('analytics', 'Analytics', 'Anonymous counts of visits and pages. Off means the analytics script never loads.');
|
|
14813
|
-
const marketingCard = categoryCard('marketing', 'Marketing', 'Ads measurement and remarketing. Off means no ad cookies and no data shared.');
|
|
14814
|
-
// Board C2's footer: bulk exits live here too — Reject | (grow) | Done | Accept.
|
|
14815
|
-
const prefsReject = button$1('Reject all', createConfig, click([
|
|
14816
|
-
{ type: 'denyConsent' },
|
|
14817
|
-
{ type: 'closeDialog', target: preferences.id },
|
|
14818
|
-
]), OUTLINED);
|
|
14819
|
-
const prefsDone = button$1('Done', createConfig, click([
|
|
14820
|
-
{ type: 'closeDialog', target: preferences.id },
|
|
14821
|
-
]), { ...OUTLINED, color: TOKEN('inkMuted', '#3d3833'), borderColor: TOKEN('line', '#d8d4d1') });
|
|
14822
|
-
const prefsAccept = button$1('Accept all', createConfig, click([
|
|
14823
|
-
{ type: 'grantConsent' },
|
|
14824
|
-
{ type: 'closeDialog', target: preferences.id },
|
|
14825
|
-
]), SOLID);
|
|
14826
|
-
// No spacer Container — an EMPTY container paints the canvas "click to select" placeholder
|
|
14827
|
-
// and squeezes the buttons until their labels wrap (Rule 0 catch). space-between + an end
|
|
14828
|
-
// group is the same board layout with no empty node.
|
|
14829
|
-
const footerEnd = row(createConfig, { display: 'flex', gap: '8px', alignItems: 'center', width: 'auto', flexShrink: '0' }, [prefsDone, prefsAccept]);
|
|
14830
|
-
const footer = row(createConfig, { display: 'flex', gap: '8px', alignItems: 'center', justifyContent: 'space-between' }, [prefsReject, footerEnd]);
|
|
14831
|
-
if (!prefsHeading || !prefsSub || !necessaryCard || !analyticsCard || !marketingCard || !footer)
|
|
14832
|
-
return null;
|
|
14833
|
-
preferences.children = [prefsHeading, prefsSub, necessaryCard, analyticsCard, marketingCard, footer];
|
|
14834
|
-
// ── the withdrawal path (§7.3) ───────────────────────────────────────────
|
|
14835
|
-
const withdrawal = button$1('Cookie settings', createConfig, click([
|
|
14836
|
-
{ type: 'openConsentPreferences', target: preferences.id },
|
|
14837
|
-
]), QUIET);
|
|
14838
|
-
if (!withdrawal)
|
|
14839
|
-
return null;
|
|
14840
|
-
withdrawal.label = 'Cookie settings';
|
|
14841
|
-
return { banner, preferences, withdrawal };
|
|
14658
|
+
function buildConsentPreset(createConfig, options = {}) {
|
|
14659
|
+
const { baselineStyles = NO_BASELINE, ...recipe } = options;
|
|
14660
|
+
try {
|
|
14661
|
+
const { banner, preferences, settings } = buildConsentRecipe(builderCompositeFactory(createConfig, baselineStyles), recipe);
|
|
14662
|
+
return {
|
|
14663
|
+
banner: banner,
|
|
14664
|
+
preferences: preferences,
|
|
14665
|
+
withdrawal: settings,
|
|
14666
|
+
};
|
|
14667
|
+
}
|
|
14668
|
+
catch (error) {
|
|
14669
|
+
if (error instanceof Error && error.message.endsWith(UNREGISTERED))
|
|
14670
|
+
return null; // a type the registry lacks
|
|
14671
|
+
throw error;
|
|
14672
|
+
}
|
|
14842
14673
|
}
|
|
14843
14674
|
|
|
14844
14675
|
/**
|
|
@@ -16199,5 +16030,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
|
|
|
16199
16030
|
* Generated bundle index. Do not edit.
|
|
16200
16031
|
*/
|
|
16201
16032
|
|
|
16202
|
-
export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BOUND_ICON, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BUILDER_FONT_LINK_ATTR, BUILDER_TOKEN_SCOPE_CLASS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderPopoverComponent, BuilderRepeaterComponent, BuilderSpacerComponentConfig, BusinessSpecimenView, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CANVAS_ROOT_RESET_CSS, CANVAS_TOKEN_SCOPE, COMPOSITE_PRESETS, CanvasDesignStateService, CanvasShowState, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, CompositeCanvasService, CompositePaletteGroup, CompositePresetId, DEFAULT_ESSENTIAL_TRAITS, DESCRIPTOR_MAX_LENGTH, DRAG_HANDLE_ATTR, DROP_REFUSED_CLASS, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FORM_STATE_BLOCK_TYPES, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FieldTrait, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GLOBALS_AFTER_CLASS, GalleryConfig, GlobalCanvasLayer, GroupStyleConfig, HIDDEN_AT_REST_LABEL_KEY, HIDDEN_AT_REST_ROLES, HIDDEN_AT_REST_TYPES, INSERT_REFUSAL_LABEL_KEYS, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_CONTENT_TYPE_LABELS, IOX_DATA_SOURCE_ENDPOINTS, InsertRefusal, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PAGE_TRANSITION_EASING_OPTIONS, PALETTE_PRESET_DEFS, POPOVER_PLACEMENT_OPTIONS, POPOVER_SHEET_MAX_WIDTH, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PhoneMenuOpenerAction, PopoverComponentConfig, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, REPEATER_SOURCE_PROP, REPEATER_TYPE, REVEALED_WHILE_SELECTED_ROLES, ROOT_ESCAPE_PX, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, RootZone, SCREEN_WIDTH_OPTIONS, SENT_LABEL_TRAIT, SILENT_REFUSALS, STRUCTURAL_STATES, SUPPORTED_STATES, SceneCanvasService, SectionComponent, SectionComponentConfig, SelectionReveal, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StructureFix, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TOGGLE_PART_ROLES, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, VideoConfig, ViewportService, ZOOM_OPTIONS, addFormChannel, arrayItemSchemaFields, arraySchemaFields, auditNodes, bindingLabel, bindingLabels, buildBusinessSpecimen, buildCompositePreset, buildConsentPreset, buildElementStyleSpecimen, buildFieldKindPreset, buildFlavorSpecimen, buildFormActionsRow, buildFormChannel, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, builderCompositeFactory, canFluidise, canvasEmptyImageLabel, canvasFloatingContainer, canvasHostDisplay, collapseColumnsProps, columnCountOf, compositeStructureFindings, defaultBuilderLabels, defaultPageSettings, deleteTabPair, displayTriggerOf, dropChildren, dropTargetLabel, duplicateTabPair, escapesRoot, essentialTraitsFor, findNodeByIdInEither, findNodeLocation, findParentOf, flattenLayerTree, flattenSchemaFields, fluidiseProps, formChannelOf, generateNodeId, globalCanvasLayer, hiddenAtBase, hiddenUntilItemOn, inPhoneMenuContext, insertRefusal, insertRefusalLabel, interactionTargets, isHiddenAt, isHiddenAtRest, isPhoneMenuOpener, isPinnedGlobal, isReadingBar, isSpecimen, itemsOnAtRest, markSpecimen, matchesControlSearch, nearestFormNode, neverShown, nodeAncestorPath, nodeAncestorPathInEither, nodeDescriptor, nodeStyleMap, overlayGlobals, pathToNode, phoneMenuOf, phoneMenuShowsAt, refreshSubtree, regenerateNodeIds, removalRefusal, reorderProps, repeaterSourceAlias, repeaterSubLabel, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, retypeNode, rootEscapeBand, rootZone, selectionRevealOf, setChannelAddress, setOverlayPreview, setStyleTrait, setTrait, shortDescriptor, showCanvasToast, shownBeforeControl, sourceContentType, sourceTypeLabel, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, syncNodeInputs, tabPairLabel, tabsRootForPart, textNode, upsertNodeStyles, visibilityProps, walkNodes, wrapNode };
|
|
16033
|
+
export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BOUND_ICON, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BUILDER_FONT_LINK_ATTR, BUILDER_TOKEN_SCOPE_CLASS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderPopoverComponent, BuilderRepeaterComponent, BuilderSpacerComponentConfig, BusinessSpecimenView, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CANVAS_ROOT_RESET_CSS, CANVAS_TOKEN_SCOPE, COMPOSITE_PRESETS, CanvasDesignStateService, CanvasShowState, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, CompositeCanvasService, CompositePaletteGroup, CompositePresetId, DEFAULT_ESSENTIAL_TRAITS, DESCRIPTOR_MAX_LENGTH, DRAG_HANDLE_ATTR, DROP_REFUSED_CLASS, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FORM_STATE_BLOCK_TYPES, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FieldTrait, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GLOBALS_AFTER_CLASS, GalleryConfig, GlobalCanvasLayer, GroupStyleConfig, HIDDEN_AT_REST_LABEL_KEY, HIDDEN_AT_REST_ROLES, HIDDEN_AT_REST_TYPES, INSERT_REFUSAL_LABEL_KEYS, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_CONTENT_TYPE_LABELS, IOX_DATA_SOURCE_ENDPOINTS, InsertRefusal, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PAGE_TRANSITION_EASING_OPTIONS, PALETTE_PRESET_DEFS, POPOVER_PLACEMENT_OPTIONS, POPOVER_SHEET_MAX_WIDTH, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PhoneMenuOpenerAction, PopoverComponentConfig, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, REPEATER_SOURCE_PROP, REPEATER_TYPE, REVEALED_WHILE_SELECTED_ROLES, ROOT_ESCAPE_PX, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, RootZone, SCREEN_WIDTH_OPTIONS, SENT_LABEL_TRAIT, SILENT_REFUSALS, STRUCTURAL_STATES, SUPPORTED_STATES, SceneCanvasService, SectionComponent, SectionComponentConfig, SelectionReveal, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StructureFix, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TOGGLE_PART_ROLES, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, VideoConfig, ViewportService, ZOOM_OPTIONS, addFormChannel, arrayItemSchemaFields, arraySchemaFields, auditNodes, bindingLabel, bindingLabels, buildBusinessSpecimen, buildCompositePreset, buildConsentPreset, buildElementStyleSpecimen, buildFieldKindPreset, buildFlavorSpecimen, buildFormActionsRow, buildFormChannel, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, builderCompositeFactory, canFluidise, canvasEmptyImageLabel, canvasFloatingContainer, canvasHostDisplay, collapseColumnsProps, columnCountOf, compositeStructureFindings, defaultBuilderLabels, defaultPageSettings, deleteTabPair, displayTriggerOf, dropChildren, dropSectionStamps, dropTargetLabel, duplicateTabPair, escapesRoot, essentialTraitsFor, findNodeByIdInEither, findNodeLocation, findParentOf, flattenLayerTree, flattenSchemaFields, fluidiseProps, formChannelOf, generateNodeId, globalCanvasLayer, hiddenAtBase, hiddenUntilItemOn, inPhoneMenuContext, insertRefusal, insertRefusalLabel, interactionTargets, isHiddenAt, isHiddenAtRest, isPhoneMenuOpener, isPinnedGlobal, isReadingBar, isSpecimen, itemsOnAtRest, markSpecimen, matchesControlSearch, nearestFormNode, neverShown, nodeAncestorPath, nodeAncestorPathInEither, nodeDescriptor, nodeStyleMap, overlayGlobals, pathToNode, phoneMenuOf, phoneMenuShowsAt, refreshSubtree, regenerateNodeIds, removalRefusal, reorderProps, repeaterSourceAlias, repeaterSubLabel, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, retypeNode, rootEscapeBand, rootZone, selectionRevealOf, setChannelAddress, setOverlayPreview, setStyleTrait, setTrait, shortDescriptor, showCanvasToast, shownBeforeControl, sourceContentType, sourceTypeLabel, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, syncNodeInputs, tabPairLabel, tabsRootForPart, textNode, upsertNodeStyles, visibilityProps, walkNodes, wrapNode };
|
|
16203
16034
|
//# sourceMappingURL=vectoriox-iox-builder.mjs.map
|