@brillout/docpress 0.7.10 → 0.8.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/+config.ts +2 -10
- package/Layout.tsx +397 -67
- package/{navigation/NavigationHeader.tsx → Links.tsx} +6 -57
- package/MenuModal.tsx +146 -0
- package/autoScrollNav.ts +4 -5
- package/components/CodeBlockTransformer.tsx +0 -2
- package/components/Note.css +4 -4
- package/components/Note.tsx +0 -2
- package/components/Supporters.tsx +1 -0
- package/config/resolveHeadingsData.ts +20 -23
- package/config/resolvePageContext.ts +11 -1
- package/css/code/block.css +5 -5
- package/css/code/inline.css +1 -1
- package/css/code.css +9 -5
- package/css/index.css +0 -4
- package/css/reset.css +0 -6
- package/dist/+config.d.ts +1 -13
- package/dist/+config.js +0 -3
- package/dist/components/CodeBlockTransformer.d.ts +1 -0
- package/dist/components/CodeBlockTransformer.js +1 -0
- package/dist/components/Note.d.ts +1 -0
- package/dist/components/Note.js +1 -0
- package/dist/components/Supporters.js +1 -0
- package/dist/config/resolveHeadingsData.d.ts +5 -8
- package/dist/config/resolveHeadingsData.js +20 -22
- package/dist/config/resolvePageContext.d.ts +5 -7
- package/dist/config/resolvePageContext.js +2 -1
- package/dist/navigation/Navigation.d.ts +12 -17
- package/dist/navigation/Navigation.js +82 -74
- package/dist/renderer/getStyleColumnLayout.d.ts +7 -0
- package/dist/renderer/getStyleColumnLayout.js +183 -0
- package/dist/types/Heading.d.ts +2 -4
- package/dist/utils/client.d.ts +1 -0
- package/dist/utils/client.js +1 -0
- package/dist/utils/css.d.ts +1 -0
- package/dist/utils/css.js +27 -0
- package/dist/utils/getGlobalObject.d.ts +1 -0
- package/dist/utils/getGlobalObject.js +9 -0
- package/docsearch/DocSearchInstall.tsx +23 -0
- package/docsearch/SearchLink.tsx +48 -0
- package/docsearch/toggleDocsearchModal.ts +29 -0
- package/global.d.ts +7 -0
- package/initKeyBindings.ts +41 -0
- package/installSectionUrlHashs.ts +6 -5
- package/navigation/Navigation.css +101 -3
- package/navigation/Navigation.tsx +114 -128
- package/package.json +1 -8
- package/renderer/getPageElement.tsx +19 -7
- package/renderer/getStyleColumnLayout.ts +204 -0
- package/renderer/onRenderClient.tsx +17 -24
- package/renderer/onRenderHtml.tsx +3 -6
- package/types/Heading.ts +2 -5
- package/utils/client.ts +1 -0
- package/utils/css.ts +26 -0
- package/utils/getGlobalObject.ts +11 -0
- package/Layout.css +0 -63
- package/MobileHeader.tsx +0 -70
- package/algolia/DocSearch.css +0 -28
- package/components/FeatureList/FeatureList.client.ts +0 -60
- package/components/FeatureList/FeatureList.css +0 -119
- package/components/FeatureList/FeatureList.tsx +0 -114
- package/components/FeatureList/chevron.svg +0 -7
- package/css/block-design.css +0 -4
- package/dist/autoScrollNav.d.ts +0 -3
- package/dist/autoScrollNav.js +0 -36
- package/dist/components/Algolia/Hit.d.ts +0 -4
- package/dist/components/Algolia/Hit.js +0 -30
- package/dist/components/Algolia/SelectIcon.d.ts +0 -2
- package/dist/components/Algolia/SelectIcon.js +0 -7
- package/dist/components/Algolia/Snippet.d.ts +0 -13
- package/dist/components/Algolia/Snippet.js +0 -37
- package/dist/components/Algolia/SourceIcon.d.ts +0 -4
- package/dist/components/Algolia/SourceIcon.js +0 -23
- package/dist/components/Algolia/types.d.ts +0 -79
- package/dist/components/Algolia/types.js +0 -1
- package/dist/navigation/NavigationHeader.d.ts +0 -8
- package/dist/navigation/NavigationHeader.js +0 -75
- package/dist/navigation/navigation-fullscreen/NavigationFullscreenButton.d.ts +0 -6
- package/dist/navigation/navigation-fullscreen/NavigationFullscreenButton.js +0 -23
- package/dist/navigation/navigation-fullscreen/hotkeyLabel.d.ts +0 -1
- package/dist/navigation/navigation-fullscreen/hotkeyLabel.js +0 -1
- package/navigation/Navigation-highlight.css +0 -41
- package/navigation/Navigation-items.css +0 -116
- package/navigation/Navigation-layout.css +0 -129
- package/navigation/initMobileNavigation.ts +0 -23
- package/navigation/initPressKit.ts +0 -19
- package/navigation/navigation-fullscreen/NavigationFullscreenButton.css +0 -32
- package/navigation/navigation-fullscreen/NavigationFullscreenButton.tsx +0 -47
- package/navigation/navigation-fullscreen/chevron.svg +0 -1
- package/navigation/navigation-fullscreen/close.svg +0 -4
- package/navigation/navigation-fullscreen/hotkeyLabel.ts +0 -1
- package/navigation/navigation-fullscreen/initNavigationFullscreen.ts +0 -60
- package/renderer/getCSSForResponsiveFullcreenNavItems.ts +0 -127
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
@media screen and (min-width: 840px) {
|
|
2
|
-
.features-row {
|
|
3
|
-
display: grid;
|
|
4
|
-
grid-template-columns: repeat(2, 1fr);
|
|
5
|
-
}
|
|
6
|
-
.features-row summary:nth-of-type(1) {
|
|
7
|
-
grid-row: 1;
|
|
8
|
-
grid-column: 1 / 2;
|
|
9
|
-
}
|
|
10
|
-
.features-row summary:nth-of-type(2) {
|
|
11
|
-
grid-row: 1;
|
|
12
|
-
grid-column: 2 / 3;
|
|
13
|
-
}
|
|
14
|
-
.features-row aside {
|
|
15
|
-
grid-row: 2;
|
|
16
|
-
grid-column: 1 / 3;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@media screen and (min-width: 840px) {
|
|
21
|
-
.features-row.single-column .feature {
|
|
22
|
-
grid-column: 1 / span 2 !important;
|
|
23
|
-
width: 100% !important;
|
|
24
|
-
max-width: calc(1010px / 2) !important;
|
|
25
|
-
margin: auto !important;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
#features {
|
|
30
|
-
margin: auto;
|
|
31
|
-
margin-top: 0;
|
|
32
|
-
max-width: 1080px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
#features summary p {
|
|
36
|
-
margin: 10px 0;
|
|
37
|
-
}
|
|
38
|
-
#features h2 {
|
|
39
|
-
margin-bottom: 0.7em;
|
|
40
|
-
margin-top: 0.5em;
|
|
41
|
-
}
|
|
42
|
-
#features .secondary-feature h2 {
|
|
43
|
-
font-size: 1.1em;
|
|
44
|
-
margin-bottom: 0.7em;
|
|
45
|
-
}
|
|
46
|
-
.learn-more h3:first-of-type {
|
|
47
|
-
margin-top: 15px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.learn-more {
|
|
51
|
-
border: var(--border-width) solid var(--border-color);
|
|
52
|
-
padding: 10px 8px;
|
|
53
|
-
}
|
|
54
|
-
@media screen and (min-width: 840px) {
|
|
55
|
-
.learn-more {
|
|
56
|
-
max-width: 886px;
|
|
57
|
-
border-radius: var(--border-radius);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
aside.learn-more:not(.right-side) {
|
|
61
|
-
border-top-left-radius: 0;
|
|
62
|
-
}
|
|
63
|
-
aside.learn-more.right-side {
|
|
64
|
-
border-top-right-radius: 0;
|
|
65
|
-
justify-self: end;
|
|
66
|
-
width: 100%;
|
|
67
|
-
}
|
|
68
|
-
@media screen and (max-width: 340px) {
|
|
69
|
-
.learn-more {
|
|
70
|
-
padding-right: 5px;
|
|
71
|
-
padding-left: 5px;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
.learn-more {
|
|
75
|
-
display: none;
|
|
76
|
-
}
|
|
77
|
-
.learn-more.selected {
|
|
78
|
-
display: block;
|
|
79
|
-
}
|
|
80
|
-
#features {
|
|
81
|
-
--border-radius: 20px;
|
|
82
|
-
--border-width: 10px;
|
|
83
|
-
--border-color: #f6f6f6;
|
|
84
|
-
}
|
|
85
|
-
.feature {
|
|
86
|
-
padding: 8px;
|
|
87
|
-
border-width: var(--border-width);
|
|
88
|
-
border-style: solid;
|
|
89
|
-
border-color: transparent;
|
|
90
|
-
border-top-left-radius: var(--border-radius);
|
|
91
|
-
border-top-right-radius: var(--border-radius);
|
|
92
|
-
}
|
|
93
|
-
.selected {
|
|
94
|
-
border-color: var(--border-color);
|
|
95
|
-
background-color: #fcfcfc;
|
|
96
|
-
}
|
|
97
|
-
.feature.selected {
|
|
98
|
-
border-bottom: 0 !important;
|
|
99
|
-
z-index: 1;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* Hide top border of .learn-more */
|
|
103
|
-
.learn-more {
|
|
104
|
-
position: relative;
|
|
105
|
-
top: calc(-1 * var(--border-width));
|
|
106
|
-
}
|
|
107
|
-
.feature {
|
|
108
|
-
position: relative;
|
|
109
|
-
z-index: 1;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.feature .chevron {
|
|
113
|
-
transition:
|
|
114
|
-
filter 0.3s ease-in-out,
|
|
115
|
-
transform 0.3s ease-in-out !important;
|
|
116
|
-
}
|
|
117
|
-
.feature.selected .chevron {
|
|
118
|
-
transform: rotate(180deg);
|
|
119
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
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: React.ReactNode
|
|
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: React.ReactNode; rightSide: boolean }) {
|
|
109
|
-
return (
|
|
110
|
-
<aside className={'learn-more ' + (rightSide ? 'right-side' : '')} id={`learn-more-${name}`}>
|
|
111
|
-
{children}
|
|
112
|
-
</aside>
|
|
113
|
-
)
|
|
114
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!-- Generator: Adobe Illustrator 24.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
-
<svg width="512.05" height="292.52" version="1.1" viewBox="0 0 512.05 292.52" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata>
|
|
4
|
-
<g transform="translate(.025 -109.68)">
|
|
5
|
-
<path fill="#323d48" d="m10.7 172.1 219.4 219.4c6.8 6.8 16.2 10.7 25.9 10.7s19.1-3.9 25.9-10.7l219.4-219.4c14.3-14.3 14.3-37.4 0-51.7s-37.4-14.3-51.7 0l-193.6 193.6-193.6-193.6c-14.3-14.3-37.4-14.3-51.7 0s-14.3 37.5 0 51.7z"/>
|
|
6
|
-
</g>
|
|
7
|
-
</svg>
|
package/css/block-design.css
DELETED
package/dist/autoScrollNav.d.ts
DELETED
package/dist/autoScrollNav.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export { autoScrollNav };
|
|
2
|
-
export var autoScrollNav_SSR = "autoScrollNav();".concat(autoScrollNav.toString());
|
|
3
|
-
// - We cannot use TypeScript syntax because of autoScrollNav_SSR
|
|
4
|
-
// - We have to save & restore `dodocument.documentElement.scrollTop` because scrollIntoView() scrolls the main view. (I don't know why).
|
|
5
|
-
// - Failed alternatives:
|
|
6
|
-
// - scrollIntoViewIfNeeded() (https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded) would work (it doesn't scroll the main view) but Firefox doesn't support it.
|
|
7
|
-
// - Doesn't work: the scrolling is off by hundreds of px (I guess because this function runs too early while the page is still rendering).
|
|
8
|
-
// ```js
|
|
9
|
-
// const navigationContainerEl = document.getElementById("navigation-container")
|
|
10
|
-
// const offset = navLink.offsetTop - (window.innerHeight / 2)
|
|
11
|
-
// navigationContainerEl.scrollTop = offset
|
|
12
|
-
// ```
|
|
13
|
-
// - Doesn't work: scrollIntoView() still scrolls the main view
|
|
14
|
-
// ```js
|
|
15
|
-
// const overflowOriginal = document.documentElement.style.overflow
|
|
16
|
-
// document.documentElement.style.overflow = 'hidden'
|
|
17
|
-
// // ...
|
|
18
|
-
// document.documentElement.style.overflow = overflowOriginal
|
|
19
|
-
// ```
|
|
20
|
-
function autoScrollNav() {
|
|
21
|
-
var navigationEl = document.getElementById('navigation-content-main');
|
|
22
|
-
if (!navigationEl)
|
|
23
|
-
return;
|
|
24
|
-
var href = window.location.pathname;
|
|
25
|
-
var navLinks = Array.from(navigationEl.querySelectorAll("a[href=\"".concat(href, "\"]")));
|
|
26
|
-
var navLink = navLinks[0];
|
|
27
|
-
if (!navLink)
|
|
28
|
-
return;
|
|
29
|
-
var scrollTopOriginal = document.documentElement.scrollTop;
|
|
30
|
-
navLink.scrollIntoView({
|
|
31
|
-
behavior: 'instant',
|
|
32
|
-
block: 'center',
|
|
33
|
-
inline: 'start',
|
|
34
|
-
});
|
|
35
|
-
document.documentElement.scrollTop = scrollTopOriginal;
|
|
36
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export { Hit };
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Snippet } from './Snippet';
|
|
4
|
-
import { SourceIcon } from './SourceIcon';
|
|
5
|
-
import { SelectIcon } from './SelectIcon';
|
|
6
|
-
var Hit = function (_a) {
|
|
7
|
-
var hit = _a.hit;
|
|
8
|
-
return (React.createElement("a", { href: hit.url },
|
|
9
|
-
React.createElement("div", { className: "DocSearch-Hit-Container" },
|
|
10
|
-
hit.__docsearch_parent && (React.createElement("svg", { className: "DocSearch-Hit-Tree", viewBox: "0 0 24 54" },
|
|
11
|
-
React.createElement("g", { stroke: "currentColor", fill: "none", fillRule: "evenodd", strokeLinecap: "round", strokeLinejoin: "round" }, !hit.__docsearch_parent ? (React.createElement("path", { d: "M8 6v21M20 27H8.3" })) : (React.createElement("path", { d: "M8 6v42M20 27H8.3" }))))),
|
|
12
|
-
React.createElement("div", { className: "DocSearch-Hit-icon" },
|
|
13
|
-
React.createElement(SourceIcon, { type: hit.type })),
|
|
14
|
-
hit.hierarchy[hit.type] && hit.type === 'lvl1' && (React.createElement("div", { className: "DocSearch-Hit-content-wrapper" },
|
|
15
|
-
React.createElement(Snippet, { className: "DocSearch-Hit-title", hit: hit, attribute: "hierarchy.lvl1" }),
|
|
16
|
-
hit.content && React.createElement(Snippet, { className: "DocSearch-Hit-path", hit: hit, attribute: "content" }))),
|
|
17
|
-
hit.hierarchy[hit.type] &&
|
|
18
|
-
(hit.type === 'lvl2' ||
|
|
19
|
-
hit.type === 'lvl3' ||
|
|
20
|
-
hit.type === 'lvl4' ||
|
|
21
|
-
hit.type === 'lvl5' ||
|
|
22
|
-
hit.type === 'lvl6') && (React.createElement("div", { className: "DocSearch-Hit-content-wrapper" },
|
|
23
|
-
React.createElement(Snippet, { className: "DocSearch-Hit-title", hit: hit, attribute: "hierarchy.".concat(hit.type) }),
|
|
24
|
-
React.createElement(Snippet, { className: "DocSearch-Hit-path", hit: hit, attribute: hit.content ? 'content' : 'hierarchy.lvl1' }))),
|
|
25
|
-
hit.type === 'content' && (React.createElement("div", { className: "DocSearch-Hit-content-wrapper" },
|
|
26
|
-
React.createElement(Snippet, { className: "DocSearch-Hit-title", hit: hit, attribute: "content" }),
|
|
27
|
-
React.createElement(Snippet, { className: "DocSearch-Hit-path", hit: hit, attribute: "hierarchy.lvl1" }))),
|
|
28
|
-
React.createElement("div", { className: "DocSearch-Hit-action" },
|
|
29
|
-
React.createElement(SelectIcon, null)))));
|
|
30
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export function SelectIcon() {
|
|
3
|
-
return (React.createElement("svg", { className: "DocSearch-Hit-Select-Icon", width: "20", height: "20", viewBox: "0 0 20 20" },
|
|
4
|
-
React.createElement("g", { stroke: "currentColor", fill: "none", fillRule: "evenodd", strokeLinecap: "round", strokeLinejoin: "round" },
|
|
5
|
-
React.createElement("path", { d: "M18 3v4c0 2-2 4-4 4H2" }),
|
|
6
|
-
React.createElement("path", { d: "M8 17l-6-6 6-6" }))));
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { StoredDocSearchHit } from './types';
|
|
2
|
-
interface SnippetProps<TItem> {
|
|
3
|
-
hit: TItem;
|
|
4
|
-
attribute: string;
|
|
5
|
-
tagName?: string;
|
|
6
|
-
[prop: string]: unknown;
|
|
7
|
-
}
|
|
8
|
-
export declare function Snippet<TItem extends StoredDocSearchHit>({ hit, attribute, tagName, ...rest }: SnippetProps<TItem>): import("react").DOMElement<{
|
|
9
|
-
dangerouslySetInnerHTML: {
|
|
10
|
-
__html: any;
|
|
11
|
-
};
|
|
12
|
-
}, Element>;
|
|
13
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { createElement } from 'react';
|
|
24
|
-
function getPropertyByPath(object, path) {
|
|
25
|
-
var parts = path.split('.');
|
|
26
|
-
return parts.reduce(function (prev, current) {
|
|
27
|
-
if (prev === null || prev === void 0 ? void 0 : prev[current])
|
|
28
|
-
return prev[current];
|
|
29
|
-
return null;
|
|
30
|
-
}, object);
|
|
31
|
-
}
|
|
32
|
-
export function Snippet(_a) {
|
|
33
|
-
var hit = _a.hit, attribute = _a.attribute, _b = _a.tagName, tagName = _b === void 0 ? 'span' : _b, rest = __rest(_a, ["hit", "attribute", "tagName"]);
|
|
34
|
-
return createElement(tagName, __assign(__assign({}, rest), { dangerouslySetInnerHTML: {
|
|
35
|
-
__html: getPropertyByPath(hit, "_snippetResult.".concat(attribute, ".value")) || getPropertyByPath(hit, attribute),
|
|
36
|
-
} }));
|
|
37
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
var LvlIcon = function () {
|
|
3
|
-
return (React.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20" },
|
|
4
|
-
React.createElement("path", { d: "M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4", stroke: "currentColor", fill: "none", fillRule: "evenodd", strokeLinejoin: "round" })));
|
|
5
|
-
};
|
|
6
|
-
export function SourceIcon(props) {
|
|
7
|
-
switch (props.type) {
|
|
8
|
-
case 'lvl1':
|
|
9
|
-
return React.createElement(LvlIcon, null);
|
|
10
|
-
case 'content':
|
|
11
|
-
return React.createElement(ContentIcon, null);
|
|
12
|
-
default:
|
|
13
|
-
return React.createElement(AnchorIcon, null);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function AnchorIcon() {
|
|
17
|
-
return (React.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20" },
|
|
18
|
-
React.createElement("path", { d: "M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z", stroke: "currentColor", fill: "none", fillRule: "evenodd", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
19
|
-
}
|
|
20
|
-
function ContentIcon() {
|
|
21
|
-
return (React.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20" },
|
|
22
|
-
React.createElement("path", { d: "M17 5H3h14zm0 5H3h14zm0 5H3h14z", stroke: "currentColor", fill: "none", fillRule: "evenodd", strokeLinejoin: "round" })));
|
|
23
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
export type InternalDocSearchHit = DocSearchHit & {
|
|
2
|
-
__docsearch_parent: InternalDocSearchHit | null;
|
|
3
|
-
};
|
|
4
|
-
export type StoredDocSearchHit = Omit<DocSearchHit, '_highlightResult' | '_snippetResult'>;
|
|
5
|
-
type ContentType = 'content' | 'lvl0' | 'lvl1' | 'lvl2' | 'lvl3' | 'lvl4' | 'lvl5' | 'lvl6';
|
|
6
|
-
interface DocSearchHitAttributeHighlightResult {
|
|
7
|
-
value: string;
|
|
8
|
-
matchLevel: 'full' | 'none' | 'partial';
|
|
9
|
-
matchedWords: string[];
|
|
10
|
-
fullyHighlighted?: boolean;
|
|
11
|
-
}
|
|
12
|
-
interface DocSearchHitHighlightResultHierarchy {
|
|
13
|
-
lvl0: DocSearchHitAttributeHighlightResult;
|
|
14
|
-
lvl1: DocSearchHitAttributeHighlightResult;
|
|
15
|
-
lvl2: DocSearchHitAttributeHighlightResult;
|
|
16
|
-
lvl3: DocSearchHitAttributeHighlightResult;
|
|
17
|
-
lvl4: DocSearchHitAttributeHighlightResult;
|
|
18
|
-
lvl5: DocSearchHitAttributeHighlightResult;
|
|
19
|
-
lvl6: DocSearchHitAttributeHighlightResult;
|
|
20
|
-
}
|
|
21
|
-
interface DocSearchHitHighlightResult {
|
|
22
|
-
content: DocSearchHitAttributeHighlightResult;
|
|
23
|
-
hierarchy: DocSearchHitHighlightResultHierarchy;
|
|
24
|
-
hierarchy_camel: DocSearchHitHighlightResultHierarchy[];
|
|
25
|
-
}
|
|
26
|
-
interface DocSearchHitAttributeSnippetResult {
|
|
27
|
-
value: string;
|
|
28
|
-
matchLevel: 'full' | 'none' | 'partial';
|
|
29
|
-
}
|
|
30
|
-
interface DocSearchHitSnippetResult {
|
|
31
|
-
content: DocSearchHitAttributeSnippetResult;
|
|
32
|
-
hierarchy: DocSearchHitHighlightResultHierarchy;
|
|
33
|
-
hierarchy_camel: DocSearchHitHighlightResultHierarchy[];
|
|
34
|
-
}
|
|
35
|
-
export declare type DocSearchHit = {
|
|
36
|
-
objectID: string;
|
|
37
|
-
content: string | null;
|
|
38
|
-
url: string;
|
|
39
|
-
url_without_anchor: string;
|
|
40
|
-
type: ContentType;
|
|
41
|
-
anchor: string | null;
|
|
42
|
-
hierarchy: {
|
|
43
|
-
lvl0: string;
|
|
44
|
-
lvl1: string;
|
|
45
|
-
lvl2: string | null;
|
|
46
|
-
lvl3: string | null;
|
|
47
|
-
lvl4: string | null;
|
|
48
|
-
lvl5: string | null;
|
|
49
|
-
lvl6: string | null;
|
|
50
|
-
};
|
|
51
|
-
_highlightResult: DocSearchHitHighlightResult;
|
|
52
|
-
_snippetResult: DocSearchHitSnippetResult;
|
|
53
|
-
_rankingInfo?: {
|
|
54
|
-
promoted: boolean;
|
|
55
|
-
nbTypos: number;
|
|
56
|
-
firstMatchedWord: number;
|
|
57
|
-
proximityDistance?: number;
|
|
58
|
-
geoDistance: number;
|
|
59
|
-
geoPrecision?: number;
|
|
60
|
-
nbExactWords: number;
|
|
61
|
-
words: number;
|
|
62
|
-
filters: number;
|
|
63
|
-
userScore: number;
|
|
64
|
-
matchedGeoLocation?: {
|
|
65
|
-
lat: number;
|
|
66
|
-
lng: number;
|
|
67
|
-
distance: number;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
_distinctSeqID?: number;
|
|
71
|
-
__autocomplete_indexName?: string;
|
|
72
|
-
__autocomplete_queryID?: string;
|
|
73
|
-
__autocomplete_algoliaCredentials?: {
|
|
74
|
-
appId: string;
|
|
75
|
-
apiKey: string;
|
|
76
|
-
};
|
|
77
|
-
__autocomplete_id?: number;
|
|
78
|
-
};
|
|
79
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import iconGithub from '../icons/github.svg';
|
|
14
|
-
import iconTwitter from '../icons/twitter.svg';
|
|
15
|
-
import iconDiscord from '../icons/discord.svg';
|
|
16
|
-
import iconChangelog from '../icons/changelog.svg';
|
|
17
|
-
import iconLanguages from '../icons/languages.svg';
|
|
18
|
-
import { usePageContext, usePageContext2 } from '../renderer/usePageContext';
|
|
19
|
-
import { DocSearch } from '@docsearch/react';
|
|
20
|
-
import { Hit } from '../components/Algolia/Hit';
|
|
21
|
-
import '@docsearch/css';
|
|
22
|
-
export { NavigationHeader };
|
|
23
|
-
export { Links };
|
|
24
|
-
function NavigationHeader() {
|
|
25
|
-
var _a;
|
|
26
|
-
var pageContext = usePageContext();
|
|
27
|
-
var pageContext2 = usePageContext2();
|
|
28
|
-
var NavHeader = pageContext2.config.NavHeader.NavHeader;
|
|
29
|
-
return (React.createElement("div", { id: "navigation-header", className: pageContext.config.pressKit && 'press-kit', style: {
|
|
30
|
-
display: 'flex',
|
|
31
|
-
flexDirection: 'column',
|
|
32
|
-
alignItems: 'center',
|
|
33
|
-
marginBottom: -5,
|
|
34
|
-
} },
|
|
35
|
-
React.createElement("a", { id: "navigation-header-logo", style: __assign({ display: 'flex', alignItems: 'center', color: 'inherit', justifyContent: 'left', textDecoration: 'none', paddingTop: 12, paddingBottom: 7 }, (_a = pageContext2.config.NavHeader) === null || _a === void 0 ? void 0 : _a.navHeaderWrapperStyle), href: "/" },
|
|
36
|
-
React.createElement(NavHeader, null)),
|
|
37
|
-
React.createElement(Links, null)));
|
|
38
|
-
}
|
|
39
|
-
function Links(_a) {
|
|
40
|
-
var style = _a.style;
|
|
41
|
-
var pageContext = usePageContext();
|
|
42
|
-
var _b = pageContext.config, projectInfo = _b.projectInfo, i18n = _b.i18n;
|
|
43
|
-
var iconI18n = !i18n ? null : (React.createElement(LinkIcon, { className: "decolorize-4", icon: iconLanguages, href: '/languages', style: { height: 21, position: 'relative', top: 0, left: 0 } }));
|
|
44
|
-
var algolia = pageContext.meta.algolia;
|
|
45
|
-
return (React.createElement("div", { style: __assign({ display: 'flex', alignItems: 'center', paddingTop: 0, justifyContent: 'left' }, style) },
|
|
46
|
-
algolia && (React.createElement("div", { className: "decolorize-6 colorize-on-hover" },
|
|
47
|
-
React.createElement(DocSearch, { appId: algolia.appId, indexName: algolia.indexName, apiKey: algolia.apiKey, insights: true, hitComponent: Hit }))),
|
|
48
|
-
iconI18n,
|
|
49
|
-
projectInfo.discordInvite && (React.createElement(LinkIcon, { className: "decolorize-6", icon: iconDiscord, href: projectInfo.discordInvite })),
|
|
50
|
-
React.createElement(LinkIcon, { className: "decolorize-4", icon: iconTwitter, href: projectInfo.twitterProfile }),
|
|
51
|
-
React.createElement(LinkIcon, { className: "decolorize-4", icon: iconGithub, href: projectInfo.githubRepository }),
|
|
52
|
-
React.createElement(ChangelogButton, null)));
|
|
53
|
-
}
|
|
54
|
-
function ChangelogButton() {
|
|
55
|
-
var pageContext = usePageContext();
|
|
56
|
-
var projectInfo = pageContext.config.projectInfo;
|
|
57
|
-
return (React.createElement("a", { href: "".concat(projectInfo.githubRepository, "/blob/main/CHANGELOG.md"), className: "button colorize-on-hover", style: {
|
|
58
|
-
display: 'flex',
|
|
59
|
-
alignItems: 'center',
|
|
60
|
-
padding: '1px 7px',
|
|
61
|
-
marginLeft: 5,
|
|
62
|
-
fontSize: '0.97em',
|
|
63
|
-
color: 'inherit',
|
|
64
|
-
} },
|
|
65
|
-
React.createElement("span", { id: "version-number", className: "decolorize-7" },
|
|
66
|
-
"v",
|
|
67
|
-
projectInfo.projectVersion),
|
|
68
|
-
React.createElement("img", { className: "decolorize-6", src: iconChangelog, height: 16, style: { marginLeft: 5 } })));
|
|
69
|
-
}
|
|
70
|
-
function LinkIcon(_a) {
|
|
71
|
-
var className = _a.className, icon = _a.icon, href = _a.href, style = _a.style;
|
|
72
|
-
return (React.createElement(React.Fragment, null,
|
|
73
|
-
React.createElement("a", { className: 'colorize-on-hover ' + className, href: href, style: { padding: 5, display: 'inline-block', lineHeight: 0 } },
|
|
74
|
-
React.createElement("img", { src: icon, height: "20", style: style }))));
|
|
75
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { NavigationFullscreenButton };
|
|
2
|
-
export { NavigationFullscreenClose };
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import './NavigationFullscreenButton.css';
|
|
5
|
-
declare function NavigationFullscreenButton(): React.JSX.Element;
|
|
6
|
-
declare function NavigationFullscreenClose(): React.JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export { NavigationFullscreenButton };
|
|
2
|
-
export { NavigationFullscreenClose };
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import './NavigationFullscreenButton.css';
|
|
5
|
-
import closeIcon from './close.svg';
|
|
6
|
-
import { hotkeyLabel } from './hotkeyLabel';
|
|
7
|
-
function NavigationFullscreenButton() {
|
|
8
|
-
return (React.createElement(React.Fragment, null,
|
|
9
|
-
React.createElement("a", { id: "navigation-fullscreen-button" },
|
|
10
|
-
React.createElement("div", { style: {
|
|
11
|
-
position: 'fixed',
|
|
12
|
-
cursor: 'pointer',
|
|
13
|
-
height: '100vh',
|
|
14
|
-
width: 20,
|
|
15
|
-
overflow: 'hidden',
|
|
16
|
-
} },
|
|
17
|
-
React.createElement("div", null)),
|
|
18
|
-
React.createElement("div", { style: { position: 'fixed', height: '100vh', width: 20 }, "aria-label": hotkeyLabel, "data-balloon-pos": "right", "data-balloon-blunt": true }))));
|
|
19
|
-
}
|
|
20
|
-
function NavigationFullscreenClose() {
|
|
21
|
-
return (React.createElement("a", { id: "navigation-fullscreen-close", style: { position: 'absolute', top: 11, right: 11, zIndex: 10 }, "aria-label": hotkeyLabel, "data-balloon-pos": "left", "data-balloon-blunt": true },
|
|
22
|
-
React.createElement("img", { src: closeIcon, height: 50, width: 50, style: { display: 'block' } })));
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const hotkeyLabel = "Hotkey <Esc>";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var hotkeyLabel = 'Hotkey <Esc>';
|