react-native-nitro-markdown 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/README.md +311 -669
  2. package/android/CMakeLists.txt +8 -1
  3. package/android/build.gradle +9 -2
  4. package/android/consumer-rules.pro +31 -0
  5. package/android/gradle.properties +2 -0
  6. package/android/src/main/java/com/margelo/nitro/com/nitromarkdown/HybridMarkdownSession.kt +68 -22
  7. package/android/src/main/java/com/nitromarkdown/NitroMarkdownPackage.kt +6 -18
  8. package/cpp/bindings/HybridMarkdownParser.cpp +40 -12
  9. package/cpp/bindings/HybridMarkdownParser.hpp +4 -4
  10. package/cpp/bindings/HybridMarkdownSession.cpp +2 -0
  11. package/cpp/core/MD4CParser.cpp +147 -86
  12. package/cpp/core/MarkdownSessionCore.cpp +2 -0
  13. package/cpp/core/MarkdownTypes.hpp +1 -1
  14. package/ios/HybridMarkdownSession.swift +89 -46
  15. package/lib/commonjs/headless.js +34 -8
  16. package/lib/commonjs/headless.js.map +1 -1
  17. package/lib/commonjs/index.js +48 -38
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/markdown-stream.js +1 -1
  20. package/lib/commonjs/markdown-stream.js.map +1 -1
  21. package/lib/commonjs/markdown.js +57 -16
  22. package/lib/commonjs/markdown.js.map +1 -1
  23. package/lib/commonjs/renderers/blockquote.js +15 -13
  24. package/lib/commonjs/renderers/blockquote.js.map +1 -1
  25. package/lib/commonjs/renderers/code.js +58 -54
  26. package/lib/commonjs/renderers/code.js.map +1 -1
  27. package/lib/commonjs/renderers/heading.js +48 -46
  28. package/lib/commonjs/renderers/heading.js.map +1 -1
  29. package/lib/commonjs/renderers/horizontal-rule.js +10 -8
  30. package/lib/commonjs/renderers/horizontal-rule.js.map +1 -1
  31. package/lib/commonjs/renderers/image.js +18 -4
  32. package/lib/commonjs/renderers/image.js.map +1 -1
  33. package/lib/commonjs/renderers/link.js +7 -2
  34. package/lib/commonjs/renderers/link.js.map +1 -1
  35. package/lib/commonjs/renderers/list.js +75 -68
  36. package/lib/commonjs/renderers/list.js.map +1 -1
  37. package/lib/commonjs/renderers/math.js +8 -5
  38. package/lib/commonjs/renderers/math.js.map +1 -1
  39. package/lib/commonjs/renderers/paragraph.js +15 -13
  40. package/lib/commonjs/renderers/paragraph.js.map +1 -1
  41. package/lib/commonjs/renderers/style-cache.js +14 -0
  42. package/lib/commonjs/renderers/style-cache.js.map +1 -0
  43. package/lib/commonjs/renderers/table/cell-content.js +1 -1
  44. package/lib/commonjs/renderers/table/cell-content.js.map +1 -1
  45. package/lib/commonjs/renderers/table/index.js +17 -6
  46. package/lib/commonjs/renderers/table/index.js.map +1 -1
  47. package/lib/commonjs/theme.js +7 -7
  48. package/lib/commonjs/theme.js.map +1 -1
  49. package/lib/commonjs/utils/code-highlight.js +24 -25
  50. package/lib/commonjs/utils/code-highlight.js.map +1 -1
  51. package/lib/module/headless.js +35 -7
  52. package/lib/module/headless.js.map +1 -1
  53. package/lib/module/index.js +1 -1
  54. package/lib/module/index.js.map +1 -1
  55. package/lib/module/markdown-stream.js +1 -1
  56. package/lib/module/markdown-stream.js.map +1 -1
  57. package/lib/module/markdown.js +58 -17
  58. package/lib/module/markdown.js.map +1 -1
  59. package/lib/module/renderers/blockquote.js +15 -13
  60. package/lib/module/renderers/blockquote.js.map +1 -1
  61. package/lib/module/renderers/code.js +58 -54
  62. package/lib/module/renderers/code.js.map +1 -1
  63. package/lib/module/renderers/heading.js +48 -46
  64. package/lib/module/renderers/heading.js.map +1 -1
  65. package/lib/module/renderers/horizontal-rule.js +10 -8
  66. package/lib/module/renderers/horizontal-rule.js.map +1 -1
  67. package/lib/module/renderers/image.js +19 -5
  68. package/lib/module/renderers/image.js.map +1 -1
  69. package/lib/module/renderers/link.js +7 -2
  70. package/lib/module/renderers/link.js.map +1 -1
  71. package/lib/module/renderers/list.js +75 -68
  72. package/lib/module/renderers/list.js.map +1 -1
  73. package/lib/module/renderers/math.js +8 -5
  74. package/lib/module/renderers/math.js.map +1 -1
  75. package/lib/module/renderers/paragraph.js +15 -13
  76. package/lib/module/renderers/paragraph.js.map +1 -1
  77. package/lib/module/renderers/style-cache.js +10 -0
  78. package/lib/module/renderers/style-cache.js.map +1 -0
  79. package/lib/module/renderers/table/cell-content.js +1 -1
  80. package/lib/module/renderers/table/cell-content.js.map +1 -1
  81. package/lib/module/renderers/table/index.js +17 -6
  82. package/lib/module/renderers/table/index.js.map +1 -1
  83. package/lib/module/theme.js +7 -7
  84. package/lib/module/theme.js.map +1 -1
  85. package/lib/module/utils/code-highlight.js +24 -25
  86. package/lib/module/utils/code-highlight.js.map +1 -1
  87. package/lib/typescript/commonjs/Markdown.nitro.d.ts +1 -0
  88. package/lib/typescript/commonjs/Markdown.nitro.d.ts.map +1 -1
  89. package/lib/typescript/commonjs/headless.d.ts +10 -2
  90. package/lib/typescript/commonjs/headless.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/index.d.ts +3 -2
  92. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/markdown-stream.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/markdown.d.ts +8 -3
  95. package/lib/typescript/commonjs/markdown.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/renderers/blockquote.d.ts +1 -1
  97. package/lib/typescript/commonjs/renderers/blockquote.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/renderers/code.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/renderers/heading.d.ts +1 -1
  100. package/lib/typescript/commonjs/renderers/heading.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/renderers/horizontal-rule.d.ts +1 -1
  102. package/lib/typescript/commonjs/renderers/horizontal-rule.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/renderers/image.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/renderers/link.d.ts.map +1 -1
  105. package/lib/typescript/commonjs/renderers/list.d.ts +1 -1
  106. package/lib/typescript/commonjs/renderers/list.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/renderers/math.d.ts +1 -1
  108. package/lib/typescript/commonjs/renderers/math.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/renderers/paragraph.d.ts +1 -1
  110. package/lib/typescript/commonjs/renderers/paragraph.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/renderers/style-cache.d.ts +3 -0
  112. package/lib/typescript/commonjs/renderers/style-cache.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/renderers/table/cell-content.d.ts +4 -3
  114. package/lib/typescript/commonjs/renderers/table/cell-content.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/renderers/table/index.d.ts.map +1 -1
  116. package/lib/typescript/commonjs/theme.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/utils/code-highlight.d.ts +1 -1
  118. package/lib/typescript/commonjs/utils/code-highlight.d.ts.map +1 -1
  119. package/lib/typescript/module/Markdown.nitro.d.ts +1 -0
  120. package/lib/typescript/module/Markdown.nitro.d.ts.map +1 -1
  121. package/lib/typescript/module/headless.d.ts +10 -2
  122. package/lib/typescript/module/headless.d.ts.map +1 -1
  123. package/lib/typescript/module/index.d.ts +3 -2
  124. package/lib/typescript/module/index.d.ts.map +1 -1
  125. package/lib/typescript/module/markdown-stream.d.ts.map +1 -1
  126. package/lib/typescript/module/markdown.d.ts +8 -3
  127. package/lib/typescript/module/markdown.d.ts.map +1 -1
  128. package/lib/typescript/module/renderers/blockquote.d.ts +1 -1
  129. package/lib/typescript/module/renderers/blockquote.d.ts.map +1 -1
  130. package/lib/typescript/module/renderers/code.d.ts.map +1 -1
  131. package/lib/typescript/module/renderers/heading.d.ts +1 -1
  132. package/lib/typescript/module/renderers/heading.d.ts.map +1 -1
  133. package/lib/typescript/module/renderers/horizontal-rule.d.ts +1 -1
  134. package/lib/typescript/module/renderers/horizontal-rule.d.ts.map +1 -1
  135. package/lib/typescript/module/renderers/image.d.ts.map +1 -1
  136. package/lib/typescript/module/renderers/link.d.ts.map +1 -1
  137. package/lib/typescript/module/renderers/list.d.ts +1 -1
  138. package/lib/typescript/module/renderers/list.d.ts.map +1 -1
  139. package/lib/typescript/module/renderers/math.d.ts +1 -1
  140. package/lib/typescript/module/renderers/math.d.ts.map +1 -1
  141. package/lib/typescript/module/renderers/paragraph.d.ts +1 -1
  142. package/lib/typescript/module/renderers/paragraph.d.ts.map +1 -1
  143. package/lib/typescript/module/renderers/style-cache.d.ts +3 -0
  144. package/lib/typescript/module/renderers/style-cache.d.ts.map +1 -0
  145. package/lib/typescript/module/renderers/table/cell-content.d.ts +4 -3
  146. package/lib/typescript/module/renderers/table/cell-content.d.ts.map +1 -1
  147. package/lib/typescript/module/renderers/table/index.d.ts.map +1 -1
  148. package/lib/typescript/module/theme.d.ts.map +1 -1
  149. package/lib/typescript/module/utils/code-highlight.d.ts +1 -1
  150. package/lib/typescript/module/utils/code-highlight.d.ts.map +1 -1
  151. package/nitro.json +12 -3
  152. package/nitrogen/generated/android/NitroMarkdownOnLoad.cpp +2 -2
  153. package/nitrogen/generated/android/c++/JFunc_void.hpp +2 -2
  154. package/nitrogen/generated/android/c++/JFunc_void_double_double.hpp +2 -2
  155. package/nitrogen/generated/android/c++/JHybridMarkdownSessionSpec.hpp +2 -2
  156. package/nitrogen/generated/ios/NitroMarkdown+autolinking.rb +2 -0
  157. package/nitrogen/generated/shared/c++/ParserOptions.hpp +6 -2
  158. package/package.json +8 -6
  159. package/react-native-nitro-markdown.podspec +3 -0
  160. package/src/Markdown.nitro.ts +1 -0
  161. package/src/headless.ts +58 -8
  162. package/src/index.ts +16 -2
  163. package/src/markdown-stream.tsx +1 -0
  164. package/src/markdown.tsx +108 -23
  165. package/src/renderers/blockquote.tsx +22 -17
  166. package/src/renderers/code.tsx +76 -57
  167. package/src/renderers/heading.tsx +60 -54
  168. package/src/renderers/horizontal-rule.tsx +17 -12
  169. package/src/renderers/image.tsx +24 -5
  170. package/src/renderers/link.tsx +8 -2
  171. package/src/renderers/list.tsx +93 -74
  172. package/src/renderers/math.tsx +14 -5
  173. package/src/renderers/paragraph.tsx +22 -17
  174. package/src/renderers/style-cache.ts +14 -0
  175. package/src/renderers/table/cell-content.tsx +15 -4
  176. package/src/renderers/table/index.tsx +30 -13
  177. package/src/theme.ts +34 -14
  178. package/src/utils/code-highlight.ts +133 -44
@@ -36,7 +36,7 @@ export type MarkdownProps = {
36
36
  */
37
37
  children: string;
38
38
  /**
39
- * Parser options to enable GFM or Math support.
39
+ * Parser options to enable GFM, math, or raw HTML AST support.
40
40
  */
41
41
  options?: ParserOptions;
42
42
  /**
@@ -54,7 +54,12 @@ export type MarkdownProps = {
54
54
  */
55
55
  astTransform?: AstTransform;
56
56
  /**
57
- * Callback fired when parsing begins.
57
+ * Callback fired after the current parse cycle completes and the component
58
+ * has re-rendered with new content. Because the native parser runs
59
+ * synchronously inside `useMemo`, there is no observable "in-progress"
60
+ * window — this callback fires in the `useEffect` commit phase, after the
61
+ * new AST is already rendered. Use `onParseComplete` for post-parse
62
+ * inspection of results.
58
63
  */
59
64
  onParsingInProgress?: () => void;
60
65
  /**
@@ -71,7 +76,7 @@ export type MarkdownProps = {
71
76
  * @param phase - Where the error occurred.
72
77
  * @param pluginName - The plugin name, if applicable.
73
78
  */
74
- onError?: (error: Error, phase: 'parse' | 'before-plugin' | 'after-plugin', pluginName?: string) => void;
79
+ onError?: (error: Error, phase: "parse" | "before-plugin" | "after-plugin", pluginName?: string) => void;
75
80
  /**
76
81
  * Custom renderers for specific markdown node types.
77
82
  * Each renderer receives { node, children, Renderer } plus type-specific props.
@@ -1 +1 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,EAAE,EAIR,MAAM,OAAO,CAAC;AACf,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAKL,KAAK,YAAY,EAClB,M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;;;OAOG;IACH,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE;QACzB,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,YAAY,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;KACd,KAAK,IAAI,CAAC;IACX;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,cAAc,EACjD,UAAU,CAAC,EAAE,MAAM,KAChB,IAAI,CAAC;IACV;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC9B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;OAEG;IACH,cAAc,CAAC,EAAE,6BAA6B,CAAC;IAC/C;;OAEG;IACH,YAAY,CAAC,EAAE;QACb,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;IACF;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAmMtC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type FC, type ReactNode } from "react";
1
+ import type { FC, ReactNode } from "react";
2
2
  import { type ViewStyle } from "react-native";
3
3
  type BlockquoteProps = {
4
4
  children: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["../../../../src/renderers/blockquote.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGhE,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAoB1C,CAAC"}
1
+ {"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["../../../../src/renderers/blockquote.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKhE,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAK1C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../../src/renderers/code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAML,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAoFxC,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA8B1C,CAAC"}
1
+ {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../../src/renderers/code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAML,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA0DxC,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAiB1C,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type FC, type ReactNode } from "react";
1
+ import type { FC, ReactNode } from "react";
2
2
  import { type TextStyle } from "react-native";
3
3
  type HeadingProps = {
4
4
  level: number;
@@ -1 +1 @@
1
- {"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../../src/renderers/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG1E,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAYF,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAmEpC,CAAC"}
1
+ {"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../../src/renderers/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAK1E,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAYF,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAepC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type FC } from "react";
1
+ import type { FC } from "react";
2
2
  import { type ViewStyle } from "react-native";
3
3
  type HorizontalRuleProps = {
4
4
  style?: ViewStyle;
@@ -1 +1 @@
1
- {"version":3,"file":"horizontal-rule.d.ts","sourceRoot":"","sources":["../../../../src/renderers/horizontal-rule.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGhE,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAclD,CAAC"}
1
+ {"version":3,"file":"horizontal-rule.d.ts","sourceRoot":"","sources":["../../../../src/renderers/horizontal-rule.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKhE,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAIlD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../src/renderers/image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,EAAE,EACP,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AACf,OAAO,EAML,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAkB5D,KAAK,UAAU,GAAG;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAqKhC,CAAC"}
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../src/renderers/image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,EAAE,EACP,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AACf,OAAO,EAML,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAkB5D,KAAK,UAAU,GAAG;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAwLhC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/renderers/link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAOtB,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAuC9B,CAAC"}
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/renderers/link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAOtB,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CA6C9B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type FC, type ReactNode } from "react";
1
+ import type { FC, ReactNode } from "react";
2
2
  import { type ViewStyle } from "react-native";
3
3
  type ListProps = {
4
4
  ordered: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/renderers/list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGhF,KAAK,SAAS,GAAG;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAoB9B,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAwCtC,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAqD9C,CAAC"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/renderers/list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKhF,KAAK,SAAS,GAAG;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAGF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAQ9B,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAoBtC,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAqB9C,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type FC } from "react";
1
+ import type { FC } from "react";
2
2
  import { type ViewStyle } from "react-native";
3
3
  type MathInlineProps = {
4
4
  content?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../src/renderers/math.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAC7D,OAAO,EAML,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAoBtB,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAyDF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA2B1C,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA0BxC,CAAC"}
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../src/renderers/math.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAiB,MAAM,OAAO,CAAC;AAC/C,OAAO,EAML,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AA0BtB,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AA4DF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA2B1C,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA0BxC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type FC, type ReactNode } from "react";
1
+ import type { FC, ReactNode } from "react";
2
2
  import { type StyleProp, type ViewStyle } from "react-native";
3
3
  type ParagraphProps = {
4
4
  children: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../../../src/renderers/paragraph.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGhF,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAkCxC,CAAC"}
1
+ {"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../../../src/renderers/paragraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKhF,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAmBxC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { MarkdownTheme } from "../theme";
2
+ export declare function getCachedStyles<T>(cache: WeakMap<MarkdownTheme, T>, theme: MarkdownTheme, createStyles: (theme: MarkdownTheme) => T): T;
3
+ //# sourceMappingURL=style-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style-cache.d.ts","sourceRoot":"","sources":["../../../../src/renderers/style-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,eAAe,CAAC,CAAC,EAC/B,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,EAChC,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,CAAC,GACxC,CAAC,CAOH"}
@@ -1,12 +1,13 @@
1
- import { type FC, type ComponentType } from "react";
2
- import { type StyleProp, type TextStyle } from "react-native";
1
+ import type { FC, ComponentType } from "react";
2
+ import { type StyleProp, type TextStyle, type ViewStyle } from "react-native";
3
3
  import type { MarkdownNode } from "../../headless";
4
4
  import type { NodeRendererProps } from "../../MarkdownContext";
5
5
  type CellContentProps = {
6
6
  node: MarkdownNode;
7
7
  Renderer: ComponentType<NodeRendererProps>;
8
8
  styles: {
9
- cellContentWrapper: object;
9
+ cellContentWrapper: StyleProp<ViewStyle>;
10
+ [key: string]: StyleProp<ViewStyle | TextStyle> | undefined;
10
11
  };
11
12
  textStyle?: StyleProp<TextStyle>;
12
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cell-content.d.ts","sourceRoot":"","sources":["../../../../../src/renderers/table/cell-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC3C,MAAM,EAAE;QACN,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAuB5C,CAAC"}
1
+ {"version":3,"file":"cell-content.d.ts","sourceRoot":"","sources":["../../../../../src/renderers/table/cell-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC3C,MAAM,EAAE;QACN,kBAAkB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACzC,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;KAC7D,CAAC;IACF,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA2B5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/renderers/table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAAE,EACP,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,SAAS,EAEf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAUnF,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,OAAO,gBAAgB,EAAE,YAAY,CAAC;IAC5C,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAQF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA+RhD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/renderers/table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAAE,EACP,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,SAAS,EAEf,MAAM,cAAc,CAAC;AAQtB,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAI/B,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,OAAO,gBAAgB,EAAE,YAAY,CAAC;IAC5C,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC3C,KAAK,CA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KAAG,CAAC,IAAI,YAAY,GAAG,SAAS;CAAE,GAAG;KAAG,CAAC,IAAI,YAAY,GAAG,SAAS;CAAE,CACxE,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,SAAS,CAAC;AAExD,eAAO,MAAM,oBAAoB,EAAE,aAoDlC,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,MAAM,aAAa,EACnB,UAAU,oBAAoB,KAC7B,aAWF,CAAC"}
@@ -1,4 +1,4 @@
1
- export type TokenType = 'keyword' | 'string' | 'comment' | 'number' | 'operator' | 'punctuation' | 'type' | 'default';
1
+ export type TokenType = "keyword" | "string" | "comment" | "number" | "operator" | "punctuation" | "type" | "default";
2
2
  export type HighlightedToken = {
3
3
  text: string;
4
4
  type: TokenType;
@@ -1 +1 @@
1
- {"version":3,"file":"code-highlight.d.ts","sourceRoot":"","sources":["../../../../src/utils/code-highlight.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,aAAa,GACb,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AACjE,MAAM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,gBAAgB,EAAE,CAAC;AA2ErF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAerF"}
1
+ {"version":3,"file":"code-highlight.d.ts","sourceRoot":"","sources":["../../../../src/utils/code-highlight.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,aAAa,GACb,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AACjE,MAAM,MAAM,eAAe,GAAG,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,KACT,gBAAgB,EAAE,CAAC;AA8JxB,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,gBAAgB,EAAE,CAepB"}
package/nitro.json CHANGED
@@ -9,11 +9,20 @@
9
9
  },
10
10
  "autolinking": {
11
11
  "MarkdownParser": {
12
- "cpp": "HybridMarkdownParser"
12
+ "all": {
13
+ "language": "c++",
14
+ "implementationClassName": "HybridMarkdownParser"
15
+ }
13
16
  },
14
17
  "MarkdownSession": {
15
- "swift": "HybridMarkdownSession",
16
- "kotlin": "HybridMarkdownSession"
18
+ "ios": {
19
+ "language": "swift",
20
+ "implementationClassName": "HybridMarkdownSession"
21
+ },
22
+ "android": {
23
+ "language": "kotlin",
24
+ "implementationClassName": "HybridMarkdownSession"
25
+ }
17
26
  }
18
27
  }
19
28
  }
@@ -30,9 +30,9 @@ int initialize(JavaVM* vm) {
30
30
  }
31
31
 
32
32
  struct JHybridMarkdownSessionSpecImpl: public jni::JavaClass<JHybridMarkdownSessionSpecImpl, JHybridMarkdownSessionSpec::JavaPart> {
33
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/HybridMarkdownSession;";
33
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/HybridMarkdownSession;";
34
34
  static std::shared_ptr<JHybridMarkdownSessionSpec> create() {
35
- static auto constructorFn = javaClassStatic()->getConstructor<JHybridMarkdownSessionSpecImpl::javaobject()>();
35
+ static const auto constructorFn = javaClassStatic()->getConstructor<JHybridMarkdownSessionSpecImpl::javaobject()>();
36
36
  jni::local_ref<JHybridMarkdownSessionSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
37
37
  return javaPart->getJHybridMarkdownSessionSpec();
38
38
  }
@@ -23,7 +23,7 @@ namespace margelo::nitro::Markdown {
23
23
  */
24
24
  struct JFunc_void: public jni::JavaClass<JFunc_void> {
25
25
  public:
26
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/Func_void;";
26
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/Func_void;";
27
27
 
28
28
  public:
29
29
  /**
@@ -59,7 +59,7 @@ namespace margelo::nitro::Markdown {
59
59
  }
60
60
 
61
61
  public:
62
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/Func_void_cxx;";
62
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/Func_void_cxx;";
63
63
  static void registerNatives() {
64
64
  registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_cxx::invoke_cxx)});
65
65
  }
@@ -23,7 +23,7 @@ namespace margelo::nitro::Markdown {
23
23
  */
24
24
  struct JFunc_void_double_double: public jni::JavaClass<JFunc_void_double_double> {
25
25
  public:
26
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/Func_void_double_double;";
26
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/Func_void_double_double;";
27
27
 
28
28
  public:
29
29
  /**
@@ -59,7 +59,7 @@ namespace margelo::nitro::Markdown {
59
59
  }
60
60
 
61
61
  public:
62
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/Func_void_double_double_cxx;";
62
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/Func_void_double_double_cxx;";
63
63
  static void registerNatives() {
64
64
  registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_double_double_cxx::invoke_cxx)});
65
65
  }
@@ -21,11 +21,11 @@ namespace margelo::nitro::Markdown {
21
21
  class JHybridMarkdownSessionSpec: public virtual HybridMarkdownSessionSpec, public virtual JHybridObject {
22
22
  public:
23
23
  struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
24
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/HybridMarkdownSessionSpec;";
24
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/HybridMarkdownSessionSpec;";
25
25
  std::shared_ptr<JHybridMarkdownSessionSpec> getJHybridMarkdownSessionSpec();
26
26
  };
27
27
  struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
28
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/HybridMarkdownSessionSpec$CxxPart;";
28
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/com/nitromarkdown/HybridMarkdownSessionSpec$CxxPart;";
29
29
  static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
30
30
  static void registerNatives();
31
31
  using HybridBase::HybridBase;
@@ -56,5 +56,7 @@ def add_nitrogen_files(spec)
56
56
  "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
57
  # Enables stricter modular headers
58
58
  "DEFINES_MODULE" => "YES",
59
+ # Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here)
60
+ "SWIFT_INSTALL_OBJC_HEADER" => "NO",
59
61
  })
60
62
  end
@@ -41,10 +41,11 @@ namespace margelo::nitro::Markdown {
41
41
  public:
42
42
  std::optional<bool> gfm SWIFT_PRIVATE;
43
43
  std::optional<bool> math SWIFT_PRIVATE;
44
+ std::optional<bool> html SWIFT_PRIVATE;
44
45
 
45
46
  public:
46
47
  ParserOptions() = default;
47
- explicit ParserOptions(std::optional<bool> gfm, std::optional<bool> math): gfm(gfm), math(math) {}
48
+ explicit ParserOptions(std::optional<bool> gfm, std::optional<bool> math, std::optional<bool> html): gfm(gfm), math(math), html(html) {}
48
49
 
49
50
  public:
50
51
  friend bool operator==(const ParserOptions& lhs, const ParserOptions& rhs) = default;
@@ -61,13 +62,15 @@ namespace margelo::nitro {
61
62
  jsi::Object obj = arg.asObject(runtime);
62
63
  return margelo::nitro::Markdown::ParserOptions(
63
64
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "gfm"))),
64
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "math")))
65
+ JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "math"))),
66
+ JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "html")))
65
67
  );
66
68
  }
67
69
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::Markdown::ParserOptions& arg) {
68
70
  jsi::Object obj(runtime);
69
71
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "gfm"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.gfm));
70
72
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "math"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.math));
73
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "html"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.html));
71
74
  return obj;
72
75
  }
73
76
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -80,6 +83,7 @@ namespace margelo::nitro {
80
83
  }
81
84
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "gfm")))) return false;
82
85
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "math")))) return false;
86
+ if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "html")))) return false;
83
87
  return true;
84
88
  }
85
89
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-markdown",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "High-performance Markdown parser for React Native using Nitro Modules and md4c",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -47,6 +47,7 @@
47
47
  "!cpp/build",
48
48
  "!android/build",
49
49
  "!android/.cxx",
50
+ "!ios/build",
50
51
  "!scripts"
51
52
  ],
52
53
  "scripts": {
@@ -54,7 +55,7 @@
54
55
  "build": "bob build",
55
56
  "clean": "rimraf lib nitrogen/generated",
56
57
  "codegen": "nitrogen --logLevel=\"debug\"",
57
- "lint": "eslint src --max-warnings=0 --ignore-pattern 'src/**/__tests__/**' --ignore-pattern 'src/**/*.nitro.ts'",
58
+ "lint": "bunx eslint src --max-warnings=0 --ignore-pattern 'src/**/__tests__/**' --ignore-pattern 'src/**/*.nitro.ts'",
58
59
  "typecheck": "tsc --noEmit",
59
60
  "test": "jest",
60
61
  "test:coverage": "jest --coverage",
@@ -80,6 +81,7 @@
80
81
  },
81
82
  "author": "João Paulo C. Marra <joaopaulocmarra@gmail.com>",
82
83
  "license": "MIT",
84
+ "sideEffects": false,
83
85
  "bugs": {
84
86
  "url": "https://github.com/JoaoPauloCMarra/react-native-nitro-markdown/issues"
85
87
  },
@@ -89,18 +91,18 @@
89
91
  },
90
92
  "devDependencies": {
91
93
  "@size-limit/preset-small-lib": "^11.0.0",
92
- "@types/react": "^19.2.14",
94
+ "@types/react": "~19.2.14",
93
95
  "@types/react-native": "^0.73.0",
94
96
  "@types/react-test-renderer": "^19.1.0",
95
- "react-native-builder-bob": "^0.40.18",
96
- "react-test-renderer": "^19.2.4",
97
+ "react-native-builder-bob": "^0.41.0",
98
+ "react-test-renderer": "19.2.0",
97
99
  "size-limit": "^11.0.0",
98
100
  "typescript": "^5.9.3"
99
101
  },
100
102
  "peerDependencies": {
101
103
  "react": "*",
102
104
  "react-native": ">=0.75.0",
103
- "react-native-nitro-modules": ">=0.35.0",
105
+ "react-native-nitro-modules": ">=0.35.4",
104
106
  "react-native-mathjax-svg": ">=0.9.0",
105
107
  "react-native-svg": ">=13.0.0"
106
108
  },
@@ -18,6 +18,9 @@ Pod::Spec.new do |s|
18
18
  "ios/**/*.{h,m,mm,swift}",
19
19
  "cpp/**/*.{h,hpp,c,cpp}"
20
20
  ]
21
+ s.exclude_files = [
22
+ "cpp/core/*Test.cpp"
23
+ ]
21
24
 
22
25
  s.pod_target_xcconfig = {
23
26
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
@@ -3,6 +3,7 @@ import type { HybridObject } from "react-native-nitro-modules";
3
3
  export interface ParserOptions {
4
4
  gfm?: boolean;
5
5
  math?: boolean;
6
+ html?: boolean;
6
7
  }
7
8
 
8
9
  export interface MarkdownParser extends HybridObject<{
package/src/headless.ts CHANGED
@@ -79,38 +79,82 @@ export type MarkdownNode = {
79
79
  children?: MarkdownNode[];
80
80
  };
81
81
 
82
- export const MarkdownParserModule =
83
- NitroModules.createHybridObject<MarkdownParser>("MarkdownParser");
82
+ let MarkdownParserModule: MarkdownParser | null = null;
83
+ try {
84
+ MarkdownParserModule =
85
+ NitroModules.createHybridObject<MarkdownParser>("MarkdownParser");
86
+ } catch (e) {
87
+ if (__DEV__) {
88
+ // eslint-disable-next-line no-console
89
+ console.error("[NitroMarkdown] Failed to create native MarkdownParser:", e);
90
+ }
91
+ }
92
+ export { MarkdownParserModule };
84
93
 
85
94
  /**
86
95
  * Parse markdown text into an AST.
87
96
  * @param text - The markdown text to parse
88
97
  * @returns The root node of the parsed AST
89
98
  */
90
- export function parseMarkdown(text: string): MarkdownNode {
91
- if (typeof MarkdownParserModule.parse === "function") {
99
+ export function parseMarkdown(text: string): MarkdownNode;
100
+ /**
101
+ * Parse markdown text with custom options.
102
+ * @param text - The markdown text to parse
103
+ * @param options - Parser options (gfm, math, html)
104
+ * @returns The root node of the parsed AST
105
+ */
106
+ export function parseMarkdown(
107
+ text: string,
108
+ options: ParserOptions,
109
+ ): MarkdownNode;
110
+ export function parseMarkdown(
111
+ text: string,
112
+ options?: ParserOptions,
113
+ ): MarkdownNode {
114
+ if (options != null) {
115
+ return parseMarkdownWithOptions(text, options);
116
+ }
117
+ if (
118
+ MarkdownParserModule != null &&
119
+ typeof MarkdownParserModule.parse === "function"
120
+ ) {
92
121
  const jsonStr = MarkdownParserModule.parse(text);
93
122
  return JSON.parse(jsonStr) as MarkdownNode;
94
123
  }
95
124
 
125
+ if (__DEV__) {
126
+ // eslint-disable-next-line no-console
127
+ console.error(
128
+ "[NitroMarkdown] parseMarkdown: native parser unavailable — check installation.",
129
+ );
130
+ }
96
131
  return { type: "document", children: [] };
97
132
  }
98
133
 
99
134
  /**
100
135
  * Parse markdown text with custom options.
101
136
  * @param text - The markdown text to parse
102
- * @param options - Parser options (gfm, math)
137
+ * @param options - Parser options (gfm, math, html)
103
138
  * @returns The root node of the parsed AST
104
139
  */
105
140
  export function parseMarkdownWithOptions(
106
141
  text: string,
107
142
  options: ParserOptions,
108
143
  ): MarkdownNode {
109
- if (typeof MarkdownParserModule.parseWithOptions === "function") {
144
+ if (
145
+ MarkdownParserModule != null &&
146
+ typeof MarkdownParserModule.parseWithOptions === "function"
147
+ ) {
110
148
  const jsonStr = MarkdownParserModule.parseWithOptions(text, options);
111
149
  return JSON.parse(jsonStr) as MarkdownNode;
112
150
  }
113
151
 
152
+ if (__DEV__) {
153
+ // eslint-disable-next-line no-console
154
+ console.error(
155
+ "[NitroMarkdown] parseMarkdownWithOptions: native parser unavailable — check installation.",
156
+ );
157
+ }
114
158
  return { type: "document", children: [] };
115
159
  }
116
160
 
@@ -119,7 +163,10 @@ export function parseMarkdownWithOptions(
119
163
  * Useful for search/indexing flows that don't need full AST rendering.
120
164
  */
121
165
  export function extractPlainText(text: string): string {
122
- if (typeof MarkdownParserModule.extractPlainText === "function") {
166
+ if (
167
+ MarkdownParserModule != null &&
168
+ typeof MarkdownParserModule.extractPlainText === "function"
169
+ ) {
123
170
  return MarkdownParserModule.extractPlainText(text);
124
171
  }
125
172
 
@@ -133,7 +180,10 @@ export function extractPlainTextWithOptions(
133
180
  text: string,
134
181
  options: ParserOptions,
135
182
  ): string {
136
- if (typeof MarkdownParserModule.extractPlainTextWithOptions === "function") {
183
+ if (
184
+ MarkdownParserModule != null &&
185
+ typeof MarkdownParserModule.extractPlainTextWithOptions === "function"
186
+ ) {
137
187
  return MarkdownParserModule.extractPlainTextWithOptions(text, options);
138
188
  }
139
189
 
package/src/index.ts CHANGED
@@ -1,4 +1,14 @@
1
- export * from "./headless";
1
+ export {
2
+ MarkdownParserModule,
3
+ parseMarkdown,
4
+ parseMarkdownWithOptions,
5
+ extractPlainText,
6
+ extractPlainTextWithOptions,
7
+ getTextContent,
8
+ getFlattenedText,
9
+ stripSourceOffsets,
10
+ } from "./headless";
11
+ export type { MarkdownNode, ParserOptions, MarkdownParser } from "./headless";
2
12
 
3
13
  export { Markdown } from "./markdown";
4
14
  export type {
@@ -56,5 +66,9 @@ export { createMarkdownSession } from "./MarkdownSession";
56
66
  export type { MarkdownSession } from "./MarkdownSession";
57
67
  export { useMarkdownSession, useStream } from "./use-markdown-stream";
58
68
 
59
- export type { HighlightedToken, TokenType, CodeHighlighter } from "./utils/code-highlight";
69
+ export type {
70
+ HighlightedToken,
71
+ TokenType,
72
+ CodeHighlighter,
73
+ } from "./utils/code-highlight";
60
74
  export { defaultHighlighter } from "./utils/code-highlight";
@@ -234,6 +234,7 @@ export const MarkdownStream: FC<MarkdownStreamProps> = ({
234
234
  allowIncremental,
235
235
  hasBeforeParsePlugins,
236
236
  options,
237
+ plugins,
237
238
  session,
238
239
  updateIntervalMs,
239
240
  updateStrategy,