@brillout/docpress 0.9.6 → 0.9.8
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/Layout.tsx +2 -1
- package/dist/Layout.js +3 -5
- package/dist/renderer/usePageContext.js +4 -3
- package/dist/types/Config.d.ts +2 -0
- package/package.json +1 -1
- package/renderer/usePageContext.tsx +4 -3
- package/types/Config.ts +2 -0
package/Layout.tsx
CHANGED
|
@@ -448,7 +448,7 @@ function NavHeaderLeftFullWidthBackground() {
|
|
|
448
448
|
|
|
449
449
|
function NavLogo({ className }: { className: string }) {
|
|
450
450
|
const pageContext = usePageContext()
|
|
451
|
-
const iconSize = 39
|
|
451
|
+
const iconSize = pageContext.config.navLogoSize ?? 39
|
|
452
452
|
const { projectName } = pageContext.meta
|
|
453
453
|
return (
|
|
454
454
|
<a
|
|
@@ -477,6 +477,7 @@ function NavLogo({ className }: { className: string }) {
|
|
|
477
477
|
style={{
|
|
478
478
|
marginLeft: `calc(var(--icon-text-padding) + 2px)`,
|
|
479
479
|
fontSize: isProjectNameShort(projectName) ? '1.65em' : '1.3em',
|
|
480
|
+
...pageContext.config.navLogoTextStyle,
|
|
480
481
|
}}
|
|
481
482
|
>
|
|
482
483
|
{projectName}
|
package/dist/Layout.js
CHANGED
|
@@ -260,9 +260,10 @@ function NavHeaderLeftFullWidthBackground() {
|
|
|
260
260
|
css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n@container container-viewport (min-width: 0px) {\n .nav-bg {\n width: 100cqw;\n }\n}\n"], ["\n@container container-viewport (min-width: 0px) {\n .nav-bg {\n width: 100cqw;\n }\n}\n"]))))));
|
|
261
261
|
}
|
|
262
262
|
function NavLogo(_a) {
|
|
263
|
+
var _b;
|
|
263
264
|
var className = _a.className;
|
|
264
265
|
var pageContext = usePageContext();
|
|
265
|
-
var iconSize = 39;
|
|
266
|
+
var iconSize = (_b = pageContext.config.navLogoSize) !== null && _b !== void 0 ? _b : 39;
|
|
266
267
|
var projectName = pageContext.meta.projectName;
|
|
267
268
|
return (React.createElement("a", { className: cls(['nav-logo', className]), style: {
|
|
268
269
|
display: 'flex',
|
|
@@ -279,10 +280,7 @@ function NavLogo(_a) {
|
|
|
279
280
|
ev.preventDefault();
|
|
280
281
|
navigate('/press#logo');
|
|
281
282
|
} }),
|
|
282
|
-
React.createElement("span", { style: {
|
|
283
|
-
marginLeft: "calc(var(--icon-text-padding) + 2px)",
|
|
284
|
-
fontSize: isProjectNameShort(projectName) ? '1.65em' : '1.3em',
|
|
285
|
-
} }, projectName)));
|
|
283
|
+
React.createElement("span", { style: __assign({ marginLeft: "calc(var(--icon-text-padding) + 2px)", fontSize: isProjectNameShort(projectName) ? '1.65em' : '1.3em' }, pageContext.config.navLogoTextStyle) }, projectName)));
|
|
286
284
|
}
|
|
287
285
|
function isProjectNameShort(projectName) {
|
|
288
286
|
return projectName.length <= 4;
|
|
@@ -2,8 +2,9 @@ export { usePageContext };
|
|
|
2
2
|
export { PageContextProvider };
|
|
3
3
|
import React, { useContext } from 'react';
|
|
4
4
|
import { getGlobalObject } from '../utils/getGlobalObject';
|
|
5
|
-
var globalObject = getGlobalObject('
|
|
5
|
+
var globalObject = getGlobalObject('usePageContext.ts', {
|
|
6
6
|
Context: React.createContext(undefined),
|
|
7
|
+
Context2: React.createContext(undefined),
|
|
7
8
|
});
|
|
8
9
|
function PageContextProvider(_a) {
|
|
9
10
|
var pageContext = _a.pageContext, children = _a.children;
|
|
@@ -18,12 +19,12 @@ function usePageContext() {
|
|
|
18
19
|
export { PageContextProvider2 };
|
|
19
20
|
// TODO/refactor: rename to usePageContext and remove old implementation
|
|
20
21
|
export { usePageContext2 };
|
|
21
|
-
var Context2 = React.createContext(undefined);
|
|
22
22
|
function usePageContext2() {
|
|
23
|
-
var pageContext = useContext(Context2);
|
|
23
|
+
var pageContext = useContext(globalObject.Context2);
|
|
24
24
|
return pageContext;
|
|
25
25
|
}
|
|
26
26
|
function PageContextProvider2(_a) {
|
|
27
27
|
var pageContext = _a.pageContext, children = _a.children;
|
|
28
|
+
var Context2 = globalObject.Context2;
|
|
28
29
|
return React.createElement(Context2.Provider, { value: pageContext }, children);
|
|
29
30
|
}
|
package/dist/types/Config.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -6,8 +6,9 @@ import type { PageContextResolved } from '../config/resolvePageContext'
|
|
|
6
6
|
import type { PageContext } from 'vike/types'
|
|
7
7
|
import { getGlobalObject } from '../utils/getGlobalObject'
|
|
8
8
|
|
|
9
|
-
const globalObject = getGlobalObject('
|
|
9
|
+
const globalObject = getGlobalObject('usePageContext.ts', {
|
|
10
10
|
Context: React.createContext<PageContextResolved>(undefined as any),
|
|
11
|
+
Context2: React.createContext<PageContext>(undefined as any),
|
|
11
12
|
})
|
|
12
13
|
|
|
13
14
|
function PageContextProvider({
|
|
@@ -31,9 +32,8 @@ export { PageContextProvider2 }
|
|
|
31
32
|
// TODO/refactor: rename to usePageContext and remove old implementation
|
|
32
33
|
export { usePageContext2 }
|
|
33
34
|
|
|
34
|
-
const Context2 = React.createContext<PageContext>(undefined as any)
|
|
35
35
|
function usePageContext2(): PageContext {
|
|
36
|
-
const pageContext = useContext(Context2)
|
|
36
|
+
const pageContext = useContext(globalObject.Context2)
|
|
37
37
|
return pageContext
|
|
38
38
|
}
|
|
39
39
|
function PageContextProvider2({
|
|
@@ -43,5 +43,6 @@ function PageContextProvider2({
|
|
|
43
43
|
pageContext: PageContext
|
|
44
44
|
children: React.ReactNode
|
|
45
45
|
}) {
|
|
46
|
+
const { Context2 } = globalObject
|
|
46
47
|
return <Context2.Provider value={pageContext}>{children}</Context2.Provider>
|
|
47
48
|
}
|