@shopify/react-native-skia 0.1.234 → 0.1.237
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkApi.h +2 -0
- package/cpp/api/JsiSkCanvas.h +36 -0
- package/cpp/api/JsiSkRSXform.h +35 -7
- package/cpp/api/JsiSkTypefaceFactory.h +2 -1
- package/cpp/rnskia/dom/JsiDomApi.h +2 -0
- package/cpp/rnskia/dom/nodes/JsiAtlasNode.h +60 -0
- package/cpp/rnskia/dom/props/RSXformProp.h +52 -0
- package/cpp/rnskia/dom/props/RectProp.h +31 -0
- package/cpp/skia/include/android/AHardwareBufferUtils.h +23 -0
- package/cpp/skia/include/android/GrAHardwareBufferUtils.h +2 -0
- package/cpp/skia/include/android/graphite/SurfaceAndroid.h +59 -0
- package/cpp/skia/include/codec/SkAvifDecoder.h +1 -1
- package/cpp/skia/include/codec/SkBmpDecoder.h +1 -1
- package/cpp/skia/include/codec/SkCodec.h +21 -3
- package/cpp/skia/include/codec/SkGifDecoder.h +1 -1
- package/cpp/skia/include/codec/SkIcoDecoder.h +1 -1
- package/cpp/skia/include/codec/SkJpegDecoder.h +1 -1
- package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -1
- package/cpp/skia/include/codec/SkPngDecoder.h +1 -1
- package/cpp/skia/include/codec/SkRawDecoder.h +1 -1
- package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -1
- package/cpp/skia/include/codec/SkWebpDecoder.h +1 -1
- package/cpp/skia/include/config/SkUserConfig.h +3 -1
- package/cpp/skia/include/core/SkCanvas.h +66 -37
- package/cpp/skia/include/core/SkColorFilter.h +5 -2
- package/cpp/skia/include/core/SkContourMeasure.h +1 -0
- package/cpp/skia/include/core/SkDocument.h +1 -0
- package/cpp/skia/include/core/SkFont.h +14 -24
- package/cpp/skia/include/core/SkFontArguments.h +1 -1
- package/cpp/skia/include/core/SkFontMetrics.h +1 -1
- package/cpp/skia/include/core/SkFontMgr.h +0 -7
- package/cpp/skia/include/core/SkGraphics.h +13 -0
- package/cpp/skia/include/core/SkMesh.h +9 -13
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkPathMeasure.h +2 -0
- package/cpp/skia/include/core/SkSerialProcs.h +29 -11
- package/cpp/skia/include/core/SkSize.h +3 -3
- package/cpp/skia/include/core/SkStream.h +3 -13
- package/cpp/skia/include/core/SkSurface.h +6 -3
- package/cpp/skia/include/core/SkSurfaceProps.h +2 -4
- package/cpp/skia/include/core/SkTraceMemoryDump.h +15 -0
- package/cpp/skia/include/core/SkTypeface.h +8 -56
- package/cpp/skia/include/core/SkTypes.h +8 -0
- package/cpp/skia/include/core/SkVertices.h +1 -1
- package/cpp/skia/include/docs/SkMultiPictureDocument.h +53 -0
- package/cpp/skia/include/docs/SkPDFDocument.h +11 -0
- package/cpp/skia/include/effects/SkGradientShader.h +9 -0
- package/cpp/skia/include/effects/SkRuntimeEffect.h +3 -7
- package/cpp/skia/include/gpu/GrBackendSemaphore.h +33 -47
- package/cpp/skia/include/gpu/GrBackendSurface.h +2 -3
- package/cpp/skia/include/gpu/GrContextOptions.h +0 -6
- package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +44 -28
- package/cpp/skia/include/gpu/GrDirectContext.h +12 -31
- package/cpp/skia/include/gpu/GrTypes.h +1 -16
- package/cpp/skia/include/gpu/MutableTextureState.h +35 -80
- package/cpp/skia/include/gpu/ShaderErrorHandler.h +11 -1
- package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +2 -2
- package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +3 -2
- package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +20 -0
- package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +30 -0
- package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
- package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -0
- package/cpp/skia/include/gpu/gl/glx/GrGLMakeGLXInterface.h +6 -0
- package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +3 -3
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +39 -27
- package/cpp/skia/include/gpu/graphite/Context.h +39 -13
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +2 -0
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +2 -1
- package/cpp/skia/include/gpu/graphite/Image.h +106 -87
- package/cpp/skia/include/gpu/graphite/Recorder.h +24 -3
- package/cpp/skia/include/gpu/graphite/Surface.h +7 -2
- package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +41 -2
- package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +11 -6
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +1 -2
- package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +6 -6
- package/cpp/skia/include/gpu/mock/GrMockTypes.h +1 -0
- package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
- package/cpp/skia/include/gpu/vk/GrVkTypes.h +1 -44
- package/cpp/skia/include/gpu/vk/VulkanExtensions.h +1 -1
- package/cpp/skia/include/gpu/vk/VulkanMutableTextureState.h +25 -0
- package/cpp/skia/include/gpu/vk/VulkanTypes.h +44 -0
- package/cpp/skia/include/ports/SkFontConfigInterface.h +3 -6
- package/cpp/skia/include/private/SkEncodedInfo.h +5 -0
- package/cpp/skia/include/private/SkExif.h +102 -0
- package/cpp/skia/include/private/SkGainmapInfo.h +11 -1
- package/cpp/skia/include/private/base/SkAssert.h +16 -0
- package/cpp/skia/include/private/base/SkDeque.h +2 -7
- package/cpp/skia/include/private/base/SkLoadUserConfig.h +1 -1
- package/cpp/skia/include/private/base/SkTArray.h +69 -28
- package/cpp/skia/include/private/base/SkThreadAnnotations.h +18 -5
- package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +26 -30
- package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +4 -3
- package/cpp/skia/include/private/chromium/SkImageChromium.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +8 -6
- package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +29 -0
- package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +12 -9
- package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +16 -11
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_platform.h +2 -2
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +312 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +77 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +446 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +67 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +36 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +9 -2
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +31 -3
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +10624 -5716
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +2 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +2 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +28 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +2 -1
- package/cpp/skia/include/utils/mac/SkCGUtils.h +23 -11
- package/cpp/skia/modules/skcms/skcms.h +2 -410
- package/cpp/skia/modules/skcms/src/Transform_inl.h +831 -704
- package/cpp/skia/modules/skcms/src/skcms_Transform.h +161 -0
- package/cpp/skia/modules/skcms/src/skcms_internals.h +136 -0
- package/cpp/skia/modules/skcms/src/skcms_public.h +404 -0
- package/cpp/skia/modules/skparagraph/include/FontArguments.h +1 -1
- package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -0
- package/cpp/skia/modules/skparagraph/include/Paragraph.h +2 -2
- package/cpp/skia/modules/skparagraph/include/TextStyle.h +4 -3
- package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -3
- package/cpp/skia/modules/skresources/include/SkResources.h +28 -17
- package/cpp/skia/modules/skunicode/include/SkUnicode.h +12 -0
- package/cpp/skia/modules/svg/include/SkSVGDOM.h +4 -1
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +4 -1
- package/cpp/skia/src/base/SkUTF.h +7 -0
- package/cpp/skia/src/core/SkTHash.h +20 -8
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +5 -3
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +60 -57
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.js +47 -0
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/index.d.ts +1 -0
- package/lib/commonjs/dom/nodes/drawings/index.js +13 -0
- package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +7 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.d.ts +1 -0
- package/lib/commonjs/dom/types/NodeType.js +1 -0
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.d.ts +2 -1
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/external/reanimated/buffers.d.ts +5 -0
- package/lib/commonjs/external/reanimated/buffers.js +48 -0
- package/lib/commonjs/external/reanimated/buffers.js.map +1 -0
- package/lib/commonjs/external/reanimated/index.d.ts +2 -0
- package/lib/commonjs/external/reanimated/index.js +26 -0
- package/lib/commonjs/external/reanimated/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/interpolators.js +13 -1
- package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
- package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +1 -0
- package/lib/commonjs/external/reanimated/moduleWrapper.js +5 -3
- package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/commonjs/external/reanimated/textures.d.ts +5 -0
- package/lib/commonjs/external/reanimated/textures.js +38 -0
- package/lib/commonjs/external/reanimated/textures.js.map +1 -0
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +8 -1
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/commonjs/headless/index.js +1 -1
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +8 -0
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +1 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.d.ts +1 -1
- package/lib/commonjs/renderer/Container.js +2 -1
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +3 -1
- package/lib/commonjs/renderer/HostComponents.js +3 -0
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/Offscreen.d.ts +4 -1
- package/lib/commonjs/renderer/Offscreen.js +28 -10
- package/lib/commonjs/renderer/Offscreen.js.map +1 -1
- package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
- package/lib/commonjs/renderer/Reconciler.js +7 -4
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Atlas.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Atlas.js +17 -0
- package/lib/commonjs/renderer/components/shapes/Atlas.js.map +1 -0
- package/lib/commonjs/renderer/components/shapes/index.d.ts +1 -0
- package/lib/commonjs/renderer/components/shapes/index.js +13 -0
- package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
- package/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/commonjs/skia/core/AnimatedImage.js +4 -1
- package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
- package/lib/commonjs/skia/core/Data.d.ts +1 -1
- package/lib/commonjs/skia/core/Data.js +11 -4
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Rect.d.ts +2 -2
- package/lib/commonjs/skia/types/Canvas.d.ts +16 -1
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.d.ts +8 -0
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +2 -2
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
- package/lib/commonjs/skia/types/RSXform.d.ts +7 -1
- package/lib/commonjs/skia/types/RSXform.js.map +1 -1
- package/lib/commonjs/skia/types/Rect.d.ts +4 -0
- package/lib/commonjs/skia/types/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.d.ts +3 -2
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +2 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +19 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +8 -2
- package/lib/commonjs/skia/web/JsiSkRSXform.js +33 -2
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.d.ts +3 -2
- package/lib/commonjs/skia/web/JsiSkRect.js +7 -0
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +2 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +5 -0
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +5 -3
- package/lib/module/dom/nodes/JsiSkDOM.js +61 -57
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/drawings/AtlasNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/AtlasNode.js +34 -0
- package/lib/module/dom/nodes/drawings/AtlasNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/index.d.ts +1 -0
- package/lib/module/dom/nodes/drawings/index.js +1 -0
- package/lib/module/dom/nodes/drawings/index.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +7 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/dom/types/NodeType.d.ts +1 -0
- package/lib/module/dom/types/NodeType.js +1 -0
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/dom/types/SkDOM.d.ts +2 -1
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/external/reanimated/buffers.d.ts +5 -0
- package/lib/module/external/reanimated/buffers.js +27 -0
- package/lib/module/external/reanimated/buffers.js.map +1 -0
- package/lib/module/external/reanimated/index.d.ts +2 -0
- package/lib/module/external/reanimated/index.js +2 -0
- package/lib/module/external/reanimated/index.js.map +1 -1
- package/lib/module/external/reanimated/interpolators.js +13 -1
- package/lib/module/external/reanimated/interpolators.js.map +1 -1
- package/lib/module/external/reanimated/moduleWrapper.d.ts +1 -0
- package/lib/module/external/reanimated/moduleWrapper.js +3 -2
- package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/module/external/reanimated/textures.d.ts +5 -0
- package/lib/module/external/reanimated/textures.js +24 -0
- package/lib/module/external/reanimated/textures.js.map +1 -0
- package/lib/module/external/reanimated/useAnimatedImageValue.js +7 -1
- package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/module/headless/index.js +1 -1
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/mock/index.js +8 -0
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +1 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.d.ts +1 -1
- package/lib/module/renderer/Container.js +2 -1
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +3 -1
- package/lib/module/renderer/HostComponents.js +3 -0
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/Offscreen.d.ts +4 -1
- package/lib/module/renderer/Offscreen.js +19 -9
- package/lib/module/renderer/Offscreen.js.map +1 -1
- package/lib/module/renderer/Reconciler.d.ts +1 -1
- package/lib/module/renderer/Reconciler.js +7 -4
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/renderer/components/shapes/Atlas.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Atlas.js +5 -0
- package/lib/module/renderer/components/shapes/Atlas.js.map +1 -0
- package/lib/module/renderer/components/shapes/index.d.ts +1 -0
- package/lib/module/renderer/components/shapes/index.js +1 -0
- package/lib/module/renderer/components/shapes/index.js.map +1 -1
- package/lib/module/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/module/skia/core/AnimatedImage.js +4 -1
- package/lib/module/skia/core/AnimatedImage.js.map +1 -1
- package/lib/module/skia/core/Data.d.ts +1 -1
- package/lib/module/skia/core/Data.js +11 -4
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Rect.d.ts +2 -2
- package/lib/module/skia/types/Canvas.d.ts +16 -1
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Image/Image.d.ts +8 -0
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +2 -2
- package/lib/module/skia/types/Matrix4.js.map +1 -1
- package/lib/module/skia/types/RSXform.d.ts +7 -1
- package/lib/module/skia/types/RSXform.js.map +1 -1
- package/lib/module/skia/types/Rect.d.ts +4 -0
- package/lib/module/skia/types/Rect.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/types/Skia.d.ts +3 -2
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +2 -1
- package/lib/module/skia/web/JsiSkCanvas.js +18 -0
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.d.ts +8 -2
- package/lib/module/skia/web/JsiSkRSXform.js +34 -3
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.d.ts +3 -2
- package/lib/module/skia/web/JsiSkRect.js +7 -0
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js +2 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +5 -0
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +5 -3
- package/lib/typescript/src/dom/nodes/drawings/AtlasNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/index.d.ts +1 -0
- package/lib/typescript/src/dom/types/Drawings.d.ts +7 -1
- package/lib/typescript/src/dom/types/NodeType.d.ts +1 -0
- package/lib/typescript/src/dom/types/SkDOM.d.ts +2 -1
- package/lib/typescript/src/external/reanimated/buffers.d.ts +5 -0
- package/lib/typescript/src/external/reanimated/index.d.ts +2 -0
- package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +1 -0
- package/lib/typescript/src/external/reanimated/textures.d.ts +5 -0
- package/lib/typescript/src/renderer/Container.d.ts +1 -1
- package/lib/typescript/src/renderer/HostComponents.d.ts +3 -1
- package/lib/typescript/src/renderer/Offscreen.d.ts +4 -1
- package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/Atlas.d.ts +4 -0
- package/lib/typescript/src/renderer/components/shapes/index.d.ts +1 -0
- package/lib/typescript/src/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/typescript/src/skia/core/Data.d.ts +1 -1
- package/lib/typescript/src/skia/core/Rect.d.ts +2 -2
- package/lib/typescript/src/skia/types/Canvas.d.ts +16 -1
- package/lib/typescript/src/skia/types/Image/Image.d.ts +8 -0
- package/lib/typescript/src/skia/types/Matrix4.d.ts +2 -2
- package/lib/typescript/src/skia/types/RSXform.d.ts +7 -1
- package/lib/typescript/src/skia/types/Rect.d.ts +4 -0
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/typescript/src/skia/types/Skia.d.ts +3 -2
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +2 -1
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -2
- package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -2
- 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/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/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/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/Info.plist +5 -5
- 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/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 +1 -1
- package/src/dom/nodes/JsiSkDOM.ts +63 -56
- package/src/dom/nodes/drawings/AtlasNode.ts +24 -0
- package/src/dom/nodes/drawings/index.ts +1 -0
- package/src/dom/types/Drawings.ts +9 -0
- package/src/dom/types/NodeType.ts +1 -0
- package/src/dom/types/SkDOM.ts +2 -0
- package/src/external/reanimated/buffers.ts +53 -0
- package/src/external/reanimated/index.ts +2 -0
- package/src/external/reanimated/interpolators.ts +15 -2
- package/src/external/reanimated/moduleWrapper.ts +1 -0
- package/src/external/reanimated/textures.tsx +38 -0
- package/src/external/reanimated/useAnimatedImageValue.ts +15 -4
- package/src/headless/index.ts +1 -1
- package/src/mock/index.ts +8 -0
- package/src/renderer/Canvas.tsx +1 -1
- package/src/renderer/Container.tsx +3 -2
- package/src/renderer/HostComponents.ts +6 -1
- package/src/renderer/Offscreen.tsx +24 -11
- package/src/renderer/Reconciler.tsx +5 -2
- package/src/renderer/components/shapes/Atlas.tsx +8 -0
- package/src/renderer/components/shapes/index.ts +1 -0
- package/src/skia/core/AnimatedImage.ts +3 -2
- package/src/skia/core/Data.ts +8 -4
- package/src/skia/types/Canvas.ts +32 -1
- package/src/skia/types/Image/Image.ts +10 -0
- package/src/skia/types/Matrix4.ts +2 -2
- package/src/skia/types/RSXform.ts +7 -1
- package/src/skia/types/Rect.ts +6 -0
- package/src/skia/types/Shader/Shader.ts +6 -1
- package/src/skia/types/Skia.ts +10 -2
- package/src/skia/web/JsiSkCanvas.ts +60 -23
- package/src/skia/web/JsiSkRSXform.ts +28 -4
- package/src/skia/web/JsiSkRect.ts +12 -2
- package/src/skia/web/JsiSkTextBlobFactory.ts +5 -5
- package/src/skia/web/JsiSkia.ts +15 -0
- package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -142
- package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +0 -107
- package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +0 -32
- package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +0 -83
- package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +0 -47
- package/cpp/skia/include/private/gpu/vk/VulkanTypesPriv.h +0 -57
- package/cpp/skia/include/utils/SkBase64.h +0 -53
- package/cpp/skia/modules/skcms/skcms_internal.h +0 -56
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["SkDOM.ts"],"sourcesContent":["import type { ChildrenProps, GroupProps, PaintProps } from \"./Common\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n DisplacementMapImageFilterProps,\n MorphologyImageFilterProps,\n BlendProps,\n} from \"./ImageFilters\";\nimport type { DeclarationNode, RenderNode } from \"./Node\";\nimport type {\n BlendColorFilterProps,\n MatrixColorFilterProps,\n LerpColorFilterProps,\n} from \"./ColorFilters\";\nimport type {\n ImageProps,\n CircleProps,\n PathProps,\n LineProps,\n OvalProps,\n PatchProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n VerticesProps,\n TextProps,\n DiffRectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n DrawingNodeProps,\n BoxProps,\n BoxShadowProps,\n} from \"./Drawings\";\nimport type { BlurMaskFilterProps } from \"./MaskFilters\";\nimport type {\n FractalNoiseProps,\n SweepGradientProps,\n ImageShaderProps,\n LinearGradientProps,\n ShaderProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n RadialGradientProps,\n ColorProps,\n} from \"./Shaders\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"./PathEffects\";\nimport type { ParagraphProps } from \"./Paragraph\";\n\ntype ImageFilterNode<P> = DeclarationNode<P>;\n\ntype PathEffectNode<P> = DeclarationNode<P>;\ntype NullablePathEffectNode<P> = DeclarationNode<P>;\n\ntype DrawingNode<P extends GroupProps> = RenderNode<P>;\n\nexport interface SkDOM {\n Layer(props?: ChildrenProps): RenderNode<ChildrenProps>;\n Group(props?: GroupProps): RenderNode<GroupProps>;\n Paint(props: PaintProps): DeclarationNode<PaintProps>;\n\n // Drawings\n Fill(props?: DrawingNodeProps): DrawingNode<DrawingNodeProps>;\n Image(props: ImageProps): DrawingNode<ImageProps>;\n Circle(props: CircleProps): DrawingNode<CircleProps>;\n Path(props: PathProps): DrawingNode<PathProps>;\n Line(props: LineProps): DrawingNode<LineProps>;\n Oval(props: OvalProps): DrawingNode<OvalProps>;\n Patch(props: PatchProps): DrawingNode<PatchProps>;\n Points(props: PointsProps): DrawingNode<PointsProps>;\n Rect(props: RectProps): DrawingNode<RectProps>;\n RRect(props: RoundedRectProps): DrawingNode<RoundedRectProps>;\n Vertices(props: VerticesProps): DrawingNode<VerticesProps>;\n Text(props: TextProps): DrawingNode<TextProps>;\n TextPath(props: TextPathProps): DrawingNode<TextPathProps>;\n TextBlob(props: TextBlobProps): DrawingNode<TextBlobProps>;\n Glyphs(props: GlyphsProps): DrawingNode<GlyphsProps>;\n DiffRect(props: DiffRectProps): DrawingNode<DiffRectProps>;\n Picture(props: PictureProps): DrawingNode<PictureProps>;\n ImageSVG(props: ImageSVGProps): DrawingNode<ImageSVGProps>;\n\n // BlurMaskFilters\n BlurMaskFilter(\n props: BlurMaskFilterProps\n ): DeclarationNode<BlurMaskFilterProps>;\n\n // ImageFilters\n BlendImageFilter(\n props: BlendImageFilterProps\n ): ImageFilterNode<BlendImageFilterProps>;\n BlurImageFilter(\n props: BlurImageFilterProps\n ): ImageFilterNode<BlurImageFilterProps>;\n OffsetImageFilter(\n props: OffsetImageFilterProps\n ): ImageFilterNode<OffsetImageFilterProps>;\n DropShadowImageFilter(\n props: DropShadowImageFilterProps\n ): ImageFilterNode<DropShadowImageFilterProps>;\n MorphologyImageFilter(\n props: MorphologyImageFilterProps\n ): ImageFilterNode<MorphologyImageFilterProps>;\n DisplacementMapImageFilter(\n props: DisplacementMapImageFilterProps\n ): ImageFilterNode<DisplacementMapImageFilterProps>;\n RuntimeShaderImageFilter(\n props: RuntimeShaderImageFilterProps\n ): ImageFilterNode<RuntimeShaderImageFilterProps>;\n\n // ColorFilters\n MatrixColorFilter(\n props: MatrixColorFilterProps\n ): DeclarationNode<MatrixColorFilterProps>;\n BlendColorFilter(\n props: BlendColorFilterProps\n ): DeclarationNode<BlendColorFilterProps>;\n LumaColorFilter(): DeclarationNode<null>;\n LinearToSRGBGammaColorFilter(): DeclarationNode<null>;\n SRGBToLinearGammaColorFilter(): DeclarationNode<null>;\n LerpColorFilter(\n props: LerpColorFilterProps\n ): DeclarationNode<LerpColorFilterProps>;\n\n // Shaders\n Shader(props: ShaderProps): DeclarationNode<ShaderProps>;\n ImageShader(props: ImageShaderProps): DeclarationNode<ImageShaderProps>;\n ColorShader(props: ColorProps): DeclarationNode<ColorProps>;\n Turbulence(props: TurbulenceProps): DeclarationNode<TurbulenceProps>;\n FractalNoise(props: FractalNoiseProps): DeclarationNode<FractalNoiseProps>;\n LinearGradient(\n props: LinearGradientProps\n ): DeclarationNode<LinearGradientProps>;\n RadialGradient(\n props: RadialGradientProps\n ): DeclarationNode<RadialGradientProps>;\n SweepGradient(props: SweepGradientProps): DeclarationNode<SweepGradientProps>;\n TwoPointConicalGradient(\n props: TwoPointConicalGradientProps\n ): DeclarationNode<TwoPointConicalGradientProps>;\n\n // Path Effects\n CornerPathEffect(\n props: CornerPathEffectProps\n ): NullablePathEffectNode<CornerPathEffectProps>;\n DiscretePathEffect(\n props: DiscretePathEffectProps\n ): PathEffectNode<DiscretePathEffectProps>;\n DashPathEffect(\n props: DashPathEffectProps\n ): PathEffectNode<DashPathEffectProps>;\n Path1DPathEffect(\n props: Path1DPathEffectProps\n ): NullablePathEffectNode<Path1DPathEffectProps>;\n Path2DPathEffect(\n props: Path2DPathEffectProps\n ): NullablePathEffectNode<Path2DPathEffectProps>;\n SumPathEffect(): NullablePathEffectNode<null>;\n Line2DPathEffect(\n props: Line2DPathEffectProps\n ): NullablePathEffectNode<Line2DPathEffectProps>;\n\n // Mixed\n Blend(props: BlendProps): DeclarationNode<BlendProps>;\n BackdropFilter(props: ChildrenProps): RenderNode<ChildrenProps>;\n Box(props: BoxProps): RenderNode<BoxProps>;\n BoxShadow(props: BoxShadowProps): DeclarationNode<BoxShadowProps>;\n\n // Paragraph\n Paragraph(props: ParagraphProps): RenderNode<ParagraphProps>;\n}\n"],"mappings":""}
|
1
|
+
{"version":3,"names":[],"sources":["SkDOM.ts"],"sourcesContent":["import type { ChildrenProps, GroupProps, PaintProps } from \"./Common\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n DisplacementMapImageFilterProps,\n MorphologyImageFilterProps,\n BlendProps,\n} from \"./ImageFilters\";\nimport type { DeclarationNode, RenderNode } from \"./Node\";\nimport type {\n BlendColorFilterProps,\n MatrixColorFilterProps,\n LerpColorFilterProps,\n} from \"./ColorFilters\";\nimport type {\n ImageProps,\n CircleProps,\n PathProps,\n LineProps,\n OvalProps,\n PatchProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n VerticesProps,\n TextProps,\n DiffRectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n DrawingNodeProps,\n BoxProps,\n BoxShadowProps,\n AtlasProps,\n} from \"./Drawings\";\nimport type { BlurMaskFilterProps } from \"./MaskFilters\";\nimport type {\n FractalNoiseProps,\n SweepGradientProps,\n ImageShaderProps,\n LinearGradientProps,\n ShaderProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n RadialGradientProps,\n ColorProps,\n} from \"./Shaders\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"./PathEffects\";\nimport type { ParagraphProps } from \"./Paragraph\";\n\ntype ImageFilterNode<P> = DeclarationNode<P>;\n\ntype PathEffectNode<P> = DeclarationNode<P>;\ntype NullablePathEffectNode<P> = DeclarationNode<P>;\n\ntype DrawingNode<P extends GroupProps> = RenderNode<P>;\n\nexport interface SkDOM {\n Layer(props?: ChildrenProps): RenderNode<ChildrenProps>;\n Group(props?: GroupProps): RenderNode<GroupProps>;\n Paint(props: PaintProps): DeclarationNode<PaintProps>;\n\n // Drawings\n Fill(props?: DrawingNodeProps): DrawingNode<DrawingNodeProps>;\n Image(props: ImageProps): DrawingNode<ImageProps>;\n Circle(props: CircleProps): DrawingNode<CircleProps>;\n Path(props: PathProps): DrawingNode<PathProps>;\n Line(props: LineProps): DrawingNode<LineProps>;\n Oval(props: OvalProps): DrawingNode<OvalProps>;\n Patch(props: PatchProps): DrawingNode<PatchProps>;\n Points(props: PointsProps): DrawingNode<PointsProps>;\n Rect(props: RectProps): DrawingNode<RectProps>;\n RRect(props: RoundedRectProps): DrawingNode<RoundedRectProps>;\n Vertices(props: VerticesProps): DrawingNode<VerticesProps>;\n Text(props: TextProps): DrawingNode<TextProps>;\n TextPath(props: TextPathProps): DrawingNode<TextPathProps>;\n TextBlob(props: TextBlobProps): DrawingNode<TextBlobProps>;\n Glyphs(props: GlyphsProps): DrawingNode<GlyphsProps>;\n DiffRect(props: DiffRectProps): DrawingNode<DiffRectProps>;\n Picture(props: PictureProps): DrawingNode<PictureProps>;\n ImageSVG(props: ImageSVGProps): DrawingNode<ImageSVGProps>;\n Atlas(props: AtlasProps): DrawingNode<AtlasProps>;\n\n // BlurMaskFilters\n BlurMaskFilter(\n props: BlurMaskFilterProps\n ): DeclarationNode<BlurMaskFilterProps>;\n\n // ImageFilters\n BlendImageFilter(\n props: BlendImageFilterProps\n ): ImageFilterNode<BlendImageFilterProps>;\n BlurImageFilter(\n props: BlurImageFilterProps\n ): ImageFilterNode<BlurImageFilterProps>;\n OffsetImageFilter(\n props: OffsetImageFilterProps\n ): ImageFilterNode<OffsetImageFilterProps>;\n DropShadowImageFilter(\n props: DropShadowImageFilterProps\n ): ImageFilterNode<DropShadowImageFilterProps>;\n MorphologyImageFilter(\n props: MorphologyImageFilterProps\n ): ImageFilterNode<MorphologyImageFilterProps>;\n DisplacementMapImageFilter(\n props: DisplacementMapImageFilterProps\n ): ImageFilterNode<DisplacementMapImageFilterProps>;\n RuntimeShaderImageFilter(\n props: RuntimeShaderImageFilterProps\n ): ImageFilterNode<RuntimeShaderImageFilterProps>;\n\n // ColorFilters\n MatrixColorFilter(\n props: MatrixColorFilterProps\n ): DeclarationNode<MatrixColorFilterProps>;\n BlendColorFilter(\n props: BlendColorFilterProps\n ): DeclarationNode<BlendColorFilterProps>;\n LumaColorFilter(): DeclarationNode<null>;\n LinearToSRGBGammaColorFilter(): DeclarationNode<null>;\n SRGBToLinearGammaColorFilter(): DeclarationNode<null>;\n LerpColorFilter(\n props: LerpColorFilterProps\n ): DeclarationNode<LerpColorFilterProps>;\n\n // Shaders\n Shader(props: ShaderProps): DeclarationNode<ShaderProps>;\n ImageShader(props: ImageShaderProps): DeclarationNode<ImageShaderProps>;\n ColorShader(props: ColorProps): DeclarationNode<ColorProps>;\n Turbulence(props: TurbulenceProps): DeclarationNode<TurbulenceProps>;\n FractalNoise(props: FractalNoiseProps): DeclarationNode<FractalNoiseProps>;\n LinearGradient(\n props: LinearGradientProps\n ): DeclarationNode<LinearGradientProps>;\n RadialGradient(\n props: RadialGradientProps\n ): DeclarationNode<RadialGradientProps>;\n SweepGradient(props: SweepGradientProps): DeclarationNode<SweepGradientProps>;\n TwoPointConicalGradient(\n props: TwoPointConicalGradientProps\n ): DeclarationNode<TwoPointConicalGradientProps>;\n\n // Path Effects\n CornerPathEffect(\n props: CornerPathEffectProps\n ): NullablePathEffectNode<CornerPathEffectProps>;\n DiscretePathEffect(\n props: DiscretePathEffectProps\n ): PathEffectNode<DiscretePathEffectProps>;\n DashPathEffect(\n props: DashPathEffectProps\n ): PathEffectNode<DashPathEffectProps>;\n Path1DPathEffect(\n props: Path1DPathEffectProps\n ): NullablePathEffectNode<Path1DPathEffectProps>;\n Path2DPathEffect(\n props: Path2DPathEffectProps\n ): NullablePathEffectNode<Path2DPathEffectProps>;\n SumPathEffect(): NullablePathEffectNode<null>;\n Line2DPathEffect(\n props: Line2DPathEffectProps\n ): NullablePathEffectNode<Line2DPathEffectProps>;\n\n // Mixed\n Blend(props: BlendProps): DeclarationNode<BlendProps>;\n BackdropFilter(props: ChildrenProps): RenderNode<ChildrenProps>;\n Box(props: BoxProps): RenderNode<BoxProps>;\n BoxShadow(props: BoxShadowProps): DeclarationNode<BoxShadowProps>;\n\n // Paragraph\n Paragraph(props: ParagraphProps): RenderNode<ParagraphProps>;\n}\n"],"mappings":""}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { SkColor, SkHostRect, SkPoint, SkRSXform } from "../../skia/types";
|
2
|
+
export declare const useRectBuffer: (size: number, modifier: (input: SkHostRect, index: number) => void) => import("react-native-reanimated").SharedValue<SkHostRect[]>;
|
3
|
+
export declare const useRSXformBuffer: (size: number, modifier: (input: SkRSXform, index: number) => void) => import("react-native-reanimated").SharedValue<SkRSXform[]>;
|
4
|
+
export declare const usePointBuffer: (size: number, modifier: (input: SkPoint, index: number) => void) => import("react-native-reanimated").SharedValue<SkPoint[]>;
|
5
|
+
export declare const useColorBuffer: (size: number, modifier: (input: SkColor, index: number) => void) => import("react-native-reanimated").SharedValue<Float32Array[]>;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { useMemo } from "react";
|
2
|
+
import { Skia } from "../../skia";
|
3
|
+
import { useDerivedValue, useSharedValue } from "./moduleWrapper";
|
4
|
+
import { notifyChange } from "./interpolators";
|
5
|
+
|
6
|
+
const useBuffer = (size, bufferInitializer, modifier) => {
|
7
|
+
const buffer = useMemo(() => new Array(size).fill(0).map(bufferInitializer), // eslint-disable-next-line react-hooks/exhaustive-deps
|
8
|
+
[size]);
|
9
|
+
const transforms = useSharedValue(buffer);
|
10
|
+
useDerivedValue(() => {
|
11
|
+
buffer.forEach((val, index) => {
|
12
|
+
modifier(val, index);
|
13
|
+
}); // Assuming notifyChange is a function that notifies about the change in transforms.
|
14
|
+
|
15
|
+
notifyChange(transforms);
|
16
|
+
});
|
17
|
+
return transforms;
|
18
|
+
};
|
19
|
+
|
20
|
+
export const useRectBuffer = (size, modifier) => useBuffer(size, () => Skia.XYWHRect(0, 0, 0, 0), modifier); // Usage for RSXform Buffer
|
21
|
+
|
22
|
+
export const useRSXformBuffer = (size, modifier) => useBuffer(size, () => Skia.RSXform(1, 0, 0, 0), modifier); // Usage for Point Buffer
|
23
|
+
|
24
|
+
export const usePointBuffer = (size, modifier) => useBuffer(size, () => Skia.Point(0, 0), modifier); // Usage for Color Buffer
|
25
|
+
|
26
|
+
export const useColorBuffer = (size, modifier) => useBuffer(size, () => Skia.Color("black"), modifier);
|
27
|
+
//# sourceMappingURL=buffers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["useMemo","Skia","useDerivedValue","useSharedValue","notifyChange","useBuffer","size","bufferInitializer","modifier","buffer","Array","fill","map","transforms","forEach","val","index","useRectBuffer","XYWHRect","useRSXformBuffer","RSXform","usePointBuffer","Point","useColorBuffer","Color"],"sources":["buffers.ts"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport type { SkColor, SkHostRect, SkPoint, SkRSXform } from \"../../skia/types\";\nimport { Skia } from \"../../skia\";\n\nimport { useDerivedValue, useSharedValue } from \"./moduleWrapper\";\nimport { notifyChange } from \"./interpolators\";\n\nconst useBuffer = <T>(\n size: number,\n bufferInitializer: () => T,\n modifier: (input: T, index: number) => void\n) => {\n const buffer = useMemo(\n () => new Array(size).fill(0).map(bufferInitializer),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [size]\n );\n const transforms = useSharedValue(buffer);\n\n useDerivedValue(() => {\n buffer.forEach((val, index) => {\n modifier(val, index);\n });\n // Assuming notifyChange is a function that notifies about the change in transforms.\n notifyChange(transforms);\n });\n\n return transforms;\n};\n\nexport const useRectBuffer = (\n size: number,\n modifier: (input: SkHostRect, index: number) => void\n) => useBuffer(size, () => Skia.XYWHRect(0, 0, 0, 0), modifier);\n\n// Usage for RSXform Buffer\nexport const useRSXformBuffer = (\n size: number,\n modifier: (input: SkRSXform, index: number) => void\n) => useBuffer(size, () => Skia.RSXform(1, 0, 0, 0), modifier);\n\n// Usage for Point Buffer\nexport const usePointBuffer = (\n size: number,\n modifier: (input: SkPoint, index: number) => void\n) => useBuffer(size, () => Skia.Point(0, 0), modifier);\n\n// Usage for Color Buffer\nexport const useColorBuffer = (\n size: number,\n modifier: (input: SkColor, index: number) => void\n) => useBuffer(size, () => Skia.Color(\"black\"), modifier);\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAGA,SAASC,IAAT,QAAqB,YAArB;AAEA,SAASC,eAAT,EAA0BC,cAA1B,QAAgD,iBAAhD;AACA,SAASC,YAAT,QAA6B,iBAA7B;;AAEA,MAAMC,SAAS,GAAG,CAChBC,IADgB,EAEhBC,iBAFgB,EAGhBC,QAHgB,KAIb;EACH,MAAMC,MAAM,GAAGT,OAAO,CACpB,MAAM,IAAIU,KAAJ,CAAUJ,IAAV,EAAgBK,IAAhB,CAAqB,CAArB,EAAwBC,GAAxB,CAA4BL,iBAA5B,CADc,EAEpB;EACA,CAACD,IAAD,CAHoB,CAAtB;EAKA,MAAMO,UAAU,GAAGV,cAAc,CAACM,MAAD,CAAjC;EAEAP,eAAe,CAAC,MAAM;IACpBO,MAAM,CAACK,OAAP,CAAe,CAACC,GAAD,EAAMC,KAAN,KAAgB;MAC7BR,QAAQ,CAACO,GAAD,EAAMC,KAAN,CAAR;IACD,CAFD,EADoB,CAIpB;;IACAZ,YAAY,CAACS,UAAD,CAAZ;EACD,CANc,CAAf;EAQA,OAAOA,UAAP;AACD,CArBD;;AAuBA,OAAO,MAAMI,aAAa,GAAG,CAC3BX,IAD2B,EAE3BE,QAF2B,KAGxBH,SAAS,CAACC,IAAD,EAAO,MAAML,IAAI,CAACiB,QAAL,CAAc,CAAd,EAAiB,CAAjB,EAAoB,CAApB,EAAuB,CAAvB,CAAb,EAAwCV,QAAxC,CAHP,C,CAKP;;AACA,OAAO,MAAMW,gBAAgB,GAAG,CAC9Bb,IAD8B,EAE9BE,QAF8B,KAG3BH,SAAS,CAACC,IAAD,EAAO,MAAML,IAAI,CAACmB,OAAL,CAAa,CAAb,EAAgB,CAAhB,EAAmB,CAAnB,EAAsB,CAAtB,CAAb,EAAuCZ,QAAvC,CAHP,C,CAKP;;AACA,OAAO,MAAMa,cAAc,GAAG,CAC5Bf,IAD4B,EAE5BE,QAF4B,KAGzBH,SAAS,CAACC,IAAD,EAAO,MAAML,IAAI,CAACqB,KAAL,CAAW,CAAX,EAAc,CAAd,CAAb,EAA+Bd,QAA/B,CAHP,C,CAKP;;AACA,OAAO,MAAMe,cAAc,GAAG,CAC5BjB,IAD4B,EAE5BE,QAF4B,KAGzBH,SAAS,CAACC,IAAD,EAAO,MAAML,IAAI,CAACuB,KAAL,CAAW,OAAX,CAAb,EAAkChB,QAAlC,CAHP"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useAnimatedImageValue\";\nexport * from \"./useDerivedValueOnJS\";\nexport * from \"./renderHelpers\";\nexport * from \"./interpolators\";\n"],"mappings":"AAAA,cAAc,yBAAd;AACA,cAAc,uBAAd;AACA,cAAc,iBAAd;AACA,cAAc,iBAAd"}
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useAnimatedImageValue\";\nexport * from \"./useDerivedValueOnJS\";\nexport * from \"./renderHelpers\";\nexport * from \"./interpolators\";\nexport * from \"./textures\";\nexport * from \"./buffers\";\n"],"mappings":"AAAA,cAAc,yBAAd;AACA,cAAc,uBAAd;AACA,cAAc,iBAAd;AACA,cAAc,iBAAd;AACA,cAAc,YAAd;AACA,cAAc,WAAd"}
|
@@ -46,6 +46,18 @@ const useInterpolator = (factory, value, interpolator, input, output, options) =
|
|
46
46
|
return result;
|
47
47
|
};
|
48
48
|
|
49
|
-
export const usePathInterpolation = (value, input, outputRange, options) =>
|
49
|
+
export const usePathInterpolation = (value, input, outputRange, options) => {
|
50
|
+
// Check if all paths in outputRange are interpolable
|
51
|
+
const allPathsInterpolable = outputRange.slice(1).every(path => outputRange[0].isInterpolatable(path));
|
52
|
+
|
53
|
+
if (!allPathsInterpolable) {
|
54
|
+
// Handle the case where not all paths are interpolable
|
55
|
+
// For example, throw an error or return early
|
56
|
+
throw new Error(`Not all paths in the output range are interpolable.
|
57
|
+
See: https://shopify.github.io/react-native-skia/docs/animations/hooks#usepathinterpolation`);
|
58
|
+
}
|
59
|
+
|
60
|
+
return useInterpolator(() => Skia.Path.Make(), value, interpolatePaths, input, outputRange, options);
|
61
|
+
};
|
50
62
|
export const useVectorInterpolation = (value, input, outputRange, options) => useInterpolator(() => Skia.Point(0, 0), value, interpolateVector, input, outputRange, options);
|
51
63
|
//# sourceMappingURL=interpolators.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useCallback","useMemo","interpolatePaths","interpolateVector","Skia","Platform","useAnimatedReaction","useFrameCallback","useSharedValue","useDerivedValue","notifyChange","value","_WORKLET","OS","_value","usePathValue","cb","pathInit","Path","Make","path","reset","useClock","clock","callback","info","timeSinceFirstFrame","useInterpolator","factory","interpolator","input","output","options","init","result","val","usePathInterpolation","outputRange","useVectorInterpolation","Point"],"sources":["interpolators.ts"],"sourcesContent":["import type {\n ExtrapolationType,\n FrameInfo,\n SharedValue,\n} from \"react-native-reanimated\";\nimport { useCallback, useMemo } from \"react\";\n\nimport type { SkPath, SkPoint } from \"../../skia/types\";\nimport { interpolatePaths, interpolateVector } from \"../../animation\";\nimport { Skia } from \"../../skia\";\nimport { Platform } from \"../../Platform\";\n\nimport {\n useAnimatedReaction,\n useFrameCallback,\n useSharedValue,\n useDerivedValue,\n} from \"./moduleWrapper\";\n\nexport const notifyChange = (value: SharedValue<unknown>) => {\n \"worklet\";\n if (_WORKLET || Platform.OS === \"web\") {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (value as any)._value = value.value;\n }\n};\n\nexport const usePathValue = (cb: (path: SkPath) => void) => {\n const pathInit = useMemo(() => Skia.Path.Make(), []);\n const path = useSharedValue(pathInit);\n useDerivedValue(() => {\n path.value.reset();\n cb(path.value);\n notifyChange(path);\n });\n return path;\n};\n\nexport const useClock = () => {\n const clock = useSharedValue(0);\n const callback = useCallback(\n (info: FrameInfo) => {\n \"worklet\";\n clock.value = info.timeSinceFirstFrame;\n },\n [clock]\n );\n useFrameCallback(callback);\n return clock;\n};\n\n/**\n * @worklet\n */\ntype Interpolator<T> = (\n value: number,\n input: number[],\n output: T[],\n options: ExtrapolationType,\n result: T\n) => T;\n\nconst useInterpolator = <T>(\n factory: () => T,\n value: SharedValue<number>,\n interpolator: Interpolator<T>,\n input: number[],\n output: T[],\n options?: ExtrapolationType\n) => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const init = useMemo(() => factory(), []);\n const result = useSharedValue(init);\n useAnimatedReaction(\n () => value.value,\n (val) => {\n result.value = interpolator(val, input, output, options, result.value);\n notifyChange(result);\n },\n [input, output, options]\n );\n return result;\n};\n\nexport const usePathInterpolation = (\n value: SharedValue<number>,\n input: number[],\n outputRange: SkPath[],\n options?: ExtrapolationType\n)
|
1
|
+
{"version":3,"names":["useCallback","useMemo","interpolatePaths","interpolateVector","Skia","Platform","useAnimatedReaction","useFrameCallback","useSharedValue","useDerivedValue","notifyChange","value","_WORKLET","OS","_value","usePathValue","cb","pathInit","Path","Make","path","reset","useClock","clock","callback","info","timeSinceFirstFrame","useInterpolator","factory","interpolator","input","output","options","init","result","val","usePathInterpolation","outputRange","allPathsInterpolable","slice","every","isInterpolatable","Error","useVectorInterpolation","Point"],"sources":["interpolators.ts"],"sourcesContent":["import type {\n ExtrapolationType,\n FrameInfo,\n SharedValue,\n} from \"react-native-reanimated\";\nimport { useCallback, useMemo } from \"react\";\n\nimport type { SkPath, SkPoint } from \"../../skia/types\";\nimport { interpolatePaths, interpolateVector } from \"../../animation\";\nimport { Skia } from \"../../skia\";\nimport { Platform } from \"../../Platform\";\n\nimport {\n useAnimatedReaction,\n useFrameCallback,\n useSharedValue,\n useDerivedValue,\n} from \"./moduleWrapper\";\n\nexport const notifyChange = (value: SharedValue<unknown>) => {\n \"worklet\";\n if (_WORKLET || Platform.OS === \"web\") {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (value as any)._value = value.value;\n }\n};\n\nexport const usePathValue = (cb: (path: SkPath) => void) => {\n const pathInit = useMemo(() => Skia.Path.Make(), []);\n const path = useSharedValue(pathInit);\n useDerivedValue(() => {\n path.value.reset();\n cb(path.value);\n notifyChange(path);\n });\n return path;\n};\n\nexport const useClock = () => {\n const clock = useSharedValue(0);\n const callback = useCallback(\n (info: FrameInfo) => {\n \"worklet\";\n clock.value = info.timeSinceFirstFrame;\n },\n [clock]\n );\n useFrameCallback(callback);\n return clock;\n};\n\n/**\n * @worklet\n */\ntype Interpolator<T> = (\n value: number,\n input: number[],\n output: T[],\n options: ExtrapolationType,\n result: T\n) => T;\n\nconst useInterpolator = <T>(\n factory: () => T,\n value: SharedValue<number>,\n interpolator: Interpolator<T>,\n input: number[],\n output: T[],\n options?: ExtrapolationType\n) => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const init = useMemo(() => factory(), []);\n const result = useSharedValue(init);\n useAnimatedReaction(\n () => value.value,\n (val) => {\n result.value = interpolator(val, input, output, options, result.value);\n notifyChange(result);\n },\n [input, output, options]\n );\n return result;\n};\n\nexport const usePathInterpolation = (\n value: SharedValue<number>,\n input: number[],\n outputRange: SkPath[],\n options?: ExtrapolationType\n) => {\n // Check if all paths in outputRange are interpolable\n const allPathsInterpolable = outputRange\n .slice(1)\n .every((path) => outputRange[0].isInterpolatable(path));\n if (!allPathsInterpolable) {\n // Handle the case where not all paths are interpolable\n // For example, throw an error or return early\n throw new Error(\n `Not all paths in the output range are interpolable.\nSee: https://shopify.github.io/react-native-skia/docs/animations/hooks#usepathinterpolation`\n );\n }\n return useInterpolator(\n () => Skia.Path.Make(),\n value,\n interpolatePaths,\n input,\n outputRange,\n options\n );\n};\n\nexport const useVectorInterpolation = (\n value: SharedValue<number>,\n input: number[],\n outputRange: SkPoint[],\n options?: ExtrapolationType\n) =>\n useInterpolator(\n () => Skia.Point(0, 0),\n value,\n interpolateVector,\n input,\n outputRange,\n options\n );\n"],"mappings":"AAKA,SAASA,WAAT,EAAsBC,OAAtB,QAAqC,OAArC;AAGA,SAASC,gBAAT,EAA2BC,iBAA3B,QAAoD,iBAApD;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,QAAT,QAAyB,gBAAzB;AAEA,SACEC,mBADF,EAEEC,gBAFF,EAGEC,cAHF,EAIEC,eAJF,QAKO,iBALP;AAOA,OAAO,MAAMC,YAAY,GAAIC,KAAD,IAAiC;EAC3D;;EACA,IAAIC,QAAQ,IAAIP,QAAQ,CAACQ,EAAT,KAAgB,KAAhC,EAAuC;IACrC;IACCF,KAAD,CAAeG,MAAf,GAAwBH,KAAK,CAACA,KAA9B;EACD;AACF,CANM;AAQP,OAAO,MAAMI,YAAY,GAAIC,EAAD,IAAgC;EAC1D,MAAMC,QAAQ,GAAGhB,OAAO,CAAC,MAAMG,IAAI,CAACc,IAAL,CAAUC,IAAV,EAAP,EAAyB,EAAzB,CAAxB;EACA,MAAMC,IAAI,GAAGZ,cAAc,CAACS,QAAD,CAA3B;EACAR,eAAe,CAAC,MAAM;IACpBW,IAAI,CAACT,KAAL,CAAWU,KAAX;IACAL,EAAE,CAACI,IAAI,CAACT,KAAN,CAAF;IACAD,YAAY,CAACU,IAAD,CAAZ;EACD,CAJc,CAAf;EAKA,OAAOA,IAAP;AACD,CATM;AAWP,OAAO,MAAME,QAAQ,GAAG,MAAM;EAC5B,MAAMC,KAAK,GAAGf,cAAc,CAAC,CAAD,CAA5B;EACA,MAAMgB,QAAQ,GAAGxB,WAAW,CACzByB,IAAD,IAAqB;IACnB;;IACAF,KAA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oB,EAIpB4B,KAJoB,EAKpBO,WALoB,EAMpBL,OANoB,CAAtB;AAQD,CA1BM;AA4BP,OAAO,MAAMW,sBAAsB,GAAG,CACpChC,KADoC,EAEpCmB,KAFoC,EAGpCO,WAHoC,EAIpCL,OAJoC,KAMpCL,eAAe,CACb,MAAMvB,IAAI,CAACwC,KAAL,CAAW,CAAX,EAAc,CAAd,CADO,EAEbjC,KAFa,EAGbR,iBAHa,EAIb2B,KAJa,EAKbO,WALa,EAMbL,OANa,CANV"}
|
@@ -9,5 +9,6 @@ export declare const useFrameCallback: (callback: (frameInfo: FrameInfo) => void
|
|
9
9
|
export declare const startMapper: (worklet: () => void, inputs?: unknown[], outputs?: unknown[]) => number;
|
10
10
|
export declare const stopMapper: (mapperID: number) => void;
|
11
11
|
export declare const runOnJS: any;
|
12
|
+
export declare const runOnUI: any;
|
12
13
|
export declare const useAnimatedReaction: <T>(prepare: () => T, react: (v: T) => void, dependencies?: DependencyList) => void;
|
13
14
|
export declare const isSharedValue: <T>(value: unknown) => value is SharedValue<T>;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _Reanimated, _Reanimated2, _Reanimated3, _Reanimated4, _Reanimated5, _Reanimated6, _Reanimated7;
|
1
|
+
var _Reanimated, _Reanimated2, _Reanimated3, _Reanimated4, _Reanimated5, _Reanimated6, _Reanimated7, _Reanimated8;
|
2
2
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
4
4
|
// This one is needed for the deprecated useSharedValue function
|
@@ -30,7 +30,8 @@ export const useFrameCallback = ((_Reanimated3 = Reanimated2) === null || _Reani
|
|
30
30
|
export const startMapper = ((_Reanimated4 = Reanimated2) === null || _Reanimated4 === void 0 ? void 0 : _Reanimated4.startMapper) || throwOnMissingReanimated;
|
31
31
|
export const stopMapper = ((_Reanimated5 = Reanimated2) === null || _Reanimated5 === void 0 ? void 0 : _Reanimated5.stopMapper) || throwOnMissingReanimated;
|
32
32
|
export const runOnJS = ((_Reanimated6 = Reanimated2) === null || _Reanimated6 === void 0 ? void 0 : _Reanimated6.runOnJS) || throwOnMissingReanimated;
|
33
|
-
export const
|
33
|
+
export const runOnUI = ((_Reanimated7 = Reanimated2) === null || _Reanimated7 === void 0 ? void 0 : _Reanimated7.runOnUI) || throwOnMissingReanimated;
|
34
|
+
export const useAnimatedReaction = ((_Reanimated8 = Reanimated2) === null || _Reanimated8 === void 0 ? void 0 : _Reanimated8.useAnimatedReaction) || throwOnMissingReanimated;
|
34
35
|
export const isSharedValue = value => {
|
35
36
|
return !!value && (Reanimated3 ? Reanimated3.isSharedValue(value) : value.value !== undefined);
|
36
37
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Reanimated2","Reanimated3","reanimatedVersion","require","version","includes","e","HAS_REANIMATED2","HAS_REANIMATED3","throwOnMissingReanimated","Error","useSharedValue","useDerivedValue","useFrameCallback","startMapper","stopMapper","runOnJS","useAnimatedReaction","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;\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,WAAJ;AAEA,IAAIC,WAAJ;AACA,IAAIC,iBAAJ;;AAEA,IAAI;EACFF,WAAW,GAAGG,OAAO,CAAC,yBAAD,CAArB;EACAD,iBAAiB,GAAGC,OAAO,CAAC,sCAAD,CAAP,CAAgDC,OAApE;;EACA,IACEF,iBAAiB,KAChBA,iBAAiB,IAAI,OAArB,IAAgCA,iBAAiB,CAACG,QAAlB,CAA2B,QAA3B,CADhB,CADnB,EAGE;IACAJ,WAAW,GAAGD,WAAd;EACD;AACF,CATD,CASE,OAAOM,CAAP,EAAU,CAAE;;AAEd,OAAO,MAAMC,eAAe,GAAG,CAAC,CAACP,WAA1B;AACP,OAAO,MAAMQ,eAAe,GAAG,CAAC,CAACP,WAA1B;AAEP,OAAO,SAASQ,wBAAT,GAAoC;EACzC,IAAI,CAACF,eAAL,EAAsB;IACpB,MAAM,IAAIG,KAAJ,CACJ;AACN,iDAFU,CAAN;EAID;AACF;AAED,OAAO,MAAMC,cAGM,GAAG,gBAAAX,WAAW,UAAX,kDAAaW,cAAb,KAA+BF,wBAH9C;AAKP,OAAO,MAAMG,eAGO,GAAG,iBAAAZ,WAAW,UAAX,oDAAaY,eAAb,KAAgCH,wBAHhD;AAKP,OAAO,MAAMI,gBAGK,GAAG,iBAAAb,WAAW,UAAX,oDAAaa,gBAAb,KAAiCJ,wBAH/C;AAKP,OAAO,MAAMK,WAIF,GAAG,iBAAAd,WAAW,UAAX,oDAAac,WAAb,KAA4BL,wBAJnC;AAMP,OAAO,MAAMM,UAAsC,GACjD,iBAAAf,WAAW,UAAX,oDAAae,UAAb,KAA2BN,wBADtB;AAGP,OAAO,MAAMO,OAAO,GAAG,iBAAAhB,WAAW,UAAX,oDAAagB,OAAb,KAAwBP,wBAAxC;
|
1
|
+
{"version":3,"names":["Reanimated2","Reanimated3","reanimatedVersion","require","version","includes","e","HAS_REANIMATED2","HAS_REANIMATED3","throwOnMissingReanimated","Error","useSharedValue","useDerivedValue","useFrameCallback","startMapper","stopMapper","runOnJS","runOnUI","useAnimatedReaction","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;\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,WAAJ;AAEA,IAAIC,WAAJ;AACA,IAAIC,iBAAJ;;AAEA,IAAI;EACFF,WAAW,GAAGG,OAAO,CAAC,yBAAD,CAArB;EACAD,iBAAiB,GAAGC,OAAO,CAAC,sCAAD,CAAP,CAAgDC,OAApE;;EACA,IACEF,iBAAiB,K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C,SAH7B,CADF;AAMD,CAPM"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { ReactElement } from "react";
|
2
|
+
import type { SharedValue } from "react-native-reanimated";
|
3
|
+
import type { SkImage, SkPicture, SkSize } from "../../skia/types";
|
4
|
+
export declare const useTextureValue: (element: ReactElement, size: SkSize) => SharedValue<SkImage | null>;
|
5
|
+
export declare const useTextureValueFromPicture: (picture: SkPicture, size: SkSize) => SharedValue<SkImage | null>;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { useEffect, useMemo } from "react";
|
2
|
+
import { drawAsImageFromPicture, drawAsPicture } from "../../renderer/Offscreen";
|
3
|
+
import { runOnUI, useSharedValue } from "./moduleWrapper";
|
4
|
+
|
5
|
+
const createTextureValue = (texture, picture, size) => {
|
6
|
+
"worklet";
|
7
|
+
|
8
|
+
texture.value = drawAsImageFromPicture(picture, size);
|
9
|
+
};
|
10
|
+
|
11
|
+
export const useTextureValue = (element, size) => {
|
12
|
+
const picture = useMemo(() => {
|
13
|
+
return drawAsPicture(element);
|
14
|
+
}, [element]);
|
15
|
+
return useTextureValueFromPicture(picture, size);
|
16
|
+
};
|
17
|
+
export const useTextureValueFromPicture = (picture, size) => {
|
18
|
+
const texture = useSharedValue(null);
|
19
|
+
useEffect(() => {
|
20
|
+
runOnUI(createTextureValue)(texture, picture, size);
|
21
|
+
}, [texture, picture, size]);
|
22
|
+
return texture;
|
23
|
+
};
|
24
|
+
//# sourceMappingURL=textures.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["useEffect","useMemo","drawAsImageFromPicture","drawAsPicture","runOnUI","useSharedValue","createTextureValue","texture","picture","size","value","useTextureValue","element","useTextureValueFromPicture"],"sources":["textures.tsx"],"sourcesContent":["import { useEffect, useMemo } from \"react\";\nimport type { ReactElement } from \"react\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nimport type { SkImage, SkPicture, SkSize } from \"../../skia/types\";\nimport {\n drawAsImageFromPicture,\n drawAsPicture,\n} from \"../../renderer/Offscreen\";\n\nimport { runOnUI, useSharedValue } from \"./moduleWrapper\";\n\nconst createTextureValue = (\n texture: SharedValue<SkImage | null>,\n picture: SkPicture,\n size: SkSize\n) => {\n \"worklet\";\n texture.value = drawAsImageFromPicture(picture, size);\n};\n\nexport const useTextureValue = (element: ReactElement, size: SkSize) => {\n const picture = useMemo(() => {\n return drawAsPicture(element);\n }, [element]);\n return useTextureValueFromPicture(picture, size);\n};\n\nexport const useTextureValueFromPicture = (\n picture: SkPicture,\n size: SkSize\n) => {\n const texture = useSharedValue<SkImage | null>(null);\n useEffect(() => {\n runOnUI(createTextureValue)(texture, picture, size);\n }, [texture, picture, size]);\n return texture;\n};\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,OAApB,QAAmC,OAAnC;AAKA,SACEC,sBADF,EAEEC,aAFF,QAGO,0BAHP;AAKA,SAASC,OAAT,EAAkBC,cAAlB,QAAwC,iBAAxC;;AAEA,MAAMC,kBAAkB,GAAG,CACzBC,OADyB,EAEzBC,OAFyB,EAGzBC,IAHyB,KAItB;EACH;;EACAF,OAAO,CAACG,KAAR,GAAgBR,sBAAsB,CAACM,OAAD,EAAUC,IAAV,CAAtC;AACD,CAPD;;AASA,OAAO,MAAME,eAAe,GAAG,CAACC,OAAD,EAAwBH,IAAxB,KAAyC;EACtE,MAAMD,OAAO,GAAGP,OAAO,CAAC,MAAM;IAC5B,OAAOE,aAAa,CAACS,OAAD,CAApB;EACD,CAFsB,EAEpB,CAACA,OAAD,CAFoB,CAAvB;EAGA,OAAOC,0BAA0B,CAACL,OAAD,EAAUC,IAAV,CAAjC;AACD,CALM;AAOP,OAAO,MAAMI,0BAA0B,GAAG,CACxCL,OADwC,EAExCC,IAFwC,KAGrC;EACH,MAAMF,OAAO,GAAGF,cAAc,CAAiB,IAAjB,CAA9B;EACAL,SAAS,CAAC,MAAM;IACdI,OAAO,CAACE,kBAAD,CAAP,CAA4BC,OAA5B,EAAqCC,OAArC,EAA8CC,IAA9C;EACD,CAFQ,EAEN,CAACF,OAAD,EAAUC,OAAV,EAAmBC,IAAnB,CAFM,CAAT;EAGA,OAAOF,OAAP;AACD,CATM"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { useEffect } from "react";
|
1
2
|
import { useAnimatedImage } from "../../skia/core/AnimatedImage";
|
2
3
|
import { throwOnMissingReanimated, useFrameCallback, useSharedValue } from "./moduleWrapper";
|
3
4
|
const DEFAULT_FRAME_DURATION = 60;
|
@@ -8,7 +9,7 @@ export const useAnimatedImageValue = source => {
|
|
8
9
|
const animatedImage = useAnimatedImage(source, err => {
|
9
10
|
console.error(err);
|
10
11
|
throw new Error(`Could not load animated image - got '${err.message}'`);
|
11
|
-
});
|
12
|
+
}, false);
|
12
13
|
const frameDuration = (animatedImage === null || animatedImage === void 0 ? void 0 : animatedImage.currentFrameDuration()) || DEFAULT_FRAME_DURATION;
|
13
14
|
useFrameCallback(frameInfo => {
|
14
15
|
if (!animatedImage) {
|
@@ -36,6 +37,11 @@ export const useAnimatedImageValue = source => {
|
|
36
37
|
|
37
38
|
lastTimestamp.value = timestamp; // eslint-disable-next-line react-hooks/exhaustive-deps
|
38
39
|
}, true);
|
40
|
+
useEffect(() => {
|
41
|
+
return () => {
|
42
|
+
animatedImage === null || animatedImage === void 0 ? void 0 : animatedImage.dispose();
|
43
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
44
|
+
}, []);
|
39
45
|
return currentFrame;
|
40
46
|
};
|
41
47
|
//# sourceMappingURL=useAnimatedImageValue.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useAnimatedImage","throwOnMissingReanimated","useFrameCallback","useSharedValue","DEFAULT_FRAME_DURATION","useAnimatedImageValue","source","currentFrame","lastTimestamp","animatedImage","err","console","error","Error","message","frameDuration","currentFrameDuration","frameInfo","value","timestamp","elapsed","decodeNextFrame","dispose","getCurrentFrame"],"sources":["useAnimatedImageValue.ts"],"sourcesContent":["import type { FrameInfo } from \"react-native-reanimated\";\n\nimport { useAnimatedImage } from \"../../skia/core/AnimatedImage\";\nimport type { DataSourceParam, SkImage } from \"../../skia/types\";\n\nimport {\n throwOnMissingReanimated,\n useFrameCallback,\n useSharedValue,\n} from \"./moduleWrapper\";\n\nconst DEFAULT_FRAME_DURATION = 60;\n\nexport const useAnimatedImageValue = (source: DataSourceParam) => {\n throwOnMissingReanimated();\n const currentFrame = useSharedValue<null | SkImage>(null);\n const lastTimestamp = useSharedValue(0);\n const animatedImage = useAnimatedImage(source
|
1
|
+
{"version":3,"names":["useEffect","useAnimatedImage","throwOnMissingReanimated","useFrameCallback","useSharedValue","DEFAULT_FRAME_DURATION","useAnimatedImageValue","source","currentFrame","lastTimestamp","animatedImage","err","console","error","Error","message","frameDuration","currentFrameDuration","frameInfo","value","timestamp","elapsed","decodeNextFrame","dispose","getCurrentFrame"],"sources":["useAnimatedImageValue.ts"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { FrameInfo } from \"react-native-reanimated\";\n\nimport { useAnimatedImage } from \"../../skia/core/AnimatedImage\";\nimport type { DataSourceParam, SkImage } from \"../../skia/types\";\n\nimport {\n throwOnMissingReanimated,\n useFrameCallback,\n useSharedValue,\n} from \"./moduleWrapper\";\n\nconst DEFAULT_FRAME_DURATION = 60;\n\nexport const useAnimatedImageValue = (source: DataSourceParam) => {\n throwOnMissingReanimated();\n const currentFrame = useSharedValue<null | SkImage>(null);\n const lastTimestamp = useSharedValue(0);\n const animatedImage = useAnimatedImage(\n source,\n (err) => {\n console.error(err);\n throw new Error(`Could not load animated image - got '${err.message}'`);\n },\n false\n );\n const frameDuration =\n animatedImage?.currentFrameDuration() || DEFAULT_FRAME_DURATION;\n\n useFrameCallback((frameInfo: FrameInfo) => {\n if (!animatedImage) {\n currentFrame.value = null;\n return;\n }\n\n const { timestamp } = frameInfo;\n const elapsed = timestamp - lastTimestamp.value;\n\n // Check if it's time to switch frames based on GIF frame duration\n if (elapsed < frameDuration) {\n return;\n }\n\n // Update the current frame\n animatedImage.decodeNextFrame();\n if (currentFrame.value) {\n currentFrame.value.dispose();\n }\n currentFrame.value = animatedImage.getCurrentFrame();\n\n // Update the last timestamp\n lastTimestamp.value = timestamp;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, true);\n useEffect(() => {\n return () => {\n animatedImage?.dispose();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return currentFrame;\n};\n"],"mappings":"AAAA,SAASA,SAAT,QAA0B,OAA1B;AAGA,SAASC,gBAAT,QAAiC,+BAAjC;AAGA,SACEC,wBADF,EAEEC,gBAFF,EAGEC,cAHF,QAIO,iBAJP;AAMA,MAAMC,sBAAsB,GAAG,EAA/B;AAEA,OAAO,MAAMC,qBAAqB,GAAIC,MAAD,IAA6B;EAChEL,wBAAwB;EACxB,MAAMM,YAAY,GAAGJ,cAAc,CAAiB,IAAjB,CAAnC;EACA,MAAMK,aAAa,GAAGL,cAAc,CAAC,CAAD,CAApC;EACA,MAAMM,aAAa,GAAGT,gBAAgB,CACpCM,MADoC,EAEnCI,GAAD,IAAS;IACPC,OAAO,CAACC,KAAR,CAAcF,GAAd;IACA,MAAM,IAAIG,KAAJ,CAAW,wCAAuCH,GAAG,CAACI,OAAQ,GAA9D,CAAN;EACD,CALmC,EAMpC,KANoC,CAAtC;EAQA,MAAMC,aAAa,GACjB,CAAAN,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAEO,oBAAf,OAAyCZ,sBAD3C;EAGAF,gBAAgB,CAAEe,SAAD,IAA0B;IACzC,IAAI,CAACR,aAAL,EAAoB;MAClBF,YAAY,CAACW,KAAb,GAAqB,IAArB;MACA;IACD;;IAED,MAAM;MAAEC;IAAF,IAAgBF,SAAtB;IACA,MAAMG,OAAO,GAAGD,SAAS,GAAGX,aAAa,CAACU,KAA1C,CAPyC,CASzC;;IACA,IAAIE,OAAO,GAAGL,aAAd,EAA6B;MAC3B;IACD,CAZwC,CAczC;;;IACAN,aAAa,CAACY,eAAd;;IACA,IAAId,YAAY,CAACW,KAAjB,EAAwB;MACtBX,YAAY,CAACW,KAAb,CAAmBI,OAAnB;IACD;;IACDf,YAAY,CAACW,KAAb,GAAqBT,aAAa,CAACc,eAAd,EAArB,CAnByC,CAqBzC;;IACAf,aAAa,CAACU,KAAd,GAAsBC,SAAtB,CAtByC,CAuBzC;EACD,CAxBe,EAwBb,IAxBa,CAAhB;EAyBApB,SAAS,CAAC,MAAM;IACd,OAAO,MAAM;MACXU,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAEa,OAAf;IACD,CAFD,CADc,CAId;EACD,CALQ,EAKN,EALM,CAAT;EAMA,OAAOf,YAAP;AACD,CA/CM"}
|
@@ -20,7 +20,7 @@ export const makeOffscreenSurface = (width, height) => {
|
|
20
20
|
return surface;
|
21
21
|
};
|
22
22
|
export const drawOffscreen = (surface, element) => {
|
23
|
-
const root = new SkiaRoot(Skia);
|
23
|
+
const root = new SkiaRoot(Skia, false);
|
24
24
|
root.render(element);
|
25
25
|
const canvas = surface.getCanvas();
|
26
26
|
const ctx = new JsiDrawingContext(Skia, canvas);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkApi","SkiaRoot","JsiDrawingContext","Skia","makeOffscreenSurface","width","height","CanvasKit","surface","Surface","MakeOffscreen","Error","drawOffscreen","element","root","render","canvas","getCanvas","ctx","dom","flush","makeImageSnapshot"],"sources":["index.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport CanvasKitInit from \"canvaskit-wasm/bin/full/canvaskit\";\nimport type { ReactNode } from \"react\";\n\nimport { JsiSkApi } from \"../skia/web\";\nimport { SkiaRoot } from \"../renderer/Reconciler\";\nimport { JsiDrawingContext } from \"../dom/types\";\nimport type { SkSurface } from \"../skia\";\n\nexport * from \"../renderer/components\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet Skia: any;\n\nexport const makeOffscreenSurface = (width: number, height: number) => {\n if (!Skia) {\n Skia = JsiSkApi(CanvasKit);\n }\n const surface = Skia.Surface.MakeOffscreen(width, height);\n if (surface === null) {\n throw new Error(\"Couldn't create surface!\");\n }\n return surface;\n};\n\nexport const drawOffscreen = (surface: SkSurface, element: ReactNode) => {\n const root = new SkiaRoot(Skia);\n root.render(element);\n const canvas = surface.getCanvas();\n const ctx = new JsiDrawingContext(Skia, canvas);\n root.dom.render(ctx);\n surface.flush();\n return surface.makeImageSnapshot();\n};\n"],"mappings":"AAAA;AACA;AAIA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,QAAT,QAAyB,wBAAzB;AACA,SAASC,iBAAT,QAAkC,cAAlC;AAGA,cAAc,wBAAd,C,CAEA;;AACA,IAAIC,IAAJ;AAEA,OAAO,MAAMC,oBAAoB,GAAG,CAACC,KAAD,EAAgBC,MAAhB,KAAmC;EACrE,IAAI,CAACH,IAAL,EAAW;IACTA,IAAI,GAAGH,QAAQ,CAACO,SAAD,CAAf;EACD;;EACD,MAAMC,OAAO,GAAGL,IAAI,CAACM,OAAL,CAAaC,aAAb,CAA2BL,KAA3B,EAAkCC,MAAlC,CAAhB;;EACA,IAAIE,OAAO,KAAK,IAAhB,EAAsB;IACpB,MAAM,IAAIG,KAAJ,CAAU,0BAAV,CAAN;EACD;;EACD,OAAOH,OAAP;AACD,CATM;AAWP,OAAO,MAAMI,aAAa,GAAG,CAACJ,OAAD,EAAqBK,OAArB,KAA4C;EACvE,MAAMC,IAAI,GAAG,IAAIb,QAAJ,CAAaE,IAAb,CAAb;EACAW,IAAI,CAACC,MAAL,CAAYF,OAAZ;EACA,MAAMG,MAAM,GAAGR,OAAO,CAACS,SAAR,EAAf;EACA,MAAMC,GAAG,GAAG,IAAIhB,iBAAJ,CAAsBC,IAAtB,EAA4Ba,MAA5B,CAAZ;EACAF,IAAI,CAACK,GAAL,CAASJ,MAAT,CAAgBG,GAAhB;EACAV,OAAO,CAACY,KAAR;EACA,OAAOZ,OAAO,CAACa,iBAAR,EAAP;AACD,CARM"}
|
1
|
+
{"version":3,"names":["JsiSkApi","SkiaRoot","JsiDrawingContext","Skia","makeOffscreenSurface","width","height","CanvasKit","surface","Surface","MakeOffscreen","Error","drawOffscreen","element","root","render","canvas","getCanvas","ctx","dom","flush","makeImageSnapshot"],"sources":["index.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport CanvasKitInit from \"canvaskit-wasm/bin/full/canvaskit\";\nimport type { ReactNode } from \"react\";\n\nimport { JsiSkApi } from \"../skia/web\";\nimport { SkiaRoot } from \"../renderer/Reconciler\";\nimport { JsiDrawingContext } from \"../dom/types\";\nimport type { SkSurface } from \"../skia\";\n\nexport * from \"../renderer/components\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet Skia: any;\n\nexport const makeOffscreenSurface = (width: number, height: number) => {\n if (!Skia) {\n Skia = JsiSkApi(CanvasKit);\n }\n const surface = Skia.Surface.MakeOffscreen(width, height);\n if (surface === null) {\n throw new Error(\"Couldn't create surface!\");\n }\n return surface;\n};\n\nexport const drawOffscreen = (surface: SkSurface, element: ReactNode) => {\n const root = new SkiaRoot(Skia, false);\n root.render(element);\n const canvas = surface.getCanvas();\n const ctx = new JsiDrawingContext(Skia, canvas);\n root.dom.render(ctx);\n surface.flush();\n return surface.makeImageSnapshot();\n};\n"],"mappings":"AAAA;AACA;AAIA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,QAAT,QAAyB,wBAAzB;AACA,SAASC,iBAAT,QAAkC,cAAlC;AAGA,cAAc,wBAAd,C,CAEA;;AACA,IAAIC,IAAJ;AAEA,OAAO,MAAMC,oBAAoB,GAAG,CAACC,KAAD,EAAgBC,MAAhB,KAAmC;EACrE,IAAI,CAACH,IAAL,EAAW;IACTA,IAAI,GAAGH,QAAQ,CAACO,SAAD,CAAf;EACD;;EACD,MAAMC,OAAO,GAAGL,IAAI,CAACM,OAAL,CAAaC,aAAb,CAA2BL,KAA3B,EAAkCC,MAAlC,CAAhB;;EACA,IAAIE,OAAO,KAAK,IAAhB,EAAsB;IACpB,MAAM,IAAIG,KAAJ,CAAU,0BAAV,CAAN;EACD;;EACD,OAAOH,OAAP;AACD,CATM;AAWP,OAAO,MAAMI,aAAa,GAAG,CAACJ,OAAD,EAAqBK,OAArB,KAA4C;EACvE,MAAMC,IAAI,GAAG,IAAIb,QAAJ,CAAaE,IAAb,EAAmB,KAAnB,CAAb;EACAW,IAAI,CAACC,MAAL,CAAYF,OAAZ;EACA,MAAMG,MAAM,GAAGR,OAAO,CAACS,SAAR,EAAf;EACA,MAAMC,GAAG,GAAG,IAAIhB,iBAAJ,CAAsBC,IAAtB,EAA4Ba,MAA5B,CAAZ;EACAF,IAAI,CAACK,GAAL,CAASJ,MAAT,CAAgBG,GAAhB;EACAV,OAAO,CAACY,KAAR;EACA,OAAOZ,OAAO,CAACa,iBAAR,EAAP;AACD,CARM"}
|
package/lib/module/mock/index.js
CHANGED
@@ -34,9 +34,17 @@ export const Mock = CanvasKit => {
|
|
34
34
|
// Reanimated hooks
|
35
35
|
useClock: NoopSharedValue,
|
36
36
|
usePathInterpolation: NoopSharedValue,
|
37
|
+
useTextureValue: NoopSharedValue,
|
38
|
+
useTextureValueFromPicture: NoopSharedValue,
|
39
|
+
useRSXformBuffer: NoopSharedValue,
|
40
|
+
usePointBuffer: NoopSharedValue,
|
41
|
+
useColorBuffer: NoopSharedValue,
|
42
|
+
useRectBuffer: NoopSharedValue,
|
43
|
+
useBuffer: NoopSharedValue,
|
37
44
|
useRawData: Noop,
|
38
45
|
useData: Noop,
|
39
46
|
useFont: () => Skia.Font(undefined, 0),
|
47
|
+
useFonts: Noop,
|
40
48
|
useTypeface: () => null,
|
41
49
|
useImage: () => null,
|
42
50
|
useSVG: () => null
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkApi","Noop","undefined","NoopValue","current","NoopSharedValue","value","Mock","CanvasKit","global","SkiaApi","Skia","require","Canvas","useValue","useComputedValue","useTouchHandler","useTiming","useLoop","useSpring","useClockValue","useValueEffect","useClock","usePathInterpolation","useRawData","useData","useFont","Font","useTypeface","useImage","useSVG"],"sources":["index.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport { JsiSkApi } from \"../skia/web\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Noop: () => any = () => undefined;\nconst NoopValue = () => ({ current: 0 });\nconst NoopSharedValue = () => ({ value: 0 });\n\nexport const Mock = (CanvasKit: CanvasKit) => {\n global.SkiaApi = JsiSkApi(CanvasKit);\n const Skia = global.SkiaApi;\n return {\n Skia,\n ...require(\"../renderer/components\"),\n ...require(\"../skia\"),\n ...require(\"../animation\"),\n ...require(\"../dom/types\"),\n ...require(\"../dom/nodes\"),\n // We could use the real Canvas if we mock the SkiaView component for node\n Canvas: Noop,\n // Skia Animations\n useValue: NoopValue,\n useComputedValue: NoopValue,\n useTouchHandler: Noop,\n useTiming: NoopValue,\n useLoop: NoopValue,\n useSpring: NoopValue,\n useClockValue: NoopValue,\n useValueEffect: Noop,\n // Reanimated hooks\n useClock: NoopSharedValue,\n usePathInterpolation: NoopSharedValue,\n useRawData: Noop,\n useData: Noop,\n useFont: () => Skia.Font(undefined, 0),\n useTypeface: () => null,\n useImage: () => null,\n useSVG: () => null,\n };\n};\n"],"mappings":"AAEA,SAASA,QAAT,QAAyB,aAAzB,C,CAEA;;AACA,MAAMC,IAAe,GAAG,MAAMC,SAA9B;;AACA,MAAMC,SAAS,GAAG,OAAO;EAAEC,OAAO,EAAE;AAAX,CAAP,CAAlB;;AACA,MAAMC,eAAe,GAAG,OAAO;EAAEC,KAAK,EAAE;AAAT,CAAP,CAAxB;;AAEA,OAAO,MAAMC,IAAI,GAAIC,SAAD,IAA0B;EAC5CC,MAAM,CAACC,OAAP,GAAiBV,QAAQ,CAACQ,SAAD,CAAzB;EACA,MAAMG,IAAI,GAAGF,MAAM,CAACC,OAApB;EACA,OAAO;IACLC,IADK;IAEL,GAAGC,OAAO,CAAC,wBAAD,CAFL;IAGL,GAAGA,OAAO,CAAC,SAAD,CAHL;IAIL,GAAGA,OAAO,CAAC,cAAD,CAJL;IAKL,GAAGA,OAAO,CAAC,cAAD,CALL;IAML,GAAGA,OAAO,CAAC,cAAD,CANL;IAOL;IACAC,MAAM,EAAEZ,IARH;IASL;IACAa,QAAQ,EAAEX,SAVL;IAWLY,gBAAgB,EAAEZ,SAXb;IAYLa,eAAe,EAAEf,IAZZ;IAaLgB,SAAS,EAAEd,SAbN;IAcLe,OAAO,EAAEf,SAdJ;IAeLgB,SAAS,EAAEhB,SAfN;IAgBLiB,aAAa,EAAEjB,SAhBV;IAiBLkB,cAAc,EAAEpB,IAjBX;IAkBL;IACAqB,QAAQ,EAAEjB,eAnBL;IAoBLkB,oBAAoB,EAAElB,eApBjB;IAqBLmB,
|
1
|
+
{"version":3,"names":["JsiSkApi","Noop","undefined","NoopValue","current","NoopSharedValue","value","Mock","CanvasKit","global","SkiaApi","Skia","require","Canvas","useValue","useComputedValue","useTouchHandler","useTiming","useLoop","useSpring","useClockValue","useValueEffect","useClock","usePathInterpolation","useTextureValue","useTextureValueFromPicture","useRSXformBuffer","usePointBuffer","useColorBuffer","useRectBuffer","useBuffer","useRawData","useData","useFont","Font","useFonts","useTypeface","useImage","useSVG"],"sources":["index.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport { JsiSkApi } from \"../skia/web\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Noop: () => any = () => undefined;\nconst NoopValue = () => ({ current: 0 });\nconst NoopSharedValue = () => ({ value: 0 });\n\nexport const Mock = (CanvasKit: CanvasKit) => {\n global.SkiaApi = JsiSkApi(CanvasKit);\n const Skia = global.SkiaApi;\n return {\n Skia,\n ...require(\"../renderer/components\"),\n ...require(\"../skia\"),\n ...require(\"../animation\"),\n ...require(\"../dom/types\"),\n ...require(\"../dom/nodes\"),\n // We could use the real Canvas if we mock the SkiaView component for node\n Canvas: Noop,\n // Skia Animations\n useValue: NoopValue,\n useComputedValue: NoopValue,\n useTouchHandler: Noop,\n useTiming: NoopValue,\n useLoop: NoopValue,\n useSpring: NoopValue,\n useClockValue: NoopValue,\n useValueEffect: Noop,\n // Reanimated hooks\n useClock: NoopSharedValue,\n usePathInterpolation: NoopSharedValue,\n useTextureValue: NoopSharedValue,\n useTextureValueFromPicture: NoopSharedValue,\n useRSXformBuffer: NoopSharedValue,\n usePointBuffer: NoopSharedValue,\n useColorBuffer: NoopSharedValue,\n useRectBuffer: NoopSharedValue,\n useBuffer: NoopSharedValue,\n useRawData: Noop,\n useData: Noop,\n useFont: () => Skia.Font(undefined, 0),\n useFonts: Noop,\n useTypeface: () => null,\n useImage: () => null,\n useSVG: () => null,\n };\n};\n"],"mappings":"AAEA,SAASA,QAAT,QAAyB,aAAzB,C,CAEA;;AACA,MAAMC,IAAe,GAAG,MAAMC,SAA9B;;AACA,MAAMC,SAAS,GAAG,OAAO;EAAEC,OAAO,EAAE;AAAX,CAAP,CAAlB;;AACA,MAAMC,eAAe,GAAG,OAAO;EAAEC,KAAK,EAAE;AAAT,CAAP,CAAxB;;AAEA,OAAO,MAAMC,IAAI,GAAIC,SAAD,IAA0B;EAC5CC,MAAM,CAACC,OAAP,GAAiBV,QAAQ,CAACQ,SAAD,CAAzB;EACA,MAAMG,IAAI,GAAGF,MAAM,CAACC,OAApB;EACA,OAAO;IACLC,IADK;IAEL,GAAGC,OAAO,CAAC,wBAAD,CAFL;IAGL,GAAGA,OAAO,CAAC,SAAD,CAHL;IAIL,GAAGA,OAAO,CAAC,cAAD,CAJL;IAKL,GAAGA,OAAO,CAAC,cAAD,CALL;IAML,GAAGA,OAAO,CAAC,cAAD,CANL;IAOL;IACAC,MAAM,EAAEZ,IARH;IASL;IACAa,QAAQ,EAAEX,SAVL;IAWLY,gBAAgB,EAAEZ,SAXb;IAYLa,eAAe,EAAEf,IAZZ;IAaLgB,SAAS,EAAEd,SAbN;IAcLe,OAAO,EAAEf,SAdJ;IAeLgB,SAAS,EAAEhB,SAfN;IAgBLiB,aAAa,EAAEjB,SAhBV;IAiBLkB,cAAc,EAAEpB,IAjBX;IAkBL;IACAqB,QAAQ,EAAEjB,eAnBL;IAoBLkB,oBAAoB,EAAElB,eApBjB;IAqBLmB,eAAe,EAAEnB,eArBZ;IAsBLoB,0BAA0B,EAAEpB,eAtBvB;IAuBLqB,gBAAgB,EAAErB,eAvBb;IAwBLsB,cAAc,EAAEtB,eAxBX;IAyBLuB,cAAc,EAAEvB,eAzBX;IA0BLwB,aAAa,EAAExB,eA1BV;IA2BLyB,SAAS,EAAEzB,eA3BN;IA4BL0B,UAAU,EAAE9B,IA5BP;IA6BL+B,OAAO,EAAE/B,IA7BJ;IA8BLgC,OAAO,EAAE,MAAMtB,IAAI,CAACuB,IAAL,CAAUhC,SAAV,EAAqB,CAArB,CA9BV;IA+BLiC,QAAQ,EAAElC,IA/BL;IAgCLmC,WAAW,EAAE,MAAM,IAhCd;IAiCLC,QAAQ,EAAE,MAAM,IAjCX;IAkCLC,MAAM,EAAE,MAAM;EAlCT,CAAP;AAoCD,CAvCM"}
|
@@ -53,7 +53,7 @@ export const Canvas = /*#__PURE__*/forwardRef((_ref, forwardedRef) => {
|
|
53
53
|
const id = (_innerRef$current$nat = (_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : _innerRef$current2.nativeId) !== null && _innerRef$current$nat !== void 0 ? _innerRef$current$nat : -1;
|
54
54
|
return id;
|
55
55
|
}, [innerRef]);
|
56
|
-
const root = useMemo(() => new SkiaRoot(Skia, redraw, getNativeId), [redraw, getNativeId]); // Render effect
|
56
|
+
const root = useMemo(() => new SkiaRoot(Skia, NATIVE_DOM, redraw, getNativeId), [redraw, getNativeId]); // Render effect
|
57
57
|
|
58
58
|
useEffect(() => {
|
59
59
|
root.render(children);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useEffect","useCallback","useMemo","forwardRef","useRef","SkiaDomView","Skia","SkiaJSDomView","SkiaRoot","NATIVE_DOM","useCanvasRef","useOnSizeEvent","resultValue","onLayout","event","width","height","nativeEvent","layout","value","Canvas","forwardedRef","children","style","debug","mode","onTouch","onSize","_onSize","_onLayout","props","innerRef","ref","useCombinedRefs","redraw","current","getNativeId","id","nativeId","root","render","unmount","dom","refs","targetRef","forEach"],"sources":["Canvas.tsx"],"sourcesContent":["import React, {\n useEffect,\n useCallback,\n useMemo,\n forwardRef,\n useRef,\n} from \"react\";\nimport type {\n RefObject,\n ReactNode,\n MutableRefObject,\n ForwardedRef,\n FunctionComponent,\n} from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nimport { SkiaDomView } from \"../views\";\nimport { Skia } from \"../skia/Skia\";\nimport type { TouchHandler, SkiaBaseViewProps } from \"../views\";\nimport { SkiaJSDomView } from \"../views/SkiaJSDomView\";\n\nimport { SkiaRoot } from \"./Reconciler\";\nimport { NATIVE_DOM } from \"./HostComponents\";\n\nexport const useCanvasRef = () => useRef<SkiaDomView>(null);\n\nexport interface CanvasProps extends SkiaBaseViewProps {\n ref?: RefObject<SkiaDomView>;\n children: ReactNode;\n onTouch?: TouchHandler;\n}\n\nconst useOnSizeEvent = (\n resultValue: SkiaBaseViewProps[\"onSize\"],\n onLayout?: (event: LayoutChangeEvent) => void\n) => {\n return useCallback(\n (event: LayoutChangeEvent) => {\n if (onLayout) {\n onLayout(event);\n }\n const { width, height } = event.nativeEvent.layout;\n\n if (resultValue) {\n resultValue.value = { width, height };\n }\n },\n [onLayout, resultValue]\n );\n};\n\nexport const Canvas = forwardRef<SkiaDomView, CanvasProps>(\n (\n {\n children,\n style,\n debug,\n mode,\n onTouch,\n onSize: _onSize,\n onLayout: _onLayout,\n ...props\n },\n forwardedRef\n ) => {\n const onLayout = useOnSizeEvent(_onSize, _onLayout);\n const innerRef = useCanvasRef();\n const ref = useCombinedRefs(forwardedRef, innerRef);\n const redraw = useCallback(() => {\n innerRef.current?.redraw();\n }, [innerRef]);\n const getNativeId = useCallback(() => {\n const id = innerRef.current?.nativeId ?? -1;\n return id;\n }, [innerRef]);\n\n const root = useMemo(\n () => new SkiaRoot(Skia, redraw, getNativeId),\n [redraw, getNativeId]\n );\n\n // Render effect\n useEffect(() => {\n root.render(children);\n }, [children, root, redraw]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n\n if (NATIVE_DOM) {\n return (\n <SkiaDomView\n ref={ref}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onLayout={onLayout}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n } else {\n return (\n <SkiaJSDomView\n Skia={Skia}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onLayout={onLayout}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n }\n }\n) as FunctionComponent<CanvasProps & React.RefAttributes<SkiaDomView>>;\n\n/**\n * Combines a list of refs into a single ref. This can be used to provide\n * both a forwarded ref and an internal ref keeping the same functionality\n * on both of the refs.\n * @param refs Array of refs to combine\n * @returns A single ref that can be used in a ref prop.\n */\nconst useCombinedRefs = <T,>(\n ...refs: Array<MutableRefObject<T> | ForwardedRef<T>>\n) => {\n const targetRef = React.useRef<T>(null);\n React.useEffect(() => {\n refs.forEach((ref) => {\n if (ref) {\n if (typeof ref === \"function\") {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n }\n });\n }, [refs]);\n return targetRef;\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,IACEC,SADF,EAEEC,WAFF,EAGEC,OAHF,EAIEC,UAJF,EAKEC,MALF,QAMO,OANP;AAgBA,SAASC,WAAT,QAA4B,UAA5B;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,aAAT,QAA8B,wBAA9B;AAEA,SAASC,QAAT,QAAyB,cAAzB;AACA,SAASC,UAAT,QAA2B,kBAA3B;AAEA,OAAO,MAAMC,YAAY,GAAG,MA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AAO,CAClB,MAAM,IAAIM,QAAJ,CAAaF,IAAb,
|
1
|
+
{"version":3,"names":["React","useEffect","useCallback","useMemo","forwardRef","useRef","SkiaDomView","Skia","SkiaJSDomView","SkiaRoot","NATIVE_DOM","useCanvasRef","useOnSizeEvent","resultValue","onLayout","event","width","height","nativeEvent","layout","value","Canvas","forwardedRef","children","style","debug","mode","onTouch","onSize","_onSize","_onLayout","props","innerRef","ref","useCombinedRefs","redraw","current","getNativeId","id","nativeId","root","render","unmount","dom","refs","targetRef","forEach"],"sources":["Canvas.tsx"],"sourcesContent":["import React, {\n useEffect,\n useCallback,\n useMemo,\n forwardRef,\n useRef,\n} from \"react\";\nimport type {\n RefObject,\n ReactNode,\n MutableRefObject,\n ForwardedRef,\n FunctionComponent,\n} from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nimport { SkiaDomView } from \"../views\";\nimport { Skia } from \"../skia/Skia\";\nimport type { TouchHandler, SkiaBaseViewProps } from \"../views\";\nimport { SkiaJSDomView } from \"../views/SkiaJSDomView\";\n\nimport { SkiaRoot } from \"./Reconciler\";\nimport { NATIVE_DOM } from \"./HostComponents\";\n\nexport const useCanvasRef = () => useRef<SkiaDomView>(null);\n\nexport interface CanvasProps extends SkiaBaseViewProps {\n ref?: RefObject<SkiaDomView>;\n children: ReactNode;\n onTouch?: TouchHandler;\n}\n\nconst useOnSizeEvent = (\n resultValue: SkiaBaseViewProps[\"onSize\"],\n onLayout?: (event: LayoutChangeEvent) => void\n) => {\n return useCallback(\n (event: LayoutChangeEvent) => {\n if (onLayout) {\n onLayout(event);\n }\n const { width, height } = event.nativeEvent.layout;\n\n if (resultValue) {\n resultValue.value = { width, height };\n }\n },\n [onLayout, resultValue]\n );\n};\n\nexport const Canvas = forwardRef<SkiaDomView, CanvasProps>(\n (\n {\n children,\n style,\n debug,\n mode,\n onTouch,\n onSize: _onSize,\n onLayout: _onLayout,\n ...props\n },\n forwardedRef\n ) => {\n const onLayout = useOnSizeEvent(_onSize, _onLayout);\n const innerRef = useCanvasRef();\n const ref = useCombinedRefs(forwardedRef, innerRef);\n const redraw = useCallback(() => {\n innerRef.current?.redraw();\n }, [innerRef]);\n const getNativeId = useCallback(() => {\n const id = innerRef.current?.nativeId ?? -1;\n return id;\n }, [innerRef]);\n\n const root = useMemo(\n () => new SkiaRoot(Skia, NATIVE_DOM, redraw, getNativeId),\n [redraw, getNativeId]\n );\n\n // Render effect\n useEffect(() => {\n root.render(children);\n }, [children, root, redraw]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n\n if (NATIVE_DOM) {\n return (\n <SkiaDomView\n ref={ref}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onLayout={onLayout}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n } else {\n return (\n <SkiaJSDomView\n Skia={Skia}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onLayout={onLayout}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n }\n }\n) as FunctionComponent<CanvasProps & React.RefAttributes<SkiaDomView>>;\n\n/**\n * Combines a list of refs into a single ref. This can be used to provide\n * both a forwarded ref and an internal ref keeping the same functionality\n * on both of the refs.\n * @param refs Array of refs to combine\n * @returns A single ref that can be used in a ref prop.\n */\nconst useCombinedRefs = <T,>(\n ...refs: Array<MutableRefObject<T> | ForwardedRef<T>>\n) => {\n const targetRef = React.useRef<T>(null);\n React.useEffect(() => {\n refs.forEach((ref) => {\n if (ref) {\n if (typeof ref === \"function\") {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n }\n });\n }, [refs]);\n return targetRef;\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,IACEC,SADF,EAEEC,WAFF,EAGEC,OAHF,EAIEC,UAJF,EAKEC,MALF,QAMO,OANP;AAgBA,SAASC,WAAT,QAA4B,UAA5B;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,aAAT,QAA8B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AN,CAAgB,IAAhB,CAAlB;EACAL,KAAK,CAACC,SAAN,CAAgB,MAAM;IACpB2C,IAAI,CAACE,OAAL,CAAcb,GAAD,IAAS;MACpB,IAAIA,GAAJ,EAAS;QACP,IAAI,OAAOA,GAAP,KAAe,UAAnB,EAA+B;UAC7BA,GAAG,CAACY,SAAS,CAACT,OAAX,CAAH;QACD,CAFD,MAEO;UACLH,GAAG,CAACG,OAAJ,GAAcS,SAAS,CAACT,OAAxB;QACD;MACF;IACF,CARD;EASD,CAVD,EAUG,CAACQ,IAAD,CAVH;EAWA,OAAOC,SAAP;AACD,CAhBD"}
|
@@ -5,7 +5,7 @@ export declare class Container {
|
|
5
5
|
getNativeId: () => number;
|
6
6
|
private _root;
|
7
7
|
Sk: SkDOM;
|
8
|
-
constructor(Skia: Skia, redraw
|
8
|
+
constructor(Skia: Skia, redraw: () => void, getNativeId: () => number, native: boolean);
|
9
9
|
draw(ctx: DrawingContext): void;
|
10
10
|
get root(): RenderNode<GroupProps>;
|
11
11
|
}
|
@@ -5,6 +5,7 @@ export class Container {
|
|
5
5
|
constructor(Skia) {
|
6
6
|
let redraw = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => {};
|
7
7
|
let getNativeId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : () => 0;
|
8
|
+
let native = arguments.length > 3 ? arguments[3] : undefined;
|
8
9
|
this.redraw = redraw;
|
9
10
|
this.getNativeId = getNativeId;
|
10
11
|
|
@@ -14,7 +15,7 @@ export class Container {
|
|
14
15
|
|
15
16
|
this.Sk = new JsiSkDOM({
|
16
17
|
Skia
|
17
|
-
});
|
18
|
+
}, native);
|
18
19
|
this._root = this.Sk.Group();
|
19
20
|
}
|
20
21
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkDOM","Container","constructor","Skia","redraw","getNativeId","Sk","_root","Group","draw","ctx","render","root"],"sources":["Container.tsx"],"sourcesContent":["import { JsiSkDOM } from \"../dom/nodes\";\nimport type {\n GroupProps,\n DrawingContext,\n RenderNode,\n SkDOM,\n} from \"../dom/types\";\nimport type { Skia } from \"../skia/types\";\n\nexport class Container {\n private _root: RenderNode<GroupProps>;\n public Sk: SkDOM;\n constructor(\n Skia: Skia,\n public redraw: () => void = () => {},\n public getNativeId: () => number = () => 0\n ) {\n this.Sk = new JsiSkDOM({ Skia });\n this._root = this.Sk.Group();\n }\n\n draw(ctx: DrawingContext) {\n this._root.render(ctx);\n }\n\n get root() {\n return this._root;\n }\n}\n"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,cAAzB;AASA,OAAO,MAAMC,SAAN,CAAgB;EAGrBC,WAAW,CACTC,IADS,
|
1
|
+
{"version":3,"names":["JsiSkDOM","Container","constructor","Skia","redraw","getNativeId","native","Sk","_root","Group","draw","ctx","render","root"],"sources":["Container.tsx"],"sourcesContent":["import { JsiSkDOM } from \"../dom/nodes\";\nimport type {\n GroupProps,\n DrawingContext,\n RenderNode,\n SkDOM,\n} from \"../dom/types\";\nimport type { Skia } from \"../skia/types\";\n\nexport class Container {\n private _root: RenderNode<GroupProps>;\n public Sk: SkDOM;\n constructor(\n Skia: Skia,\n public redraw: () => void = () => {},\n public getNativeId: () => number = () => 0,\n native: boolean\n ) {\n this.Sk = new JsiSkDOM({ Skia }, native);\n this._root = this.Sk.Group();\n }\n\n draw(ctx: DrawingContext) {\n this._root.render(ctx);\n }\n\n get root() {\n return this._root;\n }\n}\n"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,cAAzB;AASA,OAAO,MAAMC,SAAN,CAAgB;EAGrBC,WAAW,CACTC,IADS,EAKT;IAAA,IAHOC,MAGP,uEAH4B,MAAM,CAAE,CAGpC;IAAA,IAFOC,WAEP,uEAFmC,MAAM,CAEzC;IAAA,IADAC,MACA;IAAA,KAHOF,MAGP,GAHOA,MAGP;IAAA,KAFOC,WAEP,GAFOA,WAEP;;IAAA;;IAAA;;IACA,KAAKE,EAAL,GAAU,IAAIP,QAAJ,CAAa;MAAEG;IAAF,CAAb,EAAuBG,MAAvB,CAAV;IACA,KAAKE,KAAL,GAAa,KAAKD,EAAL,CAAQE,KAAR,EAAb;EACD;;EAEDC,IAAI,CAACC,GAAD,EAAsB;IACxB,KAAKH,KAAL,CAAWI,MAAX,CAAkBD,GAAlB;EACD;;EAEO,IAAJE,IAAI,GAAG;IACT,OAAO,KAAKL,KAAZ;EACD;;AAnBoB"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { NodeType } from "../dom/types";
|
2
|
-
import type { DeclarationNode, FractalNoiseProps, RenderNode, CircleProps, DrawingNodeProps, ImageProps, PaintProps, PathProps, LineProps, OvalProps, DiffRectProps, PointsProps, RectProps, RoundedRectProps, TextProps, VerticesProps, BlurMaskFilterProps, BlendImageFilterProps, BlurImageFilterProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps, MatrixColorFilterProps, ShaderProps, ImageShaderProps, LinearGradientProps, GroupProps, PatchProps, BlendColorFilterProps, DashPathEffectProps, DiscretePathEffectProps, CornerPathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps, TextPathProps, TextBlobProps, GlyphsProps, TwoPointConicalGradientProps, TurbulenceProps, SweepGradientProps, RadialGradientProps, ColorProps, PictureProps, ImageSVGProps, LerpColorFilterProps, BoxProps, BoxShadowProps, ParagraphProps } from "../dom/types";
|
2
|
+
import type { DeclarationNode, FractalNoiseProps, RenderNode, CircleProps, DrawingNodeProps, ImageProps, PaintProps, PathProps, LineProps, OvalProps, DiffRectProps, PointsProps, RectProps, RoundedRectProps, TextProps, VerticesProps, BlurMaskFilterProps, BlendImageFilterProps, BlurImageFilterProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps, MatrixColorFilterProps, ShaderProps, ImageShaderProps, LinearGradientProps, GroupProps, PatchProps, BlendColorFilterProps, DashPathEffectProps, DiscretePathEffectProps, CornerPathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps, TextPathProps, TextBlobProps, GlyphsProps, TwoPointConicalGradientProps, TurbulenceProps, SweepGradientProps, RadialGradientProps, ColorProps, PictureProps, ImageSVGProps, LerpColorFilterProps, BoxProps, BoxShadowProps, ParagraphProps, AtlasProps } from "../dom/types";
|
3
3
|
import type { ChildrenProps } from "../dom/types/Common";
|
4
4
|
import type { BlendProps, MorphologyImageFilterProps } from "../dom/types/ImageFilters";
|
5
5
|
import type { SkRect, SkRRect } from "../skia/types";
|
@@ -22,6 +22,7 @@ declare global {
|
|
22
22
|
PatchNode: (props: PatchProps) => RenderNode<PatchProps>;
|
23
23
|
PointsNode: (props: PointsProps) => RenderNode<PointsProps>;
|
24
24
|
DiffRectNode: (props: DiffRectProps) => RenderNode<DiffRectProps>;
|
25
|
+
AtlasNode: (props: AtlasProps) => RenderNode<AtlasProps>;
|
25
26
|
BlurMaskFilterNode: (props: BlurMaskFilterProps) => DeclarationNode<BlurMaskFilterProps>;
|
26
27
|
DashPathEffectNode: (props: DashPathEffectProps) => DeclarationNode<DashPathEffectProps>;
|
27
28
|
DiscretePathEffectNode: (props: DiscretePathEffectProps) => DeclarationNode<DiscretePathEffectProps>;
|
@@ -81,6 +82,7 @@ declare global {
|
|
81
82
|
skPoints: SkiaProps<PointsProps>;
|
82
83
|
skRect: SkiaProps<RectProps>;
|
83
84
|
skRRect: SkiaProps<RoundedRectProps>;
|
85
|
+
skAtlas: SkiaProps<AtlasProps>;
|
84
86
|
skVertices: SkiaProps<VerticesProps>;
|
85
87
|
skText: SkiaProps<TextProps>;
|
86
88
|
skTextPath: SkiaProps<TextPathProps>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NodeType","exhaustiveCheck","shouldUseJSDomOnNative","NATIVE_DOM","global","SkiaDomApi","createNode","container","type","props","Sk","Layer","Group","Paint","Fill","Image","Circle","Path","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LerpColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow","Paragraph"],"sources":["HostComponents.ts"],"sourcesContent":["import { NodeType } from \"../dom/types\";\nimport type {\n DeclarationNode,\n FractalNoiseProps,\n RenderNode,\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n ParagraphProps,\n} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\nimport type { SkRect, SkRRect } from \"../skia/types\";\nimport type { JsiDrawingNode } from \"../dom/nodes/DrawingNode\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\n// This flag should only be turned on for debugging/testing\nconst shouldUseJSDomOnNative = false;\nexport const NATIVE_DOM = shouldUseJSDomOnNative ? false : !!global.SkiaDomApi;\n\ndeclare global {\n var SkiaDomApi: {\n // FIXME: We need a better type for this\n RectNode: (props: RectProps) => JsiDrawingNode<RectProps, SkRect>;\n RRectNode: (\n props: RoundedRectProps\n ) => JsiDrawingNode<RoundedRectProps, SkRRect>;\n GroupNode: (props: GroupProps) => RenderNode<GroupProps>;\n PaintNode: (props: PaintProps) => DeclarationNode<PaintProps>;\n FillNode: (props: PaintProps) => RenderNode<PaintProps>;\n CircleNode: (props: CircleProps) => RenderNode<CircleProps>;\n PathNode: (props: PathProps) => RenderNode<PathProps>;\n LineNode: (props: LineProps) => RenderNode<LineProps>;\n ImageNode: (props: ImageProps) => RenderNode<ImageProps>;\n OvalNode: (props: OvalProps) => RenderNode<OvalProps>;\n PatchNode: (props: PatchProps) => RenderNode<PatchProps>;\n PointsNode: (props: PointsProps) => RenderNode<PointsProps>;\n DiffRectNode: (props: DiffRectProps) => RenderNode<DiffRectProps>;\n // Mask filters\n BlurMaskFilterNode: (\n props: BlurMaskFilterProps\n ) => DeclarationNode<BlurMaskFilterProps>;\n\n // Path effects\n DashPathEffectNode: (\n props: DashPathEffectProps\n ) => DeclarationNode<DashPathEffectProps>;\n DiscretePathEffectNode: (\n props: DiscretePathEffectProps\n ) => DeclarationNode<DiscretePathEffectProps>;\n CornerPathEffectNode: (\n props: CornerPathEffectProps\n ) => DeclarationNode<CornerPathEffectProps>;\n Path1DPathEffectNode: (\n props: Path1DPathEffectProps\n ) => DeclarationNode<Path1DPathEffectProps>;\n Path2DPathEffectNode: (\n props: Path2DPathEffectProps\n ) => DeclarationNode<Path2DPathEffectProps>;\n Line2DPathEffectNode: (\n props: Line2DPathEffectProps\n ) => DeclarationNode<Line2DPathEffectProps>;\n SumPathEffectNode: () => DeclarationNode<null>;\n\n // Image filters\n BlendImageFilterNode: (\n props: BlendImageFilterProps\n ) => DeclarationNode<BlendImageFilterProps>;\n DropShadowImageFilterNode: (\n props: DropShadowImageFilterProps\n ) => DeclarationNode<DropShadowImageFilterProps>;\n DisplacementMapImageFilterNode: (\n props: DisplacementMapImageFilterProps\n ) => DeclarationNode<DisplacementMapImageFilterProps>;\n BlurImageFilterNode: (\n props: BlurImageFilterProps\n ) => DeclarationNode<BlurImageFilterProps>;\n OffsetImageFilterNode: (\n props: OffsetImageFilterProps\n ) => DeclarationNode<OffsetImageFilterProps>;\n MorphologyImageFilterNode: (\n props: MorphologyImageFilterProps\n ) => DeclarationNode<MorphologyImageFilterProps>;\n RuntimeShaderImageFilterNode: (\n props: RuntimeShaderImageFilterProps\n ) => DeclarationNode<RuntimeShaderImageFilterProps>;\n\n // Color filters\n MatrixColorFilterNode: (\n props: MatrixColorFilterProps\n ) => DeclarationNode<MatrixColorFilterProps>;\n BlendColorFilterNode: (\n props: BlendColorFilterProps\n ) => DeclarationNode<BlendColorFilterProps>;\n LinearToSRGBGammaColorFilterNode: () => DeclarationNode<null>;\n SRGBToLinearGammaColorFilterNode: () => DeclarationNode<null>;\n LumaColorFilterNode: () => DeclarationNode<null>;\n LerpColorFilterNode: (\n props: LerpColorFilterProps\n ) => DeclarationNode<LerpColorFilterProps>;\n\n // Shaders\n ShaderNode: (props: ShaderProps) => DeclarationNode<ShaderProps>;\n ImageShaderNode: (\n props: ImageShaderProps\n ) => DeclarationNode<ImageShaderProps>;\n ColorShaderNode: (props: ColorProps) => DeclarationNode<ColorProps>;\n TurbulenceNode: (\n props: TurbulenceProps\n ) => DeclarationNode<TurbulenceProps>;\n FractalNoiseNode: (\n props: FractalNoiseProps\n ) => DeclarationNode<FractalNoiseProps>;\n LinearGradientNode: (\n props: LinearGradientProps\n ) => DeclarationNode<LinearGradientProps>;\n RadialGradientNode: (\n props: RadialGradientProps\n ) => DeclarationNode<RadialGradientProps>;\n SweepGradientNode: (\n props: SweepGradientProps\n ) => DeclarationNode<SweepGradientProps>;\n TwoPointConicalGradientNode: (\n props: TwoPointConicalGradientProps\n ) => DeclarationNode<TwoPointConicalGradientProps>;\n PictureNode: (props: PictureProps) => RenderNode<PictureProps>;\n ImageSVGNode: (props: ImageSVGProps) => RenderNode<ImageSVGProps>;\n VerticesNode: (props: VerticesProps) => RenderNode<VerticesProps>;\n TextNode: (prop: TextProps) => RenderNode<TextProps>;\n TextPathNode: (prop: TextPathProps) => RenderNode<TextPathProps>;\n TextBlobNode: (prop: TextBlobProps) => RenderNode<TextBlobProps>;\n GlyphsNode: (prop: GlyphsProps) => RenderNode<GlyphsProps>;\n BlendNode: (prop: BlendProps) => DeclarationNode<BlendProps>;\n BackdropFilterNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;\n BoxNode: (prop: BoxProps) => RenderNode<BoxProps>;\n BoxShadowNode: (prop: BoxShadowProps) => DeclarationNode<BoxShadowProps>;\n LayerNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;\n\n // Paragraph\n ParagraphNode: (props: ParagraphProps) => RenderNode<ParagraphProps>;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skLayer: SkiaProps<ChildrenProps>;\n skPaint: SkiaProps<PaintProps>;\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<FractalNoiseProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n\n // Paragraph\n skParagraph: SkiaProps<ParagraphProps>;\n }\n }\n}\n\nexport const createNode = (\n container: Container,\n type: NodeType,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: any\n) => {\n const { Sk } = container;\n switch (type) {\n case NodeType.Layer:\n return Sk.Layer(props);\n case NodeType.Group:\n return Sk.Group(props);\n case NodeType.Paint:\n return Sk.Paint(props);\n // Drawings\n case NodeType.Fill:\n return Sk.Fill(props);\n case NodeType.Image:\n return Sk.Image(props);\n case NodeType.Circle:\n return Sk.Circle(props);\n case NodeType.Path:\n return Sk.Path(props);\n case NodeType.Line:\n return Sk.Line(props);\n case NodeType.Oval:\n return Sk.Oval(props);\n case NodeType.Patch:\n return Sk.Patch(props);\n case NodeType.Points:\n return Sk.Points(props);\n case NodeType.Rect:\n return Sk.Rect(props);\n case NodeType.RRect:\n return Sk.RRect(props);\n case NodeType.Vertices:\n return Sk.Vertices(props);\n case NodeType.Text:\n return Sk.Text(props);\n case NodeType.TextPath:\n return Sk.TextPath(props);\n case NodeType.TextBlob:\n return Sk.TextBlob(props);\n case NodeType.Glyphs:\n return Sk.Glyphs(props);\n case NodeType.DiffRect:\n return Sk.DiffRect(props);\n case NodeType.Picture:\n return Sk.Picture(props);\n case NodeType.ImageSVG:\n return Sk.ImageSVG(props);\n // Mask Filter\n case NodeType.BlurMaskFilter:\n return Sk.BlurMaskFilter(props);\n // Image Filter\n case NodeType.BlendImageFilter:\n return Sk.BlendImageFilter(props);\n case NodeType.BlurImageFilter:\n return Sk.BlurImageFilter(props);\n case NodeType.OffsetImageFilter:\n return Sk.OffsetImageFilter(props);\n case NodeType.DropShadowImageFilter:\n return Sk.DropShadowImageFilter(props);\n case NodeType.DisplacementMapImageFilter:\n return Sk.DisplacementMapImageFilter(props);\n case NodeType.MorphologyImageFilter:\n return Sk.MorphologyImageFilter(props);\n case NodeType.RuntimeShaderImageFilter:\n return Sk.RuntimeShaderImageFilter(props);\n // Color Filter\n case NodeType.MatrixColorFilter:\n return Sk.MatrixColorFilter(props);\n case NodeType.BlendColorFilter:\n return Sk.BlendColorFilter(props);\n case NodeType.LerpColorFilter:\n return Sk.LerpColorFilter(props);\n case NodeType.LumaColorFilter:\n return Sk.LumaColorFilter();\n case NodeType.LinearToSRGBGammaColorFilter:\n return Sk.LinearToSRGBGammaColorFilter();\n case NodeType.SRGBToLinearGammaColorFilter:\n return Sk.SRGBToLinearGammaColorFilter();\n // Shader\n case NodeType.Shader:\n return Sk.Shader(props);\n case NodeType.ImageShader:\n return Sk.ImageShader(props);\n case NodeType.ColorShader:\n return Sk.ColorShader(props);\n case NodeType.Turbulence:\n return Sk.Turbulence(props);\n case NodeType.FractalNoise:\n return Sk.FractalNoise(props);\n case NodeType.LinearGradient:\n return Sk.LinearGradient(props);\n case NodeType.RadialGradient:\n return Sk.RadialGradient(props);\n case NodeType.SweepGradient:\n return Sk.SweepGradient(props);\n case NodeType.TwoPointConicalGradient:\n return Sk.TwoPointConicalGradient(props);\n // Path Effect\n case NodeType.CornerPathEffect:\n return Sk.CornerPathEffect(props);\n case NodeType.DiscretePathEffect:\n return Sk.DiscretePathEffect(props);\n case NodeType.DashPathEffect:\n return Sk.DashPathEffect(props);\n case NodeType.Path1DPathEffect:\n return Sk.Path1DPathEffect(props);\n case NodeType.Path2DPathEffect:\n return Sk.Path2DPathEffect(props);\n case NodeType.SumPathEffect:\n return Sk.SumPathEffect();\n case NodeType.Line2DPathEffect:\n return Sk.Line2DPathEffect(props);\n // Mixed\n case NodeType.Blend:\n return Sk.Blend(props);\n case NodeType.BackdropFilter:\n return Sk.BackdropFilter(props);\n case NodeType.Box:\n return Sk.Box(props);\n case NodeType.BoxShadow:\n return Sk.BoxShadow(props);\n // Paragraph\n case NodeType.Paragraph:\n return Sk.Paragraph(props);\n default:\n return exhaustiveCheck(type);\n }\n};\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AA8DA,SAASC,eAAT,QAAgC,aAAhC;AAGA;AACA,MAAMC,sBAAsB,GAAG,KAA/B;AACA,OAAO,MAAMC,UAAU,GAAGD,sBAAsB,GAAG,KAAH,GAAW,CAAC,CAACE,MAAM,CAACC,UAA7D;AA2MP,OAAO,MAAMC,UAAU,GAAG,CACxBC,SADwB,EAExBC,IAFwB,EAIxBC,KAJwB,KAKrB;EACH,MAAM;IAAEC;EAAF,IAASH,SAAf;;EACA,QAAQC,IAAR;IACE,KAAKR,QAAQ,CAACW,KAAd;MACE,OAAOD,EAAE,CAACC,KAAH,CAASF,KAAT,CAAP;;IACF,KAAKT,QAAQ,CAACY,KAAd;MACE,OAAOF,EAAE,CAACE,KAAH,CAASH,KAAT,CAAP;;IACF,KAAKT,QAAQ,CAACa,KAAd;MACE,OAAOH,EAAE,CAACG,KAAH,CAASJ,KAAT,CAAP;IACF;;IACA,KAAKT,QAAQ,CAACc,IAAd;MACE,OAAOJ,EAAE,CAACI,IAAH,CAAQL,KAAR,CAAP;;IACF,KAAKT,QAAQ,CAACe,KAAd;MACE,OAAOL,EAAE,CAACK,KAAH,CAASN,KAAT,CAAP;;IACF,KAAKT,QAAQ,CAACgB,MAAd;MACE,OAAON,EAAE,CAACM,MAAH,CAAUP,KAAV,CAAP;;IACF,KAAKT,QAAQ,CAACiB,IAAd;MACE,OAAOP,EAAE,CAACO,IAAH,CAAQR,KAAR,CAAP;;IACF,KAAKT,QAAQ,CAACkB,IAAd;MACE,OAAOR,EAAE,CAACQ,IAAH,CAAQT,KAAR,CAAP;;IACF,KAAKT,QAAQ,CAACmB,IAAd;MACE,OAAOT,EAAE,CAACS,IAAH,CAAQV,KAAR,CAAP;;IACF,K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AAP;IACF;;IACA,KAAKT,QAAQ,CAAC8D,KAAd;MACE,OAAOpD,EAAE,CAACoD,KAAH,CAASrD,KAAT,CAAP;;IACF,KAAKT,QAAQ,CAAC+D,cAAd;MACE,OAAOrD,EAAE,CAACqD,cAAH,CAAkBtD,KAAlB,CAAP;;IACF,KAAKT,QAAQ,CAACgE,GAAd;MACE,OAAOtD,EAAE,CAACsD,GAAH,CAAOvD,KAAP,CAAP;;IACF,KAAKT,QAAQ,CAACiE,SAAd;MACE,OAAOvD,EAAE,CAACuD,SAAH,CAAaxD,KAAb,CAAP;IACF;;IACA,KAAKT,QAAQ,CAACkE,SAAd;MACE,OAAOxD,EAAE,CAACwD,SAAH,CAAazD,KAAb,CAAP;;IACF;MACE,OAAOR,eAAe,CAACO,IAAD,CAAtB;EA1HJ;AA4HD,CAnIM"}
|
1
|
+
{"version":3,"names":["NodeType","exhaustiveCheck","shouldUseJSDomOnNative","NATIVE_DOM","global","SkiaDomApi","createNode","container","type","props","Sk","Layer","Group","Paint","Fill","Image","Circle","Path","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","Atlas","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LerpColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow","Paragraph"],"sources":["HostComponents.ts"],"sourcesContent":["import { NodeType } from \"../dom/types\";\nimport type {\n DeclarationNode,\n FractalNoiseProps,\n RenderNode,\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n ParagraphProps,\n AtlasProps,\n} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\nimport type { SkRect, SkRRect } from \"../skia/types\";\nimport type { JsiDrawingNode } from \"../dom/nodes/DrawingNode\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\n// This flag should only be turned on for debugging/testing\nconst shouldUseJSDomOnNative = false;\nexport const NATIVE_DOM = shouldUseJSDomOnNative ? false : !!global.SkiaDomApi;\n\ndeclare global {\n var SkiaDomApi: {\n RectNode: (props: RectProps) => JsiDrawingNode<RectProps, SkRect>;\n RRectNode: (\n props: RoundedRectProps\n ) => JsiDrawingNode<RoundedRectProps, SkRRect>;\n GroupNode: (props: GroupProps) => RenderNode<GroupProps>;\n PaintNode: (props: PaintProps) => DeclarationNode<PaintProps>;\n FillNode: (props: PaintProps) => RenderNode<PaintProps>;\n CircleNode: (props: CircleProps) => RenderNode<CircleProps>;\n PathNode: (props: PathProps) => RenderNode<PathProps>;\n LineNode: (props: LineProps) => RenderNode<LineProps>;\n ImageNode: (props: ImageProps) => RenderNode<ImageProps>;\n OvalNode: (props: OvalProps) => RenderNode<OvalProps>;\n PatchNode: (props: PatchProps) => RenderNode<PatchProps>;\n PointsNode: (props: PointsProps) => RenderNode<PointsProps>;\n DiffRectNode: (props: DiffRectProps) => RenderNode<DiffRectProps>;\n AtlasNode: (props: AtlasProps) => RenderNode<AtlasProps>;\n\n // Mask filters\n BlurMaskFilterNode: (\n props: BlurMaskFilterProps\n ) => DeclarationNode<BlurMaskFilterProps>;\n\n // Path effects\n DashPathEffectNode: (\n props: DashPathEffectProps\n ) => DeclarationNode<DashPathEffectProps>;\n DiscretePathEffectNode: (\n props: DiscretePathEffectProps\n ) => DeclarationNode<DiscretePathEffectProps>;\n CornerPathEffectNode: (\n props: CornerPathEffectProps\n ) => DeclarationNode<CornerPathEffectProps>;\n Path1DPathEffectNode: (\n props: Path1DPathEffectProps\n ) => DeclarationNode<Path1DPathEffectProps>;\n Path2DPathEffectNode: (\n props: Path2DPathEffectProps\n ) => DeclarationNode<Path2DPathEffectProps>;\n Line2DPathEffectNode: (\n props: Line2DPathEffectProps\n ) => DeclarationNode<Line2DPathEffectProps>;\n SumPathEffectNode: () => DeclarationNode<null>;\n\n // Image filters\n BlendImageFilterNode: (\n props: BlendImageFilterProps\n ) => DeclarationNode<BlendImageFilterProps>;\n DropShadowImageFilterNode: (\n props: DropShadowImageFilterProps\n ) => DeclarationNode<DropShadowImageFilterProps>;\n DisplacementMapImageFilterNode: (\n props: DisplacementMapImageFilterProps\n ) => DeclarationNode<DisplacementMapImageFilterProps>;\n BlurImageFilterNode: (\n props: BlurImageFilterProps\n ) => DeclarationNode<BlurImageFilterProps>;\n OffsetImageFilterNode: (\n props: OffsetImageFilterProps\n ) => DeclarationNode<OffsetImageFilterProps>;\n MorphologyImageFilterNode: (\n props: MorphologyImageFilterProps\n ) => DeclarationNode<MorphologyImageFilterProps>;\n RuntimeShaderImageFilterNode: (\n props: RuntimeShaderImageFilterProps\n ) => DeclarationNode<RuntimeShaderImageFilterProps>;\n\n // Color filters\n MatrixColorFilterNode: (\n props: MatrixColorFilterProps\n ) => DeclarationNode<MatrixColorFilterProps>;\n BlendColorFilterNode: (\n props: BlendColorFilterProps\n ) => DeclarationNode<BlendColorFilterProps>;\n LinearToSRGBGammaColorFilterNode: () => DeclarationNode<null>;\n SRGBToLinearGammaColorFilterNode: () => DeclarationNode<null>;\n LumaColorFilterNode: () => DeclarationNode<null>;\n LerpColorFilterNode: (\n props: LerpColorFilterProps\n ) => DeclarationNode<LerpColorFilterProps>;\n\n // Shaders\n ShaderNode: (props: ShaderProps) => DeclarationNode<ShaderProps>;\n ImageShaderNode: (\n props: ImageShaderProps\n ) => DeclarationNode<ImageShaderProps>;\n ColorShaderNode: (props: ColorProps) => DeclarationNode<ColorProps>;\n TurbulenceNode: (\n props: TurbulenceProps\n ) => DeclarationNode<TurbulenceProps>;\n FractalNoiseNode: (\n props: FractalNoiseProps\n ) => DeclarationNode<FractalNoiseProps>;\n LinearGradientNode: (\n props: LinearGradientProps\n ) => DeclarationNode<LinearGradientProps>;\n RadialGradientNode: (\n props: RadialGradientProps\n ) => DeclarationNode<RadialGradientProps>;\n SweepGradientNode: (\n props: SweepGradientProps\n ) => DeclarationNode<SweepGradientProps>;\n TwoPointConicalGradientNode: (\n props: TwoPointConicalGradientProps\n ) => DeclarationNode<TwoPointConicalGradientProps>;\n PictureNode: (props: PictureProps) => RenderNode<PictureProps>;\n ImageSVGNode: (props: ImageSVGProps) => RenderNode<ImageSVGProps>;\n VerticesNode: (props: VerticesProps) => RenderNode<VerticesProps>;\n TextNode: (prop: TextProps) => RenderNode<TextProps>;\n TextPathNode: (prop: TextPathProps) => RenderNode<TextPathProps>;\n TextBlobNode: (prop: TextBlobProps) => RenderNode<TextBlobProps>;\n GlyphsNode: (prop: GlyphsProps) => RenderNode<GlyphsProps>;\n BlendNode: (prop: BlendProps) => DeclarationNode<BlendProps>;\n BackdropFilterNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;\n BoxNode: (prop: BoxProps) => RenderNode<BoxProps>;\n BoxShadowNode: (prop: BoxShadowProps) => DeclarationNode<BoxShadowProps>;\n LayerNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;\n\n // Paragraph\n ParagraphNode: (props: ParagraphProps) => RenderNode<ParagraphProps>;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skLayer: SkiaProps<ChildrenProps>;\n skPaint: SkiaProps<PaintProps>;\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skAtlas: SkiaProps<AtlasProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<FractalNoiseProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n\n // Paragraph\n skParagraph: SkiaProps<ParagraphProps>;\n }\n }\n}\n\nexport const createNode = (\n container: Container,\n type: NodeType,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: any\n) => {\n const { Sk } = container;\n switch (type) {\n case NodeType.Layer:\n return Sk.Layer(props);\n case NodeType.Group:\n return Sk.Group(props);\n case NodeType.Paint:\n return Sk.Paint(props);\n // Drawings\n case NodeType.Fill:\n return Sk.Fill(props);\n case NodeType.Image:\n return Sk.Image(props);\n case NodeType.Circle:\n return Sk.Circle(props);\n case NodeType.Path:\n return Sk.Path(props);\n case NodeType.Line:\n return Sk.Line(props);\n case NodeType.Oval:\n return Sk.Oval(props);\n case NodeType.Patch:\n return Sk.Patch(props);\n case NodeType.Points:\n return Sk.Points(props);\n case NodeType.Rect:\n return Sk.Rect(props);\n case NodeType.RRect:\n return Sk.RRect(props);\n case NodeType.Vertices:\n return Sk.Vertices(props);\n case NodeType.Text:\n return Sk.Text(props);\n case NodeType.TextPath:\n return Sk.TextPath(props);\n case NodeType.TextBlob:\n return Sk.TextBlob(props);\n case NodeType.Glyphs:\n return Sk.Glyphs(props);\n case NodeType.Atlas:\n return Sk.Atlas(props);\n case NodeType.DiffRect:\n return Sk.DiffRect(props);\n case NodeType.Picture:\n return Sk.Picture(props);\n case NodeType.ImageSVG:\n return Sk.ImageSVG(props);\n // Mask Filter\n case NodeType.BlurMaskFilter:\n return Sk.BlurMaskFilter(props);\n // Image Filter\n case NodeType.BlendImageFilter:\n return Sk.BlendImageFilter(props);\n case NodeType.BlurImageFilter:\n return Sk.BlurImageFilter(props);\n case NodeType.OffsetImageFilter:\n return Sk.OffsetImageFilter(props);\n case NodeType.DropShadowImageFilter:\n return Sk.DropShadowImageFilter(props);\n case NodeType.DisplacementMapImageFilter:\n return Sk.DisplacementMapImageFilter(props);\n case NodeType.MorphologyImageFilter:\n return Sk.MorphologyImageFilter(props);\n case NodeType.RuntimeShaderImageFilter:\n return Sk.RuntimeShaderImageFilter(props);\n // Color Filter\n case NodeType.MatrixColorFilter:\n return Sk.MatrixColorFilter(props);\n case NodeType.BlendColorFilter:\n return Sk.BlendColorFilter(props);\n case NodeType.LerpColorFilter:\n return Sk.LerpColorFilter(props);\n case NodeType.LumaColorFilter:\n return Sk.LumaColorFilter();\n case NodeType.LinearToSRGBGammaColorFilter:\n return Sk.LinearToSRGBGammaColorFilter();\n case NodeType.SRGBToLinearGammaColorFilter:\n return Sk.SRGBToLinearGammaColorFilter();\n // Shader\n case NodeType.Shader:\n return Sk.Shader(props);\n case NodeType.ImageShader:\n return Sk.ImageShader(props);\n case NodeType.ColorShader:\n return Sk.ColorShader(props);\n case NodeType.Turbulence:\n return Sk.Turbulence(props);\n case NodeType.FractalNoise:\n return Sk.FractalNoise(props);\n case NodeType.LinearGradient:\n return Sk.LinearGradient(props);\n case NodeType.RadialGradient:\n return Sk.RadialGradient(props);\n case NodeType.SweepGradient:\n return Sk.SweepGradient(props);\n case NodeType.TwoPointConicalGradient:\n return Sk.TwoPointConicalGradient(props);\n // Path Effect\n case NodeType.CornerPathEffect:\n return Sk.CornerPathEffect(props);\n case NodeType.DiscretePathEffect:\n return Sk.DiscretePathEffect(props);\n case NodeType.DashPathEffect:\n return Sk.DashPathEffect(props);\n case NodeType.Path1DPathEffect:\n return Sk.Path1DPathEffect(props);\n case NodeType.Path2DPathEffect:\n return Sk.Path2DPathEffect(props);\n case NodeType.SumPathEffect:\n return Sk.SumPathEffect();\n case NodeType.Line2DPathEffect:\n return Sk.Line2DPathEffect(props);\n // Mixed\n case NodeType.Blend:\n return Sk.Blend(props);\n case NodeType.BackdropFilter:\n return Sk.BackdropFilter(props);\n case NodeType.Box:\n return Sk.Box(props);\n case NodeType.BoxShadow:\n return Sk.BoxShadow(props);\n // Paragraph\n case NodeType.Paragraph:\n return Sk.Paragraph(props);\n default:\n return exhaustiveCheck(type);\n }\n};\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AA+DA,SAASC,eAAT,QAAgC,aAAhC;AAGA;AACA,MAAMC,sBAAsB,GAAG,KAA/B;AACA,OAAO,MAAMC,UAAU,GAAGD,sBAAsB,GAAG,KAAH,GAAW,CAAC,CAACE,MAAM,CAACC,UAA7D;AA6MP,OAAO,MAAMC,UAAU,GAAG,CACxBC,SADwB,EAExBC,IAFwB,EAIxBC,KAJwB,K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