@shopify/react-native-skia 1.11.1 → 1.11.3
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +0 -8
- package/android/cpp/jni/JniLoad.cpp +0 -2
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -1
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerDelegate.java +4 -2
- package/cpp/jsi/ViewProperty.h +5 -16
- package/cpp/rnskia/RNSkManager.cpp +1 -7
- package/lib/commonjs/dom/nodes/index.d.ts +0 -1
- package/lib/commonjs/dom/nodes/index.js +0 -11
- package/lib/commonjs/dom/nodes/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -6
- package/lib/commonjs/external/reanimated/renderHelpers.js +0 -73
- package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/commonjs/index.d.ts +0 -1
- package/lib/commonjs/index.js +0 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.d.ts +10 -1
- package/lib/commonjs/renderer/Canvas.js +3 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/sksg/Container.d.ts +2 -0
- package/lib/commonjs/sksg/Container.js +10 -0
- package/lib/commonjs/sksg/Container.js.map +1 -1
- package/lib/commonjs/sksg/Elements.d.ts +65 -0
- package/lib/commonjs/sksg/Elements.js +6 -0
- package/lib/commonjs/sksg/Elements.js.map +1 -0
- package/lib/commonjs/sksg/Reconciler.d.ts +1 -0
- package/lib/commonjs/sksg/Reconciler.js +2 -0
- package/lib/commonjs/sksg/Reconciler.js.map +1 -1
- package/lib/commonjs/views/index.d.ts +0 -1
- package/lib/commonjs/views/index.js +0 -11
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/module/dom/nodes/index.d.ts +0 -1
- package/lib/module/dom/nodes/index.js +0 -1
- package/lib/module/dom/nodes/index.js.map +1 -1
- package/lib/module/external/reanimated/renderHelpers.d.ts +0 -6
- package/lib/module/external/reanimated/renderHelpers.js +0 -68
- package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/module/index.d.ts +0 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/renderer/Canvas.d.ts +10 -1
- package/lib/module/renderer/Canvas.js +1 -0
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/sksg/Container.d.ts +2 -0
- package/lib/module/sksg/Container.js +10 -0
- package/lib/module/sksg/Container.js.map +1 -1
- package/lib/module/sksg/Elements.d.ts +65 -0
- package/lib/module/sksg/Elements.js +2 -0
- package/lib/module/sksg/Elements.js.map +1 -0
- package/lib/module/sksg/Reconciler.d.ts +1 -0
- package/lib/module/sksg/Reconciler.js +2 -0
- package/lib/module/sksg/Reconciler.js.map +1 -1
- package/lib/module/views/index.d.ts +0 -1
- package/lib/module/views/index.js +0 -1
- package/lib/module/views/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -3
- package/lib/typescript/lib/commonjs/renderer/Canvas.d.ts +1 -0
- package/lib/typescript/lib/commonjs/sksg/Container.d.ts +2 -0
- package/lib/typescript/lib/commonjs/sksg/Elements.d.ts +1 -0
- package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +6 -0
- package/lib/typescript/lib/module/dom/nodes/index.d.ts +0 -1
- package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +0 -3
- package/lib/typescript/lib/module/index.d.ts +0 -1
- package/lib/typescript/lib/module/mock/index.d.ts +0 -1
- package/lib/typescript/lib/module/renderer/Canvas.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/Container.d.ts +2 -0
- package/lib/typescript/lib/module/sksg/Elements.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/Reconciler.d.ts +6 -0
- package/lib/typescript/lib/module/views/index.d.ts +0 -1
- package/lib/typescript/src/dom/nodes/index.d.ts +0 -1
- package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +0 -6
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +10 -1
- package/lib/typescript/src/sksg/Container.d.ts +2 -0
- package/lib/typescript/src/sksg/Elements.d.ts +65 -0
- package/lib/typescript/src/sksg/Reconciler.d.ts +1 -0
- package/lib/typescript/src/views/index.d.ts +0 -1
- package/package.json +1 -1
- package/react-native-skia.podspec +1 -1
- package/src/dom/nodes/index.ts +0 -1
- package/src/external/reanimated/renderHelpers.ts +1 -78
- package/src/index.ts +0 -1
- package/src/renderer/Canvas.tsx +11 -1
- package/src/sksg/Container.ts +11 -0
- package/src/sksg/Elements.tsx +136 -0
- package/src/sksg/Reconciler.ts +2 -0
- package/src/views/index.ts +0 -1
- package/android/cpp/jni/include/JniSkiaDomView.h +0 -82
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomView.java +0 -41
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomViewManager.java +0 -32
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerDelegate.java +0 -34
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerInterface.java +0 -18
- package/cpp/rnskia/RNSkDomView.cpp +0 -121
- package/cpp/rnskia/RNSkDomView.h +0 -97
- package/cpp/rnskia/dom/JsiDomApi.h +0 -165
- package/cpp/rnskia/dom/base/BaseNodeProp.h +0 -72
- package/cpp/rnskia/dom/base/ConcatablePaint.cpp +0 -117
- package/cpp/rnskia/dom/base/ConcatablePaint.h +0 -49
- package/cpp/rnskia/dom/base/Declaration.h +0 -86
- package/cpp/rnskia/dom/base/DeclarationContext.h +0 -79
- package/cpp/rnskia/dom/base/DerivedNodeProp.h +0 -203
- package/cpp/rnskia/dom/base/DrawingContext.cpp +0 -55
- package/cpp/rnskia/dom/base/DrawingContext.h +0 -104
- package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +0 -119
- package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +0 -71
- package/cpp/rnskia/dom/base/JsiDomNode.h +0 -572
- package/cpp/rnskia/dom/base/JsiDomRenderNode.h +0 -262
- package/cpp/rnskia/dom/base/NodeProp.h +0 -139
- package/cpp/rnskia/dom/base/NodePropsContainer.h +0 -158
- package/cpp/rnskia/dom/nodes/JsiAtlasNode.h +0 -64
- package/cpp/rnskia/dom/nodes/JsiBackdropFilterNode.h +0 -49
- package/cpp/rnskia/dom/nodes/JsiBlendNode.h +0 -94
- package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +0 -75
- package/cpp/rnskia/dom/nodes/JsiBoxNode.h +0 -94
- package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +0 -33
- package/cpp/rnskia/dom/nodes/JsiCircleNode.h +0 -35
- package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +0 -164
- package/cpp/rnskia/dom/nodes/JsiDiffRectNode.h +0 -37
- package/cpp/rnskia/dom/nodes/JsiFillNode.h +0 -22
- package/cpp/rnskia/dom/nodes/JsiGlyphsNode.h +0 -53
- package/cpp/rnskia/dom/nodes/JsiGroupNode.h +0 -25
- package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +0 -361
- package/cpp/rnskia/dom/nodes/JsiImageNode.h +0 -43
- package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +0 -63
- package/cpp/rnskia/dom/nodes/JsiLayerNode.h +0 -74
- package/cpp/rnskia/dom/nodes/JsiLineNode.h +0 -38
- package/cpp/rnskia/dom/nodes/JsiOvalNode.h +0 -32
- package/cpp/rnskia/dom/nodes/JsiPaintNode.h +0 -119
- package/cpp/rnskia/dom/nodes/JsiParagraphNode.h +0 -62
- package/cpp/rnskia/dom/nodes/JsiPatchNode.h +0 -50
- package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +0 -268
- package/cpp/rnskia/dom/nodes/JsiPathNode.h +0 -181
- package/cpp/rnskia/dom/nodes/JsiPictureNode.h +0 -31
- package/cpp/rnskia/dom/nodes/JsiPointsNode.h +0 -48
- package/cpp/rnskia/dom/nodes/JsiRRectNode.h +0 -33
- package/cpp/rnskia/dom/nodes/JsiRectNode.h +0 -33
- package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +0 -434
- package/cpp/rnskia/dom/nodes/JsiTextBlobNode.h +0 -44
- package/cpp/rnskia/dom/nodes/JsiTextNode.h +0 -51
- package/cpp/rnskia/dom/nodes/JsiTextPathNode.h +0 -33
- package/cpp/rnskia/dom/nodes/JsiVerticesNode.h +0 -41
- package/cpp/rnskia/dom/props/BezierProps.h +0 -65
- package/cpp/rnskia/dom/props/BlendModeProp.h +0 -103
- package/cpp/rnskia/dom/props/BoxShadowProps.h +0 -62
- package/cpp/rnskia/dom/props/CircleProp.h +0 -49
- package/cpp/rnskia/dom/props/ClipProp.h +0 -57
- package/cpp/rnskia/dom/props/ColorProp.h +0 -96
- package/cpp/rnskia/dom/props/FontProp.h +0 -42
- package/cpp/rnskia/dom/props/GlyphsProp.h +0 -55
- package/cpp/rnskia/dom/props/LayerProp.h +0 -52
- package/cpp/rnskia/dom/props/MatrixProp.h +0 -54
- package/cpp/rnskia/dom/props/NumbersProp.h +0 -67
- package/cpp/rnskia/dom/props/PaintProps.h +0 -133
- package/cpp/rnskia/dom/props/ParagraphProp.h +0 -45
- package/cpp/rnskia/dom/props/PathProp.h +0 -59
- package/cpp/rnskia/dom/props/PictureProp.h +0 -40
- package/cpp/rnskia/dom/props/PointProp.h +0 -65
- package/cpp/rnskia/dom/props/PointsProp.h +0 -81
- package/cpp/rnskia/dom/props/RRectProp.h +0 -222
- package/cpp/rnskia/dom/props/RSXformProp.h +0 -52
- package/cpp/rnskia/dom/props/RadiusProp.h +0 -43
- package/cpp/rnskia/dom/props/RectProp.h +0 -164
- package/cpp/rnskia/dom/props/SamplingProp.h +0 -54
- package/cpp/rnskia/dom/props/SkImageProps.h +0 -196
- package/cpp/rnskia/dom/props/StrokeProps.h +0 -79
- package/cpp/rnskia/dom/props/SvgProp.h +0 -45
- package/cpp/rnskia/dom/props/TextBlobProp.h +0 -133
- package/cpp/rnskia/dom/props/TileModeProp.h +0 -52
- package/cpp/rnskia/dom/props/TransformProp.h +0 -147
- package/cpp/rnskia/dom/props/TransformsProps.h +0 -66
- package/cpp/rnskia/dom/props/UniformsProp.h +0 -159
- package/cpp/rnskia/dom/props/VertexModeProp.h +0 -49
- package/cpp/rnskia/dom/props/VerticesProps.h +0 -63
- package/ios/RNSkia-iOS/SkiaDomView.h +0 -7
- package/ios/RNSkia-iOS/SkiaDomView.mm +0 -63
- package/ios/RNSkia-iOS/SkiaDomViewManager.h +0 -8
- package/ios/RNSkia-iOS/SkiaDomViewManager.mm +0 -51
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +0 -64
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +0 -196
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +0 -1
- package/lib/commonjs/renderer/CanvasOld.d.ts +0 -11
- package/lib/commonjs/renderer/CanvasOld.js +0 -96
- package/lib/commonjs/renderer/CanvasOld.js.map +0 -1
- package/lib/commonjs/renderer/Container.d.ts +0 -10
- package/lib/commonjs/renderer/Container.js +0 -26
- package/lib/commonjs/renderer/Container.js.map +0 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +0 -129
- package/lib/commonjs/renderer/HostComponents.js +0 -141
- package/lib/commonjs/renderer/HostComponents.js.map +0 -1
- package/lib/commonjs/renderer/HostConfig.d.ts +0 -18
- package/lib/commonjs/renderer/HostConfig.js +0 -157
- package/lib/commonjs/renderer/HostConfig.js.map +0 -1
- package/lib/commonjs/renderer/Reconciler.d.ts +0 -9
- package/lib/commonjs/renderer/Reconciler.js +0 -44
- package/lib/commonjs/renderer/Reconciler.js.map +0 -1
- package/lib/commonjs/specs/SkiaDomViewNativeComponent.d.ts +0 -6
- package/lib/commonjs/specs/SkiaDomViewNativeComponent.js +0 -11
- package/lib/commonjs/specs/SkiaDomViewNativeComponent.js.map +0 -1
- package/lib/commonjs/views/SkiaDomView.d.ts +0 -33
- package/lib/commonjs/views/SkiaDomView.js +0 -119
- package/lib/commonjs/views/SkiaDomView.js.map +0 -1
- package/lib/commonjs/views/SkiaDomView.web.d.ts +0 -0
- package/lib/commonjs/views/SkiaDomView.web.js +0 -2
- package/lib/commonjs/views/SkiaDomView.web.js.map +0 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +0 -64
- package/lib/module/dom/nodes/JsiSkDOM.js +0 -189
- package/lib/module/dom/nodes/JsiSkDOM.js.map +0 -1
- package/lib/module/renderer/CanvasOld.d.ts +0 -11
- package/lib/module/renderer/CanvasOld.js +0 -87
- package/lib/module/renderer/CanvasOld.js.map +0 -1
- package/lib/module/renderer/Container.d.ts +0 -10
- package/lib/module/renderer/Container.js +0 -19
- package/lib/module/renderer/Container.js.map +0 -1
- package/lib/module/renderer/HostComponents.d.ts +0 -129
- package/lib/module/renderer/HostComponents.js +0 -134
- package/lib/module/renderer/HostComponents.js.map +0 -1
- package/lib/module/renderer/HostConfig.d.ts +0 -18
- package/lib/module/renderer/HostConfig.js +0 -150
- package/lib/module/renderer/HostConfig.js.map +0 -1
- package/lib/module/renderer/Reconciler.d.ts +0 -9
- package/lib/module/renderer/Reconciler.js +0 -36
- package/lib/module/renderer/Reconciler.js.map +0 -1
- package/lib/module/specs/SkiaDomViewNativeComponent.d.ts +0 -6
- package/lib/module/specs/SkiaDomViewNativeComponent.js +0 -4
- package/lib/module/specs/SkiaDomViewNativeComponent.js.map +0 -1
- package/lib/module/views/SkiaDomView.d.ts +0 -33
- package/lib/module/views/SkiaDomView.js +0 -111
- package/lib/module/views/SkiaDomView.js.map +0 -1
- package/lib/module/views/SkiaDomView.web.d.ts +0 -0
- package/lib/module/views/SkiaDomView.web.js +0 -2
- package/lib/module/views/SkiaDomView.web.js.map +0 -1
- package/lib/typescript/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +0 -60
- package/lib/typescript/lib/commonjs/renderer/CanvasOld.d.ts +0 -3
- package/lib/typescript/lib/commonjs/renderer/Container.d.ts +0 -9
- package/lib/typescript/lib/commonjs/renderer/HostComponents.d.ts +0 -2
- package/lib/typescript/lib/commonjs/renderer/HostConfig.d.ts +0 -40
- package/lib/typescript/lib/commonjs/renderer/Reconciler.d.ts +0 -10
- package/lib/typescript/lib/commonjs/specs/SkiaDomViewNativeComponent.d.ts +0 -3
- package/lib/typescript/lib/commonjs/views/SkiaDomView.d.ts +0 -30
- package/lib/typescript/lib/commonjs/views/SkiaDomView.web.d.ts +0 -0
- package/lib/typescript/lib/module/dom/nodes/JsiSkDOM.d.ts +0 -59
- package/lib/typescript/lib/module/renderer/CanvasOld.d.ts +0 -3
- package/lib/typescript/lib/module/renderer/Container.d.ts +0 -9
- package/lib/typescript/lib/module/renderer/HostComponents.d.ts +0 -1
- package/lib/typescript/lib/module/renderer/HostConfig.d.ts +0 -39
- package/lib/typescript/lib/module/renderer/Reconciler.d.ts +0 -9
- package/lib/typescript/lib/module/specs/SkiaDomViewNativeComponent.d.ts +0 -2
- package/lib/typescript/lib/module/views/SkiaDomView.d.ts +0 -27
- package/lib/typescript/lib/module/views/SkiaDomView.web.d.ts +0 -0
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +0 -64
- package/lib/typescript/src/renderer/CanvasOld.d.ts +0 -11
- package/lib/typescript/src/renderer/Container.d.ts +0 -10
- package/lib/typescript/src/renderer/HostComponents.d.ts +0 -129
- package/lib/typescript/src/renderer/HostConfig.d.ts +0 -18
- package/lib/typescript/src/renderer/Reconciler.d.ts +0 -9
- package/lib/typescript/src/specs/SkiaDomViewNativeComponent.d.ts +0 -6
- package/lib/typescript/src/views/SkiaDomView.d.ts +0 -33
- package/lib/typescript/src/views/SkiaDomView.web.d.ts +0 -0
- package/src/dom/nodes/JsiSkDOM.ts +0 -298
- package/src/renderer/CanvasOld.tsx +0 -126
- package/src/renderer/Container.tsx +0 -19
- package/src/renderer/HostComponents.ts +0 -399
- package/src/renderer/HostConfig.ts +0 -258
- package/src/renderer/Reconciler.tsx +0 -54
- package/src/specs/SkiaDomViewNativeComponent.ts +0 -9
- package/src/views/SkiaDomView.tsx +0 -124
- package/src/views/SkiaDomView.web.tsx +0 -0
@@ -1,141 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.createNode = void 0;
|
7
|
-
var _types = require("../dom/types");
|
8
|
-
var _typeddash = require("./typeddash");
|
9
|
-
const createNode = (container, type, props) => {
|
10
|
-
const {
|
11
|
-
Sk
|
12
|
-
} = container;
|
13
|
-
switch (type) {
|
14
|
-
case _types.NodeType.Layer:
|
15
|
-
return Sk.Layer(props);
|
16
|
-
case _types.NodeType.Group:
|
17
|
-
return Sk.Group(props);
|
18
|
-
case _types.NodeType.Paint:
|
19
|
-
return Sk.Paint(props);
|
20
|
-
// Drawings
|
21
|
-
case _types.NodeType.Fill:
|
22
|
-
return Sk.Fill(props);
|
23
|
-
case _types.NodeType.Image:
|
24
|
-
return Sk.Image(props);
|
25
|
-
case _types.NodeType.Circle:
|
26
|
-
return Sk.Circle(props);
|
27
|
-
case _types.NodeType.Path:
|
28
|
-
return Sk.Path(props);
|
29
|
-
case _types.NodeType.Line:
|
30
|
-
return Sk.Line(props);
|
31
|
-
case _types.NodeType.Oval:
|
32
|
-
return Sk.Oval(props);
|
33
|
-
case _types.NodeType.Patch:
|
34
|
-
return Sk.Patch(props);
|
35
|
-
case _types.NodeType.Points:
|
36
|
-
return Sk.Points(props);
|
37
|
-
case _types.NodeType.Rect:
|
38
|
-
return Sk.Rect(props);
|
39
|
-
case _types.NodeType.RRect:
|
40
|
-
return Sk.RRect(props);
|
41
|
-
case _types.NodeType.Vertices:
|
42
|
-
return Sk.Vertices(props);
|
43
|
-
case _types.NodeType.Text:
|
44
|
-
return Sk.Text(props);
|
45
|
-
case _types.NodeType.TextPath:
|
46
|
-
return Sk.TextPath(props);
|
47
|
-
case _types.NodeType.TextBlob:
|
48
|
-
return Sk.TextBlob(props);
|
49
|
-
case _types.NodeType.Glyphs:
|
50
|
-
return Sk.Glyphs(props);
|
51
|
-
case _types.NodeType.Atlas:
|
52
|
-
return Sk.Atlas(props);
|
53
|
-
case _types.NodeType.DiffRect:
|
54
|
-
return Sk.DiffRect(props);
|
55
|
-
case _types.NodeType.Picture:
|
56
|
-
return Sk.Picture(props);
|
57
|
-
case _types.NodeType.ImageSVG:
|
58
|
-
return Sk.ImageSVG(props);
|
59
|
-
// Mask Filter
|
60
|
-
case _types.NodeType.BlurMaskFilter:
|
61
|
-
return Sk.BlurMaskFilter(props);
|
62
|
-
// Image Filter
|
63
|
-
case _types.NodeType.BlendImageFilter:
|
64
|
-
return Sk.BlendImageFilter(props);
|
65
|
-
case _types.NodeType.BlurImageFilter:
|
66
|
-
return Sk.BlurImageFilter(props);
|
67
|
-
case _types.NodeType.OffsetImageFilter:
|
68
|
-
return Sk.OffsetImageFilter(props);
|
69
|
-
case _types.NodeType.DropShadowImageFilter:
|
70
|
-
return Sk.DropShadowImageFilter(props);
|
71
|
-
case _types.NodeType.DisplacementMapImageFilter:
|
72
|
-
return Sk.DisplacementMapImageFilter(props);
|
73
|
-
case _types.NodeType.MorphologyImageFilter:
|
74
|
-
return Sk.MorphologyImageFilter(props);
|
75
|
-
case _types.NodeType.RuntimeShaderImageFilter:
|
76
|
-
return Sk.RuntimeShaderImageFilter(props);
|
77
|
-
// Color Filter
|
78
|
-
case _types.NodeType.MatrixColorFilter:
|
79
|
-
return Sk.MatrixColorFilter(props);
|
80
|
-
case _types.NodeType.BlendColorFilter:
|
81
|
-
return Sk.BlendColorFilter(props);
|
82
|
-
case _types.NodeType.LerpColorFilter:
|
83
|
-
return Sk.LerpColorFilter(props);
|
84
|
-
case _types.NodeType.LumaColorFilter:
|
85
|
-
return Sk.LumaColorFilter();
|
86
|
-
case _types.NodeType.LinearToSRGBGammaColorFilter:
|
87
|
-
return Sk.LinearToSRGBGammaColorFilter();
|
88
|
-
case _types.NodeType.SRGBToLinearGammaColorFilter:
|
89
|
-
return Sk.SRGBToLinearGammaColorFilter();
|
90
|
-
// Shader
|
91
|
-
case _types.NodeType.Shader:
|
92
|
-
return Sk.Shader(props);
|
93
|
-
case _types.NodeType.ImageShader:
|
94
|
-
return Sk.ImageShader(props);
|
95
|
-
case _types.NodeType.ColorShader:
|
96
|
-
return Sk.ColorShader(props);
|
97
|
-
case _types.NodeType.Turbulence:
|
98
|
-
return Sk.Turbulence(props);
|
99
|
-
case _types.NodeType.FractalNoise:
|
100
|
-
return Sk.FractalNoise(props);
|
101
|
-
case _types.NodeType.LinearGradient:
|
102
|
-
return Sk.LinearGradient(props);
|
103
|
-
case _types.NodeType.RadialGradient:
|
104
|
-
return Sk.RadialGradient(props);
|
105
|
-
case _types.NodeType.SweepGradient:
|
106
|
-
return Sk.SweepGradient(props);
|
107
|
-
case _types.NodeType.TwoPointConicalGradient:
|
108
|
-
return Sk.TwoPointConicalGradient(props);
|
109
|
-
// Path Effect
|
110
|
-
case _types.NodeType.CornerPathEffect:
|
111
|
-
return Sk.CornerPathEffect(props);
|
112
|
-
case _types.NodeType.DiscretePathEffect:
|
113
|
-
return Sk.DiscretePathEffect(props);
|
114
|
-
case _types.NodeType.DashPathEffect:
|
115
|
-
return Sk.DashPathEffect(props);
|
116
|
-
case _types.NodeType.Path1DPathEffect:
|
117
|
-
return Sk.Path1DPathEffect(props);
|
118
|
-
case _types.NodeType.Path2DPathEffect:
|
119
|
-
return Sk.Path2DPathEffect(props);
|
120
|
-
case _types.NodeType.SumPathEffect:
|
121
|
-
return Sk.SumPathEffect();
|
122
|
-
case _types.NodeType.Line2DPathEffect:
|
123
|
-
return Sk.Line2DPathEffect(props);
|
124
|
-
// Mixed
|
125
|
-
case _types.NodeType.Blend:
|
126
|
-
return Sk.Blend(props);
|
127
|
-
case _types.NodeType.BackdropFilter:
|
128
|
-
return Sk.BackdropFilter(props);
|
129
|
-
case _types.NodeType.Box:
|
130
|
-
return Sk.Box(props);
|
131
|
-
case _types.NodeType.BoxShadow:
|
132
|
-
return Sk.BoxShadow(props);
|
133
|
-
// Paragraph
|
134
|
-
case _types.NodeType.Paragraph:
|
135
|
-
return Sk.Paragraph(props);
|
136
|
-
default:
|
137
|
-
return (0, _typeddash.exhaustiveCheck)(type);
|
138
|
-
}
|
139
|
-
};
|
140
|
-
exports.createNode = createNode;
|
141
|
-
//# sourceMappingURL=HostComponents.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["_types","require","_typeddash","createNode","container","type","props","Sk","NodeType","Layer","Group","Paint","Fill","Image","Circle","Path","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","Atlas","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LerpColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow","Paragraph","exhaustiveCheck","exports"],"sources":["HostComponents.ts"],"sourcesContent":["import { NodeType } from \"../dom/types\";\nimport type {\n DeclarationNode,\n FractalNoiseProps,\n RenderNode,\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n ParagraphProps,\n AtlasProps,\n} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\ndeclare global {\n var SkiaDomApi: {\n RectNode: (props: RectProps) => RenderNode<RectProps>;\n RRectNode: (props: RoundedRectProps) => RenderNode<RoundedRectProps>;\n GroupNode: (props: GroupProps) => RenderNode<GroupProps>;\n PaintNode: (props: PaintProps) => DeclarationNode<PaintProps>;\n FillNode: (props: PaintProps) => RenderNode<PaintProps>;\n CircleNode: (props: CircleProps) => RenderNode<CircleProps>;\n PathNode: (props: PathProps) => RenderNode<PathProps>;\n LineNode: (props: LineProps) => RenderNode<LineProps>;\n ImageNode: (props: ImageProps) => RenderNode<ImageProps>;\n OvalNode: (props: OvalProps) => RenderNode<OvalProps>;\n PatchNode: (props: PatchProps) => RenderNode<PatchProps>;\n PointsNode: (props: PointsProps) => RenderNode<PointsProps>;\n DiffRectNode: (props: DiffRectProps) => RenderNode<DiffRectProps>;\n AtlasNode: (props: AtlasProps) => RenderNode<AtlasProps>;\n\n // Mask filters\n BlurMaskFilterNode: (\n props: BlurMaskFilterProps\n ) => DeclarationNode<BlurMaskFilterProps>;\n\n // Path effects\n DashPathEffectNode: (\n props: DashPathEffectProps\n ) => DeclarationNode<DashPathEffectProps>;\n DiscretePathEffectNode: (\n props: DiscretePathEffectProps\n ) => DeclarationNode<DiscretePathEffectProps>;\n CornerPathEffectNode: (\n props: CornerPathEffectProps\n ) => DeclarationNode<CornerPathEffectProps>;\n Path1DPathEffectNode: (\n props: Path1DPathEffectProps\n ) => DeclarationNode<Path1DPathEffectProps>;\n Path2DPathEffectNode: (\n props: Path2DPathEffectProps\n ) => DeclarationNode<Path2DPathEffectProps>;\n Line2DPathEffectNode: (\n props: Line2DPathEffectProps\n ) => DeclarationNode<Line2DPathEffectProps>;\n SumPathEffectNode: () => DeclarationNode<null>;\n\n // Image filters\n BlendImageFilterNode: (\n props: BlendImageFilterProps\n ) => DeclarationNode<BlendImageFilterProps>;\n DropShadowImageFilterNode: (\n props: DropShadowImageFilterProps\n ) => DeclarationNode<DropShadowImageFilterProps>;\n DisplacementMapImageFilterNode: (\n props: DisplacementMapImageFilterProps\n ) => DeclarationNode<DisplacementMapImageFilterProps>;\n BlurImageFilterNode: (\n props: BlurImageFilterProps\n ) => DeclarationNode<BlurImageFilterProps>;\n OffsetImageFilterNode: (\n props: OffsetImageFilterProps\n ) => DeclarationNode<OffsetImageFilterProps>;\n MorphologyImageFilterNode: (\n props: MorphologyImageFilterProps\n ) => DeclarationNode<MorphologyImageFilterProps>;\n RuntimeShaderImageFilterNode: (\n props: RuntimeShaderImageFilterProps\n ) => DeclarationNode<RuntimeShaderImageFilterProps>;\n\n // Color filters\n MatrixColorFilterNode: (\n props: MatrixColorFilterProps\n ) => DeclarationNode<MatrixColorFilterProps>;\n BlendColorFilterNode: (\n props: BlendColorFilterProps\n ) => DeclarationNode<BlendColorFilterProps>;\n LinearToSRGBGammaColorFilterNode: () => DeclarationNode<null>;\n SRGBToLinearGammaColorFilterNode: () => DeclarationNode<null>;\n LumaColorFilterNode: () => DeclarationNode<null>;\n LerpColorFilterNode: (\n props: LerpColorFilterProps\n ) => DeclarationNode<LerpColorFilterProps>;\n\n // Shaders\n ShaderNode: (props: ShaderProps) => DeclarationNode<ShaderProps>;\n ImageShaderNode: (\n props: ImageShaderProps\n ) => DeclarationNode<ImageShaderProps>;\n ColorShaderNode: (props: ColorProps) => DeclarationNode<ColorProps>;\n TurbulenceNode: (\n props: TurbulenceProps\n ) => DeclarationNode<TurbulenceProps>;\n FractalNoiseNode: (\n props: FractalNoiseProps\n ) => DeclarationNode<FractalNoiseProps>;\n LinearGradientNode: (\n props: LinearGradientProps\n ) => DeclarationNode<LinearGradientProps>;\n RadialGradientNode: (\n props: RadialGradientProps\n ) => DeclarationNode<RadialGradientProps>;\n SweepGradientNode: (\n props: SweepGradientProps\n ) => DeclarationNode<SweepGradientProps>;\n TwoPointConicalGradientNode: (\n props: TwoPointConicalGradientProps\n ) => DeclarationNode<TwoPointConicalGradientProps>;\n PictureNode: (props: PictureProps) => RenderNode<PictureProps>;\n ImageSVGNode: (props: ImageSVGProps) => RenderNode<ImageSVGProps>;\n VerticesNode: (props: VerticesProps) => RenderNode<VerticesProps>;\n TextNode: (prop: TextProps) => RenderNode<TextProps>;\n TextPathNode: (prop: TextPathProps) => RenderNode<TextPathProps>;\n TextBlobNode: (prop: TextBlobProps) => RenderNode<TextBlobProps>;\n GlyphsNode: (prop: GlyphsProps) => RenderNode<GlyphsProps>;\n BlendNode: (prop: BlendProps) => DeclarationNode<BlendProps>;\n BackdropFilterNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;\n BoxNode: (prop: BoxProps) => RenderNode<BoxProps>;\n BoxShadowNode: (prop: BoxShadowProps) => DeclarationNode<BoxShadowProps>;\n LayerNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;\n\n // Paragraph\n ParagraphNode: (props: ParagraphProps) => RenderNode<ParagraphProps>;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skLayer: SkiaProps<ChildrenProps>;\n skPaint: SkiaProps<PaintProps>;\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skAtlas: SkiaProps<AtlasProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<FractalNoiseProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n\n // Paragraph\n skParagraph: SkiaProps<ParagraphProps>;\n }\n }\n}\n\nexport const createNode = (\n container: Container,\n type: NodeType,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: any\n) => {\n const { Sk } = container;\n switch (type) {\n case NodeType.Layer:\n return Sk.Layer(props);\n case NodeType.Group:\n return Sk.Group(props);\n case NodeType.Paint:\n return Sk.Paint(props);\n // Drawings\n case NodeType.Fill:\n return Sk.Fill(props);\n case NodeType.Image:\n return Sk.Image(props);\n case NodeType.Circle:\n return Sk.Circle(props);\n case NodeType.Path:\n return Sk.Path(props);\n case NodeType.Line:\n return Sk.Line(props);\n case NodeType.Oval:\n return Sk.Oval(props);\n case NodeType.Patch:\n return Sk.Patch(props);\n case NodeType.Points:\n return Sk.Points(props);\n case NodeType.Rect:\n return Sk.Rect(props);\n case NodeType.RRect:\n return Sk.RRect(props);\n case NodeType.Vertices:\n return Sk.Vertices(props);\n case NodeType.Text:\n return Sk.Text(props);\n case NodeType.TextPath:\n return Sk.TextPath(props);\n case NodeType.TextBlob:\n return Sk.TextBlob(props);\n case NodeType.Glyphs:\n return Sk.Glyphs(props);\n case NodeType.Atlas:\n return Sk.Atlas(props);\n case NodeType.DiffRect:\n return Sk.DiffRect(props);\n case NodeType.Picture:\n return Sk.Picture(props);\n case NodeType.ImageSVG:\n return Sk.ImageSVG(props);\n // Mask Filter\n case NodeType.BlurMaskFilter:\n return Sk.BlurMaskFilter(props);\n // Image Filter\n case NodeType.BlendImageFilter:\n return Sk.BlendImageFilter(props);\n case NodeType.BlurImageFilter:\n return Sk.BlurImageFilter(props);\n case NodeType.OffsetImageFilter:\n return Sk.OffsetImageFilter(props);\n case NodeType.DropShadowImageFilter:\n return Sk.DropShadowImageFilter(props);\n case NodeType.DisplacementMapImageFilter:\n return Sk.DisplacementMapImageFilter(props);\n case NodeType.MorphologyImageFilter:\n return Sk.MorphologyImageFilter(props);\n case NodeType.RuntimeShaderImageFilter:\n return Sk.RuntimeShaderImageFilter(props);\n // Color Filter\n case NodeType.MatrixColorFilter:\n return Sk.MatrixColorFilter(props);\n case NodeType.BlendColorFilter:\n return Sk.BlendColorFilter(props);\n case NodeType.LerpColorFilter:\n return Sk.LerpColorFilter(props);\n case NodeType.LumaColorFilter:\n return Sk.LumaColorFilter();\n case NodeType.LinearToSRGBGammaColorFilter:\n return Sk.LinearToSRGBGammaColorFilter();\n case NodeType.SRGBToLinearGammaColorFilter:\n return Sk.SRGBToLinearGammaColorFilter();\n // Shader\n case NodeType.Shader:\n return Sk.Shader(props);\n case NodeType.ImageShader:\n return Sk.ImageShader(props);\n case NodeType.ColorShader:\n return Sk.ColorShader(props);\n case NodeType.Turbulence:\n return Sk.Turbulence(props);\n case NodeType.FractalNoise:\n return Sk.FractalNoise(props);\n case NodeType.LinearGradient:\n return Sk.LinearGradient(props);\n case NodeType.RadialGradient:\n return Sk.RadialGradient(props);\n case NodeType.SweepGradient:\n return Sk.SweepGradient(props);\n case NodeType.TwoPointConicalGradient:\n return Sk.TwoPointConicalGradient(props);\n // Path Effect\n case NodeType.CornerPathEffect:\n return Sk.CornerPathEffect(props);\n case NodeType.DiscretePathEffect:\n return Sk.DiscretePathEffect(props);\n case NodeType.DashPathEffect:\n return Sk.DashPathEffect(props);\n case NodeType.Path1DPathEffect:\n return Sk.Path1DPathEffect(props);\n case NodeType.Path2DPathEffect:\n return Sk.Path2DPathEffect(props);\n case NodeType.SumPathEffect:\n return Sk.SumPathEffect();\n case NodeType.Line2DPathEffect:\n return Sk.Line2DPathEffect(props);\n // Mixed\n case NodeType.Blend:\n return Sk.Blend(props);\n case NodeType.BackdropFilter:\n return Sk.BackdropFilter(props);\n case NodeType.Box:\n return Sk.Box(props);\n case NodeType.BoxShadow:\n return Sk.BoxShadow(props);\n // Paragraph\n case NodeType.Paragraph:\n return Sk.Paragraph(props);\n default:\n return exhaustiveCheck(type);\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AA6DA,IAAAC,UAAA,GAAAD,OAAA;AA4MO,MAAME,UAAU,GAAGA,CACxBC,SAAoB,EACpBC,IAAc,EAEdC,KAAU,KACP;EACH,MAAM;IAAEC;EAAG,CAAC,GAAGH,SAAS;EACxB,QAAQC,IAAI;IACV,KAAKG,eAAQ,CAACC,KAAK;MACjB,OAAOF,EAAE,CAACE,KAAK,CAACH,KAAK,CAAC;IACxB,KAAKE,eAAQ,CAACE,KAAK;MACjB,OAAOH,EAAE,CAACG,KAAK,CAACJ,KAAK,CAAC;IACxB,KAAKE,eAAQ,CAACG,KAAK;MACjB,OAAOJ,EAAE,CAACI,KAAK,CAACL,KAAK,CAAC;IACxB;IACA,KAAKE,eAAQ,CAACI,IAAI;MAChB,OAAOL,EAAE,CAACK,IAAI,CAACN,KAAK,CAAC;IACvB,KAAKE,eAAQ,CAACK,KAAK;MACjB,OAAON,EAAE,CAACM,KAAK,CAACP,KAAK,CAAC;IACxB,KAAKE,eAAQ,CAACM,MAAM;MAClB,OAAOP,EAAE,CAACO,MAAM,CAACR,KAAK,CAAC;IACzB,KAAKE,eAAQ,CAACO,IAAI;MAChB,OAAOR,EAAE,CAACQ,IAAI,CAACT,K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,KAAKE,eAAQ,CAACiD,gBAAgB;MAC5B,OAAOlD,EAAE,CAACkD,gBAAgB,CAACnD,KAAK,CAAC;IACnC,KAAKE,eAAQ,CAACkD,gBAAgB;MAC5B,OAAOnD,EAAE,CAACmD,gBAAgB,CAACpD,KAAK,CAAC;IACnC,KAAKE,eAAQ,CAACmD,aAAa;MACzB,OAAOpD,EAAE,CAACoD,aAAa,CAAC,CAAC;IAC3B,KAAKnD,eAAQ,CAACoD,gBAAgB;MAC5B,OAAOrD,EAAE,CAACqD,gBAAgB,CAACtD,KAAK,CAAC;IACnC;IACA,KAAKE,eAAQ,CAACqD,KAAK;MACjB,OAAOtD,EAAE,CAACsD,KAAK,CAACvD,KAAK,CAAC;IACxB,KAAKE,eAAQ,CAACsD,cAAc;MAC1B,OAAOvD,EAAE,CAACuD,cAAc,CAACxD,KAAK,CAAC;IACjC,KAAKE,eAAQ,CAACuD,GAAG;MACf,OAAOxD,EAAE,CAACwD,GAAG,CAACzD,KAAK,CAAC;IACtB,KAAKE,eAAQ,CAACwD,SAAS;MACrB,OAAOzD,EAAE,CAACyD,SAAS,CAAC1D,KAAK,CAAC;IAC5B;IACA,KAAKE,eAAQ,CAACyD,SAAS;MACrB,OAAO1D,EAAE,CAAC0D,SAAS,CAAC3D,KAAK,CAAC;IAC5B;MACE,OAAO,IAAA4D,0BAAe,EAAC7D,IAAI,CAAC;EAChC;AACF,CAAC;AAAC8D,OAAA,CAAAhE,UAAA,GAAAA,UAAA","ignoreList":[]}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import type { HostConfig } from "react-reconciler";
|
2
|
-
import type { NodeType, Node } from "../dom/types";
|
3
|
-
import type { Container } from "./Container";
|
4
|
-
export declare const debug: (message?: any, ...optionalParams: any[]) => void;
|
5
|
-
type Instance = Node<unknown>;
|
6
|
-
type Props = object;
|
7
|
-
type TextInstance = Node<unknown>;
|
8
|
-
type SuspenseInstance = Instance;
|
9
|
-
type HydratableInstance = Instance;
|
10
|
-
type PublicInstance = Instance;
|
11
|
-
type HostContext = null;
|
12
|
-
type UpdatePayload = Container;
|
13
|
-
type ChildSet = unknown;
|
14
|
-
type TimeoutHandle = NodeJS.Timeout;
|
15
|
-
type NoTimeout = -1;
|
16
|
-
type SkiaHostConfig = HostConfig<NodeType, Props, Container, Instance, TextInstance, SuspenseInstance, HydratableInstance, PublicInstance, HostContext, UpdatePayload, ChildSet, TimeoutHandle, NoTimeout>;
|
17
|
-
export declare const skHostConfig: SkiaHostConfig;
|
18
|
-
export {};
|
@@ -1,157 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.skHostConfig = exports.debug = void 0;
|
7
|
-
var _constants = require("react-reconciler/constants");
|
8
|
-
var _renderHelpers = require("../external/reanimated/renderHelpers");
|
9
|
-
var _HostComponents = require("./HostComponents");
|
10
|
-
var _typeddash = require("./typeddash");
|
11
|
-
/*global NodeJS*/
|
12
|
-
|
13
|
-
const DEBUG = false;
|
14
|
-
const debug = (...args) => {
|
15
|
-
if (DEBUG) {
|
16
|
-
console.log(...args);
|
17
|
-
}
|
18
|
-
};
|
19
|
-
exports.debug = debug;
|
20
|
-
const appendNode = (parent, child) => {
|
21
|
-
parent.addChild(child);
|
22
|
-
};
|
23
|
-
const removeNode = (parent, child, unmounted = false) => {
|
24
|
-
// If the drawing is unmounted we don't want to update it.
|
25
|
-
// We can just stop the reanimated mappers
|
26
|
-
(0, _renderHelpers.unbindReanimatedNode)(child);
|
27
|
-
if (!unmounted) {
|
28
|
-
parent.removeChild(child);
|
29
|
-
}
|
30
|
-
};
|
31
|
-
const insertBefore = (parent, child, before) => {
|
32
|
-
parent.insertChildBefore(child, before);
|
33
|
-
};
|
34
|
-
const skHostConfig = exports.skHostConfig = {
|
35
|
-
/**
|
36
|
-
* This function is used by the reconciler in order to calculate current time for prioritising work.
|
37
|
-
*/
|
38
|
-
supportsMutation: true,
|
39
|
-
isPrimaryRenderer: false,
|
40
|
-
supportsPersistence: false,
|
41
|
-
supportsHydration: false,
|
42
|
-
//supportsMicrotask: true,
|
43
|
-
|
44
|
-
scheduleTimeout: setTimeout,
|
45
|
-
cancelTimeout: clearTimeout,
|
46
|
-
noTimeout: -1,
|
47
|
-
appendChildToContainer(container, child) {
|
48
|
-
debug("appendChildToContainer");
|
49
|
-
appendNode(container.root, child);
|
50
|
-
},
|
51
|
-
appendChild(parent, child) {
|
52
|
-
debug("appendChild", parent, child);
|
53
|
-
appendNode(parent, child);
|
54
|
-
},
|
55
|
-
getRootHostContext: _rootContainerInstance => {
|
56
|
-
debug("getRootHostContext");
|
57
|
-
return null;
|
58
|
-
},
|
59
|
-
getChildHostContext(_parentHostContext, _type, _rootContainerInstance) {
|
60
|
-
debug("getChildHostContext");
|
61
|
-
return null;
|
62
|
-
},
|
63
|
-
shouldSetTextContent(_type, _props) {
|
64
|
-
return false;
|
65
|
-
},
|
66
|
-
createTextInstance(_text, _rootContainerInstance, _hostContext, _internalInstanceHandle) {
|
67
|
-
debug("createTextInstance");
|
68
|
-
// return SpanNode({}, text) as SkNode;
|
69
|
-
throw new Error("Text nodes are not supported yet");
|
70
|
-
},
|
71
|
-
createInstance(type, pristineProps, container, _hostContext, _internalInstanceHandle) {
|
72
|
-
debug("createInstance", type);
|
73
|
-
const [props, reanimatedProps] = (0, _renderHelpers.extractReanimatedProps)(pristineProps);
|
74
|
-
const node = (0, _HostComponents.createNode)(container, type, props);
|
75
|
-
(0, _renderHelpers.bindReanimatedProps)(container, node, reanimatedProps);
|
76
|
-
return node;
|
77
|
-
},
|
78
|
-
appendInitialChild(parentInstance, child) {
|
79
|
-
debug("appendInitialChild");
|
80
|
-
appendNode(parentInstance, child);
|
81
|
-
},
|
82
|
-
finalizeInitialChildren(parentInstance, _type, _props, _rootContainerInstance, _hostContext) {
|
83
|
-
debug("finalizeInitialChildren", parentInstance);
|
84
|
-
return false;
|
85
|
-
},
|
86
|
-
commitMount() {
|
87
|
-
// if finalizeInitialChildren = true
|
88
|
-
debug("commitMount");
|
89
|
-
},
|
90
|
-
prepareForCommit(_containerInfo) {
|
91
|
-
debug("prepareForCommit");
|
92
|
-
return null;
|
93
|
-
},
|
94
|
-
resetAfterCommit(container) {
|
95
|
-
debug("resetAfterCommit");
|
96
|
-
container.redraw();
|
97
|
-
},
|
98
|
-
getPublicInstance(node) {
|
99
|
-
debug("getPublicInstance");
|
100
|
-
return node;
|
101
|
-
},
|
102
|
-
prepareUpdate: (_instance, type, oldProps, newProps, rootContainerInstance, _hostContext) => {
|
103
|
-
debug("prepareUpdate");
|
104
|
-
const propsAreEqual = (0, _typeddash.shallowEq)(oldProps, newProps);
|
105
|
-
if (propsAreEqual) {
|
106
|
-
return null;
|
107
|
-
}
|
108
|
-
debug("update ", type);
|
109
|
-
return rootContainerInstance;
|
110
|
-
},
|
111
|
-
commitUpdate(instance, updatePayload, type, prevProps, nextProps, _internalHandle) {
|
112
|
-
debug("commitUpdate: ", type);
|
113
|
-
if ((0, _typeddash.shallowEq)(prevProps, nextProps)) {
|
114
|
-
return;
|
115
|
-
}
|
116
|
-
const [props, reanimatedProps] = (0, _renderHelpers.extractReanimatedProps)(nextProps);
|
117
|
-
instance.setProps(props);
|
118
|
-
(0, _renderHelpers.bindReanimatedProps)(updatePayload, instance, reanimatedProps);
|
119
|
-
},
|
120
|
-
commitTextUpdate: (_textInstance, _oldText, _newText) => {
|
121
|
-
// textInstance.instance = newText;
|
122
|
-
},
|
123
|
-
clearContainer: container => {
|
124
|
-
debug("clearContainer");
|
125
|
-
container.root.children().forEach(child => {
|
126
|
-
container.root.removeChild(child);
|
127
|
-
});
|
128
|
-
},
|
129
|
-
preparePortalMount: () => {
|
130
|
-
debug("preparePortalMount");
|
131
|
-
},
|
132
|
-
removeChild: (parent, child) => {
|
133
|
-
removeNode(parent, child);
|
134
|
-
},
|
135
|
-
removeChildFromContainer: (container, child) => {
|
136
|
-
removeNode(container.root, child, container.unmounted);
|
137
|
-
},
|
138
|
-
insertInContainerBefore: (container, child, before) => {
|
139
|
-
insertBefore(container.root, child, before);
|
140
|
-
},
|
141
|
-
insertBefore: (parent, child, before) => {
|
142
|
-
insertBefore(parent, child, before);
|
143
|
-
},
|
144
|
-
// see https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874
|
145
|
-
getCurrentEventPriority: () => _constants.DefaultEventPriority,
|
146
|
-
beforeActiveInstanceBlur: () => {},
|
147
|
-
afterActiveInstanceBlur: () => {},
|
148
|
-
detachDeletedInstance: () => {},
|
149
|
-
getInstanceFromNode: function (_node) {
|
150
|
-
return null;
|
151
|
-
},
|
152
|
-
prepareScopeUpdate: function (_scopeInstance, _instance) {},
|
153
|
-
getInstanceFromScope: function (_scopeInstance) {
|
154
|
-
return null;
|
155
|
-
}
|
156
|
-
};
|
157
|
-
//# sourceMappingURL=HostConfig.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["_constants","require","_renderHelpers","_HostComponents","_typeddash","DEBUG","debug","args","console","log","exports","appendNode","parent","child","addChild","removeNode","unmounted","unbindReanimatedNode","removeChild","insertBefore","before","insertChildBefore","skHostConfig","supportsMutation","isPrimaryRenderer","supportsPersistence","supportsHydration","scheduleTimeout","setTimeout","cancelTimeout","clearTimeout","noTimeout","appendChildToContainer","container","root","appendChild","getRootHostContext","_rootContainerInstance","getChildHostContext","_parentHostContext","_type","shouldSetTextContent","_props","createTextInstance","_text","_hostContext","_internalInstanceHandle","Error","createInstance","type","pristineProps","props","reanimatedProps","extractReanimatedProps","node","createNode","bindReanimatedProps","appendInitialChild","parentInstance","finalizeInitialChildren","commitMount","prepareForCommit","_containerInfo","resetAfterCommit","redraw","getPublicInstance","prepareUpdate","_instance","oldProps","newProps","rootContainerInstance","propsAreEqual","shallowEq","commitUpdate","instance","updatePayload","prevProps","nextProps","_internalHandle","setProps","commitTextUpdate","_textInstance","_oldText","_newText","clearContainer","children","forEach","preparePortalMount","removeChildFromContainer","insertInContainerBefore","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, Node } from \"../dom/types\";\nimport {\n bindReanimatedProps,\n extractReanimatedProps,\n unbindReanimatedNode,\n} from \"../external/reanimated/renderHelpers\";\n\nimport type { Container } from \"./Container\";\nimport { createNode } from \"./HostComponents\";\nimport { shallowEq } from \"./typeddash\";\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<unknown>;\n\ntype Props = object;\ntype TextInstance = Node<unknown>;\ntype SuspenseInstance = Instance;\ntype HydratableInstance = Instance;\ntype PublicInstance = Instance;\ntype HostContext = null;\ntype UpdatePayload = Container;\ntype ChildSet = unknown;\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\nconst appendNode = (parent: Node<unknown>, child: Node<unknown>) => {\n parent.addChild(child);\n};\n\nconst removeNode = (\n parent: Node<unknown>,\n child: Node<unknown>,\n unmounted = false\n) => {\n // If the drawing is unmounted we don't want to update it.\n // We can just stop the reanimated mappers\n unbindReanimatedNode(child);\n if (!unmounted) {\n parent.removeChild(child);\n }\n};\n\nconst insertBefore = (\n parent: Node<unknown>,\n child: Node<unknown>,\n before: Node<unknown>\n) => {\n parent.insertChildBefore(child, before);\n};\n\nexport const skHostConfig: SkiaHostConfig = {\n /**\n * This function is used by the reconciler in order to calculate current time for prioritising work.\n */\n supportsMutation: true,\n isPrimaryRenderer: false,\n supportsPersistence: false,\n supportsHydration: false,\n //supportsMicrotask: true,\n\n scheduleTimeout: setTimeout,\n cancelTimeout: clearTimeout,\n noTimeout: -1,\n\n appendChildToContainer(container, child) {\n debug(\"appendChildToContainer\");\n appendNode(container.root, child);\n },\n\n appendChild(parent, child) {\n debug(\"appendChild\", parent, child);\n appendNode(parent, child);\n },\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 pristineProps,\n container,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createInstance\", type);\n const [props, reanimatedProps] = extractReanimatedProps(pristineProps);\n const node = createNode(container, type, props);\n bindReanimatedProps(container, node, reanimatedProps);\n return node;\n },\n\n appendInitialChild(parentInstance, child) {\n debug(\"appendInitialChild\");\n appendNode(parentInstance, 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 prepareUpdate: (\n _instance,\n type,\n oldProps,\n newProps,\n rootContainerInstance,\n _hostContext\n ) => {\n debug(\"prepareUpdate\");\n const propsAreEqual = shallowEq(oldProps, newProps);\n if (propsAreEqual) {\n return null;\n }\n debug(\"update \", type);\n return rootContainerInstance;\n },\n\n commitUpdate(\n instance,\n updatePayload,\n type,\n prevProps,\n nextProps,\n _internalHandle\n ) {\n debug(\"commitUpdate: \", type);\n if (shallowEq(prevProps, nextProps)) {\n return;\n }\n const [props, reanimatedProps] = extractReanimatedProps(nextProps);\n instance.setProps(props);\n bindReanimatedProps(updatePayload, instance, reanimatedProps);\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.root.children().forEach((child) => {\n container.root.removeChild(child);\n });\n },\n\n preparePortalMount: () => {\n debug(\"preparePortalMount\");\n },\n\n removeChild: (parent, child) => {\n removeNode(parent, child);\n },\n\n removeChildFromContainer: (container, child) => {\n removeNode(container.root, child, container.unmounted);\n },\n\n insertInContainerBefore: (container, child, before) => {\n insertBefore(container.root, child, before);\n },\n\n insertBefore: (parent, child, before) => {\n insertBefore(parent, child, before);\n },\n\n // see https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874\n getCurrentEventPriority: () => DefaultEventPriority,\n beforeActiveInstanceBlur: () => {},\n afterActiveInstanceBlur: () => {},\n detachDeletedInstance: () => {},\n\n getInstanceFromNode: function (_node): Fiber | null | undefined {\n return null;\n },\n prepareScopeUpdate: function (_scopeInstance, _instance): void {},\n getInstanceFromScope: function (_scopeInstance): Instance | null {\n return null;\n },\n};\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAGA,IAAAC,cAAA,GAAAD,OAAA;AAOA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAbA;;AAeA,MAAMI,KAAK,GAAG,KAAK;AACZ,MAAMC,KAAK,GAAGA,CAAC,GAAGC,IAAoC,KAAK;EAChE,IAAIF,KAAK,EAAE;IACTG,OAAO,CAACC,GAAG,CAAC,GAAG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ACb;AACF,CAAC","ignoreList":[]}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import type { ReactNode } from "react";
|
2
|
-
export declare class SkiaRoot {
|
3
|
-
private root;
|
4
|
-
private container;
|
5
|
-
constructor(redraw?: () => void, getNativeId?: () => number);
|
6
|
-
render(element: ReactNode): void;
|
7
|
-
unmount(): void;
|
8
|
-
get dom(): import("..").Node<unknown>;
|
9
|
-
}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.SkiaRoot = void 0;
|
7
|
-
var _reactReconciler = _interopRequireDefault(require("react-reconciler"));
|
8
|
-
var _HostConfig = require("./HostConfig");
|
9
|
-
var _Container = require("./Container");
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
11
|
-
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; }
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
13
|
-
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); }
|
14
|
-
const skiaReconciler = (0, _reactReconciler.default)(_HostConfig.skHostConfig);
|
15
|
-
skiaReconciler.injectIntoDevTools({
|
16
|
-
bundleType: 1,
|
17
|
-
version: "0.0.1",
|
18
|
-
rendererPackageName: "react-native-skia"
|
19
|
-
});
|
20
|
-
class SkiaRoot {
|
21
|
-
constructor(redraw = () => {}, getNativeId = () => 0) {
|
22
|
-
_defineProperty(this, "root", void 0);
|
23
|
-
_defineProperty(this, "container", void 0);
|
24
|
-
this.container = new _Container.Container(redraw, getNativeId);
|
25
|
-
this.root = skiaReconciler.createContainer(this.container, 0, null, true, null, "", console.error, null);
|
26
|
-
}
|
27
|
-
render(element) {
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
29
|
-
skiaReconciler.updateContainer(element, this.root, null, () => {
|
30
|
-
(0, _HostConfig.debug)("updateContainer");
|
31
|
-
});
|
32
|
-
}
|
33
|
-
unmount() {
|
34
|
-
this.container.unmounted = true;
|
35
|
-
skiaReconciler.updateContainer(null, this.root, null, () => {
|
36
|
-
(0, _HostConfig.debug)("unmountContainer");
|
37
|
-
});
|
38
|
-
}
|
39
|
-
get dom() {
|
40
|
-
return this.container.root;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
exports.SkiaRoot = SkiaRoot;
|
44
|
-
//# sourceMappingURL=Reconciler.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["_reactReconciler","_interopRequireDefault","require","_HostConfig","_Container","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","skiaReconciler","ReactReconciler","skHostConfig","injectIntoDevTools","bundleType","version","rendererPackageName","SkiaRoot","constructor","redraw","getNativeId","container","Container","root","createContainer","console","error","render","element","updateContainer","hostDebug","unmount","unmounted","dom","exports"],"sources":["Reconciler.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { OpaqueRoot } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\n\nimport { skHostConfig, debug as hostDebug } from \"./HostConfig\";\nimport { Container } from \"./Container\";\n\nconst skiaReconciler = ReactReconciler(skHostConfig);\n\nskiaReconciler.injectIntoDevTools({\n bundleType: 1,\n version: \"0.0.1\",\n rendererPackageName: \"react-native-skia\",\n});\n\nexport class SkiaRoot {\n private root: OpaqueRoot;\n private container: Container;\n\n constructor(\n redraw: () => void = () => {},\n getNativeId: () => number = () => 0\n ) {\n this.container = new Container(redraw, getNativeId);\n this.root = skiaReconciler.createContainer(\n this.container,\n 0,\n null,\n true,\n null,\n \"\",\n console.error,\n null\n );\n }\n\n render(element: ReactNode) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n skiaReconciler.updateContainer(element as any, this.root, null, () => {\n hostDebug(\"updateContainer\");\n });\n }\n\n unmount() {\n this.container.unmounted = true;\n skiaReconciler.updateContainer(null, this.root, null, () => {\n hostDebug(\"unmountContainer\");\n });\n }\n\n get dom() {\n return this.container.root;\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAAwC,SAAAD,uBAAAI,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,MAAA,G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-native";
|
2
|
-
export interface NativeProps extends ViewProps {
|
3
|
-
debug?: boolean;
|
4
|
-
}
|
5
|
-
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
6
|
-
export default _default;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
9
|
-
// eslint-disable-next-line import/no-default-export
|
10
|
-
var _default = exports.default = (0, _codegenNativeComponent.default)("SkiaDomView");
|
11
|
-
//# sourceMappingURL=SkiaDomViewNativeComponent.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent"],"sources":["SkiaDomViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\nimport type { ViewProps } from \"react-native\";\n\nexport interface NativeProps extends ViewProps {\n debug?: boolean;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default codegenNativeComponent<NativeProps>(\"SkiaDomView\");\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAO7F;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GACe,IAAAG,+BAAsB,EAAc,aAAa,CAAC","ignoreList":[]}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import type { SkRect } from "../skia/types";
|
3
|
-
import type { SkiaDomViewNativeProps } from "./types";
|
4
|
-
interface SkiaDomViewProps extends SkiaDomViewNativeProps {
|
5
|
-
mode?: "default" | "continuous";
|
6
|
-
}
|
7
|
-
export declare class SkiaDomView extends React.Component<SkiaDomViewProps> {
|
8
|
-
constructor(props: SkiaDomViewProps);
|
9
|
-
private _nativeId;
|
10
|
-
private requestId;
|
11
|
-
get nativeId(): number;
|
12
|
-
componentDidUpdate(prevProps: SkiaDomViewProps): void;
|
13
|
-
componentWillUnmount(): void;
|
14
|
-
private tick;
|
15
|
-
/**
|
16
|
-
* Creates a snapshot from the canvas in the surface
|
17
|
-
* @param rect Rect to use as bounds. Optional.
|
18
|
-
* @returns An Image object.
|
19
|
-
*/
|
20
|
-
makeImageSnapshot(rect?: SkRect): import("../skia/types").SkImage;
|
21
|
-
/**
|
22
|
-
* Creates a snapshot from the canvas in the surface
|
23
|
-
* @param rect Rect to use as bounds. Optional.
|
24
|
-
* @returns An Image object.
|
25
|
-
*/
|
26
|
-
makeImageSnapshotAsync(rect?: SkRect): Promise<import("../skia/types").SkImage>;
|
27
|
-
/**
|
28
|
-
* Sends a redraw request to the native SkiaView.
|
29
|
-
*/
|
30
|
-
redraw(): void;
|
31
|
-
render(): React.JSX.Element;
|
32
|
-
}
|
33
|
-
export {};
|
@@ -1,119 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.SkiaDomView = void 0;
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
8
|
-
var _Platform = require("../Platform");
|
9
|
-
var _SkiaDomViewNativeComponent = _interopRequireDefault(require("../specs/SkiaDomViewNativeComponent"));
|
10
|
-
var _api = require("./api");
|
11
|
-
var _SkiaViewNativeId = require("./SkiaViewNativeId");
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
13
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
14
|
-
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; }
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
16
|
-
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); }
|
17
|
-
const NativeSkiaDomView = _Platform.Platform.OS !== "web" ? _SkiaDomViewNativeComponent.default :
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
19
|
-
null;
|
20
|
-
class SkiaDomView extends _react.default.Component {
|
21
|
-
constructor(props) {
|
22
|
-
super(props);
|
23
|
-
_defineProperty(this, "_nativeId", void 0);
|
24
|
-
_defineProperty(this, "requestId", 0);
|
25
|
-
this._nativeId = _SkiaViewNativeId.SkiaViewNativeId.current++;
|
26
|
-
const {
|
27
|
-
root,
|
28
|
-
onSize
|
29
|
-
} = props;
|
30
|
-
if (root) {
|
31
|
-
assertSkiaViewApi();
|
32
|
-
_api.SkiaViewApi.setJsiProperty(this._nativeId, "root", root);
|
33
|
-
}
|
34
|
-
if (onSize) {
|
35
|
-
assertSkiaViewApi();
|
36
|
-
_api.SkiaViewApi.setJsiProperty(this._nativeId, "onSize", onSize);
|
37
|
-
}
|
38
|
-
this.tick();
|
39
|
-
}
|
40
|
-
get nativeId() {
|
41
|
-
return this._nativeId;
|
42
|
-
}
|
43
|
-
componentDidUpdate(prevProps) {
|
44
|
-
const {
|
45
|
-
root,
|
46
|
-
onSize
|
47
|
-
} = this.props;
|
48
|
-
if (root !== prevProps.root) {
|
49
|
-
assertSkiaViewApi();
|
50
|
-
_api.SkiaViewApi.setJsiProperty(this._nativeId, "root", root);
|
51
|
-
}
|
52
|
-
if (onSize !== prevProps.onSize) {
|
53
|
-
assertSkiaViewApi();
|
54
|
-
_api.SkiaViewApi.setJsiProperty(this._nativeId, "onSize", onSize);
|
55
|
-
}
|
56
|
-
if (onSize !== prevProps.onSize || root !== prevProps.root) {
|
57
|
-
this.tick();
|
58
|
-
}
|
59
|
-
}
|
60
|
-
componentWillUnmount() {
|
61
|
-
if (this.requestId) {
|
62
|
-
cancelAnimationFrame(this.requestId);
|
63
|
-
}
|
64
|
-
}
|
65
|
-
tick() {
|
66
|
-
this.redraw();
|
67
|
-
if (this.props.mode === "continuous") {
|
68
|
-
this.requestId = requestAnimationFrame(this.tick.bind(this));
|
69
|
-
}
|
70
|
-
}
|
71
|
-
|
72
|
-
/**
|
73
|
-
* Creates a snapshot from the canvas in the surface
|
74
|
-
* @param rect Rect to use as bounds. Optional.
|
75
|
-
* @returns An Image object.
|
76
|
-
*/
|
77
|
-
makeImageSnapshot(rect) {
|
78
|
-
assertSkiaViewApi();
|
79
|
-
return _api.SkiaViewApi.makeImageSnapshot(this._nativeId, rect);
|
80
|
-
}
|
81
|
-
|
82
|
-
/**
|
83
|
-
* Creates a snapshot from the canvas in the surface
|
84
|
-
* @param rect Rect to use as bounds. Optional.
|
85
|
-
* @returns An Image object.
|
86
|
-
*/
|
87
|
-
makeImageSnapshotAsync(rect) {
|
88
|
-
assertSkiaViewApi();
|
89
|
-
return _api.SkiaViewApi.makeImageSnapshotAsync(this._nativeId, rect);
|
90
|
-
}
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Sends a redraw request to the native SkiaView.
|
94
|
-
*/
|
95
|
-
redraw() {
|
96
|
-
assertSkiaViewApi();
|
97
|
-
_api.SkiaViewApi.requestRedraw(this._nativeId);
|
98
|
-
}
|
99
|
-
render() {
|
100
|
-
const {
|
101
|
-
debug = false,
|
102
|
-
opaque = false,
|
103
|
-
...viewProps
|
104
|
-
} = this.props;
|
105
|
-
return /*#__PURE__*/_react.default.createElement(NativeSkiaDomView, _extends({
|
106
|
-
collapsable: false,
|
107
|
-
nativeID: `${this._nativeId}`,
|
108
|
-
debug: debug,
|
109
|
-
opaque: opaque
|
110
|
-
}, viewProps));
|
111
|
-
}
|
112
|
-
}
|
113
|
-
exports.SkiaDomView = SkiaDomView;
|
114
|
-
const assertSkiaViewApi = () => {
|
115
|
-
if (_api.SkiaViewApi === null || _api.SkiaViewApi.setJsiProperty === null || _api.SkiaViewApi.requestRedraw === null || _api.SkiaViewApi.makeImageSnapshot === null) {
|
116
|
-
throw Error("Skia View Api was not found.");
|
117
|
-
}
|
118
|
-
};
|
119
|
-
//# sourceMappingURL=SkiaDomView.js.map
|