@cbnventures/docusaurus-preset-nova 0.22.5 → 0.23.0
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/build/package.json +2 -2
- package/build/src/blocks/hero/index.d.ts.map +1 -1
- package/build/src/blocks/hero/index.js +5 -3
- package/build/src/blocks/hero/index.js.map +1 -1
- package/build/src/lib/use-color-mode-observer.d.ts +3 -0
- package/build/src/lib/use-color-mode-observer.d.ts.map +1 -0
- package/build/src/lib/use-color-mode-observer.js +32 -0
- package/build/src/lib/use-color-mode-observer.js.map +1 -0
- package/build/src/lib/use-overlay-panel.d.ts +3 -0
- package/build/src/lib/use-overlay-panel.d.ts.map +1 -0
- package/build/src/lib/use-overlay-panel.js +54 -0
- package/build/src/lib/use-overlay-panel.js.map +1 -0
- package/build/src/theme/BlogSidebarMobile/index.d.ts.map +1 -1
- package/build/src/theme/BlogSidebarMobile/index.js +7 -39
- package/build/src/theme/BlogSidebarMobile/index.js.map +1 -1
- package/build/src/theme/DocSidebarMobile/panel.d.ts.map +1 -1
- package/build/src/theme/DocSidebarMobile/panel.js +7 -39
- package/build/src/theme/DocSidebarMobile/panel.js.map +1 -1
- package/build/src/theme/Mermaid/index.d.ts.map +1 -1
- package/build/src/theme/Mermaid/index.js +3 -25
- package/build/src/theme/Mermaid/index.js.map +1 -1
- package/build/src/theme/Navbar/Bridge/mobile-menu.d.ts.map +1 -1
- package/build/src/theme/Navbar/Bridge/mobile-menu.js +10 -124
- package/build/src/theme/Navbar/Bridge/mobile-menu.js.map +1 -1
- package/build/src/theme/Navbar/Canopy/mobile-menu.d.ts.map +1 -1
- package/build/src/theme/Navbar/Canopy/mobile-menu.js +10 -124
- package/build/src/theme/Navbar/Canopy/mobile-menu.js.map +1 -1
- package/build/src/theme/Navbar/Compass/mobile-menu.d.ts.map +1 -1
- package/build/src/theme/Navbar/Compass/mobile-menu.js +10 -124
- package/build/src/theme/Navbar/Compass/mobile-menu.js.map +1 -1
- package/build/src/theme/Navbar/Monolith/mobile-menu.d.ts.map +1 -1
- package/build/src/theme/Navbar/Monolith/mobile-menu.js +6 -122
- package/build/src/theme/Navbar/Monolith/mobile-menu.js.map +1 -1
- package/build/src/theme/Navbar/index.d.ts.map +1 -1
- package/build/src/theme/Navbar/index.js +1 -6
- package/build/src/theme/Navbar/index.js.map +1 -1
- package/build/src/theme/Navbar/shared/mobile-menu-base.d.ts +4 -0
- package/build/src/theme/Navbar/shared/mobile-menu-base.d.ts.map +1 -0
- package/build/src/theme/Navbar/shared/mobile-menu-base.js +138 -0
- package/build/src/theme/Navbar/shared/mobile-menu-base.js.map +1 -0
- package/build/src/theme/TOCCollapsible/panel.d.ts.map +1 -1
- package/build/src/theme/TOCCollapsible/panel.js +7 -39
- package/build/src/theme/TOCCollapsible/panel.js.map +1 -1
- package/build/src/theme/ThemedImage/index.d.ts.map +1 -1
- package/build/src/theme/ThemedImage/index.js +2 -25
- package/build/src/theme/ThemedImage/index.js.map +1 -1
- package/build/src/types/blocks/hero/index.d.ts +2 -0
- package/build/src/types/lib/use-color-mode-observer.d.ts +23 -0
- package/build/src/types/lib/use-overlay-panel.d.ts +50 -0
- package/build/src/types/theme/BlogSidebarMobile/index.d.ts +8 -26
- package/build/src/types/theme/DocSidebarMobile/panel.d.ts +6 -26
- package/build/src/types/theme/Mermaid/index.d.ts +0 -10
- package/build/src/types/theme/Navbar/Bridge/mobile-menu.d.ts +0 -70
- package/build/src/types/theme/Navbar/Canopy/mobile-menu.d.ts +0 -80
- package/build/src/types/theme/Navbar/Compass/mobile-menu.d.ts +0 -80
- package/build/src/types/theme/Navbar/Monolith/mobile-menu.d.ts +0 -80
- package/build/src/types/theme/Navbar/shared/mobile-menu-base.d.ts +128 -0
- package/build/src/types/theme/TOCCollapsible/panel.d.ts +6 -17
- package/build/src/types/theme/ThemedImage/index.d.ts +0 -10
- package/package.json +2 -2
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cbnventures/docusaurus-preset-nova",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Scripts, templates, and project configuration for the common JavaScript and TypeScript developer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"node": "^22 || ^24"
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@cbnventures/nova": "0.
|
|
102
|
+
"@cbnventures/nova": "0.23.0",
|
|
103
103
|
"@codesandbox/sandpack-react": "2.20.0",
|
|
104
104
|
"@docusaurus/plugin-content-blog": "3.10.0",
|
|
105
105
|
"@docusaurus/plugin-content-docs": "3.10.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/hero/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/hero/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,kCAAkC,EACnC,MAAM,oCAAoC,CAAC;AAY5C,iBAAS,UAAU,CAAC,KAAK,EAAE,kCAAkC,2CAwC5D;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -2,9 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import Link from '@docusaurus/Link';
|
|
3
3
|
import Heading from '@theme/Heading';
|
|
4
4
|
function BlocksHero(props) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const innerContent = (_jsxs("div", { className: "nova-hero-inner nova-container", children: [(props['eyebrow'] !== undefined) && (_jsx("p", { className: "nova-hero-eyebrow", children: props['eyebrow'] })), _jsx(Heading, { as: "h1", className: "nova-hero-heading", children: props['heading'] }), _jsx("p", { className: "nova-hero-tagline", children: props['tagline'] }), _jsxs("div", { className: "nova-hero-actions", children: [_jsx(Link, { className: "nova-cta-primary", to: props['ctaLink'], children: props['ctaLabel'] }), (props['secondaryCtaLabel'] !== undefined
|
|
6
|
+
&& props['secondaryCtaLink'] !== undefined) && (_jsx(Link, { className: "nova-cta-secondary", to: props['secondaryCtaLink'], children: props['secondaryCtaLabel'] }))] })] }));
|
|
7
|
+
return (_jsx("header", { className: (props['className'] !== undefined) ? `nova-hero ${props['className']}` : 'nova-hero', style: props['style'], children: (props['surface'] === 'alt')
|
|
8
|
+
? _jsx("div", { className: "nova-surface-alt", children: innerContent })
|
|
9
|
+
: innerContent }));
|
|
8
10
|
}
|
|
9
11
|
export default BlocksHero;
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/blocks/hero/index.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,OAAO,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/blocks/hero/index.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAiBrC,SAAS,UAAU,CAAC,KAAyC;IAC3D,MAAM,YAAY,GAA8C,CAC9D,eAAK,SAAS,EAAC,gCAAgC,aAC5C,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,SAAS,CAAC,IAAI,CACnC,YAAG,SAAS,EAAC,mBAAmB,YAC7B,KAAK,CAAC,SAAS,CAAC,GACf,CACL,EACD,KAAC,OAAO,IAAC,EAAE,EAAC,IAAI,EAAC,SAAS,EAAC,mBAAmB,YAC3C,KAAK,CAAC,SAAS,CAAC,GACT,EACV,YAAG,SAAS,EAAC,mBAAmB,YAC7B,KAAK,CAAC,SAAS,CAAC,GACf,EACJ,eAAK,SAAS,EAAC,mBAAmB,aAChC,KAAC,IAAI,IAAC,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,YACpD,KAAK,CAAC,UAAU,CAAC,GACb,EACN,CACC,KAAK,CAAC,mBAAmB,CAAC,KAAK,SAAS;2BACrC,KAAK,CAAC,kBAAkB,CAAC,KAAK,SAAS,CAC3C,IAAI,CACH,KAAC,IAAI,IAAC,SAAS,EAAC,oBAAoB,EAAC,EAAE,EAAE,KAAK,CAAC,kBAAkB,CAAC,YAC/D,KAAK,CAAC,mBAAmB,CAAC,GACtB,CACR,IACG,IACF,CACP,CAAC;IAEF,OAAO,CACL,iBACE,SAAS,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAC/F,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,YAEpB,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,KAAK,CAAC;YAC3B,CAAC,CAAC,cAAK,SAAS,EAAC,kBAAkB,YAAE,YAAY,GAAO;YACxD,CAAC,CAAC,YAAY,GACT,CACV,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-color-mode-observer.d.ts","sourceRoot":"","sources":["../../../src/lib/use-color-mode-observer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gCAAgC,EAOjC,MAAM,2CAA2C,CAAC;AAanD,wBAAgB,oBAAoB,IAAI,gCAAgC,CAmCvE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useColorModeObserver = useColorModeObserver;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useColorModeObserver() {
|
|
6
|
+
const colorModeState = (0, react_1.useState)('light');
|
|
7
|
+
const colorMode = colorModeState[0];
|
|
8
|
+
const setColorMode = colorModeState[1];
|
|
9
|
+
(0, react_1.useEffect)(() => {
|
|
10
|
+
const currentTheme = document.documentElement.getAttribute('data-theme');
|
|
11
|
+
if (currentTheme !== null) {
|
|
12
|
+
setColorMode(currentTheme);
|
|
13
|
+
}
|
|
14
|
+
const observer = new MutationObserver(() => {
|
|
15
|
+
const theme = document.documentElement.getAttribute('data-theme');
|
|
16
|
+
if (theme !== null) {
|
|
17
|
+
setColorMode(theme);
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
});
|
|
21
|
+
observer.observe(document.documentElement, {
|
|
22
|
+
attributes: true,
|
|
23
|
+
attributeFilter: ['data-theme'],
|
|
24
|
+
});
|
|
25
|
+
return () => {
|
|
26
|
+
observer.disconnect();
|
|
27
|
+
return undefined;
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
return colorMode;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=use-color-mode-observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-color-mode-observer.js","sourceRoot":"","sources":["../../../src/lib/use-color-mode-observer.ts"],"names":[],"mappings":";;AAuBA,oDAmCC;AA1DD,iCAA4C;AAuB5C,SAAgB,oBAAoB;IAClC,MAAM,cAAc,GAAiE,IAAA,gBAAQ,EAA0D,OAAO,CAAC,CAAC;IAChK,MAAM,SAAS,GAA4D,cAAc,CAAC,CAAC,CAAC,CAAC;IAC7F,MAAM,YAAY,GAA+D,cAAc,CAAC,CAAC,CAAC,CAAC;IAEnG,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAA+D,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAErI,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;YAC1B,YAAY,CAAC,YAAY,CAAC,CAAC;QAC7B,CAAC;QAED,MAAM,QAAQ,GAA2D,IAAI,gBAAgB,CAAC,GAAG,EAAE;YACjG,MAAM,KAAK,GAAwD,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YAEvH,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACnB,YAAY,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;YAED,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE;YACzC,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,CAAC,YAAY,CAAC;SAChC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,UAAU,EAAE,CAAC;YAEtB,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Lib_UseOverlayPanel_FocusSelector, Lib_UseOverlayPanel_IsOpen, Lib_UseOverlayPanel_Returns } from '../types/lib/use-overlay-panel.d.ts';
|
|
2
|
+
export declare function useOverlayPanel(isOpen: Lib_UseOverlayPanel_IsOpen, focusSelector: Lib_UseOverlayPanel_FocusSelector): Lib_UseOverlayPanel_Returns;
|
|
3
|
+
//# sourceMappingURL=use-overlay-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-overlay-panel.d.ts","sourceRoot":"","sources":["../../../src/lib/use-overlay-panel.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAS5B,MAAM,qCAAqC,CAAC;AAgB7C,wBAAgB,eAAe,CAAC,MAAM,EAAE,0BAA0B,EAAE,aAAa,EAAE,iCAAiC,GAAG,2BAA2B,CA8EjJ"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOverlayPanel = useOverlayPanel;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useOverlayPanel(isOpen, focusSelector) {
|
|
6
|
+
const isClosingState = (0, react_1.useState)(false);
|
|
7
|
+
const isClosing = isClosingState[0];
|
|
8
|
+
const setIsClosing = isClosingState[1];
|
|
9
|
+
const panelRef = (0, react_1.useRef)(null);
|
|
10
|
+
const handleEscape = (0, react_1.useCallback)((event) => {
|
|
11
|
+
if (event.key === 'Escape') {
|
|
12
|
+
setIsClosing(true);
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
}, []);
|
|
16
|
+
const handleClickOutside = (0, react_1.useCallback)((event) => {
|
|
17
|
+
const mouseTarget = event.target;
|
|
18
|
+
if (mouseTarget === event.currentTarget) {
|
|
19
|
+
setIsClosing(true);
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}, []);
|
|
23
|
+
(0, react_1.useEffect)(() => {
|
|
24
|
+
if (isOpen === true) {
|
|
25
|
+
document.addEventListener('keydown', handleEscape);
|
|
26
|
+
}
|
|
27
|
+
return () => {
|
|
28
|
+
document.removeEventListener('keydown', handleEscape);
|
|
29
|
+
return undefined;
|
|
30
|
+
};
|
|
31
|
+
}, [
|
|
32
|
+
isOpen,
|
|
33
|
+
handleEscape,
|
|
34
|
+
]);
|
|
35
|
+
(0, react_1.useEffect)(() => {
|
|
36
|
+
if (isOpen === true && panelRef['current'] !== null) {
|
|
37
|
+
const focusTarget = panelRef['current'].querySelector(focusSelector);
|
|
38
|
+
if (focusTarget !== null) {
|
|
39
|
+
focusTarget.focus();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}, [
|
|
44
|
+
isOpen,
|
|
45
|
+
focusSelector,
|
|
46
|
+
]);
|
|
47
|
+
return {
|
|
48
|
+
isClosing,
|
|
49
|
+
setIsClosing,
|
|
50
|
+
handleClickOutside,
|
|
51
|
+
panelRef,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=use-overlay-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-overlay-panel.js","sourceRoot":"","sources":["../../../src/lib/use-overlay-panel.ts"],"names":[],"mappings":";;AAmCA,0CA8EC;AAjHD,iCAKe;AA8Bf,SAAgB,eAAe,CAAC,MAAkC,EAAE,aAAgD;IAClH,MAAM,cAAc,GAAuD,IAAA,gBAAQ,EAAgD,KAAK,CAAC,CAAC;IAC1I,MAAM,SAAS,GAAkD,cAAc,CAAC,CAAC,CAAC,CAAC;IACnF,MAAM,YAAY,GAAqD,cAAc,CAAC,CAAC,CAAC,CAAC;IAEzF,MAAM,QAAQ,GAAiD,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAU5F,MAAM,YAAY,GAAqD,IAAA,mBAAW,EAAC,CAAC,KAAK,EAAE,EAAE;QAC3F,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC3B,YAAY,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IAUP,MAAM,kBAAkB,GAA2D,IAAA,mBAAW,EAAC,CAAC,KAAK,EAAE,EAAE;QACvG,MAAM,WAAW,GAAoD,KAAK,CAAC,MAAM,CAAC;QAElF,IAAI,WAAW,KAAK,KAAK,CAAC,aAAa,EAAE,CAAC;YACxC,YAAY,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;YAEtD,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE;QACD,MAAM;QACN,YAAY;KACb,CAAC,CAAC;IAGH,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,MAAM,KAAK,IAAI,IAAI,QAAQ,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;YACpD,MAAM,WAAW,GAAoD,QAAQ,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,aAAa,CAAoD,CAAC;YAEzK,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;gBACzB,WAAW,CAAC,KAAK,EAAE,CAAC;YACtB,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE;QACD,MAAM;QACN,aAAa;KACd,CAAC,CAAC;IAEH,OAAO;QACL,SAAS;QACT,YAAY;QACZ,kBAAkB;QAClB,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/BlogSidebarMobile/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/BlogSidebarMobile/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAcV,qDAAqD,EAItD,MAAM,gDAAgD,CAAC;AAaxD,iBAAS,iBAAiB,CAAC,KAAK,EAAE,qDAAqD,uDAgItF;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -3,57 +3,25 @@ import { useLocation } from '@docusaurus/router';
|
|
|
3
3
|
import { translate } from '@docusaurus/Translate';
|
|
4
4
|
import { Icon } from '@iconify/react/offline';
|
|
5
5
|
import BlogSidebar from '@theme/BlogSidebar';
|
|
6
|
-
import {
|
|
6
|
+
import { useEffect, useState, } from 'react';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
|
+
import { useOverlayPanel } from '../../lib/use-overlay-panel.js';
|
|
8
9
|
function BlogSidebarMobile(props) {
|
|
9
10
|
const pathname = useLocation()['pathname'];
|
|
10
11
|
const isOpenState = useState(false);
|
|
11
12
|
const isOpen = isOpenState[0];
|
|
12
13
|
const setIsOpen = isOpenState[1];
|
|
13
|
-
const
|
|
14
|
-
const isClosing =
|
|
15
|
-
const setIsClosing =
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
if (event.key === 'Escape') {
|
|
19
|
-
setIsClosing(true);
|
|
20
|
-
}
|
|
21
|
-
return undefined;
|
|
22
|
-
}, []);
|
|
23
|
-
const handleClickOutside = useCallback((event) => {
|
|
24
|
-
const mouseTarget = event.target;
|
|
25
|
-
if (mouseTarget === event.currentTarget) {
|
|
26
|
-
setIsClosing(true);
|
|
27
|
-
}
|
|
28
|
-
return undefined;
|
|
29
|
-
}, []);
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (isOpen === true) {
|
|
32
|
-
document.addEventListener('keydown', handleEscape);
|
|
33
|
-
}
|
|
34
|
-
return () => {
|
|
35
|
-
document.removeEventListener('keydown', handleEscape);
|
|
36
|
-
return undefined;
|
|
37
|
-
};
|
|
38
|
-
}, [
|
|
39
|
-
isOpen,
|
|
40
|
-
handleEscape,
|
|
41
|
-
]);
|
|
14
|
+
const overlayPanel = useOverlayPanel(isOpen, '.nova-sidebar-mobile-close');
|
|
15
|
+
const isClosing = overlayPanel['isClosing'];
|
|
16
|
+
const setIsClosing = overlayPanel['setIsClosing'];
|
|
17
|
+
const handleClickOutside = overlayPanel['handleClickOutside'];
|
|
18
|
+
const panelRef = overlayPanel['panelRef'];
|
|
42
19
|
useEffect(() => {
|
|
43
20
|
if (isOpen === true) {
|
|
44
21
|
setIsClosing(true);
|
|
45
22
|
}
|
|
46
23
|
return undefined;
|
|
47
24
|
}, [pathname]);
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
if (isOpen === true && panelRef['current'] !== null) {
|
|
50
|
-
const focusTarget = panelRef['current'].querySelector('.nova-sidebar-mobile-close');
|
|
51
|
-
if (focusTarget !== null) {
|
|
52
|
-
focusTarget.focus();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return undefined;
|
|
56
|
-
}, [isOpen]);
|
|
57
25
|
if (props['sidebar'] === undefined
|
|
58
26
|
|| props['sidebar']['items']['length'] === 0) {
|
|
59
27
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/theme/BlogSidebarMobile/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/theme/BlogSidebarMobile/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACL,SAAS,EACT,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAiCjE,SAAS,iBAAiB,CAAC,KAA4D;IACrF,MAAM,QAAQ,GAA6D,WAAW,EAAE,CAAC,UAAU,CAAC,CAAC;IAErG,MAAM,WAAW,GAAgE,QAAQ,CAAyD,KAAK,CAAC,CAAC;IACzJ,MAAM,MAAM,GAA2D,WAAW,CAAC,CAAC,CAAC,CAAC;IACtF,MAAM,SAAS,GA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K,CAAC,CAAC;wBACtB,CAAC;wBAED,OAAO,SAAS,CAAC;oBACnB,CAAC,YAED,eACE,SAAS,EAAC,2BAA2B,EACrC,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,QAAQ,gBACF,MAAM,gBACL,cAAc,aAE1B,eAAK,SAAS,EAAC,4BAA4B,aACzC,eAAM,SAAS,EAAC,kCAAkC,YAAE,WAAW,GAAQ,EACvE,iBACE,SAAS,EAAC,2BAA2B,EACrC,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;4CACZ,YAAY,CAAC,IAAI,CAAC,CAAC;4CAEnB,OAAO,SAAS,CAAC;wCACnB,CAAC,gBACW,cAAc,YAE1B,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,iBAAa,MAAM,GAAG,GAC3D,IACL,EACN,cAAK,SAAS,EAAC,6BAA6B,YAC1C,KAAC,WAAW,IAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,GAAI,GACtC,IACF,GACF,EACN,QAAQ,CAAC,IAAI,CACd,CAAC;YACJ,CAAC,CAAC,EAAE,IACH,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../../src/theme/DocSidebarMobile/panel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../../src/theme/DocSidebarMobile/panel.tsx"],"names":[],"mappings":"AAyCA,iBAAS,qBAAqB,uCA2F7B;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -4,51 +4,19 @@ import { useLocation } from '@docusaurus/router';
|
|
|
4
4
|
import { translate } from '@docusaurus/Translate';
|
|
5
5
|
import { Icon } from '@iconify/react/offline';
|
|
6
6
|
import DocSidebar from '@theme/DocSidebar';
|
|
7
|
-
import {
|
|
7
|
+
import { useSyncExternalStore } from 'react';
|
|
8
8
|
import { createPortal } from 'react-dom';
|
|
9
9
|
import { sidebarMobileGetSnapshot, sidebarMobileSetOpen, sidebarMobileSubscribe, } from '../../lib/sidebar-mobile-store.js';
|
|
10
|
+
import { useOverlayPanel } from '../../lib/use-overlay-panel.js';
|
|
10
11
|
function DocSidebarMobilePanel() {
|
|
11
12
|
const sidebar = useDocsSidebar();
|
|
12
13
|
const pathname = useLocation()['pathname'];
|
|
13
14
|
const isOpen = useSyncExternalStore(sidebarMobileSubscribe, sidebarMobileGetSnapshot, sidebarMobileGetSnapshot);
|
|
14
|
-
const
|
|
15
|
-
const isClosing =
|
|
16
|
-
const setIsClosing =
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
if (event.key === 'Escape') {
|
|
20
|
-
setIsClosing(true);
|
|
21
|
-
}
|
|
22
|
-
return undefined;
|
|
23
|
-
}, []);
|
|
24
|
-
const handleClickOutside = useCallback((event) => {
|
|
25
|
-
const mouseTarget = event.target;
|
|
26
|
-
if (mouseTarget === event.currentTarget) {
|
|
27
|
-
setIsClosing(true);
|
|
28
|
-
}
|
|
29
|
-
return undefined;
|
|
30
|
-
}, []);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (isOpen === true) {
|
|
33
|
-
document.addEventListener('keydown', handleEscape);
|
|
34
|
-
}
|
|
35
|
-
return () => {
|
|
36
|
-
document.removeEventListener('keydown', handleEscape);
|
|
37
|
-
return undefined;
|
|
38
|
-
};
|
|
39
|
-
}, [
|
|
40
|
-
isOpen,
|
|
41
|
-
handleEscape,
|
|
42
|
-
]);
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (isOpen === true && panelRef['current'] !== null) {
|
|
45
|
-
const focusTarget = panelRef['current'].querySelector('.nova-sidebar-mobile-close');
|
|
46
|
-
if (focusTarget !== null) {
|
|
47
|
-
focusTarget.focus();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return undefined;
|
|
51
|
-
}, [isOpen]);
|
|
15
|
+
const overlayPanel = useOverlayPanel(isOpen, '.nova-sidebar-mobile-close');
|
|
16
|
+
const isClosing = overlayPanel['isClosing'];
|
|
17
|
+
const setIsClosing = overlayPanel['setIsClosing'];
|
|
18
|
+
const handleClickOutside = overlayPanel['handleClickOutside'];
|
|
19
|
+
const panelRef = overlayPanel['panelRef'];
|
|
52
20
|
if (isOpen !== true
|
|
53
21
|
|| sidebar === null) {
|
|
54
22
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.js","sourceRoot":"","sources":["../../../../src/theme/DocSidebarMobile/panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"panel.js","sourceRoot":"","sources":["../../../../src/theme/DocSidebarMobile/panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AA4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Y,CACjB,cACE,SAAS,EAAE,gBAAgB,EAC3B,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAC,cAAc,EACnB,cAAc,EAAE,CAAC,MAAyE,EAAE,EAAE;YAC5F,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;gBACvB,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBAC5B,YAAY,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;YAED,OAAO,SAAS,CAAC;QACnB,CAAC,YAED,eACE,SAAS,EAAC,2BAA2B,EACrC,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,QAAQ,gBACF,MAAM,gBACL,cAAc,aAE1B,eAAK,SAAS,EAAC,4BAA4B,aACzC,eAAM,SAAS,EAAC,kCAAkC,YAAE,WAAW,GAAQ,EACvE,iBACE,SAAS,EAAC,2BAA2B,EACrC,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;gCACZ,YAAY,CAAC,IAAI,CAAC,CAAC;gCAEnB,OAAO,SAAS,CAAC;4BACnB,CAAC,gBACW,cAAc,YAE1B,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,iBAAa,MAAM,GAAG,GAC3D,IACL,EACN,cAAK,SAAS,EAAC,6BAA6B,YAC1C,KAAC,UAAU,IACT,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS,EAC3B,QAAQ,EAAE,KAAK,GACf,GACE,IACF,GACF,EACN,QAAQ,CAAC,IAAI,CACd,CAAC;AACJ,CAAC;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/Mermaid/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/Mermaid/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAEV,iCAAiC,EACjC,mCAAmC,EAMpC,MAAM,sCAAsC,CAAC;AAsD9C,iBAAS,OAAO,CAAC,KAAK,EAAE,iCAAiC,GAAG,mCAAmC,CAoB9F;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
|
3
3
|
import ErrorPageContent from '@theme/ErrorPageContent';
|
|
4
|
-
import { useEffect, useRef
|
|
4
|
+
import { useEffect, useRef } from 'react';
|
|
5
5
|
import { MERMAID_CONTAINER_CLASS_NAME, useMermaidRenderResult, } from '../../lib/mermaid.js';
|
|
6
|
+
import { useColorModeObserver } from '../../lib/use-color-mode-observer.js';
|
|
6
7
|
function MermaidContent(props) {
|
|
7
8
|
const renderResult = useMermaidRenderResult({ text: props['value'] });
|
|
8
9
|
const containerRef = useRef(null);
|
|
@@ -21,30 +22,7 @@ function MermaidContent(props) {
|
|
|
21
22
|
return (_jsx("div", { ref: containerRef, className: className, style: props['style'], dangerouslySetInnerHTML: { __html: renderResult['svg'] } }));
|
|
22
23
|
}
|
|
23
24
|
function Mermaid(props) {
|
|
24
|
-
const
|
|
25
|
-
const colorMode = colorModeState[0];
|
|
26
|
-
const setColorMode = colorModeState[1];
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
const currentTheme = document.documentElement.getAttribute('data-theme');
|
|
29
|
-
if (currentTheme !== null) {
|
|
30
|
-
setColorMode(currentTheme);
|
|
31
|
-
}
|
|
32
|
-
const observer = new MutationObserver(() => {
|
|
33
|
-
const theme = document.documentElement.getAttribute('data-theme');
|
|
34
|
-
if (theme !== null) {
|
|
35
|
-
setColorMode(theme);
|
|
36
|
-
}
|
|
37
|
-
return undefined;
|
|
38
|
-
});
|
|
39
|
-
observer.observe(document.documentElement, {
|
|
40
|
-
attributes: true,
|
|
41
|
-
attributeFilter: ['data-theme'],
|
|
42
|
-
});
|
|
43
|
-
return () => {
|
|
44
|
-
observer.disconnect();
|
|
45
|
-
return undefined;
|
|
46
|
-
};
|
|
47
|
-
}, []);
|
|
25
|
+
const colorMode = useColorModeObserver();
|
|
48
26
|
return (_jsx(ErrorBoundary, { fallback: (params) => (_jsx(ErrorPageContent, { error: params['error'], tryAgain: params['tryAgain'] })), children: _jsx(MermaidContent, { value: props['value'], className: props['className'], style: props['style'] }, colorMode) }));
|
|
49
27
|
}
|
|
50
28
|
export default Mermaid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/theme/Mermaid/index.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/theme/Mermaid/index.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAuB5E,SAAS,cAAc,CAAC,KAA+C;IACrE,MAAM,YAAY,GAAoD,sBAAsB,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACvH,MAAM,YAAY,GAAoD,MAAM,CAAwB,IAAI,CAAC,CAAC;IAE1G,SAAS,CAAC,GAAG,EAAE;QACb,IACE,YAAY,KAAK,IAAI;eAClB,YAAY,CAAC,OAAO,KAAK,IAAI;eAC7B,YAAY,CAAC,eAAe,CAAC,KAAK,SA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"
|
|
1
|
+
{"version":3,"file":"mobile-menu.d.ts","sourceRoot":"","sources":["../../../../../src/theme/Navbar/Bridge/mobile-menu.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,+CAA+C,EAC/C,iDAAiD,EAElD,MAAM,qDAAqD,CAAC;AAmB7D,iBAAS,UAAU,CAAC,KAAK,EAAE,+CAA+C,GAAG,iDAAiD,CA0C7H;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,132 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import Link from '@docusaurus/Link';
|
|
3
|
-
import { useLocation } from '@docusaurus/router';
|
|
4
|
-
import { translate } from '@docusaurus/Translate';
|
|
5
|
-
import { Icon } from '@iconify/react/offline';
|
|
6
3
|
import Logo from '@theme/Logo';
|
|
7
|
-
import { SearchInput
|
|
8
|
-
import
|
|
9
|
-
import { createPortal } from 'react-dom';
|
|
4
|
+
import { SearchInput } from '@theme/SearchBar';
|
|
5
|
+
import MobileMenuBase from '../shared/mobile-menu-base.js';
|
|
10
6
|
function MobileMenu(props) {
|
|
11
|
-
const isOpen = props['isOpen'];
|
|
12
|
-
const onClose = props['onClose'];
|
|
13
|
-
const items = props['items'];
|
|
14
7
|
const siteLogo = props['siteLogo'];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const setIsClosing = isClosingState[1];
|
|
21
|
-
const handleEscape = useCallback((event) => {
|
|
22
|
-
if (event.key === 'Escape') {
|
|
23
|
-
setIsClosing(true);
|
|
24
|
-
}
|
|
25
|
-
return undefined;
|
|
26
|
-
}, []);
|
|
27
|
-
const handleClickOutside = useCallback((event) => {
|
|
28
|
-
const mouseTarget = event.target;
|
|
29
|
-
if (mouseTarget === event.currentTarget) {
|
|
30
|
-
setIsClosing(true);
|
|
31
|
-
}
|
|
32
|
-
return undefined;
|
|
33
|
-
}, []);
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (isOpen === true) {
|
|
36
|
-
document.addEventListener('keydown', handleEscape);
|
|
37
|
-
}
|
|
38
|
-
return () => {
|
|
39
|
-
document.removeEventListener('keydown', handleEscape);
|
|
40
|
-
return undefined;
|
|
41
|
-
};
|
|
42
|
-
}, [
|
|
43
|
-
isOpen,
|
|
44
|
-
handleEscape,
|
|
45
|
-
]);
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (isOpen === true && panelRef['current'] !== null) {
|
|
48
|
-
const focusTarget = panelRef['current'].querySelector('.nova-navbar-bridge-menu-close');
|
|
49
|
-
if (focusTarget !== null) {
|
|
50
|
-
focusTarget.focus();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return undefined;
|
|
54
|
-
}, [isOpen]);
|
|
55
|
-
const mobileMenuAriaLabel = translate({
|
|
56
|
-
id: 'theme.navbar.mobileMenuAriaLabel',
|
|
57
|
-
message: 'Navigation menu',
|
|
58
|
-
description: 'The ARIA label for the mobile navigation menu dialog',
|
|
59
|
-
});
|
|
60
|
-
const closeMenuAriaLabel = translate({
|
|
61
|
-
id: 'theme.navbar.closeMenuAriaLabel',
|
|
62
|
-
message: 'Close menu',
|
|
63
|
-
description: 'The ARIA label for the button that closes the mobile navigation menu',
|
|
64
|
-
});
|
|
65
|
-
if (isOpen === false) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
let overlayClassName = 'nova-navbar-bridge-menu-overlay nova-navbar-bridge-menu-open';
|
|
69
|
-
if (isClosing === true) {
|
|
70
|
-
overlayClassName = 'nova-navbar-bridge-menu-overlay nova-navbar-bridge-menu-closing';
|
|
71
|
-
}
|
|
72
|
-
return createPortal(_jsx("div", { className: overlayClassName, onClick: handleClickOutside, role: "presentation", onAnimationEnd: (_event) => {
|
|
73
|
-
if (isClosing === true) {
|
|
74
|
-
onClose();
|
|
75
|
-
setIsClosing(false);
|
|
76
|
-
}
|
|
77
|
-
return undefined;
|
|
78
|
-
}, children: _jsx("div", { className: "nova-navbar-bridge-menu-panel nova-mobile-menu-panel", ref: panelRef, role: "dialog", "aria-modal": "true", "aria-label": mobileMenuAriaLabel, children: _jsxs(SearchProvider, { children: [_jsxs("div", { className: "nova-navbar-bridge-menu-header", children: [_jsx("div", { className: "nova-navbar-bridge-menu-brand", children: _jsx(Link, { to: siteLogo['href'] ?? '/', target: siteLogo['target'], rel: siteLogo['rel'], "aria-label": siteLogo['ariaLabel'], onClick: () => {
|
|
79
|
-
setIsClosing(true);
|
|
8
|
+
return (_jsx(MobileMenuBase, { variantPrefix: "nova-navbar-bridge-menu", renderHeader: (renderHeaderProps) => {
|
|
9
|
+
const closeButton = renderHeaderProps['closeButton'];
|
|
10
|
+
const startClosing = renderHeaderProps['startClosing'];
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "nova-navbar-bridge-menu-header", children: [_jsx("div", { className: "nova-navbar-bridge-menu-brand", children: _jsx(Link, { to: siteLogo['href'] ?? '/', target: siteLogo['target'], rel: siteLogo['rel'], "aria-label": siteLogo['ariaLabel'], onClick: () => {
|
|
12
|
+
startClosing();
|
|
80
13
|
return undefined;
|
|
81
|
-
}, children: _jsx(Logo, { siteLogo: siteLogo }) }) }), _jsx("
|
|
82
|
-
|
|
83
|
-
return undefined;
|
|
84
|
-
}, "aria-label": closeMenuAriaLabel, children: _jsx(Icon, { icon: "lucide:x", width: "20", height: "20", "aria-hidden": "true" }) })] }), _jsx("div", { className: "nova-navbar-bridge-menu-search nova-mobile-menu-search", children: _jsx(SearchInput, {}) }), _jsxs("div", { className: "nova-navbar-bridge-menu-body nova-mobile-menu-body", children: [_jsx(SearchResults, {}), _jsx("div", { className: "nova-navbar-bridge-menu-items nova-mobile-menu-items", children: items.map((navItem, itemIndex) => {
|
|
85
|
-
const navItemType = navItem['type'];
|
|
86
|
-
const navItemChildren = navItem['items'];
|
|
87
|
-
const itemStyle = { '--nova-item-index': itemIndex };
|
|
88
|
-
if (navItemType === 'dropdown'
|
|
89
|
-
|| (navItemType === undefined
|
|
90
|
-
&& Array.isArray(navItemChildren) === true)) {
|
|
91
|
-
const dropdownIcon = navItem['icon'];
|
|
92
|
-
return (_jsxs("details", { className: "nova-navbar-bridge-menu-dropdown", style: itemStyle, children: [_jsxs("summary", { className: "nova-navbar-bridge-menu-dropdown-summary", children: [_jsx(Icon, { icon: dropdownIcon ?? 'lucide:chevron-down', width: "18", height: "18", "aria-hidden": "true" }), _jsx("span", { children: navItem['label'] })] }), _jsx("div", { className: "nova-navbar-bridge-menu-dropdown-children", children: (navItemChildren ?? []).map((childItem) => {
|
|
93
|
-
const childIcon = childItem['icon'];
|
|
94
|
-
const childLinkProps = {};
|
|
95
|
-
const childTo = childItem['to'];
|
|
96
|
-
const childIsActive = (typeof childTo === 'string' && pathname.startsWith(childTo) === true);
|
|
97
|
-
if (childTo !== undefined) {
|
|
98
|
-
Reflect.set(childLinkProps, 'to', childTo);
|
|
99
|
-
}
|
|
100
|
-
if (childItem['href'] !== undefined) {
|
|
101
|
-
Reflect.set(childLinkProps, 'href', childItem['href']);
|
|
102
|
-
}
|
|
103
|
-
if (childIsActive === true) {
|
|
104
|
-
Reflect.set(childLinkProps, 'aria-current', 'page');
|
|
105
|
-
}
|
|
106
|
-
return (_jsxs(Link, { className: "nova-navbar-bridge-menu-item", ...childLinkProps, onClick: () => {
|
|
107
|
-
setIsClosing(true);
|
|
108
|
-
return undefined;
|
|
109
|
-
}, children: [_jsx(Icon, { icon: childIcon ?? 'lucide:link', width: "18", height: "18", "aria-hidden": "true" }), _jsx("span", { children: childItem['label'] })] }, childItem['label']));
|
|
110
|
-
}) })] }, navItem['label']));
|
|
111
|
-
}
|
|
112
|
-
const itemIcon = navItem['icon'];
|
|
113
|
-
const defaultIcon = 'lucide:link';
|
|
114
|
-
const linkProps = {};
|
|
115
|
-
const isActive = navItem['label'] === activeItemLabel;
|
|
116
|
-
if (navItem['to'] !== undefined) {
|
|
117
|
-
Reflect.set(linkProps, 'to', navItem['to']);
|
|
118
|
-
}
|
|
119
|
-
if (navItem['href'] !== undefined) {
|
|
120
|
-
Reflect.set(linkProps, 'href', navItem['href']);
|
|
121
|
-
}
|
|
122
|
-
if (isActive === true) {
|
|
123
|
-
Reflect.set(linkProps, 'aria-current', 'page');
|
|
124
|
-
}
|
|
125
|
-
return (_jsxs(Link, { className: "nova-navbar-bridge-menu-item", style: itemStyle, ...linkProps, onClick: () => {
|
|
126
|
-
setIsClosing(true);
|
|
127
|
-
return undefined;
|
|
128
|
-
}, children: [_jsx(Icon, { icon: itemIcon ?? defaultIcon, width: "18", height: "18", "aria-hidden": "true" }), _jsx("span", { children: navItem['label'] })] }, navItem['label']));
|
|
129
|
-
}) })] })] }) }) }), document.body);
|
|
14
|
+
}, children: _jsx(Logo, { siteLogo: siteLogo }) }) }), closeButton] }), _jsx("div", { className: "nova-navbar-bridge-menu-search nova-mobile-menu-search", children: _jsx(SearchInput, {}) })] }));
|
|
15
|
+
}, isOpen: props['isOpen'], onClose: props['onClose'], items: props['items'], activeItemLabel: props['activeItemLabel'] }));
|
|
130
16
|
}
|
|
131
17
|
export default MobileMenu;
|
|
132
18
|
//# sourceMappingURL=mobile-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-menu.js","sourceRoot":"","sources":["../../../../../src/theme/Navbar/Bridge/mobile-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"mobile-menu.js","sourceRoot":"","sources":["../../../../../src/theme/Navbar/Bridge/mobile-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,cAAc,MAAM,+BAA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obile-menu.d.ts","sourceRoot":"","sources":["../../../../../src/theme/Navbar/Canopy/mobile-menu.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,+CAA+C,EAC/C,iDAAiD,EAElD,MAAM,qDAAqD,CAAC;AAmB7D,iBAAS,UAAU,CAAC,KAAK,EAAE,+CAA+C,GAAG,iDAAiD,CAwC7H;AAED,eAAe,UAAU,CAAC"}
|