@vectoriox/iox-ui 4.15.0 → 4.16.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.
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { AfterViewInit, EventEmitter, ElementRef, SimpleChanges, OnDestroy, OnInit, Renderer2, ModuleWithProviders, InjectionToken, ChangeDetectorRef, ViewContainerRef, Type } from '@angular/core';
|
|
2
|
+
import { AfterViewInit, EventEmitter, ElementRef, SimpleChanges, OnDestroy, OnInit, Renderer2, ModuleWithProviders, InjectionToken, ChangeDetectorRef, ViewContainerRef, OnChanges, Type } from '@angular/core';
|
|
3
3
|
import { AnimationPlayer, AnimationBuilder } from '@angular/animations';
|
|
4
4
|
import { Observable, Subject } from 'rxjs';
|
|
5
5
|
import * as i3 from '@angular/platform-browser/animations';
|
|
@@ -590,9 +590,84 @@ declare class ClientListItemComponent {
|
|
|
590
590
|
static ɵcmp: i0.ɵɵComponentDeclaration<ClientListItemComponent, "li[iox-list-item]", never, { "nodeId": { "alias": "nodeId"; "required": false; }; }, {}, never, never, false, never>;
|
|
591
591
|
}
|
|
592
592
|
|
|
593
|
+
/** One manual gallery entry. Exactly one of `url` / `binding` is the source; `binding` wins when set. */
|
|
594
|
+
interface GalleryImage {
|
|
595
|
+
/** Manual URL or filebox-picked media URL. Ignored when `binding` is set. */
|
|
596
|
+
url?: string;
|
|
597
|
+
/** Per-item binding path, resolved against the render context (e.g. `product.hero.url`). */
|
|
598
|
+
binding?: string;
|
|
599
|
+
/** Optional alt text. */
|
|
600
|
+
alt?: string;
|
|
601
|
+
}
|
|
602
|
+
/** Bound-mode input: the resolved records + which field of each record holds the image URL. */
|
|
603
|
+
interface GalleryBoundSource {
|
|
604
|
+
items: any[];
|
|
605
|
+
/** Path into each record for the URL. Empty/undefined → the record itself is treated as the URL. */
|
|
606
|
+
imageField?: string;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Resolve a gallery's configured images to the flat, display-ready `string[]` the loop renders.
|
|
610
|
+
* Pure. Empty/whitespace URLs are dropped so a half-filled manual list never yields blank frames.
|
|
611
|
+
*
|
|
612
|
+
* @param images manual `GalleryImage[]` (manual mode). Ignored when `bound` is provided.
|
|
613
|
+
* @param bound bound-mode records + image field. When present, takes precedence over `images`.
|
|
614
|
+
* @param ctx render context for per-item bindings (item/route data). Defaults to `{}`.
|
|
615
|
+
*/
|
|
616
|
+
declare function resolveGalleryUrls(images: GalleryImage[] | undefined, bound: GalleryBoundSource | null | undefined, ctx?: Record<string, any>): string[];
|
|
617
|
+
/**
|
|
618
|
+
* Parse a pasted block of URLs (newline- and/or comma-separated) into `GalleryImage[]`. Used by the
|
|
619
|
+
* MediaList trait editor's "paste URL list" affordance. Pure so it can be unit-tested + reused.
|
|
620
|
+
*/
|
|
621
|
+
declare function parseUrlList(text: string): GalleryImage[];
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* `iox-gallery` — the engine/runtime twin of the Gallery builder component (the builder twin
|
|
625
|
+
* `app-builder-gallery` arrives in Phase 2). It runs the SHARED crossfade loop + effect registry from
|
|
626
|
+
* `@vectoriox/iox-ui`, so the fade behaves identically on the canvas and the live site — no forked
|
|
627
|
+
* animation logic. See iox-ai-guidance/architecture/builder/gallery-component-plan.md.
|
|
628
|
+
*
|
|
629
|
+
* Population: v1 drives the loop from the `images` input (manual mode). Data-source binding
|
|
630
|
+
* (`source`/`sourcePath`) is Phase 3 — this component already resolves through `resolveGalleryUrls`,
|
|
631
|
+
* so that only adds a bound-source input, not new render logic.
|
|
632
|
+
*
|
|
633
|
+
* SSR / no-JS: on the server the loop never starts, so the **first image renders visible** as a static
|
|
634
|
+
* frame (SEO + no-JS baseline). In the browser `ngAfterViewInit` starts the loop, which begins on the
|
|
635
|
+
* same index 0 — so the static frame and the first live frame match and there is no hydration flash.
|
|
636
|
+
*/
|
|
637
|
+
declare class ClientGalleryComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
638
|
+
private cdr;
|
|
639
|
+
nodeId: string;
|
|
640
|
+
/** Manual images — `GalleryImage[]` or a plain `string[]` of URLs (normalised on set). */
|
|
641
|
+
images: (GalleryImage | string)[];
|
|
642
|
+
effect: string;
|
|
643
|
+
showDuration: number;
|
|
644
|
+
fadeDuration: number;
|
|
645
|
+
autoStart: boolean;
|
|
646
|
+
/** Layout mode — only `'stack'` is rendered in v1 (`'grid'` scaffolded for later). */
|
|
647
|
+
layout: 'stack' | 'grid';
|
|
648
|
+
/** The flat, display-ready URLs the loop cycles. Recomputed when `images` changes. */
|
|
649
|
+
urls: string[];
|
|
650
|
+
private currentIndex;
|
|
651
|
+
private fadingOutIndex;
|
|
652
|
+
private started;
|
|
653
|
+
private loop;
|
|
654
|
+
private readonly isBrowser;
|
|
655
|
+
constructor(platformId: object, cdr: ChangeDetectorRef);
|
|
656
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
657
|
+
ngAfterViewInit(): void;
|
|
658
|
+
ngOnDestroy(): void;
|
|
659
|
+
/** Per-slide inline style. Before the loop activates (server + no-JS + pre-first-frame) the first
|
|
660
|
+
* image is the visible static frame; once running, the effect owns each slide's look. */
|
|
661
|
+
slideStyle(i: number): Record<string, string>;
|
|
662
|
+
private startLoop;
|
|
663
|
+
private normalizeImages;
|
|
664
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClientGalleryComponent, never>;
|
|
665
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ClientGalleryComponent, "iox-gallery", never, { "nodeId": { "alias": "nodeId"; "required": false; }; "images": { "alias": "images"; "required": false; }; "effect": { "alias": "effect"; "required": false; }; "showDuration": { "alias": "showDuration"; "required": false; }; "fadeDuration": { "alias": "fadeDuration"; "required": false; }; "autoStart": { "alias": "autoStart"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; }, {}, never, never, false, never>;
|
|
666
|
+
}
|
|
667
|
+
|
|
593
668
|
declare class IoxBuilderComponentsModule {
|
|
594
669
|
static ɵfac: i0.ɵɵFactoryDeclaration<IoxBuilderComponentsModule, never>;
|
|
595
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<IoxBuilderComponentsModule, [typeof BuilderImageComponent, typeof BuilderSpacerComponent, typeof CardComponent, typeof BuilderDividerComponent, typeof BuilderIconComponent, typeof BuilderLinkComponent, typeof BuilderButtonComponent, typeof BuilderHeadingComponent, typeof TextBlockComponent, typeof SectionComponent, typeof ContainerComponent, typeof LinkedContainerComponent, typeof ClientRepeaterComponent, typeof ButtonBlockComponent, typeof ClientSliderContainerComponent, typeof ClientSliderSlideComponent, typeof ClientListComponent, typeof ClientListItemComponent], [typeof i2.CommonModule], [typeof BuilderImageComponent, typeof BuilderSpacerComponent, typeof CardComponent, typeof BuilderDividerComponent, typeof BuilderIconComponent, typeof BuilderLinkComponent, typeof BuilderButtonComponent, typeof BuilderHeadingComponent, typeof TextBlockComponent, typeof SectionComponent, typeof ContainerComponent, typeof LinkedContainerComponent, typeof ClientRepeaterComponent, typeof ButtonBlockComponent, typeof ClientSliderContainerComponent, typeof ClientSliderSlideComponent, typeof ClientListComponent, typeof ClientListItemComponent]>;
|
|
670
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<IoxBuilderComponentsModule, [typeof BuilderImageComponent, typeof BuilderSpacerComponent, typeof CardComponent, typeof BuilderDividerComponent, typeof BuilderIconComponent, typeof BuilderLinkComponent, typeof BuilderButtonComponent, typeof BuilderHeadingComponent, typeof TextBlockComponent, typeof SectionComponent, typeof ContainerComponent, typeof LinkedContainerComponent, typeof ClientRepeaterComponent, typeof ButtonBlockComponent, typeof ClientSliderContainerComponent, typeof ClientSliderSlideComponent, typeof ClientListComponent, typeof ClientListItemComponent, typeof ClientGalleryComponent], [typeof i2.CommonModule], [typeof BuilderImageComponent, typeof BuilderSpacerComponent, typeof CardComponent, typeof BuilderDividerComponent, typeof BuilderIconComponent, typeof BuilderLinkComponent, typeof BuilderButtonComponent, typeof BuilderHeadingComponent, typeof TextBlockComponent, typeof SectionComponent, typeof ContainerComponent, typeof LinkedContainerComponent, typeof ClientRepeaterComponent, typeof ButtonBlockComponent, typeof ClientSliderContainerComponent, typeof ClientSliderSlideComponent, typeof ClientListComponent, typeof ClientListItemComponent, typeof ClientGalleryComponent]>;
|
|
596
671
|
static ɵinj: i0.ɵɵInjectorDeclaration<IoxBuilderComponentsModule>;
|
|
597
672
|
}
|
|
598
673
|
|
|
@@ -1218,5 +1293,121 @@ declare function effectiveTransitionId(anim: {
|
|
|
1218
1293
|
enter?: string | null;
|
|
1219
1294
|
} | null | undefined): string;
|
|
1220
1295
|
|
|
1221
|
-
|
|
1222
|
-
|
|
1296
|
+
/**
|
|
1297
|
+
* Gallery effect registry — the SHARED, effect-agnostic description of how each gallery slide looks
|
|
1298
|
+
* and animates in a given crossfade state. Modeled on `binding-pipes.ts` / `PAGE_TRANSITION_PRESETS`:
|
|
1299
|
+
* a descriptor map + a resolve fn, all pure, consumed by BOTH the builder twin and the engine twin so
|
|
1300
|
+
* the fade looks identical on the canvas and the live site.
|
|
1301
|
+
*
|
|
1302
|
+
* v1 ships only `fade` (the look ported from `sites/interior-design` fade-gallery). Adding `slide`,
|
|
1303
|
+
* `zoom`, `kenburns`, … later is a new entry here + its CSS — NO component refactor, because the
|
|
1304
|
+
* component only ever asks `resolveGalleryEffect(id).buildSlideStyle(state)` for per-slide inline CSS.
|
|
1305
|
+
*
|
|
1306
|
+
* See iox-ai-guidance/architecture/builder/gallery-component-plan.md.
|
|
1307
|
+
*/
|
|
1308
|
+
/** Timing knobs for one running gallery. Overridable per-node via traits; defaults live per effect. */
|
|
1309
|
+
interface GalleryDurations {
|
|
1310
|
+
/** ms an image is held fully visible before the next crossfade begins. */
|
|
1311
|
+
showMs: number;
|
|
1312
|
+
/** ms the opacity crossfade takes. */
|
|
1313
|
+
fadeMs: number;
|
|
1314
|
+
}
|
|
1315
|
+
/** The state of a single slide at render time, from which an effect derives its inline CSS. */
|
|
1316
|
+
interface GallerySlideState {
|
|
1317
|
+
/** This slide is the current (incoming/visible) one. */
|
|
1318
|
+
active: boolean;
|
|
1319
|
+
/** This slide is the outgoing one, mid-crossfade. */
|
|
1320
|
+
fadingOut: boolean;
|
|
1321
|
+
/** The loop has completed its first activation RAF (used to suppress the initial transition flash). */
|
|
1322
|
+
firstCycleActive: boolean;
|
|
1323
|
+
durations: GalleryDurations;
|
|
1324
|
+
}
|
|
1325
|
+
interface GalleryEffect {
|
|
1326
|
+
id: string;
|
|
1327
|
+
/** Default English label; consumers may map `id` to their own i18n key. */
|
|
1328
|
+
label: string;
|
|
1329
|
+
/** Default timing for this effect; a node's traits may override either value. */
|
|
1330
|
+
defaults: GalleryDurations;
|
|
1331
|
+
/** Inline style map for one slide in the given state. Pure — no DOM, no side effects. */
|
|
1332
|
+
buildSlideStyle(state: GallerySlideState): Record<string, string>;
|
|
1333
|
+
}
|
|
1334
|
+
/** The registry — one entry per effect. Keyed by id; unknown ids fall back to `fade`. */
|
|
1335
|
+
declare const GALLERY_EFFECTS: Record<string, GalleryEffect>;
|
|
1336
|
+
/** Resolve an effect id to its descriptor, defaulting to `fade` (forward-compatible with new ids). */
|
|
1337
|
+
declare function resolveGalleryEffect(id: string | undefined | null): GalleryEffect;
|
|
1338
|
+
/** Metadata that DATA-DRIVES the authoring UI's effect dropdown (no per-effect if-chains). */
|
|
1339
|
+
interface GalleryEffectDescriptor {
|
|
1340
|
+
id: string;
|
|
1341
|
+
label: string;
|
|
1342
|
+
}
|
|
1343
|
+
declare const GALLERY_EFFECT_DESCRIPTORS: GalleryEffectDescriptor[];
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* Gallery crossfade loop — the SHARED, framework-free state machine that drives which image is
|
|
1347
|
+
* visible over time. Ported from the reference fade-gallery's `scheduleCycle` / `tryStartLoop` /
|
|
1348
|
+
* first-cycle-activation logic, with Angular specifics removed so BOTH the builder twin and the
|
|
1349
|
+
* engine/runtime twin (`iox-gallery`) run ONE implementation — never a forked copy that drifts.
|
|
1350
|
+
*
|
|
1351
|
+
* The loop owns only *timing + index* state and emits it through `onChange`; the component maps that
|
|
1352
|
+
* state to CSS via the effect registry (`gallery-effects.ts`). Timers are injected so the loop is
|
|
1353
|
+
* deterministic under fake timers in tests and platform-guardable in the engine.
|
|
1354
|
+
*
|
|
1355
|
+
* See iox-ai-guidance/architecture/builder/gallery-component-plan.md.
|
|
1356
|
+
*/
|
|
1357
|
+
/** The observable state of a running loop. */
|
|
1358
|
+
interface GalleryLoopState {
|
|
1359
|
+
/** Index of the current (incoming/visible) image. */
|
|
1360
|
+
currentIndex: number;
|
|
1361
|
+
/** Index of the outgoing image mid-crossfade, or null when settled. */
|
|
1362
|
+
fadingOutIndex: number | null;
|
|
1363
|
+
/**
|
|
1364
|
+
* True once the loop has completed its initial activation tick. Slides render flat + instant until
|
|
1365
|
+
* this flips, so the first paint doesn't flash a transition (matches the reference gallery).
|
|
1366
|
+
*/
|
|
1367
|
+
firstCycleActive: boolean;
|
|
1368
|
+
}
|
|
1369
|
+
/** Injectable timer surface — real timers in production, fake in tests, no-op RAF on the server. */
|
|
1370
|
+
interface GalleryLoopScheduler {
|
|
1371
|
+
setTimer(fn: () => void, ms: number): any;
|
|
1372
|
+
clearTimer(handle: any): void;
|
|
1373
|
+
/** Schedule a callback for "next frame". The engine/tests may implement this as a microtask/timeout. */
|
|
1374
|
+
nextFrame(fn: () => void): any;
|
|
1375
|
+
cancelFrame(handle: any): void;
|
|
1376
|
+
}
|
|
1377
|
+
/** Default scheduler over the platform's `setTimeout` / `requestAnimationFrame` (with a timer fallback). */
|
|
1378
|
+
declare const DEFAULT_GALLERY_SCHEDULER: GalleryLoopScheduler;
|
|
1379
|
+
interface GalleryLoopOptions {
|
|
1380
|
+
showMs: number;
|
|
1381
|
+
fadeMs: number;
|
|
1382
|
+
onChange: (state: GalleryLoopState) => void;
|
|
1383
|
+
scheduler?: GalleryLoopScheduler;
|
|
1384
|
+
}
|
|
1385
|
+
declare class GalleryLoop {
|
|
1386
|
+
private readonly scheduler;
|
|
1387
|
+
private showMs;
|
|
1388
|
+
private fadeMs;
|
|
1389
|
+
private readonly onChange;
|
|
1390
|
+
private count;
|
|
1391
|
+
private currentIndex;
|
|
1392
|
+
private fadingOutIndex;
|
|
1393
|
+
private firstCycleActive;
|
|
1394
|
+
private cycleTimer;
|
|
1395
|
+
private fadeTimer;
|
|
1396
|
+
private frameHandle;
|
|
1397
|
+
/** Bumped on every (re)start so a stale timer callback from a previous run is ignored. */
|
|
1398
|
+
private runToken;
|
|
1399
|
+
private running;
|
|
1400
|
+
constructor(opts: GalleryLoopOptions);
|
|
1401
|
+
get state(): GalleryLoopState;
|
|
1402
|
+
/** Start (or restart) the loop for `count` images. A count < 2 shows the single image without cycling. */
|
|
1403
|
+
start(count: number): void;
|
|
1404
|
+
/** Update timing live. Takes effect on the next scheduled cycle; does not restart the loop. */
|
|
1405
|
+
setDurations(showMs: number, fadeMs: number): void;
|
|
1406
|
+
/** Stop and clear all timers. Idempotent. State is retained (call `start` to reset). */
|
|
1407
|
+
stop(): void;
|
|
1408
|
+
private scheduleCycle;
|
|
1409
|
+
private emit;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
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 };
|
|
1413
|
+
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, TransitionFeel, TransitionPhase, TransitionTimelineInput };
|