@patternfly/quickstarts 2.2.2 → 2.3.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/README.md +4 -4
- package/dist/HelpTopicDrawer.d.ts +8 -2
- package/dist/QuickStartDrawer.d.ts +21 -2
- package/dist/controller/QuickStartTaskHeader.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +104 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +104 -3
- 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/quickstarts-full.es.js +104 -4
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/utils/asciidoc-procedure-parser.d.ts +12 -0
- 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/README.md
CHANGED
|
@@ -32,7 +32,7 @@ If you use an older version of @patternfly/react-core (older than "4.115.2"), an
|
|
|
32
32
|
|
|
33
33
|
Ideally @patternfly/quickstarts will use the consumer provided PatternFly styles, only use these stylesheets if really needed.
|
|
34
34
|
|
|
35
|
-
`quickstarts-standalone.min.css` nests the css classes within a **.pfext-quick-start__base** parent, so that they have higher specificity. `patternfly-global.css` includes component styles that we cannot nest with more
|
|
35
|
+
`quickstarts-standalone.min.css` nests the css classes within a **.pfext-quick-start__base** parent, so that they have higher specificity. `patternfly-global.css` includes component styles that we cannot nest with more specificity (for example Drawer since it can include consumer components that depend on an older PF version).
|
|
36
36
|
|
|
37
37
|
> Note: Only use these stylesheets if necessary!
|
|
38
38
|
```js
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
import { Button } from "@patternfly/react-core";
|
|
70
70
|
import jsYaml from "js-yaml";
|
|
71
71
|
// quick start files could be yaml files or js files, or really anything,
|
|
72
|
-
// as long as they get parsed out to the
|
|
72
|
+
// as long as they get parsed out to the expected JSON format
|
|
73
73
|
import quickstartOne from "./quick-starts/quickstart-one.yaml";
|
|
74
74
|
import quickstartTwo from "./quick-starts/quickstart-two.yaml";
|
|
75
75
|
import quickstartThree from "./quick-starts/quickstart-three";
|
|
@@ -253,7 +253,7 @@ return (
|
|
|
253
253
|
Use this [file](https://github.com/patternfly/patternfly-quickstarts/blob/main/packages/module/src/locales/en/quickstart.json) as a base for your translations.
|
|
254
254
|
Each language is different, especially when it comes to plurals. Try [this utility](https://jsfiddle.net/6bpxsgd4) sourced from [i18next](https://www.i18next.com/translation-function/plurals#how-to-find-the-correct-plural-suffix) to determine the suffixes for the right plural format.
|
|
255
255
|
|
|
256
|
-
For localizing the content of quick starts files, we provide the option to include `language` and `countryCode` key to your translated file. Based on these keys you can filter out quick starts. We have a demo of this
|
|
256
|
+
For localizing the content of quick starts files, we provide the option to include `language` and `countryCode` key to your translated file. Based on these keys you can filter out quick starts. We have a demo of this behavior in our [demo app](https://quickstarts.netlify.app/quickstarts-localized). You can have a look at the code [here](https://github.com/patternfly/patternfly-quickstarts/blob/main/packages/dev/src/AppLocalized.tsx).
|
|
257
257
|
|
|
258
258
|
## In-App / In Context Help Panel
|
|
259
259
|
|
|
@@ -406,7 +406,7 @@ const FormGroupWithHelpTopicPopover: React.FC<FormGroupWithHelpTopicPopoverProps
|
|
|
406
406
|
<Popover
|
|
407
407
|
bodyContent={(hide) => (
|
|
408
408
|
<div>
|
|
409
|
-
{topic.title} is quite
|
|
409
|
+
{topic.title} is quite amazing{' '}
|
|
410
410
|
<Button
|
|
411
411
|
variant="link"
|
|
412
412
|
onClick={() => {
|
|
@@ -3,19 +3,25 @@ import * as React from 'react';
|
|
|
3
3
|
import { QuickStartContextValues } from './utils/quick-start-context';
|
|
4
4
|
import { HelpTopic } from './utils/help-topic-types';
|
|
5
5
|
export interface HelpTopicContainerProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
|
+
/** array of HelpTopics */
|
|
6
7
|
helpTopics: HelpTopic[];
|
|
8
|
+
/** text resources object
|
|
9
|
+
* Add custom strings: https://github.com/patternfly/patternfly-quickstarts/tree/main/packages/module#localization
|
|
10
|
+
*/
|
|
7
11
|
resourceBundle?: any;
|
|
12
|
+
/** language of the current resource bundle */
|
|
8
13
|
language?: string;
|
|
14
|
+
/** if true, will show a loading spinner on the catalog page (default false) */
|
|
9
15
|
loading?: boolean;
|
|
10
16
|
/**
|
|
11
17
|
* Additional markdown extensions and renderers to use
|
|
12
|
-
*
|
|
13
|
-
* https://github.com/openshift/console/blob/master/frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx#L235
|
|
18
|
+
* Example usage: https://github.com/patternfly/patternfly-quickstarts/tree/main/packages/module#markdown-extensions
|
|
14
19
|
*/
|
|
15
20
|
markdown?: {
|
|
16
21
|
extensions?: any[];
|
|
17
22
|
renderExtension?: (docContext: HTMLDocument, rootSelector: string) => React.ReactNode;
|
|
18
23
|
};
|
|
24
|
+
/** additional quick start context props */
|
|
19
25
|
contextProps?: QuickStartContextValues;
|
|
20
26
|
}
|
|
21
27
|
export declare const HelpTopicContainer: React.FC<HelpTopicContainerProps>;
|
|
@@ -3,32 +3,51 @@ import * as React from 'react';
|
|
|
3
3
|
import { QuickStartContextValues } from './utils/quick-start-context';
|
|
4
4
|
import { QuickStart, AllQuickStartStates } from './utils/quick-start-types';
|
|
5
5
|
export interface QuickStartContainerProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
|
+
/** array of quick starts */
|
|
6
7
|
quickStarts: QuickStart[];
|
|
8
|
+
/** id of the currently active quick start */
|
|
7
9
|
activeQuickStartID: string;
|
|
10
|
+
/** setter for the active quick starts */
|
|
8
11
|
setActiveQuickStartID: React.Dispatch<React.SetStateAction<string>>;
|
|
12
|
+
/** quick starts state object */
|
|
9
13
|
allQuickStartStates: AllQuickStartStates;
|
|
14
|
+
/** setter for the quick starts state object */
|
|
10
15
|
setAllQuickStartStates: React.Dispatch<React.SetStateAction<AllQuickStartStates>>;
|
|
16
|
+
/** content to render within the container */
|
|
11
17
|
children?: React.ReactNode;
|
|
18
|
+
/** element to render the drawer panel into */
|
|
12
19
|
appendTo?: HTMLElement | (() => HTMLElement);
|
|
20
|
+
/** if true, the panel will take up the full browser width */
|
|
13
21
|
fullWidth?: boolean;
|
|
22
|
+
/** callback when an in-progress quick start is closed */
|
|
14
23
|
onCloseInProgress?: any;
|
|
24
|
+
/** callback when a not-in-progress quick start is closed */
|
|
15
25
|
onCloseNotInProgress?: any;
|
|
26
|
+
/** true to show footer buttons in the catalog tiles (default true) */
|
|
16
27
|
showCardFooters?: boolean;
|
|
28
|
+
/** true to use legacy drawer header variant colors */
|
|
17
29
|
useLegacyHeaderColors?: boolean;
|
|
30
|
+
/** text resources object */
|
|
18
31
|
resourceBundle?: any;
|
|
32
|
+
/** language of the current resource bundle
|
|
33
|
+
* Add custom strings: https://github.com/patternfly/patternfly-quickstarts/tree/main/packages/module#localization
|
|
34
|
+
*/
|
|
19
35
|
language?: string;
|
|
36
|
+
/** if true, will show a loading spinner on the catalog page (default false) */
|
|
20
37
|
loading?: boolean;
|
|
38
|
+
/** if true, will update the browser URL with ?quickstart={ID} (default true) */
|
|
21
39
|
useQueryParams?: boolean;
|
|
40
|
+
/** if true, the TaskReview component, aka "Check your work", will be shown regardless of task status */
|
|
22
41
|
alwaysShowTaskReview?: boolean;
|
|
23
42
|
/**
|
|
24
43
|
* Additional markdown extensions and renderers to use
|
|
25
|
-
*
|
|
26
|
-
* https://github.com/openshift/console/blob/master/frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx#L235
|
|
44
|
+
* Example usage: https://github.com/patternfly/patternfly-quickstarts/tree/main/packages/module#markdown-extensions
|
|
27
45
|
*/
|
|
28
46
|
markdown?: {
|
|
29
47
|
extensions?: any[];
|
|
30
48
|
renderExtension?: (docContext: HTMLDocument, rootSelector: string) => React.ReactNode;
|
|
31
49
|
};
|
|
50
|
+
/** additional quick start context props */
|
|
32
51
|
contextProps?: QuickStartContextValues;
|
|
33
52
|
}
|
|
34
53
|
export declare const QuickStartContainer: React.FC<QuickStartContainerProps>;
|
|
@@ -9,7 +9,7 @@ declare type QuickStartTaskHeaderProps = {
|
|
|
9
9
|
size?: 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';
|
|
10
10
|
isActiveTask?: boolean;
|
|
11
11
|
onTaskSelect: (index: number) => void;
|
|
12
|
-
|
|
12
|
+
children?: React.ReactNode;
|
|
13
13
|
};
|
|
14
14
|
declare const QuickStartTaskHeader: React.FC<QuickStartTaskHeaderProps>;
|
|
15
15
|
export default QuickStartTaskHeader;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export * from './utils/help-topic-context';
|
|
|
11
11
|
export * from './utils/help-topic-types';
|
|
12
12
|
export * from './utils/quick-start-utils';
|
|
13
13
|
export * from './utils/useLocalStorage';
|
|
14
|
+
export * from './utils/asciidoc-procedure-parser';
|
|
14
15
|
export { default as QuickStartPanelContent } from './QuickStartPanelContent';
|
|
15
16
|
export { default as QuickStartCloseModal } from './QuickStartCloseModal';
|
package/dist/index.es.js
CHANGED
|
@@ -1233,7 +1233,7 @@ const useInlineCopyClipboardShowdownExtension = () => {
|
|
|
1233
1233
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1234
1234
|
return React.useMemo(() => ({
|
|
1235
1235
|
type: 'lang',
|
|
1236
|
-
regex:
|
|
1236
|
+
regex: /```[\n]\s*((((?!```).)*?\n)+)\s*```{{copy}}/g,
|
|
1237
1237
|
replace: (text, group, subGroup, groupType, groupId) => {
|
|
1238
1238
|
if (!group || !subGroup || !groupType || !groupId) {
|
|
1239
1239
|
return text;
|
|
@@ -1301,7 +1301,7 @@ const useAdmonitionShowdownExtension = () => {
|
|
|
1301
1301
|
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
1302
1302
|
return React.useMemo(() => ({
|
|
1303
1303
|
type: 'lang',
|
|
1304
|
-
regex: /\[(
|
|
1304
|
+
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
1305
1305
|
replace: (text, content, admonitionLabel, admonitionType, groupId) => {
|
|
1306
1306
|
if (!content || !admonitionLabel || !admonitionType || !groupId) {
|
|
1307
1307
|
return text;
|
|
@@ -2371,7 +2371,7 @@ const HelpTopicPanelContent = (_a) => {
|
|
|
2371
2371
|
const paddingContainer = (children) => React.createElement("div", { style: { padding: '24px' } }, children);
|
|
2372
2372
|
const panelBodyItems = (React.createElement(React.Fragment, null,
|
|
2373
2373
|
paddingContainer(React.createElement(QuickStartMarkdownView, { content: activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.content })),
|
|
2374
|
-
((_b = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _b === void 0 ? void 0 : _b.length) && React.createElement(Divider, null),
|
|
2374
|
+
!!((_b = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _b === void 0 ? void 0 : _b.length) && React.createElement(Divider, null),
|
|
2375
2375
|
paddingContainer(React.createElement(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) => {
|
|
2376
2376
|
return (React.createElement(StackItem, { key: index },
|
|
2377
2377
|
React.createElement(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.createElement(ExternalLinkAltIcon, null) : null, iconPosition: "right", style: { fontSize: 'inherit' } }, text || href)));
|
|
@@ -2458,5 +2458,105 @@ const useLocalStorage = (key, initialValue) => {
|
|
|
2458
2458
|
return [storedValue, setValue];
|
|
2459
2459
|
};
|
|
2460
2460
|
|
|
2461
|
-
|
|
2461
|
+
/* eslint-disable */
|
|
2462
|
+
// Brought in from dev to publish this with QS module
|
|
2463
|
+
// Dev now imports from here
|
|
2464
|
+
const ProcQuickStartParser = (quickStart, environmentVariables) => {
|
|
2465
|
+
var _a;
|
|
2466
|
+
const replaceEnvironmentVariables = (s) => s === null || s === void 0 ? void 0 : s.replace(/\${(\w+)}/, (substring, name) => {
|
|
2467
|
+
return environmentVariables ? ([name] ? environmentVariables[name] : substring) : substring;
|
|
2468
|
+
});
|
|
2469
|
+
quickStart.spec.tasks = (_a = quickStart.spec.tasks) === null || _a === void 0 ? void 0 : _a.map((task, index) => {
|
|
2470
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2471
|
+
let proc;
|
|
2472
|
+
let answer;
|
|
2473
|
+
if (typeof task === 'string') {
|
|
2474
|
+
proc = task;
|
|
2475
|
+
answer = {};
|
|
2476
|
+
}
|
|
2477
|
+
else {
|
|
2478
|
+
// @ts-ignore
|
|
2479
|
+
proc = task.proc;
|
|
2480
|
+
answer = task;
|
|
2481
|
+
// @ts-ignore
|
|
2482
|
+
delete task.proc;
|
|
2483
|
+
}
|
|
2484
|
+
let description = '', procedure, verification, title, summaryFailed, success, reviewFailed, prerequisites;
|
|
2485
|
+
if (proc) {
|
|
2486
|
+
const taskDOM = document.createElement('div');
|
|
2487
|
+
taskDOM.innerHTML = proc;
|
|
2488
|
+
// remove the screencapture images
|
|
2489
|
+
taskDOM.querySelectorAll('.imageblock.screencapture').forEach((node) => {
|
|
2490
|
+
var _a;
|
|
2491
|
+
(_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(node);
|
|
2492
|
+
});
|
|
2493
|
+
title = (_a = taskDOM
|
|
2494
|
+
.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();
|
|
2495
|
+
let sectionBody = taskDOM.querySelector('.sectionbody');
|
|
2496
|
+
if (!(sectionBody === null || sectionBody === void 0 ? void 0 : sectionBody.hasChildNodes())) {
|
|
2497
|
+
// possibly in other templates, where we want to look for article
|
|
2498
|
+
sectionBody = taskDOM.querySelector('article');
|
|
2499
|
+
}
|
|
2500
|
+
if (sectionBody) {
|
|
2501
|
+
for (let i = 0; i < sectionBody.children.length || 0; i++) {
|
|
2502
|
+
/**
|
|
2503
|
+
child typically looks like:
|
|
2504
|
+
|
|
2505
|
+
<div class="paragraph|olist|ulist|admonitionblock">
|
|
2506
|
+
<div class="title">Procedure|Prerequisites|Verification|Note|Warning</div>
|
|
2507
|
+
<ol|ul class="arabic">
|
|
2508
|
+
<li>
|
|
2509
|
+
<li>...
|
|
2510
|
+
</ol|ul>
|
|
2511
|
+
</div>
|
|
2512
|
+
|
|
2513
|
+
And the below code extracts the <ol> or <ul>
|
|
2514
|
+
Except for when there is no <div class="title|heading"/>, then the description is extracted
|
|
2515
|
+
in the else if below
|
|
2516
|
+
*/
|
|
2517
|
+
const child = sectionBody.children.item(i);
|
|
2518
|
+
// find the title
|
|
2519
|
+
const sectionTitle = child === null || child === void 0 ? void 0 : child.querySelector('.heading,.title');
|
|
2520
|
+
// should this section be assigned to a specific section
|
|
2521
|
+
const sectionTitleText = (_b = sectionTitle === null || sectionTitle === void 0 ? void 0 : sectionTitle.textContent) === null || _b === void 0 ? void 0 : _b.trim();
|
|
2522
|
+
const isKnownSection = ['Procedure', 'Verification', 'Prerequisites'].includes((_c = sectionTitle === null || sectionTitle === void 0 ? void 0 : sectionTitle.textContent) === null || _c === void 0 ? void 0 : _c.trim());
|
|
2523
|
+
if (isKnownSection) {
|
|
2524
|
+
switch (sectionTitleText) {
|
|
2525
|
+
case 'Procedure':
|
|
2526
|
+
procedure = (_d = child === null || child === void 0 ? void 0 : child.querySelector(':not(.heading):not(.title)')) === null || _d === void 0 ? void 0 : _d.outerHTML.trim();
|
|
2527
|
+
break;
|
|
2528
|
+
case 'Verification':
|
|
2529
|
+
verification = (_e = child === null || child === void 0 ? void 0 : child.querySelector(':not(.heading):not(.title)')) === null || _e === void 0 ? void 0 : _e.outerHTML.trim();
|
|
2530
|
+
break;
|
|
2531
|
+
case 'Prerequisites':
|
|
2532
|
+
prerequisites = (_f = child === null || child === void 0 ? void 0 : child.querySelector(':not(.heading):not(.title)')) === null || _f === void 0 ? void 0 : _f.outerHTML.trim();
|
|
2533
|
+
break;
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
else if (!procedure) {
|
|
2537
|
+
// Otherwise if it comes before a procedure it's part of the description
|
|
2538
|
+
description = description + (child === null || child === void 0 ? void 0 : child.outerHTML.trim());
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
success = (_g = taskDOM.querySelector('.qs-summary.success')) === null || _g === void 0 ? void 0 : _g.innerHTML.trim();
|
|
2543
|
+
reviewFailed = (_h = taskDOM.querySelector('.qs-review.failed')) === null || _h === void 0 ? void 0 : _h.innerHTML.trim();
|
|
2544
|
+
summaryFailed = (_j = taskDOM.querySelector('.qs-summary.failed')) === null || _j === void 0 ? void 0 : _j.innerHTML.trim();
|
|
2545
|
+
}
|
|
2546
|
+
answer.title = replaceEnvironmentVariables(answer.title || title);
|
|
2547
|
+
answer.description = replaceEnvironmentVariables(answer.description || `${description} ${prerequisites || ''} ${procedure}`);
|
|
2548
|
+
answer.review = answer.review || {};
|
|
2549
|
+
answer.review.instructions = replaceEnvironmentVariables(((_k = answer.review) === null || _k === void 0 ? void 0 : _k.instructions) || verification || 'Have you completed these steps?');
|
|
2550
|
+
answer.review.failedTaskHelp = replaceEnvironmentVariables(answer.review.failedTaskHelp ||
|
|
2551
|
+
reviewFailed ||
|
|
2552
|
+
'This task isn’t verified yet. Try the task again.');
|
|
2553
|
+
answer.summary = answer.summary || {};
|
|
2554
|
+
answer.summary.success = replaceEnvironmentVariables(answer.summary.success || success || 'You have completed this task!');
|
|
2555
|
+
answer.summary.failed = replaceEnvironmentVariables(answer.summary.failed || summaryFailed || 'Try the steps again.');
|
|
2556
|
+
return answer;
|
|
2557
|
+
});
|
|
2558
|
+
return quickStart;
|
|
2559
|
+
};
|
|
2560
|
+
|
|
2561
|
+
export { Box, CamelCaseWrap, EmptyBox, HELP_TOPIC_NAME_KEY, HelpTopicContainer, HelpTopicContext, HelpTopicContextDefaults, HelpTopicDrawer, Loading, LoadingBox, ProcQuickStartParser, QUICKSTART_ID_FILTER_KEY, QUICKSTART_SEARCH_FILTER_KEY, QUICKSTART_STATUS_FILTER_KEY, QUICKSTART_TASKS_INITIAL_STATES, QUICK_START_NAME, QuickStartCatalog, QuickStartCatalogEmptyState, QuickStartCatalogFilter, QuickStartCatalogFilterCount, QuickStartCatalogFilterCountWrapper, QuickStartCatalogFilterSearch, QuickStartCatalogFilterSearchWrapper, QuickStartCatalogFilterSelect, QuickStartCatalogFilterStatusWrapper, QuickStartCatalogHeader, QuickStartCatalogPage, QuickStartCatalogSection, QuickStartCatalogToolbar, QuickStartCloseModal, QuickStartContainer, QuickStartContext, QuickStartContextDefaults, QuickStartContextProvider, QuickStartDrawer, QuickStartPanelContent, QuickStartStatus, QuickStartTaskStatus, QuickStartTile, QuickStartTileDescription, QuickStartTileFooter, QuickStartTileFooterExternal, QuickStartTileHeader, camelize, clearFilterParams, equalsIgnoreOrder, filterQuickStarts, getDefaultQuickStartState, getDisabledQuickStarts, getQuickStartByName, getQuickStartStatus, getQuickStartStatusCount, getResource, getTaskStatusKey, history, isDisabledQuickStart, removeQueryArgument, setQueryArgument, useLocalStorage, useValuesForHelpTopicContext, useValuesForQuickStartContext };
|
|
2462
2562
|
//# sourceMappingURL=index.es.js.map
|