@patternfly/documentation-framework 2.0.0-alpha.2 → 2.0.0-alpha.20
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 +171 -0
- package/app.js +8 -4
- package/components/cssVariables/cssSearch.js +3 -4
- package/components/cssVariables/cssVariables.js +69 -67
- package/components/propsTable/propsTable.js +85 -79
- package/components/sideNav/sideNav.js +10 -3
- package/helpers/getTitle.js +2 -2
- package/layouts/sideNavLayout/sideNavLayout.css +0 -4
- package/layouts/sideNavLayout/sideNavLayout.js +48 -35
- package/package.json +26 -25
- package/pages/404/index.js +3 -3
- package/routes.js +19 -4
- package/scripts/cli/build.js +6 -0
- package/scripts/cli/cli.js +1 -0
- package/scripts/cli/start.js +6 -8
- package/scripts/md/parseMD.js +11 -1
- package/scripts/webpack/webpack.base.config.js +33 -31
- package/scripts/webpack/webpack.client.config.js +11 -13
- package/scripts/webpack/webpack.server.config.js +26 -10
- package/templates/html.ejs +1 -3
- package/templates/mdx.js +10 -2
- package/templates/patternfly-docs/content/extensions/extension/design-guidelines/design-guidelines.md +2 -0
- package/templates/patternfly-docs/content/extensions/extension/examples/basic.md +2 -0
- package/versions.json +29 -9
|
@@ -2,8 +2,11 @@ const path = require('path');
|
|
|
2
2
|
const webpack = require('webpack');
|
|
3
3
|
const { merge } = require('webpack-merge');
|
|
4
4
|
const baseConfig = require('./webpack.base.config');
|
|
5
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
6
|
+
const reactCSSRegex = /(react-[\w-]+\/dist|react-styles\/css)\/.*\.css$/;
|
|
5
7
|
|
|
6
|
-
const serverConfig = () => {
|
|
8
|
+
const serverConfig = async (env, argv) => {
|
|
9
|
+
const isProd = argv.mode === 'production';
|
|
7
10
|
return {
|
|
8
11
|
output: {
|
|
9
12
|
path: path.resolve('.cache/ssr-build'), // Don't bloat `public` dir
|
|
@@ -25,13 +28,26 @@ const serverConfig = () => {
|
|
|
25
28
|
rules: [
|
|
26
29
|
{
|
|
27
30
|
test: /\.css$/,
|
|
28
|
-
use:
|
|
31
|
+
use: [
|
|
32
|
+
{
|
|
33
|
+
loader: 'css-loader'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
loader: 'postcss-loader',
|
|
37
|
+
options: {
|
|
38
|
+
postcssOptions: {
|
|
39
|
+
plugins: [
|
|
40
|
+
require('autoprefixer')({
|
|
41
|
+
env: '>0.25%, not ie 11, not op_mini all',
|
|
42
|
+
flexbox: false,
|
|
43
|
+
grid: false
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
29
50
|
},
|
|
30
|
-
// This does weird things to document
|
|
31
|
-
{
|
|
32
|
-
test: /(novnc-core|@novnc\/novnc)\/.*\.js/,
|
|
33
|
-
use: 'null-loader'
|
|
34
|
-
}
|
|
35
51
|
]
|
|
36
52
|
},
|
|
37
53
|
resolve: {
|
|
@@ -41,7 +57,7 @@ const serverConfig = () => {
|
|
|
41
57
|
// The maintainer will not allow his bundle to be required from a node context
|
|
42
58
|
// https://github.com/xtermjs/xterm.js/pull/3134
|
|
43
59
|
'xterm': '@patternfly/documentation-framework/helpers/xterm',
|
|
44
|
-
'xterm-addon-fit': '@patternfly/documentation-framework/helpers/xterm-addon-fit'
|
|
60
|
+
'xterm-addon-fit': '@patternfly/documentation-framework/helpers/xterm-addon-fit',
|
|
45
61
|
},
|
|
46
62
|
},
|
|
47
63
|
// Load in prerender.js instead
|
|
@@ -49,7 +65,7 @@ const serverConfig = () => {
|
|
|
49
65
|
};
|
|
50
66
|
}
|
|
51
67
|
|
|
52
|
-
module.exports = (env = {}, argv) => merge(
|
|
68
|
+
module.exports = async (env = {}, argv) => merge(
|
|
53
69
|
baseConfig(env, argv),
|
|
54
|
-
serverConfig(env, argv)
|
|
70
|
+
await serverConfig(env, argv)
|
|
55
71
|
);
|
package/templates/html.ejs
CHANGED
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
<%= htmlWebpackPlugin.tags.headTags %>
|
|
17
17
|
</head>
|
|
18
18
|
<body class="pf-m-redhat-updated-font pf-m-redhatmono-font">
|
|
19
|
-
<div id="root">
|
|
20
|
-
<%= prerendering %>
|
|
21
|
-
</div>
|
|
19
|
+
<div id="root"><%= prerendering %></div>
|
|
22
20
|
<%= htmlWebpackPlugin.tags.bodyTags %>
|
|
23
21
|
<% if (algolia) { %>
|
|
24
22
|
<script
|
package/templates/mdx.js
CHANGED
|
@@ -121,7 +121,15 @@ export const MDXTemplate = ({
|
|
|
121
121
|
id,
|
|
122
122
|
componentsData
|
|
123
123
|
}) => {
|
|
124
|
-
|
|
124
|
+
// Build obj mapping source names to text displayed on tabs
|
|
125
|
+
const tabNames = sources.reduce((acc, curSrc) => {
|
|
126
|
+
const { source, tabName } = curSrc;
|
|
127
|
+
// use tabName for tab name if present, otherwise default to source
|
|
128
|
+
const tabLinkText = tabName || capitalize(source.replace('html', 'HTML').replace(/-/g, ' '));
|
|
129
|
+
acc[source] = tabLinkText;
|
|
130
|
+
return acc;
|
|
131
|
+
}, {});
|
|
132
|
+
const sourceKeys = Object.keys(tabNames);
|
|
125
133
|
const isSinglePage = sourceKeys.length === 1;
|
|
126
134
|
|
|
127
135
|
let isDevResources, isComponent, isExtension, isChart, isDemo, isLayout, isUtility;
|
|
@@ -223,7 +231,7 @@ export const MDXTemplate = ({
|
|
|
223
231
|
onClick={() => trackEvent('tab_click', 'click_event', source.toUpperCase())}
|
|
224
232
|
>
|
|
225
233
|
<Link className="pf-c-tabs__link" to={`${path}${index === 0 ? '' : '/' + source}`}>
|
|
226
|
-
{
|
|
234
|
+
{tabNames[source]}
|
|
227
235
|
</Link>
|
|
228
236
|
</li>
|
|
229
237
|
))}
|
|
@@ -7,6 +7,8 @@ section: extensions
|
|
|
7
7
|
id: My extension
|
|
8
8
|
# Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
|
|
9
9
|
source: design-guidelines
|
|
10
|
+
# Optional custom text to display in tab in place of source
|
|
11
|
+
tabName: My custom tab-name
|
|
10
12
|
---
|
|
11
13
|
|
|
12
14
|
Design guidelines intro
|
|
@@ -7,6 +7,8 @@ section: extensions
|
|
|
7
7
|
id: My extension
|
|
8
8
|
# Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
|
|
9
9
|
source: react
|
|
10
|
+
# Optional custom text to display in tab in place of source
|
|
11
|
+
tabName: My custom tab-name
|
|
10
12
|
# If you use typescript, the name of the interface to display props for
|
|
11
13
|
# These are found through the sourceProps function provdided in patternfly-docs.source.js
|
|
12
14
|
# Can also pass object { component: string, source: string } allowing to specify the source
|
package/versions.json
CHANGED
|
@@ -5,25 +5,45 @@
|
|
|
5
5
|
"date": "2022-02-08",
|
|
6
6
|
"latest": true,
|
|
7
7
|
"versions": {
|
|
8
|
-
"@patternfly/patternfly": "5.0.0-alpha.
|
|
8
|
+
"@patternfly/patternfly": "5.0.0-alpha.37",
|
|
9
|
+
"@patternfly/react-charts": "^7.0.0-alpha.14",
|
|
10
|
+
"@patternfly/react-code-editor": "^5.0.0-alpha.54",
|
|
11
|
+
"@patternfly/react-core": "^5.0.0-alpha.53",
|
|
12
|
+
"@patternfly/react-icons": "^5.0.0-alpha.8",
|
|
13
|
+
"@patternfly/react-styles": "^5.0.0-alpha.6",
|
|
14
|
+
"@patternfly/react-table": "^5.0.0-alpha.54",
|
|
15
|
+
"@patternfly/react-tokens": "^5.0.0-alpha.6",
|
|
9
16
|
"@patternfly/react-catalog-view-extension": "4.95.1",
|
|
10
|
-
"@patternfly/react-
|
|
11
|
-
"@patternfly/react-code-editor": "5.0.0-alpha.7",
|
|
12
|
-
"@patternfly/react-core": "5.0.0-alpha.7",
|
|
13
|
-
"@patternfly/react-icons": "5.0.0-alpha.2",
|
|
17
|
+
"@patternfly/react-drag-drop": "5.0.0-alpha.0",
|
|
14
18
|
"@patternfly/react-inline-edit-extension": "4.86.118",
|
|
15
19
|
"@patternfly/react-log-viewer": "4.87.100",
|
|
16
|
-
"@patternfly/react-styles": "5.0.0-alpha.2",
|
|
17
|
-
"@patternfly/react-table": "5.0.0-alpha.7",
|
|
18
|
-
"@patternfly/react-tokens": "5.0.0-alpha.2",
|
|
19
20
|
"@patternfly/react-topology": "4.91.27",
|
|
20
21
|
"@patternfly/react-virtualized-extension": "4.88.113"
|
|
21
22
|
}
|
|
22
23
|
},
|
|
24
|
+
{
|
|
25
|
+
"name": "2023.02",
|
|
26
|
+
"date": "2022-03-27",
|
|
27
|
+
"versions": {
|
|
28
|
+
"@patternfly/patternfly": "4.224.4",
|
|
29
|
+
"@patternfly/react-catalog-view-extension": "4.96.0",
|
|
30
|
+
"@patternfly/react-charts": "6.94.19",
|
|
31
|
+
"@patternfly/react-code-editor": "4.82.115",
|
|
32
|
+
"@patternfly/react-console": "4.95.5",
|
|
33
|
+
"@patternfly/react-core": "4.276.8",
|
|
34
|
+
"@patternfly/react-icons": "4.93.6",
|
|
35
|
+
"@patternfly/react-inline-edit-extension": "4.86.122",
|
|
36
|
+
"@patternfly/react-log-viewer": "4.87.100",
|
|
37
|
+
"@patternfly/react-styles": "4.92.6",
|
|
38
|
+
"@patternfly/react-table": "4.113.0",
|
|
39
|
+
"@patternfly/react-tokens": "4.94.6",
|
|
40
|
+
"@patternfly/react-topology": "4.91.40",
|
|
41
|
+
"@patternfly/react-virtualized-extension": "4.88.115"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
23
44
|
{
|
|
24
45
|
"name": "2023.01",
|
|
25
46
|
"date": "2022-01-31",
|
|
26
|
-
"latest": true,
|
|
27
47
|
"versions": {
|
|
28
48
|
"@patternfly/patternfly": "4.224.2",
|
|
29
49
|
"@patternfly/react-catalog-view-extension": "4.95.1",
|