@patternfly/documentation-framework 6.0.0-alpha.5 → 6.0.0-alpha.51
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 +904 -0
- package/app.js +2 -5
- package/components/autoLinkHeader/autoLinkHeader.css +2 -2
- package/components/autoLinkHeader/autoLinkHeader.js +8 -19
- package/components/cssVariables/cssVariables.css +4 -4
- package/components/cssVariables/cssVariables.js +6 -6
- package/components/example/example.css +13 -57
- package/components/example/example.js +149 -78
- package/components/example/exampleToolbar.js +3 -2
- package/components/footer/footer.css +16 -16
- package/components/footer/footer.js +29 -29
- package/components/gdprBanner/gdprBanner.css +0 -3
- package/components/gdprBanner/gdprBanner.js +24 -17
- package/components/inlineAlert/inlineAlert.js +1 -1
- package/components/propsTable/propsTable.js +14 -10
- package/components/sectionGallery/sectionDataListLayout.js +3 -3
- package/components/sectionGallery/sectionGallery.css +12 -12
- package/components/sectionGallery/sectionGalleryToolbar.js +1 -1
- package/components/sideNav/sideNav.js +3 -4
- package/components/tableOfContents/tableOfContents.css +23 -24
- package/layouts/sideNavLayout/sideNavLayout.css +14 -14
- package/layouts/sideNavLayout/sideNavLayout.js +58 -33
- package/package.json +13 -20
- package/pages/404/404.css +2 -2
- package/pages/404/index.js +5 -8
- 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 +28 -229
- package/templates/mdx.js +37 -40
- package/templates/patternfly-docs/patternfly-docs.source.js +8 -8
- package/versions.json +39 -12
- package/components/sideNav/sideNav.css +0 -21
- package/pages/global-css-variables.md +0 -109
- package/pages/img/component-variable-mapping.png +0 -0
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
ToolbarItem,
|
|
25
25
|
SkipToContent,
|
|
26
26
|
Switch,
|
|
27
|
-
SearchInput,
|
|
27
|
+
// SearchInput,
|
|
28
28
|
ToggleGroup,
|
|
29
29
|
ToggleGroupItem
|
|
30
30
|
} from '@patternfly/react-core';
|
|
@@ -35,6 +35,7 @@ import SunIcon from '@patternfly/react-icons/dist/esm/icons/sun-icon';
|
|
|
35
35
|
import { SideNav, TopNav, GdprBanner } from '../../components';
|
|
36
36
|
import staticVersions from '../../versions.json';
|
|
37
37
|
import v5Logo from '../PF-HorizontalLogo-Reverse.svg';
|
|
38
|
+
import { Footer } from '@patternfly/documentation-framework/components';
|
|
38
39
|
|
|
39
40
|
export const RtlContext = createContext(false);
|
|
40
41
|
|
|
@@ -51,38 +52,38 @@ const HeaderTools = ({
|
|
|
51
52
|
const initialVersion = staticVersions.Releases.find(release => release.latest);
|
|
52
53
|
const latestVersion = versions.Releases.find(version => version.latest);
|
|
53
54
|
const previousReleases = Object.values(versions.Releases).filter(version => !version.hidden && !version.latest);
|
|
54
|
-
const hasSearch = algolia;
|
|
55
|
+
// const hasSearch = algolia;
|
|
55
56
|
const [isDropdownOpen, setDropdownOpen] = useState(false);
|
|
56
|
-
const [searchValue, setSearchValue] = React.useState('');
|
|
57
|
-
const [isSearchExpanded, setIsSearchExpanded] = React.useState(false);
|
|
57
|
+
// const [searchValue, setSearchValue] = React.useState('');
|
|
58
|
+
// const [isSearchExpanded, setIsSearchExpanded] = React.useState(false);
|
|
58
59
|
const [isDarkTheme, setIsDarkTheme] = React.useState(false);
|
|
59
60
|
|
|
60
61
|
const getDropdownItem = (version, isLatest = false) => (
|
|
61
62
|
<DropdownItem itemId={version.name} key={version.name} to={isLatest ? '/' : `/${version.name}`}>
|
|
62
|
-
{`
|
|
63
|
+
{`Current ${version.name}`}
|
|
63
64
|
</DropdownItem>
|
|
64
65
|
);
|
|
65
66
|
|
|
66
|
-
const onChange = (_evt, value) => {
|
|
67
|
-
|
|
68
|
-
};
|
|
67
|
+
// const onChange = (_evt, value) => {
|
|
68
|
+
// setSearchValue(value);
|
|
69
|
+
// };
|
|
69
70
|
|
|
70
|
-
const onToggleExpand = (_evt, isSearchExpanded) => {
|
|
71
|
-
|
|
72
|
-
};
|
|
71
|
+
// const onToggleExpand = (_evt, isSearchExpanded) => {
|
|
72
|
+
// setIsSearchExpanded(!isSearchExpanded);
|
|
73
|
+
// };
|
|
73
74
|
|
|
74
75
|
const toggleDarkTheme = (_evt, selected) => {
|
|
75
76
|
const darkThemeToggleClicked = !selected === isDarkTheme
|
|
76
|
-
document.querySelector('html').classList.toggle('pf-
|
|
77
|
+
document.querySelector('html').classList.toggle('pf-v6-theme-dark', darkThemeToggleClicked);
|
|
77
78
|
setIsDarkTheme(darkThemeToggleClicked);
|
|
78
79
|
};
|
|
79
80
|
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, [isSearchExpanded])
|
|
81
|
+
// useEffect(() => {
|
|
82
|
+
// // reattach algolia to input each time search is expanded
|
|
83
|
+
// if (hasSearch && isSearchExpanded) {
|
|
84
|
+
// attachDocSearch(algolia, '.ws-global-search .pf-v6-c-text-input-group__text-input', 1000);
|
|
85
|
+
// }
|
|
86
|
+
// }, [isSearchExpanded])
|
|
86
87
|
|
|
87
88
|
return (
|
|
88
89
|
<Toolbar isFullHeight>
|
|
@@ -93,8 +94,7 @@ const HeaderTools = ({
|
|
|
93
94
|
</ToolbarItem>
|
|
94
95
|
)}
|
|
95
96
|
<ToolbarGroup
|
|
96
|
-
align={{ default: '
|
|
97
|
-
spaceItems={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
97
|
+
align={{ default: 'alignEnd' }}
|
|
98
98
|
>
|
|
99
99
|
{hasDarkThemeSwitcher && (
|
|
100
100
|
<ToolbarItem>
|
|
@@ -109,7 +109,7 @@ const HeaderTools = ({
|
|
|
109
109
|
<Switch id="ws-rtl-switch" label={'RTL'} defaultChecked={isRTL} onChange={() => setIsRTL(isRTL => !isRTL)} />
|
|
110
110
|
</ToolbarItem>
|
|
111
111
|
)}
|
|
112
|
-
{hasSearch && (
|
|
112
|
+
{/* {hasSearch && (
|
|
113
113
|
<ToolbarItem>
|
|
114
114
|
<SearchInput
|
|
115
115
|
className="ws-global-search"
|
|
@@ -120,7 +120,7 @@ const HeaderTools = ({
|
|
|
120
120
|
expandableInput={{ isExpanded: isSearchExpanded, onToggleExpand, toggleAriaLabel: 'Expandable search input toggle' }}
|
|
121
121
|
/>
|
|
122
122
|
</ToolbarItem>
|
|
123
|
-
)}
|
|
123
|
+
)} */}
|
|
124
124
|
<ToolbarItem>
|
|
125
125
|
<Button
|
|
126
126
|
component="a"
|
|
@@ -145,7 +145,7 @@ const HeaderTools = ({
|
|
|
145
145
|
onClick={() => setDropdownOpen(!isDropdownOpen)}
|
|
146
146
|
isExpanded={isDropdownOpen}
|
|
147
147
|
>
|
|
148
|
-
|
|
148
|
+
Current alphas
|
|
149
149
|
</MenuToggle>
|
|
150
150
|
)}
|
|
151
151
|
>
|
|
@@ -163,12 +163,35 @@ const HeaderTools = ({
|
|
|
163
163
|
</DropdownList>
|
|
164
164
|
</DropdownGroup>
|
|
165
165
|
)}
|
|
166
|
-
<Divider key="
|
|
166
|
+
<Divider key="divider1" className="ws-switcher-divider"/>
|
|
167
|
+
<DropdownGroup key="Alpha preview version" label="Alpha preview version">
|
|
168
|
+
<DropdownList>
|
|
169
|
+
<DropdownItem
|
|
170
|
+
key="PatternFly 6"
|
|
171
|
+
className="ws-patternfly-versions"
|
|
172
|
+
isExternalLink
|
|
173
|
+
to="https://staging-v6.patternfly.org/"
|
|
174
|
+
itemId="patternfly-6"
|
|
175
|
+
>
|
|
176
|
+
PatternFly 6
|
|
177
|
+
</DropdownItem>
|
|
178
|
+
</DropdownList>
|
|
179
|
+
</DropdownGroup>
|
|
180
|
+
<Divider key="divider2" className="ws-switcher-divider"/>
|
|
167
181
|
<DropdownGroup key="Previous versions" label="Previous versions">
|
|
168
182
|
<DropdownList>
|
|
183
|
+
<DropdownItem
|
|
184
|
+
key="PatternFly 5"
|
|
185
|
+
className="ws-patternfly-versions"
|
|
186
|
+
isExternalLink
|
|
187
|
+
to="https://www.patternfly.org"
|
|
188
|
+
itemId="patternfly-5"
|
|
189
|
+
>
|
|
190
|
+
PatternFly 5
|
|
191
|
+
</DropdownItem>
|
|
169
192
|
<DropdownItem
|
|
170
193
|
key="PatternFly 4"
|
|
171
|
-
className="ws-patternfly-
|
|
194
|
+
className="ws-patternfly-versions"
|
|
172
195
|
isExternalLink
|
|
173
196
|
to="http://v4-archive.patternfly.org/v4/"
|
|
174
197
|
itemId="patternfly-4"
|
|
@@ -177,7 +200,7 @@ const HeaderTools = ({
|
|
|
177
200
|
</DropdownItem>
|
|
178
201
|
<DropdownItem
|
|
179
202
|
key="PatternFly 3"
|
|
180
|
-
className="ws-patternfly-
|
|
203
|
+
className="ws-patternfly-versions"
|
|
181
204
|
isExternalLink
|
|
182
205
|
to="https://pf3.patternfly.org/"
|
|
183
206
|
itemId="patternfly-3"
|
|
@@ -201,7 +224,7 @@ export function attachDocSearch(algolia, inputSelector, timeout) {
|
|
|
201
224
|
inputSelector,
|
|
202
225
|
autocompleteOptions: {
|
|
203
226
|
hint: false,
|
|
204
|
-
appendTo: `.ws-global-search .pf-
|
|
227
|
+
appendTo: `.ws-global-search .pf-v6-c-text-input-group`,
|
|
205
228
|
},
|
|
206
229
|
debug: process.env.NODE_ENV !== 'production',
|
|
207
230
|
...algolia
|
|
@@ -250,7 +273,7 @@ export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp })
|
|
|
250
273
|
</PageSidebar>
|
|
251
274
|
);
|
|
252
275
|
|
|
253
|
-
const
|
|
276
|
+
const masthead = (
|
|
254
277
|
<Masthead className="ws-masthead">
|
|
255
278
|
<MastheadToggle>
|
|
256
279
|
<PageToggleButton variant="plain" aria-label="Global navigation">
|
|
@@ -263,7 +286,7 @@ export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp })
|
|
|
263
286
|
<svg height="40px" viewBox="0 0 679 158">
|
|
264
287
|
<title>PF-HorizontalLogo-Color</title>
|
|
265
288
|
<defs>
|
|
266
|
-
<linearGradient x1="68%" y1="2.25860997e-13%" x2="32%" y2="100%" id="linearGradient-
|
|
289
|
+
<linearGradient x1="68%" y1="2.25860997e-13%" x2="32%" y2="100%" id="linearGradient-website-masthead">
|
|
267
290
|
<stop stopColor="#2B9AF3" offset="0%"></stop>
|
|
268
291
|
<stop stopColor="#73BCF7" stopOpacity="0.502212631" offset="100%"></stop>
|
|
269
292
|
</linearGradient>
|
|
@@ -282,9 +305,9 @@ export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp })
|
|
|
282
305
|
<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>
|
|
283
306
|
</g>
|
|
284
307
|
<g transform="translate(0.000000, 0.000000)">
|
|
285
|
-
<path 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" fill=
|
|
286
|
-
<path d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z" fill="url(#linearGradient-
|
|
287
|
-
<path 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" fill="url(#linearGradient-
|
|
308
|
+
<path 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" fill='var(--pf-t--color--blue--50)'></path>
|
|
309
|
+
<path d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z" fill="url(#linearGradient-website-masthead)"></path>
|
|
310
|
+
<path 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" fill="url(#linearGradient-website-masthead)" transform="translate(77.282609, 46.369565) scale(1, -1) rotate(90.000000) translate(-77.282609, -46.369565) "></path>
|
|
288
311
|
</g>
|
|
289
312
|
</g>
|
|
290
313
|
</svg>
|
|
@@ -314,13 +337,15 @@ export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp })
|
|
|
314
337
|
<Page
|
|
315
338
|
id="ws-page"
|
|
316
339
|
mainContainerId="ws-page-main"
|
|
317
|
-
|
|
340
|
+
mainComponent="div"
|
|
341
|
+
masthead={masthead}
|
|
318
342
|
sidebar={SideBar}
|
|
319
343
|
skipToContent={<SkipToContent href="#ws-page-main">Skip to content</SkipToContent>}
|
|
320
344
|
isManagedSidebar
|
|
321
345
|
defaultManagedSidebarIsOpen={navOpenProp}
|
|
322
346
|
>
|
|
323
347
|
{children}
|
|
348
|
+
{process.env.hasFooter && <Footer />}
|
|
324
349
|
</Page>
|
|
325
350
|
<div id="ws-page-banners">
|
|
326
351
|
{hasGdprBanner && <GdprBanner />}
|
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.0-alpha.
|
|
4
|
+
"version": "6.0.0-alpha.51",
|
|
5
5
|
"author": "Red Hat",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
@@ -9,18 +9,14 @@
|
|
|
9
9
|
"pf-docs-framework": "scripts/cli/cli.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@babel/core": "7.
|
|
13
|
-
"@babel/
|
|
14
|
-
"@babel/
|
|
15
|
-
"@babel/plugin-proposal-private-methods": "7.17.12",
|
|
16
|
-
"@babel/plugin-proposal-private-property-in-object": "7.17.12",
|
|
17
|
-
"@babel/plugin-transform-react-jsx": "7.17.12",
|
|
18
|
-
"@babel/preset-env": "7.18.2",
|
|
12
|
+
"@babel/core": "^7.24.3",
|
|
13
|
+
"@babel/preset-env": "^7.24.3",
|
|
14
|
+
"@babel/preset-react": "^7.24.1",
|
|
19
15
|
"@mdx-js/util": "1.6.16",
|
|
20
|
-
"@patternfly/ast-helpers": "^1.
|
|
16
|
+
"@patternfly/ast-helpers": "^1.4.0-alpha.40",
|
|
21
17
|
"@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
|
|
22
18
|
"autoprefixer": "9.8.6",
|
|
23
|
-
"babel-loader": "9.1.
|
|
19
|
+
"babel-loader": "^9.1.3",
|
|
24
20
|
"camelcase-css": "2.0.1",
|
|
25
21
|
"chokidar": "3.5.3",
|
|
26
22
|
"clean-webpack-plugin": "4.0.0",
|
|
@@ -43,18 +39,15 @@
|
|
|
43
39
|
"mdast-util-to-hast": "9.1.1",
|
|
44
40
|
"mdurl": "1.0.1",
|
|
45
41
|
"mini-css-extract-plugin": "2.7.5",
|
|
46
|
-
"monaco-editor": "0.34.1",
|
|
47
|
-
"monaco-editor-webpack-plugin": "7.0.1",
|
|
48
42
|
"null-loader": "4.0.1",
|
|
49
43
|
"parse-entities": "2.0.0",
|
|
50
44
|
"path-browserify": "1.0.1",
|
|
51
45
|
"postcss": "8.4.32",
|
|
52
46
|
"postcss-loader": "7.1.0",
|
|
53
47
|
"process": "^0.11.10",
|
|
54
|
-
"puppeteer": "19.
|
|
48
|
+
"puppeteer": "19.11.1",
|
|
55
49
|
"puppeteer-cluster": "0.23.0",
|
|
56
50
|
"react-docgen": "5.3.1",
|
|
57
|
-
"react-monaco-editor": "^0.51.0",
|
|
58
51
|
"react-ssr-prepass": "1.5.0",
|
|
59
52
|
"remark-footnotes": "1.0.0",
|
|
60
53
|
"remark-frontmatter": "2.0.0",
|
|
@@ -67,7 +60,7 @@
|
|
|
67
60
|
"style-to-object": "0.3.0",
|
|
68
61
|
"to-vfile": "6.1.0",
|
|
69
62
|
"typedoc": "0.23.0",
|
|
70
|
-
"typescript": "4.
|
|
63
|
+
"typescript": "4.7.4",
|
|
71
64
|
"unified": "9.1.0",
|
|
72
65
|
"unist-util-remove": "2.0.0",
|
|
73
66
|
"unist-util-visit": "2.0.3",
|
|
@@ -80,12 +73,12 @@
|
|
|
80
73
|
"webpack-merge": "5.8.0"
|
|
81
74
|
},
|
|
82
75
|
"peerDependencies": {
|
|
83
|
-
"@patternfly/patternfly": "6.0.0-alpha.
|
|
84
|
-
"@patternfly/react-code-editor": "6.0.0-alpha.
|
|
85
|
-
"@patternfly/react-core": "6.0.0-alpha.
|
|
86
|
-
"@patternfly/react-table": "6.0.0-alpha.
|
|
76
|
+
"@patternfly/patternfly": "6.0.0-alpha.139",
|
|
77
|
+
"@patternfly/react-code-editor": "6.0.0-alpha.69",
|
|
78
|
+
"@patternfly/react-core": "6.0.0-alpha.69",
|
|
79
|
+
"@patternfly/react-table": "6.0.0-alpha.69",
|
|
87
80
|
"react": "^17.0.0 || ^18.0.0",
|
|
88
81
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
89
82
|
},
|
|
90
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "41ad3661e2b785c21f13aa5729cafbafe54994d7"
|
|
91
84
|
}
|
package/pages/404/404.css
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.ws-404-card-header {
|
|
8
|
-
padding: var(--pf-
|
|
8
|
+
padding: var(--pf-t--global--spacer--lg);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
div.ws-404-button-wrapper {
|
|
12
12
|
width: 100%;
|
|
13
13
|
display: flex;
|
|
14
14
|
justify-content: center;
|
|
15
|
-
padding: var(--pf-
|
|
15
|
+
padding: var(--pf-t--global--spacer--xl);
|
|
16
16
|
}
|
package/pages/404/index.js
CHANGED
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
CardHeader,
|
|
10
10
|
EmptyState,
|
|
11
11
|
EmptyStateBody,
|
|
12
|
-
EmptyStateIcon,
|
|
13
12
|
Grid,
|
|
14
13
|
GridItem,
|
|
15
14
|
PageSection,
|
|
@@ -68,12 +67,10 @@ const Page404 = () => {
|
|
|
68
67
|
|
|
69
68
|
return (
|
|
70
69
|
<PageSection>
|
|
71
|
-
<EmptyState variant="xl">
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</Title>
|
|
76
|
-
<p style={{ marginTop: 'var(--pf-v5-global--spacer--sm)' }}>
|
|
70
|
+
<EmptyState headingLevel="h1" titleText="404: That page no longer exists" variant="xl" icon={() => <img src={PathMissingIcon} alt="" width="128px" />}>
|
|
71
|
+
<p
|
|
72
|
+
// style={{ marginTop: 'var(--pf-v6-global--spacer--sm)' }}
|
|
73
|
+
>
|
|
77
74
|
Another page might have the information you need, so try searching PatternFly.
|
|
78
75
|
</p>
|
|
79
76
|
<EmptyStateBody>
|
|
@@ -90,7 +87,7 @@ const Page404 = () => {
|
|
|
90
87
|
body="Learn about designing and developing with PatternFly."
|
|
91
88
|
link={{
|
|
92
89
|
text: 'View getting started resources',
|
|
93
|
-
to: '/get-started/about'
|
|
90
|
+
to: '/get-started/about-patternfly'
|
|
94
91
|
}}
|
|
95
92
|
/>
|
|
96
93
|
<Card404
|
package/routes.js
CHANGED
|
@@ -42,7 +42,7 @@ function anchorHeader(tocCallback) {
|
|
|
42
42
|
// Add to TOC for indexing
|
|
43
43
|
addTOCItem(tocItem, node.tagName);
|
|
44
44
|
|
|
45
|
-
node.properties.
|
|
45
|
+
node.properties.headingLevel = node.tagName;
|
|
46
46
|
node.properties.className = node.properties.className || '';
|
|
47
47
|
node.properties.className += node.properties.className ? ' ' : '';
|
|
48
48
|
node.properties.className += `ws-title ws-${node.tagName}`;
|
package/scripts/md/parseMD.js
CHANGED
|
@@ -105,6 +105,7 @@ function toReactComponent(mdFilePath, source, buildMode) {
|
|
|
105
105
|
section: frontmatter.section || '',
|
|
106
106
|
subsection: frontmatter.subsection || '',
|
|
107
107
|
deprecated: frontmatter.deprecated || false,
|
|
108
|
+
template: frontmatter.template || false,
|
|
108
109
|
beta: frontmatter.beta || false,
|
|
109
110
|
demo: frontmatter.demo || false,
|
|
110
111
|
newImplementationLink: frontmatter.newImplementationLink || false,
|
|
@@ -213,24 +214,24 @@ function toReactComponent(mdFilePath, source, buildMode) {
|
|
|
213
214
|
pageData.examples.push(node.title);
|
|
214
215
|
}
|
|
215
216
|
// Typecheck TS examples
|
|
216
|
-
if (node.properties.lang === 'ts') {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
217
|
+
// if (node.properties.lang === 'ts') {
|
|
218
|
+
// const typerrors = typecheck(
|
|
219
|
+
// path.join(pageData.id, node.title + '.tsx'), // Needs to be unique per-example
|
|
220
|
+
// node.properties.code
|
|
221
|
+
// );
|
|
222
|
+
// typerrors.forEach(({ line, character, message }) => {
|
|
223
|
+
// line = node.position.start.line + line + 1;
|
|
224
|
+
// const column = character;
|
|
225
|
+
// if (buildMode === 'start') {
|
|
226
|
+
// // Don't fail to start over types
|
|
227
|
+
// file.message(`\u001b[31m THIS WILL FAIL THE BUILD\u001b[0m\n ${message}`, { line, column });
|
|
228
|
+
// } else {
|
|
229
|
+
// console.log('\u001b[31m');
|
|
230
|
+
// file.fail(`\n ${message}\n`, { line, column });
|
|
231
|
+
// console.log('\u001b[0m');
|
|
232
|
+
// }
|
|
233
|
+
// });
|
|
234
|
+
// }
|
|
234
235
|
});
|
|
235
236
|
})
|
|
236
237
|
// Add custom PatternFly doc design things
|
|
@@ -295,6 +296,7 @@ function sourceMDFile(file, source, buildMode) {
|
|
|
295
296
|
...(pageData.hideNavItem && { hideNavItem: pageData.hideNavItem }),
|
|
296
297
|
...(pageData.beta && { beta: pageData.beta }),
|
|
297
298
|
...(pageData.deprecated && { deprecated: pageData.deprecated }),
|
|
299
|
+
...(pageData.template && { template: pageData.template }),
|
|
298
300
|
...(pageData.demo && { demo: pageData.demo }),
|
|
299
301
|
...(pageData.sortValue && { sortValue: pageData.sortValue }),
|
|
300
302
|
...(pageData.subsectionSortValue && { subsectionSortValue: pageData.subsectionSortValue })
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
const visit = require('unist-util-visit');
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const contentStyledMdTags = [
|
|
4
4
|
'p',
|
|
5
5
|
'ul',
|
|
6
|
-
'ul',
|
|
7
|
-
'ul',
|
|
8
6
|
'ol',
|
|
9
7
|
'li',
|
|
10
8
|
'dl',
|
|
@@ -12,35 +10,45 @@ const styledMdTags = [
|
|
|
12
10
|
'small',
|
|
13
11
|
'hr',
|
|
14
12
|
'dt',
|
|
13
|
+
'dd'
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const styledMdTags = [
|
|
17
|
+
...contentStyledMdTags,
|
|
15
18
|
'code',
|
|
16
19
|
'table',
|
|
17
20
|
'img'
|
|
18
|
-
]
|
|
21
|
+
]
|
|
19
22
|
|
|
20
23
|
function styledTags() {
|
|
21
24
|
return tree => {
|
|
22
25
|
visit(tree, 'element', node => {
|
|
26
|
+
node.properties.className = node.properties.className || '';
|
|
27
|
+
|
|
28
|
+
if (contentStyledMdTags.includes(node.tagName)) {
|
|
29
|
+
node.properties.className += `pf-v6-c-content--${node.tagName}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
23
32
|
if (styledMdTags.includes(node.tagName)) {
|
|
24
|
-
node.properties.className = node.properties.className || '';
|
|
25
33
|
node.properties.className += node.properties.className ? ' ' : '';
|
|
26
|
-
node.properties.className += `ws-${node.tagName}`;
|
|
27
|
-
// Match pf-
|
|
34
|
+
node.properties.className += `ws-${node.tagName} `;
|
|
35
|
+
// Match pf-v6-c-table implementation
|
|
28
36
|
// https://pf4.patternfly.org/components/table/html/basic-table/
|
|
29
37
|
if (node.tagName === 'table') {
|
|
30
|
-
node.properties.className += ' pf-
|
|
38
|
+
node.properties.className += ' pf-v6-c-table pf-m-grid-lg pf-m-compact';
|
|
31
39
|
node.properties.role = 'grid';
|
|
32
40
|
let columnHeaders = [];
|
|
33
41
|
for (let child of node.children) {
|
|
34
42
|
if (child.tagName === 'thead') {
|
|
35
|
-
child.properties.className = 'pf-
|
|
43
|
+
child.properties.className = 'pf-v6-c-table__thead';
|
|
36
44
|
// Find column headers
|
|
37
45
|
const tr = child.children.find(child => child.tagName === 'tr');
|
|
38
46
|
tr.properties.role = 'row';
|
|
39
|
-
tr.properties.className = 'pf-
|
|
47
|
+
tr.properties.className = 'pf-v6-c-table__tr';
|
|
40
48
|
tr.children
|
|
41
49
|
.filter(child => child.tagName === 'th')
|
|
42
50
|
.forEach(th => {
|
|
43
|
-
th.properties.className = `${th.properties.className} pf-
|
|
51
|
+
th.properties.className = `${th.properties.className} pf-v6-c-table__th pf-m-wrap`;
|
|
44
52
|
th.properties.role = 'columnheader';
|
|
45
53
|
th.properties.scope = 'col';
|
|
46
54
|
let colName = '';
|
|
@@ -57,17 +65,17 @@ function styledTags() {
|
|
|
57
65
|
}
|
|
58
66
|
else if (child.tagName === 'tbody') {
|
|
59
67
|
child.properties.role = 'rowgroup';
|
|
60
|
-
child.properties.className = 'pf-
|
|
68
|
+
child.properties.className = 'pf-v6-c-table__tbody';
|
|
61
69
|
child.children
|
|
62
70
|
.filter(tr => tr.tagName === 'tr')
|
|
63
71
|
.forEach(tr => {
|
|
64
72
|
tr.properties.role = 'row';
|
|
65
|
-
tr.properties.className = 'pf-
|
|
73
|
+
tr.properties.className = 'pf-v6-c-table__tr';
|
|
66
74
|
tr.children
|
|
67
75
|
.filter(td => td.tagName === 'td')
|
|
68
76
|
.forEach((td, i) => {
|
|
69
77
|
td.properties.role = 'cell';
|
|
70
|
-
td.properties.className = 'pf-
|
|
78
|
+
td.properties.className = 'pf-v6-c-table__td';
|
|
71
79
|
if (columnHeaders[i]) {
|
|
72
80
|
td.properties['data-label'] = columnHeaders[i];
|
|
73
81
|
}
|
|
@@ -2,7 +2,6 @@ const path = require('path');
|
|
|
2
2
|
const webpack = require('webpack');
|
|
3
3
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
4
4
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
5
|
-
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
|
|
6
5
|
|
|
7
6
|
module.exports = (_env, argv) => {
|
|
8
7
|
const {
|
|
@@ -47,6 +46,7 @@ module.exports = (_env, argv) => {
|
|
|
47
46
|
/react-[\w-]+\\src\\.*\\examples/, // fix for Windows
|
|
48
47
|
/react-[\w-]+\/patternfly-docs\/.*\/examples/, //fixes for extensions
|
|
49
48
|
/react-[\w-]+\\patternfly-docs\\.*\\examples/,
|
|
49
|
+
path.resolve(__dirname, '../../../../node_modules/@patternfly/design-tokens/patternfly-docs/content')
|
|
50
50
|
].concat(includePaths.map(path => new RegExp(path))),
|
|
51
51
|
exclude: [
|
|
52
52
|
path.resolve(__dirname, '../../node_modules'), // Temporarily compile theme using webpack for development
|
|
@@ -56,20 +56,12 @@ module.exports = (_env, argv) => {
|
|
|
56
56
|
options: {
|
|
57
57
|
cacheDirectory: '.cache/babel',
|
|
58
58
|
cacheCompression: false,
|
|
59
|
-
presets: [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
targets: "> 0.25%, not dead"
|
|
66
|
-
}]],
|
|
67
|
-
plugins: [
|
|
68
|
-
'@babel/plugin-transform-react-jsx',
|
|
69
|
-
'@babel/plugin-proposal-class-properties',
|
|
70
|
-
'@babel/plugin-proposal-optional-chaining',
|
|
71
|
-
["@babel/plugin-proposal-private-methods", { "loose": false }],
|
|
72
|
-
["@babel/plugin-proposal-private-property-in-object", { "loose": false }]
|
|
59
|
+
presets: [
|
|
60
|
+
'@babel/preset-react',
|
|
61
|
+
['@babel/preset-env', {
|
|
62
|
+
loose: true,
|
|
63
|
+
targets: '> 1%, not dead'
|
|
64
|
+
}],
|
|
73
65
|
],
|
|
74
66
|
}
|
|
75
67
|
},
|
|
@@ -155,9 +147,6 @@ module.exports = (_env, argv) => {
|
|
|
155
147
|
patterns: [
|
|
156
148
|
{ from: path.join(__dirname, '../../assets'), to: 'assets' }
|
|
157
149
|
]
|
|
158
|
-
}),
|
|
159
|
-
new MonacoWebpackPlugin({
|
|
160
|
-
globalAPI: true,
|
|
161
150
|
})
|
|
162
151
|
],
|
|
163
152
|
stats: 'minimal'
|
|
@@ -11,7 +11,7 @@ sharp.cache(false);
|
|
|
11
11
|
async function writeScreenshot({ page, data: { url, urlPrefix } }) {
|
|
12
12
|
await page.goto(url);
|
|
13
13
|
await page.addStyleTag({content: '*,*::before,*::after{animation-delay:-1ms !important;animation-duration:1ms !important;animation-iteration-count:1 !important;transition-duration:0s !important;transition-delay:0s !important;}'}); // disable animations/transitions so they don't interfere with screenshot tool
|
|
14
|
-
await page.waitForSelector('.pf-
|
|
14
|
+
await page.waitForSelector('.pf-v6-u-h-100');
|
|
15
15
|
const outfile = path.join(
|
|
16
16
|
screenshotBase,
|
|
17
17
|
url.replace(`${urlPrefix}/`, '') + '.png'
|
|
@@ -32,7 +32,7 @@ async function writeScreenshots({ urlPrefix, allRoutes, filterTerm }) {
|
|
|
32
32
|
concurrency: Cluster.CONCURRENCY_CONTEXT,
|
|
33
33
|
maxConcurrency: os.cpus().length,
|
|
34
34
|
puppeteerOptions: {
|
|
35
|
-
headless:
|
|
35
|
+
headless: 'new', // set to false for testing...
|
|
36
36
|
args: ["--no-sandbox", "--disable-setuid-sandbox"],
|
|
37
37
|
defaultViewport: {width: 1920, height: 1080}
|
|
38
38
|
}
|