@brillout/docpress 0.15.13-commit-ffe283f → 0.15.13-commit-03246ec
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 +3 -7
- package/MenuModal/NavigationWithColumnLayout.tsx +14 -5
- package/MenuModal.tsx +3 -0
- package/package.json +1 -1
package/Layout.tsx
CHANGED
|
@@ -255,11 +255,7 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
|
|
|
255
255
|
|
|
256
256
|
const navHeadSecondary = (
|
|
257
257
|
<div
|
|
258
|
-
className={cls([
|
|
259
|
-
'nav-head-secondary',
|
|
260
|
-
isNavLeft && 'show-on-nav-hover add-transition',
|
|
261
|
-
!!navMaxWidth && 'has-max-width',
|
|
262
|
-
])}
|
|
258
|
+
className={cls(['nav-head-secondary', isNavLeft && 'show-on-nav-hover add-transition'])}
|
|
263
259
|
style={{
|
|
264
260
|
padding: 0,
|
|
265
261
|
display: 'flex',
|
|
@@ -289,7 +285,7 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
|
|
|
289
285
|
|
|
290
286
|
return (
|
|
291
287
|
<div
|
|
292
|
-
className={cls(['nav-head', isNavLeft && 'is-nav-left', '
|
|
288
|
+
className={cls(['nav-head link-hover-animation', isNavLeft && 'is-nav-left', !!navMaxWidth && 'has-max-width'])}
|
|
293
289
|
style={{
|
|
294
290
|
display: 'flex',
|
|
295
291
|
justifyContent: isNavLeft ? 'flex-end' : 'center',
|
|
@@ -394,7 +390,7 @@ function getStyleNav() {
|
|
|
394
390
|
}
|
|
395
391
|
&.has-max-width {
|
|
396
392
|
.desktop-grow {
|
|
397
|
-
display: block;
|
|
393
|
+
display: block !important;
|
|
398
394
|
}
|
|
399
395
|
.desktop-grow,
|
|
400
396
|
.nav-head-secondary {
|
|
@@ -23,7 +23,16 @@ function NavigationWithColumnLayout(props: { navItems: NavItem[] }) {
|
|
|
23
23
|
window.addEventListener('resize', throttle(updateviewportwidth, 300), { passive: true })
|
|
24
24
|
})
|
|
25
25
|
const navItemsByColumnLayouts = getNavItemsByColumnLayouts(navItemsWithComputed, viewportWidth)
|
|
26
|
+
const columnWidthBase = navLeftWidthMax + 20
|
|
26
27
|
const maxColumns = Math.max(...navItemsByColumnLayouts.map((layout) => layout.columns.length), 1)
|
|
28
|
+
const widthMax = maxColumns * columnWidthBase
|
|
29
|
+
const getColumnsWrapperStyle = (columnLayout: NavItemsByColumnLayout) => {
|
|
30
|
+
const widthColumn = columnLayout.columns.length * columnWidthBase
|
|
31
|
+
return {
|
|
32
|
+
width: Math.max(700, widthColumn),
|
|
33
|
+
maxWidth: `min(100%, ${widthMax}px)`,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
27
36
|
return (
|
|
28
37
|
<>
|
|
29
38
|
<Style>{getStyle()}</Style>
|
|
@@ -41,7 +50,7 @@ function NavigationWithColumnLayout(props: { navItems: NavItem[] }) {
|
|
|
41
50
|
>
|
|
42
51
|
{columnLayout.isFullWidthCategory ? (
|
|
43
52
|
<div style={{ marginTop: 0 }}>
|
|
44
|
-
<ColumnsWrapper
|
|
53
|
+
<ColumnsWrapper style={getColumnsWrapperStyle(columnLayout)}>
|
|
45
54
|
<Collapsible
|
|
46
55
|
head={(onClick) => <NavItemComponent navItem={columnLayout.navItemLevel1} onClick={onClick} />}
|
|
47
56
|
disabled={maxColumns > 1}
|
|
@@ -62,7 +71,7 @@ function NavigationWithColumnLayout(props: { navItems: NavItem[] }) {
|
|
|
62
71
|
</ColumnsWrapper>
|
|
63
72
|
</div>
|
|
64
73
|
) : (
|
|
65
|
-
<ColumnsWrapper
|
|
74
|
+
<ColumnsWrapper style={getColumnsWrapperStyle(columnLayout)}>
|
|
66
75
|
<ColumnsLayout>
|
|
67
76
|
{columnLayout.columns.map((column, j) => (
|
|
68
77
|
<Column key={j}>
|
|
@@ -166,14 +175,14 @@ function Column({ children }: { children: React.ReactNode }) {
|
|
|
166
175
|
</div>
|
|
167
176
|
)
|
|
168
177
|
}
|
|
169
|
-
function ColumnsWrapper({ children,
|
|
178
|
+
function ColumnsWrapper({ children, style }: { children: React.ReactNode; style: React.CSSProperties }) {
|
|
170
179
|
return (
|
|
171
180
|
<div
|
|
181
|
+
className="columns-wrapper"
|
|
172
182
|
style={{
|
|
173
|
-
width: numberOfColumns * (navLeftWidthMax + 20),
|
|
174
|
-
maxWidth: '100%',
|
|
175
183
|
paddingLeft: 3,
|
|
176
184
|
margin: 'auto',
|
|
185
|
+
...style,
|
|
177
186
|
}}
|
|
178
187
|
>
|
|
179
188
|
{children}
|
package/MenuModal.tsx
CHANGED