@shopify/react-native-skia 0.1.156 → 0.1.158

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. package/android/build.gradle +10 -5
  2. package/cpp/api/JsiSkContourMeasure.h +7 -5
  3. package/lib/commonjs/dom/nodes/DrawingNode.js +1 -5
  4. package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
  5. package/lib/commonjs/dom/nodes/RenderNode.js +2 -8
  6. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  7. package/lib/commonjs/dom/nodes/drawings/Text.js +4 -9
  8. package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -1
  9. package/lib/commonjs/dom/types/Common.js.map +1 -1
  10. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  11. package/lib/commonjs/mock/index.js +0 -1
  12. package/lib/commonjs/mock/index.js.map +1 -1
  13. package/lib/commonjs/renderer/Canvas.js +10 -2
  14. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  15. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  16. package/lib/commonjs/renderer/HostConfig.js +10 -1
  17. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  18. package/lib/commonjs/renderer/components/Mask.js +1 -3
  19. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  20. package/lib/commonjs/renderer/components/Paint.js +5 -18
  21. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  22. package/lib/commonjs/renderer/useCanvas.js +18 -2
  23. package/lib/commonjs/renderer/useCanvas.js.map +1 -1
  24. package/lib/commonjs/skia/core/Picture.js +1 -24
  25. package/lib/commonjs/skia/core/Picture.js.map +1 -1
  26. package/lib/commonjs/skia/core/Rect.js +1 -1
  27. package/lib/commonjs/skia/core/Rect.js.map +1 -1
  28. package/lib/commonjs/skia/types/ContourMeasure.js.map +1 -1
  29. package/lib/commonjs/skia/types/Size.js +2 -0
  30. package/lib/commonjs/skia/types/Size.js.map +1 -0
  31. package/lib/commonjs/skia/types/index.js +13 -0
  32. package/lib/commonjs/skia/types/index.js.map +1 -1
  33. package/lib/commonjs/skia/web/JsiSkColor.js +8 -0
  34. package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -1
  35. package/lib/commonjs/skia/web/JsiSkContourMeasure.js +4 -7
  36. package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
  37. package/lib/commonjs/values/web/RNSkReadonlyValue.js +4 -2
  38. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  39. package/lib/commonjs/views/SkiaBaseWebView.js +2 -2
  40. package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
  41. package/lib/module/animation/spring/runSpring.js +1 -1
  42. package/lib/module/animation/spring/runSpring.js.map +1 -1
  43. package/lib/module/animation/spring/useSpring.js +1 -1
  44. package/lib/module/animation/spring/useSpring.js.map +1 -1
  45. package/lib/module/animation/timing/createTiming.js +6 -2
  46. package/lib/module/animation/timing/createTiming.js.map +1 -1
  47. package/lib/module/animation/timing/functions/getResolvedParams.js +10 -6
  48. package/lib/module/animation/timing/functions/getResolvedParams.js.map +1 -1
  49. package/lib/module/animation/timing/useTiming.js +3 -1
  50. package/lib/module/animation/timing/useTiming.js.map +1 -1
  51. package/lib/module/dom/nodes/DrawingNode.js +2 -6
  52. package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
  53. package/lib/module/dom/nodes/JsiSkDOM.js +2 -2
  54. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  55. package/lib/module/dom/nodes/RenderNode.js +1 -4
  56. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  57. package/lib/module/dom/nodes/datatypes/Gradient.js +2 -2
  58. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  59. package/lib/module/dom/nodes/drawings/Text.js +4 -9
  60. package/lib/module/dom/nodes/drawings/Text.js.map +1 -1
  61. package/lib/module/dom/nodes/paint/Shaders.js +4 -2
  62. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  63. package/lib/module/dom/types/Common.js.map +1 -1
  64. package/lib/module/dom/types/Drawings.js.map +1 -1
  65. package/lib/module/mock/index.js +10 -7
  66. package/lib/module/mock/index.js.map +1 -1
  67. package/lib/module/renderer/Canvas.js +10 -2
  68. package/lib/module/renderer/Canvas.js.map +1 -1
  69. package/lib/module/renderer/HostComponents.js.map +1 -1
  70. package/lib/module/renderer/HostConfig.js +9 -1
  71. package/lib/module/renderer/HostConfig.js.map +1 -1
  72. package/lib/module/renderer/components/Mask.js +2 -4
  73. package/lib/module/renderer/components/Mask.js.map +1 -1
  74. package/lib/module/renderer/components/Paint.js +3 -14
  75. package/lib/module/renderer/components/Paint.js.map +1 -1
  76. package/lib/module/renderer/useCanvas.js +13 -0
  77. package/lib/module/renderer/useCanvas.js.map +1 -1
  78. package/lib/module/skia/core/Picture.js +0 -18
  79. package/lib/module/skia/core/Picture.js.map +1 -1
  80. package/lib/module/skia/core/Rect.js +1 -1
  81. package/lib/module/skia/core/Rect.js.map +1 -1
  82. package/lib/module/skia/core/Vector.js +1 -1
  83. package/lib/module/skia/core/Vector.js.map +1 -1
  84. package/lib/module/skia/types/ContourMeasure.js.map +1 -1
  85. package/lib/module/skia/types/Size.js +2 -0
  86. package/lib/module/skia/types/Size.js.map +1 -0
  87. package/lib/module/skia/types/index.js +1 -0
  88. package/lib/module/skia/types/index.js.map +1 -1
  89. package/lib/module/skia/web/Host.js +1 -1
  90. package/lib/module/skia/web/Host.js.map +1 -1
  91. package/lib/module/skia/web/JsiSkColor.js +8 -0
  92. package/lib/module/skia/web/JsiSkColor.js.map +1 -1
  93. package/lib/module/skia/web/JsiSkContourMeasure.js +3 -7
  94. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
  95. package/lib/module/skia/web/JsiSkMatrix.js +1 -1
  96. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  97. package/lib/module/values/web/RNSkAnimation.js +2 -2
  98. package/lib/module/values/web/RNSkAnimation.js.map +1 -1
  99. package/lib/module/values/web/RNSkReadonlyValue.js +4 -2
  100. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  101. package/lib/module/views/SkiaBaseWebView.js +5 -3
  102. package/lib/module/views/SkiaBaseWebView.js.map +1 -1
  103. package/lib/module/views/useTouchHandler.js +6 -6
  104. package/lib/module/views/useTouchHandler.js.map +1 -1
  105. package/lib/module/web/WithSkiaWeb.js +1 -1
  106. package/lib/module/web/WithSkiaWeb.js.map +1 -1
  107. package/lib/typescript/src/dom/nodes/RenderNode.d.ts +1 -3
  108. package/lib/typescript/src/dom/types/Common.d.ts +2 -3
  109. package/lib/typescript/src/dom/types/Drawings.d.ts +1 -3
  110. package/lib/typescript/src/renderer/Canvas.d.ts +4 -1
  111. package/lib/typescript/src/renderer/HostComponents.d.ts +1 -5
  112. package/lib/typescript/src/renderer/components/Paint.d.ts +3 -4
  113. package/lib/typescript/src/renderer/useCanvas.d.ts +1 -0
  114. package/lib/typescript/src/skia/core/Picture.d.ts +0 -8
  115. package/lib/typescript/src/skia/types/ContourMeasure.d.ts +3 -2
  116. package/lib/typescript/src/skia/types/Size.d.ts +4 -0
  117. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  118. package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +2 -6
  119. package/package.json +12 -6
  120. package/src/dom/nodes/DrawingNode.ts +2 -4
  121. package/src/dom/nodes/RenderNode.ts +1 -13
  122. package/src/dom/nodes/drawings/Text.ts +4 -4
  123. package/src/dom/types/Common.ts +2 -4
  124. package/src/dom/types/Drawings.ts +1 -4
  125. package/src/mock/index.ts +0 -1
  126. package/src/renderer/Canvas.tsx +18 -3
  127. package/src/renderer/HostComponents.ts +1 -4
  128. package/src/renderer/HostConfig.ts +8 -1
  129. package/src/renderer/components/Mask.tsx +2 -2
  130. package/src/renderer/components/Paint.tsx +3 -14
  131. package/src/renderer/useCanvas.ts +14 -0
  132. package/src/skia/core/Picture.ts +0 -24
  133. package/src/skia/core/Rect.ts +1 -1
  134. package/src/skia/types/ContourMeasure.tsx +3 -2
  135. package/src/skia/types/Size.ts +4 -0
  136. package/src/skia/types/index.ts +1 -0
  137. package/src/skia/web/JsiSkColor.ts +11 -0
  138. package/src/skia/web/JsiSkContourMeasure.ts +7 -3
  139. package/src/values/web/RNSkReadonlyValue.ts +4 -2
  140. package/src/views/SkiaBaseWebView.tsx +2 -2
@@ -3,11 +3,24 @@ const CanvasContext = /*#__PURE__*/React.createContext(null);
3
3
  export const CanvasProvider = CanvasContext.Provider;
4
4
  export const useCanvas = () => {
5
5
  const ctx = useContext(CanvasContext);
6
+ console.warn( // eslint-disable-next-line max-len
7
+ "useCanvas is deprecated. use the onSize property instead: https://shopify.github.io/react-native-skia/docs/canvas/overview");
6
8
 
7
9
  if (!ctx) {
8
10
  throw new Error("Canvas context is not available");
9
11
  }
10
12
 
11
13
  return ctx;
14
+ }; // This private function will be removed once we remove the useCanvas hook and
15
+ // implement the Mask component as a node (will be faster too)
16
+
17
+ export const useSkiaPrivate = () => {
18
+ const ctx = useContext(CanvasContext);
19
+
20
+ if (!ctx) {
21
+ throw new Error("Canvas context is not available");
22
+ }
23
+
24
+ return ctx.Skia;
12
25
  };
13
26
  //# sourceMappingURL=useCanvas.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useContext","CanvasContext","createContext","CanvasProvider","Provider","useCanvas","ctx","Error"],"sources":["useCanvas.ts"],"sourcesContent":["import React, { useContext } from \"react\";\n\nimport type { Skia } from \"../skia/types\";\nimport type { SkiaValue } from \"../values/types\";\n\ninterface CanvasContext {\n Skia: Skia;\n size: SkiaValue<{ width: number; height: number }>;\n}\n\nconst CanvasContext = React.createContext<CanvasContext | null>(null);\n\nexport const CanvasProvider = CanvasContext.Provider;\n\nexport const useCanvas = () => {\n const ctx = useContext(CanvasContext);\n if (!ctx) {\n throw new Error(\"Canvas context is not available\");\n }\n return ctx;\n};\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,UAAhB,QAAkC,OAAlC;AAUA,MAAMC,aAAa,gBAAGF,KAAK,CAACG,aAAN,CAA0C,IAA1C,CAAtB;AAEA,OAAO,MAAMC,cAAc,GAAGF,aAAa,CAACG,QAArC;AAEP,OAAO,MAAMC,SAAS,GAAG,MAAM;EAC7B,MAAMC,GAAG,GAAGN,UAAU,CAACC,aAAD,CAAtB;;EACA,IAAI,CAACK,GAAL,EAAU;IACR,MAAM,IAAIC,KAAJ,CAAU,iCAAV,CAAN;EACD;;EACD,OAAOD,GAAP;AACD,CANM"}
1
+ {"version":3,"names":["React","useContext","CanvasContext","createContext","CanvasProvider","Provider","useCanvas","ctx","console","warn","Error","useSkiaPrivate","Skia"],"sources":["useCanvas.ts"],"sourcesContent":["import React, { useContext } from \"react\";\n\nimport type { Skia } from \"../skia/types\";\nimport type { SkiaValue } from \"../values/types\";\n\ninterface CanvasContext {\n Skia: Skia;\n size: SkiaValue<{ width: number; height: number }>;\n}\n\nconst CanvasContext = React.createContext<CanvasContext | null>(null);\n\nexport const CanvasProvider = CanvasContext.Provider;\n\nexport const useCanvas = () => {\n const ctx = useContext(CanvasContext);\n console.warn(\n // eslint-disable-next-line max-len\n \"useCanvas is deprecated. use the onSize property instead: https://shopify.github.io/react-native-skia/docs/canvas/overview\"\n );\n if (!ctx) {\n throw new Error(\"Canvas context is not available\");\n }\n return ctx;\n};\n\n// This private function will be removed once we remove the useCanvas hook and\n// implement the Mask component as a node (will be faster too)\nexport const useSkiaPrivate = () => {\n const ctx = useContext(CanvasContext);\n if (!ctx) {\n throw new Error(\"Canvas context is not available\");\n }\n return ctx.Skia;\n};\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,UAAhB,QAAkC,OAAlC;AAUA,MAAMC,aAAa,gBAAGF,KAAK,CAACG,aAAN,CAA0C,IAA1C,CAAtB;AAEA,OAAO,MAAMC,cAAc,GAAGF,aAAa,CAACG,QAArC;AAEP,OAAO,MAAMC,SAAS,GAAG,MAAM;EAC7B,MAAMC,GAAG,GAAGN,UAAU,CAACC,aAAD,CAAtB;EACAM,OAAO,CAACC,IAAR,EACE;EACA,4HAFF;;EAIA,IAAI,CAACF,GAAL,EAAU;IACR,MAAM,IAAIG,KAAJ,CAAU,iCAAV,CAAN;EACD;;EACD,OAAOH,GAAP;AACD,CAVM,C,CAYP;AACA;;AACA,OAAO,MAAMI,cAAc,GAAG,MAAM;EAClC,MAAMJ,GAAG,GAAGN,UAAU,CAACC,aAAD,CAAtB;;EACA,IAAI,CAACK,GAAL,EAAU;IACR,MAAM,IAAIG,KAAJ,CAAU,iCAAV,CAAN;EACD;;EACD,OAAOH,GAAG,CAACK,IAAX;AACD,CANM"}
@@ -1,4 +1,3 @@
1
- import { useMemo } from "react";
2
1
  import { Skia } from "../Skia";
3
2
 
4
3
  /**
@@ -7,23 +6,6 @@ import { Skia } from "../Skia";
7
6
  * @param cb Callback for drawing to the canvas
8
7
  * @returns SkPicture
9
8
  */
10
- export const usePicture = function (rect, cb) {
11
- let deps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
12
- console.warn("usePicture() is deprecated. Use createPicture() instead.");
13
- return useMemo(() => {
14
- const recorder = Skia.PictureRecorder();
15
- const canvas = recorder.beginRecording(rect);
16
- cb(canvas);
17
- return recorder.finishRecordingAsPicture(); // eslint-disable-next-line react-hooks/exhaustive-deps
18
- }, deps);
19
- };
20
- /**
21
- * Memoizes and returns an SkPicture that can be drawn to another canvas.
22
- * @param rect Picture bounds
23
- * @param cb Callback for drawing to the canvas
24
- * @returns SkPicture
25
- */
26
-
27
9
  export const createPicture = (rect, cb) => {
28
10
  const recorder = Skia.PictureRecorder();
29
11
  const canvas = recorder.beginRecording(rect);
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","Skia","usePicture","rect","cb","deps","console","warn","recorder","PictureRecorder","canvas","beginRecording","finishRecordingAsPicture","createPicture"],"sources":["Picture.ts"],"sourcesContent":["import type { DependencyList } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { Skia } from \"../Skia\";\nimport type { SkCanvas, SkRect } from \"../types\";\n\n/**\n * Memoizes and returns an SkPicture that can be drawn to another canvas.\n * @param rect Picture bounds\n * @param cb Callback for drawing to the canvas\n * @returns SkPicture\n */\nexport const usePicture = (\n rect: SkRect,\n cb: (canvas: SkCanvas) => void,\n deps: DependencyList = []\n) => {\n console.warn(\"usePicture() is deprecated. Use createPicture() instead.\");\n return useMemo(() => {\n const recorder = Skia.PictureRecorder();\n const canvas = recorder.beginRecording(rect);\n cb(canvas);\n return recorder.finishRecordingAsPicture();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n};\n\n/**\n * Memoizes and returns an SkPicture that can be drawn to another canvas.\n * @param rect Picture bounds\n * @param cb Callback for drawing to the canvas\n * @returns SkPicture\n */\nexport const createPicture = (rect: SkRect, cb: (canvas: SkCanvas) => void) => {\n const recorder = Skia.PictureRecorder();\n const canvas = recorder.beginRecording(rect);\n cb(canvas);\n return recorder.finishRecordingAsPicture();\n};\n"],"mappings":"AACA,SAASA,OAAT,QAAwB,OAAxB;AAEA,SAASC,IAAT,QAAqB,SAArB;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG,UACxBC,IADwB,EAExBC,EAFwB,EAIrB;EAAA,IADHC,IACG,uEADoB,EACpB;EACHC,OAAO,CAACC,IAAR,CAAa,0DAAb;EACA,OAAOP,OAAO,CAAC,MAAM;IACnB,MAAMQ,QAAQ,GAAGP,IAAI,CAACQ,eAAL,EAAjB;IACA,MAAMC,MAAM,GAAGF,QAAQ,CAACG,cAAT,CAAwBR,IAAxB,CAAf;IACAC,EAAE,CAACM,MAAD,CAAF;IACA,OAAOF,QAAQ,CAACI,wBAAT,EAAP,CAJmB,CAKnB;EACD,CANa,EAMXP,IANW,CAAd;AAOD,CAbM;AAeP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMQ,aAAa,GAAG,CAACV,IAAD,EAAeC,EAAf,KAAkD;EAC7E,MAAMI,QAAQ,GAAGP,IAAI,CAACQ,eAAL,EAAjB;EACA,MAAMC,MAAM,GAAGF,QAAQ,CAACG,cAAT,CAAwBR,IAAxB,CAAf;EACAC,EAAE,CAACM,MAAD,CAAF;EACA,OAAOF,QAAQ,CAACI,wBAAT,EAAP;AACD,CALM"}
1
+ {"version":3,"names":["Skia","createPicture","rect","cb","recorder","PictureRecorder","canvas","beginRecording","finishRecordingAsPicture"],"sources":["Picture.ts"],"sourcesContent":["import { Skia } from \"../Skia\";\nimport type { SkCanvas, SkRect } from \"../types\";\n\n/**\n * Memoizes and returns an SkPicture that can be drawn to another canvas.\n * @param rect Picture bounds\n * @param cb Callback for drawing to the canvas\n * @returns SkPicture\n */\nexport const createPicture = (rect: SkRect, cb: (canvas: SkCanvas) => void) => {\n const recorder = Skia.PictureRecorder();\n const canvas = recorder.beginRecording(rect);\n cb(canvas);\n return recorder.finishRecordingAsPicture();\n};\n"],"mappings":"AAAA,SAASA,IAAT,QAAqB,SAArB;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAG,CAACC,IAAD,EAAeC,EAAf,KAAkD;EAC7E,MAAMC,QAAQ,GAAGJ,IAAI,CAACK,eAAL,EAAjB;EACA,MAAMC,MAAM,GAAGF,QAAQ,CAACG,cAAT,CAAwBL,IAAxB,CAAf;EACAC,EAAE,CAACG,MAAD,CAAF;EACA,OAAOF,QAAQ,CAACI,wBAAT,EAAP;AACD,CALM"}
@@ -7,7 +7,7 @@ export const bounds = rects => {
7
7
  const y = Math.min(...rects.map(r => r.y));
8
8
  const width = Math.max(...rects.map(r => r.x + r.width));
9
9
  const height = Math.max(...rects.map(r => r.y + r.height));
10
- return rect(x, y, width, height);
10
+ return rect(x, y, width - x, height - y);
11
11
  };
12
12
  export const topLeft = r => isRRect(r) ? vec(r.rect.x, r.rect.y) : vec(r.x, r.y);
13
13
  export const topRight = r => isRRect(r) ? vec(r.rect.x + r.rect.width, r.rect.y) : vec(r.x + r.width, r.y);
@@ -1 +1 @@
1
- {"version":3,"names":["Skia","isRRect","vec","rect","x","y","width","height","XYWHRect","bounds","rects","Math","min","map","r","max","topLeft","topRight","bottomLeft","bottomRight","center"],"sources":["Rect.ts"],"sourcesContent":["import { Skia } from \"../Skia\";\nimport type { SkRect, SkRRect } from \"../types\";\nimport { isRRect } from \"../types\";\n\nimport { vec } from \"./Vector\";\n\nexport const rect = (x: number, y: number, width: number, height: number) =>\n Skia.XYWHRect(x, y, width, height);\n\nexport const bounds = (rects: SkRect[]) => {\n const x = Math.min(...rects.map((r) => r.x));\n const y = Math.min(...rects.map((r) => r.y));\n const width = Math.max(...rects.map((r) => r.x + r.width));\n const height = Math.max(...rects.map((r) => r.y + r.height));\n return rect(x, y, width, height);\n};\n\nexport const topLeft = (r: SkRect | SkRRect) =>\n isRRect(r) ? vec(r.rect.x, r.rect.y) : vec(r.x, r.y);\nexport const topRight = (r: SkRect | SkRRect) =>\n isRRect(r) ? vec(r.rect.x + r.rect.width, r.rect.y) : vec(r.x + r.width, r.y);\nexport const bottomLeft = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x, r.rect.y + r.rect.height)\n : vec(r.x, r.y + r.height);\nexport const bottomRight = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x + r.rect.width, r.rect.y + r.rect.height)\n : vec(r.x + r.width, r.y + r.height);\nexport const center = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x + r.rect.width / 2, r.rect.y + r.rect.height / 2)\n : vec(r.x + r.width / 2, r.y + r.height / 2);\n"],"mappings":"AAAA,SAASA,IAAT,QAAqB,SAArB;AAEA,SAASC,OAAT,QAAwB,UAAxB;AAEA,SAASC,GAAT,QAAoB,UAApB;AAEA,OAAO,MAAMC,IAAI,GAAG,CAACC,CAAD,EAAYC,CAAZ,EAAuBC,KAAvB,EAAsCC,MAAtC,KAClBP,IAAI,CAACQ,QAAL,CAAcJ,CAAd,EAAiBC,CAAjB,EAAoBC,KAApB,EAA2BC,MAA3B,CADK;AAGP,OAAO,MAAME,MAAM,GAAIC,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AAU,GAAIJ,CAAD,IACxBb,OAAO,CAACa,CAAD,CAAP,GACIZ,GAAG,CAACY,CAAC,CAACX,IAAF,CAAOC,CAAR,EAAWU,CAAC,CAACX,IAAF,CAAOE,CAAP,GAAWS,CAAC,CAACX,IAAF,CAAOI,MAA7B,CADP,GAEIL,GAAG,CAACY,CAAC,CAACV,CAAH,EAAMU,CAAC,CAACT,CAAF,GAAMS,CAAC,CAACP,MAAd,CAHF;AAIP,OAAO,MAAMY,WAAW,GAAIL,CAAD,IACzBb,OAAO,CAACa,CAAD,CAAP,GACIZ,GAAG,CAACY,CAAC,CAACX,IAAF,CAAOC,CAAP,GAAWU,CAAC,CAACX,IAAF,CAAOG,KAAnB,EAA0BQ,CAAC,CAACX,IAAF,CAAOE,CAAP,GAAWS,CAAC,CAACX,IAAF,CAAOI,MAA5C,CADP,GAEIL,GAAG,CAACY,CAAC,CAACV,CAAF,GAAMU,CAAC,CAACR,KAAT,EAAgBQ,CAAC,CAACT,CAAF,GAAMS,CAAC,CAACP,MAAxB,CAHF;AAIP,OAAO,MAAMa,MAAM,GAAIN,CAAD,IACpBb,OAAO,CAACa,CAAD,CAAP,GACIZ,GAAG,CAACY,CAAC,CAACX,IAAF,CAAOC,CAAP,GAAWU,CAAC,CAACX,IAAF,CAAOG,KAAP,GAAe,CAA3B,EAA8BQ,CAAC,CAACX,IAAF,CAAOE,CAAP,GAAWS,CAAC,CAACX,IAAF,CAAOI,MAAP,GAAgB,CAAzD,CADP,GAEIL,GAAG,CAACY,CAAC,CAACV,CAAF,GAAMU,CAAC,CAACR,KAAF,GAAU,CAAjB,EAAoBQ,CAAC,CAACT,CAAF,GAAMS,CAAC,CAACP,MAAF,GAAW,CAArC,CAHF"}
1
+ {"version":3,"names":["Skia","isRRect","vec","rect","x","y","width","height","XYWHRect","bounds","rects","Math","min","map","r","max","topLeft","topRight","bottomLeft","bottomRight","center"],"sources":["Rect.ts"],"sourcesContent":["import { Skia } from \"../Skia\";\nimport type { SkRect, SkRRect } from \"../types\";\nimport { isRRect } from \"../types\";\n\nimport { vec } from \"./Vector\";\n\nexport const rect = (x: number, y: number, width: number, height: number) =>\n Skia.XYWHRect(x, y, width, height);\n\nexport const bounds = (rects: SkRect[]) => {\n const x = Math.min(...rects.map((r) => r.x));\n const y = Math.min(...rects.map((r) => r.y));\n const width = Math.max(...rects.map((r) => r.x + r.width));\n const height = Math.max(...rects.map((r) => r.y + r.height));\n return rect(x, y, width - x, height - y);\n};\n\nexport const topLeft = (r: SkRect | SkRRect) =>\n isRRect(r) ? vec(r.rect.x, r.rect.y) : vec(r.x, r.y);\nexport const topRight = (r: SkRect | SkRRect) =>\n isRRect(r) ? vec(r.rect.x + r.rect.width, r.rect.y) : vec(r.x + r.width, r.y);\nexport const bottomLeft = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x, r.rect.y + r.rect.height)\n : vec(r.x, r.y + r.height);\nexport const bottomRight = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x + r.rect.width, r.rect.y + r.rect.height)\n : vec(r.x + r.width, r.y + r.height);\nexport const center = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x + r.rect.width / 2, r.rect.y + r.rect.height / 2)\n : vec(r.x + r.width / 2, r.y + r.height / 2);\n"],"mappings":"AAAA,SAASA,IAAT,QAAqB,SAArB;AAEA,SAASC,OAAT,QAAwB,UAAxB;AAEA,SAASC,GAAT,QAAoB,UAApB;AAEA,OAAO,MAAMC,IAAI,GAAG,CAACC,CAAD,EAAYC,CAAZ,EAAuBC,KAAvB,EAAsCC,MAAtC,KAClBP,IAAI,CAACQ,QAAL,CAAcJ,CAAd,EAAiBC,CAAjB,EAAoBC,KAApB,EAA2BC,MAA3B,CADK;AAGP,OAAO,MAAME,MAAM,GAAIC,KAAD,IAAqB;EACzC,MAAMN,CAAC,GAAGO,IAAI,CAACC,GAAL,CAAS,GAAGF,KAAK,CAACG,GAAN,CAAWC,CAAD,IAAOA,CAAC,C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CAAOC,CAAR,EAAWU,CAAC,CAACX,IAAF,CAAOE,CAAP,GAAWS,CAAC,CAACX,IAAF,CAAOI,MAA7B,CADP,GAEIL,GAAG,CAACY,CAAC,CAACV,CAAH,EAAMU,CAAC,CAACT,CAAF,GAAMS,CAAC,CAACP,MAAd,CAHF;AAIP,OAAO,MAAMY,WAAW,GAAIL,CAAD,IACzBb,OAAO,CAACa,CAAD,CAAP,GACIZ,GAAG,CAACY,CAAC,CAACX,IAAF,CAAOC,CAAP,GAAWU,CAAC,CAACX,IAAF,CAAOG,KAAnB,EAA0BQ,CAAC,CAACX,IAAF,CAAOE,CAAP,GAAWS,CAAC,CAACX,IAAF,CAAOI,MAA5C,CADP,GAEIL,GAAG,CAACY,CAAC,CAACV,CAAF,GAAMU,CAAC,CAACR,KAAT,EAAgBQ,CAAC,CAACT,CAAF,GAAMS,CAAC,CAACP,MAAxB,CAHF;AAIP,OAAO,MAAMa,MAAM,GAAIN,CAAD,IACpBb,OAAO,CAACa,CAAD,CAAP,GACIZ,GAAG,CAACY,CAAC,CAACX,IAAF,CAAOC,CAAP,GAAWU,CAAC,CAACX,IAAF,CAAOG,KAAP,GAAe,CAA3B,EAA8BQ,CAAC,CAACX,IAAF,CAAOE,CAAP,GAAWS,CAAC,CAACX,IAAF,CAAOI,MAAP,GAAgB,CAAzD,CADP,GAEIL,GAAG,CAACY,CAAC,CAACV,CAAF,GAAMU,CAAC,CAACR,KAAF,GAAU,CAAjB,EAAoBQ,CAAC,CAACT,CAAF,GAAMS,CAAC,CAACP,MAAF,GAAW,CAArC,CAHF"}
@@ -2,7 +2,7 @@ import { Skia } from "../Skia";
2
2
  export const vec = function () {
3
3
  let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
4
4
  let y = arguments.length > 1 ? arguments[1] : undefined;
5
- return Skia.Point(x, y ?? x);
5
+ return Skia.Point(x, y !== null && y !== void 0 ? y : x);
6
6
  };
7
7
  export const point = vec;
8
8
  export const neg = a => vec(-a.x, -a.y);
@@ -1 +1 @@
1
- {"version":3,"names":["Skia","vec","x","y","Point","point","neg","a","add","b","sub","dist","Math","hypot","translate","translateX","translateY"],"sources":["Vector.ts"],"sourcesContent":["import { Skia } from \"../Skia\";\nimport type { Vector } from \"../types\";\n\nexport const vec = (x = 0, y?: number) => Skia.Point(x, y ?? x);\nexport const point = vec;\nexport const neg = (a: Vector) => vec(-a.x, -a.y);\nexport const add = (a: Vector, b: Vector) => vec(a.x + b.x, a.y + b.y);\nexport const sub = (a: Vector, b: Vector) => vec(a.x - b.x, a.y - b.y);\nexport const dist = (a: Vector, b: Vector) => Math.hypot(a.x - b.x, a.y - b.y);\nexport const translate = ({ x, y }: Vector) =>\n [{ translateX: x }, { translateY: y }] as const;\n"],"mappings":"AAAA,SAASA,IAAT,QAAqB,SAArB;AAGA,OAAO,MAAMC,GAAG,GAAG;EAAA,IAACC,CAAD,uEAAK,CAAL;EAAA,IAAQC,CAAR;EAAA,OAAuBH,IAAI,CAACI,KAAL,CAAWF,CAAX,EAAcC,CAAC,IAAID,CAAnB,CAAvB;AAAA,CAAZ;AACP,OAAO,MAAMG,KAAK,GAAGJ,GAAd;AACP,OAAO,MAAMK,GAAG,GAAIC,CAAD,IAAeN,GAAG,CAAC,CAACM,CAAC,CAACL,CAAJ,EAAO,CAACK,CAAC,CAACJ,CAAV,CAA9B;AACP,OAAO,MAAMK,GAAG,GAAG,CAACD,CAAD,EAAYE,CAAZ,KAA0BR,GAAG,CAACM,CAAC,CAACL,CAAF,GAAMO,CAAC,CAACP,CAAT,EAAYK,CAAC,CAACJ,CAAF,GAAMM,CAAC,CAACN,CAApB,CAAzC;AACP,OAAO,MAAMO,GAAG,GAAG,CAACH,CAAD,EAAYE,CAAZ,KAA0BR,GAAG,CAACM,CAAC,CAACL,CAAF,GAAMO,CAAC,CAACP,CAAT,EAAYK,CAAC,CAACJ,CAAF,GAAMM,CAAC,CAACN,CAApB,CAAzC;AACP,OAAO,MAAMQ,IAAI,GAAG,CAACJ,CAAD,EAAYE,CAAZ,KAA0BG,IAAI,CAACC,KAAL,CAAWN,CAAC,CAACL,CAAF,GAAMO,CAAC,CAACP,CAAnB,EAAsBK,CAAC,CAACJ,CAAF,GAAMM,CAAC,CAACN,CAA9B,CAAvC;AACP,OAAO,MAAMW,SAAS,GAAG;EAAA,IAAC;IAAEZ,CAAF;IAAKC;EAAL,CAAD;EAAA,OACvB,CAAC;IAAEY,UAAU,EAAEb;EAAd,CAAD,EAAoB;IAAEc,UAAU,EAAEb;EAAd,CAApB,CADuB;AAAA,CAAlB"}
1
+ {"version":3,"names":["Skia","vec","x","y","Point","point","neg","a","add","b","sub","dist","Math","hypot","translate","translateX","translateY"],"sources":["Vector.ts"],"sourcesContent":["import { Skia } from \"../Skia\";\nimport type { Vector } from \"../types\";\n\nexport const vec = (x = 0, y?: number) => Skia.Point(x, y ?? x);\nexport const point = vec;\nexport const neg = (a: Vector) => vec(-a.x, -a.y);\nexport const add = (a: Vector, b: Vector) => vec(a.x + b.x, a.y + b.y);\nexport const sub = (a: Vector, b: Vector) => vec(a.x - b.x, a.y - b.y);\nexport const dist = (a: Vector, b: Vector) => Math.hypot(a.x - b.x, a.y - b.y);\nexport const translate = ({ x, y }: Vector) =>\n [{ translateX: x }, { translateY: y }] as const;\n"],"mappings":"AAAA,SAASA,IAAT,QAAqB,SAArB;AAGA,OAAO,MAAMC,GAAG,GAAG;EAAA,IAACC,CAAD,uEAAK,CAAL;EAAA,IAAQC,CAAR;EAAA,OAAuBH,IAAI,CAACI,KAAL,CAAWF,CAAX,EAAcC,CAAd,aAAcA,CAAd,cAAcA,CAAd,GAAmBD,CAAnB,CAAvB;AAAA,CAAZ;AACP,OAAO,MAAMG,KAAK,GAAGJ,GAAd;AACP,OAAO,MAAMK,GAAG,GAAIC,CAAD,IAAeN,GAAG,CAAC,CAACM,CAAC,CAACL,CAAJ,EAAO,CAACK,CAAC,CAACJ,CAAV,CAA9B;AACP,OAAO,MAAMK,GAAG,GAAG,CAACD,CAAD,EAAYE,CAAZ,KAA0BR,GAAG,CAACM,CAAC,CAACL,CAAF,GAAMO,CAAC,CAACP,CAAT,EAAYK,CAAC,CAACJ,CAAF,GAAMM,CAAC,CAACN,CAApB,CAAzC;AACP,OAAO,MAAMO,GAAG,GAAG,CAACH,CAAD,EAAYE,CAAZ,KAA0BR,GAAG,CAACM,CAAC,CAACL,CAAF,GAAMO,CAAC,CAACP,CAAT,EAAYK,CAAC,CAACJ,CAAF,GAAMM,CAAC,CAACN,CAApB,CAAzC;AACP,OAAO,MAAMQ,IAAI,GAAG,CAACJ,CAAD,EAAYE,CAAZ,KAA0BG,IAAI,CAACC,KAAL,CAAWN,CAAC,CAACL,CAAF,GAAMO,CAAC,CAACP,CAAnB,EAAsBK,CAAC,CAACJ,CAAF,GAAMM,CAAC,CAACN,CAA9B,CAAvC;AACP,OAAO,MAAMW,SAAS,GAAG;EAAA,IAAC;IAAEZ,CAAF;IAAKC;EAAL,CAAD;EAAA,OACvB,CAAC;IAAEY,UAAU,EAAEb;EAAd,CAAD,EAAoB;IAAEc,UAAU,EAAEb;EAAd,CAApB,CADuB;AAAA,CAAlB"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["ContourMeasure.tsx"],"sourcesContent":["import type { SkJSIInstance } from \"./JsiInstance\";\nimport type { SkPath } from \"./Path/Path\";\n\nexport interface PosTan {\n px: number;\n py: number;\n tx: number;\n ty: number;\n}\n\nexport interface SkContourMeasure extends SkJSIInstance<\"ContourMeasure\"> {\n /**\n * Returns the given position and tangent line for the distance on the given contour.\n * The return value is 4 floats in this order: posX, posY, vecX, vecY.\n * @param distance - will be pinned between 0 and length().\n */\n getPosTan(distance: number): PosTan;\n\n /**\n * Returns an Path representing the segment of this contour.\n * @param startD - will be pinned between 0 and length()\n * @param stopD - will be pinned between 0 and length()\n * @param startWithMoveTo\n */\n getSegment(startD: number, stopD: number, startWithMoveTo: boolean): SkPath;\n\n /**\n * Returns true if the contour is closed.\n */\n isClosed(): boolean;\n\n /**\n * Returns the length of this contour.\n */\n length(): number;\n}\n\nexport interface SkContourMeasureIter\n extends SkJSIInstance<\"ContourMeasureIter\"> {\n /**\n * Iterates through contours in path, returning a contour-measure object for each contour\n * in the path. Returns null when it is done.\n *\n * See SkContourMeasure.h for more details.\n */\n next(): SkContourMeasure | null;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["ContourMeasure.tsx"],"sourcesContent":["import type { SkJSIInstance } from \"./JsiInstance\";\nimport type { SkPath } from \"./Path/Path\";\nimport type { SkPoint } from \"./Point\";\n\nexport interface PosTan {\n px: number;\n py: number;\n tx: number;\n ty: number;\n}\n\nexport interface SkContourMeasure extends SkJSIInstance<\"ContourMeasure\"> {\n /**\n * Returns the given position and tangent line for the distance on the given contour.\n * The return value an array of 2 vectors: [position, tangent]\n * @param distance - will be pinned between 0 and length().\n */\n getPosTan(distance: number): [position: SkPoint, tangent: SkPoint];\n\n /**\n * Returns an Path representing the segment of this contour.\n * @param startD - will be pinned between 0 and length()\n * @param stopD - will be pinned between 0 and length()\n * @param startWithMoveTo\n */\n getSegment(startD: number, stopD: number, startWithMoveTo: boolean): SkPath;\n\n /**\n * Returns true if the contour is closed.\n */\n isClosed(): boolean;\n\n /**\n * Returns the length of this contour.\n */\n length(): number;\n}\n\nexport interface SkContourMeasureIter\n extends SkJSIInstance<\"ContourMeasureIter\"> {\n /**\n * Iterates through contours in path, returning a contour-measure object for each contour\n * in the path. Returns null when it is done.\n *\n * See SkContourMeasure.h for more details.\n */\n next(): SkContourMeasure | null;\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=Size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["Size.ts"],"sourcesContent":["export interface SkSize {\n width: number;\n height: number;\n}\n"],"mappings":""}
@@ -25,4 +25,5 @@ export * from "./RSXform";
25
25
  export * from "./JsiInstance";
26
26
  export * from "./Skia";
27
27
  export * from "./TextBlob";
28
+ export * from "./Size";
28
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Picture\";\nexport * from \"./Data\";\nexport * from \"./SVG\";\nexport * from \"./Surface\";\nexport * from \"./Vertices\";\nexport * from \"./RuntimeEffect\";\nexport * from \"./Shader\";\nexport * from \"./Image\";\nexport * from \"./ColorFilter\";\nexport * from \"./ImageFilter\";\nexport * from \"./Font\";\nexport * from \"./Typeface\";\nexport * from \"./Paint\";\nexport * from \"./Path\";\nexport * from \"./Color\";\nexport * from \"./Canvas\";\nexport * from \"./ContourMeasure\";\nexport * from \"./MaskFilter\";\nexport * from \"./Matrix\";\nexport * from \"./PathEffect\";\nexport * from \"./Point\";\nexport * from \"./Rect\";\nexport * from \"./RRect\";\nexport * from \"./RSXform\";\nexport * from \"./JsiInstance\";\nexport * from \"./Skia\";\nexport * from \"./TextBlob\";\n"],"mappings":"AAAA,cAAc,WAAd;AACA,cAAc,QAAd;AACA,cAAc,OAAd;AACA,cAAc,WAAd;AACA,cAAc,YAAd;AACA,cAAc,iBAAd;AACA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,eAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,YAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,SAAd;AACA,cAAc,UAAd;AACA,cAAc,kBAAd;AACA,cAAc,cAAd;AACA,cAAc,UAAd;AACA,cAAc,cAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,SAAd;AACA,cAAc,WAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,YAAd"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Picture\";\nexport * from \"./Data\";\nexport * from \"./SVG\";\nexport * from \"./Surface\";\nexport * from \"./Vertices\";\nexport * from \"./RuntimeEffect\";\nexport * from \"./Shader\";\nexport * from \"./Image\";\nexport * from \"./ColorFilter\";\nexport * from \"./ImageFilter\";\nexport * from \"./Font\";\nexport * from \"./Typeface\";\nexport * from \"./Paint\";\nexport * from \"./Path\";\nexport * from \"./Color\";\nexport * from \"./Canvas\";\nexport * from \"./ContourMeasure\";\nexport * from \"./MaskFilter\";\nexport * from \"./Matrix\";\nexport * from \"./PathEffect\";\nexport * from \"./Point\";\nexport * from \"./Rect\";\nexport * from \"./RRect\";\nexport * from \"./RSXform\";\nexport * from \"./JsiInstance\";\nexport * from \"./Skia\";\nexport * from \"./TextBlob\";\nexport * from \"./Size\";\n"],"mappings":"AAAA,cAAc,WAAd;AACA,cAAc,QAAd;AACA,cAAc,OAAd;AACA,cAAc,WAAd;AACA,cAAc,YAAd;AACA,cAAc,iBAAd;AACA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,eAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,YAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,SAAd;AACA,cAAc,UAAd;AACA,cAAc,kBAAd;AACA,cAAc,cAAd;AACA,cAAc,UAAd;AACA,cAAc,cAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,SAAd;AACA,cAAc,WAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,YAAd;AACA,cAAc,QAAd"}
@@ -2,7 +2,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
2
2
 
3
3
  export class NotImplementedOnRNWeb extends Error {
4
4
  constructor(msg) {
5
- super(msg ?? "Not implemented on React Native Web");
5
+ super(msg !== null && msg !== void 0 ? msg : "Not implemented on React Native Web");
6
6
  }
7
7
 
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"names":["NotImplementedOnRNWeb","Error","constructor","msg","Host","CanvasKit","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","ckEnum","optEnum","undefined"],"sources":["Host.ts"],"sourcesContent":["import type { CanvasKit, EmbindEnumEntity } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport class NotImplementedOnRNWeb extends Error {\n constructor(msg?: string) {\n super(msg ?? \"Not implemented on React Native Web\");\n }\n}\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const ckEnum = (value: number): EmbindEnumEntity => ({ value });\nexport const optEnum = (\n value: number | undefined\n): EmbindEnumEntity | undefined =>\n value === undefined ? undefined : { value };\n"],"mappings":";;AAIA,OAAO,MAAMA,qBAAN,SAAoCC,KAApC,CAA0C;EAC/CC,WAAW,CAACC,GAAD,EAAe;IACxB,MAAMA,GAAG,IAAI,qCAAb;EACD;;AAH8C;AAMjD,OAAO,MAAeC,IAAf,CAAoB;EAGzBF,WAAW,CAACG,SAAD,EAAuB;IAAA;;IAChC,KAAKA,SAAL,GAAiBA,SAAjB;EACD;;AALwB;AAQ3B,OAAO,MAAeC,cAAf,SACGF,IADH,CAGP;EAIEF,WAAW,CAACG,SAAD,EAAuBE,GAAvB,EAA+BC,QAA/B,EAA4C;IACrD,MAAMH,SAAN;;IADqD;;IAAA;;IAErD,KAAKE,GAAL,GAAWA,GAAX;IACA,KAAKE,YAAL,GAAoBD,QAApB;EACD;;AARH;AAWA,OAAO,MAAeE,UAAf,SAAuDJ,cAAvD,CAGL;EACgB,OAATK,SAAS,CAAIC,KAAJ,EAAkC;IAChD,OAAQA,KAAD,CAAiCL,GAAxC;EACD;;AAHD;AAMF,OAAO,MAAMM,MAAM,GAAID,KAAD,KAAsC;EAAEA;AAAF,CAAtC,CAAf;AACP,OAAO,MAAME,OAAO,GAClBF,KADqB,IAGrBA,KAAK,KAAKG,SAAV,GAAsBA,SAAtB,GAAkC;EAAEH;AAAF,CAH7B"}
1
+ {"version":3,"names":["NotImplementedOnRNWeb","Error","constructor","msg","Host","CanvasKit","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","ckEnum","optEnum","undefined"],"sources":["Host.ts"],"sourcesContent":["import type { CanvasKit, EmbindEnumEntity } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport class NotImplementedOnRNWeb extends Error {\n constructor(msg?: string) {\n super(msg ?? \"Not implemented on React Native Web\");\n }\n}\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const ckEnum = (value: number): EmbindEnumEntity => ({ value });\nexport const optEnum = (\n value: number | undefined\n): EmbindEnumEntity | undefined =>\n value === undefined ? undefined : { value };\n"],"mappings":";;AAIA,OAAO,MAAMA,qBAAN,SAAoCC,KAApC,CAA0C;EAC/CC,WAAW,CAACC,GAAD,EAAe;IACxB,MAAMA,GAAN,aAAMA,GAAN,cAAMA,GAAN,GAAa,qCAAb;EACD;;AAH8C;AAMjD,OAAO,MAAeC,IAAf,CAAoB;EAGzBF,WAAW,CAACG,SAAD,EAAuB;IAAA;;IAChC,KAAKA,SAAL,GAAiBA,SAAjB;EACD;;AALwB;AAQ3B,OAAO,MAAeC,cAAf,SACGF,IADH,CAGP;EAIEF,WAAW,CAACG,SAAD,EAAuBE,GAAvB,EAA+BC,QAA/B,EAA4C;IACrD,MAAMH,SAAN;;IADqD;;IAAA;;IAErD,KAAKE,GAAL,GAAWA,GAAX;IACA,KAAKE,YAAL,GAAoBD,QAApB;EACD;;AARH;AAWA,OAAO,MAAeE,UAAf,SAAuDJ,cAAvD,CAGL;EACgB,OAATK,SAAS,CAAIC,KAAJ,EAAkC;IAChD,OAAQA,KAAD,CAAiCL,GAAxC;EACD;;AAHD;AAMF,OAAO,MAAMM,MAAM,GAAID,KAAD,KAAsC;EAAEA;AAAF,CAAtC,CAAf;AACP,OAAO,MAAME,OAAO,GAClBF,KADqB,IAGrBA,KAAK,KAAKG,SAAV,GAAsBA,SAAtB,GAAkC;EAAEH;AAAF,CAH7B"}
@@ -252,6 +252,14 @@ const parseCSSColor = cssStr => {
252
252
 
253
253
 
254
254
  return [(iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, 1];
255
+ } else if (str.length === 9) {
256
+ var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.
257
+
258
+ if (!(iv >= 0 && iv <= 0xffffffff)) {
259
+ return null; // Covers NaN.
260
+ }
261
+
262
+ return [(iv & 0xff000000) >> 24 & 0xff, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, (iv & 0xff) / 255];
255
263
  }
256
264
 
257
265
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["alphaf","c","red","green","blue","CSSColorTable","transparent","Float32Array","of","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","clampCSSByte","j","i","Math","round","clampCSSFloat","f","parseCSSInt","str","length","parseFloat","parseInt","parseCSSFloat","undefined","CSSHueToRGB","m1","m2","h","parseCSSColor","cssStr","replace","toLowerCase","cl","iv","substr","op","indexOf","ep","fname","params","split","alpha","pop","s","l","Color","color","r","rgba"],"sources":["JsiSkColor.ts"],"sourcesContent":["import type { SkColor, Color as InputColor } from \"../types\";\n\nconst alphaf = (c: number) => ((c >> 24) & 255) / 255;\nconst red = (c: number) => (c >> 16) & 255;\nconst green = (c: number) => (c >> 8) & 255;\nconst blue = (c: number) => c & 255;\n\n// From https://raw.githubusercontent.com/deanm/css-color-parser-js/master/csscolorparser.js\nconst CSSColorTable = {\n transparent: Float32Array.of(0, 0, 0, 0),\n aliceblue: Float32Array.of(240, 248, 255, 1),\n antiquewhite: Float32Array.of(250, 235, 215, 1),\n aqua: Float32Array.of(0, 255, 255, 1),\n aquamarine: Float32Array.of(127, 255, 212, 1),\n azure: Float32Array.of(240, 255, 255, 1),\n beige: Float32Array.of(245, 245, 220, 1),\n bisque: Float32Array.of(255, 228, 196, 1),\n black: Float32Array.of(0, 0, 0, 1),\n blanchedalmond: Float32Array.of(255, 235, 205, 1),\n blue: Float32Array.of(0, 0, 255, 1),\n blueviolet: Float32Array.of(138, 43, 226, 1),\n brown: Float32Array.of(165, 42, 42, 1),\n burlywood: Float32Array.of(222, 184, 135, 1),\n cadetblue: Float32Array.of(95, 158, 160, 1),\n chartreuse: Float32Array.of(127, 255, 0, 1),\n chocolate: Float32Array.of(210, 105, 30, 1),\n coral: Float32Array.of(255, 127, 80, 1),\n cornflowerblue: Float32Array.of(100, 149, 237, 1),\n cornsilk: Float32Array.of(255, 248, 220, 1),\n crimson: Float32Array.of(220, 20, 60, 1),\n cyan: Float32Array.of(0, 255, 255, 1),\n darkblue: Float32Array.of(0, 0, 139, 1),\n darkcyan: Float32Array.of(0, 139, 139, 1),\n darkgoldenrod: Float32Array.of(184, 134, 11, 1),\n darkgray: Float32Array.of(169, 169, 169, 1),\n darkgreen: Float32Array.of(0, 100, 0, 1),\n darkgrey: Float32Array.of(169, 169, 169, 1),\n darkkhaki: Float32Array.of(189, 183, 107, 1),\n darkmagenta: Float32Array.of(139, 0, 139, 1),\n darkolivegreen: Float32Array.of(85, 107, 47, 1),\n darkorange: Float32Array.of(255, 140, 0, 1),\n darkorchid: Float32Array.of(153, 50, 204, 1),\n darkred: Float32Array.of(139, 0, 0, 1),\n darksalmon: Float32Array.of(233, 150, 122, 1),\n darkseagreen: Float32Array.of(143, 188, 143, 1),\n darkslateblue: Float32Array.of(72, 61, 139, 1),\n darkslategray: Float32Array.of(47, 79, 79, 1),\n darkslategrey: Float32Array.of(47, 79, 79, 1),\n darkturquoise: Float32Array.of(0, 206, 209, 1),\n darkviolet: Float32Array.of(148, 0, 211, 1),\n deeppink: Float32Array.of(255, 20, 147, 1),\n deepskyblue: Float32Array.of(0, 191, 255, 1),\n dimgray: Float32Array.of(105, 105, 105, 1),\n dimgrey: Float32Array.of(105, 105, 105, 1),\n dodgerblue: Float32Array.of(30, 144, 255, 1),\n firebrick: Float32Array.of(178, 34, 34, 1),\n floralwhite: Float32Array.of(255, 250, 240, 1),\n forestgreen: Float32Array.of(34, 139, 34, 1),\n fuchsia: Float32Array.of(255, 0, 255, 1),\n gainsboro: Float32Array.of(220, 220, 220, 1),\n ghostwhite: Float32Array.of(248, 248, 255, 1),\n gold: Float32Array.of(255, 215, 0, 1),\n goldenrod: Float32Array.of(218, 165, 32, 1),\n gray: Float32Array.of(128, 128, 128, 1),\n green: Float32Array.of(0, 128, 0, 1),\n greenyellow: Float32Array.of(173, 255, 47, 1),\n grey: Float32Array.of(128, 128, 128, 1),\n honeydew: Float32Array.of(240, 255, 240, 1),\n hotpink: Float32Array.of(255, 105, 180, 1),\n indianred: Float32Array.of(205, 92, 92, 1),\n indigo: Float32Array.of(75, 0, 130, 1),\n ivory: Float32Array.of(255, 255, 240, 1),\n khaki: Float32Array.of(240, 230, 140, 1),\n lavender: Float32Array.of(230, 230, 250, 1),\n lavenderblush: Float32Array.of(255, 240, 245, 1),\n lawngreen: Float32Array.of(124, 252, 0, 1),\n lemonchiffon: Float32Array.of(255, 250, 205, 1),\n lightblue: Float32Array.of(173, 216, 230, 1),\n lightcoral: Float32Array.of(240, 128, 128, 1),\n lightcyan: Float32Array.of(224, 255, 255, 1),\n lightgoldenrodyellow: Float32Array.of(250, 250, 210, 1),\n lightgray: Float32Array.of(211, 211, 211, 1),\n lightgreen: Float32Array.of(144, 238, 144, 1),\n lightgrey: Float32Array.of(211, 211, 211, 1),\n lightpink: Float32Array.of(255, 182, 193, 1),\n lightsalmon: Float32Array.of(255, 160, 122, 1),\n lightseagreen: Float32Array.of(32, 178, 170, 1),\n lightskyblue: Float32Array.of(135, 206, 250, 1),\n lightslategray: Float32Array.of(119, 136, 153, 1),\n lightslategrey: Float32Array.of(119, 136, 153, 1),\n lightsteelblue: Float32Array.of(176, 196, 222, 1),\n lightyellow: Float32Array.of(255, 255, 224, 1),\n lime: Float32Array.of(0, 255, 0, 1),\n limegreen: Float32Array.of(50, 205, 50, 1),\n linen: Float32Array.of(250, 240, 230, 1),\n magenta: Float32Array.of(255, 0, 255, 1),\n maroon: Float32Array.of(128, 0, 0, 1),\n mediumaquamarine: Float32Array.of(102, 205, 170, 1),\n mediumblue: Float32Array.of(0, 0, 205, 1),\n mediumorchid: Float32Array.of(186, 85, 211, 1),\n mediumpurple: Float32Array.of(147, 112, 219, 1),\n mediumseagreen: Float32Array.of(60, 179, 113, 1),\n mediumslateblue: Float32Array.of(123, 104, 238, 1),\n mediumspringgreen: Float32Array.of(0, 250, 154, 1),\n mediumturquoise: Float32Array.of(72, 209, 204, 1),\n mediumvioletred: Float32Array.of(199, 21, 133, 1),\n midnightblue: Float32Array.of(25, 25, 112, 1),\n mintcream: Float32Array.of(245, 255, 250, 1),\n mistyrose: Float32Array.of(255, 228, 225, 1),\n moccasin: Float32Array.of(255, 228, 181, 1),\n navajowhite: Float32Array.of(255, 222, 173, 1),\n navy: Float32Array.of(0, 0, 128, 1),\n oldlace: Float32Array.of(253, 245, 230, 1),\n olive: Float32Array.of(128, 128, 0, 1),\n olivedrab: Float32Array.of(107, 142, 35, 1),\n orange: Float32Array.of(255, 165, 0, 1),\n orangered: Float32Array.of(255, 69, 0, 1),\n orchid: Float32Array.of(218, 112, 214, 1),\n palegoldenrod: Float32Array.of(238, 232, 170, 1),\n palegreen: Float32Array.of(152, 251, 152, 1),\n paleturquoise: Float32Array.of(175, 238, 238, 1),\n palevioletred: Float32Array.of(219, 112, 147, 1),\n papayawhip: Float32Array.of(255, 239, 213, 1),\n peachpuff: Float32Array.of(255, 218, 185, 1),\n peru: Float32Array.of(205, 133, 63, 1),\n pink: Float32Array.of(255, 192, 203, 1),\n plum: Float32Array.of(221, 160, 221, 1),\n powderblue: Float32Array.of(176, 224, 230, 1),\n purple: Float32Array.of(128, 0, 128, 1),\n rebeccapurple: Float32Array.of(102, 51, 153, 1),\n red: Float32Array.of(255, 0, 0, 1),\n rosybrown: Float32Array.of(188, 143, 143, 1),\n royalblue: Float32Array.of(65, 105, 225, 1),\n saddlebrown: Float32Array.of(139, 69, 19, 1),\n salmon: Float32Array.of(250, 128, 114, 1),\n sandybrown: Float32Array.of(244, 164, 96, 1),\n seagreen: Float32Array.of(46, 139, 87, 1),\n seashell: Float32Array.of(255, 245, 238, 1),\n sienna: Float32Array.of(160, 82, 45, 1),\n silver: Float32Array.of(192, 192, 192, 1),\n skyblue: Float32Array.of(135, 206, 235, 1),\n slateblue: Float32Array.of(106, 90, 205, 1),\n slategray: Float32Array.of(112, 128, 144, 1),\n slategrey: Float32Array.of(112, 128, 144, 1),\n snow: Float32Array.of(255, 250, 250, 1),\n springgreen: Float32Array.of(0, 255, 127, 1),\n steelblue: Float32Array.of(70, 130, 180, 1),\n tan: Float32Array.of(210, 180, 140, 1),\n teal: Float32Array.of(0, 128, 128, 1),\n thistle: Float32Array.of(216, 191, 216, 1),\n tomato: Float32Array.of(255, 99, 71, 1),\n turquoise: Float32Array.of(64, 224, 208, 1),\n violet: Float32Array.of(238, 130, 238, 1),\n wheat: Float32Array.of(245, 222, 179, 1),\n white: Float32Array.of(255, 255, 255, 1),\n whitesmoke: Float32Array.of(245, 245, 245, 1),\n yellow: Float32Array.of(255, 255, 0, 1),\n yellowgreen: Float32Array.of(154, 205, 50, 1),\n};\n\nconst clampCSSByte = (j: number) => {\n // Clamp to integer 0 .. 255.\n const i = Math.round(j); // Seems to be what Chrome does (vs truncation).\n // eslint-disable-next-line no-nested-ternary\n return i < 0 ? 0 : i > 255 ? 255 : i;\n};\n\nconst clampCSSFloat = (f: number) => {\n // eslint-disable-next-line no-nested-ternary\n return f < 0 ? 0 : f > 1 ? 1 : f;\n};\n\nconst parseCSSInt = (str: string) => {\n // int or percentage.\n if (str[str.length - 1] === \"%\") {\n return clampCSSByte((parseFloat(str) / 100) * 255);\n }\n // eslint-disable-next-line radix\n return clampCSSByte(parseInt(str));\n};\n\nconst parseCSSFloat = (str: string | undefined) => {\n if (str === undefined) {\n return 1;\n }\n // float or percentage.\n if (str[str.length - 1] === \"%\") {\n return clampCSSFloat(parseFloat(str) / 100);\n }\n return clampCSSFloat(parseFloat(str));\n};\n\nconst CSSHueToRGB = (m1: number, m2: number, h: number) => {\n if (h < 0) {\n h += 1;\n } else if (h > 1) {\n h -= 1;\n }\n\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n if (h * 2 < 1) {\n return m2;\n }\n if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n return m1;\n};\n\nconst parseCSSColor = (cssStr: string) => {\n // Remove all whitespace, not compliant, but should just be more accepting.\n var str = cssStr.replace(/ /g, \"\").toLowerCase();\n\n // Color keywords (and transparent) lookup.\n if (str in CSSColorTable) {\n const cl = CSSColorTable[str as keyof typeof CSSColorTable];\n if (cl) {\n return Float32Array.of(...cl);\n }\n return null;\n } // dup.\n\n // #abc and #abc123 syntax.\n if (str[0] === \"#\") {\n if (str.length === 4) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xfff)) {\n return null;\n } // Covers NaN.\n return [\n ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8),\n (iv & 0xf0) | ((iv & 0xf0) >> 4),\n (iv & 0xf) | ((iv & 0xf) << 4),\n 1,\n ];\n } else if (str.length === 7) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xffffff)) {\n return null;\n } // Covers NaN.\n return [(iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, 1];\n }\n\n return null;\n }\n\n var op = str.indexOf(\"(\"),\n ep = str.indexOf(\")\");\n if (op !== -1 && ep + 1 === str.length) {\n var fname = str.substr(0, op);\n var params = str.substr(op + 1, ep - (op + 1)).split(\",\");\n var alpha = 1; // To allow case fallthrough.\n switch (fname) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-expect-error\n case \"rgba\":\n if (params.length !== 4) {\n return null;\n }\n alpha = parseCSSFloat(params.pop());\n // Fall through.\n case \"rgb\":\n if (params.length !== 3) {\n return null;\n }\n return [\n parseCSSInt(params[0]),\n parseCSSInt(params[1]),\n parseCSSInt(params[2]),\n alpha,\n ];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-expect-error\n case \"hsla\":\n if (params.length !== 4) {\n return null;\n }\n alpha = parseCSSFloat(params.pop());\n // Fall through.\n case \"hsl\":\n if (params.length !== 3) {\n return null;\n }\n var h = (((parseFloat(params[0]) % 360) + 360) % 360) / 360; // 0 .. 1\n // NOTE(deanm): According to the CSS spec s/l should only be\n // percentages, but we don't bother and let float or percentage.\n var s = parseCSSFloat(params[1]);\n var l = parseCSSFloat(params[2]);\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n var m1 = l * 2 - m2;\n return [\n clampCSSByte(CSSHueToRGB(m1, m2, h + 1 / 3) * 255),\n clampCSSByte(CSSHueToRGB(m1, m2, h) * 255),\n clampCSSByte(CSSHueToRGB(m1, m2, h - 1 / 3) * 255),\n alpha,\n ];\n default:\n return null;\n }\n }\n\n return null;\n};\n\nexport const Color = (color: InputColor): SkColor => {\n if (color instanceof Float32Array) {\n return color;\n } else if (typeof color === \"string\") {\n const r = parseCSSColor(color);\n const rgba = r === null ? CSSColorTable.black : r;\n return Float32Array.of(\n rgba[0] / 255,\n rgba[1] / 255,\n rgba[2] / 255,\n rgba[3]\n );\n } else {\n return Float32Array.of(\n red(color) / 255,\n green(color) / 255,\n blue(color) / 255,\n alphaf(color)\n );\n }\n};\n"],"mappings":"AAEA,MAAMA,MAAM,GAAIC,CAAD,IAAe,CAAEA,CAAC,IAAI,EAAN,GAAY,GAAb,IAAoB,GAAlD;;AACA,MAAMC,GAAG,GAAID,CAAD,IAAgBA,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,OAAO,CACLhB,YAAY,CAACc,WAAW,CAACC,EAAD,EAAKC,EAAL,EAASC,CAAC,GAAG,IAAI,CAAjB,CAAX,GAAiC,GAAlC,CADP,EAELjB,YAAY,CAACc,WAAW,CAACC,EAAD,EAAKC,EAAL,EAASC,CAAT,CAAX,GAAyB,GAA1B,CAFP,EAGLjB,YAAY,CAACc,WAAW,CAACC,EAAD,EAAKC,EAAL,EAASC,CAAC,GAAG,IAAI,CAAjB,CAAX,GAAiC,GAAlC,CAHP,EAILc,KAJK,CAAP;;MAMF;QACE,OAAO,IAAP;IA7CJ;EA+CD;;EAED,OAAO,IAAP;AACD,CA7FD;;AA+FA,OAAO,MAAMI,KAAK,GAAIC,KAAD,IAAgC;EACnD,IAAIA,KAAK,YAAYvL,YAArB,EAAmC;IACjC,OAAOuL,KAAP;EACD,CAFD,MAEO,IAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;IACpC,MAAMC,CAAC,GAAGnB,aAAa,CAACkB,KAAD,CAAvB;IACA,MAAME,IAAI,GAAGD,CAAC,KAAK,IAAN,GAAa1L,aAAa,CAACW,KAA3B,GAAmC+K,CAAhD;IACA,OAAOxL,YAAY,CAACC,EAAb,CACLwL,IAAI,CAAC,CAAD,CAAJ,GAAU,GADL,EAELA,IAAI,CAAC,CAAD,CAAJ,GAAU,GAFL,EAGLA,IAAI,CAAC,CAAD,CAAJ,GAAU,GAHL,EAILA,IAAI,CAAC,CAAD,CAJC,CAAP;EAMD,CATM,MASA;IACL,OAAOzL,YAAY,CAACC,EAAb,CACLN,GAAG,CAAC4L,KAAD,CAAH,GAAa,GADR,EAEL3L,KAAK,CAAC2L,KAAD,CAAL,GAAe,GAFV,EAGL1L,IAAI,CAAC0L,KAAD,CAAJ,GAAc,GAHT,EAIL9L,MAAM,CAAC8L,KAAD,CAJD,CAAP;EAMD;AACF,CApBM"}
1
+ {"version":3,"names":["alphaf","c","red","green","blue","CSSColorTable","transparent","Float32Array","of","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","clampCSSByte","j","i","Math","round","clampCSSFloat","f","parseCSSInt","str","length","parseFloat","parseInt","parseCSSFloat","undefined","CSSHueToRGB","m1","m2","h","parseCSSColor","cssStr","replace","toLowerCase","cl","iv","substr","op","indexOf","ep","fname","params","split","alpha","pop","s","l","Color","color","r","rgba"],"sources":["JsiSkColor.ts"],"sourcesContent":["import type { SkColor, Color as InputColor } from \"../types\";\n\nconst alphaf = (c: number) => ((c >> 24) & 255) / 255;\nconst red = (c: number) => (c >> 16) & 255;\nconst green = (c: number) => (c >> 8) & 255;\nconst blue = (c: number) => c & 255;\n\n// From https://raw.githubusercontent.com/deanm/css-color-parser-js/master/csscolorparser.js\nconst CSSColorTable = {\n transparent: Float32Array.of(0, 0, 0, 0),\n aliceblue: Float32Array.of(240, 248, 255, 1),\n antiquewhite: Float32Array.of(250, 235, 215, 1),\n aqua: Float32Array.of(0, 255, 255, 1),\n aquamarine: Float32Array.of(127, 255, 212, 1),\n azure: Float32Array.of(240, 255, 255, 1),\n beige: Float32Array.of(245, 245, 220, 1),\n bisque: Float32Array.of(255, 228, 196, 1),\n black: Float32Array.of(0, 0, 0, 1),\n blanchedalmond: Float32Array.of(255, 235, 205, 1),\n blue: Float32Array.of(0, 0, 255, 1),\n blueviolet: Float32Array.of(138, 43, 226, 1),\n brown: Float32Array.of(165, 42, 42, 1),\n burlywood: Float32Array.of(222, 184, 135, 1),\n cadetblue: Float32Array.of(95, 158, 160, 1),\n chartreuse: Float32Array.of(127, 255, 0, 1),\n chocolate: Float32Array.of(210, 105, 30, 1),\n coral: Float32Array.of(255, 127, 80, 1),\n cornflowerblue: Float32Array.of(100, 149, 237, 1),\n cornsilk: Float32Array.of(255, 248, 220, 1),\n crimson: Float32Array.of(220, 20, 60, 1),\n cyan: Float32Array.of(0, 255, 255, 1),\n darkblue: Float32Array.of(0, 0, 139, 1),\n darkcyan: Float32Array.of(0, 139, 139, 1),\n darkgoldenrod: Float32Array.of(184, 134, 11, 1),\n darkgray: Float32Array.of(169, 169, 169, 1),\n darkgreen: Float32Array.of(0, 100, 0, 1),\n darkgrey: Float32Array.of(169, 169, 169, 1),\n darkkhaki: Float32Array.of(189, 183, 107, 1),\n darkmagenta: Float32Array.of(139, 0, 139, 1),\n darkolivegreen: Float32Array.of(85, 107, 47, 1),\n darkorange: Float32Array.of(255, 140, 0, 1),\n darkorchid: Float32Array.of(153, 50, 204, 1),\n darkred: Float32Array.of(139, 0, 0, 1),\n darksalmon: Float32Array.of(233, 150, 122, 1),\n darkseagreen: Float32Array.of(143, 188, 143, 1),\n darkslateblue: Float32Array.of(72, 61, 139, 1),\n darkslategray: Float32Array.of(47, 79, 79, 1),\n darkslategrey: Float32Array.of(47, 79, 79, 1),\n darkturquoise: Float32Array.of(0, 206, 209, 1),\n darkviolet: Float32Array.of(148, 0, 211, 1),\n deeppink: Float32Array.of(255, 20, 147, 1),\n deepskyblue: Float32Array.of(0, 191, 255, 1),\n dimgray: Float32Array.of(105, 105, 105, 1),\n dimgrey: Float32Array.of(105, 105, 105, 1),\n dodgerblue: Float32Array.of(30, 144, 255, 1),\n firebrick: Float32Array.of(178, 34, 34, 1),\n floralwhite: Float32Array.of(255, 250, 240, 1),\n forestgreen: Float32Array.of(34, 139, 34, 1),\n fuchsia: Float32Array.of(255, 0, 255, 1),\n gainsboro: Float32Array.of(220, 220, 220, 1),\n ghostwhite: Float32Array.of(248, 248, 255, 1),\n gold: Float32Array.of(255, 215, 0, 1),\n goldenrod: Float32Array.of(218, 165, 32, 1),\n gray: Float32Array.of(128, 128, 128, 1),\n green: Float32Array.of(0, 128, 0, 1),\n greenyellow: Float32Array.of(173, 255, 47, 1),\n grey: Float32Array.of(128, 128, 128, 1),\n honeydew: Float32Array.of(240, 255, 240, 1),\n hotpink: Float32Array.of(255, 105, 180, 1),\n indianred: Float32Array.of(205, 92, 92, 1),\n indigo: Float32Array.of(75, 0, 130, 1),\n ivory: Float32Array.of(255, 255, 240, 1),\n khaki: Float32Array.of(240, 230, 140, 1),\n lavender: Float32Array.of(230, 230, 250, 1),\n lavenderblush: Float32Array.of(255, 240, 245, 1),\n lawngreen: Float32Array.of(124, 252, 0, 1),\n lemonchiffon: Float32Array.of(255, 250, 205, 1),\n lightblue: Float32Array.of(173, 216, 230, 1),\n lightcoral: Float32Array.of(240, 128, 128, 1),\n lightcyan: Float32Array.of(224, 255, 255, 1),\n lightgoldenrodyellow: Float32Array.of(250, 250, 210, 1),\n lightgray: Float32Array.of(211, 211, 211, 1),\n lightgreen: Float32Array.of(144, 238, 144, 1),\n lightgrey: Float32Array.of(211, 211, 211, 1),\n lightpink: Float32Array.of(255, 182, 193, 1),\n lightsalmon: Float32Array.of(255, 160, 122, 1),\n lightseagreen: Float32Array.of(32, 178, 170, 1),\n lightskyblue: Float32Array.of(135, 206, 250, 1),\n lightslategray: Float32Array.of(119, 136, 153, 1),\n lightslategrey: Float32Array.of(119, 136, 153, 1),\n lightsteelblue: Float32Array.of(176, 196, 222, 1),\n lightyellow: Float32Array.of(255, 255, 224, 1),\n lime: Float32Array.of(0, 255, 0, 1),\n limegreen: Float32Array.of(50, 205, 50, 1),\n linen: Float32Array.of(250, 240, 230, 1),\n magenta: Float32Array.of(255, 0, 255, 1),\n maroon: Float32Array.of(128, 0, 0, 1),\n mediumaquamarine: Float32Array.of(102, 205, 170, 1),\n mediumblue: Float32Array.of(0, 0, 205, 1),\n mediumorchid: Float32Array.of(186, 85, 211, 1),\n mediumpurple: Float32Array.of(147, 112, 219, 1),\n mediumseagreen: Float32Array.of(60, 179, 113, 1),\n mediumslateblue: Float32Array.of(123, 104, 238, 1),\n mediumspringgreen: Float32Array.of(0, 250, 154, 1),\n mediumturquoise: Float32Array.of(72, 209, 204, 1),\n mediumvioletred: Float32Array.of(199, 21, 133, 1),\n midnightblue: Float32Array.of(25, 25, 112, 1),\n mintcream: Float32Array.of(245, 255, 250, 1),\n mistyrose: Float32Array.of(255, 228, 225, 1),\n moccasin: Float32Array.of(255, 228, 181, 1),\n navajowhite: Float32Array.of(255, 222, 173, 1),\n navy: Float32Array.of(0, 0, 128, 1),\n oldlace: Float32Array.of(253, 245, 230, 1),\n olive: Float32Array.of(128, 128, 0, 1),\n olivedrab: Float32Array.of(107, 142, 35, 1),\n orange: Float32Array.of(255, 165, 0, 1),\n orangered: Float32Array.of(255, 69, 0, 1),\n orchid: Float32Array.of(218, 112, 214, 1),\n palegoldenrod: Float32Array.of(238, 232, 170, 1),\n palegreen: Float32Array.of(152, 251, 152, 1),\n paleturquoise: Float32Array.of(175, 238, 238, 1),\n palevioletred: Float32Array.of(219, 112, 147, 1),\n papayawhip: Float32Array.of(255, 239, 213, 1),\n peachpuff: Float32Array.of(255, 218, 185, 1),\n peru: Float32Array.of(205, 133, 63, 1),\n pink: Float32Array.of(255, 192, 203, 1),\n plum: Float32Array.of(221, 160, 221, 1),\n powderblue: Float32Array.of(176, 224, 230, 1),\n purple: Float32Array.of(128, 0, 128, 1),\n rebeccapurple: Float32Array.of(102, 51, 153, 1),\n red: Float32Array.of(255, 0, 0, 1),\n rosybrown: Float32Array.of(188, 143, 143, 1),\n royalblue: Float32Array.of(65, 105, 225, 1),\n saddlebrown: Float32Array.of(139, 69, 19, 1),\n salmon: Float32Array.of(250, 128, 114, 1),\n sandybrown: Float32Array.of(244, 164, 96, 1),\n seagreen: Float32Array.of(46, 139, 87, 1),\n seashell: Float32Array.of(255, 245, 238, 1),\n sienna: Float32Array.of(160, 82, 45, 1),\n silver: Float32Array.of(192, 192, 192, 1),\n skyblue: Float32Array.of(135, 206, 235, 1),\n slateblue: Float32Array.of(106, 90, 205, 1),\n slategray: Float32Array.of(112, 128, 144, 1),\n slategrey: Float32Array.of(112, 128, 144, 1),\n snow: Float32Array.of(255, 250, 250, 1),\n springgreen: Float32Array.of(0, 255, 127, 1),\n steelblue: Float32Array.of(70, 130, 180, 1),\n tan: Float32Array.of(210, 180, 140, 1),\n teal: Float32Array.of(0, 128, 128, 1),\n thistle: Float32Array.of(216, 191, 216, 1),\n tomato: Float32Array.of(255, 99, 71, 1),\n turquoise: Float32Array.of(64, 224, 208, 1),\n violet: Float32Array.of(238, 130, 238, 1),\n wheat: Float32Array.of(245, 222, 179, 1),\n white: Float32Array.of(255, 255, 255, 1),\n whitesmoke: Float32Array.of(245, 245, 245, 1),\n yellow: Float32Array.of(255, 255, 0, 1),\n yellowgreen: Float32Array.of(154, 205, 50, 1),\n};\n\nconst clampCSSByte = (j: number) => {\n // Clamp to integer 0 .. 255.\n const i = Math.round(j); // Seems to be what Chrome does (vs truncation).\n // eslint-disable-next-line no-nested-ternary\n return i < 0 ? 0 : i > 255 ? 255 : i;\n};\n\nconst clampCSSFloat = (f: number) => {\n // eslint-disable-next-line no-nested-ternary\n return f < 0 ? 0 : f > 1 ? 1 : f;\n};\n\nconst parseCSSInt = (str: string) => {\n // int or percentage.\n if (str[str.length - 1] === \"%\") {\n return clampCSSByte((parseFloat(str) / 100) * 255);\n }\n // eslint-disable-next-line radix\n return clampCSSByte(parseInt(str));\n};\n\nconst parseCSSFloat = (str: string | undefined) => {\n if (str === undefined) {\n return 1;\n }\n // float or percentage.\n if (str[str.length - 1] === \"%\") {\n return clampCSSFloat(parseFloat(str) / 100);\n }\n return clampCSSFloat(parseFloat(str));\n};\n\nconst CSSHueToRGB = (m1: number, m2: number, h: number) => {\n if (h < 0) {\n h += 1;\n } else if (h > 1) {\n h -= 1;\n }\n\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n if (h * 2 < 1) {\n return m2;\n }\n if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n return m1;\n};\n\nconst parseCSSColor = (cssStr: string) => {\n // Remove all whitespace, not compliant, but should just be more accepting.\n var str = cssStr.replace(/ /g, \"\").toLowerCase();\n\n // Color keywords (and transparent) lookup.\n if (str in CSSColorTable) {\n const cl = CSSColorTable[str as keyof typeof CSSColorTable];\n if (cl) {\n return Float32Array.of(...cl);\n }\n return null;\n } // dup.\n\n // #abc and #abc123 syntax.\n if (str[0] === \"#\") {\n if (str.length === 4) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xfff)) {\n return null;\n } // Covers NaN.\n return [\n ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8),\n (iv & 0xf0) | ((iv & 0xf0) >> 4),\n (iv & 0xf) | ((iv & 0xf) << 4),\n 1,\n ];\n } else if (str.length === 7) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xffffff)) {\n return null;\n } // Covers NaN.\n return [(iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, 1];\n } else if (str.length === 9) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xffffffff)) {\n return null; // Covers NaN.\n }\n return [\n ((iv & 0xff000000) >> 24) & 0xff,\n (iv & 0xff0000) >> 16,\n (iv & 0xff00) >> 8,\n (iv & 0xff) / 255,\n ];\n }\n\n return null;\n }\n\n var op = str.indexOf(\"(\"),\n ep = str.indexOf(\")\");\n if (op !== -1 && ep + 1 === str.length) {\n var fname = str.substr(0, op);\n var params = str.substr(op + 1, ep - (op + 1)).split(\",\");\n var alpha = 1; // To allow case fallthrough.\n switch (fname) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-expect-error\n case \"rgba\":\n if (params.length !== 4) {\n return null;\n }\n alpha = parseCSSFloat(params.pop());\n // Fall through.\n case \"rgb\":\n if (params.length !== 3) {\n return null;\n }\n return [\n parseCSSInt(params[0]),\n parseCSSInt(params[1]),\n parseCSSInt(params[2]),\n alpha,\n ];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-expect-error\n case \"hsla\":\n if (params.length !== 4) {\n return null;\n }\n alpha = parseCSSFloat(params.pop());\n // Fall through.\n case \"hsl\":\n if (params.length !== 3) {\n return null;\n }\n var h = (((parseFloat(params[0]) % 360) + 360) % 360) / 360; // 0 .. 1\n // NOTE(deanm): According to the CSS spec s/l should only be\n // percentages, but we don't bother and let float or percentage.\n var s = parseCSSFloat(params[1]);\n var l = parseCSSFloat(params[2]);\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n var m1 = l * 2 - m2;\n return [\n clampCSSByte(CSSHueToRGB(m1, m2, h + 1 / 3) * 255),\n clampCSSByte(CSSHueToRGB(m1, m2, h) * 255),\n clampCSSByte(CSSHueToRGB(m1, m2, h - 1 / 3) * 255),\n alpha,\n ];\n default:\n return null;\n }\n }\n\n return null;\n};\n\nexport const Color = (color: InputColor): SkColor => {\n if (color instanceof Float32Array) {\n return color;\n } else if (typeof color === \"string\") {\n const r = parseCSSColor(color);\n const rgba = r === null ? CSSColorTable.black : r;\n return Float32Array.of(\n rgba[0] / 255,\n rgba[1] / 255,\n rgba[2] / 255,\n rgba[3]\n );\n } else {\n return Float32Array.of(\n red(color) / 255,\n green(color) / 255,\n blue(color) / 255,\n alphaf(color)\n );\n }\n};\n"],"mappings":"AAEA,MAAMA,MAAM,GAAIC,CAAD,IAAe,CAAEA,CAAC,IAAI,EAAN,GAAY,GAAb,IAAoB,GAAlD;;AACA,MAAMC,GAAG,GAAID,CAAD,IAAgBA,CAAC,IAAI,EAAN,GAAY,GAAvC;;AACA,MAAME,KAAK,GAAIF,CAAD,IAAgBA,CAAC,IAAI,CAAN,GAAW,GAAxC;;AACA,MAAMG,IAAI,GAAIH,CAAD,IAAeA,CAAC,GAAG,GAAhC,C,CAEA;;;AACA,MAAMI,aAAa,GAAG;EACpBC,WAAW,EAAEC,YAAY,CAACC,EAAb,CAAgB,CAAhB,EAAmB,CAAnB,EAAsB,CAAtB,EAAyB,CAAzB,CADO;EAEpBC,SAAS,EAAEF,YAAY,CAACC,EAAb,CAAgB,GAAhB,EAAqB,GAArB,EAA0B,GAA1B,EAA+B,CAA/B,CAFS;EAGpBE,YAAY,EAAEH,YAAY,CAACC,EAAb,CAAgB,GAAhB,EAAqB,GAArB,EAA0B,GAA1B,EAA+B,CAA/B,CAHM;EAIpBG,IAAI,EAAEJ,YAAY,CAACC,EAAb,CAAgB,CAAhB,EAAmB,GAAnB,EAAwB,GAAxB,EAA6B,CAA7B,CAJc;EAKpBI,UAAU,EAAEL,YAAY,CAACC,EAAb,CAAgB,GAAhB,EAAqB,GAArB,EAA0B,GAA1B,EAA+B,CAA/B,CALQ;EAMpBK,KAAK,EAAEN,YAAY,CAACC,EAAb,CAAgB,GAAhB,EAAqB,GAArB,E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AAjB,CAAX,GAAiC,GAAlC,CAHP,EAILc,KAJK,CAAP;;MAMF;QACE,OAAO,IAAP;IA7CJ;EA+CD;;EAED,OAAO,IAAP;AACD,CAxGD;;AA0GA,OAAO,MAAMI,KAAK,GAAIC,KAAD,IAAgC;EACnD,IAAIA,KAAK,YAAYvL,YAArB,EAAmC;IACjC,OAAOuL,KAAP;EACD,CAFD,MAEO,IAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;IACpC,MAAMC,CAAC,GAAGnB,aAAa,CAACkB,KAAD,CAAvB;IACA,MAAME,IAAI,GAAGD,CAAC,KAAK,IAAN,GAAa1L,aAAa,CAACW,KAA3B,GAAmC+K,CAAhD;IACA,OAAOxL,YAAY,CAACC,EAAb,CACLwL,IAAI,CAAC,CAAD,CAAJ,GAAU,GADL,EAELA,IAAI,CAAC,CAAD,CAAJ,GAAU,GAFL,EAGLA,IAAI,CAAC,CAAD,CAAJ,GAAU,GAHL,EAILA,IAAI,CAAC,CAAD,CAJC,CAAP;EAMD,CATM,MASA;IACL,OAAOzL,YAAY,CAACC,EAAb,CACLN,GAAG,CAAC4L,KAAD,CAAH,GAAa,GADR,EAEL3L,KAAK,CAAC2L,KAAD,CAAL,GAAe,GAFV,EAGL1L,IAAI,CAAC0L,KAAD,CAAJ,GAAc,GAHT,EAIL9L,MAAM,CAAC8L,KAAD,CAJD,CAAP;EAMD;AACF,CApBM"}
@@ -1,18 +1,14 @@
1
1
  import { HostObject } from "./Host";
2
2
  import { JsiSkPath } from "./JsiSkPath";
3
+ import { JsiSkPoint } from "./JsiSkPoint";
3
4
  export class JsiSkContourMeasure extends HostObject {
4
5
  constructor(CanvasKit, ref) {
5
6
  super(CanvasKit, ref, "ContourMeasure");
6
7
  }
7
8
 
8
9
  getPosTan(distance) {
9
- const [px, py, tx, ty] = this.ref.getPosTan(distance);
10
- return {
11
- px,
12
- py,
13
- tx,
14
- ty
15
- };
10
+ const posTan = this.ref.getPosTan(distance);
11
+ return [new JsiSkPoint(this.CanvasKit, posTan.slice(0, 2)), new JsiSkPoint(this.CanvasKit, posTan.slice(2))];
16
12
  }
17
13
 
18
14
  getSegment(startD, stopD, startWithMoveTo) {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkPath","JsiSkContourMeasure","constructor","CanvasKit","ref","getPosTan","distance","px","py","tx","ty","getSegment","startD","stopD","startWithMoveTo","isClosed","length"],"sources":["JsiSkContourMeasure.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasure } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasure } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\n\nexport class JsiSkContourMeasure\n extends HostObject<ContourMeasure, \"ContourMeasure\">\n implements SkContourMeasure\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasure) {\n super(CanvasKit, ref, \"ContourMeasure\");\n }\n\n getPosTan(distance: number) {\n const [px, py, tx, ty] = this.ref.getPosTan(distance);\n return { px, py, tx, ty };\n }\n\n getSegment(startD: number, stopD: number, startWithMoveTo: boolean) {\n return new JsiSkPath(\n this.CanvasKit,\n this.ref.getSegment(startD, stopD, startWithMoveTo)\n );\n }\n\n isClosed() {\n return this.ref.isClosed();\n }\n\n length() {\n return this.ref.length();\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,mBAAN,SACGF,UADH,CAGP;EACEG,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA4C;IACrD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,gBAAtB;EACD;;EAEDC,SAAS,CAACC,QAAD,EAAmB;IAC1B,MAAM,CAACC,EAAD,EAAKC,EAAL,EAASC,EAAT,EAAaC,EAAb,IAAmB,KAAKN,GAAL,CAASC,SAAT,CAAmBC,QAAnB,CAAzB;IACA,OAAO;MAAEC,EAAF;MAAMC,EAAN;MAAUC,EAAV;MAAcC;IAAd,CAAP;EACD;;EAEDC,UAAU,CAACC,MAAD,EAAiBC,KAAjB,EAAgCC,eAAhC,EAA0D;IAClE,OAAO,IAAId,SAAJ,CACL,KAAKG,SADA,EAEL,KAAKC,GAAL,CAASO,UAAT,CAAoBC,MAApB,EAA4BC,KAA5B,EAAmCC,eAAnC,CAFK,CAAP;EAID;;EAEDC,QAAQ,GAAG;IACT,OAAO,KAAKX,GAAL,CAASW,QAAT,EAAP;EACD;;EAEDC,MAAM,GAAG;IACP,OAAO,KAAKZ,GAAL,CAASY,MAAT,EAAP;EACD;;AAvBH"}
1
+ {"version":3,"names":["HostObject","JsiSkPath","JsiSkPoint","JsiSkContourMeasure","constructor","CanvasKit","ref","getPosTan","distance","posTan","slice","getSegment","startD","stopD","startWithMoveTo","isClosed","length"],"sources":["JsiSkContourMeasure.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasure } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasure } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkContourMeasure\n extends HostObject<ContourMeasure, \"ContourMeasure\">\n implements SkContourMeasure\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasure) {\n super(CanvasKit, ref, \"ContourMeasure\");\n }\n\n getPosTan(distance: number): [position: JsiSkPoint, tangent: JsiSkPoint] {\n const posTan = this.ref.getPosTan(distance);\n return [\n new JsiSkPoint(this.CanvasKit, posTan.slice(0, 2)),\n new JsiSkPoint(this.CanvasKit, posTan.slice(2)),\n ];\n }\n\n getSegment(startD: number, stopD: number, startWithMoveTo: boolean) {\n return new JsiSkPath(\n this.CanvasKit,\n this.ref.getSegment(startD, stopD, startWithMoveTo)\n );\n }\n\n isClosed() {\n return this.ref.isClosed();\n }\n\n length() {\n return this.ref.length();\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,OAAO,MAAMC,mBAAN,SACGH,UADH,CAGP;EACEI,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA4C;IACrD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,gBAAtB;EACD;;EAEDC,SAAS,CAACC,QAAD,EAAgE;IACvE,MAAMC,MAAM,GAAG,KAAKH,GAAL,CAASC,SAAT,CAAmBC,QAAnB,CAAf;IACA,OAAO,CACL,IAAIN,UAAJ,CAAe,KAAKG,SAApB,EAA+BI,MAAM,CAACC,KAAP,CAAa,CAAb,EAAgB,CAAhB,CAA/B,CADK,EAEL,IAAIR,UAAJ,CAAe,KAAKG,SAApB,EAA+BI,MAAM,CAACC,KAAP,CAAa,CAAb,CAA/B,CAFK,CAAP;EAID;;EAEDC,UAAU,CAACC,MAAD,EAAiBC,KAAjB,EAAgCC,eAAhC,EAA0D;IAClE,OAAO,IAAIb,SAAJ,CACL,KAAKI,SADA,EAEL,KAAKC,GAAL,CAASK,UAAT,CAAoBC,MAApB,EAA4BC,KAA5B,EAAmCC,eAAnC,CAFK,CAAP;EAID;;EAEDC,QAAQ,GAAG;IACT,OAAO,KAAKT,GAAL,CAASS,QAAT,EAAP;EACD;;EAEDC,MAAM,GAAG;IACP,OAAO,KAAKV,GAAL,CAASU,MAAT,EAAP;EACD;;AA1BH"}
@@ -13,7 +13,7 @@ export class JsiSkMatrix extends HostObject {
13
13
  }
14
14
 
15
15
  scale(x, y) {
16
- this.concat(new JsiSkMatrix(this.CanvasKit, Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))));
16
+ this.concat(new JsiSkMatrix(this.CanvasKit, Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y !== null && y !== void 0 ? y : x))));
17
17
  }
18
18
 
19
19
  skew(x, y) {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","concat","matrix","set","Matrix","multiply","fromValue","translate","x","y","Float32Array","of","translated","scale","scaled","skew","skewed","rotate","value","rotated","identity","get","Array","from"],"sources":["JsiSkMatrix.ts"],"sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport type { SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n concat(matrix: SkMatrix) {\n this.ref.set(\n this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))\n );\n }\n\n translate(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.translated(x, y))\n )\n );\n }\n\n scale(x: number, y?: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))\n )\n );\n }\n\n skew(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.skewed(x, y))\n )\n );\n }\n\n rotate(value: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.rotated(value))\n )\n );\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,WAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;EACD;;EAEDC,MAAM,CAACC,MAAD,EAAmB;IACvB,KAAKF,GAAL,CAASG,GAAT,CACE,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,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version":3,"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","concat","matrix","set","Matrix","multiply","fromValue","translate","x","y","Float32Array","of","translated","scale","scaled","skew","skewed","rotate","value","rotated","identity","get","Array","from"],"sources":["JsiSkMatrix.ts"],"sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport type { SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n concat(matrix: SkMatrix) {\n this.ref.set(\n this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))\n );\n }\n\n translate(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.translated(x, y))\n )\n );\n }\n\n scale(x: number, y?: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))\n )\n );\n }\n\n skew(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.skewed(x, y))\n )\n );\n }\n\n rotate(value: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.rotated(value))\n )\n );\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,WAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;EACD;;EAEDC,MAAM,CAACC,MAAD,EAAmB;IACvB,KAAKF,GAAL,C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B,EAAb;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAOC,KAAK,CAACC,IAAN,CAAW,KAAKvB,GAAhB,CAAP;EACD;;AArDH"}
@@ -17,7 +17,7 @@ export class RNSkAnimation extends RNSkClockValue {
17
17
  }
18
18
 
19
19
  update(nextValue) {
20
- var _this$_animationState2;
20
+ var _this$_animationState2, _this$_animationState3;
21
21
 
22
22
  if (this._callback) {
23
23
  var _this$_animationState;
@@ -29,7 +29,7 @@ export class RNSkAnimation extends RNSkClockValue {
29
29
  }
30
30
  }
31
31
 
32
- super.update(((_this$_animationState2 = this._animationState) === null || _this$_animationState2 === void 0 ? void 0 : _this$_animationState2.current) ?? nextValue);
32
+ super.update((_this$_animationState2 = (_this$_animationState3 = this._animationState) === null || _this$_animationState3 === void 0 ? void 0 : _this$_animationState3.current) !== null && _this$_animationState2 !== void 0 ? _this$_animationState2 : nextValue);
33
33
  }
34
34
 
35
35
  }
@@ -1 +1 @@
1
- {"version":3,"names":["RNSkClockValue","RNSkAnimation","constructor","callback","raf","undefined","_callback","cancel","stop","update","nextValue","_animationState","finished","current"],"sources":["RNSkAnimation.ts"],"sourcesContent":["import type { AnimationState, SkiaAnimation } from \"../types\";\n\nimport { RNSkClockValue } from \"./RNSkClockValue\";\n\nexport class RNSkAnimation<S extends AnimationState = AnimationState>\n extends RNSkClockValue\n implements SkiaAnimation\n{\n constructor(\n callback: (t: number, state: S | undefined) => S,\n raf: (callback: (time: number) => void) => number\n ) {\n super(raf);\n this._callback = callback;\n }\n\n private _callback: (t: number, state: S | undefined) => S;\n private _animationState: S | undefined = undefined;\n\n public cancel() {\n this.stop();\n }\n\n protected update(nextValue: number): void {\n if (this._callback) {\n this._animationState = this._callback(nextValue, this._animationState);\n if (this._animationState?.finished) {\n this.stop();\n }\n }\n super.update(this._animationState?.current ?? nextValue);\n }\n}\n"],"mappings":";;AAEA,SAASA,cAAT,QAA+B,kBAA/B;AAEA,OAAO,MAAMC,aAAN,SACGD,cADH,CAGP;EACEE,WAAW,CACTC,QADS,EAETC,GAFS,EAGT;IACA,MAAMA,GAAN;;IADA;;IAAA,yCAMuCC,SANvC;;IAEA,KAAKC,SAAL,GAAiBH,QAAjB;EACD;;EAKMI,MAAM,GAAG;IACd,KAAKC,IAAL;EACD;;EAESC,MAAM,CAACC,SAAD,EAA0B;IAAA;;IACxC,IAAI,KAAKJ,SAAT,EAAoB;MAAA;;MAClB,KAAKK,eAAL,GAAuB,KAAKL,SAAL,CAAeI,SAAf,EAA0B,KAAKC,eAA/B,CAAvB;;MACA,6BAAI,KAAKA,eAAT,kDAAI,sBAAsBC,QAA1B,EAAoC;QAClC,KAAKJ,IAAL;MACD;IACF;;IACD,MAAMC,MAAN,CAAa,gCAAKE,eAAL,kFAAsBE,OAAtB,KAAiCH,SAA9C;EACD;;AAxBH"}
1
+ {"version":3,"names":["RNSkClockValue","RNSkAnimation","constructor","callback","raf","undefined","_callback","cancel","stop","update","nextValue","_animationState","finished","current"],"sources":["RNSkAnimation.ts"],"sourcesContent":["import type { AnimationState, SkiaAnimation } from \"../types\";\n\nimport { RNSkClockValue } from \"./RNSkClockValue\";\n\nexport class RNSkAnimation<S extends AnimationState = AnimationState>\n extends RNSkClockValue\n implements SkiaAnimation\n{\n constructor(\n callback: (t: number, state: S | undefined) => S,\n raf: (callback: (time: number) => void) => number\n ) {\n super(raf);\n this._callback = callback;\n }\n\n private _callback: (t: number, state: S | undefined) => S;\n private _animationState: S | undefined = undefined;\n\n public cancel() {\n this.stop();\n }\n\n protected update(nextValue: number): void {\n if (this._callback) {\n this._animationState = this._callback(nextValue, this._animationState);\n if (this._animationState?.finished) {\n this.stop();\n }\n }\n super.update(this._animationState?.current ?? nextValue);\n }\n}\n"],"mappings":";;AAEA,SAASA,cAAT,QAA+B,kBAA/B;AAEA,OAAO,MAAMC,aAAN,SACGD,cADH,CAGP;EACEE,WAAW,CACTC,QADS,EAETC,GAFS,EAGT;IACA,MAAMA,GAAN;;IADA;;IAAA,yCAMuCC,SANvC;;IAEA,KAAKC,SAAL,GAAiBH,QAAjB;EACD;;EAKMI,MAAM,GAAG;IACd,KAAKC,IAAL;EACD;;EAESC,MAAM,CAACC,SAAD,EAA0B;IAAA;;IACxC,IAAI,KAAKJ,SAAT,EAAoB;MAAA;;MAClB,KAAKK,eAAL,GAAuB,KAAKL,SAAL,CAAeI,SAAf,EAA0B,KAAKC,eAA/B,CAAvB;;MACA,6BAAI,KAAKA,eAAT,kDAAI,sBAAsBC,QAA1B,EAAoC;QAClC,KAAKJ,IAAL;MACD;IACF;;IACD,MAAMC,MAAN,qDAAa,KAAKE,eAAlB,2DAAa,uBAAsBE,OAAnC,2EAA8CH,SAA9C;EACD;;AAxBH"}
@@ -16,8 +16,10 @@ export class RNSkReadonlyValue {
16
16
  }
17
17
 
18
18
  update(nextValue) {
19
- this._current = nextValue;
20
- this.notifyListeners();
19
+ if (this._current !== nextValue) {
20
+ this._current = nextValue;
21
+ this.notifyListeners();
22
+ }
21
23
  }
22
24
 
23
25
  get current() {
@@ -1 +1 @@
1
- {"version":3,"names":["RNSkReadonlyValue","constructor","value","_current","notifyListeners","_listeners","forEach","cb","update","nextValue","current","addListener","push","splice","indexOf","__invalidate"],"sources":["RNSkReadonlyValue.ts"],"sourcesContent":["import type { SkiaValue } from \"../types\";\n\nexport class RNSkReadonlyValue<T> implements SkiaValue<T> {\n constructor(value: T) {\n this._current = value;\n }\n\n private _current: T;\n private _listeners: Array<(value: T) => void> = [];\n\n private notifyListeners(): void {\n this._listeners.forEach((cb) => cb(this._current));\n }\n\n protected update(nextValue: T): void {\n this._current = nextValue;\n this.notifyListeners();\n }\n\n public readonly __typename__ = \"RNSkValue\";\n\n public get current(): T {\n return this._current;\n }\n\n public addListener(cb: (value: T) => void) {\n this._listeners.push(cb);\n return () => {\n this._listeners.splice(this._listeners.indexOf(cb), 1);\n };\n }\n\n public __invalidate(): void {\n this._listeners = [];\n }\n}\n"],"mappings":";;AAEA,OAAO,MAAMA,iBAAN,CAAmD;EACxDC,WAAW,CAACC,KAAD,EAAW;IAAA;;IAAA,oCAK0B,EAL1B;;IAAA,sCAgBS,WAhBT;;IACpB,KAAKC,QAAL,GAAgBD,KAAhB;EACD;;EAKOE,eAAe,GAAS;IAC9B,KAAKC,UAAL,CAAgBC,OAAhB,CAAyBC,EAAD,IAAQA,EAAE,CAAC,KAAKJ,QAAN,CAAlC;EACD;;EAESK,MAAM,CAACC,SAAD,EAAqB;IACnC,KAAKN,QAAL,GAAgBM,SAAhB;IACA,KAAKL,eAAL;EACD;;EAIiB,IAAPM,OAAO,GAAM;IACtB,OAAO,KAAKP,QAAZ;EACD;;EAEMQ,WAAW,CAACJ,EAAD,EAAyB;IACzC,KAAKF,UAAL,CAAgBO,IAAhB,CAAqBL,EAArB;;IACA,OAAO,MAAM;MACX,KAAKF,UAAL,CAAgBQ,MAAhB,CAAuB,KAAKR,UAAL,CAAgBS,OAAhB,CAAwBP,EAAxB,CAAvB,EAAoD,CAApD;IACD,CAFD;EAGD;;EAEMQ,YAAY,GAAS;IAC1B,KAAKV,UAAL,GAAkB,EAAlB;EACD;;AAhCuD"}
1
+ {"version":3,"names":["RNSkReadonlyValue","constructor","value","_current","notifyListeners","_listeners","forEach","cb","update","nextValue","current","addListener","push","splice","indexOf","__invalidate"],"sources":["RNSkReadonlyValue.ts"],"sourcesContent":["import type { SkiaValue } from \"../types\";\n\nexport class RNSkReadonlyValue<T> implements SkiaValue<T> {\n constructor(value: T) {\n this._current = value;\n }\n\n private _current: T;\n private _listeners: Array<(value: T) => void> = [];\n\n private notifyListeners(): void {\n this._listeners.forEach((cb) => cb(this._current));\n }\n\n protected update(nextValue: T): void {\n if (this._current !== nextValue) {\n this._current = nextValue;\n this.notifyListeners();\n }\n }\n\n public readonly __typename__ = \"RNSkValue\";\n\n public get current(): T {\n return this._current;\n }\n\n public addListener(cb: (value: T) => void) {\n this._listeners.push(cb);\n return () => {\n this._listeners.splice(this._listeners.indexOf(cb), 1);\n };\n }\n\n public __invalidate(): void {\n this._listeners = [];\n }\n}\n"],"mappings":";;AAEA,OAAO,MAAMA,iBAAN,CAAmD;EACxDC,WAAW,CAACC,KAAD,EAAW;IAAA;;IAAA,oCAK0B,EAL1B;;IAAA,sCAkBS,WAlBT;;IACpB,KAAKC,QAAL,GAAgBD,KAAhB;EACD;;EAKOE,eAAe,GAAS;IAC9B,KAAKC,UAAL,CAAgBC,OAAhB,CAAyBC,EAAD,IAAQA,EAAE,CAAC,KAAKJ,QAAN,CAAlC;EACD;;EAESK,MAAM,CAACC,SAAD,EAAqB;IACnC,IAAI,KAAKN,QAAL,KAAkBM,SAAtB,EAAiC;MAC/B,KAAKN,QAAL,GAAgBM,SAAhB;MACA,KAAKL,eAAL;IACD;EACF;;EAIiB,IAAPM,OAAO,GAAM;IACtB,OAAO,KAAKP,QAAZ;EACD;;EAEMQ,WAAW,CAACJ,EAAD,EAAyB;IACzC,KAAKF,UAAL,CAAgBO,IAAhB,CAAqBL,EAArB;;IACA,OAAO,MAAM;MACX,KAAKF,UAAL,CAAgBQ,MAAhB,CAAuB,KAAKR,UAAL,CAAgBS,OAAhB,CAAwBP,EAAxB,CAAvB,EAAoD,CAApD;IACD,CAFD;EAGD;;EAEMQ,YAAY,GAAS;IAC1B,KAAKV,UAAL,GAAkB,EAAlB;EACD;;AAlCuD"}
@@ -10,6 +10,8 @@ import { TouchType } from "./types";
10
10
  const pd = PixelRatio.get();
11
11
  export class SkiaBaseWebView extends React.Component {
12
12
  constructor(props) {
13
+ var _props$mode;
14
+
13
15
  super(props);
14
16
 
15
17
  _defineProperty(this, "_surface", null);
@@ -32,7 +34,7 @@ export class SkiaBaseWebView extends React.Component {
32
34
 
33
35
  _defineProperty(this, "height", 0);
34
36
 
35
- this._mode = props.mode ?? "default";
37
+ this._mode = (_props$mode = props.mode) !== null && _props$mode !== void 0 ? _props$mode : "default";
36
38
  }
37
39
 
38
40
  unsubscribeAll() {
@@ -54,8 +56,8 @@ export class SkiaBaseWebView extends React.Component {
54
56
 
55
57
  if (this._canvasRef.current) {
56
58
  const canvas = this._canvasRef.current;
57
- canvas.width = canvas.clientWidth * pd;
58
- canvas.height = canvas.clientHeight * pd;
59
+ canvas.width = width * pd;
60
+ canvas.height = height * pd;
59
61
  const surface = CanvasKit.MakeWebGLCanvasSurface(this._canvasRef.current);
60
62
 
61
63
  if (!surface) {
@@ -1 +1 @@
1
- {"version":3,"names":["React","PixelRatio","View","JsiSkSurface","TouchType","pd","get","SkiaBaseWebView","Component","constructor","props","createRef","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","onLayout","evt","CanvasKit","global","width","height","nativeEvent","layout","_canvasRef","current","canvas","clientWidth","clientHeight","surface","MakeWebGLCanvasSurface","Error","_surface","_canvas","getCanvas","redraw","componentDidMount","tick","componentDidUpdate","componentWillUnmount","cancelAnimationFrame","requestId","makeImageSnapshot","rect","_redrawRequests","touches","_touches","renderInCanvas","ref","flush","requestAnimationFrame","bind","setDrawMode","registerValues","_values","v","push","addListener","handleTouchEvent","touchType","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","timestamp","Date","now","createTouchHandler","render","debug","viewProps","display","flex","Start","Active","End","Cancelled"],"sources":["SkiaBaseWebView.tsx"],"sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\nimport { PixelRatio, View } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\n\nimport type { DrawMode, SkiaBaseViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst pd = PixelRatio.get();\n\nexport abstract class SkiaBaseWebView<\n TProps extends SkiaBaseViewProps\n> extends React.Component<TProps> {\n constructor(props: TProps) {\n super(props);\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef = React.createRef<HTMLCanvasElement>();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private requestId = 0;\n\n protected width = 0;\n protected height = 0;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayout(evt: LayoutChangeEvent) {\n const { CanvasKit } = global;\n const { width, height } = evt.nativeEvent.layout;\n this.width = width;\n this.height = height;\n // Reset canvas / surface on layout change\n if (this._canvasRef.current) {\n const canvas = this._canvasRef.current;\n canvas.width = canvas.clientWidth * pd;\n canvas.height = canvas.clientHeight * pd;\n const surface = CanvasKit.MakeWebGLCanvasSurface(this._canvasRef.current);\n if (!surface) {\n throw new Error(\"Could not create surface\");\n }\n this._surface = new JsiSkSurface(CanvasKit, surface);\n this._canvas = this._surface.getCanvas();\n this.redraw();\n }\n }\n\n componentDidMount() {\n // Start render loop\n this.tick();\n }\n\n componentDidUpdate() {\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n cancelAnimationFrame(this.requestId);\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 return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Override to render\n */\n protected abstract renderInCanvas(\n canvas: SkCanvas,\n touches: TouchInfo[]\n ): void;\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private tick() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (this._canvas) {\n const touches = [...this._touches];\n this._touches = [];\n this.renderInCanvas(this._canvas!, touches);\n this._surface?.ref.flush();\n }\n }\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n\n public redraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.tick();\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(_values: SkiaValue<unknown>[]) {\n // Unsubscribe from dependency values\n this.unsubscribeAll();\n // Register redraw dependencies on values\n _values.forEach((v) => {\n this._unsubscriptions.push(\n v.addListener(() => {\n this.redraw();\n })\n );\n });\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.redraw();\n }\n\n createTouchHandler(touchType: TouchType) {\n return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <View {...viewProps} onLayout={this.onLayout.bind(this)}>\n <canvas\n ref={this._canvasRef}\n style={{ display: \"flex\", flex: 1 }}\n onPointerDown={this.createTouchHandler(TouchType.Start)}\n onPointerMove={this.createTouchHandler(TouchType.Active)}\n onPointerUp={this.createTouchHandler(TouchType.End)}\n onPointerCancel={this.createTouchHandler(TouchType.Cancelled)}\n onPointerLeave={this.createTouchHandler(TouchType.End)}\n onPointerOut={this.createTouchHandler(TouchType.End)}\n />\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA;AACA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,UAAT,EAAqBC,IAArB,QAAiC,cAAjC;AAIA,SAASC,YAAT,QAA6B,0BAA7B;AAGA,SAASC,SAAT,QAA0B,SAA1B;AAEA,MAAMC,EAAE,GAAGJ,UAAU,CAACK,GAAX,EAAX;AAEA,OAAO,MAAeC,eAAf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,CAACiF,MAAlC,CAJjB;MAKE,WAAW,EAAE,KAAKP,kBAAL,CAAwB1E,SAAS,CAACkF,GAAlC,CALf;MAME,eAAe,EAAE,KAAKR,kBAAL,CAAwB1E,SAAS,CAACmF,SAAlC,CANnB;MAOE,cAAc,EAAE,KAAKT,kBAAL,CAAwB1E,SAAS,CAACkF,GAAlC,CAPlB;MAQE,YAAY,EAAE,KAAKR,kBAAL,CAAwB1E,SAAS,CAACkF,GAAlC;IARhB,EADF,CADF;EAcD;;AA9J+B"}
1
+ {"version":3,"names":["React","PixelRatio","View","JsiSkSurface","TouchType","pd","get","SkiaBaseWebView","Component","constructor","props","createRef","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","onLayout","evt","CanvasKit","global","width","height","nativeEvent","layout","_canvasRef","current","canvas","surface","MakeWebGLCanvasSurface","Error","_surface","_canvas","getCanvas","redraw","componentDidMount","tick","componentDidUpdate","componentWillUnmount","cancelAnimationFrame","requestId","makeImageSnapshot","rect","_redrawRequests","touches","_touches","renderInCanvas","ref","flush","requestAnimationFrame","bind","setDrawMode","registerValues","_values","v","push","addListener","handleTouchEvent","touchType","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","timestamp","Date","now","createTouchHandler","render","debug","viewProps","display","flex","Start","Active","End","Cancelled"],"sources":["SkiaBaseWebView.tsx"],"sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\nimport { PixelRatio, View } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\n\nimport type { DrawMode, SkiaBaseViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst pd = PixelRatio.get();\n\nexport abstract class SkiaBaseWebView<\n TProps extends SkiaBaseViewProps\n> extends React.Component<TProps> {\n constructor(props: TProps) {\n super(props);\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef = React.createRef<HTMLCanvasElement>();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private requestId = 0;\n\n protected width = 0;\n protected height = 0;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayout(evt: LayoutChangeEvent) {\n const { CanvasKit } = global;\n const { width, height } = evt.nativeEvent.layout;\n this.width = width;\n this.height = height;\n // Reset canvas / surface on layout change\n if (this._canvasRef.current) {\n const canvas = this._canvasRef.current;\n canvas.width = width * pd;\n canvas.height = height * pd;\n const surface = CanvasKit.MakeWebGLCanvasSurface(this._canvasRef.current);\n if (!surface) {\n throw new Error(\"Could not create surface\");\n }\n this._surface = new JsiSkSurface(CanvasKit, surface);\n this._canvas = this._surface.getCanvas();\n this.redraw();\n }\n }\n\n componentDidMount() {\n // Start render loop\n this.tick();\n }\n\n componentDidUpdate() {\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n cancelAnimationFrame(this.requestId);\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 return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Override to render\n */\n protected abstract renderInCanvas(\n canvas: SkCanvas,\n touches: TouchInfo[]\n ): void;\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private tick() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (this._canvas) {\n const touches = [...this._touches];\n this._touches = [];\n this.renderInCanvas(this._canvas!, touches);\n this._surface?.ref.flush();\n }\n }\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n\n public redraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.tick();\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(_values: SkiaValue<unknown>[]) {\n // Unsubscribe from dependency values\n this.unsubscribeAll();\n // Register redraw dependencies on values\n _values.forEach((v) => {\n this._unsubscriptions.push(\n v.addListener(() => {\n this.redraw();\n })\n );\n });\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.redraw();\n }\n\n createTouchHandler(touchType: TouchType) {\n return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <View {...viewProps} onLayout={this.onLayout.bind(this)}>\n <canvas\n ref={this._canvasRef}\n style={{ display: \"flex\", flex: 1 }}\n onPointerDown={this.createTouchHandler(TouchType.Start)}\n onPointerMove={this.createTouchHandler(TouchType.Active)}\n onPointerUp={this.createTouchHandler(TouchType.End)}\n onPointerCancel={this.createTouchHandler(TouchType.Cancelled)}\n onPointerLeave={this.createTouchHandler(TouchType.End)}\n onPointerOut={this.createTouchHandler(TouchType.End)}\n />\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA;AACA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,UAAT,EAAqBC,IAArB,QAAiC,cAAjC;AAIA,SAASC,YAAT,QAA6B,0BAA7B;AAGA,SAASC,SAAT,QAA0B,SAA1B;AAEA,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