@shopify/react-native-skia 0.1.182 → 0.1.183

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. package/lib/commonjs/animation/functions/interpolate.js +10 -1
  2. package/lib/commonjs/animation/functions/interpolate.js.map +1 -1
  3. package/lib/commonjs/animation/functions/interpolateColors.js +6 -0
  4. package/lib/commonjs/animation/functions/interpolateColors.js.map +1 -1
  5. package/lib/commonjs/animation/functions/interpolatePaths.js +4 -0
  6. package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
  7. package/lib/commonjs/animation/functions/interpolateVector.js +13 -5
  8. package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -1
  9. package/lib/commonjs/external/reanimated/useSharedValueEffect.js +5 -2
  10. package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +1 -1
  11. package/lib/commonjs/renderer/processors/math/Coordinates.js +42 -18
  12. package/lib/commonjs/renderer/processors/math/Coordinates.js.map +1 -1
  13. package/lib/commonjs/renderer/processors/math/Math.js +10 -2
  14. package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
  15. package/lib/commonjs/renderer/processors/math/Transforms.js +2 -0
  16. package/lib/commonjs/renderer/processors/math/Transforms.js.map +1 -1
  17. package/lib/commonjs/renderer/typeddash.js +2 -0
  18. package/lib/commonjs/renderer/typeddash.js.map +1 -1
  19. package/lib/commonjs/skia/core/Vector.js +24 -4
  20. package/lib/commonjs/skia/core/Vector.js.map +1 -1
  21. package/lib/module/animation/functions/interpolate.js +10 -1
  22. package/lib/module/animation/functions/interpolate.js.map +1 -1
  23. package/lib/module/animation/functions/interpolateColors.js +6 -0
  24. package/lib/module/animation/functions/interpolateColors.js.map +1 -1
  25. package/lib/module/animation/functions/interpolatePaths.js +4 -0
  26. package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
  27. package/lib/module/animation/functions/interpolateVector.js +13 -5
  28. package/lib/module/animation/functions/interpolateVector.js.map +1 -1
  29. package/lib/module/external/reanimated/useSharedValueEffect.js +6 -3
  30. package/lib/module/external/reanimated/useSharedValueEffect.js.map +1 -1
  31. package/lib/module/renderer/processors/math/Coordinates.js +42 -18
  32. package/lib/module/renderer/processors/math/Coordinates.js.map +1 -1
  33. package/lib/module/renderer/processors/math/Math.js +10 -2
  34. package/lib/module/renderer/processors/math/Math.js.map +1 -1
  35. package/lib/module/renderer/processors/math/Transforms.js +2 -0
  36. package/lib/module/renderer/processors/math/Transforms.js.map +1 -1
  37. package/lib/module/renderer/typeddash.js +2 -0
  38. package/lib/module/renderer/typeddash.js.map +1 -1
  39. package/lib/module/skia/core/Vector.js +24 -4
  40. package/lib/module/skia/core/Vector.js.map +1 -1
  41. package/package.json +1 -1
  42. package/react-native-skia.podspec +2 -6
  43. package/src/animation/functions/interpolate.ts +5 -0
  44. package/src/animation/functions/interpolateColors.ts +3 -0
  45. package/src/animation/functions/interpolatePaths.ts +2 -0
  46. package/src/animation/functions/interpolateVector.ts +21 -16
  47. package/src/external/reanimated/useSharedValueEffect.ts +7 -4
  48. package/src/renderer/processors/math/Coordinates.ts +36 -20
  49. package/src/renderer/processors/math/Math.ts +12 -4
  50. package/src/renderer/processors/math/Transforms.ts +1 -0
  51. package/src/renderer/typeddash.ts +1 -0
  52. package/src/skia/core/Vector.ts +24 -7
@@ -2,6 +2,7 @@ export const mapKeys = <T extends object>(obj: T) =>
2
2
  Object.keys(obj) as (keyof T)[];
3
3
 
4
4
  export const exhaustiveCheck = (a: never): never => {
5
+ "worklet";
5
6
  throw new Error(`Unexhaustive handling for ${a}`);
6
7
  };
7
8
 
@@ -1,11 +1,28 @@
1
1
  import { Skia } from "../Skia";
2
2
  import type { Vector } from "../types";
3
3
 
4
- export const vec = (x = 0, y?: number) => Skia.Point(x, y ?? x);
4
+ export const vec = (x = 0, y?: number) => {
5
+ "worklet";
6
+ return Skia.Point(x, y ?? x);
7
+ };
5
8
  export const point = vec;
6
- export const neg = (a: Vector) => vec(-a.x, -a.y);
7
- export const add = (a: Vector, b: Vector) => vec(a.x + b.x, a.y + b.y);
8
- export const sub = (a: Vector, b: Vector) => vec(a.x - b.x, a.y - b.y);
9
- export const dist = (a: Vector, b: Vector) => Math.hypot(a.x - b.x, a.y - b.y);
10
- export const translate = ({ x, y }: Vector) =>
11
- [{ translateX: x }, { translateY: y }] as const;
9
+ export const neg = (a: Vector) => {
10
+ "worklet";
11
+ return vec(-a.x, -a.y);
12
+ };
13
+ export const add = (a: Vector, b: Vector) => {
14
+ "worklet";
15
+ return vec(a.x + b.x, a.y + b.y);
16
+ };
17
+ export const sub = (a: Vector, b: Vector) => {
18
+ "worklet";
19
+ return vec(a.x - b.x, a.y - b.y);
20
+ };
21
+ export const dist = (a: Vector, b: Vector) => {
22
+ "worklet";
23
+ return Math.hypot(a.x - b.x, a.y - b.y);
24
+ };
25
+ export const translate = ({ x, y }: Vector) => {
26
+ "worklet";
27
+ return [{ translateX: x }, { translateY: y }] as const;
28
+ };