@shopify/react-native-skia 1.8.0 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkPaint.h +8 -1
- package/lib/commonjs/dom/types/Common.d.ts +6 -4
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/ImageFilters.d.ts +1 -1
- package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/types/Node.d.ts +0 -2
- package/lib/commonjs/dom/types/Node.js.map +1 -1
- package/lib/commonjs/external/reanimated/index.d.ts +0 -1
- package/lib/commonjs/external/reanimated/index.js +0 -11
- package/lib/commonjs/external/reanimated/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -1
- package/lib/commonjs/external/reanimated/renderHelpers.js +5 -43
- package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +1 -8
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/commonjs/skia/core/AnimatedImage.js +1 -1
- package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
- package/lib/commonjs/skia/core/Data.d.ts +1 -1
- package/lib/commonjs/skia/core/Data.js +2 -8
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/Paint.d.ts +1 -0
- package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPaint.js +3 -0
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/sksg/Container.d.ts +3 -2
- package/lib/commonjs/sksg/Container.js +32 -26
- package/lib/commonjs/sksg/Container.js.map +1 -1
- package/lib/commonjs/sksg/HostConfig.d.ts +2 -2
- package/lib/commonjs/sksg/HostConfig.js +7 -25
- package/lib/commonjs/sksg/HostConfig.js.map +1 -1
- package/lib/commonjs/sksg/Node.d.ts +19 -0
- package/lib/commonjs/sksg/Node.js +78 -0
- package/lib/commonjs/sksg/Node.js.map +1 -0
- package/lib/commonjs/sksg/Reconciler.d.ts +1 -1
- package/lib/commonjs/sksg/Recorder/Core.d.ts +79 -0
- package/lib/commonjs/sksg/Recorder/Core.js +110 -0
- package/lib/commonjs/sksg/Recorder/Core.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +18 -0
- package/lib/commonjs/sksg/Recorder/DrawingContext.js +105 -0
- package/lib/commonjs/sksg/Recorder/DrawingContext.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/Player.d.ts +3 -0
- package/lib/commonjs/sksg/Recorder/Player.js +127 -0
- package/lib/commonjs/sksg/Recorder/Player.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/Recorder.d.ts +50 -0
- package/lib/commonjs/sksg/Recorder/Recorder.js +288 -0
- package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/Recording.d.ts +7 -0
- package/lib/commonjs/sksg/Recorder/Recording.js +12 -0
- package/lib/commonjs/sksg/Recorder/Recording.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/Visitor.d.ts +5 -0
- package/lib/commonjs/sksg/Recorder/Visitor.js +293 -0
- package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/commands/Box.d.ts +13 -0
- package/lib/commonjs/sksg/Recorder/commands/Box.js +71 -0
- package/lib/commonjs/sksg/Recorder/commands/Box.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/commands/CTM.d.ts +3 -0
- package/lib/commonjs/sksg/Recorder/commands/CTM.js +79 -0
- package/lib/commonjs/sksg/Recorder/commands/CTM.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
- package/lib/commonjs/sksg/Recorder/commands/ColorFilters.js +76 -0
- package/lib/commonjs/sksg/Recorder/commands/ColorFilters.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +24 -0
- package/lib/commonjs/sksg/{nodes/drawings.js → Recorder/commands/Drawing.js} +5 -5
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
- package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +183 -0
- package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +4 -0
- package/lib/commonjs/sksg/Recorder/commands/Paint.js +70 -0
- package/lib/commonjs/sksg/Recorder/commands/Paint.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/commands/PathEffects.d.ts +6 -0
- package/lib/commonjs/sksg/Recorder/commands/PathEffects.js +137 -0
- package/lib/commonjs/sksg/Recorder/commands/PathEffects.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/commands/Shaders.d.ts +5 -0
- package/lib/commonjs/sksg/{nodes/shaders.js → Recorder/commands/Shaders.js} +58 -15
- package/lib/commonjs/sksg/Recorder/commands/Shaders.js.map +1 -0
- package/lib/commonjs/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
- package/lib/commonjs/sksg/{nodes/utils.js → utils.js} +12 -2
- package/lib/commonjs/sksg/utils.js.map +1 -0
- package/lib/module/dom/types/Common.d.ts +6 -4
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/ImageFilters.d.ts +1 -1
- package/lib/module/dom/types/ImageFilters.js.map +1 -1
- package/lib/module/dom/types/Node.d.ts +0 -2
- package/lib/module/dom/types/Node.js.map +1 -1
- package/lib/module/external/reanimated/index.d.ts +0 -1
- package/lib/module/external/reanimated/index.js +0 -1
- package/lib/module/external/reanimated/index.js.map +1 -1
- package/lib/module/external/reanimated/renderHelpers.d.ts +0 -1
- package/lib/module/external/reanimated/renderHelpers.js +4 -42
- package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/module/external/reanimated/useAnimatedImageValue.js +1 -8
- package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/module/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/module/skia/core/AnimatedImage.js +1 -1
- package/lib/module/skia/core/AnimatedImage.js.map +1 -1
- package/lib/module/skia/core/Data.d.ts +1 -1
- package/lib/module/skia/core/Data.js +2 -8
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/types/Paint/Paint.d.ts +1 -0
- package/lib/module/skia/types/Paint/Paint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPaint.js +3 -0
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/sksg/Container.d.ts +3 -2
- package/lib/module/sksg/Container.js +30 -24
- package/lib/module/sksg/Container.js.map +1 -1
- package/lib/module/sksg/HostConfig.d.ts +2 -2
- package/lib/module/sksg/HostConfig.js +7 -25
- package/lib/module/sksg/HostConfig.js.map +1 -1
- package/lib/module/sksg/Node.d.ts +19 -0
- package/lib/module/sksg/Node.js +67 -0
- package/lib/module/sksg/Node.js.map +1 -0
- package/lib/module/sksg/Reconciler.d.ts +1 -1
- package/lib/module/sksg/Recorder/Core.d.ts +79 -0
- package/lib/module/sksg/Recorder/Core.js +101 -0
- package/lib/module/sksg/Recorder/Core.js.map +1 -0
- package/lib/module/sksg/Recorder/DrawingContext.d.ts +18 -0
- package/lib/module/sksg/Recorder/DrawingContext.js +98 -0
- package/lib/module/sksg/Recorder/DrawingContext.js.map +1 -0
- package/lib/module/sksg/Recorder/Player.d.ts +3 -0
- package/lib/module/sksg/Recorder/Player.js +120 -0
- package/lib/module/sksg/Recorder/Player.js.map +1 -0
- package/lib/module/sksg/Recorder/Recorder.d.ts +50 -0
- package/lib/module/sksg/Recorder/Recorder.js +281 -0
- package/lib/module/sksg/Recorder/Recorder.js.map +1 -0
- package/lib/module/sksg/Recorder/Recording.d.ts +7 -0
- package/lib/module/sksg/Recorder/Recording.js +5 -0
- package/lib/module/sksg/Recorder/Recording.js.map +1 -0
- package/lib/module/sksg/Recorder/Visitor.d.ts +5 -0
- package/lib/module/sksg/Recorder/Visitor.js +285 -0
- package/lib/module/sksg/Recorder/Visitor.js.map +1 -0
- package/lib/module/sksg/Recorder/commands/Box.d.ts +13 -0
- package/lib/module/sksg/Recorder/commands/Box.js +63 -0
- package/lib/module/sksg/Recorder/commands/Box.js.map +1 -0
- package/lib/module/sksg/Recorder/commands/CTM.d.ts +3 -0
- package/lib/module/sksg/Recorder/commands/CTM.js +72 -0
- package/lib/module/sksg/Recorder/commands/CTM.js.map +1 -0
- package/lib/module/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
- package/lib/module/sksg/Recorder/commands/ColorFilters.js +67 -0
- package/lib/module/sksg/Recorder/commands/ColorFilters.js.map +1 -0
- package/lib/module/sksg/Recorder/commands/Drawing.d.ts +24 -0
- package/lib/module/sksg/{nodes/drawings.js → Recorder/commands/Drawing.js} +5 -5
- package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -0
- package/lib/module/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
- package/lib/module/sksg/{nodes/imageFilters.js → Recorder/commands/ImageFilters.js} +87 -95
- package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -0
- package/lib/module/sksg/Recorder/commands/Paint.d.ts +4 -0
- package/lib/module/sksg/Recorder/commands/Paint.js +62 -0
- package/lib/module/sksg/Recorder/commands/Paint.js.map +1 -0
- package/lib/module/sksg/Recorder/commands/PathEffects.d.ts +6 -0
- package/lib/module/sksg/Recorder/commands/PathEffects.js +128 -0
- package/lib/module/sksg/Recorder/commands/PathEffects.js.map +1 -0
- package/lib/module/sksg/Recorder/commands/Shaders.d.ts +5 -0
- package/lib/module/sksg/{nodes/shaders.js → Recorder/commands/Shaders.js} +63 -13
- package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -0
- package/lib/module/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
- package/lib/module/sksg/{nodes/utils.js → utils.js} +10 -1
- package/lib/module/sksg/utils.js.map +1 -0
- package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -1
- package/lib/typescript/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/core/Data.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/typescript/lib/commonjs/sksg/Container.d.ts +4 -0
- package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +1 -3
- package/lib/typescript/lib/commonjs/sksg/Node.d.ts +14 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/Core.d.ts +5 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +17 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/Player.d.ts +2 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +45 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/Recording.d.ts +5 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/Visitor.d.ts +27 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Box.d.ts +3 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/commands/CTM.d.ts +2 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/commands/ColorFilters.d.ts +4 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/commands/ImageFilters.d.ts +6 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +14 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/commands/PathEffects.d.ts +4 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Shaders.d.ts +3 -0
- package/lib/typescript/lib/commonjs/sksg/{nodes/utils.d.ts → utils.d.ts} +1 -0
- package/lib/typescript/lib/module/external/reanimated/index.d.ts +0 -1
- package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +0 -1
- package/lib/typescript/lib/module/mock/index.d.ts +1 -1
- package/lib/typescript/lib/module/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/typescript/lib/module/skia/core/Data.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/Container.d.ts +4 -0
- package/lib/typescript/lib/module/sksg/HostConfig.d.ts +1 -3
- package/lib/typescript/lib/module/sksg/Node.d.ts +13 -0
- package/lib/typescript/lib/module/sksg/Recorder/Core.d.ts +4 -0
- package/lib/typescript/lib/module/sksg/Recorder/DrawingContext.d.ts +16 -0
- package/lib/typescript/lib/module/sksg/Recorder/Player.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +44 -0
- package/lib/typescript/lib/module/sksg/Recorder/Recording.d.ts +4 -0
- package/lib/typescript/lib/module/sksg/Recorder/Visitor.d.ts +26 -0
- package/lib/typescript/lib/module/sksg/Recorder/commands/Box.d.ts +2 -0
- package/lib/typescript/lib/module/sksg/Recorder/commands/CTM.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/Recorder/commands/ColorFilters.d.ts +3 -0
- package/lib/typescript/lib/module/sksg/Recorder/commands/ImageFilters.d.ts +5 -0
- package/lib/typescript/lib/module/sksg/Recorder/commands/Paint.d.ts +13 -0
- package/lib/typescript/lib/module/sksg/Recorder/commands/PathEffects.d.ts +3 -0
- package/lib/typescript/lib/module/sksg/Recorder/commands/Shaders.d.ts +2 -0
- package/lib/typescript/lib/module/sksg/{nodes/utils.d.ts → utils.d.ts} +1 -0
- package/lib/typescript/src/dom/types/Common.d.ts +6 -4
- package/lib/typescript/src/dom/types/ImageFilters.d.ts +1 -1
- package/lib/typescript/src/dom/types/Node.d.ts +0 -2
- package/lib/typescript/src/external/reanimated/index.d.ts +0 -1
- package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +0 -1
- package/lib/typescript/src/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/typescript/src/skia/core/Data.d.ts +1 -1
- package/lib/typescript/src/skia/types/Paint/Paint.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/typescript/src/sksg/Container.d.ts +3 -2
- package/lib/typescript/src/sksg/HostConfig.d.ts +2 -2
- package/lib/typescript/src/sksg/Node.d.ts +19 -0
- package/lib/typescript/src/sksg/Reconciler.d.ts +1 -1
- package/lib/typescript/src/sksg/Recorder/Core.d.ts +79 -0
- package/lib/typescript/src/sksg/Recorder/DrawingContext.d.ts +18 -0
- package/lib/typescript/src/sksg/Recorder/Player.d.ts +3 -0
- package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +50 -0
- package/lib/typescript/src/sksg/Recorder/Recording.d.ts +7 -0
- package/lib/typescript/src/sksg/Recorder/Visitor.d.ts +5 -0
- package/lib/typescript/src/sksg/Recorder/commands/Box.d.ts +13 -0
- package/lib/typescript/src/sksg/Recorder/commands/CTM.d.ts +3 -0
- package/lib/typescript/src/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
- package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +24 -0
- package/lib/typescript/src/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
- package/lib/typescript/src/sksg/Recorder/commands/Paint.d.ts +4 -0
- package/lib/typescript/src/sksg/Recorder/commands/PathEffects.d.ts +6 -0
- package/lib/typescript/src/sksg/Recorder/commands/Shaders.d.ts +5 -0
- package/lib/typescript/src/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
- package/package.json +1 -1
- package/src/__tests__/snapshots/image-filter/test-shadow.png +0 -0
- package/src/dom/types/Common.ts +7 -5
- package/src/dom/types/ImageFilters.ts +2 -1
- package/src/dom/types/Node.ts +0 -4
- package/src/external/reanimated/index.ts +0 -1
- package/src/external/reanimated/renderHelpers.ts +4 -44
- package/src/external/reanimated/useAnimatedImageValue.ts +4 -15
- package/src/renderer/__tests__/e2e/ColorFilters.spec.tsx +15 -0
- package/src/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.tsx +23 -2
- package/src/renderer/__tests__/e2e/ImageFilters.spec.tsx +91 -2
- package/src/renderer/__tests__/setup.tsx +1 -1
- package/src/skia/core/AnimatedImage.ts +2 -3
- package/src/skia/core/Data.ts +3 -9
- package/src/skia/types/Paint/Paint.ts +2 -0
- package/src/skia/web/JsiSkPaint.ts +4 -0
- package/src/sksg/Container.ts +35 -29
- package/src/sksg/HostConfig.ts +5 -50
- package/src/sksg/Node.ts +105 -0
- package/src/sksg/Recorder/Core.ts +171 -0
- package/src/sksg/Recorder/DrawingContext.ts +130 -0
- package/src/sksg/Recorder/Player.ts +160 -0
- package/src/sksg/Recorder/Recorder.ts +259 -0
- package/src/sksg/Recorder/Recording.ts +13 -0
- package/src/sksg/Recorder/Visitor.ts +324 -0
- package/src/sksg/Recorder/commands/Box.ts +63 -0
- package/src/sksg/Recorder/commands/CTM.ts +72 -0
- package/src/sksg/Recorder/commands/ColorFilters.ts +87 -0
- package/src/sksg/{nodes/drawings.ts → Recorder/commands/Drawing.ts} +29 -65
- package/src/sksg/Recorder/commands/ImageFilters.ts +255 -0
- package/src/sksg/Recorder/commands/Paint.ts +77 -0
- package/src/sksg/Recorder/commands/PathEffects.ts +169 -0
- package/src/sksg/{nodes/shaders.ts → Recorder/commands/Shaders.ts} +100 -26
- package/src/sksg/{nodes/utils.ts → utils.ts} +14 -1
- package/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
- package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js +0 -24
- package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js.map +0 -1
- package/lib/commonjs/sksg/DeclarationContext.d.ts +0 -56
- package/lib/commonjs/sksg/DeclarationContext.js +0 -77
- package/lib/commonjs/sksg/DeclarationContext.js.map +0 -1
- package/lib/commonjs/sksg/DrawingContext.d.ts +0 -13
- package/lib/commonjs/sksg/DrawingContext.js +0 -172
- package/lib/commonjs/sksg/DrawingContext.js.map +0 -1
- package/lib/commonjs/sksg/__tests__/Declarations.spec.d.ts +0 -1
- package/lib/commonjs/sksg/__tests__/MockDeclaration.d.ts +0 -57
- package/lib/commonjs/sksg/nodes/Node.d.ts +0 -7
- package/lib/commonjs/sksg/nodes/Node.js +0 -6
- package/lib/commonjs/sksg/nodes/Node.js.map +0 -1
- package/lib/commonjs/sksg/nodes/colorFilters.d.ts +0 -10
- package/lib/commonjs/sksg/nodes/colorFilters.js +0 -79
- package/lib/commonjs/sksg/nodes/colorFilters.js.map +0 -1
- package/lib/commonjs/sksg/nodes/context.d.ts +0 -3
- package/lib/commonjs/sksg/nodes/context.js +0 -394
- package/lib/commonjs/sksg/nodes/context.js.map +0 -1
- package/lib/commonjs/sksg/nodes/drawings.d.ts +0 -30
- package/lib/commonjs/sksg/nodes/drawings.js.map +0 -1
- package/lib/commonjs/sksg/nodes/imageFilters.d.ts +0 -17
- package/lib/commonjs/sksg/nodes/imageFilters.js +0 -197
- package/lib/commonjs/sksg/nodes/imageFilters.js.map +0 -1
- package/lib/commonjs/sksg/nodes/index.d.ts +0 -3
- package/lib/commonjs/sksg/nodes/index.js +0 -39
- package/lib/commonjs/sksg/nodes/index.js.map +0 -1
- package/lib/commonjs/sksg/nodes/paint.d.ts +0 -3
- package/lib/commonjs/sksg/nodes/paint.js +0 -81
- package/lib/commonjs/sksg/nodes/paint.js.map +0 -1
- package/lib/commonjs/sksg/nodes/pathEffects.d.ts +0 -11
- package/lib/commonjs/sksg/nodes/pathEffects.js +0 -111
- package/lib/commonjs/sksg/nodes/pathEffects.js.map +0 -1
- package/lib/commonjs/sksg/nodes/shaders.d.ts +0 -11
- package/lib/commonjs/sksg/nodes/shaders.js.map +0 -1
- package/lib/commonjs/sksg/nodes/utils.js.map +0 -1
- package/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
- package/lib/module/external/reanimated/useDerivedValueOnJS.js +0 -16
- package/lib/module/external/reanimated/useDerivedValueOnJS.js.map +0 -1
- package/lib/module/sksg/DeclarationContext.d.ts +0 -56
- package/lib/module/sksg/DeclarationContext.js +0 -69
- package/lib/module/sksg/DeclarationContext.js.map +0 -1
- package/lib/module/sksg/DrawingContext.d.ts +0 -13
- package/lib/module/sksg/DrawingContext.js +0 -165
- package/lib/module/sksg/DrawingContext.js.map +0 -1
- package/lib/module/sksg/__tests__/Declarations.spec.d.ts +0 -1
- package/lib/module/sksg/__tests__/MockDeclaration.d.ts +0 -57
- package/lib/module/sksg/nodes/Node.d.ts +0 -7
- package/lib/module/sksg/nodes/Node.js +0 -2
- package/lib/module/sksg/nodes/Node.js.map +0 -1
- package/lib/module/sksg/nodes/colorFilters.d.ts +0 -10
- package/lib/module/sksg/nodes/colorFilters.js +0 -66
- package/lib/module/sksg/nodes/colorFilters.js.map +0 -1
- package/lib/module/sksg/nodes/context.d.ts +0 -3
- package/lib/module/sksg/nodes/context.js +0 -387
- package/lib/module/sksg/nodes/context.js.map +0 -1
- package/lib/module/sksg/nodes/drawings.d.ts +0 -30
- package/lib/module/sksg/nodes/drawings.js.map +0 -1
- package/lib/module/sksg/nodes/imageFilters.d.ts +0 -17
- package/lib/module/sksg/nodes/imageFilters.js.map +0 -1
- package/lib/module/sksg/nodes/index.d.ts +0 -3
- package/lib/module/sksg/nodes/index.js +0 -4
- package/lib/module/sksg/nodes/index.js.map +0 -1
- package/lib/module/sksg/nodes/paint.d.ts +0 -3
- package/lib/module/sksg/nodes/paint.js +0 -74
- package/lib/module/sksg/nodes/paint.js.map +0 -1
- package/lib/module/sksg/nodes/pathEffects.d.ts +0 -11
- package/lib/module/sksg/nodes/pathEffects.js +0 -97
- package/lib/module/sksg/nodes/pathEffects.js.map +0 -1
- package/lib/module/sksg/nodes/shaders.d.ts +0 -11
- package/lib/module/sksg/nodes/shaders.js.map +0 -1
- package/lib/module/sksg/nodes/utils.js.map +0 -1
- package/lib/typescript/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +0 -2
- package/lib/typescript/lib/commonjs/sksg/DeclarationContext.d.ts +0 -53
- package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +0 -22
- package/lib/typescript/lib/commonjs/sksg/nodes/Node.d.ts +0 -1
- package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +0 -8
- package/lib/typescript/lib/commonjs/sksg/nodes/context.d.ts +0 -2
- package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +0 -12
- package/lib/typescript/lib/commonjs/sksg/nodes/index.d.ts +0 -1
- package/lib/typescript/lib/commonjs/sksg/nodes/paint.d.ts +0 -2
- package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +0 -9
- package/lib/typescript/lib/commonjs/sksg/nodes/shaders.d.ts +0 -10
- package/lib/typescript/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
- package/lib/typescript/lib/module/sksg/DeclarationContext.d.ts +0 -52
- package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +0 -21
- package/lib/typescript/lib/module/sksg/nodes/Node.d.ts +0 -1
- package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +0 -7
- package/lib/typescript/lib/module/sksg/nodes/context.d.ts +0 -1
- package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +0 -11
- package/lib/typescript/lib/module/sksg/nodes/index.d.ts +0 -3
- package/lib/typescript/lib/module/sksg/nodes/paint.d.ts +0 -1
- package/lib/typescript/lib/module/sksg/nodes/pathEffects.d.ts +0 -8
- package/lib/typescript/lib/module/sksg/nodes/shaders.d.ts +0 -9
- package/lib/typescript/src/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
- package/lib/typescript/src/sksg/DeclarationContext.d.ts +0 -56
- package/lib/typescript/src/sksg/DrawingContext.d.ts +0 -13
- package/lib/typescript/src/sksg/__tests__/Declarations.spec.d.ts +0 -1
- package/lib/typescript/src/sksg/__tests__/MockDeclaration.d.ts +0 -57
- package/lib/typescript/src/sksg/nodes/Node.d.ts +0 -7
- package/lib/typescript/src/sksg/nodes/colorFilters.d.ts +0 -10
- package/lib/typescript/src/sksg/nodes/context.d.ts +0 -3
- package/lib/typescript/src/sksg/nodes/drawings.d.ts +0 -30
- package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +0 -17
- package/lib/typescript/src/sksg/nodes/index.d.ts +0 -3
- package/lib/typescript/src/sksg/nodes/paint.d.ts +0 -3
- package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +0 -11
- package/lib/typescript/src/sksg/nodes/shaders.d.ts +0 -11
- package/src/external/reanimated/useDerivedValueOnJS.ts +0 -20
- package/src/sksg/DeclarationContext.ts +0 -85
- package/src/sksg/DrawingContext.ts +0 -226
- package/src/sksg/__tests__/Declarations.spec.tsx +0 -235
- package/src/sksg/__tests__/MockDeclaration.ts +0 -138
- package/src/sksg/nodes/Node.ts +0 -8
- package/src/sksg/nodes/colorFilters.ts +0 -79
- package/src/sksg/nodes/context.ts +0 -412
- package/src/sksg/nodes/imageFilters.ts +0 -235
- package/src/sksg/nodes/index.ts +0 -3
- package/src/sksg/nodes/paint.ts +0 -75
- package/src/sksg/nodes/pathEffects.ts +0 -118
- /package/lib/typescript/lib/commonjs/sksg/{nodes/drawings.d.ts → Recorder/commands/Drawing.d.ts} +0 -0
- /package/lib/typescript/lib/module/sksg/{nodes/drawings.d.ts → Recorder/commands/Drawing.d.ts} +0 -0
@@ -5,25 +5,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.Container = void 0;
|
7
7
|
var _ReanimatedProxy = _interopRequireDefault(require("../external/reanimated/ReanimatedProxy"));
|
8
|
-
var
|
9
|
-
var
|
10
|
-
var
|
8
|
+
var _utils = require("./utils");
|
9
|
+
var _Recorder = require("./Recorder/Recorder");
|
10
|
+
var _Visitor = require("./Recorder/Visitor");
|
11
|
+
var _Player = require("./Recorder/Player");
|
12
|
+
var _DrawingContext = require("./Recorder/DrawingContext");
|
13
|
+
var _Recording = require("./Recorder/Recording");
|
11
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
12
15
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
13
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
14
17
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
15
|
-
const drawOnscreen = (Skia, nativeId,
|
18
|
+
const drawOnscreen = (Skia, nativeId, recording) => {
|
16
19
|
"worklet";
|
17
20
|
|
18
21
|
const rec = Skia.PictureRecorder();
|
19
22
|
const canvas = rec.beginRecording();
|
20
|
-
//
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
// const start = performance.now();
|
24
|
+
|
25
|
+
// TODO: because the pool is not a shared value here, it is copied on every frame
|
26
|
+
const ctx = (0, _DrawingContext.createDrawingContext)(Skia, recording.paintPool, canvas);
|
27
|
+
//console.log(recording.commands);
|
28
|
+
(0, _Player.replay)(ctx, recording.commands);
|
26
29
|
const picture = rec.finishRecordingAsPicture();
|
30
|
+
//const end = performance.now();
|
31
|
+
//console.log("Recording time: ", end - start);
|
27
32
|
SkiaViewApi.setJsiProperty(nativeId, "picture", picture);
|
28
33
|
};
|
29
34
|
class Container {
|
@@ -31,6 +36,7 @@ class Container {
|
|
31
36
|
this.Skia = Skia;
|
32
37
|
this.nativeId = nativeId;
|
33
38
|
_defineProperty(this, "_root", []);
|
39
|
+
_defineProperty(this, "_recording", null);
|
34
40
|
_defineProperty(this, "unmounted", false);
|
35
41
|
_defineProperty(this, "values", new Set());
|
36
42
|
_defineProperty(this, "mapperId", null);
|
@@ -40,41 +46,39 @@ class Container {
|
|
40
46
|
}
|
41
47
|
set root(root) {
|
42
48
|
const isOnscreen = this.nativeId !== -1;
|
43
|
-
if (_renderHelpers.HAS_REANIMATED && !_renderHelpers.HAS_REANIMATED_3) {
|
44
|
-
throw new Error("React Native Skia only supports Reanimated 3 and above");
|
45
|
-
}
|
46
49
|
if (isOnscreen) {
|
47
50
|
if (this.mapperId !== null) {
|
48
51
|
_ReanimatedProxy.default.stopMapper(this.mapperId);
|
49
52
|
}
|
50
53
|
const {
|
51
54
|
nativeId,
|
52
|
-
Skia
|
55
|
+
Skia,
|
56
|
+
_recording
|
53
57
|
} = this;
|
54
58
|
this.mapperId = _ReanimatedProxy.default.startMapper(() => {
|
55
59
|
"worklet";
|
56
60
|
|
57
|
-
drawOnscreen(Skia, nativeId,
|
61
|
+
drawOnscreen(Skia, nativeId, _recording);
|
58
62
|
}, Array.from(this.values));
|
59
63
|
}
|
60
64
|
this._root = root;
|
65
|
+
const recorder = new _Recorder.Recorder();
|
66
|
+
(0, _Visitor.visit)(recorder, root);
|
67
|
+
this._recording = (0, _Recording.createRecording)(recorder.commands);
|
61
68
|
}
|
62
69
|
clear() {
|
63
70
|
console.log("clear container");
|
64
71
|
}
|
65
72
|
redraw() {
|
66
73
|
const isOnscreen = this.nativeId !== -1;
|
67
|
-
if (_renderHelpers.HAS_REANIMATED && !_renderHelpers.HAS_REANIMATED_3) {
|
68
|
-
throw new Error("React Native Skia only supports Reanimated 3 and above");
|
69
|
-
}
|
70
74
|
if (isOnscreen) {
|
71
75
|
const {
|
72
76
|
nativeId,
|
73
77
|
Skia,
|
74
|
-
|
78
|
+
_recording
|
75
79
|
} = this;
|
76
80
|
_ReanimatedProxy.default.runOnUI(() => {
|
77
|
-
drawOnscreen(Skia, nativeId,
|
81
|
+
drawOnscreen(Skia, nativeId, _recording);
|
78
82
|
})();
|
79
83
|
}
|
80
84
|
}
|
@@ -82,20 +86,22 @@ class Container {
|
|
82
86
|
return this.nativeId;
|
83
87
|
}
|
84
88
|
unregisterValues(values) {
|
85
|
-
Object.values(values).filter(
|
89
|
+
Object.values(values).filter(_utils.isSharedValue).forEach(value => {
|
86
90
|
this.values.delete(value);
|
87
91
|
});
|
88
92
|
}
|
89
93
|
registerValues(values) {
|
90
|
-
Object.values(values).filter(
|
94
|
+
Object.values(values).filter(_utils.isSharedValue).forEach(value => {
|
91
95
|
this.values.add(value);
|
92
96
|
});
|
93
97
|
}
|
94
98
|
drawOnCanvas(canvas) {
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
+
if (!this._recording) {
|
100
|
+
throw new Error("No recording to draw");
|
101
|
+
}
|
102
|
+
const ctx = (0, _DrawingContext.createDrawingContext)(this.Skia, this._recording.paintPool, canvas);
|
103
|
+
//console.log(this._recording);
|
104
|
+
(0, _Player.replay)(ctx, this._recording.commands);
|
99
105
|
}
|
100
106
|
}
|
101
107
|
exports.Container = Container;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ReanimatedProxy","_interopRequireDefault","require","
|
1
|
+
{"version":3,"names":["_ReanimatedProxy","_interopRequireDefault","require","_utils","_Recorder","_Visitor","_Player","_DrawingContext","_Recording","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","drawOnscreen","Skia","nativeId","recording","rec","PictureRecorder","canvas","beginRecording","ctx","createDrawingContext","paintPool","replay","commands","picture","finishRecordingAsPicture","SkiaViewApi","setJsiProperty","Container","constructor","Set","root","_root","isOnscreen","mapperId","Rea","stopMapper","_recording","startMapper","Array","from","values","recorder","Recorder","visit","createRecording","clear","console","log","redraw","runOnUI","getNativeId","unregisterValues","filter","isSharedValue","forEach","delete","registerValues","add","drawOnCanvas","Error","exports"],"sources":["Container.ts"],"sourcesContent":["import { type SharedValue } from \"react-native-reanimated\";\n\nimport Rea from \"../external/reanimated/ReanimatedProxy\";\nimport type { Skia, SkCanvas } from \"../skia/types\";\n\nimport type { Node } from \"./Node\";\nimport { isSharedValue } from \"./utils\";\nimport { Recorder } from \"./Recorder/Recorder\";\nimport { visit } from \"./Recorder/Visitor\";\nimport { replay } from \"./Recorder/Player\";\nimport { createDrawingContext } from \"./Recorder/DrawingContext\";\nimport { createRecording, type Recording } from \"./Recorder/Recording\";\n\nconst drawOnscreen = (Skia: Skia, nativeId: number, recording: Recording) => {\n \"worklet\";\n const rec = Skia.PictureRecorder();\n const canvas = rec.beginRecording();\n // const start = performance.now();\n\n // TODO: because the pool is not a shared value here, it is copied on every frame\n const ctx = createDrawingContext(Skia, recording.paintPool, canvas);\n //console.log(recording.commands);\n replay(ctx, recording.commands);\n const picture = rec.finishRecordingAsPicture();\n //const end = performance.now();\n //console.log(\"Recording time: \", end - start);\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nexport class Container {\n private _root: Node[] = [];\n private _recording: Recording | null = null;\n public unmounted = false;\n\n private values = new Set<SharedValue<unknown>>();\n private mapperId: number | null = null;\n\n constructor(public Skia: Skia, private nativeId: number) {}\n\n get root() {\n return this._root;\n }\n\n set root(root: Node[]) {\n const isOnscreen = this.nativeId !== -1;\n if (isOnscreen) {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n }\n const { nativeId, Skia, _recording } = this;\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, _recording!);\n }, Array.from(this.values));\n }\n this._root = root;\n const recorder = new Recorder();\n visit(recorder, root);\n this._recording = createRecording(recorder.commands);\n }\n\n clear() {\n console.log(\"clear container\");\n }\n\n redraw() {\n const isOnscreen = this.nativeId !== -1;\n if (isOnscreen) {\n const { nativeId, Skia, _recording } = this;\n Rea.runOnUI(() => {\n drawOnscreen(Skia, nativeId, _recording!);\n })();\n }\n }\n\n getNativeId() {\n return this.nativeId;\n }\n\n unregisterValues(values: object) {\n Object.values(values)\n .filter(isSharedValue)\n .forEach((value) => {\n this.values.delete(value);\n });\n }\n\n registerValues(values: object) {\n Object.values(values)\n .filter(isSharedValue)\n .forEach((value) => {\n this.values.add(value);\n });\n }\n\n drawOnCanvas(canvas: SkCanvas) {\n if (!this._recording) {\n throw new Error(\"No recording to draw\");\n }\n const ctx = createDrawingContext(\n this.Skia,\n this._recording.paintPool,\n canvas\n );\n //console.log(this._recording);\n replay(ctx, this._recording.commands);\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAAuE,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe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C,MAAM,CAACA,MAAM,CAAC,CAClBY,MAAM,CAACC,oBAAa,CAAC,CACrBC,OAAO,CAAExD,KAAK,IAAK;MAClB,IAAI,CAAC0C,MAAM,CAACiB,GAAG,CAAC3D,KAAK,CAAC;IACxB,CAAC,CAAC;EACN;EAEA4D,YAAYA,CAAC1C,MAAgB,EAAE;IAC7B,IAAI,CAAC,IAAI,CAACoB,UAAU,EAAE;MACpB,MAAM,IAAIuB,KAAK,CAAC,sBAAsB,CAAC;IACzC;IACA,MAAMzC,GAAG,GAAG,IAAAC,oCAAoB,EAC9B,IAAI,CAACR,IAAI,EACT,IAAI,CAACyB,UAAU,CAAChB,SAAS,EACzBJ,MACF,CAAC;IACD;IACA,IAAAK,cAAM,EAACH,GAAG,EAAE,IAAI,CAACkB,UAAU,CAACd,QAAQ,CAAC;EACvC;AACF;AAACsC,OAAA,CAAAjC,SAAA,GAAAA,SAAA","ignoreList":[]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { HostConfig } from "react-reconciler";
|
2
|
-
import { NodeType } from "../dom/types";
|
3
|
-
import type { Node } from "./
|
2
|
+
import type { NodeType } from "../dom/types";
|
3
|
+
import type { Node } from "./Node";
|
4
4
|
import type { Container } from "./Container";
|
5
5
|
export declare const debug: (message?: any, ...optionalParams: any[]) => void;
|
6
6
|
type Instance = Node;
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.sksgHostConfig = exports.debug = void 0;
|
7
7
|
var _constants = require("react-reconciler/constants");
|
8
|
-
var _types = require("../dom/types");
|
9
8
|
var _typeddash = require("../renderer/typeddash");
|
10
9
|
/*global NodeJS*/
|
11
10
|
|
@@ -16,26 +15,6 @@ const debug = (...args) => {
|
|
16
15
|
}
|
17
16
|
};
|
18
17
|
exports.debug = debug;
|
19
|
-
const isDeclaration = type => {
|
20
|
-
"worklet";
|
21
|
-
|
22
|
-
return (
|
23
|
-
// BlurMaskFilters
|
24
|
-
type === _types.NodeType.BlurMaskFilter ||
|
25
|
-
// ImageFilters
|
26
|
-
type === _types.NodeType.BlendImageFilter || type === _types.NodeType.BlurImageFilter || type === _types.NodeType.OffsetImageFilter || type === _types.NodeType.DropShadowImageFilter || type === _types.NodeType.MorphologyImageFilter || type === _types.NodeType.DisplacementMapImageFilter || type === _types.NodeType.RuntimeShaderImageFilter ||
|
27
|
-
// ColorFilters
|
28
|
-
type === _types.NodeType.MatrixColorFilter || type === _types.NodeType.BlendColorFilter || type === _types.NodeType.LumaColorFilter || type === _types.NodeType.LinearToSRGBGammaColorFilter || type === _types.NodeType.SRGBToLinearGammaColorFilter || type === _types.NodeType.LerpColorFilter ||
|
29
|
-
// Shaders
|
30
|
-
type === _types.NodeType.Shader || type === _types.NodeType.ImageShader || type === _types.NodeType.ColorShader || type === _types.NodeType.Turbulence || type === _types.NodeType.FractalNoise || type === _types.NodeType.LinearGradient || type === _types.NodeType.RadialGradient || type === _types.NodeType.SweepGradient || type === _types.NodeType.TwoPointConicalGradient ||
|
31
|
-
// Path Effects
|
32
|
-
type === _types.NodeType.CornerPathEffect || type === _types.NodeType.DiscretePathEffect || type === _types.NodeType.DashPathEffect || type === _types.NodeType.Path1DPathEffect || type === _types.NodeType.Path2DPathEffect || type === _types.NodeType.SumPathEffect || type === _types.NodeType.Line2DPathEffect ||
|
33
|
-
// Mixed
|
34
|
-
type === _types.NodeType.Blend ||
|
35
|
-
// Paint
|
36
|
-
type === _types.NodeType.Paint
|
37
|
-
);
|
38
|
-
};
|
39
18
|
const sksgHostConfig = exports.sksgHostConfig = {
|
40
19
|
/**
|
41
20
|
* This function is used by the reconciler in order to calculate current time for prioritising work.
|
@@ -64,12 +43,16 @@ const sksgHostConfig = exports.sksgHostConfig = {
|
|
64
43
|
// return SpanNode({}, text) as SkNode;
|
65
44
|
throw new Error("Text nodes are not supported yet");
|
66
45
|
},
|
67
|
-
createInstance(type,
|
46
|
+
createInstance(type, propsWithChildren, container, _hostContext, _internalInstanceHandle) {
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
48
|
+
const {
|
49
|
+
children,
|
50
|
+
...props
|
51
|
+
} = propsWithChildren;
|
68
52
|
debug("createInstance", type);
|
69
53
|
container.registerValues(props);
|
70
54
|
const instance = {
|
71
55
|
type,
|
72
|
-
isDeclaration: isDeclaration(type),
|
73
56
|
props,
|
74
57
|
children: []
|
75
58
|
};
|
@@ -123,8 +106,7 @@ const sksgHostConfig = exports.sksgHostConfig = {
|
|
123
106
|
return {
|
124
107
|
type: instance.type,
|
125
108
|
props: newProps,
|
126
|
-
children: keepChildren ? [...instance.children] : []
|
127
|
-
isDeclaration: instance.isDeclaration
|
109
|
+
children: keepChildren ? [...instance.children] : []
|
128
110
|
};
|
129
111
|
},
|
130
112
|
createContainerChildSet() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_constants","require","_types","_typeddash","DEBUG","debug","args","console","log","exports","isDeclaration","type","NodeType","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","MorphologyImageFilter","DisplacementMapImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","LerpColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","Paint","sksgHostConfig","supportsMutation","isPrimaryRenderer","supportsPersistence","supportsHydration","scheduleTimeout","setTimeout","cancelTimeout","clearTimeout","noTimeout","getRootHostContext","_rootContainerInstance","getChildHostContext","_parentHostContext","_type","shouldSetTextContent","_props","createTextInstance","_text","_hostContext","_internalInstanceHandle","Error","createInstance","props","container","registerValues","instance","children","appendInitialChild","parentInstance","child","push","finalizeInitialChildren","commitMount","prepareForCommit","_containerInfo","resetAfterCommit","redraw","getPublicInstance","node","commitTextUpdate","_textInstance","_oldText","_newText","clearContainer","clear","prepareUpdate","_instance","oldProps","newProps","propsAreEqual","shallowEq","unregisterValues","preparePortalMount","cloneInstance","_updatePayload","_oldProps","keepChildren","_recyclableInstance","createContainerChildSet","appendChildToContainerChildSet","childSet","finalizeContainerChildren","newChildren","root","replaceContainerChildren","cloneHiddenInstance","cloneHiddenTextInstance","getCurrentEventPriority","DefaultEventPriority","beforeActiveInstanceBlur","afterActiveInstanceBlur","detachDeletedInstance","getInstanceFromNode","_node","prepareScopeUpdate","_scopeInstance","getInstanceFromScope"],"sources":["HostConfig.ts"],"sourcesContent":["/*global NodeJS*/\nimport type { Fiber, HostConfig } from \"react-reconciler\";\nimport { DefaultEventPriority } from \"react-reconciler/constants\";\n\nimport { NodeType } from \"../dom/types\";\nimport { shallowEq } from \"../renderer/typeddash\";\n\nimport type { Node } from \"./nodes/Node\";\nimport type { Container } from \"./Container\";\n\nconst DEBUG = false;\nexport const debug = (...args: Parameters<typeof console.log>) => {\n if (DEBUG) {\n console.log(...args);\n }\n};\n\nconst isDeclaration = (type: NodeType) => {\n \"worklet\";\n return (\n // BlurMaskFilters\n type === NodeType.BlurMaskFilter ||\n // ImageFilters\n type === NodeType.BlendImageFilter ||\n type === NodeType.BlurImageFilter ||\n type === NodeType.OffsetImageFilter ||\n type === NodeType.DropShadowImageFilter ||\n type === NodeType.MorphologyImageFilter ||\n type === NodeType.DisplacementMapImageFilter ||\n type === NodeType.RuntimeShaderImageFilter ||\n // ColorFilters\n type === NodeType.MatrixColorFilter ||\n type === NodeType.BlendColorFilter ||\n type === NodeType.LumaColorFilter ||\n type === NodeType.LinearToSRGBGammaColorFilter ||\n type === NodeType.SRGBToLinearGammaColorFilter ||\n type === NodeType.LerpColorFilter ||\n // Shaders\n type === NodeType.Shader ||\n type === NodeType.ImageShader ||\n type === NodeType.ColorShader ||\n type === NodeType.Turbulence ||\n type === NodeType.FractalNoise ||\n type === NodeType.LinearGradient ||\n type === NodeType.RadialGradient ||\n type === NodeType.SweepGradient ||\n type === NodeType.TwoPointConicalGradient ||\n // Path Effects\n type === NodeType.CornerPathEffect ||\n type === NodeType.DiscretePathEffect ||\n type === NodeType.DashPathEffect ||\n type === NodeType.Path1DPathEffect ||\n type === NodeType.Path2DPathEffect ||\n type === NodeType.SumPathEffect ||\n type === NodeType.Line2DPathEffect ||\n // Mixed\n type === NodeType.Blend ||\n // Paint\n type === NodeType.Paint\n );\n};\n\ntype Instance = Node;\n\ntype Props = object;\ntype TextInstance = Node;\ntype SuspenseInstance = Instance;\ntype HydratableInstance = Instance;\ntype PublicInstance = Instance;\ntype HostContext = null;\ntype UpdatePayload = Container;\ntype ChildSet = Node[];\ntype TimeoutHandle = NodeJS.Timeout;\ntype NoTimeout = -1;\n\ntype SkiaHostConfig = HostConfig<\n NodeType,\n Props,\n Container,\n Instance,\n TextInstance,\n SuspenseInstance,\n HydratableInstance,\n PublicInstance,\n HostContext,\n UpdatePayload,\n ChildSet,\n TimeoutHandle,\n NoTimeout\n>;\n\nexport const sksgHostConfig: SkiaHostConfig = {\n /**\n * This function is used by the reconciler in order to calculate current time for prioritising work.\n */\n supportsMutation: false,\n isPrimaryRenderer: false,\n supportsPersistence: true,\n supportsHydration: false,\n //supportsMicrotask: true,\n scheduleTimeout: setTimeout,\n cancelTimeout: clearTimeout,\n noTimeout: -1,\n\n getRootHostContext: (_rootContainerInstance: Container) => {\n debug(\"getRootHostContext\");\n return null;\n },\n\n getChildHostContext(_parentHostContext, _type, _rootContainerInstance) {\n debug(\"getChildHostContext\");\n return null;\n },\n\n shouldSetTextContent(_type, _props) {\n return false;\n },\n\n createTextInstance(\n _text,\n _rootContainerInstance,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createTextInstance\");\n // return SpanNode({}, text) as SkNode;\n throw new Error(\"Text nodes are not supported yet\");\n },\n\n createInstance(\n type,\n props,\n container,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createInstance\", type);\n container.registerValues(props);\n const instance = {\n type,\n isDeclaration: isDeclaration(type),\n props,\n children: [],\n };\n return instance;\n },\n\n appendInitialChild(parentInstance: Instance, child: Instance | TextInstance) {\n parentInstance.children.push(child);\n },\n\n finalizeInitialChildren(\n parentInstance,\n _type,\n _props,\n _rootContainerInstance,\n _hostContext\n ) {\n debug(\"finalizeInitialChildren\", parentInstance);\n return false;\n },\n\n commitMount() {\n // if finalizeInitialChildren = true\n debug(\"commitMount\");\n },\n\n prepareForCommit(_containerInfo) {\n debug(\"prepareForCommit\");\n return null;\n },\n\n resetAfterCommit(container) {\n debug(\"resetAfterCommit\");\n container.redraw();\n },\n\n getPublicInstance(node: Instance) {\n debug(\"getPublicInstance\");\n return node;\n },\n\n commitTextUpdate: (\n _textInstance: TextInstance,\n _oldText: string,\n _newText: string\n ) => {\n // textInstance.instance = newText;\n },\n\n clearContainer: (container) => {\n debug(\"clearContainer\");\n container.clear();\n },\n\n prepareUpdate(\n _instance: Instance,\n _type: string,\n oldProps: Props,\n newProps: Props,\n container: Container,\n _hostContext: HostContext\n ) {\n debug(\"prepareUpdate\");\n const propsAreEqual = shallowEq(oldProps, newProps);\n if (propsAreEqual) {\n return null;\n }\n container.unregisterValues(oldProps);\n container.registerValues(newProps);\n return container;\n },\n\n preparePortalMount: () => {\n debug(\"preparePortalMount\");\n },\n\n cloneInstance(\n instance,\n _updatePayload,\n _type,\n _oldProps,\n newProps,\n _internalInstanceHandle,\n keepChildren: boolean,\n _recyclableInstance: null | Instance\n ) {\n debug(\"cloneInstance\");\n\n return {\n type: instance.type,\n props: newProps,\n children: keepChildren ? [...instance.children] : [],\n isDeclaration: instance.isDeclaration,\n };\n },\n\n createContainerChildSet(): ChildSet {\n debug(\"createContainerChildSet\");\n return [];\n },\n\n appendChildToContainerChildSet(\n childSet: ChildSet,\n child: Instance | TextInstance\n ): void {\n childSet.push(child);\n },\n\n finalizeContainerChildren(container: Container, newChildren: ChildSet) {\n debug(\"finalizeContainerChildren\");\n container.root = newChildren;\n },\n\n replaceContainerChildren(container: Container, newChildren: ChildSet) {\n debug(\"replaceContainerChildren\");\n container.root = newChildren;\n },\n\n cloneHiddenInstance(\n _instance: Instance,\n _type: string,\n _props: Props\n ): Instance {\n debug(\"cloneHiddenInstance\");\n throw new Error(\"Not yet implemented.\");\n },\n\n cloneHiddenTextInstance(_instance: Instance, _text: string): TextInstance {\n debug(\"cloneHiddenTextInstance\");\n throw new Error(\"Not yet implemented.\");\n },\n // see https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874\n getCurrentEventPriority: () => DefaultEventPriority,\n beforeActiveInstanceBlur: () => {},\n afterActiveInstanceBlur: () => {},\n detachDeletedInstance: () => {},\n getInstanceFromNode: function (_node): Fiber | null | undefined {\n throw new Error(\"Function not implemented.\");\n },\n prepareScopeUpdate: function (_scopeInstance, _instance): void {\n throw new Error(\"Function not implemented.\");\n },\n getInstanceFromScope: function (_scopeInstance): Instance | null {\n throw new Error(\"Function not implemented.\");\n },\n};\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AALA;;AAUA,MAAMG,KAAK,GAAG,KAAK;AACZ,MAAMC,KAAK,GAAGA,CAAC,GAAGC,IAAoC,KAAK;EAChE,IAAIF,KAAK,EAAE;IACTG,OAAO,CAACC,GAAG,CAAC,GAAGF,IAAI,CAAC;EACtB;AACF,CAAC;AAACG,OAAA,CAAAJ,KAAA,GAAAA,KAAA;AAEF,MAAMK,aAAa,GAAIC,IAAc,IAAK;EACxC,SAAS;;EACT;IACE;IACAA,IAAI,KAAKC,eAAQ,CAACC,cAAc;IAChC;IACAF,IAAI,KAAKC,eAAQ,CAACE,gBAAgB,IAClCH,IAAI,KAAKC,eAAQ,CAACG,eAAe,IACjCJ,IAAI,KAAKC,eAAQ,CAACI,iBAAiB,IACnCL,IAAI,KAAKC,eAAQ,CAACK,qBAAqB,IACvCN,IAAI,K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CAAA,KAAM,CAAC,CAAC;EAClCC,uBAAuB,EAAEA,CAAA,KAAM,CAAC,CAAC;EACjCC,qBAAqB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC/BC,mBAAmB,EAAE,SAAAA,CAAUC,KAAK,EAA4B;IAC9D,MAAM,IAAIrD,KAAK,CAAC,2BAA2B,CAAC;EAC9C,CAAC;EACDsD,kBAAkB,EAAE,SAAAA,CAAUC,cAAc,EAAE7B,SAAS,EAAQ;IAC7D,MAAM,IAAI1B,KAAK,CAAC,2BAA2B,CAAC;EAC9C,CAAC;EACDwD,oBAAoB,EAAE,SAAAA,CAAUD,cAAc,EAAmB;IAC/D,MAAM,IAAIvD,KAAK,CAAC,2BAA2B,CAAC;EAC9C;AACF,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_constants","require","_typeddash","DEBUG","debug","args","console","log","exports","sksgHostConfig","supportsMutation","isPrimaryRenderer","supportsPersistence","supportsHydration","scheduleTimeout","setTimeout","cancelTimeout","clearTimeout","noTimeout","getRootHostContext","_rootContainerInstance","getChildHostContext","_parentHostContext","_type","shouldSetTextContent","_props","createTextInstance","_text","_hostContext","_internalInstanceHandle","Error","createInstance","type","propsWithChildren","container","children","props","registerValues","instance","appendInitialChild","parentInstance","child","push","finalizeInitialChildren","commitMount","prepareForCommit","_containerInfo","resetAfterCommit","redraw","getPublicInstance","node","commitTextUpdate","_textInstance","_oldText","_newText","clearContainer","clear","prepareUpdate","_instance","oldProps","newProps","propsAreEqual","shallowEq","unregisterValues","preparePortalMount","cloneInstance","_updatePayload","_oldProps","keepChildren","_recyclableInstance","createContainerChildSet","appendChildToContainerChildSet","childSet","finalizeContainerChildren","newChildren","root","replaceContainerChildren","cloneHiddenInstance","cloneHiddenTextInstance","getCurrentEventPriority","DefaultEventPriority","beforeActiveInstanceBlur","afterActiveInstanceBlur","detachDeletedInstance","getInstanceFromNode","_node","prepareScopeUpdate","_scopeInstance","getInstanceFromScope"],"sources":["HostConfig.ts"],"sourcesContent":["/*global NodeJS*/\nimport type { Fiber, HostConfig } from \"react-reconciler\";\nimport { DefaultEventPriority } from \"react-reconciler/constants\";\n\nimport type { NodeType } from \"../dom/types\";\nimport { shallowEq } from \"../renderer/typeddash\";\n\nimport type { Node } from \"./Node\";\nimport type { Container } from \"./Container\";\n\nconst DEBUG = false;\nexport const debug = (...args: Parameters<typeof console.log>) => {\n if (DEBUG) {\n console.log(...args);\n }\n};\n\ntype Instance = Node;\n\ntype Props = object;\ntype TextInstance = Node;\ntype SuspenseInstance = Instance;\ntype HydratableInstance = Instance;\ntype PublicInstance = Instance;\ntype HostContext = null;\ntype UpdatePayload = Container;\ntype ChildSet = Node[];\ntype TimeoutHandle = NodeJS.Timeout;\ntype NoTimeout = -1;\n\ntype SkiaHostConfig = HostConfig<\n NodeType,\n Props,\n Container,\n Instance,\n TextInstance,\n SuspenseInstance,\n HydratableInstance,\n PublicInstance,\n HostContext,\n UpdatePayload,\n ChildSet,\n TimeoutHandle,\n NoTimeout\n>;\n\nexport const sksgHostConfig: SkiaHostConfig = {\n /**\n * This function is used by the reconciler in order to calculate current time for prioritising work.\n */\n supportsMutation: false,\n isPrimaryRenderer: false,\n supportsPersistence: true,\n supportsHydration: false,\n //supportsMicrotask: true,\n scheduleTimeout: setTimeout,\n cancelTimeout: clearTimeout,\n noTimeout: -1,\n\n getRootHostContext: (_rootContainerInstance: Container) => {\n debug(\"getRootHostContext\");\n return null;\n },\n\n getChildHostContext(_parentHostContext, _type, _rootContainerInstance) {\n debug(\"getChildHostContext\");\n return null;\n },\n\n shouldSetTextContent(_type, _props) {\n return false;\n },\n\n createTextInstance(\n _text,\n _rootContainerInstance,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createTextInstance\");\n // return SpanNode({}, text) as SkNode;\n throw new Error(\"Text nodes are not supported yet\");\n },\n\n createInstance(\n type,\n propsWithChildren,\n container,\n _hostContext,\n _internalInstanceHandle\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { children, ...props } = propsWithChildren as any;\n debug(\"createInstance\", type);\n container.registerValues(props);\n const instance = {\n type,\n props,\n children: [],\n };\n return instance;\n },\n\n appendInitialChild(parentInstance: Instance, child: Instance | TextInstance) {\n parentInstance.children.push(child);\n },\n\n finalizeInitialChildren(\n parentInstance,\n _type,\n _props,\n _rootContainerInstance,\n _hostContext\n ) {\n debug(\"finalizeInitialChildren\", parentInstance);\n return false;\n },\n\n commitMount() {\n // if finalizeInitialChildren = true\n debug(\"commitMount\");\n },\n\n prepareForCommit(_containerInfo) {\n debug(\"prepareForCommit\");\n return null;\n },\n\n resetAfterCommit(container) {\n debug(\"resetAfterCommit\");\n container.redraw();\n },\n\n getPublicInstance(node: Instance) {\n debug(\"getPublicInstance\");\n return node;\n },\n\n commitTextUpdate: (\n _textInstance: TextInstance,\n _oldText: string,\n _newText: string\n ) => {\n // textInstance.instance = newText;\n },\n\n clearContainer: (container) => {\n debug(\"clearContainer\");\n container.clear();\n },\n\n prepareUpdate(\n _instance: Instance,\n _type: string,\n oldProps: Props,\n newProps: Props,\n container: Container,\n _hostContext: HostContext\n ) {\n debug(\"prepareUpdate\");\n const propsAreEqual = shallowEq(oldProps, newProps);\n if (propsAreEqual) {\n return null;\n }\n container.unregisterValues(oldProps);\n container.registerValues(newProps);\n return container;\n },\n\n preparePortalMount: () => {\n debug(\"preparePortalMount\");\n },\n\n cloneInstance(\n instance,\n _updatePayload,\n _type,\n _oldProps,\n newProps,\n _internalInstanceHandle,\n keepChildren: boolean,\n _recyclableInstance: null | Instance\n ) {\n debug(\"cloneInstance\");\n\n return {\n type: instance.type,\n props: newProps,\n children: keepChildren ? [...instance.children] : [],\n };\n },\n\n createContainerChildSet(): ChildSet {\n debug(\"createContainerChildSet\");\n return [];\n },\n\n appendChildToContainerChildSet(\n childSet: ChildSet,\n child: Instance | TextInstance\n ): void {\n childSet.push(child);\n },\n\n finalizeContainerChildren(container: Container, newChildren: ChildSet) {\n debug(\"finalizeContainerChildren\");\n container.root = newChildren;\n },\n\n replaceContainerChildren(container: Container, newChildren: ChildSet) {\n debug(\"replaceContainerChildren\");\n container.root = newChildren;\n },\n\n cloneHiddenInstance(\n _instance: Instance,\n _type: string,\n _props: Props\n ): Instance {\n debug(\"cloneHiddenInstance\");\n throw new Error(\"Not yet implemented.\");\n },\n\n cloneHiddenTextInstance(_instance: Instance, _text: string): TextInstance {\n debug(\"cloneHiddenTextInstance\");\n throw new Error(\"Not yet implemented.\");\n },\n // see https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874\n getCurrentEventPriority: () => DefaultEventPriority,\n beforeActiveInstanceBlur: () => {},\n afterActiveInstanceBlur: () => {},\n detachDeletedInstance: () => {},\n getInstanceFromNode: function (_node): Fiber | null | undefined {\n throw new Error(\"Function not implemented.\");\n },\n prepareScopeUpdate: function (_scopeInstance, _instance): void {\n throw new Error(\"Function not implemented.\");\n },\n getInstanceFromScope: function (_scopeInstance): Instance | null {\n throw new Error(\"Function not implemented.\");\n },\n};\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AALA;;AAUA,MAAME,KAAK,GAAG,KAAK;AACZ,MAAMC,KAAK,GAAGA,CAAC,GAAGC,IAAoC,KAAK;EAChE,IAAIF,KAAK,EAAE;IACTG,OAAO,CAACC,GAAG,CAAC,GAAGF,IAAI,CAAC;EACtB;AACF,CAAC;AAACG,OAAA,CAAAJ,KAAA,GAAAA,KAAA;AA+BK,MAAMK,cAA8B,GAAAD,OAAA,CAAAC,cAAA,GAAG;EAC5C;AACF;AACA;EACEC,gBAAgB,EAAE,KAAK;EACvBC,iBAAiB,EAAE,KAAK;EACxBC,mBAAmB,EAAE,IAAI;EACzBC,iBAAiB,EAAE,KAAK;EACxB;EACAC,eAAe,EAAEC,UAAU;EAC3BC,aAAa,EAAEC,YAAY;EAC3BC,SAAS,EAAE,CAAC,CAAC;EAEbC,kBAAkB,EAAGC,sBAAiC,IAAK;IACzDh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AC7D,MAAM,IAAI5B,KAAK,CAAC,2BAA2B,CAAC;EAC9C,CAAC;EACD0D,oBAAoB,EAAE,SAAAA,CAAUD,cAAc,EAAmB;IAC/D,MAAM,IAAIzD,KAAK,CAAC,2BAA2B,CAAC;EAC9C;AACF,CAAC","ignoreList":[]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { NodeType } from "../dom/types";
|
2
|
+
export interface Node<Props = unknown> {
|
3
|
+
type: NodeType;
|
4
|
+
props: Props;
|
5
|
+
children: Node[];
|
6
|
+
}
|
7
|
+
export declare const isColorFilter: (type: NodeType) => type is NodeType.MatrixColorFilter | NodeType.BlendColorFilter | NodeType.LinearToSRGBGammaColorFilter | NodeType.SRGBToLinearGammaColorFilter | NodeType.LumaColorFilter | NodeType.LerpColorFilter;
|
8
|
+
export declare const isPathEffect: (type: NodeType) => type is NodeType.DiscretePathEffect | NodeType.DashPathEffect | NodeType.Path1DPathEffect | NodeType.Path2DPathEffect | NodeType.CornerPathEffect | NodeType.SumPathEffect | NodeType.Line2DPathEffect;
|
9
|
+
export declare const isImageFilter: (type: NodeType) => type is NodeType.OffsetImageFilter | NodeType.DisplacementMapImageFilter | NodeType.BlurImageFilter | NodeType.DropShadowImageFilter | NodeType.MorphologyImageFilter | NodeType.BlendImageFilter | NodeType.RuntimeShaderImageFilter;
|
10
|
+
export declare const isShader: (type: NodeType) => type is NodeType.Shader | NodeType.ImageShader | NodeType.ColorShader | NodeType.Turbulence | NodeType.FractalNoise | NodeType.LinearGradient | NodeType.RadialGradient | NodeType.SweepGradient | NodeType.TwoPointConicalGradient;
|
11
|
+
export declare const sortNodeChildren: (parent: Node) => {
|
12
|
+
colorFilters: Node<unknown>[];
|
13
|
+
drawings: Node<unknown>[];
|
14
|
+
maskFilters: Node<unknown>[];
|
15
|
+
shaders: Node<unknown>[];
|
16
|
+
pathEffects: Node<unknown>[];
|
17
|
+
imageFilters: Node<unknown>[];
|
18
|
+
paints: Node<unknown>[];
|
19
|
+
};
|
@@ -0,0 +1,78 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.sortNodeChildren = exports.isShader = exports.isPathEffect = exports.isImageFilter = exports.isColorFilter = void 0;
|
7
|
+
var _types = require("../dom/types");
|
8
|
+
const isColorFilter = type => {
|
9
|
+
"worklet";
|
10
|
+
|
11
|
+
return type === _types.NodeType.BlendColorFilter || type === _types.NodeType.MatrixColorFilter || type === _types.NodeType.LerpColorFilter || type === _types.NodeType.LumaColorFilter || type === _types.NodeType.SRGBToLinearGammaColorFilter || type === _types.NodeType.LinearToSRGBGammaColorFilter;
|
12
|
+
};
|
13
|
+
exports.isColorFilter = isColorFilter;
|
14
|
+
const isPathEffect = type => {
|
15
|
+
"worklet";
|
16
|
+
|
17
|
+
return type === _types.NodeType.DiscretePathEffect || type === _types.NodeType.DashPathEffect || type === _types.NodeType.Path1DPathEffect || type === _types.NodeType.Path2DPathEffect || type === _types.NodeType.CornerPathEffect || type === _types.NodeType.SumPathEffect || type === _types.NodeType.Line2DPathEffect;
|
18
|
+
};
|
19
|
+
exports.isPathEffect = isPathEffect;
|
20
|
+
const isImageFilter = type => {
|
21
|
+
"worklet";
|
22
|
+
|
23
|
+
return type === _types.NodeType.OffsetImageFilter || type === _types.NodeType.DisplacementMapImageFilter || type === _types.NodeType.BlurImageFilter || type === _types.NodeType.DropShadowImageFilter || type === _types.NodeType.MorphologyImageFilter || type === _types.NodeType.BlendImageFilter || type === _types.NodeType.RuntimeShaderImageFilter;
|
24
|
+
};
|
25
|
+
exports.isImageFilter = isImageFilter;
|
26
|
+
const isShader = type => {
|
27
|
+
"worklet";
|
28
|
+
|
29
|
+
return type === _types.NodeType.Shader || type === _types.NodeType.ImageShader || type === _types.NodeType.ColorShader || type === _types.NodeType.Turbulence || type === _types.NodeType.FractalNoise || type === _types.NodeType.LinearGradient || type === _types.NodeType.RadialGradient || type === _types.NodeType.SweepGradient || type === _types.NodeType.TwoPointConicalGradient;
|
30
|
+
};
|
31
|
+
exports.isShader = isShader;
|
32
|
+
const sortNodeChildren = parent => {
|
33
|
+
"worklet";
|
34
|
+
|
35
|
+
const maskFilters = [];
|
36
|
+
const colorFilters = [];
|
37
|
+
const shaders = [];
|
38
|
+
const imageFilters = [];
|
39
|
+
const pathEffects = [];
|
40
|
+
const drawings = [];
|
41
|
+
const paints = [];
|
42
|
+
parent.children.forEach(node => {
|
43
|
+
if (isColorFilter(node.type)) {
|
44
|
+
colorFilters.push(node);
|
45
|
+
} else if (node.type === _types.NodeType.BlurMaskFilter) {
|
46
|
+
maskFilters.push(node);
|
47
|
+
} else if (isPathEffect(node.type)) {
|
48
|
+
pathEffects.push(node);
|
49
|
+
} else if (isImageFilter(node.type)) {
|
50
|
+
imageFilters.push(node);
|
51
|
+
} else if (isShader(node.type)) {
|
52
|
+
shaders.push(node);
|
53
|
+
} else if (node.type === _types.NodeType.Paint) {
|
54
|
+
paints.push(node);
|
55
|
+
} else if (node.type === _types.NodeType.Blend) {
|
56
|
+
if (node.children[0] && isImageFilter(node.children[0].type)) {
|
57
|
+
node.type = _types.NodeType.BlendImageFilter;
|
58
|
+
imageFilters.push(node);
|
59
|
+
} else {
|
60
|
+
node.type = _types.NodeType.Blend;
|
61
|
+
shaders.push(node);
|
62
|
+
}
|
63
|
+
} else {
|
64
|
+
drawings.push(node);
|
65
|
+
}
|
66
|
+
});
|
67
|
+
return {
|
68
|
+
colorFilters,
|
69
|
+
drawings,
|
70
|
+
maskFilters,
|
71
|
+
shaders,
|
72
|
+
pathEffects,
|
73
|
+
imageFilters,
|
74
|
+
paints
|
75
|
+
};
|
76
|
+
};
|
77
|
+
exports.sortNodeChildren = sortNodeChildren;
|
78
|
+
//# sourceMappingURL=Node.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_types","require","isColorFilter","type","NodeType","BlendColorFilter","MatrixColorFilter","LerpColorFilter","LumaColorFilter","SRGBToLinearGammaColorFilter","LinearToSRGBGammaColorFilter","exports","isPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","CornerPathEffect","SumPathEffect","Line2DPathEffect","isImageFilter","OffsetImageFilter","DisplacementMapImageFilter","BlurImageFilter","DropShadowImageFilter","MorphologyImageFilter","BlendImageFilter","RuntimeShaderImageFilter","isShader","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","sortNodeChildren","parent","maskFilters","colorFilters","shaders","imageFilters","pathEffects","drawings","paints","children","forEach","node","push","BlurMaskFilter","Paint","Blend"],"sources":["Node.ts"],"sourcesContent":["import { NodeType } from \"../dom/types\";\n\nexport interface Node<Props = unknown> {\n type: NodeType;\n props: Props;\n children: Node[];\n}\n\nexport const isColorFilter = (type: NodeType) => {\n \"worklet\";\n return (\n type === NodeType.BlendColorFilter ||\n type === NodeType.MatrixColorFilter ||\n type === NodeType.LerpColorFilter ||\n type === NodeType.LumaColorFilter ||\n type === NodeType.SRGBToLinearGammaColorFilter ||\n type === NodeType.LinearToSRGBGammaColorFilter\n );\n};\n\nexport const isPathEffect = (type: NodeType) => {\n \"worklet\";\n return (\n type === NodeType.DiscretePathEffect ||\n type === NodeType.DashPathEffect ||\n type === NodeType.Path1DPathEffect ||\n type === NodeType.Path2DPathEffect ||\n type === NodeType.CornerPathEffect ||\n type === NodeType.SumPathEffect ||\n type === NodeType.Line2DPathEffect\n );\n};\n\nexport const isImageFilter = (type: NodeType) => {\n \"worklet\";\n return (\n type === NodeType.OffsetImageFilter ||\n type === NodeType.DisplacementMapImageFilter ||\n type === NodeType.BlurImageFilter ||\n type === NodeType.DropShadowImageFilter ||\n type === NodeType.MorphologyImageFilter ||\n type === NodeType.BlendImageFilter ||\n type === NodeType.RuntimeShaderImageFilter\n );\n};\n\nexport const isShader = (type: NodeType) => {\n \"worklet\";\n return (\n type === NodeType.Shader ||\n type === NodeType.ImageShader ||\n type === NodeType.ColorShader ||\n type === NodeType.Turbulence ||\n type === NodeType.FractalNoise ||\n type === NodeType.LinearGradient ||\n type === NodeType.RadialGradient ||\n type === NodeType.SweepGradient ||\n type === NodeType.TwoPointConicalGradient\n );\n};\n\nexport const sortNodeChildren = (parent: Node) => {\n \"worklet\";\n const maskFilters: Node[] = [];\n const colorFilters: Node[] = [];\n const shaders: Node[] = [];\n const imageFilters: Node[] = [];\n const pathEffects: Node[] = [];\n const drawings: Node[] = [];\n const paints: Node[] = [];\n parent.children.forEach((node) => {\n if (isColorFilter(node.type)) {\n colorFilters.push(node);\n } else if (node.type === NodeType.BlurMaskFilter) {\n maskFilters.push(node);\n } else if (isPathEffect(node.type)) {\n pathEffects.push(node);\n } else if (isImageFilter(node.type)) {\n imageFilters.push(node);\n } else if (isShader(node.type)) {\n shaders.push(node);\n } else if (node.type === NodeType.Paint) {\n paints.push(node);\n } else if (node.type === NodeType.Blend) {\n if (node.children[0] && isImageFilter(node.children[0].type)) {\n node.type = NodeType.BlendImageFilter;\n imageFilters.push(node);\n } else {\n node.type = NodeType.Blend;\n shaders.push(node);\n }\n } else {\n drawings.push(node);\n }\n });\n return {\n colorFilters,\n drawings,\n maskFilters,\n shaders,\n pathEffects,\n imageFilters,\n paints,\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAQO,MAAMC,aAAa,GAAIC,IAAc,IAAK;EAC/C,SAAS;;EACT,OACEA,IAAI,KAAKC,eAAQ,CAACC,gBAAgB,IAClCF,IAAI,KAAKC,eAAQ,CAACE,iBAAiB,IACnCH,IAAI,KAAKC,eAAQ,CAACG,eAAe,IACjCJ,IAAI,KAAKC,eAAQ,CAACI,eAAe,IACjCL,IAAI,KAAKC,eAAQ,CAACK,4BAA4B,IAC9CN,IAAI,KAAKC,eAAQ,CAACM,4BAA4B;AAElD,CAAC;AAACC,OAAA,CAAAT,aAAA,GAAAA,aAAA;AAEK,MAAMU,YAAY,GAAIT,IAAc,IAAK;EAC9C,S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C,IAAI3B,aAAa,CAAC6B,IAAI,CAACF,QAAQ,CAAC,CAAC,CAAC,CAAC5C,IAAI,CAAC,EAAE;QAC5D8C,IAAI,CAAC9C,IAAI,GAAGC,eAAQ,CAACsB,gBAAgB;QACrCiB,YAAY,CAACO,IAAI,CAACD,IAAI,CAAC;MACzB,CAAC,MAAM;QACLA,IAAI,CAAC9C,IAAI,GAAGC,eAAQ,CAACiD,KAAK;QAC1BX,OAAO,CAACQ,IAAI,CAACD,IAAI,CAAC;MACpB;IACF,CAAC,MAAM;MACLJ,QAAQ,CAACK,IAAI,CAACD,IAAI,CAAC;IACrB;EACF,CAAC,CAAC;EACF,OAAO;IACLR,YAAY;IACZI,QAAQ;IACRL,WAAW;IACXE,OAAO;IACPE,WAAW;IACXD,YAAY;IACZG;EACF,CAAC;AACH,CAAC;AAACnC,OAAA,CAAA2B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import type { SharedValue } from "react-native-reanimated";
|
2
|
+
import type { BlurMaskFilterProps, CircleProps, CTMProps, ImageProps, PointsProps, PathProps, RectProps, RoundedRectProps, OvalProps, LineProps, PatchProps, VerticesProps, DiffRectProps, TextProps, TextPathProps, TextBlobProps, GlyphsProps, PictureProps, ImageSVGProps, ParagraphProps, AtlasProps, DrawingNodeProps } from "../../dom/types";
|
3
|
+
export declare enum CommandType {
|
4
|
+
SavePaint = 0,
|
5
|
+
RestorePaint = 1,
|
6
|
+
SaveCTM = 2,
|
7
|
+
RestoreCTM = 3,
|
8
|
+
PushColorFilter = 4,
|
9
|
+
PushBlurMaskFilter = 5,
|
10
|
+
PushImageFilter = 6,
|
11
|
+
PushPathEffect = 7,
|
12
|
+
PushShader = 8,
|
13
|
+
ComposeColorFilter = 9,
|
14
|
+
ComposeImageFilter = 10,
|
15
|
+
ComposePathEffect = 11,
|
16
|
+
MaterializePaint = 12,
|
17
|
+
SaveBackdropFilter = 13,
|
18
|
+
SaveLayer = 14,
|
19
|
+
RestorePaintDeclaration = 15,
|
20
|
+
DrawBox = 16,
|
21
|
+
DrawImage = 17,
|
22
|
+
DrawCircle = 18,
|
23
|
+
DrawPaint = 19,
|
24
|
+
DrawPoints = 20,
|
25
|
+
DrawPath = 21,
|
26
|
+
DrawRect = 22,
|
27
|
+
DrawRRect = 23,
|
28
|
+
DrawOval = 24,
|
29
|
+
DrawLine = 25,
|
30
|
+
DrawPatch = 26,
|
31
|
+
DrawVertices = 27,
|
32
|
+
DrawDiffRect = 28,
|
33
|
+
DrawText = 29,
|
34
|
+
DrawTextPath = 30,
|
35
|
+
DrawTextBlob = 31,
|
36
|
+
DrawGlyphs = 32,
|
37
|
+
DrawPicture = 33,
|
38
|
+
DrawImageSVG = 34,
|
39
|
+
DrawParagraph = 35,
|
40
|
+
DrawAtlas = 36
|
41
|
+
}
|
42
|
+
export type Command<T extends CommandType = CommandType> = {
|
43
|
+
type: T;
|
44
|
+
[key: string]: unknown;
|
45
|
+
};
|
46
|
+
export declare const materializeProps: (command: {
|
47
|
+
props: Record<string, unknown>;
|
48
|
+
animatedProps?: Record<string, SharedValue<unknown>>;
|
49
|
+
}) => void;
|
50
|
+
export declare const isCommand: <T extends CommandType>(command: Command, type: T) => command is Command<T>;
|
51
|
+
interface Props {
|
52
|
+
[CommandType.DrawImage]: ImageProps;
|
53
|
+
[CommandType.DrawCircle]: CircleProps;
|
54
|
+
[CommandType.SaveCTM]: CTMProps;
|
55
|
+
[CommandType.SavePaint]: DrawingNodeProps;
|
56
|
+
[CommandType.PushBlurMaskFilter]: BlurMaskFilterProps;
|
57
|
+
[CommandType.DrawPoints]: PointsProps;
|
58
|
+
[CommandType.DrawPath]: PathProps;
|
59
|
+
[CommandType.DrawRect]: RectProps;
|
60
|
+
[CommandType.DrawRRect]: RoundedRectProps;
|
61
|
+
[CommandType.DrawOval]: OvalProps;
|
62
|
+
[CommandType.DrawLine]: LineProps;
|
63
|
+
[CommandType.DrawPatch]: PatchProps;
|
64
|
+
[CommandType.DrawVertices]: VerticesProps;
|
65
|
+
[CommandType.DrawDiffRect]: DiffRectProps;
|
66
|
+
[CommandType.DrawText]: TextProps;
|
67
|
+
[CommandType.DrawTextPath]: TextPathProps;
|
68
|
+
[CommandType.DrawTextBlob]: TextBlobProps;
|
69
|
+
[CommandType.DrawGlyphs]: GlyphsProps;
|
70
|
+
[CommandType.DrawPicture]: PictureProps;
|
71
|
+
[CommandType.DrawImageSVG]: ImageSVGProps;
|
72
|
+
[CommandType.DrawParagraph]: ParagraphProps;
|
73
|
+
[CommandType.DrawAtlas]: AtlasProps;
|
74
|
+
}
|
75
|
+
interface DrawCommand<T extends CommandType> extends Command<T> {
|
76
|
+
props: T extends keyof Props ? Props[T] : never;
|
77
|
+
}
|
78
|
+
export declare const isDrawCommand: <T extends keyof Props>(command: Command, type: T) => command is DrawCommand<T>;
|
79
|
+
export {};
|
@@ -0,0 +1,110 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.materializeProps = exports.isDrawCommand = exports.isCommand = exports.CommandType = void 0;
|
7
|
+
// export enum CommandType {
|
8
|
+
// // Context
|
9
|
+
// SavePaint = "SavePaint",
|
10
|
+
// RestorePaint = "RestorePaint",
|
11
|
+
// SaveCTM = "SaveCTM",
|
12
|
+
// RestoreCTM = "RestoreCTM",
|
13
|
+
// PushColorFilter = "PushColorFilter",
|
14
|
+
// PushBlurMaskFilter = "PushBlurMaskFilter",
|
15
|
+
// PushImageFilter = "PushImageFilter",
|
16
|
+
// PushPathEffect = "PushPathEffect",
|
17
|
+
// PushShader = "PushShader",
|
18
|
+
// ComposeColorFilter = "ComposeColorFilter",
|
19
|
+
// ComposeImageFilter = "ComposeImageFilter",
|
20
|
+
// ComposePathEffect = "ComposePathEffect",
|
21
|
+
// MaterializePaint = "MaterializePaint",
|
22
|
+
// SaveBackdropFilter = "SaveBackdropFilter",
|
23
|
+
// SaveLayer = "SaveLayer",
|
24
|
+
// RestorePaintDeclaration = "RestorePaintDeclaration",
|
25
|
+
// // Drawing
|
26
|
+
// DrawBox = "DrawBox",
|
27
|
+
// DrawImage = "DrawImage",
|
28
|
+
// DrawCircle = "DrawCircle",
|
29
|
+
// DrawPaint = "DrawPaint",
|
30
|
+
// DrawPoints = "DrawPoints",
|
31
|
+
// DrawPath = "DrawPath",
|
32
|
+
// DrawRect = "DrawRect",
|
33
|
+
// DrawRRect = "DrawRRect",
|
34
|
+
// DrawOval = "DrawOval",
|
35
|
+
// DrawLine = "DrawLine",
|
36
|
+
// DrawPatch = "DrawPatch",
|
37
|
+
// DrawVertices = "DrawVertices",
|
38
|
+
// DrawDiffRect = "DrawDiffRect",
|
39
|
+
// DrawText = "DrawText",
|
40
|
+
// DrawTextPath = "DrawTextPath",
|
41
|
+
// DrawTextBlob = "DrawTextBlob",
|
42
|
+
// DrawGlyphs = "DrawGlyphs",
|
43
|
+
// DrawPicture = "DrawPicture",
|
44
|
+
// DrawImageSVG = "DrawImageSVG",
|
45
|
+
// DrawParagraph = "DrawParagraph",
|
46
|
+
// DrawAtlas = "DrawAtlas",
|
47
|
+
// }
|
48
|
+
let CommandType = exports.CommandType = /*#__PURE__*/function (CommandType) {
|
49
|
+
CommandType[CommandType["SavePaint"] = 0] = "SavePaint";
|
50
|
+
CommandType[CommandType["RestorePaint"] = 1] = "RestorePaint";
|
51
|
+
CommandType[CommandType["SaveCTM"] = 2] = "SaveCTM";
|
52
|
+
CommandType[CommandType["RestoreCTM"] = 3] = "RestoreCTM";
|
53
|
+
CommandType[CommandType["PushColorFilter"] = 4] = "PushColorFilter";
|
54
|
+
CommandType[CommandType["PushBlurMaskFilter"] = 5] = "PushBlurMaskFilter";
|
55
|
+
CommandType[CommandType["PushImageFilter"] = 6] = "PushImageFilter";
|
56
|
+
CommandType[CommandType["PushPathEffect"] = 7] = "PushPathEffect";
|
57
|
+
CommandType[CommandType["PushShader"] = 8] = "PushShader";
|
58
|
+
CommandType[CommandType["ComposeColorFilter"] = 9] = "ComposeColorFilter";
|
59
|
+
CommandType[CommandType["ComposeImageFilter"] = 10] = "ComposeImageFilter";
|
60
|
+
CommandType[CommandType["ComposePathEffect"] = 11] = "ComposePathEffect";
|
61
|
+
CommandType[CommandType["MaterializePaint"] = 12] = "MaterializePaint";
|
62
|
+
CommandType[CommandType["SaveBackdropFilter"] = 13] = "SaveBackdropFilter";
|
63
|
+
CommandType[CommandType["SaveLayer"] = 14] = "SaveLayer";
|
64
|
+
CommandType[CommandType["RestorePaintDeclaration"] = 15] = "RestorePaintDeclaration";
|
65
|
+
CommandType[CommandType["DrawBox"] = 16] = "DrawBox";
|
66
|
+
CommandType[CommandType["DrawImage"] = 17] = "DrawImage";
|
67
|
+
CommandType[CommandType["DrawCircle"] = 18] = "DrawCircle";
|
68
|
+
CommandType[CommandType["DrawPaint"] = 19] = "DrawPaint";
|
69
|
+
CommandType[CommandType["DrawPoints"] = 20] = "DrawPoints";
|
70
|
+
CommandType[CommandType["DrawPath"] = 21] = "DrawPath";
|
71
|
+
CommandType[CommandType["DrawRect"] = 22] = "DrawRect";
|
72
|
+
CommandType[CommandType["DrawRRect"] = 23] = "DrawRRect";
|
73
|
+
CommandType[CommandType["DrawOval"] = 24] = "DrawOval";
|
74
|
+
CommandType[CommandType["DrawLine"] = 25] = "DrawLine";
|
75
|
+
CommandType[CommandType["DrawPatch"] = 26] = "DrawPatch";
|
76
|
+
CommandType[CommandType["DrawVertices"] = 27] = "DrawVertices";
|
77
|
+
CommandType[CommandType["DrawDiffRect"] = 28] = "DrawDiffRect";
|
78
|
+
CommandType[CommandType["DrawText"] = 29] = "DrawText";
|
79
|
+
CommandType[CommandType["DrawTextPath"] = 30] = "DrawTextPath";
|
80
|
+
CommandType[CommandType["DrawTextBlob"] = 31] = "DrawTextBlob";
|
81
|
+
CommandType[CommandType["DrawGlyphs"] = 32] = "DrawGlyphs";
|
82
|
+
CommandType[CommandType["DrawPicture"] = 33] = "DrawPicture";
|
83
|
+
CommandType[CommandType["DrawImageSVG"] = 34] = "DrawImageSVG";
|
84
|
+
CommandType[CommandType["DrawParagraph"] = 35] = "DrawParagraph";
|
85
|
+
CommandType[CommandType["DrawAtlas"] = 36] = "DrawAtlas";
|
86
|
+
return CommandType;
|
87
|
+
}({});
|
88
|
+
const materializeProps = command => {
|
89
|
+
"worklet";
|
90
|
+
|
91
|
+
if (command.animatedProps) {
|
92
|
+
for (const key in command.animatedProps) {
|
93
|
+
command.props[key] = command.animatedProps[key].value;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
};
|
97
|
+
exports.materializeProps = materializeProps;
|
98
|
+
const isCommand = (command, type) => {
|
99
|
+
"worklet";
|
100
|
+
|
101
|
+
return command.type === type;
|
102
|
+
};
|
103
|
+
exports.isCommand = isCommand;
|
104
|
+
const isDrawCommand = (command, type) => {
|
105
|
+
"worklet";
|
106
|
+
|
107
|
+
return command.type === type;
|
108
|
+
};
|
109
|
+
exports.isDrawCommand = isDrawCommand;
|
110
|
+
//# sourceMappingURL=Core.js.map
|