@shopify/react-native-skia 0.1.155 → 0.1.156
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/jni/JniLoad.cpp +5 -5
- package/android/cpp/jni/JniPlatformContext.cpp +107 -119
- package/android/cpp/jni/JniSkiaManager.cpp +18 -20
- package/android/cpp/jni/include/JniPlatformContext.h +41 -45
- package/android/cpp/jni/include/JniSkiaBaseView.h +52 -55
- package/android/cpp/jni/include/JniSkiaDrawView.h +72 -77
- package/android/cpp/jni/include/JniSkiaManager.h +51 -53
- package/android/cpp/jni/include/JniSkiaPictureView.h +74 -78
- package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +36 -45
- package/android/cpp/rnskia-android/RNSkAndroidView.h +87 -92
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +62 -65
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +20 -17
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +257 -313
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +107 -110
- package/cpp/api/JsiSkApi.h +66 -62
- package/cpp/api/JsiSkCanvas.h +38 -30
- package/cpp/api/JsiSkColor.h +58 -56
- package/cpp/api/JsiSkColorFilter.h +5 -3
- package/cpp/api/JsiSkColorFilterFactory.h +23 -21
- package/cpp/api/JsiSkContourMeasure.h +74 -85
- package/cpp/api/JsiSkContourMeasureIter.h +68 -75
- package/cpp/api/JsiSkData.h +16 -22
- package/cpp/api/JsiSkDataFactory.h +86 -79
- package/cpp/api/JsiSkFont.h +286 -311
- package/cpp/api/JsiSkHostObjects.h +15 -16
- package/cpp/api/JsiSkImage.h +107 -103
- package/cpp/api/JsiSkImageFactory.h +34 -36
- package/cpp/api/JsiSkImageFilter.h +5 -3
- package/cpp/api/JsiSkImageFilterFactory.h +71 -68
- package/cpp/api/JsiSkImageInfo.h +41 -38
- package/cpp/api/JsiSkMaskFilter.h +5 -3
- package/cpp/api/JsiSkMaskFilterFactory.h +2 -3
- package/cpp/api/JsiSkMatrix.h +26 -36
- package/cpp/api/JsiSkPaint.h +20 -13
- package/cpp/api/JsiSkPath.h +70 -85
- package/cpp/api/JsiSkPathEffect.h +5 -3
- package/cpp/api/JsiSkPathEffectFactory.h +33 -28
- package/cpp/api/JsiSkPathFactory.h +68 -67
- package/cpp/api/JsiSkPicture.h +28 -22
- package/cpp/api/JsiSkPictureFactory.h +13 -12
- package/cpp/api/JsiSkPictureRecorder.h +21 -19
- package/cpp/api/JsiSkPoint.h +6 -8
- package/cpp/api/JsiSkRRect.h +11 -7
- package/cpp/api/JsiSkRSXform.h +82 -85
- package/cpp/api/JsiSkRect.h +9 -9
- package/cpp/api/JsiSkRuntimeEffect.h +182 -186
- package/cpp/api/JsiSkRuntimeEffectFactory.h +10 -11
- package/cpp/api/JsiSkRuntimeShaderBuilder.h +64 -61
- package/cpp/api/JsiSkSVG.h +4 -5
- package/cpp/api/JsiSkSVGFactory.h +28 -27
- package/cpp/api/JsiSkShader.h +3 -2
- package/cpp/api/JsiSkShaderFactory.h +37 -25
- package/cpp/api/JsiSkSurface.h +44 -40
- package/cpp/api/JsiSkSurfaceFactory.h +22 -22
- package/cpp/api/JsiSkTextBlob.h +28 -31
- package/cpp/api/JsiSkTextBlobFactory.h +88 -87
- package/cpp/api/JsiSkTypeface.h +6 -5
- package/cpp/api/JsiSkTypefaceFactory.h +22 -21
- package/cpp/api/JsiSkVertices.h +137 -124
- package/cpp/api/third_party/CSSColorParser.cpp +161 -174
- package/cpp/api/third_party/CSSColorParser.h +172 -96
- package/cpp/jsi/JsiHostObject.cpp +11 -9
- package/cpp/jsi/JsiHostObject.h +31 -24
- package/cpp/jsi/JsiSimpleValueWrapper.h +74 -83
- package/cpp/jsi/JsiValueWrapper.h +52 -54
- package/cpp/rnskia/RNSkAnimation.h +26 -29
- package/cpp/rnskia/RNSkDispatchQueue.cpp +50 -61
- package/cpp/rnskia/RNSkDispatchQueue.h +3 -1
- package/cpp/rnskia/RNSkInfoParameter.h +12 -12
- package/cpp/rnskia/RNSkJsView.cpp +82 -81
- package/cpp/rnskia/RNSkJsView.h +45 -41
- package/cpp/rnskia/RNSkJsiViewApi.h +99 -89
- package/cpp/rnskia/RNSkManager.cpp +8 -7
- package/cpp/rnskia/RNSkManager.h +8 -6
- package/cpp/rnskia/RNSkPictureView.h +44 -37
- package/cpp/rnskia/RNSkPlatformContext.h +39 -28
- package/cpp/rnskia/RNSkValueApi.h +33 -34
- package/cpp/rnskia/RNSkView.h +108 -93
- package/cpp/rnskia/values/RNSkClockValue.h +63 -64
- package/cpp/rnskia/values/RNSkComputedValue.h +32 -30
- package/cpp/rnskia/values/RNSkReadonlyValue.h +60 -59
- package/cpp/rnskia/values/RNSkValue.h +38 -40
- package/cpp/utils/RNSkLog.h +9 -7
- package/cpp/utils/RNSkMeasureTime.h +7 -7
- package/cpp/utils/RNSkTimingInfo.h +27 -24
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +8 -9
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.h +24 -23
- package/ios/RNSkia-iOS/RNSkiOSView.h +16 -13
- package/ios/RNSkia-iOS/SkiaUIView.h +9 -8
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +6 -0
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/LayerNode.js +43 -0
- package/lib/commonjs/dom/nodes/LayerNode.js.map +1 -0
- package/lib/commonjs/dom/types/NodeType.js +1 -0
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.js +3 -0
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/components/Group.js +19 -4
- package/lib/commonjs/renderer/components/Group.js.map +1 -1
- package/lib/commonjs/renderer/components/Paint.js +6 -1
- package/lib/commonjs/renderer/components/Paint.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.js +3 -2
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
- package/lib/commonjs/views/SkiaView.js +6 -3
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js +5 -0
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/LayerNode.js +32 -0
- package/lib/module/dom/nodes/LayerNode.js.map +1 -0
- package/lib/module/dom/types/NodeType.js +1 -0
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/renderer/HostComponents.js +3 -0
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/components/Group.js +16 -3
- package/lib/module/renderer/components/Group.js.map +1 -1
- package/lib/module/renderer/components/Paint.js +7 -1
- package/lib/module/renderer/components/Paint.js.map +1 -1
- package/lib/module/views/SkiaPictureView.js +2 -2
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/SkiaView.js +4 -2
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +2 -0
- package/lib/typescript/src/dom/nodes/LayerNode.d.ts +8 -0
- package/lib/typescript/src/dom/types/NodeType.d.ts +1 -0
- package/lib/typescript/src/dom/types/SkDOM.d.ts +1 -0
- package/lib/typescript/src/renderer/HostComponents.d.ts +2 -1
- package/lib/typescript/src/renderer/components/Group.d.ts +5 -1
- package/lib/typescript/src/views/SkiaView.d.ts +3 -0
- package/libs/android/arm64-v8a/libskottie.a +0 -0
- package/libs/android/arm64-v8a/libsksg.a +0 -0
- package/libs/android/armeabi-v7a/libskottie.a +0 -0
- package/libs/android/armeabi-v7a/libsksg.a +0 -0
- package/libs/android/x86/libskottie.a +0 -0
- package/libs/android/x86/libsksg.a +0 -0
- package/libs/android/x86_64/libskottie.a +0 -0
- package/libs/android/x86_64/libsksg.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskottie.xcframework/Info.plist +42 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libsksg.xcframework/Info.plist +42 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +5 -5
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +3 -1
- package/src/dom/nodes/JsiSkDOM.ts +5 -0
- package/src/dom/nodes/LayerNode.ts +35 -0
- package/src/dom/types/NodeType.ts +1 -0
- package/src/dom/types/SkDOM.ts +1 -0
- package/src/renderer/HostComponents.ts +3 -0
- package/src/renderer/components/Group.tsx +16 -3
- package/src/renderer/components/Paint.tsx +7 -1
- package/src/views/SkiaPictureView.tsx +2 -3
- package/src/views/SkiaView.tsx +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createNode","container","type","props","Sk","NodeType","Group","Paint","Fill","Image","Circle","Path","Drawing","CustomDrawing","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LerpColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow","exhaustiveCheck"],"sources":["HostComponents.ts"],"sourcesContent":["import type { ForwardedRef } from \"react\";\n\nimport { NodeType } from \"../dom/types\";\nimport type {\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\nimport type { PaintNode } from \"../dom/nodes/PaintNode\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skPaint: SkiaProps<PaintProps> & { ref: ForwardedRef<PaintNode> };\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skDrawing: SkiaProps<CustomDrawingNodeProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<TurbulenceProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n }\n }\n}\n\nexport const createNode = (\n container: Container,\n type: NodeType,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: any\n) => {\n const { Sk } = container;\n switch (type) {\n case NodeType.Group:\n return Sk.Group(props);\n case NodeType.Paint:\n return Sk.Paint(props);\n // Drawings\n case NodeType.Fill:\n return Sk.Fill(props);\n case NodeType.Image:\n return Sk.Image(props);\n case NodeType.Circle:\n return Sk.Circle(props);\n case NodeType.Path:\n return Sk.Path(props);\n case NodeType.Drawing:\n return Sk.CustomDrawing(props);\n case NodeType.Line:\n return Sk.Line(props);\n case NodeType.Oval:\n return Sk.Oval(props);\n case NodeType.Patch:\n return Sk.Patch(props);\n case NodeType.Points:\n return Sk.Points(props);\n case NodeType.Rect:\n return Sk.Rect(props);\n case NodeType.RRect:\n return Sk.RRect(props);\n case NodeType.Vertices:\n return Sk.Vertices(props);\n case NodeType.Text:\n return Sk.Text(props);\n case NodeType.TextPath:\n return Sk.TextPath(props);\n case NodeType.TextBlob:\n return Sk.TextBlob(props);\n case NodeType.Glyphs:\n return Sk.Glyphs(props);\n case NodeType.DiffRect:\n return Sk.DiffRect(props);\n case NodeType.Picture:\n return Sk.Picture(props);\n case NodeType.ImageSVG:\n return Sk.ImageSVG(props);\n // Mask Filter\n case NodeType.BlurMaskFilter:\n return Sk.BlurMaskFilter(props);\n // Image Filter\n case NodeType.BlendImageFilter:\n return Sk.BlendImageFilter(props);\n case NodeType.BlurImageFilter:\n return Sk.BlurImageFilter(props);\n case NodeType.OffsetImageFilter:\n return Sk.OffsetImageFilter(props);\n case NodeType.DropShadowImageFilter:\n return Sk.DropShadowImageFilter(props);\n case NodeType.DisplacementMapImageFilter:\n return Sk.DisplacementMapImageFilter(props);\n case NodeType.MorphologyImageFilter:\n return Sk.MorphologyImageFilter(props);\n case NodeType.RuntimeShaderImageFilter:\n return Sk.RuntimeShaderImageFilter(props);\n // Color Filter\n case NodeType.MatrixColorFilter:\n return Sk.MatrixColorFilter(props);\n case NodeType.BlendColorFilter:\n return Sk.BlendColorFilter(props);\n case NodeType.LerpColorFilter:\n return Sk.LerpColorFilter(props);\n case NodeType.LumaColorFilter:\n return Sk.LumaColorFilter();\n case NodeType.LinearToSRGBGammaColorFilter:\n return Sk.LinearToSRGBGammaColorFilter();\n case NodeType.SRGBToLinearGammaColorFilter:\n return Sk.SRGBToLinearGammaColorFilter();\n // Shader\n case NodeType.Shader:\n return Sk.Shader(props);\n case NodeType.ImageShader:\n return Sk.ImageShader(props);\n case NodeType.ColorShader:\n return Sk.ColorShader(props);\n case NodeType.Turbulence:\n return Sk.Turbulence(props);\n case NodeType.FractalNoise:\n return Sk.FractalNoise(props);\n case NodeType.LinearGradient:\n return Sk.LinearGradient(props);\n case NodeType.RadialGradient:\n return Sk.RadialGradient(props);\n case NodeType.SweepGradient:\n return Sk.SweepGradient(props);\n case NodeType.TwoPointConicalGradient:\n return Sk.TwoPointConicalGradient(props);\n // Path Effect\n case NodeType.CornerPathEffect:\n return Sk.CornerPathEffect(props);\n case NodeType.DiscretePathEffect:\n return Sk.DiscretePathEffect(props);\n case NodeType.DashPathEffect:\n return Sk.DashPathEffect(props);\n case NodeType.Path1DPathEffect:\n return Sk.Path1DPathEffect(props);\n case NodeType.Path2DPathEffect:\n return Sk.Path2DPathEffect(props);\n case NodeType.SumPathEffect:\n return Sk.SumPathEffect();\n case NodeType.Line2DPathEffect:\n return Sk.Line2DPathEffect(props);\n // Mixed\n case NodeType.Blend:\n return Sk.Blend(props);\n case NodeType.BackdropFilter:\n return Sk.BackdropFilter(props);\n case NodeType.Box:\n return Sk.Box(props);\n case NodeType.BoxShadow:\n return Sk.BoxShadow(props);\n default:\n return exhaustiveCheck(type);\n }\n};\n"],"mappings":";;;;;;;AAEA;;AA0DA;;AAgFO,MAAMA,UAAU,GAAG,CACxBC,SADwB,EAExBC,IAFwB,EAIxBC,KAJwB,KAKrB;EACH,MAAM;IAAEC;EAAF,IAASH,SAAf;;EACA,QAAQC,IAAR;IACE,KAAKG,eAAA,CAASC,KAAd;MACE,OAAOF,EAAE,CAACE,KAAH,CAASH,KAAT,CAAP;;IACF,KAAKE,eAAA,CAASE,KAAd;MACE,OAAOH,EAAE,CAACG,KAAH,CAASJ,KAAT,CAAP;IACF;;IACA,KAAKE,eAAA,CAASG,IAAd;MACE,OAAOJ,EAAE,CAACI,IAAH,CAAQL,KAAR,CAAP;;IACF,KAAKE,eAAA,CAASI,KAAd;MACE,OAAOL,EAAE,CAACK,KAAH,CAASN,KAAT,CAAP;;IACF,KAAKE,eAAA,CAASK,MAAd;MACE,OAAON,EAAE,CAACM,MAAH,CAAUP,KAAV,CAAP;;IACF,KAAKE,eAAA,CAASM,IAAd;MACE,OAAOP,EAAE,CAACO,IAAH,CAAQR,KAAR,CAAP;;IACF,KAAKE,eAAA,CAASO,OAAd;MACE,OAAOR,EAAE,CAACS,aAAH,CAAiBV,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Ad;MACE,OAAOpD,EAAE,CAACoD,aAAH,EAAP;;IACF,KAAKnD,eAAA,CAASoD,gBAAd;MACE,OAAOrD,EAAE,CAACqD,gBAAH,CAAoBtD,KAApB,CAAP;IACF;;IACA,KAAKE,eAAA,CAASqD,KAAd;MACE,OAAOtD,EAAE,CAACsD,KAAH,CAASvD,KAAT,CAAP;;IACF,KAAKE,eAAA,CAASsD,cAAd;MACE,OAAOvD,EAAE,CAACuD,cAAH,CAAkBxD,KAAlB,CAAP;;IACF,KAAKE,eAAA,CAASuD,GAAd;MACE,OAAOxD,EAAE,CAACwD,GAAH,CAAOzD,KAAP,CAAP;;IACF,KAAKE,eAAA,CAASwD,SAAd;MACE,OAAOzD,EAAE,CAACyD,SAAH,CAAa1D,KAAb,CAAP;;IACF;MACE,OAAO,IAAA2D,0BAAA,EAAgB5D,IAAhB,CAAP;EAvHJ;AAyHD,CAhIM"}
|
1
|
+
{"version":3,"names":["createNode","container","type","props","Sk","NodeType","Layer","Group","Paint","Fill","Image","Circle","Path","Drawing","CustomDrawing","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LerpColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow","exhaustiveCheck"],"sources":["HostComponents.ts"],"sourcesContent":["import type { ForwardedRef } from \"react\";\n\nimport { NodeType } from \"../dom/types\";\nimport type {\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\nimport type { PaintNode } from \"../dom/nodes/PaintNode\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skLayer: SkiaProps<ChildrenProps>;\n skPaint: SkiaProps<PaintProps> & { ref: ForwardedRef<PaintNode> };\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skDrawing: SkiaProps<CustomDrawingNodeProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<TurbulenceProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n }\n }\n}\n\nexport const createNode = (\n container: Container,\n type: NodeType,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: any\n) => {\n const { Sk } = container;\n switch (type) {\n case NodeType.Layer:\n return Sk.Layer(props);\n case NodeType.Group:\n return Sk.Group(props);\n case NodeType.Paint:\n return Sk.Paint(props);\n // Drawings\n case NodeType.Fill:\n return Sk.Fill(props);\n case NodeType.Image:\n return Sk.Image(props);\n case NodeType.Circle:\n return Sk.Circle(props);\n case NodeType.Path:\n return Sk.Path(props);\n case NodeType.Drawing:\n return Sk.CustomDrawing(props);\n case NodeType.Line:\n return Sk.Line(props);\n case NodeType.Oval:\n return Sk.Oval(props);\n case NodeType.Patch:\n return Sk.Patch(props);\n case NodeType.Points:\n return Sk.Points(props);\n case NodeType.Rect:\n return Sk.Rect(props);\n case NodeType.RRect:\n return Sk.RRect(props);\n case NodeType.Vertices:\n return Sk.Vertices(props);\n case NodeType.Text:\n return Sk.Text(props);\n case NodeType.TextPath:\n return Sk.TextPath(props);\n case NodeType.TextBlob:\n return Sk.TextBlob(props);\n case NodeType.Glyphs:\n return Sk.Glyphs(props);\n case NodeType.DiffRect:\n return Sk.DiffRect(props);\n case NodeType.Picture:\n return Sk.Picture(props);\n case NodeType.ImageSVG:\n return Sk.ImageSVG(props);\n // Mask Filter\n case NodeType.BlurMaskFilter:\n return Sk.BlurMaskFilter(props);\n // Image Filter\n case NodeType.BlendImageFilter:\n return Sk.BlendImageFilter(props);\n case NodeType.BlurImageFilter:\n return Sk.BlurImageFilter(props);\n case NodeType.OffsetImageFilter:\n return Sk.OffsetImageFilter(props);\n case NodeType.DropShadowImageFilter:\n return Sk.DropShadowImageFilter(props);\n case NodeType.DisplacementMapImageFilter:\n return Sk.DisplacementMapImageFilter(props);\n case NodeType.MorphologyImageFilter:\n return Sk.MorphologyImageFilter(props);\n case NodeType.RuntimeShaderImageFilter:\n return Sk.RuntimeShaderImageFilter(props);\n // Color Filter\n case NodeType.MatrixColorFilter:\n return Sk.MatrixColorFilter(props);\n case NodeType.BlendColorFilter:\n return Sk.BlendColorFilter(props);\n case NodeType.LerpColorFilter:\n return Sk.LerpColorFilter(props);\n case NodeType.LumaColorFilter:\n return Sk.LumaColorFilter();\n case NodeType.LinearToSRGBGammaColorFilter:\n return Sk.LinearToSRGBGammaColorFilter();\n case NodeType.SRGBToLinearGammaColorFilter:\n return Sk.SRGBToLinearGammaColorFilter();\n // Shader\n case NodeType.Shader:\n return Sk.Shader(props);\n case NodeType.ImageShader:\n return Sk.ImageShader(props);\n case NodeType.ColorShader:\n return Sk.ColorShader(props);\n case NodeType.Turbulence:\n return Sk.Turbulence(props);\n case NodeType.FractalNoise:\n return Sk.FractalNoise(props);\n case NodeType.LinearGradient:\n return Sk.LinearGradient(props);\n case NodeType.RadialGradient:\n return Sk.RadialGradient(props);\n case NodeType.SweepGradient:\n return Sk.SweepGradient(props);\n case NodeType.TwoPointConicalGradient:\n return Sk.TwoPointConicalGradient(props);\n // Path Effect\n case NodeType.CornerPathEffect:\n return Sk.CornerPathEffect(props);\n case NodeType.DiscretePathEffect:\n return Sk.DiscretePathEffect(props);\n case NodeType.DashPathEffect:\n return Sk.DashPathEffect(props);\n case NodeType.Path1DPathEffect:\n return Sk.Path1DPathEffect(props);\n case NodeType.Path2DPathEffect:\n return Sk.Path2DPathEffect(props);\n case NodeType.SumPathEffect:\n return Sk.SumPathEffect();\n case NodeType.Line2DPathEffect:\n return Sk.Line2DPathEffect(props);\n // Mixed\n case NodeType.Blend:\n return Sk.Blend(props);\n case NodeType.BackdropFilter:\n return Sk.BackdropFilter(props);\n case NodeType.Box:\n return Sk.Box(props);\n case NodeType.BoxShadow:\n return Sk.BoxShadow(props);\n default:\n return exhaustiveCheck(type);\n }\n};\n"],"mappings":";;;;;;;AAEA;;AA0DA;;AAiFO,MAAMA,UAAU,GAAG,CACxBC,SADwB,EAExBC,IAFwB,EAIxBC,KAJwB,KAKrB;EACH,MAAM;IAAEC;EAAF,IAASH,SAAf;;EACA,QAAQC,IAAR;IACE,KAAKG,eAAA,CAASC,KAAd;MACE,OAAOF,EAAE,CAACE,KAAH,CAASH,KAAT,CAAP;;IACF,KAAKE,eAAA,CAASE,KAAd;MACE,OAAOH,EAAE,CAACG,KAAH,CAASJ,KAAT,CAAP;;IACF,KAAKE,eAAA,CAASG,KAAd;MACE,OAAOJ,EAAE,CAACI,KAAH,CAASL,KAAT,CAAP;IACF;;IACA,KAAKE,eAAA,CAASI,IAAd;MACE,OAAOL,EAAE,CAACK,IAAH,CAAQN,KAAR,CAAP;;IACF,KAAKE,eAAA,CAASK,KAAd;MACE,OAAON,EAAE,CAACM,KAAH,CAASP,KAAT,CAAP;;IACF,KAAKE,eAAA,CAASM,MAAd;MACE,OAAOP,EAAE,CAACO,MAAH,CAAUR,KAAV,CAAP;;IACF,KAAKE,eAAA,CAASO,IAAd;MACE,OAAOR,EAAE,CAACQ,IAAH,CAAQT,KAAR,CAAP;;IACF,KAAKE,eAAA,CAASQ,OAAd;MACE,OAAOT,EAAE,CAACU,aAAH,CAAiBX,KAAjB,CAAP;;IACF,KAAKE,eAAA,CAASU,IAAd;MACE,OAAOX,EAAE,CAACW,IAAH,CAAQZ,KAAR,CAAP;;IACF,KAAKE,eAAA,CAASW,IAAd;MACE,OAAOZ,EAAE,CAACY,IAAH,CAAQb,KAAR,CAAP;;IACF,KAAKE,eAAA,CAASY,KAAd;MACE,OAAOb,EAAE,CAACa,K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KAAKE,eAAA,CAASuD,cAAd;MACE,OAAOxD,EAAE,CAACwD,cAAH,CAAkBzD,KAAlB,CAAP;;IACF,KAAKE,eAAA,CAASwD,GAAd;MACE,OAAOzD,EAAE,CAACyD,GAAH,CAAO1D,KAAP,CAAP;;IACF,KAAKE,eAAA,CAASyD,SAAd;MACE,OAAO1D,EAAE,CAAC0D,SAAH,CAAa3D,KAAb,CAAP;;IACF;MACE,OAAO,IAAA4D,0BAAA,EAAgB7D,IAAhB,CAAP;EAzHJ;AA2HD,CAlIM"}
|
@@ -5,12 +5,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.Group = void 0;
|
7
7
|
|
8
|
-
var _react =
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
-
function
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
13
|
+
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
15
|
+
|
16
|
+
const Group = _ref => {
|
17
|
+
let {
|
18
|
+
layer,
|
19
|
+
...props
|
20
|
+
} = _ref;
|
21
|
+
|
22
|
+
if ( /*#__PURE__*/(0, _react.isValidElement)(layer) && typeof layer === "object") {
|
23
|
+
return /*#__PURE__*/_react.default.createElement("skLayer", null, layer, /*#__PURE__*/_react.default.createElement("skGroup", props));
|
24
|
+
}
|
25
|
+
|
26
|
+
return /*#__PURE__*/_react.default.createElement("skGroup", _extends({
|
27
|
+
layer: layer
|
28
|
+
}, props));
|
14
29
|
};
|
15
30
|
|
16
31
|
exports.Group = Group;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Group","props"],"sources":["Group.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../processors\";\nimport type { GroupProps } from \"../../dom/types\";\n\nexport const Group = (props: SkiaProps<
|
1
|
+
{"version":3,"names":["Group","layer","props","isValidElement"],"sources":["Group.tsx"],"sourcesContent":["import React, { isValidElement } from \"react\";\n\nimport type { SkiaProps } from \"../processors\";\nimport type { GroupProps } from \"../../dom/types\";\nimport type { ChildrenProps } from \"../../dom/types/Common\";\n\nexport interface PublicGroupProps extends Omit<GroupProps, \"layer\"> {\n layer?: GroupProps[\"layer\"] | ChildrenProps[\"children\"];\n}\n\nexport const Group = ({ layer, ...props }: SkiaProps<PublicGroupProps>) => {\n if (isValidElement(layer) && typeof layer === \"object\") {\n return (\n <skLayer>\n {layer}\n <skGroup {...props} />\n </skLayer>\n );\n }\n return <skGroup layer={layer as GroupProps[\"layer\"]} {...props} />;\n};\n"],"mappings":";;;;;;;AAAA;;;;;;;;AAUO,MAAMA,KAAK,GAAG,QAAsD;EAAA,IAArD;IAAEC,KAAF;IAAS,GAAGC;EAAZ,CAAqD;;EACzE,IAAI,kBAAAC,qBAAA,EAAeF,KAAf,KAAyB,OAAOA,KAAP,KAAiB,QAA9C,EAAwD;IACtD,oBACE,8CACGA,KADH,eAEE,wCAAaC,KAAb,CAFF,CADF;EAMD;;EACD,oBAAO;IAAS,KAAK,EAAED;EAAhB,GAAkDC,KAAlD,EAAP;AACD,CAVM"}
|
@@ -13,7 +13,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
13
13
|
|
14
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
15
15
|
|
16
|
-
const usePaintRef = () =>
|
16
|
+
const usePaintRef = () => {
|
17
|
+
console.log(`usePaintRef() is now deprecated.
|
18
|
+
If you are using the layer property, simply pass the component directly: https://shopify.github.io/react-native-skia/docs/group#layer-effects.
|
19
|
+
If you are using the paint property, please the following paint properties directly: https://shopify.github.io/react-native-skia/docs/paint/overview`);
|
20
|
+
return (0, _react.useRef)(null);
|
21
|
+
};
|
17
22
|
|
18
23
|
exports.usePaintRef = usePaintRef;
|
19
24
|
const Paint = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["usePaintRef","useRef","Paint","forwardRef","props","ref"],"sources":["Paint.tsx"],"sourcesContent":["
|
1
|
+
{"version":3,"names":["usePaintRef","console","log","useRef","Paint","forwardRef","props","ref"],"sources":["Paint.tsx"],"sourcesContent":["/* eslint-disable max-len */\nimport React, { useRef, forwardRef } from \"react\";\n\nimport type { SkiaProps } from \"../processors\";\nimport type { DrawingNodeProps } from \"../../dom/types\";\nimport type { PaintNode } from \"../../dom/nodes/PaintNode\";\n\nexport const usePaintRef = () => {\n console.log(`usePaintRef() is now deprecated.\nIf you are using the layer property, simply pass the component directly: https://shopify.github.io/react-native-skia/docs/group#layer-effects.\nIf you are using the paint property, please the following paint properties directly: https://shopify.github.io/react-native-skia/docs/paint/overview`);\n return useRef<PaintNode>(null);\n};\n\nexport const Paint = forwardRef<PaintNode, SkiaProps<DrawingNodeProps>>(\n (props, ref) => {\n return <skPaint ref={ref} {...props} />;\n }\n);\n"],"mappings":";;;;;;;AACA;;;;;;;;AAMO,MAAMA,WAAW,GAAG,MAAM;EAC/BC,OAAO,CAACC,GAAR,CAAa;AACf;AACA,qJAFE;EAGA,OAAO,IAAAC,aAAA,EAAkB,IAAlB,CAAP;AACD,CALM;;;AAOA,MAAMC,KAAK,gBAAG,IAAAC,iBAAA,EACnB,CAACC,KAAD,EAAQC,GAAR,KAAgB;EACd,oBAAO;IAAS,GAAG,EAAEA;EAAd,GAAuBD,KAAvB,EAAP;AACD,CAHkB,CAAd"}
|
@@ -11,13 +11,14 @@ var _reactNative = require("react-native");
|
|
11
11
|
|
12
12
|
var _api = require("./api");
|
13
13
|
|
14
|
+
var _SkiaView = require("./SkiaView");
|
15
|
+
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
17
|
|
16
18
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
17
19
|
|
18
20
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
19
21
|
|
20
|
-
let SkiaViewNativeId = 1000;
|
21
22
|
const NativeSkiaPictureView = (0, _reactNative.requireNativeComponent)("SkiaPictureView");
|
22
23
|
|
23
24
|
class SkiaPictureView extends _react.default.Component {
|
@@ -26,7 +27,7 @@ class SkiaPictureView extends _react.default.Component {
|
|
26
27
|
|
27
28
|
_defineProperty(this, "_nativeId", void 0);
|
28
29
|
|
29
|
-
this._nativeId = SkiaViewNativeId++;
|
30
|
+
this._nativeId = _SkiaView.SkiaViewNativeId.current++;
|
30
31
|
const {
|
31
32
|
picture
|
32
33
|
} = props;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["NativeSkiaPictureView","requireNativeComponent","SkiaPictureView","React","Component","constructor","props","_nativeId","SkiaViewNativeId","current","picture","assertSkiaViewApi","SkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaPictureView.tsx"],"sourcesContent":["import React from \"react\";\nimport { requireNativeComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nimport { SkiaViewApi } from \"./api\";\nimport { SkiaViewNativeId } from \"./SkiaView\";\nimport type { NativeSkiaViewProps, SkiaPictureViewProps } from \"./types\";\n\nconst NativeSkiaPictureView =\n requireNativeComponent<NativeSkiaViewProps>(\"SkiaPictureView\");\n\nexport class SkiaPictureView extends React.Component<SkiaPictureViewProps> {\n constructor(props: SkiaPictureViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { picture } = props;\n if (picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaPictureViewProps) {\n const { picture } = this.props;\n if (picture !== prevProps.picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAKA;;AACA;;;;;;;;AAGA,MAAMA,qBAAqB,GACzB,IAAAC,mCAAA,EAA4C,iBAA5C,CADF;;AAGO,MAAMC,eAAN,SAA8BC,cAAA,CAAMC,SAApC,CAAoE;EACzEC,WAAW,CAACC,KAAD,EAA8B;IACvC,MAAMA,KAAN;;IADuC;;IAEvC,KAAKC,SAAL,GAAiBC,0BAAA,CAAiBC,OAAjB,EAAjB;IACA,MAAM;MAAEC;IAAF,IAAcJ,KAApB;;IACA,IAAII,OAAJ,EAAa;MACXC,iBAAiB;;MACjBC,gBAAA,CAAYC,cAAZ,CAA2B,KAAKN,SAAhC,EAA2C,SAA3C,EAAsDG,OAAtD;IACD;EACF;;EAIkB,IAARI,QAAQ,GAAG;IACpB,OAAO,KAAKP,SAAZ;EACD;;EAEDQ,kBAAkB,CAACC,SAAD,EAAkC;IAClD,MAAM;MAAEN;IAAF,IAAc,KAAKJ,KAAzB;;IACA,IAAII,OAAO,KAAKM,SAAS,CAACN,OAA1B,EAAmC;MACjCC,iB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|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.SkiaView = void 0;
|
6
|
+
exports.SkiaViewNativeId = exports.SkiaView = void 0;
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
@@ -17,7 +17,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
17
17
|
|
18
18
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
19
19
|
|
20
|
-
|
20
|
+
const SkiaViewNativeId = {
|
21
|
+
current: 1000
|
22
|
+
};
|
23
|
+
exports.SkiaViewNativeId = SkiaViewNativeId;
|
21
24
|
const NativeSkiaView = (0, _reactNative.requireNativeComponent)("SkiaDrawView");
|
22
25
|
|
23
26
|
class SkiaView extends _react.default.Component {
|
@@ -26,7 +29,7 @@ class SkiaView extends _react.default.Component {
|
|
26
29
|
|
27
30
|
_defineProperty(this, "_nativeId", void 0);
|
28
31
|
|
29
|
-
this._nativeId = SkiaViewNativeId++;
|
32
|
+
this._nativeId = SkiaViewNativeId.current++;
|
30
33
|
const {
|
31
34
|
onDraw
|
32
35
|
} = props;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["SkiaViewNativeId","NativeSkiaView","requireNativeComponent","SkiaView","React","Component","constructor","props","_nativeId","onDraw","assertSkiaViewApi","SkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaView.tsx"],"sourcesContent":["import React from \"react\";\nimport { requireNativeComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { NativeSkiaViewProps, SkiaDrawViewProps } from \"./types\";\n\
|
1
|
+
{"version":3,"names":["SkiaViewNativeId","current","NativeSkiaView","requireNativeComponent","SkiaView","React","Component","constructor","props","_nativeId","onDraw","assertSkiaViewApi","SkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaView.tsx"],"sourcesContent":["import React from \"react\";\nimport { requireNativeComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { NativeSkiaViewProps, SkiaDrawViewProps } from \"./types\";\n\nexport const SkiaViewNativeId = { current: 1000 };\n\nconst NativeSkiaView =\n requireNativeComponent<NativeSkiaViewProps>(\"SkiaDrawView\");\n\nexport class SkiaView extends React.Component<SkiaDrawViewProps> {\n constructor(props: SkiaDrawViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { onDraw } = props;\n if (onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDrawViewProps) {\n const { onDraw } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAKA;;;;;;;;AAGO,MAAMA,gBAAgB,GAAG;EAAEC,OAAO,EAAE;AAAX,CAAzB;;AAEP,MAAMC,cAAc,GAClB,IAAAC,mCAAA,EAA4C,cAA5C,CADF;;AAGO,MAAMC,QAAN,SAAuBC,cAAA,CAAMC,SAA7B,CAA0D;EAC/DC,WAAW,CAACC,KAAD,EAA2B;IACpC,MAAMA,KAAN;;IADoC;;IAEpC,KAAKC,SAAL,GAAiBT,gBAAgB,CAACC,OAAjB,EAAjB;IACA,MAAM;MAAES;IAAF,IAAaF,KAAnB;;IACA,IAAIE,MAAJ,EAAY;MACVC,iBAAiB;;MACjBC,gBAAA,CAAYC,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,cAA3C,EAA2DC,MAA3D;IACD;EACF;;EAIkB,IAARI,QAAQ,GAAG;IACpB,OAAO,KAAKL,SAAZ;EACD;;EAEDM,kBAAkB,CAACC,SAAD,EAA+B;IAC/C,MAAM;MAAEN;IAAF,IAAa,KAAKF,KAAxB;;IACA,IAAIE,MAAM,KAAKM,SAAS,CAACN,MAAzB,EAAiC;MAC/BC,iBAAiB;;MACjBC,gBAAA,CAAYC,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,cAA3C,EAA2DC,MAA3D;IACD;EACF;EAED;AACF;AACA;AACA;AACA;;;EACSO,iBAAiB,CAACC,IAAD,EAAgB;IACtCP,iBAAiB;IACjB,OAAOC,gBAAA,CAAYK,iBAAZ,CAA8B,KAAKR,SAAnC,EAA8CS,IAA9C,CAAP;EACD;EAED;AACF;AACA;;;EACSC,MAAM,GAAG;IACdR,iBAAiB;;IACjBC,gBAAA,CAAYQ,aAAZ,CAA0B,KAAKX,SAA/B;EACD;EAED;AACF;AACA;AACA;AACA;;;EACSY,cAAc,CAACC,MAAD,EAA2C;IAC9DX,iBAAiB;IACjB,OAAOC,gBAAA,CAAYW,oBAAZ,CAAiC,KAAKd,SAAtC,EAAiDa,MAAjD,CAAP;EACD;;EAEDE,MAAM,GAAG;IACP,MAAM;MAAEC,IAAF;MAAQC,KAAK,GAAG,KAAhB;MAAuB,GAAGC;IAA1B,IAAwC,KAAKnB,KAAnD;IACA,oBACE,6BAAC,cAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;MAGE,IAAI,EAAEgB,IAHR;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AAhE8D;;;;AAmEjE,MAAMhB,iBAAiB,GAAG,MAAM;EAC9B,IACEC,gBAAA,KAAgB,IAAhB,IACAA,gBAAA,CAAYC,cAAZ,KAA+B,IAD/B,IAEAD,gBAAA,CAAYgB,aAAZ,KAA8B,IAF9B,IAGAhB,gBAAA,CAAYW,oBAAZ,KAAqC,IAHrC,IAIAX,gBAAA,CAAYQ,aAAZ,KAA8B,IAJ9B,IAKAR,gBAAA,CAAYK,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMY,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
|
@@ -5,11 +5,16 @@ import { LinearGradientNode, ShaderNode, ImageShaderNode, TwoPointConicalGradien
|
|
5
5
|
import { MorphologyImageFilterNode } from "./paint/ImageFilters";
|
6
6
|
import { GroupNode } from "./GroupNode";
|
7
7
|
import { PaintNode } from "./PaintNode";
|
8
|
+
import { LayerNode } from "./LayerNode";
|
8
9
|
export class JsiSkDOM {
|
9
10
|
constructor(ctx) {
|
10
11
|
this.ctx = ctx;
|
11
12
|
}
|
12
13
|
|
14
|
+
Layer(props) {
|
15
|
+
return new LayerNode(this.ctx, props ?? {});
|
16
|
+
}
|
17
|
+
|
13
18
|
Group(props) {
|
14
19
|
return new GroupNode(this.ctx, props ?? {});
|
15
20
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["FillNode","ImageNode","CircleNode","PathNode","LineNode","PatchNode","PointsNode","RectNode","RRectNode","VerticesNode","TextNode","OvalNode","CustomDrawingNode","TextPathNode","TextBlobNode","GlyphsNode","DiffRectNode","PictureNode","ImageSVGNode","BackdropFilterNode","BoxNode","BoxShadowNode","BlendImageFilterNode","BlurImageFilterNode","BlurMaskFilterNode","DisplacementMapImageFilterNode","DropShadowImageFilterNode","OffsetImageFilterNode","RuntimeShaderImageFilterNode","CornerPathEffectNode","DiscretePathEffectNode","DashPathEffectNode","Path1DPathEffectNode","Path2DPathEffectNode","SumPathEffectNode","Line2DPathEffectNode","BlendNode","MatrixColorFilterNode","LumaColorFilterNode","LinearToSRGBGammaColorFilterNode","SRGBToLinearGammaColorFilterNode","BlendColorFilterNode","LerpColorFilterNode","LinearGradientNode","ShaderNode","ImageShaderNode","TwoPointConicalGradientNode","TurbulenceNode","SweepGradientNode","RadialGradientNode","FractalNoiseNode","ColorNode","MorphologyImageFilterNode","GroupNode","PaintNode","JsiSkDOM","constructor","ctx","Group","props","Paint","Fill","Image","Circle","Path","CustomDrawing","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","BlurImageFilter","OffsetImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","LerpColorFilter","Shader","ImageShader","ColorShader","SweepGradient","Turbulence","FractalNoise","LinearGradient","RadialGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow"],"sources":["JsiSkDOM.ts"],"sourcesContent":["import type {\n PathProps,\n SkDOM,\n GroupProps,\n ImageProps,\n BlurImageFilterProps,\n MatrixColorFilterProps,\n CircleProps,\n BlurMaskFilterProps,\n LinearGradientProps,\n PaintProps,\n ShaderProps,\n ImageShaderProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n PatchProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n VerticesProps,\n TextProps,\n DiffRectProps,\n OffsetImageFilterProps,\n BlendColorFilterProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n FractalNoiseProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n DrawingNodeProps,\n BoxProps,\n BoxShadowProps,\n ChildrenProps,\n} from \"../types\";\nimport type {\n BlendImageFilterProps,\n BlendProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../types/ImageFilters\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"../types/PathEffects\";\n\nimport {\n FillNode,\n ImageNode,\n CircleNode,\n PathNode,\n LineNode,\n PatchNode,\n PointsNode,\n RectNode,\n RRectNode,\n VerticesNode,\n TextNode,\n OvalNode,\n CustomDrawingNode,\n TextPathNode,\n TextBlobNode,\n GlyphsNode,\n DiffRectNode,\n PictureNode,\n ImageSVGNode,\n BackdropFilterNode,\n BoxNode,\n BoxShadowNode,\n} from \"./drawings\";\nimport {\n BlendImageFilterNode,\n BlurImageFilterNode,\n BlurMaskFilterNode,\n DisplacementMapImageFilterNode,\n DropShadowImageFilterNode,\n OffsetImageFilterNode,\n RuntimeShaderImageFilterNode,\n CornerPathEffectNode,\n DiscretePathEffectNode,\n DashPathEffectNode,\n Path1DPathEffectNode,\n Path2DPathEffectNode,\n SumPathEffectNode,\n Line2DPathEffectNode,\n BlendNode,\n} from \"./paint\";\nimport {\n MatrixColorFilterNode,\n LumaColorFilterNode,\n LinearToSRGBGammaColorFilterNode,\n SRGBToLinearGammaColorFilterNode,\n BlendColorFilterNode,\n LerpColorFilterNode,\n} from \"./paint/ColorFilters\";\nimport {\n LinearGradientNode,\n ShaderNode,\n ImageShaderNode,\n TwoPointConicalGradientNode,\n TurbulenceNode,\n SweepGradientNode,\n RadialGradientNode,\n FractalNoiseNode,\n ColorNode,\n} from \"./paint/Shaders\";\nimport { MorphologyImageFilterNode } from \"./paint/ImageFilters\";\nimport { GroupNode } from \"./GroupNode\";\nimport { PaintNode } from \"./PaintNode\";\nimport type { NodeContext } from \"./Node\";\n\nexport class JsiSkDOM implements SkDOM {\n constructor(private ctx: NodeContext) {}\n\n Group(props?: GroupProps) {\n return new GroupNode(this.ctx, props ?? {});\n }\n\n Paint(props: PaintProps) {\n return new PaintNode(this.ctx, props);\n }\n\n // Drawings\n Fill(props?: DrawingNodeProps) {\n return new FillNode(this.ctx, props);\n }\n\n Image(props: ImageProps) {\n return new ImageNode(this.ctx, props);\n }\n\n Circle(props: CircleProps) {\n return new CircleNode(this.ctx, props);\n }\n\n Path(props: PathProps) {\n return new PathNode(this.ctx, props);\n }\n\n CustomDrawing(props: CustomDrawingNodeProps) {\n return new CustomDrawingNode(this.ctx, props);\n }\n\n Line(props: LineProps) {\n return new LineNode(this.ctx, props);\n }\n\n Oval(props: OvalProps) {\n return new OvalNode(this.ctx, props);\n }\n\n Patch(props: PatchProps) {\n return new PatchNode(this.ctx, props);\n }\n\n Points(props: PointsProps) {\n return new PointsNode(this.ctx, props);\n }\n\n Rect(props: RectProps) {\n return new RectNode(this.ctx, props);\n }\n\n RRect(props: RoundedRectProps) {\n return new RRectNode(this.ctx, props);\n }\n\n Vertices(props: VerticesProps) {\n return new VerticesNode(this.ctx, props);\n }\n\n Text(props: TextProps) {\n return new TextNode(this.ctx, props);\n }\n\n TextPath(props: TextPathProps) {\n return new TextPathNode(this.ctx, props);\n }\n\n TextBlob(props: TextBlobProps) {\n return new TextBlobNode(this.ctx, props);\n }\n\n Glyphs(props: GlyphsProps) {\n return new GlyphsNode(this.ctx, props);\n }\n\n DiffRect(props: DiffRectProps) {\n return new DiffRectNode(this.ctx, props);\n }\n\n Picture(props: PictureProps) {\n return new PictureNode(this.ctx, props);\n }\n\n ImageSVG(props: ImageSVGProps) {\n return new ImageSVGNode(this.ctx, props);\n }\n\n // BlurMaskFilters\n BlurMaskFilter(props: BlurMaskFilterProps) {\n return new BlurMaskFilterNode(this.ctx, props);\n }\n\n // ImageFilters\n BlendImageFilter(props: BlendImageFilterProps) {\n return new BlendImageFilterNode(this.ctx, props);\n }\n\n DropShadowImageFilter(props: DropShadowImageFilterProps) {\n return new DropShadowImageFilterNode(this.ctx, props);\n }\n\n DisplacementMapImageFilter(props: DisplacementMapImageFilterProps) {\n return new DisplacementMapImageFilterNode(this.ctx, props);\n }\n\n BlurImageFilter(props: BlurImageFilterProps) {\n return new BlurImageFilterNode(this.ctx, props);\n }\n\n OffsetImageFilter(props: OffsetImageFilterProps) {\n return new OffsetImageFilterNode(this.ctx, props);\n }\n\n MorphologyImageFilter(props: MorphologyImageFilterProps) {\n return new MorphologyImageFilterNode(this.ctx, props);\n }\n\n RuntimeShaderImageFilter(props: RuntimeShaderImageFilterProps) {\n return new RuntimeShaderImageFilterNode(this.ctx, props);\n }\n\n // Color Filters\n MatrixColorFilter(props: MatrixColorFilterProps) {\n return new MatrixColorFilterNode(this.ctx, props);\n }\n\n BlendColorFilter(props: BlendColorFilterProps) {\n return new BlendColorFilterNode(this.ctx, props);\n }\n\n LumaColorFilter() {\n return new LumaColorFilterNode(this.ctx);\n }\n\n LinearToSRGBGammaColorFilter() {\n return new LinearToSRGBGammaColorFilterNode(this.ctx);\n }\n\n SRGBToLinearGammaColorFilter() {\n return new SRGBToLinearGammaColorFilterNode(this.ctx);\n }\n\n LerpColorFilter(props: LerpColorFilterProps) {\n return new LerpColorFilterNode(this.ctx, props);\n }\n\n // Shaders\n Shader(props: ShaderProps) {\n return new ShaderNode(this.ctx, props);\n }\n\n ImageShader(props: ImageShaderProps) {\n return new ImageShaderNode(this.ctx, props);\n }\n\n ColorShader(props: ColorProps) {\n return new ColorNode(this.ctx, props);\n }\n\n SweepGradient(props: SweepGradientProps) {\n return new SweepGradientNode(this.ctx, props);\n }\n\n Turbulence(props: TurbulenceProps) {\n return new TurbulenceNode(this.ctx, props);\n }\n\n FractalNoise(props: FractalNoiseProps) {\n return new FractalNoiseNode(this.ctx, props);\n }\n\n LinearGradient(props: LinearGradientProps) {\n return new LinearGradientNode(this.ctx, props);\n }\n\n RadialGradient(props: RadialGradientProps) {\n return new RadialGradientNode(this.ctx, props);\n }\n\n TwoPointConicalGradient(props: TwoPointConicalGradientProps) {\n return new TwoPointConicalGradientNode(this.ctx, props);\n }\n\n // Path Effects\n CornerPathEffect(props: CornerPathEffectProps) {\n return new CornerPathEffectNode(this.ctx, props);\n }\n\n DiscretePathEffect(props: DiscretePathEffectProps) {\n return new DiscretePathEffectNode(this.ctx, props);\n }\n\n DashPathEffect(props: DashPathEffectProps) {\n return new DashPathEffectNode(this.ctx, props);\n }\n\n Path1DPathEffect(props: Path1DPathEffectProps) {\n return new Path1DPathEffectNode(this.ctx, props);\n }\n\n Path2DPathEffect(props: Path2DPathEffectProps) {\n return new Path2DPathEffectNode(this.ctx, props);\n }\n\n SumPathEffect() {\n return new SumPathEffectNode(this.ctx);\n }\n\n Line2DPathEffect(props: Line2DPathEffectProps) {\n return new Line2DPathEffectNode(this.ctx, props);\n }\n\n Blend(props: BlendProps) {\n return new BlendNode(this.ctx, props);\n }\n\n BackdropFilter(props: ChildrenProps) {\n return new BackdropFilterNode(this.ctx, props);\n }\n\n Box(props: BoxProps) {\n return new BoxNode(this.ctx, props);\n }\n\n BoxShadow(props: BoxShadowProps) {\n return new BoxShadowNode(this.ctx, props);\n }\n}\n"],"mappings":"AA2DA,SACEA,QADF,EAEEC,SAFF,EAGEC,UAHF,EAIEC,QAJF,EAKEC,QALF,EAMEC,SANF,EAOEC,UAPF,EAQEC,QARF,EASEC,SATF,EAUEC,YAVF,EAWEC,QAXF,EAYEC,QAZF,EAaEC,iBAbF,EAcEC,YAdF,EAeEC,YAfF,EAgBEC,UAhBF,EAiBEC,YAjBF,EAkBEC,WAlBF,EAmBEC,YAnBF,EAoBEC,kBApBF,EAqBEC,OArBF,EAsBEC,aAtBF,QAuBO,YAvBP;AAwBA,SACEC,oBADF,EAEEC,mBAFF,EAGEC,kBAHF,EAIEC,8BAJF,EAKEC,yBALF,EAMEC,qBANF,EAOEC,4BAPF,EAQEC,oBARF,EASEC,sBATF,EAUEC,kBAVF,EAWEC,oBAXF,EAYEC,oBAZF,EAaEC,iBAbF,EAcEC,oBAdF,EAeEC,SAfF,QAgBO,SAhBP;AAiBA,SACEC,qBADF,EAEEC,mBAFF,EAGEC,gCAHF,EAIEC,gCAJF,EAKEC,oBALF,EAMEC,mBANF,QAOO,sBAPP;AAQA,SACEC,kBADF,EAEEC,UAFF,EAGEC,eAHF,EAIEC,2BAJF,EAKEC,cALF,EAMEC,iBANF,EAOEC,kBAPF,EAQEC,gBARF,EASEC,SATF,QAUO,iBAVP;AAWA,SAASC,yBAAT,QAA0C,sBAA1C;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAGA,OAAO,MAAMC,QAAN,CAAgC;EACrCC,WAAW,CAASC,GAAT,EAA2B;IAAA,KAAlBA,GAAkB,GAAlBA,GAAkB;EAAE;;EAExCC,KAAK,CAACC,KAAD,EAA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EAA4BE,KAA5B,CAAP;EACD;;AAnOoC"}
|
1
|
+
{"version":3,"names":["FillNode","ImageNode","CircleNode","PathNode","LineNode","PatchNode","PointsNode","RectNode","RRectNode","VerticesNode","TextNode","OvalNode","CustomDrawingNode","TextPathNode","TextBlobNode","GlyphsNode","DiffRectNode","PictureNode","ImageSVGNode","BackdropFilterNode","BoxNode","BoxShadowNode","BlendImageFilterNode","BlurImageFilterNode","BlurMaskFilterNode","DisplacementMapImageFilterNode","DropShadowImageFilterNode","OffsetImageFilterNode","RuntimeShaderImageFilterNode","CornerPathEffectNode","DiscretePathEffectNode","DashPathEffectNode","Path1DPathEffectNode","Path2DPathEffectNode","SumPathEffectNode","Line2DPathEffectNode","BlendNode","MatrixColorFilterNode","LumaColorFilterNode","LinearToSRGBGammaColorFilterNode","SRGBToLinearGammaColorFilterNode","BlendColorFilterNode","LerpColorFilterNode","LinearGradientNode","ShaderNode","ImageShaderNode","TwoPointConicalGradientNode","TurbulenceNode","SweepGradientNode","RadialGradientNode","FractalNoiseNode","ColorNode","MorphologyImageFilterNode","GroupNode","PaintNode","LayerNode","JsiSkDOM","constructor","ctx","Layer","props","Group","Paint","Fill","Image","Circle","Path","CustomDrawing","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","BlurImageFilter","OffsetImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","LerpColorFilter","Shader","ImageShader","ColorShader","SweepGradient","Turbulence","FractalNoise","LinearGradient","RadialGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow"],"sources":["JsiSkDOM.ts"],"sourcesContent":["import type {\n PathProps,\n SkDOM,\n GroupProps,\n ImageProps,\n BlurImageFilterProps,\n MatrixColorFilterProps,\n CircleProps,\n BlurMaskFilterProps,\n LinearGradientProps,\n PaintProps,\n ShaderProps,\n ImageShaderProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n PatchProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n VerticesProps,\n TextProps,\n DiffRectProps,\n OffsetImageFilterProps,\n BlendColorFilterProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n FractalNoiseProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n DrawingNodeProps,\n BoxProps,\n BoxShadowProps,\n ChildrenProps,\n} from \"../types\";\nimport type {\n BlendImageFilterProps,\n BlendProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../types/ImageFilters\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"../types/PathEffects\";\n\nimport {\n FillNode,\n ImageNode,\n CircleNode,\n PathNode,\n LineNode,\n PatchNode,\n PointsNode,\n RectNode,\n RRectNode,\n VerticesNode,\n TextNode,\n OvalNode,\n CustomDrawingNode,\n TextPathNode,\n TextBlobNode,\n GlyphsNode,\n DiffRectNode,\n PictureNode,\n ImageSVGNode,\n BackdropFilterNode,\n BoxNode,\n BoxShadowNode,\n} from \"./drawings\";\nimport {\n BlendImageFilterNode,\n BlurImageFilterNode,\n BlurMaskFilterNode,\n DisplacementMapImageFilterNode,\n DropShadowImageFilterNode,\n OffsetImageFilterNode,\n RuntimeShaderImageFilterNode,\n CornerPathEffectNode,\n DiscretePathEffectNode,\n DashPathEffectNode,\n Path1DPathEffectNode,\n Path2DPathEffectNode,\n SumPathEffectNode,\n Line2DPathEffectNode,\n BlendNode,\n} from \"./paint\";\nimport {\n MatrixColorFilterNode,\n LumaColorFilterNode,\n LinearToSRGBGammaColorFilterNode,\n SRGBToLinearGammaColorFilterNode,\n BlendColorFilterNode,\n LerpColorFilterNode,\n} from \"./paint/ColorFilters\";\nimport {\n LinearGradientNode,\n ShaderNode,\n ImageShaderNode,\n TwoPointConicalGradientNode,\n TurbulenceNode,\n SweepGradientNode,\n RadialGradientNode,\n FractalNoiseNode,\n ColorNode,\n} from \"./paint/Shaders\";\nimport { MorphologyImageFilterNode } from \"./paint/ImageFilters\";\nimport { GroupNode } from \"./GroupNode\";\nimport { PaintNode } from \"./PaintNode\";\nimport type { NodeContext } from \"./Node\";\nimport { LayerNode } from \"./LayerNode\";\n\nexport class JsiSkDOM implements SkDOM {\n constructor(private ctx: NodeContext) {}\n\n Layer(props?: ChildrenProps) {\n return new LayerNode(this.ctx, props ?? {});\n }\n\n Group(props?: GroupProps) {\n return new GroupNode(this.ctx, props ?? {});\n }\n\n Paint(props: PaintProps) {\n return new PaintNode(this.ctx, props);\n }\n\n // Drawings\n Fill(props?: DrawingNodeProps) {\n return new FillNode(this.ctx, props);\n }\n\n Image(props: ImageProps) {\n return new ImageNode(this.ctx, props);\n }\n\n Circle(props: CircleProps) {\n return new CircleNode(this.ctx, props);\n }\n\n Path(props: PathProps) {\n return new PathNode(this.ctx, props);\n }\n\n CustomDrawing(props: CustomDrawingNodeProps) {\n return new CustomDrawingNode(this.ctx, props);\n }\n\n Line(props: LineProps) {\n return new LineNode(this.ctx, props);\n }\n\n Oval(props: OvalProps) {\n return new OvalNode(this.ctx, props);\n }\n\n Patch(props: PatchProps) {\n return new PatchNode(this.ctx, props);\n }\n\n Points(props: PointsProps) {\n return new PointsNode(this.ctx, props);\n }\n\n Rect(props: RectProps) {\n return new RectNode(this.ctx, props);\n }\n\n RRect(props: RoundedRectProps) {\n return new RRectNode(this.ctx, props);\n }\n\n Vertices(props: VerticesProps) {\n return new VerticesNode(this.ctx, props);\n }\n\n Text(props: TextProps) {\n return new TextNode(this.ctx, props);\n }\n\n TextPath(props: TextPathProps) {\n return new TextPathNode(this.ctx, props);\n }\n\n TextBlob(props: TextBlobProps) {\n return new TextBlobNode(this.ctx, props);\n }\n\n Glyphs(props: GlyphsProps) {\n return new GlyphsNode(this.ctx, props);\n }\n\n DiffRect(props: DiffRectProps) {\n return new DiffRectNode(this.ctx, props);\n }\n\n Picture(props: PictureProps) {\n return new PictureNode(this.ctx, props);\n }\n\n ImageSVG(props: ImageSVGProps) {\n return new ImageSVGNode(this.ctx, props);\n }\n\n // BlurMaskFilters\n BlurMaskFilter(props: BlurMaskFilterProps) {\n return new BlurMaskFilterNode(this.ctx, props);\n }\n\n // ImageFilters\n BlendImageFilter(props: BlendImageFilterProps) {\n return new BlendImageFilterNode(this.ctx, props);\n }\n\n DropShadowImageFilter(props: DropShadowImageFilterProps) {\n return new DropShadowImageFilterNode(this.ctx, props);\n }\n\n DisplacementMapImageFilter(props: DisplacementMapImageFilterProps) {\n return new DisplacementMapImageFilterNode(this.ctx, props);\n }\n\n BlurImageFilter(props: BlurImageFilterProps) {\n return new BlurImageFilterNode(this.ctx, props);\n }\n\n OffsetImageFilter(props: OffsetImageFilterProps) {\n return new OffsetImageFilterNode(this.ctx, props);\n }\n\n MorphologyImageFilter(props: MorphologyImageFilterProps) {\n return new MorphologyImageFilterNode(this.ctx, props);\n }\n\n RuntimeShaderImageFilter(props: RuntimeShaderImageFilterProps) {\n return new RuntimeShaderImageFilterNode(this.ctx, props);\n }\n\n // Color Filters\n MatrixColorFilter(props: MatrixColorFilterProps) {\n return new MatrixColorFilterNode(this.ctx, props);\n }\n\n BlendColorFilter(props: BlendColorFilterProps) {\n return new BlendColorFilterNode(this.ctx, props);\n }\n\n LumaColorFilter() {\n return new LumaColorFilterNode(this.ctx);\n }\n\n LinearToSRGBGammaColorFilter() {\n return new LinearToSRGBGammaColorFilterNode(this.ctx);\n }\n\n SRGBToLinearGammaColorFilter() {\n return new SRGBToLinearGammaColorFilterNode(this.ctx);\n }\n\n LerpColorFilter(props: LerpColorFilterProps) {\n return new LerpColorFilterNode(this.ctx, props);\n }\n\n // Shaders\n Shader(props: ShaderProps) {\n return new ShaderNode(this.ctx, props);\n }\n\n ImageShader(props: ImageShaderProps) {\n return new ImageShaderNode(this.ctx, props);\n }\n\n ColorShader(props: ColorProps) {\n return new ColorNode(this.ctx, props);\n }\n\n SweepGradient(props: SweepGradientProps) {\n return new SweepGradientNode(this.ctx, props);\n }\n\n Turbulence(props: TurbulenceProps) {\n return new TurbulenceNode(this.ctx, props);\n }\n\n FractalNoise(props: FractalNoiseProps) {\n return new FractalNoiseNode(this.ctx, props);\n }\n\n LinearGradient(props: LinearGradientProps) {\n return new LinearGradientNode(this.ctx, props);\n }\n\n RadialGradient(props: RadialGradientProps) {\n return new RadialGradientNode(this.ctx, props);\n }\n\n TwoPointConicalGradient(props: TwoPointConicalGradientProps) {\n return new TwoPointConicalGradientNode(this.ctx, props);\n }\n\n // Path Effects\n CornerPathEffect(props: CornerPathEffectProps) {\n return new CornerPathEffectNode(this.ctx, props);\n }\n\n DiscretePathEffect(props: DiscretePathEffectProps) {\n return new DiscretePathEffectNode(this.ctx, props);\n }\n\n DashPathEffect(props: DashPathEffectProps) {\n return new DashPathEffectNode(this.ctx, props);\n }\n\n Path1DPathEffect(props: Path1DPathEffectProps) {\n return new Path1DPathEffectNode(this.ctx, props);\n }\n\n Path2DPathEffect(props: Path2DPathEffectProps) {\n return new Path2DPathEffectNode(this.ctx, props);\n }\n\n SumPathEffect() {\n return new SumPathEffectNode(this.ctx);\n }\n\n Line2DPathEffect(props: Line2DPathEffectProps) {\n return new Line2DPathEffectNode(this.ctx, props);\n }\n\n Blend(props: BlendProps) {\n return new BlendNode(this.ctx, props);\n }\n\n BackdropFilter(props: ChildrenProps) {\n return new BackdropFilterNode(this.ctx, props);\n }\n\n Box(props: BoxProps) {\n return new BoxNode(this.ctx, props);\n }\n\n Box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,GAAvB,EAA4BE,KAA5B,CAAP;EACD;;AAvOoC"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { NodeType } from "../types";
|
2
|
+
import { JsiRenderNode } from "./RenderNode";
|
3
|
+
import { JsiDeclarationNode } from "./Node";
|
4
|
+
|
5
|
+
const isLayer = node => node instanceof JsiDeclarationNode && node.isPaint();
|
6
|
+
|
7
|
+
export class LayerNode extends JsiRenderNode {
|
8
|
+
constructor(ctx, props) {
|
9
|
+
super(ctx, NodeType.Layer, props);
|
10
|
+
}
|
11
|
+
|
12
|
+
renderNode(ctx) {
|
13
|
+
const [layer, ...children] = this.children();
|
14
|
+
|
15
|
+
if (isLayer(layer)) {
|
16
|
+
const paint = layer.materialize();
|
17
|
+
ctx.canvas.saveLayer(paint);
|
18
|
+
}
|
19
|
+
|
20
|
+
children.map(child => {
|
21
|
+
if (child instanceof JsiRenderNode) {
|
22
|
+
child.render(ctx);
|
23
|
+
}
|
24
|
+
});
|
25
|
+
|
26
|
+
if (isLayer(layer)) {
|
27
|
+
ctx.canvas.restore();
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
}
|
32
|
+
//# sourceMappingURL=LayerNode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["NodeType","JsiRenderNode","JsiDeclarationNode","isLayer","node","isPaint","LayerNode","constructor","ctx","props","Layer","renderNode","layer","children","paint","materialize","canvas","saveLayer","map","child","render","restore"],"sources":["LayerNode.ts"],"sourcesContent":["import type { DeclarationNode, DrawingContext, Node } from \"../types\";\nimport { NodeType } from \"../types\";\nimport type { ChildrenProps } from \"../types/Common\";\nimport type { SkPaint } from \"../../skia\";\n\nimport { JsiRenderNode } from \"./RenderNode\";\nimport type { NodeContext } from \"./Node\";\nimport { JsiDeclarationNode } from \"./Node\";\n\nconst isLayer = (\n node: Node<unknown>\n): node is DeclarationNode<unknown, SkPaint> =>\n node instanceof JsiDeclarationNode && node.isPaint();\n\nexport class LayerNode extends JsiRenderNode<ChildrenProps> {\n constructor(ctx: NodeContext, props: ChildrenProps) {\n super(ctx, NodeType.Layer, props);\n }\n\n renderNode(ctx: DrawingContext): void {\n const [layer, ...children] = this.children();\n if (isLayer(layer)) {\n const paint = layer.materialize() as SkPaint;\n ctx.canvas.saveLayer(paint);\n }\n children.map((child) => {\n if (child instanceof JsiRenderNode) {\n child.render(ctx);\n }\n });\n if (isLayer(layer)) {\n ctx.canvas.restore();\n }\n }\n}\n"],"mappings":"AACA,SAASA,QAAT,QAAyB,UAAzB;AAIA,SAASC,aAAT,QAA8B,cAA9B;AAEA,SAASC,kBAAT,QAAmC,QAAnC;;AAEA,MAAMC,OAAO,GACXC,IADc,IAGdA,IAAI,YAAYF,kBAAhB,IAAsCE,IAAI,CAACC,OAAL,EAHxC;;AAKA,OAAO,MAAMC,SAAN,SAAwBL,aAAxB,CAAqD;EAC1DM,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;IAClD,MAAMD,GAAN,EAAWR,QAAQ,CAACU,KAApB,EAA2BD,KAA3B;EACD;;EAEDE,UAAU,CAACH,GAAD,EAA4B;IACpC,MAAM,CAACI,KAAD,EAAQ,GAAGC,QAAX,IAAuB,KAAKA,QAAL,EAA7B;;IACA,IAAIV,OAAO,CAACS,KAAD,CAAX,EAAoB;MAClB,MAAME,KAAK,GAAGF,KAAK,CAACG,WAAN,EAAd;MACAP,GAAG,CAACQ,MAAJ,CAAWC,SAAX,CAAqBH,KAArB;IACD;;IACDD,QAAQ,CAACK,GAAT,CAAcC,KAAD,IAAW;MACtB,IAAIA,KAAK,YAAYlB,aAArB,EAAoC;QAClCkB,KAAK,CAACC,MAAN,CAAaZ,GAAb;MACD;IACF,CAJD;;IAKA,IAAIL,OAAO,CAACS,KAAD,CAAX,EAAoB;MAClBJ,GAAG,CAACQ,MAAJ,CAAWK,OAAX;IACD;EACF;;AAnByD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NodeType","DeclarationType"],"sources":["NodeType.ts"],"sourcesContent":["export const enum NodeType {\n // Shaders\n Shader = \"skShader\",\n ImageShader = \"skImageShader\",\n ColorShader = \"skColorShader\",\n Turbulence = \"skTurbulence\",\n FractalNoise = \"skFractalNoise\",\n LinearGradient = \"skLinearGradient\",\n RadialGradient = \"skRadialGradient\",\n SweepGradient = \"skSweepGradient\",\n TwoPointConicalGradient = \"skTwoPointConicalGradient\",\n\n // Mask Filters\n BlurMaskFilter = \"skBlurMaskFilter\",\n\n // Path Effects\n DiscretePathEffect = \"skDiscretePathEffect\",\n DashPathEffect = \"skDashPathEffect\",\n Path1DPathEffect = \"skPath1DPathEffect\",\n Path2DPathEffect = \"skPath2DPathEffect\",\n CornerPathEffect = \"skCornerPathEffect\",\n SumPathEffect = \"skSumPathEffect\",\n Line2DPathEffect = \"skLine2DPathEffect\",\n\n // Color Filters\n MatrixColorFilter = \"skMatrixColorFilter\",\n BlendColorFilter = \"skBlendColorFilter\",\n LinearToSRGBGammaColorFilter = \"skLinearToSRGBGammaColorFilter\",\n SRGBToLinearGammaColorFilter = \"skSRGBToLinearGammaColorFilter\",\n LumaColorFilter = \"skLumaColorFilter\",\n LerpColorFilter = \"skLerpColorFilter\",\n\n // Image Filters\n OffsetImageFilter = \"skOffsetImageFilter\",\n DisplacementMapImageFilter = \"skDisplacementMapImageFilter\",\n BlurImageFilter = \"skBlurImageFilter\",\n DropShadowImageFilter = \"skDropShadowImageFilter\",\n MorphologyImageFilter = \"skMorphologyImageFilter\",\n BlendImageFilter = \"skBlendImageFilter\",\n RuntimeShaderImageFilter = \"skRuntimeShaderImageFilter\",\n\n // Mixed\n Blend = \"skBlend\",\n BackdropFilter = \"skBackdropFilter\",\n Box = \"skBox\",\n BoxShadow = \"skBoxShadow\",\n\n // Drawings\n Group = \"skGroup\",\n Drawing = \"skDrawing\",\n Paint = \"skPaint\",\n Circle = \"skCircle\",\n Fill = \"skFill\",\n Image = \"skImage\",\n Points = \"skPoints\",\n Path = \"skPath\",\n Rect = \"skRect\",\n RRect = \"skRRect\",\n Oval = \"skOval\",\n Line = \"skLine\",\n Patch = \"skPatch\",\n Vertices = \"skVertices\",\n DiffRect = \"skDiffRect\",\n Text = \"skText\",\n TextPath = \"skTextPath\",\n TextBlob = \"skTextBlob\",\n Glyphs = \"skGlyphs\",\n Picture = \"skPicture\",\n ImageSVG = \"skImageSVG\",\n}\n\nexport const enum DeclarationType {\n Paint,\n Shader,\n ImageFilter,\n ColorFilter,\n PathEffect,\n MaskFilter,\n Unknown,\n}\n"],"mappings":"AAAA,WAAkBA,QAAlB;;WAAkBA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;GAAAA,Q,KAAAA,Q;;
|
1
|
+
{"version":3,"names":["NodeType","DeclarationType"],"sources":["NodeType.ts"],"sourcesContent":["export const enum NodeType {\n // Shaders\n Layer = \"skLayer\",\n Shader = \"skShader\",\n ImageShader = \"skImageShader\",\n ColorShader = \"skColorShader\",\n Turbulence = \"skTurbulence\",\n FractalNoise = \"skFractalNoise\",\n LinearGradient = \"skLinearGradient\",\n RadialGradient = \"skRadialGradient\",\n SweepGradient = \"skSweepGradient\",\n TwoPointConicalGradient = \"skTwoPointConicalGradient\",\n\n // Mask Filters\n BlurMaskFilter = \"skBlurMaskFilter\",\n\n // Path Effects\n DiscretePathEffect = \"skDiscretePathEffect\",\n DashPathEffect = \"skDashPathEffect\",\n Path1DPathEffect = \"skPath1DPathEffect\",\n Path2DPathEffect = \"skPath2DPathEffect\",\n CornerPathEffect = \"skCornerPathEffect\",\n SumPathEffect = \"skSumPathEffect\",\n Line2DPathEffect = \"skLine2DPathEffect\",\n\n // Color Filters\n MatrixColorFilter = \"skMatrixColorFilter\",\n BlendColorFilter = \"skBlendColorFilter\",\n LinearToSRGBGammaColorFilter = \"skLinearToSRGBGammaColorFilter\",\n SRGBToLinearGammaColorFilter = \"skSRGBToLinearGammaColorFilter\",\n LumaColorFilter = \"skLumaColorFilter\",\n LerpColorFilter = \"skLerpColorFilter\",\n\n // Image Filters\n OffsetImageFilter = \"skOffsetImageFilter\",\n DisplacementMapImageFilter = \"skDisplacementMapImageFilter\",\n BlurImageFilter = \"skBlurImageFilter\",\n DropShadowImageFilter = \"skDropShadowImageFilter\",\n MorphologyImageFilter = \"skMorphologyImageFilter\",\n BlendImageFilter = \"skBlendImageFilter\",\n RuntimeShaderImageFilter = \"skRuntimeShaderImageFilter\",\n\n // Mixed\n Blend = \"skBlend\",\n BackdropFilter = \"skBackdropFilter\",\n Box = \"skBox\",\n BoxShadow = \"skBoxShadow\",\n\n // Drawings\n Group = \"skGroup\",\n Drawing = \"skDrawing\",\n Paint = \"skPaint\",\n Circle = \"skCircle\",\n Fill = \"skFill\",\n Image = \"skImage\",\n Points = \"skPoints\",\n Path = \"skPath\",\n Rect = \"skRect\",\n RRect = \"skRRect\",\n Oval = \"skOval\",\n Line = \"skLine\",\n Patch = \"skPatch\",\n Vertices = \"skVertices\",\n DiffRect = \"skDiffRect\",\n Text = \"skText\",\n TextPath = \"skTextPath\",\n TextBlob = \"skTextBlob\",\n Glyphs = \"skGlyphs\",\n Picture = \"skPicture\",\n ImageSVG = \"skImageSVG\",\n}\n\nexport const enum DeclarationType {\n Paint,\n Shader,\n ImageFilter,\n ColorFilter,\n PathEffect,\n MaskFilter,\n Unknown,\n}\n"],"mappings":"AAAA,WAAkBA,QAAlB;;WAAkBA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;GAAAA,Q,KAAAA,Q;;AAwElB,WAAkBC,eAAlB;;WAAkBA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;GAAAA,e,KAAAA,e"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["SkDOM.ts"],"sourcesContent":["import type {\n SkImageFilter,\n SkMaskFilter,\n SkShader,\n SkColorFilter,\n SkPathEffect,\n SkPaint,\n} from \"../../skia/types\";\n\nimport type { ChildrenProps, GroupProps, PaintProps } from \"./Common\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n DisplacementMapImageFilterProps,\n MorphologyImageFilterProps,\n BlendProps,\n} from \"./ImageFilters\";\nimport type { DeclarationNode, RenderNode } from \"./Node\";\nimport type {\n BlendColorFilterProps,\n MatrixColorFilterProps,\n LerpColorFilterProps,\n} from \"./ColorFilters\";\nimport type {\n ImageProps,\n CircleProps,\n PathProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n PatchProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n VerticesProps,\n TextProps,\n DiffRectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n DrawingNodeProps,\n BoxProps,\n BoxShadowProps,\n} from \"./Drawings\";\nimport type { BlurMaskFilterProps } from \"./MaskFilters\";\nimport type {\n FractalNoiseProps,\n SweepGradientProps,\n ImageShaderProps,\n LinearGradientProps,\n ShaderProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n RadialGradientProps,\n ColorProps,\n} from \"./Shaders\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"./PathEffects\";\n\ntype ImageFilterNode<P> = DeclarationNode<P, SkImageFilter>;\n\ntype PathEffectNode<P> = DeclarationNode<P, SkPathEffect>;\ntype NullablePathEffectNode<P> = DeclarationNode<P, SkPathEffect, null>;\n\ntype DrawingNode<P extends GroupProps> = RenderNode<P>;\n\nexport interface SkDOM {\n Group(props?: GroupProps): RenderNode<GroupProps>;\n Paint(props: PaintProps): DeclarationNode<PaintProps, SkPaint>;\n\n // Drawings\n Fill(props?: DrawingNodeProps): DrawingNode<DrawingNodeProps>;\n Image(props: ImageProps): DrawingNode<ImageProps>;\n Circle(props: CircleProps): DrawingNode<CircleProps>;\n Path(props: PathProps): DrawingNode<PathProps>;\n CustomDrawing(\n props: CustomDrawingNodeProps\n ): DrawingNode<CustomDrawingNodeProps>;\n Line(props: LineProps): DrawingNode<LineProps>;\n Oval(props: OvalProps): DrawingNode<OvalProps>;\n Patch(props: PatchProps): DrawingNode<PatchProps>;\n Points(props: PointsProps): DrawingNode<PointsProps>;\n Rect(props: RectProps): DrawingNode<RectProps>;\n RRect(props: RoundedRectProps): DrawingNode<RoundedRectProps>;\n Vertices(props: VerticesProps): DrawingNode<VerticesProps>;\n Text(props: TextProps): DrawingNode<TextProps>;\n TextPath(props: TextPathProps): DrawingNode<TextPathProps>;\n TextBlob(props: TextBlobProps): DrawingNode<TextBlobProps>;\n Glyphs(props: GlyphsProps): DrawingNode<GlyphsProps>;\n DiffRect(props: DiffRectProps): DrawingNode<DiffRectProps>;\n Picture(props: PictureProps): DrawingNode<PictureProps>;\n ImageSVG(props: ImageSVGProps): DrawingNode<ImageSVGProps>;\n\n // BlurMaskFilters\n BlurMaskFilter(\n props: BlurMaskFilterProps\n ): DeclarationNode<BlurMaskFilterProps, SkMaskFilter>;\n\n // ImageFilters\n BlendImageFilter(\n props: BlendImageFilterProps\n ): ImageFilterNode<BlendImageFilterProps>;\n BlurImageFilter(\n props: BlurImageFilterProps\n ): ImageFilterNode<BlurImageFilterProps>;\n OffsetImageFilter(\n props: OffsetImageFilterProps\n ): ImageFilterNode<OffsetImageFilterProps>;\n DropShadowImageFilter(\n props: DropShadowImageFilterProps\n ): ImageFilterNode<DropShadowImageFilterProps>;\n MorphologyImageFilter(\n props: MorphologyImageFilterProps\n ): ImageFilterNode<MorphologyImageFilterProps>;\n DisplacementMapImageFilter(\n props: DisplacementMapImageFilterProps\n ): ImageFilterNode<DisplacementMapImageFilterProps>;\n RuntimeShaderImageFilter(\n props: RuntimeShaderImageFilterProps\n ): ImageFilterNode<RuntimeShaderImageFilterProps>;\n\n // ColorFilters\n MatrixColorFilter(\n props: MatrixColorFilterProps\n ): DeclarationNode<MatrixColorFilterProps, SkColorFilter>;\n BlendColorFilter(\n props: BlendColorFilterProps\n ): DeclarationNode<BlendColorFilterProps, SkColorFilter>;\n LumaColorFilter(): DeclarationNode<null, SkColorFilter>;\n LinearToSRGBGammaColorFilter(): DeclarationNode<null, SkColorFilter>;\n SRGBToLinearGammaColorFilter(): DeclarationNode<null, SkColorFilter>;\n LerpColorFilter(\n props: LerpColorFilterProps\n ): DeclarationNode<LerpColorFilterProps, SkColorFilter>;\n\n // Shaders\n Shader(props: ShaderProps): DeclarationNode<ShaderProps, SkShader>;\n ImageShader(\n props: ImageShaderProps\n ): DeclarationNode<ImageShaderProps, SkShader>;\n ColorShader(props: ColorProps): DeclarationNode<ColorProps, SkShader>;\n Turbulence(\n props: TurbulenceProps\n ): DeclarationNode<TurbulenceProps, SkShader>;\n FractalNoise(\n props: FractalNoiseProps\n ): DeclarationNode<FractalNoiseProps, SkShader>;\n LinearGradient(\n props: LinearGradientProps\n ): DeclarationNode<LinearGradientProps, SkShader>;\n RadialGradient(\n props: RadialGradientProps\n ): DeclarationNode<RadialGradientProps, SkShader>;\n SweepGradient(\n props: SweepGradientProps\n ): DeclarationNode<SweepGradientProps, SkShader>;\n TwoPointConicalGradient(\n props: TwoPointConicalGradientProps\n ): DeclarationNode<TwoPointConicalGradientProps, SkShader>;\n\n // Path Effects\n CornerPathEffect(\n props: CornerPathEffectProps\n ): NullablePathEffectNode<CornerPathEffectProps>;\n DiscretePathEffect(\n props: DiscretePathEffectProps\n ): PathEffectNode<DiscretePathEffectProps>;\n DashPathEffect(\n props: DashPathEffectProps\n ): PathEffectNode<DashPathEffectProps>;\n Path1DPathEffect(\n props: Path1DPathEffectProps\n ): NullablePathEffectNode<Path1DPathEffectProps>;\n Path2DPathEffect(\n props: Path2DPathEffectProps\n ): NullablePathEffectNode<Path2DPathEffectProps>;\n SumPathEffect(): NullablePathEffectNode<null>;\n Line2DPathEffect(\n props: Line2DPathEffectProps\n ): NullablePathEffectNode<Line2DPathEffectProps>;\n\n // Mixed\n Blend(\n props: BlendProps\n ): DeclarationNode<BlendProps, SkShader | SkImageFilter>;\n BackdropFilter(props: ChildrenProps): RenderNode<ChildrenProps>;\n Box(props: BoxProps): RenderNode<BoxProps>;\n BoxShadow(\n props: BoxShadowProps\n ): DeclarationNode<BoxShadowProps, BoxShadowProps>;\n}\n"],"mappings":""}
|
1
|
+
{"version":3,"names":[],"sources":["SkDOM.ts"],"sourcesContent":["import type {\n SkImageFilter,\n SkMaskFilter,\n SkShader,\n SkColorFilter,\n SkPathEffect,\n SkPaint,\n} from \"../../skia/types\";\n\nimport type { ChildrenProps, GroupProps, PaintProps } from \"./Common\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n DisplacementMapImageFilterProps,\n MorphologyImageFilterProps,\n BlendProps,\n} from \"./ImageFilters\";\nimport type { DeclarationNode, RenderNode } from \"./Node\";\nimport type {\n BlendColorFilterProps,\n MatrixColorFilterProps,\n LerpColorFilterProps,\n} from \"./ColorFilters\";\nimport type {\n ImageProps,\n CircleProps,\n PathProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n PatchProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n VerticesProps,\n TextProps,\n DiffRectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n DrawingNodeProps,\n BoxProps,\n BoxShadowProps,\n} from \"./Drawings\";\nimport type { BlurMaskFilterProps } from \"./MaskFilters\";\nimport type {\n FractalNoiseProps,\n SweepGradientProps,\n ImageShaderProps,\n LinearGradientProps,\n ShaderProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n RadialGradientProps,\n ColorProps,\n} from \"./Shaders\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"./PathEffects\";\n\ntype ImageFilterNode<P> = DeclarationNode<P, SkImageFilter>;\n\ntype PathEffectNode<P> = DeclarationNode<P, SkPathEffect>;\ntype NullablePathEffectNode<P> = DeclarationNode<P, SkPathEffect, null>;\n\ntype DrawingNode<P extends GroupProps> = RenderNode<P>;\n\nexport interface SkDOM {\n Layer(props?: ChildrenProps): RenderNode<ChildrenProps>;\n Group(props?: GroupProps): RenderNode<GroupProps>;\n Paint(props: PaintProps): DeclarationNode<PaintProps, SkPaint>;\n\n // Drawings\n Fill(props?: DrawingNodeProps): DrawingNode<DrawingNodeProps>;\n Image(props: ImageProps): DrawingNode<ImageProps>;\n Circle(props: CircleProps): DrawingNode<CircleProps>;\n Path(props: PathProps): DrawingNode<PathProps>;\n CustomDrawing(\n props: CustomDrawingNodeProps\n ): DrawingNode<CustomDrawingNodeProps>;\n Line(props: LineProps): DrawingNode<LineProps>;\n Oval(props: OvalProps): DrawingNode<OvalProps>;\n Patch(props: PatchProps): DrawingNode<PatchProps>;\n Points(props: PointsProps): DrawingNode<PointsProps>;\n Rect(props: RectProps): DrawingNode<RectProps>;\n RRect(props: RoundedRectProps): DrawingNode<RoundedRectProps>;\n Vertices(props: VerticesProps): DrawingNode<VerticesProps>;\n Text(props: TextProps): DrawingNode<TextProps>;\n TextPath(props: TextPathProps): DrawingNode<TextPathProps>;\n TextBlob(props: TextBlobProps): DrawingNode<TextBlobProps>;\n Glyphs(props: GlyphsProps): DrawingNode<GlyphsProps>;\n DiffRect(props: DiffRectProps): DrawingNode<DiffRectProps>;\n Picture(props: PictureProps): DrawingNode<PictureProps>;\n ImageSVG(props: ImageSVGProps): DrawingNode<ImageSVGProps>;\n\n // BlurMaskFilters\n BlurMaskFilter(\n props: BlurMaskFilterProps\n ): DeclarationNode<BlurMaskFilterProps, SkMaskFilter>;\n\n // ImageFilters\n BlendImageFilter(\n props: BlendImageFilterProps\n ): ImageFilterNode<BlendImageFilterProps>;\n BlurImageFilter(\n props: BlurImageFilterProps\n ): ImageFilterNode<BlurImageFilterProps>;\n OffsetImageFilter(\n props: OffsetImageFilterProps\n ): ImageFilterNode<OffsetImageFilterProps>;\n DropShadowImageFilter(\n props: DropShadowImageFilterProps\n ): ImageFilterNode<DropShadowImageFilterProps>;\n MorphologyImageFilter(\n props: MorphologyImageFilterProps\n ): ImageFilterNode<MorphologyImageFilterProps>;\n DisplacementMapImageFilter(\n props: DisplacementMapImageFilterProps\n ): ImageFilterNode<DisplacementMapImageFilterProps>;\n RuntimeShaderImageFilter(\n props: RuntimeShaderImageFilterProps\n ): ImageFilterNode<RuntimeShaderImageFilterProps>;\n\n // ColorFilters\n MatrixColorFilter(\n props: MatrixColorFilterProps\n ): DeclarationNode<MatrixColorFilterProps, SkColorFilter>;\n BlendColorFilter(\n props: BlendColorFilterProps\n ): DeclarationNode<BlendColorFilterProps, SkColorFilter>;\n LumaColorFilter(): DeclarationNode<null, SkColorFilter>;\n LinearToSRGBGammaColorFilter(): DeclarationNode<null, SkColorFilter>;\n SRGBToLinearGammaColorFilter(): DeclarationNode<null, SkColorFilter>;\n LerpColorFilter(\n props: LerpColorFilterProps\n ): DeclarationNode<LerpColorFilterProps, SkColorFilter>;\n\n // Shaders\n Shader(props: ShaderProps): DeclarationNode<ShaderProps, SkShader>;\n ImageShader(\n props: ImageShaderProps\n ): DeclarationNode<ImageShaderProps, SkShader>;\n ColorShader(props: ColorProps): DeclarationNode<ColorProps, SkShader>;\n Turbulence(\n props: TurbulenceProps\n ): DeclarationNode<TurbulenceProps, SkShader>;\n FractalNoise(\n props: FractalNoiseProps\n ): DeclarationNode<FractalNoiseProps, SkShader>;\n LinearGradient(\n props: LinearGradientProps\n ): DeclarationNode<LinearGradientProps, SkShader>;\n RadialGradient(\n props: RadialGradientProps\n ): DeclarationNode<RadialGradientProps, SkShader>;\n SweepGradient(\n props: SweepGradientProps\n ): DeclarationNode<SweepGradientProps, SkShader>;\n TwoPointConicalGradient(\n props: TwoPointConicalGradientProps\n ): DeclarationNode<TwoPointConicalGradientProps, SkShader>;\n\n // Path Effects\n CornerPathEffect(\n props: CornerPathEffectProps\n ): NullablePathEffectNode<CornerPathEffectProps>;\n DiscretePathEffect(\n props: DiscretePathEffectProps\n ): PathEffectNode<DiscretePathEffectProps>;\n DashPathEffect(\n props: DashPathEffectProps\n ): PathEffectNode<DashPathEffectProps>;\n Path1DPathEffect(\n props: Path1DPathEffectProps\n ): NullablePathEffectNode<Path1DPathEffectProps>;\n Path2DPathEffect(\n props: Path2DPathEffectProps\n ): NullablePathEffectNode<Path2DPathEffectProps>;\n SumPathEffect(): NullablePathEffectNode<null>;\n Line2DPathEffect(\n props: Line2DPathEffectProps\n ): NullablePathEffectNode<Line2DPathEffectProps>;\n\n // Mixed\n Blend(\n props: BlendProps\n ): DeclarationNode<BlendProps, SkShader | SkImageFilter>;\n BackdropFilter(props: ChildrenProps): RenderNode<ChildrenProps>;\n Box(props: BoxProps): RenderNode<BoxProps>;\n BoxShadow(\n props: BoxShadowProps\n ): DeclarationNode<BoxShadowProps, BoxShadowProps>;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NodeType","exhaustiveCheck","createNode","container","type","props","Sk","Group","Paint","Fill","Image","Circle","Path","Drawing","CustomDrawing","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LerpColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow"],"sources":["HostComponents.ts"],"sourcesContent":["import type { ForwardedRef } from \"react\";\n\nimport { NodeType } from \"../dom/types\";\nimport type {\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\nimport type { PaintNode } from \"../dom/nodes/PaintNode\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skPaint: SkiaProps<PaintProps> & { ref: ForwardedRef<PaintNode> };\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skDrawing: SkiaProps<CustomDrawingNodeProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<TurbulenceProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n }\n }\n}\n\nexport const createNode = (\n container: Container,\n type: NodeType,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: any\n) => {\n const { Sk } = container;\n switch (type) {\n case NodeType.Group:\n return Sk.Group(props);\n case NodeType.Paint:\n return Sk.Paint(props);\n // Drawings\n case NodeType.Fill:\n return Sk.Fill(props);\n case NodeType.Image:\n return Sk.Image(props);\n case NodeType.Circle:\n return Sk.Circle(props);\n case NodeType.Path:\n return Sk.Path(props);\n case NodeType.Drawing:\n return Sk.CustomDrawing(props);\n case NodeType.Line:\n return Sk.Line(props);\n case NodeType.Oval:\n return Sk.Oval(props);\n case NodeType.Patch:\n return Sk.Patch(props);\n case NodeType.Points:\n return Sk.Points(props);\n case NodeType.Rect:\n return Sk.Rect(props);\n case NodeType.RRect:\n return Sk.RRect(props);\n case NodeType.Vertices:\n return Sk.Vertices(props);\n case NodeType.Text:\n return Sk.Text(props);\n case NodeType.TextPath:\n return Sk.TextPath(props);\n case NodeType.TextBlob:\n return Sk.TextBlob(props);\n case NodeType.Glyphs:\n return Sk.Glyphs(props);\n case NodeType.DiffRect:\n return Sk.DiffRect(props);\n case NodeType.Picture:\n return Sk.Picture(props);\n case NodeType.ImageSVG:\n return Sk.ImageSVG(props);\n // Mask Filter\n case NodeType.BlurMaskFilter:\n return Sk.BlurMaskFilter(props);\n // Image Filter\n case NodeType.BlendImageFilter:\n return Sk.BlendImageFilter(props);\n case NodeType.BlurImageFilter:\n return Sk.BlurImageFilter(props);\n case NodeType.OffsetImageFilter:\n return Sk.OffsetImageFilter(props);\n case NodeType.DropShadowImageFilter:\n return Sk.DropShadowImageFilter(props);\n case NodeType.DisplacementMapImageFilter:\n return Sk.DisplacementMapImageFilter(props);\n case NodeType.MorphologyImageFilter:\n return Sk.MorphologyImageFilter(props);\n case NodeType.RuntimeShaderImageFilter:\n return Sk.RuntimeShaderImageFilter(props);\n // Color Filter\n case NodeType.MatrixColorFilter:\n return Sk.MatrixColorFilter(props);\n case NodeType.BlendColorFilter:\n return Sk.BlendColorFilter(props);\n case NodeType.LerpColorFilter:\n return Sk.LerpColorFilter(props);\n case NodeType.LumaColorFilter:\n return Sk.LumaColorFilter();\n case NodeType.LinearToSRGBGammaColorFilter:\n return Sk.LinearToSRGBGammaColorFilter();\n case NodeType.SRGBToLinearGammaColorFilter:\n return Sk.SRGBToLinearGammaColorFilter();\n // Shader\n case NodeType.Shader:\n return Sk.Shader(props);\n case NodeType.ImageShader:\n return Sk.ImageShader(props);\n case NodeType.ColorShader:\n return Sk.ColorShader(props);\n case NodeType.Turbulence:\n return Sk.Turbulence(props);\n case NodeType.FractalNoise:\n return Sk.FractalNoise(props);\n case NodeType.LinearGradient:\n return Sk.LinearGradient(props);\n case NodeType.RadialGradient:\n return Sk.RadialGradient(props);\n case NodeType.SweepGradient:\n return Sk.SweepGradient(props);\n case NodeType.TwoPointConicalGradient:\n return Sk.TwoPointConicalGradient(props);\n // Path Effect\n case NodeType.CornerPathEffect:\n return Sk.CornerPathEffect(props);\n case NodeType.DiscretePathEffect:\n return Sk.DiscretePathEffect(props);\n case NodeType.DashPathEffect:\n return Sk.DashPathEffect(props);\n case NodeType.Path1DPathEffect:\n return Sk.Path1DPathEffect(props);\n case NodeType.Path2DPathEffect:\n return Sk.Path2DPathEffect(props);\n case NodeType.SumPathEffect:\n return Sk.SumPathEffect();\n case NodeType.Line2DPathEffect:\n return Sk.Line2DPathEffect(props);\n // Mixed\n case NodeType.Blend:\n return Sk.Blend(props);\n case NodeType.BackdropFilter:\n return Sk.BackdropFilter(props);\n case NodeType.Box:\n return Sk.Box(props);\n case NodeType.BoxShadow:\n return Sk.BoxShadow(props);\n default:\n return exhaustiveCheck(type);\n }\n};\n"],"mappings":"AAEA,SAASA,QAAT,QAAyB,cAAzB;AA0DA,SAASC,eAAT,QAAgC,aAAhC;AAgFA,OAAO,MAAMC,UAAU,GAAG,CACxBC,SADwB,EAExBC,IAFwB,EAIxBC,KAJwB,KAKrB;EACH,MAAM;IAAEC;EAAF,IAASH,SAAf;;EACA,QAAQC,IAAR;IACE,KAAKJ,QAAQ,CAACO,KAAd;MACE,OAAOD,EAAE,CAACC,KAAH,CAASF,KAAT,CAAP;;IACF,KAAKL,QAAQ,CAACQ,KAAd;MACE,OAAOF,EAAE,CAACE,KAAH,CAASH,KAAT,CAAP;IACF;;IACA,KAAKL,QAAQ,CAACS,IAAd;MACE,OAAOH,EAAE,CAACG,IAAH,CAAQJ,KAAR,CAAP;;IACF,KAAKL,QAAQ,CAACU,KAAd;MACE,OAAOJ,EAAE,CAACI,KAAH,CAASL,KAAT,CAAP;;IACF,KAAKL,QAAQ,CAACW,MAAd;MACE,OAAOL,EAAE,CAACK,MAAH,CAAUN,KAAV,CAAP;;IACF,KAAKL,QAAQ,CAACY,IAAd;MACE,OAAON,EAAE,CAACM,IAAH,CAAQP,KAAR,CAAP;;IACF,KAAKL,QAAQ,CAACa,OAAd;MACE,OAAOP,EAAE,CAACQ,aAAH,CAAiBT,KAAjB,CAAP;;IACF,KAAKL,QAAQ,CAACe,IAAd;MACE,OAAOT,EAAE,CAACS,IAAH,CAAQV,KAAR,CAAP;;IACF,KAAKL,QAAQ,CAACgB,IAAd;MACE,OAAOV,EAAE,CAACU,IAAH,CAAQX,KAAR,CAAP;;IACF,KAAKL,QAAQ,CAACiB,KAAd;MACE,OAAOX,EAAE,CAACW,KAAH,CAASZ,KAAT,CAAP;;IACF,KAAKL,QA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AP;;IACF,KAAKL,QAAQ,CAAC4D,cAAd;MACE,OAAOtD,EAAE,CAACsD,cAAH,CAAkBvD,KAAlB,CAAP;;IACF,KAAKL,QAAQ,CAAC6D,GAAd;MACE,OAAOvD,EAAE,CAACuD,GAAH,CAAOxD,KAAP,CAAP;;IACF,KAAKL,QAAQ,CAAC8D,SAAd;MACE,OAAOxD,EAAE,CAACwD,SAAH,CAAazD,KAAb,CAAP;;IACF;MACE,OAAOJ,eAAe,CAACG,IAAD,CAAtB;EAvHJ;AAyHD,CAhIM"}
|
1
|
+
{"version":3,"names":["NodeType","exhaustiveCheck","createNode","container","type","props","Sk","Layer","Group","Paint","Fill","Image","Circle","Path","Drawing","CustomDrawing","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LerpColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow"],"sources":["HostComponents.ts"],"sourcesContent":["import type { ForwardedRef } from \"react\";\n\nimport { NodeType } from \"../dom/types\";\nimport type {\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\nimport type { PaintNode } from \"../dom/nodes/PaintNode\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skLayer: SkiaProps<ChildrenProps>;\n skPaint: SkiaProps<PaintProps> & { ref: ForwardedRef<PaintNode> };\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skDrawing: SkiaProps<CustomDrawingNodeProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<TurbulenceProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n }\n }\n}\n\nexport const createNode = (\n container: Container,\n type: NodeType,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: any\n) => {\n const { Sk } = container;\n switch (type) {\n case NodeType.Layer:\n return Sk.Layer(props);\n case NodeType.Group:\n return Sk.Group(props);\n case NodeType.Paint:\n return Sk.Paint(props);\n // Drawings\n case NodeType.Fill:\n return Sk.Fill(props);\n case NodeType.Image:\n return Sk.Image(props);\n case NodeType.Circle:\n return Sk.Circle(props);\n case NodeType.Path:\n return Sk.Path(props);\n case NodeType.Drawing:\n return Sk.CustomDrawing(props);\n case NodeType.Line:\n return Sk.Line(props);\n case NodeType.Oval:\n return Sk.Oval(props);\n case NodeType.Patch:\n return Sk.Patch(props);\n case NodeType.Points:\n return Sk.Points(props);\n case NodeType.Rect:\n return Sk.Rect(props);\n case NodeType.RRect:\n return Sk.RRect(props);\n case NodeType.Vertices:\n return Sk.Vertices(props);\n case NodeType.Text:\n return Sk.Text(props);\n case NodeType.TextPath:\n return Sk.TextPath(props);\n case NodeType.TextBlob:\n return Sk.TextBlob(props);\n case NodeType.Glyphs:\n return Sk.Glyphs(props);\n case NodeType.DiffRect:\n return Sk.DiffRect(props);\n case NodeType.Picture:\n return Sk.Picture(props);\n case NodeType.ImageSVG:\n return Sk.ImageSVG(props);\n // Mask Filter\n case NodeType.BlurMaskFilter:\n return Sk.BlurMaskFilter(props);\n // Image Filter\n case NodeType.BlendImageFilter:\n return Sk.BlendImageFilter(props);\n case NodeType.BlurImageFilter:\n return Sk.BlurImageFilter(props);\n case NodeType.OffsetImageFilter:\n return Sk.OffsetImageFilter(props);\n case NodeType.DropShadowImageFilter:\n return Sk.DropShadowImageFilter(props);\n case NodeType.DisplacementMapImageFilter:\n return Sk.DisplacementMapImageFilter(props);\n case NodeType.MorphologyImageFilter:\n return Sk.MorphologyImageFilter(props);\n case NodeType.RuntimeShaderImageFilter:\n return Sk.RuntimeShaderImageFilter(props);\n // Color Filter\n case NodeType.MatrixColorFilter:\n return Sk.MatrixColorFilter(props);\n case NodeType.BlendColorFilter:\n return Sk.BlendColorFilter(props);\n case NodeType.LerpColorFilter:\n return Sk.LerpColorFilter(props);\n case NodeType.LumaColorFilter:\n return Sk.LumaColorFilter();\n case NodeType.LinearToSRGBGammaColorFilter:\n return Sk.LinearToSRGBGammaColorFilter();\n case NodeType.SRGBToLinearGammaColorFilter:\n return Sk.SRGBToLinearGammaColorFilter();\n // Shader\n case NodeType.Shader:\n return Sk.Shader(props);\n case NodeType.ImageShader:\n return Sk.ImageShader(props);\n case NodeType.ColorShader:\n return Sk.ColorShader(props);\n case NodeType.Turbulence:\n return Sk.Turbulence(props);\n case NodeType.FractalNoise:\n return Sk.FractalNoise(props);\n case NodeType.LinearGradient:\n return Sk.LinearGradient(props);\n case NodeType.RadialGradient:\n return Sk.RadialGradient(props);\n case NodeType.SweepGradient:\n return Sk.SweepGradient(props);\n case NodeType.TwoPointConicalGradient:\n return Sk.TwoPointConicalGradient(props);\n // Path Effect\n case NodeType.CornerPathEffect:\n return Sk.CornerPathEffect(props);\n case NodeType.DiscretePathEffect:\n return Sk.DiscretePathEffect(props);\n case NodeType.DashPathEffect:\n return Sk.DashPathEffect(props);\n case NodeType.Path1DPathEffect:\n return Sk.Path1DPathEffect(props);\n case NodeType.Path2DPathEffect:\n return Sk.Path2DPathEffect(props);\n case NodeType.SumPathEffect:\n return Sk.SumPathEffect();\n case NodeType.Line2DPathEffect:\n return Sk.Line2DPathEffect(props);\n // Mixed\n case NodeType.Blend:\n return Sk.Blend(props);\n case NodeType.BackdropFilter:\n return Sk.BackdropFilter(props);\n case NodeType.Box:\n return Sk.Box(props);\n case NodeType.BoxShadow:\n return Sk.BoxShadow(props);\n default:\n return exhaustiveCheck(type);\n }\n};\n"],"mappings":"AAEA,SAASA,QAA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,CAAC8D,GAAd;MACE,OAAOxD,EAAE,CAACwD,GAAH,CAAOzD,KAAP,CAAP;;IACF,KAAKL,QAAQ,CAAC+D,SAAd;MACE,OAAOzD,EAAE,CAACyD,SAAH,CAAa1D,KAAb,CAAP;;IACF;MACE,OAAOJ,eAAe,CAACG,IAAD,CAAtB;EAzHJ;AA2HD,CAlIM"}
|
@@ -1,5 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
3
|
+
import React, { isValidElement } from "react";
|
4
|
+
export const Group = _ref => {
|
5
|
+
let {
|
6
|
+
layer,
|
7
|
+
...props
|
8
|
+
} = _ref;
|
9
|
+
|
10
|
+
if ( /*#__PURE__*/isValidElement(layer) && typeof layer === "object") {
|
11
|
+
return /*#__PURE__*/React.createElement("skLayer", null, layer, /*#__PURE__*/React.createElement("skGroup", props));
|
12
|
+
}
|
13
|
+
|
14
|
+
return /*#__PURE__*/React.createElement("skGroup", _extends({
|
15
|
+
layer: layer
|
16
|
+
}, props));
|
4
17
|
};
|
5
18
|
//# sourceMappingURL=Group.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Group","props"],"sources":["Group.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../processors\";\nimport type { GroupProps } from \"../../dom/types\";\n\nexport const Group = (props: SkiaProps<
|
1
|
+
{"version":3,"names":["React","isValidElement","Group","layer","props"],"sources":["Group.tsx"],"sourcesContent":["import React, { isValidElement } from \"react\";\n\nimport type { SkiaProps } from \"../processors\";\nimport type { GroupProps } from \"../../dom/types\";\nimport type { ChildrenProps } from \"../../dom/types/Common\";\n\nexport interface PublicGroupProps extends Omit<GroupProps, \"layer\"> {\n layer?: GroupProps[\"layer\"] | ChildrenProps[\"children\"];\n}\n\nexport const Group = ({ layer, ...props }: SkiaProps<PublicGroupProps>) => {\n if (isValidElement(layer) && typeof layer === \"object\") {\n return (\n <skLayer>\n {layer}\n <skGroup {...props} />\n </skLayer>\n );\n }\n return <skGroup layer={layer as GroupProps[\"layer\"]} {...props} />;\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,cAAhB,QAAsC,OAAtC;AAUA,OAAO,MAAMC,KAAK,GAAG,QAAsD;EAAA,IAArD;IAAEC,KAAF;IAAS,GAAGC;EAAZ,CAAqD;;EACzE,IAAI,cAAAH,cAAc,CAACE,KAAD,CAAd,IAAyB,OAAOA,KAAP,KAAiB,QAA9C,EAAwD;IACtD,oBACE,qCACGA,KADH,eAEE,+BAAaC,KAAb,CAFF,CADF;EAMD;;EACD,oBAAO;IAAS,KAAK,EAAED;EAAhB,GAAkDC,KAAlD,EAAP;AACD,CAVM"}
|
@@ -1,7 +1,13 @@
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
2
|
|
3
|
+
/* eslint-disable max-len */
|
3
4
|
import React, { useRef, forwardRef } from "react";
|
4
|
-
export const usePaintRef = () =>
|
5
|
+
export const usePaintRef = () => {
|
6
|
+
console.log(`usePaintRef() is now deprecated.
|
7
|
+
If you are using the layer property, simply pass the component directly: https://shopify.github.io/react-native-skia/docs/group#layer-effects.
|
8
|
+
If you are using the paint property, please the following paint properties directly: https://shopify.github.io/react-native-skia/docs/paint/overview`);
|
9
|
+
return useRef(null);
|
10
|
+
};
|
5
11
|
export const Paint = /*#__PURE__*/forwardRef((props, ref) => {
|
6
12
|
return /*#__PURE__*/React.createElement("skPaint", _extends({
|
7
13
|
ref: ref
|