@vectoriox/iox-ui 4.5.1 → 4.6.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.
@@ -2341,8 +2341,18 @@ function dataSourcePlanToRequest(plan, endpoints) {
2341
2341
  */
2342
2342
  /** Perspective (px) applied to the transition container unless a preset overrides it. */
2343
2343
  const DEFAULT_PAGE_TRANSITION_PERSPECTIVE = 1200;
2344
- /** Default transition duration (ms) when the page does not specify one. */
2345
- const DEFAULT_PAGE_TRANSITION_DURATION = 600;
2344
+ /**
2345
+ * Default transition duration (ms). Deliberately long — a slow, settled transition is most of what
2346
+ * makes a page change read as "premium"; the same motion at ~400ms feels like a snap.
2347
+ */
2348
+ const DEFAULT_PAGE_TRANSITION_DURATION = 1500;
2349
+ /**
2350
+ * Default easing: a strong symmetric in-out. Paired with the long duration this is the "smoothness"
2351
+ * — slow to leave, quick through the middle, gentle to settle.
2352
+ */
2353
+ const DEFAULT_PAGE_TRANSITION_EASING = 'cubic-bezier(0.76, 0, 0.24, 1)';
2354
+ /** Default preset used when a page has no transition configured at all. */
2355
+ const DEFAULT_PAGE_TRANSITION = 'parallax-up';
2346
2356
  // ── Keyframe helpers ────────────────────────────────────────────────────────
2347
2357
  const FADE_OUT = [{ opacity: 1 }, { opacity: 0 }];
2348
2358
  const FADE_IN = [{ opacity: 0 }, { opacity: 1 }];
@@ -2350,6 +2360,46 @@ const move = (from, to) => [{ transform: from }, { transform: to }];
2350
2360
  // ── The preset catalog ──────────────────────────────────────────────────────
2351
2361
  // Keyed by a stable preset id persisted in pageSettings.routeAnimation.transition.
2352
2362
  const PAGE_TRANSITION_PRESETS = {
2363
+ // ── Parallax (the default family) ──────────────────────────────────────────
2364
+ // The outgoing page travels only HALF the distance while shrinking and dimming, so it recedes
2365
+ // *behind* the incoming page rather than sliding away. That travel difference (50% vs 100%) is
2366
+ // what reads as depth — there is no 3D here at all. Pair with the long default duration.
2367
+ 'parallax-up': {
2368
+ category: 'parallax', label: 'Parallax up (recommended)',
2369
+ outKeyframes: [
2370
+ { transform: 'translateY(0) scale(1)', opacity: 1 },
2371
+ { transform: 'translateY(-50%) scale(0.8)', opacity: 0.4 },
2372
+ ],
2373
+ inKeyframes: move('translateY(100%)', 'translateY(0)'),
2374
+ ontop: 'in',
2375
+ },
2376
+ 'parallax-down': {
2377
+ category: 'parallax', label: 'Parallax down',
2378
+ outKeyframes: [
2379
+ { transform: 'translateY(0) scale(1)', opacity: 1 },
2380
+ { transform: 'translateY(50%) scale(0.8)', opacity: 0.4 },
2381
+ ],
2382
+ inKeyframes: move('translateY(-100%)', 'translateY(0)'),
2383
+ ontop: 'in',
2384
+ },
2385
+ 'parallax-left': {
2386
+ category: 'parallax', label: 'Parallax left',
2387
+ outKeyframes: [
2388
+ { transform: 'translateX(0) scale(1)', opacity: 1 },
2389
+ { transform: 'translateX(-50%) scale(0.8)', opacity: 0.4 },
2390
+ ],
2391
+ inKeyframes: move('translateX(100%)', 'translateX(0)'),
2392
+ ontop: 'in',
2393
+ },
2394
+ 'parallax-right': {
2395
+ category: 'parallax', label: 'Parallax right',
2396
+ outKeyframes: [
2397
+ { transform: 'translateX(0) scale(1)', opacity: 1 },
2398
+ { transform: 'translateX(50%) scale(0.8)', opacity: 0.4 },
2399
+ ],
2400
+ inKeyframes: move('translateX(-100%)', 'translateX(0)'),
2401
+ ontop: 'in',
2402
+ },
2353
2403
  // ── Move (both pages slide; no fade — the classic Codrops "move") ──────────
2354
2404
  'move-left': {
2355
2405
  category: 'move', label: 'Move left / from right',
@@ -2472,6 +2522,7 @@ const PAGE_TRANSITION_PRESETS = {
2472
2522
  /** Built from PAGE_TRANSITION_PRESETS so the two lists can never drift apart. */
2473
2523
  const PAGE_TRANSITION_CATEGORIES = (() => {
2474
2524
  const order = [
2525
+ { value: 'parallax', label: 'Smooth (parallax)' },
2475
2526
  { value: 'move', label: 'Move' },
2476
2527
  { value: 'fade', label: 'Fade' },
2477
2528
  { value: 'scale', label: 'Scale' },
@@ -2484,6 +2535,11 @@ const PAGE_TRANSITION_CATEGORIES = (() => {
2484
2535
  .map(([value, p]) => ({ value, label: p.label })),
2485
2536
  }));
2486
2537
  })();
2538
+ /** Coerce a possibly-string / invalid numeric setting to a usable finite, non-negative number. */
2539
+ function toFiniteNumber(value, fallback) {
2540
+ const n = typeof value === 'number' ? value : Number(value);
2541
+ return Number.isFinite(n) && n >= 0 ? n : fallback;
2542
+ }
2487
2543
  /**
2488
2544
  * Resolve a persisted preset id + timing into the two WAAPI animations the consumer runs.
2489
2545
  * Returns `null` for unknown / 'none' presets (caller should skip the transition).
@@ -2494,9 +2550,13 @@ function resolvePageTransition(name, opts = {}) {
2494
2550
  const preset = PAGE_TRANSITION_PRESETS[name];
2495
2551
  if (!preset)
2496
2552
  return null;
2497
- const duration = opts.duration ?? DEFAULT_PAGE_TRANSITION_DURATION;
2498
- const easing = opts.easing ?? 'ease';
2499
- const perspective = preset.perspective ?? opts.perspective ?? DEFAULT_PAGE_TRANSITION_PERSPECTIVE;
2553
+ // Builder numeric inputs persist as STRINGS (e.g. duration:"413"), and WAAPI throws on a
2554
+ // non-numeric `duration` — which silently kills the whole transition. Coerce defensively here,
2555
+ // the single point where these values become animation options, so every consumer is protected
2556
+ // and already-saved string data keeps working.
2557
+ const duration = toFiniteNumber(opts.duration, DEFAULT_PAGE_TRANSITION_DURATION);
2558
+ const easing = opts.easing || DEFAULT_PAGE_TRANSITION_EASING;
2559
+ const perspective = toFiniteNumber(preset.perspective ?? opts.perspective, DEFAULT_PAGE_TRANSITION_PERSPECTIVE);
2500
2560
  const clampRatio = (r) => Math.max(0, Math.min(1, r ?? 0));
2501
2561
  const outDelay = clampRatio(preset.outDelayRatio) * duration;
2502
2562
  const inDelay = clampRatio(preset.inDelayRatio) * duration;
@@ -2549,7 +2609,8 @@ function legacyEnterToTransition(enter) {
2549
2609
  case 'blurIn': return 'fade';
2550
2610
  case 'flip': return 'flip';
2551
2611
  case 'fade': return 'fade';
2552
- default: return 'fade';
2612
+ // Never configured (or an unrecognised value) → the default parallax transition.
2613
+ default: return DEFAULT_PAGE_TRANSITION;
2553
2614
  }
2554
2615
  }
2555
2616
  /**
@@ -2558,7 +2619,7 @@ function legacyEnterToTransition(enter) {
2558
2619
  */
2559
2620
  function effectiveTransitionId(anim) {
2560
2621
  if (!anim)
2561
- return 'fade';
2622
+ return DEFAULT_PAGE_TRANSITION;
2562
2623
  if (anim.transition)
2563
2624
  return anim.transition;
2564
2625
  return legacyEnterToTransition(anim.enter);
@@ -2572,5 +2633,5 @@ function effectiveTransitionId(anim) {
2572
2633
  * Generated bundle index. Do not edit.
2573
2634
  */
2574
2635
 
2575
- export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CardComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_WIDTH_BY_TYPE, ENVIRONMENT, IOX_BUILDER_EVENTS, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxPageComponent, IoxPageModule, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PageScrollProvider, PrivacyModalComponent, PrivacyModalService, PrivacyModelEvent, SectionComponent, TextBlockComponent, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, WebSettingsService, buildDataSourceFilter, buildTransitionTimeline, compileDeclarations, composeVirtualTraits, dataSourcePlanToRequest, effectiveTransitionId, legacyEnterToTransition, matchRouteParams, normalizeCollectionResult, planDataSource, renderDefaultDeclarations, resolvePageTransition, resolveSingleItemId, rewriteViewportUnits, styleKeyToKebab };
2636
+ export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CardComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_WIDTH_BY_TYPE, ENVIRONMENT, IOX_BUILDER_EVENTS, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxPageComponent, IoxPageModule, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PageScrollProvider, PrivacyModalComponent, PrivacyModalService, PrivacyModelEvent, SectionComponent, TextBlockComponent, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, WebSettingsService, buildDataSourceFilter, buildTransitionTimeline, compileDeclarations, composeVirtualTraits, dataSourcePlanToRequest, effectiveTransitionId, legacyEnterToTransition, matchRouteParams, normalizeCollectionResult, planDataSource, renderDefaultDeclarations, resolvePageTransition, resolveSingleItemId, rewriteViewportUnits, styleKeyToKebab };
2576
2637
  //# sourceMappingURL=vectoriox-iox-ui.mjs.map