@vectoriox/iox-builder 4.32.2 → 4.33.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.
@@ -10000,6 +10000,56 @@ function buildFormPreset(def, createConfig) {
10000
10000
  form.children = children;
10001
10001
  return form;
10002
10002
  }
10003
+ const FIELD_KIND_PRESETS = Object.freeze([
10004
+ {
10005
+ control: 'checkbox', name: 'Checkbox', icon: 'ph-thin ph-check-square',
10006
+ description: 'One tick. Making it required turns it into a must-accept.',
10007
+ label: 'I agree',
10008
+ },
10009
+ {
10010
+ control: 'switch', name: 'Switch', icon: 'ph-thin ph-toggle-left',
10011
+ description: 'An on/off toggle — records true or false.',
10012
+ label: 'Enable',
10013
+ },
10014
+ {
10015
+ control: 'radio', name: 'Radio group', icon: 'ph-thin ph-radio-button',
10016
+ description: 'Pick exactly one of a few visible choices.',
10017
+ label: 'Pick one',
10018
+ optionsText: 'First choice\nSecond choice\nThird choice',
10019
+ },
10020
+ {
10021
+ control: 'select', name: 'Dropdown', icon: 'ph-thin ph-caret-circle-down',
10022
+ description: 'Pick one from a list that folds away.',
10023
+ label: 'Choose',
10024
+ optionsText: 'First choice\nSecond choice\nThird choice',
10025
+ },
10026
+ {
10027
+ control: 'range', name: 'Slider', icon: 'ph-thin ph-sliders-horizontal',
10028
+ description: 'A number by sliding between a min and a max.',
10029
+ label: 'How much',
10030
+ },
10031
+ {
10032
+ control: 'date', name: 'Date', icon: 'ph-thin ph-calendar-blank',
10033
+ description: 'A calendar date.',
10034
+ label: 'Date',
10035
+ },
10036
+ {
10037
+ control: 'time', name: 'Time', icon: 'ph-thin ph-clock',
10038
+ description: 'A time of day.',
10039
+ label: 'Time',
10040
+ },
10041
+ ]);
10042
+ /** One pre-set Field. Null when the registry lacks the type — never a half-built node. */
10043
+ function buildFieldKindPreset(def, createConfig) {
10044
+ const field = createConfig('Field');
10045
+ if (!field)
10046
+ return null;
10047
+ setTrait(field, 'label', def.label);
10048
+ setTrait(field, 'control', def.control);
10049
+ if (def.optionsText)
10050
+ setTrait(field, 'optionsText', def.optionsText);
10051
+ return field;
10052
+ }
10003
10053
  function textNode(content, createConfig) {
10004
10054
  const text = createConfig('Text');
10005
10055
  if (!text)
@@ -10063,25 +10113,34 @@ function button(label, createConfig, interaction, styles = {}) {
10063
10113
  return btn;
10064
10114
  }
10065
10115
  /** The C1/C2 board button voices — Swiss by fallback, the brand's the moment tokens seed. */
10116
+ // width:'auto' + flexShrink:'0' on every voice: a consent button never stretches to its row's
10117
+ // height nor shrinks until its label wraps — both happened on the canvas (Rule 0, 2026-10-10).
10066
10118
  const SOLID = {
10067
10119
  backgroundColor: TOKEN$1('brand-500', '#1f1d1b'), color: TOKEN$1('brandInk', '#ffffff'),
10068
10120
  fontSize: '12px', fontWeight: '600', padding: '9px 16px',
10069
10121
  borderRadius: TOKEN$1('radius-control', '4px'),
10122
+ width: 'auto', flexShrink: '0',
10070
10123
  };
10071
10124
  const OUTLINED = {
10072
10125
  backgroundColor: 'transparent', color: TOKEN$1('ink', '#1f1d1b'),
10073
10126
  borderWidth: '1px', borderStyle: 'solid', borderColor: TOKEN$1('ink', '#1f1d1b'),
10074
10127
  fontSize: '12px', fontWeight: '600', padding: '8px 16px',
10075
10128
  borderRadius: TOKEN$1('radius-control', '4px'),
10129
+ width: 'auto', flexShrink: '0',
10076
10130
  };
10077
10131
  const QUIET = {
10078
10132
  backgroundColor: 'transparent', color: TOKEN$1('inkMuted', '#4a453f'),
10079
10133
  fontSize: '11px', fontWeight: '400', padding: '2px 4px', textDecoration: 'underline',
10134
+ width: 'auto', flexShrink: '0',
10080
10135
  };
10081
10136
  function row(createConfig, styles, children) {
10082
10137
  const container = createConfig('Container');
10083
10138
  if (!container || children.some(c => !c))
10084
10139
  return null;
10140
+ // The Container config defaults (minHeight 200px — the canvas droppability affordance) are
10141
+ // serialized with the node, so a preset box must OWN its height or every card ships 200px
10142
+ // tall with dead space (Rule 0 catch, 2026-10-10). Callers may still override.
10143
+ setStyleTrait(container, 'minHeight', 'auto');
10085
10144
  for (const [prop, value] of Object.entries(styles))
10086
10145
  setStyleTrait(container, prop, value);
10087
10146
  container.children = children;
@@ -10111,7 +10170,9 @@ function buildConsentPreset(createConfig) {
10111
10170
  const heading = text$1('Cookies on this site', { fontSize: '13px', fontWeight: '600', color: TOKEN$1('ink', '#1f1d1b') }, createConfig);
10112
10171
  // The first layer NAMES the three categories (plan §7) — the board does it in the copy.
10113
10172
  const body = text$1('We use analytics and marketing cookies only if you allow them. Necessary ones always run.', { fontSize: '11px', color: TOKEN$1('inkMuted', '#4a453f'), lineHeight: '1.5', maxWidth: '330px' }, createConfig);
10114
- const textCol = row(createConfig, { display: 'flex', flexDirection: 'column', gap: '4px', flexGrow: '1' }, [heading, body]);
10173
+ // width:'auto' throughout — the Container default is 100%, and two 100%-wide columns
10174
+ // cannot share the bar's row (they wrap into a stack; Rule 0 catch, 2026-10-10).
10175
+ const textCol = row(createConfig, { display: 'flex', flexDirection: 'column', gap: '4px', flexGrow: '1', width: 'auto' }, [heading, body]);
10115
10176
  const accept = button('Accept all', createConfig, click([
10116
10177
  { type: 'grantConsent' },
10117
10178
  { type: 'closeDialog', target: banner.id },
@@ -10123,9 +10184,9 @@ function buildConsentPreset(createConfig) {
10123
10184
  const prefs = button('Preferences', createConfig, click([
10124
10185
  { type: 'openConsentPreferences', target: preferences.id },
10125
10186
  ]), QUIET);
10126
- const acceptRejectRow = row(createConfig, { display: 'flex', gap: '7px' }, [accept, reject]);
10127
- const buttonsCol = row(createConfig, { display: 'flex', flexDirection: 'column', gap: '7px', alignItems: 'center' }, [acceptRejectRow, prefs]);
10128
- const bannerRow = row(createConfig, { display: 'flex', gap: '18px', alignItems: 'flex-start', flexWrap: 'wrap' }, [textCol, buttonsCol]);
10187
+ const acceptRejectRow = row(createConfig, { display: 'flex', gap: '7px', alignItems: 'center', width: 'auto' }, [accept, reject]);
10188
+ const buttonsCol = row(createConfig, { display: 'flex', flexDirection: 'column', gap: '7px', alignItems: 'center', width: 'auto', flexShrink: '0' }, [acceptRejectRow, prefs]);
10189
+ const bannerRow = row(createConfig, { display: 'flex', gap: '18px', alignItems: 'center', flexWrap: 'wrap' }, [textCol, buttonsCol]);
10129
10190
  if (!bannerRow)
10130
10191
  return null;
10131
10192
  banner.children = [bannerRow];
@@ -10147,11 +10208,12 @@ function buildConsentPreset(createConfig) {
10147
10208
  };
10148
10209
  const nameText = (s) => text$1(s, { fontSize: '13px', fontWeight: '600', color: TOKEN$1('ink', '#1f1d1b') }, createConfig);
10149
10210
  const descText = (s) => text$1(s, { fontSize: '11px', color: TOKEN$1('inkMuted', '#6b6560'), lineHeight: '1.5' }, createConfig);
10150
- const textColOf = (name, desc) => row(createConfig, { display: 'flex', flexDirection: 'column', gap: '2px', flexGrow: '1' }, [nameText(name), descText(desc)]);
10211
+ const textColOf = (name, desc) => row(createConfig, { display: 'flex', flexDirection: 'column', gap: '2px', flexGrow: '1', width: 'auto' }, [nameText(name), descText(desc)]);
10151
10212
  const alwaysOn = text$1('ALWAYS ON', {
10152
10213
  fontSize: '10px', fontWeight: '600', color: TOKEN$1('inkMuted', '#6b6560'),
10153
10214
  borderWidth: '1px', borderStyle: 'solid', borderColor: TOKEN$1('line', '#e6e3e1'),
10154
10215
  borderRadius: '999px', padding: '3px 8px',
10216
+ width: 'auto', flexShrink: '0', // a chip hugs its word (Text defaults to 100%)
10155
10217
  }, createConfig);
10156
10218
  const necessaryCard = row(createConfig, CARD, [
10157
10219
  textColOf('Necessary', 'Keeps the site working: your session, your language, this very choice. Always on.'),
@@ -10169,6 +10231,7 @@ function buildConsentPreset(createConfig) {
10169
10231
  setTrait(sw, 'control', 'switch');
10170
10232
  setTrait(sw, 'name', `consent-${category}`);
10171
10233
  setStyleTrait(sw, 'width', 'auto');
10234
+ setStyleTrait(sw, 'flexShrink', '0');
10172
10235
  return row(createConfig, CARD, [textColOf(name, desc), sw]);
10173
10236
  };
10174
10237
  const analyticsCard = categoryCard('analytics', 'Analytics', 'Anonymous counts of visits and pages. Off means the analytics script never loads.');
@@ -10185,8 +10248,11 @@ function buildConsentPreset(createConfig) {
10185
10248
  { type: 'grantConsent' },
10186
10249
  { type: 'closeDialog', target: preferences.id },
10187
10250
  ]), SOLID);
10188
- const spacer = row(createConfig, { flexGrow: '1' }, []);
10189
- const footer = row(createConfig, { display: 'flex', gap: '8px', alignItems: 'center' }, [prefsReject, spacer, prefsDone, prefsAccept]);
10251
+ // No spacer Container — an EMPTY container paints the canvas "click to select" placeholder
10252
+ // and squeezes the buttons until their labels wrap (Rule 0 catch). space-between + an end
10253
+ // group is the same board layout with no empty node.
10254
+ const footerEnd = row(createConfig, { display: 'flex', gap: '8px', alignItems: 'center', width: 'auto', flexShrink: '0' }, [prefsDone, prefsAccept]);
10255
+ const footer = row(createConfig, { display: 'flex', gap: '8px', alignItems: 'center', justifyContent: 'space-between' }, [prefsReject, footerEnd]);
10190
10256
  if (!prefsHeading || !prefsSub || !necessaryCard || !analyticsCard || !marketingCard || !footer)
10191
10257
  return null;
10192
10258
  preferences.children = [prefsHeading, prefsSub, necessaryCard, analyticsCard, marketingCard, footer];
@@ -11163,5 +11229,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
11163
11229
  * Generated bundle index. Do not edit.
11164
11230
  */
11165
11231
 
11166
- export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, DEFAULT_ESSENTIAL_TRAITS, DRAG_HANDLE_ATTR, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS$1 as EASING_OPTIONS, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_PARTS, FORM_PRESETS, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GalleryConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_LABELS, IOX_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, STRUCTURAL_STATES, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, buildConsentPreset, buildFlavorSampler, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPresetStyleTraits, canFluidise, collapseColumnsProps, columnCountOf, defaultBuilderLabels, defaultPageSettings, dropTargetLabel, essentialTraitsFor, findNodeLocation, findParentOf, flattenSchemaFields, fluidiseProps, generateNodeId, isHiddenAt, matchesControlSearch, nearestFormNode, nodeAncestorPath, nodeAncestorPathInEither, reorderProps, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, setStyleTrait, setTrait, stackChildrenProps, summarise, textNode, visibilityProps, wrapNode };
11232
+ export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, DEFAULT_ESSENTIAL_TRAITS, DRAG_HANDLE_ATTR, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS$1 as EASING_OPTIONS, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FORM_PRESETS, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GalleryConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_LABELS, IOX_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, STRUCTURAL_STATES, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, buildConsentPreset, buildFieldKindPreset, buildFlavorSampler, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPresetStyleTraits, canFluidise, collapseColumnsProps, columnCountOf, defaultBuilderLabels, defaultPageSettings, dropTargetLabel, essentialTraitsFor, findNodeLocation, findParentOf, flattenSchemaFields, fluidiseProps, generateNodeId, isHiddenAt, matchesControlSearch, nearestFormNode, nodeAncestorPath, nodeAncestorPathInEither, reorderProps, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, setStyleTrait, setTrait, stackChildrenProps, summarise, textNode, visibilityProps, wrapNode };
11167
11233
  //# sourceMappingURL=vectoriox-iox-builder.mjs.map