@multiplatform.one/markdown 7.4.1 → 7.5.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/dist/cjs/Aside/index.cjs +6 -4
- package/dist/cjs/Aside/index.native.js +6 -4
- package/dist/cjs/Aside/index.native.js.map +1 -1
- package/dist/cjs/Hr/index.cjs +2 -3
- package/dist/cjs/Hr/index.native.js +2 -3
- package/dist/cjs/Hr/index.native.js.map +1 -1
- package/dist/cjs/MarkdownSimpleTable/index.cjs +15 -15
- package/dist/cjs/MarkdownSimpleTable/index.native.js +17 -18
- package/dist/cjs/MarkdownSimpleTable/index.native.js.map +1 -1
- package/dist/cjs/MdxCodeBlock/index.cjs +9 -5
- package/dist/cjs/MdxCodeBlock/index.native.js +9 -5
- package/dist/cjs/MdxCodeBlock/index.native.js.map +1 -1
- package/dist/cjs/Table/index.cjs +20 -8
- package/dist/cjs/Table/index.native.js +20 -8
- package/dist/cjs/Table/index.native.js.map +1 -1
- package/dist/cjs/Video/index.cjs +11 -7
- package/dist/cjs/Video/index.native.js +12 -7
- package/dist/cjs/Video/index.native.js.map +1 -1
- package/dist/cjs/components/Blockquote.cjs +5 -4
- package/dist/cjs/components/Blockquote.native.js +7 -6
- package/dist/cjs/components/Blockquote.native.js.map +1 -1
- package/dist/cjs/components/CodeBlock.cjs +2 -2
- package/dist/cjs/components/CodeBlock.native.js +3 -3
- package/dist/cjs/components/CodeBlock.native.js.map +1 -1
- package/dist/cjs/components/Heading.cjs +1 -0
- package/dist/cjs/components/Heading.native.js +1 -0
- package/dist/cjs/components/Heading.native.js.map +1 -1
- package/dist/cjs/components/HorizontalRule.cjs +12 -1
- package/dist/cjs/components/HorizontalRule.native.js +12 -1
- package/dist/cjs/components/HorizontalRule.native.js.map +1 -1
- package/dist/cjs/components/Image.cjs +2 -2
- package/dist/cjs/components/Image.native.js +3 -2
- package/dist/cjs/components/Image.native.js.map +1 -1
- package/dist/cjs/components/InlineCode.cjs +2 -1
- package/dist/cjs/components/InlineCode.native.js +2 -1
- package/dist/cjs/components/InlineCode.native.js.map +1 -1
- package/dist/cjs/components/InlineStyles.cjs +14 -1
- package/dist/cjs/components/InlineStyles.native.js +14 -1
- package/dist/cjs/components/InlineStyles.native.js.map +1 -1
- package/dist/cjs/components/Link.cjs +5 -0
- package/dist/cjs/components/Link.native.js +5 -0
- package/dist/cjs/components/Link.native.js.map +1 -1
- package/dist/cjs/components/List.cjs +8 -1
- package/dist/cjs/components/List.native.js +11 -3
- package/dist/cjs/components/List.native.js.map +1 -1
- package/dist/cjs/components/Table.cjs +15 -9
- package/dist/cjs/components/Table.native.js +17 -12
- package/dist/cjs/components/Table.native.js.map +1 -1
- package/dist/cjs/mdxComponents.cjs +175 -108
- package/dist/cjs/mdxComponents.native.js +184 -113
- package/dist/cjs/mdxComponents.native.js.map +1 -1
- package/dist/cjs/mermaid/MermaidBlock.cjs +1 -1
- package/dist/cjs/mermaid/renderMermaidDiagram.native.js +11 -81
- package/dist/cjs/mermaid/renderMermaidDiagram.native.js.map +1 -1
- package/dist/cjs/shared/index.cjs +13 -1
- package/dist/cjs/shared/index.native.js +12 -0
- package/dist/cjs/shared/index.native.js.map +1 -1
- package/dist/cjs/shared/tokenPx.cjs +41 -0
- package/dist/cjs/shared/tokenPx.native.js +46 -0
- package/dist/cjs/shared/tokenPx.native.js.map +1 -0
- package/dist/cjs/shared/useMarkdownTableKnobs.cjs +61 -0
- package/dist/cjs/shared/useMarkdownTableKnobs.native.js +64 -0
- package/dist/cjs/shared/useMarkdownTableKnobs.native.js.map +1 -0
- package/dist/esm/Aside/index.mjs +6 -4
- package/dist/esm/Aside/index.mjs.map +1 -1
- package/dist/esm/Aside/index.native.js +6 -4
- package/dist/esm/Aside/index.native.js.map +1 -1
- package/dist/esm/Hr/index.mjs +2 -3
- package/dist/esm/Hr/index.mjs.map +1 -1
- package/dist/esm/Hr/index.native.js +2 -3
- package/dist/esm/Hr/index.native.js.map +1 -1
- package/dist/esm/MarkdownSimpleTable/index.mjs +15 -15
- package/dist/esm/MarkdownSimpleTable/index.mjs.map +1 -1
- package/dist/esm/MarkdownSimpleTable/index.native.js +17 -18
- package/dist/esm/MarkdownSimpleTable/index.native.js.map +1 -1
- package/dist/esm/MdxCodeBlock/index.mjs +9 -5
- package/dist/esm/MdxCodeBlock/index.mjs.map +1 -1
- package/dist/esm/MdxCodeBlock/index.native.js +9 -5
- package/dist/esm/MdxCodeBlock/index.native.js.map +1 -1
- package/dist/esm/Table/index.mjs +20 -8
- package/dist/esm/Table/index.mjs.map +1 -1
- package/dist/esm/Table/index.native.js +20 -8
- package/dist/esm/Table/index.native.js.map +1 -1
- package/dist/esm/Video/index.mjs +11 -7
- package/dist/esm/Video/index.mjs.map +1 -1
- package/dist/esm/Video/index.native.js +12 -7
- package/dist/esm/Video/index.native.js.map +1 -1
- package/dist/esm/components/Blockquote.mjs +5 -4
- package/dist/esm/components/Blockquote.mjs.map +1 -1
- package/dist/esm/components/Blockquote.native.js +7 -6
- package/dist/esm/components/Blockquote.native.js.map +1 -1
- package/dist/esm/components/CodeBlock.mjs +2 -2
- package/dist/esm/components/CodeBlock.mjs.map +1 -1
- package/dist/esm/components/CodeBlock.native.js +3 -3
- package/dist/esm/components/CodeBlock.native.js.map +1 -1
- package/dist/esm/components/Heading.mjs +1 -0
- package/dist/esm/components/Heading.mjs.map +1 -1
- package/dist/esm/components/Heading.native.js +1 -0
- package/dist/esm/components/Heading.native.js.map +1 -1
- package/dist/esm/components/HorizontalRule.mjs +13 -2
- package/dist/esm/components/HorizontalRule.mjs.map +1 -1
- package/dist/esm/components/HorizontalRule.native.js +13 -2
- package/dist/esm/components/HorizontalRule.native.js.map +1 -1
- package/dist/esm/components/Image.mjs +2 -2
- package/dist/esm/components/Image.mjs.map +1 -1
- package/dist/esm/components/Image.native.js +3 -2
- package/dist/esm/components/Image.native.js.map +1 -1
- package/dist/esm/components/InlineCode.mjs +2 -1
- package/dist/esm/components/InlineCode.mjs.map +1 -1
- package/dist/esm/components/InlineCode.native.js +2 -1
- package/dist/esm/components/InlineCode.native.js.map +1 -1
- package/dist/esm/components/InlineStyles.mjs +14 -1
- package/dist/esm/components/InlineStyles.mjs.map +1 -1
- package/dist/esm/components/InlineStyles.native.js +14 -1
- package/dist/esm/components/InlineStyles.native.js.map +1 -1
- package/dist/esm/components/Link.mjs +5 -0
- package/dist/esm/components/Link.mjs.map +1 -1
- package/dist/esm/components/Link.native.js +5 -0
- package/dist/esm/components/Link.native.js.map +1 -1
- package/dist/esm/components/List.mjs +8 -1
- package/dist/esm/components/List.mjs.map +1 -1
- package/dist/esm/components/List.native.js +11 -3
- package/dist/esm/components/List.native.js.map +1 -1
- package/dist/esm/components/Table.mjs +15 -9
- package/dist/esm/components/Table.mjs.map +1 -1
- package/dist/esm/components/Table.native.js +17 -12
- package/dist/esm/components/Table.native.js.map +1 -1
- package/dist/esm/mdxComponents.mjs +175 -108
- package/dist/esm/mdxComponents.mjs.map +1 -1
- package/dist/esm/mdxComponents.native.js +184 -113
- package/dist/esm/mdxComponents.native.js.map +1 -1
- package/dist/esm/mermaid/MermaidBlock.mjs +1 -1
- package/dist/esm/mermaid/MermaidBlock.mjs.map +1 -1
- package/dist/esm/mermaid/renderMermaidDiagram.native.js +9 -68
- package/dist/esm/mermaid/renderMermaidDiagram.native.js.map +1 -1
- package/dist/esm/shared/index.mjs +3 -0
- package/dist/esm/shared/index.mjs.map +1 -1
- package/dist/esm/shared/index.native.js +3 -0
- package/dist/esm/shared/index.native.js.map +1 -1
- package/dist/esm/shared/tokenPx.mjs +16 -0
- package/dist/esm/shared/tokenPx.mjs.map +1 -0
- package/dist/esm/shared/tokenPx.native.js +18 -0
- package/dist/esm/shared/tokenPx.native.js.map +1 -0
- package/dist/esm/shared/useMarkdownTableKnobs.mjs +36 -0
- package/dist/esm/shared/useMarkdownTableKnobs.mjs.map +1 -0
- package/dist/esm/shared/useMarkdownTableKnobs.native.js +36 -0
- package/dist/esm/shared/useMarkdownTableKnobs.native.js.map +1 -0
- package/dist/jsx/Aside/index.mjs +6 -4
- package/dist/jsx/Aside/index.mjs.map +1 -1
- package/dist/jsx/Aside/index.native.js +6 -4
- package/dist/jsx/Aside/index.native.js.map +1 -1
- package/dist/jsx/Hr/index.mjs +2 -3
- package/dist/jsx/Hr/index.mjs.map +1 -1
- package/dist/jsx/Hr/index.native.js +2 -3
- package/dist/jsx/Hr/index.native.js.map +1 -1
- package/dist/jsx/MarkdownSimpleTable/index.mjs +15 -15
- package/dist/jsx/MarkdownSimpleTable/index.mjs.map +1 -1
- package/dist/jsx/MarkdownSimpleTable/index.native.js +17 -18
- package/dist/jsx/MarkdownSimpleTable/index.native.js.map +1 -1
- package/dist/jsx/MdxCodeBlock/index.mjs +9 -5
- package/dist/jsx/MdxCodeBlock/index.mjs.map +1 -1
- package/dist/jsx/MdxCodeBlock/index.native.js +9 -5
- package/dist/jsx/MdxCodeBlock/index.native.js.map +1 -1
- package/dist/jsx/Table/index.mjs +20 -8
- package/dist/jsx/Table/index.mjs.map +1 -1
- package/dist/jsx/Table/index.native.js +20 -8
- package/dist/jsx/Table/index.native.js.map +1 -1
- package/dist/jsx/Video/index.mjs +11 -7
- package/dist/jsx/Video/index.mjs.map +1 -1
- package/dist/jsx/Video/index.native.js +12 -7
- package/dist/jsx/Video/index.native.js.map +1 -1
- package/dist/jsx/components/Blockquote.mjs +5 -4
- package/dist/jsx/components/Blockquote.mjs.map +1 -1
- package/dist/jsx/components/Blockquote.native.js +7 -6
- package/dist/jsx/components/Blockquote.native.js.map +1 -1
- package/dist/jsx/components/CodeBlock.mjs +2 -2
- package/dist/jsx/components/CodeBlock.mjs.map +1 -1
- package/dist/jsx/components/CodeBlock.native.js +3 -3
- package/dist/jsx/components/CodeBlock.native.js.map +1 -1
- package/dist/jsx/components/Heading.mjs +1 -0
- package/dist/jsx/components/Heading.mjs.map +1 -1
- package/dist/jsx/components/Heading.native.js +1 -0
- package/dist/jsx/components/Heading.native.js.map +1 -1
- package/dist/jsx/components/HorizontalRule.mjs +13 -2
- package/dist/jsx/components/HorizontalRule.mjs.map +1 -1
- package/dist/jsx/components/HorizontalRule.native.js +12 -1
- package/dist/jsx/components/HorizontalRule.native.js.map +1 -1
- package/dist/jsx/components/Image.mjs +2 -2
- package/dist/jsx/components/Image.mjs.map +1 -1
- package/dist/jsx/components/Image.native.js +3 -2
- package/dist/jsx/components/Image.native.js.map +1 -1
- package/dist/jsx/components/InlineCode.mjs +2 -1
- package/dist/jsx/components/InlineCode.mjs.map +1 -1
- package/dist/jsx/components/InlineCode.native.js +2 -1
- package/dist/jsx/components/InlineCode.native.js.map +1 -1
- package/dist/jsx/components/InlineStyles.mjs +14 -1
- package/dist/jsx/components/InlineStyles.mjs.map +1 -1
- package/dist/jsx/components/InlineStyles.native.js +14 -1
- package/dist/jsx/components/InlineStyles.native.js.map +1 -1
- package/dist/jsx/components/Link.mjs +5 -0
- package/dist/jsx/components/Link.mjs.map +1 -1
- package/dist/jsx/components/Link.native.js +5 -0
- package/dist/jsx/components/Link.native.js.map +1 -1
- package/dist/jsx/components/List.mjs +8 -1
- package/dist/jsx/components/List.mjs.map +1 -1
- package/dist/jsx/components/List.native.js +11 -3
- package/dist/jsx/components/List.native.js.map +1 -1
- package/dist/jsx/components/Table.mjs +15 -9
- package/dist/jsx/components/Table.mjs.map +1 -1
- package/dist/jsx/components/Table.native.js +17 -12
- package/dist/jsx/components/Table.native.js.map +1 -1
- package/dist/jsx/mdxComponents.mjs +175 -108
- package/dist/jsx/mdxComponents.mjs.map +1 -1
- package/dist/jsx/mdxComponents.native.js +184 -113
- package/dist/jsx/mdxComponents.native.js.map +1 -1
- package/dist/jsx/mermaid/MermaidBlock.mjs +1 -1
- package/dist/jsx/mermaid/MermaidBlock.mjs.map +1 -1
- package/dist/jsx/mermaid/renderMermaidDiagram.native.js +11 -81
- package/dist/jsx/mermaid/renderMermaidDiagram.native.js.map +1 -1
- package/dist/jsx/shared/index.mjs +3 -0
- package/dist/jsx/shared/index.mjs.map +1 -1
- package/dist/jsx/shared/index.native.js +12 -0
- package/dist/jsx/shared/index.native.js.map +1 -1
- package/dist/jsx/shared/tokenPx.mjs +16 -0
- package/dist/jsx/shared/tokenPx.mjs.map +1 -0
- package/dist/jsx/shared/tokenPx.native.js +46 -0
- package/dist/jsx/shared/tokenPx.native.js.map +1 -0
- package/dist/jsx/shared/useMarkdownTableKnobs.mjs +36 -0
- package/dist/jsx/shared/useMarkdownTableKnobs.mjs.map +1 -0
- package/dist/jsx/shared/useMarkdownTableKnobs.native.js +64 -0
- package/dist/jsx/shared/useMarkdownTableKnobs.native.js.map +1 -0
- package/package.json +14 -9
- package/src/Aside/index.tsx +6 -4
- package/src/Hr/hr.spec.tsx +11 -10
- package/src/Hr/index.tsx +2 -2
- package/src/MarkdownSimpleTable/index.tsx +10 -24
- package/src/MdxCodeBlock/index.tsx +10 -4
- package/src/Table/index.tsx +11 -11
- package/src/Video/index.tsx +15 -5
- package/src/components/Blockquote.tsx +6 -5
- package/src/components/CodeBlock.tsx +2 -2
- package/src/components/Heading.tsx +7 -1
- package/src/components/HorizontalRule.tsx +19 -2
- package/src/components/Image.tsx +3 -2
- package/src/components/InlineCode.tsx +2 -1
- package/src/components/InlineStyles.tsx +7 -3
- package/src/components/Link.tsx +3 -0
- package/src/components/List.tsx +10 -3
- package/src/components/Table.tsx +13 -10
- package/src/designLaw.spec.tsx +130 -0
- package/src/mdxComponents.tsx +168 -87
- package/src/mermaid/MermaidBlock.tsx +1 -1
- package/src/mermaid/nativeGraph.spec.ts +90 -0
- package/src/mermaid/renderMermaidDiagram.native.ts +50 -0
- package/src/mermaid/renderMermaidDiagram.spec.ts +23 -0
- package/src/shared/index.ts +2 -0
- package/src/shared/tokenPx.ts +29 -0
- package/src/shared/useMarkdownTableKnobs.ts +38 -0
- package/src/stories/Blocks.stories.tsx +5 -5
- package/types/Aside/index.d.ts.map +1 -1
- package/types/Hr/index.d.ts +1 -1
- package/types/Hr/index.d.ts.map +1 -1
- package/types/MarkdownSimpleTable/index.d.ts.map +1 -1
- package/types/MdxCodeBlock/index.d.ts.map +1 -1
- package/types/Table/index.d.ts.map +1 -1
- package/types/Video/index.d.ts.map +1 -1
- package/types/components/Blockquote.d.ts.map +1 -1
- package/types/components/Heading.d.ts.map +1 -1
- package/types/components/HorizontalRule.d.ts +5 -1
- package/types/components/HorizontalRule.d.ts.map +1 -1
- package/types/components/Image.d.ts.map +1 -1
- package/types/components/InlineCode.d.ts.map +1 -1
- package/types/components/InlineStyles.d.ts.map +1 -1
- package/types/components/Link.d.ts.map +1 -1
- package/types/components/List.d.ts.map +1 -1
- package/types/components/Table.d.ts.map +1 -1
- package/types/mdxComponents.d.ts.map +1 -1
- package/types/mermaid/renderMermaidDiagram.native.d.ts +45 -0
- package/types/mermaid/renderMermaidDiagram.native.d.ts.map +1 -0
- package/types/shared/index.d.ts +2 -0
- package/types/shared/index.d.ts.map +1 -1
- package/types/shared/tokenPx.d.ts +7 -0
- package/types/shared/tokenPx.d.ts.map +1 -0
- package/types/shared/useMarkdownTableKnobs.d.ts +39 -0
- package/types/shared/useMarkdownTableKnobs.d.ts.map +1 -0
package/src/mdxComponents.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CodeInline, unwrapText } from "@multiplatform.one/components";
|
|
2
2
|
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
3
|
+
import { tokenPx } from "./shared/tokenPx";
|
|
3
4
|
import { Link } from "@multiplatform.one/router";
|
|
4
5
|
import type { MDXComponents } from "mdx/types";
|
|
5
6
|
import { Children } from "react";
|
|
@@ -8,7 +9,8 @@ import { H1, H2, H3, H4, H5, H6, Paragraph, Text, XStack, YStack, isWeb, styled
|
|
|
8
9
|
import { ExternalIcon } from "./ExternalIcon";
|
|
9
10
|
import { HR } from "./Hr";
|
|
10
11
|
import { LinkIcon } from "./icons";
|
|
11
|
-
import {
|
|
12
|
+
import { MarkdownList, MarkdownListItem } from "./components/List";
|
|
13
|
+
import { MarkdownImage } from "./components/Image";
|
|
12
14
|
import { MDXCodeBlock } from "./MdxCodeBlock";
|
|
13
15
|
import {
|
|
14
16
|
MDXTable,
|
|
@@ -18,7 +20,6 @@ import {
|
|
|
18
20
|
MDXTableHeaderCell,
|
|
19
21
|
MDXTableRow,
|
|
20
22
|
} from "./Table";
|
|
21
|
-
import { UL } from "./Ul";
|
|
22
23
|
|
|
23
24
|
const code = ({
|
|
24
25
|
hero: _hero,
|
|
@@ -57,30 +58,31 @@ export type TableHighlightProps = React.ComponentProps<typeof TableHighlight>;
|
|
|
57
58
|
|
|
58
59
|
function MdxBlockquote({ children, ...props }: any) {
|
|
59
60
|
const { knobProps } = useResolvedKnobs();
|
|
61
|
+
const railWidth = knobProps.borderRadius.borderWidth;
|
|
62
|
+
const inset = knobProps.panelPadding.padding;
|
|
60
63
|
return (
|
|
61
64
|
<YStack
|
|
62
65
|
marginVertical="$4"
|
|
63
|
-
paddingHorizontal={
|
|
66
|
+
paddingHorizontal={inset}
|
|
64
67
|
// Logical start rail so the quote mirrors in RTL; tamagui
|
|
65
68
|
// borderStartWidth does not compile to working CSS on web (SB-M-1215)
|
|
66
69
|
{...(isWeb
|
|
67
70
|
? {
|
|
68
71
|
style: {
|
|
69
|
-
marginInlineStart:
|
|
70
|
-
borderInlineStartWidth:
|
|
71
|
-
borderInlineStartStyle: "solid",
|
|
72
|
+
marginInlineStart: inset,
|
|
73
|
+
borderInlineStartWidth: railWidth,
|
|
74
|
+
borderInlineStartStyle: railWidth ? "solid" : "none",
|
|
72
75
|
} as any,
|
|
73
76
|
}
|
|
74
|
-
: { style: { marginInlineStart:
|
|
77
|
+
: { style: { marginInlineStart: inset }, borderStartWidth: railWidth })}
|
|
75
78
|
borderColor="$borderColor"
|
|
76
79
|
justifyContent="center"
|
|
77
80
|
{...props}
|
|
78
81
|
>
|
|
79
82
|
<Paragraph
|
|
80
83
|
whiteSpace="revert"
|
|
81
|
-
size=
|
|
82
|
-
|
|
83
|
-
fontWeight="300"
|
|
84
|
+
size={knobProps.sizeToken as any}
|
|
85
|
+
{...knobProps.body}
|
|
84
86
|
color="$color"
|
|
85
87
|
opacity={0.65}
|
|
86
88
|
>
|
|
@@ -90,106 +92,184 @@ function MdxBlockquote({ children, ...props }: any) {
|
|
|
90
92
|
);
|
|
91
93
|
}
|
|
92
94
|
|
|
95
|
+
function MdxHeading({
|
|
96
|
+
Component,
|
|
97
|
+
children,
|
|
98
|
+
id,
|
|
99
|
+
size,
|
|
100
|
+
color,
|
|
101
|
+
marginTop,
|
|
102
|
+
marginBottom,
|
|
103
|
+
dataHeading,
|
|
104
|
+
link,
|
|
105
|
+
...props
|
|
106
|
+
}: {
|
|
107
|
+
Component: typeof H1;
|
|
108
|
+
children?: any;
|
|
109
|
+
id?: string;
|
|
110
|
+
size?: any;
|
|
111
|
+
color?: string;
|
|
112
|
+
marginTop?: any;
|
|
113
|
+
marginBottom?: any;
|
|
114
|
+
dataHeading?: boolean;
|
|
115
|
+
link?: boolean;
|
|
116
|
+
} & Record<string, unknown>) {
|
|
117
|
+
const { knobProps } = useResolvedKnobs();
|
|
118
|
+
const heading = (
|
|
119
|
+
<Component
|
|
120
|
+
maxWidth="100%"
|
|
121
|
+
position="relative"
|
|
122
|
+
width={link ? ("fit-content" as any) : undefined}
|
|
123
|
+
size={size}
|
|
124
|
+
color={color}
|
|
125
|
+
marginTop={link ? undefined : marginTop}
|
|
126
|
+
marginBottom={link ? undefined : marginBottom}
|
|
127
|
+
{...(dataHeading ? { "data-heading": true } : {})}
|
|
128
|
+
{...knobProps.heading}
|
|
129
|
+
{...props}
|
|
130
|
+
>
|
|
131
|
+
{children}
|
|
132
|
+
</Component>
|
|
133
|
+
);
|
|
134
|
+
if (!link) return heading;
|
|
135
|
+
return (
|
|
136
|
+
<LinkHeading data-heading marginTop={marginTop} marginBottom={marginBottom} id={id}>
|
|
137
|
+
{heading}
|
|
138
|
+
{getNonTextChildren(children)}
|
|
139
|
+
</LinkHeading>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function MdxAnchor({ href = "", children, ...props }: { href?: string; children?: any }) {
|
|
144
|
+
const { knobProps } = useResolvedKnobs();
|
|
145
|
+
return (
|
|
146
|
+
<Link href={href}>
|
|
147
|
+
<Paragraph
|
|
148
|
+
// the router Link already renders the anchor; a nested <a> is invalid
|
|
149
|
+
render="span"
|
|
150
|
+
fontSize="inherit"
|
|
151
|
+
display="inline"
|
|
152
|
+
cursor="pointer"
|
|
153
|
+
{...knobProps.body}
|
|
154
|
+
focusVisibleStyle={{
|
|
155
|
+
outlineColor: "$outlineColor",
|
|
156
|
+
outlineWidth: 2,
|
|
157
|
+
outlineStyle: "solid",
|
|
158
|
+
outlineOffset: 2,
|
|
159
|
+
}}
|
|
160
|
+
{...props}
|
|
161
|
+
>
|
|
162
|
+
{children}
|
|
163
|
+
{typeof href === "string" && href.startsWith("http") ? (
|
|
164
|
+
<>
|
|
165
|
+
|
|
166
|
+
<Text fontSize="inherit" display="inline-flex" y={2} style={{ marginLeft: -1 }}>
|
|
167
|
+
<ExternalIcon />
|
|
168
|
+
</Text>
|
|
169
|
+
</>
|
|
170
|
+
) : null}
|
|
171
|
+
</Paragraph>
|
|
172
|
+
</Link>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function MdxStrong(props: any) {
|
|
177
|
+
const { knobProps } = useResolvedKnobs();
|
|
178
|
+
return (
|
|
179
|
+
<Paragraph render="strong" fontSize="inherit" {...knobProps.body} {...props} fontWeight="700" />
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function MdxP(props: any) {
|
|
184
|
+
const { knobProps } = useResolvedKnobs();
|
|
185
|
+
return (
|
|
186
|
+
<Paragraph
|
|
187
|
+
render="p"
|
|
188
|
+
display="block"
|
|
189
|
+
size={knobProps.sizeToken as any}
|
|
190
|
+
marginVertical="$2"
|
|
191
|
+
{...knobProps.body}
|
|
192
|
+
{...props}
|
|
193
|
+
/>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function MdxList({
|
|
198
|
+
ordered,
|
|
199
|
+
children,
|
|
200
|
+
start,
|
|
201
|
+
}: {
|
|
202
|
+
ordered: boolean;
|
|
203
|
+
children?: any;
|
|
204
|
+
start?: number;
|
|
205
|
+
}) {
|
|
206
|
+
return (
|
|
207
|
+
<MarkdownList ordered={ordered} start={start}>
|
|
208
|
+
{Children.toArray(children).map((child) => (typeof child === "string" ? null : child))}
|
|
209
|
+
</MarkdownList>
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
93
213
|
export const mdxComponents: MDXComponents = {
|
|
94
|
-
h1: (props) =>
|
|
95
|
-
<H1 fontFamily="$mono" width="max-content" position="relative" marginBottom="$2" {...props} />
|
|
96
|
-
),
|
|
214
|
+
h1: (props) => <MdxHeading Component={H1} width="max-content" marginBottom="$2" {...props} />,
|
|
97
215
|
h2: ({ children, ...props }) => (
|
|
98
|
-
<
|
|
99
|
-
|
|
216
|
+
<MdxHeading
|
|
217
|
+
Component={H2}
|
|
218
|
+
dataHeading
|
|
100
219
|
width={"fit-content" as any}
|
|
101
|
-
marginTop="$8"
|
|
102
|
-
marginBottom="$4"
|
|
103
|
-
data-heading
|
|
104
220
|
size="$9"
|
|
105
221
|
color="$color12"
|
|
222
|
+
marginTop="$8"
|
|
223
|
+
marginBottom="$4"
|
|
106
224
|
{...props}
|
|
107
225
|
>
|
|
108
226
|
{children}
|
|
109
|
-
</
|
|
227
|
+
</MdxHeading>
|
|
110
228
|
),
|
|
111
|
-
h3: (
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
{children}
|
|
123
|
-
</H3>
|
|
124
|
-
{getNonTextChildren(children)}
|
|
125
|
-
</LinkHeading>
|
|
229
|
+
h3: (props) => (
|
|
230
|
+
<MdxHeading
|
|
231
|
+
Component={H3}
|
|
232
|
+
link
|
|
233
|
+
dataHeading
|
|
234
|
+
size="$8"
|
|
235
|
+
color="$color11"
|
|
236
|
+
marginTop="$6"
|
|
237
|
+
marginBottom="$2"
|
|
238
|
+
{...props}
|
|
239
|
+
/>
|
|
126
240
|
),
|
|
127
241
|
h4: (props) => (
|
|
128
|
-
<
|
|
129
|
-
|
|
242
|
+
<MdxHeading
|
|
243
|
+
Component={H4}
|
|
244
|
+
dataHeading
|
|
130
245
|
width={"fit-content" as any}
|
|
131
|
-
marginTop="$8"
|
|
132
|
-
marginBottom="$2"
|
|
133
246
|
size="$8"
|
|
134
247
|
color="$color8"
|
|
135
|
-
|
|
248
|
+
marginTop="$8"
|
|
249
|
+
marginBottom="$2"
|
|
136
250
|
{...props}
|
|
137
|
-
fontWeight="400"
|
|
138
251
|
/>
|
|
139
252
|
),
|
|
140
|
-
h5: (props) => <H5 size="$6"
|
|
141
|
-
h6: (props) => <H6 marginTop="$4" {...props} />,
|
|
142
|
-
p: (props) => <
|
|
143
|
-
a: (
|
|
144
|
-
return (
|
|
145
|
-
<Link href={href}>
|
|
146
|
-
<Paragraph
|
|
147
|
-
// the router Link already renders the anchor; a nested <a> is invalid
|
|
148
|
-
render="span"
|
|
149
|
-
fontSize="inherit"
|
|
150
|
-
display="inline"
|
|
151
|
-
cursor="pointer"
|
|
152
|
-
focusVisibleStyle={{
|
|
153
|
-
outlineColor: "$outlineColor",
|
|
154
|
-
outlineWidth: 2,
|
|
155
|
-
outlineStyle: "solid",
|
|
156
|
-
outlineOffset: 2,
|
|
157
|
-
}}
|
|
158
|
-
{...props}
|
|
159
|
-
>
|
|
160
|
-
{children}
|
|
161
|
-
{typeof href === "string" && href.startsWith("http") ? (
|
|
162
|
-
<>
|
|
163
|
-
|
|
164
|
-
<Text fontSize="inherit" display="inline-flex" y={2} style={{ marginLeft: -1 }}>
|
|
165
|
-
<ExternalIcon />
|
|
166
|
-
</Text>
|
|
167
|
-
</>
|
|
168
|
-
) : null}
|
|
169
|
-
</Paragraph>
|
|
170
|
-
</Link>
|
|
171
|
-
);
|
|
172
|
-
},
|
|
253
|
+
h5: (props) => <MdxHeading Component={H5} size="$6" marginTop="$4" {...props} />,
|
|
254
|
+
h6: (props) => <MdxHeading Component={H6} marginTop="$4" {...props} />,
|
|
255
|
+
p: (props) => <MdxP {...props} />,
|
|
256
|
+
a: (props) => <MdxAnchor {...props} />,
|
|
173
257
|
hr: (props) => <HR {...props} />,
|
|
174
|
-
ul: ({ children }) =>
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
ol: (props) => <YStack {...props} render="ol" marginBottom="$3" />,
|
|
180
|
-
li: (props) => (
|
|
181
|
-
<LI render="li" size="$6" marginBottom="$1.5" style={{ listStyleType: "disc" }}>
|
|
182
|
-
{props.children}
|
|
183
|
-
</LI>
|
|
258
|
+
ul: ({ children }) => <MdxList ordered={false}>{children}</MdxList>,
|
|
259
|
+
ol: ({ children, start }: any) => (
|
|
260
|
+
<MdxList ordered start={typeof start === "number" ? start : Number(start) || undefined}>
|
|
261
|
+
{children}
|
|
262
|
+
</MdxList>
|
|
184
263
|
),
|
|
185
|
-
|
|
264
|
+
li: (props) => <MarkdownListItem>{props.children}</MarkdownListItem>,
|
|
265
|
+
strong: (props) => <MdxStrong {...props} />,
|
|
186
266
|
em: (props) => <Paragraph render="em" fontSize="inherit" {...props} fontStyle="italic" />,
|
|
187
267
|
del: (props) => (
|
|
188
268
|
<Paragraph render="del" fontSize="inherit" {...props} textDecorationLine="line-through" />
|
|
189
269
|
),
|
|
190
|
-
img: ({ ...props }) => (
|
|
270
|
+
img: ({ src, alt, title, ...props }: any) => (
|
|
191
271
|
<YStack render="span" marginVertical="$6">
|
|
192
|
-
<
|
|
272
|
+
<MarkdownImage src={src} alt={alt} title={title} {...props} />
|
|
193
273
|
</YStack>
|
|
194
274
|
),
|
|
195
275
|
pre: ({ children }) => <>{children}</>,
|
|
@@ -205,6 +285,7 @@ export const mdxComponents: MDXComponents = {
|
|
|
205
285
|
|
|
206
286
|
const LinkHeading = ({ id, children, ...props }: { id?: string } & XStackProps) => {
|
|
207
287
|
const { knobProps } = useResolvedKnobs();
|
|
288
|
+
const iconPx = tokenPx(knobProps.label.fontSize as string, 12, "fontSize");
|
|
208
289
|
return (
|
|
209
290
|
<XStack
|
|
210
291
|
render="a"
|
|
@@ -219,7 +300,7 @@ const LinkHeading = ({ id, children, ...props }: { id?: string } & XStackProps)
|
|
|
219
300
|
>
|
|
220
301
|
{children}
|
|
221
302
|
<YStack render="span" opacity={0.3}>
|
|
222
|
-
<LinkIcon size={
|
|
303
|
+
<LinkIcon size={iconPx} />
|
|
223
304
|
</YStack>
|
|
224
305
|
</XStack>
|
|
225
306
|
);
|
|
@@ -55,7 +55,7 @@ export function MermaidBlock({ children }: MermaidBlockProps) {
|
|
|
55
55
|
if (state.status === "ok") {
|
|
56
56
|
return (
|
|
57
57
|
<View
|
|
58
|
-
{...(knobProps.
|
|
58
|
+
{...(knobProps.borderRadiusNested ?? { borderRadius: "$4" })}
|
|
59
59
|
backgroundColor={markdownCodeColors.background.base}
|
|
60
60
|
borderWidth={1}
|
|
61
61
|
borderColor={markdownCodeColors.border.base}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MPO-10 regression guard.
|
|
3
|
+
*
|
|
4
|
+
* mermaid must not appear anywhere on this package's NATIVE source graph.
|
|
5
|
+
* `import()` is not tree-shakable, so a single dynamic import on a native
|
|
6
|
+
* module forces every native bundler that reaches it to parse mermaid and
|
|
7
|
+
* emit its chunk — and mermaid's published chunks are illegal ESM ("use
|
|
8
|
+
* strict" inside functions with non-simple parameter lists), which fails
|
|
9
|
+
* `one build --platform ios` outright with no bundle at all.
|
|
10
|
+
*
|
|
11
|
+
* The blast radius is the whole workspace: this package's barrel re-exports
|
|
12
|
+
* ./mermaid, so any native consumer that reaches the barrel — including
|
|
13
|
+
* anyone importing one component from @multiplatform.one/frappe-ui — used to
|
|
14
|
+
* inherit the failure.
|
|
15
|
+
*
|
|
16
|
+
* The rule this pins: for every module in src/, the tier a native bundler
|
|
17
|
+
* resolves (the `.native` sibling when one exists, otherwise the shared
|
|
18
|
+
* file) carries no `mermaid` specifier.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import fs from "node:fs";
|
|
22
|
+
import path from "node:path";
|
|
23
|
+
import { fileURLToPath } from "node:url";
|
|
24
|
+
import { describe, expect, it } from "vitest";
|
|
25
|
+
|
|
26
|
+
const srcDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
27
|
+
|
|
28
|
+
const codeExt = new Set([".ts", ".tsx"]);
|
|
29
|
+
const skip = /\.(spec|test|stories)\.tsx?$/;
|
|
30
|
+
|
|
31
|
+
function walk(dir: string): string[] {
|
|
32
|
+
return fs.readdirSync(dir, { withFileTypes: true }).flatMap((e) => {
|
|
33
|
+
const full = path.join(dir, e.name);
|
|
34
|
+
if (e.isDirectory()) return walk(full);
|
|
35
|
+
if (!codeExt.has(path.extname(e.name))) return [];
|
|
36
|
+
if (skip.test(e.name)) return [];
|
|
37
|
+
return [full];
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The file a native bundler resolves for `file` (its `.native` sibling wins). */
|
|
42
|
+
function nativeTier(file: string): string {
|
|
43
|
+
const ext = path.extname(file);
|
|
44
|
+
if (file.endsWith(".native" + ext)) return file;
|
|
45
|
+
const base = file.slice(0, -ext.length);
|
|
46
|
+
for (const e of [".native.tsx", ".native.ts"]) {
|
|
47
|
+
if (fs.existsSync(base + e)) return base + e;
|
|
48
|
+
}
|
|
49
|
+
return file;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const importPatterns = [
|
|
53
|
+
/(?:^|\n)\s*(?:import|export)\s+(?:type\s+)?(?:[^'"();]*?\sfrom\s*)?["']([^"']+)["']/g,
|
|
54
|
+
/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
/** Module specifiers, static and dynamic, with comments stripped. */
|
|
58
|
+
function specifiers(file: string): string[] {
|
|
59
|
+
const src = fs
|
|
60
|
+
.readFileSync(file, "utf8")
|
|
61
|
+
.replace(/\/\*[\s\S]*?\*\//g, "")
|
|
62
|
+
.replace(/(^|\s)\/\/[^\n]*/g, "$1");
|
|
63
|
+
const found: string[] = [];
|
|
64
|
+
for (const pattern of importPatterns) {
|
|
65
|
+
pattern.lastIndex = 0;
|
|
66
|
+
let match = pattern.exec(src);
|
|
67
|
+
while (match) {
|
|
68
|
+
found.push(match[1]);
|
|
69
|
+
match = pattern.exec(src);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return found;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const isMermaid = (spec: string) => spec === "mermaid" || spec.startsWith("mermaid/");
|
|
76
|
+
|
|
77
|
+
describe("native module graph", () => {
|
|
78
|
+
it("never reaches the mermaid engine", () => {
|
|
79
|
+
const offenders = [...new Set(walk(srcDir).map(nativeTier))]
|
|
80
|
+
.filter((file) => specifiers(file).some(isMermaid))
|
|
81
|
+
.map((file) => path.relative(srcDir, file))
|
|
82
|
+
.sort();
|
|
83
|
+
expect(offenders).toEqual([]);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("keeps the web tier's lazy mermaid import, which is where it belongs", () => {
|
|
87
|
+
const web = path.join(srcDir, "mermaid", "renderMermaidDiagram.ts");
|
|
88
|
+
expect(specifiers(web).some(isMermaid)).toBe(true);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native tier of the canonical mermaid renderer (LC-16).
|
|
3
|
+
*
|
|
4
|
+
* The web tier's `import("mermaid")` is deliberately ABSENT here. mermaid
|
|
5
|
+
* needs a DOM — the web module already refuses without one — so on native
|
|
6
|
+
* that import can only ever resolve and then bail. Keeping it in the native
|
|
7
|
+
* source costs a whole graph: `import()` is not tree-shakable, so every
|
|
8
|
+
* native bundler that reaches this module has to parse mermaid and emit its
|
|
9
|
+
* chunk. mermaid's published chunks put "use strict" inside functions with
|
|
10
|
+
* non-simple parameter lists, which is illegal ESM, so rolldown fails the
|
|
11
|
+
* build outright (`one build --platform ios` died with ten PARSE_ERRORs and
|
|
12
|
+
* produced no bundle — measured shipping the Lookout iOS app, MPO-10).
|
|
13
|
+
*
|
|
14
|
+
* Because this package's barrel re-exports this module, ANY native consumer
|
|
15
|
+
* that reaches the barrel — including anyone importing a single component
|
|
16
|
+
* from @multiplatform.one/frappe-ui — inherited that failure. Dropping the
|
|
17
|
+
* import here takes mermaid off the native graph for all of them at once.
|
|
18
|
+
*
|
|
19
|
+
* The contract is unchanged: same exports, same result shape, and the same
|
|
20
|
+
* "requires a DOM" error the web tier returns when `document` is missing.
|
|
21
|
+
* `MermaidBlock.native.tsx` already renders diagram source as a code block,
|
|
22
|
+
* so nothing on native regresses.
|
|
23
|
+
*
|
|
24
|
+
* Types are declared locally rather than re-exported from the web tier:
|
|
25
|
+
* tamagui-build rewrites relative specifiers to their `.native` sibling, so
|
|
26
|
+
* `from "./renderMermaidDiagram"` would resolve back to this file. Same
|
|
27
|
+
* idiom as `MermaidBlock.native.tsx`, which redeclares its own props.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
export interface MermaidRenderOptions {
|
|
31
|
+
/** Color scheme for mermaid's built-in theming (default "light") */
|
|
32
|
+
scheme?: "light" | "dark";
|
|
33
|
+
/** Font family passed to mermaid's theme config */
|
|
34
|
+
fontFamily?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type MermaidRenderResult = { ok: true; svg: string } | { ok: false; error: string };
|
|
38
|
+
|
|
39
|
+
/** Same message the web tier returns when it cannot find a `document`. */
|
|
40
|
+
const NO_DOM = "Mermaid diagrams require a DOM environment";
|
|
41
|
+
|
|
42
|
+
export async function renderMermaidDiagram(
|
|
43
|
+
_code: string,
|
|
44
|
+
_options: MermaidRenderOptions = {},
|
|
45
|
+
): Promise<MermaidRenderResult> {
|
|
46
|
+
return { ok: false, error: NO_DOM };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Test seam parity with the web tier — nothing is cached here. */
|
|
50
|
+
export function resetMermaidForTesting(): void {}
|
|
@@ -87,3 +87,26 @@ describe("mountDiagramSvg", () => {
|
|
|
87
87
|
expect(container.childNodes.length).toBe(0);
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
|
+
|
|
91
|
+
// MPO-10: the native tier ships no mermaid import at all. It answers with
|
|
92
|
+
// the same "requires a DOM" result the web tier gives without a document,
|
|
93
|
+
// so callers need no platform branch.
|
|
94
|
+
describe("renderMermaidDiagram (native tier)", () => {
|
|
95
|
+
it("refuses with the DOM error and never touches the engine", async () => {
|
|
96
|
+
const native = await import("./renderMermaidDiagram.native");
|
|
97
|
+
await expect(native.renderMermaidDiagram("graph TD\n A-->B")).resolves.toEqual({
|
|
98
|
+
ok: false,
|
|
99
|
+
error: "Mermaid diagrams require a DOM environment",
|
|
100
|
+
});
|
|
101
|
+
expect(parse).not.toHaveBeenCalled();
|
|
102
|
+
expect(render).not.toHaveBeenCalled();
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("keeps the web tier's export surface", async () => {
|
|
106
|
+
const [web, native] = await Promise.all([
|
|
107
|
+
import("./renderMermaidDiagram"),
|
|
108
|
+
import("./renderMermaidDiagram.native"),
|
|
109
|
+
]);
|
|
110
|
+
expect(Object.keys(native).sort()).toEqual(Object.keys(web).sort());
|
|
111
|
+
});
|
|
112
|
+
});
|
package/src/shared/index.ts
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getTokens, getVariableValue } from "tamagui";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a Tamagui size/radius/space/fontSize token to CSS pixels so
|
|
5
|
+
* markdown chrome (cutoff, marker column, media fallback) scales with knobs
|
|
6
|
+
* instead of hardcoded geometry.
|
|
7
|
+
*/
|
|
8
|
+
export function tokenPx(
|
|
9
|
+
token: string | number | undefined,
|
|
10
|
+
fallback: number,
|
|
11
|
+
scale: "size" | "radius" | "space" | "fontSize" = "size",
|
|
12
|
+
): number {
|
|
13
|
+
if (typeof token === "number" && Number.isFinite(token)) return token;
|
|
14
|
+
if (token == null) return fallback;
|
|
15
|
+
try {
|
|
16
|
+
const tokens = getTokens();
|
|
17
|
+
const bucket =
|
|
18
|
+
scale === "fontSize"
|
|
19
|
+
? (tokens as { fontSize?: Record<string, unknown> }).fontSize
|
|
20
|
+
: tokens[scale];
|
|
21
|
+
const raw = getVariableValue(
|
|
22
|
+
(bucket as Record<string, unknown> | undefined)?.[String(token)] ?? token,
|
|
23
|
+
);
|
|
24
|
+
const n = typeof raw === "number" ? raw : Number.parseFloat(String(raw));
|
|
25
|
+
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
26
|
+
} catch {
|
|
27
|
+
return fallback;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared R-OUTER table chrome for MarkdownTable, MDXTable, and
|
|
5
|
+
* MarkdownSimpleTable (spec: Table renderer, MDX Table, and SimpleTable).
|
|
6
|
+
* Spread complete surface + borderRadiusOuter fragments; inner cells stay square.
|
|
7
|
+
*/
|
|
8
|
+
export function useMarkdownTableKnobs() {
|
|
9
|
+
const { knobProps } = useResolvedKnobs();
|
|
10
|
+
const cellPad = {
|
|
11
|
+
paddingHorizontal: knobProps.gap.gap,
|
|
12
|
+
paddingVertical: knobProps.gap.gap,
|
|
13
|
+
borderRadius: 0 as const,
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
knobProps,
|
|
17
|
+
frameProps: {
|
|
18
|
+
...knobProps.surface,
|
|
19
|
+
...knobProps.borderRadiusOuter,
|
|
20
|
+
overflow: "hidden" as const,
|
|
21
|
+
"data-markdown-table-frame": "true",
|
|
22
|
+
"data-border-width": String(knobProps.surface.borderWidth),
|
|
23
|
+
},
|
|
24
|
+
headerTextProps: {
|
|
25
|
+
size: knobProps.sizeToken as any,
|
|
26
|
+
...knobProps.heading,
|
|
27
|
+
},
|
|
28
|
+
cellTextProps: {
|
|
29
|
+
size: knobProps.sizeToken as any,
|
|
30
|
+
...knobProps.body,
|
|
31
|
+
},
|
|
32
|
+
cellPad,
|
|
33
|
+
headRule: {
|
|
34
|
+
borderBottomWidth: knobProps.surface.borderWidth,
|
|
35
|
+
borderBottomColor: "$borderColor" as const,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -150,7 +150,7 @@ export const Rules: Story = {
|
|
|
150
150
|
export const Lists: Story = {
|
|
151
151
|
render: () => (
|
|
152
152
|
<YStack maxWidth={700} padding="$4">
|
|
153
|
-
<TamaguiParagraph fontWeight="
|
|
153
|
+
<TamaguiParagraph fontWeight="400">Unordered</TamaguiParagraph>
|
|
154
154
|
<MarkdownList ordered={false}>
|
|
155
155
|
<MarkdownListItem index={0}>
|
|
156
156
|
<Paragraph>first item</Paragraph>
|
|
@@ -175,7 +175,7 @@ export const Lists: Story = {
|
|
|
175
175
|
</MarkdownList>
|
|
176
176
|
</MarkdownListItem>
|
|
177
177
|
</MarkdownList>
|
|
178
|
-
<TamaguiParagraph fontWeight="
|
|
178
|
+
<TamaguiParagraph fontWeight="400">Ordered (start ignored?)</TamaguiParagraph>
|
|
179
179
|
<MarkdownList ordered start={5}>
|
|
180
180
|
<MarkdownListItem ordered index={0}>
|
|
181
181
|
<Paragraph>ordered one</Paragraph>
|
|
@@ -184,7 +184,7 @@ export const Lists: Story = {
|
|
|
184
184
|
<Paragraph>ordered two</Paragraph>
|
|
185
185
|
</MarkdownListItem>
|
|
186
186
|
</MarkdownList>
|
|
187
|
-
<TamaguiParagraph fontWeight="
|
|
187
|
+
<TamaguiParagraph fontWeight="400">Tasks</TamaguiParagraph>
|
|
188
188
|
<MarkdownList ordered={false}>
|
|
189
189
|
<MarkdownListItem checked={true} index={0}>
|
|
190
190
|
<Paragraph>checked task</Paragraph>
|
|
@@ -193,9 +193,9 @@ export const Lists: Story = {
|
|
|
193
193
|
<Paragraph>unchecked task</Paragraph>
|
|
194
194
|
</MarkdownListItem>
|
|
195
195
|
</MarkdownList>
|
|
196
|
-
<TamaguiParagraph fontWeight="
|
|
196
|
+
<TamaguiParagraph fontWeight="400">Empty list</TamaguiParagraph>
|
|
197
197
|
<MarkdownList ordered={false}>{null}</MarkdownList>
|
|
198
|
-
<TamaguiParagraph fontWeight="
|
|
198
|
+
<TamaguiParagraph fontWeight="400">RTL</TamaguiParagraph>
|
|
199
199
|
<YStack style={{ direction: "rtl" } as any}>
|
|
200
200
|
<MarkdownList ordered={false}>
|
|
201
201
|
<MarkdownListItem index={0}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Aside/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ3D,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Aside/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ3D,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2CAiFvF;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,sEAAsE;AACtE,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2CAMrF"}
|
package/types/Hr/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const HR: (props:
|
|
1
|
+
export declare const HR: (props: Record<string, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/types/Hr/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Hr/index.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,EAAE,GAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Hr/index.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,EAAE,GAAI,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,4CAA2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MarkdownSimpleTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MarkdownSimpleTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,KAAK,WAAW,GAAG,SAAS,CAAC;AAqD7B,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,wBAAwB,2CAwD9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MdxCodeBlock/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MdxCodeBlock/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAGtE,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAwBD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAyIpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2CAsBpD;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2CAOpD;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2CAMpD;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2CAMpD;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2CAOpD;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2CASpD"}
|