@brillout/docpress 0.5.1 → 0.5.2
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 +9 -1
- package/dist/index.js +17 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -119,6 +119,14 @@ declare function Construction({ children }: {
|
|
|
119
119
|
declare function Danger({ children }: {
|
|
120
120
|
children: JSX.Element;
|
|
121
121
|
}): JSX.Element;
|
|
122
|
+
declare function NoteWithoutIcon({ children }: {
|
|
123
|
+
children: JSX.Element;
|
|
124
|
+
}): JSX.Element;
|
|
125
|
+
type CustomIcon = JSX.Element | string;
|
|
126
|
+
declare function NoteWithCustomIcon({ icon, children }: {
|
|
127
|
+
children: JSX.Element;
|
|
128
|
+
icon: CustomIcon;
|
|
129
|
+
}): JSX.Element;
|
|
122
130
|
|
|
123
131
|
declare function ImportMeta({ prop }: {
|
|
124
132
|
prop: string;
|
|
@@ -154,4 +162,4 @@ declare function CodeBlockTransformer({ children, lineBreak }: {
|
|
|
154
162
|
lineBreak: LineBreak;
|
|
155
163
|
}): JSX.Element;
|
|
156
164
|
|
|
157
|
-
export { CodeBlockTransformer, Config, Construction, Danger, Emoji, EmojiName, HeadingDefinition, HeadingDetachedDefinition, HorizontalLine, ImportMeta, Info, Link, P, ReadingRecommendation, RepoLink, Sponsor, Sponsors, Warning, assert, assertUsage, assertWarning, crawlAllFiles, determineSectionTitle, determineSectionUrlHash, filter, isBrowser, isRepoLink, jsxToTextContent, objectAssign };
|
|
165
|
+
export { CodeBlockTransformer, Config, Construction, Danger, Emoji, EmojiName, HeadingDefinition, HeadingDetachedDefinition, HorizontalLine, ImportMeta, Info, 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
|
@@ -195,16 +195,27 @@ function Danger({ children }) {
|
|
|
195
195
|
type: "danger"
|
|
196
196
|
}, children);
|
|
197
197
|
}
|
|
198
|
+
function NoteWithoutIcon({ children }) {
|
|
199
|
+
return /* @__PURE__ */ React5.createElement(Note, {
|
|
200
|
+
icon: null
|
|
201
|
+
}, children);
|
|
202
|
+
}
|
|
203
|
+
function NoteWithCustomIcon({ icon, children }) {
|
|
204
|
+
return /* @__PURE__ */ React5.createElement(Note, {
|
|
205
|
+
icon
|
|
206
|
+
}, children);
|
|
207
|
+
}
|
|
198
208
|
function Note({
|
|
199
209
|
type,
|
|
200
210
|
icon,
|
|
201
211
|
children
|
|
202
212
|
}) {
|
|
213
|
+
assert(icon === null || icon || type);
|
|
203
214
|
let className = "custom-icon";
|
|
204
215
|
if (type) {
|
|
205
216
|
className = `${className} type-${type}`;
|
|
206
217
|
}
|
|
207
|
-
if (!icon) {
|
|
218
|
+
if (!icon && type) {
|
|
208
219
|
let classColor = "";
|
|
209
220
|
if (type === "danger") {
|
|
210
221
|
icon = ":no_entry:";
|
|
@@ -218,9 +229,9 @@ function Note({
|
|
|
218
229
|
icon = ":construction:";
|
|
219
230
|
classColor = "note-color-yellow";
|
|
220
231
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
232
|
+
assert(icon);
|
|
233
|
+
assert(classColor);
|
|
234
|
+
className = `${className} ${classColor}`;
|
|
224
235
|
}
|
|
225
236
|
return /* @__PURE__ */ React5.createElement("blockquote", {
|
|
226
237
|
className
|
|
@@ -614,6 +625,8 @@ export {
|
|
|
614
625
|
ImportMeta,
|
|
615
626
|
Info,
|
|
616
627
|
Link,
|
|
628
|
+
NoteWithCustomIcon,
|
|
629
|
+
NoteWithoutIcon,
|
|
617
630
|
P,
|
|
618
631
|
ReadingRecommendation,
|
|
619
632
|
RepoLink,
|