@patternfly/documentation-framework 6.0.7 → 6.0.9
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
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.0.9 (2024-11-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/documentation-framework
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 6.0.8 (2024-11-15)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **docs:** fix scroll selector to scroll to top on page change ([#4364](https://github.com/patternfly/patternfly-org/issues/4364)) ([c0a0c26](https://github.com/patternfly/patternfly-org/commit/c0a0c26bf10b7a784fab194d626342a7d71e86d6))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## 6.0.7 (2024-11-15)
|
|
7
26
|
|
|
8
27
|
|
package/components/link/link.js
CHANGED
|
@@ -16,13 +16,7 @@ const Promiseany = (
|
|
|
16
16
|
}
|
|
17
17
|
).bind(Promise);
|
|
18
18
|
|
|
19
|
-
export const Link = ({
|
|
20
|
-
href,
|
|
21
|
-
to,
|
|
22
|
-
onMouseOver = () => {},
|
|
23
|
-
onClick,
|
|
24
|
-
...props
|
|
25
|
-
}) => {
|
|
19
|
+
export const Link = ({ href, to, onMouseOver = () => {}, onClick, ...props }) => {
|
|
26
20
|
let preloadPromise;
|
|
27
21
|
let url = href || to || '';
|
|
28
22
|
if (url.startsWith('#') && !onClick) {
|
|
@@ -54,14 +48,12 @@ export const Link = ({
|
|
|
54
48
|
if (!(ev.ctrlKey || ev.metaKey)) {
|
|
55
49
|
// avoid disallowing cmnd/ctrl+click opening in new tab
|
|
56
50
|
ev.preventDefault();
|
|
57
|
-
document
|
|
58
|
-
.querySelector('.pf-v6-c-page__main-container')
|
|
59
|
-
.scrollTo({ top: 0 }); // scroll to top of page
|
|
60
51
|
if (typeof window !== 'undefined' && url !== location.pathname) {
|
|
61
|
-
Promiseany([
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
Promiseany([preloadPromise, new Promise((res) => setTimeout(res, 500))])
|
|
53
|
+
.then(() => navigate(url))
|
|
54
|
+
.then(() => {
|
|
55
|
+
document.querySelector('#ws-page-main').scrollTo({ top: 0 }); // scroll to top of page
|
|
56
|
+
});
|
|
65
57
|
}
|
|
66
58
|
}
|
|
67
59
|
};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
JumpLinks,
|
|
4
|
-
JumpLinksItem,
|
|
5
|
-
JumpLinksList,
|
|
6
|
-
} from '@patternfly/react-core';
|
|
2
|
+
import { JumpLinks, JumpLinksItem, JumpLinksList } from '@patternfly/react-core';
|
|
7
3
|
import { trackEvent } from '../../helpers';
|
|
8
4
|
|
|
9
5
|
export const TableOfContents = ({ items }) => {
|
|
@@ -14,9 +10,7 @@ export const TableOfContents = ({ items }) => {
|
|
|
14
10
|
|
|
15
11
|
React.useEffect(() => {
|
|
16
12
|
if (document.getElementById('ws-sticky-nav-tabs')) {
|
|
17
|
-
setStickyNavHeight(
|
|
18
|
-
document.getElementById('ws-sticky-nav-tabs').offsetHeight
|
|
19
|
-
);
|
|
13
|
+
setStickyNavHeight(document.getElementById('ws-sticky-nav-tabs').offsetHeight);
|
|
20
14
|
}
|
|
21
15
|
}, []);
|
|
22
16
|
|
|
@@ -40,13 +34,7 @@ export const TableOfContents = ({ items }) => {
|
|
|
40
34
|
className="ws-toc-item"
|
|
41
35
|
onKeyDown={updateWidth}
|
|
42
36
|
onMouseDown={updateWidth}
|
|
43
|
-
onClick={() =>
|
|
44
|
-
trackEvent(
|
|
45
|
-
'jump_link_click',
|
|
46
|
-
'click_event',
|
|
47
|
-
curItem.id.toUpperCase()
|
|
48
|
-
)
|
|
49
|
-
}
|
|
37
|
+
onClick={() => trackEvent('jump_link_click', 'click_event', curItem.id.toUpperCase())}
|
|
50
38
|
>
|
|
51
39
|
{curItem.text}
|
|
52
40
|
</JumpLinksItem>
|
|
@@ -74,13 +62,7 @@ export const TableOfContents = ({ items }) => {
|
|
|
74
62
|
className="ws-toc-item"
|
|
75
63
|
onKeyDown={updateWidth}
|
|
76
64
|
onMouseDown={updateWidth}
|
|
77
|
-
onClick={() =>
|
|
78
|
-
trackEvent(
|
|
79
|
-
'jump_link_click',
|
|
80
|
-
'click_event',
|
|
81
|
-
curItem.id.toUpperCase()
|
|
82
|
-
)
|
|
83
|
-
}
|
|
65
|
+
onClick={() => trackEvent('jump_link_click', 'click_event', curItem.id.toUpperCase())}
|
|
84
66
|
>
|
|
85
67
|
{curItem.text}
|
|
86
68
|
</JumpLinksItem>
|
|
@@ -95,17 +77,9 @@ export const TableOfContents = ({ items }) => {
|
|
|
95
77
|
className="ws-toc-item"
|
|
96
78
|
onKeyDown={updateWidth}
|
|
97
79
|
onMouseDown={updateWidth}
|
|
98
|
-
onClick={() =>
|
|
99
|
-
trackEvent(
|
|
100
|
-
'jump_link_click',
|
|
101
|
-
'click_event',
|
|
102
|
-
item.id.toUpperCase()
|
|
103
|
-
)
|
|
104
|
-
}
|
|
80
|
+
onClick={() => trackEvent('jump_link_click', 'click_event', item.id.toUpperCase())}
|
|
105
81
|
>
|
|
106
|
-
{Array.isArray(nextItem)
|
|
107
|
-
? renderSublist(item, nextItem)
|
|
108
|
-
: item.text}
|
|
82
|
+
{Array.isArray(nextItem) ? renderSublist(item, nextItem) : item.text}
|
|
109
83
|
</JumpLinksItem>
|
|
110
84
|
);
|
|
111
85
|
}
|
|
@@ -117,7 +91,7 @@ export const TableOfContents = ({ items }) => {
|
|
|
117
91
|
<JumpLinks
|
|
118
92
|
label="Table of contents"
|
|
119
93
|
isVertical
|
|
120
|
-
scrollableSelector="
|
|
94
|
+
scrollableSelector="#ws-page-main"
|
|
121
95
|
className="ws-toc"
|
|
122
96
|
style={{ top: stickyNavHeight }}
|
|
123
97
|
offset={width > 1450 ? 108 + stickyNavHeight : 148 + stickyNavHeight}
|
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.9",
|
|
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.125",
|
|
17
17
|
"@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
|
|
18
18
|
"autoprefixer": "9.8.6",
|
|
19
19
|
"babel-loader": "^9.1.3",
|
|
@@ -80,5 +80,5 @@
|
|
|
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": "f0810efe5715e1e8a3a54960720bf5411939bfc9"
|
|
84
84
|
}
|