@brillout/docpress 0.15.13 → 0.16.0

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/EditLink.tsx CHANGED
@@ -5,28 +5,40 @@ import { usePageContext } from './renderer/usePageContext'
5
5
  import { iconPencil } from './icons'
6
6
  import { getRepoHref } from './components'
7
7
 
8
- function EditLink({ className, style }: { className?: string; style: React.CSSProperties }) {
8
+ function EditLink({
9
+ className,
10
+ style,
11
+ verbose,
12
+ }: { className?: string; style: React.CSSProperties; verbose?: boolean }) {
9
13
  const pageContext = usePageContext()
10
- const iconSize = 17
11
- const icon = (
12
- <img
13
- src={iconPencil}
14
- width={iconSize}
15
- height={iconSize}
16
- style={{
17
- marginRight: 9,
18
- position: 'relative',
19
- top: -1,
20
- }}
21
- />
22
- )
14
+ const iconSize = 13
15
+ const icon = <img src={iconPencil} width={iconSize} height={iconSize} style={{ marginRight: 6 }} />
23
16
  const { urlPathname } = pageContext
24
17
  const fsPath = urlPathname === '/' ? '/index/+Page.tsx' : `${urlPathname}/+Page.mdx`
25
18
  const docsDir = pageContext.globalContext.config.docpress.docsDir ?? 'docs'
26
19
  const editLink = getRepoHref(`/${docsDir}/pages${fsPath}`, true)
27
20
  return (
28
- <a href={editLink} className={className} style={{ display: 'flex', alignItems: 'center', ...style }}>
29
- {icon} Edit this page
21
+ <a
22
+ href={editLink}
23
+ className={className}
24
+ style={{
25
+ display: 'inline-flex',
26
+ alignItems: 'center',
27
+ paddingTop: 7,
28
+ paddingBottom: 7,
29
+ paddingLeft: 8,
30
+ paddingRight: 7,
31
+ border: '1px solid #e0e0e0',
32
+ borderRadius: 7,
33
+ fontSize: '0.91em',
34
+ color: '#6c6c6c',
35
+ background: '#f8f8f8',
36
+ letterSpacing: 0.4,
37
+ lineHeight: 0,
38
+ ...style,
39
+ }}
40
+ >
41
+ {icon} Edit{verbose ? ' page' : ''}
30
42
  </a>
31
43
  )
32
44
  }
package/ExternalLinks.tsx CHANGED
@@ -31,6 +31,7 @@ function ExternalLinks(props: { style?: React.CSSProperties }) {
31
31
  ...props.style,
32
32
  }}
33
33
  >
34
+ <LinkIcon className="decolorize-4" icon={iconGithub} href={github} iconSizeBoost={1} />
34
35
  {iconI18n}
35
36
  {discord && <LinkIcon className="decolorize-6" icon={iconDiscord} href={discord} />}
36
37
  {twitter && <LinkIcon className="decolorize-4" icon={iconTwitter} href={`https://x.com/${twitter.slice(1)}`} />}
@@ -38,7 +39,6 @@ function ExternalLinks(props: { style?: React.CSSProperties }) {
38
39
  {linkedin && (
39
40
  <LinkIcon className="decolorize-6" icon={iconLinkedin} href={`https://www.linkedin.com/company/${linkedin}`} />
40
41
  )}
41
- <LinkIcon className="decolorize-4" icon={iconGithub} href={github} />
42
42
  {changelog !== false && <ChangelogButton />}
43
43
  </div>
44
44
  )
@@ -54,7 +54,7 @@ function ChangelogButton() {
54
54
  style={{
55
55
  display: 'flex',
56
56
  alignItems: 'center',
57
- padding: '0 5px',
57
+ padding: '0 3px',
58
58
  height: '100%',
59
59
  }}
60
60
  >
@@ -63,28 +63,51 @@ function ChangelogButton() {
63
63
  style={{
64
64
  display: 'flex',
65
65
  alignItems: 'center',
66
- padding: '2px 10px',
66
+ paddingLeft: 8,
67
+ paddingRight: 8,
68
+ paddingTop: 4,
69
+ paddingBottom: 5,
67
70
  fontSize: '0.97em',
71
+ lineHeight: 0,
68
72
  }}
69
73
  >
70
- <span id="version-number" className="decolorize-7">
74
+ <span
75
+ id="version-number"
76
+ className="decolorize-7"
77
+ style={{
78
+ position: 'relative',
79
+ top: 1,
80
+ color: 'var(--color-text)',
81
+ }}
82
+ >
71
83
  v{version}
72
84
  </span>
73
- <img className="decolorize-6" src={iconChangelog} height={16} style={{ marginLeft: 6 }} />
85
+ <img
86
+ className="decolorize-6"
87
+ src={iconChangelog}
88
+ height={16}
89
+ style={{ marginLeft: 6, position: 'relative', top: 1 }}
90
+ />
74
91
  </div>
75
92
  </a>
76
93
  )
77
94
  }
78
95
 
79
- function LinkIcon({ className, icon, href, style }: { className: string; icon: string; href: string; style?: any }) {
96
+ function LinkIcon({
97
+ className,
98
+ icon,
99
+ href,
100
+ style,
101
+ iconSizeBoost = 0,
102
+ }: { className: string; icon: string; href: string; style?: any; iconSizeBoost?: number }) {
80
103
  return (
81
104
  <>
82
105
  <a
83
106
  className="colorize-on-hover"
84
107
  href={href}
85
- style={{ padding: 5, display: 'inline-flex', lineHeight: 0, height: '100%', alignItems: 'center' }}
108
+ style={{ padding: 3, display: 'inline-flex', lineHeight: 0, height: '100%', alignItems: 'center' }}
86
109
  >
87
- <img className={className} src={icon} height="20" style={style} />
110
+ <img className={className} src={icon} height={18 + iconSizeBoost} style={style} />
88
111
  </a>
89
112
  </>
90
113
  )
package/Layout.css ADDED
@@ -0,0 +1,4 @@
1
+ body {
2
+ background: var(--color-bg-white);
3
+ --color-bg-white: #fdfdfd;
4
+ }