@shopify/react-native-skia 1.7.5 → 1.7.7

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.
Files changed (384) 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 +2 -2
  11. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  12. package/lib/commonjs/dom/nodes/datatypes/Circle.d.ts +2 -3
  13. package/lib/commonjs/dom/nodes/datatypes/Circle.js +11 -6
  14. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
  15. package/lib/commonjs/dom/nodes/datatypes/Enum.js +1 -0
  16. package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
  17. package/lib/commonjs/dom/nodes/datatypes/Fitting.js +1 -10
  18. package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
  19. package/lib/commonjs/dom/nodes/datatypes/Gradient.js +3 -2
  20. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
  21. package/lib/commonjs/dom/nodes/datatypes/Path.js +4 -1
  22. package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
  23. package/lib/commonjs/dom/nodes/datatypes/Radius.js +1 -0
  24. package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
  25. package/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +3 -1
  26. package/lib/commonjs/dom/nodes/datatypes/Rect.js +17 -7
  27. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  28. package/lib/commonjs/dom/nodes/datatypes/Transform.d.ts +2 -1
  29. package/lib/commonjs/dom/nodes/datatypes/Transform.js +32 -1
  30. package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
  31. package/lib/commonjs/dom/nodes/drawings/Box.js +4 -5
  32. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  33. package/lib/commonjs/dom/nodes/drawings/CircleNode.js +1 -1
  34. package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -1
  35. package/lib/commonjs/dom/types/DeclarationContext.d.ts +4 -4
  36. package/lib/commonjs/dom/types/DeclarationContext.js +8 -2
  37. package/lib/commonjs/dom/types/DeclarationContext.js.map +1 -1
  38. package/lib/commonjs/external/reanimated/renderHelpers.d.ts +2 -0
  39. package/lib/commonjs/external/reanimated/renderHelpers.js +11 -6
  40. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  41. package/lib/commonjs/renderer/HostConfig.js +8 -4
  42. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  43. package/lib/commonjs/renderer/__tests__/setup.d.ts +2 -3
  44. package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +1 -2
  45. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  46. package/lib/commonjs/renderer/typeddash.js +5 -1
  47. package/lib/commonjs/renderer/typeddash.js.map +1 -1
  48. package/lib/commonjs/skia/__tests__/setup.d.ts +0 -3
  49. package/lib/commonjs/skia/types/Path/Path.js +5 -1
  50. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  51. package/lib/commonjs/skia/types/RRect.d.ts +1 -1
  52. package/lib/commonjs/skia/types/RRect.js +7 -3
  53. package/lib/commonjs/skia/types/RRect.js.map +1 -1
  54. package/lib/commonjs/skia/types/Shader/Shader.js +8 -6
  55. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  56. package/lib/commonjs/skia/web/JsiSkParagraphStyle.js +1 -1
  57. package/lib/commonjs/skia/web/JsiSkParagraphStyle.js.map +1 -1
  58. package/lib/commonjs/sksg/Container.d.ts +19 -0
  59. package/lib/commonjs/sksg/Container.js +102 -0
  60. package/lib/commonjs/sksg/Container.js.map +1 -0
  61. package/lib/commonjs/sksg/DrawingContext.d.ts +16 -0
  62. package/lib/commonjs/sksg/DrawingContext.js +186 -0
  63. package/lib/commonjs/sksg/DrawingContext.js.map +1 -0
  64. package/lib/commonjs/sksg/HostConfig.d.ts +19 -0
  65. package/lib/commonjs/sksg/HostConfig.js +168 -0
  66. package/lib/commonjs/sksg/HostConfig.js.map +1 -0
  67. package/lib/commonjs/sksg/Reconciler.d.ts +17 -0
  68. package/lib/commonjs/sksg/Reconciler.js +54 -0
  69. package/lib/commonjs/sksg/Reconciler.js.map +1 -0
  70. package/lib/commonjs/sksg/__tests__/MockDeclaration.d.ts +57 -0
  71. package/lib/commonjs/sksg/nodes/Node.d.ts +7 -0
  72. package/lib/commonjs/sksg/nodes/Node.js +6 -0
  73. package/lib/commonjs/sksg/nodes/Node.js.map +1 -0
  74. package/lib/commonjs/sksg/nodes/colorFilters.d.ts +7 -0
  75. package/lib/commonjs/sksg/nodes/colorFilters.js +55 -0
  76. package/lib/commonjs/sksg/nodes/colorFilters.js.map +1 -0
  77. package/lib/commonjs/sksg/nodes/context.d.ts +3 -0
  78. package/lib/commonjs/sksg/nodes/context.js +448 -0
  79. package/lib/commonjs/sksg/nodes/context.js.map +1 -0
  80. package/lib/commonjs/sksg/nodes/drawings.d.ts +31 -0
  81. package/lib/commonjs/sksg/nodes/drawings.js +361 -0
  82. package/lib/commonjs/sksg/nodes/drawings.js.map +1 -0
  83. package/lib/commonjs/sksg/nodes/imageFilters.d.ts +14 -0
  84. package/lib/commonjs/sksg/nodes/imageFilters.js +135 -0
  85. package/lib/commonjs/sksg/nodes/imageFilters.js.map +1 -0
  86. package/lib/commonjs/sksg/nodes/index.d.ts +3 -0
  87. package/lib/commonjs/sksg/nodes/index.js +39 -0
  88. package/lib/commonjs/sksg/nodes/index.js.map +1 -0
  89. package/lib/commonjs/sksg/nodes/paint.d.ts +2 -0
  90. package/lib/commonjs/sksg/nodes/paint.js +80 -0
  91. package/lib/commonjs/sksg/nodes/paint.js.map +1 -0
  92. package/lib/commonjs/sksg/nodes/pathEffects.d.ts +8 -0
  93. package/lib/commonjs/sksg/nodes/pathEffects.js +84 -0
  94. package/lib/commonjs/sksg/nodes/pathEffects.js.map +1 -0
  95. package/lib/commonjs/sksg/nodes/shaders.d.ts +10 -0
  96. package/lib/commonjs/sksg/nodes/shaders.js +156 -0
  97. package/lib/commonjs/sksg/nodes/shaders.js.map +1 -0
  98. package/lib/commonjs/sksg/nodes/utils.d.ts +3 -0
  99. package/lib/commonjs/sksg/nodes/utils.js +25 -0
  100. package/lib/commonjs/sksg/nodes/utils.js.map +1 -0
  101. package/lib/commonjs/views/SkiaDomView.js +3 -1
  102. package/lib/commonjs/views/SkiaDomView.js.map +1 -1
  103. package/lib/commonjs/views/SkiaPictureView.js +0 -2
  104. package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
  105. package/lib/commonjs/views/types.d.ts +2 -2
  106. package/lib/commonjs/views/types.js.map +1 -1
  107. package/lib/module/dom/nodes/JsiSkDOM.js +2 -2
  108. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  109. package/lib/module/dom/nodes/datatypes/Circle.d.ts +2 -3
  110. package/lib/module/dom/nodes/datatypes/Circle.js +12 -6
  111. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  112. package/lib/module/dom/nodes/datatypes/Enum.js +2 -0
  113. package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
  114. package/lib/module/dom/nodes/datatypes/Fitting.js +2 -10
  115. package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
  116. package/lib/module/dom/nodes/datatypes/Gradient.js +4 -2
  117. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  118. package/lib/module/dom/nodes/datatypes/Path.js +5 -1
  119. package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
  120. package/lib/module/dom/nodes/datatypes/Radius.js +2 -0
  121. package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
  122. package/lib/module/dom/nodes/datatypes/Rect.d.ts +3 -1
  123. package/lib/module/dom/nodes/datatypes/Rect.js +14 -5
  124. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  125. package/lib/module/dom/nodes/datatypes/Transform.d.ts +2 -1
  126. package/lib/module/dom/nodes/datatypes/Transform.js +31 -0
  127. package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
  128. package/lib/module/dom/nodes/drawings/Box.js +1 -2
  129. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  130. package/lib/module/dom/nodes/drawings/CircleNode.js +1 -1
  131. package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -1
  132. package/lib/module/dom/types/DeclarationContext.d.ts +4 -4
  133. package/lib/module/dom/types/DeclarationContext.js +9 -2
  134. package/lib/module/dom/types/DeclarationContext.js.map +1 -1
  135. package/lib/module/external/reanimated/renderHelpers.d.ts +2 -0
  136. package/lib/module/external/reanimated/renderHelpers.js +8 -4
  137. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  138. package/lib/module/renderer/HostConfig.js +8 -4
  139. package/lib/module/renderer/HostConfig.js.map +1 -1
  140. package/lib/module/renderer/__tests__/setup.d.ts +2 -3
  141. package/lib/module/renderer/processors/Animations/Animations.d.ts +1 -2
  142. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  143. package/lib/module/renderer/typeddash.js +5 -1
  144. package/lib/module/renderer/typeddash.js.map +1 -1
  145. package/lib/module/skia/__tests__/setup.d.ts +0 -3
  146. package/lib/module/skia/types/Path/Path.js +5 -1
  147. package/lib/module/skia/types/Path/Path.js.map +1 -1
  148. package/lib/module/skia/types/RRect.d.ts +1 -1
  149. package/lib/module/skia/types/RRect.js +7 -3
  150. package/lib/module/skia/types/RRect.js.map +1 -1
  151. package/lib/module/skia/types/Shader/Shader.js +9 -6
  152. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  153. package/lib/module/skia/web/JsiSkParagraphStyle.js +1 -1
  154. package/lib/module/skia/web/JsiSkParagraphStyle.js.map +1 -1
  155. package/lib/module/sksg/Container.d.ts +19 -0
  156. package/lib/module/sksg/Container.js +94 -0
  157. package/lib/module/sksg/Container.js.map +1 -0
  158. package/lib/module/sksg/DrawingContext.d.ts +16 -0
  159. package/lib/module/sksg/DrawingContext.js +180 -0
  160. package/lib/module/sksg/DrawingContext.js.map +1 -0
  161. package/lib/module/sksg/HostConfig.d.ts +19 -0
  162. package/lib/module/sksg/HostConfig.js +161 -0
  163. package/lib/module/sksg/HostConfig.js.map +1 -0
  164. package/lib/module/sksg/Reconciler.d.ts +17 -0
  165. package/lib/module/sksg/Reconciler.js +46 -0
  166. package/lib/module/sksg/Reconciler.js.map +1 -0
  167. package/lib/module/sksg/__tests__/MockDeclaration.d.ts +57 -0
  168. package/lib/module/sksg/nodes/Node.d.ts +7 -0
  169. package/lib/module/sksg/nodes/Node.js +2 -0
  170. package/lib/module/sksg/nodes/Node.js.map +1 -0
  171. package/lib/module/sksg/nodes/colorFilters.d.ts +7 -0
  172. package/lib/module/sksg/nodes/colorFilters.js +44 -0
  173. package/lib/module/sksg/nodes/colorFilters.js.map +1 -0
  174. package/lib/module/sksg/nodes/context.d.ts +3 -0
  175. package/lib/module/sksg/nodes/context.js +443 -0
  176. package/lib/module/sksg/nodes/context.js.map +1 -0
  177. package/lib/module/sksg/nodes/drawings.d.ts +31 -0
  178. package/lib/module/sksg/nodes/drawings.js +334 -0
  179. package/lib/module/sksg/nodes/drawings.js.map +1 -0
  180. package/lib/module/sksg/nodes/imageFilters.d.ts +14 -0
  181. package/lib/module/sksg/nodes/imageFilters.js +122 -0
  182. package/lib/module/sksg/nodes/imageFilters.js.map +1 -0
  183. package/lib/module/sksg/nodes/index.d.ts +3 -0
  184. package/lib/module/sksg/nodes/index.js +4 -0
  185. package/lib/module/sksg/nodes/index.js.map +1 -0
  186. package/lib/module/sksg/nodes/paint.d.ts +2 -0
  187. package/lib/module/sksg/nodes/paint.js +74 -0
  188. package/lib/module/sksg/nodes/paint.js.map +1 -0
  189. package/lib/module/sksg/nodes/pathEffects.d.ts +8 -0
  190. package/lib/module/sksg/nodes/pathEffects.js +72 -0
  191. package/lib/module/sksg/nodes/pathEffects.js.map +1 -0
  192. package/lib/module/sksg/nodes/shaders.d.ts +10 -0
  193. package/lib/module/sksg/nodes/shaders.js +142 -0
  194. package/lib/module/sksg/nodes/shaders.js.map +1 -0
  195. package/lib/module/sksg/nodes/utils.d.ts +3 -0
  196. package/lib/module/sksg/nodes/utils.js +18 -0
  197. package/lib/module/sksg/nodes/utils.js.map +1 -0
  198. package/lib/module/views/SkiaDomView.js +3 -1
  199. package/lib/module/views/SkiaDomView.js.map +1 -1
  200. package/lib/module/views/SkiaPictureView.js +0 -2
  201. package/lib/module/views/SkiaPictureView.js.map +1 -1
  202. package/lib/module/views/types.d.ts +2 -2
  203. package/lib/module/views/types.js.map +1 -1
  204. package/lib/typescript/lib/commonjs/dom/nodes/datatypes/Circle.d.ts +1 -1
  205. package/lib/typescript/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +2 -0
  206. package/lib/typescript/lib/commonjs/dom/nodes/datatypes/Transform.d.ts +1 -0
  207. package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +2 -0
  208. package/lib/typescript/lib/commonjs/renderer/HostConfig.d.ts +3 -1
  209. package/lib/typescript/lib/commonjs/sksg/Container.d.ts +16 -0
  210. package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +26 -0
  211. package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +50 -0
  212. package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +16 -0
  213. package/lib/typescript/lib/commonjs/sksg/nodes/Node.d.ts +1 -0
  214. package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +7 -0
  215. package/lib/typescript/lib/commonjs/sksg/nodes/context.d.ts +2 -0
  216. package/lib/typescript/lib/commonjs/sksg/nodes/drawings.d.ts +23 -0
  217. package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +10 -0
  218. package/lib/typescript/lib/commonjs/sksg/nodes/index.d.ts +1 -0
  219. package/lib/typescript/lib/commonjs/sksg/nodes/paint.d.ts +2 -0
  220. package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +8 -0
  221. package/lib/typescript/lib/commonjs/sksg/nodes/shaders.d.ts +10 -0
  222. package/lib/typescript/lib/commonjs/sksg/nodes/utils.d.ts +3 -0
  223. package/lib/typescript/lib/module/dom/nodes/datatypes/Circle.d.ts +1 -1
  224. package/lib/typescript/lib/module/dom/nodes/datatypes/Rect.d.ts +2 -0
  225. package/lib/typescript/lib/module/dom/nodes/datatypes/Transform.d.ts +1 -0
  226. package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +2 -0
  227. package/lib/typescript/lib/module/mock/index.d.ts +4 -1
  228. package/lib/typescript/lib/module/renderer/HostConfig.d.ts +3 -1
  229. package/lib/typescript/lib/module/sksg/Container.d.ts +15 -0
  230. package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +26 -0
  231. package/lib/typescript/lib/module/sksg/HostConfig.d.ts +49 -0
  232. package/lib/typescript/lib/module/sksg/Reconciler.d.ts +15 -0
  233. package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +6 -0
  234. package/lib/typescript/lib/module/sksg/nodes/context.d.ts +1 -0
  235. package/lib/typescript/lib/module/sksg/nodes/drawings.d.ts +22 -0
  236. package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +9 -0
  237. package/lib/typescript/lib/module/sksg/nodes/index.d.ts +3 -0
  238. package/lib/typescript/lib/module/sksg/nodes/paint.d.ts +1 -0
  239. package/lib/typescript/lib/module/sksg/nodes/pathEffects.d.ts +7 -0
  240. package/lib/typescript/lib/module/sksg/nodes/shaders.d.ts +9 -0
  241. package/lib/typescript/lib/module/sksg/nodes/utils.d.ts +2 -0
  242. package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +2 -3
  243. package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +3 -1
  244. package/lib/typescript/src/dom/nodes/datatypes/Transform.d.ts +2 -1
  245. package/lib/typescript/src/dom/types/DeclarationContext.d.ts +4 -4
  246. package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +2 -0
  247. package/lib/typescript/src/renderer/__tests__/setup.d.ts +2 -3
  248. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -2
  249. package/lib/typescript/src/skia/__tests__/setup.d.ts +0 -3
  250. package/lib/typescript/src/skia/types/RRect.d.ts +1 -1
  251. package/lib/typescript/src/sksg/Container.d.ts +19 -0
  252. package/lib/typescript/src/sksg/DrawingContext.d.ts +16 -0
  253. package/lib/typescript/src/sksg/HostConfig.d.ts +19 -0
  254. package/lib/typescript/src/sksg/Reconciler.d.ts +17 -0
  255. package/lib/typescript/src/sksg/__tests__/MockDeclaration.d.ts +57 -0
  256. package/lib/typescript/src/sksg/nodes/Node.d.ts +7 -0
  257. package/lib/typescript/src/sksg/nodes/colorFilters.d.ts +7 -0
  258. package/lib/typescript/src/sksg/nodes/context.d.ts +3 -0
  259. package/lib/typescript/src/sksg/nodes/drawings.d.ts +31 -0
  260. package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +14 -0
  261. package/lib/typescript/src/sksg/nodes/index.d.ts +3 -0
  262. package/lib/typescript/src/sksg/nodes/paint.d.ts +2 -0
  263. package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +8 -0
  264. package/lib/typescript/src/sksg/nodes/shaders.d.ts +10 -0
  265. package/lib/typescript/src/sksg/nodes/utils.d.ts +3 -0
  266. package/lib/typescript/src/views/types.d.ts +2 -2
  267. package/libs/{ios → apple}/libskia.xcframework/Info.plist +15 -0
  268. package/libs/{ios → apple}/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  269. package/libs/{ios → apple}/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  270. package/libs/apple/libskia.xcframework/macos-arm64_x86_64/libskia.a +0 -0
  271. package/libs/{ios → apple}/libskottie.xcframework/Info.plist +20 -5
  272. package/libs/{ios → apple}/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  273. package/libs/{ios → apple}/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  274. package/libs/apple/libskottie.xcframework/macos-arm64_x86_64/libskottie.a +0 -0
  275. package/libs/{ios → apple}/libskparagraph.xcframework/Info.plist +20 -5
  276. package/libs/{ios → apple}/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  277. package/libs/{ios → apple}/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  278. package/libs/apple/libskparagraph.xcframework/macos-arm64_x86_64/libskparagraph.a +0 -0
  279. package/libs/{ios → apple}/libsksg.xcframework/Info.plist +15 -0
  280. package/libs/{ios → apple}/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  281. package/libs/{ios → apple}/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  282. package/libs/apple/libsksg.xcframework/macos-arm64_x86_64/libsksg.a +0 -0
  283. package/libs/{ios → apple}/libskshaper.xcframework/Info.plist +20 -5
  284. package/libs/{ios → apple}/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  285. package/libs/{ios → apple}/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  286. package/libs/apple/libskshaper.xcframework/macos-arm64_x86_64/libskshaper.a +0 -0
  287. package/libs/{ios → apple}/libskunicode_core.xcframework/Info.plist +18 -3
  288. package/libs/{ios → apple}/libskunicode_core.xcframework/ios-arm64_arm64e/libskunicode_core.a +0 -0
  289. package/libs/{ios → apple}/libskunicode_core.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
  290. package/libs/apple/libskunicode_core.xcframework/macos-arm64_x86_64/libskunicode_core.a +0 -0
  291. package/libs/{ios → apple}/libskunicode_libgrapheme.xcframework/Info.plist +15 -0
  292. package/libs/{ios → apple}/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
  293. package/libs/{ios → apple}/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
  294. package/libs/apple/libskunicode_libgrapheme.xcframework/macos-arm64_x86_64/libskunicode_libgrapheme.a +0 -0
  295. package/libs/{ios → apple}/libsvg.xcframework/Info.plist +15 -0
  296. package/libs/{ios → apple}/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  297. package/libs/{ios → apple}/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  298. package/libs/apple/libsvg.xcframework/macos-arm64_x86_64/libsvg.a +0 -0
  299. package/package.json +3 -3
  300. package/react-native-skia.podspec +9 -9
  301. package/src/__tests__/setup.ts +1 -1
  302. package/src/__tests__/snapshots/sksg/breathe-0.png +0 -0
  303. package/src/__tests__/snapshots/sksg/breathe.png +0 -0
  304. package/src/__tests__/snapshots/sksg/simple.png +0 -0
  305. package/src/__tests__/snapshots/sksg/simple2.png +0 -0
  306. package/src/dom/nodes/JsiSkDOM.ts +2 -4
  307. package/src/dom/nodes/datatypes/Circle.ts +7 -5
  308. package/src/dom/nodes/datatypes/Enum.ts +2 -0
  309. package/src/dom/nodes/datatypes/Fitting.ts +2 -5
  310. package/src/dom/nodes/datatypes/Gradient.ts +4 -7
  311. package/src/dom/nodes/datatypes/Path.ts +5 -2
  312. package/src/dom/nodes/datatypes/Radius.ts +2 -0
  313. package/src/dom/nodes/datatypes/Rect.ts +40 -6
  314. package/src/dom/nodes/datatypes/Transform.ts +29 -1
  315. package/src/dom/nodes/drawings/Box.ts +1 -29
  316. package/src/dom/nodes/drawings/CircleNode.ts +1 -1
  317. package/src/dom/types/DeclarationContext.ts +12 -2
  318. package/src/external/reanimated/renderHelpers.ts +8 -4
  319. package/src/renderer/HostConfig.ts +10 -4
  320. package/src/renderer/__tests__/documentation/shapes/Box.spec.tsx +2 -2
  321. package/src/renderer/__tests__/setup.tsx +17 -15
  322. package/src/renderer/processors/Animations/Animations.ts +1 -5
  323. package/src/renderer/typeddash.ts +4 -2
  324. package/src/skia/__tests__/setup.ts +1 -51
  325. package/src/skia/types/Path/Path.ts +4 -2
  326. package/src/skia/types/RRect.ts +9 -3
  327. package/src/skia/types/Shader/Shader.ts +7 -4
  328. package/src/skia/web/JsiSkParagraphStyle.ts +1 -3
  329. package/src/sksg/Container.ts +102 -0
  330. package/src/sksg/DrawingContext.ts +221 -0
  331. package/src/sksg/HostConfig.ts +287 -0
  332. package/src/sksg/Reconciler.ts +59 -0
  333. package/src/sksg/__tests__/Declarations.spec.tsx +235 -0
  334. package/src/sksg/__tests__/MockDeclaration.ts +140 -0
  335. package/src/sksg/__tests__/Simple.spec.tsx +148 -0
  336. package/src/sksg/nodes/Node.ts +8 -0
  337. package/src/sksg/nodes/colorFilters.ts +60 -0
  338. package/src/sksg/nodes/context.ts +489 -0
  339. package/src/sksg/nodes/drawings.ts +393 -0
  340. package/src/sksg/nodes/imageFilters.ts +183 -0
  341. package/src/sksg/nodes/index.ts +3 -0
  342. package/src/sksg/nodes/paint.ts +75 -0
  343. package/src/sksg/nodes/pathEffects.ts +95 -0
  344. package/src/sksg/nodes/shaders.ts +203 -0
  345. package/src/sksg/nodes/utils.ts +23 -0
  346. package/src/views/SkiaDomView.tsx +3 -1
  347. package/src/views/SkiaPictureView.tsx +0 -2
  348. package/src/views/types.ts +2 -2
  349. package/lib/commonjs/dom/__tests__/Shaders.spec.d.ts +0 -1
  350. package/lib/commonjs/renderer/__tests__/SkiaDOM.spec.d.ts +0 -1
  351. package/lib/module/dom/__tests__/Compose.spec.d.ts +0 -1
  352. package/lib/module/dom/__tests__/Demos.spec.d.ts +0 -1
  353. package/lib/module/dom/__tests__/DrawingContext.spec.d.ts +0 -1
  354. package/lib/module/dom/__tests__/Drawings.spec.d.ts +0 -1
  355. package/lib/module/dom/__tests__/Group.spec.d.ts +0 -1
  356. package/lib/module/dom/__tests__/Paint.spec.d.ts +0 -1
  357. package/lib/module/dom/__tests__/RenderNodes.spec.d.ts +0 -1
  358. package/lib/module/dom/__tests__/Shaders.spec.d.ts +0 -1
  359. package/lib/module/renderer/__tests__/SkiaDOM.spec.d.ts +0 -1
  360. package/lib/typescript/src/dom/__tests__/Compose.spec.d.ts +0 -1
  361. package/lib/typescript/src/dom/__tests__/Demos.spec.d.ts +0 -1
  362. package/lib/typescript/src/dom/__tests__/DrawingContext.spec.d.ts +0 -1
  363. package/lib/typescript/src/dom/__tests__/Drawings.spec.d.ts +0 -1
  364. package/lib/typescript/src/dom/__tests__/Group.spec.d.ts +0 -1
  365. package/lib/typescript/src/dom/__tests__/Paint.spec.d.ts +0 -1
  366. package/lib/typescript/src/dom/__tests__/RenderNodes.spec.d.ts +0 -1
  367. package/lib/typescript/src/dom/__tests__/Shaders.spec.d.ts +0 -1
  368. package/lib/typescript/src/renderer/__tests__/SkiaDOM.spec.d.ts +0 -1
  369. package/src/dom/__tests__/Compose.spec.tsx +0 -42
  370. package/src/dom/__tests__/Demos.spec.tsx +0 -145
  371. package/src/dom/__tests__/DrawingContext.spec.tsx +0 -99
  372. package/src/dom/__tests__/Drawings.spec.tsx +0 -95
  373. package/src/dom/__tests__/Group.spec.tsx +0 -132
  374. package/src/dom/__tests__/Paint.spec.tsx +0 -100
  375. package/src/dom/__tests__/RenderNodes.spec.tsx +0 -44
  376. package/src/dom/__tests__/Shaders.spec.tsx +0 -123
  377. package/src/renderer/__tests__/SkiaDOM.spec.tsx +0 -46
  378. /package/lib/commonjs/{dom/__tests__/Compose.spec.d.ts → sksg/__tests__/Declarations.spec.d.ts} +0 -0
  379. /package/lib/commonjs/{dom/__tests__/Demos.spec.d.ts → sksg/__tests__/Simple.spec.d.ts} +0 -0
  380. /package/lib/{commonjs/dom/__tests__/DrawingContext.spec.d.ts → module/sksg/__tests__/Declarations.spec.d.ts} +0 -0
  381. /package/lib/{commonjs/dom/__tests__/Drawings.spec.d.ts → module/sksg/__tests__/Simple.spec.d.ts} +0 -0
  382. /package/lib/{commonjs/dom/__tests__/Group.spec.d.ts → typescript/lib/module/sksg/nodes/Node.d.ts} +0 -0
  383. /package/lib/{commonjs/dom/__tests__/Paint.spec.d.ts → typescript/src/sksg/__tests__/Declarations.spec.d.ts} +0 -0
  384. /package/lib/{commonjs/dom/__tests__/RenderNodes.spec.d.ts → typescript/src/sksg/__tests__/Simple.spec.d.ts} +0 -0
@@ -0,0 +1,74 @@
1
+ "worklet";
2
+
3
+ import { enumKey } from "../../dom/nodes";
4
+ import { BlendMode, PaintStyle, StrokeCap, StrokeJoin } from "../../skia/types";
5
+ export const declarePaint = (ctx, props) => {
6
+ const {
7
+ color,
8
+ strokeWidth,
9
+ blendMode,
10
+ style,
11
+ strokeJoin,
12
+ strokeCap,
13
+ strokeMiter,
14
+ opacity,
15
+ antiAlias,
16
+ dither
17
+ } = props;
18
+ const paint = ctx.Skia.Paint();
19
+ if (color !== undefined) {
20
+ paint.setColor(ctx.Skia.Color(color));
21
+ }
22
+ if (strokeWidth !== undefined) {
23
+ paint.setStrokeWidth(strokeWidth);
24
+ }
25
+ if (blendMode !== undefined) {
26
+ paint.setBlendMode(BlendMode[enumKey(blendMode)]);
27
+ }
28
+ if (style !== undefined) {
29
+ paint.setStyle(PaintStyle[enumKey(style)]);
30
+ }
31
+ if (strokeJoin !== undefined) {
32
+ paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);
33
+ }
34
+ if (strokeCap !== undefined) {
35
+ paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);
36
+ }
37
+ if (strokeMiter !== undefined) {
38
+ paint.setStrokeMiter(strokeMiter);
39
+ }
40
+ if (opacity !== undefined) {
41
+ paint.setAlphaf(opacity);
42
+ }
43
+ if (antiAlias !== undefined) {
44
+ paint.setAntiAlias(antiAlias);
45
+ }
46
+ if (dither !== undefined) {
47
+ paint.setDither(dither);
48
+ }
49
+ //ctx.save();
50
+
51
+ const colorFilter = ctx.colorFilters.popAllAsOne();
52
+ const imageFilter = ctx.imageFilters.popAllAsOne();
53
+ const shader = ctx.shaders.pop();
54
+ const maskFilter = ctx.maskFilters.pop();
55
+ const pathEffect = ctx.pathEffects.popAllAsOne();
56
+ //ctx.restore();
57
+ if (imageFilter) {
58
+ paint.setImageFilter(imageFilter);
59
+ }
60
+ if (shader) {
61
+ paint.setShader(shader);
62
+ }
63
+ if (pathEffect) {
64
+ paint.setPathEffect(pathEffect);
65
+ }
66
+ if (colorFilter) {
67
+ paint.setColorFilter(colorFilter);
68
+ }
69
+ if (maskFilter) {
70
+ paint.setMaskFilter(maskFilter);
71
+ }
72
+ ctx.paints.push(paint);
73
+ };
74
+ //# sourceMappingURL=paint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["enumKey","BlendMode","PaintStyle","StrokeCap","StrokeJoin","declarePaint","ctx","props","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","opacity","antiAlias","dither","paint","Skia","Paint","undefined","setColor","Color","setStrokeWidth","setBlendMode","setStyle","setStrokeJoin","setStrokeCap","setStrokeMiter","setAlphaf","setAntiAlias","setDither","colorFilter","colorFilters","popAllAsOne","imageFilter","imageFilters","shader","shaders","pop","maskFilter","maskFilters","pathEffect","pathEffects","setImageFilter","setShader","setPathEffect","setColorFilter","setMaskFilter","paints","push"],"sources":["paint.ts"],"sourcesContent":["\"worklet\";\n\nimport { enumKey } from \"../../dom/nodes\";\nimport type { DeclarationContext, PaintProps } from \"../../dom/types\";\nimport { BlendMode, PaintStyle, StrokeCap, StrokeJoin } from \"../../skia/types\";\n\nexport const declarePaint = (ctx: DeclarationContext, props: PaintProps) => {\n const {\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n opacity,\n antiAlias,\n dither,\n } = props;\n const paint = ctx.Skia.Paint();\n if (color !== undefined) {\n paint.setColor(ctx.Skia.Color(color));\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (opacity !== undefined) {\n paint.setAlphaf(opacity);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n if (dither !== undefined) {\n paint.setDither(dither);\n }\n //ctx.save();\n\n const colorFilter = ctx.colorFilters.popAllAsOne();\n const imageFilter = ctx.imageFilters.popAllAsOne();\n const shader = ctx.shaders.pop();\n const maskFilter = ctx.maskFilters.pop();\n const pathEffect = ctx.pathEffects.popAllAsOne();\n //ctx.restore();\n if (imageFilter) {\n paint.setImageFilter(imageFilter);\n }\n if (shader) {\n paint.setShader(shader);\n }\n if (pathEffect) {\n paint.setPathEffect(pathEffect);\n }\n if (colorFilter) {\n paint.setColorFilter(colorFilter);\n }\n if (maskFilter) {\n paint.setMaskFilter(maskFilter);\n }\n ctx.paints.push(paint);\n};\n"],"mappings":"AAAA,SAAS;;AAET,SAASA,OAAO,QAAQ,iBAAiB;AAEzC,SAASC,SAAS,EAAEC,UAAU,EAAEC,SAAS,EAAEC,UAAU,QAAQ,kBAAkB;AAE/E,OAAO,MAAMC,YAAY,GAAGA,CAACC,GAAuB,E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EACA,IAAIC,MAAM,KAAKI,SAAS,EAAE;IACxBH,KAAK,CAACc,SAAS,CAACf,MAAM,CAAC;EACzB;EACA;;EAEA,MAAMgB,WAAW,GAAG3B,GAAG,CAAC4B,YAAY,CAACC,WAAW,CAAC,CAAC;EAClD,MAAMC,WAAW,GAAG9B,GAAG,CAAC+B,YAAY,CAACF,WAAW,CAAC,CAAC;EAClD,MAAMG,MAAM,GAAGhC,GAAG,CAACiC,OAAO,CAACC,GAAG,CAAC,CAAC;EAChC,MAAMC,UAAU,GAAGnC,GAAG,CAACoC,WAAW,CAACF,GAAG,CAAC,CAAC;EACxC,MAAMG,UAAU,GAAGrC,GAAG,CAACsC,WAAW,CAACT,WAAW,CAAC,CAAC;EAChD;EACA,IAAIC,WAAW,EAAE;IACflB,KAAK,CAAC2B,cAAc,CAACT,WAAW,CAAC;EACnC;EACA,IAAIE,MAAM,EAAE;IACVpB,KAAK,CAAC4B,SAAS,CAACR,MAAM,CAAC;EACzB;EACA,IAAIK,UAAU,EAAE;IACdzB,KAAK,CAAC6B,aAAa,CAACJ,UAAU,CAAC;EACjC;EACA,IAAIV,WAAW,EAAE;IACff,KAAK,CAAC8B,cAAc,CAACf,WAAW,CAAC;EACnC;EACA,IAAIQ,UAAU,EAAE;IACdvB,KAAK,CAAC+B,aAAa,CAACR,UAAU,CAAC;EACjC;EACAnC,GAAG,CAAC4C,MAAM,CAACC,IAAI,CAACjC,KAAK,CAAC;AACxB,CAAC","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import type { CornerPathEffectProps, DashPathEffectProps, DeclarationContext, DiscretePathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps } from "../../dom/types";
2
+ export declare const makeDiscretePathEffect: (ctx: DeclarationContext, props: DiscretePathEffectProps) => import("../../skia/types").SkPathEffect;
3
+ export declare const makePath2DPathEffect: (ctx: DeclarationContext, props: Path2DPathEffectProps) => import("../../skia/types").SkPathEffect;
4
+ export declare const makeDashPathEffect: (ctx: DeclarationContext, props: DashPathEffectProps) => import("../../skia/types").SkPathEffect;
5
+ export declare const makeCornerPathEffect: (ctx: DeclarationContext, props: CornerPathEffectProps) => import("../../skia/types").SkPathEffect;
6
+ export declare const declareSumPathEffect: (ctx: DeclarationContext) => void;
7
+ export declare const makeLine2DPathEffect: (ctx: DeclarationContext, props: Line2DPathEffectProps) => import("../../skia/types").SkPathEffect;
8
+ export declare const makePath1DPathEffect: (ctx: DeclarationContext, props: Path1DPathEffectProps) => import("../../skia/types").SkPathEffect;
@@ -0,0 +1,72 @@
1
+ "worklet";
2
+
3
+ import { composeDeclarations, enumKey, processPath } from "../../dom/nodes";
4
+ import { Path1DEffectStyle } from "../../skia/types";
5
+ export const makeDiscretePathEffect = (ctx, props) => {
6
+ const {
7
+ length,
8
+ deviation,
9
+ seed
10
+ } = props;
11
+ return ctx.Skia.PathEffect.MakeDiscrete(length, deviation, seed);
12
+ };
13
+ export const makePath2DPathEffect = (ctx, props) => {
14
+ const {
15
+ matrix
16
+ } = props;
17
+ const path = processPath(ctx.Skia, props.path);
18
+ const pe = ctx.Skia.PathEffect.MakePath2D(matrix, path);
19
+ if (pe === null) {
20
+ throw new Error("Path2DPathEffect: invalid path");
21
+ }
22
+ return pe;
23
+ };
24
+ export const makeDashPathEffect = (ctx, props) => {
25
+ const {
26
+ intervals,
27
+ phase
28
+ } = props;
29
+ const pe = ctx.Skia.PathEffect.MakeDash(intervals, phase);
30
+ return pe;
31
+ };
32
+ export const makeCornerPathEffect = (ctx, props) => {
33
+ const {
34
+ r
35
+ } = props;
36
+ const pe = ctx.Skia.PathEffect.MakeCorner(r);
37
+ if (pe === null) {
38
+ throw new Error("CornerPathEffect: couldn't create path effect");
39
+ }
40
+ return pe;
41
+ };
42
+ export const declareSumPathEffect = ctx => {
43
+ // Note: decorateChildren functionality needs to be handled differently
44
+ const pes = ctx.pathEffects.popAll();
45
+ const pe = composeDeclarations(pes, ctx.Skia.PathEffect.MakeSum.bind(ctx.Skia.PathEffect));
46
+ ctx.pathEffects.push(pe);
47
+ };
48
+ export const makeLine2DPathEffect = (ctx, props) => {
49
+ const {
50
+ width,
51
+ matrix
52
+ } = props;
53
+ const pe = ctx.Skia.PathEffect.MakeLine2D(width, matrix);
54
+ if (pe === null) {
55
+ throw new Error("Line2DPathEffect: could not create path effect");
56
+ }
57
+ return pe;
58
+ };
59
+ export const makePath1DPathEffect = (ctx, props) => {
60
+ const {
61
+ advance,
62
+ phase,
63
+ style
64
+ } = props;
65
+ const path = processPath(ctx.Skia, props.path);
66
+ const pe = ctx.Skia.PathEffect.MakePath1D(path, advance, phase, Path1DEffectStyle[enumKey(style)]);
67
+ if (pe === null) {
68
+ throw new Error("Path1DPathEffect: could not create path effect");
69
+ }
70
+ return pe;
71
+ };
72
+ //# sourceMappingURL=pathEffects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["composeDeclarations","enumKey","processPath","Path1DEffectStyle","makeDiscretePathEffect","ctx","props","length","deviation","seed","Skia","PathEffect","MakeDiscrete","makePath2DPathEffect","matrix","path","pe","MakePath2D","Error","makeDashPathEffect","intervals","phase","MakeDash","makeCornerPathEffect","r","MakeCorner","declareSumPathEffect","pes","pathEffects","popAll","MakeSum","bind","push","makeLine2DPathEffect","width","MakeLine2D","makePath1DPathEffect","advance","style","MakePath1D"],"sources":["pathEffects.ts"],"sourcesContent":["\"worklet\";\n\nimport { composeDeclarations, enumKey, processPath } from \"../../dom/nodes\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DeclarationContext,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"../../dom/types\";\nimport { Path1DEffectStyle } from \"../../skia/types\";\n\nexport const makeDiscretePathEffect = (\n ctx: DeclarationContext,\n props: DiscretePathEffectProps\n) => {\n const { length, deviation, seed } = props;\n return ctx.Skia.PathEffect.MakeDiscrete(length, deviation, seed);\n};\n\nexport const makePath2DPathEffect = (\n ctx: DeclarationContext,\n props: Path2DPathEffectProps\n) => {\n const { matrix } = props;\n const path = processPath(ctx.Skia, props.path);\n const pe = ctx.Skia.PathEffect.MakePath2D(matrix, path);\n if (pe === null) {\n throw new Error(\"Path2DPathEffect: invalid path\");\n }\n return pe;\n};\n\nexport const makeDashPathEffect = (\n ctx: DeclarationContext,\n props: DashPathEffectProps\n) => {\n const { intervals, phase } = props;\n const pe = ctx.Skia.PathEffect.MakeDash(intervals, phase);\n return pe;\n};\n\nexport const makeCornerPathEffect = (\n ctx: DeclarationContext,\n props: CornerPathEffectProps\n) => {\n const { r } = props;\n const pe = ctx.Skia.PathEffect.MakeCorner(r);\n if (pe === null) {\n throw new Error(\"CornerPathEffect: couldn't create path effect\");\n }\n return pe;\n};\n\nexport const declareSumPathEffect = (ctx: DeclarationContext) => {\n // Note: decorateChildren functionality needs to be handled differently\n const pes = ctx.pathEffects.popAll();\n const pe = composeDeclarations(\n pes,\n ctx.Skia.PathEffect.MakeSum.bind(ctx.Skia.PathEffect)\n );\n ctx.pathEffects.push(pe);\n};\n\nexport const makeLine2DPathEffect = (\n ctx: DeclarationContext,\n props: Line2DPathEffectProps\n) => {\n const { width, matrix } = props;\n const pe = ctx.Skia.PathEffect.MakeLine2D(width, matrix);\n if (pe === null) {\n throw new Error(\"Line2DPathEffect: could not create path effect\");\n }\n return pe;\n};\n\nexport const makePath1DPathEffect = (\n ctx: DeclarationContext,\n props: Path1DPathEffectProps\n) => {\n const { advance, phase, style } = props;\n const path = processPath(ctx.Skia, props.path);\n const pe = ctx.Skia.PathEffect.MakePath1D(\n path,\n advance,\n phase,\n Path1DEffectStyle[enumKey(style)]\n );\n if (pe === null) {\n throw new Error(\"Path1DPathEffect: could not create path effect\");\n }\n return pe;\n};\n"],"mappings":"AAAA,SAAS;;AAET,SAASA,mBAAmB,EAAEC,OAAO,EAAEC,WAAW,QAAQ,iBAAiB;AAU3E,SAASC,iBAAiB,QAAQ,kBAAkB;AAEpD,OAAO,MAAMC,sBAAsB,GAAGA,C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0 +1,10 @@
1
+ import type { ColorProps, DeclarationContext, FractalNoiseProps, ImageShaderProps, LinearGradientProps, RadialGradientProps, ShaderProps, SweepGradientProps, TurbulenceProps, TwoPointConicalGradientProps } from "../../dom/types";
2
+ export declare const declareShader: (ctx: DeclarationContext, props: ShaderProps) => void;
3
+ export declare const declareColorShader: (ctx: DeclarationContext, props: ColorProps) => void;
4
+ export declare const declareFractalNoiseShader: (ctx: DeclarationContext, props: FractalNoiseProps) => void;
5
+ export declare const declareTwoPointConicalGradientShader: (ctx: DeclarationContext, props: TwoPointConicalGradientProps) => void;
6
+ export declare const declareRadialGradientShader: (ctx: DeclarationContext, props: RadialGradientProps) => void;
7
+ export declare const declareSweepGradientShader: (ctx: DeclarationContext, props: SweepGradientProps) => void;
8
+ export declare const declareLinearGradientShader: (ctx: DeclarationContext, props: LinearGradientProps) => void;
9
+ export declare const declareTurbulenceShader: (ctx: DeclarationContext, props: TurbulenceProps) => void;
10
+ export declare const declareImageShader: (ctx: DeclarationContext, props: ImageShaderProps) => void;
@@ -0,0 +1,142 @@
1
+ "worklet";
2
+
3
+ import { enumKey, fitRects, getRect, processGradientProps, processTransformProps, rect2rect } from "../../dom/nodes";
4
+ import { FilterMode, MipmapMode, processUniforms, TileMode } from "../../skia/types";
5
+ export const declareShader = (ctx, props) => {
6
+ const {
7
+ source,
8
+ uniforms,
9
+ ...transform
10
+ } = props;
11
+ const m3 = ctx.Skia.Matrix();
12
+ processTransformProps(m3, transform);
13
+ const shader = source.makeShaderWithChildren(processUniforms(source, uniforms), ctx.shaders.popAll(), m3);
14
+ ctx.shaders.push(shader);
15
+ };
16
+ export const declareColorShader = (ctx, props) => {
17
+ const {
18
+ color
19
+ } = props;
20
+ const shader = ctx.Skia.Shader.MakeColor(ctx.Skia.Color(color));
21
+ ctx.shaders.push(shader);
22
+ };
23
+ export const declareFractalNoiseShader = (ctx, props) => {
24
+ const {
25
+ freqX,
26
+ freqY,
27
+ octaves,
28
+ seed,
29
+ tileWidth,
30
+ tileHeight
31
+ } = props;
32
+ const shader = ctx.Skia.Shader.MakeFractalNoise(freqX, freqY, octaves, seed, tileWidth, tileHeight);
33
+ ctx.shaders.push(shader);
34
+ };
35
+ export const declareTwoPointConicalGradientShader = (ctx, props) => {
36
+ const {
37
+ startR,
38
+ endR,
39
+ start,
40
+ end
41
+ } = props;
42
+ const {
43
+ colors,
44
+ positions,
45
+ mode,
46
+ localMatrix,
47
+ flags
48
+ } = processGradientProps(ctx.Skia, props);
49
+ const shader = ctx.Skia.Shader.MakeTwoPointConicalGradient(start, startR, end, endR, colors, positions, mode, localMatrix, flags);
50
+ ctx.shaders.push(shader);
51
+ };
52
+ export const declareRadialGradientShader = (ctx, props) => {
53
+ const {
54
+ c,
55
+ r
56
+ } = props;
57
+ const {
58
+ colors,
59
+ positions,
60
+ mode,
61
+ localMatrix,
62
+ flags
63
+ } = processGradientProps(ctx.Skia, props);
64
+ const shader = ctx.Skia.Shader.MakeRadialGradient(c, r, colors, positions, mode, localMatrix, flags);
65
+ ctx.shaders.push(shader);
66
+ };
67
+ export const declareSweepGradientShader = (ctx, props) => {
68
+ const {
69
+ c,
70
+ start,
71
+ end
72
+ } = props;
73
+ const {
74
+ colors,
75
+ positions,
76
+ mode,
77
+ localMatrix,
78
+ flags
79
+ } = processGradientProps(ctx.Skia, props);
80
+ const shader = ctx.Skia.Shader.MakeSweepGradient(c.x, c.y, colors, positions, mode, localMatrix, flags, start, end);
81
+ ctx.shaders.push(shader);
82
+ };
83
+ export const declareLinearGradientShader = (ctx, props) => {
84
+ const {
85
+ start,
86
+ end
87
+ } = props;
88
+ const {
89
+ colors,
90
+ positions,
91
+ mode,
92
+ localMatrix,
93
+ flags
94
+ } = processGradientProps(ctx.Skia, props);
95
+ const shader = ctx.Skia.Shader.MakeLinearGradient(start, end, colors, positions !== null && positions !== void 0 ? positions : null, mode, localMatrix, flags);
96
+ ctx.shaders.push(shader);
97
+ };
98
+ export const declareTurbulenceShader = (ctx, props) => {
99
+ const {
100
+ freqX,
101
+ freqY,
102
+ octaves,
103
+ seed,
104
+ tileWidth,
105
+ tileHeight
106
+ } = props;
107
+ const shader = ctx.Skia.Shader.MakeTurbulence(freqX, freqY, octaves, seed, tileWidth, tileHeight);
108
+ ctx.shaders.push(shader);
109
+ };
110
+ export const declareImageShader = (ctx, props) => {
111
+ const {
112
+ fit,
113
+ image,
114
+ tx,
115
+ ty,
116
+ fm,
117
+ mm,
118
+ ...imageShaderProps
119
+ } = props;
120
+ if (!image) {
121
+ return;
122
+ }
123
+ const rct = getRect(ctx.Skia, imageShaderProps);
124
+ const m3 = ctx.Skia.Matrix();
125
+ if (rct) {
126
+ const rects = fitRects(fit, {
127
+ x: 0,
128
+ y: 0,
129
+ width: image.width(),
130
+ height: image.height()
131
+ }, rct);
132
+ const [x, y, sx, sy] = rect2rect(rects.src, rects.dst);
133
+ m3.translate(x.translateX, y.translateY);
134
+ m3.scale(sx.scaleX, sy.scaleY);
135
+ }
136
+ const lm = ctx.Skia.Matrix();
137
+ lm.concat(m3);
138
+ processTransformProps(lm, imageShaderProps);
139
+ const shader = image.makeShaderOptions(TileMode[enumKey(tx)], TileMode[enumKey(ty)], FilterMode[enumKey(fm)], MipmapMode[enumKey(mm)], lm);
140
+ ctx.shaders.push(shader);
141
+ };
142
+ //# sourceMappingURL=shaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["enumKey","fitRects","getRect","processGradientProps","processTransformProps","rect2rect","FilterMode","MipmapMode","processUniforms","TileMode","declareShader","ctx","props","source","uniforms","transform","m3","Skia","Matrix","shader","makeShaderWithChildren","shaders","popAll","push","declareColorShader","color","Shader","MakeColor","Color","declareFractalNoiseShader","freqX","freqY","octaves","seed","tileWidth","tileHeight","MakeFractalNoise","declareTwoPointConicalGradientShader","startR","endR","start","end","colors","positions","mode","localMatrix","flags","MakeTwoPointConicalGradient","declareRadialGradientShader","c","r","MakeRadialGradient","declareSweepGradientShader","MakeSweepGradient","x","y","declareLinearGradientShader","MakeLinearGradient","declareTurbulenceShader","MakeTurbulence","declareImageShader","fit","image","tx","ty","fm","mm","imageShaderProps","rct","rects","width","height","sx","sy","src","dst","translate","translateX","translateY","scale","scaleX","scaleY","lm","concat","makeShaderOptions"],"sources":["shaders.ts"],"sourcesContent":["\"worklet\";\n\nimport {\n enumKey,\n fitRects,\n getRect,\n processGradientProps,\n processTransformProps,\n rect2rect,\n} from \"../../dom/nodes\";\nimport type {\n ColorProps,\n DeclarationContext,\n FractalNoiseProps,\n ImageShaderProps,\n LinearGradientProps,\n RadialGradientProps,\n ShaderProps,\n SweepGradientProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n} from \"../../dom/types\";\nimport {\n FilterMode,\n MipmapMode,\n processUniforms,\n TileMode,\n} from \"../../skia/types\";\n\nexport const declareShader = (ctx: DeclarationContext, props: ShaderProps) => {\n const { source, uniforms, ...transform } = props;\n const m3 = ctx.Skia.Matrix();\n processTransformProps(m3, transform);\n const shader = source.makeShaderWithChildren(\n processUniforms(source, uniforms),\n ctx.shaders.popAll(),\n m3\n );\n ctx.shaders.push(shader);\n};\n\nexport const declareColorShader = (\n ctx: DeclarationContext,\n props: ColorProps\n) => {\n const { color } = props;\n const shader = ctx.Skia.Shader.MakeColor(ctx.Skia.Color(color));\n ctx.shaders.push(shader);\n};\n\nexport const declareFractalNoiseShader = (\n ctx: DeclarationContext,\n props: FractalNoiseProps\n) => {\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = props;\n const shader = ctx.Skia.Shader.MakeFractalNoise(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n ctx.shaders.push(shader);\n};\n\nexport const declareTwoPointConicalGradientShader = (\n ctx: DeclarationContext,\n props: TwoPointConicalGradientProps\n) => {\n const { startR, endR, start, end } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeTwoPointConicalGradient(\n start,\n startR,\n end,\n endR,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n ctx.shaders.push(shader);\n};\n\nexport const declareRadialGradientShader = (\n ctx: DeclarationContext,\n props: RadialGradientProps\n) => {\n const { c, r } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeRadialGradient(\n c,\n r,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n ctx.shaders.push(shader);\n};\n\nexport const declareSweepGradientShader = (\n ctx: DeclarationContext,\n props: SweepGradientProps\n) => {\n const { c, start, end } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeSweepGradient(\n c.x,\n c.y,\n colors,\n positions,\n mode,\n localMatrix,\n flags,\n start,\n end\n );\n ctx.shaders.push(shader);\n};\n\nexport const declareLinearGradientShader = (\n ctx: DeclarationContext,\n props: LinearGradientProps\n) => {\n const { start, end } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeLinearGradient(\n start,\n end,\n colors,\n positions ?? null,\n mode,\n localMatrix,\n flags\n );\n ctx.shaders.push(shader);\n};\n\nexport const declareTurbulenceShader = (\n ctx: DeclarationContext,\n props: TurbulenceProps\n) => {\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = props;\n const shader = ctx.Skia.Shader.MakeTurbulence(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n ctx.shaders.push(shader);\n};\n\nexport const declareImageShader = (\n ctx: DeclarationContext,\n props: ImageShaderProps\n) => {\n const { fit, image, tx, ty, fm, mm, ...imageShaderProps } = props;\n if (!image) {\n return;\n }\n\n const rct = getRect(ctx.Skia, imageShaderProps);\n const m3 = ctx.Skia.Matrix();\n if (rct) {\n const rects = fitRects(\n fit,\n { x: 0, y: 0, width: image.width(), height: image.height() },\n rct\n );\n const [x, y, sx, sy] = rect2rect(rects.src, rects.dst);\n m3.translate(x.translateX, y.translateY);\n m3.scale(sx.scaleX, sy.scaleY);\n }\n const lm = ctx.Skia.Matrix();\n lm.concat(m3);\n processTransformProps(lm, imageShaderProps);\n const shader = image.makeShaderOptions(\n TileMode[enumKey(tx)],\n TileMode[enumKey(ty)],\n FilterMode[enumKey(fm)],\n MipmapMode[enumKey(mm)],\n lm\n );\n ctx.shaders.push(shader);\n};\n"],"mappings":"AAAA,SAAS;;AAET,SACEA,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,oBAAoB,EACpBC,qBAAqB,EACrBC,SAAS,QACJ,iBAAiB;AAaxB,SACEC,UAAU,EACVC,UAAU,EACVC,eAAe,EACfC,QAAQ,QACH,kBAAkB;AAEzB,OAAO,MAAMC,aAAa,GAAGA,CAACC,GAAuB,EAAEC,KAAkB,KAAK;EAC5E,MAAM;IAAEC,MAAM;IAAEC,QAAQ;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EAChD,MAAMI,EAAE,GAAGL,GAAG,CAACM,IAAI,CAACC,MAAM,CAAC,CAAC;EAC5Bd,qBAAqB,CAACY,EAAE,EAAED,SAAS,CAAC;EACpC,MAAMI,MAAM,GAAGN,MAAM,CAACO,sBAAsB,CAC1CZ,eAAe,CAACK,MAAM,EAAEC,QAAQ,CAAC,EACjCH,GAAG,CAACU,OAAO,CAACC,MAAM,CAAC,CAAC,EACpBN,EACF,CAAC;EACDL,GAAG,CAACU,OAAO,CAACE,IAAI,CAACJ,MAAM,CAAC;AAC1B,CAAC;AAED,OAAO,MAAMK,kBAAkB,GAAGA,CAChCb,GAAuB,EACvBC,KAAiB,KACd;EACH,MAAM;IAAEa;EAAM,CAAC,GAAGb,KAAK;EACvB,MAAMO,MAAM,GAAGR,GAAG,CAACM,IAAI,CAACS,MAAM,CAACC,SAAS,CAAChB,GAAG,CAACM,IAAI,CAACW,KAAK,CAACH,KAAK,CAAC,CAAC;EAC/Dd,GAAG,CAACU,OAAO,CAACE,IAAI,CAACJ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EAAEC,CAAC,EAAEiB,EAAE,EAAEC,EAAE,CAAC,GAAGpE,SAAS,CAACgE,KAAK,CAACK,GAAG,EAAEL,KAAK,CAACM,GAAG,CAAC;IACtD3D,EAAE,CAAC4D,SAAS,CAACtB,CAAC,CAACuB,UAAU,EAAEtB,CAAC,CAACuB,UAAU,CAAC;IACxC9D,EAAE,CAAC+D,KAAK,CAACP,EAAE,CAACQ,MAAM,EAAEP,EAAE,CAACQ,MAAM,CAAC;EAChC;EACA,MAAMC,EAAE,GAAGvE,GAAG,CAACM,IAAI,CAACC,MAAM,CAAC,CAAC;EAC5BgE,EAAE,CAACC,MAAM,CAACnE,EAAE,CAAC;EACbZ,qBAAqB,CAAC8E,EAAE,EAAEf,gBAAgB,CAAC;EAC3C,MAAMhD,MAAM,GAAG2C,KAAK,CAACsB,iBAAiB,CACpC3E,QAAQ,CAACT,OAAO,CAAC+D,EAAE,CAAC,CAAC,EACrBtD,QAAQ,CAACT,OAAO,CAACgE,EAAE,CAAC,CAAC,EACrB1D,UAAU,CAACN,OAAO,CAACiE,EAAE,CAAC,CAAC,EACvB1D,UAAU,CAACP,OAAO,CAACkE,EAAE,CAAC,CAAC,EACvBgB,EACF,CAAC;EACDvE,GAAG,CAACU,OAAO,CAACE,IAAI,CAACJ,MAAM,CAAC;AAC1B,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import type { SharedValue } from "react-native-reanimated";
2
+ export declare const isSharedValue: <T = unknown>(value: unknown) => value is SharedValue<T>;
3
+ export declare const materialize: <T extends object>(props: T) => T;
@@ -0,0 +1,18 @@
1
+ "worklet";
2
+
3
+ import { mapKeys } from "../../renderer/typeddash";
4
+ export const isSharedValue = value => {
5
+ // We cannot use `in` operator here because `value` could be a HostObject and therefore we cast.
6
+ return (value === null || value === void 0 ? void 0 : value._isReanimatedSharedValue) === true;
7
+ };
8
+ export const materialize = props => {
9
+ const result = Object.assign({}, props);
10
+ mapKeys(result).forEach(key => {
11
+ const value = result[key];
12
+ if (isSharedValue(value)) {
13
+ result[key] = value.value;
14
+ }
15
+ });
16
+ return result;
17
+ };
18
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["mapKeys","isSharedValue","value","_isReanimatedSharedValue","materialize","props","result","Object","assign","forEach","key"],"sources":["utils.ts"],"sourcesContent":["\"worklet\";\n\nimport type { SharedValue } from \"react-native-reanimated\";\n\nimport { mapKeys } from \"../../renderer/typeddash\";\n\nexport const isSharedValue = <T = unknown>(\n value: unknown\n): value is SharedValue<T> => {\n // We cannot use `in` operator here because `value` could be a HostObject and therefore we cast.\n return (value as Record<string, unknown>)?._isReanimatedSharedValue === true;\n};\n\nexport const materialize = <T extends object>(props: T) => {\n const result: T = Object.assign({}, props);\n mapKeys(result).forEach((key) => {\n const value = result[key];\n if (isSharedValue(value)) {\n result[key] = value.value as never;\n }\n });\n return result;\n};\n"],"mappings":"AAAA,SAAS;;AAIT,SAASA,OAAO,QAAQ,0BAA0B;AAElD,OAAO,MAAMC,aAAa,GACxBC,KAAc,IACc;EAC5B;EACA,OAAO,CAACA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAA8BC,wBAAwB,MAAK,IAAI;AAC9E,CAAC;AAED,OAAO,MAAMC,WAAW,GAAsBC,KAAQ,IAAK;EACzD,MAAMC,MAAS,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEH,KAAK,CAAC;EAC1CL,OAAO,CAACM,MAAM,CAAC,CAACG,OAAO,CAAEC,GAAG,IAAK;IAC/B,MAAMR,KAAK,GAAGI,MAAM,CAACI,GAAG,CAAC;IACzB,IAAIT,aAAa,CAACC,KAAK,CAAC,EAAE;MACxBI,MAAM,CAACI,GAAG,CAAC,GAAGR,KAAK,CAACA,KAAc;IACpC;EACF,CAAC,CAAC;EACF,OAAOI,MAAM;AACf,CAAC","ignoreList":[]}
@@ -46,7 +46,9 @@ export class SkiaDomView extends React.Component {
46
46
  assertSkiaViewApi();
47
47
  SkiaViewApi.setJsiProperty(this._nativeId, "onSize", onSize);
48
48
  }
49
- this.tick();
49
+ if (onSize !== prevProps.onSize || root !== prevProps.root) {
50
+ this.tick();
51
+ }
50
52
  }
51
53
  componentWillUnmount() {
52
54
  if (this.requestId) {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","SkiaDomViewNativeComponent","SkiaViewApi","SkiaViewNativeId","NativeSkiaDomView","OS","SkiaDomView","Component","constructor","props","_defineProperty","_nativeId","current","root","onSize","assertSkiaViewApi","setJsiProperty","tick","nativeId","componentDidUpdate","prevProps","componentWillUnmount","requestId","cancelAnimationFrame","redraw","mode","requestAnimationFrame","bind","makeImageSnapshot","rect","makeImageSnapshotAsync","requestRedraw","render","debug","opaque","viewProps","createElement","_extends","collapsable","nativeID","Error"],"sources":["SkiaDomView.tsx"],"sourcesContent":["import React from \"react\";\nimport type { HostComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport { Platform } from \"../Platform\";\nimport SkiaDomViewNativeComponent from \"../specs/SkiaDomViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaDomViewNativeProps } from \"./types\";\nimport { SkiaViewNativeId } from \"./SkiaViewNativeId\";\n\nconst NativeSkiaDomView: HostComponent<SkiaDomViewNativeProps> =\n Platform.OS !== \"web\"\n ? SkiaDomViewNativeComponent\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (null as any);\n\ninterface SkiaDomViewProps extends SkiaDomViewNativeProps {\n mode?: \"default\" | \"continuous\";\n}\n\nexport class SkiaDomView extends React.Component<SkiaDomViewProps> {\n constructor(props: SkiaDomViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { root, onSize } = props;\n if (root) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", root);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n private _nativeId: number;\n private requestId = 0;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDomViewProps) {\n const { root, onSize } = this.props;\n if (root !== prevProps.root) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", root);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n componentWillUnmount(): void {\n if (this.requestId) {\n cancelAnimationFrame(this.requestId);\n }\n }\n\n private tick() {\n this.redraw();\n if (this.props.mode === \"continuous\") {\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshotAsync(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshotAsync(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n render() {\n const { debug = false, opaque = false, ...viewProps } = this.props;\n return (\n <NativeSkiaDomView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n debug={debug}\n opaque={opaque}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,SAASC,QAAQ,QAAQ,aAAa;AACtC,OAAOC,0BA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C9BsB,KAAK,EAAEA,KAAM;MACbC,MAAM,EAAEA;IAAO,GACXC,SAAS,CACd,CAAC;EAEN;AACF;AAEA,MAAMpB,iBAAiB,GAAGA,CAAA,KAAM;EAC9B,IACEb,WAAW,KAAK,IAAI,IACpBA,WAAW,CAACc,cAAc,KAAK,IAAI,IACnCd,WAAW,CAAC6B,aAAa,KAAK,IAAI,IAClC7B,WAAW,CAAC0B,iBAAiB,KAAK,IAAI,EACtC;IACA,MAAMY,KAAK,CAAC,8BAA8B,CAAC;EAC7C;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","Platform","SkiaDomViewNativeComponent","SkiaViewApi","SkiaViewNativeId","NativeSkiaDomView","OS","SkiaDomView","Component","constructor","props","_defineProperty","_nativeId","current","root","onSize","assertSkiaViewApi","setJsiProperty","tick","nativeId","componentDidUpdate","prevProps","componentWillUnmount","requestId","cancelAnimationFrame","redraw","mode","requestAnimationFrame","bind","makeImageSnapshot","rect","makeImageSnapshotAsync","requestRedraw","render","debug","opaque","viewProps","createElement","_extends","collapsable","nativeID","Error"],"sources":["SkiaDomView.tsx"],"sourcesContent":["import React from \"react\";\nimport type { HostComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport { Platform } from \"../Platform\";\nimport SkiaDomViewNativeComponent from \"../specs/SkiaDomViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaDomViewNativeProps } from \"./types\";\nimport { SkiaViewNativeId } from \"./SkiaViewNativeId\";\n\nconst NativeSkiaDomView: HostComponent<SkiaDomViewNativeProps> =\n Platform.OS !== \"web\"\n ? SkiaDomViewNativeComponent\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (null as any);\n\ninterface SkiaDomViewProps extends SkiaDomViewNativeProps {\n mode?: \"default\" | \"continuous\";\n}\n\nexport class SkiaDomView extends React.Component<SkiaDomViewProps> {\n constructor(props: SkiaDomViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { root, onSize } = props;\n if (root) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", root);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n private _nativeId: number;\n private requestId = 0;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDomViewProps) {\n const { root, onSize } = this.props;\n if (root !== prevProps.root) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", root);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n if (onSize !== prevProps.onSize || root !== prevProps.root) {\n this.tick();\n }\n }\n\n componentWillUnmount(): void {\n if (this.requestId) {\n cancelAnimationFrame(this.requestId);\n }\n }\n\n private tick() {\n this.redraw();\n if (this.props.mode === \"continuous\") {\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshotAsync(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshotAsync(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n render() {\n const { debug = false, opaque = false, ...viewProps } = this.props;\n return (\n <NativeSkiaDomView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n debug={debug}\n opaque={opaque}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,SAASC,QAAQ,QAAQ,aAAa;AACtC,OAAOC,0BAA0B,MAAM,qCAAqC;AAE5E,SAASC,WAAW,QAAQ,OAAO;AAEnC,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAMC,iBAAwD,GAC5DJ,QAAQ,CAACK,EAAE,KAAK,KAAK,GACjBJ,0BAA0B;AAC1B;AACC,IAAY;AAMnB,OAAO,MAAMK,WAAW,SAASP,KAAK,CAACQ,SAAS,CAAmB;EACjEC,WAAWA,CAACC,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA;IAAAA,eAAA,oBAeK,CAAC;IAdnB,IAAI,CAACC,SAAS,GAAGR,gBAAgB,CAACS,OAAO,EAAE;IAC3C,MAAM;MAAEC,IAAI;MAAEC;IAAO,CAAC,GAAGL,KAAK;IAC9B,IAAII,IAAI,EAAE;MACRE,iBAAiB,CAAC,CAAC;MACnBb,WAAW,CAACc,cAAc,CAAC,IAAI,CAACL,SAAS,EAAE,MAAM,EAAEE,IAAI,CAAC;IAC1D;IACA,IAAIC,MAAM,EAAE;MACVC,iBAAiB,CAAC,CAAC;MACnBb,WAAW,CAACc,cAAc,CAAC,IAAI,CAACL,SAAS,EAAE,QAAQ,EAAEG,MAAM,CAAC;IAC9D;IACA,IAAI,CAACG,IAAI,CAAC,CAAC;EACb;EAKA,IAAWC,QAAQA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACP,SAAS;EACvB;EAEAQ,kBAAkBA,CAACC,SAA2B,EAAE;IAC9C,MAAM;MAAEP,IAAI;MAAEC;IAAO,CAAC,GAAG,IAAI,CAACL,KAAK;IACnC,IAAII,IAAI,KAAKO,SAAS,CAACP,IAAI,EAAE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IAAI,CAACpB,SAAS,CAAC;EAC3C;EAEAqB,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEC,KAAK,GAAG,KAAK;MAAEC,MAAM,GAAG,KAAK;MAAE,GAAGC;IAAU,CAAC,GAAG,IAAI,CAAC1B,KAAK;IAClE,oBACEV,KAAA,CAAAqC,aAAA,CAAChC,iBAAiB,EAAAiC,QAAA;MAChBC,WAAW,EAAE,KAAM;MACnBC,QAAQ,EAAE,GAAG,IAAI,CAAC5B,SAAS,EAAG;MAC9BsB,KAAK,EAAEA,KAAM;MACbC,MAAM,EAAEA;IAAO,GACXC,SAAS,CACd,CAAC;EAEN;AACF;AAEA,MAAMpB,iBAAiB,GAAGA,CAAA,KAAM;EAC9B,IACEb,WAAW,KAAK,IAAI,IACpBA,WAAW,CAACc,cAAc,KAAK,IAAI,IACnCd,WAAW,CAAC6B,aAAa,KAAK,IAAI,IAClC7B,WAAW,CAAC0B,iBAAiB,KAAK,IAAI,EACtC;IACA,MAAMY,KAAK,CAAC,8BAA8B,CAAC;EAC7C;AACF,CAAC","ignoreList":[]}
@@ -31,7 +31,6 @@ export class SkiaPictureView extends React.Component {
31
31
  return this._nativeId;
32
32
  }
33
33
  componentDidUpdate(prevProps) {
34
- console.log("componentDidUpdate");
35
34
  const {
36
35
  picture,
37
36
  onSize
@@ -73,7 +72,6 @@ export class SkiaPictureView extends React.Component {
73
72
  */
74
73
  redraw() {
75
74
  assertSkiaViewApi();
76
- console.log("Request redraw: ", this._nativeId);
77
75
  SkiaViewApi.requestRedraw(this._nativeId);
78
76
  }
79
77
  render() {
@@ -1 +1 @@
1
- {"version":3,"names":["React","SkiaPictureViewNativeComponent","SkiaViewApi","SkiaViewNativeId","NativeSkiaPictureView","SkiaPictureView","Component","constructor","props","_defineProperty","_nativeId","current","picture","onSize","assertSkiaViewApi","setJsiProperty","tick","nativeId","componentDidUpdate","prevProps","console","log","componentWillUnmount","requestId","cancelAnimationFrame","redraw","mode","requestAnimationFrame","bind","makeImageSnapshot","rect","requestRedraw","render","debug","opaque","viewProps","createElement","_extends","collapsable","nativeID","Error"],"sources":["SkiaPictureView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaPictureViewNativeProps } from \"./types\";\nimport { SkiaViewNativeId } from \"./SkiaViewNativeId\";\n\nconst NativeSkiaPictureView = SkiaPictureViewNativeComponent;\n\ninterface SkiaPictureViewProps extends SkiaPictureViewNativeProps {\n mode?: \"default\" | \"continuous\";\n}\n\nexport class SkiaPictureView extends React.Component<SkiaPictureViewProps> {\n private requestId = 0;\n\n constructor(props: SkiaPictureViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { picture, onSize } = props;\n if (picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaPictureViewProps) {\n console.log(\"componentDidUpdate\");\n const { picture, onSize } = this.props;\n if (picture !== prevProps.picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n componentWillUnmount() {\n if (this.requestId) {\n cancelAnimationFrame(this.requestId);\n }\n }\n\n private tick() {\n this.redraw();\n if (this.props.mode === \"continuous\") {\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n console.log(\"Request redraw: \", this._nativeId);\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n render() {\n const { mode, debug = false, opaque = false, ...viewProps } = this.props;\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n debug={debug}\n opaque={opaque}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAOC,8BAA8B,MAAM,yCAAyC;AAEpF,SAASC,WAAW,QAAQ,OAAO;AAEnC,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAMC,qBAAqB,GAAGH,8BAA8B;AAM5D,OAAO,MAAMI,eAAe,SAASL,KAAK,CAACM,SAAS,CAAuB;EAGzEC,WAAWA,CAACC,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,oBAHK,CAAC;IAAAA,eAAA;IAInB,IAAI,CAACC,SAAS,GAAGP,gBAAgB,CAACQ,OAAO,EAAE;IAC3C,MAAM;MAAEC,OAAO;MAAEC;IAAO,CAAC,GAAGL,KAAK;IACjC,IAAII,OAAO,EAAE;MACXE,iBAAiB,CAAC,CAAC;MACnBZ,WAAW,CAACa,cAAc,CAAC,IAAI,CAACL,SAAS,EAAE,SAAS,EAAEE,OAAO,CAAC;IAChE;IACA,IAAIC,MAAM,EAAE;MACVC,iBAAiB,CAAC,CAAC;MACnBZ,WAAW,CAACa,cAAc,CAAC,IAAI,CAACL,SAAS,EAAE,QAAQ,EAAEG,MAAM,CAAC;I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C,CAAC;IACnBM,OAAO,CAACC,GAAG,CAAC,kBAAkB,EAAE,IAAI,CAACX,SAAS,CAAC;IAC/CR,WAAW,CAAC6B,aAAa,CAAC,IAAI,CAACrB,SAAS,CAAC;EAC3C;EAEAsB,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEN,IAAI;MAAEO,KAAK,GAAG,KAAK;MAAEC,MAAM,GAAG,KAAK;MAAE,GAAGC;IAAU,CAAC,GAAG,IAAI,CAAC3B,KAAK;IACxE,oBACER,KAAA,CAAAoC,aAAA,CAAChC,qBAAqB,EAAAiC,QAAA;MACpBC,WAAW,EAAE,KAAM;MACnBC,QAAQ,EAAE,GAAG,IAAI,CAAC7B,SAAS,EAAG;MAC9BuB,KAAK,EAAEA,KAAM;MACbC,MAAM,EAAEA;IAAO,GACXC,SAAS,CACd,CAAC;EAEN;AACF;AAEA,MAAMrB,iBAAiB,GAAGA,CAAA,KAAM;EAC9B,IACEZ,WAAW,KAAK,IAAI,IACpBA,WAAW,CAACa,cAAc,KAAK,IAAI,IACnCb,WAAW,CAAC6B,aAAa,KAAK,IAAI,IAClC7B,WAAW,CAAC2B,iBAAiB,KAAK,IAAI,EACtC;IACA,MAAMW,KAAK,CAAC,8BAA8B,CAAC;EAC7C;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","SkiaPictureViewNativeComponent","SkiaViewApi","SkiaViewNativeId","NativeSkiaPictureView","SkiaPictureView","Component","constructor","props","_defineProperty","_nativeId","current","picture","onSize","assertSkiaViewApi","setJsiProperty","tick","nativeId","componentDidUpdate","prevProps","componentWillUnmount","requestId","cancelAnimationFrame","redraw","mode","requestAnimationFrame","bind","makeImageSnapshot","rect","requestRedraw","render","debug","opaque","viewProps","createElement","_extends","collapsable","nativeID","Error"],"sources":["SkiaPictureView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaPictureViewNativeProps } from \"./types\";\nimport { SkiaViewNativeId } from \"./SkiaViewNativeId\";\n\nconst NativeSkiaPictureView = SkiaPictureViewNativeComponent;\n\ninterface SkiaPictureViewProps extends SkiaPictureViewNativeProps {\n mode?: \"default\" | \"continuous\";\n}\n\nexport class SkiaPictureView extends React.Component<SkiaPictureViewProps> {\n private requestId = 0;\n\n constructor(props: SkiaPictureViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { picture, onSize } = props;\n if (picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaPictureViewProps) {\n const { picture, onSize } = this.props;\n if (picture !== prevProps.picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n componentWillUnmount() {\n if (this.requestId) {\n cancelAnimationFrame(this.requestId);\n }\n }\n\n private tick() {\n this.redraw();\n if (this.props.mode === \"continuous\") {\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n render() {\n const { mode, debug = false, opaque = false, ...viewProps } = this.props;\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n debug={debug}\n opaque={opaque}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAOC,8BAA8B,MAAM,yCAAyC;AAEpF,SAASC,WAAW,QAAQ,OAAO;AAEnC,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAMC,qBAAqB,GAAGH,8BAA8B;AAM5D,OAAO,MAAMI,eAAe,SAASL,KAAK,CAACM,SAAS,CAAuB;EAGzEC,WAAWA,CAACC,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,oBAHK,CAAC;IAAAA,eAAA;IAInB,IAAI,CAACC,SAAS,GAAGP,gBAAgB,CAACQ,OAAO,EAAE;IAC3C,MAAM;MAAEC,OAAO;MAAEC;IAAO,CAAC,GAAGL,KAAK;IACjC,IAAII,OAAO,EAAE;MACXE,iBAAiB,CAAC,CAAC;MACnBZ,WAAW,CAACa,cAAc,CAAC,IAAI,CAACL,SAAS,EAAE,SAAS,EAAEE,OAAO,CAAC;IAChE;IACA,IAAIC,MAAM,EAAE;MACVC,iBAAiB,CAAC,CAAC;MACnBZ,WAAW,CAACa,cAAc,CAAC,IAAI,CAACL,SAAS,EAAE,QAAQ,EAAEG,MAAM,CAAC;IAC9D;IACA,IAAI,CAACG,IAAI,CAAC,CAAC;EACb;EAIA,IAAWC,QAAQA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACP,SAAS;EACvB;EAEAQ,kBAAkBA,CAACC,SAA+B,EAAE;IAClD,MAAM;MAAEP,OAAO;MAAEC;IAAO,CAAC,GAAG,IAAI,CAACL,KAAK;IACtC,IAAII,OAAO,KAAKO,SAA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BC,WAAW,EAAE,KAAM;MACnBC,QAAQ,EAAE,GAAG,IAAI,CAAC3B,SAAS,EAAG;MAC9BqB,KAAK,EAAEA,KAAM;MACbC,MAAM,EAAEA;IAAO,GACXC,SAAS,CACd,CAAC;EAEN;AACF;AAEA,MAAMnB,iBAAiB,GAAGA,CAAA,KAAM;EAC9B,IACEZ,WAAW,KAAK,IAAI,IACpBA,WAAW,CAACa,cAAc,KAAK,IAAI,IACnCb,WAAW,CAAC2B,aAAa,KAAK,IAAI,IAClC3B,WAAW,CAACyB,iBAAiB,KAAK,IAAI,EACtC;IACA,MAAMW,KAAK,CAAC,8BAA8B,CAAC;EAC7C;AACF,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import type { ViewProps } from "react-native";
2
+ import type { SharedValue } from "react-native-reanimated";
2
3
  import type { GroupProps, RenderNode } from "../dom/types";
3
4
  import type { SkImage, SkPicture, SkRect, SkSize } from "../skia/types";
4
- import type { SharedValueType } from "../renderer/processors/Animations/Animations";
5
5
  export type NativeSkiaViewProps = ViewProps & {
6
6
  debug?: boolean;
7
7
  opaque?: boolean;
@@ -27,7 +27,7 @@ export interface SkiaBaseViewProps extends ViewProps {
27
27
  * Pass an animated value to the onSize property to get updates when
28
28
  * the Skia view is resized.
29
29
  */
30
- onSize?: SharedValueType<SkSize>;
30
+ onSize?: SharedValue<SkSize>;
31
31
  opaque?: boolean;
32
32
  }
33
33
  export interface SkiaPictureViewNativeProps extends SkiaBaseViewProps {
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ViewProps } from \"react-native\";\n\nimport type { GroupProps, RenderNode } from \"../dom/types\";\nimport type { SkImage, SkPicture, SkRect, SkSize } from \"../skia/types\";\nimport type { SharedValueType } from \"../renderer/processors/Animations/Animations\";\n\nexport type NativeSkiaViewProps = ViewProps & {\n debug?: boolean;\n opaque?: boolean;\n};\n\nexport interface DrawingInfo {\n width: number;\n height: number;\n timestamp: number;\n}\n\nexport interface ISkiaViewApi {\n setJsiProperty: <T>(nativeId: number, name: string, value: T) => void;\n requestRedraw: (nativeId: number) => void;\n makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;\n makeImageSnapshotAsync: (nativeId: number, rect?: SkRect) => Promise<SkImage>;\n}\n\nexport interface SkiaBaseViewProps extends ViewProps {\n /**\n * When set to true the view will display information about the\n * average time it takes to render.\n */\n debug?: boolean;\n /**\n * Pass an animated value to the onSize property to get updates when\n * the Skia view is resized.\n */\n onSize?: SharedValueType<SkSize>;\n\n opaque?: boolean;\n}\n\nexport interface SkiaPictureViewNativeProps extends SkiaBaseViewProps {\n picture?: SkPicture;\n}\n\nexport interface SkiaDomViewNativeProps extends SkiaBaseViewProps {\n root?: RenderNode<GroupProps>;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ViewProps } from \"react-native\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nimport type { GroupProps, RenderNode } from \"../dom/types\";\nimport type { SkImage, SkPicture, SkRect, SkSize } from \"../skia/types\";\n\nexport type NativeSkiaViewProps = ViewProps & {\n debug?: boolean;\n opaque?: boolean;\n};\n\nexport interface DrawingInfo {\n width: number;\n height: number;\n timestamp: number;\n}\n\nexport interface ISkiaViewApi {\n setJsiProperty: <T>(nativeId: number, name: string, value: T) => void;\n requestRedraw: (nativeId: number) => void;\n makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;\n makeImageSnapshotAsync: (nativeId: number, rect?: SkRect) => Promise<SkImage>;\n}\n\nexport interface SkiaBaseViewProps extends ViewProps {\n /**\n * When set to true the view will display information about the\n * average time it takes to render.\n */\n debug?: boolean;\n /**\n * Pass an animated value to the onSize property to get updates when\n * the Skia view is resized.\n */\n onSize?: SharedValue<SkSize>;\n\n opaque?: boolean;\n}\n\nexport interface SkiaPictureViewNativeProps extends SkiaBaseViewProps {\n picture?: SkPicture;\n}\n\nexport interface SkiaDomViewNativeProps extends SkiaBaseViewProps {\n root?: RenderNode<GroupProps>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,3 +1,3 @@
1
1
  export const __esModule: boolean;
2
2
  export function isCircleScalarDef(def: any): boolean;
3
- export function processCircle(Skia: any, def: any): any;
3
+ export function processCircle(def: any): any;
@@ -2,3 +2,5 @@ export const __esModule: boolean;
2
2
  export function isEdge(pos: any, b: any): boolean;
3
3
  export function processRect(Skia: any, def: any): any;
4
4
  export function processRRect(Skia: any, def: any): any;
5
+ export function inflate(Skia: any, box: any, dx: any, dy: any, tx?: number, ty?: number): any;
6
+ export function deflate(Skia: any, box: any, dx: any, dy: any, tx?: number, ty?: number): any;
@@ -1,2 +1,3 @@
1
1
  export const __esModule: boolean;
2
2
  export function processTransformProps(m3: any, props: any): void;
3
+ export function processTransformProps2(Skia: any, props: any): any;
@@ -1,4 +1,6 @@
1
1
  export const __esModule: boolean;
2
+ export const HAS_REANIMATED: any;
3
+ export const HAS_REANIMATED_3: any;
2
4
  export function bindReanimatedProps(container: any, node: any, reanimatedProps: any): void;
3
5
  export function extractReanimatedProps(props: any): any[];
4
6
  export function unbindReanimatedNode(node: any): void;
@@ -1,6 +1,5 @@
1
1
  export const __esModule: boolean;
2
2
  export namespace skHostConfig {
3
- let now: () => number;
4
3
  let supportsMutation: boolean;
5
4
  let isPrimaryRenderer: boolean;
6
5
  let supportsPersistence: boolean;
@@ -34,5 +33,8 @@ export namespace skHostConfig {
34
33
  function beforeActiveInstanceBlur(): void;
35
34
  function afterActiveInstanceBlur(): void;
36
35
  function detachDeletedInstance(): void;
36
+ function getInstanceFromNode(_node: any): null;
37
+ function prepareScopeUpdate(_scopeInstance: any, _instance: any): void;
38
+ function getInstanceFromScope(_scopeInstance: any): null;
37
39
  }
38
40
  export function debug(...args: any[]): void;
@@ -0,0 +1,16 @@
1
+ export const __esModule: boolean;
2
+ export class Container {
3
+ constructor(Skia: any, nativeId: any);
4
+ Skia: any;
5
+ nativeId: any;
6
+ set root(root: any);
7
+ get root(): any;
8
+ mapperId: any;
9
+ _root: any;
10
+ clear(): void;
11
+ redraw(): void;
12
+ getNativeId(): any;
13
+ unregisterValues(values: any): void;
14
+ registerValues(values: any): void;
15
+ drawOnCanvas(canvas: any): void;
16
+ }
@@ -0,0 +1,26 @@
1
+ export const __esModule: boolean;
2
+ export class DrawingContext {
3
+ constructor(Skia: any, canvas: any);
4
+ Skia: any;
5
+ canvas: any;
6
+ paints: any[];
7
+ declCtx: any;
8
+ save(): void;
9
+ restore(): void;
10
+ get paint(): any;
11
+ getLocalPaints(): any[];
12
+ processPaint({ opacity, color, strokeWidth, blendMode, style, strokeJoin, strokeCap, strokeMiter, antiAlias, dither, paint: paintProp }: {
13
+ opacity: any;
14
+ color: any;
15
+ strokeWidth: any;
16
+ blendMode: any;
17
+ style: any;
18
+ strokeJoin: any;
19
+ strokeCap: any;
20
+ strokeMiter: any;
21
+ antiAlias: any;
22
+ dither: any;
23
+ paint: any;
24
+ }): boolean;
25
+ processMatrixAndClipping(props: any, layer: any): boolean;
26
+ }