@shopify/react-native-skia 1.3.7 → 1.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/android/cpp/rnskia-android/RNSkAndroidVideo.cpp +1 -1
  2. package/cpp/api/JsiSkTypefaceFontProvider.h +14 -4
  3. package/cpp/rnskia/RNSkJsiViewApi.h +0 -5
  4. package/lib/commonjs/skia/types/Font/FontMgr.d.ts +1 -1
  5. package/lib/commonjs/skia/types/Font/FontMgr.js.map +1 -1
  6. package/lib/module/skia/types/Font/FontMgr.d.ts +1 -1
  7. package/lib/module/skia/types/Font/FontMgr.js.map +1 -1
  8. package/lib/typescript/src/skia/types/Font/FontMgr.d.ts +1 -1
  9. package/libs/ios/libskia.xcframework/Info.plist +9 -5
  10. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  11. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  12. package/libs/ios/libskottie.xcframework/Info.plist +9 -5
  13. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  14. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  15. package/libs/ios/libskparagraph.xcframework/Info.plist +4 -0
  16. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  17. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  18. package/libs/ios/libsksg.xcframework/Info.plist +9 -5
  19. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  20. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  21. package/libs/ios/libskshaper.xcframework/Info.plist +4 -0
  22. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  23. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  24. package/libs/ios/libskunicode.xcframework/Info.plist +4 -0
  25. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  26. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  27. package/libs/ios/libsvg.xcframework/Info.plist +4 -0
  28. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  29. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  30. package/package.json +2 -2
  31. package/src/skia/types/Font/FontMgr.ts +1 -1
@@ -88,7 +88,7 @@ void RNSkAndroidVideo::seek(double timestamp) {
88
88
  RNSkLogger::logToConsole("seek method not found");
89
89
  return;
90
90
  }
91
- env->CallVoidMethod(_jniVideo.get(), mid, static_cast<jlong>(timestamp));
91
+ env->CallVoidMethod(_jniVideo.get(), mid, static_cast<jdouble>(timestamp));
92
92
  }
93
93
 
94
94
  float RNSkAndroidVideo::getRotationInDegrees() {
@@ -45,10 +45,20 @@ public:
45
45
  }
46
46
 
47
47
  JSI_HOST_FUNCTION(matchFamilyStyle) {
48
- auto name = arguments[0].asString(runtime).utf8(runtime);
49
- auto fontStyle = JsiSkFontStyle::fromValue(runtime, arguments[1]);
50
- sk_sp<SkFontStyleSet> set(getObject()->onMatchFamily(name.c_str()));
51
- sk_sp<SkTypeface> typeface(set->matchStyle(*fontStyle));
48
+ auto name = count > 0 ? arguments[0].asString(runtime).utf8(runtime) : "";
49
+ auto fontStyle =
50
+ count > 1 ? JsiSkFontStyle::fromValue(runtime, arguments[1]) : nullptr;
51
+ if (name == "" || fontStyle == nullptr) {
52
+ throw std::runtime_error("matchFamilyStyle requires a name and a style");
53
+ }
54
+ auto set = getObject()->onMatchFamily(name.c_str());
55
+ if (!set) {
56
+ throw std::runtime_error("Could not find font family " + name);
57
+ }
58
+ auto typeface = set->matchStyle(*fontStyle);
59
+ if (!typeface) {
60
+ throw std::runtime_error("Could not find font style for " + name);
61
+ }
52
62
  return jsi::Object::createFromHostObject(
53
63
  runtime, std::make_shared<JsiSkTypeface>(getContext(), typeface));
54
64
  }
@@ -206,11 +206,6 @@ public:
206
206
  */
207
207
  void unregisterAll() {
208
208
  std::lock_guard<std::mutex> lock(_mutex);
209
- // Unregister all views
210
- auto tempList = _viewInfos;
211
- for (const auto &info : tempList) {
212
- unregisterSkiaView(info.first);
213
- }
214
209
  _viewInfos.clear();
215
210
  }
216
211
 
@@ -4,5 +4,5 @@ import type { FontStyle } from "./Font";
4
4
  export interface SkFontMgr extends SkJSIInstance<"FontMgr"> {
5
5
  countFamilies(): number;
6
6
  getFamilyName(index: number): string;
7
- matchFamilyStyle(name?: string, style?: FontStyle): SkTypeface;
7
+ matchFamilyStyle(name: string, style: FontStyle): SkTypeface;
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["FontMgr.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkTypeface } from \"../Typeface\";\n\nimport type { FontStyle } from \"./Font\";\n\nexport interface SkFontMgr extends SkJSIInstance<\"FontMgr\"> {\n countFamilies(): number;\n getFamilyName(index: number): string;\n matchFamilyStyle(name?: string, style?: FontStyle): SkTypeface;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["FontMgr.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkTypeface } from \"../Typeface\";\n\nimport type { FontStyle } from \"./Font\";\n\nexport interface SkFontMgr extends SkJSIInstance<\"FontMgr\"> {\n countFamilies(): number;\n getFamilyName(index: number): string;\n matchFamilyStyle(name: string, style: FontStyle): SkTypeface;\n}\n"],"mappings":""}
@@ -4,5 +4,5 @@ import type { FontStyle } from "./Font";
4
4
  export interface SkFontMgr extends SkJSIInstance<"FontMgr"> {
5
5
  countFamilies(): number;
6
6
  getFamilyName(index: number): string;
7
- matchFamilyStyle(name?: string, style?: FontStyle): SkTypeface;
7
+ matchFamilyStyle(name: string, style: FontStyle): SkTypeface;
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["FontMgr.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkTypeface } from \"../Typeface\";\n\nimport type { FontStyle } from \"./Font\";\n\nexport interface SkFontMgr extends SkJSIInstance<\"FontMgr\"> {\n countFamilies(): number;\n getFamilyName(index: number): string;\n matchFamilyStyle(name?: string, style?: FontStyle): SkTypeface;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["FontMgr.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkTypeface } from \"../Typeface\";\n\nimport type { FontStyle } from \"./Font\";\n\nexport interface SkFontMgr extends SkJSIInstance<\"FontMgr\"> {\n countFamilies(): number;\n getFamilyName(index: number): string;\n matchFamilyStyle(name: string, style: FontStyle): SkTypeface;\n}\n"],"mappings":""}
@@ -4,5 +4,5 @@ import type { FontStyle } from "./Font";
4
4
  export interface SkFontMgr extends SkJSIInstance<"FontMgr"> {
5
5
  countFamilies(): number;
6
6
  getFamilyName(index: number): string;
7
- matchFamilyStyle(name?: string, style?: FontStyle): SkTypeface;
7
+ matchFamilyStyle(name: string, style: FontStyle): SkTypeface;
8
8
  }
@@ -5,33 +5,37 @@
5
5
  <key>AvailableLibraries</key>
6
6
  <array>
7
7
  <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libskia.a</string>
8
10
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64_arm64e_x86_64-simulator</string>
11
+ <string>ios-arm64_arm64e</string>
10
12
  <key>LibraryPath</key>
11
13
  <string>libskia.a</string>
12
14
  <key>SupportedArchitectures</key>
13
15
  <array>
14
16
  <string>arm64</string>
15
17
  <string>arm64e</string>
16
- <string>x86_64</string>
17
18
  </array>
18
19
  <key>SupportedPlatform</key>
19
20
  <string>ios</string>
20
- <key>SupportedPlatformVariant</key>
21
- <string>simulator</string>
22
21
  </dict>
23
22
  <dict>
23
+ <key>BinaryPath</key>
24
+ <string>libskia.a</string>
24
25
  <key>LibraryIdentifier</key>
25
- <string>ios-arm64_arm64e</string>
26
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
26
27
  <key>LibraryPath</key>
27
28
  <string>libskia.a</string>
28
29
  <key>SupportedArchitectures</key>
29
30
  <array>
30
31
  <string>arm64</string>
31
32
  <string>arm64e</string>
33
+ <string>x86_64</string>
32
34
  </array>
33
35
  <key>SupportedPlatform</key>
34
36
  <string>ios</string>
37
+ <key>SupportedPlatformVariant</key>
38
+ <string>simulator</string>
35
39
  </dict>
36
40
  </array>
37
41
  <key>CFBundlePackageType</key>
@@ -5,33 +5,37 @@
5
5
  <key>AvailableLibraries</key>
6
6
  <array>
7
7
  <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libskottie.a</string>
8
10
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64_arm64e</string>
11
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
10
12
  <key>LibraryPath</key>
11
13
  <string>libskottie.a</string>
12
14
  <key>SupportedArchitectures</key>
13
15
  <array>
14
16
  <string>arm64</string>
15
17
  <string>arm64e</string>
18
+ <string>x86_64</string>
16
19
  </array>
17
20
  <key>SupportedPlatform</key>
18
21
  <string>ios</string>
22
+ <key>SupportedPlatformVariant</key>
23
+ <string>simulator</string>
19
24
  </dict>
20
25
  <dict>
26
+ <key>BinaryPath</key>
27
+ <string>libskottie.a</string>
21
28
  <key>LibraryIdentifier</key>
22
- <string>ios-arm64_arm64e_x86_64-simulator</string>
29
+ <string>ios-arm64_arm64e</string>
23
30
  <key>LibraryPath</key>
24
31
  <string>libskottie.a</string>
25
32
  <key>SupportedArchitectures</key>
26
33
  <array>
27
34
  <string>arm64</string>
28
35
  <string>arm64e</string>
29
- <string>x86_64</string>
30
36
  </array>
31
37
  <key>SupportedPlatform</key>
32
38
  <string>ios</string>
33
- <key>SupportedPlatformVariant</key>
34
- <string>simulator</string>
35
39
  </dict>
36
40
  </array>
37
41
  <key>CFBundlePackageType</key>
@@ -5,6 +5,8 @@
5
5
  <key>AvailableLibraries</key>
6
6
  <array>
7
7
  <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libskparagraph.a</string>
8
10
  <key>LibraryIdentifier</key>
9
11
  <string>ios-arm64_arm64e_x86_64-simulator</string>
10
12
  <key>LibraryPath</key>
@@ -21,6 +23,8 @@
21
23
  <string>simulator</string>
22
24
  </dict>
23
25
  <dict>
26
+ <key>BinaryPath</key>
27
+ <string>libskparagraph.a</string>
24
28
  <key>LibraryIdentifier</key>
25
29
  <string>ios-arm64_arm64e</string>
26
30
  <key>LibraryPath</key>
@@ -5,33 +5,37 @@
5
5
  <key>AvailableLibraries</key>
6
6
  <array>
7
7
  <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libsksg.a</string>
8
10
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64_arm64e_x86_64-simulator</string>
11
+ <string>ios-arm64_arm64e</string>
10
12
  <key>LibraryPath</key>
11
13
  <string>libsksg.a</string>
12
14
  <key>SupportedArchitectures</key>
13
15
  <array>
14
16
  <string>arm64</string>
15
17
  <string>arm64e</string>
16
- <string>x86_64</string>
17
18
  </array>
18
19
  <key>SupportedPlatform</key>
19
20
  <string>ios</string>
20
- <key>SupportedPlatformVariant</key>
21
- <string>simulator</string>
22
21
  </dict>
23
22
  <dict>
23
+ <key>BinaryPath</key>
24
+ <string>libsksg.a</string>
24
25
  <key>LibraryIdentifier</key>
25
- <string>ios-arm64_arm64e</string>
26
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
26
27
  <key>LibraryPath</key>
27
28
  <string>libsksg.a</string>
28
29
  <key>SupportedArchitectures</key>
29
30
  <array>
30
31
  <string>arm64</string>
31
32
  <string>arm64e</string>
33
+ <string>x86_64</string>
32
34
  </array>
33
35
  <key>SupportedPlatform</key>
34
36
  <string>ios</string>
37
+ <key>SupportedPlatformVariant</key>
38
+ <string>simulator</string>
35
39
  </dict>
36
40
  </array>
37
41
  <key>CFBundlePackageType</key>
@@ -5,6 +5,8 @@
5
5
  <key>AvailableLibraries</key>
6
6
  <array>
7
7
  <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libskshaper.a</string>
8
10
  <key>LibraryIdentifier</key>
9
11
  <string>ios-arm64_arm64e_x86_64-simulator</string>
10
12
  <key>LibraryPath</key>
@@ -21,6 +23,8 @@
21
23
  <string>simulator</string>
22
24
  </dict>
23
25
  <dict>
26
+ <key>BinaryPath</key>
27
+ <string>libskshaper.a</string>
24
28
  <key>LibraryIdentifier</key>
25
29
  <string>ios-arm64_arm64e</string>
26
30
  <key>LibraryPath</key>
@@ -5,6 +5,8 @@
5
5
  <key>AvailableLibraries</key>
6
6
  <array>
7
7
  <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libskunicode.a</string>
8
10
  <key>LibraryIdentifier</key>
9
11
  <string>ios-arm64_arm64e</string>
10
12
  <key>LibraryPath</key>
@@ -18,6 +20,8 @@
18
20
  <string>ios</string>
19
21
  </dict>
20
22
  <dict>
23
+ <key>BinaryPath</key>
24
+ <string>libskunicode.a</string>
21
25
  <key>LibraryIdentifier</key>
22
26
  <string>ios-arm64_arm64e_x86_64-simulator</string>
23
27
  <key>LibraryPath</key>
@@ -5,6 +5,8 @@
5
5
  <key>AvailableLibraries</key>
6
6
  <array>
7
7
  <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libsvg.a</string>
8
10
  <key>LibraryIdentifier</key>
9
11
  <string>ios-arm64_arm64e</string>
10
12
  <key>LibraryPath</key>
@@ -18,6 +20,8 @@
18
20
  <string>ios</string>
19
21
  </dict>
20
22
  <dict>
23
+ <key>BinaryPath</key>
24
+ <string>libsvg.a</string>
21
25
  <key>LibraryIdentifier</key>
22
26
  <string>ios-arm64_arm64e_x86_64-simulator</string>
23
27
  <key>LibraryPath</key>
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": "1.3.7",
10
+ "version": "1.3.9",
11
11
  "description": "High-performance React Native Graphics using Skia",
12
12
  "main": "lib/module/index.js",
13
13
  "react-native": "src/index.ts",
@@ -108,7 +108,7 @@
108
108
  "react-native-reanimated": "3.6.2",
109
109
  "ts-jest": "29.1.1",
110
110
  "typescript": "5.1.6",
111
- "ws": "8.17.1"
111
+ "ws": "8.18.0"
112
112
  },
113
113
  "dependencies": {
114
114
  "canvaskit-wasm": "0.39.1",
@@ -6,5 +6,5 @@ import type { FontStyle } from "./Font";
6
6
  export interface SkFontMgr extends SkJSIInstance<"FontMgr"> {
7
7
  countFamilies(): number;
8
8
  getFamilyName(index: number): string;
9
- matchFamilyStyle(name?: string, style?: FontStyle): SkTypeface;
9
+ matchFamilyStyle(name: string, style: FontStyle): SkTypeface;
10
10
  }