@patternfly/documentation-framework 6.0.0-alpha.9 → 6.0.0-alpha.90
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/CHANGELOG.md +1241 -0
- package/README.md +5 -76
- package/app.js +2 -5
- package/components/autoLinkHeader/autoLinkHeader.css +2 -2
- package/components/autoLinkHeader/autoLinkHeader.js +8 -19
- package/components/cssVariables/cssVariables.css +9 -11
- package/components/cssVariables/cssVariables.js +19 -32
- package/components/example/example.css +14 -58
- package/components/example/example.js +149 -78
- package/components/example/exampleToolbar.js +3 -2
- package/components/footer/RHLogoDark.png +0 -0
- package/components/footer/footer.css +31 -93
- package/components/footer/footer.js +139 -78
- package/components/gdprBanner/gdprBanner.css +0 -3
- package/components/gdprBanner/gdprBanner.js +22 -16
- package/components/inlineAlert/inlineAlert.js +1 -1
- package/components/link/link.js +23 -18
- package/components/propsTable/propsTable.js +14 -10
- package/components/sectionGallery/TextSummary.js +5 -5
- package/components/sectionGallery/sectionDataListLayout.js +87 -41
- package/components/sectionGallery/sectionGallery.css +6 -39
- package/components/sectionGallery/sectionGalleryLayout.js +73 -23
- package/components/sectionGallery/sectionGalleryToolbar.js +48 -12
- package/components/sideNav/sideNav.js +3 -4
- package/components/tableOfContents/tableOfContents.css +26 -35
- package/components/tableOfContents/tableOfContents.js +58 -28
- package/layouts/sideNavLayout/sideNavLayout.css +1 -36
- package/layouts/sideNavLayout/sideNavLayout.js +193 -103
- package/package.json +12 -19
- package/pages/404/404.css +2 -2
- package/pages/404/index.js +23 -36
- package/routes.js +3 -1
- package/scripts/md/anchor-header.js +1 -1
- package/scripts/md/parseMD.js +20 -18
- package/scripts/md/styled-tags.js +22 -14
- package/scripts/webpack/webpack.base.config.js +7 -18
- package/scripts/writeScreenshots.js +2 -2
- package/templates/mdx.css +11 -288
- package/templates/mdx.js +40 -43
- package/templates/patternfly-docs/patternfly-docs.source.js +8 -8
- package/versions.json +42 -15
- package/components/sideNav/sideNav.css +0 -21
- package/pages/global-css-variables.md +0 -109
- package/pages/img/component-variable-mapping.png +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
JumpLinks,
|
|
4
|
+
JumpLinksItem,
|
|
5
|
+
JumpLinksList,
|
|
6
|
+
} from '@patternfly/react-core';
|
|
3
7
|
import { trackEvent } from '../../helpers';
|
|
4
8
|
|
|
5
9
|
export const TableOfContents = ({ items }) => {
|
|
@@ -9,15 +13,17 @@ export const TableOfContents = ({ items }) => {
|
|
|
9
13
|
const [stickyNavHeight, setStickyNavHeight] = React.useState(0);
|
|
10
14
|
|
|
11
15
|
React.useEffect(() => {
|
|
12
|
-
if (document.getElementById(
|
|
13
|
-
setStickyNavHeight(
|
|
16
|
+
if (document.getElementById('ws-sticky-nav-tabs')) {
|
|
17
|
+
setStickyNavHeight(
|
|
18
|
+
document.getElementById('ws-sticky-nav-tabs').offsetHeight
|
|
19
|
+
);
|
|
14
20
|
}
|
|
15
|
-
}, [])
|
|
21
|
+
}, []);
|
|
16
22
|
|
|
17
23
|
const updateWidth = () => {
|
|
18
24
|
const { innerWidth } = window;
|
|
19
25
|
innerWidth !== width && setWidth(innerWidth);
|
|
20
|
-
}
|
|
26
|
+
};
|
|
21
27
|
let jumpLinksItems = [];
|
|
22
28
|
let wasSublistRendered = false;
|
|
23
29
|
|
|
@@ -27,14 +33,20 @@ export const TableOfContents = ({ items }) => {
|
|
|
27
33
|
<>
|
|
28
34
|
{item.text}
|
|
29
35
|
<JumpLinksList>
|
|
30
|
-
{nextItemArr.map(curItem => (
|
|
36
|
+
{nextItemArr.map((curItem) => (
|
|
31
37
|
<JumpLinksItem
|
|
32
38
|
key={curItem.id}
|
|
33
39
|
href={`#${curItem.id}`}
|
|
34
40
|
className="ws-toc-item"
|
|
35
41
|
onKeyDown={updateWidth}
|
|
36
42
|
onMouseDown={updateWidth}
|
|
37
|
-
onClick={() =>
|
|
43
|
+
onClick={() =>
|
|
44
|
+
trackEvent(
|
|
45
|
+
'jump_link_click',
|
|
46
|
+
'click_event',
|
|
47
|
+
curItem.id.toUpperCase()
|
|
48
|
+
)
|
|
49
|
+
}
|
|
38
50
|
>
|
|
39
51
|
{curItem.text}
|
|
40
52
|
</JumpLinksItem>
|
|
@@ -42,7 +54,7 @@ export const TableOfContents = ({ items }) => {
|
|
|
42
54
|
</JumpLinksList>
|
|
43
55
|
</>
|
|
44
56
|
);
|
|
45
|
-
}
|
|
57
|
+
};
|
|
46
58
|
|
|
47
59
|
const renderJumpLinksItems = () => {
|
|
48
60
|
items.forEach((item, index) => {
|
|
@@ -53,18 +65,28 @@ export const TableOfContents = ({ items }) => {
|
|
|
53
65
|
return;
|
|
54
66
|
}
|
|
55
67
|
if (!Array.isArray(nextItem) && Array.isArray(item)) {
|
|
56
|
-
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
{
|
|
69
|
+
item.map((curItem) =>
|
|
70
|
+
jumpLinksItems.push(
|
|
71
|
+
<JumpLinksItem
|
|
72
|
+
key={curItem.id}
|
|
73
|
+
href={`#${curItem.id}`}
|
|
74
|
+
className="ws-toc-item"
|
|
75
|
+
onKeyDown={updateWidth}
|
|
76
|
+
onMouseDown={updateWidth}
|
|
77
|
+
onClick={() =>
|
|
78
|
+
trackEvent(
|
|
79
|
+
'jump_link_click',
|
|
80
|
+
'click_event',
|
|
81
|
+
curItem.id.toUpperCase()
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
>
|
|
85
|
+
{curItem.text}
|
|
86
|
+
</JumpLinksItem>
|
|
87
|
+
)
|
|
88
|
+
);
|
|
89
|
+
}
|
|
68
90
|
} else {
|
|
69
91
|
jumpLinksItems.push(
|
|
70
92
|
<JumpLinksItem
|
|
@@ -73,27 +95,35 @@ export const TableOfContents = ({ items }) => {
|
|
|
73
95
|
className="ws-toc-item"
|
|
74
96
|
onKeyDown={updateWidth}
|
|
75
97
|
onMouseDown={updateWidth}
|
|
76
|
-
onClick={() =>
|
|
98
|
+
onClick={() =>
|
|
99
|
+
trackEvent(
|
|
100
|
+
'jump_link_click',
|
|
101
|
+
'click_event',
|
|
102
|
+
item.id.toUpperCase()
|
|
103
|
+
)
|
|
104
|
+
}
|
|
77
105
|
>
|
|
78
|
-
{
|
|
106
|
+
{Array.isArray(nextItem)
|
|
107
|
+
? renderSublist(item, nextItem)
|
|
108
|
+
: item.text}
|
|
79
109
|
</JumpLinksItem>
|
|
80
110
|
);
|
|
81
111
|
}
|
|
82
|
-
})
|
|
112
|
+
});
|
|
83
113
|
return jumpLinksItems;
|
|
84
|
-
}
|
|
114
|
+
};
|
|
85
115
|
|
|
86
116
|
return (
|
|
87
117
|
<JumpLinks
|
|
88
118
|
label="Table of contents"
|
|
89
119
|
isVertical
|
|
90
|
-
scrollableSelector="
|
|
120
|
+
scrollableSelector=".pf-v6-c-page__main-container"
|
|
91
121
|
className="ws-toc"
|
|
92
|
-
style={{
|
|
122
|
+
style={{ top: stickyNavHeight }}
|
|
93
123
|
offset={width > 1450 ? 108 + stickyNavHeight : 148 + stickyNavHeight}
|
|
94
124
|
expandable={{ default: 'expandable', '2xl': 'nonExpandable' }}
|
|
95
125
|
>
|
|
96
|
-
{
|
|
126
|
+
{renderJumpLinksItems()}
|
|
97
127
|
</JumpLinks>
|
|
98
128
|
);
|
|
99
|
-
}
|
|
129
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* Page layout */
|
|
2
|
-
/* tells .pf-
|
|
2
|
+
/* tells .pf-v6-c-page to consume the available space left over from the banners/footers */
|
|
3
3
|
#ws-router {
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
@@ -8,43 +8,8 @@
|
|
|
8
8
|
flex: 1;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.ws-switcher-divider {
|
|
12
|
-
padding: 0 var(--pf-v5-global--spacer--md);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@media (min-width: 1200px) {
|
|
16
|
-
.ws-page-sidebar {
|
|
17
|
-
box-shadow: none !important;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.ws-page-sidebar > .pf-v5-c-page__sidebar-body {
|
|
22
|
-
padding-top: var(--pf-v5-global--spacer--md);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
11
|
/* Search */
|
|
26
12
|
#algolia-autocomplete-listbox-0 {
|
|
27
13
|
/* Fix search results overflowing page */
|
|
28
14
|
min-width: 480px !important;
|
|
29
15
|
}
|
|
30
|
-
.ws-global-search.pf-v5-c-input-group {
|
|
31
|
-
/* remove white background on dark Masthead */
|
|
32
|
-
--pf-v5-c-input-group--BackgroundColor: none;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* For tiny (200px) viewports */
|
|
36
|
-
.ws-masthead .pf-v5-c-toolbar__item {
|
|
37
|
-
min-width: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.ws-masthead .pf-v5-c-switch {
|
|
41
|
-
align-items: center;
|
|
42
|
-
--pf-v5-c-switch__input--not-checked__label--Color: var(--pf-v5-global--Color--100);
|
|
43
|
-
--pf-v5-c-switch__input--checked__label--Color: var(--pf-v5-global--Color--100);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.ws-masthead .pf-v5-c-toggle-group {
|
|
47
|
-
--pf-v5-c-toggle-group__button--m-selected--BackgroundColor: var(--pf-v5-global--palette--blue-400);
|
|
48
|
-
--pf-v5-c-toggle-group__button--focus--BackgroundColor: transparent;
|
|
49
|
-
--pf-v5-c-toggle-group__button--hover--BackgroundColor: transparent;
|
|
50
|
-
}
|
|
@@ -24,9 +24,10 @@ import {
|
|
|
24
24
|
ToolbarItem,
|
|
25
25
|
SkipToContent,
|
|
26
26
|
Switch,
|
|
27
|
-
SearchInput,
|
|
27
|
+
// SearchInput,
|
|
28
28
|
ToggleGroup,
|
|
29
|
-
ToggleGroupItem
|
|
29
|
+
ToggleGroupItem,
|
|
30
|
+
MastheadLogo,
|
|
30
31
|
} from '@patternfly/react-core';
|
|
31
32
|
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
32
33
|
import GithubIcon from '@patternfly/react-icons/dist/esm/icons/github-icon';
|
|
@@ -34,7 +35,7 @@ import MoonIcon from '@patternfly/react-icons/dist/esm/icons/moon-icon';
|
|
|
34
35
|
import SunIcon from '@patternfly/react-icons/dist/esm/icons/sun-icon';
|
|
35
36
|
import { SideNav, TopNav, GdprBanner } from '../../components';
|
|
36
37
|
import staticVersions from '../../versions.json';
|
|
37
|
-
import
|
|
38
|
+
import { Footer } from '@patternfly/documentation-framework/components';
|
|
38
39
|
|
|
39
40
|
export const RtlContext = createContext(false);
|
|
40
41
|
|
|
@@ -46,43 +47,54 @@ const HeaderTools = ({
|
|
|
46
47
|
hasRTLSwitcher,
|
|
47
48
|
topNavItems,
|
|
48
49
|
isRTL,
|
|
49
|
-
setIsRTL
|
|
50
|
+
setIsRTL,
|
|
51
|
+
isDarkTheme,
|
|
52
|
+
setIsDarkTheme,
|
|
50
53
|
}) => {
|
|
51
|
-
const initialVersion = staticVersions.Releases.find(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
54
|
+
const initialVersion = staticVersions.Releases.find(
|
|
55
|
+
(release) => release.latest
|
|
56
|
+
);
|
|
57
|
+
const latestVersion = versions.Releases.find((version) => version.latest);
|
|
58
|
+
const previousReleases = Object.values(versions.Releases).filter(
|
|
59
|
+
(version) => !version.hidden && !version.latest
|
|
60
|
+
);
|
|
61
|
+
// const hasSearch = algolia;
|
|
55
62
|
const [isDropdownOpen, setDropdownOpen] = useState(false);
|
|
56
|
-
const [searchValue, setSearchValue] = React.useState('');
|
|
57
|
-
const [isSearchExpanded, setIsSearchExpanded] = React.useState(false);
|
|
58
|
-
const [isDarkTheme, setIsDarkTheme] = React.useState(false);
|
|
63
|
+
// const [searchValue, setSearchValue] = React.useState('');
|
|
64
|
+
// const [isSearchExpanded, setIsSearchExpanded] = React.useState(false);
|
|
59
65
|
|
|
60
66
|
const getDropdownItem = (version, isLatest = false) => (
|
|
61
|
-
<DropdownItem
|
|
62
|
-
{
|
|
67
|
+
<DropdownItem
|
|
68
|
+
itemId={version.name}
|
|
69
|
+
key={version.name}
|
|
70
|
+
to={isLatest ? '/' : `/${version.name}`}
|
|
71
|
+
>
|
|
72
|
+
{`Current ${version.name}`}
|
|
63
73
|
</DropdownItem>
|
|
64
74
|
);
|
|
65
75
|
|
|
66
|
-
const onChange = (_evt, value) => {
|
|
67
|
-
|
|
68
|
-
};
|
|
76
|
+
// const onChange = (_evt, value) => {
|
|
77
|
+
// setSearchValue(value);
|
|
78
|
+
// };
|
|
69
79
|
|
|
70
|
-
const onToggleExpand = (_evt, isSearchExpanded) => {
|
|
71
|
-
|
|
72
|
-
};
|
|
80
|
+
// const onToggleExpand = (_evt, isSearchExpanded) => {
|
|
81
|
+
// setIsSearchExpanded(!isSearchExpanded);
|
|
82
|
+
// };
|
|
73
83
|
|
|
74
84
|
const toggleDarkTheme = (_evt, selected) => {
|
|
75
|
-
const darkThemeToggleClicked = !selected === isDarkTheme
|
|
76
|
-
document
|
|
85
|
+
const darkThemeToggleClicked = !selected === isDarkTheme;
|
|
86
|
+
document
|
|
87
|
+
.querySelector('html')
|
|
88
|
+
.classList.toggle('pf-v6-theme-dark', darkThemeToggleClicked);
|
|
77
89
|
setIsDarkTheme(darkThemeToggleClicked);
|
|
78
90
|
};
|
|
79
91
|
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, [isSearchExpanded])
|
|
92
|
+
// useEffect(() => {
|
|
93
|
+
// // reattach algolia to input each time search is expanded
|
|
94
|
+
// if (hasSearch && isSearchExpanded) {
|
|
95
|
+
// attachDocSearch(algolia, '.ws-global-search .pf-v6-c-text-input-group__text-input', 1000);
|
|
96
|
+
// }
|
|
97
|
+
// }, [isSearchExpanded])
|
|
86
98
|
|
|
87
99
|
return (
|
|
88
100
|
<Toolbar isFullHeight>
|
|
@@ -92,24 +104,36 @@ const HeaderTools = ({
|
|
|
92
104
|
<TopNav navItems={topNavItems} />
|
|
93
105
|
</ToolbarItem>
|
|
94
106
|
)}
|
|
95
|
-
<ToolbarGroup
|
|
96
|
-
align={{ default: 'alignRight' }}
|
|
97
|
-
spaceItems={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
98
|
-
>
|
|
107
|
+
<ToolbarGroup align={{ default: 'alignEnd' }}>
|
|
99
108
|
{hasDarkThemeSwitcher && (
|
|
100
109
|
<ToolbarItem>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
<ToggleGroup aria-label="Dark theme toggle group">
|
|
111
|
+
<ToggleGroupItem
|
|
112
|
+
aria-label="light theme toggle"
|
|
113
|
+
icon={<SunIcon />}
|
|
114
|
+
isSelected={!isDarkTheme}
|
|
115
|
+
onChange={toggleDarkTheme}
|
|
116
|
+
/>
|
|
117
|
+
<ToggleGroupItem
|
|
118
|
+
aria-label="dark theme toggle"
|
|
119
|
+
icon={<MoonIcon />}
|
|
120
|
+
isSelected={isDarkTheme}
|
|
121
|
+
onChange={toggleDarkTheme}
|
|
122
|
+
/>
|
|
123
|
+
</ToggleGroup>
|
|
105
124
|
</ToolbarItem>
|
|
106
125
|
)}
|
|
107
126
|
{hasRTLSwitcher && (
|
|
108
127
|
<ToolbarItem>
|
|
109
|
-
<Switch
|
|
128
|
+
<Switch
|
|
129
|
+
id="ws-rtl-switch"
|
|
130
|
+
label={'RTL'}
|
|
131
|
+
defaultChecked={isRTL}
|
|
132
|
+
onChange={() => setIsRTL((isRTL) => !isRTL)}
|
|
133
|
+
/>
|
|
110
134
|
</ToolbarItem>
|
|
111
135
|
)}
|
|
112
|
-
{hasSearch && (
|
|
136
|
+
{/* {hasSearch && (
|
|
113
137
|
<ToolbarItem>
|
|
114
138
|
<SearchInput
|
|
115
139
|
className="ws-global-search"
|
|
@@ -120,7 +144,7 @@ const HeaderTools = ({
|
|
|
120
144
|
expandableInput={{ isExpanded: isSearchExpanded, onToggleExpand, toggleAriaLabel: 'Expandable search input toggle' }}
|
|
121
145
|
/>
|
|
122
146
|
</ToolbarItem>
|
|
123
|
-
)}
|
|
147
|
+
)} */}
|
|
124
148
|
<ToolbarItem>
|
|
125
149
|
<Button
|
|
126
150
|
component="a"
|
|
@@ -145,7 +169,7 @@ const HeaderTools = ({
|
|
|
145
169
|
onClick={() => setDropdownOpen(!isDropdownOpen)}
|
|
146
170
|
isExpanded={isDropdownOpen}
|
|
147
171
|
>
|
|
148
|
-
|
|
172
|
+
Current alphas
|
|
149
173
|
</MenuToggle>
|
|
150
174
|
)}
|
|
151
175
|
>
|
|
@@ -155,20 +179,52 @@ const HeaderTools = ({
|
|
|
155
179
|
</DropdownList>
|
|
156
180
|
</DropdownGroup>
|
|
157
181
|
{previousReleases.length > 0 && (
|
|
158
|
-
<DropdownGroup
|
|
182
|
+
<DropdownGroup
|
|
183
|
+
key="Previous releases"
|
|
184
|
+
label="Previous releases"
|
|
185
|
+
>
|
|
159
186
|
<DropdownList>
|
|
160
187
|
{previousReleases
|
|
161
|
-
.slice(0,3)
|
|
162
|
-
.map(version => getDropdownItem(version))}
|
|
188
|
+
.slice(0, 3)
|
|
189
|
+
.map((version) => getDropdownItem(version))}
|
|
163
190
|
</DropdownList>
|
|
164
191
|
</DropdownGroup>
|
|
165
192
|
)}
|
|
166
|
-
<Divider key="
|
|
167
|
-
<DropdownGroup
|
|
193
|
+
<Divider key="divider1" />
|
|
194
|
+
<DropdownGroup
|
|
195
|
+
key="Alpha preview version"
|
|
196
|
+
label="Alpha preview version"
|
|
197
|
+
>
|
|
168
198
|
<DropdownList>
|
|
199
|
+
<DropdownItem
|
|
200
|
+
key="PatternFly 6"
|
|
201
|
+
className="ws-patternfly-versions"
|
|
202
|
+
isExternalLink
|
|
203
|
+
to="https://staging-v6.patternfly.org/"
|
|
204
|
+
itemId="patternfly-6"
|
|
205
|
+
>
|
|
206
|
+
PatternFly 6
|
|
207
|
+
</DropdownItem>
|
|
208
|
+
</DropdownList>
|
|
209
|
+
</DropdownGroup>
|
|
210
|
+
<Divider key="divider2" />
|
|
211
|
+
<DropdownGroup
|
|
212
|
+
key="Previous versions"
|
|
213
|
+
label="Previous versions"
|
|
214
|
+
>
|
|
215
|
+
<DropdownList>
|
|
216
|
+
<DropdownItem
|
|
217
|
+
key="PatternFly 5"
|
|
218
|
+
className="ws-patternfly-versions"
|
|
219
|
+
isExternalLink
|
|
220
|
+
to="https://www.patternfly.org"
|
|
221
|
+
itemId="patternfly-5"
|
|
222
|
+
>
|
|
223
|
+
PatternFly 5
|
|
224
|
+
</DropdownItem>
|
|
169
225
|
<DropdownItem
|
|
170
226
|
key="PatternFly 4"
|
|
171
|
-
className="ws-patternfly-
|
|
227
|
+
className="ws-patternfly-versions"
|
|
172
228
|
isExternalLink
|
|
173
229
|
to="http://v4-archive.patternfly.org/v4/"
|
|
174
230
|
itemId="patternfly-4"
|
|
@@ -177,7 +233,7 @@ const HeaderTools = ({
|
|
|
177
233
|
</DropdownItem>
|
|
178
234
|
<DropdownItem
|
|
179
235
|
key="PatternFly 3"
|
|
180
|
-
className="ws-patternfly-
|
|
236
|
+
className="ws-patternfly-versions"
|
|
181
237
|
isExternalLink
|
|
182
238
|
to="https://pf3.patternfly.org/"
|
|
183
239
|
itemId="patternfly-3"
|
|
@@ -189,10 +245,11 @@ const HeaderTools = ({
|
|
|
189
245
|
</Dropdown>
|
|
190
246
|
</ToolbarItem>
|
|
191
247
|
)}
|
|
192
|
-
</ToolbarGroup
|
|
248
|
+
</ToolbarGroup>
|
|
249
|
+
</ToolbarContent>
|
|
193
250
|
</Toolbar>
|
|
194
251
|
);
|
|
195
|
-
}
|
|
252
|
+
};
|
|
196
253
|
|
|
197
254
|
// https://github.com/algolia/autocomplete.js#global-options
|
|
198
255
|
export function attachDocSearch(algolia, inputSelector, timeout) {
|
|
@@ -201,18 +258,21 @@ export function attachDocSearch(algolia, inputSelector, timeout) {
|
|
|
201
258
|
inputSelector,
|
|
202
259
|
autocompleteOptions: {
|
|
203
260
|
hint: false,
|
|
204
|
-
appendTo: `.ws-global-search .pf-
|
|
261
|
+
appendTo: `.ws-global-search .pf-v6-c-text-input-group`,
|
|
205
262
|
},
|
|
206
263
|
debug: process.env.NODE_ENV !== 'production',
|
|
207
|
-
...algolia
|
|
264
|
+
...algolia,
|
|
208
265
|
});
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
266
|
+
} else {
|
|
211
267
|
setTimeout(() => attachDocSearch(algolia, inputSelector, timeout), timeout);
|
|
212
268
|
}
|
|
213
269
|
}
|
|
214
270
|
|
|
215
|
-
export const SideNavLayout = ({
|
|
271
|
+
export const SideNavLayout = ({
|
|
272
|
+
children,
|
|
273
|
+
groupedRoutes,
|
|
274
|
+
navOpen: navOpenProp,
|
|
275
|
+
}) => {
|
|
216
276
|
const algolia = process.env.algolia;
|
|
217
277
|
const hasGdprBanner = process.env.hasGdprBanner;
|
|
218
278
|
const hasVersionSwitcher = process.env.hasVersionSwitcher;
|
|
@@ -225,69 +285,95 @@ export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp })
|
|
|
225
285
|
|
|
226
286
|
const [versions, setVersions] = useState({ ...staticVersions });
|
|
227
287
|
const [isRTL, setIsRTL] = useState(false);
|
|
288
|
+
const [isDarkTheme, setIsDarkTheme] = React.useState(false);
|
|
228
289
|
|
|
229
290
|
useEffect(() => {
|
|
230
291
|
if (typeof window === 'undefined') {
|
|
231
292
|
return;
|
|
232
293
|
}
|
|
233
294
|
if (hasVersionSwitcher && window.fetch) {
|
|
234
|
-
fetch('/versions.json').then(res => {
|
|
295
|
+
fetch('/versions.json').then((res) => {
|
|
235
296
|
if (res.ok) {
|
|
236
|
-
res.json().then(json => setVersions(json));
|
|
297
|
+
res.json().then((json) => setVersions(json));
|
|
237
298
|
}
|
|
238
299
|
});
|
|
239
300
|
}
|
|
240
301
|
}, []);
|
|
241
302
|
|
|
242
303
|
const SideBar = (
|
|
243
|
-
<PageSidebar
|
|
244
|
-
className="ws-page-sidebar"
|
|
245
|
-
theme="light"
|
|
246
|
-
>
|
|
304
|
+
<PageSidebar>
|
|
247
305
|
<PageSidebarBody>
|
|
248
306
|
<SideNav navItems={sideNavItems} groupedRoutes={groupedRoutes} />
|
|
249
307
|
</PageSidebarBody>
|
|
250
308
|
</PageSidebar>
|
|
251
309
|
);
|
|
252
310
|
|
|
253
|
-
const
|
|
254
|
-
<Masthead
|
|
255
|
-
<MastheadToggle>
|
|
256
|
-
<PageToggleButton variant="plain" aria-label="Global navigation">
|
|
257
|
-
<BarsIcon />
|
|
258
|
-
</PageToggleButton>
|
|
259
|
-
</MastheadToggle>
|
|
311
|
+
const masthead = (
|
|
312
|
+
<Masthead>
|
|
260
313
|
<MastheadMain>
|
|
261
|
-
<
|
|
262
|
-
|
|
263
|
-
<
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
<
|
|
272
|
-
<
|
|
273
|
-
|
|
274
|
-
<
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
314
|
+
<MastheadToggle>
|
|
315
|
+
<PageToggleButton variant="plain" aria-label="Global navigation">
|
|
316
|
+
<BarsIcon />
|
|
317
|
+
</PageToggleButton>
|
|
318
|
+
</MastheadToggle>
|
|
319
|
+
<MastheadBrand>
|
|
320
|
+
{prnum ? (
|
|
321
|
+
`PR #${prnum}`
|
|
322
|
+
) : (
|
|
323
|
+
<MastheadLogo href={prurl || '/'}>
|
|
324
|
+
<svg height="40px" viewBox="0 0 679 158">
|
|
325
|
+
<title>PF-HorizontalLogo-Color</title>
|
|
326
|
+
<defs>
|
|
327
|
+
<linearGradient
|
|
328
|
+
x1="68%"
|
|
329
|
+
y1="2.25860997e-13%"
|
|
330
|
+
x2="32%"
|
|
331
|
+
y2="100%"
|
|
332
|
+
id="linearGradient-website-masthead"
|
|
333
|
+
>
|
|
334
|
+
<stop stopColor="#2B9AF3" offset="0%"></stop>
|
|
335
|
+
<stop
|
|
336
|
+
stopColor="#73BCF7"
|
|
337
|
+
stopOpacity="0.502212631"
|
|
338
|
+
offset="100%"
|
|
339
|
+
></stop>
|
|
340
|
+
</linearGradient>
|
|
341
|
+
</defs>
|
|
342
|
+
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
|
|
343
|
+
<g
|
|
344
|
+
transform="translate(206.000000, 45.750000)"
|
|
345
|
+
fill="var(--pf-t--global--text--color--regular)"
|
|
346
|
+
fillRule="nonzero"
|
|
347
|
+
>
|
|
348
|
+
<path d="M0,65.25 L0,2.25 L33.21,2.25 C37.35,2.25 41.025,3.135 44.235,4.905 C47.445,6.675 49.98,9.09 51.84,12.15 C53.7,15.21 54.63,18.72 54.63,22.68 C54.63,26.46 53.7,29.865 51.84,32.895 C49.98,35.925 47.43,38.31 44.19,40.05 C40.95,41.79 37.29,42.66 33.21,42.66 L15.48,42.66 L15.48,65.25 L0,65.25 Z M15.48,29.88 L31.41,29.88 C33.69,29.88 35.52,29.22 36.9,27.9 C38.28,26.58 38.97,24.87 38.97,22.77 C38.97,20.61 38.28,18.855 36.9,17.505 C35.52,16.155 33.69,15.48 31.41,15.48 L15.48,15.48 L15.48,29.88 Z"></path>
|
|
349
|
+
<path d="M77.04,66.06 C73.68,66.06 70.695,65.43 68.085,64.17 C65.475,62.91 63.435,61.17 61.965,58.95 C60.495,56.73 59.76,54.18 59.76,51.3 C59.76,46.74 61.485,43.215 64.935,40.725 C68.385,38.235 73.2,36.99 79.38,36.99 C83.1,36.99 86.7,37.44 90.18,38.34 L90.18,36 C90.18,31.26 87.15,28.89 81.09,28.89 C77.49,28.89 72.69,30.15 66.69,32.67 L61.47,21.96 C69.15,18.48 76.56,16.74 83.7,16.74 C90.3,16.74 95.43,18.315 99.09,21.465 C102.75,24.615 104.58,29.04 104.58,34.74 L104.58,65.25 L90.18,65.25 L90.18,62.37 C88.26,63.69 86.235,64.635 84.105,65.205 C81.975,65.775 79.62,66.06 77.04,66.06 Z M73.62,51.03 C73.62,52.53 74.28,53.7 75.6,54.54 C76.92,55.38 78.75,55.8 81.09,55.8 C84.69,55.8 87.72,55.05 90.18,53.55 L90.18,47.43 C87.42,46.71 84.54,46.35 81.54,46.35 C79.02,46.35 77.07,46.755 75.69,47.565 C74.31,48.375 73.62,49.53 73.62,51.03 Z"></path>
|
|
350
|
+
<path d="M137.25,65.88 C125.73,65.88 119.97,60.84 119.97,50.76 L119.97,29.79 L110.34,29.79 L110.34,17.64 L119.97,17.64 L119.97,5.4 L134.55,2.25 L134.55,17.64 L147.87,17.64 L147.87,29.79 L134.55,29.79 L134.55,47.88 C134.55,49.98 135.015,51.465 135.945,52.335 C136.875,53.205 138.51,53.64 140.85,53.64 C143.01,53.64 145.2,53.31 147.42,52.65 L147.42,64.44 C146.1,64.86 144.42,65.205 142.38,65.475 C140.34,65.745 138.63,65.88 137.25,65.88 Z"></path>
|
|
351
|
+
<path d="M177.57,65.88 C166.05,65.88 160.29,60.84 160.29,50.76 L160.29,29.79 L150.66,29.79 L150.66,17.64 L160.29,17.64 L160.29,5.4 L174.87,2.25 L174.87,17.64 L188.19,17.64 L188.19,29.79 L174.87,29.79 L174.87,47.88 C174.87,49.98 175.335,51.465 176.265,52.335 C177.195,53.205 178.83,53.64 181.17,53.64 C183.33,53.64 185.52,53.31 187.74,52.65 L187.74,64.44 C186.42,64.86 184.74,65.205 182.7,65.475 C180.66,65.745 178.95,65.88 177.57,65.88 Z"></path>
|
|
352
|
+
<path d="M217.62,66.15 C212.76,66.15 208.365,65.055 204.435,62.865 C200.505,60.675 197.4,57.72 195.12,54 C192.84,50.28 191.7,46.11 191.7,41.49 C191.7,36.87 192.795,32.7 194.985,28.98 C197.175,25.26 200.16,22.305 203.94,20.115 C207.72,17.925 211.92,16.83 216.54,16.83 C221.22,16.83 225.36,17.955 228.96,20.205 C232.56,22.455 235.395,25.53 237.465,29.43 C239.535,33.33 240.57,37.8 240.57,42.84 L240.57,46.44 L206.64,46.44 C207.6,48.66 209.1,50.475 211.14,51.885 C213.18,53.295 215.58,54 218.34,54 C222.42,54 225.6,52.8 227.88,50.4 L237.51,58.95 C234.51,61.47 231.435,63.3 228.285,64.44 C225.135,65.58 221.58,66.15 217.62,66.15 Z M206.37,36.27 L226.26,36.27 C225.48,33.99 224.205,32.16 222.435,30.78 C220.665,29.4 218.61,28.71 216.27,28.71 C213.87,28.71 211.8,29.37 210.06,30.69 C208.32,32.01 207.09,33.87 206.37,36.27 Z"></path>
|
|
353
|
+
<path d="M247.41,65.25 L247.41,17.64 L261.99,17.64 L261.99,22.41 C265.23,18.51 269.4,16.56 274.5,16.56 C277.08,16.62 278.91,17.01 279.99,17.73 L279.99,30.42 C277.95,29.46 275.64,28.98 273.06,28.98 C270.78,28.98 268.665,29.505 266.715,30.555 C264.765,31.605 263.19,33.09 261.99,35.01 L261.99,65.25 L247.41,65.25 Z"></path>
|
|
354
|
+
<path d="M286.29,65.25 L286.29,17.64 L300.87,17.64 L300.87,20.88 C304.47,18.12 308.73,16.74 313.65,16.74 C317.37,16.74 320.655,17.55 323.505,19.17 C326.355,20.79 328.59,23.04 330.21,25.92 C331.83,28.8 332.64,32.13 332.64,35.91 L332.64,65.25 L318.06,65.25 L318.06,37.89 C318.06,35.25 317.28,33.15 315.72,31.59 C314.16,30.03 312.06,29.25 309.42,29.25 C305.76,29.25 302.91,30.51 300.87,33.03 L300.87,65.25 L286.29,65.25 Z"></path>
|
|
355
|
+
<polygon points="342 65.25 342 2.25 392.04 2.25 392.04 15.66 357.48 15.66 357.48 27.45 380.52 27.45 380.52 40.41 357.48 40.41 357.48 65.25"></polygon>
|
|
356
|
+
<polygon points="399.96 65.25 399.96 2.25 414.54 0 414.54 65.25"></polygon>
|
|
357
|
+
<path d="M429.21,84.69 C428.07,84.69 426.96,84.645 425.88,84.555 C424.8,84.465 423.9,84.33 423.18,84.15 L423.18,71.73 C424.38,71.97 425.88,72.09 427.68,72.09 C432.36,72.09 435.51,70.05 437.13,65.97 L437.13,65.88 L418.86,17.64 L434.97,17.64 L445.5,47.61 L457.74,17.64 L473.49,17.64 L452.16,67.68 C450.42,71.82 448.5,75.135 446.4,77.625 C444.3,80.115 441.87,81.915 439.11,83.025 C436.35,84.135 433.05,84.69 429.21,84.69 Z"></path>
|
|
358
|
+
</g>
|
|
359
|
+
<g transform="translate(0.000000, 0.000000)">
|
|
360
|
+
<path
|
|
361
|
+
d="M61.826087,0 L158,0 L158,96.173913 L147.695652,96.173913 C100.271201,96.173913 61.826087,57.7287992 61.826087,10.3043478 L61.826087,0 L61.826087,0 Z"
|
|
362
|
+
fill="var(--pf-t--color--blue--50)"
|
|
363
|
+
></path>
|
|
364
|
+
<path
|
|
365
|
+
d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z"
|
|
366
|
+
fill="url(#linearGradient-website-masthead)"
|
|
367
|
+
></path>
|
|
368
|
+
<path
|
|
369
|
+
d="M123.652174,-30.9130435 L30.9130435,123.652174 L103.652174,123.652174 C114.697869,123.652174 123.652174,114.697869 123.652174,103.652174 L123.652174,-30.9130435 L123.652174,-30.9130435 Z"
|
|
370
|
+
fill="url(#linearGradient-website-masthead)"
|
|
371
|
+
transform="translate(77.282609, 46.369565) scale(1, -1) rotate(90.000000) translate(-77.282609, -46.369565) "
|
|
372
|
+
></path>
|
|
373
|
+
</g>
|
|
288
374
|
</g>
|
|
289
|
-
</
|
|
290
|
-
</
|
|
375
|
+
</svg>
|
|
376
|
+
</MastheadLogo>
|
|
291
377
|
)}
|
|
292
378
|
</MastheadBrand>
|
|
293
379
|
</MastheadMain>
|
|
@@ -302,30 +388,34 @@ export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp })
|
|
|
302
388
|
topNavItems={topNavItems}
|
|
303
389
|
isRTL={isRTL}
|
|
304
390
|
setIsRTL={setIsRTL}
|
|
391
|
+
isDarkTheme={isDarkTheme}
|
|
392
|
+
setIsDarkTheme={setIsDarkTheme}
|
|
305
393
|
/>
|
|
306
394
|
)}
|
|
307
395
|
</MastheadContent>
|
|
308
396
|
</Masthead>
|
|
309
|
-
)
|
|
397
|
+
);
|
|
310
398
|
|
|
311
399
|
return (
|
|
312
400
|
<React.Fragment>
|
|
313
|
-
<RtlContext.Provider value={
|
|
401
|
+
<RtlContext.Provider value={isRTL}>
|
|
314
402
|
<Page
|
|
315
403
|
id="ws-page"
|
|
316
404
|
mainContainerId="ws-page-main"
|
|
317
|
-
|
|
405
|
+
mainComponent="div"
|
|
406
|
+
masthead={masthead}
|
|
318
407
|
sidebar={SideBar}
|
|
319
|
-
skipToContent={
|
|
408
|
+
skipToContent={
|
|
409
|
+
<SkipToContent href="#ws-page-main">Skip to content</SkipToContent>
|
|
410
|
+
}
|
|
320
411
|
isManagedSidebar
|
|
321
412
|
defaultManagedSidebarIsOpen={navOpenProp}
|
|
322
413
|
>
|
|
323
414
|
{children}
|
|
415
|
+
{process.env.hasFooter && <Footer isDarkTheme={isDarkTheme} />}
|
|
324
416
|
</Page>
|
|
325
|
-
<div id="ws-page-banners">
|
|
326
|
-
{hasGdprBanner && <GdprBanner />}
|
|
327
|
-
</div>
|
|
417
|
+
<div id="ws-page-banners">{hasGdprBanner && <GdprBanner />}</div>
|
|
328
418
|
</RtlContext.Provider>
|
|
329
419
|
</React.Fragment>
|
|
330
420
|
);
|
|
331
|
-
}
|
|
421
|
+
};
|