@shopify/react-native-skia 0.1.190 → 0.1.192
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkColorFilter.h +2 -17
- package/cpp/api/JsiSkContourMeasure.h +3 -17
- package/cpp/api/JsiSkContourMeasureIter.h +3 -18
- package/cpp/api/JsiSkData.h +1 -18
- package/cpp/api/JsiSkFont.h +4 -14
- package/cpp/api/JsiSkHostObjects.h +85 -10
- package/cpp/api/JsiSkImage.h +1 -12
- package/cpp/api/JsiSkImageFilter.h +1 -17
- package/cpp/api/JsiSkMaskFilter.h +1 -17
- package/cpp/api/JsiSkMatrix.h +3 -6
- package/cpp/api/JsiSkPaint.h +3 -15
- package/cpp/api/JsiSkPath.h +2 -15
- package/cpp/api/JsiSkPathEffect.h +2 -17
- package/cpp/api/JsiSkPicture.h +4 -18
- package/cpp/api/JsiSkPictureRecorder.h +4 -1
- package/cpp/api/JsiSkPoint.h +6 -1
- package/cpp/api/JsiSkRRect.h +6 -1
- package/cpp/api/JsiSkRSXform.h +4 -6
- package/cpp/api/JsiSkRect.h +6 -2
- package/cpp/api/JsiSkRuntimeEffect.h +4 -7
- package/cpp/api/JsiSkRuntimeShaderBuilder.h +2 -10
- package/cpp/api/JsiSkSVG.h +1 -10
- package/cpp/api/JsiSkShader.h +2 -16
- package/cpp/api/JsiSkSurface.h +3 -16
- package/cpp/api/JsiSkTextBlob.h +2 -18
- package/cpp/api/JsiSkTypeface.h +1 -22
- package/cpp/api/JsiSkVertices.h +3 -17
- package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +24 -3
- package/cpp/rnskia/dom/nodes/JsiPathNode.h +11 -11
- package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -2
- package/cpp/rnskia/values/RNSkValue.h +1 -1
- package/lib/commonjs/Platform/Platform.web.js +1 -1
- package/lib/commonjs/Platform/Platform.web.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +7 -2
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +29 -7
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PathNode.js +6 -2
- package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +7 -2
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +17 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Math.d.ts +1 -0
- package/lib/commonjs/renderer/processors/math/Math.js +9 -1
- package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
- package/lib/commonjs/skia/core/Data.d.ts +2 -2
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Data/Data.d.ts +2 -2
- package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.d.ts +2 -2
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/JsiInstance.d.ts +4 -4
- package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/commonjs/skia/web/Host.d.ts +1 -0
- package/lib/commonjs/skia/web/Host.js +2 -0
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.js +6 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkColorFilter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js +6 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkData.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkData.js +4 -2
- package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkFont.js +6 -0
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +6 -4
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js +5 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPaint.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPath.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPicture.js +6 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPoint.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js +5 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js +5 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js +5 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRect.js +5 -0
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShader.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkShader.js +6 -0
- package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkSurface.js +6 -0
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkTextBlob.js +6 -0
- package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkTypeface.js +6 -4
- package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVertices.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js +6 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/types.d.ts +1 -1
- package/lib/commonjs/values/types.js.map +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.d.ts +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.js +9 -4
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.web.js +14 -4
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +2 -1
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/Platform/Platform.web.js +1 -1
- package/lib/module/Platform/Platform.web.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageSVG.d.ts +7 -2
- package/lib/module/dom/nodes/drawings/ImageSVG.js +29 -6
- package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PathNode.js +5 -2
- package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +7 -2
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/renderer/Canvas.js +15 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/processors/math/Math.d.ts +1 -0
- package/lib/module/renderer/processors/math/Math.js +5 -0
- package/lib/module/renderer/processors/math/Math.js.map +1 -1
- package/lib/module/skia/core/Data.d.ts +2 -2
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/types/Data/Data.d.ts +2 -2
- package/lib/module/skia/types/Data/Data.js.map +1 -1
- package/lib/module/skia/types/Image/Image.d.ts +2 -2
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/JsiInstance.d.ts +4 -4
- package/lib/module/skia/types/JsiInstance.js.map +1 -1
- package/lib/module/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/module/skia/types/SVG/SVG.js.map +1 -1
- package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/module/skia/web/Host.d.ts +1 -0
- package/lib/module/skia/web/Host.js +2 -0
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -0
- package/lib/module/skia/web/JsiSkCanvas.js +6 -0
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkColorFilter.js +6 -0
- package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.d.ts +1 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js +6 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js +6 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/module/skia/web/JsiSkData.d.ts +1 -1
- package/lib/module/skia/web/JsiSkData.js +4 -2
- package/lib/module/skia/web/JsiSkData.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.d.ts +1 -0
- package/lib/module/skia/web/JsiSkFont.js +6 -0
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.d.ts +1 -1
- package/lib/module/skia/web/JsiSkImage.js +6 -4
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkImageFilter.js +6 -0
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js +6 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.d.ts +1 -0
- package/lib/module/skia/web/JsiSkMatrix.js +5 -0
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPaint.js +6 -0
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPath.js +6 -0
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPathEffect.js +6 -0
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPicture.js +6 -0
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js +6 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkPoint.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPoint.js +5 -0
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRRect.js +5 -0
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRSXform.js +5 -0
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRect.js +5 -0
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkShader.d.ts +1 -0
- package/lib/module/skia/web/JsiSkShader.js +6 -0
- package/lib/module/skia/web/JsiSkShader.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/module/skia/web/JsiSkSurface.js +6 -0
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.d.ts +1 -0
- package/lib/module/skia/web/JsiSkTextBlob.js +6 -0
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypeface.d.ts +1 -1
- package/lib/module/skia/web/JsiSkTypeface.js +6 -4
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/module/skia/web/JsiSkVertices.d.ts +1 -0
- package/lib/module/skia/web/JsiSkVertices.js +6 -0
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.js +1 -1
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/types.d.ts +1 -1
- package/lib/module/values/types.js.map +1 -1
- package/lib/module/values/web/RNSkComputedValue.d.ts +1 -1
- package/lib/module/values/web/RNSkComputedValue.js +1 -1
- package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.d.ts +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.js +9 -4
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/views/SkiaDomView.web.js +13 -4
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/types.d.ts +2 -1
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +7 -2
- package/lib/typescript/src/dom/types/Drawings.d.ts +7 -2
- package/lib/typescript/src/renderer/processors/math/Math.d.ts +1 -0
- package/lib/typescript/src/skia/core/Data.d.ts +2 -2
- package/lib/typescript/src/skia/types/Data/Data.d.ts +2 -2
- package/lib/typescript/src/skia/types/Image/Image.d.ts +2 -2
- package/lib/typescript/src/skia/types/JsiInstance.d.ts +4 -4
- package/lib/typescript/src/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/typescript/src/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/typescript/src/skia/web/Host.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkColorFilter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkData.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkFont.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkImage.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkShader.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +1 -0
- package/lib/typescript/src/values/types.d.ts +1 -1
- package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -1
- package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -1
- package/lib/typescript/src/views/types.d.ts +2 -1
- package/package.json +4 -1
- package/scripts/install-npm.js +2 -3
- package/src/Platform/Platform.web.tsx +1 -1
- package/src/dom/nodes/drawings/ImageSVG.ts +17 -6
- package/src/dom/nodes/drawings/PathNode.ts +10 -1
- package/src/dom/types/Drawings.ts +7 -2
- package/src/renderer/Canvas.tsx +21 -1
- package/src/renderer/processors/math/Math.ts +5 -0
- package/src/skia/core/Data.ts +3 -3
- package/src/skia/types/Data/Data.ts +2 -2
- package/src/skia/types/Image/Image.ts +2 -2
- package/src/skia/types/JsiInstance.ts +4 -4
- package/src/skia/types/SVG/SVG.ts +2 -2
- package/src/skia/types/Typeface/Typeface.ts +2 -2
- package/src/skia/web/Host.ts +2 -0
- package/src/skia/web/JsiSkCanvas.ts +4 -0
- package/src/skia/web/JsiSkColorFilter.ts +4 -0
- package/src/skia/web/JsiSkContourMeasure.ts +4 -0
- package/src/skia/web/JsiSkContourMeasureIter.ts +4 -0
- package/src/skia/web/JsiSkData.ts +3 -3
- package/src/skia/web/JsiSkFont.ts +4 -0
- package/src/skia/web/JsiSkImage.ts +2 -2
- package/src/skia/web/JsiSkImageFilter.ts +4 -0
- package/src/skia/web/JsiSkMaskFilter.ts +4 -0
- package/src/skia/web/JsiSkMatrix.ts +4 -0
- package/src/skia/web/JsiSkPaint.ts +4 -0
- package/src/skia/web/JsiSkPath.ts +4 -0
- package/src/skia/web/JsiSkPathEffect.ts +4 -0
- package/src/skia/web/JsiSkPicture.ts +4 -0
- package/src/skia/web/JsiSkPictureRecorder.ts +4 -0
- package/src/skia/web/JsiSkPoint.ts +4 -0
- package/src/skia/web/JsiSkRRect.ts +4 -0
- package/src/skia/web/JsiSkRSXform.ts +4 -0
- package/src/skia/web/JsiSkRect.ts +4 -0
- package/src/skia/web/JsiSkRuntimeEffect.ts +4 -0
- package/src/skia/web/JsiSkShader.ts +4 -0
- package/src/skia/web/JsiSkSurface.ts +4 -0
- package/src/skia/web/JsiSkTextBlob.ts +4 -0
- package/src/skia/web/JsiSkTypeface.ts +2 -2
- package/src/skia/web/JsiSkVertices.ts +4 -0
- package/src/values/hooks/useComputedValue.ts +1 -1
- package/src/values/types.ts +1 -1
- package/src/values/web/RNSkComputedValue.ts +1 -1
- package/src/values/web/RNSkReadonlyValue.ts +1 -1
- package/src/views/SkiaBaseWebView.tsx +9 -4
- package/src/views/SkiaDomView.web.tsx +6 -1
- package/src/views/types.ts +2 -1
@@ -32,12 +32,6 @@ struct RuntimeEffectUniform {
|
|
32
32
|
class JsiSkRuntimeEffect
|
33
33
|
: public JsiSkWrappingSkPtrHostObject<SkRuntimeEffect> {
|
34
34
|
public:
|
35
|
-
static sk_sp<SkRuntimeEffect> fromValue(jsi::Runtime &runtime,
|
36
|
-
const jsi::Value &obj) {
|
37
|
-
const auto &object = obj.asObject(runtime);
|
38
|
-
return object.asHostObject<JsiSkRuntimeEffect>(runtime)->getObject();
|
39
|
-
}
|
40
|
-
|
41
35
|
JSI_HOST_FUNCTION(makeShader) {
|
42
36
|
auto uniforms = castUniforms(runtime, arguments[0]);
|
43
37
|
|
@@ -121,6 +115,8 @@ public:
|
|
121
115
|
return jsi::String::createFromAscii(runtime, getObject()->source());
|
122
116
|
}
|
123
117
|
|
118
|
+
EXPORT_JSI_API_TYPENAME(JsiSkRuntimeEffect, "RuntimeEffect")
|
119
|
+
|
124
120
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRuntimeEffect, makeShader),
|
125
121
|
JSI_EXPORT_FUNC(JsiSkRuntimeEffect,
|
126
122
|
makeShaderWithChildren),
|
@@ -129,7 +125,8 @@ public:
|
|
129
125
|
getUniformFloatCount),
|
130
126
|
JSI_EXPORT_FUNC(JsiSkRuntimeEffect, getUniformName),
|
131
127
|
JSI_EXPORT_FUNC(JsiSkRuntimeEffect, getUniform),
|
132
|
-
JSI_EXPORT_FUNC(JsiSkRuntimeEffect, source)
|
128
|
+
JSI_EXPORT_FUNC(JsiSkRuntimeEffect, source),
|
129
|
+
JSI_EXPORT_FUNC(JsiSkRuntimeEffect, dispose))
|
133
130
|
|
134
131
|
JsiSkRuntimeEffect(std::shared_ptr<RNSkPlatformContext> context,
|
135
132
|
sk_sp<SkRuntimeEffect> rt)
|
@@ -47,16 +47,8 @@ public:
|
|
47
47
|
return jsi::Value::undefined();
|
48
48
|
}
|
49
49
|
|
50
|
-
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRuntimeShaderBuilder, setUniform)
|
51
|
-
|
52
|
-
/**
|
53
|
-
Returns the underlying object from a host object of this type
|
54
|
-
*/
|
55
|
-
static std::shared_ptr<SkRuntimeShaderBuilder>
|
56
|
-
fromValue(jsi::Runtime &runtime, const jsi::Value &obj) {
|
57
|
-
const auto &object = obj.asObject(runtime);
|
58
|
-
return object.asHostObject<JsiSkRuntimeShaderBuilder>(runtime)->getObject();
|
59
|
-
}
|
50
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRuntimeShaderBuilder, setUniform),
|
51
|
+
JSI_EXPORT_FUNC(JsiSkRuntimeShaderBuilder, dispose))
|
60
52
|
|
61
53
|
/**
|
62
54
|
Returns the jsi object from a host object of this type
|
package/cpp/api/JsiSkSVG.h
CHANGED
@@ -24,9 +24,7 @@ public:
|
|
24
24
|
: JsiSkWrappingSkPtrHostObject<SkSVGDOM>(std::move(context),
|
25
25
|
std::move(svgdom)) {}
|
26
26
|
|
27
|
-
|
28
|
-
return jsi::String::createFromUtf8(runtime, "SVG");
|
29
|
-
}
|
27
|
+
EXPORT_JSI_API_TYPENAME(JsiSkSVG, "SVG")
|
30
28
|
|
31
29
|
JSI_HOST_FUNCTION(width) {
|
32
30
|
return static_cast<double>(getObject()->containerSize().width());
|
@@ -36,13 +34,6 @@ public:
|
|
36
34
|
return static_cast<double>(getObject()->containerSize().height());
|
37
35
|
}
|
38
36
|
|
39
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkSVG, __typename__))
|
40
|
-
|
41
|
-
JSI_HOST_FUNCTION(dispose) {
|
42
|
-
setObject(nullptr);
|
43
|
-
return jsi::Value::undefined();
|
44
|
-
}
|
45
|
-
|
46
37
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkSVG, width),
|
47
38
|
JSI_EXPORT_FUNC(JsiSkSVG, height),
|
48
39
|
JSI_EXPORT_FUNC(JsiSkSVG, dispose))
|
package/cpp/api/JsiSkShader.h
CHANGED
@@ -26,21 +26,7 @@ public:
|
|
26
26
|
: JsiSkWrappingSkPtrHostObject<SkShader>(std::move(context),
|
27
27
|
std::move(shader)) {}
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
return jsi::String::createFromUtf8(runtime, "Shader");
|
32
|
-
}
|
33
|
-
|
34
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkShader, __typename__))
|
35
|
-
|
36
|
-
/**
|
37
|
-
Returns the underlying object from a host object of this type
|
38
|
-
*/
|
39
|
-
static sk_sp<SkShader> fromValue(jsi::Runtime &runtime,
|
40
|
-
const jsi::Value &obj) {
|
41
|
-
return obj.asObject(runtime)
|
42
|
-
.asHostObject<JsiSkShader>(runtime)
|
43
|
-
->getObject();
|
44
|
-
}
|
29
|
+
EXPORT_JSI_API_TYPENAME(JsiSkShader, "Shader")
|
30
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkShader, dispose))
|
45
31
|
};
|
46
32
|
} // namespace RNSkia
|
package/cpp/api/JsiSkSurface.h
CHANGED
@@ -29,10 +29,7 @@ public:
|
|
29
29
|
: JsiSkWrappingSkPtrHostObject<SkSurface>(std::move(context),
|
30
30
|
std::move(surface)) {}
|
31
31
|
|
32
|
-
|
33
|
-
JSI_PROPERTY_GET(__typename__) {
|
34
|
-
return jsi::String::createFromUtf8(runtime, "Surface");
|
35
|
-
}
|
32
|
+
EXPORT_JSI_API_TYPENAME(JsiSkSurface, "Surface")
|
36
33
|
|
37
34
|
JSI_HOST_FUNCTION(getCanvas) {
|
38
35
|
return jsi::Object::createFromHostObject(
|
@@ -58,20 +55,10 @@ public:
|
|
58
55
|
runtime, std::make_shared<JsiSkImage>(getContext(), std::move(image)));
|
59
56
|
}
|
60
57
|
|
61
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkSurface, __typename__))
|
62
58
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkSurface, getCanvas),
|
63
59
|
JSI_EXPORT_FUNC(JsiSkSurface, makeImageSnapshot),
|
64
|
-
JSI_EXPORT_FUNC(JsiSkSurface, flush)
|
65
|
-
|
66
|
-
/**
|
67
|
-
Returns the underlying object from a host object of this type
|
68
|
-
*/
|
69
|
-
static sk_sp<SkSurface> fromValue(jsi::Runtime &runtime,
|
70
|
-
const jsi::Value &obj) {
|
71
|
-
return obj.asObject(runtime)
|
72
|
-
.asHostObject<JsiSkSurface>(runtime)
|
73
|
-
->getObject();
|
74
|
-
}
|
60
|
+
JSI_EXPORT_FUNC(JsiSkSurface, flush),
|
61
|
+
JSI_EXPORT_FUNC(JsiSkSurface, dispose))
|
75
62
|
};
|
76
63
|
|
77
64
|
} // namespace RNSkia
|
package/cpp/api/JsiSkTextBlob.h
CHANGED
@@ -25,23 +25,7 @@ public:
|
|
25
25
|
: JsiSkWrappingSkPtrHostObject<SkTextBlob>(std::move(context),
|
26
26
|
std::move(shader)) {}
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
JSI_PROPERTY_GET(__typename__) {
|
31
|
-
return jsi::String::createFromUtf8(runtime, "TextBlob");
|
32
|
-
}
|
33
|
-
|
34
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkTextBlob,
|
35
|
-
__typename__), )
|
36
|
-
|
37
|
-
/**
|
38
|
-
Returns the underlying object from a host object of this type
|
39
|
-
*/
|
40
|
-
static sk_sp<SkTextBlob> fromValue(jsi::Runtime &runtime,
|
41
|
-
const jsi::Value &obj) {
|
42
|
-
return obj.asObject(runtime)
|
43
|
-
.asHostObject<JsiSkTextBlob>(runtime)
|
44
|
-
->getObject();
|
45
|
-
}
|
28
|
+
EXPORT_JSI_API_TYPENAME(JsiSkTextBlob, "TextBlob")
|
29
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkTextBlob, dispose))
|
46
30
|
};
|
47
31
|
} // namespace RNSkia
|
package/cpp/api/JsiSkTypeface.h
CHANGED
@@ -22,34 +22,13 @@ namespace jsi = facebook::jsi;
|
|
22
22
|
|
23
23
|
class JsiSkTypeface : public JsiSkWrappingSkPtrHostObject<SkTypeface> {
|
24
24
|
public:
|
25
|
-
|
26
|
-
JSI_PROPERTY_GET(__typename__) {
|
27
|
-
return jsi::String::createFromUtf8(runtime, "Typeface");
|
28
|
-
}
|
29
|
-
|
30
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkTypeface, __typename__))
|
31
|
-
|
32
|
-
JSI_HOST_FUNCTION(dispose) {
|
33
|
-
setObject(nullptr);
|
34
|
-
return jsi::Value::undefined();
|
35
|
-
}
|
36
|
-
|
25
|
+
EXPORT_JSI_API_TYPENAME(JsiSkTypeface, "Typeface")
|
37
26
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkTypeface, dispose))
|
38
27
|
|
39
28
|
JsiSkTypeface(std::shared_ptr<RNSkPlatformContext> context,
|
40
29
|
sk_sp<SkTypeface> typeface)
|
41
30
|
: JsiSkWrappingSkPtrHostObject(std::move(context), std::move(typeface)) {}
|
42
31
|
|
43
|
-
/**
|
44
|
-
Returns the underlying object from a host object of this type
|
45
|
-
*/
|
46
|
-
static sk_sp<SkTypeface> fromValue(jsi::Runtime &runtime,
|
47
|
-
const jsi::Value &obj) {
|
48
|
-
return obj.asObject(runtime)
|
49
|
-
.asHostObject<JsiSkTypeface>(runtime)
|
50
|
-
->getObject();
|
51
|
-
}
|
52
|
-
|
53
32
|
/**
|
54
33
|
Returns the jsi object from a host object of this type
|
55
34
|
*/
|
package/cpp/api/JsiSkVertices.h
CHANGED
@@ -25,12 +25,7 @@ public:
|
|
25
25
|
: JsiSkWrappingSkPtrHostObject<SkVertices>(std::move(context),
|
26
26
|
std::move(vertices)) {}
|
27
27
|
|
28
|
-
|
29
|
-
JSI_PROPERTY_GET(__typename__) {
|
30
|
-
return jsi::String::createFromUtf8(runtime, "Vertices");
|
31
|
-
}
|
32
|
-
|
33
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkVertices, __typename__))
|
28
|
+
EXPORT_JSI_API_TYPENAME(JsiSkVertices, "Vertices")
|
34
29
|
|
35
30
|
JSI_HOST_FUNCTION(bounds) {
|
36
31
|
const auto &result = getObject()->bounds();
|
@@ -43,17 +38,8 @@ public:
|
|
43
38
|
}
|
44
39
|
|
45
40
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkVertices, bounds),
|
46
|
-
JSI_EXPORT_FUNC(JsiSkVertices, uniqueID),
|
47
|
-
|
48
|
-
/**
|
49
|
-
Returns the underlying object from a host object of this type
|
50
|
-
*/
|
51
|
-
static sk_sp<SkVertices> fromValue(jsi::Runtime &runtime,
|
52
|
-
const jsi::Value &obj) {
|
53
|
-
return obj.asObject(runtime)
|
54
|
-
.asHostObject<JsiSkVertices>(runtime)
|
55
|
-
->getObject();
|
56
|
-
}
|
41
|
+
JSI_EXPORT_FUNC(JsiSkVertices, uniqueID),
|
42
|
+
JSI_EXPORT_FUNC(JsiSkVertices, dispose))
|
57
43
|
|
58
44
|
/**
|
59
45
|
* Creates the function for construction a new instance of the SkVertices
|
@@ -19,10 +19,23 @@ protected:
|
|
19
19
|
auto svgDom = _svgDomProp->getDerivedValue();
|
20
20
|
if (svgDom != nullptr) {
|
21
21
|
auto rect = _rectProp->getDerivedValue();
|
22
|
-
|
22
|
+
auto x = _xProp->isSet() ? _xProp->value().getAsNumber() : -1;
|
23
|
+
auto y = _yProp->isSet() ? _yProp->value().getAsNumber() : -1;
|
24
|
+
auto width = _widthProp->isSet() ? _widthProp->value().getAsNumber() : -1;
|
25
|
+
auto height =
|
26
|
+
_widthProp->isSet() ? _heightProp->value().getAsNumber() : -1;
|
23
27
|
context->getCanvas()->save();
|
24
|
-
|
25
|
-
|
28
|
+
if (rect != nullptr) {
|
29
|
+
context->getCanvas()->translate(rect->x(), rect->y());
|
30
|
+
svgDom->setContainerSize(SkSize::Make(rect->width(), rect->height()));
|
31
|
+
} else {
|
32
|
+
if (x != -1 && y != -1) {
|
33
|
+
context->getCanvas()->translate(x, y);
|
34
|
+
}
|
35
|
+
if (width != -1 && height != -1) {
|
36
|
+
svgDom->setContainerSize(SkSize::Make(width, height));
|
37
|
+
}
|
38
|
+
}
|
26
39
|
svgDom->render(context->getCanvas());
|
27
40
|
context->getCanvas()->restore();
|
28
41
|
}
|
@@ -32,11 +45,19 @@ protected:
|
|
32
45
|
JsiDomDrawingNode::defineProperties(container);
|
33
46
|
_svgDomProp = container->defineProperty<SvgProp>("svg");
|
34
47
|
_rectProp = container->defineProperty<RectProps>("rect");
|
48
|
+
_xProp = container->defineProperty<NodeProp>("x");
|
49
|
+
_yProp = container->defineProperty<NodeProp>("y");
|
50
|
+
_widthProp = container->defineProperty<NodeProp>("width");
|
51
|
+
_heightProp = container->defineProperty<NodeProp>("height");
|
35
52
|
}
|
36
53
|
|
37
54
|
private:
|
38
55
|
SvgProp *_svgDomProp;
|
39
56
|
RectProps *_rectProp;
|
57
|
+
NodeProp *_xProp;
|
58
|
+
NodeProp *_yProp;
|
59
|
+
NodeProp *_widthProp;
|
60
|
+
NodeProp *_heightProp;
|
40
61
|
};
|
41
62
|
|
42
63
|
} // namespace RNSkia
|
@@ -3,6 +3,7 @@
|
|
3
3
|
#include "JsiDomDrawingNode.h"
|
4
4
|
#include "PathProp.h"
|
5
5
|
|
6
|
+
#include <algorithm>
|
6
7
|
#include <memory>
|
7
8
|
#include <string>
|
8
9
|
|
@@ -27,12 +28,14 @@ public:
|
|
27
28
|
protected:
|
28
29
|
void draw(DrawingContext *context) override {
|
29
30
|
if (getPropsContainer()->isChanged()) {
|
31
|
+
auto start = saturate(
|
32
|
+
_startProp->isSet() ? _startProp->value().getAsNumber() : 0.0);
|
33
|
+
auto end =
|
34
|
+
saturate(_endProp->isSet() ? _endProp->value().getAsNumber() : 1.0);
|
30
35
|
// Can we use the path directly, or do we need to copy to
|
31
36
|
// mutate / modify the path?
|
32
|
-
auto hasStartOffset =
|
33
|
-
|
34
|
-
auto hasEndOffset =
|
35
|
-
_endProp->isSet() && _endProp->value().getAsNumber() != 1.0;
|
37
|
+
auto hasStartOffset = start != 0.0;
|
38
|
+
auto hasEndOffset = end != 1.0;
|
36
39
|
auto hasFillStyle = _fillTypeProp->isSet();
|
37
40
|
auto hasStrokeOptions =
|
38
41
|
_strokeOptsProp->isSet() &&
|
@@ -44,9 +47,6 @@ protected:
|
|
44
47
|
if (willMutatePath) {
|
45
48
|
// We'll trim the path
|
46
49
|
SkPath filteredPath(*_pathProp->getDerivedValue());
|
47
|
-
auto start =
|
48
|
-
_startProp->isSet() ? _startProp->value().getAsNumber() : 0.0;
|
49
|
-
auto end = _endProp->isSet() ? _endProp->value().getAsNumber() : 1.0;
|
50
50
|
auto pe =
|
51
51
|
SkTrimPathEffect::Make(start, end, SkTrimPathEffect::Mode::kNormal);
|
52
52
|
|
@@ -55,16 +55,14 @@ protected:
|
|
55
55
|
if (!pe->filterPath(&filteredPath, filteredPath, &rec, nullptr)) {
|
56
56
|
throw std::runtime_error(
|
57
57
|
"Failed trimming path with parameters start: " +
|
58
|
-
std::to_string(
|
59
|
-
", end: " + std::to_string(_endProp->value().getAsNumber()));
|
58
|
+
std::to_string(start) + ", end: " + std::to_string(end));
|
60
59
|
}
|
61
60
|
filteredPath.swap(filteredPath);
|
62
61
|
_path = std::make_shared<const SkPath>(filteredPath);
|
63
62
|
} else if (hasStartOffset || hasEndOffset) {
|
64
63
|
throw std::runtime_error(
|
65
64
|
"Failed trimming path with parameters start: " +
|
66
|
-
std::to_string(
|
67
|
-
", end: " + std::to_string(_endProp->value().getAsNumber()));
|
65
|
+
std::to_string(start) + ", end: " + std::to_string(end));
|
68
66
|
} else {
|
69
67
|
_path = std::make_shared<const SkPath>(filteredPath);
|
70
68
|
}
|
@@ -144,6 +142,8 @@ protected:
|
|
144
142
|
}
|
145
143
|
|
146
144
|
private:
|
145
|
+
float saturate(float x) { return std::max(0.0f, std::min(1.0f, x)); }
|
146
|
+
|
147
147
|
SkPathFillType getFillTypeFromStringValue(const std::string &value) {
|
148
148
|
if (value == "winding") {
|
149
149
|
return SkPathFillType::kWinding;
|
@@ -72,13 +72,13 @@ public:
|
|
72
72
|
});
|
73
73
|
}
|
74
74
|
|
75
|
-
JSI_HOST_FUNCTION(
|
75
|
+
JSI_HOST_FUNCTION(dispose) {
|
76
76
|
invalidate();
|
77
77
|
return jsi::Value::undefined();
|
78
78
|
}
|
79
79
|
|
80
80
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(RNSkReadonlyValue, addListener),
|
81
|
-
JSI_EXPORT_FUNC(RNSkReadonlyValue,
|
81
|
+
JSI_EXPORT_FUNC(RNSkReadonlyValue, dispose))
|
82
82
|
|
83
83
|
/**
|
84
84
|
* Adds a callback that will be called whenever the value changes
|
@@ -70,7 +70,7 @@ public:
|
|
70
70
|
JSI_EXPORT_PROP_GET(RNSkValue, animation))
|
71
71
|
|
72
72
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(RNSkValue, addListener),
|
73
|
-
JSI_EXPORT_FUNC(RNSkReadonlyValue,
|
73
|
+
JSI_EXPORT_FUNC(RNSkReadonlyValue, dispose))
|
74
74
|
|
75
75
|
private:
|
76
76
|
void subscribe(std::shared_ptr<RNSkAnimation> animation) {
|
@@ -121,7 +121,7 @@ const View = _ref => {
|
|
121
121
|
const cssStyles = (0, _react.useMemo)(() => {
|
122
122
|
return { ...style,
|
123
123
|
display: "flex",
|
124
|
-
flexDirection: style.flexDirection || "
|
124
|
+
flexDirection: style.flexDirection || "inherit",
|
125
125
|
flexWrap: style.flexWrap || "nowrap",
|
126
126
|
justifyContent: style.justifyContent || "flex-start",
|
127
127
|
alignItems: style.alignItems || "stretch",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["DOM_LAYOUT_HANDLER_NAME","resizeObserver","getObserver","window","ResizeObserver","entries","forEach","entry","node","target","left","top","width","height","contentRect","onLayout","setTimeout","timeStamp","Date","now","nativeEvent","layout","x","y","currentTarget","bubbles","cancelable","defaultPrevented","eventPhase","isDefaultPrevented","Error","isPropagationStopped","persist","preventDefault","stopPropagation","isTrusted","type","useElementLayout","ref","observer","useLayoutEffect","current","observe","unobserve","View","children","style","rawStyle","useMemo","useRef","cssStyles","display","flexDirection","flexWrap","justifyContent","alignItems","alignContent","Platform","OS","PixelRatio","devicePixelRatio","requireNativeComponent","resolveAsset","source","isRNModule","default","findNodeHandle","NativeModules"],"sources":["Platform.web.tsx"],"sourcesContent":["import type { RefObject, CSSProperties } from \"react\";\nimport React, { useLayoutEffect, useMemo, useRef } from \"react\";\nimport type { LayoutChangeEvent, ViewComponent, ViewProps } from \"react-native\";\n\nimport type { DataModule } from \"../skia/types\";\nimport { isRNModule } from \"../skia/types\";\n\nimport type { IPlatform } from \"./IPlatform\";\n\n// eslint-disable-next-line max-len\n// https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/modules/useElementLayout/index.js\nconst DOM_LAYOUT_HANDLER_NAME = \"__reactLayoutHandler\";\ntype OnLayout = ((event: LayoutChangeEvent) => void) | undefined;\ntype Div = HTMLDivElement & {\n __reactLayoutHandler: OnLayout;\n};\n\nlet resizeObserver: ResizeObserver | null = null;\n\nconst getObserver = () => {\n if (resizeObserver == null) {\n resizeObserver = new window.ResizeObserver(function (entries) {\n entries.forEach((entry) => {\n const node = entry.target as Div;\n const { left, top, width, height } = entry.contentRect;\n const onLayout = node[DOM_LAYOUT_HANDLER_NAME];\n if (typeof onLayout === \"function\") {\n // setTimeout 0 is taken from react-native-web (UIManager)\n setTimeout(\n () =>\n onLayout({\n timeStamp: Date.now(),\n nativeEvent: { layout: { x: left, y: top, width, height } },\n currentTarget: 0,\n target: 0,\n bubbles: false,\n cancelable: false,\n defaultPrevented: false,\n eventPhase: 0,\n isDefaultPrevented() {\n throw new Error(\"Method not supported on web.\");\n },\n isPropagationStopped() {\n throw new Error(\"Method not supported on web.\");\n },\n persist() {\n throw new Error(\"Method not supported on web.\");\n },\n preventDefault() {\n throw new Error(\"Method not supported on web.\");\n },\n stopPropagation() {\n throw new Error(\"Method not supported on web.\");\n },\n isTrusted: true,\n type: \"\",\n }),\n 0\n );\n }\n });\n });\n }\n return resizeObserver;\n};\n\nconst useElementLayout = (ref: RefObject<Div>, onLayout: OnLayout) => {\n const observer = getObserver();\n\n useLayoutEffect(() => {\n const node = ref.current;\n if (node !== null) {\n node[DOM_LAYOUT_HANDLER_NAME] = onLayout;\n }\n }, [ref, onLayout]);\n\n useLayoutEffect(() => {\n const node = ref.current;\n if (node != null && observer != null) {\n if (typeof node[DOM_LAYOUT_HANDLER_NAME] === \"function\") {\n observer.observe(node);\n } else {\n observer.unobserve(node);\n }\n }\n return () => {\n if (node != null && observer != null) {\n observer.unobserve(node);\n }\n };\n }, [observer, ref]);\n};\n\nconst View = (({ children, onLayout, style: rawStyle }: ViewProps) => {\n const style = useMemo(() => (rawStyle ?? {}) as CSSProperties, [rawStyle]);\n const ref = useRef<Div>(null);\n useElementLayout(ref, onLayout);\n const cssStyles = useMemo(() => {\n return {\n ...style,\n display: \"flex\",\n flexDirection: style.flexDirection || \"
|
1
|
+
{"version":3,"names":["DOM_LAYOUT_HANDLER_NAME","resizeObserver","getObserver","window","ResizeObserver","entries","forEach","entry","node","target","left","top","width","height","contentRect","onLayout","setTimeout","timeStamp","Date","now","nativeEvent","layout","x","y","currentTarget","bubbles","cancelable","defaultPrevented","eventPhase","isDefaultPrevented","Error","isPropagationStopped","persist","preventDefault","stopPropagation","isTrusted","type","useElementLayout","ref","observer","useLayoutEffect","current","observe","unobserve","View","children","style","rawStyle","useMemo","useRef","cssStyles","display","flexDirection","flexWrap","justifyContent","alignItems","alignContent","Platform","OS","PixelRatio","devicePixelRatio","requireNativeComponent","resolveAsset","source","isRNModule","default","findNodeHandle","NativeModules"],"sources":["Platform.web.tsx"],"sourcesContent":["import type { RefObject, CSSProperties } from \"react\";\nimport React, { useLayoutEffect, useMemo, useRef } from \"react\";\nimport type { LayoutChangeEvent, ViewComponent, ViewProps } from \"react-native\";\n\nimport type { DataModule } from \"../skia/types\";\nimport { isRNModule } from \"../skia/types\";\n\nimport type { IPlatform } from \"./IPlatform\";\n\n// eslint-disable-next-line max-len\n// https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/modules/useElementLayout/index.js\nconst DOM_LAYOUT_HANDLER_NAME = \"__reactLayoutHandler\";\ntype OnLayout = ((event: LayoutChangeEvent) => void) | undefined;\ntype Div = HTMLDivElement & {\n __reactLayoutHandler: OnLayout;\n};\n\nlet resizeObserver: ResizeObserver | null = null;\n\nconst getObserver = () => {\n if (resizeObserver == null) {\n resizeObserver = new window.ResizeObserver(function (entries) {\n entries.forEach((entry) => {\n const node = entry.target as Div;\n const { left, top, width, height } = entry.contentRect;\n const onLayout = node[DOM_LAYOUT_HANDLER_NAME];\n if (typeof onLayout === \"function\") {\n // setTimeout 0 is taken from react-native-web (UIManager)\n setTimeout(\n () =>\n onLayout({\n timeStamp: Date.now(),\n nativeEvent: { layout: { x: left, y: top, width, height } },\n currentTarget: 0,\n target: 0,\n bubbles: false,\n cancelable: false,\n defaultPrevented: false,\n eventPhase: 0,\n isDefaultPrevented() {\n throw new Error(\"Method not supported on web.\");\n },\n isPropagationStopped() {\n throw new Error(\"Method not supported on web.\");\n },\n persist() {\n throw new Error(\"Method not supported on web.\");\n },\n preventDefault() {\n throw new Error(\"Method not supported on web.\");\n },\n stopPropagation() {\n throw new Error(\"Method not supported on web.\");\n },\n isTrusted: true,\n type: \"\",\n }),\n 0\n );\n }\n });\n });\n }\n return resizeObserver;\n};\n\nconst useElementLayout = (ref: RefObject<Div>, onLayout: OnLayout) => {\n const observer = getObserver();\n\n useLayoutEffect(() => {\n const node = ref.current;\n if (node !== null) {\n node[DOM_LAYOUT_HANDLER_NAME] = onLayout;\n }\n }, [ref, onLayout]);\n\n useLayoutEffect(() => {\n const node = ref.current;\n if (node != null && observer != null) {\n if (typeof node[DOM_LAYOUT_HANDLER_NAME] === \"function\") {\n observer.observe(node);\n } else {\n observer.unobserve(node);\n }\n }\n return () => {\n if (node != null && observer != null) {\n observer.unobserve(node);\n }\n };\n }, [observer, ref]);\n};\n\nconst View = (({ children, onLayout, style: rawStyle }: ViewProps) => {\n const style = useMemo(() => (rawStyle ?? {}) as CSSProperties, [rawStyle]);\n const ref = useRef<Div>(null);\n useElementLayout(ref, onLayout);\n const cssStyles = useMemo(() => {\n return {\n ...style,\n display: \"flex\",\n flexDirection: style.flexDirection || \"inherit\",\n flexWrap: style.flexWrap || \"nowrap\",\n justifyContent: style.justifyContent || \"flex-start\",\n alignItems: style.alignItems || \"stretch\",\n alignContent: style.alignContent || \"stretch\",\n };\n }, [style]);\n\n return (\n <div ref={ref} style={cssStyles}>\n {children}\n </div>\n );\n}) as unknown as typeof ViewComponent;\n\nexport const Platform: IPlatform = {\n OS: \"web\",\n PixelRatio: window.devicePixelRatio,\n requireNativeComponent: () => {\n throw new Error(\"requireNativeComponent is not supported on the web\");\n },\n resolveAsset: (source: DataModule) => {\n if (isRNModule(source)) {\n throw new Error(\n \"Image source is a number - this is not supported on the web\"\n );\n }\n return source.default;\n },\n findNodeHandle: () => {\n throw new Error(\"findNodeHandle is not supported on the web\");\n },\n NativeModules: {},\n View,\n};\n"],"mappings":"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"}
|
@@ -1,8 +1,13 @@
|
|
1
1
|
import type { DrawingContext, ImageSVGProps } from "../../types";
|
2
2
|
import { JsiDrawingNode } from "../DrawingNode";
|
3
3
|
import type { NodeContext } from "../Node";
|
4
|
-
export declare class ImageSVGNode extends JsiDrawingNode<ImageSVGProps,
|
4
|
+
export declare class ImageSVGNode extends JsiDrawingNode<ImageSVGProps, Pick<ImageSVGProps, "x" | "y" | "width" | "height">> {
|
5
5
|
constructor(ctx: NodeContext, props: ImageSVGProps);
|
6
|
-
deriveProps():
|
6
|
+
deriveProps(): import("../../..").SkRect | {
|
7
|
+
x: number | undefined;
|
8
|
+
y: number | undefined;
|
9
|
+
width: number | undefined;
|
10
|
+
height: number | undefined;
|
11
|
+
};
|
7
12
|
draw({ canvas }: DrawingContext): void;
|
8
13
|
}
|
@@ -7,8 +7,6 @@ exports.ImageSVGNode = void 0;
|
|
7
7
|
|
8
8
|
var _types = require("../../types");
|
9
9
|
|
10
|
-
var _datatypes = require("../datatypes");
|
11
|
-
|
12
10
|
var _DrawingNode = require("../DrawingNode");
|
13
11
|
|
14
12
|
class ImageSVGNode extends _DrawingNode.JsiDrawingNode {
|
@@ -17,7 +15,22 @@ class ImageSVGNode extends _DrawingNode.JsiDrawingNode {
|
|
17
15
|
}
|
18
16
|
|
19
17
|
deriveProps() {
|
20
|
-
|
18
|
+
if (this.props.rect) {
|
19
|
+
return this.props.rect;
|
20
|
+
}
|
21
|
+
|
22
|
+
const {
|
23
|
+
x,
|
24
|
+
y,
|
25
|
+
width,
|
26
|
+
height
|
27
|
+
} = this.props;
|
28
|
+
return {
|
29
|
+
x,
|
30
|
+
y,
|
31
|
+
width,
|
32
|
+
height
|
33
|
+
};
|
21
34
|
}
|
22
35
|
|
23
36
|
draw(_ref) {
|
@@ -28,8 +41,8 @@ class ImageSVGNode extends _DrawingNode.JsiDrawingNode {
|
|
28
41
|
svg
|
29
42
|
} = this.props;
|
30
43
|
|
31
|
-
if (!
|
32
|
-
|
44
|
+
if (!this.derived) {
|
45
|
+
throw new Error("ImageSVGNode: derived props unresolved");
|
33
46
|
}
|
34
47
|
|
35
48
|
const {
|
@@ -37,9 +50,18 @@ class ImageSVGNode extends _DrawingNode.JsiDrawingNode {
|
|
37
50
|
y,
|
38
51
|
width,
|
39
52
|
height
|
40
|
-
} =
|
53
|
+
} = this.derived;
|
54
|
+
|
55
|
+
if (svg === null) {
|
56
|
+
return;
|
57
|
+
}
|
58
|
+
|
41
59
|
canvas.save();
|
42
|
-
|
60
|
+
|
61
|
+
if (x && y) {
|
62
|
+
canvas.translate(x, y);
|
63
|
+
}
|
64
|
+
|
43
65
|
canvas.drawSvg(svg, width, height);
|
44
66
|
canvas.restore();
|
45
67
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ImageSVGNode","JsiDrawingNode","constructor","ctx","props","NodeType","ImageSVG","deriveProps","
|
1
|
+
{"version":3,"names":["ImageSVGNode","JsiDrawingNode","constructor","ctx","props","NodeType","ImageSVG","deriveProps","rect","x","y","width","height","draw","canvas","svg","derived","Error","save","translate","drawSvg","restore"],"sources":["ImageSVG.ts"],"sourcesContent":["import type { DrawingContext, ImageSVGProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class ImageSVGNode extends JsiDrawingNode<\n ImageSVGProps,\n Pick<ImageSVGProps, \"x\" | \"y\" | \"width\" | \"height\">\n> {\n constructor(ctx: NodeContext, props: ImageSVGProps) {\n super(ctx, NodeType.ImageSVG, props);\n }\n\n deriveProps() {\n if (this.props.rect) {\n return this.props.rect;\n }\n const { x, y, width, height } = this.props;\n return { x, y, width, height };\n }\n\n draw({ canvas }: DrawingContext) {\n const { svg } = this.props;\n if (!this.derived) {\n throw new Error(\"ImageSVGNode: derived props unresolved\");\n }\n const { x, y, width, height } = this.derived;\n if (svg === null) {\n return;\n }\n canvas.save();\n if (x && y) {\n canvas.translate(x, y);\n }\n canvas.drawSvg(svg, width, height);\n canvas.restore();\n }\n}\n"],"mappings":";;;;;;;AACA;;AACA;;AAGO,MAAMA,YAAN,SAA2BC,2BAA3B,CAGL;EACAC,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;IAClD,MAAMD,GAAN,EAAWE,eAAA,CAASC,QAApB,EAA8BF,KAA9B;EACD;;EAEDG,WAAW,GAAG;IACZ,IAAI,KAAKH,KAAL,CAAWI,IAAf,EAAqB;MACnB,OAAO,KAAKJ,KAAL,CAAWI,IAAlB;IACD;;IACD,MAAM;MAAEC,CAAF;MAAKC,CAAL;MAAQC,KAAR;MAAeC;IAAf,IAA0B,KAAKR,KAArC;IACA,OAAO;MAAEK,CAAF;MAAKC,CAAL;MAAQC,KAAR;MAAeC;IAAf,CAAP;EACD;;EAEDC,IAAI,OAA6B;IAAA,IAA5B;MAAEC;IAAF,CAA4B;IAC/B,MAAM;MAAEC;IAAF,IAAU,KAAKX,KAArB;;IACA,IAAI,CAAC,KAAKY,OAAV,EAAmB;MACjB,MAAM,IAAIC,KAAJ,CAAU,wCAAV,CAAN;IACD;;IACD,MAAM;MAAER,CAAF;MAAKC,CAAL;MAAQC,KAAR;MAAeC;IAAf,IAA0B,KAAKI,OAArC;;IACA,IAAID,GAAG,KAAK,IAAZ,EAAkB;MAChB;IACD;;IACDD,MAAM,CAACI,IAAP;;IACA,IAAIT,CAAC,IAAIC,CAAT,EAAY;MACVI,MAAM,CAACK,SAAP,CAAiBV,CAAjB,EAAoBC,CAApB;IACD;;IACDI,MAAM,CAACM,OAAP,CAAeL,GAAf,EAAoBJ,KAApB,EAA2BC,MAA3B;IACAE,MAAM,CAACO,OAAP;EACD;;AA5BD"}
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.PathNode = void 0;
|
7
7
|
|
8
|
+
var _math = require("../../../renderer/processors/math");
|
9
|
+
|
8
10
|
var _types = require("../../../skia/types");
|
9
11
|
|
10
12
|
var _types2 = require("../../types");
|
@@ -20,12 +22,14 @@ class PathNode extends _DrawingNode.JsiDrawingNode {
|
|
20
22
|
|
21
23
|
deriveProps() {
|
22
24
|
const {
|
23
|
-
start,
|
24
|
-
end,
|
25
|
+
start: trimStart,
|
26
|
+
end: trimEnd,
|
25
27
|
fillType,
|
26
28
|
stroke,
|
27
29
|
...pathProps
|
28
30
|
} = this.props;
|
31
|
+
const start = (0, _math.saturate)(trimStart);
|
32
|
+
const end = (0, _math.saturate)(trimEnd);
|
29
33
|
const hasStartOffset = start !== 0;
|
30
34
|
const hasEndOffset = end !== 1;
|
31
35
|
const hasStrokeOptions = stroke !== undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["PathNode","JsiDrawingNode","constructor","ctx","props","NodeType","Path","deriveProps","start","end","fillType","stroke","pathProps","hasStartOffset","hasEndOffset","hasStrokeOptions","undefined","hasFillType","willMutatePath","pristinePath","processPath","Skia","path","copy","setFillType","FillType","enumKey","trim","draw","canvas","paint","derived","Error","drawPath"],"sources":["PathNode.ts"],"sourcesContent":["import { FillType } from \"../../../skia/types\";\nimport type { SkPath } from \"../../../skia/types\";\nimport type { DrawingContext, PathProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { enumKey, processPath } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class PathNode extends JsiDrawingNode<PathProps, SkPath> {\n constructor(ctx: NodeContext, props: PathProps) {\n super(ctx, NodeType.Path, props);\n }\n\n protected deriveProps() {\n const {
|
1
|
+
{"version":3,"names":["PathNode","JsiDrawingNode","constructor","ctx","props","NodeType","Path","deriveProps","start","trimStart","end","trimEnd","fillType","stroke","pathProps","saturate","hasStartOffset","hasEndOffset","hasStrokeOptions","undefined","hasFillType","willMutatePath","pristinePath","processPath","Skia","path","copy","setFillType","FillType","enumKey","trim","draw","canvas","paint","derived","Error","drawPath"],"sources":["PathNode.ts"],"sourcesContent":["import { saturate } from \"../../../renderer/processors/math\";\nimport { FillType } from \"../../../skia/types\";\nimport type { SkPath } from \"../../../skia/types\";\nimport type { DrawingContext, PathProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { enumKey, processPath } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class PathNode extends JsiDrawingNode<PathProps, SkPath> {\n constructor(ctx: NodeContext, props: PathProps) {\n super(ctx, NodeType.Path, props);\n }\n\n protected deriveProps() {\n const {\n start: trimStart,\n end: trimEnd,\n fillType,\n stroke,\n ...pathProps\n } = this.props;\n const start = saturate(trimStart);\n const end = saturate(trimEnd);\n const hasStartOffset = start !== 0;\n const hasEndOffset = end !== 1;\n const hasStrokeOptions = stroke !== undefined;\n const hasFillType = !!fillType;\n const willMutatePath =\n hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;\n const pristinePath = processPath(this.Skia, pathProps.path);\n const path = willMutatePath ? pristinePath.copy() : pristinePath;\n if (hasFillType) {\n path.setFillType(FillType[enumKey(fillType)]);\n }\n if (hasStrokeOptions) {\n path.stroke(stroke);\n }\n if (hasStartOffset || hasEndOffset) {\n path.trim(start, end, false);\n }\n return path;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (!this.derived) {\n throw new Error(\"Path not initialized\");\n }\n canvas.drawPath(this.derived, paint);\n }\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;AACA;;AACA;;AAGO,MAAMA,QAAN,SAAuBC,2BAAvB,CAAyD;EAC9DC,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAqC;IAC9C,MAAMD,GAAN,EAAWE,gBAAA,CAASC,IAApB,EAA0BF,KAA1B;EACD;;EAESG,WAAW,GAAG;IACtB,MAAM;MACJC,KAAK,EAAEC,SADH;MAEJC,GAAG,EAAEC,OAFD;MAGJC,QAHI;MAIJC,MAJI;MAKJ,GAAGC;IALC,IAMF,KAAKV,KANT;IAOA,MAAMI,KAAK,GAAG,IAAAO,cAAA,EAASN,SAAT,CAAd;IACA,MAAMC,GAAG,GAAG,IAAAK,cAAA,EAASJ,OAAT,CAAZ;IACA,MAAMK,cAAc,GAAGR,KAAK,KAAK,CAAjC;IACA,MAAMS,YAAY,GAAGP,GAAG,KAAK,CAA7B;IACA,MAAMQ,gBAAgB,GAAGL,MAAM,KAAKM,SAApC;IACA,MAAMC,WAAW,GAAG,CAAC,CAACR,QAAtB;IACA,MAAMS,cAAc,GAClBL,cAAc,IAAIC,YAAlB,IAAkCC,gBAAlC,IAAsDE,WADxD;IAEA,MAAME,YAAY,GAAG,IAAAC,sBAAA,EAAY,KAAKC,IAAjB,EAAuBV,SAAS,CAACW,IAAjC,CAArB;IACA,MAAMA,IAAI,GAAGJ,cAAc,GAAGC,YAAY,CAACI,IAAb,EAAH,GAAyBJ,YAApD;;IACA,IAAIF,WAAJ,EAAiB;MACfK,IAAI,CAACE,WAAL,CAAiBC,eAAA,CAAS,IAAAC,kBAAA,EAAQjB,QAAR,CAAT,CAAjB;IACD;;IACD,IAAIM,gBAAJ,EAAsB;MACpBO,IAAI,CAACZ,MAAL,CAAYA,MAAZ;IACD;;IACD,IAAIG,cAAc,IAAIC,YAAtB,EAAoC;MAClCQ,IAAI,CAACK,IAAL,CAAUtB,KAAV,EAAiBE,GAAjB,EAAsB,KAAtB;IACD;;IACD,OAAOe,IAAP;EACD;;EAEDM,IAAI,OAAoC;IAAA,IAAnC;MAAEC,MAAF;MAAUC;IAAV,CAAmC;;IACtC,IAAI,CAAC,KAAKC,OAAV,EAAmB;MACjB,MAAM,IAAIC,KAAJ,CAAU,sBAAV,CAAN;IACD;;IACDH,MAAM,CAACI,QAAP,CAAgB,KAAKF,OAArB,EAA8BD,KAA9B;EACD;;AAxC6D"}
|
@@ -50,9 +50,14 @@ export interface VerticesProps extends DrawingNodeProps {
|
|
50
50
|
blendMode?: SkEnum<typeof BlendMode>;
|
51
51
|
indices?: number[];
|
52
52
|
}
|
53
|
-
export
|
53
|
+
export interface ImageSVGProps extends DrawingNodeProps {
|
54
54
|
svg: SkSVG | null;
|
55
|
-
|
55
|
+
x?: number;
|
56
|
+
y?: number;
|
57
|
+
width?: number;
|
58
|
+
height?: number;
|
59
|
+
rect?: SkRect;
|
60
|
+
}
|
56
61
|
export interface PictureProps extends DrawingNodeProps {
|
57
62
|
picture: SkPicture;
|
58
63
|
}
|
@@ -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?: Fit;\n image: SkImage | null;\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
|
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 | null;\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 interface ImageSVGProps extends DrawingNodeProps {\n svg: SkSVG | null;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n rect?: SkRect;\n}\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 | null;\n text: string;\n x: number;\n y: number;\n}\n\nexport interface TextPathProps extends DrawingNodeProps {\n font: SkFont | null;\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 | null;\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":""}
|