@ethlete/core 5.0.0-next.35 → 5.0.0-next.36
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/CHANGELOG.md +39 -0
- package/fesm2022/ethlete-core.mjs +170 -23
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ethlete-core.d.ts +105 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @ethlete/core
|
|
2
2
|
|
|
3
|
+
## 5.0.0-next.36
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#3040](https://github.com/ethlete-io/ethdk/pull/3040) [`e052061`](https://github.com/ethlete-io/ethdk/commit/e0520614647b784f19ad55a4d7f6df47acec154e) Thanks [@github-actions](https://github.com/apps/github-actions)! - Localization: one mechanism for every string the library renders. `createLabels` (core) backs a
|
|
8
|
+
`provide<Domain>Labels` / `inject<Domain>Labels` pair per domain — 22 of them, all locale-reactive and
|
|
9
|
+
signal-shaped. See the [localization guide](https://ethlete-sdk-docs-next.web.app/components/localization).
|
|
10
|
+
|
|
11
|
+
- New tokens make the rich text editor, stream, grid, loader, chip, calendar, time picker, dropzone,
|
|
12
|
+
select, cascader, phone input, slider, date/time and notification strings overridable.
|
|
13
|
+
- **Breaking:** `inject*Labels()` now returns a signal; the string fields left `StreamConsentConfig`,
|
|
14
|
+
`StreamPlayerErrorConfig`, `PipSlotPlaceholderConfig`, `GridConfig` and `NotificationManagerConfig`
|
|
15
|
+
(with their `transformer` hooks); per-instance label inputs default to `null` instead of English.
|
|
16
|
+
- Fixes the PiP close/back buttons, which set an attribute literally named `attr.aria-label`.
|
|
17
|
+
|
|
18
|
+
- [#3040](https://github.com/ethlete-io/ethdk/pull/3040) [`38bb816`](https://github.com/ethlete-io/ethdk/commit/38bb8165006c4ebfba6a34623468ded140002188) Thanks [@github-actions](https://github.com/apps/github-actions)! - Card presets and a tabs variant: `et-radio` and `et-choice-field` take `variant="card"` (full-width clickable
|
|
19
|
+
panel, label leading, selection on the border and label), and `et-segmented-button-group` takes `variant="tabs"` (underlined
|
|
20
|
+
selection instead of a filled pill). Closes the last cdk parity gaps.
|
|
21
|
+
|
|
22
|
+
`@ethlete/core` adds `injectRouterNavigationState<T>()` for reading the state a navigation was given.
|
|
23
|
+
|
|
24
|
+
- [#3040](https://github.com/ethlete-io/ethdk/pull/3040) [`4624559`](https://github.com/ethlete-io/ethdk/commit/4624559c81ed9b6efffc539b8f1dd0db0556420c) Thanks [@github-actions](https://github.com/apps/github-actions)! - RTL and reduced-motion consistency pass:
|
|
25
|
+
|
|
26
|
+
- Side sheets and the notification stack dock, animate and drag toward their logical inline edge under `dir="rtl"` — `dragToDismiss.direction` gains `'to-inline-start'` / `'to-inline-end'`.
|
|
27
|
+
- `createFlipAnimation` and the PiP animations now skip to their end state under `prefers-reduced-motion`; `ignoreReducedMotion` opts out, and `matchesReducedMotion()` is exported for helpers with no injection context.
|
|
28
|
+
- The full-screen overlay animation throws `ET1209` when it has no origin element, instead of a bare `Error`.
|
|
29
|
+
|
|
30
|
+
- [#3040](https://github.com/ethlete-io/ethdk/pull/3040) [`f6061e1`](https://github.com/ethlete-io/ethdk/commit/f6061e162aacd3c847ad1a9c9c9ef13d2e494b7f) Thanks [@github-actions](https://github.com/apps/github-actions)! - `createSwipeTracker` now reports the release velocity — measured over the trailing
|
|
31
|
+
100ms of the gesture (`SWIPE_VELOCITY_WINDOW_MS`) — in `pixelPerSecondX/Y` instead
|
|
32
|
+
of the whole-gesture average. A slow drag ending in a flick reports the flick, and a
|
|
33
|
+
flick parked before release reports ~0.
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- [#3040](https://github.com/ethlete-io/ethdk/pull/3040) [`b06ed44`](https://github.com/ethlete-io/ethdk/commit/b06ed44db47a52d2a07a4d9a6b3bd3b04011decb) Thanks [@github-actions](https://github.com/apps/github-actions)! - Overlay: the anchored arrow no longer rides into a pane's rounded corner on aligned placements or when a pane
|
|
38
|
+
shifts near a viewport edge. `arrowPadding` now measures the arrow's actual base, so it means "how close the
|
|
39
|
+
arrow may get to the corners" — tooltip and toggletip default to `20` (was `8`), a bare anchored strategy to
|
|
40
|
+
`12` (was `4`).
|
|
41
|
+
|
|
3
42
|
## 5.0.0-next.35
|
|
4
43
|
|
|
5
44
|
### Minor Changes
|
|
@@ -1972,7 +1972,12 @@ const signalStyles = (el, styleMap) => {
|
|
|
1972
1972
|
const signalHostStyles = (styleMap) => signalStyles(inject(ElementRef), styleMap);
|
|
1973
1973
|
|
|
1974
1974
|
const elementCanScroll = (element, direction) => {
|
|
1975
|
-
|
|
1975
|
+
// Omitting the element means "the document scroller". Resolved lazily and guarded so a call on the
|
|
1976
|
+
// server answers "cannot scroll" instead of throwing on a missing `document`.
|
|
1977
|
+
const el = element || (typeof document === 'undefined' ? null : document.documentElement);
|
|
1978
|
+
if (!el) {
|
|
1979
|
+
return false;
|
|
1980
|
+
}
|
|
1976
1981
|
const { scrollHeight, clientHeight, scrollWidth, clientWidth } = el;
|
|
1977
1982
|
if (direction === 'x') {
|
|
1978
1983
|
return scrollWidth > clientWidth;
|
|
@@ -1982,17 +1987,25 @@ const elementCanScroll = (element, direction) => {
|
|
|
1982
1987
|
}
|
|
1983
1988
|
return scrollHeight > clientHeight || scrollWidth > clientWidth;
|
|
1984
1989
|
};
|
|
1985
|
-
const createViewportRect = () =>
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
width
|
|
1991
|
-
height
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1990
|
+
const createViewportRect = () => {
|
|
1991
|
+
// Collapses to a zero rect where there is no window (server). `isElementVisible` never reaches the
|
|
1992
|
+
// intersection math there anyway — `elementCanScroll` already reports the document as unscrollable
|
|
1993
|
+
// — so the rect only has to be a valid shape.
|
|
1994
|
+
const hasWindow = typeof window !== 'undefined';
|
|
1995
|
+
const width = hasWindow ? window.innerWidth : 0;
|
|
1996
|
+
const height = hasWindow ? window.innerHeight : 0;
|
|
1997
|
+
return {
|
|
1998
|
+
left: 0,
|
|
1999
|
+
top: 0,
|
|
2000
|
+
right: width,
|
|
2001
|
+
bottom: height,
|
|
2002
|
+
width,
|
|
2003
|
+
height,
|
|
2004
|
+
x: 0,
|
|
2005
|
+
y: 0,
|
|
2006
|
+
toJSON: () => ({}),
|
|
2007
|
+
};
|
|
2008
|
+
};
|
|
1996
2009
|
const isElementVisible = (options) => {
|
|
1997
2010
|
const { container, element } = options;
|
|
1998
2011
|
if (!element) {
|
|
@@ -2961,6 +2974,31 @@ const injectPathParamChanges = memoizeSignal(() => {
|
|
|
2961
2974
|
return changes;
|
|
2962
2975
|
});
|
|
2963
2976
|
});
|
|
2977
|
+
/**
|
|
2978
|
+
* The state handed to the navigation that is currently in progress, i.e. what
|
|
2979
|
+
* `router.navigate(…, { state })` passed — typed to whatever you expect.
|
|
2980
|
+
*
|
|
2981
|
+
* Read **synchronously**, in a constructor or a resolver, and deliberately not a signal: navigation state exists
|
|
2982
|
+
* only for the duration of the navigation that carries it. By the time an effect flushed, the navigation would be
|
|
2983
|
+
* over and the answer always `null`. Returns `null` when there is no navigation in flight or it carried no state —
|
|
2984
|
+
* which is the normal case for a page arrived at by typing its URL, so always handle it.
|
|
2985
|
+
*
|
|
2986
|
+
* Use it for the things a URL should not carry: a "you were redirected because…" reason, a pre-fetched object the
|
|
2987
|
+
* previous page already had, a scroll intent. Anything the page needs to survive a reload belongs in the URL.
|
|
2988
|
+
*
|
|
2989
|
+
* @example
|
|
2990
|
+
* type CheckoutNavState = { fromCart: boolean };
|
|
2991
|
+
*
|
|
2992
|
+
* export class CheckoutComponent {
|
|
2993
|
+
* private navState = injectRouterNavigationState<CheckoutNavState>();
|
|
2994
|
+
*
|
|
2995
|
+
* protected cameFromCart = this.navState?.fromCart ?? false;
|
|
2996
|
+
* }
|
|
2997
|
+
*/
|
|
2998
|
+
const injectRouterNavigationState = () => {
|
|
2999
|
+
const router = inject(Router);
|
|
3000
|
+
return router.getCurrentNavigation()?.extras.state ?? null;
|
|
3001
|
+
};
|
|
2964
3002
|
|
|
2965
3003
|
const ET_DISABLE_SCROLL_TOP = Symbol('ET_DISABLE_SCROLL_TOP');
|
|
2966
3004
|
const ET_DISABLE_SCROLL_TOP_AS_RETURN_ROUTE = Symbol('ET_DISABLE_SCROLL_TOP_AS_RETURN_ROUTE');
|
|
@@ -3763,6 +3801,8 @@ const getClientXY = (event) => {
|
|
|
3763
3801
|
}
|
|
3764
3802
|
return { clientX: event.clientX, clientY: event.clientY };
|
|
3765
3803
|
};
|
|
3804
|
+
/** Trailing window over which {@link SwipeTracker.end} measures the release velocity. */
|
|
3805
|
+
const SWIPE_VELOCITY_WINDOW_MS = 100;
|
|
3766
3806
|
const createSwipeTracker = (startEvent) => {
|
|
3767
3807
|
const { clientX: originClientX, clientY: originClientY } = getClientXY(startEvent);
|
|
3768
3808
|
const startTime = Date.now();
|
|
@@ -3770,10 +3810,25 @@ const createSwipeTracker = (startEvent) => {
|
|
|
3770
3810
|
let movementY = 0;
|
|
3771
3811
|
let isSwiping = false;
|
|
3772
3812
|
let isScrolling = false;
|
|
3813
|
+
/**
|
|
3814
|
+
* Recent positions, oldest first, used to derive the release velocity. Trimmed to the trailing
|
|
3815
|
+
* window plus the one sample just before it, which serves as that window's baseline.
|
|
3816
|
+
*/
|
|
3817
|
+
let samples = [{ t: startTime, movementX: 0, movementY: 0 }];
|
|
3773
3818
|
const update = (event) => {
|
|
3774
3819
|
const { clientX, clientY } = getClientXY(event);
|
|
3775
3820
|
movementX = clientX - originClientX;
|
|
3776
3821
|
movementY = clientY - originClientY;
|
|
3822
|
+
const now = Date.now();
|
|
3823
|
+
samples.push({ t: now, movementX, movementY });
|
|
3824
|
+
// Trim against the newest sample rather than `now + window`: `end()` measures from its own
|
|
3825
|
+
// timestamp, which is never earlier, so this always keeps a superset of what it needs.
|
|
3826
|
+
const cutoff = now - SWIPE_VELOCITY_WINDOW_MS;
|
|
3827
|
+
let dropCount = 0;
|
|
3828
|
+
while (dropCount + 1 < samples.length && samples[dropCount + 1].t < cutoff)
|
|
3829
|
+
dropCount++;
|
|
3830
|
+
if (dropCount)
|
|
3831
|
+
samples = samples.slice(dropCount);
|
|
3777
3832
|
const positiveMovementX = Math.abs(movementX);
|
|
3778
3833
|
const positiveMovementY = Math.abs(movementY);
|
|
3779
3834
|
if (!isSwiping && !isScrolling) {
|
|
@@ -3796,12 +3851,31 @@ const createSwipeTracker = (startEvent) => {
|
|
|
3796
3851
|
isSwiping,
|
|
3797
3852
|
};
|
|
3798
3853
|
};
|
|
3854
|
+
const measureReleaseVelocity = (endTime) => {
|
|
3855
|
+
const windowStart = endTime - SWIPE_VELOCITY_WINDOW_MS;
|
|
3856
|
+
const firstInWindow = samples.findIndex((sample) => sample.t >= windowStart);
|
|
3857
|
+
// Nothing moved during the window: the pointer was held still before release, so the gesture
|
|
3858
|
+
// carries no momentum no matter how fast it started out.
|
|
3859
|
+
if (firstInWindow === -1)
|
|
3860
|
+
return { x: 0, y: 0 };
|
|
3861
|
+
const newest = samples[samples.length - 1];
|
|
3862
|
+
// Measure across the window when it holds a span of its own. With a single sample in it — a
|
|
3863
|
+
// pointer emitting moves slower than the window — reach back one sample for a baseline instead
|
|
3864
|
+
// of reporting nothing.
|
|
3865
|
+
const hasSpanInWindow = samples.length - firstInWindow >= 2;
|
|
3866
|
+
const baseline = samples[hasSpanInWindow ? firstInWindow : Math.max(0, firstInWindow - 1)];
|
|
3867
|
+
const elapsed = newest.t - baseline.t;
|
|
3868
|
+
if (elapsed <= 0)
|
|
3869
|
+
return { x: 0, y: 0 };
|
|
3870
|
+
return {
|
|
3871
|
+
x: ((newest.movementX - baseline.movementX) / elapsed) * 1000,
|
|
3872
|
+
y: ((newest.movementY - baseline.movementY) / elapsed) * 1000,
|
|
3873
|
+
};
|
|
3874
|
+
};
|
|
3799
3875
|
const end = () => {
|
|
3800
|
-
const swipeTime = Math.max(1, Date.now() - startTime);
|
|
3801
3876
|
const positiveMovementX = Math.abs(movementX);
|
|
3802
3877
|
const positiveMovementY = Math.abs(movementY);
|
|
3803
|
-
const pixelPerSecondX = (
|
|
3804
|
-
const pixelPerSecondY = (movementY / swipeTime) * 1000;
|
|
3878
|
+
const { x: pixelPerSecondX, y: pixelPerSecondY } = measureReleaseVelocity(Date.now());
|
|
3805
3879
|
return {
|
|
3806
3880
|
movementX,
|
|
3807
3881
|
movementY,
|
|
@@ -3818,6 +3892,7 @@ const createSwipeTracker = (startEvent) => {
|
|
|
3818
3892
|
const cancel = () => {
|
|
3819
3893
|
movementX = 0;
|
|
3820
3894
|
movementY = 0;
|
|
3895
|
+
samples = [{ t: Date.now(), movementX: 0, movementY: 0 }];
|
|
3821
3896
|
};
|
|
3822
3897
|
return { update, end, cancel };
|
|
3823
3898
|
};
|
|
@@ -3905,6 +3980,56 @@ const [provideLocale, injectLocale] = createRootProvider(() => {
|
|
|
3905
3980
|
name: 'Locale',
|
|
3906
3981
|
});
|
|
3907
3982
|
|
|
3983
|
+
const resolveSource = (source, locale) => typeof source === 'function' ? source(locale) : source;
|
|
3984
|
+
/**
|
|
3985
|
+
* The one mechanism for the strings a component renders or announces itself. Every domain in the UI
|
|
3986
|
+
* library that has such strings exposes exactly this pair — `provide<Domain>Labels` to localize a
|
|
3987
|
+
* subtree, `inject<Domain>Labels()` to read the result — so localizing an app is the same move
|
|
3988
|
+
* repeated per domain rather than a different one each time.
|
|
3989
|
+
*
|
|
3990
|
+
* `defaults` may itself be locale-derived, for a domain that ships more than one language (the
|
|
3991
|
+
* `@ethlete/query` error tables, say). Overrides are partial and layer on top of whatever the locale
|
|
3992
|
+
* resolved to, so translating into a third language while keeping a shipped one as the base is the
|
|
3993
|
+
* same call.
|
|
3994
|
+
*
|
|
3995
|
+
* The injector returns a **signal**, because both halves can change at runtime — read it in a
|
|
3996
|
+
* template or computed, never destructure it once.
|
|
3997
|
+
*
|
|
3998
|
+
* @example
|
|
3999
|
+
* export type BreadcrumbLabels = { navigation: string; overflow: string };
|
|
4000
|
+
*
|
|
4001
|
+
* export const DEFAULT_BREADCRUMB_LABELS: BreadcrumbLabels = {
|
|
4002
|
+
* navigation: 'Breadcrumb',
|
|
4003
|
+
* overflow: 'Show hidden levels',
|
|
4004
|
+
* };
|
|
4005
|
+
*
|
|
4006
|
+
* export const [provideBreadcrumbLabels, injectBreadcrumbLabels, BREADCRUMB_LABELS] =
|
|
4007
|
+
* createLabels<BreadcrumbLabels>('BREADCRUMB_LABELS', DEFAULT_BREADCRUMB_LABELS);
|
|
4008
|
+
*
|
|
4009
|
+
* @example
|
|
4010
|
+
* // consumer, fixed wording
|
|
4011
|
+
* provideBreadcrumbLabels({ navigation: 'Brotkrumen' });
|
|
4012
|
+
*
|
|
4013
|
+
* // consumer, driven by the app's i18n and re-resolved on a locale change
|
|
4014
|
+
* provideBreadcrumbLabels((locale) => ({ navigation: translate('breadcrumb.nav', locale) }));
|
|
4015
|
+
*/
|
|
4016
|
+
const createLabels = (name, defaults) => {
|
|
4017
|
+
const token = new InjectionToken(name, {
|
|
4018
|
+
providedIn: 'root',
|
|
4019
|
+
factory: () => ({}),
|
|
4020
|
+
});
|
|
4021
|
+
const provide = (labels) => ({ provide: token, useValue: labels });
|
|
4022
|
+
const injectFn = () => {
|
|
4023
|
+
const source = inject(token);
|
|
4024
|
+
const { currentLocale } = injectLocale();
|
|
4025
|
+
return computed(() => {
|
|
4026
|
+
const locale = currentLocale();
|
|
4027
|
+
return { ...resolveSource(defaults, locale), ...resolveSource(source, locale) };
|
|
4028
|
+
});
|
|
4029
|
+
};
|
|
4030
|
+
return [provide, injectFn, token];
|
|
4031
|
+
};
|
|
4032
|
+
|
|
3908
4033
|
const [provideStyleManager, injectStyleManager] = createRootProvider(() => {
|
|
3909
4034
|
const appRef = inject(ApplicationRef);
|
|
3910
4035
|
const destroyRef = inject(DestroyRef);
|
|
@@ -3987,8 +4112,23 @@ const fromNextFrame = () => {
|
|
|
3987
4112
|
});
|
|
3988
4113
|
});
|
|
3989
4114
|
};
|
|
3990
|
-
const forceReflow = (element
|
|
3991
|
-
|
|
4115
|
+
const forceReflow = (element) => {
|
|
4116
|
+
// The `document.body` fallback is resolved lazily and guarded: there is nothing to reflow on the
|
|
4117
|
+
// server, so this becomes a no-op instead of throwing on a missing `document`.
|
|
4118
|
+
const el = element ?? (typeof document === 'undefined' ? null : document.body);
|
|
4119
|
+
return el?.offsetHeight ?? 0;
|
|
4120
|
+
};
|
|
4121
|
+
/**
|
|
4122
|
+
* Whether the user asked for reduced motion, read straight from `matchMedia`.
|
|
4123
|
+
*
|
|
4124
|
+
* Inside a component, prefer the reactive `injectPrefersReducedMotion()`. This is for the animation
|
|
4125
|
+
* helpers that run from effects, event handlers and imperative APIs, where there is no injection
|
|
4126
|
+
* context. Pass the element being animated so the query resolves against its own window — otherwise
|
|
4127
|
+
* an animation inside an iframe would read the top-level document's preference.
|
|
4128
|
+
*/
|
|
4129
|
+
const matchesReducedMotion = (element) => {
|
|
4130
|
+
const view = element?.ownerDocument.defaultView ?? (typeof window === 'undefined' ? null : window);
|
|
4131
|
+
return view?.matchMedia('(prefers-reduced-motion: reduce)').matches ?? false;
|
|
3992
4132
|
};
|
|
3993
4133
|
|
|
3994
4134
|
const ANIMATED_LIFECYCLE_TOKEN = new InjectionToken('ANIMATED_LIFECYCLE_DIRECTIVE_TOKEN');
|
|
@@ -4677,11 +4817,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
4677
4817
|
}], ctorParameters: () => [], propDecorators: { placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], fallbackPlacements: [{ type: i0.Input, args: [{ isSignal: true, alias: "fallbackPlacements", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], arrowPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrowPadding", required: false }] }], viewportPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewportPadding", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }], shift: [{ type: i0.Input, args: [{ isSignal: true, alias: "shift", required: false }] }], autoHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoHide", required: false }] }], autoCloseIfReferenceHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCloseIfReferenceHidden", required: false }] }], referenceElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "referenceElement", required: false }] }], mirrorWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "mirrorWidth", required: false }] }] } });
|
|
4678
4818
|
|
|
4679
4819
|
const createFlipAnimationGroup = (config) => {
|
|
4680
|
-
const { elements, duration = 250, easing = 'cubic-bezier(0.4, 0, 0.2, 1)' } = config;
|
|
4820
|
+
const { elements, duration = 250, easing = 'cubic-bezier(0.4, 0, 0.2, 1)', ignoreReducedMotion } = config;
|
|
4681
4821
|
const flips = elements.map((el) => {
|
|
4682
4822
|
const element = 'element' in el ? el.element : el;
|
|
4683
4823
|
const originElement = 'originElement' in el ? el.originElement : undefined;
|
|
4684
|
-
return createFlipAnimation({ element, originElement, duration, easing });
|
|
4824
|
+
return createFlipAnimation({ element, originElement, duration, easing, ignoreReducedMotion });
|
|
4685
4825
|
});
|
|
4686
4826
|
const onStart$ = combineLatest(flips.map((animation) => animation.onStart$));
|
|
4687
4827
|
const onFinish$ = combineLatest(flips.map((animation) => animation.onFinish$));
|
|
@@ -4705,7 +4845,7 @@ const createFlipAnimationGroup = (config) => {
|
|
|
4705
4845
|
};
|
|
4706
4846
|
};
|
|
4707
4847
|
const createFlipAnimation = (config) => {
|
|
4708
|
-
const { element: el, originElement = el, duration = 250, easing = 'cubic-bezier(0.4, 0, 0.2, 1)' } = config;
|
|
4848
|
+
const { element: el, originElement = el, duration = 250, easing = 'cubic-bezier(0.4, 0, 0.2, 1)', ignoreReducedMotion = false, } = config;
|
|
4709
4849
|
let initialRect = originElement.getBoundingClientRect();
|
|
4710
4850
|
let animation = null;
|
|
4711
4851
|
const onStart$ = new Subject();
|
|
@@ -4737,6 +4877,10 @@ const createFlipAnimation = (config) => {
|
|
|
4737
4877
|
scaleX: initialRect.width / lastRect.width,
|
|
4738
4878
|
scaleY: initialRect.height / lastRect.height,
|
|
4739
4879
|
};
|
|
4880
|
+
// Under reduced motion the element jumps straight to its final position. Collapsing the duration
|
|
4881
|
+
// instead of bailing out keeps the `Animation` lifecycle intact, so callers that wait on
|
|
4882
|
+
// `onFinish$` to clean up still get their event.
|
|
4883
|
+
const effectiveDuration = !ignoreReducedMotion && matchesReducedMotion(el) ? 0 : duration;
|
|
4740
4884
|
animation = el.animate([
|
|
4741
4885
|
{
|
|
4742
4886
|
transformOrigin: 'top left',
|
|
@@ -4750,7 +4894,7 @@ const createFlipAnimation = (config) => {
|
|
|
4750
4894
|
transform: 'none',
|
|
4751
4895
|
},
|
|
4752
4896
|
], {
|
|
4753
|
-
duration,
|
|
4897
|
+
duration: effectiveDuration,
|
|
4754
4898
|
easing,
|
|
4755
4899
|
fill: 'both',
|
|
4756
4900
|
});
|
|
@@ -5218,7 +5362,10 @@ const createAnchoredPositionCleanup = (strategy, paneElement, overlayRef, render
|
|
|
5218
5362
|
if (arrowElement) {
|
|
5219
5363
|
middleware.push(arrow({
|
|
5220
5364
|
element: arrowElement,
|
|
5221
|
-
|
|
5365
|
+
// keeps the arrow off a rounded pane corner by default: 12px covers the radius of the
|
|
5366
|
+
// built-in boxed panes (--et-overlay-radius). Panes with a larger radius have to pass their
|
|
5367
|
+
// own — an arrow whose base sits on the corner arc looks detached from the pane.
|
|
5368
|
+
padding: strategy.arrowPadding ?? 12,
|
|
5222
5369
|
}));
|
|
5223
5370
|
}
|
|
5224
5371
|
if (strategy.autoHide || strategy.autoCloseIfReferenceHidden) {
|
|
@@ -8459,5 +8606,5 @@ const createUnsavedChangesGuard = (config) => {
|
|
|
8459
8606
|
* Generated bundle index. Do not edit.
|
|
8460
8607
|
*/
|
|
8461
8608
|
|
|
8462
|
-
export { ANIMATABLE_TOKEN, ANIMATED_IF_TOKEN, ANIMATED_LIFECYCLE_TOKEN, ANIMATION_DEBUG_STORAGE_KEY, AT_LEAST_ONE_REQUIRED, AnimatableDirective, AnimatedIfDirective, AnimatedLifecycleDirective, AnimatedOverlayDirective, AutoSurfaceDirective, BOUNDARY_ELEMENT_TOKEN, BREAKPOINT_INSTANCE_TOKEN, BREAKPOINT_ORDER, COLOR_PROVIDER, ClickOutsideDirective, ColorInteractiveContainerDirective, ColorInteractiveDirective, ColorInteractiveExcludeDirective, ColorInteractiveHasFocusDirective, DEFAULT_MULTI_INSTANCE_RELS, DEFAULT_MULTI_INSTANCE_TAGS, DEFAULT_VIEWPORT_CONFIG, DISABLE_LOGGER_PARAM, DragHandleDirective, ET_DISABLE_SCROLL_TOP, ET_DISABLE_SCROLL_TOP_AS_RETURN_ROUTE, ET_DISABLE_SCROLL_TOP_ON_PATH_PARAM_CHANGE, ET_PROPERTY_REMOVED, FOCUSABLE_SELECTOR, FOCUS_VISIBLE_TRACKER_TOKEN, HtmlToMarkdownPipe, IS_ARRAY_NOT_EMPTY, IS_EMAIL, InferMimeTypePipe, InitialsPipe, IsArrayNotEmpty, IsEmail, jsonLd as JsonLD, KeyPressManager, MUST_MATCH, MarkdownToHtmlPipe, MustMatch, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, PropsDirective, ProvideColorDirective, ProvideSurfaceDirective, RUNTIME_ERROR_NO_DATA, RepeatDirective, ResizeHandlesComponent, RuntimeError, SEO_DIRECTIVE_TOKEN, SURFACE_PROVIDER, SURFACE_TYPE, ScrollObserverDirective, ScrollObserverEndDirective, ScrollObserverStartDirective, SeoDirective, SlugifyPipe, StructuredDataComponent, SurfaceInteractiveDirective, ToArrayPipe, TypedQueryList, ValidateAtLeastOneRequired, Validators, animationDebugLog, applyAlternateBinding, applyAlternateLanguagesBindings, applyArticleBindings, applyAuthorBinding, applyCanonicalBinding, applyCenteredPosition, applyDescriptionBinding, applyGlobalPosition, applyHeadBinding, applyHeadTitleBinding, applyHostListener, applyHostListeners, applyInitialFocus, applyKeywordsBinding, applyLinkBinding, applyMetaBinding, applyNextBinding, applyOgBinding, applyOpenGraphBindings, applyPrevBinding, applyResourceHintsBindings, applyRobotsBinding, applySocialMediaBindings, applyStructuredDataBinding, applyTwitterCardBindings, areScrollStatesEqual, bindProps, boolBreakpointTransform, booleanBreakpointAttribute, boundingClientRectToElementRect, breakpointTransformBase, buildElementSignal, buildSignalEffects, canUseSessionMemory, clamp, clone, cloneFormGroup, computedTillFalsy, computedTillTruthy, controlValueSignal, controlValueSignalWithPrevious, copyToClipboard, createAnchoredPositionCleanup, createArrayPropertyBinding, createAutoSessionMemoryKey, createBulkPropertyBinding, createCanAnimateSignal, createComponentId, createCssColorThemeName, createCssSurfaceName, createDependencyStash, createDestroy, createDocumentElementSignal, createElementDictionary, createElementDimensions, createEmptyElementSignal, createFlipAnimation, createFlipAnimationGroup, createHostProps, createIsRenderedSignal, createLogger, createOverlayRuntimeRef, createPropHandlers, createPropertyBinding, createProps, createProvider, createRootProvider, createRootThemeCss, createRoute, createRouterState, createRxHostListener, createSessionMemory, createSetup, createStaticProvider, createStaticRootProvider, createSwatchCss, createSwipeTracker, createTailwindColorThemes, createTailwindCssVar, createTailwindRgbVar, createThemeStyle, createUnsavedChangesGuard, createUnsavedChangesTracker, createUserConsentProvider, deferredSignal, deleteCookie, dragGestureFrom, easeElastic, easeIn, easeInOut, easeLinear, easeOut, easeOutBack, easeOutBackStrong, elementCanScroll, equal, firstElementSignal, focusElement, forceReflow, formatRuntimeError, fromNextFrame, getCookie, getDomain, getElementScrollCoordinates, getFocusableElements, getFormGroupValue, getGroupMatchPoints, getGroupMatchScore, getHeadingElement, getKnockoutMatchScore, getMatchScoreSubLine, getObjectProperty, getScrollContainerTarget, getScrollItemTarget, getScrollSnapTarget, hasCookie, holdScrollRestoration, htmlToMarkdown, inferMimeType, initials, injectAngularRootElement, injectAnimatedBlockSize, injectBoundaryElement, injectBreakpointInput, injectBreakpointIsMatched, injectBreakpointObserver, injectCanHover, injectColorThemes, injectColorThemesPrefix, injectCurrentBreakpoint, injectDeviceInputType, injectDisplayOrientation, injectErrorTheme, injectFocusVisibleTracker, injectFragment, injectHasPrecisionInput, injectHasTouchInput, injectHostElement, injectIs2Xl, injectIsDocumentVisible, injectIsLandscape, injectIsLg, injectIsMd, injectIsPortrait, injectIsRouterInitialized, injectIsSm, injectIsXl, injectIsXs, injectLinkStore, injectLinkStoreConfig, injectLocale, injectMediaQueryIsMatched, injectMetaConfig, injectMetaStore, injectObserveBreakpoint, injectObserveMediaQuery, injectOverlayRuntime, injectPathParam, injectPathParamChanges, injectPathParams, injectPrefersReducedMotion, injectQueryParam, injectQueryParamChanges, injectQueryParams, injectRenderer, injectRoute, injectRouteData, injectRouteDataItem, injectRouteTitle, injectRouterEvent, injectRouterState, injectScrollbarDimensions, injectStructuredDataConfig, injectStructuredDataStore, injectStyleManager, injectSuccessTheme, injectSurfaceContextTracker, injectSurfaceThemes, injectSurfaceThemesPrefix, injectTemplateRef, injectTitleConfig, injectTitleStore, injectUrl, injectViewportConfig, injectViewportDimensions, injectViewportSize, injectWarningTheme, isAnimationDebugEnabled, isArray, isElementSignal, isElementVisible, isFocusable, isGroupMatch, isHTMLElement, isKnockoutMatch, isObject, markdownToHtml, maybeSignalValue, memoizeSignal, nextFrame, normalizeGameResultType, normalizeMatchParticipant, normalizeMatchParticipants, normalizeMatchScore, normalizeMatchState, normalizeMatchType, normalizeUnsavedChangesSource, numberBreakpointAttribute, numberBreakpointTransform, previousSignalValue, provideBoundaryElement, provideBreakpointInstance, provideBreakpointObserver, provideColorThemes, provideColorThemesWithTailwind4, provideFocusVisibleTracker, provideLinkStore, provideLinkStoreConfig, provideLocale, provideMetaConfig, provideMetaStore, provideOverlayRuntime, provideRenderer, provideStructuredDataConfig, provideStructuredDataStore, provideStyleManager, provideSurfaceContextTracker, provideSurfaceThemesWithTailwind4, provideTitleConfig, provideTitleStore, provideViewportConfig, randomId, readFromClipboard, resetPositioningStyles, resolveAppRootColorProvider, resolveSurfaceByElevation, round, routerDisableScrollTop, scrollToElement, setBackdropStyles, setBaseElementStyles, setCookie, setInputSignal, setupFocusTrap, setupPositioning, setupScrollRestoration, signalAnimatedNumber, signalAttributes, signalClasses, signalElementChildren, signalElementDimensions, signalElementIntersection, signalElementLastScrollDirection, signalElementMutations, signalElementScrollState, signalHostAttributes, signalHostClasses, signalHostElementDimensions, signalHostElementIntersection, signalHostElementLastScrollDirection, signalHostElementMutations, signalHostElementScrollState, signalHostStyles, signalIsRendered, signalStyles, slugify, switchQueryListChanges, syncSignal, templateComputed, toArray, toArrayTrackByFn, toStringBinding, transformOrReturn, typedBreakpointTransform, unbindProps, useCursorDragScroll, writeScrollbarSizeToCssVariables, writeViewportSizeToCssVariables, ɵProvideColorThemes, ɵProvideColorThemesPrefix, ɵProvideSurfaceThemes, ɵProvideSurfaceThemesPrefix };
|
|
8609
|
+
export { ANIMATABLE_TOKEN, ANIMATED_IF_TOKEN, ANIMATED_LIFECYCLE_TOKEN, ANIMATION_DEBUG_STORAGE_KEY, AT_LEAST_ONE_REQUIRED, AnimatableDirective, AnimatedIfDirective, AnimatedLifecycleDirective, AnimatedOverlayDirective, AutoSurfaceDirective, BOUNDARY_ELEMENT_TOKEN, BREAKPOINT_INSTANCE_TOKEN, BREAKPOINT_ORDER, COLOR_PROVIDER, ClickOutsideDirective, ColorInteractiveContainerDirective, ColorInteractiveDirective, ColorInteractiveExcludeDirective, ColorInteractiveHasFocusDirective, DEFAULT_MULTI_INSTANCE_RELS, DEFAULT_MULTI_INSTANCE_TAGS, DEFAULT_VIEWPORT_CONFIG, DISABLE_LOGGER_PARAM, DragHandleDirective, ET_DISABLE_SCROLL_TOP, ET_DISABLE_SCROLL_TOP_AS_RETURN_ROUTE, ET_DISABLE_SCROLL_TOP_ON_PATH_PARAM_CHANGE, ET_PROPERTY_REMOVED, FOCUSABLE_SELECTOR, FOCUS_VISIBLE_TRACKER_TOKEN, HtmlToMarkdownPipe, IS_ARRAY_NOT_EMPTY, IS_EMAIL, InferMimeTypePipe, InitialsPipe, IsArrayNotEmpty, IsEmail, jsonLd as JsonLD, KeyPressManager, MUST_MATCH, MarkdownToHtmlPipe, MustMatch, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, PropsDirective, ProvideColorDirective, ProvideSurfaceDirective, RUNTIME_ERROR_NO_DATA, RepeatDirective, ResizeHandlesComponent, RuntimeError, SEO_DIRECTIVE_TOKEN, SURFACE_PROVIDER, SURFACE_TYPE, SWIPE_VELOCITY_WINDOW_MS, ScrollObserverDirective, ScrollObserverEndDirective, ScrollObserverStartDirective, SeoDirective, SlugifyPipe, StructuredDataComponent, SurfaceInteractiveDirective, ToArrayPipe, TypedQueryList, ValidateAtLeastOneRequired, Validators, animationDebugLog, applyAlternateBinding, applyAlternateLanguagesBindings, applyArticleBindings, applyAuthorBinding, applyCanonicalBinding, applyCenteredPosition, applyDescriptionBinding, applyGlobalPosition, applyHeadBinding, applyHeadTitleBinding, applyHostListener, applyHostListeners, applyInitialFocus, applyKeywordsBinding, applyLinkBinding, applyMetaBinding, applyNextBinding, applyOgBinding, applyOpenGraphBindings, applyPrevBinding, applyResourceHintsBindings, applyRobotsBinding, applySocialMediaBindings, applyStructuredDataBinding, applyTwitterCardBindings, areScrollStatesEqual, bindProps, boolBreakpointTransform, booleanBreakpointAttribute, boundingClientRectToElementRect, breakpointTransformBase, buildElementSignal, buildSignalEffects, canUseSessionMemory, clamp, clone, cloneFormGroup, computedTillFalsy, computedTillTruthy, controlValueSignal, controlValueSignalWithPrevious, copyToClipboard, createAnchoredPositionCleanup, createArrayPropertyBinding, createAutoSessionMemoryKey, createBulkPropertyBinding, createCanAnimateSignal, createComponentId, createCssColorThemeName, createCssSurfaceName, createDependencyStash, createDestroy, createDocumentElementSignal, createElementDictionary, createElementDimensions, createEmptyElementSignal, createFlipAnimation, createFlipAnimationGroup, createHostProps, createIsRenderedSignal, createLabels, createLogger, createOverlayRuntimeRef, createPropHandlers, createPropertyBinding, createProps, createProvider, createRootProvider, createRootThemeCss, createRoute, createRouterState, createRxHostListener, createSessionMemory, createSetup, createStaticProvider, createStaticRootProvider, createSwatchCss, createSwipeTracker, createTailwindColorThemes, createTailwindCssVar, createTailwindRgbVar, createThemeStyle, createUnsavedChangesGuard, createUnsavedChangesTracker, createUserConsentProvider, deferredSignal, deleteCookie, dragGestureFrom, easeElastic, easeIn, easeInOut, easeLinear, easeOut, easeOutBack, easeOutBackStrong, elementCanScroll, equal, firstElementSignal, focusElement, forceReflow, formatRuntimeError, fromNextFrame, getCookie, getDomain, getElementScrollCoordinates, getFocusableElements, getFormGroupValue, getGroupMatchPoints, getGroupMatchScore, getHeadingElement, getKnockoutMatchScore, getMatchScoreSubLine, getObjectProperty, getScrollContainerTarget, getScrollItemTarget, getScrollSnapTarget, hasCookie, holdScrollRestoration, htmlToMarkdown, inferMimeType, initials, injectAngularRootElement, injectAnimatedBlockSize, injectBoundaryElement, injectBreakpointInput, injectBreakpointIsMatched, injectBreakpointObserver, injectCanHover, injectColorThemes, injectColorThemesPrefix, injectCurrentBreakpoint, injectDeviceInputType, injectDisplayOrientation, injectErrorTheme, injectFocusVisibleTracker, injectFragment, injectHasPrecisionInput, injectHasTouchInput, injectHostElement, injectIs2Xl, injectIsDocumentVisible, injectIsLandscape, injectIsLg, injectIsMd, injectIsPortrait, injectIsRouterInitialized, injectIsSm, injectIsXl, injectIsXs, injectLinkStore, injectLinkStoreConfig, injectLocale, injectMediaQueryIsMatched, injectMetaConfig, injectMetaStore, injectObserveBreakpoint, injectObserveMediaQuery, injectOverlayRuntime, injectPathParam, injectPathParamChanges, injectPathParams, injectPrefersReducedMotion, injectQueryParam, injectQueryParamChanges, injectQueryParams, injectRenderer, injectRoute, injectRouteData, injectRouteDataItem, injectRouteTitle, injectRouterEvent, injectRouterNavigationState, injectRouterState, injectScrollbarDimensions, injectStructuredDataConfig, injectStructuredDataStore, injectStyleManager, injectSuccessTheme, injectSurfaceContextTracker, injectSurfaceThemes, injectSurfaceThemesPrefix, injectTemplateRef, injectTitleConfig, injectTitleStore, injectUrl, injectViewportConfig, injectViewportDimensions, injectViewportSize, injectWarningTheme, isAnimationDebugEnabled, isArray, isElementSignal, isElementVisible, isFocusable, isGroupMatch, isHTMLElement, isKnockoutMatch, isObject, markdownToHtml, matchesReducedMotion, maybeSignalValue, memoizeSignal, nextFrame, normalizeGameResultType, normalizeMatchParticipant, normalizeMatchParticipants, normalizeMatchScore, normalizeMatchState, normalizeMatchType, normalizeUnsavedChangesSource, numberBreakpointAttribute, numberBreakpointTransform, previousSignalValue, provideBoundaryElement, provideBreakpointInstance, provideBreakpointObserver, provideColorThemes, provideColorThemesWithTailwind4, provideFocusVisibleTracker, provideLinkStore, provideLinkStoreConfig, provideLocale, provideMetaConfig, provideMetaStore, provideOverlayRuntime, provideRenderer, provideStructuredDataConfig, provideStructuredDataStore, provideStyleManager, provideSurfaceContextTracker, provideSurfaceThemesWithTailwind4, provideTitleConfig, provideTitleStore, provideViewportConfig, randomId, readFromClipboard, resetPositioningStyles, resolveAppRootColorProvider, resolveSurfaceByElevation, round, routerDisableScrollTop, scrollToElement, setBackdropStyles, setBaseElementStyles, setCookie, setInputSignal, setupFocusTrap, setupPositioning, setupScrollRestoration, signalAnimatedNumber, signalAttributes, signalClasses, signalElementChildren, signalElementDimensions, signalElementIntersection, signalElementLastScrollDirection, signalElementMutations, signalElementScrollState, signalHostAttributes, signalHostClasses, signalHostElementDimensions, signalHostElementIntersection, signalHostElementLastScrollDirection, signalHostElementMutations, signalHostElementScrollState, signalHostStyles, signalIsRendered, signalStyles, slugify, switchQueryListChanges, syncSignal, templateComputed, toArray, toArrayTrackByFn, toStringBinding, transformOrReturn, typedBreakpointTransform, unbindProps, useCursorDragScroll, writeScrollbarSizeToCssVariables, writeViewportSizeToCssVariables, ɵProvideColorThemes, ɵProvideColorThemesPrefix, ɵProvideSurfaceThemes, ɵProvideSurfaceThemesPrefix };
|
|
8463
8610
|
//# sourceMappingURL=ethlete-core.mjs.map
|