@shopify/react-native-skia 1.7.6 → 1.7.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (364) hide show
  1. package/android/cpp/rnskia-android/OpenGLWindowContext.h +8 -1
  2. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +4 -4
  3. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +2 -2
  4. package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +13 -0
  5. package/android/src/main/java/com/shopify/reactnative/skia/SkiaTextureView.java +24 -1
  6. package/cpp/rnskia/RNSkJsiViewApi.h +0 -3
  7. package/cpp/rnskia/RNSkView.h +6 -6
  8. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +2 -2
  9. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +2 -2
  10. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  11. package/lib/commonjs/dom/nodes/datatypes/Circle.d.ts +2 -3
  12. package/lib/commonjs/dom/nodes/datatypes/Circle.js +11 -6
  13. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
  14. package/lib/commonjs/dom/nodes/datatypes/Enum.js +1 -0
  15. package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
  16. package/lib/commonjs/dom/nodes/datatypes/Fitting.js +1 -10
  17. package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
  18. package/lib/commonjs/dom/nodes/datatypes/Gradient.js +3 -2
  19. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
  20. package/lib/commonjs/dom/nodes/datatypes/Path.js +4 -1
  21. package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
  22. package/lib/commonjs/dom/nodes/datatypes/Radius.js +1 -0
  23. package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
  24. package/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +3 -1
  25. package/lib/commonjs/dom/nodes/datatypes/Rect.js +17 -7
  26. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  27. package/lib/commonjs/dom/nodes/datatypes/Transform.d.ts +2 -1
  28. package/lib/commonjs/dom/nodes/datatypes/Transform.js +32 -1
  29. package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
  30. package/lib/commonjs/dom/nodes/drawings/Box.js +4 -5
  31. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  32. package/lib/commonjs/dom/nodes/drawings/CircleNode.js +1 -1
  33. package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -1
  34. package/lib/commonjs/dom/types/DeclarationContext.d.ts +4 -4
  35. package/lib/commonjs/dom/types/DeclarationContext.js +8 -2
  36. package/lib/commonjs/dom/types/DeclarationContext.js.map +1 -1
  37. package/lib/commonjs/external/reanimated/renderHelpers.d.ts +2 -0
  38. package/lib/commonjs/external/reanimated/renderHelpers.js +11 -6
  39. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  40. package/lib/commonjs/renderer/HostConfig.js +8 -4
  41. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  42. package/lib/commonjs/renderer/__tests__/setup.d.ts +2 -3
  43. package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +1 -2
  44. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  45. package/lib/commonjs/renderer/typeddash.js +5 -1
  46. package/lib/commonjs/renderer/typeddash.js.map +1 -1
  47. package/lib/commonjs/skia/__tests__/setup.d.ts +0 -3
  48. package/lib/commonjs/skia/types/Path/Path.js +5 -1
  49. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  50. package/lib/commonjs/skia/types/Shader/Shader.js +8 -6
  51. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  52. package/lib/commonjs/sksg/Container.d.ts +19 -0
  53. package/lib/commonjs/sksg/Container.js +102 -0
  54. package/lib/commonjs/sksg/Container.js.map +1 -0
  55. package/lib/commonjs/sksg/DrawingContext.d.ts +16 -0
  56. package/lib/commonjs/sksg/DrawingContext.js +186 -0
  57. package/lib/commonjs/sksg/DrawingContext.js.map +1 -0
  58. package/lib/commonjs/sksg/HostConfig.d.ts +19 -0
  59. package/lib/commonjs/sksg/HostConfig.js +168 -0
  60. package/lib/commonjs/sksg/HostConfig.js.map +1 -0
  61. package/lib/commonjs/sksg/Reconciler.d.ts +17 -0
  62. package/lib/commonjs/sksg/Reconciler.js +54 -0
  63. package/lib/commonjs/sksg/Reconciler.js.map +1 -0
  64. package/lib/commonjs/sksg/__tests__/MockDeclaration.d.ts +57 -0
  65. package/lib/commonjs/sksg/nodes/Node.d.ts +7 -0
  66. package/lib/commonjs/sksg/nodes/Node.js +6 -0
  67. package/lib/commonjs/sksg/nodes/Node.js.map +1 -0
  68. package/lib/commonjs/sksg/nodes/colorFilters.d.ts +7 -0
  69. package/lib/commonjs/sksg/nodes/colorFilters.js +55 -0
  70. package/lib/commonjs/sksg/nodes/colorFilters.js.map +1 -0
  71. package/lib/commonjs/sksg/nodes/context.d.ts +3 -0
  72. package/lib/commonjs/sksg/nodes/context.js +448 -0
  73. package/lib/commonjs/sksg/nodes/context.js.map +1 -0
  74. package/lib/commonjs/sksg/nodes/drawings.d.ts +31 -0
  75. package/lib/commonjs/sksg/nodes/drawings.js +361 -0
  76. package/lib/commonjs/sksg/nodes/drawings.js.map +1 -0
  77. package/lib/commonjs/sksg/nodes/imageFilters.d.ts +14 -0
  78. package/lib/commonjs/sksg/nodes/imageFilters.js +135 -0
  79. package/lib/commonjs/sksg/nodes/imageFilters.js.map +1 -0
  80. package/lib/commonjs/sksg/nodes/index.d.ts +3 -0
  81. package/lib/commonjs/sksg/nodes/index.js +39 -0
  82. package/lib/commonjs/sksg/nodes/index.js.map +1 -0
  83. package/lib/commonjs/sksg/nodes/paint.d.ts +2 -0
  84. package/lib/commonjs/sksg/nodes/paint.js +80 -0
  85. package/lib/commonjs/sksg/nodes/paint.js.map +1 -0
  86. package/lib/commonjs/sksg/nodes/pathEffects.d.ts +8 -0
  87. package/lib/commonjs/sksg/nodes/pathEffects.js +84 -0
  88. package/lib/commonjs/sksg/nodes/pathEffects.js.map +1 -0
  89. package/lib/commonjs/sksg/nodes/shaders.d.ts +10 -0
  90. package/lib/commonjs/sksg/nodes/shaders.js +156 -0
  91. package/lib/commonjs/sksg/nodes/shaders.js.map +1 -0
  92. package/lib/commonjs/sksg/nodes/utils.d.ts +3 -0
  93. package/lib/commonjs/sksg/nodes/utils.js +25 -0
  94. package/lib/commonjs/sksg/nodes/utils.js.map +1 -0
  95. package/lib/commonjs/views/SkiaPictureView.js +0 -2
  96. package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
  97. package/lib/commonjs/views/types.d.ts +2 -2
  98. package/lib/commonjs/views/types.js.map +1 -1
  99. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  100. package/lib/module/dom/nodes/datatypes/Circle.d.ts +2 -3
  101. package/lib/module/dom/nodes/datatypes/Circle.js +12 -6
  102. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  103. package/lib/module/dom/nodes/datatypes/Enum.js +2 -0
  104. package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
  105. package/lib/module/dom/nodes/datatypes/Fitting.js +2 -10
  106. package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
  107. package/lib/module/dom/nodes/datatypes/Gradient.js +4 -2
  108. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  109. package/lib/module/dom/nodes/datatypes/Path.js +5 -1
  110. package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
  111. package/lib/module/dom/nodes/datatypes/Radius.js +2 -0
  112. package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
  113. package/lib/module/dom/nodes/datatypes/Rect.d.ts +3 -1
  114. package/lib/module/dom/nodes/datatypes/Rect.js +14 -5
  115. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  116. package/lib/module/dom/nodes/datatypes/Transform.d.ts +2 -1
  117. package/lib/module/dom/nodes/datatypes/Transform.js +31 -0
  118. package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
  119. package/lib/module/dom/nodes/drawings/Box.js +1 -2
  120. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  121. package/lib/module/dom/nodes/drawings/CircleNode.js +1 -1
  122. package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -1
  123. package/lib/module/dom/types/DeclarationContext.d.ts +4 -4
  124. package/lib/module/dom/types/DeclarationContext.js +9 -2
  125. package/lib/module/dom/types/DeclarationContext.js.map +1 -1
  126. package/lib/module/external/reanimated/renderHelpers.d.ts +2 -0
  127. package/lib/module/external/reanimated/renderHelpers.js +8 -4
  128. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  129. package/lib/module/renderer/HostConfig.js +8 -4
  130. package/lib/module/renderer/HostConfig.js.map +1 -1
  131. package/lib/module/renderer/__tests__/setup.d.ts +2 -3
  132. package/lib/module/renderer/processors/Animations/Animations.d.ts +1 -2
  133. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  134. package/lib/module/renderer/typeddash.js +5 -1
  135. package/lib/module/renderer/typeddash.js.map +1 -1
  136. package/lib/module/skia/__tests__/setup.d.ts +0 -3
  137. package/lib/module/skia/types/Path/Path.js +5 -1
  138. package/lib/module/skia/types/Path/Path.js.map +1 -1
  139. package/lib/module/skia/types/Shader/Shader.js +9 -6
  140. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  141. package/lib/module/sksg/Container.d.ts +19 -0
  142. package/lib/module/sksg/Container.js +94 -0
  143. package/lib/module/sksg/Container.js.map +1 -0
  144. package/lib/module/sksg/DrawingContext.d.ts +16 -0
  145. package/lib/module/sksg/DrawingContext.js +180 -0
  146. package/lib/module/sksg/DrawingContext.js.map +1 -0
  147. package/lib/module/sksg/HostConfig.d.ts +19 -0
  148. package/lib/module/sksg/HostConfig.js +161 -0
  149. package/lib/module/sksg/HostConfig.js.map +1 -0
  150. package/lib/module/sksg/Reconciler.d.ts +17 -0
  151. package/lib/module/sksg/Reconciler.js +46 -0
  152. package/lib/module/sksg/Reconciler.js.map +1 -0
  153. package/lib/module/sksg/__tests__/MockDeclaration.d.ts +57 -0
  154. package/lib/module/sksg/nodes/Node.d.ts +7 -0
  155. package/lib/module/sksg/nodes/Node.js +2 -0
  156. package/lib/module/sksg/nodes/Node.js.map +1 -0
  157. package/lib/module/sksg/nodes/colorFilters.d.ts +7 -0
  158. package/lib/module/sksg/nodes/colorFilters.js +44 -0
  159. package/lib/module/sksg/nodes/colorFilters.js.map +1 -0
  160. package/lib/module/sksg/nodes/context.d.ts +3 -0
  161. package/lib/module/sksg/nodes/context.js +443 -0
  162. package/lib/module/sksg/nodes/context.js.map +1 -0
  163. package/lib/module/sksg/nodes/drawings.d.ts +31 -0
  164. package/lib/module/sksg/nodes/drawings.js +334 -0
  165. package/lib/module/sksg/nodes/drawings.js.map +1 -0
  166. package/lib/module/sksg/nodes/imageFilters.d.ts +14 -0
  167. package/lib/module/sksg/nodes/imageFilters.js +122 -0
  168. package/lib/module/sksg/nodes/imageFilters.js.map +1 -0
  169. package/lib/module/sksg/nodes/index.d.ts +3 -0
  170. package/lib/module/sksg/nodes/index.js +4 -0
  171. package/lib/module/sksg/nodes/index.js.map +1 -0
  172. package/lib/module/sksg/nodes/paint.d.ts +2 -0
  173. package/lib/module/sksg/nodes/paint.js +74 -0
  174. package/lib/module/sksg/nodes/paint.js.map +1 -0
  175. package/lib/module/sksg/nodes/pathEffects.d.ts +8 -0
  176. package/lib/module/sksg/nodes/pathEffects.js +72 -0
  177. package/lib/module/sksg/nodes/pathEffects.js.map +1 -0
  178. package/lib/module/sksg/nodes/shaders.d.ts +10 -0
  179. package/lib/module/sksg/nodes/shaders.js +142 -0
  180. package/lib/module/sksg/nodes/shaders.js.map +1 -0
  181. package/lib/module/sksg/nodes/utils.d.ts +3 -0
  182. package/lib/module/sksg/nodes/utils.js +18 -0
  183. package/lib/module/sksg/nodes/utils.js.map +1 -0
  184. package/lib/module/views/SkiaPictureView.js +0 -2
  185. package/lib/module/views/SkiaPictureView.js.map +1 -1
  186. package/lib/module/views/types.d.ts +2 -2
  187. package/lib/module/views/types.js.map +1 -1
  188. package/lib/typescript/lib/commonjs/dom/nodes/datatypes/Circle.d.ts +1 -1
  189. package/lib/typescript/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +2 -0
  190. package/lib/typescript/lib/commonjs/dom/nodes/datatypes/Transform.d.ts +1 -0
  191. package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +2 -0
  192. package/lib/typescript/lib/commonjs/renderer/HostConfig.d.ts +3 -1
  193. package/lib/typescript/lib/commonjs/sksg/Container.d.ts +16 -0
  194. package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +26 -0
  195. package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +50 -0
  196. package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +16 -0
  197. package/lib/typescript/lib/commonjs/sksg/nodes/Node.d.ts +1 -0
  198. package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +7 -0
  199. package/lib/typescript/lib/commonjs/sksg/nodes/context.d.ts +2 -0
  200. package/lib/typescript/lib/commonjs/sksg/nodes/drawings.d.ts +23 -0
  201. package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +10 -0
  202. package/lib/typescript/lib/commonjs/sksg/nodes/index.d.ts +1 -0
  203. package/lib/typescript/lib/commonjs/sksg/nodes/paint.d.ts +2 -0
  204. package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +8 -0
  205. package/lib/typescript/lib/commonjs/sksg/nodes/shaders.d.ts +10 -0
  206. package/lib/typescript/lib/commonjs/sksg/nodes/utils.d.ts +3 -0
  207. package/lib/typescript/lib/module/dom/nodes/datatypes/Circle.d.ts +1 -1
  208. package/lib/typescript/lib/module/dom/nodes/datatypes/Rect.d.ts +2 -0
  209. package/lib/typescript/lib/module/dom/nodes/datatypes/Transform.d.ts +1 -0
  210. package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +2 -0
  211. package/lib/typescript/lib/module/mock/index.d.ts +4 -1
  212. package/lib/typescript/lib/module/renderer/HostConfig.d.ts +3 -1
  213. package/lib/typescript/lib/module/sksg/Container.d.ts +15 -0
  214. package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +26 -0
  215. package/lib/typescript/lib/module/sksg/HostConfig.d.ts +49 -0
  216. package/lib/typescript/lib/module/sksg/Reconciler.d.ts +15 -0
  217. package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +6 -0
  218. package/lib/typescript/lib/module/sksg/nodes/context.d.ts +1 -0
  219. package/lib/typescript/lib/module/sksg/nodes/drawings.d.ts +22 -0
  220. package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +9 -0
  221. package/lib/typescript/lib/module/sksg/nodes/index.d.ts +3 -0
  222. package/lib/typescript/lib/module/sksg/nodes/paint.d.ts +1 -0
  223. package/lib/typescript/lib/module/sksg/nodes/pathEffects.d.ts +7 -0
  224. package/lib/typescript/lib/module/sksg/nodes/shaders.d.ts +9 -0
  225. package/lib/typescript/lib/module/sksg/nodes/utils.d.ts +2 -0
  226. package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +2 -3
  227. package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +3 -1
  228. package/lib/typescript/src/dom/nodes/datatypes/Transform.d.ts +2 -1
  229. package/lib/typescript/src/dom/types/DeclarationContext.d.ts +4 -4
  230. package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +2 -0
  231. package/lib/typescript/src/renderer/__tests__/setup.d.ts +2 -3
  232. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -2
  233. package/lib/typescript/src/skia/__tests__/setup.d.ts +0 -3
  234. package/lib/typescript/src/sksg/Container.d.ts +19 -0
  235. package/lib/typescript/src/sksg/DrawingContext.d.ts +16 -0
  236. package/lib/typescript/src/sksg/HostConfig.d.ts +19 -0
  237. package/lib/typescript/src/sksg/Reconciler.d.ts +17 -0
  238. package/lib/typescript/src/sksg/__tests__/MockDeclaration.d.ts +57 -0
  239. package/lib/typescript/src/sksg/nodes/Node.d.ts +7 -0
  240. package/lib/typescript/src/sksg/nodes/colorFilters.d.ts +7 -0
  241. package/lib/typescript/src/sksg/nodes/context.d.ts +3 -0
  242. package/lib/typescript/src/sksg/nodes/drawings.d.ts +31 -0
  243. package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +14 -0
  244. package/lib/typescript/src/sksg/nodes/index.d.ts +3 -0
  245. package/lib/typescript/src/sksg/nodes/paint.d.ts +2 -0
  246. package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +8 -0
  247. package/lib/typescript/src/sksg/nodes/shaders.d.ts +10 -0
  248. package/lib/typescript/src/sksg/nodes/utils.d.ts +3 -0
  249. package/lib/typescript/src/views/types.d.ts +2 -2
  250. package/libs/{ios → apple}/libskia.xcframework/Info.plist +15 -0
  251. package/libs/{ios → apple}/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  252. package/libs/{ios → apple}/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  253. package/libs/apple/libskia.xcframework/macos-arm64_x86_64/libskia.a +0 -0
  254. package/libs/{ios → apple}/libskottie.xcframework/Info.plist +20 -5
  255. package/libs/{ios → apple}/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  256. package/libs/{ios → apple}/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  257. package/libs/apple/libskottie.xcframework/macos-arm64_x86_64/libskottie.a +0 -0
  258. package/libs/{ios → apple}/libskparagraph.xcframework/Info.plist +20 -5
  259. package/libs/{ios → apple}/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  260. package/libs/{ios → apple}/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  261. package/libs/apple/libskparagraph.xcframework/macos-arm64_x86_64/libskparagraph.a +0 -0
  262. package/libs/{ios → apple}/libsksg.xcframework/Info.plist +15 -0
  263. package/libs/{ios → apple}/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  264. package/libs/{ios → apple}/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  265. package/libs/apple/libsksg.xcframework/macos-arm64_x86_64/libsksg.a +0 -0
  266. package/libs/{ios → apple}/libskshaper.xcframework/Info.plist +20 -5
  267. package/libs/{ios → apple}/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  268. package/libs/{ios → apple}/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  269. package/libs/apple/libskshaper.xcframework/macos-arm64_x86_64/libskshaper.a +0 -0
  270. package/libs/{ios → apple}/libskunicode_core.xcframework/Info.plist +18 -3
  271. package/libs/{ios → apple}/libskunicode_core.xcframework/ios-arm64_arm64e/libskunicode_core.a +0 -0
  272. package/libs/{ios → apple}/libskunicode_core.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
  273. package/libs/apple/libskunicode_core.xcframework/macos-arm64_x86_64/libskunicode_core.a +0 -0
  274. package/libs/{ios → apple}/libskunicode_libgrapheme.xcframework/Info.plist +15 -0
  275. package/libs/{ios → apple}/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
  276. package/libs/{ios → apple}/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
  277. package/libs/apple/libskunicode_libgrapheme.xcframework/macos-arm64_x86_64/libskunicode_libgrapheme.a +0 -0
  278. package/libs/{ios → apple}/libsvg.xcframework/Info.plist +15 -0
  279. package/libs/{ios → apple}/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  280. package/libs/{ios → apple}/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  281. package/libs/apple/libsvg.xcframework/macos-arm64_x86_64/libsvg.a +0 -0
  282. package/package.json +3 -3
  283. package/react-native-skia.podspec +9 -9
  284. package/src/__tests__/setup.ts +1 -1
  285. package/src/__tests__/snapshots/sksg/breathe-0.png +0 -0
  286. package/src/__tests__/snapshots/sksg/breathe.png +0 -0
  287. package/src/__tests__/snapshots/sksg/simple.png +0 -0
  288. package/src/__tests__/snapshots/sksg/simple2.png +0 -0
  289. package/src/dom/nodes/JsiSkDOM.ts +2 -1
  290. package/src/dom/nodes/datatypes/Circle.ts +7 -5
  291. package/src/dom/nodes/datatypes/Enum.ts +2 -0
  292. package/src/dom/nodes/datatypes/Fitting.ts +2 -5
  293. package/src/dom/nodes/datatypes/Gradient.ts +4 -7
  294. package/src/dom/nodes/datatypes/Path.ts +5 -2
  295. package/src/dom/nodes/datatypes/Radius.ts +2 -0
  296. package/src/dom/nodes/datatypes/Rect.ts +40 -6
  297. package/src/dom/nodes/datatypes/Transform.ts +29 -1
  298. package/src/dom/nodes/drawings/Box.ts +1 -29
  299. package/src/dom/nodes/drawings/CircleNode.ts +1 -1
  300. package/src/dom/types/DeclarationContext.ts +12 -2
  301. package/src/external/reanimated/renderHelpers.ts +8 -4
  302. package/src/renderer/HostConfig.ts +10 -4
  303. package/src/renderer/__tests__/documentation/shapes/Box.spec.tsx +2 -2
  304. package/src/renderer/__tests__/setup.tsx +17 -15
  305. package/src/renderer/processors/Animations/Animations.ts +1 -5
  306. package/src/renderer/typeddash.ts +4 -2
  307. package/src/skia/__tests__/setup.ts +1 -51
  308. package/src/skia/types/Path/Path.ts +4 -2
  309. package/src/skia/types/Shader/Shader.ts +7 -4
  310. package/src/sksg/Container.ts +102 -0
  311. package/src/sksg/DrawingContext.ts +221 -0
  312. package/src/sksg/HostConfig.ts +287 -0
  313. package/src/sksg/Reconciler.ts +59 -0
  314. package/src/sksg/__tests__/Declarations.spec.tsx +235 -0
  315. package/src/sksg/__tests__/MockDeclaration.ts +140 -0
  316. package/src/sksg/__tests__/Simple.spec.tsx +148 -0
  317. package/src/sksg/nodes/Node.ts +8 -0
  318. package/src/sksg/nodes/colorFilters.ts +60 -0
  319. package/src/sksg/nodes/context.ts +489 -0
  320. package/src/sksg/nodes/drawings.ts +393 -0
  321. package/src/sksg/nodes/imageFilters.ts +183 -0
  322. package/src/sksg/nodes/index.ts +3 -0
  323. package/src/sksg/nodes/paint.ts +75 -0
  324. package/src/sksg/nodes/pathEffects.ts +95 -0
  325. package/src/sksg/nodes/shaders.ts +203 -0
  326. package/src/sksg/nodes/utils.ts +23 -0
  327. package/src/views/SkiaPictureView.tsx +0 -2
  328. package/src/views/types.ts +2 -2
  329. package/lib/commonjs/dom/__tests__/Shaders.spec.d.ts +0 -1
  330. package/lib/commonjs/renderer/__tests__/SkiaDOM.spec.d.ts +0 -1
  331. package/lib/module/dom/__tests__/Compose.spec.d.ts +0 -1
  332. package/lib/module/dom/__tests__/Demos.spec.d.ts +0 -1
  333. package/lib/module/dom/__tests__/DrawingContext.spec.d.ts +0 -1
  334. package/lib/module/dom/__tests__/Drawings.spec.d.ts +0 -1
  335. package/lib/module/dom/__tests__/Group.spec.d.ts +0 -1
  336. package/lib/module/dom/__tests__/Paint.spec.d.ts +0 -1
  337. package/lib/module/dom/__tests__/RenderNodes.spec.d.ts +0 -1
  338. package/lib/module/dom/__tests__/Shaders.spec.d.ts +0 -1
  339. package/lib/module/renderer/__tests__/SkiaDOM.spec.d.ts +0 -1
  340. package/lib/typescript/src/dom/__tests__/Compose.spec.d.ts +0 -1
  341. package/lib/typescript/src/dom/__tests__/Demos.spec.d.ts +0 -1
  342. package/lib/typescript/src/dom/__tests__/DrawingContext.spec.d.ts +0 -1
  343. package/lib/typescript/src/dom/__tests__/Drawings.spec.d.ts +0 -1
  344. package/lib/typescript/src/dom/__tests__/Group.spec.d.ts +0 -1
  345. package/lib/typescript/src/dom/__tests__/Paint.spec.d.ts +0 -1
  346. package/lib/typescript/src/dom/__tests__/RenderNodes.spec.d.ts +0 -1
  347. package/lib/typescript/src/dom/__tests__/Shaders.spec.d.ts +0 -1
  348. package/lib/typescript/src/renderer/__tests__/SkiaDOM.spec.d.ts +0 -1
  349. package/src/dom/__tests__/Compose.spec.tsx +0 -42
  350. package/src/dom/__tests__/Demos.spec.tsx +0 -145
  351. package/src/dom/__tests__/DrawingContext.spec.tsx +0 -99
  352. package/src/dom/__tests__/Drawings.spec.tsx +0 -95
  353. package/src/dom/__tests__/Group.spec.tsx +0 -132
  354. package/src/dom/__tests__/Paint.spec.tsx +0 -100
  355. package/src/dom/__tests__/RenderNodes.spec.tsx +0 -44
  356. package/src/dom/__tests__/Shaders.spec.tsx +0 -123
  357. package/src/renderer/__tests__/SkiaDOM.spec.tsx +0 -46
  358. /package/lib/commonjs/{dom/__tests__/Compose.spec.d.ts → sksg/__tests__/Declarations.spec.d.ts} +0 -0
  359. /package/lib/commonjs/{dom/__tests__/Demos.spec.d.ts → sksg/__tests__/Simple.spec.d.ts} +0 -0
  360. /package/lib/{commonjs/dom/__tests__/DrawingContext.spec.d.ts → module/sksg/__tests__/Declarations.spec.d.ts} +0 -0
  361. /package/lib/{commonjs/dom/__tests__/Drawings.spec.d.ts → module/sksg/__tests__/Simple.spec.d.ts} +0 -0
  362. /package/lib/{commonjs/dom/__tests__/Group.spec.d.ts → typescript/lib/module/sksg/nodes/Node.d.ts} +0 -0
  363. /package/lib/{commonjs/dom/__tests__/Paint.spec.d.ts → typescript/src/sksg/__tests__/Declarations.spec.d.ts} +0 -0
  364. /package/lib/{commonjs/dom/__tests__/RenderNodes.spec.d.ts → typescript/src/sksg/__tests__/Simple.spec.d.ts} +0 -0
@@ -37,6 +37,21 @@
37
37
  <key>SupportedPlatformVariant</key>
38
38
  <string>simulator</string>
39
39
  </dict>
40
+ <dict>
41
+ <key>BinaryPath</key>
42
+ <string>libskia.a</string>
43
+ <key>LibraryIdentifier</key>
44
+ <string>macos-arm64_x86_64</string>
45
+ <key>LibraryPath</key>
46
+ <string>libskia.a</string>
47
+ <key>SupportedArchitectures</key>
48
+ <array>
49
+ <string>arm64</string>
50
+ <string>x86_64</string>
51
+ </array>
52
+ <key>SupportedPlatform</key>
53
+ <string>macos</string>
54
+ </dict>
40
55
  </array>
41
56
  <key>CFBundlePackageType</key>
42
57
  <string>XFWK</string>
@@ -8,34 +8,49 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libskottie.a</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_arm64e</string>
11
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libskottie.a</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
17
  <string>arm64e</string>
18
+ <string>x86_64</string>
18
19
  </array>
19
20
  <key>SupportedPlatform</key>
20
21
  <string>ios</string>
22
+ <key>SupportedPlatformVariant</key>
23
+ <string>simulator</string>
21
24
  </dict>
22
25
  <dict>
23
26
  <key>BinaryPath</key>
24
27
  <string>libskottie.a</string>
25
28
  <key>LibraryIdentifier</key>
26
- <string>ios-arm64_arm64e_x86_64-simulator</string>
29
+ <string>ios-arm64_arm64e</string>
27
30
  <key>LibraryPath</key>
28
31
  <string>libskottie.a</string>
29
32
  <key>SupportedArchitectures</key>
30
33
  <array>
31
34
  <string>arm64</string>
32
35
  <string>arm64e</string>
33
- <string>x86_64</string>
34
36
  </array>
35
37
  <key>SupportedPlatform</key>
36
38
  <string>ios</string>
37
- <key>SupportedPlatformVariant</key>
38
- <string>simulator</string>
39
+ </dict>
40
+ <dict>
41
+ <key>BinaryPath</key>
42
+ <string>libskottie.a</string>
43
+ <key>LibraryIdentifier</key>
44
+ <string>macos-arm64_x86_64</string>
45
+ <key>LibraryPath</key>
46
+ <string>libskottie.a</string>
47
+ <key>SupportedArchitectures</key>
48
+ <array>
49
+ <string>arm64</string>
50
+ <string>x86_64</string>
51
+ </array>
52
+ <key>SupportedPlatform</key>
53
+ <string>macos</string>
39
54
  </dict>
40
55
  </array>
41
56
  <key>CFBundlePackageType</key>
@@ -8,34 +8,49 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libskparagraph.a</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_arm64e</string>
11
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libskparagraph.a</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
17
  <string>arm64e</string>
18
+ <string>x86_64</string>
18
19
  </array>
19
20
  <key>SupportedPlatform</key>
20
21
  <string>ios</string>
22
+ <key>SupportedPlatformVariant</key>
23
+ <string>simulator</string>
21
24
  </dict>
22
25
  <dict>
23
26
  <key>BinaryPath</key>
24
27
  <string>libskparagraph.a</string>
25
28
  <key>LibraryIdentifier</key>
26
- <string>ios-arm64_arm64e_x86_64-simulator</string>
29
+ <string>ios-arm64_arm64e</string>
27
30
  <key>LibraryPath</key>
28
31
  <string>libskparagraph.a</string>
29
32
  <key>SupportedArchitectures</key>
30
33
  <array>
31
34
  <string>arm64</string>
32
35
  <string>arm64e</string>
33
- <string>x86_64</string>
34
36
  </array>
35
37
  <key>SupportedPlatform</key>
36
38
  <string>ios</string>
37
- <key>SupportedPlatformVariant</key>
38
- <string>simulator</string>
39
+ </dict>
40
+ <dict>
41
+ <key>BinaryPath</key>
42
+ <string>libskparagraph.a</string>
43
+ <key>LibraryIdentifier</key>
44
+ <string>macos-arm64_x86_64</string>
45
+ <key>LibraryPath</key>
46
+ <string>libskparagraph.a</string>
47
+ <key>SupportedArchitectures</key>
48
+ <array>
49
+ <string>arm64</string>
50
+ <string>x86_64</string>
51
+ </array>
52
+ <key>SupportedPlatform</key>
53
+ <string>macos</string>
39
54
  </dict>
40
55
  </array>
41
56
  <key>CFBundlePackageType</key>
@@ -4,6 +4,21 @@
4
4
  <dict>
5
5
  <key>AvailableLibraries</key>
6
6
  <array>
7
+ <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libsksg.a</string>
10
+ <key>LibraryIdentifier</key>
11
+ <string>macos-arm64_x86_64</string>
12
+ <key>LibraryPath</key>
13
+ <string>libsksg.a</string>
14
+ <key>SupportedArchitectures</key>
15
+ <array>
16
+ <string>arm64</string>
17
+ <string>x86_64</string>
18
+ </array>
19
+ <key>SupportedPlatform</key>
20
+ <string>macos</string>
21
+ </dict>
7
22
  <dict>
8
23
  <key>BinaryPath</key>
9
24
  <string>libsksg.a</string>
@@ -8,19 +8,16 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libskshaper.a</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_arm64e_x86_64-simulator</string>
11
+ <string>macos-arm64_x86_64</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libskshaper.a</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
- <string>arm64e</string>
18
17
  <string>x86_64</string>
19
18
  </array>
20
19
  <key>SupportedPlatform</key>
21
- <string>ios</string>
22
- <key>SupportedPlatformVariant</key>
23
- <string>simulator</string>
20
+ <string>macos</string>
24
21
  </dict>
25
22
  <dict>
26
23
  <key>BinaryPath</key>
@@ -37,6 +34,24 @@
37
34
  <key>SupportedPlatform</key>
38
35
  <string>ios</string>
39
36
  </dict>
37
+ <dict>
38
+ <key>BinaryPath</key>
39
+ <string>libskshaper.a</string>
40
+ <key>LibraryIdentifier</key>
41
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
42
+ <key>LibraryPath</key>
43
+ <string>libskshaper.a</string>
44
+ <key>SupportedArchitectures</key>
45
+ <array>
46
+ <string>arm64</string>
47
+ <string>arm64e</string>
48
+ <string>x86_64</string>
49
+ </array>
50
+ <key>SupportedPlatform</key>
51
+ <string>ios</string>
52
+ <key>SupportedPlatformVariant</key>
53
+ <string>simulator</string>
54
+ </dict>
40
55
  </array>
41
56
  <key>CFBundlePackageType</key>
42
57
  <string>XFWK</string>
@@ -4,6 +4,21 @@
4
4
  <dict>
5
5
  <key>AvailableLibraries</key>
6
6
  <array>
7
+ <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libskunicode_core.a</string>
10
+ <key>LibraryIdentifier</key>
11
+ <string>ios-arm64_arm64e</string>
12
+ <key>LibraryPath</key>
13
+ <string>libskunicode_core.a</string>
14
+ <key>SupportedArchitectures</key>
15
+ <array>
16
+ <string>arm64</string>
17
+ <string>arm64e</string>
18
+ </array>
19
+ <key>SupportedPlatform</key>
20
+ <string>ios</string>
21
+ </dict>
7
22
  <dict>
8
23
  <key>BinaryPath</key>
9
24
  <string>libskunicode_core.a</string>
@@ -26,16 +41,16 @@
26
41
  <key>BinaryPath</key>
27
42
  <string>libskunicode_core.a</string>
28
43
  <key>LibraryIdentifier</key>
29
- <string>ios-arm64_arm64e</string>
44
+ <string>macos-arm64_x86_64</string>
30
45
  <key>LibraryPath</key>
31
46
  <string>libskunicode_core.a</string>
32
47
  <key>SupportedArchitectures</key>
33
48
  <array>
34
49
  <string>arm64</string>
35
- <string>arm64e</string>
50
+ <string>x86_64</string>
36
51
  </array>
37
52
  <key>SupportedPlatform</key>
38
- <string>ios</string>
53
+ <string>macos</string>
39
54
  </dict>
40
55
  </array>
41
56
  <key>CFBundlePackageType</key>
@@ -22,6 +22,21 @@
22
22
  <key>SupportedPlatformVariant</key>
23
23
  <string>simulator</string>
24
24
  </dict>
25
+ <dict>
26
+ <key>BinaryPath</key>
27
+ <string>libskunicode_libgrapheme.a</string>
28
+ <key>LibraryIdentifier</key>
29
+ <string>macos-arm64_x86_64</string>
30
+ <key>LibraryPath</key>
31
+ <string>libskunicode_libgrapheme.a</string>
32
+ <key>SupportedArchitectures</key>
33
+ <array>
34
+ <string>arm64</string>
35
+ <string>x86_64</string>
36
+ </array>
37
+ <key>SupportedPlatform</key>
38
+ <string>macos</string>
39
+ </dict>
25
40
  <dict>
26
41
  <key>BinaryPath</key>
27
42
  <string>libskunicode_libgrapheme.a</string>
@@ -22,6 +22,21 @@
22
22
  <key>SupportedPlatformVariant</key>
23
23
  <string>simulator</string>
24
24
  </dict>
25
+ <dict>
26
+ <key>BinaryPath</key>
27
+ <string>libsvg.a</string>
28
+ <key>LibraryIdentifier</key>
29
+ <string>macos-arm64_x86_64</string>
30
+ <key>LibraryPath</key>
31
+ <string>libsvg.a</string>
32
+ <key>SupportedArchitectures</key>
33
+ <array>
34
+ <string>arm64</string>
35
+ <string>x86_64</string>
36
+ </array>
37
+ <key>SupportedPlatform</key>
38
+ <string>macos</string>
39
+ </dict>
25
40
  <dict>
26
41
  <key>BinaryPath</key>
27
42
  <string>libsvg.a</string>
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.7.6",
10
+ "version": "1.7.7",
11
11
  "description": "High-performance React Native Graphics using Skia",
12
12
  "main": "lib/module/index.js",
13
13
  "react-native": "src/index.ts",
@@ -29,7 +29,7 @@
29
29
  "jestEnv.mjs",
30
30
  "cpp/**/*.{h,cpp}",
31
31
  "ios/**",
32
- "libs/ios/*.xcframework/**",
32
+ "libs/apple/*.xcframework/**",
33
33
  "react-native-skia.podspec",
34
34
  "scripts/setup-canvaskit.js",
35
35
  "dist/**"
@@ -95,7 +95,7 @@
95
95
  "@types/pixelmatch": "5.2.4",
96
96
  "@types/pngjs": "6.0.1",
97
97
  "@types/react": "^18.2.6",
98
- "@types/react-reconciler": "0.26.7",
98
+ "@types/react-reconciler": "0.28.9",
99
99
  "@types/ws": "8.5.3",
100
100
  "eslint": "8",
101
101
  "eslint-config-react-native-wcandillon": "^3.10.2",
@@ -13,18 +13,18 @@ preprocessor_defs = use_graphite ?
13
13
  '$(inherited) SK_METAL=1 SK_GANESH=1 SK_IMAGE_READ_PIXELS_DISABLE_LEGACY_API=1'
14
14
 
15
15
  # Define base frameworks
16
- base_frameworks = ['libs/ios/libskia.xcframework',
17
- 'libs/ios/libsvg.xcframework',
18
- 'libs/ios/libskshaper.xcframework',
19
- 'libs/ios/libskparagraph.xcframework',
20
- 'libs/ios/libskunicode_core.xcframework',
21
- 'libs/ios/libskunicode_libgrapheme.xcframework',]
16
+ base_frameworks = ['libs/apple/libskia.xcframework',
17
+ 'libs/apple/libsvg.xcframework',
18
+ 'libs/apple/libskshaper.xcframework',
19
+ 'libs/apple/libskparagraph.xcframework',
20
+ 'libs/apple/libskunicode_core.xcframework',
21
+ 'libs/apple/libskunicode_libgrapheme.xcframework',]
22
22
 
23
23
  # Add Graphite frameworks if enabled
24
24
  graphite_frameworks = [
25
- 'libs/ios/libdawn_native_static.xcframework',
26
- 'libs/ios/libdawn_platform_static.xcframework',
27
- 'libs/ios/libdawn_proc_static.xcframework'
25
+ 'libs/apple/libdawn_native_static.xcframework',
26
+ 'libs/apple/libdawn_platform_static.xcframework',
27
+ 'libs/apple/libdawn_proc_static.xcframework'
28
28
  ]
29
29
 
30
30
  Pod::Spec.new do |s|
@@ -82,7 +82,7 @@ export const checkImage = (
82
82
  if (diffPixelsCount > maxPixelDiff && !shouldFail) {
83
83
  console.log(`${p} didn't match`);
84
84
  fs.writeFileSync(`${p}.test.png`, PNG.sync.write(toTest));
85
- fs.writeFileSync(`${p}-diff-test.png`, PNG.sync.write(diffImage));
85
+ //fs.writeFileSync(`${p}-diff-test.png`, PNG.sync.write(diffImage));
86
86
  }
87
87
  if (shouldFail) {
88
88
  expect(diffPixelsCount).not.toBeLessThanOrEqual(maxPixelDiff);
@@ -331,7 +331,8 @@ export class JsiSkDOM implements SkDOM {
331
331
  }
332
332
 
333
333
  LinearToSRGBGammaColorFilter() {
334
- return this.native? global.SkiaDomApi.LinearToSRGBGammaColorFilterNode()
334
+ return this.native
335
+ ? global.SkiaDomApi.LinearToSRGBGammaColorFilterNode()
335
336
  : new LinearToSRGBGammaColorFilterNode(this.ctx);
336
337
  }
337
338
 
@@ -1,14 +1,16 @@
1
- import type { Skia } from "../../../skia/types";
1
+ "worklet";
2
+
2
3
  import type { CircleDef, ScalarCircleDef } from "../../types";
3
4
 
4
- export const isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef =>
5
+ export const isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef => {
5
6
  // We have an issue to check property existence on JSI backed instances
6
7
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
- (def as any).cx !== undefined;
8
+ return (def as any).cx !== undefined;
9
+ };
8
10
 
9
- export const processCircle = (Skia: Skia, def: CircleDef) => {
11
+ export const processCircle = (def: CircleDef) => {
10
12
  if (isCircleScalarDef(def)) {
11
- return { c: Skia.Point(def.cx, def.cy), r: def.r };
13
+ return { c: { x: def.cx, y: def.cy }, r: def.r };
12
14
  }
13
15
  return { ...def, c: def.c ?? { x: 0, y: 0 } };
14
16
  };
@@ -1,2 +1,4 @@
1
+ "worklet";
2
+
1
3
  export const enumKey = <K extends string>(k: K) =>
2
4
  (k.charAt(0).toUpperCase() + k.slice(1)) as Capitalize<K>;
@@ -1,3 +1,5 @@
1
+ "worklet";
2
+
1
3
  import { exhaustiveCheck } from "../../../renderer/typeddash";
2
4
  import type { SkRect } from "../../../skia/types";
3
5
  import type { Fit } from "../../types";
@@ -8,7 +10,6 @@ export interface Size {
8
10
  }
9
11
 
10
12
  export const size = (width = 0, height = 0) => {
11
- "worklet";
12
13
  return { width, height };
13
14
  };
14
15
 
@@ -21,7 +22,6 @@ export const rect2rect = (
21
22
  { scaleX: number },
22
23
  { scaleY: number }
23
24
  ] => {
24
- "worklet";
25
25
  const scaleX = dst.width / src.width;
26
26
  const scaleY = dst.height / src.height;
27
27
  const translateX = dst.x - src.x * scaleX;
@@ -33,7 +33,6 @@ const inscribe = (
33
33
  { width, height }: Size,
34
34
  rect: { x: number; y: number; width: number; height: number }
35
35
  ) => {
36
- "worklet";
37
36
  const halfWidthDelta = (rect.width - width) / 2.0;
38
37
  const halfHeightDelta = (rect.height - height) / 2.0;
39
38
  return {
@@ -45,7 +44,6 @@ const inscribe = (
45
44
  };
46
45
 
47
46
  const applyBoxFit = (fit: Fit, input: Size, output: Size) => {
48
- "worklet";
49
47
  let src = size(),
50
48
  dst = size();
51
49
  if (
@@ -114,7 +112,6 @@ export const fitRects = (
114
112
  rect: SkRect,
115
113
  { x, y, width, height }: SkRect
116
114
  ) => {
117
- "worklet";
118
115
  const sizes = applyBoxFit(
119
116
  fit,
120
117
  { width: rect.width, height: rect.height },
@@ -1,3 +1,5 @@
1
+ "worklet";
2
+
1
3
  import type { Skia, SkRect, Transforms3d, Vector } from "../../../skia/types";
2
4
  import { TileMode } from "../../../skia/types";
3
5
  import type { GradientProps, ImageShaderProps } from "../../types";
@@ -35,13 +37,8 @@ export const getRect = (
35
37
  const { x, y, width, height } = props;
36
38
  if (props.rect) {
37
39
  return props.rect;
38
- } else if (
39
- x !== undefined &&
40
- y !== undefined &&
41
- width !== undefined &&
42
- height !== undefined
43
- ) {
44
- return Skia.XYWHRect(x, y, width, height);
40
+ } else if (width !== undefined && height !== undefined) {
41
+ return Skia.XYWHRect(x ?? 0, y ?? 0, width, height);
45
42
  } else {
46
43
  return undefined;
47
44
  }
@@ -1,3 +1,5 @@
1
+ "worklet";
2
+
1
3
  import type { Skia } from "../../../skia/types";
2
4
  import { isPath } from "../../../skia/types";
3
5
  import type { PathDef } from "../../types";
@@ -14,5 +16,6 @@ export const processPath = (Skia: Skia, rawPath: PathDef) => {
14
16
  };
15
17
 
16
18
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
- export const isPathDef = (def: any): def is PathDef =>
18
- typeof def === "string" || isPath(def);
19
+ export const isPathDef = (def: any): def is PathDef => {
20
+ return typeof def === "string" || isPath(def);
21
+ };
@@ -1,3 +1,5 @@
1
+ "worklet";
2
+
1
3
  import type { Skia, Vector } from "../../../skia/types";
2
4
  import type { Radius } from "../../types";
3
5
 
@@ -1,22 +1,25 @@
1
+ "worklet";
2
+
1
3
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import type { Skia, SkRect, Vector } from "../../../skia/types";
4
+ import type { Skia, SkRect, SkRRect, Vector } from "../../../skia/types";
3
5
  import type { RectCtor, RectDef, RRectCtor, RRectDef } from "../../types";
4
6
 
5
7
  import { processRadius } from "./Radius";
6
8
 
7
9
  export const isEdge = (pos: Vector, b: SkRect) => {
8
- "worklet";
9
10
  return (
10
11
  pos.x === b.x || pos.y === b.y || pos.x === b.width || pos.y === b.height
11
12
  );
12
13
  };
13
14
 
14
15
  // We have an issue to check property existence on JSI backed instances
15
- const isRRectCtor = (def: RRectDef): def is RRectCtor =>
16
- (def as any).rect === undefined;
16
+ const isRRectCtor = (def: RRectDef): def is RRectCtor => {
17
+ return (def as any).rect === undefined;
18
+ };
17
19
  // We have an issue to check property existence on JSI backed instances
18
- const isRectCtor = (def: RectDef): def is RectCtor =>
19
- (def as any).rect === undefined;
20
+ const isRectCtor = (def: RectDef): def is RectCtor => {
21
+ return (def as any).rect === undefined;
22
+ };
20
23
 
21
24
  export const processRect = (Skia: Skia, def: RectDef) => {
22
25
  if (isRectCtor(def)) {
@@ -38,3 +41,34 @@ export const processRRect = (Skia: Skia, def: RRectDef) => {
38
41
  return def.rect;
39
42
  }
40
43
  };
44
+
45
+ export const inflate = (
46
+ Skia: Skia,
47
+ box: SkRRect,
48
+ dx: number,
49
+ dy: number,
50
+ tx = 0,
51
+ ty = 0
52
+ ) => {
53
+ return Skia.RRectXY(
54
+ Skia.XYWHRect(
55
+ box.rect.x - dx + tx,
56
+ box.rect.y - dy + ty,
57
+ box.rect.width + 2 * dx,
58
+ box.rect.height + 2 * dy
59
+ ),
60
+ box.rx + dx,
61
+ box.ry + dy
62
+ );
63
+ };
64
+
65
+ export const deflate = (
66
+ Skia: Skia,
67
+ box: SkRRect,
68
+ dx: number,
69
+ dy: number,
70
+ tx = 0,
71
+ ty = 0
72
+ ) => {
73
+ return inflate(Skia, box, -dx, -dy, tx, ty);
74
+ };