@patternfly/quickstarts 2.3.1 → 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/index.es.js +138 -119
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +138 -119
- package/dist/index.js.map +1 -1
- package/dist/quickstarts-base.css +24 -24
- package/dist/quickstarts-full.es.js +211 -192
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts.css +24 -24
- package/dist/quickstarts.min.css +1 -1
- package/dist/utils/quick-start-context.d.ts +1 -1
- package/package.json +1 -1
- package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +3 -2
- 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;
|
|
@@ -1325,118 +1325,6 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1325
1325
|
}), [getResource]);
|
|
1326
1326
|
};
|
|
1327
1327
|
|
|
1328
|
-
var AdmonitionType;
|
|
1329
|
-
(function (AdmonitionType) {
|
|
1330
|
-
AdmonitionType["TIP"] = "TIP";
|
|
1331
|
-
AdmonitionType["NOTE"] = "NOTE";
|
|
1332
|
-
AdmonitionType["IMPORTANT"] = "IMPORTANT";
|
|
1333
|
-
AdmonitionType["WARNING"] = "WARNING";
|
|
1334
|
-
AdmonitionType["CAUTION"] = "CAUTION";
|
|
1335
|
-
})(AdmonitionType || (AdmonitionType = {}));
|
|
1336
|
-
const admonitionToAlertVariantMap = {
|
|
1337
|
-
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
1338
|
-
[AdmonitionType.TIP]: { variant: 'default', customIcon: React__namespace.createElement(LightbulbIcon__default['default'], null) },
|
|
1339
|
-
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
1340
|
-
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: React__namespace.createElement(FireIcon__default['default'], null) },
|
|
1341
|
-
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
1342
|
-
};
|
|
1343
|
-
const useAdmonitionShowdownExtension = () => {
|
|
1344
|
-
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
1345
|
-
return React__namespace.useMemo(() => ({
|
|
1346
|
-
type: 'lang',
|
|
1347
|
-
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
1348
|
-
replace: (text, content, admonitionLabel, admonitionType, groupId) => {
|
|
1349
|
-
if (!content || !admonitionLabel || !admonitionType || !groupId) {
|
|
1350
|
-
return text;
|
|
1351
|
-
}
|
|
1352
|
-
admonitionType = admonitionType.toUpperCase();
|
|
1353
|
-
const { variant, customIcon } = admonitionToAlertVariantMap[admonitionType];
|
|
1354
|
-
const style = admonitionType === AdmonitionType.CAUTION ? { backgroundColor: '#ec7a0915' } : {};
|
|
1355
|
-
const pfAlert = (React__namespace.createElement(reactCore.Alert, { variant: variant, customIcon: customIcon && customIcon, isInline: true, title: admonitionType, className: "pfext-markdown-admonition", style: style }, content));
|
|
1356
|
-
return removeTemplateWhitespace(server.renderToStaticMarkup(pfAlert));
|
|
1357
|
-
},
|
|
1358
|
-
}), []);
|
|
1359
|
-
};
|
|
1360
|
-
|
|
1361
|
-
const useCodeShowdownExtension = () => {
|
|
1362
|
-
return React__namespace.useMemo(() => ({
|
|
1363
|
-
type: 'output',
|
|
1364
|
-
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
1365
|
-
replace: (text, content) => {
|
|
1366
|
-
if (!content) {
|
|
1367
|
-
return text;
|
|
1368
|
-
}
|
|
1369
|
-
const pfCodeBlock = React__namespace.createElement(reactCore.CodeBlock, null, content);
|
|
1370
|
-
return removeTemplateWhitespace(server.renderToStaticMarkup(pfCodeBlock));
|
|
1371
|
-
},
|
|
1372
|
-
}), []);
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
1376
|
-
const [isSrcValid, setIsSrcValid] = React__namespace.useState(true);
|
|
1377
|
-
if (src && isSrcValid) {
|
|
1378
|
-
return React__namespace.createElement("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
|
|
1379
|
-
}
|
|
1380
|
-
return React__namespace.createElement(React__namespace.Fragment, null, fallback);
|
|
1381
|
-
};
|
|
1382
|
-
|
|
1383
|
-
const DASH = '-';
|
|
1384
|
-
|
|
1385
|
-
const PopoverStatus = ({ hideHeader, children, isVisible = null, shouldClose = null, statusBody, title, onHide, onShow, }) => {
|
|
1386
|
-
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 },
|
|
1387
|
-
React__namespace.createElement(reactCore.Button, { variant: "link", isInline: true }, statusBody)));
|
|
1388
|
-
};
|
|
1389
|
-
|
|
1390
|
-
const StatusIconAndText = ({ icon, title, spin, iconOnly, noTooltip, className, }) => {
|
|
1391
|
-
if (!title) {
|
|
1392
|
-
return React__namespace.createElement(React__namespace.Fragment, null, DASH);
|
|
1393
|
-
}
|
|
1394
|
-
return (React__namespace.createElement("span", { className: reactStyles.css('pfext-icon-and-text', className), title: iconOnly && !noTooltip ? title : undefined },
|
|
1395
|
-
icon &&
|
|
1396
|
-
React__namespace.cloneElement(icon, {
|
|
1397
|
-
className: reactStyles.css(spin && 'fa-spin', icon.props.className, !iconOnly && 'pfext-icon-and-text__icon pfext-icon-flex-child'),
|
|
1398
|
-
}),
|
|
1399
|
-
!iconOnly && React__namespace.createElement(CamelCaseWrap, { value: title, dataTest: "status-text" })));
|
|
1400
|
-
};
|
|
1401
|
-
|
|
1402
|
-
const GenericStatus = (props) => {
|
|
1403
|
-
const { Icon, children, popoverTitle, title, noTooltip, iconOnly } = props, restProps = tslib.__rest(props, ["Icon", "children", "popoverTitle", "title", "noTooltip", "iconOnly"]);
|
|
1404
|
-
const renderIcon = iconOnly && !noTooltip ? React__namespace.createElement(Icon, { title: title }) : React__namespace.createElement(Icon, null);
|
|
1405
|
-
const statusBody = (React__namespace.createElement(StatusIconAndText, Object.assign({}, restProps, { noTooltip: noTooltip, title: title, iconOnly: iconOnly, icon: renderIcon })));
|
|
1406
|
-
return React__namespace.Children.toArray(children).length ? (React__namespace.createElement(PopoverStatus, Object.assign({ title: popoverTitle || title }, restProps, { statusBody: statusBody }), children)) : (statusBody);
|
|
1407
|
-
};
|
|
1408
|
-
|
|
1409
|
-
// import { global_warning_color_100 as warningColor } from '@patternfly/react-tokens/dist/js/global_warning_color_100';
|
|
1410
|
-
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 }));
|
|
1411
|
-
|
|
1412
|
-
// export const PendingStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1413
|
-
// <GenericStatus {...props} Icon={HourglassHalfIcon} title={props.title || 'Pending'} />
|
|
1414
|
-
// );
|
|
1415
|
-
// PendingStatus.displayName = 'PendingStatus';
|
|
1416
|
-
// export const ProgressStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1417
|
-
// <GenericStatus {...props} Icon={InProgressIcon} title={props.title || 'In progress'} />
|
|
1418
|
-
// );
|
|
1419
|
-
// ProgressStatus.displayName = 'ProgressStatus';
|
|
1420
|
-
const SuccessStatus = (props) => (React__namespace.createElement(GenericStatus, Object.assign({}, props, { Icon: GreenCheckCircleIcon, title: props.title || 'Healthy' })));
|
|
1421
|
-
SuccessStatus.displayName = 'SuccessStatus';
|
|
1422
|
-
// export const WarningStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1423
|
-
// <GenericStatus {...props} Icon={YellowExclamationTriangleIcon} title={props.title || 'Warning'} />
|
|
1424
|
-
// );
|
|
1425
|
-
// WarningStatus.displayName = 'WarningStatus';
|
|
1426
|
-
|
|
1427
|
-
const Status = ({ status, title, iconOnly, noTooltip, className, }) => {
|
|
1428
|
-
const statusProps = { title: title || status, iconOnly, noTooltip, className };
|
|
1429
|
-
switch (status) {
|
|
1430
|
-
case 'In Progress':
|
|
1431
|
-
return React__namespace.createElement(StatusIconAndText, Object.assign({}, statusProps, { icon: React__namespace.createElement(SyncAltIcon__default['default'], null) }));
|
|
1432
|
-
case 'Complete':
|
|
1433
|
-
return React__namespace.createElement(SuccessStatus, Object.assign({}, statusProps));
|
|
1434
|
-
default:
|
|
1435
|
-
return React__namespace.createElement(React__namespace.Fragment, null, status || DASH);
|
|
1436
|
-
}
|
|
1437
|
-
};
|
|
1438
|
-
const StatusIcon = ({ status }) => (React__namespace.createElement(Status, { status: status, iconOnly: true }));
|
|
1439
|
-
|
|
1440
1328
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
1441
1329
|
const DOMPurify = require('dompurify');
|
|
1442
1330
|
const markdownConvert = (markdown, extensions) => {
|
|
@@ -1645,6 +1533,119 @@ const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
|
1645
1533
|
markdown.renderExtension(docContext, rootSelector))), className: className }));
|
|
1646
1534
|
};
|
|
1647
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
|
+
|
|
1648
1649
|
const QuickStartTileDescription = ({ description, prerequisites, }) => {
|
|
1649
1650
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1650
1651
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
@@ -1748,9 +1749,14 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, })
|
|
|
1748
1749
|
// @ts-ignore
|
|
1749
1750
|
component: "div", style: {
|
|
1750
1751
|
cursor: 'pointer',
|
|
1751
|
-
}, 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
|
+
},
|
|
1752
1758
|
// https://github.com/patternfly/patternfly-react/issues/7039
|
|
1753
|
-
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 })));
|
|
1754
1760
|
};
|
|
1755
1761
|
|
|
1756
1762
|
const QuickStartCatalog = ({ quickStarts }) => {
|
|
@@ -1993,6 +1999,13 @@ const TaskIcon = ({ taskIndex, taskStatus }) => {
|
|
|
1993
1999
|
return React__namespace.createElement("span", { className: classNames }, content);
|
|
1994
2000
|
};
|
|
1995
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]);
|
|
1996
2009
|
const classNames = reactStyles.css('pfext-quick-start-task-header__title', {
|
|
1997
2010
|
'pfext-quick-start-task-header__title-success': taskStatus === exports.QuickStartTaskStatus.SUCCESS,
|
|
1998
2011
|
'pfext-quick-start-task-header__title-failed': taskStatus === (exports.QuickStartTaskStatus.FAILED || exports.QuickStartTaskStatus.VISITED),
|
|
@@ -2005,7 +2018,7 @@ const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, is
|
|
|
2005
2018
|
const tryAgain = failedReview && (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2006
2019
|
React__namespace.createElement("div", null),
|
|
2007
2020
|
React__namespace.createElement("div", { className: "pfext-quick-start-task-header__tryagain" }, "Try the steps again.")));
|
|
2008
|
-
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 },
|
|
2009
2022
|
React__namespace.createElement(TaskIcon, { taskIndex: taskIndex, taskStatus: taskStatus }),
|
|
2010
2023
|
React__namespace.createElement(reactCore.Title, { headingLevel: "h3", size: size, className: classNames },
|
|
2011
2024
|
React__namespace.createElement("span", { dangerouslySetInnerHTML: { __html: removeParagraphWrap(markdownConvert(title)) } }),
|
|
@@ -2212,6 +2225,7 @@ const useScrollTopOnTaskNumberChange = (node, taskNumber) => {
|
|
|
2212
2225
|
};
|
|
2213
2226
|
const QuickStartPanelContent = (_a) => {
|
|
2214
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);
|
|
2215
2229
|
const { getResource, activeQuickStartState } = React__namespace.useContext(QuickStartContext);
|
|
2216
2230
|
const [contentRef, setContentRef] = React__namespace.useState();
|
|
2217
2231
|
const shadows = useScrollShadows(contentRef);
|
|
@@ -2236,10 +2250,15 @@ const QuickStartPanelContent = (_a) => {
|
|
|
2236
2250
|
}
|
|
2237
2251
|
return Number.parseInt(taskNumber, 10) + 1;
|
|
2238
2252
|
};
|
|
2253
|
+
React__namespace.useEffect(() => {
|
|
2254
|
+
if (quickStart) {
|
|
2255
|
+
titleRef.current.focus();
|
|
2256
|
+
}
|
|
2257
|
+
}, [quickStart]);
|
|
2239
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),
|
|
2240
2259
|
React__namespace.createElement("div", { className: headerClasses },
|
|
2241
2260
|
React__namespace.createElement(reactCore.DrawerHead, null,
|
|
2242
|
-
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 },
|
|
2243
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 :
|
|
2244
2263
|
quickStart.spec.displayName,
|
|
2245
2264
|
' ',
|