@vectoriox/iox-builder 11.35.0 → 11.37.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.
@@ -20,7 +20,7 @@ import * as i2$1 from '@vectoriox/iox-ui';
20
20
  import { nodeCssId, needsGroupName, resolveBoundValue, isBoundStyleProp, 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, siteColumnOf, 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, applyBoundStyles, applyBoundStyle, 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, PopupTrait, PopupKind, PopupForm, PopupArrive, PopupAgain, DIALOG_MODAL_TRAIT, 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, PopupRole, SliderRole, accordionItemLabel, segmentedOptionLabel, isExclusivePanels, isLockedPart, attachShop, ShopRole, attachAccount, AccountRole, accordionRootOf, accordionItemOf, addAccordionItem, addTabPair, segmentedAddRefusal, addSegmentedOption, isCompositeItem, accordionHeadingLevel, isCompositePanel, isCompositeTrigger, popupFormOf, 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';
23
+ import { formContentInHost, isInteractiveHost, findFormContentInHosts, formPresetById, presetFormActions, busyWord, 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, HeaderInk, SECTION_EDGE_TRAIT, SECTION_EDGES, SECTION_SHAPE_TRAIT, SectionShape, MenuTrait, MenuForm, MenuReveal, MenuHover, MenuPhoneForm, MenuButtonKind, pageColumn, pageOpeningScheme, menuDialogAttributes, MenuAttribute } from '@vectoriox/iox-ui/design-core';
@@ -29,7 +29,7 @@ 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';
30
30
  import { POPOVER_ACTION_TYPE_SET, TOAST_ACTION_TYPES, itemActionOf, BEHAVIOUR_ACTION_TYPES, SHOP_ACTION_TYPES, ACCOUNT_ACTION_TYPES, SERVER_ELEMENT_ACTION_TYPES, CONSENT_ACTION_TYPES, opensAtClickedItem, openedDialogId, DIALOG_CLOSING_ATTRIBUTE, cancelExit, runExitMotion, dialogOpenersSelector, dialogDomId, revealOrigin, holdClosedWhile, revealOriginStyle, popoverOpenersSelector, popoverDomId } from '@vectoriox/iox-ui/actions-core';
31
31
  import { NavRole, navShapeBreakpoint, isScrubbedEntrance, ENTRANCE_TRIGGER, entranceInteraction, entranceAction, sectionEntrances, EntrancePart } from '@vectoriox/iox-ui/generation-core';
32
- import { ScrollDriver, syncSceneAttributes, SCENE_LAND_TRIGGER, onSceneLand, buildSceneRecipe } from '@vectoriox/iox-ui/scene-core';
32
+ import { ScrollDriver, syncSceneAttributes, SCENE_LAND_TRIGGER, onSceneLand, watchArrival, arrivedWithin, buildSceneRecipe } from '@vectoriox/iox-ui/scene-core';
33
33
  import Lenis from 'lenis';
34
34
  import { simulatedSiteAuthTransport } from '@vectoriox/iox-ui/identity-core';
35
35
  import Moveable from 'moveable';
@@ -5096,21 +5096,17 @@ class InteractionEngineService {
5096
5096
  firedSet.add(key);
5097
5097
  this.runActions(node, ix.actions, element);
5098
5098
  };
5099
- // IntersectionObserver with no root uses the browser viewport.
5100
- // It respects overflow:hidden clipping from .preview-scroll so it fires
5101
- // correctly as Lenis scrolls (Lenis changes scrollTop on .preview-scroll).
5102
- const observer = new IntersectionObserver((entries) => {
5103
- for (const entry of entries) {
5104
- if (entry.isIntersecting) {
5105
- cleanup();
5106
- fire();
5107
- }
5108
- }
5109
- }, { threshold: 0.1 });
5110
- observer.observe(element);
5099
+ // The moment the element ARRIVES is shared scene-core `watchArrival`'s (a tenth of it, or a tenth of the screen,
5100
+ // shows it — iox-ui#156), the same rule the live engine plays by. With no root it asks the browser viewport and
5101
+ // respects the overflow clipping of .preview-scroll, so it fires as Lenis scrolls (Lenis changes its scrollTop).
5102
+ // No IntersectionObserver at all (an old browser): the entrance plays at once, never an empty band.
5103
+ const unwatch = watchArrival(element, arrived => { if (arrived) {
5104
+ cleanup();
5105
+ fire();
5106
+ } });
5111
5107
  // Builder: also listen to Lenis scroll events on .preview-lenis-content
5112
5108
  // as a fallback in case IntersectionObserver misses elements behind a
5113
- // CSS transform (scale) on iox-page-component.
5109
+ // CSS transform (scale) on iox-page-component — the same rule, read off the canvas's box (scene-core `arrivedWithin`).
5114
5110
  const lenisEl = this.overlayService.getScrollContainer();
5115
5111
  let scrollFired = false;
5116
5112
  const onScroll = () => {
@@ -5119,11 +5115,7 @@ class InteractionEngineService {
5119
5115
  const rootEl = this.overlayService.getIntersectionRoot();
5120
5116
  if (!rootEl)
5121
5117
  return;
5122
- const rootRect = rootEl.getBoundingClientRect();
5123
- const elRect = element.getBoundingClientRect();
5124
- const overlapH = Math.min(elRect.bottom, rootRect.bottom) - Math.max(elRect.top, rootRect.top);
5125
- const elH = elRect.bottom - elRect.top;
5126
- if (elH > 0 && overlapH / elH >= 0.1) {
5118
+ if (arrivedWithin(element.getBoundingClientRect(), rootEl.getBoundingClientRect())) {
5127
5119
  scrollFired = true;
5128
5120
  cleanup();
5129
5121
  fire();
@@ -5132,11 +5124,15 @@ class InteractionEngineService {
5132
5124
  if (lenisEl)
5133
5125
  lenisEl.addEventListener('scroll', onScroll, { passive: true });
5134
5126
  const cleanup = () => {
5135
- observer.disconnect();
5127
+ unwatch?.();
5136
5128
  scrollFired = true;
5137
5129
  if (lenisEl)
5138
5130
  lenisEl.removeEventListener('scroll', onScroll);
5139
5131
  };
5132
+ if (!unwatch) {
5133
+ cleanup();
5134
+ fire();
5135
+ }
5140
5136
  return cleanup;
5141
5137
  }
5142
5138
  isBuilderMode() {
@@ -14799,11 +14795,16 @@ function matchesControlSearch(name, label, term) {
14799
14795
  * carry the default Name/Email pair as well as its own fields.
14800
14796
  *
14801
14797
  * Returns null when a type is missing from the registry, so a half-built tree never reaches a page.
14798
+ *
14799
+ * `lang` is the SITE's language (vectoriox/iox-cms-client#115), never the admin's: the form asks, answers, fails and
14800
+ * says "While sending" in it — forms-core's own words (`formPresetById`, `busyWord`), the SAME the composer stamps, so a
14801
+ * form dropped from the tray onto a Hebrew page reads as the generated one does. Absent: English, as before.
14802
14802
  */
14803
- function buildFormPreset(def, createConfig) {
14803
+ function buildFormPreset(def, createConfig, lang) {
14804
14804
  const form = createConfig('Form');
14805
14805
  if (!form)
14806
14806
  return null;
14807
+ def = (lang ? formPresetById(def.id, lang) : null) ?? def;
14807
14808
  setTrait(form, 'name', def.formName);
14808
14809
  // A fresh id per insert: two forms on one page must never share a submissions stream.
14809
14810
  setTrait(form, 'formId', `${def.id}-${Math.random().toString(36).slice(2, 8)}`);
@@ -14843,6 +14844,7 @@ function buildFormPreset(def, createConfig) {
14843
14844
  if (!submit)
14844
14845
  return null;
14845
14846
  setTrait(submit, 'label', def.submitLabel);
14847
+ setTrait(submit, 'loadingLabel', busyWord(lang));
14846
14848
  if (def.channel) {
14847
14849
  // Send and the second channel share ONE row (premium N2) — it stays on screen after the form has sent.
14848
14850
  const row = buildFormActionsRow(submit, def.channel, '', createConfig);