@brillout/docpress 0.10.11 → 0.10.13
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/+config.ts +1 -1
- package/Layout.tsx +1 -1
- package/MenuModal.tsx +0 -2
- package/NavItemComponent.tsx +1 -1
- package/components/Link.tsx +5 -5
- package/components/Note.tsx +1 -1
- package/css/tooltip.css +10 -3
- package/dist/+config.d.ts +1 -1
- package/dist/components/Link.js +1 -1
- package/dist/components/Note.d.ts +1 -1
- package/dist/parseMarkdownMini.d.ts +2 -1
- package/dist/utils/Emoji/Emoji.d.ts +1 -1
- package/dist/utils/jsxToTextContent.d.ts +1 -1
- package/package.json +1 -1
- package/parseMarkdownMini.ts +1 -1
- package/types.d.ts +1 -1
- package/utils/Emoji/Emoji.ts +1 -1
- package/utils/jsxToTextContent.ts +1 -1
package/+config.ts
CHANGED
package/Layout.tsx
CHANGED
|
@@ -49,7 +49,7 @@ function Layout({ children }: { children: React.ReactNode }) {
|
|
|
49
49
|
const pageContext = usePageContext()
|
|
50
50
|
const { isLandingPage } = pageContext
|
|
51
51
|
|
|
52
|
-
let content: JSX.Element
|
|
52
|
+
let content: React.JSX.Element
|
|
53
53
|
if (isLandingPage) {
|
|
54
54
|
content = <LayoutLandingPage>{children}</LayoutLandingPage>
|
|
55
55
|
} else {
|
package/MenuModal.tsx
CHANGED
|
@@ -148,8 +148,6 @@ function CloseButton({ className }: { className: string }) {
|
|
|
148
148
|
className={className}
|
|
149
149
|
onClick={closeMenuModal}
|
|
150
150
|
style={{ position: 'fixed', top: 0, right: 0, zIndex: 10, padding: 11, cursor: 'pointer' }}
|
|
151
|
-
aria-label={'Escape\nCtrl\xa0+\xa0M'}
|
|
152
|
-
data-label-shift
|
|
153
151
|
>
|
|
154
152
|
<svg width="48.855" height="48.855" version="1.1" viewBox="0 0 22.901 22.901" xmlns="http://www.w3.org/2000/svg">
|
|
155
153
|
<circle
|
package/NavItemComponent.tsx
CHANGED
package/components/Link.tsx
CHANGED
|
@@ -28,7 +28,7 @@ function Link({
|
|
|
28
28
|
`<Link href /> prop \`href==='${href}'\` but should start with '/' or '#'`,
|
|
29
29
|
)
|
|
30
30
|
assertUsage(!text || !children, 'Cannot use both `text` or `children`')
|
|
31
|
-
assertWarning(!text, 'prop `text` is deprecated')
|
|
31
|
+
// assertWarning(!text, 'prop `text` is deprecated')
|
|
32
32
|
text = text ?? children
|
|
33
33
|
|
|
34
34
|
if (isRepoLink(href)) {
|
|
@@ -55,10 +55,10 @@ function getLinkText({
|
|
|
55
55
|
}: {
|
|
56
56
|
noBreadcrumb: true | undefined
|
|
57
57
|
linkData: LinkData
|
|
58
|
-
sectionTitle: JSX.Element | null
|
|
58
|
+
sectionTitle: React.JSX.Element | null
|
|
59
59
|
isLinkOnSamePage: boolean
|
|
60
|
-
}): JSX.Element {
|
|
61
|
-
const breadcrumbParts: JSX.Element[] = []
|
|
60
|
+
}): React.JSX.Element {
|
|
61
|
+
const breadcrumbParts: React.JSX.Element[] = []
|
|
62
62
|
if (linkData.linkBreadcrumb) {
|
|
63
63
|
breadcrumbParts.push(...(linkData.linkBreadcrumb ?? []).slice().reverse().map(parseMarkdownMini))
|
|
64
64
|
}
|
|
@@ -91,7 +91,7 @@ function getLinkTextData(href: string, pageContext: PageContextResolved, doNotIn
|
|
|
91
91
|
const isLinkOnSamePage = linkData.url === pageContext.urlPathname
|
|
92
92
|
if (!hrefPathname) assert(isLinkOnSamePage)
|
|
93
93
|
|
|
94
|
-
let sectionTitle: JSX.Element | null = null
|
|
94
|
+
let sectionTitle: React.JSX.Element | null = null
|
|
95
95
|
if (hrefHash) {
|
|
96
96
|
assert(!hrefHash.startsWith('#'))
|
|
97
97
|
if (isLinkOnSamePage) {
|
package/components/Note.tsx
CHANGED
|
@@ -39,7 +39,7 @@ function Danger(props: Props) {
|
|
|
39
39
|
function NoteWithoutIcon(props: Props) {
|
|
40
40
|
return <NoteGeneric icon={null} {...props} />
|
|
41
41
|
}
|
|
42
|
-
type CustomIcon = JSX.Element | string
|
|
42
|
+
type CustomIcon = React.JSX.Element | string
|
|
43
43
|
function NoteWithCustomIcon(props: Props & { icon: CustomIcon }) {
|
|
44
44
|
const { icon } = props
|
|
45
45
|
if (!icon) throw new Error(`<NoteWithCustomIcon icon={/*...*/}> property 'icon' is \`${icon}\` which is forbidden`)
|
package/css/tooltip.css
CHANGED
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
position: relative;
|
|
8
8
|
}
|
|
9
9
|
[aria-label]:hover::before {
|
|
10
|
+
opacity: 1;
|
|
11
|
+
}
|
|
12
|
+
[aria-label]::before {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
transition: opacity 0.3s ease-in-out;
|
|
15
|
+
pointer-events: none;
|
|
10
16
|
font-family: monospace;
|
|
11
17
|
font-size: 12px;
|
|
12
18
|
content: attr(aria-label);
|
|
@@ -23,8 +29,9 @@
|
|
|
23
29
|
letter-spacing: -0.02em;
|
|
24
30
|
border: 1px solid #e3e3e3;
|
|
25
31
|
z-index: 1;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
/* Atlernative: https://stackoverflow.com/questions/30086913/css-positioned-absolute-element-automatic-width-outside-of-parents-bounds/57379329#57379329
|
|
33
|
+
width: max-content;
|
|
34
|
+
*/
|
|
35
|
+
white-space: nowrap;
|
|
29
36
|
}
|
|
30
37
|
}
|
package/dist/+config.d.ts
CHANGED
package/dist/components/Link.js
CHANGED
|
@@ -21,7 +21,7 @@ function Link(_a) {
|
|
|
21
21
|
var pageContext = usePageContext();
|
|
22
22
|
assertUsage(href.startsWith('/') || href.startsWith('#'), "<Link href /> prop `href==='".concat(href, "'` but should start with '/' or '#'"));
|
|
23
23
|
assertUsage(!text || !children, 'Cannot use both `text` or `children`');
|
|
24
|
-
assertWarning(!text, 'prop `text` is deprecated')
|
|
24
|
+
// assertWarning(!text, 'prop `text` is deprecated')
|
|
25
25
|
text = text !== null && text !== void 0 ? text : children;
|
|
26
26
|
if (isRepoLink(href)) {
|
|
27
27
|
return React.createElement(RepoLink, { path: href, text: text });
|
|
@@ -17,7 +17,7 @@ declare function Construction(props: Props): React.JSX.Element;
|
|
|
17
17
|
declare function Contribution(props: Props): React.JSX.Element;
|
|
18
18
|
declare function Danger(props: Props): React.JSX.Element;
|
|
19
19
|
declare function NoteWithoutIcon(props: Props): React.JSX.Element;
|
|
20
|
-
type CustomIcon = JSX.Element | string;
|
|
20
|
+
type CustomIcon = React.JSX.Element | string;
|
|
21
21
|
declare function NoteWithCustomIcon(props: Props & {
|
|
22
22
|
icon: CustomIcon;
|
|
23
23
|
}): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { jsxToTextContent };
|
|
2
|
-
declare function jsxToTextContent(node: JSX.Element): string;
|
|
2
|
+
declare function jsxToTextContent(node: React.JSX.Element): string;
|
package/package.json
CHANGED
package/parseMarkdownMini.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { parseMarkdownMini }
|
|
|
2
2
|
|
|
3
3
|
import React from 'react'
|
|
4
4
|
|
|
5
|
-
function parseMarkdownMini(markdown: string): JSX.Element {
|
|
5
|
+
function parseMarkdownMini(markdown: string): React.JSX.Element {
|
|
6
6
|
type Part = { nodeType: 'text' | 'code'; content: string }
|
|
7
7
|
const parts: Part[] = []
|
|
8
8
|
let current: Part | undefined
|
package/types.d.ts
CHANGED
package/utils/Emoji/Emoji.ts
CHANGED
|
@@ -37,7 +37,7 @@ type EmojiName =
|
|
|
37
37
|
| 'trophy'
|
|
38
38
|
| 'ribbon'
|
|
39
39
|
|
|
40
|
-
function Emoji({ name, style }: { name: EmojiName; style?: React.CSSProperties }): JSX.Element {
|
|
40
|
+
function Emoji({ name, style }: { name: EmojiName; style?: React.CSSProperties }): React.JSX.Element {
|
|
41
41
|
const emoji =
|
|
42
42
|
// ***
|
|
43
43
|
// U+26A0
|
|
@@ -3,7 +3,7 @@ import { assert } from './assert'
|
|
|
3
3
|
export { jsxToTextContent }
|
|
4
4
|
|
|
5
5
|
// https://stackoverflow.com/questions/34204975/react-is-there-something-similar-to-node-textcontent/60564620#60564620
|
|
6
|
-
function jsxToTextContent(node: JSX.Element): string {
|
|
6
|
+
function jsxToTextContent(node: React.JSX.Element): string {
|
|
7
7
|
if (['string', 'number'].includes(typeof node)) return String(node)
|
|
8
8
|
if (node instanceof Array) return node.map(jsxToTextContent).join('')
|
|
9
9
|
if (typeof node === 'object' && node) return jsxToTextContent(node.props.children)
|