@vectoriox/iox-builder 2.10.4 → 2.12.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-builder",
3
- "version": "2.10.4",
3
+ "version": "2.12.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { ComponentRef, Type, ChangeDetectorRef, OnInit, AfterViewInit, OnChanges, OnDestroy, EventEmitter, ElementRef, ApplicationRef, SimpleChanges, ViewContainerRef, Injector, EnvironmentInjector, InjectionToken, TemplateRef, AfterContentInit, QueryList } from '@angular/core';
3
3
  import * as i28 from '@vectoriox/iox-ui';
4
4
  import { RelativeSourceSpec, DataSourceEndpoints } from '@vectoriox/iox-ui';
5
- export { ComponentInstanceRegistryService, VIRTUAL_TRAIT_KEYS, composeVirtualTraits } from '@vectoriox/iox-ui';
5
+ export { ComponentInstanceRegistryService, IoxContextSlot, SetContextParams, VIRTUAL_TRAIT_KEYS, composeVirtualTraits } from '@vectoriox/iox-ui';
6
6
  import * as rxjs from 'rxjs';
7
7
  import { Subject, Subscription, BehaviorSubject, Observable } from 'rxjs';
8
8
  import * as _vectoriox_iox_builder from '@vectoriox/iox-builder';
@@ -119,8 +119,9 @@ interface IoxDataSource {
119
119
  params?: Record<string, any>;
120
120
  };
121
121
  }
122
+
122
123
  type InteractionTrigger = 'pageLoad' | 'click' | 'hover' | 'viewportEnter' | 'scrollProgress' | 'pageLeave' | 'pageEnter' | 'swiperSlideChange' | 'swiperReachBeginning' | 'swiperReachEnd' | 'swiperAutoplayStart' | 'swiperAutoplayStop' | 'swiperSlideActive' | 'swiperSlideInactive';
123
- type InteractionActionType = 'fadeIn' | 'fadeOut' | 'moveUp' | 'moveDown' | 'moveLeft' | 'moveRight' | 'scaleIn' | 'scaleOut' | 'rotate' | 'show' | 'hide' | 'toggleVisibility' | 'swiperNext' | 'swiperPrev' | 'swiperGoToSlide' | 'swiperAutoplayStart' | 'swiperAutoplayStop' | 'swiperAutoplayPause';
124
+ type InteractionActionType = 'fadeIn' | 'fadeOut' | 'moveUp' | 'moveDown' | 'moveLeft' | 'moveRight' | 'scaleIn' | 'scaleOut' | 'rotate' | 'show' | 'hide' | 'toggleVisibility' | 'setContext' | 'clearContext' | 'swiperNext' | 'swiperPrev' | 'swiperGoToSlide' | 'swiperAutoplayStart' | 'swiperAutoplayStop' | 'swiperAutoplayPause';
124
125
  interface InteractionAction {
125
126
  type: InteractionActionType;
126
127
  /** 'self' targets the node that owns the interaction; otherwise a node ID. */
@@ -130,7 +131,12 @@ interface InteractionAction {
130
131
  /** Delay in milliseconds before the action starts. */
131
132
  delay: number;
132
133
  easing: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out';
133
- /** Extra parameters (e.g. { distance: 20 } for move actions). */
134
+ /**
135
+ * Extra parameters — `{ distance: 20 }` for move actions. For `setContext`/`clearContext` this
136
+ * holds a `SetContextParams` (`{ slot, value, noReverse? }`), read structurally by the shared
137
+ * `contextActionEffect` in @vectoriox/iox-ui. Kept as an index signature because animation
138
+ * actions access it by key (`params?.['degrees']`).
139
+ */
134
140
  params?: Record<string, any>;
135
141
  /** If true, the action only plays once (relevant for viewport/scroll triggers). */
136
142
  once?: boolean;
@@ -1071,6 +1077,10 @@ declare class DataSourceRegistryService {
1071
1077
  declare class InteractionEngineService {
1072
1078
  private overlayService;
1073
1079
  private attached;
1080
+ /** Shared with the SSR engine — one store type, one set of semantics. */
1081
+ private contextStore;
1082
+ /** Resolved data for the canvas, so a row marker (source + index) resolves back to its item. */
1083
+ private contextData;
1074
1084
  /** Elements that have had pre-state applied (hidden by attach). */
1075
1085
  private preStatedElements;
1076
1086
  /**
@@ -1137,6 +1147,16 @@ declare class InteractionEngineService {
1137
1147
  private attachClick;
1138
1148
  private attachHover;
1139
1149
  private runActions;
1150
+ /**
1151
+ * Execute a context action against the shared store. The forward/reverse semantics come from
1152
+ * `contextActionEffect` in @vectoriox/iox-ui — the same function the SSR engine calls, so the
1153
+ * builder canvas and the live site behave identically.
1154
+ */
1155
+ private applyContextAction;
1156
+ /** The repeater item this element belongs to — the nearest marked row ancestor. */
1157
+ private rowItemFor;
1158
+ /** Resolved data for the canvas, kept current by the repeater as it fetches. */
1159
+ setContextData(data: Record<string, any>): void;
1140
1160
  private executeSwiperAction;
1141
1161
  private resolveTarget;
1142
1162
  private executeAction;
@@ -1262,6 +1282,15 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1262
1282
  private appRef;
1263
1283
  private moveableCanvas;
1264
1284
  private selectoCanvas;
1285
+ private contextStore;
1286
+ /**
1287
+ * Re-apply context-bound inputs on the CANVAS when a slot changes — the builder twin of the
1288
+ * engine's effect. The canvas is a live runtime, so hovering a repeater row while editing must
1289
+ * swap the bound element just as it does on the published site.
1290
+ *
1291
+ * Only nodes that read a slot are touched; nothing else re-renders (trap T2).
1292
+ */
1293
+ private readonly contextEffect;
1265
1294
  layout: ComponentNode[];
1266
1295
  dataSources: IoxDataSource[];
1267
1296
  orgId: string;
@@ -1362,6 +1391,12 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1362
1391
  ngOnInit(): void;
1363
1392
  ngOnChanges(changes: SimpleChanges): void;
1364
1393
  ngAfterViewInit(): void;
1394
+ /**
1395
+ * Walk the tree and push freshly-resolved values into the live component instances of every node
1396
+ * that reads a context slot. Uses the overlay's node→ComponentRef registry, and the shared
1397
+ * `safeSetInput` so an undeclared input can never trigger NG0303.
1398
+ */
1399
+ private applyContextBindings;
1365
1400
  ngOnDestroy(): void;
1366
1401
  /**
1367
1402
  * Cancel the browser's default navigation for any link clicked on the editing canvas.
@@ -1900,6 +1935,7 @@ declare class BuilderRepeaterComponent implements OnInit, OnDestroy {
1900
1935
  private dsRegistry;
1901
1936
  private panelEventService;
1902
1937
  private cdr;
1938
+ private interactionEngine;
1903
1939
  private _children;
1904
1940
  get children(): ComponentNode[];
1905
1941
  /** RenderDirective sets `source` (→ fetchData) BEFORE `children`. With an async source the response
@@ -1931,7 +1967,7 @@ declare class BuilderRepeaterComponent implements OnInit, OnDestroy {
1931
1967
  set sourcePath(value: string);
1932
1968
  get limit(): number;
1933
1969
  set limit(value: number);
1934
- constructor(dragEngine: DragEngineService, overlayService: OverlayService, dataSourceService: BuilderDataSourceService, dsRegistry: DataSourceRegistryService, panelEventService: PanelEventService, cdr: ChangeDetectorRef);
1970
+ constructor(dragEngine: DragEngineService, overlayService: OverlayService, dataSourceService: BuilderDataSourceService, dsRegistry: DataSourceRegistryService, panelEventService: PanelEventService, cdr: ChangeDetectorRef, interactionEngine: InteractionEngineService);
1935
1971
  ngOnInit(): void;
1936
1972
  ngOnDestroy(): void;
1937
1973
  onDrop(event: IoxDropEvent): void;
@@ -2220,6 +2256,15 @@ declare class InteractionsPanelComponent implements OnInit, OnDestroy {
2220
2256
  label: string;
2221
2257
  value: string;
2222
2258
  }[];
2259
+ /** Slot names already used anywhere on the canvas — offered as suggestions, not a closed list.
2260
+ * A slot needs no declaration to work: naming it in a setContext action creates it. */
2261
+ knownSlots: string[];
2262
+ /** Data-source aliases, for the "Pick a value…" mode. */
2263
+ sourceOptions: {
2264
+ label: string;
2265
+ value: string;
2266
+ }[];
2267
+ private dsRegistry;
2223
2268
  /** State for the "add interaction" form */
2224
2269
  isAdding: boolean;
2225
2270
  newTrigger: InteractionTrigger;
@@ -2254,6 +2299,25 @@ declare class InteractionsPanelComponent implements OnInit, OnDestroy {
2254
2299
  removeInteraction(id: string): void;
2255
2300
  addAction(interaction: IoxInteraction): void;
2256
2301
  removeAction(interaction: IoxInteraction, index: number): void;
2302
+ /** True for setContext/clearContext — they get a slot editor instead of a target + easing. */
2303
+ isContextAction(action: InteractionAction): boolean;
2304
+ private ctxParams;
2305
+ slotOf(action: InteractionAction): string;
2306
+ setSlot(action: InteractionAction, slot: string): void;
2307
+ valueKindOf(action: InteractionAction): string;
2308
+ setValueKind(action: InteractionAction, kind: string): void;
2309
+ valueSourceOf(action: InteractionAction): string;
2310
+ setValueSource(action: InteractionAction, source: string): void;
2311
+ valuePathOf(action: InteractionAction): string;
2312
+ setValuePath(action: InteractionAction, path: string): void;
2313
+ /**
2314
+ * "Keep after leave" — ON means the slot survives mouseleave (stored as `noReverse`).
2315
+ * Defaults to ON: a repeater row that cleared itself on leave would blink on every row-to-row
2316
+ * move. Turning it OFF is the list-container behaviour (leave clears).
2317
+ */
2318
+ keepAfterLeave(action: InteractionAction): boolean;
2319
+ setKeepAfterLeave(action: InteractionAction, keep: boolean): void;
2320
+ private refreshKnownSlots;
2257
2321
  hasToggle(interaction: IoxInteraction): boolean;
2258
2322
  enableToggle(interaction: IoxInteraction): void;
2259
2323
  disableToggle(interaction: IoxInteraction): void;