@multiplatform.one/markdown 6.4.1 → 6.4.2
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/dist/cjs/Aside/index.cjs +117 -0
- package/dist/cjs/Aside/index.native.js +126 -0
- package/dist/cjs/Aside/index.native.js.map +1 -0
- package/dist/cjs/ExternalIcon/index.cjs +48 -0
- package/dist/cjs/ExternalIcon/index.native.js +53 -0
- package/dist/cjs/ExternalIcon/index.native.js.map +1 -0
- package/dist/cjs/Hr/index.cjs +33 -0
- package/dist/cjs/Hr/index.native.js +38 -0
- package/dist/cjs/Hr/index.native.js.map +1 -0
- package/dist/cjs/Li/index.cjs +38 -0
- package/dist/cjs/Li/index.native.js +41 -0
- package/dist/cjs/Li/index.native.js.map +1 -0
- package/dist/cjs/Markdown.cjs +66 -0
- package/dist/cjs/Markdown.native.js +71 -0
- package/dist/cjs/Markdown.native.js.map +1 -0
- package/dist/cjs/MarkdownSimpleTable/index.cjs +150 -0
- package/dist/cjs/MarkdownSimpleTable/index.native.js +183 -0
- package/dist/cjs/MarkdownSimpleTable/index.native.js.map +1 -0
- package/dist/cjs/Mdx/index.cjs +66 -0
- package/dist/cjs/Mdx/index.native.js +70 -0
- package/dist/cjs/Mdx/index.native.js.map +1 -0
- package/dist/cjs/MdxCodeBlock/index.cjs +193 -0
- package/dist/cjs/MdxCodeBlock/index.native.js +216 -0
- package/dist/cjs/MdxCodeBlock/index.native.js.map +1 -0
- package/dist/cjs/MdxCodeBlock/mdxCodeBlockContext.cjs +29 -0
- package/dist/cjs/MdxCodeBlock/mdxCodeBlockContext.native.js +32 -0
- package/dist/cjs/MdxCodeBlock/mdxCodeBlockContext.native.js.map +1 -0
- package/dist/cjs/Notice/index.cjs +51 -0
- package/dist/cjs/Notice/index.native.js +55 -0
- package/dist/cjs/Notice/index.native.js.map +1 -0
- package/dist/cjs/Table/index.cjs +134 -0
- package/dist/cjs/Table/index.native.js +145 -0
- package/dist/cjs/Table/index.native.js.map +1 -0
- package/dist/cjs/Tabs/index.cjs +61 -0
- package/dist/cjs/Tabs/index.native.js +71 -0
- package/dist/cjs/Tabs/index.native.js.map +1 -0
- package/dist/cjs/Ul/index.cjs +35 -0
- package/dist/cjs/Ul/index.native.js +38 -0
- package/dist/cjs/Ul/index.native.js.map +1 -0
- package/dist/cjs/Video/index.cjs +86 -0
- package/dist/cjs/Video/index.native.js +91 -0
- package/dist/cjs/Video/index.native.js.map +1 -0
- package/dist/cjs/components/Blockquote.cjs +60 -0
- package/dist/cjs/components/Blockquote.native.js +73 -0
- package/dist/cjs/components/Blockquote.native.js.map +1 -0
- package/dist/cjs/components/Break.cjs +35 -0
- package/dist/cjs/components/Break.native.js +38 -0
- package/dist/cjs/components/Break.native.js.map +1 -0
- package/dist/cjs/components/CodeBlock.cjs +69 -0
- package/dist/cjs/components/CodeBlock.native.js +77 -0
- package/dist/cjs/components/CodeBlock.native.js.map +1 -0
- package/dist/cjs/components/Heading.cjs +71 -0
- package/dist/cjs/components/Heading.native.js +76 -0
- package/dist/cjs/components/Heading.native.js.map +1 -0
- package/dist/cjs/components/HorizontalRule.cjs +34 -0
- package/dist/cjs/components/HorizontalRule.native.js +37 -0
- package/dist/cjs/components/HorizontalRule.native.js.map +1 -0
- package/dist/cjs/components/Image.cjs +51 -0
- package/dist/cjs/components/Image.native.js +58 -0
- package/dist/cjs/components/Image.native.js.map +1 -0
- package/dist/cjs/components/InlineCode.cjs +45 -0
- package/dist/cjs/components/InlineCode.native.js +49 -0
- package/dist/cjs/components/InlineCode.native.js.map +1 -0
- package/dist/cjs/components/InlineStyles.cjs +58 -0
- package/dist/cjs/components/InlineStyles.native.js +64 -0
- package/dist/cjs/components/InlineStyles.native.js.map +1 -0
- package/dist/cjs/components/Link.cjs +71 -0
- package/dist/cjs/components/Link.native.js +76 -0
- package/dist/cjs/components/Link.native.js.map +1 -0
- package/dist/cjs/components/List.cjs +152 -0
- package/dist/cjs/components/List.native.js +161 -0
- package/dist/cjs/components/List.native.js.map +1 -0
- package/dist/cjs/components/Paragraph.cjs +43 -0
- package/dist/cjs/components/Paragraph.native.js +47 -0
- package/dist/cjs/components/Paragraph.native.js.map +1 -0
- package/dist/cjs/components/Table.cjs +119 -0
- package/dist/cjs/components/Table.native.js +134 -0
- package/dist/cjs/components/Table.native.js.map +1 -0
- package/dist/cjs/components/index.cjs +55 -0
- package/dist/cjs/components/index.native.js +58 -0
- package/dist/cjs/components/index.native.js.map +1 -0
- package/dist/cjs/hooks/index.cjs +22 -0
- package/dist/cjs/hooks/index.native.js +25 -0
- package/dist/cjs/hooks/index.native.js.map +1 -0
- package/dist/cjs/hooks/useCompileAndEvaluateMdx.cjs +42 -0
- package/dist/cjs/hooks/useCompileAndEvaluateMdx.native.js +45 -0
- package/dist/cjs/hooks/useCompileAndEvaluateMdx.native.js.map +1 -0
- package/dist/cjs/hooks/useCompileMdx.cjs +113 -0
- package/dist/cjs/hooks/useCompileMdx.native.js +135 -0
- package/dist/cjs/hooks/useCompileMdx.native.js.map +1 -0
- package/dist/cjs/hooks/useEvaluateMdx.cjs +64 -0
- package/dist/cjs/hooks/useEvaluateMdx.native.js +69 -0
- package/dist/cjs/hooks/useEvaluateMdx.native.js.map +1 -0
- package/dist/cjs/icons/index.cjs +135 -0
- package/dist/cjs/icons/index.native.js +146 -0
- package/dist/cjs/icons/index.native.js.map +1 -0
- package/dist/cjs/index.cjs +53 -0
- package/dist/cjs/index.native.js +56 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/mdxComponents.cjs +324 -0
- package/dist/cjs/mdxComponents.native.js +386 -0
- package/dist/cjs/mdxComponents.native.js.map +1 -0
- 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/parser.cjs +49 -0
- package/dist/cjs/parser.native.js +52 -0
- package/dist/cjs/parser.native.js.map +1 -0
- package/dist/cjs/renderer.cjs +334 -0
- package/dist/cjs/renderer.native.js +356 -0
- package/dist/cjs/renderer.native.js.map +1 -0
- package/dist/cjs/shared/colorRamps.cjs +64 -0
- package/dist/cjs/shared/colorRamps.native.js +67 -0
- package/dist/cjs/shared/colorRamps.native.js.map +1 -0
- 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/shared/index.cjs +20 -0
- package/dist/cjs/shared/index.native.js +23 -0
- package/dist/cjs/shared/index.native.js.map +1 -0
- package/dist/cjs/shiki/index.cjs +18 -0
- package/dist/cjs/shiki/index.native.js +21 -0
- package/dist/cjs/shiki/index.native.js.map +1 -0
- package/dist/cjs/types.cjs +18 -0
- package/dist/cjs/types.native.js +21 -0
- package/dist/cjs/types.native.js.map +1 -0
- package/dist/cjs/util/rehypeMetaAttributes.cjs +45 -0
- package/dist/cjs/util/rehypeMetaAttributes.native.js +49 -0
- package/dist/cjs/util/rehypeMetaAttributes.native.js.map +1 -0
- package/dist/esm/Aside/index.mjs +91 -0
- package/dist/esm/Aside/index.mjs.map +1 -0
- package/dist/esm/Aside/index.native.js +97 -0
- package/dist/esm/Aside/index.native.js.map +1 -0
- package/dist/esm/ExternalIcon/index.mjs +23 -0
- package/dist/esm/ExternalIcon/index.mjs.map +1 -0
- package/dist/esm/ExternalIcon/index.native.js +25 -0
- package/dist/esm/ExternalIcon/index.native.js.map +1 -0
- package/dist/esm/Hr/index.mjs +8 -0
- package/dist/esm/Hr/index.mjs.map +1 -0
- package/dist/esm/Hr/index.native.js +10 -0
- package/dist/esm/Hr/index.native.js.map +1 -0
- package/dist/esm/Li/index.mjs +13 -0
- package/dist/esm/Li/index.mjs.map +1 -0
- package/dist/esm/Li/index.native.js +13 -0
- package/dist/esm/Li/index.native.js.map +1 -0
- package/dist/esm/Markdown.mjs +41 -0
- package/dist/esm/Markdown.mjs.map +1 -0
- package/dist/esm/Markdown.native.js +43 -0
- package/dist/esm/Markdown.native.js.map +1 -0
- package/dist/esm/MarkdownSimpleTable/index.mjs +125 -0
- package/dist/esm/MarkdownSimpleTable/index.mjs.map +1 -0
- package/dist/esm/MarkdownSimpleTable/index.native.js +155 -0
- package/dist/esm/MarkdownSimpleTable/index.native.js.map +1 -0
- package/dist/esm/Mdx/index.mjs +41 -0
- package/dist/esm/Mdx/index.mjs.map +1 -0
- package/dist/esm/Mdx/index.native.js +42 -0
- package/dist/esm/Mdx/index.native.js.map +1 -0
- package/dist/esm/MdxCodeBlock/index.mjs +157 -0
- package/dist/esm/MdxCodeBlock/index.mjs.map +1 -0
- package/dist/esm/MdxCodeBlock/index.native.js +177 -0
- package/dist/esm/MdxCodeBlock/index.native.js.map +1 -0
- package/dist/esm/MdxCodeBlock/mdxCodeBlockContext.mjs +4 -0
- package/dist/esm/MdxCodeBlock/mdxCodeBlockContext.mjs.map +1 -0
- package/dist/esm/MdxCodeBlock/mdxCodeBlockContext.native.js +4 -0
- package/dist/esm/MdxCodeBlock/mdxCodeBlockContext.native.js.map +1 -0
- package/dist/esm/Notice/index.mjs +26 -0
- package/dist/esm/Notice/index.mjs.map +1 -0
- package/dist/esm/Notice/index.native.js +27 -0
- package/dist/esm/Notice/index.native.js.map +1 -0
- package/dist/esm/Table/index.mjs +104 -0
- package/dist/esm/Table/index.mjs.map +1 -0
- package/dist/esm/Table/index.native.js +112 -0
- package/dist/esm/Table/index.native.js.map +1 -0
- package/dist/esm/Tabs/index.mjs +35 -0
- package/dist/esm/Tabs/index.mjs.map +1 -0
- package/dist/esm/Tabs/index.native.js +42 -0
- package/dist/esm/Tabs/index.native.js.map +1 -0
- package/dist/esm/Ul/index.mjs +10 -0
- package/dist/esm/Ul/index.mjs.map +1 -0
- package/dist/esm/Ul/index.native.js +10 -0
- package/dist/esm/Ul/index.native.js.map +1 -0
- package/dist/esm/Video/index.mjs +61 -0
- package/dist/esm/Video/index.mjs.map +1 -0
- package/dist/esm/Video/index.native.js +63 -0
- package/dist/esm/Video/index.native.js.map +1 -0
- package/dist/esm/components/Blockquote.mjs +35 -0
- package/dist/esm/components/Blockquote.mjs.map +1 -0
- package/dist/esm/components/Blockquote.native.js +45 -0
- package/dist/esm/components/Blockquote.native.js.map +1 -0
- package/dist/esm/components/Break.mjs +10 -0
- package/dist/esm/components/Break.mjs.map +1 -0
- package/dist/esm/components/Break.native.js +10 -0
- package/dist/esm/components/Break.native.js.map +1 -0
- package/dist/esm/components/CodeBlock.mjs +44 -0
- package/dist/esm/components/CodeBlock.mjs.map +1 -0
- package/dist/esm/components/CodeBlock.native.js +49 -0
- package/dist/esm/components/CodeBlock.native.js.map +1 -0
- package/dist/esm/components/Heading.mjs +46 -0
- package/dist/esm/components/Heading.mjs.map +1 -0
- package/dist/esm/components/Heading.native.js +48 -0
- package/dist/esm/components/Heading.native.js.map +1 -0
- package/dist/esm/components/HorizontalRule.mjs +9 -0
- package/dist/esm/components/HorizontalRule.mjs.map +1 -0
- package/dist/esm/components/HorizontalRule.native.js +9 -0
- package/dist/esm/components/HorizontalRule.native.js.map +1 -0
- package/dist/esm/components/Image.mjs +26 -0
- package/dist/esm/components/Image.mjs.map +1 -0
- package/dist/esm/components/Image.native.js +30 -0
- package/dist/esm/components/Image.native.js.map +1 -0
- package/dist/esm/components/InlineCode.mjs +20 -0
- package/dist/esm/components/InlineCode.mjs.map +1 -0
- package/dist/esm/components/InlineCode.native.js +21 -0
- package/dist/esm/components/InlineCode.native.js.map +1 -0
- package/dist/esm/components/InlineStyles.mjs +31 -0
- package/dist/esm/components/InlineStyles.mjs.map +1 -0
- package/dist/esm/components/InlineStyles.native.js +34 -0
- package/dist/esm/components/InlineStyles.native.js.map +1 -0
- package/dist/esm/components/Link.mjs +46 -0
- package/dist/esm/components/Link.mjs.map +1 -0
- package/dist/esm/components/Link.native.js +48 -0
- package/dist/esm/components/Link.native.js.map +1 -0
- package/dist/esm/components/List.mjs +126 -0
- package/dist/esm/components/List.mjs.map +1 -0
- package/dist/esm/components/List.native.js +132 -0
- package/dist/esm/components/List.native.js.map +1 -0
- package/dist/esm/components/Paragraph.mjs +18 -0
- package/dist/esm/components/Paragraph.mjs.map +1 -0
- package/dist/esm/components/Paragraph.native.js +19 -0
- package/dist/esm/components/Paragraph.native.js.map +1 -0
- package/dist/esm/components/Table.mjs +92 -0
- package/dist/esm/components/Table.mjs.map +1 -0
- package/dist/esm/components/Table.native.js +104 -0
- package/dist/esm/components/Table.native.js.map +1 -0
- package/dist/esm/components/index.mjs +14 -0
- package/dist/esm/components/index.mjs.map +1 -0
- package/dist/esm/components/index.native.js +14 -0
- package/dist/esm/components/index.native.js.map +1 -0
- package/dist/esm/hooks/index.mjs +4 -0
- package/dist/esm/hooks/index.mjs.map +1 -0
- package/dist/esm/hooks/index.native.js +4 -0
- package/dist/esm/hooks/index.native.js.map +1 -0
- package/dist/esm/hooks/useCompileAndEvaluateMdx.mjs +17 -0
- package/dist/esm/hooks/useCompileAndEvaluateMdx.mjs.map +1 -0
- package/dist/esm/hooks/useCompileAndEvaluateMdx.native.js +17 -0
- package/dist/esm/hooks/useCompileAndEvaluateMdx.native.js.map +1 -0
- package/dist/esm/hooks/useCompileMdx.mjs +76 -0
- package/dist/esm/hooks/useCompileMdx.mjs.map +1 -0
- package/dist/esm/hooks/useCompileMdx.native.js +95 -0
- package/dist/esm/hooks/useCompileMdx.native.js.map +1 -0
- package/dist/esm/hooks/useEvaluateMdx.mjs +28 -0
- package/dist/esm/hooks/useEvaluateMdx.mjs.map +1 -0
- package/dist/esm/hooks/useEvaluateMdx.native.js +30 -0
- package/dist/esm/hooks/useEvaluateMdx.native.js.map +1 -0
- package/dist/esm/icons/index.mjs +107 -0
- package/dist/esm/icons/index.mjs.map +1 -0
- package/dist/esm/icons/index.native.js +115 -0
- package/dist/esm/icons/index.native.js.map +1 -0
- package/dist/esm/index.mjs +23 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +23 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/mdxComponents.mjs +298 -0
- package/dist/esm/mdxComponents.mjs.map +1 -0
- package/dist/esm/mdxComponents.native.js +357 -0
- package/dist/esm/mdxComponents.native.js.map +1 -0
- 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/parser.mjs +12 -0
- package/dist/esm/parser.mjs.map +1 -0
- package/dist/esm/parser.native.js +12 -0
- package/dist/esm/parser.native.js.map +1 -0
- package/dist/esm/renderer.mjs +308 -0
- package/dist/esm/renderer.mjs.map +1 -0
- package/dist/esm/renderer.native.js +327 -0
- package/dist/esm/renderer.native.js.map +1 -0
- package/dist/esm/shared/colorRamps.mjs +36 -0
- package/dist/esm/shared/colorRamps.mjs.map +1 -0
- package/dist/esm/shared/colorRamps.native.js +36 -0
- package/dist/esm/shared/colorRamps.native.js.map +1 -0
- 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/shared/index.mjs +2 -0
- package/dist/esm/shared/index.mjs.map +1 -0
- package/dist/esm/shared/index.native.js +2 -0
- package/dist/esm/shared/index.native.js.map +1 -0
- package/dist/esm/shiki/index.mjs +2 -0
- package/dist/esm/shiki/index.mjs.map +1 -0
- package/dist/esm/shiki/index.native.js +2 -0
- package/dist/esm/shiki/index.native.js.map +1 -0
- package/dist/esm/types.mjs +2 -0
- package/dist/esm/types.mjs.map +1 -0
- package/dist/esm/types.native.js +2 -0
- package/dist/esm/types.native.js.map +1 -0
- package/dist/esm/util/rehypeMetaAttributes.mjs +20 -0
- package/dist/esm/util/rehypeMetaAttributes.mjs.map +1 -0
- package/dist/esm/util/rehypeMetaAttributes.native.js +21 -0
- package/dist/esm/util/rehypeMetaAttributes.native.js.map +1 -0
- package/dist/jsx/Aside/index.mjs +91 -0
- package/dist/jsx/Aside/index.mjs.map +1 -0
- package/dist/jsx/Aside/index.native.js +126 -0
- package/dist/jsx/Aside/index.native.js.map +1 -0
- package/dist/jsx/ExternalIcon/index.mjs +23 -0
- package/dist/jsx/ExternalIcon/index.mjs.map +1 -0
- package/dist/jsx/ExternalIcon/index.native.js +53 -0
- package/dist/jsx/ExternalIcon/index.native.js.map +1 -0
- package/dist/jsx/Hr/index.mjs +8 -0
- package/dist/jsx/Hr/index.mjs.map +1 -0
- package/dist/jsx/Hr/index.native.js +38 -0
- package/dist/jsx/Hr/index.native.js.map +1 -0
- package/dist/jsx/Li/index.mjs +13 -0
- package/dist/jsx/Li/index.mjs.map +1 -0
- package/dist/jsx/Li/index.native.js +41 -0
- package/dist/jsx/Li/index.native.js.map +1 -0
- package/dist/jsx/Markdown.mjs +41 -0
- package/dist/jsx/Markdown.mjs.map +1 -0
- package/dist/jsx/Markdown.native.js +71 -0
- package/dist/jsx/Markdown.native.js.map +1 -0
- package/dist/jsx/MarkdownSimpleTable/index.mjs +125 -0
- package/dist/jsx/MarkdownSimpleTable/index.mjs.map +1 -0
- package/dist/jsx/MarkdownSimpleTable/index.native.js +183 -0
- package/dist/jsx/MarkdownSimpleTable/index.native.js.map +1 -0
- package/dist/jsx/Mdx/index.mjs +41 -0
- package/dist/jsx/Mdx/index.mjs.map +1 -0
- package/dist/jsx/Mdx/index.native.js +70 -0
- package/dist/jsx/Mdx/index.native.js.map +1 -0
- package/dist/jsx/MdxCodeBlock/index.mjs +157 -0
- package/dist/jsx/MdxCodeBlock/index.mjs.map +1 -0
- package/dist/jsx/MdxCodeBlock/index.native.js +216 -0
- package/dist/jsx/MdxCodeBlock/index.native.js.map +1 -0
- package/dist/jsx/MdxCodeBlock/mdxCodeBlockContext.mjs +4 -0
- package/dist/jsx/MdxCodeBlock/mdxCodeBlockContext.mjs.map +1 -0
- package/dist/jsx/MdxCodeBlock/mdxCodeBlockContext.native.js +32 -0
- package/dist/jsx/MdxCodeBlock/mdxCodeBlockContext.native.js.map +1 -0
- package/dist/jsx/Notice/index.mjs +26 -0
- package/dist/jsx/Notice/index.mjs.map +1 -0
- package/dist/jsx/Notice/index.native.js +55 -0
- package/dist/jsx/Notice/index.native.js.map +1 -0
- package/dist/jsx/Table/index.mjs +104 -0
- package/dist/jsx/Table/index.mjs.map +1 -0
- package/dist/jsx/Table/index.native.js +145 -0
- package/dist/jsx/Table/index.native.js.map +1 -0
- package/dist/jsx/Tabs/index.mjs +35 -0
- package/dist/jsx/Tabs/index.mjs.map +1 -0
- package/dist/jsx/Tabs/index.native.js +71 -0
- package/dist/jsx/Tabs/index.native.js.map +1 -0
- package/dist/jsx/Ul/index.mjs +10 -0
- package/dist/jsx/Ul/index.mjs.map +1 -0
- package/dist/jsx/Ul/index.native.js +38 -0
- package/dist/jsx/Ul/index.native.js.map +1 -0
- package/dist/jsx/Video/index.mjs +61 -0
- package/dist/jsx/Video/index.mjs.map +1 -0
- package/dist/jsx/Video/index.native.js +91 -0
- package/dist/jsx/Video/index.native.js.map +1 -0
- package/dist/jsx/components/Blockquote.mjs +35 -0
- package/dist/jsx/components/Blockquote.mjs.map +1 -0
- package/dist/jsx/components/Blockquote.native.js +73 -0
- package/dist/jsx/components/Blockquote.native.js.map +1 -0
- package/dist/jsx/components/Break.mjs +10 -0
- package/dist/jsx/components/Break.mjs.map +1 -0
- package/dist/jsx/components/Break.native.js +38 -0
- package/dist/jsx/components/Break.native.js.map +1 -0
- package/dist/jsx/components/CodeBlock.mjs +44 -0
- package/dist/jsx/components/CodeBlock.mjs.map +1 -0
- package/dist/jsx/components/CodeBlock.native.js +77 -0
- package/dist/jsx/components/CodeBlock.native.js.map +1 -0
- package/dist/jsx/components/Heading.mjs +46 -0
- package/dist/jsx/components/Heading.mjs.map +1 -0
- package/dist/jsx/components/Heading.native.js +76 -0
- package/dist/jsx/components/Heading.native.js.map +1 -0
- package/dist/jsx/components/HorizontalRule.mjs +9 -0
- package/dist/jsx/components/HorizontalRule.mjs.map +1 -0
- package/dist/jsx/components/HorizontalRule.native.js +37 -0
- package/dist/jsx/components/HorizontalRule.native.js.map +1 -0
- package/dist/jsx/components/Image.mjs +26 -0
- package/dist/jsx/components/Image.mjs.map +1 -0
- package/dist/jsx/components/Image.native.js +58 -0
- package/dist/jsx/components/Image.native.js.map +1 -0
- package/dist/jsx/components/InlineCode.mjs +20 -0
- package/dist/jsx/components/InlineCode.mjs.map +1 -0
- package/dist/jsx/components/InlineCode.native.js +49 -0
- package/dist/jsx/components/InlineCode.native.js.map +1 -0
- package/dist/jsx/components/InlineStyles.mjs +31 -0
- package/dist/jsx/components/InlineStyles.mjs.map +1 -0
- package/dist/jsx/components/InlineStyles.native.js +64 -0
- package/dist/jsx/components/InlineStyles.native.js.map +1 -0
- package/dist/jsx/components/Link.mjs +46 -0
- package/dist/jsx/components/Link.mjs.map +1 -0
- package/dist/jsx/components/Link.native.js +76 -0
- package/dist/jsx/components/Link.native.js.map +1 -0
- package/dist/jsx/components/List.mjs +126 -0
- package/dist/jsx/components/List.mjs.map +1 -0
- package/dist/jsx/components/List.native.js +161 -0
- package/dist/jsx/components/List.native.js.map +1 -0
- package/dist/jsx/components/Paragraph.mjs +18 -0
- package/dist/jsx/components/Paragraph.mjs.map +1 -0
- package/dist/jsx/components/Paragraph.native.js +47 -0
- package/dist/jsx/components/Paragraph.native.js.map +1 -0
- package/dist/jsx/components/Table.mjs +92 -0
- package/dist/jsx/components/Table.mjs.map +1 -0
- package/dist/jsx/components/Table.native.js +134 -0
- package/dist/jsx/components/Table.native.js.map +1 -0
- package/dist/jsx/components/index.mjs +14 -0
- package/dist/jsx/components/index.mjs.map +1 -0
- package/dist/jsx/components/index.native.js +58 -0
- package/dist/jsx/components/index.native.js.map +1 -0
- package/dist/jsx/hooks/index.mjs +4 -0
- package/dist/jsx/hooks/index.mjs.map +1 -0
- package/dist/jsx/hooks/index.native.js +25 -0
- package/dist/jsx/hooks/index.native.js.map +1 -0
- package/dist/jsx/hooks/useCompileAndEvaluateMdx.mjs +17 -0
- package/dist/jsx/hooks/useCompileAndEvaluateMdx.mjs.map +1 -0
- package/dist/jsx/hooks/useCompileAndEvaluateMdx.native.js +45 -0
- package/dist/jsx/hooks/useCompileAndEvaluateMdx.native.js.map +1 -0
- package/dist/jsx/hooks/useCompileMdx.mjs +76 -0
- package/dist/jsx/hooks/useCompileMdx.mjs.map +1 -0
- package/dist/jsx/hooks/useCompileMdx.native.js +135 -0
- package/dist/jsx/hooks/useCompileMdx.native.js.map +1 -0
- package/dist/jsx/hooks/useEvaluateMdx.mjs +28 -0
- package/dist/jsx/hooks/useEvaluateMdx.mjs.map +1 -0
- package/dist/jsx/hooks/useEvaluateMdx.native.js +69 -0
- package/dist/jsx/hooks/useEvaluateMdx.native.js.map +1 -0
- package/dist/jsx/icons/index.mjs +107 -0
- package/dist/jsx/icons/index.mjs.map +1 -0
- package/dist/jsx/icons/index.native.js +146 -0
- package/dist/jsx/icons/index.native.js.map +1 -0
- package/dist/jsx/index.js +23 -0
- package/dist/jsx/index.js.map +1 -0
- package/dist/jsx/index.mjs +23 -0
- package/dist/jsx/index.mjs.map +1 -0
- package/dist/jsx/index.native.js +56 -0
- package/dist/jsx/index.native.js.map +1 -0
- package/dist/jsx/mdxComponents.mjs +298 -0
- package/dist/jsx/mdxComponents.mjs.map +1 -0
- package/dist/jsx/mdxComponents.native.js +386 -0
- package/dist/jsx/mdxComponents.native.js.map +1 -0
- 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/parser.mjs +12 -0
- package/dist/jsx/parser.mjs.map +1 -0
- package/dist/jsx/parser.native.js +52 -0
- package/dist/jsx/parser.native.js.map +1 -0
- package/dist/jsx/renderer.mjs +308 -0
- package/dist/jsx/renderer.mjs.map +1 -0
- package/dist/jsx/renderer.native.js +356 -0
- package/dist/jsx/renderer.native.js.map +1 -0
- package/dist/jsx/shared/colorRamps.mjs +36 -0
- package/dist/jsx/shared/colorRamps.mjs.map +1 -0
- package/dist/jsx/shared/colorRamps.native.js +67 -0
- package/dist/jsx/shared/colorRamps.native.js.map +1 -0
- 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/shared/index.mjs +2 -0
- package/dist/jsx/shared/index.mjs.map +1 -0
- package/dist/jsx/shared/index.native.js +23 -0
- package/dist/jsx/shared/index.native.js.map +1 -0
- package/dist/jsx/shiki/index.mjs +2 -0
- package/dist/jsx/shiki/index.mjs.map +1 -0
- package/dist/jsx/shiki/index.native.js +21 -0
- package/dist/jsx/shiki/index.native.js.map +1 -0
- package/dist/jsx/types.mjs +2 -0
- package/dist/jsx/types.mjs.map +1 -0
- package/dist/jsx/types.native.js +21 -0
- package/dist/jsx/types.native.js.map +1 -0
- package/dist/jsx/util/rehypeMetaAttributes.mjs +20 -0
- package/dist/jsx/util/rehypeMetaAttributes.mjs.map +1 -0
- package/dist/jsx/util/rehypeMetaAttributes.native.js +49 -0
- package/dist/jsx/util/rehypeMetaAttributes.native.js.map +1 -0
- package/package.json +9 -9
- 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
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var MarkdownSimpleTable_exports = {};
|
|
24
|
+
__export(MarkdownSimpleTable_exports, {
|
|
25
|
+
MarkdownSimpleTable: () => MarkdownSimpleTable
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(MarkdownSimpleTable_exports);
|
|
28
|
+
var import_tamagui = require("tamagui");
|
|
29
|
+
var import_table_primitives = require("@multiplatform.one/table-primitives");
|
|
30
|
+
var import_theme = require("@multiplatform.one/theme");
|
|
31
|
+
var import_Link = require("../components/Link.cjs");
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
const markdownPattern = /(\*\*\[([^\]]+)\]\(([^)]+)\)\*\*)|(\[([^\]]+)\]\(([^)]+)\))|(\*\*([^*]+)\*\*)|(`([^`]+)`)/g;
|
|
34
|
+
function parseCell(content) {
|
|
35
|
+
if (typeof content !== "string") return content;
|
|
36
|
+
const matches = [...content.matchAll(markdownPattern)];
|
|
37
|
+
if (!matches.length) return content;
|
|
38
|
+
const parts = [];
|
|
39
|
+
let lastIndex = 0;
|
|
40
|
+
for (const match of matches) {
|
|
41
|
+
const matchIndex = match.index ?? 0;
|
|
42
|
+
if (matchIndex > lastIndex) {
|
|
43
|
+
parts.push(content.slice(lastIndex, matchIndex));
|
|
44
|
+
}
|
|
45
|
+
const key = `m-${matchIndex}`;
|
|
46
|
+
if (match[1]) {
|
|
47
|
+
parts.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
48
|
+
fontWeight: "700",
|
|
49
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Link.Link, {
|
|
50
|
+
href: match[3],
|
|
51
|
+
children: match[2]
|
|
52
|
+
})
|
|
53
|
+
}, key));
|
|
54
|
+
} else if (match[4]) {
|
|
55
|
+
parts.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Link.Link, {
|
|
56
|
+
href: match[6],
|
|
57
|
+
children: match[5]
|
|
58
|
+
}, key));
|
|
59
|
+
} else if (match[7]) {
|
|
60
|
+
parts.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
61
|
+
fontWeight: "700",
|
|
62
|
+
children: match[8]
|
|
63
|
+
}, key));
|
|
64
|
+
} else if (match[9]) {
|
|
65
|
+
parts.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
66
|
+
fontFamily: "$mono",
|
|
67
|
+
backgroundColor: "$color4",
|
|
68
|
+
paddingHorizontal: "$1.5",
|
|
69
|
+
paddingVertical: "$0.5",
|
|
70
|
+
borderRadius: "$2",
|
|
71
|
+
children: match[10]
|
|
72
|
+
}, key));
|
|
73
|
+
}
|
|
74
|
+
lastIndex = matchIndex + match[0].length;
|
|
75
|
+
}
|
|
76
|
+
if (lastIndex < content.length) {
|
|
77
|
+
parts.push(content.slice(lastIndex));
|
|
78
|
+
}
|
|
79
|
+
return parts.length === 1 ? parts[0] : parts;
|
|
80
|
+
}
|
|
81
|
+
function MarkdownSimpleTable({
|
|
82
|
+
headers,
|
|
83
|
+
rows
|
|
84
|
+
}) {
|
|
85
|
+
const {
|
|
86
|
+
knobProps
|
|
87
|
+
} = (0, import_theme.useResolvedKnobs)();
|
|
88
|
+
const media = (0, import_tamagui.useMedia)();
|
|
89
|
+
const isMobile = media.sm;
|
|
90
|
+
const table = /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_table_primitives.Table, {
|
|
91
|
+
render: "table",
|
|
92
|
+
width: "auto",
|
|
93
|
+
cellWidth: "auto",
|
|
94
|
+
style: {
|
|
95
|
+
tableLayout: "auto"
|
|
96
|
+
},
|
|
97
|
+
borderColor: "$borderColor",
|
|
98
|
+
borderRadius: knobProps.borderRadius.borderRadius,
|
|
99
|
+
alignCells: {
|
|
100
|
+
x: "start",
|
|
101
|
+
y: "center"
|
|
102
|
+
},
|
|
103
|
+
alignHeaderCells: {
|
|
104
|
+
x: "start",
|
|
105
|
+
y: "center"
|
|
106
|
+
},
|
|
107
|
+
...(isMobile && {
|
|
108
|
+
minWidth: 760
|
|
109
|
+
}),
|
|
110
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.Head, {
|
|
111
|
+
render: "thead",
|
|
112
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.Row, {
|
|
113
|
+
render: "tr",
|
|
114
|
+
rowLocation: "first",
|
|
115
|
+
children: headers.map((header, headerIdx) => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.HeaderCell, {
|
|
116
|
+
render: "th",
|
|
117
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, {
|
|
118
|
+
size: "$4",
|
|
119
|
+
fontWeight: "600",
|
|
120
|
+
children: header
|
|
121
|
+
})
|
|
122
|
+
}, `h-${headerIdx}`))
|
|
123
|
+
})
|
|
124
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.Body, {
|
|
125
|
+
render: "tbody",
|
|
126
|
+
children: rows.map((row, rowIdx) => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.Row, {
|
|
127
|
+
render: "tr",
|
|
128
|
+
rowLocation: rowIdx === rows.length - 1 ? "last" : "middle",
|
|
129
|
+
children: row.map((cell, cellIdx) => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.Cell, {
|
|
130
|
+
render: "td",
|
|
131
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, {
|
|
132
|
+
render: "span",
|
|
133
|
+
display: "block",
|
|
134
|
+
size: "$4",
|
|
135
|
+
maxWidth: 480,
|
|
136
|
+
children: parseCell(cell)
|
|
137
|
+
})
|
|
138
|
+
}, `c-${rowIdx}-${cellIdx}`))
|
|
139
|
+
}, `r-${rowIdx}`))
|
|
140
|
+
})]
|
|
141
|
+
});
|
|
142
|
+
if (isMobile) {
|
|
143
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.ScrollView, {
|
|
144
|
+
horizontal: true,
|
|
145
|
+
showsHorizontalScrollIndicator: false,
|
|
146
|
+
children: table
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return table;
|
|
150
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var MarkdownSimpleTable_exports = {};
|
|
26
|
+
__export(MarkdownSimpleTable_exports, {
|
|
27
|
+
MarkdownSimpleTable: () => MarkdownSimpleTable
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(MarkdownSimpleTable_exports);
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var import_tamagui = require("tamagui");
|
|
32
|
+
var import_table_primitives = require("@multiplatform.one/table-primitives");
|
|
33
|
+
var import_theme = require("@multiplatform.one/theme");
|
|
34
|
+
var import_Link = require("../components/Link.native.js");
|
|
35
|
+
var markdownPattern = /(\*\*\[([^\]]+)\]\(([^)]+)\)\*\*)|(\[([^\]]+)\]\(([^)]+)\))|(\*\*([^*]+)\*\*)|(`([^`]+)`)/g;
|
|
36
|
+
function parseCell(content) {
|
|
37
|
+
if (typeof content !== "string") return content;
|
|
38
|
+
var matches = [...content.matchAll(markdownPattern)];
|
|
39
|
+
if (!matches.length) return content;
|
|
40
|
+
var parts = [];
|
|
41
|
+
var lastIndex = 0;
|
|
42
|
+
var _iteratorNormalCompletion = true,
|
|
43
|
+
_didIteratorError = false,
|
|
44
|
+
_iteratorError = void 0;
|
|
45
|
+
try {
|
|
46
|
+
for (var _iterator = matches[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
47
|
+
var match = _step.value;
|
|
48
|
+
var _match_index;
|
|
49
|
+
var matchIndex = (_match_index = match.index) !== null && _match_index !== void 0 ? _match_index : 0;
|
|
50
|
+
if (matchIndex > lastIndex) {
|
|
51
|
+
parts.push(content.slice(lastIndex, matchIndex));
|
|
52
|
+
}
|
|
53
|
+
var key = `m-${matchIndex}`;
|
|
54
|
+
if (match[1]) {
|
|
55
|
+
parts.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
56
|
+
fontWeight: "700",
|
|
57
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Link.Link, {
|
|
58
|
+
href: match[3],
|
|
59
|
+
children: match[2]
|
|
60
|
+
})
|
|
61
|
+
}, key));
|
|
62
|
+
} else if (match[4]) {
|
|
63
|
+
parts.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Link.Link, {
|
|
64
|
+
href: match[6],
|
|
65
|
+
children: match[5]
|
|
66
|
+
}, key));
|
|
67
|
+
} else if (match[7]) {
|
|
68
|
+
parts.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
69
|
+
fontWeight: "700",
|
|
70
|
+
children: match[8]
|
|
71
|
+
}, key));
|
|
72
|
+
} else if (match[9]) {
|
|
73
|
+
parts.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
74
|
+
fontFamily: "$mono",
|
|
75
|
+
backgroundColor: "$color4",
|
|
76
|
+
paddingHorizontal: "$1.5",
|
|
77
|
+
paddingVertical: "$0.5",
|
|
78
|
+
borderRadius: "$2",
|
|
79
|
+
children: match[10]
|
|
80
|
+
}, key));
|
|
81
|
+
}
|
|
82
|
+
lastIndex = matchIndex + match[0].length;
|
|
83
|
+
}
|
|
84
|
+
} catch (err) {
|
|
85
|
+
_didIteratorError = true;
|
|
86
|
+
_iteratorError = err;
|
|
87
|
+
} finally {
|
|
88
|
+
try {
|
|
89
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
90
|
+
_iterator.return();
|
|
91
|
+
}
|
|
92
|
+
} finally {
|
|
93
|
+
if (_didIteratorError) {
|
|
94
|
+
throw _iteratorError;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (lastIndex < content.length) {
|
|
99
|
+
parts.push(content.slice(lastIndex));
|
|
100
|
+
}
|
|
101
|
+
return parts.length === 1 ? parts[0] : parts;
|
|
102
|
+
}
|
|
103
|
+
function MarkdownSimpleTable(param) {
|
|
104
|
+
var {
|
|
105
|
+
headers,
|
|
106
|
+
rows
|
|
107
|
+
} = param;
|
|
108
|
+
var {
|
|
109
|
+
knobProps
|
|
110
|
+
} = (0, import_theme.useResolvedKnobs)();
|
|
111
|
+
var media = (0, import_tamagui.useMedia)();
|
|
112
|
+
var isMobile = media.sm;
|
|
113
|
+
var table = /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_table_primitives.Table, {
|
|
114
|
+
render: "table",
|
|
115
|
+
// Auto width/layout: a real <table> with width:100% against the
|
|
116
|
+
// scroller's indefinite width hits Chromium's 1e6px table clamp.
|
|
117
|
+
width: "auto",
|
|
118
|
+
cellWidth: "auto",
|
|
119
|
+
style: {
|
|
120
|
+
tableLayout: "auto"
|
|
121
|
+
},
|
|
122
|
+
borderColor: "$borderColor",
|
|
123
|
+
borderRadius: knobProps.borderRadius.borderRadius,
|
|
124
|
+
alignCells: {
|
|
125
|
+
x: "start",
|
|
126
|
+
y: "center"
|
|
127
|
+
},
|
|
128
|
+
alignHeaderCells: {
|
|
129
|
+
x: "start",
|
|
130
|
+
y: "center"
|
|
131
|
+
},
|
|
132
|
+
...(isMobile && {
|
|
133
|
+
minWidth: 760
|
|
134
|
+
}),
|
|
135
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.Head, {
|
|
136
|
+
render: "thead",
|
|
137
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.Row, {
|
|
138
|
+
render: "tr",
|
|
139
|
+
rowLocation: "first",
|
|
140
|
+
children: headers.map(function (header, headerIdx) {
|
|
141
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.HeaderCell, {
|
|
142
|
+
render: "th",
|
|
143
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, {
|
|
144
|
+
size: "$4",
|
|
145
|
+
fontWeight: "600",
|
|
146
|
+
children: header
|
|
147
|
+
})
|
|
148
|
+
}, `h-${headerIdx}`);
|
|
149
|
+
})
|
|
150
|
+
})
|
|
151
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.Body, {
|
|
152
|
+
render: "tbody",
|
|
153
|
+
children: rows.map(function (row, rowIdx) {
|
|
154
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.Row, {
|
|
155
|
+
render: "tr",
|
|
156
|
+
rowLocation: rowIdx === rows.length - 1 ? "last" : "middle",
|
|
157
|
+
children: row.map(function (cell, cellIdx) {
|
|
158
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_table_primitives.Table.Cell, {
|
|
159
|
+
render: "td",
|
|
160
|
+
children: (/* maxWidth caps the column's max-content contribution so long cells wrap */
|
|
161
|
+
/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, {
|
|
162
|
+
render: "span",
|
|
163
|
+
display: "block",
|
|
164
|
+
size: "$4",
|
|
165
|
+
maxWidth: 480,
|
|
166
|
+
children: parseCell(cell)
|
|
167
|
+
}))
|
|
168
|
+
}, `c-${rowIdx}-${cellIdx}`);
|
|
169
|
+
})
|
|
170
|
+
}, `r-${rowIdx}`);
|
|
171
|
+
})
|
|
172
|
+
})]
|
|
173
|
+
});
|
|
174
|
+
if (isMobile) {
|
|
175
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.ScrollView, {
|
|
176
|
+
horizontal: true,
|
|
177
|
+
showsHorizontalScrollIndicator: false,
|
|
178
|
+
children: table
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
return table;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","MarkdownSimpleTable_exports","__export","MarkdownSimpleTable","module","exports","import_jsx_runtime","require","import_tamagui","import_table_primitives","import_theme","import_Link","markdownPattern","parseCell","content","matches","matchAll","length","parts","lastIndex","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","match","_match_index","matchIndex","index","push","slice","key","jsx","Text","fontWeight","children","Link","href","fontFamily","backgroundColor","paddingHorizontal","paddingVertical","borderRadius","err","return","param","headers","rows","knobProps","useResolvedKnobs","media","useMedia","isMobile","sm","table","jsxs","Table","render","width","cellWidth","style","tableLayout"],"sources":["../../../src/MarkdownSimpleTable/index.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,2BAAA;AAAAC,QAAA,CAAAD,2BAAA;EAAAE,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAT,YAAsD,CAAAK,2BAAA;AACtD,IAAAK,kBAAA,GAAAC,OAAsB;AACtB,IAAAC,cAAA,GAAiCD,OAAA;AACjC,IAAAE,uBAAqB,GAAAF,OAAA;AA0BX,IAAAG,YAAA,GAAAH,OAAA;AAtBV,IAAAI,WAAM,GAAAJ,OACJ;AAEF,IAAAK,eAAmB,+FAAiC;AAClD,SAAIC,SAAOA,CAAAC,OAAY;EAEvB,WAAMA,OAAW,KAAG,QAAQ,SAASA,OAAA;EACrC,IAAIC,OAAC,GAAQ,CAEb,GAAAD,OAAM,CAAAE,QAAsB,CAAAJ,eAAA,EAC5B;EAEA,KAAAG,OAAW,CAAAE,MAAA,EAAS,OAAAH,OAAS;EAC3B,IAAAI,KAAM;EACN,IAAAC,SAAI;EACF,IAAAC,yBAAyB;IAAAC,iBAAsB;IAAAC,cAAA;EAAA,IACjD;IAEA,SAAMC,SAAW,GAAAR,OAAU,CAAAS,MAAA,CAAAC,QAAA,KAAAC,KAAA,IAAAN,yBAAA,IAAAM,KAAA,GAAAH,SAAA,CAAAI,IAAA,IAAAC,IAAA,GAAAR,yBAAA;MAC3B,IAAIS,KAAO,GAAGH,KAAA,CAAA1B,KAAA;MACZ,IAAA8B,YAAM;MAAA,IACJC,UAAA,IAAAD,YAAA,GAAAD,KAAA,CAAAG,KAAA,MAAC,QAAAF,YAAe,WAAW,GAAAA,YACzB;MAEJ,IAAAC,UAAA,GAAAZ,SAAA;QACFD,KAAA,CAAAe,IAAW,CAAAnB,OAAU,CAAAoB,KAAA,CAAAf,SAAA,EAAAY,UAAA;MACnB;MAAM,IACJI,GAAA,QAAAJ,UAAA;MAGF,IAAAF,KAAA;QACFX,KAAA,CAAAe,IAAW,gBAAU,IAAA3B,kBAAA,CAAA8B,GAAA,EAAA5B,cAAA,CAAA6B,IAAA;UACnBC,UAAM;UACJC,QAAA,qBAAAjC,kBAAC,CAAA8B,GAAA,EAAAzB,WAAe,CAAA6B,IAAA;YAGlBC,IAAA,EAAAZ,KAAA;YACFU,QAAW,EAAOV,KAAG;UACnB;QACE,GAAAM,GAAA;MAAA,OAAC,IAAAN,KAAA;QAAAX,KAAA,CAAAe,IAAA,oBAAA3B,kBAAA,CAAA8B,GAAA,EAAAzB,WAAA,CAAA6B,IAAA;UAAAC,IAEC,EAAAZ,KAAA,GAAW;UAAAU,QACX,EAAAV,KAAA;QAAgB,GAAAM,GAChB;MAAkB,OAClB,IAAAN,KAAA;QAAgBX,KAChB,CAAAe,IAAA,gBAAa,IAAA3B,kBAAA,CAAA8B,GAAA,EAAA5B,cAAA,CAAA6B,IAAA;UAAAC,UAEZ;UAAQC,QAAA,EAAAV,KAAA;QAAA,GAPJM,GAAA;MAAA,OAQP,IAAAN,KAAA;QACFX,KAAA,CAAAe,IAAA,oBAAA3B,kBAAA,CAAA8B,GAAA,EAAA5B,cAAA,CAAA6B,IAAA;UACFK,UAAA;UAEAC,eAAY,WAAoB;UAClCC,iBAAA;UAEIC,eAAY,EAAQ;UAChBC,YAAK,EAAQ;UACrBP,QAAA,EAAAV,KAAA;QAEA,CAAO,EAAAM,GAAA,CAAM;MACf;MAcOhB,SAAS,GAAAY,UAAA,GAAsBF,KAAA,IAASZ,MAAK;IAClD;EACA,SAAM8B,GAAA;IACN1B,iBAAiB,OAAM;IAEvBC,cACE,GAAAyB,GAAA;EAAA,UAAC;IAAA;MACC,KAAA3B,yBAAO,IAAAG,SAAA,CAAAyB,MAAA;QAGPzB,SAAM,CAAAyB,MAAA;MACN;IAAU,UACH;MACP,IAAA3B,iBAAY;QACZ,MAAAC,cAAc;MACd;IAAsC;EACM;EACX,IAEjCH,SAAA,GAAAL,OAAA,CAAAG,MAAA;IAAAC,KAAA,CAAAe,IAAA,CAAAnB,OAAA,CAAAoB,KAAA,CAAAf,SAAA;EAUA;EAGI,OAAAD,KAAC,CAAAD,MAAA,SAAAC,KAAA,MAAMA,KAAA;AAAA;AAAN,SAAAf,mBACQA,CAAA8C,KAAA;EAAA;IAAAC,OAEP;IAAAC;EAAA,IAAaF,KAAA;EAAsC;IAAAG;EAElD,QAAI1C,YAAW,CAAA2C,gBACd;EAMD,IAAAC,KAAA,OAAA9C,cAAA,CAAA+C,QAAA;EAAA,IAAAC,QAVI,GAAKF,KAAM,CAAAG,EAAA;EAAA,IAAAC,KAYnB,GACH,mBAAApD,kBAAA,CAAAqD,IAAA,EAAAlD,uBAAA,CAAAmD,KAAA;IAAAC,MAAA;IAAA;IACF;IAGFC,KAAI,QAAU;IACZC,SACE;IAIJC,KAAA;MAEAC,WAAO;IACT","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var Mdx_exports = {};
|
|
24
|
+
__export(Mdx_exports, {
|
|
25
|
+
MDX: () => MDX
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(Mdx_exports);
|
|
28
|
+
var import_react = require("@mdx-js/react");
|
|
29
|
+
var import_components = require("@multiplatform.one/components");
|
|
30
|
+
var import_hooks = require("../hooks/index.cjs");
|
|
31
|
+
var import_mdxComponents = require("../mdxComponents.cjs");
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
const logger = console;
|
|
34
|
+
function MDX({
|
|
35
|
+
children,
|
|
36
|
+
debug,
|
|
37
|
+
...props
|
|
38
|
+
}) {
|
|
39
|
+
const components = (0, import_react.useMDXComponents)();
|
|
40
|
+
const {
|
|
41
|
+
Component,
|
|
42
|
+
code,
|
|
43
|
+
frontmatter
|
|
44
|
+
} = (0, import_hooks.useCompileAndEvaluateMdx)(children);
|
|
45
|
+
if (!Component) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
|
|
46
|
+
if (debug) {
|
|
47
|
+
logger.debug("MDX", {
|
|
48
|
+
frontmatter
|
|
49
|
+
});
|
|
50
|
+
logger.debug(code);
|
|
51
|
+
}
|
|
52
|
+
return (
|
|
53
|
+
// contain runtime render errors (e.g. missing component mappings) so
|
|
54
|
+
// sibling content outside the MDX renderer survives
|
|
55
|
+
/* @__PURE__ */
|
|
56
|
+
(0, import_jsx_runtime.jsx)(import_components.ErrorBoundary, {
|
|
57
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(Component, {
|
|
58
|
+
components: {
|
|
59
|
+
...import_mdxComponents.mdxComponents,
|
|
60
|
+
...components,
|
|
61
|
+
...props.components
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var Mdx_exports = {};
|
|
26
|
+
__export(Mdx_exports, {
|
|
27
|
+
MDX: () => MDX
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(Mdx_exports);
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var import_react = require("@mdx-js/react");
|
|
32
|
+
var import_components = require("@multiplatform.one/components");
|
|
33
|
+
var import_hooks = require("../hooks/index.native.js");
|
|
34
|
+
var import_mdxComponents = require("../mdxComponents.native.js");
|
|
35
|
+
var logger = console;
|
|
36
|
+
function MDX(param) {
|
|
37
|
+
var {
|
|
38
|
+
children,
|
|
39
|
+
debug,
|
|
40
|
+
...props
|
|
41
|
+
} = param;
|
|
42
|
+
var components = (0, import_react.useMDXComponents)();
|
|
43
|
+
var {
|
|
44
|
+
Component,
|
|
45
|
+
code,
|
|
46
|
+
frontmatter
|
|
47
|
+
} = (0, import_hooks.useCompileAndEvaluateMdx)(children);
|
|
48
|
+
if (!Component) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
|
|
49
|
+
if (debug) {
|
|
50
|
+
logger.debug("MDX", {
|
|
51
|
+
frontmatter
|
|
52
|
+
});
|
|
53
|
+
logger.debug(code);
|
|
54
|
+
}
|
|
55
|
+
return (
|
|
56
|
+
// contain runtime render errors (e.g. missing component mappings) so
|
|
57
|
+
// sibling content outside the MDX renderer survives
|
|
58
|
+
/* @__PURE__ */
|
|
59
|
+
(0, import_jsx_runtime.jsx)(import_components.ErrorBoundary, {
|
|
60
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(Component, {
|
|
61
|
+
components: {
|
|
62
|
+
...import_mdxComponents.mdxComponents,
|
|
63
|
+
...components,
|
|
64
|
+
...props.components
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Mdx_exports","__export","MDX","module","exports","import_jsx_runtime","require","import_react","import_components","import_hooks","import_mdxComponents","logger","console","param","children","debug","props","components","useMDXComponents","Component","code","frontmatter","useCompileAndEvaluateMdx","jsx","Fragment","ErrorBoundary","mdxComponents"],"sources":["../../../src/Mdx/index.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,WAAA;AAAAC,QAAA,CAAAD,WAAA;EAAAE,GAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAiC,CAAAK,WAAA;AACjC,IAAAK,kBAAA,GAA8BC,OAAA;AAG9B,IAAAC,YAAA,GAAyCD,OAAA;AACzC,IAAAE,iBAAA,GAAAF,OAA8B;AAaL,IAAAG,YAAA,GAAAH,OAAA;AALzB,IAAAI,oBAAe,GAAAJ,OAAA;AAER,IAAAK,MAAS,GAAIC,OAAE;AACpB,SAAMV,IAAAW,KAAA;EACN;IAAMC,QAAE;IAAAC,KAAW;IAAA,GAAMC;EAAA,IAAAH,KAAY;EACrC,IAAII,UAAC,GAAW,IAAAV,YAAO,CAAAW,gBAAA;EACvB,IAAI;IAAAC,SAAO;IAAAC,IAAA;IAAAC;EAAA,QAAAZ,YAAA,CAAAa,wBAAA,EAAAR,QAAA;EACT,KAAAK,SAAO,EAAM,OAAO,eAAe,IAAAd,kBAAA,CAAAkB,GAAA,EAAAlB,kBAAA,CAAAmB,QAAA;EACnC,IAAAT,KAAO;IACTJ,MAAA,CAAAI,KAAA;MACAM;IAAA;IAAAV,MAAA,CAAAI,KAAA,CAAAK,IAAA;EAAA;EAII;IAAC;IAAA;IACa;IACP,IAAAf,kBAAA,CAAAkB,GAAA,EAAAf,iBAAA,CAAAiB,aAAA;MAAAX,QACA,qBAAAT,kBAAA,CAAAkB,GAAA,EAAAJ,SAAA;QAAAF,UACA,EAAM;UACX,GAAAP,oBAAA,CAAAgB,aAAA;UAAA,GAAAT,UAAA;UAEJ,GAAAD,KAAA,CAAAC;QAAA;MAEJ","ignoreList":[]}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
34
|
+
var MdxCodeBlock_exports = {};
|
|
35
|
+
__export(MdxCodeBlock_exports, {
|
|
36
|
+
MDXCodeBlock: () => MDXCodeBlock
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(MdxCodeBlock_exports);
|
|
39
|
+
var import_components = require("@multiplatform.one/components");
|
|
40
|
+
var import_theme = require("@multiplatform.one/theme");
|
|
41
|
+
var import_linear_gradient = require("@tamagui/linear-gradient");
|
|
42
|
+
var import_parse_numeric_range = __toESM(require("parse-numeric-range"));
|
|
43
|
+
var import_react = require("react");
|
|
44
|
+
var import_tamagui = require("tamagui");
|
|
45
|
+
var import_icons = require("../icons/index.cjs");
|
|
46
|
+
var import_cutoffGradient = require("../shared/cutoffGradient.cjs");
|
|
47
|
+
var import_mdxCodeBlockContext = require("./mdxCodeBlockContext.cjs");
|
|
48
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
|
+
const zIndex = {
|
|
50
|
+
localTop: 100
|
|
51
|
+
};
|
|
52
|
+
function extractCodeText(children) {
|
|
53
|
+
if (typeof children === "string") return children;
|
|
54
|
+
if (Array.isArray(children)) return children.map(extractCodeText).join("");
|
|
55
|
+
if (children && typeof children === "object" && "props" in children) {
|
|
56
|
+
return extractCodeText(children.props?.children);
|
|
57
|
+
}
|
|
58
|
+
return String(children ?? "");
|
|
59
|
+
}
|
|
60
|
+
function extractLanguage(className) {
|
|
61
|
+
if (!className) return "text";
|
|
62
|
+
const match = className.match(/language-(\w+)/);
|
|
63
|
+
return match?.[1] || "text";
|
|
64
|
+
}
|
|
65
|
+
function MDXCodeBlock(props) {
|
|
66
|
+
const {
|
|
67
|
+
children,
|
|
68
|
+
className,
|
|
69
|
+
disableCopy,
|
|
70
|
+
id,
|
|
71
|
+
isCollapsible,
|
|
72
|
+
isHighlightingLines,
|
|
73
|
+
showLineNumbers: propShowLineNumbers,
|
|
74
|
+
size,
|
|
75
|
+
line,
|
|
76
|
+
...codeProps
|
|
77
|
+
} = {
|
|
78
|
+
...(0, import_react.useContext)(import_mdxCodeBlockContext.MDXCodeBlockContext),
|
|
79
|
+
...props
|
|
80
|
+
};
|
|
81
|
+
const {
|
|
82
|
+
knobProps
|
|
83
|
+
} = (0, import_theme.useResolvedKnobs)();
|
|
84
|
+
const gradientColors = (0, import_cutoffGradient.useCutoffGradientColors)();
|
|
85
|
+
const codeText = (0, import_react.useMemo)(() => extractCodeText(children).replace(/\n$/, ""), [children]);
|
|
86
|
+
const language = (0, import_react.useMemo)(() => extractLanguage(className), [className]);
|
|
87
|
+
const tokens = (0, import_components.useShikiTokens)(codeText, language);
|
|
88
|
+
const lines = tokens?.length ?? codeText.split("\n").length;
|
|
89
|
+
const showLineNumbers = propShowLineNumbers ?? lines > 10;
|
|
90
|
+
const [isCollapsed, setIsCollapsed] = (0, import_react.useState)(isCollapsible);
|
|
91
|
+
const isLong = lines > 22;
|
|
92
|
+
const [isCutoff, setIsCutoff] = (0, import_react.useState)(isLong && !isCollapsible);
|
|
93
|
+
const {
|
|
94
|
+
hasCopied,
|
|
95
|
+
onCopy
|
|
96
|
+
} = (0, import_components.useClipboard)(codeText);
|
|
97
|
+
const highlightLines = (0, import_react.useMemo)(() => {
|
|
98
|
+
if (!isHighlightingLines || !line) return [];
|
|
99
|
+
return (0, import_parse_numeric_range.default)(line);
|
|
100
|
+
}, [isHighlightingLines, line]);
|
|
101
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
102
|
+
position: "relative",
|
|
103
|
+
marginBottom: "$4",
|
|
104
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.ErrorBoundary, {
|
|
105
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
106
|
+
position: "relative",
|
|
107
|
+
...(isCutoff && {
|
|
108
|
+
maxHeight: 400,
|
|
109
|
+
overflow: "hidden",
|
|
110
|
+
borderRadius: knobProps.borderRadius.borderRadius
|
|
111
|
+
}),
|
|
112
|
+
children: [(!isCollapsed || !isCollapsible) && isCutoff && /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
113
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_linear_gradient.LinearGradient, {
|
|
114
|
+
position: "absolute",
|
|
115
|
+
bottom: 0,
|
|
116
|
+
left: 0,
|
|
117
|
+
right: 0,
|
|
118
|
+
height: 200,
|
|
119
|
+
colors: gradientColors,
|
|
120
|
+
pointerEvents: "none",
|
|
121
|
+
zIndex: zIndex.localTop
|
|
122
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
123
|
+
position: "absolute",
|
|
124
|
+
bottom: "$4",
|
|
125
|
+
left: 0,
|
|
126
|
+
right: 0,
|
|
127
|
+
justifyContent: "center",
|
|
128
|
+
zIndex: zIndex.localTop + 1,
|
|
129
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Button, {
|
|
130
|
+
onPress: () => setIsCutoff(false),
|
|
131
|
+
children: "Show more"
|
|
132
|
+
})
|
|
133
|
+
})]
|
|
134
|
+
}), (!isCollapsed || !isCollapsible) && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.Pre, {
|
|
135
|
+
padding: 0,
|
|
136
|
+
marginBottom: 0,
|
|
137
|
+
id,
|
|
138
|
+
"data-line-numbers": showLineNumbers ? "true" : "false",
|
|
139
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.ScrollView, {
|
|
140
|
+
style: {
|
|
141
|
+
width: "100%"
|
|
142
|
+
},
|
|
143
|
+
contentContainerStyle: {
|
|
144
|
+
minWidth: "100%"
|
|
145
|
+
},
|
|
146
|
+
horizontal: true,
|
|
147
|
+
showsHorizontalScrollIndicator: false,
|
|
148
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.Code, {
|
|
149
|
+
backgroundColor: "transparent",
|
|
150
|
+
flex: 1,
|
|
151
|
+
borderWidth: 0,
|
|
152
|
+
...knobProps.panelPadding,
|
|
153
|
+
size: size ?? knobProps.sizeToken,
|
|
154
|
+
...codeProps,
|
|
155
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.HighlightedCode, {
|
|
156
|
+
tokens,
|
|
157
|
+
highlightLines,
|
|
158
|
+
showLineNumbers,
|
|
159
|
+
children: codeText
|
|
160
|
+
})
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
|
|
164
|
+
position: "absolute",
|
|
165
|
+
top: "$3",
|
|
166
|
+
insetInlineEnd: "$3",
|
|
167
|
+
...knobProps.gap,
|
|
168
|
+
children: [(!isCollapsed || !isCollapsible) && !disableCopy && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.TooltipSimple, {
|
|
169
|
+
label: hasCopied ? "Copied" : "Copy to clipboard",
|
|
170
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Button, {
|
|
171
|
+
"aria-label": "Copy code to clipboard",
|
|
172
|
+
size: "$2",
|
|
173
|
+
icon: hasCopied ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_icons.CheckCircleIcon, {
|
|
174
|
+
size: 14
|
|
175
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_icons.ClipboardIcon, {
|
|
176
|
+
size: 14
|
|
177
|
+
}),
|
|
178
|
+
onPress: onCopy,
|
|
179
|
+
"$max-xs": {
|
|
180
|
+
display: "none"
|
|
181
|
+
}
|
|
182
|
+
})
|
|
183
|
+
}), isCollapsible && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Button, {
|
|
184
|
+
"aria-label": "Show or hide code",
|
|
185
|
+
size: "$2",
|
|
186
|
+
onPress: () => setIsCollapsed(x => !x),
|
|
187
|
+
children: isCollapsed ? "Show code" : "Hide code"
|
|
188
|
+
})]
|
|
189
|
+
})]
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
});
|
|
193
|
+
}
|