use-scroll-animate 3.6.0 → 3.8.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 +20 -0
- package/README.md +1 -1
- package/dist/chunks/bind-B_CTL6Qn.js +22 -0
- package/dist/chunks/bind-B_CTL6Qn.js.map +1 -0
- package/dist/chunks/bind-Ui43-n2d.cjs +25 -0
- package/dist/chunks/bind-Ui43-n2d.cjs.map +1 -0
- package/dist/components/angular.cjs +67 -0
- package/dist/components/angular.cjs.map +1 -0
- package/dist/components/angular.d.cts +1662 -0
- package/dist/components/angular.d.ts +1662 -0
- package/dist/components/angular.js +61 -0
- package/dist/components/angular.js.map +1 -0
- package/dist/components/solid.cjs +62 -0
- package/dist/components/solid.cjs.map +1 -0
- package/dist/components/solid.d.cts +1693 -0
- package/dist/components/solid.d.ts +1693 -0
- package/dist/components/solid.js +58 -0
- package/dist/components/solid.js.map +1 -0
- package/dist/components/svelte.cjs +59 -0
- package/dist/components/svelte.cjs.map +1 -0
- package/dist/components/svelte.d.cts +1661 -0
- package/dist/components/svelte.d.ts +1661 -0
- package/dist/components/svelte.js +55 -0
- package/dist/components/svelte.js.map +1 -0
- package/docs/components.md +14 -0
- package/docs/frameworks-ssr.md +36 -0
- package/docs/hybrid-apps.md +130 -0
- package/package.json +31 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { defineComponents } from '../components.js';
|
|
2
|
+
export { b as bindUsa, u as usaEventName } from '../chunks/bind-B_CTL6Qn.js';
|
|
3
|
+
import './reveal.js';
|
|
4
|
+
import '../chunks/base-BpROOcey.js';
|
|
5
|
+
import './text.js';
|
|
6
|
+
import './interaction.js';
|
|
7
|
+
import './feedback.js';
|
|
8
|
+
import './background.js';
|
|
9
|
+
import '../chunks/variants-CHe1VbSn.js';
|
|
10
|
+
import './transitions.js';
|
|
11
|
+
import './physics.js';
|
|
12
|
+
import '../chunks/spring-C-fw7_9f.js';
|
|
13
|
+
import './cards.js';
|
|
14
|
+
import './click.js';
|
|
15
|
+
import './ui.js';
|
|
16
|
+
import './page.js';
|
|
17
|
+
import './timeline.js';
|
|
18
|
+
import './gesture.js';
|
|
19
|
+
import '../chunks/core-uxs3ETou.js';
|
|
20
|
+
import './svg.js';
|
|
21
|
+
import './webgl.js';
|
|
22
|
+
import './depth.js';
|
|
23
|
+
import './layout.js';
|
|
24
|
+
import '../chunks/index-tags-BANJ-e4H.js';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* use-scroll-animate/components/angular — Angular integration (v3.8).
|
|
28
|
+
* Angular renders `<usa-*>` tags once the component (or NgModule) allows
|
|
29
|
+
* custom elements with `CUSTOM_ELEMENTS_SCHEMA`; property binding
|
|
30
|
+
* `[checked]="on"` and event binding `(usa:change)="…"` then work as is.
|
|
31
|
+
* This entry is framework-free (no `@angular/*` import):
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { CUSTOM_ELEMENTS_SCHEMA, Component, APP_INITIALIZER } from '@angular/core';
|
|
35
|
+
* import { usaInitializer } from 'use-scroll-animate/components/angular';
|
|
36
|
+
*
|
|
37
|
+
* // app.config.ts
|
|
38
|
+
* providers: [{ provide: APP_INITIALIZER, multi: true, useFactory: usaInitializer(['click', 'ui']) }]
|
|
39
|
+
*
|
|
40
|
+
* @Component({ standalone: true, schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
41
|
+
* template: `<usa-toggle [checked]="on" (usa:change)="on = $any($event).detail.checked"></usa-toggle>` })
|
|
42
|
+
* ```
|
|
43
|
+
* `bindUsa(el, { props, on })` is available for directives that bind imperatively.
|
|
44
|
+
*/
|
|
45
|
+
/** `APP_INITIALIZER` factory: registers the elements in the browser (no-op during SSR). */
|
|
46
|
+
function usaInitializer(categories) {
|
|
47
|
+
return () => () => {
|
|
48
|
+
if (typeof window !== 'undefined')
|
|
49
|
+
defineComponents(categories);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Register the elements directly (e.g. in `main.ts` before `bootstrapApplication`). */
|
|
53
|
+
function defineUsa(categories) {
|
|
54
|
+
if (typeof window !== 'undefined')
|
|
55
|
+
defineComponents(categories);
|
|
56
|
+
}
|
|
57
|
+
/** Read `event.detail` from a `usa:*` event in a template handler: `(usa:change)="on = usaDetail($event).checked"`. */
|
|
58
|
+
const usaDetail = (e) => e.detail;
|
|
59
|
+
|
|
60
|
+
export { defineUsa, usaDetail, usaInitializer };
|
|
61
|
+
//# sourceMappingURL=angular.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular.js","sources":["../../src/components/frameworks/angular.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/angular — Angular integration (v3.8).\n * Angular renders `<usa-*>` tags once the component (or NgModule) allows\n * custom elements with `CUSTOM_ELEMENTS_SCHEMA`; property binding\n * `[checked]=\"on\"` and event binding `(usa:change)=\"…\"` then work as is.\n * This entry is framework-free (no `@angular/*` import):\n *\n * ```ts\n * import { CUSTOM_ELEMENTS_SCHEMA, Component, APP_INITIALIZER } from '@angular/core';\n * import { usaInitializer } from 'use-scroll-animate/components/angular';\n *\n * // app.config.ts\n * providers: [{ provide: APP_INITIALIZER, multi: true, useFactory: usaInitializer(['click', 'ui']) }]\n *\n * @Component({ standalone: true, schemas: [CUSTOM_ELEMENTS_SCHEMA],\n * template: `<usa-toggle [checked]=\"on\" (usa:change)=\"on = $any($event).detail.checked\"></usa-toggle>` })\n * ```\n * `bindUsa(el, { props, on })` is available for directives that bind imperatively.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/** `APP_INITIALIZER` factory: registers the elements in the browser (no-op during SSR). */\nexport function usaInitializer(categories?: ComponentCategory[]): () => () => void {\n return () => () => {\n if (typeof window !== 'undefined') defineComponents(categories);\n };\n}\n\n/** Register the elements directly (e.g. in `main.ts` before `bootstrapApplication`). */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** Read `event.detail` from a `usa:*` event in a template handler: `(usa:change)=\"on = usaDetail($event).checked\"`. */\nexport const usaDetail = <T = any>(e: Event): T => (e as CustomEvent<T>).detail;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAMH;AACM,SAAU,cAAc,CAAC,UAAgC,EAAA;AAC7D,IAAA,OAAO,MAAM,MAAK;QAChB,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,gBAAgB,CAAC,UAAU,CAAC;AACjE,IAAA,CAAC;AACH;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,gBAAgB,CAAC,UAAU,CAAC;AACjE;AAEA;AACO,MAAM,SAAS,GAAG,CAAU,CAAQ,KAAS,CAAoB,CAAC;;;;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components = require('../components.cjs');
|
|
4
|
+
var bind = require('../chunks/bind-Ui43-n2d.cjs');
|
|
5
|
+
require('./reveal.cjs');
|
|
6
|
+
require('../chunks/base-CXx7jZ-o.cjs');
|
|
7
|
+
require('./text.cjs');
|
|
8
|
+
require('./interaction.cjs');
|
|
9
|
+
require('./feedback.cjs');
|
|
10
|
+
require('./background.cjs');
|
|
11
|
+
require('../chunks/variants-BNIrn4ch.cjs');
|
|
12
|
+
require('./transitions.cjs');
|
|
13
|
+
require('./physics.cjs');
|
|
14
|
+
require('../chunks/spring-2OTnYCzm.cjs');
|
|
15
|
+
require('./cards.cjs');
|
|
16
|
+
require('./click.cjs');
|
|
17
|
+
require('./ui.cjs');
|
|
18
|
+
require('./page.cjs');
|
|
19
|
+
require('./timeline.cjs');
|
|
20
|
+
require('./gesture.cjs');
|
|
21
|
+
require('../chunks/core-IaorbTdu.cjs');
|
|
22
|
+
require('./svg.cjs');
|
|
23
|
+
require('./webgl.cjs');
|
|
24
|
+
require('./depth.cjs');
|
|
25
|
+
require('./layout.cjs');
|
|
26
|
+
require('../chunks/index-tags-wbuPiMR6.cjs');
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* use-scroll-animate/components/solid — Solid integration (v3.8).
|
|
30
|
+
* Solid renders custom elements natively: set properties with `prop:` and
|
|
31
|
+
* listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).
|
|
32
|
+
* This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`
|
|
33
|
+
* directive for `use:usa={{ props, on }}`, and JSX types.
|
|
34
|
+
*
|
|
35
|
+
* ```tsx
|
|
36
|
+
* import { defineUsa, usa } from 'use-scroll-animate/components/solid';
|
|
37
|
+
* import type {} from 'use-scroll-animate/components/solid'; // JSX types
|
|
38
|
+
* onMount(() => defineUsa());
|
|
39
|
+
* false && usa; // keep the directive import (Solid convention)
|
|
40
|
+
* <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect="flip">…</usa-card>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* Solid directive (`use:usa`). Solid calls it with the element and an
|
|
45
|
+
* accessor; the binding is read once on mount and re-read whenever
|
|
46
|
+
* `refresh()` on the returned handle is called (or wrap it in `createEffect`).
|
|
47
|
+
*/
|
|
48
|
+
function usa(el, accessor) {
|
|
49
|
+
const b = bind.bindUsa(el, accessor() || {});
|
|
50
|
+
return { refresh: () => b.update(accessor() || {}), destroy: b.destroy };
|
|
51
|
+
}
|
|
52
|
+
/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */
|
|
53
|
+
function defineUsa(categories) {
|
|
54
|
+
if (typeof window !== 'undefined')
|
|
55
|
+
components.defineComponents(categories);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports.bindUsa = bind.bindUsa;
|
|
59
|
+
exports.usaEventName = bind.usaEventName;
|
|
60
|
+
exports.defineUsa = defineUsa;
|
|
61
|
+
exports.usa = usa;
|
|
62
|
+
//# sourceMappingURL=solid.cjs.map
|
|
@@ -0,0 +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 once on mount and re-read whenever\n * `refresh()` on the returned handle is called (or wrap it in `createEffect`).\n */\nexport function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): { refresh(): void; destroy(): void } {\n const b = bindUsa(el, accessor() || {});\n return { refresh: () => b.update(accessor() || {}), destroy: b.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","defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AAQH;;;;AAIG;AACG,SAAU,GAAG,CAAC,EAAe,EAAE,QAAsC,EAAA;IACzE,MAAM,CAAC,GAAGA,YAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;AAC1E;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAEC,2BAAgB,CAAC,UAAU,CAAC;AACjE;;;;;;;"}
|