@infinityfx/lively 4.0.0-beta.3 → 4.0.0-beta.5
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/dist/animate.js +1 -1
- package/dist/hooks/use-path.js +1 -1
- package/dist/hooks/use-path.js.map +1 -1
- package/dist/hooks/use-viewport.js +1 -1
- package/dist/hooks/use-visible.js +1 -1
- package/dist/types/hooks/use-path.d.ts +1 -1
- package/dist/types/hooks/use-viewport.d.ts +1 -1
- package/dist/types/hooks/use-visible.d.ts +1 -1
- package/package.json +1 -5
- package/dist/animations/fade.js +0 -2
- package/dist/animations/fade.js.map +0 -1
- package/dist/animations/move.js +0 -2
- package/dist/animations/move.js.map +0 -1
- package/dist/animations/pop.js +0 -2
- package/dist/animations/pop.js.map +0 -1
- package/dist/animations/scale.js +0 -2
- package/dist/animations/scale.js.map +0 -1
- package/dist/animations/wipe.js +0 -2
- package/dist/animations/wipe.js.map +0 -1
- package/dist/animations.js +0 -2
- package/dist/animations.js.map +0 -1
- package/dist/types/animations/fade.d.ts +0 -3
- package/dist/types/animations/move.d.ts +0 -3
- package/dist/types/animations/pop.d.ts +0 -3
- package/dist/types/animations/scale.d.ts +0 -3
- package/dist/types/animations/wipe.d.ts +0 -3
- package/dist/types/animations.d.ts +0 -7
package/dist/animate.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{__rest as i}from"tslib";import{jsx as r,Fragment as t}from"react/jsx-runtime";import{Children as
|
|
2
|
+
import{__rest as i}from"tslib";import{jsx as r,Fragment as t}from"react/jsx-runtime";import{Children as e,isValidElement as n,cloneElement as a}from"react";import o from"./animatable.js";function l(l){var{children:m,animations:p=[{translate:["0px 16px","0px 0px"],opacity:[0,1],duration:.35}],levels:s=2}=l,c=i(l,["children","animations","levels"]);return r(t,{children:function i(t,l=s){let m,f=s-l;for(;!(m=p[f])&&f>=0;)f--;return l<1||e.count(t)<1?t:r(o,Object.assign({},c,{animate:m,inherit:l<s||c.inherit,children:e.map(t,(r=>n(r)?a(r,{},i(r.props.children,l-1)):r))}))}(m)})}l.isLively=!0;export{l as default};
|
|
3
3
|
//# sourceMappingURL=animate.js.map
|
package/dist/hooks/use-path.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useRef as t,useCallback as r}from"react";function n(){const n=t(null)
|
|
1
|
+
import{useRef as t,useCallback as r}from"react";function n(){const n=t(null),e=r((t=>(r,e)=>{if(!n.current)return t([0,0],e);const u=n.current.getTotalLength()*r,{x:o,y:c}=n.current.getPointAtLength(u);return t([o,c],e)}),[n]);return[n,e]}export{n as default};
|
|
2
2
|
//# sourceMappingURL=use-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-path.js","sources":["../../src/hooks/use-path.ts"],"sourcesContent":[null],"names":["usePath","ref","useRef","useCallback","transform","progress","index","current","len","getTotalLength","x","y","getPointAtLength"],"mappings":"gDAEc,SAAUA,IACpB,MAAMC,EAAMC,EAAU,
|
|
1
|
+
{"version":3,"file":"use-path.js","sources":["../../src/hooks/use-path.ts"],"sourcesContent":[null],"names":["usePath","ref","useRef","link","useCallback","transform","progress","index","current","len","getTotalLength","x","y","getPointAtLength"],"mappings":"gDAEc,SAAUA,IACpB,MAAMC,EAAMC,EAAU,MAEhBC,EAAOC,GAAaC,GACf,CAACC,EAAkBC,KACtB,IAAKN,EAAIO,QAAS,OAAOH,EAAU,CAAC,EAAG,GAAIE,GAE3C,MAAME,EAAMR,EAAIO,QAAQE,iBAAmBJ,GACrCK,EAAEA,EAACC,EAAEA,GAAMX,EAAIO,QAAQK,iBAAiBJ,GAE9C,OAAOJ,EAAU,CAACM,EAAGC,GAAIL,EAAM,GAEpC,CAACN,IAEJ,MAAO,CAACA,EAAKE,EACjB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useRef as e}from"react";import n from"./use-link.js";import t from"./use-mount-effect.js";function r(r=.5){const i=e(null),o=n([-1,-1]);return t((()=>{function e(){if(!i.current)return;const{x:e,y:n,width:t,height:s}=i.current.getBoundingClientRect();o.set([(e+t*r)/(window.innerWidth+2*t*(r-.5)),(n+s*r)/(window.innerHeight+2*s*(r-.5))])}return e(),window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[r]),[o
|
|
2
|
+
import{useRef as e}from"react";import n from"./use-link.js";import t from"./use-mount-effect.js";function r(r=.5){const i=e(null),o=n([-1,-1]);return t((()=>{function e(){if(!i.current)return;const{x:e,y:n,width:t,height:s}=i.current.getBoundingClientRect();o.set([(e+t*r)/(window.innerWidth+2*t*(r-.5)),(n+s*r)/(window.innerHeight+2*s*(r-.5))])}return e(),window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[r]),[i,o]}export{r as default};
|
|
3
3
|
//# sourceMappingURL=use-viewport.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useRef as
|
|
2
|
+
import{useRef as r,useEffect as e}from"react";import t from"./use-trigger.js";import n from"./use-viewport.js";function o({enter:o=1,exit:u=!1,threshold:c=.5}={}){const[s,i]=n(c),f=r(!1),l=t(),m=t();return e((()=>{function r(){const[r,e]=i(),t=r>0&&r<1&&e>0&&e<1;!f.current&&t&&l.called<(!0===o?1/0:+o)&&l(),f.current&&!t&&m.called<(!0===u?1/0:+u)&&m(),f.current=t}return r(),i.subscribe(r),()=>i.unsubscribe(r)}),[l,m]),[s,l,m]}export{o as default};
|
|
3
3
|
//# sourceMappingURL=use-visible.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export default function usePath<T extends SVGGeometryElement = any>(): [(transform: (value: [number, number], index: number) => any) => (progress: number, index: number) => any
|
|
2
|
+
export default function usePath<T extends SVGGeometryElement = any>(): [React.Ref<T>, (transform: (value: [number, number], index: number) => any) => (progress: number, index: number) => any];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Link } from "../core/link";
|
|
3
|
-
export default function useViewport<T extends Element = any>(threshold?: number): [Link<[number, number]
|
|
3
|
+
export default function useViewport<T extends Element = any>(threshold?: number): [React.Ref<T>, Link<[number, number]>];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infinityfx/lively",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Feature complete, lightweight react animation library.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,15 +8,11 @@
|
|
|
8
8
|
"types": "dist/types/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": "./dist/index.js",
|
|
11
|
-
"./animations": "./dist/animations.js",
|
|
12
11
|
"./hooks": "./dist/hooks.js",
|
|
13
12
|
"./layout": "./dist/layout.js"
|
|
14
13
|
},
|
|
15
14
|
"typesVersions": {
|
|
16
15
|
"*": {
|
|
17
|
-
"animations": [
|
|
18
|
-
"./dist/types/animations.d.ts"
|
|
19
|
-
],
|
|
20
16
|
"hooks": [
|
|
21
17
|
"./dist/types/hooks.d.ts"
|
|
22
18
|
],
|
package/dist/animations/fade.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fade.js","sources":["../../src/animations/fade.ts"],"sourcesContent":[null],"names":["Fade","Clip","opacity","duration"],"mappings":"+BAEA,MAAMA,EAAO,IAAIC,EAAK,CAClBC,QAAS,EACTC,SAAU,KACX,CACCD,QAAS"}
|
package/dist/animations/move.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"move.js","sources":["../../src/animations/move.ts"],"sourcesContent":[null],"names":["Move","Clip","opacity","translate","duration"],"mappings":"+BAEA,MAAMA,EAAO,IAAIC,EAAK,CAClBC,QAAS,EACTC,UAAW,UACXC,SAAU,IACX,CACCF,QAAS,EACTC,UAAW"}
|
package/dist/animations/pop.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pop.js","sources":["../../src/animations/pop.ts"],"sourcesContent":[null],"names":["Pop","Clip","opacity","scale","duration"],"mappings":"+BAEA,MAAMA,EAAM,IAAIC,EAAK,CACjBC,QAAS,EACTC,MAAO,EACPC,SAAU,KACX,CACCF,QAAS,EACTC,MAAO"}
|
package/dist/animations/scale.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scale.js","sources":["../../src/animations/scale.ts"],"sourcesContent":[null],"names":["Scale","Clip","scale","transformOrigin"],"mappings":"+BAEA,MAAMA,EAAQ,IAAIC,EAAK,CACnBC,MAAO,GACR,CACCC,gBAAiB,OACjBD,MAAO"}
|
package/dist/animations/wipe.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wipe.js","sources":["../../src/animations/wipe.ts"],"sourcesContent":[null],"names":["Wipe","Clip","clipPath"],"mappings":"+BAEA,MAAMA,EAAO,IAAIC,EAAK,CAClBC,SAAU,sBACX,CACCA,SAAU"}
|
package/dist/animations.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export{default as Fade}from"./animations/fade.js";export{default as Move}from"./animations/move.js";export{default as Pop}from"./animations/pop.js";export{default as Scale}from"./animations/scale.js";export{default as Wipe}from"./animations/wipe.js";export{default as Clip}from"./core/clip.js";
|
|
2
|
-
//# sourceMappingURL=animations.js.map
|
package/dist/animations.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"animations.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import Fade from "./animations/fade";
|
|
2
|
-
import Move from "./animations/move";
|
|
3
|
-
import Pop from "./animations/pop";
|
|
4
|
-
import Scale from "./animations/scale";
|
|
5
|
-
import Wipe from "./animations/wipe";
|
|
6
|
-
import Clip from "./core/clip";
|
|
7
|
-
export { Fade, Move, Pop, Scale, Wipe, Clip };
|