@multiplatform.one/markdown 6.0.0

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 (640) hide show
  1. package/LICENSE +201 -0
  2. package/dist/cjs/Aside/index.cjs +112 -0
  3. package/dist/cjs/Aside/index.native.js +119 -0
  4. package/dist/cjs/Aside/index.native.js.map +1 -0
  5. package/dist/cjs/ExternalIcon/ExternalIcon.spec.cjs +37 -0
  6. package/dist/cjs/ExternalIcon/ExternalIcon.spec.native.js +40 -0
  7. package/dist/cjs/ExternalIcon/ExternalIcon.spec.native.js.map +1 -0
  8. package/dist/cjs/ExternalIcon/index.cjs +46 -0
  9. package/dist/cjs/ExternalIcon/index.native.js +51 -0
  10. package/dist/cjs/ExternalIcon/index.native.js.map +1 -0
  11. package/dist/cjs/Hr/hr.spec.cjs +21 -0
  12. package/dist/cjs/Hr/hr.spec.native.js +24 -0
  13. package/dist/cjs/Hr/hr.spec.native.js.map +1 -0
  14. package/dist/cjs/Hr/index.cjs +41 -0
  15. package/dist/cjs/Hr/index.native.js +46 -0
  16. package/dist/cjs/Hr/index.native.js.map +1 -0
  17. package/dist/cjs/Li/index.cjs +38 -0
  18. package/dist/cjs/Li/index.native.js +41 -0
  19. package/dist/cjs/Li/index.native.js.map +1 -0
  20. package/dist/cjs/Li/li.spec.cjs +45 -0
  21. package/dist/cjs/Li/li.spec.native.js +50 -0
  22. package/dist/cjs/Li/li.spec.native.js.map +1 -0
  23. package/dist/cjs/Markdown.cjs +66 -0
  24. package/dist/cjs/Markdown.native.js +71 -0
  25. package/dist/cjs/Markdown.native.js.map +1 -0
  26. package/dist/cjs/Markdown.stories.cjs +153 -0
  27. package/dist/cjs/Markdown.stories.native.js +162 -0
  28. package/dist/cjs/Markdown.stories.native.js.map +1 -0
  29. package/dist/cjs/Mdx/index.cjs +58 -0
  30. package/dist/cjs/Mdx/index.native.js +62 -0
  31. package/dist/cjs/Mdx/index.native.js.map +1 -0
  32. package/dist/cjs/Mdx/mdx.spec.cjs +139 -0
  33. package/dist/cjs/Mdx/mdx.spec.native.js +158 -0
  34. package/dist/cjs/Mdx/mdx.spec.native.js.map +1 -0
  35. package/dist/cjs/MdxCodeBlock/index.cjs +185 -0
  36. package/dist/cjs/MdxCodeBlock/index.native.js +205 -0
  37. package/dist/cjs/MdxCodeBlock/index.native.js.map +1 -0
  38. package/dist/cjs/MdxCodeBlock/mdxCodeBlock.spec.cjs +90 -0
  39. package/dist/cjs/MdxCodeBlock/mdxCodeBlock.spec.native.js +122 -0
  40. package/dist/cjs/MdxCodeBlock/mdxCodeBlock.spec.native.js.map +1 -0
  41. package/dist/cjs/MdxCodeBlock/mdxCodeBlockContext.cjs +29 -0
  42. package/dist/cjs/MdxCodeBlock/mdxCodeBlockContext.native.js +32 -0
  43. package/dist/cjs/MdxCodeBlock/mdxCodeBlockContext.native.js.map +1 -0
  44. package/dist/cjs/Notice/index.cjs +94 -0
  45. package/dist/cjs/Notice/index.native.js +98 -0
  46. package/dist/cjs/Notice/index.native.js.map +1 -0
  47. package/dist/cjs/SimpleTable/index.cjs +132 -0
  48. package/dist/cjs/SimpleTable/index.native.js +162 -0
  49. package/dist/cjs/SimpleTable/index.native.js.map +1 -0
  50. package/dist/cjs/Table/index.cjs +121 -0
  51. package/dist/cjs/Table/index.native.js +130 -0
  52. package/dist/cjs/Table/index.native.js.map +1 -0
  53. package/dist/cjs/Tabs/index.cjs +93 -0
  54. package/dist/cjs/Tabs/index.native.js +103 -0
  55. package/dist/cjs/Tabs/index.native.js.map +1 -0
  56. package/dist/cjs/Ul/index.cjs +35 -0
  57. package/dist/cjs/Ul/index.native.js +38 -0
  58. package/dist/cjs/Ul/index.native.js.map +1 -0
  59. package/dist/cjs/Ul/ul.spec.cjs +150 -0
  60. package/dist/cjs/Ul/ul.spec.native.js +153 -0
  61. package/dist/cjs/Ul/ul.spec.native.js.map +1 -0
  62. package/dist/cjs/Video/index.cjs +84 -0
  63. package/dist/cjs/Video/index.native.js +89 -0
  64. package/dist/cjs/Video/index.native.js.map +1 -0
  65. package/dist/cjs/components/Blockquote.cjs +47 -0
  66. package/dist/cjs/components/Blockquote.native.js +51 -0
  67. package/dist/cjs/components/Blockquote.native.js.map +1 -0
  68. package/dist/cjs/components/Break.cjs +34 -0
  69. package/dist/cjs/components/Break.native.js +37 -0
  70. package/dist/cjs/components/Break.native.js.map +1 -0
  71. package/dist/cjs/components/CodeBlock.cjs +109 -0
  72. package/dist/cjs/components/CodeBlock.native.js +119 -0
  73. package/dist/cjs/components/CodeBlock.native.js.map +1 -0
  74. package/dist/cjs/components/Heading.cjs +48 -0
  75. package/dist/cjs/components/Heading.native.js +52 -0
  76. package/dist/cjs/components/Heading.native.js.map +1 -0
  77. package/dist/cjs/components/HorizontalRule.cjs +34 -0
  78. package/dist/cjs/components/HorizontalRule.native.js +37 -0
  79. package/dist/cjs/components/HorizontalRule.native.js.map +1 -0
  80. package/dist/cjs/components/Image.cjs +53 -0
  81. package/dist/cjs/components/Image.native.js +57 -0
  82. package/dist/cjs/components/Image.native.js.map +1 -0
  83. package/dist/cjs/components/InlineCode.cjs +48 -0
  84. package/dist/cjs/components/InlineCode.native.js +52 -0
  85. package/dist/cjs/components/InlineCode.native.js.map +1 -0
  86. package/dist/cjs/components/InlineStyles.cjs +55 -0
  87. package/dist/cjs/components/InlineStyles.native.js +61 -0
  88. package/dist/cjs/components/InlineStyles.native.js.map +1 -0
  89. package/dist/cjs/components/Link.cjs +54 -0
  90. package/dist/cjs/components/Link.native.js +58 -0
  91. package/dist/cjs/components/Link.native.js.map +1 -0
  92. package/dist/cjs/components/List.cjs +74 -0
  93. package/dist/cjs/components/List.native.js +79 -0
  94. package/dist/cjs/components/List.native.js.map +1 -0
  95. package/dist/cjs/components/Paragraph.cjs +38 -0
  96. package/dist/cjs/components/Paragraph.native.js +42 -0
  97. package/dist/cjs/components/Paragraph.native.js.map +1 -0
  98. package/dist/cjs/components/Table.cjs +86 -0
  99. package/dist/cjs/components/Table.native.js +92 -0
  100. package/dist/cjs/components/Table.native.js.map +1 -0
  101. package/dist/cjs/components/index.cjs +55 -0
  102. package/dist/cjs/components/index.native.js +58 -0
  103. package/dist/cjs/components/index.native.js.map +1 -0
  104. package/dist/cjs/hooks/index.cjs +22 -0
  105. package/dist/cjs/hooks/index.native.js +25 -0
  106. package/dist/cjs/hooks/index.native.js.map +1 -0
  107. package/dist/cjs/hooks/useCompileAndEvaluateMdx.cjs +42 -0
  108. package/dist/cjs/hooks/useCompileAndEvaluateMdx.native.js +45 -0
  109. package/dist/cjs/hooks/useCompileAndEvaluateMdx.native.js.map +1 -0
  110. package/dist/cjs/hooks/useCompileAndEvaluateMdx.spec.cjs +34 -0
  111. package/dist/cjs/hooks/useCompileAndEvaluateMdx.spec.native.js +49 -0
  112. package/dist/cjs/hooks/useCompileAndEvaluateMdx.spec.native.js.map +1 -0
  113. package/dist/cjs/hooks/useCompileMdx.cjs +80 -0
  114. package/dist/cjs/hooks/useCompileMdx.native.js +83 -0
  115. package/dist/cjs/hooks/useCompileMdx.native.js.map +1 -0
  116. package/dist/cjs/hooks/useEvaluateMdx.cjs +58 -0
  117. package/dist/cjs/hooks/useEvaluateMdx.native.js +63 -0
  118. package/dist/cjs/hooks/useEvaluateMdx.native.js.map +1 -0
  119. package/dist/cjs/icons/index.cjs +205 -0
  120. package/dist/cjs/icons/index.native.js +226 -0
  121. package/dist/cjs/icons/index.native.js.map +1 -0
  122. package/dist/cjs/index.cjs +51 -0
  123. package/dist/cjs/index.native.js +54 -0
  124. package/dist/cjs/index.native.js.map +1 -0
  125. package/dist/cjs/mdx.spec.cjs +400 -0
  126. package/dist/cjs/mdx.spec.native.js +465 -0
  127. package/dist/cjs/mdx.spec.native.js.map +1 -0
  128. package/dist/cjs/mdxComponents.cjs +317 -0
  129. package/dist/cjs/mdxComponents.native.js +376 -0
  130. package/dist/cjs/mdxComponents.native.js.map +1 -0
  131. package/dist/cjs/parser.cjs +49 -0
  132. package/dist/cjs/parser.native.js +52 -0
  133. package/dist/cjs/parser.native.js.map +1 -0
  134. package/dist/cjs/parser.spec.cjs +109 -0
  135. package/dist/cjs/parser.spec.native.js +114 -0
  136. package/dist/cjs/parser.spec.native.js.map +1 -0
  137. package/dist/cjs/renderer.cjs +326 -0
  138. package/dist/cjs/renderer.native.js +348 -0
  139. package/dist/cjs/renderer.native.js.map +1 -0
  140. package/dist/cjs/shared/colorRamps.cjs +74 -0
  141. package/dist/cjs/shared/colorRamps.native.js +77 -0
  142. package/dist/cjs/shared/colorRamps.native.js.map +1 -0
  143. package/dist/cjs/shared/index.cjs +20 -0
  144. package/dist/cjs/shared/index.native.js +23 -0
  145. package/dist/cjs/shared/index.native.js.map +1 -0
  146. package/dist/cjs/shiki/highlighter.cjs +89 -0
  147. package/dist/cjs/shiki/highlighter.native.js +94 -0
  148. package/dist/cjs/shiki/highlighter.native.js.map +1 -0
  149. package/dist/cjs/shiki/index.cjs +33 -0
  150. package/dist/cjs/shiki/index.native.js +36 -0
  151. package/dist/cjs/shiki/index.native.js.map +1 -0
  152. package/dist/cjs/types.cjs +18 -0
  153. package/dist/cjs/types.native.js +21 -0
  154. package/dist/cjs/types.native.js.map +1 -0
  155. package/dist/cjs/util/rehypeMetaAttributes.cjs +45 -0
  156. package/dist/cjs/util/rehypeMetaAttributes.native.js +49 -0
  157. package/dist/cjs/util/rehypeMetaAttributes.native.js.map +1 -0
  158. package/dist/cjs/util/util.spec.cjs +81 -0
  159. package/dist/cjs/util/util.spec.native.js +84 -0
  160. package/dist/cjs/util/util.spec.native.js.map +1 -0
  161. package/dist/esm/Aside/index.mjs +86 -0
  162. package/dist/esm/Aside/index.mjs.map +1 -0
  163. package/dist/esm/Aside/index.native.js +90 -0
  164. package/dist/esm/Aside/index.native.js.map +1 -0
  165. package/dist/esm/ExternalIcon/ExternalIcon.spec.mjs +38 -0
  166. package/dist/esm/ExternalIcon/ExternalIcon.spec.mjs.map +1 -0
  167. package/dist/esm/ExternalIcon/ExternalIcon.spec.native.js +38 -0
  168. package/dist/esm/ExternalIcon/ExternalIcon.spec.native.js.map +1 -0
  169. package/dist/esm/ExternalIcon/index.mjs +21 -0
  170. package/dist/esm/ExternalIcon/index.mjs.map +1 -0
  171. package/dist/esm/ExternalIcon/index.native.js +23 -0
  172. package/dist/esm/ExternalIcon/index.native.js.map +1 -0
  173. package/dist/esm/Hr/hr.spec.mjs +22 -0
  174. package/dist/esm/Hr/hr.spec.mjs.map +1 -0
  175. package/dist/esm/Hr/hr.spec.native.js +22 -0
  176. package/dist/esm/Hr/hr.spec.native.js.map +1 -0
  177. package/dist/esm/Hr/index.mjs +16 -0
  178. package/dist/esm/Hr/index.mjs.map +1 -0
  179. package/dist/esm/Hr/index.native.js +18 -0
  180. package/dist/esm/Hr/index.native.js.map +1 -0
  181. package/dist/esm/Li/index.mjs +13 -0
  182. package/dist/esm/Li/index.mjs.map +1 -0
  183. package/dist/esm/Li/index.native.js +13 -0
  184. package/dist/esm/Li/index.native.js.map +1 -0
  185. package/dist/esm/Li/li.spec.mjs +46 -0
  186. package/dist/esm/Li/li.spec.mjs.map +1 -0
  187. package/dist/esm/Li/li.spec.native.js +48 -0
  188. package/dist/esm/Li/li.spec.native.js.map +1 -0
  189. package/dist/esm/Markdown.mjs +41 -0
  190. package/dist/esm/Markdown.mjs.map +1 -0
  191. package/dist/esm/Markdown.native.js +43 -0
  192. package/dist/esm/Markdown.native.js.map +1 -0
  193. package/dist/esm/Markdown.stories.mjs +125 -0
  194. package/dist/esm/Markdown.stories.mjs.map +1 -0
  195. package/dist/esm/Markdown.stories.native.js +131 -0
  196. package/dist/esm/Markdown.stories.native.js.map +1 -0
  197. package/dist/esm/Mdx/index.mjs +33 -0
  198. package/dist/esm/Mdx/index.mjs.map +1 -0
  199. package/dist/esm/Mdx/index.native.js +34 -0
  200. package/dist/esm/Mdx/index.native.js.map +1 -0
  201. package/dist/esm/Mdx/mdx.spec.mjs +140 -0
  202. package/dist/esm/Mdx/mdx.spec.mjs.map +1 -0
  203. package/dist/esm/Mdx/mdx.spec.native.js +156 -0
  204. package/dist/esm/Mdx/mdx.spec.native.js.map +1 -0
  205. package/dist/esm/MdxCodeBlock/index.mjs +149 -0
  206. package/dist/esm/MdxCodeBlock/index.mjs.map +1 -0
  207. package/dist/esm/MdxCodeBlock/index.native.js +166 -0
  208. package/dist/esm/MdxCodeBlock/index.native.js.map +1 -0
  209. package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.mjs +91 -0
  210. package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.mjs.map +1 -0
  211. package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.native.js +96 -0
  212. package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.native.js.map +1 -0
  213. package/dist/esm/MdxCodeBlock/mdxCodeBlockContext.mjs +4 -0
  214. package/dist/esm/MdxCodeBlock/mdxCodeBlockContext.mjs.map +1 -0
  215. package/dist/esm/MdxCodeBlock/mdxCodeBlockContext.native.js +4 -0
  216. package/dist/esm/MdxCodeBlock/mdxCodeBlockContext.native.js.map +1 -0
  217. package/dist/esm/Notice/index.mjs +68 -0
  218. package/dist/esm/Notice/index.mjs.map +1 -0
  219. package/dist/esm/Notice/index.native.js +69 -0
  220. package/dist/esm/Notice/index.native.js.map +1 -0
  221. package/dist/esm/SimpleTable/index.mjs +107 -0
  222. package/dist/esm/SimpleTable/index.mjs.map +1 -0
  223. package/dist/esm/SimpleTable/index.native.js +134 -0
  224. package/dist/esm/SimpleTable/index.native.js.map +1 -0
  225. package/dist/esm/Table/index.mjs +91 -0
  226. package/dist/esm/Table/index.mjs.map +1 -0
  227. package/dist/esm/Table/index.native.js +97 -0
  228. package/dist/esm/Table/index.native.js.map +1 -0
  229. package/dist/esm/Tabs/index.mjs +67 -0
  230. package/dist/esm/Tabs/index.mjs.map +1 -0
  231. package/dist/esm/Tabs/index.native.js +74 -0
  232. package/dist/esm/Tabs/index.native.js.map +1 -0
  233. package/dist/esm/Ul/index.mjs +10 -0
  234. package/dist/esm/Ul/index.mjs.map +1 -0
  235. package/dist/esm/Ul/index.native.js +10 -0
  236. package/dist/esm/Ul/index.native.js.map +1 -0
  237. package/dist/esm/Ul/ul.spec.mjs +151 -0
  238. package/dist/esm/Ul/ul.spec.mjs.map +1 -0
  239. package/dist/esm/Ul/ul.spec.native.js +151 -0
  240. package/dist/esm/Ul/ul.spec.native.js.map +1 -0
  241. package/dist/esm/Video/index.mjs +59 -0
  242. package/dist/esm/Video/index.mjs.map +1 -0
  243. package/dist/esm/Video/index.native.js +61 -0
  244. package/dist/esm/Video/index.native.js.map +1 -0
  245. package/dist/esm/components/Blockquote.mjs +22 -0
  246. package/dist/esm/components/Blockquote.mjs.map +1 -0
  247. package/dist/esm/components/Blockquote.native.js +23 -0
  248. package/dist/esm/components/Blockquote.native.js.map +1 -0
  249. package/dist/esm/components/Break.mjs +9 -0
  250. package/dist/esm/components/Break.mjs.map +1 -0
  251. package/dist/esm/components/Break.native.js +9 -0
  252. package/dist/esm/components/Break.native.js.map +1 -0
  253. package/dist/esm/components/CodeBlock.mjs +84 -0
  254. package/dist/esm/components/CodeBlock.mjs.map +1 -0
  255. package/dist/esm/components/CodeBlock.native.js +91 -0
  256. package/dist/esm/components/CodeBlock.native.js.map +1 -0
  257. package/dist/esm/components/Heading.mjs +23 -0
  258. package/dist/esm/components/Heading.mjs.map +1 -0
  259. package/dist/esm/components/Heading.native.js +24 -0
  260. package/dist/esm/components/Heading.native.js.map +1 -0
  261. package/dist/esm/components/HorizontalRule.mjs +9 -0
  262. package/dist/esm/components/HorizontalRule.mjs.map +1 -0
  263. package/dist/esm/components/HorizontalRule.native.js +9 -0
  264. package/dist/esm/components/HorizontalRule.native.js.map +1 -0
  265. package/dist/esm/components/Image.mjs +28 -0
  266. package/dist/esm/components/Image.mjs.map +1 -0
  267. package/dist/esm/components/Image.native.js +29 -0
  268. package/dist/esm/components/Image.native.js.map +1 -0
  269. package/dist/esm/components/InlineCode.mjs +23 -0
  270. package/dist/esm/components/InlineCode.mjs.map +1 -0
  271. package/dist/esm/components/InlineCode.native.js +24 -0
  272. package/dist/esm/components/InlineCode.native.js.map +1 -0
  273. package/dist/esm/components/InlineStyles.mjs +28 -0
  274. package/dist/esm/components/InlineStyles.mjs.map +1 -0
  275. package/dist/esm/components/InlineStyles.native.js +31 -0
  276. package/dist/esm/components/InlineStyles.native.js.map +1 -0
  277. package/dist/esm/components/Link.mjs +29 -0
  278. package/dist/esm/components/Link.mjs.map +1 -0
  279. package/dist/esm/components/Link.native.js +30 -0
  280. package/dist/esm/components/Link.native.js.map +1 -0
  281. package/dist/esm/components/List.mjs +48 -0
  282. package/dist/esm/components/List.mjs.map +1 -0
  283. package/dist/esm/components/List.native.js +50 -0
  284. package/dist/esm/components/List.native.js.map +1 -0
  285. package/dist/esm/components/Paragraph.mjs +13 -0
  286. package/dist/esm/components/Paragraph.mjs.map +1 -0
  287. package/dist/esm/components/Paragraph.native.js +14 -0
  288. package/dist/esm/components/Paragraph.native.js.map +1 -0
  289. package/dist/esm/components/Table.mjs +59 -0
  290. package/dist/esm/components/Table.mjs.map +1 -0
  291. package/dist/esm/components/Table.native.js +62 -0
  292. package/dist/esm/components/Table.native.js.map +1 -0
  293. package/dist/esm/components/index.mjs +14 -0
  294. package/dist/esm/components/index.mjs.map +1 -0
  295. package/dist/esm/components/index.native.js +14 -0
  296. package/dist/esm/components/index.native.js.map +1 -0
  297. package/dist/esm/hooks/index.mjs +4 -0
  298. package/dist/esm/hooks/index.mjs.map +1 -0
  299. package/dist/esm/hooks/index.native.js +4 -0
  300. package/dist/esm/hooks/index.native.js.map +1 -0
  301. package/dist/esm/hooks/useCompileAndEvaluateMdx.mjs +17 -0
  302. package/dist/esm/hooks/useCompileAndEvaluateMdx.mjs.map +1 -0
  303. package/dist/esm/hooks/useCompileAndEvaluateMdx.native.js +17 -0
  304. package/dist/esm/hooks/useCompileAndEvaluateMdx.native.js.map +1 -0
  305. package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.mjs +35 -0
  306. package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.mjs.map +1 -0
  307. package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.native.js +47 -0
  308. package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.native.js.map +1 -0
  309. package/dist/esm/hooks/useCompileMdx.mjs +44 -0
  310. package/dist/esm/hooks/useCompileMdx.mjs.map +1 -0
  311. package/dist/esm/hooks/useCompileMdx.native.js +44 -0
  312. package/dist/esm/hooks/useCompileMdx.native.js.map +1 -0
  313. package/dist/esm/hooks/useEvaluateMdx.mjs +22 -0
  314. package/dist/esm/hooks/useEvaluateMdx.mjs.map +1 -0
  315. package/dist/esm/hooks/useEvaluateMdx.native.js +24 -0
  316. package/dist/esm/hooks/useEvaluateMdx.native.js.map +1 -0
  317. package/dist/esm/icons/index.mjs +175 -0
  318. package/dist/esm/icons/index.mjs.map +1 -0
  319. package/dist/esm/icons/index.native.js +193 -0
  320. package/dist/esm/icons/index.native.js.map +1 -0
  321. package/dist/esm/index.mjs +21 -0
  322. package/dist/esm/index.mjs.map +1 -0
  323. package/dist/esm/index.native.js +21 -0
  324. package/dist/esm/index.native.js.map +1 -0
  325. package/dist/esm/mdx.spec.mjs +377 -0
  326. package/dist/esm/mdx.spec.mjs.map +1 -0
  327. package/dist/esm/mdx.spec.native.js +439 -0
  328. package/dist/esm/mdx.spec.native.js.map +1 -0
  329. package/dist/esm/mdxComponents.mjs +291 -0
  330. package/dist/esm/mdxComponents.mjs.map +1 -0
  331. package/dist/esm/mdxComponents.native.js +347 -0
  332. package/dist/esm/mdxComponents.native.js.map +1 -0
  333. package/dist/esm/parser.mjs +12 -0
  334. package/dist/esm/parser.mjs.map +1 -0
  335. package/dist/esm/parser.native.js +12 -0
  336. package/dist/esm/parser.native.js.map +1 -0
  337. package/dist/esm/parser.spec.mjs +110 -0
  338. package/dist/esm/parser.spec.mjs.map +1 -0
  339. package/dist/esm/parser.spec.native.js +112 -0
  340. package/dist/esm/parser.spec.native.js.map +1 -0
  341. package/dist/esm/renderer.mjs +300 -0
  342. package/dist/esm/renderer.mjs.map +1 -0
  343. package/dist/esm/renderer.native.js +319 -0
  344. package/dist/esm/renderer.native.js.map +1 -0
  345. package/dist/esm/shared/colorRamps.mjs +45 -0
  346. package/dist/esm/shared/colorRamps.mjs.map +1 -0
  347. package/dist/esm/shared/colorRamps.native.js +45 -0
  348. package/dist/esm/shared/colorRamps.native.js.map +1 -0
  349. package/dist/esm/shared/index.mjs +2 -0
  350. package/dist/esm/shared/index.mjs.map +1 -0
  351. package/dist/esm/shared/index.native.js +2 -0
  352. package/dist/esm/shared/index.native.js.map +1 -0
  353. package/dist/esm/shiki/highlighter.mjs +59 -0
  354. package/dist/esm/shiki/highlighter.mjs.map +1 -0
  355. package/dist/esm/shiki/highlighter.native.js +61 -0
  356. package/dist/esm/shiki/highlighter.native.js.map +1 -0
  357. package/dist/esm/shiki/index.mjs +3 -0
  358. package/dist/esm/shiki/index.mjs.map +1 -0
  359. package/dist/esm/shiki/index.native.js +3 -0
  360. package/dist/esm/shiki/index.native.js.map +1 -0
  361. package/dist/esm/types.mjs +2 -0
  362. package/dist/esm/types.mjs.map +1 -0
  363. package/dist/esm/types.native.js +2 -0
  364. package/dist/esm/types.native.js.map +1 -0
  365. package/dist/esm/util/rehypeMetaAttributes.mjs +20 -0
  366. package/dist/esm/util/rehypeMetaAttributes.mjs.map +1 -0
  367. package/dist/esm/util/rehypeMetaAttributes.native.js +21 -0
  368. package/dist/esm/util/rehypeMetaAttributes.native.js.map +1 -0
  369. package/dist/esm/util/util.spec.mjs +82 -0
  370. package/dist/esm/util/util.spec.mjs.map +1 -0
  371. package/dist/esm/util/util.spec.native.js +82 -0
  372. package/dist/esm/util/util.spec.native.js.map +1 -0
  373. package/dist/jsx/Aside/index.mjs +86 -0
  374. package/dist/jsx/Aside/index.mjs.map +1 -0
  375. package/dist/jsx/Aside/index.native.js +119 -0
  376. package/dist/jsx/Aside/index.native.js.map +1 -0
  377. package/dist/jsx/ExternalIcon/ExternalIcon.spec.mjs +38 -0
  378. package/dist/jsx/ExternalIcon/ExternalIcon.spec.mjs.map +1 -0
  379. package/dist/jsx/ExternalIcon/ExternalIcon.spec.native.js +40 -0
  380. package/dist/jsx/ExternalIcon/ExternalIcon.spec.native.js.map +1 -0
  381. package/dist/jsx/ExternalIcon/index.mjs +21 -0
  382. package/dist/jsx/ExternalIcon/index.mjs.map +1 -0
  383. package/dist/jsx/ExternalIcon/index.native.js +51 -0
  384. package/dist/jsx/ExternalIcon/index.native.js.map +1 -0
  385. package/dist/jsx/Hr/hr.spec.mjs +22 -0
  386. package/dist/jsx/Hr/hr.spec.mjs.map +1 -0
  387. package/dist/jsx/Hr/hr.spec.native.js +24 -0
  388. package/dist/jsx/Hr/hr.spec.native.js.map +1 -0
  389. package/dist/jsx/Hr/index.mjs +16 -0
  390. package/dist/jsx/Hr/index.mjs.map +1 -0
  391. package/dist/jsx/Hr/index.native.js +46 -0
  392. package/dist/jsx/Hr/index.native.js.map +1 -0
  393. package/dist/jsx/Li/index.mjs +13 -0
  394. package/dist/jsx/Li/index.mjs.map +1 -0
  395. package/dist/jsx/Li/index.native.js +41 -0
  396. package/dist/jsx/Li/index.native.js.map +1 -0
  397. package/dist/jsx/Li/li.spec.mjs +46 -0
  398. package/dist/jsx/Li/li.spec.mjs.map +1 -0
  399. package/dist/jsx/Li/li.spec.native.js +50 -0
  400. package/dist/jsx/Li/li.spec.native.js.map +1 -0
  401. package/dist/jsx/Markdown.mjs +41 -0
  402. package/dist/jsx/Markdown.mjs.map +1 -0
  403. package/dist/jsx/Markdown.native.js +71 -0
  404. package/dist/jsx/Markdown.native.js.map +1 -0
  405. package/dist/jsx/Markdown.stories.mjs +125 -0
  406. package/dist/jsx/Markdown.stories.mjs.map +1 -0
  407. package/dist/jsx/Markdown.stories.native.js +162 -0
  408. package/dist/jsx/Markdown.stories.native.js.map +1 -0
  409. package/dist/jsx/Mdx/index.mjs +33 -0
  410. package/dist/jsx/Mdx/index.mjs.map +1 -0
  411. package/dist/jsx/Mdx/index.native.js +62 -0
  412. package/dist/jsx/Mdx/index.native.js.map +1 -0
  413. package/dist/jsx/Mdx/mdx.spec.mjs +140 -0
  414. package/dist/jsx/Mdx/mdx.spec.mjs.map +1 -0
  415. package/dist/jsx/Mdx/mdx.spec.native.js +158 -0
  416. package/dist/jsx/Mdx/mdx.spec.native.js.map +1 -0
  417. package/dist/jsx/MdxCodeBlock/index.mjs +149 -0
  418. package/dist/jsx/MdxCodeBlock/index.mjs.map +1 -0
  419. package/dist/jsx/MdxCodeBlock/index.native.js +205 -0
  420. package/dist/jsx/MdxCodeBlock/index.native.js.map +1 -0
  421. package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.mjs +91 -0
  422. package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.mjs.map +1 -0
  423. package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.native.js +122 -0
  424. package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.native.js.map +1 -0
  425. package/dist/jsx/MdxCodeBlock/mdxCodeBlockContext.mjs +4 -0
  426. package/dist/jsx/MdxCodeBlock/mdxCodeBlockContext.mjs.map +1 -0
  427. package/dist/jsx/MdxCodeBlock/mdxCodeBlockContext.native.js +32 -0
  428. package/dist/jsx/MdxCodeBlock/mdxCodeBlockContext.native.js.map +1 -0
  429. package/dist/jsx/Notice/index.mjs +68 -0
  430. package/dist/jsx/Notice/index.mjs.map +1 -0
  431. package/dist/jsx/Notice/index.native.js +98 -0
  432. package/dist/jsx/Notice/index.native.js.map +1 -0
  433. package/dist/jsx/SimpleTable/index.mjs +107 -0
  434. package/dist/jsx/SimpleTable/index.mjs.map +1 -0
  435. package/dist/jsx/SimpleTable/index.native.js +162 -0
  436. package/dist/jsx/SimpleTable/index.native.js.map +1 -0
  437. package/dist/jsx/Table/index.mjs +91 -0
  438. package/dist/jsx/Table/index.mjs.map +1 -0
  439. package/dist/jsx/Table/index.native.js +130 -0
  440. package/dist/jsx/Table/index.native.js.map +1 -0
  441. package/dist/jsx/Tabs/index.mjs +67 -0
  442. package/dist/jsx/Tabs/index.mjs.map +1 -0
  443. package/dist/jsx/Tabs/index.native.js +103 -0
  444. package/dist/jsx/Tabs/index.native.js.map +1 -0
  445. package/dist/jsx/Ul/index.mjs +10 -0
  446. package/dist/jsx/Ul/index.mjs.map +1 -0
  447. package/dist/jsx/Ul/index.native.js +38 -0
  448. package/dist/jsx/Ul/index.native.js.map +1 -0
  449. package/dist/jsx/Ul/ul.spec.mjs +151 -0
  450. package/dist/jsx/Ul/ul.spec.mjs.map +1 -0
  451. package/dist/jsx/Ul/ul.spec.native.js +153 -0
  452. package/dist/jsx/Ul/ul.spec.native.js.map +1 -0
  453. package/dist/jsx/Video/index.mjs +59 -0
  454. package/dist/jsx/Video/index.mjs.map +1 -0
  455. package/dist/jsx/Video/index.native.js +89 -0
  456. package/dist/jsx/Video/index.native.js.map +1 -0
  457. package/dist/jsx/components/Blockquote.mjs +22 -0
  458. package/dist/jsx/components/Blockquote.mjs.map +1 -0
  459. package/dist/jsx/components/Blockquote.native.js +51 -0
  460. package/dist/jsx/components/Blockquote.native.js.map +1 -0
  461. package/dist/jsx/components/Break.mjs +9 -0
  462. package/dist/jsx/components/Break.mjs.map +1 -0
  463. package/dist/jsx/components/Break.native.js +37 -0
  464. package/dist/jsx/components/Break.native.js.map +1 -0
  465. package/dist/jsx/components/CodeBlock.mjs +84 -0
  466. package/dist/jsx/components/CodeBlock.mjs.map +1 -0
  467. package/dist/jsx/components/CodeBlock.native.js +119 -0
  468. package/dist/jsx/components/CodeBlock.native.js.map +1 -0
  469. package/dist/jsx/components/Heading.mjs +23 -0
  470. package/dist/jsx/components/Heading.mjs.map +1 -0
  471. package/dist/jsx/components/Heading.native.js +52 -0
  472. package/dist/jsx/components/Heading.native.js.map +1 -0
  473. package/dist/jsx/components/HorizontalRule.mjs +9 -0
  474. package/dist/jsx/components/HorizontalRule.mjs.map +1 -0
  475. package/dist/jsx/components/HorizontalRule.native.js +37 -0
  476. package/dist/jsx/components/HorizontalRule.native.js.map +1 -0
  477. package/dist/jsx/components/Image.mjs +28 -0
  478. package/dist/jsx/components/Image.mjs.map +1 -0
  479. package/dist/jsx/components/Image.native.js +57 -0
  480. package/dist/jsx/components/Image.native.js.map +1 -0
  481. package/dist/jsx/components/InlineCode.mjs +23 -0
  482. package/dist/jsx/components/InlineCode.mjs.map +1 -0
  483. package/dist/jsx/components/InlineCode.native.js +52 -0
  484. package/dist/jsx/components/InlineCode.native.js.map +1 -0
  485. package/dist/jsx/components/InlineStyles.mjs +28 -0
  486. package/dist/jsx/components/InlineStyles.mjs.map +1 -0
  487. package/dist/jsx/components/InlineStyles.native.js +61 -0
  488. package/dist/jsx/components/InlineStyles.native.js.map +1 -0
  489. package/dist/jsx/components/Link.mjs +29 -0
  490. package/dist/jsx/components/Link.mjs.map +1 -0
  491. package/dist/jsx/components/Link.native.js +58 -0
  492. package/dist/jsx/components/Link.native.js.map +1 -0
  493. package/dist/jsx/components/List.mjs +48 -0
  494. package/dist/jsx/components/List.mjs.map +1 -0
  495. package/dist/jsx/components/List.native.js +79 -0
  496. package/dist/jsx/components/List.native.js.map +1 -0
  497. package/dist/jsx/components/Paragraph.mjs +13 -0
  498. package/dist/jsx/components/Paragraph.mjs.map +1 -0
  499. package/dist/jsx/components/Paragraph.native.js +42 -0
  500. package/dist/jsx/components/Paragraph.native.js.map +1 -0
  501. package/dist/jsx/components/Table.mjs +59 -0
  502. package/dist/jsx/components/Table.mjs.map +1 -0
  503. package/dist/jsx/components/Table.native.js +92 -0
  504. package/dist/jsx/components/Table.native.js.map +1 -0
  505. package/dist/jsx/components/index.mjs +14 -0
  506. package/dist/jsx/components/index.mjs.map +1 -0
  507. package/dist/jsx/components/index.native.js +58 -0
  508. package/dist/jsx/components/index.native.js.map +1 -0
  509. package/dist/jsx/hooks/index.mjs +4 -0
  510. package/dist/jsx/hooks/index.mjs.map +1 -0
  511. package/dist/jsx/hooks/index.native.js +25 -0
  512. package/dist/jsx/hooks/index.native.js.map +1 -0
  513. package/dist/jsx/hooks/useCompileAndEvaluateMdx.mjs +17 -0
  514. package/dist/jsx/hooks/useCompileAndEvaluateMdx.mjs.map +1 -0
  515. package/dist/jsx/hooks/useCompileAndEvaluateMdx.native.js +45 -0
  516. package/dist/jsx/hooks/useCompileAndEvaluateMdx.native.js.map +1 -0
  517. package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.mjs +35 -0
  518. package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.mjs.map +1 -0
  519. package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.native.js +49 -0
  520. package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.native.js.map +1 -0
  521. package/dist/jsx/hooks/useCompileMdx.mjs +44 -0
  522. package/dist/jsx/hooks/useCompileMdx.mjs.map +1 -0
  523. package/dist/jsx/hooks/useCompileMdx.native.js +83 -0
  524. package/dist/jsx/hooks/useCompileMdx.native.js.map +1 -0
  525. package/dist/jsx/hooks/useEvaluateMdx.mjs +22 -0
  526. package/dist/jsx/hooks/useEvaluateMdx.mjs.map +1 -0
  527. package/dist/jsx/hooks/useEvaluateMdx.native.js +63 -0
  528. package/dist/jsx/hooks/useEvaluateMdx.native.js.map +1 -0
  529. package/dist/jsx/icons/index.mjs +175 -0
  530. package/dist/jsx/icons/index.mjs.map +1 -0
  531. package/dist/jsx/icons/index.native.js +226 -0
  532. package/dist/jsx/icons/index.native.js.map +1 -0
  533. package/dist/jsx/index.js +21 -0
  534. package/dist/jsx/index.js.map +1 -0
  535. package/dist/jsx/index.mjs +21 -0
  536. package/dist/jsx/index.mjs.map +1 -0
  537. package/dist/jsx/index.native.js +54 -0
  538. package/dist/jsx/index.native.js.map +1 -0
  539. package/dist/jsx/mdx.spec.mjs +377 -0
  540. package/dist/jsx/mdx.spec.mjs.map +1 -0
  541. package/dist/jsx/mdx.spec.native.js +465 -0
  542. package/dist/jsx/mdx.spec.native.js.map +1 -0
  543. package/dist/jsx/mdxComponents.mjs +291 -0
  544. package/dist/jsx/mdxComponents.mjs.map +1 -0
  545. package/dist/jsx/mdxComponents.native.js +376 -0
  546. package/dist/jsx/mdxComponents.native.js.map +1 -0
  547. package/dist/jsx/parser.mjs +12 -0
  548. package/dist/jsx/parser.mjs.map +1 -0
  549. package/dist/jsx/parser.native.js +52 -0
  550. package/dist/jsx/parser.native.js.map +1 -0
  551. package/dist/jsx/parser.spec.mjs +110 -0
  552. package/dist/jsx/parser.spec.mjs.map +1 -0
  553. package/dist/jsx/parser.spec.native.js +114 -0
  554. package/dist/jsx/parser.spec.native.js.map +1 -0
  555. package/dist/jsx/renderer.mjs +300 -0
  556. package/dist/jsx/renderer.mjs.map +1 -0
  557. package/dist/jsx/renderer.native.js +348 -0
  558. package/dist/jsx/renderer.native.js.map +1 -0
  559. package/dist/jsx/shared/colorRamps.mjs +45 -0
  560. package/dist/jsx/shared/colorRamps.mjs.map +1 -0
  561. package/dist/jsx/shared/colorRamps.native.js +77 -0
  562. package/dist/jsx/shared/colorRamps.native.js.map +1 -0
  563. package/dist/jsx/shared/index.mjs +2 -0
  564. package/dist/jsx/shared/index.mjs.map +1 -0
  565. package/dist/jsx/shared/index.native.js +23 -0
  566. package/dist/jsx/shared/index.native.js.map +1 -0
  567. package/dist/jsx/shiki/highlighter.mjs +59 -0
  568. package/dist/jsx/shiki/highlighter.mjs.map +1 -0
  569. package/dist/jsx/shiki/highlighter.native.js +94 -0
  570. package/dist/jsx/shiki/highlighter.native.js.map +1 -0
  571. package/dist/jsx/shiki/index.mjs +3 -0
  572. package/dist/jsx/shiki/index.mjs.map +1 -0
  573. package/dist/jsx/shiki/index.native.js +36 -0
  574. package/dist/jsx/shiki/index.native.js.map +1 -0
  575. package/dist/jsx/types.mjs +2 -0
  576. package/dist/jsx/types.mjs.map +1 -0
  577. package/dist/jsx/types.native.js +21 -0
  578. package/dist/jsx/types.native.js.map +1 -0
  579. package/dist/jsx/util/rehypeMetaAttributes.mjs +20 -0
  580. package/dist/jsx/util/rehypeMetaAttributes.mjs.map +1 -0
  581. package/dist/jsx/util/rehypeMetaAttributes.native.js +49 -0
  582. package/dist/jsx/util/rehypeMetaAttributes.native.js.map +1 -0
  583. package/dist/jsx/util/util.spec.mjs +82 -0
  584. package/dist/jsx/util/util.spec.mjs.map +1 -0
  585. package/dist/jsx/util/util.spec.native.js +84 -0
  586. package/dist/jsx/util/util.spec.native.js.map +1 -0
  587. package/package.json +94 -0
  588. package/src/Aside/index.tsx +89 -0
  589. package/src/ExternalIcon/ExternalIcon.spec.tsx +33 -0
  590. package/src/ExternalIcon/index.tsx +15 -0
  591. package/src/Hr/hr.spec.tsx +18 -0
  592. package/src/Hr/index.tsx +7 -0
  593. package/src/Li/index.tsx +14 -0
  594. package/src/Li/li.spec.tsx +33 -0
  595. package/src/Markdown.stories.tsx +127 -0
  596. package/src/Markdown.tsx +62 -0
  597. package/src/Mdx/index.tsx +32 -0
  598. package/src/Mdx/mdx.spec.tsx +118 -0
  599. package/src/MdxCodeBlock/index.tsx +168 -0
  600. package/src/MdxCodeBlock/mdxCodeBlock.spec.tsx +66 -0
  601. package/src/MdxCodeBlock/mdxCodeBlockContext.ts +15 -0
  602. package/src/Notice/index.tsx +76 -0
  603. package/src/SimpleTable/index.tsx +125 -0
  604. package/src/Table/index.tsx +80 -0
  605. package/src/Tabs/index.tsx +76 -0
  606. package/src/Ul/index.ts +11 -0
  607. package/src/Ul/ul.spec.tsx +131 -0
  608. package/src/Video/index.tsx +62 -0
  609. package/src/components/Blockquote.tsx +20 -0
  610. package/src/components/Break.tsx +6 -0
  611. package/src/components/CodeBlock.tsx +94 -0
  612. package/src/components/Heading.tsx +20 -0
  613. package/src/components/HorizontalRule.tsx +6 -0
  614. package/src/components/Image.tsx +20 -0
  615. package/src/components/InlineCode.tsx +21 -0
  616. package/src/components/InlineStyles.tsx +14 -0
  617. package/src/components/Link.tsx +26 -0
  618. package/src/components/List.tsx +41 -0
  619. package/src/components/Paragraph.tsx +10 -0
  620. package/src/components/Table.tsx +56 -0
  621. package/src/components/index.ts +12 -0
  622. package/src/hooks/index.ts +3 -0
  623. package/src/hooks/useCompileAndEvaluateMdx.spec.tsx +31 -0
  624. package/src/hooks/useCompileAndEvaluateMdx.ts +22 -0
  625. package/src/hooks/useCompileMdx.ts +55 -0
  626. package/src/hooks/useEvaluateMdx.ts +27 -0
  627. package/src/icons/index.tsx +116 -0
  628. package/src/index.ts +33 -0
  629. package/src/mdx.spec.tsx +347 -0
  630. package/src/mdxComponents.tsx +225 -0
  631. package/src/parser.spec.ts +126 -0
  632. package/src/parser.ts +27 -0
  633. package/src/renderer.tsx +391 -0
  634. package/src/shared/colorRamps.ts +52 -0
  635. package/src/shared/index.ts +1 -0
  636. package/src/shiki/highlighter.ts +148 -0
  637. package/src/shiki/index.ts +11 -0
  638. package/src/types.ts +225 -0
  639. package/src/util/rehypeMetaAttributes.ts +21 -0
  640. package/src/util/util.spec.tsx +90 -0
@@ -0,0 +1,33 @@
1
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
2
+ import { describe, expect, it } from "vitest";
3
+ import { ExternalIcon } from "./index";
4
+
5
+ describe("ExternalIcon Component", () => {
6
+ it("renders without crashing", () => {
7
+ const { container } = renderWithProviders(<ExternalIcon />);
8
+ const svgElement = container.querySelector("svg");
9
+ expect(svgElement).toBeTruthy();
10
+ });
11
+
12
+ it("renders Svg with correct attributes", () => {
13
+ const { container } = renderWithProviders(<ExternalIcon />);
14
+ const svgElement = container.querySelector("svg");
15
+ expect(svgElement).toHaveAttribute("height", "10");
16
+ expect(svgElement).toHaveAttribute("width", "10");
17
+ expect(svgElement).toHaveAttribute("viewBox", "0 0 15 15");
18
+ });
19
+
20
+ it("applies correct opacity style to Svg", () => {
21
+ const { container } = renderWithProviders(<ExternalIcon />);
22
+ const svgElement = container.querySelector("svg");
23
+ expect(svgElement).toHaveStyle("opacity: 0.4");
24
+ });
25
+
26
+ it("contains Path inside Svg", () => {
27
+ const { container } = renderWithProviders(<ExternalIcon />);
28
+ const pathElement = container.querySelector("svg path");
29
+ expect(pathElement).toBeTruthy();
30
+ expect(pathElement).toHaveAttribute("fill");
31
+ // fill is now resolved via useTheme() instead of CSS var(--color)
32
+ });
33
+ });
@@ -0,0 +1,15 @@
1
+ import { Path, Svg } from "@tamagui/react-native-svg";
2
+ import { useTheme } from "tamagui";
3
+
4
+ export function ExternalIcon() {
5
+ const theme = useTheme();
6
+ const color = theme.color?.val ?? "currentColor";
7
+ return (
8
+ <Svg style={{ opacity: 0.4 }} width="10" height="10" viewBox="0 0 15 15">
9
+ <Path
10
+ d="M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z"
11
+ fill={color}
12
+ />
13
+ </Svg>
14
+ );
15
+ }
@@ -0,0 +1,18 @@
1
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
2
+ import { expect, it } from "vitest";
3
+ import { HR } from "./index";
4
+
5
+ it("renders without crashing", () => {
6
+ const { container } = renderWithProviders(<HR />);
7
+ expect(container).toBeTruthy();
8
+ });
9
+
10
+ it("renders outer YStack with correct basic alignment and structure", () => {
11
+ const { container } = renderWithProviders(<HR />);
12
+ const outerYStack = container.firstElementChild as HTMLElement;
13
+ expect(outerYStack).toBeTruthy();
14
+ const styleAttr = outerYStack.getAttribute("style") || "";
15
+ expect(styleAttr.includes("margin-left: auto"));
16
+ expect(styleAttr.includes("margin-right: auto"));
17
+ expect(styleAttr.includes("max-width: 50%"));
18
+ });
@@ -0,0 +1,7 @@
1
+ import { YStack } from "tamagui";
2
+
3
+ export const HR = (props: any) => (
4
+ <YStack marginVertical="$10" marginBottom="$8" marginHorizontal="auto" width="50%" {...props}>
5
+ <YStack borderBottomColor="$borderColor" borderBottomWidth={1} flex={1} />
6
+ </YStack>
7
+ );
@@ -0,0 +1,14 @@
1
+ import { Paragraph, styled } from "tamagui";
2
+
3
+ export const LI = styled(Paragraph, {
4
+ name: "LI",
5
+ display: "list-item" as any,
6
+ render: "li",
7
+ size: "$5",
8
+ paddingBottom: "$1",
9
+ style: {
10
+ listStyleType: "disc",
11
+ },
12
+ });
13
+
14
+ export type LIProps = React.ComponentProps<typeof LI>;
@@ -0,0 +1,33 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
3
+ import { LI } from "./index";
4
+
5
+ describe("LI Component", () => {
6
+ it("should render without errors", () => {
7
+ const { getByText } = renderWithProviders(<LI>This is a list item</LI>);
8
+ expect(getByText("This is a list item")).toBeDefined();
9
+ });
10
+
11
+ it("should have the correct tag", () => {
12
+ const { container } = renderWithProviders(<LI>This is a list item</LI>);
13
+ // Tamagui may render as li or as a styled element; ensure list content is present
14
+ expect(container.textContent).toContain("This is a list item");
15
+ const listItem = container.querySelector("li") ?? container.querySelector("[role='listitem']");
16
+ if (listItem) expect(listItem).toBeTruthy();
17
+ });
18
+
19
+ it("should render dynamic content correctly", () => {
20
+ const { getByText } = renderWithProviders(<LI>Another list item</LI>);
21
+ expect(getByText("Another list item")).toBeDefined();
22
+ });
23
+
24
+ it("should have display: list-item", () => {
25
+ const { container } = renderWithProviders(<LI>This is a list item</LI>);
26
+ expect(container.textContent).toContain("This is a list item");
27
+ const listItem = container.querySelector("li") ?? container.querySelector("[role='listitem']");
28
+ if (listItem) {
29
+ const display = window.getComputedStyle(listItem).display;
30
+ expect(display).toBe("list-item");
31
+ }
32
+ });
33
+ });
@@ -0,0 +1,127 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
2
+ import { YStack } from "tamagui";
3
+ import { Markdown } from "./Markdown";
4
+
5
+ const meta: Meta<typeof Markdown> = {
6
+ title: "Markdown/Markdown",
7
+ component: Markdown,
8
+ parameters: {
9
+ status: { type: "beta" },
10
+ docs: {
11
+ description: {
12
+ component:
13
+ "Cross-platform markdown renderer with Shiki syntax highlighting. Supports GFM (tables, strikethrough, task lists).",
14
+ },
15
+ },
16
+ },
17
+ };
18
+
19
+ export default meta;
20
+ type Story = StoryObj<typeof Markdown>;
21
+
22
+ const sampleMarkdown = `# Hello World
23
+
24
+ This is **bold**, _italic_, and ~~strikethrough~~ text.
25
+
26
+ ## Features
27
+
28
+ - Markdown parsing with remark
29
+ - GFM support (tables, task lists)
30
+ - Shiki syntax highlighting
31
+ - Cross-platform (web + native)
32
+
33
+ ### Task Lists
34
+
35
+ - [x] Completed task
36
+ - [ ] Incomplete task
37
+ - [ ] Another task
38
+
39
+ ## Code Blocks
40
+
41
+ Inline \`code\` looks like this.
42
+
43
+ \`\`\`typescript
44
+ interface User {
45
+ id: string;
46
+ name: string;
47
+ email: string;
48
+ }
49
+
50
+ function greet(user: User): string {
51
+ return \`Hello, \${user.name}!\`;
52
+ }
53
+ \`\`\`
54
+
55
+ \`\`\`python
56
+ def fibonacci(n: int) -> int:
57
+ if n <= 1:
58
+ return n
59
+ return fibonacci(n - 1) + fibonacci(n - 2)
60
+
61
+ print(fibonacci(10))
62
+ \`\`\`
63
+
64
+ ## Blockquotes
65
+
66
+ > This is a blockquote.
67
+ > It can span multiple lines.
68
+
69
+ ## Tables
70
+
71
+ | Feature | Web | Native |
72
+ |---------|-----|--------|
73
+ | Markdown | Yes | Yes |
74
+ | Syntax Highlighting | Yes | Yes |
75
+ | Tables | Yes | Yes |
76
+ | HTML | Yes | No |
77
+
78
+ ## Links and Images
79
+
80
+ [Visit GitHub](https://github.com)
81
+
82
+ ---
83
+
84
+ That's a horizontal rule above.
85
+ `;
86
+
87
+ export const Main: Story = {
88
+ name: "Main",
89
+ render: () => (
90
+ <YStack maxWidth={700} padding="$4">
91
+ <Markdown>{sampleMarkdown}</Markdown>
92
+ </YStack>
93
+ ),
94
+ };
95
+
96
+ export const CodeBlock: Story = {
97
+ render: () => (
98
+ <YStack maxWidth={700} padding="$4">
99
+ <Markdown>
100
+ {`\`\`\`javascript
101
+ const express = require('express');
102
+ const app = express();
103
+
104
+ app.get('/', (req, res) => {
105
+ res.json({ message: 'Hello World!' });
106
+ });
107
+
108
+ app.listen(3000, () => {
109
+ console.log('Server running on port 3000');
110
+ });
111
+ \`\`\``}
112
+ </Markdown>
113
+ </YStack>
114
+ ),
115
+ };
116
+
117
+ export const Simple: Story = {
118
+ render: () => (
119
+ <YStack maxWidth={700} padding="$4">
120
+ <Markdown>
121
+ {`# Simple Example
122
+
123
+ Just some **bold** and _italic_ text with a [link](https://example.com).`}
124
+ </Markdown>
125
+ </YStack>
126
+ ),
127
+ };
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Main Markdown component
3
+ * Cross-platform markdown renderer with Shiki syntax highlighting
4
+ */
5
+ import { useMemo } from "react";
6
+ import { View, type ViewProps, useThemeName } from "tamagui";
7
+ import { parseMarkdown } from "./parser";
8
+ import { renderMarkdown } from "./renderer";
9
+ import type { CodeTheme, MarkdownProps } from "./types";
10
+
11
+ export interface MarkdownComponentProps extends MarkdownProps, Omit<ViewProps, "children"> {}
12
+
13
+ /**
14
+ * Render markdown string as cross-platform React components
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <Markdown>
19
+ * # Hello World
20
+ *
21
+ * This is **bold** and _italic_ text.
22
+ *
23
+ * ```javascript
24
+ * const x = 1;
25
+ * ```
26
+ * </Markdown>
27
+ * ```
28
+ */
29
+ export function Markdown({
30
+ children,
31
+ components,
32
+ codeTheme = "auto",
33
+ ...viewProps
34
+ }: MarkdownComponentProps) {
35
+ const themeName = useThemeName();
36
+
37
+ // Resolve "auto" theme to light/dark based on current Tamagui theme
38
+ const resolvedCodeTheme = useMemo((): Exclude<CodeTheme, "auto"> => {
39
+ if (codeTheme !== "auto") {
40
+ return codeTheme;
41
+ }
42
+ // Check if theme name contains "dark" (e.g., "dark", "dark_blue", etc.)
43
+ const isDark = themeName?.includes("dark") ?? false;
44
+ return isDark ? "github-dark" : "github-light";
45
+ }, [codeTheme, themeName]);
46
+
47
+ const rendered = useMemo(() => {
48
+ if (!children || typeof children !== "string") {
49
+ return null;
50
+ }
51
+
52
+ try {
53
+ const ast = parseMarkdown(children);
54
+ return renderMarkdown(ast, { components, codeTheme: resolvedCodeTheme });
55
+ } catch (error) {
56
+ console.error("Markdown parsing error:", error);
57
+ return null;
58
+ }
59
+ }, [children, components, resolvedCodeTheme]);
60
+
61
+ return <View {...viewProps}>{rendered}</View>;
62
+ }
@@ -0,0 +1,32 @@
1
+ import { useMDXComponents } from "@mdx-js/react";
2
+ import type { DebugProp } from "@tamagui/web";
3
+ import type { MDXComponents } from "mdx/types";
4
+ import { useCompileAndEvaluateMdx } from "../hooks";
5
+ import { mdxComponents } from "../mdxComponents";
6
+
7
+ export interface MDXProps {
8
+ children: string;
9
+ components?: MDXComponents;
10
+ debug?: DebugProp;
11
+ }
12
+
13
+ const logger = console;
14
+
15
+ export function MDX({ children, debug, ...props }: MDXProps) {
16
+ const components = useMDXComponents();
17
+ const { Component, code, frontmatter } = useCompileAndEvaluateMdx(children);
18
+ if (!Component) return <>{}</>;
19
+ if (debug) {
20
+ logger.debug("MDX", { frontmatter });
21
+ logger.debug(code);
22
+ }
23
+ return (
24
+ <Component
25
+ components={{
26
+ ...mdxComponents,
27
+ ...components,
28
+ ...props.components,
29
+ }}
30
+ />
31
+ );
32
+ }
@@ -0,0 +1,118 @@
1
+ import { screen } from "@testing-library/react";
2
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
3
+ import type { MDXComponents } from "mdx/types";
4
+ import { YStack } from "tamagui";
5
+ import { afterEach, describe, expect, it, vi } from "vitest";
6
+ import { useCompileAndEvaluateMdx } from "../hooks";
7
+ import { MDX } from "./index";
8
+
9
+ const DummyComponent = ({ components }: { components: MDXComponents }) => {
10
+ return <YStack data-testid="dummy">{JSON.stringify(components)}</YStack>;
11
+ };
12
+ vi.mock("../hooks", () => ({
13
+ useCompileAndEvaluateMdx: vi.fn(),
14
+ }));
15
+ vi.mock("@mdx-js/react", () => ({
16
+ useMDXComponents: () => ({ hookKey: "hookValue" }),
17
+ }));
18
+ vi.mock("../mdxComponents", () => ({
19
+ mdxComponents: { mdxKey: "mdxValue" },
20
+ }));
21
+
22
+ describe("MDX component", () => {
23
+ afterEach(() => {
24
+ vi.clearAllMocks();
25
+ });
26
+ it("renders an empty fragment if no component is returned from the hook", () => {
27
+ (useCompileAndEvaluateMdx as any).mockReturnValue({
28
+ Component: null,
29
+ code: "some code",
30
+ frontmatter: { test: "frontmatter" },
31
+ });
32
+ renderWithProviders(
33
+ <>
34
+ <MDX children="hello" />
35
+ </>,
36
+ );
37
+ // When Component is null, no MDX content should be rendered
38
+ const mdxContent = screen.queryByText("hello");
39
+ expect(mdxContent).toBeNull();
40
+ });
41
+
42
+ it("renders the evaluated MDX component and passes the merged components prop", () => {
43
+ const TestDummyComponent = ({ components }: { components: MDXComponents }) => {
44
+ // Check if components are properly merged by checking keys
45
+ const componentKeys = Object.keys(components || {});
46
+ return <YStack data-testid="dummy">{componentKeys.join(",")}</YStack>;
47
+ };
48
+
49
+ (useCompileAndEvaluateMdx as any).mockReturnValue({
50
+ Component: TestDummyComponent,
51
+ code: "compiledCode",
52
+ frontmatter: { test: true },
53
+ });
54
+ const additionalComponents = {
55
+ p: ({ children }: any) => <div data-testid="custom-p">{children}</div>,
56
+ };
57
+ renderWithProviders(
58
+ <>
59
+ <MDX children="hello" components={additionalComponents} />
60
+ </>,
61
+ );
62
+ const dummyDiv = screen.getByTestId("dummy");
63
+ const componentKeys = dummyDiv.textContent?.split(",") || [];
64
+ expect(componentKeys).toContain("mdxKey");
65
+ expect(componentKeys).toContain("hookKey");
66
+ expect(componentKeys).toContain("p");
67
+ });
68
+
69
+ it("calls debug logging when the debug prop is provided", () => {
70
+ const debugSpy = vi.spyOn(console, "debug").mockImplementation(() => {});
71
+ (useCompileAndEvaluateMdx as any).mockReturnValue({
72
+ Component: DummyComponent,
73
+ code: "compiledCode",
74
+ frontmatter: { test: "frontmatter" },
75
+ });
76
+ renderWithProviders(
77
+ <>
78
+ <MDX children="hello" debug={true} />
79
+ </>,
80
+ );
81
+ expect(debugSpy).toHaveBeenCalledWith("MDX", {
82
+ frontmatter: { test: "frontmatter" },
83
+ });
84
+ expect(debugSpy).toHaveBeenCalledWith("compiledCode");
85
+ debugSpy.mockRestore();
86
+ });
87
+
88
+ it("does not call debug logging when the debug prop is false", () => {
89
+ const debugSpy = vi.spyOn(console, "debug").mockImplementation(() => {});
90
+ (useCompileAndEvaluateMdx as any).mockReturnValue({
91
+ Component: DummyComponent,
92
+ code: "compiledCode",
93
+ frontmatter: { test: "frontmatter" },
94
+ });
95
+ renderWithProviders(
96
+ <>
97
+ <MDX children="hello" debug={false} />
98
+ </>,
99
+ );
100
+ expect(debugSpy).not.toHaveBeenCalled();
101
+ debugSpy.mockRestore();
102
+ });
103
+
104
+ it("does not throw an error when an empty children string is provided", () => {
105
+ (useCompileAndEvaluateMdx as any).mockReturnValue({
106
+ Component: DummyComponent,
107
+ code: "",
108
+ frontmatter: {},
109
+ });
110
+ expect(() =>
111
+ renderWithProviders(
112
+ <>
113
+ <MDX children="hello" />
114
+ </>,
115
+ ),
116
+ ).not.toThrow();
117
+ });
118
+ });
@@ -0,0 +1,168 @@
1
+ import {
2
+ Code,
3
+ ErrorBoundary,
4
+ HighlightedCode,
5
+ Pre,
6
+ useClipboard,
7
+ useShikiTokens,
8
+ } from "@multiplatform.one/components";
9
+ import { useResolvedKnobs } from "@multiplatform.one/theme";
10
+ import { LinearGradient } from "@tamagui/linear-gradient";
11
+ import rangeParser from "parse-numeric-range";
12
+ import type { ReactNode } from "react";
13
+ import { useContext, useMemo, useState } from "react";
14
+ import { Button, ScrollView, Spacer, TooltipSimple, XStack, YStack } from "tamagui";
15
+ import { CheckCircleIcon, ClipboardIcon } from "../icons";
16
+
17
+ const zIndex = { localTop: 100 };
18
+ import type { MDXCodeBlockContextValue } from "./mdxCodeBlockContext";
19
+ import { MDXCodeBlockContext } from "./mdxCodeBlockContext";
20
+
21
+ export interface MDXCodeBlockProps extends MDXCodeBlockContextValue {
22
+ className?: string;
23
+ id?: string;
24
+ }
25
+
26
+ /**
27
+ * Extract raw code text from MDX children.
28
+ * Children are typically a plain string, but this handles nested elements for safety.
29
+ */
30
+ function extractCodeText(children: ReactNode): string {
31
+ if (typeof children === "string") return children;
32
+ if (Array.isArray(children)) return children.map(extractCodeText).join("");
33
+ if (children && typeof children === "object" && "props" in children) {
34
+ return extractCodeText((children as any).props?.children);
35
+ }
36
+ return String(children ?? "");
37
+ }
38
+
39
+ /**
40
+ * Extract language from className like "language-tsx" -> "tsx"
41
+ */
42
+ function extractLanguage(className?: string): string {
43
+ if (!className) return "text";
44
+ const match = className.match(/language-(\w+)/);
45
+ return match?.[1] || "text";
46
+ }
47
+
48
+ export function MDXCodeBlock(props: MDXCodeBlockProps) {
49
+ const {
50
+ children,
51
+ className,
52
+ disableCopy,
53
+ id,
54
+ isCollapsible,
55
+ isHighlightingLines,
56
+ showLineNumbers: propShowLineNumbers,
57
+ size,
58
+ line,
59
+ ...codeProps
60
+ } = { ...useContext(MDXCodeBlockContext), ...props } as MDXCodeBlockProps & {
61
+ line?: string;
62
+ };
63
+
64
+ const { knobProps } = useResolvedKnobs();
65
+ const codeText = useMemo(() => extractCodeText(children).replace(/\n$/, ""), [children]);
66
+ const language = useMemo(() => extractLanguage(className), [className]);
67
+ const tokens = useShikiTokens(codeText, language);
68
+
69
+ const lines = tokens?.length ?? codeText.split("\n").length;
70
+ const showLineNumbers = propShowLineNumbers ?? lines > 10;
71
+ const [isCollapsed, setIsCollapsed] = useState(isCollapsible);
72
+ const isLong = lines > 22;
73
+ const [isCutoff, setIsCutoff] = useState(isLong && !isCollapsible);
74
+ const { hasCopied, onCopy } = useClipboard(codeText);
75
+
76
+ const highlightLines = useMemo(() => {
77
+ if (!isHighlightingLines || !line) return [];
78
+ return rangeParser(line);
79
+ }, [isHighlightingLines, line]);
80
+
81
+ return (
82
+ <YStack position="relative" marginBottom="$4">
83
+ <ErrorBoundary>
84
+ <YStack
85
+ position="relative"
86
+ {...(isCutoff && {
87
+ maxHeight: 400,
88
+ overflow: "hidden",
89
+ borderRadius: knobProps.borderRadius.borderRadius,
90
+ })}
91
+ >
92
+ {(!isCollapsed || !isCollapsible) && isCutoff && (
93
+ <LinearGradient
94
+ position="absolute"
95
+ bottom={0}
96
+ left={0}
97
+ right={0}
98
+ height={200}
99
+ colors={["$backgroundTransparent", "$background"]}
100
+ zIndex={zIndex.localTop}
101
+ >
102
+ <Spacer flex={1} />
103
+ <Button onPress={() => setIsCutoff(!isCutoff)} alignSelf="center">
104
+ Show more
105
+ </Button>
106
+ <Spacer size="$4" />
107
+ </LinearGradient>
108
+ )}
109
+ {(!isCollapsed || !isCollapsible) && (
110
+ <Pre
111
+ padding={0}
112
+ marginBottom={0}
113
+ id={id}
114
+ data-line-numbers={showLineNumbers ? "true" : "false"}
115
+ >
116
+ <ScrollView
117
+ style={{ width: "100%" }}
118
+ contentContainerStyle={{ minWidth: "100%" }}
119
+ horizontal
120
+ showsHorizontalScrollIndicator={false}
121
+ >
122
+ <Code
123
+ backgroundColor="transparent"
124
+ flex={1}
125
+ {...knobProps.panelPadding}
126
+ size={(size ?? "$5") as any}
127
+ {...codeProps}
128
+ >
129
+ <HighlightedCode
130
+ tokens={tokens}
131
+ highlightLines={highlightLines}
132
+ showLineNumbers={showLineNumbers}
133
+ >
134
+ {codeText}
135
+ </HighlightedCode>
136
+ </Code>
137
+ </ScrollView>
138
+ </Pre>
139
+ )}
140
+ <XStack position="absolute" top="$3" right="$3" {...knobProps.gap}>
141
+ {(!isCollapsed || !isCollapsible) && !disableCopy && (
142
+ <TooltipSimple label={hasCopied ? "Copied" : "Copy to clipboard"}>
143
+ <Button
144
+ aria-label="Copy code to clipboard"
145
+ size="$2"
146
+ icon={hasCopied ? <CheckCircleIcon size={14} /> : <ClipboardIcon size={14} />}
147
+ onPress={onCopy}
148
+ $xs={{
149
+ display: "none",
150
+ }}
151
+ />
152
+ </TooltipSimple>
153
+ )}
154
+ {isCollapsible && (
155
+ <Button
156
+ accessibilityLabel="Show or hide code"
157
+ size="$2"
158
+ onPress={() => setIsCollapsed((x) => !x)}
159
+ >
160
+ {isCollapsed ? "Show code" : "Hide code"}
161
+ </Button>
162
+ )}
163
+ </XStack>
164
+ </YStack>
165
+ </ErrorBoundary>
166
+ </YStack>
167
+ );
168
+ }