@shopify/react-native-skia 1.8.0 → 1.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (390) hide show
  1. package/cpp/api/JsiSkPaint.h +8 -1
  2. package/lib/commonjs/dom/types/Common.d.ts +6 -4
  3. package/lib/commonjs/dom/types/Common.js.map +1 -1
  4. package/lib/commonjs/dom/types/ImageFilters.d.ts +1 -1
  5. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
  6. package/lib/commonjs/dom/types/Node.d.ts +0 -2
  7. package/lib/commonjs/dom/types/Node.js.map +1 -1
  8. package/lib/commonjs/external/reanimated/index.d.ts +0 -1
  9. package/lib/commonjs/external/reanimated/index.js +0 -11
  10. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  11. package/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -1
  12. package/lib/commonjs/external/reanimated/renderHelpers.js +5 -43
  13. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  14. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +1 -8
  15. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
  16. package/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
  17. package/lib/commonjs/skia/core/AnimatedImage.js +1 -1
  18. package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
  19. package/lib/commonjs/skia/core/Data.d.ts +1 -1
  20. package/lib/commonjs/skia/core/Data.js +2 -8
  21. package/lib/commonjs/skia/core/Data.js.map +1 -1
  22. package/lib/commonjs/skia/types/Paint/Paint.d.ts +1 -0
  23. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  24. package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  25. package/lib/commonjs/skia/web/JsiSkPaint.js +3 -0
  26. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  27. package/lib/commonjs/sksg/Container.d.ts +3 -2
  28. package/lib/commonjs/sksg/Container.js +32 -26
  29. package/lib/commonjs/sksg/Container.js.map +1 -1
  30. package/lib/commonjs/sksg/HostConfig.d.ts +2 -2
  31. package/lib/commonjs/sksg/HostConfig.js +7 -25
  32. package/lib/commonjs/sksg/HostConfig.js.map +1 -1
  33. package/lib/commonjs/sksg/Node.d.ts +19 -0
  34. package/lib/commonjs/sksg/Node.js +78 -0
  35. package/lib/commonjs/sksg/Node.js.map +1 -0
  36. package/lib/commonjs/sksg/Reconciler.d.ts +1 -1
  37. package/lib/commonjs/sksg/Recorder/Core.d.ts +79 -0
  38. package/lib/commonjs/sksg/Recorder/Core.js +110 -0
  39. package/lib/commonjs/sksg/Recorder/Core.js.map +1 -0
  40. package/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +18 -0
  41. package/lib/commonjs/sksg/Recorder/DrawingContext.js +105 -0
  42. package/lib/commonjs/sksg/Recorder/DrawingContext.js.map +1 -0
  43. package/lib/commonjs/sksg/Recorder/Player.d.ts +3 -0
  44. package/lib/commonjs/sksg/Recorder/Player.js +127 -0
  45. package/lib/commonjs/sksg/Recorder/Player.js.map +1 -0
  46. package/lib/commonjs/sksg/Recorder/Recorder.d.ts +50 -0
  47. package/lib/commonjs/sksg/Recorder/Recorder.js +288 -0
  48. package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -0
  49. package/lib/commonjs/sksg/Recorder/Recording.d.ts +7 -0
  50. package/lib/commonjs/sksg/Recorder/Recording.js +12 -0
  51. package/lib/commonjs/sksg/Recorder/Recording.js.map +1 -0
  52. package/lib/commonjs/sksg/Recorder/Visitor.d.ts +5 -0
  53. package/lib/commonjs/sksg/Recorder/Visitor.js +293 -0
  54. package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -0
  55. package/lib/commonjs/sksg/Recorder/commands/Box.d.ts +13 -0
  56. package/lib/commonjs/sksg/Recorder/commands/Box.js +71 -0
  57. package/lib/commonjs/sksg/Recorder/commands/Box.js.map +1 -0
  58. package/lib/commonjs/sksg/Recorder/commands/CTM.d.ts +3 -0
  59. package/lib/commonjs/sksg/Recorder/commands/CTM.js +79 -0
  60. package/lib/commonjs/sksg/Recorder/commands/CTM.js.map +1 -0
  61. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  62. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.js +76 -0
  63. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.js.map +1 -0
  64. package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +24 -0
  65. package/lib/commonjs/sksg/{nodes/drawings.js → Recorder/commands/Drawing.js} +5 -5
  66. package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -0
  67. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  68. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +183 -0
  69. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -0
  70. package/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +4 -0
  71. package/lib/commonjs/sksg/Recorder/commands/Paint.js +70 -0
  72. package/lib/commonjs/sksg/Recorder/commands/Paint.js.map +1 -0
  73. package/lib/commonjs/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  74. package/lib/commonjs/sksg/Recorder/commands/PathEffects.js +137 -0
  75. package/lib/commonjs/sksg/Recorder/commands/PathEffects.js.map +1 -0
  76. package/lib/commonjs/sksg/Recorder/commands/Shaders.d.ts +5 -0
  77. package/lib/commonjs/sksg/{nodes/shaders.js → Recorder/commands/Shaders.js} +58 -15
  78. package/lib/commonjs/sksg/Recorder/commands/Shaders.js.map +1 -0
  79. package/lib/commonjs/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  80. package/lib/commonjs/sksg/{nodes/utils.js → utils.js} +12 -2
  81. package/lib/commonjs/sksg/utils.js.map +1 -0
  82. package/lib/module/dom/types/Common.d.ts +6 -4
  83. package/lib/module/dom/types/Common.js.map +1 -1
  84. package/lib/module/dom/types/ImageFilters.d.ts +1 -1
  85. package/lib/module/dom/types/ImageFilters.js.map +1 -1
  86. package/lib/module/dom/types/Node.d.ts +0 -2
  87. package/lib/module/dom/types/Node.js.map +1 -1
  88. package/lib/module/external/reanimated/index.d.ts +0 -1
  89. package/lib/module/external/reanimated/index.js +0 -1
  90. package/lib/module/external/reanimated/index.js.map +1 -1
  91. package/lib/module/external/reanimated/renderHelpers.d.ts +0 -1
  92. package/lib/module/external/reanimated/renderHelpers.js +4 -42
  93. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  94. package/lib/module/external/reanimated/useAnimatedImageValue.js +1 -8
  95. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
  96. package/lib/module/skia/core/AnimatedImage.d.ts +1 -1
  97. package/lib/module/skia/core/AnimatedImage.js +1 -1
  98. package/lib/module/skia/core/AnimatedImage.js.map +1 -1
  99. package/lib/module/skia/core/Data.d.ts +1 -1
  100. package/lib/module/skia/core/Data.js +2 -8
  101. package/lib/module/skia/core/Data.js.map +1 -1
  102. package/lib/module/skia/types/Paint/Paint.d.ts +1 -0
  103. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  104. package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  105. package/lib/module/skia/web/JsiSkPaint.js +3 -0
  106. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  107. package/lib/module/sksg/Container.d.ts +3 -2
  108. package/lib/module/sksg/Container.js +30 -24
  109. package/lib/module/sksg/Container.js.map +1 -1
  110. package/lib/module/sksg/HostConfig.d.ts +2 -2
  111. package/lib/module/sksg/HostConfig.js +7 -25
  112. package/lib/module/sksg/HostConfig.js.map +1 -1
  113. package/lib/module/sksg/Node.d.ts +19 -0
  114. package/lib/module/sksg/Node.js +67 -0
  115. package/lib/module/sksg/Node.js.map +1 -0
  116. package/lib/module/sksg/Reconciler.d.ts +1 -1
  117. package/lib/module/sksg/Recorder/Core.d.ts +79 -0
  118. package/lib/module/sksg/Recorder/Core.js +101 -0
  119. package/lib/module/sksg/Recorder/Core.js.map +1 -0
  120. package/lib/module/sksg/Recorder/DrawingContext.d.ts +18 -0
  121. package/lib/module/sksg/Recorder/DrawingContext.js +98 -0
  122. package/lib/module/sksg/Recorder/DrawingContext.js.map +1 -0
  123. package/lib/module/sksg/Recorder/Player.d.ts +3 -0
  124. package/lib/module/sksg/Recorder/Player.js +120 -0
  125. package/lib/module/sksg/Recorder/Player.js.map +1 -0
  126. package/lib/module/sksg/Recorder/Recorder.d.ts +50 -0
  127. package/lib/module/sksg/Recorder/Recorder.js +281 -0
  128. package/lib/module/sksg/Recorder/Recorder.js.map +1 -0
  129. package/lib/module/sksg/Recorder/Recording.d.ts +7 -0
  130. package/lib/module/sksg/Recorder/Recording.js +5 -0
  131. package/lib/module/sksg/Recorder/Recording.js.map +1 -0
  132. package/lib/module/sksg/Recorder/Visitor.d.ts +5 -0
  133. package/lib/module/sksg/Recorder/Visitor.js +285 -0
  134. package/lib/module/sksg/Recorder/Visitor.js.map +1 -0
  135. package/lib/module/sksg/Recorder/commands/Box.d.ts +13 -0
  136. package/lib/module/sksg/Recorder/commands/Box.js +63 -0
  137. package/lib/module/sksg/Recorder/commands/Box.js.map +1 -0
  138. package/lib/module/sksg/Recorder/commands/CTM.d.ts +3 -0
  139. package/lib/module/sksg/Recorder/commands/CTM.js +72 -0
  140. package/lib/module/sksg/Recorder/commands/CTM.js.map +1 -0
  141. package/lib/module/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  142. package/lib/module/sksg/Recorder/commands/ColorFilters.js +67 -0
  143. package/lib/module/sksg/Recorder/commands/ColorFilters.js.map +1 -0
  144. package/lib/module/sksg/Recorder/commands/Drawing.d.ts +24 -0
  145. package/lib/module/sksg/{nodes/drawings.js → Recorder/commands/Drawing.js} +5 -5
  146. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -0
  147. package/lib/module/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  148. package/lib/module/sksg/{nodes/imageFilters.js → Recorder/commands/ImageFilters.js} +87 -95
  149. package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -0
  150. package/lib/module/sksg/Recorder/commands/Paint.d.ts +4 -0
  151. package/lib/module/sksg/Recorder/commands/Paint.js +62 -0
  152. package/lib/module/sksg/Recorder/commands/Paint.js.map +1 -0
  153. package/lib/module/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  154. package/lib/module/sksg/Recorder/commands/PathEffects.js +128 -0
  155. package/lib/module/sksg/Recorder/commands/PathEffects.js.map +1 -0
  156. package/lib/module/sksg/Recorder/commands/Shaders.d.ts +5 -0
  157. package/lib/module/sksg/{nodes/shaders.js → Recorder/commands/Shaders.js} +63 -13
  158. package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -0
  159. package/lib/module/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  160. package/lib/module/sksg/{nodes/utils.js → utils.js} +10 -1
  161. package/lib/module/sksg/utils.js.map +1 -0
  162. package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -1
  163. package/lib/typescript/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
  164. package/lib/typescript/lib/commonjs/skia/core/Data.d.ts +1 -1
  165. package/lib/typescript/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  166. package/lib/typescript/lib/commonjs/sksg/Container.d.ts +4 -0
  167. package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +1 -3
  168. package/lib/typescript/lib/commonjs/sksg/Node.d.ts +14 -0
  169. package/lib/typescript/lib/commonjs/sksg/Recorder/Core.d.ts +5 -0
  170. package/lib/typescript/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +17 -0
  171. package/lib/typescript/lib/commonjs/sksg/Recorder/Player.d.ts +2 -0
  172. package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +45 -0
  173. package/lib/typescript/lib/commonjs/sksg/Recorder/Recording.d.ts +5 -0
  174. package/lib/typescript/lib/commonjs/sksg/Recorder/Visitor.d.ts +27 -0
  175. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Box.d.ts +3 -0
  176. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/CTM.d.ts +2 -0
  177. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/ColorFilters.d.ts +4 -0
  178. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/ImageFilters.d.ts +6 -0
  179. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +14 -0
  180. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/PathEffects.d.ts +4 -0
  181. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Shaders.d.ts +3 -0
  182. package/lib/typescript/lib/commonjs/sksg/{nodes/utils.d.ts → utils.d.ts} +1 -0
  183. package/lib/typescript/lib/module/external/reanimated/index.d.ts +0 -1
  184. package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +0 -1
  185. package/lib/typescript/lib/module/mock/index.d.ts +1 -1
  186. package/lib/typescript/lib/module/skia/core/AnimatedImage.d.ts +1 -1
  187. package/lib/typescript/lib/module/skia/core/Data.d.ts +1 -1
  188. package/lib/typescript/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  189. package/lib/typescript/lib/module/sksg/Container.d.ts +4 -0
  190. package/lib/typescript/lib/module/sksg/HostConfig.d.ts +1 -3
  191. package/lib/typescript/lib/module/sksg/Node.d.ts +13 -0
  192. package/lib/typescript/lib/module/sksg/Recorder/Core.d.ts +4 -0
  193. package/lib/typescript/lib/module/sksg/Recorder/DrawingContext.d.ts +16 -0
  194. package/lib/typescript/lib/module/sksg/Recorder/Player.d.ts +1 -0
  195. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +44 -0
  196. package/lib/typescript/lib/module/sksg/Recorder/Recording.d.ts +4 -0
  197. package/lib/typescript/lib/module/sksg/Recorder/Visitor.d.ts +26 -0
  198. package/lib/typescript/lib/module/sksg/Recorder/commands/Box.d.ts +2 -0
  199. package/lib/typescript/lib/module/sksg/Recorder/commands/CTM.d.ts +1 -0
  200. package/lib/typescript/lib/module/sksg/Recorder/commands/ColorFilters.d.ts +3 -0
  201. package/lib/typescript/lib/module/sksg/Recorder/commands/ImageFilters.d.ts +5 -0
  202. package/lib/typescript/lib/module/sksg/Recorder/commands/Paint.d.ts +13 -0
  203. package/lib/typescript/lib/module/sksg/Recorder/commands/PathEffects.d.ts +3 -0
  204. package/lib/typescript/lib/module/sksg/Recorder/commands/Shaders.d.ts +2 -0
  205. package/lib/typescript/lib/module/sksg/{nodes/utils.d.ts → utils.d.ts} +1 -0
  206. package/lib/typescript/src/dom/types/Common.d.ts +6 -4
  207. package/lib/typescript/src/dom/types/ImageFilters.d.ts +1 -1
  208. package/lib/typescript/src/dom/types/Node.d.ts +0 -2
  209. package/lib/typescript/src/external/reanimated/index.d.ts +0 -1
  210. package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +0 -1
  211. package/lib/typescript/src/skia/core/AnimatedImage.d.ts +1 -1
  212. package/lib/typescript/src/skia/core/Data.d.ts +1 -1
  213. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +1 -0
  214. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  215. package/lib/typescript/src/sksg/Container.d.ts +3 -2
  216. package/lib/typescript/src/sksg/HostConfig.d.ts +2 -2
  217. package/lib/typescript/src/sksg/Node.d.ts +19 -0
  218. package/lib/typescript/src/sksg/Reconciler.d.ts +1 -1
  219. package/lib/typescript/src/sksg/Recorder/Core.d.ts +79 -0
  220. package/lib/typescript/src/sksg/Recorder/DrawingContext.d.ts +18 -0
  221. package/lib/typescript/src/sksg/Recorder/Player.d.ts +3 -0
  222. package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +50 -0
  223. package/lib/typescript/src/sksg/Recorder/Recording.d.ts +7 -0
  224. package/lib/typescript/src/sksg/Recorder/Visitor.d.ts +5 -0
  225. package/lib/typescript/src/sksg/Recorder/commands/Box.d.ts +13 -0
  226. package/lib/typescript/src/sksg/Recorder/commands/CTM.d.ts +3 -0
  227. package/lib/typescript/src/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  228. package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +24 -0
  229. package/lib/typescript/src/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  230. package/lib/typescript/src/sksg/Recorder/commands/Paint.d.ts +4 -0
  231. package/lib/typescript/src/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  232. package/lib/typescript/src/sksg/Recorder/commands/Shaders.d.ts +5 -0
  233. package/lib/typescript/src/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  234. package/package.json +1 -1
  235. package/src/__tests__/snapshots/image-filter/test-shadow.png +0 -0
  236. package/src/dom/types/Common.ts +7 -5
  237. package/src/dom/types/ImageFilters.ts +2 -1
  238. package/src/dom/types/Node.ts +0 -4
  239. package/src/external/reanimated/index.ts +0 -1
  240. package/src/external/reanimated/renderHelpers.ts +4 -44
  241. package/src/external/reanimated/useAnimatedImageValue.ts +4 -15
  242. package/src/renderer/__tests__/e2e/ColorFilters.spec.tsx +15 -0
  243. package/src/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.tsx +23 -2
  244. package/src/renderer/__tests__/e2e/ImageFilters.spec.tsx +91 -2
  245. package/src/renderer/__tests__/setup.tsx +1 -1
  246. package/src/skia/core/AnimatedImage.ts +2 -3
  247. package/src/skia/core/Data.ts +3 -9
  248. package/src/skia/types/Paint/Paint.ts +2 -0
  249. package/src/skia/web/JsiSkPaint.ts +4 -0
  250. package/src/sksg/Container.ts +35 -29
  251. package/src/sksg/HostConfig.ts +5 -50
  252. package/src/sksg/Node.ts +105 -0
  253. package/src/sksg/Recorder/Core.ts +171 -0
  254. package/src/sksg/Recorder/DrawingContext.ts +130 -0
  255. package/src/sksg/Recorder/Player.ts +160 -0
  256. package/src/sksg/Recorder/Recorder.ts +259 -0
  257. package/src/sksg/Recorder/Recording.ts +13 -0
  258. package/src/sksg/Recorder/Visitor.ts +324 -0
  259. package/src/sksg/Recorder/commands/Box.ts +63 -0
  260. package/src/sksg/Recorder/commands/CTM.ts +72 -0
  261. package/src/sksg/Recorder/commands/ColorFilters.ts +87 -0
  262. package/src/sksg/{nodes/drawings.ts → Recorder/commands/Drawing.ts} +29 -65
  263. package/src/sksg/Recorder/commands/ImageFilters.ts +255 -0
  264. package/src/sksg/Recorder/commands/Paint.ts +77 -0
  265. package/src/sksg/Recorder/commands/PathEffects.ts +169 -0
  266. package/src/sksg/{nodes/shaders.ts → Recorder/commands/Shaders.ts} +100 -26
  267. package/src/sksg/{nodes/utils.ts → utils.ts} +14 -1
  268. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  269. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js +0 -24
  270. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js.map +0 -1
  271. package/lib/commonjs/sksg/DeclarationContext.d.ts +0 -56
  272. package/lib/commonjs/sksg/DeclarationContext.js +0 -77
  273. package/lib/commonjs/sksg/DeclarationContext.js.map +0 -1
  274. package/lib/commonjs/sksg/DrawingContext.d.ts +0 -13
  275. package/lib/commonjs/sksg/DrawingContext.js +0 -172
  276. package/lib/commonjs/sksg/DrawingContext.js.map +0 -1
  277. package/lib/commonjs/sksg/__tests__/Declarations.spec.d.ts +0 -1
  278. package/lib/commonjs/sksg/__tests__/MockDeclaration.d.ts +0 -57
  279. package/lib/commonjs/sksg/nodes/Node.d.ts +0 -7
  280. package/lib/commonjs/sksg/nodes/Node.js +0 -6
  281. package/lib/commonjs/sksg/nodes/Node.js.map +0 -1
  282. package/lib/commonjs/sksg/nodes/colorFilters.d.ts +0 -10
  283. package/lib/commonjs/sksg/nodes/colorFilters.js +0 -79
  284. package/lib/commonjs/sksg/nodes/colorFilters.js.map +0 -1
  285. package/lib/commonjs/sksg/nodes/context.d.ts +0 -3
  286. package/lib/commonjs/sksg/nodes/context.js +0 -394
  287. package/lib/commonjs/sksg/nodes/context.js.map +0 -1
  288. package/lib/commonjs/sksg/nodes/drawings.d.ts +0 -30
  289. package/lib/commonjs/sksg/nodes/drawings.js.map +0 -1
  290. package/lib/commonjs/sksg/nodes/imageFilters.d.ts +0 -17
  291. package/lib/commonjs/sksg/nodes/imageFilters.js +0 -197
  292. package/lib/commonjs/sksg/nodes/imageFilters.js.map +0 -1
  293. package/lib/commonjs/sksg/nodes/index.d.ts +0 -3
  294. package/lib/commonjs/sksg/nodes/index.js +0 -39
  295. package/lib/commonjs/sksg/nodes/index.js.map +0 -1
  296. package/lib/commonjs/sksg/nodes/paint.d.ts +0 -3
  297. package/lib/commonjs/sksg/nodes/paint.js +0 -81
  298. package/lib/commonjs/sksg/nodes/paint.js.map +0 -1
  299. package/lib/commonjs/sksg/nodes/pathEffects.d.ts +0 -11
  300. package/lib/commonjs/sksg/nodes/pathEffects.js +0 -111
  301. package/lib/commonjs/sksg/nodes/pathEffects.js.map +0 -1
  302. package/lib/commonjs/sksg/nodes/shaders.d.ts +0 -11
  303. package/lib/commonjs/sksg/nodes/shaders.js.map +0 -1
  304. package/lib/commonjs/sksg/nodes/utils.js.map +0 -1
  305. package/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  306. package/lib/module/external/reanimated/useDerivedValueOnJS.js +0 -16
  307. package/lib/module/external/reanimated/useDerivedValueOnJS.js.map +0 -1
  308. package/lib/module/sksg/DeclarationContext.d.ts +0 -56
  309. package/lib/module/sksg/DeclarationContext.js +0 -69
  310. package/lib/module/sksg/DeclarationContext.js.map +0 -1
  311. package/lib/module/sksg/DrawingContext.d.ts +0 -13
  312. package/lib/module/sksg/DrawingContext.js +0 -165
  313. package/lib/module/sksg/DrawingContext.js.map +0 -1
  314. package/lib/module/sksg/__tests__/Declarations.spec.d.ts +0 -1
  315. package/lib/module/sksg/__tests__/MockDeclaration.d.ts +0 -57
  316. package/lib/module/sksg/nodes/Node.d.ts +0 -7
  317. package/lib/module/sksg/nodes/Node.js +0 -2
  318. package/lib/module/sksg/nodes/Node.js.map +0 -1
  319. package/lib/module/sksg/nodes/colorFilters.d.ts +0 -10
  320. package/lib/module/sksg/nodes/colorFilters.js +0 -66
  321. package/lib/module/sksg/nodes/colorFilters.js.map +0 -1
  322. package/lib/module/sksg/nodes/context.d.ts +0 -3
  323. package/lib/module/sksg/nodes/context.js +0 -387
  324. package/lib/module/sksg/nodes/context.js.map +0 -1
  325. package/lib/module/sksg/nodes/drawings.d.ts +0 -30
  326. package/lib/module/sksg/nodes/drawings.js.map +0 -1
  327. package/lib/module/sksg/nodes/imageFilters.d.ts +0 -17
  328. package/lib/module/sksg/nodes/imageFilters.js.map +0 -1
  329. package/lib/module/sksg/nodes/index.d.ts +0 -3
  330. package/lib/module/sksg/nodes/index.js +0 -4
  331. package/lib/module/sksg/nodes/index.js.map +0 -1
  332. package/lib/module/sksg/nodes/paint.d.ts +0 -3
  333. package/lib/module/sksg/nodes/paint.js +0 -74
  334. package/lib/module/sksg/nodes/paint.js.map +0 -1
  335. package/lib/module/sksg/nodes/pathEffects.d.ts +0 -11
  336. package/lib/module/sksg/nodes/pathEffects.js +0 -97
  337. package/lib/module/sksg/nodes/pathEffects.js.map +0 -1
  338. package/lib/module/sksg/nodes/shaders.d.ts +0 -11
  339. package/lib/module/sksg/nodes/shaders.js.map +0 -1
  340. package/lib/module/sksg/nodes/utils.js.map +0 -1
  341. package/lib/typescript/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +0 -2
  342. package/lib/typescript/lib/commonjs/sksg/DeclarationContext.d.ts +0 -53
  343. package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +0 -22
  344. package/lib/typescript/lib/commonjs/sksg/nodes/Node.d.ts +0 -1
  345. package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +0 -8
  346. package/lib/typescript/lib/commonjs/sksg/nodes/context.d.ts +0 -2
  347. package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +0 -12
  348. package/lib/typescript/lib/commonjs/sksg/nodes/index.d.ts +0 -1
  349. package/lib/typescript/lib/commonjs/sksg/nodes/paint.d.ts +0 -2
  350. package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +0 -9
  351. package/lib/typescript/lib/commonjs/sksg/nodes/shaders.d.ts +0 -10
  352. package/lib/typescript/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  353. package/lib/typescript/lib/module/sksg/DeclarationContext.d.ts +0 -52
  354. package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +0 -21
  355. package/lib/typescript/lib/module/sksg/nodes/Node.d.ts +0 -1
  356. package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +0 -7
  357. package/lib/typescript/lib/module/sksg/nodes/context.d.ts +0 -1
  358. package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +0 -11
  359. package/lib/typescript/lib/module/sksg/nodes/index.d.ts +0 -3
  360. package/lib/typescript/lib/module/sksg/nodes/paint.d.ts +0 -1
  361. package/lib/typescript/lib/module/sksg/nodes/pathEffects.d.ts +0 -8
  362. package/lib/typescript/lib/module/sksg/nodes/shaders.d.ts +0 -9
  363. package/lib/typescript/src/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  364. package/lib/typescript/src/sksg/DeclarationContext.d.ts +0 -56
  365. package/lib/typescript/src/sksg/DrawingContext.d.ts +0 -13
  366. package/lib/typescript/src/sksg/__tests__/Declarations.spec.d.ts +0 -1
  367. package/lib/typescript/src/sksg/__tests__/MockDeclaration.d.ts +0 -57
  368. package/lib/typescript/src/sksg/nodes/Node.d.ts +0 -7
  369. package/lib/typescript/src/sksg/nodes/colorFilters.d.ts +0 -10
  370. package/lib/typescript/src/sksg/nodes/context.d.ts +0 -3
  371. package/lib/typescript/src/sksg/nodes/drawings.d.ts +0 -30
  372. package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +0 -17
  373. package/lib/typescript/src/sksg/nodes/index.d.ts +0 -3
  374. package/lib/typescript/src/sksg/nodes/paint.d.ts +0 -3
  375. package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +0 -11
  376. package/lib/typescript/src/sksg/nodes/shaders.d.ts +0 -11
  377. package/src/external/reanimated/useDerivedValueOnJS.ts +0 -20
  378. package/src/sksg/DeclarationContext.ts +0 -85
  379. package/src/sksg/DrawingContext.ts +0 -226
  380. package/src/sksg/__tests__/Declarations.spec.tsx +0 -235
  381. package/src/sksg/__tests__/MockDeclaration.ts +0 -138
  382. package/src/sksg/nodes/Node.ts +0 -8
  383. package/src/sksg/nodes/colorFilters.ts +0 -79
  384. package/src/sksg/nodes/context.ts +0 -412
  385. package/src/sksg/nodes/imageFilters.ts +0 -235
  386. package/src/sksg/nodes/index.ts +0 -3
  387. package/src/sksg/nodes/paint.ts +0 -75
  388. package/src/sksg/nodes/pathEffects.ts +0 -118
  389. /package/lib/typescript/lib/commonjs/sksg/{nodes/drawings.d.ts → Recorder/commands/Drawing.d.ts} +0 -0
  390. /package/lib/typescript/lib/module/sksg/{nodes/drawings.d.ts → Recorder/commands/Drawing.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","_utils","_Node","_Core","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","Recorder","constructor","processProps","props","animatedProps","hasAnimatedProps","key","prop","isSharedValue","undefined","add","command","commands","push","savePaint","type","CommandType","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","isPathEffect","Error","PushPathEffect","pushImageFilter","imageFilterType","isImageFilter","PushImageFilter","pushColorFilter","colorFilterType","isColorFilter","PushColorFilter","pushShader","shaderType","isShader","NodeType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","forEach","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas","exports"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport class Recorder {\n commands: Command[] = [];\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n props[key] = prop.value;\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.commands.push(command);\n }\n\n savePaint(props: AnimatedProps<PaintProps>) {\n this.add({ type: CommandType.SavePaint, props });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AA4BA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AAAqC,SAAAI,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAG9B,MAAMgB,QAAQ,CAAC;EAAAC,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AC;MAAEK,IAAI,EAAEC,iBAAW,CAACgF,UAAU;MAAE7F;IAAM,CAAC,CAAC;EACnD;EAEA8F,WAAWA,CAAC9F,KAAkC,EAAE;IAC9C,IAAI,CAACO,GAAG,CAAC;MAAEK,IAAI,EAAEC,iBAAW,CAACkF,WAAW;MAAE/F;IAAM,CAAC,CAAC;EACpD;EAEAgG,YAAYA,CAAChG,KAAmC,EAAE;IAChD,IAAI,CAACO,GAAG,CAAC;MAAEK,IAAI,EAAEC,iBAAW,CAACoF,YAAY;MAAEjG;IAAM,CAAC,CAAC;EACrD;EAEAkG,aAAaA,CAAClG,KAAoC,EAAE;IAClD,IAAI,CAACO,GAAG,CAAC;MAAEK,IAAI,EAAEC,iBAAW,CAACsF,aAAa;MAAEnG;IAAM,CAAC,CAAC;EACtD;EAEAoG,SAASA,CAACpG,KAAgC,EAAE;IAC1C,IAAI,CAACO,GAAG,CAAC;MAAEK,IAAI,EAAEC,iBAAW,CAACwF,SAAS;MAAErG;IAAM,CAAC,CAAC;EAClD;AACF;AAACsG,OAAA,CAAAzG,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import type { SkPaint } from "../../skia/types";
2
+ import type { Command } from "./Core";
3
+ export interface Recording {
4
+ commands: Command[];
5
+ paintPool: SkPaint[];
6
+ }
7
+ export declare const createRecording: (commands: Command[]) => Recording;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createRecording = void 0;
7
+ const createRecording = commands => ({
8
+ commands,
9
+ paintPool: []
10
+ });
11
+ exports.createRecording = createRecording;
12
+ //# sourceMappingURL=Recording.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createRecording","commands","paintPool","exports"],"sources":["Recording.ts"],"sourcesContent":["import type { SkPaint } from \"../../skia/types\";\n\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n}\n\nexport const createRecording = (commands: Command[]): Recording => ({\n commands,\n paintPool: [],\n});\n"],"mappings":";;;;;;AASO,MAAMA,eAAe,GAAIC,QAAmB,KAAiB;EAClEA,QAAQ;EACRC,SAAS,EAAE;AACb,CAAC,CAAC;AAACC,OAAA,CAAAH,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import type { DrawingNodeProps } from "../../dom/types";
2
+ import type { Node } from "../Node";
3
+ import type { Recorder } from "./Recorder";
4
+ export declare const processPaint: ({ opacity, color, strokeWidth, blendMode, style, strokeJoin, strokeCap, strokeMiter, antiAlias, dither, paint: paintRef, }: DrawingNodeProps) => DrawingNodeProps | null;
5
+ export declare const visit: (recorder: Recorder, root: Node[]) => void;
@@ -0,0 +1,293 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.visit = exports.processPaint = void 0;
7
+ var _types = require("../../dom/types");
8
+ var _Node = require("../Node");
9
+ /* eslint-disable @typescript-eslint/no-explicit-any */
10
+
11
+ const processPaint = ({
12
+ opacity,
13
+ color,
14
+ strokeWidth,
15
+ blendMode,
16
+ style,
17
+ strokeJoin,
18
+ strokeCap,
19
+ strokeMiter,
20
+ antiAlias,
21
+ dither,
22
+ paint: paintRef
23
+ }) => {
24
+ const paint = {};
25
+ if (opacity !== undefined) {
26
+ paint.opacity = opacity;
27
+ }
28
+ if (color !== undefined) {
29
+ paint.color = color;
30
+ }
31
+ if (strokeWidth !== undefined) {
32
+ paint.strokeWidth = strokeWidth;
33
+ }
34
+ if (blendMode !== undefined) {
35
+ paint.blendMode = blendMode;
36
+ }
37
+ if (style !== undefined) {
38
+ paint.style = style;
39
+ }
40
+ if (strokeJoin !== undefined) {
41
+ paint.strokeJoin = strokeJoin;
42
+ }
43
+ if (strokeCap !== undefined) {
44
+ paint.strokeCap = strokeCap;
45
+ }
46
+ if (strokeMiter !== undefined) {
47
+ paint.strokeMiter = strokeMiter;
48
+ }
49
+ if (antiAlias !== undefined) {
50
+ paint.antiAlias = antiAlias;
51
+ }
52
+ if (dither !== undefined) {
53
+ paint.dither = dither;
54
+ }
55
+ if (paintRef !== undefined) {
56
+ paint.paint = paintRef;
57
+ }
58
+ if (opacity !== undefined || color !== undefined || strokeWidth !== undefined || blendMode !== undefined || style !== undefined || strokeJoin !== undefined || strokeCap !== undefined || strokeMiter !== undefined || antiAlias !== undefined || dither !== undefined || paintRef !== undefined) {
59
+ return paint;
60
+ }
61
+ return null;
62
+ };
63
+ exports.processPaint = processPaint;
64
+ const processCTM = ({
65
+ clip,
66
+ invertClip,
67
+ transform,
68
+ origin,
69
+ matrix,
70
+ layer
71
+ }) => {
72
+ const ctm = {};
73
+ if (clip) {
74
+ ctm.clip = clip;
75
+ }
76
+ if (invertClip) {
77
+ ctm.invertClip = invertClip;
78
+ }
79
+ if (transform) {
80
+ ctm.transform = transform;
81
+ }
82
+ if (origin) {
83
+ ctm.origin = origin;
84
+ }
85
+ if (matrix) {
86
+ ctm.matrix = matrix;
87
+ }
88
+ if (layer) {
89
+ ctm.layer = layer;
90
+ }
91
+ if (clip !== undefined || invertClip !== undefined || transform !== undefined || origin !== undefined || matrix !== undefined || layer !== undefined) {
92
+ return ctm;
93
+ }
94
+ return null;
95
+ };
96
+ const pushColorFilters = (recorder, colorFilters) => {
97
+ colorFilters.forEach(colorFilter => {
98
+ if (colorFilter.children.length > 0) {
99
+ pushColorFilters(recorder, colorFilter.children);
100
+ }
101
+ recorder.pushColorFilter(colorFilter.type, colorFilter.props);
102
+ const needsComposition = colorFilter.type !== _types.NodeType.LerpColorFilter && colorFilter.children.length > 0;
103
+ if (needsComposition) {
104
+ recorder.composeColorFilter();
105
+ }
106
+ });
107
+ };
108
+ const pushPathEffects = (recorder, pathEffects) => {
109
+ pathEffects.forEach(pathEffect => {
110
+ if (pathEffect.children.length > 0) {
111
+ pushPathEffects(recorder, pathEffect.children);
112
+ }
113
+ recorder.pushPathEffect(pathEffect.type, pathEffect.props);
114
+ const needsComposition = pathEffect.type !== _types.NodeType.SumPathEffect && pathEffect.children.length > 0;
115
+ if (needsComposition) {
116
+ recorder.composePathEffect();
117
+ }
118
+ });
119
+ };
120
+ const pushImageFilters = (recorder, imageFilters) => {
121
+ imageFilters.forEach(imageFilter => {
122
+ if (imageFilter.children.length > 0) {
123
+ pushImageFilters(recorder, imageFilter.children);
124
+ }
125
+ if ((0, _Node.isImageFilter)(imageFilter.type)) {
126
+ recorder.pushImageFilter(imageFilter.type, imageFilter.props);
127
+ } else if ((0, _Node.isShader)(imageFilter.type)) {
128
+ recorder.pushShader(imageFilter.type, imageFilter.props);
129
+ }
130
+ const needsComposition = imageFilter.type !== _types.NodeType.BlendImageFilter && imageFilter.children.length > 0;
131
+ if (needsComposition) {
132
+ recorder.composeImageFilter();
133
+ }
134
+ });
135
+ };
136
+ const pushShaders = (recorder, shaders) => {
137
+ shaders.forEach(shader => {
138
+ if (shader.children.length > 0) {
139
+ pushShaders(recorder, shader.children);
140
+ }
141
+ recorder.pushShader(shader.type, shader.props);
142
+ });
143
+ };
144
+ const pushMaskFilters = (recorder, maskFilters) => {
145
+ if (maskFilters.length > 0) {
146
+ recorder.pushBlurMaskFilter(maskFilters[maskFilters.length - 1].props);
147
+ }
148
+ };
149
+ const pushPaints = (recorder, paints) => {
150
+ paints.forEach(paint => {
151
+ recorder.savePaint(paint.props);
152
+ const {
153
+ colorFilters,
154
+ maskFilters,
155
+ shaders,
156
+ imageFilters,
157
+ pathEffects
158
+ } = (0, _Node.sortNodeChildren)(paint);
159
+ pushColorFilters(recorder, colorFilters);
160
+ pushImageFilters(recorder, imageFilters);
161
+ pushMaskFilters(recorder, maskFilters);
162
+ pushShaders(recorder, shaders);
163
+ pushPathEffects(recorder, pathEffects);
164
+ recorder.restorePaintDeclaration();
165
+ });
166
+ };
167
+ const visitNode = (recorder, node) => {
168
+ const {
169
+ props
170
+ } = node;
171
+ const {
172
+ colorFilters,
173
+ maskFilters,
174
+ drawings,
175
+ shaders,
176
+ imageFilters,
177
+ pathEffects,
178
+ paints
179
+ } = (0, _Node.sortNodeChildren)(node);
180
+ const paint = processPaint(props);
181
+ const shouldPushPaint = paint || colorFilters.length > 0 || maskFilters.length > 0 || imageFilters.length > 0 || pathEffects.length > 0 || shaders.length > 0;
182
+ if (shouldPushPaint) {
183
+ recorder.savePaint(paint !== null && paint !== void 0 ? paint : {});
184
+ pushColorFilters(recorder, colorFilters);
185
+ pushImageFilters(recorder, imageFilters);
186
+ pushMaskFilters(recorder, maskFilters);
187
+ pushShaders(recorder, shaders);
188
+ pushPathEffects(recorder, pathEffects);
189
+ // For mixed nodes like BackdropFilters we don't materialize the paint
190
+ if (node.type === _types.NodeType.BackdropFilter) {
191
+ recorder.saveBackdropFilter();
192
+ } else {
193
+ recorder.materializePaint();
194
+ }
195
+ }
196
+ pushPaints(recorder, paints);
197
+ if (node.type === _types.NodeType.Layer) {
198
+ recorder.saveLayer();
199
+ }
200
+ const ctm = processCTM(props);
201
+ const shouldRestore = !!ctm || node.type === _types.NodeType.Layer;
202
+ if (ctm) {
203
+ recorder.saveCTM(ctm);
204
+ }
205
+ switch (node.type) {
206
+ case _types.NodeType.Box:
207
+ const shadows = node.children.filter(n => n.type === _types.NodeType.BoxShadow)
208
+ // eslint-disable-next-line @typescript-eslint/no-shadow
209
+ .map(({
210
+ props
211
+ }) => ({
212
+ props
213
+ }));
214
+ recorder.drawBox(props, shadows);
215
+ break;
216
+ case _types.NodeType.Fill:
217
+ recorder.drawPaint();
218
+ break;
219
+ case _types.NodeType.Image:
220
+ recorder.drawImage(node.props);
221
+ break;
222
+ case _types.NodeType.Circle:
223
+ recorder.drawCircle(node.props);
224
+ break;
225
+ case _types.NodeType.Points:
226
+ recorder.drawPoints(props);
227
+ break;
228
+ case _types.NodeType.Path:
229
+ recorder.drawPath(props);
230
+ break;
231
+ case _types.NodeType.Rect:
232
+ recorder.drawRect(props);
233
+ break;
234
+ case _types.NodeType.RRect:
235
+ recorder.drawRRect(props);
236
+ break;
237
+ case _types.NodeType.Oval:
238
+ recorder.drawOval(props);
239
+ break;
240
+ case _types.NodeType.Line:
241
+ recorder.drawLine(props);
242
+ break;
243
+ case _types.NodeType.Patch:
244
+ recorder.drawPatch(props);
245
+ break;
246
+ case _types.NodeType.Vertices:
247
+ recorder.drawVertices(props);
248
+ break;
249
+ case _types.NodeType.DiffRect:
250
+ recorder.drawDiffRect(props);
251
+ break;
252
+ case _types.NodeType.Text:
253
+ recorder.drawText(props);
254
+ break;
255
+ case _types.NodeType.TextPath:
256
+ recorder.drawTextPath(props);
257
+ break;
258
+ case _types.NodeType.TextBlob:
259
+ recorder.drawTextBlob(props);
260
+ break;
261
+ case _types.NodeType.Glyphs:
262
+ recorder.drawGlyphs(props);
263
+ break;
264
+ case _types.NodeType.Picture:
265
+ recorder.drawPicture(props);
266
+ break;
267
+ case _types.NodeType.ImageSVG:
268
+ recorder.drawImageSVG(props);
269
+ break;
270
+ case _types.NodeType.Paragraph:
271
+ recorder.drawParagraph(props);
272
+ break;
273
+ case _types.NodeType.Atlas:
274
+ recorder.drawAtlas(props);
275
+ break;
276
+ }
277
+ drawings.forEach(drawing => {
278
+ visitNode(recorder, drawing);
279
+ });
280
+ if (shouldPushPaint) {
281
+ recorder.restorePaint();
282
+ }
283
+ if (shouldRestore) {
284
+ recorder.restoreCTM();
285
+ }
286
+ };
287
+ const visit = (recorder, root) => {
288
+ root.forEach(node => {
289
+ visitNode(recorder, node);
290
+ });
291
+ };
292
+ exports.visit = visit;
293
+ //# sourceMappingURL=Visitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","_Node","processPaint","opacity","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","antiAlias","dither","paint","paintRef","undefined","exports","processCTM","clip","invertClip","transform","origin","matrix","layer","ctm","pushColorFilters","recorder","colorFilters","forEach","colorFilter","children","length","pushColorFilter","type","props","needsComposition","NodeType","LerpColorFilter","composeColorFilter","pushPathEffects","pathEffects","pathEffect","pushPathEffect","SumPathEffect","composePathEffect","pushImageFilters","imageFilters","imageFilter","isImageFilter","pushImageFilter","isShader","pushShader","BlendImageFilter","composeImageFilter","pushShaders","shaders","shader","pushMaskFilters","maskFilters","pushBlurMaskFilter","pushPaints","paints","savePaint","sortNodeChildren","restorePaintDeclaration","visitNode","node","drawings","shouldPushPaint","BackdropFilter","saveBackdropFilter","materializePaint","Layer","saveLayer","shouldRestore","saveCTM","Box","shadows","filter","n","BoxShadow","map","drawBox","Fill","drawPaint","Image","drawImage","Circle","drawCircle","Points","drawPoints","Path","drawPath","Rect","drawRect","RRect","drawRRect","Oval","drawOval","Line","drawLine","Patch","drawPatch","Vertices","drawVertices","DiffRect","drawDiffRect","Text","drawText","TextPath","drawTextPath","TextBlob","drawTextBlob","Glyphs","drawGlyphs","Picture","drawPicture","ImageSVG","drawImageSVG","Paragraph","drawParagraph","Atlas","drawAtlas","drawing","restorePaint","restoreCTM","visit","root"],"sources":["Visitor.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n CTMProps,\n DrawingNodeProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport { NodeType } from \"../../dom/types\";\nimport type { Node } from \"../Node\";\nimport { isImageFilter, isShader, sortNodeChildren } from \"../Node\";\n\nimport type { Recorder } from \"./Recorder\";\n\nexport const processPaint = ({\n opacity,\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n antiAlias,\n dither,\n paint: paintRef,\n}: DrawingNodeProps) => {\n const paint: DrawingNodeProps = {};\n if (opacity !== undefined) {\n paint.opacity = opacity;\n }\n if (color !== undefined) {\n paint.color = color;\n }\n if (strokeWidth !== undefined) {\n paint.strokeWidth = strokeWidth;\n }\n if (blendMode !== undefined) {\n paint.blendMode = blendMode;\n }\n if (style !== undefined) {\n paint.style = style;\n }\n if (strokeJoin !== undefined) {\n paint.strokeJoin = strokeJoin;\n }\n if (strokeCap !== undefined) {\n paint.strokeCap = strokeCap;\n }\n if (strokeMiter !== undefined) {\n paint.strokeMiter = strokeMiter;\n }\n if (antiAlias !== undefined) {\n paint.antiAlias = antiAlias;\n }\n if (dither !== undefined) {\n paint.dither = dither;\n }\n\n if (paintRef !== undefined) {\n paint.paint = paintRef;\n }\n\n if (\n opacity !== undefined ||\n color !== undefined ||\n strokeWidth !== undefined ||\n blendMode !== undefined ||\n style !== undefined ||\n strokeJoin !== undefined ||\n strokeCap !== undefined ||\n strokeMiter !== undefined ||\n antiAlias !== undefined ||\n dither !== undefined ||\n paintRef !== undefined\n ) {\n return paint;\n }\n return null;\n};\n\nconst processCTM = ({\n clip,\n invertClip,\n transform,\n origin,\n matrix,\n layer,\n}: CTMProps) => {\n const ctm: CTMProps = {};\n if (clip) {\n ctm.clip = clip;\n }\n if (invertClip) {\n ctm.invertClip = invertClip;\n }\n if (transform) {\n ctm.transform = transform;\n }\n if (origin) {\n ctm.origin = origin;\n }\n if (matrix) {\n ctm.matrix = matrix;\n }\n if (layer) {\n ctm.layer = layer;\n }\n if (\n clip !== undefined ||\n invertClip !== undefined ||\n transform !== undefined ||\n origin !== undefined ||\n matrix !== undefined ||\n layer !== undefined\n ) {\n return ctm;\n }\n return null;\n};\n\nconst pushColorFilters = (recorder: Recorder, colorFilters: Node<any>[]) => {\n colorFilters.forEach((colorFilter) => {\n if (colorFilter.children.length > 0) {\n pushColorFilters(recorder, colorFilter.children);\n }\n recorder.pushColorFilter(colorFilter.type, colorFilter.props);\n const needsComposition =\n colorFilter.type !== NodeType.LerpColorFilter &&\n colorFilter.children.length > 0;\n if (needsComposition) {\n recorder.composeColorFilter();\n }\n });\n};\n\nconst pushPathEffects = (recorder: Recorder, pathEffects: Node<any>[]) => {\n pathEffects.forEach((pathEffect) => {\n if (pathEffect.children.length > 0) {\n pushPathEffects(recorder, pathEffect.children);\n }\n recorder.pushPathEffect(pathEffect.type, pathEffect.props);\n const needsComposition =\n pathEffect.type !== NodeType.SumPathEffect &&\n pathEffect.children.length > 0;\n if (needsComposition) {\n recorder.composePathEffect();\n }\n });\n};\n\nconst pushImageFilters = (recorder: Recorder, imageFilters: Node<any>[]) => {\n imageFilters.forEach((imageFilter) => {\n if (imageFilter.children.length > 0) {\n pushImageFilters(recorder, imageFilter.children);\n }\n if (isImageFilter(imageFilter.type)) {\n recorder.pushImageFilter(imageFilter.type, imageFilter.props);\n } else if (isShader(imageFilter.type)) {\n recorder.pushShader(imageFilter.type, imageFilter.props);\n }\n const needsComposition =\n imageFilter.type !== NodeType.BlendImageFilter &&\n imageFilter.children.length > 0;\n if (needsComposition) {\n recorder.composeImageFilter();\n }\n });\n};\n\nconst pushShaders = (recorder: Recorder, shaders: Node<any>[]) => {\n shaders.forEach((shader) => {\n if (shader.children.length > 0) {\n pushShaders(recorder, shader.children);\n }\n recorder.pushShader(shader.type, shader.props);\n });\n};\n\nconst pushMaskFilters = (recorder: Recorder, maskFilters: Node<any>[]) => {\n if (maskFilters.length > 0) {\n recorder.pushBlurMaskFilter(maskFilters[maskFilters.length - 1].props);\n }\n};\n\nconst pushPaints = (recorder: Recorder, paints: Node<any>[]) => {\n paints.forEach((paint) => {\n recorder.savePaint(paint.props);\n const { colorFilters, maskFilters, shaders, imageFilters, pathEffects } =\n sortNodeChildren(paint);\n pushColorFilters(recorder, colorFilters);\n pushImageFilters(recorder, imageFilters);\n pushMaskFilters(recorder, maskFilters);\n pushShaders(recorder, shaders);\n pushPathEffects(recorder, pathEffects);\n recorder.restorePaintDeclaration();\n });\n};\n\nconst visitNode = (recorder: Recorder, node: Node<any>) => {\n const { props } = node;\n const {\n colorFilters,\n maskFilters,\n drawings,\n shaders,\n imageFilters,\n pathEffects,\n paints,\n } = sortNodeChildren(node);\n const paint = processPaint(props);\n const shouldPushPaint =\n paint ||\n colorFilters.length > 0 ||\n maskFilters.length > 0 ||\n imageFilters.length > 0 ||\n pathEffects.length > 0 ||\n shaders.length > 0;\n if (shouldPushPaint) {\n recorder.savePaint(paint ?? {});\n pushColorFilters(recorder, colorFilters);\n pushImageFilters(recorder, imageFilters);\n pushMaskFilters(recorder, maskFilters);\n pushShaders(recorder, shaders);\n pushPathEffects(recorder, pathEffects);\n // For mixed nodes like BackdropFilters we don't materialize the paint\n if (node.type === NodeType.BackdropFilter) {\n recorder.saveBackdropFilter();\n } else {\n recorder.materializePaint();\n }\n }\n pushPaints(recorder, paints);\n if (node.type === NodeType.Layer) {\n recorder.saveLayer();\n }\n const ctm = processCTM(props);\n const shouldRestore = !!ctm || node.type === NodeType.Layer;\n if (ctm) {\n recorder.saveCTM(ctm);\n }\n switch (node.type) {\n case NodeType.Box:\n const shadows = node.children\n .filter((n) => n.type === NodeType.BoxShadow)\n // eslint-disable-next-line @typescript-eslint/no-shadow\n .map(({ props }) => ({ props } as { props: BoxShadowProps }));\n recorder.drawBox(props, shadows);\n break;\n case NodeType.Fill:\n recorder.drawPaint();\n break;\n case NodeType.Image:\n recorder.drawImage(node.props);\n break;\n case NodeType.Circle:\n recorder.drawCircle(node.props);\n break;\n case NodeType.Points:\n recorder.drawPoints(props);\n break;\n case NodeType.Path:\n recorder.drawPath(props);\n break;\n case NodeType.Rect:\n recorder.drawRect(props);\n break;\n case NodeType.RRect:\n recorder.drawRRect(props);\n break;\n case NodeType.Oval:\n recorder.drawOval(props);\n break;\n case NodeType.Line:\n recorder.drawLine(props);\n break;\n case NodeType.Patch:\n recorder.drawPatch(props);\n break;\n case NodeType.Vertices:\n recorder.drawVertices(props);\n break;\n case NodeType.DiffRect:\n recorder.drawDiffRect(props);\n break;\n case NodeType.Text:\n recorder.drawText(props);\n break;\n case NodeType.TextPath:\n recorder.drawTextPath(props);\n break;\n case NodeType.TextBlob:\n recorder.drawTextBlob(props);\n break;\n case NodeType.Glyphs:\n recorder.drawGlyphs(props);\n break;\n case NodeType.Picture:\n recorder.drawPicture(props);\n break;\n case NodeType.ImageSVG:\n recorder.drawImageSVG(props);\n break;\n case NodeType.Paragraph:\n recorder.drawParagraph(props);\n break;\n case NodeType.Atlas:\n recorder.drawAtlas(props);\n break;\n }\n drawings.forEach((drawing) => {\n visitNode(recorder, drawing);\n });\n if (shouldPushPaint) {\n recorder.restorePaint();\n }\n if (shouldRestore) {\n recorder.restoreCTM();\n }\n};\n\nexport const visit = (recorder: Recorder, root: Node[]) => {\n root.forEach((node) => {\n visitNode(recorder, node);\n });\n};\n"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AARA;;AAYO,MAAME,YAAY,GAAGA,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,WAAW;EACXC,SAAS;EACTC,KAAK;EACLC,UAAU;EACVC,SAAS;EACTC,WAAW;EACXC,SAAS;EACTC,MAAM;EACNC,KAAK,EAAEC;AACS,CAAC,KAAK;EACtB,MAAMD,KAAuB,GAAG,CAAC,CAAC;EAClC,IAAIV,OAAO,KAAKY,SAAS,EAAE;IACzBF,KAAK,CAACV,OAAO,GAAGA,OAAO;EACzB;EACA,IAAIC,KAAK,KAAKW,SAAS,EAAE;IACvBF,KAAK,CAACT,KAAK,GAAGA,KAAK;EACrB;EACA,IAAIC,WAAW,KAAKU,SAAS,EAAE;IAC7BF,KAAK,CAACR,WAAW,GAAGA,WAAW;EACjC;EACA,IAAIC,SAAS,KAAKS,SAAS,EAAE;IAC3BF,KAAK,CAACP,SAAS,GAAGA,SAAS;EAC7B;EACA,IAAIC,KAAK,KAAKQ,SAAS,EAAE;IACvBF,KAAK,CAACN,KAAK,GAAGA,KAAK;EACrB;EACA,IAAIC,UAAU,KAAKO,SAAS,EAAE;IAC5BF,KAAK,CAACL,UAAU,GAAGA,UAAU;EAC/B;EACA,IAAIC,SAAS,KAAKM,SAAS,EAAE;IAC3BF,KAAK,CAACJ,SAAS,GAAGA,SAAS;EAC7B;EACA,IAAIC,WAAW,KAAKK,SAAS,EAAE;IAC7BF,KAAK,CAACH,WAAW,GAAGA,WAAW;EACjC;EACA,IAAIC,SAAS,KAAKI,SAAS,EAAE;IAC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,CAAC;AAAClD,OAAA,CAAA8G,KAAA,GAAAA,KAAA","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ import type { BoxProps, BoxShadowProps } from "../../../dom/types";
2
+ import type { Command } from "../Core";
3
+ import { CommandType } from "../Core";
4
+ import type { DrawingContext } from "../DrawingContext";
5
+ interface BoxCommand extends Command<CommandType.DrawBox> {
6
+ props: BoxProps;
7
+ shadows: {
8
+ props: BoxShadowProps;
9
+ }[];
10
+ }
11
+ export declare const isBoxCommand: (command: Command) => command is BoxCommand;
12
+ export declare const drawBox: (ctx: DrawingContext, command: BoxCommand) => void;
13
+ export {};
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isBoxCommand = exports.drawBox = void 0;
7
+ var _nodes = require("../../../dom/nodes");
8
+ var _types = require("../../../skia/types");
9
+ var _Core = require("../Core");
10
+ const isBoxCommand = command => {
11
+ "worklet";
12
+
13
+ return command.type === _Core.CommandType.DrawBox;
14
+ };
15
+ exports.isBoxCommand = isBoxCommand;
16
+ const drawBox = (ctx, command) => {
17
+ "worklet";
18
+
19
+ command.shadows.forEach(shadow => {
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+ (0, _Core.materializeProps)(shadow);
22
+ });
23
+ const shadows = command.shadows.map(shadow => shadow.props);
24
+ const {
25
+ paint,
26
+ Skia,
27
+ canvas
28
+ } = ctx;
29
+ const {
30
+ box: defaultBox
31
+ } = command.props;
32
+ const opacity = paint.getAlphaf();
33
+ const box = (0, _types.isRRect)(defaultBox) ? defaultBox : Skia.RRectXY(defaultBox, 0, 0);
34
+ shadows.filter(shadow => !shadow.inner).map(shadow => {
35
+ const {
36
+ color = "black",
37
+ blur,
38
+ spread = 0,
39
+ dx = 0,
40
+ dy = 0
41
+ } = shadow;
42
+ const lPaint = Skia.Paint();
43
+ lPaint.setColor(Skia.Color(color));
44
+ lPaint.setAlphaf(paint.getAlphaf() * opacity);
45
+ lPaint.setMaskFilter(Skia.MaskFilter.MakeBlur(_types.BlurStyle.Normal, blur, true));
46
+ canvas.drawRRect((0, _nodes.inflate)(Skia, box, spread, spread, dx, dy), lPaint);
47
+ });
48
+ canvas.drawRRect(box, paint);
49
+ shadows.filter(shadow => shadow.inner).map(shadow => {
50
+ const {
51
+ color = "black",
52
+ blur,
53
+ spread = 0,
54
+ dx = 0,
55
+ dy = 0
56
+ } = shadow;
57
+ const delta = Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));
58
+ canvas.save();
59
+ canvas.clipRRect(box, _types.ClipOp.Intersect, false);
60
+ const lPaint = Skia.Paint();
61
+ lPaint.setColor(Skia.Color(color));
62
+ lPaint.setAlphaf(paint.getAlphaf() * opacity);
63
+ lPaint.setMaskFilter(Skia.MaskFilter.MakeBlur(_types.BlurStyle.Normal, blur, true));
64
+ const inner = (0, _nodes.deflate)(Skia, box, spread, spread, dx, dy);
65
+ const outer = (0, _nodes.inflate)(Skia, box, delta.x, delta.y);
66
+ canvas.drawDRRect(outer, inner, lPaint);
67
+ canvas.restore();
68
+ });
69
+ };
70
+ exports.drawBox = drawBox;
71
+ //# sourceMappingURL=Box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_nodes","require","_types","_Core","isBoxCommand","command","type","CommandType","DrawBox","exports","drawBox","ctx","shadows","forEach","shadow","materializeProps","map","props","paint","Skia","canvas","box","defaultBox","opacity","getAlphaf","isRRect","RRectXY","filter","inner","color","blur","spread","dx","dy","lPaint","Paint","setColor","Color","setAlphaf","setMaskFilter","MaskFilter","MakeBlur","BlurStyle","Normal","drawRRect","inflate","delta","Point","Math","abs","save","clipRRect","ClipOp","Intersect","deflate","outer","x","y","drawDRRect","restore"],"sources":["Box.ts"],"sourcesContent":["import { deflate, inflate } from \"../../../dom/nodes\";\nimport type { BoxProps, BoxShadowProps } from \"../../../dom/types\";\nimport { BlurStyle, ClipOp, isRRect } from \"../../../skia/types\";\nimport type { Command } from \"../Core\";\nimport { CommandType, materializeProps } from \"../Core\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\ninterface BoxCommand extends Command<CommandType.DrawBox> {\n props: BoxProps;\n shadows: { props: BoxShadowProps }[];\n}\n\nexport const isBoxCommand = (command: Command): command is BoxCommand => {\n \"worklet\";\n return command.type === CommandType.DrawBox;\n};\n\nexport const drawBox = (ctx: DrawingContext, command: BoxCommand) => {\n \"worklet\";\n command.shadows.forEach((shadow) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n materializeProps(shadow as any);\n });\n const shadows = command.shadows.map((shadow) => shadow.props);\n const { paint, Skia, canvas } = ctx;\n const { box: defaultBox } = command.props;\n const opacity = paint.getAlphaf();\n const box = isRRect(defaultBox) ? defaultBox : Skia.RRectXY(defaultBox, 0, 0);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = Skia.Paint();\n lPaint.setColor(Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(inflate(Skia, box, spread, spread, dx, dy), lPaint);\n });\n\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = Skia.Paint();\n lPaint.setColor(Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(Skia, box, spread, spread, dx, dy);\n const outer = inflate(Skia, box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n};\n"],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SAAS,CAAC,CAAC,GAAGD,OAAO,CAAC;IAE7CW,MAAM,CAACK,aAAa,CAClBpB,IAAI,CAACqB,UAAU,CAACC,QAAQ,CAACC,gBAAS,CAACC,MAAM,EAAEb,IAAI,EAAE,IAAI,CACvD,CAAC;IACD,MAAMF,KAAK,GAAG,IAAA0B,cAAO,EAACnC,IAAI,EAAEE,GAAG,EAAEU,MAAM,EAAEA,MAAM,EAAEC,EAAE,EAAEC,EAAE,CAAC;IACxD,MAAMsB,KAAK,GAAG,IAAAV,cAAO,EAAC1B,IAAI,EAAEE,GAAG,EAAEyB,KAAK,CAACU,CAAC,EAAEV,KAAK,CAACW,CAAC,CAAC;IAClDrC,MAAM,CAACsC,UAAU,CAACH,KAAK,EAAE3B,KAAK,EAAEM,MAAM,CAAC;IACvCd,MAAM,CAACuC,OAAO,CAAC,CAAC;EAClB,CAAC,CAAC;AACN,CAAC;AAAClD,OAAA,CAAAC,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import type { CTMProps } from "../../../dom/types";
2
+ import type { DrawingContext } from "../DrawingContext";
3
+ export declare const saveCTM: (ctx: DrawingContext, props: CTMProps) => void;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.saveCTM = void 0;
7
+ var _nodes = require("../../../dom/nodes");
8
+ var _types = require("../../../skia/types");
9
+ const computeClip = (Skia, clip) => {
10
+ "worklet";
11
+
12
+ if (clip) {
13
+ if ((0, _nodes.isPathDef)(clip)) {
14
+ return {
15
+ clipPath: (0, _nodes.processPath)(Skia, clip)
16
+ };
17
+ } else if ((0, _types.isRRect)(clip)) {
18
+ return {
19
+ clipRRect: clip
20
+ };
21
+ } else {
22
+ return {
23
+ clipRect: clip
24
+ };
25
+ }
26
+ }
27
+ return undefined;
28
+ };
29
+ const saveCTM = (ctx, props) => {
30
+ "worklet";
31
+
32
+ const {
33
+ canvas,
34
+ Skia
35
+ } = ctx;
36
+ const {
37
+ clip: rawClip,
38
+ invertClip,
39
+ matrix,
40
+ transform,
41
+ origin,
42
+ layer
43
+ } = props;
44
+ const hasTransform = matrix !== undefined || transform !== undefined;
45
+ const clip = computeClip(Skia, rawClip);
46
+ const hasClip = clip !== undefined;
47
+ const op = invertClip ? _types.ClipOp.Difference : _types.ClipOp.Intersect;
48
+ const m3 = (0, _nodes.processTransformProps2)(Skia, {
49
+ matrix,
50
+ transform,
51
+ origin
52
+ });
53
+ const shouldSave = hasTransform || hasClip || !!layer;
54
+ if (shouldSave) {
55
+ if (layer) {
56
+ if (typeof layer === "boolean") {
57
+ canvas.saveLayer();
58
+ } else {
59
+ canvas.saveLayer(layer);
60
+ }
61
+ } else {
62
+ canvas.save();
63
+ }
64
+ }
65
+ if (m3) {
66
+ canvas.concat(m3);
67
+ }
68
+ if (clip) {
69
+ if ("clipRect" in clip) {
70
+ canvas.clipRect(clip.clipRect, op, true);
71
+ } else if ("clipRRect" in clip) {
72
+ canvas.clipRRect(clip.clipRRect, op, true);
73
+ } else {
74
+ canvas.clipPath(clip.clipPath, op, true);
75
+ }
76
+ }
77
+ };
78
+ exports.saveCTM = saveCTM;
79
+ //# sourceMappingURL=CTM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_nodes","require","_types","computeClip","Skia","clip","isPathDef","clipPath","processPath","isRRect","clipRRect","clipRect","undefined","saveCTM","ctx","props","canvas","rawClip","invertClip","matrix","transform","origin","layer","hasTransform","hasClip","op","ClipOp","Difference","Intersect","m3","processTransformProps2","shouldSave","saveLayer","save","concat","exports"],"sources":["CTM.ts"],"sourcesContent":["import {\n isPathDef,\n processPath,\n processTransformProps2,\n} from \"../../../dom/nodes\";\nimport type { ClipDef, CTMProps } from \"../../../dom/types\";\nimport type { Skia, SkPath, SkRect, SkRRect } from \"../../../skia/types\";\nimport { ClipOp, isRRect } from \"../../../skia/types\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nconst computeClip = (\n Skia: Skia,\n clip: ClipDef | undefined\n):\n | undefined\n | { clipPath: SkPath }\n | { clipRect: SkRect }\n | { clipRRect: SkRRect } => {\n \"worklet\";\n if (clip) {\n if (isPathDef(clip)) {\n return { clipPath: processPath(Skia, clip) };\n } else if (isRRect(clip)) {\n return { clipRRect: clip };\n } else {\n return { clipRect: clip };\n }\n }\n return undefined;\n};\n\nexport const saveCTM = (ctx: DrawingContext, props: CTMProps) => {\n \"worklet\";\n const { canvas, Skia } = ctx;\n const {\n clip: rawClip,\n invertClip,\n matrix,\n transform,\n origin,\n layer,\n } = props as CTMProps;\n const hasTransform = matrix !== undefined || transform !== undefined;\n const clip = computeClip(Skia, rawClip);\n const hasClip = clip !== undefined;\n const op = invertClip ? ClipOp.Difference : ClipOp.Intersect;\n const m3 = processTransformProps2(Skia, { matrix, transform, origin });\n const shouldSave = hasTransform || hasClip || !!layer;\n if (shouldSave) {\n if (layer) {\n if (typeof layer === \"boolean\") {\n canvas.saveLayer();\n } else {\n canvas.saveLayer(layer);\n }\n } else {\n canvas.save();\n }\n }\n if (m3) {\n canvas.concat(m3);\n }\n if (clip) {\n if (\"clipRect\" in clip) {\n canvas.clipRect(clip.clipRect, op, true);\n } else if (\"clipRRect\" in clip) {\n canvas.clipRRect(clip.clipRRect, op, true);\n } else {\n canvas.clipPath(clip.clipPath, op, true);\n }\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAD,OAAA;AAGA,MAAME,WAAW,GAAGA,CAClBC,IAAU,EACVC,IAAyB,KAKG;EAC5B,SAAS;;EACT,IAAIA,IAAI,EAAE;IACR,IAAI,IAAAC,gBAAS,EAACD,IAAI,CAAC,EAAE;MACnB,OAAO;QAAEE,QAAQ,EAAE,IAAAC,kBAAW,EAACJ,IAAI,EAAEC,IAAI;MAAE,CAAC;IAC9C,CAAC,MAAM,IAAI,IAAAI,cAAO,EAACJ,IAAI,CAAC,EAAE;MACxB,OAAO;QA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,EAAE;MACtBW,MAAM,CAACL,QAAQ,CAACN,IAAI,CAACM,QAAQ,EAAEc,EAAE,EAAE,IAAI,CAAC;IAC1C,CAAC,MAAM,IAAI,WAAW,IAAIpB,IAAI,EAAE;MAC9BW,MAAM,CAACN,SAAS,CAACL,IAAI,CAACK,SAAS,EAAEe,EAAE,EAAE,IAAI,CAAC;IAC5C,CAAC,MAAM;MACLT,MAAM,CAACT,QAAQ,CAACF,IAAI,CAACE,QAAQ,EAAEkB,EAAE,EAAE,IAAI,CAAC;IAC1C;EACF;AACF,CAAC;AAACU,OAAA,CAAAtB,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import { CommandType } from "../Core";
2
+ import type { Command } from "../Core";
3
+ import type { DrawingContext } from "../DrawingContext";
4
+ export declare const isPushColorFilter: (command: Command) => command is Command<CommandType.PushColorFilter>;
5
+ export declare const composeColorFilters: (ctx: DrawingContext) => void;
6
+ export declare const pushColorFilter: (ctx: DrawingContext, command: Command<CommandType.PushColorFilter>) => void;