@shopify/react-native-skia 0.1.222 → 0.1.224

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. package/cpp/api/JsiSkApi.h +6 -1
  2. package/cpp/api/JsiSkFontMgrFactory.h +9 -4
  3. package/cpp/api/JsiSkParagraph.h +135 -0
  4. package/cpp/api/JsiSkParagraphBuilder.h +159 -0
  5. package/cpp/api/JsiSkParagraphStyle.h +124 -0
  6. package/cpp/api/JsiSkStrutStyle.h +96 -0
  7. package/cpp/api/JsiSkTextStyle.h +185 -0
  8. package/cpp/api/{JsiSkTypeFaceFontProviderFactory.h → JsiSkTypefaceFontProviderFactory.h} +1 -1
  9. package/cpp/jsi/JsiHostObject.h +21 -0
  10. package/cpp/rnskia/dom/JsiDomApi.h +4 -0
  11. package/cpp/rnskia/dom/nodes/JsiParagraphNode.h +62 -0
  12. package/cpp/rnskia/dom/props/ParagraphProp.h +45 -0
  13. package/cpp/skia/modules/skunicode/include/SkUnicode.h +312 -0
  14. package/cpp/skia/src/base/SkTInternalLList.h +304 -0
  15. package/cpp/skia/src/base/SkUTF.h +95 -0
  16. package/cpp/skia/src/core/SkLRUCache.h +130 -0
  17. package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +2 -0
  18. package/lib/commonjs/dom/nodes/JsiSkDOM.js +7 -0
  19. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  20. package/lib/commonjs/dom/nodes/drawings/ParagraphNode.d.ts +8 -0
  21. package/lib/commonjs/dom/nodes/drawings/ParagraphNode.js +41 -0
  22. package/lib/commonjs/dom/nodes/drawings/ParagraphNode.js.map +1 -0
  23. package/lib/commonjs/dom/types/NodeType.d.ts +2 -1
  24. package/lib/commonjs/dom/types/NodeType.js +1 -0
  25. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  26. package/lib/commonjs/dom/types/Paragraph.d.ts +8 -0
  27. package/lib/commonjs/dom/types/Paragraph.js +6 -0
  28. package/lib/commonjs/dom/types/Paragraph.js.map +1 -0
  29. package/lib/commonjs/dom/types/SkDOM.d.ts +2 -0
  30. package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
  31. package/lib/commonjs/dom/types/index.d.ts +1 -0
  32. package/lib/commonjs/dom/types/index.js +13 -0
  33. package/lib/commonjs/dom/types/index.js.map +1 -1
  34. package/lib/commonjs/renderer/HostComponents.d.ts +3 -1
  35. package/lib/commonjs/renderer/HostComponents.js +4 -0
  36. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  37. package/lib/commonjs/renderer/components/index.d.ts +1 -0
  38. package/lib/commonjs/renderer/components/index.js +13 -0
  39. package/lib/commonjs/renderer/components/index.js.map +1 -1
  40. package/lib/commonjs/renderer/components/paragraph/Paragraph.d.ts +4 -0
  41. package/lib/commonjs/renderer/components/paragraph/Paragraph.js +17 -0
  42. package/lib/commonjs/renderer/components/paragraph/Paragraph.js.map +1 -0
  43. package/lib/commonjs/renderer/components/paragraph/index.d.ts +1 -0
  44. package/lib/commonjs/renderer/components/paragraph/index.js +19 -0
  45. package/lib/commonjs/renderer/components/paragraph/index.js.map +1 -0
  46. package/lib/commonjs/skia/types/Paragraph/Paragraph.d.ts +56 -0
  47. package/lib/commonjs/skia/types/Paragraph/Paragraph.js +6 -0
  48. package/lib/commonjs/skia/types/Paragraph/Paragraph.js.map +1 -0
  49. package/lib/commonjs/skia/types/Paragraph/ParagraphBuilder.d.ts +60 -0
  50. package/lib/commonjs/skia/types/Paragraph/ParagraphBuilder.js +18 -0
  51. package/lib/commonjs/skia/types/Paragraph/ParagraphBuilder.js.map +1 -0
  52. package/lib/commonjs/skia/types/Paragraph/ParagraphStyle.d.ts +41 -0
  53. package/lib/commonjs/skia/types/Paragraph/ParagraphStyle.js +36 -0
  54. package/lib/commonjs/skia/types/Paragraph/ParagraphStyle.js.map +1 -0
  55. package/lib/commonjs/skia/types/Paragraph/TextStyle.d.ts +62 -0
  56. package/lib/commonjs/skia/types/Paragraph/TextStyle.js +35 -0
  57. package/lib/commonjs/skia/types/Paragraph/TextStyle.js.map +1 -0
  58. package/lib/commonjs/skia/types/Paragraph/index.d.ts +6 -0
  59. package/lib/commonjs/skia/types/Paragraph/index.js +84 -0
  60. package/lib/commonjs/skia/types/Paragraph/index.js.map +1 -0
  61. package/lib/commonjs/skia/types/Skia.d.ts +2 -0
  62. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  63. package/lib/commonjs/skia/types/index.d.ts +1 -0
  64. package/lib/commonjs/skia/types/index.js +13 -0
  65. package/lib/commonjs/skia/types/index.js.map +1 -1
  66. package/lib/commonjs/skia/web/JsiSkParagraph.d.ts +16 -0
  67. package/lib/commonjs/skia/web/JsiSkParagraph.js +91 -0
  68. package/lib/commonjs/skia/web/JsiSkParagraph.js.map +1 -0
  69. package/lib/commonjs/skia/web/JsiSkParagraphBuilder.d.ts +15 -0
  70. package/lib/commonjs/skia/web/JsiSkParagraphBuilder.js +85 -0
  71. package/lib/commonjs/skia/web/JsiSkParagraphBuilder.js.map +1 -0
  72. package/lib/commonjs/skia/web/JsiSkParagraphBuilderFactory.d.ts +8 -0
  73. package/lib/commonjs/skia/web/JsiSkParagraphBuilderFactory.js +34 -0
  74. package/lib/commonjs/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -0
  75. package/lib/commonjs/skia/web/JsiSkParagraphStyle.d.ts +5 -0
  76. package/lib/commonjs/skia/web/JsiSkParagraphStyle.js +59 -0
  77. package/lib/commonjs/skia/web/JsiSkParagraphStyle.js.map +1 -0
  78. package/lib/commonjs/skia/web/JsiSkTextStyle.d.ts +5 -0
  79. package/lib/commonjs/skia/web/JsiSkTextStyle.js +54 -0
  80. package/lib/commonjs/skia/web/JsiSkTextStyle.js.map +1 -0
  81. package/lib/commonjs/skia/web/JsiSkia.js +4 -1
  82. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  83. package/lib/module/dom/nodes/JsiSkDOM.d.ts +2 -0
  84. package/lib/module/dom/nodes/JsiSkDOM.js +6 -0
  85. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  86. package/lib/module/dom/nodes/drawings/ParagraphNode.d.ts +8 -0
  87. package/lib/module/dom/nodes/drawings/ParagraphNode.js +30 -0
  88. package/lib/module/dom/nodes/drawings/ParagraphNode.js.map +1 -0
  89. package/lib/module/dom/types/NodeType.d.ts +2 -1
  90. package/lib/module/dom/types/NodeType.js +1 -0
  91. package/lib/module/dom/types/NodeType.js.map +1 -1
  92. package/lib/module/dom/types/Paragraph.d.ts +8 -0
  93. package/lib/module/dom/types/Paragraph.js +2 -0
  94. package/lib/module/dom/types/Paragraph.js.map +1 -0
  95. package/lib/module/dom/types/SkDOM.d.ts +2 -0
  96. package/lib/module/dom/types/SkDOM.js.map +1 -1
  97. package/lib/module/dom/types/index.d.ts +1 -0
  98. package/lib/module/dom/types/index.js +1 -0
  99. package/lib/module/dom/types/index.js.map +1 -1
  100. package/lib/module/renderer/HostComponents.d.ts +3 -1
  101. package/lib/module/renderer/HostComponents.js +4 -0
  102. package/lib/module/renderer/HostComponents.js.map +1 -1
  103. package/lib/module/renderer/components/index.d.ts +1 -0
  104. package/lib/module/renderer/components/index.js +1 -0
  105. package/lib/module/renderer/components/index.js.map +1 -1
  106. package/lib/module/renderer/components/paragraph/Paragraph.d.ts +4 -0
  107. package/lib/module/renderer/components/paragraph/Paragraph.js +5 -0
  108. package/lib/module/renderer/components/paragraph/Paragraph.js.map +1 -0
  109. package/lib/module/renderer/components/paragraph/index.d.ts +1 -0
  110. package/lib/module/renderer/components/paragraph/index.js +2 -0
  111. package/lib/module/renderer/components/paragraph/index.js.map +1 -0
  112. package/lib/module/skia/types/Paragraph/Paragraph.d.ts +56 -0
  113. package/lib/module/skia/types/Paragraph/Paragraph.js +2 -0
  114. package/lib/module/skia/types/Paragraph/Paragraph.js.map +1 -0
  115. package/lib/module/skia/types/Paragraph/ParagraphBuilder.d.ts +60 -0
  116. package/lib/module/skia/types/Paragraph/ParagraphBuilder.js +11 -0
  117. package/lib/module/skia/types/Paragraph/ParagraphBuilder.js.map +1 -0
  118. package/lib/module/skia/types/Paragraph/ParagraphStyle.d.ts +41 -0
  119. package/lib/module/skia/types/Paragraph/ParagraphStyle.js +27 -0
  120. package/lib/module/skia/types/Paragraph/ParagraphStyle.js.map +1 -0
  121. package/lib/module/skia/types/Paragraph/TextStyle.d.ts +62 -0
  122. package/lib/module/skia/types/Paragraph/TextStyle.js +26 -0
  123. package/lib/module/skia/types/Paragraph/TextStyle.js.map +1 -0
  124. package/lib/module/skia/types/Paragraph/index.d.ts +6 -0
  125. package/lib/module/skia/types/Paragraph/index.js +7 -0
  126. package/lib/module/skia/types/Paragraph/index.js.map +1 -0
  127. package/lib/module/skia/types/Skia.d.ts +2 -0
  128. package/lib/module/skia/types/Skia.js.map +1 -1
  129. package/lib/module/skia/types/index.d.ts +1 -0
  130. package/lib/module/skia/types/index.js +1 -0
  131. package/lib/module/skia/types/index.js.map +1 -1
  132. package/lib/module/skia/web/JsiSkParagraph.d.ts +16 -0
  133. package/lib/module/skia/web/JsiSkParagraph.js +81 -0
  134. package/lib/module/skia/web/JsiSkParagraph.js.map +1 -0
  135. package/lib/module/skia/web/JsiSkParagraphBuilder.d.ts +15 -0
  136. package/lib/module/skia/web/JsiSkParagraphBuilder.js +73 -0
  137. package/lib/module/skia/web/JsiSkParagraphBuilder.js.map +1 -0
  138. package/lib/module/skia/web/JsiSkParagraphBuilderFactory.d.ts +8 -0
  139. package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js +21 -0
  140. package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -0
  141. package/lib/module/skia/web/JsiSkParagraphStyle.d.ts +5 -0
  142. package/lib/module/skia/web/JsiSkParagraphStyle.js +49 -0
  143. package/lib/module/skia/web/JsiSkParagraphStyle.js.map +1 -0
  144. package/lib/module/skia/web/JsiSkTextStyle.d.ts +5 -0
  145. package/lib/module/skia/web/JsiSkTextStyle.js +45 -0
  146. package/lib/module/skia/web/JsiSkTextStyle.js.map +1 -0
  147. package/lib/module/skia/web/JsiSkia.js +3 -1
  148. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  149. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +2 -0
  150. package/lib/typescript/src/dom/nodes/drawings/ParagraphNode.d.ts +8 -0
  151. package/lib/typescript/src/dom/types/NodeType.d.ts +2 -1
  152. package/lib/typescript/src/dom/types/Paragraph.d.ts +8 -0
  153. package/lib/typescript/src/dom/types/SkDOM.d.ts +2 -0
  154. package/lib/typescript/src/dom/types/index.d.ts +1 -0
  155. package/lib/typescript/src/renderer/HostComponents.d.ts +3 -1
  156. package/lib/typescript/src/renderer/components/index.d.ts +1 -0
  157. package/lib/typescript/src/renderer/components/paragraph/Paragraph.d.ts +4 -0
  158. package/lib/typescript/src/renderer/components/paragraph/index.d.ts +1 -0
  159. package/lib/typescript/src/skia/types/Paragraph/Paragraph.d.ts +56 -0
  160. package/lib/typescript/src/skia/types/Paragraph/ParagraphBuilder.d.ts +60 -0
  161. package/lib/typescript/src/skia/types/Paragraph/ParagraphStyle.d.ts +41 -0
  162. package/lib/typescript/src/skia/types/Paragraph/TextStyle.d.ts +62 -0
  163. package/lib/typescript/src/skia/types/Paragraph/index.d.ts +6 -0
  164. package/lib/typescript/src/skia/types/Skia.d.ts +2 -0
  165. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  166. package/lib/typescript/src/skia/web/JsiSkParagraph.d.ts +16 -0
  167. package/lib/typescript/src/skia/web/JsiSkParagraphBuilder.d.ts +15 -0
  168. package/lib/typescript/src/skia/web/JsiSkParagraphBuilderFactory.d.ts +8 -0
  169. package/lib/typescript/src/skia/web/JsiSkParagraphStyle.d.ts +5 -0
  170. package/lib/typescript/src/skia/web/JsiSkTextStyle.d.ts +5 -0
  171. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  172. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  173. package/libs/ios/libskottie.xcframework/Info.plist +5 -5
  174. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  175. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  176. package/libs/ios/libskparagraph.xcframework/Info.plist +5 -5
  177. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  178. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  179. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  180. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  181. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  182. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  183. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  184. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  185. package/libs/ios/libsvg.xcframework/Info.plist +5 -5
  186. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  187. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  188. package/package.json +1 -1
  189. package/src/dom/nodes/JsiSkDOM.ts +9 -0
  190. package/src/dom/nodes/drawings/ParagraphNode.ts +22 -0
  191. package/src/dom/types/NodeType.ts +3 -0
  192. package/src/dom/types/Paragraph.ts +10 -0
  193. package/src/dom/types/SkDOM.ts +4 -0
  194. package/src/dom/types/index.ts +1 -0
  195. package/src/renderer/HostComponents.ts +10 -0
  196. package/src/renderer/components/index.ts +2 -0
  197. package/src/renderer/components/paragraph/Paragraph.tsx +8 -0
  198. package/src/renderer/components/paragraph/index.ts +1 -0
  199. package/src/skia/types/Paragraph/Paragraph.ts +59 -0
  200. package/src/skia/types/Paragraph/ParagraphBuilder.ts +96 -0
  201. package/src/skia/types/Paragraph/ParagraphStyle.ts +45 -0
  202. package/src/skia/types/Paragraph/TextStyle.ts +70 -0
  203. package/src/skia/types/Paragraph/index.ts +6 -0
  204. package/src/skia/types/Skia.ts +3 -0
  205. package/src/skia/types/index.ts +1 -0
  206. package/src/skia/web/JsiSkParagraph.ts +69 -0
  207. package/src/skia/web/JsiSkParagraphBuilder.ts +99 -0
  208. package/src/skia/web/JsiSkParagraphBuilderFactory.ts +42 -0
  209. package/src/skia/web/JsiSkParagraphStyle.ts +65 -0
  210. package/src/skia/web/JsiSkTextStyle.ts +53 -0
  211. package/src/skia/web/JsiSkia.ts +2 -0
  212. /package/cpp/api/{JsiSkTypeFaceFontProvider.h → JsiSkTypefaceFontProvider.h} +0 -0
@@ -0,0 +1,41 @@
1
+ import type { SkTextFontStyle, SkTextStyle } from "./TextStyle";
2
+ export declare enum SkTextDirection {
3
+ RTL = 0,
4
+ LTR = 1
5
+ }
6
+ export declare enum SkTextAlign {
7
+ Left = 0,
8
+ Right = 1,
9
+ Center = 2,
10
+ Justify = 3,
11
+ Start = 4,
12
+ End = 5
13
+ }
14
+ export interface SkStrutStyle {
15
+ strutEnabled?: boolean;
16
+ fontFamilies?: string[];
17
+ fontStyle?: SkTextFontStyle;
18
+ fontSize?: number;
19
+ heightMultiplier?: number;
20
+ halfLeading?: boolean;
21
+ leading?: number;
22
+ forceStrutHeight?: boolean;
23
+ }
24
+ export declare enum SkTextHeightBehavior {
25
+ All = 0,
26
+ DisableFirstAscent = 1,
27
+ DisableLastDescent = 2,
28
+ DisableAll = 3
29
+ }
30
+ export interface SkParagraphStyle {
31
+ disableHinting?: boolean;
32
+ ellipsis?: string;
33
+ heightMultiplier?: number;
34
+ maxLines?: number;
35
+ replaceTabCharacters?: boolean;
36
+ strutStyle?: SkStrutStyle;
37
+ textAlign?: SkTextAlign;
38
+ textDirection?: SkTextDirection;
39
+ textHeightBehavior?: SkTextHeightBehavior;
40
+ textStyle?: SkTextStyle;
41
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SkTextHeightBehavior = exports.SkTextDirection = exports.SkTextAlign = void 0;
7
+ let SkTextDirection;
8
+ exports.SkTextDirection = SkTextDirection;
9
+
10
+ (function (SkTextDirection) {
11
+ SkTextDirection[SkTextDirection["RTL"] = 0] = "RTL";
12
+ SkTextDirection[SkTextDirection["LTR"] = 1] = "LTR";
13
+ })(SkTextDirection || (exports.SkTextDirection = SkTextDirection = {}));
14
+
15
+ let SkTextAlign;
16
+ exports.SkTextAlign = SkTextAlign;
17
+
18
+ (function (SkTextAlign) {
19
+ SkTextAlign[SkTextAlign["Left"] = 0] = "Left";
20
+ SkTextAlign[SkTextAlign["Right"] = 1] = "Right";
21
+ SkTextAlign[SkTextAlign["Center"] = 2] = "Center";
22
+ SkTextAlign[SkTextAlign["Justify"] = 3] = "Justify";
23
+ SkTextAlign[SkTextAlign["Start"] = 4] = "Start";
24
+ SkTextAlign[SkTextAlign["End"] = 5] = "End";
25
+ })(SkTextAlign || (exports.SkTextAlign = SkTextAlign = {}));
26
+
27
+ let SkTextHeightBehavior;
28
+ exports.SkTextHeightBehavior = SkTextHeightBehavior;
29
+
30
+ (function (SkTextHeightBehavior) {
31
+ SkTextHeightBehavior[SkTextHeightBehavior["All"] = 0] = "All";
32
+ SkTextHeightBehavior[SkTextHeightBehavior["DisableFirstAscent"] = 1] = "DisableFirstAscent";
33
+ SkTextHeightBehavior[SkTextHeightBehavior["DisableLastDescent"] = 2] = "DisableLastDescent";
34
+ SkTextHeightBehavior[SkTextHeightBehavior["DisableAll"] = 3] = "DisableAll";
35
+ })(SkTextHeightBehavior || (exports.SkTextHeightBehavior = SkTextHeightBehavior = {}));
36
+ //# sourceMappingURL=ParagraphStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SkTextDirection","SkTextAlign","SkTextHeightBehavior"],"sources":["ParagraphStyle.ts"],"sourcesContent":["import type { SkTextFontStyle, SkTextStyle } from \"./TextStyle\";\n\nexport enum SkTextDirection {\n RTL = 0,\n LTR = 1,\n}\nexport enum SkTextAlign {\n Left = 0,\n Right,\n Center,\n Justify,\n Start,\n End,\n}\n\nexport interface SkStrutStyle {\n strutEnabled?: boolean;\n fontFamilies?: string[];\n fontStyle?: SkTextFontStyle;\n fontSize?: number;\n heightMultiplier?: number;\n halfLeading?: boolean;\n leading?: number;\n forceStrutHeight?: boolean;\n}\n\nexport enum SkTextHeightBehavior {\n All = 0x0,\n DisableFirstAscent = 0x1,\n DisableLastDescent = 0x2,\n DisableAll = 0x1 | 0x2,\n}\n\nexport interface SkParagraphStyle {\n disableHinting?: boolean;\n ellipsis?: string;\n heightMultiplier?: number;\n maxLines?: number;\n replaceTabCharacters?: boolean;\n strutStyle?: SkStrutStyle;\n textAlign?: SkTextAlign;\n textDirection?: SkTextDirection;\n textHeightBehavior?: SkTextHeightBehavior;\n textStyle?: SkTextStyle;\n}\n"],"mappings":";;;;;;IAEYA,e;;;WAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;GAAAA,e,+BAAAA,e;;IAIAC,W;;;WAAAA,W;EAAAA,W,CAAAA,W;EAAAA,W,CAAAA,W;EAAAA,W,CAAAA,W;EAAAA,W,CAAAA,W;EAAAA,W,CAAAA,W;EAAAA,W,CAAAA,W;GAAAA,W,2BAAAA,W;;IAoBAC,oB;;;WAAAA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;GAAAA,oB,oCAAAA,oB"}
@@ -0,0 +1,62 @@
1
+ import type { SkColor } from "../Color";
2
+ import type { FontSlant, FontWeight, FontWidth } from "../Font";
3
+ import type { SkPoint } from "../Point";
4
+ export declare enum TextDecoration {
5
+ NoDecoration = 0,
6
+ Underline = 1,
7
+ Overline = 2,
8
+ LineThrough = 4
9
+ }
10
+ export declare enum TextDecorationStyle {
11
+ Solid = 0,
12
+ Double = 1,
13
+ Dotted = 2,
14
+ Dashed = 3,
15
+ Wavy = 4
16
+ }
17
+ export interface SkTextShadow {
18
+ color?: SkColor;
19
+ /**
20
+ * 2d array for x and y offset. Defaults to [0, 0]
21
+ */
22
+ offset?: SkPoint;
23
+ blurRadius?: number;
24
+ }
25
+ export interface SkTextFontFeatures {
26
+ name: string;
27
+ value: number;
28
+ }
29
+ export interface SkTextFontStyle {
30
+ weight?: FontWeight;
31
+ width?: FontWidth;
32
+ slant?: FontSlant;
33
+ }
34
+ export interface SkTextFontVariations {
35
+ axis: string;
36
+ value: number;
37
+ }
38
+ export declare enum TextBaseline {
39
+ Alphabetic = 0,
40
+ Ideographic = 1
41
+ }
42
+ export interface SkTextStyle {
43
+ backgroundColor?: SkColor;
44
+ color?: SkColor;
45
+ decoration?: number;
46
+ decorationColor?: SkColor;
47
+ decorationThickness?: number;
48
+ decorationStyle?: TextDecoration;
49
+ fontFamilies?: string[];
50
+ fontFeatures?: SkTextFontFeatures[];
51
+ fontSize?: number;
52
+ fontStyle?: SkTextFontStyle;
53
+ fontVariations?: SkTextFontVariations[];
54
+ foregroundColor?: SkColor;
55
+ heightMultiplier?: number;
56
+ halfLeading?: boolean;
57
+ letterSpacing?: number;
58
+ locale?: string;
59
+ shadows?: SkTextShadow[];
60
+ textBaseline?: TextBaseline;
61
+ wordSpacing?: number;
62
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TextDecorationStyle = exports.TextDecoration = exports.TextBaseline = void 0;
7
+ let TextDecoration;
8
+ exports.TextDecoration = TextDecoration;
9
+
10
+ (function (TextDecoration) {
11
+ TextDecoration[TextDecoration["NoDecoration"] = 0] = "NoDecoration";
12
+ TextDecoration[TextDecoration["Underline"] = 1] = "Underline";
13
+ TextDecoration[TextDecoration["Overline"] = 2] = "Overline";
14
+ TextDecoration[TextDecoration["LineThrough"] = 4] = "LineThrough";
15
+ })(TextDecoration || (exports.TextDecoration = TextDecoration = {}));
16
+
17
+ let TextDecorationStyle;
18
+ exports.TextDecorationStyle = TextDecorationStyle;
19
+
20
+ (function (TextDecorationStyle) {
21
+ TextDecorationStyle[TextDecorationStyle["Solid"] = 0] = "Solid";
22
+ TextDecorationStyle[TextDecorationStyle["Double"] = 1] = "Double";
23
+ TextDecorationStyle[TextDecorationStyle["Dotted"] = 2] = "Dotted";
24
+ TextDecorationStyle[TextDecorationStyle["Dashed"] = 3] = "Dashed";
25
+ TextDecorationStyle[TextDecorationStyle["Wavy"] = 4] = "Wavy";
26
+ })(TextDecorationStyle || (exports.TextDecorationStyle = TextDecorationStyle = {}));
27
+
28
+ let TextBaseline;
29
+ exports.TextBaseline = TextBaseline;
30
+
31
+ (function (TextBaseline) {
32
+ TextBaseline[TextBaseline["Alphabetic"] = 0] = "Alphabetic";
33
+ TextBaseline[TextBaseline["Ideographic"] = 1] = "Ideographic";
34
+ })(TextBaseline || (exports.TextBaseline = TextBaseline = {}));
35
+ //# sourceMappingURL=TextStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TextDecoration","TextDecorationStyle","TextBaseline"],"sources":["TextStyle.ts"],"sourcesContent":["import type { SkColor } from \"../Color\";\nimport type { FontSlant, FontWeight, FontWidth } from \"../Font\";\nimport type { SkPoint } from \"../Point\";\n\nexport enum TextDecoration {\n NoDecoration = 0x0,\n Underline = 0x1,\n Overline = 0x2,\n LineThrough = 0x4,\n}\n\nexport enum TextDecorationStyle {\n Solid = 0,\n Double,\n Dotted,\n Dashed,\n Wavy,\n}\n\nexport interface SkTextShadow {\n color?: SkColor;\n /**\n * 2d array for x and y offset. Defaults to [0, 0]\n */\n offset?: SkPoint;\n blurRadius?: number;\n}\n\nexport interface SkTextFontFeatures {\n name: string;\n value: number;\n}\n\nexport interface SkTextFontStyle {\n weight?: FontWeight;\n width?: FontWidth;\n slant?: FontSlant;\n}\n\nexport interface SkTextFontVariations {\n axis: string;\n value: number;\n}\n\nexport enum TextBaseline {\n Alphabetic = 0,\n Ideographic,\n}\n\nexport interface SkTextStyle {\n backgroundColor?: SkColor;\n color?: SkColor;\n decoration?: number;\n decorationColor?: SkColor;\n decorationThickness?: number;\n decorationStyle?: TextDecoration;\n fontFamilies?: string[];\n fontFeatures?: SkTextFontFeatures[];\n fontSize?: number;\n fontStyle?: SkTextFontStyle;\n fontVariations?: SkTextFontVariations[];\n foregroundColor?: SkColor;\n heightMultiplier?: number;\n halfLeading?: boolean;\n letterSpacing?: number;\n locale?: string;\n shadows?: SkTextShadow[];\n textBaseline?: TextBaseline;\n wordSpacing?: number;\n}\n"],"mappings":";;;;;;IAIYA,c;;;WAAAA,c;EAAAA,c,CAAAA,c;EAAAA,c,CAAAA,c;EAAAA,c,CAAAA,c;EAAAA,c,CAAAA,c;GAAAA,c,8BAAAA,c;;IAOAC,mB;;;WAAAA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;GAAAA,mB,mCAAAA,mB;;IAiCAC,Y;;;WAAAA,Y;EAAAA,Y,CAAAA,Y;EAAAA,Y,CAAAA,Y;GAAAA,Y,4BAAAA,Y"}
@@ -0,0 +1,6 @@
1
+ export * from "./TypefaceFontProvider";
2
+ export * from "./TypefaceFontProviderFactory";
3
+ export * from "./Paragraph";
4
+ export * from "./ParagraphBuilder";
5
+ export * from "./ParagraphStyle";
6
+ export * from "./TextStyle";
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _TypefaceFontProvider = require("./TypefaceFontProvider");
8
+
9
+ Object.keys(_TypefaceFontProvider).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _TypefaceFontProvider[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _TypefaceFontProvider[key];
16
+ }
17
+ });
18
+ });
19
+
20
+ var _TypefaceFontProviderFactory = require("./TypefaceFontProviderFactory");
21
+
22
+ Object.keys(_TypefaceFontProviderFactory).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (key in exports && exports[key] === _TypefaceFontProviderFactory[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _TypefaceFontProviderFactory[key];
29
+ }
30
+ });
31
+ });
32
+
33
+ var _Paragraph = require("./Paragraph");
34
+
35
+ Object.keys(_Paragraph).forEach(function (key) {
36
+ if (key === "default" || key === "__esModule") return;
37
+ if (key in exports && exports[key] === _Paragraph[key]) return;
38
+ Object.defineProperty(exports, key, {
39
+ enumerable: true,
40
+ get: function () {
41
+ return _Paragraph[key];
42
+ }
43
+ });
44
+ });
45
+
46
+ var _ParagraphBuilder = require("./ParagraphBuilder");
47
+
48
+ Object.keys(_ParagraphBuilder).forEach(function (key) {
49
+ if (key === "default" || key === "__esModule") return;
50
+ if (key in exports && exports[key] === _ParagraphBuilder[key]) return;
51
+ Object.defineProperty(exports, key, {
52
+ enumerable: true,
53
+ get: function () {
54
+ return _ParagraphBuilder[key];
55
+ }
56
+ });
57
+ });
58
+
59
+ var _ParagraphStyle = require("./ParagraphStyle");
60
+
61
+ Object.keys(_ParagraphStyle).forEach(function (key) {
62
+ if (key === "default" || key === "__esModule") return;
63
+ if (key in exports && exports[key] === _ParagraphStyle[key]) return;
64
+ Object.defineProperty(exports, key, {
65
+ enumerable: true,
66
+ get: function () {
67
+ return _ParagraphStyle[key];
68
+ }
69
+ });
70
+ });
71
+
72
+ var _TextStyle = require("./TextStyle");
73
+
74
+ Object.keys(_TextStyle).forEach(function (key) {
75
+ if (key === "default" || key === "__esModule") return;
76
+ if (key in exports && exports[key] === _TextStyle[key]) return;
77
+ Object.defineProperty(exports, key, {
78
+ enumerable: true,
79
+ get: function () {
80
+ return _TextStyle[key];
81
+ }
82
+ });
83
+ });
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./TypefaceFontProvider\";\nexport * from \"./TypefaceFontProviderFactory\";\nexport * from \"./Paragraph\";\nexport * from \"./ParagraphBuilder\";\nexport * from \"./ParagraphStyle\";\nexport * from \"./TextStyle\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -25,6 +25,7 @@ import type { PictureFactory, SkPictureRecorder } from "./Picture";
25
25
  import type { Color, SkColor } from "./Color";
26
26
  import type { TypefaceFontProviderFactory } from "./Paragraph/TypefaceFontProviderFactory";
27
27
  import type { AnimatedImageFactory } from "./AnimatedImage";
28
+ import type { ParagraphBuilderFactory } from "./Paragraph/ParagraphBuilder";
28
29
  /**
29
30
  * Declares the interface for the native Skia API
30
31
  */
@@ -68,4 +69,5 @@ export interface Skia {
68
69
  SVG: SVGFactory;
69
70
  TextBlob: TextBlobFactory;
70
71
  Surface: SurfaceFactory;
72
+ ParagraphBuilder: ParagraphBuilderFactory;
71
73
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Skia.ts"],"sourcesContent":["import type { ImageFilterFactory } from \"./ImageFilter\";\nimport type { PathFactory } from \"./Path\";\nimport type { ColorFilterFactory } from \"./ColorFilter\";\nimport type { SkFont, FontMgrFactory } from \"./Font\";\nimport type { SkTypeface, TypefaceFactory } from \"./Typeface\";\nimport type { ImageFactory } from \"./Image\";\nimport type { MaskFilterFactory } from \"./MaskFilter\";\nimport type { SkPaint } from \"./Paint\";\nimport type { SkRect } from \"./Rect\";\nimport type { SkRRect } from \"./RRect\";\nimport type {\n RuntimeEffectFactory,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n} from \"./RuntimeEffect\";\nimport type { ShaderFactory } from \"./Shader\";\nimport type { SkMatrix } from \"./Matrix\";\nimport type { PathEffectFactory } from \"./PathEffect\";\nimport type { SkPoint } from \"./Point\";\nimport type { SkVertices, VertexMode } from \"./Vertices/Vertices\";\nimport type { DataFactory } from \"./Data\";\nimport type { SVGFactory } from \"./SVG\";\nimport type { TextBlobFactory } from \"./TextBlob\";\nimport type { SurfaceFactory } from \"./Surface\";\nimport type { SkRSXform } from \"./RSXform\";\nimport type { SkPath } from \"./Path/Path\";\nimport type { SkContourMeasureIter } from \"./ContourMeasure\";\nimport type { PictureFactory, SkPictureRecorder } from \"./Picture\";\nimport type { Color, SkColor } from \"./Color\";\nimport type { TypefaceFontProviderFactory } from \"./Paragraph/TypefaceFontProviderFactory\";\nimport type { AnimatedImageFactory } from \"./AnimatedImage\";\n\n/**\n * Declares the interface for the native Skia API\n */\nexport interface Skia {\n Point: (x: number, y: number) => SkPoint;\n XYWHRect: (x: number, y: number, width: number, height: number) => SkRect;\n RuntimeShaderBuilder: (rt: SkRuntimeEffect) => SkRuntimeShaderBuilder;\n RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;\n RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;\n Color: (color: Color) => SkColor;\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ) => SkContourMeasureIter;\n Paint: () => SkPaint;\n PictureRecorder: () => SkPictureRecorder;\n Picture: PictureFactory;\n Path: PathFactory;\n Matrix: (matrix?: readonly number[]) => SkMatrix;\n ColorFilter: ColorFilterFactory;\n Font: (typeface?: SkTypeface, size?: number) => SkFont;\n Typeface: TypefaceFactory;\n TypefaceFontProvider: TypefaceFontProviderFactory;\n FontMgr: FontMgrFactory;\n MaskFilter: MaskFilterFactory;\n RuntimeEffect: RuntimeEffectFactory;\n ImageFilter: ImageFilterFactory;\n Shader: ShaderFactory;\n PathEffect: PathEffectFactory;\n /**\n * Returns an Vertices based on the given positions and optional parameters.\n * See SkVertices.h (especially the Builder) for more details.\n * @param mode\n * @param positions\n * @param textureCoordinates\n * @param colors - either a list of int colors or a flattened color array.\n * @param indices\n * @param isVolatile\n */\n MakeVertices(\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n ): SkVertices;\n Data: DataFactory;\n Image: ImageFactory;\n AnimatedImage: AnimatedImageFactory;\n SVG: SVGFactory;\n TextBlob: TextBlobFactory;\n Surface: SurfaceFactory;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["Skia.ts"],"sourcesContent":["import type { ImageFilterFactory } from \"./ImageFilter\";\nimport type { PathFactory } from \"./Path\";\nimport type { ColorFilterFactory } from \"./ColorFilter\";\nimport type { SkFont, FontMgrFactory } from \"./Font\";\nimport type { SkTypeface, TypefaceFactory } from \"./Typeface\";\nimport type { ImageFactory } from \"./Image\";\nimport type { MaskFilterFactory } from \"./MaskFilter\";\nimport type { SkPaint } from \"./Paint\";\nimport type { SkRect } from \"./Rect\";\nimport type { SkRRect } from \"./RRect\";\nimport type {\n RuntimeEffectFactory,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n} from \"./RuntimeEffect\";\nimport type { ShaderFactory } from \"./Shader\";\nimport type { SkMatrix } from \"./Matrix\";\nimport type { PathEffectFactory } from \"./PathEffect\";\nimport type { SkPoint } from \"./Point\";\nimport type { SkVertices, VertexMode } from \"./Vertices/Vertices\";\nimport type { DataFactory } from \"./Data\";\nimport type { SVGFactory } from \"./SVG\";\nimport type { TextBlobFactory } from \"./TextBlob\";\nimport type { SurfaceFactory } from \"./Surface\";\nimport type { SkRSXform } from \"./RSXform\";\nimport type { SkPath } from \"./Path/Path\";\nimport type { SkContourMeasureIter } from \"./ContourMeasure\";\nimport type { PictureFactory, SkPictureRecorder } from \"./Picture\";\nimport type { Color, SkColor } from \"./Color\";\nimport type { TypefaceFontProviderFactory } from \"./Paragraph/TypefaceFontProviderFactory\";\nimport type { AnimatedImageFactory } from \"./AnimatedImage\";\nimport type { ParagraphBuilderFactory } from \"./Paragraph/ParagraphBuilder\";\n\n/**\n * Declares the interface for the native Skia API\n */\nexport interface Skia {\n Point: (x: number, y: number) => SkPoint;\n XYWHRect: (x: number, y: number, width: number, height: number) => SkRect;\n RuntimeShaderBuilder: (rt: SkRuntimeEffect) => SkRuntimeShaderBuilder;\n RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;\n RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;\n Color: (color: Color) => SkColor;\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ) => SkContourMeasureIter;\n Paint: () => SkPaint;\n PictureRecorder: () => SkPictureRecorder;\n Picture: PictureFactory;\n Path: PathFactory;\n Matrix: (matrix?: readonly number[]) => SkMatrix;\n ColorFilter: ColorFilterFactory;\n Font: (typeface?: SkTypeface, size?: number) => SkFont;\n Typeface: TypefaceFactory;\n TypefaceFontProvider: TypefaceFontProviderFactory;\n FontMgr: FontMgrFactory;\n MaskFilter: MaskFilterFactory;\n RuntimeEffect: RuntimeEffectFactory;\n ImageFilter: ImageFilterFactory;\n Shader: ShaderFactory;\n PathEffect: PathEffectFactory;\n /**\n * Returns an Vertices based on the given positions and optional parameters.\n * See SkVertices.h (especially the Builder) for more details.\n * @param mode\n * @param positions\n * @param textureCoordinates\n * @param colors - either a list of int colors or a flattened color array.\n * @param indices\n * @param isVolatile\n */\n MakeVertices(\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n ): SkVertices;\n Data: DataFactory;\n Image: ImageFactory;\n AnimatedImage: AnimatedImageFactory;\n SVG: SVGFactory;\n TextBlob: TextBlobFactory;\n Surface: SurfaceFactory;\n // Paragraph\n ParagraphBuilder: ParagraphBuilderFactory;\n}\n"],"mappings":""}
@@ -27,3 +27,4 @@ export * from "./JsiInstance";
27
27
  export * from "./Skia";
28
28
  export * from "./TextBlob";
29
29
  export * from "./Size";
30
+ export * from "./Paragraph";
@@ -380,4 +380,17 @@ Object.keys(_Size).forEach(function (key) {
380
380
  }
381
381
  });
382
382
  });
383
+
384
+ var _Paragraph = require("./Paragraph");
385
+
386
+ Object.keys(_Paragraph).forEach(function (key) {
387
+ if (key === "default" || key === "__esModule") return;
388
+ if (key in exports && exports[key] === _Paragraph[key]) return;
389
+ Object.defineProperty(exports, key, {
390
+ enumerable: true,
391
+ get: function () {
392
+ return _Paragraph[key];
393
+ }
394
+ });
395
+ });
383
396
  //# 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 \"./AnimatedImage\";\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;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
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 \"./AnimatedImage\";\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\";\nexport * from \"./Paragraph\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,16 @@
1
+ import type { CanvasKit, Paragraph } from "canvaskit-wasm";
2
+ import type { SkRect, SkRectWithDirection, SkParagraph } from "../types";
3
+ import { HostObject } from "./Host";
4
+ import type { JsiSkCanvas } from "./JsiSkCanvas";
5
+ export declare class JsiSkParagraph extends HostObject<Paragraph, "Paragraph"> implements SkParagraph {
6
+ constructor(CanvasKit: CanvasKit, ref: Paragraph);
7
+ layout(width: number): void;
8
+ paint(canvas: JsiSkCanvas, x: number, y: number): void;
9
+ getHeight(): number;
10
+ getMaxWidth(): number;
11
+ getGlyphPositionAtCoordinate(x: number, y: number): number;
12
+ getRectsForPlaceholders(): SkRectWithDirection[];
13
+ getRectsForRange(start: number, end: number): SkRect[];
14
+ getLineMetrics(): SkRect[];
15
+ dispose(): void;
16
+ }
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.JsiSkParagraph = void 0;
7
+
8
+ var _Host = require("./Host");
9
+
10
+ class JsiSkParagraph extends _Host.HostObject {
11
+ constructor(CanvasKit, ref) {
12
+ super(CanvasKit, ref, "Paragraph");
13
+ }
14
+
15
+ layout(width) {
16
+ this.ref.layout(width);
17
+ }
18
+
19
+ paint(canvas, x, y) {
20
+ canvas.ref.drawParagraph(this.ref, x, y);
21
+ }
22
+
23
+ getHeight() {
24
+ return this.ref.getHeight();
25
+ }
26
+
27
+ getMaxWidth() {
28
+ return this.ref.getMaxWidth();
29
+ }
30
+
31
+ getGlyphPositionAtCoordinate(x, y) {
32
+ return this.ref.getGlyphPositionAtCoordinate(x, y).pos;
33
+ }
34
+
35
+ getRectsForPlaceholders() {
36
+ return this.ref.getRectsForPlaceholders().map(_ref => {
37
+ let {
38
+ rect,
39
+ dir
40
+ } = _ref;
41
+ return {
42
+ rect: {
43
+ x: rect.at(0),
44
+ y: rect.at(1),
45
+ width: rect.at(2),
46
+ height: rect.at(3)
47
+ },
48
+ direction: dir.value
49
+ };
50
+ });
51
+ }
52
+
53
+ getRectsForRange(start, end) {
54
+ return this.ref.getRectsForRange(start, end, {
55
+ value: 0
56
+ }
57
+ /** kTight */
58
+ , {
59
+ value: 0
60
+ }
61
+ /** kTight */
62
+ ).map(_ref2 => {
63
+ let {
64
+ rect
65
+ } = _ref2;
66
+ return {
67
+ x: rect[0],
68
+ y: rect[1],
69
+ width: rect[2],
70
+ height: rect[3]
71
+ };
72
+ });
73
+ }
74
+
75
+ getLineMetrics() {
76
+ return this.ref.getLineMetrics().map((r, index) => ({
77
+ x: r.left,
78
+ y: index * r.height,
79
+ width: r.width,
80
+ height: r.height
81
+ }));
82
+ }
83
+
84
+ dispose() {
85
+ this.ref.delete();
86
+ }
87
+
88
+ }
89
+
90
+ exports.JsiSkParagraph = JsiSkParagraph;
91
+ //# sourceMappingURL=JsiSkParagraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["JsiSkParagraph","HostObject","constructor","CanvasKit","ref","layout","width","paint","canvas","x","y","drawParagraph","getHeight","getMaxWidth","getGlyphPositionAtCoordinate","pos","getRectsForPlaceholders","map","rect","dir","at","height","direction","value","getRectsForRange","start","end","getLineMetrics","r","index","left","dispose","delete"],"sources":["JsiSkParagraph.ts"],"sourcesContent":["import type { CanvasKit, Paragraph } from \"canvaskit-wasm\";\n\nimport type { SkRect, SkRectWithDirection, SkParagraph } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport type { JsiSkCanvas } from \"./JsiSkCanvas\";\n\nexport class JsiSkParagraph\n extends HostObject<Paragraph, \"Paragraph\">\n implements SkParagraph\n{\n constructor(CanvasKit: CanvasKit, ref: Paragraph) {\n super(CanvasKit, ref, \"Paragraph\");\n }\n\n layout(width: number): void {\n this.ref.layout(width);\n }\n paint(canvas: JsiSkCanvas, x: number, y: number): void {\n canvas.ref.drawParagraph(this.ref, x, y);\n }\n getHeight(): number {\n return this.ref.getHeight();\n }\n getMaxWidth(): number {\n return this.ref.getMaxWidth();\n }\n getGlyphPositionAtCoordinate(x: number, y: number): number {\n return this.ref.getGlyphPositionAtCoordinate(x, y).pos;\n }\n getRectsForPlaceholders(): SkRectWithDirection[] {\n return this.ref.getRectsForPlaceholders().map(({ rect, dir }) => ({\n rect: {\n x: rect.at(0)!,\n y: rect.at(1)!,\n width: rect.at(2)!,\n height: rect.at(3)!,\n },\n direction: dir.value,\n }));\n }\n getRectsForRange(start: number, end: number): SkRect[] {\n return this.ref\n .getRectsForRange(\n start,\n end,\n { value: 0 } /** kTight */,\n { value: 0 } /** kTight */\n )\n .map(({ rect }) => ({\n x: rect[0],\n y: rect[1],\n width: rect[2],\n height: rect[3],\n }));\n }\n getLineMetrics(): SkRect[] {\n return this.ref.getLineMetrics().map((r, index) => ({\n x: r.left,\n y: index * r.height,\n width: r.width,\n height: r.height,\n }));\n }\n\n dispose() {\n this.ref.delete();\n }\n}\n"],"mappings":";;;;;;;AAIA;;AAGO,MAAMA,cAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,WAAtB;EACD;;EAEDC,MAAM,CAACC,KAAD,EAAsB;IAC1B,KAAKF,GAAL,CAASC,MAAT,CAAgBC,KAAhB;EACD;;EACDC,KAAK,CAACC,MAAD,EAAsBC,CAAtB,EAAiCC,CAAjC,EAAkD;IACrDF,MAAM,CAACJ,GAAP,CAAWO,aAAX,CAAyB,KAAKP,GAA9B,EAAmCK,CAAnC,EAAsCC,CAAtC;EACD;;EACDE,SAAS,GAAW;IAClB,OAAO,KAAKR,GAAL,CAASQ,SAAT,EAAP;EACD;;EACDC,WAAW,GAAW;IACpB,OAAO,KAAKT,GAAL,CAASS,WAAT,EAAP;EACD;;EACDC,4BAA4B,CAACL,CAAD,EAAYC,CAAZ,EAA+B;IACzD,OAAO,KAAKN,GAAL,CAASU,4BAAT,CAAsCL,CAAtC,EAAyCC,CAAzC,EAA4CK,GAAnD;EACD;;EACDC,uBAAuB,GAA0B;IAC/C,OAAO,KAAKZ,GAAL,CAASY,uBAAT,GAAmCC,GAAnC,CAAuC;MAAA,IAAC;QAAEC,IAAF;QAAQC;MAAR,CAAD;MAAA,OAAoB;QAChED,IAAI,EAAE;UACJT,CAAC,EAAES,IAAI,CAACE,EAAL,CAAQ,CAAR,CADC;UAEJV,CAAC,EAAEQ,IAAI,CAACE,EAAL,CAAQ,CAAR,CAFC;UAGJd,KAAK,EAAEY,IAAI,CAACE,EAAL,CAAQ,CAAR,CAHH;UAIJC,MAAM,EAAEH,IAAI,CAACE,EAAL,CAAQ,CAAR;QAJJ,CAD0D;QAOhEE,SAAS,EAAEH,GAAG,CAACI;MAPiD,CAApB;IAAA,CAAvC,CAAP;EASD;;EACDC,gBAAgB,CAACC,KAAD,EAAgBC,GAAhB,EAAuC;IACrD,OAAO,KAAKtB,GAAL,CACJoB,gBADI,CAEHC,KAFG,EAGHC,GAHG,EAIH;MAAEH,KAAK,EAAE;IAAT;IAAa;IAJV,EAKH;MAAEA,KAAK,EAAE;IAAT;IAAa;IALV,EAOJN,GAPI,CAOA;MAAA,IAAC;QAAEC;MAAF,CAAD;MAAA,OAAe;QAClBT,CAAC,EAAES,IAAI,CAAC,CAAD,CADW;QAElBR,CAAC,EAAEQ,IAAI,CAAC,CAAD,CAFW;QAGlBZ,KAAK,EAAEY,IAAI,CAAC,CAAD,CAHO;QAIlBG,MAAM,EAAEH,IAAI,CAAC,CAAD;MAJM,CAAf;IAAA,CAPA,CAAP;EAaD;;EACDS,cAAc,GAAa;IACzB,OAAO,KAAKvB,GAAL,CAASuB,cAAT,GAA0BV,GAA1B,CAA8B,CAACW,CAAD,EAAIC,KAAJ,MAAe;MAClDpB,CAAC,EAAEmB,CAAC,CAACE,IAD6C;MAElDpB,CAAC,EAAEmB,KAAK,GAAGD,CAAC,CAACP,MAFqC;MAGlDf,KAAK,EAAEsB,CAAC,CAACtB,KAHyC;MAIlDe,MAAM,EAAEO,CAAC,CAACP;IAJwC,CAAf,CAA9B,CAAP;EAMD;;EAEDU,OAAO,GAAG;IACR,KAAK3B,GAAL,CAAS4B,MAAT;EACD;;AAzDH"}
@@ -0,0 +1,15 @@
1
+ import type { CanvasKit, ParagraphBuilder } from "canvaskit-wasm";
2
+ import type { SkParagraphBuilder, SkParagraph, SkTextStyle, SkPaint } from "../types";
3
+ import { PlaceholderAlignment, TextBaseline } from "../types";
4
+ import { HostObject } from "./Host";
5
+ export declare class JsiSkParagraphBuilder extends HostObject<ParagraphBuilder, "ParagraphBuilder"> implements SkParagraphBuilder {
6
+ constructor(CanvasKit: CanvasKit, ref: ParagraphBuilder);
7
+ addPlaceholder(width?: number | undefined, height?: number | undefined, alignment?: PlaceholderAlignment | undefined, baseline?: TextBaseline | undefined, offset?: number | undefined): SkParagraphBuilder;
8
+ addText(text: string): SkParagraphBuilder;
9
+ build(): SkParagraph;
10
+ reset(): void;
11
+ pushStyle(style: SkTextStyle, foregroundPaint?: SkPaint | undefined, backgroundPaint?: SkPaint | undefined): SkParagraphBuilder;
12
+ pop(): SkParagraphBuilder;
13
+ dispose(): void;
14
+ private makePaint;
15
+ }
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.JsiSkParagraphBuilder = void 0;
7
+
8
+ var _types = require("../types");
9
+
10
+ var _Host = require("./Host");
11
+
12
+ var _JsiSkParagraph = require("./JsiSkParagraph");
13
+
14
+ var _JsiSkTextStyle = require("./JsiSkTextStyle");
15
+
16
+ var _JsiSkPaint = require("./JsiSkPaint");
17
+
18
+ class JsiSkParagraphBuilder extends _Host.HostObject {
19
+ constructor(CanvasKit, ref) {
20
+ super(CanvasKit, ref, "ParagraphBuilder");
21
+ }
22
+
23
+ addPlaceholder() {
24
+ let width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
25
+ let height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
26
+ let alignment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _types.PlaceholderAlignment.Baseline;
27
+ let baseline = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _types.TextBaseline.Alphabetic;
28
+ let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
29
+ this.ref.addPlaceholder(width, height, {
30
+ value: alignment
31
+ }, {
32
+ value: baseline
33
+ }, offset);
34
+ return this;
35
+ }
36
+
37
+ addText(text) {
38
+ this.ref.addText(text);
39
+ return this;
40
+ }
41
+
42
+ build() {
43
+ return new _JsiSkParagraph.JsiSkParagraph(this.CanvasKit, this.ref.build());
44
+ }
45
+
46
+ reset() {
47
+ this.ref.reset();
48
+ }
49
+
50
+ pushStyle(style, foregroundPaint, backgroundPaint) {
51
+ const textStyle = _JsiSkTextStyle.JsiSkTextStyle.toTextStyle(style);
52
+
53
+ if (foregroundPaint || backgroundPaint) {
54
+ // Due the canvaskit API not exposing textStyle methods,
55
+ // we set the default paint color to black for the foreground
56
+ // and transparent for the background
57
+ const fg = foregroundPaint ? _JsiSkPaint.JsiSkPaint.fromValue(foregroundPaint) : this.makePaint(textStyle.color ?? Float32Array.of(0, 0, 0, 1));
58
+ const bg = backgroundPaint ? _JsiSkPaint.JsiSkPaint.fromValue(backgroundPaint) : this.makePaint(textStyle.backgroundColor ?? Float32Array.of(0, 0, 0, 0));
59
+ this.ref.pushPaintStyle(new this.CanvasKit.TextStyle(textStyle), fg, bg);
60
+ } else {
61
+ this.ref.pushStyle(new this.CanvasKit.TextStyle(textStyle));
62
+ }
63
+
64
+ return this;
65
+ }
66
+
67
+ pop() {
68
+ this.ref.pop();
69
+ return this;
70
+ }
71
+
72
+ dispose() {
73
+ this.ref.delete();
74
+ }
75
+
76
+ makePaint(color) {
77
+ const paint = new this.CanvasKit.Paint();
78
+ paint.setColor(color);
79
+ return paint;
80
+ }
81
+
82
+ }
83
+
84
+ exports.JsiSkParagraphBuilder = JsiSkParagraphBuilder;
85
+ //# sourceMappingURL=JsiSkParagraphBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["JsiSkParagraphBuilder","HostObject","constructor","CanvasKit","ref","addPlaceholder","width","height","alignment","PlaceholderAlignment","Baseline","baseline","TextBaseline","Alphabetic","offset","value","addText","text","build","JsiSkParagraph","reset","pushStyle","style","foregroundPaint","backgroundPaint","textStyle","JsiSkTextStyle","toTextStyle","fg","JsiSkPaint","fromValue","makePaint","color","Float32Array","of","bg","backgroundColor","pushPaintStyle","TextStyle","pop","dispose","delete","paint","Paint","setColor"],"sources":["JsiSkParagraphBuilder.ts"],"sourcesContent":["import type {\n CanvasKit,\n InputColor,\n Paint,\n ParagraphBuilder,\n TextStyle,\n} from \"canvaskit-wasm\";\n\nimport type {\n SkParagraphBuilder,\n SkParagraph,\n SkTextStyle,\n SkPaint,\n} from \"../types\";\nimport { PlaceholderAlignment, TextBaseline } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkParagraph } from \"./JsiSkParagraph\";\nimport { JsiSkTextStyle } from \"./JsiSkTextStyle\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\n\nexport class JsiSkParagraphBuilder\n extends HostObject<ParagraphBuilder, \"ParagraphBuilder\">\n implements SkParagraphBuilder\n{\n constructor(CanvasKit: CanvasKit, ref: ParagraphBuilder) {\n super(CanvasKit, ref, \"ParagraphBuilder\");\n }\n\n addPlaceholder(\n width: number | undefined = 0,\n height: number | undefined = 0,\n alignment: PlaceholderAlignment | undefined = PlaceholderAlignment.Baseline,\n baseline: TextBaseline | undefined = TextBaseline.Alphabetic,\n offset: number | undefined = 0\n ): SkParagraphBuilder {\n this.ref.addPlaceholder(\n width,\n height,\n { value: alignment },\n { value: baseline },\n offset\n );\n return this;\n }\n addText(text: string): SkParagraphBuilder {\n this.ref.addText(text);\n return this;\n }\n\n build(): SkParagraph {\n return new JsiSkParagraph(this.CanvasKit, this.ref.build());\n }\n\n reset(): void {\n this.ref.reset();\n }\n\n pushStyle(\n style: SkTextStyle,\n foregroundPaint?: SkPaint | undefined,\n backgroundPaint?: SkPaint | undefined\n ): SkParagraphBuilder {\n const textStyle: TextStyle = JsiSkTextStyle.toTextStyle(style);\n if (foregroundPaint || backgroundPaint) {\n // Due the canvaskit API not exposing textStyle methods,\n // we set the default paint color to black for the foreground\n // and transparent for the background\n const fg: Paint = foregroundPaint\n ? JsiSkPaint.fromValue(foregroundPaint)\n : this.makePaint(textStyle.color ?? Float32Array.of(0, 0, 0, 1));\n const bg: Paint = backgroundPaint\n ? JsiSkPaint.fromValue(backgroundPaint)\n : this.makePaint(\n textStyle.backgroundColor ?? Float32Array.of(0, 0, 0, 0)\n );\n this.ref.pushPaintStyle(new this.CanvasKit.TextStyle(textStyle), fg, bg);\n } else {\n this.ref.pushStyle(new this.CanvasKit.TextStyle(textStyle));\n }\n\n return this;\n }\n\n pop(): SkParagraphBuilder {\n this.ref.pop();\n return this;\n }\n\n dispose() {\n this.ref.delete();\n }\n\n private makePaint(color: InputColor) {\n const paint = new this.CanvasKit.Paint();\n paint.setColor(color);\n return paint;\n }\n}\n"],"mappings":";;;;;;;AAcA;;AAEA;;AACA;;AACA;;AACA;;AAEO,MAAMA,qBAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA8C;IACvD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,kBAAtB;EACD;;EAEDC,cAAc,GAMQ;IAAA,IALpBC,KAKoB,uEALQ,CAKR;IAAA,IAJpBC,MAIoB,uEAJS,CAIT;IAAA,IAHpBC,SAGoB,uEAH0BC,2BAAA,CAAqBC,QAG/C;IAAA,IAFpBC,QAEoB,uEAFiBC,mBAAA,CAAaC,UAE9B;IAAA,IADpBC,MACoB,uEADS,CACT;IACpB,KAAKV,GAAL,CAASC,cAAT,CACEC,KADF,EAEEC,MAFF,EAGE;MAAEQ,KAAK,EAAEP;IAAT,CAHF,EAIE;MAAEO,KAAK,EAAEJ;IAAT,CAJF,EAKEG,MALF;IAOA,OAAO,IAAP;EACD;;EACDE,OAAO,CAACC,IAAD,EAAmC;IACxC,KAAKb,GAAL,CAASY,OAAT,CAAiBC,IAAjB;IACA,OAAO,IAAP;EACD;;EAEDC,KAAK,GAAgB;IACnB,OAAO,IAAIC,8BAAJ,CAAmB,KAAKhB,SAAxB,EAAmC,KAAKC,GAAL,CAASc,KAAT,EAAnC,CAAP;EACD;;EAEDE,KAAK,GAAS;IACZ,KAAKhB,GAAL,CAASgB,KAAT;EACD;;EAEDC,SAAS,CACPC,KADO,EAEPC,eAFO,EAGPC,eAHO,EAIa;IACpB,MAAMC,SAAoB,GAAGC,8BAAA,CAAeC,WAAf,CAA2BL,KAA3B,CAA7B;;IACA,IAAIC,eAAe,IAAIC,eAAvB,EAAwC;MACtC;MACA;MACA;MACA,MAAMI,EAAS,GAAGL,eAAe,GAC7BM,sBAAA,CAAWC,SAAX,CAAqBP,eAArB,CAD6B,GAE7B,KAAKQ,SAAL,CAAeN,SAAS,CAACO,KAAV,IAAmBC,YAAY,CAACC,EAAb,CAAgB,CAAhB,EAAmB,CAAnB,EAAsB,CAAtB,EAAyB,CAAzB,CAAlC,CAFJ;MAGA,MAAMC,EAAS,GAAGX,eAAe,GAC7BK,sBAAA,CAAWC,SAAX,CAAqBN,eAArB,CAD6B,GAE7B,KAAKO,SAAL,CACEN,SAAS,CAACW,eAAV,IAA6BH,YAAY,CAACC,EAAb,CAAgB,CAAhB,EAAmB,CAAnB,EAAsB,CAAtB,EAAyB,CAAzB,CAD/B,CAFJ;MAKA,KAAK9B,GAAL,CAASiC,cAAT,CAAwB,IAAI,KAAKlC,SAAL,CAAemC,SAAnB,CAA6Bb,SAA7B,CAAxB,EAAiEG,EAAjE,EAAqEO,EAArE;IACD,CAbD,MAaO;MACL,KAAK/B,GAAL,CAASiB,SAAT,CAAmB,IAAI,KAAKlB,SAAL,CAAemC,SAAnB,CAA6Bb,SAA7B,CAAnB;IACD;;IAED,OAAO,IAAP;EACD;;EAEDc,GAAG,GAAuB;IACxB,KAAKnC,GAAL,CAASmC,GAAT;IACA,OAAO,IAAP;EACD;;EAEDC,OAAO,GAAG;IACR,KAAKpC,GAAL,CAASqC,MAAT;EACD;;EAEOV,SAAS,CAACC,KAAD,EAAoB;IACnC,MAAMU,KAAK,GAAG,IAAI,KAAKvC,SAAL,CAAewC,KAAnB,EAAd;IACAD,KAAK,CAACE,QAAN,CAAeZ,KAAf;IACA,OAAOU,KAAP;EACD;;AAzEH"}
@@ -0,0 +1,8 @@
1
+ import type { CanvasKit } from "canvaskit-wasm";
2
+ import type { ParagraphBuilderFactory, SkParagraphStyle, SkTypefaceFontProvider } from "../types";
3
+ import { Host } from "./Host";
4
+ import { JsiSkParagraphBuilder } from "./JsiSkParagraphBuilder";
5
+ export declare class JsiSkParagraphBuilderFactory extends Host implements ParagraphBuilderFactory {
6
+ constructor(CanvasKit: CanvasKit);
7
+ Make(paragraphStyle: SkParagraphStyle, typefaceProvider?: SkTypefaceFontProvider): JsiSkParagraphBuilder;
8
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.JsiSkParagraphBuilderFactory = void 0;
7
+
8
+ var _Host = require("./Host");
9
+
10
+ var _JsiSkParagraphBuilder = require("./JsiSkParagraphBuilder");
11
+
12
+ var _JsiSkParagraphStyle = require("./JsiSkParagraphStyle");
13
+
14
+ var _JsiSkTypeface = require("./JsiSkTypeface");
15
+
16
+ class JsiSkParagraphBuilderFactory extends _Host.Host {
17
+ constructor(CanvasKit) {
18
+ super(CanvasKit);
19
+ }
20
+
21
+ Make(paragraphStyle, typefaceProvider) {
22
+ const style = new this.CanvasKit.ParagraphStyle(_JsiSkParagraphStyle.JsiSkParagraphStyle.toParagraphStyle(this.CanvasKit, paragraphStyle ?? {}));
23
+
24
+ if (typefaceProvider === undefined) {
25
+ throw new Error("SkTypefaceFontProvider is required on React Native Web.");
26
+ }
27
+
28
+ return new _JsiSkParagraphBuilder.JsiSkParagraphBuilder(this.CanvasKit, this.CanvasKit.ParagraphBuilder.MakeFromFontProvider(style, _JsiSkTypeface.JsiSkTypeface.fromValue(typefaceProvider)));
29
+ }
30
+
31
+ }
32
+
33
+ exports.JsiSkParagraphBuilderFactory = JsiSkParagraphBuilderFactory;
34
+ //# sourceMappingURL=JsiSkParagraphBuilderFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["JsiSkParagraphBuilderFactory","Host","constructor","CanvasKit","Make","paragraphStyle","typefaceProvider","style","ParagraphStyle","JsiSkParagraphStyle","toParagraphStyle","undefined","Error","JsiSkParagraphBuilder","ParagraphBuilder","MakeFromFontProvider","JsiSkTypeface","fromValue"],"sources":["JsiSkParagraphBuilderFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n ParagraphBuilderFactory,\n SkParagraphStyle,\n SkTypefaceFontProvider,\n} from \"../types\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkParagraphBuilder } from \"./JsiSkParagraphBuilder\";\nimport { JsiSkParagraphStyle } from \"./JsiSkParagraphStyle\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkParagraphBuilderFactory\n extends Host\n implements ParagraphBuilderFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make(\n paragraphStyle: SkParagraphStyle,\n typefaceProvider?: SkTypefaceFontProvider\n ) {\n const style = new this.CanvasKit.ParagraphStyle(\n JsiSkParagraphStyle.toParagraphStyle(this.CanvasKit, paragraphStyle ?? {})\n );\n if (typefaceProvider === undefined) {\n throw new Error(\n \"SkTypefaceFontProvider is required on React Native Web.\"\n );\n }\n return new JsiSkParagraphBuilder(\n this.CanvasKit,\n this.CanvasKit.ParagraphBuilder.MakeFromFontProvider(\n style,\n JsiSkTypeface.fromValue(typefaceProvider)\n )\n );\n }\n}\n"],"mappings":";;;;;;;AAQA;;AACA;;AACA;;AACA;;AAEO,MAAMA,4BAAN,SACGC,UADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,CACFC,cADE,EAEFC,gBAFE,EAGF;IACA,MAAMC,KAAK,GAAG,IAAI,KAAKJ,SAAL,CAAeK,cAAnB,CACZC,wCAAA,CAAoBC,gBAApB,CAAqC,KAAKP,SAA1C,EAAqDE,cAAc,IAAI,EAAvE,CADY,CAAd;;IAGA,IAAIC,gBAAgB,KAAKK,SAAzB,EAAoC;MAClC,MAAM,IAAIC,KAAJ,CACJ,yDADI,CAAN;IAGD;;IACD,OAAO,IAAIC,4CAAJ,CACL,KAAKV,SADA,EAEL,KAAKA,SAAL,CAAeW,gBAAf,CAAgCC,oBAAhC,CACER,KADF,EAEES,4BAAA,CAAcC,SAAd,CAAwBX,gBAAxB,CAFF,CAFK,CAAP;EAOD;;AAxBH"}