@mintlify/msft-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/components/content-components/all-components.js +27 -0
- package/dist/components/content-components/all-components.js.map +1 -0
- package/dist/components/content-components/callouts.js +50 -0
- package/dist/components/content-components/callouts.js.map +1 -0
- package/dist/components/content-components/callouts.module.css.js +26 -0
- package/dist/components/content-components/callouts.module.css.js.map +1 -0
- package/dist/components/content-components/code-block.js +86 -0
- package/dist/components/content-components/code-block.js.map +1 -0
- package/dist/components/content-components/code-block.module.css.js +28 -0
- package/dist/components/content-components/code-block.module.css.js.map +1 -0
- package/dist/components/content-components/default-components.js +36 -0
- package/dist/components/content-components/default-components.js.map +1 -0
- package/dist/components/content-components/default-components.module.css.js +12 -0
- package/dist/components/content-components/default-components.module.css.js.map +1 -0
- package/dist/components/content-components/details/details.js +42 -0
- package/dist/components/content-components/details/details.js.map +1 -0
- package/dist/components/content-components/details/details.module.css.js +20 -0
- package/dist/components/content-components/details/details.module.css.js.map +1 -0
- package/dist/components/content-components/heading.js +9 -0
- package/dist/components/content-components/heading.js.map +1 -0
- package/dist/components/content-components/link.js +23 -0
- package/dist/components/content-components/link.js.map +1 -0
- package/dist/components/content-components/link.module.css.js +10 -0
- package/dist/components/content-components/link.module.css.js.map +1 -0
- package/dist/components/content-components/param-name.js +9 -0
- package/dist/components/content-components/param-name.js.map +1 -0
- package/dist/components/content-components/param-name.module.css.js +8 -0
- package/dist/components/content-components/param-name.module.css.js.map +1 -0
- package/dist/components/content-components/table/index.js +122 -0
- package/dist/components/content-components/table/index.js.map +1 -0
- package/dist/components/content-components/table/table-modal.js +64 -0
- package/dist/components/content-components/table/table-modal.js.map +1 -0
- package/dist/components/content-components/table/table-modal.module.css.js +18 -0
- package/dist/components/content-components/table/table-modal.module.css.js.map +1 -0
- package/dist/components/content-components/table/table.module.css.js +30 -0
- package/dist/components/content-components/table/table.module.css.js.map +1 -0
- package/dist/components/content-components/tabs/tab.js +8 -0
- package/dist/components/content-components/tabs/tab.js.map +1 -0
- package/dist/components/content-components/tabs/tabs.js +87 -0
- package/dist/components/content-components/tabs/tabs.js.map +1 -0
- package/dist/components/content-components/tabs/tabs.module.css.js +24 -0
- package/dist/components/content-components/tabs/tabs.module.css.js.map +1 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-context.js +52 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-context.js.map +1 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-selector.js +74 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-selector.js.map +1 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-selector.module.css.js +14 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-selector.module.css.js.map +1 -0
- package/dist/components/content-components/zone-pivots/zone-pivot.js +25 -0
- package/dist/components/content-components/zone-pivots/zone-pivot.js.map +1 -0
- package/dist/components/content-components/zone-pivots/zone-target.js +8 -0
- package/dist/components/content-components/zone-pivots/zone-target.js.map +1 -0
- package/dist/components/mdx-renderer.js +13 -0
- package/dist/components/mdx-renderer.js.map +1 -0
- package/dist/components/mdx-renderer.module.css.js +8 -0
- package/dist/components/mdx-renderer.module.css.js.map +1 -0
- package/dist/components/nav-tree/dropdown-menu.js +68 -0
- package/dist/components/nav-tree/dropdown-menu.js.map +1 -0
- package/dist/components/nav-tree/dropdown-menu.module.css.js +52 -0
- package/dist/components/nav-tree/dropdown-menu.module.css.js.map +1 -0
- package/dist/components/nav-tree/index.js +126 -0
- package/dist/components/nav-tree/index.js.map +1 -0
- package/dist/components/nav-tree/mobile-nav.js +60 -0
- package/dist/components/nav-tree/mobile-nav.js.map +1 -0
- package/dist/components/nav-tree/mobile-nav.module.css.js +22 -0
- package/dist/components/nav-tree/mobile-nav.module.css.js.map +1 -0
- package/dist/components/nav-tree/nav-tree.module.css.js +34 -0
- package/dist/components/nav-tree/nav-tree.module.css.js.map +1 -0
- package/dist/components/page-context-menu.js +123 -0
- package/dist/components/page-context-menu.js.map +1 -0
- package/dist/components/page-context-menu.module.css.js +42 -0
- package/dist/components/page-context-menu.module.css.js.map +1 -0
- package/dist/components/page.js +85 -0
- package/dist/components/page.js.map +1 -0
- package/dist/components/page.module.css.js +48 -0
- package/dist/components/page.module.css.js.map +1 -0
- package/dist/components/prose.module.css.js +8 -0
- package/dist/components/prose.module.css.js.map +1 -0
- package/dist/components/toc/index.js +65 -0
- package/dist/components/toc/index.js.map +1 -0
- package/dist/components/toc/pivot-aware-toc.js +23 -0
- package/dist/components/toc/pivot-aware-toc.js.map +1 -0
- package/dist/components/toc/toc.module.css.js +18 -0
- package/dist/components/toc/toc.module.css.js.map +1 -0
- package/dist/hooks/useMarkdownCopy.js +50 -0
- package/dist/hooks/useMarkdownCopy.js.map +1 -0
- package/dist/index.d.ts +313 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/convert-html-to-mdx.js +28 -0
- package/dist/parser/convert-html-to-mdx.js.map +1 -0
- package/dist/parser/serialize-mdx.js +36 -0
- package/dist/parser/serialize-mdx.js.map +1 -0
- package/dist/plugins/rehype/rehype-code-blocks.js +44 -0
- package/dist/plugins/rehype/rehype-code-blocks.js.map +1 -0
- package/dist/plugins/remark/remark-heading-ids.js +23 -0
- package/dist/plugins/remark/remark-heading-ids.js.map +1 -0
- package/dist/plugins/sanitize/rehype-callouts.js +32 -0
- package/dist/plugins/sanitize/rehype-callouts.js.map +1 -0
- package/dist/plugins/sanitize/rehype-details.js +18 -0
- package/dist/plugins/sanitize/rehype-details.js.map +1 -0
- package/dist/plugins/sanitize/rehype-heading-ids.js +22 -0
- package/dist/plugins/sanitize/rehype-heading-ids.js.map +1 -0
- package/dist/plugins/sanitize/rehype-param-name.js +11 -0
- package/dist/plugins/sanitize/rehype-param-name.js.map +1 -0
- package/dist/plugins/sanitize/rehype-pre-to-mdx-fence.js +29 -0
- package/dist/plugins/sanitize/rehype-pre-to-mdx-fence.js.map +1 -0
- package/dist/plugins/sanitize/rehype-remark.js +50 -0
- package/dist/plugins/sanitize/rehype-remark.js.map +1 -0
- package/dist/plugins/sanitize/rehype-table-align.js +52 -0
- package/dist/plugins/sanitize/rehype-table-align.js.map +1 -0
- package/dist/plugins/sanitize/rehype-tabs.js +51 -0
- package/dist/plugins/sanitize/rehype-tabs.js.map +1 -0
- package/dist/plugins/sanitize/rehype-zone-pivots.js +106 -0
- package/dist/plugins/sanitize/rehype-zone-pivots.js.map +1 -0
- package/dist/plugins/sanitize/remove-html-comments.js +17 -0
- package/dist/plugins/sanitize/remove-html-comments.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/utils/get-node-text.js +5 -0
- package/dist/utils/get-node-text.js.map +1 -0
- package/dist/utils/rehype.js +17 -0
- package/dist/utils/rehype.js.map +1 -0
- package/dist/utils/string.js +5 -0
- package/dist/utils/string.js.map +1 -0
- package/package.json +90 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @mintlify/msft-sdk
|
|
2
|
+
|
|
3
|
+
Lightweight SDK for Microsoft documentation with MDX rendering.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @mintlify/msft-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Import CSS
|
|
12
|
+
|
|
13
|
+
In your home page
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import "@mintlify/msft-sdk/styles.css";
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
(optional) to control themes:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
@variant dark (&:where(.dark, .dark *));
|
|
23
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CodeBlock as o } from "./code-block.js";
|
|
2
|
+
import { Heading as m } from "./heading.js";
|
|
3
|
+
import { Link as r } from "./link.js";
|
|
4
|
+
import { Callout as t } from "./callouts.js";
|
|
5
|
+
import { ParamName as i } from "./param-name.js";
|
|
6
|
+
import { Summary as p, Details as a } from "./details/details.js";
|
|
7
|
+
import { Tab as f } from "./tabs/tab.js";
|
|
8
|
+
import { Tabs as e } from "./tabs/tabs.js";
|
|
9
|
+
import { ZoneTarget as n } from "./zone-pivots/zone-target.js";
|
|
10
|
+
import { ZonePivot as l } from "./zone-pivots/zone-pivot.js";
|
|
11
|
+
const Z = {
|
|
12
|
+
CodeBlock: o,
|
|
13
|
+
Heading: m,
|
|
14
|
+
Link: r,
|
|
15
|
+
Callout: t,
|
|
16
|
+
ZonePivot: l,
|
|
17
|
+
ZoneTarget: n,
|
|
18
|
+
ParamName: i,
|
|
19
|
+
Tabs: e,
|
|
20
|
+
Tab: f,
|
|
21
|
+
Details: a,
|
|
22
|
+
Summary: p
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
Z as allComponents
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=all-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all-components.js","sources":["../../../src/components/content-components/all-components.tsx"],"sourcesContent":["import { CodeBlock } from \"./code-block\";\nimport { Heading } from \"./heading\";\nimport { Link } from \"./link\";\nimport { Callout } from \"./callouts\";\nimport { ZonePivot, ZoneTarget } from \"./zone-pivots\";\nimport { ParamName } from \"./param-name\";\nimport { Tabs, Tab } from \"./tabs\";\nimport { Details, Summary } from \"./details\";\n\nexport const allComponents = {\n CodeBlock,\n Heading,\n Link,\n Callout,\n ZonePivot,\n ZoneTarget,\n ParamName,\n Tabs,\n Tab,\n Details,\n Summary,\n};\n"],"names":["allComponents","CodeBlock","Heading","Link","Callout","ZonePivot","ZoneTarget","ParamName","Tabs","Tab","Details","Summary"],"mappings":";;;;;;;;;;AASO,MAAMA,IAAgB;AAAA,EAC3B,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,KAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AACF;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { InfoFilled as l, Warning20Regular as t, DismissCircle20Regular as r, Info20Regular as m, Lightbulb20Regular as u } from "@fluentui/react-icons";
|
|
3
|
+
import n from "./callouts.module.css.js";
|
|
4
|
+
import p from "../prose.module.css.js";
|
|
5
|
+
const g = {
|
|
6
|
+
tip: {
|
|
7
|
+
icon: /* @__PURE__ */ o(u, { className: n.icon })
|
|
8
|
+
},
|
|
9
|
+
note: {
|
|
10
|
+
icon: /* @__PURE__ */ o(m, { className: n.icon })
|
|
11
|
+
},
|
|
12
|
+
warning: {
|
|
13
|
+
icon: /* @__PURE__ */ o(t, { className: n.icon })
|
|
14
|
+
},
|
|
15
|
+
caution: {
|
|
16
|
+
icon: /* @__PURE__ */ o(r, { className: n.icon })
|
|
17
|
+
},
|
|
18
|
+
important: {
|
|
19
|
+
icon: /* @__PURE__ */ o(t, { className: n.icon })
|
|
20
|
+
},
|
|
21
|
+
nextstepaction: {
|
|
22
|
+
icon: /* @__PURE__ */ o(l, { className: n.icon })
|
|
23
|
+
}
|
|
24
|
+
}, N = {
|
|
25
|
+
note: "Note",
|
|
26
|
+
tip: "Tip",
|
|
27
|
+
important: "Important",
|
|
28
|
+
caution: "Caution",
|
|
29
|
+
warning: "Warning",
|
|
30
|
+
nextstepaction: "Next step action"
|
|
31
|
+
};
|
|
32
|
+
function C({ type: i, children: c }) {
|
|
33
|
+
const a = g[i], e = N[i];
|
|
34
|
+
return /* @__PURE__ */ s(
|
|
35
|
+
"aside",
|
|
36
|
+
{
|
|
37
|
+
role: "note",
|
|
38
|
+
"aria-label": e,
|
|
39
|
+
className: `${n.callout} ${n[i]}`,
|
|
40
|
+
children: [
|
|
41
|
+
a.icon && /* @__PURE__ */ o("div", { className: n.iconContainer, "aria-hidden": "true", children: a.icon }),
|
|
42
|
+
/* @__PURE__ */ o("div", { className: `${n.content} ${p.prose}`, children: c })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
C as Callout
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=callouts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callouts.js","sources":["../../../src/components/content-components/callouts.tsx"],"sourcesContent":["import {\n Lightbulb20Regular,\n InfoFilled,\n Warning20Regular,\n DismissCircle20Regular,\n Info20Regular,\n} from \"@fluentui/react-icons\";\nimport styles from \"./callouts.module.css\";\nimport proseStyles from \"../prose.module.css\";\n\nexport type CalloutType =\n | \"note\"\n | \"tip\"\n | \"important\"\n | \"caution\"\n | \"warning\"\n | \"nextstepaction\";\n\ninterface CalloutProps {\n type: CalloutType;\n children: React.ReactNode;\n}\n\nconst calloutConfig: Record<\n CalloutType,\n {\n icon?: React.ReactNode;\n }\n> = {\n tip: {\n icon: <Lightbulb20Regular className={styles.icon} />,\n },\n note: {\n icon: <Info20Regular className={styles.icon} />,\n },\n warning: {\n icon: <Warning20Regular className={styles.icon} />,\n },\n caution: {\n icon: <DismissCircle20Regular className={styles.icon} />,\n },\n important: {\n icon: <Warning20Regular className={styles.icon} />,\n },\n nextstepaction: {\n icon: <InfoFilled className={styles.icon} />,\n },\n};\n\nconst calloutLabels: Record<CalloutType, string> = {\n note: \"Note\",\n tip: \"Tip\",\n important: \"Important\",\n caution: \"Caution\",\n warning: \"Warning\",\n nextstepaction: \"Next step action\",\n};\n\nexport function Callout({ type, children }: CalloutProps) {\n const config = calloutConfig[type];\n const label = calloutLabels[type];\n\n return (\n <aside\n role=\"note\"\n aria-label={label}\n className={`${styles.callout} ${styles[type]}`}\n >\n {config.icon && (\n <div className={styles.iconContainer} aria-hidden=\"true\">\n {config.icon}\n </div>\n )}\n <div className={`${styles.content} ${proseStyles.prose}`}>{children}</div>\n </aside>\n );\n}\n"],"names":["calloutConfig","jsx","Lightbulb20Regular","styles","Info20Regular","Warning20Regular","DismissCircle20Regular","InfoFilled","calloutLabels","Callout","type","children","config","label","jsxs","proseStyles"],"mappings":";;;;AAuBA,MAAMA,IAKF;AAAA,EACF,KAAK;AAAA,IACH,MAAM,gBAAAC,EAACC,GAAA,EAAmB,WAAWC,EAAO,KAAA,CAAM;AAAA,EAAA;AAAA,EAEpD,MAAM;AAAA,IACJ,MAAM,gBAAAF,EAACG,GAAA,EAAc,WAAWD,EAAO,KAAA,CAAM;AAAA,EAAA;AAAA,EAE/C,SAAS;AAAA,IACP,MAAM,gBAAAF,EAACI,GAAA,EAAiB,WAAWF,EAAO,KAAA,CAAM;AAAA,EAAA;AAAA,EAElD,SAAS;AAAA,IACP,MAAM,gBAAAF,EAACK,GAAA,EAAuB,WAAWH,EAAO,KAAA,CAAM;AAAA,EAAA;AAAA,EAExD,WAAW;AAAA,IACT,MAAM,gBAAAF,EAACI,GAAA,EAAiB,WAAWF,EAAO,KAAA,CAAM;AAAA,EAAA;AAAA,EAElD,gBAAgB;AAAA,IACd,MAAM,gBAAAF,EAACM,GAAA,EAAW,WAAWJ,EAAO,KAAA,CAAM;AAAA,EAAA;AAE9C,GAEMK,IAA6C;AAAA,EACjD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,gBAAgB;AAClB;AAEO,SAASC,EAAQ,EAAE,MAAAC,GAAM,UAAAC,KAA0B;AACxD,QAAMC,IAASZ,EAAcU,CAAI,GAC3BG,IAAQL,EAAcE,CAAI;AAEhC,SACE,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAYD;AAAA,MACZ,WAAW,GAAGV,EAAO,OAAO,IAAIA,EAAOO,CAAI,CAAC;AAAA,MAE3C,UAAA;AAAA,QAAAE,EAAO,0BACL,OAAA,EAAI,WAAWT,EAAO,eAAe,eAAY,QAC/C,UAAAS,EAAO,KAAA,CACV;AAAA,QAEF,gBAAAX,EAAC,OAAA,EAAI,WAAW,GAAGE,EAAO,OAAO,IAAIY,EAAY,KAAK,IAAK,UAAAJ,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG1E;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const n = "_callout_1k3jj_1", t = "_iconContainer_1k3jj_12", o = "_icon_1k3jj_12", _ = "_content_1k3jj_25", c = "_tip_1k3jj_40", i = "_note_1k3jj_52", a = "_warning_1k3jj_64", j = "_caution_1k3jj_76", e = "_important_1k3jj_88", s = "_nextstepaction_1k3jj_100", k = {
|
|
2
|
+
callout: n,
|
|
3
|
+
iconContainer: t,
|
|
4
|
+
icon: o,
|
|
5
|
+
content: _,
|
|
6
|
+
tip: c,
|
|
7
|
+
note: i,
|
|
8
|
+
warning: a,
|
|
9
|
+
caution: j,
|
|
10
|
+
important: e,
|
|
11
|
+
nextstepaction: s
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
n as callout,
|
|
15
|
+
j as caution,
|
|
16
|
+
_ as content,
|
|
17
|
+
k as default,
|
|
18
|
+
o as icon,
|
|
19
|
+
t as iconContainer,
|
|
20
|
+
e as important,
|
|
21
|
+
s as nextstepaction,
|
|
22
|
+
i as note,
|
|
23
|
+
c as tip,
|
|
24
|
+
a as warning
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=callouts.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callouts.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import T, { useState as N, useEffect as j } from "react";
|
|
3
|
+
import u from "prismjs";
|
|
4
|
+
import "prismjs/components/prism-javascript";
|
|
5
|
+
import "prismjs/components/prism-typescript";
|
|
6
|
+
import "prismjs/components/prism-python";
|
|
7
|
+
import "prismjs/components/prism-bash";
|
|
8
|
+
import "prismjs/components/prism-json";
|
|
9
|
+
import "prismjs/components/prism-markdown";
|
|
10
|
+
import "prismjs/components/prism-csharp";
|
|
11
|
+
import "prismjs/components/prism-powershell";
|
|
12
|
+
import { getNodeText as A } from "../../utils/get-node-text.js";
|
|
13
|
+
import { Checkmark20Regular as k, Copy20Regular as I } from "@fluentui/react-icons";
|
|
14
|
+
import { capitalize as R } from "../../utils/string.js";
|
|
15
|
+
import o from "./code-block.module.css.js";
|
|
16
|
+
function S() {
|
|
17
|
+
const [e, c] = N(!1);
|
|
18
|
+
return { isCopied: e, copy: async (m) => {
|
|
19
|
+
try {
|
|
20
|
+
await navigator.clipboard.writeText(m), c(!0), setTimeout(() => c(!1), 2e3);
|
|
21
|
+
} catch (l) {
|
|
22
|
+
console.error("Failed to copy to clipboard:", l);
|
|
23
|
+
}
|
|
24
|
+
} };
|
|
25
|
+
}
|
|
26
|
+
function K({
|
|
27
|
+
children: e,
|
|
28
|
+
className: c,
|
|
29
|
+
fileName: n,
|
|
30
|
+
language: m
|
|
31
|
+
}) {
|
|
32
|
+
const [l, f] = N(""), { isCopied: y, copy: b } = S(), t = m || (c == null ? void 0 : c.replace(/^language-/, "")) || "text", s = A(e), x = !!n, g = T.useMemo(() => {
|
|
33
|
+
var p, C;
|
|
34
|
+
if (typeof e != "object" || e == null)
|
|
35
|
+
return !1;
|
|
36
|
+
const i = Array.isArray(e) ? e : [e];
|
|
37
|
+
for (const a of i)
|
|
38
|
+
if (typeof a == "object" && a != null && "props" in a && ((p = a.props) != null && p.children)) {
|
|
39
|
+
const v = Array.isArray(a.props.children) ? a.props.children : [a.props.children];
|
|
40
|
+
for (const d of v)
|
|
41
|
+
if (typeof d == "object" && d != null && "props" in d && ((C = d.props) != null && C.className))
|
|
42
|
+
return !0;
|
|
43
|
+
}
|
|
44
|
+
return !1;
|
|
45
|
+
}, [e]);
|
|
46
|
+
j(() => {
|
|
47
|
+
if (!g)
|
|
48
|
+
try {
|
|
49
|
+
const i = u.languages[t] || u.languages.plaintext, p = u.highlight(s, i, t);
|
|
50
|
+
f(p);
|
|
51
|
+
} catch (i) {
|
|
52
|
+
console.error("Failed to highlight code:", i), f(s);
|
|
53
|
+
}
|
|
54
|
+
}, [s, t, g]);
|
|
55
|
+
const $ = () => {
|
|
56
|
+
b(s);
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ h("div", { className: x ? o.container : void 0, children: [
|
|
59
|
+
n && /* @__PURE__ */ r("span", { className: o.fileName, children: n }),
|
|
60
|
+
/* @__PURE__ */ h("div", { className: `${o.codeWrapper} not-prose`, children: [
|
|
61
|
+
/* @__PURE__ */ h("div", { className: o.header, children: [
|
|
62
|
+
/* @__PURE__ */ r("span", { className: o.language, children: R(t) }),
|
|
63
|
+
/* @__PURE__ */ r(
|
|
64
|
+
"button",
|
|
65
|
+
{
|
|
66
|
+
onClick: $,
|
|
67
|
+
className: o.copyButton,
|
|
68
|
+
"aria-label": y ? "Copied" : "Copy code",
|
|
69
|
+
children: y ? /* @__PURE__ */ r(k, { className: o.copiedIcon }) : /* @__PURE__ */ r(I, { className: o.copyIcon })
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ r("div", { className: `${o.scrollContainer} code-scrollbar`, children: /* @__PURE__ */ r("pre", { className: o.pre, children: g ? /* @__PURE__ */ r("code", { className: `language-${t} ${o.code}`, children: e }) : l ? /* @__PURE__ */ r(
|
|
74
|
+
"code",
|
|
75
|
+
{
|
|
76
|
+
className: `language-${t} ${o.code}`,
|
|
77
|
+
dangerouslySetInnerHTML: { __html: l }
|
|
78
|
+
}
|
|
79
|
+
) : /* @__PURE__ */ r("code", { className: `language-${t} ${o.code}`, children: s }) }) })
|
|
80
|
+
] })
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
K as CodeBlock
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=code-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block.js","sources":["../../../src/components/content-components/code-block.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport Prism from \"prismjs\";\nimport \"prismjs/components/prism-javascript\";\nimport \"prismjs/components/prism-typescript\";\nimport \"prismjs/components/prism-python\";\nimport \"prismjs/components/prism-bash\";\nimport \"prismjs/components/prism-json\";\nimport \"prismjs/components/prism-markdown\";\nimport \"prismjs/components/prism-csharp\";\nimport \"prismjs/components/prism-powershell\";\nimport { getNodeText } from \"../../utils/get-node-text\";\nimport { Copy20Regular, Checkmark20Regular } from \"@fluentui/react-icons\";\nimport { capitalize } from \"../../utils/string\";\nimport styles from \"./code-block.module.css\";\n\ninterface CodeBlockProps {\n children: React.ReactNode;\n className?: string;\n language?: string;\n fileName?: string;\n}\n\nfunction useCopyToClipboard() {\n const [isCopied, setIsCopied] = useState(false);\n\n const copy = async (text: string) => {\n try {\n await navigator.clipboard.writeText(text);\n setIsCopied(true);\n setTimeout(() => setIsCopied(false), 2000);\n } catch (error) {\n console.error(\"Failed to copy to clipboard:\", error);\n }\n };\n\n return { isCopied, copy };\n}\n\nexport function CodeBlock({\n children,\n className,\n fileName,\n language,\n}: CodeBlockProps) {\n const [highlightedCode, setHighlightedCode] = useState<string>(\"\");\n const { isCopied, copy } = useCopyToClipboard();\n const lang = language || className?.replace(/^language-/, \"\") || \"text\";\n const codeText = getNodeText(children);\n const showContainer = !!fileName;\n\n const isSSRHighlighted = React.useMemo(() => {\n if (typeof children !== \"object\" || children == null) {\n return false;\n }\n\n const childrenArray = Array.isArray(children) ? children : [children];\n for (const child of childrenArray) {\n if (\n typeof child === \"object\" &&\n child != null &&\n \"props\" in child &&\n child.props?.children\n ) {\n const codeChildren = Array.isArray(child.props.children)\n ? child.props.children\n : [child.props.children];\n\n for (const codeChild of codeChildren) {\n if (\n typeof codeChild === \"object\" &&\n codeChild != null &&\n \"props\" in codeChild &&\n codeChild.props?.className\n ) {\n return true;\n }\n }\n }\n }\n return false;\n }, [children]);\n\n useEffect(() => {\n if (isSSRHighlighted) {\n return;\n }\n\n try {\n const grammar = Prism.languages[lang] || Prism.languages.plaintext;\n const html = Prism.highlight(codeText, grammar, lang);\n setHighlightedCode(html);\n } catch (error) {\n console.error(\"Failed to highlight code:\", error);\n setHighlightedCode(codeText);\n }\n }, [codeText, lang, isSSRHighlighted]);\n\n const handleCopy = () => {\n copy(codeText);\n };\n\n return (\n <div className={showContainer ? styles.container : undefined}>\n {fileName && <span className={styles.fileName}>{fileName}</span>}\n <div className={`${styles.codeWrapper} not-prose`}>\n <div className={styles.header}>\n <span className={styles.language}>\n {capitalize(lang)}\n </span>\n <button\n onClick={handleCopy}\n className={styles.copyButton}\n aria-label={isCopied ? \"Copied\" : \"Copy code\"}\n >\n {isCopied ? (\n <Checkmark20Regular className={styles.copiedIcon} />\n ) : (\n <Copy20Regular className={styles.copyIcon} />\n )}\n </button>\n </div>\n <div className={`${styles.scrollContainer} code-scrollbar`}>\n <pre className={styles.pre}>\n {isSSRHighlighted ? (\n <code className={`language-${lang} ${styles.code}`}>\n {children}\n </code>\n ) : highlightedCode ? (\n <code\n className={`language-${lang} ${styles.code}`}\n dangerouslySetInnerHTML={{ __html: highlightedCode }}\n />\n ) : (\n <code className={`language-${lang} ${styles.code}`}>\n {codeText}\n </code>\n )}\n </pre>\n </div>\n </div>\n </div>\n );\n}\n"],"names":["useCopyToClipboard","isCopied","setIsCopied","useState","text","error","CodeBlock","children","className","fileName","language","highlightedCode","setHighlightedCode","copy","lang","codeText","getNodeText","showContainer","isSSRHighlighted","React","childrenArray","child","_a","codeChildren","codeChild","_b","useEffect","grammar","Prism","html","handleCopy","styles","jsx","jsxs","capitalize","Checkmark20Regular","Copy20Regular"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAASA,IAAqB;AAC5B,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,E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QAAA;AAAA,UACC,WAAW,YAAYlB,CAAI,IAAIiB,EAAO,IAAI;AAAA,UAC1C,yBAAyB,EAAE,QAAQpB,EAAA;AAAA,QAAgB;AAAA,MAAA,IAGrD,gBAAAqB,EAAC,QAAA,EAAK,WAAW,YAAYlB,CAAI,IAAIiB,EAAO,IAAI,IAC7C,UAAAhB,EAAA,CACH,EAAA,CAEJ,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const e = "_container_2biqe_1", o = "_fileName_2biqe_20", c = "_codeWrapper_2biqe_27", n = "_header_2biqe_37", _ = "_language_2biqe_46", t = "_copyButton_2biqe_56", a = "_copyIcon_2biqe_86", i = "_copiedIcon_2biqe_91", r = "_scrollContainer_2biqe_101", p = "_pre_2biqe_105", s = "_code_2biqe_27", l = {
|
|
2
|
+
container: e,
|
|
3
|
+
fileName: o,
|
|
4
|
+
codeWrapper: c,
|
|
5
|
+
header: n,
|
|
6
|
+
language: _,
|
|
7
|
+
copyButton: t,
|
|
8
|
+
copyIcon: a,
|
|
9
|
+
copiedIcon: i,
|
|
10
|
+
scrollContainer: r,
|
|
11
|
+
pre: p,
|
|
12
|
+
code: s
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
s as code,
|
|
16
|
+
c as codeWrapper,
|
|
17
|
+
e as container,
|
|
18
|
+
i as copiedIcon,
|
|
19
|
+
t as copyButton,
|
|
20
|
+
a as copyIcon,
|
|
21
|
+
l as default,
|
|
22
|
+
o as fileName,
|
|
23
|
+
n as header,
|
|
24
|
+
_ as language,
|
|
25
|
+
p as pre,
|
|
26
|
+
r as scrollContainer
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=code-block.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as l, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { TableBody as m, TableHeader as i, TableRow as n, TableCell as p, TableHead as d, Table as c } from "./table/index.js";
|
|
3
|
+
import o from "./default-components.module.css.js";
|
|
4
|
+
import { allComponents as b } from "./all-components.js";
|
|
5
|
+
import { Link as u } from "./link.js";
|
|
6
|
+
import { Heading as a } from "./heading.js";
|
|
7
|
+
import { Summary as f, Details as h } from "./details/details.js";
|
|
8
|
+
const H = {
|
|
9
|
+
h1: (e) => /* @__PURE__ */ l(a, { level: 1, ...e }),
|
|
10
|
+
h2: (e) => /* @__PURE__ */ l(a, { level: 2, ...e }),
|
|
11
|
+
h3: (e) => /* @__PURE__ */ l(a, { level: 3, ...e }),
|
|
12
|
+
h4: (e) => /* @__PURE__ */ l(a, { level: 4, ...e }),
|
|
13
|
+
h5: (e) => /* @__PURE__ */ l(a, { level: 5, ...e }),
|
|
14
|
+
h6: (e) => /* @__PURE__ */ l(a, { level: 6, ...e }),
|
|
15
|
+
code: ({ className: e, children: t, ...r }) => e ? t : /* @__PURE__ */ l("code", { className: `not-prose ${o.inlineCode}`, ...r, children: t }),
|
|
16
|
+
pre: ({ children: e }) => /* @__PURE__ */ l(s, { children: e }),
|
|
17
|
+
a: u,
|
|
18
|
+
p: (e) => /* @__PURE__ */ l("p", { className: o.paragraph, ...e }),
|
|
19
|
+
ul: (e) => /* @__PURE__ */ l("ul", { className: o.list, ...e }),
|
|
20
|
+
ol: (e) => /* @__PURE__ */ l("ol", { className: o.orderedList, ...e }),
|
|
21
|
+
li: (e) => /* @__PURE__ */ l("li", { className: o.listItem, ...e }),
|
|
22
|
+
blockquote: (e) => /* @__PURE__ */ l("blockquote", { className: `not-prose ${o.blockquote}`, ...e }),
|
|
23
|
+
table: c,
|
|
24
|
+
th: d,
|
|
25
|
+
td: p,
|
|
26
|
+
tr: n,
|
|
27
|
+
thead: i,
|
|
28
|
+
tbody: m,
|
|
29
|
+
details: h,
|
|
30
|
+
summary: f,
|
|
31
|
+
...b
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
H as defaultComponents
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=default-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-components.js","sources":["../../../src/components/content-components/default-components.tsx"],"sourcesContent":["import { Details, Heading, Link, Summary, allComponents } from \".\";\nimport type { MDXComponents } from \"../../types\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from \"./table\";\nimport styles from \"./default-components.module.css\";\n\nexport const defaultComponents: MDXComponents = {\n h1: (props) => <Heading level={1} {...props} />,\n h2: (props) => <Heading level={2} {...props} />,\n h3: (props) => <Heading level={3} {...props} />,\n h4: (props) => <Heading level={4} {...props} />,\n h5: (props) => <Heading level={5} {...props} />,\n h6: (props) => <Heading level={6} {...props} />,\n code: ({ className, children, ...props }) => {\n const isInline = !className;\n if (isInline) {\n return (\n <code className={`not-prose ${styles.inlineCode}`} {...props}>\n {children}\n </code>\n );\n }\n return children;\n },\n pre: ({ children }) => <>{children}</>,\n a: Link,\n p: (props) => <p className={styles.paragraph} {...props} />,\n ul: (props) => <ul className={styles.list} {...props} />,\n ol: (props) => <ol className={styles.orderedList} {...props} />,\n li: (props) => <li className={styles.listItem} {...props} />,\n blockquote: (props) => (\n <blockquote className={`not-prose ${styles.blockquote}`} {...props} />\n ),\n table: Table,\n th: TableHead,\n td: TableCell,\n tr: TableRow,\n thead: TableHeader,\n tbody: TableBody,\n details: Details,\n summary: Summary,\n ...allComponents,\n};\n"],"names":["defaultComponents","props","jsx","Heading","className","children","styles","Link","Table","TableHead","TableCell","TableRow","TableHeader","TableBody","Details","Summary","allComponents"],"mappings":";;;;;;;AAYO,MAAMA,IAAmC;AAAA,EAC9C,IAAI,CAACC,MAAU,gBAAAC,EAACC,KAAQ,OAAO,GAAI,GAAGF,GAAO;AAAA,EAC7C,IAAI,CA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}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const o = "_inlineCode_16wxq_1", e = "_paragraph_16wxq_17", a = "_blockquote_16wxq_21", n = {
|
|
2
|
+
inlineCode: o,
|
|
3
|
+
paragraph: e,
|
|
4
|
+
blockquote: a
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
a as blockquote,
|
|
8
|
+
n as default,
|
|
9
|
+
o as inlineCode,
|
|
10
|
+
e as paragraph
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=default-components.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-components.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as c, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import t, { useState as p } from "react";
|
|
3
|
+
import { ChevronDown16Regular as u } from "@fluentui/react-icons";
|
|
4
|
+
import n from "./details.module.css.js";
|
|
5
|
+
function g({ children: s, open: r = !1 }) {
|
|
6
|
+
const [o, d] = p(r), a = t.Children.toArray(s).find(
|
|
7
|
+
(e) => t.isValidElement(e) && e.type === m
|
|
8
|
+
), i = t.Children.toArray(s).filter(
|
|
9
|
+
(e) => !(t.isValidElement(e) && e.type === m)
|
|
10
|
+
);
|
|
11
|
+
return /* @__PURE__ */ c(
|
|
12
|
+
"details",
|
|
13
|
+
{
|
|
14
|
+
open: o,
|
|
15
|
+
onToggle: (e) => d(e.currentTarget.open),
|
|
16
|
+
className: n.details,
|
|
17
|
+
children: [
|
|
18
|
+
a && t.isValidElement(a) && t.cloneElement(
|
|
19
|
+
a,
|
|
20
|
+
{ isOpen: o }
|
|
21
|
+
),
|
|
22
|
+
o && i.length > 0 && /* @__PURE__ */ l("div", { className: n.body, children: i })
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function m({ children: s, isOpen: r }) {
|
|
28
|
+
return /* @__PURE__ */ c("summary", { className: n.summary, children: [
|
|
29
|
+
/* @__PURE__ */ l(
|
|
30
|
+
u,
|
|
31
|
+
{
|
|
32
|
+
className: `${n.icon} ${r ? n.iconOpen : n.iconClosed}`
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ l("span", { className: `${n.content} not-prose`, children: s })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
g as Details,
|
|
40
|
+
m as Summary
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"details.js","sources":["../../../../src/components/content-components/details/details.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { ChevronDown16Regular } from \"@fluentui/react-icons\";\nimport styles from \"./details.module.css\";\n\ninterface DetailsProps {\n children: React.ReactNode;\n open?: boolean;\n}\n\nexport function Details({ children, open = false }: DetailsProps) {\n const [isOpen, setIsOpen] = useState(open);\n\n const summaryChild = React.Children.toArray(children).find(\n (child) => React.isValidElement(child) && child.type === Summary\n );\n\n const otherChildren = React.Children.toArray(children).filter(\n (child) => !(React.isValidElement(child) && child.type === Summary)\n );\n\n return (\n <details\n open={isOpen}\n onToggle={(e) => setIsOpen(e.currentTarget.open)}\n className={styles.details}\n >\n {summaryChild &&\n React.isValidElement(summaryChild) &&\n React.cloneElement(\n summaryChild as React.ReactElement<\n SummaryProps & { isOpen?: boolean }\n >,\n { isOpen }\n )}\n {isOpen && otherChildren.length > 0 && (\n <div className={styles.body}>{otherChildren}</div>\n )}\n </details>\n );\n}\n\ninterface SummaryProps {\n children: React.ReactNode;\n isOpen?: boolean;\n}\n\nexport function Summary({ children, isOpen }: SummaryProps) {\n return (\n <summary className={styles.summary}>\n <ChevronDown16Regular\n className={`${styles.icon} ${\n isOpen ? styles.iconOpen : styles.iconClosed\n }`}\n />\n <span className={`${styles.content} not-prose`}>{children}</span>\n </summary>\n );\n}\n"],"names":["Details","children","open","isOpen","setIsOpen","useState","summaryChild","React","child","Summary","otherChildren","jsxs","styles","jsx","ChevronDown16Regular"],"mappings":";;;;AASO,SAASA,EAAQ,EAAE,UAAAC,GAAU,MAAAC,IAAO,MAAuB;AAChE,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAASH,CAAI,GAEnCI,IAAeC,EAAM,SAAS,QAAQN,CAAQ,EAAE;AAAA,IACpD,CAACO,MAAUD,EAAM,eAAeC,CAAK,KAAKA,EAAM,SAASC;AAAA,EAAA,GAGrDC,IAAgBH,EAAM,SAAS,QAAQN,CAAQ,EAAE;AAAA,IACrD,CAACO,MAAU,EAAED,EAAM,eAAeC,CAAK,KAAKA,EAAM,SAASC;AAAA,EAAA;AAG7D,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAMR;AAAA,MACN,UAAU,CAAC,MAAMC,EAAU,EAAE,cAAc,IAAI;AAAA,MAC/C,WAAWQ,EAAO;AAAA,MAEjB,UAAA;AAAA,QAAAN,KACCC,EAAM,eAAeD,CAAY,KACjCC,EAAM;AAAA,UACJD;AAAA,UAGA,EAAE,QAAAH,EAAA;AAAA,QAAO;AAAA,QAEZA,KAAUO,EAAc,SAAS,uBAC/B,OAAA,EAAI,WAAWE,EAAO,MAAO,UAAAF,EAAA,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIpD;AAOO,SAASD,EAAQ,EAAE,UAAAR,GAAU,QAAAE,KAAwB;AAC1D,SACE,gBAAAQ,EAAC,WAAA,EAAQ,WAAWC,EAAO,SACzB,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAW,GAAGF,EAAO,IAAI,IACvBT,IAASS,EAAO,WAAWA,EAAO,UACpC;AAAA,MAAA;AAAA,IAAA;AAAA,sBAED,QAAA,EAAK,WAAW,GAAGA,EAAO,OAAO,cAAe,UAAAX,EAAA,CAAS;AAAA,EAAA,GAC5D;AAEJ;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const c = "_details_d3x6c_1", o = "_summary_d3x6c_13", n = "_icon_d3x6c_37", _ = "_iconOpen_d3x6c_42", s = "_iconClosed_d3x6c_46", t = "_content_d3x6c_50", d = "_body_d3x6c_54", e = {
|
|
2
|
+
details: c,
|
|
3
|
+
summary: o,
|
|
4
|
+
icon: n,
|
|
5
|
+
iconOpen: _,
|
|
6
|
+
iconClosed: s,
|
|
7
|
+
content: t,
|
|
8
|
+
body: d
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
d as body,
|
|
12
|
+
t as content,
|
|
13
|
+
e as default,
|
|
14
|
+
c as details,
|
|
15
|
+
n as icon,
|
|
16
|
+
s as iconClosed,
|
|
17
|
+
_ as iconOpen,
|
|
18
|
+
o as summary
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=details.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"details.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
const c = ({ id: o, level: r, children: t, className: n = "" }) => {
|
|
3
|
+
const e = `h${r}`;
|
|
4
|
+
return /* @__PURE__ */ s(e, { id: o, className: n, children: t });
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
c as Heading
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.js","sources":["../../../src/components/content-components/heading.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface HeadingProps {\n id: string;\n level: 1 | 2 | 3 | 4 | 5 | 6;\n children: React.ReactNode;\n className?: string;\n}\n\nexport const Heading = ({ id, level, children, className = '' }: HeadingProps) => {\n const Tag = `h${level}` as keyof JSX.IntrinsicElements;\n \n return (\n <Tag id={id} className={className}>\n {children}\n </Tag>\n );\n};"],"names":["Heading","id","level","children","className","Tag","jsx"],"mappings":";AASO,MAAMA,IAAU,CAAC,EAAE,IAAAC,GAAI,OAAAC,GAAO,UAAAC,GAAU,WAAAC,IAAY,SAAuB;AAChF,QAAMC,IAAM,IAAIH,CAAK;AAErB,SACE,gBAAAI,EAACD,GAAA,EAAI,IAAAJ,GAAQ,WAAAG,GACV,UAAAD,EAAA,CACH;AAEJ;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import o from "./link.module.css.js";
|
|
3
|
+
function p({ href: n, children: s, className: a = "" }) {
|
|
4
|
+
const t = (n == null ? void 0 : n.startsWith("http")) || (n == null ? void 0 : n.startsWith("//"));
|
|
5
|
+
return /* @__PURE__ */ i(
|
|
6
|
+
"a",
|
|
7
|
+
{
|
|
8
|
+
href: n,
|
|
9
|
+
className: `not-prose ${o.link} ${a}`,
|
|
10
|
+
target: t ? "_blank" : void 0,
|
|
11
|
+
rel: t ? "noopener noreferrer" : void 0,
|
|
12
|
+
"aria-label": t ? `${s} (opens in new tab)` : void 0,
|
|
13
|
+
children: [
|
|
14
|
+
s,
|
|
15
|
+
t && /* @__PURE__ */ l("span", { className: o.srOnly, children: " (opens in new tab)" })
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
p as Link
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sources":["../../../src/components/content-components/link.tsx"],"sourcesContent":["import React from \"react\";\nimport styles from \"./link.module.css\";\n\ninterface LinkProps {\n href?: string;\n children: React.ReactNode;\n className?: string;\n}\n\nexport function Link({ href, children, className = \"\" }: LinkProps) {\n const isExternal = href?.startsWith(\"http\") || href?.startsWith(\"//\");\n\n return (\n <a\n href={href}\n className={`not-prose ${styles.link} ${className}`}\n target={isExternal ? \"_blank\" : undefined}\n rel={isExternal ? \"noopener noreferrer\" : undefined}\n aria-label={isExternal ? `${children} (opens in new tab)` : undefined}\n >\n {children}\n {isExternal && (\n <span className={styles.srOnly}> (opens in new tab)</span>\n )}\n </a>\n );\n}\n"],"names":["Link","href","children","className","isExternal","jsxs","styles","jsx"],"mappings":";;AASO,SAASA,EAAK,EAAE,MAAAC,GAAM,UAAAC,GAAU,WAAAC,IAAY,MAAiB;AAClE,QAAMC,KAAaH,KAAA,gBAAAA,EAAM,WAAW,aAAWA,KAAA,gBAAAA,EAAM,WAAW;AAEhE,SACE,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAAJ;AAAA,MACA,WAAW,aAAaK,EAAO,IAAI,IAAIH,CAAS;AAAA,MAChD,QAAQC,IAAa,WAAW;AAAA,MAChC,KAAKA,IAAa,wBAAwB;AAAA,MAC1C,cAAYA,IAAa,GAAGF,CAAQ,wBAAwB;AAAA,MAE3D,UAAA;AAAA,QAAAA;AAAA,QACAE,KACC,gBAAAG,EAAC,QAAA,EAAK,WAAWD,EAAO,QAAQ,UAAA,sBAAA,CAAmB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAI3D;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import m from "./param-name.module.css.js";
|
|
3
|
+
function s({ children: r }) {
|
|
4
|
+
return /* @__PURE__ */ a("span", { className: `not-prose ${m.paramName}`, children: r });
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
s as ParamName
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=param-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"param-name.js","sources":["../../../src/components/content-components/param-name.tsx"],"sourcesContent":["import styles from \"./param-name.module.css\";\n\ninterface ParamNameProps {\n children: React.ReactNode;\n}\n\nexport function ParamName({ children }: ParamNameProps) {\n return <span className={`not-prose ${styles.paramName}`}>{children}</span>;\n}\n"],"names":["ParamName","children","styles"],"mappings":";;AAMO,SAASA,EAAU,EAAE,UAAAC,KAA4B;AACtD,2BAAQ,QAAA,EAAK,WAAW,aAAaC,EAAO,SAAS,IAAK,UAAAD,GAAS;AACrE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"param-name.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsx as t, jsxs as r, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { useState as p } from "react";
|
|
4
|
+
import { TableModal as f } from "./table-modal.js";
|
|
5
|
+
import { ArrowExpand20Regular as N } from "@fluentui/react-icons";
|
|
6
|
+
import o from "./table.module.css.js";
|
|
7
|
+
const T = s.forwardRef(({ className: a, children: e, ...l }, n) => {
|
|
8
|
+
const [c, d] = p(!1), i = () => {
|
|
9
|
+
d(!0);
|
|
10
|
+
}, b = () => {
|
|
11
|
+
d(!1);
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ r(m, { children: [
|
|
14
|
+
/* @__PURE__ */ r(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: o.container,
|
|
18
|
+
role: "region",
|
|
19
|
+
"aria-label": "Data table",
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ r(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
onClick: i,
|
|
25
|
+
className: o.expandButton,
|
|
26
|
+
"aria-label": "Expand table to full screen view",
|
|
27
|
+
title: "Expand table",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ t(N, { className: o.expandIcon }),
|
|
30
|
+
/* @__PURE__ */ t("span", { className: o.expandText, children: "Expand table" })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ t("div", { className: o.scrollContainer, children: /* @__PURE__ */ t(
|
|
35
|
+
"table",
|
|
36
|
+
{
|
|
37
|
+
ref: n,
|
|
38
|
+
className: `${o.table} ${a || ""}`,
|
|
39
|
+
...l,
|
|
40
|
+
children: e
|
|
41
|
+
}
|
|
42
|
+
) })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ t(f, { isOpen: c, onClose: b, children: /* @__PURE__ */ t(
|
|
47
|
+
"table",
|
|
48
|
+
{
|
|
49
|
+
className: `${o.table} ${a || ""}`,
|
|
50
|
+
children: e
|
|
51
|
+
}
|
|
52
|
+
) })
|
|
53
|
+
] });
|
|
54
|
+
});
|
|
55
|
+
T.displayName = "Table";
|
|
56
|
+
const $ = s.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ t(
|
|
57
|
+
"thead",
|
|
58
|
+
{
|
|
59
|
+
ref: l,
|
|
60
|
+
className: `${o.tableHeader} ${a || ""}`,
|
|
61
|
+
...e
|
|
62
|
+
}
|
|
63
|
+
));
|
|
64
|
+
$.displayName = "TableHeader";
|
|
65
|
+
const w = s.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ t("tbody", { ref: l, className: a, ...e }));
|
|
66
|
+
w.displayName = "TableBody";
|
|
67
|
+
const R = s.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ t(
|
|
68
|
+
"tfoot",
|
|
69
|
+
{
|
|
70
|
+
ref: l,
|
|
71
|
+
className: `${o.tableFooter} ${a || ""}`,
|
|
72
|
+
...e
|
|
73
|
+
}
|
|
74
|
+
));
|
|
75
|
+
R.displayName = "TableFooter";
|
|
76
|
+
const x = s.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ t(
|
|
77
|
+
"tr",
|
|
78
|
+
{
|
|
79
|
+
ref: l,
|
|
80
|
+
className: `${o.tableRow} ${a || ""}`,
|
|
81
|
+
...e
|
|
82
|
+
}
|
|
83
|
+
));
|
|
84
|
+
x.displayName = "TableRow";
|
|
85
|
+
const y = s.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ t(
|
|
86
|
+
"th",
|
|
87
|
+
{
|
|
88
|
+
ref: l,
|
|
89
|
+
className: `${o.tableHead} ${a || ""}`,
|
|
90
|
+
...e
|
|
91
|
+
}
|
|
92
|
+
));
|
|
93
|
+
y.displayName = "TableHead";
|
|
94
|
+
const C = s.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ t(
|
|
95
|
+
"td",
|
|
96
|
+
{
|
|
97
|
+
ref: l,
|
|
98
|
+
className: `${o.tableCell} ${a || ""}`,
|
|
99
|
+
...e
|
|
100
|
+
}
|
|
101
|
+
));
|
|
102
|
+
C.displayName = "TableCell";
|
|
103
|
+
const h = s.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ t(
|
|
104
|
+
"caption",
|
|
105
|
+
{
|
|
106
|
+
ref: l,
|
|
107
|
+
className: `${o.tableCaption} ${a || ""}`,
|
|
108
|
+
...e
|
|
109
|
+
}
|
|
110
|
+
));
|
|
111
|
+
h.displayName = "TableCaption";
|
|
112
|
+
export {
|
|
113
|
+
T as Table,
|
|
114
|
+
w as TableBody,
|
|
115
|
+
h as TableCaption,
|
|
116
|
+
C as TableCell,
|
|
117
|
+
R as TableFooter,
|
|
118
|
+
y as TableHead,
|
|
119
|
+
$ as TableHeader,
|
|
120
|
+
x as TableRow
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=index.js.map
|