@vectoriox/iox-ui 4.17.3 → 4.18.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-ui",
3
- "version": "4.17.3",
3
+ "version": "4.18.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -1222,6 +1222,174 @@ declare function declaredInputNames(type: Type<unknown>): Set<string>;
1222
1222
  */
1223
1223
  declare function safeSetInput(ref: ComponentRef<unknown>, name: string, value: unknown): boolean;
1224
1224
 
1225
+ /**
1226
+ * THE binding path resolver — one implementation, shared by every renderer.
1227
+ *
1228
+ * Resolves a dot-notation path with optional array brackets against a data object:
1229
+ * `title`, `author.name`, `tags[0]`, `items[2].title`.
1230
+ *
1231
+ * This lived in three places before (iox-builder's binding-path.util, the engine's string
1232
+ * renderer, and the engine's component renderer) and had already drifted: the component-renderer
1233
+ * copy was missing the `$` case below, so a repeater over a primitive array rendered in the SSR
1234
+ * HTML and then blanked on hydration. See render-parity.md.
1235
+ */
1236
+ declare function resolvePath(obj: any, path: string): any;
1237
+
1238
+ /**
1239
+ * Element context state — shared types.
1240
+ *
1241
+ * A **context slot** is a data-source alias whose value is WRITTEN at runtime (by an interaction)
1242
+ * instead of fetched. That is the whole trick: bindings need no new grammar, because a slot is just
1243
+ * another key in the `resolvedData` map both renderers already resolve against.
1244
+ *
1245
+ * See architecture/builder/element-context-state-plan.md.
1246
+ */
1247
+ /** How a slot behaves before anyone has interacted with the page. */
1248
+ type ContextSlotDefault =
1249
+ /** Empty until an interaction fills it. The preview is hidden by CSS until then. */
1250
+ 'none'
1251
+ /** Pre-filled with the first item of `source`, so the page is never empty. */
1252
+ | 'first';
1253
+ /** Declared on the PAGE — always page-level, never promoted to the org library. */
1254
+ interface IoxContextSlot {
1255
+ /**
1256
+ * The bindable alias, e.g. `currentItem`. Shares the page's data-source alias namespace, so it
1257
+ * must be unique among sources AND slots, and must not start with `$` (reserved for system
1258
+ * aliases).
1259
+ */
1260
+ key: string;
1261
+ /** The data-source alias whose items this slot holds. Types the slot for the bind picker. */
1262
+ source: string;
1263
+ /** Defaults to `'none'`. */
1264
+ default?: ContextSlotDefault;
1265
+ }
1266
+ /**
1267
+ * What a `setContext` action writes. Three shapes, one for each way an element can know a value.
1268
+ */
1269
+ type ContextValueSpec =
1270
+ /** `$item` — the row's own item, read from the enclosing loop scope. Configured once. */
1271
+ {
1272
+ kind: 'item';
1273
+ }
1274
+ /** An explicit source + path, for a standalone element that is not inside a loop. */
1275
+ | {
1276
+ kind: 'source';
1277
+ source: string;
1278
+ path?: string;
1279
+ }
1280
+ /** A fixed value. */
1281
+ | {
1282
+ kind: 'literal';
1283
+ value: unknown;
1284
+ };
1285
+ /** The parameters of a `setContext` interaction action. */
1286
+ interface SetContextParams {
1287
+ /** Which slot to write. */
1288
+ slot: string;
1289
+ /** What to write into it. */
1290
+ value: ContextValueSpec;
1291
+ /**
1292
+ * When true this action does NOT auto-reverse on `mouseleave`.
1293
+ *
1294
+ * `hover` binds both ends and runs actions reversed on leave, which is what we want on a LIST
1295
+ * container (leave → clear) and exactly what we do NOT want on a row: a row clearing itself on
1296
+ * its own leave makes every row-to-row move flicker. Rows set this; container clears don't.
1297
+ */
1298
+ noReverse?: boolean;
1299
+ }
1300
+ /** Where a slot's value came from — stored as a reference, never a snapshot copy. */
1301
+ interface ContextItemRef {
1302
+ /** The source alias the item belongs to. */
1303
+ source: string;
1304
+ /** Position in the resolved array — the O(1) read path. */
1305
+ index: number;
1306
+ /** Optional stable id, used only to repair the index if the collection re-fetched or reordered. */
1307
+ id?: string;
1308
+ }
1309
+
1310
+ /**
1311
+ * Pure context resolution — no Angular, no transport. Shared by the builder canvas and the SSR
1312
+ * engine so a slot behaves identically in both. See element-context-state-plan.md.
1313
+ */
1314
+ /** What an interaction knows at the moment it fires. */
1315
+ interface ContextWriteScope {
1316
+ /** The enclosing loop's item, when the element sits inside a repeater/slider row. */
1317
+ item?: unknown;
1318
+ /** The page's resolved data, for `{ kind: 'source' }` specs. */
1319
+ resolvedData?: Record<string, unknown>;
1320
+ }
1321
+ /**
1322
+ * Turn a `setContext` value spec into the value to store.
1323
+ *
1324
+ * Returns `undefined` when the spec cannot be satisfied (e.g. `$item` on an element that is not in
1325
+ * a loop), which the store treats as "don't write" rather than "write empty".
1326
+ */
1327
+ declare function resolveContextValue(spec: ContextValueSpec | undefined, scope?: ContextWriteScope): unknown;
1328
+ /**
1329
+ * The value each slot holds before any interaction.
1330
+ *
1331
+ * `'first'` pre-fills from the resolved source so the page is never empty; `'none'` (the default)
1332
+ * leaves the key ABSENT — not set to undefined — so `resolvedData` looks exactly as it does for a
1333
+ * source that returned nothing, and bindings simply don't resolve.
1334
+ */
1335
+ declare function initialSlotValues(slots: readonly IoxContextSlot[] | undefined, resolvedData?: Record<string, unknown>): Record<string, unknown>;
1336
+ /**
1337
+ * Merge live slot values over the page's resolved data, producing the map bindings resolve against.
1338
+ *
1339
+ * Slot keys share the data-source namespace, so a slot deliberately shadows a source of the same
1340
+ * name — the same way a repeater row shadows its own source alias with the single item.
1341
+ */
1342
+ declare function withContextSlots(resolvedData: Record<string, unknown> | undefined, slotValues: Record<string, unknown> | undefined): Record<string, unknown>;
1343
+ /** The set of declared slot keys — what marks a binding as "live". */
1344
+ declare function contextSlotKeys(slots: readonly IoxContextSlot[] | undefined): Set<string>;
1345
+ /**
1346
+ * Does this node read a context slot? Nodes that do must be REGISTERED at render time and
1347
+ * re-applied when the store changes — they are the only ones whose props are not final after the
1348
+ * first render.
1349
+ */
1350
+ declare function nodeUsesContext(node: unknown, slotKeys: ReadonlySet<string>): boolean;
1351
+ /**
1352
+ * Is a slot key a legal user alias?
1353
+ *
1354
+ * Slots live in the page's data-source alias namespace, so uniqueness is the existing rule. The one
1355
+ * extra constraint is the reserved `$` prefix (system aliases — `$route`, `$current`, …).
1356
+ */
1357
+ declare function isValidSlotKey(key: string | undefined | null): boolean;
1358
+
1359
+ /**
1360
+ * The runtime context channel: named slots an interaction writes and bindings read.
1361
+ *
1362
+ * Signal-backed because writes are HOT — a hover fires on every row crossing. A write must cost a
1363
+ * signal set and re-apply one input on the registered nodes; it must never re-clone a repeater or
1364
+ * re-render the loop. See element-context-state-plan.md (trap T2).
1365
+ *
1366
+ * Provided in root and reset by the consumer on page navigation — slots are page-level state.
1367
+ */
1368
+ declare class ContextStore {
1369
+ private readonly _values;
1370
+ /** All live slot values. Merge over `resolvedData` with `withContextSlots` to resolve bindings. */
1371
+ readonly values: i0.Signal<Readonly<Record<string, unknown>>>;
1372
+ /** The keys currently holding a value — what the "is this slot populated?" CSS state keys off. */
1373
+ readonly populatedKeys: i0.Signal<Set<string>>;
1374
+ /**
1375
+ * Write a slot. An `undefined` value is IGNORED rather than stored: a spec that could not be
1376
+ * satisfied (e.g. `$item` outside a loop) must not silently blank a populated slot.
1377
+ */
1378
+ set(key: string, value: unknown): void;
1379
+ /** Remove a slot's value entirely, so the key is ABSENT (not undefined) for binding resolution. */
1380
+ clear(key: string): void;
1381
+ /** Drop every slot — call on page navigation; context is page-level state. */
1382
+ resetAll(): void;
1383
+ /** Seed the initial values (from `initialSlotValues`) without clobbering later writes. */
1384
+ seed(values: Record<string, unknown>): void;
1385
+ /** Non-reactive read — for imperative code that must not create a dependency. */
1386
+ peek(key: string): unknown;
1387
+ /** Whether a slot currently holds a value. */
1388
+ has(key: string): boolean;
1389
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContextStore, never>;
1390
+ static ɵprov: i0.ɵɵInjectableDeclaration<ContextStore>;
1391
+ }
1392
+
1225
1393
  /**
1226
1394
  * Cinematic page-transition presets — the SINGLE SOURCE OF TRUTH shared by the page builder
1227
1395
  * (preview) and the SSR client engine (production). Pure, transport-agnostic: this module only
@@ -1485,5 +1653,5 @@ declare class GalleryLoop {
1485
1653
  private emit;
1486
1654
  }
1487
1655
 
1488
- 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, declaredInputNames, effectiveTransitionId, excludeSelf, feelFor, getByPath, isReservedAlias, legacyEnterToTransition, matchRouteParams, nearestCommonAncestorId, nodeCssId, normalizeCollectionResult, parseUrlList, planDataSource, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, rewriteViewportUnits, safeSetInput, stripSuppressedProps, styleKeyToKebab };
1489
- export type { BuildRelatedFilterOptions, DataSourceDomain, DataSourceEndpoints, DataSourceMode, DataSourcePlan, DataSourceQueryFilter, DataSourceRequest, DataSourceRequestSpec, DataSourceRouteFilter, DataSourceSpec, GalleryBoundSource, GalleryDurations, GalleryEffect, GalleryEffectDescriptor, GalleryImage, GalleryLoopOptions, GalleryLoopScheduler, GalleryLoopState, GallerySlideState, IBuilderEventEmitter, IoxPipe, PageTransitionCategory, PageTransitionCategoryMeta, PageTransitionOptions, PageTransitionPreset, PipeArgSpec, PipeContext, PipeDescriptor, RelativeInputs, RelativeSourceKind, RelativeSourceSpec, ResolveSiblingsOptions, ResolvedPageTransition, RouteContext, SiblingsResult, StyleTreeNode, TransitionFeel, TransitionPhase, TransitionTimelineInput };
1656
+ 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 };
1657
+ export type { BuildRelatedFilterOptions, ContextItemRef, ContextSlotDefault, ContextValueSpec, ContextWriteScope, DataSourceDomain, DataSourceEndpoints, DataSourceMode, DataSourcePlan, DataSourceQueryFilter, DataSourceRequest, DataSourceRequestSpec, DataSourceRouteFilter, DataSourceSpec, GalleryBoundSource, GalleryDurations, GalleryEffect, GalleryEffectDescriptor, GalleryImage, GalleryLoopOptions, GalleryLoopScheduler, GalleryLoopState, GallerySlideState, IBuilderEventEmitter, IoxContextSlot, IoxPipe, PageTransitionCategory, PageTransitionCategoryMeta, PageTransitionOptions, PageTransitionPreset, PipeArgSpec, PipeContext, PipeDescriptor, RelativeInputs, RelativeSourceKind, RelativeSourceSpec, ResolveSiblingsOptions, ResolvedPageTransition, RouteContext, SetContextParams, SiblingsResult, StyleTreeNode, TransitionFeel, TransitionPhase, TransitionTimelineInput };