@shopify/react-native-skia 0.1.116 → 0.1.120

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. package/cpp/api/JsiSkApi.h +13 -9
  2. package/cpp/api/JsiSkCanvas.h +9 -1
  3. package/cpp/api/JsiSkPicture.h +71 -0
  4. package/cpp/api/JsiSkPictureFactory.h +50 -0
  5. package/cpp/api/JsiSkPictureRecorder.h +53 -0
  6. package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +3 -6
  7. package/ios/RNSkia-iOS/RNSkDrawViewImpl.mm +2 -4
  8. package/ios/RNSkia-iOS/SkiaDrawView.mm +3 -2
  9. package/lib/commonjs/renderer/Canvas.js +22 -36
  10. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  11. package/lib/commonjs/renderer/HostConfig.js +3 -25
  12. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  13. package/lib/commonjs/renderer/components/{Defs.js → Drawing.js} +13 -12
  14. package/lib/commonjs/renderer/components/Drawing.js.map +1 -0
  15. package/lib/commonjs/renderer/components/Group.js +7 -4
  16. package/lib/commonjs/renderer/components/Group.js.map +1 -1
  17. package/lib/commonjs/renderer/components/Paint.js +1 -21
  18. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  19. package/lib/commonjs/renderer/components/Picture.js +35 -0
  20. package/lib/commonjs/renderer/components/Picture.js.map +1 -0
  21. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +5 -34
  22. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +1 -1
  23. package/lib/commonjs/renderer/components/imageFilters/{DropShadow.js → Shadow.js} +19 -8
  24. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -0
  25. package/lib/commonjs/renderer/components/imageFilters/index.js +4 -17
  26. package/lib/commonjs/renderer/components/imageFilters/index.js.map +1 -1
  27. package/lib/commonjs/renderer/components/index.js +17 -4
  28. package/lib/commonjs/renderer/components/index.js.map +1 -1
  29. package/lib/commonjs/renderer/components/maskFilters/Blur.js +1 -1
  30. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  31. package/lib/commonjs/renderer/components/shapes/Box.js +126 -0
  32. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -0
  33. package/lib/commonjs/renderer/components/shapes/index.js +13 -0
  34. package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
  35. package/lib/commonjs/renderer/index.js +13 -0
  36. package/lib/commonjs/renderer/index.js.map +1 -1
  37. package/lib/commonjs/renderer/nodes/Declaration.js +12 -1
  38. package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
  39. package/lib/commonjs/renderer/nodes/Drawing.js +9 -24
  40. package/lib/commonjs/renderer/nodes/Drawing.js.map +1 -1
  41. package/lib/commonjs/renderer/nodes/Node.js +9 -16
  42. package/lib/commonjs/renderer/nodes/Node.js.map +1 -1
  43. package/lib/commonjs/renderer/processors/Paint.js +24 -26
  44. package/lib/commonjs/renderer/processors/Paint.js.map +1 -1
  45. package/lib/commonjs/renderer/processors/math/Math.js +19 -1
  46. package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
  47. package/lib/commonjs/renderer/processors/math/Matrix3.js +11 -5
  48. package/lib/commonjs/renderer/processors/math/Matrix3.js.map +1 -1
  49. package/lib/commonjs/renderer/typeddash.js +26 -2
  50. package/lib/commonjs/renderer/typeddash.js.map +1 -1
  51. package/lib/commonjs/renderer/useContextBridge.js +35 -0
  52. package/lib/commonjs/renderer/useContextBridge.js.map +1 -0
  53. package/lib/commonjs/skia/Canvas.js.map +1 -1
  54. package/lib/commonjs/skia/Picture/Picture.js +6 -0
  55. package/lib/commonjs/skia/Picture/Picture.js.map +1 -0
  56. package/lib/commonjs/skia/Picture/PictureFactory.js +6 -0
  57. package/lib/commonjs/skia/Picture/PictureFactory.js.map +1 -0
  58. package/lib/commonjs/skia/Picture/PictureRecorder.js +6 -0
  59. package/lib/commonjs/skia/Picture/PictureRecorder.js.map +1 -0
  60. package/lib/commonjs/skia/Picture/index.js +58 -0
  61. package/lib/commonjs/skia/Picture/index.js.map +1 -0
  62. package/lib/commonjs/skia/Picture/usePicture.js +30 -0
  63. package/lib/commonjs/skia/Picture/usePicture.js.map +1 -0
  64. package/lib/commonjs/skia/Skia.js +2 -0
  65. package/lib/commonjs/skia/Skia.js.map +1 -1
  66. package/lib/commonjs/skia/index.js +14 -0
  67. package/lib/commonjs/skia/index.js.map +1 -1
  68. package/lib/commonjs/values/hooks/useDerivedValue.js +2 -2
  69. package/lib/commonjs/values/hooks/useDerivedValue.js.map +1 -1
  70. package/lib/commonjs/views/SkiaView.js +6 -5
  71. package/lib/commonjs/views/SkiaView.js.map +1 -1
  72. package/lib/commonjs/views/types.js.map +1 -1
  73. package/lib/module/renderer/Canvas.js +20 -32
  74. package/lib/module/renderer/Canvas.js.map +1 -1
  75. package/lib/module/renderer/HostConfig.js +2 -24
  76. package/lib/module/renderer/HostConfig.js.map +1 -1
  77. package/lib/module/renderer/components/Drawing.js +17 -0
  78. package/lib/module/renderer/components/Drawing.js.map +1 -0
  79. package/lib/module/renderer/components/Group.js +8 -6
  80. package/lib/module/renderer/components/Group.js.map +1 -1
  81. package/lib/module/renderer/components/Paint.js +2 -22
  82. package/lib/module/renderer/components/Paint.js.map +1 -1
  83. package/lib/module/renderer/components/Picture.js +21 -0
  84. package/lib/module/renderer/components/Picture.js.map +1 -0
  85. package/lib/module/renderer/components/imageFilters/InnerShadow.js +4 -26
  86. package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +1 -1
  87. package/lib/module/renderer/components/imageFilters/{DropShadow.js → Shadow.js} +16 -6
  88. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -0
  89. package/lib/module/renderer/components/imageFilters/index.js +1 -2
  90. package/lib/module/renderer/components/imageFilters/index.js.map +1 -1
  91. package/lib/module/renderer/components/index.js +2 -1
  92. package/lib/module/renderer/components/index.js.map +1 -1
  93. package/lib/module/renderer/components/maskFilters/Blur.js +1 -1
  94. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  95. package/lib/module/renderer/components/shapes/Box.js +102 -0
  96. package/lib/module/renderer/components/shapes/Box.js.map +1 -0
  97. package/lib/module/renderer/components/shapes/index.js +1 -0
  98. package/lib/module/renderer/components/shapes/index.js.map +1 -1
  99. package/lib/module/renderer/index.js +1 -0
  100. package/lib/module/renderer/index.js.map +1 -1
  101. package/lib/module/renderer/nodes/Declaration.js +4 -0
  102. package/lib/module/renderer/nodes/Declaration.js.map +1 -1
  103. package/lib/module/renderer/nodes/Drawing.js +8 -21
  104. package/lib/module/renderer/nodes/Drawing.js.map +1 -1
  105. package/lib/module/renderer/nodes/Node.js +9 -15
  106. package/lib/module/renderer/nodes/Node.js.map +1 -1
  107. package/lib/module/renderer/processors/Paint.js +22 -21
  108. package/lib/module/renderer/processors/Paint.js.map +1 -1
  109. package/lib/module/renderer/processors/math/Math.js +15 -0
  110. package/lib/module/renderer/processors/math/Math.js.map +1 -1
  111. package/lib/module/renderer/processors/math/Matrix3.js +6 -2
  112. package/lib/module/renderer/processors/math/Matrix3.js.map +1 -1
  113. package/lib/module/renderer/typeddash.js +21 -0
  114. package/lib/module/renderer/typeddash.js.map +1 -1
  115. package/lib/module/renderer/useContextBridge.js +21 -0
  116. package/lib/module/renderer/useContextBridge.js.map +1 -0
  117. package/lib/module/skia/Canvas.js.map +1 -1
  118. package/lib/module/skia/Picture/Picture.js +2 -0
  119. package/lib/module/skia/Picture/Picture.js.map +1 -0
  120. package/lib/module/skia/Picture/PictureFactory.js +2 -0
  121. package/lib/module/skia/Picture/PictureFactory.js.map +1 -0
  122. package/lib/module/skia/Picture/PictureRecorder.js +2 -0
  123. package/lib/module/skia/Picture/PictureRecorder.js.map +1 -0
  124. package/lib/module/skia/Picture/index.js +5 -0
  125. package/lib/module/skia/Picture/index.js.map +1 -0
  126. package/lib/module/skia/Picture/usePicture.js +19 -0
  127. package/lib/module/skia/Picture/usePicture.js.map +1 -0
  128. package/lib/module/skia/Skia.js +2 -0
  129. package/lib/module/skia/Skia.js.map +1 -1
  130. package/lib/module/skia/index.js +1 -0
  131. package/lib/module/skia/index.js.map +1 -1
  132. package/lib/module/values/hooks/useDerivedValue.js +1 -1
  133. package/lib/module/values/hooks/useDerivedValue.js.map +1 -1
  134. package/lib/module/views/SkiaView.js +6 -5
  135. package/lib/module/views/SkiaView.js.map +1 -1
  136. package/lib/module/views/types.js.map +1 -1
  137. package/lib/typescript/src/renderer/Canvas.d.ts +5 -10
  138. package/lib/typescript/src/renderer/components/Drawing.d.ts +7 -0
  139. package/lib/typescript/src/renderer/components/Picture.d.ts +6 -0
  140. package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +3 -12
  141. package/lib/typescript/src/renderer/components/imageFilters/{DropShadow.d.ts → Shadow.d.ts} +3 -2
  142. package/lib/typescript/src/renderer/components/imageFilters/index.d.ts +1 -2
  143. package/lib/typescript/src/renderer/components/index.d.ts +2 -1
  144. package/lib/typescript/src/renderer/components/shapes/Box.d.ts +23 -0
  145. package/lib/typescript/src/renderer/components/shapes/index.d.ts +1 -0
  146. package/lib/typescript/src/renderer/index.d.ts +1 -0
  147. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +3 -0
  148. package/lib/typescript/src/renderer/nodes/Drawing.d.ts +2 -2
  149. package/lib/typescript/src/renderer/nodes/Node.d.ts +2 -2
  150. package/lib/typescript/src/renderer/processors/Paint.d.ts +2 -2
  151. package/lib/typescript/src/renderer/processors/math/Math.d.ts +14 -0
  152. package/lib/typescript/src/renderer/processors/math/Matrix3.d.ts +1 -0
  153. package/lib/typescript/src/renderer/typeddash.d.ts +1 -0
  154. package/lib/typescript/src/renderer/useContextBridge.d.ts +5 -0
  155. package/lib/typescript/src/skia/Canvas.d.ts +6 -0
  156. package/lib/typescript/src/skia/Picture/Picture.d.ts +26 -0
  157. package/lib/typescript/src/skia/Picture/PictureFactory.d.ts +8 -0
  158. package/lib/typescript/src/skia/Picture/PictureRecorder.d.ts +15 -0
  159. package/lib/typescript/src/skia/Picture/index.d.ts +4 -0
  160. package/lib/typescript/src/skia/Picture/usePicture.d.ts +11 -0
  161. package/lib/typescript/src/skia/Skia.d.ts +5 -0
  162. package/lib/typescript/src/skia/index.d.ts +1 -0
  163. package/lib/typescript/src/views/SkiaView.d.ts +25 -1
  164. package/lib/typescript/src/views/types.d.ts +0 -24
  165. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  166. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  167. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  168. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  169. package/libs/ios/libsvg.xcframework/Info.plist +5 -5
  170. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  171. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  172. package/package.json +1 -1
  173. package/src/renderer/Canvas.tsx +14 -30
  174. package/src/renderer/HostConfig.ts +2 -20
  175. package/src/renderer/components/Drawing.tsx +16 -0
  176. package/src/renderer/components/Group.tsx +25 -15
  177. package/src/renderer/components/Paint.tsx +5 -35
  178. package/src/renderer/components/Picture.tsx +17 -0
  179. package/src/renderer/components/imageFilters/InnerShadow.tsx +33 -47
  180. package/src/renderer/components/imageFilters/Shadow.tsx +39 -0
  181. package/src/renderer/components/imageFilters/index.ts +1 -2
  182. package/src/renderer/components/index.ts +2 -1
  183. package/src/renderer/components/maskFilters/Blur.tsx +1 -1
  184. package/src/renderer/components/shapes/Box.tsx +98 -0
  185. package/src/renderer/components/shapes/index.ts +1 -0
  186. package/src/renderer/index.ts +1 -0
  187. package/src/renderer/nodes/Declaration.tsx +14 -0
  188. package/src/renderer/nodes/Drawing.tsx +16 -26
  189. package/src/renderer/nodes/Node.ts +9 -12
  190. package/src/renderer/processors/Paint.ts +34 -31
  191. package/src/renderer/processors/math/Math.ts +16 -0
  192. package/src/renderer/processors/math/Matrix3.ts +35 -31
  193. package/src/renderer/typeddash.ts +18 -0
  194. package/src/renderer/useContextBridge.tsx +21 -0
  195. package/src/skia/Canvas.ts +7 -0
  196. package/src/skia/Picture/Picture.ts +34 -0
  197. package/src/skia/Picture/PictureFactory.ts +9 -0
  198. package/src/skia/Picture/PictureRecorder.ts +18 -0
  199. package/src/skia/Picture/index.ts +4 -0
  200. package/src/skia/Picture/usePicture.ts +28 -0
  201. package/src/skia/Skia.ts +5 -0
  202. package/src/skia/index.ts +1 -0
  203. package/src/values/hooks/useDerivedValue.ts +1 -1
  204. package/src/views/SkiaView.tsx +27 -3
  205. package/src/views/types.ts +0 -25
  206. package/lib/commonjs/renderer/components/Defs.js.map +0 -1
  207. package/lib/commonjs/renderer/components/imageFilters/DropShadow.js.map +0 -1
  208. package/lib/module/renderer/components/Defs.js +0 -16
  209. package/lib/module/renderer/components/Defs.js.map +0 -1
  210. package/lib/module/renderer/components/imageFilters/DropShadow.js.map +0 -1
  211. package/lib/typescript/src/renderer/components/Defs.d.ts +0 -5
  212. package/src/renderer/components/Defs.tsx +0 -19
  213. package/src/renderer/components/imageFilters/DropShadow.tsx +0 -31
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import type { ReactNode } from "react";
3
-
4
- import { createDeclaration } from "../nodes";
5
-
6
- export interface DefsProps {
7
- children: ReactNode | ReactNode[];
8
- }
9
-
10
- const onDeclare = createDeclaration(() => {
11
- // Do nothing.
12
- // The goal of this component is to avoid declared paint from
13
- // being used in the drawing context automatically
14
- return null;
15
- });
16
-
17
- export const Defs = (props: DefsProps) => {
18
- return <skDeclaration onDeclare={onDeclare} {...props} />;
19
- };
@@ -1,31 +0,0 @@
1
- import React from "react";
2
-
3
- import { Skia } from "../../../skia";
4
- import { createDeclaration } from "../../nodes/Declaration";
5
- import type { AnimatedProps } from "../../processors/Animations/Animations";
6
- import type { Color } from "../../../skia/Color";
7
- import { processColor } from "../../../skia/Color";
8
-
9
- import { getInput } from "./getInput";
10
-
11
- export interface DropShadowProps {
12
- dx: number;
13
- dy: number;
14
- blur: number;
15
- color: Color;
16
- shadowOnly?: boolean;
17
- }
18
-
19
- const onDeclare = createDeclaration<DropShadowProps>(
20
- ({ dx, dy, blur, color, shadowOnly }, children, { opacity }) => {
21
- const input = getInput(children);
22
- const factory = shadowOnly
23
- ? Skia.ImageFilter.MakeDropShadowOnly
24
- : Skia.ImageFilter.MakeDropShadow;
25
- return factory(dx, dy, blur, blur, processColor(color, opacity), input);
26
- }
27
- );
28
-
29
- export const DropShadow = (props: AnimatedProps<DropShadowProps>) => {
30
- return <skDeclaration onDeclare={onDeclare} {...props} />;
31
- };