@multiplatform.one/markdown 6.0.4 → 6.3.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 (672) hide show
  1. package/README.md +61 -0
  2. package/dist/cjs/Aside/index.cjs +37 -32
  3. package/dist/cjs/Aside/index.native.js +41 -34
  4. package/dist/cjs/Aside/index.native.js.map +1 -1
  5. package/dist/cjs/ExternalIcon/index.cjs +2 -0
  6. package/dist/cjs/ExternalIcon/index.native.js +2 -0
  7. package/dist/cjs/ExternalIcon/index.native.js.map +1 -1
  8. package/dist/cjs/Hr/index.cjs +3 -11
  9. package/dist/cjs/Hr/index.native.js +3 -11
  10. package/dist/cjs/Hr/index.native.js.map +1 -1
  11. package/dist/cjs/{SimpleTable → MarkdownSimpleTable}/index.cjs +27 -9
  12. package/dist/{jsx/SimpleTable → cjs/MarkdownSimpleTable}/index.native.js +32 -11
  13. package/dist/cjs/MarkdownSimpleTable/index.native.js.map +1 -0
  14. package/dist/cjs/Mdx/index.cjs +15 -7
  15. package/dist/cjs/Mdx/index.native.js +15 -7
  16. package/dist/cjs/Mdx/index.native.js.map +1 -1
  17. package/dist/cjs/MdxCodeBlock/index.cjs +28 -20
  18. package/dist/cjs/MdxCodeBlock/index.native.js +33 -22
  19. package/dist/cjs/MdxCodeBlock/index.native.js.map +1 -1
  20. package/dist/cjs/Notice/index.cjs +13 -56
  21. package/dist/cjs/Notice/index.native.js +13 -56
  22. package/dist/cjs/Notice/index.native.js.map +1 -1
  23. package/dist/cjs/Table/index.cjs +13 -0
  24. package/dist/cjs/Table/index.native.js +15 -0
  25. package/dist/cjs/Table/index.native.js.map +1 -1
  26. package/dist/cjs/Tabs/index.cjs +15 -47
  27. package/dist/cjs/Tabs/index.native.js +20 -52
  28. package/dist/cjs/Tabs/index.native.js.map +1 -1
  29. package/dist/cjs/Ul/index.cjs +2 -2
  30. package/dist/cjs/Ul/index.native.js +2 -2
  31. package/dist/cjs/Ul/index.native.js.map +1 -1
  32. package/dist/cjs/Video/index.cjs +4 -2
  33. package/dist/cjs/Video/index.native.js +4 -2
  34. package/dist/cjs/Video/index.native.js.map +1 -1
  35. package/dist/cjs/components/Blockquote.cjs +16 -3
  36. package/dist/cjs/components/Blockquote.native.js +25 -3
  37. package/dist/cjs/components/Blockquote.native.js.map +1 -1
  38. package/dist/cjs/components/Break.cjs +1 -0
  39. package/dist/cjs/components/Break.native.js +1 -0
  40. package/dist/cjs/components/Break.native.js.map +1 -1
  41. package/dist/cjs/components/CodeBlock.cjs +20 -60
  42. package/dist/cjs/components/CodeBlock.native.js +22 -64
  43. package/dist/cjs/components/CodeBlock.native.js.map +1 -1
  44. package/dist/cjs/components/Heading.cjs +23 -0
  45. package/dist/cjs/components/Heading.native.js +24 -0
  46. package/dist/cjs/components/Heading.native.js.map +1 -1
  47. package/dist/cjs/components/Image.cjs +3 -5
  48. package/dist/cjs/components/Image.native.js +6 -5
  49. package/dist/cjs/components/Image.native.js.map +1 -1
  50. package/dist/cjs/components/InlineCode.cjs +3 -6
  51. package/dist/cjs/components/InlineCode.native.js +3 -6
  52. package/dist/cjs/components/InlineCode.native.js.map +1 -1
  53. package/dist/cjs/components/InlineStyles.cjs +3 -0
  54. package/dist/cjs/components/InlineStyles.native.js +3 -0
  55. package/dist/cjs/components/InlineStyles.native.js.map +1 -1
  56. package/dist/cjs/components/Link.cjs +22 -5
  57. package/dist/cjs/components/Link.native.js +23 -5
  58. package/dist/cjs/components/Link.native.js.map +1 -1
  59. package/dist/cjs/components/List.cjs +87 -9
  60. package/dist/cjs/components/List.native.js +91 -9
  61. package/dist/cjs/components/List.native.js.map +1 -1
  62. package/dist/cjs/components/Paragraph.cjs +6 -1
  63. package/dist/cjs/components/Paragraph.native.js +6 -1
  64. package/dist/cjs/components/Paragraph.native.js.map +1 -1
  65. package/dist/cjs/components/Table.cjs +57 -24
  66. package/dist/cjs/components/Table.native.js +67 -25
  67. package/dist/cjs/components/Table.native.js.map +1 -1
  68. package/dist/cjs/hooks/useCompileMdx.cjs +61 -28
  69. package/dist/cjs/hooks/useCompileMdx.native.js +80 -28
  70. package/dist/cjs/hooks/useCompileMdx.native.js.map +1 -1
  71. package/dist/cjs/hooks/useEvaluateMdx.cjs +7 -1
  72. package/dist/cjs/hooks/useEvaluateMdx.native.js +9 -3
  73. package/dist/cjs/hooks/useEvaluateMdx.native.js.map +1 -1
  74. package/dist/cjs/icons/index.cjs +31 -101
  75. package/dist/cjs/icons/index.native.js +36 -116
  76. package/dist/cjs/icons/index.native.js.map +1 -1
  77. package/dist/cjs/index.cjs +6 -4
  78. package/dist/cjs/index.native.js +6 -4
  79. package/dist/cjs/index.native.js.map +1 -1
  80. package/dist/cjs/mdxComponents.cjs +13 -6
  81. package/dist/cjs/mdxComponents.native.js +16 -6
  82. package/dist/cjs/mdxComponents.native.js.map +1 -1
  83. package/dist/cjs/mermaid/MermaidBlock.cjs +110 -0
  84. package/dist/cjs/mermaid/MermaidBlock.native.js +41 -0
  85. package/dist/cjs/mermaid/MermaidBlock.native.js.map +1 -0
  86. package/dist/cjs/mermaid/index.cjs +31 -0
  87. package/dist/cjs/mermaid/index.native.js +34 -0
  88. package/dist/cjs/mermaid/index.native.js.map +1 -0
  89. package/dist/cjs/mermaid/mountDiagramSvg.cjs +54 -0
  90. package/dist/cjs/mermaid/mountDiagramSvg.native.js +98 -0
  91. package/dist/cjs/mermaid/mountDiagramSvg.native.js.map +1 -0
  92. package/dist/cjs/mermaid/renderMermaidDiagram.cjs +92 -0
  93. package/dist/cjs/mermaid/renderMermaidDiagram.native.js +110 -0
  94. package/dist/cjs/mermaid/renderMermaidDiagram.native.js.map +1 -0
  95. package/dist/cjs/renderer.cjs +9 -1
  96. package/dist/cjs/renderer.native.js +10 -2
  97. package/dist/cjs/renderer.native.js.map +1 -1
  98. package/dist/cjs/shared/colorRamps.cjs +1 -11
  99. package/dist/cjs/shared/colorRamps.native.js +1 -11
  100. package/dist/cjs/shared/colorRamps.native.js.map +1 -1
  101. package/dist/cjs/shared/cutoffGradient.cjs +54 -0
  102. package/dist/cjs/shared/cutoffGradient.native.js +63 -0
  103. package/dist/cjs/shared/cutoffGradient.native.js.map +1 -0
  104. package/dist/cjs/shiki/index.cjs +1 -16
  105. package/dist/cjs/shiki/index.native.js +0 -15
  106. package/dist/cjs/shiki/index.native.js.map +1 -1
  107. package/dist/esm/Aside/index.mjs +39 -34
  108. package/dist/esm/Aside/index.mjs.map +1 -1
  109. package/dist/esm/Aside/index.native.js +43 -36
  110. package/dist/esm/Aside/index.native.js.map +1 -1
  111. package/dist/esm/ExternalIcon/index.mjs +2 -0
  112. package/dist/esm/ExternalIcon/index.mjs.map +1 -1
  113. package/dist/esm/ExternalIcon/index.native.js +2 -0
  114. package/dist/esm/ExternalIcon/index.native.js.map +1 -1
  115. package/dist/esm/Hr/index.mjs +4 -12
  116. package/dist/esm/Hr/index.mjs.map +1 -1
  117. package/dist/esm/Hr/index.native.js +4 -12
  118. package/dist/esm/Hr/index.native.js.map +1 -1
  119. package/dist/esm/{SimpleTable → MarkdownSimpleTable}/index.mjs +24 -6
  120. package/dist/esm/MarkdownSimpleTable/index.mjs.map +1 -0
  121. package/dist/esm/{SimpleTable → MarkdownSimpleTable}/index.native.js +29 -8
  122. package/dist/esm/MarkdownSimpleTable/index.native.js.map +1 -0
  123. package/dist/esm/Mdx/index.mjs +15 -7
  124. package/dist/esm/Mdx/index.mjs.map +1 -1
  125. package/dist/esm/Mdx/index.native.js +15 -7
  126. package/dist/esm/Mdx/index.native.js.map +1 -1
  127. package/dist/esm/MdxCodeBlock/index.mjs +30 -22
  128. package/dist/esm/MdxCodeBlock/index.mjs.map +1 -1
  129. package/dist/esm/MdxCodeBlock/index.native.js +35 -24
  130. package/dist/esm/MdxCodeBlock/index.native.js.map +1 -1
  131. package/dist/esm/Notice/index.mjs +15 -57
  132. package/dist/esm/Notice/index.mjs.map +1 -1
  133. package/dist/esm/Notice/index.native.js +15 -57
  134. package/dist/esm/Notice/index.native.js.map +1 -1
  135. package/dist/esm/Table/index.mjs +13 -0
  136. package/dist/esm/Table/index.mjs.map +1 -1
  137. package/dist/esm/Table/index.native.js +15 -0
  138. package/dist/esm/Table/index.native.js.map +1 -1
  139. package/dist/esm/Tabs/index.mjs +17 -49
  140. package/dist/esm/Tabs/index.mjs.map +1 -1
  141. package/dist/esm/Tabs/index.native.js +22 -54
  142. package/dist/esm/Tabs/index.native.js.map +1 -1
  143. package/dist/esm/Ul/index.mjs +2 -2
  144. package/dist/esm/Ul/index.mjs.map +1 -1
  145. package/dist/esm/Ul/index.native.js +2 -2
  146. package/dist/esm/Ul/index.native.js.map +1 -1
  147. package/dist/esm/Video/index.mjs +4 -2
  148. package/dist/esm/Video/index.mjs.map +1 -1
  149. package/dist/esm/Video/index.native.js +4 -2
  150. package/dist/esm/Video/index.native.js.map +1 -1
  151. package/dist/esm/components/Blockquote.mjs +17 -4
  152. package/dist/esm/components/Blockquote.mjs.map +1 -1
  153. package/dist/esm/components/Blockquote.native.js +26 -4
  154. package/dist/esm/components/Blockquote.native.js.map +1 -1
  155. package/dist/esm/components/Break.mjs +2 -1
  156. package/dist/esm/components/Break.mjs.map +1 -1
  157. package/dist/esm/components/Break.native.js +2 -1
  158. package/dist/esm/components/Break.native.js.map +1 -1
  159. package/dist/esm/components/CodeBlock.mjs +21 -61
  160. package/dist/esm/components/CodeBlock.mjs.map +1 -1
  161. package/dist/esm/components/CodeBlock.native.js +23 -65
  162. package/dist/esm/components/CodeBlock.native.js.map +1 -1
  163. package/dist/esm/components/Heading.mjs +24 -1
  164. package/dist/esm/components/Heading.mjs.map +1 -1
  165. package/dist/esm/components/Heading.native.js +25 -1
  166. package/dist/esm/components/Heading.native.js.map +1 -1
  167. package/dist/esm/components/Image.mjs +3 -5
  168. package/dist/esm/components/Image.mjs.map +1 -1
  169. package/dist/esm/components/Image.native.js +6 -5
  170. package/dist/esm/components/Image.native.js.map +1 -1
  171. package/dist/esm/components/InlineCode.mjs +3 -6
  172. package/dist/esm/components/InlineCode.mjs.map +1 -1
  173. package/dist/esm/components/InlineCode.native.js +3 -6
  174. package/dist/esm/components/InlineCode.native.js.map +1 -1
  175. package/dist/esm/components/InlineStyles.mjs +3 -0
  176. package/dist/esm/components/InlineStyles.mjs.map +1 -1
  177. package/dist/esm/components/InlineStyles.native.js +3 -0
  178. package/dist/esm/components/InlineStyles.native.js.map +1 -1
  179. package/dist/esm/components/Link.mjs +23 -6
  180. package/dist/esm/components/Link.mjs.map +1 -1
  181. package/dist/esm/components/Link.native.js +24 -6
  182. package/dist/esm/components/Link.native.js.map +1 -1
  183. package/dist/esm/components/List.mjs +88 -10
  184. package/dist/esm/components/List.mjs.map +1 -1
  185. package/dist/esm/components/List.native.js +92 -10
  186. package/dist/esm/components/List.native.js.map +1 -1
  187. package/dist/esm/components/Paragraph.mjs +6 -1
  188. package/dist/esm/components/Paragraph.mjs.map +1 -1
  189. package/dist/esm/components/Paragraph.native.js +6 -1
  190. package/dist/esm/components/Paragraph.native.js.map +1 -1
  191. package/dist/esm/components/Table.mjs +59 -26
  192. package/dist/esm/components/Table.mjs.map +1 -1
  193. package/dist/esm/components/Table.native.js +69 -27
  194. package/dist/esm/components/Table.native.js.map +1 -1
  195. package/dist/esm/hooks/useCompileMdx.mjs +61 -29
  196. package/dist/esm/hooks/useCompileMdx.mjs.map +1 -1
  197. package/dist/esm/hooks/useCompileMdx.native.js +80 -29
  198. package/dist/esm/hooks/useCompileMdx.native.js.map +1 -1
  199. package/dist/esm/hooks/useEvaluateMdx.mjs +7 -1
  200. package/dist/esm/hooks/useEvaluateMdx.mjs.map +1 -1
  201. package/dist/esm/hooks/useEvaluateMdx.native.js +9 -3
  202. package/dist/esm/hooks/useEvaluateMdx.native.js.map +1 -1
  203. package/dist/esm/icons/index.mjs +32 -100
  204. package/dist/esm/icons/index.mjs.map +1 -1
  205. package/dist/esm/icons/index.native.js +37 -115
  206. package/dist/esm/icons/index.native.js.map +1 -1
  207. package/dist/esm/index.mjs +5 -3
  208. package/dist/esm/index.mjs.map +1 -1
  209. package/dist/esm/index.native.js +5 -3
  210. package/dist/esm/index.native.js.map +1 -1
  211. package/dist/esm/mdxComponents.mjs +14 -7
  212. package/dist/esm/mdxComponents.mjs.map +1 -1
  213. package/dist/esm/mdxComponents.native.js +17 -7
  214. package/dist/esm/mdxComponents.native.js.map +1 -1
  215. package/dist/esm/mermaid/MermaidBlock.mjs +85 -0
  216. package/dist/esm/mermaid/MermaidBlock.mjs.map +1 -0
  217. package/dist/esm/mermaid/MermaidBlock.native.js +13 -0
  218. package/dist/esm/mermaid/MermaidBlock.native.js.map +1 -0
  219. package/dist/esm/mermaid/index.mjs +4 -0
  220. package/dist/esm/mermaid/index.mjs.map +1 -0
  221. package/dist/esm/mermaid/index.native.js +4 -0
  222. package/dist/esm/mermaid/index.native.js.map +1 -0
  223. package/dist/esm/mermaid/mountDiagramSvg.mjs +29 -0
  224. package/dist/esm/mermaid/mountDiagramSvg.mjs.map +1 -0
  225. package/dist/esm/mermaid/mountDiagramSvg.native.js +70 -0
  226. package/dist/esm/mermaid/mountDiagramSvg.native.js.map +1 -0
  227. package/dist/esm/mermaid/renderMermaidDiagram.mjs +55 -0
  228. package/dist/esm/mermaid/renderMermaidDiagram.mjs.map +1 -0
  229. package/dist/esm/mermaid/renderMermaidDiagram.native.js +70 -0
  230. package/dist/esm/mermaid/renderMermaidDiagram.native.js.map +1 -0
  231. package/dist/esm/renderer.mjs +9 -1
  232. package/dist/esm/renderer.mjs.map +1 -1
  233. package/dist/esm/renderer.native.js +10 -2
  234. package/dist/esm/renderer.native.js.map +1 -1
  235. package/dist/esm/shared/colorRamps.mjs +1 -10
  236. package/dist/esm/shared/colorRamps.mjs.map +1 -1
  237. package/dist/esm/shared/colorRamps.native.js +1 -10
  238. package/dist/esm/shared/colorRamps.native.js.map +1 -1
  239. package/dist/esm/shared/cutoffGradient.mjs +28 -0
  240. package/dist/esm/shared/cutoffGradient.mjs.map +1 -0
  241. package/dist/esm/shared/cutoffGradient.native.js +34 -0
  242. package/dist/esm/shared/cutoffGradient.native.js.map +1 -0
  243. package/dist/esm/shiki/index.mjs +1 -2
  244. package/dist/esm/shiki/index.mjs.map +1 -1
  245. package/dist/esm/shiki/index.native.js +1 -2
  246. package/dist/esm/shiki/index.native.js.map +1 -1
  247. package/dist/jsx/Aside/index.mjs +39 -34
  248. package/dist/jsx/Aside/index.mjs.map +1 -1
  249. package/dist/jsx/Aside/index.native.js +41 -34
  250. package/dist/jsx/Aside/index.native.js.map +1 -1
  251. package/dist/jsx/ExternalIcon/index.mjs +2 -0
  252. package/dist/jsx/ExternalIcon/index.mjs.map +1 -1
  253. package/dist/jsx/ExternalIcon/index.native.js +2 -0
  254. package/dist/jsx/ExternalIcon/index.native.js.map +1 -1
  255. package/dist/jsx/Hr/index.mjs +4 -12
  256. package/dist/jsx/Hr/index.mjs.map +1 -1
  257. package/dist/jsx/Hr/index.native.js +3 -11
  258. package/dist/jsx/Hr/index.native.js.map +1 -1
  259. package/dist/jsx/{SimpleTable → MarkdownSimpleTable}/index.mjs +24 -6
  260. package/dist/jsx/MarkdownSimpleTable/index.mjs.map +1 -0
  261. package/dist/{cjs/SimpleTable → jsx/MarkdownSimpleTable}/index.native.js +32 -11
  262. package/dist/jsx/MarkdownSimpleTable/index.native.js.map +1 -0
  263. package/dist/jsx/Mdx/index.mjs +15 -7
  264. package/dist/jsx/Mdx/index.mjs.map +1 -1
  265. package/dist/jsx/Mdx/index.native.js +15 -7
  266. package/dist/jsx/Mdx/index.native.js.map +1 -1
  267. package/dist/jsx/MdxCodeBlock/index.mjs +30 -22
  268. package/dist/jsx/MdxCodeBlock/index.mjs.map +1 -1
  269. package/dist/jsx/MdxCodeBlock/index.native.js +33 -22
  270. package/dist/jsx/MdxCodeBlock/index.native.js.map +1 -1
  271. package/dist/jsx/Notice/index.mjs +15 -57
  272. package/dist/jsx/Notice/index.mjs.map +1 -1
  273. package/dist/jsx/Notice/index.native.js +13 -56
  274. package/dist/jsx/Notice/index.native.js.map +1 -1
  275. package/dist/jsx/Table/index.mjs +13 -0
  276. package/dist/jsx/Table/index.mjs.map +1 -1
  277. package/dist/jsx/Table/index.native.js +15 -0
  278. package/dist/jsx/Table/index.native.js.map +1 -1
  279. package/dist/jsx/Tabs/index.mjs +17 -49
  280. package/dist/jsx/Tabs/index.mjs.map +1 -1
  281. package/dist/jsx/Tabs/index.native.js +20 -52
  282. package/dist/jsx/Tabs/index.native.js.map +1 -1
  283. package/dist/jsx/Ul/index.mjs +2 -2
  284. package/dist/jsx/Ul/index.mjs.map +1 -1
  285. package/dist/jsx/Ul/index.native.js +2 -2
  286. package/dist/jsx/Ul/index.native.js.map +1 -1
  287. package/dist/jsx/Video/index.mjs +4 -2
  288. package/dist/jsx/Video/index.mjs.map +1 -1
  289. package/dist/jsx/Video/index.native.js +4 -2
  290. package/dist/jsx/Video/index.native.js.map +1 -1
  291. package/dist/jsx/components/Blockquote.mjs +17 -4
  292. package/dist/jsx/components/Blockquote.mjs.map +1 -1
  293. package/dist/jsx/components/Blockquote.native.js +25 -3
  294. package/dist/jsx/components/Blockquote.native.js.map +1 -1
  295. package/dist/jsx/components/Break.mjs +2 -1
  296. package/dist/jsx/components/Break.mjs.map +1 -1
  297. package/dist/jsx/components/Break.native.js +1 -0
  298. package/dist/jsx/components/Break.native.js.map +1 -1
  299. package/dist/jsx/components/CodeBlock.mjs +21 -61
  300. package/dist/jsx/components/CodeBlock.mjs.map +1 -1
  301. package/dist/jsx/components/CodeBlock.native.js +22 -64
  302. package/dist/jsx/components/CodeBlock.native.js.map +1 -1
  303. package/dist/jsx/components/Heading.mjs +24 -1
  304. package/dist/jsx/components/Heading.mjs.map +1 -1
  305. package/dist/jsx/components/Heading.native.js +24 -0
  306. package/dist/jsx/components/Heading.native.js.map +1 -1
  307. package/dist/jsx/components/Image.mjs +3 -5
  308. package/dist/jsx/components/Image.mjs.map +1 -1
  309. package/dist/jsx/components/Image.native.js +6 -5
  310. package/dist/jsx/components/Image.native.js.map +1 -1
  311. package/dist/jsx/components/InlineCode.mjs +3 -6
  312. package/dist/jsx/components/InlineCode.mjs.map +1 -1
  313. package/dist/jsx/components/InlineCode.native.js +3 -6
  314. package/dist/jsx/components/InlineCode.native.js.map +1 -1
  315. package/dist/jsx/components/InlineStyles.mjs +3 -0
  316. package/dist/jsx/components/InlineStyles.mjs.map +1 -1
  317. package/dist/jsx/components/InlineStyles.native.js +3 -0
  318. package/dist/jsx/components/InlineStyles.native.js.map +1 -1
  319. package/dist/jsx/components/Link.mjs +23 -6
  320. package/dist/jsx/components/Link.mjs.map +1 -1
  321. package/dist/jsx/components/Link.native.js +23 -5
  322. package/dist/jsx/components/Link.native.js.map +1 -1
  323. package/dist/jsx/components/List.mjs +88 -10
  324. package/dist/jsx/components/List.mjs.map +1 -1
  325. package/dist/jsx/components/List.native.js +91 -9
  326. package/dist/jsx/components/List.native.js.map +1 -1
  327. package/dist/jsx/components/Paragraph.mjs +6 -1
  328. package/dist/jsx/components/Paragraph.mjs.map +1 -1
  329. package/dist/jsx/components/Paragraph.native.js +6 -1
  330. package/dist/jsx/components/Paragraph.native.js.map +1 -1
  331. package/dist/jsx/components/Table.mjs +59 -26
  332. package/dist/jsx/components/Table.mjs.map +1 -1
  333. package/dist/jsx/components/Table.native.js +67 -25
  334. package/dist/jsx/components/Table.native.js.map +1 -1
  335. package/dist/jsx/hooks/useCompileMdx.mjs +61 -29
  336. package/dist/jsx/hooks/useCompileMdx.mjs.map +1 -1
  337. package/dist/jsx/hooks/useCompileMdx.native.js +80 -28
  338. package/dist/jsx/hooks/useCompileMdx.native.js.map +1 -1
  339. package/dist/jsx/hooks/useEvaluateMdx.mjs +7 -1
  340. package/dist/jsx/hooks/useEvaluateMdx.mjs.map +1 -1
  341. package/dist/jsx/hooks/useEvaluateMdx.native.js +9 -3
  342. package/dist/jsx/hooks/useEvaluateMdx.native.js.map +1 -1
  343. package/dist/jsx/icons/index.mjs +32 -100
  344. package/dist/jsx/icons/index.mjs.map +1 -1
  345. package/dist/jsx/icons/index.native.js +36 -116
  346. package/dist/jsx/icons/index.native.js.map +1 -1
  347. package/dist/jsx/index.js +5 -3
  348. package/dist/jsx/index.js.map +1 -1
  349. package/dist/jsx/index.mjs +5 -3
  350. package/dist/jsx/index.mjs.map +1 -1
  351. package/dist/jsx/index.native.js +6 -4
  352. package/dist/jsx/index.native.js.map +1 -1
  353. package/dist/jsx/mdxComponents.mjs +14 -7
  354. package/dist/jsx/mdxComponents.mjs.map +1 -1
  355. package/dist/jsx/mdxComponents.native.js +16 -6
  356. package/dist/jsx/mdxComponents.native.js.map +1 -1
  357. package/dist/jsx/mermaid/MermaidBlock.mjs +85 -0
  358. package/dist/jsx/mermaid/MermaidBlock.mjs.map +1 -0
  359. package/dist/jsx/mermaid/MermaidBlock.native.js +41 -0
  360. package/dist/jsx/mermaid/MermaidBlock.native.js.map +1 -0
  361. package/dist/jsx/mermaid/index.mjs +4 -0
  362. package/dist/jsx/mermaid/index.mjs.map +1 -0
  363. package/dist/jsx/mermaid/index.native.js +34 -0
  364. package/dist/jsx/mermaid/index.native.js.map +1 -0
  365. package/dist/jsx/mermaid/mountDiagramSvg.mjs +29 -0
  366. package/dist/jsx/mermaid/mountDiagramSvg.mjs.map +1 -0
  367. package/dist/jsx/mermaid/mountDiagramSvg.native.js +98 -0
  368. package/dist/jsx/mermaid/mountDiagramSvg.native.js.map +1 -0
  369. package/dist/jsx/mermaid/renderMermaidDiagram.mjs +55 -0
  370. package/dist/jsx/mermaid/renderMermaidDiagram.mjs.map +1 -0
  371. package/dist/jsx/mermaid/renderMermaidDiagram.native.js +110 -0
  372. package/dist/jsx/mermaid/renderMermaidDiagram.native.js.map +1 -0
  373. package/dist/jsx/renderer.mjs +9 -1
  374. package/dist/jsx/renderer.mjs.map +1 -1
  375. package/dist/jsx/renderer.native.js +10 -2
  376. package/dist/jsx/renderer.native.js.map +1 -1
  377. package/dist/jsx/shared/colorRamps.mjs +1 -10
  378. package/dist/jsx/shared/colorRamps.mjs.map +1 -1
  379. package/dist/jsx/shared/colorRamps.native.js +1 -11
  380. package/dist/jsx/shared/colorRamps.native.js.map +1 -1
  381. package/dist/jsx/shared/cutoffGradient.mjs +28 -0
  382. package/dist/jsx/shared/cutoffGradient.mjs.map +1 -0
  383. package/dist/jsx/shared/cutoffGradient.native.js +63 -0
  384. package/dist/jsx/shared/cutoffGradient.native.js.map +1 -0
  385. package/dist/jsx/shiki/index.mjs +1 -2
  386. package/dist/jsx/shiki/index.mjs.map +1 -1
  387. package/dist/jsx/shiki/index.native.js +0 -15
  388. package/dist/jsx/shiki/index.native.js.map +1 -1
  389. package/package.json +25 -14
  390. package/src/Aside/index.tsx +42 -35
  391. package/src/ExternalIcon/index.tsx +8 -1
  392. package/src/Hr/index.tsx +3 -6
  393. package/src/{SimpleTable → MarkdownSimpleTable}/index.tsx +30 -12
  394. package/src/MarkdownSimpleTable/markdownSimpleTable.spec.tsx +92 -0
  395. package/src/Mdx/index.tsx +12 -7
  396. package/src/MdxCodeBlock/index.tsx +33 -20
  397. package/src/Notice/index.tsx +12 -54
  398. package/src/Table/index.tsx +22 -6
  399. package/src/Tabs/index.tsx +26 -52
  400. package/src/Ul/index.ts +2 -2
  401. package/src/Video/index.tsx +15 -12
  402. package/src/components/Blockquote.tsx +29 -4
  403. package/src/components/Break.tsx +3 -1
  404. package/src/components/CodeBlock.tsx +49 -79
  405. package/src/components/Heading.tsx +15 -2
  406. package/src/components/Image.tsx +6 -3
  407. package/src/components/InlineCode.tsx +14 -7
  408. package/src/components/InlineStyles.tsx +15 -3
  409. package/src/components/Link.tsx +29 -6
  410. package/src/components/List.tsx +111 -11
  411. package/src/components/Paragraph.tsx +6 -1
  412. package/src/components/Table.tsx +56 -35
  413. package/src/components/markdownPrimitives.spec.tsx +121 -0
  414. package/src/docBlocks.spec.tsx +85 -0
  415. package/src/hooks/useCompileMdx.ts +75 -35
  416. package/src/hooks/useEvaluateMdx.ts +7 -1
  417. package/src/icons/index.tsx +36 -58
  418. package/src/index.ts +15 -3
  419. package/src/markdownComponent.spec.tsx +58 -0
  420. package/src/mdx.spec.tsx +4 -0
  421. package/src/mdxComponents.spec.tsx +185 -0
  422. package/src/mdxComponents.tsx +14 -5
  423. package/src/mermaid/MermaidBlock.native.tsx +15 -0
  424. package/src/mermaid/MermaidBlock.tsx +88 -0
  425. package/src/mermaid/index.ts +23 -0
  426. package/src/mermaid/mountDiagramSvg.ts +49 -0
  427. package/src/mermaid/renderMermaidDiagram.spec.ts +89 -0
  428. package/src/mermaid/renderMermaidDiagram.ts +78 -0
  429. package/src/renderer.spec.tsx +276 -0
  430. package/src/renderer.tsx +13 -1
  431. package/src/shared/colorRamps.ts +0 -10
  432. package/src/shared/cutoffGradient.ts +40 -0
  433. package/src/shiki/index.ts +7 -11
  434. package/src/stories/Blocks.stories.tsx +232 -0
  435. package/src/stories/Callouts.stories.tsx +147 -0
  436. package/src/stories/Code.stories.tsx +116 -0
  437. package/src/stories/Inline.stories.tsx +162 -0
  438. package/src/stories/Mdx.stories.tsx +107 -0
  439. package/src/stories/Media.stories.tsx +148 -0
  440. package/src/stories/Tables.stories.tsx +173 -0
  441. package/types/Aside/index.d.ts +11 -0
  442. package/types/Aside/index.d.ts.map +1 -0
  443. package/types/ExternalIcon/index.d.ts +2 -0
  444. package/types/ExternalIcon/index.d.ts.map +1 -0
  445. package/types/Hr/index.d.ts +2 -0
  446. package/types/Hr/index.d.ts.map +1 -0
  447. package/types/Li/index.d.ts +6 -0
  448. package/types/Li/index.d.ts.map +1 -0
  449. package/types/Markdown.d.ts +22 -0
  450. package/types/Markdown.d.ts.map +1 -0
  451. package/types/MarkdownSimpleTable/index.d.ts +16 -0
  452. package/types/MarkdownSimpleTable/index.d.ts.map +1 -0
  453. package/types/Mdx/index.d.ts +9 -0
  454. package/types/Mdx/index.d.ts.map +1 -0
  455. package/types/MdxCodeBlock/index.d.ts +7 -0
  456. package/types/MdxCodeBlock/index.d.ts.map +1 -0
  457. package/types/MdxCodeBlock/mdxCodeBlockContext.d.ts +13 -0
  458. package/types/MdxCodeBlock/mdxCodeBlockContext.d.ts.map +1 -0
  459. package/types/Notice/index.d.ts +12 -0
  460. package/types/Notice/index.d.ts.map +1 -0
  461. package/types/Table/index.d.ts +20 -0
  462. package/types/Table/index.d.ts.map +1 -0
  463. package/types/Tabs/index.d.ts +21 -0
  464. package/types/Tabs/index.d.ts.map +1 -0
  465. package/types/Ul/index.d.ts +6 -0
  466. package/types/Ul/index.d.ts.map +1 -0
  467. package/types/Video/index.d.ts +12 -0
  468. package/types/Video/index.d.ts.map +1 -0
  469. package/types/components/Blockquote.d.ts +3 -0
  470. package/types/components/Blockquote.d.ts.map +1 -0
  471. package/types/components/Break.d.ts +3 -0
  472. package/types/components/Break.d.ts.map +1 -0
  473. package/types/components/CodeBlock.d.ts +17 -0
  474. package/types/components/CodeBlock.d.ts.map +1 -0
  475. package/types/components/Heading.d.ts +3 -0
  476. package/types/components/Heading.d.ts.map +1 -0
  477. package/types/components/HorizontalRule.d.ts +3 -0
  478. package/types/components/HorizontalRule.d.ts.map +1 -0
  479. package/types/components/Image.d.ts +3 -0
  480. package/types/components/Image.d.ts.map +1 -0
  481. package/types/components/InlineCode.d.ts +12 -0
  482. package/types/components/InlineCode.d.ts.map +1 -0
  483. package/types/components/InlineStyles.d.ts +5 -0
  484. package/types/components/InlineStyles.d.ts.map +1 -0
  485. package/types/components/Link.d.ts +3 -0
  486. package/types/components/Link.d.ts.map +1 -0
  487. package/types/components/List.d.ts +10 -0
  488. package/types/components/List.d.ts.map +1 -0
  489. package/types/components/Paragraph.d.ts +3 -0
  490. package/types/components/Paragraph.d.ts.map +1 -0
  491. package/types/components/Table.d.ts +13 -0
  492. package/types/components/Table.d.ts.map +1 -0
  493. package/types/components/index.d.ts +13 -0
  494. package/types/components/index.d.ts.map +1 -0
  495. package/types/hooks/index.d.ts +4 -0
  496. package/types/hooks/index.d.ts.map +1 -0
  497. package/types/hooks/useCompileAndEvaluateMdx.d.ts +9 -0
  498. package/types/hooks/useCompileAndEvaluateMdx.d.ts.map +1 -0
  499. package/types/hooks/useCompileMdx.d.ts +13 -0
  500. package/types/hooks/useCompileMdx.d.ts.map +1 -0
  501. package/types/hooks/useEvaluateMdx.d.ts +5 -0
  502. package/types/hooks/useEvaluateMdx.d.ts.map +1 -0
  503. package/types/icons/index.d.ts +12 -0
  504. package/types/icons/index.d.ts.map +1 -0
  505. package/types/index.d.ts +29 -0
  506. package/types/index.d.ts.map +1 -0
  507. package/types/mdxComponents.d.ts +8 -0
  508. package/types/mdxComponents.d.ts.map +1 -0
  509. package/types/mermaid/MermaidBlock.d.ts +15 -0
  510. package/types/mermaid/MermaidBlock.d.ts.map +1 -0
  511. package/types/mermaid/MermaidBlock.native.d.ts +10 -0
  512. package/types/mermaid/MermaidBlock.native.d.ts.map +1 -0
  513. package/types/mermaid/index.d.ts +18 -0
  514. package/types/mermaid/index.d.ts.map +1 -0
  515. package/types/mermaid/mountDiagramSvg.d.ts +11 -0
  516. package/types/mermaid/mountDiagramSvg.d.ts.map +1 -0
  517. package/types/mermaid/renderMermaidDiagram.d.ts +33 -0
  518. package/types/mermaid/renderMermaidDiagram.d.ts.map +1 -0
  519. package/types/parser.d.ts +11 -0
  520. package/types/parser.d.ts.map +1 -0
  521. package/types/renderer.d.ts +32 -0
  522. package/types/renderer.d.ts.map +1 -0
  523. package/types/shared/colorRamps.d.ts +39 -0
  524. package/types/shared/colorRamps.d.ts.map +1 -0
  525. package/types/shared/cutoffGradient.d.ts +12 -0
  526. package/types/shared/cutoffGradient.d.ts.map +1 -0
  527. package/types/shared/index.d.ts +2 -0
  528. package/types/shared/index.d.ts.map +1 -0
  529. package/types/shiki/index.d.ts +8 -0
  530. package/types/shiki/index.d.ts.map +1 -0
  531. package/types/types.d.ts +160 -0
  532. package/types/types.d.ts.map +1 -0
  533. package/types/util/rehypeMetaAttributes.d.ts +2 -0
  534. package/types/util/rehypeMetaAttributes.d.ts.map +1 -0
  535. package/dist/cjs/ExternalIcon/ExternalIcon.spec.cjs +0 -37
  536. package/dist/cjs/ExternalIcon/ExternalIcon.spec.native.js +0 -40
  537. package/dist/cjs/ExternalIcon/ExternalIcon.spec.native.js.map +0 -1
  538. package/dist/cjs/Hr/hr.spec.cjs +0 -21
  539. package/dist/cjs/Hr/hr.spec.native.js +0 -24
  540. package/dist/cjs/Hr/hr.spec.native.js.map +0 -1
  541. package/dist/cjs/Li/li.spec.cjs +0 -45
  542. package/dist/cjs/Li/li.spec.native.js +0 -50
  543. package/dist/cjs/Li/li.spec.native.js.map +0 -1
  544. package/dist/cjs/Markdown.stories.cjs +0 -153
  545. package/dist/cjs/Markdown.stories.native.js +0 -162
  546. package/dist/cjs/Markdown.stories.native.js.map +0 -1
  547. package/dist/cjs/Mdx/mdx.spec.cjs +0 -139
  548. package/dist/cjs/Mdx/mdx.spec.native.js +0 -158
  549. package/dist/cjs/Mdx/mdx.spec.native.js.map +0 -1
  550. package/dist/cjs/MdxCodeBlock/mdxCodeBlock.spec.cjs +0 -90
  551. package/dist/cjs/MdxCodeBlock/mdxCodeBlock.spec.native.js +0 -122
  552. package/dist/cjs/MdxCodeBlock/mdxCodeBlock.spec.native.js.map +0 -1
  553. package/dist/cjs/SimpleTable/index.native.js.map +0 -1
  554. package/dist/cjs/Ul/ul.spec.cjs +0 -150
  555. package/dist/cjs/Ul/ul.spec.native.js +0 -153
  556. package/dist/cjs/Ul/ul.spec.native.js.map +0 -1
  557. package/dist/cjs/hooks/useCompileAndEvaluateMdx.spec.cjs +0 -34
  558. package/dist/cjs/hooks/useCompileAndEvaluateMdx.spec.native.js +0 -49
  559. package/dist/cjs/hooks/useCompileAndEvaluateMdx.spec.native.js.map +0 -1
  560. package/dist/cjs/mdx.spec.cjs +0 -400
  561. package/dist/cjs/mdx.spec.native.js +0 -465
  562. package/dist/cjs/mdx.spec.native.js.map +0 -1
  563. package/dist/cjs/parser.spec.cjs +0 -109
  564. package/dist/cjs/parser.spec.native.js +0 -114
  565. package/dist/cjs/parser.spec.native.js.map +0 -1
  566. package/dist/cjs/shiki/highlighter.cjs +0 -89
  567. package/dist/cjs/shiki/highlighter.native.js +0 -94
  568. package/dist/cjs/shiki/highlighter.native.js.map +0 -1
  569. package/dist/cjs/util/util.spec.cjs +0 -81
  570. package/dist/cjs/util/util.spec.native.js +0 -84
  571. package/dist/cjs/util/util.spec.native.js.map +0 -1
  572. package/dist/esm/ExternalIcon/ExternalIcon.spec.mjs +0 -38
  573. package/dist/esm/ExternalIcon/ExternalIcon.spec.mjs.map +0 -1
  574. package/dist/esm/ExternalIcon/ExternalIcon.spec.native.js +0 -38
  575. package/dist/esm/ExternalIcon/ExternalIcon.spec.native.js.map +0 -1
  576. package/dist/esm/Hr/hr.spec.mjs +0 -22
  577. package/dist/esm/Hr/hr.spec.mjs.map +0 -1
  578. package/dist/esm/Hr/hr.spec.native.js +0 -22
  579. package/dist/esm/Hr/hr.spec.native.js.map +0 -1
  580. package/dist/esm/Li/li.spec.mjs +0 -46
  581. package/dist/esm/Li/li.spec.mjs.map +0 -1
  582. package/dist/esm/Li/li.spec.native.js +0 -48
  583. package/dist/esm/Li/li.spec.native.js.map +0 -1
  584. package/dist/esm/Markdown.stories.mjs +0 -125
  585. package/dist/esm/Markdown.stories.mjs.map +0 -1
  586. package/dist/esm/Markdown.stories.native.js +0 -131
  587. package/dist/esm/Markdown.stories.native.js.map +0 -1
  588. package/dist/esm/Mdx/mdx.spec.mjs +0 -140
  589. package/dist/esm/Mdx/mdx.spec.mjs.map +0 -1
  590. package/dist/esm/Mdx/mdx.spec.native.js +0 -156
  591. package/dist/esm/Mdx/mdx.spec.native.js.map +0 -1
  592. package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.mjs +0 -91
  593. package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.mjs.map +0 -1
  594. package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.native.js +0 -96
  595. package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.native.js.map +0 -1
  596. package/dist/esm/SimpleTable/index.mjs.map +0 -1
  597. package/dist/esm/SimpleTable/index.native.js.map +0 -1
  598. package/dist/esm/Ul/ul.spec.mjs +0 -151
  599. package/dist/esm/Ul/ul.spec.mjs.map +0 -1
  600. package/dist/esm/Ul/ul.spec.native.js +0 -151
  601. package/dist/esm/Ul/ul.spec.native.js.map +0 -1
  602. package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.mjs +0 -35
  603. package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.mjs.map +0 -1
  604. package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.native.js +0 -47
  605. package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.native.js.map +0 -1
  606. package/dist/esm/mdx.spec.mjs +0 -377
  607. package/dist/esm/mdx.spec.mjs.map +0 -1
  608. package/dist/esm/mdx.spec.native.js +0 -439
  609. package/dist/esm/mdx.spec.native.js.map +0 -1
  610. package/dist/esm/parser.spec.mjs +0 -110
  611. package/dist/esm/parser.spec.mjs.map +0 -1
  612. package/dist/esm/parser.spec.native.js +0 -112
  613. package/dist/esm/parser.spec.native.js.map +0 -1
  614. package/dist/esm/shiki/highlighter.mjs +0 -59
  615. package/dist/esm/shiki/highlighter.mjs.map +0 -1
  616. package/dist/esm/shiki/highlighter.native.js +0 -61
  617. package/dist/esm/shiki/highlighter.native.js.map +0 -1
  618. package/dist/esm/util/util.spec.mjs +0 -82
  619. package/dist/esm/util/util.spec.mjs.map +0 -1
  620. package/dist/esm/util/util.spec.native.js +0 -82
  621. package/dist/esm/util/util.spec.native.js.map +0 -1
  622. package/dist/jsx/ExternalIcon/ExternalIcon.spec.mjs +0 -38
  623. package/dist/jsx/ExternalIcon/ExternalIcon.spec.mjs.map +0 -1
  624. package/dist/jsx/ExternalIcon/ExternalIcon.spec.native.js +0 -40
  625. package/dist/jsx/ExternalIcon/ExternalIcon.spec.native.js.map +0 -1
  626. package/dist/jsx/Hr/hr.spec.mjs +0 -22
  627. package/dist/jsx/Hr/hr.spec.mjs.map +0 -1
  628. package/dist/jsx/Hr/hr.spec.native.js +0 -24
  629. package/dist/jsx/Hr/hr.spec.native.js.map +0 -1
  630. package/dist/jsx/Li/li.spec.mjs +0 -46
  631. package/dist/jsx/Li/li.spec.mjs.map +0 -1
  632. package/dist/jsx/Li/li.spec.native.js +0 -50
  633. package/dist/jsx/Li/li.spec.native.js.map +0 -1
  634. package/dist/jsx/Markdown.stories.mjs +0 -125
  635. package/dist/jsx/Markdown.stories.mjs.map +0 -1
  636. package/dist/jsx/Markdown.stories.native.js +0 -162
  637. package/dist/jsx/Markdown.stories.native.js.map +0 -1
  638. package/dist/jsx/Mdx/mdx.spec.mjs +0 -140
  639. package/dist/jsx/Mdx/mdx.spec.mjs.map +0 -1
  640. package/dist/jsx/Mdx/mdx.spec.native.js +0 -158
  641. package/dist/jsx/Mdx/mdx.spec.native.js.map +0 -1
  642. package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.mjs +0 -91
  643. package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.mjs.map +0 -1
  644. package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.native.js +0 -122
  645. package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.native.js.map +0 -1
  646. package/dist/jsx/SimpleTable/index.mjs.map +0 -1
  647. package/dist/jsx/SimpleTable/index.native.js.map +0 -1
  648. package/dist/jsx/Ul/ul.spec.mjs +0 -151
  649. package/dist/jsx/Ul/ul.spec.mjs.map +0 -1
  650. package/dist/jsx/Ul/ul.spec.native.js +0 -153
  651. package/dist/jsx/Ul/ul.spec.native.js.map +0 -1
  652. package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.mjs +0 -35
  653. package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.mjs.map +0 -1
  654. package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.native.js +0 -49
  655. package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.native.js.map +0 -1
  656. package/dist/jsx/mdx.spec.mjs +0 -377
  657. package/dist/jsx/mdx.spec.mjs.map +0 -1
  658. package/dist/jsx/mdx.spec.native.js +0 -465
  659. package/dist/jsx/mdx.spec.native.js.map +0 -1
  660. package/dist/jsx/parser.spec.mjs +0 -110
  661. package/dist/jsx/parser.spec.mjs.map +0 -1
  662. package/dist/jsx/parser.spec.native.js +0 -114
  663. package/dist/jsx/parser.spec.native.js.map +0 -1
  664. package/dist/jsx/shiki/highlighter.mjs +0 -59
  665. package/dist/jsx/shiki/highlighter.mjs.map +0 -1
  666. package/dist/jsx/shiki/highlighter.native.js +0 -94
  667. package/dist/jsx/shiki/highlighter.native.js.map +0 -1
  668. package/dist/jsx/util/util.spec.mjs +0 -82
  669. package/dist/jsx/util/util.spec.mjs.map +0 -1
  670. package/dist/jsx/util/util.spec.native.js +0 -84
  671. package/dist/jsx/util/util.spec.native.js.map +0 -1
  672. package/src/shiki/highlighter.ts +0 -148
@@ -1,6 +1,8 @@
1
- import { Text } from "tamagui";
1
+ import { Text, isWeb } from "tamagui";
2
2
  import type { BreakProps } from "../types";
3
3
 
4
4
  export function Break(_props: BreakProps) {
5
+ // a literal "\n" collapses under white-space: normal on web (SB-M-1210)
6
+ if (isWeb) return <br />;
5
7
  return <Text>{"\n"}</Text>;
6
8
  }
@@ -1,93 +1,63 @@
1
+ /**
2
+ * Plain-markdown code block.
3
+ *
4
+ * LC-16 wrapper: tokenizing and token rendering come from the canonical
5
+ * `@multiplatform.one/components` code family (`useShikiTokens` +
6
+ * `HighlightedCode` — one shiki highlighter for the whole app). This file
7
+ * only owns the markdown-specific container chrome: the block inset (rides
8
+ * the space knob — SP-PAD, spec CodeBlock frame) and the shared markdown
9
+ * code color ramp.
10
+ */
11
+
12
+ import { Code, HighlightedCode, useShikiTokens } from "@multiplatform.one/components";
1
13
  import { useResolvedKnobs } from "@multiplatform.one/theme";
2
- import { useEffect, useState } from "react";
3
- import { ScrollView, Text, View, XStack } from "tamagui";
14
+ import { ScrollView, View } from "tamagui";
4
15
  import { markdownCodeColors } from "../shared/colorRamps";
5
- import { highlightCode, type ThemedToken, type BundledTheme } from "../shiki";
6
16
  import type { CodeBlockProps } from "../types";
7
17
 
8
18
  interface CodeBlockInternalProps extends CodeBlockProps {
9
- theme?: BundledTheme;
19
+ theme?: string | "auto";
10
20
  }
11
21
 
12
- export function CodeBlock({ children, lang, theme = "github-dark" }: CodeBlockInternalProps) {
22
+ export function CodeBlock({ children, lang, theme: themeProp = "auto" }: CodeBlockInternalProps) {
13
23
  const { knobProps } = useResolvedKnobs();
14
- const [tokens, setTokens] = useState<ThemedToken[][] | null>(null);
15
- const [error, setError] = useState<string | null>(null);
16
-
17
- useEffect(() => {
18
- let cancelled = false;
19
-
20
- highlightCode(children, lang || "text", theme)
21
- .then((result) => {
22
- if (!cancelled) {
23
- setTokens(result);
24
- setError(null);
25
- }
26
- })
27
- .catch((err) => {
28
- if (!cancelled) {
29
- setError(String(err));
30
- setTokens(null);
31
- }
32
- });
33
-
34
- return () => {
35
- cancelled = true;
36
- };
37
- }, [children, lang, theme]);
38
-
39
- const containerProps = {
40
- borderRadius: knobProps.borderRadiusOuter?.borderRadius ?? "$4",
41
- backgroundColor: markdownCodeColors.background.base,
42
- borderWidth: 1,
43
- borderColor: markdownCodeColors.border.base,
44
- padding: knobProps.panelPadding.padding,
45
- marginVertical: "$2",
46
- overflow: "hidden" as const,
47
- };
48
-
49
- // Loading or error fallback
50
- if (!tokens || error) {
51
- return (
52
- <View {...containerProps}>
53
- <ScrollView horizontal showsHorizontalScrollIndicator={false}>
54
- <Text
55
- fontFamily="$mono"
56
- fontSize={knobProps.sizeToken}
57
- color={markdownCodeColors.text.muted}
58
- >
59
- {children}
60
- </Text>
61
- </ScrollView>
62
- </View>
63
- );
64
- }
24
+ // "auto" defers to useShikiTokens' scheme default (github-light/dark from
25
+ // the active Tamagui theme), so direct CodeBlock use matches the color
26
+ // scheme instead of painting dark tokens on a light container (SB-M-1216).
27
+ const tokens = useShikiTokens(
28
+ children,
29
+ lang || "text",
30
+ themeProp === "auto" ? undefined : themeProp,
31
+ );
65
32
 
66
33
  return (
67
- <View {...containerProps}>
34
+ <View
35
+ // Full fragment spread (AGENTS.md knob rule) so the cornerSmoothing
36
+ // class rides along with the outer radius; the fallback keeps the old
37
+ // default when a Preset override drops the fragment.
38
+ {...(knobProps.borderRadiusOuter ?? { borderRadius: "$4" })}
39
+ backgroundColor={markdownCodeColors.background.base}
40
+ borderWidth={1}
41
+ borderColor={markdownCodeColors.border.base}
42
+ // SP-PAD (spec CodeBlock frame; LC-18 / UX-P07): the block inset rides
43
+ // the space knob through the complete panelPadding fragment —
44
+ // components-CodeBlock parity.
45
+ {...knobProps.panelPadding}
46
+ marginVertical="$2"
47
+ overflow="hidden"
48
+ >
68
49
  <ScrollView horizontal showsHorizontalScrollIndicator={false}>
69
- <View>
70
- {tokens.map((line, lineIndex) => (
71
- <XStack key={lineIndex} minHeight={20}>
72
- {line.length === 0 ? (
73
- <Text fontFamily="$mono" fontSize={knobProps.sizeToken}>
74
- {"\n"}
75
- </Text>
76
- ) : (
77
- line.map((token, tokenIndex) => (
78
- <Text
79
- key={tokenIndex}
80
- fontFamily="$mono"
81
- fontSize={knobProps.sizeToken}
82
- style={{ color: token.color }}
83
- >
84
- {token.content}
85
- </Text>
86
- ))
87
- )}
88
- </XStack>
89
- ))}
90
- </View>
50
+ <Code
51
+ backgroundColor="transparent"
52
+ borderWidth={0}
53
+ padding={0}
54
+ color={markdownCodeColors.text.base}
55
+ fontSize={knobProps.sizeToken}
56
+ >
57
+ <HighlightedCode tokens={tokens} fontSize={knobProps.sizeToken}>
58
+ {children}
59
+ </HighlightedCode>
60
+ </Code>
91
61
  </ScrollView>
92
62
  </View>
93
63
  );
@@ -1,4 +1,5 @@
1
- import { H1, H2, H3, H4, H5, H6 } from "tamagui";
1
+ import { useResolvedKnobs } from "@multiplatform.one/theme";
2
+ import { H1, H2, H3, H4, H5, H6, isWeb } from "tamagui";
2
3
  import type { HeadingProps } from "../types";
3
4
 
4
5
  const headingComponents = {
@@ -10,10 +11,22 @@ const headingComponents = {
10
11
  6: H6,
11
12
  } as const;
12
13
 
14
+ /** Tamagui default heading scale per level (medium size knob keeps these). */
15
+ const headingBaseSize = { 1: 9, 2: 8, 3: 7, 4: 6, 5: 5, 6: 4 } as const;
16
+
17
+ /** Size knob shifts the whole heading scale one step, preserving hierarchy. */
18
+ const sizeShift: Record<string, number> = { $3: -1, $4: 0, $5: 1 };
19
+
13
20
  export function Heading({ level, children }: HeadingProps) {
14
21
  const Component = headingComponents[level];
22
+ // T-HEADING: heading recipe + sizeToken-appropriate scale (spec: Heading).
23
+ // Web resolves the heading family through the tamagui font config, so the
24
+ // fontFamily override is native-only (same pattern as PageHeader).
25
+ const { knobProps } = useResolvedKnobs();
26
+ const headingFamily = isWeb ? null : { fontFamily: knobProps.heading.fontFamily };
27
+ const size = `$${headingBaseSize[level] + (sizeShift[knobProps.sizeToken] ?? 0)}`;
15
28
  return (
16
- <Component marginTop="$3" marginBottom="$2">
29
+ <Component marginTop="$3" marginBottom="$2" size={size as any} {...headingFamily}>
17
30
  {children}
18
31
  </Component>
19
32
  );
@@ -7,12 +7,15 @@ export function MarkdownImage({ src, alt, title }: ImageProps) {
7
7
  return (
8
8
  <View marginVertical="$2">
9
9
  <TamaguiImage
10
- source={{ uri: src }}
10
+ // src (string), not source: the RN source object never reaches the
11
+ // DOM <img> src on web, so the image silently renders empty; tamagui
12
+ // maps src back to source={{uri}} on native.
13
+ src={src}
11
14
  alt={alt || ""}
12
- accessibilityLabel={alt || title || "Image"}
15
+ aria-label={alt || title || undefined}
13
16
  width="100%"
14
17
  height={200}
15
- resizeMode="contain"
18
+ objectFit="contain"
16
19
  borderRadius={knobProps.borderRadius.borderRadius}
17
20
  />
18
21
  </View>
@@ -1,21 +1,28 @@
1
- import { Text } from "tamagui";
1
+ /**
2
+ * Plain-markdown inline code.
3
+ *
4
+ * LC-16 wrapper over the canonical `CodeInline` from
5
+ * `@multiplatform.one/components` (real `<code>` semantics, shared code
6
+ * color ramp). Markdown-specific constraint kept here: sizing uses the size
7
+ * knob token instead of CodeInline's web-only percentage font metrics, so
8
+ * the same source renders on native (React Native has no % font sizes).
9
+ */
10
+
11
+ import { CodeInline } from "@multiplatform.one/components";
2
12
  import { useResolvedKnobs } from "@multiplatform.one/theme";
3
- import { markdownCodeColors } from "../shared/colorRamps";
4
13
  import type { InlineCodeProps } from "../types";
5
14
 
6
15
  export function InlineCode({ children }: InlineCodeProps) {
7
16
  const { knobProps } = useResolvedKnobs();
8
17
  return (
9
- <Text
10
- fontFamily="$mono"
18
+ <CodeInline
11
19
  fontSize={knobProps.sizeToken}
12
- backgroundColor={markdownCodeColors.background.base}
13
- color={markdownCodeColors.text.base}
20
+ lineHeight={knobProps.sizeToken}
14
21
  paddingHorizontal="$1.5"
15
22
  paddingVertical="$0.5"
16
23
  borderRadius={knobProps.borderRadius.borderRadius}
17
24
  >
18
25
  {children}
19
- </Text>
26
+ </CodeInline>
20
27
  );
21
28
  }
@@ -2,13 +2,25 @@ import { Text } from "tamagui";
2
2
  import type { InlineProps } from "../types";
3
3
 
4
4
  export function Strong({ children }: InlineProps) {
5
- return <Text fontWeight="bold">{children}</Text>;
5
+ return (
6
+ <Text render="strong" fontWeight="bold">
7
+ {children}
8
+ </Text>
9
+ );
6
10
  }
7
11
 
8
12
  export function Emphasis({ children }: InlineProps) {
9
- return <Text fontStyle="italic">{children}</Text>;
13
+ return (
14
+ <Text render="em" fontStyle="italic">
15
+ {children}
16
+ </Text>
17
+ );
10
18
  }
11
19
 
12
20
  export function Strikethrough({ children }: InlineProps) {
13
- return <Text textDecorationLine="line-through">{children}</Text>;
21
+ return (
22
+ <Text render="del" textDecorationLine="line-through">
23
+ {children}
24
+ </Text>
25
+ );
14
26
  }
@@ -1,24 +1,47 @@
1
- import { Text } from "tamagui";
1
+ import { Text, isWeb } from "tamagui";
2
2
  import { openUrl } from "@multiplatform.one/platform";
3
3
  import { markdownLinkColors } from "../shared/colorRamps";
4
4
  import type { LinkProps } from "../types";
5
5
 
6
+ const safeProtocols = new Set(["http", "https", "mailto", "tel", "sms"]);
7
+
8
+ function getSafeHref(href?: string): string | undefined {
9
+ if (!href) return undefined;
10
+ const trimmed = href.trim();
11
+ const match = trimmed.match(/^([a-z][a-z0-9+.-]*):/i);
12
+ // relative, hash, and query hrefs have no scheme and are safe
13
+ if (!match) return trimmed;
14
+ return safeProtocols.has(match[1].toLowerCase()) ? trimmed : undefined;
15
+ }
16
+
6
17
  export function Link({ href, title, children }: LinkProps) {
18
+ const safeHref = getSafeHref(href);
19
+ const isExternal = !!safeHref && /^https?:\/\//i.test(safeHref);
20
+
7
21
  const handlePress = () => {
8
- if (href) {
9
- openUrl(href);
10
- }
22
+ // web navigation is handled natively by the anchor element
23
+ if (!isWeb && safeHref) openUrl(safeHref);
11
24
  };
12
25
 
13
26
  return (
14
27
  <Text
28
+ render="a"
29
+ // @ts-expect-error anchor attributes forwarded to the DOM element
30
+ href={safeHref}
31
+ target={isExternal ? "_blank" : undefined}
32
+ rel={isExternal ? "noopener noreferrer" : undefined}
33
+ title={title || undefined}
15
34
  color={markdownLinkColors.text.base}
16
35
  textDecorationLine="underline"
17
36
  cursor="pointer"
18
37
  onPress={handlePress}
19
- accessibilityRole="link"
20
- accessibilityLabel={title || undefined}
21
38
  hoverStyle={{ color: markdownLinkColors.text.hover }}
39
+ focusVisibleStyle={{
40
+ outlineColor: "$outlineColor",
41
+ outlineWidth: 2,
42
+ outlineStyle: "solid",
43
+ outlineOffset: 2,
44
+ }}
22
45
  >
23
46
  {children}
24
47
  </Text>
@@ -1,13 +1,108 @@
1
- import { View, XStack, Text } from "tamagui";
2
- import type { ListProps, ListItemProps } from "../types";
1
+ import { Children, cloneElement, isValidElement } from "react";
2
+ import { useResolvedKnobs } from "@multiplatform.one/theme";
3
+ import { Text, View, XStack, getConfig, getVariableValue } from "tamagui";
4
+ import { CheckIcon } from "../icons";
5
+ import type { ListItemProps, ListProps } from "../types";
3
6
 
4
- export function MarkdownList({ ordered: _ordered, start: _start, children }: ListProps) {
5
- return <View marginVertical="$2">{children}</View>;
7
+ const listReset = {
8
+ listStyleType: "none",
9
+ paddingInlineStart: 0,
10
+ marginBlockStart: 0,
11
+ marginBlockEnd: 0,
12
+ } as any;
13
+
14
+ export function MarkdownList({ ordered, start, children }: ListProps) {
15
+ const items = Children.map(children, (child) => {
16
+ if (!isValidElement(child) || child.type !== MarkdownListItem) return child;
17
+ const childProps = child.props as ListItemInternalProps;
18
+ return cloneElement(child as React.ReactElement<ListItemInternalProps>, {
19
+ ordered: childProps.ordered ?? ordered,
20
+ start: childProps.start ?? start ?? undefined,
21
+ });
22
+ });
23
+ return (
24
+ <View
25
+ render={ordered ? "ol" : "ul"}
26
+ start={ordered ? (start ?? undefined) : undefined}
27
+ style={listReset}
28
+ marginVertical="$2"
29
+ >
30
+ {items}
31
+ </View>
32
+ );
6
33
  }
7
34
 
8
35
  interface ListItemInternalProps extends ListItemProps {
9
36
  index?: number;
10
37
  ordered?: boolean;
38
+ start?: number;
39
+ }
40
+
41
+ /**
42
+ * Typography of the prose the task marker sits beside: markdown Paragraph
43
+ * renders the $body font at size $true with lineHeight $6 (./Paragraph.tsx).
44
+ * The box derives from those same tokens so it scales with the body type
45
+ * instead of a hardcoded glyph column (theme-propagation-spec: MarkdownListItem
46
+ * marker "scales with type/size").
47
+ */
48
+ function getTaskBoxMetrics() {
49
+ const bodyFont = getConfig()?.fontsParsed?.$body;
50
+ const fontSize = Math.round(getVariableValue(bodyFont?.size?.$true) || 14);
51
+ const lineHeight = Math.round(getVariableValue(bodyFont?.lineHeight?.$6) || fontSize * 2);
52
+ return { boxSize: Math.round(fontSize * 1.15), lineHeight };
53
+ }
54
+
55
+ /** Box↔label gap by space knob — mirrors the forms Checkbox inline gap. */
56
+ const taskInlineGapMap: Record<string, string> = {
57
+ small: "$1.5",
58
+ medium: "$2",
59
+ large: "$2.5",
60
+ };
61
+
62
+ /** Cap the radius knob for a small square control (R-CLAMP: never a circle). */
63
+ function clampTaskBoxRadius(radiusToken: string, pointy: boolean): string | number {
64
+ if (pointy || radiusToken === "$0") return 0;
65
+ const num = Number.parseInt(radiusToken.replace("$", ""), 10);
66
+ return Number.isFinite(num) && num > 2 ? "$2" : radiusToken;
67
+ }
68
+
69
+ /**
70
+ * Read-only GFM task-list marker. It is document content, not a form field:
71
+ * never focusable or clickable, state conveyed via role/aria only. Drawn with
72
+ * the house control treatment ($color5 surface, $color7 border, accent check)
73
+ * so radius/border/fill/space/accent/weight knobs all reach it (LC-18).
74
+ */
75
+ function TaskCheckbox({ checked }: { checked: boolean }) {
76
+ const { knobProps } = useResolvedKnobs();
77
+ const { boxSize, lineHeight } = getTaskBoxMetrics();
78
+ return (
79
+ <View height={lineHeight} justifyContent="center">
80
+ <View
81
+ role="checkbox"
82
+ aria-checked={checked}
83
+ aria-disabled={true}
84
+ width={boxSize}
85
+ height={boxSize}
86
+ borderWidth={knobProps.borderRadius.borderWidth}
87
+ borderColor="$color7"
88
+ backgroundColor={knobProps.outlined ? "transparent" : "$color5"}
89
+ borderRadius={clampTaskBoxRadius(
90
+ knobProps.borderRadius.borderRadius as string,
91
+ knobProps.pointy,
92
+ )}
93
+ alignItems="center"
94
+ justifyContent="center"
95
+ >
96
+ {checked ? (
97
+ <CheckIcon
98
+ size={Math.round(boxSize * 0.72)}
99
+ color={knobProps.textAccentColor}
100
+ strokeWidth={knobProps.textWeight.fontWeight === "700" ? 3 : 2.5}
101
+ />
102
+ ) : null}
103
+ </View>
104
+ </View>
105
+ );
11
106
  }
12
107
 
13
108
  export function MarkdownListItem({
@@ -15,24 +110,29 @@ export function MarkdownListItem({
15
110
  children,
16
111
  index = 0,
17
112
  ordered = false,
113
+ start,
18
114
  }: ListItemInternalProps) {
19
- const bullet = ordered ? `${index + 1}.` : "•";
115
+ const { knobProps } = useResolvedKnobs();
116
+ const bullet = ordered ? `${(start ?? 1) + index}.` : "•";
20
117
 
21
118
  // Task list item
22
119
  if (checked !== null && checked !== undefined) {
23
120
  return (
24
- <XStack marginBottom="$1" alignItems="flex-start">
25
- <Text width={24} color="$color11">
26
- {checked ? "☑" : "☐"}
27
- </Text>
121
+ <XStack
122
+ render="li"
123
+ marginBottom="$1"
124
+ alignItems="flex-start"
125
+ gap={taskInlineGapMap[knobProps.space] ?? "$2"}
126
+ >
127
+ <TaskCheckbox checked={checked} />
28
128
  <View flex={1}>{children}</View>
29
129
  </XStack>
30
130
  );
31
131
  }
32
132
 
33
133
  return (
34
- <XStack marginBottom="$1" alignItems="flex-start">
35
- <Text width={24} color="$color11">
134
+ <XStack render="li" marginBottom="$1" alignItems="flex-start">
135
+ <Text width={24} color="$color11" aria-hidden>
36
136
  {bullet}
37
137
  </Text>
38
138
  <View flex={1}>{children}</View>
@@ -1,9 +1,14 @@
1
+ import { useResolvedKnobs } from "@multiplatform.one/theme";
1
2
  import { Paragraph as TamaguiParagraph } from "tamagui";
2
3
  import type { ParagraphProps } from "../types";
3
4
 
4
5
  export function Paragraph({ children }: ParagraphProps) {
6
+ // Prose is T-VALUE: body recipe (family/weight) + size-knob body scale
7
+ // (spec: markdown Paragraph binds `body`; LC-18). The size prop carries
8
+ // the paired lineHeight, replacing the old fixed $6.
9
+ const { knobProps } = useResolvedKnobs();
5
10
  return (
6
- <TamaguiParagraph marginBottom="$2" lineHeight="$6">
11
+ <TamaguiParagraph marginBottom="$2" size={knobProps.sizeToken as any} {...knobProps.body}>
7
12
  {children}
8
13
  </TamaguiParagraph>
9
14
  );
@@ -1,56 +1,77 @@
1
+ /**
2
+ * Plain-markdown table renderer.
3
+ *
4
+ * Built on `@multiplatform.one/table-primitives` so plain-markdown tables
5
+ * render real `<table>/<thead>/<tbody>/<tr>/<th>/<td>` semantics and match
6
+ * the MDX table styling. The renderer emits a flat list of rows (first row
7
+ * flagged `isHeader`); MarkdownTable partitions them into head and body.
8
+ */
9
+
10
+ import { Children, isValidElement } from "react";
1
11
  import { useResolvedKnobs } from "@multiplatform.one/theme";
2
- import { View, Text, XStack, YStack, ScrollView } from "tamagui";
3
- import { markdownTableColors } from "../shared/colorRamps";
12
+ import { Paragraph, ScrollView, YStack } from "tamagui";
13
+ import { Table } from "@multiplatform.one/table-primitives";
4
14
  import type { TableProps, TableRowProps, TableCellProps } from "../types";
5
15
 
16
+ function isHeaderRow(row: unknown): boolean {
17
+ return isValidElement(row) && Boolean((row.props as TableRowProps).isHeader);
18
+ }
19
+
6
20
  export function MarkdownTable({ children }: TableProps) {
7
21
  const { knobProps } = useResolvedKnobs();
22
+ const rows = Children.toArray(children);
23
+ const headerRows = rows.filter((row) => isHeaderRow(row));
24
+ const bodyRows = rows.filter((row) => !isHeaderRow(row));
8
25
 
9
26
  return (
10
- <ScrollView horizontal marginVertical="$3">
11
- <YStack
12
- {...knobProps.borderRadiusOuter}
13
- borderWidth={1}
14
- borderColor={markdownTableColors.border.base}
15
- overflow="hidden"
16
- minWidth="100%"
17
- >
18
- {children}
27
+ <ScrollView horizontal showsHorizontalScrollIndicator={false} marginVertical="$3">
28
+ <YStack minWidth="100%">
29
+ <Table
30
+ render="table"
31
+ // Size by content inside the horizontal scroller: a real <table> with
32
+ // width:100% against the scroller's indefinite width hits Chromium's
33
+ // 1e6px table clamp. Auto width + auto layout = GitHub-style
34
+ // shrink-to-fit columns; cellWidth="auto" lifts the token width cap.
35
+ width="auto"
36
+ cellWidth="auto"
37
+ style={{ tableLayout: "auto" }}
38
+ borderColor="$borderColor"
39
+ borderRadius={knobProps.borderRadius.borderRadius}
40
+ alignCells={{ x: "start", y: "center" }}
41
+ alignHeaderCells={{ x: "start", y: "center" }}
42
+ >
43
+ {headerRows.length > 0 && <Table.Head render="thead">{headerRows}</Table.Head>}
44
+ <Table.Body render="tbody">{bodyRows}</Table.Body>
45
+ </Table>
19
46
  </YStack>
20
47
  </ScrollView>
21
48
  );
22
49
  }
23
50
 
24
- export function MarkdownTableRow({ children, isHeader }: TableRowProps) {
25
- return (
26
- <XStack
27
- backgroundColor={
28
- isHeader ? markdownTableColors.background.header : markdownTableColors.background.base
29
- }
30
- borderBottomWidth={isHeader ? 1 : 0.5}
31
- borderBottomColor={markdownTableColors.border.base}
32
- >
33
- {children}
34
- </XStack>
35
- );
51
+ export function MarkdownTableRow({ children }: TableRowProps) {
52
+ // `isHeader` is consumed by MarkdownTable to place the row in thead/tbody.
53
+ return <Table.Row render="tr">{children}</Table.Row>;
36
54
  }
37
55
 
38
56
  export function MarkdownTableCell({ children, isHeader, align }: TableCellProps) {
39
- const { knobProps } = useResolvedKnobs();
40
57
  const textAlign = align || "left";
41
58
 
59
+ if (isHeader) {
60
+ return (
61
+ <Table.HeaderCell render="th">
62
+ <Paragraph render="span" display="block" size="$4" fontWeight="600" textAlign={textAlign}>
63
+ {children}
64
+ </Paragraph>
65
+ </Table.HeaderCell>
66
+ );
67
+ }
68
+
42
69
  return (
43
- <View
44
- flex={1}
45
- paddingHorizontal={knobProps.gap.gap}
46
- paddingVertical="$2"
47
- borderRightWidth={0.5}
48
- borderRightColor={markdownTableColors.border.base}
49
- justifyContent="center"
50
- >
51
- <Text fontWeight={isHeader ? "600" : "normal"} textAlign={textAlign}>
70
+ <Table.Cell render="td">
71
+ {/* maxWidth caps the column's max-content contribution so long cells wrap */}
72
+ <Paragraph render="span" display="block" size="$4" textAlign={textAlign} maxWidth={480}>
52
73
  {children}
53
- </Text>
54
- </View>
74
+ </Paragraph>
75
+ </Table.Cell>
55
76
  );
56
77
  }