@shopify/react-native-skia 0.1.138 → 0.1.141

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/android/CMakeLists.txt +5 -1
  2. package/android/build.gradle +3 -1
  3. package/cpp/api/JsiSkApi.h +0 -4
  4. package/cpp/api/JsiSkFont.h +0 -19
  5. package/lib/commonjs/mock/index.js +0 -4
  6. package/lib/commonjs/mock/index.js.map +1 -1
  7. package/lib/commonjs/renderer/Canvas.js +5 -8
  8. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  9. package/lib/commonjs/renderer/components/text/Glyphs.js +4 -6
  10. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  11. package/lib/commonjs/renderer/components/text/Text.js +4 -6
  12. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  13. package/lib/commonjs/renderer/components/text/TextPath.js +3 -4
  14. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  15. package/lib/commonjs/renderer/processors/Font.js +1 -27
  16. package/lib/commonjs/renderer/processors/Font.js.map +1 -1
  17. package/lib/commonjs/skia/core/Data.js +4 -5
  18. package/lib/commonjs/skia/core/Data.js.map +1 -1
  19. package/lib/commonjs/skia/core/Image.js +4 -1
  20. package/lib/commonjs/skia/core/Image.js.map +1 -1
  21. package/lib/commonjs/skia/core/SVG.js +3 -1
  22. package/lib/commonjs/skia/core/SVG.js.map +1 -1
  23. package/lib/commonjs/skia/core/Typeface.js +4 -1
  24. package/lib/commonjs/skia/core/Typeface.js.map +1 -1
  25. package/lib/commonjs/skia/core/index.js +0 -26
  26. package/lib/commonjs/skia/core/index.js.map +1 -1
  27. package/lib/commonjs/skia/types/Font/Font.js.map +1 -1
  28. package/lib/commonjs/skia/types/Image/ImageFactory.js +0 -2
  29. package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
  30. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  31. package/lib/commonjs/skia/types/index.js +0 -13
  32. package/lib/commonjs/skia/types/index.js.map +1 -1
  33. package/lib/commonjs/skia/web/JsiSkFont.js +0 -6
  34. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  35. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +1 -1
  36. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  37. package/lib/commonjs/skia/web/JsiSkia.js +0 -3
  38. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  39. package/lib/commonjs/values/hooks/useComputedValue.js +1 -8
  40. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  41. package/lib/commonjs/views/SkiaView.web.js +53 -33
  42. package/lib/commonjs/views/SkiaView.web.js.map +1 -1
  43. package/lib/commonjs/views/useTouchHandler.js +13 -15
  44. package/lib/commonjs/views/useTouchHandler.js.map +1 -1
  45. package/lib/module/mock/index.js +0 -4
  46. package/lib/module/mock/index.js.map +1 -1
  47. package/lib/module/renderer/Canvas.js +5 -6
  48. package/lib/module/renderer/Canvas.js.map +1 -1
  49. package/lib/module/renderer/components/text/Glyphs.js +4 -5
  50. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  51. package/lib/module/renderer/components/text/Text.js +4 -5
  52. package/lib/module/renderer/components/text/Text.js.map +1 -1
  53. package/lib/module/renderer/components/text/TextPath.js +3 -3
  54. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  55. package/lib/module/renderer/processors/Font.js +0 -23
  56. package/lib/module/renderer/processors/Font.js.map +1 -1
  57. package/lib/module/skia/core/Data.js +4 -5
  58. package/lib/module/skia/core/Data.js.map +1 -1
  59. package/lib/module/skia/core/Image.js +2 -1
  60. package/lib/module/skia/core/Image.js.map +1 -1
  61. package/lib/module/skia/core/SVG.js +2 -1
  62. package/lib/module/skia/core/SVG.js.map +1 -1
  63. package/lib/module/skia/core/Typeface.js +2 -1
  64. package/lib/module/skia/core/Typeface.js.map +1 -1
  65. package/lib/module/skia/core/index.js +0 -2
  66. package/lib/module/skia/core/index.js.map +1 -1
  67. package/lib/module/skia/types/Font/Font.js.map +1 -1
  68. package/lib/module/skia/types/Image/ImageFactory.js +0 -1
  69. package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
  70. package/lib/module/skia/types/Path/Path.js.map +1 -1
  71. package/lib/module/skia/types/index.js +0 -1
  72. package/lib/module/skia/types/index.js.map +1 -1
  73. package/lib/module/skia/web/JsiSkFont.js +0 -6
  74. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  75. package/lib/module/skia/web/JsiSkTextBlobFactory.js +1 -1
  76. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  77. package/lib/module/skia/web/JsiSkia.js +0 -2
  78. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  79. package/lib/module/values/hooks/useComputedValue.js +0 -4
  80. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  81. package/lib/module/views/SkiaView.web.js +53 -34
  82. package/lib/module/views/SkiaView.web.js.map +1 -1
  83. package/lib/module/views/useTouchHandler.js +12 -14
  84. package/lib/module/views/useTouchHandler.js.map +1 -1
  85. package/lib/typescript/src/renderer/Canvas.d.ts +1 -3
  86. package/lib/typescript/src/renderer/DrawingContext.d.ts +1 -2
  87. package/lib/typescript/src/renderer/processors/Font.d.ts +1 -5
  88. package/lib/typescript/src/skia/core/index.d.ts +0 -2
  89. package/lib/typescript/src/skia/types/Font/Font.d.ts +0 -12
  90. package/lib/typescript/src/skia/types/Skia.d.ts +0 -2
  91. package/lib/typescript/src/skia/types/index.d.ts +0 -1
  92. package/lib/typescript/src/skia/web/JsiSkFont.d.ts +1 -2
  93. package/lib/typescript/src/values/hooks/useComputedValue.d.ts +0 -1
  94. package/lib/typescript/src/views/SkiaView.web.d.ts +5 -5
  95. package/package.json +12 -7
  96. package/src/mock/index.ts +0 -4
  97. package/src/renderer/Canvas.tsx +5 -8
  98. package/src/renderer/DrawingContext.ts +1 -2
  99. package/src/renderer/components/text/Glyphs.tsx +2 -6
  100. package/src/renderer/components/text/Text.tsx +2 -3
  101. package/src/renderer/components/text/TextPath.tsx +2 -3
  102. package/src/renderer/processors/Font.ts +2 -25
  103. package/src/skia/core/Data.ts +8 -5
  104. package/src/skia/core/Image.ts +3 -1
  105. package/src/skia/core/SVG.ts +3 -1
  106. package/src/skia/core/Typeface.ts +4 -6
  107. package/src/skia/core/index.ts +0 -2
  108. package/src/skia/types/Font/Font.ts +0 -13
  109. package/src/skia/types/Image/ImageFactory.ts +0 -1
  110. package/src/skia/types/Path/Path.ts +0 -1
  111. package/src/skia/types/Skia.ts +0 -2
  112. package/src/skia/types/index.ts +0 -1
  113. package/src/skia/web/JsiSkFont.ts +0 -9
  114. package/src/skia/web/JsiSkTextBlobFactory.ts +1 -1
  115. package/src/skia/web/JsiSkia.ts +0 -2
  116. package/src/values/hooks/useComputedValue.ts +0 -5
  117. package/src/views/SkiaView.web.tsx +41 -46
  118. package/src/views/useTouchHandler.ts +15 -19
  119. package/android/README.md +0 -14
  120. package/cpp/api/JsiSkFontMgr.h +0 -84
  121. package/cpp/api/JsiSkFontMgrFactory.h +0 -48
  122. package/cpp/skia/include/third_party/skcms/LICENSE +0 -29
  123. package/cpp/skia/include/third_party/vulkan/LICENSE +0 -29
  124. package/cpp/skia/readme.txt +0 -1
  125. package/lib/commonjs/skia/core/Paint.js +0 -28
  126. package/lib/commonjs/skia/core/Paint.js.map +0 -1
  127. package/lib/commonjs/skia/core/Path.js +0 -72
  128. package/lib/commonjs/skia/core/Path.js.map +0 -1
  129. package/lib/commonjs/skia/types/FontMgr/FontMgr.js +0 -6
  130. package/lib/commonjs/skia/types/FontMgr/FontMgr.js.map +0 -1
  131. package/lib/commonjs/skia/types/FontMgr/FontMgrFactory.js +0 -6
  132. package/lib/commonjs/skia/types/FontMgr/FontMgrFactory.js.map +0 -1
  133. package/lib/commonjs/skia/types/FontMgr/index.js +0 -32
  134. package/lib/commonjs/skia/types/FontMgr/index.js.map +0 -1
  135. package/lib/commonjs/skia/web/JsiSkFontMgr.js +0 -33
  136. package/lib/commonjs/skia/web/JsiSkFontMgr.js.map +0 -1
  137. package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js +0 -25
  138. package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js.map +0 -1
  139. package/lib/module/skia/core/Paint.js +0 -17
  140. package/lib/module/skia/core/Paint.js.map +0 -1
  141. package/lib/module/skia/core/Path.js +0 -53
  142. package/lib/module/skia/core/Path.js.map +0 -1
  143. package/lib/module/skia/types/FontMgr/FontMgr.js +0 -2
  144. package/lib/module/skia/types/FontMgr/FontMgr.js.map +0 -1
  145. package/lib/module/skia/types/FontMgr/FontMgrFactory.js +0 -2
  146. package/lib/module/skia/types/FontMgr/FontMgrFactory.js.map +0 -1
  147. package/lib/module/skia/types/FontMgr/index.js +0 -3
  148. package/lib/module/skia/types/FontMgr/index.js.map +0 -1
  149. package/lib/module/skia/web/JsiSkFontMgr.js +0 -23
  150. package/lib/module/skia/web/JsiSkFontMgr.js.map +0 -1
  151. package/lib/module/skia/web/JsiSkFontMgrFactory.js +0 -14
  152. package/lib/module/skia/web/JsiSkFontMgrFactory.js.map +0 -1
  153. package/lib/typescript/src/skia/core/Paint.d.ts +0 -6
  154. package/lib/typescript/src/skia/core/Path.d.ts +0 -21
  155. package/lib/typescript/src/skia/types/FontMgr/FontMgr.d.ts +0 -18
  156. package/lib/typescript/src/skia/types/FontMgr/FontMgrFactory.d.ts +0 -4
  157. package/lib/typescript/src/skia/types/FontMgr/index.d.ts +0 -2
  158. package/lib/typescript/src/skia/web/JsiSkFontMgr.d.ts +0 -9
  159. package/lib/typescript/src/skia/web/JsiSkFontMgrFactory.d.ts +0 -8
  160. package/src/skia/core/Paint.ts +0 -22
  161. package/src/skia/core/Path.ts +0 -60
  162. package/src/skia/types/FontMgr/FontMgr.ts +0 -24
  163. package/src/skia/types/FontMgr/FontMgrFactory.ts +0 -12
  164. package/src/skia/types/FontMgr/index.ts +0 -2
  165. package/src/skia/web/JsiSkFontMgr.ts +0 -38
  166. package/src/skia/web/JsiSkFontMgrFactory.ts +0 -18
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _FontMgrFactory = require("./FontMgrFactory");
8
-
9
- Object.keys(_FontMgrFactory).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _FontMgrFactory[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function () {
15
- return _FontMgrFactory[key];
16
- }
17
- });
18
- });
19
-
20
- var _FontMgr = require("./FontMgr");
21
-
22
- Object.keys(_FontMgr).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _FontMgr[key]) return;
25
- Object.defineProperty(exports, key, {
26
- enumerable: true,
27
- get: function () {
28
- return _FontMgr[key];
29
- }
30
- });
31
- });
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./FontMgrFactory\";\nexport * from \"./FontMgr\";\n"]}
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.JsiSkFontMgr = void 0;
7
-
8
- var _Host = require("./Host");
9
-
10
- class JsiSkFontMgr extends _Host.HostObject {
11
- constructor(CanvasKit) {
12
- super(CanvasKit, null, "FontMgr");
13
- }
14
-
15
- countFamilies() {
16
- console.warn("countFamilies() is deprecated. It returns 0 on React Native Web");
17
- return 0;
18
- }
19
-
20
- getFamilyName(_index) {
21
- console.warn("getFamilyName() is deprecated. It returns an empty string on React Native Web");
22
- return "";
23
- }
24
-
25
- matchFamilyStyle(_familyName, _fontStyle) {
26
- console.warn("matchFamilyStyle() is deprecated. It returns null on React Native Web");
27
- return null;
28
- }
29
-
30
- }
31
-
32
- exports.JsiSkFontMgr = JsiSkFontMgr;
33
- //# sourceMappingURL=JsiSkFontMgr.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["JsiSkFontMgr.ts"],"names":["JsiSkFontMgr","HostObject","constructor","CanvasKit","countFamilies","console","warn","getFamilyName","_index","matchFamilyStyle","_familyName","_fontStyle"],"mappings":";;;;;;;AAIA;;AAEO,MAAMA,YAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN,EAAiB,IAAjB,EAAuB,SAAvB;AACD;;AAEDC,EAAAA,aAAa,GAAG;AACdC,IAAAA,OAAO,CAACC,IAAR,CACE,iEADF;AAGA,WAAO,CAAP;AACD;;AAEDC,EAAAA,aAAa,CAACC,MAAD,EAAiB;AAC5BH,IAAAA,OAAO,CAACC,IAAR,CACE,+EADF;AAGA,WAAO,EAAP;AACD;;AAEDG,EAAAA,gBAAgB,CACdC,WADc,EAEdC,UAFc,EAGK;AACnBN,IAAAA,OAAO,CAACC,IAAR,CACE,uEADF;AAGA,WAAO,IAAP;AACD;;AA3BH","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { FontStyle, SkFontMgr, SkTypeface } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkFontMgr\n extends HostObject<null, \"FontMgr\">\n implements SkFontMgr\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit, null, \"FontMgr\");\n }\n\n countFamilies() {\n console.warn(\n \"countFamilies() is deprecated. It returns 0 on React Native Web\"\n );\n return 0;\n }\n\n getFamilyName(_index: number) {\n console.warn(\n \"getFamilyName() is deprecated. It returns an empty string on React Native Web\"\n );\n return \"\";\n }\n\n matchFamilyStyle(\n _familyName: string,\n _fontStyle?: FontStyle\n ): SkTypeface | null {\n console.warn(\n \"matchFamilyStyle() is deprecated. It returns null on React Native Web\"\n );\n return null;\n }\n}\n"]}
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.JsiSkFontMgrFactory = void 0;
7
-
8
- var _Host = require("./Host");
9
-
10
- var _JsiSkFontMgr = require("./JsiSkFontMgr");
11
-
12
- /*global atob*/
13
- class JsiSkFontMgrFactory extends _Host.Host {
14
- constructor(CanvasKit) {
15
- super(CanvasKit);
16
- }
17
-
18
- RefDefault() {
19
- return new _JsiSkFontMgr.JsiSkFontMgr(this.CanvasKit);
20
- }
21
-
22
- }
23
-
24
- exports.JsiSkFontMgrFactory = JsiSkFontMgrFactory;
25
- //# sourceMappingURL=JsiSkFontMgrFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["JsiSkFontMgrFactory.ts"],"names":["JsiSkFontMgrFactory","Host","constructor","CanvasKit","RefDefault","JsiSkFontMgr"],"mappings":";;;;;;;AAMA;;AACA;;AAPA;AASO,MAAMA,mBAAN,SAAkCC,UAAlC,CAAiE;AACtEC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,UAAU,GAAc;AACtB,WAAO,IAAIC,0BAAJ,CAAiB,KAAKF,SAAtB,CAAP;AACD;;AAPqE","sourcesContent":["/*global atob*/\nimport type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkFontMgr } from \"../types\";\nimport type { FontMgrFactory } from \"../types/FontMgr/FontMgrFactory\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkFontMgr } from \"./JsiSkFontMgr\";\n\nexport class JsiSkFontMgrFactory extends Host implements FontMgrFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n RefDefault(): SkFontMgr {\n return new JsiSkFontMgr(this.CanvasKit);\n }\n}\n"]}
@@ -1,17 +0,0 @@
1
- import { useMemo } from "react";
2
- import { Skia } from "../Skia";
3
-
4
- /**
5
- * Returns a Skia Paint object
6
- * */
7
- export const usePaint = (initializer, deps) => useMemo(() => {
8
- console.warn("usePaint() is deprecated. Use Skia.Paint() instead.");
9
- const p = Skia.Paint();
10
-
11
- if (initializer) {
12
- initializer(p);
13
- }
14
-
15
- return p; // eslint-disable-next-line react-hooks/exhaustive-deps
16
- }, deps);
17
- //# sourceMappingURL=Paint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Paint.ts"],"names":["useMemo","Skia","usePaint","initializer","deps","console","warn","p","Paint"],"mappings":"AACA,SAASA,OAAT,QAAwB,OAAxB;AAEA,SAASC,IAAT,QAAqB,SAArB;;AAGA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG,CACtBC,WADsB,EAEtBC,IAFsB,KAItBJ,OAAO,CAAC,MAAM;AACZK,EAAAA,OAAO,CAACC,IAAR,CAAa,qDAAb;AACA,QAAMC,CAAC,GAAGN,IAAI,CAACO,KAAL,EAAV;;AACA,MAAIL,WAAJ,EAAiB;AACfA,IAAAA,WAAW,CAACI,CAAD,CAAX;AACD;;AACD,SAAOA,CAAP,CANY,CAOZ;AACD,CARM,EAQJH,IARI,CAJF","sourcesContent":["import type { DependencyList } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { Skia } from \"../Skia\";\nimport type { SkPaint } from \"../types\";\n\n/**\n * Returns a Skia Paint object\n * */\nexport const usePaint = (\n initializer?: (paint: SkPaint) => void,\n deps?: DependencyList\n) =>\n useMemo(() => {\n console.warn(\"usePaint() is deprecated. Use Skia.Paint() instead.\");\n const p = Skia.Paint();\n if (initializer) {\n initializer(p);\n }\n return p;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n"]}
@@ -1,53 +0,0 @@
1
- import { useMemo } from "react";
2
- import { Skia } from "../Skia";
3
-
4
- /**
5
- * Memoizes and returns a Skia Path object with optional initializer
6
- * @param initializer
7
- * @param deps
8
- * @returns
9
- */
10
- export const usePath = (initializer, deps) => useMemo(() => {
11
- console.warn("usePath() is deprecated. Use Skia.Path.Make() instead.");
12
- const p = Skia.Path.Make();
13
-
14
- if (initializer) {
15
- initializer(p);
16
- }
17
-
18
- return p; // eslint-disable-next-line react-hooks/exhaustive-deps
19
- }, [initializer, deps]);
20
- /**
21
- * Initializes a Skia Path from an svg path string
22
- * @param svgpath
23
- * @returns
24
- */
25
- // MakeFromSVGString
26
-
27
- export const useSvgPath = svgpath => useMemo(() => {
28
- console.warn("useSvgPath() is deprecated. Use Skia.Path.MakeFromSVGString() instead.");
29
- const p = Skia.Path.MakeFromSVGString(svgpath);
30
-
31
- if (p === null) {
32
- throw new Error(`Invalid SVG path: ${svgpath}`);
33
- }
34
-
35
- return p;
36
- }, [svgpath]);
37
- /**
38
- * Initializes a Skia Path from a text string
39
- * @param svgpath
40
- * @returns
41
- */
42
-
43
- export const useTextPath = (text, x, y, font) => useMemo(() => {
44
- console.warn("useTextPath() is deprecated. Use Skia.Path.MakeFromText() instead.");
45
- const p = Skia.Path.MakeFromText(text, x, y, font);
46
-
47
- if (p === null) {
48
- throw new Error("Text path creation failed.");
49
- }
50
-
51
- return p;
52
- }, [text, x, y, font]);
53
- //# sourceMappingURL=Path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Path.ts"],"names":["useMemo","Skia","usePath","initializer","deps","console","warn","p","Path","Make","useSvgPath","svgpath","MakeFromSVGString","Error","useTextPath","text","x","y","font","MakeFromText"],"mappings":"AACA,SAASA,OAAT,QAAwB,OAAxB;AAEA,SAASC,IAAT,QAAqB,SAArB;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,OAAO,GAAG,CACrBC,WADqB,EAErBC,IAFqB,KAIrBJ,OAAO,CAAC,MAAM;AACZK,EAAAA,OAAO,CAACC,IAAR,CAAa,wDAAb;AACA,QAAMC,CAAC,GAAGN,IAAI,CAACO,IAAL,CAAUC,IAAV,EAAV;;AACA,MAAIN,WAAJ,EAAiB;AACfA,IAAAA,WAAW,CAACI,CAAD,CAAX;AACD;;AACD,SAAOA,CAAP,CANY,CAOZ;AACD,CARM,EAQJ,CAACJ,WAAD,EAAcC,IAAd,CARI,CAJF;AAcP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMM,UAAU,GAAIC,OAAD,IACxBX,OAAO,CAAC,MAAM;AACZK,EAAAA,OAAO,CAACC,IAAR,CACE,wEADF;AAGA,QAAMC,CAAC,GAAGN,IAAI,CAACO,IAAL,CAAUI,iBAAV,CAA4BD,OAA5B,CAAV;;AACA,MAAIJ,CAAC,KAAK,IAAV,EAAgB;AACd,UAAM,IAAIM,KAAJ,CAAW,qBAAoBF,OAAQ,EAAvC,CAAN;AACD;;AACD,SAAOJ,CAAP;AACD,CATM,EASJ,CAACI,OAAD,CATI,CADF;AAYP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMG,WAAW,GAAG,CAACC,IAAD,EAAeC,CAAf,EAA0BC,CAA1B,EAAqCC,IAArC,KACzBlB,OAAO,CAAC,MAAM;AACZK,EAAAA,OAAO,CAACC,IAAR,CACE,oEADF;AAGA,QAAMC,CAAC,GAAGN,IAAI,CAACO,IAAL,CAAUW,YAAV,CAAuBJ,IAAvB,EAA6BC,CAA7B,EAAgCC,CAAhC,EAAmCC,IAAnC,CAAV;;AACA,MAAIX,CAAC,KAAK,IAAV,EAAgB;AACd,UAAM,IAAIM,KAAJ,CAAU,4BAAV,CAAN;AACD;;AACD,SAAON,CAAP;AACD,CATM,EASJ,CAACQ,IAAD,EAAOC,CAAP,EAAUC,CAAV,EAAaC,IAAb,CATI,CADF","sourcesContent":["import type { DependencyList } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { Skia } from \"../Skia\";\nimport type { SkFont, SkPath } from \"../types\";\n\n/**\n * Memoizes and returns a Skia Path object with optional initializer\n * @param initializer\n * @param deps\n * @returns\n */\nexport const usePath = (\n initializer?: (path: SkPath) => void,\n deps?: DependencyList\n) =>\n useMemo(() => {\n console.warn(\"usePath() is deprecated. Use Skia.Path.Make() instead.\");\n const p = Skia.Path.Make();\n if (initializer) {\n initializer(p);\n }\n return p;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [initializer, deps]);\n\n/**\n * Initializes a Skia Path from an svg path string\n * @param svgpath\n * @returns\n */\n// MakeFromSVGString\nexport const useSvgPath = (svgpath: string) =>\n useMemo(() => {\n console.warn(\n \"useSvgPath() is deprecated. Use Skia.Path.MakeFromSVGString() instead.\"\n );\n const p = Skia.Path.MakeFromSVGString(svgpath);\n if (p === null) {\n throw new Error(`Invalid SVG path: ${svgpath}`);\n }\n return p;\n }, [svgpath]);\n\n/**\n * Initializes a Skia Path from a text string\n * @param svgpath\n * @returns\n */\nexport const useTextPath = (text: string, x: number, y: number, font: SkFont) =>\n useMemo(() => {\n console.warn(\n \"useTextPath() is deprecated. Use Skia.Path.MakeFromText() instead.\"\n );\n const p = Skia.Path.MakeFromText(text, x, y, font);\n if (p === null) {\n throw new Error(\"Text path creation failed.\");\n }\n return p;\n }, [text, x, y, font]);\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=FontMgr.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=FontMgrFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,3 +0,0 @@
1
- export * from "./FontMgrFactory";
2
- export * from "./FontMgr";
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAd;AACA,cAAc,WAAd","sourcesContent":["export * from \"./FontMgrFactory\";\nexport * from \"./FontMgr\";\n"]}
@@ -1,23 +0,0 @@
1
- import { HostObject } from "./Host";
2
- export class JsiSkFontMgr extends HostObject {
3
- constructor(CanvasKit) {
4
- super(CanvasKit, null, "FontMgr");
5
- }
6
-
7
- countFamilies() {
8
- console.warn("countFamilies() is deprecated. It returns 0 on React Native Web");
9
- return 0;
10
- }
11
-
12
- getFamilyName(_index) {
13
- console.warn("getFamilyName() is deprecated. It returns an empty string on React Native Web");
14
- return "";
15
- }
16
-
17
- matchFamilyStyle(_familyName, _fontStyle) {
18
- console.warn("matchFamilyStyle() is deprecated. It returns null on React Native Web");
19
- return null;
20
- }
21
-
22
- }
23
- //# sourceMappingURL=JsiSkFontMgr.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["JsiSkFontMgr.ts"],"names":["HostObject","JsiSkFontMgr","constructor","CanvasKit","countFamilies","console","warn","getFamilyName","_index","matchFamilyStyle","_familyName","_fontStyle"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,YAAN,SACGD,UADH,CAGP;AACEE,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN,EAAiB,IAAjB,EAAuB,SAAvB;AACD;;AAEDC,EAAAA,aAAa,GAAG;AACdC,IAAAA,OAAO,CAACC,IAAR,CACE,iEADF;AAGA,WAAO,CAAP;AACD;;AAEDC,EAAAA,aAAa,CAACC,MAAD,EAAiB;AAC5BH,IAAAA,OAAO,CAACC,IAAR,CACE,+EADF;AAGA,WAAO,EAAP;AACD;;AAEDG,EAAAA,gBAAgB,CACdC,WADc,EAEdC,UAFc,EAGK;AACnBN,IAAAA,OAAO,CAACC,IAAR,CACE,uEADF;AAGA,WAAO,IAAP;AACD;;AA3BH","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { FontStyle, SkFontMgr, SkTypeface } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkFontMgr\n extends HostObject<null, \"FontMgr\">\n implements SkFontMgr\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit, null, \"FontMgr\");\n }\n\n countFamilies() {\n console.warn(\n \"countFamilies() is deprecated. It returns 0 on React Native Web\"\n );\n return 0;\n }\n\n getFamilyName(_index: number) {\n console.warn(\n \"getFamilyName() is deprecated. It returns an empty string on React Native Web\"\n );\n return \"\";\n }\n\n matchFamilyStyle(\n _familyName: string,\n _fontStyle?: FontStyle\n ): SkTypeface | null {\n console.warn(\n \"matchFamilyStyle() is deprecated. It returns null on React Native Web\"\n );\n return null;\n }\n}\n"]}
@@ -1,14 +0,0 @@
1
- /*global atob*/
2
- import { Host } from "./Host";
3
- import { JsiSkFontMgr } from "./JsiSkFontMgr";
4
- export class JsiSkFontMgrFactory extends Host {
5
- constructor(CanvasKit) {
6
- super(CanvasKit);
7
- }
8
-
9
- RefDefault() {
10
- return new JsiSkFontMgr(this.CanvasKit);
11
- }
12
-
13
- }
14
- //# sourceMappingURL=JsiSkFontMgrFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["JsiSkFontMgrFactory.ts"],"names":["Host","JsiSkFontMgr","JsiSkFontMgrFactory","constructor","CanvasKit","RefDefault"],"mappings":"AAAA;AAMA,SAASA,IAAT,QAAqB,QAArB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA,OAAO,MAAMC,mBAAN,SAAkCF,IAAlC,CAAiE;AACtEG,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,UAAU,GAAc;AACtB,WAAO,IAAIJ,YAAJ,CAAiB,KAAKG,SAAtB,CAAP;AACD;;AAPqE","sourcesContent":["/*global atob*/\nimport type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkFontMgr } from \"../types\";\nimport type { FontMgrFactory } from \"../types/FontMgr/FontMgrFactory\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkFontMgr } from \"./JsiSkFontMgr\";\n\nexport class JsiSkFontMgrFactory extends Host implements FontMgrFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n RefDefault(): SkFontMgr {\n return new JsiSkFontMgr(this.CanvasKit);\n }\n}\n"]}
@@ -1,6 +0,0 @@
1
- import type { DependencyList } from "react";
2
- import type { SkPaint } from "../types";
3
- /**
4
- * Returns a Skia Paint object
5
- * */
6
- export declare const usePaint: (initializer?: ((paint: SkPaint) => void) | undefined, deps?: DependencyList | undefined) => SkPaint;
@@ -1,21 +0,0 @@
1
- import type { DependencyList } from "react";
2
- import type { SkFont, SkPath } from "../types";
3
- /**
4
- * Memoizes and returns a Skia Path object with optional initializer
5
- * @param initializer
6
- * @param deps
7
- * @returns
8
- */
9
- export declare const usePath: (initializer?: ((path: SkPath) => void) | undefined, deps?: DependencyList | undefined) => SkPath;
10
- /**
11
- * Initializes a Skia Path from an svg path string
12
- * @param svgpath
13
- * @returns
14
- */
15
- export declare const useSvgPath: (svgpath: string) => SkPath;
16
- /**
17
- * Initializes a Skia Path from a text string
18
- * @param svgpath
19
- * @returns
20
- */
21
- export declare const useTextPath: (text: string, x: number, y: number, font: SkFont) => SkPath;
@@ -1,18 +0,0 @@
1
- import type { SkJSIInstance } from "../JsiInstance";
2
- import type { FontStyle } from "../Font/Font";
3
- import type { SkTypeface } from "../Typeface";
4
- export interface SkFontMgr extends SkJSIInstance<"FontMgr"> {
5
- /**
6
- * Return the number of font families loaded in this manager. Useful for debugging.
7
- */
8
- countFamilies(): number;
9
- /**
10
- * Return the nth family name. Useful for debugging.
11
- * @param index
12
- */
13
- getFamilyName(index: number): string;
14
- /**
15
- * Find the closest matching typeface to the specified familyName and style and return a ref to it.
16
- */
17
- matchFamilyStyle(familyName: string, fontStyle?: FontStyle): SkTypeface | null;
18
- }
@@ -1,4 +0,0 @@
1
- import type { SkFontMgr } from "./FontMgr";
2
- export interface FontMgrFactory {
3
- RefDefault: () => SkFontMgr;
4
- }
@@ -1,2 +0,0 @@
1
- export * from "./FontMgrFactory";
2
- export * from "./FontMgr";
@@ -1,9 +0,0 @@
1
- import type { CanvasKit } from "canvaskit-wasm";
2
- import type { FontStyle, SkFontMgr, SkTypeface } from "../types";
3
- import { HostObject } from "./Host";
4
- export declare class JsiSkFontMgr extends HostObject<null, "FontMgr"> implements SkFontMgr {
5
- constructor(CanvasKit: CanvasKit);
6
- countFamilies(): number;
7
- getFamilyName(_index: number): string;
8
- matchFamilyStyle(_familyName: string, _fontStyle?: FontStyle): SkTypeface | null;
9
- }
@@ -1,8 +0,0 @@
1
- import type { CanvasKit } from "canvaskit-wasm";
2
- import type { SkFontMgr } from "../types";
3
- import type { FontMgrFactory } from "../types/FontMgr/FontMgrFactory";
4
- import { Host } from "./Host";
5
- export declare class JsiSkFontMgrFactory extends Host implements FontMgrFactory {
6
- constructor(CanvasKit: CanvasKit);
7
- RefDefault(): SkFontMgr;
8
- }
@@ -1,22 +0,0 @@
1
- import type { DependencyList } from "react";
2
- import { useMemo } from "react";
3
-
4
- import { Skia } from "../Skia";
5
- import type { SkPaint } from "../types";
6
-
7
- /**
8
- * Returns a Skia Paint object
9
- * */
10
- export const usePaint = (
11
- initializer?: (paint: SkPaint) => void,
12
- deps?: DependencyList
13
- ) =>
14
- useMemo(() => {
15
- console.warn("usePaint() is deprecated. Use Skia.Paint() instead.");
16
- const p = Skia.Paint();
17
- if (initializer) {
18
- initializer(p);
19
- }
20
- return p;
21
- // eslint-disable-next-line react-hooks/exhaustive-deps
22
- }, deps);
@@ -1,60 +0,0 @@
1
- import type { DependencyList } from "react";
2
- import { useMemo } from "react";
3
-
4
- import { Skia } from "../Skia";
5
- import type { SkFont, SkPath } from "../types";
6
-
7
- /**
8
- * Memoizes and returns a Skia Path object with optional initializer
9
- * @param initializer
10
- * @param deps
11
- * @returns
12
- */
13
- export const usePath = (
14
- initializer?: (path: SkPath) => void,
15
- deps?: DependencyList
16
- ) =>
17
- useMemo(() => {
18
- console.warn("usePath() is deprecated. Use Skia.Path.Make() instead.");
19
- const p = Skia.Path.Make();
20
- if (initializer) {
21
- initializer(p);
22
- }
23
- return p;
24
- // eslint-disable-next-line react-hooks/exhaustive-deps
25
- }, [initializer, deps]);
26
-
27
- /**
28
- * Initializes a Skia Path from an svg path string
29
- * @param svgpath
30
- * @returns
31
- */
32
- // MakeFromSVGString
33
- export const useSvgPath = (svgpath: string) =>
34
- useMemo(() => {
35
- console.warn(
36
- "useSvgPath() is deprecated. Use Skia.Path.MakeFromSVGString() instead."
37
- );
38
- const p = Skia.Path.MakeFromSVGString(svgpath);
39
- if (p === null) {
40
- throw new Error(`Invalid SVG path: ${svgpath}`);
41
- }
42
- return p;
43
- }, [svgpath]);
44
-
45
- /**
46
- * Initializes a Skia Path from a text string
47
- * @param svgpath
48
- * @returns
49
- */
50
- export const useTextPath = (text: string, x: number, y: number, font: SkFont) =>
51
- useMemo(() => {
52
- console.warn(
53
- "useTextPath() is deprecated. Use Skia.Path.MakeFromText() instead."
54
- );
55
- const p = Skia.Path.MakeFromText(text, x, y, font);
56
- if (p === null) {
57
- throw new Error("Text path creation failed.");
58
- }
59
- return p;
60
- }, [text, x, y, font]);
@@ -1,24 +0,0 @@
1
- import type { SkJSIInstance } from "../JsiInstance";
2
- import type { FontStyle } from "../Font/Font";
3
- import type { SkTypeface } from "../Typeface";
4
-
5
- export interface SkFontMgr extends SkJSIInstance<"FontMgr"> {
6
- /**
7
- * Return the number of font families loaded in this manager. Useful for debugging.
8
- */
9
- countFamilies(): number;
10
-
11
- /**
12
- * Return the nth family name. Useful for debugging.
13
- * @param index
14
- */
15
- getFamilyName(index: number): string;
16
-
17
- /**
18
- * Find the closest matching typeface to the specified familyName and style and return a ref to it.
19
- */
20
- matchFamilyStyle(
21
- familyName: string,
22
- fontStyle?: FontStyle
23
- ): SkTypeface | null;
24
- }
@@ -1,12 +0,0 @@
1
- import type { SkFontMgr } from "./FontMgr";
2
-
3
- // Commented code below is the CanvasKit reference
4
- export interface FontMgrFactory {
5
- // FromData: (...data: Data[]) => FontMgr | null;
6
- RefDefault: () => SkFontMgr;
7
- }
8
-
9
- //const fontMgrFactory = (data: Data[]) => Skia.FontMgr.FromData(...data);
10
-
11
- // export const useFontMgr = (data: DataSource[], deps: DependencyList = []) =>
12
- // useDataCollection(data, fontMgrFactory, deps);
@@ -1,2 +0,0 @@
1
- export * from "./FontMgrFactory";
2
- export * from "./FontMgr";
@@ -1,38 +0,0 @@
1
- import type { CanvasKit } from "canvaskit-wasm";
2
-
3
- import type { FontStyle, SkFontMgr, SkTypeface } from "../types";
4
-
5
- import { HostObject } from "./Host";
6
-
7
- export class JsiSkFontMgr
8
- extends HostObject<null, "FontMgr">
9
- implements SkFontMgr
10
- {
11
- constructor(CanvasKit: CanvasKit) {
12
- super(CanvasKit, null, "FontMgr");
13
- }
14
-
15
- countFamilies() {
16
- console.warn(
17
- "countFamilies() is deprecated. It returns 0 on React Native Web"
18
- );
19
- return 0;
20
- }
21
-
22
- getFamilyName(_index: number) {
23
- console.warn(
24
- "getFamilyName() is deprecated. It returns an empty string on React Native Web"
25
- );
26
- return "";
27
- }
28
-
29
- matchFamilyStyle(
30
- _familyName: string,
31
- _fontStyle?: FontStyle
32
- ): SkTypeface | null {
33
- console.warn(
34
- "matchFamilyStyle() is deprecated. It returns null on React Native Web"
35
- );
36
- return null;
37
- }
38
- }
@@ -1,18 +0,0 @@
1
- /*global atob*/
2
- import type { CanvasKit } from "canvaskit-wasm";
3
-
4
- import type { SkFontMgr } from "../types";
5
- import type { FontMgrFactory } from "../types/FontMgr/FontMgrFactory";
6
-
7
- import { Host } from "./Host";
8
- import { JsiSkFontMgr } from "./JsiSkFontMgr";
9
-
10
- export class JsiSkFontMgrFactory extends Host implements FontMgrFactory {
11
- constructor(CanvasKit: CanvasKit) {
12
- super(CanvasKit);
13
- }
14
-
15
- RefDefault(): SkFontMgr {
16
- return new JsiSkFontMgr(this.CanvasKit);
17
- }
18
- }