@vectoriox/iox-ui 4.18.0 → 4.20.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.
@@ -3451,6 +3451,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
3451
3451
  args: [{ providedIn: 'root' }]
3452
3452
  }] });
3453
3453
 
3454
+ /** Action types this module handles. Anything else is not a context action. */
3455
+ const CONTEXT_ACTION_TYPES = ['setContext', 'clearContext'];
3456
+ function isContextAction(action) {
3457
+ return !!action?.type && CONTEXT_ACTION_TYPES.includes(action.type);
3458
+ }
3459
+ /**
3460
+ * Resolve an action + pass into the store operation to perform, or `null` for "do nothing".
3461
+ *
3462
+ * Returning `null` (rather than throwing or guessing) is what lets a runtime call this for every
3463
+ * action on every pass and simply skip the misses.
3464
+ */
3465
+ function contextActionEffect(action, pass = 'forward') {
3466
+ if (!isContextAction(action))
3467
+ return null;
3468
+ const params = (action.params ?? {});
3469
+ const slot = typeof params.slot === 'string' ? params.slot.trim() : '';
3470
+ if (!slot)
3471
+ return null;
3472
+ if (action.type === 'clearContext') {
3473
+ // A clear has no meaningful reverse — leaving the element must not re-populate the slot.
3474
+ return pass === 'forward' ? { op: 'clear', slot } : null;
3475
+ }
3476
+ // setContext
3477
+ if (pass === 'forward') {
3478
+ return params.value ? { op: 'set', slot, value: params.value } : null;
3479
+ }
3480
+ return params.noReverse ? null : { op: 'clear', slot };
3481
+ }
3482
+
3483
+ /**
3484
+ * Which slot keys are actually IN USE on a page — derived from the layout tree itself.
3485
+ *
3486
+ * A slot only matters at runtime if something writes it (a `setContext`/`clearContext` action) or
3487
+ * reads it (a binding whose `source` names it). Deriving the set from the tree means the runtime
3488
+ * works without waiting on the page model: a DECLARED `IoxContextSlot` adds typing for the bind
3489
+ * picker and a `default`, but is not required for the channel to function.
3490
+ *
3491
+ * Union of declared + in-use, so a declared-but-unused slot still seeds its default, and a slot used
3492
+ * by a symbol dropped onto a page that never declared it still works (it just has no default).
3493
+ */
3494
+ function collectContextSlotKeys(nodes, declared = []) {
3495
+ const written = new Set();
3496
+ const read = new Set();
3497
+ walk(nodes, written, read);
3498
+ // A binding only names a SLOT if something writes that key; otherwise it names a data source.
3499
+ const keys = new Set(written);
3500
+ for (const key of read)
3501
+ if (written.has(key))
3502
+ keys.add(key);
3503
+ for (const slot of declared)
3504
+ if (slot?.key)
3505
+ keys.add(slot.key);
3506
+ return keys;
3507
+ }
3508
+ function walk(nodes, written, read) {
3509
+ for (const raw of nodes ?? []) {
3510
+ const node = raw;
3511
+ if (!node)
3512
+ continue;
3513
+ for (const ix of node.interactions ?? []) {
3514
+ for (const action of [...(ix?.actions ?? []), ...(ix?.reverseActions ?? [])]) {
3515
+ const effect = contextActionEffect(action, 'forward')
3516
+ ?? contextActionEffect(action, 'reverse');
3517
+ if (effect)
3518
+ written.add(effect.slot);
3519
+ }
3520
+ }
3521
+ for (const binding of node.bindings ?? []) {
3522
+ if (binding?.source)
3523
+ read.add(binding.source);
3524
+ }
3525
+ if (Array.isArray(node.children))
3526
+ walk(node.children, written, read);
3527
+ }
3528
+ }
3529
+
3454
3530
  /**
3455
3531
  * Cinematic page-transition presets — the SINGLE SOURCE OF TRUTH shared by the page builder
3456
3532
  * (preview) and the SSR client engine (production). Pure, transport-agnostic: this module only
@@ -3885,5 +3961,5 @@ function effectiveTransitionId(anim) {
3885
3961
  * Generated bundle index. Do not edit.
3886
3962
  */
3887
3963
 
3888
- export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, ContextStore, 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, contextSlotKeys, dataSourcePlanToRequest, declaredInputNames, effectiveTransitionId, excludeSelf, feelFor, getByPath, initialSlotValues, isReservedAlias, isValidSlotKey, legacyEnterToTransition, matchRouteParams, nearestCommonAncestorId, nodeCssId, nodeUsesContext, normalizeCollectionResult, parseUrlList, planDataSource, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveContextValue, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolvePath, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, rewriteViewportUnits, safeSetInput, stripSuppressedProps, styleKeyToKebab, withContextSlots };
3964
+ export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CONTEXT_ACTION_TYPES, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, ContextStore, 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, collectContextSlotKeys, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, contextActionEffect, contextSlotKeys, dataSourcePlanToRequest, declaredInputNames, effectiveTransitionId, excludeSelf, feelFor, getByPath, initialSlotValues, isContextAction, isReservedAlias, isValidSlotKey, legacyEnterToTransition, matchRouteParams, nearestCommonAncestorId, nodeCssId, nodeUsesContext, normalizeCollectionResult, parseUrlList, planDataSource, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveContextValue, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolvePath, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, rewriteViewportUnits, safeSetInput, stripSuppressedProps, styleKeyToKebab, withContextSlots };
3889
3965
  //# sourceMappingURL=vectoriox-iox-ui.mjs.map