@vectoriox/iox-builder 11.27.0 → 11.28.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.
@@ -17,13 +17,13 @@ import { TooltipModule } from 'primeng/tooltip';
17
17
  import * as i20 from 'primeng/dialog';
18
18
  import { DialogModule } from 'primeng/dialog';
19
19
  import * as i2$1 from '@vectoriox/iox-ui';
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, reducedEntranceRun, settleInteraction, settleModeFor, SettleMode, playInteraction, entranceDelay, repeatedRowIndex, resolveInteractionEasing, 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';
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, reducedEntranceRun, settleInteraction, settleModeFor, SettleMode, playInteraction, entranceDelay, repeatedRowIndex, resolveInteractionEasing, 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, inkFollowingHeadersIn, HeaderInkRuntime, 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
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, 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
- import { HeaderTrait, HeaderBehaviour, HeaderEdge, MenuTrait, MenuForm, MenuReveal, MenuHover, MenuPhoneForm, MenuButtonKind, pageOpeningScheme, menuDialogAttributes, MenuAttribute } from '@vectoriox/iox-ui/design-core';
26
+ import { HeaderTrait, HeaderBehaviour, HeaderEdge, HeaderInk, SECTION_EDGE_TRAIT, SECTION_EDGES, SECTION_SHAPE_TRAIT, SectionShape, MenuTrait, MenuForm, MenuReveal, MenuHover, MenuPhoneForm, MenuButtonKind, pageOpeningScheme, menuDialogAttributes, MenuAttribute } from '@vectoriox/iox-ui/design-core';
27
27
  import { map, catchError, skip } from 'rxjs/operators';
28
28
  import * as i1 from '@angular/common/http';
29
29
  import { SAMPLE_PRODUCT, productInScope, simulatedCartTransport, storefrontCatalog, SAMPLE_STUDIO, SAMPLE_CART_LINE, SAMPLE_SWATCHES } from '@vectoriox/iox-ui/commerce-core';
@@ -971,7 +971,7 @@ var PanelEventTypes;
971
971
  /** A panel rewrote a node's SUBTREE in place — its children (a Card's Parts), its layout styles (Card ▸
972
972
  * Layout), a part's element style or scheme. Carries `{ node }`. The builder re-renders the subtree,
973
973
  * re-registers every node's rules and design classes, refreshes a Repeater holding it, and records ONE
974
- * undo step (LAYOUT_CHANGED). */
974
+ * undo step (LAYOUT_CHANGED). `{ nodes }` (AW6): several subtrees changed by one edit — still ONE step. */
975
975
  PanelEventTypes["NODE_STRUCTURE_CHANGED"] = "nodestructurechanged";
976
976
  /** A Repeater's rows changed on the canvas (fetched, re-fetched, its source cleared). Carries `{ nodeId,
977
977
  * count }`. Not a page edit — never an undo step: the layer tree redraws its "N more rows" line. */
@@ -2000,6 +2000,22 @@ function buildHeaderBehaviourTraits() {
2000
2000
  // HI1b (HS-5): the mix the header was composed as (generation-core `stampHeaderMix`) — read by Bindings ▸ Header and
2001
2001
  // the Header studio, written by its Apply; no renderer reads it.
2002
2002
  new TraitConfig(HeaderTrait.Mix, 'Header mix', TraitInputType.Text),
2003
+ // AW6 (AW6-D10): whose colours the header wears — the page's opening, or every section as it passes under the bar.
2004
+ // Written by the Header studio (Scroll & phone ▸ Its colours follow) and the composer; no default (R-H4).
2005
+ new TraitConfig(HeaderTrait.Ink, 'Colours follow', TraitInputType.Select, [
2006
+ { label: "The page's opening", value: HeaderInk.Opening },
2007
+ { label: 'Every section', value: HeaderInk.Follows },
2008
+ ]),
2009
+ ];
2010
+ }
2011
+ /**
2012
+ * A section's edge into the one above it, and its shape (AW6 — design-core `section-edge.ts`). No default: a section
2013
+ * saves neither until the author (Bindings ▸ Section edge) or the composer chooses — straight and full width.
2014
+ */
2015
+ function buildSectionEdgeTraits() {
2016
+ return [
2017
+ new TraitConfig(SECTION_EDGE_TRAIT, 'Section edge', TraitInputType.Select, SECTION_EDGES.map(e => ({ label: e, value: e }))),
2018
+ new TraitConfig(SECTION_SHAPE_TRAIT, 'Section shape', TraitInputType.Select, Object.values(SectionShape).map(s => ({ label: s, value: s }))),
2003
2019
  ];
2004
2020
  }
2005
2021
  /**
@@ -9869,7 +9885,8 @@ class BuilderComponent {
9869
9885
  }
9870
9886
  /** The overlay's BEFORE wrapper comes and goes with its globals; its block size is the page's top reserve. */
9871
9887
  set globalsBeforeRef(ref) {
9872
- this.observeBeforeGlobals(ref?.nativeElement ?? null);
9888
+ this.globalsBeforeEl = ref?.nativeElement ?? null;
9889
+ this.observeBeforeGlobals(this.globalsBeforeEl);
9873
9890
  }
9874
9891
  /** A page with nothing on it yet: offer a structure instead of a blank canvas. */
9875
9892
  get isPageEmpty() {
@@ -10305,6 +10322,7 @@ class BuilderComponent {
10305
10322
  this.applyAnimationToAll = new EventEmitter();
10306
10323
  this.saveBlock = new EventEmitter();
10307
10324
  this.globalElementsChange = new EventEmitter();
10325
+ this.globalsBeforeEl = null;
10308
10326
  this.components = [];
10309
10327
  this.activePanel = PanelTypes.STYLES;
10310
10328
  this.isPanelOpen = false;
@@ -10391,6 +10409,10 @@ class BuilderComponent {
10391
10409
  };
10392
10410
  /** The canvas's hiding headers (premium M4, T2) — the SAME runtime the live site runs, fed the canvas's scroll. */
10393
10411
  this.headerRuntimes = new Map();
10412
+ /** AW6 (AW6-D10): the canvas's header whose colours follow the sections — the SAME runtime the live site runs, read on
10413
+ * the canvas driver's scroll (never a dispatched DOM scroll). It writes the opening attribute on the BEFORE
10414
+ * globals' wrapper, which the shared scheme CSS reads. */
10415
+ this.headerInk = null;
10394
10416
  /**
10395
10417
  * HI1b (HS-1): the width a covering side-card takes from the canvas column, in screen px — the column's inline-end
10396
10418
  * margin, so the canvas, its two strips and the overlays re-centre in the room left beside the card. (A pan moved only
@@ -10444,6 +10466,8 @@ class BuilderComponent {
10444
10466
  // that only appeared once the site was published.
10445
10467
  this.pageStyleCss = compilePageStyle(this.pageSettings?.style, { designSystem: this.pageSettings?.designSystem === true });
10446
10468
  this.globalLayerCss = pickInherited(this.pageStyleCss);
10469
+ // A new opening: the header-ink runtime of the last one goes (it would write its own opening back).
10470
+ this.dropHeaderInk();
10447
10471
  this.openingScheme = pageOpeningScheme(this.pageSettings);
10448
10472
  }
10449
10473
  if (changes['pagePath']) {
@@ -10749,6 +10773,7 @@ class BuilderComponent {
10749
10773
  for (const runtime of this.headerRuntimes.values())
10750
10774
  runtime.destroy();
10751
10775
  this.headerRuntimes.clear();
10776
+ this.dropHeaderInk();
10752
10777
  this.canvasRo?.disconnect();
10753
10778
  this.previewFrameRo?.disconnect();
10754
10779
  this.beforeGlobalsRo?.disconnect();
@@ -10814,6 +10839,37 @@ class BuilderComponent {
10814
10839
  runtime.update(offset);
10815
10840
  }
10816
10841
  }
10842
+ syncHeaderInk() {
10843
+ const host = this.globalsBeforeEl;
10844
+ const header = host ? inkFollowingHeadersIn(host)[0] : undefined;
10845
+ if (!host || !header) {
10846
+ this.dropHeaderInk();
10847
+ return;
10848
+ }
10849
+ if (this.headerInk?.header !== header || this.headerInk.host !== host) {
10850
+ this.dropHeaderInk();
10851
+ this.headerInk = { runtime: new HeaderInkRuntime(host, header, () => this.canvasSections()), header, host };
10852
+ }
10853
+ this.headerInk.runtime.update();
10854
+ }
10855
+ dropHeaderInk() {
10856
+ this.headerInk?.runtime.destroy();
10857
+ this.headerInk = null;
10858
+ }
10859
+ /** The page's sections on the canvas, in order: its top-level nodes, then the in-flow AFTER globals (a footer). */
10860
+ canvasSections() {
10861
+ const page = document.getElementById('canvas-preview');
10862
+ if (!page)
10863
+ return [];
10864
+ const out = [];
10865
+ for (const el of Array.from(page.children)) {
10866
+ if (el.classList.contains(GLOBALS_AFTER_CLASS))
10867
+ out.push(...Array.from(el.children));
10868
+ else if (!el.classList.contains('empty-canvas'))
10869
+ out.push(el);
10870
+ }
10871
+ return out;
10872
+ }
10817
10873
  /** Keep the Scrolled attribute (iox-ui SCROLLED_ATTRIBUTE) on the canvas page and the header overlay — written only
10818
10874
  * when it changes, so the overlay's mutation observers never wake for a scroll tick. */
10819
10875
  syncScrolled(offset) {
@@ -10840,6 +10896,7 @@ class BuilderComponent {
10840
10896
  // The Scrolled state (G4) on the canvas: the page and its header globals know the canvas has moved.
10841
10897
  this.syncScrolled(instance.scroll);
10842
10898
  this.syncHeaderRuntimes(instance.scroll);
10899
+ this.syncHeaderInk();
10843
10900
  const clientH = this.previewScrollRef.nativeElement.clientHeight;
10844
10901
  this.onPageScroll({
10845
10902
  scrollTop: instance.scroll,
@@ -11710,10 +11767,12 @@ class BuilderComponent {
11710
11767
  * when the node is not inside a repeater. */
11711
11768
  /** NODE_STRUCTURE_CHANGED: the subtree's children render (CD), then every node's rules, classes and
11712
11769
  * inputs are re-applied (a moved node's rule may have been dropped by its old host's teardown). */
11713
- applyStructureChange(node) {
11770
+ applyStructureChange(nodes) {
11714
11771
  this.cdr.detectChanges();
11715
- refreshSubtree(node, this.styleRegistry, n => this.overlayService.getNodeRef(n)?.componentRef, canvasEmptyImageLabel(this.labels));
11716
- this._refreshRepeaterFor(node);
11772
+ for (const node of nodes) {
11773
+ refreshSubtree(node, this.styleRegistry, n => this.overlayService.getNodeRef(n)?.componentRef, canvasEmptyImageLabel(this.labels));
11774
+ this._refreshRepeaterFor(node);
11775
+ }
11717
11776
  this.cdr.detectChanges();
11718
11777
  this.overlayService.refreshSelect();
11719
11778
  this.panelEventService.emit(PanelEventTypes.LAYOUT_CHANGED, this.layout);
@@ -11813,8 +11872,10 @@ class BuilderComponent {
11813
11872
  // every node's rules and classes, refresh a Repeater holding it, and record ONE undo step.
11814
11873
  if (panelEvent.type === PanelEventTypes.NODE_STRUCTURE_CHANGED) {
11815
11874
  const node = panelEvent.data?.node;
11816
- if (node)
11817
- this.applyStructureChange(node);
11875
+ // AW6 (AW6-D6): one edit across several nodes ("Use this edge on every section") is ONE undo step.
11876
+ const nodes = panelEvent.data?.nodes ?? (node ? [node] : []);
11877
+ if (nodes.length)
11878
+ this.applyStructureChange(nodes);
11818
11879
  return;
11819
11880
  }
11820
11881
  // A panel (e.g. the Form's nested field list) wants to select a node it already holds a
@@ -15289,6 +15350,8 @@ class BuilderContainerComponentConfig extends ComponentConfig {
15289
15350
  ...buildCompositeBehaviourTraits(),
15290
15351
  ...buildHeaderBehaviourTraits(),
15291
15352
  ...buildMarqueeTraits(),
15353
+ // AW6: a Container that is a page's direct child is a section too (Bindings ▸ Section edge).
15354
+ ...buildSectionEdgeTraits(),
15292
15355
  ];
15293
15356
  this.styleTraits = buildFullStyleTraits();
15294
15357
  this.applyStyleDefaults({
@@ -15940,7 +16003,7 @@ class SectionComponentConfig extends ComponentConfig {
15940
16003
  constructor() {
15941
16004
  super('Section', 'app-section', 'ph-thin ph-rows', 'Layout');
15942
16005
  this.children = [];
15943
- this.traits = [buildColorSchemeTrait(), new TraitConfig(OPENING_MIX_TRAIT, 'Opening mix', TraitInputType.Text)];
16006
+ this.traits = [buildColorSchemeTrait(), new TraitConfig(OPENING_MIX_TRAIT, 'Opening mix', TraitInputType.Text), ...buildSectionEdgeTraits()];
15944
16007
  this.styleTraits = buildFullStyleTraits();
15945
16008
  this.applyStyleDefaults({
15946
16009
  width: 'auto',