@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 CHANGED
@@ -25,7 +25,7 @@ export default {
25
25
  },
26
26
  } satisfies Config
27
27
 
28
- type ReactComponent = () => JSX.Element
28
+ type ReactComponent = () => React.JSX.Element
29
29
  declare global {
30
30
  namespace Vike {
31
31
  interface PageContext {
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
@@ -63,7 +63,7 @@ function NavItemComponent({
63
63
  )
64
64
  }
65
65
 
66
- let children: JSX.Element = titleInNavJsx
66
+ let children: React.JSX.Element = titleInNavJsx
67
67
  if (navItem.level === 1) {
68
68
  children = (
69
69
  <>
@@ -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) {
@@ -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
- [data-label-shift]::before {
28
- margin-left: -10px;
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
@@ -29,7 +29,7 @@ declare const _default: {
29
29
  };
30
30
  };
31
31
  export default _default;
32
- type ReactComponent = () => JSX.Element;
32
+ type ReactComponent = () => React.JSX.Element;
33
33
  declare global {
34
34
  namespace Vike {
35
35
  interface PageContext {
@@ -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,3 @@
1
1
  export { parseMarkdownMini };
2
- declare function parseMarkdownMini(markdown: string): JSX.Element;
2
+ import React from 'react';
3
+ declare function parseMarkdownMini(markdown: string): React.JSX.Element;
@@ -5,4 +5,4 @@ type EmojiName = 'warning' | 'typescript' | 'shield' | 'mechanical-arm' | 'mount
5
5
  declare function Emoji({ name, style }: {
6
6
  name: EmojiName;
7
7
  style?: React.CSSProperties;
8
- }): JSX.Element;
8
+ }): 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.10.11",
3
+ "version": "0.10.13",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@brillout/picocolors": "^1.0.10",
@@ -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
@@ -1,7 +1,7 @@
1
1
  /// <reference types="vite/client" />
2
2
 
3
3
  declare module '*.mdx' {
4
- const value: (props?: any) => JSX.Element
4
+ const value: (props?: any) => React.JSX.Element
5
5
  export default value
6
6
  export const headings: { level: number; title: string; id: string }[]
7
7
  }
@@ -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)