@brillout/docpress 0.15.4 → 0.15.6

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/ExternalLinks.tsx CHANGED
@@ -5,6 +5,7 @@ import iconGithub from './icons/github.svg'
5
5
  import iconTwitter from './icons/twitter.svg'
6
6
  import iconDiscord from './icons/discord.svg'
7
7
  import iconBluesky from './icons/bluesky.svg'
8
+ import iconLinkedin from './icons/linkedin.svg'
8
9
  import iconChangelog from './icons/changelog.svg'
9
10
  import iconLanguages from './icons/languages.svg'
10
11
  import { usePageContext } from './renderer/usePageContext'
@@ -12,7 +13,7 @@ import '@docsearch/css'
12
13
 
13
14
  function ExternalLinks(props: { style?: React.CSSProperties }) {
14
15
  const pageContext = usePageContext()
15
- const { github, discord, bluesky, i18n, twitter } = pageContext.globalContext.config.docpress
16
+ const { github, discord, bluesky, linkedin, i18n, twitter } = pageContext.globalContext.config.docpress
16
17
  const iconI18n = !i18n ? null : (
17
18
  <LinkIcon
18
19
  className="decolorize-4"
@@ -34,6 +35,9 @@ function ExternalLinks(props: { style?: React.CSSProperties }) {
34
35
  {discord && <LinkIcon className="decolorize-6" icon={iconDiscord} href={discord} />}
35
36
  {twitter && <LinkIcon className="decolorize-4" icon={iconTwitter} href={`https://x.com/${twitter.slice(1)}`} />}
36
37
  {bluesky && <LinkIcon className="decolorize-6" icon={iconBluesky} href={`https://bsky.app/profile/${bluesky}`} />}
38
+ {linkedin && (
39
+ <LinkIcon className="decolorize-6" icon={iconLinkedin} href={`https://www.linkedin.com/company/${linkedin}`} />
40
+ )}
37
41
  <LinkIcon className="decolorize-4" icon={iconGithub} href={github} />
38
42
  <ChangelogButton />
39
43
  </div>
package/Layout.tsx CHANGED
@@ -61,8 +61,8 @@ function Layout({ children }: { children: React.ReactNode }) {
61
61
  ['--bg-color']: '#f5f5f5',
62
62
  ['--block-margin']: `${blockMargin}px`,
63
63
  ['--icon-text-padding']: '8px',
64
- // ['--nav-head-height']: `${isLandingPage ? 70 : 60}px`,
65
- ['--nav-head-height']: `60px`,
64
+ // ['--nav-head-height']: `${isLandingPage ? 70 : 63}px`,
65
+ ['--nav-head-height']: `63px`,
66
66
  }}
67
67
  >
68
68
  <MenuModal isTopNav={isLandingPage} />
@@ -605,6 +605,8 @@ function MenuToggle({ menuId, ...props }: PropsDiv & { menuId: number }) {
605
605
  marginLeft: 10,
606
606
  flexShrink: 0,
607
607
  color: '#888',
608
+ position: 'relative',
609
+ top: -1,
608
610
  }}
609
611
  />
610
612
  </div>
@@ -7,6 +7,7 @@ import { assert, assertUsage, assertWarning, determineSectionTitle, determineSec
7
7
  import { parseMarkdownMini } from '../parseMarkdownMini'
8
8
  import pc from '@brillout/picocolors'
9
9
  import type { PageContext } from 'vike/types'
10
+ import type { StringArray } from '../types/Heading'
10
11
 
11
12
  function Link({
12
13
  href,
@@ -133,8 +134,8 @@ function getLinkTextData({
133
134
  type LinkData = {
134
135
  url?: null | string
135
136
  title: string
136
- linkBreadcrumb: null | string[]
137
- sectionTitles?: string[]
137
+ linkBreadcrumb: null | StringArray
138
+ sectionTitles?: StringArray
138
139
  }
139
140
  function findLinkData(
140
141
  href: string,
@@ -1,6 +1,7 @@
1
1
  export { Link };
2
2
  export type { LinkData };
3
3
  import React from 'react';
4
+ import type { StringArray } from '../types/Heading';
4
5
  declare function Link({ href, text, noBreadcrumb, doNotInferSectionTitle, noWarning, children, }: {
5
6
  href: string;
6
7
  text?: string | React.ReactNode;
@@ -12,6 +13,6 @@ declare function Link({ href, text, noBreadcrumb, doNotInferSectionTitle, noWarn
12
13
  type LinkData = {
13
14
  url?: null | string;
14
15
  title: string;
15
- linkBreadcrumb: null | string[];
16
- sectionTitles?: string[];
16
+ linkBreadcrumb: null | StringArray;
17
+ sectionTitles?: StringArray;
17
18
  };
@@ -13,6 +13,7 @@ type Config = {
13
13
  discord?: string;
14
14
  twitter?: string;
15
15
  bluesky?: string;
16
+ linkedin?: string;
16
17
  headings: HeadingDefinition[];
17
18
  headingsDetached: HeadingDetachedDefinition[];
18
19
  categories?: Category[];
@@ -1,14 +1,15 @@
1
- export { HeadingResolved };
2
- export { HeadingDetachedResolved };
3
- export { HeadingDetachedDefinition };
4
- export { HeadingDefinition };
1
+ export type { HeadingResolved };
2
+ export type { HeadingDetachedResolved };
3
+ export type { HeadingDetachedDefinition };
4
+ export type { HeadingDefinition };
5
+ export type { StringArray };
5
6
  type HeadingResolved = {
6
7
  url?: null | string;
7
8
  level: number;
8
9
  title: string;
9
10
  titleInNav: string;
10
- linkBreadcrumb: string[];
11
- sectionTitles?: string[];
11
+ linkBreadcrumb: StringArray;
12
+ sectionTitles?: StringArray;
12
13
  menuModalFullWidth?: true;
13
14
  pageDesign?: PageDesign;
14
15
  category?: string;
@@ -17,6 +18,7 @@ type HeadingResolved = {
17
18
  titleIconStyle?: React.CSSProperties;
18
19
  titleDocument?: string;
19
20
  };
21
+ type StringArray = string[] | readonly string[];
20
22
  type PageDesign = {
21
23
  hideTitle?: true;
22
24
  hideMenuLeft?: true;
@@ -33,7 +35,7 @@ type HeadingDefinitionCommon = {
33
35
  };
34
36
  type HeadingDetachedDefinition = HeadingDefinitionCommon & {
35
37
  url: string;
36
- sectionTitles?: string[];
38
+ sectionTitles?: StringArray;
37
39
  category?: string;
38
40
  };
39
41
  type HeadingDefinition = HeadingDefinitionCommon & {} & (({
@@ -47,7 +49,7 @@ type HeadingDefinition = HeadingDefinitionCommon & {} & (({
47
49
  level: 2;
48
50
  titleInNav?: string;
49
51
  titleDocument?: string;
50
- sectionTitles?: string[];
52
+ sectionTitles?: StringArray;
51
53
  url: null | string;
52
54
  });
53
55
  type IsCategory = {
@@ -33,7 +33,7 @@ function SearchIcon() {
33
33
  <img
34
34
  src={iconMagnifyingGlass}
35
35
  width={18}
36
- style={{ marginRight: 'var(--icon-text-padding)' }}
36
+ style={{ marginRight: 'var(--icon-text-padding)', position: 'relative', top: -1 }}
37
37
  className="decolorize-7"
38
38
  />
39
39
  )
@@ -0,0 +1,6 @@
1
+ <svg width="80.17" height="80.17" version="1.1" viewBox="0 0 80.17 80.17" xmlns="http://www.w3.org/2000/svg">
2
+ <defs>
3
+ <style>.cls-1{fill:#0a66c2;}</style>
4
+ </defs>
5
+ <path class="cls-1" d="m68.32 68.315h-11.88v-18.6c0-4.44-0.08-10.15-6.18-10.15s-7.14 4.83-7.14 9.83v18.92h-11.88v-38.25h11.41v5.23h0.16c1.59-3.01 5.47-6.18 11.25-6.18 12.04 0 14.27 7.92 14.27 18.22v20.98zm-50.48-43.49c-3.81 0-6.89-3.09-6.89-6.9s3.08-6.89 6.89-6.89 6.89 3.09 6.89 6.89-3.09 6.9-6.89 6.9m5.94 43.49h-11.89v-38.26h11.89zm50.46-68.31h-68.32c-3.27 0-5.92 2.59-5.92 5.78v68.6c0 3.19 2.65 5.78 5.92 5.78h68.32c3.27 0 5.93-2.59 5.93-5.78v-68.6c0-3.19-2.66-5.78-5.93-5.78"/>
6
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.15.4",
3
+ "version": "0.15.6",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@brillout/picocolors": "^1.0.10",
@@ -57,7 +57,7 @@
57
57
  }
58
58
  },
59
59
  "devDependencies": {
60
- "@brillout/release-me": "^0.4.2",
60
+ "@brillout/release-me": "^0.4.7",
61
61
  "@types/node": "^22.5.5",
62
62
  "@types/react": "^18.3.8",
63
63
  "@types/react-dom": "^18.3.0"
@@ -11,6 +11,7 @@ import type {
11
11
  HeadingDetachedDefinition,
12
12
  HeadingResolved,
13
13
  HeadingDetachedResolved,
14
+ StringArray,
14
15
  } from './types/Heading'
15
16
  import { assert } from './utils/assert'
16
17
  import { jsxToTextContent } from './utils/jsxToTextContent'
@@ -22,7 +23,7 @@ type PageSectionResolved = {
22
23
  url: string | null
23
24
  title: string
24
25
  titleInNav: string
25
- linkBreadcrumb: string[]
26
+ linkBreadcrumb: StringArray
26
27
  pageSectionLevel: number
27
28
  }
28
29
 
package/types/Config.ts CHANGED
@@ -16,6 +16,7 @@ type Config = {
16
16
  discord?: string
17
17
  twitter?: string
18
18
  bluesky?: string
19
+ linkedin?: string
19
20
 
20
21
  headings: HeadingDefinition[]
21
22
  headingsDetached: HeadingDetachedDefinition[]
package/types/Heading.ts CHANGED
@@ -1,15 +1,16 @@
1
- export { HeadingResolved }
2
- export { HeadingDetachedResolved }
3
- export { HeadingDetachedDefinition }
4
- export { HeadingDefinition }
1
+ export type { HeadingResolved }
2
+ export type { HeadingDetachedResolved }
3
+ export type { HeadingDetachedDefinition }
4
+ export type { HeadingDefinition }
5
+ export type { StringArray }
5
6
 
6
7
  type HeadingResolved = {
7
8
  url?: null | string
8
9
  level: number
9
10
  title: string
10
11
  titleInNav: string
11
- linkBreadcrumb: string[]
12
- sectionTitles?: string[]
12
+ linkBreadcrumb: StringArray
13
+ sectionTitles?: StringArray
13
14
  menuModalFullWidth?: true
14
15
  pageDesign?: PageDesign
15
16
  category?: string
@@ -19,6 +20,8 @@ type HeadingResolved = {
19
20
  titleDocument?: string
20
21
  }
21
22
 
23
+ type StringArray = string[] | readonly string[]
24
+
22
25
  type PageDesign = {
23
26
  hideTitle?: true
24
27
  hideMenuLeft?: true
@@ -38,7 +41,7 @@ type HeadingDefinitionCommon = {
38
41
 
39
42
  type HeadingDetachedDefinition = HeadingDefinitionCommon & {
40
43
  url: string
41
- sectionTitles?: string[]
44
+ sectionTitles?: StringArray
42
45
  category?: string
43
46
  }
44
47
 
@@ -49,7 +52,7 @@ type HeadingDefinition = HeadingDefinitionCommon & {} & (
49
52
  level: 2
50
53
  titleInNav?: string
51
54
  titleDocument?: string
52
- sectionTitles?: string[]
55
+ sectionTitles?: StringArray
53
56
  url: null | string
54
57
  }
55
58
  )