use-scroll-animate 3.9.0 → 4.0.1
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 +40 -0
- package/README.md +16 -14
- package/README_ja.md +10 -11
- package/README_zh.md +11 -12
- package/dist/chunks/{base-Dm6ee5ug.cjs → base-CXx7jZ-o.cjs} +1 -11
- package/dist/chunks/{base-Dm6ee5ug.cjs.map → base-CXx7jZ-o.cjs.map} +1 -1
- package/dist/chunks/{base-BRIPyPtX.js → base-ZARFccur.js} +2 -11
- package/dist/chunks/{base-BRIPyPtX.js.map → base-ZARFccur.js.map} +1 -1
- package/dist/chunks/core-Co-6AL0h.js +218 -0
- package/dist/chunks/core-Co-6AL0h.js.map +1 -0
- package/dist/chunks/{core-CYozf_E-.js → core-DKY-fVzR.js} +2 -2
- package/dist/chunks/{core-CYozf_E-.js.map → core-DKY-fVzR.js.map} +1 -1
- package/dist/chunks/core-DXqZm5Il.cjs +222 -0
- package/dist/chunks/core-DXqZm5Il.cjs.map +1 -0
- package/dist/chunks/{core-CHAtivHV.cjs → core-IaorbTdu.cjs} +2 -2
- package/dist/chunks/{core-CHAtivHV.cjs.map → core-IaorbTdu.cjs.map} +1 -1
- package/dist/chunks/{index-tags-BmQR17Sb.js → index-tags-43Xtd01A.js} +2 -2
- package/dist/chunks/index-tags-43Xtd01A.js.map +1 -0
- package/dist/chunks/{index-tags-DYYsgbba.cjs → index-tags-BQh_uGqH.cjs} +2 -2
- package/dist/chunks/index-tags-BQh_uGqH.cjs.map +1 -0
- package/dist/chunks/{spring-Dp5BllPB.cjs → spring-2OTnYCzm.cjs} +2 -2
- package/dist/chunks/{spring-Dp5BllPB.cjs.map → spring-2OTnYCzm.cjs.map} +1 -1
- package/dist/chunks/{spring-UBPhrh1X.js → spring-E2ickYNI.js} +2 -2
- package/dist/chunks/{spring-UBPhrh1X.js.map → spring-E2ickYNI.js.map} +1 -1
- package/dist/chunks/{variants-_dC-ey6R.cjs → variants-BNIrn4ch.cjs} +2 -2
- package/dist/chunks/{variants-_dC-ey6R.cjs.map → variants-BNIrn4ch.cjs.map} +1 -1
- package/dist/chunks/{variants-DTypaOH3.js → variants-DvnxvRCM.js} +2 -2
- package/dist/chunks/{variants-DTypaOH3.js.map → variants-DvnxvRCM.js.map} +1 -1
- package/dist/components/angular.cjs +6 -5
- package/dist/components/angular.cjs.map +1 -1
- package/dist/components/angular.d.cts +4 -17
- package/dist/components/angular.d.ts +4 -17
- package/dist/components/angular.js +6 -5
- package/dist/components/angular.js.map +1 -1
- package/dist/components/background.cjs +2 -2
- package/dist/components/background.js +3 -3
- package/dist/components/cards.cjs +2 -2
- package/dist/components/cards.js +3 -3
- package/dist/components/click.cjs +2 -2
- package/dist/components/click.js +3 -3
- package/dist/components/depth.cjs +3 -3
- package/dist/components/depth.js +4 -4
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.js +2 -2
- package/dist/components/gesture.cjs +3 -3
- package/dist/components/gesture.js +5 -5
- package/dist/components/interaction.cjs +1 -1
- package/dist/components/interaction.js +2 -2
- package/dist/components/jsx.d.cts +1 -1
- package/dist/components/jsx.d.ts +1 -1
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +2 -2
- package/dist/components/lazy.cjs +1 -1
- package/dist/components/lazy.d.cts +1 -1
- package/dist/components/lazy.d.ts +1 -1
- package/dist/components/lazy.js +1 -1
- package/dist/components/packs.cjs +1 -1
- package/dist/components/packs.js +2 -2
- package/dist/components/page.cjs +2 -2
- package/dist/components/page.js +3 -3
- package/dist/components/physics.cjs +2 -2
- package/dist/components/physics.js +4 -4
- package/dist/components/react.cjs +2 -2
- package/dist/components/react.cjs.map +1 -1
- package/dist/components/react.d.cts +1 -1
- package/dist/components/react.d.ts +1 -1
- package/dist/components/react.js +2 -2
- package/dist/components/react.js.map +1 -1
- package/dist/components/reveal.cjs +1 -1
- package/dist/components/reveal.js +2 -2
- package/dist/components/solid.cjs +25 -9
- package/dist/components/solid.cjs.map +1 -1
- package/dist/components/solid.d.cts +8 -35
- package/dist/components/solid.d.ts +8 -35
- package/dist/components/solid.js +25 -9
- package/dist/components/solid.js.map +1 -1
- package/dist/components/svelte.cjs +6 -5
- package/dist/components/svelte.cjs.map +1 -1
- package/dist/components/svelte.d.cts +4 -17
- package/dist/components/svelte.d.ts +4 -17
- package/dist/components/svelte.js +6 -5
- package/dist/components/svelte.js.map +1 -1
- package/dist/components/svg.cjs +17 -11
- package/dist/components/svg.cjs.map +1 -1
- package/dist/components/svg.css +1 -1
- package/dist/components/svg.js +18 -12
- package/dist/components/svg.js.map +1 -1
- package/dist/components/text.cjs +2 -2
- package/dist/components/text.css +1 -1
- package/dist/components/text.js +3 -3
- package/dist/components/timeline.cjs +23 -223
- package/dist/components/timeline.cjs.map +1 -1
- package/dist/components/timeline.js +21 -220
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/transitions.cjs +8 -125
- package/dist/components/transitions.cjs.map +1 -1
- package/dist/components/transitions.css +0 -1
- package/dist/components/transitions.d.cts +5 -34
- package/dist/components/transitions.d.ts +5 -34
- package/dist/components/transitions.js +10 -125
- package/dist/components/transitions.js.map +1 -1
- package/dist/components/ui.cjs +3 -3
- package/dist/components/ui.js +5 -5
- package/dist/components/vue.cjs +6 -5
- package/dist/components/vue.cjs.map +1 -1
- package/dist/components/vue.d.cts +4 -17
- package/dist/components/vue.d.ts +4 -17
- package/dist/components/vue.js +6 -5
- package/dist/components/vue.js.map +1 -1
- package/dist/components/webgl.cjs +11 -1
- package/dist/components/webgl.cjs.map +1 -1
- package/dist/components/webgl.js +12 -2
- package/dist/components/webgl.js.map +1 -1
- package/dist/components.cjs +12 -13
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +2 -3
- package/dist/components.d.cts +6 -35
- package/dist/components.d.ts +6 -35
- package/dist/components.js +10 -9
- 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 +5 -109
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -32
- package/dist/index.d.ts +72 -32
- package/dist/index.js +4 -110
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/solid.cjs +38 -8
- package/dist/solid.cjs.map +1 -1
- package/dist/solid.d.cts +6 -1
- package/dist/solid.d.ts +6 -1
- package/dist/solid.js +39 -9
- package/dist/solid.js.map +1 -1
- package/docs/API.md +6 -6
- package/docs/ROADMAP.md +14 -0
- package/docs/components.md +3 -5
- package/docs/migration-from-aos.md +1 -1
- package/docs/migration-from-gsap-scrolltrigger.md +6 -6
- package/package.json +1 -1
- package/dist/chunks/index-tags-BmQR17Sb.js.map +0 -1
- package/dist/chunks/index-tags-DYYsgbba.cjs.map +0 -1
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var solidJs = require('solid-js');
|
|
3
4
|
var components = require('../components.cjs');
|
|
4
5
|
var bind = require('../chunks/bind-Ui43-n2d.cjs');
|
|
5
6
|
require('./reveal.cjs');
|
|
6
|
-
require('../chunks/base-
|
|
7
|
+
require('../chunks/base-CXx7jZ-o.cjs');
|
|
7
8
|
require('./text.cjs');
|
|
8
9
|
require('./interaction.cjs');
|
|
9
10
|
require('./feedback.cjs');
|
|
10
11
|
require('./background.cjs');
|
|
11
|
-
require('../chunks/variants-
|
|
12
|
+
require('../chunks/variants-BNIrn4ch.cjs');
|
|
12
13
|
require('./transitions.cjs');
|
|
13
14
|
require('./physics.cjs');
|
|
14
|
-
require('../chunks/spring-
|
|
15
|
+
require('../chunks/spring-2OTnYCzm.cjs');
|
|
15
16
|
require('./cards.cjs');
|
|
16
17
|
require('./click.cjs');
|
|
17
18
|
require('./ui.cjs');
|
|
18
19
|
require('./page.cjs');
|
|
19
20
|
require('./timeline.cjs');
|
|
21
|
+
require('../chunks/core-DXqZm5Il.cjs');
|
|
20
22
|
require('./gesture.cjs');
|
|
21
|
-
require('../chunks/core-
|
|
23
|
+
require('../chunks/core-IaorbTdu.cjs');
|
|
22
24
|
require('./svg.cjs');
|
|
23
25
|
require('./webgl.cjs');
|
|
24
26
|
require('./depth.cjs');
|
|
25
27
|
require('./layout.cjs');
|
|
26
28
|
require('./packs.cjs');
|
|
27
|
-
require('../chunks/index-tags-
|
|
29
|
+
require('../chunks/index-tags-BQh_uGqH.cjs');
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* use-scroll-animate/components/solid — Solid integration (v3.8).
|
|
@@ -43,12 +45,26 @@ require('../chunks/index-tags-DYYsgbba.cjs');
|
|
|
43
45
|
*/
|
|
44
46
|
/**
|
|
45
47
|
* Solid directive (`use:usa`). Solid calls it with the element and an
|
|
46
|
-
* accessor; the binding is
|
|
47
|
-
*
|
|
48
|
+
* accessor; since 4.0.1 the binding is tracked with `createRenderEffect`, so
|
|
49
|
+
* signals read inside `{{ props, on }}` update the element automatically and
|
|
50
|
+
* the listeners are removed on cleanup. `refresh()` is kept for code that
|
|
51
|
+
* calls the directive outside a reactive owner.
|
|
48
52
|
*/
|
|
49
53
|
function usa(el, accessor) {
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
let b = null;
|
|
55
|
+
const run = () => {
|
|
56
|
+
const v = accessor() || {};
|
|
57
|
+
if (b)
|
|
58
|
+
b.update(v);
|
|
59
|
+
else
|
|
60
|
+
b = bind.bindUsa(el, v);
|
|
61
|
+
};
|
|
62
|
+
solidJs.createRenderEffect(run);
|
|
63
|
+
if (!b)
|
|
64
|
+
run();
|
|
65
|
+
const destroy = () => b?.destroy();
|
|
66
|
+
solidJs.onCleanup(destroy);
|
|
67
|
+
return { refresh: run, destroy };
|
|
52
68
|
}
|
|
53
69
|
/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */
|
|
54
70
|
function defineUsa(categories) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid.cjs","sources":["../../src/components/frameworks/solid.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/solid — Solid integration (v3.8).\n * Solid renders custom elements natively: set properties with `prop:` and\n * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).\n * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`\n * directive for `use:usa={{ props, on }}`, and JSX types.\n *\n * ```tsx\n * import { defineUsa, usa } from 'use-scroll-animate/components/solid';\n * import type {} from 'use-scroll-animate/components/solid'; // JSX types\n * onMount(() => defineUsa());\n * false && usa; // keep the directive import (Solid convention)\n * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect=\"flip\">…</usa-card>\n * ```\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\nimport type { UsaIntrinsicElements } from './jsx';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/**\n * Solid directive (`use:usa`). Solid calls it with the element and an\n * accessor; the binding is read
|
|
1
|
+
{"version":3,"file":"solid.cjs","sources":["../../src/components/frameworks/solid.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/solid — Solid integration (v3.8).\n * Solid renders custom elements natively: set properties with `prop:` and\n * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).\n * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`\n * directive for `use:usa={{ props, on }}`, and JSX types.\n *\n * ```tsx\n * import { defineUsa, usa } from 'use-scroll-animate/components/solid';\n * import type {} from 'use-scroll-animate/components/solid'; // JSX types\n * onMount(() => defineUsa());\n * false && usa; // keep the directive import (Solid convention)\n * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect=\"flip\">…</usa-card>\n * ```\n */\nimport { createRenderEffect, onCleanup } from 'solid-js';\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\nimport type { UsaIntrinsicElements } from './jsx';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/**\n * Solid directive (`use:usa`). Solid calls it with the element and an\n * accessor; since 4.0.1 the binding is tracked with `createRenderEffect`, so\n * signals read inside `{{ props, on }}` update the element automatically and\n * the listeners are removed on cleanup. `refresh()` is kept for code that\n * calls the directive outside a reactive owner.\n */\nexport function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): { refresh(): void; destroy(): void } {\n let b: ReturnType<typeof bindUsa> | null = null;\n const run = () => {\n const v = accessor() || {};\n if (b) b.update(v);\n else b = bindUsa(el, v);\n };\n createRenderEffect(run);\n if (!b) run();\n const destroy = () => b?.destroy();\n onCleanup(destroy);\n return { refresh: run, destroy };\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** JSX intrinsic elements for Solid (same attribute types as the React/Preact ones). */\nexport type SolidUsaIntrinsicElements = UsaIntrinsicElements;\n"],"names":["bindUsa","createRenderEffect","onCleanup","defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AASH;;;;;;AAMG;AACG,SAAU,GAAG,CAAC,EAAe,EAAE,QAAsC,EAAA;IACzE,IAAI,CAAC,GAAsC,IAAI;IAC/C,MAAM,GAAG,GAAG,MAAK;AACf,QAAA,MAAM,CAAC,GAAG,QAAQ,EAAE,IAAI,EAAE;AAC1B,QAAA,IAAI,CAAC;AAAE,YAAA,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;;AACb,YAAA,CAAC,GAAGA,YAAO,CAAC,EAAE,EAAE,CAAC,CAAC;AACzB,IAAA,CAAC;IACDC,0BAAkB,CAAC,GAAG,CAAC;AACvB,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,GAAG,EAAE;IACb,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,OAAO,EAAE;IAClCC,iBAAS,CAAC,OAAO,CAAC;AAClB,IAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE;AAClC;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAEC,2BAAgB,CAAC,UAAU,CAAC;AACjE;;;;;;;"}
|
|
@@ -622,19 +622,6 @@ interface UsaAccordionElement extends UsaElement {
|
|
|
622
622
|
toggleItem(details: HTMLDetailsElement, open?: boolean): Promise<void>;
|
|
623
623
|
}
|
|
624
624
|
|
|
625
|
-
/**
|
|
626
|
-
* `<usa-flip-list>` — animates its children to their new places whenever
|
|
627
|
-
* they are added, removed or reordered (FLIP: transforms only). Works with
|
|
628
|
-
* any rendering: plain DOM, React keyed lists, Vue `v-for`, Svelte `{#each}`.
|
|
629
|
-
*
|
|
630
|
-
* Attributes: `duration` (ms, 420), `easing`, `disabled`.
|
|
631
|
-
* Method: `flip(mutate)` for explicit changes (also measures resizes).
|
|
632
|
-
* Reduced motion: no animation.
|
|
633
|
-
*/
|
|
634
|
-
interface UsaFlipListElement extends UsaElement {
|
|
635
|
-
flip(mutate: () => void | Promise<void>): Promise<void>;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
625
|
/**
|
|
639
626
|
* `<usa-view-switch>` — shows one of its children at a time (tabs, wizard
|
|
640
627
|
* steps, app pages) and animates between them. Children are views; name
|
|
@@ -654,15 +641,15 @@ interface UsaViewSwitchElement extends UsaElement {
|
|
|
654
641
|
|
|
655
642
|
/**
|
|
656
643
|
* use-scroll-animate/components/transitions — view & layout transitions.
|
|
657
|
-
* `<usa-dialog>`, `<usa-accordion>`, `<usa-
|
|
658
|
-
* and the `viewTransition()
|
|
644
|
+
* `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
|
|
645
|
+
* and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
|
|
646
|
+
* `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
|
|
659
647
|
*/
|
|
660
648
|
|
|
661
649
|
declare global {
|
|
662
650
|
interface HTMLElementTagNameMap {
|
|
663
651
|
'usa-dialog': UsaDialogElement;
|
|
664
652
|
'usa-accordion': UsaAccordionElement;
|
|
665
|
-
'usa-flip-list': UsaFlipListElement;
|
|
666
653
|
'usa-view-switch': UsaViewSwitchElement;
|
|
667
654
|
}
|
|
668
655
|
}
|
|
@@ -1621,7 +1608,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
1621
1608
|
readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
|
|
1622
1609
|
readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
|
|
1623
1610
|
readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
|
|
1624
|
-
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-
|
|
1611
|
+
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
|
|
1625
1612
|
readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
|
|
1626
1613
|
readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
|
|
1627
1614
|
readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
|
|
@@ -1684,26 +1671,12 @@ type UsaIntrinsicElements = {
|
|
|
1684
1671
|
[K in Tags]: UsaAttributes;
|
|
1685
1672
|
};
|
|
1686
1673
|
|
|
1687
|
-
/**
|
|
1688
|
-
* use-scroll-animate/components/solid — Solid integration (v3.8).
|
|
1689
|
-
* Solid renders custom elements natively: set properties with `prop:` and
|
|
1690
|
-
* listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).
|
|
1691
|
-
* This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`
|
|
1692
|
-
* directive for `use:usa={{ props, on }}`, and JSX types.
|
|
1693
|
-
*
|
|
1694
|
-
* ```tsx
|
|
1695
|
-
* import { defineUsa, usa } from 'use-scroll-animate/components/solid';
|
|
1696
|
-
* import type {} from 'use-scroll-animate/components/solid'; // JSX types
|
|
1697
|
-
* onMount(() => defineUsa());
|
|
1698
|
-
* false && usa; // keep the directive import (Solid convention)
|
|
1699
|
-
* <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect="flip">…</usa-card>
|
|
1700
|
-
* ```
|
|
1701
|
-
*/
|
|
1702
|
-
|
|
1703
1674
|
/**
|
|
1704
1675
|
* Solid directive (`use:usa`). Solid calls it with the element and an
|
|
1705
|
-
* accessor; the binding is
|
|
1706
|
-
*
|
|
1676
|
+
* accessor; since 4.0.1 the binding is tracked with `createRenderEffect`, so
|
|
1677
|
+
* signals read inside `{{ props, on }}` update the element automatically and
|
|
1678
|
+
* the listeners are removed on cleanup. `refresh()` is kept for code that
|
|
1679
|
+
* calls the directive outside a reactive owner.
|
|
1707
1680
|
*/
|
|
1708
1681
|
declare function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): {
|
|
1709
1682
|
refresh(): void;
|
|
@@ -622,19 +622,6 @@ interface UsaAccordionElement extends UsaElement {
|
|
|
622
622
|
toggleItem(details: HTMLDetailsElement, open?: boolean): Promise<void>;
|
|
623
623
|
}
|
|
624
624
|
|
|
625
|
-
/**
|
|
626
|
-
* `<usa-flip-list>` — animates its children to their new places whenever
|
|
627
|
-
* they are added, removed or reordered (FLIP: transforms only). Works with
|
|
628
|
-
* any rendering: plain DOM, React keyed lists, Vue `v-for`, Svelte `{#each}`.
|
|
629
|
-
*
|
|
630
|
-
* Attributes: `duration` (ms, 420), `easing`, `disabled`.
|
|
631
|
-
* Method: `flip(mutate)` for explicit changes (also measures resizes).
|
|
632
|
-
* Reduced motion: no animation.
|
|
633
|
-
*/
|
|
634
|
-
interface UsaFlipListElement extends UsaElement {
|
|
635
|
-
flip(mutate: () => void | Promise<void>): Promise<void>;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
625
|
/**
|
|
639
626
|
* `<usa-view-switch>` — shows one of its children at a time (tabs, wizard
|
|
640
627
|
* steps, app pages) and animates between them. Children are views; name
|
|
@@ -654,15 +641,15 @@ interface UsaViewSwitchElement extends UsaElement {
|
|
|
654
641
|
|
|
655
642
|
/**
|
|
656
643
|
* use-scroll-animate/components/transitions — view & layout transitions.
|
|
657
|
-
* `<usa-dialog>`, `<usa-accordion>`, `<usa-
|
|
658
|
-
* and the `viewTransition()
|
|
644
|
+
* `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
|
|
645
|
+
* and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
|
|
646
|
+
* `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
|
|
659
647
|
*/
|
|
660
648
|
|
|
661
649
|
declare global {
|
|
662
650
|
interface HTMLElementTagNameMap {
|
|
663
651
|
'usa-dialog': UsaDialogElement;
|
|
664
652
|
'usa-accordion': UsaAccordionElement;
|
|
665
|
-
'usa-flip-list': UsaFlipListElement;
|
|
666
653
|
'usa-view-switch': UsaViewSwitchElement;
|
|
667
654
|
}
|
|
668
655
|
}
|
|
@@ -1621,7 +1608,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
1621
1608
|
readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
|
|
1622
1609
|
readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
|
|
1623
1610
|
readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
|
|
1624
|
-
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-
|
|
1611
|
+
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
|
|
1625
1612
|
readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
|
|
1626
1613
|
readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
|
|
1627
1614
|
readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
|
|
@@ -1684,26 +1671,12 @@ type UsaIntrinsicElements = {
|
|
|
1684
1671
|
[K in Tags]: UsaAttributes;
|
|
1685
1672
|
};
|
|
1686
1673
|
|
|
1687
|
-
/**
|
|
1688
|
-
* use-scroll-animate/components/solid — Solid integration (v3.8).
|
|
1689
|
-
* Solid renders custom elements natively: set properties with `prop:` and
|
|
1690
|
-
* listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).
|
|
1691
|
-
* This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`
|
|
1692
|
-
* directive for `use:usa={{ props, on }}`, and JSX types.
|
|
1693
|
-
*
|
|
1694
|
-
* ```tsx
|
|
1695
|
-
* import { defineUsa, usa } from 'use-scroll-animate/components/solid';
|
|
1696
|
-
* import type {} from 'use-scroll-animate/components/solid'; // JSX types
|
|
1697
|
-
* onMount(() => defineUsa());
|
|
1698
|
-
* false && usa; // keep the directive import (Solid convention)
|
|
1699
|
-
* <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect="flip">…</usa-card>
|
|
1700
|
-
* ```
|
|
1701
|
-
*/
|
|
1702
|
-
|
|
1703
1674
|
/**
|
|
1704
1675
|
* Solid directive (`use:usa`). Solid calls it with the element and an
|
|
1705
|
-
* accessor; the binding is
|
|
1706
|
-
*
|
|
1676
|
+
* accessor; since 4.0.1 the binding is tracked with `createRenderEffect`, so
|
|
1677
|
+
* signals read inside `{{ props, on }}` update the element automatically and
|
|
1678
|
+
* the listeners are removed on cleanup. `refresh()` is kept for code that
|
|
1679
|
+
* calls the directive outside a reactive owner.
|
|
1707
1680
|
*/
|
|
1708
1681
|
declare function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): {
|
|
1709
1682
|
refresh(): void;
|
package/dist/components/solid.js
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
|
+
import { createRenderEffect, onCleanup } from 'solid-js';
|
|
1
2
|
import { defineComponents } from '../components.js';
|
|
2
3
|
import { b as bindUsa } from '../chunks/bind-B_CTL6Qn.js';
|
|
3
4
|
export { u as usaEventName } from '../chunks/bind-B_CTL6Qn.js';
|
|
4
5
|
import './reveal.js';
|
|
5
|
-
import '../chunks/base-
|
|
6
|
+
import '../chunks/base-ZARFccur.js';
|
|
6
7
|
import './text.js';
|
|
7
8
|
import './interaction.js';
|
|
8
9
|
import './feedback.js';
|
|
9
10
|
import './background.js';
|
|
10
|
-
import '../chunks/variants-
|
|
11
|
+
import '../chunks/variants-DvnxvRCM.js';
|
|
11
12
|
import './transitions.js';
|
|
12
13
|
import './physics.js';
|
|
13
|
-
import '../chunks/spring-
|
|
14
|
+
import '../chunks/spring-E2ickYNI.js';
|
|
14
15
|
import './cards.js';
|
|
15
16
|
import './click.js';
|
|
16
17
|
import './ui.js';
|
|
17
18
|
import './page.js';
|
|
18
19
|
import './timeline.js';
|
|
20
|
+
import '../chunks/core-Co-6AL0h.js';
|
|
19
21
|
import './gesture.js';
|
|
20
|
-
import '../chunks/core-
|
|
22
|
+
import '../chunks/core-DKY-fVzR.js';
|
|
21
23
|
import './svg.js';
|
|
22
24
|
import './webgl.js';
|
|
23
25
|
import './depth.js';
|
|
24
26
|
import './layout.js';
|
|
25
27
|
import './packs.js';
|
|
26
|
-
import '../chunks/index-tags-
|
|
28
|
+
import '../chunks/index-tags-43Xtd01A.js';
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
31
|
* use-scroll-animate/components/solid — Solid integration (v3.8).
|
|
@@ -42,12 +44,26 @@ import '../chunks/index-tags-BmQR17Sb.js';
|
|
|
42
44
|
*/
|
|
43
45
|
/**
|
|
44
46
|
* Solid directive (`use:usa`). Solid calls it with the element and an
|
|
45
|
-
* accessor; the binding is
|
|
46
|
-
*
|
|
47
|
+
* accessor; since 4.0.1 the binding is tracked with `createRenderEffect`, so
|
|
48
|
+
* signals read inside `{{ props, on }}` update the element automatically and
|
|
49
|
+
* the listeners are removed on cleanup. `refresh()` is kept for code that
|
|
50
|
+
* calls the directive outside a reactive owner.
|
|
47
51
|
*/
|
|
48
52
|
function usa(el, accessor) {
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
let b = null;
|
|
54
|
+
const run = () => {
|
|
55
|
+
const v = accessor() || {};
|
|
56
|
+
if (b)
|
|
57
|
+
b.update(v);
|
|
58
|
+
else
|
|
59
|
+
b = bindUsa(el, v);
|
|
60
|
+
};
|
|
61
|
+
createRenderEffect(run);
|
|
62
|
+
if (!b)
|
|
63
|
+
run();
|
|
64
|
+
const destroy = () => b?.destroy();
|
|
65
|
+
onCleanup(destroy);
|
|
66
|
+
return { refresh: run, destroy };
|
|
51
67
|
}
|
|
52
68
|
/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */
|
|
53
69
|
function defineUsa(categories) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid.js","sources":["../../src/components/frameworks/solid.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/solid — Solid integration (v3.8).\n * Solid renders custom elements natively: set properties with `prop:` and\n * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).\n * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`\n * directive for `use:usa={{ props, on }}`, and JSX types.\n *\n * ```tsx\n * import { defineUsa, usa } from 'use-scroll-animate/components/solid';\n * import type {} from 'use-scroll-animate/components/solid'; // JSX types\n * onMount(() => defineUsa());\n * false && usa; // keep the directive import (Solid convention)\n * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect=\"flip\">…</usa-card>\n * ```\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\nimport type { UsaIntrinsicElements } from './jsx';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/**\n * Solid directive (`use:usa`). Solid calls it with the element and an\n * accessor; the binding is read
|
|
1
|
+
{"version":3,"file":"solid.js","sources":["../../src/components/frameworks/solid.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/solid — Solid integration (v3.8).\n * Solid renders custom elements natively: set properties with `prop:` and\n * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).\n * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`\n * directive for `use:usa={{ props, on }}`, and JSX types.\n *\n * ```tsx\n * import { defineUsa, usa } from 'use-scroll-animate/components/solid';\n * import type {} from 'use-scroll-animate/components/solid'; // JSX types\n * onMount(() => defineUsa());\n * false && usa; // keep the directive import (Solid convention)\n * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect=\"flip\">…</usa-card>\n * ```\n */\nimport { createRenderEffect, onCleanup } from 'solid-js';\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\nimport type { UsaIntrinsicElements } from './jsx';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/**\n * Solid directive (`use:usa`). Solid calls it with the element and an\n * accessor; since 4.0.1 the binding is tracked with `createRenderEffect`, so\n * signals read inside `{{ props, on }}` update the element automatically and\n * the listeners are removed on cleanup. `refresh()` is kept for code that\n * calls the directive outside a reactive owner.\n */\nexport function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): { refresh(): void; destroy(): void } {\n let b: ReturnType<typeof bindUsa> | null = null;\n const run = () => {\n const v = accessor() || {};\n if (b) b.update(v);\n else b = bindUsa(el, v);\n };\n createRenderEffect(run);\n if (!b) run();\n const destroy = () => b?.destroy();\n onCleanup(destroy);\n return { refresh: run, destroy };\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** JSX intrinsic elements for Solid (same attribute types as the React/Preact ones). */\nexport type SolidUsaIntrinsicElements = UsaIntrinsicElements;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AASH;;;;;;AAMG;AACG,SAAU,GAAG,CAAC,EAAe,EAAE,QAAsC,EAAA;IACzE,IAAI,CAAC,GAAsC,IAAI;IAC/C,MAAM,GAAG,GAAG,MAAK;AACf,QAAA,MAAM,CAAC,GAAG,QAAQ,EAAE,IAAI,EAAE;AAC1B,QAAA,IAAI,CAAC;AAAE,YAAA,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;;AACb,YAAA,CAAC,GAAG,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;AACzB,IAAA,CAAC;IACD,kBAAkB,CAAC,GAAG,CAAC;AACvB,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,GAAG,EAAE;IACb,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,OAAO,EAAE;IAClC,SAAS,CAAC,OAAO,CAAC;AAClB,IAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE;AAClC;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,gBAAgB,CAAC,UAAU,CAAC;AACjE;;;;"}
|
|
@@ -3,28 +3,29 @@
|
|
|
3
3
|
var components = require('../components.cjs');
|
|
4
4
|
var bind = require('../chunks/bind-Ui43-n2d.cjs');
|
|
5
5
|
require('./reveal.cjs');
|
|
6
|
-
require('../chunks/base-
|
|
6
|
+
require('../chunks/base-CXx7jZ-o.cjs');
|
|
7
7
|
require('./text.cjs');
|
|
8
8
|
require('./interaction.cjs');
|
|
9
9
|
require('./feedback.cjs');
|
|
10
10
|
require('./background.cjs');
|
|
11
|
-
require('../chunks/variants-
|
|
11
|
+
require('../chunks/variants-BNIrn4ch.cjs');
|
|
12
12
|
require('./transitions.cjs');
|
|
13
13
|
require('./physics.cjs');
|
|
14
|
-
require('../chunks/spring-
|
|
14
|
+
require('../chunks/spring-2OTnYCzm.cjs');
|
|
15
15
|
require('./cards.cjs');
|
|
16
16
|
require('./click.cjs');
|
|
17
17
|
require('./ui.cjs');
|
|
18
18
|
require('./page.cjs');
|
|
19
19
|
require('./timeline.cjs');
|
|
20
|
+
require('../chunks/core-DXqZm5Il.cjs');
|
|
20
21
|
require('./gesture.cjs');
|
|
21
|
-
require('../chunks/core-
|
|
22
|
+
require('../chunks/core-IaorbTdu.cjs');
|
|
22
23
|
require('./svg.cjs');
|
|
23
24
|
require('./webgl.cjs');
|
|
24
25
|
require('./depth.cjs');
|
|
25
26
|
require('./layout.cjs');
|
|
26
27
|
require('./packs.cjs');
|
|
27
|
-
require('../chunks/index-tags-
|
|
28
|
+
require('../chunks/index-tags-BQh_uGqH.cjs');
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* use-scroll-animate/components/svelte — Svelte integration (v3.8).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svelte.cjs","sources":["../../src/components/frameworks/svelte.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/svelte — Svelte integration (v3.8).\n * Svelte (3, 4, 5) renders `<usa-*>` tags natively; `use:usa` sets\n * **properties** and `usa:*` listeners in one place, and `defineUsa()`\n * registers the elements on the client only (safe in SvelteKit SSR).\n *\n * ```svelte\n * <script>\n * import { usa, defineUsa } from 'use-scroll-animate/components/svelte';\n * import { onMount } from 'svelte';\n * onMount(() => defineUsa(['click', 'ui']));\n * let on = false;\n * </script>\n * <usa-toggle use:usa={{ props: { checked: on }, on: { change: (e) => (on = e.detail.checked) } }}></usa-toggle>\n * ```\n * Plain `on:usa:change` does not compile in Svelte 3/4 (colon); use the action or `onusa:change` in Svelte 5.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/** Svelte action: `use:usa={{ props, on }}`. */\nexport function usa(node: HTMLElement, binding: UsaBinding = {}): { update(b: UsaBinding): void; destroy(): void } {\n return bindUsa(node, binding);\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` for SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n"],"names":["bindUsa","defineComponents"],"mappings":"
|
|
1
|
+
{"version":3,"file":"svelte.cjs","sources":["../../src/components/frameworks/svelte.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/svelte — Svelte integration (v3.8).\n * Svelte (3, 4, 5) renders `<usa-*>` tags natively; `use:usa` sets\n * **properties** and `usa:*` listeners in one place, and `defineUsa()`\n * registers the elements on the client only (safe in SvelteKit SSR).\n *\n * ```svelte\n * <script>\n * import { usa, defineUsa } from 'use-scroll-animate/components/svelte';\n * import { onMount } from 'svelte';\n * onMount(() => defineUsa(['click', 'ui']));\n * let on = false;\n * </script>\n * <usa-toggle use:usa={{ props: { checked: on }, on: { change: (e) => (on = e.detail.checked) } }}></usa-toggle>\n * ```\n * Plain `on:usa:change` does not compile in Svelte 3/4 (colon); use the action or `onusa:change` in Svelte 5.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/** Svelte action: `use:usa={{ props, on }}`. */\nexport function usa(node: HTMLElement, binding: UsaBinding = {}): { update(b: UsaBinding): void; destroy(): void } {\n return bindUsa(node, binding);\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` for SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n"],"names":["bindUsa","defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;AAOH;SACgB,GAAG,CAAC,IAAiB,EAAE,UAAsB,EAAE,EAAA;AAC7D,IAAA,OAAOA,YAAO,CAAC,IAAI,EAAE,OAAO,CAAC;AAC/B;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAEC,2BAAgB,CAAC,UAAU,CAAC;AACjE;;;;;;;"}
|
|
@@ -622,19 +622,6 @@ interface UsaAccordionElement extends UsaElement {
|
|
|
622
622
|
toggleItem(details: HTMLDetailsElement, open?: boolean): Promise<void>;
|
|
623
623
|
}
|
|
624
624
|
|
|
625
|
-
/**
|
|
626
|
-
* `<usa-flip-list>` — animates its children to their new places whenever
|
|
627
|
-
* they are added, removed or reordered (FLIP: transforms only). Works with
|
|
628
|
-
* any rendering: plain DOM, React keyed lists, Vue `v-for`, Svelte `{#each}`.
|
|
629
|
-
*
|
|
630
|
-
* Attributes: `duration` (ms, 420), `easing`, `disabled`.
|
|
631
|
-
* Method: `flip(mutate)` for explicit changes (also measures resizes).
|
|
632
|
-
* Reduced motion: no animation.
|
|
633
|
-
*/
|
|
634
|
-
interface UsaFlipListElement extends UsaElement {
|
|
635
|
-
flip(mutate: () => void | Promise<void>): Promise<void>;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
625
|
/**
|
|
639
626
|
* `<usa-view-switch>` — shows one of its children at a time (tabs, wizard
|
|
640
627
|
* steps, app pages) and animates between them. Children are views; name
|
|
@@ -654,15 +641,15 @@ interface UsaViewSwitchElement extends UsaElement {
|
|
|
654
641
|
|
|
655
642
|
/**
|
|
656
643
|
* use-scroll-animate/components/transitions — view & layout transitions.
|
|
657
|
-
* `<usa-dialog>`, `<usa-accordion>`, `<usa-
|
|
658
|
-
* and the `viewTransition()
|
|
644
|
+
* `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
|
|
645
|
+
* and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
|
|
646
|
+
* `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
|
|
659
647
|
*/
|
|
660
648
|
|
|
661
649
|
declare global {
|
|
662
650
|
interface HTMLElementTagNameMap {
|
|
663
651
|
'usa-dialog': UsaDialogElement;
|
|
664
652
|
'usa-accordion': UsaAccordionElement;
|
|
665
|
-
'usa-flip-list': UsaFlipListElement;
|
|
666
653
|
'usa-view-switch': UsaViewSwitchElement;
|
|
667
654
|
}
|
|
668
655
|
}
|
|
@@ -1621,7 +1608,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
1621
1608
|
readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
|
|
1622
1609
|
readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
|
|
1623
1610
|
readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
|
|
1624
|
-
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-
|
|
1611
|
+
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
|
|
1625
1612
|
readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
|
|
1626
1613
|
readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
|
|
1627
1614
|
readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
|
|
@@ -622,19 +622,6 @@ interface UsaAccordionElement extends UsaElement {
|
|
|
622
622
|
toggleItem(details: HTMLDetailsElement, open?: boolean): Promise<void>;
|
|
623
623
|
}
|
|
624
624
|
|
|
625
|
-
/**
|
|
626
|
-
* `<usa-flip-list>` — animates its children to their new places whenever
|
|
627
|
-
* they are added, removed or reordered (FLIP: transforms only). Works with
|
|
628
|
-
* any rendering: plain DOM, React keyed lists, Vue `v-for`, Svelte `{#each}`.
|
|
629
|
-
*
|
|
630
|
-
* Attributes: `duration` (ms, 420), `easing`, `disabled`.
|
|
631
|
-
* Method: `flip(mutate)` for explicit changes (also measures resizes).
|
|
632
|
-
* Reduced motion: no animation.
|
|
633
|
-
*/
|
|
634
|
-
interface UsaFlipListElement extends UsaElement {
|
|
635
|
-
flip(mutate: () => void | Promise<void>): Promise<void>;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
625
|
/**
|
|
639
626
|
* `<usa-view-switch>` — shows one of its children at a time (tabs, wizard
|
|
640
627
|
* steps, app pages) and animates between them. Children are views; name
|
|
@@ -654,15 +641,15 @@ interface UsaViewSwitchElement extends UsaElement {
|
|
|
654
641
|
|
|
655
642
|
/**
|
|
656
643
|
* use-scroll-animate/components/transitions — view & layout transitions.
|
|
657
|
-
* `<usa-dialog>`, `<usa-accordion>`, `<usa-
|
|
658
|
-
* and the `viewTransition()
|
|
644
|
+
* `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
|
|
645
|
+
* and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
|
|
646
|
+
* `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
|
|
659
647
|
*/
|
|
660
648
|
|
|
661
649
|
declare global {
|
|
662
650
|
interface HTMLElementTagNameMap {
|
|
663
651
|
'usa-dialog': UsaDialogElement;
|
|
664
652
|
'usa-accordion': UsaAccordionElement;
|
|
665
|
-
'usa-flip-list': UsaFlipListElement;
|
|
666
653
|
'usa-view-switch': UsaViewSwitchElement;
|
|
667
654
|
}
|
|
668
655
|
}
|
|
@@ -1621,7 +1608,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
1621
1608
|
readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
|
|
1622
1609
|
readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
|
|
1623
1610
|
readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
|
|
1624
|
-
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-
|
|
1611
|
+
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
|
|
1625
1612
|
readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
|
|
1626
1613
|
readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
|
|
1627
1614
|
readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
|
|
@@ -2,28 +2,29 @@ import { defineComponents } from '../components.js';
|
|
|
2
2
|
import { b as bindUsa } from '../chunks/bind-B_CTL6Qn.js';
|
|
3
3
|
export { u as usaEventName } from '../chunks/bind-B_CTL6Qn.js';
|
|
4
4
|
import './reveal.js';
|
|
5
|
-
import '../chunks/base-
|
|
5
|
+
import '../chunks/base-ZARFccur.js';
|
|
6
6
|
import './text.js';
|
|
7
7
|
import './interaction.js';
|
|
8
8
|
import './feedback.js';
|
|
9
9
|
import './background.js';
|
|
10
|
-
import '../chunks/variants-
|
|
10
|
+
import '../chunks/variants-DvnxvRCM.js';
|
|
11
11
|
import './transitions.js';
|
|
12
12
|
import './physics.js';
|
|
13
|
-
import '../chunks/spring-
|
|
13
|
+
import '../chunks/spring-E2ickYNI.js';
|
|
14
14
|
import './cards.js';
|
|
15
15
|
import './click.js';
|
|
16
16
|
import './ui.js';
|
|
17
17
|
import './page.js';
|
|
18
18
|
import './timeline.js';
|
|
19
|
+
import '../chunks/core-Co-6AL0h.js';
|
|
19
20
|
import './gesture.js';
|
|
20
|
-
import '../chunks/core-
|
|
21
|
+
import '../chunks/core-DKY-fVzR.js';
|
|
21
22
|
import './svg.js';
|
|
22
23
|
import './webgl.js';
|
|
23
24
|
import './depth.js';
|
|
24
25
|
import './layout.js';
|
|
25
26
|
import './packs.js';
|
|
26
|
-
import '../chunks/index-tags-
|
|
27
|
+
import '../chunks/index-tags-43Xtd01A.js';
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* use-scroll-animate/components/svelte — Svelte integration (v3.8).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svelte.js","sources":["../../src/components/frameworks/svelte.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/svelte — Svelte integration (v3.8).\n * Svelte (3, 4, 5) renders `<usa-*>` tags natively; `use:usa` sets\n * **properties** and `usa:*` listeners in one place, and `defineUsa()`\n * registers the elements on the client only (safe in SvelteKit SSR).\n *\n * ```svelte\n * <script>\n * import { usa, defineUsa } from 'use-scroll-animate/components/svelte';\n * import { onMount } from 'svelte';\n * onMount(() => defineUsa(['click', 'ui']));\n * let on = false;\n * </script>\n * <usa-toggle use:usa={{ props: { checked: on }, on: { change: (e) => (on = e.detail.checked) } }}></usa-toggle>\n * ```\n * Plain `on:usa:change` does not compile in Svelte 3/4 (colon); use the action or `onusa:change` in Svelte 5.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/** Svelte action: `use:usa={{ props, on }}`. */\nexport function usa(node: HTMLElement, binding: UsaBinding = {}): { update(b: UsaBinding): void; destroy(): void } {\n return bindUsa(node, binding);\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` for SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"svelte.js","sources":["../../src/components/frameworks/svelte.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/svelte — Svelte integration (v3.8).\n * Svelte (3, 4, 5) renders `<usa-*>` tags natively; `use:usa` sets\n * **properties** and `usa:*` listeners in one place, and `defineUsa()`\n * registers the elements on the client only (safe in SvelteKit SSR).\n *\n * ```svelte\n * <script>\n * import { usa, defineUsa } from 'use-scroll-animate/components/svelte';\n * import { onMount } from 'svelte';\n * onMount(() => defineUsa(['click', 'ui']));\n * let on = false;\n * </script>\n * <usa-toggle use:usa={{ props: { checked: on }, on: { change: (e) => (on = e.detail.checked) } }}></usa-toggle>\n * ```\n * Plain `on:usa:change` does not compile in Svelte 3/4 (colon); use the action or `onusa:change` in Svelte 5.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/** Svelte action: `use:usa={{ props, on }}`. */\nexport function usa(node: HTMLElement, binding: UsaBinding = {}): { update(b: UsaBinding): void; destroy(): void } {\n return bindUsa(node, binding);\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` for SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;AAOH;SACgB,GAAG,CAAC,IAAiB,EAAE,UAAsB,EAAE,EAAA;AAC7D,IAAA,OAAO,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;AAC/B;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,gBAAgB,CAAC,UAAU,CAAC;AACjE;;;;"}
|
package/dist/components/svg.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var base = require('../chunks/base-
|
|
3
|
+
var base = require('../chunks/base-CXx7jZ-o.cjs');
|
|
4
4
|
|
|
5
5
|
const NUM = /-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi;
|
|
6
6
|
/** `true` when two path strings share the same commands (so their numbers can be interpolated). */
|
|
@@ -76,7 +76,7 @@ function drawLines(root, o = {}) {
|
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
var css = "usa-draw{display:inline-block}usa-draw svg :is(path,line,polyline,polygon,circle,ellipse,rect){transition:fill-opacity 0.6s ease}usa-draw[fill]:not([data-drawn]) svg :is(path,polygon,circle,ellipse,rect){fill-opacity:0}usa-morph{display:inline-block;line-height:0}usa-morph svg{width:100%;height:100%;fill:currentColor}usa-morph[role=\"button\"]{cursor:pointer}usa-mask-reveal{display:block}usa-mask-reveal[data-state=\"visible\"]{clip-path:none !important}usa-anim-icon{display:inline-flex;line-height:0;vertical-align:middle}usa-anim-icon svg{overflow:visible}@media (prefers-reduced-motion:reduce){usa-mask-reveal{clip-path:none !important}usa-draw svg *{stroke-dashoffset:0 !important}}";
|
|
79
|
+
var css = "usa-draw{display:inline-block}usa-draw svg :is(path,line,polyline,polygon,circle,ellipse,rect){transition:fill-opacity 0.6s ease}usa-draw[fill]:not([data-drawn]) svg :is(path,polygon,circle,ellipse,rect){fill-opacity:0}usa-morph{display:inline-block;line-height:0}usa-morph svg{width:100%;height:100%;fill:currentColor}usa-morph[role=\"button\"]{cursor:pointer}usa-mask-reveal{display:block}usa-mask-reveal[data-state=\"visible\"]{clip-path:none !important}usa-mask-reveal[data-state=\"hidden\"]{opacity:0}usa-anim-icon{display:inline-flex;line-height:0;vertical-align:middle}usa-anim-icon svg{overflow:visible}@media (prefers-reduced-motion:reduce){usa-mask-reveal{clip-path:none !important;opacity:1 !important}usa-draw svg *{stroke-dashoffset:0 !important}}";
|
|
80
80
|
|
|
81
81
|
function defineDraw(tag = 'usa-draw') {
|
|
82
82
|
return base.defineElement(tag, (Base) => class UsaDraw extends Base {
|
|
@@ -239,7 +239,9 @@ function defineMaskReveal(tag = 'usa-mask-reveal') {
|
|
|
239
239
|
reveal() {
|
|
240
240
|
const [a, b] = this.frames();
|
|
241
241
|
this.setAttribute('data-state', 'revealing');
|
|
242
|
-
|
|
242
|
+
// fill 'both' keeps the closed mask applied during `delay`
|
|
243
|
+
const anim = this.motion(this, [{ clipPath: a }, { clipPath: b }], { duration: this.num('duration', 900), delay: this.num('delay', 0), easing: base.EASE_OUT, fill: 'both' });
|
|
244
|
+
this.style.opacity = '';
|
|
243
245
|
const done = () => {
|
|
244
246
|
this.setAttribute('data-state', 'visible');
|
|
245
247
|
this.emit('complete');
|
|
@@ -253,9 +255,16 @@ function defineMaskReveal(tag = 'usa-mask-reveal') {
|
|
|
253
255
|
this.setAttribute('data-state', 'visible');
|
|
254
256
|
return;
|
|
255
257
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
// 4.0.1: hide with opacity, not the closed clip-path — Chromium's
|
|
259
|
+
// IntersectionObserver honours the target's own clip-path, so a fully
|
|
260
|
+
// clipped element never reports as intersecting and never revealed.
|
|
261
|
+
const hide = () => {
|
|
262
|
+
this.getAnimations?.().forEach((x) => x.cancel());
|
|
263
|
+
this.style.opacity = '0';
|
|
264
|
+
this.setAttribute('data-state', 'hidden');
|
|
265
|
+
};
|
|
266
|
+
hide();
|
|
267
|
+
this.onCleanup(() => ((this.style.opacity = ''), (this.style.clipPath = '')));
|
|
259
268
|
const t = this.str('trigger', 'view');
|
|
260
269
|
if (t === 'hover')
|
|
261
270
|
this.listen(this, 'pointerenter', () => void this.reveal());
|
|
@@ -268,11 +277,8 @@ function defineMaskReveal(tag = 'usa-mask-reveal') {
|
|
|
268
277
|
done = true;
|
|
269
278
|
void this.reveal();
|
|
270
279
|
}
|
|
271
|
-
else if (!v && this.flag('repeat'))
|
|
272
|
-
|
|
273
|
-
this.style.clipPath = this.frames()[0];
|
|
274
|
-
this.setAttribute('data-state', 'hidden');
|
|
275
|
-
}
|
|
280
|
+
else if (!v && this.flag('repeat'))
|
|
281
|
+
hide();
|
|
276
282
|
}, { threshold: 0.25 });
|
|
277
283
|
}
|
|
278
284
|
}
|