@vectoriox/iox-builder 11.23.0 → 11.24.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,7 +19,7 @@ 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';
|
|
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
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';
|
|
24
24
|
import { Subject, BehaviorSubject, of, forkJoin } from 'rxjs';
|
|
25
25
|
import interact from 'interactjs';
|
|
@@ -14638,207 +14638,25 @@ function buildPalettePreset(def, createConfig) {
|
|
|
14638
14638
|
return node;
|
|
14639
14639
|
}
|
|
14640
14640
|
|
|
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
|
-
}
|
|
14641
|
+
const NO_BASELINE = () => ({});
|
|
14642
|
+
/** The tail of `builderCompositeFactory`'s error for a type the registry does not have. */
|
|
14643
|
+
const UNREGISTERED = 'is not a registered component type';
|
|
14724
14644
|
/** 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 };
|
|
14645
|
+
function buildConsentPreset(createConfig, options = {}) {
|
|
14646
|
+
const { baselineStyles = NO_BASELINE, ...recipe } = options;
|
|
14647
|
+
try {
|
|
14648
|
+
const { banner, preferences, settings } = buildConsentRecipe(builderCompositeFactory(createConfig, baselineStyles), recipe);
|
|
14649
|
+
return {
|
|
14650
|
+
banner: banner,
|
|
14651
|
+
preferences: preferences,
|
|
14652
|
+
withdrawal: settings,
|
|
14653
|
+
};
|
|
14654
|
+
}
|
|
14655
|
+
catch (error) {
|
|
14656
|
+
if (error instanceof Error && error.message.endsWith(UNREGISTERED))
|
|
14657
|
+
return null; // a type the registry lacks
|
|
14658
|
+
throw error;
|
|
14659
|
+
}
|
|
14842
14660
|
}
|
|
14843
14661
|
|
|
14844
14662
|
/**
|