@patternfly/quickstarts 2.2.3 → 2.3.1
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/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.d.ts +1 -1
- package/dist/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.d.ts +1 -1
- 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.es.js +14 -13
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +14 -13
- 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-base.css +24 -24
- package/dist/quickstarts-full.es.js +14 -13
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts.css +24 -24
- package/dist/quickstarts.min.css +1 -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 +39 -0
- package/src/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.tsx +44 -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={() => {
|
package/dist/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import './showdown-extension.scss';
|
|
|
2
2
|
declare const useInlineCopyClipboardShowdownExtension: () => {
|
|
3
3
|
type: string;
|
|
4
4
|
regex: RegExp;
|
|
5
|
-
replace: (text: string, group: string,
|
|
5
|
+
replace: (text: string, group: string, _: string, groupId: number) => string;
|
|
6
6
|
};
|
|
7
7
|
export default useInlineCopyClipboardShowdownExtension;
|
package/dist/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import './showdown-extension.scss';
|
|
|
2
2
|
declare const useMultilineCopyClipboardShowdownExtension: () => {
|
|
3
3
|
type: string;
|
|
4
4
|
regex: RegExp;
|
|
5
|
-
replace: (text: string, group: string,
|
|
5
|
+
replace: (text: string, group: string, _1: string, _2: string, groupId: number) => string;
|
|
6
6
|
};
|
|
7
7
|
export default useMultilineCopyClipboardShowdownExtension;
|
|
@@ -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.es.js
CHANGED
|
@@ -1201,12 +1201,13 @@ const CopyClipboard = ({ element, rootSelector, docContext, }) => {
|
|
|
1201
1201
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1202
1202
|
const [showSuccessContent, setShowSuccessContent] = React.useState(false);
|
|
1203
1203
|
const textToCopy = React.useMemo(() => {
|
|
1204
|
+
var _a;
|
|
1204
1205
|
const copyTextId = element.getAttribute(MARKDOWN_COPY_BUTTON_ID);
|
|
1205
|
-
return docContext.querySelector(`${rootSelector} [${MARKDOWN_SNIPPET_ID}="${copyTextId}"]`).innerText;
|
|
1206
|
+
return (_a = docContext.querySelector(`${rootSelector} [${MARKDOWN_SNIPPET_ID}="${copyTextId}"]`)) === null || _a === void 0 ? void 0 : _a.innerText;
|
|
1206
1207
|
}, [element, docContext, rootSelector]);
|
|
1207
1208
|
useEventListener(element, 'click', React.useCallback(() => {
|
|
1208
1209
|
navigator.clipboard
|
|
1209
|
-
.writeText(textToCopy)
|
|
1210
|
+
.writeText(textToCopy.trim())
|
|
1210
1211
|
.then(() => {
|
|
1211
1212
|
setShowSuccessContent(true);
|
|
1212
1213
|
})
|
|
@@ -1234,15 +1235,15 @@ const useInlineCopyClipboardShowdownExtension = () => {
|
|
|
1234
1235
|
return React.useMemo(() => ({
|
|
1235
1236
|
type: 'lang',
|
|
1236
1237
|
regex: /`([^`](.*?)[^`])`{{copy}}/g,
|
|
1237
|
-
replace: (text, group,
|
|
1238
|
-
if (!group ||
|
|
1238
|
+
replace: (text, group, _, groupId) => {
|
|
1239
|
+
if (!group || isNaN(groupId)) {
|
|
1239
1240
|
return text;
|
|
1240
1241
|
}
|
|
1241
1242
|
return removeTemplateWhitespace(`<span class="pf-c-clipboard-copy pf-m-inline">
|
|
1242
|
-
<span class="pf-c-clipboard-copy__text" ${MARKDOWN_SNIPPET_ID}="${
|
|
1243
|
+
<span class="pf-c-clipboard-copy__text" ${MARKDOWN_SNIPPET_ID}="${groupId}">${group}</span>
|
|
1243
1244
|
<span class="pf-c-clipboard-copy__actions">
|
|
1244
1245
|
<span class="pf-c-clipboard-copy__actions-item">
|
|
1245
|
-
<button class="pf-c-button pf-m-plain" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${
|
|
1246
|
+
<button class="pf-c-button pf-m-plain" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${groupId}">
|
|
1246
1247
|
${renderToStaticMarkup(React.createElement(CopyIcon, null))}
|
|
1247
1248
|
</button>
|
|
1248
1249
|
</span>
|
|
@@ -1256,16 +1257,16 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1256
1257
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1257
1258
|
return React.useMemo(() => ({
|
|
1258
1259
|
type: 'lang',
|
|
1259
|
-
regex: /```[\n]((
|
|
1260
|
-
replace: (text, group,
|
|
1261
|
-
if (!group ||
|
|
1260
|
+
regex: /```[\n]\s*((((?!```).)*?\n)+)\s*```{{copy}}/g,
|
|
1261
|
+
replace: (text, group, _1, _2, groupId) => {
|
|
1262
|
+
if (!group || isNaN(groupId)) {
|
|
1262
1263
|
return text;
|
|
1263
1264
|
}
|
|
1264
1265
|
return `<div class="pf-c-code-block">
|
|
1265
1266
|
<div class="pf-c-code-block__header">
|
|
1266
1267
|
<div class="pf-c-code-block__actions">
|
|
1267
1268
|
<div class="pf-c-code-block__actions-item">
|
|
1268
|
-
<button class="pf-c-button pf-m-plain" type="button" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${
|
|
1269
|
+
<button class="pf-c-button pf-m-plain" type="button" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${groupId}">
|
|
1269
1270
|
${renderToStaticMarkup(React.createElement(CopyIcon, null))}
|
|
1270
1271
|
</button>
|
|
1271
1272
|
</div>
|
|
@@ -1274,7 +1275,7 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1274
1275
|
<div class="pf-c-code-block__content">
|
|
1275
1276
|
<pre class="pf-c-code-block__pre pfext-code-block__pre">
|
|
1276
1277
|
<code class="pf-c-code-block__code"
|
|
1277
|
-
${MARKDOWN_SNIPPET_ID}="${
|
|
1278
|
+
${MARKDOWN_SNIPPET_ID}="${groupId}">${group.trim()}</code>
|
|
1278
1279
|
</pre>
|
|
1279
1280
|
</div>
|
|
1280
1281
|
</div>`;
|
|
@@ -1301,7 +1302,7 @@ const useAdmonitionShowdownExtension = () => {
|
|
|
1301
1302
|
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
1302
1303
|
return React.useMemo(() => ({
|
|
1303
1304
|
type: 'lang',
|
|
1304
|
-
regex: /\[(
|
|
1305
|
+
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
1305
1306
|
replace: (text, content, admonitionLabel, admonitionType, groupId) => {
|
|
1306
1307
|
if (!content || !admonitionLabel || !admonitionType || !groupId) {
|
|
1307
1308
|
return text;
|
|
@@ -2371,7 +2372,7 @@ const HelpTopicPanelContent = (_a) => {
|
|
|
2371
2372
|
const paddingContainer = (children) => React.createElement("div", { style: { padding: '24px' } }, children);
|
|
2372
2373
|
const panelBodyItems = (React.createElement(React.Fragment, null,
|
|
2373
2374
|
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),
|
|
2375
|
+
!!((_b = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _b === void 0 ? void 0 : _b.length) && React.createElement(Divider, null),
|
|
2375
2376
|
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
2377
|
return (React.createElement(StackItem, { key: index },
|
|
2377
2378
|
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)));
|