@shopify/react-native-skia 1.2.1 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp +34 -14
  2. package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h +2 -1
  3. package/android/src/main/java/com/shopify/reactnative/skia/ViewScreenshotService.java +13 -8
  4. package/cpp/api/JsiSkImageFactory.h +3 -3
  5. package/cpp/rnskia/RNSkPlatformContext.h +3 -3
  6. package/ios/RNSkia-iOS/RNSkiOSPlatformContext.mm +2 -6
  7. package/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.h +42 -7
  8. package/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.mm +178 -5
  9. package/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm +10 -13
  10. package/lib/commonjs/external/ModuleProxy.d.ts +10 -0
  11. package/lib/commonjs/external/ModuleProxy.js +36 -0
  12. package/lib/commonjs/external/ModuleProxy.js.map +1 -0
  13. package/lib/commonjs/external/reanimated/ReanimatedProxy.d.ts +3 -0
  14. package/lib/commonjs/external/reanimated/ReanimatedProxy.js +18 -0
  15. package/lib/commonjs/external/reanimated/ReanimatedProxy.js.map +1 -0
  16. package/lib/commonjs/external/reanimated/buffers.js +9 -6
  17. package/lib/commonjs/external/reanimated/buffers.js.map +1 -1
  18. package/lib/commonjs/external/reanimated/interpolators.js +8 -7
  19. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  20. package/lib/commonjs/external/reanimated/renderHelpers.js +27 -11
  21. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  22. package/lib/commonjs/external/reanimated/textures.js +4 -3
  23. package/lib/commonjs/external/reanimated/textures.js.map +1 -1
  24. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +6 -6
  25. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
  26. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js +6 -5
  27. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js.map +1 -1
  28. package/lib/commonjs/renderer/Offscreen.js +1 -5
  29. package/lib/commonjs/renderer/Offscreen.js.map +1 -1
  30. package/lib/commonjs/skia/types/Image/ImageFactory.d.ts +3 -3
  31. package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
  32. package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.d.ts +3 -3
  33. package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.js.map +1 -1
  34. package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.d.ts +1 -1
  35. package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.js +1 -1
  36. package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.js.map +1 -1
  37. package/lib/commonjs/specs/NativeSkiaModule.web.d.ts +0 -2
  38. package/lib/commonjs/specs/NativeSkiaModule.web.js +0 -8
  39. package/lib/commonjs/specs/NativeSkiaModule.web.js.map +1 -1
  40. package/lib/module/external/ModuleProxy.d.ts +10 -0
  41. package/lib/module/external/ModuleProxy.js +28 -0
  42. package/lib/module/external/ModuleProxy.js.map +1 -0
  43. package/lib/module/external/reanimated/ReanimatedProxy.d.ts +3 -0
  44. package/lib/module/external/reanimated/ReanimatedProxy.js +12 -0
  45. package/lib/module/external/reanimated/ReanimatedProxy.js.map +1 -0
  46. package/lib/module/external/reanimated/buffers.js +8 -6
  47. package/lib/module/external/reanimated/buffers.js.map +1 -1
  48. package/lib/module/external/reanimated/interpolators.js +7 -7
  49. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  50. package/lib/module/external/reanimated/renderHelpers.js +26 -11
  51. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  52. package/lib/module/external/reanimated/textures.js +3 -3
  53. package/lib/module/external/reanimated/textures.js.map +1 -1
  54. package/lib/module/external/reanimated/useAnimatedImageValue.js +5 -6
  55. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
  56. package/lib/module/external/reanimated/useDerivedValueOnJS.js +5 -5
  57. package/lib/module/external/reanimated/useDerivedValueOnJS.js.map +1 -1
  58. package/lib/module/renderer/Offscreen.js +1 -5
  59. package/lib/module/renderer/Offscreen.js.map +1 -1
  60. package/lib/module/skia/types/Image/ImageFactory.d.ts +3 -3
  61. package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
  62. package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.d.ts +3 -3
  63. package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.js.map +1 -1
  64. package/lib/module/skia/web/JsiSkNativeBufferFactory.d.ts +1 -1
  65. package/lib/module/skia/web/JsiSkNativeBufferFactory.js +1 -1
  66. package/lib/module/skia/web/JsiSkNativeBufferFactory.js.map +1 -1
  67. package/lib/module/specs/NativeSkiaModule.web.d.ts +0 -2
  68. package/lib/module/specs/NativeSkiaModule.web.js +0 -3
  69. package/lib/module/specs/NativeSkiaModule.web.js.map +1 -1
  70. package/lib/typescript/src/external/ModuleProxy.d.ts +10 -0
  71. package/lib/typescript/src/external/reanimated/ReanimatedProxy.d.ts +3 -0
  72. package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +3 -3
  73. package/lib/typescript/src/skia/types/NativeBuffer/NativeBufferFactory.d.ts +3 -3
  74. package/lib/typescript/src/skia/web/JsiSkNativeBufferFactory.d.ts +1 -1
  75. package/lib/typescript/src/specs/NativeSkiaModule.web.d.ts +0 -2
  76. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  77. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  78. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  79. package/libs/ios/libskottie.xcframework/Info.plist +5 -5
  80. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  81. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  82. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  83. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  84. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  85. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  86. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  87. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  88. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  89. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  90. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  91. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  92. package/package.json +1 -1
  93. package/src/external/ModuleProxy.ts +30 -0
  94. package/src/external/reanimated/ReanimatedProxy.ts +18 -0
  95. package/src/external/reanimated/buffers.ts +7 -6
  96. package/src/external/reanimated/interpolators.ts +7 -12
  97. package/src/external/reanimated/renderHelpers.ts +31 -18
  98. package/src/external/reanimated/textures.tsx +3 -3
  99. package/src/external/reanimated/useAnimatedImageValue.ts +5 -10
  100. package/src/external/reanimated/useDerivedValueOnJS.ts +5 -10
  101. package/src/renderer/Offscreen.tsx +1 -7
  102. package/src/skia/types/Image/ImageFactory.ts +3 -3
  103. package/src/skia/types/NativeBuffer/NativeBufferFactory.ts +3 -3
  104. package/src/skia/web/JsiSkNativeBufferFactory.ts +1 -1
  105. package/src/specs/NativeSkiaModule.web.ts +0 -4
  106. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDrawViewManagerDelegate.java +0 -34
  107. package/cpp/skia/include/gpu/GrBackendDrawableInfo.h +0 -9
  108. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +0 -15
  109. package/lib/commonjs/external/reanimated/moduleWrapper.js +0 -46
  110. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +0 -1
  111. package/lib/module/external/reanimated/moduleWrapper.d.ts +0 -15
  112. package/lib/module/external/reanimated/moduleWrapper.js +0 -37
  113. package/lib/module/external/reanimated/moduleWrapper.js.map +0 -1
  114. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +0 -15
  115. package/src/external/reanimated/moduleWrapper.ts +0 -83
@@ -1,34 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GeneratePropsJavaDelegate.js
8
- */
9
-
10
- package com.facebook.react.viewmanagers;
11
-
12
- import android.view.View;
13
- import androidx.annotation.Nullable;
14
- import com.facebook.react.uimanager.BaseViewManagerDelegate;
15
- import com.facebook.react.uimanager.BaseViewManagerInterface;
16
-
17
- public class SkiaDrawViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & SkiaDrawViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
18
- public SkiaDrawViewManagerDelegate(U viewManager) {
19
- super(viewManager);
20
- }
21
- @Override
22
- public void setProperty(T view, String propName, @Nullable Object value) {
23
- switch (propName) {
24
- case "mode":
25
- mViewManager.setMode(view, value == null ? null : (String) value);
26
- break;
27
- case "debug":
28
- mViewManager.setDebug(view, value == null ? false : (boolean) value);
29
- break;
30
- default:
31
- super.setProperty(view, propName, value);
32
- }
33
- }
34
- }
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright 2018 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- // TODO(kjlubick) delete after Chrome (and Android?) are migrated.
9
- #include "include/gpu/ganesh/vk/GrBackendDrawableInfo.h"
@@ -1,15 +0,0 @@
1
- import type { DependencyList } from "react";
2
- import type { DerivedValue, FrameCallback, FrameInfo, SharedValue } from "react-native-reanimated";
3
- export declare const HAS_REANIMATED2: boolean;
4
- export declare const HAS_REANIMATED3: boolean;
5
- export declare function throwOnMissingReanimated(): void;
6
- export declare const useSharedValue: <T>(init: T, oneWayReadsOnly?: boolean) => SharedValue<T>;
7
- export declare const useDerivedValue: <T>(processor: () => T, dependencies?: DependencyList) => DerivedValue<T>;
8
- export declare const useFrameCallback: (callback: (frameInfo: FrameInfo) => void, autostart?: boolean) => FrameCallback;
9
- export declare const startMapper: (worklet: () => void, inputs?: unknown[], outputs?: unknown[]) => number;
10
- export declare const stopMapper: (mapperID: number) => void;
11
- export declare const runOnJS: any;
12
- export declare const runOnUI: any;
13
- export declare const makeMutable: <T>(val: T) => SharedValue<T>;
14
- export declare const useAnimatedReaction: <T>(prepare: () => T, react: (v: T) => void, dependencies?: DependencyList) => void;
15
- export declare const isSharedValue: <T>(value: unknown) => value is SharedValue<T>;
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.stopMapper = exports.startMapper = exports.runOnUI = exports.runOnJS = exports.makeMutable = exports.isSharedValue = exports.HAS_REANIMATED3 = exports.HAS_REANIMATED2 = void 0;
7
- exports.throwOnMissingReanimated = throwOnMissingReanimated;
8
- exports.useSharedValue = exports.useFrameCallback = exports.useDerivedValue = exports.useAnimatedReaction = void 0;
9
- var _Reanimated, _Reanimated2, _Reanimated3, _Reanimated4, _Reanimated5, _Reanimated6, _Reanimated7, _Reanimated8, _Reanimated9;
10
- /* eslint-disable @typescript-eslint/no-explicit-any */
11
-
12
- // This one is needed for the deprecated useSharedValue function
13
- // We can remove it once we remove the deprecation
14
-
15
- let Reanimated2;
16
- let Reanimated3;
17
- let reanimatedVersion;
18
- try {
19
- Reanimated2 = require("react-native-reanimated");
20
- reanimatedVersion = require("react-native-reanimated/package.json").version;
21
- if (reanimatedVersion && (reanimatedVersion >= "3.0.0" || reanimatedVersion.includes("3.0.0-"))) {
22
- Reanimated3 = Reanimated2;
23
- }
24
- } catch (e) {}
25
- const HAS_REANIMATED2 = exports.HAS_REANIMATED2 = !!Reanimated2;
26
- const HAS_REANIMATED3 = exports.HAS_REANIMATED3 = !!Reanimated3;
27
- function throwOnMissingReanimated() {
28
- if (!HAS_REANIMATED2) {
29
- throw new Error("Reanimated was not found, make sure react-native-reanimated package is installed if you want to use \
30
- react-native-skia's integration layer API.");
31
- }
32
- }
33
- const useSharedValue = exports.useSharedValue = ((_Reanimated = Reanimated2) === null || _Reanimated === void 0 ? void 0 : _Reanimated.useSharedValue) || throwOnMissingReanimated;
34
- const useDerivedValue = exports.useDerivedValue = ((_Reanimated2 = Reanimated2) === null || _Reanimated2 === void 0 ? void 0 : _Reanimated2.useDerivedValue) || throwOnMissingReanimated;
35
- const useFrameCallback = exports.useFrameCallback = ((_Reanimated3 = Reanimated2) === null || _Reanimated3 === void 0 ? void 0 : _Reanimated3.useFrameCallback) || throwOnMissingReanimated;
36
- const startMapper = exports.startMapper = ((_Reanimated4 = Reanimated2) === null || _Reanimated4 === void 0 ? void 0 : _Reanimated4.startMapper) || throwOnMissingReanimated;
37
- const stopMapper = exports.stopMapper = ((_Reanimated5 = Reanimated2) === null || _Reanimated5 === void 0 ? void 0 : _Reanimated5.stopMapper) || throwOnMissingReanimated;
38
- const runOnJS = exports.runOnJS = ((_Reanimated6 = Reanimated2) === null || _Reanimated6 === void 0 ? void 0 : _Reanimated6.runOnJS) || throwOnMissingReanimated;
39
- const runOnUI = exports.runOnUI = ((_Reanimated7 = Reanimated2) === null || _Reanimated7 === void 0 ? void 0 : _Reanimated7.runOnUI) || throwOnMissingReanimated;
40
- const makeMutable = exports.makeMutable = ((_Reanimated8 = Reanimated2) === null || _Reanimated8 === void 0 ? void 0 : _Reanimated8.makeMutable) || throwOnMissingReanimated;
41
- const useAnimatedReaction = exports.useAnimatedReaction = ((_Reanimated9 = Reanimated2) === null || _Reanimated9 === void 0 ? void 0 : _Reanimated9.useAnimatedReaction) || throwOnMissingReanimated;
42
- const isSharedValue = value => {
43
- return !!value && (Reanimated3 ? Reanimated3.isSharedValue(value) : value.value !== undefined);
44
- };
45
- exports.isSharedValue = isSharedValue;
46
- //# sourceMappingURL=moduleWrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Reanimated2","Reanimated3","reanimatedVersion","require","version","includes","e","HAS_REANIMATED2","exports","HAS_REANIMATED3","throwOnMissingReanimated","Error","useSharedValue","_Reanimated","useDerivedValue","_Reanimated2","useFrameCallback","_Reanimated3","startMapper","_Reanimated4","stopMapper","_Reanimated5","runOnJS","_Reanimated6","runOnUI","_Reanimated7","makeMutable","_Reanimated8","useAnimatedReaction","_Reanimated9","isSharedValue","value","undefined"],"sources":["moduleWrapper.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { DependencyList } from \"react\";\nimport type {\n DerivedValue,\n FrameCallback,\n FrameInfo,\n SharedValue,\n} from \"react-native-reanimated\";\n\n// This one is needed for the deprecated useSharedValue function\n// We can remove it once we remove the deprecation\n\nlet Reanimated2: any;\n\nlet Reanimated3: any;\nlet reanimatedVersion: string;\n\ntry {\n Reanimated2 = require(\"react-native-reanimated\");\n reanimatedVersion = require(\"react-native-reanimated/package.json\").version;\n if (\n reanimatedVersion &&\n (reanimatedVersion >= \"3.0.0\" || reanimatedVersion.includes(\"3.0.0-\"))\n ) {\n Reanimated3 = Reanimated2;\n }\n} catch (e) {}\n\nexport const HAS_REANIMATED2 = !!Reanimated2;\nexport const HAS_REANIMATED3 = !!Reanimated3;\n\nexport function throwOnMissingReanimated() {\n if (!HAS_REANIMATED2) {\n throw new Error(\n \"Reanimated was not found, make sure react-native-reanimated package is installed if you want to use \\\n react-native-skia's integration layer API.\"\n );\n }\n}\n\nexport const useSharedValue: <T>(\n init: T,\n oneWayReadsOnly?: boolean\n) => SharedValue<T> = Reanimated2?.useSharedValue || throwOnMissingReanimated;\n\nexport const useDerivedValue: <T>(\n processor: () => T,\n dependencies?: DependencyList\n) => DerivedValue<T> = Reanimated2?.useDerivedValue || throwOnMissingReanimated;\n\nexport const useFrameCallback: (\n callback: (frameInfo: FrameInfo) => void,\n autostart?: boolean\n) => FrameCallback = Reanimated2?.useFrameCallback || throwOnMissingReanimated;\n\nexport const startMapper: (\n worklet: () => void,\n inputs?: unknown[],\n outputs?: unknown[]\n) => number = Reanimated2?.startMapper || throwOnMissingReanimated;\n\nexport const stopMapper: (mapperID: number) => void =\n Reanimated2?.stopMapper || throwOnMissingReanimated;\n\nexport const runOnJS = Reanimated2?.runOnJS || throwOnMissingReanimated;\nexport const runOnUI = Reanimated2?.runOnUI || throwOnMissingReanimated;\nexport const makeMutable: <T>(val: T) => SharedValue<T> =\n Reanimated2?.makeMutable || throwOnMissingReanimated;\n\nexport const useAnimatedReaction: <T>(\n prepare: () => T,\n react: (v: T) => void,\n dependencies?: DependencyList\n) => void = Reanimated2?.useAnimatedReaction || throwOnMissingReanimated;\n\nexport const isSharedValue = <T>(value: unknown): value is SharedValue<T> => {\n return (\n !!value &&\n (Reanimated3\n ? Reanimated3.isSharedValue(value)\n : (value as any).value !== undefined)\n );\n};\n"],"mappings":";;;;;;;;;AAAA;;AASA;AACA;;AAEA,IAAIA,WAAgB;AAEpB,IAAIC,WAAgB;AACpB,IAAIC,iBAAyB;AAE7B,IAAI;EACFF,WAAW,GAAGG,OAAO,CAAC,yBAAyB,CAAC;EAChDD,iBAAiB,GAAGC,OAAO,CAAC,sCAAsC,CAAC,CAACC,OAAO;EAC3E,IACEF,iBAAiB,KAChBA,iBAAiB,IAAI,OAAO,IAAIA,iBAAiB,CAACG,QAAQ,CAAC,QAAQ,CAAC,CAAC,EACtE;IACAJ,WAAW,GAAGD,WAAW;EAC3B;AACF,CAAC,CAAC,OAAOM,CAAC,EAAE,CAAC;AAEN,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,CAAC,CAACP,WAAW;AACrC,MAAMS,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAG,CAAC,CAACR,WAAW;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wB;AAE/C,MAAMkB,mBAIJ,GAAApB,OAAA,CAAAoB,mBAAA,GAAG,EAAAC,YAAA,GAAA7B,WAAW,cAAA6B,YAAA,uBAAXA,YAAA,CAAaD,mBAAmB,KAAIlB,wBAAwB;AAEjE,MAAMoB,aAAa,GAAOC,KAAc,IAA8B;EAC3E,OACE,CAAC,CAACA,KAAK,KACN9B,WAAW,GACRA,WAAW,CAAC6B,aAAa,CAACC,KAAK,CAAC,GAC/BA,KAAK,CAASA,KAAK,KAAKC,SAAS,CAAC;AAE3C,CAAC;AAACxB,OAAA,CAAAsB,aAAA,GAAAA,aAAA"}
@@ -1,15 +0,0 @@
1
- import type { DependencyList } from "react";
2
- import type { DerivedValue, FrameCallback, FrameInfo, SharedValue } from "react-native-reanimated";
3
- export declare const HAS_REANIMATED2: boolean;
4
- export declare const HAS_REANIMATED3: boolean;
5
- export declare function throwOnMissingReanimated(): void;
6
- export declare const useSharedValue: <T>(init: T, oneWayReadsOnly?: boolean) => SharedValue<T>;
7
- export declare const useDerivedValue: <T>(processor: () => T, dependencies?: DependencyList) => DerivedValue<T>;
8
- export declare const useFrameCallback: (callback: (frameInfo: FrameInfo) => void, autostart?: boolean) => FrameCallback;
9
- export declare const startMapper: (worklet: () => void, inputs?: unknown[], outputs?: unknown[]) => number;
10
- export declare const stopMapper: (mapperID: number) => void;
11
- export declare const runOnJS: any;
12
- export declare const runOnUI: any;
13
- export declare const makeMutable: <T>(val: T) => SharedValue<T>;
14
- export declare const useAnimatedReaction: <T>(prepare: () => T, react: (v: T) => void, dependencies?: DependencyList) => void;
15
- export declare const isSharedValue: <T>(value: unknown) => value is SharedValue<T>;
@@ -1,37 +0,0 @@
1
- var _Reanimated, _Reanimated2, _Reanimated3, _Reanimated4, _Reanimated5, _Reanimated6, _Reanimated7, _Reanimated8, _Reanimated9;
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
-
4
- // This one is needed for the deprecated useSharedValue function
5
- // We can remove it once we remove the deprecation
6
-
7
- let Reanimated2;
8
- let Reanimated3;
9
- let reanimatedVersion;
10
- try {
11
- Reanimated2 = require("react-native-reanimated");
12
- reanimatedVersion = require("react-native-reanimated/package.json").version;
13
- if (reanimatedVersion && (reanimatedVersion >= "3.0.0" || reanimatedVersion.includes("3.0.0-"))) {
14
- Reanimated3 = Reanimated2;
15
- }
16
- } catch (e) {}
17
- export const HAS_REANIMATED2 = !!Reanimated2;
18
- export const HAS_REANIMATED3 = !!Reanimated3;
19
- export function throwOnMissingReanimated() {
20
- if (!HAS_REANIMATED2) {
21
- throw new Error("Reanimated was not found, make sure react-native-reanimated package is installed if you want to use \
22
- react-native-skia's integration layer API.");
23
- }
24
- }
25
- export const useSharedValue = ((_Reanimated = Reanimated2) === null || _Reanimated === void 0 ? void 0 : _Reanimated.useSharedValue) || throwOnMissingReanimated;
26
- export const useDerivedValue = ((_Reanimated2 = Reanimated2) === null || _Reanimated2 === void 0 ? void 0 : _Reanimated2.useDerivedValue) || throwOnMissingReanimated;
27
- export const useFrameCallback = ((_Reanimated3 = Reanimated2) === null || _Reanimated3 === void 0 ? void 0 : _Reanimated3.useFrameCallback) || throwOnMissingReanimated;
28
- export const startMapper = ((_Reanimated4 = Reanimated2) === null || _Reanimated4 === void 0 ? void 0 : _Reanimated4.startMapper) || throwOnMissingReanimated;
29
- export const stopMapper = ((_Reanimated5 = Reanimated2) === null || _Reanimated5 === void 0 ? void 0 : _Reanimated5.stopMapper) || throwOnMissingReanimated;
30
- export const runOnJS = ((_Reanimated6 = Reanimated2) === null || _Reanimated6 === void 0 ? void 0 : _Reanimated6.runOnJS) || throwOnMissingReanimated;
31
- export const runOnUI = ((_Reanimated7 = Reanimated2) === null || _Reanimated7 === void 0 ? void 0 : _Reanimated7.runOnUI) || throwOnMissingReanimated;
32
- export const makeMutable = ((_Reanimated8 = Reanimated2) === null || _Reanimated8 === void 0 ? void 0 : _Reanimated8.makeMutable) || throwOnMissingReanimated;
33
- export const useAnimatedReaction = ((_Reanimated9 = Reanimated2) === null || _Reanimated9 === void 0 ? void 0 : _Reanimated9.useAnimatedReaction) || throwOnMissingReanimated;
34
- export const isSharedValue = value => {
35
- return !!value && (Reanimated3 ? Reanimated3.isSharedValue(value) : value.value !== undefined);
36
- };
37
- //# sourceMappingURL=moduleWrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Reanimated2","Reanimated3","reanimatedVersion","require","version","includes","e","HAS_REANIMATED2","HAS_REANIMATED3","throwOnMissingReanimated","Error","useSharedValue","_Reanimated","useDerivedValue","_Reanimated2","useFrameCallback","_Reanimated3","startMapper","_Reanimated4","stopMapper","_Reanimated5","runOnJS","_Reanimated6","runOnUI","_Reanimated7","makeMutable","_Reanimated8","useAnimatedReaction","_Reanimated9","isSharedValue","value","undefined"],"sources":["moduleWrapper.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { DependencyList } from \"react\";\nimport type {\n DerivedValue,\n FrameCallback,\n FrameInfo,\n SharedValue,\n} from \"react-native-reanimated\";\n\n// This one is needed for the deprecated useSharedValue function\n// We can remove it once we remove the deprecation\n\nlet Reanimated2: any;\n\nlet Reanimated3: any;\nlet reanimatedVersion: string;\n\ntry {\n Reanimated2 = require(\"react-native-reanimated\");\n reanimatedVersion = require(\"react-native-reanimated/package.json\").version;\n if (\n reanimatedVersion &&\n (reanimatedVersion >= \"3.0.0\" || reanimatedVersion.includes(\"3.0.0-\"))\n ) {\n Reanimated3 = Reanimated2;\n }\n} catch (e) {}\n\nexport const HAS_REANIMATED2 = !!Reanimated2;\nexport const HAS_REANIMATED3 = !!Reanimated3;\n\nexport function throwOnMissingReanimated() {\n if (!HAS_REANIMATED2) {\n throw new Error(\n \"Reanimated was not found, make sure react-native-reanimated package is installed if you want to use \\\n react-native-skia's integration layer API.\"\n );\n }\n}\n\nexport const useSharedValue: <T>(\n init: T,\n oneWayReadsOnly?: boolean\n) => SharedValue<T> = Reanimated2?.useSharedValue || throwOnMissingReanimated;\n\nexport const useDerivedValue: <T>(\n processor: () => T,\n dependencies?: DependencyList\n) => DerivedValue<T> = Reanimated2?.useDerivedValue || throwOnMissingReanimated;\n\nexport const useFrameCallback: (\n callback: (frameInfo: FrameInfo) => void,\n autostart?: boolean\n) => FrameCallback = Reanimated2?.useFrameCallback || throwOnMissingReanimated;\n\nexport const startMapper: (\n worklet: () => void,\n inputs?: unknown[],\n outputs?: unknown[]\n) => number = Reanimated2?.startMapper || throwOnMissingReanimated;\n\nexport const stopMapper: (mapperID: number) => void =\n Reanimated2?.stopMapper || throwOnMissingReanimated;\n\nexport const runOnJS = Reanimated2?.runOnJS || throwOnMissingReanimated;\nexport const runOnUI = Reanimated2?.runOnUI || throwOnMissingReanimated;\nexport const makeMutable: <T>(val: T) => SharedValue<T> =\n Reanimated2?.makeMutable || throwOnMissingReanimated;\n\nexport const useAnimatedReaction: <T>(\n prepare: () => T,\n react: (v: T) => void,\n dependencies?: DependencyList\n) => void = Reanimated2?.useAnimatedReaction || throwOnMissingReanimated;\n\nexport const isSharedValue = <T>(value: unknown): value is SharedValue<T> => {\n return (\n !!value &&\n (Reanimated3\n ? Reanimated3.isSharedValue(value)\n : (value as any).value !== undefined)\n );\n};\n"],"mappings":";AAAA;;AASA;AACA;;AAEA,IAAIA,WAAgB;AAEpB,IAAIC,WAAgB;AACpB,IAAIC,iBAAyB;AAE7B,IAAI;EACFF,WAAW,GAAGG,OAAO,CAAC,yBAAyB,CAAC;EAChDD,iBAAiB,GAAGC,OAAO,CAAC,sCAAsC,CAAC,CAACC,OAAO;EAC3E,IACEF,iBAAiB,KAChBA,iBAAiB,IAAI,OAAO,IAAIA,iBAAiB,CAACG,QAAQ,CAAC,QAAQ,CAAC,CAAC,EACtE;IACAJ,WAAW,GAAGD,WAAW;EAC3B;AACF,CAAC,CAAC,OAAOM,CAAC,EAAE,CAAC;AAEb,OAAO,MAAMC,eAAe,GAAG,CAAC,CAACP,WAAW;AAC5C,OAAO,MAAMQ,eAAe,GAAG,CAAC,CAACP,WAAW;AAE5C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AA8B;EAC3E,OACE,CAAC,CAACA,KAAK,KACN7B,WAAW,GACRA,WAAW,CAAC4B,aAAa,CAACC,KAAK,CAAC,GAC/BA,KAAK,CAASA,KAAK,KAAKC,SAAS,CAAC;AAE3C,CAAC"}
@@ -1,15 +0,0 @@
1
- import type { DependencyList } from "react";
2
- import type { DerivedValue, FrameCallback, FrameInfo, SharedValue } from "react-native-reanimated";
3
- export declare const HAS_REANIMATED2: boolean;
4
- export declare const HAS_REANIMATED3: boolean;
5
- export declare function throwOnMissingReanimated(): void;
6
- export declare const useSharedValue: <T>(init: T, oneWayReadsOnly?: boolean) => SharedValue<T>;
7
- export declare const useDerivedValue: <T>(processor: () => T, dependencies?: DependencyList) => DerivedValue<T>;
8
- export declare const useFrameCallback: (callback: (frameInfo: FrameInfo) => void, autostart?: boolean) => FrameCallback;
9
- export declare const startMapper: (worklet: () => void, inputs?: unknown[], outputs?: unknown[]) => number;
10
- export declare const stopMapper: (mapperID: number) => void;
11
- export declare const runOnJS: any;
12
- export declare const runOnUI: any;
13
- export declare const makeMutable: <T>(val: T) => SharedValue<T>;
14
- export declare const useAnimatedReaction: <T>(prepare: () => T, react: (v: T) => void, dependencies?: DependencyList) => void;
15
- export declare const isSharedValue: <T>(value: unknown) => value is SharedValue<T>;
@@ -1,83 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import type { DependencyList } from "react";
3
- import type {
4
- DerivedValue,
5
- FrameCallback,
6
- FrameInfo,
7
- SharedValue,
8
- } from "react-native-reanimated";
9
-
10
- // This one is needed for the deprecated useSharedValue function
11
- // We can remove it once we remove the deprecation
12
-
13
- let Reanimated2: any;
14
-
15
- let Reanimated3: any;
16
- let reanimatedVersion: string;
17
-
18
- try {
19
- Reanimated2 = require("react-native-reanimated");
20
- reanimatedVersion = require("react-native-reanimated/package.json").version;
21
- if (
22
- reanimatedVersion &&
23
- (reanimatedVersion >= "3.0.0" || reanimatedVersion.includes("3.0.0-"))
24
- ) {
25
- Reanimated3 = Reanimated2;
26
- }
27
- } catch (e) {}
28
-
29
- export const HAS_REANIMATED2 = !!Reanimated2;
30
- export const HAS_REANIMATED3 = !!Reanimated3;
31
-
32
- export function throwOnMissingReanimated() {
33
- if (!HAS_REANIMATED2) {
34
- throw new Error(
35
- "Reanimated was not found, make sure react-native-reanimated package is installed if you want to use \
36
- react-native-skia's integration layer API."
37
- );
38
- }
39
- }
40
-
41
- export const useSharedValue: <T>(
42
- init: T,
43
- oneWayReadsOnly?: boolean
44
- ) => SharedValue<T> = Reanimated2?.useSharedValue || throwOnMissingReanimated;
45
-
46
- export const useDerivedValue: <T>(
47
- processor: () => T,
48
- dependencies?: DependencyList
49
- ) => DerivedValue<T> = Reanimated2?.useDerivedValue || throwOnMissingReanimated;
50
-
51
- export const useFrameCallback: (
52
- callback: (frameInfo: FrameInfo) => void,
53
- autostart?: boolean
54
- ) => FrameCallback = Reanimated2?.useFrameCallback || throwOnMissingReanimated;
55
-
56
- export const startMapper: (
57
- worklet: () => void,
58
- inputs?: unknown[],
59
- outputs?: unknown[]
60
- ) => number = Reanimated2?.startMapper || throwOnMissingReanimated;
61
-
62
- export const stopMapper: (mapperID: number) => void =
63
- Reanimated2?.stopMapper || throwOnMissingReanimated;
64
-
65
- export const runOnJS = Reanimated2?.runOnJS || throwOnMissingReanimated;
66
- export const runOnUI = Reanimated2?.runOnUI || throwOnMissingReanimated;
67
- export const makeMutable: <T>(val: T) => SharedValue<T> =
68
- Reanimated2?.makeMutable || throwOnMissingReanimated;
69
-
70
- export const useAnimatedReaction: <T>(
71
- prepare: () => T,
72
- react: (v: T) => void,
73
- dependencies?: DependencyList
74
- ) => void = Reanimated2?.useAnimatedReaction || throwOnMissingReanimated;
75
-
76
- export const isSharedValue = <T>(value: unknown): value is SharedValue<T> => {
77
- return (
78
- !!value &&
79
- (Reanimated3
80
- ? Reanimated3.isSharedValue(value)
81
- : (value as any).value !== undefined)
82
- );
83
- };