@shopify/react-native-skia 0.1.164 → 0.1.165
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkRuntimeEffect.h +7 -2
- package/cpp/rnskia/RNSkDomView.cpp +1 -1
- package/cpp/rnskia/RNSkPlatformContext.h +2 -6
- package/cpp/rnskia/dom/base/DrawingContext.cpp +5 -38
- package/cpp/rnskia/dom/base/DrawingContext.h +3 -17
- package/cpp/rnskia/dom/nodes/JsiCircleNode.h +0 -2
- package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +1 -3
- package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +2 -2
- package/cpp/rnskia/dom/props/CircleProp.h +2 -0
- package/cpp/rnskia/dom/props/ColorProp.h +9 -4
- package/cpp/rnskia/dom/props/ImageProps.h +3 -2
- package/cpp/rnskia/dom/props/PaintProps.h +15 -6
- package/cpp/rnskia/dom/props/RectProp.h +11 -4
- package/cpp/rnskia/dom/props/UniformsProp.h +86 -123
- package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -6
- package/lib/commonjs/dom/nodes/datatypes/Circle.js +6 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js +3 -3
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js +2 -2
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js +2 -6
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/renderer/components/image/Image.js +0 -5
- package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageShader.js +20 -10
- package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Blur.js +10 -5
- package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js +10 -5
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Offset.js +12 -6
- package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js +12 -6
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js +10 -5
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js +14 -7
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js +10 -5
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Turbulence.js +14 -7
- package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Circle.js +0 -6
- package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.js +1 -4
- package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Oval.js +0 -4
- package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Path.js +12 -6
- package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Points.js +10 -5
- package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js +0 -3
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Vertices.js +10 -5
- package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Glyphs.js +12 -6
- package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Text.js +12 -6
- package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextBlob.js +12 -6
- package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextPath.js +10 -5
- package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js +3 -2
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.js +8 -1
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js +7 -3
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageNode.js +4 -2
- package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/renderer/components/Mask.js +2 -6
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js +0 -5
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js +20 -10
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js +10 -5
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js +10 -5
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js +12 -6
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js +12 -6
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js +10 -5
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js +14 -7
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js +10 -5
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/Turbulence.js +14 -7
- package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/module/renderer/components/shapes/Circle.js +0 -6
- package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.js +1 -4
- package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/module/renderer/components/shapes/Oval.js +0 -4
- package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/module/renderer/components/shapes/Path.js +12 -6
- package/lib/module/renderer/components/shapes/Path.js.map +1 -1
- package/lib/module/renderer/components/shapes/Points.js +10 -5
- package/lib/module/renderer/components/shapes/Points.js.map +1 -1
- package/lib/module/renderer/components/shapes/RoundedRect.js +0 -3
- package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Vertices.js +10 -5
- package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/module/renderer/components/text/Glyphs.js +12 -6
- package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/module/renderer/components/text/Text.js +12 -6
- package/lib/module/renderer/components/text/Text.js.map +1 -1
- package/lib/module/renderer/components/text/TextBlob.js +12 -6
- package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/module/renderer/components/text/TextPath.js +10 -5
- package/lib/module/renderer/components/text/TextPath.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js +3 -2
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -1
- package/lib/typescript/src/dom/types/Common.d.ts +4 -4
- package/lib/typescript/src/dom/types/Drawings.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Mask.d.ts +3 -9
- package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -8
- package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -12
- package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +2 -7
- package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +2 -7
- package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +2 -8
- package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +2 -8
- package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +2 -9
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +2 -9
- package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +1 -9
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +1 -7
- package/lib/typescript/src/renderer/components/shapes/Path.d.ts +2 -8
- package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +1 -6
- package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -7
- package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/Text.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/TextPath.d.ts +2 -7
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +5 -0
- package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +4 -0
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +3 -1
- package/package.json +1 -1
- package/src/dom/nodes/datatypes/Circle.ts +1 -1
- package/src/dom/nodes/datatypes/Rect.ts +3 -3
- package/src/dom/nodes/drawings/ImageNode.ts +2 -1
- package/src/dom/types/Common.ts +4 -4
- package/src/dom/types/Drawings.ts +1 -1
- package/src/renderer/components/Mask.tsx +8 -8
- package/src/renderer/components/image/Image.tsx +0 -6
- package/src/renderer/components/image/ImageShader.tsx +24 -12
- package/src/renderer/components/imageFilters/Blur.tsx +6 -7
- package/src/renderer/components/imageFilters/Morphology.tsx +6 -7
- package/src/renderer/components/imageFilters/Offset.tsx +7 -8
- package/src/renderer/components/maskFilters/Blur.tsx +7 -8
- package/src/renderer/components/pathEffects/Discrete.tsx +6 -9
- package/src/renderer/components/shaders/FractalNoise.tsx +18 -9
- package/src/renderer/components/shaders/Shader.tsx +6 -7
- package/src/renderer/components/shaders/Turbulence.tsx +15 -9
- package/src/renderer/components/shapes/Circle.tsx +0 -4
- package/src/renderer/components/shapes/FitBox.tsx +2 -6
- package/src/renderer/components/shapes/Oval.tsx +0 -5
- package/src/renderer/components/shapes/Path.tsx +7 -8
- package/src/renderer/components/shapes/Points.tsx +6 -7
- package/src/renderer/components/shapes/RoundedRect.tsx +0 -4
- package/src/renderer/components/shapes/Vertices.tsx +6 -7
- package/src/renderer/components/text/Glyphs.tsx +7 -8
- package/src/renderer/components/text/Text.tsx +7 -8
- package/src/renderer/components/text/TextBlob.tsx +7 -8
- package/src/renderer/components/text/TextPath.tsx +6 -7
- package/src/renderer/processors/Animations/Animations.ts +9 -3
- package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +5 -0
- package/src/skia/types/Shader/Shader.ts +5 -3
- package/src/skia/web/JsiSkRuntimeEffect.ts +5 -1
- package/src/skia/web/JsiSkRuntimeEffectFactory.ts +1 -1
@@ -9,12 +9,17 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
13
|
+
|
14
|
+
const Vertices = _ref => {
|
15
|
+
let {
|
16
|
+
mode = "triangles",
|
17
|
+
...props
|
18
|
+
} = _ref;
|
19
|
+
return /*#__PURE__*/_react.default.createElement("skVertices", _extends({
|
20
|
+
mode: mode
|
21
|
+
}, props));
|
14
22
|
};
|
15
23
|
|
16
24
|
exports.Vertices = Vertices;
|
17
|
-
Vertices.defaultProps = {
|
18
|
-
mode: "triangles"
|
19
|
-
};
|
20
25
|
//# sourceMappingURL=Vertices.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Vertices","
|
1
|
+
{"version":3,"names":["Vertices","mode","props"],"sources":["Vertices.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkiaDefaultProps } from \"../../processors\";\nimport type { VerticesProps } from \"../../../dom/types\";\n\nexport const Vertices = ({\n mode = \"triangles\",\n ...props\n}: SkiaDefaultProps<VerticesProps, \"mode\">) => {\n return <skVertices mode={mode} {...props} />;\n};\n"],"mappings":";;;;;;;AAAA;;;;;;AAKO,MAAMA,QAAQ,GAAG,QAGuB;EAAA,IAHtB;IACvBC,IAAI,GAAG,WADgB;IAEvB,GAAGC;EAFoB,CAGsB;EAC7C,oBAAO;IAAY,IAAI,EAAED;EAAlB,GAA4BC,KAA5B,EAAP;AACD,CALM"}
|
@@ -9,13 +9,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
13
|
+
|
14
|
+
const Glyphs = _ref => {
|
15
|
+
let {
|
16
|
+
x = 0,
|
17
|
+
y = 0,
|
18
|
+
...props
|
19
|
+
} = _ref;
|
20
|
+
return /*#__PURE__*/_react.default.createElement("skGlyphs", _extends({
|
21
|
+
x: x,
|
22
|
+
y: y
|
23
|
+
}, props));
|
14
24
|
};
|
15
25
|
|
16
26
|
exports.Glyphs = Glyphs;
|
17
|
-
Glyphs.defaultProps = {
|
18
|
-
x: 0,
|
19
|
-
y: 0
|
20
|
-
};
|
21
27
|
//# sourceMappingURL=Glyphs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Glyphs","
|
1
|
+
{"version":3,"names":["Glyphs","x","y","props"],"sources":["Glyphs.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { GlyphsProps } from \"../../../dom/types\";\nimport type { SkiaDefaultProps } from \"../../processors/Animations/Animations\";\n\nexport const Glyphs = ({\n x = 0,\n y = 0,\n ...props\n}: SkiaDefaultProps<GlyphsProps, \"x\" | \"y\">) => {\n return <skGlyphs x={x} y={y} {...props} />;\n};\n"],"mappings":";;;;;;;AAAA;;;;;;AAKO,MAAMA,MAAM,GAAG,QAI0B;EAAA,IAJzB;IACrBC,CAAC,GAAG,CADiB;IAErBC,CAAC,GAAG,CAFiB;IAGrB,GAAGC;EAHkB,CAIyB;EAC9C,oBAAO;IAAU,CAAC,EAAEF,CAAb;IAAgB,CAAC,EAAEC;EAAnB,GAA0BC,KAA1B,EAAP;AACD,CANM"}
|
@@ -9,13 +9,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
13
|
+
|
14
|
+
const Text = _ref => {
|
15
|
+
let {
|
16
|
+
x = 0,
|
17
|
+
y = 0,
|
18
|
+
...props
|
19
|
+
} = _ref;
|
20
|
+
return /*#__PURE__*/_react.default.createElement("skText", _extends({
|
21
|
+
x: x,
|
22
|
+
y: y
|
23
|
+
}, props));
|
14
24
|
};
|
15
25
|
|
16
26
|
exports.Text = Text;
|
17
|
-
Text.defaultProps = {
|
18
|
-
x: 0,
|
19
|
-
y: 0
|
20
|
-
};
|
21
27
|
//# sourceMappingURL=Text.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Text","
|
1
|
+
{"version":3,"names":["Text","x","y","props"],"sources":["Text.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkiaDefaultProps } from \"../../processors\";\nimport type { TextProps } from \"../../../dom/types\";\n\nexport const Text = ({\n x = 0,\n y = 0,\n ...props\n}: SkiaDefaultProps<TextProps, \"x\" | \"y\">) => {\n return <skText x={x} y={y} {...props} />;\n};\n"],"mappings":";;;;;;;AAAA;;;;;;AAKO,MAAMA,IAAI,GAAG,QAI0B;EAAA,IAJzB;IACnBC,CAAC,GAAG,CADe;IAEnBC,CAAC,GAAG,CAFe;IAGnB,GAAGC;EAHgB,CAIyB;EAC5C,oBAAO;IAAQ,CAAC,EAAEF,CAAX;IAAc,CAAC,EAAEC;EAAjB,GAAwBC,KAAxB,EAAP;AACD,CANM"}
|
@@ -9,13 +9,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
13
|
+
|
14
|
+
const TextBlob = _ref => {
|
15
|
+
let {
|
16
|
+
x = 0,
|
17
|
+
y = 0,
|
18
|
+
...props
|
19
|
+
} = _ref;
|
20
|
+
return /*#__PURE__*/_react.default.createElement("skTextBlob", _extends({
|
21
|
+
x: x,
|
22
|
+
y: y
|
23
|
+
}, props));
|
14
24
|
};
|
15
25
|
|
16
26
|
exports.TextBlob = TextBlob;
|
17
|
-
TextBlob.defaultProps = {
|
18
|
-
x: 0,
|
19
|
-
y: 0
|
20
|
-
};
|
21
27
|
//# sourceMappingURL=TextBlob.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["TextBlob","
|
1
|
+
{"version":3,"names":["TextBlob","x","y","props"],"sources":["TextBlob.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkiaDefaultProps } from \"../../processors\";\nimport type { TextBlobProps } from \"../../../dom/types\";\n\nexport const TextBlob = ({\n x = 0,\n y = 0,\n ...props\n}: SkiaDefaultProps<TextBlobProps, \"x\" | \"y\">) => {\n return <skTextBlob x={x} y={y} {...props} />;\n};\n"],"mappings":";;;;;;;AAAA;;;;;;AAKO,MAAMA,QAAQ,GAAG,QAI0B;EAAA,IAJzB;IACvBC,CAAC,GAAG,CADmB;IAEvBC,CAAC,GAAG,CAFmB;IAGvB,GAAGC;EAHoB,CAIyB;EAChD,oBAAO;IAAY,CAAC,EAAEF,CAAf;IAAkB,CAAC,EAAEC;EAArB,GAA4BC,KAA5B,EAAP;AACD,CANM"}
|
@@ -9,12 +9,17 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
13
|
+
|
14
|
+
const TextPath = _ref => {
|
15
|
+
let {
|
16
|
+
initialOffset = 0,
|
17
|
+
...props
|
18
|
+
} = _ref;
|
19
|
+
return /*#__PURE__*/_react.default.createElement("skTextPath", _extends({
|
20
|
+
initialOffset: initialOffset
|
21
|
+
}, props));
|
14
22
|
};
|
15
23
|
|
16
24
|
exports.TextPath = TextPath;
|
17
|
-
TextPath.defaultProps = {
|
18
|
-
initialOffset: 0
|
19
|
-
};
|
20
25
|
//# sourceMappingURL=TextPath.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["TextPath","
|
1
|
+
{"version":3,"names":["TextPath","initialOffset","props"],"sources":["TextPath.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkiaDefaultProps } from \"../../processors\";\nimport type { TextPathProps } from \"../../../dom/types\";\n\nexport const TextPath = ({\n initialOffset = 0,\n ...props\n}: SkiaDefaultProps<TextPathProps, \"initialOffset\">) => {\n return <skTextPath initialOffset={initialOffset} {...props} />;\n};\n"],"mappings":";;;;;;;AAAA;;;;;;AAKO,MAAMA,QAAQ,GAAG,QAGgC;EAAA,IAH/B;IACvBC,aAAa,GAAG,CADO;IAEvB,GAAGC;EAFoB,CAG+B;EACtD,oBAAO;IAAY,aAAa,EAAED;EAA3B,GAA8CC,KAA9C,EAAP;AACD,CALM"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isValue","value","undefined","__typename__","isSelector","selector","isAnimated","props","Object","values"],"sources":["Animations.ts"],"sourcesContent":["import type { SkiaSelector, SkiaValue } from \"../../../values\";\n\nexport const isValue = (value: unknown): value is SkiaValue<unknown> => {\n if (value === undefined || value === null) {\n return false;\n }\n try {\n if (\n typeof value === \"object\" &&\n \"__typename__\" in value &&\n (value as unknown as SkiaValue<unknown>).__typename__ === \"RNSkValue\"\n ) {\n return true;\n }\n } catch {}\n return false;\n};\n\nexport const isSelector = <T, R>(\n value: unknown\n): value is {\n selector: (v: T) => R;\n value: SkiaValue<T>;\n} => {\n if (value) {\n return (\n typeof value === \"object\" &&\n \"selector\" in value &&\n \"value\" in value &&\n (value as Record<string, unknown>).selector !== undefined &&\n (value as Record<string, unknown>).value !== undefined\n );\n }\n return false;\n};\n\nexport const isAnimated = <T>(props: AnimatedProps<T>) => {\n for (const value of Object.values(props)) {\n if (isValue(value) || isSelector(value)) {\n return true;\n }\n }\n return false;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnimatedProp<T, P = any> = T | SkiaValue<T> | SkiaSelector<T, P>;\n\nexport type AnimatedProps<T, O extends keyof T | never = never> = {\n [K in keyof T]: K extends \"children\"\n ? T[K]\n : K extends O\n ? T[K]\n : AnimatedProp<T[K]>;\n};\n\n
|
1
|
+
{"version":3,"names":["isValue","value","undefined","__typename__","isSelector","selector","isAnimated","props","Object","values"],"sources":["Animations.ts"],"sourcesContent":["import type { SkiaSelector, SkiaValue } from \"../../../values\";\n\nexport const isValue = (value: unknown): value is SkiaValue<unknown> => {\n if (value === undefined || value === null) {\n return false;\n }\n try {\n if (\n typeof value === \"object\" &&\n \"__typename__\" in value &&\n (value as unknown as SkiaValue<unknown>).__typename__ === \"RNSkValue\"\n ) {\n return true;\n }\n } catch {}\n return false;\n};\n\nexport const isSelector = <T, R>(\n value: unknown\n): value is {\n selector: (v: T) => R;\n value: SkiaValue<T>;\n} => {\n if (value) {\n return (\n typeof value === \"object\" &&\n \"selector\" in value &&\n \"value\" in value &&\n (value as Record<string, unknown>).selector !== undefined &&\n (value as Record<string, unknown>).value !== undefined\n );\n }\n return false;\n};\n\nexport const isAnimated = <T>(props: AnimatedProps<T>) => {\n for (const value of Object.values(props)) {\n if (isValue(value) || isSelector(value)) {\n return true;\n }\n }\n return false;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnimatedProp<T, P = any> = T | SkiaValue<T> | SkiaSelector<T, P>;\n\nexport type AnimatedProps<T, O extends keyof T | never = never> = {\n [K in keyof T]: K extends \"children\"\n ? T[K]\n : K extends O\n ? T[K]\n : AnimatedProp<T[K]>;\n};\n\nexport type SkiaProps<\n P = object,\n O extends keyof P | never = never\n> = AnimatedProps<P, O>;\n\ntype WithOptional<T extends object, N extends keyof T> = Omit<T, N> & {\n [K in N]?: T[K];\n};\n\nexport type SkiaDefaultProps<\n T extends object,\n N extends keyof T\n> = WithOptional<SkiaProps<T>, N>;\n"],"mappings":";;;;;;;AAEO,MAAMA,OAAO,GAAIC,KAAD,IAAiD;EACtE,IAAIA,KAAK,KAAKC,SAAV,IAAuBD,KAAK,KAAK,IAArC,EAA2C;IACzC,OAAO,KAAP;EACD;;EACD,IAAI;IACF,IACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,kBAAkBA,KADlB,IAECA,KAAD,CAAyCE,YAAzC,KAA0D,WAH5D,EAIE;MACA,OAAO,IAAP;IACD;EACF,CARD,CAQE,MAAM,CAAE;;EACV,OAAO,KAAP;AACD,CAdM;;;;AAgBA,MAAMC,UAAU,GACrBH,KADwB,IAKrB;EACH,IAAIA,KAAJ,EAAW;IACT,OACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,cAAcA,KADd,IAEA,WAAWA,KAFX,IAGCA,KAAD,CAAmCI,QAAnC,KAAgDH,SAHhD,IAICD,KAAD,CAAmCA,KAAnC,KAA6CC,SAL/C;EAOD;;EACD,OAAO,KAAP;AACD,CAhBM;;;;AAkBA,MAAMI,UAAU,GAAOC,KAAJ,IAAgC;EACxD,KAAK,MAAMN,KAAX,IAAoBO,MAAM,CAACC,MAAP,CAAcF,KAAd,CAApB,EAA0C;IACxC,IAAIP,OAAO,CAACC,KAAD,CAAP,IAAkBG,UAAU,CAACH,KAAD,CAAhC,EAAyC;MACvC,OAAO,IAAP;IACD;EACF;;EACD,OAAO,KAAP;AACD,CAPM,C,CASP"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["RuntimeEffect.ts"],"sourcesContent":["import type { SkShader } from \"../Shader\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkMatrix } from \"../Matrix\";\n\nexport interface SkSLUniform {\n columns: number;\n rows: number;\n /** The index into the uniforms array that this uniform begins. */\n slot: number;\n isInteger: boolean;\n}\n\nexport interface SkRuntimeShaderBuilder\n extends SkJSIInstance<\"RuntimeShaderBuilder\"> {\n setUniform(name: string, value: readonly number[]): void;\n}\n\nexport interface SkRuntimeEffect extends SkJSIInstance<\"RuntimeEffect\"> {\n /**\n * Returns a shader executed using the given uniform data.\n * @param uniforms\n * @param localMatrix\n */\n makeShader(uniforms: number[], localMatrix?: SkMatrix): SkShader;\n\n /**\n * Returns a shader executed using the given uniform data and the children as inputs.\n * @param uniforms\n * @param children\n * @param localMatrix\n */\n makeShaderWithChildren(\n uniforms: number[],\n children?: SkShader[],\n localMatrix?: SkMatrix\n ): SkShader;\n\n /**\n * Returns the nth uniform from the effect.\n * @param index\n */\n getUniform(index: number): SkSLUniform;\n\n /**\n * Returns the number of uniforms in the effect.\n */\n getUniformCount(): number;\n\n /**\n * Returns the total number of floats across all uniforms on the effect. This is the length\n * of the uniforms array expected by makeShader. For example, an effect with a single float3\n * uniform, would return 1 from `getUniformCount()`, but 3 from `getUniformFloatCount()`.\n */\n getUniformFloatCount(): number;\n\n /**\n * Returns the name of the nth effect uniform.\n * @param index\n */\n getUniformName(index: number): string;\n}\n"],"mappings":""}
|
1
|
+
{"version":3,"names":[],"sources":["RuntimeEffect.ts"],"sourcesContent":["import type { SkShader } from \"../Shader\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkMatrix } from \"../Matrix\";\n\nexport interface SkSLUniform {\n columns: number;\n rows: number;\n /** The index into the uniforms array that this uniform begins. */\n slot: number;\n isInteger: boolean;\n}\n\nexport interface SkRuntimeShaderBuilder\n extends SkJSIInstance<\"RuntimeShaderBuilder\"> {\n setUniform(name: string, value: readonly number[]): void;\n}\n\nexport interface SkRuntimeEffect extends SkJSIInstance<\"RuntimeEffect\"> {\n /**\n * Returns a shader executed using the given uniform data.\n * @param uniforms\n * @param localMatrix\n */\n makeShader(uniforms: number[], localMatrix?: SkMatrix): SkShader;\n\n /**\n * Returns a shader executed using the given uniform data and the children as inputs.\n * @param uniforms\n * @param children\n * @param localMatrix\n */\n makeShaderWithChildren(\n uniforms: number[],\n children?: SkShader[],\n localMatrix?: SkMatrix\n ): SkShader;\n\n /**\n * Returns the nth uniform from the effect.\n * @param index\n */\n getUniform(index: number): SkSLUniform;\n\n /**\n * Returns the number of uniforms in the effect.\n */\n getUniformCount(): number;\n\n /**\n * Returns the total number of floats across all uniforms on the effect. This is the length\n * of the uniforms array expected by makeShader. For example, an effect with a single float3\n * uniform, would return 1 from `getUniformCount()`, but 3 from `getUniformFloatCount()`.\n */\n getUniformFloatCount(): number;\n\n /**\n * Returns the name of the nth effect uniform.\n * @param index\n */\n getUniformName(index: number): string;\n\n /**\n * Returns the SkSL source of the runtime effect shader.\n */\n source(): string;\n}\n"],"mappings":""}
|
@@ -24,12 +24,13 @@ const processValue = value => {
|
|
24
24
|
const processUniforms = (source, uniforms, builder) => {
|
25
25
|
const processed = new Array(source.getUniformCount()).fill(0).flatMap((_, i) => {
|
26
26
|
const name = source.getUniformName(i);
|
27
|
-
const
|
27
|
+
const rawValue = uniforms[name];
|
28
28
|
|
29
|
-
if (
|
29
|
+
if (rawValue === undefined) {
|
30
30
|
throw new Error(`No value specified for uniform ${name}`);
|
31
31
|
}
|
32
32
|
|
33
|
+
const value = rawValue instanceof Float32Array ? Array.from(rawValue) : rawValue;
|
33
34
|
const result = Array.isArray(value) ? value.flatMap(processValue) : processValue(value);
|
34
35
|
builder === null || builder === void 0 ? void 0 : builder.setUniform(name, typeof result === "number" ? [result] : result);
|
35
36
|
return result;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isShader","obj","__typename__","isVector","x","undefined","y","processValue","value","processUniforms","source","uniforms","builder","processed","Array","getUniformCount","fill","flatMap","_","i","name","getUniformName","Error","result","isArray","setUniform","names","Object","keys","length","usedUniforms","map","unusedUniform","indexOf","filter","n","console","warn","join"],"sources":["Shader.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { Vector } from \"../Point\";\nimport type { SkRuntimeEffect, SkRuntimeShaderBuilder } from \"../RuntimeEffect\";\n\nexport const isShader = (obj: SkJSIInstance<string> | null): obj is SkShader =>\n obj !== null && obj.__typename__ === \"Shader\";\n\nexport type SkShader = SkJSIInstance<\"Shader\">;\n\nexport type UniformValue = number | Vector | readonly number[];\n\nexport type Uniform = UniformValue | readonly UniformValue[];\n\nexport interface Uniforms {\n [name: string]: Uniform;\n}\n\nconst isVector = (obj: unknown): obj is Vector =>\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (obj as any).x !== undefined && (obj as any).y !== undefined;\n\nconst processValue = (value: UniformValue): number | readonly number[] => {\n if (isVector(value)) {\n return [value.x, value.y];\n }\n return value;\n};\n\nexport const processUniforms = (\n source: SkRuntimeEffect,\n uniforms: Uniforms,\n builder?: SkRuntimeShaderBuilder\n) => {\n const processed = new Array(source.getUniformCount())\n .fill(0)\n .flatMap((_, i) => {\n const name = source.getUniformName(i);\n const
|
1
|
+
{"version":3,"names":["isShader","obj","__typename__","isVector","x","undefined","y","processValue","value","processUniforms","source","uniforms","builder","processed","Array","getUniformCount","fill","flatMap","_","i","name","getUniformName","rawValue","Error","Float32Array","from","result","isArray","setUniform","names","Object","keys","length","usedUniforms","map","unusedUniform","indexOf","filter","n","console","warn","join"],"sources":["Shader.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { Vector } from \"../Point\";\nimport type { SkRuntimeEffect, SkRuntimeShaderBuilder } from \"../RuntimeEffect\";\n\nexport const isShader = (obj: SkJSIInstance<string> | null): obj is SkShader =>\n obj !== null && obj.__typename__ === \"Shader\";\n\nexport type SkShader = SkJSIInstance<\"Shader\">;\n\nexport type UniformValue = number | Vector | readonly number[];\n\nexport type Uniform = UniformValue | readonly UniformValue[] | Float32Array;\n\nexport interface Uniforms {\n [name: string]: Uniform;\n}\n\nconst isVector = (obj: unknown): obj is Vector =>\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (obj as any).x !== undefined && (obj as any).y !== undefined;\n\nconst processValue = (value: UniformValue): number | readonly number[] => {\n if (isVector(value)) {\n return [value.x, value.y];\n }\n return value;\n};\n\nexport const processUniforms = (\n source: SkRuntimeEffect,\n uniforms: Uniforms,\n builder?: SkRuntimeShaderBuilder\n) => {\n const processed = new Array(source.getUniformCount())\n .fill(0)\n .flatMap((_, i) => {\n const name = source.getUniformName(i);\n const rawValue = uniforms[name];\n if (rawValue === undefined) {\n throw new Error(`No value specified for uniform ${name}`);\n }\n const value =\n rawValue instanceof Float32Array ? Array.from(rawValue) : rawValue;\n const result = Array.isArray(value)\n ? value.flatMap(processValue)\n : processValue(value as UniformValue);\n builder?.setUniform(name, typeof result === \"number\" ? [result] : result);\n return result;\n });\n const names = Object.keys(uniforms);\n if (names.length > source.getUniformCount()) {\n const usedUniforms = new Array(source.getUniformCount())\n .fill(0)\n .map((_, i) => source.getUniformName(i));\n const unusedUniform = names\n .map((name) => {\n if (usedUniforms.indexOf(name) === -1) {\n return name;\n }\n return null;\n })\n .filter((n) => n !== null);\n console.warn(\"Unused uniforms were provided: \" + unusedUniform.join(\", \"));\n }\n return processed;\n};\n"],"mappings":";;;;;;;AAIO,MAAMA,QAAQ,GAAIC,GAAD,IACtBA,GAAG,KAAK,IAAR,IAAgBA,GAAG,CAACC,YAAJ,KAAqB,QADhC;;;;AAaP,MAAMC,QAAQ,GAAIF,GAAD,IACf;AACA;AACCA,GAAD,CAAaG,CAAb,KAAmBC,SAAnB,IAAiCJ,GAAD,CAAaK,CAAb,KAAmBD,SAHrD;;AAKA,MAAME,YAAY,GAAIC,KAAD,IAAqD;EACxE,IAAIL,QAAQ,CAACK,KAAD,CAAZ,EAAqB;IACnB,OAAO,CAACA,KAAK,CAACJ,CAAP,EAAUI,KAAK,CAACF,CAAhB,CAAP;EACD;;EACD,OAAOE,KAAP;AACD,CALD;;AAOO,MAAMC,eAAe,GAAG,CAC7BC,MAD6B,EAE7BC,QAF6B,EAG7BC,OAH6B,KAI1B;EACH,MAAMC,SAAS,GAAG,IAAIC,KAAJ,CAAUJ,MAAM,CAACK,eAAP,EAAV,EACfC,IADe,CACV,CADU,EAEfC,OAFe,CAEP,CAACC,CAAD,EAAIC,CAAJ,KAAU;IACjB,MAAMC,IAAI,GAAGV,MAAM,CAACW,cAAP,CAAsBF,CAAtB,CAAb;IACA,MAAMG,QAAQ,GAAGX,QAAQ,CAACS,IAAD,CAAzB;;IACA,IAAIE,QAAQ,KAAKjB,SAAjB,EAA4B;MAC1B,MAAM,IAAIkB,KAAJ,CAAW,kCAAiCH,IAAK,EAAjD,CAAN;IACD;;IACD,MAAMZ,KAAK,GACTc,QAAQ,YAAYE,YAApB,GAAmCV,KAAK,CAACW,IAAN,CAAWH,QAAX,CAAnC,GAA0DA,QAD5D;IAEA,MAAMI,MAAM,GAAGZ,KAAK,CAACa,OAAN,CAAcnB,KAAd,IACXA,KAAK,CAACS,OAAN,CAAcV,YAAd,CADW,GAEXA,YAAY,CAACC,KAAD,CAFhB;IAGAI,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEgB,UAAT,CAAoBR,IAApB,EAA0B,OAAOM,MAAP,KAAkB,QAAlB,GAA6B,CAACA,MAAD,CAA7B,GAAwCA,MAAlE;IACA,OAAOA,MAAP;EACD,CAfe,CAAlB;EAgBA,MAAMG,KAAK,GAAGC,MAAM,CAACC,IAAP,CAAYpB,QAAZ,CAAd;;EACA,IAAIkB,KAAK,CAACG,MAAN,GAAetB,MAAM,CAACK,eAAP,EAAnB,EAA6C;IAC3C,MAAMkB,YAAY,GAAG,IAAInB,KAAJ,CAAUJ,MAAM,CAACK,eAAP,EAAV,EAClBC,IADkB,CACb,CADa,EAElBkB,GAFkB,CAEd,CAAChB,CAAD,EAAIC,CAAJ,KAAUT,MAAM,CAACW,cAAP,CAAsBF,CAAtB,CAFI,CAArB;IAGA,MAAMgB,aAAa,GAAGN,KAAK,CACxBK,GADmB,CACdd,IAAD,IAAU;MACb,IAAIa,YAAY,CAACG,OAAb,CAAqBhB,IAArB,MAA+B,CAAC,CAApC,EAAuC;QACrC,OAAOA,IAAP;MACD;;MACD,OAAO,IAAP;IACD,CANmB,EAOnBiB,MAPmB,CAOXC,CAAD,IAAOA,CAAC,KAAK,IAPD,CAAtB;IAQAC,OAAO,CAACC,IAAR,CAAa,oCAAoCL,aAAa,CAACM,IAAd,CAAmB,IAAnB,CAAjD;EACD;;EACD,OAAO5B,SAAP;AACD,CArCM"}
|
@@ -12,8 +12,13 @@ var _JsiSkMatrix = require("./JsiSkMatrix");
|
|
12
12
|
var _JsiSkShader = require("./JsiSkShader");
|
13
13
|
|
14
14
|
class JsiSkRuntimeEffect extends _Host.HostObject {
|
15
|
-
constructor(CanvasKit, ref) {
|
15
|
+
constructor(CanvasKit, ref, sksl) {
|
16
16
|
super(CanvasKit, ref, "RuntimeEffect");
|
17
|
+
this.sksl = sksl;
|
18
|
+
}
|
19
|
+
|
20
|
+
source() {
|
21
|
+
return this.sksl;
|
17
22
|
}
|
18
23
|
|
19
24
|
makeShader(uniforms, localMatrix) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkRuntimeEffect","HostObject","constructor","CanvasKit","ref","makeShader","uniforms","localMatrix","JsiSkShader","undefined","JsiSkMatrix","fromValue","makeShaderWithChildren","children","map","child","getUniform","index","getUniformCount","getUniformFloatCount","getUniformName"],"sources":["JsiSkRuntimeEffect.ts"],"sourcesContent":["import type { CanvasKit, RuntimeEffect } from \"canvaskit-wasm\";\n\nimport type { SkMatrix, SkShader } from \"../types\";\nimport type { SkRuntimeEffect } from \"../types/RuntimeEffect/RuntimeEffect\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkRuntimeEffect\n extends HostObject<RuntimeEffect, \"RuntimeEffect\">\n implements SkRuntimeEffect\n{\n constructor(CanvasKit: CanvasKit, ref: RuntimeEffect) {\n super(CanvasKit, ref, \"RuntimeEffect\");\n }\n\n makeShader(uniforms: number[], localMatrix?: SkMatrix) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n uniforms,\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n makeShaderWithChildren(\n uniforms: number[],\n children?: SkShader[],\n localMatrix?: SkMatrix\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderWithChildren(\n uniforms,\n children?.map((child) => JsiSkShader.fromValue(child)),\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n getUniform(index: number) {\n return this.ref.getUniform(index);\n }\n\n getUniformCount() {\n return this.ref.getUniformCount();\n }\n\n getUniformFloatCount() {\n return this.ref.getUniformFloatCount();\n }\n\n getUniformName(index: number) {\n return this.ref.getUniformName(index);\n }\n}\n"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AAEO,MAAMA,kBAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,
|
1
|
+
{"version":3,"names":["JsiSkRuntimeEffect","HostObject","constructor","CanvasKit","ref","sksl","source","makeShader","uniforms","localMatrix","JsiSkShader","undefined","JsiSkMatrix","fromValue","makeShaderWithChildren","children","map","child","getUniform","index","getUniformCount","getUniformFloatCount","getUniformName"],"sources":["JsiSkRuntimeEffect.ts"],"sourcesContent":["import type { CanvasKit, RuntimeEffect } from \"canvaskit-wasm\";\n\nimport type { SkMatrix, SkShader } from \"../types\";\nimport type { SkRuntimeEffect } from \"../types/RuntimeEffect/RuntimeEffect\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkRuntimeEffect\n extends HostObject<RuntimeEffect, \"RuntimeEffect\">\n implements SkRuntimeEffect\n{\n constructor(CanvasKit: CanvasKit, ref: RuntimeEffect, private sksl: string) {\n super(CanvasKit, ref, \"RuntimeEffect\");\n }\n\n source() {\n return this.sksl;\n }\n\n makeShader(uniforms: number[], localMatrix?: SkMatrix) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n uniforms,\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n makeShaderWithChildren(\n uniforms: number[],\n children?: SkShader[],\n localMatrix?: SkMatrix\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderWithChildren(\n uniforms,\n children?.map((child) => JsiSkShader.fromValue(child)),\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n getUniform(index: number) {\n return this.ref.getUniform(index);\n }\n\n getUniformCount() {\n return this.ref.getUniformCount();\n }\n\n getUniformFloatCount() {\n return this.ref.getUniformFloatCount();\n }\n\n getUniformName(index: number) {\n return this.ref.getUniformName(index);\n }\n}\n"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AAEO,MAAMA,kBAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmDC,IAAnD,EAAiE;IAC1E,MAAMF,SAAN,EAAiBC,GAAjB,EAAsB,eAAtB;IAD0E,KAAdC,IAAc,GAAdA,IAAc;EAE3E;;EAEDC,MAAM,GAAG;IACP,OAAO,KAAKD,IAAZ;EACD;;EAEDE,UAAU,CAACC,QAAD,EAAqBC,WAArB,EAA6C;IACrD,OAAO,IAAIC,wBAAJ,CACL,KAAKP,SADA,EAEL,KAAKC,GAAL,CAASG,UAAT,CACEC,QADF,EAEEC,WAAW,KAAKE,SAAhB,GACIC,wBAAA,CAAYC,SAAZ,CAAsBJ,WAAtB,CADJ,GAEIA,WAJN,CAFK,CAAP;EASD;;EAEDK,sBAAsB,CACpBN,QADoB,EAEpBO,QAFoB,EAGpBN,WAHoB,EAIpB;IACA,OAAO,IAAIC,wBAAJ,CACL,KAAKP,SADA,EAEL,KAAKC,GAAL,CAASU,sBAAT,CACEN,QADF,EAEEO,QAFF,aAEEA,QAFF,uBAEEA,QAAQ,CAAEC,GAAV,CAAeC,KAAD,IAAWP,wBAAA,CAAYG,SAAZ,CAAsBI,KAAtB,CAAzB,CAFF,EAGER,WAAW,KAAKE,SAAhB,GACIC,wBAAA,CAAYC,SAAZ,CAAsBJ,WAAtB,CADJ,GAEIA,WALN,CAFK,CAAP;EAUD;;EAEDS,UAAU,CAACC,KAAD,EAAgB;IACxB,OAAO,KAAKf,GAAL,CAASc,UAAT,CAAoBC,KAApB,CAAP;EACD;;EAEDC,eAAe,GAAG;IAChB,OAAO,KAAKhB,GAAL,CAASgB,eAAT,EAAP;EACD;;EAEDC,oBAAoB,GAAG;IACrB,OAAO,KAAKjB,GAAL,CAASiB,oBAAT,EAAP;EACD;;EAEDC,cAAc,CAACH,KAAD,EAAgB;IAC5B,OAAO,KAAKf,GAAL,CAASkB,cAAT,CAAwBH,KAAxB,CAAP;EACD;;AApDH"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkRuntimeEffectFactory","Host","constructor","CanvasKit","Make","sksl","re","RuntimeEffect","JsiSkRuntimeEffect"],"sources":["JsiSkRuntimeEffectFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { RuntimeEffectFactory } from \"../types/RuntimeEffect/RuntimeEffectFactory\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkRuntimeEffect } from \"./JsiSkRuntimeEffect\";\n\nexport class JsiSkRuntimeEffectFactory\n extends Host\n implements RuntimeEffectFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make(sksl: string) {\n const re = this.CanvasKit.RuntimeEffect.Make(sksl);\n if (re === null) {\n return null;\n }\n return new JsiSkRuntimeEffect(this.CanvasKit, re);\n }\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;AAEO,MAAMA,yBAAN,SACGC,UADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,CAACC,IAAD,EAAe;IACjB,MAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,aAAf,CAA6BH,IAA7B,CAAkCC,IAAlC,CAAX;;IACA,IAAIC,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIE,sCAAJ,CAAuB,KAAKL,SAA5B,EAAuCG,EAAvC,CAAP;EACD;;AAXH"}
|
1
|
+
{"version":3,"names":["JsiSkRuntimeEffectFactory","Host","constructor","CanvasKit","Make","sksl","re","RuntimeEffect","JsiSkRuntimeEffect"],"sources":["JsiSkRuntimeEffectFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { RuntimeEffectFactory } from \"../types/RuntimeEffect/RuntimeEffectFactory\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkRuntimeEffect } from \"./JsiSkRuntimeEffect\";\n\nexport class JsiSkRuntimeEffectFactory\n extends Host\n implements RuntimeEffectFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make(sksl: string) {\n const re = this.CanvasKit.RuntimeEffect.Make(sksl);\n if (re === null) {\n return null;\n }\n return new JsiSkRuntimeEffect(this.CanvasKit, re, sksl);\n }\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;AAEO,MAAMA,yBAAN,SACGC,UADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,CAACC,IAAD,EAAe;IACjB,MAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,aAAf,CAA6BH,IAA7B,CAAkCC,IAAlC,CAAX;;IACA,IAAIC,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIE,sCAAJ,CAAuB,KAAKL,SAA5B,EAAuCG,EAAvC,EAA2CD,IAA3C,CAAP;EACD;;AAXH"}
|
@@ -2,6 +2,8 @@ export const isCircleScalarDef = def => // We have an issue to check property ex
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
3
3
|
def.cx !== undefined;
|
4
4
|
export const processCircle = (Skia, def) => {
|
5
|
+
var _def$c;
|
6
|
+
|
5
7
|
if (isCircleScalarDef(def)) {
|
6
8
|
return {
|
7
9
|
c: Skia.Point(def.cx, def.cy),
|
@@ -9,6 +11,11 @@ export const processCircle = (Skia, def) => {
|
|
9
11
|
};
|
10
12
|
}
|
11
13
|
|
12
|
-
return def
|
14
|
+
return { ...def,
|
15
|
+
c: (_def$c = def.c) !== null && _def$c !== void 0 ? _def$c : {
|
16
|
+
x: 0,
|
17
|
+
y: 0
|
18
|
+
}
|
19
|
+
};
|
13
20
|
};
|
14
21
|
//# sourceMappingURL=Circle.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isCircleScalarDef","def","cx","undefined","processCircle","Skia","c","Point","cy","r"],"sources":["Circle.ts"],"sourcesContent":["import type { Skia } from \"../../../skia/types\";\nimport type { CircleDef, ScalarCircleDef } from \"../../types\";\n\nexport const isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef =>\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (def as any).cx !== undefined;\n\nexport const processCircle = (Skia: Skia, def: CircleDef) => {\n if (isCircleScalarDef(def)) {\n return { c: Skia.Point(def.cx, def.cy), r: def.r };\n }\n return def;\n};\n"],"mappings":"AAGA,OAAO,MAAMA,iBAAiB,GAAIC,GAAD,IAC/B;AACA;AACCA,GAAD,CAAaC,EAAb,KAAoBC,SAHf;AAKP,OAAO,MAAMC,aAAa,GAAG,CAACC,IAAD,EAAaJ,GAAb,KAAgC;EAC3D,IAAID,iBAAiB,CAACC,GAAD,CAArB,EAA4B;IAC1B,OAAO;MAAEK,CAAC,EAAED,IAAI,CAACE,KAAL,CAAWN,GAAG,CAACC,EAAf,EAAmBD,GAAG,CAACO,EAAvB,CAAL;MAAiCC,CAAC,EAAER,GAAG,CAACQ;IAAxC,CAAP;EACD;;EACD,
|
1
|
+
{"version":3,"names":["isCircleScalarDef","def","cx","undefined","processCircle","Skia","c","Point","cy","r","x","y"],"sources":["Circle.ts"],"sourcesContent":["import type { Skia } from \"../../../skia/types\";\nimport type { CircleDef, ScalarCircleDef } from \"../../types\";\n\nexport const isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef =>\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (def as any).cx !== undefined;\n\nexport const processCircle = (Skia: Skia, def: CircleDef) => {\n if (isCircleScalarDef(def)) {\n return { c: Skia.Point(def.cx, def.cy), r: def.r };\n }\n return { ...def, c: def.c ?? { x: 0, y: 0 } };\n};\n"],"mappings":"AAGA,OAAO,MAAMA,iBAAiB,GAAIC,GAAD,IAC/B;AACA;AACCA,GAAD,CAAaC,EAAb,KAAoBC,SAHf;AAKP,OAAO,MAAMC,aAAa,GAAG,CAACC,IAAD,EAAaJ,GAAb,KAAgC;EAAA;;EAC3D,IAAID,iBAAiB,CAACC,GAAD,CAArB,EAA4B;IAC1B,OAAO;MAAEK,CAAC,EAAED,IAAI,CAACE,KAAL,CAAWN,GAAG,CAACC,EAAf,EAAmBD,GAAG,CAACO,EAAvB,CAAL;MAAiCC,CAAC,EAAER,GAAG,CAACQ;IAAxC,CAAP;EACD;;EACD,OAAO,EAAE,GAAGR,GAAL;IAAUK,CAAC,YAAEL,GAAG,CAACK,CAAN,2CAAW;MAAEI,CAAC,EAAE,CAAL;MAAQC,CAAC,EAAE;IAAX;EAAtB,CAAP;AACD,CALM"}
|
@@ -9,15 +9,19 @@ const isRectCtor = def => def.rect === undefined;
|
|
9
9
|
|
10
10
|
export const processRect = (Skia, def) => {
|
11
11
|
if (isRectCtor(def)) {
|
12
|
-
|
12
|
+
var _def$x, _def$y;
|
13
|
+
|
14
|
+
return Skia.XYWHRect((_def$x = def.x) !== null && _def$x !== void 0 ? _def$x : 0, (_def$y = def.y) !== null && _def$y !== void 0 ? _def$y : 0, def.width, def.height);
|
13
15
|
} else {
|
14
16
|
return def.rect;
|
15
17
|
}
|
16
18
|
};
|
17
19
|
export const processRRect = (Skia, def) => {
|
18
20
|
if (isRRectCtor(def)) {
|
19
|
-
|
20
|
-
|
21
|
+
var _def$r, _def$x2, _def$y2;
|
22
|
+
|
23
|
+
const r = processRadius(Skia, (_def$r = def.r) !== null && _def$r !== void 0 ? _def$r : 0);
|
24
|
+
return Skia.RRectXY(Skia.XYWHRect((_def$x2 = def.x) !== null && _def$x2 !== void 0 ? _def$x2 : 0, (_def$y2 = def.y) !== null && _def$y2 !== void 0 ? _def$y2 : 0, def.width, def.height), r.x, r.y);
|
21
25
|
} else {
|
22
26
|
return def.rect;
|
23
27
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["processRadius","isEdge","pos","b","x","y","width","height","isRRectCtor","def","rect","undefined","isRectCtor","processRect","Skia","XYWHRect","processRRect","r","RRectXY"],"sources":["Rect.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Skia, SkRect, Vector } from \"../../../skia/types\";\nimport type { RectCtor, RectDef, RRectCtor, RRectDef } from \"../../types\";\n\nimport { processRadius } from \"./Radius\";\n\nexport const isEdge = (pos: Vector, b: SkRect) =>\n pos.x === b.x || pos.y === b.y || pos.x === b.width || pos.y === b.height;\n\n// We have an issue to check property existence on JSI backed instances\nconst isRRectCtor = (def: RRectDef): def is RRectCtor =>\n (def as any).rect === undefined;\n// We have an issue to check property existence on JSI backed instances\nconst isRectCtor = (def: RectDef): def is RectCtor =>\n (def as any).rect === undefined;\n\nexport const processRect = (Skia: Skia, def: RectDef) => {\n if (isRectCtor(def)) {\n return Skia.XYWHRect(def.x, def.y, def.width, def.height);\n } else {\n return def.rect;\n }\n};\n\nexport const processRRect = (Skia: Skia, def: RRectDef) => {\n if (isRRectCtor(def)) {\n const r = processRadius(Skia, def.r);\n return Skia.RRectXY(\n Skia.XYWHRect(def.x, def.y, def.width, def.height),\n r.x,\n r.y\n );\n } else {\n return def.rect;\n }\n};\n"],"mappings":"AAAA;AAIA,SAASA,aAAT,QAA8B,UAA9B;AAEA,OAAO,MAAMC,MAAM,GAAG,CAACC,GAAD,EAAcC,CAAd,KACpBD,GAAG,CAACE,CAAJ,KAAUD,CAAC,CAACC,CAAZ,IAAiBF,GAAG,CAACG,CAAJ,KAAUF,CAAC,CAACE,CAA7B,IAAkCH,GAAG,CAACE,CAAJ,KAAUD,CAAC,CAACG,KAA9C,IAAuDJ,GAAG,CAACG,CAAJ,KAAUF,CAAC,CAACI,MAD9D,C,CAGP;;AACA,MAAMC,WAAW,GAAIC,GAAD,IACjBA,GAAD,CAAaC,IAAb,KAAsBC,SADxB,C,CAEA;;;AACA,MAAMC,UAAU,GAAIH,GAAD,IAChBA,GAAD,CAAaC,IAAb,KAAsBC,SADxB;;AAGA,OAAO,MAAME,WAAW,GAAG,CAACC,IAAD,EAAaL,GAAb,KAA8B;EACvD,IAAIG,UAAU,CAACH,GAAD,CAAd,EAAqB;IACnB,OAAOK,IAAI,CAACC,QAAL,
|
1
|
+
{"version":3,"names":["processRadius","isEdge","pos","b","x","y","width","height","isRRectCtor","def","rect","undefined","isRectCtor","processRect","Skia","XYWHRect","processRRect","r","RRectXY"],"sources":["Rect.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Skia, SkRect, Vector } from \"../../../skia/types\";\nimport type { RectCtor, RectDef, RRectCtor, RRectDef } from \"../../types\";\n\nimport { processRadius } from \"./Radius\";\n\nexport const isEdge = (pos: Vector, b: SkRect) =>\n pos.x === b.x || pos.y === b.y || pos.x === b.width || pos.y === b.height;\n\n// We have an issue to check property existence on JSI backed instances\nconst isRRectCtor = (def: RRectDef): def is RRectCtor =>\n (def as any).rect === undefined;\n// We have an issue to check property existence on JSI backed instances\nconst isRectCtor = (def: RectDef): def is RectCtor =>\n (def as any).rect === undefined;\n\nexport const processRect = (Skia: Skia, def: RectDef) => {\n if (isRectCtor(def)) {\n return Skia.XYWHRect(def.x ?? 0, def.y ?? 0, def.width, def.height);\n } else {\n return def.rect;\n }\n};\n\nexport const processRRect = (Skia: Skia, def: RRectDef) => {\n if (isRRectCtor(def)) {\n const r = processRadius(Skia, def.r ?? 0);\n return Skia.RRectXY(\n Skia.XYWHRect(def.x ?? 0, def.y ?? 0, def.width, def.height),\n r.x,\n r.y\n );\n } else {\n return def.rect;\n }\n};\n"],"mappings":"AAAA;AAIA,SAASA,aAAT,QAA8B,UAA9B;AAEA,OAAO,MAAMC,MAAM,GAAG,CAACC,GAAD,EAAcC,CAAd,KACpBD,GAAG,CAACE,CAAJ,KAAUD,CAAC,CAACC,CAAZ,IAAiBF,GAAG,CAACG,CAAJ,KAAUF,CAAC,CAACE,CAA7B,IAAkCH,GAAG,CAACE,CAAJ,KAAUD,CAAC,CAACG,KAA9C,IAAuDJ,GAAG,CAACG,CAAJ,KAAUF,CAAC,CAACI,MAD9D,C,CAGP;;AACA,MAAMC,WAAW,GAAIC,GAAD,IACjBA,GAAD,CAAaC,IAAb,KAAsBC,SADxB,C,CAEA;;;AACA,MAAMC,UAAU,GAAIH,GAAD,IAChBA,GAAD,CAAaC,IAAb,KAAsBC,SADxB;;AAGA,OAAO,MAAME,WAAW,GAAG,CAACC,IAAD,EAAaL,GAAb,KAA8B;EACvD,IAAIG,UAAU,CAACH,GAAD,CAAd,EAAqB;IAAA;;IACnB,OAAOK,IAAI,CAACC,QAAL,WAAcN,GAAG,CAACL,CAAlB,2CAAuB,CAAvB,YAA0BK,GAAG,CAACJ,CAA9B,2CAAmC,CAAnC,EAAsCI,GAAG,CAACH,KAA1C,EAAiDG,GAAG,CAACF,MAArD,CAAP;EACD,CAFD,MAEO;IACL,OAAOE,GAAG,CAACC,IAAX;EACD;AACF,CANM;AAQP,OAAO,MAAMM,YAAY,GAAG,CAACF,IAAD,EAAaL,GAAb,KAA+B;EACzD,IAAID,WAAW,CAACC,GAAD,CAAf,EAAsB;IAAA;;IACpB,MAAMQ,CAAC,GAAGjB,aAAa,CAACc,IAAD,YAAOL,GAAG,CAACQ,CAAX,2CAAgB,CAAhB,CAAvB;IACA,OAAOH,IAAI,CAACI,OAAL,CACLJ,IAAI,CAACC,QAAL,YAAcN,GAAG,CAACL,CAAlB,6CAAuB,CAAvB,aAA0BK,GAAG,CAACJ,CAA9B,6CAAmC,CAAnC,EAAsCI,GAAG,CAACH,KAA1C,EAAiDG,GAAG,CAACF,MAArD,CADK,EAELU,CAAC,CAACb,CAFG,EAGLa,CAAC,CAACZ,CAHG,CAAP;EAKD,CAPD,MAOO;IACL,OAAOI,GAAG,CAACC,IAAX;EACD;AACF,CAXM"}
|
@@ -7,10 +7,12 @@ export class ImageNode extends JsiDrawingNode {
|
|
7
7
|
}
|
8
8
|
|
9
9
|
deriveProps() {
|
10
|
+
var _this$props$fit;
|
11
|
+
|
10
12
|
const {
|
11
|
-
image
|
12
|
-
fit
|
13
|
+
image
|
13
14
|
} = this.props;
|
15
|
+
const fit = (_this$props$fit = this.props.fit) !== null && _this$props$fit !== void 0 ? _this$props$fit : "contain";
|
14
16
|
const rect = processRect(this.Skia, this.props);
|
15
17
|
const {
|
16
18
|
src,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NodeType","fitRects","processRect","JsiDrawingNode","ImageNode","constructor","ctx","props","Image","deriveProps","image","fit","rect","Skia","src","dst","x","y","width","height","draw","canvas","paint","derived","Error","drawImageRect"],"sources":["ImageNode.ts"],"sourcesContent":["import type { SkRect } from \"../../../skia/types\";\nimport type { DrawingContext, ImageProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { fitRects, processRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class ImageNode extends JsiDrawingNode<\n ImageProps,\n { src: SkRect; dst: SkRect }\n> {\n constructor(ctx: NodeContext, props: ImageProps) {\n super(ctx, NodeType.Image, props);\n }\n\n deriveProps() {\n const { image
|
1
|
+
{"version":3,"names":["NodeType","fitRects","processRect","JsiDrawingNode","ImageNode","constructor","ctx","props","Image","deriveProps","image","fit","rect","Skia","src","dst","x","y","width","height","draw","canvas","paint","derived","Error","drawImageRect"],"sources":["ImageNode.ts"],"sourcesContent":["import type { SkRect } from \"../../../skia/types\";\nimport type { DrawingContext, ImageProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { fitRects, processRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class ImageNode extends JsiDrawingNode<\n ImageProps,\n { src: SkRect; dst: SkRect }\n> {\n constructor(ctx: NodeContext, props: ImageProps) {\n super(ctx, NodeType.Image, props);\n }\n\n deriveProps() {\n const { image } = this.props;\n const fit = this.props.fit ?? \"contain\";\n const rect = processRect(this.Skia, this.props);\n const { src, dst } = fitRects(\n fit,\n {\n x: 0,\n y: 0,\n width: image.width(),\n height: image.height(),\n },\n rect\n );\n return { src, dst };\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { image } = this.props;\n if (!this.derived) {\n throw new Error(\"ImageNode: src and dst are undefined\");\n }\n const { src, dst } = this.derived;\n canvas.drawImageRect(image, src, dst, paint);\n }\n}\n"],"mappings":"AAEA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,QAAT,EAAmBC,WAAnB,QAAsC,cAAtC;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,SAAN,SAAwBD,cAAxB,CAGL;EACAE,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAsC;IAC/C,MAAMD,GAAN,EAAWN,QAAQ,CAACQ,KAApB,EAA2BD,KAA3B;EACD;;EAEDE,WAAW,GAAG;IAAA;;IACZ,MAAM;MAAEC;IAAF,IAAY,KAAKH,KAAvB;IACA,MAAMI,GAAG,sBAAG,KAAKJ,KAAL,CAAWI,GAAd,6DAAqB,SAA9B;IACA,MAAMC,IAAI,GAAGV,WAAW,CAAC,KAAKW,IAAN,EAAY,KAAKN,KAAjB,CAAxB;IACA,MAAM;MAAEO,GAAF;MAAOC;IAAP,IAAed,QAAQ,CAC3BU,GAD2B,EAE3B;MACEK,CAAC,EAAE,CADL;MAEEC,CAAC,EAAE,CAFL;MAGEC,KAAK,EAAER,KAAK,CAACQ,KAAN,EAHT;MAIEC,MAAM,EAAET,KAAK,CAACS,MAAN;IAJV,CAF2B,EAQ3BP,IAR2B,CAA7B;IAUA,OAAO;MAAEE,GAAF;MAAOC;IAAP,CAAP;EACD;;EAEDK,IAAI,OAAoC;IAAA,IAAnC;MAAEC,MAAF;MAAUC;IAAV,CAAmC;IACtC,MAAM;MAAEZ;IAAF,IAAY,KAAKH,KAAvB;;IACA,IAAI,CAAC,KAAKgB,OAAV,EAAmB;MACjB,MAAM,IAAIC,KAAJ,CAAU,sCAAV,CAAN;IACD;;IACD,MAAM;MAAEV,GAAF;MAAOC;IAAP,IAAe,KAAKQ,OAA1B;IACAF,MAAM,CAACI,aAAP,CAAqBf,KAArB,EAA4BI,GAA5B,EAAiCC,GAAjC,EAAsCO,KAAtC;EACD;;AA7BD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["Common.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type {\n BlendMode,\n Color,\n PaintStyle,\n SkMatrix,\n SkPaint,\n SkPath,\n SkRect,\n SkRRect,\n StrokeCap,\n StrokeJoin,\n Transforms2d,\n Vector,\n} from \"../../skia/types\";\n\nexport type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;\n\nexport type PathDef = string | SkPath;\n\nexport type ClipDef = SkRRect | SkRect | PathDef;\n\nexport type Fit =\n | \"cover\"\n | \"contain\"\n | \"fill\"\n | \"fitHeight\"\n | \"fitWidth\"\n | \"none\"\n | \"scaleDown\";\n\nexport type Radius = number | Vector;\n\nexport interface ChildrenProps {\n children?: ReactNode | ReactNode[];\n}\n\nexport interface RectCtor {\n x
|
1
|
+
{"version":3,"names":[],"sources":["Common.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type {\n BlendMode,\n Color,\n PaintStyle,\n SkMatrix,\n SkPaint,\n SkPath,\n SkRect,\n SkRRect,\n StrokeCap,\n StrokeJoin,\n Transforms2d,\n Vector,\n} from \"../../skia/types\";\n\nexport type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;\n\nexport type PathDef = string | SkPath;\n\nexport type ClipDef = SkRRect | SkRect | PathDef;\n\nexport type Fit =\n | \"cover\"\n | \"contain\"\n | \"fill\"\n | \"fitHeight\"\n | \"fitWidth\"\n | \"none\"\n | \"scaleDown\";\n\nexport type Radius = number | Vector;\n\nexport interface ChildrenProps {\n children?: ReactNode | ReactNode[];\n}\n\nexport interface RectCtor {\n x?: number;\n y?: number;\n width: number;\n height: number;\n}\n\nexport interface RRectCtor extends RectCtor {\n r?: Radius;\n}\n\nexport type RectDef = RectCtor | { rect: SkRect };\nexport type RRectDef = RRectCtor | { rect: SkRRect };\n\nexport interface PointCircleDef {\n c?: Vector;\n r: number;\n}\n\nexport interface ScalarCircleDef {\n cx: number;\n cy: number;\n r: number;\n}\n\nexport type CircleDef = PointCircleDef | ScalarCircleDef;\n\nexport interface TransformProps {\n transform?: Transforms2d;\n origin?: Vector;\n matrix?: SkMatrix;\n}\n\nexport interface PaintProps extends ChildrenProps {\n color?: Color;\n strokeWidth?: number;\n blendMode?: SkEnum<typeof BlendMode>;\n style?: SkEnum<typeof PaintStyle>;\n strokeJoin?: SkEnum<typeof StrokeJoin>;\n strokeCap?: SkEnum<typeof StrokeCap>;\n strokeMiter?: number;\n opacity?: number;\n antiAlias?: boolean;\n}\n\nexport interface GroupProps extends PaintProps, TransformProps {\n clip?: ClipDef;\n invertClip?: boolean;\n layer?: SkPaint | boolean;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["Drawings.ts"],"sourcesContent":["import type {\n FillType,\n SkImage,\n StrokeOpts,\n Vector,\n Color,\n SkPoint,\n BlendMode,\n PointMode,\n VertexMode,\n SkFont,\n SkRRect,\n SkTextBlob,\n SkPicture,\n SkSVG,\n SkPaint,\n SkRect,\n} from \"../../skia/types\";\n\nimport type {\n CircleDef,\n Fit,\n GroupProps,\n PathDef,\n RectDef,\n RRectDef,\n SkEnum,\n} from \"./Common\";\nimport type { DrawingContext } from \"./DrawingContext\";\n\nexport interface DrawingNodeProps extends GroupProps {\n paint?: SkPaint;\n}\n\nexport type ImageProps = DrawingNodeProps &\n RectDef & {\n fit
|
1
|
+
{"version":3,"names":[],"sources":["Drawings.ts"],"sourcesContent":["import type {\n FillType,\n SkImage,\n StrokeOpts,\n Vector,\n Color,\n SkPoint,\n BlendMode,\n PointMode,\n VertexMode,\n SkFont,\n SkRRect,\n SkTextBlob,\n SkPicture,\n SkSVG,\n SkPaint,\n SkRect,\n} from \"../../skia/types\";\n\nimport type {\n CircleDef,\n Fit,\n GroupProps,\n PathDef,\n RectDef,\n RRectDef,\n SkEnum,\n} from \"./Common\";\nimport type { DrawingContext } from \"./DrawingContext\";\n\nexport interface DrawingNodeProps extends GroupProps {\n paint?: SkPaint;\n}\n\nexport type ImageProps = DrawingNodeProps &\n RectDef & {\n fit?: Fit;\n image: SkImage;\n };\n\nexport type CircleProps = CircleDef & DrawingNodeProps;\n\nexport interface PathProps extends DrawingNodeProps {\n path: PathDef;\n start: number;\n end: number;\n stroke?: StrokeOpts;\n fillType?: SkEnum<typeof FillType>;\n}\n\nexport interface CustomDrawingNodeProps extends DrawingNodeProps {\n drawing: (ctx: DrawingContext) => void;\n}\n\nexport interface LineProps extends DrawingNodeProps {\n p1: Vector;\n p2: Vector;\n}\n\nexport type OvalProps = RectDef & DrawingNodeProps;\n\nexport type RectProps = RectDef & DrawingNodeProps;\n\nexport type RoundedRectProps = RRectDef & DrawingNodeProps;\n\nexport interface CubicBezierHandle {\n pos: Vector;\n c1: Vector;\n c2: Vector;\n}\n\nexport interface PatchProps extends DrawingNodeProps {\n colors?: Color[];\n patch: [\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle\n ];\n texture?: readonly [SkPoint, SkPoint, SkPoint, SkPoint];\n blendMode?: SkEnum<typeof BlendMode>;\n}\n\nexport interface VerticesProps extends DrawingNodeProps {\n colors?: string[];\n vertices: SkPoint[];\n textures?: SkPoint[];\n mode: SkEnum<typeof VertexMode>;\n blendMode?: SkEnum<typeof BlendMode>;\n indices?: number[];\n}\n\nexport type ImageSVGProps = RectDef & {\n svg: SkSVG;\n} & DrawingNodeProps;\n\nexport interface PictureProps extends DrawingNodeProps {\n picture: SkPicture;\n}\n\nexport interface PointsProps extends DrawingNodeProps {\n points: SkPoint[];\n mode: SkEnum<typeof PointMode>;\n}\n\nexport interface DiffRectProps extends DrawingNodeProps {\n inner: SkRRect;\n outer: SkRRect;\n}\n\nexport interface TextProps extends DrawingNodeProps {\n font: SkFont;\n text: string;\n x: number;\n y: number;\n}\n\nexport interface TextPathProps extends DrawingNodeProps {\n font: SkFont;\n text: string;\n path: PathDef;\n initialOffset: number;\n}\n\nexport interface TextBlobProps extends DrawingNodeProps {\n blob: SkTextBlob;\n x: number;\n y: number;\n}\n\nexport interface Glyph {\n id: number;\n pos: SkPoint;\n}\n\nexport interface GlyphsProps extends DrawingNodeProps {\n font: SkFont;\n x: number;\n y: number;\n glyphs: Glyph[];\n}\n\nexport interface BoxProps extends DrawingNodeProps {\n box: SkRRect | SkRect;\n}\n\nexport interface BoxShadowProps {\n dx?: number;\n dy?: number;\n spread?: number;\n blur: number;\n color?: Color;\n inner?: boolean;\n}\n"],"mappings":""}
|
@@ -6,8 +6,8 @@ export const Mask = _ref => {
|
|
6
6
|
let {
|
7
7
|
children,
|
8
8
|
mask,
|
9
|
-
mode,
|
10
|
-
clip
|
9
|
+
mode = "alpha",
|
10
|
+
clip = true
|
11
11
|
} = _ref;
|
12
12
|
return /*#__PURE__*/React.createElement(Group, {
|
13
13
|
layer: true
|
@@ -23,8 +23,4 @@ export const Mask = _ref => {
|
|
23
23
|
blendMode: "srcIn"
|
24
24
|
}, children));
|
25
25
|
};
|
26
|
-
Mask.defaultProps = {
|
27
|
-
mode: "alpha",
|
28
|
-
clip: true
|
29
|
-
};
|
30
26
|
//# sourceMappingURL=Mask.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Group","LumaColorFilter","Paint","Mask","children","mask","mode","clip"
|
1
|
+
{"version":3,"names":["React","Group","LumaColorFilter","Paint","Mask","children","mask","mode","clip"],"sources":["Mask.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport React from \"react\";\n\nimport { Group } from \"./Group\";\nimport { LumaColorFilter } from \"./colorFilters/LumaColorFilter\";\nimport { Paint } from \"./Paint\";\n\ninterface MaskProps {\n mode?: \"luminance\" | \"alpha\";\n clip?: boolean;\n mask: ReactNode | ReactNode[];\n children: ReactNode | ReactNode[];\n}\n\nexport const Mask = ({\n children,\n mask,\n mode = \"alpha\",\n clip = true,\n}: MaskProps) => {\n return (\n <Group layer>\n <Group\n layer={\n <Paint blendMode=\"src\">\n {mode === \"luminance\" && <LumaColorFilter />}\n </Paint>\n }\n >\n {mask}\n {clip && <Group layer={<Paint blendMode=\"dstIn\" />}>{children}</Group>}\n </Group>\n <Group blendMode=\"srcIn\">{children}</Group>\n </Group>\n );\n};\n"],"mappings":"AACA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,KAAT,QAAsB,SAAtB;AASA,OAAO,MAAMC,IAAI,GAAG,QAKH;EAAA,IALI;IACnBC,QADmB;IAEnBC,IAFmB;IAGnBC,IAAI,GAAG,OAHY;IAInBC,IAAI,GAAG;EAJY,CAKJ;EACf,oBACE,oBAAC,KAAD;IAAO,KAAK;EAAZ,gBACE,oBAAC,KAAD;IACE,KAAK,eACH,oBAAC,KAAD;MAAO,SAAS,EAAC;IAAjB,GACGD,IAAI,KAAK,WAAT,iBAAwB,oBAAC,eAAD,OAD3B;EAFJ,GAOGD,IAPH,EAQGE,IAAI,iBAAI,oBAAC,KAAD;IAAO,KAAK,eAAE,oBAAC,KAAD;MAAO,SAAS,EAAC;IAAjB;EAAd,GAA4CH,QAA5C,CARX,CADF,eAWE,oBAAC,KAAD;IAAO,SAAS,EAAC;EAAjB,GAA0BA,QAA1B,CAXF,CADF;AAeD,CArBM"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Image","props"
|
1
|
+
{"version":3,"names":["React","Image","props"],"sources":["Image.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../../processors\";\nimport type { ImageProps } from \"../../../dom/types\";\n\nexport const Image = (props: SkiaProps<ImageProps>) => {\n return <skImage {...props} />;\n};\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,KAAK,GAAIC,KAAD,IAAkC;EACrD,oBAAO,+BAAaA,KAAb,CAAP;AACD,CAFM"}
|
@@ -1,13 +1,23 @@
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
1
3
|
import React from "react";
|
2
|
-
export const ImageShader =
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
export const ImageShader = _ref => {
|
5
|
+
let {
|
6
|
+
tx = "decal",
|
7
|
+
ty = "decal",
|
8
|
+
fm = "nearest",
|
9
|
+
mm = "none",
|
10
|
+
fit = "none",
|
11
|
+
transform = [],
|
12
|
+
...props
|
13
|
+
} = _ref;
|
14
|
+
return /*#__PURE__*/React.createElement("skImageShader", _extends({
|
15
|
+
tx: tx,
|
16
|
+
ty: ty,
|
17
|
+
fm: fm,
|
18
|
+
mm: mm,
|
19
|
+
fit: fit,
|
20
|
+
transform: transform
|
21
|
+
}, props));
|
12
22
|
};
|
13
23
|
//# sourceMappingURL=ImageShader.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","ImageShader","
|
1
|
+
{"version":3,"names":["React","ImageShader","tx","ty","fm","mm","fit","transform","props"],"sources":["ImageShader.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { ImageShaderProps } from \"../../../dom/types\";\nimport type { SkiaDefaultProps } from \"../../processors\";\n\nexport const ImageShader = ({\n tx = \"decal\",\n ty = \"decal\",\n fm = \"nearest\",\n mm = \"none\",\n fit = \"none\",\n transform = [],\n ...props\n}: SkiaDefaultProps<\n ImageShaderProps,\n \"tx\" | \"ty\" | \"fm\" | \"mm\" | \"fit\" | \"transform\"\n>) => {\n return (\n <skImageShader\n tx={tx}\n ty={ty}\n fm={fm}\n mm={mm}\n fit={fit}\n transform={transform}\n {...props}\n />\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,WAAW,GAAG,QAWrB;EAAA,IAXsB;IAC1BC,EAAE,GAAG,OADqB;IAE1BC,EAAE,GAAG,OAFqB;IAG1BC,EAAE,GAAG,SAHqB;IAI1BC,EAAE,GAAG,MAJqB;IAK1BC,GAAG,GAAG,MALoB;IAM1BC,SAAS,GAAG,EANc;IAO1B,GAAGC;EAPuB,CAWtB;EACJ,oBACE;IACE,EAAE,EAAEN,EADN;IAEE,EAAE,EAAEC,EAFN;IAGE,EAAE,EAAEC,EAHN;IAIE,EAAE,EAAEC,EAJN;IAKE,GAAG,EAAEC,GALP;IAME,SAAS,EAAEC;EANb,GAOMC,KAPN,EADF;AAWD,CAvBM"}
|
@@ -1,8 +1,13 @@
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
1
3
|
import React from "react";
|
2
|
-
export const Blur =
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
export const Blur = _ref => {
|
5
|
+
let {
|
6
|
+
mode = "decal",
|
7
|
+
...props
|
8
|
+
} = _ref;
|
9
|
+
return /*#__PURE__*/React.createElement("skBlurImageFilter", _extends({
|
10
|
+
mode: mode
|
11
|
+
}, props));
|
7
12
|
};
|
8
13
|
//# sourceMappingURL=Blur.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Blur","
|
1
|
+
{"version":3,"names":["React","Blur","mode","props"],"sources":["Blur.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkiaDefaultProps } from \"../../processors/Animations/Animations\";\nimport type { BlurImageFilterProps } from \"../../../dom/types\";\n\nexport const Blur = ({\n mode = \"decal\",\n ...props\n}: SkiaDefaultProps<BlurImageFilterProps, \"mode\">) => {\n return <skBlurImageFilter mode={mode} {...props} />;\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,IAAI,GAAG,QAGkC;EAAA,IAHjC;IACnBC,IAAI,GAAG,OADY;IAEnB,GAAGC;EAFgB,CAGiC;EACpD,oBAAO;IAAmB,IAAI,EAAED;EAAzB,GAAmCC,KAAnC,EAAP;AACD,CALM"}
|
@@ -1,8 +1,13 @@
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
1
3
|
import React from "react";
|
2
|
-
export const Morphology =
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
export const Morphology = _ref => {
|
5
|
+
let {
|
6
|
+
operator = "dilate",
|
7
|
+
...props
|
8
|
+
} = _ref;
|
9
|
+
return /*#__PURE__*/React.createElement("skMorphologyImageFilter", _extends({
|
10
|
+
operator: operator
|
11
|
+
}, props));
|
7
12
|
};
|
8
13
|
//# sourceMappingURL=Morphology.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Morphology","
|
1
|
+
{"version":3,"names":["React","Morphology","operator","props"],"sources":["Morphology.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { MorphologyImageFilterProps } from \"../../../dom/types\";\nimport type { SkiaDefaultProps } from \"../../processors\";\n\nexport const Morphology = ({\n operator = \"dilate\",\n ...props\n}: SkiaDefaultProps<MorphologyImageFilterProps, \"operator\">) => {\n return <skMorphologyImageFilter operator={operator} {...props} />;\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,UAAU,GAAG,QAGsC;EAAA,IAHrC;IACzBC,QAAQ,GAAG,QADc;IAEzB,GAAGC;EAFsB,CAGqC;EAC9D,oBAAO;IAAyB,QAAQ,EAAED;EAAnC,GAAiDC,KAAjD,EAAP;AACD,CALM"}
|