@brillout/docpress 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-C3OIVLKV.js +75 -0
- package/dist/{chunk-OEVBWUR6.js.map → chunk-C3OIVLKV.js.map} +1 -1
- package/dist/{chunk-JS5BGVDK.js → chunk-H5CO4N2X.js} +3 -7
- package/dist/{chunk-JS5BGVDK.js.map → chunk-H5CO4N2X.js.map} +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/components/features/FeatureList.d.ts +1 -1
- package/dist/components/features/FeatureList.js +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +121 -145
- package/dist/index.js.map +1 -1
- package/dist/renderer/_default.page.client.css +1 -0
- package/dist/renderer/_default.page.client.css.map +1 -1
- package/dist/renderer/_default.page.server.d.ts +4 -4
- package/dist/renderer/_default.page.server.js +216 -227
- package/dist/renderer/_default.page.server.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-OEVBWUR6.js +0 -92
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// src/components/features/FeatureList.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
// src/components/features/chevron.svg
|
|
5
|
+
var chevron_default = "/assets/chevron-R2IYJD62.svg";
|
|
6
|
+
|
|
7
|
+
// src/components/features/FeatureList.tsx
|
|
8
|
+
function FeatureList({ features }) {
|
|
9
|
+
const numberOfFeatures = features.length;
|
|
10
|
+
const numberOfRows = Math.ceil(numberOfFeatures / 2);
|
|
11
|
+
return /* @__PURE__ */ React.createElement("div", { id: "features" }, Array.from({ length: numberOfRows }, (_, i) => {
|
|
12
|
+
const feature1Id = 2 * i + 0;
|
|
13
|
+
const feature2Id = 2 * i + 1;
|
|
14
|
+
const feature1 = features[feature1Id];
|
|
15
|
+
const feature2 = features[feature2Id];
|
|
16
|
+
const className = ["features-row", feature2 ? "" : "single-column"].filter(Boolean).join(" ");
|
|
17
|
+
return /* @__PURE__ */ React.createElement("div", { className, key: i }, /* @__PURE__ */ React.createElement(Feature, { ...{ ...feature1, featureId: feature1Id } }), feature2 && /* @__PURE__ */ React.createElement(Feature, { ...{ ...feature2, featureId: feature2Id } }));
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
function Feature({ title, desc, learnMore, isSecondaryFeature, featureId }) {
|
|
21
|
+
const name = `feature-${featureId}`;
|
|
22
|
+
const rightSide = featureId % 2 === 1;
|
|
23
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(FeatureHead, { name, hasLearnMore: !!learnMore, isSecondaryFeature }, " ", /* @__PURE__ */ React.createElement("h2", null, title), desc), !!learnMore && /* @__PURE__ */ React.createElement(LearnMore, { name, rightSide }, learnMore));
|
|
24
|
+
}
|
|
25
|
+
function FeatureHead({
|
|
26
|
+
children,
|
|
27
|
+
name,
|
|
28
|
+
hasLearnMore,
|
|
29
|
+
isSecondaryFeature,
|
|
30
|
+
className = ""
|
|
31
|
+
}) {
|
|
32
|
+
return /* @__PURE__ */ React.createElement(
|
|
33
|
+
"summary",
|
|
34
|
+
{
|
|
35
|
+
className: [
|
|
36
|
+
className,
|
|
37
|
+
"feature",
|
|
38
|
+
"colorize-on-hover",
|
|
39
|
+
hasLearnMore && "has-learn-more",
|
|
40
|
+
isSecondaryFeature && "secondary-feature"
|
|
41
|
+
].filter(Boolean).join(" "),
|
|
42
|
+
id: name && `feature-${name}`,
|
|
43
|
+
style: { cursor: hasLearnMore && "pointer" || void 0 }
|
|
44
|
+
},
|
|
45
|
+
children,
|
|
46
|
+
hasLearnMore && /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center", marginTop: "1em" } }, /* @__PURE__ */ React.createElement(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
type: "button",
|
|
50
|
+
style: {
|
|
51
|
+
textAlign: "center",
|
|
52
|
+
padding: "0 7px",
|
|
53
|
+
paddingTop: 3,
|
|
54
|
+
paddingBottom: 1,
|
|
55
|
+
display: "inline-block",
|
|
56
|
+
fontSize: "10px",
|
|
57
|
+
textTransform: "uppercase",
|
|
58
|
+
letterSpacing: "1px",
|
|
59
|
+
fontWeight: 600
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
/* @__PURE__ */ React.createElement("span", { className: "decolorize-5" }, "Learn more"),
|
|
63
|
+
/* @__PURE__ */ React.createElement("br", null),
|
|
64
|
+
/* @__PURE__ */ React.createElement("img", { className: "decolorize-4 chevron", src: chevron_default, height: "7", style: { marginTop: 2 } })
|
|
65
|
+
))
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function LearnMore({ children, name, rightSide }) {
|
|
69
|
+
return /* @__PURE__ */ React.createElement("aside", { className: "learn-more " + (rightSide ? "right-side" : ""), id: `learn-more-${name}` }, children);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
FeatureList
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=chunk-C3OIVLKV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/features/FeatureList.tsx"],"sourcesContent":["import React from 'react'\nimport './FeatureList.css'\nimport iconChevron from './chevron.svg'\n\nexport { FeatureList }\n\ntype FeatureProps = {\n title: React.ReactNode\n desc: React.ReactNode\n learnMore?: React.ReactNode\n isSecondaryFeature?: true\n}\n\nfunction FeatureList({ features }: { features: FeatureProps[] }) {\n const numberOfFeatures = features.length\n const numberOfRows = Math.ceil(numberOfFeatures / 2)\n return (\n <div id=\"features\">\n {Array.from({ length: numberOfRows }, (_, i) => {\n const feature1Id = 2 * i + 0\n const feature2Id = 2 * i + 1\n const feature1 = features[feature1Id]\n const feature2 = features[feature2Id]\n const className = ['features-row', feature2 ? '' : 'single-column'].filter(Boolean).join(' ')\n return (\n <div className={className} key={i}>\n <Feature {...{ ...feature1, featureId: feature1Id }} />\n {feature2 && <Feature {...{ ...feature2, featureId: feature2Id }} />}\n </div>\n )\n })}\n </div>\n )\n}\n\nfunction Feature({ title, desc, learnMore, isSecondaryFeature, featureId }: FeatureProps & { featureId: number }) {\n const name = `feature-${featureId}`\n const rightSide = featureId % 2 === 1\n return (\n <>\n <FeatureHead name={name} hasLearnMore={!!learnMore} isSecondaryFeature={isSecondaryFeature}>\n {' '}\n <h2>{title}</h2>\n {desc}\n </FeatureHead>\n {!!learnMore && (\n <LearnMore name={name} rightSide={rightSide}>\n {learnMore}\n </LearnMore>\n )}\n </>\n )\n}\n\nfunction FeatureHead({\n children,\n name,\n hasLearnMore,\n isSecondaryFeature,\n className = ''\n}: {\n className?: string\n name?: string\n hasLearnMore?: boolean\n isSecondaryFeature?: true\n children: any\n}) {\n return (\n <summary\n className={[\n className,\n 'feature',\n 'colorize-on-hover',\n hasLearnMore && 'has-learn-more',\n isSecondaryFeature && 'secondary-feature'\n ]\n .filter(Boolean)\n .join(' ')}\n id={name && `feature-${name}`}\n style={{ cursor: (hasLearnMore && 'pointer') || undefined }}\n >\n {children}\n {hasLearnMore && (\n <div style={{ textAlign: 'center', marginTop: '1em' }}>\n <button\n type=\"button\"\n style={{\n textAlign: 'center',\n padding: '0 7px',\n paddingTop: 3,\n paddingBottom: 1,\n display: 'inline-block',\n fontSize: '10px',\n textTransform: 'uppercase',\n letterSpacing: '1px',\n fontWeight: 600\n }}\n >\n <span className=\"decolorize-5\">Learn more</span>\n <br />\n <img className=\"decolorize-4 chevron\" src={iconChevron} height=\"7\" style={{ marginTop: 2 }} />\n </button>\n </div>\n )}\n </summary>\n )\n}\nfunction LearnMore({ children, name, rightSide }: { name: string; children: any; rightSide: boolean }) {\n return (\n <aside className={'learn-more ' + (rightSide ? 'right-side' : '')} id={`learn-more-${name}`}>\n {children}\n </aside>\n )\n}\n"],"mappings":";AAAA,OAAO,WAAW;;;;;;AAalB,SAAS,YAAY,EAAE,SAAS,GAAiC;AAC/D,QAAM,mBAAmB,SAAS;AAClC,QAAM,eAAe,KAAK,KAAK,mBAAmB,CAAC;AACnD,SACE,oCAAC
|
|
1
|
+
{"version":3,"sources":["../src/components/features/FeatureList.tsx"],"sourcesContent":["import React from 'react'\nimport './FeatureList.css'\nimport iconChevron from './chevron.svg'\n\nexport { FeatureList }\n\ntype FeatureProps = {\n title: React.ReactNode\n desc: React.ReactNode\n learnMore?: React.ReactNode\n isSecondaryFeature?: true\n}\n\nfunction FeatureList({ features }: { features: FeatureProps[] }) {\n const numberOfFeatures = features.length\n const numberOfRows = Math.ceil(numberOfFeatures / 2)\n return (\n <div id=\"features\">\n {Array.from({ length: numberOfRows }, (_, i) => {\n const feature1Id = 2 * i + 0\n const feature2Id = 2 * i + 1\n const feature1 = features[feature1Id]\n const feature2 = features[feature2Id]\n const className = ['features-row', feature2 ? '' : 'single-column'].filter(Boolean).join(' ')\n return (\n <div className={className} key={i}>\n <Feature {...{ ...feature1, featureId: feature1Id }} />\n {feature2 && <Feature {...{ ...feature2, featureId: feature2Id }} />}\n </div>\n )\n })}\n </div>\n )\n}\n\nfunction Feature({ title, desc, learnMore, isSecondaryFeature, featureId }: FeatureProps & { featureId: number }) {\n const name = `feature-${featureId}`\n const rightSide = featureId % 2 === 1\n return (\n <>\n <FeatureHead name={name} hasLearnMore={!!learnMore} isSecondaryFeature={isSecondaryFeature}>\n {' '}\n <h2>{title}</h2>\n {desc}\n </FeatureHead>\n {!!learnMore && (\n <LearnMore name={name} rightSide={rightSide}>\n {learnMore}\n </LearnMore>\n )}\n </>\n )\n}\n\nfunction FeatureHead({\n children,\n name,\n hasLearnMore,\n isSecondaryFeature,\n className = ''\n}: {\n className?: string\n name?: string\n hasLearnMore?: boolean\n isSecondaryFeature?: true\n children: any\n}) {\n return (\n <summary\n className={[\n className,\n 'feature',\n 'colorize-on-hover',\n hasLearnMore && 'has-learn-more',\n isSecondaryFeature && 'secondary-feature'\n ]\n .filter(Boolean)\n .join(' ')}\n id={name && `feature-${name}`}\n style={{ cursor: (hasLearnMore && 'pointer') || undefined }}\n >\n {children}\n {hasLearnMore && (\n <div style={{ textAlign: 'center', marginTop: '1em' }}>\n <button\n type=\"button\"\n style={{\n textAlign: 'center',\n padding: '0 7px',\n paddingTop: 3,\n paddingBottom: 1,\n display: 'inline-block',\n fontSize: '10px',\n textTransform: 'uppercase',\n letterSpacing: '1px',\n fontWeight: 600\n }}\n >\n <span className=\"decolorize-5\">Learn more</span>\n <br />\n <img className=\"decolorize-4 chevron\" src={iconChevron} height=\"7\" style={{ marginTop: 2 }} />\n </button>\n </div>\n )}\n </summary>\n )\n}\nfunction LearnMore({ children, name, rightSide }: { name: string; children: any; rightSide: boolean }) {\n return (\n <aside className={'learn-more ' + (rightSide ? 'right-side' : '')} id={`learn-more-${name}`}>\n {children}\n </aside>\n )\n}\n"],"mappings":";AAAA,OAAO,WAAW;;;;;;AAalB,SAAS,YAAY,EAAE,SAAS,GAAiC;AAC/D,QAAM,mBAAmB,SAAS;AAClC,QAAM,eAAe,KAAK,KAAK,mBAAmB,CAAC;AACnD,SACE,oCAAC,SAAI,IAAG,cACL,MAAM,KAAK,EAAE,QAAQ,aAAa,GAAG,CAAC,GAAG,MAAM;AAC9C,UAAM,aAAa,IAAI,IAAI;AAC3B,UAAM,aAAa,IAAI,IAAI;AAC3B,UAAM,WAAW,SAAS;AAC1B,UAAM,WAAW,SAAS;AAC1B,UAAM,YAAY,CAAC,gBAAgB,WAAW,KAAK,eAAe,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAC5F,WACE,oCAAC,SAAI,WAAsB,KAAK,KAC9B,oCAAC,WAAS,GAAG,EAAE,GAAG,UAAU,WAAW,WAAW,GAAG,GACpD,YAAY,oCAAC,WAAS,GAAG,EAAE,GAAG,UAAU,WAAW,WAAW,GAAG,CACpE;AAAA,EAEJ,CAAC,CACH;AAEJ;AAEA,SAAS,QAAQ,EAAE,OAAO,MAAM,WAAW,oBAAoB,UAAU,GAAyC;AAChH,QAAM,OAAO,WAAW;AACxB,QAAM,YAAY,YAAY,MAAM;AACpC,SACE,0DACE,oCAAC,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|
-
return /* @__PURE__ */ React.createElement(Context.Provider, {
|
|
19
|
-
value: pageContext
|
|
20
|
-
}, children);
|
|
18
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, { value: pageContext }, children);
|
|
21
19
|
}
|
|
22
20
|
function usePageContext() {
|
|
23
21
|
const pageContext = useContext(Context);
|
|
@@ -39,9 +37,7 @@ function RepoLink({ path, text, editMode }) {
|
|
|
39
37
|
const { githubRepository } = pageContext.config.projectInfo;
|
|
40
38
|
assert(githubRepository.startsWith("https://github.com/"));
|
|
41
39
|
const href = `${githubRepository}/${viewMode}/main${path}`;
|
|
42
|
-
return /* @__PURE__ */ React2.createElement("a", {
|
|
43
|
-
href
|
|
44
|
-
}, text);
|
|
40
|
+
return /* @__PURE__ */ React2.createElement("a", { href }, text);
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
// src/headings.ts
|
|
@@ -175,4 +171,4 @@ export {
|
|
|
175
171
|
getHeadings,
|
|
176
172
|
parseTitle
|
|
177
173
|
};
|
|
178
|
-
//# sourceMappingURL=chunk-
|
|
174
|
+
//# sourceMappingURL=chunk-H5CO4N2X.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/RepoLink.tsx","../src/renderer/usePageContext.tsx","../src/headings.ts"],"sourcesContent":["import React from 'react'\nimport { assert } from '../utils/server'\nimport { usePageContext } from '../renderer/usePageContext'\n\nexport { RepoLink }\nexport { isRepoLink }\n\nfunction isRepoLink(href: string) {\n return ['/examples/', '/docs/', '/boilerplates/', '.github/', '/test/'].some((start) => href.startsWith(start))\n}\n\nfunction RepoLink({ path, text, editMode }: { path: string; text?: string | JSX.Element; editMode?: true }) {\n const pageContext = usePageContext()\n assert(isRepoLink(path), { path })\n text = text || path\n if (!path.startsWith('/')) {\n path = '/' + path\n }\n const viewMode = (editMode && 'edit') || (path.endsWith('/') && 'tree') || 'blob'\n const { githubRepository } = pageContext.config.projectInfo\n assert(githubRepository.startsWith('https://github.com/'))\n const href = `${githubRepository}/${viewMode}/main${path}`\n return <a href={href}>{text}</a>\n}\n","// `usePageContext` allows us to access `pageContext` in any React component.\n// More infos: https://vite-plugin-ssr.com/pageContext-anywhere\n\nimport React, { useContext } from 'react'\nimport type { PageContextResolved } from '../config/resolvePageContext'\n\nexport { PageContextProvider }\nexport { usePageContext }\n\nconst Context = React.createContext<PageContextResolved>(undefined as any)\n\nfunction PageContextProvider({\n pageContext,\n children\n}: {\n pageContext: PageContextResolved\n children: React.ReactNode\n}) {\n return <Context.Provider value={pageContext}>{children}</Context.Provider>\n}\n\nfunction usePageContext(): PageContextResolved {\n const pageContext = useContext(Context)\n return pageContext\n}\n","import React from 'react'\nimport { assert, Emoji, EmojiName } from './utils/server'\n\nexport { getHeadings }\nexport { parseTitle }\n\nexport type Heading = Omit<HeadingDefinition, 'title' | 'titleInNav'> & {\n title: JSX.Element\n titleInNav: JSX.Element\n parentHeadings: Heading[]\n // Not sure why this is needed\n isListTitle?: true\n sectionTitles?: string[]\n}\nexport type HeadingWithoutLink = {\n url: string\n title: string | JSX.Element\n}\nexport type HeadingDefinition = HeadingBase &\n (\n | ({ level: 1; titleEmoji: EmojiName } & HeadingAbstract)\n | ({ level: 4 } & HeadingAbstract)\n | {\n level: 2\n isListTitle?: true\n sectionTitles?: string[]\n url: string\n }\n | {\n level: 3\n url: string\n }\n )\ntype HeadingBase = {\n title: string\n level: number\n url?: string\n titleDocument?: string\n titleInNav?: string\n // titleSize?: string\n}\ntype HeadingAbstract = {\n url?: undefined\n titleDocument?: undefined\n titleInNav?: undefined\n}\n\nfunction getHeadings(config: { headings: HeadingDefinition[]; headingsWithoutLink: HeadingWithoutLink[] }): {\n headings: Heading[]\n headingsWithoutLink: HeadingWithoutLink[]\n} {\n const headingsWithoutParent: Omit<Heading, 'parentHeadings'>[] = config.headings.map((heading: HeadingDefinition) => {\n const titleProcessed: JSX.Element = parseTitle(heading.title)\n\n const titleInNav = heading.titleInNav || heading.title\n let titleInNavProcessed: JSX.Element\n if ('isListTitle' in heading) {\n assert(heading.isListTitle === true)\n let titleParsed: JSX.Element = parseTitle(titleInNav)\n // if (heading.titleSize) {\n // titleParsed = React.createElement('span', { style: { fontSize: heading.titleSize } }, titleParsed)\n // }\n titleInNavProcessed = React.createElement(React.Fragment, {}, getListPrefix(), titleParsed)\n } else {\n titleInNavProcessed = parseTitle(titleInNav)\n }\n if ('titleEmoji' in heading) {\n assert(heading.titleEmoji)\n titleInNavProcessed = withEmoji(heading.titleEmoji, titleInNavProcessed)\n }\n\n const headingProcessed: Omit<Heading, 'parentHeadings'> = {\n ...heading,\n title: titleProcessed,\n titleInNav: titleInNavProcessed\n }\n return headingProcessed\n })\n\n const headings: Heading[] = []\n headingsWithoutParent.forEach((heading) => {\n const parentHeadings = findParentHeadings(heading, headings)\n headings.push({ ...heading, parentHeadings })\n })\n\n const headingsWithoutLink = config.headingsWithoutLink.map((headingsWithoutLink) => {\n const { url, title } = headingsWithoutLink\n assert(\n headings.find((heading) => heading.url === url) === undefined,\n `remove ${headingsWithoutLink.url} from headingsWithoutLink`\n )\n const titleProcessed = typeof title === 'string' ? parseTitle(title) : title\n return {\n ...headingsWithoutLink,\n title: titleProcessed\n }\n })\n\n assertHeadingsUrl([...headings, ...headingsWithoutLink])\n return { headings, headingsWithoutLink }\n}\n\nfunction findParentHeadings(heading: Omit<Heading, 'parentHeadings'>, headings: Heading[]) {\n const parentHeadings: Heading[] = []\n let levelCurrent = heading.level\n let listTitleParentFound = false\n headings\n .slice()\n .reverse()\n .forEach((parentCandidate) => {\n let isListTitleParent = false\n if (\n !listTitleParentFound &&\n levelCurrent === heading.level &&\n parentCandidate.level === heading.level &&\n !parentCandidate.isListTitle &&\n heading.isListTitle\n ) {\n isListTitleParent = true\n listTitleParentFound = true\n }\n\n const isParent = parentCandidate.level < levelCurrent\n\n if (isParent || isListTitleParent) {\n levelCurrent = parentCandidate.level\n parentHeadings.push(parentCandidate)\n }\n })\n return parentHeadings\n}\n\nfunction assertHeadingsUrl(headings: { url?: string }[]) {\n const urls: Record<string, true> = {}\n headings.forEach((heading) => {\n if (heading.url) {\n const { url } = heading\n assert(url.startsWith('/'))\n assert(!urls[url], { url })\n urls[url] = true\n }\n })\n}\n\nfunction getListPrefix() {\n const nonBreakingSpace = String.fromCodePoint(0x00a0)\n const bulletPoint = String.fromCodePoint(0x2022)\n return nonBreakingSpace + bulletPoint + nonBreakingSpace\n}\n\nfunction parseTitle(title: string): JSX.Element {\n type Part = { nodeType: 'text' | 'code'; content: string }\n const parts: Part[] = []\n let current: Part | undefined\n title.split('').forEach((letter) => {\n if (letter === '`') {\n if (current?.nodeType === 'code') {\n // </code>\n parts.push(current)\n current = undefined\n } else {\n // <code>\n if (current) {\n parts.push(current)\n }\n current = { nodeType: 'code', content: '' }\n }\n } else {\n if (!current) {\n current = { nodeType: 'text', content: '' }\n }\n current.content += letter\n }\n })\n if (current) {\n parts.push(current)\n }\n\n const titleJsx = React.createElement(\n React.Fragment,\n {},\n ...parts.map((part, i) =>\n React.createElement(part.nodeType === 'code' ? 'code' : React.Fragment, { key: i }, part.content)\n )\n )\n\n return titleJsx\n}\n\nfunction withEmoji(name: EmojiName, title: string | JSX.Element): JSX.Element {\n const style = { fontSize: '1.4em' }\n //return React.createElement(React.Fragment, null, Emoji({ name, style }), ' ', title)\n return React.createElement(\n 'span',\n { style },\n Emoji({ name }),\n ' ',\n React.createElement('span', { style: { fontSize: '1rem' } }, title)\n )\n}\n"],"mappings":";;;;;;;;AAAA,OAAOA,YAAW;;;ACGlB,OAAO,SAAS,kBAAkB;AAMlC,IAAM,UAAU,MAAM,cAAmC,MAAgB;AAEzE,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA;AACF,GAGG;AACD,SAAO,oCAAC,QAAQ,UAAR;AAAA,IAAiB,OAAO;AAAA,KAAc,QAAS;AACzD;AAEA,SAAS,iBAAsC;AAC7C,QAAM,cAAc,WAAW,OAAO;AACtC,SAAO;AACT;;;ADjBA,SAAS,WAAW,MAAc;AAChC,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KAAK;AAAA,EACpE;AACF;","names":["React","React","React","React","headingsWithoutLink"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/RepoLink.tsx","../src/renderer/usePageContext.tsx","../src/headings.ts"],"sourcesContent":["import React from 'react'\nimport { assert } from '../utils/server'\nimport { usePageContext } from '../renderer/usePageContext'\n\nexport { RepoLink }\nexport { isRepoLink }\n\nfunction isRepoLink(href: string) {\n return ['/examples/', '/docs/', '/boilerplates/', '.github/', '/test/'].some((start) => href.startsWith(start))\n}\n\nfunction RepoLink({ path, text, editMode }: { path: string; text?: string | JSX.Element; editMode?: true }) {\n const pageContext = usePageContext()\n assert(isRepoLink(path), { path })\n text = text || path\n if (!path.startsWith('/')) {\n path = '/' + path\n }\n const viewMode = (editMode && 'edit') || (path.endsWith('/') && 'tree') || 'blob'\n const { githubRepository } = pageContext.config.projectInfo\n assert(githubRepository.startsWith('https://github.com/'))\n const href = `${githubRepository}/${viewMode}/main${path}`\n return <a href={href}>{text}</a>\n}\n","// `usePageContext` allows us to access `pageContext` in any React component.\n// More infos: https://vite-plugin-ssr.com/pageContext-anywhere\n\nimport React, { useContext } from 'react'\nimport type { PageContextResolved } from '../config/resolvePageContext'\n\nexport { PageContextProvider }\nexport { usePageContext }\n\nconst Context = React.createContext<PageContextResolved>(undefined as any)\n\nfunction PageContextProvider({\n pageContext,\n children\n}: {\n pageContext: PageContextResolved\n children: React.ReactNode\n}) {\n return <Context.Provider value={pageContext}>{children}</Context.Provider>\n}\n\nfunction usePageContext(): PageContextResolved {\n const pageContext = useContext(Context)\n return pageContext\n}\n","import React from 'react'\nimport { assert, Emoji, EmojiName } from './utils/server'\n\nexport { getHeadings }\nexport { parseTitle }\n\nexport type Heading = Omit<HeadingDefinition, 'title' | 'titleInNav'> & {\n title: JSX.Element\n titleInNav: JSX.Element\n parentHeadings: Heading[]\n // Not sure why this is needed\n isListTitle?: true\n sectionTitles?: string[]\n}\nexport type HeadingWithoutLink = {\n url: string\n title: string | JSX.Element\n}\nexport type HeadingDefinition = HeadingBase &\n (\n | ({ level: 1; titleEmoji: EmojiName } & HeadingAbstract)\n | ({ level: 4 } & HeadingAbstract)\n | {\n level: 2\n isListTitle?: true\n sectionTitles?: string[]\n url: string\n }\n | {\n level: 3\n url: string\n }\n )\ntype HeadingBase = {\n title: string\n level: number\n url?: string\n titleDocument?: string\n titleInNav?: string\n // titleSize?: string\n}\ntype HeadingAbstract = {\n url?: undefined\n titleDocument?: undefined\n titleInNav?: undefined\n}\n\nfunction getHeadings(config: { headings: HeadingDefinition[]; headingsWithoutLink: HeadingWithoutLink[] }): {\n headings: Heading[]\n headingsWithoutLink: HeadingWithoutLink[]\n} {\n const headingsWithoutParent: Omit<Heading, 'parentHeadings'>[] = config.headings.map((heading: HeadingDefinition) => {\n const titleProcessed: JSX.Element = parseTitle(heading.title)\n\n const titleInNav = heading.titleInNav || heading.title\n let titleInNavProcessed: JSX.Element\n if ('isListTitle' in heading) {\n assert(heading.isListTitle === true)\n let titleParsed: JSX.Element = parseTitle(titleInNav)\n // if (heading.titleSize) {\n // titleParsed = React.createElement('span', { style: { fontSize: heading.titleSize } }, titleParsed)\n // }\n titleInNavProcessed = React.createElement(React.Fragment, {}, getListPrefix(), titleParsed)\n } else {\n titleInNavProcessed = parseTitle(titleInNav)\n }\n if ('titleEmoji' in heading) {\n assert(heading.titleEmoji)\n titleInNavProcessed = withEmoji(heading.titleEmoji, titleInNavProcessed)\n }\n\n const headingProcessed: Omit<Heading, 'parentHeadings'> = {\n ...heading,\n title: titleProcessed,\n titleInNav: titleInNavProcessed\n }\n return headingProcessed\n })\n\n const headings: Heading[] = []\n headingsWithoutParent.forEach((heading) => {\n const parentHeadings = findParentHeadings(heading, headings)\n headings.push({ ...heading, parentHeadings })\n })\n\n const headingsWithoutLink = config.headingsWithoutLink.map((headingsWithoutLink) => {\n const { url, title } = headingsWithoutLink\n assert(\n headings.find((heading) => heading.url === url) === undefined,\n `remove ${headingsWithoutLink.url} from headingsWithoutLink`\n )\n const titleProcessed = typeof title === 'string' ? parseTitle(title) : title\n return {\n ...headingsWithoutLink,\n title: titleProcessed\n }\n })\n\n assertHeadingsUrl([...headings, ...headingsWithoutLink])\n return { headings, headingsWithoutLink }\n}\n\nfunction findParentHeadings(heading: Omit<Heading, 'parentHeadings'>, headings: Heading[]) {\n const parentHeadings: Heading[] = []\n let levelCurrent = heading.level\n let listTitleParentFound = false\n headings\n .slice()\n .reverse()\n .forEach((parentCandidate) => {\n let isListTitleParent = false\n if (\n !listTitleParentFound &&\n levelCurrent === heading.level &&\n parentCandidate.level === heading.level &&\n !parentCandidate.isListTitle &&\n heading.isListTitle\n ) {\n isListTitleParent = true\n listTitleParentFound = true\n }\n\n const isParent = parentCandidate.level < levelCurrent\n\n if (isParent || isListTitleParent) {\n levelCurrent = parentCandidate.level\n parentHeadings.push(parentCandidate)\n }\n })\n return parentHeadings\n}\n\nfunction assertHeadingsUrl(headings: { url?: string }[]) {\n const urls: Record<string, true> = {}\n headings.forEach((heading) => {\n if (heading.url) {\n const { url } = heading\n assert(url.startsWith('/'))\n assert(!urls[url], { url })\n urls[url] = true\n }\n })\n}\n\nfunction getListPrefix() {\n const nonBreakingSpace = String.fromCodePoint(0x00a0)\n const bulletPoint = String.fromCodePoint(0x2022)\n return nonBreakingSpace + bulletPoint + nonBreakingSpace\n}\n\nfunction parseTitle(title: string): JSX.Element {\n type Part = { nodeType: 'text' | 'code'; content: string }\n const parts: Part[] = []\n let current: Part | undefined\n title.split('').forEach((letter) => {\n if (letter === '`') {\n if (current?.nodeType === 'code') {\n // </code>\n parts.push(current)\n current = undefined\n } else {\n // <code>\n if (current) {\n parts.push(current)\n }\n current = { nodeType: 'code', content: '' }\n }\n } else {\n if (!current) {\n current = { nodeType: 'text', content: '' }\n }\n current.content += letter\n }\n })\n if (current) {\n parts.push(current)\n }\n\n const titleJsx = React.createElement(\n React.Fragment,\n {},\n ...parts.map((part, i) =>\n React.createElement(part.nodeType === 'code' ? 'code' : React.Fragment, { key: i }, part.content)\n )\n )\n\n return titleJsx\n}\n\nfunction withEmoji(name: EmojiName, title: string | JSX.Element): JSX.Element {\n const style = { fontSize: '1.4em' }\n //return React.createElement(React.Fragment, null, Emoji({ name, style }), ' ', title)\n return React.createElement(\n 'span',\n { style },\n Emoji({ name }),\n ' ',\n React.createElement('span', { style: { fontSize: '1rem' } }, title)\n )\n}\n"],"mappings":";;;;;;;;AAAA,OAAOA,YAAW;;;ACGlB,OAAO,SAAS,kBAAkB;AAMlC,IAAM,UAAU,MAAM,cAAmC,MAAgB;AAEzE,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA;AACF,GAGG;AACD,SAAO,oCAAC,QAAQ,UAAR,EAAiB,OAAO,eAAc,QAAS;AACzD;AAEA,SAAS,iBAAsC;AAC7C,QAAM,cAAc,WAAW,OAAO;AACtC,SAAO;AACT;;;ADjBA,SAAS,WAAW,MAAc;AAChC,SAAO,CAAC,cAAc,UAAU,kBAAkB,YAAY,QAAQ,EAAE,KAAK,CAAC,UAAU,KAAK,WAAW,KAAK,CAAC;AAChH;AAEA,SAAS,SAAS,EAAE,MAAM,MAAM,SAAS,GAAmE;AAC1G,QAAM,cAAc,eAAe;AACnC,SAAO,WAAW,IAAI,GAAG,EAAE,KAAK,CAAC;AACjC,SAAO,QAAQ;AACf,MAAI,CAAC,KAAK,WAAW,GAAG,GAAG;AACzB,WAAO,MAAM;AAAA,EACf;AACA,QAAM,WAAY,YAAY,UAAY,KAAK,SAAS,GAAG,KAAK,UAAW;AAC3E,QAAM,EAAE,iBAAiB,IAAI,YAAY,OAAO;AAChD,SAAO,iBAAiB,WAAW,qBAAqB,CAAC;AACzD,QAAM,OAAO,GAAG,oBAAoB,gBAAgB;AACpD,SAAO,gBAAAC,OAAA,cAAC,OAAE,QAAa,IAAK;AAC9B;;;AEvBA,OAAOC,YAAW;AA+ClB,SAAS,YAAY,QAGnB;AACA,QAAM,wBAA2D,OAAO,SAAS,IAAI,CAAC,YAA+B;AACnH,UAAM,iBAA8B,WA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AAC;AACD,MAAI,SAAS;AACX,UAAM,KAAK,OAAO;AAAA,EACpB;AAEA,QAAM,WAAWD,OAAM;AAAA,IACrBA,OAAM;AAAA,IACN,CAAC;AAAA,IACD,GAAG,MAAM;AAAA,MAAI,CAAC,MAAM,MAClBA,OAAM,cAAc,KAAK,aAAa,SAAS,SAASA,OAAM,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,OAAO;AAAA,IAClG;AAAA,EACF;AAEA,SAAO;AACT;AAEA,SAAS,UAAU,MAAiB,OAA0C;AAC5E,QAAM,QAAQ,EAAE,UAAU,QAAQ;AAElC,SAAOA,OAAM;AAAA,IACX;AAAA,IACA,EAAE,MAAM;AAAA,IACR,MAAM,EAAE,KAAK,CAAC;AAAA,IACd;AAAA,IACAA,OAAM,cAAc,QAAQ,EAAE,OAAO,EAAE,UAAU,OAAO,EAAE,GAAG,KAAK;AAAA,EACpE;AACF;","names":["React","React","React","React","headingsWithoutLink"]}
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["import { build, preview } from 'vite'\nimport config from '../vite.config'\nimport { prerender } from 'vite-plugin-ssr/prerender'\nconst args = process.argv.filter(Boolean).slice(2)\nconst isDev = args.includes('dev')\nconst isPreview = args.includes('preview')\nconst isBuild = args.includes('build')\nError.stackTraceLimit = Infinity\n\ncli()\n\nasync function cli() {\n if (isDev) {\n await import('./devServer')\n } else if (isBuild) {\n await build(config)\n await build({ ...config, build: { ssr: true } })\n await prerender({ viteConfig: config })\n } else if (isPreview) {\n const server = await preview({ ...config, preview: { host: true } })\n server.printUrls()\n } else {\n throw new Error(\n `DocPress: unknown command \\`$ docpress ${args.join(\n ' '\n )}\\`. Known commands: \\`$ docpress dev\\` and \\`$ docpress preview\\`.`\n )\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,OAAO,eAAe;AAE/B,SAAS,iBAAiB;AAC1B,IAAM,OAAO,QAAQ,KAAK,OAAO,OAAO,EAAE,MAAM,CAAC;AACjD,IAAM,QAAQ,KAAK,SAAS,KAAK;AACjC,IAAM,YAAY,KAAK,SAAS,SAAS;AACzC,IAAM,UAAU,KAAK,SAAS,OAAO;AACrC,MAAM,kBAAkB;AAExB,IAAI;AAEJ,eAAe,MAAM;AACnB,MAAI,OAAO;AACT,UAAM,OAAO;AAAA,EACf,WAAW,SAAS;AAClB,UAAM,MAAM,mBAAM;AAClB,UAAM,MAAM,EAAE,GAAG,qBAAQ,OAAO,EAAE,KAAK,KAAK,EAAE,CAAC;AAC/C,UAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["import { build, preview } from 'vite'\nimport config from '../vite.config'\nimport { prerender } from 'vite-plugin-ssr/prerender'\nconst args = process.argv.filter(Boolean).slice(2)\nconst isDev = args.includes('dev')\nconst isPreview = args.includes('preview')\nconst isBuild = args.includes('build')\nError.stackTraceLimit = Infinity\n\ncli()\n\nasync function cli() {\n if (isDev) {\n await import('./devServer')\n } else if (isBuild) {\n await build(config)\n await build({ ...config, build: { ssr: true } })\n await prerender({ viteConfig: (config as any) })\n } else if (isPreview) {\n const server = await preview({ ...config, preview: { host: true } })\n server.printUrls()\n } else {\n throw new Error(\n `DocPress: unknown command \\`$ docpress ${args.join(\n ' '\n )}\\`. Known commands: \\`$ docpress dev\\` and \\`$ docpress preview\\`.`\n )\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,OAAO,eAAe;AAE/B,SAAS,iBAAiB;AAC1B,IAAM,OAAO,QAAQ,KAAK,OAAO,OAAO,EAAE,MAAM,CAAC;AACjD,IAAM,QAAQ,KAAK,SAAS,KAAK;AACjC,IAAM,YAAY,KAAK,SAAS,SAAS;AACzC,IAAM,UAAU,KAAK,SAAS,OAAO;AACrC,MAAM,kBAAkB;AAExB,IAAI;AAEJ,eAAe,MAAM;AACnB,MAAI,OAAO;AACT,UAAM,OAAO;AAAA,EACf,WAAW,SAAS;AAClB,UAAM,MAAM,mBAAM;AAClB,UAAM,MAAM,EAAE,GAAG,qBAAQ,OAAO,EAAE,KAAK,KAAK,EAAE,CAAC;AAC/C,UAAM,UAAU,EAAE,YAAa,oBAAe,CAAC;AAAA,EACjD,WAAW,WAAW;AACpB,UAAM,SAAS,MAAM,QAAQ,EAAE,GAAG,qBAAQ,SAAS,EAAE,MAAM,KAAK,EAAE,CAAC;AACnE,WAAO,UAAU;AAAA,EACnB,OAAO;AACL,UAAM,IAAI;AAAA,MACR,0CAA0C,KAAK;AAAA,QAC7C;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,17 +17,17 @@ declare function objectAssign<Obj extends Object, ObjAddendum>(obj: Obj, objAdde
|
|
|
17
17
|
|
|
18
18
|
declare function crawlAllFiles(dir: string): Promise<string[]>;
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
type EmojiName = 'warning' | 'typescript' | 'shield' | 'mechanical-arm' | 'mountain' | 'rocket' | 'wrench' | 'compass' | 'seedling' | 'books' | 'plug' | 'earth' | 'gear' | 'red-heart' | 'high-voltage' | 'gem-stone' | 'dizzy' | 'sparkles' | 'writing-hang' | 'road-fork' | 'engine' | 'red-circle' | 'sparkling-heart' | 'gift' | 'package' | 'info' | 'lab' | 'trophy';
|
|
21
21
|
declare function Emoji({ name, style }: {
|
|
22
22
|
name: EmojiName;
|
|
23
23
|
style?: React$1.CSSProperties;
|
|
24
24
|
}): JSX.Element;
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
type HeadingWithoutLink = {
|
|
27
27
|
url: string;
|
|
28
28
|
title: string | JSX.Element;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
type HeadingDefinition = HeadingBase & (({
|
|
31
31
|
level: 1;
|
|
32
32
|
titleEmoji: EmojiName;
|
|
33
33
|
} & HeadingAbstract) | ({
|
|
@@ -41,20 +41,20 @@ declare type HeadingDefinition = HeadingBase & (({
|
|
|
41
41
|
level: 3;
|
|
42
42
|
url: string;
|
|
43
43
|
});
|
|
44
|
-
|
|
44
|
+
type HeadingBase = {
|
|
45
45
|
title: string;
|
|
46
46
|
level: number;
|
|
47
47
|
url?: string;
|
|
48
48
|
titleDocument?: string;
|
|
49
49
|
titleInNav?: string;
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
type HeadingAbstract = {
|
|
52
52
|
url?: undefined;
|
|
53
53
|
titleDocument?: undefined;
|
|
54
54
|
titleInNav?: undefined;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
type Config = {
|
|
58
58
|
projectInfo: {
|
|
59
59
|
githubRepository: string;
|
|
60
60
|
githubIssues: string;
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
isRepoLink,
|
|
5
5
|
parseTitle,
|
|
6
6
|
usePageContext
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-H5CO4N2X.js";
|
|
8
8
|
import {
|
|
9
9
|
FeatureList
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-C3OIVLKV.js";
|
|
11
11
|
import {
|
|
12
12
|
Emoji,
|
|
13
13
|
crawlAllFiles,
|
|
@@ -36,9 +36,7 @@ function DocLink({
|
|
|
36
36
|
doNotInferSectionTitle
|
|
37
37
|
}) {
|
|
38
38
|
const pageContext = usePageContext();
|
|
39
|
-
return /* @__PURE__ */ React.createElement("a", {
|
|
40
|
-
href
|
|
41
|
-
}, text || getTitle({ href, noBreadcrumb, pageContext, doNotInferSectionTitle }));
|
|
39
|
+
return /* @__PURE__ */ React.createElement("a", { href }, text || getTitle({ href, noBreadcrumb, pageContext, doNotInferSectionTitle }));
|
|
42
40
|
}
|
|
43
41
|
function getTitle({
|
|
44
42
|
href,
|
|
@@ -86,9 +84,7 @@ function getTitle({
|
|
|
86
84
|
}
|
|
87
85
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, breadcrumbs.map((title, i) => {
|
|
88
86
|
const seperator = i === 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null) : " > ";
|
|
89
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
90
|
-
key: i
|
|
91
|
-
}, seperator, title);
|
|
87
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, { key: i }, seperator, title);
|
|
92
88
|
}));
|
|
93
89
|
}
|
|
94
90
|
function findHeading(href, pageContext) {
|
|
@@ -108,24 +104,16 @@ function findHeading(href, pageContext) {
|
|
|
108
104
|
// src/components/Link.tsx
|
|
109
105
|
function Link(props) {
|
|
110
106
|
if (isRepoLink(props.href)) {
|
|
111
|
-
return /* @__PURE__ */ React2.createElement(RepoLink, {
|
|
112
|
-
path: props.href,
|
|
113
|
-
text: props.text
|
|
114
|
-
});
|
|
107
|
+
return /* @__PURE__ */ React2.createElement(RepoLink, { path: props.href, text: props.text });
|
|
115
108
|
} else {
|
|
116
|
-
return /* @__PURE__ */ React2.createElement(DocLink, {
|
|
117
|
-
...props
|
|
118
|
-
});
|
|
109
|
+
return /* @__PURE__ */ React2.createElement(DocLink, { ...props });
|
|
119
110
|
}
|
|
120
111
|
}
|
|
121
112
|
|
|
122
113
|
// src/components/P.tsx
|
|
123
114
|
import React3 from "react";
|
|
124
115
|
function P(props) {
|
|
125
|
-
return /* @__PURE__ */ React3.createElement("div", {
|
|
126
|
-
...props,
|
|
127
|
-
className: "paragraph"
|
|
128
|
-
});
|
|
116
|
+
return /* @__PURE__ */ React3.createElement("div", { ...props, className: "paragraph" });
|
|
129
117
|
}
|
|
130
118
|
|
|
131
119
|
// src/components/Info.tsx
|
|
@@ -140,31 +128,24 @@ function ReadingRecommendation({ tour, links }) {
|
|
|
140
128
|
const multiple = links.length + (tour ? 1 : 0) > 1;
|
|
141
129
|
return /* @__PURE__ */ React5.createElement(Info, null, multiple ? " " : "", /* @__PURE__ */ React5.createElement("b", null, "Reading Recommendation", multiple ? "." : ": "), (() => {
|
|
142
130
|
if (!multiple) {
|
|
143
|
-
const link = tour ? /* @__PURE__ */ React5.createElement(TourLink, null) : /* @__PURE__ */ React5.createElement(Link, {
|
|
144
|
-
href: links[0]
|
|
145
|
-
});
|
|
131
|
+
const link = tour ? /* @__PURE__ */ React5.createElement(TourLink, null) : /* @__PURE__ */ React5.createElement(Link, { href: links[0] });
|
|
146
132
|
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, link, ".");
|
|
147
133
|
}
|
|
148
|
-
return /* @__PURE__ */ React5.createElement(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
134
|
+
return /* @__PURE__ */ React5.createElement(
|
|
135
|
+
"ul",
|
|
136
|
+
{
|
|
137
|
+
style: {
|
|
138
|
+
marginLeft: 18,
|
|
139
|
+
marginTop: 11
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
tour && /* @__PURE__ */ React5.createElement("li", null, /* @__PURE__ */ React5.createElement(TourLink, null)),
|
|
143
|
+
links.map((link, i) => /* @__PURE__ */ React5.createElement("li", { key: i }, /* @__PURE__ */ React5.createElement(Link, { href: link })))
|
|
144
|
+
);
|
|
158
145
|
})());
|
|
159
146
|
}
|
|
160
147
|
function TourLink() {
|
|
161
|
-
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(Link, {
|
|
162
|
-
href: "/react-tour",
|
|
163
|
-
noBreadcrumb: true
|
|
164
|
-
}), " or ", /* @__PURE__ */ React5.createElement(Link, {
|
|
165
|
-
href: "/vue-tour",
|
|
166
|
-
noBreadcrumb: true
|
|
167
|
-
}));
|
|
148
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(Link, { href: "/react-tour", noBreadcrumb: true }), " or ", /* @__PURE__ */ React5.createElement(Link, { href: "/vue-tour", noBreadcrumb: true }));
|
|
168
149
|
}
|
|
169
150
|
|
|
170
151
|
// src/components/Note.tsx
|
|
@@ -183,13 +164,7 @@ function Note({
|
|
|
183
164
|
icon = ":warning:";
|
|
184
165
|
}
|
|
185
166
|
}
|
|
186
|
-
return /* @__PURE__ */ React6.createElement("blockquote", {
|
|
187
|
-
className: type
|
|
188
|
-
}, /* @__PURE__ */ React6.createElement("div", {
|
|
189
|
-
style: { marginBottom: 20 }
|
|
190
|
-
}), icon, " ", children, /* @__PURE__ */ React6.createElement("div", {
|
|
191
|
-
style: { marginTop: 20 }
|
|
192
|
-
}));
|
|
167
|
+
return /* @__PURE__ */ React6.createElement("blockquote", { className: type }, /* @__PURE__ */ React6.createElement("div", { style: { marginBottom: 20 } }), icon, " ", children, /* @__PURE__ */ React6.createElement("div", { style: { marginTop: 20 } }));
|
|
193
168
|
}
|
|
194
169
|
|
|
195
170
|
// src/components/ImportMeta.tsx
|
|
@@ -204,19 +179,19 @@ function ImportMeta({ prop }) {
|
|
|
204
179
|
// src/components/HorizontalLine.tsx
|
|
205
180
|
import React8 from "react";
|
|
206
181
|
function HorizontalLine({ primary }) {
|
|
207
|
-
return /* @__PURE__ */ React8.createElement("div", {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
182
|
+
return /* @__PURE__ */ React8.createElement("div", { className: "header-separator-line " + (primary ? "primary" : ""), style: { textAlign: "center" } }, /* @__PURE__ */ React8.createElement(
|
|
183
|
+
"hr",
|
|
184
|
+
{
|
|
185
|
+
style: {
|
|
186
|
+
display: "inline-block",
|
|
187
|
+
margin: 0,
|
|
188
|
+
border: 0,
|
|
189
|
+
borderTop: "1px solid #eee",
|
|
190
|
+
maxWidth: 500,
|
|
191
|
+
width: "80%"
|
|
192
|
+
}
|
|
218
193
|
}
|
|
219
|
-
|
|
194
|
+
));
|
|
220
195
|
}
|
|
221
196
|
|
|
222
197
|
// src/components/Sponsors.tsx
|
|
@@ -282,31 +257,23 @@ var sponsors = [
|
|
|
282
257
|
function Sponsors() {
|
|
283
258
|
const pageContext = usePageContext();
|
|
284
259
|
const { projectInfo } = pageContext.config;
|
|
285
|
-
return /* @__PURE__ */ React9.createElement("div", {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
src: heart_default,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}, "Sponsor")), /* @__PURE__ */ React9.createElement("div", null), /* @__PURE__ */ React9.createElement("div", {
|
|
303
|
-
style: { maxWidth: 400, display: "inline-block", marginTop: 12, marginBottom: 12 }
|
|
304
|
-
}, projectInfo.projectNameJsx || projectInfo.projectName, " is free and open source, made possible by wonderful sponsors."), /* @__PURE__ */ React9.createElement("div", {
|
|
305
|
-
style: { display: "flex", flexWrap: "wrap", justifyContent: "center", alignItems: "end" }
|
|
306
|
-
}, sponsors.map((sponsor, i) => /* @__PURE__ */ React9.createElement(SponsorDiv, {
|
|
307
|
-
sponsor,
|
|
308
|
-
key: i
|
|
309
|
-
}))));
|
|
260
|
+
return /* @__PURE__ */ React9.createElement("div", { style: { textAlign: "center", marginTop: 19 } }, /* @__PURE__ */ React9.createElement(
|
|
261
|
+
"a",
|
|
262
|
+
{
|
|
263
|
+
className: "button",
|
|
264
|
+
href: "https://github.com/sponsors/brillout",
|
|
265
|
+
style: {
|
|
266
|
+
color: "inherit",
|
|
267
|
+
display: "inline-flex",
|
|
268
|
+
alignItems: "center",
|
|
269
|
+
padding: "5px 10px",
|
|
270
|
+
marginBottom: 10
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
/* @__PURE__ */ React9.createElement("img", { src: heart_default, height: 22 }),
|
|
274
|
+
" ",
|
|
275
|
+
/* @__PURE__ */ React9.createElement("span", { style: { marginLeft: 7, fontSize: "1.07em" } }, "Sponsor")
|
|
276
|
+
), /* @__PURE__ */ React9.createElement("div", null), /* @__PURE__ */ React9.createElement("div", { style: { maxWidth: 400, display: "inline-block", marginTop: 12, marginBottom: 12 } }, projectInfo.projectNameJsx || projectInfo.projectName, " is free and open source, made possible by wonderful sponsors."), /* @__PURE__ */ React9.createElement("div", { style: { display: "flex", flexWrap: "wrap", justifyContent: "center", alignItems: "end" } }, sponsors.map((sponsor, i) => /* @__PURE__ */ React9.createElement(SponsorDiv, { sponsor, key: i }))));
|
|
310
277
|
}
|
|
311
278
|
function SponsorDiv({ sponsor }) {
|
|
312
279
|
let imgSrc;
|
|
@@ -332,82 +299,96 @@ function SponsorDiv({ sponsor }) {
|
|
|
332
299
|
height = size.height;
|
|
333
300
|
padding = size.padding;
|
|
334
301
|
imgAlt = sponsor.companyName;
|
|
335
|
-
label = /* @__PURE__ */ React9.createElement(Label, {
|
|
336
|
-
sponsor
|
|
337
|
-
});
|
|
302
|
+
label = /* @__PURE__ */ React9.createElement(Label, { sponsor });
|
|
338
303
|
}
|
|
339
304
|
const marginWidth = 5;
|
|
340
|
-
return /* @__PURE__ */ React9.createElement(
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
305
|
+
return /* @__PURE__ */ React9.createElement(
|
|
306
|
+
"a",
|
|
307
|
+
{
|
|
308
|
+
href: website,
|
|
309
|
+
style: {
|
|
310
|
+
margin: `10px ${marginWidth}px`
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
label,
|
|
314
|
+
/* @__PURE__ */ React9.createElement(
|
|
315
|
+
"div",
|
|
316
|
+
{
|
|
317
|
+
style: {
|
|
318
|
+
backgroundColor,
|
|
319
|
+
borderRadius: 7,
|
|
320
|
+
overflow: "hidden",
|
|
321
|
+
width,
|
|
322
|
+
maxWidth: `calc(100vw - 2 * var(--main-view-padding) - 2 * ${marginWidth}px)`,
|
|
323
|
+
height,
|
|
324
|
+
display: "flex",
|
|
325
|
+
alignItems: "center",
|
|
326
|
+
flexDirection: "column",
|
|
327
|
+
justifyContent: "center"
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
/* @__PURE__ */ React9.createElement(
|
|
331
|
+
"img",
|
|
332
|
+
{
|
|
333
|
+
style: { width: `calc(100% - ${padding}px)`, height: height - padding, zIndex: 2 },
|
|
334
|
+
src: imgSrc,
|
|
335
|
+
alt: imgAlt
|
|
336
|
+
}
|
|
337
|
+
)
|
|
338
|
+
)
|
|
339
|
+
);
|
|
363
340
|
}
|
|
364
341
|
function Label({ sponsor }) {
|
|
365
342
|
assert(!("username" in sponsor));
|
|
366
343
|
const labelBg = getLabelBg(sponsor);
|
|
367
344
|
const labelIcon = getLabelIcon(sponsor);
|
|
368
345
|
const labelText = getLabelText(sponsor);
|
|
369
|
-
return /* @__PURE__ */ React9.createElement(
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
346
|
+
return /* @__PURE__ */ React9.createElement(
|
|
347
|
+
"div",
|
|
348
|
+
{
|
|
349
|
+
style: {
|
|
350
|
+
top: 0,
|
|
351
|
+
display: "flex",
|
|
352
|
+
justifyContent: "center",
|
|
353
|
+
alignItems: "center",
|
|
354
|
+
position: "relative",
|
|
355
|
+
paddingBottom: 1
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
labelBg,
|
|
359
|
+
labelIcon,
|
|
360
|
+
labelText
|
|
361
|
+
);
|
|
379
362
|
}
|
|
380
363
|
function getLabelBg(sponsor) {
|
|
381
364
|
const height = sponsor.plan === "platinum" ? 32 : 24;
|
|
382
|
-
return /* @__PURE__ */ React9.createElement("img", {
|
|
383
|
-
src: label_default,
|
|
384
|
-
style: { height, position: "absolute", bottom: 0, zIndex: -1 }
|
|
385
|
-
});
|
|
365
|
+
return /* @__PURE__ */ React9.createElement("img", { src: label_default, style: { height, position: "absolute", bottom: 0, zIndex: -1 } });
|
|
386
366
|
}
|
|
387
367
|
function getLabelText(sponsor) {
|
|
388
368
|
if (sponsor.plan === "platinum") {
|
|
389
369
|
return /* @__PURE__ */ React9.createElement(React9.Fragment, null);
|
|
390
370
|
}
|
|
391
371
|
const letterSpacing = ["bronze", "silver", "gold"].includes(sponsor.plan) ? 1 : void 0;
|
|
392
|
-
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, " ", /* @__PURE__ */ React9.createElement(
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
372
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, " ", /* @__PURE__ */ React9.createElement(
|
|
373
|
+
"span",
|
|
374
|
+
{
|
|
375
|
+
style: {
|
|
376
|
+
zIndex: 1,
|
|
377
|
+
fontSize: "0.82em",
|
|
378
|
+
position: "relative",
|
|
379
|
+
top: 0,
|
|
380
|
+
fontWeight: 500,
|
|
381
|
+
color: "#666",
|
|
382
|
+
letterSpacing
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
capitalizeFirstLetter(sponsor.plan)
|
|
386
|
+
));
|
|
403
387
|
}
|
|
404
388
|
function getLabelIcon(sponsor) {
|
|
405
389
|
let medalSrc;
|
|
406
390
|
if (sponsor.plan === "platinum") {
|
|
407
|
-
return /* @__PURE__ */ React9.createElement(Emoji, {
|
|
408
|
-
name: "trophy",
|
|
409
|
-
style: { fontSize: "1.3em" }
|
|
410
|
-
});
|
|
391
|
+
return /* @__PURE__ */ React9.createElement(Emoji, { name: "trophy", style: { fontSize: "1.3em" } });
|
|
411
392
|
} else if (sponsor.plan === "gold") {
|
|
412
393
|
medalSrc = medalGold_default;
|
|
413
394
|
} else if (sponsor.plan === "silver") {
|
|
@@ -417,10 +398,7 @@ function getLabelIcon(sponsor) {
|
|
|
417
398
|
} else {
|
|
418
399
|
assert(false);
|
|
419
400
|
}
|
|
420
|
-
return /* @__PURE__ */ React9.createElement("img", {
|
|
421
|
-
src: medalSrc,
|
|
422
|
-
style: { height: 15, zIndex: 1, marginRight: 5 }
|
|
423
|
-
});
|
|
401
|
+
return /* @__PURE__ */ React9.createElement("img", { src: medalSrc, style: { height: 15, zIndex: 1, marginRight: 5 } });
|
|
424
402
|
}
|
|
425
403
|
function getSize(plan) {
|
|
426
404
|
if (plan === "platinum") {
|
|
@@ -457,9 +435,7 @@ function CodeBlock({ children, lineBreak }) {
|
|
|
457
435
|
paddingRight: "16px !important"
|
|
458
436
|
});
|
|
459
437
|
}
|
|
460
|
-
return /* @__PURE__ */ React10.createElement("pre", null, /* @__PURE__ */ React10.createElement("code", {
|
|
461
|
-
style
|
|
462
|
-
}, children));
|
|
438
|
+
return /* @__PURE__ */ React10.createElement("pre", null, /* @__PURE__ */ React10.createElement("code", { style }, children));
|
|
463
439
|
}
|
|
464
440
|
export {
|
|
465
441
|
CodeBlock,
|