use-scroll-animate 4.9.0 → 5.1.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/CHANGELOG.md +33 -0
- package/README.md +2 -1
- package/README_ja.md +1 -0
- package/README_zh.md +2 -1
- package/dist/chunks/{base-BvpQ4Ggj.cjs → base-B5i8qQPR.cjs} +46 -40
- package/dist/chunks/base-B5i8qQPR.cjs.map +1 -0
- package/dist/chunks/{base-DbbRUxaa.js → base-C3Sw9sAO.js} +46 -41
- package/dist/chunks/base-C3Sw9sAO.js.map +1 -0
- package/dist/chunks/{core-BWO7JKJ5.cjs → core-BDcszY4L.cjs} +2 -2
- package/dist/chunks/{core-BWO7JKJ5.cjs.map → core-BDcszY4L.cjs.map} +1 -1
- package/dist/chunks/{core-CcaSsbV8.js → core-BTf__I-8.js} +2 -2
- package/dist/chunks/{core-CcaSsbV8.js.map → core-BTf__I-8.js.map} +1 -1
- package/dist/chunks/{core-CCAM3nKw.cjs → core-BjOYKSrV.cjs} +2 -2
- package/dist/chunks/{core-CCAM3nKw.cjs.map → core-BjOYKSrV.cjs.map} +1 -1
- package/dist/chunks/{core-BVTuet9o.js → core-DN3hHbHh.js} +2 -2
- package/dist/chunks/{core-BVTuet9o.js.map → core-DN3hHbHh.js.map} +1 -1
- package/dist/chunks/fx-B8hk1Fby.cjs +114 -0
- package/dist/chunks/fx-B8hk1Fby.cjs.map +1 -0
- package/dist/chunks/fx-ChjxrMBo.js +109 -0
- package/dist/chunks/fx-ChjxrMBo.js.map +1 -0
- package/dist/chunks/{index-tags-Dh8nwXqw.js → index-tags-DucKMQr_.js} +2 -1
- package/dist/chunks/{index-tags-Dh8nwXqw.js.map → index-tags-DucKMQr_.js.map} +1 -1
- package/dist/chunks/{index-tags-CIRY2KnU.cjs → index-tags-wv0R_vkO.cjs} +2 -1
- package/dist/chunks/{index-tags-CIRY2KnU.cjs.map → index-tags-wv0R_vkO.cjs.map} +1 -1
- package/dist/chunks/{spring-fFkqE9J0.cjs → spring--oZh55tB.cjs} +2 -2
- package/dist/chunks/{spring-fFkqE9J0.cjs.map → spring--oZh55tB.cjs.map} +1 -1
- package/dist/chunks/{spring-B6w7mVCU.js → spring-CckMe3x0.js} +2 -2
- package/dist/chunks/{spring-B6w7mVCU.js.map → spring-CckMe3x0.js.map} +1 -1
- package/dist/chunks/{variants-Cal4DB0E.js → variants-Bsevy6Xm.js} +2 -2
- package/dist/chunks/{variants-Cal4DB0E.js.map → variants-Bsevy6Xm.js.map} +1 -1
- package/dist/chunks/{variants-C8xj8gfd.cjs → variants-DxPmgrNX.cjs} +2 -2
- package/dist/chunks/{variants-C8xj8gfd.cjs.map → variants-DxPmgrNX.cjs.map} +1 -1
- package/dist/components/a11y.cjs +3 -2
- package/dist/components/a11y.cjs.map +1 -1
- package/dist/components/a11y.d.cts +1 -0
- package/dist/components/a11y.d.ts +1 -0
- package/dist/components/a11y.js +4 -3
- package/dist/components/a11y.js.map +1 -1
- package/dist/components/angular.cjs +8 -6
- package/dist/components/angular.cjs.map +1 -1
- package/dist/components/angular.d.cts +33 -4
- package/dist/components/angular.d.ts +33 -4
- package/dist/components/angular.js +8 -6
- package/dist/components/angular.js.map +1 -1
- package/dist/components/background.cjs +2 -4
- package/dist/components/background.cjs.map +1 -1
- package/dist/components/background.d.cts +2 -47
- package/dist/components/background.d.ts +2 -47
- package/dist/components/background.js +3 -4
- package/dist/components/background.js.map +1 -1
- package/dist/components/bridge.cjs +1 -1
- package/dist/components/bridge.js +1 -1
- package/dist/components/cards.cjs +2 -4
- package/dist/components/cards.cjs.map +1 -1
- package/dist/components/cards.d.cts +2 -47
- package/dist/components/cards.d.ts +2 -47
- package/dist/components/cards.js +2 -3
- package/dist/components/cards.js.map +1 -1
- package/dist/components/click.cjs +24 -130
- package/dist/components/click.cjs.map +1 -1
- package/dist/components/click.d.cts +2 -47
- package/dist/components/click.d.ts +2 -47
- package/dist/components/click.js +4 -109
- package/dist/components/click.js.map +1 -1
- package/dist/components/depth.cjs +3 -5
- package/dist/components/depth.cjs.map +1 -1
- package/dist/components/depth.d.cts +2 -47
- package/dist/components/depth.d.ts +2 -47
- package/dist/components/depth.js +3 -4
- package/dist/components/depth.js.map +1 -1
- package/dist/components/effects.cjs +265 -0
- package/dist/components/effects.cjs.map +1 -0
- package/dist/components/effects.d.cts +66 -0
- package/dist/components/effects.d.ts +66 -0
- package/dist/components/effects.js +258 -0
- package/dist/components/effects.js.map +1 -0
- package/dist/components/feedback.cjs +1 -3
- package/dist/components/feedback.cjs.map +1 -1
- package/dist/components/feedback.d.cts +2 -47
- package/dist/components/feedback.d.ts +2 -47
- package/dist/components/feedback.js +1 -2
- package/dist/components/feedback.js.map +1 -1
- package/dist/components/fx.cjs +289 -0
- package/dist/components/fx.cjs.map +1 -0
- package/dist/components/fx.css +3 -0
- package/dist/components/fx.d.cts +114 -0
- package/dist/components/fx.d.ts +114 -0
- package/dist/components/fx.js +275 -0
- package/dist/components/fx.js.map +1 -0
- package/dist/components/gesture.cjs +3 -5
- package/dist/components/gesture.cjs.map +1 -1
- package/dist/components/gesture.d.cts +2 -47
- package/dist/components/gesture.d.ts +2 -47
- package/dist/components/gesture.js +4 -5
- package/dist/components/gesture.js.map +1 -1
- package/dist/components/interaction.cjs +1 -3
- package/dist/components/interaction.cjs.map +1 -1
- package/dist/components/interaction.d.cts +2 -47
- package/dist/components/interaction.d.ts +2 -47
- package/dist/components/interaction.js +1 -2
- package/dist/components/interaction.js.map +1 -1
- package/dist/components/jsx.d.cts +1 -0
- package/dist/components/jsx.d.ts +1 -0
- package/dist/components/layout.cjs +1 -3
- package/dist/components/layout.cjs.map +1 -1
- package/dist/components/layout.d.cts +2 -47
- package/dist/components/layout.d.ts +2 -47
- package/dist/components/layout.js +2 -3
- package/dist/components/layout.js.map +1 -1
- package/dist/components/lazy.cjs +2 -1
- package/dist/components/lazy.cjs.map +1 -1
- package/dist/components/lazy.d.cts +1 -0
- package/dist/components/lazy.d.ts +1 -0
- package/dist/components/lazy.js +2 -1
- package/dist/components/lazy.js.map +1 -1
- package/dist/components/lite.cjs +366 -64
- package/dist/components/lite.cjs.map +1 -1
- package/dist/components/lite.js +349 -65
- package/dist/components/lite.js.map +1 -1
- package/dist/components/packs.cjs +1 -3
- package/dist/components/packs.cjs.map +1 -1
- package/dist/components/packs.d.cts +2 -47
- package/dist/components/packs.d.ts +2 -47
- package/dist/components/packs.js +2 -3
- package/dist/components/packs.js.map +1 -1
- package/dist/components/page.cjs +33 -22
- package/dist/components/page.cjs.map +1 -1
- package/dist/components/page.d.cts +15 -52
- package/dist/components/page.d.ts +15 -52
- package/dist/components/page.js +33 -22
- package/dist/components/page.js.map +1 -1
- package/dist/components/perf.cjs +3 -4
- package/dist/components/perf.cjs.map +1 -1
- package/dist/components/perf.d.cts +1 -0
- package/dist/components/perf.d.ts +1 -0
- package/dist/components/perf.js +4 -5
- package/dist/components/perf.js.map +1 -1
- package/dist/components/physics.cjs +2 -4
- package/dist/components/physics.cjs.map +1 -1
- package/dist/components/physics.d.cts +2 -47
- package/dist/components/physics.d.ts +2 -47
- package/dist/components/physics.js +3 -4
- package/dist/components/physics.js.map +1 -1
- package/dist/components/react.cjs +1 -1
- package/dist/components/react.js +1 -1
- package/dist/components/reveal.cjs +1 -3
- package/dist/components/reveal.cjs.map +1 -1
- package/dist/components/reveal.d.cts +2 -47
- package/dist/components/reveal.d.ts +2 -47
- package/dist/components/reveal.js +1 -2
- package/dist/components/reveal.js.map +1 -1
- package/dist/components/solid.cjs +8 -6
- package/dist/components/solid.cjs.map +1 -1
- package/dist/components/solid.d.cts +33 -4
- package/dist/components/solid.d.ts +33 -4
- package/dist/components/solid.js +8 -6
- package/dist/components/solid.js.map +1 -1
- package/dist/components/svelte.cjs +8 -6
- package/dist/components/svelte.cjs.map +1 -1
- package/dist/components/svelte.d.cts +33 -4
- package/dist/components/svelte.d.ts +33 -4
- package/dist/components/svelte.js +8 -6
- package/dist/components/svelte.js.map +1 -1
- package/dist/components/svg.cjs +1 -3
- package/dist/components/svg.cjs.map +1 -1
- package/dist/components/svg.d.cts +2 -47
- package/dist/components/svg.d.ts +2 -47
- package/dist/components/svg.js +2 -3
- package/dist/components/svg.js.map +1 -1
- package/dist/components/text.cjs +2 -4
- package/dist/components/text.cjs.map +1 -1
- package/dist/components/text.d.cts +2 -47
- package/dist/components/text.d.ts +2 -47
- package/dist/components/text.js +2 -3
- package/dist/components/text.js.map +1 -1
- package/dist/components/timeline.cjs +3 -7
- package/dist/components/timeline.cjs.map +1 -1
- package/dist/components/timeline.d.cts +4 -49
- package/dist/components/timeline.d.ts +4 -49
- package/dist/components/timeline.js +4 -7
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/transitions.cjs +1 -3
- package/dist/components/transitions.cjs.map +1 -1
- package/dist/components/transitions.d.cts +2 -47
- package/dist/components/transitions.d.ts +2 -47
- package/dist/components/transitions.js +2 -3
- package/dist/components/transitions.js.map +1 -1
- package/dist/components/ui.cjs +3 -5
- package/dist/components/ui.cjs.map +1 -1
- package/dist/components/ui.d.cts +2 -47
- package/dist/components/ui.d.ts +2 -47
- package/dist/components/ui.js +4 -5
- package/dist/components/ui.js.map +1 -1
- package/dist/components/vue.cjs +8 -6
- package/dist/components/vue.cjs.map +1 -1
- package/dist/components/vue.d.cts +33 -4
- package/dist/components/vue.d.ts +33 -4
- package/dist/components/vue.js +8 -6
- package/dist/components/vue.js.map +1 -1
- package/dist/components/webgl.cjs +3 -5
- package/dist/components/webgl.cjs.map +1 -1
- package/dist/components/webgl.d.cts +2 -47
- package/dist/components/webgl.d.ts +2 -47
- package/dist/components/webgl.js +3 -4
- package/dist/components/webgl.js.map +1 -1
- package/dist/components.cjs +31 -10
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +1 -0
- package/dist/components.d.cts +137 -17
- package/dist/components.d.ts +137 -17
- package/dist/components.js +15 -11
- package/dist/components.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/docs/API.md +1 -1
- package/docs/ROADMAP.md +12 -12
- package/docs/components.md +29 -1
- package/docs/performance.md +1 -1
- package/docs/upgrading-5.md +2 -2
- package/package.json +24 -3
- package/dist/chunks/base-BvpQ4Ggj.cjs.map +0 -1
- package/dist/chunks/base-DbbRUxaa.js.map +0 -1
package/dist/components/lite.cjs
CHANGED
|
@@ -10,17 +10,16 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
|
|
|
10
10
|
* scripts. Classes are created the first time a `define*()` function runs.
|
|
11
11
|
*/
|
|
12
12
|
const MOTION_SENSITIVITY_LEVELS = ['full', 'gentle', 'minimal', 'static'];
|
|
13
|
-
const MOTION_SCALE = {
|
|
13
|
+
const MOTION_SCALE = { low: 0.6, normal: 1, high: 1.25 };
|
|
14
14
|
const config = { injectStyles: true, reducedMotion: 'user', motionIntensity: 'normal', motionSensitivity: 'full' };
|
|
15
15
|
/** Change global component settings (call before `define*()` for `injectStyles`). */
|
|
16
16
|
function configureComponents(options) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
17
|
+
options = { ...options };
|
|
18
|
+
// 5.0: removed values are ignored (see docs/upgrading-5.md)
|
|
19
|
+
if (options.motionIntensity && !(options.motionIntensity in MOTION_SCALE))
|
|
20
|
+
delete options.motionIntensity;
|
|
21
|
+
if (options.reducedMotion && options.reducedMotion !== 'reduce')
|
|
22
|
+
options.reducedMotion = 'user';
|
|
24
23
|
Object.assign(config, options);
|
|
25
24
|
if (options.motionIntensity && typeof document !== 'undefined') {
|
|
26
25
|
document.documentElement.style.setProperty('--usa-motion', String(MOTION_SCALE[options.motionIntensity] ?? 1));
|
|
@@ -65,15 +64,12 @@ function adaptKeyframes(frames, level = config.motionSensitivity) {
|
|
|
65
64
|
return out;
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
|
-
let quiet = 0;
|
|
69
67
|
/** Run `fn` without 4.9 deprecation warnings (library-internal calls). */
|
|
70
68
|
function withoutDeprecations(fn) {
|
|
71
|
-
quiet++;
|
|
72
69
|
try {
|
|
73
70
|
return fn();
|
|
74
71
|
}
|
|
75
72
|
finally {
|
|
76
|
-
quiet--;
|
|
77
73
|
}
|
|
78
74
|
}
|
|
79
75
|
/** The current global motion intensity. */
|
|
@@ -87,10 +83,10 @@ function motionScale() {
|
|
|
87
83
|
const canDefine = () => typeof customElements !== 'undefined' && typeof HTMLElement !== 'undefined';
|
|
88
84
|
/** `true` when animations should be reduced (OS setting or `configureComponents`). */
|
|
89
85
|
function prefersReducedMotion() {
|
|
90
|
-
if (config.
|
|
86
|
+
if (config.motionSensitivity === 'minimal' || config.motionSensitivity === 'static')
|
|
87
|
+
return true;
|
|
88
|
+
if (config.reducedMotion === 'reduce')
|
|
91
89
|
return true;
|
|
92
|
-
if (config.reducedMotion !== 'user')
|
|
93
|
-
return config.reducedMotion === 'reduce';
|
|
94
90
|
return typeof matchMedia === 'function' && !!matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
95
91
|
}
|
|
96
92
|
const injected = new Set();
|
|
@@ -226,31 +222,7 @@ function getBase() {
|
|
|
226
222
|
}
|
|
227
223
|
/** `el.animate()` that returns `null` (and applies the last frame) without WAAPI. */
|
|
228
224
|
motion(el, keyframes, options) {
|
|
229
|
-
|
|
230
|
-
applyFrame(el, keyframes[keyframes.length - 1]);
|
|
231
|
-
return null;
|
|
232
|
-
}
|
|
233
|
-
keyframes = adaptKeyframes(keyframes);
|
|
234
|
-
if (active$1 >= maxActive) {
|
|
235
|
-
applyFrame(el, keyframes[keyframes.length - 1]);
|
|
236
|
-
return null;
|
|
237
|
-
}
|
|
238
|
-
const k = motionScale();
|
|
239
|
-
if (k !== 1 && k > 0 && typeof options.duration === 'number')
|
|
240
|
-
options = { ...options, duration: options.duration * k, delay: (options.delay || 0) * k };
|
|
241
|
-
const a = el.animate(keyframes, options);
|
|
242
|
-
if (options.iterations !== Infinity) {
|
|
243
|
-
active$1++;
|
|
244
|
-
let done = false;
|
|
245
|
-
const end = () => {
|
|
246
|
-
if (!done) {
|
|
247
|
-
done = true;
|
|
248
|
-
active$1--;
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
a?.finished?.then(end, end);
|
|
252
|
-
}
|
|
253
|
-
return a;
|
|
225
|
+
return animateWithMotion(el, keyframes, options);
|
|
254
226
|
}
|
|
255
227
|
emit(type, detail) {
|
|
256
228
|
return this.dispatchEvent(new CustomEvent(`usa:${type}`, { detail, bubbles: true, cancelable: true }));
|
|
@@ -259,6 +231,39 @@ function getBase() {
|
|
|
259
231
|
baseClass = Base;
|
|
260
232
|
return baseClass;
|
|
261
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* `el.animate()` with the library's motion rules (5.0, shared by elements and
|
|
236
|
+
* registered effects): motion sensitivity (keyframes adapted, `static` →
|
|
237
|
+
* final frame), intensity (duration scale) and the animation budget. Returns
|
|
238
|
+
* `null` (final frame applied) when nothing should animate.
|
|
239
|
+
*/
|
|
240
|
+
function animateWithMotion(el, keyframes, options) {
|
|
241
|
+
if (typeof el.animate !== 'function' || config.motionSensitivity === 'static') {
|
|
242
|
+
applyFrame(el, keyframes[keyframes.length - 1]);
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
keyframes = adaptKeyframes(keyframes);
|
|
246
|
+
if (active$1 >= maxActive) {
|
|
247
|
+
applyFrame(el, keyframes[keyframes.length - 1]);
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
const k = motionScale();
|
|
251
|
+
if (k !== 1 && k > 0 && typeof options.duration === 'number')
|
|
252
|
+
options = { ...options, duration: options.duration * k, delay: (options.delay || 0) * k };
|
|
253
|
+
const a = el.animate(keyframes, options);
|
|
254
|
+
if (options.iterations !== Infinity) {
|
|
255
|
+
active$1++;
|
|
256
|
+
let done = false;
|
|
257
|
+
const end = () => {
|
|
258
|
+
if (!done) {
|
|
259
|
+
done = true;
|
|
260
|
+
active$1--;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
a?.finished?.then(end, end);
|
|
264
|
+
}
|
|
265
|
+
return a;
|
|
266
|
+
}
|
|
262
267
|
/** Write a keyframe's properties as inline styles (no-WAAPI fallback). */
|
|
263
268
|
function applyFrame(el, frame) {
|
|
264
269
|
if (!frame)
|
|
@@ -419,6 +424,7 @@ const COMPONENT_CATEGORIES = {
|
|
|
419
424
|
depth: ['usa-cube', 'usa-depth'],
|
|
420
425
|
layout: ['usa-auto-animate', 'usa-masonry'],
|
|
421
426
|
packs: ['usa-pack'],
|
|
427
|
+
fx: ['usa-fx'],
|
|
422
428
|
};
|
|
423
429
|
|
|
424
430
|
/**
|
|
@@ -454,8 +460,7 @@ function autoDegrade(options = {}) {
|
|
|
454
460
|
state.reason = reason;
|
|
455
461
|
if (degraded) {
|
|
456
462
|
prev = { intensity: getMotionIntensity(), budget: animationBudget() };
|
|
457
|
-
|
|
458
|
-
configureComponents({ motionIntensity: 'low' });
|
|
463
|
+
configureComponents({ motionIntensity: 'low' });
|
|
459
464
|
setAnimationBudget(Math.max(4, Math.floor(maxActive / 2)));
|
|
460
465
|
}
|
|
461
466
|
else if (prev) {
|
|
@@ -7971,21 +7976,23 @@ function defineAutoSkeleton(tag = 'usa-auto-skeleton') {
|
|
|
7971
7976
|
|
|
7972
7977
|
var css$7 = "";
|
|
7973
7978
|
|
|
7979
|
+
const INTENSITIES = ['low', 'normal', 'high'];
|
|
7974
7980
|
const LEVELS = ['off', 'low', 'normal', 'high'];
|
|
7975
7981
|
const KEY$1 = 'usa:motion';
|
|
7976
|
-
let fromSwitch = false;
|
|
7977
7982
|
/**
|
|
7978
7983
|
* Set the global motion intensity for every `<usa-*>` component:
|
|
7979
|
-
* `'
|
|
7980
|
-
*
|
|
7981
|
-
*
|
|
7984
|
+
* `'low'`, `'normal'` (default), `'high'`. Sets `--usa-motion` and
|
|
7985
|
+
* `data-usa-motion` on `<html>`; with `persist` the choice is remembered
|
|
7986
|
+
* (localStorage) and restored by `restoreMotionIntensity()`.
|
|
7987
|
+
* 5.0: `'off'` was removed — use `setMotionSensitivity('minimal')`.
|
|
7982
7988
|
*/
|
|
7983
7989
|
function setMotionIntensity(level, persist = false) {
|
|
7984
|
-
if (!
|
|
7990
|
+
if (!INTENSITIES.includes(level))
|
|
7985
7991
|
return;
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7992
|
+
configureComponents({ motionIntensity: level });
|
|
7993
|
+
store(level, persist);
|
|
7994
|
+
}
|
|
7995
|
+
function store(level, persist) {
|
|
7989
7996
|
if (persist) {
|
|
7990
7997
|
try {
|
|
7991
7998
|
localStorage.setItem(KEY$1, level);
|
|
@@ -7997,30 +8004,39 @@ function setMotionIntensity(level, persist = false) {
|
|
|
7997
8004
|
if (typeof document !== 'undefined')
|
|
7998
8005
|
document.dispatchEvent(new CustomEvent('usa:motion', { detail: { level } }));
|
|
7999
8006
|
}
|
|
8000
|
-
/**
|
|
8007
|
+
/** Apply a switch level: `'off'` = motion sensitivity `minimal`, otherwise full motion at that intensity. */
|
|
8008
|
+
function setMotionLevel(level, persist = false) {
|
|
8009
|
+
if (!LEVELS.includes(level))
|
|
8010
|
+
return;
|
|
8011
|
+
if (level === 'off')
|
|
8012
|
+
configureComponents({ motionSensitivity: 'minimal' });
|
|
8013
|
+
else
|
|
8014
|
+
configureComponents({ motionIntensity: level, ...(getMotionSensitivity() === 'minimal' ? { motionSensitivity: 'full' } : {}) });
|
|
8015
|
+
store(level, persist);
|
|
8016
|
+
}
|
|
8017
|
+
/** The current switch level. */
|
|
8018
|
+
function getMotionLevel() {
|
|
8019
|
+
return getMotionSensitivity() === 'minimal' || getMotionSensitivity() === 'static' ? 'off' : getMotionIntensity();
|
|
8020
|
+
}
|
|
8021
|
+
/** Re-apply a persisted level (call early on page load). Returns the active intensity. */
|
|
8001
8022
|
function restoreMotionIntensity() {
|
|
8002
8023
|
try {
|
|
8003
8024
|
const v = localStorage.getItem(KEY$1);
|
|
8004
|
-
if (v && LEVELS.includes(v))
|
|
8005
|
-
|
|
8006
|
-
setMotionIntensity(v);
|
|
8007
|
-
}
|
|
8025
|
+
if (v && LEVELS.includes(v))
|
|
8026
|
+
setMotionLevel(v);
|
|
8008
8027
|
}
|
|
8009
8028
|
catch {
|
|
8010
8029
|
/* ignore */
|
|
8011
8030
|
}
|
|
8012
|
-
fromSwitch = false;
|
|
8013
8031
|
return getMotionIntensity();
|
|
8014
8032
|
}
|
|
8015
8033
|
function defineMotionSwitch(tag = 'usa-motion-switch') {
|
|
8016
8034
|
return defineElement(tag, (Base) => class UsaMotionSwitch extends Base {
|
|
8017
8035
|
get value() {
|
|
8018
|
-
return
|
|
8036
|
+
return getMotionLevel();
|
|
8019
8037
|
}
|
|
8020
8038
|
set value(v) {
|
|
8021
|
-
|
|
8022
|
-
setMotionIntensity(v, true);
|
|
8023
|
-
fromSwitch = false;
|
|
8039
|
+
setMotionLevel(v, true);
|
|
8024
8040
|
this.sync();
|
|
8025
8041
|
}
|
|
8026
8042
|
mount() {
|
|
@@ -8211,9 +8227,7 @@ function defineTimeline(tag = 'usa-timeline') {
|
|
|
8211
8227
|
// (0–0.95) or `scrub="js"` opt into the JS engine, `scrub="scroll"`
|
|
8212
8228
|
// follows this element's own scroll position.
|
|
8213
8229
|
const v = this.str('scrub');
|
|
8214
|
-
|
|
8215
|
-
deprecate('timeline-scrub-js', '<usa-timeline scrub="js"> is deprecated and will be removed in 5.0 — the JS engine is picked automatically where native scroll timelines are missing; add smooth="…" to opt into smoothing.');
|
|
8216
|
-
const stop = tl.scrub(this, { smooth: this.num('smooth', 0), engine: v === 'js' ? 'js' : 'auto', source: v === 'scroll' ? 'scroll' : 'view' });
|
|
8230
|
+
const stop = tl.scrub(this, { smooth: this.num('smooth', 0), engine: 'auto', source: v === 'scroll' ? 'scroll' : 'view' });
|
|
8217
8231
|
this.toggleAttribute('data-native', stop.native);
|
|
8218
8232
|
this.onCleanup(stop);
|
|
8219
8233
|
return;
|
|
@@ -9010,7 +9024,7 @@ function supportsWebGL() {
|
|
|
9010
9024
|
return support;
|
|
9011
9025
|
try {
|
|
9012
9026
|
const c = typeof document !== 'undefined' ? document.createElement('canvas') : null;
|
|
9013
|
-
support = !!(c && (c.getContext('webgl')
|
|
9027
|
+
support = !!(c && (c.getContext('webgl')));
|
|
9014
9028
|
}
|
|
9015
9029
|
catch {
|
|
9016
9030
|
support = false;
|
|
@@ -9021,7 +9035,7 @@ function supportsWebGL() {
|
|
|
9021
9035
|
function glQuad(canvas, frag) {
|
|
9022
9036
|
let gl = null;
|
|
9023
9037
|
try {
|
|
9024
|
-
gl = (canvas.getContext('webgl', { premultipliedAlpha: false, antialias: false })
|
|
9038
|
+
gl = (canvas.getContext('webgl', { premultipliedAlpha: false, antialias: false }));
|
|
9025
9039
|
}
|
|
9026
9040
|
catch {
|
|
9027
9041
|
gl = null;
|
|
@@ -10079,6 +10093,274 @@ function definePacksComponents() {
|
|
|
10079
10093
|
definePack();
|
|
10080
10094
|
}
|
|
10081
10095
|
|
|
10096
|
+
/**
|
|
10097
|
+
* 5.0 — unified plugin-style effect registration. Every effect (built-in or
|
|
10098
|
+
* yours) is a plain object registered once and played the same way:
|
|
10099
|
+
* `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
|
|
10100
|
+
* `<usa-fx effect="name" trigger="click">`. Effects get a context that
|
|
10101
|
+
* already applies reduced motion, motion sensitivity, intensity and the
|
|
10102
|
+
* animation budget.
|
|
10103
|
+
*/
|
|
10104
|
+
const EFFECT_KINDS = ['enter', 'exit', 'attention', 'click', 'hover', 'card', 'loop', 'page', 'background', 'text', 'cursor', 'scroll'];
|
|
10105
|
+
const EFFECT_TRIGGERS = ['click', 'hover', 'enter', 'load', 'loop', 'manual'];
|
|
10106
|
+
const registry = new Map();
|
|
10107
|
+
/** Register an effect (throws on a duplicate name unless `override`). Returns an unregister function. */
|
|
10108
|
+
function registerEffect(def, opts = {}) {
|
|
10109
|
+
if (!/^[a-z][a-z0-9-]*$/.test(def.name))
|
|
10110
|
+
throw new Error(`[use-scroll-animate] invalid effect name "${def.name}"`);
|
|
10111
|
+
if (!EFFECT_KINDS.includes(def.kind))
|
|
10112
|
+
throw new Error(`[use-scroll-animate] unknown effect kind "${def.kind}"`);
|
|
10113
|
+
if (registry.has(def.name) && !opts.override)
|
|
10114
|
+
throw new Error(`[use-scroll-animate] effect "${def.name}" is already registered`);
|
|
10115
|
+
registry.set(def.name, def);
|
|
10116
|
+
return () => {
|
|
10117
|
+
if (registry.get(def.name) === def)
|
|
10118
|
+
registry.delete(def.name);
|
|
10119
|
+
};
|
|
10120
|
+
}
|
|
10121
|
+
/** Register several effects at once (already-registered names are skipped). */
|
|
10122
|
+
function registerEffects(defs) {
|
|
10123
|
+
for (const d of defs)
|
|
10124
|
+
if (!registry.has(d.name))
|
|
10125
|
+
registerEffect(d);
|
|
10126
|
+
}
|
|
10127
|
+
const getEffect = (name) => registry.get(name);
|
|
10128
|
+
const hasEffect = (name) => registry.has(name);
|
|
10129
|
+
/** Registered effects (optionally of one kind), sorted by name. */
|
|
10130
|
+
function listEffects(kind) {
|
|
10131
|
+
return Array.from(registry.values())
|
|
10132
|
+
.filter((d) => !kind || d.kind === kind)
|
|
10133
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
10134
|
+
}
|
|
10135
|
+
const SKIP_BY_DEFAULT = ['loop', 'background', 'cursor'];
|
|
10136
|
+
function context(event) {
|
|
10137
|
+
const cleanups = [];
|
|
10138
|
+
return {
|
|
10139
|
+
reduced: prefersReducedMotion(),
|
|
10140
|
+
sensitivity: getMotionSensitivity(),
|
|
10141
|
+
event,
|
|
10142
|
+
animate: animateWithMotion,
|
|
10143
|
+
onCleanup: (fn) => cleanups.push(fn),
|
|
10144
|
+
cleanups,
|
|
10145
|
+
};
|
|
10146
|
+
}
|
|
10147
|
+
/**
|
|
10148
|
+
* Play a registered effect once on `el`. Resolves when it finishes (or
|
|
10149
|
+
* immediately for fire-and-forget effects). Unknown names reject.
|
|
10150
|
+
*/
|
|
10151
|
+
async function playEffect(el, name, options = {}, event) {
|
|
10152
|
+
const def = registry.get(name);
|
|
10153
|
+
if (!def)
|
|
10154
|
+
throw new Error(`[use-scroll-animate] unknown effect "${name}" — registered: ${Array.from(registry.keys()).join(', ')}`);
|
|
10155
|
+
const ctx = context(event);
|
|
10156
|
+
if (ctx.reduced && (def.reduced ?? (SKIP_BY_DEFAULT.includes(def.kind) ? 'skip' : 'run')) === 'skip')
|
|
10157
|
+
return;
|
|
10158
|
+
const out = def.run(el, { ...(def.defaults || {}), ...options }, ctx);
|
|
10159
|
+
if (out && typeof out.finished?.then === 'function')
|
|
10160
|
+
await out.finished.catch(() => undefined);
|
|
10161
|
+
else if (out && typeof out.then === 'function')
|
|
10162
|
+
await out;
|
|
10163
|
+
}
|
|
10164
|
+
/**
|
|
10165
|
+
* Bind an effect to a trigger on `el`: `click`, `hover` (pointerenter / focus),
|
|
10166
|
+
* `enter` (scrolls into view; `once` by default), `load` (now), `loop`
|
|
10167
|
+
* (starts now, cleanup stops it) or `manual` (nothing). Returns an unbind.
|
|
10168
|
+
*/
|
|
10169
|
+
function bindEffect(el, name, options = {}) {
|
|
10170
|
+
const { trigger = 'click', once, ...opts } = options;
|
|
10171
|
+
const def = registry.get(name);
|
|
10172
|
+
if (!def)
|
|
10173
|
+
throw new Error(`[use-scroll-animate] unknown effect "${name}"`);
|
|
10174
|
+
const offs = [];
|
|
10175
|
+
let current = null;
|
|
10176
|
+
const fire = (e) => {
|
|
10177
|
+
const ctx = context(e);
|
|
10178
|
+
if (ctx.reduced && (def.reduced ?? (SKIP_BY_DEFAULT.includes(def.kind) ? 'skip' : 'run')) === 'skip')
|
|
10179
|
+
return;
|
|
10180
|
+
// A persistent effect (returns a cleanup) replaces its previous run instead of stacking.
|
|
10181
|
+
current?.();
|
|
10182
|
+
current = null;
|
|
10183
|
+
const out = def.run(el, { ...(def.defaults || {}), ...opts }, ctx);
|
|
10184
|
+
const stops = [...ctx.cleanups, ...(typeof out === 'function' ? [out] : [])];
|
|
10185
|
+
if (stops.length)
|
|
10186
|
+
current = () => stops.splice(0).forEach((f) => f());
|
|
10187
|
+
};
|
|
10188
|
+
offs.push(() => {
|
|
10189
|
+
current?.();
|
|
10190
|
+
current = null;
|
|
10191
|
+
});
|
|
10192
|
+
const on = (type, opt) => {
|
|
10193
|
+
el.addEventListener(type, fire, opt);
|
|
10194
|
+
offs.push(() => el.removeEventListener(type, fire, opt));
|
|
10195
|
+
};
|
|
10196
|
+
if (trigger === 'click')
|
|
10197
|
+
on('click', { once: !!once });
|
|
10198
|
+
else if (trigger === 'hover')
|
|
10199
|
+
(on('pointerenter'), on('focusin'));
|
|
10200
|
+
else if (trigger === 'load' || trigger === 'loop')
|
|
10201
|
+
fire();
|
|
10202
|
+
else if (trigger === 'enter' && typeof IntersectionObserver !== 'undefined') {
|
|
10203
|
+
const io = new IntersectionObserver((entries) => {
|
|
10204
|
+
for (const en of entries)
|
|
10205
|
+
if (en.isIntersecting) {
|
|
10206
|
+
fire();
|
|
10207
|
+
if (once !== false)
|
|
10208
|
+
io.disconnect();
|
|
10209
|
+
}
|
|
10210
|
+
}, { threshold: 0.15 });
|
|
10211
|
+
io.observe(el);
|
|
10212
|
+
offs.push(() => io.disconnect());
|
|
10213
|
+
}
|
|
10214
|
+
return () => offs.splice(0).reverse().forEach((f) => f());
|
|
10215
|
+
}
|
|
10216
|
+
|
|
10217
|
+
function defineFx(tag = 'usa-fx') {
|
|
10218
|
+
return defineElement(tag, (Base) => class UsaFx extends Base {
|
|
10219
|
+
static get observedAttributes() {
|
|
10220
|
+
return ['effect', 'trigger', 'options'];
|
|
10221
|
+
}
|
|
10222
|
+
get target() {
|
|
10223
|
+
return this.flag('self') ? this : (this.firstElementChild || this);
|
|
10224
|
+
}
|
|
10225
|
+
opts() {
|
|
10226
|
+
try {
|
|
10227
|
+
return JSON.parse(this.str('options', '{}')) || {};
|
|
10228
|
+
}
|
|
10229
|
+
catch {
|
|
10230
|
+
return {};
|
|
10231
|
+
}
|
|
10232
|
+
}
|
|
10233
|
+
play() {
|
|
10234
|
+
return playEffect(this.target, this.str('effect', 'pop'), this.opts()).catch(() => undefined);
|
|
10235
|
+
}
|
|
10236
|
+
mount() {
|
|
10237
|
+
if (!this.style.display)
|
|
10238
|
+
this.style.display = 'inline-block';
|
|
10239
|
+
const name = this.str('effect', 'pop');
|
|
10240
|
+
const t = this.str('trigger', 'click');
|
|
10241
|
+
try {
|
|
10242
|
+
this.onCleanup(bindEffect(this.target, name, { ...this.opts(), trigger: EFFECT_TRIGGERS.includes(t) ? t : 'click', once: this.flag('once') }));
|
|
10243
|
+
this.removeAttribute('data-unknown');
|
|
10244
|
+
}
|
|
10245
|
+
catch {
|
|
10246
|
+
this.setAttribute('data-unknown', name); // not registered (yet)
|
|
10247
|
+
}
|
|
10248
|
+
}
|
|
10249
|
+
});
|
|
10250
|
+
}
|
|
10251
|
+
|
|
10252
|
+
/**
|
|
10253
|
+
* 5.0 built-in effects, all registered through `registerEffect()`:
|
|
10254
|
+
* every timeline preset as an `enter` effect, attention seekers, and the
|
|
10255
|
+
* click effects (burst, confetti, shake, ripple).
|
|
10256
|
+
*/
|
|
10257
|
+
const enter = Object.entries(TIMELINE_PRESETS).map(([name, frames]) => ({
|
|
10258
|
+
name,
|
|
10259
|
+
kind: 'enter',
|
|
10260
|
+
description: `Entrance: ${name} (same keyframes as the timeline preset).`,
|
|
10261
|
+
defaults: { duration: 600, delay: 0, easing: 'cubic-bezier(0.22, 1, 0.36, 1)' },
|
|
10262
|
+
run: (el, o, ctx) => ctx.animate(el, ctx.reduced ? [{ opacity: 0 }, { opacity: 1 }] : frames, { duration: o.duration, delay: o.delay, easing: o.easing, fill: 'backwards' }),
|
|
10263
|
+
}));
|
|
10264
|
+
const A = (name, description, frames, duration = 700, easing = 'ease-in-out') => ({
|
|
10265
|
+
name,
|
|
10266
|
+
kind: 'attention',
|
|
10267
|
+
description,
|
|
10268
|
+
defaults: { duration, iterations: 1 },
|
|
10269
|
+
run: (el, o, ctx) => (ctx.reduced ? ctx.animate(el, [{ opacity: 1 }, { opacity: 0.6 }, { opacity: 1 }], { duration: 400 }) : ctx.animate(el, frames, { duration: o.duration, easing, iterations: o.iterations })),
|
|
10270
|
+
});
|
|
10271
|
+
const attention = [
|
|
10272
|
+
A('pulse', 'Gentle scale pulse.', [{ transform: 'scale(1)' }, { transform: 'scale(1.08)' }, { transform: 'scale(1)' }], 600),
|
|
10273
|
+
A('pop', 'Quick overshoot pop.', [{ transform: 'scale(1)' }, { transform: 'scale(1.18)', offset: 0.4 }, { transform: 'scale(0.96)', offset: 0.7 }, { transform: 'scale(1)' }], 450, 'cubic-bezier(0.34, 1.56, 0.64, 1)'),
|
|
10274
|
+
A('jelly', 'Rubbery squash-and-stretch.', [{ transform: 'scale(1,1)' }, { transform: 'scale(1.25,0.75)', offset: 0.3 }, { transform: 'scale(0.75,1.25)', offset: 0.4 }, { transform: 'scale(1.15,0.85)', offset: 0.5 }, { transform: 'scale(0.95,1.05)', offset: 0.65 }, { transform: 'scale(1.05,0.95)', offset: 0.75 }, { transform: 'scale(1,1)' }], 900),
|
|
10275
|
+
A('wiggle', 'Playful rotate wiggle.', [{ transform: 'rotate(0)' }, { transform: 'rotate(-8deg)', offset: 0.2 }, { transform: 'rotate(7deg)', offset: 0.4 }, { transform: 'rotate(-5deg)', offset: 0.6 }, { transform: 'rotate(3deg)', offset: 0.8 }, { transform: 'rotate(0)' }], 650),
|
|
10276
|
+
A('heartbeat', 'Double-beat heart pulse.', [{ transform: 'scale(1)' }, { transform: 'scale(1.2)', offset: 0.14 }, { transform: 'scale(1)', offset: 0.28 }, { transform: 'scale(1.2)', offset: 0.42 }, { transform: 'scale(1)', offset: 0.7 }], 1100),
|
|
10277
|
+
A('bounce', 'Hop up and settle with a squash.', [{ transform: 'translateY(0) scale(1,1)' }, { transform: 'translateY(-22px) scale(0.95,1.05)', offset: 0.35 }, { transform: 'translateY(0) scale(1.08,0.92)', offset: 0.6 }, { transform: 'translateY(-6px) scale(1,1)', offset: 0.8 }, { transform: 'translateY(0) scale(1,1)' }], 800),
|
|
10278
|
+
A('flash', 'Two soft flashes (well under 3 per second).', [{ opacity: 1 }, { opacity: 0.25, offset: 0.25 }, { opacity: 1, offset: 0.5 }, { opacity: 0.25, offset: 0.75 }, { opacity: 1 }], 1400),
|
|
10279
|
+
A('tada', 'Scale + shake celebration.', [{ transform: 'scale(1) rotate(0)' }, { transform: 'scale(0.9) rotate(-3deg)', offset: 0.1 }, { transform: 'scale(1.1) rotate(3deg)', offset: 0.3 }, { transform: 'scale(1.1) rotate(-3deg)', offset: 0.5 }, { transform: 'scale(1.1) rotate(3deg)', offset: 0.7 }, { transform: 'scale(1) rotate(0)' }], 1000),
|
|
10280
|
+
];
|
|
10281
|
+
const click = [
|
|
10282
|
+
{
|
|
10283
|
+
name: 'burst',
|
|
10284
|
+
kind: 'click',
|
|
10285
|
+
description: 'Particle burst from the click point (or the element center).',
|
|
10286
|
+
defaults: { count: 12 },
|
|
10287
|
+
run: (el, o, ctx) => {
|
|
10288
|
+
if (ctx.reduced)
|
|
10289
|
+
return;
|
|
10290
|
+
const r = el.getBoundingClientRect();
|
|
10291
|
+
const e = ctx.event;
|
|
10292
|
+
burst(e?.clientX ?? r.left + r.width / 2, e?.clientY ?? r.top + r.height / 2, o);
|
|
10293
|
+
},
|
|
10294
|
+
},
|
|
10295
|
+
{
|
|
10296
|
+
name: 'confetti',
|
|
10297
|
+
kind: 'click',
|
|
10298
|
+
description: 'Confetti cannon from the element.',
|
|
10299
|
+
defaults: { count: 80 },
|
|
10300
|
+
run: (el, o, ctx) => {
|
|
10301
|
+
if (ctx.reduced)
|
|
10302
|
+
return;
|
|
10303
|
+
const r = el.getBoundingClientRect();
|
|
10304
|
+
confetti({ x: r.left + r.width / 2, y: r.top + r.height / 2, ...o });
|
|
10305
|
+
},
|
|
10306
|
+
},
|
|
10307
|
+
{
|
|
10308
|
+
name: 'shake',
|
|
10309
|
+
kind: 'attention',
|
|
10310
|
+
description: 'Horizontal "no" shake (errors, wrong password).',
|
|
10311
|
+
defaults: { intensity: 8, duration: 480 },
|
|
10312
|
+
run: (el, o, ctx) => (ctx.reduced ? ctx.animate(el, [{ opacity: 1 }, { opacity: 0.5 }, { opacity: 1 }], { duration: 300 }) : shake(el, o.intensity, o.duration)),
|
|
10313
|
+
},
|
|
10314
|
+
{
|
|
10315
|
+
name: 'ripple',
|
|
10316
|
+
kind: 'click',
|
|
10317
|
+
description: 'Material-style ink ripple from the pointer.',
|
|
10318
|
+
defaults: { color: 'currentColor', duration: 600 },
|
|
10319
|
+
run: (el, o, ctx) => {
|
|
10320
|
+
var _a;
|
|
10321
|
+
if (ctx.reduced)
|
|
10322
|
+
return;
|
|
10323
|
+
const r = el.getBoundingClientRect();
|
|
10324
|
+
const e = ctx.event;
|
|
10325
|
+
const d = Math.hypot(r.width, r.height) * 2;
|
|
10326
|
+
const dot = document.createElement('span');
|
|
10327
|
+
dot.setAttribute('aria-hidden', 'true');
|
|
10328
|
+
Object.assign(dot.style, { position: 'absolute', left: `${(e?.clientX ?? r.left + r.width / 2) - r.left - d / 2}px`, top: `${(e?.clientY ?? r.top + r.height / 2) - r.top - d / 2}px`, width: `${d}px`, height: `${d}px`, borderRadius: '50%', background: o.color, opacity: '0.25', pointerEvents: 'none' });
|
|
10329
|
+
if (getComputedStyle(el).position === 'static')
|
|
10330
|
+
el.style.position = 'relative';
|
|
10331
|
+
(_a = el.style).overflow || (_a.overflow = 'hidden');
|
|
10332
|
+
el.appendChild(dot);
|
|
10333
|
+
const a = ctx.animate(dot, [{ transform: 'scale(0)', opacity: 0.3 }, { transform: 'scale(1)', opacity: 0 }], { duration: o.duration, easing: 'ease-out' });
|
|
10334
|
+
const done = () => dot.remove();
|
|
10335
|
+
if (a)
|
|
10336
|
+
a.finished.then(done, done);
|
|
10337
|
+
else
|
|
10338
|
+
done();
|
|
10339
|
+
return a;
|
|
10340
|
+
},
|
|
10341
|
+
},
|
|
10342
|
+
];
|
|
10343
|
+
/** Every built-in 5.0 effect definition. */
|
|
10344
|
+
const BUILTIN_EFFECTS = [...enter, ...attention, ...click];
|
|
10345
|
+
|
|
10346
|
+
/**
|
|
10347
|
+
* use-scroll-animate/components/fx — unified plugin-style effects (5.0).
|
|
10348
|
+
* `registerEffect({ name, kind, run })`, `playEffect(el, name)`,
|
|
10349
|
+
* `bindEffect(el, name, { trigger })`, `<usa-fx effect trigger>`. Built-ins:
|
|
10350
|
+
* every timeline preset (`enter`), `pulse` · `pop` · `jelly` · `wiggle` ·
|
|
10351
|
+
* `heartbeat` · `bounce` · `flash` · `tada` · `shake` (attention),
|
|
10352
|
+
* `burst` · `confetti` · `ripple` (click). More packs: `use-scroll-animate/components/effects`.
|
|
10353
|
+
*/
|
|
10354
|
+
/** Register the built-in effects (idempotent; `defineFxComponents()` calls it). */
|
|
10355
|
+
function registerBuiltinEffects() {
|
|
10356
|
+
registerEffects(BUILTIN_EFFECTS);
|
|
10357
|
+
}
|
|
10358
|
+
/** Register every component of this category under its default tag (+ the built-in effects). */
|
|
10359
|
+
function defineFxComponents() {
|
|
10360
|
+
registerBuiltinEffects();
|
|
10361
|
+
defineFx();
|
|
10362
|
+
}
|
|
10363
|
+
|
|
10082
10364
|
/**
|
|
10083
10365
|
* 4.9 — the 5.0 modern-browser baseline. `baselineReport()` lists which
|
|
10084
10366
|
* required / progressive features this browser has; `warnBaseline()` logs
|
|
@@ -10203,6 +10485,7 @@ const STATIC_ALTERNATIVES = {
|
|
|
10203
10485
|
depth: 'Flat, front-facing layout.',
|
|
10204
10486
|
layout: 'Items reflow instantly.',
|
|
10205
10487
|
packs: 'Roles are styled but not animated.',
|
|
10488
|
+
fx: 'Effects are skipped or reduced to a short fade; the content is unchanged.',
|
|
10206
10489
|
};
|
|
10207
10490
|
/**
|
|
10208
10491
|
* Freeze a subtree at its static alternative: finishes running animations
|
|
@@ -10513,6 +10796,7 @@ const BY_CATEGORY = {
|
|
|
10513
10796
|
depth: defineDepthComponents,
|
|
10514
10797
|
layout: defineLayoutComponents,
|
|
10515
10798
|
packs: definePacksComponents,
|
|
10799
|
+
fx: defineFxComponents,
|
|
10516
10800
|
};
|
|
10517
10801
|
/**
|
|
10518
10802
|
* Register every `<usa-*>` component (or only the given categories).
|
|
@@ -10544,11 +10828,14 @@ exports.ALL_TAGS = ALL_TAGS;
|
|
|
10544
10828
|
exports.AMBIENT_EFFECTS = AMBIENT_EFFECTS;
|
|
10545
10829
|
exports.ANIM_ICONS = ANIM_ICONS;
|
|
10546
10830
|
exports.BRIDGE_PROTOCOL_VERSION = BRIDGE_PROTOCOL_VERSION;
|
|
10831
|
+
exports.BUILTIN_EFFECTS = BUILTIN_EFFECTS;
|
|
10547
10832
|
exports.BUTTON_DEFORMS = BUTTON_DEFORMS;
|
|
10548
10833
|
exports.CARD_EFFECTS = CARD_EFFECTS;
|
|
10549
10834
|
exports.CLICK_EFFECTS = CLICK_EFFECTS;
|
|
10550
10835
|
exports.COMPONENT_CATEGORIES = COMPONENT_CATEGORIES;
|
|
10551
10836
|
exports.CURSOR_MODES = CURSOR_MODES;
|
|
10837
|
+
exports.EFFECT_KINDS = EFFECT_KINDS;
|
|
10838
|
+
exports.EFFECT_TRIGGERS = EFFECT_TRIGGERS;
|
|
10552
10839
|
exports.GL_FALLBACKS = GL_FALLBACKS;
|
|
10553
10840
|
exports.JOINING_SCRIPT = JOINING_SCRIPT;
|
|
10554
10841
|
exports.LIVE_REGION_IDS = LIVE_REGION_IDS;
|
|
@@ -10576,6 +10863,7 @@ exports.VARIANTS = VARIANTS;
|
|
|
10576
10863
|
exports.activeAnimations = activeAnimations;
|
|
10577
10864
|
exports.adaptKeyframes = adaptKeyframes;
|
|
10578
10865
|
exports.adoptVariants = adoptVariants;
|
|
10866
|
+
exports.animateWithMotion = animateWithMotion;
|
|
10579
10867
|
exports.animationBudget = animationBudget;
|
|
10580
10868
|
exports.announce = announce;
|
|
10581
10869
|
exports.applyMotionTokens = applyMotionTokens;
|
|
@@ -10585,6 +10873,7 @@ exports.auditMotionA11y = auditMotionA11y;
|
|
|
10585
10873
|
exports.autoAnimate = autoAnimate;
|
|
10586
10874
|
exports.autoDegrade = autoDegrade;
|
|
10587
10875
|
exports.baselineReport = baselineReport;
|
|
10876
|
+
exports.bindEffect = bindEffect;
|
|
10588
10877
|
exports.burst = burst;
|
|
10589
10878
|
exports.categoryOf = categoryOf;
|
|
10590
10879
|
exports.confetti = confetti;
|
|
@@ -10630,6 +10919,8 @@ exports.defineDrawer = defineDrawer;
|
|
|
10630
10919
|
exports.defineFab = defineFab;
|
|
10631
10920
|
exports.defineFeedbackComponents = defineFeedbackComponents;
|
|
10632
10921
|
exports.defineFullpage = defineFullpage;
|
|
10922
|
+
exports.defineFx = defineFx;
|
|
10923
|
+
exports.defineFxComponents = defineFxComponents;
|
|
10633
10924
|
exports.defineGestureComponents = defineGestureComponents;
|
|
10634
10925
|
exports.defineGlitch = defineGlitch;
|
|
10635
10926
|
exports.defineGradientText = defineGradientText;
|
|
@@ -10710,7 +11001,9 @@ exports.fluentPreset = fluentPreset;
|
|
|
10710
11001
|
exports.flyToCart = flyToCart;
|
|
10711
11002
|
exports.fragmentSource = fragmentSource;
|
|
10712
11003
|
exports.gesture = gesture;
|
|
11004
|
+
exports.getEffect = getEffect;
|
|
10713
11005
|
exports.getMotionIntensity = getMotionIntensity;
|
|
11006
|
+
exports.getMotionLevel = getMotionLevel;
|
|
10714
11007
|
exports.getMotionSensitivity = getMotionSensitivity;
|
|
10715
11008
|
exports.getMotionTokens = getMotionTokens;
|
|
10716
11009
|
exports.glFallbackCss = glFallbackCss;
|
|
@@ -10718,9 +11011,11 @@ exports.glGovernor = glGovernor;
|
|
|
10718
11011
|
exports.glQuad = glQuad;
|
|
10719
11012
|
exports.graphemes = graphemes;
|
|
10720
11013
|
exports.haptic = haptic;
|
|
11014
|
+
exports.hasEffect = hasEffect;
|
|
10721
11015
|
exports.importMotionTokens = importMotionTokens;
|
|
10722
11016
|
exports.interpolatePath = interpolatePath;
|
|
10723
11017
|
exports.linearEasing = linearEasing;
|
|
11018
|
+
exports.listEffects = listEffects;
|
|
10724
11019
|
exports.liveRegion = liveRegion;
|
|
10725
11020
|
exports.loadCategoryStyles = loadCategoryStyles;
|
|
10726
11021
|
exports.loadedStyles = loadedStyles;
|
|
@@ -10730,6 +11025,7 @@ exports.mergeMotionTokens = mergeMotionTokens;
|
|
|
10730
11025
|
exports.morphPath = morphPath;
|
|
10731
11026
|
exports.morphTo = morphTo;
|
|
10732
11027
|
exports.motionAllowed = motionAllowed;
|
|
11028
|
+
exports.motionScale = motionScale;
|
|
10733
11029
|
exports.motionToken = motionToken;
|
|
10734
11030
|
exports.motionTokensToCss = motionTokensToCss;
|
|
10735
11031
|
exports.motionTokensToJSON = motionTokensToJSON;
|
|
@@ -10744,11 +11040,15 @@ exports.parseEasing = parseEasing;
|
|
|
10744
11040
|
exports.parseNativeSettings = parseNativeSettings;
|
|
10745
11041
|
exports.pathsCompatible = pathsCompatible;
|
|
10746
11042
|
exports.pinchScale = pinchScale;
|
|
11043
|
+
exports.playEffect = playEffect;
|
|
10747
11044
|
exports.postFxShader = postFxShader;
|
|
10748
11045
|
exports.postToNative = postToNative;
|
|
10749
11046
|
exports.prefersReducedMotion = prefersReducedMotion;
|
|
10750
11047
|
exports.projectInertia = projectInertia;
|
|
10751
11048
|
exports.readScrollProgress = readScrollProgress;
|
|
11049
|
+
exports.registerBuiltinEffects = registerBuiltinEffects;
|
|
11050
|
+
exports.registerEffect = registerEffect;
|
|
11051
|
+
exports.registerEffects = registerEffects;
|
|
10752
11052
|
exports.requestOrientationPermission = requestOrientationPermission;
|
|
10753
11053
|
exports.resolveDurationToken = resolveDurationToken;
|
|
10754
11054
|
exports.resolveEasingToken = resolveEasingToken;
|
|
@@ -10763,6 +11063,7 @@ exports.scrambleFrame = scrambleFrame;
|
|
|
10763
11063
|
exports.scrollToTarget = scrollToTarget;
|
|
10764
11064
|
exports.setAnimationBudget = setAnimationBudget;
|
|
10765
11065
|
exports.setMotionIntensity = setMotionIntensity;
|
|
11066
|
+
exports.setMotionLevel = setMotionLevel;
|
|
10766
11067
|
exports.setMotionSensitivity = setMotionSensitivity;
|
|
10767
11068
|
exports.setVariant = setVariant;
|
|
10768
11069
|
exports.shake = shake;
|
|
@@ -10791,4 +11092,5 @@ exports.toast = toast;
|
|
|
10791
11092
|
exports.viewTransition = viewTransition;
|
|
10792
11093
|
exports.warnBaseline = warnBaseline;
|
|
10793
11094
|
exports.watchPowerSaver = watchPowerSaver;
|
|
11095
|
+
exports.withoutDeprecations = withoutDeprecations;
|
|
10794
11096
|
//# sourceMappingURL=lite.cjs.map
|