@patternfly/documentation-framework 1.2.57 → 1.2.59
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 +16 -0
- package/components/example/exampleToolbar.js +23 -13
- package/helpers/copy.js +1 -17
- package/package.json +2 -2
- package/versions.json +19 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
## 1.2.59 (2022-11-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/documentation-framework
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.2.58 (2022-11-01)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @patternfly/documentation-framework
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## 1.2.57 (2022-11-01)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @patternfly/documentation-framework
|
|
@@ -57,19 +57,17 @@ export const ExampleToolbar = ({
|
|
|
57
57
|
const undoAllAriaLabel = `Undo all changes to ${exampleTitle}`;
|
|
58
58
|
|
|
59
59
|
const editorControlProps = {
|
|
60
|
-
maxWidth: 'var(--ws-code-editor--tooltip--MaxWidth)',
|
|
61
60
|
className: "ws-code-editor-control",
|
|
62
|
-
exitDelay: 300
|
|
63
61
|
};
|
|
64
62
|
|
|
63
|
+
const commonTooltipProps = {
|
|
64
|
+
exitDelay: 300,
|
|
65
|
+
maxWidth: 'var(--ws-code-editor--tooltip--MaxWidth)'
|
|
66
|
+
}
|
|
67
|
+
|
|
65
68
|
const copyCode = () => {
|
|
66
69
|
copy(code);
|
|
67
|
-
|
|
68
70
|
setCopied(true);
|
|
69
|
-
// Reset isCopied after Tooltip fades out
|
|
70
|
-
setTimeout(() => {
|
|
71
|
-
setCopied(false);
|
|
72
|
-
}, 2500);
|
|
73
71
|
};
|
|
74
72
|
|
|
75
73
|
const customControls = (
|
|
@@ -86,16 +84,19 @@ export const ExampleToolbar = ({
|
|
|
86
84
|
// 1 === expand code, 0 === collapse code
|
|
87
85
|
trackEvent('code_editor_control_click', 'click_event', 'TOGGLE_CODE', isEditorOpen ? 0 : 1);
|
|
88
86
|
}}
|
|
87
|
+
tooltipProps={{
|
|
88
|
+
content: languageLabel,
|
|
89
|
+
...commonTooltipProps
|
|
90
|
+
}}
|
|
89
91
|
aria-label={languageAriaLabel}
|
|
90
|
-
toolTipText={languageLabel}
|
|
91
92
|
aria-expanded={isEditorOpen}
|
|
92
93
|
{...editorControlProps}
|
|
93
94
|
/>
|
|
94
95
|
<Tooltip
|
|
95
|
-
trigger="mouseenter"
|
|
96
96
|
content={<div>{isCopied ? 'Code copied' : copyLabel}</div>}
|
|
97
|
-
{...(isCopied && {exitDelay: 1600})}
|
|
98
97
|
maxWidth={editorControlProps.maxWidth}
|
|
98
|
+
exitDelay={isCopied ? "300" : 1600}
|
|
99
|
+
onTooltipHidden={() => setCopied(false)}
|
|
99
100
|
>
|
|
100
101
|
<Button
|
|
101
102
|
onClick={() => {
|
|
@@ -144,7 +145,10 @@ export const ExampleToolbar = ({
|
|
|
144
145
|
target="_blank"
|
|
145
146
|
rel="noopener noreferrer"
|
|
146
147
|
aria-label={fullscreenAriaLabel}
|
|
147
|
-
|
|
148
|
+
tooltipProps={{
|
|
149
|
+
content: fullscreenLabel,
|
|
150
|
+
...commonTooltipProps
|
|
151
|
+
}}
|
|
148
152
|
onClick={() => {
|
|
149
153
|
trackEvent('code_editor_control_click', 'click_event', 'FULLSCREEN_LINK');
|
|
150
154
|
}}
|
|
@@ -159,7 +163,10 @@ export const ExampleToolbar = ({
|
|
|
159
163
|
</React.Fragment>
|
|
160
164
|
)}
|
|
161
165
|
aria-label={convertAriaLabel}
|
|
162
|
-
|
|
166
|
+
tooltipProps={{
|
|
167
|
+
content: convertLabel,
|
|
168
|
+
...commonTooltipProps
|
|
169
|
+
}}
|
|
163
170
|
onClick={() => {
|
|
164
171
|
setCode(convertToJSX(code).code);
|
|
165
172
|
trackEvent('code_editor_control_click', 'click_event', 'TS_TO_JS');
|
|
@@ -171,7 +178,10 @@ export const ExampleToolbar = ({
|
|
|
171
178
|
<CodeEditorControl
|
|
172
179
|
icon={<ReplyAllIcon />}
|
|
173
180
|
aria-label={undoAllAriaLabel}
|
|
174
|
-
|
|
181
|
+
tooltipProps={{
|
|
182
|
+
content: undoAllLabel,
|
|
183
|
+
...commonTooltipProps
|
|
184
|
+
}}
|
|
175
185
|
onClick={() => {
|
|
176
186
|
setCode(originalCode);
|
|
177
187
|
trackEvent('code_editor_control_click', 'click_event', 'RESET_CODE');
|
package/helpers/copy.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
1
|
export const copy = textToCopy => {
|
|
2
|
-
|
|
3
|
-
// Set value (string to be copied)
|
|
4
|
-
el.value = textToCopy;
|
|
5
|
-
// Set non-editable to avoid focus and move outside of view
|
|
6
|
-
el.setAttribute('readonly', '');
|
|
7
|
-
el.style = {
|
|
8
|
-
display: 'none',
|
|
9
|
-
position: 'absolute',
|
|
10
|
-
left: '-9999px'
|
|
11
|
-
};
|
|
12
|
-
document.body.appendChild(el);
|
|
13
|
-
// Select text inside element
|
|
14
|
-
el.select();
|
|
15
|
-
// Copy text to clipboard
|
|
16
|
-
document.execCommand('copy');
|
|
17
|
-
// Remove temporary element
|
|
18
|
-
document.body.removeChild(el);
|
|
2
|
+
navigator.clipboard.writeText(textToCopy);
|
|
19
3
|
};
|
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": "1.2.
|
|
4
|
+
"version": "1.2.59",
|
|
5
5
|
"author": "Red Hat",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"react": "^16.8.0 || ^17.0.0",
|
|
86
86
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "b3fd85bc93c5f3c2a86f91facc77d8f176fda8d4"
|
|
89
89
|
}
|
package/versions.json
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Releases": [
|
|
3
3
|
{
|
|
4
|
+
"name": "2022.14",
|
|
5
|
+
"date": "2022-11-01",
|
|
6
|
+
"latest": true,
|
|
7
|
+
"versions": {
|
|
8
|
+
"@patternfly/patternfly": "4.219.2",
|
|
9
|
+
"@patternfly/react-catalog-view-extension": "4.92.55",
|
|
10
|
+
"@patternfly/react-charts": "6.94.11",
|
|
11
|
+
"@patternfly/react-code-editor": "4.82.55",
|
|
12
|
+
"@patternfly/react-core": "4.258.3",
|
|
13
|
+
"@patternfly/react-icons": "4.92.10",
|
|
14
|
+
"@patternfly/react-inline-edit-extension": "4.86.56",
|
|
15
|
+
"@patternfly/react-log-viewer": "4.87.50",
|
|
16
|
+
"@patternfly/react-styles": "4.91.10",
|
|
17
|
+
"@patternfly/react-table": "4.111.33",
|
|
18
|
+
"@patternfly/react-tokens": "4.93.10",
|
|
19
|
+
"@patternfly/react-topology": "4.90.11",
|
|
20
|
+
"@patternfly/react-virtualized-extension": "4.88.55"
|
|
21
|
+
}
|
|
22
|
+
},{
|
|
4
23
|
"name": "2022.13",
|
|
5
24
|
"date": "2022-10-11",
|
|
6
|
-
"latest": true,
|
|
7
25
|
"versions": {
|
|
8
26
|
"@patternfly/patternfly": "4.217.1",
|
|
9
27
|
"@patternfly/react-catalog-view-extension": "4.92.26",
|