@shopify/react-native-skia 2.11.0-next.2 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cpp/api/recorder/Convertor.h +57 -9
- package/cpp/api/third_party/SkottieUtils.cpp +1 -1
- package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +0 -2
- package/cpp/skia/include/android/vk/AndroidVulkanMemoryAllocator.h +1 -1
- package/cpp/skia/include/codec/SkAndroidCodec.h +1 -1
- package/cpp/skia/include/codec/SkAvifDecoder.h +1 -1
- package/cpp/skia/include/codec/SkBmpDecoder.h +1 -1
- package/cpp/skia/include/codec/SkBmpRustDecoder.h +42 -0
- package/cpp/skia/include/codec/SkCodec.h +3 -2
- 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/SkPixmapUtils.h +1 -1
- package/cpp/skia/include/codec/SkPngDecoder.h +1 -1
- package/cpp/skia/include/codec/SkPngRustDecoder.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/core/SkBitmap.h +3 -3
- package/cpp/skia/include/core/SkCPUContext.h +1 -1
- package/cpp/skia/include/core/SkCPURecorder.h +2 -3
- package/cpp/skia/include/core/SkCanvas.h +23 -15
- package/cpp/skia/include/core/SkColor.h +2 -2
- package/cpp/skia/include/core/SkColorFilter.h +1 -1
- package/cpp/skia/include/core/SkColorSpace.h +2 -2
- package/cpp/skia/include/core/SkColorTable.h +1 -1
- package/cpp/skia/include/core/SkContourMeasure.h +1 -1
- package/cpp/skia/include/core/SkData.h +1 -1
- package/cpp/skia/include/core/SkDataTable.h +2 -2
- package/cpp/skia/include/core/SkDocument.h +1 -1
- package/cpp/skia/include/core/SkDrawable.h +1 -1
- package/cpp/skia/include/core/SkFont.h +2 -2
- package/cpp/skia/include/core/SkFontMetrics.h +1 -1
- package/cpp/skia/include/core/SkFontMgr.h +1 -1
- package/cpp/skia/include/core/SkFontScanner.h +3 -3
- package/cpp/skia/include/core/SkFontStyle.h +1 -1
- package/cpp/skia/include/core/SkGraphics.h +1 -1
- package/cpp/skia/include/core/SkImage.h +1 -1
- package/cpp/skia/include/core/SkImageFilter.h +1 -1
- package/cpp/skia/include/core/SkImageGenerator.h +1 -1
- package/cpp/skia/include/core/SkImageInfo.h +4 -4
- package/cpp/skia/include/core/SkMatrix.h +3 -3
- package/cpp/skia/include/core/SkMesh.h +2 -2
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkOverdrawCanvas.h +1 -1
- package/cpp/skia/include/core/SkPaint.h +4 -4
- package/cpp/skia/include/core/SkPath.h +5 -23
- package/cpp/skia/include/core/SkPathBuilder.h +4 -2
- package/cpp/skia/include/core/SkPathMeasure.h +1 -1
- package/cpp/skia/include/core/SkPictureRecorder.h +1 -1
- package/cpp/skia/include/core/SkPixelRef.h +3 -5
- package/cpp/skia/include/core/SkPixmap.h +7 -2
- package/cpp/skia/include/core/SkPoint.h +555 -5
- package/cpp/skia/include/core/SkPoint3.h +2 -2
- package/cpp/skia/include/core/SkRRect.h +9 -1
- package/cpp/skia/include/core/SkRSXform.h +1 -1
- package/cpp/skia/include/core/SkRecorder.h +2 -3
- package/cpp/skia/include/core/SkRect.h +3 -3
- package/cpp/skia/include/core/SkRefCnt.h +1 -1
- package/cpp/skia/include/core/SkRegion.h +4 -4
- package/cpp/skia/include/core/SkScalar.h +2 -3
- package/cpp/skia/include/core/SkSerialProcs.h +1 -1
- package/cpp/skia/include/core/SkShader.h +1 -1
- package/cpp/skia/include/core/SkSize.h +1 -1
- package/cpp/skia/include/core/SkSpan.h +165 -4
- package/cpp/skia/include/core/SkStream.h +2 -2
- package/cpp/skia/include/core/SkStrikeRef.h +16 -0
- package/cpp/skia/include/core/SkString.h +2 -2
- package/cpp/skia/include/core/SkStrokeRec.h +1 -1
- package/cpp/skia/include/core/SkSurfaceProps.h +1 -1
- package/cpp/skia/include/core/SkSwizzle.h +1 -1
- package/cpp/skia/include/core/SkTextBlob.h +2 -2
- package/cpp/skia/include/core/SkTiledImageUtils.h +1 -1
- package/cpp/skia/include/core/SkTypeface.h +8 -2
- package/cpp/skia/include/core/SkTypes.h +6 -6
- package/cpp/skia/include/core/SkUnPreMultiply.h +1 -1
- package/cpp/skia/include/core/SkVertices.h +1 -1
- package/cpp/skia/include/core/SkYUVAPixmaps.h +1 -1
- package/cpp/skia/include/docs/SkPDFDocument.h +9 -3
- package/cpp/skia/include/effects/SkGradient.h +1 -1
- package/cpp/skia/include/effects/SkPerlinNoiseShader.h +1 -1
- package/cpp/skia/include/effects/SkRuntimeEffect.h +4 -4
- package/cpp/skia/include/encode/SkEncoder.h +3 -3
- package/cpp/skia/include/encode/SkICC.h +1 -1
- package/cpp/skia/include/encode/SkJpegEncoder.h +1 -1
- package/cpp/skia/include/encode/SkPngEncoder.h +1 -1
- package/cpp/skia/include/encode/SkPngRustEncoder.h +16 -1
- package/cpp/skia/include/encode/SkWebpEncoder.h +1 -1
- package/cpp/skia/include/gpu/GpuTypes.h +1 -1
- package/cpp/skia/include/gpu/MutableTextureState.h +1 -1
- package/cpp/skia/include/gpu/ganesh/GrBackendSemaphore.h +2 -2
- package/cpp/skia/include/gpu/ganesh/GrBackendSurface.h +3 -3
- package/cpp/skia/include/gpu/ganesh/GrDriverBugWorkaroundsAutogen.h +39 -37
- package/cpp/skia/include/gpu/ganesh/GrExternalTextureGenerator.h +1 -1
- package/cpp/skia/include/gpu/ganesh/GrRecordingContext.h +3 -2
- package/cpp/skia/include/gpu/ganesh/GrTypes.h +1 -1
- package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +1 -1
- package/cpp/skia/include/gpu/ganesh/SkMeshGanesh.h +1 -1
- package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +1 -1
- package/cpp/skia/include/gpu/ganesh/d3d/GrD3DBackendSemaphore.h +1 -1
- package/cpp/skia/include/gpu/ganesh/d3d/GrD3DBackendSurface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/d3d/GrD3DDirectContext.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLAssembleInterface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLConfig.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLExtensions.h +2 -2
- package/cpp/skia/include/gpu/ganesh/gl/GrGLFunctions.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLMakeWebGLInterface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/epoxy/GrGLMakeEpoxyEGLInterface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/glx/GrGLMakeGLXInterface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/ios/GrGLMakeIOSInterface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/mac/GrGLMakeMacInterface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/win/GrGLMakeWinInterface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/mock/GrMockBackendSurface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/mock/GrMockTypes.h +1 -1
- package/cpp/skia/include/gpu/ganesh/mtl/GrMtlBackendSemaphore.h +1 -1
- package/cpp/skia/include/gpu/ganesh/mtl/GrMtlBackendSurface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/mtl/GrMtlDirectContext.h +1 -1
- package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +1 -1
- package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h +1 -1
- package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +1 -1
- package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +2 -2
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +2 -2
- package/cpp/skia/include/gpu/graphite/Context.h +3 -3
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +8 -2
- package/cpp/skia/include/gpu/graphite/PersistentPipelineStorage.h +1 -1
- package/cpp/skia/include/gpu/graphite/PrecompileContext.h +16 -2
- package/cpp/skia/include/gpu/graphite/Recorder.h +8 -7
- package/cpp/skia/include/gpu/graphite/Recording.h +6 -4
- package/cpp/skia/include/gpu/graphite/TextureInfo.h +2 -2
- package/cpp/skia/include/gpu/graphite/dawn/DawnGraphiteTypes.h +1 -1
- package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +1 -1
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +1 -1
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes_cpp.h +1 -1
- package/cpp/skia/include/gpu/graphite/precompile/PaintOptions.h +2 -2
- package/cpp/skia/include/gpu/graphite/precompile/PrecompileImageFilter.h +1 -1
- package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteContext.h +1 -1
- package/cpp/skia/include/gpu/vk/VulkanBackendContext.h +1 -1
- package/cpp/skia/include/gpu/vk/VulkanExtensions.h +3 -3
- package/cpp/skia/include/gpu/vk/VulkanMutableTextureState.h +1 -1
- package/cpp/skia/include/gpu/vk/VulkanPreferredFeatures.h +1 -1
- package/cpp/skia/include/gpu/vk/VulkanTypes.h +1 -1
- package/cpp/skia/include/pathops/SkPathOps.h +2 -2
- package/cpp/skia/include/ports/SkImageGeneratorCG.h +2 -2
- package/cpp/skia/include/ports/SkImageGeneratorWIC.h +2 -2
- package/cpp/skia/include/private/{base/SingleOwner.h → SingleOwner.h} +5 -5
- package/cpp/skia/include/private/{base/SkAPI.h → SkAPI.h} +1 -1
- package/cpp/skia/include/private/{base/SkAlign.h → SkAlign.h} +1 -1
- package/cpp/skia/include/private/{base/SkAnySubclass.h → SkAnySubclass.h} +1 -1
- package/cpp/skia/include/private/{base/SkAssert.h → SkAssert.h} +4 -4
- package/cpp/skia/include/private/{base/SkAttributes.h → SkAttributes.h} +2 -2
- package/cpp/skia/include/private/{base/SkContainers.h → SkContainers.h} +3 -3
- package/cpp/skia/include/private/{base/SkDebug.h → SkDebug.h} +3 -3
- package/cpp/skia/include/private/{base/SkDeque.h → SkDeque.h} +1 -1
- package/cpp/skia/include/private/SkEncodedInfo.h +2 -2
- package/cpp/skia/include/private/SkEnumBitMask.h +92 -0
- package/cpp/skia/include/private/SkExif.h +1 -1
- package/cpp/skia/include/private/{base/SkFixed.h → SkFixed.h} +4 -4
- package/cpp/skia/include/private/{base/SkFloatingPoint.h → SkFloatingPoint.h} +2 -2
- package/cpp/skia/include/private/SkGainmapShader.h +1 -1
- package/cpp/skia/include/private/SkHdrMetadata.h +1 -1
- package/cpp/skia/include/private/SkIDChangeListener.h +3 -3
- package/cpp/skia/include/private/{base/SkLoadUserConfig.h → SkLoadUserConfig.h} +2 -2
- package/cpp/skia/include/private/{base/SkLog.h → SkLog.h} +4 -4
- package/cpp/skia/include/private/{base/SkMacros.h → SkMacros.h} +1 -1
- package/cpp/skia/include/private/{base/SkMalloc.h → SkMalloc.h} +1 -1
- package/cpp/skia/include/private/{base/SkMath.h → SkMath.h} +2 -2
- package/cpp/skia/include/private/{base/SkMutex.h → SkMutex.h} +5 -5
- package/cpp/skia/include/private/{base/SkNoncopyable.h → SkNoncopyable.h} +1 -1
- package/cpp/skia/include/private/{base/SkOnce.h → SkOnce.h} +1 -1
- package/cpp/skia/include/private/SkPathRef.h +4 -4
- package/cpp/skia/include/private/SkPixelStorage.h +20 -5
- package/cpp/skia/include/private/{base/SkSafe32.h → SkSafe32.h} +2 -2
- package/cpp/skia/include/private/{base/SkSemaphore.h → SkSemaphore.h} +3 -3
- package/cpp/skia/include/private/{base/SkTArray.h → SkTArray.h} +10 -11
- package/cpp/skia/include/private/{base/SkTDArray.h → SkTDArray.h} +4 -4
- package/cpp/skia/include/private/{base/SkTFitsIn.h → SkTFitsIn.h} +0 -2
- package/cpp/skia/include/private/{base/SkTLogic.h → SkTLogic.h} +1 -1
- package/cpp/skia/include/private/{base/SkTemplates.h → SkTemplates.h} +5 -6
- package/cpp/skia/include/private/{base/SkThreadAnnotations.h → SkThreadAnnotations.h} +1 -1
- package/cpp/skia/include/private/{base/SkThreadID.h → SkThreadID.h} +2 -2
- package/cpp/skia/include/private/{base/SkTo.h → SkTo.h} +2 -2
- package/cpp/skia/include/private/{base/SkTypeTraits.h → SkTypeTraits.h} +20 -0
- package/cpp/skia/include/private/SkXmp.h +1 -1
- package/cpp/skia/include/private/chromium/GrDeferredDisplayList.h +1 -1
- package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +1 -1
- package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +1 -1
- package/cpp/skia/include/private/chromium/SkCodecsICCProfileChromium.h +1 -1
- package/cpp/skia/include/private/chromium/SkExifChromium.h +1 -1
- package/cpp/skia/include/private/chromium/SkImageChromium.h +1 -1
- package/cpp/skia/include/private/chromium/SkPMColor.h +1 -1
- package/cpp/skia/include/private/chromium/Slug.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +2 -2
- package/cpp/skia/include/private/gpu/ganesh/GrTextureGenerator.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +4 -4
- package/cpp/skia/include/utils/SkCamera.h +1 -1
- package/cpp/skia/include/utils/SkNWayCanvas.h +1 -1
- package/cpp/skia/include/utils/SkPaintFilterCanvas.h +1 -1
- package/cpp/skia/modules/jsonreader/SkJSONReader.cpp +6 -6
- package/cpp/skia/modules/jsonreader/SkJSONReader.h +2 -2
- package/cpp/skia/modules/skottie/include/SkottieProperty.h +1 -1
- package/cpp/skia/modules/skottie/include/SlotManager.h +2 -2
- package/cpp/skia/modules/skottie/include/TextShaper.h +1 -1
- package/cpp/skia/modules/skottie/src/text/Font.h +1 -1
- package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +1 -1
- package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -1
- package/cpp/skia/modules/skresources/include/SkResources.h +1 -1
- package/cpp/skia/modules/sksg/include/SkSGNode.h +1 -1
- package/cpp/skia/modules/sksg/include/SkSGRect.h +1 -1
- package/cpp/skia/modules/sksg/include/SkSGRenderEffect.h +1 -1
- package/cpp/skia/modules/skunicode/include/SkUnicode.h +3 -3
- package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGCircle.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGClipPath.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGContainer.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGDOM.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGEllipse.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFe.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeBlend.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeColorMatrix.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeComponentTransfer.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeComposite.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeDisplacementMap.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeFlood.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeGaussianBlur.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeImage.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGFeLighting.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeMerge.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeOffset.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeTurbulence.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFilter.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGGradient.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGImage.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGLine.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGLinearGradient.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGMask.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGNode.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGPath.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGPattern.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGPoly.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRadialGradient.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRect.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGSVG.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGShape.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGStop.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGText.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGTransformableNode.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGUse.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGValue.h +1 -1
- package/cpp/skia/src/{base → core}/SkArenaAlloc.h +5 -5
- package/cpp/skia/src/{base → core}/SkAutoLocaleSetter.h +1 -1
- package/cpp/skia/src/core/SkChecksum.h +1 -1
- package/cpp/skia/src/core/SkLRUCache.h +1 -1
- package/cpp/skia/src/{base → core}/SkMathPriv.h +3 -3
- package/cpp/skia/src/core/SkTHash.h +1 -1
- package/cpp/skia/src/{base → core}/SkTInternalLList.h +3 -3
- package/cpp/skia/src/{base → core}/SkTLazy.h +1 -1
- package/cpp/skia/src/{base → core}/SkUTF.h +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +27 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js +28 -0
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Core.js +8 -1
- package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js +8 -0
- package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -1
- package/lib/commonjs/sksg/Recorder/Recorder.js +4 -0
- package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -1
- package/lib/commonjs/sksg/utils.d.ts +4 -0
- package/lib/commonjs/sksg/utils.js +14 -1
- package/lib/commonjs/sksg/utils.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.d.ts +27 -1
- package/lib/module/renderer/processors/Animations/Animations.js +21 -0
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/sksg/Recorder/Core.js +8 -1
- package/lib/module/sksg/Recorder/Core.js.map +1 -1
- package/lib/module/sksg/Recorder/ReanimatedRecorder.js +9 -1
- package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
- package/lib/module/sksg/Recorder/Recorder.d.ts +1 -1
- package/lib/module/sksg/Recorder/Recorder.js +5 -1
- package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
- package/lib/module/sksg/utils.d.ts +4 -0
- package/lib/module/sksg/utils.js +12 -0
- package/lib/module/sksg/utils.js.map +1 -1
- package/lib/typescript/lib/commonjs/renderer/processors/Animations/Animations.d.ts +22 -0
- package/lib/typescript/lib/commonjs/sksg/utils.d.ts +1 -0
- package/lib/typescript/lib/module/mock/index.d.ts +4 -0
- package/lib/typescript/lib/module/renderer/processors/Animations/Animations.d.ts +4 -0
- package/lib/typescript/lib/module/renderer/processors/Animations/index.d.ts +1 -1
- package/lib/typescript/lib/module/sksg/utils.d.ts +1 -0
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +27 -1
- package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +1 -1
- package/lib/typescript/src/sksg/utils.d.ts +4 -0
- package/package.json +9 -9
- package/src/renderer/processors/Animations/Animations.ts +34 -1
- package/src/sksg/Recorder/Core.ts +11 -1
- package/src/sksg/Recorder/ReanimatedRecorder.ts +10 -1
- package/src/sksg/Recorder/Recorder.ts +7 -3
- package/src/sksg/utils.ts +18 -0
- package/cpp/dawn/include/dawn/dawn_proc.h +0 -53
- package/cpp/dawn/include/dawn/dawn_proc_table.h +0 -330
- package/cpp/dawn/include/dawn/dawn_thread_dispatch_proc.h +0 -47
- package/cpp/dawn/include/dawn/dawn_version.h +0 -41
- package/cpp/dawn/include/dawn/native/D3D11Backend.h +0 -65
- package/cpp/dawn/include/dawn/native/D3D12Backend.h +0 -86
- package/cpp/dawn/include/dawn/native/D3DBackend.h +0 -56
- package/cpp/dawn/include/dawn/native/DawnNative.h +0 -369
- package/cpp/dawn/include/dawn/native/MetalBackend.h +0 -56
- package/cpp/dawn/include/dawn/native/NullBackend.h +0 -39
- package/cpp/dawn/include/dawn/native/OpenGLBackend.h +0 -89
- package/cpp/dawn/include/dawn/native/VulkanBackend.h +0 -183
- package/cpp/dawn/include/dawn/native/WebGPUBackend.h +0 -49
- package/cpp/dawn/include/dawn/native/dawn_native_export.h +0 -49
- package/cpp/dawn/include/dawn/platform/DawnPlatform.h +0 -210
- package/cpp/dawn/include/dawn/platform/dawn_platform_export.h +0 -49
- package/cpp/dawn/include/dawn/replay/Replay.h +0 -99
- package/cpp/dawn/include/dawn/replay/dawn_replay_export.h +0 -49
- package/cpp/dawn/include/dawn/webgpu_cpp_print.h +0 -2844
- package/cpp/dawn/include/tint/tint.h +0 -90
- package/cpp/dawn/include/webgpu/webgpu.h +0 -4987
- package/cpp/dawn/include/webgpu/webgpu_cpp.h +0 -10080
- package/cpp/dawn/include/webgpu/webgpu_cpp_chained_struct.h +0 -57
- package/cpp/dawn/include/webgpu/webgpu_enum_class_bitmasks.h +0 -161
- package/cpp/dawn/include/webgpu/webgpu_glfw.h +0 -88
- package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteUtils.h +0 -10
- package/cpp/skia/include/private/base/README.md +0 -4
- package/cpp/skia/include/private/base/SkPoint_impl.h +0 -560
- package/cpp/skia/include/private/base/SkSpan_impl.h +0 -158
- package/cpp/skia/src/gpu/graphite/ContextOptionsPriv.h +0 -45
- package/cpp/skia/src/gpu/graphite/ResourceTypes.h +0 -360
- package/cpp/skia/src/gpu/graphite/TextureProxyView.h +0 -105
- package/libs/.graphite +0 -1
- /package/cpp/skia/include/private/{base/SkASAN.h → SkASAN.h} +0 -0
- /package/cpp/skia/include/private/{base/SkAlignedStorage.h → SkAlignedStorage.h} +0 -0
- /package/cpp/skia/include/private/{base/SkCPUTypes.h → SkCPUTypes.h} +0 -0
- /package/cpp/skia/include/private/{base/SkFeatures.h → SkFeatures.h} +0 -0
- /package/cpp/skia/include/private/{base/SkLogPriority.h → SkLogPriority.h} +0 -0
- /package/cpp/skia/include/private/{base/SkTPin.h → SkTPin.h} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_types","require","_utils","_Node","_Core","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","disposeRecording","recording","paintPool","forEach","paint","dispose","length","lastPicture","exports","Recorder","constructor","Set","cursors","push","commands","getRecording","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","isSharedValue","add","undefined","command","saveGroup","children","group","type","CommandType","Group","restoreGroup","pop","savePaint","standalone","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","isPathEffect","Error","PushPathEffect","pushImageFilter","imageFilterType","isImageFilter","PushImageFilter","pushColorFilter","colorFilterType","isColorFilter","PushColorFilter","pushShader","shaderType","isShader","NodeType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas","drawSkottie","DrawSkottie"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n SkottieProps,\n DrawingNodeProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, SkPicture, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n // Last picture produced from this recording. The view keeps its own\n // reference to the picture it displays, so the renderer owns this one and\n // disposes it when the next frame replaces it or the recording is disposed.\n lastPicture?: SkPicture | null;\n}\n\nexport const disposeRecording = (recording: Recording) => {\n \"worklet\";\n recording.paintPool.forEach((paint) => paint.dispose());\n recording.paintPool.length = 0;\n if (recording.lastPicture) {\n recording.lastPicture.dispose();\n recording.lastPicture = null;\n }\n};\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup(props?: AnimatedProps<Pick<DrawingNodeProps, \"zIndex\">>) {\n const children: Command[] = [];\n const group: Command = { type: CommandType.Group, children };\n if (props) {\n group.props = props;\n }\n this.add(group);\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean) {\n this.add({ type: CommandType.SavePaint, props, standalone });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(\n shaderType: NodeType,\n props: AnimatedProps<unknown>,\n children: number\n ) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props, children });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n\n drawSkottie(props: AnimatedProps<SkottieProps>) {\n this.add({ type: CommandType.DrawSkottie, props });\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AA8BA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAGA,IAAAG,KAAA,GAAAH,OAAA;AAAqC,SAAAI,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAY9B,MAAMgB,gBAAgB,GAAIC,SAAoB,IAAK;EACxD,SAAS;;EACTA,SAAS,CAACC,SAAS,CAACC,OAAO,CAAEC,KAAK,IAAKA,KAAK,CAACC,OAAO,CAA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IAAI,CAACM,GAAG,CAAC;MAAEM,IAAI,EAAEC,iBAAW,CAACsF,WAAW;MAAEnG;IAAM,CAAC,CAAC;EACpD;EAEAoG,YAAYA,CAACpG,KAAmC,EAAE;IAChD,IAAI,CAACM,GAAG,CAAC;MAAEM,IAAI,EAAEC,iBAAW,CAACwF,YAAY;MAAErG;IAAM,CAAC,CAAC;EACrD;EAEAsG,aAAaA,CAACtG,KAAoC,EAAE;IAClD,IAAI,CAACM,GAAG,CAAC;MAAEM,IAAI,EAAEC,iBAAW,CAAC0F,aAAa;MAAEvG;IAAM,CAAC,CAAC;EACtD;EAEAwG,SAASA,CAACxG,KAAgC,EAAE;IAC1C,IAAI,CAACM,GAAG,CAAC;MAAEM,IAAI,EAAEC,iBAAW,CAAC4F,SAAS;MAAEzG;IAAM,CAAC,CAAC;EAClD;EAEA0G,WAAWA,CAAC1G,KAAkC,EAAE;IAC9C,IAAI,CAACM,GAAG,CAAC;MAAEM,IAAI,EAAEC,iBAAW,CAAC8F,WAAW;MAAE3G;IAAM,CAAC,CAAC;EACpD;AACF;AAACV,OAAA,CAAAC,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_types","require","_utils","_Node","_Core","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","disposeRecording","recording","paintPool","forEach","paint","dispose","length","lastPicture","exports","Recorder","constructor","Set","cursors","push","commands","getRecording","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","isSharedValue","add","isSharedValueSelector","__sv","undefined","command","saveGroup","children","group","type","CommandType","Group","restoreGroup","pop","savePaint","standalone","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","isPathEffect","Error","PushPathEffect","pushImageFilter","imageFilterType","isImageFilter","PushImageFilter","pushColorFilter","colorFilterType","isColorFilter","PushColorFilter","pushShader","shaderType","isShader","NodeType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas","drawSkottie","DrawSkottie"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n SkottieProps,\n DrawingNodeProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue, isSharedValueSelector } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, SkPicture, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n // Last picture produced from this recording. The view keeps its own\n // reference to the picture it displays, so the renderer owns this one and\n // disposes it when the next frame replaces it or the recording is disposed.\n lastPicture?: SkPicture | null;\n}\n\nexport const disposeRecording = (recording: Recording) => {\n \"worklet\";\n recording.paintPool.forEach((paint) => paint.dispose());\n recording.paintPool.length = 0;\n if (recording.lastPicture) {\n recording.lastPicture.dispose();\n recording.lastPicture = null;\n }\n};\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, unknown> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n } else if (isSharedValueSelector(prop)) {\n this.animationValues.add(prop.__sv);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup(props?: AnimatedProps<Pick<DrawingNodeProps, \"zIndex\">>) {\n const children: Command[] = [];\n const group: Command = { type: CommandType.Group, children };\n if (props) {\n group.props = props;\n }\n this.add(group);\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean) {\n this.add({ type: CommandType.SavePaint, props, standalone });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(\n shaderType: NodeType,\n props: AnimatedProps<unknown>,\n children: number\n ) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props, children });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, unknown>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n\n drawSkottie(props: AnimatedProps<SkottieProps>) {\n this.add({ type: CommandType.DrawSkottie, props });\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AA8BA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAGA,IAAAG,KAAA,GAAAH,OAAA;AAAqC,SAAAI,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAY9B,MAAMgB,gBAAgB,GAAIC,S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CAAC,CAAC;EACrD;EAEAgG,YAAYA,CAAChG,KAAmC,EAAE;IAChD,IAAI,CAACM,GAAG,CAAC;MAAEQ,IAAI,EAAEC,iBAAW,CAACkF,YAAY;MAAEjG;IAAM,CAAC,CAAC;EACrD;EAEAkG,UAAUA,CAAClG,KAAiC,EAAE;IAC5C,IAAI,CAACM,GAAG,CAAC;MAAEQ,IAAI,EAAEC,iBAAW,CAACoF,UAAU;MAAEnG;IAAM,CAAC,CAAC;EACnD;EAEAoG,WAAWA,CAACpG,KAAkC,EAAE;IAC9C,IAAI,CAACM,GAAG,CAAC;MAAEQ,IAAI,EAAEC,iBAAW,CAACsF,WAAW;MAAErG;IAAM,CAAC,CAAC;EACpD;EAEAsG,YAAYA,CAACtG,KAAmC,EAAE;IAChD,IAAI,CAACM,GAAG,CAAC;MAAEQ,IAAI,EAAEC,iBAAW,CAACwF,YAAY;MAAEvG;IAAM,CAAC,CAAC;EACrD;EAEAwG,aAAaA,CAACxG,KAAoC,EAAE;IAClD,IAAI,CAACM,GAAG,CAAC;MAAEQ,IAAI,EAAEC,iBAAW,CAAC0F,aAAa;MAAEzG;IAAM,CAAC,CAAC;EACtD;EAEA0G,SAASA,CAAC1G,KAAgC,EAAE;IAC1C,IAAI,CAACM,GAAG,CAAC;MAAEQ,IAAI,EAAEC,iBAAW,CAAC4F,SAAS;MAAE3G;IAAM,CAAC,CAAC;EAClD;EAEA4G,WAAWA,CAAC5G,KAAkC,EAAE;IAC9C,IAAI,CAACM,GAAG,CAAC;MAAEQ,IAAI,EAAEC,iBAAW,CAAC8F,WAAW;MAAE7G;IAAM,CAAC,CAAC;EACpD;AACF;AAACV,OAAA,CAAAC,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { SharedValue } from "react-native-reanimated";
|
|
2
2
|
export declare const isSharedValue: <T = unknown>(value: unknown) => value is SharedValue<T>;
|
|
3
|
+
export declare const isSharedValueSelector: (value: unknown) => value is {
|
|
4
|
+
__sv: SharedValue<unknown>;
|
|
5
|
+
__key: string;
|
|
6
|
+
};
|
|
3
7
|
export declare const materialize: <T extends object>(props: T) => T;
|
|
4
8
|
type Composer<T> = (outer: T, inner: T) => T;
|
|
5
9
|
export declare const composeDeclarations: <T>(filters: T[], composer: Composer<T>) => T;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.materialize = exports.isSharedValue = exports.composeDeclarations = void 0;
|
|
6
|
+
exports.materialize = exports.isSharedValueSelector = exports.isSharedValue = exports.composeDeclarations = void 0;
|
|
7
7
|
var _typeddash = require("../renderer/typeddash");
|
|
8
8
|
const isSharedValue = value => {
|
|
9
9
|
"worklet";
|
|
@@ -12,6 +12,16 @@ const isSharedValue = value => {
|
|
|
12
12
|
return (value === null || value === void 0 ? void 0 : value._isReanimatedSharedValue) === true;
|
|
13
13
|
};
|
|
14
14
|
exports.isSharedValue = isSharedValue;
|
|
15
|
+
const isSharedValueSelector = value => {
|
|
16
|
+
"worklet";
|
|
17
|
+
|
|
18
|
+
if (!value || typeof value !== "object") {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const obj = value;
|
|
22
|
+
return isSharedValue(obj.__sv) && typeof obj.__key === "string";
|
|
23
|
+
};
|
|
24
|
+
exports.isSharedValueSelector = isSharedValueSelector;
|
|
15
25
|
const materialize = props => {
|
|
16
26
|
"worklet";
|
|
17
27
|
|
|
@@ -20,6 +30,9 @@ const materialize = props => {
|
|
|
20
30
|
const value = result[key];
|
|
21
31
|
if (isSharedValue(value)) {
|
|
22
32
|
result[key] = value.value;
|
|
33
|
+
} else if (isSharedValueSelector(value)) {
|
|
34
|
+
const group = value.__sv.value;
|
|
35
|
+
result[key] = group && typeof group === "object" ? group[value.__key] : undefined;
|
|
23
36
|
}
|
|
24
37
|
});
|
|
25
38
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_typeddash","require","isSharedValue","value","_isReanimatedSharedValue","exports","materialize","props","result","Object","assign","mapKeys","forEach","key","composeDeclarations","filters","composer","len","length","reduceRight","inner","outer"],"sources":["utils.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { mapKeys } from \"../renderer/typeddash\";\n\nexport const isSharedValue = <T = unknown>(\n value: unknown\n): value is SharedValue<T> => {\n \"worklet\";\n // We cannot use `in` operator here because `value` could be a HostObject and therefore we cast.\n return (value as Record<string, unknown>)?._isReanimatedSharedValue === true;\n};\n\nexport const materialize = <T extends object>(props: T) => {\n \"worklet\";\n const result: T = Object.assign({}, props);\n mapKeys(result).forEach((key) => {\n const value = result[key];\n if (isSharedValue(value)) {\n result[key] = value.value as never;\n }\n });\n return result;\n};\n\ntype Composer<T> = (outer: T, inner: T) => T;\n\nexport const composeDeclarations = <T>(filters: T[], composer: Composer<T>) => {\n \"worklet\";\n const len = filters.length;\n if (len <= 1) {\n return filters[0];\n }\n return filters.reduceRight((inner, outer) =>\n inner ? composer(outer, inner) : outer\n );\n};\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEO,MAAMC,aAAa,GACxBC,KAAc,IACc;EAC5B,SAAS;;EACT;EACA,OAAO,CAACA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAA8BC,wBAAwB,MAAK,IAAI;AAC9E,CAAC;AAACC,OAAA,CAAAH,aAAA,GAAAA,aAAA;AAEK,MAAMI,WAAW,GAAsBC,KAAQ,IAAK;EACzD,SAAS;;EACT,MAAMC,MAAS,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEH,KAAK,CAAC;EAC1C,IAAAI,kBAAO,EAACH,MAAM,CAAC,CAACI,OAAO,CAAEC,GAAG,IAAK;IAC/B,
|
|
1
|
+
{"version":3,"names":["_typeddash","require","isSharedValue","value","_isReanimatedSharedValue","exports","isSharedValueSelector","obj","__sv","__key","materialize","props","result","Object","assign","mapKeys","forEach","key","group","undefined","composeDeclarations","filters","composer","len","length","reduceRight","inner","outer"],"sources":["utils.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { mapKeys } from \"../renderer/typeddash\";\n\nexport const isSharedValue = <T = unknown>(\n value: unknown\n): value is SharedValue<T> => {\n \"worklet\";\n // We cannot use `in` operator here because `value` could be a HostObject and therefore we cast.\n return (value as Record<string, unknown>)?._isReanimatedSharedValue === true;\n};\n\nexport const isSharedValueSelector = (\n value: unknown\n): value is { __sv: SharedValue<unknown>; __key: string } => {\n \"worklet\";\n if (!value || typeof value !== \"object\") {\n return false;\n }\n const obj = value as Record<string, unknown>;\n return isSharedValue(obj.__sv) && typeof obj.__key === \"string\";\n};\n\nexport const materialize = <T extends object>(props: T) => {\n \"worklet\";\n const result: T = Object.assign({}, props);\n mapKeys(result).forEach((key) => {\n const value = result[key];\n if (isSharedValue(value)) {\n result[key] = value.value as never;\n } else if (isSharedValueSelector(value)) {\n const group = value.__sv.value;\n result[key] = (\n group && typeof group === \"object\"\n ? (group as Record<string, unknown>)[value.__key]\n : undefined\n ) as never;\n }\n });\n return result;\n};\n\ntype Composer<T> = (outer: T, inner: T) => T;\n\nexport const composeDeclarations = <T>(filters: T[], composer: Composer<T>) => {\n \"worklet\";\n const len = filters.length;\n if (len <= 1) {\n return filters[0];\n }\n return filters.reduceRight((inner, outer) =>\n inner ? composer(outer, inner) : outer\n );\n};\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEO,MAAMC,aAAa,GACxBC,KAAc,IACc;EAC5B,SAAS;;EACT;EACA,OAAO,CAACA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAA8BC,wBAAwB,MAAK,IAAI;AAC9E,CAAC;AAACC,OAAA,CAAAH,aAAA,GAAAA,aAAA;AAEK,MAAMI,qBAAqB,GAChCH,KAAc,IAC6C;EAC3D,SAAS;;EACT,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,K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,KAAK,CAAC,GAAGC,KACnC,CAAC;AACH,CAAC;AAACtB,OAAA,CAAAe,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -1,6 +1,32 @@
|
|
|
1
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
2
|
+
/**
|
|
3
|
+
* Binds a prop to a single key of a "grouped" shared value: one shared value
|
|
4
|
+
* whose `.value` is an object can drive many props (one key each) instead of
|
|
5
|
+
* requiring a separate shared value per prop.
|
|
6
|
+
*
|
|
7
|
+
* Created via {@link select}. `T` is the type of the selected value; `__type`
|
|
8
|
+
* is a phantom marker carrying that type and is never present at runtime.
|
|
9
|
+
*/
|
|
10
|
+
export type SharedValueSelector<T> = {
|
|
11
|
+
__sv: {
|
|
12
|
+
value: Record<string, unknown>;
|
|
13
|
+
};
|
|
14
|
+
__key: string;
|
|
15
|
+
readonly __type?: T;
|
|
16
|
+
};
|
|
1
17
|
export type AnimatedProp<T> = T | {
|
|
2
18
|
value: T;
|
|
3
|
-
}
|
|
19
|
+
} | SharedValueSelector<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Selects a single key of a shared value so it can drive an animated prop.
|
|
22
|
+
* This lets one shared value (whose value is an object) drive multiple props
|
|
23
|
+
* — one per key — instead of using a separate shared value for each.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const data = useSharedValue({ x: 0, y: 0, r: 10 });
|
|
27
|
+
* <Circle cx={select(data, "x")} cy={select(data, "y")} r={select(data, "r")} />
|
|
28
|
+
*/
|
|
29
|
+
export declare const select: <T extends object, K extends keyof T & string>(value: SharedValue<T>, key: K) => SharedValueSelector<T[K]>;
|
|
4
30
|
export type AnimatedProps<T, O extends keyof T | never = never> = {
|
|
5
31
|
[K in keyof T]: K extends "children" ? T[K] : K extends O ? T[K] : AnimatedProp<T[K]>;
|
|
6
32
|
};
|
|
@@ -1,2 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Binds a prop to a single key of a "grouped" shared value: one shared value
|
|
3
|
+
* whose `.value` is an object can drive many props (one key each) instead of
|
|
4
|
+
* requiring a separate shared value per prop.
|
|
5
|
+
*
|
|
6
|
+
* Created via {@link select}. `T` is the type of the selected value; `__type`
|
|
7
|
+
* is a phantom marker carrying that type and is never present at runtime.
|
|
8
|
+
*/
|
|
1
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Selects a single key of a shared value so it can drive an animated prop.
|
|
12
|
+
* This lets one shared value (whose value is an object) drive multiple props
|
|
13
|
+
* — one per key — instead of using a separate shared value for each.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const data = useSharedValue({ x: 0, y: 0, r: 10 });
|
|
17
|
+
* <Circle cx={select(data, "x")} cy={select(data, "y")} r={select(data, "r")} />
|
|
18
|
+
*/
|
|
19
|
+
export const select = (value, key) => ({
|
|
20
|
+
__sv: value,
|
|
21
|
+
__key: key
|
|
22
|
+
});
|
|
2
23
|
//# sourceMappingURL=Animations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["Animations.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["select","value","key","__sv","__key"],"sources":["Animations.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\n/**\n * Binds a prop to a single key of a \"grouped\" shared value: one shared value\n * whose `.value` is an object can drive many props (one key each) instead of\n * requiring a separate shared value per prop.\n *\n * Created via {@link select}. `T` is the type of the selected value; `__type`\n * is a phantom marker carrying that type and is never present at runtime.\n */\nexport type SharedValueSelector<T> = {\n __sv: { value: Record<string, unknown> };\n __key: string;\n readonly __type?: T;\n};\n\nexport type AnimatedProp<T> = T | { value: T } | SharedValueSelector<T>;\n\n/**\n * Selects a single key of a shared value so it can drive an animated prop.\n * This lets one shared value (whose value is an object) drive multiple props\n * — one per key — instead of using a separate shared value for each.\n *\n * @example\n * const data = useSharedValue({ x: 0, y: 0, r: 10 });\n * <Circle cx={select(data, \"x\")} cy={select(data, \"y\")} r={select(data, \"r\")} />\n */\nexport const select = <T extends object, K extends keyof T & string>(\n value: SharedValue<T>,\n key: K\n): SharedValueSelector<T[K]> => ({\n __sv: value as unknown as { value: Record<string, unknown> },\n __key: key,\n});\n\nexport type AnimatedProps<T, O extends keyof T | never = never> = {\n [K in keyof T]: K extends \"children\"\n ? T[K]\n : K extends O\n ? T[K]\n : AnimatedProp<T[K]>;\n};\n\nexport type SkiaProps<\n P = object,\n O extends keyof P | never = never,\n> = AnimatedProps<P, O>;\n\ntype WithOptional<T extends object, N extends keyof T> = Omit<T, N> & {\n [K in N]?: T[K];\n};\n\nexport type SkiaDefaultProps<\n T extends object,\n N extends keyof T,\n> = WithOptional<SkiaProps<T>, N>;\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,MAAM,GAAGA,CACpBC,KAAqB,EACrBC,GAAM,MACyB;EAC/BC,IAAI,EAAEF,KAAsD;EAC5DG,KAAK,EAAEF;AACT,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isSharedValueSelector } from "../utils";
|
|
1
2
|
export let CommandType = /*#__PURE__*/function (CommandType) {
|
|
2
3
|
// Context
|
|
3
4
|
CommandType[CommandType["Group"] = 0] = "Group";
|
|
@@ -51,7 +52,13 @@ export const materializeCommand = command => {
|
|
|
51
52
|
};
|
|
52
53
|
if (command.animatedProps) {
|
|
53
54
|
for (const key in command.animatedProps) {
|
|
54
|
-
|
|
55
|
+
const entry = command.animatedProps[key];
|
|
56
|
+
if (isSharedValueSelector(entry)) {
|
|
57
|
+
const group = entry.__sv.value;
|
|
58
|
+
newProps[key] = group && typeof group === "object" ? group[entry.__key] : undefined;
|
|
59
|
+
} else {
|
|
60
|
+
newProps[key] = entry.value;
|
|
61
|
+
}
|
|
55
62
|
}
|
|
56
63
|
}
|
|
57
64
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CommandType","materializeCommand","command","newProps","props","animatedProps","key","value","isCommand","type","isGroup","Group","isDrawCommand"],"sources":["Core.ts"],"sourcesContent":["import type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n DrawingNodeProps,\n SkottieProps,\n} from \"../../dom/types\";\n\nexport enum CommandType {\n // Context\n Group,\n SavePaint,\n RestorePaint,\n SaveCTM,\n RestoreCTM,\n PushColorFilter,\n PushBlurMaskFilter,\n PushImageFilter,\n PushPathEffect,\n PushShader,\n ComposeColorFilter,\n ComposeImageFilter,\n ComposePathEffect,\n MaterializePaint,\n SaveBackdropFilter,\n SaveLayer,\n RestorePaintDeclaration,\n // Drawing\n DrawBox,\n DrawImage,\n DrawCircle,\n DrawPaint,\n DrawPoints,\n DrawPath,\n DrawRect,\n DrawRRect,\n DrawOval,\n DrawLine,\n DrawPatch,\n DrawVertices,\n DrawDiffRect,\n DrawText,\n DrawTextPath,\n DrawTextBlob,\n DrawGlyphs,\n DrawPicture,\n DrawImageSVG,\n DrawParagraph,\n DrawAtlas,\n DrawSkottie,\n}\n\nexport type Command<T extends CommandType = CommandType> = {\n type: T;\n [key: string]: unknown;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const materializeCommand = (command: any) => {\n \"worklet\";\n const newProps = { ...command.props };\n if (command.animatedProps) {\n for (const key in command.animatedProps) {\n
|
|
1
|
+
{"version":3,"names":["isSharedValueSelector","CommandType","materializeCommand","command","newProps","props","animatedProps","key","entry","group","__sv","value","__key","undefined","isCommand","type","isGroup","Group","isDrawCommand"],"sources":["Core.ts"],"sourcesContent":["import type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n DrawingNodeProps,\n SkottieProps,\n} from \"../../dom/types\";\nimport { isSharedValueSelector } from \"../utils\";\n\nexport enum CommandType {\n // Context\n Group,\n SavePaint,\n RestorePaint,\n SaveCTM,\n RestoreCTM,\n PushColorFilter,\n PushBlurMaskFilter,\n PushImageFilter,\n PushPathEffect,\n PushShader,\n ComposeColorFilter,\n ComposeImageFilter,\n ComposePathEffect,\n MaterializePaint,\n SaveBackdropFilter,\n SaveLayer,\n RestorePaintDeclaration,\n // Drawing\n DrawBox,\n DrawImage,\n DrawCircle,\n DrawPaint,\n DrawPoints,\n DrawPath,\n DrawRect,\n DrawRRect,\n DrawOval,\n DrawLine,\n DrawPatch,\n DrawVertices,\n DrawDiffRect,\n DrawText,\n DrawTextPath,\n DrawTextBlob,\n DrawGlyphs,\n DrawPicture,\n DrawImageSVG,\n DrawParagraph,\n DrawAtlas,\n DrawSkottie,\n}\n\nexport type Command<T extends CommandType = CommandType> = {\n type: T;\n [key: string]: unknown;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const materializeCommand = (command: any) => {\n \"worklet\";\n const newProps = { ...command.props };\n if (command.animatedProps) {\n for (const key in command.animatedProps) {\n const entry = command.animatedProps[key];\n if (isSharedValueSelector(entry)) {\n const group = entry.__sv.value;\n newProps[key] =\n group && typeof group === \"object\"\n ? (group as Record<string, unknown>)[entry.__key]\n : undefined;\n } else {\n newProps[key] = entry.value;\n }\n }\n }\n return { ...command, props: newProps };\n};\n\nexport const isCommand = <T extends CommandType>(\n command: Command,\n type: T\n): command is Command<T> => {\n \"worklet\";\n return command.type === type;\n};\n\nexport interface GroupCommand extends Command<CommandType.Group> {\n props?: Pick<DrawingNodeProps, \"zIndex\">;\n children: Command[];\n}\n\nexport const isGroup = (command: Command): command is GroupCommand => {\n \"worklet\";\n return command.type === CommandType.Group;\n};\n\ninterface Props {\n [CommandType.DrawImage]: ImageProps;\n [CommandType.DrawCircle]: CircleProps;\n [CommandType.SaveCTM]: CTMProps;\n [CommandType.SavePaint]: DrawingNodeProps;\n [CommandType.PushBlurMaskFilter]: BlurMaskFilterProps;\n [CommandType.DrawPoints]: PointsProps;\n [CommandType.DrawPath]: PathProps;\n [CommandType.DrawRect]: RectProps;\n [CommandType.DrawRRect]: RoundedRectProps;\n [CommandType.DrawOval]: OvalProps;\n [CommandType.DrawLine]: LineProps;\n [CommandType.DrawPatch]: PatchProps;\n [CommandType.DrawVertices]: VerticesProps;\n [CommandType.DrawDiffRect]: DiffRectProps;\n [CommandType.DrawText]: TextProps;\n [CommandType.DrawTextPath]: TextPathProps;\n [CommandType.DrawTextBlob]: TextBlobProps;\n [CommandType.DrawGlyphs]: GlyphsProps;\n [CommandType.DrawPicture]: PictureProps;\n [CommandType.DrawImageSVG]: ImageSVGProps;\n [CommandType.DrawParagraph]: ParagraphProps;\n [CommandType.DrawAtlas]: AtlasProps;\n [CommandType.DrawSkottie]: SkottieProps;\n}\n\ninterface DrawCommand<T extends CommandType> extends Command<T> {\n props: T extends keyof Props ? Props[T] : never;\n}\n\nexport const isDrawCommand = <T extends keyof Props>(\n command: Command,\n type: T\n): command is DrawCommand<T> => {\n \"worklet\";\n return command.type === type;\n};\n"],"mappings":"AAyBA,SAASA,qBAAqB,QAAQ,UAAU;AAEhD,WAAYC,WAAW,0BAAXA,WAAW;EACrB;EADUA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA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P,QAAQ,CAACG,GAAG,CAAC,GACXE,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,GAC7BA,KAAK,CAA6BD,KAAK,CAACI,KAAK,CAAC,GAC/CC,SAAS;MACjB,CAAC,MAAM;QACLT,QAAQ,CAACG,GAAG,CAAC,GAAGC,KAAK,CAACG,KAAK;MAC7B;IACF;EACF;EACA,OAAO;IAAE,GAAGR,OAAO;IAAEE,KAAK,EAAED;EAAS,CAAC;AACxC,CAAC;AAED,OAAO,MAAMU,SAAS,GAAGA,CACvBX,OAAgB,EAChBY,IAAO,KACmB;EAC1B,SAAS;;EACT,OAAOZ,OAAO,CAACY,IAAI,KAAKA,IAAI;AAC9B,CAAC;AAOD,OAAO,MAAMC,OAAO,GAAIb,OAAgB,IAA8B;EACpE,SAAS;;EACT,OAAOA,OAAO,CAACY,IAAI,KAAKd,WAAW,CAACgB,KAAK;AAC3C,CAAC;AAgCD,OAAO,MAAMC,aAAa,GAAGA,CAC3Bf,OAAgB,EAChBY,IAAO,KACuB;EAC9B,SAAS;;EACT,OAAOZ,OAAO,CAACY,IAAI,KAAKA,IAAI;AAC9B,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
-
import { isSharedValue } from "../utils";
|
|
4
|
+
import { isSharedValue, isSharedValueSelector } from "../utils";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Currently the recorder only work if the GPU resources (e.g Images) are owned by the main thread.
|
|
@@ -22,6 +22,14 @@ export class ReanimatedRecorder {
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
Object.values(props).forEach(value => {
|
|
25
|
+
if (isSharedValueSelector(value) && !this.values.has(value.__sv)) {
|
|
26
|
+
const sv = value.__sv;
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
28
|
+
// @ts-expect-error
|
|
29
|
+
sv.name = `variable${this.values.size}`;
|
|
30
|
+
this.values.add(sv);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
25
33
|
if (isSharedValue(value) && !this.values.has(value)) {
|
|
26
34
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
27
35
|
// @ts-expect-error
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isSharedValue","ReanimatedRecorder","constructor","Skia","_defineProperty","Set","recorder","Recorder","reset","values","clear","processAnimationValues","props","Object","forEach","value","has","name","size","add","getRecorder","getSharedValues","Array","from","saveGroup","restoreGroup","savePaint","standalone","restorePaint","restorePaintDeclaration","materializePaint","pushPathEffect","pathEffectType","pushImageFilter","imageFilterType","pushColorFilter","colorFilterType","pushShader","shaderType","children","pushBlurMaskFilter","composePathEffect","composeColorFilter","composeImageFilter","saveCTM","restoreCTM","drawPaint","saveLayer","saveBackdropFilter","drawBox","boxProps","shadows","shadow","map","s","drawImage","drawCircle","drawPoints","drawPath","drawRect","drawRRect","drawOval","drawLine","drawPatch","drawVertices","drawDiffRect","drawText","drawTextPath","drawTextBlob","drawGlyphs","drawPicture","drawImageSVG","drawParagraph","drawAtlas","drawSkottie"],"sources":["ReanimatedRecorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport type { BaseRecorder, JsiRecorder, Skia } from \"../../skia/types\";\nimport type {\n PaintProps,\n NodeType,\n BlurMaskFilterProps,\n CTMProps,\n BoxProps,\n BoxShadowProps,\n ImageProps,\n CircleProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n SkottieProps,\n DrawingNodeProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\n\n/**\n * Currently the recorder only work if the GPU resources (e.g Images) are owned by the main thread.\n * It will crash otherwise on Ganesh (iOS/Android).\n */\nexport class ReanimatedRecorder implements BaseRecorder {\n private values = new Set<SharedValue<unknown>>();\n private recorder: JsiRecorder;\n\n constructor(Skia: Skia) {\n this.recorder = Skia.Recorder();\n }\n\n reset() {\n this.values.clear();\n this.recorder.reset();\n }\n\n private processAnimationValues(props?: Record<string, unknown>) {\n if (!props) {\n return;\n }\n Object.values(props).forEach((value) => {\n if (isSharedValue(value) && !this.values.has(value)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n value.name = `variable${this.values.size}`;\n this.values.add(value as SharedValue<unknown>);\n }\n });\n }\n\n getRecorder() {\n return this.recorder;\n }\n\n getSharedValues() {\n return Array.from(this.values);\n }\n\n saveGroup(props?: AnimatedProps<Pick<DrawingNodeProps, \"zIndex\">>): void {\n if (props) {\n this.processAnimationValues(props);\n this.recorder.saveGroup(props);\n } else {\n this.recorder.saveGroup();\n }\n }\n\n restoreGroup(): void {\n this.recorder.restoreGroup();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean): void {\n this.processAnimationValues(props);\n this.recorder.savePaint(props, standalone);\n }\n\n restorePaint(): void {\n this.recorder.restorePaint();\n }\n\n restorePaintDeclaration(): void {\n this.recorder.restorePaintDeclaration();\n }\n\n materializePaint(): void {\n this.recorder.materializePaint();\n }\n\n pushPathEffect(\n pathEffectType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushPathEffect(pathEffectType, props);\n }\n\n pushImageFilter(\n imageFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushImageFilter(imageFilterType, props);\n }\n\n pushColorFilter(\n colorFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushColorFilter(colorFilterType, props);\n }\n\n pushShader(\n shaderType: NodeType,\n props: AnimatedProps<unknown>,\n children: number\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushShader(shaderType, props, children);\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void {\n this.processAnimationValues(props);\n this.recorder.pushBlurMaskFilter(props);\n }\n\n composePathEffect(): void {\n this.recorder.composePathEffect();\n }\n\n composeColorFilter(): void {\n this.recorder.composeColorFilter();\n }\n\n composeImageFilter(): void {\n this.recorder.composeImageFilter();\n }\n\n saveCTM(props: AnimatedProps<CTMProps>): void {\n this.processAnimationValues(props);\n this.recorder.saveCTM(props);\n }\n\n restoreCTM(): void {\n this.recorder.restoreCTM();\n }\n\n drawPaint(): void {\n this.recorder.drawPaint();\n }\n\n saveLayer(): void {\n this.recorder.saveLayer();\n }\n\n saveBackdropFilter(): void {\n this.recorder.saveBackdropFilter();\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n }[]\n ): void {\n this.processAnimationValues(boxProps);\n shadows.forEach((shadow) => {\n this.processAnimationValues(\n shadow.props as AnimatedProps<BoxShadowProps>\n );\n });\n this.recorder.drawBox(\n boxProps,\n // TODO: Fix this type BaseRecorder.drawBox()\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n shadows.map((s) => s.props)\n );\n }\n\n drawImage(props: AnimatedProps<ImageProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImage(props);\n }\n\n drawCircle(props: AnimatedProps<CircleProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawCircle(props);\n }\n\n drawPoints(props: AnimatedProps<PointsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPoints(props);\n }\n\n drawPath(props: AnimatedProps<PathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPath(props);\n }\n\n drawRect(props: AnimatedProps<RectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRect(props);\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRRect(props);\n }\n\n drawOval(props: AnimatedProps<OvalProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawOval(props);\n }\n\n drawLine(props: AnimatedProps<LineProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawLine(props);\n }\n\n drawPatch(props: AnimatedProps<PatchProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPatch(props);\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawVertices(props);\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawDiffRect(props);\n }\n\n drawText(props: AnimatedProps<TextProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawText(props);\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextPath(props);\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextBlob(props);\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawGlyphs(props);\n }\n\n drawPicture(props: AnimatedProps<PictureProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPicture(props);\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImageSVG(props);\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawParagraph(props);\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawAtlas(props);\n }\n\n drawSkottie(props: AnimatedProps<SkottieProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawSkottie(props);\n }\n}\n"],"mappings":";;;AAiCA,SAASA,aAAa,QAAQ,UAAU;;AAExC;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,CAAyB;EAItDC,WAAWA,CAACC,IAAU,EAAE;IAAAC,eAAA,iBAHP,IAAIC,GAAG,CAAuB,CAAC;IAAAD,eAAA;IAI9C,IAAI,CAACE,QAAQ,GAAGH,IAAI,CAACI,QAAQ,CAAC,CAAC;EACjC;EAEAC,KAAKA,CAAA,EAAG;IACN,IAAI,CAACC,MAAM,CAACC,KAAK,CAAC,CAAC;IACnB,IAAI,CAACJ,QAAQ,CAACE,KAAK,CAAC,CAAC;EACvB;EAEQG,sBAAsBA,CAACC,KAA+B,EAAE;IAC9D,IAAI,CAACA,KAAK,EAAE;MACV;IACF;IACAC,MAAM,CAACJ,MAAM,CAACG,KAAK,CAAC,CAACE,OAAO,CAAEC,KAAK,IAAK;MACtC,IAAIf,aAAa,CAACe,KAAK,CAAC,IAAI,CAAC,IAAI,CAACN,MAAM,CAACO,GAAG,CAACD,KAAK,CAAC,EAAE;QACnD;QACA;QACAA,KAAK,CAACE,IAAI,GAAG,WAAW,IAAI,CAACR,MAAM,CAACS,IAAI,EAAE;QAC1C,IAAI,CAACT,MAAM,CAACU,GAAG,CAACJ,KAA6B,CAAC;MAChD;IACF,CAAC,CAAC;EACJ;EAEAK,WAAWA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACd,QAAQ;EACtB;EAEAe,eAAeA,CAAA,EAAG;IAChB,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACd,MAAM,CAAC;EAChC;EAEAe,SAASA,CAACZ,KAAuD,EAAQ;IACvE,IAAIA,KAAK,EAAE;MACT,IAAI,CAACD,sBAAsB,CAACC,K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,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACN,QAAQ,CAACgE,WAAW,CAAC1D,KAAK,CAAC;EAClC;EAEA2D,YAAYA,CAAC3D,KAAmC,EAAQ;IACtD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACN,QAAQ,CAACiE,YAAY,CAAC3D,KAAK,CAAC;EACnC;EAEA4D,aAAaA,CAAC5D,KAAoC,EAAQ;IACxD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACN,QAAQ,CAACkE,aAAa,CAAC5D,KAAK,CAAC;EACpC;EAEA6D,SAASA,CAAC7D,KAAgC,EAAQ;IAChD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACN,QAAQ,CAACmE,SAAS,CAAC7D,KAAK,CAAC;EAChC;EAEA8D,WAAWA,CAAC9D,KAAkC,EAAQ;IACpD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACN,QAAQ,CAACoE,WAAW,CAAC9D,KAAK,CAAC;EAClC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["isSharedValue","isSharedValueSelector","ReanimatedRecorder","constructor","Skia","_defineProperty","Set","recorder","Recorder","reset","values","clear","processAnimationValues","props","Object","forEach","value","has","__sv","sv","name","size","add","getRecorder","getSharedValues","Array","from","saveGroup","restoreGroup","savePaint","standalone","restorePaint","restorePaintDeclaration","materializePaint","pushPathEffect","pathEffectType","pushImageFilter","imageFilterType","pushColorFilter","colorFilterType","pushShader","shaderType","children","pushBlurMaskFilter","composePathEffect","composeColorFilter","composeImageFilter","saveCTM","restoreCTM","drawPaint","saveLayer","saveBackdropFilter","drawBox","boxProps","shadows","shadow","map","s","drawImage","drawCircle","drawPoints","drawPath","drawRect","drawRRect","drawOval","drawLine","drawPatch","drawVertices","drawDiffRect","drawText","drawTextPath","drawTextBlob","drawGlyphs","drawPicture","drawImageSVG","drawParagraph","drawAtlas","drawSkottie"],"sources":["ReanimatedRecorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport type { BaseRecorder, JsiRecorder, Skia } from \"../../skia/types\";\nimport type {\n PaintProps,\n NodeType,\n BlurMaskFilterProps,\n CTMProps,\n BoxProps,\n BoxShadowProps,\n ImageProps,\n CircleProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n SkottieProps,\n DrawingNodeProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue, isSharedValueSelector } from \"../utils\";\n\n/**\n * Currently the recorder only work if the GPU resources (e.g Images) are owned by the main thread.\n * It will crash otherwise on Ganesh (iOS/Android).\n */\nexport class ReanimatedRecorder implements BaseRecorder {\n private values = new Set<SharedValue<unknown>>();\n private recorder: JsiRecorder;\n\n constructor(Skia: Skia) {\n this.recorder = Skia.Recorder();\n }\n\n reset() {\n this.values.clear();\n this.recorder.reset();\n }\n\n private processAnimationValues(props?: Record<string, unknown>) {\n if (!props) {\n return;\n }\n Object.values(props).forEach((value) => {\n if (isSharedValueSelector(value) && !this.values.has(value.__sv)) {\n const sv = value.__sv;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n sv.name = `variable${this.values.size}`;\n this.values.add(sv as SharedValue<unknown>);\n return;\n }\n\n if (isSharedValue(value) && !this.values.has(value)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n value.name = `variable${this.values.size}`;\n this.values.add(value as SharedValue<unknown>);\n }\n });\n }\n\n getRecorder() {\n return this.recorder;\n }\n\n getSharedValues() {\n return Array.from(this.values);\n }\n\n saveGroup(props?: AnimatedProps<Pick<DrawingNodeProps, \"zIndex\">>): void {\n if (props) {\n this.processAnimationValues(props);\n this.recorder.saveGroup(props);\n } else {\n this.recorder.saveGroup();\n }\n }\n\n restoreGroup(): void {\n this.recorder.restoreGroup();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean): void {\n this.processAnimationValues(props);\n this.recorder.savePaint(props, standalone);\n }\n\n restorePaint(): void {\n this.recorder.restorePaint();\n }\n\n restorePaintDeclaration(): void {\n this.recorder.restorePaintDeclaration();\n }\n\n materializePaint(): void {\n this.recorder.materializePaint();\n }\n\n pushPathEffect(\n pathEffectType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushPathEffect(pathEffectType, props);\n }\n\n pushImageFilter(\n imageFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushImageFilter(imageFilterType, props);\n }\n\n pushColorFilter(\n colorFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushColorFilter(colorFilterType, props);\n }\n\n pushShader(\n shaderType: NodeType,\n props: AnimatedProps<unknown>,\n children: number\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushShader(shaderType, props, children);\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void {\n this.processAnimationValues(props);\n this.recorder.pushBlurMaskFilter(props);\n }\n\n composePathEffect(): void {\n this.recorder.composePathEffect();\n }\n\n composeColorFilter(): void {\n this.recorder.composeColorFilter();\n }\n\n composeImageFilter(): void {\n this.recorder.composeImageFilter();\n }\n\n saveCTM(props: AnimatedProps<CTMProps>): void {\n this.processAnimationValues(props);\n this.recorder.saveCTM(props);\n }\n\n restoreCTM(): void {\n this.recorder.restoreCTM();\n }\n\n drawPaint(): void {\n this.recorder.drawPaint();\n }\n\n saveLayer(): void {\n this.recorder.saveLayer();\n }\n\n saveBackdropFilter(): void {\n this.recorder.saveBackdropFilter();\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n }[]\n ): void {\n this.processAnimationValues(boxProps);\n shadows.forEach((shadow) => {\n this.processAnimationValues(\n shadow.props as AnimatedProps<BoxShadowProps>\n );\n });\n this.recorder.drawBox(\n boxProps,\n // TODO: Fix this type BaseRecorder.drawBox()\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n shadows.map((s) => s.props)\n );\n }\n\n drawImage(props: AnimatedProps<ImageProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImage(props);\n }\n\n drawCircle(props: AnimatedProps<CircleProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawCircle(props);\n }\n\n drawPoints(props: AnimatedProps<PointsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPoints(props);\n }\n\n drawPath(props: AnimatedProps<PathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPath(props);\n }\n\n drawRect(props: AnimatedProps<RectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRect(props);\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRRect(props);\n }\n\n drawOval(props: AnimatedProps<OvalProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawOval(props);\n }\n\n drawLine(props: AnimatedProps<LineProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawLine(props);\n }\n\n drawPatch(props: AnimatedProps<PatchProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPatch(props);\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawVertices(props);\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawDiffRect(props);\n }\n\n drawText(props: AnimatedProps<TextProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawText(props);\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextPath(props);\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextBlob(props);\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawGlyphs(props);\n }\n\n drawPicture(props: AnimatedProps<PictureProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPicture(props);\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImageSVG(props);\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawParagraph(props);\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawAtlas(props);\n }\n\n drawSkottie(props: AnimatedProps<SkottieProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawSkottie(props);\n }\n}\n"],"mappings":";;;AAiCA,SAASA,aAAa,EAAEC,qBAAqB,QAAQ,UAAU;;AAE/D;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,CAAyB;EAItDC,WAAWA,CAACC,IAAU,EAAE;IAAAC,eAAA,iBAHP,IAAIC,GAAG,CAAuB,CAAC;IAAAD,eAAA;IAI9C,IAAI,CAACE,QAAQ,GAAGH,IAAI,CAACI,QAAQ,CAAC,CAAC;EACjC;EAEAC,KAAKA,CAAA,EAAG;IACN,IAAI,CAACC,MAAM,CAACC,KAAK,CAAC,CAAC;IACnB,IAAI,CAACJ,QAAQ,CAACE,KAAK,CAAC,CAAC;EACvB;EAEQG,sBAAsBA,CAACC,KAA+B,EAAE;IAC9D,IAAI,CAACA,KAAK,EAAE;MACV;IACF;IACAC,MAAM,CAACJ,MAAM,CAACG,KAAK,CAAC,CAACE,OAAO,CAAEC,KAAK,IAAK;MACtC,IAAIf,qBAAqB,CAACe,KAAK,CAAC,IAAI,CAAC,IAAI,CAACN,MAAM,CAACO,GAAG,CAACD,KAAK,CAACE,IAAI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;IAClC,IAAI,CAACN,QAAQ,CAACqE,SAAS,CAAC/D,KAAK,CAAC;EAChC;EAEAgE,WAAWA,CAAChE,KAAkC,EAAQ;IACpD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACN,QAAQ,CAACsE,WAAW,CAAChE,KAAK,CAAC;EAClC;AACF","ignoreList":[]}
|
|
@@ -42,7 +42,7 @@ export declare class Recorder implements BaseRecorder {
|
|
|
42
42
|
saveBackdropFilter(): void;
|
|
43
43
|
drawBox(boxProps: AnimatedProps<BoxProps>, shadows: {
|
|
44
44
|
props: BoxShadowProps;
|
|
45
|
-
animatedProps?: Record<string,
|
|
45
|
+
animatedProps?: Record<string, unknown>;
|
|
46
46
|
}[]): void;
|
|
47
47
|
drawImage(props: AnimatedProps<ImageProps>): void;
|
|
48
48
|
drawCircle(props: AnimatedProps<CircleProps>): void;
|
|
@@ -2,7 +2,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
import { NodeType } from "../../dom/types";
|
|
5
|
-
import { isSharedValue } from "../utils";
|
|
5
|
+
import { isSharedValue, isSharedValueSelector } from "../utils";
|
|
6
6
|
import { isColorFilter, isImageFilter, isPathEffect, isShader } from "../Node";
|
|
7
7
|
import { CommandType } from "./Core";
|
|
8
8
|
export const disposeRecording = recording => {
|
|
@@ -38,6 +38,10 @@ export class Recorder {
|
|
|
38
38
|
this.animationValues.add(prop);
|
|
39
39
|
animatedProps[key] = prop;
|
|
40
40
|
hasAnimatedProps = true;
|
|
41
|
+
} else if (isSharedValueSelector(prop)) {
|
|
42
|
+
this.animationValues.add(prop.__sv);
|
|
43
|
+
animatedProps[key] = prop;
|
|
44
|
+
hasAnimatedProps = true;
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NodeType","isSharedValue","isColorFilter","isImageFilter","isPathEffect","isShader","CommandType","disposeRecording","recording","paintPool","forEach","paint","dispose","length","lastPicture","Recorder","constructor","_defineProperty","Set","cursors","push","commands","getRecording","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","add","undefined","command","saveGroup","children","group","type","Group","restoreGroup","pop","savePaint","standalone","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","Error","PushPathEffect","pushImageFilter","imageFilterType","PushImageFilter","pushColorFilter","colorFilterType","PushColorFilter","pushShader","shaderType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas","drawSkottie","DrawSkottie"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n SkottieProps,\n DrawingNodeProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, SkPicture, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n // Last picture produced from this recording. The view keeps its own\n // reference to the picture it displays, so the renderer owns this one and\n // disposes it when the next frame replaces it or the recording is disposed.\n lastPicture?: SkPicture | null;\n}\n\nexport const disposeRecording = (recording: Recording) => {\n \"worklet\";\n recording.paintPool.forEach((paint) => paint.dispose());\n recording.paintPool.length = 0;\n if (recording.lastPicture) {\n recording.lastPicture.dispose();\n recording.lastPicture = null;\n }\n};\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup(props?: AnimatedProps<Pick<DrawingNodeProps, \"zIndex\">>) {\n const children: Command[] = [];\n const group: Command = { type: CommandType.Group, children };\n if (props) {\n group.props = props;\n }\n this.add(group);\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean) {\n this.add({ type: CommandType.SavePaint, props, standalone });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(\n shaderType: NodeType,\n props: AnimatedProps<unknown>,\n children: number\n ) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props, children });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n\n drawSkottie(props: AnimatedProps<SkottieProps>) {\n this.add({ type: CommandType.DrawSkottie, props });\n }\n}\n"],"mappings":";;;AAEA,SAASA,QAAQ,QAAQ,iBAAiB;AA8B1C,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,aAAa,EAAEC,aAAa,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,SAAS;AAG9E,SAASC,WAAW,QAAQ,QAAQ;AAYpC,OAAO,MAAMC,gBAAgB,GAAIC,SAAoB,IAAK;EACxD,SAAS;;EACTA,SAAS,CAACC,SAAS,CAACC,OAAO,CAAEC,KAAK,IAAKA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC;EACvDJ,SAAS,CAACC,SAAS,CAACI,MAAM,GAAG,CAAC;EAC9B,IA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EAAE;IAChD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAE9B,WAAW,CAACiH,YAAY;MAAE9F;IAAM,CAAC,CAAC;EACrD;EAEA+F,aAAaA,CAAC/F,KAAoC,EAAE;IAClD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAE9B,WAAW,CAACmH,aAAa;MAAEhG;IAAM,CAAC,CAAC;EACtD;EAEAiG,SAASA,CAACjG,KAAgC,EAAE;IAC1C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAE9B,WAAW,CAACqH,SAAS;MAAElG;IAAM,CAAC,CAAC;EAClD;EAEAmG,WAAWA,CAACnG,KAAkC,EAAE;IAC9C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAE9B,WAAW,CAACuH,WAAW;MAAEpG;IAAM,CAAC,CAAC;EACpD;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["NodeType","isSharedValue","isSharedValueSelector","isColorFilter","isImageFilter","isPathEffect","isShader","CommandType","disposeRecording","recording","paintPool","forEach","paint","dispose","length","lastPicture","Recorder","constructor","_defineProperty","Set","cursors","push","commands","getRecording","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","add","__sv","undefined","command","saveGroup","children","group","type","Group","restoreGroup","pop","savePaint","standalone","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","Error","PushPathEffect","pushImageFilter","imageFilterType","PushImageFilter","pushColorFilter","colorFilterType","PushColorFilter","pushShader","shaderType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas","drawSkottie","DrawSkottie"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n SkottieProps,\n DrawingNodeProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue, isSharedValueSelector } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, SkPicture, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n // Last picture produced from this recording. The view keeps its own\n // reference to the picture it displays, so the renderer owns this one and\n // disposes it when the next frame replaces it or the recording is disposed.\n lastPicture?: SkPicture | null;\n}\n\nexport const disposeRecording = (recording: Recording) => {\n \"worklet\";\n recording.paintPool.forEach((paint) => paint.dispose());\n recording.paintPool.length = 0;\n if (recording.lastPicture) {\n recording.lastPicture.dispose();\n recording.lastPicture = null;\n }\n};\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, unknown> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n } else if (isSharedValueSelector(prop)) {\n this.animationValues.add(prop.__sv);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup(props?: AnimatedProps<Pick<DrawingNodeProps, \"zIndex\">>) {\n const children: Command[] = [];\n const group: Command = { type: CommandType.Group, children };\n if (props) {\n group.props = props;\n }\n this.add(group);\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean) {\n this.add({ type: CommandType.SavePaint, props, standalone });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(\n shaderType: NodeType,\n props: AnimatedProps<unknown>,\n children: number\n ) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props, children });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, unknown>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n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]}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { SharedValue } from "react-native-reanimated";
|
|
2
2
|
export declare const isSharedValue: <T = unknown>(value: unknown) => value is SharedValue<T>;
|
|
3
|
+
export declare const isSharedValueSelector: (value: unknown) => value is {
|
|
4
|
+
__sv: SharedValue<unknown>;
|
|
5
|
+
__key: string;
|
|
6
|
+
};
|
|
3
7
|
export declare const materialize: <T extends object>(props: T) => T;
|
|
4
8
|
type Composer<T> = (outer: T, inner: T) => T;
|
|
5
9
|
export declare const composeDeclarations: <T>(filters: T[], composer: Composer<T>) => T;
|
package/lib/module/sksg/utils.js
CHANGED
|
@@ -5,6 +5,15 @@ export const isSharedValue = value => {
|
|
|
5
5
|
// We cannot use `in` operator here because `value` could be a HostObject and therefore we cast.
|
|
6
6
|
return (value === null || value === void 0 ? void 0 : value._isReanimatedSharedValue) === true;
|
|
7
7
|
};
|
|
8
|
+
export const isSharedValueSelector = value => {
|
|
9
|
+
"worklet";
|
|
10
|
+
|
|
11
|
+
if (!value || typeof value !== "object") {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const obj = value;
|
|
15
|
+
return isSharedValue(obj.__sv) && typeof obj.__key === "string";
|
|
16
|
+
};
|
|
8
17
|
export const materialize = props => {
|
|
9
18
|
"worklet";
|
|
10
19
|
|
|
@@ -13,6 +22,9 @@ export const materialize = props => {
|
|
|
13
22
|
const value = result[key];
|
|
14
23
|
if (isSharedValue(value)) {
|
|
15
24
|
result[key] = value.value;
|
|
25
|
+
} else if (isSharedValueSelector(value)) {
|
|
26
|
+
const group = value.__sv.value;
|
|
27
|
+
result[key] = group && typeof group === "object" ? group[value.__key] : undefined;
|
|
16
28
|
}
|
|
17
29
|
});
|
|
18
30
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["mapKeys","isSharedValue","value","_isReanimatedSharedValue","materialize","props","result","Object","assign","forEach","key","composeDeclarations","filters","composer","len","length","reduceRight","inner","outer"],"sources":["utils.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { mapKeys } from \"../renderer/typeddash\";\n\nexport const isSharedValue = <T = unknown>(\n value: unknown\n): value is SharedValue<T> => {\n \"worklet\";\n // We cannot use `in` operator here because `value` could be a HostObject and therefore we cast.\n return (value as Record<string, unknown>)?._isReanimatedSharedValue === true;\n};\n\nexport const materialize = <T extends object>(props: T) => {\n \"worklet\";\n const result: T = Object.assign({}, props);\n mapKeys(result).forEach((key) => {\n const value = result[key];\n if (isSharedValue(value)) {\n result[key] = value.value as never;\n }\n });\n return result;\n};\n\ntype Composer<T> = (outer: T, inner: T) => T;\n\nexport const composeDeclarations = <T>(filters: T[], composer: Composer<T>) => {\n \"worklet\";\n const len = filters.length;\n if (len <= 1) {\n return filters[0];\n }\n return filters.reduceRight((inner, outer) =>\n inner ? composer(outer, inner) : outer\n );\n};\n"],"mappings":"AAEA,SAASA,OAAO,QAAQ,uBAAuB;AAE/C,OAAO,MAAMC,aAAa,GACxBC,KAAc,IACc;EAC5B,SAAS;;EACT;EACA,OAAO,CAACA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAA8BC,wBAAwB,MAAK,IAAI;AAC9E,CAAC;AAED,OAAO,MAAMC,WAAW,GAAsBC,KAAQ,IAAK;EACzD,SAAS;;EACT,MAAMC,MAAS,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEH,KAAK,CAAC;
|
|
1
|
+
{"version":3,"names":["mapKeys","isSharedValue","value","_isReanimatedSharedValue","isSharedValueSelector","obj","__sv","__key","materialize","props","result","Object","assign","forEach","key","group","undefined","composeDeclarations","filters","composer","len","length","reduceRight","inner","outer"],"sources":["utils.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { mapKeys } from \"../renderer/typeddash\";\n\nexport const isSharedValue = <T = unknown>(\n value: unknown\n): value is SharedValue<T> => {\n \"worklet\";\n // We cannot use `in` operator here because `value` could be a HostObject and therefore we cast.\n return (value as Record<string, unknown>)?._isReanimatedSharedValue === true;\n};\n\nexport const isSharedValueSelector = (\n value: unknown\n): value is { __sv: SharedValue<unknown>; __key: string } => {\n \"worklet\";\n if (!value || typeof value !== \"object\") {\n return false;\n }\n const obj = value as Record<string, unknown>;\n return isSharedValue(obj.__sv) && typeof obj.__key === \"string\";\n};\n\nexport const materialize = <T extends object>(props: T) => {\n \"worklet\";\n const result: T = Object.assign({}, props);\n mapKeys(result).forEach((key) => {\n const value = result[key];\n if (isSharedValue(value)) {\n result[key] = value.value as never;\n } else if (isSharedValueSelector(value)) {\n const group = value.__sv.value;\n result[key] = (\n group && typeof group === \"object\"\n ? (group as Record<string, unknown>)[value.__key]\n : undefined\n ) as never;\n }\n });\n return result;\n};\n\ntype Composer<T> = (outer: T, inner: T) => T;\n\nexport const composeDeclarations = <T>(filters: T[], composer: Composer<T>) => {\n \"worklet\";\n const len = filters.length;\n if (len <= 1) {\n return filters[0];\n }\n return filters.reduceRight((inner, outer) =>\n inner ? composer(outer, inner) : outer\n );\n};\n"],"mappings":"AAEA,SAASA,OAAO,QAAQ,uBAAuB;AAE/C,OAAO,MAAMC,aAAa,GACxBC,KAAc,IACc;EAC5B,SAAS;;EACT;EACA,OAAO,CAACA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAA8BC,wBAAwB,MAAK,IAAI;AAC9E,CAAC;AAED,OAAO,MAAMC,qBAAqB,GAChCF,KAAc,IAC6C;EAC3D,SAAS;;EACT,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACvC,OAAO,KAAK;EACd;EACA,MAAMG,GAAG,GAAGH,KAAgC;EAC5C,OAAOD,aAAa,CAACI,GAAG,CAACC,IAAI,CAAC,IAAI,OAAOD,GAAG,CAACE,KAAK,KAAK,QAAQ;AACjE,CAAC;AAED,OAAO,MAAMC,WAAW,GAAsBC,KAAQ,IAAK;EACzD,SAAS;;EACT,MAAMC,MAAS,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEH,KAAK,CAAC;EAC1CT,OAAO,CAACU,MAAM,CAAC,CAACG,OAAO,CAAEC,GAAG,IAAK;IAC/B,MAAMZ,KAAK,GAAGQ,MAAM,CAACI,GAAG,CAAC;IACzB,IAAIb,aAAa,CAACC,KAAK,CAAC,EAAE;MACxBQ,MAAM,CAACI,GAAG,CAAC,GAAGZ,KAAK,CAACA,KAAc;IACpC,CAAC,MAAM,IAAIE,qBAAqB,CAACF,KAAK,CAAC,EAAE;MACvC,MAAMa,KAAK,GAAGb,KAAK,CAACI,IAAI,CAACJ,KAAK;MAC9BQ,MAAM,CAACI,GAAG,CAAC,GACTC,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,GAC7BA,KAAK,CAA6Bb,KAAK,CAACK,KAAK,CAAC,GAC/CS,SACI;IACZ;EACF,CAAC,CAAC;EACF,OAAON,MAAM;AACf,CAAC;AAID,OAAO,MAAMO,mBAAmB,GAAGA,CAAIC,OAAY,EAAEC,QAAqB,KAAK;EAC7E,SAAS;;EACT,MAAMC,GAAG,GAAGF,OAAO,CAACG,MAAM;EAC1B,IAAID,GAAG,IAAI,CAAC,EAAE;IACZ,OAAOF,OAAO,CAAC,CAAC,CAAC;EACnB;EACA,OAAOA,OAAO,CAACI,WAAW,CAAC,CAACC,KAAK,EAAEC,KAAK,KACtCD,KAAK,GAAGJ,QAAQ,CAACK,KAAK,EAAED,KAAK,CAAC,GAAGC,KACnC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const __esModule: boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Binds a prop to a single key of a "grouped" shared value: one shared value
|
|
4
|
+
* whose `.value` is an object can drive many props (one key each) instead of
|
|
5
|
+
* requiring a separate shared value per prop.
|
|
6
|
+
*
|
|
7
|
+
* Created via {@link select}. `T` is the type of the selected value; `__type`
|
|
8
|
+
* is a phantom marker carrying that type and is never present at runtime.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Selects a single key of a shared value so it can drive an animated prop.
|
|
12
|
+
* This lets one shared value (whose value is an object) drive multiple props
|
|
13
|
+
* — one per key — instead of using a separate shared value for each.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const data = useSharedValue({ x: 0, y: 0, r: 10 });
|
|
17
|
+
* <Circle cx={select(data, "x")} cy={select(data, "y")} r={select(data, "r")} />
|
|
18
|
+
*/
|
|
19
|
+
export function select(value: any, key: any): {
|
|
20
|
+
__sv: any;
|
|
21
|
+
__key: any;
|
|
22
|
+
};
|
|
@@ -476,6 +476,10 @@ export function Mock(CanvasKit: any): {
|
|
|
476
476
|
Line2DPathEffect: (props: any) => import("react").DOMElement<any, Element>;
|
|
477
477
|
Path1DPathEffect: (props: any) => import("react").DOMElement<any, Element>;
|
|
478
478
|
Path2DPathEffect: (props: any) => import("react").DOMElement<any, Element>;
|
|
479
|
+
select: (value: any, key: any) => {
|
|
480
|
+
__sv: any;
|
|
481
|
+
__key: any;
|
|
482
|
+
};
|
|
479
483
|
canvas2Cartesian: (v: any, center: any) => {
|
|
480
484
|
x: number;
|
|
481
485
|
y: number;
|