@shopify/react-native-skia 0.1.216 → 0.1.218
Sign up to get free protection for your applications and to get access to all the features.
- package/android/build.gradle +22 -0
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaModule.java +3 -3
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +56 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseViewManager.java +3 -3
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomViewManager.java +14 -1
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawViewManager.java +16 -1
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureViewManager.java +15 -1
- package/android/src/main/java/com/shopify/reactnative/skia/ViewScreenshotService.java +2 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerDelegate.java +34 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerInterface.java +18 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDrawViewManagerDelegate.java +34 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDrawViewManagerInterface.java +18 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerDelegate.java +34 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerInterface.java +18 -0
- package/android/src/paper/java/com/shopify/reactnative/skia/NativeSkiaModuleSpec.java +38 -0
- package/cpp/rnskia/dom/nodes/JsiImageNode.h +5 -0
- package/ios/RNSkia-iOS/SkiaDomView.h +7 -0
- package/ios/RNSkia-iOS/SkiaDomView.mm +64 -0
- package/ios/RNSkia-iOS/SkiaDomViewManager.mm +1 -1
- package/ios/RNSkia-iOS/SkiaDrawView.h +7 -0
- package/ios/RNSkia-iOS/SkiaDrawView.mm +72 -0
- package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +1 -1
- package/ios/RNSkia-iOS/SkiaPictureView.h +7 -0
- package/ios/RNSkia-iOS/SkiaPictureView.mm +66 -0
- package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +1 -1
- package/ios/RNSkia-iOS/SkiaUIView.h +15 -2
- package/ios/RNSkia-iOS/SkiaUIView.mm +48 -16
- package/ios/RNSkiaModule.h +10 -1
- package/ios/RNSkiaModule.mm +8 -1
- package/lib/commonjs/Platform/IPlatform.d.ts +1 -3
- package/lib/commonjs/Platform/IPlatform.js.map +1 -1
- package/lib/commonjs/Platform/Platform.js +0 -2
- package/lib/commonjs/Platform/Platform.js.map +1 -1
- package/lib/commonjs/Platform/Platform.web.js +0 -4
- package/lib/commonjs/Platform/Platform.web.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolate.d.ts +1 -1
- package/lib/commonjs/animation/timing/functions/types.d.ts +1 -1
- package/lib/commonjs/animation/types.d.ts +2 -2
- package/lib/commonjs/dom/nodes/Node.d.ts +1 -1
- package/lib/commonjs/dom/types/Common.d.ts +8 -8
- package/lib/commonjs/dom/types/DeclarationContext.d.ts +1 -1
- package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +5 -5
- package/lib/commonjs/dom/types/Node.d.ts +1 -1
- package/lib/commonjs/dom/types/SkDOM.d.ts +4 -4
- package/lib/commonjs/external/reanimated/renderHelpers.js +0 -2
- package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.d.ts +1 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/DependencyManager.d.ts +3 -3
- package/lib/commonjs/renderer/HostConfig.d.ts +12 -12
- package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
- package/lib/commonjs/renderer/Reconciler.js +1 -0
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.d.ts +2 -2
- package/lib/commonjs/renderer/components/Drawing.d.ts +2 -2
- package/lib/commonjs/renderer/components/Group.d.ts +2 -2
- package/lib/commonjs/renderer/components/Mask.d.ts +2 -1
- package/lib/commonjs/renderer/components/Paint.d.ts +2 -2
- package/lib/commonjs/renderer/components/Picture.d.ts +2 -2
- package/lib/commonjs/renderer/components/backdrop/BackdropBlur.d.ts +2 -2
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.d.ts +2 -1
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.d.ts +2 -2
- package/lib/commonjs/renderer/components/colorFilters/Lerp.d.ts +2 -2
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +2 -2
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.d.ts +2 -2
- package/lib/commonjs/renderer/components/colorFilters/Matrix.d.ts +2 -2
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +2 -2
- package/lib/commonjs/renderer/components/image/Image.d.ts +2 -2
- package/lib/commonjs/renderer/components/image/ImageSVG.d.ts +2 -2
- package/lib/commonjs/renderer/components/image/ImageShader.d.ts +2 -2
- package/lib/commonjs/renderer/components/imageFilters/Blur.d.ts +2 -2
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.d.ts +2 -2
- package/lib/commonjs/renderer/components/imageFilters/Morphology.d.ts +2 -2
- package/lib/commonjs/renderer/components/imageFilters/Offset.d.ts +2 -2
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.d.ts +2 -2
- package/lib/commonjs/renderer/components/imageFilters/Shadow.d.ts +2 -2
- package/lib/commonjs/renderer/components/maskFilters/Blur.d.ts +2 -2
- package/lib/commonjs/renderer/components/pathEffects/Corner.d.ts +2 -2
- package/lib/commonjs/renderer/components/pathEffects/Dash.d.ts +2 -2
- package/lib/commonjs/renderer/components/pathEffects/Discrete.d.ts +2 -2
- package/lib/commonjs/renderer/components/pathEffects/Line2D.d.ts +2 -2
- package/lib/commonjs/renderer/components/pathEffects/Path1D.d.ts +2 -2
- package/lib/commonjs/renderer/components/pathEffects/Path2D.d.ts +2 -2
- package/lib/commonjs/renderer/components/pathEffects/Sum.d.ts +2 -2
- package/lib/commonjs/renderer/components/shaders/Color.d.ts +2 -2
- package/lib/commonjs/renderer/components/shaders/FractalNoise.d.ts +2 -2
- package/lib/commonjs/renderer/components/shaders/LinearGradient.d.ts +2 -2
- package/lib/commonjs/renderer/components/shaders/RadialGradient.d.ts +2 -2
- package/lib/commonjs/renderer/components/shaders/Shader.d.ts +2 -2
- package/lib/commonjs/renderer/components/shaders/SweepGradient.d.ts +2 -2
- package/lib/commonjs/renderer/components/shaders/Turbulence.d.ts +2 -2
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/Box.d.ts +3 -3
- package/lib/commonjs/renderer/components/shapes/Circle.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/DiffRect.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/Fill.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +2 -1
- package/lib/commonjs/renderer/components/shapes/Line.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/Oval.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/Patch.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/Path.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/Points.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/Rect.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/RoundedRect.d.ts +2 -2
- package/lib/commonjs/renderer/components/shapes/Vertices.d.ts +2 -2
- package/lib/commonjs/renderer/components/text/Glyphs.d.ts +2 -2
- package/lib/commonjs/renderer/components/text/Text.d.ts +2 -2
- package/lib/commonjs/renderer/components/text/TextBlob.d.ts +2 -2
- package/lib/commonjs/renderer/components/text/TextPath.d.ts +2 -2
- package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +6 -6
- package/lib/commonjs/skia/NativeSetup.js +5 -1
- package/lib/commonjs/skia/NativeSetup.js.map +1 -1
- package/lib/commonjs/skia/core/Font.d.ts +2 -2
- package/lib/commonjs/skia/types/Color.d.ts +2 -2
- package/lib/commonjs/skia/types/ColorFilter/ColorFilter.d.ts +1 -1
- package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.d.ts +1 -1
- package/lib/commonjs/skia/types/Data/Data.d.ts +6 -6
- package/lib/commonjs/skia/types/ImageFilter/ImageFilter.d.ts +1 -1
- package/lib/commonjs/skia/types/MaskFilter.d.ts +1 -1
- package/lib/commonjs/skia/types/Matrix.d.ts +3 -3
- package/lib/commonjs/skia/types/Path/Path.d.ts +1 -1
- package/lib/commonjs/skia/types/PathEffect.d.ts +1 -1
- package/lib/commonjs/skia/types/Point.d.ts +1 -1
- package/lib/commonjs/skia/types/RSXform.d.ts +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.d.ts +2 -2
- package/lib/commonjs/skia/types/TextBlob.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkData.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -1
- package/lib/commonjs/specs/NativeSkiaModule.d.ts +6 -0
- package/lib/commonjs/specs/NativeSkiaModule.js +14 -0
- package/lib/commonjs/specs/NativeSkiaModule.js.map +1 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.d.ts +2 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.js +13 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.js.map +1 -0
- package/lib/commonjs/specs/SkiaDomViewNativeComponent.d.ts +8 -0
- package/lib/commonjs/specs/SkiaDomViewNativeComponent.js +16 -0
- package/lib/commonjs/specs/SkiaDomViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.d.ts +8 -0
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.js +16 -0
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +8 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js +16 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js.map +1 -0
- package/lib/commonjs/values/selector.d.ts +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.d.ts +1 -1
- package/lib/commonjs/views/SkiaDomView.d.ts +1 -1
- package/lib/commonjs/views/SkiaDomView.js +3 -1
- package/lib/commonjs/views/SkiaDomView.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.d.ts +1 -1
- package/lib/commonjs/views/SkiaPictureView.js +3 -3
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
- package/lib/commonjs/views/SkiaView.d.ts +1 -1
- package/lib/commonjs/views/SkiaView.js +3 -4
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +6 -6
- package/lib/commonjs/web/WithSkiaWeb.d.ts +2 -2
- package/lib/module/Platform/IPlatform.d.ts +1 -3
- package/lib/module/Platform/IPlatform.js.map +1 -1
- package/lib/module/Platform/Platform.js +1 -3
- package/lib/module/Platform/Platform.js.map +1 -1
- package/lib/module/Platform/Platform.web.js +0 -4
- package/lib/module/Platform/Platform.web.js.map +1 -1
- package/lib/module/animation/functions/interpolate.d.ts +1 -1
- package/lib/module/animation/timing/functions/types.d.ts +1 -1
- package/lib/module/animation/types.d.ts +2 -2
- package/lib/module/dom/nodes/Node.d.ts +1 -1
- package/lib/module/dom/types/Common.d.ts +8 -8
- package/lib/module/dom/types/DeclarationContext.d.ts +1 -1
- package/lib/module/dom/types/DrawingContext.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +5 -5
- package/lib/module/dom/types/Node.d.ts +1 -1
- package/lib/module/dom/types/SkDOM.d.ts +4 -4
- package/lib/module/external/reanimated/renderHelpers.js +0 -2
- package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/module/renderer/Canvas.d.ts +1 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/DependencyManager.d.ts +3 -3
- package/lib/module/renderer/HostConfig.d.ts +12 -12
- package/lib/module/renderer/Reconciler.d.ts +1 -1
- package/lib/module/renderer/Reconciler.js +1 -0
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/renderer/components/Blend.d.ts +2 -2
- package/lib/module/renderer/components/Drawing.d.ts +2 -2
- package/lib/module/renderer/components/Group.d.ts +2 -2
- package/lib/module/renderer/components/Mask.d.ts +2 -1
- package/lib/module/renderer/components/Paint.d.ts +2 -2
- package/lib/module/renderer/components/Picture.d.ts +2 -2
- package/lib/module/renderer/components/backdrop/BackdropBlur.d.ts +2 -2
- package/lib/module/renderer/components/backdrop/BackdropFilter.d.ts +2 -1
- package/lib/module/renderer/components/colorFilters/BlendColor.d.ts +2 -2
- package/lib/module/renderer/components/colorFilters/Lerp.d.ts +2 -2
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +2 -2
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.d.ts +2 -2
- package/lib/module/renderer/components/colorFilters/Matrix.d.ts +2 -2
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +2 -2
- package/lib/module/renderer/components/image/Image.d.ts +2 -2
- package/lib/module/renderer/components/image/ImageSVG.d.ts +2 -2
- package/lib/module/renderer/components/image/ImageShader.d.ts +2 -2
- package/lib/module/renderer/components/imageFilters/Blur.d.ts +2 -2
- package/lib/module/renderer/components/imageFilters/DisplacementMap.d.ts +2 -2
- package/lib/module/renderer/components/imageFilters/Morphology.d.ts +2 -2
- package/lib/module/renderer/components/imageFilters/Offset.d.ts +2 -2
- package/lib/module/renderer/components/imageFilters/RuntimeShader.d.ts +2 -2
- package/lib/module/renderer/components/imageFilters/Shadow.d.ts +2 -2
- package/lib/module/renderer/components/maskFilters/Blur.d.ts +2 -2
- package/lib/module/renderer/components/pathEffects/Corner.d.ts +2 -2
- package/lib/module/renderer/components/pathEffects/Dash.d.ts +2 -2
- package/lib/module/renderer/components/pathEffects/Discrete.d.ts +2 -2
- package/lib/module/renderer/components/pathEffects/Line2D.d.ts +2 -2
- package/lib/module/renderer/components/pathEffects/Path1D.d.ts +2 -2
- package/lib/module/renderer/components/pathEffects/Path2D.d.ts +2 -2
- package/lib/module/renderer/components/pathEffects/Sum.d.ts +2 -2
- package/lib/module/renderer/components/shaders/Color.d.ts +2 -2
- package/lib/module/renderer/components/shaders/FractalNoise.d.ts +2 -2
- package/lib/module/renderer/components/shaders/LinearGradient.d.ts +2 -2
- package/lib/module/renderer/components/shaders/RadialGradient.d.ts +2 -2
- package/lib/module/renderer/components/shaders/Shader.d.ts +2 -2
- package/lib/module/renderer/components/shaders/SweepGradient.d.ts +2 -2
- package/lib/module/renderer/components/shaders/Turbulence.d.ts +2 -2
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.d.ts +2 -2
- package/lib/module/renderer/components/shapes/Box.d.ts +3 -3
- package/lib/module/renderer/components/shapes/Circle.d.ts +2 -2
- package/lib/module/renderer/components/shapes/DiffRect.d.ts +2 -2
- package/lib/module/renderer/components/shapes/Fill.d.ts +2 -2
- package/lib/module/renderer/components/shapes/FitBox.d.ts +2 -1
- package/lib/module/renderer/components/shapes/Line.d.ts +2 -2
- package/lib/module/renderer/components/shapes/Oval.d.ts +2 -2
- package/lib/module/renderer/components/shapes/Patch.d.ts +2 -2
- package/lib/module/renderer/components/shapes/Path.d.ts +2 -2
- package/lib/module/renderer/components/shapes/Points.d.ts +2 -2
- package/lib/module/renderer/components/shapes/Rect.d.ts +2 -2
- package/lib/module/renderer/components/shapes/RoundedRect.d.ts +2 -2
- package/lib/module/renderer/components/shapes/Vertices.d.ts +2 -2
- package/lib/module/renderer/components/text/Glyphs.d.ts +2 -2
- package/lib/module/renderer/components/text/Text.d.ts +2 -2
- package/lib/module/renderer/components/text/TextBlob.d.ts +2 -2
- package/lib/module/renderer/components/text/TextPath.d.ts +2 -2
- package/lib/module/renderer/processors/Animations/Animations.d.ts +6 -6
- package/lib/module/skia/NativeSetup.js +2 -1
- package/lib/module/skia/NativeSetup.js.map +1 -1
- package/lib/module/skia/core/Font.d.ts +2 -2
- package/lib/module/skia/types/Color.d.ts +2 -2
- package/lib/module/skia/types/ColorFilter/ColorFilter.d.ts +1 -1
- package/lib/module/skia/types/ColorFilter/ColorFilterFactory.d.ts +1 -1
- package/lib/module/skia/types/Data/Data.d.ts +6 -6
- package/lib/module/skia/types/ImageFilter/ImageFilter.d.ts +1 -1
- package/lib/module/skia/types/MaskFilter.d.ts +1 -1
- package/lib/module/skia/types/Matrix.d.ts +3 -3
- package/lib/module/skia/types/Path/Path.d.ts +1 -1
- package/lib/module/skia/types/PathEffect.d.ts +1 -1
- package/lib/module/skia/types/Point.d.ts +1 -1
- package/lib/module/skia/types/RSXform.d.ts +1 -1
- package/lib/module/skia/types/Shader/Shader.d.ts +2 -2
- package/lib/module/skia/types/TextBlob.d.ts +1 -1
- package/lib/module/skia/web/JsiSkData.d.ts +1 -1
- package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -1
- package/lib/module/specs/NativeSkiaModule.d.ts +6 -0
- package/lib/module/specs/NativeSkiaModule.js +4 -0
- package/lib/module/specs/NativeSkiaModule.js.map +1 -0
- package/lib/module/specs/NativeSkiaModule.web.d.ts +2 -0
- package/lib/module/specs/NativeSkiaModule.web.js +4 -0
- package/lib/module/specs/NativeSkiaModule.web.js.map +1 -0
- package/lib/module/specs/SkiaDomViewNativeComponent.d.ts +8 -0
- package/lib/module/specs/SkiaDomViewNativeComponent.js +4 -0
- package/lib/module/specs/SkiaDomViewNativeComponent.js.map +1 -0
- package/lib/module/specs/SkiaDrawViewNativeComponent.d.ts +8 -0
- package/lib/module/specs/SkiaDrawViewNativeComponent.js +4 -0
- package/lib/module/specs/SkiaDrawViewNativeComponent.js.map +1 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +8 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.js +4 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.js.map +1 -0
- package/lib/module/values/selector.d.ts +1 -1
- package/lib/module/views/SkiaBaseWebView.d.ts +1 -1
- package/lib/module/views/SkiaDomView.d.ts +1 -1
- package/lib/module/views/SkiaDomView.js +2 -1
- package/lib/module/views/SkiaDomView.js.map +1 -1
- package/lib/module/views/SkiaPictureView.d.ts +1 -1
- package/lib/module/views/SkiaPictureView.js +3 -3
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/SkiaView.d.ts +1 -1
- package/lib/module/views/SkiaView.js +3 -3
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/module/views/types.d.ts +6 -6
- package/lib/module/web/WithSkiaWeb.d.ts +2 -2
- package/lib/typescript/src/Platform/IPlatform.d.ts +1 -3
- package/lib/typescript/src/animation/functions/interpolate.d.ts +1 -1
- package/lib/typescript/src/animation/timing/functions/types.d.ts +1 -1
- package/lib/typescript/src/animation/types.d.ts +2 -2
- package/lib/typescript/src/dom/nodes/Node.d.ts +1 -1
- package/lib/typescript/src/dom/types/Common.d.ts +8 -8
- package/lib/typescript/src/dom/types/DeclarationContext.d.ts +1 -1
- package/lib/typescript/src/dom/types/Drawings.d.ts +5 -5
- package/lib/typescript/src/dom/types/Node.d.ts +1 -1
- package/lib/typescript/src/dom/types/SkDOM.d.ts +4 -4
- package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
- package/lib/typescript/src/renderer/DependencyManager.d.ts +3 -3
- package/lib/typescript/src/renderer/HostConfig.d.ts +12 -12
- package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Blend.d.ts +2 -2
- package/lib/typescript/src/renderer/components/Drawing.d.ts +2 -2
- package/lib/typescript/src/renderer/components/Group.d.ts +2 -2
- package/lib/typescript/src/renderer/components/Mask.d.ts +2 -1
- package/lib/typescript/src/renderer/components/Paint.d.ts +2 -2
- package/lib/typescript/src/renderer/components/Picture.d.ts +2 -2
- package/lib/typescript/src/renderer/components/backdrop/BackdropBlur.d.ts +2 -2
- package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +2 -1
- package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +2 -2
- package/lib/typescript/src/renderer/components/colorFilters/Lerp.d.ts +2 -2
- package/lib/typescript/src/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +2 -2
- package/lib/typescript/src/renderer/components/colorFilters/LumaColorFilter.d.ts +2 -2
- package/lib/typescript/src/renderer/components/colorFilters/Matrix.d.ts +2 -2
- package/lib/typescript/src/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +2 -2
- package/lib/typescript/src/renderer/components/image/Image.d.ts +2 -2
- package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +2 -2
- package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +2 -2
- package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +2 -2
- package/lib/typescript/src/renderer/components/pathEffects/Corner.d.ts +2 -2
- package/lib/typescript/src/renderer/components/pathEffects/Dash.d.ts +2 -2
- package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +2 -2
- package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +2 -2
- package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +2 -2
- package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +2 -2
- package/lib/typescript/src/renderer/components/pathEffects/Sum.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shaders/Color.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Box.d.ts +3 -3
- package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Fill.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shapes/Line.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Path.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Rect.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -2
- package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +2 -2
- package/lib/typescript/src/renderer/components/text/Text.d.ts +2 -2
- package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +2 -2
- package/lib/typescript/src/renderer/components/text/TextPath.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +6 -6
- package/lib/typescript/src/skia/core/Font.d.ts +2 -2
- package/lib/typescript/src/skia/types/Color.d.ts +2 -2
- package/lib/typescript/src/skia/types/ColorFilter/ColorFilter.d.ts +1 -1
- package/lib/typescript/src/skia/types/ColorFilter/ColorFilterFactory.d.ts +1 -1
- package/lib/typescript/src/skia/types/Data/Data.d.ts +6 -6
- package/lib/typescript/src/skia/types/ImageFilter/ImageFilter.d.ts +1 -1
- package/lib/typescript/src/skia/types/MaskFilter.d.ts +1 -1
- package/lib/typescript/src/skia/types/Matrix.d.ts +3 -3
- package/lib/typescript/src/skia/types/Path/Path.d.ts +1 -1
- package/lib/typescript/src/skia/types/PathEffect.d.ts +1 -1
- package/lib/typescript/src/skia/types/Point.d.ts +1 -1
- package/lib/typescript/src/skia/types/RSXform.d.ts +1 -1
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +2 -2
- package/lib/typescript/src/skia/types/TextBlob.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkData.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -1
- package/lib/typescript/src/specs/NativeSkiaModule.d.ts +6 -0
- package/lib/typescript/src/specs/NativeSkiaModule.web.d.ts +2 -0
- package/lib/typescript/src/specs/SkiaDomViewNativeComponent.d.ts +8 -0
- package/lib/typescript/src/specs/SkiaDrawViewNativeComponent.d.ts +8 -0
- package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.d.ts +8 -0
- package/lib/typescript/src/values/selector.d.ts +1 -1
- package/lib/typescript/src/views/SkiaBaseWebView.d.ts +1 -1
- package/lib/typescript/src/views/SkiaDomView.d.ts +1 -1
- package/lib/typescript/src/views/SkiaPictureView.d.ts +1 -1
- package/lib/typescript/src/views/SkiaView.d.ts +1 -1
- package/lib/typescript/src/views/types.d.ts +6 -6
- package/lib/typescript/src/web/WithSkiaWeb.d.ts +2 -2
- package/package.json +18 -6
- package/react-native-skia.podspec +11 -3
- package/src/Platform/IPlatform.ts +1 -3
- package/src/Platform/Platform.ts +0 -4
- package/src/Platform/Platform.web.tsx +0 -4
- package/src/dom/types/DrawingContext.ts +1 -1
- package/src/external/reanimated/renderHelpers.ts +1 -1
- package/src/renderer/Canvas.tsx +2 -1
- package/src/renderer/Reconciler.tsx +2 -1
- package/src/skia/NativeSetup.ts +2 -1
- package/src/specs/NativeSkiaModule.ts +9 -0
- package/src/specs/NativeSkiaModule.web.ts +4 -0
- package/src/specs/SkiaDomViewNativeComponent.ts +10 -0
- package/src/specs/SkiaDrawViewNativeComponent.ts +10 -0
- package/src/specs/SkiaPictureViewNativeComponent.ts +10 -0
- package/src/views/SkiaDomView.tsx +3 -2
- package/src/views/SkiaPictureView.tsx +4 -5
- package/src/views/SkiaView.tsx +4 -5
package/android/build.gradle
CHANGED
@@ -26,6 +26,14 @@ def safeExtGet(prop, fallback) {
|
|
26
26
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
27
27
|
}
|
28
28
|
|
29
|
+
def isNewArchitectureEnabled() {
|
30
|
+
// To opt-in for the New Architecture, you can either:
|
31
|
+
// - Set `newArchEnabled` to true inside the `gradle.properties` file
|
32
|
+
// - Invoke gradle with `-newArchEnabled=true`
|
33
|
+
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
|
34
|
+
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
|
35
|
+
}
|
36
|
+
|
29
37
|
apply plugin: 'com.android.library'
|
30
38
|
|
31
39
|
def reactNativeArchitectures() {
|
@@ -54,6 +62,10 @@ logger.warn("react-native-skia: node_modules/ found at: ${nodeModules}")
|
|
54
62
|
def sourceBuild = false
|
55
63
|
def defaultDir
|
56
64
|
|
65
|
+
if (isNewArchitectureEnabled()) {
|
66
|
+
apply plugin: "com.facebook.react"
|
67
|
+
}
|
68
|
+
|
57
69
|
if (rootProject.ext.has('reactNativeAndroidRoot')) {
|
58
70
|
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
|
59
71
|
} else if (findProject(':ReactAndroid') != null) {
|
@@ -148,6 +160,16 @@ android {
|
|
148
160
|
}
|
149
161
|
}
|
150
162
|
|
163
|
+
sourceSets.main {
|
164
|
+
java {
|
165
|
+
if (!isNewArchitectureEnabled()) {
|
166
|
+
srcDirs += [
|
167
|
+
"src/paper/java",
|
168
|
+
]
|
169
|
+
}
|
170
|
+
}
|
171
|
+
}
|
172
|
+
|
151
173
|
externalNativeBuild {
|
152
174
|
cmake {
|
153
175
|
path file('CMakeLists.txt')
|
@@ -12,9 +12,9 @@ import com.facebook.react.module.annotations.ReactModule;
|
|
12
12
|
|
13
13
|
import java.lang.ref.WeakReference;
|
14
14
|
|
15
|
-
@ReactModule(name="
|
16
|
-
public class RNSkiaModule extends
|
17
|
-
public static final String NAME = "
|
15
|
+
@ReactModule(name="RNSkiaModule")
|
16
|
+
public class RNSkiaModule extends NativeSkiaModuleSpec implements LifecycleEventListener {
|
17
|
+
public static final String NAME = "RNSkiaModule";
|
18
18
|
|
19
19
|
private final WeakReference<ReactApplicationContext> weakReactContext;
|
20
20
|
private SkiaManager skiaManager;
|
@@ -2,23 +2,77 @@
|
|
2
2
|
|
3
3
|
package com.shopify.reactnative.skia;
|
4
4
|
|
5
|
+
import androidx.annotation.Nullable;
|
6
|
+
|
5
7
|
import java.util.Arrays;
|
8
|
+
import java.util.HashMap;
|
6
9
|
import java.util.List;
|
10
|
+
import java.util.Map;
|
7
11
|
|
8
|
-
import com.facebook.react.
|
12
|
+
import com.facebook.react.TurboReactPackage;
|
9
13
|
import com.facebook.react.bridge.NativeModule;
|
10
14
|
import com.facebook.react.bridge.ReactApplicationContext;
|
15
|
+
import com.facebook.react.module.annotations.ReactModule;
|
16
|
+
import com.facebook.react.module.annotations.ReactModuleList;
|
17
|
+
import com.facebook.react.module.model.ReactModuleInfo;
|
18
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider;
|
19
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
11
20
|
import com.facebook.react.uimanager.ViewManager;
|
12
21
|
|
13
|
-
|
22
|
+
@ReactModuleList(
|
23
|
+
nativeModules = {
|
24
|
+
RNSkiaModule.class,
|
25
|
+
})
|
26
|
+
public class RNSkiaPackage extends TurboReactPackage {
|
14
27
|
@Override
|
15
28
|
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
16
29
|
return Arrays.<NativeModule>asList(new RNSkiaModule(reactContext));
|
17
30
|
}
|
18
31
|
|
32
|
+
@Nullable
|
33
|
+
@Override
|
34
|
+
public NativeModule getModule(String s, ReactApplicationContext reactApplicationContext) {
|
35
|
+
switch (s) {
|
36
|
+
case RNSkiaModule.NAME:
|
37
|
+
return new RNSkiaModule(reactApplicationContext);
|
38
|
+
default:
|
39
|
+
return null;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
19
43
|
@Override
|
20
44
|
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
21
45
|
return Arrays.<ViewManager>asList(new SkiaDrawViewManager(),
|
22
46
|
new SkiaPictureViewManager(), new SkiaDomViewManager());
|
23
47
|
}
|
48
|
+
|
49
|
+
@Override
|
50
|
+
public ReactModuleInfoProvider getReactModuleInfoProvider() {
|
51
|
+
return new ReactModuleInfoProvider() {
|
52
|
+
@Override
|
53
|
+
public Map<String, ReactModuleInfo> getReactModuleInfos() {
|
54
|
+
final Map<String, ReactModuleInfo> reactModuleInfoMap = new HashMap<>();
|
55
|
+
Class<? extends NativeModule>[] moduleList =
|
56
|
+
new Class[] {
|
57
|
+
RNSkiaModule.class,
|
58
|
+
};
|
59
|
+
|
60
|
+
for (Class<? extends NativeModule> moduleClass : moduleList) {
|
61
|
+
ReactModule reactModule = moduleClass.getAnnotation(ReactModule.class);
|
62
|
+
|
63
|
+
reactModuleInfoMap.put(
|
64
|
+
reactModule.name(),
|
65
|
+
new ReactModuleInfo(
|
66
|
+
reactModule.name(),
|
67
|
+
moduleClass.getName(),
|
68
|
+
reactModule.canOverrideExistingModule(),
|
69
|
+
reactModule.needsEagerInit(),
|
70
|
+
reactModule.hasConstants(),
|
71
|
+
reactModule.isCxxModule(),
|
72
|
+
TurboModule.class.isAssignableFrom(moduleClass)));
|
73
|
+
}
|
74
|
+
return reactModuleInfoMap;
|
75
|
+
}
|
76
|
+
};
|
77
|
+
}
|
24
78
|
}
|
@@ -7,7 +7,7 @@ import com.facebook.react.views.view.ReactViewManager;
|
|
7
7
|
import androidx.annotation.NonNull;
|
8
8
|
import androidx.annotation.Nullable;
|
9
9
|
|
10
|
-
public abstract class SkiaBaseViewManager extends ReactViewManager {
|
10
|
+
public abstract class SkiaBaseViewManager<T extends SkiaBaseView> extends ReactViewManager {
|
11
11
|
|
12
12
|
@Override
|
13
13
|
public void setNativeId(@NonNull ReactViewGroup view, @Nullable String nativeId) {
|
@@ -17,12 +17,12 @@ public abstract class SkiaBaseViewManager extends ReactViewManager {
|
|
17
17
|
}
|
18
18
|
|
19
19
|
@ReactProp(name = "mode")
|
20
|
-
public void setMode(
|
20
|
+
public void setMode(T view, String mode) {
|
21
21
|
((SkiaBaseView)view).setMode(mode);
|
22
22
|
}
|
23
23
|
|
24
24
|
@ReactProp(name = "debug")
|
25
|
-
public void setDebug(
|
25
|
+
public void setDebug(T view, boolean show) {
|
26
26
|
((SkiaBaseView)view).setDebugMode(show);
|
27
27
|
}
|
28
28
|
|
@@ -1,9 +1,22 @@
|
|
1
1
|
package com.shopify.reactnative.skia;
|
2
2
|
|
3
3
|
import com.facebook.react.uimanager.ThemedReactContext;
|
4
|
+
import com.facebook.react.viewmanagers.SkiaDomViewManagerInterface;
|
5
|
+
import com.facebook.react.viewmanagers.SkiaDomViewManagerDelegate;
|
6
|
+
|
4
7
|
import androidx.annotation.NonNull;
|
5
8
|
|
6
|
-
public class SkiaDomViewManager extends SkiaBaseViewManager {
|
9
|
+
public class SkiaDomViewManager extends SkiaBaseViewManager<SkiaDomView> implements SkiaDomViewManagerInterface<SkiaDomView> {
|
10
|
+
|
11
|
+
protected SkiaDomViewManagerDelegate mDelegate;
|
12
|
+
|
13
|
+
SkiaDomViewManager() {
|
14
|
+
mDelegate = new SkiaDomViewManagerDelegate(this);
|
15
|
+
}
|
16
|
+
|
17
|
+
protected SkiaDomViewManagerDelegate getDelegate() {
|
18
|
+
return mDelegate;
|
19
|
+
}
|
7
20
|
|
8
21
|
@NonNull
|
9
22
|
@Override
|
@@ -1,9 +1,23 @@
|
|
1
1
|
package com.shopify.reactnative.skia;
|
2
2
|
|
3
3
|
import com.facebook.react.uimanager.ThemedReactContext;
|
4
|
+
import com.facebook.react.viewmanagers.SkiaDrawViewManagerDelegate;
|
5
|
+
import com.facebook.react.viewmanagers.SkiaDrawViewManagerInterface;
|
6
|
+
|
4
7
|
import androidx.annotation.NonNull;
|
5
8
|
|
6
|
-
public class SkiaDrawViewManager extends SkiaBaseViewManager {
|
9
|
+
public class SkiaDrawViewManager extends SkiaBaseViewManager<SkiaDrawView> implements SkiaDrawViewManagerInterface<SkiaDrawView> {
|
10
|
+
|
11
|
+
|
12
|
+
protected SkiaDrawViewManagerDelegate mDelegate;
|
13
|
+
|
14
|
+
SkiaDrawViewManager() {
|
15
|
+
mDelegate = new SkiaDrawViewManagerDelegate(this);
|
16
|
+
}
|
17
|
+
|
18
|
+
protected SkiaDrawViewManagerDelegate getDelegate() {
|
19
|
+
return mDelegate;
|
20
|
+
}
|
7
21
|
|
8
22
|
@NonNull
|
9
23
|
@Override
|
@@ -16,4 +30,5 @@ public class SkiaDrawViewManager extends SkiaBaseViewManager {
|
|
16
30
|
public SkiaDrawView createViewInstance(@NonNull ThemedReactContext reactContext) {
|
17
31
|
return new SkiaDrawView(reactContext);
|
18
32
|
}
|
33
|
+
|
19
34
|
}
|
@@ -1,9 +1,23 @@
|
|
1
1
|
package com.shopify.reactnative.skia;
|
2
2
|
|
3
3
|
import com.facebook.react.uimanager.ThemedReactContext;
|
4
|
+
import com.facebook.react.viewmanagers.SkiaPictureViewManagerDelegate;
|
5
|
+
import com.facebook.react.viewmanagers.SkiaPictureViewManagerInterface;
|
6
|
+
|
4
7
|
import androidx.annotation.NonNull;
|
5
8
|
|
6
|
-
public class SkiaPictureViewManager extends SkiaBaseViewManager {
|
9
|
+
public class SkiaPictureViewManager extends SkiaBaseViewManager<SkiaPictureView> implements SkiaPictureViewManagerInterface<SkiaPictureView> {
|
10
|
+
|
11
|
+
|
12
|
+
protected SkiaPictureViewManagerDelegate mDelegate;
|
13
|
+
|
14
|
+
SkiaPictureViewManager() {
|
15
|
+
mDelegate = new SkiaPictureViewManagerDelegate(this);
|
16
|
+
}
|
17
|
+
|
18
|
+
protected SkiaPictureViewManagerDelegate getDelegate() {
|
19
|
+
return mDelegate;
|
20
|
+
}
|
7
21
|
|
8
22
|
@NonNull
|
9
23
|
@Override
|
@@ -174,8 +174,8 @@ public class ViewScreenshotService {
|
|
174
174
|
|
175
175
|
// Create a new matrix for translation
|
176
176
|
final Matrix translateMatrix = new Matrix();
|
177
|
-
final float dx = view.getLeft() + view.getPaddingLeft()
|
178
|
-
final float dy = view.getTop() + view.getPaddingTop()
|
177
|
+
final float dx = view.getLeft() + view.getPaddingLeft();
|
178
|
+
final float dy = view.getTop() + view.getPaddingTop();
|
179
179
|
translateMatrix.setTranslate(dx, dy);
|
180
180
|
|
181
181
|
// Pre-concatenate the current matrix of the canvas with the translation and transformation matrices of the view
|
package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerDelegate.java
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
3
|
+
*
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
5
|
+
* once the code is regenerated.
|
6
|
+
*
|
7
|
+
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
8
|
+
*/
|
9
|
+
|
10
|
+
package com.facebook.react.viewmanagers;
|
11
|
+
|
12
|
+
import android.view.View;
|
13
|
+
import androidx.annotation.Nullable;
|
14
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
15
|
+
import com.facebook.react.uimanager.BaseViewManagerInterface;
|
16
|
+
|
17
|
+
public class SkiaDomViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & SkiaDomViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
18
|
+
public SkiaDomViewManagerDelegate(U viewManager) {
|
19
|
+
super(viewManager);
|
20
|
+
}
|
21
|
+
@Override
|
22
|
+
public void setProperty(T view, String propName, @Nullable Object value) {
|
23
|
+
switch (propName) {
|
24
|
+
case "mode":
|
25
|
+
mViewManager.setMode(view, value == null ? null : (String) value);
|
26
|
+
break;
|
27
|
+
case "debug":
|
28
|
+
mViewManager.setDebug(view, value == null ? false : (boolean) value);
|
29
|
+
break;
|
30
|
+
default:
|
31
|
+
super.setProperty(view, propName, value);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerInterface.java
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
3
|
+
*
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
5
|
+
* once the code is regenerated.
|
6
|
+
*
|
7
|
+
* @generated by codegen project: GeneratePropsJavaInterface.js
|
8
|
+
*/
|
9
|
+
|
10
|
+
package com.facebook.react.viewmanagers;
|
11
|
+
|
12
|
+
import android.view.View;
|
13
|
+
import androidx.annotation.Nullable;
|
14
|
+
|
15
|
+
public interface SkiaDomViewManagerInterface<T extends View> {
|
16
|
+
void setMode(T view, @Nullable String value);
|
17
|
+
void setDebug(T view, boolean value);
|
18
|
+
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDrawViewManagerDelegate.java
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
3
|
+
*
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
5
|
+
* once the code is regenerated.
|
6
|
+
*
|
7
|
+
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
8
|
+
*/
|
9
|
+
|
10
|
+
package com.facebook.react.viewmanagers;
|
11
|
+
|
12
|
+
import android.view.View;
|
13
|
+
import androidx.annotation.Nullable;
|
14
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
15
|
+
import com.facebook.react.uimanager.BaseViewManagerInterface;
|
16
|
+
|
17
|
+
public class SkiaDrawViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & SkiaDrawViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
18
|
+
public SkiaDrawViewManagerDelegate(U viewManager) {
|
19
|
+
super(viewManager);
|
20
|
+
}
|
21
|
+
@Override
|
22
|
+
public void setProperty(T view, String propName, @Nullable Object value) {
|
23
|
+
switch (propName) {
|
24
|
+
case "mode":
|
25
|
+
mViewManager.setMode(view, value == null ? null : (String) value);
|
26
|
+
break;
|
27
|
+
case "debug":
|
28
|
+
mViewManager.setDebug(view, value == null ? false : (boolean) value);
|
29
|
+
break;
|
30
|
+
default:
|
31
|
+
super.setProperty(view, propName, value);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDrawViewManagerInterface.java
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
3
|
+
*
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
5
|
+
* once the code is regenerated.
|
6
|
+
*
|
7
|
+
* @generated by codegen project: GeneratePropsJavaInterface.js
|
8
|
+
*/
|
9
|
+
|
10
|
+
package com.facebook.react.viewmanagers;
|
11
|
+
|
12
|
+
import android.view.View;
|
13
|
+
import androidx.annotation.Nullable;
|
14
|
+
|
15
|
+
public interface SkiaDrawViewManagerInterface<T extends View> {
|
16
|
+
void setMode(T view, @Nullable String value);
|
17
|
+
void setDebug(T view, boolean value);
|
18
|
+
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerDelegate.java
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
3
|
+
*
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
5
|
+
* once the code is regenerated.
|
6
|
+
*
|
7
|
+
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
8
|
+
*/
|
9
|
+
|
10
|
+
package com.facebook.react.viewmanagers;
|
11
|
+
|
12
|
+
import android.view.View;
|
13
|
+
import androidx.annotation.Nullable;
|
14
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
15
|
+
import com.facebook.react.uimanager.BaseViewManagerInterface;
|
16
|
+
|
17
|
+
public class SkiaPictureViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & SkiaPictureViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
18
|
+
public SkiaPictureViewManagerDelegate(U viewManager) {
|
19
|
+
super(viewManager);
|
20
|
+
}
|
21
|
+
@Override
|
22
|
+
public void setProperty(T view, String propName, @Nullable Object value) {
|
23
|
+
switch (propName) {
|
24
|
+
case "mode":
|
25
|
+
mViewManager.setMode(view, value == null ? null : (String) value);
|
26
|
+
break;
|
27
|
+
case "debug":
|
28
|
+
mViewManager.setDebug(view, value == null ? false : (boolean) value);
|
29
|
+
break;
|
30
|
+
default:
|
31
|
+
super.setProperty(view, propName, value);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerInterface.java
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
3
|
+
*
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
5
|
+
* once the code is regenerated.
|
6
|
+
*
|
7
|
+
* @generated by codegen project: GeneratePropsJavaInterface.js
|
8
|
+
*/
|
9
|
+
|
10
|
+
package com.facebook.react.viewmanagers;
|
11
|
+
|
12
|
+
import android.view.View;
|
13
|
+
import androidx.annotation.Nullable;
|
14
|
+
|
15
|
+
public interface SkiaPictureViewManagerInterface<T extends View> {
|
16
|
+
void setMode(T view, @Nullable String value);
|
17
|
+
void setDebug(T view, boolean value);
|
18
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
4
|
+
*
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
6
|
+
* once the code is regenerated.
|
7
|
+
*
|
8
|
+
* @generated by codegen project: GenerateModuleJavaSpec.js
|
9
|
+
*
|
10
|
+
* @nolint
|
11
|
+
*/
|
12
|
+
|
13
|
+
package com.shopify.reactnative.skia;
|
14
|
+
|
15
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
16
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
17
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
18
|
+
import com.facebook.react.bridge.ReactMethod;
|
19
|
+
import com.facebook.react.bridge.ReactModuleWithSpec;
|
20
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
21
|
+
import javax.annotation.Nonnull;
|
22
|
+
|
23
|
+
public abstract class NativeSkiaModuleSpec extends ReactContextBaseJavaModule implements ReactModuleWithSpec, TurboModule {
|
24
|
+
public static final String NAME = "RNSkiaModule";
|
25
|
+
|
26
|
+
public NativeSkiaModuleSpec(ReactApplicationContext reactContext) {
|
27
|
+
super(reactContext);
|
28
|
+
}
|
29
|
+
|
30
|
+
@Override
|
31
|
+
public @Nonnull String getName() {
|
32
|
+
return NAME;
|
33
|
+
}
|
34
|
+
|
35
|
+
@ReactMethod(isBlockingSynchronousMethod = true)
|
36
|
+
@DoNotStrip
|
37
|
+
public abstract boolean install();
|
38
|
+
}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
2
|
+
#import <SkiaDomView.h>
|
3
|
+
|
4
|
+
#import <RNSkDomView.h>
|
5
|
+
#import <RNSkIOSView.h>
|
6
|
+
#import <RNSkPlatformContext.h>
|
7
|
+
|
8
|
+
#import <RNSkiaModule.h>
|
9
|
+
#import <SkiaManager.h>
|
10
|
+
#import <SkiaUIView.h>
|
11
|
+
|
12
|
+
#import <React/RCTBridge+Private.h>
|
13
|
+
#import <React/RCTConversions.h>
|
14
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
15
|
+
|
16
|
+
#import <react/renderer/components/rnskia/ComponentDescriptors.h>
|
17
|
+
#import <react/renderer/components/rnskia/EventEmitters.h>
|
18
|
+
#import <react/renderer/components/rnskia/Props.h>
|
19
|
+
#import <react/renderer/components/rnskia/RCTComponentViewHelpers.h>
|
20
|
+
|
21
|
+
using namespace facebook::react;
|
22
|
+
|
23
|
+
@implementation SkiaDomView
|
24
|
+
|
25
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
26
|
+
if (self = [super initWithFrame:frame]) {
|
27
|
+
auto skManager = [[self skiaManager] skManager];
|
28
|
+
// Pass SkManager as a raw pointer to avoid circular dependenciesr
|
29
|
+
[self
|
30
|
+
initCommon:skManager.get()
|
31
|
+
factory:[](std::shared_ptr<RNSkia::RNSkPlatformContext> context) {
|
32
|
+
return std::make_shared<RNSkiOSView<RNSkia::RNSkDomView>>(context);
|
33
|
+
}];
|
34
|
+
static const auto defaultProps = std::make_shared<const SkiaDomViewProps>();
|
35
|
+
_props = defaultProps;
|
36
|
+
}
|
37
|
+
return self;
|
38
|
+
}
|
39
|
+
|
40
|
+
#pragma mark - RCTComponentViewProtocol
|
41
|
+
|
42
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
43
|
+
return concreteComponentDescriptorProvider<SkiaDomViewComponentDescriptor>();
|
44
|
+
}
|
45
|
+
|
46
|
+
- (void)updateProps:(const Props::Shared &)props
|
47
|
+
oldProps:(const Props::Shared &)oldProps {
|
48
|
+
const auto &newProps =
|
49
|
+
*std::static_pointer_cast<const SkiaDomViewProps>(props);
|
50
|
+
[super updateProps:props oldProps:oldProps];
|
51
|
+
int nativeId =
|
52
|
+
[[RCTConvert NSString:RCTNSStringFromString(newProps.nativeId)] intValue];
|
53
|
+
[self setNativeId:nativeId];
|
54
|
+
[self setDrawingMode:newProps.mode];
|
55
|
+
[self setDebugMode:newProps.debug];
|
56
|
+
}
|
57
|
+
|
58
|
+
@end
|
59
|
+
|
60
|
+
Class<RCTComponentViewProtocol> SkiaDomViewCls(void) {
|
61
|
+
return SkiaDomView.class;
|
62
|
+
}
|
63
|
+
|
64
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
@@ -16,7 +16,7 @@ RCT_EXPORT_MODULE(SkiaDomView)
|
|
16
16
|
|
17
17
|
- (SkiaManager *)skiaManager {
|
18
18
|
auto bridge = [RCTBridge currentBridge];
|
19
|
-
auto skiaModule = (RNSkiaModule *)[bridge moduleForName:@"
|
19
|
+
auto skiaModule = (RNSkiaModule *)[bridge moduleForName:@"RNSkiaModule"];
|
20
20
|
return [skiaModule manager];
|
21
21
|
}
|
22
22
|
|
@@ -0,0 +1,72 @@
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
2
|
+
#import <SkiaDrawView.h>
|
3
|
+
|
4
|
+
#import <RNSkDomView.h>
|
5
|
+
#import <RNSkIOSView.h>
|
6
|
+
#import <RNSkPlatformContext.h>
|
7
|
+
|
8
|
+
#import <RNSkJsView.h>
|
9
|
+
#import <SkiaUIView.h>
|
10
|
+
|
11
|
+
#import <React/RCTBridge+Private.h>
|
12
|
+
#import <React/RCTConversions.h>
|
13
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
14
|
+
|
15
|
+
#import <react/renderer/components/rnskia/ComponentDescriptors.h>
|
16
|
+
#import <react/renderer/components/rnskia/EventEmitters.h>
|
17
|
+
#import <react/renderer/components/rnskia/Props.h>
|
18
|
+
#import <react/renderer/components/rnskia/RCTComponentViewHelpers.h>
|
19
|
+
|
20
|
+
using namespace facebook::react;
|
21
|
+
|
22
|
+
@implementation SkiaDrawView
|
23
|
+
|
24
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
25
|
+
if (self = [super initWithFrame:frame]) {
|
26
|
+
[self prepareView];
|
27
|
+
static const auto defaultProps =
|
28
|
+
std::make_shared<const SkiaDrawViewProps>();
|
29
|
+
_props = defaultProps;
|
30
|
+
}
|
31
|
+
return self;
|
32
|
+
}
|
33
|
+
|
34
|
+
- (void)prepareView {
|
35
|
+
auto skManager = [[self skiaManager] skManager];
|
36
|
+
// Pass SkManager as a raw pointer to avoid circular dependenciesr
|
37
|
+
[self initCommon:skManager.get()
|
38
|
+
factory:[](std::shared_ptr<RNSkia::RNSkPlatformContext> context) {
|
39
|
+
return std::make_shared<RNSkiOSView<RNSkia::RNSkJsView>>(context);
|
40
|
+
}];
|
41
|
+
}
|
42
|
+
|
43
|
+
- (void)prepareForRecycle {
|
44
|
+
[super prepareForRecycle];
|
45
|
+
[self prepareView];
|
46
|
+
}
|
47
|
+
|
48
|
+
#pragma mark - RCTComponentViewProtocol
|
49
|
+
|
50
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
51
|
+
return concreteComponentDescriptorProvider<SkiaDrawViewComponentDescriptor>();
|
52
|
+
}
|
53
|
+
|
54
|
+
- (void)updateProps:(const Props::Shared &)props
|
55
|
+
oldProps:(const Props::Shared &)oldProps {
|
56
|
+
const auto &newProps =
|
57
|
+
*std::static_pointer_cast<const SkiaDrawViewProps>(props);
|
58
|
+
[super updateProps:props oldProps:oldProps];
|
59
|
+
int nativeId =
|
60
|
+
[[RCTConvert NSString:RCTNSStringFromString(newProps.nativeId)] intValue];
|
61
|
+
[self setNativeId:nativeId];
|
62
|
+
[self setDrawingMode:newProps.mode];
|
63
|
+
[self setDebugMode:newProps.debug];
|
64
|
+
}
|
65
|
+
|
66
|
+
@end
|
67
|
+
|
68
|
+
Class<RCTComponentViewProtocol> SkiaDrawViewCls(void) {
|
69
|
+
return SkiaDrawView.class;
|
70
|
+
}
|
71
|
+
|
72
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
@@ -15,7 +15,7 @@ RCT_EXPORT_MODULE(SkiaDrawView)
|
|
15
15
|
|
16
16
|
- (SkiaManager *)skiaManager {
|
17
17
|
auto bridge = [RCTBridge currentBridge];
|
18
|
-
auto skiaModule = (RNSkiaModule *)[bridge moduleForName:@"
|
18
|
+
auto skiaModule = (RNSkiaModule *)[bridge moduleForName:@"RNSkiaModule"];
|
19
19
|
return [skiaModule manager];
|
20
20
|
}
|
21
21
|
|