@multiplatform.one/markdown 6.1.0 → 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.
- package/README.md +61 -0
- package/dist/cjs/Aside/index.cjs +37 -32
- package/dist/cjs/Aside/index.native.js +41 -34
- package/dist/cjs/Aside/index.native.js.map +1 -1
- package/dist/cjs/ExternalIcon/index.cjs +2 -0
- package/dist/cjs/ExternalIcon/index.native.js +2 -0
- package/dist/cjs/ExternalIcon/index.native.js.map +1 -1
- package/dist/cjs/Hr/index.cjs +3 -11
- package/dist/cjs/Hr/index.native.js +3 -11
- package/dist/cjs/Hr/index.native.js.map +1 -1
- package/dist/cjs/{SimpleTable → MarkdownSimpleTable}/index.cjs +27 -9
- package/dist/{jsx/SimpleTable → cjs/MarkdownSimpleTable}/index.native.js +32 -11
- package/dist/cjs/MarkdownSimpleTable/index.native.js.map +1 -0
- package/dist/cjs/Mdx/index.cjs +15 -7
- package/dist/cjs/Mdx/index.native.js +15 -7
- package/dist/cjs/Mdx/index.native.js.map +1 -1
- package/dist/cjs/MdxCodeBlock/index.cjs +28 -20
- package/dist/cjs/MdxCodeBlock/index.native.js +33 -22
- package/dist/cjs/MdxCodeBlock/index.native.js.map +1 -1
- package/dist/cjs/Notice/index.cjs +13 -56
- package/dist/cjs/Notice/index.native.js +13 -56
- package/dist/cjs/Notice/index.native.js.map +1 -1
- package/dist/cjs/Table/index.cjs +13 -0
- package/dist/cjs/Table/index.native.js +15 -0
- package/dist/cjs/Table/index.native.js.map +1 -1
- package/dist/cjs/Tabs/index.cjs +15 -47
- package/dist/cjs/Tabs/index.native.js +20 -52
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/Ul/index.cjs +2 -2
- package/dist/cjs/Ul/index.native.js +2 -2
- package/dist/cjs/Ul/index.native.js.map +1 -1
- package/dist/cjs/Video/index.cjs +4 -2
- package/dist/cjs/Video/index.native.js +4 -2
- package/dist/cjs/Video/index.native.js.map +1 -1
- package/dist/cjs/components/Blockquote.cjs +16 -3
- package/dist/cjs/components/Blockquote.native.js +25 -3
- package/dist/cjs/components/Blockquote.native.js.map +1 -1
- package/dist/cjs/components/Break.cjs +1 -0
- package/dist/cjs/components/Break.native.js +1 -0
- package/dist/cjs/components/Break.native.js.map +1 -1
- package/dist/cjs/components/CodeBlock.cjs +20 -60
- package/dist/cjs/components/CodeBlock.native.js +22 -64
- package/dist/cjs/components/CodeBlock.native.js.map +1 -1
- package/dist/cjs/components/Heading.cjs +23 -0
- package/dist/cjs/components/Heading.native.js +24 -0
- package/dist/cjs/components/Heading.native.js.map +1 -1
- package/dist/cjs/components/Image.cjs +3 -5
- package/dist/cjs/components/Image.native.js +6 -5
- package/dist/cjs/components/Image.native.js.map +1 -1
- package/dist/cjs/components/InlineCode.cjs +3 -6
- package/dist/cjs/components/InlineCode.native.js +3 -6
- package/dist/cjs/components/InlineCode.native.js.map +1 -1
- package/dist/cjs/components/InlineStyles.cjs +3 -0
- package/dist/cjs/components/InlineStyles.native.js +3 -0
- package/dist/cjs/components/InlineStyles.native.js.map +1 -1
- package/dist/cjs/components/Link.cjs +22 -5
- package/dist/cjs/components/Link.native.js +23 -5
- package/dist/cjs/components/Link.native.js.map +1 -1
- package/dist/cjs/components/List.cjs +87 -9
- package/dist/cjs/components/List.native.js +91 -9
- package/dist/cjs/components/List.native.js.map +1 -1
- package/dist/cjs/components/Paragraph.cjs +6 -1
- package/dist/cjs/components/Paragraph.native.js +6 -1
- package/dist/cjs/components/Paragraph.native.js.map +1 -1
- package/dist/cjs/components/Table.cjs +57 -24
- package/dist/cjs/components/Table.native.js +67 -25
- package/dist/cjs/components/Table.native.js.map +1 -1
- package/dist/cjs/hooks/useCompileMdx.cjs +61 -28
- package/dist/cjs/hooks/useCompileMdx.native.js +80 -28
- package/dist/cjs/hooks/useCompileMdx.native.js.map +1 -1
- package/dist/cjs/hooks/useEvaluateMdx.cjs +7 -1
- package/dist/cjs/hooks/useEvaluateMdx.native.js +9 -3
- package/dist/cjs/hooks/useEvaluateMdx.native.js.map +1 -1
- package/dist/cjs/icons/index.cjs +31 -101
- package/dist/cjs/icons/index.native.js +36 -116
- package/dist/cjs/icons/index.native.js.map +1 -1
- package/dist/cjs/index.cjs +6 -4
- package/dist/cjs/index.native.js +6 -4
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/mdxComponents.cjs +13 -6
- package/dist/cjs/mdxComponents.native.js +16 -6
- package/dist/cjs/mdxComponents.native.js.map +1 -1
- package/dist/cjs/mermaid/MermaidBlock.cjs +110 -0
- package/dist/cjs/mermaid/MermaidBlock.native.js +41 -0
- package/dist/cjs/mermaid/MermaidBlock.native.js.map +1 -0
- package/dist/cjs/mermaid/index.cjs +31 -0
- package/dist/cjs/mermaid/index.native.js +34 -0
- package/dist/cjs/mermaid/index.native.js.map +1 -0
- package/dist/cjs/mermaid/mountDiagramSvg.cjs +54 -0
- package/dist/cjs/mermaid/mountDiagramSvg.native.js +98 -0
- package/dist/cjs/mermaid/mountDiagramSvg.native.js.map +1 -0
- package/dist/cjs/mermaid/renderMermaidDiagram.cjs +92 -0
- package/dist/cjs/mermaid/renderMermaidDiagram.native.js +110 -0
- package/dist/cjs/mermaid/renderMermaidDiagram.native.js.map +1 -0
- package/dist/cjs/renderer.cjs +9 -1
- package/dist/cjs/renderer.native.js +10 -2
- package/dist/cjs/renderer.native.js.map +1 -1
- package/dist/cjs/shared/colorRamps.cjs +1 -11
- package/dist/cjs/shared/colorRamps.native.js +1 -11
- package/dist/cjs/shared/colorRamps.native.js.map +1 -1
- package/dist/cjs/shared/cutoffGradient.cjs +54 -0
- package/dist/cjs/shared/cutoffGradient.native.js +63 -0
- package/dist/cjs/shared/cutoffGradient.native.js.map +1 -0
- package/dist/cjs/shiki/index.cjs +1 -16
- package/dist/cjs/shiki/index.native.js +0 -15
- package/dist/cjs/shiki/index.native.js.map +1 -1
- package/dist/esm/Aside/index.mjs +39 -34
- package/dist/esm/Aside/index.mjs.map +1 -1
- package/dist/esm/Aside/index.native.js +43 -36
- package/dist/esm/Aside/index.native.js.map +1 -1
- package/dist/esm/ExternalIcon/index.mjs +2 -0
- package/dist/esm/ExternalIcon/index.mjs.map +1 -1
- package/dist/esm/ExternalIcon/index.native.js +2 -0
- package/dist/esm/ExternalIcon/index.native.js.map +1 -1
- package/dist/esm/Hr/index.mjs +4 -12
- package/dist/esm/Hr/index.mjs.map +1 -1
- package/dist/esm/Hr/index.native.js +4 -12
- package/dist/esm/Hr/index.native.js.map +1 -1
- package/dist/esm/{SimpleTable → MarkdownSimpleTable}/index.mjs +24 -6
- package/dist/esm/MarkdownSimpleTable/index.mjs.map +1 -0
- package/dist/esm/{SimpleTable → MarkdownSimpleTable}/index.native.js +29 -8
- package/dist/esm/MarkdownSimpleTable/index.native.js.map +1 -0
- package/dist/esm/Mdx/index.mjs +15 -7
- package/dist/esm/Mdx/index.mjs.map +1 -1
- package/dist/esm/Mdx/index.native.js +15 -7
- package/dist/esm/Mdx/index.native.js.map +1 -1
- package/dist/esm/MdxCodeBlock/index.mjs +30 -22
- package/dist/esm/MdxCodeBlock/index.mjs.map +1 -1
- package/dist/esm/MdxCodeBlock/index.native.js +35 -24
- package/dist/esm/MdxCodeBlock/index.native.js.map +1 -1
- package/dist/esm/Notice/index.mjs +15 -57
- package/dist/esm/Notice/index.mjs.map +1 -1
- package/dist/esm/Notice/index.native.js +15 -57
- package/dist/esm/Notice/index.native.js.map +1 -1
- package/dist/esm/Table/index.mjs +13 -0
- package/dist/esm/Table/index.mjs.map +1 -1
- package/dist/esm/Table/index.native.js +15 -0
- package/dist/esm/Table/index.native.js.map +1 -1
- package/dist/esm/Tabs/index.mjs +17 -49
- package/dist/esm/Tabs/index.mjs.map +1 -1
- package/dist/esm/Tabs/index.native.js +22 -54
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/Ul/index.mjs +2 -2
- package/dist/esm/Ul/index.mjs.map +1 -1
- package/dist/esm/Ul/index.native.js +2 -2
- package/dist/esm/Ul/index.native.js.map +1 -1
- package/dist/esm/Video/index.mjs +4 -2
- package/dist/esm/Video/index.mjs.map +1 -1
- package/dist/esm/Video/index.native.js +4 -2
- package/dist/esm/Video/index.native.js.map +1 -1
- package/dist/esm/components/Blockquote.mjs +17 -4
- package/dist/esm/components/Blockquote.mjs.map +1 -1
- package/dist/esm/components/Blockquote.native.js +26 -4
- package/dist/esm/components/Blockquote.native.js.map +1 -1
- package/dist/esm/components/Break.mjs +2 -1
- package/dist/esm/components/Break.mjs.map +1 -1
- package/dist/esm/components/Break.native.js +2 -1
- package/dist/esm/components/Break.native.js.map +1 -1
- package/dist/esm/components/CodeBlock.mjs +21 -61
- package/dist/esm/components/CodeBlock.mjs.map +1 -1
- package/dist/esm/components/CodeBlock.native.js +23 -65
- package/dist/esm/components/CodeBlock.native.js.map +1 -1
- package/dist/esm/components/Heading.mjs +24 -1
- package/dist/esm/components/Heading.mjs.map +1 -1
- package/dist/esm/components/Heading.native.js +25 -1
- package/dist/esm/components/Heading.native.js.map +1 -1
- package/dist/esm/components/Image.mjs +3 -5
- package/dist/esm/components/Image.mjs.map +1 -1
- package/dist/esm/components/Image.native.js +6 -5
- package/dist/esm/components/Image.native.js.map +1 -1
- package/dist/esm/components/InlineCode.mjs +3 -6
- package/dist/esm/components/InlineCode.mjs.map +1 -1
- package/dist/esm/components/InlineCode.native.js +3 -6
- package/dist/esm/components/InlineCode.native.js.map +1 -1
- package/dist/esm/components/InlineStyles.mjs +3 -0
- package/dist/esm/components/InlineStyles.mjs.map +1 -1
- package/dist/esm/components/InlineStyles.native.js +3 -0
- package/dist/esm/components/InlineStyles.native.js.map +1 -1
- package/dist/esm/components/Link.mjs +23 -6
- package/dist/esm/components/Link.mjs.map +1 -1
- package/dist/esm/components/Link.native.js +24 -6
- package/dist/esm/components/Link.native.js.map +1 -1
- package/dist/esm/components/List.mjs +88 -10
- package/dist/esm/components/List.mjs.map +1 -1
- package/dist/esm/components/List.native.js +92 -10
- package/dist/esm/components/List.native.js.map +1 -1
- package/dist/esm/components/Paragraph.mjs +6 -1
- package/dist/esm/components/Paragraph.mjs.map +1 -1
- package/dist/esm/components/Paragraph.native.js +6 -1
- package/dist/esm/components/Paragraph.native.js.map +1 -1
- package/dist/esm/components/Table.mjs +59 -26
- package/dist/esm/components/Table.mjs.map +1 -1
- package/dist/esm/components/Table.native.js +69 -27
- package/dist/esm/components/Table.native.js.map +1 -1
- package/dist/esm/hooks/useCompileMdx.mjs +61 -29
- package/dist/esm/hooks/useCompileMdx.mjs.map +1 -1
- package/dist/esm/hooks/useCompileMdx.native.js +80 -29
- package/dist/esm/hooks/useCompileMdx.native.js.map +1 -1
- package/dist/esm/hooks/useEvaluateMdx.mjs +7 -1
- package/dist/esm/hooks/useEvaluateMdx.mjs.map +1 -1
- package/dist/esm/hooks/useEvaluateMdx.native.js +9 -3
- package/dist/esm/hooks/useEvaluateMdx.native.js.map +1 -1
- package/dist/esm/icons/index.mjs +32 -100
- package/dist/esm/icons/index.mjs.map +1 -1
- package/dist/esm/icons/index.native.js +37 -115
- package/dist/esm/icons/index.native.js.map +1 -1
- package/dist/esm/index.mjs +5 -3
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +5 -3
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/mdxComponents.mjs +14 -7
- package/dist/esm/mdxComponents.mjs.map +1 -1
- package/dist/esm/mdxComponents.native.js +17 -7
- package/dist/esm/mdxComponents.native.js.map +1 -1
- package/dist/esm/mermaid/MermaidBlock.mjs +85 -0
- package/dist/esm/mermaid/MermaidBlock.mjs.map +1 -0
- package/dist/esm/mermaid/MermaidBlock.native.js +13 -0
- package/dist/esm/mermaid/MermaidBlock.native.js.map +1 -0
- package/dist/esm/mermaid/index.mjs +4 -0
- package/dist/esm/mermaid/index.mjs.map +1 -0
- package/dist/esm/mermaid/index.native.js +4 -0
- package/dist/esm/mermaid/index.native.js.map +1 -0
- package/dist/esm/mermaid/mountDiagramSvg.mjs +29 -0
- package/dist/esm/mermaid/mountDiagramSvg.mjs.map +1 -0
- package/dist/esm/mermaid/mountDiagramSvg.native.js +70 -0
- package/dist/esm/mermaid/mountDiagramSvg.native.js.map +1 -0
- package/dist/esm/mermaid/renderMermaidDiagram.mjs +55 -0
- package/dist/esm/mermaid/renderMermaidDiagram.mjs.map +1 -0
- package/dist/esm/mermaid/renderMermaidDiagram.native.js +70 -0
- package/dist/esm/mermaid/renderMermaidDiagram.native.js.map +1 -0
- package/dist/esm/renderer.mjs +9 -1
- package/dist/esm/renderer.mjs.map +1 -1
- package/dist/esm/renderer.native.js +10 -2
- package/dist/esm/renderer.native.js.map +1 -1
- package/dist/esm/shared/colorRamps.mjs +1 -10
- package/dist/esm/shared/colorRamps.mjs.map +1 -1
- package/dist/esm/shared/colorRamps.native.js +1 -10
- package/dist/esm/shared/colorRamps.native.js.map +1 -1
- package/dist/esm/shared/cutoffGradient.mjs +28 -0
- package/dist/esm/shared/cutoffGradient.mjs.map +1 -0
- package/dist/esm/shared/cutoffGradient.native.js +34 -0
- package/dist/esm/shared/cutoffGradient.native.js.map +1 -0
- package/dist/esm/shiki/index.mjs +1 -2
- package/dist/esm/shiki/index.mjs.map +1 -1
- package/dist/esm/shiki/index.native.js +1 -2
- package/dist/esm/shiki/index.native.js.map +1 -1
- package/dist/jsx/Aside/index.mjs +39 -34
- package/dist/jsx/Aside/index.mjs.map +1 -1
- package/dist/jsx/Aside/index.native.js +41 -34
- package/dist/jsx/Aside/index.native.js.map +1 -1
- package/dist/jsx/ExternalIcon/index.mjs +2 -0
- package/dist/jsx/ExternalIcon/index.mjs.map +1 -1
- package/dist/jsx/ExternalIcon/index.native.js +2 -0
- package/dist/jsx/ExternalIcon/index.native.js.map +1 -1
- package/dist/jsx/Hr/index.mjs +4 -12
- package/dist/jsx/Hr/index.mjs.map +1 -1
- package/dist/jsx/Hr/index.native.js +3 -11
- package/dist/jsx/Hr/index.native.js.map +1 -1
- package/dist/jsx/{SimpleTable → MarkdownSimpleTable}/index.mjs +24 -6
- package/dist/jsx/MarkdownSimpleTable/index.mjs.map +1 -0
- package/dist/{cjs/SimpleTable → jsx/MarkdownSimpleTable}/index.native.js +32 -11
- package/dist/jsx/MarkdownSimpleTable/index.native.js.map +1 -0
- package/dist/jsx/Mdx/index.mjs +15 -7
- package/dist/jsx/Mdx/index.mjs.map +1 -1
- package/dist/jsx/Mdx/index.native.js +15 -7
- package/dist/jsx/Mdx/index.native.js.map +1 -1
- package/dist/jsx/MdxCodeBlock/index.mjs +30 -22
- package/dist/jsx/MdxCodeBlock/index.mjs.map +1 -1
- package/dist/jsx/MdxCodeBlock/index.native.js +33 -22
- package/dist/jsx/MdxCodeBlock/index.native.js.map +1 -1
- package/dist/jsx/Notice/index.mjs +15 -57
- package/dist/jsx/Notice/index.mjs.map +1 -1
- package/dist/jsx/Notice/index.native.js +13 -56
- package/dist/jsx/Notice/index.native.js.map +1 -1
- package/dist/jsx/Table/index.mjs +13 -0
- package/dist/jsx/Table/index.mjs.map +1 -1
- package/dist/jsx/Table/index.native.js +15 -0
- package/dist/jsx/Table/index.native.js.map +1 -1
- package/dist/jsx/Tabs/index.mjs +17 -49
- package/dist/jsx/Tabs/index.mjs.map +1 -1
- package/dist/jsx/Tabs/index.native.js +20 -52
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/Ul/index.mjs +2 -2
- package/dist/jsx/Ul/index.mjs.map +1 -1
- package/dist/jsx/Ul/index.native.js +2 -2
- package/dist/jsx/Ul/index.native.js.map +1 -1
- package/dist/jsx/Video/index.mjs +4 -2
- package/dist/jsx/Video/index.mjs.map +1 -1
- package/dist/jsx/Video/index.native.js +4 -2
- package/dist/jsx/Video/index.native.js.map +1 -1
- package/dist/jsx/components/Blockquote.mjs +17 -4
- package/dist/jsx/components/Blockquote.mjs.map +1 -1
- package/dist/jsx/components/Blockquote.native.js +25 -3
- package/dist/jsx/components/Blockquote.native.js.map +1 -1
- package/dist/jsx/components/Break.mjs +2 -1
- package/dist/jsx/components/Break.mjs.map +1 -1
- package/dist/jsx/components/Break.native.js +1 -0
- package/dist/jsx/components/Break.native.js.map +1 -1
- package/dist/jsx/components/CodeBlock.mjs +21 -61
- package/dist/jsx/components/CodeBlock.mjs.map +1 -1
- package/dist/jsx/components/CodeBlock.native.js +22 -64
- package/dist/jsx/components/CodeBlock.native.js.map +1 -1
- package/dist/jsx/components/Heading.mjs +24 -1
- package/dist/jsx/components/Heading.mjs.map +1 -1
- package/dist/jsx/components/Heading.native.js +24 -0
- package/dist/jsx/components/Heading.native.js.map +1 -1
- package/dist/jsx/components/Image.mjs +3 -5
- package/dist/jsx/components/Image.mjs.map +1 -1
- package/dist/jsx/components/Image.native.js +6 -5
- package/dist/jsx/components/Image.native.js.map +1 -1
- package/dist/jsx/components/InlineCode.mjs +3 -6
- package/dist/jsx/components/InlineCode.mjs.map +1 -1
- package/dist/jsx/components/InlineCode.native.js +3 -6
- package/dist/jsx/components/InlineCode.native.js.map +1 -1
- package/dist/jsx/components/InlineStyles.mjs +3 -0
- package/dist/jsx/components/InlineStyles.mjs.map +1 -1
- package/dist/jsx/components/InlineStyles.native.js +3 -0
- package/dist/jsx/components/InlineStyles.native.js.map +1 -1
- package/dist/jsx/components/Link.mjs +23 -6
- package/dist/jsx/components/Link.mjs.map +1 -1
- package/dist/jsx/components/Link.native.js +23 -5
- package/dist/jsx/components/Link.native.js.map +1 -1
- package/dist/jsx/components/List.mjs +88 -10
- package/dist/jsx/components/List.mjs.map +1 -1
- package/dist/jsx/components/List.native.js +91 -9
- package/dist/jsx/components/List.native.js.map +1 -1
- package/dist/jsx/components/Paragraph.mjs +6 -1
- package/dist/jsx/components/Paragraph.mjs.map +1 -1
- package/dist/jsx/components/Paragraph.native.js +6 -1
- package/dist/jsx/components/Paragraph.native.js.map +1 -1
- package/dist/jsx/components/Table.mjs +59 -26
- package/dist/jsx/components/Table.mjs.map +1 -1
- package/dist/jsx/components/Table.native.js +67 -25
- package/dist/jsx/components/Table.native.js.map +1 -1
- package/dist/jsx/hooks/useCompileMdx.mjs +61 -29
- package/dist/jsx/hooks/useCompileMdx.mjs.map +1 -1
- package/dist/jsx/hooks/useCompileMdx.native.js +80 -28
- package/dist/jsx/hooks/useCompileMdx.native.js.map +1 -1
- package/dist/jsx/hooks/useEvaluateMdx.mjs +7 -1
- package/dist/jsx/hooks/useEvaluateMdx.mjs.map +1 -1
- package/dist/jsx/hooks/useEvaluateMdx.native.js +9 -3
- package/dist/jsx/hooks/useEvaluateMdx.native.js.map +1 -1
- package/dist/jsx/icons/index.mjs +32 -100
- package/dist/jsx/icons/index.mjs.map +1 -1
- package/dist/jsx/icons/index.native.js +36 -116
- package/dist/jsx/icons/index.native.js.map +1 -1
- package/dist/jsx/index.js +5 -3
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +5 -3
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +6 -4
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/mdxComponents.mjs +14 -7
- package/dist/jsx/mdxComponents.mjs.map +1 -1
- package/dist/jsx/mdxComponents.native.js +16 -6
- package/dist/jsx/mdxComponents.native.js.map +1 -1
- package/dist/jsx/mermaid/MermaidBlock.mjs +85 -0
- package/dist/jsx/mermaid/MermaidBlock.mjs.map +1 -0
- package/dist/jsx/mermaid/MermaidBlock.native.js +41 -0
- package/dist/jsx/mermaid/MermaidBlock.native.js.map +1 -0
- package/dist/jsx/mermaid/index.mjs +4 -0
- package/dist/jsx/mermaid/index.mjs.map +1 -0
- package/dist/jsx/mermaid/index.native.js +34 -0
- package/dist/jsx/mermaid/index.native.js.map +1 -0
- package/dist/jsx/mermaid/mountDiagramSvg.mjs +29 -0
- package/dist/jsx/mermaid/mountDiagramSvg.mjs.map +1 -0
- package/dist/jsx/mermaid/mountDiagramSvg.native.js +98 -0
- package/dist/jsx/mermaid/mountDiagramSvg.native.js.map +1 -0
- package/dist/jsx/mermaid/renderMermaidDiagram.mjs +55 -0
- package/dist/jsx/mermaid/renderMermaidDiagram.mjs.map +1 -0
- package/dist/jsx/mermaid/renderMermaidDiagram.native.js +110 -0
- package/dist/jsx/mermaid/renderMermaidDiagram.native.js.map +1 -0
- package/dist/jsx/renderer.mjs +9 -1
- package/dist/jsx/renderer.mjs.map +1 -1
- package/dist/jsx/renderer.native.js +10 -2
- package/dist/jsx/renderer.native.js.map +1 -1
- package/dist/jsx/shared/colorRamps.mjs +1 -10
- package/dist/jsx/shared/colorRamps.mjs.map +1 -1
- package/dist/jsx/shared/colorRamps.native.js +1 -11
- package/dist/jsx/shared/colorRamps.native.js.map +1 -1
- package/dist/jsx/shared/cutoffGradient.mjs +28 -0
- package/dist/jsx/shared/cutoffGradient.mjs.map +1 -0
- package/dist/jsx/shared/cutoffGradient.native.js +63 -0
- package/dist/jsx/shared/cutoffGradient.native.js.map +1 -0
- package/dist/jsx/shiki/index.mjs +1 -2
- package/dist/jsx/shiki/index.mjs.map +1 -1
- package/dist/jsx/shiki/index.native.js +0 -15
- package/dist/jsx/shiki/index.native.js.map +1 -1
- package/package.json +25 -14
- package/src/Aside/index.tsx +42 -35
- package/src/ExternalIcon/index.tsx +8 -1
- package/src/Hr/index.tsx +3 -6
- package/src/{SimpleTable → MarkdownSimpleTable}/index.tsx +30 -12
- package/src/MarkdownSimpleTable/markdownSimpleTable.spec.tsx +92 -0
- package/src/Mdx/index.tsx +12 -7
- package/src/MdxCodeBlock/index.tsx +33 -20
- package/src/Notice/index.tsx +12 -54
- package/src/Table/index.tsx +22 -6
- package/src/Tabs/index.tsx +26 -52
- package/src/Ul/index.ts +2 -2
- package/src/Video/index.tsx +15 -12
- package/src/components/Blockquote.tsx +29 -4
- package/src/components/Break.tsx +3 -1
- package/src/components/CodeBlock.tsx +49 -79
- package/src/components/Heading.tsx +15 -2
- package/src/components/Image.tsx +6 -3
- package/src/components/InlineCode.tsx +14 -7
- package/src/components/InlineStyles.tsx +15 -3
- package/src/components/Link.tsx +29 -6
- package/src/components/List.tsx +111 -11
- package/src/components/Paragraph.tsx +6 -1
- package/src/components/Table.tsx +56 -35
- package/src/components/markdownPrimitives.spec.tsx +121 -0
- package/src/docBlocks.spec.tsx +85 -0
- package/src/hooks/useCompileMdx.ts +75 -35
- package/src/hooks/useEvaluateMdx.ts +7 -1
- package/src/icons/index.tsx +36 -58
- package/src/index.ts +15 -3
- package/src/markdownComponent.spec.tsx +58 -0
- package/src/mdx.spec.tsx +4 -0
- package/src/mdxComponents.spec.tsx +185 -0
- package/src/mdxComponents.tsx +14 -5
- package/src/mermaid/MermaidBlock.native.tsx +15 -0
- package/src/mermaid/MermaidBlock.tsx +88 -0
- package/src/mermaid/index.ts +23 -0
- package/src/mermaid/mountDiagramSvg.ts +49 -0
- package/src/mermaid/renderMermaidDiagram.spec.ts +89 -0
- package/src/mermaid/renderMermaidDiagram.ts +78 -0
- package/src/renderer.spec.tsx +276 -0
- package/src/renderer.tsx +13 -1
- package/src/shared/colorRamps.ts +0 -10
- package/src/shared/cutoffGradient.ts +40 -0
- package/src/shiki/index.ts +7 -11
- package/src/stories/Blocks.stories.tsx +232 -0
- package/src/stories/Callouts.stories.tsx +147 -0
- package/src/stories/Code.stories.tsx +116 -0
- package/src/stories/Inline.stories.tsx +162 -0
- package/src/stories/Mdx.stories.tsx +107 -0
- package/src/stories/Media.stories.tsx +148 -0
- package/src/stories/Tables.stories.tsx +173 -0
- package/types/Aside/index.d.ts +11 -0
- package/types/Aside/index.d.ts.map +1 -0
- package/types/ExternalIcon/index.d.ts +2 -0
- package/types/ExternalIcon/index.d.ts.map +1 -0
- package/types/Hr/index.d.ts +2 -0
- package/types/Hr/index.d.ts.map +1 -0
- package/types/Li/index.d.ts +6 -0
- package/types/Li/index.d.ts.map +1 -0
- package/types/Markdown.d.ts +22 -0
- package/types/Markdown.d.ts.map +1 -0
- package/types/MarkdownSimpleTable/index.d.ts +16 -0
- package/types/MarkdownSimpleTable/index.d.ts.map +1 -0
- package/types/Mdx/index.d.ts +9 -0
- package/types/Mdx/index.d.ts.map +1 -0
- package/types/MdxCodeBlock/index.d.ts +7 -0
- package/types/MdxCodeBlock/index.d.ts.map +1 -0
- package/types/MdxCodeBlock/mdxCodeBlockContext.d.ts +13 -0
- package/types/MdxCodeBlock/mdxCodeBlockContext.d.ts.map +1 -0
- package/types/Notice/index.d.ts +12 -0
- package/types/Notice/index.d.ts.map +1 -0
- package/types/Table/index.d.ts +20 -0
- package/types/Table/index.d.ts.map +1 -0
- package/types/Tabs/index.d.ts +21 -0
- package/types/Tabs/index.d.ts.map +1 -0
- package/types/Ul/index.d.ts +6 -0
- package/types/Ul/index.d.ts.map +1 -0
- package/types/Video/index.d.ts +12 -0
- package/types/Video/index.d.ts.map +1 -0
- package/types/components/Blockquote.d.ts +3 -0
- package/types/components/Blockquote.d.ts.map +1 -0
- package/types/components/Break.d.ts +3 -0
- package/types/components/Break.d.ts.map +1 -0
- package/types/components/CodeBlock.d.ts +17 -0
- package/types/components/CodeBlock.d.ts.map +1 -0
- package/types/components/Heading.d.ts +3 -0
- package/types/components/Heading.d.ts.map +1 -0
- package/types/components/HorizontalRule.d.ts +3 -0
- package/types/components/HorizontalRule.d.ts.map +1 -0
- package/types/components/Image.d.ts +3 -0
- package/types/components/Image.d.ts.map +1 -0
- package/types/components/InlineCode.d.ts +12 -0
- package/types/components/InlineCode.d.ts.map +1 -0
- package/types/components/InlineStyles.d.ts +5 -0
- package/types/components/InlineStyles.d.ts.map +1 -0
- package/types/components/Link.d.ts +3 -0
- package/types/components/Link.d.ts.map +1 -0
- package/types/components/List.d.ts +10 -0
- package/types/components/List.d.ts.map +1 -0
- package/types/components/Paragraph.d.ts +3 -0
- package/types/components/Paragraph.d.ts.map +1 -0
- package/types/components/Table.d.ts +13 -0
- package/types/components/Table.d.ts.map +1 -0
- package/types/components/index.d.ts +13 -0
- package/types/components/index.d.ts.map +1 -0
- package/types/hooks/index.d.ts +4 -0
- package/types/hooks/index.d.ts.map +1 -0
- package/types/hooks/useCompileAndEvaluateMdx.d.ts +9 -0
- package/types/hooks/useCompileAndEvaluateMdx.d.ts.map +1 -0
- package/types/hooks/useCompileMdx.d.ts +13 -0
- package/types/hooks/useCompileMdx.d.ts.map +1 -0
- package/types/hooks/useEvaluateMdx.d.ts +5 -0
- package/types/hooks/useEvaluateMdx.d.ts.map +1 -0
- package/types/icons/index.d.ts +12 -0
- package/types/icons/index.d.ts.map +1 -0
- package/types/index.d.ts +29 -0
- package/types/index.d.ts.map +1 -0
- package/types/mdxComponents.d.ts +8 -0
- package/types/mdxComponents.d.ts.map +1 -0
- package/types/mermaid/MermaidBlock.d.ts +15 -0
- package/types/mermaid/MermaidBlock.d.ts.map +1 -0
- package/types/mermaid/MermaidBlock.native.d.ts +10 -0
- package/types/mermaid/MermaidBlock.native.d.ts.map +1 -0
- package/types/mermaid/index.d.ts +18 -0
- package/types/mermaid/index.d.ts.map +1 -0
- package/types/mermaid/mountDiagramSvg.d.ts +11 -0
- package/types/mermaid/mountDiagramSvg.d.ts.map +1 -0
- package/types/mermaid/renderMermaidDiagram.d.ts +33 -0
- package/types/mermaid/renderMermaidDiagram.d.ts.map +1 -0
- package/types/parser.d.ts +11 -0
- package/types/parser.d.ts.map +1 -0
- package/types/renderer.d.ts +32 -0
- package/types/renderer.d.ts.map +1 -0
- package/types/shared/colorRamps.d.ts +39 -0
- package/types/shared/colorRamps.d.ts.map +1 -0
- package/types/shared/cutoffGradient.d.ts +12 -0
- package/types/shared/cutoffGradient.d.ts.map +1 -0
- package/types/shared/index.d.ts +2 -0
- package/types/shared/index.d.ts.map +1 -0
- package/types/shiki/index.d.ts +8 -0
- package/types/shiki/index.d.ts.map +1 -0
- package/types/types.d.ts +160 -0
- package/types/types.d.ts.map +1 -0
- package/types/util/rehypeMetaAttributes.d.ts +2 -0
- package/types/util/rehypeMetaAttributes.d.ts.map +1 -0
- package/dist/cjs/ExternalIcon/ExternalIcon.spec.cjs +0 -37
- package/dist/cjs/ExternalIcon/ExternalIcon.spec.native.js +0 -40
- package/dist/cjs/ExternalIcon/ExternalIcon.spec.native.js.map +0 -1
- package/dist/cjs/Hr/hr.spec.cjs +0 -21
- package/dist/cjs/Hr/hr.spec.native.js +0 -24
- package/dist/cjs/Hr/hr.spec.native.js.map +0 -1
- package/dist/cjs/Li/li.spec.cjs +0 -45
- package/dist/cjs/Li/li.spec.native.js +0 -50
- package/dist/cjs/Li/li.spec.native.js.map +0 -1
- package/dist/cjs/Markdown.stories.cjs +0 -153
- package/dist/cjs/Markdown.stories.native.js +0 -162
- package/dist/cjs/Markdown.stories.native.js.map +0 -1
- package/dist/cjs/Mdx/mdx.spec.cjs +0 -139
- package/dist/cjs/Mdx/mdx.spec.native.js +0 -158
- package/dist/cjs/Mdx/mdx.spec.native.js.map +0 -1
- package/dist/cjs/MdxCodeBlock/mdxCodeBlock.spec.cjs +0 -90
- package/dist/cjs/MdxCodeBlock/mdxCodeBlock.spec.native.js +0 -122
- package/dist/cjs/MdxCodeBlock/mdxCodeBlock.spec.native.js.map +0 -1
- package/dist/cjs/SimpleTable/index.native.js.map +0 -1
- package/dist/cjs/Ul/ul.spec.cjs +0 -150
- package/dist/cjs/Ul/ul.spec.native.js +0 -153
- package/dist/cjs/Ul/ul.spec.native.js.map +0 -1
- package/dist/cjs/hooks/useCompileAndEvaluateMdx.spec.cjs +0 -34
- package/dist/cjs/hooks/useCompileAndEvaluateMdx.spec.native.js +0 -49
- package/dist/cjs/hooks/useCompileAndEvaluateMdx.spec.native.js.map +0 -1
- package/dist/cjs/mdx.spec.cjs +0 -400
- package/dist/cjs/mdx.spec.native.js +0 -465
- package/dist/cjs/mdx.spec.native.js.map +0 -1
- package/dist/cjs/parser.spec.cjs +0 -109
- package/dist/cjs/parser.spec.native.js +0 -114
- package/dist/cjs/parser.spec.native.js.map +0 -1
- package/dist/cjs/shiki/highlighter.cjs +0 -89
- package/dist/cjs/shiki/highlighter.native.js +0 -94
- package/dist/cjs/shiki/highlighter.native.js.map +0 -1
- package/dist/cjs/util/util.spec.cjs +0 -81
- package/dist/cjs/util/util.spec.native.js +0 -84
- package/dist/cjs/util/util.spec.native.js.map +0 -1
- package/dist/esm/ExternalIcon/ExternalIcon.spec.mjs +0 -38
- package/dist/esm/ExternalIcon/ExternalIcon.spec.mjs.map +0 -1
- package/dist/esm/ExternalIcon/ExternalIcon.spec.native.js +0 -38
- package/dist/esm/ExternalIcon/ExternalIcon.spec.native.js.map +0 -1
- package/dist/esm/Hr/hr.spec.mjs +0 -22
- package/dist/esm/Hr/hr.spec.mjs.map +0 -1
- package/dist/esm/Hr/hr.spec.native.js +0 -22
- package/dist/esm/Hr/hr.spec.native.js.map +0 -1
- package/dist/esm/Li/li.spec.mjs +0 -46
- package/dist/esm/Li/li.spec.mjs.map +0 -1
- package/dist/esm/Li/li.spec.native.js +0 -48
- package/dist/esm/Li/li.spec.native.js.map +0 -1
- package/dist/esm/Markdown.stories.mjs +0 -125
- package/dist/esm/Markdown.stories.mjs.map +0 -1
- package/dist/esm/Markdown.stories.native.js +0 -131
- package/dist/esm/Markdown.stories.native.js.map +0 -1
- package/dist/esm/Mdx/mdx.spec.mjs +0 -140
- package/dist/esm/Mdx/mdx.spec.mjs.map +0 -1
- package/dist/esm/Mdx/mdx.spec.native.js +0 -156
- package/dist/esm/Mdx/mdx.spec.native.js.map +0 -1
- package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.mjs +0 -91
- package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.mjs.map +0 -1
- package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.native.js +0 -96
- package/dist/esm/MdxCodeBlock/mdxCodeBlock.spec.native.js.map +0 -1
- package/dist/esm/SimpleTable/index.mjs.map +0 -1
- package/dist/esm/SimpleTable/index.native.js.map +0 -1
- package/dist/esm/Ul/ul.spec.mjs +0 -151
- package/dist/esm/Ul/ul.spec.mjs.map +0 -1
- package/dist/esm/Ul/ul.spec.native.js +0 -151
- package/dist/esm/Ul/ul.spec.native.js.map +0 -1
- package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.mjs +0 -35
- package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.mjs.map +0 -1
- package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.native.js +0 -47
- package/dist/esm/hooks/useCompileAndEvaluateMdx.spec.native.js.map +0 -1
- package/dist/esm/mdx.spec.mjs +0 -377
- package/dist/esm/mdx.spec.mjs.map +0 -1
- package/dist/esm/mdx.spec.native.js +0 -439
- package/dist/esm/mdx.spec.native.js.map +0 -1
- package/dist/esm/parser.spec.mjs +0 -110
- package/dist/esm/parser.spec.mjs.map +0 -1
- package/dist/esm/parser.spec.native.js +0 -112
- package/dist/esm/parser.spec.native.js.map +0 -1
- package/dist/esm/shiki/highlighter.mjs +0 -59
- package/dist/esm/shiki/highlighter.mjs.map +0 -1
- package/dist/esm/shiki/highlighter.native.js +0 -61
- package/dist/esm/shiki/highlighter.native.js.map +0 -1
- package/dist/esm/util/util.spec.mjs +0 -82
- package/dist/esm/util/util.spec.mjs.map +0 -1
- package/dist/esm/util/util.spec.native.js +0 -82
- package/dist/esm/util/util.spec.native.js.map +0 -1
- package/dist/jsx/ExternalIcon/ExternalIcon.spec.mjs +0 -38
- package/dist/jsx/ExternalIcon/ExternalIcon.spec.mjs.map +0 -1
- package/dist/jsx/ExternalIcon/ExternalIcon.spec.native.js +0 -40
- package/dist/jsx/ExternalIcon/ExternalIcon.spec.native.js.map +0 -1
- package/dist/jsx/Hr/hr.spec.mjs +0 -22
- package/dist/jsx/Hr/hr.spec.mjs.map +0 -1
- package/dist/jsx/Hr/hr.spec.native.js +0 -24
- package/dist/jsx/Hr/hr.spec.native.js.map +0 -1
- package/dist/jsx/Li/li.spec.mjs +0 -46
- package/dist/jsx/Li/li.spec.mjs.map +0 -1
- package/dist/jsx/Li/li.spec.native.js +0 -50
- package/dist/jsx/Li/li.spec.native.js.map +0 -1
- package/dist/jsx/Markdown.stories.mjs +0 -125
- package/dist/jsx/Markdown.stories.mjs.map +0 -1
- package/dist/jsx/Markdown.stories.native.js +0 -162
- package/dist/jsx/Markdown.stories.native.js.map +0 -1
- package/dist/jsx/Mdx/mdx.spec.mjs +0 -140
- package/dist/jsx/Mdx/mdx.spec.mjs.map +0 -1
- package/dist/jsx/Mdx/mdx.spec.native.js +0 -158
- package/dist/jsx/Mdx/mdx.spec.native.js.map +0 -1
- package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.mjs +0 -91
- package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.mjs.map +0 -1
- package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.native.js +0 -122
- package/dist/jsx/MdxCodeBlock/mdxCodeBlock.spec.native.js.map +0 -1
- package/dist/jsx/SimpleTable/index.mjs.map +0 -1
- package/dist/jsx/SimpleTable/index.native.js.map +0 -1
- package/dist/jsx/Ul/ul.spec.mjs +0 -151
- package/dist/jsx/Ul/ul.spec.mjs.map +0 -1
- package/dist/jsx/Ul/ul.spec.native.js +0 -153
- package/dist/jsx/Ul/ul.spec.native.js.map +0 -1
- package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.mjs +0 -35
- package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.mjs.map +0 -1
- package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.native.js +0 -49
- package/dist/jsx/hooks/useCompileAndEvaluateMdx.spec.native.js.map +0 -1
- package/dist/jsx/mdx.spec.mjs +0 -377
- package/dist/jsx/mdx.spec.mjs.map +0 -1
- package/dist/jsx/mdx.spec.native.js +0 -465
- package/dist/jsx/mdx.spec.native.js.map +0 -1
- package/dist/jsx/parser.spec.mjs +0 -110
- package/dist/jsx/parser.spec.mjs.map +0 -1
- package/dist/jsx/parser.spec.native.js +0 -114
- package/dist/jsx/parser.spec.native.js.map +0 -1
- package/dist/jsx/shiki/highlighter.mjs +0 -59
- package/dist/jsx/shiki/highlighter.mjs.map +0 -1
- package/dist/jsx/shiki/highlighter.native.js +0 -94
- package/dist/jsx/shiki/highlighter.native.js.map +0 -1
- package/dist/jsx/util/util.spec.mjs +0 -82
- package/dist/jsx/util/util.spec.mjs.map +0 -1
- package/dist/jsx/util/util.spec.native.js +0 -84
- package/dist/jsx/util/util.spec.native.js.map +0 -1
- package/src/shiki/highlighter.ts +0 -148
|
@@ -2,6 +2,7 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
import { Paragraph, ScrollView, Text, useMedia } from "tamagui";
|
|
3
3
|
import { Table } from "@multiplatform.one/table-primitives";
|
|
4
4
|
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
5
|
+
import { Link } from "../components/Link";
|
|
5
6
|
|
|
6
7
|
type CellContent = ReactNode;
|
|
7
8
|
|
|
@@ -26,15 +27,15 @@ function parseCell(content: CellContent): ReactNode {
|
|
|
26
27
|
const key = `m-${matchIndex}`;
|
|
27
28
|
if (match[1]) {
|
|
28
29
|
parts.push(
|
|
29
|
-
<Text key={key} fontWeight="700"
|
|
30
|
-
{match[2]}
|
|
30
|
+
<Text key={key} fontWeight="700">
|
|
31
|
+
<Link href={match[3]}>{match[2]}</Link>
|
|
31
32
|
</Text>,
|
|
32
33
|
);
|
|
33
34
|
} else if (match[4]) {
|
|
34
35
|
parts.push(
|
|
35
|
-
<
|
|
36
|
+
<Link key={key} href={match[6]}>
|
|
36
37
|
{match[5]}
|
|
37
|
-
</
|
|
38
|
+
</Link>,
|
|
38
39
|
);
|
|
39
40
|
} else if (match[7]) {
|
|
40
41
|
parts.push(
|
|
@@ -67,28 +68,41 @@ function parseCell(content: CellContent): ReactNode {
|
|
|
67
68
|
return parts.length === 1 ? parts[0] : parts;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
export interface
|
|
71
|
+
export interface MarkdownSimpleTableProps {
|
|
71
72
|
headers: CellContent[];
|
|
72
73
|
rows: CellContent[][];
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
/**
|
|
77
|
+
* MarkdownSimpleTable — headers/rows table for markdown-ish content.
|
|
78
|
+
*
|
|
79
|
+
* Cells are ReactNodes; string cells get a mini inline-markdown pass
|
|
80
|
+
* (links, bold, inline code). Not a data table — for that use
|
|
81
|
+
* `SimpleTable` from `@multiplatform.one/table`.
|
|
82
|
+
*/
|
|
83
|
+
export function MarkdownSimpleTable({ headers, rows }: MarkdownSimpleTableProps) {
|
|
76
84
|
const { knobProps } = useResolvedKnobs();
|
|
77
85
|
const media = useMedia();
|
|
78
86
|
const isMobile = media.sm;
|
|
79
87
|
|
|
80
88
|
const table = (
|
|
81
89
|
<Table
|
|
90
|
+
render="table"
|
|
91
|
+
// Auto width/layout: a real <table> with width:100% against the
|
|
92
|
+
// scroller's indefinite width hits Chromium's 1e6px table clamp.
|
|
93
|
+
width="auto"
|
|
94
|
+
cellWidth="auto"
|
|
95
|
+
style={{ tableLayout: "auto" }}
|
|
82
96
|
borderColor="$borderColor"
|
|
83
97
|
borderRadius={knobProps.borderRadius.borderRadius}
|
|
84
98
|
alignCells={{ x: "start", y: "center" }}
|
|
85
99
|
alignHeaderCells={{ x: "start", y: "center" }}
|
|
86
100
|
{...(isMobile && { minWidth: 760 })}
|
|
87
101
|
>
|
|
88
|
-
<Table.Head>
|
|
89
|
-
<Table.Row rowLocation="first">
|
|
102
|
+
<Table.Head render="thead">
|
|
103
|
+
<Table.Row render="tr" rowLocation="first">
|
|
90
104
|
{headers.map((header, headerIdx) => (
|
|
91
|
-
<Table.HeaderCell key={`h-${headerIdx}`}>
|
|
105
|
+
<Table.HeaderCell render="th" key={`h-${headerIdx}`}>
|
|
92
106
|
<Paragraph size="$4" fontWeight="600">
|
|
93
107
|
{header}
|
|
94
108
|
</Paragraph>
|
|
@@ -96,15 +110,19 @@ export function SimpleTable({ headers, rows }: SimpleTableProps) {
|
|
|
96
110
|
))}
|
|
97
111
|
</Table.Row>
|
|
98
112
|
</Table.Head>
|
|
99
|
-
<Table.Body>
|
|
113
|
+
<Table.Body render="tbody">
|
|
100
114
|
{rows.map((row, rowIdx) => (
|
|
101
115
|
<Table.Row
|
|
116
|
+
render="tr"
|
|
102
117
|
key={`r-${rowIdx}`}
|
|
103
118
|
rowLocation={rowIdx === rows.length - 1 ? "last" : "middle"}
|
|
104
119
|
>
|
|
105
120
|
{row.map((cell, cellIdx) => (
|
|
106
|
-
<Table.Cell key={`c-${rowIdx}-${cellIdx}`}>
|
|
107
|
-
|
|
121
|
+
<Table.Cell render="td" key={`c-${rowIdx}-${cellIdx}`}>
|
|
122
|
+
{/* maxWidth caps the column's max-content contribution so long cells wrap */}
|
|
123
|
+
<Paragraph render="span" display="block" size="$4" maxWidth={480}>
|
|
124
|
+
{parseCell(cell)}
|
|
125
|
+
</Paragraph>
|
|
108
126
|
</Table.Cell>
|
|
109
127
|
))}
|
|
110
128
|
</Table.Row>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MarkdownSimpleTable contract specs — headers/rows render into real
|
|
3
|
+
* table/thead/tbody semantics, and string cells get the mini inline-markdown
|
|
4
|
+
* pass (links, bold links, bold, inline code) while element cells and plain
|
|
5
|
+
* strings pass through untouched.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
9
|
+
import { Text } from "tamagui";
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
import { MarkdownSimpleTable } from "./index";
|
|
12
|
+
|
|
13
|
+
describe("MarkdownSimpleTable", () => {
|
|
14
|
+
it("renders headers into thead and rows into tbody", () => {
|
|
15
|
+
const { container } = renderWithProviders(
|
|
16
|
+
<MarkdownSimpleTable
|
|
17
|
+
headers={["Name", "Role"]}
|
|
18
|
+
rows={[
|
|
19
|
+
["Ada", "Engineer"],
|
|
20
|
+
["Grace", "Admiral"],
|
|
21
|
+
]}
|
|
22
|
+
/>,
|
|
23
|
+
);
|
|
24
|
+
expect(container.querySelector("table")).toBeTruthy();
|
|
25
|
+
const ths = container.querySelectorAll("thead th");
|
|
26
|
+
expect(ths).toHaveLength(2);
|
|
27
|
+
expect(ths[0].textContent).toBe("Name");
|
|
28
|
+
const bodyRows = container.querySelectorAll("tbody tr");
|
|
29
|
+
expect(bodyRows).toHaveLength(2);
|
|
30
|
+
expect(bodyRows[1].querySelectorAll("td")[1].textContent).toBe("Admiral");
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("parses [label](url) cell syntax into a real link", () => {
|
|
34
|
+
const { container } = renderWithProviders(
|
|
35
|
+
<MarkdownSimpleTable
|
|
36
|
+
headers={["Docs"]}
|
|
37
|
+
rows={[["see [guide](https://example.com/guide)"]]}
|
|
38
|
+
/>,
|
|
39
|
+
);
|
|
40
|
+
const anchor = container.querySelector("tbody a");
|
|
41
|
+
expect(anchor).toBeTruthy();
|
|
42
|
+
expect(anchor!.getAttribute("href")).toBe("https://example.com/guide");
|
|
43
|
+
expect(anchor!.textContent).toBe("guide");
|
|
44
|
+
expect(container.textContent).toContain("see");
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("parses **[label](url)** into a bold link", () => {
|
|
48
|
+
const { container } = renderWithProviders(
|
|
49
|
+
<MarkdownSimpleTable headers={["Docs"]} rows={[["**[api](https://example.com/api)**"]]} />,
|
|
50
|
+
);
|
|
51
|
+
const anchor = container.querySelector("tbody a");
|
|
52
|
+
expect(anchor).toBeTruthy();
|
|
53
|
+
expect(anchor!.getAttribute("href")).toBe("https://example.com/api");
|
|
54
|
+
expect(anchor!.textContent).toBe("api");
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("parses **bold** and `code` cell fragments", () => {
|
|
58
|
+
const { container } = renderWithProviders(
|
|
59
|
+
<MarkdownSimpleTable headers={["Col"]} rows={[["a **strong** and `snippet` end"]]} />,
|
|
60
|
+
);
|
|
61
|
+
const cell = container.querySelector("tbody td");
|
|
62
|
+
expect(cell!.textContent).toBe("a strong and snippet end");
|
|
63
|
+
// Both fragments render as distinct styled spans, not raw markup.
|
|
64
|
+
expect(cell!.textContent).not.toContain("**");
|
|
65
|
+
expect(cell!.textContent).not.toContain("`");
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("leaves plain string cells untouched", () => {
|
|
69
|
+
const { container } = renderWithProviders(
|
|
70
|
+
<MarkdownSimpleTable headers={["Col"]} rows={[["just plain text"]]} />,
|
|
71
|
+
);
|
|
72
|
+
expect(container.querySelector("tbody td")!.textContent).toBe("just plain text");
|
|
73
|
+
expect(container.querySelector("tbody a")).toBeNull();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("passes ReactNode cells through without a markdown pass", () => {
|
|
77
|
+
const { getByTestId } = renderWithProviders(
|
|
78
|
+
<MarkdownSimpleTable
|
|
79
|
+
headers={["Col"]}
|
|
80
|
+
rows={[
|
|
81
|
+
[
|
|
82
|
+
<Text key="x" data-testid="element-cell">
|
|
83
|
+
**not parsed**
|
|
84
|
+
</Text>,
|
|
85
|
+
],
|
|
86
|
+
]}
|
|
87
|
+
/>,
|
|
88
|
+
);
|
|
89
|
+
// The literal asterisks survive because element cells skip parseCell.
|
|
90
|
+
expect(getByTestId("element-cell").textContent).toBe("**not parsed**");
|
|
91
|
+
});
|
|
92
|
+
});
|
package/src/Mdx/index.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useMDXComponents } from "@mdx-js/react";
|
|
2
|
+
import { ErrorBoundary } from "@multiplatform.one/components";
|
|
2
3
|
import type { DebugProp } from "@tamagui/web";
|
|
3
4
|
import type { MDXComponents } from "mdx/types";
|
|
4
5
|
import { useCompileAndEvaluateMdx } from "../hooks";
|
|
@@ -21,12 +22,16 @@ export function MDX({ children, debug, ...props }: MDXProps) {
|
|
|
21
22
|
logger.debug(code);
|
|
22
23
|
}
|
|
23
24
|
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
// contain runtime render errors (e.g. missing component mappings) so
|
|
26
|
+
// sibling content outside the MDX renderer survives
|
|
27
|
+
<ErrorBoundary>
|
|
28
|
+
<Component
|
|
29
|
+
components={{
|
|
30
|
+
...mdxComponents,
|
|
31
|
+
...components,
|
|
32
|
+
...props.components,
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
</ErrorBoundary>
|
|
31
36
|
);
|
|
32
37
|
}
|
|
@@ -11,8 +11,9 @@ import { LinearGradient } from "@tamagui/linear-gradient";
|
|
|
11
11
|
import rangeParser from "parse-numeric-range";
|
|
12
12
|
import type { ReactNode } from "react";
|
|
13
13
|
import { useContext, useMemo, useState } from "react";
|
|
14
|
-
import { Button, ScrollView,
|
|
14
|
+
import { Button, ScrollView, TooltipSimple, XStack, YStack } from "tamagui";
|
|
15
15
|
import { CheckCircleIcon, ClipboardIcon } from "../icons";
|
|
16
|
+
import { useCutoffGradientColors } from "../shared/cutoffGradient";
|
|
16
17
|
|
|
17
18
|
const zIndex = { localTop: 100 };
|
|
18
19
|
import type { MDXCodeBlockContextValue } from "./mdxCodeBlockContext";
|
|
@@ -62,6 +63,7 @@ export function MDXCodeBlock(props: MDXCodeBlockProps) {
|
|
|
62
63
|
};
|
|
63
64
|
|
|
64
65
|
const { knobProps } = useResolvedKnobs();
|
|
66
|
+
const gradientColors = useCutoffGradientColors();
|
|
65
67
|
const codeText = useMemo(() => extractCodeText(children).replace(/\n$/, ""), [children]);
|
|
66
68
|
const language = useMemo(() => extractLanguage(className), [className]);
|
|
67
69
|
const tokens = useShikiTokens(codeText, language);
|
|
@@ -90,21 +92,28 @@ export function MDXCodeBlock(props: MDXCodeBlockProps) {
|
|
|
90
92
|
})}
|
|
91
93
|
>
|
|
92
94
|
{(!isCollapsed || !isCollapsible) && isCutoff && (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
95
|
+
<>
|
|
96
|
+
<LinearGradient
|
|
97
|
+
position="absolute"
|
|
98
|
+
bottom={0}
|
|
99
|
+
left={0}
|
|
100
|
+
right={0}
|
|
101
|
+
height={200}
|
|
102
|
+
colors={gradientColors}
|
|
103
|
+
pointerEvents="none"
|
|
104
|
+
zIndex={zIndex.localTop}
|
|
105
|
+
/>
|
|
106
|
+
<XStack
|
|
107
|
+
position="absolute"
|
|
108
|
+
bottom="$4"
|
|
109
|
+
left={0}
|
|
110
|
+
right={0}
|
|
111
|
+
justifyContent="center"
|
|
112
|
+
zIndex={zIndex.localTop + 1}
|
|
113
|
+
>
|
|
114
|
+
<Button onPress={() => setIsCutoff(false)}>Show more</Button>
|
|
115
|
+
</XStack>
|
|
116
|
+
</>
|
|
108
117
|
)}
|
|
109
118
|
{(!isCollapsed || !isCollapsible) && (
|
|
110
119
|
<Pre
|
|
@@ -122,8 +131,12 @@ export function MDXCodeBlock(props: MDXCodeBlockProps) {
|
|
|
122
131
|
<Code
|
|
123
132
|
backgroundColor="transparent"
|
|
124
133
|
flex={1}
|
|
134
|
+
borderWidth={0}
|
|
135
|
+
// SP-PAD + T-VALUE via sizeToken (spec MdxCodeBlock; LC-18):
|
|
136
|
+
// inset rides the space knob, content type rides the size
|
|
137
|
+
// knob — components-CodeBlock parity. Explicit props eject.
|
|
125
138
|
{...knobProps.panelPadding}
|
|
126
|
-
size={(size ??
|
|
139
|
+
size={(size ?? knobProps.sizeToken) as any}
|
|
127
140
|
{...codeProps}
|
|
128
141
|
>
|
|
129
142
|
<HighlightedCode
|
|
@@ -137,7 +150,7 @@ export function MDXCodeBlock(props: MDXCodeBlockProps) {
|
|
|
137
150
|
</ScrollView>
|
|
138
151
|
</Pre>
|
|
139
152
|
)}
|
|
140
|
-
<XStack position="absolute" top="$3"
|
|
153
|
+
<XStack position="absolute" top="$3" insetInlineEnd="$3" {...knobProps.gap}>
|
|
141
154
|
{(!isCollapsed || !isCollapsible) && !disableCopy && (
|
|
142
155
|
<TooltipSimple label={hasCopied ? "Copied" : "Copy to clipboard"}>
|
|
143
156
|
<Button
|
|
@@ -145,7 +158,7 @@ export function MDXCodeBlock(props: MDXCodeBlockProps) {
|
|
|
145
158
|
size="$2"
|
|
146
159
|
icon={hasCopied ? <CheckCircleIcon size={14} /> : <ClipboardIcon size={14} />}
|
|
147
160
|
onPress={onCopy}
|
|
148
|
-
$xs={{
|
|
161
|
+
$max-xs={{
|
|
149
162
|
display: "none",
|
|
150
163
|
}}
|
|
151
164
|
/>
|
|
@@ -153,7 +166,7 @@ export function MDXCodeBlock(props: MDXCodeBlockProps) {
|
|
|
153
166
|
)}
|
|
154
167
|
{isCollapsible && (
|
|
155
168
|
<Button
|
|
156
|
-
|
|
169
|
+
aria-label="Show or hide code"
|
|
157
170
|
size="$2"
|
|
158
171
|
onPress={() => setIsCollapsed((x) => !x)}
|
|
159
172
|
>
|
package/src/Notice/index.tsx
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import { unwrapText } from "@multiplatform.one/components";
|
|
2
|
-
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
1
|
+
import { Alert, type AlertIntent, unwrapText } from "@multiplatform.one/components";
|
|
3
2
|
import type { ReactNode } from "react";
|
|
4
|
-
import { H3, Paragraph, XStack, YStack, styled } from "tamagui";
|
|
5
|
-
import { AlertTriangleIcon, CheckCircleIcon, InfoIcon } from "../icons";
|
|
6
3
|
|
|
7
4
|
type NoticeTheme = "yellow" | "blue" | "green" | "red";
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
default:
|
|
16
|
-
return AlertTriangleIcon;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
6
|
+
const themeIntentMap: Record<NoticeTheme, AlertIntent> = {
|
|
7
|
+
yellow: "warning",
|
|
8
|
+
blue: "info",
|
|
9
|
+
green: "success",
|
|
10
|
+
red: "error",
|
|
11
|
+
};
|
|
19
12
|
|
|
20
13
|
export interface NoticeProps {
|
|
21
14
|
children: ReactNode;
|
|
@@ -24,15 +17,7 @@ export interface NoticeProps {
|
|
|
24
17
|
title?: string;
|
|
25
18
|
}
|
|
26
19
|
|
|
27
|
-
|
|
28
|
-
name: "NoticeFrame",
|
|
29
|
-
borderWidth: 1,
|
|
30
|
-
borderColor: "$borderColor",
|
|
31
|
-
backgroundColor: "$background",
|
|
32
|
-
marginVertical: "$4",
|
|
33
|
-
position: "relative",
|
|
34
|
-
});
|
|
35
|
-
|
|
20
|
+
/** Markdown-facing callout: a thin wrapper mapping Notice themes onto Alert intents. */
|
|
36
21
|
export function Notice({
|
|
37
22
|
children,
|
|
38
23
|
theme = "yellow",
|
|
@@ -40,37 +25,10 @@ export function Notice({
|
|
|
40
25
|
title,
|
|
41
26
|
...props
|
|
42
27
|
}: NoticeProps & Record<string, unknown>) {
|
|
43
|
-
const
|
|
44
|
-
const IconComponent = getIcon(theme);
|
|
45
|
-
|
|
28
|
+
const content = disableUnwrap ? children : unwrapText(children);
|
|
46
29
|
return (
|
|
47
|
-
<
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
borderRadius={knobProps.borderRadius.borderRadius}
|
|
51
|
-
{...props}
|
|
52
|
-
>
|
|
53
|
-
<XStack {...knobProps.gap}>
|
|
54
|
-
<YStack marginTop={5}>
|
|
55
|
-
<IconComponent size={20} color="$color10" />
|
|
56
|
-
</YStack>
|
|
57
|
-
<YStack flex={1}>
|
|
58
|
-
{title && (
|
|
59
|
-
<H3 size="$5" marginBottom={-10} marginTop={5}>
|
|
60
|
-
{title}
|
|
61
|
-
</H3>
|
|
62
|
-
)}
|
|
63
|
-
<Paragraph
|
|
64
|
-
paddingVertical={knobProps.gap.gap}
|
|
65
|
-
color="$color11"
|
|
66
|
-
marginTop={-3}
|
|
67
|
-
marginBottom={-3}
|
|
68
|
-
size="$5"
|
|
69
|
-
>
|
|
70
|
-
{disableUnwrap ? children : unwrapText(children)}
|
|
71
|
-
</Paragraph>
|
|
72
|
-
</YStack>
|
|
73
|
-
</XStack>
|
|
74
|
-
</NoticeFrame>
|
|
30
|
+
<Alert intent={themeIntentMap[theme]} title={title} marginVertical="$4" {...props}>
|
|
31
|
+
{content}
|
|
32
|
+
</Alert>
|
|
75
33
|
);
|
|
76
34
|
}
|
package/src/Table/index.tsx
CHANGED
|
@@ -17,6 +17,12 @@ export function MDXTable({
|
|
|
17
17
|
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
|
18
18
|
<MDXTableFrame>
|
|
19
19
|
<BaseTable
|
|
20
|
+
render="table"
|
|
21
|
+
// Auto width/layout: a real <table> with width:100% against the
|
|
22
|
+
// scroller's indefinite width hits Chromium's 1e6px table clamp.
|
|
23
|
+
width="auto"
|
|
24
|
+
cellWidth="auto"
|
|
25
|
+
style={{ tableLayout: "auto" }}
|
|
20
26
|
borderColor="$borderColor"
|
|
21
27
|
borderRadius={knobProps.borderRadius.borderRadius}
|
|
22
28
|
alignCells={{ x: "start", y: "center" }}
|
|
@@ -34,14 +40,22 @@ export function MDXTableHead({
|
|
|
34
40
|
children,
|
|
35
41
|
...props
|
|
36
42
|
}: { children?: ReactNode } & Record<string, unknown>) {
|
|
37
|
-
return
|
|
43
|
+
return (
|
|
44
|
+
<BaseTable.Head render="thead" {...props}>
|
|
45
|
+
{children}
|
|
46
|
+
</BaseTable.Head>
|
|
47
|
+
);
|
|
38
48
|
}
|
|
39
49
|
|
|
40
50
|
export function MDXTableBody({
|
|
41
51
|
children,
|
|
42
52
|
...props
|
|
43
53
|
}: { children?: ReactNode } & Record<string, unknown>) {
|
|
44
|
-
return
|
|
54
|
+
return (
|
|
55
|
+
<BaseTable.Body render="tbody" {...props}>
|
|
56
|
+
{children}
|
|
57
|
+
</BaseTable.Body>
|
|
58
|
+
);
|
|
45
59
|
}
|
|
46
60
|
|
|
47
61
|
export function MDXTableRow({
|
|
@@ -49,7 +63,7 @@ export function MDXTableRow({
|
|
|
49
63
|
...props
|
|
50
64
|
}: { children?: ReactNode } & Record<string, unknown>) {
|
|
51
65
|
return (
|
|
52
|
-
<BaseTable.Row rowLocation="middle" {...props}>
|
|
66
|
+
<BaseTable.Row render="tr" rowLocation="middle" {...props}>
|
|
53
67
|
{children}
|
|
54
68
|
</BaseTable.Row>
|
|
55
69
|
);
|
|
@@ -60,7 +74,7 @@ export function MDXTableHeaderCell({
|
|
|
60
74
|
...props
|
|
61
75
|
}: { children?: ReactNode } & Record<string, unknown>) {
|
|
62
76
|
return (
|
|
63
|
-
<BaseTable.HeaderCell {...props}>
|
|
77
|
+
<BaseTable.HeaderCell render="th" {...props}>
|
|
64
78
|
<Paragraph size="$4" fontWeight="600">
|
|
65
79
|
{children}
|
|
66
80
|
</Paragraph>
|
|
@@ -73,8 +87,10 @@ export function MDXTableCell({
|
|
|
73
87
|
...props
|
|
74
88
|
}: { children?: ReactNode } & Record<string, unknown>) {
|
|
75
89
|
return (
|
|
76
|
-
<BaseTable.Cell {...props}>
|
|
77
|
-
<Paragraph size="$4">
|
|
90
|
+
<BaseTable.Cell render="td" {...props}>
|
|
91
|
+
<Paragraph render="span" display="block" size="$4">
|
|
92
|
+
{children}
|
|
93
|
+
</Paragraph>
|
|
78
94
|
</BaseTable.Cell>
|
|
79
95
|
);
|
|
80
96
|
}
|
package/src/Tabs/index.tsx
CHANGED
|
@@ -1,34 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MDX doc tabs.
|
|
3
|
+
*
|
|
4
|
+
* LC-16 wrapper over the canonical `Tabs` from
|
|
5
|
+
* `@multiplatform.one/components` (tamagui tablist/tab/tabpanel aria, roving
|
|
6
|
+
* focus, knob-scaled underline variant) instead of the previous hand-rolled
|
|
7
|
+
* strip. This file only owns the MDX-facing API: parallel `items` (labels)
|
|
8
|
+
* and `children` (panels) arrays, with `defaultValue` addressing a label.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { Tabs } from "@multiplatform.one/components";
|
|
1
12
|
import type { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { Paragraph, XStack, YStack, styled } from "tamagui";
|
|
4
|
-
|
|
5
|
-
const TabListFrame = styled(XStack, {
|
|
6
|
-
borderBottomWidth: 1,
|
|
7
|
-
borderBottomColor: "$borderColor",
|
|
8
|
-
marginBottom: "$3",
|
|
9
|
-
gap: "$1",
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const TabTrigger = styled(XStack, {
|
|
13
|
-
paddingHorizontal: "$4",
|
|
14
|
-
paddingVertical: "$2",
|
|
15
|
-
cursor: "pointer",
|
|
16
|
-
borderBottomWidth: 2,
|
|
17
|
-
borderBottomColor: "transparent",
|
|
18
|
-
marginBottom: -1,
|
|
19
|
-
|
|
20
|
-
hoverStyle: {
|
|
21
|
-
backgroundColor: "$color3",
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
variants: {
|
|
25
|
-
active: {
|
|
26
|
-
true: {
|
|
27
|
-
borderBottomColor: "$color10",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
} as const,
|
|
31
|
-
});
|
|
13
|
+
import { YStack } from "tamagui";
|
|
32
14
|
|
|
33
15
|
export interface MDXTabsProps {
|
|
34
16
|
items: string[];
|
|
@@ -37,32 +19,24 @@ export interface MDXTabsProps {
|
|
|
37
19
|
}
|
|
38
20
|
|
|
39
21
|
export function MDXTabs({ items, children, defaultValue }: MDXTabsProps) {
|
|
40
|
-
const [activeIndex, setActiveIndex] = useState(() => {
|
|
41
|
-
if (defaultValue) {
|
|
42
|
-
const idx = items.indexOf(defaultValue);
|
|
43
|
-
return idx >= 0 ? idx : 0;
|
|
44
|
-
}
|
|
45
|
-
return 0;
|
|
46
|
-
});
|
|
47
|
-
|
|
48
22
|
const childArray = Array.isArray(children) ? children : [children];
|
|
23
|
+
// Doc labels may repeat; index-suffixed values keep tab identity unique.
|
|
24
|
+
const values = items.map((label, index) => `${label}-${index}`);
|
|
25
|
+
const defaultIndex = defaultValue ? Math.max(items.indexOf(defaultValue), 0) : 0;
|
|
49
26
|
|
|
50
27
|
return (
|
|
51
28
|
<YStack marginVertical="$4">
|
|
52
|
-
<
|
|
53
|
-
{items.map((
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
))}
|
|
64
|
-
</TabListFrame>
|
|
65
|
-
<YStack>{childArray[activeIndex] ?? null}</YStack>
|
|
29
|
+
<Tabs
|
|
30
|
+
items={items.map((label, index) => ({
|
|
31
|
+
value: values[index]!,
|
|
32
|
+
label,
|
|
33
|
+
// Panels mount on first visit and stay mounted (lazyMount), so
|
|
34
|
+
// focus/input state inside a visited panel survives switching.
|
|
35
|
+
content: childArray[index] ?? null,
|
|
36
|
+
}))}
|
|
37
|
+
defaultValue={values[defaultIndex]}
|
|
38
|
+
lazyMount
|
|
39
|
+
/>
|
|
66
40
|
</YStack>
|
|
67
41
|
);
|
|
68
42
|
}
|
package/src/Ul/index.ts
CHANGED
package/src/Video/index.tsx
CHANGED
|
@@ -26,18 +26,21 @@ export function Video({
|
|
|
26
26
|
return (
|
|
27
27
|
<YStack render="figure" marginHorizontal={0} marginVertical="$6" {...props}>
|
|
28
28
|
{isWeb ? (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
src ? (
|
|
30
|
+
<YStack
|
|
31
|
+
render="video"
|
|
32
|
+
// @ts-expect-error HTML video attributes via render prop
|
|
33
|
+
src={src}
|
|
34
|
+
autoPlay={autoPlay}
|
|
35
|
+
playsInline
|
|
36
|
+
muted={muted}
|
|
37
|
+
controls={controls}
|
|
38
|
+
loop={loop}
|
|
39
|
+
poster={poster}
|
|
40
|
+
style={{ width: "100%", display: "block", borderRadius: 8 }}
|
|
41
|
+
/>
|
|
42
|
+
) : // omit the element entirely for an empty src (SB-M-1227)
|
|
43
|
+
null
|
|
41
44
|
) : (
|
|
42
45
|
<YStack
|
|
43
46
|
{...knobProps.panelPadding}
|
|
@@ -1,18 +1,43 @@
|
|
|
1
|
-
import { View } from "tamagui";
|
|
1
|
+
import { View, getTokens, isWeb, useTheme } from "tamagui";
|
|
2
2
|
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
3
3
|
import { markdownBlockquoteColors } from "../shared/colorRamps";
|
|
4
4
|
import type { BlockquoteProps } from "../types";
|
|
5
5
|
|
|
6
6
|
export function Blockquote({ children }: BlockquoteProps) {
|
|
7
7
|
const { knobProps } = useResolvedKnobs();
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
const padToken = knobProps.panelPadding.padding as number | string;
|
|
10
|
+
const pad =
|
|
11
|
+
typeof padToken === "number"
|
|
12
|
+
? padToken
|
|
13
|
+
: ((getTokens().space as any)?.[padToken]?.val ?? padToken);
|
|
8
14
|
return (
|
|
9
15
|
<View
|
|
10
16
|
backgroundColor={markdownBlockquoteColors.background.base}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
// R-SCALE quote frame (spec Blockquote): the painted quote surface
|
|
18
|
+
// rounds with the radius knob, capped at its own padding (Axiom 1 —
|
|
19
|
+
// containerRadius fragment). Was radius-dead (spec conformance note).
|
|
20
|
+
{...knobProps.containerRadius}
|
|
14
21
|
paddingVertical={knobProps.gap.gap}
|
|
15
22
|
marginVertical="$3"
|
|
23
|
+
// CSS logical properties keep the border and padding on the logical
|
|
24
|
+
// start side in RTL (SB-M-1215); tamagui borderStartWidth does not
|
|
25
|
+
// compile to working CSS in this version. Native uses the RN logical
|
|
26
|
+
// border/padding props, which flip with I18nManager.
|
|
27
|
+
{...(isWeb
|
|
28
|
+
? {
|
|
29
|
+
style: {
|
|
30
|
+
borderInlineStartWidth: 4,
|
|
31
|
+
borderInlineStartStyle: "solid",
|
|
32
|
+
borderInlineStartColor: theme.color8?.val ?? "#999",
|
|
33
|
+
paddingInlineStart: pad,
|
|
34
|
+
} as any,
|
|
35
|
+
}
|
|
36
|
+
: {
|
|
37
|
+
borderStartWidth: 4,
|
|
38
|
+
borderStartColor: markdownBlockquoteColors.border.base,
|
|
39
|
+
paddingStart: knobProps.panelPadding.padding,
|
|
40
|
+
})}
|
|
16
41
|
>
|
|
17
42
|
{children}
|
|
18
43
|
</View>
|