@brillout/docpress 0.6.20 → 0.6.21-commit-74553e7

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.
Files changed (105) hide show
  1. package/+config.ts +26 -7
  2. package/MobileHeader.tsx +5 -3
  3. package/PageLayout.css +11 -11
  4. package/PageLayout.tsx +27 -20
  5. package/algolia/DocSearch.css +6 -9
  6. package/autoScrollNav.ts +4 -3
  7. package/components/FeatureList/FeatureList.client.ts +6 -11
  8. package/components/Link.tsx +9 -9
  9. package/config/getConfig.ts +2 -1
  10. package/config/resolveHeadingsData.ts +22 -30
  11. package/config/resolvePageContext.ts +4 -6
  12. package/dist/+config.d.ts +25 -8
  13. package/dist/+config.js +7 -7
  14. package/dist/components/CodeBlockTransformer.d.ts +7 -0
  15. package/dist/components/CodeBlockTransformer.js +9 -0
  16. package/dist/components/Comment.d.ts +5 -0
  17. package/dist/components/Comment.js +6 -0
  18. package/dist/components/Consulting.d.ts +4 -0
  19. package/dist/components/Consulting.js +39 -0
  20. package/dist/components/Contributors.d.ts +7 -0
  21. package/dist/components/Contributors.js +74 -0
  22. package/dist/components/FileRemoved.d.ts +9 -0
  23. package/dist/components/FileRemoved.js +28 -0
  24. package/dist/components/HorizontalLine.d.ts +5 -0
  25. package/dist/components/HorizontalLine.js +15 -0
  26. package/dist/components/ImportMeta.d.ts +5 -0
  27. package/dist/components/ImportMeta.js +10 -0
  28. package/dist/components/Link.d.ts +16 -0
  29. package/dist/components/Link.js +108 -0
  30. package/dist/components/Note.d.ts +22 -0
  31. package/dist/components/Note.js +93 -0
  32. package/dist/components/P.d.ts +4 -0
  33. package/dist/components/P.js +17 -0
  34. package/dist/components/ReadingRecommendation.d.ts +6 -0
  35. package/dist/components/ReadingRecommendation.js +40 -0
  36. package/dist/components/RepoLink.d.ts +9 -0
  37. package/dist/components/RepoLink.js +22 -0
  38. package/dist/components/Sponsors.d.ts +22 -0
  39. package/dist/components/Sponsors.js +161 -0
  40. package/dist/components/Supporters.d.ts +32 -0
  41. package/dist/components/Supporters.js +80 -0
  42. package/dist/components/index.d.ts +15 -0
  43. package/dist/components/index.js +15 -0
  44. package/dist/config/getConfig.d.ts +3 -0
  45. package/dist/config/getConfig.js +14 -0
  46. package/dist/config/resolveHeadingsData.d.ts +16 -0
  47. package/dist/config/resolveHeadingsData.js +223 -0
  48. package/dist/config/resolvePageContext.d.ts +38 -0
  49. package/dist/config/resolvePageContext.js +23 -0
  50. package/dist/data/maintainersList.d.ts +9 -0
  51. package/dist/data/maintainersList.js +83 -0
  52. package/dist/data/sponsorsList.d.ts +3 -0
  53. package/dist/data/sponsorsList.js +151 -0
  54. package/dist/navigation/Navigation.d.ts +20 -0
  55. package/dist/navigation/Navigation.js +127 -0
  56. package/dist/navigation/NavigationHeader.d.ts +4 -0
  57. package/dist/navigation/NavigationHeader.js +85 -0
  58. package/dist/navigation/navigation-fullscreen/NavigationFullscreenButton.d.ts +6 -0
  59. package/dist/navigation/navigation-fullscreen/NavigationFullscreenButton.js +22 -0
  60. package/dist/parsePageSections.js +2 -2
  61. package/dist/parseTitle.d.ts +5 -0
  62. package/dist/parseTitle.js +52 -0
  63. package/dist/renderer/usePageContext.d.ts +17 -0
  64. package/dist/renderer/usePageContext.js +26 -0
  65. package/dist/types/Config.d.ts +30 -0
  66. package/dist/types/Config.js +1 -0
  67. package/dist/types/Heading.d.ts +45 -0
  68. package/dist/types/Heading.js +1 -0
  69. package/dist/utils/Emoji/Emoji.d.ts +8 -0
  70. package/dist/utils/Emoji/Emoji.js +191 -0
  71. package/dist/utils/Emoji/assets.d.ts +6 -0
  72. package/dist/utils/Emoji/assets.js +7 -0
  73. package/dist/utils/Emoji/index.d.ts +1 -0
  74. package/dist/utils/Emoji/index.js +1 -0
  75. package/dist/utils/client.d.ts +2 -0
  76. package/dist/utils/client.js +2 -0
  77. package/dist/utils/filter.d.ts +2 -0
  78. package/dist/utils/filter.js +11 -0
  79. package/dist/utils/isBrowser.d.ts +2 -0
  80. package/dist/utils/isBrowser.js +4 -0
  81. package/dist/utils/jsxToTextContent.d.ts +2 -0
  82. package/dist/utils/jsxToTextContent.js +12 -0
  83. package/dist/utils/objectAssign.d.ts +2 -0
  84. package/dist/utils/objectAssign.js +5 -0
  85. package/dist/utils/server.d.ts +7 -0
  86. package/dist/utils/server.js +7 -0
  87. package/dist/vite.config.js +7 -2
  88. package/installSectionUrlHashs.ts +7 -6
  89. package/navigation/Navigation-layout.css +2 -2
  90. package/navigation/Navigation.tsx +9 -6
  91. package/navigation/NavigationHeader.tsx +33 -4
  92. package/navigation/initPressKit.ts +2 -1
  93. package/package.json +17 -13
  94. package/renderer/getPageElement.tsx +16 -0
  95. package/renderer/onBeforeRender.ts +12 -0
  96. package/renderer/onRenderClient.tsx +53 -0
  97. package/renderer/onRenderHtml.tsx +7 -22
  98. package/renderer/usePageContext.tsx +20 -0
  99. package/tsconfig.json +1 -1
  100. package/types/Config.ts +6 -20
  101. package/types/Heading.ts +4 -4
  102. package/vite.config.ts +7 -2
  103. package/algolia/DocSearch.ts +0 -62
  104. package/navigation/Navigation.client.ts +0 -7
  105. package/renderer/client.ts +0 -4
@@ -0,0 +1,39 @@
1
+ export { Consulting, Consultants };
2
+ import React from 'react';
3
+ import iconPeople from '../icons/people.svg';
4
+ import { usePageContext } from '../renderer/usePageContext';
5
+ import { SupporterSection, SectionDescription, CallToAction } from './Supporters';
6
+ import { Maintainer } from './Contributors';
7
+ import { maintainers } from '../data/maintainersList';
8
+ import { Link } from './Link';
9
+ var consultingPageHref = '/consulting';
10
+ function Consulting() {
11
+ var pageContext = usePageContext();
12
+ var projectInfo = pageContext.config.projectInfo;
13
+ var projectName = projectInfo.projectName;
14
+ return (React.createElement(SupporterSection, null,
15
+ React.createElement(CallToAction, { iconUrl: iconPeople, text: "Consulting", href: consultingPageHref }),
16
+ React.createElement("div", null),
17
+ React.createElement(SectionDescription, null,
18
+ "For questions and issues related to ",
19
+ projectName,
20
+ ", open a",
21
+ ' ',
22
+ React.createElement("a", { href: projectInfo.githubDiscussions || projectInfo.githubIssues }, "GitHub Discussion"),
23
+ ". For advanced help or help not directly related to ",
24
+ projectName,
25
+ ", the ",
26
+ projectName,
27
+ " team offers",
28
+ ' ',
29
+ React.createElement(Link, { href: consultingPageHref, noBreadcrumb: true }, "consulting"),
30
+ ".")));
31
+ }
32
+ function Consultants() {
33
+ return (React.createElement(SupporterSection, null,
34
+ React.createElement("div", { style: { display: 'flex', flexWrap: 'wrap', alignItems: 'end' } }, maintainers
35
+ .filter(function (maintainer) {
36
+ return !!maintainer.consultingUrl;
37
+ })
38
+ .map(function (maintainer, i) { return (React.createElement(Maintainer, { maintainer: maintainer, key: i })); }))));
39
+ }
@@ -0,0 +1,7 @@
1
+ export { Contributors, Maintainer };
2
+ import React from 'react';
3
+ import { maintainers } from '../data/maintainersList';
4
+ declare function Contributors(): React.JSX.Element;
5
+ declare function Maintainer({ maintainer }: {
6
+ maintainer: (typeof maintainers)[0];
7
+ }): React.JSX.Element;
@@ -0,0 +1,74 @@
1
+ export { Contributors, Maintainer };
2
+ import React from 'react';
3
+ import { usePageContext } from '../renderer/usePageContext';
4
+ import { Supporter, SupporterSection, SectionDescription, Individuals, SupporterImg } from './Supporters';
5
+ import { maintainers } from '../data/maintainersList';
6
+ import { contributors } from 'vike-contributors'; // sorted by number of contributions
7
+ function Contributors() {
8
+ var pageContext = usePageContext();
9
+ var projectInfo = pageContext.config.projectInfo;
10
+ return (React.createElement(SupporterSection, null,
11
+ React.createElement(SectionDescription, null,
12
+ projectInfo.projectName,
13
+ " is built and maintained by passionate contributors."),
14
+ React.createElement("div", { style: { display: 'flex', flexWrap: 'wrap', justifyContent: 'space-evenly', alignItems: 'end' } }, maintainers.map(function (maintainer, i) { return (React.createElement(Maintainer, { maintainer: maintainer, key: i })); })),
15
+ React.createElement(Individuals, null, contributors
16
+ .filter(function (contributor) {
17
+ return (!contributor.login.includes('[bot]') && !maintainers.map(function (m) { return m.username; }).includes(contributor.login));
18
+ })
19
+ .map(function (contributor, i) { return (React.createElement(Supporter, { username: contributor.login, avatarUrl: contributor.avatarUrl, key: i })); }))));
20
+ }
21
+ function Maintainer(_a) {
22
+ var maintainer = _a.maintainer;
23
+ var marginHeight = 20;
24
+ var marginWidth = 10;
25
+ var imgSize = 50;
26
+ var githubUrl = "https://github.com/".concat(maintainer.username);
27
+ return (React.createElement("div", { style: {
28
+ borderRadius: 7,
29
+ borderWidth: 1,
30
+ borderStyle: 'solid',
31
+ borderColor: '#e0e0e0',
32
+ overflow: 'hidden',
33
+ width: 430,
34
+ maxWidth: "calc(100vw - 2 * var(--main-view-padding) - 2 * ".concat(marginWidth, "px)"),
35
+ margin: "".concat(marginHeight, "px ").concat(marginWidth, "px"),
36
+ display: 'flex',
37
+ flexWrap: 'wrap',
38
+ padding: 20,
39
+ gap: 20,
40
+ textAlign: 'left',
41
+ } },
42
+ React.createElement("a", { href: githubUrl },
43
+ React.createElement("div", { style: { width: imgSize, height: imgSize, borderRadius: imgSize / 2, overflow: 'hidden' } },
44
+ React.createElement(SupporterImg, { username: maintainer.username, avatarUrl: getAvatarUrl(maintainer), imgAlt: maintainer.firstName, width: imgSize, height: imgSize }))),
45
+ React.createElement("div", null,
46
+ React.createElement("b", null, maintainer.firstName),
47
+ " \u00B7",
48
+ ' ',
49
+ React.createElement("a", { href: githubUrl },
50
+ React.createElement("i", { style: { fontSize: '.9em', color: '#505050' } }, maintainer.username)),
51
+ maintainer.consultingUrl ? (React.createElement(React.Fragment, null,
52
+ ' ',
53
+ "\u00B7",
54
+ ' ',
55
+ React.createElement("a", { href: maintainer.consultingUrl },
56
+ React.createElement("b", { style: {
57
+ fontSize: '.7em',
58
+ color: 'white',
59
+ backgroundColor: '#305090',
60
+ padding: '1px 5px 2px 5px',
61
+ verticalAlign: 'text-top',
62
+ borderRadius: 3,
63
+ } }, "consulting")))) : null,
64
+ React.createElement("ul", { style: { fontSize: '.8em', paddingLeft: 15, marginTop: 5, marginBottom: 0 } }, maintainer.roles.map(function (role, i) { return (React.createElement("li", { key: i }, role)); })))));
65
+ }
66
+ function getAvatarUrl(maintainer) {
67
+ for (var _i = 0, contributors_1 = contributors; _i < contributors_1.length; _i++) {
68
+ var contributor = contributors_1[_i];
69
+ if (maintainer.username === contributor.login) {
70
+ return contributor.avatarUrl;
71
+ }
72
+ }
73
+ throw new Error("Maintainer ".concat(maintainer.username, " not found in contributors' list."));
74
+ }
@@ -0,0 +1,9 @@
1
+ export { FileRemoved };
2
+ export { FileAdded };
3
+ import React from 'react';
4
+ declare function FileRemoved({ children }: {
5
+ children: React.ReactNode;
6
+ }): React.JSX.Element;
7
+ declare function FileAdded({ children }: {
8
+ children: React.ReactNode;
9
+ }): React.JSX.Element;
@@ -0,0 +1,28 @@
1
+ export { FileRemoved };
2
+ export { FileAdded };
3
+ import React from 'react';
4
+ // Styling defined in src/css/code/diff.css
5
+ var classRemoved = [
6
+ //
7
+ 'diff-entire-file',
8
+ 'diff-entire-file-removed',
9
+ ].join(' ');
10
+ var classAdded = [
11
+ //
12
+ 'diff-entire-file',
13
+ 'diff-entire-file-added',
14
+ ].join(' ');
15
+ function FileRemoved(_a) {
16
+ var children = _a.children;
17
+ return React.createElement("div", { className: classRemoved },
18
+ " ",
19
+ children,
20
+ " ");
21
+ }
22
+ function FileAdded(_a) {
23
+ var children = _a.children;
24
+ return React.createElement("div", { className: classAdded },
25
+ " ",
26
+ children,
27
+ " ");
28
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export { HorizontalLine };
3
+ declare function HorizontalLine({ primary }: {
4
+ primary?: true;
5
+ }): React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ export { HorizontalLine };
3
+ function HorizontalLine(_a) {
4
+ var primary = _a.primary;
5
+ return (React.createElement("div", { className: 'header-separator-line ' + (primary ? 'primary' : ''), style: { textAlign: 'center' } },
6
+ React.createElement("hr", { style: {
7
+ display: 'inline-block',
8
+ margin: 0,
9
+ border: 0,
10
+ // Same as `.doc-page h2::after`
11
+ borderTop: '1px solid #eaeaea',
12
+ maxWidth: 500,
13
+ width: '80%',
14
+ } })));
15
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export { ImportMeta };
3
+ declare function ImportMeta({ prop }: {
4
+ prop: string;
5
+ }): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { assert } from '../utils/server';
3
+ export { ImportMeta };
4
+ function ImportMeta(_a) {
5
+ var prop = _a.prop;
6
+ assert(!prop.startsWith('import'));
7
+ assert(!prop.startsWith('.'));
8
+ var text = 'imp' + 'ort.meta.' + prop;
9
+ return React.createElement("code", null, text);
10
+ }
@@ -0,0 +1,16 @@
1
+ export { Link };
2
+ export type { LinkData };
3
+ import React from 'react';
4
+ declare function Link({ href, text, noBreadcrumb, doNotInferSectionTitle, children, }: {
5
+ href: string;
6
+ text?: string | JSX.Element;
7
+ noBreadcrumb?: true;
8
+ doNotInferSectionTitle?: true;
9
+ children?: React.ReactNode;
10
+ }): React.JSX.Element;
11
+ type LinkData = {
12
+ url?: null | string;
13
+ title: string;
14
+ linkBreadcrumb: null | string[];
15
+ sectionTitles?: string[];
16
+ };
@@ -0,0 +1,108 @@
1
+ export { Link };
2
+ import React from 'react';
3
+ import { isRepoLink, RepoLink } from './RepoLink';
4
+ import { usePageContext } from '../renderer/usePageContext';
5
+ import { assert, assertUsage, determineSectionTitle, determineSectionUrlHash } from '../utils/server';
6
+ import { parseTitle } from '../parseTitle';
7
+ import pc from '@brillout/picocolors';
8
+ function Link(_a) {
9
+ var href = _a.href, text = _a.text, noBreadcrumb = _a.noBreadcrumb, doNotInferSectionTitle = _a.doNotInferSectionTitle, children = _a.children;
10
+ assertUsage(href.startsWith('/') || href.startsWith('#'), "<Link href /> prop `href==='".concat(href, "'` but should start with '/' or '#'"));
11
+ assertUsage(!text || !children, 'Cannot use both `text` or `children`');
12
+ if (isRepoLink(href)) {
13
+ return React.createElement(RepoLink, { path: href, text: text });
14
+ }
15
+ else {
16
+ var pageContext = usePageContext();
17
+ return (React.createElement("a", { href: href }, children || text || getLinkText({ href: href, noBreadcrumb: noBreadcrumb, pageContext: pageContext, doNotInferSectionTitle: doNotInferSectionTitle })));
18
+ }
19
+ }
20
+ function getLinkText(_a) {
21
+ var _b;
22
+ var href = _a.href, noBreadcrumb = _a.noBreadcrumb, pageContext = _a.pageContext, doNotInferSectionTitle = _a.doNotInferSectionTitle;
23
+ var _c = parseHref(href), hrefPathname = _c.hrefPathname, hrefHash = _c.hrefHash;
24
+ var linkData = findLinkData(hrefPathname || pageContext.urlPathname, pageContext);
25
+ var isLinkOnSamePage = linkData.url === pageContext.urlPathname;
26
+ if (!hrefPathname)
27
+ assert(isLinkOnSamePage);
28
+ var breadcrumbParts = [];
29
+ if (linkData.linkBreadcrumb) {
30
+ breadcrumbParts.push.apply(breadcrumbParts, ((_b = linkData.linkBreadcrumb) !== null && _b !== void 0 ? _b : []).slice().reverse().map(parseTitle));
31
+ }
32
+ breadcrumbParts.push(parseTitle(linkData.title));
33
+ if (hrefHash) {
34
+ var sectionTitle_1 = undefined;
35
+ assert(!hrefHash.startsWith('#'));
36
+ if (isLinkOnSamePage) {
37
+ var linkDataPageSection = findLinkData("#".concat(hrefHash), pageContext);
38
+ sectionTitle_1 = parseTitle(linkDataPageSection.title);
39
+ }
40
+ else if ('sectionTitles' in linkData && linkData.sectionTitles) {
41
+ linkData.sectionTitles.forEach(function (title) {
42
+ if (determineSectionUrlHash(title) === hrefHash) {
43
+ sectionTitle_1 = parseTitle(title);
44
+ }
45
+ });
46
+ }
47
+ if (!sectionTitle_1) {
48
+ assertUsage(!doNotInferSectionTitle, "Page section title not found for <Link href=\"`".concat(href, "`\" doNotInferSectionTitle={true} />."));
49
+ sectionTitle_1 = React.createElement(React.Fragment, null, determineSectionTitle(href));
50
+ }
51
+ breadcrumbParts.push(sectionTitle_1);
52
+ }
53
+ {
54
+ if (noBreadcrumb || isLinkOnSamePage) {
55
+ return breadcrumbParts[breadcrumbParts.length - 1];
56
+ }
57
+ }
58
+ return (React.createElement(React.Fragment, null, breadcrumbParts.map(function (title, i) {
59
+ var seperator = i === 0 ? React.createElement(React.Fragment, null) : ' > ';
60
+ return (React.createElement(React.Fragment, { key: i },
61
+ seperator,
62
+ title));
63
+ })));
64
+ }
65
+ function findLinkData(href, pageContext) {
66
+ assert(href.startsWith('/') || href.startsWith('#'));
67
+ var linksAll = pageContext.linksAll;
68
+ var linkData = linksAll.find(function (_a) {
69
+ var url = _a.url;
70
+ return href === url;
71
+ });
72
+ if (href.startsWith('#')) {
73
+ assertUsage(linkData, "Couldn't find ".concat(href, " in ").concat(pageContext.urlPathname, ", does it exist?"));
74
+ }
75
+ else {
76
+ assertUsage(linkData, [
77
+ "Couldn't find page with URL ".concat(pc.bold(href)),
78
+ "\u2014 did you define it in",
79
+ [
80
+ pc.cyan('docpress.config.js'),
81
+ pc.dim('#{'),
82
+ pc.cyan('headings'),
83
+ pc.dim(','),
84
+ pc.cyan('headingsDetached'),
85
+ pc.dim('}'),
86
+ '?',
87
+ ].join(''),
88
+ ].join(' '));
89
+ }
90
+ return linkData;
91
+ }
92
+ function parseHref(href) {
93
+ var hrefHash = null;
94
+ var hrefPathname = null;
95
+ if (!href.includes('#')) {
96
+ hrefPathname = href;
97
+ }
98
+ else {
99
+ var _a = href.split('#'), partsFirst = _a[0], partsRest = _a.slice(1);
100
+ if (partsFirst) {
101
+ hrefPathname = partsFirst;
102
+ }
103
+ hrefHash = partsRest.join('#');
104
+ }
105
+ assert(hrefPathname !== null || hrefHash !== null);
106
+ assert(hrefPathname || hrefHash);
107
+ return { hrefPathname: hrefPathname, hrefHash: hrefHash };
108
+ }
@@ -0,0 +1,22 @@
1
+ export { Warning };
2
+ export { Advanced };
3
+ export { Construction };
4
+ export { Contribution };
5
+ export { Danger };
6
+ export { NoteWithoutIcon };
7
+ export { NoteWithCustomIcon };
8
+ import React from 'react';
9
+ type Props = {
10
+ children: React.ReactNode;
11
+ style?: React.CSSProperties;
12
+ };
13
+ declare function Warning(props: Props): React.JSX.Element;
14
+ declare function Advanced(props: Props): React.JSX.Element;
15
+ declare function Construction(props: Props): React.JSX.Element;
16
+ declare function Contribution(props: Props): React.JSX.Element;
17
+ declare function Danger(props: Props): React.JSX.Element;
18
+ declare function NoteWithoutIcon(props: Props): React.JSX.Element;
19
+ type CustomIcon = JSX.Element | string;
20
+ declare function NoteWithCustomIcon(props: Props & {
21
+ icon: CustomIcon;
22
+ }): React.JSX.Element;
@@ -0,0 +1,93 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ export { Warning };
13
+ export { Advanced };
14
+ export { Construction };
15
+ export { Contribution };
16
+ export { Danger };
17
+ export { NoteWithoutIcon };
18
+ export { NoteWithCustomIcon };
19
+ /* Use markdown instead:
20
+ * ```diff
21
+ * - <Note>Some note</Note>
22
+ * + > Some note
23
+ * ```
24
+ export { Note }
25
+ */
26
+ import React from 'react';
27
+ import { assert } from '../utils/assert';
28
+ function Warning(props) {
29
+ return React.createElement(NoteGeneric, __assign({ type: "warning" }, props));
30
+ }
31
+ function Advanced(props) {
32
+ return React.createElement(NoteGeneric, __assign({ type: "advanced" }, props));
33
+ }
34
+ function Construction(props) {
35
+ return React.createElement(NoteGeneric, __assign({ type: "construction" }, props));
36
+ }
37
+ function Contribution(props) {
38
+ return React.createElement(NoteGeneric, __assign({ type: "contribution" }, props));
39
+ }
40
+ function Danger(props) {
41
+ return React.createElement(NoteGeneric, __assign({ type: "danger" }, props));
42
+ }
43
+ function NoteWithoutIcon(props) {
44
+ return React.createElement(NoteGeneric, __assign({ icon: null }, props));
45
+ }
46
+ function NoteWithCustomIcon(props) {
47
+ var icon = props.icon;
48
+ if (!icon)
49
+ throw new Error("<NoteWithCustomIcon icon={/*...*/}> property 'icon' is `".concat(icon, "` which is forbidden"));
50
+ return React.createElement(NoteGeneric, __assign({}, props));
51
+ }
52
+ function NoteGeneric(_a) {
53
+ var type = _a.type, icon = _a.icon, iconMargin = _a.iconMargin, children = _a.children, style = _a.style;
54
+ assert(icon === null || icon || type, { icon: icon, type: type });
55
+ iconMargin !== null && iconMargin !== void 0 ? iconMargin : (iconMargin = 2);
56
+ var className = 'custom-icon';
57
+ if (type) {
58
+ className = "".concat(className, " type-").concat(type);
59
+ }
60
+ if (!icon && type) {
61
+ var classColor = '';
62
+ if (type === 'danger') {
63
+ icon = '⛔';
64
+ classColor = 'note-color-red';
65
+ }
66
+ if (type === 'warning') {
67
+ icon = '⚠️';
68
+ classColor = 'note-color-yellow';
69
+ }
70
+ if (type === 'construction') {
71
+ icon = '🚧';
72
+ classColor = 'note-color-yellow';
73
+ }
74
+ if (type === 'contribution') {
75
+ icon = '💚';
76
+ classColor = 'note-color-green';
77
+ }
78
+ if (type === 'advanced') {
79
+ icon = '🧠';
80
+ classColor = 'note-color-pink';
81
+ }
82
+ assert(icon);
83
+ assert(classColor);
84
+ className = "".concat(className, " ").concat(classColor);
85
+ }
86
+ return (React.createElement("blockquote", { className: className, style: style },
87
+ React.createElement("div", { style: { marginBottom: 20 } }),
88
+ React.createElement("span", { style: { fontFamily: 'emoji' } }, icon),
89
+ React.createElement("span", { style: { width: iconMargin !== null && iconMargin !== void 0 ? iconMargin : undefined, display: 'inline-block' } }),
90
+ ' ',
91
+ React.createElement("div", { className: "blockquote-content" }, children),
92
+ React.createElement("div", { style: { marginTop: 20 } })));
93
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './P.css';
3
+ export { P };
4
+ declare function P(props: React.HTMLProps<HTMLDivElement>): React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import React from 'react';
13
+ import './P.css';
14
+ export { P };
15
+ function P(props) {
16
+ return React.createElement("div", __assign({}, props, { className: 'paragraph' }));
17
+ }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export { ReadingRecommendation };
3
+ declare function ReadingRecommendation({ tour, links }: {
4
+ tour?: true;
5
+ links?: string[];
6
+ }): React.JSX.Element;
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { Link } from './Link';
3
+ export { ReadingRecommendation };
4
+ // TODO/eventually: remove
5
+ function ReadingRecommendation(_a) {
6
+ var tour = _a.tour, links = _a.links;
7
+ links !== null && links !== void 0 ? links : (links = []);
8
+ if (!links.length)
9
+ tour = true;
10
+ var multiple = links.length + (tour ? 1 : 0) > 1;
11
+ var intro = React.createElement("b", null,
12
+ "Reading Recommendation",
13
+ multiple ? '.' : ': ');
14
+ return (React.createElement("blockquote", null, (function () {
15
+ if (!multiple) {
16
+ var link = tour ? React.createElement(TourLink, null) : React.createElement(Link, { href: links[0] });
17
+ return (React.createElement("p", null,
18
+ intro,
19
+ link));
20
+ }
21
+ return (React.createElement(React.Fragment, null,
22
+ React.createElement("p", null,
23
+ " ",
24
+ intro),
25
+ React.createElement("ul", { style: {
26
+ marginLeft: 18,
27
+ marginTop: 11,
28
+ } },
29
+ tour && (React.createElement("li", null,
30
+ React.createElement(TourLink, null))),
31
+ links.map(function (link, i) { return (React.createElement("li", { key: i },
32
+ React.createElement(Link, { href: link }))); }))));
33
+ })()));
34
+ }
35
+ function TourLink() {
36
+ return (React.createElement(React.Fragment, null,
37
+ React.createElement(Link, { href: '/react-tour', noBreadcrumb: true }),
38
+ " or ",
39
+ React.createElement(Link, { href: '/vue-tour', noBreadcrumb: true })));
40
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export { RepoLink };
3
+ export { isRepoLink };
4
+ declare function isRepoLink(href: string): boolean;
5
+ declare function RepoLink({ path, text, editMode }: {
6
+ path: string;
7
+ text?: string | JSX.Element;
8
+ editMode?: true;
9
+ }): React.JSX.Element;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { assert } from '../utils/server';
3
+ import { usePageContext } from '../renderer/usePageContext';
4
+ export { RepoLink };
5
+ export { isRepoLink };
6
+ function isRepoLink(href) {
7
+ return ['/examples/', '/docs/', '/boilerplates/', '.github/', '/test/'].some(function (start) { return href.startsWith(start); });
8
+ }
9
+ function RepoLink(_a) {
10
+ var path = _a.path, text = _a.text, editMode = _a.editMode;
11
+ var pageContext = usePageContext();
12
+ assert(isRepoLink(path), { path: path });
13
+ text = text || path;
14
+ if (!path.startsWith('/')) {
15
+ path = '/' + path;
16
+ }
17
+ var viewMode = path.endsWith('/') || editMode ? 'tree' : 'blob';
18
+ var githubRepository = pageContext.config.projectInfo.githubRepository;
19
+ assert(githubRepository.startsWith('https://github.com/'));
20
+ var href = "".concat(githubRepository, "/").concat(viewMode, "/main").concat(path);
21
+ return React.createElement("a", { href: href }, text);
22
+ }
@@ -0,0 +1,22 @@
1
+ export { Sponsors };
2
+ export type { Sponsor };
3
+ import React from 'react';
4
+ type Plan = 'indie' | 'bronze' | 'silver' | 'gold' | 'platinum';
5
+ type SponsorCompany = {
6
+ companyName: string;
7
+ companyLogo: string;
8
+ website: string;
9
+ plan: Plan;
10
+ divSize?: Partial<DivSize>;
11
+ github: string;
12
+ };
13
+ type SponsorIndividual = {
14
+ username: string;
15
+ };
16
+ type Sponsor = SponsorCompany | SponsorIndividual;
17
+ type DivSize = {
18
+ width: number;
19
+ height: number;
20
+ padding: number;
21
+ };
22
+ declare function Sponsors(): React.JSX.Element;