@patternfly/quickstarts 0.0.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 +546 -0
- package/dist/ConsoleInternal/components/markdown-view.d.ts +19 -0
- package/dist/ConsoleInternal/components/utils/camel-case-wrap.d.ts +6 -0
- package/dist/ConsoleInternal/components/utils/index.d.ts +3 -0
- package/dist/ConsoleInternal/components/utils/router.d.ts +9 -0
- package/dist/ConsoleInternal/components/utils/status-box.d.ts +20 -0
- package/dist/ConsoleInternal/module/k8s/types.d.ts +42 -0
- package/dist/ConsoleShared/index.d.ts +1 -0
- package/dist/ConsoleShared/src/components/index.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.d.ts +13 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/accordion-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.d.ts +6 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/admonition-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/code-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/const.d.ts +5 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/index.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/utils.d.ts +1 -0
- package/dist/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-highlight-extension/highlight-consts.d.ts +4 -0
- package/dist/ConsoleShared/src/components/markdown-highlight-extension/index.d.ts +1 -0
- package/dist/ConsoleShared/src/components/modal/Modal.d.ts +9 -0
- package/dist/ConsoleShared/src/components/modal/index.d.ts +1 -0
- package/dist/ConsoleShared/src/components/popper/Portal.d.ts +8 -0
- package/dist/ConsoleShared/src/components/popper/SimplePopper.d.ts +6 -0
- package/dist/ConsoleShared/src/components/popper/index.d.ts +2 -0
- package/dist/ConsoleShared/src/components/spotlight/InteractiveSpotlight.d.ts +7 -0
- package/dist/ConsoleShared/src/components/spotlight/Spotlight.d.ts +7 -0
- package/dist/ConsoleShared/src/components/spotlight/StaticSpotlight.d.ts +7 -0
- package/dist/ConsoleShared/src/components/spotlight/index.d.ts +1 -0
- package/dist/ConsoleShared/src/components/status/GenericStatus.d.ts +12 -0
- package/dist/ConsoleShared/src/components/status/NotStartedIcon.d.ts +3 -0
- package/dist/ConsoleShared/src/components/status/PopoverStatus.d.ts +13 -0
- package/dist/ConsoleShared/src/components/status/Status.d.ts +11 -0
- package/dist/ConsoleShared/src/components/status/StatusIconAndText.d.ts +8 -0
- package/dist/ConsoleShared/src/components/status/icons.d.ts +9 -0
- package/dist/ConsoleShared/src/components/status/index.d.ts +1 -0
- package/dist/ConsoleShared/src/components/status/statuses.d.ts +5 -0
- package/dist/ConsoleShared/src/components/status/types.d.ts +9 -0
- package/dist/ConsoleShared/src/components/utils/FallbackImg.d.ts +9 -0
- package/dist/ConsoleShared/src/components/utils/index.d.ts +1 -0
- package/dist/ConsoleShared/src/constants/index.d.ts +1 -0
- package/dist/ConsoleShared/src/constants/ui.d.ts +1 -0
- package/dist/ConsoleShared/src/hooks/index.d.ts +6 -0
- package/dist/ConsoleShared/src/hooks/scroll.d.ts +8 -0
- package/dist/ConsoleShared/src/hooks/useBoundingClientRect.d.ts +3 -0
- package/dist/ConsoleShared/src/hooks/useEventListener.d.ts +1 -0
- package/dist/ConsoleShared/src/hooks/useForceRender.d.ts +4 -0
- package/dist/ConsoleShared/src/hooks/useResizeObserver.d.ts +1 -0
- package/dist/ConsoleShared/src/hooks/useScrollShadows.d.ts +7 -0
- package/dist/ConsoleShared/src/index.d.ts +4 -0
- package/dist/ConsoleShared/src/utils/index.d.ts +1 -0
- package/dist/ConsoleShared/src/utils/useCombineRefs.d.ts +2 -0
- package/dist/HelpTopicDrawer.d.ts +33 -0
- package/dist/HelpTopicPanelContent.d.ts +11 -0
- package/dist/QuickStartCatalogPage.d.ts +14 -0
- package/dist/QuickStartCloseModal.d.ts +8 -0
- package/dist/QuickStartController.d.ts +10 -0
- package/dist/QuickStartDrawer.d.ts +62 -0
- package/dist/QuickStartMarkdownView.d.ts +9 -0
- package/dist/QuickStartPanelContent.d.ts +15 -0
- package/dist/catalog/Catalog/QuickStartCatalogHeader.d.ts +6 -0
- package/dist/catalog/Catalog/QuickStartCatalogSection.d.ts +5 -0
- package/dist/catalog/Catalog/QuickStartCatalogToolbar.d.ts +5 -0
- package/dist/catalog/Catalog/index.d.ts +3 -0
- package/dist/catalog/QuickStartCatalog.d.ts +8 -0
- package/dist/catalog/QuickStartTile.d.ts +14 -0
- package/dist/catalog/QuickStartTileDescription.d.ts +8 -0
- package/dist/catalog/QuickStartTileFooter.d.ts +8 -0
- package/dist/catalog/QuickStartTileFooterExternal.d.ts +8 -0
- package/dist/catalog/QuickStartTileHeader.d.ts +24 -0
- package/dist/catalog/Toolbar/QuickStartCatalogFilter.d.ts +10 -0
- package/dist/catalog/Toolbar/QuickStartCatalogFilterItems.d.ts +31 -0
- package/dist/catalog/index.d.ts +9 -0
- package/dist/controller/QuickStartConclusion.d.ts +12 -0
- package/dist/controller/QuickStartContent.d.ts +14 -0
- package/dist/controller/QuickStartFooter.d.ts +14 -0
- package/dist/controller/QuickStartIntroduction.d.ts +12 -0
- package/dist/controller/QuickStartTaskHeader.d.ts +15 -0
- package/dist/controller/QuickStartTaskHeaderList.d.ts +10 -0
- package/dist/controller/QuickStartTaskReview.d.ts +10 -0
- package/dist/controller/QuickStartTasks.d.ts +12 -0
- package/dist/data/mocks/json/explore-pipeline-quickstart.d.ts +2 -0
- package/dist/data/mocks/json/explore-serverless-quickstart.d.ts +2 -0
- package/dist/data/mocks/json/monitor-sampleapp-quickstart.d.ts +2 -0
- package/dist/data/mocks/json/tour-icons.d.ts +2 -0
- package/dist/data/quick-start-test-data.d.ts +2 -0
- package/dist/data/test-utils.d.ts +8 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.es.js +2593 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +2695 -0
- package/dist/index.js.map +1 -0
- 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 +51 -0
- package/dist/patternfly-docs/quick-starts/examples/about.md +84 -0
- package/dist/patternfly-docs/quick-starts/examples/basic.md +29 -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 +28 -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-global.css +1302 -0
- package/dist/patternfly-nested.css +11812 -0
- package/dist/quickstarts-base.css +1219 -0
- package/dist/quickstarts-full.es.js +31861 -0
- package/dist/quickstarts-full.es.js.map +1 -0
- package/dist/quickstarts-standalone.css +868 -0
- package/dist/quickstarts-standalone.min.css +4 -0
- package/dist/quickstarts-vendor.css +165 -0
- package/dist/quickstarts.css +1383 -0
- package/dist/quickstarts.min.css +1 -0
- package/dist/styles/patternfly-global-entry.d.ts +1 -0
- package/dist/styles/patternfly-nested-entry.d.ts +1 -0
- package/dist/styles/quickstarts-standalone-entry.d.ts +1 -0
- package/dist/styles/vendor-entry.d.ts +1 -0
- package/dist/utils/PluralResolver.d.ts +16 -0
- package/dist/utils/asciidoc-procedure-parser.d.ts +12 -0
- package/dist/utils/const.d.ts +6 -0
- package/dist/utils/help-topic-context.d.ts +23 -0
- package/dist/utils/help-topic-types.d.ts +13 -0
- package/dist/utils/quick-start-context.d.ts +81 -0
- package/dist/utils/quick-start-types.d.ts +60 -0
- package/dist/utils/quick-start-utils.d.ts +10 -0
- package/dist/utils/useLocalStorage.d.ts +1 -0
- package/dist/vendor.js +2 -0
- package/dist/vendor.js.map +1 -0
- package/package.json +105 -0
- 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 +392 -0
- package/src/ConsoleInternal/components/markdown-view.tsx +276 -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 +45 -0
- package/src/ConsoleInternal/components/utils/status-box.tsx +56 -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 +95 -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/accordion-extension.tsx +51 -0
- package/src/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.tsx +60 -0
- package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +67 -0
- package/src/ConsoleShared/src/components/markdown-extensions/code-extension.tsx +23 -0
- package/src/ConsoleShared/src/components/markdown-extensions/const.ts +5 -0
- package/src/ConsoleShared/src/components/markdown-extensions/index.ts +7 -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 +1 -0
- package/src/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.tsx +65 -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 +25 -0
- package/src/ConsoleShared/src/components/popper/SimplePopper.tsx +92 -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 +34 -0
- package/src/ConsoleShared/src/components/status/NotStartedIcon.tsx +27 -0
- package/src/ConsoleShared/src/components/status/PopoverStatus.tsx +39 -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 +39 -0
- package/src/ConsoleShared/src/components/status/index.tsx +1 -0
- package/src/ConsoleShared/src/components/status/statuses.tsx +20 -0
- package/src/ConsoleShared/src/components/status/types.ts +8 -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 +19 -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 +16 -0
- package/src/HelpTopicDrawer.tsx +116 -0
- package/src/HelpTopicPanelContent.tsx +160 -0
- package/src/QuickStartCatalogPage.tsx +195 -0
- package/src/QuickStartCloseModal.tsx +47 -0
- package/src/QuickStartController.tsx +111 -0
- package/src/QuickStartDrawer.scss +11 -0
- package/src/QuickStartDrawer.tsx +265 -0
- package/src/QuickStartMarkdownView.tsx +80 -0
- package/src/QuickStartPanelContent.scss +46 -0
- package/src/QuickStartPanelContent.tsx +165 -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 +129 -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 +16 -0
- package/src/catalog/QuickStartTileHeader.tsx +105 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilter.scss +25 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilter.tsx +32 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +218 -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 +124 -0
- package/src/controller/QuickStartIntroduction.scss +35 -0
- package/src/controller/QuickStartIntroduction.tsx +64 -0
- package/src/controller/QuickStartTaskHeader.scss +58 -0
- package/src/controller/QuickStartTaskHeader.tsx +125 -0
- package/src/controller/QuickStartTaskHeaderList.scss +17 -0
- package/src/controller/QuickStartTaskHeaderList.tsx +33 -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 +43 -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 +46 -0
- package/src/styles/legacy-bootstrap/_tables.scss +38 -0
- package/src/styles/legacy-bootstrap/_type.scss +92 -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 +362 -0
- package/src/utils/asciidoc-procedure-parser.ts +130 -0
- package/src/utils/const.ts +10 -0
- package/src/utils/help-topic-context.tsx +72 -0
- package/src/utils/help-topic-types.ts +16 -0
- package/src/utils/quick-start-context.tsx +473 -0
- package/src/utils/quick-start-types.ts +73 -0
- package/src/utils/quick-start-utils.ts +88 -0
- package/src/utils/useLocalStorage.ts +38 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
// Code (inline and block)
|
|
5
|
+
// --------------------------------------------------
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// Inline and block code styles
|
|
9
|
+
code,
|
|
10
|
+
pre {
|
|
11
|
+
font-family: $font-family-monospace;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Inline code
|
|
15
|
+
code {
|
|
16
|
+
padding: 2px 4px;
|
|
17
|
+
font-size: 90%;
|
|
18
|
+
color: $code-color;
|
|
19
|
+
background-color: $code-bg;
|
|
20
|
+
border-radius: $border-radius-base;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Blocks of code
|
|
24
|
+
pre {
|
|
25
|
+
display: block;
|
|
26
|
+
padding: math.div($line-height-computed - 1, 2);
|
|
27
|
+
margin: 0 0 math.div($line-height-computed, 2);
|
|
28
|
+
font-size: ($font-size-base - 1); // 14px to 13px
|
|
29
|
+
line-height: $line-height-base;
|
|
30
|
+
color: $pre-color;
|
|
31
|
+
word-break: break-all;
|
|
32
|
+
word-wrap: break-word;
|
|
33
|
+
background-color: $pre-bg;
|
|
34
|
+
border: 1px solid $pre-border-color;
|
|
35
|
+
border-radius: $border-radius-base;
|
|
36
|
+
|
|
37
|
+
// Account for some code outputs that place code tags in pre tags
|
|
38
|
+
code {
|
|
39
|
+
padding: 0;
|
|
40
|
+
font-size: inherit;
|
|
41
|
+
color: inherit;
|
|
42
|
+
white-space: pre-wrap;
|
|
43
|
+
background-color: transparent;
|
|
44
|
+
border-radius: 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Tables
|
|
3
|
+
// --------------------------------------------------
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
table {
|
|
7
|
+
background-color: $table-bg;
|
|
8
|
+
|
|
9
|
+
// Table cell sizing
|
|
10
|
+
//
|
|
11
|
+
// Reset default table behavior
|
|
12
|
+
|
|
13
|
+
col[class*="col-"] {
|
|
14
|
+
position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)
|
|
15
|
+
display: table-column;
|
|
16
|
+
float: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
td,
|
|
20
|
+
th {
|
|
21
|
+
&[class*="col-"] {
|
|
22
|
+
position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)
|
|
23
|
+
display: table-cell;
|
|
24
|
+
float: none;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
caption {
|
|
30
|
+
padding-top: $table-cell-padding;
|
|
31
|
+
padding-bottom: $table-cell-padding;
|
|
32
|
+
color: $text-muted;
|
|
33
|
+
text-align: left;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
th {
|
|
37
|
+
text-align: left;
|
|
38
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
// Typography
|
|
5
|
+
// --------------------------------------------------
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// Headings
|
|
9
|
+
// -------------------------
|
|
10
|
+
|
|
11
|
+
h1, h2, h3, h4, h5, h6,
|
|
12
|
+
.h1, .h2, .h3, .h4, .h5, .h6 {
|
|
13
|
+
font-family: $headings-font-family;
|
|
14
|
+
font-weight: $headings-font-weight;
|
|
15
|
+
line-height: $headings-line-height;
|
|
16
|
+
color: $headings-color;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
h1, .h1,
|
|
20
|
+
h2, .h2,
|
|
21
|
+
h3, .h3 {
|
|
22
|
+
margin-top: $line-height-computed;
|
|
23
|
+
margin-bottom: math.div($line-height-computed, 2);
|
|
24
|
+
}
|
|
25
|
+
h4, .h4,
|
|
26
|
+
h5, .h5,
|
|
27
|
+
h6, .h6 {
|
|
28
|
+
margin-top: math.div($line-height-computed, 2);
|
|
29
|
+
margin-bottom: math.div($line-height-computed, 2);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
h1, .h1 { font-size: $font-size-h1; }
|
|
33
|
+
h2, .h2 { font-size: $font-size-h2; }
|
|
34
|
+
h3, .h3 { font-size: $font-size-h3; }
|
|
35
|
+
h4, .h4 { font-size: $font-size-h4; }
|
|
36
|
+
h5, .h5 { font-size: $font-size-h5; }
|
|
37
|
+
h6, .h6 { font-size: $font-size-h6; }
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
// Body text
|
|
41
|
+
// -------------------------
|
|
42
|
+
|
|
43
|
+
p {
|
|
44
|
+
margin: 0 0 math.div($line-height-computed, 2);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
// Lists
|
|
49
|
+
// -------------------------
|
|
50
|
+
|
|
51
|
+
// Unordered and Ordered lists
|
|
52
|
+
ul,
|
|
53
|
+
ol {
|
|
54
|
+
margin-top: 0;
|
|
55
|
+
margin-bottom: math.div($line-height-computed, 2);
|
|
56
|
+
ul,
|
|
57
|
+
ol {
|
|
58
|
+
margin-bottom: 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Description Lists
|
|
63
|
+
dl {
|
|
64
|
+
margin-top: 0; // Remove browser default
|
|
65
|
+
margin-bottom: $line-height-computed;
|
|
66
|
+
}
|
|
67
|
+
dt,
|
|
68
|
+
dd {
|
|
69
|
+
line-height: $line-height-base;
|
|
70
|
+
}
|
|
71
|
+
dt {
|
|
72
|
+
font-weight: 700;
|
|
73
|
+
}
|
|
74
|
+
dd {
|
|
75
|
+
margin-left: 0; // Undo browser default
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Blockquotes
|
|
79
|
+
blockquote {
|
|
80
|
+
padding: math.div($line-height-computed, 2) $line-height-computed;
|
|
81
|
+
margin: 0 0 $line-height-computed;
|
|
82
|
+
font-size: $blockquote-font-size;
|
|
83
|
+
border-left: 5px solid $blockquote-border-color;
|
|
84
|
+
|
|
85
|
+
p,
|
|
86
|
+
ul,
|
|
87
|
+
ol {
|
|
88
|
+
&:last-child {
|
|
89
|
+
margin-bottom: 0;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// PF4 overrides
|
|
2
|
+
$font-size-base: 14px;
|
|
3
|
+
$font-size-h1: var(--pf-v5-global--FontSize--2xl);
|
|
4
|
+
$font-size-h2: 20px; // must be literal value because of calculation in patternfly/dist/sass/patternfly/_list-view.scss
|
|
5
|
+
$font-size-h3: var(--pf-v5-global--FontSize--lg);
|
|
6
|
+
$font-size-h4: var(--pf-v5-global--FontSize--md);
|
|
7
|
+
$font-size-h5: var(--pf-v5-global--FontSize--md);
|
|
8
|
+
$font-size-h6: var(--pf-v5-global--FontSize--md);
|
|
9
|
+
$grid-gutter-width: 30px;
|
|
10
|
+
$headings-font-family: var(--pf-v5-global--FontFamily--heading--sans-serif);
|
|
11
|
+
$headings-font-weight: var(--pf-v5-global--FontWeight--normal);
|
|
12
|
+
|
|
13
|
+
// PF3 variables
|
|
14
|
+
$color-pf-black: #030303 !default;
|
|
15
|
+
$color-pf-black-600: #72767b !default;
|
|
16
|
+
$color-pf-white: #fff !default;
|
|
17
|
+
$color-pf-black-150: #f5f5f5 !default;
|
|
18
|
+
$color-pf-blue-600: #004368 !default;
|
|
19
|
+
$color-pf-blue-50: #def3ff !default;
|
|
20
|
+
$color-pf-black-100: #fafafa !default;
|
|
21
|
+
|
|
22
|
+
// PF3 bootstrap overrides
|
|
23
|
+
$line-height-base: 1.66666667 !default; // 20/12
|
|
24
|
+
$line-height-computed: floor(($font-size-base * $line-height-base)) !default;
|
|
25
|
+
$gray-light: lighten($color-pf-black, 60%) !default; // #999
|
|
26
|
+
$gray-lighter: lighten($color-pf-black, 93.5%) !default; // #eee
|
|
27
|
+
$gray-dark: lighten($color-pf-black, 20%) !default; // #333
|
|
28
|
+
$font-family-monospace: Menlo, Monaco, Consolas, monospace !default;
|
|
29
|
+
$code-color: $color-pf-blue-600 !default;
|
|
30
|
+
$code-bg: $color-pf-blue-50 !default;
|
|
31
|
+
$pre-bg: $color-pf-black-100 !default;
|
|
32
|
+
$border-radius-base: 1px !default;
|
|
33
|
+
$table-cell-padding: 10px !default;
|
|
34
|
+
|
|
35
|
+
// bootstrap variables
|
|
36
|
+
$screen-sm: 768px !default;
|
|
37
|
+
$screen-sm-min: $screen-sm !default;
|
|
38
|
+
$grid-float-breakpoint: $screen-sm-min !default;
|
|
39
|
+
$screen-md: 992px !default;
|
|
40
|
+
$headings-line-height: 1.1 !default;
|
|
41
|
+
$headings-color: inherit !default;
|
|
42
|
+
$gray-base: #000 !default;
|
|
43
|
+
$blockquote-font-size: ($font-size-base * 1.25) !default;
|
|
44
|
+
$blockquote-border-color: $gray-lighter !default;
|
|
45
|
+
$pre-color: $gray-dark !default;
|
|
46
|
+
$pre-border-color: #ccc !default;
|
|
47
|
+
$table-bg: transparent !default;
|
|
48
|
+
$text-muted: $gray-light !default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './patternfly-global.scss';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// pulls in the patternfly drawer styles, in case the consumer does not have them
|
|
2
|
+
// which can happen when they're not using PatternFly, or a different (older) version
|
|
3
|
+
// some global styles that quickstarts uses (Drawer, Popover, Modal, Backdrop, Bullseye)
|
|
4
|
+
|
|
5
|
+
// TODO: Investigate if we can remove and/or nest these within patternfly-nested.css
|
|
6
|
+
// what do we really need to expose globally?
|
|
7
|
+
// here are the classes that exist outside the scope of .pfext-quick-start__base:
|
|
8
|
+
// class="pf-v5-c-popover pfext-quick-start__base pf-m-right"
|
|
9
|
+
// class="pf-v5-c-modal-box pfext-modal pfext-quick-start-drawer__modal pfext-quick-start__base pf-m-sm"
|
|
10
|
+
// class="pf-v5-c-backdrop__open"
|
|
11
|
+
// class="pf-v5-c-backdrop"
|
|
12
|
+
// class="pf-v5-l-bullseye"
|
|
13
|
+
// class="pf-v5-c-tooltip pf-m-top pfext-quick-start__base"
|
|
14
|
+
|
|
15
|
+
@import '@patternfly/patternfly/sass-utilities/all';
|
|
16
|
+
// gets added globally to :root
|
|
17
|
+
@import '@patternfly/patternfly/base/variables';
|
|
18
|
+
|
|
19
|
+
@import '@patternfly/patternfly/components/Drawer/drawer.scss';
|
|
20
|
+
@import '@patternfly/patternfly/components/Popover/popover.scss';
|
|
21
|
+
|
|
22
|
+
// for the 'Leave quick start?` modal
|
|
23
|
+
@import '@patternfly/patternfly/components/ModalBox/modal-box.scss';
|
|
24
|
+
@import '@patternfly/patternfly/components/Backdrop/backdrop.scss';
|
|
25
|
+
@import '@patternfly/patternfly/layouts/Bullseye/bullseye.scss';
|
|
26
|
+
|
|
27
|
+
// for the markdown extension that lets users copy text to clipboard
|
|
28
|
+
@import '@patternfly/patternfly/components/Tooltip/tooltip.scss';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './patternfly-nested.scss';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// pulls in the patternfly styles, in case the consumer does not have them
|
|
2
|
+
// which can happen when they're not using PatternFly, or a different (older) version
|
|
3
|
+
// that could be incompatible with the version of PatternFly that we're using
|
|
4
|
+
|
|
5
|
+
@import '@patternfly/patternfly/sass-utilities/all';
|
|
6
|
+
|
|
7
|
+
.pfext-quick-start__base {
|
|
8
|
+
$pf-v5-global--enable-reset: false;
|
|
9
|
+
@import '@patternfly/patternfly/base/common';
|
|
10
|
+
@import '@patternfly/patternfly/utilities/Accessibility/accessibility';
|
|
11
|
+
|
|
12
|
+
// it's okay that we include everything since we'll purge the unused styles
|
|
13
|
+
@import '@patternfly/patternfly/components/all';
|
|
14
|
+
@import '@patternfly/patternfly/layouts/all';
|
|
15
|
+
|
|
16
|
+
// some apps globally set text-align: center
|
|
17
|
+
text-align: left;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './quickstarts-standalone.scss';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@import '@patternfly/patternfly/sass-utilities/all';
|
|
2
|
+
@import './legacy-bootstrap/variables';
|
|
3
|
+
|
|
4
|
+
@import './base';
|
|
5
|
+
@import './dark-custom-override';
|
|
6
|
+
|
|
7
|
+
// React Components
|
|
8
|
+
@import '../ConsoleInternal/**/*.scss';
|
|
9
|
+
@import '../ConsoleShared/**/*.scss';
|
|
10
|
+
|
|
11
|
+
// legacy bootstrap typography styles for markdown content
|
|
12
|
+
@import './legacy-bootstrap.scss';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './vendor.scss';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// be careful about adding additional stylesheets here, they are bundled into the quickstarts.css
|
|
2
|
+
|
|
3
|
+
@import '@patternfly/patternfly/sass-utilities/all';
|
|
4
|
+
|
|
5
|
+
@import '@patternfly/react-catalog-view-extension/dist/sass/react-catalog-view-extension.scss';
|
|
6
|
+
@import '@patternfly/patternfly/components/ClipboardCopy/clipboard-copy.scss';
|
|
7
|
+
@import '@patternfly/patternfly/components/CodeBlock/code-block.scss';
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// https://github.com/i18next/i18next/blob/master/src/PluralResolver.js
|
|
3
|
+
|
|
4
|
+
const sets = [
|
|
5
|
+
{
|
|
6
|
+
lngs: [
|
|
7
|
+
'ach',
|
|
8
|
+
'ak',
|
|
9
|
+
'am',
|
|
10
|
+
'arn',
|
|
11
|
+
'br',
|
|
12
|
+
'fil',
|
|
13
|
+
'gun',
|
|
14
|
+
'ln',
|
|
15
|
+
'mfe',
|
|
16
|
+
'mg',
|
|
17
|
+
'mi',
|
|
18
|
+
'oc',
|
|
19
|
+
'pt',
|
|
20
|
+
'pt-BR',
|
|
21
|
+
'tg',
|
|
22
|
+
'tl',
|
|
23
|
+
'ti',
|
|
24
|
+
'tr',
|
|
25
|
+
'uz',
|
|
26
|
+
'wa',
|
|
27
|
+
],
|
|
28
|
+
nr: [1, 2],
|
|
29
|
+
fc: 1,
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
lngs: [
|
|
34
|
+
'af',
|
|
35
|
+
'an',
|
|
36
|
+
'ast',
|
|
37
|
+
'az',
|
|
38
|
+
'bg',
|
|
39
|
+
'bn',
|
|
40
|
+
'ca',
|
|
41
|
+
'da',
|
|
42
|
+
'de',
|
|
43
|
+
'dev',
|
|
44
|
+
'el',
|
|
45
|
+
'en',
|
|
46
|
+
'eo',
|
|
47
|
+
'es',
|
|
48
|
+
'et',
|
|
49
|
+
'eu',
|
|
50
|
+
'fi',
|
|
51
|
+
'fo',
|
|
52
|
+
'fur',
|
|
53
|
+
'fy',
|
|
54
|
+
'gl',
|
|
55
|
+
'gu',
|
|
56
|
+
'ha',
|
|
57
|
+
'hi',
|
|
58
|
+
'hu',
|
|
59
|
+
'hy',
|
|
60
|
+
'ia',
|
|
61
|
+
'it',
|
|
62
|
+
'kk',
|
|
63
|
+
'kn',
|
|
64
|
+
'ku',
|
|
65
|
+
'lb',
|
|
66
|
+
'mai',
|
|
67
|
+
'ml',
|
|
68
|
+
'mn',
|
|
69
|
+
'mr',
|
|
70
|
+
'nah',
|
|
71
|
+
'nap',
|
|
72
|
+
'nb',
|
|
73
|
+
'ne',
|
|
74
|
+
'nl',
|
|
75
|
+
'nn',
|
|
76
|
+
'no',
|
|
77
|
+
'nso',
|
|
78
|
+
'pa',
|
|
79
|
+
'pap',
|
|
80
|
+
'pms',
|
|
81
|
+
'ps',
|
|
82
|
+
'pt-PT',
|
|
83
|
+
'rm',
|
|
84
|
+
'sco',
|
|
85
|
+
'se',
|
|
86
|
+
'si',
|
|
87
|
+
'so',
|
|
88
|
+
'son',
|
|
89
|
+
'sq',
|
|
90
|
+
'sv',
|
|
91
|
+
'sw',
|
|
92
|
+
'ta',
|
|
93
|
+
'te',
|
|
94
|
+
'tk',
|
|
95
|
+
'ur',
|
|
96
|
+
'yo',
|
|
97
|
+
],
|
|
98
|
+
nr: [1, 2],
|
|
99
|
+
fc: 2,
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
{
|
|
103
|
+
lngs: [
|
|
104
|
+
'ay',
|
|
105
|
+
'bo',
|
|
106
|
+
'cgg',
|
|
107
|
+
'fa',
|
|
108
|
+
'ht',
|
|
109
|
+
'id',
|
|
110
|
+
'ja',
|
|
111
|
+
'jbo',
|
|
112
|
+
'ka',
|
|
113
|
+
'km',
|
|
114
|
+
'ko',
|
|
115
|
+
'ky',
|
|
116
|
+
'lo',
|
|
117
|
+
'ms',
|
|
118
|
+
'sah',
|
|
119
|
+
'su',
|
|
120
|
+
'th',
|
|
121
|
+
'tt',
|
|
122
|
+
'ug',
|
|
123
|
+
'vi',
|
|
124
|
+
'wo',
|
|
125
|
+
'zh',
|
|
126
|
+
],
|
|
127
|
+
nr: [1],
|
|
128
|
+
fc: 3,
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
{ lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'], nr: [1, 2, 5], fc: 4 },
|
|
132
|
+
|
|
133
|
+
{ lngs: ['ar'], nr: [0, 1, 2, 3, 11, 100], fc: 5 },
|
|
134
|
+
{ lngs: ['cs', 'sk'], nr: [1, 2, 5], fc: 6 },
|
|
135
|
+
{ lngs: ['csb', 'pl'], nr: [1, 2, 5], fc: 7 },
|
|
136
|
+
{ lngs: ['cy'], nr: [1, 2, 3, 8], fc: 8 },
|
|
137
|
+
{ lngs: ['fr'], nr: [1, 2], fc: 9 },
|
|
138
|
+
{ lngs: ['ga'], nr: [1, 2, 3, 7, 11], fc: 10 },
|
|
139
|
+
{ lngs: ['gd'], nr: [1, 2, 3, 20], fc: 11 },
|
|
140
|
+
{ lngs: ['is'], nr: [1, 2], fc: 12 },
|
|
141
|
+
{ lngs: ['jv'], nr: [0, 1], fc: 13 },
|
|
142
|
+
{ lngs: ['kw'], nr: [1, 2, 3, 4], fc: 14 },
|
|
143
|
+
{ lngs: ['lt'], nr: [1, 2, 10], fc: 15 },
|
|
144
|
+
{ lngs: ['lv'], nr: [1, 2, 0], fc: 16 },
|
|
145
|
+
{ lngs: ['mk'], nr: [1, 2], fc: 17 },
|
|
146
|
+
{ lngs: ['mnk'], nr: [0, 1, 2], fc: 18 },
|
|
147
|
+
{ lngs: ['mt'], nr: [1, 2, 11, 20], fc: 19 },
|
|
148
|
+
{ lngs: ['or'], nr: [2, 1], fc: 2 },
|
|
149
|
+
{ lngs: ['ro'], nr: [1, 2, 20], fc: 20 },
|
|
150
|
+
{ lngs: ['sl'], nr: [5, 1, 2, 3], fc: 21 },
|
|
151
|
+
{ lngs: ['he', 'iw'], nr: [1, 2, 20, 21], fc: 22 },
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
const _rulesPluralsTypes = {
|
|
155
|
+
1: function (n) {
|
|
156
|
+
return Number(n > 1);
|
|
157
|
+
},
|
|
158
|
+
2: function (n) {
|
|
159
|
+
return Number(n != 1);
|
|
160
|
+
},
|
|
161
|
+
3: function (n) {
|
|
162
|
+
return 0;
|
|
163
|
+
},
|
|
164
|
+
4: function (n) {
|
|
165
|
+
return Number(
|
|
166
|
+
n % 10 == 1 && n % 100 != 11
|
|
167
|
+
? 0
|
|
168
|
+
: n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20)
|
|
169
|
+
? 1
|
|
170
|
+
: 2,
|
|
171
|
+
);
|
|
172
|
+
},
|
|
173
|
+
5: function (n) {
|
|
174
|
+
return Number(
|
|
175
|
+
n == 0
|
|
176
|
+
? 0
|
|
177
|
+
: n == 1
|
|
178
|
+
? 1
|
|
179
|
+
: n == 2
|
|
180
|
+
? 2
|
|
181
|
+
: n % 100 >= 3 && n % 100 <= 10
|
|
182
|
+
? 3
|
|
183
|
+
: n % 100 >= 11
|
|
184
|
+
? 4
|
|
185
|
+
: 5,
|
|
186
|
+
);
|
|
187
|
+
},
|
|
188
|
+
6: function (n) {
|
|
189
|
+
return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2);
|
|
190
|
+
},
|
|
191
|
+
7: function (n) {
|
|
192
|
+
return Number(
|
|
193
|
+
n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2,
|
|
194
|
+
);
|
|
195
|
+
},
|
|
196
|
+
8: function (n) {
|
|
197
|
+
return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3);
|
|
198
|
+
},
|
|
199
|
+
9: function (n) {
|
|
200
|
+
return Number(n >= 2);
|
|
201
|
+
},
|
|
202
|
+
10: function (n) {
|
|
203
|
+
return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4);
|
|
204
|
+
},
|
|
205
|
+
11: function (n) {
|
|
206
|
+
return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3);
|
|
207
|
+
},
|
|
208
|
+
12: function (n) {
|
|
209
|
+
return Number(n % 10 != 1 || n % 100 == 11);
|
|
210
|
+
},
|
|
211
|
+
13: function (n) {
|
|
212
|
+
return Number(n !== 0);
|
|
213
|
+
},
|
|
214
|
+
14: function (n) {
|
|
215
|
+
return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3);
|
|
216
|
+
},
|
|
217
|
+
15: function (n) {
|
|
218
|
+
return Number(
|
|
219
|
+
n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2,
|
|
220
|
+
);
|
|
221
|
+
},
|
|
222
|
+
16: function (n) {
|
|
223
|
+
return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2);
|
|
224
|
+
},
|
|
225
|
+
17: function (n) {
|
|
226
|
+
return Number(n == 1 || (n % 10 == 1 && n % 100 != 11) ? 0 : 1);
|
|
227
|
+
},
|
|
228
|
+
18: function (n) {
|
|
229
|
+
return Number(n == 0 ? 0 : n == 1 ? 1 : 2);
|
|
230
|
+
},
|
|
231
|
+
19: function (n) {
|
|
232
|
+
return Number(
|
|
233
|
+
n == 1
|
|
234
|
+
? 0
|
|
235
|
+
: n == 0 || (n % 100 > 1 && n % 100 < 11)
|
|
236
|
+
? 1
|
|
237
|
+
: n % 100 > 10 && n % 100 < 20
|
|
238
|
+
? 2
|
|
239
|
+
: 3,
|
|
240
|
+
);
|
|
241
|
+
},
|
|
242
|
+
20: function (n) {
|
|
243
|
+
return Number(n == 1 ? 0 : n == 0 || (n % 100 > 0 && n % 100 < 20) ? 1 : 2);
|
|
244
|
+
},
|
|
245
|
+
21: function (n) {
|
|
246
|
+
return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0);
|
|
247
|
+
},
|
|
248
|
+
22: function (n) {
|
|
249
|
+
return Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3);
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
function createRules() {
|
|
254
|
+
const rules = {};
|
|
255
|
+
sets.forEach((set) => {
|
|
256
|
+
set.lngs.forEach((l) => {
|
|
257
|
+
rules[l] = {
|
|
258
|
+
numbers: set.nr,
|
|
259
|
+
plurals: _rulesPluralsTypes[set.fc],
|
|
260
|
+
};
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
return rules;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
class PluralResolver {
|
|
267
|
+
options: {
|
|
268
|
+
simplifyPluralSuffix?: string;
|
|
269
|
+
compatibilityJSON?: string;
|
|
270
|
+
prepend?: boolean;
|
|
271
|
+
};
|
|
272
|
+
rules: {};
|
|
273
|
+
|
|
274
|
+
constructor(options = {}) {
|
|
275
|
+
this.options = options;
|
|
276
|
+
|
|
277
|
+
this.rules = createRules();
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
addRule(lng, obj) {
|
|
281
|
+
this.rules[lng] = obj;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
getRule(code) {
|
|
285
|
+
return this.rules[code];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
needsPlural(code) {
|
|
289
|
+
const rule = this.getRule(code);
|
|
290
|
+
|
|
291
|
+
return rule && rule.numbers.length > 1;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
getPluralFormsOfKey(code, key) {
|
|
295
|
+
return this.getSuffixes(code).map((suffix) => key + suffix);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
getSuffixes(code) {
|
|
299
|
+
const rule = this.getRule(code);
|
|
300
|
+
|
|
301
|
+
if (!rule) {
|
|
302
|
+
return [];
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return rule.numbers.map((number) => this.getSuffix(code, number));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
getSuffix(code, count) {
|
|
309
|
+
const rule = this.getRule(code);
|
|
310
|
+
|
|
311
|
+
if (rule) {
|
|
312
|
+
// if (rule.numbers.length === 1) return ''; // only singular
|
|
313
|
+
|
|
314
|
+
const idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
|
|
315
|
+
let suffix = rule.numbers[idx];
|
|
316
|
+
|
|
317
|
+
// special treatment for lngs only having singular and plural
|
|
318
|
+
if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
319
|
+
if (suffix === 2) {
|
|
320
|
+
suffix = 'plural';
|
|
321
|
+
} else if (suffix === 1) {
|
|
322
|
+
suffix = '';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const returnSuffix = () =>
|
|
327
|
+
this.options.prepend && suffix.toString()
|
|
328
|
+
? this.options.prepend + suffix.toString()
|
|
329
|
+
: suffix.toString();
|
|
330
|
+
|
|
331
|
+
// COMPATIBILITY JSON
|
|
332
|
+
// v1
|
|
333
|
+
if (this.options.compatibilityJSON === 'v1') {
|
|
334
|
+
if (suffix === 1) {
|
|
335
|
+
return '';
|
|
336
|
+
}
|
|
337
|
+
if (typeof suffix === 'number') {
|
|
338
|
+
return `_plural_${suffix.toString()}`;
|
|
339
|
+
}
|
|
340
|
+
return returnSuffix();
|
|
341
|
+
}
|
|
342
|
+
if (/* v2 */ this.options.compatibilityJSON === 'v2') {
|
|
343
|
+
return returnSuffix();
|
|
344
|
+
}
|
|
345
|
+
if (
|
|
346
|
+
/* v3 - gettext index */ this.options.simplifyPluralSuffix &&
|
|
347
|
+
rule.numbers.length === 2 &&
|
|
348
|
+
rule.numbers[0] === 1
|
|
349
|
+
) {
|
|
350
|
+
return returnSuffix();
|
|
351
|
+
}
|
|
352
|
+
return this.options.prepend && idx.toString()
|
|
353
|
+
? this.options.prepend + idx.toString()
|
|
354
|
+
: idx.toString();
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// this.logger.warn(`no plural rule found for: ${code}`);
|
|
358
|
+
return '';
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export default PluralResolver;
|