@brillout/docpress 0.5.8 → 0.5.10
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/dist/index.d.ts +13 -8
- package/dist/index.js +11 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -84,12 +84,13 @@ type Config = {
|
|
|
84
84
|
i18n?: true;
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
declare function Link({ href, text, noBreadcrumb, doNotInferSectionTitle, titleNormalCase }: {
|
|
87
|
+
declare function Link({ href, text, noBreadcrumb, doNotInferSectionTitle, titleNormalCase, children }: {
|
|
88
88
|
href: string;
|
|
89
89
|
text?: string | JSX.Element;
|
|
90
90
|
noBreadcrumb?: true;
|
|
91
91
|
doNotInferSectionTitle?: true;
|
|
92
92
|
titleNormalCase?: boolean;
|
|
93
|
+
children?: React$1.ReactNode;
|
|
93
94
|
}): JSX.Element;
|
|
94
95
|
|
|
95
96
|
declare function isRepoLink(href: string): boolean;
|
|
@@ -107,20 +108,20 @@ declare function ReadingRecommendation({ tour, links }: {
|
|
|
107
108
|
}): JSX.Element;
|
|
108
109
|
|
|
109
110
|
declare function Warning({ children }: {
|
|
110
|
-
children:
|
|
111
|
+
children: React$1.ReactNode;
|
|
111
112
|
}): JSX.Element;
|
|
112
113
|
declare function Construction({ children }: {
|
|
113
|
-
children:
|
|
114
|
+
children: React$1.ReactNode;
|
|
114
115
|
}): JSX.Element;
|
|
115
116
|
declare function Danger({ children }: {
|
|
116
|
-
children:
|
|
117
|
+
children: React$1.ReactNode;
|
|
117
118
|
}): JSX.Element;
|
|
118
119
|
declare function NoteWithoutIcon({ children }: {
|
|
119
|
-
children:
|
|
120
|
+
children: React$1.ReactNode;
|
|
120
121
|
}): JSX.Element;
|
|
121
122
|
type CustomIcon = JSX.Element | string;
|
|
122
123
|
declare function NoteWithCustomIcon({ icon, children }: {
|
|
123
|
-
children:
|
|
124
|
+
children: React$1.ReactNode;
|
|
124
125
|
icon: CustomIcon;
|
|
125
126
|
}): JSX.Element;
|
|
126
127
|
|
|
@@ -154,8 +155,12 @@ declare function Sponsors(): JSX.Element;
|
|
|
154
155
|
|
|
155
156
|
type LineBreak = 'white-space' | 'break-word';
|
|
156
157
|
declare function CodeBlockTransformer({ children, lineBreak }: {
|
|
157
|
-
children:
|
|
158
|
+
children: React$1.ReactNode;
|
|
158
159
|
lineBreak: LineBreak;
|
|
159
160
|
}): JSX.Element;
|
|
160
161
|
|
|
161
|
-
|
|
162
|
+
declare function Comment({ children }: {
|
|
163
|
+
children: React$1.ReactNode;
|
|
164
|
+
}): JSX.Element;
|
|
165
|
+
|
|
166
|
+
export { CodeBlockTransformer, Comment, Config, Construction, Danger, Emoji, EmojiName, HeadingDefinition, HeadingDetachedDefinition, HorizontalLine, ImportMeta, Link, NoteWithCustomIcon, NoteWithoutIcon, P, ReadingRecommendation, RepoLink, Sponsor, Sponsors, Warning, assert, assertUsage, assertWarning, crawlAllFiles, determineSectionTitle, determineSectionUrlHash, filter, isBrowser, isRepoLink, jsxToTextContent, objectAssign };
|
package/dist/index.js
CHANGED
|
@@ -31,12 +31,14 @@ function Link({
|
|
|
31
31
|
text,
|
|
32
32
|
noBreadcrumb,
|
|
33
33
|
doNotInferSectionTitle,
|
|
34
|
-
titleNormalCase
|
|
34
|
+
titleNormalCase,
|
|
35
|
+
children
|
|
35
36
|
}) {
|
|
36
37
|
assertUsage(
|
|
37
38
|
href.startsWith("/") || href.startsWith("#"),
|
|
38
39
|
`<Link href /> prop \`href==='${href}'\` but should start with '/' or '#'`
|
|
39
40
|
);
|
|
41
|
+
assertUsage(!text || !children, "Cannot use both `text` or `children`");
|
|
40
42
|
if (isRepoLink(href)) {
|
|
41
43
|
return /* @__PURE__ */ React.createElement(RepoLink, {
|
|
42
44
|
path: href,
|
|
@@ -46,7 +48,7 @@ function Link({
|
|
|
46
48
|
const pageContext = usePageContext();
|
|
47
49
|
return /* @__PURE__ */ React.createElement("a", {
|
|
48
50
|
href
|
|
49
|
-
}, text || getTitle({ href, noBreadcrumb, pageContext, doNotInferSectionTitle, titleNormalCase }));
|
|
51
|
+
}, children || text || getTitle({ href, noBreadcrumb, pageContext, doNotInferSectionTitle, titleNormalCase }));
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
function getTitle({
|
|
@@ -622,8 +624,15 @@ function CodeBlockTransformer({ children, lineBreak }) {
|
|
|
622
624
|
className
|
|
623
625
|
}, children);
|
|
624
626
|
}
|
|
627
|
+
|
|
628
|
+
// src/components/Comment.tsx
|
|
629
|
+
import React9 from "react";
|
|
630
|
+
function Comment({ children }) {
|
|
631
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null);
|
|
632
|
+
}
|
|
625
633
|
export {
|
|
626
634
|
CodeBlockTransformer,
|
|
635
|
+
Comment,
|
|
627
636
|
Construction,
|
|
628
637
|
Danger,
|
|
629
638
|
Emoji,
|