@shopify/react-native-skia 0.1.176 → 0.1.180

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. package/android/CMakeLists.txt +2 -0
  2. package/cpp/jsi/JsiHostObject.cpp +13 -7
  3. package/cpp/jsi/JsiHostObject.h +3 -1
  4. package/cpp/jsi/RuntimeAwareCache.cpp +9 -0
  5. package/cpp/jsi/RuntimeAwareCache.h +101 -0
  6. package/cpp/jsi/RuntimeLifecycleMonitor.cpp +57 -0
  7. package/cpp/jsi/RuntimeLifecycleMonitor.h +32 -0
  8. package/cpp/rnskia/RNSkManager.cpp +4 -0
  9. package/cpp/rnskia/RNSkView.h +5 -3
  10. package/cpp/rnskia/dom/base/JsiDomNode.h +22 -2
  11. package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +10 -9
  12. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +10 -2
  13. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  14. package/lib/commonjs/external/reanimated/index.d.ts +1 -0
  15. package/lib/commonjs/external/reanimated/index.js +13 -0
  16. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  17. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +8 -0
  18. package/lib/commonjs/external/reanimated/moduleWrapper.js +68 -0
  19. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -0
  20. package/lib/commonjs/external/reanimated/renderHelpers.d.ts +5 -0
  21. package/lib/commonjs/external/reanimated/renderHelpers.js +81 -0
  22. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -0
  23. package/lib/commonjs/external/reanimated/useSharedValueEffect.d.ts +2 -5
  24. package/lib/commonjs/external/reanimated/useSharedValueEffect.js +10 -25
  25. package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +1 -1
  26. package/lib/commonjs/headless/index.d.ts +3 -0
  27. package/lib/commonjs/headless/index.js +57 -0
  28. package/lib/commonjs/headless/index.js.map +1 -0
  29. package/lib/commonjs/mock/index.d.ts +1 -2
  30. package/lib/commonjs/mock/index.js +0 -4
  31. package/lib/commonjs/mock/index.js.map +1 -1
  32. package/lib/commonjs/renderer/Canvas.js +7 -1
  33. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  34. package/lib/commonjs/renderer/Container.d.ts +2 -1
  35. package/lib/commonjs/renderer/Container.js +2 -0
  36. package/lib/commonjs/renderer/Container.js.map +1 -1
  37. package/lib/commonjs/renderer/HostConfig.js +6 -4
  38. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  39. package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
  40. package/lib/commonjs/renderer/Reconciler.js +2 -1
  41. package/lib/commonjs/renderer/Reconciler.js.map +1 -1
  42. package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +4 -1
  43. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  44. package/lib/module/dom/nodes/paint/ImageFilters.js +10 -2
  45. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  46. package/lib/module/external/reanimated/index.d.ts +1 -0
  47. package/lib/module/external/reanimated/index.js +1 -0
  48. package/lib/module/external/reanimated/index.js.map +1 -1
  49. package/lib/module/external/reanimated/moduleWrapper.d.ts +8 -0
  50. package/lib/module/external/reanimated/moduleWrapper.js +50 -0
  51. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -0
  52. package/lib/module/external/reanimated/renderHelpers.d.ts +5 -0
  53. package/lib/module/external/reanimated/renderHelpers.js +72 -0
  54. package/lib/module/external/reanimated/renderHelpers.js.map +1 -0
  55. package/lib/module/external/reanimated/useSharedValueEffect.d.ts +2 -5
  56. package/lib/module/external/reanimated/useSharedValueEffect.js +7 -22
  57. package/lib/module/external/reanimated/useSharedValueEffect.js.map +1 -1
  58. package/lib/module/headless/index.d.ts +3 -0
  59. package/lib/module/headless/index.js +29 -0
  60. package/lib/module/headless/index.js.map +1 -0
  61. package/lib/module/mock/index.d.ts +1 -2
  62. package/lib/module/mock/index.js +0 -3
  63. package/lib/module/mock/index.js.map +1 -1
  64. package/lib/module/renderer/Canvas.js +7 -1
  65. package/lib/module/renderer/Canvas.js.map +1 -1
  66. package/lib/module/renderer/Container.d.ts +2 -1
  67. package/lib/module/renderer/Container.js +2 -0
  68. package/lib/module/renderer/Container.js.map +1 -1
  69. package/lib/module/renderer/HostConfig.js +5 -4
  70. package/lib/module/renderer/HostConfig.js.map +1 -1
  71. package/lib/module/renderer/Reconciler.d.ts +1 -1
  72. package/lib/module/renderer/Reconciler.js +2 -1
  73. package/lib/module/renderer/Reconciler.js.map +1 -1
  74. package/lib/module/renderer/processors/Animations/Animations.d.ts +4 -1
  75. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  76. package/lib/typescript/src/external/reanimated/index.d.ts +1 -0
  77. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +8 -0
  78. package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +5 -0
  79. package/lib/typescript/src/external/reanimated/useSharedValueEffect.d.ts +2 -5
  80. package/lib/typescript/src/headless/index.d.ts +3 -0
  81. package/lib/typescript/src/mock/index.d.ts +1 -2
  82. package/lib/typescript/src/renderer/Container.d.ts +2 -1
  83. package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
  84. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +4 -1
  85. package/package.json +1 -1
  86. package/src/dom/nodes/paint/ImageFilters.ts +8 -2
  87. package/src/external/reanimated/index.ts +1 -0
  88. package/src/external/reanimated/moduleWrapper.ts +60 -0
  89. package/src/external/reanimated/renderHelpers.ts +70 -0
  90. package/src/external/reanimated/useSharedValueEffect.ts +17 -23
  91. package/src/headless/index.ts +31 -0
  92. package/src/mock/index.ts +0 -5
  93. package/src/renderer/Canvas.tsx +6 -2
  94. package/src/renderer/Container.tsx +2 -1
  95. package/src/renderer/HostConfig.ts +8 -2
  96. package/src/renderer/Reconciler.tsx +3 -2
  97. package/src/renderer/processors/Animations/Animations.ts +9 -1
@@ -1,5 +1,9 @@
1
1
  import type { SkiaSelector, SkiaValue } from "../../../values";
2
2
 
3
+ export type SharedValueType<T = number> = {
4
+ value: T;
5
+ };
6
+
3
7
  export const isValue = (value: unknown): value is SkiaValue<unknown> => {
4
8
  if (value === undefined || value === null) {
5
9
  return false;
@@ -44,7 +48,11 @@ export const isAnimated = <T>(props: AnimatedProps<T>) => {
44
48
  };
45
49
 
46
50
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
- export type AnimatedProp<T, P = any> = T | SkiaValue<T> | SkiaSelector<T, P>;
51
+ export type AnimatedProp<T, P = any> =
52
+ | T
53
+ | SkiaValue<T>
54
+ | SkiaSelector<T, P>
55
+ | SharedValueType<T>;
48
56
 
49
57
  export type AnimatedProps<T, O extends keyof T | never = never> = {
50
58
  [K in keyof T]: K extends "children"