@patternfly/documentation-framework 2.0.0-alpha.9 → 5.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 +614 -0
- package/README.md +1 -1
- package/app.js +20 -14
- package/assets/Favicon-Light-16x16.png +0 -0
- package/assets/Favicon-Light-32x32.png +0 -0
- package/assets/Favicon-Light-48x48.png +0 -0
- package/assets/Favicon-Light.png +0 -0
- package/assets/android-chrome-36x36.png +0 -0
- package/assets/android-chrome-48x48.png +0 -0
- package/assets/android-chrome-96x96.png +0 -0
- package/components/autoLinkHeader/autoLinkHeader.css +2 -2
- package/components/autoLinkHeader/autoLinkHeader.js +18 -13
- package/components/cssVariables/cssSearch.js +3 -4
- package/components/cssVariables/cssVariables.css +4 -4
- package/components/cssVariables/cssVariables.js +83 -84
- package/components/example/example.css +29 -29
- package/components/example/example.js +34 -6
- package/components/footer/footer.css +16 -16
- package/components/footer/footer.js +16 -16
- package/components/functionsTable/functionsTable.js +57 -0
- package/components/gdprBanner/gdprBanner.css +2 -2
- package/components/gdprBanner/gdprBanner.js +3 -3
- package/components/inlineAlert/inlineAlert.js +1 -1
- package/components/link/link.js +1 -2
- package/components/propsTable/propsTable.js +85 -79
- package/components/sectionGallery/TextSummary.js +31 -0
- package/components/sectionGallery/sectionDataListLayout.js +51 -0
- package/components/sectionGallery/sectionGallery.css +53 -0
- package/components/sectionGallery/sectionGallery.js +76 -0
- package/components/sectionGallery/sectionGalleryLayout.js +41 -0
- package/components/sectionGallery/sectionGalleryToolbar.js +38 -0
- package/components/sectionGallery/sectionGalleryWrapper.js +110 -0
- package/components/sideNav/sideNav.css +12 -12
- package/components/sideNav/sideNav.js +44 -16
- package/components/tableOfContents/tableOfContents.css +17 -17
- package/helpers/codesandbox.js +3 -5
- package/helpers/getTitle.js +2 -2
- package/layouts/sideNavLayout/sideNavLayout.css +7 -11
- package/layouts/sideNavLayout/sideNavLayout.js +59 -45
- package/package.json +28 -29
- package/pages/404/404.css +2 -2
- package/pages/404/index.js +1 -1
- package/pages/global-css-variables.md +16 -16
- package/routes.js +20 -10
- package/scripts/cli/build.js +0 -1
- package/scripts/cli/cli.js +2 -1
- package/scripts/cli/generate.js +2 -2
- package/scripts/cli/start.js +6 -8
- package/scripts/md/parseMD.js +46 -11
- package/scripts/md/styled-tags.js +8 -4
- package/scripts/tsDocgen.js +119 -91
- package/scripts/typeDocGen.js +209 -0
- package/scripts/webpack/getHtmlWebpackPlugins.js +1 -2
- package/scripts/webpack/prerender.js +1 -2
- package/scripts/webpack/webpack.base.config.js +35 -35
- package/scripts/webpack/webpack.client.config.js +11 -8
- package/scripts/webpack/webpack.server.config.js +8 -5
- package/scripts/writeScreenshots.js +3 -3
- package/templates/html.ejs +6 -8
- package/templates/mdx.css +156 -161
- package/templates/mdx.js +122 -51
- 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/templates/sitemap.ejs +1 -1
- package/versions.json +32 -14
- package/assets/favicon-16x16.png +0 -0
- package/assets/favicon-32x32.png +0 -0
- package/assets/favicon-48x48.png +0 -0
- package/assets/favicon.ico +0 -0
- package/components/topNav/topNav.css +0 -30
- package/pages/red-hat-font.md +0 -40
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button, SearchInput, Toolbar, ToolbarContent, ToolbarGroup, ToolbarItem, Text, TextVariants, ToggleGroup, ToggleGroupItem } from '@patternfly/react-core';
|
|
3
|
+
import ListIcon from '@patternfly/react-icons/dist/esm/icons/list-icon';
|
|
4
|
+
import ThIcon from'@patternfly/react-icons/dist/esm/icons/th-icon';
|
|
5
|
+
|
|
6
|
+
export const SectionGalleryToolbar = ({
|
|
7
|
+
galleryItems,
|
|
8
|
+
searchTerm,
|
|
9
|
+
setSearchTerm,
|
|
10
|
+
layoutView,
|
|
11
|
+
setLayoutView,
|
|
12
|
+
placeholderText ="Search by name",
|
|
13
|
+
countText=" items"
|
|
14
|
+
}) => (
|
|
15
|
+
<Toolbar isSticky>
|
|
16
|
+
<ToolbarContent>
|
|
17
|
+
<ToolbarItem variant="search-filter" widths={{default: '100%', md: '320px'}}>
|
|
18
|
+
<SearchInput onClear={false} value={searchTerm} placeholder={placeholderText} onChange={(_evt, val) => setSearchTerm(val)} />
|
|
19
|
+
</ToolbarItem>
|
|
20
|
+
{searchTerm && (
|
|
21
|
+
<ToolbarItem>
|
|
22
|
+
<Button variant="link" onClick={() => setSearchTerm('')}>Reset</Button>
|
|
23
|
+
</ToolbarItem>
|
|
24
|
+
)}
|
|
25
|
+
<ToolbarGroup variant="icon-button-group">
|
|
26
|
+
<ToolbarItem>
|
|
27
|
+
<ToggleGroup>
|
|
28
|
+
<ToggleGroupItem icon={<ThIcon />} aria-label="grid icon button" isSelected={layoutView === 'grid'} onChange={() => setLayoutView('grid')}></ToggleGroupItem>
|
|
29
|
+
<ToggleGroupItem icon={<ListIcon />} aria-label="list icon button" isSelected={layoutView === 'list'} onChange={() => setLayoutView('list')}></ToggleGroupItem>
|
|
30
|
+
</ToggleGroup>
|
|
31
|
+
</ToolbarItem>
|
|
32
|
+
</ToolbarGroup>
|
|
33
|
+
<ToolbarItem variant="pagination" spacer={{default: 'spacerMd', md: 'spacerNone'}} style={{'--pf-v5-c-toolbar__item--MinWidth': "max-content"}}>
|
|
34
|
+
<Text component={TextVariants.small}>{ galleryItems.length }{ countText }</Text>
|
|
35
|
+
</ToolbarItem>
|
|
36
|
+
</ToolbarContent>
|
|
37
|
+
</Toolbar>
|
|
38
|
+
);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { groupedRoutes } from '../../routes';
|
|
3
|
+
|
|
4
|
+
export const SectionGalleryWrapper = ({
|
|
5
|
+
section,
|
|
6
|
+
subsection,
|
|
7
|
+
galleryItemsData,
|
|
8
|
+
illustrations,
|
|
9
|
+
includeSubsections,
|
|
10
|
+
parseSubsections,
|
|
11
|
+
initialLayout,
|
|
12
|
+
isFullWidth,
|
|
13
|
+
children
|
|
14
|
+
}) => {
|
|
15
|
+
let sectionRoutes = subsection ? groupedRoutes[section][subsection] : groupedRoutes[section];
|
|
16
|
+
if (!includeSubsections || parseSubsections) {
|
|
17
|
+
const sectionRoutesArr = Object.entries(sectionRoutes);
|
|
18
|
+
// loop through galleryItems object and build new object to handle subsections
|
|
19
|
+
sectionRoutes = sectionRoutesArr.reduce((acc, [navName, routeData]) => {
|
|
20
|
+
// exit immediately if current item is isSubsection flag
|
|
21
|
+
if (navName === 'isSubsection') {
|
|
22
|
+
return acc;
|
|
23
|
+
}
|
|
24
|
+
// add current item
|
|
25
|
+
if (includeSubsections || !routeData.isSubsection) {
|
|
26
|
+
acc[navName] = routeData;
|
|
27
|
+
}
|
|
28
|
+
// drill down into current item if subsection and parseSubsections === true
|
|
29
|
+
if (parseSubsections && routeData.isSubsection) {
|
|
30
|
+
// loop through each subsection item & add
|
|
31
|
+
Object.entries(routeData).map(([subitemName, subitemData]) => {
|
|
32
|
+
if (subitemName !== 'isSubsection') {
|
|
33
|
+
acc[subitemName] = subitemData;
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
return acc;
|
|
38
|
+
}, {})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const [searchTerm, setSearchTerm] = React.useState('');
|
|
42
|
+
const [layoutView, setLayoutView] = React.useState(initialLayout);
|
|
43
|
+
const filteredItems = Object.entries(sectionRoutes)
|
|
44
|
+
.filter(([itemName, { slug }]) => (
|
|
45
|
+
// exclude current gallery page from results
|
|
46
|
+
!location.pathname.endsWith(slug) &&
|
|
47
|
+
itemName
|
|
48
|
+
.toLowerCase()
|
|
49
|
+
.includes(searchTerm.toLowerCase())
|
|
50
|
+
));
|
|
51
|
+
const sectionGalleryItems = filteredItems
|
|
52
|
+
.sort(([itemName1], [itemName2]) => itemName1.localeCompare(itemName2))
|
|
53
|
+
.map(([itemName, itemData], idx) => {
|
|
54
|
+
let illustration = null;
|
|
55
|
+
if (illustrations) {
|
|
56
|
+
// Convert to lowercase-camelcase ex: File upload - multiple ==> file_upload_multiple
|
|
57
|
+
const illustrationName = itemName
|
|
58
|
+
.replace('-', '')
|
|
59
|
+
.replace(' ',' ')
|
|
60
|
+
.split(' ')
|
|
61
|
+
.join('_')
|
|
62
|
+
.toLowerCase();
|
|
63
|
+
illustration = illustrations[illustrationName] || illustrations.default_placeholder;
|
|
64
|
+
}
|
|
65
|
+
const { sources, isSubsection = false } = itemData;
|
|
66
|
+
// Subsections don't have title or id, default to itemName aka sidenav text
|
|
67
|
+
const title = itemData.title || itemName;
|
|
68
|
+
const id = itemData.id || title;
|
|
69
|
+
// Display beta label if tab other than a '-next' tab is marked Beta
|
|
70
|
+
const isDeprecated = !isSubsection && sources && sources.some(source => source.source === "react-deprecated" || source.source === "html-deprecated") && !sources.some(source => source.source === "react" || source.source === "html");
|
|
71
|
+
const isBeta = !isSubsection && sources && sources.some(src => src.beta && !src.source.includes('-next'));
|
|
72
|
+
const isDemo = !isSubsection && sources && sources.some(source => source.source === "react-demos" || source.source === "html-demos") && !sources.some(source => source.source === "react" || source.source === "html");
|
|
73
|
+
|
|
74
|
+
let slug = itemData.slug;
|
|
75
|
+
if (!slug && isSubsection) {
|
|
76
|
+
// Update slug to link to first page in subsection
|
|
77
|
+
const subsectionItems = Object.entries(itemData).filter(([name, _data]) => name !== 'isSubsection');
|
|
78
|
+
const sortedSubsectionItems = subsectionItems.sort((
|
|
79
|
+
[name1, {sortValue: sortValue1 = 50}],
|
|
80
|
+
[name2, {sortValue: sortValue2 = 50}]
|
|
81
|
+
) => {
|
|
82
|
+
if (sortValue1 === sortValue2) {
|
|
83
|
+
return name1.localeCompare(name2);
|
|
84
|
+
}
|
|
85
|
+
return sortValue1 > sortValue2 ? 1 : -1;
|
|
86
|
+
});
|
|
87
|
+
const firstSubsectionItem = sortedSubsectionItems[0];
|
|
88
|
+
slug = firstSubsectionItem[1].slug;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
idx,
|
|
93
|
+
slug,
|
|
94
|
+
itemName,
|
|
95
|
+
illustration,
|
|
96
|
+
isBeta,
|
|
97
|
+
isDeprecated,
|
|
98
|
+
isDemo,
|
|
99
|
+
title,
|
|
100
|
+
id,
|
|
101
|
+
galleryItemsData
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<div className={`ws-section-gallery${ isFullWidth ? ' ws-section-gallery-full-width' : '' }`}>
|
|
107
|
+
{ children(sectionGalleryItems, searchTerm, setSearchTerm, layoutView, setLayoutView) }
|
|
108
|
+
</div>
|
|
109
|
+
)
|
|
110
|
+
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
.ws-page-sidebar .pf-c-nav {
|
|
2
|
-
--pf-c-nav__link--before--BorderBottomWidth: 0;
|
|
3
|
-
--pf-c-nav--m-light__link--hover--BackgroundColor: var(--pf-global--BackgroundColor--light-200);
|
|
4
|
-
--pf-c-nav--m-light__link--focus--BackgroundColor: var(--pf-global--BackgroundColor--light-200);
|
|
5
|
-
--pf-c-nav--m-light__link--m-current--BackgroundColor: var(--pf-global--BackgroundColor--light-200);
|
|
6
|
-
--pf-c-nav--m-light__link--active--BackgroundColor: var(--pf-global--BackgroundColor--light-200);
|
|
7
|
-
--pf-c-nav__link--m-current--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
1
|
+
.ws-page-sidebar .pf-v5-c-nav {
|
|
2
|
+
--pf-v5-c-nav__link--before--BorderBottomWidth: 0;
|
|
3
|
+
--pf-v5-c-nav--m-light__link--hover--BackgroundColor: var(--pf-v5-global--BackgroundColor--light-200);
|
|
4
|
+
--pf-v5-c-nav--m-light__link--focus--BackgroundColor: var(--pf-v5-global--BackgroundColor--light-200);
|
|
5
|
+
--pf-v5-c-nav--m-light__link--m-current--BackgroundColor: var(--pf-v5-global--BackgroundColor--light-200);
|
|
6
|
+
--pf-v5-c-nav--m-light__link--active--BackgroundColor: var(--pf-v5-global--BackgroundColor--light-200);
|
|
7
|
+
--pf-v5-c-nav__link--m-current--BackgroundColor: var(--pf-v5-global--BackgroundColor--200);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.ws-side-nav-list .pf-c-nav__item.pf-m-expandable::before {
|
|
10
|
+
.ws-side-nav-list .pf-v5-c-nav__item.pf-m-expandable::before {
|
|
11
11
|
border-bottom: 0;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.pf-c-nav__subsection-title {
|
|
15
|
-
color: var(--ws-toc-link--Color, var(--pf-global--Color--300));
|
|
16
|
-
font-size: var(--pf-global--FontSize--sm);
|
|
14
|
+
.pf-v5-c-nav__subsection-title {
|
|
15
|
+
color: var(--ws-toc-link--Color, var(--pf-v5-global--Color--300));
|
|
16
|
+
font-size: var(--pf-v5-global--FontSize--sm);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
#ws-sticky-nav-tabs {
|
|
20
|
-
z-index: var(--pf-global--ZIndex--2xl);
|
|
20
|
+
z-index: var(--pf-v5-global--ZIndex--2xl);
|
|
21
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Link } from '../link/link';
|
|
3
|
-
import { Nav, NavList, NavExpandable, PageContextConsumer, capitalize } from '@patternfly/react-core';
|
|
3
|
+
import { Label, Nav, NavList, NavExpandable, PageContextConsumer, capitalize, Flex, FlexItem } from '@patternfly/react-core';
|
|
4
4
|
import { css } from '@patternfly/react-styles';
|
|
5
5
|
import { Location } from '@reach/router';
|
|
6
6
|
import { makeSlug } from '../../helpers';
|
|
@@ -9,29 +9,42 @@ import { trackEvent } from '../../helpers';
|
|
|
9
9
|
|
|
10
10
|
const getIsActive = (location, section, subsection = null) => {
|
|
11
11
|
const slug = makeSlug(null, section, null, null, subsection);
|
|
12
|
-
return location.pathname.startsWith(
|
|
12
|
+
return location.pathname.startsWith(slug);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const defaultValue = 50;
|
|
16
|
+
|
|
17
|
+
const NavItem = ({ text, href, isDeprecated, isBeta, isDemo }) => {
|
|
16
18
|
const isMobileView = window.innerWidth < Number.parseInt(globalBreakpointXl.value, 10);
|
|
17
19
|
return (
|
|
18
20
|
<PageContextConsumer key={href + text}>
|
|
19
|
-
{({
|
|
20
|
-
<li key={href + text} className="pf-c-nav__item" onClick={() => isMobileView &&
|
|
21
|
+
{({onSidebarToggle, isSidebarOpen }) => (
|
|
22
|
+
<li key={href + text} className="pf-v5-c-nav__item" onClick={() => isMobileView && onSidebarToggle && onSidebarToggle()}>
|
|
21
23
|
<Link
|
|
22
24
|
to={href}
|
|
23
25
|
getProps={({ isCurrent, href, location }) => {
|
|
24
26
|
const { pathname } = location;
|
|
25
27
|
return {
|
|
26
28
|
className: css(
|
|
27
|
-
'pf-c-nav__link',
|
|
29
|
+
'pf-v5-c-nav__link',
|
|
28
30
|
(isCurrent || pathname.startsWith(href + '/')) && 'pf-m-current'
|
|
29
31
|
)
|
|
30
32
|
}}
|
|
31
33
|
}
|
|
32
|
-
tabIndex={
|
|
34
|
+
tabIndex={isSidebarOpen ? undefined : -1}
|
|
33
35
|
>
|
|
34
|
-
{
|
|
36
|
+
<Flex spaceItems={{ default: 'spaceItemsSm'}}>
|
|
37
|
+
<FlexItem>{text}</FlexItem>
|
|
38
|
+
{(isBeta || isDemo || isDeprecated) && (
|
|
39
|
+
<FlexItem>
|
|
40
|
+
{isBeta && (<Label color="blue" isCompact>Beta</Label>)}
|
|
41
|
+
{!isBeta && isDeprecated && (<Label color="grey" isCompact>Deprecated</Label>)}
|
|
42
|
+
{!isBeta && !isDeprecated && isDemo && (<Label color="purple" isCompact>Demo</Label>)}
|
|
43
|
+
</FlexItem>
|
|
44
|
+
)}
|
|
45
|
+
</Flex>
|
|
46
|
+
|
|
47
|
+
|
|
35
48
|
</Link>
|
|
36
49
|
</li>
|
|
37
50
|
)}
|
|
@@ -67,14 +80,29 @@ const ExpandableNav = ({groupedRoutes, location, section, subsection = null}) =>
|
|
|
67
80
|
}}
|
|
68
81
|
>
|
|
69
82
|
{Object.entries(routes || {})
|
|
70
|
-
.filter(([id,
|
|
71
|
-
.map(([id, { slug, isSubsection = false }]) => ({ text: id, href: slug, isSubsection }))
|
|
72
|
-
.sort(({
|
|
83
|
+
.filter(([id, navObj]) => !Boolean(navObj.hideNavItem) && (Object.entries(navObj).length > 0))
|
|
84
|
+
.map(([id, { slug, isSubsection = false, sortValue = defaultValue, subsectionSortValue = defaultValue, sources }]) => ({ text: id, href: slug, isSubsection, sortValue: (isSubsection ? subsectionSortValue : sortValue), sources }))
|
|
85
|
+
.sort(({text: text1, sortValue: sortValue1}, {text: text2, sortValue: sortValue2}) => {
|
|
86
|
+
if (sortValue1 === sortValue2) {
|
|
87
|
+
return text1.localeCompare(text2);
|
|
88
|
+
}
|
|
89
|
+
return sortValue1 > sortValue2 ? 1 : -1;
|
|
90
|
+
})
|
|
73
91
|
.map(navObj => navObj.isSubsection
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
92
|
+
? ExpandableNav({groupedRoutes, location, section, subsection: navObj.text})
|
|
93
|
+
: NavItem({
|
|
94
|
+
...navObj,
|
|
95
|
+
isDeprecated: navObj.href?.includes('components') && navObj.sources.some(source => (
|
|
96
|
+
source.source === "react-deprecated" || source.source === "html-deprecated")
|
|
97
|
+
&& !navObj.sources.some(source => source.source === "react" || source.source === "html")
|
|
98
|
+
),
|
|
99
|
+
isBeta: navObj.sources.some(source => source.beta),
|
|
100
|
+
isDemo: navObj.sources.some(source => (
|
|
101
|
+
source.source === "react-demos" || source.source === "html-demos")
|
|
102
|
+
&& !navObj.sources.some(source => source.source === "react" || source.source === "html")
|
|
103
|
+
)
|
|
104
|
+
})
|
|
105
|
+
)}
|
|
78
106
|
</NavExpandable>
|
|
79
107
|
);
|
|
80
108
|
}
|
|
@@ -94,7 +122,7 @@ export const SideNav = ({ groupedRoutes = {}, navItems = [] }) => {
|
|
|
94
122
|
lastElement.scrollIntoView({ block: 'center' });
|
|
95
123
|
}
|
|
96
124
|
}, []);
|
|
97
|
-
|
|
125
|
+
|
|
98
126
|
return (
|
|
99
127
|
<Nav aria-label="Side Nav" theme="light">
|
|
100
128
|
<NavList className="ws-side-nav-list">
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
.ws-toc {
|
|
2
2
|
align-self: flex-start;
|
|
3
3
|
position: sticky;
|
|
4
|
-
width: calc(100% + var(--pf-c-page__main-section--PaddingLeft) + var(--pf-c-page__main-section--PaddingRight));
|
|
5
|
-
background-color: var(--pf-global--BackgroundColor--200);
|
|
4
|
+
width: calc(100% + var(--pf-v5-c-page__main-section--PaddingLeft) + var(--pf-v5-c-page__main-section--PaddingRight));
|
|
5
|
+
background-color: var(--pf-v5-global--BackgroundColor--200);
|
|
6
6
|
z-index: 501;
|
|
7
|
-
margin: calc(var(--pf-c-page__main-section--PaddingTop) * -1) calc(var(--pf-c-page__main-section--PaddingRight) * -2) var(--pf-global--spacer--md) calc(var(--pf-c-page__main-section--PaddingLeft) * -1);
|
|
8
|
-
padding: var(--pf-global--spacer--md) 0 var(--pf-global--spacer--md) var(--pf-global--spacer--md);
|
|
9
|
-
box-shadow: var(--pf-global--BoxShadow--lg-bottom);
|
|
7
|
+
margin: calc(var(--pf-v5-c-page__main-section--PaddingTop) * -1) calc(var(--pf-v5-c-page__main-section--PaddingRight) * -2) var(--pf-v5-global--spacer--md) calc(var(--pf-v5-c-page__main-section--PaddingLeft) * -1);
|
|
8
|
+
padding: var(--pf-v5-global--spacer--md) 0 var(--pf-v5-global--spacer--md) var(--pf-v5-global--spacer--md);
|
|
9
|
+
box-shadow: var(--pf-v5-global--BoxShadow--lg-bottom);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.ws-toc.pf-m-expanded {
|
|
13
|
-
box-shadow: var(--pf-global--BoxShadow--sm-bottom)
|
|
13
|
+
box-shadow: var(--pf-v5-global--BoxShadow--sm-bottom)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/* Mobile jumplinks */
|
|
17
17
|
@media (max-width: 1450px) {
|
|
18
|
-
.ws-toc.pf-m-expanded .pf-c-jump-links__main {
|
|
18
|
+
.ws-toc.pf-m-expanded .pf-v5-c-jump-links__main {
|
|
19
19
|
max-height: 65vh;
|
|
20
20
|
overflow: auto;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.ws-toc .pf-c-jump-links__header {
|
|
23
|
+
.ws-toc .pf-v5-c-jump-links__header {
|
|
24
24
|
position: sticky;
|
|
25
25
|
top: 0;
|
|
26
|
-
background-color: var(--pf-global--BackgroundColor--200);
|
|
26
|
+
background-color: var(--pf-v5-global--BackgroundColor--200);
|
|
27
27
|
z-index: 2;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.ws-toc .pf-c-jump-links__main {
|
|
31
|
+
.ws-toc .pf-v5-c-jump-links__main {
|
|
32
32
|
scrollbar-width: none;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/* Hide TOC scrollbar Chrome, Safari & Opera */
|
|
36
|
-
.ws-toc .pf-c-jump-links__main::-webkit-scrollbar {
|
|
36
|
+
.ws-toc .pf-v5-c-jump-links__main::-webkit-scrollbar {
|
|
37
37
|
display: none;
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
-ms-overflow-style: none;
|
|
47
47
|
scrollbar-width: none;
|
|
48
48
|
order: 1;
|
|
49
|
-
padding: 0 var(--pf-global--spacer--lg) var(--pf-global--spacer--lg) var(--pf-global--spacer--2xl);
|
|
49
|
+
padding: 0 var(--pf-v5-global--spacer--lg) var(--pf-v5-global--spacer--lg) var(--pf-v5-global--spacer--2xl);
|
|
50
50
|
flex-grow: 1;
|
|
51
51
|
background: none;
|
|
52
52
|
margin: 0;
|
|
@@ -59,18 +59,18 @@
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/* .ws-toc-link { */
|
|
62
|
-
.ws-toc-item .pf-c-jump-links__link {
|
|
62
|
+
.ws-toc-item .pf-v5-c-jump-links__link {
|
|
63
63
|
position: relative;
|
|
64
64
|
display: block;
|
|
65
|
-
color: var(--ws-toc-link--Color, var(--pf-global--Color--300));
|
|
66
|
-
font-size: var(--pf-global--FontSize--sm);
|
|
65
|
+
color: var(--ws-toc-link--Color, var(--pf-v5-global--Color--300));
|
|
66
|
+
font-size: var(--pf-v5-global--FontSize--sm);
|
|
67
67
|
margin: -4px 0;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
.ws-toc-sublist > .ws-toc-item:first-child .pf-c-jump-links__link {
|
|
70
|
+
.ws-toc-sublist > .ws-toc-item:first-child .pf-v5-c-jump-links__link {
|
|
71
71
|
margin-top: 0;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
.ws-toc-item.pf-m-current .pf-c-jump-links__link::before {
|
|
74
|
+
.ws-toc-item.pf-m-current .pf-v5-c-jump-links__link::before {
|
|
75
75
|
z-index: 1;
|
|
76
76
|
}
|
package/helpers/codesandbox.js
CHANGED
|
@@ -2,15 +2,13 @@ const { parse } = require('@patternfly/ast-helpers');
|
|
|
2
2
|
const versions = require('../versions.json');
|
|
3
3
|
const overpass = require('./fonts');
|
|
4
4
|
const { capitalize } = require('./capitalize');
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const pathPrefix = process.env.pathPrefix;
|
|
7
5
|
|
|
8
6
|
const getStaticParams = (title, html) => {
|
|
9
7
|
const imgAssetRegex = /['"](\/assets\/images\/.*)['"]/g;
|
|
10
8
|
let imgAsset;
|
|
11
9
|
while ((imgAsset = imgAssetRegex.exec(html))) {
|
|
12
10
|
const imgName = imgAsset[1];
|
|
13
|
-
html = html.replace(imgName, `https://www.patternfly.org
|
|
11
|
+
html = html.replace(imgName, `https://www.patternfly.org${imgName}`);
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
return {
|
|
@@ -18,7 +16,7 @@ const getStaticParams = (title, html) => {
|
|
|
18
16
|
'index.html': {
|
|
19
17
|
content: `
|
|
20
18
|
<!DOCTYPE html>
|
|
21
|
-
<html lang="en"
|
|
19
|
+
<html lang="en">
|
|
22
20
|
<head>
|
|
23
21
|
<meta charset="utf-8" />
|
|
24
22
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
@@ -184,7 +182,7 @@ function getReactParams(title, code, scope, lang, relativeImports, relPath, sour
|
|
|
184
182
|
files: {
|
|
185
183
|
'index.html': {
|
|
186
184
|
content: `<!DOCTYPE html>
|
|
187
|
-
<html lang="en"
|
|
185
|
+
<html lang="en">
|
|
188
186
|
<head>
|
|
189
187
|
<meta charset="utf-8" />
|
|
190
188
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
package/helpers/getTitle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* Page layout */
|
|
2
|
-
/* tells .pf-c-page to consume the available space left over from the banners/footers */
|
|
2
|
+
/* tells .pf-v5-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;
|
|
@@ -9,11 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.ws-switcher-divider {
|
|
12
|
-
padding: 0 var(--pf-global--spacer--md);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.ws-patternfly-3 > svg {
|
|
16
|
-
margin-left: var(--pf-global--spacer--sm);
|
|
12
|
+
padding: 0 var(--pf-v5-global--spacer--md);
|
|
17
13
|
}
|
|
18
14
|
|
|
19
15
|
@media (min-width: 1200px) {
|
|
@@ -22,8 +18,8 @@
|
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
|
|
25
|
-
.ws-page-sidebar > .pf-c-page__sidebar-body {
|
|
26
|
-
padding-top: var(--pf-global--spacer--md);
|
|
21
|
+
.ws-page-sidebar > .pf-v5-c-page__sidebar-body {
|
|
22
|
+
padding-top: var(--pf-v5-global--spacer--md);
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
/* Search */
|
|
@@ -31,12 +27,12 @@
|
|
|
31
27
|
/* Fix search results overflowing page */
|
|
32
28
|
min-width: 480px !important;
|
|
33
29
|
}
|
|
34
|
-
.ws-global-search.pf-c-input-group {
|
|
30
|
+
.ws-global-search.pf-v5-c-input-group {
|
|
35
31
|
/* remove white background on dark Masthead */
|
|
36
|
-
--pf-c-input-group--BackgroundColor: none;
|
|
32
|
+
--pf-v5-c-input-group--BackgroundColor: none;
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
/* For tiny (200px) viewports */
|
|
40
|
-
.ws-masthead .pf-c-toolbar__item {
|
|
36
|
+
.ws-masthead .pf-v5-c-toolbar__item {
|
|
41
37
|
min-width: 0;
|
|
42
38
|
}
|