@brillout/docpress 0.1.13 → 0.1.15
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-V7ZWIKEX.js → chunk-J7PKG3ZA.js} +38 -15
- package/dist/chunk-J7PKG3ZA.js.map +1 -0
- package/dist/{devServer-6O6KCRPG.js → devServer-RUTLBMIJ.js} +2 -5
- package/dist/{devServer-6O6KCRPG.js.map → devServer-RUTLBMIJ.js.map} +1 -1
- package/dist/index.d.ts +0 -136
- package/dist/index.js +27 -484
- package/dist/index.js.map +1 -1
- package/package.json +8 -11
- package/src/MobileHeader.tsx +68 -0
- package/src/PageLayout.css +41 -0
- package/src/PageLayout.tsx +37 -0
- package/src/algolia/DocSearch.css +29 -0
- package/src/algolia/DocSearch.ts +37 -0
- package/src/autoScrollNav.ts +22 -0
- package/src/cli/devServer.ts +31 -0
- package/src/cli/index.ts +29 -0
- package/src/components/CodeBlock.tsx +22 -0
- package/src/components/DocLink.tsx +108 -0
- package/src/components/EditPageNote.tsx +18 -0
- package/src/components/HorizontalLine.tsx +20 -0
- package/src/components/ImportMeta.tsx +11 -0
- package/src/components/Info.tsx +12 -0
- package/src/components/Link.tsx +18 -0
- package/src/components/Note.tsx +31 -0
- package/src/components/P.css +8 -0
- package/src/components/P.tsx +8 -0
- package/src/components/ReadingRecommendation.tsx +53 -0
- package/src/components/RepoLink.tsx +24 -0
- package/src/components/Sponsors/companyLogos/ccoli-logo.svg +1 -0
- package/src/components/Sponsors/companyLogos/ccoli-text.svg +1 -0
- package/{dist/ccoli-CHW3TQKS.svg → src/components/Sponsors/companyLogos/ccoli.svg} +0 -0
- package/{dist/contra-WLZBOPBV.svg → src/components/Sponsors/companyLogos/contra.svg} +0 -0
- package/{dist/mfqs-2EAEE7N6.svg → src/components/Sponsors/companyLogos/mfqs.svg} +0 -0
- package/src/components/Sponsors/label.draft.svg +108 -0
- package/{dist/label-MP75CTIA.svg → src/components/Sponsors/label.svg} +0 -0
- package/{dist/medalBronze-CO4CTUR4.svg → src/components/Sponsors/medalBronze.svg} +0 -0
- package/{dist/medalGold-UP6A73FL.svg → src/components/Sponsors/medalGold.svg} +0 -0
- package/{dist/medalSilver-FAPGGOBN.svg → src/components/Sponsors/medalSilver.svg} +0 -0
- package/src/components/Sponsors.tsx +242 -0
- package/{dist → src}/components/features/FeatureList.css +7 -2
- package/src/components/features/FeatureList.tsx +114 -0
- package/{dist/chevron-R2IYJD62.svg → src/components/features/chevron.svg} +0 -0
- package/src/components/features/initFeatureList.ts +66 -0
- package/src/components/index.ts +13 -0
- package/src/config/Config.ts +30 -0
- package/src/config/getConfig.ts +18 -0
- package/src/config/resolveConfig/resolveHeading.ts +0 -0
- package/src/config/resolvePageContext.ts +157 -0
- package/{dist/Inter-Var-IOAEQULN.ttf → src/css/Inter-Var.ttf} +0 -0
- package/src/css/button.css +7 -0
- package/src/css/code/block.css +36 -0
- package/src/css/code/inline.css +27 -0
- package/src/css/code.css +20 -0
- package/src/css/colorize-on-hover.css +29 -0
- package/src/css/font.css +19 -0
- package/src/css/heading.css +25 -0
- package/src/css/index.css +11 -0
- package/src/css/link.css +17 -0
- package/src/css/note.css +26 -0
- package/src/css/reset.css +12 -0
- package/src/css/table.css +14 -0
- package/src/css/tooltip.css +11 -0
- package/src/headings.ts +200 -0
- package/{dist/changelog-IPI5F42D.svg → src/icons/changelog.svg} +0 -0
- package/{dist/discord-JD33TUSF.svg → src/icons/discord.svg} +0 -0
- package/{dist/github-P5ZSKN2N.svg → src/icons/github.svg} +0 -0
- package/{dist/heart-OINVKOXO.svg → src/icons/heart.svg} +0 -0
- package/{dist/twitter-I7DXDN3J.svg → src/icons/twitter.svg} +0 -0
- package/src/index.ts +3 -0
- package/src/installSectionUrlHashs.ts +50 -0
- package/src/markdownHeadingsVitePlugin.ts +128 -0
- package/src/navigation/Navigation-highlight.css +41 -0
- package/src/navigation/Navigation-items.css +122 -0
- package/src/navigation/Navigation-layout.css +118 -0
- package/src/navigation/Navigation.client.old.ts +303 -0
- package/src/navigation/Navigation.client.ts +19 -0
- package/src/navigation/Navigation.css +12 -0
- package/src/navigation/Navigation.tsx +228 -0
- package/src/navigation/NavigationHeader.tsx +97 -0
- package/src/navigation/navigation-fullscreen/NavigationFullscreenButton.css +32 -0
- package/src/navigation/navigation-fullscreen/NavigationFullscreenButton.tsx +44 -0
- package/{dist/chevron-K3WPYLOP.svg → src/navigation/navigation-fullscreen/chevron.svg} +0 -0
- package/{dist/close-IQXTDOHV.svg → src/navigation/navigation-fullscreen/close.svg} +0 -0
- package/src/navigation/navigation-fullscreen/initNavigationFullscreen.ts +115 -0
- package/src/parseEmojis.ts +33 -0
- package/src/renderer/_default.page.client.ts +4 -0
- package/src/renderer/_default.page.server.tsx +69 -0
- package/src/renderer/usePageContext.tsx +25 -0
- package/src/types.ts +2 -0
- package/src/utils/Emoji/Emoji.ts +216 -0
- package/src/utils/Emoji/assets.ts +9 -0
- package/{dist/compass-2RWQU3E4.svg → src/utils/Emoji/compass.svg} +0 -0
- package/{dist/engine-6Q6VSCVA.png → src/utils/Emoji/engine.png} +0 -0
- package/src/utils/Emoji/index.ts +1 -0
- package/{dist/mechanical-arm-TR7IQQMG.svg → src/utils/Emoji/mechanical-arm.svg} +0 -0
- package/src/utils/Emoji/mountain.svg +1 -0
- package/{dist/road-fork-3WZLW3HB.svg → src/utils/Emoji/road-fork.svg} +0 -0
- package/{dist/shield-CU45RG5C.svg → src/utils/Emoji/shield.svg} +0 -0
- package/{dist/typescript-ALIPKLRM.svg → src/utils/Emoji/typescript.svg} +0 -0
- package/src/utils/assert.ts +39 -0
- package/src/utils/client.ts +2 -0
- package/src/utils/crawlAllFiles.ts +17 -0
- package/src/utils/determineSectionUrlHash.ts +35 -0
- package/src/utils/filesystemPathHandling.ts +42 -0
- package/src/utils/filter.ts +12 -0
- package/src/utils/isBrowser.ts +5 -0
- package/src/utils/jsxToTextContent.ts +11 -0
- package/src/utils/objectAssign.ts +9 -0
- package/src/utils/server.ts +8 -0
- package/src/vite.config.ts +52 -0
- package/dist/chunk-G2A5MZJA.js +0 -48
- package/dist/chunk-G2A5MZJA.js.map +0 -1
- package/dist/chunk-M7LTQJLV.js +0 -178
- package/dist/chunk-M7LTQJLV.js.map +0 -1
- package/dist/chunk-OEVBWUR6.js +0 -92
- package/dist/chunk-OEVBWUR6.js.map +0 -1
- package/dist/chunk-P6M6A4HU.js +0 -154
- package/dist/chunk-P6M6A4HU.js.map +0 -1
- package/dist/chunk-TTLAZ2T2.js +0 -8
- package/dist/chunk-TTLAZ2T2.js.map +0 -1
- package/dist/chunk-V7ZWIKEX.js.map +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +0 -35
- package/dist/cli/index.js.map +0 -1
- package/dist/components/features/FeatureList.css.map +0 -1
- package/dist/components/features/FeatureList.d.ts +0 -13
- package/dist/components/features/FeatureList.js +0 -8
- package/dist/components/features/FeatureList.js.map +0 -1
- package/dist/components/features/initFeatureList.d.ts +0 -3
- package/dist/components/features/initFeatureList.js +0 -60
- package/dist/components/features/initFeatureList.js.map +0 -1
- package/dist/index.css +0 -121
- package/dist/index.css.map +0 -1
- package/dist/renderer/_default.page.client.css +0 -263
- package/dist/renderer/_default.page.client.css.map +0 -1
- package/dist/renderer/_default.page.client.d.ts +0 -1
- package/dist/renderer/_default.page.client.js +0 -180
- package/dist/renderer/_default.page.client.js.map +0 -1
- package/dist/renderer/_default.page.server.css +0 -312
- package/dist/renderer/_default.page.server.css.map +0 -1
- package/dist/renderer/_default.page.server.d.ts +0 -22
- package/dist/renderer/_default.page.server.js +0 -602
- package/dist/renderer/_default.page.server.js.map +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
6
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
7
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
8
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
11
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
12
|
+
width="210mm"
|
|
13
|
+
height="297mm"
|
|
14
|
+
viewBox="0 0 210 297"
|
|
15
|
+
version="1.1"
|
|
16
|
+
id="svg8"
|
|
17
|
+
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
|
18
|
+
sodipodi:docname="label.draft.svg">
|
|
19
|
+
<defs
|
|
20
|
+
id="defs2" />
|
|
21
|
+
<sodipodi:namedview
|
|
22
|
+
id="base"
|
|
23
|
+
pagecolor="#ffffff"
|
|
24
|
+
bordercolor="#666666"
|
|
25
|
+
borderopacity="1.0"
|
|
26
|
+
inkscape:pageopacity="0.0"
|
|
27
|
+
inkscape:pageshadow="2"
|
|
28
|
+
inkscape:zoom="0.9899495"
|
|
29
|
+
inkscape:cx="461.6406"
|
|
30
|
+
inkscape:cy="96.846632"
|
|
31
|
+
inkscape:document-units="mm"
|
|
32
|
+
inkscape:current-layer="layer1"
|
|
33
|
+
showgrid="false"
|
|
34
|
+
inkscape:window-width="1366"
|
|
35
|
+
inkscape:window-height="736"
|
|
36
|
+
inkscape:window-x="0"
|
|
37
|
+
inkscape:window-y="16"
|
|
38
|
+
inkscape:window-maximized="1" />
|
|
39
|
+
<metadata
|
|
40
|
+
id="metadata5">
|
|
41
|
+
<rdf:RDF>
|
|
42
|
+
<cc:Work
|
|
43
|
+
rdf:about="">
|
|
44
|
+
<dc:format>image/svg+xml</dc:format>
|
|
45
|
+
<dc:type
|
|
46
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
47
|
+
<dc:title></dc:title>
|
|
48
|
+
</cc:Work>
|
|
49
|
+
</rdf:RDF>
|
|
50
|
+
</metadata>
|
|
51
|
+
<g
|
|
52
|
+
inkscape:label="Layer 1"
|
|
53
|
+
inkscape:groupmode="layer"
|
|
54
|
+
id="layer1">
|
|
55
|
+
<path
|
|
56
|
+
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
57
|
+
d="m 51.40476,117.83928 13.530744,-23.435929 0.01098,0.0063 v 0"
|
|
58
|
+
id="path815"
|
|
59
|
+
inkscape:connector-curvature="0" />
|
|
60
|
+
<path
|
|
61
|
+
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
62
|
+
d="M 78.309972,119.26576 90.337099,96.280583 h 32.339611"
|
|
63
|
+
id="path817"
|
|
64
|
+
inkscape:connector-curvature="0"
|
|
65
|
+
sodipodi:nodetypes="ccc" />
|
|
66
|
+
<path
|
|
67
|
+
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
68
|
+
d="M 71.815475,146.56548 H 85.96596 c 0.676332,-0.0209 3.30147,-0.005 3.934153,-0.83721 0.426501,-0.36462 1.272256,-1.92024 1.602106,-2.49156 l 4.177131,-7.23501 c 0,0 0.679705,-1.34341 1.817605,-2.11076 0.472523,-0.30451 3.063205,-0.4009 3.063205,-0.4009 h 13.21067"
|
|
69
|
+
id="path819"
|
|
70
|
+
inkscape:connector-curvature="0"
|
|
71
|
+
sodipodi:nodetypes="cccccccc" />
|
|
72
|
+
<path
|
|
73
|
+
sodipodi:nodetypes="cccccccc"
|
|
74
|
+
inkscape:connector-curvature="0"
|
|
75
|
+
id="path859"
|
|
76
|
+
d="m 145.52085,146.56548 h -14.15049 c -0.67633,-0.0209 -3.30147,-0.005 -3.93415,-0.83721 -0.4265,-0.36462 -1.27226,-1.92024 -1.60211,-2.49156 l -4.17713,-7.23501 c 0,0 -0.67971,-1.34341 -1.81761,-2.11076 -0.47252,-0.30451 -3.0632,-0.4009 -3.0632,-0.4009 h -13.21068"
|
|
77
|
+
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
|
78
|
+
<path
|
|
79
|
+
sodipodi:nodetypes="ccccccccc"
|
|
80
|
+
inkscape:connector-curvature="0"
|
|
81
|
+
id="path967"
|
|
82
|
+
d="m 118.49554,172.57638 -47.05804,0 h 10.748698 c 0.676332,-0.0209 3.30147,-0.005 3.934153,-0.83721 0.426501,-0.36462 1.272256,-1.92024 1.602106,-2.49156 l 4.177131,-7.23501 c 0,0 0.679705,-1.34341 1.817605,-2.11076 0.472523,-0.30451 3.063205,-0.4009 3.063205,-0.4009 l 22.282102,0"
|
|
83
|
+
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
|
84
|
+
<path
|
|
85
|
+
style="fill:#f0f0f0;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
|
|
86
|
+
d="M 365.78516 702.83789 C 365.78516 702.83789 355.99294 703.20261 354.20703 704.35352 C 349.90631 707.25374 347.33789 712.33203 347.33789 712.33203 L 331.54883 739.67578 C 330.30215 741.8351 327.10611 747.71566 325.49414 749.09375 C 323.1029 752.23911 313.18122 752.17882 310.625 752.25781 L 392.14258 752.25781 L 447.85742 752.25781 L 529.375 752.25781 C 526.81879 752.17882 516.89709 752.23911 514.50586 749.09375 C 512.89389 747.71566 509.69785 741.8351 508.45117 739.67578 L 492.66211 712.33203 C 492.66211 712.33203 490.09369 707.25374 485.79297 704.35352 C 484.00707 703.20261 474.2168 702.83789 474.2168 702.83789 L 450 702.83789 L 390 702.83789 L 365.78516 702.83789 z "
|
|
87
|
+
transform="scale(0.26458333)"
|
|
88
|
+
id="path977" />
|
|
89
|
+
<path
|
|
90
|
+
id="path982"
|
|
91
|
+
d="m 96.780656,212.41754 c 0,0 -2.590858,0.0965 -3.06338,0.40101 -1.137899,0.76735 -1.81746,2.11098 -1.81746,2.11098 l -4.177523,7.2347 c -0.32985,0.57132 -1.175469,2.12722 -1.60197,2.49184 -0.632682,0.83221 -3.257793,0.81625 -3.934126,0.83715 h 21.568193 30.61622 21.56819 c -0.67633,-0.0209 -3.30145,-0.005 -3.93413,-0.83715 -0.4265,-0.36462 -1.27212,-1.92052 -1.60197,-2.49184 l -4.17752,-7.2347 c 0,0 -0.67956,-1.34363 -1.81746,-2.11098 -0.47252,-0.30452 -3.06286,-0.40101 -3.06286,-0.40101 h -6.40736 -31.75 z"
|
|
92
|
+
style="fill:#f0f0f0;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
93
|
+
inkscape:connector-curvature="0"
|
|
94
|
+
sodipodi:nodetypes="ccccccccccccccccc" />
|
|
95
|
+
<path
|
|
96
|
+
sodipodi:nodetypes="ccccccccccccccccc"
|
|
97
|
+
inkscape:connector-curvature="0"
|
|
98
|
+
style="fill:#f0f0f0;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
99
|
+
d="m 96.780656,244.16756 c 0,0 -2.590858,0.0965 -3.06338,0.40101 -1.137899,0.76735 -1.81746,2.11098 -1.81746,2.11098 l -4.177523,7.2347 c -0.32985,0.57132 -1.175469,2.12722 -1.60197,2.49184 -0.632682,0.83221 -3.257793,0.81625 -3.934126,0.83715 h 21.568193 25.32455 21.56819 c -0.67633,-0.0209 -3.30145,-0.005 -3.93413,-0.83715 -0.4265,-0.36462 -1.27212,-1.92052 -1.60197,-2.49184 l -4.17752,-7.2347 c 0,0 -0.67956,-1.34363 -1.81746,-2.11098 -0.47252,-0.30452 -3.06286,-0.40101 -3.06286,-0.40101 h -6.40736 -26.45833 z"
|
|
100
|
+
id="path984" />
|
|
101
|
+
<path
|
|
102
|
+
id="path878"
|
|
103
|
+
d="m 103.72033,265.33423 c 0,0 -2.25707,0.0965 -2.66872,0.40101 -0.9913,0.76735 -1.583315,2.11098 -1.583315,2.11098 l -3.639329,7.2347 c -0.287355,0.57132 -1.024032,2.12722 -1.395586,2.49184 -0.551173,0.83221 -2.838088,0.81625 -3.427289,0.83715 h 18.789539 22.06196 18.78954 c -0.5892,-0.0209 -2.87612,-0.005 -3.42729,-0.83715 -0.37156,-0.36462 -1.10823,-1.92052 -1.39559,-2.49184 l -3.63932,-7.2347 c 0,0 -0.59202,-1.34363 -1.58332,-2.11098 -0.41164,-0.30452 -2.66827,-0.40101 -2.66827,-0.40101 h -5.58189 -23.04968 z"
|
|
104
|
+
style="fill:#f0f0f0;fill-opacity:1;stroke:none;stroke-width:0.24695262px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
105
|
+
inkscape:connector-curvature="0"
|
|
106
|
+
sodipodi:nodetypes="ccccccccccccccccc" />
|
|
107
|
+
</g>
|
|
108
|
+
</svg>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import iconHeart from '../icons/heart.svg'
|
|
3
|
+
import { usePageContext } from '../renderer/usePageContext'
|
|
4
|
+
import { assert, Emoji } from '../utils/server'
|
|
5
|
+
import ccoliLogo from './Sponsors/companyLogos/ccoli.svg'
|
|
6
|
+
import contraLogo from './Sponsors/companyLogos/contra.svg'
|
|
7
|
+
import mfqsLogo from './Sponsors/companyLogos/mfqs.svg'
|
|
8
|
+
import medalGold from './Sponsors/medalGold.svg'
|
|
9
|
+
import medalSilver from './Sponsors/medalSilver.svg'
|
|
10
|
+
import medalBronze from './Sponsors/medalBronze.svg'
|
|
11
|
+
import labelBgImg from './Sponsors/label.svg'
|
|
12
|
+
|
|
13
|
+
export { Sponsors }
|
|
14
|
+
|
|
15
|
+
type Plan = 'FREE_SLOT' | 'bronze' | 'silver' | 'gold' | 'platinum'
|
|
16
|
+
|
|
17
|
+
type SponsorCompany = {
|
|
18
|
+
companyName: string
|
|
19
|
+
companyLogo: string
|
|
20
|
+
website: string
|
|
21
|
+
plan: Plan
|
|
22
|
+
}
|
|
23
|
+
type SponsorIndividual = {
|
|
24
|
+
username: string
|
|
25
|
+
}
|
|
26
|
+
type Sponsor = SponsorCompany | SponsorIndividual
|
|
27
|
+
|
|
28
|
+
const sponsors: Sponsor[] = [
|
|
29
|
+
{
|
|
30
|
+
companyName: 'Contra',
|
|
31
|
+
companyLogo: contraLogo,
|
|
32
|
+
plan: 'gold',
|
|
33
|
+
website: 'https://contra.com'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
companyName: 'ccoli',
|
|
37
|
+
companyLogo: ccoliLogo,
|
|
38
|
+
plan: 'silver',
|
|
39
|
+
website: 'https://ccoli.co'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
companyName: 'My Favorite Quilt Store',
|
|
43
|
+
companyLogo: mfqsLogo,
|
|
44
|
+
plan: 'bronze',
|
|
45
|
+
website: 'https://myfavoritequiltstore.com'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
username: 'spacedawwwg'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
username: 'codthing'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
username: 'Junaidhkn'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
username: 'zgfdev'
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
function Sponsors() {
|
|
62
|
+
const pageContext = usePageContext()
|
|
63
|
+
const { projectInfo } = pageContext.config
|
|
64
|
+
return (
|
|
65
|
+
<div style={{ textAlign: 'center', marginTop: 19 }}>
|
|
66
|
+
<a
|
|
67
|
+
className="button"
|
|
68
|
+
href="https://github.com/sponsors/brillout"
|
|
69
|
+
style={{
|
|
70
|
+
color: 'inherit',
|
|
71
|
+
display: 'inline-flex',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
padding: '5px 10px',
|
|
74
|
+
marginBottom: 10
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
77
|
+
<img src={iconHeart} height={22} /> <span style={{ marginLeft: 7, fontSize: '1.07em' }}>Sponsor</span>
|
|
78
|
+
</a>
|
|
79
|
+
<div></div>
|
|
80
|
+
<div style={{ maxWidth: 400, display: 'inline-block', marginTop: 12, marginBottom: 12 }}>
|
|
81
|
+
{projectInfo.projectNameJsx || projectInfo.projectName} is free and open source, made possible by wonderful
|
|
82
|
+
sponsors.
|
|
83
|
+
</div>
|
|
84
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', justifyContent: 'center', alignItems: 'end' }}>
|
|
85
|
+
{sponsors.map((sponsor, i) => (
|
|
86
|
+
<SponsorDiv sponsor={sponsor} key={i} />
|
|
87
|
+
))}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function SponsorDiv({ sponsor }: { sponsor: Sponsor }) {
|
|
94
|
+
let imgSrc: string
|
|
95
|
+
let imgAlt: string | undefined
|
|
96
|
+
let width: number
|
|
97
|
+
let height: number
|
|
98
|
+
let website: string
|
|
99
|
+
let padding: number
|
|
100
|
+
let backgroundColor = '#f0f0f0'
|
|
101
|
+
let label: null | JSX.Element = null
|
|
102
|
+
if ('username' in sponsor) {
|
|
103
|
+
website = `https://github.com/${sponsor.username}`
|
|
104
|
+
imgSrc = `https://github.com/${sponsor.username}.png?size=30`
|
|
105
|
+
width = 30
|
|
106
|
+
height = 30
|
|
107
|
+
padding = 0
|
|
108
|
+
backgroundColor = 'none'
|
|
109
|
+
} else {
|
|
110
|
+
imgSrc = sponsor.companyLogo
|
|
111
|
+
website = sponsor.website
|
|
112
|
+
const size = getSize(sponsor.plan)
|
|
113
|
+
width = size.width
|
|
114
|
+
height = size.height
|
|
115
|
+
padding = size.padding
|
|
116
|
+
imgAlt = sponsor.companyName
|
|
117
|
+
label = <Label sponsor={sponsor} />
|
|
118
|
+
}
|
|
119
|
+
const marginWidth = 5
|
|
120
|
+
return (
|
|
121
|
+
<a
|
|
122
|
+
href={website}
|
|
123
|
+
style={{
|
|
124
|
+
margin: `10px ${marginWidth}px`
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
{label}
|
|
128
|
+
<div
|
|
129
|
+
style={{
|
|
130
|
+
backgroundColor,
|
|
131
|
+
borderRadius: 7,
|
|
132
|
+
overflow: 'hidden',
|
|
133
|
+
width,
|
|
134
|
+
maxWidth: `calc(100vw - 2 * var(--main-view-padding) - 2 * ${marginWidth}px)`,
|
|
135
|
+
height,
|
|
136
|
+
display: 'flex',
|
|
137
|
+
alignItems: 'center',
|
|
138
|
+
flexDirection: 'column',
|
|
139
|
+
justifyContent: 'center'
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
<img
|
|
143
|
+
style={{ width: `calc(100% - ${padding}px)`, height: height - padding, zIndex: 2 }}
|
|
144
|
+
src={imgSrc}
|
|
145
|
+
alt={imgAlt}
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
</a>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function Label({ sponsor }: { sponsor: Sponsor }) {
|
|
153
|
+
assert(!('username' in sponsor))
|
|
154
|
+
const labelBg = getLabelBg(sponsor)
|
|
155
|
+
const labelIcon = getLabelIcon(sponsor)
|
|
156
|
+
const labelText = getLabelText(sponsor)
|
|
157
|
+
return (
|
|
158
|
+
<div
|
|
159
|
+
style={{
|
|
160
|
+
top: 0,
|
|
161
|
+
display: 'flex',
|
|
162
|
+
justifyContent: 'center',
|
|
163
|
+
alignItems: 'center',
|
|
164
|
+
position: 'relative',
|
|
165
|
+
paddingBottom: 1
|
|
166
|
+
}}
|
|
167
|
+
>
|
|
168
|
+
{labelBg}
|
|
169
|
+
{labelIcon}
|
|
170
|
+
{labelText}
|
|
171
|
+
</div>
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function getLabelBg(sponsor: SponsorCompany) {
|
|
176
|
+
const height = sponsor.plan === 'platinum' ? 32 : 24
|
|
177
|
+
return <img src={labelBgImg} style={{ height, position: 'absolute', bottom: 0, zIndex: -1 }} />
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function getLabelText(sponsor: SponsorCompany) {
|
|
181
|
+
if (sponsor.plan === 'platinum') {
|
|
182
|
+
return <></>
|
|
183
|
+
}
|
|
184
|
+
const letterSpacing = ['bronze', 'silver', 'gold'].includes(sponsor.plan) ? 1 : undefined
|
|
185
|
+
return (
|
|
186
|
+
<>
|
|
187
|
+
{' '}
|
|
188
|
+
<span
|
|
189
|
+
style={{
|
|
190
|
+
zIndex: 1,
|
|
191
|
+
fontSize: '0.82em',
|
|
192
|
+
position: 'relative',
|
|
193
|
+
top: 0,
|
|
194
|
+
fontWeight: 500,
|
|
195
|
+
color: '#666',
|
|
196
|
+
letterSpacing
|
|
197
|
+
}}
|
|
198
|
+
>
|
|
199
|
+
{capitalizeFirstLetter(sponsor.plan)}
|
|
200
|
+
</span>
|
|
201
|
+
</>
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function getLabelIcon(sponsor: SponsorCompany) {
|
|
206
|
+
let medalSrc: string
|
|
207
|
+
if (sponsor.plan === 'platinum') {
|
|
208
|
+
return <Emoji name="trophy" style={{ fontSize: '1.3em' }} />
|
|
209
|
+
} else if (sponsor.plan === 'gold') {
|
|
210
|
+
medalSrc = medalGold
|
|
211
|
+
} else if (sponsor.plan === 'silver') {
|
|
212
|
+
medalSrc = medalSilver
|
|
213
|
+
} else if (sponsor.plan === 'bronze') {
|
|
214
|
+
medalSrc = medalBronze
|
|
215
|
+
} else {
|
|
216
|
+
assert(false)
|
|
217
|
+
}
|
|
218
|
+
return <img src={medalSrc} style={{ height: 15, zIndex: 1, marginRight: 5 }} />
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function getSize(plan: Plan) {
|
|
222
|
+
if (plan === 'platinum') {
|
|
223
|
+
assert(false)
|
|
224
|
+
}
|
|
225
|
+
if (plan === 'gold') {
|
|
226
|
+
return { width: 400, height: 150, padding: 95 }
|
|
227
|
+
}
|
|
228
|
+
if (plan === 'silver') {
|
|
229
|
+
return { width: 300, height: 100, padding: 45 }
|
|
230
|
+
}
|
|
231
|
+
if (plan === 'bronze') {
|
|
232
|
+
return { width: 200, height: 70, padding: 30 }
|
|
233
|
+
}
|
|
234
|
+
if (plan === 'FREE_SLOT') {
|
|
235
|
+
return { width: 150, height: 40, padding: 15 }
|
|
236
|
+
}
|
|
237
|
+
assert(false)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function capitalizeFirstLetter(word: string): string {
|
|
241
|
+
return word[0].toUpperCase() + word.slice(1)
|
|
242
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* src/components/features/FeatureList.css */
|
|
2
1
|
@media screen and (min-width: 840px) {
|
|
3
2
|
.features-row {
|
|
4
3
|
display: grid;
|
|
@@ -17,6 +16,7 @@
|
|
|
17
16
|
grid-column: 1 / 3;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
19
|
+
|
|
20
20
|
@media screen and (min-width: 840px) {
|
|
21
21
|
.features-row.single-column .feature {
|
|
22
22
|
grid-column: 1 / span 2 !important;
|
|
@@ -25,11 +25,13 @@
|
|
|
25
25
|
margin: auto !important;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
|
|
28
29
|
#features {
|
|
29
30
|
margin: auto;
|
|
30
31
|
margin-top: 0;
|
|
31
32
|
max-width: 1080px;
|
|
32
33
|
}
|
|
34
|
+
|
|
33
35
|
#features summary p {
|
|
34
36
|
margin: 10px 0;
|
|
35
37
|
}
|
|
@@ -44,6 +46,7 @@
|
|
|
44
46
|
.learn-more h3:first-of-type {
|
|
45
47
|
margin-top: 15px;
|
|
46
48
|
}
|
|
49
|
+
|
|
47
50
|
.learn-more {
|
|
48
51
|
border: var(--border-width) solid var(--border-color);
|
|
49
52
|
padding: 10px 8px;
|
|
@@ -95,6 +98,8 @@ aside.learn-more.right-side {
|
|
|
95
98
|
border-bottom: 0 !important;
|
|
96
99
|
z-index: 1;
|
|
97
100
|
}
|
|
101
|
+
|
|
102
|
+
/* Hide top border of .learn-more */
|
|
98
103
|
.learn-more {
|
|
99
104
|
position: relative;
|
|
100
105
|
top: calc(-1 * var(--border-width));
|
|
@@ -103,10 +108,10 @@ aside.learn-more.right-side {
|
|
|
103
108
|
position: relative;
|
|
104
109
|
z-index: 1;
|
|
105
110
|
}
|
|
111
|
+
|
|
106
112
|
.feature .chevron {
|
|
107
113
|
transition: filter 0.3s ease-in-out, transform 0.3s ease-in-out !important;
|
|
108
114
|
}
|
|
109
115
|
.feature.selected .chevron {
|
|
110
116
|
transform: rotate(180deg);
|
|
111
117
|
}
|
|
112
|
-
/*# sourceMappingURL=FeatureList.css.map */
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import './FeatureList.css'
|
|
3
|
+
import iconChevron from './chevron.svg'
|
|
4
|
+
|
|
5
|
+
export { FeatureList }
|
|
6
|
+
|
|
7
|
+
type FeatureProps = {
|
|
8
|
+
title: React.ReactNode
|
|
9
|
+
desc: React.ReactNode
|
|
10
|
+
learnMore?: React.ReactNode
|
|
11
|
+
isSecondaryFeature?: true
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function FeatureList({ features }: { features: FeatureProps[] }) {
|
|
15
|
+
const numberOfFeatures = features.length
|
|
16
|
+
const numberOfRows = Math.ceil(numberOfFeatures / 2)
|
|
17
|
+
return (
|
|
18
|
+
<div id="features">
|
|
19
|
+
{Array.from({ length: numberOfRows }, (_, i) => {
|
|
20
|
+
const feature1Id = 2 * i + 0
|
|
21
|
+
const feature2Id = 2 * i + 1
|
|
22
|
+
const feature1 = features[feature1Id]
|
|
23
|
+
const feature2 = features[feature2Id]
|
|
24
|
+
const className = ['features-row', feature2 ? '' : 'single-column'].filter(Boolean).join(' ')
|
|
25
|
+
return (
|
|
26
|
+
<div className={className} key={i}>
|
|
27
|
+
<Feature {...{ ...feature1, featureId: feature1Id }} />
|
|
28
|
+
{feature2 && <Feature {...{ ...feature2, featureId: feature2Id }} />}
|
|
29
|
+
</div>
|
|
30
|
+
)
|
|
31
|
+
})}
|
|
32
|
+
</div>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function Feature({ title, desc, learnMore, isSecondaryFeature, featureId }: FeatureProps & { featureId: number }) {
|
|
37
|
+
const name = `feature-${featureId}`
|
|
38
|
+
const rightSide = featureId % 2 === 1
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<FeatureHead name={name} hasLearnMore={!!learnMore} isSecondaryFeature={isSecondaryFeature}>
|
|
42
|
+
{' '}
|
|
43
|
+
<h2>{title}</h2>
|
|
44
|
+
{desc}
|
|
45
|
+
</FeatureHead>
|
|
46
|
+
{!!learnMore && (
|
|
47
|
+
<LearnMore name={name} rightSide={rightSide}>
|
|
48
|
+
{learnMore}
|
|
49
|
+
</LearnMore>
|
|
50
|
+
)}
|
|
51
|
+
</>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function FeatureHead({
|
|
56
|
+
children,
|
|
57
|
+
name,
|
|
58
|
+
hasLearnMore,
|
|
59
|
+
isSecondaryFeature,
|
|
60
|
+
className = ''
|
|
61
|
+
}: {
|
|
62
|
+
className?: string
|
|
63
|
+
name?: string
|
|
64
|
+
hasLearnMore?: boolean
|
|
65
|
+
isSecondaryFeature?: true
|
|
66
|
+
children: any
|
|
67
|
+
}) {
|
|
68
|
+
return (
|
|
69
|
+
<summary
|
|
70
|
+
className={[
|
|
71
|
+
className,
|
|
72
|
+
'feature',
|
|
73
|
+
'colorize-on-hover',
|
|
74
|
+
hasLearnMore && 'has-learn-more',
|
|
75
|
+
isSecondaryFeature && 'secondary-feature'
|
|
76
|
+
]
|
|
77
|
+
.filter(Boolean)
|
|
78
|
+
.join(' ')}
|
|
79
|
+
id={name && `feature-${name}`}
|
|
80
|
+
style={{ cursor: (hasLearnMore && 'pointer') || undefined }}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
{hasLearnMore && (
|
|
84
|
+
<div style={{ textAlign: 'center', marginTop: '1em' }}>
|
|
85
|
+
<button
|
|
86
|
+
type="button"
|
|
87
|
+
style={{
|
|
88
|
+
textAlign: 'center',
|
|
89
|
+
padding: '0 7px',
|
|
90
|
+
paddingTop: 3,
|
|
91
|
+
paddingBottom: 1,
|
|
92
|
+
display: 'inline-block',
|
|
93
|
+
fontSize: '10px',
|
|
94
|
+
textTransform: 'uppercase',
|
|
95
|
+
letterSpacing: '1px',
|
|
96
|
+
fontWeight: 600
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
<span className="decolorize-5">Learn more</span>
|
|
100
|
+
<br />
|
|
101
|
+
<img className="decolorize-4 chevron" src={iconChevron} height="7" style={{ marginTop: 2 }} />
|
|
102
|
+
</button>
|
|
103
|
+
</div>
|
|
104
|
+
)}
|
|
105
|
+
</summary>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
function LearnMore({ children, name, rightSide }: { name: string; children: any; rightSide: boolean }) {
|
|
109
|
+
return (
|
|
110
|
+
<aside className={'learn-more ' + (rightSide ? 'right-side' : '')} id={`learn-more-${name}`}>
|
|
111
|
+
{children}
|
|
112
|
+
</aside>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { assert } from '../../utils/client'
|
|
2
|
+
|
|
3
|
+
addTwitterWidgets()
|
|
4
|
+
addFeatureClickHandlers()
|
|
5
|
+
window.__docpress_hydrationFinished = true
|
|
6
|
+
|
|
7
|
+
function addTwitterWidgets() {
|
|
8
|
+
loadScript('https://platform.twitter.com/widgets.js')
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function addFeatureClickHandlers() {
|
|
12
|
+
const featureEls: HTMLElement[] = Array.from(
|
|
13
|
+
document.getElementById('features')!.querySelectorAll('.feature.has-learn-more')
|
|
14
|
+
)
|
|
15
|
+
featureEls.forEach((featureEl) => {
|
|
16
|
+
featureEl.onclick = () => {
|
|
17
|
+
expandLearnMore(featureEl)
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function expandLearnMore(featureEl: HTMLElement) {
|
|
23
|
+
const featureId = featureEl.id
|
|
24
|
+
assert(featureId.startsWith('feature-'), { featureId })
|
|
25
|
+
const featureName = featureId.slice('feature-'.length)
|
|
26
|
+
|
|
27
|
+
const selectedClass = 'selected'
|
|
28
|
+
const learnId = 'learn-more-' + featureName
|
|
29
|
+
const learnEl = document.getElementById(learnId)
|
|
30
|
+
assert(learnEl, { learnId })
|
|
31
|
+
|
|
32
|
+
const isExpanded = featureEl.classList.contains(selectedClass)
|
|
33
|
+
|
|
34
|
+
if (!isExpanded) {
|
|
35
|
+
const rowEl = featureEl.parentNode as HTMLElement
|
|
36
|
+
if (getComputedStyle(rowEl, 'display') === 'grid') {
|
|
37
|
+
;[
|
|
38
|
+
...(rowEl.querySelectorAll('.learn-more') as any as HTMLElement[]),
|
|
39
|
+
...(rowEl.querySelectorAll('.feature') as any as HTMLElement[])
|
|
40
|
+
].forEach((el) => {
|
|
41
|
+
el.classList.remove(selectedClass)
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
;[featureEl, learnEl].forEach((el) => {
|
|
47
|
+
el.classList.toggle(selectedClass)
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function loadScript(scriptUrl: string): void {
|
|
52
|
+
assert(scriptUrl.startsWith('https://'))
|
|
53
|
+
const scriptEl = document.createElement('script')
|
|
54
|
+
scriptEl.src = scriptUrl
|
|
55
|
+
scriptEl.async = true
|
|
56
|
+
scriptEl.setAttribute('charset', 'utf-8')
|
|
57
|
+
document.getElementsByTagName('head')[0].appendChild(scriptEl)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function getComputedStyle(el: HTMLElement, styleProp: string) {
|
|
61
|
+
return window.document.defaultView!.getComputedStyle(el).getPropertyValue(styleProp)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare global {
|
|
65
|
+
var __docpress_hydrationFinished: undefined | true
|
|
66
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from '../utils/Emoji'
|
|
2
|
+
export * from './Link'
|
|
3
|
+
export * from './DocLink'
|
|
4
|
+
export * from './RepoLink'
|
|
5
|
+
export * from './P'
|
|
6
|
+
export * from './Info'
|
|
7
|
+
export * from './ReadingRecommendation'
|
|
8
|
+
export * from './Note'
|
|
9
|
+
export * from './ImportMeta'
|
|
10
|
+
export * from './features/FeatureList'
|
|
11
|
+
export * from './HorizontalLine'
|
|
12
|
+
export * from './Sponsors'
|
|
13
|
+
export * from './CodeBlock'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type { Config }
|
|
2
|
+
|
|
3
|
+
import type { HeadingDefinition, HeadingWithoutLink } from '../headings'
|
|
4
|
+
|
|
5
|
+
type Config = {
|
|
6
|
+
projectInfo: {
|
|
7
|
+
githubRepository: string
|
|
8
|
+
githubIssues: string
|
|
9
|
+
projectName: string
|
|
10
|
+
projectNameJsx?: JSX.Element
|
|
11
|
+
projectVersion: string
|
|
12
|
+
discordInvite: string
|
|
13
|
+
twitterProfile: string
|
|
14
|
+
}
|
|
15
|
+
faviconUrl: string
|
|
16
|
+
algolia: null | {
|
|
17
|
+
appId: string
|
|
18
|
+
apiKey: string
|
|
19
|
+
indexName: string
|
|
20
|
+
}
|
|
21
|
+
headings: HeadingDefinition[]
|
|
22
|
+
headingsWithoutLink: HeadingWithoutLink[]
|
|
23
|
+
navHeaderMobile: React.ReactNode
|
|
24
|
+
navHeader: React.ReactNode
|
|
25
|
+
titleNormalCase: boolean
|
|
26
|
+
tagline: string
|
|
27
|
+
websiteUrl: string
|
|
28
|
+
bannerUrl?: string
|
|
29
|
+
twitterHandle: string
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { getConfig }
|
|
2
|
+
import { assert, assertUsage } from '../utils/server'
|
|
3
|
+
import { Config } from './Config'
|
|
4
|
+
|
|
5
|
+
function getConfig(): Config {
|
|
6
|
+
// We use `@ts-ignore` because the DocPress user most likely didn't add `vite/client` in his `tsconfig.json`.
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
const globResult = import.meta.glob('/**/docpress.config.*([a-zA-Z0-9])', { eager: true })
|
|
9
|
+
const files = Object.keys(globResult)
|
|
10
|
+
assertUsage(files.length >= 1, 'No DocPress config file found `docpress.config.(js|ts|tsx|...)`')
|
|
11
|
+
assertUsage(
|
|
12
|
+
files.length === 1,
|
|
13
|
+
`Found multiple \`docpress.config.js\` files: ${files.map((f) => `\`${f}\``).join(', ')}. Define only one instead.`
|
|
14
|
+
)
|
|
15
|
+
const config = (Object.values(globResult)[0] as any).default as Config
|
|
16
|
+
assert(config)
|
|
17
|
+
return config
|
|
18
|
+
}
|
|
File without changes
|