@patternfly/quickstarts 6.3.0-prerelease.5 → 6.3.0-prerelease.7
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/accordion-extension.d.ts +1 -1
- package/dist/ConsoleShared/src/components/markdown-extensions/admonition-extension.d.ts +1 -1
- package/dist/index.es.js +226 -133
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +226 -133
- package/dist/index.js.map +1 -1
- package/dist/quickstarts-base.css +4 -4
- package/dist/quickstarts-full.es.js +274 -181
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts.css +4 -4
- package/dist/quickstarts.min.css +1 -1
- package/package.json +2 -2
- package/src/ConsoleInternal/components/markdown-view.tsx +92 -4
- package/src/ConsoleShared/src/components/markdown-extensions/__tests__/accordion-extension.spec.tsx +105 -0
- package/src/ConsoleShared/src/components/markdown-extensions/__tests__/admonition-extension.spec.tsx +121 -0
- package/src/ConsoleShared/src/components/markdown-extensions/accordion-extension.tsx +20 -13
- package/src/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.tsx +19 -5
- package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +17 -6
- package/src/QuickStartDrawerContent.tsx +3 -1
- package/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +1 -4
- package/src/controller/QuickStartIntroduction.tsx +1 -1
|
@@ -163,6 +163,10 @@
|
|
|
163
163
|
border: var(--pf-v6-c-card--BorderColor) var(--pf-v6-c-card--BorderStyle) var(--pf-v6-c-card--BorderWidth);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
.pfext-quick-start-footer {
|
|
167
|
+
padding-top: var(--pf-t--global--spacer--md);
|
|
168
|
+
}
|
|
169
|
+
|
|
166
170
|
.pfext-quick-start-task {
|
|
167
171
|
flex: 1 1 0;
|
|
168
172
|
overflow: auto;
|
|
@@ -174,10 +178,6 @@
|
|
|
174
178
|
height: initial;
|
|
175
179
|
}
|
|
176
180
|
|
|
177
|
-
.pfext-quick-start-footer {
|
|
178
|
-
padding-top: var(--pf-t--global--spacer--md);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
181
|
.pfext-quick-start-task-header button.pf-v6-c-wizard__nav-link {
|
|
182
182
|
margin-bottom: var(--pf-t--global--spacer--md);
|
|
183
183
|
}
|
|
@@ -30007,6 +30007,203 @@ marked.parseInline;
|
|
|
30007
30007
|
_Parser.parse;
|
|
30008
30008
|
_Lexer.lex;
|
|
30009
30009
|
|
|
30010
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30011
|
+
const DOMPurify$2 = require('dompurify');
|
|
30012
|
+
var AdmonitionType;
|
|
30013
|
+
(function (AdmonitionType) {
|
|
30014
|
+
AdmonitionType["TIP"] = "TIP";
|
|
30015
|
+
AdmonitionType["NOTE"] = "NOTE";
|
|
30016
|
+
AdmonitionType["IMPORTANT"] = "IMPORTANT";
|
|
30017
|
+
AdmonitionType["WARNING"] = "WARNING";
|
|
30018
|
+
AdmonitionType["CAUTION"] = "CAUTION";
|
|
30019
|
+
})(AdmonitionType || (AdmonitionType = {}));
|
|
30020
|
+
const admonitionToAlertVariantMap = {
|
|
30021
|
+
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
30022
|
+
[AdmonitionType.TIP]: { variant: 'custom', customIcon: jsxRuntime.jsx(LightbulbIcon, {}) },
|
|
30023
|
+
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
30024
|
+
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: jsxRuntime.jsx(FireIcon, {}) },
|
|
30025
|
+
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
30026
|
+
};
|
|
30027
|
+
const useAdmonitionShowdownExtension = () =>
|
|
30028
|
+
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
30029
|
+
useMemo(() => ({
|
|
30030
|
+
type: 'lang',
|
|
30031
|
+
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
30032
|
+
replace: (text, content, admonitionLabel, admonitionType) => {
|
|
30033
|
+
if (!content || !admonitionLabel || !admonitionType) {
|
|
30034
|
+
return text;
|
|
30035
|
+
}
|
|
30036
|
+
if (admonitionLabel !== 'admonition') {
|
|
30037
|
+
return text;
|
|
30038
|
+
}
|
|
30039
|
+
admonitionType = admonitionType.toUpperCase();
|
|
30040
|
+
// Process markdown content directly using marked
|
|
30041
|
+
const processedContent = marked.parseInline(content);
|
|
30042
|
+
const sanitizedContent = DOMPurify$2.sanitize(processedContent);
|
|
30043
|
+
// Handle unknown admonition types by defaulting to NOTE
|
|
30044
|
+
const admonitionConfig = admonitionToAlertVariantMap[admonitionType] || admonitionToAlertVariantMap.NOTE;
|
|
30045
|
+
const { variant, customIcon } = admonitionConfig;
|
|
30046
|
+
const pfAlert = (jsxRuntime.jsx(Alert, Object.assign({ variant: variant }, (customIcon && { customIcon }), { isInline: true, title: admonitionType, className: "pfext-markdown-admonition" }, { children: jsxRuntime.jsx("div", { dangerouslySetInnerHTML: { __html: sanitizedContent } }) })));
|
|
30047
|
+
return removeTemplateWhitespace(renderToStaticMarkup(pfAlert));
|
|
30048
|
+
},
|
|
30049
|
+
}), []);
|
|
30050
|
+
|
|
30051
|
+
const useCodeShowdownExtension = () => useMemo(() => ({
|
|
30052
|
+
type: 'output',
|
|
30053
|
+
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
30054
|
+
replace: (text, content) => {
|
|
30055
|
+
if (!content) {
|
|
30056
|
+
return text;
|
|
30057
|
+
}
|
|
30058
|
+
const pfCodeBlock = jsxRuntime.jsx(CodeBlock, { children: content });
|
|
30059
|
+
return removeTemplateWhitespace(renderToStaticMarkup(pfCodeBlock));
|
|
30060
|
+
},
|
|
30061
|
+
}), []);
|
|
30062
|
+
|
|
30063
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30064
|
+
const DOMPurify$1 = require('dompurify');
|
|
30065
|
+
const useAccordionShowdownExtension = () => useMemo(() => ({
|
|
30066
|
+
type: 'lang',
|
|
30067
|
+
regex: /\[(.+)]{{(accordion) ("(.*?)")}}/g,
|
|
30068
|
+
replace: (_text, accordionContent, _command, _quotedHeading, accordionHeading) => {
|
|
30069
|
+
const accordionId = String(accordionHeading).replace(/\s/g, '-');
|
|
30070
|
+
// Process accordion content with markdown
|
|
30071
|
+
const processedContent = marked.parseInline(accordionContent);
|
|
30072
|
+
const sanitizedContent = DOMPurify$1.sanitize(processedContent);
|
|
30073
|
+
return removeTemplateWhitespace(renderToStaticMarkup(jsxRuntime.jsx(Accordion, { children: jsxRuntime.jsxs(AccordionItem, { children: [jsxRuntime.jsx(AccordionToggle, Object.assign({ id: `${ACCORDION_MARKDOWN_BUTTON_ID}-${accordionId}` }, { children: accordionHeading })), jsxRuntime.jsx(AccordionContent, Object.assign({ id: `${ACCORDION_MARKDOWN_CONTENT_ID}-${accordionId}`, hidden: true }, { children: jsxRuntime.jsx("div", { dangerouslySetInnerHTML: { __html: sanitizedContent } }) }))] }) })));
|
|
30074
|
+
},
|
|
30075
|
+
}), []);
|
|
30076
|
+
|
|
30077
|
+
const AccordionShowdownHandler = ({ buttonElement, contentElement, }) => {
|
|
30078
|
+
const [expanded, setExpanded] = useState(false);
|
|
30079
|
+
const handleClick = () => {
|
|
30080
|
+
const newExpanded = !expanded;
|
|
30081
|
+
const expandedModifier = 'pf-m-expanded';
|
|
30082
|
+
// Find the accordion item element (parent of the button)
|
|
30083
|
+
const accordionItem = buttonElement.closest('.pf-v6-c-accordion__item');
|
|
30084
|
+
// Update button - both visual state and aria-expanded
|
|
30085
|
+
buttonElement.className = `pf-v6-c-accordion__toggle ${newExpanded ? expandedModifier : ''}`;
|
|
30086
|
+
buttonElement.setAttribute('aria-expanded', newExpanded.toString());
|
|
30087
|
+
// Update content - both visual state and hidden attribute
|
|
30088
|
+
contentElement.hidden = !newExpanded;
|
|
30089
|
+
contentElement.className = `pf-v6-c-accordion__expandable-content ${newExpanded ? expandedModifier : ''}`;
|
|
30090
|
+
// Update accordion item
|
|
30091
|
+
if (accordionItem) {
|
|
30092
|
+
accordionItem.className = `pf-v6-c-accordion__item ${newExpanded ? expandedModifier : ''}`;
|
|
30093
|
+
}
|
|
30094
|
+
setExpanded(newExpanded);
|
|
30095
|
+
};
|
|
30096
|
+
useEventListener(buttonElement, 'click', handleClick);
|
|
30097
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
30098
|
+
};
|
|
30099
|
+
const AccordionRenderExtension = ({ docContext }) => {
|
|
30100
|
+
const buttonElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_BUTTON_ID}]`);
|
|
30101
|
+
const contentElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_CONTENT_ID}]`);
|
|
30102
|
+
return buttonElements.length > 0 ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from(buttonElements).map((elm) => {
|
|
30103
|
+
const content = Array.from(contentElements).find((elm2) => {
|
|
30104
|
+
const elmId = elm.id.split(ACCORDION_MARKDOWN_BUTTON_ID)[1];
|
|
30105
|
+
const elm2Id = elm2.id.split(ACCORDION_MARKDOWN_CONTENT_ID)[1];
|
|
30106
|
+
return elmId === elm2Id;
|
|
30107
|
+
});
|
|
30108
|
+
return (jsxRuntime.jsx(AccordionShowdownHandler, { buttonElement: elm, contentElement: content }, elm.id.split(ACCORDION_MARKDOWN_BUTTON_ID)[1]));
|
|
30109
|
+
}) })) : null;
|
|
30110
|
+
};
|
|
30111
|
+
|
|
30112
|
+
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
30113
|
+
const [isSrcValid, setIsSrcValid] = useState(true);
|
|
30114
|
+
if (src && isSrcValid) {
|
|
30115
|
+
return jsxRuntime.jsx("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
|
|
30116
|
+
}
|
|
30117
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: fallback });
|
|
30118
|
+
};
|
|
30119
|
+
|
|
30120
|
+
var syncAltIcon = createCommonjsModule(function (module, exports) {
|
|
30121
|
+
exports.__esModule = true;
|
|
30122
|
+
exports.SyncAltIconConfig = {
|
|
30123
|
+
name: 'SyncAltIcon',
|
|
30124
|
+
height: 512,
|
|
30125
|
+
width: 512,
|
|
30126
|
+
svgPath: 'M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z',
|
|
30127
|
+
yOffset: 0,
|
|
30128
|
+
xOffset: 0,
|
|
30129
|
+
};
|
|
30130
|
+
exports.SyncAltIcon = require$$0.createIcon(exports.SyncAltIconConfig);
|
|
30131
|
+
exports["default"] = exports.SyncAltIcon;
|
|
30132
|
+
});
|
|
30133
|
+
|
|
30134
|
+
var SyncAltIcon = /*@__PURE__*/getDefaultExportFromCjs(syncAltIcon);
|
|
30135
|
+
|
|
30136
|
+
const DASH = '-';
|
|
30137
|
+
|
|
30138
|
+
const PopoverStatus = ({ hideHeader, children, isVisible = null, statusBody, title, onHide, onShow, }) => (jsxRuntime.jsx(Popover, Object.assign({ position: PopoverPosition.right, headerContent: hideHeader ? null : title, bodyContent: children, "aria-label": title, onHide: onHide, onShow: onShow, isVisible: isVisible }, { children: jsxRuntime.jsx(Button, Object.assign({ variant: "link", isInline: true }, { children: statusBody })) })));
|
|
30139
|
+
|
|
30140
|
+
const StatusIconAndText = ({ icon, title, spin, iconOnly, noTooltip, className, }) => {
|
|
30141
|
+
if (!title) {
|
|
30142
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: DASH });
|
|
30143
|
+
}
|
|
30144
|
+
return (jsxRuntime.jsxs("span", Object.assign({ className: css('pfext-icon-and-text', className), title: iconOnly && !noTooltip ? title : undefined }, { children: [icon &&
|
|
30145
|
+
cloneElement(icon, {
|
|
30146
|
+
className: css(spin && 'fa-spin', icon.props.className, !iconOnly && 'pfext-icon-and-text__icon pfext-icon-flex-child'),
|
|
30147
|
+
}), !iconOnly && jsxRuntime.jsx(CamelCaseWrap, { value: title, dataTest: "status-text" })] })));
|
|
30148
|
+
};
|
|
30149
|
+
|
|
30150
|
+
const GenericStatus = (props) => {
|
|
30151
|
+
const { Icon, children, popoverTitle, title, noTooltip, iconOnly } = props, restProps = __rest(props, ["Icon", "children", "popoverTitle", "title", "noTooltip", "iconOnly"]);
|
|
30152
|
+
const renderIcon = iconOnly && !noTooltip ? jsxRuntime.jsx(Icon, { title: title }) : jsxRuntime.jsx(Icon, {});
|
|
30153
|
+
const statusBody = (jsxRuntime.jsx(StatusIconAndText, Object.assign({}, restProps, { noTooltip: noTooltip, title: title, iconOnly: iconOnly, icon: renderIcon })));
|
|
30154
|
+
return Children.toArray(children).length ? (jsxRuntime.jsx(PopoverStatus, Object.assign({ title: popoverTitle || title }, restProps, { statusBody: statusBody }, { children: children }))) : (statusBody);
|
|
30155
|
+
};
|
|
30156
|
+
|
|
30157
|
+
var checkCircleIcon = createCommonjsModule(function (module, exports) {
|
|
30158
|
+
exports.__esModule = true;
|
|
30159
|
+
exports.CheckCircleIconConfig = {
|
|
30160
|
+
name: 'CheckCircleIcon',
|
|
30161
|
+
height: 512,
|
|
30162
|
+
width: 512,
|
|
30163
|
+
svgPath: 'M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z',
|
|
30164
|
+
yOffset: 0,
|
|
30165
|
+
xOffset: 0,
|
|
30166
|
+
};
|
|
30167
|
+
exports.CheckCircleIcon = require$$0.createIcon(exports.CheckCircleIconConfig);
|
|
30168
|
+
exports["default"] = exports.CheckCircleIcon;
|
|
30169
|
+
});
|
|
30170
|
+
|
|
30171
|
+
var CheckCircleIcon = /*@__PURE__*/getDefaultExportFromCjs(checkCircleIcon);
|
|
30172
|
+
|
|
30173
|
+
var infoCircleIcon = createCommonjsModule(function (module, exports) {
|
|
30174
|
+
exports.__esModule = true;
|
|
30175
|
+
exports.InfoCircleIconConfig = {
|
|
30176
|
+
name: 'InfoCircleIcon',
|
|
30177
|
+
height: 512,
|
|
30178
|
+
width: 512,
|
|
30179
|
+
svgPath: 'M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z',
|
|
30180
|
+
yOffset: 0,
|
|
30181
|
+
xOffset: 0,
|
|
30182
|
+
};
|
|
30183
|
+
exports.InfoCircleIcon = require$$0.createIcon(exports.InfoCircleIconConfig);
|
|
30184
|
+
exports["default"] = exports.InfoCircleIcon;
|
|
30185
|
+
});
|
|
30186
|
+
|
|
30187
|
+
var InfoCircleIcon = /*@__PURE__*/getDefaultExportFromCjs(infoCircleIcon);
|
|
30188
|
+
|
|
30189
|
+
const GreenCheckCircleIcon = ({ className, title, size }) => (jsxRuntime.jsx(Icon, Object.assign({ size: size, status: "success" }, { children: jsxRuntime.jsx(CheckCircleIcon, { "data-test": "success-icon", className: className, title: title }) })));
|
|
30190
|
+
|
|
30191
|
+
const SuccessStatus = (props) => (jsxRuntime.jsx(GenericStatus, Object.assign({}, props, { Icon: GreenCheckCircleIcon, title: props.title || 'Healthy' })));
|
|
30192
|
+
SuccessStatus.displayName = 'SuccessStatus';
|
|
30193
|
+
|
|
30194
|
+
const Status = ({ status, title, iconOnly, noTooltip, className }) => {
|
|
30195
|
+
const statusProps = { title: title || status, iconOnly, noTooltip, className };
|
|
30196
|
+
switch (status) {
|
|
30197
|
+
case 'In Progress':
|
|
30198
|
+
return jsxRuntime.jsx(StatusIconAndText, Object.assign({}, statusProps, { icon: jsxRuntime.jsx(SyncAltIcon, {}) }));
|
|
30199
|
+
case 'Complete':
|
|
30200
|
+
return jsxRuntime.jsx(SuccessStatus, Object.assign({}, statusProps));
|
|
30201
|
+
default:
|
|
30202
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: status || DASH });
|
|
30203
|
+
}
|
|
30204
|
+
};
|
|
30205
|
+
const StatusIcon = ({ status }) => jsxRuntime.jsx(Status, { status: status, iconOnly: true });
|
|
30206
|
+
|
|
30010
30207
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30011
30208
|
const DOMPurify = require('dompurify');
|
|
30012
30209
|
const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -30018,7 +30215,7 @@ const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void
|
|
|
30018
30215
|
node.setAttribute('rel', 'noopener noreferrer');
|
|
30019
30216
|
return node;
|
|
30020
30217
|
}
|
|
30021
|
-
// add PF content classes
|
|
30218
|
+
// add PF content classes to standard elements (details blocks get handled separately)
|
|
30022
30219
|
if (node.nodeType === 1) {
|
|
30023
30220
|
const contentElements = [
|
|
30024
30221
|
'ul',
|
|
@@ -30069,13 +30266,82 @@ const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void
|
|
|
30069
30266
|
const reversedMarkdown = reverseString(markdown);
|
|
30070
30267
|
const reverseMarkdownWithSubstitutedCodeFences = reversedMarkdown.replace(/{{```((.|\n)*?)```/g, '{{@@@$1@@@');
|
|
30071
30268
|
const markdownWithSubstitutedCodeFences = reverseString(reverseMarkdownWithSubstitutedCodeFences);
|
|
30072
|
-
|
|
30269
|
+
// Fix malformed HTML entities early in the process
|
|
30270
|
+
let preprocessedMarkdown = markdownWithSubstitutedCodeFences;
|
|
30271
|
+
preprocessedMarkdown = preprocessedMarkdown
|
|
30272
|
+
.replace(/ ([^;])/g, ' $1')
|
|
30273
|
+
.replace(/&nbsp;/g, ' ');
|
|
30274
|
+
preprocessedMarkdown = preprocessedMarkdown.replace(/ (?![;])/g, ' ');
|
|
30275
|
+
// Process content in segments to ensure markdown parsing continues after HTML blocks
|
|
30276
|
+
const htmlBlockRegex = /(<(?:details|div|section|article)[^>]*>[\s\S]*?<\/(?:details|div|section|article)>)/g;
|
|
30277
|
+
let parsedMarkdown = '';
|
|
30278
|
+
// Check if there are any HTML blocks
|
|
30279
|
+
if (htmlBlockRegex.test(preprocessedMarkdown)) {
|
|
30280
|
+
// Reset regex for actual processing
|
|
30281
|
+
htmlBlockRegex.lastIndex = 0;
|
|
30282
|
+
let lastIndex = 0;
|
|
30283
|
+
let match;
|
|
30284
|
+
while ((match = htmlBlockRegex.exec(preprocessedMarkdown)) !== null) {
|
|
30285
|
+
// Process markdown before the HTML block
|
|
30286
|
+
const markdownBefore = preprocessedMarkdown.slice(lastIndex, match.index).trim();
|
|
30287
|
+
if (markdownBefore) {
|
|
30288
|
+
const parsed = yield marked.parse(markdownBefore);
|
|
30289
|
+
parsedMarkdown += parsed;
|
|
30290
|
+
}
|
|
30291
|
+
// Process the HTML block: parse markdown content inside while preserving HTML structure
|
|
30292
|
+
let htmlBlock = match[1];
|
|
30293
|
+
// Find and process markdown content inside HTML tags
|
|
30294
|
+
const contentRegex = />(\s*[\s\S]*?)\s*</g;
|
|
30295
|
+
const contentMatches = [];
|
|
30296
|
+
let contentMatch;
|
|
30297
|
+
while ((contentMatch = contentRegex.exec(htmlBlock)) !== null) {
|
|
30298
|
+
const content = contentMatch[1];
|
|
30299
|
+
// Only process content that has markdown formatting but no extension syntax
|
|
30300
|
+
if (content.trim() &&
|
|
30301
|
+
!content.includes('{{') &&
|
|
30302
|
+
(content.includes('**') || content.includes('- ') || content.includes('\n'))) {
|
|
30303
|
+
// This looks like markdown content without extensions - parse it as block content
|
|
30304
|
+
const parsedContent = yield marked.parse(content.trim());
|
|
30305
|
+
// Remove wrapping <p> tags if they exist since we're inside HTML already
|
|
30306
|
+
const cleanedContent = parsedContent.replace(/^<p[^>]*>([\s\S]*)<\/p>[\s]*$/g, '$1');
|
|
30307
|
+
contentMatches.push({
|
|
30308
|
+
original: contentMatch[0],
|
|
30309
|
+
replacement: `>${cleanedContent}<`,
|
|
30310
|
+
});
|
|
30311
|
+
}
|
|
30312
|
+
}
|
|
30313
|
+
// Apply the content replacements
|
|
30314
|
+
contentMatches.forEach(({ original, replacement }) => {
|
|
30315
|
+
htmlBlock = htmlBlock.replace(original, replacement);
|
|
30316
|
+
});
|
|
30317
|
+
// Apply extensions (like admonitions) to the processed HTML block
|
|
30318
|
+
if (extensions) {
|
|
30319
|
+
extensions.forEach(({ regex, replace }) => {
|
|
30320
|
+
if (regex) {
|
|
30321
|
+
htmlBlock = htmlBlock.replace(regex, replace);
|
|
30322
|
+
}
|
|
30323
|
+
});
|
|
30324
|
+
}
|
|
30325
|
+
parsedMarkdown += htmlBlock;
|
|
30326
|
+
lastIndex = htmlBlockRegex.lastIndex;
|
|
30327
|
+
}
|
|
30328
|
+
// Process any remaining markdown after the last HTML block
|
|
30329
|
+
const markdownAfter = preprocessedMarkdown.slice(lastIndex).trim();
|
|
30330
|
+
if (markdownAfter) {
|
|
30331
|
+
const parsed = yield marked.parse(markdownAfter);
|
|
30332
|
+
parsedMarkdown += parsed;
|
|
30333
|
+
}
|
|
30334
|
+
}
|
|
30335
|
+
else {
|
|
30336
|
+
// No HTML blocks found, process normally
|
|
30337
|
+
parsedMarkdown = yield marked.parse(preprocessedMarkdown);
|
|
30338
|
+
}
|
|
30073
30339
|
// Swap the temporary tokens back to code fences before we run the extensions
|
|
30074
30340
|
let md = parsedMarkdown.replace(/@@@/g, '```');
|
|
30075
30341
|
if (extensions) {
|
|
30076
30342
|
// Convert code spans back to md format before we run the custom extension regexes
|
|
30077
30343
|
md = md.replace(/<code>(.*)<\/code>/g, '`$1`');
|
|
30078
|
-
extensions.forEach(({ regex, replace }) => {
|
|
30344
|
+
extensions.forEach(({ regex, replace }, _index) => {
|
|
30079
30345
|
if (regex) {
|
|
30080
30346
|
md = md.replace(regex, replace);
|
|
30081
30347
|
}
|
|
@@ -30140,7 +30406,7 @@ const RenderExtension = ({ renderExtension, selector, markup, docContext, }) =>
|
|
|
30140
30406
|
};
|
|
30141
30407
|
const InlineMarkdownView = ({ markup, isEmpty, renderExtension, className, }) => {
|
|
30142
30408
|
const id = useMemo(() => uniqueId('markdown'), []);
|
|
30143
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: css({ 'is-empty': isEmpty }, className), id: id }, { children: [jsxRuntime.jsx("div", { dangerouslySetInnerHTML: { __html: markup } }), renderExtension && (jsxRuntime.jsx(RenderExtension, { renderExtension: renderExtension, selector: `#${id}`, markup: markup }))] })));
|
|
30409
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: css({ 'is-empty': isEmpty }, className), id: id }, { children: [jsxRuntime.jsx("div", { style: { marginBlockEnd: 'var(--pf-t-global--spacer--md)' }, dangerouslySetInnerHTML: { __html: markup } }), renderExtension && (jsxRuntime.jsx(RenderExtension, { renderExtension: renderExtension, selector: `#${id}`, markup: markup }))] })));
|
|
30144
30410
|
};
|
|
30145
30411
|
const IFrameMarkdownView = ({ exactHeight, markup, isEmpty, renderExtension, className, }) => {
|
|
30146
30412
|
const [frame, setFrame] = useState();
|
|
@@ -30199,7 +30465,7 @@ const IFrameMarkdownView = ({ exactHeight, markup, isEmpty, renderExtension, cla
|
|
|
30199
30465
|
}
|
|
30200
30466
|
</style>
|
|
30201
30467
|
<body class="pf-m-redhat-font"><div style="overflow-y: auto;">${markup}</div></body>`;
|
|
30202
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("iframe", { sandbox: "allow-popups allow-popups-to-escape-sandbox allow-same-origin", srcDoc: contents, style: { border: '0px', display: 'block', width: '100%', height: '0' }, ref: (r) => {
|
|
30468
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("iframe", { title: "Markdown content preview", sandbox: "allow-popups allow-popups-to-escape-sandbox allow-same-origin", srcDoc: contents, style: { border: '0px', display: 'block', width: '100%', height: '0' }, ref: (r) => {
|
|
30203
30469
|
setFrame(r);
|
|
30204
30470
|
}, onLoad: () => onLoad(), className: className }), loaded && frame && renderExtension && (jsxRuntime.jsx(RenderExtension, { markup: markup, selector: '', renderExtension: renderExtension, docContext: frame.contentDocument }))] }));
|
|
30205
30471
|
};
|
|
@@ -30247,179 +30513,6 @@ const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
|
30247
30513
|
markdown.renderExtension(docContext, rootSelector)] })), className: className }));
|
|
30248
30514
|
};
|
|
30249
30515
|
|
|
30250
|
-
var AdmonitionType;
|
|
30251
|
-
(function (AdmonitionType) {
|
|
30252
|
-
AdmonitionType["TIP"] = "TIP";
|
|
30253
|
-
AdmonitionType["NOTE"] = "NOTE";
|
|
30254
|
-
AdmonitionType["IMPORTANT"] = "IMPORTANT";
|
|
30255
|
-
AdmonitionType["WARNING"] = "WARNING";
|
|
30256
|
-
AdmonitionType["CAUTION"] = "CAUTION";
|
|
30257
|
-
})(AdmonitionType || (AdmonitionType = {}));
|
|
30258
|
-
const admonitionToAlertVariantMap = {
|
|
30259
|
-
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
30260
|
-
[AdmonitionType.TIP]: { variant: 'custom', customIcon: jsxRuntime.jsx(LightbulbIcon, {}) },
|
|
30261
|
-
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
30262
|
-
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: jsxRuntime.jsx(FireIcon, {}) },
|
|
30263
|
-
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
30264
|
-
};
|
|
30265
|
-
const useAdmonitionShowdownExtension = () =>
|
|
30266
|
-
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
30267
|
-
useMemo(() => ({
|
|
30268
|
-
type: 'lang',
|
|
30269
|
-
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
30270
|
-
replace: (text, content, admonitionLabel, admonitionType, groupId) => {
|
|
30271
|
-
if (!content || !admonitionLabel || !admonitionType || !groupId) {
|
|
30272
|
-
return text;
|
|
30273
|
-
}
|
|
30274
|
-
admonitionType = admonitionType.toUpperCase();
|
|
30275
|
-
const { variant, customIcon } = admonitionToAlertVariantMap[admonitionType];
|
|
30276
|
-
const mdContent = jsxRuntime.jsx(QuickStartMarkdownView, { content: content });
|
|
30277
|
-
const pfAlert = (jsxRuntime.jsx(Alert, Object.assign({ variant: variant }, (customIcon && { customIcon }), { isInline: true, title: admonitionType, className: "pfext-markdown-admonition" }, { children: mdContent })));
|
|
30278
|
-
return removeTemplateWhitespace(renderToStaticMarkup(pfAlert));
|
|
30279
|
-
},
|
|
30280
|
-
}), []);
|
|
30281
|
-
|
|
30282
|
-
const useCodeShowdownExtension = () => useMemo(() => ({
|
|
30283
|
-
type: 'output',
|
|
30284
|
-
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
30285
|
-
replace: (text, content) => {
|
|
30286
|
-
if (!content) {
|
|
30287
|
-
return text;
|
|
30288
|
-
}
|
|
30289
|
-
const pfCodeBlock = jsxRuntime.jsx(CodeBlock, { children: content });
|
|
30290
|
-
return removeTemplateWhitespace(renderToStaticMarkup(pfCodeBlock));
|
|
30291
|
-
},
|
|
30292
|
-
}), []);
|
|
30293
|
-
|
|
30294
|
-
const useAccordionShowdownExtension = () => useMemo(() => ({
|
|
30295
|
-
type: 'lang',
|
|
30296
|
-
regex: /\[(.+)]{{(accordion) ("(.*?)")}}/g,
|
|
30297
|
-
replace: (_text, accordionContent, _command, accordionHeading) => {
|
|
30298
|
-
const accordionId = String(accordionHeading).replace(/\s/g, '-');
|
|
30299
|
-
return removeTemplateWhitespace(renderToStaticMarkup(jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(Accordion, Object.assign({ asDefinitionList: true }, { children: jsxRuntime.jsxs(AccordionItem, Object.assign({ isExpanded: false }, { children: [jsxRuntime.jsx(AccordionToggle, Object.assign({ id: `${ACCORDION_MARKDOWN_BUTTON_ID}-${accordionId}` }, { children: accordionHeading })), jsxRuntime.jsx(AccordionContent, Object.assign({ id: `${ACCORDION_MARKDOWN_CONTENT_ID}-${accordionId}` }, { children: accordionContent }))] })) })) })));
|
|
30300
|
-
},
|
|
30301
|
-
}), []);
|
|
30302
|
-
|
|
30303
|
-
const AccordionShowdownHandler = ({ buttonElement, contentElement, }) => {
|
|
30304
|
-
const [expanded, setExpanded] = useState(false);
|
|
30305
|
-
const handleClick = () => {
|
|
30306
|
-
const expandedModifier = 'pf-m-expanded';
|
|
30307
|
-
buttonElement.className = `pf-v6-c-accordion__toggle ${!expanded ? expandedModifier : ''}`;
|
|
30308
|
-
contentElement.hidden = expanded;
|
|
30309
|
-
contentElement.className = `pf-v6-c-accordion__expanded-content ${!expanded ? expandedModifier : ''}`;
|
|
30310
|
-
setExpanded(!expanded);
|
|
30311
|
-
};
|
|
30312
|
-
useEventListener(buttonElement, 'click', handleClick);
|
|
30313
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
30314
|
-
};
|
|
30315
|
-
const AccordionRenderExtension = ({ docContext }) => {
|
|
30316
|
-
const buttonElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_BUTTON_ID}]`);
|
|
30317
|
-
const contentElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_CONTENT_ID}]`);
|
|
30318
|
-
return buttonElements.length > 0 ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from(buttonElements).map((elm) => {
|
|
30319
|
-
const content = Array.from(contentElements).find((elm2) => {
|
|
30320
|
-
const elmId = elm.id.split(ACCORDION_MARKDOWN_BUTTON_ID)[1];
|
|
30321
|
-
const elm2Id = elm2.id.split(ACCORDION_MARKDOWN_CONTENT_ID)[1];
|
|
30322
|
-
return elmId === elm2Id;
|
|
30323
|
-
});
|
|
30324
|
-
return (jsxRuntime.jsx(AccordionShowdownHandler, { buttonElement: elm, contentElement: content }, elm.id.split(ACCORDION_MARKDOWN_BUTTON_ID)[1]));
|
|
30325
|
-
}) })) : null;
|
|
30326
|
-
};
|
|
30327
|
-
|
|
30328
|
-
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
30329
|
-
const [isSrcValid, setIsSrcValid] = useState(true);
|
|
30330
|
-
if (src && isSrcValid) {
|
|
30331
|
-
return jsxRuntime.jsx("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
|
|
30332
|
-
}
|
|
30333
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: fallback });
|
|
30334
|
-
};
|
|
30335
|
-
|
|
30336
|
-
var syncAltIcon = createCommonjsModule(function (module, exports) {
|
|
30337
|
-
exports.__esModule = true;
|
|
30338
|
-
exports.SyncAltIconConfig = {
|
|
30339
|
-
name: 'SyncAltIcon',
|
|
30340
|
-
height: 512,
|
|
30341
|
-
width: 512,
|
|
30342
|
-
svgPath: 'M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z',
|
|
30343
|
-
yOffset: 0,
|
|
30344
|
-
xOffset: 0,
|
|
30345
|
-
};
|
|
30346
|
-
exports.SyncAltIcon = require$$0.createIcon(exports.SyncAltIconConfig);
|
|
30347
|
-
exports["default"] = exports.SyncAltIcon;
|
|
30348
|
-
});
|
|
30349
|
-
|
|
30350
|
-
var SyncAltIcon = /*@__PURE__*/getDefaultExportFromCjs(syncAltIcon);
|
|
30351
|
-
|
|
30352
|
-
const DASH = '-';
|
|
30353
|
-
|
|
30354
|
-
const PopoverStatus = ({ hideHeader, children, isVisible = null, statusBody, title, onHide, onShow, }) => (jsxRuntime.jsx(Popover, Object.assign({ position: PopoverPosition.right, headerContent: hideHeader ? null : title, bodyContent: children, "aria-label": title, onHide: onHide, onShow: onShow, isVisible: isVisible }, { children: jsxRuntime.jsx(Button, Object.assign({ variant: "link", isInline: true }, { children: statusBody })) })));
|
|
30355
|
-
|
|
30356
|
-
const StatusIconAndText = ({ icon, title, spin, iconOnly, noTooltip, className, }) => {
|
|
30357
|
-
if (!title) {
|
|
30358
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: DASH });
|
|
30359
|
-
}
|
|
30360
|
-
return (jsxRuntime.jsxs("span", Object.assign({ className: css('pfext-icon-and-text', className), title: iconOnly && !noTooltip ? title : undefined }, { children: [icon &&
|
|
30361
|
-
cloneElement(icon, {
|
|
30362
|
-
className: css(spin && 'fa-spin', icon.props.className, !iconOnly && 'pfext-icon-and-text__icon pfext-icon-flex-child'),
|
|
30363
|
-
}), !iconOnly && jsxRuntime.jsx(CamelCaseWrap, { value: title, dataTest: "status-text" })] })));
|
|
30364
|
-
};
|
|
30365
|
-
|
|
30366
|
-
const GenericStatus = (props) => {
|
|
30367
|
-
const { Icon, children, popoverTitle, title, noTooltip, iconOnly } = props, restProps = __rest(props, ["Icon", "children", "popoverTitle", "title", "noTooltip", "iconOnly"]);
|
|
30368
|
-
const renderIcon = iconOnly && !noTooltip ? jsxRuntime.jsx(Icon, { title: title }) : jsxRuntime.jsx(Icon, {});
|
|
30369
|
-
const statusBody = (jsxRuntime.jsx(StatusIconAndText, Object.assign({}, restProps, { noTooltip: noTooltip, title: title, iconOnly: iconOnly, icon: renderIcon })));
|
|
30370
|
-
return Children.toArray(children).length ? (jsxRuntime.jsx(PopoverStatus, Object.assign({ title: popoverTitle || title }, restProps, { statusBody: statusBody }, { children: children }))) : (statusBody);
|
|
30371
|
-
};
|
|
30372
|
-
|
|
30373
|
-
var checkCircleIcon = createCommonjsModule(function (module, exports) {
|
|
30374
|
-
exports.__esModule = true;
|
|
30375
|
-
exports.CheckCircleIconConfig = {
|
|
30376
|
-
name: 'CheckCircleIcon',
|
|
30377
|
-
height: 512,
|
|
30378
|
-
width: 512,
|
|
30379
|
-
svgPath: 'M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z',
|
|
30380
|
-
yOffset: 0,
|
|
30381
|
-
xOffset: 0,
|
|
30382
|
-
};
|
|
30383
|
-
exports.CheckCircleIcon = require$$0.createIcon(exports.CheckCircleIconConfig);
|
|
30384
|
-
exports["default"] = exports.CheckCircleIcon;
|
|
30385
|
-
});
|
|
30386
|
-
|
|
30387
|
-
var CheckCircleIcon = /*@__PURE__*/getDefaultExportFromCjs(checkCircleIcon);
|
|
30388
|
-
|
|
30389
|
-
var infoCircleIcon = createCommonjsModule(function (module, exports) {
|
|
30390
|
-
exports.__esModule = true;
|
|
30391
|
-
exports.InfoCircleIconConfig = {
|
|
30392
|
-
name: 'InfoCircleIcon',
|
|
30393
|
-
height: 512,
|
|
30394
|
-
width: 512,
|
|
30395
|
-
svgPath: 'M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z',
|
|
30396
|
-
yOffset: 0,
|
|
30397
|
-
xOffset: 0,
|
|
30398
|
-
};
|
|
30399
|
-
exports.InfoCircleIcon = require$$0.createIcon(exports.InfoCircleIconConfig);
|
|
30400
|
-
exports["default"] = exports.InfoCircleIcon;
|
|
30401
|
-
});
|
|
30402
|
-
|
|
30403
|
-
var InfoCircleIcon = /*@__PURE__*/getDefaultExportFromCjs(infoCircleIcon);
|
|
30404
|
-
|
|
30405
|
-
const GreenCheckCircleIcon = ({ className, title, size }) => (jsxRuntime.jsx(Icon, Object.assign({ size: size, status: "success" }, { children: jsxRuntime.jsx(CheckCircleIcon, { "data-test": "success-icon", className: className, title: title }) })));
|
|
30406
|
-
|
|
30407
|
-
const SuccessStatus = (props) => (jsxRuntime.jsx(GenericStatus, Object.assign({}, props, { Icon: GreenCheckCircleIcon, title: props.title || 'Healthy' })));
|
|
30408
|
-
SuccessStatus.displayName = 'SuccessStatus';
|
|
30409
|
-
|
|
30410
|
-
const Status = ({ status, title, iconOnly, noTooltip, className }) => {
|
|
30411
|
-
const statusProps = { title: title || status, iconOnly, noTooltip, className };
|
|
30412
|
-
switch (status) {
|
|
30413
|
-
case 'In Progress':
|
|
30414
|
-
return jsxRuntime.jsx(StatusIconAndText, Object.assign({}, statusProps, { icon: jsxRuntime.jsx(SyncAltIcon, {}) }));
|
|
30415
|
-
case 'Complete':
|
|
30416
|
-
return jsxRuntime.jsx(SuccessStatus, Object.assign({}, statusProps));
|
|
30417
|
-
default:
|
|
30418
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: status || DASH });
|
|
30419
|
-
}
|
|
30420
|
-
};
|
|
30421
|
-
const StatusIcon = ({ status }) => jsxRuntime.jsx(Status, { status: status, iconOnly: true });
|
|
30422
|
-
|
|
30423
30516
|
const QuickStartTileDescription = ({ description, prerequisites, }) => {
|
|
30424
30517
|
const { getResource } = useContext(QuickStartContext);
|
|
30425
30518
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
@@ -30570,7 +30663,7 @@ const QuickStartCatalogFilterSelect = (_a) => {
|
|
|
30570
30663
|
};
|
|
30571
30664
|
const QuickStartCatalogFilterCount = ({ quickStartsCount }) => {
|
|
30572
30665
|
const { getResource } = useContext(QuickStartContext);
|
|
30573
|
-
return (jsxRuntime.jsx(ToolbarItem, Object.assign({ align: { default: 'alignEnd' } }, { children: getResource('{{count, number}} item', quickStartsCount)
|
|
30666
|
+
return (jsxRuntime.jsx(ToolbarItem, Object.assign({ align: { default: 'alignEnd' } }, { children: getResource('{{count, number}} item', quickStartsCount) })));
|
|
30574
30667
|
};
|
|
30575
30668
|
const QuickStartCatalogFilterSearchWrapper = ({ onSearchInputChange = () => { } }) => {
|
|
30576
30669
|
const { useQueryParams, filter, setFilter } = useContext(QuickStartContext);
|
|
@@ -30800,7 +30893,7 @@ const QuickStartIntroduction = ({ tasks, introduction, allTaskStatuses, prerequi
|
|
|
30800
30893
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
30801
30894
|
const [isPrereqsExpanded, setIsPrereqsExpanded] = useState(false);
|
|
30802
30895
|
const prereqList = (prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (jsxRuntime.jsx(ExpandableSection, Object.assign({ toggleText: getResource('View Prerequisites ({{totalPrereqs}})').replace('{{totalPrereqs}}', prereqs.length), onToggle: () => setIsPrereqsExpanded(!isPrereqsExpanded) }, { children: jsxRuntime.jsx(List, { children: prereqs.map((pr) => (jsxRuntime.jsx(ListItem, { children: jsxRuntime.jsx(QuickStartMarkdownView, { content: pr }) }, pr))) }) })));
|
|
30803
|
-
return (jsxRuntime.jsxs(Stack, Object.assign({ hasGutter: true }, { children: [jsxRuntime.jsx(QuickStartMarkdownView, { content: introduction }), prereqList, jsxRuntime.jsxs("p", { children: [getResource('In this quick start, you will complete {{count, number}} task', tasks === null || tasks === void 0 ? void 0 : tasks.length).replace('{{count, number}}', (tasks === null || tasks === void 0 ? void 0 : tasks.length) || 0), ":"] }), jsxRuntime.jsx(QuickStartTaskHeaderList, { tasks: tasks, allTaskStatuses: allTaskStatuses, onTaskSelect: onTaskSelect })] })));
|
|
30896
|
+
return (jsxRuntime.jsxs(Stack, Object.assign({ hasGutter: true }, { children: [jsxRuntime.jsx(QuickStartMarkdownView, { content: introduction }), prereqList, jsxRuntime.jsxs("p", { children: [getResource('In this quick start, you will complete {{count, number}} task', (tasks === null || tasks === void 0 ? void 0 : tasks.length) || 0).replace('{{count, number}}', (tasks === null || tasks === void 0 ? void 0 : tasks.length) || 0), ":"] }), jsxRuntime.jsx(QuickStartTaskHeaderList, { tasks: tasks, allTaskStatuses: allTaskStatuses, onTaskSelect: onTaskSelect })] })));
|
|
30804
30897
|
};
|
|
30805
30898
|
|
|
30806
30899
|
const getAlertVariant = (status) => {
|
|
@@ -30973,7 +31066,7 @@ const QuickStartPanelContent = (_a) => {
|
|
|
30973
31066
|
const QuickStartDrawerContent = (_a) => {
|
|
30974
31067
|
var { quickStarts = [], appendTo, fullWidth, handleDrawerClose } = _a, props = __rest(_a, ["quickStarts", "appendTo", "fullWidth", "handleDrawerClose"]);
|
|
30975
31068
|
const { activeQuickStartID, allQuickStarts = [], activeQuickStartState, } = useContext(QuickStartContext);
|
|
30976
|
-
const combinedQuickStarts = allQuickStarts.
|
|
31069
|
+
const combinedQuickStarts = [...allQuickStarts, ...quickStarts].filter((qs, idx, arr) => arr.findIndex((q) => q.metadata.name === qs.metadata.name) === idx);
|
|
30977
31070
|
const handleClose = () => {
|
|
30978
31071
|
handleDrawerClose && handleDrawerClose(activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.status);
|
|
30979
31072
|
};
|