@shopify/react-native-skia 0.1.213 → 0.1.215
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/rnskia-android/SkiaOpenGLHelper.h +3 -2
- package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp +9 -2
- package/cpp/api/JsiSkMatrix.h +31 -0
- package/cpp/api/JsiSkPath.h +15 -7
- package/cpp/api/JsiSkSurface.h +4 -1
- package/cpp/skia/include/android/GrAHardwareBufferUtils.h +99 -0
- package/cpp/skia/include/android/SkHeifDecoder.h +10 -3
- package/cpp/skia/include/codec/SkAvifDecoder.h +1 -0
- package/cpp/skia/include/codec/SkBmpDecoder.h +1 -0
- package/cpp/skia/include/codec/SkCodec.h +4 -3
- package/cpp/skia/include/codec/SkEncodedImageFormat.h +0 -3
- package/cpp/skia/include/codec/SkGifDecoder.h +1 -0
- package/cpp/skia/include/codec/SkIcoDecoder.h +1 -0
- package/cpp/skia/include/codec/SkJpegDecoder.h +1 -0
- package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -0
- package/cpp/skia/include/codec/SkPngDecoder.h +1 -0
- package/cpp/skia/include/codec/SkRawDecoder.h +1 -0
- package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -0
- package/cpp/skia/include/codec/SkWebpDecoder.h +1 -0
- package/cpp/skia/include/config/SkUserConfig.h +0 -2
- package/cpp/skia/include/core/SkBitmap.h +8 -8
- package/cpp/skia/include/core/SkCanvas.h +37 -50
- package/cpp/skia/include/core/SkCapabilities.h +2 -7
- package/cpp/skia/include/core/SkColor.h +1 -1
- package/cpp/skia/include/core/SkColorFilter.h +6 -0
- package/cpp/skia/include/core/SkColorTable.h +3 -0
- package/cpp/skia/include/core/SkColorType.h +2 -0
- package/cpp/skia/include/core/SkContourMeasure.h +12 -8
- package/cpp/skia/include/core/SkDocument.h +1 -0
- package/cpp/skia/include/core/SkFont.h +11 -2
- package/cpp/skia/include/core/SkFontMgr.h +2 -3
- package/cpp/skia/include/core/SkGraphics.h +3 -13
- package/cpp/skia/include/core/SkImage.h +57 -111
- package/cpp/skia/include/core/SkImageFilter.h +6 -1
- package/cpp/skia/include/core/SkImageGenerator.h +8 -0
- package/cpp/skia/include/core/SkImageInfo.h +0 -2
- package/cpp/skia/include/core/SkM44.h +7 -3
- package/cpp/skia/include/core/SkMallocPixelRef.h +4 -1
- package/cpp/skia/include/core/SkMatrix.h +17 -17
- package/cpp/skia/include/core/SkMesh.h +71 -61
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkOverdrawCanvas.h +25 -0
- package/cpp/skia/include/core/SkPaint.h +1 -1
- package/cpp/skia/include/core/SkPath.h +12 -4
- package/cpp/skia/include/core/SkPathMeasure.h +3 -4
- package/cpp/skia/include/core/SkPicture.h +19 -6
- package/cpp/skia/include/core/SkPictureRecorder.h +6 -6
- package/cpp/skia/include/core/SkPixmap.h +2 -3
- package/cpp/skia/include/core/SkRRect.h +1 -1
- package/cpp/skia/include/core/SkRect.h +107 -110
- package/cpp/skia/include/core/SkRefCnt.h +1 -1
- package/cpp/skia/include/core/SkRegion.h +7 -1
- package/cpp/skia/include/core/SkSerialProcs.h +14 -0
- package/cpp/skia/include/core/SkShader.h +9 -0
- package/cpp/skia/include/core/SkStream.h +9 -9
- package/cpp/skia/include/core/SkString.h +1 -1
- package/cpp/skia/include/core/SkSurface.h +14 -25
- package/cpp/skia/include/core/SkTextBlob.h +17 -4
- package/cpp/skia/include/core/SkTiledImageUtils.h +28 -0
- package/cpp/skia/include/core/SkTypeface.h +7 -2
- package/cpp/skia/include/core/SkTypes.h +4 -12
- package/cpp/skia/include/docs/SkPDFDocument.h +17 -3
- package/cpp/skia/include/effects/SkImageFilters.h +73 -24
- package/cpp/skia/include/effects/SkRuntimeEffect.h +20 -51
- package/cpp/skia/include/gpu/GpuTypes.h +13 -0
- package/cpp/skia/include/gpu/GrBackendSurface.h +95 -262
- package/cpp/skia/include/gpu/GrContextOptions.h +7 -1
- package/cpp/skia/include/gpu/GrDirectContext.h +138 -128
- package/cpp/skia/include/gpu/GrRecordingContext.h +9 -4
- package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -24
- package/cpp/skia/include/gpu/GrTypes.h +16 -1
- package/cpp/skia/include/gpu/GrYUVABackendTextures.h +4 -4
- package/cpp/skia/include/gpu/d3d/GrD3DTypes.h +2 -2
- package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +44 -12
- package/cpp/skia/include/gpu/ganesh/SkMeshGanesh.h +57 -0
- package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +2 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h +58 -0
- package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +29 -0
- package/cpp/skia/include/gpu/ganesh/mtl/SkSurfaceMetal.h +1 -1
- package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h +67 -0
- package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -2
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +14 -3
- package/cpp/skia/include/gpu/graphite/Context.h +93 -13
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +19 -8
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +23 -0
- package/cpp/skia/include/gpu/graphite/Image.h +56 -0
- package/cpp/skia/include/gpu/graphite/ImageProvider.h +5 -0
- package/cpp/skia/include/gpu/graphite/Recorder.h +26 -9
- package/cpp/skia/include/gpu/graphite/Recording.h +7 -5
- package/cpp/skia/include/gpu/graphite/TextureInfo.h +8 -0
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +2 -2
- package/cpp/skia/include/gpu/mtl/GrMtlTypes.h +2 -2
- package/cpp/skia/include/gpu/vk/GrVkTypes.h +4 -3
- package/cpp/skia/include/ports/SkCFObject.h +1 -1
- package/cpp/skia/include/private/SkGainmapInfo.h +4 -13
- package/cpp/skia/include/private/SkJpegGainmapEncoder.h +1 -24
- package/cpp/skia/include/private/SkWeakRefCnt.h +1 -1
- package/cpp/skia/include/private/base/SkAnySubclass.h +73 -0
- package/cpp/skia/include/private/base/SkAssert.h +106 -12
- package/cpp/skia/include/private/base/SkAttributes.h +0 -12
- package/cpp/skia/include/private/base/SkFeatures.h +0 -3
- package/cpp/skia/include/private/base/SkFloatingPoint.h +58 -105
- package/cpp/skia/include/private/base/SkSpan_impl.h +18 -12
- package/cpp/skia/include/private/base/SkTArray.h +22 -17
- package/cpp/skia/include/private/base/SkTDArray.h +5 -6
- package/cpp/skia/include/private/base/SkTemplates.h +50 -30
- package/cpp/skia/include/private/chromium/GrDeferredDisplayListRecorder.h +5 -2
- package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +2 -2
- package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +13 -8
- package/cpp/skia/include/private/chromium/SkDiscardableMemory.h +1 -1
- package/cpp/skia/include/private/chromium/SkImageChromium.h +16 -3
- package/cpp/skia/include/private/chromium/Slug.h +11 -4
- package/cpp/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +6 -9
- package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +29 -13
- package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +2 -28
- package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +34 -0
- package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +6 -0
- package/cpp/skia/include/private/gpu/graphite/MtlGraphiteTypesPriv.h +8 -0
- package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +10 -0
- package/cpp/skia/include/utils/SkBase64.h +2 -2
- package/cpp/skia/include/utils/SkNWayCanvas.h +1 -11
- package/cpp/skia/include/utils/SkNoDrawCanvas.h +0 -2
- package/cpp/skia/include/utils/SkPaintFilterCanvas.h +1 -2
- package/cpp/skia/include/utils/SkShadowUtils.h +15 -1
- package/cpp/skia/include/utils/SkTextUtils.h +1 -1
- package/cpp/skia/modules/skparagraph/include/Paragraph.h +107 -1
- package/cpp/skia/modules/skparagraph/include/ParagraphBuilder.h +3 -2
- package/cpp/skia/modules/skparagraph/include/ParagraphStyle.h +4 -0
- package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +5 -3
- package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +4 -0
- package/cpp/skia/src/core/SkChecksum.h +2 -1
- package/cpp/skia/src/core/SkPathPriv.h +1 -1
- package/cpp/skia/src/core/SkTHash.h +19 -9
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +3 -1
- package/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm +1 -1
- package/lib/commonjs/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/commonjs/animation/functions/interpolatePaths.js +4 -4
- package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js +5 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/external/reanimated/index.d.ts +3 -1
- package/lib/commonjs/external/reanimated/index.js +30 -4
- package/lib/commonjs/external/reanimated/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/interpolators.d.ts +9 -0
- package/lib/commonjs/external/reanimated/interpolators.js +56 -0
- package/lib/commonjs/external/reanimated/interpolators.js.map +1 -0
- package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +8 -6
- package/lib/commonjs/external/reanimated/moduleWrapper.js +8 -18
- package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/commonjs/external/reanimated/renderHelpers.js +46 -1
- package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.d.ts +2 -0
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +53 -0
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -0
- package/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +1 -0
- package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js +27 -0
- package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js.map +1 -0
- package/lib/commonjs/mock/index.js +8 -0
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +5 -5
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/skia/core/AnimatedImage.d.ts +0 -1
- package/lib/commonjs/skia/core/AnimatedImage.js +1 -45
- package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
- package/lib/commonjs/skia/types/MaskFilter.js +4 -0
- package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.d.ts +4 -0
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.d.ts +10 -9
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js +33 -5
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +9 -9
- package/lib/commonjs/skia/web/JsiSkPath.js +15 -2
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js +2 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.js +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
- package/lib/commonjs/views/types.js +3 -0
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/module/animation/functions/interpolatePaths.js +4 -4
- package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js +5 -1
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/external/reanimated/index.d.ts +3 -1
- package/lib/module/external/reanimated/index.js +3 -1
- package/lib/module/external/reanimated/index.js.map +1 -1
- package/lib/module/external/reanimated/interpolators.d.ts +9 -0
- package/lib/module/external/reanimated/interpolators.js +34 -0
- package/lib/module/external/reanimated/interpolators.js.map +1 -0
- package/lib/module/external/reanimated/moduleWrapper.d.ts +8 -6
- package/lib/module/external/reanimated/moduleWrapper.js +5 -16
- package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/module/external/reanimated/renderHelpers.js +48 -2
- package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/module/external/reanimated/useAnimatedImageValue.d.ts +2 -0
- package/lib/module/external/reanimated/useAnimatedImageValue.js +41 -0
- package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -0
- package/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +1 -0
- package/lib/module/external/reanimated/useDerivedValueOnJS.js +16 -0
- package/lib/module/external/reanimated/useDerivedValueOnJS.js.map +1 -0
- package/lib/module/mock/index.js +8 -0
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +1 -1
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/skia/core/AnimatedImage.d.ts +0 -1
- package/lib/module/skia/core/AnimatedImage.js +0 -40
- package/lib/module/skia/core/AnimatedImage.js.map +1 -1
- package/lib/module/skia/types/MaskFilter.js +3 -0
- package/lib/module/skia/types/MaskFilter.js.map +1 -1
- package/lib/module/skia/types/Matrix.d.ts +4 -0
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Path/Path.d.ts +10 -9
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.d.ts +6 -0
- package/lib/module/skia/web/JsiSkMatrix.js +33 -5
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.d.ts +9 -9
- package/lib/module/skia/web/JsiSkPath.js +15 -2
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/views/types.js +3 -0
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/jestEnv.d.mts +5 -0
- package/lib/typescript/jestSetup.d.mts +1 -0
- package/lib/typescript/src/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/typescript/src/external/reanimated/index.d.ts +3 -1
- package/lib/typescript/src/external/reanimated/interpolators.d.ts +9 -0
- package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +8 -6
- package/lib/typescript/src/external/reanimated/useAnimatedImageValue.d.ts +2 -0
- package/lib/typescript/src/external/reanimated/useDerivedValueOnJS.d.ts +1 -0
- package/lib/typescript/src/skia/core/AnimatedImage.d.ts +0 -1
- package/lib/typescript/src/skia/types/Matrix.d.ts +4 -0
- package/lib/typescript/src/skia/types/Path/Path.d.ts +10 -9
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +9 -9
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/arm64-v8a/libskottie.a +0 -0
- package/libs/android/arm64-v8a/libskparagraph.a +0 -0
- package/libs/android/arm64-v8a/libsksg.a +0 -0
- package/libs/android/arm64-v8a/libskshaper.a +0 -0
- package/libs/android/arm64-v8a/libskunicode.a +0 -0
- package/libs/android/arm64-v8a/libsvg.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskottie.a +0 -0
- package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
- package/libs/android/armeabi-v7a/libsksg.a +0 -0
- package/libs/android/armeabi-v7a/libskshaper.a +0 -0
- package/libs/android/armeabi-v7a/libskunicode.a +0 -0
- package/libs/android/armeabi-v7a/libsvg.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86/libskottie.a +0 -0
- package/libs/android/x86/libskparagraph.a +0 -0
- package/libs/android/x86/libsksg.a +0 -0
- package/libs/android/x86/libskshaper.a +0 -0
- package/libs/android/x86/libskunicode.a +0 -0
- package/libs/android/x86/libsvg.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/android/x86_64/libskottie.a +0 -0
- package/libs/android/x86_64/libskparagraph.a +0 -0
- package/libs/android/x86_64/libsksg.a +0 -0
- package/libs/android/x86_64/libskshaper.a +0 -0
- package/libs/android/x86_64/libskunicode.a +0 -0
- package/libs/android/x86_64/libsvg.a +0 -0
- package/libs/ios/libskia.xcframework/Info.plist +5 -5
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libskparagraph.xcframework/Info.plist +5 -5
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/ios/libsksg.xcframework/Info.plist +5 -5
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libskunicode.xcframework/Info.plist +5 -5
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +5 -5
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +4 -3
- package/react-native-skia.podspec +1 -1
- package/src/animation/functions/interpolatePaths.ts +7 -4
- package/src/dom/nodes/datatypes/Rect.ts +6 -2
- package/src/external/reanimated/index.ts +3 -1
- package/src/external/reanimated/interpolators.ts +89 -0
- package/src/external/reanimated/moduleWrapper.ts +38 -25
- package/src/external/reanimated/renderHelpers.ts +42 -2
- package/src/external/reanimated/useAnimatedImageValue.ts +51 -0
- package/src/external/reanimated/useDerivedValueOnJS.ts +25 -0
- package/src/mock/index.ts +5 -0
- package/src/renderer/HostConfig.ts +1 -1
- package/src/skia/core/AnimatedImage.ts +0 -47
- package/src/skia/types/Matrix.ts +4 -0
- package/src/skia/types/Path/Path.ts +10 -9
- package/src/skia/web/JsiSkMatrix.ts +33 -27
- package/src/skia/web/JsiSkPath.ts +15 -2
- package/cpp/skia/include/core/SkDeferredDisplayList.h +0 -15
- package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +0 -15
- package/cpp/skia/include/core/SkPromiseImageTexture.h +0 -20
- package/cpp/skia/include/core/SkSurfaceCharacterization.h +0 -15
- package/cpp/skia/include/core/SkTime.h +0 -63
- package/cpp/skia/include/effects/SkOpPathEffect.h +0 -43
- package/cpp/skia/include/effects/SkStrokeAndFillPathEffect.h +0 -28
- package/cpp/skia/include/gpu/GrBackendSurfaceMutableState.h +0 -32
- package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +0 -95
- package/cpp/skia/include/private/SkBitmaskEnum.h +0 -59
- package/cpp/skia/include/private/SkSLDefines.h +0 -64
- package/cpp/skia/include/private/SkShadowFlags.h +0 -27
- package/cpp/skia/include/private/gpu/ganesh/GrDawnTypesPriv.h +0 -26
- package/globalJestSetup.js +0 -6
- package/lib/commonjs/external/reanimated/useSharedValueEffect.d.ts +0 -8
- package/lib/commonjs/external/reanimated/useSharedValueEffect.js +0 -52
- package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +0 -1
- package/lib/module/external/reanimated/useSharedValueEffect.d.ts +0 -8
- package/lib/module/external/reanimated/useSharedValueEffect.js +0 -42
- package/lib/module/external/reanimated/useSharedValueEffect.js.map +0 -1
- package/lib/typescript/globalJestSetup.d.ts +0 -2
- package/lib/typescript/src/external/reanimated/useSharedValueEffect.d.ts +0 -8
- package/src/external/reanimated/useSharedValueEffect.ts +0 -58
- /package/cpp/skia/{include/private/base → src/core}/SkPathEnums.h +0 -0
@@ -1,28 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2020 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
|
-
#ifndef SkStrokeAndFillPathEffect_DEFINED
|
9
|
-
#define SkStrokeAndFillPathEffect_DEFINED
|
10
|
-
|
11
|
-
#include "include/core/SkPaint.h"
|
12
|
-
#include "include/core/SkPathEffect.h"
|
13
|
-
#include "include/pathops/SkPathOps.h"
|
14
|
-
|
15
|
-
class SK_API SkStrokeAndFillPathEffect {
|
16
|
-
public:
|
17
|
-
/* If the paint is set to stroke, this will add the stroke and fill geometries
|
18
|
-
* together (hoping that the winding-direction works out).
|
19
|
-
*
|
20
|
-
* If the paint is set to fill, this effect is ignored.
|
21
|
-
*
|
22
|
-
* Note that if the paint is set to stroke and the stroke-width is 0, then
|
23
|
-
* this will turn the geometry into just a fill.
|
24
|
-
*/
|
25
|
-
static sk_sp<SkPathEffect> Make();
|
26
|
-
};
|
27
|
-
|
28
|
-
#endif
|
@@ -1,32 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2020 Google LLC
|
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
|
-
#ifndef GrBackendSurfaceMutableState_DEFINED
|
9
|
-
#define GrBackendSurfaceMutableState_DEFINED
|
10
|
-
|
11
|
-
#include "include/gpu/MutableTextureState.h"
|
12
|
-
|
13
|
-
#ifdef SK_VULKAN
|
14
|
-
#include "include/private/gpu/vk/SkiaVulkan.h"
|
15
|
-
|
16
|
-
#include <cstdint>
|
17
|
-
#endif
|
18
|
-
|
19
|
-
class GrBackendSurfaceMutableState : public skgpu::MutableTextureState {
|
20
|
-
public:
|
21
|
-
GrBackendSurfaceMutableState() = default;
|
22
|
-
|
23
|
-
#ifdef SK_VULKAN
|
24
|
-
GrBackendSurfaceMutableState(VkImageLayout layout, uint32_t queueFamilyIndex)
|
25
|
-
: skgpu::MutableTextureState(layout, queueFamilyIndex) {}
|
26
|
-
#endif
|
27
|
-
|
28
|
-
GrBackendSurfaceMutableState(const GrBackendSurfaceMutableState& that)
|
29
|
-
: skgpu::MutableTextureState(that) {}
|
30
|
-
};
|
31
|
-
|
32
|
-
#endif
|
@@ -1,95 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2019 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
|
-
#ifndef GrDawnTypes_DEFINED
|
9
|
-
#define GrDawnTypes_DEFINED
|
10
|
-
|
11
|
-
#include "include/gpu/GpuTypes.h"
|
12
|
-
|
13
|
-
#ifdef Always
|
14
|
-
#undef Always
|
15
|
-
static constexpr int Always = 2;
|
16
|
-
#endif
|
17
|
-
#ifdef Success
|
18
|
-
#undef Success
|
19
|
-
static constexpr int Success = 0;
|
20
|
-
#endif
|
21
|
-
#ifdef None
|
22
|
-
#undef None
|
23
|
-
static constexpr int None = 0L;
|
24
|
-
#endif
|
25
|
-
#include "webgpu/webgpu_cpp.h" // IWYU pragma: export
|
26
|
-
|
27
|
-
struct GrDawnTextureInfo {
|
28
|
-
wgpu::Texture fTexture;
|
29
|
-
wgpu::TextureFormat fFormat;
|
30
|
-
uint32_t fLevelCount;
|
31
|
-
GrDawnTextureInfo() : fTexture(nullptr), fFormat(), fLevelCount(0) {
|
32
|
-
}
|
33
|
-
GrDawnTextureInfo(const GrDawnTextureInfo& other)
|
34
|
-
: fTexture(other.fTexture)
|
35
|
-
, fFormat(other.fFormat)
|
36
|
-
, fLevelCount(other.fLevelCount) {
|
37
|
-
}
|
38
|
-
GrDawnTextureInfo& operator=(const GrDawnTextureInfo& other) {
|
39
|
-
fTexture = other.fTexture;
|
40
|
-
fFormat = other.fFormat;
|
41
|
-
fLevelCount = other.fLevelCount;
|
42
|
-
return *this;
|
43
|
-
}
|
44
|
-
bool operator==(const GrDawnTextureInfo& other) const {
|
45
|
-
return fTexture.Get() == other.fTexture.Get() &&
|
46
|
-
fFormat == other.fFormat &&
|
47
|
-
fLevelCount == other.fLevelCount;
|
48
|
-
}
|
49
|
-
};
|
50
|
-
|
51
|
-
// GrDawnRenderTargetInfo holds a reference to a (1-mip) TextureView. This means that, for now,
|
52
|
-
// GrDawnRenderTarget is suitable for rendering, but not readPixels() or writePixels(). Also,
|
53
|
-
// backdrop filters and certain blend modes requiring copying the destination framebuffer
|
54
|
-
// will not work.
|
55
|
-
struct GrDawnRenderTargetInfo {
|
56
|
-
wgpu::TextureView fTextureView;
|
57
|
-
wgpu::TextureFormat fFormat;
|
58
|
-
uint32_t fLevelCount;
|
59
|
-
GrDawnRenderTargetInfo() : fTextureView(nullptr), fFormat(), fLevelCount(0) {
|
60
|
-
}
|
61
|
-
GrDawnRenderTargetInfo(const GrDawnRenderTargetInfo& other)
|
62
|
-
: fTextureView(other.fTextureView)
|
63
|
-
, fFormat(other.fFormat)
|
64
|
-
, fLevelCount(other.fLevelCount) {
|
65
|
-
}
|
66
|
-
explicit GrDawnRenderTargetInfo(const GrDawnTextureInfo& texInfo)
|
67
|
-
: fFormat(texInfo.fFormat)
|
68
|
-
, fLevelCount(1) {
|
69
|
-
wgpu::TextureViewDescriptor desc;
|
70
|
-
desc.format = texInfo.fFormat;
|
71
|
-
desc.mipLevelCount = 1;
|
72
|
-
fTextureView = texInfo.fTexture.CreateView(&desc);
|
73
|
-
}
|
74
|
-
GrDawnRenderTargetInfo& operator=(const GrDawnRenderTargetInfo& other) {
|
75
|
-
fTextureView = other.fTextureView;
|
76
|
-
fFormat = other.fFormat;
|
77
|
-
fLevelCount = other.fLevelCount;
|
78
|
-
return *this;
|
79
|
-
}
|
80
|
-
bool operator==(const GrDawnRenderTargetInfo& other) const {
|
81
|
-
return fTextureView.Get() == other.fTextureView.Get() &&
|
82
|
-
fFormat == other.fFormat &&
|
83
|
-
fLevelCount == other.fLevelCount;
|
84
|
-
}
|
85
|
-
};
|
86
|
-
|
87
|
-
struct GrDawnSurfaceInfo {
|
88
|
-
uint32_t fSampleCount = 1;
|
89
|
-
uint32_t fLevelCount = 0;
|
90
|
-
skgpu::Protected fProtected = skgpu::Protected::kNo;
|
91
|
-
|
92
|
-
wgpu::TextureFormat fFormat;
|
93
|
-
};
|
94
|
-
|
95
|
-
#endif
|
@@ -1,59 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2016 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
|
-
#ifndef SkEnumOperators_DEFINED
|
8
|
-
#define SkEnumOperators_DEFINED
|
9
|
-
|
10
|
-
#include <type_traits>
|
11
|
-
|
12
|
-
namespace sknonstd {
|
13
|
-
template <typename T> struct is_bitmask_enum : std::false_type {};
|
14
|
-
|
15
|
-
template <typename E>
|
16
|
-
std::enable_if_t<sknonstd::is_bitmask_enum<E>::value, bool> constexpr Any(E e) {
|
17
|
-
return static_cast<std::underlying_type_t<E>>(e) != 0;
|
18
|
-
}
|
19
|
-
} // namespace sknonstd
|
20
|
-
|
21
|
-
template <typename E>
|
22
|
-
std::enable_if_t<sknonstd::is_bitmask_enum<E>::value, E> constexpr operator|(E l, E r) {
|
23
|
-
using U = std::underlying_type_t<E>;
|
24
|
-
return static_cast<E>(static_cast<U>(l) | static_cast<U>(r));
|
25
|
-
}
|
26
|
-
|
27
|
-
template <typename E>
|
28
|
-
std::enable_if_t<sknonstd::is_bitmask_enum<E>::value, E&> constexpr operator|=(E& l, E r) {
|
29
|
-
return l = l | r;
|
30
|
-
}
|
31
|
-
|
32
|
-
template <typename E>
|
33
|
-
std::enable_if_t<sknonstd::is_bitmask_enum<E>::value, E> constexpr operator&(E l, E r) {
|
34
|
-
using U = std::underlying_type_t<E>;
|
35
|
-
return static_cast<E>(static_cast<U>(l) & static_cast<U>(r));
|
36
|
-
}
|
37
|
-
|
38
|
-
template <typename E>
|
39
|
-
std::enable_if_t<sknonstd::is_bitmask_enum<E>::value, E&> constexpr operator&=(E& l, E r) {
|
40
|
-
return l = l & r;
|
41
|
-
}
|
42
|
-
|
43
|
-
template <typename E>
|
44
|
-
std::enable_if_t<sknonstd::is_bitmask_enum<E>::value, E> constexpr operator^(E l, E r) {
|
45
|
-
using U = std::underlying_type_t<E>;
|
46
|
-
return static_cast<E>(static_cast<U>(l) ^ static_cast<U>(r));
|
47
|
-
}
|
48
|
-
|
49
|
-
template <typename E>
|
50
|
-
std::enable_if_t<sknonstd::is_bitmask_enum<E>::value, E&> constexpr operator^=(E& l, E r) {
|
51
|
-
return l = l ^ r;
|
52
|
-
}
|
53
|
-
|
54
|
-
template <typename E>
|
55
|
-
std::enable_if_t<sknonstd::is_bitmask_enum<E>::value, E> constexpr operator~(E e) {
|
56
|
-
return static_cast<E>(~static_cast<std::underlying_type_t<E>>(e));
|
57
|
-
}
|
58
|
-
|
59
|
-
#endif // SkEnumOperators_DEFINED
|
@@ -1,64 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2019 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
|
-
#ifndef SKSL_DEFINES
|
9
|
-
#define SKSL_DEFINES
|
10
|
-
|
11
|
-
#include <cstdint>
|
12
|
-
|
13
|
-
#include "include/core/SkTypes.h"
|
14
|
-
#include "include/private/base/SkTArray.h"
|
15
|
-
|
16
|
-
using SKSL_INT = int64_t;
|
17
|
-
using SKSL_FLOAT = float;
|
18
|
-
|
19
|
-
namespace SkSL {
|
20
|
-
|
21
|
-
class Expression;
|
22
|
-
class Statement;
|
23
|
-
|
24
|
-
using ComponentArray = skia_private::STArray<4, int8_t>; // for Swizzles
|
25
|
-
|
26
|
-
class ExpressionArray : public skia_private::STArray<2, std::unique_ptr<Expression>> {
|
27
|
-
public:
|
28
|
-
using STArray::STArray;
|
29
|
-
|
30
|
-
/** Returns a new ExpressionArray containing a clone of every element. */
|
31
|
-
ExpressionArray clone() const;
|
32
|
-
};
|
33
|
-
|
34
|
-
using StatementArray = skia_private::STArray<2, std::unique_ptr<Statement>>;
|
35
|
-
|
36
|
-
// Functions larger than this (measured in IR nodes) will not be inlined. This growth factor
|
37
|
-
// accounts for the number of calls being inlined--i.e., a function called five times (that is, with
|
38
|
-
// five inlining opportunities) would be considered 5x larger than if it were called once. This
|
39
|
-
// default threshold value is arbitrary, but tends to work well in practice.
|
40
|
-
static constexpr int kDefaultInlineThreshold = 50;
|
41
|
-
|
42
|
-
// A hard upper limit on the number of variable slots allowed in a function/global scope.
|
43
|
-
// This is an arbitrary limit, but is needed to prevent code generation from taking unbounded
|
44
|
-
// amounts of time or space.
|
45
|
-
static constexpr int kVariableSlotLimit = 100000;
|
46
|
-
|
47
|
-
// The SwizzleComponent namespace is used both by the SkSL::Swizzle expression, and the DSL swizzle.
|
48
|
-
// This namespace is injected into SkSL::dsl so that `using namespace SkSL::dsl` enables DSL code
|
49
|
-
// like `Swizzle(var, X, Y, ONE)` to compile without any extra qualifications.
|
50
|
-
namespace SwizzleComponent {
|
51
|
-
|
52
|
-
enum Type : int8_t {
|
53
|
-
X = 0, Y = 1, Z = 2, W = 3,
|
54
|
-
R = 4, G = 5, B = 6, A = 7,
|
55
|
-
S = 8, T = 9, P = 10, Q = 11,
|
56
|
-
UL = 12, UT = 13, UR = 14, UB = 15,
|
57
|
-
ZERO,
|
58
|
-
ONE
|
59
|
-
};
|
60
|
-
|
61
|
-
} // namespace SwizzleComponent
|
62
|
-
} // namespace SkSL
|
63
|
-
|
64
|
-
#endif
|
@@ -1,27 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2017 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
|
-
#ifndef SkShadowFlags_DEFINED
|
9
|
-
#define SkShadowFlags_DEFINED
|
10
|
-
|
11
|
-
// A set of flags shared between the SkAmbientShadowMaskFilter and the SkSpotShadowMaskFilter
|
12
|
-
enum SkShadowFlags {
|
13
|
-
kNone_ShadowFlag = 0x00,
|
14
|
-
/** The occluding object is not opaque. Knowing that the occluder is opaque allows
|
15
|
-
* us to cull shadow geometry behind it and improve performance. */
|
16
|
-
kTransparentOccluder_ShadowFlag = 0x01,
|
17
|
-
/** Don't try to use analytic shadows. */
|
18
|
-
kGeometricOnly_ShadowFlag = 0x02,
|
19
|
-
/** Light position represents a direction, light radius is blur radius at elevation 1 */
|
20
|
-
kDirectionalLight_ShadowFlag = 0x04,
|
21
|
-
/** Concave paths will only use blur to generate the shadow */
|
22
|
-
kConcaveBlurOnly_ShadowFlag = 0x08,
|
23
|
-
/** mask for all shadow flags */
|
24
|
-
kAll_ShadowFlag = 0x0F
|
25
|
-
};
|
26
|
-
|
27
|
-
#endif
|
@@ -1,26 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2021 Google LLC
|
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
|
-
#ifndef GrDawnTypesPriv_DEFINED
|
9
|
-
#define GrDawnTypesPriv_DEFINED
|
10
|
-
|
11
|
-
#include "include/gpu/dawn/GrDawnTypes.h"
|
12
|
-
|
13
|
-
struct GrDawnTextureSpec {
|
14
|
-
GrDawnTextureSpec() {}
|
15
|
-
GrDawnTextureSpec(const GrDawnSurfaceInfo& info) : fFormat(info.fFormat) {}
|
16
|
-
|
17
|
-
wgpu::TextureFormat fFormat;
|
18
|
-
};
|
19
|
-
|
20
|
-
GrDawnSurfaceInfo GrDawnTextureSpecToSurfaceInfo(const GrDawnTextureSpec& dawnSpec,
|
21
|
-
uint32_t sampleCount,
|
22
|
-
uint32_t levelCount,
|
23
|
-
skgpu::Protected isProtected);
|
24
|
-
|
25
|
-
#endif
|
26
|
-
|
package/globalJestSetup.js
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { SharedValueType } from "../../renderer/processors/Animations";
|
2
|
-
/**
|
3
|
-
* Connects a shared value from reanimated to a SkiaView or Canvas
|
4
|
-
* so whenever the shared value changes the SkiaView will redraw.
|
5
|
-
* @param cb Callback that will be called whenever the shared value changes.
|
6
|
-
* @param values One or more shared values to listen for.
|
7
|
-
*/
|
8
|
-
export declare const useSharedValueEffect: <T = number>(cb: () => void, value: SharedValueType<T>, ...values: SharedValueType<T>[]) => void;
|
@@ -1,52 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.useSharedValueEffect = void 0;
|
7
|
-
|
8
|
-
var _react = require("react");
|
9
|
-
|
10
|
-
var _moduleWrapper = require("./moduleWrapper");
|
11
|
-
|
12
|
-
/**
|
13
|
-
* Connects a shared value from reanimated to a SkiaView or Canvas
|
14
|
-
* so whenever the shared value changes the SkiaView will redraw.
|
15
|
-
* @param cb Callback that will be called whenever the shared value changes.
|
16
|
-
* @param values One or more shared values to listen for.
|
17
|
-
*/
|
18
|
-
const useSharedValueEffect = function (cb, value) {
|
19
|
-
for (var _len = arguments.length, values = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
20
|
-
values[_key - 2] = arguments[_key];
|
21
|
-
}
|
22
|
-
|
23
|
-
if (_moduleWrapper.HAS_REANIMATED3) {
|
24
|
-
console.warn(`useSharedValueEffect() is deprecated with Reanimated 3, you can use Reanimated values directly.
|
25
|
-
Learn more at https://shopify.github.io/react-native-skia/docs/animations/reanimated.`);
|
26
|
-
}
|
27
|
-
|
28
|
-
const input = (0, _moduleWrapper.useSharedValue)(0);
|
29
|
-
(0, _react.useEffect)(() => {
|
30
|
-
if (!_moduleWrapper.HAS_REANIMATED2) {
|
31
|
-
console.warn("Reanimated was not found and the useSharedValueEffect hook will have no effect.");
|
32
|
-
} else {
|
33
|
-
// Start a mapper in Reanimated
|
34
|
-
const mapperId = (0, _moduleWrapper.startMapper)(() => {
|
35
|
-
"worklet";
|
36
|
-
|
37
|
-
(0, _moduleWrapper.runOnJS)(cb)();
|
38
|
-
}, [value, ...values], [input]); // Return unregistering the mapper
|
39
|
-
|
40
|
-
return () => {
|
41
|
-
if (_moduleWrapper.stopMapper && mapperId !== undefined) {
|
42
|
-
(0, _moduleWrapper.stopMapper)(mapperId);
|
43
|
-
}
|
44
|
-
};
|
45
|
-
}
|
46
|
-
|
47
|
-
return () => {}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
48
|
-
}, [input, value, ...values]);
|
49
|
-
};
|
50
|
-
|
51
|
-
exports.useSharedValueEffect = useSharedValueEffect;
|
52
|
-
//# sourceMappingURL=useSharedValueEffect.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["useSharedValueEffect","cb","value","values","HAS_REANIMATED3","console","warn","input","useSharedValue","useEffect","HAS_REANIMATED2","mapperId","startMapper","runOnJS","stopMapper","undefined"],"sources":["useSharedValueEffect.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport type { SharedValueType } from \"../../renderer/processors/Animations\";\n\nimport {\n HAS_REANIMATED2,\n useSharedValue,\n runOnJS,\n startMapper,\n stopMapper,\n HAS_REANIMATED3,\n} from \"./moduleWrapper\";\n\n/**\n * Connects a shared value from reanimated to a SkiaView or Canvas\n * so whenever the shared value changes the SkiaView will redraw.\n * @param cb Callback that will be called whenever the shared value changes.\n * @param values One or more shared values to listen for.\n */\nexport const useSharedValueEffect = <T = number>(\n cb: () => void,\n value: SharedValueType<T>,\n ...values: SharedValueType<T>[]\n) => {\n if (HAS_REANIMATED3) {\n console.warn(\n `useSharedValueEffect() is deprecated with Reanimated 3, you can use Reanimated values directly.\nLearn more at https://shopify.github.io/react-native-skia/docs/animations/reanimated.`\n );\n }\n const input = useSharedValue(0);\n\n useEffect(() => {\n if (!HAS_REANIMATED2) {\n console.warn(\n \"Reanimated was not found and the useSharedValueEffect hook will have no effect.\"\n );\n } else {\n // Start a mapper in Reanimated\n const mapperId = startMapper(\n () => {\n \"worklet\";\n runOnJS(cb)();\n },\n [value, ...values],\n [input]\n );\n // Return unregistering the mapper\n return () => {\n if (stopMapper && mapperId !== undefined) {\n stopMapper(mapperId);\n }\n };\n }\n return () => {};\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [input, value, ...values]);\n};\n"],"mappings":";;;;;;;AAAA;;AAIA;;AASA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,oBAAoB,GAAG,UAClCC,EADkC,EAElCC,KAFkC,EAI/B;EAAA,kCADAC,MACA;IADAA,MACA;EAAA;;EACH,IAAIC,8BAAJ,EAAqB;IACnBC,OAAO,CAACC,IAAR,CACG;AACP,sFAFI;EAID;;EACD,MAAMC,KAAK,GAAG,IAAAC,6BAAA,EAAe,CAAf,CAAd;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACd,IAAI,CAACC,8BAAL,EAAsB;MACpBL,OAAO,CAACC,IAAR,CACE,iFADF;IAGD,CAJD,MAIO;MACL;MACA,MAAMK,QAAQ,GAAG,IAAAC,0BAAA,EACf,MAAM;QACJ;;QACA,IAAAC,sBAAA,EAAQZ,EAAR;MACD,CAJc,EAKf,CAACC,KAAD,EAAQ,GAAGC,MAAX,CALe,EAMf,CAACI,KAAD,CANe,CAAjB,CAFK,CAUL;;MACA,OAAO,MAAM;QACX,IAAIO,yBAAA,IAAcH,QAAQ,KAAKI,SAA/B,EAA0C;UACxC,IAAAD,yBAAA,EAAWH,QAAX;QACD;MACF,CAJD;IAKD;;IACD,OAAO,MAAM,CAAE,CAAf,CAtBc,CAuBd;EACD,CAxBD,EAwBG,CAACJ,KAAD,EAAQL,KAAR,EAAe,GAAGC,MAAlB,CAxBH;AAyBD,CAtCM"}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { SharedValueType } from "../../renderer/processors/Animations";
|
2
|
-
/**
|
3
|
-
* Connects a shared value from reanimated to a SkiaView or Canvas
|
4
|
-
* so whenever the shared value changes the SkiaView will redraw.
|
5
|
-
* @param cb Callback that will be called whenever the shared value changes.
|
6
|
-
* @param values One or more shared values to listen for.
|
7
|
-
*/
|
8
|
-
export declare const useSharedValueEffect: <T = number>(cb: () => void, value: SharedValueType<T>, ...values: SharedValueType<T>[]) => void;
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import { useEffect } from "react";
|
2
|
-
import { HAS_REANIMATED2, useSharedValue, runOnJS, startMapper, stopMapper, HAS_REANIMATED3 } from "./moduleWrapper";
|
3
|
-
/**
|
4
|
-
* Connects a shared value from reanimated to a SkiaView or Canvas
|
5
|
-
* so whenever the shared value changes the SkiaView will redraw.
|
6
|
-
* @param cb Callback that will be called whenever the shared value changes.
|
7
|
-
* @param values One or more shared values to listen for.
|
8
|
-
*/
|
9
|
-
|
10
|
-
export const useSharedValueEffect = function (cb, value) {
|
11
|
-
for (var _len = arguments.length, values = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
12
|
-
values[_key - 2] = arguments[_key];
|
13
|
-
}
|
14
|
-
|
15
|
-
if (HAS_REANIMATED3) {
|
16
|
-
console.warn(`useSharedValueEffect() is deprecated with Reanimated 3, you can use Reanimated values directly.
|
17
|
-
Learn more at https://shopify.github.io/react-native-skia/docs/animations/reanimated.`);
|
18
|
-
}
|
19
|
-
|
20
|
-
const input = useSharedValue(0);
|
21
|
-
useEffect(() => {
|
22
|
-
if (!HAS_REANIMATED2) {
|
23
|
-
console.warn("Reanimated was not found and the useSharedValueEffect hook will have no effect.");
|
24
|
-
} else {
|
25
|
-
// Start a mapper in Reanimated
|
26
|
-
const mapperId = startMapper(() => {
|
27
|
-
"worklet";
|
28
|
-
|
29
|
-
runOnJS(cb)();
|
30
|
-
}, [value, ...values], [input]); // Return unregistering the mapper
|
31
|
-
|
32
|
-
return () => {
|
33
|
-
if (stopMapper && mapperId !== undefined) {
|
34
|
-
stopMapper(mapperId);
|
35
|
-
}
|
36
|
-
};
|
37
|
-
}
|
38
|
-
|
39
|
-
return () => {}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
40
|
-
}, [input, value, ...values]);
|
41
|
-
};
|
42
|
-
//# sourceMappingURL=useSharedValueEffect.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["useEffect","HAS_REANIMATED2","useSharedValue","runOnJS","startMapper","stopMapper","HAS_REANIMATED3","useSharedValueEffect","cb","value","values","console","warn","input","mapperId","undefined"],"sources":["useSharedValueEffect.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport type { SharedValueType } from \"../../renderer/processors/Animations\";\n\nimport {\n HAS_REANIMATED2,\n useSharedValue,\n runOnJS,\n startMapper,\n stopMapper,\n HAS_REANIMATED3,\n} from \"./moduleWrapper\";\n\n/**\n * Connects a shared value from reanimated to a SkiaView or Canvas\n * so whenever the shared value changes the SkiaView will redraw.\n * @param cb Callback that will be called whenever the shared value changes.\n * @param values One or more shared values to listen for.\n */\nexport const useSharedValueEffect = <T = number>(\n cb: () => void,\n value: SharedValueType<T>,\n ...values: SharedValueType<T>[]\n) => {\n if (HAS_REANIMATED3) {\n console.warn(\n `useSharedValueEffect() is deprecated with Reanimated 3, you can use Reanimated values directly.\nLearn more at https://shopify.github.io/react-native-skia/docs/animations/reanimated.`\n );\n }\n const input = useSharedValue(0);\n\n useEffect(() => {\n if (!HAS_REANIMATED2) {\n console.warn(\n \"Reanimated was not found and the useSharedValueEffect hook will have no effect.\"\n );\n } else {\n // Start a mapper in Reanimated\n const mapperId = startMapper(\n () => {\n \"worklet\";\n runOnJS(cb)();\n },\n [value, ...values],\n [input]\n );\n // Return unregistering the mapper\n return () => {\n if (stopMapper && mapperId !== undefined) {\n stopMapper(mapperId);\n }\n };\n }\n return () => {};\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [input, value, ...values]);\n};\n"],"mappings":"AAAA,SAASA,SAAT,QAA0B,OAA1B;AAIA,SACEC,eADF,EAEEC,cAFF,EAGEC,OAHF,EAIEC,WAJF,EAKEC,UALF,EAMEC,eANF,QAOO,iBAPP;AASA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,oBAAoB,GAAG,UAClCC,EADkC,EAElCC,KAFkC,EAI/B;EAAA,kCADAC,MACA;IADAA,MACA;EAAA;;EACH,IAAIJ,eAAJ,EAAqB;IACnBK,OAAO,CAACC,IAAR,CACG;AACP,sFAFI;EAID;;EACD,MAAMC,KAAK,GAAGX,cAAc,CAAC,CAAD,CAA5B;EAEAF,SAAS,CAAC,MAAM;IACd,IAAI,CAACC,eAAL,EAAsB;MACpBU,OAAO,CAACC,IAAR,CACE,iFADF;IAGD,CAJD,MAIO;MACL;MACA,MAAME,QAAQ,GAAGV,WAAW,CAC1B,MAAM;QACJ;;QACAD,OAAO,CAACK,EAAD,CAAP;MACD,CAJyB,EAK1B,CAACC,KAAD,EAAQ,GAAGC,MAAX,CAL0B,EAM1B,CAACG,KAAD,CAN0B,CAA5B,CAFK,CAUL;;MACA,OAAO,MAAM;QACX,IAAIR,UAAU,IAAIS,QAAQ,KAAKC,SAA/B,EAA0C;UACxCV,UAAU,CAACS,QAAD,CAAV;QACD;MACF,CAJD;IAKD;;IACD,OAAO,MAAM,CAAE,CAAf,CAtBc,CAuBd;EACD,CAxBQ,EAwBN,CAACD,KAAD,EAAQJ,KAAR,EAAe,GAAGC,MAAlB,CAxBM,CAAT;AAyBD,CAtCM"}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { SharedValueType } from "../../renderer/processors/Animations";
|
2
|
-
/**
|
3
|
-
* Connects a shared value from reanimated to a SkiaView or Canvas
|
4
|
-
* so whenever the shared value changes the SkiaView will redraw.
|
5
|
-
* @param cb Callback that will be called whenever the shared value changes.
|
6
|
-
* @param values One or more shared values to listen for.
|
7
|
-
*/
|
8
|
-
export declare const useSharedValueEffect: <T = number>(cb: () => void, value: SharedValueType<T>, ...values: SharedValueType<T>[]) => void;
|
@@ -1,58 +0,0 @@
|
|
1
|
-
import { useEffect } from "react";
|
2
|
-
|
3
|
-
import type { SharedValueType } from "../../renderer/processors/Animations";
|
4
|
-
|
5
|
-
import {
|
6
|
-
HAS_REANIMATED2,
|
7
|
-
useSharedValue,
|
8
|
-
runOnJS,
|
9
|
-
startMapper,
|
10
|
-
stopMapper,
|
11
|
-
HAS_REANIMATED3,
|
12
|
-
} from "./moduleWrapper";
|
13
|
-
|
14
|
-
/**
|
15
|
-
* Connects a shared value from reanimated to a SkiaView or Canvas
|
16
|
-
* so whenever the shared value changes the SkiaView will redraw.
|
17
|
-
* @param cb Callback that will be called whenever the shared value changes.
|
18
|
-
* @param values One or more shared values to listen for.
|
19
|
-
*/
|
20
|
-
export const useSharedValueEffect = <T = number>(
|
21
|
-
cb: () => void,
|
22
|
-
value: SharedValueType<T>,
|
23
|
-
...values: SharedValueType<T>[]
|
24
|
-
) => {
|
25
|
-
if (HAS_REANIMATED3) {
|
26
|
-
console.warn(
|
27
|
-
`useSharedValueEffect() is deprecated with Reanimated 3, you can use Reanimated values directly.
|
28
|
-
Learn more at https://shopify.github.io/react-native-skia/docs/animations/reanimated.`
|
29
|
-
);
|
30
|
-
}
|
31
|
-
const input = useSharedValue(0);
|
32
|
-
|
33
|
-
useEffect(() => {
|
34
|
-
if (!HAS_REANIMATED2) {
|
35
|
-
console.warn(
|
36
|
-
"Reanimated was not found and the useSharedValueEffect hook will have no effect."
|
37
|
-
);
|
38
|
-
} else {
|
39
|
-
// Start a mapper in Reanimated
|
40
|
-
const mapperId = startMapper(
|
41
|
-
() => {
|
42
|
-
"worklet";
|
43
|
-
runOnJS(cb)();
|
44
|
-
},
|
45
|
-
[value, ...values],
|
46
|
-
[input]
|
47
|
-
);
|
48
|
-
// Return unregistering the mapper
|
49
|
-
return () => {
|
50
|
-
if (stopMapper && mapperId !== undefined) {
|
51
|
-
stopMapper(mapperId);
|
52
|
-
}
|
53
|
-
};
|
54
|
-
}
|
55
|
-
return () => {};
|
56
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
57
|
-
}, [input, value, ...values]);
|
58
|
-
};
|
File without changes
|