@shopify/react-native-skia 0.1.202 → 0.1.203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/CMakeLists.txt +9 -9
- package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +11 -0
- package/cpp/api/JsiSkApi.h +8 -0
- package/cpp/api/JsiSkFontMgr.h +54 -0
- package/cpp/api/JsiSkFontMgrFactory.h +40 -0
- package/cpp/api/JsiSkFontStyle.h +61 -0
- package/cpp/api/JsiSkTypeFaceFontProvider.h +80 -0
- package/cpp/api/JsiSkTypeFaceFontProviderFactory.h +32 -0
- package/cpp/rnskia/RNSkPlatformContext.h +6 -0
- package/cpp/skia/include/core/SkColorTable.h +1 -1
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.h +1 -0
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.mm +7 -0
- package/lib/commonjs/skia/core/Data.d.ts +2 -0
- package/lib/commonjs/skia/core/Data.js +29 -1
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Font.d.ts +14 -1
- package/lib/commonjs/skia/core/Font.js +93 -1
- package/lib/commonjs/skia/core/Font.js.map +1 -1
- package/lib/commonjs/skia/types/Font/FontMgr.d.ts +8 -0
- package/lib/commonjs/skia/types/Font/FontMgr.js +6 -0
- package/lib/commonjs/skia/types/Font/FontMgr.js.map +1 -0
- package/lib/commonjs/skia/types/Font/FontMgrFactory.d.ts +4 -0
- package/lib/commonjs/skia/types/Font/FontMgrFactory.js +6 -0
- package/lib/commonjs/skia/types/Font/FontMgrFactory.js.map +1 -0
- package/lib/commonjs/skia/types/Font/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Font/index.js +26 -0
- package/lib/commonjs/skia/types/Font/index.js.map +1 -1
- package/lib/commonjs/skia/types/Paragraph/TypefaceFontProvider.d.ts +10 -0
- package/lib/commonjs/skia/types/Paragraph/TypefaceFontProvider.js +6 -0
- package/lib/commonjs/skia/types/Paragraph/TypefaceFontProvider.js.map +1 -0
- package/lib/commonjs/skia/types/Paragraph/TypefaceFontProviderFactory.d.ts +4 -0
- package/lib/commonjs/skia/types/Paragraph/TypefaceFontProviderFactory.js +6 -0
- package/lib/commonjs/skia/types/Paragraph/TypefaceFontProviderFactory.js.map +1 -0
- package/lib/commonjs/skia/types/Skia.d.ts +4 -1
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/web/Host.d.ts +1 -1
- package/lib/commonjs/skia/web/Host.js +0 -2
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFontMgr.d.ts +10 -0
- package/lib/commonjs/skia/web/JsiSkFontMgr.js +34 -0
- package/lib/commonjs/skia/web/JsiSkFontMgr.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFontMgrFactory.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js +32 -0
- package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFontProvider.d.ts +13 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFontProvider.js +90 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFontProvider.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFontProviderFactory.d.ts +7 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFontProviderFactory.js +25 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFontProviderFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkia.js +7 -1
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/skia/core/Data.d.ts +2 -0
- package/lib/module/skia/core/Data.js +24 -1
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Font.d.ts +14 -1
- package/lib/module/skia/core/Font.js +83 -1
- package/lib/module/skia/core/Font.js.map +1 -1
- package/lib/module/skia/types/Font/FontMgr.d.ts +8 -0
- package/lib/module/skia/types/Font/FontMgr.js +2 -0
- package/lib/module/skia/types/Font/FontMgr.js.map +1 -0
- package/lib/module/skia/types/Font/FontMgrFactory.d.ts +4 -0
- package/lib/module/skia/types/Font/FontMgrFactory.js +2 -0
- package/lib/module/skia/types/Font/FontMgrFactory.js.map +1 -0
- package/lib/module/skia/types/Font/index.d.ts +2 -0
- package/lib/module/skia/types/Font/index.js +2 -0
- package/lib/module/skia/types/Font/index.js.map +1 -1
- package/lib/module/skia/types/Paragraph/TypefaceFontProvider.d.ts +10 -0
- package/lib/module/skia/types/Paragraph/TypefaceFontProvider.js +2 -0
- package/lib/module/skia/types/Paragraph/TypefaceFontProvider.js.map +1 -0
- package/lib/module/skia/types/Paragraph/TypefaceFontProviderFactory.d.ts +4 -0
- package/lib/module/skia/types/Paragraph/TypefaceFontProviderFactory.js +2 -0
- package/lib/module/skia/types/Paragraph/TypefaceFontProviderFactory.js.map +1 -0
- package/lib/module/skia/types/Skia.d.ts +4 -1
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/web/Host.d.ts +1 -1
- package/lib/module/skia/web/Host.js +0 -2
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkFontMgr.d.ts +10 -0
- package/lib/module/skia/web/JsiSkFontMgr.js +24 -0
- package/lib/module/skia/web/JsiSkFontMgr.js.map +1 -0
- package/lib/module/skia/web/JsiSkFontMgrFactory.d.ts +8 -0
- package/lib/module/skia/web/JsiSkFontMgrFactory.js +21 -0
- package/lib/module/skia/web/JsiSkFontMgrFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkTypefaceFontProvider.d.ts +13 -0
- package/lib/module/skia/web/JsiSkTypefaceFontProvider.js +80 -0
- package/lib/module/skia/web/JsiSkTypefaceFontProvider.js.map +1 -0
- package/lib/module/skia/web/JsiSkTypefaceFontProviderFactory.d.ts +7 -0
- package/lib/module/skia/web/JsiSkTypefaceFontProviderFactory.js +14 -0
- package/lib/module/skia/web/JsiSkTypefaceFontProviderFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkia.js +5 -1
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/typescript/src/skia/core/Data.d.ts +2 -0
- package/lib/typescript/src/skia/core/Font.d.ts +14 -1
- package/lib/typescript/src/skia/types/Font/FontMgr.d.ts +8 -0
- package/lib/typescript/src/skia/types/Font/FontMgrFactory.d.ts +4 -0
- package/lib/typescript/src/skia/types/Font/index.d.ts +2 -0
- package/lib/typescript/src/skia/types/Paragraph/TypefaceFontProvider.d.ts +10 -0
- package/lib/typescript/src/skia/types/Paragraph/TypefaceFontProviderFactory.d.ts +4 -0
- package/lib/typescript/src/skia/types/Skia.d.ts +4 -1
- package/lib/typescript/src/skia/web/Host.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkFontMgr.d.ts +10 -0
- package/lib/typescript/src/skia/web/JsiSkFontMgrFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkTypefaceFontProvider.d.ts +13 -0
- package/lib/typescript/src/skia/web/JsiSkTypefaceFontProviderFactory.d.ts +7 -0
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/arm64-v8a/libskottie.a +0 -0
- package/libs/android/arm64-v8a/libskparagraph.a +0 -0
- package/libs/android/arm64-v8a/libskshaper.a +0 -0
- package/libs/android/arm64-v8a/libskunicode.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskottie.a +0 -0
- package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
- package/libs/android/armeabi-v7a/libskshaper.a +0 -0
- package/libs/android/armeabi-v7a/libskunicode.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86/libskottie.a +0 -0
- package/libs/android/x86/libskparagraph.a +0 -0
- package/libs/android/x86/libskshaper.a +0 -0
- package/libs/android/x86/libskunicode.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/android/x86_64/libskottie.a +0 -0
- package/libs/android/x86_64/libskparagraph.a +0 -0
- package/libs/android/x86_64/libskshaper.a +0 -0
- package/libs/android/x86_64/libskunicode.a +0 -0
- package/libs/ios/libskia.xcframework/Info.plist +5 -5
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libskparagraph.xcframework/Info.plist +42 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libskunicode.xcframework/Info.plist +42 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +5 -5
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +3 -1
- package/react-native-skia.podspec +2 -2
- package/src/skia/core/Data.ts +31 -1
- package/src/skia/core/Font.ts +109 -2
- package/src/skia/types/Font/FontMgr.ts +10 -0
- package/src/skia/types/Font/FontMgrFactory.ts +5 -0
- package/src/skia/types/Font/index.ts +2 -0
- package/src/skia/types/Paragraph/TypefaceFontProvider.ts +11 -0
- package/src/skia/types/Paragraph/TypefaceFontProviderFactory.ts +5 -0
- package/src/skia/types/Skia.ts +4 -2
- package/src/skia/web/Host.ts +1 -1
- package/src/skia/web/JsiSkFontMgr.ts +26 -0
- package/src/skia/web/JsiSkFontMgrFactory.ts +22 -0
- package/src/skia/web/JsiSkTypefaceFontProvider.ts +89 -0
- package/src/skia/web/JsiSkTypefaceFontProviderFactory.ts +18 -0
- package/src/skia/web/JsiSkia.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["JsiSkPoint","JsiSkPaint","JsiSkRect","Color","JsiSkSurfaceFactory","JsiSkRRect","JsiSkRSXform","JsiSkContourMeasureIter","JsiSkPictureRecorder","JsiSkPictureFactory","JsiSkPathFactory","JsiSkMatrix","JsiSkColorFilterFactory","JsiSkTypefaceFactory","JsiSkMaskFilterFactory","JsiSkRuntimeEffectFactory","JsiSkImageFilterFactory","JsiSkShaderFactory","JsiSkPathEffectFactory","JsiSkDataFactory","JsiSkImageFactory","JsiSkSVGFactory","JsiSkTextBlobFactory","JsiSkFont","MakeVertices","JsiSkPath","JsiSkTypeface","JsiSkApi","CanvasKit","Point","x","y","Float32Array","of","RuntimeShaderBuilder","_","Error","RRectXY","rect","rx","ry","RSXform","scos","ssin","tx","ty","ContourMeasureIter","path","forceClosed","resScale","fromValue","Paint","paint","setAntiAlias","PictureRecorder","Picture","Path","Matrix","matrix","identity","ColorFilter","Font","typeface","size","undefined","Typeface","MaskFilter","RuntimeEffect","ImageFilter","Shader","PathEffect","bind","Data","Image","SVG","TextBlob","XYWHRect","width","height","Surface"],"sources":["JsiSkia.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n SkContourMeasureIter,\n Skia,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect): SkRuntimeShaderBuilder => {\n throw new Error(\"Not implemented on React Native Web\");\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(CanvasKit, rect, rx, ry),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(\n JsiSkPath.fromValue(path),\n forceClosed,\n resScale\n )\n ),\n Paint: () => {\n const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());\n paint.setAntiAlias(true);\n return paint;\n },\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : JsiSkTypeface.fromValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n});\n"],"mappings":"AAYA,SAASA,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,KAAT,QAAsB,cAAtB;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,yBAAT,QAA0C,6BAA1C;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,kBAAT,QAAmC,sBAAnC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,YAAT,QAA6B,wBAA7B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,OAAO,MAAMC,QAAQ,GAAIC,SAAD,KAAiC;EACvDC,KAAK,EAAE,CAACC,CAAD,EAAYC,CAAZ,KACL,
|
|
1
|
+
{"version":3,"names":["JsiSkPoint","JsiSkPaint","JsiSkRect","Color","JsiSkSurfaceFactory","JsiSkRRect","JsiSkRSXform","JsiSkContourMeasureIter","JsiSkPictureRecorder","JsiSkPictureFactory","JsiSkPathFactory","JsiSkMatrix","JsiSkColorFilterFactory","JsiSkTypefaceFactory","JsiSkMaskFilterFactory","JsiSkRuntimeEffectFactory","JsiSkImageFilterFactory","JsiSkShaderFactory","JsiSkPathEffectFactory","JsiSkDataFactory","JsiSkImageFactory","JsiSkSVGFactory","JsiSkTextBlobFactory","JsiSkFont","MakeVertices","JsiSkPath","JsiSkTypeface","JsiSkTypefaceFontProviderFactory","JsiSkFontMgrFactory","JsiSkApi","CanvasKit","Point","x","y","Float32Array","of","RuntimeShaderBuilder","_","Error","RRectXY","rect","rx","ry","RSXform","scos","ssin","tx","ty","ContourMeasureIter","path","forceClosed","resScale","fromValue","Paint","paint","setAntiAlias","PictureRecorder","Picture","Path","Matrix","matrix","identity","ColorFilter","Font","typeface","size","undefined","Typeface","MaskFilter","RuntimeEffect","ImageFilter","Shader","PathEffect","bind","Data","Image","SVG","TextBlob","XYWHRect","width","height","Surface","TypefaceFontProvider","FontMgr"],"sources":["JsiSkia.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n SkContourMeasureIter,\n Skia,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\nimport { JsiSkTypefaceFontProviderFactory } from \"./JsiSkTypefaceFontProviderFactory\";\nimport { JsiSkFontMgrFactory } from \"./JsiSkFontMgrFactory\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect): SkRuntimeShaderBuilder => {\n throw new Error(\"Not implemented on React Native Web\");\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(CanvasKit, rect, rx, ry),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(\n JsiSkPath.fromValue(path),\n forceClosed,\n resScale\n )\n ),\n Paint: () => {\n const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());\n paint.setAntiAlias(true);\n return paint;\n },\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : JsiSkTypeface.fromValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n TypefaceFontProvider: new JsiSkTypefaceFontProviderFactory(CanvasKit),\n FontMgr: new JsiSkFontMgrFactory(CanvasKit),\n});\n"],"mappings":"AAYA,SAASA,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,KAAT,QAAsB,cAAtB;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,UAAT,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vD,gCAAJ,CAAqCG,SAArC,CAhEiC;EAiEvDqD,OAAO,EAAE,IAAIvD,mBAAJ,CAAwBE,SAAxB;AAjE8C,CAAjC,CAAjB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { SkData, DataSourceParam, SkJSIInstance } from "../types";
|
|
2
|
+
export declare const loadData: <T>(source: DataSourceParam, factory: (data: SkData) => T | null, onError?: ((err: Error) => void) | undefined) => Promise<T | null>;
|
|
3
|
+
export declare const useCollectionLoading: <T extends SkJSIInstance<string>>(source: DataSourceParam[], loader: () => Promise<(T | null)[]>) => T[] | null;
|
|
2
4
|
export declare const useRawData: <T extends SkJSIInstance<string>>(source: DataSourceParam, factory: (data: SkData) => T | null, onError?: ((err: Error) => void) | undefined) => T | null;
|
|
3
5
|
export declare const useData: (source: DataSourceParam, onError?: ((err: Error) => void) | undefined) => SkData | null;
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
import type { DataSourceParam } from "../types";
|
|
1
|
+
import type { DataModule, DataSourceParam, SkFontMgr } from "../types";
|
|
2
|
+
import type { SkTypefaceFontProvider } from "../types/Paragraph/TypefaceFontProvider";
|
|
2
3
|
/**
|
|
3
4
|
* Returns a Skia Font object
|
|
4
5
|
* */
|
|
5
6
|
export declare const useFont: (font: DataSourceParam, size?: number, onError?: ((err: Error) => void) | undefined) => import("../types").SkFont | null;
|
|
7
|
+
declare type Slant = "normal" | "italic" | "oblique";
|
|
8
|
+
declare type Weight = "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
|
|
9
|
+
interface RNFontStyle {
|
|
10
|
+
fontFamily: string;
|
|
11
|
+
fontSize: number;
|
|
12
|
+
fontStyle: Slant;
|
|
13
|
+
fontWeight: Weight;
|
|
14
|
+
}
|
|
15
|
+
export declare const matchFont: (inputStyle?: Partial<RNFontStyle>, fontMgr?: SkFontMgr) => import("../types").SkFont;
|
|
16
|
+
export declare const listFontFamilies: (fontMgr?: SkFontMgr) => string[];
|
|
17
|
+
export declare const useFonts: (sources: Record<string, DataModule[]>) => SkTypefaceFontProvider | null;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
|
2
|
+
import type { SkTypeface } from "../Typeface";
|
|
3
|
+
import type { FontStyle } from "./Font";
|
|
4
|
+
export interface SkFontMgr extends SkJSIInstance<"FontMgr"> {
|
|
5
|
+
countFamilies(): number;
|
|
6
|
+
getFamilyName(index: number): string;
|
|
7
|
+
matchFamilyStyle(name: string, style: FontStyle): SkTypeface;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SkFontMgr } from "../Font";
|
|
2
|
+
import type { SkTypeface } from "../Typeface";
|
|
3
|
+
export interface SkTypefaceFontProvider extends SkFontMgr {
|
|
4
|
+
/**
|
|
5
|
+
* Registers a given typeface with the given family name.
|
|
6
|
+
* @param typeface - Typeface.
|
|
7
|
+
* @param family
|
|
8
|
+
*/
|
|
9
|
+
registerFont(typeface: SkTypeface, familyName: string): void;
|
|
10
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ImageFilterFactory } from "./ImageFilter";
|
|
2
2
|
import type { PathFactory } from "./Path";
|
|
3
3
|
import type { ColorFilterFactory } from "./ColorFilter";
|
|
4
|
-
import type { SkFont } from "./Font";
|
|
4
|
+
import type { SkFont, FontMgrFactory } from "./Font";
|
|
5
5
|
import type { SkTypeface, TypefaceFactory } from "./Typeface";
|
|
6
6
|
import type { ImageFactory } from "./Image";
|
|
7
7
|
import type { MaskFilterFactory } from "./MaskFilter";
|
|
@@ -23,6 +23,7 @@ import type { SkPath } from "./Path/Path";
|
|
|
23
23
|
import type { SkContourMeasureIter } from "./ContourMeasure";
|
|
24
24
|
import type { PictureFactory, SkPictureRecorder } from "./Picture";
|
|
25
25
|
import type { Color, SkColor } from "./Color";
|
|
26
|
+
import type { TypefaceFontProviderFactory } from "./Paragraph/TypefaceFontProviderFactory";
|
|
26
27
|
/**
|
|
27
28
|
* Declares the interface for the native Skia API
|
|
28
29
|
*/
|
|
@@ -42,6 +43,8 @@ export interface Skia {
|
|
|
42
43
|
ColorFilter: ColorFilterFactory;
|
|
43
44
|
Font: (typeface?: SkTypeface, size?: number) => SkFont;
|
|
44
45
|
Typeface: TypefaceFactory;
|
|
46
|
+
TypefaceFontProvider: TypefaceFontProviderFactory;
|
|
47
|
+
FontMgr: FontMgrFactory;
|
|
45
48
|
MaskFilter: MaskFilterFactory;
|
|
46
49
|
RuntimeEffect: RuntimeEffectFactory;
|
|
47
50
|
ImageFilter: ImageFilterFactory;
|
|
@@ -11,7 +11,7 @@ export declare abstract class BaseHostObject<T, N extends string> extends Host i
|
|
|
11
11
|
readonly __typename__: N;
|
|
12
12
|
ref: T;
|
|
13
13
|
constructor(CanvasKit: CanvasKit, ref: T, typename: N);
|
|
14
|
-
abstract dispose
|
|
14
|
+
abstract dispose(): void;
|
|
15
15
|
}
|
|
16
16
|
export declare abstract class HostObject<T, N extends string> extends BaseHostObject<T, N> {
|
|
17
17
|
static fromValue<T>(value: SkJSIInstance<string>): T;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CanvasKit, FontMgr } from "canvaskit-wasm";
|
|
2
|
+
import type { FontStyle, SkFontMgr, SkTypeface } from "../types";
|
|
3
|
+
import { HostObject } from "./Host";
|
|
4
|
+
export declare class JsiSkFontMgr extends HostObject<FontMgr, "FontMgr"> implements SkFontMgr {
|
|
5
|
+
constructor(CanvasKit: CanvasKit, ref: FontMgr);
|
|
6
|
+
dispose(): void;
|
|
7
|
+
countFamilies(): number;
|
|
8
|
+
getFamilyName(index: number): string;
|
|
9
|
+
matchFamilyStyle(_familyName: string, _fontStyle: FontStyle): SkTypeface;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CanvasKit } from "canvaskit-wasm";
|
|
2
|
+
import type { FontMgrFactory } from "../types";
|
|
3
|
+
import { Host } from "./Host";
|
|
4
|
+
import { JsiSkFontMgr } from "./JsiSkFontMgr";
|
|
5
|
+
export declare class JsiSkFontMgrFactory extends Host implements FontMgrFactory {
|
|
6
|
+
constructor(CanvasKit: CanvasKit);
|
|
7
|
+
System(): JsiSkFontMgr;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CanvasKit, TypefaceFontProvider } from "canvaskit-wasm";
|
|
2
|
+
import type { SkTypefaceFontProvider } from "../types/Paragraph/TypefaceFontProvider";
|
|
3
|
+
import type { FontStyle, SkTypeface } from "../types";
|
|
4
|
+
import { HostObject } from "./Host";
|
|
5
|
+
export declare class JsiSkTypefaceFontProvider extends HostObject<TypefaceFontProvider, "FontMgr"> implements SkTypefaceFontProvider {
|
|
6
|
+
private allocatedPointers;
|
|
7
|
+
constructor(CanvasKit: CanvasKit, ref: TypefaceFontProvider);
|
|
8
|
+
matchFamilyStyle(_name: string, _style: FontStyle): SkTypeface;
|
|
9
|
+
countFamilies(): any;
|
|
10
|
+
getFamilyName(index: number): any;
|
|
11
|
+
registerFont(typeface: SkTypeface, familyName: string): void;
|
|
12
|
+
dispose(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CanvasKit } from "canvaskit-wasm";
|
|
2
|
+
import { Host } from "./Host";
|
|
3
|
+
import { JsiSkTypefaceFontProvider } from "./JsiSkTypefaceFontProvider";
|
|
4
|
+
export declare class JsiSkTypefaceFontProviderFactory extends Host implements JsiSkTypefaceFontProviderFactory {
|
|
5
|
+
constructor(CanvasKit: CanvasKit);
|
|
6
|
+
Make(): JsiSkTypefaceFontProvider;
|
|
7
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -6,32 +6,32 @@
|
|
|
6
6
|
<array>
|
|
7
7
|
<dict>
|
|
8
8
|
<key>LibraryIdentifier</key>
|
|
9
|
-
<string>ios-
|
|
9
|
+
<string>ios-arm64_arm64e</string>
|
|
10
10
|
<key>LibraryPath</key>
|
|
11
11
|
<string>libskia.a</string>
|
|
12
12
|
<key>SupportedArchitectures</key>
|
|
13
13
|
<array>
|
|
14
14
|
<string>arm64</string>
|
|
15
15
|
<string>arm64e</string>
|
|
16
|
-
<string>x86_64</string>
|
|
17
16
|
</array>
|
|
18
17
|
<key>SupportedPlatform</key>
|
|
19
18
|
<string>ios</string>
|
|
20
|
-
<key>SupportedPlatformVariant</key>
|
|
21
|
-
<string>simulator</string>
|
|
22
19
|
</dict>
|
|
23
20
|
<dict>
|
|
24
21
|
<key>LibraryIdentifier</key>
|
|
25
|
-
<string>ios-
|
|
22
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
|
26
23
|
<key>LibraryPath</key>
|
|
27
24
|
<string>libskia.a</string>
|
|
28
25
|
<key>SupportedArchitectures</key>
|
|
29
26
|
<array>
|
|
30
27
|
<string>arm64</string>
|
|
31
28
|
<string>arm64e</string>
|
|
29
|
+
<string>x86_64</string>
|
|
32
30
|
</array>
|
|
33
31
|
<key>SupportedPlatform</key>
|
|
34
32
|
<string>ios</string>
|
|
33
|
+
<key>SupportedPlatformVariant</key>
|
|
34
|
+
<string>simulator</string>
|
|
35
35
|
</dict>
|
|
36
36
|
</array>
|
|
37
37
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>AvailableLibraries</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>LibraryIdentifier</key>
|
|
9
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
|
10
|
+
<key>LibraryPath</key>
|
|
11
|
+
<string>libskparagraph.a</string>
|
|
12
|
+
<key>SupportedArchitectures</key>
|
|
13
|
+
<array>
|
|
14
|
+
<string>arm64</string>
|
|
15
|
+
<string>arm64e</string>
|
|
16
|
+
<string>x86_64</string>
|
|
17
|
+
</array>
|
|
18
|
+
<key>SupportedPlatform</key>
|
|
19
|
+
<string>ios</string>
|
|
20
|
+
<key>SupportedPlatformVariant</key>
|
|
21
|
+
<string>simulator</string>
|
|
22
|
+
</dict>
|
|
23
|
+
<dict>
|
|
24
|
+
<key>LibraryIdentifier</key>
|
|
25
|
+
<string>ios-arm64_arm64e</string>
|
|
26
|
+
<key>LibraryPath</key>
|
|
27
|
+
<string>libskparagraph.a</string>
|
|
28
|
+
<key>SupportedArchitectures</key>
|
|
29
|
+
<array>
|
|
30
|
+
<string>arm64</string>
|
|
31
|
+
<string>arm64e</string>
|
|
32
|
+
</array>
|
|
33
|
+
<key>SupportedPlatform</key>
|
|
34
|
+
<string>ios</string>
|
|
35
|
+
</dict>
|
|
36
|
+
</array>
|
|
37
|
+
<key>CFBundlePackageType</key>
|
|
38
|
+
<string>XFWK</string>
|
|
39
|
+
<key>XCFrameworkFormatVersion</key>
|
|
40
|
+
<string>1.0</string>
|
|
41
|
+
</dict>
|
|
42
|
+
</plist>
|
package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>AvailableLibraries</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>LibraryIdentifier</key>
|
|
9
|
+
<string>ios-arm64_arm64e</string>
|
|
10
|
+
<key>LibraryPath</key>
|
|
11
|
+
<string>libskunicode.a</string>
|
|
12
|
+
<key>SupportedArchitectures</key>
|
|
13
|
+
<array>
|
|
14
|
+
<string>arm64</string>
|
|
15
|
+
<string>arm64e</string>
|
|
16
|
+
</array>
|
|
17
|
+
<key>SupportedPlatform</key>
|
|
18
|
+
<string>ios</string>
|
|
19
|
+
</dict>
|
|
20
|
+
<dict>
|
|
21
|
+
<key>LibraryIdentifier</key>
|
|
22
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
|
23
|
+
<key>LibraryPath</key>
|
|
24
|
+
<string>libskunicode.a</string>
|
|
25
|
+
<key>SupportedArchitectures</key>
|
|
26
|
+
<array>
|
|
27
|
+
<string>arm64</string>
|
|
28
|
+
<string>arm64e</string>
|
|
29
|
+
<string>x86_64</string>
|
|
30
|
+
</array>
|
|
31
|
+
<key>SupportedPlatform</key>
|
|
32
|
+
<string>ios</string>
|
|
33
|
+
<key>SupportedPlatformVariant</key>
|
|
34
|
+
<string>simulator</string>
|
|
35
|
+
</dict>
|
|
36
|
+
</array>
|
|
37
|
+
<key>CFBundlePackageType</key>
|
|
38
|
+
<string>XFWK</string>
|
|
39
|
+
<key>XCFrameworkFormatVersion</key>
|
|
40
|
+
<string>1.0</string>
|
|
41
|
+
</dict>
|
|
42
|
+
</plist>
|
|
Binary file
|
|
@@ -6,32 +6,32 @@
|
|
|
6
6
|
<array>
|
|
7
7
|
<dict>
|
|
8
8
|
<key>LibraryIdentifier</key>
|
|
9
|
-
<string>ios-
|
|
9
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
|
10
10
|
<key>LibraryPath</key>
|
|
11
11
|
<string>libsvg.a</string>
|
|
12
12
|
<key>SupportedArchitectures</key>
|
|
13
13
|
<array>
|
|
14
14
|
<string>arm64</string>
|
|
15
15
|
<string>arm64e</string>
|
|
16
|
+
<string>x86_64</string>
|
|
16
17
|
</array>
|
|
17
18
|
<key>SupportedPlatform</key>
|
|
18
19
|
<string>ios</string>
|
|
20
|
+
<key>SupportedPlatformVariant</key>
|
|
21
|
+
<string>simulator</string>
|
|
19
22
|
</dict>
|
|
20
23
|
<dict>
|
|
21
24
|
<key>LibraryIdentifier</key>
|
|
22
|
-
<string>ios-
|
|
25
|
+
<string>ios-arm64_arm64e</string>
|
|
23
26
|
<key>LibraryPath</key>
|
|
24
27
|
<string>libsvg.a</string>
|
|
25
28
|
<key>SupportedArchitectures</key>
|
|
26
29
|
<array>
|
|
27
30
|
<string>arm64</string>
|
|
28
31
|
<string>arm64e</string>
|
|
29
|
-
<string>x86_64</string>
|
|
30
32
|
</array>
|
|
31
33
|
<key>SupportedPlatform</key>
|
|
32
34
|
<string>ios</string>
|
|
33
|
-
<key>SupportedPlatformVariant</key>
|
|
34
|
-
<string>simulator</string>
|
|
35
35
|
</dict>
|
|
36
36
|
</array>
|
|
37
37
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"setup-skia-web": "./scripts/setup-canvaskit.js"
|
|
8
8
|
},
|
|
9
9
|
"title": "React Native Skia",
|
|
10
|
-
"version": "0.1.
|
|
10
|
+
"version": "0.1.203",
|
|
11
11
|
"description": "High-performance React Native Graphics using Skia",
|
|
12
12
|
"main": "lib/module/index.js",
|
|
13
13
|
"files": [
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
"libs/ios/libsvg.xcframework",
|
|
34
34
|
"libs/ios/libskottie.xcframework",
|
|
35
35
|
"libs/ios/libsksg.xcframework",
|
|
36
|
+
"libs/ios/libskparagraph.xcframework",
|
|
37
|
+
"libs/ios/libskunicode.xcframework",
|
|
36
38
|
"react-native-skia.podspec",
|
|
37
39
|
"scripts/setup-canvaskit.js",
|
|
38
40
|
"dist/**"
|
|
@@ -34,8 +34,8 @@ Pod::Spec.new do |s|
|
|
|
34
34
|
'libs/ios/libskia.xcframework',
|
|
35
35
|
'libs/ios/libsvg.xcframework',
|
|
36
36
|
'libs/ios/libskshaper.xcframework',
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
'libs/ios/libskparagraph.xcframework',
|
|
38
|
+
'libs/ios/libskunicode.xcframework',
|
|
39
39
|
]
|
|
40
40
|
|
|
41
41
|
# All iOS cpp/h files
|
package/src/skia/core/Data.ts
CHANGED
|
@@ -18,7 +18,7 @@ const factoryWrapper = <T>(
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const loadData = <T>(
|
|
21
|
+
export const loadData = <T>(
|
|
22
22
|
source: DataSourceParam,
|
|
23
23
|
factory: (data: SkData) => T | null,
|
|
24
24
|
onError?: (err: Error) => void
|
|
@@ -37,6 +37,7 @@ const loadData = <T>(
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
+
|
|
40
41
|
const useLoading = <T extends SkJSIInstance<string>>(
|
|
41
42
|
source: DataSourceParam,
|
|
42
43
|
loader: () => Promise<T | null>
|
|
@@ -61,6 +62,35 @@ const useLoading = <T extends SkJSIInstance<string>>(
|
|
|
61
62
|
return data;
|
|
62
63
|
};
|
|
63
64
|
|
|
65
|
+
export const useCollectionLoading = <T extends SkJSIInstance<string>>(
|
|
66
|
+
source: DataSourceParam[],
|
|
67
|
+
loader: () => Promise<(T | null)[]>
|
|
68
|
+
) => {
|
|
69
|
+
const mounted = useRef(false);
|
|
70
|
+
const [data, setData] = useState<T[] | null>(null);
|
|
71
|
+
const dataRef = useRef<T[] | null>(null);
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
mounted.current = true;
|
|
75
|
+
loader().then((result) => {
|
|
76
|
+
const value = result.filter((r) => r !== null) as T[];
|
|
77
|
+
if (mounted.current) {
|
|
78
|
+
setData(value);
|
|
79
|
+
dataRef.current = value;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return () => {
|
|
84
|
+
dataRef.current?.forEach((instance) => instance?.dispose());
|
|
85
|
+
mounted.current = false;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89
|
+
}, [source]);
|
|
90
|
+
|
|
91
|
+
return data;
|
|
92
|
+
};
|
|
93
|
+
|
|
64
94
|
export const useRawData = <T extends SkJSIInstance<string>>(
|
|
65
95
|
source: DataSourceParam,
|
|
66
96
|
factory: (data: SkData) => T | null,
|