@vectoriox/iox-ui 5.84.0 → 5.85.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/actions-core/index.d.ts +18 -2
- package/composite-core/index.d.ts +93 -15
- package/design-core/index.d.ts +566 -4
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +18 -1
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +307 -39
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +680 -15
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +35 -4
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-scene-core.mjs +101 -5
- package/fesm2022/vectoriox-iox-ui-scene-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +285 -12
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +13 -0
- package/index.d.ts +143 -42
- package/package.json +1 -1
- package/scene-core/index.d.ts +32 -4
- package/src/actions-core/dialog-motion.ts +25 -0
- package/src/composite-core/header.ts +25 -0
- package/src/composite-core/public-api.ts +1 -0
- package/src/composite-core/slider-runtime.ts +82 -0
- package/src/composite-core/slider.ts +194 -27
- package/src/composite-core/structure.ts +14 -9
- package/src/design-core/flavor-spec.generated.ts +596 -9
- package/src/design-core/header-behaviour.ts +76 -0
- package/src/design-core/public-api.ts +1 -0
- package/src/design-core/theme-color.ts +21 -5
- package/src/generation-core/compose-site.ts +8 -0
- package/src/generation-core/node-baselines.generated.ts +17 -3
- package/src/generation-core/patterns.ts +2 -0
- package/src/generation-core/site-spec.generated.ts +8 -0
- package/src/scene-core/scene.ts +18 -0
- package/src/scene-core/scroll-driver.ts +83 -6
- package/styles/iox-design.css +232 -1
- package/styles/iox-forms.css +5 -2
|
@@ -766,6 +766,10 @@ declare const SPEC_SITE_PATTERNS: {
|
|
|
766
766
|
readonly label: "Navigation bar";
|
|
767
767
|
readonly global: "before";
|
|
768
768
|
readonly phoneMenu: "drawer";
|
|
769
|
+
readonly header: {
|
|
770
|
+
readonly behaviour: "hides";
|
|
771
|
+
readonly edge: "fade";
|
|
772
|
+
};
|
|
769
773
|
readonly intent: "The brand on one side, the pages and one call to action on the other — the default header.";
|
|
770
774
|
readonly node: {
|
|
771
775
|
readonly t: "Container";
|
|
@@ -827,6 +831,10 @@ declare const SPEC_SITE_PATTERNS: {
|
|
|
827
831
|
readonly label: "Navigation — the name centred";
|
|
828
832
|
readonly global: "before";
|
|
829
833
|
readonly phoneMenu: "drawer";
|
|
834
|
+
readonly header: {
|
|
835
|
+
readonly behaviour: "hides";
|
|
836
|
+
readonly edge: "fade";
|
|
837
|
+
};
|
|
830
838
|
readonly intent: "The name centred above a centred row of pages — when the name is the brand.";
|
|
831
839
|
readonly node: {
|
|
832
840
|
readonly t: "Container";
|
|
@@ -5410,6 +5418,11 @@ interface SitePattern {
|
|
|
5410
5418
|
readonly global?: `${PatternGlobalPosition}`;
|
|
5411
5419
|
/** A navigation pattern's phone shape (CC1): `planNavShape` adds it after the pattern is stamped. */
|
|
5412
5420
|
readonly phoneMenu?: 'drawer' | 'bar' | 'both';
|
|
5421
|
+
/** A navigation pattern's behaviour as the page scrolls (premium M4, T2): design-core HeaderBehaviour / HeaderEdge. */
|
|
5422
|
+
readonly header?: {
|
|
5423
|
+
readonly behaviour: 'scrolls' | 'stays' | 'hides';
|
|
5424
|
+
readonly edge?: 'fade' | 'line' | 'none';
|
|
5425
|
+
};
|
|
5413
5426
|
/** SC6: a Scene section — held while the page scrolls, moved by the scroll. Only at How animated Expressive, at
|
|
5414
5427
|
* most one per page and on at most two pages (`validateSitePlan`); it never takes the look's entrances. */
|
|
5415
5428
|
readonly scene?: boolean;
|
package/index.d.ts
CHANGED
|
@@ -719,7 +719,8 @@ declare function planResponsiveRules(styleProps: StyleMap | null | undefined, st
|
|
|
719
719
|
* shared boot). The slides render into `.swiper-wrapper` (`childrenHost` — the `.swiper-slide` direct-child invariant,
|
|
720
720
|
* slider.md); the control PARTS (CC3: Previous, Next, Pause, Pagination — `childHostFor`) render beside it, inside
|
|
721
721
|
* `.swiper`: those before the first slide before the wrapper, the rest after it. A saved slider with no parts keeps
|
|
722
|
-
* Swiper-drawn controls (the legacy switches). Swiper is booted by the ONE shared `bootSlider`.
|
|
722
|
+
* Swiper-drawn controls (the legacy switches). Swiper is booted by the ONE shared `bootSlider`. A slider the scroll plays
|
|
723
|
+
* (premium M4) sits in its runway — the string path writes the same `iox-slider-runway` wrapper.
|
|
723
724
|
*/
|
|
724
725
|
declare class ClientSliderContainerComponent implements AfterViewInit, OnDestroy {
|
|
725
726
|
private platformId;
|
|
@@ -764,6 +765,9 @@ declare class ClientSliderContainerComponent implements AfterViewInit, OnDestroy
|
|
|
764
765
|
responsive: ResponsiveOverrides | null;
|
|
765
766
|
/** The slider's controls are parts (set by the renderer from the node): Swiper draws none of its own. */
|
|
766
767
|
controlParts: boolean;
|
|
768
|
+
/** Premium M4: the scroll plays it — a runway (a Scene root the ONE driver drives) holds it mid-screen; otherwise the
|
|
769
|
+
* wrapper is `display: contents` and the slider lays out exactly as before. */
|
|
770
|
+
scrollPlays: boolean;
|
|
767
771
|
childrenHost: ViewContainerRef;
|
|
768
772
|
leadHost: ViewContainerRef;
|
|
769
773
|
trailHost: ViewContainerRef;
|
|
@@ -786,7 +790,7 @@ declare class ClientSliderContainerComponent implements AfterViewInit, OnDestroy
|
|
|
786
790
|
private boot;
|
|
787
791
|
private inputs;
|
|
788
792
|
static ɵfac: i0.ɵɵFactoryDeclaration<ClientSliderContainerComponent, never>;
|
|
789
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ClientSliderContainerComponent, "iox-slider-container", never, { "nodeId": { "alias": "nodeId"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "loop": { "alias": "loop"; "required": false; }; "slidesPerView": { "alias": "slidesPerView"; "required": false; }; "slidesPerGroup": { "alias": "slidesPerGroup"; "required": false; }; "spaceBetween": { "alias": "spaceBetween"; "required": false; }; "speed": { "alias": "speed"; "required": false; }; "effect": { "alias": "effect"; "required": false; }; "grabCursor": { "alias": "grabCursor"; "required": false; }; "centeredSlides": { "alias": "centeredSlides"; "required": false; }; "initialSlide": { "alias": "initialSlide"; "required": false; }; "autoHeight": { "alias": "autoHeight"; "required": false; }; "slideToClickedSlide": { "alias": "slideToClickedSlide"; "required": false; }; "freeMode": { "alias": "freeMode"; "required": false; }; "enableNavigation": { "alias": "enableNavigation"; "required": false; }; "enablePagination": { "alias": "enablePagination"; "required": false; }; "enableScrollbar": { "alias": "enableScrollbar"; "required": false; }; "enableAutoplay": { "alias": "enableAutoplay"; "required": false; }; "enableKeyboard": { "alias": "enableKeyboard"; "required": false; }; "enableMousewheel": { "alias": "enableMousewheel"; "required": false; }; "enableZoom": { "alias": "enableZoom"; "required": false; }; "enableGrid": { "alias": "enableGrid"; "required": false; }; "enableParallax": { "alias": "enableParallax"; "required": false; }; "autoplayDelay": { "alias": "autoplayDelay"; "required": false; }; "autoplayPauseOnMouseEnter": { "alias": "autoplayPauseOnMouseEnter"; "required": false; }; "autoplayDisableOnInteraction": { "alias": "autoplayDisableOnInteraction"; "required": false; }; "paginationType": { "alias": "paginationType"; "required": false; }; "paginationClickable": { "alias": "paginationClickable"; "required": false; }; "paginationDynamicBullets": { "alias": "paginationDynamicBullets"; "required": false; }; "navigationColor": { "alias": "navigationColor"; "required": false; }; "paginationColor": { "alias": "paginationColor"; "required": false; }; "gridRows": { "alias": "gridRows"; "required": false; }; "breakpoints": { "alias": "breakpoints"; "required": false; }; "responsive": { "alias": "responsive"; "required": false; }; "controlParts": { "alias": "controlParts"; "required": false; }; }, {}, never, never, false, never>;
|
|
793
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ClientSliderContainerComponent, "iox-slider-container", never, { "nodeId": { "alias": "nodeId"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "loop": { "alias": "loop"; "required": false; }; "slidesPerView": { "alias": "slidesPerView"; "required": false; }; "slidesPerGroup": { "alias": "slidesPerGroup"; "required": false; }; "spaceBetween": { "alias": "spaceBetween"; "required": false; }; "speed": { "alias": "speed"; "required": false; }; "effect": { "alias": "effect"; "required": false; }; "grabCursor": { "alias": "grabCursor"; "required": false; }; "centeredSlides": { "alias": "centeredSlides"; "required": false; }; "initialSlide": { "alias": "initialSlide"; "required": false; }; "autoHeight": { "alias": "autoHeight"; "required": false; }; "slideToClickedSlide": { "alias": "slideToClickedSlide"; "required": false; }; "freeMode": { "alias": "freeMode"; "required": false; }; "enableNavigation": { "alias": "enableNavigation"; "required": false; }; "enablePagination": { "alias": "enablePagination"; "required": false; }; "enableScrollbar": { "alias": "enableScrollbar"; "required": false; }; "enableAutoplay": { "alias": "enableAutoplay"; "required": false; }; "enableKeyboard": { "alias": "enableKeyboard"; "required": false; }; "enableMousewheel": { "alias": "enableMousewheel"; "required": false; }; "enableZoom": { "alias": "enableZoom"; "required": false; }; "enableGrid": { "alias": "enableGrid"; "required": false; }; "enableParallax": { "alias": "enableParallax"; "required": false; }; "autoplayDelay": { "alias": "autoplayDelay"; "required": false; }; "autoplayPauseOnMouseEnter": { "alias": "autoplayPauseOnMouseEnter"; "required": false; }; "autoplayDisableOnInteraction": { "alias": "autoplayDisableOnInteraction"; "required": false; }; "paginationType": { "alias": "paginationType"; "required": false; }; "paginationClickable": { "alias": "paginationClickable"; "required": false; }; "paginationDynamicBullets": { "alias": "paginationDynamicBullets"; "required": false; }; "navigationColor": { "alias": "navigationColor"; "required": false; }; "paginationColor": { "alias": "paginationColor"; "required": false; }; "gridRows": { "alias": "gridRows"; "required": false; }; "breakpoints": { "alias": "breakpoints"; "required": false; }; "responsive": { "alias": "responsive"; "required": false; }; "controlParts": { "alias": "controlParts"; "required": false; }; "scrollPlays": { "alias": "scrollPlays"; "required": false; }; }, {}, never, never, false, never>;
|
|
790
794
|
}
|
|
791
795
|
|
|
792
796
|
/**
|
|
@@ -1728,6 +1732,8 @@ interface SliderInputs {
|
|
|
1728
1732
|
gridRows?: number | string;
|
|
1729
1733
|
breakpoints?: string;
|
|
1730
1734
|
responsive?: ResponsiveOverrides | null;
|
|
1735
|
+
/** Premium M4: the scroll plays it — held mid-screen, resting on each picture; no swipe, no loop, no autoplay. */
|
|
1736
|
+
scrollPlays?: boolean;
|
|
1731
1737
|
}
|
|
1732
1738
|
/** The slider's controls, when they are PARTS (CC3) — the elements Swiper is handed. */
|
|
1733
1739
|
interface SliderControlElements {
|
|
@@ -1759,6 +1765,17 @@ declare const LEGACY_SWIPER_CONTROLS: {
|
|
|
1759
1765
|
readonly pagination: ".swiper-pagination";
|
|
1760
1766
|
readonly scrollbar: ".swiper-scrollbar";
|
|
1761
1767
|
};
|
|
1768
|
+
/**
|
|
1769
|
+
* The feel every live slider gets (premium M4, T3 — Emil 114/121): past either end a drag meets friction, not a wall
|
|
1770
|
+
* (resistance), and a swipe commits only after a few px of travel, so a vertical scroll that drifts never moves a slide.
|
|
1771
|
+
* The easing of the slides is the look's (`slider-ease`, iox-design.css).
|
|
1772
|
+
*/
|
|
1773
|
+
declare const SLIDER_FEEL: {
|
|
1774
|
+
readonly resistanceRatio: 0.65;
|
|
1775
|
+
readonly threshold: 6;
|
|
1776
|
+
};
|
|
1777
|
+
/** At or under this width one picture takes the full width (M1.3) unless the author said otherwise there. */
|
|
1778
|
+
declare const SLIDER_PHONE_BREAKPOINT = "mobile";
|
|
1762
1779
|
/** The pagination part's classes — Swiper's own position CSS (`.swiper-pagination-bullets.swiper-pagination-horizontal`)
|
|
1763
1780
|
* must not pin a PART: its place is its own styles'. The dots keep Swiper's bullet class. */
|
|
1764
1781
|
declare const PART_PAGINATION_MODIFIER = "iox-slider-pagination-";
|
|
@@ -1767,6 +1784,12 @@ declare function swiperLoopOptions(loop: unknown): {
|
|
|
1767
1784
|
loop: boolean;
|
|
1768
1785
|
rewind: boolean;
|
|
1769
1786
|
};
|
|
1787
|
+
/**
|
|
1788
|
+
* One picture the full width on a phone (M1.3) — the default the M1 prototype proved: a 1.15 "peek" left an empty strip
|
|
1789
|
+
* beside the picture. Added as a phone layer only where the author set no slides-per-view at a phone width; an effect
|
|
1790
|
+
* that shows one slide anyway keeps its own (a "cards" stack stays a centred card, iox-design.css).
|
|
1791
|
+
*/
|
|
1792
|
+
declare function withPhoneDefaults(inputs: SliderInputs): ResponsiveOverrides | null;
|
|
1770
1793
|
declare function planSwiperOptions(inputs: SliderInputs, ctx: SwiperPlanContext): SwiperPlan;
|
|
1771
1794
|
|
|
1772
1795
|
/**
|
|
@@ -1795,6 +1818,19 @@ declare function sliderControlElements(el: Element): {
|
|
|
1795
1818
|
/** True when the rendered slider holds any control part (the model's `hasSliderParts`, read off the DOM). */
|
|
1796
1819
|
declare function domHasSliderParts(el: Element): boolean;
|
|
1797
1820
|
declare function bootSlider(el: HTMLElement, inputs: SliderInputs, options?: SliderBootOptions): Promise<any>;
|
|
1821
|
+
/** The element a slider the scroll plays is held in: its runway, the Scene root the ONE driver drives (premium M4). */
|
|
1822
|
+
declare const SLIDER_RUNWAY_CLASS = "iox-slider-runway";
|
|
1823
|
+
/** The runway's steps (slides − 1): how many half-screens of scroll it reserves (iox-design.css). */
|
|
1824
|
+
declare const SLIDER_STEPS_PROPERTY = "--slider-steps";
|
|
1825
|
+
/**
|
|
1826
|
+
* The runway a slider the scroll plays sits in — ONE answer for the string path (it writes this wrapper, steps known at
|
|
1827
|
+
* render, so the page never shifts) and the component path (the same class and Scene root; its boot writes the steps).
|
|
1828
|
+
* Null when the scroll does not play it.
|
|
1829
|
+
*/
|
|
1830
|
+
declare function sliderRunwayHtml(inputs: SliderInputs | null | undefined, slideCount: number): {
|
|
1831
|
+
open: string;
|
|
1832
|
+
close: string;
|
|
1833
|
+
} | null;
|
|
1798
1834
|
/** The inputs a string-path slider carries (`data-iox-slider`), or null. */
|
|
1799
1835
|
declare function sliderInputsOf(el: Element): SliderInputs | null;
|
|
1800
1836
|
/** The Swiper inputs of a saved SliderContainer node — what the string path serialises into `data-iox-slider`. */
|
|
@@ -1958,10 +1994,17 @@ type StateMaps = Record<string, Record<string, any> | undefined> | null | undefi
|
|
|
1958
1994
|
declare function stateTransitionProperties(stateStyles: StateMaps, responsive?: Record<string, {
|
|
1959
1995
|
stateStyles?: StateMaps;
|
|
1960
1996
|
} | undefined> | null, type?: string | null): string[];
|
|
1997
|
+
/**
|
|
1998
|
+
* What an element style animates beyond the properties its states change (premium M4): a link's underline is DRAWN by
|
|
1999
|
+
* the shared CSS (`iox-design.css`) as a background line that grows from the reading start on hover — its growth is a
|
|
2000
|
+
* `background-size` the node's own transition must name, or it would jump.
|
|
2001
|
+
*/
|
|
2002
|
+
declare const ELEMENT_STYLE_TRANSITION_EXTRAS: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
1961
2003
|
/**
|
|
1962
2004
|
* `styleProps` as a renderer compiles them: a hovering node with no timing of its own takes the default hover timing,
|
|
1963
|
-
* and a node whose transition names no properties gets the ones its states change
|
|
1964
|
-
* (or a raw `transition`) always wins. Pure:
|
|
2005
|
+
* and a node whose transition names no properties gets the ones its states change (and what its element style draws,
|
|
2006
|
+
* `ELEMENT_STYLE_TRANSITION_EXTRAS`). An author's own `transitionProperty` (or a raw `transition`) always wins. Pure:
|
|
2007
|
+
* the node's stored styles are never touched.
|
|
1965
2008
|
*/
|
|
1966
2009
|
declare function withStateTransitions(styleProps: Record<string, any>, stateStyles: StateMaps, elementStyle?: string | null, responsive?: Record<string, {
|
|
1967
2010
|
stateStyles?: StateMaps;
|
|
@@ -2301,6 +2344,98 @@ declare function normalizeAppPath(path: string | null | undefined, baseHref?: st
|
|
|
2301
2344
|
/** Whether `href` points at the page at `currentPath` (both app-relative, or absolute under `baseHref`). */
|
|
2302
2345
|
declare function isCurrentLink(href: string | null | undefined, currentPath: string | null | undefined, options?: CurrentLinkOptions): boolean;
|
|
2303
2346
|
|
|
2347
|
+
/**
|
|
2348
|
+
* Reduced motion (CC1, R1 — complex-components plan §2d). The token sheet already collapses the
|
|
2349
|
+
* motion tokens under `prefers-reduced-motion`; everything that moves through SCRIPT must ask the
|
|
2350
|
+
* same question, and ask it HERE: the interaction engines (builder canvas + live site), the Slider's
|
|
2351
|
+
* autoplay and the Gallery's crossfade loop. Publishable gate #6: reduced motion = motion dial 0.
|
|
2352
|
+
*/
|
|
2353
|
+
declare const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
2354
|
+
/** Anything with `matchMedia` — a window, or a stub in a spec. */
|
|
2355
|
+
interface MatchMediaHost {
|
|
2356
|
+
matchMedia?: (query: string) => {
|
|
2357
|
+
matches: boolean;
|
|
2358
|
+
};
|
|
2359
|
+
}
|
|
2360
|
+
/** True when the visitor asked their system for reduced motion. No `matchMedia` (SSR) → false. */
|
|
2361
|
+
declare function prefersReducedMotion(host?: MatchMediaHost | null | undefined): boolean;
|
|
2362
|
+
/** True when script may animate. The ONE question every runtime asks before moving anything. */
|
|
2363
|
+
declare function motionAllowed(host?: MatchMediaHost | null | undefined): boolean;
|
|
2364
|
+
|
|
2365
|
+
/** How far the page has to move before it counts as scrolled — past a trackpad's rest jitter. */
|
|
2366
|
+
declare const SCROLLED_THRESHOLD_PX = 8;
|
|
2367
|
+
/** True once `offset` has passed the threshold. */
|
|
2368
|
+
declare function isScrolled(offset: number, threshold?: number): boolean;
|
|
2369
|
+
/** Anything that scrolls: a window (`scrollY`) or an element (`scrollTop`). */
|
|
2370
|
+
interface ScrollSource {
|
|
2371
|
+
addEventListener(type: 'scroll', fn: () => void, options?: AddEventListenerOptions): void;
|
|
2372
|
+
removeEventListener(type: 'scroll', fn: () => void): void;
|
|
2373
|
+
scrollY?: number;
|
|
2374
|
+
scrollTop?: number;
|
|
2375
|
+
}
|
|
2376
|
+
/**
|
|
2377
|
+
* Keep `SCROLLED_ATTRIBUTE` on `target` while `source` has scrolled past the threshold — what the Scrolled state (G4)
|
|
2378
|
+
* compiles against, on the live site (the window → the document element) and on the canvas (its scroller → the page).
|
|
2379
|
+
* One passive listener, read once per frame, written only when it changes. Returns the stop.
|
|
2380
|
+
*/
|
|
2381
|
+
declare function watchScrolled(source: ScrollSource, target: Element, threshold?: number): () => void;
|
|
2382
|
+
|
|
2383
|
+
/**
|
|
2384
|
+
* A header that HIDES (premium components T2, M4): it steps aside while the page scrolls down and comes back the moment
|
|
2385
|
+
* it scrolls up — ONE runtime for the live site (the window's scroll) and the builder canvas (its Lenis scroll, handed in
|
|
2386
|
+
* through `update`). It never moves while the visitor is inside it: keyboard focus in the header, or its own drawer
|
|
2387
|
+
* open, keeps it in place, and it is always there at the top of the page.
|
|
2388
|
+
*
|
|
2389
|
+
* Motion (Emil 30/41/52/59/192): `translate` only, from the live value (a run interrupted by a change of direction turns
|
|
2390
|
+
* back from where it is — never stacked); the exit is faster than the return (dur-fast out, dur-ui back, on the look's
|
|
2391
|
+
* standard easing — the tokens collapse with the look's motion); under reduced motion it fades in place (opacity, no
|
|
2392
|
+
* movement — gentler, not zero), and is not clickable while faded. The return RELEASES (no inline frame is left), the
|
|
2393
|
+
* hidden frame is held, as every exit in the product (M2's settle rule).
|
|
2394
|
+
*
|
|
2395
|
+
* A header that only STAYS needs no runtime: the shared CSS keeps it at the top (`iox-design.css`).
|
|
2396
|
+
*/
|
|
2397
|
+
/** Page px the scroll must travel in one direction before the header answers — past a trackpad's jitter. */
|
|
2398
|
+
declare const HEADER_SCROLL_HYSTERESIS_PX = 6;
|
|
2399
|
+
interface HeaderRuntimeOptions {
|
|
2400
|
+
/** Where reduced motion is asked (the window; a stub in a spec). */
|
|
2401
|
+
host?: MatchMediaHost | null;
|
|
2402
|
+
}
|
|
2403
|
+
/** `120ms` / `0.2s` → milliseconds; anything else → null. */
|
|
2404
|
+
declare function durationMs(value: string | null | undefined): number | null;
|
|
2405
|
+
/**
|
|
2406
|
+
* Whether a hiding header should step aside now: the page moved DOWN past the header's own height, the header is not
|
|
2407
|
+
* held (focus inside, its drawer open). Pure: the direction and the offsets come from the caller.
|
|
2408
|
+
*/
|
|
2409
|
+
declare function headerShouldHide(offset: number, delta: number, headerHeight: number, held: boolean): boolean;
|
|
2410
|
+
declare class HeaderRuntime {
|
|
2411
|
+
private readonly header;
|
|
2412
|
+
private readonly options;
|
|
2413
|
+
private lastOffset;
|
|
2414
|
+
private hidden;
|
|
2415
|
+
private height;
|
|
2416
|
+
private anim;
|
|
2417
|
+
private readonly resize;
|
|
2418
|
+
private readonly onFocusIn;
|
|
2419
|
+
constructor(header: HTMLElement, options?: HeaderRuntimeOptions);
|
|
2420
|
+
/** True while the header has stepped aside. */
|
|
2421
|
+
get isHidden(): boolean;
|
|
2422
|
+
/** The page now stands at `offset` page px (layout px — the canvas divides out its zoom). */
|
|
2423
|
+
update(offset: number): void;
|
|
2424
|
+
/** Back in place now, with no motion (a page change, the runtime going away). */
|
|
2425
|
+
reset(): void;
|
|
2426
|
+
destroy(): void;
|
|
2427
|
+
private held;
|
|
2428
|
+
private setHidden;
|
|
2429
|
+
}
|
|
2430
|
+
/** The headers that hide while the page scrolls down: in `root`, or among `elements` (each, and what it holds — what a
|
|
2431
|
+
* runtime instance owns: the page's nodes or the globals'). */
|
|
2432
|
+
declare function hidingHeadersIn(root: ParentNode | Iterable<Element>): HTMLElement[];
|
|
2433
|
+
/**
|
|
2434
|
+
* The live site's door: every hiding header in `root` (or among `elements`) follows `source` (the window), through ONE
|
|
2435
|
+
* passive listener read once per frame. Returns the stop.
|
|
2436
|
+
*/
|
|
2437
|
+
declare function watchHeaders(source: ScrollSource, root: ParentNode | Iterable<Element>, options?: HeaderRuntimeOptions): () => void;
|
|
2438
|
+
|
|
2304
2439
|
/**
|
|
2305
2440
|
* The content traits the accessibility attributes are read from (CC1). Import-free on purpose: the
|
|
2306
2441
|
* builder's component configs declare these traits, and the node-baseline generator bundles those
|
|
@@ -2332,6 +2467,8 @@ declare const DIALOG_NODE_TYPE = "Dialog";
|
|
|
2332
2467
|
declare const NAMED_GROUP_ROLES: ReadonlyArray<string>;
|
|
2333
2468
|
/** Carries the min-width (px) at which an open dialog closes itself; the engine listens on it. */
|
|
2334
2469
|
declare const DIALOG_CLOSE_ABOVE_ATTRIBUTE = "data-iox-dialog-close-above";
|
|
2470
|
+
/** A slide's caption (premium M4, T3): the Slider's Caption part shows the caption of the slide in view. */
|
|
2471
|
+
declare const SLIDE_CAPTION_ATTRIBUTE = "data-iox-caption";
|
|
2335
2472
|
declare enum A11yAttribute {
|
|
2336
2473
|
Label = "aria-label",
|
|
2337
2474
|
Hidden = "aria-hidden",
|
|
@@ -2395,24 +2532,6 @@ declare function needsGroupName(node: (A11yNodeSource & {
|
|
|
2395
2532
|
role?: string | null;
|
|
2396
2533
|
}) | null | undefined): boolean;
|
|
2397
2534
|
|
|
2398
|
-
/**
|
|
2399
|
-
* Reduced motion (CC1, R1 — complex-components plan §2d). The token sheet already collapses the
|
|
2400
|
-
* motion tokens under `prefers-reduced-motion`; everything that moves through SCRIPT must ask the
|
|
2401
|
-
* same question, and ask it HERE: the interaction engines (builder canvas + live site), the Slider's
|
|
2402
|
-
* autoplay and the Gallery's crossfade loop. Publishable gate #6: reduced motion = motion dial 0.
|
|
2403
|
-
*/
|
|
2404
|
-
declare const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
2405
|
-
/** Anything with `matchMedia` — a window, or a stub in a spec. */
|
|
2406
|
-
interface MatchMediaHost {
|
|
2407
|
-
matchMedia?: (query: string) => {
|
|
2408
|
-
matches: boolean;
|
|
2409
|
-
};
|
|
2410
|
-
}
|
|
2411
|
-
/** True when the visitor asked their system for reduced motion. No `matchMedia` (SSR) → false. */
|
|
2412
|
-
declare function prefersReducedMotion(host?: MatchMediaHost | null | undefined): boolean;
|
|
2413
|
-
/** True when script may animate. The ONE question every runtime asks before moving anything. */
|
|
2414
|
-
declare function motionAllowed(host?: MatchMediaHost | null | undefined): boolean;
|
|
2415
|
-
|
|
2416
2535
|
/**
|
|
2417
2536
|
* Scrolling (AI plan rev 3.1 §3p, MO-D1/MO-D7): the look's `scroll` choice → the options the ONE page
|
|
2418
2537
|
* scroller starts Lenis with, or `null` for the browser's own scrolling. The table is the contract's
|
|
@@ -2644,24 +2763,6 @@ declare function splitPressFeedback<T extends PressAction>(actions: ReadonlyArra
|
|
|
2644
2763
|
onClick: T[];
|
|
2645
2764
|
};
|
|
2646
2765
|
|
|
2647
|
-
/** How far the page has to move before it counts as scrolled — past a trackpad's rest jitter. */
|
|
2648
|
-
declare const SCROLLED_THRESHOLD_PX = 8;
|
|
2649
|
-
/** True once `offset` has passed the threshold. */
|
|
2650
|
-
declare function isScrolled(offset: number, threshold?: number): boolean;
|
|
2651
|
-
/** Anything that scrolls: a window (`scrollY`) or an element (`scrollTop`). */
|
|
2652
|
-
interface ScrollSource {
|
|
2653
|
-
addEventListener(type: 'scroll', fn: () => void, options?: AddEventListenerOptions): void;
|
|
2654
|
-
removeEventListener(type: 'scroll', fn: () => void): void;
|
|
2655
|
-
scrollY?: number;
|
|
2656
|
-
scrollTop?: number;
|
|
2657
|
-
}
|
|
2658
|
-
/**
|
|
2659
|
-
* Keep `SCROLLED_ATTRIBUTE` on `target` while `source` has scrolled past the threshold — what the Scrolled state (G4)
|
|
2660
|
-
* compiles against, on the live site (the window → the document element) and on the canvas (its scroller → the page).
|
|
2661
|
-
* One passive listener, read once per frame, written only when it changes. Returns the stop.
|
|
2662
|
-
*/
|
|
2663
|
-
declare function watchScrolled(source: ScrollSource, target: Element, threshold?: number): () => void;
|
|
2664
|
-
|
|
2665
2766
|
/**
|
|
2666
2767
|
* page-style — the ONE compiler that turns a page's style settings into CSS.
|
|
2667
2768
|
*
|
|
@@ -3842,5 +3943,5 @@ declare const FLOATING_MARGIN = 12;
|
|
|
3842
3943
|
/** Where `panel` goes beside `anchor` inside `viewport`. */
|
|
3843
3944
|
declare function placeFloating(anchor: FloatingRect, panel: FloatingSize, viewport: FloatingViewport, options?: FloatingOptions): FloatingPlacement;
|
|
3844
3945
|
|
|
3845
|
-
export { A11yAttribute, A11yTrait, ACCESSIBLE_NAME_TYPES, AOSService, ARIA_CURRENT_PAGE, BACKDROP_TWIN_KEY, BACKDROP_WHOLE_KEY, BREAKPOINTS, Breakpoint, BreakpointQueryKind, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CALENDAR_CLOSING_ATTRIBUTE, CALENDAR_DESIGN_ATTRIBUTE, CALENDAR_INSTANT_ATTRIBUTE, CALENDAR_SHEET_QUERY, COMPONENT_STATE_SELECTOR, CONTAINER_HTML_TAGS, CONTEXT_ACTION_TYPES, CURRENT_LINK_TYPES, CalendarClass, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ComponentState, ContainerComponent, ContextStore, DECORATIVE_TYPES, DEFAULT_GALLERY_SCHEDULER, DEFAULT_INTERACTION_EASING, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_PHOSPHOR_WEIGHT, DEFAULT_WIDTH_BY_TYPE, DIALOG_CLOSE_ABOVE_ATTRIBUTE, DIALOG_NODE_TYPE, DatePickerRuntime, DeclarationContext, EASING_KEYWORDS, EASING_TOKENS, ENTRANCE_ACTION_TYPES, ENTRANCE_FALLBACK_CSS, ENTRANCE_NOSCRIPT_CSS, ENTRANCE_PRESTATE_ATTRIBUTE, EXIT_ACTION_TYPES, EasingKeyword, EasingToken, FLOATING_GAP, FLOATING_MARGIN, FloatingSide, FormRenderState, FormRuntimeService, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, HOVER_DEFAULT_TRANSITION_TRAITS, HOVER_MEDIA_QUERY, HOVER_STATES, INTERACTION_ANIMATION_ID, INTERACTION_HIDDEN_ATTRIBUTE, IOX_BUILDER_EVENTS, IOX_FORM_MESSAGES, IOX_FORM_NAVIGATOR, IOX_FORM_TRANSPORT, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxDialogComponent, IoxFieldComponent, IoxFormComponent, IoxFormErrorComponent, IoxFormSuccessComponent, IoxPageComponent, IoxPageModule, IoxSubmitButtonComponent, IoxUiModule, IoxVideoComponent, LAST_EMITTED_STATES, LEGACY_DIRECTION_KEY, LEGACY_HOVER_TRANSITION_TRAITS, LEGACY_SWIPER_CONTROLS, LinkedContainerComponent, MANAGED_A11Y_ATTRIBUTES, MAX_LINES_KEY, NAMED_GROUP_ROLES, NO_PAGE_TRANSITION, ON_STATE_ROLES, OUTER_STYLE_PROPS, PAGE_STYLE_TOKENS, PAGE_TOKEN_FALLBACKS, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PART_CLASS_NAMES, PART_PAGINATION_MODIFIER, PHONE_TRANSITION_QUERY, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, PageStyleField, PageStyleSource, PointerKind, REDUCED_MOTION_QUERY, RELATIONAL_STATE_PSEUDO, RevealActionType, SCROLLED_ATTRIBUTE, SCROLLED_STATE_ROLE, SCROLLED_THRESHOLD_PX, SCROLL_EASINGS, SELF_PLAYING_TRIGGERS, SHAKE_DURATION_MS, SHAKE_EASING, SHAKE_KEYFRAMES, SLIDER_INPUTS_ATTRIBUTE, SLIDER_INPUT_NAMES, STATE_PSEUDO_CLASS, STRUCTURAL_STATES, SUPPRESSED_STYLE_PROPS_BY_TYPE, SWIPER_A11Y_OPTIONS, SWIPER_RESPONSIVE_TRAITS, SWIPER_TRIGGER_EVENTS, ScrollEasing, SectionComponent, SettleMode, StringFormRuntime, SwiperModuleName, TARGETED_STATE_SUFFIX, TEXT_ALIGN_KEY, TEXT_DIRECTION_KEY, TRANSITION_FEELS, TRANSITION_PROPERTY_KEY, TextAlign, TextBlockComponent, VALIDATION_STATES, VALIDATION_STATE_CLASS, VIRTUAL_TRAIT_GROUPS, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, VisibilityActionType, activeActions, animateAction, applyBindingPipes, applyFeel, attachDatePicker, attachDatePickers, attachStringForm, bootSlider, breakpointDef, breakpointForWidth, breakpointQueryFor, buildInteractionKeyframes, buildPartSelector, buildSwiperBreakpoints, buildTargetedStateSelector, buildTargetedSuffixSelector, buildTransitionTimeline, cascadeChain, clearInputOverride, clearOverride, closeAboveMediaQuery, collectContextSlotKeys, compileDeclarations, compilePageStyle, componentStatesFor, composeVirtualTraits, containerHtmlTag, contextActionEffect, contextSlotKeys, countOverrides, datePickerOf, declaredInputNames, decomposeBackdropFilter, defaultHoverTransitionTraits, defaultMessageResolver, deriveSeoFromContent, describePageStyle, describeSeoFields, dialogCloseAboveMinWidth, domHasSliderParts, effectiveActionType, effectiveTransitionId, entrancePreStateStyle, entranceStartsHidden, feelFor, fieldLanguage, finalKeyframe, framesFromLiveValue, gateHoverRule, getSeoValue, hasHoverState, hasOwnPageTransition, hasOwnTransition, initialSlotValues, isActionEnabled, isContextAction, isCubicBezier, isCurrentLink, isEasingToken, isExternalOrFragment, isGradientPaint, isHoverPointer, isHoverState, isInputOverriddenAt, isInteractionEasing, isLastEmittedStateKey, isOverriddenAt, isPressFeedback, isScrolled, isStructuralState, isValidSlotKey, isWholeBackdropSet, keyframePropertyName, keyframeStyleEntries, legacyEnterToTransition, mediaQueryFor, mergeSwiperBreakpoints, migrateLegacyDirection, migrateLegacyTextAlign, motionAllowed, nearestCommonAncestorId, needsAccessibleName, needsGroupName, nodeA11yAttributes, nodeCssId, nodeTraitValue, nodeUsesContext, normalizeAppPath, normalizeGalleryImage, normalizeIconClass, orderStatesForEmit, pageTransitionOf, parentBreakpoint, parseUrlList, partClassName, placeFloating, planPartRule, planResponsiveRules, planScroll, planStateRule, planSwiperOptions, playDualLayerTransition, playInteraction, prefersReducedMotion, renderDefaultDeclarations, resetPageStyleField, resetSeoField, resolveBoundValue, resolveContextValue, resolveGalleryEffect, resolveGalleryUrls, resolveInputChain, resolveInputs, resolveInteractionEasing, resolvePageTransition, resolvePath, resolveSeo, resolveStateStyles, resolveStyleProps, resolveToggleVisibility, resolveValueChain, rewriteViewportUnits, safeSetInput, serializeA11yAttributes, setDateFieldValue, setInputOverride, setOverride, setSeoAuto, setSeoBinding, setSeoOverride, setSeoValue, settleInteraction, settleModeFor, shakeElement, showCalendarDesign, sliderControlElements, sliderInputsFromProps, sliderInputsOf, splitOuterProps, splitPressFeedback, stateNamesIn, statePseudoClass, stateSelectorSuffix, stateTransitionProperties, stringFormRuntimeOf, stripSuppressedProps, swiperAutoplayAllowed, swiperLoopOptions, swiperModuleNames, syncNodeA11yAttributes, syncSubmitButtons, targetedStateSelector, transitionPropertyList, viewportTransitionContext, watchScrolled, withContextSlots, withStateTransitions, wrapInBreakpointQuery, wrapInMediaQuery };
|
|
3846
|
-
export type { A11yNodeSource, AnimateActionOptions, BoundValueSpec, BreakpointDef, ContextActionEffect, ContextActionLike, ContextItemRef, ContextSlotDefault, ContextValueSpec, ContextWriteScope, CurrentLinkOptions, DatePickerOptions, FloatingOptions, FloatingPlacement, FloatingRect, FloatingSize, FloatingViewport, FormMessageResolver, GalleryBoundSource, GalleryDurations, GalleryEffect, GalleryEffectDescriptor, GalleryImage, GalleryLoopOptions, GalleryLoopScheduler, GalleryLoopState, GallerySlideState, IBuilderEventEmitter, InputMap, InteractionKeyframe, IoxContextSlot, IoxPipe, MatchMediaHost, NodeA11yContext, OverrideBreakpoint, PageScrollStart, PageStyleFieldState, PageStyleOptions, PageStyleSettings, PageTransitionCategory, PageTransitionCategoryMeta, PageTransitionContext, PageTransitionOptions, PageTransitionPreset, PipeArgSpec, PipeContext, PipeDescriptor, PlannedPageTransition, PressAction, RegisteredField, ResolvedPageTransition, ResponsiveLayer, ResponsiveOverrides, ResponsiveRuleSet, RouteAnimationLike, ScrollPlanContext, ScrollSource, SeoDerivedContent, SeoFieldSource, SeoFieldState, SeoResolveContext, SetContextParams, SettleOptions, SliderBootOptions, SliderControlElements, SliderInputs, StateRulePlan, StateScope, StateStyleMap, StringFormOptions, StyleMap, StyleTreeNode, SwiperBreakpointMap, SwiperModuleFlags, SwiperPlan, SwiperPlanContext, ToggleableAction, TransitionFeel, TransitionPhase, TransitionPreviewLayers, TransitionTimelineInput, TransitionViewport, ValueSource, VirtualTraitGroup };
|
|
3946
|
+
export { A11yAttribute, A11yTrait, ACCESSIBLE_NAME_TYPES, AOSService, ARIA_CURRENT_PAGE, BACKDROP_TWIN_KEY, BACKDROP_WHOLE_KEY, BREAKPOINTS, Breakpoint, BreakpointQueryKind, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CALENDAR_CLOSING_ATTRIBUTE, CALENDAR_DESIGN_ATTRIBUTE, CALENDAR_INSTANT_ATTRIBUTE, CALENDAR_SHEET_QUERY, COMPONENT_STATE_SELECTOR, CONTAINER_HTML_TAGS, CONTEXT_ACTION_TYPES, CURRENT_LINK_TYPES, CalendarClass, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ComponentState, ContainerComponent, ContextStore, DECORATIVE_TYPES, DEFAULT_GALLERY_SCHEDULER, DEFAULT_INTERACTION_EASING, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_PHOSPHOR_WEIGHT, DEFAULT_WIDTH_BY_TYPE, DIALOG_CLOSE_ABOVE_ATTRIBUTE, DIALOG_NODE_TYPE, DatePickerRuntime, DeclarationContext, EASING_KEYWORDS, EASING_TOKENS, ELEMENT_STYLE_TRANSITION_EXTRAS, ENTRANCE_ACTION_TYPES, ENTRANCE_FALLBACK_CSS, ENTRANCE_NOSCRIPT_CSS, ENTRANCE_PRESTATE_ATTRIBUTE, EXIT_ACTION_TYPES, EasingKeyword, EasingToken, FLOATING_GAP, FLOATING_MARGIN, FloatingSide, FormRenderState, FormRuntimeService, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, HEADER_SCROLL_HYSTERESIS_PX, HOVER_DEFAULT_TRANSITION_TRAITS, HOVER_MEDIA_QUERY, HOVER_STATES, HeaderRuntime, INTERACTION_ANIMATION_ID, INTERACTION_HIDDEN_ATTRIBUTE, IOX_BUILDER_EVENTS, IOX_FORM_MESSAGES, IOX_FORM_NAVIGATOR, IOX_FORM_TRANSPORT, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxDialogComponent, IoxFieldComponent, IoxFormComponent, IoxFormErrorComponent, IoxFormSuccessComponent, IoxPageComponent, IoxPageModule, IoxSubmitButtonComponent, IoxUiModule, IoxVideoComponent, LAST_EMITTED_STATES, LEGACY_DIRECTION_KEY, LEGACY_HOVER_TRANSITION_TRAITS, LEGACY_SWIPER_CONTROLS, LinkedContainerComponent, MANAGED_A11Y_ATTRIBUTES, MAX_LINES_KEY, NAMED_GROUP_ROLES, NO_PAGE_TRANSITION, ON_STATE_ROLES, OUTER_STYLE_PROPS, PAGE_STYLE_TOKENS, PAGE_TOKEN_FALLBACKS, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PART_CLASS_NAMES, PART_PAGINATION_MODIFIER, PHONE_TRANSITION_QUERY, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, PageStyleField, PageStyleSource, PointerKind, REDUCED_MOTION_QUERY, RELATIONAL_STATE_PSEUDO, RevealActionType, SCROLLED_ATTRIBUTE, SCROLLED_STATE_ROLE, SCROLLED_THRESHOLD_PX, SCROLL_EASINGS, SELF_PLAYING_TRIGGERS, SHAKE_DURATION_MS, SHAKE_EASING, SHAKE_KEYFRAMES, SLIDER_FEEL, SLIDER_INPUTS_ATTRIBUTE, SLIDER_INPUT_NAMES, SLIDER_PHONE_BREAKPOINT, SLIDER_RUNWAY_CLASS, SLIDER_STEPS_PROPERTY, SLIDE_CAPTION_ATTRIBUTE, STATE_PSEUDO_CLASS, STRUCTURAL_STATES, SUPPRESSED_STYLE_PROPS_BY_TYPE, SWIPER_A11Y_OPTIONS, SWIPER_RESPONSIVE_TRAITS, SWIPER_TRIGGER_EVENTS, ScrollEasing, SectionComponent, SettleMode, StringFormRuntime, SwiperModuleName, TARGETED_STATE_SUFFIX, TEXT_ALIGN_KEY, TEXT_DIRECTION_KEY, TRANSITION_FEELS, TRANSITION_PROPERTY_KEY, TextAlign, TextBlockComponent, VALIDATION_STATES, VALIDATION_STATE_CLASS, VIRTUAL_TRAIT_GROUPS, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, VisibilityActionType, activeActions, animateAction, applyBindingPipes, applyFeel, attachDatePicker, attachDatePickers, attachStringForm, bootSlider, breakpointDef, breakpointForWidth, breakpointQueryFor, buildInteractionKeyframes, buildPartSelector, buildSwiperBreakpoints, buildTargetedStateSelector, buildTargetedSuffixSelector, buildTransitionTimeline, cascadeChain, clearInputOverride, clearOverride, closeAboveMediaQuery, collectContextSlotKeys, compileDeclarations, compilePageStyle, componentStatesFor, composeVirtualTraits, containerHtmlTag, contextActionEffect, contextSlotKeys, countOverrides, datePickerOf, declaredInputNames, decomposeBackdropFilter, defaultHoverTransitionTraits, defaultMessageResolver, deriveSeoFromContent, describePageStyle, describeSeoFields, dialogCloseAboveMinWidth, domHasSliderParts, durationMs, effectiveActionType, effectiveTransitionId, entrancePreStateStyle, entranceStartsHidden, feelFor, fieldLanguage, finalKeyframe, framesFromLiveValue, gateHoverRule, getSeoValue, hasHoverState, hasOwnPageTransition, hasOwnTransition, headerShouldHide, hidingHeadersIn, initialSlotValues, isActionEnabled, isContextAction, isCubicBezier, isCurrentLink, isEasingToken, isExternalOrFragment, isGradientPaint, isHoverPointer, isHoverState, isInputOverriddenAt, isInteractionEasing, isLastEmittedStateKey, isOverriddenAt, isPressFeedback, isScrolled, isStructuralState, isValidSlotKey, isWholeBackdropSet, keyframePropertyName, keyframeStyleEntries, legacyEnterToTransition, mediaQueryFor, mergeSwiperBreakpoints, migrateLegacyDirection, migrateLegacyTextAlign, motionAllowed, nearestCommonAncestorId, needsAccessibleName, needsGroupName, nodeA11yAttributes, nodeCssId, nodeTraitValue, nodeUsesContext, normalizeAppPath, normalizeGalleryImage, normalizeIconClass, orderStatesForEmit, pageTransitionOf, parentBreakpoint, parseUrlList, partClassName, placeFloating, planPartRule, planResponsiveRules, planScroll, planStateRule, planSwiperOptions, playDualLayerTransition, playInteraction, prefersReducedMotion, renderDefaultDeclarations, resetPageStyleField, resetSeoField, resolveBoundValue, resolveContextValue, resolveGalleryEffect, resolveGalleryUrls, resolveInputChain, resolveInputs, resolveInteractionEasing, resolvePageTransition, resolvePath, resolveSeo, resolveStateStyles, resolveStyleProps, resolveToggleVisibility, resolveValueChain, rewriteViewportUnits, safeSetInput, serializeA11yAttributes, setDateFieldValue, setInputOverride, setOverride, setSeoAuto, setSeoBinding, setSeoOverride, setSeoValue, settleInteraction, settleModeFor, shakeElement, showCalendarDesign, sliderControlElements, sliderInputsFromProps, sliderInputsOf, sliderRunwayHtml, splitOuterProps, splitPressFeedback, stateNamesIn, statePseudoClass, stateSelectorSuffix, stateTransitionProperties, stringFormRuntimeOf, stripSuppressedProps, swiperAutoplayAllowed, swiperLoopOptions, swiperModuleNames, syncNodeA11yAttributes, syncSubmitButtons, targetedStateSelector, transitionPropertyList, viewportTransitionContext, watchHeaders, watchScrolled, withContextSlots, withPhoneDefaults, withStateTransitions, wrapInBreakpointQuery, wrapInMediaQuery };
|
|
3947
|
+
export type { A11yNodeSource, AnimateActionOptions, BoundValueSpec, BreakpointDef, ContextActionEffect, ContextActionLike, ContextItemRef, ContextSlotDefault, ContextValueSpec, ContextWriteScope, CurrentLinkOptions, DatePickerOptions, FloatingOptions, FloatingPlacement, FloatingRect, FloatingSize, FloatingViewport, FormMessageResolver, GalleryBoundSource, GalleryDurations, GalleryEffect, GalleryEffectDescriptor, GalleryImage, GalleryLoopOptions, GalleryLoopScheduler, GalleryLoopState, GallerySlideState, HeaderRuntimeOptions, IBuilderEventEmitter, InputMap, InteractionKeyframe, IoxContextSlot, IoxPipe, MatchMediaHost, NodeA11yContext, OverrideBreakpoint, PageScrollStart, PageStyleFieldState, PageStyleOptions, PageStyleSettings, PageTransitionCategory, PageTransitionCategoryMeta, PageTransitionContext, PageTransitionOptions, PageTransitionPreset, PipeArgSpec, PipeContext, PipeDescriptor, PlannedPageTransition, PressAction, RegisteredField, ResolvedPageTransition, ResponsiveLayer, ResponsiveOverrides, ResponsiveRuleSet, RouteAnimationLike, ScrollPlanContext, ScrollSource, SeoDerivedContent, SeoFieldSource, SeoFieldState, SeoResolveContext, SetContextParams, SettleOptions, SliderBootOptions, SliderControlElements, SliderInputs, StateRulePlan, StateScope, StateStyleMap, StringFormOptions, StyleMap, StyleTreeNode, SwiperBreakpointMap, SwiperModuleFlags, SwiperPlan, SwiperPlanContext, ToggleableAction, TransitionFeel, TransitionPhase, TransitionPreviewLayers, TransitionTimelineInput, TransitionViewport, ValueSource, VirtualTraitGroup };
|
package/package.json
CHANGED
package/scene-core/index.d.ts
CHANGED
|
@@ -70,8 +70,19 @@ interface SceneFrame {
|
|
|
70
70
|
declare enum SceneAttribute {
|
|
71
71
|
Root = "data-iox-scene",
|
|
72
72
|
Tracks = "data-iox-tracks",
|
|
73
|
-
PhoneTracks = "data-iox-tracks-phone"
|
|
73
|
+
PhoneTracks = "data-iox-tracks-phone",
|
|
74
|
+
/** A root's stage that is not a Scene's `scene.stage` part: the slider a scroll plays (premium M4). */
|
|
75
|
+
Stage = "data-iox-scene-stage"
|
|
74
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* A SLIDER THE SCROLL PLAYS (premium components M4 — M1.3's held gallery). Its progress rests on each picture and changes
|
|
79
|
+
* only over the middle share of each step, so every picture arrives and stays a moment while the page holds it: `p` is
|
|
80
|
+
* the scroll's progress through the runway (0–1), `n` the slides; the answer is Swiper's progress (0–1).
|
|
81
|
+
*/
|
|
82
|
+
declare const SLIDER_HOLD_SHARE = 0.2;
|
|
83
|
+
/** Page px of scroll per picture, as a share of the screen's height (the runway the renderers reserve). */
|
|
84
|
+
declare const SLIDER_SCROLL_STEP_SCREENS = 0.55;
|
|
85
|
+
declare function heldProgress(p: number, n: number): number;
|
|
75
86
|
/** At or under this stage width a layer plays its phone tracks. The `mobile` breakpoint's width. */
|
|
76
87
|
declare const SCENE_PHONE_MAX_WIDTH = 767;
|
|
77
88
|
/**
|
|
@@ -287,6 +298,11 @@ declare function buildSceneRecipe(create: CompositeNodeFactory, words?: Partial<
|
|
|
287
298
|
* - Reads come first in a frame and writes after, and a write only ever touches compositor properties.
|
|
288
299
|
*/
|
|
289
300
|
declare const SCENE_DAMPING = 9;
|
|
301
|
+
/**
|
|
302
|
+
* Dispatched (bubbling) by something the driver plays that arrived after the driver last looked — a Swiper booted on a
|
|
303
|
+
* slider's stage. Never a DOM `scroll`: nothing that follows the driver may dispatch one (SC2).
|
|
304
|
+
*/
|
|
305
|
+
declare const SCENE_WAKE_EVENT = "iox-scene-wake";
|
|
290
306
|
/** One frame of the damping: frame-rate independent, so 60 Hz and 120 Hz settle in the same time. */
|
|
291
307
|
declare function dampToward(current: number, target: number, seconds: number, rate?: number): number;
|
|
292
308
|
/** Where a root stands: scrolled `local` page px into its `travel`. `zoom` undoes the canvas's scale. */
|
|
@@ -321,9 +337,12 @@ declare class ScrollDriver {
|
|
|
321
337
|
private frame;
|
|
322
338
|
private lastTime;
|
|
323
339
|
private readonly wakeUp;
|
|
340
|
+
private readonly onWakeEvent;
|
|
324
341
|
constructor(options?: ScrollDriverOptions);
|
|
325
|
-
/** Drive a Scene's root. Idempotent: adding a root again re-reads it. */
|
|
326
|
-
add(root: HTMLElement):
|
|
342
|
+
/** Drive a Scene's root. Idempotent: adding a root again re-reads it. False when another driver holds it. */
|
|
343
|
+
add(root: HTMLElement): boolean;
|
|
344
|
+
/** True when this driver holds `root`. */
|
|
345
|
+
holds(root: HTMLElement): boolean;
|
|
327
346
|
remove(root: HTMLElement): void;
|
|
328
347
|
/** Read a root's layers again now, keeping where it stands: an editor changed their tracks. */
|
|
329
348
|
reread(root: HTMLElement): void;
|
|
@@ -366,6 +385,15 @@ declare class ScrollDriver {
|
|
|
366
385
|
/** A page's Scenes, driven by one driver; null when it holds none, or when the visitor asked for less motion (the
|
|
367
386
|
* page's own CSS then lets each Scene flow). The live site's door. */
|
|
368
387
|
declare function attachScenes(container: HTMLElement, options?: ScrollDriverOptions): ScrollDriver | null;
|
|
388
|
+
/**
|
|
389
|
+
* The Scene roots that belong to `elements` (each, and what it holds) — what one runtime instance owns: the page's nodes,
|
|
390
|
+
* or the globals'. Never a whole container that also holds another instance's Scenes (premium M4: the globals' instance
|
|
391
|
+
* scanned the app root and drove the page's Scenes a second time).
|
|
392
|
+
*/
|
|
393
|
+
declare function sceneRootsIn(elements: Iterable<Element>): HTMLElement[];
|
|
394
|
+
/** The live site's door for a runtime that owns some nodes: their Scenes on one driver (null when none, or under reduced
|
|
395
|
+
* motion — the page's own CSS then lets each Scene flow). A root another driver holds stays with it. */
|
|
396
|
+
declare function attachSceneRoots(roots: ReadonlyArray<HTMLElement>, options?: ScrollDriverOptions): ScrollDriver | null;
|
|
369
397
|
|
|
370
398
|
/**
|
|
371
399
|
* Text into pieces, in the browser only (premium sites SC3, Motion v2 §3c). A saved node keeps its plain text and the
|
|
@@ -416,5 +444,5 @@ declare function revealStagger(groups: number, by: TextRevealBy): number;
|
|
|
416
444
|
*/
|
|
417
445
|
declare function playTextReveal(el: HTMLElement, by: TextRevealBy, timing: KeyframeAnimationOptions): Animation | null;
|
|
418
446
|
|
|
419
|
-
export { LIGHT_UP_PIECE_CAP, REVEAL_PIECE_CAP, SCENE_BUDGET, SCENE_DAMPING, SCENE_FILM_SMOOTH, SCENE_FLOW_RULES, SCENE_LENGTH, SCENE_MAX_SCREENS, SCENE_MIN_SCREENS, SCENE_PHONE_LENGTH, SCENE_PHONE_MAX_WIDTH, SCENE_REDUCED_MOTION_CSS, SCENE_REVEAL_DEFAULT, SCENE_STAGE_HEIGHT, SCENE_TRACK_DEFS, SCENE_WORDS, SCENE_WORD_DIM, SceneAttribute, SceneProp, SceneRevealFrom, ScrollDriver, TextRevealBy, applySceneFirstFrame, attachScenes, buildSceneRecipe, colourAt, dampToward, lineIndexes, movedSceneKey, normalizeTracks, playTextReveal, revealClipPath, revealStagger, sceneBudget, sceneColourKeyAt, sceneDisplayValue, sceneFilmDensity, sceneFirstFrame, sceneFrame, sceneFrameDeclarations, sceneHasKeyAt, sceneHeightForScreens, sceneKeyPosition, sceneLayersOf, sceneNodeAttributes, scenePlayed, sceneRevealFromOf, sceneRootOnPath, sceneScreensOf, sceneScrollState, sceneTrackDef, sceneTrackSpan, sceneWordOpacity, sceneWordsLit, scenesIn, splitText, syncSceneAttributes, textPieces, valueAt, withSceneKey, withScenePlayback, withSceneRevealFrom, withoutSceneKey, withoutScenePlayback };
|
|
447
|
+
export { LIGHT_UP_PIECE_CAP, REVEAL_PIECE_CAP, SCENE_BUDGET, SCENE_DAMPING, SCENE_FILM_SMOOTH, SCENE_FLOW_RULES, SCENE_LENGTH, SCENE_MAX_SCREENS, SCENE_MIN_SCREENS, SCENE_PHONE_LENGTH, SCENE_PHONE_MAX_WIDTH, SCENE_REDUCED_MOTION_CSS, SCENE_REVEAL_DEFAULT, SCENE_STAGE_HEIGHT, SCENE_TRACK_DEFS, SCENE_WAKE_EVENT, SCENE_WORDS, SCENE_WORD_DIM, SLIDER_HOLD_SHARE, SLIDER_SCROLL_STEP_SCREENS, SceneAttribute, SceneProp, SceneRevealFrom, ScrollDriver, TextRevealBy, applySceneFirstFrame, attachSceneRoots, attachScenes, buildSceneRecipe, colourAt, dampToward, heldProgress, lineIndexes, movedSceneKey, normalizeTracks, playTextReveal, revealClipPath, revealStagger, sceneBudget, sceneColourKeyAt, sceneDisplayValue, sceneFilmDensity, sceneFirstFrame, sceneFrame, sceneFrameDeclarations, sceneHasKeyAt, sceneHeightForScreens, sceneKeyPosition, sceneLayersOf, sceneNodeAttributes, scenePlayed, sceneRevealFromOf, sceneRootOnPath, sceneRootsIn, sceneScreensOf, sceneScrollState, sceneTrackDef, sceneTrackSpan, sceneWordOpacity, sceneWordsLit, scenesIn, splitText, syncSceneAttributes, textPieces, valueAt, withSceneKey, withScenePlayback, withSceneRevealFrom, withoutSceneKey, withoutScenePlayback };
|
|
420
448
|
export type { SceneBudget, SceneFilmDensity, SceneFrame, SceneFrameOptions, SceneFrameState, SceneKey, SceneLayerNode, SceneNodeSource, SceneTrack, SceneTrackDef, SceneTreeNode, SceneWords, ScrollDriverOptions, SplitText, SplitTextOptions, TextPiece };
|
|
@@ -103,3 +103,28 @@ export function closeDialogAnimated(el: DialogElementLike, options: ExitMotionOp
|
|
|
103
103
|
export function dialogTogglesClosed(el: Pick<DialogElementLike, 'open' | 'hasAttribute'>): boolean {
|
|
104
104
|
return el.open && !el.hasAttribute(DIALOG_CLOSING_ATTRIBUTE);
|
|
105
105
|
}
|
|
106
|
+
|
|
107
|
+
/** The element-style marker a styled dialog carries (design-core ELEMENT_STYLE_MARKER_CLASS — actions-core does not
|
|
108
|
+
* import design-core). */
|
|
109
|
+
const STYLED_DIALOG_CLASS = 'iox-es';
|
|
110
|
+
|
|
111
|
+
export interface FocusableSheet {
|
|
112
|
+
classList: { contains(token: string): boolean };
|
|
113
|
+
querySelector(selector: string): unknown;
|
|
114
|
+
hasAttribute(name: string): boolean;
|
|
115
|
+
setAttribute(name: string, value: string): void;
|
|
116
|
+
focus(options?: FocusOptions): void;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* A styled dialog a visitor just opened takes focus on its SHEET (premium components M4 — M1.1's carry-over). A bare
|
|
121
|
+
* `showModal()` focuses its first control, and a phone can ring it after a tap; the sheet never rings (iox-design.css) and
|
|
122
|
+
* the first Tab moves to that control, with its ring. A dialog with an author's `[autofocus]` keeps it; a dialog saved
|
|
123
|
+
* before element styles keeps the browser's behaviour. True when the sheet took focus.
|
|
124
|
+
*/
|
|
125
|
+
export function focusDialogSheet(dialog: FocusableSheet | null | undefined): boolean {
|
|
126
|
+
if (!dialog || !dialog.classList.contains(STYLED_DIALOG_CLASS) || dialog.querySelector('[autofocus]')) return false;
|
|
127
|
+
if (!dialog.hasAttribute('tabindex')) dialog.setAttribute('tabindex', '-1');
|
|
128
|
+
dialog.focus({ preventScroll: true });
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HeaderBehaviour, HeaderEdge, headerBehaviourOf, headerEdgeOf, headerStaysAtTop, HeaderTrait } from '@vectoriox/iox-ui/design-core';
|
|
2
|
+
|
|
3
|
+
import { CompositeNode, readProp, readStyle, writeProp, writeStyles } from './composite-node';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Set how a header behaves as the page scrolls (premium components T2, M4) — ONE edit for the builder's Header section
|
|
7
|
+
* and the composer (generation-core), on either node shape. A header that stays at the top is the containing block of its
|
|
8
|
+
* edge: the live site makes it sticky (iox-design.css), and a header stored `static` becomes `relative` — what the canvas,
|
|
9
|
+
* which forces a node's own position, draws it with. Nothing else of the author's is touched.
|
|
10
|
+
*/
|
|
11
|
+
export function setHeaderBehaviour(node: CompositeNode, behaviour: HeaderBehaviour | `${HeaderBehaviour}`, edge: HeaderEdge | `${HeaderEdge}` | null): void {
|
|
12
|
+
const b = headerBehaviourOf(behaviour);
|
|
13
|
+
writeProp(node, HeaderTrait.Behaviour, b);
|
|
14
|
+
writeProp(node, HeaderTrait.Edge, headerEdgeOf(edge) ?? '');
|
|
15
|
+
const position = readStyle(node, 'position');
|
|
16
|
+
if (headerStaysAtTop(b) && (position === undefined || position === null || position === '' || position === 'static')) writeStyles(node, { position: 'relative' });
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** The header's behaviour and edge as stored (Scrolls / none for a header that never chose). */
|
|
20
|
+
export function headerBehaviourOfNode(node: CompositeNode | null | undefined): { behaviour: HeaderBehaviour; edge: HeaderEdge | null } {
|
|
21
|
+
return {
|
|
22
|
+
behaviour: headerBehaviourOf(node ? readProp(node, HeaderTrait.Behaviour) : undefined),
|
|
23
|
+
edge: headerEdgeOf(node ? readProp(node, HeaderTrait.Edge) : undefined),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -178,3 +178,85 @@ export function attachCarouselA11y(swiper: CarouselSwiper, options: CarouselA11y
|
|
|
178
178
|
carouselOf(swiper.el)?.destroy();
|
|
179
179
|
return new CarouselA11y(swiper, options);
|
|
180
180
|
}
|
|
181
|
+
|
|
182
|
+
// ── The bar's words (premium components M4, M1.3) ──────────────────────────────────────────────────────
|
|
183
|
+
|
|
184
|
+
/** Where the Caption and the Count parts get their words: generated content (`attr()`), never the element's text — so
|
|
185
|
+
* the canvas's Text component and the runtime never write the same node. */
|
|
186
|
+
export const SLIDER_TEXT_ATTRIBUTE = 'data-iox-text';
|
|
187
|
+
/** A slide's caption, written by every renderer (iox-ui `nodeA11yAttributes`, SLIDE_CAPTION_ATTRIBUTE). */
|
|
188
|
+
const CAPTION_ATTRIBUTE = 'data-iox-caption';
|
|
189
|
+
/** Held for a frame while the caption changes, so its new words fade in (iox-design.css). */
|
|
190
|
+
export const SLIDER_SWAPPING_ATTRIBUTE = 'data-iox-swapping';
|
|
191
|
+
const BAR_RUNTIME_KEY = '__ioxSliderBar';
|
|
192
|
+
|
|
193
|
+
/** What the caption says for a slide: its own caption, else its picture's description, else nothing. */
|
|
194
|
+
export function sliderCaptionOf(slide: Element | null | undefined): string {
|
|
195
|
+
if (!slide) return '';
|
|
196
|
+
const holder = slide.hasAttribute(CAPTION_ATTRIBUTE) ? slide : slide.querySelector(`[${CAPTION_ATTRIBUTE}]`);
|
|
197
|
+
const own = holder?.getAttribute(CAPTION_ATTRIBUTE)?.trim();
|
|
198
|
+
if (own) return own;
|
|
199
|
+
return slide.querySelector('img[alt]')?.getAttribute('alt')?.trim() ?? '';
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** "2 / 5" — the slide in view and how many there are; nothing for an empty slider. */
|
|
203
|
+
export function sliderCountText(index: number, total: number): string {
|
|
204
|
+
if (!(total > 0)) return '';
|
|
205
|
+
const i = Math.min(total - 1, Math.max(0, Math.floor(Number.isFinite(index) ? index : 0)));
|
|
206
|
+
return `${i + 1} / ${total}`;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** The parts of a running Swiper the bar's runtime reads. */
|
|
210
|
+
export interface BarSwiper {
|
|
211
|
+
el: HTMLElement;
|
|
212
|
+
slides: HTMLElement[];
|
|
213
|
+
activeIndex: number;
|
|
214
|
+
realIndex?: number;
|
|
215
|
+
destroyed?: boolean;
|
|
216
|
+
on(event: string, handler: (...args: unknown[]) => void): void;
|
|
217
|
+
off(event: string, handler: (...args: unknown[]) => void): void;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Keep the bar's Caption and Count on the slide in view — the canvas, Preview and both engine paths (bootSlider). The
|
|
222
|
+
* caption changes behind a short fade (the first one does not); the count reads left to right in every language.
|
|
223
|
+
* Returns the stop; a slider with neither part gets a no-op.
|
|
224
|
+
*/
|
|
225
|
+
export function attachSliderBar(swiper: BarSwiper): () => void {
|
|
226
|
+
((swiper.el as unknown as Record<string, () => void>)[BAR_RUNTIME_KEY])?.();
|
|
227
|
+
const caption = sliderPartElement(swiper.el, SliderRole.Caption);
|
|
228
|
+
const count = sliderPartElement(swiper.el, SliderRole.Count);
|
|
229
|
+
if (!caption && !count) return () => { /* nothing to keep */ };
|
|
230
|
+
const view = swiper.el.ownerDocument?.defaultView;
|
|
231
|
+
const raf = (fn: () => void) => (view?.requestAnimationFrame ? view.requestAnimationFrame(() => view.requestAnimationFrame(fn)) : setTimeout(fn, 32));
|
|
232
|
+
let first = true;
|
|
233
|
+
const sync = () => {
|
|
234
|
+
if (swiper.destroyed) return;
|
|
235
|
+
const slides = swiper.slides ?? [];
|
|
236
|
+
if (count) {
|
|
237
|
+
count.setAttribute('dir', 'ltr');
|
|
238
|
+
count.setAttribute(SLIDER_TEXT_ATTRIBUTE, sliderCountText(swiper.realIndex ?? swiper.activeIndex, slides.length));
|
|
239
|
+
}
|
|
240
|
+
if (caption) {
|
|
241
|
+
const words = sliderCaptionOf(slides[swiper.activeIndex]);
|
|
242
|
+
if (caption.getAttribute(SLIDER_TEXT_ATTRIBUTE) !== words) {
|
|
243
|
+
if (!first) {
|
|
244
|
+
caption.setAttribute(SLIDER_SWAPPING_ATTRIBUTE, '');
|
|
245
|
+
raf(() => caption.removeAttribute(SLIDER_SWAPPING_ATTRIBUTE));
|
|
246
|
+
}
|
|
247
|
+
caption.setAttribute(SLIDER_TEXT_ATTRIBUTE, words);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
first = false;
|
|
251
|
+
};
|
|
252
|
+
swiper.on('slideChange', sync);
|
|
253
|
+
swiper.on('slidesLengthChange', sync);
|
|
254
|
+
sync();
|
|
255
|
+
const stop = () => {
|
|
256
|
+
swiper.off('slideChange', sync);
|
|
257
|
+
swiper.off('slidesLengthChange', sync);
|
|
258
|
+
delete (swiper.el as unknown as Record<string, unknown>)[BAR_RUNTIME_KEY];
|
|
259
|
+
};
|
|
260
|
+
(swiper.el as unknown as Record<string, () => void>)[BAR_RUNTIME_KEY] = stop;
|
|
261
|
+
return stop;
|
|
262
|
+
}
|