@patternfly/documentation-framework 6.0.0-alpha.99 → 6.0.2
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 +279 -0
- package/components/autoLinkHeader/autoLinkHeader.js +1 -0
- package/components/cssVariables/cssVariables.js +63 -57
- package/components/footer/footer.js +52 -34
- package/components/sectionGallery/TextSummary.js +6 -6
- package/components/sectionGallery/sectionDataListLayout.js +7 -7
- package/components/sectionGallery/sectionGalleryToolbar.js +14 -14
- package/components/sideNav/sideNav.js +161 -71
- package/layouts/sideNavLayout/sideNavLayout.js +42 -93
- package/package.json +8 -8
- package/scripts/md/parseMD.js +3 -3
- package/scripts/md/styled-tags.js +1 -1
- package/scripts/md/typecheck.js +4 -0
- package/templates/mdx.js +248 -116
- package/versions.json +165 -20
|
@@ -4,13 +4,11 @@ import {
|
|
|
4
4
|
Page,
|
|
5
5
|
PageSidebar,
|
|
6
6
|
PageSidebarBody,
|
|
7
|
-
Brand,
|
|
8
7
|
Dropdown,
|
|
9
8
|
DropdownItem,
|
|
10
9
|
DropdownGroup,
|
|
11
10
|
DropdownList,
|
|
12
11
|
Divider,
|
|
13
|
-
Icon,
|
|
14
12
|
Masthead,
|
|
15
13
|
MastheadToggle,
|
|
16
14
|
MastheadMain,
|
|
@@ -24,10 +22,10 @@ import {
|
|
|
24
22
|
ToolbarItem,
|
|
25
23
|
SkipToContent,
|
|
26
24
|
Switch,
|
|
27
|
-
|
|
25
|
+
SearchInput,
|
|
28
26
|
ToggleGroup,
|
|
29
27
|
ToggleGroupItem,
|
|
30
|
-
MastheadLogo
|
|
28
|
+
MastheadLogo
|
|
31
29
|
} from '@patternfly/react-core';
|
|
32
30
|
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
33
31
|
import GithubIcon from '@patternfly/react-icons/dist/esm/icons/github-icon';
|
|
@@ -49,52 +47,41 @@ const HeaderTools = ({
|
|
|
49
47
|
isRTL,
|
|
50
48
|
setIsRTL,
|
|
51
49
|
isDarkTheme,
|
|
52
|
-
setIsDarkTheme
|
|
50
|
+
setIsDarkTheme
|
|
53
51
|
}) => {
|
|
54
|
-
const initialVersion = staticVersions.Releases.find(
|
|
55
|
-
(release) => release.latest
|
|
56
|
-
);
|
|
57
52
|
const latestVersion = versions.Releases.find((version) => version.latest);
|
|
58
|
-
const previousReleases = Object.values(versions.Releases).filter(
|
|
59
|
-
|
|
60
|
-
);
|
|
61
|
-
// const hasSearch = algolia;
|
|
53
|
+
const previousReleases = Object.values(versions.Releases).filter((version) => !version.hidden && !version.latest);
|
|
54
|
+
const hasSearch = algolia;
|
|
62
55
|
const [isDropdownOpen, setDropdownOpen] = useState(false);
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
const [searchValue, setSearchValue] = React.useState('');
|
|
57
|
+
const [isSearchExpanded, setIsSearchExpanded] = React.useState(false);
|
|
65
58
|
|
|
66
59
|
const getDropdownItem = (version, isLatest = false) => (
|
|
67
|
-
<DropdownItem
|
|
68
|
-
|
|
69
|
-
key={version.name}
|
|
70
|
-
to={isLatest ? '/' : `/${version.name}`}
|
|
71
|
-
>
|
|
72
|
-
{`Current ${version.name}`}
|
|
60
|
+
<DropdownItem itemId={version.name} key={version.name} to={isLatest ? '/' : `/${version.name}`}>
|
|
61
|
+
{`Release ${version.name}`}
|
|
73
62
|
</DropdownItem>
|
|
74
63
|
);
|
|
75
64
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
const onChange = (_evt, value) => {
|
|
66
|
+
setSearchValue(value);
|
|
67
|
+
};
|
|
79
68
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
69
|
+
const onToggleExpand = (_evt, isSearchExpanded) => {
|
|
70
|
+
setIsSearchExpanded(!isSearchExpanded);
|
|
71
|
+
};
|
|
83
72
|
|
|
84
73
|
const toggleDarkTheme = (_evt, selected) => {
|
|
85
74
|
const darkThemeToggleClicked = !selected === isDarkTheme;
|
|
86
|
-
document
|
|
87
|
-
.querySelector('html')
|
|
88
|
-
.classList.toggle('pf-v6-theme-dark', darkThemeToggleClicked);
|
|
75
|
+
document.querySelector('html').classList.toggle('pf-v6-theme-dark', darkThemeToggleClicked);
|
|
89
76
|
setIsDarkTheme(darkThemeToggleClicked);
|
|
90
77
|
};
|
|
91
78
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
// reattach algolia to input each time search is expanded
|
|
81
|
+
if (hasSearch && isSearchExpanded) {
|
|
82
|
+
attachDocSearch(algolia, '.ws-global-search .pf-v6-c-text-input-group__text-input', 1000);
|
|
83
|
+
}
|
|
84
|
+
}, [isSearchExpanded]);
|
|
98
85
|
|
|
99
86
|
return (
|
|
100
87
|
<Toolbar isFullHeight>
|
|
@@ -133,7 +120,7 @@ const HeaderTools = ({
|
|
|
133
120
|
/>
|
|
134
121
|
</ToolbarItem>
|
|
135
122
|
)}
|
|
136
|
-
{
|
|
123
|
+
{hasSearch && (
|
|
137
124
|
<ToolbarItem>
|
|
138
125
|
<SearchInput
|
|
139
126
|
className="ws-global-search"
|
|
@@ -141,10 +128,14 @@ const HeaderTools = ({
|
|
|
141
128
|
value={searchValue}
|
|
142
129
|
onChange={onChange}
|
|
143
130
|
onClear={(_evt) => onChange(_evt, '')}
|
|
144
|
-
expandableInput={{
|
|
131
|
+
expandableInput={{
|
|
132
|
+
isExpanded: isSearchExpanded,
|
|
133
|
+
onToggleExpand,
|
|
134
|
+
toggleAriaLabel: 'Expandable search input toggle'
|
|
135
|
+
}}
|
|
145
136
|
/>
|
|
146
137
|
</ToolbarItem>
|
|
147
|
-
)}
|
|
138
|
+
)}
|
|
148
139
|
<ToolbarItem>
|
|
149
140
|
<Button
|
|
150
141
|
component="a"
|
|
@@ -168,55 +159,29 @@ const HeaderTools = ({
|
|
|
168
159
|
onClick={() => setDropdownOpen(!isDropdownOpen)}
|
|
169
160
|
isExpanded={isDropdownOpen}
|
|
170
161
|
>
|
|
171
|
-
|
|
162
|
+
Release 6.0.0
|
|
172
163
|
</MenuToggle>
|
|
173
164
|
)}
|
|
165
|
+
popperProps={{ position: 'right' }}
|
|
174
166
|
>
|
|
175
167
|
<DropdownGroup key="Latest" label="Latest">
|
|
176
|
-
<DropdownList>
|
|
177
|
-
{getDropdownItem(latestVersion, true)}
|
|
178
|
-
</DropdownList>
|
|
168
|
+
<DropdownList>{getDropdownItem(latestVersion, true)}</DropdownList>
|
|
179
169
|
</DropdownGroup>
|
|
180
170
|
{previousReleases.length > 0 && (
|
|
181
|
-
<DropdownGroup
|
|
182
|
-
key="Previous releases"
|
|
183
|
-
label="Previous releases"
|
|
184
|
-
>
|
|
171
|
+
<DropdownGroup key="Previous releases" label="Previous releases">
|
|
185
172
|
<DropdownList>
|
|
186
|
-
{previousReleases
|
|
187
|
-
.slice(0, 3)
|
|
188
|
-
.map((version) => getDropdownItem(version))}
|
|
173
|
+
{previousReleases.slice(0, 3).map((version) => getDropdownItem(version))}
|
|
189
174
|
</DropdownList>
|
|
190
175
|
</DropdownGroup>
|
|
191
176
|
)}
|
|
192
177
|
<Divider key="divider1" />
|
|
193
|
-
<DropdownGroup
|
|
194
|
-
key="Alpha preview version"
|
|
195
|
-
label="Alpha preview version"
|
|
196
|
-
>
|
|
197
|
-
<DropdownList>
|
|
198
|
-
<DropdownItem
|
|
199
|
-
key="PatternFly 6"
|
|
200
|
-
className="ws-patternfly-versions"
|
|
201
|
-
isExternalLink
|
|
202
|
-
to="https://staging.patternfly.org/"
|
|
203
|
-
itemId="patternfly-6"
|
|
204
|
-
>
|
|
205
|
-
PatternFly 6
|
|
206
|
-
</DropdownItem>
|
|
207
|
-
</DropdownList>
|
|
208
|
-
</DropdownGroup>
|
|
209
|
-
<Divider key="divider2" />
|
|
210
|
-
<DropdownGroup
|
|
211
|
-
key="Previous versions"
|
|
212
|
-
label="Previous versions"
|
|
213
|
-
>
|
|
178
|
+
<DropdownGroup key="Previous versions" label="Previous versions">
|
|
214
179
|
<DropdownList>
|
|
215
180
|
<DropdownItem
|
|
216
181
|
key="PatternFly 5"
|
|
217
182
|
className="ws-patternfly-versions"
|
|
218
183
|
isExternalLink
|
|
219
|
-
to="https://
|
|
184
|
+
to="https://v5-archive.patternfly.org/"
|
|
220
185
|
itemId="patternfly-5"
|
|
221
186
|
>
|
|
222
187
|
PatternFly 5
|
|
@@ -257,21 +222,17 @@ export function attachDocSearch(algolia, inputSelector, timeout) {
|
|
|
257
222
|
inputSelector,
|
|
258
223
|
autocompleteOptions: {
|
|
259
224
|
hint: false,
|
|
260
|
-
appendTo: `.ws-global-search .pf-v6-c-text-input-group
|
|
225
|
+
appendTo: `.ws-global-search .pf-v6-c-text-input-group`
|
|
261
226
|
},
|
|
262
227
|
debug: process.env.NODE_ENV !== 'production',
|
|
263
|
-
...algolia
|
|
228
|
+
...algolia
|
|
264
229
|
});
|
|
265
230
|
} else {
|
|
266
231
|
setTimeout(() => attachDocSearch(algolia, inputSelector, timeout), timeout);
|
|
267
232
|
}
|
|
268
233
|
}
|
|
269
234
|
|
|
270
|
-
export const SideNavLayout = ({
|
|
271
|
-
children,
|
|
272
|
-
groupedRoutes,
|
|
273
|
-
navOpen: navOpenProp,
|
|
274
|
-
}) => {
|
|
235
|
+
export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp }) => {
|
|
275
236
|
const algolia = process.env.algolia;
|
|
276
237
|
const hasGdprBanner = process.env.hasGdprBanner;
|
|
277
238
|
const hasVersionSwitcher = process.env.hasVersionSwitcher;
|
|
@@ -323,19 +284,9 @@ export const SideNavLayout = ({
|
|
|
323
284
|
<svg height="40px" viewBox="0 0 679 158">
|
|
324
285
|
<title>PF-HorizontalLogo-Color</title>
|
|
325
286
|
<defs>
|
|
326
|
-
<linearGradient
|
|
327
|
-
x1="68%"
|
|
328
|
-
y1="2.25860997e-13%"
|
|
329
|
-
x2="32%"
|
|
330
|
-
y2="100%"
|
|
331
|
-
id="linearGradient-website-masthead"
|
|
332
|
-
>
|
|
287
|
+
<linearGradient x1="68%" y1="2.25860997e-13%" x2="32%" y2="100%" id="linearGradient-website-masthead">
|
|
333
288
|
<stop stopColor="#2B9AF3" offset="0%"></stop>
|
|
334
|
-
<stop
|
|
335
|
-
stopColor="#73BCF7"
|
|
336
|
-
stopOpacity="0.502212631"
|
|
337
|
-
offset="100%"
|
|
338
|
-
></stop>
|
|
289
|
+
<stop stopColor="#73BCF7" stopOpacity="0.502212631" offset="100%"></stop>
|
|
339
290
|
</linearGradient>
|
|
340
291
|
</defs>
|
|
341
292
|
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
|
|
@@ -404,9 +355,7 @@ export const SideNavLayout = ({
|
|
|
404
355
|
mainComponent="div"
|
|
405
356
|
masthead={masthead}
|
|
406
357
|
sidebar={SideBar}
|
|
407
|
-
skipToContent={
|
|
408
|
-
<SkipToContent href="#ws-page-main">Skip to content</SkipToContent>
|
|
409
|
-
}
|
|
358
|
+
skipToContent={<SkipToContent href="#ws-page-main">Skip to content</SkipToContent>}
|
|
410
359
|
isManagedSidebar
|
|
411
360
|
defaultManagedSidebarIsOpen={navOpenProp}
|
|
412
361
|
>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/documentation-framework",
|
|
3
3
|
"description": "A framework to build documentation for PatternFly.",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.2",
|
|
5
5
|
"author": "Red Hat",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@babel/preset-env": "^7.24.3",
|
|
14
14
|
"@babel/preset-react": "^7.24.1",
|
|
15
15
|
"@mdx-js/util": "1.6.16",
|
|
16
|
-
"@patternfly/ast-helpers": "^1.4.0-alpha.
|
|
16
|
+
"@patternfly/ast-helpers": "^1.4.0-alpha.118",
|
|
17
17
|
"@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
|
|
18
18
|
"autoprefixer": "9.8.6",
|
|
19
19
|
"babel-loader": "^9.1.3",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"copy-webpack-plugin": "11.0.0",
|
|
26
26
|
"css-loader": "6.7.3",
|
|
27
27
|
"detab": "2.0.3",
|
|
28
|
-
"express": "4.
|
|
28
|
+
"express": "4.21.0",
|
|
29
29
|
"file-loader": "6.2.0",
|
|
30
30
|
"file-saver": "1.3.8",
|
|
31
31
|
"fs-extra": "9.0.1",
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"webpack-merge": "5.8.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@patternfly/patternfly": "6.0.0
|
|
77
|
-
"@patternfly/react-code-editor": "6.0.0
|
|
78
|
-
"@patternfly/react-core": "6.0.0
|
|
79
|
-
"@patternfly/react-table": "6.0.0
|
|
76
|
+
"@patternfly/patternfly": "^6.0.0",
|
|
77
|
+
"@patternfly/react-code-editor": "^6.0.0",
|
|
78
|
+
"@patternfly/react-core": "^6.0.0",
|
|
79
|
+
"@patternfly/react-table": "^6.0.0",
|
|
80
80
|
"react": "^17.0.0 || ^18.0.0",
|
|
81
81
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "d5b85d834a8c461748d13e2d51d08beed4cbd3bd"
|
|
84
84
|
}
|
package/scripts/md/parseMD.js
CHANGED
|
@@ -184,7 +184,7 @@ function toReactComponent(mdFilePath, source, buildMode) {
|
|
|
184
184
|
.use(require('./mdx-ast-to-mdx-hast'), {
|
|
185
185
|
watchExternal(file) {
|
|
186
186
|
if (buildMode === 'start') {
|
|
187
|
-
const watcher = chokidar.watch(file, { ignoreInitial: true
|
|
187
|
+
const watcher = chokidar.watch(globSync(file, { ignoreInitial: true}));
|
|
188
188
|
watcher.on('change', () => {
|
|
189
189
|
sourceMDFile(mdFilePath, source, buildMode);
|
|
190
190
|
writeIndex();
|
|
@@ -350,12 +350,12 @@ module.exports = {
|
|
|
350
350
|
writeIndex,
|
|
351
351
|
watchMD() {
|
|
352
352
|
globs.props.forEach(({ glob, ignore }) => {
|
|
353
|
-
const propWatcher = chokidar.watch(glob, { ignored: ignore, ignoreInitial: true
|
|
353
|
+
const propWatcher = chokidar.watch(globSync(glob, { ignored: ignore, ignoreInitial: true}));
|
|
354
354
|
propWatcher.on('add', sourcePropsFile);
|
|
355
355
|
propWatcher.on('change', sourcePropsFile);
|
|
356
356
|
});
|
|
357
357
|
globs.md.forEach(({ glob, source, ignore }) => {
|
|
358
|
-
const mdWatcher = chokidar.watch(glob, { ignored: ignore, ignoreInitial: true });
|
|
358
|
+
const mdWatcher = chokidar.watch(globSync(glob, { ignored: ignore, ignoreInitial: true }));
|
|
359
359
|
function onMDFileChange(file) {
|
|
360
360
|
sourceMDFile(file, source, 'start');
|
|
361
361
|
writeIndex();
|
|
@@ -26,7 +26,7 @@ function styledTags() {
|
|
|
26
26
|
node.properties.className = node.properties.className || '';
|
|
27
27
|
|
|
28
28
|
if (contentStyledMdTags.includes(node.tagName)) {
|
|
29
|
-
node.properties.className += `pf-v6-c-content--${node.tagName}`;
|
|
29
|
+
node.properties.className += `pf-v6-c-content--${node.tagName} pf-m-editorial`;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
if (styledMdTags.includes(node.tagName)) {
|
package/scripts/md/typecheck.js
CHANGED
|
@@ -37,7 +37,11 @@ const reactStyles = globSync(path.join(reactStylesDir, 'css/**/*.d.ts'))
|
|
|
37
37
|
const defaultImports = [
|
|
38
38
|
'react',
|
|
39
39
|
'@reach/router',
|
|
40
|
+
'@patternfly/react-charts/echarts',
|
|
40
41
|
'@patternfly/react-charts/next',
|
|
42
|
+
'@patternfly/react-charts/next/echarts',
|
|
43
|
+
'@patternfly/react-charts/next/victory',
|
|
44
|
+
'@patternfly/react-charts/victory',
|
|
41
45
|
'@patternfly/react-core/next',
|
|
42
46
|
'@patternfly/react-core/deprecated',
|
|
43
47
|
'@patternfly/react-table/deprecated',
|