@vectoriox/iox-ui 4.20.0 → 4.21.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.
@@ -1913,10 +1913,38 @@ function planDataSource(ds, routeParams = {}, queryParams = {}) {
1913
1913
  const d = ds.request?.derived;
1914
1914
  return d?.from ? { kind: 'derived', from: d.from, path: d.path ?? '', mode } : { kind: 'none' };
1915
1915
  }
1916
+ case 'variable':
1917
+ // A VARIABLE is a page-local resource whose value is WRITTEN at runtime by an interaction
1918
+ // (setContext), never fetched. It resolves to nothing here on purpose: the page renders
1919
+ // its empty state until something writes it. `request.variable.itemsFrom` only names the
1920
+ // source whose items it holds, so the bind picker can suggest fields.
1921
+ return { kind: 'none' };
1916
1922
  default:
1917
1923
  return { kind: 'none' };
1918
1924
  }
1919
1925
  }
1926
+ /**
1927
+ * The aliases on a page that are VARIABLES — runtime-written resources, not fetched data.
1928
+ *
1929
+ * Shared so the builder and the SSR engine agree on which aliases start empty and are filled by
1930
+ * interactions. See element-context-state-plan.md.
1931
+ */
1932
+ function variableAliases(dataSources) {
1933
+ const out = new Set();
1934
+ for (const ds of dataSources ?? []) {
1935
+ if (ds?.type === 'variable' && ds.alias)
1936
+ out.add(ds.alias);
1937
+ }
1938
+ return out;
1939
+ }
1940
+ /** The source alias whose items a variable holds, if it declares one (for field suggestions). */
1941
+ function variableItemsFrom(dataSources, alias) {
1942
+ for (const ds of dataSources ?? []) {
1943
+ if (ds?.type === 'variable' && ds.alias === alias)
1944
+ return ds.request?.variable?.itemsFrom || undefined;
1945
+ }
1946
+ return undefined;
1947
+ }
1920
1948
  /**
1921
1949
  * Normalise a collection response into the shape a source expects: unwraps `{items}`/`{data}`
1922
1950
  * envelopes, then returns the first item for a `single` source or the whole array for a `list`.
@@ -3491,7 +3519,9 @@ function contextActionEffect(action, pass = 'forward') {
3491
3519
  * Union of declared + in-use, so a declared-but-unused slot still seeds its default, and a slot used
3492
3520
  * by a symbol dropped onto a page that never declared it still works (it just has no default).
3493
3521
  */
3494
- function collectContextSlotKeys(nodes, declared = []) {
3522
+ function collectContextSlotKeys(nodes,
3523
+ /** Declared VARIABLES — page resources of `type: 'variable'`, or legacy slot declarations. */
3524
+ declared = []) {
3495
3525
  const written = new Set();
3496
3526
  const read = new Set();
3497
3527
  walk(nodes, written, read);
@@ -3500,9 +3530,13 @@ function collectContextSlotKeys(nodes, declared = []) {
3500
3530
  for (const key of read)
3501
3531
  if (written.has(key))
3502
3532
  keys.add(key);
3503
- for (const slot of declared)
3504
- if (slot?.key)
3505
- keys.add(slot.key);
3533
+ for (const decl of declared) {
3534
+ // A declared variable (a data source of type 'variable') or a legacy IoxContextSlot.
3535
+ const key = decl?.key
3536
+ ?? (decl?.type === 'variable' ? decl.alias : undefined);
3537
+ if (key)
3538
+ keys.add(key);
3539
+ }
3506
3540
  return keys;
3507
3541
  }
3508
3542
  function walk(nodes, written, read) {
@@ -3961,5 +3995,5 @@ function effectiveTransitionId(anim) {
3961
3995
  * Generated bundle index. Do not edit.
3962
3996
  */
3963
3997
 
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 };
3998
+ 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, variableAliases, variableItemsFrom, withContextSlots };
3965
3999
  //# sourceMappingURL=vectoriox-iox-ui.mjs.map