@patternfly/quickstarts 2.3.0 → 2.3.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/dist/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.d.ts +1 -1
- package/dist/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.d.ts +1 -1
- package/dist/index.es.js +151 -131
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +151 -131
- package/dist/index.js.map +1 -1
- package/dist/quickstarts-full.es.js +224 -204
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/utils/quick-start-context.d.ts +1 -1
- package/package.json +1 -1
- package/src/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.tsx +2 -2
- package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +3 -2
- package/src/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.tsx +5 -11
- package/src/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.tsx +5 -11
- package/src/QuickStartPanelContent.tsx +8 -1
- package/src/catalog/QuickStartTile.tsx +7 -0
- package/src/controller/QuickStartTaskHeader.tsx +8 -1
- package/src/utils/quick-start-context.tsx +2 -2
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ var server = require('react-dom/server');
|
|
|
13
13
|
var CopyIcon = require('@patternfly/react-icons/dist/js/icons/copy-icon');
|
|
14
14
|
var LightbulbIcon = require('@patternfly/react-icons/dist/js/icons/lightbulb-icon');
|
|
15
15
|
var FireIcon = require('@patternfly/react-icons/dist/js/icons/fire-icon');
|
|
16
|
+
var showdown = require('showdown');
|
|
16
17
|
var SyncAltIcon = require('@patternfly/react-icons/dist/js/icons/sync-alt-icon');
|
|
17
18
|
var CheckCircleIcon = require('@patternfly/react-icons/dist/js/icons/check-circle-icon');
|
|
18
19
|
var ExclamationCircleIcon = require('@patternfly/react-icons/dist/js/icons/exclamation-circle-icon');
|
|
@@ -20,7 +21,6 @@ var InfoCircleIcon = require('@patternfly/react-icons/dist/js/icons/info-circle-
|
|
|
20
21
|
require('@patternfly/react-tokens/dist/js/global_danger_color_100');
|
|
21
22
|
require('@patternfly/react-tokens/dist/js/global_palette_blue_300');
|
|
22
23
|
var global_palette_green_500 = require('@patternfly/react-tokens/dist/js/global_palette_green_500');
|
|
23
|
-
var showdown = require('showdown');
|
|
24
24
|
var ExternalLinkAltIcon = require('@patternfly/react-icons/dist/js/icons/external-link-alt-icon');
|
|
25
25
|
var OutlinedClockIcon = require('@patternfly/react-icons/dist/js/icons/outlined-clock-icon');
|
|
26
26
|
var ArrowRightIcon = require('@patternfly/react-icons/dist/js/icons/arrow-right-icon');
|
|
@@ -614,7 +614,7 @@ const QuickStartContextDefaults = {
|
|
|
614
614
|
activeQuickStartState: {},
|
|
615
615
|
setAllQuickStarts: () => { },
|
|
616
616
|
resourceBundle: en,
|
|
617
|
-
getResource: () =>
|
|
617
|
+
getResource: (resource) => resource,
|
|
618
618
|
language: 'en',
|
|
619
619
|
useQueryParams: true,
|
|
620
620
|
filter: {
|
|
@@ -640,7 +640,7 @@ const getResource = (resource, options, resourceBundle, lng) => {
|
|
|
640
640
|
return resourceBundle[`${resource}_${suffix}`];
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
|
-
return (resourceBundle && resourceBundle[resource]) ||
|
|
643
|
+
return (resourceBundle && resourceBundle[resource]) || resource;
|
|
644
644
|
};
|
|
645
645
|
const useValuesForQuickStartContext = (value = {}) => {
|
|
646
646
|
var _a, _b;
|
|
@@ -1243,12 +1243,13 @@ const CopyClipboard = ({ element, rootSelector, docContext, }) => {
|
|
|
1243
1243
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1244
1244
|
const [showSuccessContent, setShowSuccessContent] = React__namespace.useState(false);
|
|
1245
1245
|
const textToCopy = React__namespace.useMemo(() => {
|
|
1246
|
+
var _a;
|
|
1246
1247
|
const copyTextId = element.getAttribute(MARKDOWN_COPY_BUTTON_ID);
|
|
1247
|
-
return docContext.querySelector(`${rootSelector} [${MARKDOWN_SNIPPET_ID}="${copyTextId}"]`).innerText;
|
|
1248
|
+
return (_a = docContext.querySelector(`${rootSelector} [${MARKDOWN_SNIPPET_ID}="${copyTextId}"]`)) === null || _a === void 0 ? void 0 : _a.innerText;
|
|
1248
1249
|
}, [element, docContext, rootSelector]);
|
|
1249
1250
|
useEventListener(element, 'click', React__namespace.useCallback(() => {
|
|
1250
1251
|
navigator.clipboard
|
|
1251
|
-
.writeText(textToCopy)
|
|
1252
|
+
.writeText(textToCopy.trim())
|
|
1252
1253
|
.then(() => {
|
|
1253
1254
|
setShowSuccessContent(true);
|
|
1254
1255
|
})
|
|
@@ -1275,16 +1276,16 @@ const useInlineCopyClipboardShowdownExtension = () => {
|
|
|
1275
1276
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1276
1277
|
return React__namespace.useMemo(() => ({
|
|
1277
1278
|
type: 'lang',
|
|
1278
|
-
regex:
|
|
1279
|
-
replace: (text, group,
|
|
1280
|
-
if (!group ||
|
|
1279
|
+
regex: /`([^`](.*?)[^`])`{{copy}}/g,
|
|
1280
|
+
replace: (text, group, _, groupId) => {
|
|
1281
|
+
if (!group || isNaN(groupId)) {
|
|
1281
1282
|
return text;
|
|
1282
1283
|
}
|
|
1283
1284
|
return removeTemplateWhitespace(`<span class="pf-c-clipboard-copy pf-m-inline">
|
|
1284
|
-
<span class="pf-c-clipboard-copy__text" ${MARKDOWN_SNIPPET_ID}="${
|
|
1285
|
+
<span class="pf-c-clipboard-copy__text" ${MARKDOWN_SNIPPET_ID}="${groupId}">${group}</span>
|
|
1285
1286
|
<span class="pf-c-clipboard-copy__actions">
|
|
1286
1287
|
<span class="pf-c-clipboard-copy__actions-item">
|
|
1287
|
-
<button class="pf-c-button pf-m-plain" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${
|
|
1288
|
+
<button class="pf-c-button pf-m-plain" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${groupId}">
|
|
1288
1289
|
${server.renderToStaticMarkup(React__namespace.createElement(CopyIcon__default['default'], null))}
|
|
1289
1290
|
</button>
|
|
1290
1291
|
</span>
|
|
@@ -1298,16 +1299,16 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1298
1299
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1299
1300
|
return React__namespace.useMemo(() => ({
|
|
1300
1301
|
type: 'lang',
|
|
1301
|
-
regex: /```[\n]((
|
|
1302
|
-
replace: (text, group,
|
|
1303
|
-
if (!group ||
|
|
1302
|
+
regex: /```[\n]\s*((((?!```).)*?\n)+)\s*```{{copy}}/g,
|
|
1303
|
+
replace: (text, group, _1, _2, groupId) => {
|
|
1304
|
+
if (!group || isNaN(groupId)) {
|
|
1304
1305
|
return text;
|
|
1305
1306
|
}
|
|
1306
1307
|
return `<div class="pf-c-code-block">
|
|
1307
1308
|
<div class="pf-c-code-block__header">
|
|
1308
1309
|
<div class="pf-c-code-block__actions">
|
|
1309
1310
|
<div class="pf-c-code-block__actions-item">
|
|
1310
|
-
<button class="pf-c-button pf-m-plain" type="button" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${
|
|
1311
|
+
<button class="pf-c-button pf-m-plain" type="button" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${groupId}">
|
|
1311
1312
|
${server.renderToStaticMarkup(React__namespace.createElement(CopyIcon__default['default'], null))}
|
|
1312
1313
|
</button>
|
|
1313
1314
|
</div>
|
|
@@ -1316,7 +1317,7 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1316
1317
|
<div class="pf-c-code-block__content">
|
|
1317
1318
|
<pre class="pf-c-code-block__pre pfext-code-block__pre">
|
|
1318
1319
|
<code class="pf-c-code-block__code"
|
|
1319
|
-
${MARKDOWN_SNIPPET_ID}="${
|
|
1320
|
+
${MARKDOWN_SNIPPET_ID}="${groupId}">${group.trim()}</code>
|
|
1320
1321
|
</pre>
|
|
1321
1322
|
</div>
|
|
1322
1323
|
</div>`;
|
|
@@ -1324,118 +1325,6 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1324
1325
|
}), [getResource]);
|
|
1325
1326
|
};
|
|
1326
1327
|
|
|
1327
|
-
var AdmonitionType;
|
|
1328
|
-
(function (AdmonitionType) {
|
|
1329
|
-
AdmonitionType["TIP"] = "TIP";
|
|
1330
|
-
AdmonitionType["NOTE"] = "NOTE";
|
|
1331
|
-
AdmonitionType["IMPORTANT"] = "IMPORTANT";
|
|
1332
|
-
AdmonitionType["WARNING"] = "WARNING";
|
|
1333
|
-
AdmonitionType["CAUTION"] = "CAUTION";
|
|
1334
|
-
})(AdmonitionType || (AdmonitionType = {}));
|
|
1335
|
-
const admonitionToAlertVariantMap = {
|
|
1336
|
-
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
1337
|
-
[AdmonitionType.TIP]: { variant: 'default', customIcon: React__namespace.createElement(LightbulbIcon__default['default'], null) },
|
|
1338
|
-
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
1339
|
-
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: React__namespace.createElement(FireIcon__default['default'], null) },
|
|
1340
|
-
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
1341
|
-
};
|
|
1342
|
-
const useAdmonitionShowdownExtension = () => {
|
|
1343
|
-
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
1344
|
-
return React__namespace.useMemo(() => ({
|
|
1345
|
-
type: 'lang',
|
|
1346
|
-
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
1347
|
-
replace: (text, content, admonitionLabel, admonitionType, groupId) => {
|
|
1348
|
-
if (!content || !admonitionLabel || !admonitionType || !groupId) {
|
|
1349
|
-
return text;
|
|
1350
|
-
}
|
|
1351
|
-
admonitionType = admonitionType.toUpperCase();
|
|
1352
|
-
const { variant, customIcon } = admonitionToAlertVariantMap[admonitionType];
|
|
1353
|
-
const style = admonitionType === AdmonitionType.CAUTION ? { backgroundColor: '#ec7a0915' } : {};
|
|
1354
|
-
const pfAlert = (React__namespace.createElement(reactCore.Alert, { variant: variant, customIcon: customIcon && customIcon, isInline: true, title: admonitionType, className: "pfext-markdown-admonition", style: style }, content));
|
|
1355
|
-
return removeTemplateWhitespace(server.renderToStaticMarkup(pfAlert));
|
|
1356
|
-
},
|
|
1357
|
-
}), []);
|
|
1358
|
-
};
|
|
1359
|
-
|
|
1360
|
-
const useCodeShowdownExtension = () => {
|
|
1361
|
-
return React__namespace.useMemo(() => ({
|
|
1362
|
-
type: 'output',
|
|
1363
|
-
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
1364
|
-
replace: (text, content) => {
|
|
1365
|
-
if (!content) {
|
|
1366
|
-
return text;
|
|
1367
|
-
}
|
|
1368
|
-
const pfCodeBlock = React__namespace.createElement(reactCore.CodeBlock, null, content);
|
|
1369
|
-
return removeTemplateWhitespace(server.renderToStaticMarkup(pfCodeBlock));
|
|
1370
|
-
},
|
|
1371
|
-
}), []);
|
|
1372
|
-
};
|
|
1373
|
-
|
|
1374
|
-
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
1375
|
-
const [isSrcValid, setIsSrcValid] = React__namespace.useState(true);
|
|
1376
|
-
if (src && isSrcValid) {
|
|
1377
|
-
return React__namespace.createElement("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
|
|
1378
|
-
}
|
|
1379
|
-
return React__namespace.createElement(React__namespace.Fragment, null, fallback);
|
|
1380
|
-
};
|
|
1381
|
-
|
|
1382
|
-
const DASH = '-';
|
|
1383
|
-
|
|
1384
|
-
const PopoverStatus = ({ hideHeader, children, isVisible = null, shouldClose = null, statusBody, title, onHide, onShow, }) => {
|
|
1385
|
-
return (React__namespace.createElement(reactCore.Popover, { position: reactCore.PopoverPosition.right, headerContent: hideHeader ? null : title, bodyContent: children, "aria-label": title, onHide: onHide, onShow: onShow, isVisible: isVisible, shouldClose: shouldClose },
|
|
1386
|
-
React__namespace.createElement(reactCore.Button, { variant: "link", isInline: true }, statusBody)));
|
|
1387
|
-
};
|
|
1388
|
-
|
|
1389
|
-
const StatusIconAndText = ({ icon, title, spin, iconOnly, noTooltip, className, }) => {
|
|
1390
|
-
if (!title) {
|
|
1391
|
-
return React__namespace.createElement(React__namespace.Fragment, null, DASH);
|
|
1392
|
-
}
|
|
1393
|
-
return (React__namespace.createElement("span", { className: reactStyles.css('pfext-icon-and-text', className), title: iconOnly && !noTooltip ? title : undefined },
|
|
1394
|
-
icon &&
|
|
1395
|
-
React__namespace.cloneElement(icon, {
|
|
1396
|
-
className: reactStyles.css(spin && 'fa-spin', icon.props.className, !iconOnly && 'pfext-icon-and-text__icon pfext-icon-flex-child'),
|
|
1397
|
-
}),
|
|
1398
|
-
!iconOnly && React__namespace.createElement(CamelCaseWrap, { value: title, dataTest: "status-text" })));
|
|
1399
|
-
};
|
|
1400
|
-
|
|
1401
|
-
const GenericStatus = (props) => {
|
|
1402
|
-
const { Icon, children, popoverTitle, title, noTooltip, iconOnly } = props, restProps = tslib.__rest(props, ["Icon", "children", "popoverTitle", "title", "noTooltip", "iconOnly"]);
|
|
1403
|
-
const renderIcon = iconOnly && !noTooltip ? React__namespace.createElement(Icon, { title: title }) : React__namespace.createElement(Icon, null);
|
|
1404
|
-
const statusBody = (React__namespace.createElement(StatusIconAndText, Object.assign({}, restProps, { noTooltip: noTooltip, title: title, iconOnly: iconOnly, icon: renderIcon })));
|
|
1405
|
-
return React__namespace.Children.toArray(children).length ? (React__namespace.createElement(PopoverStatus, Object.assign({ title: popoverTitle || title }, restProps, { statusBody: statusBody }), children)) : (statusBody);
|
|
1406
|
-
};
|
|
1407
|
-
|
|
1408
|
-
// import { global_warning_color_100 as warningColor } from '@patternfly/react-tokens/dist/js/global_warning_color_100';
|
|
1409
|
-
const GreenCheckCircleIcon = ({ className, title, size }) => (React__namespace.createElement(CheckCircleIcon__default['default'], { "data-test": "success-icon", size: size, color: global_palette_green_500.global_palette_green_500.value, className: className, title: title }));
|
|
1410
|
-
|
|
1411
|
-
// export const PendingStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1412
|
-
// <GenericStatus {...props} Icon={HourglassHalfIcon} title={props.title || 'Pending'} />
|
|
1413
|
-
// );
|
|
1414
|
-
// PendingStatus.displayName = 'PendingStatus';
|
|
1415
|
-
// export const ProgressStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1416
|
-
// <GenericStatus {...props} Icon={InProgressIcon} title={props.title || 'In progress'} />
|
|
1417
|
-
// );
|
|
1418
|
-
// ProgressStatus.displayName = 'ProgressStatus';
|
|
1419
|
-
const SuccessStatus = (props) => (React__namespace.createElement(GenericStatus, Object.assign({}, props, { Icon: GreenCheckCircleIcon, title: props.title || 'Healthy' })));
|
|
1420
|
-
SuccessStatus.displayName = 'SuccessStatus';
|
|
1421
|
-
// export const WarningStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1422
|
-
// <GenericStatus {...props} Icon={YellowExclamationTriangleIcon} title={props.title || 'Warning'} />
|
|
1423
|
-
// );
|
|
1424
|
-
// WarningStatus.displayName = 'WarningStatus';
|
|
1425
|
-
|
|
1426
|
-
const Status = ({ status, title, iconOnly, noTooltip, className, }) => {
|
|
1427
|
-
const statusProps = { title: title || status, iconOnly, noTooltip, className };
|
|
1428
|
-
switch (status) {
|
|
1429
|
-
case 'In Progress':
|
|
1430
|
-
return React__namespace.createElement(StatusIconAndText, Object.assign({}, statusProps, { icon: React__namespace.createElement(SyncAltIcon__default['default'], null) }));
|
|
1431
|
-
case 'Complete':
|
|
1432
|
-
return React__namespace.createElement(SuccessStatus, Object.assign({}, statusProps));
|
|
1433
|
-
default:
|
|
1434
|
-
return React__namespace.createElement(React__namespace.Fragment, null, status || DASH);
|
|
1435
|
-
}
|
|
1436
|
-
};
|
|
1437
|
-
const StatusIcon = ({ status }) => (React__namespace.createElement(Status, { status: status, iconOnly: true }));
|
|
1438
|
-
|
|
1439
1328
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
1440
1329
|
const DOMPurify = require('dompurify');
|
|
1441
1330
|
const markdownConvert = (markdown, extensions) => {
|
|
@@ -1644,6 +1533,119 @@ const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
|
1644
1533
|
markdown.renderExtension(docContext, rootSelector))), className: className }));
|
|
1645
1534
|
};
|
|
1646
1535
|
|
|
1536
|
+
var AdmonitionType;
|
|
1537
|
+
(function (AdmonitionType) {
|
|
1538
|
+
AdmonitionType["TIP"] = "TIP";
|
|
1539
|
+
AdmonitionType["NOTE"] = "NOTE";
|
|
1540
|
+
AdmonitionType["IMPORTANT"] = "IMPORTANT";
|
|
1541
|
+
AdmonitionType["WARNING"] = "WARNING";
|
|
1542
|
+
AdmonitionType["CAUTION"] = "CAUTION";
|
|
1543
|
+
})(AdmonitionType || (AdmonitionType = {}));
|
|
1544
|
+
const admonitionToAlertVariantMap = {
|
|
1545
|
+
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
1546
|
+
[AdmonitionType.TIP]: { variant: 'default', customIcon: React__namespace.createElement(LightbulbIcon__default['default'], null) },
|
|
1547
|
+
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
1548
|
+
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: React__namespace.createElement(FireIcon__default['default'], null) },
|
|
1549
|
+
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
1550
|
+
};
|
|
1551
|
+
const useAdmonitionShowdownExtension = () => {
|
|
1552
|
+
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
1553
|
+
return React__namespace.useMemo(() => ({
|
|
1554
|
+
type: 'lang',
|
|
1555
|
+
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
1556
|
+
replace: (text, content, admonitionLabel, admonitionType, groupId) => {
|
|
1557
|
+
if (!content || !admonitionLabel || !admonitionType || !groupId) {
|
|
1558
|
+
return text;
|
|
1559
|
+
}
|
|
1560
|
+
admonitionType = admonitionType.toUpperCase();
|
|
1561
|
+
const { variant, customIcon } = admonitionToAlertVariantMap[admonitionType];
|
|
1562
|
+
const style = admonitionType === AdmonitionType.CAUTION ? { backgroundColor: '#ec7a0915' } : {};
|
|
1563
|
+
const mdContent = React__namespace.createElement(QuickStartMarkdownView, { content: content });
|
|
1564
|
+
const pfAlert = (React__namespace.createElement(reactCore.Alert, { variant: variant, customIcon: customIcon && customIcon, isInline: true, title: admonitionType, className: "pfext-markdown-admonition", style: style }, mdContent));
|
|
1565
|
+
return removeTemplateWhitespace(server.renderToStaticMarkup(pfAlert));
|
|
1566
|
+
},
|
|
1567
|
+
}), []);
|
|
1568
|
+
};
|
|
1569
|
+
|
|
1570
|
+
const useCodeShowdownExtension = () => {
|
|
1571
|
+
return React__namespace.useMemo(() => ({
|
|
1572
|
+
type: 'output',
|
|
1573
|
+
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
1574
|
+
replace: (text, content) => {
|
|
1575
|
+
if (!content) {
|
|
1576
|
+
return text;
|
|
1577
|
+
}
|
|
1578
|
+
const pfCodeBlock = React__namespace.createElement(reactCore.CodeBlock, null, content);
|
|
1579
|
+
return removeTemplateWhitespace(server.renderToStaticMarkup(pfCodeBlock));
|
|
1580
|
+
},
|
|
1581
|
+
}), []);
|
|
1582
|
+
};
|
|
1583
|
+
|
|
1584
|
+
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
1585
|
+
const [isSrcValid, setIsSrcValid] = React__namespace.useState(true);
|
|
1586
|
+
if (src && isSrcValid) {
|
|
1587
|
+
return React__namespace.createElement("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
|
|
1588
|
+
}
|
|
1589
|
+
return React__namespace.createElement(React__namespace.Fragment, null, fallback);
|
|
1590
|
+
};
|
|
1591
|
+
|
|
1592
|
+
const DASH = '-';
|
|
1593
|
+
|
|
1594
|
+
const PopoverStatus = ({ hideHeader, children, isVisible = null, shouldClose = null, statusBody, title, onHide, onShow, }) => {
|
|
1595
|
+
return (React__namespace.createElement(reactCore.Popover, { position: reactCore.PopoverPosition.right, headerContent: hideHeader ? null : title, bodyContent: children, "aria-label": title, onHide: onHide, onShow: onShow, isVisible: isVisible, shouldClose: shouldClose },
|
|
1596
|
+
React__namespace.createElement(reactCore.Button, { variant: "link", isInline: true }, statusBody)));
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
const StatusIconAndText = ({ icon, title, spin, iconOnly, noTooltip, className, }) => {
|
|
1600
|
+
if (!title) {
|
|
1601
|
+
return React__namespace.createElement(React__namespace.Fragment, null, DASH);
|
|
1602
|
+
}
|
|
1603
|
+
return (React__namespace.createElement("span", { className: reactStyles.css('pfext-icon-and-text', className), title: iconOnly && !noTooltip ? title : undefined },
|
|
1604
|
+
icon &&
|
|
1605
|
+
React__namespace.cloneElement(icon, {
|
|
1606
|
+
className: reactStyles.css(spin && 'fa-spin', icon.props.className, !iconOnly && 'pfext-icon-and-text__icon pfext-icon-flex-child'),
|
|
1607
|
+
}),
|
|
1608
|
+
!iconOnly && React__namespace.createElement(CamelCaseWrap, { value: title, dataTest: "status-text" })));
|
|
1609
|
+
};
|
|
1610
|
+
|
|
1611
|
+
const GenericStatus = (props) => {
|
|
1612
|
+
const { Icon, children, popoverTitle, title, noTooltip, iconOnly } = props, restProps = tslib.__rest(props, ["Icon", "children", "popoverTitle", "title", "noTooltip", "iconOnly"]);
|
|
1613
|
+
const renderIcon = iconOnly && !noTooltip ? React__namespace.createElement(Icon, { title: title }) : React__namespace.createElement(Icon, null);
|
|
1614
|
+
const statusBody = (React__namespace.createElement(StatusIconAndText, Object.assign({}, restProps, { noTooltip: noTooltip, title: title, iconOnly: iconOnly, icon: renderIcon })));
|
|
1615
|
+
return React__namespace.Children.toArray(children).length ? (React__namespace.createElement(PopoverStatus, Object.assign({ title: popoverTitle || title }, restProps, { statusBody: statusBody }), children)) : (statusBody);
|
|
1616
|
+
};
|
|
1617
|
+
|
|
1618
|
+
// import { global_warning_color_100 as warningColor } from '@patternfly/react-tokens/dist/js/global_warning_color_100';
|
|
1619
|
+
const GreenCheckCircleIcon = ({ className, title, size }) => (React__namespace.createElement(CheckCircleIcon__default['default'], { "data-test": "success-icon", size: size, color: global_palette_green_500.global_palette_green_500.value, className: className, title: title }));
|
|
1620
|
+
|
|
1621
|
+
// export const PendingStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1622
|
+
// <GenericStatus {...props} Icon={HourglassHalfIcon} title={props.title || 'Pending'} />
|
|
1623
|
+
// );
|
|
1624
|
+
// PendingStatus.displayName = 'PendingStatus';
|
|
1625
|
+
// export const ProgressStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1626
|
+
// <GenericStatus {...props} Icon={InProgressIcon} title={props.title || 'In progress'} />
|
|
1627
|
+
// );
|
|
1628
|
+
// ProgressStatus.displayName = 'ProgressStatus';
|
|
1629
|
+
const SuccessStatus = (props) => (React__namespace.createElement(GenericStatus, Object.assign({}, props, { Icon: GreenCheckCircleIcon, title: props.title || 'Healthy' })));
|
|
1630
|
+
SuccessStatus.displayName = 'SuccessStatus';
|
|
1631
|
+
// export const WarningStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1632
|
+
// <GenericStatus {...props} Icon={YellowExclamationTriangleIcon} title={props.title || 'Warning'} />
|
|
1633
|
+
// );
|
|
1634
|
+
// WarningStatus.displayName = 'WarningStatus';
|
|
1635
|
+
|
|
1636
|
+
const Status = ({ status, title, iconOnly, noTooltip, className, }) => {
|
|
1637
|
+
const statusProps = { title: title || status, iconOnly, noTooltip, className };
|
|
1638
|
+
switch (status) {
|
|
1639
|
+
case 'In Progress':
|
|
1640
|
+
return React__namespace.createElement(StatusIconAndText, Object.assign({}, statusProps, { icon: React__namespace.createElement(SyncAltIcon__default['default'], null) }));
|
|
1641
|
+
case 'Complete':
|
|
1642
|
+
return React__namespace.createElement(SuccessStatus, Object.assign({}, statusProps));
|
|
1643
|
+
default:
|
|
1644
|
+
return React__namespace.createElement(React__namespace.Fragment, null, status || DASH);
|
|
1645
|
+
}
|
|
1646
|
+
};
|
|
1647
|
+
const StatusIcon = ({ status }) => (React__namespace.createElement(Status, { status: status, iconOnly: true }));
|
|
1648
|
+
|
|
1647
1649
|
const QuickStartTileDescription = ({ description, prerequisites, }) => {
|
|
1648
1650
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1649
1651
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
@@ -1747,9 +1749,14 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, })
|
|
|
1747
1749
|
// @ts-ignore
|
|
1748
1750
|
component: "div", style: {
|
|
1749
1751
|
cursor: 'pointer',
|
|
1750
|
-
}, icon: quickStartIcon, className: "pfext-quick-start-tile", "data-testid": `qs-card-${camelize(displayName)}`, featured: isActive, title: React__namespace.createElement(QuickStartTileHeader, { name: displayName, status: status, duration: durationMinutes, type: type, quickStartId: id }), onClick: handleClick,
|
|
1752
|
+
}, icon: quickStartIcon, className: "pfext-quick-start-tile", "data-testid": `qs-card-${camelize(displayName)}`, featured: isActive, title: React__namespace.createElement(QuickStartTileHeader, { name: displayName, status: status, duration: durationMinutes, type: type, quickStartId: id }), onClick: handleClick, onKeyDown: (event) => {
|
|
1753
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
1754
|
+
setActiveQuickStart(id, tasks === null || tasks === void 0 ? void 0 : tasks.length);
|
|
1755
|
+
onClick();
|
|
1756
|
+
}
|
|
1757
|
+
},
|
|
1751
1758
|
// https://github.com/patternfly/patternfly-react/issues/7039
|
|
1752
|
-
href: "#", "data-test": `tile ${id}`, description: React__namespace.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }), footer: footerComponent })));
|
|
1759
|
+
href: "#", "data-test": `tile ${id}`, description: React__namespace.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }), footer: footerComponent, tabIndex: 0 })));
|
|
1753
1760
|
};
|
|
1754
1761
|
|
|
1755
1762
|
const QuickStartCatalog = ({ quickStarts }) => {
|
|
@@ -1992,6 +1999,13 @@ const TaskIcon = ({ taskIndex, taskStatus }) => {
|
|
|
1992
1999
|
return React__namespace.createElement("span", { className: classNames }, content);
|
|
1993
2000
|
};
|
|
1994
2001
|
const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, isActiveTask, onTaskSelect, children, }) => {
|
|
2002
|
+
const titleRef = React__namespace.useRef(null);
|
|
2003
|
+
React__namespace.useEffect(() => {
|
|
2004
|
+
if (isActiveTask) {
|
|
2005
|
+
// Focus the WizardNavItem button element that contains the title
|
|
2006
|
+
titleRef.current.parentNode.focus();
|
|
2007
|
+
}
|
|
2008
|
+
}, [isActiveTask]);
|
|
1995
2009
|
const classNames = reactStyles.css('pfext-quick-start-task-header__title', {
|
|
1996
2010
|
'pfext-quick-start-task-header__title-success': taskStatus === exports.QuickStartTaskStatus.SUCCESS,
|
|
1997
2011
|
'pfext-quick-start-task-header__title-failed': taskStatus === (exports.QuickStartTaskStatus.FAILED || exports.QuickStartTaskStatus.VISITED),
|
|
@@ -2004,7 +2018,7 @@ const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, is
|
|
|
2004
2018
|
const tryAgain = failedReview && (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2005
2019
|
React__namespace.createElement("div", null),
|
|
2006
2020
|
React__namespace.createElement("div", { className: "pfext-quick-start-task-header__tryagain" }, "Try the steps again.")));
|
|
2007
|
-
const content = (React__namespace.createElement("div", { className: "pfext-quick-start-task-header" },
|
|
2021
|
+
const content = (React__namespace.createElement("div", { className: "pfext-quick-start-task-header", ref: titleRef },
|
|
2008
2022
|
React__namespace.createElement(TaskIcon, { taskIndex: taskIndex, taskStatus: taskStatus }),
|
|
2009
2023
|
React__namespace.createElement(reactCore.Title, { headingLevel: "h3", size: size, className: classNames },
|
|
2010
2024
|
React__namespace.createElement("span", { dangerouslySetInnerHTML: { __html: removeParagraphWrap(markdownConvert(title)) } }),
|
|
@@ -2211,6 +2225,7 @@ const useScrollTopOnTaskNumberChange = (node, taskNumber) => {
|
|
|
2211
2225
|
};
|
|
2212
2226
|
const QuickStartPanelContent = (_a) => {
|
|
2213
2227
|
var { quickStarts = [], handleClose, activeQuickStartID, appendTo, isResizable = true, showClose = true, headerVariant = '' } = _a, props = tslib.__rest(_a, ["quickStarts", "handleClose", "activeQuickStartID", "appendTo", "isResizable", "showClose", "headerVariant"]);
|
|
2228
|
+
const titleRef = React__namespace.useRef(null);
|
|
2214
2229
|
const { getResource, activeQuickStartState } = React__namespace.useContext(QuickStartContext);
|
|
2215
2230
|
const [contentRef, setContentRef] = React__namespace.useState();
|
|
2216
2231
|
const shadows = useScrollShadows(contentRef);
|
|
@@ -2235,10 +2250,15 @@ const QuickStartPanelContent = (_a) => {
|
|
|
2235
2250
|
}
|
|
2236
2251
|
return Number.parseInt(taskNumber, 10) + 1;
|
|
2237
2252
|
};
|
|
2253
|
+
React__namespace.useEffect(() => {
|
|
2254
|
+
if (quickStart) {
|
|
2255
|
+
titleRef.current.focus();
|
|
2256
|
+
}
|
|
2257
|
+
}, [quickStart]);
|
|
2238
2258
|
const content = quickStart ? (React__namespace.createElement(reactCore.DrawerPanelContent, Object.assign({ isResizable: isResizable, className: "pfext-quick-start__base", "data-testid": `qs-drawer-${camelize(quickStart.spec.displayName)}`, "data-qs": `qs-step-${getStep()}`, "data-test": "quickstart drawer" }, props),
|
|
2239
2259
|
React__namespace.createElement("div", { className: headerClasses },
|
|
2240
2260
|
React__namespace.createElement(reactCore.DrawerHead, null,
|
|
2241
|
-
React__namespace.createElement("div", { className: "pfext-quick-start-panel-content__title" },
|
|
2261
|
+
React__namespace.createElement("div", { className: "pfext-quick-start-panel-content__title", tabIndex: -1, ref: titleRef },
|
|
2242
2262
|
React__namespace.createElement(reactCore.Title, { headingLevel: "h1", size: "xl", className: "pfext-quick-start-panel-content__name", style: { marginRight: 'var(--pf-global--spacer--md)' } }, quickStart === null || quickStart === void 0 ? void 0 :
|
|
2243
2263
|
quickStart.spec.displayName,
|
|
2244
2264
|
' ',
|