@vectoriox/iox-ui 4.16.2 → 4.17.1

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.
@@ -2578,6 +2578,13 @@ const NOOP_INITIAL_VALUES = {
2578
2578
  'aspect-ratio': ['auto'],
2579
2579
  'mix-blend-mode': ['normal'],
2580
2580
  'transform': ['none'], 'box-shadow': ['none'],
2581
+ // overflow initial is `visible`. A self-describing node serialises the Overflow trait's default,
2582
+ // so WITHOUT this the emitted `overflow: visible` would override component baselines that clip
2583
+ // (e.g. `.iox-card__img-wrap`, `.iox-slider`, `.iox-gallery` all set `overflow: hidden`), breaking
2584
+ // object-fit/aspect-ratio image clipping everywhere. A user-set hidden/scroll/auto/clip is not the
2585
+ // initial, so it still emits and wins.
2586
+ 'overflow': ['visible'], 'overflow-x': ['visible'], 'overflow-y': ['visible'],
2587
+ 'clip-path': ['none'],
2581
2588
  };
2582
2589
  /**
2583
2590
  * Style props a type's render-default fully REPLACES. Emitting them would produce a dead
@@ -2845,6 +2852,83 @@ function composeVirtualTraits(raw, base = raw) {
2845
2852
  return result;
2846
2853
  }
2847
2854
 
2855
+ /**
2856
+ * tree-relations — framework-agnostic helpers for reasoning about a rendered node
2857
+ * tree's structural relationships. Lives in @vectoriox/iox-ui because BOTH renderers
2858
+ * depend on iox-ui (the engine does NOT depend on iox-builder), so the same logic
2859
+ * drives the builder canvas AND the SSR site — no fork.
2860
+ * See iox-ai-guidance `architecture/builder/targeted-hover-state-plan.md`.
2861
+ */
2862
+ /** The css id a node contributes to selectors: its clone `styleId`, else its own `id`. */
2863
+ function nodeCssId(node) {
2864
+ return node.styleId ?? node.id;
2865
+ }
2866
+ /**
2867
+ * Path of css ids from the root down to (and including) the node whose css id === `cssId`.
2868
+ * Returns `null` when no node matches. First match wins (depth-first, pre-order).
2869
+ */
2870
+ function pathToCssId(nodes, cssId) {
2871
+ for (const node of nodes) {
2872
+ const ownId = nodeCssId(node);
2873
+ if (ownId === cssId)
2874
+ return [ownId];
2875
+ if (node.children?.length) {
2876
+ const childPath = pathToCssId(node.children, cssId);
2877
+ if (childPath)
2878
+ return ownId ? [ownId, ...childPath] : childPath;
2879
+ }
2880
+ }
2881
+ return null;
2882
+ }
2883
+ /**
2884
+ * The css id of the NEAREST COMMON ANCESTOR of two nodes (identified by their css ids),
2885
+ * used to scope a `:has()` targeted-state selector so it stays repetition-safe.
2886
+ *
2887
+ * The result may equal `styledCssId` (the trigger sits INSIDE the styled node) or
2888
+ * `triggerCssId` (the styled node sits inside the trigger) — both are valid scopes;
2889
+ * `buildTargetedStateSelector` picks the right selector shape for each. Returns
2890
+ * `undefined` only when a valid scope can't exist: an id is blank, the two ids are the
2891
+ * same node, or they share no ancestor in `root`. Callers MUST skip emitting the rule
2892
+ * when this is `undefined` — never emit an unscoped (page-global) `:has()`, which would
2893
+ * break under repetition.
2894
+ */
2895
+ function nearestCommonAncestorId(root, styledCssId, triggerCssId) {
2896
+ if (!styledCssId || !triggerCssId || styledCssId === triggerCssId)
2897
+ return undefined;
2898
+ const styledPath = pathToCssId(root, styledCssId);
2899
+ const triggerPath = pathToCssId(root, triggerCssId);
2900
+ if (!styledPath || !triggerPath)
2901
+ return undefined;
2902
+ // Walk both paths together; the last shared prefix element is the common ancestor.
2903
+ let common;
2904
+ const shorter = Math.min(styledPath.length, triggerPath.length);
2905
+ for (let i = 0; i < shorter; i++) {
2906
+ if (styledPath[i] !== triggerPath[i])
2907
+ break;
2908
+ common = styledPath[i];
2909
+ }
2910
+ return common;
2911
+ }
2912
+ /**
2913
+ * Build the selector BODY (no leading `.`, matching the builder's `compile()` convention)
2914
+ * for a targeted state, given the resolved scope. Three topologies, one shared rule:
2915
+ *
2916
+ * - trigger INSIDE styled (scope === styled): `iox-node-{styled}:has(.iox-node-{trigger}:{base})`
2917
+ * - styled INSIDE trigger (scope === trigger): `iox-node-{trigger}:{base} .iox-node-{styled}`
2918
+ * - separate subtrees (scope is above both): `iox-node-{scope}:has(.iox-node-{trigger}:{base}) .iox-node-{styled}`
2919
+ *
2920
+ * `scopeCssId` MUST be a value returned by `nearestCommonAncestorId` for the same pair.
2921
+ */
2922
+ function buildTargetedStateSelector(scopeCssId, triggerCssId, styledCssId, base) {
2923
+ if (scopeCssId === styledCssId) {
2924
+ return `iox-node-${styledCssId}:has(.iox-node-${triggerCssId}:${base})`;
2925
+ }
2926
+ if (scopeCssId === triggerCssId) {
2927
+ return `iox-node-${triggerCssId}:${base} .iox-node-${styledCssId}`;
2928
+ }
2929
+ return `iox-node-${scopeCssId}:has(.iox-node-${triggerCssId}:${base}) .iox-node-${styledCssId}`;
2930
+ }
2931
+
2848
2932
  /**
2849
2933
  * Shared RELATIVE (route-context) data resolving — the SINGLE source of truth for how a detail page
2850
2934
  * derives values FROM its current route item, consumed by BOTH the page builder (iox-cms-client) and
@@ -3550,5 +3634,5 @@ function effectiveTransitionId(anim) {
3550
3634
  * Generated bundle index. Do not edit.
3551
3635
  */
3552
3636
 
3553
- export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, DEFAULT_GALLERY_SCHEDULER, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_WIDTH_BY_TYPE, ENVIRONMENT, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, IOX_BUILDER_EVENTS, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxPageComponent, IoxPageModule, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, PrivacyModalComponent, PrivacyModalService, PrivacyModelEvent, RESERVED_ALIAS_PREFIX, SUPPRESSED_STYLE_PROPS_BY_TYPE, SectionComponent, TRANSITION_FEELS, TextBlockComponent, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, WebSettingsService, applyBindingPipes, applyFeel, buildDataSourceFilter, buildRelatedFilter, buildTransitionTimeline, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, dataSourcePlanToRequest, effectiveTransitionId, excludeSelf, feelFor, getByPath, isReservedAlias, legacyEnterToTransition, matchRouteParams, normalizeCollectionResult, parseUrlList, planDataSource, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, rewriteViewportUnits, stripSuppressedProps, styleKeyToKebab };
3637
+ export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, DEFAULT_GALLERY_SCHEDULER, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_WIDTH_BY_TYPE, ENVIRONMENT, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, IOX_BUILDER_EVENTS, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxPageComponent, IoxPageModule, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, PrivacyModalComponent, PrivacyModalService, PrivacyModelEvent, RESERVED_ALIAS_PREFIX, SUPPRESSED_STYLE_PROPS_BY_TYPE, SectionComponent, TRANSITION_FEELS, TextBlockComponent, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, WebSettingsService, applyBindingPipes, applyFeel, buildDataSourceFilter, buildRelatedFilter, buildTargetedStateSelector, buildTransitionTimeline, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, dataSourcePlanToRequest, effectiveTransitionId, excludeSelf, feelFor, getByPath, isReservedAlias, legacyEnterToTransition, matchRouteParams, nearestCommonAncestorId, nodeCssId, normalizeCollectionResult, parseUrlList, planDataSource, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, rewriteViewportUnits, stripSuppressedProps, styleKeyToKebab };
3554
3638
  //# sourceMappingURL=vectoriox-iox-ui.mjs.map