@patternfly/quickstarts 2.2.1 → 2.2.4
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/README.md +20 -20
- package/dist/ConsoleShared/src/components/markdown-extensions/code-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/index.d.ts +1 -0
- package/dist/HelpTopicDrawer.d.ts +8 -2
- package/dist/QuickStartDrawer.d.ts +21 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +127 -21
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +126 -19
- package/dist/index.js.map +1 -1
- package/dist/patternfly-docs/quick-starts/design-guidelines/design-guidelines.md +105 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/card-elements copy.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/card-elements.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/catalog-elements.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/check-your-work.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/introduction-screen.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/mixed-catalog.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/prerequisites.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/qs-context.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/side-panel-elements.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/side-panel-resized.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/side-panel.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/task-no.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/task-yes.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/task.png +0 -0
- package/dist/patternfly-docs/quick-starts/examples/Basic.jsx +73 -0
- package/dist/patternfly-docs/quick-starts/examples/HelpTopic.jsx +53 -0
- package/dist/patternfly-docs/quick-starts/examples/about.md +77 -0
- package/dist/patternfly-docs/quick-starts/examples/basic.md +27 -0
- package/dist/patternfly-docs/quick-starts/examples/example-data/example-help-topics.js +173 -0
- package/dist/patternfly-docs/quick-starts/examples/example-data/example-quickstarts.js +215 -0
- package/dist/patternfly-docs/quick-starts/examples/example-data/index.js +15 -0
- package/dist/patternfly-docs/quick-starts/examples/help-topics.md +25 -0
- package/dist/patternfly-docs/quick-starts/examples/img/catalog.png +0 -0
- package/dist/patternfly-docs/quick-starts/examples/img/help-topic.png +0 -0
- package/dist/patternfly-docs/quick-starts/examples/img/side-panel.png +0 -0
- package/dist/patternfly-nested.css +11 -1
- package/dist/quickstarts-base.css +49 -11
- package/dist/quickstarts-full.es.js +451 -305
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts-standalone.css +5 -15
- package/dist/quickstarts-standalone.min.css +1 -1
- package/dist/quickstarts.css +49 -11
- package/dist/quickstarts.min.css +1 -1
- package/dist/utils/asciidoc-procedure-parser.d.ts +12 -0
- package/dist/utils/help-topic-types.d.ts +7 -1
- package/package.json +11 -4
- package/src/ConsoleInternal/components/_icon-and-text.scss +14 -0
- package/src/ConsoleInternal/components/_markdown-view.scss +19 -0
- package/src/ConsoleInternal/components/catalog/_catalog.scss +390 -0
- package/src/ConsoleInternal/components/markdown-view.tsx +305 -0
- package/src/ConsoleInternal/components/utils/_status-box.scss +58 -0
- package/src/ConsoleInternal/components/utils/camel-case-wrap.tsx +33 -0
- package/src/ConsoleInternal/components/utils/index.tsx +3 -0
- package/src/ConsoleInternal/components/utils/router.ts +47 -0
- package/src/ConsoleInternal/components/utils/status-box.tsx +94 -0
- package/src/ConsoleInternal/module/k8s/types.ts +53 -0
- package/src/ConsoleShared/index.ts +1 -0
- package/src/ConsoleShared/src/components/index.ts +7 -0
- package/src/ConsoleShared/src/components/layout/PageLayout.scss +29 -0
- package/src/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.tsx +93 -0
- package/src/ConsoleShared/src/components/markdown-extensions/__tests__/MarkdownCopyClipboard.spec.tsx +25 -0
- package/src/ConsoleShared/src/components/markdown-extensions/__tests__/test-data.ts +5 -0
- package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +66 -0
- package/src/ConsoleShared/src/components/markdown-extensions/code-extension.tsx +25 -0
- package/src/ConsoleShared/src/components/markdown-extensions/const.ts +3 -0
- package/src/ConsoleShared/src/components/markdown-extensions/index.ts +5 -0
- package/src/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.tsx +45 -0
- package/src/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.tsx +50 -0
- package/src/ConsoleShared/src/components/markdown-extensions/showdown-extension.scss +52 -0
- package/src/ConsoleShared/src/components/markdown-extensions/utils.ts +3 -0
- package/src/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.tsx +64 -0
- package/src/ConsoleShared/src/components/markdown-highlight-extension/highlight-consts.ts +9 -0
- package/src/ConsoleShared/src/components/markdown-highlight-extension/index.ts +1 -0
- package/src/ConsoleShared/src/components/modal/Modal.scss +3 -0
- package/src/ConsoleShared/src/components/modal/Modal.tsx +19 -0
- package/src/ConsoleShared/src/components/modal/index.ts +1 -0
- package/src/ConsoleShared/src/components/popper/Portal.tsx +23 -0
- package/src/ConsoleShared/src/components/popper/SimplePopper.tsx +90 -0
- package/src/ConsoleShared/src/components/popper/index.ts +2 -0
- package/src/ConsoleShared/src/components/spotlight/InteractiveSpotlight.tsx +58 -0
- package/src/ConsoleShared/src/components/spotlight/Spotlight.tsx +35 -0
- package/src/ConsoleShared/src/components/spotlight/StaticSpotlight.tsx +32 -0
- package/src/ConsoleShared/src/components/spotlight/index.ts +1 -0
- package/src/ConsoleShared/src/components/spotlight/spotlight.scss +63 -0
- package/src/ConsoleShared/src/components/status/GenericStatus.tsx +33 -0
- package/src/ConsoleShared/src/components/status/NotStartedIcon.tsx +27 -0
- package/src/ConsoleShared/src/components/status/PopoverStatus.tsx +42 -0
- package/src/ConsoleShared/src/components/status/Status.tsx +38 -0
- package/src/ConsoleShared/src/components/status/StatusIconAndText.tsx +42 -0
- package/src/ConsoleShared/src/components/status/icons.tsx +77 -0
- package/src/ConsoleShared/src/components/status/index.tsx +1 -0
- package/src/ConsoleShared/src/components/status/statuses.tsx +36 -0
- package/src/ConsoleShared/src/components/status/types.ts +7 -0
- package/src/ConsoleShared/src/components/utils/FallbackImg.tsx +20 -0
- package/src/ConsoleShared/src/components/utils/index.ts +1 -0
- package/src/ConsoleShared/src/constants/index.ts +1 -0
- package/src/ConsoleShared/src/constants/ui.ts +1 -0
- package/src/ConsoleShared/src/hooks/index.ts +6 -0
- package/src/ConsoleShared/src/hooks/scroll.ts +52 -0
- package/src/ConsoleShared/src/hooks/useBoundingClientRect.ts +18 -0
- package/src/ConsoleShared/src/hooks/useEventListener.ts +14 -0
- package/src/ConsoleShared/src/hooks/useForceRender.ts +6 -0
- package/src/ConsoleShared/src/hooks/useResizeObserver.ts +20 -0
- package/src/ConsoleShared/src/hooks/useScrollShadows.ts +45 -0
- package/src/ConsoleShared/src/index.ts +4 -0
- package/src/ConsoleShared/src/utils/index.ts +1 -0
- package/src/ConsoleShared/src/utils/useCombineRefs.ts +17 -0
- package/src/HelpTopicDrawer.tsx +124 -0
- package/src/HelpTopicPanelContent.tsx +152 -0
- package/src/QuickStartCatalogPage.tsx +190 -0
- package/src/QuickStartCloseModal.tsx +47 -0
- package/src/QuickStartController.tsx +113 -0
- package/src/QuickStartDrawer.scss +11 -0
- package/src/QuickStartDrawer.tsx +265 -0
- package/src/QuickStartMarkdownView.tsx +75 -0
- package/src/QuickStartPanelContent.scss +46 -0
- package/src/QuickStartPanelContent.tsx +153 -0
- package/src/__tests__/quick-start-utils.spec.tsx +16 -0
- package/src/catalog/Catalog/QuickStartCatalogHeader.tsx +18 -0
- package/src/catalog/Catalog/QuickStartCatalogSection.tsx +9 -0
- package/src/catalog/Catalog/QuickStartCatalogToolbar.tsx +12 -0
- package/src/catalog/Catalog/index.ts +3 -0
- package/src/catalog/QuickStartCatalog.scss +8 -0
- package/src/catalog/QuickStartCatalog.tsx +42 -0
- package/src/catalog/QuickStartTile.scss +11 -0
- package/src/catalog/QuickStartTile.tsx +105 -0
- package/src/catalog/QuickStartTileDescription.scss +29 -0
- package/src/catalog/QuickStartTileDescription.tsx +79 -0
- package/src/catalog/QuickStartTileFooter.tsx +101 -0
- package/src/catalog/QuickStartTileFooterExternal.tsx +40 -0
- package/src/catalog/QuickStartTileHeader.scss +12 -0
- package/src/catalog/QuickStartTileHeader.tsx +77 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilter.scss +25 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilter.tsx +34 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +199 -0
- package/src/catalog/__tests__/QuickStartCatalog.spec.tsx +35 -0
- package/src/catalog/__tests__/QuickStartTile.spec.tsx +38 -0
- package/src/catalog/__tests__/QuickStartTileDescription.spec.tsx +44 -0
- package/src/catalog/index.ts +9 -0
- package/src/controller/QuickStartConclusion.tsx +63 -0
- package/src/controller/QuickStartContent.scss +12 -0
- package/src/controller/QuickStartContent.tsx +72 -0
- package/src/controller/QuickStartFooter.scss +13 -0
- package/src/controller/QuickStartFooter.tsx +128 -0
- package/src/controller/QuickStartIntroduction.scss +35 -0
- package/src/controller/QuickStartIntroduction.tsx +66 -0
- package/src/controller/QuickStartTaskHeader.scss +58 -0
- package/src/controller/QuickStartTaskHeader.tsx +116 -0
- package/src/controller/QuickStartTaskHeaderList.scss +17 -0
- package/src/controller/QuickStartTaskHeaderList.tsx +35 -0
- package/src/controller/QuickStartTaskReview.scss +30 -0
- package/src/controller/QuickStartTaskReview.tsx +81 -0
- package/src/controller/QuickStartTasks.scss +89 -0
- package/src/controller/QuickStartTasks.tsx +75 -0
- package/src/controller/__tests__/QuickStartConclusion.spec.tsx +95 -0
- package/src/controller/__tests__/QuickStartContent.spec.tsx +52 -0
- package/src/controller/__tests__/QuickStartFooter.spec.tsx +148 -0
- package/src/controller/__tests__/QuickStartTaskHeader.spec.tsx +56 -0
- package/src/controller/__tests__/QuickStartTaskReview.spec.tsx +45 -0
- package/src/controller/__tests__/QuickStartTasks.spec.tsx +81 -0
- package/src/data/mocks/json/explore-pipeline-quickstart.ts +66 -0
- package/src/data/mocks/json/explore-serverless-quickstart.ts +90 -0
- package/src/data/mocks/json/monitor-sampleapp-quickstart.ts +77 -0
- package/src/data/mocks/json/tour-icons.ts +3 -0
- package/src/data/mocks/yamls/add-healthchecks-quickstart.yaml +67 -0
- package/src/data/mocks/yamls/explore-pipeline-quickstart.yaml +57 -0
- package/src/data/mocks/yamls/explore-serverless-quickstart.yaml +83 -0
- package/src/data/mocks/yamls/install-associate-pipeline-quickstart.yaml +74 -0
- package/src/data/mocks/yamls/monitor-sampleapp-quickstart.yaml +66 -0
- package/src/data/mocks/yamls/sample-application-quickstart.yaml +97 -0
- package/src/data/mocks/yamls/serverless-application-quickstart.yaml +141 -0
- package/src/data/quick-start-test-data.ts +10 -0
- package/src/data/test-utils.ts +11 -0
- package/src/declaration.d.ts +2 -0
- package/src/index.ts +17 -0
- package/src/locales/en/quickstart.json +46 -0
- package/src/styles/_base.scss +54 -0
- package/src/styles/_dark-custom-override.scss +62 -0
- package/src/styles/legacy-bootstrap/README.md +21 -0
- package/src/styles/legacy-bootstrap/_code.scss +44 -0
- package/src/styles/legacy-bootstrap/_tables.scss +38 -0
- package/src/styles/legacy-bootstrap/_type.scss +90 -0
- package/src/styles/legacy-bootstrap/_variables.scss +48 -0
- package/src/styles/legacy-bootstrap.scss +5 -0
- package/src/styles/patternfly-global-entry.ts +1 -0
- package/src/styles/patternfly-global.scss +28 -0
- package/src/styles/patternfly-nested-entry.ts +1 -0
- package/src/styles/patternfly-nested.scss +18 -0
- package/src/styles/quickstarts-standalone-entry.ts +1 -0
- package/src/styles/quickstarts-standalone.scss +7 -0
- package/src/styles/style.scss +12 -0
- package/src/styles/vendor-entry.ts +1 -0
- package/src/styles/vendor.scss +7 -0
- package/src/utils/PluralResolver.ts +356 -0
- package/src/utils/asciidoc-procedure-parser.ts +132 -0
- package/src/utils/const.ts +10 -0
- package/src/utils/help-topic-context.tsx +74 -0
- package/src/utils/help-topic-types.ts +16 -0
- package/src/utils/quick-start-context.tsx +477 -0
- package/src/utils/quick-start-types.ts +72 -0
- package/src/utils/quick-start-utils.ts +92 -0
- package/src/utils/useLocalStorage.ts +38 -0
package/dist/index.js
CHANGED
|
@@ -1357,6 +1357,20 @@ const useAdmonitionShowdownExtension = () => {
|
|
|
1357
1357
|
}), []);
|
|
1358
1358
|
};
|
|
1359
1359
|
|
|
1360
|
+
const useCodeShowdownExtension = () => {
|
|
1361
|
+
return React__namespace.useMemo(() => ({
|
|
1362
|
+
type: 'output',
|
|
1363
|
+
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
1364
|
+
replace: (text, content) => {
|
|
1365
|
+
if (!content) {
|
|
1366
|
+
return text;
|
|
1367
|
+
}
|
|
1368
|
+
const pfCodeBlock = React__namespace.createElement(reactCore.CodeBlock, null, content);
|
|
1369
|
+
return removeTemplateWhitespace(server.renderToStaticMarkup(pfCodeBlock));
|
|
1370
|
+
},
|
|
1371
|
+
}), []);
|
|
1372
|
+
};
|
|
1373
|
+
|
|
1360
1374
|
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
1361
1375
|
const [isSrcValid, setIsSrcValid] = React__namespace.useState(true);
|
|
1362
1376
|
if (src && isSrcValid) {
|
|
@@ -1597,6 +1611,7 @@ const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
|
1597
1611
|
const inlineCopyClipboardShowdownExtension = useInlineCopyClipboardShowdownExtension();
|
|
1598
1612
|
const multilineCopyClipboardShowdownExtension = useMultilineCopyClipboardShowdownExtension();
|
|
1599
1613
|
const admonitionShowdownExtension = useAdmonitionShowdownExtension();
|
|
1614
|
+
const codeShowdownExtension = useCodeShowdownExtension();
|
|
1600
1615
|
return (React__namespace.createElement(SyncMarkdownView, { inline: true, content: content, exactHeight: exactHeight, extensions: [
|
|
1601
1616
|
{
|
|
1602
1617
|
type: 'lang',
|
|
@@ -1619,6 +1634,7 @@ const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
|
1619
1634
|
inlineCopyClipboardShowdownExtension,
|
|
1620
1635
|
multilineCopyClipboardShowdownExtension,
|
|
1621
1636
|
admonitionShowdownExtension,
|
|
1637
|
+
codeShowdownExtension,
|
|
1622
1638
|
...(markdown ? markdown.extensions : []),
|
|
1623
1639
|
], renderExtension: (docContext, rootSelector) => (React__namespace.createElement(React__namespace.Fragment, null,
|
|
1624
1640
|
React__namespace.createElement(MarkdownHighlightExtension, { docContext: docContext, rootSelector: rootSelector }),
|
|
@@ -1738,7 +1754,7 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, })
|
|
|
1738
1754
|
|
|
1739
1755
|
const QuickStartCatalog = ({ quickStarts }) => {
|
|
1740
1756
|
const { activeQuickStartID, allQuickStartStates } = React__namespace.useContext(QuickStartContext);
|
|
1741
|
-
return (React__namespace.createElement("div", { className: "pfext-page-layout__content
|
|
1757
|
+
return (React__namespace.createElement("div", { className: "pfext-page-layout__content" },
|
|
1742
1758
|
React__namespace.createElement(reactCore.Gallery, { className: "pfext-quick-start-catalog__gallery", hasGutter: true }, quickStarts.map((quickStart) => {
|
|
1743
1759
|
const { metadata: { name: id }, } = quickStart;
|
|
1744
1760
|
return (React__namespace.createElement(reactCore.GalleryItem, { key: id, className: "pfext-quick-start-catalog__gallery-item" },
|
|
@@ -1943,7 +1959,7 @@ const QuickStartCatalogHeader = ({ title, hint, }) => (React__namespace.createEl
|
|
|
1943
1959
|
React__namespace.createElement("h1", { "data-pf-content": "true", className: "pfext-page-layout__title" }, title),
|
|
1944
1960
|
hint && React__namespace.createElement("div", { className: "pfext-page-layout__hint" }, hint)));
|
|
1945
1961
|
|
|
1946
|
-
const QuickStartCatalogSection = ({ children }) => (React__namespace.createElement("div", { className: "pfext-page-layout__content
|
|
1962
|
+
const QuickStartCatalogSection = ({ children }) => (React__namespace.createElement("div", { className: "pfext-page-layout__content" }, children));
|
|
1947
1963
|
|
|
1948
1964
|
const QuickStartCatalogToolbar = ({ children }) => (React__namespace.createElement(reactCore.Toolbar, { usePageInsets: true, className: "pfext-quick-start-catalog-filter__flex" }, children));
|
|
1949
1965
|
|
|
@@ -2378,6 +2394,7 @@ const useValuesForHelpTopicContext = (value = {}) => {
|
|
|
2378
2394
|
};
|
|
2379
2395
|
|
|
2380
2396
|
const HelpTopicPanelContent = (_a) => {
|
|
2397
|
+
var _b, _c;
|
|
2381
2398
|
var { activeHelpTopic = null, filteredHelpTopics = [], isResizable = true, onClose } = _a, props = tslib.__rest(_a, ["activeHelpTopic", "filteredHelpTopics", "isResizable", "onClose"]);
|
|
2382
2399
|
const { setActiveHelpTopicByName } = React__namespace.useContext(HelpTopicContext);
|
|
2383
2400
|
const [isHelpTopicMenuOpen, setIsHelpTopicMenuOpen] = React__namespace.useState(false);
|
|
@@ -2396,10 +2413,11 @@ const HelpTopicPanelContent = (_a) => {
|
|
|
2396
2413
|
const paddingContainer = (children) => React__namespace.createElement("div", { style: { padding: '24px' } }, children);
|
|
2397
2414
|
const panelBodyItems = (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2398
2415
|
paddingContainer(React__namespace.createElement(QuickStartMarkdownView, { content: activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.content })),
|
|
2399
|
-
React__namespace.createElement(reactCore.Divider, null),
|
|
2400
|
-
paddingContainer(activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links.map((
|
|
2401
|
-
return React__namespace.createElement(
|
|
2402
|
-
|
|
2416
|
+
((_b = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _b === void 0 ? void 0 : _b.length) && React__namespace.createElement(reactCore.Divider, null),
|
|
2417
|
+
paddingContainer(React__namespace.createElement(reactCore.Stack, { hasGutter: true }, (_c = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _c === void 0 ? void 0 : _c.map(({ href, text, newTab, isExternal }, index) => {
|
|
2418
|
+
return (React__namespace.createElement(reactCore.StackItem, { key: index },
|
|
2419
|
+
React__namespace.createElement(reactCore.Button, { component: "a", href: href, target: newTab ? '_blank' : '', rel: "noopener noreferrer", variant: "link", "aria-label": `Open documentation in new window`, isInline: true, icon: isExternal ? React__namespace.createElement(ExternalLinkAltIcon__default['default'], null) : null, iconPosition: "right", style: { fontSize: 'inherit' } }, text || href)));
|
|
2420
|
+
})))));
|
|
2403
2421
|
const content = (React__namespace.createElement(reactCore.DrawerPanelContent, Object.assign({ isResizable: isResizable, className: "pfext-quick-start__base" }, props),
|
|
2404
2422
|
React__namespace.createElement("div", null,
|
|
2405
2423
|
React__namespace.createElement(reactCore.DrawerHead, null,
|
|
@@ -2434,20 +2452,8 @@ const HelpTopicContainer = (_a) => {
|
|
|
2434
2452
|
React__namespace.createElement(HelpTopicDrawer, Object.assign({}, drawerProps), children)));
|
|
2435
2453
|
};
|
|
2436
2454
|
const HelpTopicDrawer = (_a) => {
|
|
2437
|
-
var {
|
|
2438
|
-
// helpTopics,
|
|
2439
|
-
children } = _a, props = tslib.__rest(_a, ["children"]);
|
|
2455
|
+
var { children } = _a, props = tslib.__rest(_a, ["children"]);
|
|
2440
2456
|
const { activeHelpTopic, filteredHelpTopics, setActiveHelpTopicByName } = React__namespace.useContext(HelpTopicContext);
|
|
2441
|
-
// Leave here if query param is desired for help topics later
|
|
2442
|
-
// React.useEffect(() => {
|
|
2443
|
-
// const params = new URLSearchParams(window.location.search);
|
|
2444
|
-
// // if there is a quick start param, but the quick start is not active, set it
|
|
2445
|
-
// // this can happen if a new browser session is opened or an incognito window for example
|
|
2446
|
-
// const helpTopicNameFromParam = params.get(HELP_TOPIC_NAME_KEY) || '';
|
|
2447
|
-
// if (helpTopicNameFromParam) {
|
|
2448
|
-
// setActiveHelpTopicByName(helpTopicNameFromParam);
|
|
2449
|
-
// }
|
|
2450
|
-
// }, [inContextHelpTopics, setActiveHelpTopicByName]);
|
|
2451
2457
|
const onClose = () => {
|
|
2452
2458
|
setActiveHelpTopicByName('');
|
|
2453
2459
|
};
|
|
@@ -2494,6 +2500,106 @@ const useLocalStorage = (key, initialValue) => {
|
|
|
2494
2500
|
return [storedValue, setValue];
|
|
2495
2501
|
};
|
|
2496
2502
|
|
|
2503
|
+
/* eslint-disable */
|
|
2504
|
+
// Brought in from dev to publish this with QS module
|
|
2505
|
+
// Dev now imports from here
|
|
2506
|
+
const ProcQuickStartParser = (quickStart, environmentVariables) => {
|
|
2507
|
+
var _a;
|
|
2508
|
+
const replaceEnvironmentVariables = (s) => s === null || s === void 0 ? void 0 : s.replace(/\${(\w+)}/, (substring, name) => {
|
|
2509
|
+
return environmentVariables ? ([name] ? environmentVariables[name] : substring) : substring;
|
|
2510
|
+
});
|
|
2511
|
+
quickStart.spec.tasks = (_a = quickStart.spec.tasks) === null || _a === void 0 ? void 0 : _a.map((task, index) => {
|
|
2512
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2513
|
+
let proc;
|
|
2514
|
+
let answer;
|
|
2515
|
+
if (typeof task === 'string') {
|
|
2516
|
+
proc = task;
|
|
2517
|
+
answer = {};
|
|
2518
|
+
}
|
|
2519
|
+
else {
|
|
2520
|
+
// @ts-ignore
|
|
2521
|
+
proc = task.proc;
|
|
2522
|
+
answer = task;
|
|
2523
|
+
// @ts-ignore
|
|
2524
|
+
delete task.proc;
|
|
2525
|
+
}
|
|
2526
|
+
let description = '', procedure, verification, title, summaryFailed, success, reviewFailed, prerequisites;
|
|
2527
|
+
if (proc) {
|
|
2528
|
+
const taskDOM = document.createElement('div');
|
|
2529
|
+
taskDOM.innerHTML = proc;
|
|
2530
|
+
// remove the screencapture images
|
|
2531
|
+
taskDOM.querySelectorAll('.imageblock.screencapture').forEach((node) => {
|
|
2532
|
+
var _a;
|
|
2533
|
+
(_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(node);
|
|
2534
|
+
});
|
|
2535
|
+
title = (_a = taskDOM
|
|
2536
|
+
.querySelector('h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child')) === null || _a === void 0 ? void 0 : _a.innerHTML.trim();
|
|
2537
|
+
let sectionBody = taskDOM.querySelector('.sectionbody');
|
|
2538
|
+
if (!(sectionBody === null || sectionBody === void 0 ? void 0 : sectionBody.hasChildNodes())) {
|
|
2539
|
+
// possibly in other templates, where we want to look for article
|
|
2540
|
+
sectionBody = taskDOM.querySelector('article');
|
|
2541
|
+
}
|
|
2542
|
+
if (sectionBody) {
|
|
2543
|
+
for (let i = 0; i < sectionBody.children.length || 0; i++) {
|
|
2544
|
+
/**
|
|
2545
|
+
child typically looks like:
|
|
2546
|
+
|
|
2547
|
+
<div class="paragraph|olist|ulist|admonitionblock">
|
|
2548
|
+
<div class="title">Procedure|Prerequisites|Verification|Note|Warning</div>
|
|
2549
|
+
<ol|ul class="arabic">
|
|
2550
|
+
<li>
|
|
2551
|
+
<li>...
|
|
2552
|
+
</ol|ul>
|
|
2553
|
+
</div>
|
|
2554
|
+
|
|
2555
|
+
And the below code extracts the <ol> or <ul>
|
|
2556
|
+
Except for when there is no <div class="title|heading"/>, then the description is extracted
|
|
2557
|
+
in the else if below
|
|
2558
|
+
*/
|
|
2559
|
+
const child = sectionBody.children.item(i);
|
|
2560
|
+
// find the title
|
|
2561
|
+
const sectionTitle = child === null || child === void 0 ? void 0 : child.querySelector('.heading,.title');
|
|
2562
|
+
// should this section be assigned to a specific section
|
|
2563
|
+
const sectionTitleText = (_b = sectionTitle === null || sectionTitle === void 0 ? void 0 : sectionTitle.textContent) === null || _b === void 0 ? void 0 : _b.trim();
|
|
2564
|
+
const isKnownSection = ['Procedure', 'Verification', 'Prerequisites'].includes((_c = sectionTitle === null || sectionTitle === void 0 ? void 0 : sectionTitle.textContent) === null || _c === void 0 ? void 0 : _c.trim());
|
|
2565
|
+
if (isKnownSection) {
|
|
2566
|
+
switch (sectionTitleText) {
|
|
2567
|
+
case 'Procedure':
|
|
2568
|
+
procedure = (_d = child === null || child === void 0 ? void 0 : child.querySelector(':not(.heading):not(.title)')) === null || _d === void 0 ? void 0 : _d.outerHTML.trim();
|
|
2569
|
+
break;
|
|
2570
|
+
case 'Verification':
|
|
2571
|
+
verification = (_e = child === null || child === void 0 ? void 0 : child.querySelector(':not(.heading):not(.title)')) === null || _e === void 0 ? void 0 : _e.outerHTML.trim();
|
|
2572
|
+
break;
|
|
2573
|
+
case 'Prerequisites':
|
|
2574
|
+
prerequisites = (_f = child === null || child === void 0 ? void 0 : child.querySelector(':not(.heading):not(.title)')) === null || _f === void 0 ? void 0 : _f.outerHTML.trim();
|
|
2575
|
+
break;
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
else if (!procedure) {
|
|
2579
|
+
// Otherwise if it comes before a procedure it's part of the description
|
|
2580
|
+
description = description + (child === null || child === void 0 ? void 0 : child.outerHTML.trim());
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
success = (_g = taskDOM.querySelector('.qs-summary.success')) === null || _g === void 0 ? void 0 : _g.innerHTML.trim();
|
|
2585
|
+
reviewFailed = (_h = taskDOM.querySelector('.qs-review.failed')) === null || _h === void 0 ? void 0 : _h.innerHTML.trim();
|
|
2586
|
+
summaryFailed = (_j = taskDOM.querySelector('.qs-summary.failed')) === null || _j === void 0 ? void 0 : _j.innerHTML.trim();
|
|
2587
|
+
}
|
|
2588
|
+
answer.title = replaceEnvironmentVariables(answer.title || title);
|
|
2589
|
+
answer.description = replaceEnvironmentVariables(answer.description || `${description} ${prerequisites || ''} ${procedure}`);
|
|
2590
|
+
answer.review = answer.review || {};
|
|
2591
|
+
answer.review.instructions = replaceEnvironmentVariables(((_k = answer.review) === null || _k === void 0 ? void 0 : _k.instructions) || verification || 'Have you completed these steps?');
|
|
2592
|
+
answer.review.failedTaskHelp = replaceEnvironmentVariables(answer.review.failedTaskHelp ||
|
|
2593
|
+
reviewFailed ||
|
|
2594
|
+
'This task isn’t verified yet. Try the task again.');
|
|
2595
|
+
answer.summary = answer.summary || {};
|
|
2596
|
+
answer.summary.success = replaceEnvironmentVariables(answer.summary.success || success || 'You have completed this task!');
|
|
2597
|
+
answer.summary.failed = replaceEnvironmentVariables(answer.summary.failed || summaryFailed || 'Try the steps again.');
|
|
2598
|
+
return answer;
|
|
2599
|
+
});
|
|
2600
|
+
return quickStart;
|
|
2601
|
+
};
|
|
2602
|
+
|
|
2497
2603
|
exports.Box = Box;
|
|
2498
2604
|
exports.CamelCaseWrap = CamelCaseWrap;
|
|
2499
2605
|
exports.EmptyBox = EmptyBox;
|
|
@@ -2504,6 +2610,7 @@ exports.HelpTopicContextDefaults = HelpTopicContextDefaults;
|
|
|
2504
2610
|
exports.HelpTopicDrawer = HelpTopicDrawer;
|
|
2505
2611
|
exports.Loading = Loading;
|
|
2506
2612
|
exports.LoadingBox = LoadingBox;
|
|
2613
|
+
exports.ProcQuickStartParser = ProcQuickStartParser;
|
|
2507
2614
|
exports.QUICKSTART_ID_FILTER_KEY = QUICKSTART_ID_FILTER_KEY;
|
|
2508
2615
|
exports.QUICKSTART_SEARCH_FILTER_KEY = QUICKSTART_SEARCH_FILTER_KEY;
|
|
2509
2616
|
exports.QUICKSTART_STATUS_FILTER_KEY = QUICKSTART_STATUS_FILTER_KEY;
|