@tamagui/animations-css 1.0.1-beta.140 → 1.0.1-beta.141

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.
@@ -21,6 +21,7 @@ __export(createAnimations_exports, {
21
21
  createAnimations: () => createAnimations
22
22
  });
23
23
  module.exports = __toCommonJS(createAnimations_exports);
24
+ var import_react = require("react");
24
25
  function createAnimations(animations) {
25
26
  return {
26
27
  avoidClasses: false,
@@ -33,12 +34,15 @@ function createAnimations(animations) {
33
34
  throw new Error(`no animation found: ${props.animation}`);
34
35
  }
35
36
  const keys = props.animateOnly ? props.animateOnly.join(" ") : "all";
36
- return {
37
+ const style = {
37
38
  style: {
38
39
  transition: `${keys} ${animation}`,
39
40
  ...getStyle()
40
41
  }
41
42
  };
43
+ return (0, import_react.useMemo)(() => {
44
+ return style;
45
+ }, [JSON.stringify(style)]);
42
46
  }
43
47
  };
44
48
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createAnimations.tsx"],
4
- "sourcesContent": ["import { AnimationDriver } from '@tamagui/core'\n\nexport function createAnimations<A extends Object>(animations: A): AnimationDriver<A> {\n return {\n avoidClasses: false,\n View: 'div',\n Text: 'span',\n animations,\n useAnimations: (props, { getStyle }) => {\n const animation = animations[props.animation as any]\n if (!animation) {\n throw new Error(`no animation found: ${props.animation}`)\n }\n\n const keys = props.animateOnly ? props.animateOnly.join(' ') : 'all'\n\n return {\n style: {\n transition: `${keys} ${animation}`,\n ...getStyle(),\n },\n }\n },\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,0BAA4C,YAAmC;AACpF,SAAO;AAAA,IACL,cAAc;AAAA,IACd,MAAM;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA,eAAe,CAAC,OAAO,EAAE,eAAe;AACtC,YAAM,YAAY,WAAW,MAAM;AACnC,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,uBAAuB,MAAM,WAAW;AAAA,MAC1D;AAEA,YAAM,OAAO,MAAM,cAAc,MAAM,YAAY,KAAK,GAAG,IAAI;AAE/D,aAAO;AAAA,QACL,OAAO;AAAA,UACL,YAAY,GAAG,QAAQ;AAAA,UACvB,GAAG,SAAS;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { AnimationDriver } from '@tamagui/core'\nimport { useMemo } from 'react'\n\nexport function createAnimations<A extends Object>(animations: A): AnimationDriver<A> {\n return {\n avoidClasses: false,\n View: 'div',\n Text: 'span',\n animations,\n useAnimations: (props, { getStyle }) => {\n const animation = animations[props.animation as any]\n if (!animation) {\n throw new Error(`no animation found: ${props.animation}`)\n }\n\n const keys = props.animateOnly ? props.animateOnly.join(' ') : 'all'\n\n const style = {\n style: {\n transition: `${keys} ${animation}`,\n ...getStyle(),\n },\n }\n\n return useMemo(() => {\n return style\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(style)])\n },\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAwB;AAEjB,0BAA4C,YAAmC;AACpF,SAAO;AAAA,IACL,cAAc;AAAA,IACd,MAAM;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA,eAAe,CAAC,OAAO,EAAE,eAAe;AACtC,YAAM,YAAY,WAAW,MAAM;AACnC,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,uBAAuB,MAAM,WAAW;AAAA,MAC1D;AAEA,YAAM,OAAO,MAAM,cAAc,MAAM,YAAY,KAAK,GAAG,IAAI;AAE/D,YAAM,QAAQ;AAAA,QACZ,OAAO;AAAA,UACL,YAAY,GAAG,QAAQ;AAAA,UACvB,GAAG,SAAS;AAAA,QACd;AAAA,MACF;AAEA,aAAO,0BAAQ,MAAM;AACnB,eAAO;AAAA,MAET,GAAG,CAAC,KAAK,UAAU,KAAK,CAAC,CAAC;AAAA,IAC5B;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
package/dist/cjs/index.js CHANGED
File without changes
File without changes
@@ -1,3 +1,4 @@
1
+ import { useMemo } from "react";
1
2
  function createAnimations(animations) {
2
3
  return {
3
4
  avoidClasses: false,
@@ -10,12 +11,15 @@ function createAnimations(animations) {
10
11
  throw new Error(`no animation found: ${props.animation}`);
11
12
  }
12
13
  const keys = props.animateOnly ? props.animateOnly.join(" ") : "all";
13
- return {
14
+ const style = {
14
15
  style: {
15
16
  transition: `${keys} ${animation}`,
16
17
  ...getStyle()
17
18
  }
18
19
  };
20
+ return useMemo(() => {
21
+ return style;
22
+ }, [JSON.stringify(style)]);
19
23
  }
20
24
  };
21
25
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createAnimations.tsx"],
4
- "sourcesContent": ["import { AnimationDriver } from '@tamagui/core'\n\nexport function createAnimations<A extends Object>(animations: A): AnimationDriver<A> {\n return {\n avoidClasses: false,\n View: 'div',\n Text: 'span',\n animations,\n useAnimations: (props, { getStyle }) => {\n const animation = animations[props.animation as any]\n if (!animation) {\n throw new Error(`no animation found: ${props.animation}`)\n }\n\n const keys = props.animateOnly ? props.animateOnly.join(' ') : 'all'\n\n return {\n style: {\n transition: `${keys} ${animation}`,\n ...getStyle(),\n },\n }\n },\n }\n}\n"],
5
- "mappings": "AAEO,0BAA4C,YAAmC;AACpF,SAAO;AAAA,IACL,cAAc;AAAA,IACd,MAAM;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA,eAAe,CAAC,OAAO,EAAE,eAAe;AACtC,YAAM,YAAY,WAAW,MAAM;AACnC,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,uBAAuB,MAAM,WAAW;AAAA,MAC1D;AAEA,YAAM,OAAO,MAAM,cAAc,MAAM,YAAY,KAAK,GAAG,IAAI;AAE/D,aAAO;AAAA,QACL,OAAO;AAAA,UACL,YAAY,GAAG,QAAQ;AAAA,UACvB,GAAG,SAAS;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { AnimationDriver } from '@tamagui/core'\nimport { useMemo } from 'react'\n\nexport function createAnimations<A extends Object>(animations: A): AnimationDriver<A> {\n return {\n avoidClasses: false,\n View: 'div',\n Text: 'span',\n animations,\n useAnimations: (props, { getStyle }) => {\n const animation = animations[props.animation as any]\n if (!animation) {\n throw new Error(`no animation found: ${props.animation}`)\n }\n\n const keys = props.animateOnly ? props.animateOnly.join(' ') : 'all'\n\n const style = {\n style: {\n transition: `${keys} ${animation}`,\n ...getStyle(),\n },\n }\n\n return useMemo(() => {\n return style\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(style)])\n },\n }\n}\n"],
5
+ "mappings": "AACA;AAEO,0BAA4C,YAAmC;AACpF,SAAO;AAAA,IACL,cAAc;AAAA,IACd,MAAM;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA,eAAe,CAAC,OAAO,EAAE,eAAe;AACtC,YAAM,YAAY,WAAW,MAAM;AACnC,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,uBAAuB,MAAM,WAAW;AAAA,MAC1D;AAEA,YAAM,OAAO,MAAM,cAAc,MAAM,YAAY,KAAK,GAAG,IAAI;AAE/D,YAAM,QAAQ;AAAA,QACZ,OAAO;AAAA,UACL,YAAY,GAAG,QAAQ;AAAA,UACvB,GAAG,SAAS;AAAA,QACd;AAAA,MACF;AAEA,aAAO,QAAQ,MAAM;AACnB,eAAO;AAAA,MAET,GAAG,CAAC,KAAK,UAAU,KAAK,CAAC,CAAC;AAAA,IAC5B;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
File without changes
File without changes
@@ -1,3 +1,4 @@
1
+ import { useMemo } from "react";
1
2
  function createAnimations(animations) {
2
3
  return {
3
4
  avoidClasses: false,
@@ -10,12 +11,15 @@ function createAnimations(animations) {
10
11
  throw new Error(`no animation found: ${props.animation}`);
11
12
  }
12
13
  const keys = props.animateOnly ? props.animateOnly.join(" ") : "all";
13
- return {
14
+ const style = {
14
15
  style: {
15
16
  transition: `${keys} ${animation}`,
16
17
  ...getStyle()
17
18
  }
18
19
  };
20
+ return useMemo(() => {
21
+ return style;
22
+ }, [JSON.stringify(style)]);
19
23
  }
20
24
  };
21
25
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createAnimations.tsx"],
4
- "sourcesContent": ["import { AnimationDriver } from '@tamagui/core'\n\nexport function createAnimations<A extends Object>(animations: A): AnimationDriver<A> {\n return {\n avoidClasses: false,\n View: 'div',\n Text: 'span',\n animations,\n useAnimations: (props, { getStyle }) => {\n const animation = animations[props.animation as any]\n if (!animation) {\n throw new Error(`no animation found: ${props.animation}`)\n }\n\n const keys = props.animateOnly ? props.animateOnly.join(' ') : 'all'\n\n return {\n style: {\n transition: `${keys} ${animation}`,\n ...getStyle(),\n },\n }\n },\n }\n}\n"],
5
- "mappings": "AAEO,0BAA4C,YAAmC;AACpF,SAAO;AAAA,IACL,cAAc;AAAA,IACd,MAAM;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA,eAAe,CAAC,OAAO,EAAE,eAAe;AACtC,YAAM,YAAY,WAAW,MAAM;AACnC,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,uBAAuB,MAAM,WAAW;AAAA,MAC1D;AAEA,YAAM,OAAO,MAAM,cAAc,MAAM,YAAY,KAAK,GAAG,IAAI;AAE/D,aAAO;AAAA,QACL,OAAO;AAAA,UACL,YAAY,GAAG,QAAQ;AAAA,UACvB,GAAG,SAAS;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { AnimationDriver } from '@tamagui/core'\nimport { useMemo } from 'react'\n\nexport function createAnimations<A extends Object>(animations: A): AnimationDriver<A> {\n return {\n avoidClasses: false,\n View: 'div',\n Text: 'span',\n animations,\n useAnimations: (props, { getStyle }) => {\n const animation = animations[props.animation as any]\n if (!animation) {\n throw new Error(`no animation found: ${props.animation}`)\n }\n\n const keys = props.animateOnly ? props.animateOnly.join(' ') : 'all'\n\n const style = {\n style: {\n transition: `${keys} ${animation}`,\n ...getStyle(),\n },\n }\n\n return useMemo(() => {\n return style\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(style)])\n },\n }\n}\n"],
5
+ "mappings": "AACA;AAEO,0BAA4C,YAAmC;AACpF,SAAO;AAAA,IACL,cAAc;AAAA,IACd,MAAM;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA,eAAe,CAAC,OAAO,EAAE,eAAe;AACtC,YAAM,YAAY,WAAW,MAAM;AACnC,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,uBAAuB,MAAM,WAAW;AAAA,MAC1D;AAEA,YAAM,OAAO,MAAM,cAAc,MAAM,YAAY,KAAK,GAAG,IAAI;AAE/D,YAAM,QAAQ;AAAA,QACZ,OAAO;AAAA,UACL,YAAY,GAAG,QAAQ;AAAA,UACvB,GAAG,SAAS;AAAA,QACd;AAAA,MACF;AAEA,aAAO,QAAQ,MAAM;AACnB,eAAO;AAAA,MAET,GAAG,CAAC,KAAK,UAAU,KAAK,CAAC,CAAC;AAAA,IAC5B;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
package/dist/jsx/index.js CHANGED
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/animations-css",
3
- "version": "1.0.1-beta.140",
3
+ "version": "1.0.1-beta.141",
4
4
  "source": "src/index.ts",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -14,10 +14,10 @@
14
14
  "dist"
15
15
  ],
16
16
  "dependencies": {
17
- "@tamagui/core": "^1.0.1-beta.140"
17
+ "@tamagui/core": "^1.0.1-beta.141"
18
18
  },
19
19
  "devDependencies": {
20
- "@tamagui/build": "^1.0.1-beta.140"
20
+ "@tamagui/build": "^1.0.1-beta.141"
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tamagui-build",
@@ -1,4 +1,5 @@
1
1
  import { AnimationDriver } from '@tamagui/core'
2
+ import { useMemo } from 'react'
2
3
 
3
4
  export function createAnimations<A extends Object>(animations: A): AnimationDriver<A> {
4
5
  return {
@@ -14,12 +15,17 @@ export function createAnimations<A extends Object>(animations: A): AnimationDriv
14
15
 
15
16
  const keys = props.animateOnly ? props.animateOnly.join(' ') : 'all'
16
17
 
17
- return {
18
+ const style = {
18
19
  style: {
19
20
  transition: `${keys} ${animation}`,
20
21
  ...getStyle(),
21
22
  },
22
23
  }
24
+
25
+ return useMemo(() => {
26
+ return style
27
+ // eslint-disable-next-line react-hooks/exhaustive-deps
28
+ }, [JSON.stringify(style)])
23
29
  },
24
30
  }
25
31
  }