@brillout/docpress 0.15.4 → 0.15.5

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.
@@ -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
  };
@@ -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 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@brillout/picocolors": "^1.0.10",
@@ -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/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
  )