@brillout/docpress 0.12.6 → 0.13.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/Layout.tsx
CHANGED
|
@@ -342,7 +342,7 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
|
|
|
342
342
|
maxWidth: navMaxWidth,
|
|
343
343
|
margin: 'auto',
|
|
344
344
|
height: 'var(--nav-head-height)',
|
|
345
|
-
fontSize: `min(
|
|
345
|
+
fontSize: `min(15.2px, ${isProjectNameShort(projectName) ? '4.8cqw' : '4.5cqw'})`,
|
|
346
346
|
color: '#666',
|
|
347
347
|
['--icon-text-padding']: 'min(8px, 1.8cqw)',
|
|
348
348
|
display: 'flex',
|
|
@@ -398,7 +398,7 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
|
|
|
398
398
|
}
|
|
399
399
|
@container container-nav-head (min-width: ${containerQueryMobileNav + 150}px) {
|
|
400
400
|
.nav-head-content {
|
|
401
|
-
--padding-side:
|
|
401
|
+
--padding-side: 25px;
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
@media(max-width: ${containerQueryMobileNav}px) {
|
|
@@ -539,7 +539,7 @@ function MenuToggleMain(props: PropsDiv) {
|
|
|
539
539
|
</span>
|
|
540
540
|
<Style>{css`
|
|
541
541
|
@media(max-width: ${containerQueryMobileNav}px) {
|
|
542
|
-
.text-docs {
|
|
542
|
+
.text-docs, .caret-icon {
|
|
543
543
|
display: none !important;
|
|
544
544
|
}
|
|
545
545
|
}
|
|
@@ -586,6 +586,14 @@ function MenuToggle({ menuId, ...props }: PropsDiv & { menuId: number }) {
|
|
|
586
586
|
>
|
|
587
587
|
<Style>{getAnimation()}</Style>
|
|
588
588
|
{props.children}
|
|
589
|
+
<CaretIcon
|
|
590
|
+
style={{
|
|
591
|
+
width: 11,
|
|
592
|
+
marginLeft: 10,
|
|
593
|
+
flexShrink: 0,
|
|
594
|
+
color: '#888',
|
|
595
|
+
}}
|
|
596
|
+
/>
|
|
589
597
|
</div>
|
|
590
598
|
)
|
|
591
599
|
|
|
@@ -614,15 +622,53 @@ function MenuToggle({ menuId, ...props }: PropsDiv & { menuId: number }) {
|
|
|
614
622
|
transition: top 0.4s ease !important;
|
|
615
623
|
z-index: -1;
|
|
616
624
|
}
|
|
625
|
+
& .caret-icon-left,
|
|
626
|
+
& .caret-icon-right {
|
|
627
|
+
transition: transform .4s cubic-bezier(.4,0, .2, 1);
|
|
628
|
+
}
|
|
629
|
+
& .caret-icon-left {
|
|
630
|
+
transform-origin: 25% 50%;
|
|
631
|
+
}
|
|
632
|
+
& .caret-icon-right {
|
|
633
|
+
transform-origin: 75% 50%;
|
|
634
|
+
}
|
|
617
635
|
}
|
|
618
636
|
`
|
|
619
637
|
}
|
|
620
638
|
}
|
|
639
|
+
function CaretIcon({ style }: { style: React.CSSProperties }) {
|
|
640
|
+
return (
|
|
641
|
+
// - Inspired by stripe.com
|
|
642
|
+
// - Alternative caret SVGs: https://gist.github.com/brillout/dbf05e1fb79a34169cc2d0d5eaf58c01
|
|
643
|
+
// - The rounded caret (`caret.svg`) doesn't look nice when flipped:
|
|
644
|
+
// - https://github.com/brillout/docpress/commit/0ff937d8caf5fc439887ef495e2d2a700234dfb1
|
|
645
|
+
// - https://github.com/brillout/docpress/pull/39
|
|
646
|
+
<svg
|
|
647
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
648
|
+
viewBox="0 0 9.24 5.858"
|
|
649
|
+
style={{
|
|
650
|
+
overflow: 'visible',
|
|
651
|
+
...style,
|
|
652
|
+
}}
|
|
653
|
+
className="caret-icon"
|
|
654
|
+
>
|
|
655
|
+
<g className="caret-icon-left">
|
|
656
|
+
<path
|
|
657
|
+
fill="currentColor"
|
|
658
|
+
d="m4.001 5.24.619.618 1.237-1.237-.618-.619L4 5.241zm-4-4 4 4L5.24 4.001l-4-4L0 1.241z"
|
|
659
|
+
></path>
|
|
660
|
+
</g>
|
|
661
|
+
<g className="caret-icon-right">
|
|
662
|
+
<path fill="currentColor" d="m5.239 5.239-.619.618L3.383 4.62l.618-.619L5.24 5.24Zm4-4-4 4L4 4l4-4z"></path>
|
|
663
|
+
</g>
|
|
664
|
+
</svg>
|
|
665
|
+
)
|
|
666
|
+
}
|
|
621
667
|
function DocsIcon() {
|
|
622
668
|
return (
|
|
623
669
|
<img
|
|
624
670
|
src={iconBooks}
|
|
625
|
-
width={
|
|
671
|
+
width={18}
|
|
626
672
|
style={{ marginRight: 'calc(var(--icon-text-padding) + 2px)' }}
|
|
627
673
|
className="decolorize-5"
|
|
628
674
|
/>
|
package/components/RepoLink.tsx
CHANGED
|
@@ -6,7 +6,9 @@ import { assert } from '../utils/server'
|
|
|
6
6
|
import { usePageContext } from '../renderer/usePageContext'
|
|
7
7
|
|
|
8
8
|
function isRepoLink(href: string) {
|
|
9
|
-
return ['/examples/', '/docs/', '/boilerplates/', '.github/', '/test/'].some((start) =>
|
|
9
|
+
return ['/examples/', '/docs/', '/boilerplates/', '.github/', '/test/', '/packages/'].some((start) =>
|
|
10
|
+
href.startsWith(start),
|
|
11
|
+
)
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
function RepoLink({ path, text, editMode }: { path: string; text?: string | React.ReactNode; editMode?: true }) {
|
|
@@ -4,7 +4,9 @@ import React from 'react';
|
|
|
4
4
|
import { assert } from '../utils/server';
|
|
5
5
|
import { usePageContext } from '../renderer/usePageContext';
|
|
6
6
|
function isRepoLink(href) {
|
|
7
|
-
return ['/examples/', '/docs/', '/boilerplates/', '.github/', '/test/'].some(function (start) {
|
|
7
|
+
return ['/examples/', '/docs/', '/boilerplates/', '.github/', '/test/', '/packages/'].some(function (start) {
|
|
8
|
+
return href.startsWith(start);
|
|
9
|
+
});
|
|
8
10
|
}
|
|
9
11
|
function RepoLink(_a) {
|
|
10
12
|
var path = _a.path, text = _a.text, editMode = _a.editMode;
|
package/docsearch/SearchLink.tsx
CHANGED