@vectoriox/iox-ui 5.164.1 → 5.165.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.
@@ -8,7 +8,7 @@ import * as i1 from '@angular/common';
8
8
  import { CommonModule, isPlatformBrowser } from '@angular/common';
9
9
  import { SPEC_AXES, resolveDesignMotion, FILTER_FUNCTIONS, BACKDROP_FUNCTIONS, decomposeCssFunctions, FieldClass, HeaderAttribute, HeaderBehaviour, HeaderInk, OPENING_ATTRIBUTE, schemeOfClasses, schemeUnderBar, BRAND_NAME_ATTRIBUTE, MENU_ATTRIBUTES, menuDialogAttributes, menuButtonAttributes, headerAttributes, HeaderTrait, BRAND_ROLE, brandNameAttributes, REDUCED_ENTRANCE_MAX_MS, roleClass, preloaderWords, PreloaderKind, preloaderGraphemes, PRELOADER_EXIT_EASE, PRELOADER_CAP_MS, isFirstVisit, PRELOADER_ENTER_EASE, PreloaderExit, PRELOADER_MIN_SHOW_MS, preloaderLeaveAt, preloaderExitMotion, preloaderPercent, inkOnGround, writeFieldError } from '@vectoriox/iox-ui/design-core';
10
10
  export * from '@vectoriox/iox-ui/design-core';
11
- import { setPageScroller, pageScroller, SceneAttribute, SCENE_WAKE_EVENT, SCENE_REVEAL_DEFAULT, SceneRevealFrom, revealClipPath, playTextReveal, textRevealByOf, textRevealLookOf, ScrollActionKind, lightMotionWanted, scrubTextReveal, ScrollPlay, gentleFrames, SCENE_PHONE_MAX_WIDTH, normalizeParallaxDepth, normalizeParallaxPhone, parallaxShift, parallaxRest, parallaxFrames, PROGRESS_BAR_FRAMES, ParallaxPhone, outermostNodeOf, normalizeScrollRange, scrollPlayFor, ScrollRange } from '@vectoriox/iox-ui/scene-core';
11
+ import { setPageScroller, pageScroller, SceneAttribute, SCENE_WAKE_EVENT, SCENE_REVEAL_DEFAULT, SceneRevealFrom, revealClipPath, playTextReveal, textRevealByOf, textRevealLookOf, textRevealStaggerOf, ScrollActionKind, lightMotionWanted, scrubTextReveal, ScrollPlay, gentleFrames, SCENE_PHONE_MAX_WIDTH, normalizeParallaxDepth, normalizeParallaxPhone, parallaxShift, parallaxRest, parallaxFrames, PROGRESS_BAR_FRAMES, ParallaxPhone, outermostNodeOf, normalizeScrollRange, scrollPlayFor, ScrollRange } from '@vectoriox/iox-ui/scene-core';
12
12
  import Lenis from 'lenis';
13
13
  import { SLIDER_WORDS, sliderPartElement, SliderRole, sliderWords, attachCarouselA11y, attachSliderBar, isSliderPart, SceneRole, MARQUEE_NODE_ATTRIBUTES, POPUP_ATTRIBUTES, popupDialogAttributes, SLIDE_TYPE, SLIDE_CAPTION_TRAIT, marqueeRootAttributes, MarqueeRole, PopupAttribute, PopupTrait, popupWords, PopupForm } from '@vectoriox/iox-ui/composite-core';
14
14
  import { getByPath } from '@vectoriox/iox-ui/data-core';
@@ -9829,7 +9829,7 @@ function animateAction(el, action, frames, timing, options = {}) {
9829
9829
  return count ?? tagged(el.animate([], { duration: 0 }));
9830
9830
  }
9831
9831
  if (action.type === RevealActionType.Text && !options.reverse) {
9832
- const reveal = playTextReveal(el, textRevealByOf(action.params?.['by']), timing, textRevealLookOf(action.params?.['look']));
9832
+ const reveal = playTextReveal(el, textRevealByOf(action.params?.['by']), timing, textRevealLookOf(action.params?.['look']), textRevealStaggerOf(action.params?.['stagger']));
9833
9833
  if (reveal)
9834
9834
  return reveal;
9835
9835
  }
@@ -13652,6 +13652,8 @@ class PopupRuntime {
13652
13652
  tick(elapsedMs = 0) {
13653
13653
  if (this.destroyed)
13654
13654
  return;
13655
+ // A popup the visitor opened from a button (§9: that opening is their own), or closed after it, waits no more.
13656
+ this.pending = this.pending.filter(p => !this.showing(p.dialog) && popupDue(popupAttributeGetter(p.dialog), this.readMemory(p.dialog), this.now()) === null);
13655
13657
  const state = this.options.overlayState?.() ?? this.defaultOverlayState();
13656
13658
  const turn = overlayTurn({
13657
13659
  ...state,
@@ -13708,7 +13710,10 @@ class PopupRuntime {
13708
13710
  }
13709
13711
  return;
13710
13712
  }
13711
- // Non-modal: focus stays where the visitor is (R-H7); the title is said once.
13713
+ // Non-modal: focus stays where the visitor is (R-H7); the title is said once. ⚠️ `showPopover()` on a `<dialog>` runs
13714
+ // the DIALOG focusing steps (HTML "popover focusing steps"), as `show()` does — focus would jump to the ✕, so it is
13715
+ // put back.
13716
+ const before = this.doc.activeElement;
13712
13717
  if (dialog.hasAttribute('popover') && canPopover(dialog)) {
13713
13718
  try {
13714
13719
  dialog.showPopover();
@@ -13717,6 +13722,7 @@ class PopupRuntime {
13717
13722
  }
13718
13723
  else if (!dialog.open)
13719
13724
  dialog.show();
13725
+ this.keepFocus(before);
13720
13726
  this.announce(dialog);
13721
13727
  }
13722
13728
  async hide(dialog) {
@@ -13743,6 +13749,19 @@ class PopupRuntime {
13743
13749
  this.returnFocus = null;
13744
13750
  }
13745
13751
  }
13752
+ /** Focus back where it was before a non-modal open (nothing happens when it did not move). */
13753
+ keepFocus(before) {
13754
+ if (this.doc.activeElement === before)
13755
+ return;
13756
+ const view = this.win;
13757
+ if (before && view && before instanceof view.HTMLElement && before !== this.doc.body && before.isConnected)
13758
+ before.focus({ preventScroll: true });
13759
+ else
13760
+ this.doc.activeElement?.blur?.();
13761
+ }
13762
+ showing(dialog) {
13763
+ return dialog.open || popoverOpen(dialog);
13764
+ }
13746
13765
  openPopups() {
13747
13766
  return Array.from(this.root.querySelectorAll(`${POPUP_SELECTOR}[${POPUP_OPEN_ATTRIBUTE}]`));
13748
13767
  }