@xyd-js/components 0.1.0-xyd.10 → 0.1.0-xyd.13
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/.idea/git_toolbox_blame.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/xyd-components.iml +12 -0
- package/CHANGELOG.md +22 -0
- package/TODO.md +1 -0
- package/content.ts +0 -2
- package/dist/CTABanner-BD4wweO5.js +2 -0
- package/dist/CTABanner-BD4wweO5.js.map +1 -0
- package/dist/CTABanner-DLG0_gv8.js +2 -0
- package/dist/CTABanner-DLG0_gv8.js.map +1 -0
- package/dist/CTABanner-DpPtA-FL.js +2 -0
- package/dist/CTABanner-DpPtA-FL.js.map +1 -0
- package/dist/CodeSample--qfqZ1hL.js +2 -0
- package/dist/CodeSample--qfqZ1hL.js.map +1 -0
- package/dist/CodeSample-CqFaFwwz.js +2 -0
- package/dist/CodeSample-CqFaFwwz.js.map +1 -0
- package/dist/CodeSample-GbqwRbcO.js +2 -0
- package/dist/CodeSample-GbqwRbcO.js.map +1 -0
- package/dist/HomeView-BZdY0g_7.js +2 -0
- package/dist/{HomeView-ACBdUgyz.js.map → HomeView-BZdY0g_7.js.map} +1 -1
- package/dist/HomeView-C_mEMzjV.js +2 -0
- package/dist/{HomeView-B0ATNUF1.js.map → HomeView-C_mEMzjV.js.map} +1 -1
- package/dist/HomeView-RATm-3zT.js +2 -0
- package/dist/{HomeView-CHSb4HL6.js.map → HomeView-RATm-3zT.js.map} +1 -1
- package/dist/Icon-BkXdTctK.js +2 -0
- package/dist/Icon-BkXdTctK.js.map +1 -0
- package/dist/Icon-BoKcRZAF.js +2 -0
- package/dist/Icon-BoKcRZAF.js.map +1 -0
- package/dist/Icon-CouPZRkJ.js +2 -0
- package/dist/Icon-CouPZRkJ.js.map +1 -0
- package/dist/Text-B-E3eaWW.js +2 -0
- package/dist/Text-B-E3eaWW.js.map +1 -0
- package/dist/Text-B5Ba_pci.js +2 -0
- package/dist/Text-B5Ba_pci.js.map +1 -0
- package/dist/Text-QH4jjPUM.js +2 -0
- package/dist/Text-QH4jjPUM.js.map +1 -0
- package/dist/Update-BlhP2VFR.js +2 -0
- package/dist/Update-BlhP2VFR.js.map +1 -0
- package/dist/Update-CMM38Snc.js +2 -0
- package/dist/Update-CMM38Snc.js.map +1 -0
- package/dist/Update-D5e_yqty.js +2 -0
- package/dist/Update-D5e_yqty.js.map +1 -0
- package/dist/VideoGuide-C5aW4OXW.js +2 -0
- package/dist/VideoGuide-C5aW4OXW.js.map +1 -0
- package/dist/VideoGuide-CoQXlHjQ.js +2 -0
- package/dist/VideoGuide-CoQXlHjQ.js.map +1 -0
- package/dist/VideoGuide-CwkedH8b.js +2 -0
- package/dist/VideoGuide-CwkedH8b.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-9wcO9jN6.js +4 -0
- package/dist/_rollupPluginBabelHelpers-9wcO9jN6.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-CiqSP2w-.js +4 -0
- package/dist/_rollupPluginBabelHelpers-CiqSP2w-.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-DmvUE1MU.js +4 -0
- package/dist/_rollupPluginBabelHelpers-DmvUE1MU.js.map +1 -0
- package/dist/brand.js +1 -1
- package/dist/brand.js.map +1 -1
- package/dist/coder/themes/cosmo-light.js.map +1 -1
- package/dist/coder.d.ts +29 -9
- package/dist/coder.js +1 -1
- package/dist/coder.js.map +1 -1
- package/dist/content.d.ts +264 -201
- package/dist/content.js +1 -1
- package/dist/content.js.map +1 -1
- package/dist/index.css +260 -210
- package/dist/layouts.d.ts +20 -21
- package/dist/layouts.js +1 -1
- package/dist/layouts.js.map +1 -1
- package/dist/pages.js +1 -1
- package/dist/pages.js.map +1 -1
- package/dist/system.d.ts +10 -0
- package/dist/system.js +2 -0
- package/dist/system.js.map +1 -0
- package/dist/tslib.es6-Bb9zBh0L.js +2 -0
- package/dist/{tslib.es6-BBkx4Se1.js.map → tslib.es6-Bb9zBh0L.js.map} +1 -1
- package/dist/tslib.es6-Bd9lzVn6.js +2 -0
- package/dist/{tslib.es6-BF6ZLEXa.js.map → tslib.es6-Bd9lzVn6.js.map} +1 -1
- package/dist/tslib.es6-DwnOrHRg.js +2 -0
- package/dist/{tslib.es6-BOZCDgb8.js.map → tslib.es6-DwnOrHRg.js.map} +1 -1
- package/dist/views.js +1 -1
- package/dist/writer.d.ts +409 -77
- package/dist/writer.js +1 -1
- package/dist/writer.js.map +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +22 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1640 -0
- package/docs/functions/GuideCard.html +6 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +2 -0
- package/docs/interfaces/GuideCardProps.html +18 -0
- package/docs/modules.html +1 -0
- package/index.ts +0 -1
- package/package.json +10 -6
- package/project.json +677 -0
- package/rollup.config.js +30 -20
- package/src/brand/Button/Button.styles.tsx +0 -3
- package/src/brand/CTABanner/CTABanner.styles.tsx +2 -4
- package/src/brand/Footer/Footer.styles.tsx +0 -3
- package/src/coder/Code/Code.styles.tsx +132 -33
- package/src/coder/Code/Code.tsx +129 -38
- package/src/coder/Code/CodeLoader.tsx +3 -3
- package/src/coder/Code/annotations.tsx +28 -8
- package/src/coder/Code/highlight.ts +38 -0
- package/src/coder/Code/index.ts +2 -1
- package/src/coder/CodeCopy/CodeCopy.styles.tsx +13 -11
- package/src/coder/CodeCopy/CodeCopy.tsx +5 -3
- package/src/coder/CodeSample/CodeSample.tsx +83 -27
- package/src/coder/CodeTabs/CodeTabs.styles.tsx +111 -94
- package/src/coder/CodeTabs/CodeTabs.tsx +69 -51
- package/src/coder/CodeTheme/CodeTheme.tsx +89 -49
- package/src/coder/CodeTheme/index.ts +0 -1
- package/src/coder/CoderProvider.tsx +26 -0
- package/src/coder/index.ts +8 -4
- package/src/content/ContentDecoator.styles.tsx +113 -0
- package/src/content/ContentDecorator.tsx +17 -0
- package/src/content/GridDecorator.styles.tsx +67 -0
- package/src/content/GridDecorator.tsx +21 -0
- package/src/content/ReactContent.tsx +575 -0
- package/src/content/index.ts +10 -2
- package/src/icons/index.ts +0 -0
- package/src/kit/Loader/Loader.styles.tsx +53 -0
- package/src/kit/Loader/Loader.tsx +22 -0
- package/src/kit/index.ts +1 -0
- package/src/layouts/LayoutPrimary/LayoutPrimary.styles.tsx +270 -306
- package/src/layouts/LayoutPrimary/LayoutPrimary.tsx +171 -91
- package/src/layouts/LayoutPrimary/index.ts +0 -2
- package/src/layouts/index.ts +0 -7
- package/src/system/SearchButton/SearchButton.styles.tsx +86 -0
- package/src/system/SearchButton/SearchButton.tsx +116 -0
- package/src/system/SearchButton/index.ts +1 -0
- package/src/system/index.ts +1 -0
- package/src/writer/Anchor/Anchor.styles.tsx +11 -0
- package/src/{content → writer}/Anchor/Anchor.tsx +20 -22
- package/src/writer/Anchor/index.tsx +1 -0
- package/src/writer/Badge/Badge.styles.tsx +37 -27
- package/src/writer/Badge/Badge.tsx +34 -48
- package/src/writer/Banner/Banner.styles.tsx +91 -0
- package/src/writer/Banner/Banner.tsx +70 -0
- package/src/writer/Banner/index.ts +1 -0
- package/src/writer/Blockquote/Blockquote.styles.tsx +6 -4
- package/src/writer/Blockquote/Blockquote.tsx +5 -2
- package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +25 -25
- package/src/writer/Breadcrumbs/Breadcrumbs.tsx +18 -12
- package/src/writer/Button/Button.styles.tsx +137 -0
- package/src/writer/Button/Button.tsx +75 -0
- package/src/writer/Button/index.ts +2 -0
- package/src/writer/Callout/Callout.styles.tsx +35 -42
- package/src/writer/Callout/Callout.tsx +30 -15
- package/src/writer/Card/Card.styles.tsx +47 -0
- package/src/writer/Card/Card.tsx +69 -0
- package/src/writer/Card/index.ts +1 -0
- package/src/writer/Code/Code.styles.tsx +12 -11
- package/src/writer/Code/Code.tsx +6 -3
- package/src/writer/ColorSchemeButton/ColorSchemeButton.tsx +172 -0
- package/src/writer/ColorSchemeButton/index.ts +1 -0
- package/src/writer/Details/Details.styles.tsx +87 -98
- package/src/writer/Details/Details.tsx +65 -44
- package/src/writer/Example/index.tsx +5 -0
- package/src/writer/GuideCard/GuideCard.styles.tsx +100 -103
- package/src/writer/GuideCard/GuideCard.tsx +72 -37
- package/src/writer/Heading/Heading.styles.tsx +76 -60
- package/src/writer/Heading/Heading.tsx +92 -22
- package/src/writer/Hr/Hr.styles.tsx +3 -1
- package/src/writer/Hr/Hr.tsx +2 -5
- package/src/writer/Icon/Icon.tsx +48 -0
- package/src/writer/Icon/index.ts +1 -0
- package/src/writer/Image/Image.styles.tsx +9 -0
- package/src/writer/Image/Image.tsx +19 -0
- package/src/writer/Image/index.ts +1 -0
- package/src/writer/List/List.styles.tsx +47 -0
- package/src/writer/List/List.tsx +29 -0
- package/src/writer/List/index.ts +4 -0
- package/src/writer/NavLinks/NavLinks.styles.ts +26 -26
- package/src/writer/NavLinks/NavLinks.tsx +65 -18
- package/src/writer/Pre/Pre.styles.tsx +8 -6
- package/src/writer/Pre/Pre.tsx +3 -2
- package/src/writer/Steps/Steps.styles.tsx +27 -24
- package/src/writer/Steps/Steps.tsx +38 -8
- package/src/writer/Table/Table.styles.tsx +65 -34
- package/src/writer/Table/Table.tsx +121 -11
- package/src/writer/Table/index.ts +0 -11
- package/src/writer/Tabs/Tabs.styles.tsx +51 -55
- package/src/writer/Tabs/Tabs.tsx +30 -23
- package/src/writer/Text/Text.styles.tsx +66 -0
- package/src/writer/Text/Text.tsx +79 -0
- package/src/writer/Text/index.ts +3 -0
- package/src/writer/TocCard/TocCard.module.css +44 -0
- package/src/writer/TocCard/TocCard.tsx +42 -0
- package/src/writer/TocCard/index.ts +3 -0
- package/src/writer/UnderlineNav/Tabs.tsx +51 -0
- package/src/writer/UnderlineNav/TabsPrimary.styles.tsx +184 -0
- package/src/writer/UnderlineNav/TabsPrimary.tsx +209 -0
- package/src/writer/UnderlineNav/TabsSecondary.styles.tsx +77 -0
- package/src/writer/UnderlineNav/TabsSecondary.tsx +171 -0
- package/src/writer/UnderlineNav/UnderlineNav.styles.tsx +165 -31
- package/src/writer/UnderlineNav/UnderlineNav.tsx +257 -22
- package/src/writer/UnderlineNav/index.ts +2 -1
- package/src/writer/UnderlineNav/useValueChange.ts +60 -0
- package/src/writer/Update/Update.styles.tsx +33 -0
- package/src/writer/Update/Update.tsx +37 -0
- package/src/writer/Update/index.ts +1 -0
- package/src/writer/VideoGuide/VideoGuide.module.css +105 -0
- package/src/writer/VideoGuide/VideoGuide.tsx +75 -0
- package/src/writer/VideoGuide/index.ts +1 -0
- package/src/writer/index.ts +23 -1
- package/tsconfig.json +9 -3
- package/types.d.ts +50 -0
- package/writer.ts +1 -1
- package/dist/CTABanner-4FVIoaTR.js +0 -2
- package/dist/CTABanner-4FVIoaTR.js.map +0 -1
- package/dist/CTABanner-BQx2SLf8.js +0 -2
- package/dist/CTABanner-BQx2SLf8.js.map +0 -1
- package/dist/CTABanner-C6afsXoE.js +0 -2
- package/dist/CTABanner-C6afsXoE.js.map +0 -1
- package/dist/CTABanner-CEKs-Hb-.js +0 -2
- package/dist/CTABanner-CEKs-Hb-.js.map +0 -1
- package/dist/CTABanner-CUNcTr6s.js +0 -2
- package/dist/CTABanner-CUNcTr6s.js.map +0 -1
- package/dist/CTABanner-D02aIAsD.js +0 -2
- package/dist/CTABanner-D02aIAsD.js.map +0 -1
- package/dist/CTABanner-Dm3tUG3I.js +0 -2
- package/dist/CTABanner-Dm3tUG3I.js.map +0 -1
- package/dist/CTABanner-MCOcVowa.js +0 -2
- package/dist/CTABanner-MCOcVowa.js.map +0 -1
- package/dist/CTABanner-X6K49gSr.js +0 -2
- package/dist/CTABanner-X6K49gSr.js.map +0 -1
- package/dist/CodeSample-B9VUhTKF.js +0 -2
- package/dist/CodeSample-B9VUhTKF.js.map +0 -1
- package/dist/CodeSample-BSXeFy0x.js +0 -2
- package/dist/CodeSample-BSXeFy0x.js.map +0 -1
- package/dist/CodeSample-BwP208sQ.js +0 -2
- package/dist/CodeSample-BwP208sQ.js.map +0 -1
- package/dist/CodeSample-CK-CQYrV.js +0 -2
- package/dist/CodeSample-CK-CQYrV.js.map +0 -1
- package/dist/CodeSample-CUemtj_W.js +0 -2
- package/dist/CodeSample-CUemtj_W.js.map +0 -1
- package/dist/CodeSample-D0iKih-A.js +0 -2
- package/dist/CodeSample-D0iKih-A.js.map +0 -1
- package/dist/CodeSample-D33vTa6M.js +0 -2
- package/dist/CodeSample-D33vTa6M.js.map +0 -1
- package/dist/CodeSample-DUSx2KBt.js +0 -2
- package/dist/CodeSample-DUSx2KBt.js.map +0 -1
- package/dist/CodeSample-P4yxkHPW.js +0 -2
- package/dist/CodeSample-P4yxkHPW.js.map +0 -1
- package/dist/HomeView-ACBdUgyz.js +0 -2
- package/dist/HomeView-B0ATNUF1.js +0 -2
- package/dist/HomeView-CHSb4HL6.js +0 -2
- package/dist/HomeView-COJrg8Ju.js +0 -2
- package/dist/HomeView-COJrg8Ju.js.map +0 -1
- package/dist/HomeView-Cun4apuy.js +0 -2
- package/dist/HomeView-Cun4apuy.js.map +0 -1
- package/dist/HomeView-D4DXEOOn.js +0 -2
- package/dist/HomeView-D4DXEOOn.js.map +0 -1
- package/dist/HomeView-DaH1PSBB.js +0 -2
- package/dist/HomeView-DaH1PSBB.js.map +0 -1
- package/dist/HomeView-O_lj2c2t.js +0 -2
- package/dist/HomeView-O_lj2c2t.js.map +0 -1
- package/dist/HomeView-_Nu2RcOM.js +0 -2
- package/dist/HomeView-_Nu2RcOM.js.map +0 -1
- package/dist/UnderlineNav-3-KptDYD.js +0 -2
- package/dist/UnderlineNav-3-KptDYD.js.map +0 -1
- package/dist/UnderlineNav-BCyB0G5d.js +0 -2
- package/dist/UnderlineNav-BCyB0G5d.js.map +0 -1
- package/dist/UnderlineNav-BEhDJk0H.js +0 -2
- package/dist/UnderlineNav-BEhDJk0H.js.map +0 -1
- package/dist/UnderlineNav-BqZ2xAp7.js +0 -2
- package/dist/UnderlineNav-BqZ2xAp7.js.map +0 -1
- package/dist/UnderlineNav-C2-4Vyj8.js +0 -2
- package/dist/UnderlineNav-C2-4Vyj8.js.map +0 -1
- package/dist/UnderlineNav-Co08Gykm.js +0 -2
- package/dist/UnderlineNav-Co08Gykm.js.map +0 -1
- package/dist/UnderlineNav-DC3UVmnZ.js +0 -2
- package/dist/UnderlineNav-DC3UVmnZ.js.map +0 -1
- package/dist/UnderlineNav-DsRYwuGB.js +0 -2
- package/dist/UnderlineNav-DsRYwuGB.js.map +0 -1
- package/dist/UnderlineNav-FbclXKUW.js +0 -2
- package/dist/UnderlineNav-FbclXKUW.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-BEouSrrZ.js +0 -2
- package/dist/_rollupPluginBabelHelpers-BEouSrrZ.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-BHehKRBq.js +0 -2
- package/dist/_rollupPluginBabelHelpers-BHehKRBq.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-Bunpz22T.js +0 -2
- package/dist/_rollupPluginBabelHelpers-Bunpz22T.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-CVblpRvU.js +0 -2
- package/dist/_rollupPluginBabelHelpers-CVblpRvU.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-CxmswfqM.js +0 -2
- package/dist/_rollupPluginBabelHelpers-CxmswfqM.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-D0XU6lDu.js +0 -2
- package/dist/_rollupPluginBabelHelpers-D0XU6lDu.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-DQJTK9EO.js +0 -2
- package/dist/_rollupPluginBabelHelpers-DQJTK9EO.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-DuRQdJ01.js +0 -2
- package/dist/_rollupPluginBabelHelpers-DuRQdJ01.js.map +0 -1
- package/dist/_rollupPluginBabelHelpers-tRAa4O0f.js +0 -2
- package/dist/_rollupPluginBabelHelpers-tRAa4O0f.js.map +0 -1
- package/dist/index-B0FncPxO.js +0 -2
- package/dist/index-B0FncPxO.js.map +0 -1
- package/dist/index-BEm-xkm-.js +0 -2
- package/dist/index-BEm-xkm-.js.map +0 -1
- package/dist/index-BHwtxG27.js +0 -2
- package/dist/index-BHwtxG27.js.map +0 -1
- package/dist/index-BTcmIG47.js +0 -2
- package/dist/index-BTcmIG47.js.map +0 -1
- package/dist/index-BbIMmTvo.js +0 -2
- package/dist/index-BbIMmTvo.js.map +0 -1
- package/dist/index-CNkHt1r7.js +0 -2
- package/dist/index-CNkHt1r7.js.map +0 -1
- package/dist/index-D0XuyFm7.js +0 -2
- package/dist/index-D0XuyFm7.js.map +0 -1
- package/dist/index-DBspcqWq.js +0 -2
- package/dist/index-DBspcqWq.js.map +0 -1
- package/dist/index-DVBO4gYE.js +0 -2
- package/dist/index-DVBO4gYE.js.map +0 -1
- package/dist/tslib.es6-BBkx4Se1.js +0 -2
- package/dist/tslib.es6-BF6ZLEXa.js +0 -2
- package/dist/tslib.es6-BOZCDgb8.js +0 -2
- package/dist/tslib.es6-CNVK7Xcu.js +0 -2
- package/dist/tslib.es6-CNVK7Xcu.js.map +0 -1
- package/dist/tslib.es6-Cjl5tesf.js +0 -2
- package/dist/tslib.es6-Cjl5tesf.js.map +0 -1
- package/dist/tslib.es6-DEH7Dkgy.js +0 -2
- package/dist/tslib.es6-DEH7Dkgy.js.map +0 -1
- package/dist/tslib.es6-DTeJ7dWi.js +0 -2
- package/dist/tslib.es6-DTeJ7dWi.js.map +0 -1
- package/dist/tslib.es6-U9-f6pA7.js +0 -2
- package/dist/tslib.es6-U9-f6pA7.js.map +0 -1
- package/dist/tslib.es6-cb69JjeS.js +0 -2
- package/dist/tslib.es6-cb69JjeS.js.map +0 -1
- package/src/content/Anchor/Anchor.styles.tsx +0 -5
- package/src/content/Anchor/index.tsx +0 -3
- package/src/content/Content/Content.styles.tsx +0 -9
- package/src/content/Content/Content.tsx +0 -13
- package/src/content/Content/index.tsx +0 -3
- package/src/content/Content.tsx +0 -179
- package/src/content/Subtitle/Subtitle.styles.ts +0 -8
- package/src/content/Subtitle/Subtitle.tsx +0 -12
- package/src/content/Subtitle/index.tsx +0 -3
- package/src/layouts/Layout.styles.tsx +0 -155
- package/src/layouts/Layout.tsx +0 -119
- package/src/ui/Loader/Loader.styles.tsx +0 -54
- package/src/ui/Loader/Loader.tsx +0 -26
- package/src/ui/index.ts +0 -1
- package/src/writer/Icon/index.tsx +0 -355
- package/src/writer/Table/TableV2.styles.tsx +0 -117
- package/src/writer/Table/TableV2.tsx +0 -83
- /package/src/{ui → kit}/TODO.md +0 -0
package/dist/coder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coder.js","sources":["../src/coder/Code/highlight.ts"],"sourcesContent":["import {\n type CodeAnnotation,\n type RawCode,\n type HighlightedCode,\n type Token\n} from 'codehike/code';\nimport {\n type Lines,\n type Tokens,\n highlightSync as lighter,\n LANG_NAMES,\n type Theme\n} from '@code-hike/lighter';\n\ntype Whitespace = string\n\ntype AnyToken = Token | Whitespace\n\nfunction isWhitespace(token: Token | Whitespace): token is Whitespace {\n return typeof token === 'string';\n}\n\nexport function highlight(\n data: RawCode,\n theme: Theme,\n lang: string\n): HighlightedCode {\n if (!LANG_NAMES.includes(lang)) {\n console.warn(`Unknown language \"${lang}\"`);\n lang = 'txt';\n }\n\n const {\n lines,\n lang: lighterLang,\n style\n } = lighter(data.value, lang, theme as any, {\n annotations: [],\n scopes: false // true for better token transitions, but breaks css themes\n });\n\n const tokens = joinLines(lines);\n // split surrounding whitespace for each token\n const splitTokens = splitWhitespace(tokens);\n // join consecutive whitespace tokens\n const joinedTokens = joinWhitespace(splitTokens);\n\n return {\n ...data,\n code: data.value,\n tokens: joinedTokens,\n lang: lighterLang,\n annotations: [], // TODO: in the future\n // annotations: compatAnnotations(annotations),\n themeName: typeof theme === 'string' ? theme : theme?.name || 'unknown',\n style\n };\n}\n\nfunction compatAnnotations(annotations: any[]): CodeAnnotation[] {\n const newAnnotations: CodeAnnotation[] = [];\n for (const a of annotations) {\n const {name, query, ranges} = a;\n for (const r of ranges) {\n if (r.lineNumber) {\n const {lineNumber, fromColumn, toColumn} = r;\n newAnnotations.push({\n name,\n query,\n lineNumber,\n fromColumn,\n toColumn\n });\n } else {\n const {fromLineNumber, toLineNumber} = r;\n newAnnotations.push({\n name,\n query,\n fromLineNumber,\n toLineNumber\n });\n }\n }\n }\n return newAnnotations;\n}\n\n// group the Lines into one array\nfunction joinLines(lines: Lines): AnyToken[] {\n const joinedTokens: AnyToken[] = [];\n lines.forEach((lineOrGroup, i) => {\n if ('lines' in lineOrGroup) {\n throw new Error('Shouldnt be groups');\n } else {\n const tokens = joinTokens(lineOrGroup.tokens);\n joinedTokens.push(...tokens);\n if (i < lines.length - 1) {\n joinedTokens.push('\\n');\n }\n }\n });\n return joinedTokens;\n}\n\nfunction joinTokens(tokens: Tokens): AnyToken[] {\n return tokens.map((tokenOrGroup) => {\n if ('tokens' in tokenOrGroup) {\n throw new Error('Shouldnt be groups');\n } else {\n const t = [tokenOrGroup.content] as Token;\n const {color, ...rest} = tokenOrGroup.style || {};\n t.push(color);\n if (Object.keys(rest).length) {\n t.push(rest);\n }\n return t;\n }\n });\n}\n\nfunction splitWhitespace(tokens: AnyToken[]) {\n const ejected: AnyToken[] = [];\n tokens.forEach((tokenOrGroup) => {\n if (isWhitespace(tokenOrGroup)) {\n ejected.push(tokenOrGroup);\n } else {\n const [before, content, after] = splitSurroundingWhitespace(\n tokenOrGroup[0]\n );\n if (before?.length) {\n ejected.push(before);\n }\n if (content.length) {\n const copy = [...tokenOrGroup] as Token;\n copy[0] = content;\n ejected.push(copy);\n }\n if (after?.length) {\n ejected.push(after);\n }\n }\n });\n return ejected;\n}\n\nfunction joinWhitespace(tokens: AnyToken[]) {\n const joinedTokens: AnyToken[] = [];\n tokens.forEach((tokenOrGroup) => {\n if (isWhitespace(tokenOrGroup)) {\n let last = joinedTokens[joinedTokens.length - 1];\n if (last && isWhitespace(last)) {\n joinedTokens[joinedTokens.length - 1] += tokenOrGroup;\n } else if (tokenOrGroup !== '') {\n joinedTokens.push(tokenOrGroup);\n }\n } else if (tokenOrGroup[0].length > 0) {\n joinedTokens.push(tokenOrGroup);\n }\n });\n return joinedTokens;\n}\n\n// splits \" \\t foo bar \\n\" into [\" \\t \",\"foo bar\",\" \\n\"]\n// \"foo bar\" -> [\"\",\"foo bar\",\"\"]\nfunction splitSurroundingWhitespace(content: string) {\n const trimmed = content.trim();\n const before = content.slice(0, content.indexOf(trimmed));\n const after = content.slice(content.indexOf(trimmed) + trimmed.length);\n return [before, trimmed, after];\n}"],"names":["isWhitespace","token","highlight","data","theme","lang","LANG_NAMES","includes","console","warn","concat","_lighter","lighter","value","annotations","scopes","lines","lighterLang","style","tokens","
|
|
1
|
+
{"version":3,"file":"coder.js","sources":["../src/coder/Code/highlight.ts"],"sourcesContent":["import {\n type CodeAnnotation,\n type RawCode,\n type HighlightedCode,\n type Token\n} from 'codehike/code';\nimport {\n type Lines,\n type Tokens,\n highlight as lighterAsync,\n highlightSync as lighter,\n LANG_NAMES,\n type Theme\n} from '@code-hike/lighter';\n\ntype Whitespace = string\n\ntype AnyToken = Token | Whitespace\n\nfunction isWhitespace(token: Token | Whitespace): token is Whitespace {\n return typeof token === 'string';\n}\n\nexport function highlight(\n data: RawCode,\n theme: Theme,\n lang: string\n): HighlightedCode {\n if (!LANG_NAMES.includes(lang)) {\n console.warn(`Unknown language \"${lang}\"`);\n lang = 'txt';\n }\n\n const {\n lines,\n lang: lighterLang,\n style\n } = lighter(data.value, lang, theme as any, {\n annotations: [],\n scopes: false // true for better token transitions, but breaks css themes\n });\n\n const tokens = joinLines(lines);\n // split surrounding whitespace for each token\n const splitTokens = splitWhitespace(tokens);\n // join consecutive whitespace tokens\n const joinedTokens = joinWhitespace(splitTokens);\n\n return {\n ...data,\n code: data.value,\n tokens: joinedTokens,\n lang: lighterLang,\n annotations: [], // TODO: in the future\n // annotations: compatAnnotations(annotations),\n themeName: typeof theme === 'string' ? theme : theme?.name || 'unknown',\n style\n };\n}\n\nexport async function highlightAsync(\n data: RawCode,\n theme: Theme,\n lang: string\n): Promise<HighlightedCode> {\n if (!LANG_NAMES.includes(lang)) {\n console.warn(`Unknown language \"${lang}\"`);\n lang = 'txt';\n }\n\n const {\n lines,\n lang: lighterLang,\n style\n } = await lighterAsync(data.value, lang, theme as any, {\n annotations: [],\n scopes: false // true for better token transitions, but breaks css themes\n });\n\n const tokens = joinLines(lines);\n // split surrounding whitespace for each token\n const splitTokens = splitWhitespace(tokens);\n // join consecutive whitespace tokens\n const joinedTokens = joinWhitespace(splitTokens);\n\n return {\n ...data,\n code: data.value,\n tokens: joinedTokens,\n lang: lighterLang,\n annotations: [], // TODO: in the future\n // annotations: compatAnnotations(annotations),\n themeName: typeof theme === 'string' ? theme : theme?.name || 'unknown',\n style\n };\n}\n\nfunction compatAnnotations(annotations: any[]): CodeAnnotation[] {\n const newAnnotations: CodeAnnotation[] = [];\n for (const a of annotations) {\n const {name, query, ranges} = a;\n for (const r of ranges) {\n if (r.lineNumber) {\n const {lineNumber, fromColumn, toColumn} = r;\n newAnnotations.push({\n name,\n query,\n lineNumber,\n fromColumn,\n toColumn\n });\n } else {\n const {fromLineNumber, toLineNumber} = r;\n newAnnotations.push({\n name,\n query,\n fromLineNumber,\n toLineNumber\n });\n }\n }\n }\n return newAnnotations;\n}\n\n// group the Lines into one array\nfunction joinLines(lines: Lines): AnyToken[] {\n const joinedTokens: AnyToken[] = [];\n lines.forEach((lineOrGroup, i) => {\n if ('lines' in lineOrGroup) {\n throw new Error('Shouldnt be groups');\n } else {\n const tokens = joinTokens(lineOrGroup.tokens);\n joinedTokens.push(...tokens);\n if (i < lines.length - 1) {\n joinedTokens.push('\\n');\n }\n }\n });\n return joinedTokens;\n}\n\nfunction joinTokens(tokens: Tokens): AnyToken[] {\n return tokens.map((tokenOrGroup) => {\n if ('tokens' in tokenOrGroup) {\n throw new Error('Shouldnt be groups');\n } else {\n const t = [tokenOrGroup.content] as Token;\n const {color, ...rest} = tokenOrGroup.style || {};\n t.push(color);\n if (Object.keys(rest).length) {\n t.push(rest);\n }\n return t;\n }\n });\n}\n\nfunction splitWhitespace(tokens: AnyToken[]) {\n const ejected: AnyToken[] = [];\n tokens.forEach((tokenOrGroup) => {\n if (isWhitespace(tokenOrGroup)) {\n ejected.push(tokenOrGroup);\n } else {\n const [before, content, after] = splitSurroundingWhitespace(\n tokenOrGroup[0]\n );\n if (before?.length) {\n ejected.push(before);\n }\n if (content.length) {\n const copy = [...tokenOrGroup] as Token;\n copy[0] = content;\n ejected.push(copy);\n }\n if (after?.length) {\n ejected.push(after);\n }\n }\n });\n return ejected;\n}\n\nfunction joinWhitespace(tokens: AnyToken[]) {\n const joinedTokens: AnyToken[] = [];\n tokens.forEach((tokenOrGroup) => {\n if (isWhitespace(tokenOrGroup)) {\n let last = joinedTokens[joinedTokens.length - 1];\n if (last && isWhitespace(last)) {\n joinedTokens[joinedTokens.length - 1] += tokenOrGroup;\n } else if (tokenOrGroup !== '') {\n joinedTokens.push(tokenOrGroup);\n }\n } else if (tokenOrGroup[0].length > 0) {\n joinedTokens.push(tokenOrGroup);\n }\n });\n return joinedTokens;\n}\n\n// splits \" \\t foo bar \\n\" into [\" \\t \",\"foo bar\",\" \\n\"]\n// \"foo bar\" -> [\"\",\"foo bar\",\"\"]\nfunction splitSurroundingWhitespace(content: string) {\n const trimmed = content.trim();\n const before = content.slice(0, content.indexOf(trimmed));\n const after = content.slice(content.indexOf(trimmed) + trimmed.length);\n return [before, trimmed, after];\n}"],"names":["isWhitespace","token","highlight","data","theme","lang","LANG_NAMES","includes","console","warn","concat","_lighter","lighter","value","annotations","scopes","lines","lighterLang","style","joinedTokens","joinWhitespace","splitWhitespace","joinLines","Object","assign","code","tokens","themeName","name","highlightAsync","_context","n","lighterAsync","_yield$lighterAsync","v","splitTokens","a","_callee","forEach","lineOrGroup","i","Error","map","tokenOrGroup","t","content","_a","color","rest","__rest","push","keys","length","joinTokens","apply","_toConsumableArray","ejected","_splitSurroundingWhit","trimmed","trim","before","slice","indexOf","after","splitSurroundingWhitespace","_splitSurroundingWhit2","_slicedToArray","copy","last"],"mappings":"sgBAmBA,SAASA,EAAaC,GAClB,MAAwB,iBAAVA,CAClB,UAEgBC,EACZC,EACAC,EACAC,GAEKC,EAAWC,SAASF,KACrBG,QAAQC,KAAI,qBAAAC,OAAsBL,QAClCA,EAAO,OAGX,IAAAM,EAIIC,EAAQT,EAAKU,MAAOR,EAAMD,EAAc,CACxCU,YAAa,GACbC,QAAQ,IALRC,EAAKL,EAALK,MACMC,EAAWN,EAAjBN,KACAa,EAAKP,EAALO,MAUEC,EAAeC,EAFDC,EAFLC,EAAUN,KAMzB,OAAAO,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACOrB,GAAI,CACPsB,KAAMtB,EAAKU,MACXa,OAAQP,EACRd,KAAMY,EACNH,YAAa,GAEba,UAA4B,iBAAVvB,EAAqBA,GAAQA,aAAK,EAALA,EAAOwB,OAAQ,UAC9DV,MAAAA,GAER,UAEsBW,EAClB1B,EACAC,EACAC,uHAWI,OATCC,EAAWC,SAASF,KACrBG,QAAQC,KAAI,qBAAAC,OAAsBL,QAClCA,EAAO,OACVyB,EAAAC,EAAA,EAMSC,EAAa7B,EAAKU,MAAOR,EAAMD,EAAc,CACnDU,YAAa,GACbC,QAAQ,IACV,KAAA,EAM8C,OAN9CkB,EAAAH,EAAAI,EANElB,EAAKiB,EAALjB,MACMC,EAAWgB,EAAjB5B,KACAa,EAAKe,EAALf,MAMEQ,EAASJ,EAAUN,GAEnBmB,EAAcd,EAAgBK,GAE9BP,EAAeC,EAAee,GAAYL,EAAAM,EAAA,EAEhDb,OAAAC,OAAAD,OAAAC,OAAA,GACOrB,GAAI,CACPsB,KAAMtB,EAAKU,MACXa,OAAQP,EACRd,KAAMY,EACNH,YAAa,GAEba,UAA4B,iBAAVvB,EAAqBA,GAAQA,aAAK,EAALA,EAAOwB,OAAQ,UAC9DV,MAAAA,KAAK,EAAAmB,EAAA,GAEZ,CA+BD,SAASf,EAAUN,GACf,IAAMG,EAA2B,GAYjC,OAXAH,EAAMsB,QAAQ,SAACC,EAAaC,GACxB,GAAI,UAAWD,EACX,MAAM,IAAIE,MAAM,sBAEhB,IAAMf,EAUlB,SAAoBA,GAChB,OAAOA,EAAOgB,IAAI,SAACC,GACf,GAAI,WAAYA,EACZ,MAAM,IAAIF,MAAM,sBAEhB,IAAMG,EAAI,CAACD,EAAaE,SAClBC,EAAmBH,EAAazB,OAAS,CAAA,EAAxC6B,IAAAA,MAAUC,EAAIC,EAAAH,EAAf,CAAA,UAKN,OAJAF,EAAEM,KAAKH,GACHxB,OAAO4B,KAAKH,GAAMI,QAClBR,EAAEM,KAAKF,GAEJJ,CAEf,EACJ,CAxB2BS,CAAWd,EAAYb,QACtCP,EAAa+B,KAAII,MAAjBnC,EAAYoC,EAAS7B,IACjBc,EAAIxB,EAAMoC,OAAS,GACnBjC,EAAa+B,KAAK,KAG9B,GACO/B,CACX,CAkBA,SAASE,EAAgBK,GACrB,IAAM8B,EAAsB,GAqB5B,OApBA9B,EAAOY,QAAQ,SAACK,GACZ,GAAI3C,EAAa2C,GACba,EAAQN,KAAKP,OACV,CACH,IAAAc,EAsCZ,SAAoCZ,GAChC,IAAMa,EAAUb,EAAQc,OAClBC,EAASf,EAAQgB,MAAM,EAAGhB,EAAQiB,QAAQJ,IAC1CK,EAAQlB,EAAQgB,MAAMhB,EAAQiB,QAAQJ,GAAWA,EAAQN,QAC/D,MAAO,CAACQ,EAAQF,EAASK,EAC7B,CA3C6CC,CAC7BrB,EAAa,IAChBsB,EAAAC,EAAAT,EAAA,GAFMG,EAAMK,EAAA,GAAEpB,EAAOoB,EAAA,GAAEF,EAAKE,EAAA,GAM7B,IAHIL,aAAM,EAANA,EAAQR,SACRI,EAAQN,KAAKU,GAEbf,EAAQO,OAAQ,CAChB,IAAMe,EAAIZ,EAAOZ,GACjBwB,EAAK,GAAKtB,EACVW,EAAQN,KAAKiB,EACjB,EACIJ,aAAK,EAALA,EAAOX,SACPI,EAAQN,KAAKa,EAErB,CACJ,GACOP,CACX,CAEA,SAASpC,EAAeM,GACpB,IAAMP,EAA2B,GAajC,OAZAO,EAAOY,QAAQ,SAACK,GACZ,GAAI3C,EAAa2C,GAAe,CAC5B,IAAIyB,EAAOjD,EAAaA,EAAaiC,OAAS,GAC1CgB,GAAQpE,EAAaoE,GACrBjD,EAAaA,EAAaiC,OAAS,IAAMT,EACjB,KAAjBA,GACPxB,EAAa+B,KAAKP,QAEfA,EAAa,GAAGS,OAAS,GAChCjC,EAAa+B,KAAKP,EAE1B,GACOxB,CACX"}
|
package/dist/content.d.ts
CHANGED
|
@@ -1,145 +1,233 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { Settings } from '@xyd-js/core';
|
|
2
3
|
import { Theme } from '@code-hike/lighter';
|
|
3
|
-
|
|
4
|
-
interface TableV2Props {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
}
|
|
8
|
-
declare function TableV2({ children, className }: TableV2Props): React.JSX.Element;
|
|
9
|
-
declare namespace TableV2 {
|
|
10
|
-
var Head: ({ children }: TableHeadProps) => React.JSX.Element;
|
|
11
|
-
var Th: ({ children, numeric }: TableThProps) => React.JSX.Element;
|
|
12
|
-
var Tr: ({ children }: TableTrProps) => React.JSX.Element;
|
|
13
|
-
var Td: ({ children, numeric, muted }: TableTdProps) => React.JSX.Element;
|
|
14
|
-
var Cell: ({ children }: TableCellProps) => React.JSX.Element;
|
|
15
|
-
var ModelCell: ({ children }: TableModelCellProps) => React.JSX.Element;
|
|
16
|
-
}
|
|
17
|
-
interface TableHeadProps {
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
}
|
|
20
|
-
interface TableThProps {
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
numeric?: boolean;
|
|
23
|
-
}
|
|
24
|
-
interface TableTrProps {
|
|
25
|
-
children: React.ReactNode;
|
|
26
|
-
}
|
|
27
|
-
interface TableTdProps {
|
|
28
|
-
children: React.ReactNode;
|
|
29
|
-
numeric?: boolean;
|
|
30
|
-
muted?: boolean;
|
|
31
|
-
}
|
|
32
|
-
interface TableCellProps {
|
|
33
|
-
children: React.ReactNode;
|
|
34
|
-
}
|
|
35
|
-
interface TableModelCellProps {
|
|
36
|
-
children: React.ReactNode;
|
|
37
|
-
}
|
|
4
|
+
import { HighlightedCode } from 'codehike/code';
|
|
38
5
|
|
|
39
6
|
interface BadgeProps {
|
|
7
|
+
/**
|
|
8
|
+
* The class name of the badge.
|
|
9
|
+
*/
|
|
40
10
|
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The children of the badge.
|
|
13
|
+
*/
|
|
41
14
|
children?: React.ReactNode;
|
|
42
|
-
|
|
43
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The size of the badge.
|
|
17
|
+
*/
|
|
18
|
+
size?: "sm" | "xs";
|
|
19
|
+
/**
|
|
20
|
+
* The kind of the badge.
|
|
21
|
+
*/
|
|
22
|
+
kind?: "warning" | "info" | "default";
|
|
44
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Badge component is used to display a badge.
|
|
26
|
+
*
|
|
27
|
+
* @group Components
|
|
28
|
+
*/
|
|
45
29
|
declare function Badge({ className, children, size, kind }: BadgeProps): React.JSX.Element;
|
|
46
30
|
|
|
47
|
-
interface
|
|
48
|
-
children
|
|
31
|
+
interface ButtonProps {
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
kind?: "primary" | "secondary" | "tertiary" | undefined;
|
|
34
|
+
theme?: "ghost";
|
|
35
|
+
size?: "sm" | "md" | "lg";
|
|
36
|
+
className?: string;
|
|
37
|
+
onClick?: () => void;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
icon?: React.ReactElement;
|
|
40
|
+
iconPosition?: "left" | "right";
|
|
41
|
+
href?: string;
|
|
49
42
|
}
|
|
50
|
-
declare function
|
|
43
|
+
declare function Button({ children, kind, theme, size, className, onClick, disabled, icon, iconPosition, href }: ButtonProps): React.JSX.Element;
|
|
51
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Props for the Callout component
|
|
47
|
+
*/
|
|
52
48
|
interface CalloutProps {
|
|
49
|
+
/** Additional CSS class name to be applied to the callout */
|
|
50
|
+
className?: string;
|
|
51
|
+
/** Content to be displayed inside the callout */
|
|
53
52
|
children: React.ReactNode;
|
|
54
53
|
}
|
|
55
|
-
|
|
54
|
+
/**
|
|
55
|
+
* A Callout component that displays important information or notices in a visually distinct way.
|
|
56
|
+
* It includes an info icon and a message area for content.
|
|
57
|
+
*
|
|
58
|
+
* @category Component
|
|
59
|
+
*/
|
|
60
|
+
declare function Callout({ className, children }: CalloutProps): React.JSX.Element;
|
|
56
61
|
|
|
57
|
-
|
|
58
|
-
children: React.ReactNode;
|
|
59
|
-
}
|
|
60
|
-
declare function Code({ children }: CodeProps): React.JSX.Element;
|
|
62
|
+
declare function ColorSchemeButton(): React.JSX.Element;
|
|
61
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Base interface for all Details component variants
|
|
66
|
+
*/
|
|
62
67
|
interface BaseDetailsProps {
|
|
68
|
+
/** Content to be displayed inside the details element */
|
|
63
69
|
children: React.ReactNode;
|
|
70
|
+
/** Label text displayed in the summary */
|
|
64
71
|
label: string;
|
|
72
|
+
/** Optional icon element to be displayed in the summary */
|
|
65
73
|
icon?: React.ReactElement;
|
|
74
|
+
/** Optional CSS class name for custom styling */
|
|
75
|
+
className?: string;
|
|
66
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Props for the tertiary variant of the Details component
|
|
79
|
+
*/
|
|
67
80
|
interface TertiaryDetailsProps extends BaseDetailsProps {
|
|
81
|
+
/** Specifies the tertiary variant */
|
|
68
82
|
kind: "tertiary";
|
|
83
|
+
/** Title text or element displayed in the summary */
|
|
69
84
|
title: string | React.ReactNode;
|
|
70
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Props for the secondary variant of the Details component
|
|
88
|
+
*/
|
|
71
89
|
interface SecondaryDetailsProps extends BaseDetailsProps {
|
|
90
|
+
/** Specifies the secondary variant */
|
|
72
91
|
kind: "secondary";
|
|
92
|
+
/** Title text or element displayed in the summary */
|
|
73
93
|
title: string | React.ReactNode;
|
|
74
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Props for the primary variant of the Details component
|
|
97
|
+
*/
|
|
75
98
|
interface PrimaryDetailsProps extends BaseDetailsProps {
|
|
99
|
+
/** Specifies the primary variant (default) */
|
|
76
100
|
kind?: "primary";
|
|
77
101
|
}
|
|
102
|
+
/** Union type of all possible Details component variants */
|
|
78
103
|
type DetailsProps = PrimaryDetailsProps | SecondaryDetailsProps | TertiaryDetailsProps;
|
|
79
|
-
|
|
104
|
+
/**
|
|
105
|
+
* A collapsible details component that supports three variants: primary, secondary, and tertiary.
|
|
106
|
+
* Each variant has a different visual style and structure.
|
|
107
|
+
*
|
|
108
|
+
* @param props - The component props
|
|
109
|
+
* @returns A details element with collapsible content
|
|
110
|
+
*
|
|
111
|
+
* @category Component
|
|
112
|
+
*/
|
|
113
|
+
declare function Details(props: DetailsProps): React.ReactElement;
|
|
80
114
|
|
|
81
|
-
interface
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
icon?: React.ReactNode;
|
|
86
|
-
kind?: "secondary";
|
|
87
|
-
size?: "sm" | "md";
|
|
88
|
-
}
|
|
89
|
-
declare function GuideCard({ children, href, icon, title, kind, size, }: GuideCardProps): React.JSX.Element;
|
|
90
|
-
declare namespace GuideCard {
|
|
91
|
-
var List: ({ children }: {
|
|
92
|
-
children: React.ReactNode;
|
|
93
|
-
}) => React.JSX.Element;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
interface HrProps {
|
|
97
|
-
children: React.ReactNode;
|
|
115
|
+
interface IconProps {
|
|
116
|
+
name: string;
|
|
117
|
+
size?: number;
|
|
118
|
+
color?: string;
|
|
98
119
|
}
|
|
99
|
-
declare function
|
|
100
|
-
|
|
101
|
-
declare function IconSessionReplay(): React.JSX.Element;
|
|
102
|
-
declare function IconMetrics(): React.JSX.Element;
|
|
103
|
-
declare function IconFunnels(): React.JSX.Element;
|
|
104
|
-
declare function IconCode(): React.JSX.Element;
|
|
105
|
-
declare function IconCustomEvent(): React.JSX.Element;
|
|
106
|
-
declare function IconAlert(): React.JSX.Element;
|
|
107
|
-
declare function IconBrowser(): React.JSX.Element;
|
|
108
|
-
declare function IconREST(): React.JSX.Element;
|
|
109
|
-
declare function IconGraphQL(): React.JSX.Element;
|
|
110
|
-
declare function IconWebhooks(): React.JSX.Element;
|
|
111
|
-
declare function IconJSBrowser(): React.JSX.Element;
|
|
112
|
-
declare function IconJSNode(): React.JSX.Element;
|
|
113
|
-
declare function IconStorybook(): React.JSX.Element;
|
|
114
|
-
declare function IconReactRouter(): React.JSX.Element;
|
|
115
|
-
declare function IconNextJS(): React.JSX.Element;
|
|
116
|
-
declare function IconAppTemplate(): React.JSX.Element;
|
|
117
|
-
declare function IconQuote(): React.JSX.Element;
|
|
120
|
+
declare function Icon(props: IconProps): ReactElement | null;
|
|
118
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Props for the Steps component
|
|
124
|
+
*/
|
|
119
125
|
interface StepsProps {
|
|
126
|
+
/** Content to be rendered inside the steps list */
|
|
120
127
|
children: React.ReactNode;
|
|
128
|
+
/** Optional CSS class name to be applied to the steps container */
|
|
129
|
+
className?: string;
|
|
121
130
|
}
|
|
122
|
-
|
|
131
|
+
/**
|
|
132
|
+
* Steps component that renders a numbered list of steps or stages.
|
|
133
|
+
* Use this component to display a sequence of steps in a process or workflow.
|
|
134
|
+
*
|
|
135
|
+
* @category Component
|
|
136
|
+
*/
|
|
137
|
+
declare function Steps({ children, className }: StepsProps): React.JSX.Element;
|
|
123
138
|
declare namespace Steps {
|
|
124
|
-
var Item: ({ children }: StepsItemProps) => React.JSX.Element;
|
|
139
|
+
var Item: ({ children, className }: StepsItemProps) => React.JSX.Element;
|
|
125
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Props for the Steps.Item component
|
|
143
|
+
*/
|
|
126
144
|
interface StepsItemProps {
|
|
145
|
+
/** Content to be rendered inside the step item */
|
|
127
146
|
children: React.ReactNode;
|
|
147
|
+
/** Optional CSS class name to be applied to the step item */
|
|
148
|
+
className?: string;
|
|
128
149
|
}
|
|
129
150
|
|
|
130
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Props for the Table component
|
|
153
|
+
*/
|
|
154
|
+
interface TableProps {
|
|
155
|
+
/** The content to be rendered inside the table */
|
|
131
156
|
children: React.ReactNode;
|
|
132
|
-
|
|
133
|
-
|
|
157
|
+
/** Optional CSS class name to be applied to the table */
|
|
158
|
+
className?: string;
|
|
134
159
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
160
|
+
/**
|
|
161
|
+
* A table component that provides a structured way to display tabular data.
|
|
162
|
+
* It supports custom styling through className prop and can contain various table elements.
|
|
163
|
+
*
|
|
164
|
+
* @category Component
|
|
165
|
+
*/
|
|
166
|
+
declare function Table({ children, className }: TableProps): React.JSX.Element;
|
|
167
|
+
declare namespace Table {
|
|
168
|
+
var Head: ({ children }: TableHeadProps) => React.JSX.Element;
|
|
169
|
+
var Th: ({ children, numeric }: TableThProps) => React.JSX.Element;
|
|
170
|
+
var Tr: ({ children }: TableTrProps) => React.JSX.Element;
|
|
171
|
+
var Body: ({ children }: TableBodyProps) => React.JSX.Element;
|
|
172
|
+
var Td: ({ children, numeric, muted }: TableTdProps) => React.JSX.Element;
|
|
173
|
+
var Cell: ({ children }: TableCellProps) => React.JSX.Element;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Props for the TableHead component
|
|
177
|
+
*/
|
|
178
|
+
interface TableHeadProps {
|
|
179
|
+
/** The content to be rendered inside the table header */
|
|
180
|
+
children: React.ReactNode;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Props for the TableTh component
|
|
184
|
+
*/
|
|
185
|
+
interface TableThProps {
|
|
186
|
+
/** The content to be rendered inside the table header cell */
|
|
187
|
+
children: React.ReactNode;
|
|
188
|
+
/** Whether the cell content should be right-aligned (for numeric values) */
|
|
189
|
+
numeric?: boolean;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Props for the TableTr component
|
|
193
|
+
*/
|
|
194
|
+
interface TableTrProps {
|
|
195
|
+
/** The content to be rendered inside the table row */
|
|
196
|
+
children: React.ReactNode;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Props for the TableBody component
|
|
200
|
+
*/
|
|
201
|
+
interface TableBodyProps {
|
|
202
|
+
/** The content to be rendered inside the table body */
|
|
203
|
+
children: React.ReactNode;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Props for the TableTd component
|
|
207
|
+
*/
|
|
208
|
+
interface TableTdProps {
|
|
209
|
+
/** The content to be rendered inside the table cell */
|
|
210
|
+
children: React.ReactNode;
|
|
211
|
+
/** Whether the cell content should be right-aligned (for numeric values) */
|
|
212
|
+
numeric?: boolean;
|
|
213
|
+
/** Whether the cell should have a muted appearance */
|
|
214
|
+
muted?: boolean;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Props for the TableCell component
|
|
218
|
+
*/
|
|
219
|
+
interface TableCellProps {
|
|
220
|
+
/** The content to be rendered inside the table cell */
|
|
221
|
+
children: React.ReactNode;
|
|
141
222
|
}
|
|
142
223
|
|
|
224
|
+
interface UpdateProps {
|
|
225
|
+
children: React.ReactNode;
|
|
226
|
+
version: string;
|
|
227
|
+
date?: string;
|
|
228
|
+
}
|
|
229
|
+
declare function Update(props: UpdateProps): React.JSX.Element;
|
|
230
|
+
|
|
143
231
|
interface CodeThemeBlockProps {
|
|
144
232
|
/** This is the raw code. May include annotation comments. */
|
|
145
233
|
value: string;
|
|
@@ -147,145 +235,120 @@ interface CodeThemeBlockProps {
|
|
|
147
235
|
lang: string;
|
|
148
236
|
/** Metadata string (the content after the language name in a markdown codeblock). */
|
|
149
237
|
meta: string;
|
|
238
|
+
/** The highlighted code. */
|
|
239
|
+
highlighted?: HighlightedCode;
|
|
150
240
|
}
|
|
151
241
|
|
|
152
242
|
interface CodeSampleProps {
|
|
153
243
|
name: string;
|
|
154
244
|
description: string;
|
|
155
|
-
codeblocks
|
|
245
|
+
codeblocks?: CodeThemeBlockProps[];
|
|
246
|
+
theme?: Theme;
|
|
156
247
|
size?: "full";
|
|
248
|
+
lineNumbers?: boolean;
|
|
249
|
+
descriptionHead?: string;
|
|
250
|
+
descriptionContent?: string | React.ReactNode;
|
|
251
|
+
descriptionIcon?: string;
|
|
157
252
|
kind?: "secondary";
|
|
158
|
-
|
|
253
|
+
controlByMeta?: boolean;
|
|
159
254
|
}
|
|
160
255
|
declare function CodeSample(props: CodeSampleProps): React.JSX.Element;
|
|
161
256
|
|
|
162
|
-
interface
|
|
163
|
-
|
|
257
|
+
interface ReactContentOptions {
|
|
258
|
+
Link?: React.ElementType;
|
|
259
|
+
components?: {
|
|
260
|
+
[component: string]: (props: any) => React.JSX.Element | null;
|
|
261
|
+
};
|
|
262
|
+
useLocation?: () => {
|
|
263
|
+
search: string;
|
|
264
|
+
};
|
|
265
|
+
useNavigate?: (to: any) => void;
|
|
266
|
+
useNavigation?: () => any;
|
|
164
267
|
}
|
|
165
|
-
declare
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
268
|
+
declare class ReactContent {
|
|
269
|
+
protected settings?: Settings | undefined;
|
|
270
|
+
protected options?: ReactContentOptions | undefined;
|
|
271
|
+
constructor(settings?: Settings | undefined, options?: ReactContentOptions | undefined);
|
|
272
|
+
components(): {
|
|
273
|
+
[component: string]: (props: any) => React.JSX.Element | null;
|
|
274
|
+
};
|
|
275
|
+
noop(): {
|
|
276
|
+
React: typeof NoopReactComponent;
|
|
277
|
+
Steps: typeof NoopComponent;
|
|
278
|
+
UnderlineNav: typeof NoopComponent;
|
|
279
|
+
Tabs: typeof NoopComponent;
|
|
280
|
+
GuideCard: typeof NoopComponent;
|
|
281
|
+
Table: typeof NoopComponent;
|
|
282
|
+
};
|
|
169
283
|
}
|
|
170
|
-
declare function
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
IconJSNode: typeof IconJSNode;
|
|
187
|
-
IconStorybook: typeof IconStorybook;
|
|
188
|
-
IconReactRouter: typeof IconReactRouter;
|
|
189
|
-
IconNextJS: typeof IconNextJS;
|
|
190
|
-
IconAppTemplate: typeof IconAppTemplate;
|
|
191
|
-
IconQuote: typeof IconQuote;
|
|
192
|
-
Content: typeof Content;
|
|
193
|
-
Subtitle: typeof Subtitle;
|
|
194
|
-
Callout: typeof Callout;
|
|
195
|
-
Details: typeof Details;
|
|
196
|
-
GuideCard: typeof GuideCard;
|
|
197
|
-
Steps: typeof Steps;
|
|
198
|
-
Tabs: typeof Tabs;
|
|
199
|
-
Table: typeof TableV2;
|
|
200
|
-
Badge: typeof Badge;
|
|
201
|
-
h1: (props: any) => React.JSX.Element;
|
|
202
|
-
h2: (props: any) => React.JSX.Element;
|
|
203
|
-
h3: (props: any) => React.JSX.Element;
|
|
204
|
-
h4: (props: any) => React.JSX.Element;
|
|
205
|
-
h5: (props: any) => React.JSX.Element;
|
|
206
|
-
h6: (props: any) => React.JSX.Element;
|
|
207
|
-
p: (props: any) => React.JSX.Element;
|
|
208
|
-
ul: (props: any) => React.JSX.Element;
|
|
209
|
-
ol: (props: any) => React.JSX.Element;
|
|
210
|
-
li: (props: any) => React.JSX.Element;
|
|
211
|
-
table: typeof TableV2;
|
|
212
|
-
tr: ({ children }: TableTrProps) => React.JSX.Element;
|
|
213
|
-
th: ({ children, numeric }: TableThProps) => React.JSX.Element;
|
|
214
|
-
td: (props: any) => React.JSX.Element;
|
|
215
|
-
code: typeof Code;
|
|
216
|
-
pre: (props: any) => React.JSX.Element;
|
|
217
|
-
details: typeof Details;
|
|
218
|
-
blockquote: typeof Blockquote;
|
|
219
|
-
hr: typeof Hr;
|
|
220
|
-
a: ({ href, className, ...props }: {
|
|
221
|
-
[x: string]: any;
|
|
222
|
-
href?: string | undefined;
|
|
223
|
-
className?: string | undefined;
|
|
224
|
-
}) => React.JSX.Element;
|
|
225
|
-
};
|
|
226
|
-
declare function stdContent(): {
|
|
284
|
+
declare function NoopComponent(): null;
|
|
285
|
+
declare namespace NoopComponent {
|
|
286
|
+
var Item: () => null;
|
|
287
|
+
var Content: () => null;
|
|
288
|
+
var List: () => null;
|
|
289
|
+
var Head: () => null;
|
|
290
|
+
var Td: () => null;
|
|
291
|
+
var Tr: () => null;
|
|
292
|
+
var Th: () => null;
|
|
293
|
+
var Cell: () => null;
|
|
294
|
+
}
|
|
295
|
+
declare function NoopReactComponent(): null;
|
|
296
|
+
declare namespace NoopReactComponent {
|
|
297
|
+
var Fragment: React.ExoticComponent<React.FragmentProps>;
|
|
298
|
+
}
|
|
299
|
+
declare function stdContent(this: ReactContent): {
|
|
227
300
|
h1: (props: any) => React.JSX.Element;
|
|
228
301
|
h2: (props: any) => React.JSX.Element;
|
|
229
302
|
h3: (props: any) => React.JSX.Element;
|
|
230
303
|
h4: (props: any) => React.JSX.Element;
|
|
231
304
|
h5: (props: any) => React.JSX.Element;
|
|
232
|
-
h6: (props: any) => React.JSX.Element;
|
|
233
305
|
p: (props: any) => React.JSX.Element;
|
|
234
306
|
ul: (props: any) => React.JSX.Element;
|
|
235
307
|
ol: (props: any) => React.JSX.Element;
|
|
236
308
|
li: (props: any) => React.JSX.Element;
|
|
237
|
-
table:
|
|
238
|
-
tr: (
|
|
239
|
-
th: (
|
|
309
|
+
table: (props: any) => React.JSX.Element;
|
|
310
|
+
tr: (props: any) => React.JSX.Element;
|
|
311
|
+
th: (props: any) => React.JSX.Element;
|
|
240
312
|
td: (props: any) => React.JSX.Element;
|
|
241
|
-
code:
|
|
242
|
-
pre:
|
|
243
|
-
details:
|
|
244
|
-
blockquote:
|
|
245
|
-
hr:
|
|
246
|
-
a: (
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}) => React.JSX.Element;
|
|
313
|
+
code: (props: any) => React.JSX.Element;
|
|
314
|
+
pre: any;
|
|
315
|
+
details: (props: any) => React.JSX.Element;
|
|
316
|
+
blockquote: (props: any) => React.JSX.Element;
|
|
317
|
+
hr: (props: any) => React.JSX.Element;
|
|
318
|
+
a: (props: any) => React.JSX.Element;
|
|
319
|
+
br: (props: any) => React.JSX.Element;
|
|
320
|
+
img: (props: any) => React.JSX.Element;
|
|
321
|
+
React: typeof NoopReactComponent;
|
|
251
322
|
};
|
|
252
323
|
declare function writerContent(): {
|
|
253
324
|
Callout: typeof Callout;
|
|
254
325
|
Details: typeof Details;
|
|
255
|
-
GuideCard:
|
|
326
|
+
GuideCard: any;
|
|
256
327
|
Steps: typeof Steps;
|
|
257
|
-
Tabs:
|
|
258
|
-
Table: typeof
|
|
328
|
+
Tabs: any;
|
|
329
|
+
Table: typeof Table;
|
|
259
330
|
Badge: typeof Badge;
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
Subtitle: typeof Subtitle;
|
|
331
|
+
Button: typeof Button;
|
|
332
|
+
UnderlineNav: any;
|
|
333
|
+
Subtitle(props: any): React.JSX.Element;
|
|
334
|
+
Update: typeof Update;
|
|
335
|
+
Card: any;
|
|
336
|
+
ColorSchemeButton: typeof ColorSchemeButton;
|
|
267
337
|
};
|
|
268
338
|
declare function iconContent(): {
|
|
269
|
-
|
|
270
|
-
IconMetrics: typeof IconMetrics;
|
|
271
|
-
IconFunnels: typeof IconFunnels;
|
|
272
|
-
IconCode: typeof IconCode;
|
|
273
|
-
IconCustomEvent: typeof IconCustomEvent;
|
|
274
|
-
IconAlert: typeof IconAlert;
|
|
275
|
-
IconBrowser: typeof IconBrowser;
|
|
276
|
-
IconREST: typeof IconREST;
|
|
277
|
-
IconGraphQL: typeof IconGraphQL;
|
|
278
|
-
IconWebhooks: typeof IconWebhooks;
|
|
279
|
-
IconJSBrowser: typeof IconJSBrowser;
|
|
280
|
-
IconJSNode: typeof IconJSNode;
|
|
281
|
-
IconStorybook: typeof IconStorybook;
|
|
282
|
-
IconReactRouter: typeof IconReactRouter;
|
|
283
|
-
IconNextJS: typeof IconNextJS;
|
|
284
|
-
IconAppTemplate: typeof IconAppTemplate;
|
|
285
|
-
IconQuote: typeof IconQuote;
|
|
339
|
+
Icon: typeof Icon;
|
|
286
340
|
};
|
|
287
341
|
declare function coderContent(): {
|
|
288
342
|
CodeSample: typeof CodeSample;
|
|
289
343
|
};
|
|
344
|
+
declare function directiveContent(this: ReactContent): {
|
|
345
|
+
DirectiveCodeGroup: (props: any) => React.JSX.Element;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
interface ContentDecoratorProps {
|
|
349
|
+
children: React.ReactNode;
|
|
350
|
+
metaComponent?: string;
|
|
351
|
+
}
|
|
352
|
+
declare function ContentDecorator({ children, metaComponent }: ContentDecoratorProps): React.JSX.Element;
|
|
290
353
|
|
|
291
|
-
export {
|
|
354
|
+
export { ContentDecorator, ReactContent, coderContent, directiveContent, iconContent, stdContent, writerContent };
|
package/dist/content.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e}from"./
|
|
1
|
+
import{c as n,_ as e,d as t,a as i,e as r}from"./_rollupPluginBabelHelpers-CiqSP2w-.js";import{a as o}from"./tslib.es6-DwnOrHRg.js";import l,{useRef as a,useState as c,useEffect as s,createContext as u,useContext as d,useMemo as v}from"react";import{T as h,L as m,a as f,G as p,B as g,S as b,A as j,b as E}from"./VideoGuide-CoQXlHjQ.js";import{I as O,H as w,B as C,D as y,C as k,a as L,U as S,b as I,c as T,d as x,e as N}from"./Update-D5e_yqty.js";import{I as U}from"./Icon-BoKcRZAF.js";import{T as A}from"./Text-QH4jjPUM.js";import{c as H}from"./CodeSample-GbqwRbcO.js";import"@code-hike/lighter";import"radix-ui";import"lucide-react";import"./coder/themes/cosmo-light.js";var R="g1wc20vm";function B(n){var e=n.children,t=n.cols;return l.createElement("xyd-grid-decorator",{className:R,"data-cols":t},e)}var G=function(){return n(function n(e,i){t(this,n),this.settings=e,this.options=i},[{key:"components",value:function(){var n,e=this,t=[F,z,Q,X,Y,Z].map(function(n){return n.bind(e)}).reduce(function(n,e){return Object.assign(Object.assign({},n),e())},{});return Object.assign(Object.assign({},t),(null===(n=this.options)||void 0===n?void 0:n.components)||{})}},{key:"noop",value:function(){var n,t=this.components(),i=[].concat(e(Object.keys(t)),e(Object.keys((null===(n=this.options)||void 0===n?void 0:n.components)||{}))).reduce(function(n,e){return n[e]=function(){return null},n},{}),r={Steps:V,UnderlineNav:V,Tabs:V,GuideCard:V,Table:V};return Object.assign(Object.assign(Object.assign({},i),r),{React:D})}}])}();function V(){return null}function D(){return null}function F(){var n=this,e=$.bind(this),t=P.bind(this);return{h1:function(n){return l.createElement(t,Object.assign({depth:1},n,{noanchor:!0}))},h2:function(n){return l.createElement(t,Object.assign({depth:2},n))},h3:function(n){return l.createElement(t,Object.assign({depth:3},n))},h4:function(n){return l.createElement(t,Object.assign({depth:4},n))},h5:function(n){return l.createElement(t,Object.assign({depth:5},n))},p:function(n){return l.createElement(A,Object.assign({},n))},ul:function(n){return l.createElement(m,Object.assign({},n),n.children)},ol:function(n){return l.createElement(f,Object.assign({},n),n.children)},li:function(n){return l.createElement(m.Item,Object.assign({},n),n.children)},table:function(n){return l.createElement(h,Object.assign({},n))},tr:function(n){return l.createElement(h.Tr,Object.assign({},n))},th:function(n){return l.createElement(h.Th,Object.assign({},n))},td:function(n){return l.createElement(h.Td,Object.assign({},n),l.createElement(h.Cell,null,n.children))},code:function(n){return l.createElement(k,Object.assign({},n))},pre:e,details:function(n){return l.createElement(y,Object.assign({},n))},blockquote:function(n){return l.createElement(C,Object.assign({},n))},hr:function(n){return l.createElement(w,Object.assign({},n))},a:function(e){var t;return l.createElement(en,Object.assign({},e,{as:null===(t=null==n?void 0:n.options)||void 0===t?void 0:t.Link}))},br:function(n){return l.createElement("br",null)},img:function(n){return l.createElement(O,Object.assign({},n))},React:D}}function P(n){var e,t=n.id,r=n.depth,o=n.children,u=n.label,d=n.subtitle,v=n.noanchor,h=n.style,m=null===(e=null==this?void 0:this.options)||void 0===e?void 0:e.useNavigation(),f=a(null),p=c(!1),g=i(p,2),b=g[0],j=g[1];function E(n){var e=window.location.hash==="#".concat(t);j(e)}return s(function(){window.addEventListener("replaceState",E);var n=window.location.hash==="#".concat(t);return j(n),n&&f.current&&"loading"!==(null==m?void 0:m.state)&&f.current.scrollIntoView(),function(){window.removeEventListener("replaceState",E)}},[]),l.createElement(x,{ref:f,id:t,size:r,active:b,onClick:function(){var n,e=new URL(window.location.href);e.hash=t,history.replaceState(null,"",e),null===(n=document.querySelector("#".concat(t)))||void 0===n||n.scrollIntoView()},label:u,subtitle:d,noanchor:v,style:h},o)}function z(){var n=W.bind(this);n.List=p.List;var e=_.bind(this);return e.Content=K.bind(this),e.Item=M.bind(this),e.Item.displayName="UnderlineNav.Item",{Callout:T,Details:y,GuideCard:n,Steps:b,Tabs:e,Table:h,Badge:I,Button:g,UnderlineNav:e,Subtitle:function(n){var e,t,i=null===(t=null===(e=null==n?void 0:n.children)||void 0===e?void 0:e.props)||void 0===t?void 0:t.children;return l.createElement(x,Object.assign({size:4,kind:"muted"},n),i)},Update:S,Card:q.bind(this),ColorSchemeButton:L}}function W(n){var e;return l.createElement(p,Object.assign({},n,{as:null===(e=null==this?void 0:this.options)||void 0===e?void 0:e.Link}))}function q(n){var e;return l.createElement(N,Object.assign({},n,{link:null===(e=null==this?void 0:this.options)||void 0===e?void 0:e.Link}))}V.Item=function(){return null},V.Content=function(){return null},V.List=function(){return null},V.Head=function(){return null},V.Td=function(){return null},V.Tr=function(){return null},V.Th=function(){return null},V.Cell=function(){return null},D.Fragment=l.Fragment;var J=u({value:"",onChange:function(n){}});function _(n){var e=c(n.value),t=i(e,2),r=t[0],o=t[1];return l.createElement(J,{value:{value:r,onChange:o}},l.createElement(E,Object.assign({},n,{value:r,onChange:function(n){o(n)}})))}function K(n){var e,t,i=d(J).onChange,r=null===(t=null===(e=null==this?void 0:this.options)||void 0===e?void 0:e.useLocation)||void 0===t?void 0:t.call(e),o=null==r?void 0:r.search,a=new URLSearchParams(o),c=new URLSearchParams(n.value),u=!0,v=!0;return c.forEach(function(n,e){var t=a.get(e);t!==n&&(u=!1),t||(v=!1)}),s(function(){u&&i(n.value)},[u]),v||(u=void 0),l.createElement(E.Content,Object.assign({},n,{defaultActive:u}))}function M(n){var e,t,i,r=d(J).onChange,o=null===(t=null===(e=null==this?void 0:this.options)||void 0===e?void 0:e.useLocation)||void 0===t?void 0:t.call(e),a=null==o?void 0:o.search,c=new URLSearchParams(a),u=new URLSearchParams(n.value),v=!0;return u.forEach(function(n,e){c.get(e)!==n&&(v=!1)}),s(function(){v&&r(n.value)},[v]),l.createElement(E.Item,Object.assign({},n,{as:null===(i=null==this?void 0:this.options)||void 0===i?void 0:i.Link,defaultActive:v}))}function Q(){return{Icon:U}}function X(){return{CodeSample:H}}function Y(){var n=this;return{DirectiveCodeGroup:function(e){var t,i,r;return l.createElement(H,Object.assign({},e,{theme:(null===(r=null===(i=null===(t=n.settings)||void 0===t?void 0:t.theme)||void 0===i?void 0:i.coder)||void 0===r?void 0:r.syntaxHighlight)||void 0,codeblocks:JSON.parse(e.codeblocks)}))}}}function Z(){return{GridDecorator:B}}function $(n){var e,t,i,r,o,a,c,s,u,d=void 0;if(n.highlighted)try{var h=JSON.parse(n.highlighted);h&&(d=h)}catch(n){console.error("Error parsing highlighted code",n)}var m,f=((null===(t=null===(e=null==n?void 0:n.children)||void 0===e?void 0:e.props)||void 0===t?void 0:t.className)||"").replace("language-",""),p=void 0;if(null==n?void 0:n.descriptionContent){var g=function(n){var e=tn(n);if(!tn)return{};return{component:null==e?void 0:e.default}}(null==n?void 0:n.descriptionContent);if(null==g?void 0:g.component){var b=(m=null==g?void 0:g.component,v(function(){return m||null},[m]));p=l.createElement(b,{components:this.components()})}}return l.createElement(H,{theme:(null===(o=null===(r=null===(i=this.settings)||void 0===i?void 0:i.theme)||void 0===r?void 0:r.coder)||void 0===o?void 0:o.syntaxHighlight)||void 0,name:f,description:null===(c=null===(a=null==n?void 0:n.children)||void 0===a?void 0:a.props)||void 0===c?void 0:c.meta,codeblocks:[{value:null===(u=null===(s=null==n?void 0:n.children)||void 0===s?void 0:s.props)||void 0===u?void 0:u.children,lang:f,meta:f,highlighted:d}],lineNumbers:null==n?void 0:n.lineNumbers,size:null==n?void 0:n.size,descriptionHead:null==n?void 0:n.descriptionHead,descriptionContent:p,descriptionIcon:null==n?void 0:n.descriptionIcon})}var nn=/https?:\/\//;function en(n){var e=n.href,t=void 0===e?"":e,i=n.as,r=n.newWindow,a=n.children,c=o(n,["href","as","newWindow","children"]),s=i||j;return l.createElement(s,Object.assign({href:t,newWindow:r||nn.test(t)},c),a)}function tn(n){var t={Fragment:l.Fragment,jsxs:rn,jsx:rn,jsxDEV:rn};return r(Function,e(Object.keys(t)).concat([n]))(t)}var rn=function(n,e){var t,i=function(n){return n.map(function(n,e){return l.isValidElement(n)&&!n.key?l.cloneElement(n,{key:"mdx-".concat(e)}):Array.isArray(n)?i(n):n})};return t=e&&e.children?Array.isArray(e.children)?i(e.children):l.isValidElement(e.children)&&!e.children.key?l.cloneElement(e.children,{key:"mdx-child"}):e.children:[],l.createElement(n,Object.assign(Object.assign({},e),{children:t}))},on="ca1c472";function ln(n){var e=n.children,t=n.metaComponent;return l.createElement("xyd-content-decorator",{className:on,"meta-component":t||void 0},e)}export{ln as ContentDecorator,G as ReactContent,X as coderContent,Y as directiveContent,Q as iconContent,F as stdContent,z as writerContent};
|
|
2
2
|
//# sourceMappingURL=content.js.map
|