@patternfly/quickstarts 6.3.0 → 6.4.0
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 +232 -147
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +232 -147
- package/dist/index.js.map +1 -1
- package/dist/quickstarts-full.es.js +280 -195
- package/dist/quickstarts-full.es.js.map +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 +2 -5
- package/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +1 -4
- package/src/controller/QuickStartIntroduction.tsx +1 -1
|
@@ -11876,18 +11876,13 @@ exports["default"] = exports.SearchIcon;
|
|
|
11876
11876
|
var SearchIcon = /*@__PURE__*/getDefaultExportFromCjs(searchIcon);
|
|
11877
11877
|
|
|
11878
11878
|
function _extends() {
|
|
11879
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
11880
|
-
for (var
|
|
11881
|
-
var
|
|
11882
|
-
for (var
|
|
11883
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11884
|
-
target[key] = source[key];
|
|
11885
|
-
}
|
|
11886
|
-
}
|
|
11879
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
11880
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
11881
|
+
var t = arguments[e];
|
|
11882
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
11887
11883
|
}
|
|
11888
|
-
return
|
|
11889
|
-
};
|
|
11890
|
-
return _extends.apply(this, arguments);
|
|
11884
|
+
return n;
|
|
11885
|
+
}, _extends.apply(null, arguments);
|
|
11891
11886
|
}
|
|
11892
11887
|
|
|
11893
11888
|
var m,x$2=m||(m={});x$2.Pop="POP";x$2.Push="PUSH";x$2.Replace="REPLACE";var y$1="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function z$2(a,b){if(!a){"undefined"!==typeof console&&console.warn(b);try{throw Error(b);}catch(g){}}}function A$2(a){a.preventDefault();a.returnValue="";}
|
|
@@ -30007,6 +30002,203 @@ marked.parseInline;
|
|
|
30007
30002
|
_Parser.parse;
|
|
30008
30003
|
_Lexer.lex;
|
|
30009
30004
|
|
|
30005
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30006
|
+
const DOMPurify$2 = require('dompurify');
|
|
30007
|
+
var AdmonitionType;
|
|
30008
|
+
(function (AdmonitionType) {
|
|
30009
|
+
AdmonitionType["TIP"] = "TIP";
|
|
30010
|
+
AdmonitionType["NOTE"] = "NOTE";
|
|
30011
|
+
AdmonitionType["IMPORTANT"] = "IMPORTANT";
|
|
30012
|
+
AdmonitionType["WARNING"] = "WARNING";
|
|
30013
|
+
AdmonitionType["CAUTION"] = "CAUTION";
|
|
30014
|
+
})(AdmonitionType || (AdmonitionType = {}));
|
|
30015
|
+
const admonitionToAlertVariantMap = {
|
|
30016
|
+
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
30017
|
+
[AdmonitionType.TIP]: { variant: 'custom', customIcon: jsxRuntime.jsx(LightbulbIcon, {}) },
|
|
30018
|
+
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
30019
|
+
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: jsxRuntime.jsx(FireIcon, {}) },
|
|
30020
|
+
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
30021
|
+
};
|
|
30022
|
+
const useAdmonitionShowdownExtension = () =>
|
|
30023
|
+
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
30024
|
+
useMemo(() => ({
|
|
30025
|
+
type: 'lang',
|
|
30026
|
+
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
30027
|
+
replace: (text, content, admonitionLabel, admonitionType) => {
|
|
30028
|
+
if (!content || !admonitionLabel || !admonitionType) {
|
|
30029
|
+
return text;
|
|
30030
|
+
}
|
|
30031
|
+
if (admonitionLabel !== 'admonition') {
|
|
30032
|
+
return text;
|
|
30033
|
+
}
|
|
30034
|
+
admonitionType = admonitionType.toUpperCase();
|
|
30035
|
+
// Process markdown content directly using marked
|
|
30036
|
+
const processedContent = marked.parseInline(content);
|
|
30037
|
+
const sanitizedContent = DOMPurify$2.sanitize(processedContent);
|
|
30038
|
+
// Handle unknown admonition types by defaulting to NOTE
|
|
30039
|
+
const admonitionConfig = admonitionToAlertVariantMap[admonitionType] || admonitionToAlertVariantMap.NOTE;
|
|
30040
|
+
const { variant, customIcon } = admonitionConfig;
|
|
30041
|
+
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 } }) })));
|
|
30042
|
+
return removeTemplateWhitespace(renderToStaticMarkup(pfAlert));
|
|
30043
|
+
},
|
|
30044
|
+
}), []);
|
|
30045
|
+
|
|
30046
|
+
const useCodeShowdownExtension = () => useMemo(() => ({
|
|
30047
|
+
type: 'output',
|
|
30048
|
+
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
30049
|
+
replace: (text, content) => {
|
|
30050
|
+
if (!content) {
|
|
30051
|
+
return text;
|
|
30052
|
+
}
|
|
30053
|
+
const pfCodeBlock = jsxRuntime.jsx(CodeBlock, { children: content });
|
|
30054
|
+
return removeTemplateWhitespace(renderToStaticMarkup(pfCodeBlock));
|
|
30055
|
+
},
|
|
30056
|
+
}), []);
|
|
30057
|
+
|
|
30058
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30059
|
+
const DOMPurify$1 = require('dompurify');
|
|
30060
|
+
const useAccordionShowdownExtension = () => useMemo(() => ({
|
|
30061
|
+
type: 'lang',
|
|
30062
|
+
regex: /\[(.+)]{{(accordion) ("(.*?)")}}/g,
|
|
30063
|
+
replace: (_text, accordionContent, _command, _quotedHeading, accordionHeading) => {
|
|
30064
|
+
const accordionId = String(accordionHeading).replace(/\s/g, '-');
|
|
30065
|
+
// Process accordion content with markdown
|
|
30066
|
+
const processedContent = marked.parseInline(accordionContent);
|
|
30067
|
+
const sanitizedContent = DOMPurify$1.sanitize(processedContent);
|
|
30068
|
+
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 } }) }))] }) })));
|
|
30069
|
+
},
|
|
30070
|
+
}), []);
|
|
30071
|
+
|
|
30072
|
+
const AccordionShowdownHandler = ({ buttonElement, contentElement, }) => {
|
|
30073
|
+
const [expanded, setExpanded] = useState(false);
|
|
30074
|
+
const handleClick = () => {
|
|
30075
|
+
const newExpanded = !expanded;
|
|
30076
|
+
const expandedModifier = 'pf-m-expanded';
|
|
30077
|
+
// Find the accordion item element (parent of the button)
|
|
30078
|
+
const accordionItem = buttonElement.closest('.pf-v6-c-accordion__item');
|
|
30079
|
+
// Update button - both visual state and aria-expanded
|
|
30080
|
+
buttonElement.className = `pf-v6-c-accordion__toggle ${newExpanded ? expandedModifier : ''}`;
|
|
30081
|
+
buttonElement.setAttribute('aria-expanded', newExpanded.toString());
|
|
30082
|
+
// Update content - both visual state and hidden attribute
|
|
30083
|
+
contentElement.hidden = !newExpanded;
|
|
30084
|
+
contentElement.className = `pf-v6-c-accordion__expandable-content ${newExpanded ? expandedModifier : ''}`;
|
|
30085
|
+
// Update accordion item
|
|
30086
|
+
if (accordionItem) {
|
|
30087
|
+
accordionItem.className = `pf-v6-c-accordion__item ${newExpanded ? expandedModifier : ''}`;
|
|
30088
|
+
}
|
|
30089
|
+
setExpanded(newExpanded);
|
|
30090
|
+
};
|
|
30091
|
+
useEventListener(buttonElement, 'click', handleClick);
|
|
30092
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
30093
|
+
};
|
|
30094
|
+
const AccordionRenderExtension = ({ docContext }) => {
|
|
30095
|
+
const buttonElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_BUTTON_ID}]`);
|
|
30096
|
+
const contentElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_CONTENT_ID}]`);
|
|
30097
|
+
return buttonElements.length > 0 ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from(buttonElements).map((elm) => {
|
|
30098
|
+
const content = Array.from(contentElements).find((elm2) => {
|
|
30099
|
+
const elmId = elm.id.split(ACCORDION_MARKDOWN_BUTTON_ID)[1];
|
|
30100
|
+
const elm2Id = elm2.id.split(ACCORDION_MARKDOWN_CONTENT_ID)[1];
|
|
30101
|
+
return elmId === elm2Id;
|
|
30102
|
+
});
|
|
30103
|
+
return (jsxRuntime.jsx(AccordionShowdownHandler, { buttonElement: elm, contentElement: content }, elm.id.split(ACCORDION_MARKDOWN_BUTTON_ID)[1]));
|
|
30104
|
+
}) })) : null;
|
|
30105
|
+
};
|
|
30106
|
+
|
|
30107
|
+
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
30108
|
+
const [isSrcValid, setIsSrcValid] = useState(true);
|
|
30109
|
+
if (src && isSrcValid) {
|
|
30110
|
+
return jsxRuntime.jsx("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
|
|
30111
|
+
}
|
|
30112
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: fallback });
|
|
30113
|
+
};
|
|
30114
|
+
|
|
30115
|
+
var syncAltIcon = createCommonjsModule(function (module, exports) {
|
|
30116
|
+
exports.__esModule = true;
|
|
30117
|
+
exports.SyncAltIconConfig = {
|
|
30118
|
+
name: 'SyncAltIcon',
|
|
30119
|
+
height: 512,
|
|
30120
|
+
width: 512,
|
|
30121
|
+
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',
|
|
30122
|
+
yOffset: 0,
|
|
30123
|
+
xOffset: 0,
|
|
30124
|
+
};
|
|
30125
|
+
exports.SyncAltIcon = require$$0.createIcon(exports.SyncAltIconConfig);
|
|
30126
|
+
exports["default"] = exports.SyncAltIcon;
|
|
30127
|
+
});
|
|
30128
|
+
|
|
30129
|
+
var SyncAltIcon = /*@__PURE__*/getDefaultExportFromCjs(syncAltIcon);
|
|
30130
|
+
|
|
30131
|
+
const DASH = '-';
|
|
30132
|
+
|
|
30133
|
+
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 })) })));
|
|
30134
|
+
|
|
30135
|
+
const StatusIconAndText = ({ icon, title, spin, iconOnly, noTooltip, className, }) => {
|
|
30136
|
+
if (!title) {
|
|
30137
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: DASH });
|
|
30138
|
+
}
|
|
30139
|
+
return (jsxRuntime.jsxs("span", Object.assign({ className: css('pfext-icon-and-text', className), title: iconOnly && !noTooltip ? title : undefined }, { children: [icon &&
|
|
30140
|
+
cloneElement(icon, {
|
|
30141
|
+
className: css(spin && 'fa-spin', icon.props.className, !iconOnly && 'pfext-icon-and-text__icon pfext-icon-flex-child'),
|
|
30142
|
+
}), !iconOnly && jsxRuntime.jsx(CamelCaseWrap, { value: title, dataTest: "status-text" })] })));
|
|
30143
|
+
};
|
|
30144
|
+
|
|
30145
|
+
const GenericStatus = (props) => {
|
|
30146
|
+
const { Icon, children, popoverTitle, title, noTooltip, iconOnly } = props, restProps = __rest(props, ["Icon", "children", "popoverTitle", "title", "noTooltip", "iconOnly"]);
|
|
30147
|
+
const renderIcon = iconOnly && !noTooltip ? jsxRuntime.jsx(Icon, { title: title }) : jsxRuntime.jsx(Icon, {});
|
|
30148
|
+
const statusBody = (jsxRuntime.jsx(StatusIconAndText, Object.assign({}, restProps, { noTooltip: noTooltip, title: title, iconOnly: iconOnly, icon: renderIcon })));
|
|
30149
|
+
return Children.toArray(children).length ? (jsxRuntime.jsx(PopoverStatus, Object.assign({ title: popoverTitle || title }, restProps, { statusBody: statusBody }, { children: children }))) : (statusBody);
|
|
30150
|
+
};
|
|
30151
|
+
|
|
30152
|
+
var checkCircleIcon = createCommonjsModule(function (module, exports) {
|
|
30153
|
+
exports.__esModule = true;
|
|
30154
|
+
exports.CheckCircleIconConfig = {
|
|
30155
|
+
name: 'CheckCircleIcon',
|
|
30156
|
+
height: 512,
|
|
30157
|
+
width: 512,
|
|
30158
|
+
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',
|
|
30159
|
+
yOffset: 0,
|
|
30160
|
+
xOffset: 0,
|
|
30161
|
+
};
|
|
30162
|
+
exports.CheckCircleIcon = require$$0.createIcon(exports.CheckCircleIconConfig);
|
|
30163
|
+
exports["default"] = exports.CheckCircleIcon;
|
|
30164
|
+
});
|
|
30165
|
+
|
|
30166
|
+
var CheckCircleIcon = /*@__PURE__*/getDefaultExportFromCjs(checkCircleIcon);
|
|
30167
|
+
|
|
30168
|
+
var infoCircleIcon = createCommonjsModule(function (module, exports) {
|
|
30169
|
+
exports.__esModule = true;
|
|
30170
|
+
exports.InfoCircleIconConfig = {
|
|
30171
|
+
name: 'InfoCircleIcon',
|
|
30172
|
+
height: 512,
|
|
30173
|
+
width: 512,
|
|
30174
|
+
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',
|
|
30175
|
+
yOffset: 0,
|
|
30176
|
+
xOffset: 0,
|
|
30177
|
+
};
|
|
30178
|
+
exports.InfoCircleIcon = require$$0.createIcon(exports.InfoCircleIconConfig);
|
|
30179
|
+
exports["default"] = exports.InfoCircleIcon;
|
|
30180
|
+
});
|
|
30181
|
+
|
|
30182
|
+
var InfoCircleIcon = /*@__PURE__*/getDefaultExportFromCjs(infoCircleIcon);
|
|
30183
|
+
|
|
30184
|
+
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 }) })));
|
|
30185
|
+
|
|
30186
|
+
const SuccessStatus = (props) => (jsxRuntime.jsx(GenericStatus, Object.assign({}, props, { Icon: GreenCheckCircleIcon, title: props.title || 'Healthy' })));
|
|
30187
|
+
SuccessStatus.displayName = 'SuccessStatus';
|
|
30188
|
+
|
|
30189
|
+
const Status = ({ status, title, iconOnly, noTooltip, className }) => {
|
|
30190
|
+
const statusProps = { title: title || status, iconOnly, noTooltip, className };
|
|
30191
|
+
switch (status) {
|
|
30192
|
+
case 'In Progress':
|
|
30193
|
+
return jsxRuntime.jsx(StatusIconAndText, Object.assign({}, statusProps, { icon: jsxRuntime.jsx(SyncAltIcon, {}) }));
|
|
30194
|
+
case 'Complete':
|
|
30195
|
+
return jsxRuntime.jsx(SuccessStatus, Object.assign({}, statusProps));
|
|
30196
|
+
default:
|
|
30197
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: status || DASH });
|
|
30198
|
+
}
|
|
30199
|
+
};
|
|
30200
|
+
const StatusIcon = ({ status }) => jsxRuntime.jsx(Status, { status: status, iconOnly: true });
|
|
30201
|
+
|
|
30010
30202
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30011
30203
|
const DOMPurify = require('dompurify');
|
|
30012
30204
|
const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -30018,7 +30210,7 @@ const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void
|
|
|
30018
30210
|
node.setAttribute('rel', 'noopener noreferrer');
|
|
30019
30211
|
return node;
|
|
30020
30212
|
}
|
|
30021
|
-
// add PF content classes
|
|
30213
|
+
// add PF content classes to standard elements (details blocks get handled separately)
|
|
30022
30214
|
if (node.nodeType === 1) {
|
|
30023
30215
|
const contentElements = [
|
|
30024
30216
|
'ul',
|
|
@@ -30069,13 +30261,82 @@ const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void
|
|
|
30069
30261
|
const reversedMarkdown = reverseString(markdown);
|
|
30070
30262
|
const reverseMarkdownWithSubstitutedCodeFences = reversedMarkdown.replace(/{{```((.|\n)*?)```/g, '{{@@@$1@@@');
|
|
30071
30263
|
const markdownWithSubstitutedCodeFences = reverseString(reverseMarkdownWithSubstitutedCodeFences);
|
|
30072
|
-
|
|
30264
|
+
// Fix malformed HTML entities early in the process
|
|
30265
|
+
let preprocessedMarkdown = markdownWithSubstitutedCodeFences;
|
|
30266
|
+
preprocessedMarkdown = preprocessedMarkdown
|
|
30267
|
+
.replace(/ ([^;])/g, ' $1')
|
|
30268
|
+
.replace(/&nbsp;/g, ' ');
|
|
30269
|
+
preprocessedMarkdown = preprocessedMarkdown.replace(/ (?![;])/g, ' ');
|
|
30270
|
+
// Process content in segments to ensure markdown parsing continues after HTML blocks
|
|
30271
|
+
const htmlBlockRegex = /(<(?:details|div|section|article)[^>]*>[\s\S]*?<\/(?:details|div|section|article)>)/g;
|
|
30272
|
+
let parsedMarkdown = '';
|
|
30273
|
+
// Check if there are any HTML blocks
|
|
30274
|
+
if (htmlBlockRegex.test(preprocessedMarkdown)) {
|
|
30275
|
+
// Reset regex for actual processing
|
|
30276
|
+
htmlBlockRegex.lastIndex = 0;
|
|
30277
|
+
let lastIndex = 0;
|
|
30278
|
+
let match;
|
|
30279
|
+
while ((match = htmlBlockRegex.exec(preprocessedMarkdown)) !== null) {
|
|
30280
|
+
// Process markdown before the HTML block
|
|
30281
|
+
const markdownBefore = preprocessedMarkdown.slice(lastIndex, match.index).trim();
|
|
30282
|
+
if (markdownBefore) {
|
|
30283
|
+
const parsed = yield marked.parse(markdownBefore);
|
|
30284
|
+
parsedMarkdown += parsed;
|
|
30285
|
+
}
|
|
30286
|
+
// Process the HTML block: parse markdown content inside while preserving HTML structure
|
|
30287
|
+
let htmlBlock = match[1];
|
|
30288
|
+
// Find and process markdown content inside HTML tags
|
|
30289
|
+
const contentRegex = />(\s*[\s\S]*?)\s*</g;
|
|
30290
|
+
const contentMatches = [];
|
|
30291
|
+
let contentMatch;
|
|
30292
|
+
while ((contentMatch = contentRegex.exec(htmlBlock)) !== null) {
|
|
30293
|
+
const content = contentMatch[1];
|
|
30294
|
+
// Only process content that has markdown formatting but no extension syntax
|
|
30295
|
+
if (content.trim() &&
|
|
30296
|
+
!content.includes('{{') &&
|
|
30297
|
+
(content.includes('**') || content.includes('- ') || content.includes('\n'))) {
|
|
30298
|
+
// This looks like markdown content without extensions - parse it as block content
|
|
30299
|
+
const parsedContent = yield marked.parse(content.trim());
|
|
30300
|
+
// Remove wrapping <p> tags if they exist since we're inside HTML already
|
|
30301
|
+
const cleanedContent = parsedContent.replace(/^<p[^>]*>([\s\S]*)<\/p>[\s]*$/g, '$1');
|
|
30302
|
+
contentMatches.push({
|
|
30303
|
+
original: contentMatch[0],
|
|
30304
|
+
replacement: `>${cleanedContent}<`,
|
|
30305
|
+
});
|
|
30306
|
+
}
|
|
30307
|
+
}
|
|
30308
|
+
// Apply the content replacements
|
|
30309
|
+
contentMatches.forEach(({ original, replacement }) => {
|
|
30310
|
+
htmlBlock = htmlBlock.replace(original, replacement);
|
|
30311
|
+
});
|
|
30312
|
+
// Apply extensions (like admonitions) to the processed HTML block
|
|
30313
|
+
if (extensions) {
|
|
30314
|
+
extensions.forEach(({ regex, replace }) => {
|
|
30315
|
+
if (regex) {
|
|
30316
|
+
htmlBlock = htmlBlock.replace(regex, replace);
|
|
30317
|
+
}
|
|
30318
|
+
});
|
|
30319
|
+
}
|
|
30320
|
+
parsedMarkdown += htmlBlock;
|
|
30321
|
+
lastIndex = htmlBlockRegex.lastIndex;
|
|
30322
|
+
}
|
|
30323
|
+
// Process any remaining markdown after the last HTML block
|
|
30324
|
+
const markdownAfter = preprocessedMarkdown.slice(lastIndex).trim();
|
|
30325
|
+
if (markdownAfter) {
|
|
30326
|
+
const parsed = yield marked.parse(markdownAfter);
|
|
30327
|
+
parsedMarkdown += parsed;
|
|
30328
|
+
}
|
|
30329
|
+
}
|
|
30330
|
+
else {
|
|
30331
|
+
// No HTML blocks found, process normally
|
|
30332
|
+
parsedMarkdown = yield marked.parse(preprocessedMarkdown);
|
|
30333
|
+
}
|
|
30073
30334
|
// Swap the temporary tokens back to code fences before we run the extensions
|
|
30074
30335
|
let md = parsedMarkdown.replace(/@@@/g, '```');
|
|
30075
30336
|
if (extensions) {
|
|
30076
30337
|
// Convert code spans back to md format before we run the custom extension regexes
|
|
30077
30338
|
md = md.replace(/<code>(.*)<\/code>/g, '`$1`');
|
|
30078
|
-
extensions.forEach(({ regex, replace }) => {
|
|
30339
|
+
extensions.forEach(({ regex, replace }, _index) => {
|
|
30079
30340
|
if (regex) {
|
|
30080
30341
|
md = md.replace(regex, replace);
|
|
30081
30342
|
}
|
|
@@ -30140,7 +30401,7 @@ const RenderExtension = ({ renderExtension, selector, markup, docContext, }) =>
|
|
|
30140
30401
|
};
|
|
30141
30402
|
const InlineMarkdownView = ({ markup, isEmpty, renderExtension, className, }) => {
|
|
30142
30403
|
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 }))] })));
|
|
30404
|
+
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
30405
|
};
|
|
30145
30406
|
const IFrameMarkdownView = ({ exactHeight, markup, isEmpty, renderExtension, className, }) => {
|
|
30146
30407
|
const [frame, setFrame] = useState();
|
|
@@ -30199,7 +30460,7 @@ const IFrameMarkdownView = ({ exactHeight, markup, isEmpty, renderExtension, cla
|
|
|
30199
30460
|
}
|
|
30200
30461
|
</style>
|
|
30201
30462
|
<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) => {
|
|
30463
|
+
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
30464
|
setFrame(r);
|
|
30204
30465
|
}, onLoad: () => onLoad(), className: className }), loaded && frame && renderExtension && (jsxRuntime.jsx(RenderExtension, { markup: markup, selector: '', renderExtension: renderExtension, docContext: frame.contentDocument }))] }));
|
|
30205
30466
|
};
|
|
@@ -30247,179 +30508,6 @@ const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
|
30247
30508
|
markdown.renderExtension(docContext, rootSelector)] })), className: className }));
|
|
30248
30509
|
};
|
|
30249
30510
|
|
|
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
30511
|
const QuickStartTileDescription = ({ description, prerequisites, }) => {
|
|
30424
30512
|
const { getResource } = useContext(QuickStartContext);
|
|
30425
30513
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
@@ -30570,7 +30658,7 @@ const QuickStartCatalogFilterSelect = (_a) => {
|
|
|
30570
30658
|
};
|
|
30571
30659
|
const QuickStartCatalogFilterCount = ({ quickStartsCount }) => {
|
|
30572
30660
|
const { getResource } = useContext(QuickStartContext);
|
|
30573
|
-
return (jsxRuntime.jsx(ToolbarItem, Object.assign({ align: { default: 'alignEnd' } }, { children: getResource(
|
|
30661
|
+
return (jsxRuntime.jsx(ToolbarItem, Object.assign({ align: { default: 'alignEnd' } }, { children: getResource("{{count, number}} item", quickStartsCount).replace('{{count, number}}', quickStartsCount) })));
|
|
30574
30662
|
};
|
|
30575
30663
|
const QuickStartCatalogFilterSearchWrapper = ({ onSearchInputChange = () => { } }) => {
|
|
30576
30664
|
const { useQueryParams, filter, setFilter } = useContext(QuickStartContext);
|
|
@@ -30800,7 +30888,7 @@ const QuickStartIntroduction = ({ tasks, introduction, allTaskStatuses, prerequi
|
|
|
30800
30888
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
30801
30889
|
const [isPrereqsExpanded, setIsPrereqsExpanded] = useState(false);
|
|
30802
30890
|
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 })] })));
|
|
30891
|
+
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
30892
|
};
|
|
30805
30893
|
|
|
30806
30894
|
const getAlertVariant = (status) => {
|
|
@@ -30973,10 +31061,7 @@ const QuickStartPanelContent = (_a) => {
|
|
|
30973
31061
|
const QuickStartDrawerContent = (_a) => {
|
|
30974
31062
|
var { quickStarts = [], appendTo, fullWidth, handleDrawerClose } = _a, props = __rest(_a, ["quickStarts", "appendTo", "fullWidth", "handleDrawerClose"]);
|
|
30975
31063
|
const { activeQuickStartID, allQuickStarts = [], activeQuickStartState, } = useContext(QuickStartContext);
|
|
30976
|
-
const combinedQuickStarts = [
|
|
30977
|
-
...allQuickStarts,
|
|
30978
|
-
...quickStarts,
|
|
30979
|
-
].filter((qs, idx, arr) => arr.findIndex(q => q.metadata.name === qs.metadata.name) === idx);
|
|
31064
|
+
const combinedQuickStarts = [...allQuickStarts, ...quickStarts].filter((qs, idx, arr) => arr.findIndex((q) => q.metadata.name === qs.metadata.name) === idx);
|
|
30980
31065
|
const handleClose = () => {
|
|
30981
31066
|
handleDrawerClose && handleDrawerClose(activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.status);
|
|
30982
31067
|
};
|