@brillout/docpress 0.2.1 → 0.2.2
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-H5CO4N2X.js → chunk-JS5BGVDK.js} +7 -3
- package/dist/{chunk-H5CO4N2X.js.map → chunk-JS5BGVDK.js.map} +1 -1
- package/dist/chunk-OEVBWUR6.js +92 -0
- package/dist/{chunk-C3OIVLKV.js.map → chunk-OEVBWUR6.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 +145 -121
- package/dist/index.js.map +1 -1
- package/dist/renderer/_default.page.server.d.ts +4 -4
- package/dist/renderer/_default.page.server.js +228 -216
- package/dist/renderer/_default.page.server.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-C3OIVLKV.js +0 -75
|
@@ -15,7 +15,9 @@ function PageContextProvider({
|
|
|
15
15
|
pageContext,
|
|
16
16
|
children
|
|
17
17
|
}) {
|
|
18
|
-
return /* @__PURE__ */ React.createElement(Context.Provider, {
|
|
18
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, {
|
|
19
|
+
value: pageContext
|
|
20
|
+
}, children);
|
|
19
21
|
}
|
|
20
22
|
function usePageContext() {
|
|
21
23
|
const pageContext = useContext(Context);
|
|
@@ -37,7 +39,9 @@ function RepoLink({ path, text, editMode }) {
|
|
|
37
39
|
const { githubRepository } = pageContext.config.projectInfo;
|
|
38
40
|
assert(githubRepository.startsWith("https://github.com/"));
|
|
39
41
|
const href = `${githubRepository}/${viewMode}/main${path}`;
|
|
40
|
-
return /* @__PURE__ */ React2.createElement("a", {
|
|
42
|
+
return /* @__PURE__ */ React2.createElement("a", {
|
|
43
|
+
href
|
|
44
|
+
}, text);
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
// src/headings.ts
|
|
@@ -171,4 +175,4 @@ export {
|
|
|
171
175
|
getHeadings,
|
|
172
176
|
parseTitle
|
|
173
177
|
};
|
|
174
|
-
//# sourceMappingURL=chunk-
|
|
178
|
+
//# sourceMappingURL=chunk-JS5BGVDK.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,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,QAGn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,QAAQ,SAAS,GAAG;AAAA,MAC5C;AACA,cAAQ,WAAW;AAAA,IACrB;AAAA,EACF,CAAC;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"]}
|
|
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,SAAO,CAAC,cAAc,UAAU,kBAAkB,YAAY,QAAQ,EAAE,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
|
|
@@ -0,0 +1,92 @@
|
|
|
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", {
|
|
12
|
+
id: "features"
|
|
13
|
+
}, Array.from({ length: numberOfRows }, (_, i) => {
|
|
14
|
+
const feature1Id = 2 * i + 0;
|
|
15
|
+
const feature2Id = 2 * i + 1;
|
|
16
|
+
const feature1 = features[feature1Id];
|
|
17
|
+
const feature2 = features[feature2Id];
|
|
18
|
+
const className = ["features-row", feature2 ? "" : "single-column"].filter(Boolean).join(" ");
|
|
19
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
20
|
+
className,
|
|
21
|
+
key: i
|
|
22
|
+
}, /* @__PURE__ */ React.createElement(Feature, {
|
|
23
|
+
...{ ...feature1, featureId: feature1Id }
|
|
24
|
+
}), feature2 && /* @__PURE__ */ React.createElement(Feature, {
|
|
25
|
+
...{ ...feature2, featureId: feature2Id }
|
|
26
|
+
}));
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
function Feature({ title, desc, learnMore, isSecondaryFeature, featureId }) {
|
|
30
|
+
const name = `feature-${featureId}`;
|
|
31
|
+
const rightSide = featureId % 2 === 1;
|
|
32
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(FeatureHead, {
|
|
33
|
+
name,
|
|
34
|
+
hasLearnMore: !!learnMore,
|
|
35
|
+
isSecondaryFeature
|
|
36
|
+
}, " ", /* @__PURE__ */ React.createElement("h2", null, title), desc), !!learnMore && /* @__PURE__ */ React.createElement(LearnMore, {
|
|
37
|
+
name,
|
|
38
|
+
rightSide
|
|
39
|
+
}, learnMore));
|
|
40
|
+
}
|
|
41
|
+
function FeatureHead({
|
|
42
|
+
children,
|
|
43
|
+
name,
|
|
44
|
+
hasLearnMore,
|
|
45
|
+
isSecondaryFeature,
|
|
46
|
+
className = ""
|
|
47
|
+
}) {
|
|
48
|
+
return /* @__PURE__ */ React.createElement("summary", {
|
|
49
|
+
className: [
|
|
50
|
+
className,
|
|
51
|
+
"feature",
|
|
52
|
+
"colorize-on-hover",
|
|
53
|
+
hasLearnMore && "has-learn-more",
|
|
54
|
+
isSecondaryFeature && "secondary-feature"
|
|
55
|
+
].filter(Boolean).join(" "),
|
|
56
|
+
id: name && `feature-${name}`,
|
|
57
|
+
style: { cursor: hasLearnMore && "pointer" || void 0 }
|
|
58
|
+
}, children, hasLearnMore && /* @__PURE__ */ React.createElement("div", {
|
|
59
|
+
style: { textAlign: "center", marginTop: "1em" }
|
|
60
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
61
|
+
type: "button",
|
|
62
|
+
style: {
|
|
63
|
+
textAlign: "center",
|
|
64
|
+
padding: "0 7px",
|
|
65
|
+
paddingTop: 3,
|
|
66
|
+
paddingBottom: 1,
|
|
67
|
+
display: "inline-block",
|
|
68
|
+
fontSize: "10px",
|
|
69
|
+
textTransform: "uppercase",
|
|
70
|
+
letterSpacing: "1px",
|
|
71
|
+
fontWeight: 600
|
|
72
|
+
}
|
|
73
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
74
|
+
className: "decolorize-5"
|
|
75
|
+
}, "Learn more"), /* @__PURE__ */ React.createElement("br", null), /* @__PURE__ */ React.createElement("img", {
|
|
76
|
+
className: "decolorize-4 chevron",
|
|
77
|
+
src: chevron_default,
|
|
78
|
+
height: "7",
|
|
79
|
+
style: { marginTop: 2 }
|
|
80
|
+
}))));
|
|
81
|
+
}
|
|
82
|
+
function LearnMore({ children, name, rightSide }) {
|
|
83
|
+
return /* @__PURE__ */ React.createElement("aside", {
|
|
84
|
+
className: "learn-more " + (rightSide ? "right-side" : ""),
|
|
85
|
+
id: `learn-more-${name}`
|
|
86
|
+
}, children);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
FeatureList
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=chunk-OEVBWUR6.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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AChB,sBAAsB;AAAA,IACxB,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,IACX,IAAI,QAAQ,WAAW;AAAA,IACvB,OAAO,EAAE,QAAS,gBAAgB,aAAc,OAAU;AAAA,KAEzD,UACA,gBACC,oCAAC;AAAA,IAAI,OAAO,EAAE,WAAW,UAAU,WAAW,MAAM;AAAA,KAClD,oCAAC;AAAA,IACC,MAAK;AAAA,IACL,OAAO;AAAA,MACL,WAAW;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,SAAS;AAAA,MACT,UAAU;AAAA,MACV,eAAe;AAAA,MACf,eAAe;AAAA,MACf,YAAY;AAAA,IACd;AAAA,KAEA,oCAAC;AAAA,IAAK,WAAU;AAAA,KAAe,YAAU,GACzC,oCAAC,UAAG,GACJ,oCAAC;AAAA,IAAI,WAAU;AAAA,IAAuB,KAAK;AAAA,IAAa,QAAO;AAAA,IAAI,OAAO,EAAE,WAAW,EAAE;AAAA,GAAG,CAC9F,CACF,CAEJ;AAEJ;AACA,SAAS,UAAU,EAAE,UAAU,MAAM,UAAU,GAAwD;AACrG,SACE,oCAAC;AAAA,IAAM,WAAW,iBAAiB,YAAY,eAAe;AAAA,IAAK,IAAI,cAAc;AAAA,KAClF,QACH;AAEJ;","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
|
-
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';
|
|
20
|
+
declare 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
|
-
type HeadingWithoutLink = {
|
|
26
|
+
declare type HeadingWithoutLink = {
|
|
27
27
|
url: string;
|
|
28
28
|
title: string | JSX.Element;
|
|
29
29
|
};
|
|
30
|
-
type HeadingDefinition = HeadingBase & (({
|
|
30
|
+
declare type HeadingDefinition = HeadingBase & (({
|
|
31
31
|
level: 1;
|
|
32
32
|
titleEmoji: EmojiName;
|
|
33
33
|
} & HeadingAbstract) | ({
|
|
@@ -41,20 +41,20 @@ type HeadingDefinition = HeadingBase & (({
|
|
|
41
41
|
level: 3;
|
|
42
42
|
url: string;
|
|
43
43
|
});
|
|
44
|
-
type HeadingBase = {
|
|
44
|
+
declare 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
|
-
type HeadingAbstract = {
|
|
51
|
+
declare type HeadingAbstract = {
|
|
52
52
|
url?: undefined;
|
|
53
53
|
titleDocument?: undefined;
|
|
54
54
|
titleInNav?: undefined;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
type Config = {
|
|
57
|
+
declare 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-JS5BGVDK.js";
|
|
8
8
|
import {
|
|
9
9
|
FeatureList
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OEVBWUR6.js";
|
|
11
11
|
import {
|
|
12
12
|
Emoji,
|
|
13
13
|
crawlAllFiles,
|
|
@@ -36,7 +36,9 @@ function DocLink({
|
|
|
36
36
|
doNotInferSectionTitle
|
|
37
37
|
}) {
|
|
38
38
|
const pageContext = usePageContext();
|
|
39
|
-
return /* @__PURE__ */ React.createElement("a", {
|
|
39
|
+
return /* @__PURE__ */ React.createElement("a", {
|
|
40
|
+
href
|
|
41
|
+
}, text || getTitle({ href, noBreadcrumb, pageContext, doNotInferSectionTitle }));
|
|
40
42
|
}
|
|
41
43
|
function getTitle({
|
|
42
44
|
href,
|
|
@@ -84,7 +86,9 @@ function getTitle({
|
|
|
84
86
|
}
|
|
85
87
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, breadcrumbs.map((title, i) => {
|
|
86
88
|
const seperator = i === 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null) : " > ";
|
|
87
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
89
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
90
|
+
key: i
|
|
91
|
+
}, seperator, title);
|
|
88
92
|
}));
|
|
89
93
|
}
|
|
90
94
|
function findHeading(href, pageContext) {
|
|
@@ -104,16 +108,24 @@ function findHeading(href, pageContext) {
|
|
|
104
108
|
// src/components/Link.tsx
|
|
105
109
|
function Link(props) {
|
|
106
110
|
if (isRepoLink(props.href)) {
|
|
107
|
-
return /* @__PURE__ */ React2.createElement(RepoLink, {
|
|
111
|
+
return /* @__PURE__ */ React2.createElement(RepoLink, {
|
|
112
|
+
path: props.href,
|
|
113
|
+
text: props.text
|
|
114
|
+
});
|
|
108
115
|
} else {
|
|
109
|
-
return /* @__PURE__ */ React2.createElement(DocLink, {
|
|
116
|
+
return /* @__PURE__ */ React2.createElement(DocLink, {
|
|
117
|
+
...props
|
|
118
|
+
});
|
|
110
119
|
}
|
|
111
120
|
}
|
|
112
121
|
|
|
113
122
|
// src/components/P.tsx
|
|
114
123
|
import React3 from "react";
|
|
115
124
|
function P(props) {
|
|
116
|
-
return /* @__PURE__ */ React3.createElement("div", {
|
|
125
|
+
return /* @__PURE__ */ React3.createElement("div", {
|
|
126
|
+
...props,
|
|
127
|
+
className: "paragraph"
|
|
128
|
+
});
|
|
117
129
|
}
|
|
118
130
|
|
|
119
131
|
// src/components/Info.tsx
|
|
@@ -128,24 +140,31 @@ function ReadingRecommendation({ tour, links }) {
|
|
|
128
140
|
const multiple = links.length + (tour ? 1 : 0) > 1;
|
|
129
141
|
return /* @__PURE__ */ React5.createElement(Info, null, multiple ? " " : "", /* @__PURE__ */ React5.createElement("b", null, "Reading Recommendation", multiple ? "." : ": "), (() => {
|
|
130
142
|
if (!multiple) {
|
|
131
|
-
const link = tour ? /* @__PURE__ */ React5.createElement(TourLink, null) : /* @__PURE__ */ React5.createElement(Link, {
|
|
143
|
+
const link = tour ? /* @__PURE__ */ React5.createElement(TourLink, null) : /* @__PURE__ */ React5.createElement(Link, {
|
|
144
|
+
href: links[0]
|
|
145
|
+
});
|
|
132
146
|
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, link, ".");
|
|
133
147
|
}
|
|
134
|
-
return /* @__PURE__ */ React5.createElement(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
);
|
|
148
|
+
return /* @__PURE__ */ React5.createElement("ul", {
|
|
149
|
+
style: {
|
|
150
|
+
marginLeft: 18,
|
|
151
|
+
marginTop: 11
|
|
152
|
+
}
|
|
153
|
+
}, tour && /* @__PURE__ */ React5.createElement("li", null, /* @__PURE__ */ React5.createElement(TourLink, null)), links.map((link, i) => /* @__PURE__ */ React5.createElement("li", {
|
|
154
|
+
key: i
|
|
155
|
+
}, /* @__PURE__ */ React5.createElement(Link, {
|
|
156
|
+
href: link
|
|
157
|
+
}))));
|
|
145
158
|
})());
|
|
146
159
|
}
|
|
147
160
|
function TourLink() {
|
|
148
|
-
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(Link, {
|
|
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
|
+
}));
|
|
149
168
|
}
|
|
150
169
|
|
|
151
170
|
// src/components/Note.tsx
|
|
@@ -164,7 +183,13 @@ function Note({
|
|
|
164
183
|
icon = ":warning:";
|
|
165
184
|
}
|
|
166
185
|
}
|
|
167
|
-
return /* @__PURE__ */ React6.createElement("blockquote", {
|
|
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
|
+
}));
|
|
168
193
|
}
|
|
169
194
|
|
|
170
195
|
// src/components/ImportMeta.tsx
|
|
@@ -179,19 +204,19 @@ function ImportMeta({ prop }) {
|
|
|
179
204
|
// src/components/HorizontalLine.tsx
|
|
180
205
|
import React8 from "react";
|
|
181
206
|
function HorizontalLine({ primary }) {
|
|
182
|
-
return /* @__PURE__ */ React8.createElement("div", {
|
|
183
|
-
"
|
|
184
|
-
{
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
207
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
208
|
+
className: "header-separator-line " + (primary ? "primary" : ""),
|
|
209
|
+
style: { textAlign: "center" }
|
|
210
|
+
}, /* @__PURE__ */ React8.createElement("hr", {
|
|
211
|
+
style: {
|
|
212
|
+
display: "inline-block",
|
|
213
|
+
margin: 0,
|
|
214
|
+
border: 0,
|
|
215
|
+
borderTop: "1px solid #eee",
|
|
216
|
+
maxWidth: 500,
|
|
217
|
+
width: "80%"
|
|
193
218
|
}
|
|
194
|
-
));
|
|
219
|
+
}));
|
|
195
220
|
}
|
|
196
221
|
|
|
197
222
|
// src/components/Sponsors.tsx
|
|
@@ -257,23 +282,31 @@ var sponsors = [
|
|
|
257
282
|
function Sponsors() {
|
|
258
283
|
const pageContext = usePageContext();
|
|
259
284
|
const { projectInfo } = pageContext.config;
|
|
260
|
-
return /* @__PURE__ */ React9.createElement("div", {
|
|
261
|
-
"
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
285
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
286
|
+
style: { textAlign: "center", marginTop: 19 }
|
|
287
|
+
}, /* @__PURE__ */ React9.createElement("a", {
|
|
288
|
+
className: "button",
|
|
289
|
+
href: "https://github.com/sponsors/brillout",
|
|
290
|
+
style: {
|
|
291
|
+
color: "inherit",
|
|
292
|
+
display: "inline-flex",
|
|
293
|
+
alignItems: "center",
|
|
294
|
+
padding: "5px 10px",
|
|
295
|
+
marginBottom: 10
|
|
296
|
+
}
|
|
297
|
+
}, /* @__PURE__ */ React9.createElement("img", {
|
|
298
|
+
src: heart_default,
|
|
299
|
+
height: 22
|
|
300
|
+
}), " ", /* @__PURE__ */ React9.createElement("span", {
|
|
301
|
+
style: { marginLeft: 7, fontSize: "1.07em" }
|
|
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
|
+
}))));
|
|
277
310
|
}
|
|
278
311
|
function SponsorDiv({ sponsor }) {
|
|
279
312
|
let imgSrc;
|
|
@@ -299,96 +332,82 @@ function SponsorDiv({ sponsor }) {
|
|
|
299
332
|
height = size.height;
|
|
300
333
|
padding = size.padding;
|
|
301
334
|
imgAlt = sponsor.companyName;
|
|
302
|
-
label = /* @__PURE__ */ React9.createElement(Label, {
|
|
335
|
+
label = /* @__PURE__ */ React9.createElement(Label, {
|
|
336
|
+
sponsor
|
|
337
|
+
});
|
|
303
338
|
}
|
|
304
339
|
const marginWidth = 5;
|
|
305
|
-
return /* @__PURE__ */ React9.createElement(
|
|
306
|
-
|
|
307
|
-
{
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
{
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
-
);
|
|
340
|
+
return /* @__PURE__ */ React9.createElement("a", {
|
|
341
|
+
href: website,
|
|
342
|
+
style: {
|
|
343
|
+
margin: `10px ${marginWidth}px`
|
|
344
|
+
}
|
|
345
|
+
}, label, /* @__PURE__ */ React9.createElement("div", {
|
|
346
|
+
style: {
|
|
347
|
+
backgroundColor,
|
|
348
|
+
borderRadius: 7,
|
|
349
|
+
overflow: "hidden",
|
|
350
|
+
width,
|
|
351
|
+
maxWidth: `calc(100vw - 2 * var(--main-view-padding) - 2 * ${marginWidth}px)`,
|
|
352
|
+
height,
|
|
353
|
+
display: "flex",
|
|
354
|
+
alignItems: "center",
|
|
355
|
+
flexDirection: "column",
|
|
356
|
+
justifyContent: "center"
|
|
357
|
+
}
|
|
358
|
+
}, /* @__PURE__ */ React9.createElement("img", {
|
|
359
|
+
style: { width: `calc(100% - ${padding}px)`, height: height - padding, zIndex: 2 },
|
|
360
|
+
src: imgSrc,
|
|
361
|
+
alt: imgAlt
|
|
362
|
+
})));
|
|
340
363
|
}
|
|
341
364
|
function Label({ sponsor }) {
|
|
342
365
|
assert(!("username" in sponsor));
|
|
343
366
|
const labelBg = getLabelBg(sponsor);
|
|
344
367
|
const labelIcon = getLabelIcon(sponsor);
|
|
345
368
|
const labelText = getLabelText(sponsor);
|
|
346
|
-
return /* @__PURE__ */ React9.createElement(
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
labelBg,
|
|
359
|
-
labelIcon,
|
|
360
|
-
labelText
|
|
361
|
-
);
|
|
369
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
370
|
+
style: {
|
|
371
|
+
top: 0,
|
|
372
|
+
display: "flex",
|
|
373
|
+
justifyContent: "center",
|
|
374
|
+
alignItems: "center",
|
|
375
|
+
position: "relative",
|
|
376
|
+
paddingBottom: 1
|
|
377
|
+
}
|
|
378
|
+
}, labelBg, labelIcon, labelText);
|
|
362
379
|
}
|
|
363
380
|
function getLabelBg(sponsor) {
|
|
364
381
|
const height = sponsor.plan === "platinum" ? 32 : 24;
|
|
365
|
-
return /* @__PURE__ */ React9.createElement("img", {
|
|
382
|
+
return /* @__PURE__ */ React9.createElement("img", {
|
|
383
|
+
src: label_default,
|
|
384
|
+
style: { height, position: "absolute", bottom: 0, zIndex: -1 }
|
|
385
|
+
});
|
|
366
386
|
}
|
|
367
387
|
function getLabelText(sponsor) {
|
|
368
388
|
if (sponsor.plan === "platinum") {
|
|
369
389
|
return /* @__PURE__ */ React9.createElement(React9.Fragment, null);
|
|
370
390
|
}
|
|
371
391
|
const letterSpacing = ["bronze", "silver", "gold"].includes(sponsor.plan) ? 1 : void 0;
|
|
372
|
-
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, " ", /* @__PURE__ */ React9.createElement(
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
capitalizeFirstLetter(sponsor.plan)
|
|
386
|
-
));
|
|
392
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, " ", /* @__PURE__ */ React9.createElement("span", {
|
|
393
|
+
style: {
|
|
394
|
+
zIndex: 1,
|
|
395
|
+
fontSize: "0.82em",
|
|
396
|
+
position: "relative",
|
|
397
|
+
top: 0,
|
|
398
|
+
fontWeight: 500,
|
|
399
|
+
color: "#666",
|
|
400
|
+
letterSpacing
|
|
401
|
+
}
|
|
402
|
+
}, capitalizeFirstLetter(sponsor.plan)));
|
|
387
403
|
}
|
|
388
404
|
function getLabelIcon(sponsor) {
|
|
389
405
|
let medalSrc;
|
|
390
406
|
if (sponsor.plan === "platinum") {
|
|
391
|
-
return /* @__PURE__ */ React9.createElement(Emoji, {
|
|
407
|
+
return /* @__PURE__ */ React9.createElement(Emoji, {
|
|
408
|
+
name: "trophy",
|
|
409
|
+
style: { fontSize: "1.3em" }
|
|
410
|
+
});
|
|
392
411
|
} else if (sponsor.plan === "gold") {
|
|
393
412
|
medalSrc = medalGold_default;
|
|
394
413
|
} else if (sponsor.plan === "silver") {
|
|
@@ -398,7 +417,10 @@ function getLabelIcon(sponsor) {
|
|
|
398
417
|
} else {
|
|
399
418
|
assert(false);
|
|
400
419
|
}
|
|
401
|
-
return /* @__PURE__ */ React9.createElement("img", {
|
|
420
|
+
return /* @__PURE__ */ React9.createElement("img", {
|
|
421
|
+
src: medalSrc,
|
|
422
|
+
style: { height: 15, zIndex: 1, marginRight: 5 }
|
|
423
|
+
});
|
|
402
424
|
}
|
|
403
425
|
function getSize(plan) {
|
|
404
426
|
if (plan === "platinum") {
|
|
@@ -435,7 +457,9 @@ function CodeBlock({ children, lineBreak }) {
|
|
|
435
457
|
paddingRight: "16px !important"
|
|
436
458
|
});
|
|
437
459
|
}
|
|
438
|
-
return /* @__PURE__ */ React10.createElement("pre", null, /* @__PURE__ */ React10.createElement("code", {
|
|
460
|
+
return /* @__PURE__ */ React10.createElement("pre", null, /* @__PURE__ */ React10.createElement("code", {
|
|
461
|
+
style
|
|
462
|
+
}, children));
|
|
439
463
|
}
|
|
440
464
|
export {
|
|
441
465
|
CodeBlock,
|