@alloy-js/markdown 0.25.0-dev.1 → 0.25.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/CHANGELOG.md +4 -0
- package/dist/dev/src/components/Code.js.map +1 -1
- package/dist/dev/src/components/Frontmatter.js +2 -2
- package/dist/dev/src/components/Frontmatter.js.map +1 -1
- package/dist/dev/src/components/Heading.js.map +1 -1
- package/dist/dev/src/components/Link.js.map +1 -1
- package/dist/dev/src/components/List.js +3 -3
- package/dist/dev/src/components/List.js.map +1 -1
- package/dist/dev/src/components/Section.js +5 -5
- package/dist/dev/src/components/Section.js.map +1 -1
- package/dist/dev/src/components/SourceFile.js +2 -2
- package/dist/dev/src/components/SourceFile.js.map +1 -1
- package/dist/dev/src/components/index.js.map +1 -1
- package/dist/dev/src/context/section.js.map +1 -1
- package/dist/dev/src/index.js.map +1 -1
- package/dist/dev/test/Code.test.js +3 -3
- package/dist/dev/test/Code.test.js.map +1 -1
- package/dist/dev/test/Frontmatter.test.js +2 -2
- package/dist/dev/test/Frontmatter.test.js.map +1 -1
- package/dist/dev/test/list.test.js +6 -6
- package/dist/dev/test/list.test.js.map +1 -1
- package/dist/dev/test/paragraph.test.js +3 -3
- package/dist/dev/test/paragraph.test.js.map +1 -1
- package/dist/dev/test/section.test.js +6 -6
- package/dist/dev/test/section.test.js.map +1 -1
- package/dist/dev/test/utils.js +2 -2
- package/dist/dev/test/utils.js.map +1 -1
- package/dist/dev/test/vitest.d.js.map +1 -1
- package/dist/dev/test/vitest.setup.js.map +1 -1
- package/dist/src/components/Code.d.ts +1 -1
- package/dist/src/components/Code.d.ts.map +1 -1
- package/dist/src/components/Code.js.map +1 -1
- package/dist/src/components/Frontmatter.d.ts +1 -1
- package/dist/src/components/Frontmatter.d.ts.map +1 -1
- package/dist/src/components/Frontmatter.js.map +1 -1
- package/dist/src/components/Heading.d.ts +2 -2
- package/dist/src/components/Heading.d.ts.map +1 -1
- package/dist/src/components/Heading.js.map +1 -1
- package/dist/src/components/Link.d.ts +1 -1
- package/dist/src/components/Link.d.ts.map +1 -1
- package/dist/src/components/Link.js.map +1 -1
- package/dist/src/components/List.d.ts +1 -1
- package/dist/src/components/List.d.ts.map +1 -1
- package/dist/src/components/List.js.map +1 -1
- package/dist/src/components/Section.d.ts +1 -1
- package/dist/src/components/Section.d.ts.map +1 -1
- package/dist/src/components/Section.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts +1 -1
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/context/section.d.ts +1 -1
- package/dist/src/context/section.d.ts.map +1 -1
- package/dist/src/context/section.js.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/test/Code.test.js.map +1 -1
- package/dist/test/Frontmatter.test.js.map +1 -1
- package/dist/test/list.test.js.map +1 -1
- package/dist/test/paragraph.test.js.map +1 -1
- package/dist/test/section.test.js.map +1 -1
- package/dist/test/utils.d.ts +1 -1
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js.map +1 -1
- package/dist/test/vitest.d.js.map +1 -1
- package/dist/test/vitest.setup.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/components/Code.tsx +1 -1
- package/src/components/Frontmatter.tsx +5 -3
- package/src/components/Heading.tsx +3 -2
- package/src/components/Link.tsx +1 -1
- package/src/components/List.tsx +3 -4
- package/src/components/Section.tsx +2 -1
- package/src/components/SourceFile.tsx +3 -1
- package/src/context/section.ts +2 -1
- package/temp/api.json +1 -1
- package/test/Code.test.tsx +1 -0
- package/test/Frontmatter.test.tsx +1 -0
- package/test/list.test.tsx +1 -0
- package/test/paragraph.test.tsx +1 -0
- package/test/section.test.tsx +1 -0
- package/test/utils.tsx +3 -1
- package/tsdoc-metadata.json +1 -1
- package/vitest.config.ts +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/Code.tsx"],"sourcesContent":["import { List } from \"@alloy-js/core\";\nimport type { Children } from \"@alloy-js/core/jsx-runtime\";\n\nexport interface CodeProps {\n /** Language of the code block */\n lang?: string;\n\n /** Body of the code block */\n children?: Children;\n}\n\n/**\n * Render a Markdown code block\n */\nexport function Code(props: CodeProps) {\n const tripleBackticks = \"```\";\n return (\n <List>\n {tripleBackticks + props.lang}\n {props.children}\n {tripleBackticks}\n </List>\n );\n}\n"],"mappings":";AAAA,SAAS,IAAI,QAAQ,gBAAgB;AAWrC;AACA;AACA;AACA,OAAO,SAAS,IAAI,CAAC,KAAgB,EAAE;EACrC,MAAM,eAAe,GAAG,KAAK;EAC7B,yBACG,IAAI;IAAA;MAAA,qBACF,eAAe,GAAG,KAAK,CAAC,IAAI,gBAC5B,KAAK,CAAC,QAAQ,4BACd,eAAe;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA;AAGtB","ignoreList":[]}
|
|
@@ -21,9 +21,9 @@ export function Frontmatter(props) {
|
|
|
21
21
|
}
|
|
22
22
|
}, {
|
|
23
23
|
fileName: import.meta.url,
|
|
24
|
-
lineNumber:
|
|
24
|
+
lineNumber: 29,
|
|
25
25
|
columnNumber: 9
|
|
26
|
-
}), false, "_$memo(
|
|
26
|
+
}), false, "_$memo(…)(…) ? …"), "---"];
|
|
27
27
|
}
|
|
28
28
|
}, {
|
|
29
29
|
fileName: import.meta.url,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/Frontmatter.tsx"],"sourcesContent":["import { List } from \"@alloy-js/core\";\nimport type { Children } from \"@alloy-js/core/jsx-runtime\";\nimport { stringify } from \"yaml\";\n\nexport interface FrontmatterProps {\n /** Js value to automatically serialize as yaml */\n jsValue?: Record<string, unknown>;\n children?: Children;\n}\n\n/**\n * Create a frontmatter block for markdown files.\n *\n * @example\n *\n * ```markdown\n * ---\n * title: \"My Title\"\n * ---\n * ```\n */\nexport function Frontmatter(props: FrontmatterProps) {\n return (\n <List>\n {\"---\"}\n {props.jsValue ? (\n stringify(props.jsValue).trim()\n ) : (\n <List children={props.children} />\n )}\n {\"---\"}\n </List>\n );\n}\n"],"mappings":";AAAA,SAAS,IAAI,QAAQ,gBAAgB;AAErC,SAAS,SAAS,QAAQ,MAAM;AAQhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,WAAW,CAAC,KAAuB,EAAE;EACnD,yBACG,IAAI;IAAA;MAAA,QACF,KAAK,eACL,oBAAK,CAAC,OAAO,MACZ,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,qBAE9B,IAAI;QAAA,IAAC,QAAQ;UAAA,OAAE,KAAK,CAAC,QAAQ;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA,EAC/B,8BACA,KAAK;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA;AAGZ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/Heading.tsx"],"sourcesContent":["import type { Refkey } from \"@alloy-js/core\";\nimport type { Children } from \"@alloy-js/core/jsx-runtime\";\n\nimport { useSectionContext } from \"../context/section.js\";\n\nexport interface HeadingProps {\n level?: number;\n children: Children;\n refkey?: Refkey;\n}\n\nexport function Heading(props: HeadingProps) {\n const level =\n props.level !== undefined ? props.level : useSectionContext().level;\n return (\n <>\n {\"#\".repeat(level)} {props.children}\n </>\n );\n}\n"],"mappings":";AAGA,SAAS,iBAAiB,QAAQ,uBAAuB;AAQzD,OAAO,SAAS,OAAO,CAAC,KAAmB,EAAE;EAC3C,MAAM,KAAK,GACT,KAAK,CAAC,KAAK,KAAK,SAAS,GAAG,KAAK,CAAC,KAAK,GAAG,iBAAiB,CAAC,CAAC,CAAC,KAAK;EACrE,qBAEK,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAG,KAAK,CAAC,QAAQ;AAGzC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/Link.tsx"],"sourcesContent":["import type { Refkey } from \"@alloy-js/core\";\n\nexport interface LinkPropsWithRefkey {\n refkey: Refkey;\n}\n\nexport interface LinkPropsWithHref {\n href: string;\n title: string;\n}\n\nexport type LinkProps = LinkPropsWithRefkey | LinkPropsWithHref;\n\nexport function Link(props: LinkProps) {\n if (\"refkey\" in props) {\n return \"refkey\";\n }\n\n return (\n <>\n [{props.title}]({props.href})\n </>\n );\n}\n"],"mappings":";AAaA,OAAO,SAAS,IAAI,CAAC,KAAgB,EAAE;EACrC,IAAI,QAAQ,IAAI,KAAK,EAAE;IACrB,OAAO,QAAQ;EACjB;EAEA,0BAEM,KAAK,CAAC,KAAK,4CAAI,KAAK,CAAC,IAAI;AAGjC","ignoreList":[]}
|
|
@@ -18,17 +18,17 @@ export function List(props) {
|
|
|
18
18
|
return _$createIntrinsic("align", {
|
|
19
19
|
width: alignSize,
|
|
20
20
|
get children() {
|
|
21
|
-
return [_$memo(() => _$memo(() => !!props.ordered)() ? [index + start, "."] : props.bullet, false, "_$memo(
|
|
21
|
+
return [_$memo(() => _$memo(() => !!props.ordered)() ? [index + start, "."] : props.bullet, false, "_$memo(…)(…) ? …"), " ", _$memo(() => props.tasks && "[ ] ", false, "props.tasks && …"), child];
|
|
22
22
|
}
|
|
23
23
|
}, {
|
|
24
24
|
fileName: import.meta.url,
|
|
25
|
-
lineNumber:
|
|
25
|
+
lineNumber: 40,
|
|
26
26
|
columnNumber: 11
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
}, {
|
|
30
30
|
fileName: import.meta.url,
|
|
31
|
-
lineNumber:
|
|
31
|
+
lineNumber: 32,
|
|
32
32
|
columnNumber: 5
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/List.tsx"],"sourcesContent":["import { childrenArray, For } from \"@alloy-js/core\";\nimport type { Children } from \"@alloy-js/core/jsx-runtime\";\nimport { memo } from \"@alloy-js/core/jsx-runtime\";\n\nexport interface CommonListProps {\n children: Children;\n tasks?: boolean;\n}\n\nexport interface OrderedListProps extends CommonListProps {\n ordered: true;\n start?: number;\n}\n\nexport interface UnorderedListProps extends CommonListProps {\n ordered?: false | undefined;\n bullet?: \"*\" | \"-\" | \"+\";\n}\n\nexport type ListProps = OrderedListProps | UnorderedListProps;\n\nexport function List(props: ListProps) {\n const children = memo(() => {\n return childrenArray(() => props.children, {\n preserveFragments: true,\n }).filter((c) => Boolean(c));\n });\n\n const start = (props as OrderedListProps).start ?? 1;\n\n return (\n <For each={children}>\n {(child, index) => {\n // sure would be great to align based on the number of digits for\n // ordered lists, but GitHub has issues parsing them sometimes. This is\n // much more reliable.\n const alignSize = props.ordered ? 3 : 2;\n\n return (\n <align width={alignSize}>\n {props.ordered ? <>{index + start}.</> : props.bullet}{\" \"}\n {props.tasks && \"[ ] \"}\n {child}\n </align>\n );\n }}\n </For>\n );\n}\n"],"mappings":";AAAA,SAAS,aAAa,EAAE,GAAG,QAAQ,gBAAgB;AAEnD,SAAS,IAAI,QAAQ,4BAA4B;AAmBjD,OAAO,SAAS,IAAI,CAAC,KAAgB,EAAE;EACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM;IAC1B,OAAO,aAAa,CAAC,MAAM,KAAK,CAAC,QAAQ,EAAE;MACzC,iBAAiB,EAAE;IACrB,CAAC,CAAC,CAAC,MAAM,CAAE,CAAC,IAAK,OAAO,CAAC,CAAC,CAAC,CAAC;EAC9B,CAAC,CAAC;EAEF,MAAM,KAAK,GAAI,KAAK,CAAsB,KAAK,IAAI,CAAC;EAEpD,yBACG,GAAG;IAAC,IAAI,EAAE,QAAQ;IAAA,UAChB,CAAC,KAAK,EAAE,KAAK,KAAK;MACjB;MACA;MACA;MACA,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC;MAEvC;QACS,KAAK,EAAE,SAAS;QAAA;UAAA,qBACpB,oBAAK,CAAC,OAAO,OAAM,KAAK,GAAG,KAAK,SAAQ,KAAK,CAAC,MAAM,8BAAE,GAAG,eACzD,KAAK,CAAC,KAAK,IAAI,MAAM,8BACrB,KAAK;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA;IAGZ;EAAC;IAAA;IAAA;IAAA;EAAA;AAGP","ignoreList":[]}
|
|
@@ -13,9 +13,9 @@ export function Section(props) {
|
|
|
13
13
|
}
|
|
14
14
|
}, {
|
|
15
15
|
fileName: import.meta.url,
|
|
16
|
-
lineNumber:
|
|
16
|
+
lineNumber: 17,
|
|
17
17
|
columnNumber: 25
|
|
18
|
-
}), false, "_$memo(
|
|
18
|
+
}), false, "_$memo(…)(…) && …"), _$createComponent(SectionContext.Provider, {
|
|
19
19
|
get value() {
|
|
20
20
|
return {
|
|
21
21
|
...sectionContext,
|
|
@@ -30,19 +30,19 @@ export function Section(props) {
|
|
|
30
30
|
}
|
|
31
31
|
}, {
|
|
32
32
|
fileName: import.meta.url,
|
|
33
|
-
lineNumber:
|
|
33
|
+
lineNumber: 21,
|
|
34
34
|
columnNumber: 9
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}, {
|
|
38
38
|
fileName: import.meta.url,
|
|
39
|
-
lineNumber:
|
|
39
|
+
lineNumber: 18,
|
|
40
40
|
columnNumber: 7
|
|
41
41
|
})];
|
|
42
42
|
}
|
|
43
43
|
}, {
|
|
44
44
|
fileName: import.meta.url,
|
|
45
|
-
lineNumber:
|
|
45
|
+
lineNumber: 16,
|
|
46
46
|
columnNumber: 5
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/Section.tsx"],"sourcesContent":["import { List } from \"@alloy-js/core\";\nimport type { Children } from \"@alloy-js/core/jsx-runtime\";\n\nimport { SectionContext, useSectionContext } from \"../context/section.js\";\nimport { Heading } from \"./Heading.jsx\";\n\nexport interface SectionProps {\n heading?: Children;\n children: Children;\n}\n\nexport function Section(props: SectionProps) {\n const sectionContext = useSectionContext();\n\n return (\n <List doubleHardline>\n {props.heading && <Heading>{props.heading}</Heading>}\n <SectionContext.Provider\n value={{ ...sectionContext, level: sectionContext.level + 1 }}\n >\n <List doubleHardline>{props.children}</List>\n </SectionContext.Provider>\n </List>\n );\n}\n"],"mappings":";AAAA,SAAS,IAAI,QAAQ,gBAAgB;AAGrC,SAAS,cAAc,EAAE,iBAAiB,QAAQ,uBAAuB;AACzE,SAAS,OAAO;AAOhB,OAAO,SAAS,OAAO,CAAC,KAAmB,EAAE;EAC3C,MAAM,cAAc,GAAG,iBAAiB,CAAC,CAAC;EAE1C,yBACG,IAAI;IAAC,cAAc;IAAA;MAAA,qBACjB,oBAAK,CAAC,OAAO,yBAAK,OAAO;QAAA;UAAA,OAAE,KAAK,CAAC,OAAO;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA,EAAW,iDACnD,cAAc,CAAC,QAAQ;QAAA,IACtB,KAAK;UAAA,OAAE;YAAE,GAAG,cAAc;YAAE,KAAK,EAAE,cAAc,CAAC,KAAK,GAAG;UAAE,CAAC;QAAA;QAAA;UAAA,yBAE5D,IAAI;YAAC,cAAc;YAAA;cAAA,OAAE,KAAK,CAAC,QAAQ;YAAA;UAAA;YAAA;YAAA;YAAA;UAAA;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA;AAI5C","ignoreList":[]}
|
|
@@ -16,13 +16,13 @@ export function SourceFile(props) {
|
|
|
16
16
|
}
|
|
17
17
|
}, {
|
|
18
18
|
fileName: import.meta.url,
|
|
19
|
-
lineNumber:
|
|
19
|
+
lineNumber: 13,
|
|
20
20
|
columnNumber: 7
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}, {
|
|
24
24
|
fileName: import.meta.url,
|
|
25
|
-
lineNumber:
|
|
25
|
+
lineNumber: 12,
|
|
26
26
|
columnNumber: 5
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/SourceFile.tsx"],"sourcesContent":["import type { Children } from \"@alloy-js/core\";\nimport { SourceFile as CoreSourceFile, List } from \"@alloy-js/core\";\n\nimport { Link } from \"./Link.jsx\";\n\nexport interface SourceFileProps {\n path: string;\n children: Children;\n}\nexport function SourceFile(props: SourceFileProps) {\n return (\n <CoreSourceFile path={props.path} filetype=\"md\" reference={Link}>\n <List doubleHardline>{props.children}</List>\n </CoreSourceFile>\n );\n}\n"],"mappings":";AACA,SAAS,UAAU,IAAI,cAAc,EAAE,IAAI,QAAQ,gBAAgB;AAEnE,SAAS,IAAI;AAMb,OAAO,SAAS,UAAU,CAAC,KAAsB,EAAE;EACjD,yBACG,cAAc;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,IAAI;IAAA;IAAE,QAAQ;IAAM,SAAS,EAAE,IAAI;IAAA;MAAA,yBAC5D,IAAI;QAAC,cAAc;QAAA;UAAA,OAAE,KAAK,CAAC,QAAQ;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA;AAG1C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/components/index.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/index.ts"],"sourcesContent":["export * from \"./Code.jsx\";\nexport * from \"./Frontmatter.jsx\";\nexport * from \"./Heading.jsx\";\nexport * from \"./Link.jsx\";\nexport * from \"./List.jsx\";\nexport * from \"./Section.jsx\";\nexport * from \"./SourceFile.jsx\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/context/section.ts"],"sourcesContent":["import type { ComponentContext } from \"@alloy-js/core\";\nimport { createContext, useContext } from \"@alloy-js/core\";\n\nexport interface SectionContext {\n level: number;\n}\n\nexport const SectionContext: ComponentContext<SectionContext> =\n createContext<SectionContext>({ level: 1 });\n\nexport function useSectionContext(): SectionContext {\n const context = useContext(SectionContext);\n\n if (context === undefined) {\n throw new Error(\"useSectionContext must be used within a Section\");\n }\n return context;\n}\n"],"mappings":"AACA,SAAS,aAAa,EAAE,UAAU,QAAQ,gBAAgB;AAM1D,OAAO,MAAM,cAAgD,GAC3D,aAAa,CAAiB;EAAE,KAAK,EAAE;AAAE,CAAC,CAAC;AAE7C,OAAO,SAAS,iBAAiB,GAAmB;EAClD,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC;EAE1C,IAAI,OAAO,KAAK,SAAS,EAAE;IACzB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC;EACpE;EACA,OAAO,OAAO;AAChB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/index.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/index.ts"],"sourcesContent":["export * from \"./components/index.js\";\n"],"mappings":"AAAA,cAAc,uBAAuB","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ it("renders with js value", () => {
|
|
|
10
10
|
children: "const foo = 123;\nconsole.log(foo);"
|
|
11
11
|
}, {
|
|
12
12
|
fileName: import.meta.url,
|
|
13
|
-
lineNumber:
|
|
13
|
+
lineNumber: 10,
|
|
14
14
|
columnNumber: 5
|
|
15
15
|
}));
|
|
16
16
|
expect(template).toRenderTo(d`
|
|
@@ -30,13 +30,13 @@ it("renders with children", () => {
|
|
|
30
30
|
}
|
|
31
31
|
}, {
|
|
32
32
|
fileName: import.meta.url,
|
|
33
|
-
lineNumber:
|
|
33
|
+
lineNumber: 24,
|
|
34
34
|
columnNumber: 7
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}, {
|
|
38
38
|
fileName: import.meta.url,
|
|
39
|
-
lineNumber:
|
|
39
|
+
lineNumber: 23,
|
|
40
40
|
columnNumber: 5
|
|
41
41
|
}));
|
|
42
42
|
expect(template).toRenderTo(d`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../test/Code.test.tsx"],"sourcesContent":["import { List } from \"@alloy-js/core\";\nimport { d } from \"@alloy-js/core/testing\";\nimport { expect, it } from \"vitest\";\n\nimport { Code } from \"../src/components/Code.jsx\";\nimport { mdTest } from \"./utils.jsx\";\n\nit(\"renders with js value\", () => {\n const template = mdTest(\n <Code lang=\"ts\" children={\"const foo = 123;\\nconsole.log(foo);\"} />,\n );\n\n expect(template).toRenderTo(d`\n \\`\\`\\`ts\n const foo = 123;\n console.log(foo);\n \\`\\`\\`\n `);\n});\n\nit(\"renders with children\", () => {\n const template = mdTest(\n <Code lang=\"ts\">\n <List>\n <>const foo = 123;</>\n <>console.log(foo);</>\n </List>\n </Code>,\n );\n\n expect(template).toRenderTo(d`\n \\`\\`\\`ts\n const foo = 123;\n console.log(foo);\n \\`\\`\\`\n `);\n});\n"],"mappings":";AAAA,SAAS,IAAI,QAAQ,gBAAgB;AACrC,SAAS,CAAC,QAAQ,wBAAwB;AAC1C,SAAS,MAAM,EAAE,EAAE,QAAQ,QAAQ;AAEnC,SAAS,IAAI;AACb,SAAS,MAAM;AAEf,EAAE,CAAC,uBAAuB,EAAE,MAAM;EAChC,MAAM,QAAQ,GAAG,MAAM,mBACpB,IAAI;IAAC,IAAI;IAAM,QAAQ,EAAE;EAAqC;IAAA;IAAA;IAAA;EAAA,EACjE,CAAC;EAED,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;AAC/B;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEF,EAAE,CAAC,uBAAuB,EAAE,MAAM;EAChC,MAAM,QAAQ,GAAG,MAAM,mBACpB,IAAI;IAAC,IAAI;IAAA;MAAA,yBACP,IAAI;QAAA;UAAA;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA,EAKT,CAAC;EAED,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;AAC/B;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ it("renders with js value", () => {
|
|
|
11
11
|
}
|
|
12
12
|
}, {
|
|
13
13
|
fileName: import.meta.url,
|
|
14
|
-
lineNumber:
|
|
14
|
+
lineNumber: 9,
|
|
15
15
|
columnNumber: 5
|
|
16
16
|
}));
|
|
17
17
|
expect(template).toRenderTo(d`
|
|
@@ -30,7 +30,7 @@ it("renders with children", () => {
|
|
|
30
30
|
}
|
|
31
31
|
}, {
|
|
32
32
|
fileName: import.meta.url,
|
|
33
|
-
lineNumber:
|
|
33
|
+
lineNumber: 24,
|
|
34
34
|
columnNumber: 5
|
|
35
35
|
}));
|
|
36
36
|
expect(template).toRenderTo(d`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../test/Frontmatter.test.tsx"],"sourcesContent":["import { d } from \"@alloy-js/core/testing\";\nimport { expect, it } from \"vitest\";\n\nimport { Frontmatter } from \"../src/components/Frontmatter.jsx\";\nimport { mdTest } from \"./utils.jsx\";\n\nit(\"renders with js value\", () => {\n const template = mdTest(\n <Frontmatter jsValue={{ title: \"My Title\", tags: [\"tag1\", \"tag2\"] }} />,\n );\n\n expect(template).toRenderTo(d`\n ---\n title: My Title\n tags:\n - tag1\n - tag2\n ---\n `);\n});\n\nit(\"renders with children\", () => {\n const template = mdTest(\n <Frontmatter>\n <>{`title: My Title`}</>\n <>{`tags:`}</>\n <>{` - tag1`}</>\n <>{` - tag2`}</>\n </Frontmatter>,\n );\n\n expect(template).toRenderTo(d`\n ---\n title: My Title\n tags:\n - tag1\n - tag2\n ---\n `);\n});\n"],"mappings":";AAAA,SAAS,CAAC,QAAQ,wBAAwB;AAC1C,SAAS,MAAM,EAAE,EAAE,QAAQ,QAAQ;AAEnC,SAAS,WAAW;AACpB,SAAS,MAAM;AAEf,EAAE,CAAC,uBAAuB,EAAE,MAAM;EAChC,MAAM,QAAQ,GAAG,MAAM,mBACpB,WAAW;IAAC,OAAO,EAAE;MAAE,KAAK,EAAE,UAAU;MAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM;IAAE;EAAC;IAAA;IAAA;IAAA;EAAA,EACrE,CAAC;EAED,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEF,EAAE,CAAC,uBAAuB,EAAE,MAAM;EAChC,MAAM,QAAQ,GAAG,MAAM,mBACpB,WAAW;IAAA;MAAA,SACP,iBAAiB,IACjB,OAAO,IACP,UAAU,IACV,UAAU;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA,EAEjB,CAAC;EAED,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -9,7 +9,7 @@ it("renders ordered lists", () => {
|
|
|
9
9
|
get children() {
|
|
10
10
|
return [["Item 1"], ["Item 2"], ["Item 3", _$createIntrinsic("hbr", {}, {
|
|
11
11
|
fileName: import.meta.url,
|
|
12
|
-
lineNumber:
|
|
12
|
+
lineNumber: 13,
|
|
13
13
|
columnNumber: 15
|
|
14
14
|
}), _$createComponent(List, {
|
|
15
15
|
ordered: true,
|
|
@@ -19,13 +19,13 @@ it("renders ordered lists", () => {
|
|
|
19
19
|
}
|
|
20
20
|
}, {
|
|
21
21
|
fileName: import.meta.url,
|
|
22
|
-
lineNumber:
|
|
22
|
+
lineNumber: 14,
|
|
23
23
|
columnNumber: 9
|
|
24
24
|
})]];
|
|
25
25
|
}
|
|
26
26
|
}, {
|
|
27
27
|
fileName: import.meta.url,
|
|
28
|
-
lineNumber:
|
|
28
|
+
lineNumber: 9,
|
|
29
29
|
columnNumber: 5
|
|
30
30
|
}));
|
|
31
31
|
expect(template).toRenderTo(d`
|
|
@@ -43,7 +43,7 @@ it("renders task lists", () => {
|
|
|
43
43
|
get children() {
|
|
44
44
|
return [["Item 1"], ["Item 2"], ["Item 3", _$createIntrinsic("hbr", {}, {
|
|
45
45
|
fileName: import.meta.url,
|
|
46
|
-
lineNumber:
|
|
46
|
+
lineNumber: 37,
|
|
47
47
|
columnNumber: 15
|
|
48
48
|
}), _$createComponent(List, {
|
|
49
49
|
tasks: true,
|
|
@@ -53,13 +53,13 @@ it("renders task lists", () => {
|
|
|
53
53
|
}
|
|
54
54
|
}, {
|
|
55
55
|
fileName: import.meta.url,
|
|
56
|
-
lineNumber:
|
|
56
|
+
lineNumber: 38,
|
|
57
57
|
columnNumber: 9
|
|
58
58
|
})]];
|
|
59
59
|
}
|
|
60
60
|
}, {
|
|
61
61
|
fileName: import.meta.url,
|
|
62
|
-
lineNumber:
|
|
62
|
+
lineNumber: 33,
|
|
63
63
|
columnNumber: 5
|
|
64
64
|
}));
|
|
65
65
|
expect(template).toRenderTo(d`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../test/list.test.tsx"],"sourcesContent":["import { d } from \"@alloy-js/core/testing\";\nimport { expect, it } from \"vitest\";\n\nimport { List } from \"../src/components/List.jsx\";\nimport { mdTest } from \"./utils.jsx\";\n\nit(\"renders ordered lists\", () => {\n const template = mdTest(\n <List ordered>\n <>Item 1</>\n <>Item 2</>\n <>\n Item 3<hbr />\n <List ordered start={10}>\n <>Item 3.1</>\n <>Item 3.2</>\n </List>\n </>\n </List>,\n );\n\n expect(template).toRenderTo(d`\n 1. Item 1\n 2. Item 2\n 3. Item 3\n 10. Item 3.1\n 11. Item 3.2\n `);\n});\n\nit(\"renders task lists\", () => {\n const template = mdTest(\n <List tasks bullet=\"-\">\n <>Item 1</>\n <>Item 2</>\n <>\n Item 3<hbr />\n <List tasks ordered>\n <>Item 3.1</>\n <>Item 3.2</>\n </List>\n </>\n </List>,\n );\n\n expect(template).toRenderTo(d`\n - [ ] Item 1\n - [ ] Item 2\n - [ ] Item 3\n 1. [ ] Item 3.1\n 2. [ ] Item 3.2\n `);\n});\n"],"mappings":";AAAA,SAAS,CAAC,QAAQ,wBAAwB;AAC1C,SAAS,MAAM,EAAE,EAAE,QAAQ,QAAQ;AAEnC,SAAS,IAAI;AACb,SAAS,MAAM;AAEf,EAAE,CAAC,uBAAuB,EAAE,MAAM;EAChC,MAAM,QAAQ,GAAG,MAAM,mBACpB,IAAI;IAAC,OAAO;IAAA;MAAA;QAAA;QAAA;QAAA;MAAA,sBAKR,IAAI;QAAC,OAAO;QAAC,KAAK,EAAE,EAAE;QAAA;UAAA;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA,EAM7B,CAAC;EAED,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;AAC/B;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEF,EAAE,CAAC,oBAAoB,EAAE,MAAM;EAC7B,MAAM,QAAQ,GAAG,MAAM,mBACpB,IAAI;IAAC,KAAK;IAAC,MAAM;IAAA;MAAA;QAAA;QAAA;QAAA;MAAA,sBAKb,IAAI;QAAC,KAAK;QAAC,OAAO;QAAA;UAAA;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA,EAMzB,CAAC;EAED,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;AAC/B;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -11,19 +11,19 @@ it("renders a section", () => {
|
|
|
11
11
|
children: "This is some text content that should be wrapped and such. We can put *italic* and **bold** text here, and it should be rendered correctly. We can also put in some code: `const x = 1;` and it should be rendered correctly. We can also put in some links: [Alloy](https://alloy-framework.github.io/alloy). It's pretty nice."
|
|
12
12
|
}, {
|
|
13
13
|
fileName: import.meta.url,
|
|
14
|
-
lineNumber:
|
|
14
|
+
lineNumber: 10,
|
|
15
15
|
columnNumber: 7
|
|
16
16
|
}), _$createComponent(Prose, {
|
|
17
17
|
children: "Subsequent paragraphs should have a blank line between them."
|
|
18
18
|
}, {
|
|
19
19
|
fileName: import.meta.url,
|
|
20
|
-
lineNumber:
|
|
20
|
+
lineNumber: 17,
|
|
21
21
|
columnNumber: 7
|
|
22
22
|
})];
|
|
23
23
|
}
|
|
24
24
|
}, {
|
|
25
25
|
fileName: import.meta.url,
|
|
26
|
-
lineNumber:
|
|
26
|
+
lineNumber: 9,
|
|
27
27
|
columnNumber: 5
|
|
28
28
|
}));
|
|
29
29
|
expect(template).toRenderTo(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../test/paragraph.test.tsx"],"sourcesContent":["import { Prose } from \"@alloy-js/core\";\nimport { expect, it } from \"vitest\";\n\nimport { Section } from \"../src/components/Section.jsx\";\nimport { mdTest } from \"./utils.jsx\";\n\nit(\"renders a section\", () => {\n const template = mdTest(\n <Section heading=\"hello\">\n <Prose>\n This is some text content that should be wrapped and such. We can put\n *italic* and **bold** text here, and it should be rendered correctly. We\n can also put in some code: `const x = 1;` and it should be rendered\n correctly. We can also put in some links:\n [Alloy](https://alloy-framework.github.io/alloy). It's pretty nice.\n </Prose>\n <Prose>\n Subsequent paragraphs should have a blank line between them.\n </Prose>\n </Section>,\n );\n\n expect(template).toRenderTo(\n `\n # hello\n\n This is some text content that should be\n wrapped and such. We can put *italic*\n and **bold** text here, and it should be\n rendered correctly. We can also put in\n some code: \\`const x = 1;\\` and it should\n be rendered correctly. We can also put\n in some links:\n [Alloy](https://alloy-framework.github.io/alloy).\n It's pretty nice.\n\n Subsequent paragraphs should have a\n blank line between them.\n `,\n { printWidth: 40 },\n );\n});\n"],"mappings":";AAAA,SAAS,KAAK,QAAQ,gBAAgB;AACtC,SAAS,MAAM,EAAE,EAAE,QAAQ,QAAQ;AAEnC,SAAS,OAAO;AAChB,SAAS,MAAM;AAEf,EAAE,CAAC,mBAAmB,EAAE,MAAM;EAC5B,MAAM,QAAQ,GAAG,MAAM,mBACpB,OAAO;IAAC,OAAO;IAAA;MAAA,0BACb,KAAK;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA,sBAOL,KAAK;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA,EAIV,CAAC;EAED,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CACzB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EACC;IAAE,UAAU,EAAE;EAAG,CACnB,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ it("renders a section", () => {
|
|
|
8
8
|
children: "world"
|
|
9
9
|
}, {
|
|
10
10
|
fileName: import.meta.url,
|
|
11
|
-
lineNumber:
|
|
11
|
+
lineNumber: 7,
|
|
12
12
|
columnNumber: 28
|
|
13
13
|
})]);
|
|
14
14
|
expect(template).toRenderTo(`
|
|
@@ -23,14 +23,14 @@ it("renders multiple sections", () => {
|
|
|
23
23
|
children: "world"
|
|
24
24
|
}, {
|
|
25
25
|
fileName: import.meta.url,
|
|
26
|
-
lineNumber:
|
|
26
|
+
lineNumber: 18,
|
|
27
27
|
columnNumber: 5
|
|
28
28
|
}), _$createComponent(Section, {
|
|
29
29
|
heading: "hello",
|
|
30
30
|
children: "world"
|
|
31
31
|
}, {
|
|
32
32
|
fileName: import.meta.url,
|
|
33
|
-
lineNumber:
|
|
33
|
+
lineNumber: 19,
|
|
34
34
|
columnNumber: 5
|
|
35
35
|
})]);
|
|
36
36
|
expect(template).toRenderTo(`
|
|
@@ -52,20 +52,20 @@ it("renders nested sections", () => {
|
|
|
52
52
|
children: "subworld"
|
|
53
53
|
}, {
|
|
54
54
|
fileName: import.meta.url,
|
|
55
|
-
lineNumber:
|
|
55
|
+
lineNumber: 37,
|
|
56
56
|
columnNumber: 7
|
|
57
57
|
})];
|
|
58
58
|
}
|
|
59
59
|
}, {
|
|
60
60
|
fileName: import.meta.url,
|
|
61
|
-
lineNumber:
|
|
61
|
+
lineNumber: 35,
|
|
62
62
|
columnNumber: 5
|
|
63
63
|
}), _$createComponent(Section, {
|
|
64
64
|
heading: "hello",
|
|
65
65
|
children: "world"
|
|
66
66
|
}, {
|
|
67
67
|
fileName: import.meta.url,
|
|
68
|
-
lineNumber:
|
|
68
|
+
lineNumber: 39,
|
|
69
69
|
columnNumber: 5
|
|
70
70
|
})]);
|
|
71
71
|
expect(template).toRenderTo(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../test/section.test.tsx"],"sourcesContent":["import { expect, it } from \"vitest\";\n\nimport { Section } from \"../src/components/Section.jsx\";\nimport { mdTest } from \"./utils.jsx\";\n\nit(\"renders a section\", () => {\n const template = mdTest([<Section heading=\"hello\">world</Section>]);\n\n expect(template).toRenderTo(`\n # hello\n \n world\n `);\n});\n\nit(\"renders multiple sections\", () => {\n const template = mdTest([\n <Section heading=\"hello\">world</Section>,\n <Section heading=\"hello\">world</Section>,\n ]);\n\n expect(template).toRenderTo(`\n # hello\n \n world\n\n # hello\n\n world\n `);\n});\n\nit(\"renders nested sections\", () => {\n const template = mdTest([\n <Section heading=\"hello\">\n world\n <Section heading=\"subhello\">subworld</Section>\n </Section>,\n <Section heading=\"hello\">world</Section>,\n ]);\n\n expect(template).toRenderTo(`\n # hello\n\n world\n\n ## subhello\n\n subworld\n\n # hello\n\n world\n `);\n});\n"],"mappings":";AAAA,SAAS,MAAM,EAAE,EAAE,QAAQ,QAAQ;AAEnC,SAAS,OAAO;AAChB,SAAS,MAAM;AAEf,EAAE,CAAC,mBAAmB,EAAE,MAAM;EAC5B,MAAM,QAAQ,GAAG,MAAM,CAAC,mBAAE,OAAO;IAAC,OAAO;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA,GAAyB,CAAC;EAEnE,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC;AAC9B;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEF,EAAE,CAAC,2BAA2B,EAAE,MAAM;EACpC,MAAM,QAAQ,GAAG,MAAM,CAAC,mBACrB,OAAO;IAAC,OAAO;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA,sBACf,OAAO;IAAC,OAAO;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA,GACjB,CAAC;EAEF,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEF,EAAE,CAAC,yBAAyB,EAAE,MAAM;EAClC,MAAM,QAAQ,GAAG,MAAM,CAAC,mBACrB,OAAO;IAAC,OAAO;IAAA;MAAA,mCAEb,OAAO;QAAC,OAAO;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA,sBAEjB,OAAO;IAAC,OAAO;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA,GACjB,CAAC;EAEF,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/dist/dev/test/utils.js
CHANGED
|
@@ -9,13 +9,13 @@ export function mdTest(children) {
|
|
|
9
9
|
children: children
|
|
10
10
|
}, {
|
|
11
11
|
fileName: import.meta.url,
|
|
12
|
-
lineNumber:
|
|
12
|
+
lineNumber: 9,
|
|
13
13
|
columnNumber: 7
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
}, {
|
|
17
17
|
fileName: import.meta.url,
|
|
18
|
-
lineNumber:
|
|
18
|
+
lineNumber: 8,
|
|
19
19
|
columnNumber: 5
|
|
20
20
|
});
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../test/utils.tsx"],"sourcesContent":["import type { Children } from \"@alloy-js/core\";\nimport { Output } from \"@alloy-js/core\";\n\nimport { SourceFile } from \"../src/components/SourceFile.jsx\";\n\nexport function mdTest(children: Children) {\n return (\n <Output>\n <SourceFile path=\"test.md\">{children}</SourceFile>\n </Output>\n );\n}\n"],"mappings":";AACA,SAAS,MAAM,QAAQ,gBAAgB;AAEvC,SAAS,UAAU;AAEnB,OAAO,SAAS,MAAM,CAAC,QAAkB,EAAE;EACzC,yBACG,MAAM;IAAA;MAAA,yBACJ,UAAU;QAAC,IAAI;QAAA,UAAY;MAAQ;QAAA;QAAA;QAAA;MAAA;IAAA;EAAA;IAAA;IAAA;IAAA;EAAA;AAG1C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../test/vitest.d.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../test/vitest.d.ts"],"sourcesContent":["import \"vitest\";\n\ninterface ToRenderToRenderOptions {\n printWidth?: number;\n tabWidth?: number;\n useTabs?: boolean;\n}\n\ninterface CustomMatchers<R = unknown> {\n toRenderTo: (str: string, options?: ToRenderToRenderOptions) => R;\n}\n\ndeclare module \"vitest\" {\n interface Assertion<T = any> extends CustomMatchers<T> {}\n interface AsymmetricMatchersContaining extends CustomMatchers {}\n}\n"],"mappings":"AAAA,OAAO,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../test/vitest.setup.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../test/vitest.setup.ts"],"sourcesContent":["import \"@alloy-js/core/testing\";\n"],"mappings":"AAAA,OAAO,wBAAwB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../src/components/Code.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../src/components/Code.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,WAAW,SAAS;IACxB,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,YASpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/Code.tsx"],"sourcesContent":["import { List } from \"@alloy-js/core\";\nimport type { Children } from \"@alloy-js/core/jsx-runtime\";\n\nexport interface CodeProps {\n /** Language of the code block */\n lang?: string;\n\n /** Body of the code block */\n children?: Children;\n}\n\n/**\n * Render a Markdown code block\n */\nexport function Code(props: CodeProps) {\n const tripleBackticks = \"```\";\n return (\n <List>\n {tripleBackticks + props.lang}\n {props.children}\n {tripleBackticks}\n </List>\n );\n}\n"],"mappings":";AAAA,SAAS,IAAI,QAAQ,gBAAgB;AAWrC;AACA;AACA;AACA,OAAO,SAAS,IAAI,CAAC,KAAgB,EAAE;EACrC,MAAM,eAAe,GAAG,KAAK;EAC7B,yBACG,IAAI;IAAA;MAAA,qBACF,eAAe,GAAG,KAAK,CAAC,IAAI,gBAC5B,KAAK,CAAC,QAAQ,GACd,eAAe;IAAA;EAAA;AAGtB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frontmatter.d.ts","sourceRoot":"","sources":["../../../src/components/Frontmatter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"Frontmatter.d.ts","sourceRoot":"","sources":["../../../src/components/Frontmatter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D,MAAM,WAAW,gBAAgB;IAC/B,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YAYlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/Frontmatter.tsx"],"sourcesContent":["import { List } from \"@alloy-js/core\";\nimport type { Children } from \"@alloy-js/core/jsx-runtime\";\nimport { stringify } from \"yaml\";\n\nexport interface FrontmatterProps {\n /** Js value to automatically serialize as yaml */\n jsValue?: Record<string, unknown>;\n children?: Children;\n}\n\n/**\n * Create a frontmatter block for markdown files.\n *\n * @example\n *\n * ```markdown\n * ---\n * title: \"My Title\"\n * ---\n * ```\n */\nexport function Frontmatter(props: FrontmatterProps) {\n return (\n <List>\n {\"---\"}\n {props.jsValue ? (\n stringify(props.jsValue).trim()\n ) : (\n <List children={props.children} />\n )}\n {\"---\"}\n </List>\n );\n}\n"],"mappings":";AAAA,SAAS,IAAI,QAAQ,gBAAgB;AAErC,SAAS,SAAS,QAAQ,MAAM;AAQhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,WAAW,CAAC,KAAuB,EAAE;EACnD,yBACG,IAAI;IAAA;MAAA,QACF,KAAK,eACL,oBAAK,CAAC,OAAO,MACZ,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,qBAE9B,IAAI;QAAA,IAAC,QAAQ;UAAA,OAAE,KAAK,CAAC,QAAQ;QAAA;MAAA,EAC/B,GACA,KAAK;IAAA;EAAA;AAGZ","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Refkey } from "@alloy-js/core";
|
|
2
|
-
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import type { Refkey } from "@alloy-js/core";
|
|
2
|
+
import type { Children } from "@alloy-js/core/jsx-runtime";
|
|
3
3
|
export interface HeadingProps {
|
|
4
4
|
level?: number;
|
|
5
5
|
children: Children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../src/components/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../src/components/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAI3D,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,YAQ1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/Heading.tsx"],"sourcesContent":["import type { Refkey } from \"@alloy-js/core\";\nimport type { Children } from \"@alloy-js/core/jsx-runtime\";\n\nimport { useSectionContext } from \"../context/section.js\";\n\nexport interface HeadingProps {\n level?: number;\n children: Children;\n refkey?: Refkey;\n}\n\nexport function Heading(props: HeadingProps) {\n const level =\n props.level !== undefined ? props.level : useSectionContext().level;\n return (\n <>\n {\"#\".repeat(level)} {props.children}\n </>\n );\n}\n"],"mappings":";AAGA,SAAS,iBAAiB,QAAQ,uBAAuB;AAQzD,OAAO,SAAS,OAAO,CAAC,KAAmB,EAAE;EAC3C,MAAM,KAAK,GACT,KAAK,CAAC,KAAK,KAAK,SAAS,GAAG,KAAK,CAAC,KAAK,GAAG,iBAAiB,CAAC,CAAC,CAAC,KAAK;EACrE,qBAEK,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAG,KAAK,CAAC,QAAQ;AAGzC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,SAAS,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;AAEhE,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,qCAUpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/Link.tsx"],"sourcesContent":["import type { Refkey } from \"@alloy-js/core\";\n\nexport interface LinkPropsWithRefkey {\n refkey: Refkey;\n}\n\nexport interface LinkPropsWithHref {\n href: string;\n title: string;\n}\n\nexport type LinkProps = LinkPropsWithRefkey | LinkPropsWithHref;\n\nexport function Link(props: LinkProps) {\n if (\"refkey\" in props) {\n return \"refkey\";\n }\n\n return (\n <>\n [{props.title}]({props.href})\n </>\n );\n}\n"],"mappings":";AAaA,OAAO,SAAS,IAAI,CAAC,KAAgB,EAAE;EACrC,IAAI,QAAQ,IAAI,KAAK,EAAE;IACrB,OAAO,QAAQ;EACjB;EAEA,0BAEM,KAAK,CAAC,KAAK,sBAAI,KAAK,CAAC,IAAI;AAGjC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/components/List.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/components/List.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC1B;AAED,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAE9D,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,YA2BpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/List.tsx"],"sourcesContent":["import { childrenArray, For } from \"@alloy-js/core\";\nimport type { Children } from \"@alloy-js/core/jsx-runtime\";\nimport { memo } from \"@alloy-js/core/jsx-runtime\";\n\nexport interface CommonListProps {\n children: Children;\n tasks?: boolean;\n}\n\nexport interface OrderedListProps extends CommonListProps {\n ordered: true;\n start?: number;\n}\n\nexport interface UnorderedListProps extends CommonListProps {\n ordered?: false | undefined;\n bullet?: \"*\" | \"-\" | \"+\";\n}\n\nexport type ListProps = OrderedListProps | UnorderedListProps;\n\nexport function List(props: ListProps) {\n const children = memo(() => {\n return childrenArray(() => props.children, {\n preserveFragments: true,\n }).filter((c) => Boolean(c));\n });\n\n const start = (props as OrderedListProps).start ?? 1;\n\n return (\n <For each={children}>\n {(child, index) => {\n // sure would be great to align based on the number of digits for\n // ordered lists, but GitHub has issues parsing them sometimes. This is\n // much more reliable.\n const alignSize = props.ordered ? 3 : 2;\n\n return (\n <align width={alignSize}>\n {props.ordered ? <>{index + start}.</> : props.bullet}{\" \"}\n {props.tasks && \"[ ] \"}\n {child}\n </align>\n );\n }}\n </For>\n );\n}\n"],"mappings":";AAAA,SAAS,aAAa,EAAE,GAAG,QAAQ,gBAAgB;AAEnD,SAAS,IAAI,QAAQ,4BAA4B;AAmBjD,OAAO,SAAS,IAAI,CAAC,KAAgB,EAAE;EACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM;IAC1B,OAAO,aAAa,CAAC,MAAM,KAAK,CAAC,QAAQ,EAAE;MACzC,iBAAiB,EAAE;IACrB,CAAC,CAAC,CAAC,MAAM,CAAE,CAAC,IAAK,OAAO,CAAC,CAAC,CAAC,CAAC;EAC9B,CAAC,CAAC;EAEF,MAAM,KAAK,GAAI,KAAK,CAAsB,KAAK,IAAI,CAAC;EAEpD,yBACG,GAAG;IAAC,IAAI,EAAE,QAAQ;IAAA,UAChB,CAAC,KAAK,EAAE,KAAK,KAAK;MACjB;MACA;MACA;MACA,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC;MAEvC;QACS,KAAK,EAAE,SAAS;QAAA;UAAA,qBACpB,oBAAK,CAAC,OAAO,OAAM,KAAK,GAAG,KAAK,SAAQ,KAAK,CAAC,MAAM,GAAE,GAAG,eACzD,KAAK,CAAC,KAAK,IAAI,MAAM,GACrB,KAAK;QAAA;MAAA;IAGZ;EAAC;AAGP","ignoreList":[]}
|