@brillout/docpress 0.6.17 → 0.6.19
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/components/Note.tsx +22 -17
- package/dist/vite.config.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +1 -1
- package/vite.config.ts +1 -1
package/components/Note.tsx
CHANGED
|
@@ -19,28 +19,33 @@ import { assert } from '../utils/assert'
|
|
|
19
19
|
import './Note.css'
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
type Props = {
|
|
23
|
+
children: React.ReactNode
|
|
24
|
+
style: React.CSSProperties
|
|
25
|
+
}
|
|
26
|
+
function Warning(props: Props) {
|
|
27
|
+
return <NoteGeneric type="warning" {...props} />
|
|
24
28
|
}
|
|
25
|
-
function Advanced(
|
|
26
|
-
return <NoteGeneric type="advanced"
|
|
29
|
+
function Advanced(props: Props) {
|
|
30
|
+
return <NoteGeneric type="advanced" {...props} />
|
|
27
31
|
}
|
|
28
|
-
function Construction(
|
|
29
|
-
return <NoteGeneric type="construction"
|
|
32
|
+
function Construction(props: Props) {
|
|
33
|
+
return <NoteGeneric type="construction" {...props} />
|
|
30
34
|
}
|
|
31
|
-
function Contribution(
|
|
32
|
-
return <NoteGeneric type="contribution"
|
|
35
|
+
function Contribution(props: Props) {
|
|
36
|
+
return <NoteGeneric type="contribution" {...props} />
|
|
33
37
|
}
|
|
34
|
-
function Danger(
|
|
35
|
-
return <NoteGeneric type="danger"
|
|
38
|
+
function Danger(props: Props) {
|
|
39
|
+
return <NoteGeneric type="danger" {...props} />
|
|
36
40
|
}
|
|
37
|
-
function NoteWithoutIcon(
|
|
38
|
-
return <NoteGeneric icon={null}
|
|
41
|
+
function NoteWithoutIcon(props: Props) {
|
|
42
|
+
return <NoteGeneric icon={null} {...props} />
|
|
39
43
|
}
|
|
40
44
|
type CustomIcon = JSX.Element | string
|
|
41
|
-
function NoteWithCustomIcon(
|
|
45
|
+
function NoteWithCustomIcon(props: Props & { icon: CustomIcon }) {
|
|
46
|
+
const { icon } = props
|
|
42
47
|
if (!icon) throw new Error(`<NoteWithCustomIcon icon={/*...*/}> property 'icon' is \`${icon}\` which is forbidden`)
|
|
43
|
-
return <NoteGeneric
|
|
48
|
+
return <NoteGeneric {...props} />
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
function NoteGeneric({
|
|
@@ -48,11 +53,11 @@ function NoteGeneric({
|
|
|
48
53
|
icon,
|
|
49
54
|
iconMargin,
|
|
50
55
|
children,
|
|
51
|
-
|
|
56
|
+
style,
|
|
57
|
+
}: Props & {
|
|
52
58
|
icon?: null | CustomIcon
|
|
53
59
|
iconMargin?: null | number
|
|
54
60
|
type?: 'danger' | 'warning' | 'construction' | 'contribution' | 'advanced'
|
|
55
|
-
children: React.ReactNode
|
|
56
61
|
}) {
|
|
57
62
|
assert(icon === null || icon || type, { icon, type })
|
|
58
63
|
iconMargin ??= 2
|
|
@@ -88,7 +93,7 @@ function NoteGeneric({
|
|
|
88
93
|
className = `${className} ${classColor}`
|
|
89
94
|
}
|
|
90
95
|
return (
|
|
91
|
-
<blockquote className={className}>
|
|
96
|
+
<blockquote className={className} style={style}>
|
|
92
97
|
<div style={{ marginBottom: 20 }} />
|
|
93
98
|
<span style={{ fontFamily: 'emoji' }}>{icon}</span>
|
|
94
99
|
<span style={{ width: iconMargin ?? undefined, display: 'inline-block' }}></span>{' '}
|
package/dist/vite.config.js
CHANGED
|
@@ -23,7 +23,7 @@ var config = {
|
|
|
23
23
|
includeAssetsImportedByServer: true,
|
|
24
24
|
}),
|
|
25
25
|
],
|
|
26
|
-
optimizeDeps: { include: ['@
|
|
26
|
+
optimizeDeps: { include: ['@brillout/docpress', 'react-dom'] },
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
ssr: {
|
|
29
29
|
noExternal: ['@brillout/docpress'],
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
package/vite.config.ts
CHANGED
|
@@ -26,7 +26,7 @@ const config: UserConfig = {
|
|
|
26
26
|
includeAssetsImportedByServer: true,
|
|
27
27
|
}),
|
|
28
28
|
],
|
|
29
|
-
optimizeDeps: { include: ['@
|
|
29
|
+
optimizeDeps: { include: ['@brillout/docpress', 'react-dom'] },
|
|
30
30
|
// @ts-ignore
|
|
31
31
|
ssr: {
|
|
32
32
|
noExternal: ['@brillout/docpress'],
|