@patternfly/quickstarts 6.2.2 → 6.3.0-prerelease.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConsoleInternal/components/markdown-view.d.ts +2 -2
- package/dist/ConsoleInternal/components/utils/camel-case-wrap.d.ts +1 -1
- package/dist/ConsoleInternal/components/utils/status-box.d.ts +3 -3
- package/dist/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.d.ts +3 -3
- package/dist/ConsoleShared/src/components/markdown-extensions/accordion-extension.d.ts +1 -1
- package/dist/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.d.ts +2 -2
- package/dist/ConsoleShared/src/components/markdown-extensions/admonition-extension.d.ts +1 -1
- package/dist/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.d.ts +2 -2
- package/dist/ConsoleShared/src/components/modal/Modal.d.ts +3 -3
- package/dist/ConsoleShared/src/components/popper/Portal.d.ts +3 -3
- package/dist/ConsoleShared/src/components/popper/SimplePopper.d.ts +3 -3
- package/dist/ConsoleShared/src/components/spotlight/InteractiveSpotlight.d.ts +2 -2
- package/dist/ConsoleShared/src/components/spotlight/Spotlight.d.ts +2 -2
- package/dist/ConsoleShared/src/components/spotlight/StaticSpotlight.d.ts +2 -2
- package/dist/ConsoleShared/src/components/status/GenericStatus.d.ts +4 -4
- package/dist/ConsoleShared/src/components/status/NotStartedIcon.d.ts +1 -2
- package/dist/ConsoleShared/src/components/status/PopoverStatus.d.ts +4 -4
- package/dist/ConsoleShared/src/components/status/Status.d.ts +3 -3
- package/dist/ConsoleShared/src/components/status/StatusIconAndText.d.ts +3 -3
- package/dist/ConsoleShared/src/components/status/icons.d.ts +4 -4
- package/dist/ConsoleShared/src/components/status/statuses.d.ts +4 -4
- package/dist/ConsoleShared/src/components/utils/FallbackImg.d.ts +3 -3
- package/dist/ConsoleShared/src/utils/useCombineRefs.d.ts +2 -2
- package/dist/HelpTopicDrawer.d.ts +3 -3
- package/dist/HelpTopicPanelContent.d.ts +2 -2
- package/dist/QuickStartCatalogPage.d.ts +3 -3
- package/dist/QuickStartCloseModal.d.ts +2 -2
- package/dist/QuickStartContainer.d.ts +2 -2
- package/dist/QuickStartController.d.ts +2 -2
- package/dist/QuickStartDrawer.d.ts +2 -2
- package/dist/QuickStartDrawerContent.d.ts +2 -2
- package/dist/QuickStartMarkdownView.d.ts +2 -2
- package/dist/QuickStartPanelContent.d.ts +2 -2
- package/dist/catalog/Catalog/QuickStartCatalogHeader.d.ts +2 -2
- package/dist/catalog/Catalog/QuickStartCatalogSection.d.ts +2 -2
- package/dist/catalog/Catalog/QuickStartCatalogToolbar.d.ts +2 -2
- package/dist/catalog/QuickStartCatalog.d.ts +2 -2
- package/dist/catalog/QuickStartTile.d.ts +2 -2
- package/dist/catalog/QuickStartTileDescription.d.ts +2 -2
- package/dist/catalog/QuickStartTileFooter.d.ts +2 -2
- package/dist/catalog/QuickStartTileFooterExternal.d.ts +2 -2
- package/dist/catalog/QuickStartTileHeader.d.ts +2 -2
- package/dist/catalog/Toolbar/QuickStartCatalogFilter.d.ts +2 -2
- package/dist/catalog/Toolbar/QuickStartCatalogFilterItems.d.ts +7 -7
- package/dist/controller/QuickStartConclusion.d.ts +2 -2
- package/dist/controller/QuickStartContent.d.ts +2 -2
- package/dist/controller/QuickStartFooter.d.ts +2 -2
- package/dist/controller/QuickStartIntroduction.d.ts +2 -2
- package/dist/controller/QuickStartTaskHeader.d.ts +2 -2
- package/dist/controller/QuickStartTaskHeaderList.d.ts +2 -2
- package/dist/controller/QuickStartTaskReview.d.ts +2 -2
- package/dist/controller/QuickStartTasks.d.ts +2 -2
- package/dist/index.es.js +489 -561
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +500 -574
- package/dist/index.js.map +1 -1
- package/dist/quickstarts-base.css +4 -4
- package/dist/quickstarts-full.es.js +1963 -693
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts.css +4 -4
- package/dist/quickstarts.min.css +1 -1
- package/dist/utils/help-topic-context.d.ts +2 -2
- package/dist/utils/quick-start-context.d.ts +3 -3
- package/package.json +7 -7
- package/src/ConsoleInternal/components/markdown-view.tsx +112 -22
- package/src/ConsoleInternal/components/utils/camel-case-wrap.tsx +3 -3
- package/src/ConsoleInternal/components/utils/status-box.tsx +4 -4
- package/src/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.tsx +8 -15
- package/src/ConsoleShared/src/components/markdown-extensions/__tests__/MarkdownCopyClipboard.spec.tsx +0 -1
- package/src/ConsoleShared/src/components/markdown-extensions/__tests__/accordion-extension.spec.tsx +105 -0
- package/src/ConsoleShared/src/components/markdown-extensions/__tests__/admonition-extension.spec.tsx +121 -0
- package/src/ConsoleShared/src/components/markdown-extensions/accordion-extension.tsx +22 -15
- package/src/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.tsx +23 -9
- package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +19 -8
- package/src/ConsoleShared/src/components/markdown-extensions/code-extension.tsx +2 -2
- package/src/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.tsx +3 -3
- package/src/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.tsx +3 -3
- package/src/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.tsx +5 -5
- package/src/ConsoleShared/src/components/modal/Modal.tsx +3 -3
- package/src/ConsoleShared/src/components/popper/Portal.tsx +5 -5
- package/src/ConsoleShared/src/components/popper/SimplePopper.tsx +15 -15
- package/src/ConsoleShared/src/components/spotlight/InteractiveSpotlight.tsx +5 -5
- package/src/ConsoleShared/src/components/spotlight/Spotlight.tsx +3 -3
- package/src/ConsoleShared/src/components/spotlight/StaticSpotlight.tsx +3 -3
- package/src/ConsoleShared/src/components/status/GenericStatus.tsx +5 -5
- package/src/ConsoleShared/src/components/status/NotStartedIcon.tsx +0 -1
- package/src/ConsoleShared/src/components/status/PopoverStatus.tsx +4 -4
- package/src/ConsoleShared/src/components/status/Status.tsx +3 -11
- package/src/ConsoleShared/src/components/status/StatusIconAndText.tsx +6 -6
- package/src/ConsoleShared/src/components/status/icons.tsx +4 -8
- package/src/ConsoleShared/src/components/status/statuses.tsx +4 -5
- package/src/ConsoleShared/src/components/utils/FallbackImg.tsx +4 -4
- package/src/ConsoleShared/src/hooks/scroll.ts +4 -4
- package/src/ConsoleShared/src/hooks/useBoundingClientRect.ts +3 -3
- package/src/ConsoleShared/src/hooks/useForceRender.ts +2 -2
- package/src/ConsoleShared/src/hooks/useResizeObserver.ts +3 -6
- package/src/ConsoleShared/src/hooks/useScrollShadows.ts +4 -4
- package/src/ConsoleShared/src/utils/useCombineRefs.ts +4 -4
- package/src/HelpTopicDrawer.tsx +6 -6
- package/src/HelpTopicPanelContent.tsx +4 -4
- package/src/QuickStartCatalogPage.tsx +9 -9
- package/src/QuickStartCloseModal.tsx +3 -7
- package/src/QuickStartContainer.tsx +4 -4
- package/src/QuickStartController.tsx +11 -11
- package/src/QuickStartDrawer.tsx +6 -6
- package/src/QuickStartDrawerContent.tsx +6 -4
- package/src/QuickStartMarkdownView.tsx +3 -3
- package/src/QuickStartPanelContent.tsx +8 -8
- package/src/catalog/Catalog/QuickStartCatalogHeader.tsx +2 -2
- package/src/catalog/Catalog/QuickStartCatalogSection.tsx +2 -2
- package/src/catalog/Catalog/QuickStartCatalogToolbar.tsx +2 -2
- package/src/catalog/QuickStartCatalog.tsx +3 -3
- package/src/catalog/QuickStartTile.tsx +4 -4
- package/src/catalog/QuickStartTileDescription.tsx +4 -4
- package/src/catalog/QuickStartTileFooter.tsx +6 -6
- package/src/catalog/QuickStartTileFooterExternal.tsx +2 -5
- package/src/catalog/QuickStartTileHeader.tsx +2 -6
- package/src/catalog/Toolbar/QuickStartCatalogFilter.tsx +2 -2
- package/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +17 -20
- package/src/catalog/__tests__/QuickStartCatalog.spec.tsx +0 -1
- package/src/catalog/__tests__/QuickStartTile.spec.tsx +0 -1
- package/src/catalog/__tests__/QuickStartTileDescription.spec.tsx +1 -2
- package/src/controller/QuickStartConclusion.tsx +3 -3
- package/src/controller/QuickStartContent.tsx +2 -2
- package/src/controller/QuickStartFooter.tsx +10 -11
- package/src/controller/QuickStartIntroduction.tsx +5 -5
- package/src/controller/QuickStartTaskHeader.tsx +5 -5
- package/src/controller/QuickStartTaskHeaderList.tsx +2 -2
- package/src/controller/QuickStartTaskReview.tsx +4 -4
- package/src/controller/QuickStartTasks.tsx +5 -5
- package/src/controller/__tests__/QuickStartConclusion.spec.tsx +3 -3
- package/src/controller/__tests__/QuickStartContent.spec.tsx +2 -2
- package/src/controller/__tests__/QuickStartTaskHeader.spec.tsx +2 -2
- package/src/controller/__tests__/QuickStartTaskReview.spec.tsx +2 -2
- package/src/utils/help-topic-context.tsx +7 -10
- package/src/utils/quick-start-context.tsx +11 -11
|
@@ -1,9 +1,1376 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useRef, useEffect, forwardRef, useImperativeHandle, useMemo, useState, createContext, useCallback } from 'react';
|
|
2
|
+
import React__default, { useRef, useEffect, forwardRef, useImperativeHandle, useMemo, useState, createContext, useCallback, useContext, Fragment as Fragment$1, useReducer, cloneElement, Children } from 'react';
|
|
3
3
|
import * as ReactDOM from 'react-dom';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
4
5
|
import fa$1 from 'stream';
|
|
5
6
|
import aa from 'util';
|
|
6
7
|
|
|
8
|
+
function getDefaultExportFromCjs (x) {
|
|
9
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getAugmentedNamespace(n) {
|
|
13
|
+
if (n.__esModule) return n;
|
|
14
|
+
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
15
|
+
Object.keys(n).forEach(function (k) {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
17
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return n[k];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
return a;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function createCommonjsModule(fn) {
|
|
28
|
+
var module = { exports: {} };
|
|
29
|
+
return fn(module, module.exports), module.exports;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @license React
|
|
34
|
+
* react-jsx-runtime.production.min.js
|
|
35
|
+
*
|
|
36
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the MIT license found in the
|
|
39
|
+
* LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/
|
|
41
|
+
var k$1=Symbol.for("react.element"),l$2=Symbol.for("react.fragment"),m$1=Object.prototype.hasOwnProperty,n$1=React__default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
42
|
+
function q$2(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m$1.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k$1,type:c,key:e,ref:h,props:d,_owner:n$1.current}}var Fragment=l$2;var jsx=q$2;var jsxs=q$2;
|
|
43
|
+
|
|
44
|
+
var reactJsxRuntime_production_min = {
|
|
45
|
+
Fragment: Fragment,
|
|
46
|
+
jsx: jsx,
|
|
47
|
+
jsxs: jsxs
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @license React
|
|
52
|
+
* react-jsx-runtime.development.js
|
|
53
|
+
*
|
|
54
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the MIT license found in the
|
|
57
|
+
* LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
var reactJsxRuntime_development = createCommonjsModule(function (module, exports) {
|
|
61
|
+
|
|
62
|
+
if (process.env.NODE_ENV !== "production") {
|
|
63
|
+
(function() {
|
|
64
|
+
|
|
65
|
+
var React = React__default;
|
|
66
|
+
|
|
67
|
+
// ATTENTION
|
|
68
|
+
// When adding new symbols to this file,
|
|
69
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
70
|
+
// The Symbol used to tag the ReactElement-like types.
|
|
71
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
72
|
+
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
73
|
+
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
74
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
75
|
+
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
76
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
77
|
+
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
78
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
79
|
+
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
80
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
81
|
+
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
82
|
+
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
83
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
84
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
85
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
86
|
+
function getIteratorFn(maybeIterable) {
|
|
87
|
+
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
92
|
+
|
|
93
|
+
if (typeof maybeIterator === 'function') {
|
|
94
|
+
return maybeIterator;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
101
|
+
|
|
102
|
+
function error(format) {
|
|
103
|
+
{
|
|
104
|
+
{
|
|
105
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
106
|
+
args[_key2 - 1] = arguments[_key2];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
printWarning('error', format, args);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function printWarning(level, format, args) {
|
|
115
|
+
// When changing this logic, you might want to also
|
|
116
|
+
// update consoleWithStackDev.www.js as well.
|
|
117
|
+
{
|
|
118
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
119
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
120
|
+
|
|
121
|
+
if (stack !== '') {
|
|
122
|
+
format += '%s';
|
|
123
|
+
args = args.concat([stack]);
|
|
124
|
+
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
var argsWithFormat = args.map(function (item) {
|
|
128
|
+
return String(item);
|
|
129
|
+
}); // Careful: RN currently depends on this prefix
|
|
130
|
+
|
|
131
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
132
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
133
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
134
|
+
|
|
135
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// -----------------------------------------------------------------------------
|
|
140
|
+
|
|
141
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
142
|
+
var enableCacheElement = false;
|
|
143
|
+
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
144
|
+
|
|
145
|
+
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
146
|
+
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
147
|
+
// issues in DEV builds.
|
|
148
|
+
|
|
149
|
+
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
150
|
+
|
|
151
|
+
var REACT_MODULE_REFERENCE;
|
|
152
|
+
|
|
153
|
+
{
|
|
154
|
+
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function isValidElementType(type) {
|
|
158
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
159
|
+
return true;
|
|
160
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (typeof type === 'object' && type !== null) {
|
|
168
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
169
|
+
// types supported by any Flight configuration anywhere since
|
|
170
|
+
// we don't know which Flight build this will end up being used
|
|
171
|
+
// with.
|
|
172
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
181
|
+
var displayName = outerType.displayName;
|
|
182
|
+
|
|
183
|
+
if (displayName) {
|
|
184
|
+
return displayName;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
188
|
+
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
189
|
+
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
function getContextName(type) {
|
|
193
|
+
return type.displayName || 'Context';
|
|
194
|
+
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
function getComponentNameFromType(type) {
|
|
198
|
+
if (type == null) {
|
|
199
|
+
// Host root, text node or just invalid type.
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
{
|
|
204
|
+
if (typeof type.tag === 'number') {
|
|
205
|
+
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (typeof type === 'function') {
|
|
210
|
+
return type.displayName || type.name || null;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (typeof type === 'string') {
|
|
214
|
+
return type;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
switch (type) {
|
|
218
|
+
case REACT_FRAGMENT_TYPE:
|
|
219
|
+
return 'Fragment';
|
|
220
|
+
|
|
221
|
+
case REACT_PORTAL_TYPE:
|
|
222
|
+
return 'Portal';
|
|
223
|
+
|
|
224
|
+
case REACT_PROFILER_TYPE:
|
|
225
|
+
return 'Profiler';
|
|
226
|
+
|
|
227
|
+
case REACT_STRICT_MODE_TYPE:
|
|
228
|
+
return 'StrictMode';
|
|
229
|
+
|
|
230
|
+
case REACT_SUSPENSE_TYPE:
|
|
231
|
+
return 'Suspense';
|
|
232
|
+
|
|
233
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
234
|
+
return 'SuspenseList';
|
|
235
|
+
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (typeof type === 'object') {
|
|
239
|
+
switch (type.$$typeof) {
|
|
240
|
+
case REACT_CONTEXT_TYPE:
|
|
241
|
+
var context = type;
|
|
242
|
+
return getContextName(context) + '.Consumer';
|
|
243
|
+
|
|
244
|
+
case REACT_PROVIDER_TYPE:
|
|
245
|
+
var provider = type;
|
|
246
|
+
return getContextName(provider._context) + '.Provider';
|
|
247
|
+
|
|
248
|
+
case REACT_FORWARD_REF_TYPE:
|
|
249
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
250
|
+
|
|
251
|
+
case REACT_MEMO_TYPE:
|
|
252
|
+
var outerName = type.displayName || null;
|
|
253
|
+
|
|
254
|
+
if (outerName !== null) {
|
|
255
|
+
return outerName;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
return getComponentNameFromType(type.type) || 'Memo';
|
|
259
|
+
|
|
260
|
+
case REACT_LAZY_TYPE:
|
|
261
|
+
{
|
|
262
|
+
var lazyComponent = type;
|
|
263
|
+
var payload = lazyComponent._payload;
|
|
264
|
+
var init = lazyComponent._init;
|
|
265
|
+
|
|
266
|
+
try {
|
|
267
|
+
return getComponentNameFromType(init(payload));
|
|
268
|
+
} catch (x) {
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// eslint-disable-next-line no-fallthrough
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
var assign = Object.assign;
|
|
281
|
+
|
|
282
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
283
|
+
// replaying on render function. This currently only patches the object
|
|
284
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
285
|
+
// We could also eagerly patch the method.
|
|
286
|
+
var disabledDepth = 0;
|
|
287
|
+
var prevLog;
|
|
288
|
+
var prevInfo;
|
|
289
|
+
var prevWarn;
|
|
290
|
+
var prevError;
|
|
291
|
+
var prevGroup;
|
|
292
|
+
var prevGroupCollapsed;
|
|
293
|
+
var prevGroupEnd;
|
|
294
|
+
|
|
295
|
+
function disabledLog() {}
|
|
296
|
+
|
|
297
|
+
disabledLog.__reactDisabledLog = true;
|
|
298
|
+
function disableLogs() {
|
|
299
|
+
{
|
|
300
|
+
if (disabledDepth === 0) {
|
|
301
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
302
|
+
prevLog = console.log;
|
|
303
|
+
prevInfo = console.info;
|
|
304
|
+
prevWarn = console.warn;
|
|
305
|
+
prevError = console.error;
|
|
306
|
+
prevGroup = console.group;
|
|
307
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
308
|
+
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
309
|
+
|
|
310
|
+
var props = {
|
|
311
|
+
configurable: true,
|
|
312
|
+
enumerable: true,
|
|
313
|
+
value: disabledLog,
|
|
314
|
+
writable: true
|
|
315
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
316
|
+
|
|
317
|
+
Object.defineProperties(console, {
|
|
318
|
+
info: props,
|
|
319
|
+
log: props,
|
|
320
|
+
warn: props,
|
|
321
|
+
error: props,
|
|
322
|
+
group: props,
|
|
323
|
+
groupCollapsed: props,
|
|
324
|
+
groupEnd: props
|
|
325
|
+
});
|
|
326
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
disabledDepth++;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function reenableLogs() {
|
|
333
|
+
{
|
|
334
|
+
disabledDepth--;
|
|
335
|
+
|
|
336
|
+
if (disabledDepth === 0) {
|
|
337
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
338
|
+
var props = {
|
|
339
|
+
configurable: true,
|
|
340
|
+
enumerable: true,
|
|
341
|
+
writable: true
|
|
342
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
343
|
+
|
|
344
|
+
Object.defineProperties(console, {
|
|
345
|
+
log: assign({}, props, {
|
|
346
|
+
value: prevLog
|
|
347
|
+
}),
|
|
348
|
+
info: assign({}, props, {
|
|
349
|
+
value: prevInfo
|
|
350
|
+
}),
|
|
351
|
+
warn: assign({}, props, {
|
|
352
|
+
value: prevWarn
|
|
353
|
+
}),
|
|
354
|
+
error: assign({}, props, {
|
|
355
|
+
value: prevError
|
|
356
|
+
}),
|
|
357
|
+
group: assign({}, props, {
|
|
358
|
+
value: prevGroup
|
|
359
|
+
}),
|
|
360
|
+
groupCollapsed: assign({}, props, {
|
|
361
|
+
value: prevGroupCollapsed
|
|
362
|
+
}),
|
|
363
|
+
groupEnd: assign({}, props, {
|
|
364
|
+
value: prevGroupEnd
|
|
365
|
+
})
|
|
366
|
+
});
|
|
367
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (disabledDepth < 0) {
|
|
371
|
+
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
377
|
+
var prefix;
|
|
378
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
379
|
+
{
|
|
380
|
+
if (prefix === undefined) {
|
|
381
|
+
// Extract the VM specific prefix used by each line.
|
|
382
|
+
try {
|
|
383
|
+
throw Error();
|
|
384
|
+
} catch (x) {
|
|
385
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
386
|
+
prefix = match && match[1] || '';
|
|
387
|
+
}
|
|
388
|
+
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
return '\n' + prefix + name;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
var reentry = false;
|
|
395
|
+
var componentFrameCache;
|
|
396
|
+
|
|
397
|
+
{
|
|
398
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
399
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
403
|
+
// If something asked for a stack inside a fake render, it should get ignored.
|
|
404
|
+
if ( !fn || reentry) {
|
|
405
|
+
return '';
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
{
|
|
409
|
+
var frame = componentFrameCache.get(fn);
|
|
410
|
+
|
|
411
|
+
if (frame !== undefined) {
|
|
412
|
+
return frame;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
var control;
|
|
417
|
+
reentry = true;
|
|
418
|
+
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
419
|
+
|
|
420
|
+
Error.prepareStackTrace = undefined;
|
|
421
|
+
var previousDispatcher;
|
|
422
|
+
|
|
423
|
+
{
|
|
424
|
+
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
425
|
+
// for warnings.
|
|
426
|
+
|
|
427
|
+
ReactCurrentDispatcher.current = null;
|
|
428
|
+
disableLogs();
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
try {
|
|
432
|
+
// This should throw.
|
|
433
|
+
if (construct) {
|
|
434
|
+
// Something should be setting the props in the constructor.
|
|
435
|
+
var Fake = function () {
|
|
436
|
+
throw Error();
|
|
437
|
+
}; // $FlowFixMe
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
441
|
+
set: function () {
|
|
442
|
+
// We use a throwing setter instead of frozen or non-writable props
|
|
443
|
+
// because that won't throw in a non-strict mode function.
|
|
444
|
+
throw Error();
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
449
|
+
// We construct a different control for this case to include any extra
|
|
450
|
+
// frames added by the construct call.
|
|
451
|
+
try {
|
|
452
|
+
Reflect.construct(Fake, []);
|
|
453
|
+
} catch (x) {
|
|
454
|
+
control = x;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
Reflect.construct(fn, [], Fake);
|
|
458
|
+
} else {
|
|
459
|
+
try {
|
|
460
|
+
Fake.call();
|
|
461
|
+
} catch (x) {
|
|
462
|
+
control = x;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
fn.call(Fake.prototype);
|
|
466
|
+
}
|
|
467
|
+
} else {
|
|
468
|
+
try {
|
|
469
|
+
throw Error();
|
|
470
|
+
} catch (x) {
|
|
471
|
+
control = x;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
fn();
|
|
475
|
+
}
|
|
476
|
+
} catch (sample) {
|
|
477
|
+
// This is inlined manually because closure doesn't do it for us.
|
|
478
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
479
|
+
// This extracts the first frame from the sample that isn't also in the control.
|
|
480
|
+
// Skipping one frame that we assume is the frame that calls the two.
|
|
481
|
+
var sampleLines = sample.stack.split('\n');
|
|
482
|
+
var controlLines = control.stack.split('\n');
|
|
483
|
+
var s = sampleLines.length - 1;
|
|
484
|
+
var c = controlLines.length - 1;
|
|
485
|
+
|
|
486
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
487
|
+
// We expect at least one stack frame to be shared.
|
|
488
|
+
// Typically this will be the root most one. However, stack frames may be
|
|
489
|
+
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
490
|
+
// earlier than the other. We assume that the sample is longer or the same
|
|
491
|
+
// and there for cut off earlier. So we should find the root most frame in
|
|
492
|
+
// the sample somewhere in the control.
|
|
493
|
+
c--;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
497
|
+
// Next we find the first one that isn't the same which should be the
|
|
498
|
+
// frame that called our sample function and the control.
|
|
499
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
500
|
+
// In V8, the first line is describing the message but other VMs don't.
|
|
501
|
+
// If we're about to return the first line, and the control is also on the same
|
|
502
|
+
// line, that's a pretty good indicator that our sample threw at same line as
|
|
503
|
+
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
504
|
+
// This can happen if you passed a class to function component, or non-function.
|
|
505
|
+
if (s !== 1 || c !== 1) {
|
|
506
|
+
do {
|
|
507
|
+
s--;
|
|
508
|
+
c--; // We may still have similar intermediate frames from the construct call.
|
|
509
|
+
// The next one that isn't the same should be our match though.
|
|
510
|
+
|
|
511
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
512
|
+
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
513
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
514
|
+
// but we have a user-provided "displayName"
|
|
515
|
+
// splice it in to make the stack more readable.
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
519
|
+
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
{
|
|
523
|
+
if (typeof fn === 'function') {
|
|
524
|
+
componentFrameCache.set(fn, _frame);
|
|
525
|
+
}
|
|
526
|
+
} // Return the line we found.
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
return _frame;
|
|
530
|
+
}
|
|
531
|
+
} while (s >= 1 && c >= 0);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
} finally {
|
|
539
|
+
reentry = false;
|
|
540
|
+
|
|
541
|
+
{
|
|
542
|
+
ReactCurrentDispatcher.current = previousDispatcher;
|
|
543
|
+
reenableLogs();
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
547
|
+
} // Fallback to just using the name if we couldn't make it throw.
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
var name = fn ? fn.displayName || fn.name : '';
|
|
551
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
552
|
+
|
|
553
|
+
{
|
|
554
|
+
if (typeof fn === 'function') {
|
|
555
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
return syntheticFrame;
|
|
560
|
+
}
|
|
561
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
562
|
+
{
|
|
563
|
+
return describeNativeComponentFrame(fn, false);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
function shouldConstruct(Component) {
|
|
568
|
+
var prototype = Component.prototype;
|
|
569
|
+
return !!(prototype && prototype.isReactComponent);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
573
|
+
|
|
574
|
+
if (type == null) {
|
|
575
|
+
return '';
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
if (typeof type === 'function') {
|
|
579
|
+
{
|
|
580
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
if (typeof type === 'string') {
|
|
585
|
+
return describeBuiltInComponentFrame(type);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
switch (type) {
|
|
589
|
+
case REACT_SUSPENSE_TYPE:
|
|
590
|
+
return describeBuiltInComponentFrame('Suspense');
|
|
591
|
+
|
|
592
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
593
|
+
return describeBuiltInComponentFrame('SuspenseList');
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
if (typeof type === 'object') {
|
|
597
|
+
switch (type.$$typeof) {
|
|
598
|
+
case REACT_FORWARD_REF_TYPE:
|
|
599
|
+
return describeFunctionComponentFrame(type.render);
|
|
600
|
+
|
|
601
|
+
case REACT_MEMO_TYPE:
|
|
602
|
+
// Memo may contain any component type so we recursively resolve it.
|
|
603
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
604
|
+
|
|
605
|
+
case REACT_LAZY_TYPE:
|
|
606
|
+
{
|
|
607
|
+
var lazyComponent = type;
|
|
608
|
+
var payload = lazyComponent._payload;
|
|
609
|
+
var init = lazyComponent._init;
|
|
610
|
+
|
|
611
|
+
try {
|
|
612
|
+
// Lazy may contain any component type so we recursively resolve it.
|
|
613
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
614
|
+
} catch (x) {}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
return '';
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
623
|
+
|
|
624
|
+
var loggedTypeFailures = {};
|
|
625
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
626
|
+
|
|
627
|
+
function setCurrentlyValidatingElement(element) {
|
|
628
|
+
{
|
|
629
|
+
if (element) {
|
|
630
|
+
var owner = element._owner;
|
|
631
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
632
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
633
|
+
} else {
|
|
634
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
640
|
+
{
|
|
641
|
+
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
642
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
643
|
+
|
|
644
|
+
for (var typeSpecName in typeSpecs) {
|
|
645
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
646
|
+
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
647
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
648
|
+
// After these have been cleaned up, we'll let them throw.
|
|
649
|
+
|
|
650
|
+
try {
|
|
651
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
652
|
+
// behavior as without this statement except with a better message.
|
|
653
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
654
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
655
|
+
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
656
|
+
err.name = 'Invariant Violation';
|
|
657
|
+
throw err;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
661
|
+
} catch (ex) {
|
|
662
|
+
error$1 = ex;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
666
|
+
setCurrentlyValidatingElement(element);
|
|
667
|
+
|
|
668
|
+
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
|
669
|
+
|
|
670
|
+
setCurrentlyValidatingElement(null);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
674
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
675
|
+
// same error.
|
|
676
|
+
loggedTypeFailures[error$1.message] = true;
|
|
677
|
+
setCurrentlyValidatingElement(element);
|
|
678
|
+
|
|
679
|
+
error('Failed %s type: %s', location, error$1.message);
|
|
680
|
+
|
|
681
|
+
setCurrentlyValidatingElement(null);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
689
|
+
|
|
690
|
+
function isArray(a) {
|
|
691
|
+
return isArrayImpl(a);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/*
|
|
695
|
+
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
696
|
+
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
697
|
+
*
|
|
698
|
+
* The functions in this module will throw an easier-to-understand,
|
|
699
|
+
* easier-to-debug exception with a clear errors message message explaining the
|
|
700
|
+
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
701
|
+
* of the `value` object).
|
|
702
|
+
*/
|
|
703
|
+
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
704
|
+
function typeName(value) {
|
|
705
|
+
{
|
|
706
|
+
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
707
|
+
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
708
|
+
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
709
|
+
return type;
|
|
710
|
+
}
|
|
711
|
+
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
function willCoercionThrow(value) {
|
|
715
|
+
{
|
|
716
|
+
try {
|
|
717
|
+
testStringCoercion(value);
|
|
718
|
+
return false;
|
|
719
|
+
} catch (e) {
|
|
720
|
+
return true;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
function testStringCoercion(value) {
|
|
726
|
+
// If you ended up here by following an exception call stack, here's what's
|
|
727
|
+
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
728
|
+
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
729
|
+
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
730
|
+
//
|
|
731
|
+
// The most common types that will cause this exception are `Symbol` instances
|
|
732
|
+
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
733
|
+
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
734
|
+
// exception. (Library authors do this to prevent users from using built-in
|
|
735
|
+
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
736
|
+
// methods are needed to perform accurate arithmetic or comparison.)
|
|
737
|
+
//
|
|
738
|
+
// To fix the problem, coerce this object or symbol value to a string before
|
|
739
|
+
// passing it to React. The most reliable way is usually `String(value)`.
|
|
740
|
+
//
|
|
741
|
+
// To find which value is throwing, check the browser or debugger console.
|
|
742
|
+
// Before this exception was thrown, there should be `console.error` output
|
|
743
|
+
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
744
|
+
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
745
|
+
// In most cases, this console output also shows the component and its
|
|
746
|
+
// ancestor components where the exception happened.
|
|
747
|
+
//
|
|
748
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
749
|
+
return '' + value;
|
|
750
|
+
}
|
|
751
|
+
function checkKeyStringCoercion(value) {
|
|
752
|
+
{
|
|
753
|
+
if (willCoercionThrow(value)) {
|
|
754
|
+
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
755
|
+
|
|
756
|
+
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
762
|
+
var RESERVED_PROPS = {
|
|
763
|
+
key: true,
|
|
764
|
+
ref: true,
|
|
765
|
+
__self: true,
|
|
766
|
+
__source: true
|
|
767
|
+
};
|
|
768
|
+
var specialPropKeyWarningShown;
|
|
769
|
+
var specialPropRefWarningShown;
|
|
770
|
+
var didWarnAboutStringRefs;
|
|
771
|
+
|
|
772
|
+
{
|
|
773
|
+
didWarnAboutStringRefs = {};
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
function hasValidRef(config) {
|
|
777
|
+
{
|
|
778
|
+
if (hasOwnProperty.call(config, 'ref')) {
|
|
779
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
780
|
+
|
|
781
|
+
if (getter && getter.isReactWarning) {
|
|
782
|
+
return false;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
return config.ref !== undefined;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
function hasValidKey(config) {
|
|
791
|
+
{
|
|
792
|
+
if (hasOwnProperty.call(config, 'key')) {
|
|
793
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
794
|
+
|
|
795
|
+
if (getter && getter.isReactWarning) {
|
|
796
|
+
return false;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
return config.key !== undefined;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
805
|
+
{
|
|
806
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
807
|
+
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
808
|
+
|
|
809
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
810
|
+
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
811
|
+
|
|
812
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
819
|
+
{
|
|
820
|
+
var warnAboutAccessingKey = function () {
|
|
821
|
+
if (!specialPropKeyWarningShown) {
|
|
822
|
+
specialPropKeyWarningShown = true;
|
|
823
|
+
|
|
824
|
+
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
825
|
+
}
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
829
|
+
Object.defineProperty(props, 'key', {
|
|
830
|
+
get: warnAboutAccessingKey,
|
|
831
|
+
configurable: true
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
837
|
+
{
|
|
838
|
+
var warnAboutAccessingRef = function () {
|
|
839
|
+
if (!specialPropRefWarningShown) {
|
|
840
|
+
specialPropRefWarningShown = true;
|
|
841
|
+
|
|
842
|
+
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
847
|
+
Object.defineProperty(props, 'ref', {
|
|
848
|
+
get: warnAboutAccessingRef,
|
|
849
|
+
configurable: true
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Factory method to create a new React element. This no longer adheres to
|
|
855
|
+
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
856
|
+
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
857
|
+
* if something is a React Element.
|
|
858
|
+
*
|
|
859
|
+
* @param {*} type
|
|
860
|
+
* @param {*} props
|
|
861
|
+
* @param {*} key
|
|
862
|
+
* @param {string|object} ref
|
|
863
|
+
* @param {*} owner
|
|
864
|
+
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
865
|
+
* different from the `owner` when React.createElement is called, so that we
|
|
866
|
+
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
867
|
+
* functions, and as long as `this` and owner are the same, there will be no
|
|
868
|
+
* change in behavior.
|
|
869
|
+
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
870
|
+
* indicating filename, line number, and/or other information.
|
|
871
|
+
* @internal
|
|
872
|
+
*/
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
876
|
+
var element = {
|
|
877
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
878
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
879
|
+
// Built-in properties that belong on the element
|
|
880
|
+
type: type,
|
|
881
|
+
key: key,
|
|
882
|
+
ref: ref,
|
|
883
|
+
props: props,
|
|
884
|
+
// Record the component responsible for creating this element.
|
|
885
|
+
_owner: owner
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
{
|
|
889
|
+
// The validation flag is currently mutative. We put it on
|
|
890
|
+
// an external backing store so that we can freeze the whole object.
|
|
891
|
+
// This can be replaced with a WeakMap once they are implemented in
|
|
892
|
+
// commonly used development environments.
|
|
893
|
+
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
894
|
+
// the validation flag non-enumerable (where possible, which should
|
|
895
|
+
// include every environment we run tests in), so the test framework
|
|
896
|
+
// ignores it.
|
|
897
|
+
|
|
898
|
+
Object.defineProperty(element._store, 'validated', {
|
|
899
|
+
configurable: false,
|
|
900
|
+
enumerable: false,
|
|
901
|
+
writable: true,
|
|
902
|
+
value: false
|
|
903
|
+
}); // self and source are DEV only properties.
|
|
904
|
+
|
|
905
|
+
Object.defineProperty(element, '_self', {
|
|
906
|
+
configurable: false,
|
|
907
|
+
enumerable: false,
|
|
908
|
+
writable: false,
|
|
909
|
+
value: self
|
|
910
|
+
}); // Two elements created in two different places should be considered
|
|
911
|
+
// equal for testing purposes and therefore we hide it from enumeration.
|
|
912
|
+
|
|
913
|
+
Object.defineProperty(element, '_source', {
|
|
914
|
+
configurable: false,
|
|
915
|
+
enumerable: false,
|
|
916
|
+
writable: false,
|
|
917
|
+
value: source
|
|
918
|
+
});
|
|
919
|
+
|
|
920
|
+
if (Object.freeze) {
|
|
921
|
+
Object.freeze(element.props);
|
|
922
|
+
Object.freeze(element);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
return element;
|
|
927
|
+
};
|
|
928
|
+
/**
|
|
929
|
+
* https://github.com/reactjs/rfcs/pull/107
|
|
930
|
+
* @param {*} type
|
|
931
|
+
* @param {object} props
|
|
932
|
+
* @param {string} key
|
|
933
|
+
*/
|
|
934
|
+
|
|
935
|
+
function jsxDEV(type, config, maybeKey, source, self) {
|
|
936
|
+
{
|
|
937
|
+
var propName; // Reserved names are extracted
|
|
938
|
+
|
|
939
|
+
var props = {};
|
|
940
|
+
var key = null;
|
|
941
|
+
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
942
|
+
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
943
|
+
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
944
|
+
// but as an intermediary step, we will use jsxDEV for everything except
|
|
945
|
+
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
946
|
+
// key is explicitly declared to be undefined or not.
|
|
947
|
+
|
|
948
|
+
if (maybeKey !== undefined) {
|
|
949
|
+
{
|
|
950
|
+
checkKeyStringCoercion(maybeKey);
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
key = '' + maybeKey;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
if (hasValidKey(config)) {
|
|
957
|
+
{
|
|
958
|
+
checkKeyStringCoercion(config.key);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
key = '' + config.key;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
if (hasValidRef(config)) {
|
|
965
|
+
ref = config.ref;
|
|
966
|
+
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
967
|
+
} // Remaining properties are added to a new props object
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
for (propName in config) {
|
|
971
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
972
|
+
props[propName] = config[propName];
|
|
973
|
+
}
|
|
974
|
+
} // Resolve default props
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
if (type && type.defaultProps) {
|
|
978
|
+
var defaultProps = type.defaultProps;
|
|
979
|
+
|
|
980
|
+
for (propName in defaultProps) {
|
|
981
|
+
if (props[propName] === undefined) {
|
|
982
|
+
props[propName] = defaultProps[propName];
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
if (key || ref) {
|
|
988
|
+
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
989
|
+
|
|
990
|
+
if (key) {
|
|
991
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
if (ref) {
|
|
995
|
+
defineRefPropWarningGetter(props, displayName);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
1004
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1005
|
+
|
|
1006
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
1007
|
+
{
|
|
1008
|
+
if (element) {
|
|
1009
|
+
var owner = element._owner;
|
|
1010
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1011
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1012
|
+
} else {
|
|
1013
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
var propTypesMisspellWarningShown;
|
|
1019
|
+
|
|
1020
|
+
{
|
|
1021
|
+
propTypesMisspellWarningShown = false;
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* Verifies the object is a ReactElement.
|
|
1025
|
+
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1026
|
+
* @param {?object} object
|
|
1027
|
+
* @return {boolean} True if `object` is a ReactElement.
|
|
1028
|
+
* @final
|
|
1029
|
+
*/
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
function isValidElement(object) {
|
|
1033
|
+
{
|
|
1034
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
function getDeclarationErrorAddendum() {
|
|
1039
|
+
{
|
|
1040
|
+
if (ReactCurrentOwner$1.current) {
|
|
1041
|
+
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1042
|
+
|
|
1043
|
+
if (name) {
|
|
1044
|
+
return '\n\nCheck the render method of `' + name + '`.';
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
return '';
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
function getSourceInfoErrorAddendum(source) {
|
|
1053
|
+
{
|
|
1054
|
+
if (source !== undefined) {
|
|
1055
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1056
|
+
var lineNumber = source.lineNumber;
|
|
1057
|
+
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
return '';
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1065
|
+
* object keys are not valid. This allows us to keep track of children between
|
|
1066
|
+
* updates.
|
|
1067
|
+
*/
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
var ownerHasKeyUseWarning = {};
|
|
1071
|
+
|
|
1072
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
1073
|
+
{
|
|
1074
|
+
var info = getDeclarationErrorAddendum();
|
|
1075
|
+
|
|
1076
|
+
if (!info) {
|
|
1077
|
+
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1078
|
+
|
|
1079
|
+
if (parentName) {
|
|
1080
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
return info;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1089
|
+
* This element is in an array. The array could grow and shrink or be
|
|
1090
|
+
* reordered. All children that haven't already been validated are required to
|
|
1091
|
+
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1092
|
+
* will only be shown once.
|
|
1093
|
+
*
|
|
1094
|
+
* @internal
|
|
1095
|
+
* @param {ReactElement} element Element that requires a key.
|
|
1096
|
+
* @param {*} parentType element's parent's type.
|
|
1097
|
+
*/
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
function validateExplicitKey(element, parentType) {
|
|
1101
|
+
{
|
|
1102
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
element._store.validated = true;
|
|
1107
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1108
|
+
|
|
1109
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1114
|
+
// property, it may be the creator of the child that's responsible for
|
|
1115
|
+
// assigning it a key.
|
|
1116
|
+
|
|
1117
|
+
var childOwner = '';
|
|
1118
|
+
|
|
1119
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1120
|
+
// Give the component that originally created this child.
|
|
1121
|
+
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
setCurrentlyValidatingElement$1(element);
|
|
1125
|
+
|
|
1126
|
+
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1127
|
+
|
|
1128
|
+
setCurrentlyValidatingElement$1(null);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Ensure that every element either is passed in a static location, in an
|
|
1133
|
+
* array with an explicit keys property defined, or in an object literal
|
|
1134
|
+
* with valid key property.
|
|
1135
|
+
*
|
|
1136
|
+
* @internal
|
|
1137
|
+
* @param {ReactNode} node Statically passed child of any type.
|
|
1138
|
+
* @param {*} parentType node's parent's type.
|
|
1139
|
+
*/
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
function validateChildKeys(node, parentType) {
|
|
1143
|
+
{
|
|
1144
|
+
if (typeof node !== 'object') {
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
if (isArray(node)) {
|
|
1149
|
+
for (var i = 0; i < node.length; i++) {
|
|
1150
|
+
var child = node[i];
|
|
1151
|
+
|
|
1152
|
+
if (isValidElement(child)) {
|
|
1153
|
+
validateExplicitKey(child, parentType);
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
} else if (isValidElement(node)) {
|
|
1157
|
+
// This element was passed in a valid location.
|
|
1158
|
+
if (node._store) {
|
|
1159
|
+
node._store.validated = true;
|
|
1160
|
+
}
|
|
1161
|
+
} else if (node) {
|
|
1162
|
+
var iteratorFn = getIteratorFn(node);
|
|
1163
|
+
|
|
1164
|
+
if (typeof iteratorFn === 'function') {
|
|
1165
|
+
// Entry iterators used to provide implicit keys,
|
|
1166
|
+
// but now we print a separate warning for them later.
|
|
1167
|
+
if (iteratorFn !== node.entries) {
|
|
1168
|
+
var iterator = iteratorFn.call(node);
|
|
1169
|
+
var step;
|
|
1170
|
+
|
|
1171
|
+
while (!(step = iterator.next()).done) {
|
|
1172
|
+
if (isValidElement(step.value)) {
|
|
1173
|
+
validateExplicitKey(step.value, parentType);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Given an element, validate that its props follow the propTypes definition,
|
|
1183
|
+
* provided by the type.
|
|
1184
|
+
*
|
|
1185
|
+
* @param {ReactElement} element
|
|
1186
|
+
*/
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
function validatePropTypes(element) {
|
|
1190
|
+
{
|
|
1191
|
+
var type = element.type;
|
|
1192
|
+
|
|
1193
|
+
if (type === null || type === undefined || typeof type === 'string') {
|
|
1194
|
+
return;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
var propTypes;
|
|
1198
|
+
|
|
1199
|
+
if (typeof type === 'function') {
|
|
1200
|
+
propTypes = type.propTypes;
|
|
1201
|
+
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1202
|
+
// Inner props are checked in the reconciler.
|
|
1203
|
+
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1204
|
+
propTypes = type.propTypes;
|
|
1205
|
+
} else {
|
|
1206
|
+
return;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
if (propTypes) {
|
|
1210
|
+
// Intentionally inside to avoid triggering lazy initializers:
|
|
1211
|
+
var name = getComponentNameFromType(type);
|
|
1212
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1213
|
+
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1214
|
+
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1215
|
+
|
|
1216
|
+
var _name = getComponentNameFromType(type);
|
|
1217
|
+
|
|
1218
|
+
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
1222
|
+
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* Given a fragment, validate that it can only be provided with fragment props
|
|
1228
|
+
* @param {ReactElement} fragment
|
|
1229
|
+
*/
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
function validateFragmentProps(fragment) {
|
|
1233
|
+
{
|
|
1234
|
+
var keys = Object.keys(fragment.props);
|
|
1235
|
+
|
|
1236
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1237
|
+
var key = keys[i];
|
|
1238
|
+
|
|
1239
|
+
if (key !== 'children' && key !== 'key') {
|
|
1240
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1241
|
+
|
|
1242
|
+
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1243
|
+
|
|
1244
|
+
setCurrentlyValidatingElement$1(null);
|
|
1245
|
+
break;
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
if (fragment.ref !== null) {
|
|
1250
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1251
|
+
|
|
1252
|
+
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1253
|
+
|
|
1254
|
+
setCurrentlyValidatingElement$1(null);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1260
|
+
{
|
|
1261
|
+
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1262
|
+
// succeed and there will likely be errors in render.
|
|
1263
|
+
|
|
1264
|
+
if (!validType) {
|
|
1265
|
+
var info = '';
|
|
1266
|
+
|
|
1267
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1268
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1272
|
+
|
|
1273
|
+
if (sourceInfo) {
|
|
1274
|
+
info += sourceInfo;
|
|
1275
|
+
} else {
|
|
1276
|
+
info += getDeclarationErrorAddendum();
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
var typeString;
|
|
1280
|
+
|
|
1281
|
+
if (type === null) {
|
|
1282
|
+
typeString = 'null';
|
|
1283
|
+
} else if (isArray(type)) {
|
|
1284
|
+
typeString = 'array';
|
|
1285
|
+
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1286
|
+
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1287
|
+
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1288
|
+
} else {
|
|
1289
|
+
typeString = typeof type;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1296
|
+
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1297
|
+
|
|
1298
|
+
if (element == null) {
|
|
1299
|
+
return element;
|
|
1300
|
+
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1301
|
+
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1302
|
+
// We don't want exception behavior to differ between dev and prod.
|
|
1303
|
+
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1304
|
+
// fixed, the key warnings will appear.)
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
if (validType) {
|
|
1308
|
+
var children = props.children;
|
|
1309
|
+
|
|
1310
|
+
if (children !== undefined) {
|
|
1311
|
+
if (isStaticChildren) {
|
|
1312
|
+
if (isArray(children)) {
|
|
1313
|
+
for (var i = 0; i < children.length; i++) {
|
|
1314
|
+
validateChildKeys(children[i], type);
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
if (Object.freeze) {
|
|
1318
|
+
Object.freeze(children);
|
|
1319
|
+
}
|
|
1320
|
+
} else {
|
|
1321
|
+
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
1322
|
+
}
|
|
1323
|
+
} else {
|
|
1324
|
+
validateChildKeys(children, type);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
1330
|
+
validateFragmentProps(element);
|
|
1331
|
+
} else {
|
|
1332
|
+
validatePropTypes(element);
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
return element;
|
|
1336
|
+
}
|
|
1337
|
+
} // These two functions exist to still get child warnings in dev
|
|
1338
|
+
// even with the prod transform. This means that jsxDEV is purely
|
|
1339
|
+
// opt-in behavior for better messages but that we won't stop
|
|
1340
|
+
// giving you warnings if you use production apis.
|
|
1341
|
+
|
|
1342
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
1343
|
+
{
|
|
1344
|
+
return jsxWithValidation(type, props, key, true);
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
1348
|
+
{
|
|
1349
|
+
return jsxWithValidation(type, props, key, false);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
|
|
1354
|
+
// for now we can ship identical prod functions
|
|
1355
|
+
|
|
1356
|
+
var jsxs = jsxWithValidationStatic ;
|
|
1357
|
+
|
|
1358
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1359
|
+
exports.jsx = jsx;
|
|
1360
|
+
exports.jsxs = jsxs;
|
|
1361
|
+
})();
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1364
|
+
|
|
1365
|
+
var jsxRuntime = createCommonjsModule(function (module) {
|
|
1366
|
+
|
|
1367
|
+
if (process.env.NODE_ENV === 'production') {
|
|
1368
|
+
module.exports = reactJsxRuntime_production_min;
|
|
1369
|
+
} else {
|
|
1370
|
+
module.exports = reactJsxRuntime_development;
|
|
1371
|
+
}
|
|
1372
|
+
});
|
|
1373
|
+
|
|
7
1374
|
/******************************************************************************
|
|
8
1375
|
Copyright (c) Microsoft Corporation.
|
|
9
1376
|
|
|
@@ -500,37 +1867,37 @@ var tslib_es6 = {
|
|
|
500
1867
|
};
|
|
501
1868
|
|
|
502
1869
|
var tslib_es6$1 = /*#__PURE__*/Object.freeze({
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
1870
|
+
__proto__: null,
|
|
1871
|
+
__extends: __extends,
|
|
1872
|
+
get __assign () { return __assign; },
|
|
1873
|
+
__rest: __rest,
|
|
1874
|
+
__decorate: __decorate,
|
|
1875
|
+
__param: __param,
|
|
1876
|
+
__esDecorate: __esDecorate,
|
|
1877
|
+
__runInitializers: __runInitializers,
|
|
1878
|
+
__propKey: __propKey,
|
|
1879
|
+
__setFunctionName: __setFunctionName,
|
|
1880
|
+
__metadata: __metadata,
|
|
1881
|
+
__awaiter: __awaiter,
|
|
1882
|
+
__generator: __generator,
|
|
1883
|
+
__createBinding: __createBinding,
|
|
1884
|
+
__exportStar: __exportStar,
|
|
1885
|
+
__values: __values,
|
|
1886
|
+
__read: __read,
|
|
1887
|
+
__spread: __spread,
|
|
1888
|
+
__spreadArrays: __spreadArrays,
|
|
1889
|
+
__spreadArray: __spreadArray,
|
|
1890
|
+
__await: __await,
|
|
1891
|
+
__asyncGenerator: __asyncGenerator,
|
|
1892
|
+
__asyncDelegator: __asyncDelegator,
|
|
1893
|
+
__asyncValues: __asyncValues,
|
|
1894
|
+
__makeTemplateObject: __makeTemplateObject,
|
|
1895
|
+
__importStar: __importStar,
|
|
1896
|
+
__importDefault: __importDefault,
|
|
1897
|
+
__classPrivateFieldGet: __classPrivateFieldGet,
|
|
1898
|
+
__classPrivateFieldSet: __classPrivateFieldSet,
|
|
1899
|
+
__classPrivateFieldIn: __classPrivateFieldIn,
|
|
1900
|
+
'default': tslib_es6
|
|
534
1901
|
});
|
|
535
1902
|
|
|
536
1903
|
let currentId$1 = 0;
|
|
@@ -8779,30 +10146,6 @@ ExpandableSection.defaultProps = {
|
|
|
8779
10146
|
variant: 'default'
|
|
8780
10147
|
};
|
|
8781
10148
|
|
|
8782
|
-
function getDefaultExportFromCjs (x) {
|
|
8783
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
8784
|
-
}
|
|
8785
|
-
|
|
8786
|
-
function getAugmentedNamespace(n) {
|
|
8787
|
-
if (n.__esModule) return n;
|
|
8788
|
-
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
8789
|
-
Object.keys(n).forEach(function (k) {
|
|
8790
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
8791
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
8792
|
-
enumerable: true,
|
|
8793
|
-
get: function () {
|
|
8794
|
-
return n[k];
|
|
8795
|
-
}
|
|
8796
|
-
});
|
|
8797
|
-
});
|
|
8798
|
-
return a;
|
|
8799
|
-
}
|
|
8800
|
-
|
|
8801
|
-
function createCommonjsModule(fn) {
|
|
8802
|
-
var module = { exports: {} };
|
|
8803
|
-
return fn(module, module.exports), module.exports;
|
|
8804
|
-
}
|
|
8805
|
-
|
|
8806
10149
|
var labelStyles = {
|
|
8807
10150
|
"button": "pf-v6-c-button",
|
|
8808
10151
|
"label": "pf-v6-c-label",
|
|
@@ -10533,18 +11876,13 @@ exports["default"] = exports.SearchIcon;
|
|
|
10533
11876
|
var SearchIcon = /*@__PURE__*/getDefaultExportFromCjs(searchIcon);
|
|
10534
11877
|
|
|
10535
11878
|
function _extends() {
|
|
10536
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
10537
|
-
for (var
|
|
10538
|
-
var
|
|
10539
|
-
for (var
|
|
10540
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10541
|
-
target[key] = source[key];
|
|
10542
|
-
}
|
|
10543
|
-
}
|
|
11879
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
11880
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
11881
|
+
var t = arguments[e];
|
|
11882
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
10544
11883
|
}
|
|
10545
|
-
return
|
|
10546
|
-
};
|
|
10547
|
-
return _extends.apply(this, arguments);
|
|
11884
|
+
return n;
|
|
11885
|
+
}, _extends.apply(null, arguments);
|
|
10548
11886
|
}
|
|
10549
11887
|
|
|
10550
11888
|
var m,x$2=m||(m={});x$2.Pop="POP";x$2.Push="PUSH";x$2.Replace="REPLACE";var y$1="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function z$2(a,b){if(!a){"undefined"!==typeof console&&console.warn(b);try{throw Error(b);}catch(g){}}}function A$2(a){a.preventDefault();a.returnValue="";}
|
|
@@ -11104,27 +12442,27 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
11104
12442
|
var _a, _b;
|
|
11105
12443
|
const combinedValue = Object.assign(Object.assign({}, QuickStartContextDefaults), value);
|
|
11106
12444
|
const { activeQuickStartID, setActiveQuickStartID, setAllQuickStartStates, useQueryParams, allQuickStartStates, allQuickStarts = [], footer, useLegacyHeaderColors, markdown, } = combinedValue;
|
|
11107
|
-
const [quickStarts, setQuickStarts] =
|
|
11108
|
-
const [resourceBundle, setResourceBundle] =
|
|
11109
|
-
const [language, setLanguage] =
|
|
12445
|
+
const [quickStarts, setQuickStarts] = useState(combinedValue.allQuickStarts || []);
|
|
12446
|
+
const [resourceBundle, setResourceBundle] = useState(Object.assign(Object.assign({}, en), combinedValue.resourceBundle));
|
|
12447
|
+
const [language, setLanguage] = useState(combinedValue.language);
|
|
11110
12448
|
const changeResourceBundle = (bundle, lng) => {
|
|
11111
12449
|
lng && setLanguage(lng);
|
|
11112
12450
|
setResourceBundle(Object.assign(Object.assign({}, en), bundle));
|
|
11113
12451
|
};
|
|
11114
12452
|
const findResource = useCallback((resource, count) => getResource(resource, count !== undefined ? { count } : null, resourceBundle, language), [resourceBundle, language]);
|
|
11115
|
-
const [loading, setLoading] =
|
|
11116
|
-
const [alwaysShowTaskReview, setAlwaysShowTaskReview] =
|
|
12453
|
+
const [loading, setLoading] = useState(combinedValue.loading);
|
|
12454
|
+
const [alwaysShowTaskReview, setAlwaysShowTaskReview] = useState(combinedValue.alwaysShowTaskReview);
|
|
11117
12455
|
const initialSearchParams = new URLSearchParams(window.location.search);
|
|
11118
12456
|
const initialSearchQuery = initialSearchParams.get(QUICKSTART_SEARCH_FILTER_KEY) || '';
|
|
11119
12457
|
const initialStatusFilters = ((_a = initialSearchParams.get(QUICKSTART_STATUS_FILTER_KEY)) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
|
|
11120
12458
|
const quickStartStatusCount = getQuickStartStatusCount(allQuickStartStates, allQuickStarts);
|
|
11121
|
-
const [statusTypes, setStatusTypes] =
|
|
12459
|
+
const [statusTypes, setStatusTypes] = useState({
|
|
11122
12460
|
[QuickStartStatus.COMPLETE]: findResource('Complete ({{statusCount, number}})').replace('{{statusCount, number}}', quickStartStatusCount[QuickStartStatus.COMPLETE]),
|
|
11123
12461
|
[QuickStartStatus.IN_PROGRESS]: findResource('In progress ({{statusCount, number}})').replace('{{statusCount, number}}', quickStartStatusCount[QuickStartStatus.IN_PROGRESS]),
|
|
11124
12462
|
[QuickStartStatus.NOT_STARTED]: findResource('Not started ({{statusCount, number}})').replace('{{statusCount, number}}', quickStartStatusCount[QuickStartStatus.NOT_STARTED]),
|
|
11125
12463
|
});
|
|
11126
|
-
const [statusFilters, setStatusFilters] =
|
|
11127
|
-
const [filterKeyword, setFilterKeyword] =
|
|
12464
|
+
const [statusFilters, setStatusFilters] = useState(initialStatusFilters);
|
|
12465
|
+
const [filterKeyword, setFilterKeyword] = useState(initialSearchQuery);
|
|
11128
12466
|
const setFilter = (type, val) => {
|
|
11129
12467
|
if (type === 'keyword') {
|
|
11130
12468
|
setFilterKeyword(val);
|
|
@@ -11133,7 +12471,7 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
11133
12471
|
setStatusFilters(val);
|
|
11134
12472
|
}
|
|
11135
12473
|
};
|
|
11136
|
-
|
|
12474
|
+
useEffect(() => {
|
|
11137
12475
|
const updatedQuickStartStatusCount = getQuickStartStatusCount(allQuickStartStates, quickStarts);
|
|
11138
12476
|
setStatusTypes({
|
|
11139
12477
|
[QuickStartStatus.COMPLETE]: findResource('Complete ({{statusCount, number}})').replace('{{statusCount, number}}', updatedQuickStartStatusCount[QuickStartStatus.COMPLETE]),
|
|
@@ -11305,24 +12643,18 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
11305
12643
|
setAlwaysShowTaskReview,
|
|
11306
12644
|
};
|
|
11307
12645
|
};
|
|
11308
|
-
const QuickStartContextProvider = ({ children, value }) => (
|
|
12646
|
+
const QuickStartContextProvider = ({ children, value }) => (jsxRuntime.jsx(QuickStartContext.Provider, Object.assign({ value: useValuesForQuickStartContext(value) }, { children: children })));
|
|
11309
12647
|
|
|
11310
|
-
const Box = ({ children, className }) => (
|
|
11311
|
-
const Loading = ({ className }) => (
|
|
11312
|
-
React.createElement("div", { className: "pfext-m-loader-dot__one" }),
|
|
11313
|
-
React.createElement("div", { className: "pfext-m-loader-dot__two" }),
|
|
11314
|
-
React.createElement("div", { className: "pfext-m-loader-dot__three" })));
|
|
12648
|
+
const Box = ({ children, className }) => (jsxRuntime.jsx("div", Object.assign({ className: css('pfext-status-box', className) }, { children: children })));
|
|
12649
|
+
const Loading = ({ className }) => (jsxRuntime.jsxs("div", Object.assign({ className: css('pfext-m-loader', className) }, { children: [jsxRuntime.jsx("div", { className: "pfext-m-loader-dot__one" }), jsxRuntime.jsx("div", { className: "pfext-m-loader-dot__two" }), jsxRuntime.jsx("div", { className: "pfext-m-loader-dot__three" })] })));
|
|
11315
12650
|
Loading.displayName = 'Loading';
|
|
11316
|
-
const LoadingBox = ({ className, message }) => (
|
|
11317
|
-
React.createElement(Loading, null),
|
|
11318
|
-
message && React.createElement("div", { className: "pfext-status-box__loading-message" }, message)));
|
|
12651
|
+
const LoadingBox = ({ className, message }) => (jsxRuntime.jsxs(Box, Object.assign({ className: css('pfext-status-box--loading', className) }, { children: [jsxRuntime.jsx(Loading, {}), message && jsxRuntime.jsx("div", Object.assign({ className: "pfext-status-box__loading-message" }, { children: message }))] })));
|
|
11319
12652
|
LoadingBox.displayName = 'LoadingBox';
|
|
11320
12653
|
const EmptyBox = ({ label }) => {
|
|
11321
|
-
const { getResource } =
|
|
11322
|
-
return (
|
|
11323
|
-
|
|
11324
|
-
|
|
11325
|
-
: getResource('Not found'))));
|
|
12654
|
+
const { getResource } = useContext(QuickStartContext);
|
|
12655
|
+
return (jsxRuntime.jsx(Box, { children: jsxRuntime.jsx("div", Object.assign({ "data-test": "empty-message", className: "text-center" }, { children: label
|
|
12656
|
+
? getResource('No {{label}} found').replace('{{label}}', label)
|
|
12657
|
+
: getResource('Not found') })) }));
|
|
11326
12658
|
};
|
|
11327
12659
|
EmptyBox.displayName = 'EmptyBox';
|
|
11328
12660
|
|
|
@@ -11336,9 +12668,7 @@ const CamelCaseWrap = ({ value, dataTest }) => {
|
|
|
11336
12668
|
}
|
|
11337
12669
|
// Add word break points before capital letters (but keep consecutive capital letters together).
|
|
11338
12670
|
const words = value.match(/[A-Z]+[^A-Z]*|[^A-Z]+/g);
|
|
11339
|
-
const rendered = (
|
|
11340
|
-
word,
|
|
11341
|
-
i !== words.length - 1 && React.createElement("wbr", null))))));
|
|
12671
|
+
const rendered = (jsxRuntime.jsx("span", Object.assign({ "data-test": dataTest }, { children: words.map((word, i) => (jsxRuntime.jsxs(Fragment$1, { children: [word, i !== words.length - 1 && jsxRuntime.jsx("wbr", {})] }, i))) })));
|
|
11342
12672
|
MEMO[value] = rendered;
|
|
11343
12673
|
return rendered;
|
|
11344
12674
|
};
|
|
@@ -11361,40 +12691,40 @@ var RocketIcon = /*@__PURE__*/getDefaultExportFromCjs(rocketIcon);
|
|
|
11361
12691
|
|
|
11362
12692
|
const Modal = (_a) => {
|
|
11363
12693
|
var { isFullScreen = false, className } = _a, props = __rest(_a, ["isFullScreen", "className"]);
|
|
11364
|
-
return (
|
|
12694
|
+
return (jsxRuntime.jsx(Modal$1, Object.assign({}, props, { className: css('pfext-modal', className), appendTo: () => (isFullScreen ? document.body : document.querySelector('#modal-container')) })));
|
|
11365
12695
|
};
|
|
11366
12696
|
|
|
11367
12697
|
const getContainer = (container) => typeof container === 'function' ? container() : container;
|
|
11368
12698
|
const Portal = ({ children, container }) => {
|
|
11369
|
-
const [containerNode, setContainerNode] =
|
|
12699
|
+
const [containerNode, setContainerNode] = useState();
|
|
11370
12700
|
useIsomorphicLayoutEffect(() => {
|
|
11371
12701
|
setContainerNode(getContainer(container) || document.body);
|
|
11372
12702
|
}, [container]);
|
|
11373
|
-
return containerNode ?
|
|
12703
|
+
return containerNode ? createPortal(children, containerNode) : null;
|
|
11374
12704
|
};
|
|
11375
12705
|
|
|
11376
12706
|
const SimplePopper = ({ children }) => {
|
|
11377
12707
|
const openProp = true;
|
|
11378
|
-
const nodeRef =
|
|
11379
|
-
const popperRef =
|
|
11380
|
-
const [isOpen, setOpenState] =
|
|
11381
|
-
const setOpen =
|
|
12708
|
+
const nodeRef = useRef(null);
|
|
12709
|
+
const popperRef = useRef(null);
|
|
12710
|
+
const [isOpen, setOpenState] = useState(openProp);
|
|
12711
|
+
const setOpen = useCallback((newOpen) => {
|
|
11382
12712
|
setOpenState(newOpen);
|
|
11383
12713
|
}, []);
|
|
11384
|
-
|
|
12714
|
+
useEffect(() => {
|
|
11385
12715
|
setOpen(openProp);
|
|
11386
12716
|
}, [openProp, setOpen]);
|
|
11387
|
-
const onKeyDown =
|
|
12717
|
+
const onKeyDown = useCallback((e) => {
|
|
11388
12718
|
if (e.keyCode === 27) {
|
|
11389
12719
|
setOpen(false);
|
|
11390
12720
|
}
|
|
11391
12721
|
}, [setOpen]);
|
|
11392
|
-
const onClickOutside =
|
|
12722
|
+
const onClickOutside = useCallback((e) => {
|
|
11393
12723
|
if (!nodeRef.current || (e.target instanceof Node && !nodeRef.current.contains(e.target))) {
|
|
11394
12724
|
setOpen(false);
|
|
11395
12725
|
}
|
|
11396
12726
|
}, [setOpen]);
|
|
11397
|
-
const destroy =
|
|
12727
|
+
const destroy = useCallback(() => {
|
|
11398
12728
|
if (popperRef.current) {
|
|
11399
12729
|
popperRef.current.destroy();
|
|
11400
12730
|
document.removeEventListener('keydown', onKeyDown, true);
|
|
@@ -11402,29 +12732,28 @@ const SimplePopper = ({ children }) => {
|
|
|
11402
12732
|
document.removeEventListener('touchstart', onClickOutside, true);
|
|
11403
12733
|
}
|
|
11404
12734
|
}, [onClickOutside, onKeyDown]);
|
|
11405
|
-
const initialize =
|
|
12735
|
+
const initialize = useCallback(() => {
|
|
11406
12736
|
if (!nodeRef.current || !isOpen) {
|
|
11407
12737
|
return;
|
|
11408
12738
|
}
|
|
11409
12739
|
destroy();
|
|
11410
12740
|
}, [isOpen, destroy]);
|
|
11411
|
-
const nodeRefCallback =
|
|
12741
|
+
const nodeRefCallback = useCallback((node) => {
|
|
11412
12742
|
nodeRef.current = node;
|
|
11413
12743
|
initialize();
|
|
11414
12744
|
}, [initialize]);
|
|
11415
|
-
|
|
12745
|
+
useEffect(() => {
|
|
11416
12746
|
initialize();
|
|
11417
12747
|
}, [initialize]);
|
|
11418
|
-
|
|
12748
|
+
useEffect(() => () => {
|
|
11419
12749
|
destroy();
|
|
11420
12750
|
}, [destroy]);
|
|
11421
|
-
|
|
12751
|
+
useEffect(() => {
|
|
11422
12752
|
if (!isOpen) {
|
|
11423
12753
|
destroy();
|
|
11424
12754
|
}
|
|
11425
12755
|
}, [destroy, isOpen]);
|
|
11426
|
-
return isOpen ? (
|
|
11427
|
-
React.createElement("div", { ref: nodeRefCallback, style: { zIndex: 9999, position: 'absolute', top: 0, left: 0 }, className: "pfext-quick-start__base" }, children))) : null;
|
|
12756
|
+
return isOpen ? (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsx("div", Object.assign({ ref: nodeRefCallback, style: { zIndex: 9999, position: 'absolute', top: 0, left: 0 }, className: "pfext-quick-start__base" }, { children: children })) })) : null;
|
|
11428
12757
|
};
|
|
11429
12758
|
|
|
11430
12759
|
const isInViewport = (elementToCheck) => {
|
|
@@ -11444,8 +12773,8 @@ const InteractiveSpotlight = ({ element }) => {
|
|
|
11444
12773
|
bottom,
|
|
11445
12774
|
right,
|
|
11446
12775
|
};
|
|
11447
|
-
const [clicked, setClicked] =
|
|
11448
|
-
|
|
12776
|
+
const [clicked, setClicked] = useState(false);
|
|
12777
|
+
useEffect(() => {
|
|
11449
12778
|
if (!clicked) {
|
|
11450
12779
|
if (!isInViewport(element)) {
|
|
11451
12780
|
element.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
|
|
@@ -11461,9 +12790,7 @@ const InteractiveSpotlight = ({ element }) => {
|
|
|
11461
12790
|
if (clicked) {
|
|
11462
12791
|
return null;
|
|
11463
12792
|
}
|
|
11464
|
-
return (
|
|
11465
|
-
React.createElement(SimplePopper, null,
|
|
11466
|
-
React.createElement("div", { className: "pfext-spotlight pfext-spotlight__element-highlight-animate", style: style }))));
|
|
12793
|
+
return (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsx(SimplePopper, { children: jsxRuntime.jsx("div", { className: "pfext-spotlight pfext-spotlight__element-highlight-animate", style: style }) }) }));
|
|
11467
12794
|
};
|
|
11468
12795
|
|
|
11469
12796
|
var ScrollDirection;
|
|
@@ -11475,8 +12802,8 @@ var ScrollDirection;
|
|
|
11475
12802
|
})(ScrollDirection || (ScrollDirection = {}));
|
|
11476
12803
|
|
|
11477
12804
|
const useResizeObserver = (callback, targetElement, observerOptions = undefined) => {
|
|
11478
|
-
const element =
|
|
11479
|
-
|
|
12805
|
+
const element = useMemo(() => targetElement !== null && targetElement !== void 0 ? targetElement : document.querySelector('body'), [targetElement]);
|
|
12806
|
+
useEffect(() => {
|
|
11480
12807
|
const observer = new ResizeObserver(callback);
|
|
11481
12808
|
observer.observe(element, observerOptions);
|
|
11482
12809
|
return () => {
|
|
@@ -11494,8 +12821,8 @@ var Shadows;
|
|
|
11494
12821
|
})(Shadows || (Shadows = {}));
|
|
11495
12822
|
|
|
11496
12823
|
const useBoundingClientRect = (targetElement) => {
|
|
11497
|
-
const [clientRect, setClientRect] =
|
|
11498
|
-
const observerCallback =
|
|
12824
|
+
const [clientRect, setClientRect] = useState(() => targetElement ? targetElement.getBoundingClientRect() : null);
|
|
12825
|
+
const observerCallback = useCallback(() => {
|
|
11499
12826
|
setClientRect(targetElement ? targetElement.getBoundingClientRect() : null);
|
|
11500
12827
|
}, [targetElement]);
|
|
11501
12828
|
useResizeObserver(observerCallback);
|
|
@@ -11505,7 +12832,7 @@ const useBoundingClientRect = (targetElement) => {
|
|
|
11505
12832
|
/**
|
|
11506
12833
|
* React hook that forces component render.
|
|
11507
12834
|
*/
|
|
11508
|
-
const useForceRender = () =>
|
|
12835
|
+
const useForceRender = () => useReducer((s) => !s, false)[1];
|
|
11509
12836
|
|
|
11510
12837
|
const useEventListener = (target, event, callback) => {
|
|
11511
12838
|
useEffect(() => {
|
|
@@ -11526,14 +12853,12 @@ const StaticSpotlight = ({ element }) => {
|
|
|
11526
12853
|
width: clientRect.width,
|
|
11527
12854
|
}
|
|
11528
12855
|
: {};
|
|
11529
|
-
return clientRect ? (
|
|
11530
|
-
React.createElement("div", { className: "pf-v6-c-backdrop pfext-spotlight__with-backdrop" },
|
|
11531
|
-
React.createElement("div", { className: "pfext-spotlight pfext-spotlight__element-highlight-noanimate", style: style })))) : null;
|
|
12856
|
+
return clientRect ? (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsx("div", Object.assign({ className: "pf-v6-c-backdrop pfext-spotlight__with-backdrop" }, { children: jsxRuntime.jsx("div", { className: "pfext-spotlight pfext-spotlight__element-highlight-noanimate", style: style }) })) })) : null;
|
|
11532
12857
|
};
|
|
11533
12858
|
|
|
11534
12859
|
const Spotlight = ({ selector, interactive }) => {
|
|
11535
12860
|
// if target element is a hidden one return null
|
|
11536
|
-
const element =
|
|
12861
|
+
const element = useMemo(() => {
|
|
11537
12862
|
const highlightElement = document.querySelector(selector);
|
|
11538
12863
|
let hiddenElement = highlightElement;
|
|
11539
12864
|
while (hiddenElement) {
|
|
@@ -11548,12 +12873,12 @@ const Spotlight = ({ selector, interactive }) => {
|
|
|
11548
12873
|
if (!element) {
|
|
11549
12874
|
return null;
|
|
11550
12875
|
}
|
|
11551
|
-
return interactive ? (
|
|
12876
|
+
return interactive ? (jsxRuntime.jsx(InteractiveSpotlight, { element: element })) : (jsxRuntime.jsx(StaticSpotlight, { element: element }));
|
|
11552
12877
|
};
|
|
11553
12878
|
|
|
11554
12879
|
const MarkdownHighlightExtension = ({ docContext, rootSelector, }) => {
|
|
11555
|
-
const [selector, setSelector] =
|
|
11556
|
-
|
|
12880
|
+
const [selector, setSelector] = useState(null);
|
|
12881
|
+
useEffect(() => {
|
|
11557
12882
|
const elements = docContext.querySelectorAll(`${rootSelector} [data-highlight]`);
|
|
11558
12883
|
let timeoutId;
|
|
11559
12884
|
function startHighlight(e) {
|
|
@@ -11572,7 +12897,7 @@ const MarkdownHighlightExtension = ({ docContext, rootSelector, }) => {
|
|
|
11572
12897
|
elements && elements.forEach((elm) => elm.removeEventListener('click', startHighlight));
|
|
11573
12898
|
};
|
|
11574
12899
|
}, [docContext, rootSelector]);
|
|
11575
|
-
|
|
12900
|
+
useEffect(() => {
|
|
11576
12901
|
const elements = docContext.querySelectorAll(`${rootSelector} [class^=data-highlight__]`);
|
|
11577
12902
|
let timeoutId;
|
|
11578
12903
|
function startHighlight(e) {
|
|
@@ -11602,7 +12927,7 @@ const MarkdownHighlightExtension = ({ docContext, rootSelector, }) => {
|
|
|
11602
12927
|
if (!selector) {
|
|
11603
12928
|
return null;
|
|
11604
12929
|
}
|
|
11605
|
-
return
|
|
12930
|
+
return jsxRuntime.jsx(Spotlight, { selector: selector, interactive: true });
|
|
11606
12931
|
};
|
|
11607
12932
|
|
|
11608
12933
|
const MARKDOWN_COPY_BUTTON_ID = 'data-copy-for';
|
|
@@ -11610,15 +12935,15 @@ const MARKDOWN_SNIPPET_ID = 'data-snippet-id';
|
|
|
11610
12935
|
const ACCORDION_MARKDOWN_BUTTON_ID = `accordion-markdown-button-id`;
|
|
11611
12936
|
const ACCORDION_MARKDOWN_CONTENT_ID = `accordion-markdown-content-id`;
|
|
11612
12937
|
|
|
11613
|
-
const CopyClipboard = ({ element, rootSelector, docContext
|
|
11614
|
-
const { getResource } =
|
|
11615
|
-
const [showSuccessContent, setShowSuccessContent] =
|
|
11616
|
-
const textToCopy =
|
|
12938
|
+
const CopyClipboard = ({ element, rootSelector, docContext }) => {
|
|
12939
|
+
const { getResource } = useContext(QuickStartContext);
|
|
12940
|
+
const [showSuccessContent, setShowSuccessContent] = useState(false);
|
|
12941
|
+
const textToCopy = useMemo(() => {
|
|
11617
12942
|
var _a;
|
|
11618
12943
|
const copyTextId = element.getAttribute(MARKDOWN_COPY_BUTTON_ID);
|
|
11619
12944
|
return (_a = docContext.querySelector(`${rootSelector} [${MARKDOWN_SNIPPET_ID}="${copyTextId}"]`)) === null || _a === void 0 ? void 0 : _a.innerText;
|
|
11620
12945
|
}, [element, docContext, rootSelector]);
|
|
11621
|
-
useEventListener(element, 'click',
|
|
12946
|
+
useEventListener(element, 'click', useCallback(() => {
|
|
11622
12947
|
navigator.clipboard
|
|
11623
12948
|
.writeText(textToCopy.trim())
|
|
11624
12949
|
.then(() => {
|
|
@@ -11626,17 +12951,17 @@ const CopyClipboard = ({ element, rootSelector, docContext, }) => {
|
|
|
11626
12951
|
})
|
|
11627
12952
|
.catch(() => { });
|
|
11628
12953
|
}, [textToCopy]));
|
|
11629
|
-
useEventListener(element, 'mouseleave',
|
|
12954
|
+
useEventListener(element, 'mouseleave', useCallback(() => {
|
|
11630
12955
|
setShowSuccessContent(false);
|
|
11631
12956
|
}, []));
|
|
11632
|
-
return showSuccessContent ? (
|
|
12957
|
+
return showSuccessContent ? (jsxRuntime.jsx(Tooltip, { isVisible: true, triggerRef: () => element, content: getResource('Successfully copied to clipboard!'), className: "pfext-quick-start__base" }, "after-copy")) : (jsxRuntime.jsx(Tooltip, { triggerRef: () => element, content: getResource('Copy to clipboard'), className: "pfext-quick-start__base" }, "before-copy"));
|
|
11633
12958
|
};
|
|
11634
|
-
const MarkdownCopyClipboard = ({ docContext, rootSelector
|
|
12959
|
+
const MarkdownCopyClipboard = ({ docContext, rootSelector }) => {
|
|
11635
12960
|
const elements = docContext.querySelectorAll(`${rootSelector} [${MARKDOWN_COPY_BUTTON_ID}]`);
|
|
11636
|
-
return elements.length > 0 ? (
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
12961
|
+
return elements.length > 0 ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from(elements).map((elm) => {
|
|
12962
|
+
const attributeValue = elm.getAttribute(MARKDOWN_COPY_BUTTON_ID);
|
|
12963
|
+
return (jsxRuntime.jsx(CopyClipboard, { element: elm, rootSelector: rootSelector, docContext: docContext }, attributeValue));
|
|
12964
|
+
}) })) : null;
|
|
11640
12965
|
};
|
|
11641
12966
|
|
|
11642
12967
|
const removeTemplateWhitespace = (template) => template.replace(/>(?:\s|\n)+</g, '><');
|
|
@@ -26031,8 +27356,8 @@ exports["default"] = exports.CopyIcon;
|
|
|
26031
27356
|
var CopyIcon = /*@__PURE__*/getDefaultExportFromCjs(copyIcon);
|
|
26032
27357
|
|
|
26033
27358
|
const useInlineCopyClipboardShowdownExtension = () => {
|
|
26034
|
-
const { getResource } =
|
|
26035
|
-
return
|
|
27359
|
+
const { getResource } = useContext(QuickStartContext);
|
|
27360
|
+
return useMemo(() => ({
|
|
26036
27361
|
type: 'lang',
|
|
26037
27362
|
regex: /`([^`](.*?)[^`])`{{copy}}/g,
|
|
26038
27363
|
replace: (text, group, _, groupId) => {
|
|
@@ -26044,7 +27369,7 @@ const useInlineCopyClipboardShowdownExtension = () => {
|
|
|
26044
27369
|
<span class="pf-v6-c-clipboard-copy__actions">
|
|
26045
27370
|
<span class="pf-v6-c-clipboard-copy__actions-item">
|
|
26046
27371
|
<button class="pf-v6-c-button pf-m-plain" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${groupId}">
|
|
26047
|
-
${renderToStaticMarkup(
|
|
27372
|
+
${renderToStaticMarkup(jsxRuntime.jsx(CopyIcon, {}))}
|
|
26048
27373
|
</button>
|
|
26049
27374
|
</span>
|
|
26050
27375
|
</span>
|
|
@@ -26053,10 +27378,9 @@ const useInlineCopyClipboardShowdownExtension = () => {
|
|
|
26053
27378
|
}), [getResource]);
|
|
26054
27379
|
};
|
|
26055
27380
|
|
|
26056
|
-
/* eslint-disable max-len */
|
|
26057
27381
|
const useMultilineCopyClipboardShowdownExtension = () => {
|
|
26058
|
-
const { getResource } =
|
|
26059
|
-
return
|
|
27382
|
+
const { getResource } = useContext(QuickStartContext);
|
|
27383
|
+
return useMemo(() => ({
|
|
26060
27384
|
type: 'lang',
|
|
26061
27385
|
regex: /```[\n]\s*((((?!```).)*?\n)+)\s*```{{copy}}/g,
|
|
26062
27386
|
replace: (text, group, _1, _2, groupId) => {
|
|
@@ -26068,7 +27392,7 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
26068
27392
|
<div class="pf-v6-c-code-block__actions">
|
|
26069
27393
|
<div class="pf-v6-c-code-block__actions-item">
|
|
26070
27394
|
<button class="pf-v6-c-button pf-m-plain" type="button" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${groupId}">
|
|
26071
|
-
${renderToStaticMarkup(
|
|
27395
|
+
${renderToStaticMarkup(jsxRuntime.jsx(CopyIcon, {}))}
|
|
26072
27396
|
</button>
|
|
26073
27397
|
</div>
|
|
26074
27398
|
</div>
|
|
@@ -28644,39 +29968,236 @@ marked.use = function (...args) {
|
|
|
28644
29968
|
changeDefaults(marked.defaults);
|
|
28645
29969
|
return marked;
|
|
28646
29970
|
};
|
|
28647
|
-
/**
|
|
28648
|
-
* Run callback for every token
|
|
28649
|
-
*/
|
|
28650
|
-
marked.walkTokens = function (tokens, callback) {
|
|
28651
|
-
return markedInstance.walkTokens(tokens, callback);
|
|
29971
|
+
/**
|
|
29972
|
+
* Run callback for every token
|
|
29973
|
+
*/
|
|
29974
|
+
marked.walkTokens = function (tokens, callback) {
|
|
29975
|
+
return markedInstance.walkTokens(tokens, callback);
|
|
29976
|
+
};
|
|
29977
|
+
/**
|
|
29978
|
+
* Compiles markdown to HTML without enclosing `p` tag.
|
|
29979
|
+
*
|
|
29980
|
+
* @param src String of markdown source to be compiled
|
|
29981
|
+
* @param options Hash of options
|
|
29982
|
+
* @return String of compiled HTML
|
|
29983
|
+
*/
|
|
29984
|
+
marked.parseInline = markedInstance.parseInline;
|
|
29985
|
+
/**
|
|
29986
|
+
* Expose
|
|
29987
|
+
*/
|
|
29988
|
+
marked.Parser = _Parser;
|
|
29989
|
+
marked.parser = _Parser.parse;
|
|
29990
|
+
marked.Renderer = _Renderer;
|
|
29991
|
+
marked.TextRenderer = _TextRenderer;
|
|
29992
|
+
marked.Lexer = _Lexer;
|
|
29993
|
+
marked.lexer = _Lexer.lex;
|
|
29994
|
+
marked.Tokenizer = _Tokenizer;
|
|
29995
|
+
marked.Hooks = _Hooks;
|
|
29996
|
+
marked.parse = marked;
|
|
29997
|
+
marked.options;
|
|
29998
|
+
marked.setOptions;
|
|
29999
|
+
marked.use;
|
|
30000
|
+
marked.walkTokens;
|
|
30001
|
+
marked.parseInline;
|
|
30002
|
+
_Parser.parse;
|
|
30003
|
+
_Lexer.lex;
|
|
30004
|
+
|
|
30005
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30006
|
+
const DOMPurify$2 = require('dompurify');
|
|
30007
|
+
var AdmonitionType;
|
|
30008
|
+
(function (AdmonitionType) {
|
|
30009
|
+
AdmonitionType["TIP"] = "TIP";
|
|
30010
|
+
AdmonitionType["NOTE"] = "NOTE";
|
|
30011
|
+
AdmonitionType["IMPORTANT"] = "IMPORTANT";
|
|
30012
|
+
AdmonitionType["WARNING"] = "WARNING";
|
|
30013
|
+
AdmonitionType["CAUTION"] = "CAUTION";
|
|
30014
|
+
})(AdmonitionType || (AdmonitionType = {}));
|
|
30015
|
+
const admonitionToAlertVariantMap = {
|
|
30016
|
+
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
30017
|
+
[AdmonitionType.TIP]: { variant: 'custom', customIcon: jsxRuntime.jsx(LightbulbIcon, {}) },
|
|
30018
|
+
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
30019
|
+
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: jsxRuntime.jsx(FireIcon, {}) },
|
|
30020
|
+
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
30021
|
+
};
|
|
30022
|
+
const useAdmonitionShowdownExtension = () =>
|
|
30023
|
+
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
30024
|
+
useMemo(() => ({
|
|
30025
|
+
type: 'lang',
|
|
30026
|
+
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
30027
|
+
replace: (text, content, admonitionLabel, admonitionType) => {
|
|
30028
|
+
if (!content || !admonitionLabel || !admonitionType) {
|
|
30029
|
+
return text;
|
|
30030
|
+
}
|
|
30031
|
+
if (admonitionLabel !== 'admonition') {
|
|
30032
|
+
return text;
|
|
30033
|
+
}
|
|
30034
|
+
admonitionType = admonitionType.toUpperCase();
|
|
30035
|
+
// Process markdown content directly using marked
|
|
30036
|
+
const processedContent = marked.parseInline(content);
|
|
30037
|
+
const sanitizedContent = DOMPurify$2.sanitize(processedContent);
|
|
30038
|
+
// Handle unknown admonition types by defaulting to NOTE
|
|
30039
|
+
const admonitionConfig = admonitionToAlertVariantMap[admonitionType] || admonitionToAlertVariantMap.NOTE;
|
|
30040
|
+
const { variant, customIcon } = admonitionConfig;
|
|
30041
|
+
const pfAlert = (jsxRuntime.jsx(Alert, Object.assign({ variant: variant }, (customIcon && { customIcon }), { isInline: true, title: admonitionType, className: "pfext-markdown-admonition" }, { children: jsxRuntime.jsx("div", { dangerouslySetInnerHTML: { __html: sanitizedContent } }) })));
|
|
30042
|
+
return removeTemplateWhitespace(renderToStaticMarkup(pfAlert));
|
|
30043
|
+
},
|
|
30044
|
+
}), []);
|
|
30045
|
+
|
|
30046
|
+
const useCodeShowdownExtension = () => useMemo(() => ({
|
|
30047
|
+
type: 'output',
|
|
30048
|
+
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
30049
|
+
replace: (text, content) => {
|
|
30050
|
+
if (!content) {
|
|
30051
|
+
return text;
|
|
30052
|
+
}
|
|
30053
|
+
const pfCodeBlock = jsxRuntime.jsx(CodeBlock, { children: content });
|
|
30054
|
+
return removeTemplateWhitespace(renderToStaticMarkup(pfCodeBlock));
|
|
30055
|
+
},
|
|
30056
|
+
}), []);
|
|
30057
|
+
|
|
30058
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30059
|
+
const DOMPurify$1 = require('dompurify');
|
|
30060
|
+
const useAccordionShowdownExtension = () => useMemo(() => ({
|
|
30061
|
+
type: 'lang',
|
|
30062
|
+
regex: /\[(.+)]{{(accordion) ("(.*?)")}}/g,
|
|
30063
|
+
replace: (_text, accordionContent, _command, _quotedHeading, accordionHeading) => {
|
|
30064
|
+
const accordionId = String(accordionHeading).replace(/\s/g, '-');
|
|
30065
|
+
// Process accordion content with markdown
|
|
30066
|
+
const processedContent = marked.parseInline(accordionContent);
|
|
30067
|
+
const sanitizedContent = DOMPurify$1.sanitize(processedContent);
|
|
30068
|
+
return removeTemplateWhitespace(renderToStaticMarkup(jsxRuntime.jsx(Accordion, { children: jsxRuntime.jsxs(AccordionItem, { children: [jsxRuntime.jsx(AccordionToggle, Object.assign({ id: `${ACCORDION_MARKDOWN_BUTTON_ID}-${accordionId}` }, { children: accordionHeading })), jsxRuntime.jsx(AccordionContent, Object.assign({ id: `${ACCORDION_MARKDOWN_CONTENT_ID}-${accordionId}`, hidden: true }, { children: jsxRuntime.jsx("div", { dangerouslySetInnerHTML: { __html: sanitizedContent } }) }))] }) })));
|
|
30069
|
+
},
|
|
30070
|
+
}), []);
|
|
30071
|
+
|
|
30072
|
+
const AccordionShowdownHandler = ({ buttonElement, contentElement, }) => {
|
|
30073
|
+
const [expanded, setExpanded] = useState(false);
|
|
30074
|
+
const handleClick = () => {
|
|
30075
|
+
const newExpanded = !expanded;
|
|
30076
|
+
const expandedModifier = 'pf-m-expanded';
|
|
30077
|
+
// Find the accordion item element (parent of the button)
|
|
30078
|
+
const accordionItem = buttonElement.closest('.pf-v6-c-accordion__item');
|
|
30079
|
+
// Update button - both visual state and aria-expanded
|
|
30080
|
+
buttonElement.className = `pf-v6-c-accordion__toggle ${newExpanded ? expandedModifier : ''}`;
|
|
30081
|
+
buttonElement.setAttribute('aria-expanded', newExpanded.toString());
|
|
30082
|
+
// Update content - both visual state and hidden attribute
|
|
30083
|
+
contentElement.hidden = !newExpanded;
|
|
30084
|
+
contentElement.className = `pf-v6-c-accordion__expandable-content ${newExpanded ? expandedModifier : ''}`;
|
|
30085
|
+
// Update accordion item
|
|
30086
|
+
if (accordionItem) {
|
|
30087
|
+
accordionItem.className = `pf-v6-c-accordion__item ${newExpanded ? expandedModifier : ''}`;
|
|
30088
|
+
}
|
|
30089
|
+
setExpanded(newExpanded);
|
|
30090
|
+
};
|
|
30091
|
+
useEventListener(buttonElement, 'click', handleClick);
|
|
30092
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
30093
|
+
};
|
|
30094
|
+
const AccordionRenderExtension = ({ docContext }) => {
|
|
30095
|
+
const buttonElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_BUTTON_ID}]`);
|
|
30096
|
+
const contentElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_CONTENT_ID}]`);
|
|
30097
|
+
return buttonElements.length > 0 ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from(buttonElements).map((elm) => {
|
|
30098
|
+
const content = Array.from(contentElements).find((elm2) => {
|
|
30099
|
+
const elmId = elm.id.split(ACCORDION_MARKDOWN_BUTTON_ID)[1];
|
|
30100
|
+
const elm2Id = elm2.id.split(ACCORDION_MARKDOWN_CONTENT_ID)[1];
|
|
30101
|
+
return elmId === elm2Id;
|
|
30102
|
+
});
|
|
30103
|
+
return (jsxRuntime.jsx(AccordionShowdownHandler, { buttonElement: elm, contentElement: content }, elm.id.split(ACCORDION_MARKDOWN_BUTTON_ID)[1]));
|
|
30104
|
+
}) })) : null;
|
|
30105
|
+
};
|
|
30106
|
+
|
|
30107
|
+
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
30108
|
+
const [isSrcValid, setIsSrcValid] = useState(true);
|
|
30109
|
+
if (src && isSrcValid) {
|
|
30110
|
+
return jsxRuntime.jsx("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
|
|
30111
|
+
}
|
|
30112
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: fallback });
|
|
30113
|
+
};
|
|
30114
|
+
|
|
30115
|
+
var syncAltIcon = createCommonjsModule(function (module, exports) {
|
|
30116
|
+
exports.__esModule = true;
|
|
30117
|
+
exports.SyncAltIconConfig = {
|
|
30118
|
+
name: 'SyncAltIcon',
|
|
30119
|
+
height: 512,
|
|
30120
|
+
width: 512,
|
|
30121
|
+
svgPath: 'M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z',
|
|
30122
|
+
yOffset: 0,
|
|
30123
|
+
xOffset: 0,
|
|
30124
|
+
};
|
|
30125
|
+
exports.SyncAltIcon = require$$0.createIcon(exports.SyncAltIconConfig);
|
|
30126
|
+
exports["default"] = exports.SyncAltIcon;
|
|
30127
|
+
});
|
|
30128
|
+
|
|
30129
|
+
var SyncAltIcon = /*@__PURE__*/getDefaultExportFromCjs(syncAltIcon);
|
|
30130
|
+
|
|
30131
|
+
const DASH = '-';
|
|
30132
|
+
|
|
30133
|
+
const PopoverStatus = ({ hideHeader, children, isVisible = null, statusBody, title, onHide, onShow, }) => (jsxRuntime.jsx(Popover, Object.assign({ position: PopoverPosition.right, headerContent: hideHeader ? null : title, bodyContent: children, "aria-label": title, onHide: onHide, onShow: onShow, isVisible: isVisible }, { children: jsxRuntime.jsx(Button, Object.assign({ variant: "link", isInline: true }, { children: statusBody })) })));
|
|
30134
|
+
|
|
30135
|
+
const StatusIconAndText = ({ icon, title, spin, iconOnly, noTooltip, className, }) => {
|
|
30136
|
+
if (!title) {
|
|
30137
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: DASH });
|
|
30138
|
+
}
|
|
30139
|
+
return (jsxRuntime.jsxs("span", Object.assign({ className: css('pfext-icon-and-text', className), title: iconOnly && !noTooltip ? title : undefined }, { children: [icon &&
|
|
30140
|
+
cloneElement(icon, {
|
|
30141
|
+
className: css(spin && 'fa-spin', icon.props.className, !iconOnly && 'pfext-icon-and-text__icon pfext-icon-flex-child'),
|
|
30142
|
+
}), !iconOnly && jsxRuntime.jsx(CamelCaseWrap, { value: title, dataTest: "status-text" })] })));
|
|
30143
|
+
};
|
|
30144
|
+
|
|
30145
|
+
const GenericStatus = (props) => {
|
|
30146
|
+
const { Icon, children, popoverTitle, title, noTooltip, iconOnly } = props, restProps = __rest(props, ["Icon", "children", "popoverTitle", "title", "noTooltip", "iconOnly"]);
|
|
30147
|
+
const renderIcon = iconOnly && !noTooltip ? jsxRuntime.jsx(Icon, { title: title }) : jsxRuntime.jsx(Icon, {});
|
|
30148
|
+
const statusBody = (jsxRuntime.jsx(StatusIconAndText, Object.assign({}, restProps, { noTooltip: noTooltip, title: title, iconOnly: iconOnly, icon: renderIcon })));
|
|
30149
|
+
return Children.toArray(children).length ? (jsxRuntime.jsx(PopoverStatus, Object.assign({ title: popoverTitle || title }, restProps, { statusBody: statusBody }, { children: children }))) : (statusBody);
|
|
30150
|
+
};
|
|
30151
|
+
|
|
30152
|
+
var checkCircleIcon = createCommonjsModule(function (module, exports) {
|
|
30153
|
+
exports.__esModule = true;
|
|
30154
|
+
exports.CheckCircleIconConfig = {
|
|
30155
|
+
name: 'CheckCircleIcon',
|
|
30156
|
+
height: 512,
|
|
30157
|
+
width: 512,
|
|
30158
|
+
svgPath: 'M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z',
|
|
30159
|
+
yOffset: 0,
|
|
30160
|
+
xOffset: 0,
|
|
30161
|
+
};
|
|
30162
|
+
exports.CheckCircleIcon = require$$0.createIcon(exports.CheckCircleIconConfig);
|
|
30163
|
+
exports["default"] = exports.CheckCircleIcon;
|
|
30164
|
+
});
|
|
30165
|
+
|
|
30166
|
+
var CheckCircleIcon = /*@__PURE__*/getDefaultExportFromCjs(checkCircleIcon);
|
|
30167
|
+
|
|
30168
|
+
var infoCircleIcon = createCommonjsModule(function (module, exports) {
|
|
30169
|
+
exports.__esModule = true;
|
|
30170
|
+
exports.InfoCircleIconConfig = {
|
|
30171
|
+
name: 'InfoCircleIcon',
|
|
30172
|
+
height: 512,
|
|
30173
|
+
width: 512,
|
|
30174
|
+
svgPath: 'M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z',
|
|
30175
|
+
yOffset: 0,
|
|
30176
|
+
xOffset: 0,
|
|
28652
30177
|
};
|
|
28653
|
-
|
|
28654
|
-
|
|
28655
|
-
|
|
28656
|
-
|
|
28657
|
-
|
|
28658
|
-
|
|
28659
|
-
|
|
28660
|
-
|
|
28661
|
-
|
|
28662
|
-
|
|
28663
|
-
|
|
28664
|
-
|
|
28665
|
-
|
|
28666
|
-
|
|
28667
|
-
|
|
28668
|
-
|
|
28669
|
-
|
|
28670
|
-
|
|
28671
|
-
|
|
28672
|
-
|
|
28673
|
-
|
|
28674
|
-
|
|
28675
|
-
|
|
28676
|
-
marked.walkTokens;
|
|
28677
|
-
marked.parseInline;
|
|
28678
|
-
_Parser.parse;
|
|
28679
|
-
_Lexer.lex;
|
|
30178
|
+
exports.InfoCircleIcon = require$$0.createIcon(exports.InfoCircleIconConfig);
|
|
30179
|
+
exports["default"] = exports.InfoCircleIcon;
|
|
30180
|
+
});
|
|
30181
|
+
|
|
30182
|
+
var InfoCircleIcon = /*@__PURE__*/getDefaultExportFromCjs(infoCircleIcon);
|
|
30183
|
+
|
|
30184
|
+
const GreenCheckCircleIcon = ({ className, title, size }) => (jsxRuntime.jsx(Icon, Object.assign({ size: size, status: "success" }, { children: jsxRuntime.jsx(CheckCircleIcon, { "data-test": "success-icon", className: className, title: title }) })));
|
|
30185
|
+
|
|
30186
|
+
const SuccessStatus = (props) => (jsxRuntime.jsx(GenericStatus, Object.assign({}, props, { Icon: GreenCheckCircleIcon, title: props.title || 'Healthy' })));
|
|
30187
|
+
SuccessStatus.displayName = 'SuccessStatus';
|
|
30188
|
+
|
|
30189
|
+
const Status = ({ status, title, iconOnly, noTooltip, className }) => {
|
|
30190
|
+
const statusProps = { title: title || status, iconOnly, noTooltip, className };
|
|
30191
|
+
switch (status) {
|
|
30192
|
+
case 'In Progress':
|
|
30193
|
+
return jsxRuntime.jsx(StatusIconAndText, Object.assign({}, statusProps, { icon: jsxRuntime.jsx(SyncAltIcon, {}) }));
|
|
30194
|
+
case 'Complete':
|
|
30195
|
+
return jsxRuntime.jsx(SuccessStatus, Object.assign({}, statusProps));
|
|
30196
|
+
default:
|
|
30197
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: status || DASH });
|
|
30198
|
+
}
|
|
30199
|
+
};
|
|
30200
|
+
const StatusIcon = ({ status }) => jsxRuntime.jsx(Status, { status: status, iconOnly: true });
|
|
28680
30201
|
|
|
28681
30202
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
28682
30203
|
const DOMPurify = require('dompurify');
|
|
@@ -28689,7 +30210,7 @@ const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void
|
|
|
28689
30210
|
node.setAttribute('rel', 'noopener noreferrer');
|
|
28690
30211
|
return node;
|
|
28691
30212
|
}
|
|
28692
|
-
// add PF content classes
|
|
30213
|
+
// add PF content classes to standard elements (details blocks get handled separately)
|
|
28693
30214
|
if (node.nodeType === 1) {
|
|
28694
30215
|
const contentElements = [
|
|
28695
30216
|
'ul',
|
|
@@ -28740,13 +30261,82 @@ const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void
|
|
|
28740
30261
|
const reversedMarkdown = reverseString(markdown);
|
|
28741
30262
|
const reverseMarkdownWithSubstitutedCodeFences = reversedMarkdown.replace(/{{```((.|\n)*?)```/g, '{{@@@$1@@@');
|
|
28742
30263
|
const markdownWithSubstitutedCodeFences = reverseString(reverseMarkdownWithSubstitutedCodeFences);
|
|
28743
|
-
|
|
30264
|
+
// Fix malformed HTML entities early in the process
|
|
30265
|
+
let preprocessedMarkdown = markdownWithSubstitutedCodeFences;
|
|
30266
|
+
preprocessedMarkdown = preprocessedMarkdown
|
|
30267
|
+
.replace(/ ([^;])/g, ' $1')
|
|
30268
|
+
.replace(/&nbsp;/g, ' ');
|
|
30269
|
+
preprocessedMarkdown = preprocessedMarkdown.replace(/ (?![;])/g, ' ');
|
|
30270
|
+
// Process content in segments to ensure markdown parsing continues after HTML blocks
|
|
30271
|
+
const htmlBlockRegex = /(<(?:details|div|section|article)[^>]*>[\s\S]*?<\/(?:details|div|section|article)>)/g;
|
|
30272
|
+
let parsedMarkdown = '';
|
|
30273
|
+
// Check if there are any HTML blocks
|
|
30274
|
+
if (htmlBlockRegex.test(preprocessedMarkdown)) {
|
|
30275
|
+
// Reset regex for actual processing
|
|
30276
|
+
htmlBlockRegex.lastIndex = 0;
|
|
30277
|
+
let lastIndex = 0;
|
|
30278
|
+
let match;
|
|
30279
|
+
while ((match = htmlBlockRegex.exec(preprocessedMarkdown)) !== null) {
|
|
30280
|
+
// Process markdown before the HTML block
|
|
30281
|
+
const markdownBefore = preprocessedMarkdown.slice(lastIndex, match.index).trim();
|
|
30282
|
+
if (markdownBefore) {
|
|
30283
|
+
const parsed = yield marked.parse(markdownBefore);
|
|
30284
|
+
parsedMarkdown += parsed;
|
|
30285
|
+
}
|
|
30286
|
+
// Process the HTML block: parse markdown content inside while preserving HTML structure
|
|
30287
|
+
let htmlBlock = match[1];
|
|
30288
|
+
// Find and process markdown content inside HTML tags
|
|
30289
|
+
const contentRegex = />(\s*[\s\S]*?)\s*</g;
|
|
30290
|
+
const contentMatches = [];
|
|
30291
|
+
let contentMatch;
|
|
30292
|
+
while ((contentMatch = contentRegex.exec(htmlBlock)) !== null) {
|
|
30293
|
+
const content = contentMatch[1];
|
|
30294
|
+
// Only process content that has markdown formatting but no extension syntax
|
|
30295
|
+
if (content.trim() &&
|
|
30296
|
+
!content.includes('{{') &&
|
|
30297
|
+
(content.includes('**') || content.includes('- ') || content.includes('\n'))) {
|
|
30298
|
+
// This looks like markdown content without extensions - parse it as block content
|
|
30299
|
+
const parsedContent = yield marked.parse(content.trim());
|
|
30300
|
+
// Remove wrapping <p> tags if they exist since we're inside HTML already
|
|
30301
|
+
const cleanedContent = parsedContent.replace(/^<p[^>]*>([\s\S]*)<\/p>[\s]*$/g, '$1');
|
|
30302
|
+
contentMatches.push({
|
|
30303
|
+
original: contentMatch[0],
|
|
30304
|
+
replacement: `>${cleanedContent}<`,
|
|
30305
|
+
});
|
|
30306
|
+
}
|
|
30307
|
+
}
|
|
30308
|
+
// Apply the content replacements
|
|
30309
|
+
contentMatches.forEach(({ original, replacement }) => {
|
|
30310
|
+
htmlBlock = htmlBlock.replace(original, replacement);
|
|
30311
|
+
});
|
|
30312
|
+
// Apply extensions (like admonitions) to the processed HTML block
|
|
30313
|
+
if (extensions) {
|
|
30314
|
+
extensions.forEach(({ regex, replace }) => {
|
|
30315
|
+
if (regex) {
|
|
30316
|
+
htmlBlock = htmlBlock.replace(regex, replace);
|
|
30317
|
+
}
|
|
30318
|
+
});
|
|
30319
|
+
}
|
|
30320
|
+
parsedMarkdown += htmlBlock;
|
|
30321
|
+
lastIndex = htmlBlockRegex.lastIndex;
|
|
30322
|
+
}
|
|
30323
|
+
// Process any remaining markdown after the last HTML block
|
|
30324
|
+
const markdownAfter = preprocessedMarkdown.slice(lastIndex).trim();
|
|
30325
|
+
if (markdownAfter) {
|
|
30326
|
+
const parsed = yield marked.parse(markdownAfter);
|
|
30327
|
+
parsedMarkdown += parsed;
|
|
30328
|
+
}
|
|
30329
|
+
}
|
|
30330
|
+
else {
|
|
30331
|
+
// No HTML blocks found, process normally
|
|
30332
|
+
parsedMarkdown = yield marked.parse(preprocessedMarkdown);
|
|
30333
|
+
}
|
|
28744
30334
|
// Swap the temporary tokens back to code fences before we run the extensions
|
|
28745
30335
|
let md = parsedMarkdown.replace(/@@@/g, '```');
|
|
28746
30336
|
if (extensions) {
|
|
28747
30337
|
// Convert code spans back to md format before we run the custom extension regexes
|
|
28748
30338
|
md = md.replace(/<code>(.*)<\/code>/g, '`$1`');
|
|
28749
|
-
extensions.forEach(({ regex, replace }) => {
|
|
30339
|
+
extensions.forEach(({ regex, replace }, _index) => {
|
|
28750
30340
|
if (regex) {
|
|
28751
30341
|
md = md.replace(regex, replace);
|
|
28752
30342
|
}
|
|
@@ -28757,9 +30347,9 @@ const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void
|
|
|
28757
30347
|
return DOMPurify.sanitize(md);
|
|
28758
30348
|
});
|
|
28759
30349
|
const SyncMarkdownView = ({ content, emptyMsg, extensions, renderExtension, exactHeight, inline, className, }) => {
|
|
28760
|
-
const { getResource } =
|
|
28761
|
-
const [markup, setMarkup] =
|
|
28762
|
-
|
|
30350
|
+
const { getResource } = useContext(QuickStartContext);
|
|
30351
|
+
const [markup, setMarkup] = useState('');
|
|
30352
|
+
useEffect(() => {
|
|
28763
30353
|
function getMd() {
|
|
28764
30354
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28765
30355
|
const md = yield markdownConvert(content || emptyMsg || getResource('Not available'), extensions);
|
|
@@ -28775,7 +30365,7 @@ const SyncMarkdownView = ({ content, emptyMsg, extensions, renderExtension, exac
|
|
|
28775
30365
|
isEmpty: !content,
|
|
28776
30366
|
className,
|
|
28777
30367
|
};
|
|
28778
|
-
return inline ?
|
|
30368
|
+
return inline ? jsxRuntime.jsx(InlineMarkdownView, Object.assign({}, innerProps)) : jsxRuntime.jsx(IFrameMarkdownView, Object.assign({}, innerProps));
|
|
28779
30369
|
};
|
|
28780
30370
|
const uniqueId = (function () {
|
|
28781
30371
|
let num = 0;
|
|
@@ -28787,8 +30377,8 @@ const uniqueId = (function () {
|
|
|
28787
30377
|
})();
|
|
28788
30378
|
const RenderExtension = ({ renderExtension, selector, markup, docContext, }) => {
|
|
28789
30379
|
const forceRender = useForceRender();
|
|
28790
|
-
const markupRef =
|
|
28791
|
-
const shouldRenderExtension =
|
|
30380
|
+
const markupRef = useRef(null);
|
|
30381
|
+
const shouldRenderExtension = useCallback(() => {
|
|
28792
30382
|
if (markupRef.current === markup) {
|
|
28793
30383
|
return true;
|
|
28794
30384
|
}
|
|
@@ -28801,25 +30391,23 @@ const RenderExtension = ({ renderExtension, selector, markup, docContext, }) =>
|
|
|
28801
30391
|
* which causes the component rendered by renderExtension to receive old copy of document
|
|
28802
30392
|
* use forceRender to delay the rendering of extension by one render cycle
|
|
28803
30393
|
*/
|
|
28804
|
-
|
|
30394
|
+
useEffect(() => {
|
|
28805
30395
|
if (renderExtension) {
|
|
28806
30396
|
forceRender();
|
|
28807
30397
|
}
|
|
28808
30398
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28809
30399
|
}, [markup]);
|
|
28810
|
-
return (
|
|
30400
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: shouldRenderExtension() ? renderExtension === null || renderExtension === void 0 ? void 0 : renderExtension(docContext !== null && docContext !== void 0 ? docContext : document, selector) : null }));
|
|
28811
30401
|
};
|
|
28812
30402
|
const InlineMarkdownView = ({ markup, isEmpty, renderExtension, className, }) => {
|
|
28813
|
-
const id =
|
|
28814
|
-
return (
|
|
28815
|
-
React.createElement("div", { dangerouslySetInnerHTML: { __html: markup } }),
|
|
28816
|
-
renderExtension && (React.createElement(RenderExtension, { renderExtension: renderExtension, selector: `#${id}`, markup: markup }))));
|
|
30403
|
+
const id = useMemo(() => uniqueId('markdown'), []);
|
|
30404
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: css({ 'is-empty': isEmpty }, className), id: id }, { children: [jsxRuntime.jsx("div", { style: { marginBlockEnd: 'var(--pf-t-global--spacer--md)' }, dangerouslySetInnerHTML: { __html: markup } }), renderExtension && (jsxRuntime.jsx(RenderExtension, { renderExtension: renderExtension, selector: `#${id}`, markup: markup }))] })));
|
|
28817
30405
|
};
|
|
28818
30406
|
const IFrameMarkdownView = ({ exactHeight, markup, isEmpty, renderExtension, className, }) => {
|
|
28819
|
-
const [frame, setFrame] =
|
|
28820
|
-
const [loaded, setLoaded] =
|
|
28821
|
-
const updateTimeoutHandle =
|
|
28822
|
-
const updateDimensions =
|
|
30407
|
+
const [frame, setFrame] = useState();
|
|
30408
|
+
const [loaded, setLoaded] = useState(false);
|
|
30409
|
+
const updateTimeoutHandle = useRef(null);
|
|
30410
|
+
const updateDimensions = useCallback(() => {
|
|
28823
30411
|
var _a;
|
|
28824
30412
|
if (!((_a = frame === null || frame === void 0 ? void 0 : frame.contentWindow) === null || _a === void 0 ? void 0 : _a.document.body.firstChild)) {
|
|
28825
30413
|
return;
|
|
@@ -28836,10 +30424,10 @@ const IFrameMarkdownView = ({ exactHeight, markup, isEmpty, renderExtension, cla
|
|
|
28836
30424
|
}
|
|
28837
30425
|
});
|
|
28838
30426
|
}, [frame, exactHeight]);
|
|
28839
|
-
|
|
30427
|
+
useEffect(() => () => {
|
|
28840
30428
|
clearTimeout(updateTimeoutHandle.current);
|
|
28841
30429
|
}, []);
|
|
28842
|
-
const onLoad =
|
|
30430
|
+
const onLoad = useCallback(() => {
|
|
28843
30431
|
updateDimensions();
|
|
28844
30432
|
setLoaded(true);
|
|
28845
30433
|
}, [updateDimensions]);
|
|
@@ -28872,9 +30460,9 @@ const IFrameMarkdownView = ({ exactHeight, markup, isEmpty, renderExtension, cla
|
|
|
28872
30460
|
}
|
|
28873
30461
|
</style>
|
|
28874
30462
|
<body class="pf-m-redhat-font"><div style="overflow-y: auto;">${markup}</div></body>`;
|
|
28875
|
-
return (
|
|
28876
|
-
|
|
28877
|
-
|
|
30463
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("iframe", { title: "Markdown content preview", sandbox: "allow-popups allow-popups-to-escape-sandbox allow-same-origin", srcDoc: contents, style: { border: '0px', display: 'block', width: '100%', height: '0' }, ref: (r) => {
|
|
30464
|
+
setFrame(r);
|
|
30465
|
+
}, onLoad: () => onLoad(), className: className }), loaded && frame && renderExtension && (jsxRuntime.jsx(RenderExtension, { markup: markup, selector: '', renderExtension: renderExtension, docContext: frame.contentDocument }))] }));
|
|
28878
30466
|
};
|
|
28879
30467
|
|
|
28880
30468
|
const LINK_LABEL = '[\\d\\w\\s-()$!]+';
|
|
@@ -28884,13 +30472,13 @@ const SELECTOR_ID = `[\\w-]+`;
|
|
|
28884
30472
|
const HIGHLIGHT_REGEXP = new RegExp(`\\[(${LINK_LABEL})]{{(${HIGHLIGHT_ACTIONS.join('|')}) (${SELECTOR_ID})}}`, 'g');
|
|
28885
30473
|
|
|
28886
30474
|
const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
28887
|
-
const { markdown } =
|
|
30475
|
+
const { markdown } = useContext(QuickStartContext);
|
|
28888
30476
|
const inlineCopyClipboardShowdownExtension = useInlineCopyClipboardShowdownExtension();
|
|
28889
30477
|
const multilineCopyClipboardShowdownExtension = useMultilineCopyClipboardShowdownExtension();
|
|
28890
30478
|
const admonitionShowdownExtension = useAdmonitionShowdownExtension();
|
|
28891
30479
|
const codeShowdownExtension = useCodeShowdownExtension();
|
|
28892
30480
|
const accordionShowdownExtension = useAccordionShowdownExtension();
|
|
28893
|
-
return (
|
|
30481
|
+
return (jsxRuntime.jsx(SyncMarkdownView, { inline: true, content: content, exactHeight: exactHeight, extensions: [
|
|
28894
30482
|
{
|
|
28895
30483
|
type: 'lang',
|
|
28896
30484
|
regex: HIGHLIGHT_REGEXP,
|
|
@@ -28915,236 +30503,33 @@ const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
|
28915
30503
|
codeShowdownExtension,
|
|
28916
30504
|
accordionShowdownExtension,
|
|
28917
30505
|
...(markdown ? markdown.extensions : []),
|
|
28918
|
-
], renderExtension: (docContext, rootSelector) => (
|
|
28919
|
-
|
|
28920
|
-
|
|
28921
|
-
React.createElement(MarkdownCopyClipboard, { docContext: docContext, rootSelector: rootSelector }),
|
|
28922
|
-
markdown &&
|
|
28923
|
-
markdown.renderExtension &&
|
|
28924
|
-
markdown.renderExtension(docContext, rootSelector))), className: className }));
|
|
28925
|
-
};
|
|
28926
|
-
|
|
28927
|
-
var AdmonitionType;
|
|
28928
|
-
(function (AdmonitionType) {
|
|
28929
|
-
AdmonitionType["TIP"] = "TIP";
|
|
28930
|
-
AdmonitionType["NOTE"] = "NOTE";
|
|
28931
|
-
AdmonitionType["IMPORTANT"] = "IMPORTANT";
|
|
28932
|
-
AdmonitionType["WARNING"] = "WARNING";
|
|
28933
|
-
AdmonitionType["CAUTION"] = "CAUTION";
|
|
28934
|
-
})(AdmonitionType || (AdmonitionType = {}));
|
|
28935
|
-
const admonitionToAlertVariantMap = {
|
|
28936
|
-
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
28937
|
-
[AdmonitionType.TIP]: { variant: 'custom', customIcon: React.createElement(LightbulbIcon, null) },
|
|
28938
|
-
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
28939
|
-
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: React.createElement(FireIcon, null) },
|
|
28940
|
-
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
28941
|
-
};
|
|
28942
|
-
const useAdmonitionShowdownExtension = () =>
|
|
28943
|
-
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
28944
|
-
React.useMemo(() => ({
|
|
28945
|
-
type: 'lang',
|
|
28946
|
-
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
28947
|
-
replace: (text, content, admonitionLabel, admonitionType, groupId) => {
|
|
28948
|
-
if (!content || !admonitionLabel || !admonitionType || !groupId) {
|
|
28949
|
-
return text;
|
|
28950
|
-
}
|
|
28951
|
-
admonitionType = admonitionType.toUpperCase();
|
|
28952
|
-
const { variant, customIcon } = admonitionToAlertVariantMap[admonitionType];
|
|
28953
|
-
const mdContent = React.createElement(QuickStartMarkdownView, { content: content });
|
|
28954
|
-
const pfAlert = (React.createElement(Alert, Object.assign({ variant: variant }, (customIcon && { customIcon }), { isInline: true, title: admonitionType, className: "pfext-markdown-admonition" }), mdContent));
|
|
28955
|
-
return removeTemplateWhitespace(renderToStaticMarkup(pfAlert));
|
|
28956
|
-
},
|
|
28957
|
-
}), []);
|
|
28958
|
-
|
|
28959
|
-
const useCodeShowdownExtension = () => React.useMemo(() => ({
|
|
28960
|
-
type: 'output',
|
|
28961
|
-
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
28962
|
-
replace: (text, content) => {
|
|
28963
|
-
if (!content) {
|
|
28964
|
-
return text;
|
|
28965
|
-
}
|
|
28966
|
-
const pfCodeBlock = React.createElement(CodeBlock, null, content);
|
|
28967
|
-
return removeTemplateWhitespace(renderToStaticMarkup(pfCodeBlock));
|
|
28968
|
-
},
|
|
28969
|
-
}), []);
|
|
28970
|
-
|
|
28971
|
-
const useAccordionShowdownExtension = () => React.useMemo(() => ({
|
|
28972
|
-
type: 'lang',
|
|
28973
|
-
regex: /\[(.+)]{{(accordion) ("(.*?)")}}/g,
|
|
28974
|
-
replace: (_text, accordionContent, _command, accordionHeading) => {
|
|
28975
|
-
const accordionId = String(accordionHeading).replace(/\s/g, '-');
|
|
28976
|
-
return removeTemplateWhitespace(renderToStaticMarkup(React.createElement(React.Fragment, null,
|
|
28977
|
-
React.createElement(Accordion, { asDefinitionList: true },
|
|
28978
|
-
React.createElement(AccordionItem, { isExpanded: false },
|
|
28979
|
-
React.createElement(AccordionToggle, { id: `${ACCORDION_MARKDOWN_BUTTON_ID}-${accordionId}` }, accordionHeading),
|
|
28980
|
-
React.createElement(AccordionContent, { id: `${ACCORDION_MARKDOWN_CONTENT_ID}-${accordionId}` }, accordionContent))))));
|
|
28981
|
-
},
|
|
28982
|
-
}), []);
|
|
28983
|
-
|
|
28984
|
-
const AccordionShowdownHandler = ({ buttonElement, contentElement, }) => {
|
|
28985
|
-
const [expanded, setExpanded] = React.useState(false);
|
|
28986
|
-
const handleClick = () => {
|
|
28987
|
-
const expandedModifier = 'pf-m-expanded';
|
|
28988
|
-
buttonElement.className = `pf-v6-c-accordion__toggle ${!expanded ? expandedModifier : ''}`;
|
|
28989
|
-
contentElement.hidden = expanded;
|
|
28990
|
-
contentElement.className = `pf-v6-c-accordion__expanded-content ${!expanded ? expandedModifier : ''}`;
|
|
28991
|
-
setExpanded(!expanded);
|
|
28992
|
-
};
|
|
28993
|
-
useEventListener(buttonElement, 'click', handleClick);
|
|
28994
|
-
return React.createElement(React.Fragment, null);
|
|
28995
|
-
};
|
|
28996
|
-
const AccordionRenderExtension = ({ docContext }) => {
|
|
28997
|
-
const buttonElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_BUTTON_ID}]`);
|
|
28998
|
-
const contentElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_CONTENT_ID}]`);
|
|
28999
|
-
return buttonElements.length > 0 ? (React.createElement(React.Fragment, null, Array.from(buttonElements).map((elm) => {
|
|
29000
|
-
const content = Array.from(contentElements).find((elm2) => {
|
|
29001
|
-
const elmId = elm.id.split(ACCORDION_MARKDOWN_BUTTON_ID)[1];
|
|
29002
|
-
const elm2Id = elm2.id.split(ACCORDION_MARKDOWN_CONTENT_ID)[1];
|
|
29003
|
-
return elmId === elm2Id;
|
|
29004
|
-
});
|
|
29005
|
-
return (React.createElement(AccordionShowdownHandler, { key: elm.id.split(ACCORDION_MARKDOWN_BUTTON_ID)[1], buttonElement: elm, contentElement: content }));
|
|
29006
|
-
}))) : null;
|
|
29007
|
-
};
|
|
29008
|
-
|
|
29009
|
-
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
29010
|
-
const [isSrcValid, setIsSrcValid] = React.useState(true);
|
|
29011
|
-
if (src && isSrcValid) {
|
|
29012
|
-
return React.createElement("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
|
|
29013
|
-
}
|
|
29014
|
-
return React.createElement(React.Fragment, null, fallback);
|
|
29015
|
-
};
|
|
29016
|
-
|
|
29017
|
-
var syncAltIcon = createCommonjsModule(function (module, exports) {
|
|
29018
|
-
exports.__esModule = true;
|
|
29019
|
-
exports.SyncAltIconConfig = {
|
|
29020
|
-
name: 'SyncAltIcon',
|
|
29021
|
-
height: 512,
|
|
29022
|
-
width: 512,
|
|
29023
|
-
svgPath: 'M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z',
|
|
29024
|
-
yOffset: 0,
|
|
29025
|
-
xOffset: 0,
|
|
29026
|
-
};
|
|
29027
|
-
exports.SyncAltIcon = require$$0.createIcon(exports.SyncAltIconConfig);
|
|
29028
|
-
exports["default"] = exports.SyncAltIcon;
|
|
29029
|
-
});
|
|
29030
|
-
|
|
29031
|
-
var SyncAltIcon = /*@__PURE__*/getDefaultExportFromCjs(syncAltIcon);
|
|
29032
|
-
|
|
29033
|
-
const DASH = '-';
|
|
29034
|
-
|
|
29035
|
-
const PopoverStatus = ({ hideHeader, children, isVisible = null, statusBody, title, onHide, onShow, }) => (React.createElement(Popover, { position: PopoverPosition.right, headerContent: hideHeader ? null : title, bodyContent: children, "aria-label": title, onHide: onHide, onShow: onShow, isVisible: isVisible },
|
|
29036
|
-
React.createElement(Button, { variant: "link", isInline: true }, statusBody)));
|
|
29037
|
-
|
|
29038
|
-
const StatusIconAndText = ({ icon, title, spin, iconOnly, noTooltip, className, }) => {
|
|
29039
|
-
if (!title) {
|
|
29040
|
-
return React.createElement(React.Fragment, null, DASH);
|
|
29041
|
-
}
|
|
29042
|
-
return (React.createElement("span", { className: css('pfext-icon-and-text', className), title: iconOnly && !noTooltip ? title : undefined },
|
|
29043
|
-
icon &&
|
|
29044
|
-
React.cloneElement(icon, {
|
|
29045
|
-
className: css(spin && 'fa-spin', icon.props.className, !iconOnly && 'pfext-icon-and-text__icon pfext-icon-flex-child'),
|
|
29046
|
-
}),
|
|
29047
|
-
!iconOnly && React.createElement(CamelCaseWrap, { value: title, dataTest: "status-text" })));
|
|
29048
|
-
};
|
|
29049
|
-
|
|
29050
|
-
const GenericStatus = (props) => {
|
|
29051
|
-
const { Icon, children, popoverTitle, title, noTooltip, iconOnly } = props, restProps = __rest(props, ["Icon", "children", "popoverTitle", "title", "noTooltip", "iconOnly"]);
|
|
29052
|
-
const renderIcon = iconOnly && !noTooltip ? React.createElement(Icon, { title: title }) : React.createElement(Icon, null);
|
|
29053
|
-
const statusBody = (React.createElement(StatusIconAndText, Object.assign({}, restProps, { noTooltip: noTooltip, title: title, iconOnly: iconOnly, icon: renderIcon })));
|
|
29054
|
-
return React.Children.toArray(children).length ? (React.createElement(PopoverStatus, Object.assign({ title: popoverTitle || title }, restProps, { statusBody: statusBody }), children)) : (statusBody);
|
|
29055
|
-
};
|
|
29056
|
-
|
|
29057
|
-
var checkCircleIcon = createCommonjsModule(function (module, exports) {
|
|
29058
|
-
exports.__esModule = true;
|
|
29059
|
-
exports.CheckCircleIconConfig = {
|
|
29060
|
-
name: 'CheckCircleIcon',
|
|
29061
|
-
height: 512,
|
|
29062
|
-
width: 512,
|
|
29063
|
-
svgPath: 'M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z',
|
|
29064
|
-
yOffset: 0,
|
|
29065
|
-
xOffset: 0,
|
|
29066
|
-
};
|
|
29067
|
-
exports.CheckCircleIcon = require$$0.createIcon(exports.CheckCircleIconConfig);
|
|
29068
|
-
exports["default"] = exports.CheckCircleIcon;
|
|
29069
|
-
});
|
|
29070
|
-
|
|
29071
|
-
var CheckCircleIcon = /*@__PURE__*/getDefaultExportFromCjs(checkCircleIcon);
|
|
29072
|
-
|
|
29073
|
-
var infoCircleIcon = createCommonjsModule(function (module, exports) {
|
|
29074
|
-
exports.__esModule = true;
|
|
29075
|
-
exports.InfoCircleIconConfig = {
|
|
29076
|
-
name: 'InfoCircleIcon',
|
|
29077
|
-
height: 512,
|
|
29078
|
-
width: 512,
|
|
29079
|
-
svgPath: 'M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z',
|
|
29080
|
-
yOffset: 0,
|
|
29081
|
-
xOffset: 0,
|
|
29082
|
-
};
|
|
29083
|
-
exports.InfoCircleIcon = require$$0.createIcon(exports.InfoCircleIconConfig);
|
|
29084
|
-
exports["default"] = exports.InfoCircleIcon;
|
|
29085
|
-
});
|
|
29086
|
-
|
|
29087
|
-
var InfoCircleIcon = /*@__PURE__*/getDefaultExportFromCjs(infoCircleIcon);
|
|
29088
|
-
|
|
29089
|
-
const GreenCheckCircleIcon = ({ className, title, size }) => (React.createElement(Icon, { size: size, status: "success" },
|
|
29090
|
-
React.createElement(CheckCircleIcon, { "data-test": "success-icon", className: className, title: title })));
|
|
29091
|
-
|
|
29092
|
-
const SuccessStatus = (props) => (React.createElement(GenericStatus, Object.assign({}, props, { Icon: GreenCheckCircleIcon, title: props.title || 'Healthy' })));
|
|
29093
|
-
SuccessStatus.displayName = 'SuccessStatus';
|
|
29094
|
-
|
|
29095
|
-
const Status = ({ status, title, iconOnly, noTooltip, className, }) => {
|
|
29096
|
-
const statusProps = { title: title || status, iconOnly, noTooltip, className };
|
|
29097
|
-
switch (status) {
|
|
29098
|
-
case 'In Progress':
|
|
29099
|
-
return React.createElement(StatusIconAndText, Object.assign({}, statusProps, { icon: React.createElement(SyncAltIcon, null) }));
|
|
29100
|
-
case 'Complete':
|
|
29101
|
-
return React.createElement(SuccessStatus, Object.assign({}, statusProps));
|
|
29102
|
-
default:
|
|
29103
|
-
return React.createElement(React.Fragment, null, status || DASH);
|
|
29104
|
-
}
|
|
30506
|
+
], renderExtension: (docContext, rootSelector) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(AccordionRenderExtension, { docContext: docContext }), jsxRuntime.jsx(MarkdownHighlightExtension, { docContext: docContext, rootSelector: rootSelector }), jsxRuntime.jsx(MarkdownCopyClipboard, { docContext: docContext, rootSelector: rootSelector }), markdown &&
|
|
30507
|
+
markdown.renderExtension &&
|
|
30508
|
+
markdown.renderExtension(docContext, rootSelector)] })), className: className }));
|
|
29105
30509
|
};
|
|
29106
|
-
const StatusIcon = ({ status }) => (React.createElement(Status, { status: status, iconOnly: true }));
|
|
29107
30510
|
|
|
29108
30511
|
const QuickStartTileDescription = ({ description, prerequisites, }) => {
|
|
29109
|
-
const { getResource } =
|
|
30512
|
+
const { getResource } = useContext(QuickStartContext);
|
|
29110
30513
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
29111
|
-
const buttonRef =
|
|
29112
|
-
return (
|
|
29113
|
-
|
|
29114
|
-
|
|
29115
|
-
|
|
29116
|
-
|
|
29117
|
-
|
|
29118
|
-
React.createElement(Button, { variant: "link", isInline: true, "data-testid": "qs-card-prereqs", ref: buttonRef, onClick: (e) => {
|
|
29119
|
-
e.preventDefault();
|
|
29120
|
-
e.stopPropagation();
|
|
29121
|
-
}, "aria-label": getResource('Show prerequisites') },
|
|
29122
|
-
React.createElement(InfoCircleIcon, null)),
|
|
29123
|
-
React.createElement(Popover, { "aria-label": getResource('Prerequisites'), headerContent: getResource('Prerequisites'), triggerRef: buttonRef, bodyContent: React.createElement("div", null,
|
|
29124
|
-
React.createElement("ul", { "aria-label": getResource('Prerequisites') }, prereqs.map((prerequisite, index) => (
|
|
29125
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
29126
|
-
React.createElement("li", { key: index },
|
|
29127
|
-
React.createElement(QuickStartMarkdownView, { content: prerequisite })))))) })))));
|
|
30514
|
+
const buttonRef = useRef(null);
|
|
30515
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(QuickStartMarkdownView, { content: description }), (prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (jsxRuntime.jsxs(Flex, Object.assign({ spaceItems: { default: 'spaceItemsSm' } }, { children: [jsxRuntime.jsxs("h5", { children: [getResource('Prerequisites ({{totalPrereqs}})').replace('{{totalPrereqs}}', prereqs.length), ' '] }), jsxRuntime.jsx(Button, Object.assign({ variant: "link", isInline: true, "data-testid": "qs-card-prereqs", ref: buttonRef, onClick: (e) => {
|
|
30516
|
+
e.preventDefault();
|
|
30517
|
+
e.stopPropagation();
|
|
30518
|
+
}, "aria-label": getResource('Show prerequisites') }, { children: jsxRuntime.jsx(InfoCircleIcon, {}) })), jsxRuntime.jsx(Popover, { "aria-label": getResource('Prerequisites'), headerContent: getResource('Prerequisites'), triggerRef: buttonRef, bodyContent: jsxRuntime.jsx("div", { children: jsxRuntime.jsx("ul", Object.assign({ "aria-label": getResource('Prerequisites') }, { children: prereqs.map((prerequisite, index) => (
|
|
30519
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
30520
|
+
jsxRuntime.jsx("li", { children: jsxRuntime.jsx(QuickStartMarkdownView, { content: prerequisite }) }, index))) })) }) })] })))] }));
|
|
29128
30521
|
};
|
|
29129
30522
|
|
|
29130
30523
|
const QuickStartTileFooter = ({ quickStartId, status, totalTasks, onClickContinue, }) => {
|
|
29131
|
-
const { getResource } =
|
|
29132
|
-
const { activeQuickStartID, startQuickStart, restartQuickStart } =
|
|
29133
|
-
const start =
|
|
30524
|
+
const { getResource } = useContext(QuickStartContext);
|
|
30525
|
+
const { activeQuickStartID, startQuickStart, restartQuickStart } = useContext(QuickStartContext);
|
|
30526
|
+
const start = useCallback(() => {
|
|
29134
30527
|
startQuickStart(quickStartId, totalTasks);
|
|
29135
30528
|
}, [quickStartId, startQuickStart, totalTasks]);
|
|
29136
|
-
const restart =
|
|
30529
|
+
const restart = useCallback(() => {
|
|
29137
30530
|
restartQuickStart(quickStartId, totalTasks);
|
|
29138
30531
|
}, [quickStartId, restartQuickStart, totalTasks]);
|
|
29139
|
-
return (
|
|
29140
|
-
status === QuickStartStatus.NOT_STARTED && (React.createElement(FlexItem, null,
|
|
29141
|
-
React.createElement(Button, { onClick: start, variant: "link", isInline: true, "data-testid": "qs-card-notStarted-start", id: `${quickStartId}-start`, "aria-labelledby": `${quickStartId}-start ${quickStartId}` }, getResource('Start')))),
|
|
29142
|
-
status === QuickStartStatus.IN_PROGRESS && activeQuickStartID !== quickStartId && (React.createElement(FlexItem, null,
|
|
29143
|
-
React.createElement(Button, { variant: "link", onClick: onClickContinue, isInline: true, "data-testid": "qs-card-inProgress-resume", id: `${quickStartId}-continue`, "aria-labelledby": `${quickStartId}-continue ${quickStartId}` }, getResource('Continue')))),
|
|
29144
|
-
status === QuickStartStatus.COMPLETE && (React.createElement(FlexItem, null,
|
|
29145
|
-
React.createElement(Button, { onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-complete-restart", id: `${quickStartId}-restart`, "aria-labelledby": `${quickStartId}-restart ${quickStartId}` }, getResource('Restart')))),
|
|
29146
|
-
status === QuickStartStatus.IN_PROGRESS && (React.createElement(FlexItem, null,
|
|
29147
|
-
React.createElement(Button, { onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-inProgress-restart", id: `${quickStartId}-restart`, "aria-labelledby": `${quickStartId}-restart ${quickStartId}` }, getResource('Restart'))))));
|
|
30532
|
+
return (jsxRuntime.jsxs(Flex, Object.assign({ justifyContent: { default: 'justifyContentSpaceBetween' } }, { children: [status === QuickStartStatus.NOT_STARTED && (jsxRuntime.jsx(FlexItem, { children: jsxRuntime.jsx(Button, Object.assign({ onClick: start, variant: "link", isInline: true, "data-testid": "qs-card-notStarted-start", id: `${quickStartId}-start`, "aria-labelledby": `${quickStartId}-start ${quickStartId}` }, { children: getResource('Start') })) })), status === QuickStartStatus.IN_PROGRESS && activeQuickStartID !== quickStartId && (jsxRuntime.jsx(FlexItem, { children: jsxRuntime.jsx(Button, Object.assign({ variant: "link", onClick: onClickContinue, isInline: true, "data-testid": "qs-card-inProgress-resume", id: `${quickStartId}-continue`, "aria-labelledby": `${quickStartId}-continue ${quickStartId}` }, { children: getResource('Continue') })) })), status === QuickStartStatus.COMPLETE && (jsxRuntime.jsx(FlexItem, { children: jsxRuntime.jsx(Button, Object.assign({ onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-complete-restart", id: `${quickStartId}-restart`, "aria-labelledby": `${quickStartId}-restart ${quickStartId}` }, { children: getResource('Restart') })) })), status === QuickStartStatus.IN_PROGRESS && (jsxRuntime.jsx(FlexItem, { children: jsxRuntime.jsx(Button, Object.assign({ onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-inProgress-restart", id: `${quickStartId}-restart`, "aria-labelledby": `${quickStartId}-restart ${quickStartId}` }, { children: getResource('Restart') })) }))] })));
|
|
29148
30533
|
};
|
|
29149
30534
|
|
|
29150
30535
|
var externalLinkAltIcon = createCommonjsModule(function (module, exports) {
|
|
@@ -29163,15 +30548,12 @@ exports["default"] = exports.ExternalLinkAltIcon;
|
|
|
29163
30548
|
|
|
29164
30549
|
var ExternalLinkAltIcon = /*@__PURE__*/getDefaultExportFromCjs(externalLinkAltIcon);
|
|
29165
30550
|
|
|
29166
|
-
const QuickStartTileFooterExternal = ({ link, quickStartId
|
|
30551
|
+
const QuickStartTileFooterExternal = ({ link, quickStartId }) => {
|
|
29167
30552
|
const { href, text } = link;
|
|
29168
|
-
return (
|
|
29169
|
-
React.createElement(FlexItem, null,
|
|
29170
|
-
React.createElement(Button, { component: "a", href: href, target: "_blank", rel: "noopener noreferrer", variant: "link", "aria-label": `Open documentation in new window`, isInline: true, icon: React.createElement(ExternalLinkAltIcon, null), iconPosition: "right", id: quickStartId, "aria-labelledby": `${quickStartId}-external ${quickStartId}` }, text || href))));
|
|
30553
|
+
return (jsxRuntime.jsx(Flex, Object.assign({ justifyContent: { default: 'justifyContentSpaceBetween' } }, { children: jsxRuntime.jsx(FlexItem, { children: jsxRuntime.jsx(Button, Object.assign({ component: "a", href: href, target: "_blank", rel: "noopener noreferrer", variant: "link", "aria-label": `Open documentation in new window`, isInline: true, icon: jsxRuntime.jsx(ExternalLinkAltIcon, {}), iconPosition: "right", id: quickStartId, "aria-labelledby": `${quickStartId}-external ${quickStartId}` }, { children: text || href })) }) })));
|
|
29171
30554
|
};
|
|
29172
30555
|
|
|
29173
|
-
const QuickStartTileHeader = ({ name, quickStartId, onSelect
|
|
29174
|
-
React.createElement(Button, { "data-test": "title", id: quickStartId, variant: "link", isInline: true, onClick: onSelect }, name)));
|
|
30556
|
+
const QuickStartTileHeader = ({ name, quickStartId, onSelect }) => (jsxRuntime.jsx(Flex, Object.assign({ flexWrap: { default: 'nowrap' } }, { children: jsxRuntime.jsx(Button, Object.assign({ "data-test": "title", id: quickStartId, variant: "link", isInline: true, onClick: onSelect }, { children: name })) })));
|
|
29175
30557
|
|
|
29176
30558
|
var outlinedBookmarkIcon = createCommonjsModule(function (module, exports) {
|
|
29177
30559
|
exports.__esModule = true;
|
|
@@ -29207,7 +30589,7 @@ var OutlinedClockIcon = /*@__PURE__*/getDefaultExportFromCjs(outlinedClockIcon);
|
|
|
29207
30589
|
|
|
29208
30590
|
const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, action, }) => {
|
|
29209
30591
|
const { metadata: { name: id }, spec: { icon, tasks, displayName, description, durationMinutes, prerequisites, link, type }, } = quickStart;
|
|
29210
|
-
const { setActiveQuickStart, footer, getResource } =
|
|
30592
|
+
const { setActiveQuickStart, footer, getResource } = useContext(QuickStartContext);
|
|
29211
30593
|
const statusColorMap = {
|
|
29212
30594
|
[QuickStartStatus.COMPLETE]: 'green',
|
|
29213
30595
|
[QuickStartStatus.IN_PROGRESS]: 'purple',
|
|
@@ -29220,11 +30602,10 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, act
|
|
|
29220
30602
|
};
|
|
29221
30603
|
let quickStartIcon;
|
|
29222
30604
|
if (typeof icon === 'object') {
|
|
29223
|
-
quickStartIcon =
|
|
30605
|
+
quickStartIcon = jsxRuntime.jsx(Icon, Object.assign({ size: "2xl" }, { children: icon }));
|
|
29224
30606
|
}
|
|
29225
30607
|
else {
|
|
29226
|
-
quickStartIcon = (
|
|
29227
|
-
React.createElement(FallbackImg, { src: icon, alt: "", className: "pfext-catalog-item-icon__img", fallback: React.createElement(RocketIcon, null) })));
|
|
30608
|
+
quickStartIcon = (jsxRuntime.jsx(Icon, Object.assign({ size: "2xl" }, { children: jsxRuntime.jsx(FallbackImg, { src: icon, alt: "", className: "pfext-catalog-item-icon__img", fallback: jsxRuntime.jsx(RocketIcon, {}) }) })));
|
|
29228
30609
|
}
|
|
29229
30610
|
const onSelect = () => {
|
|
29230
30611
|
if (!link) {
|
|
@@ -29235,70 +30616,53 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, act
|
|
|
29235
30616
|
}
|
|
29236
30617
|
onClick();
|
|
29237
30618
|
};
|
|
29238
|
-
const footerComponent =
|
|
30619
|
+
const footerComponent = useMemo(() => {
|
|
29239
30620
|
if (footer && footer.show === false) {
|
|
29240
30621
|
return null;
|
|
29241
30622
|
}
|
|
29242
30623
|
if (link) {
|
|
29243
|
-
return
|
|
30624
|
+
return jsxRuntime.jsx(QuickStartTileFooterExternal, { link: link, quickStartId: id });
|
|
29244
30625
|
}
|
|
29245
|
-
return (
|
|
30626
|
+
return (jsxRuntime.jsx(QuickStartTileFooter, { quickStartId: id, status: status, totalTasks: tasks === null || tasks === void 0 ? void 0 : tasks.length, onClickContinue: onSelect }));
|
|
29246
30627
|
}, [footer, id, link, status, tasks === null || tasks === void 0 ? void 0 : tasks.length]);
|
|
29247
30628
|
const ActionIcon = (action === null || action === void 0 ? void 0 : action.icon) || OutlinedBookmarkIcon;
|
|
29248
|
-
const additionalAction = action ? (
|
|
29249
|
-
return (
|
|
30629
|
+
const additionalAction = action ? (jsxRuntime.jsx(Button, Object.assign({ "aria-label": action['aria-label'], icon: jsxRuntime.jsx(ActionIcon, {}), variant: "plain", onClick: action.onClick }, action.buttonProps))) : undefined;
|
|
30630
|
+
return (jsxRuntime.jsxs(Card, Object.assign({ id: `${id}-catalog-tile`, style: { height: '100%' }, "data-testid": `qs-card-${camelize(displayName)}`, className: "pfext-catalog-item" }, (isActive && {
|
|
29250
30631
|
isClickable: true,
|
|
29251
30632
|
isSelectable: true,
|
|
29252
30633
|
isSelected: true,
|
|
29253
30634
|
isClicked: true,
|
|
29254
|
-
})
|
|
29255
|
-
|
|
29256
|
-
|
|
29257
|
-
})), quickStartIcon),
|
|
29258
|
-
React.createElement(CardTitle, null,
|
|
29259
|
-
React.createElement(QuickStartTileHeader, { name: displayName, onSelect: onSelect, quickStartId: id })),
|
|
29260
|
-
React.createElement(CardBody, null,
|
|
29261
|
-
React.createElement(Stack, { hasGutter: true },
|
|
29262
|
-
React.createElement(Flex, { spaceItems: { default: 'spaceItemsSm' } },
|
|
29263
|
-
type && React.createElement(Label, { color: type.color }, type.text),
|
|
29264
|
-
durationMinutes && (React.createElement(Label, { variant: "outline", "data-test": "duration", icon: React.createElement(OutlinedClockIcon, null) }, getResource('{{duration, number}} minutes', durationMinutes).replace('{{duration, number}}', durationMinutes))),
|
|
29265
|
-
status !== QuickStartStatus.NOT_STARTED && (React.createElement(Label, { variant: "outline", color: statusColorMap[status], icon: React.createElement(StatusIcon, { status: status }), "data-test": "status" }, statusLocaleMap[status]))),
|
|
29266
|
-
React.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }))),
|
|
29267
|
-
React.createElement(CardFooter, null, footerComponent)));
|
|
30635
|
+
}), { children: [jsxRuntime.jsx(CardHeader, Object.assign({}, (action && {
|
|
30636
|
+
actions: { actions: additionalAction },
|
|
30637
|
+
}), { children: quickStartIcon })), jsxRuntime.jsx(CardTitle, { children: jsxRuntime.jsx(QuickStartTileHeader, { name: displayName, onSelect: onSelect, quickStartId: id }) }), jsxRuntime.jsx(CardBody, { children: jsxRuntime.jsxs(Stack, Object.assign({ hasGutter: true }, { children: [jsxRuntime.jsxs(Flex, Object.assign({ spaceItems: { default: 'spaceItemsSm' } }, { children: [type && jsxRuntime.jsx(Label, Object.assign({ color: type.color }, { children: type.text })), durationMinutes && (jsxRuntime.jsx(Label, Object.assign({ variant: "outline", "data-test": "duration", icon: jsxRuntime.jsx(OutlinedClockIcon, {}) }, { children: getResource('{{duration, number}} minutes', durationMinutes).replace('{{duration, number}}', durationMinutes) }))), status !== QuickStartStatus.NOT_STARTED && (jsxRuntime.jsx(Label, Object.assign({ variant: "outline", color: statusColorMap[status], icon: jsxRuntime.jsx(StatusIcon, { status: status }), "data-test": "status" }, { children: statusLocaleMap[status] })))] })), jsxRuntime.jsx(QuickStartTileDescription, { description: description, prerequisites: prerequisites })] })) }), jsxRuntime.jsx(CardFooter, { children: footerComponent })] })));
|
|
29268
30638
|
};
|
|
29269
30639
|
|
|
29270
30640
|
const QuickStartCatalog = ({ quickStarts }) => {
|
|
29271
|
-
const { activeQuickStartID, allQuickStartStates } =
|
|
29272
|
-
return (
|
|
29273
|
-
|
|
29274
|
-
|
|
29275
|
-
|
|
29276
|
-
}))));
|
|
30641
|
+
const { activeQuickStartID, allQuickStartStates } = useContext(QuickStartContext);
|
|
30642
|
+
return (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Gallery, Object.assign({ hasGutter: true, className: "pfext-quick-start-catalog__gallery" }, { children: quickStarts.map((quickStart, index) => {
|
|
30643
|
+
const { metadata: { name: id }, } = quickStart;
|
|
30644
|
+
return (jsxRuntime.jsx(QuickStartTile, { quickStart: quickStart, isActive: id === activeQuickStartID, status: getQuickStartStatus(allQuickStartStates, id) }, index));
|
|
30645
|
+
}) })) }));
|
|
29277
30646
|
};
|
|
29278
30647
|
|
|
29279
30648
|
const QuickStartCatalogFilterSearch = (_a) => {
|
|
29280
30649
|
var { searchInputText, handleTextChange } = _a, props = __rest(_a, ["searchInputText", "handleTextChange"]);
|
|
29281
|
-
const { getResource } =
|
|
29282
|
-
return (
|
|
29283
|
-
React.createElement(SearchInput, Object.assign({ placeholder: getResource('Filter by keyword...'), value: searchInputText, onChange: (_ev, value) => handleTextChange(value), onClear: () => handleTextChange('') }, props))));
|
|
30650
|
+
const { getResource } = useContext(QuickStartContext);
|
|
30651
|
+
return (jsxRuntime.jsx(ToolbarItem, { children: jsxRuntime.jsx(SearchInput, Object.assign({ placeholder: getResource('Filter by keyword...'), value: searchInputText, onChange: (_ev, value) => handleTextChange(value), onClear: () => handleTextChange('') }, props)) }));
|
|
29284
30652
|
};
|
|
29285
30653
|
const QuickStartCatalogFilterSelect = (_a) => {
|
|
29286
30654
|
var { isDropdownOpen, setIsDropdownOpen, onRowfilterSelect, selectedFilters, dropdownItems } = _a, props = __rest(_a, ["isDropdownOpen", "setIsDropdownOpen", "onRowfilterSelect", "selectedFilters", "dropdownItems"]);
|
|
29287
|
-
const { getResource } =
|
|
29288
|
-
const toggle = (toggleRef) => (
|
|
29289
|
-
|
|
29290
|
-
selectedFilters.length > 0 && React.createElement(Badge, { isRead: true }, selectedFilters.length)));
|
|
29291
|
-
return (React.createElement(ToolbarItem, null,
|
|
29292
|
-
React.createElement(Select, Object.assign({ "aria-label": getResource('Select filter'), isOpen: isDropdownOpen, selected: selectedFilters, onSelect: onRowfilterSelect, onOpenChange: (isOpen) => setIsDropdownOpen(isOpen), toggle: toggle }, props),
|
|
29293
|
-
React.createElement(SelectList, null, dropdownItems))));
|
|
30655
|
+
const { getResource } = useContext(QuickStartContext);
|
|
30656
|
+
const toggle = (toggleRef) => (jsxRuntime.jsxs(MenuToggle, Object.assign({ isFullWidth: true, ref: toggleRef, onClick: () => setIsDropdownOpen(!isDropdownOpen), isExpanded: isDropdownOpen }, { children: [getResource('Status'), selectedFilters.length > 0 && jsxRuntime.jsx(Badge, Object.assign({ isRead: true }, { children: selectedFilters.length }))] })));
|
|
30657
|
+
return (jsxRuntime.jsx(ToolbarItem, { children: jsxRuntime.jsx(Select, Object.assign({ "aria-label": getResource('Select filter'), isOpen: isDropdownOpen, selected: selectedFilters, onSelect: onRowfilterSelect, onOpenChange: (isOpen) => setIsDropdownOpen(isOpen), toggle: toggle }, props, { children: jsxRuntime.jsx(SelectList, { children: dropdownItems }) })) }));
|
|
29294
30658
|
};
|
|
29295
30659
|
const QuickStartCatalogFilterCount = ({ quickStartsCount }) => {
|
|
29296
|
-
const { getResource } =
|
|
29297
|
-
return (
|
|
30660
|
+
const { getResource } = useContext(QuickStartContext);
|
|
30661
|
+
return (jsxRuntime.jsx(ToolbarItem, Object.assign({ align: { default: 'alignEnd' } }, { children: getResource("{{count, number}} item", quickStartsCount).replace('{{count, number}}', quickStartsCount) })));
|
|
29298
30662
|
};
|
|
29299
30663
|
const QuickStartCatalogFilterSearchWrapper = ({ onSearchInputChange = () => { } }) => {
|
|
29300
|
-
const { useQueryParams, filter, setFilter } =
|
|
29301
|
-
|
|
30664
|
+
const { useQueryParams, filter, setFilter } = useContext(QuickStartContext);
|
|
30665
|
+
useEffect(() => {
|
|
29302
30666
|
// use this effect to clear the search when a `clear all` action is performed higher up
|
|
29303
30667
|
const unlisten = history.listen(({ location }) => {
|
|
29304
30668
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -29324,7 +30688,7 @@ const QuickStartCatalogFilterSearchWrapper = ({ onSearchInputChange = () => { }
|
|
|
29324
30688
|
}
|
|
29325
30689
|
onSearchInputChange(val);
|
|
29326
30690
|
};
|
|
29327
|
-
return (
|
|
30691
|
+
return (jsxRuntime.jsx(QuickStartCatalogFilterSearch, { searchInputText: filter === null || filter === void 0 ? void 0 : filter.keyword, handleTextChange: handleTextChange }));
|
|
29328
30692
|
};
|
|
29329
30693
|
// compare string/number arrays
|
|
29330
30694
|
const equalsIgnoreOrder = (a, b) => {
|
|
@@ -29342,8 +30706,8 @@ const equalsIgnoreOrder = (a, b) => {
|
|
|
29342
30706
|
return true;
|
|
29343
30707
|
};
|
|
29344
30708
|
const QuickStartCatalogFilterStatusWrapper = ({ onStatusChange = () => { } }) => {
|
|
29345
|
-
const { useQueryParams, filter, setFilter } =
|
|
29346
|
-
|
|
30709
|
+
const { useQueryParams, filter, setFilter } = useContext(QuickStartContext);
|
|
30710
|
+
useEffect(() => {
|
|
29347
30711
|
// use this effect to clear the status when a `clear all` action is performed higher up
|
|
29348
30712
|
const unlisten = history.listen(({ location }) => {
|
|
29349
30713
|
var _a;
|
|
@@ -29358,8 +30722,8 @@ const QuickStartCatalogFilterStatusWrapper = ({ onStatusChange = () => { } }) =>
|
|
|
29358
30722
|
unlisten();
|
|
29359
30723
|
};
|
|
29360
30724
|
});
|
|
29361
|
-
const [isDropdownOpen, setIsDropdownOpen] =
|
|
29362
|
-
const onRowfilterSelect =
|
|
30725
|
+
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
30726
|
+
const onRowfilterSelect = useCallback((_e, selectedValue) => {
|
|
29363
30727
|
setIsDropdownOpen(false);
|
|
29364
30728
|
const selection = Object.entries(filter.status.statusTypes).find(([_key, value]) => value === selectedValue)[0];
|
|
29365
30729
|
const selectedFiltersList = filter.status.statusFilters.includes(selection)
|
|
@@ -29376,33 +30740,24 @@ const QuickStartCatalogFilterStatusWrapper = ({ onStatusChange = () => { } }) =>
|
|
|
29376
30740
|
}
|
|
29377
30741
|
onStatusChange(selectedFiltersList);
|
|
29378
30742
|
}, [filter.status.statusFilters, onStatusChange, setFilter, useQueryParams]);
|
|
29379
|
-
const dropdownItems = Object.entries(filter.status.statusTypes).map(([key, value]) => (
|
|
29380
|
-
|
|
29381
|
-
return (React.createElement(QuickStartCatalogFilterSelect, { isDropdownOpen: isDropdownOpen, setIsDropdownOpen: setIsDropdownOpen, onRowfilterSelect: onRowfilterSelect, selectedFilters: filter.status.statusFilters, dropdownItems: dropdownItems }));
|
|
30743
|
+
const dropdownItems = Object.entries(filter.status.statusTypes).map(([key, value]) => (jsxRuntime.jsx(SelectOption, Object.assign({ "data-key": key, value: value, hasCheckbox: true, isSelected: filter.status.statusFilters.includes(key) }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: value }) }), key)));
|
|
30744
|
+
return (jsxRuntime.jsx(QuickStartCatalogFilterSelect, { isDropdownOpen: isDropdownOpen, setIsDropdownOpen: setIsDropdownOpen, onRowfilterSelect: onRowfilterSelect, selectedFilters: filter.status.statusFilters, dropdownItems: dropdownItems }));
|
|
29382
30745
|
};
|
|
29383
|
-
const QuickStartCatalogFilterCountWrapper = ({ quickStartsCount }) =>
|
|
30746
|
+
const QuickStartCatalogFilterCountWrapper = ({ quickStartsCount, }) => jsxRuntime.jsx(QuickStartCatalogFilterCount, { quickStartsCount: quickStartsCount });
|
|
29384
30747
|
|
|
29385
30748
|
const QuickStartCatalogFilter = (_a) => {
|
|
29386
30749
|
var { quickStartsCount, onSearchInputChange = () => { }, onStatusChange = () => { } } = _a, props = __rest(_a, ["quickStartsCount", "onSearchInputChange", "onStatusChange"]);
|
|
29387
|
-
return (
|
|
29388
|
-
React.createElement(ToolbarContent, null,
|
|
29389
|
-
React.createElement(QuickStartCatalogFilterSearchWrapper, { onSearchInputChange: onSearchInputChange }),
|
|
29390
|
-
React.createElement(QuickStartCatalogFilterStatusWrapper, { onStatusChange: onStatusChange }),
|
|
29391
|
-
React.createElement(QuickStartCatalogFilterCountWrapper, { quickStartsCount: quickStartsCount }))));
|
|
30750
|
+
return (jsxRuntime.jsx(Toolbar, Object.assign({}, props, { children: jsxRuntime.jsxs(ToolbarContent, { children: [jsxRuntime.jsx(QuickStartCatalogFilterSearchWrapper, { onSearchInputChange: onSearchInputChange }), jsxRuntime.jsx(QuickStartCatalogFilterStatusWrapper, { onStatusChange: onStatusChange }), jsxRuntime.jsx(QuickStartCatalogFilterCountWrapper, { quickStartsCount: quickStartsCount })] }) })));
|
|
29392
30751
|
};
|
|
29393
30752
|
|
|
29394
30753
|
const QuickStartCatalogEmptyState = ({ clearFilters }) => {
|
|
29395
|
-
const { getResource } =
|
|
29396
|
-
return (
|
|
29397
|
-
React.createElement(EmptyStateBody, null, getResource('No results match the filter criteria. Remove filters or clear all filters to show results.')),
|
|
29398
|
-
React.createElement(EmptyStateFooter, null,
|
|
29399
|
-
React.createElement(EmptyStateActions, null,
|
|
29400
|
-
React.createElement(Button, { variant: "link", onClick: clearFilters, "data-test": "clear-filter button" }, getResource('Clear all filters'))))));
|
|
30754
|
+
const { getResource } = useContext(QuickStartContext);
|
|
30755
|
+
return (jsxRuntime.jsxs(EmptyState, Object.assign({ headingLevel: "h4", icon: SearchIcon, titleText: jsxRuntime.jsx(jsxRuntime.Fragment, { children: getResource('No results found') }) }, { children: [jsxRuntime.jsx(EmptyStateBody, { children: getResource('No results match the filter criteria. Remove filters or clear all filters to show results.') }), jsxRuntime.jsx(EmptyStateFooter, { children: jsxRuntime.jsx(EmptyStateActions, { children: jsxRuntime.jsx(Button, Object.assign({ variant: "link", onClick: clearFilters, "data-test": "clear-filter button" }, { children: getResource('Clear all filters') })) }) })] })));
|
|
29401
30756
|
};
|
|
29402
30757
|
const QuickStartCatalogPage = ({ quickStarts, showFilter, sortFnc = (q1, q2) => q1.spec.displayName.localeCompare(q2.spec.displayName), title, hint, showTitle = true, }) => {
|
|
29403
|
-
const sortFncCallback =
|
|
29404
|
-
const { allQuickStarts = [], setAllQuickStarts, allQuickStartStates, getResource, filter, setFilter, loading, } =
|
|
29405
|
-
|
|
30758
|
+
const sortFncCallback = useCallback(sortFnc, [sortFnc]);
|
|
30759
|
+
const { allQuickStarts = [], setAllQuickStarts, allQuickStartStates, getResource, filter, setFilter, loading, } = useContext(QuickStartContext);
|
|
30760
|
+
useEffect(() => {
|
|
29406
30761
|
// passed through prop, not context
|
|
29407
30762
|
if (quickStarts && JSON.stringify(quickStarts) !== JSON.stringify(allQuickStarts)) {
|
|
29408
30763
|
setAllQuickStarts(quickStarts);
|
|
@@ -29411,8 +30766,8 @@ const QuickStartCatalogPage = ({ quickStarts, showFilter, sortFnc = (q1, q2) =>
|
|
|
29411
30766
|
const initialFilteredQuickStarts = showFilter
|
|
29412
30767
|
? filterQuickStarts(allQuickStarts, filter.keyword, filter.status.statusFilters, allQuickStartStates).sort(sortFncCallback)
|
|
29413
30768
|
: allQuickStarts;
|
|
29414
|
-
const [filteredQuickStarts, setFilteredQuickStarts] =
|
|
29415
|
-
|
|
30769
|
+
const [filteredQuickStarts, setFilteredQuickStarts] = useState(initialFilteredQuickStarts);
|
|
30770
|
+
useEffect(() => {
|
|
29416
30771
|
const filteredQs = showFilter
|
|
29417
30772
|
? filterQuickStarts(allQuickStarts, filter.keyword, filter.status.statusFilters, allQuickStartStates).sort(sortFncCallback)
|
|
29418
30773
|
: allQuickStarts;
|
|
@@ -29455,37 +30810,23 @@ const QuickStartCatalogPage = ({ quickStarts, showFilter, sortFnc = (q1, q2) =>
|
|
|
29455
30810
|
}
|
|
29456
30811
|
};
|
|
29457
30812
|
if (loading) {
|
|
29458
|
-
return
|
|
30813
|
+
return jsxRuntime.jsx(LoadingBox, {});
|
|
29459
30814
|
}
|
|
29460
30815
|
if (!allQuickStarts || allQuickStarts.length === 0) {
|
|
29461
|
-
return
|
|
30816
|
+
return jsxRuntime.jsx(EmptyBox, { label: getResource('Quick Starts') });
|
|
29462
30817
|
}
|
|
29463
|
-
return (
|
|
29464
|
-
(showTitle || showFilter) && (React.createElement(PageSection, { hasBodyWrapper: false },
|
|
29465
|
-
showTitle && (React.createElement(Content, { isEditorial: true },
|
|
29466
|
-
React.createElement(Title, { headingLevel: "h1", "data-test": "page-title" }, title || getResource('Quick Starts')),
|
|
29467
|
-
hint && React.createElement("div", null, hint))),
|
|
29468
|
-
showTitle && React.createElement(Divider, { component: "div" }),
|
|
29469
|
-
showFilter && (React.createElement(React.Fragment, null,
|
|
29470
|
-
React.createElement(QuickStartCatalogFilter, { quickStartsCount: filteredQuickStarts.length, onSearchInputChange: onSearchInputChange, onStatusChange: onStatusChange }))))),
|
|
29471
|
-
React.createElement(PageSection, { hasBodyWrapper: false }, filteredQuickStarts.length === 0 ? (React.createElement(QuickStartCatalogEmptyState, { clearFilters: clearFilters })) : (React.createElement(QuickStartCatalog, { quickStarts: filteredQuickStarts })))));
|
|
30818
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(showTitle || showFilter) && (jsxRuntime.jsxs(PageSection, Object.assign({ hasBodyWrapper: false }, { children: [showTitle && (jsxRuntime.jsxs(Content, Object.assign({ isEditorial: true }, { children: [jsxRuntime.jsx(Title, Object.assign({ headingLevel: "h1", "data-test": "page-title" }, { children: title || getResource('Quick Starts') })), hint && jsxRuntime.jsx("div", { children: hint })] }))), showTitle && jsxRuntime.jsx(Divider, { component: "div" }), showFilter && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(QuickStartCatalogFilter, { quickStartsCount: filteredQuickStarts.length, onSearchInputChange: onSearchInputChange, onStatusChange: onStatusChange }) }))] }))), jsxRuntime.jsx(PageSection, Object.assign({ hasBodyWrapper: false }, { children: filteredQuickStarts.length === 0 ? (jsxRuntime.jsx(QuickStartCatalogEmptyState, { clearFilters: clearFilters })) : (jsxRuntime.jsx(QuickStartCatalog, { quickStarts: filteredQuickStarts })) }))] }));
|
|
29472
30819
|
};
|
|
29473
30820
|
|
|
29474
|
-
const QuickStartCatalogHeader = ({ title, hint, }) => (
|
|
29475
|
-
React.createElement(Title, { headingLevel: "h1", "data-pf-content": "true" }, title),
|
|
29476
|
-
hint && React.createElement("div", null, hint)));
|
|
30821
|
+
const QuickStartCatalogHeader = ({ title, hint, }) => (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Title, Object.assign({ headingLevel: "h1", "data-pf-content": "true" }, { children: title })), hint && jsxRuntime.jsx("div", { children: hint })] }));
|
|
29477
30822
|
|
|
29478
|
-
const QuickStartCatalogSection = ({ children }) => (
|
|
30823
|
+
const QuickStartCatalogSection = ({ children }) => (jsxRuntime.jsx("div", { children: children }));
|
|
29479
30824
|
|
|
29480
|
-
const QuickStartCatalogToolbar = ({ children }) => (
|
|
30825
|
+
const QuickStartCatalogToolbar = ({ children }) => (jsxRuntime.jsx(Toolbar, { children: children }));
|
|
29481
30826
|
|
|
29482
|
-
const QuickStartCloseModal = ({ isOpen, onConfirm, onCancel
|
|
29483
|
-
const { getResource } =
|
|
29484
|
-
return (
|
|
29485
|
-
React.createElement(FlexItem, { align: { default: 'alignRight' } },
|
|
29486
|
-
React.createElement(Button, { variant: "secondary", "data-test": "cancel button", onClick: onCancel }, getResource('Cancel'))),
|
|
29487
|
-
React.createElement(FlexItem, null,
|
|
29488
|
-
React.createElement(Button, { variant: "primary", "data-test": "leave button", onClick: onConfirm }, getResource('Leave')))), isFullScreen: true }, getResource('Your progress will be saved.')));
|
|
30827
|
+
const QuickStartCloseModal = ({ isOpen, onConfirm, onCancel }) => {
|
|
30828
|
+
const { getResource } = useContext(QuickStartContext);
|
|
30829
|
+
return (jsxRuntime.jsx(Modal, Object.assign({ isOpen: isOpen, variant: ModalVariant.small, showClose: false, "data-test": "leave-quickstart", title: getResource('Leave quick start?'), footer: jsxRuntime.jsxs(Flex, { children: [jsxRuntime.jsx(FlexItem, Object.assign({ align: { default: 'alignRight' } }, { children: jsxRuntime.jsx(Button, Object.assign({ variant: "secondary", "data-test": "cancel button", onClick: onCancel }, { children: getResource('Cancel') })) })), jsxRuntime.jsx(FlexItem, { children: jsxRuntime.jsx(Button, Object.assign({ variant: "primary", "data-test": "leave button", onClick: onConfirm }, { children: getResource('Leave') })) })] }), isFullScreen: true }, { children: getResource('Your progress will be saved.') })));
|
|
29489
30830
|
};
|
|
29490
30831
|
|
|
29491
30832
|
var arrowRightIcon = createCommonjsModule(function (module, exports) {
|
|
@@ -29505,25 +30846,17 @@ exports["default"] = exports.ArrowRightIcon;
|
|
|
29505
30846
|
var ArrowRightIcon = /*@__PURE__*/getDefaultExportFromCjs(arrowRightIcon);
|
|
29506
30847
|
|
|
29507
30848
|
const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, isActiveTask, onTaskSelect, children, }) => {
|
|
29508
|
-
const titleRef =
|
|
29509
|
-
const { focusOnQuickStart } =
|
|
29510
|
-
|
|
30849
|
+
const titleRef = useRef(null);
|
|
30850
|
+
const { focusOnQuickStart } = useContext(QuickStartContext);
|
|
30851
|
+
useEffect(() => {
|
|
29511
30852
|
if (focusOnQuickStart && isActiveTask) {
|
|
29512
30853
|
// Focus the WizardNavItem button element that contains the title
|
|
29513
30854
|
titleRef.current.parentNode.focus();
|
|
29514
30855
|
}
|
|
29515
30856
|
}, [focusOnQuickStart, isActiveTask]);
|
|
29516
30857
|
const failedReview = taskStatus === QuickStartTaskStatus.FAILED;
|
|
29517
|
-
const tryAgain = failedReview && (
|
|
29518
|
-
|
|
29519
|
-
React.createElement("div", { className: "pfext-quick-start-task-header__tryagain" }, "Try the steps again.")));
|
|
29520
|
-
const content = (React.createElement("div", { ref: titleRef },
|
|
29521
|
-
React.createElement(Title, { headingLevel: "h3", size: size },
|
|
29522
|
-
React.createElement("span", { className: "pfext-quick-start-task-header__title" }, title),
|
|
29523
|
-
isActiveTask && subtitle && (React.createElement("span", null,
|
|
29524
|
-
' ',
|
|
29525
|
-
React.createElement("span", { "data-test-id": "quick-start-task-subtitle", className: "pfext-quick-start-task-header__subtitle" }, subtitle))),
|
|
29526
|
-
tryAgain)));
|
|
30858
|
+
const tryAgain = failedReview && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", Object.assign({ className: "pfext-quick-start-task-header__tryagain" }, { children: "Try the steps again." }))] }));
|
|
30859
|
+
const content = (jsxRuntime.jsx("div", Object.assign({ ref: titleRef }, { children: jsxRuntime.jsxs(Title, Object.assign({ headingLevel: "h3", size: size }, { children: [jsxRuntime.jsx("span", Object.assign({ className: "pfext-quick-start-task-header__title" }, { children: title })), isActiveTask && subtitle && (jsxRuntime.jsxs("span", { children: [' ', jsxRuntime.jsx("span", Object.assign({ "data-test-id": "quick-start-task-subtitle", className: "pfext-quick-start-task-header__subtitle" }, { children: subtitle }))] })), tryAgain] })) })));
|
|
29527
30860
|
let status = 'default';
|
|
29528
30861
|
if (taskStatus === QuickStartTaskStatus.FAILED) {
|
|
29529
30862
|
status = 'error';
|
|
@@ -29531,42 +30864,31 @@ const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, is
|
|
|
29531
30864
|
else if (taskStatus === QuickStartTaskStatus.SUCCESS) {
|
|
29532
30865
|
status = 'success';
|
|
29533
30866
|
}
|
|
29534
|
-
return (
|
|
30867
|
+
return (jsxRuntime.jsx(WizardNavItem, Object.assign({ content: content, stepIndex: taskIndex, onClick: () => onTaskSelect(taskIndex - 1), component: "button", isCurrent: isActiveTask, status: status, className: "pfext-quick-start-task-header" }, { children: children })));
|
|
29535
30868
|
};
|
|
29536
30869
|
|
|
29537
|
-
const QuickStartTaskHeaderList = ({ tasks, allTaskStatuses, onTaskSelect, }) => (tasks === null || tasks === void 0 ? void 0 : tasks.length) > 0 ? (
|
|
30870
|
+
const QuickStartTaskHeaderList = ({ tasks, allTaskStatuses, onTaskSelect, }) => (tasks === null || tasks === void 0 ? void 0 : tasks.length) > 0 ? (jsxRuntime.jsx("ul", Object.assign({ className: "pf-v6-c-wizard pf-v6-c-wizard__nav-list" }, { children: tasks.map((task, index) => (jsxRuntime.jsx(QuickStartTaskHeader, { title: task.title, taskIndex: index + 1, size: "md", taskStatus: allTaskStatuses[index], onTaskSelect: onTaskSelect }, task.title))) }))) : null;
|
|
29538
30871
|
|
|
29539
30872
|
const QuickStartConclusion = ({ tasks, conclusion, allTaskStatuses, nextQuickStarts, onQuickStartChange, onTaskSelect, }) => {
|
|
29540
30873
|
const hasFailedTask = allTaskStatuses.includes(QuickStartTaskStatus.FAILED);
|
|
29541
|
-
const { getResource } =
|
|
29542
|
-
return (
|
|
29543
|
-
|
|
29544
|
-
|
|
29545
|
-
|
|
29546
|
-
|
|
29547
|
-
|
|
29548
|
-
|
|
29549
|
-
|
|
29550
|
-
|
|
29551
|
-
var _a;
|
|
29552
|
-
return (React.createElement(Button, { variant: "link", onClick: () => onQuickStartChange(nextQuickStart.metadata.name), isInline: true, icon: React.createElement(ArrowRightIcon, null), iconPosition: "end", isBlock: true, key: index, style: { marginTop: 'var(--pf-t--global--spacer--md' } }, getResource('Start {{nextQSDisplayName}} quick start').replace('{{nextQSDisplayName}}', (_a = nextQuickStart === null || nextQuickStart === void 0 ? void 0 : nextQuickStart.spec) === null || _a === void 0 ? void 0 : _a.displayName)));
|
|
29553
|
-
})));
|
|
30874
|
+
const { getResource } = useContext(QuickStartContext);
|
|
30875
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(QuickStartTaskHeaderList, { tasks: tasks, allTaskStatuses: allTaskStatuses, onTaskSelect: onTaskSelect }), jsxRuntime.jsx(QuickStartMarkdownView, { content: hasFailedTask
|
|
30876
|
+
? getResource('One or more verifications did not pass during this quick start. Revisit the tasks or the help links, and then try again.')
|
|
30877
|
+
: conclusion }), !hasFailedTask &&
|
|
30878
|
+
nextQuickStarts &&
|
|
30879
|
+
nextQuickStarts.length > 0 &&
|
|
30880
|
+
nextQuickStarts.map((nextQuickStart, index) => {
|
|
30881
|
+
var _a;
|
|
30882
|
+
return (jsxRuntime.jsx(Button, Object.assign({ variant: "link", onClick: () => onQuickStartChange(nextQuickStart.metadata.name), isInline: true, icon: jsxRuntime.jsx(ArrowRightIcon, {}), iconPosition: "end", isBlock: true, style: { marginTop: 'var(--pf-t--global--spacer--md' } }, { children: getResource('Start {{nextQSDisplayName}} quick start').replace('{{nextQSDisplayName}}', (_a = nextQuickStart === null || nextQuickStart === void 0 ? void 0 : nextQuickStart.spec) === null || _a === void 0 ? void 0 : _a.displayName) }), index));
|
|
30883
|
+
})] }));
|
|
29554
30884
|
};
|
|
29555
30885
|
|
|
29556
30886
|
const QuickStartIntroduction = ({ tasks, introduction, allTaskStatuses, prerequisites, onTaskSelect, }) => {
|
|
29557
|
-
const { getResource } =
|
|
30887
|
+
const { getResource } = useContext(QuickStartContext);
|
|
29558
30888
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
29559
|
-
const [isPrereqsExpanded, setIsPrereqsExpanded] =
|
|
29560
|
-
const prereqList = (prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (
|
|
29561
|
-
|
|
29562
|
-
React.createElement(QuickStartMarkdownView, { content: pr })))))));
|
|
29563
|
-
return (React.createElement(Stack, { hasGutter: true },
|
|
29564
|
-
React.createElement(QuickStartMarkdownView, { content: introduction }),
|
|
29565
|
-
prereqList,
|
|
29566
|
-
React.createElement("p", null,
|
|
29567
|
-
getResource('In this quick start, you will complete {{count, number}} task', tasks === null || tasks === void 0 ? void 0 : tasks.length).replace('{{count, number}}', (tasks === null || tasks === void 0 ? void 0 : tasks.length) || 0),
|
|
29568
|
-
":"),
|
|
29569
|
-
React.createElement(QuickStartTaskHeaderList, { tasks: tasks, allTaskStatuses: allTaskStatuses, onTaskSelect: onTaskSelect })));
|
|
30889
|
+
const [isPrereqsExpanded, setIsPrereqsExpanded] = useState(false);
|
|
30890
|
+
const prereqList = (prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (jsxRuntime.jsx(ExpandableSection, Object.assign({ toggleText: getResource('View Prerequisites ({{totalPrereqs}})').replace('{{totalPrereqs}}', prereqs.length), onToggle: () => setIsPrereqsExpanded(!isPrereqsExpanded) }, { children: jsxRuntime.jsx(List, { children: prereqs.map((pr) => (jsxRuntime.jsx(ListItem, { children: jsxRuntime.jsx(QuickStartMarkdownView, { content: pr }) }, pr))) }) })));
|
|
30891
|
+
return (jsxRuntime.jsxs(Stack, Object.assign({ hasGutter: true }, { children: [jsxRuntime.jsx(QuickStartMarkdownView, { content: introduction }), prereqList, jsxRuntime.jsxs("p", { children: [getResource('In this quick start, you will complete {{count, number}} task', (tasks === null || tasks === void 0 ? void 0 : tasks.length) || 0).replace('{{count, number}}', (tasks === null || tasks === void 0 ? void 0 : tasks.length) || 0), ":"] }), jsxRuntime.jsx(QuickStartTaskHeaderList, { tasks: tasks, allTaskStatuses: allTaskStatuses, onTaskSelect: onTaskSelect })] })));
|
|
29570
30892
|
};
|
|
29571
30893
|
|
|
29572
30894
|
const getAlertVariant = (status) => {
|
|
@@ -29581,64 +30903,52 @@ const getAlertVariant = (status) => {
|
|
|
29581
30903
|
};
|
|
29582
30904
|
const QuickStartTaskReview = ({ review, taskStatus, onTaskReview, }) => {
|
|
29583
30905
|
const { instructions, failedTaskHelp: taskHelp } = review;
|
|
29584
|
-
const { getResource } =
|
|
29585
|
-
return (
|
|
30906
|
+
const { getResource } = useContext(QuickStartContext);
|
|
30907
|
+
return (jsxRuntime.jsxs(Alert, Object.assign({ variant: getAlertVariant(taskStatus), title: getResource('Check your work'), isInline: true, role: "alert", style: {
|
|
29586
30908
|
marginBottom: 'var(--pf-t--global--spacer--md)',
|
|
29587
|
-
} },
|
|
29588
|
-
React.createElement(QuickStartMarkdownView, { content: instructions }),
|
|
29589
|
-
React.createElement("span", { className: "pfext-quick-start-task-review__actions" },
|
|
29590
|
-
React.createElement(Radio, { id: "review-success", name: "review-success", "data-testid": "qs-drawer-check-yes", label: getResource('Yes'), className: "pfext-quick-start-task-review__radio", isChecked: taskStatus === QuickStartTaskStatus.SUCCESS, onChange: () => onTaskReview(QuickStartTaskStatus.SUCCESS) }),
|
|
29591
|
-
React.createElement(Radio, { id: "review-failed", name: "review-failed", "data-testid": "qs-drawer-check-no", label: getResource('No'), className: "pfext-quick-start-task-review__radio", isChecked: taskStatus === QuickStartTaskStatus.FAILED, onChange: () => onTaskReview(QuickStartTaskStatus.FAILED) })),
|
|
29592
|
-
taskStatus === QuickStartTaskStatus.FAILED && taskHelp && (React.createElement(QuickStartMarkdownView, { content: taskHelp, exactHeight: true }))));
|
|
30909
|
+
} }, { children: [jsxRuntime.jsx(QuickStartMarkdownView, { content: instructions }), jsxRuntime.jsxs("span", Object.assign({ className: "pfext-quick-start-task-review__actions" }, { children: [jsxRuntime.jsx(Radio, { id: "review-success", name: "review-success", "data-testid": "qs-drawer-check-yes", label: getResource('Yes'), className: "pfext-quick-start-task-review__radio", isChecked: taskStatus === QuickStartTaskStatus.SUCCESS, onChange: () => onTaskReview(QuickStartTaskStatus.SUCCESS) }), jsxRuntime.jsx(Radio, { id: "review-failed", name: "review-failed", "data-testid": "qs-drawer-check-no", label: getResource('No'), className: "pfext-quick-start-task-review__radio", isChecked: taskStatus === QuickStartTaskStatus.FAILED, onChange: () => onTaskReview(QuickStartTaskStatus.FAILED) })] })), taskStatus === QuickStartTaskStatus.FAILED && taskHelp && (jsxRuntime.jsx(QuickStartMarkdownView, { content: taskHelp, exactHeight: true }))] })));
|
|
29593
30910
|
};
|
|
29594
30911
|
|
|
29595
30912
|
const QuickStartTasks = ({ tasks, taskNumber, allTaskStatuses, onTaskReview, onTaskSelect, }) => {
|
|
29596
|
-
const { getResource, alwaysShowTaskReview } =
|
|
29597
|
-
return (
|
|
29598
|
-
|
|
29599
|
-
|
|
29600
|
-
|
|
29601
|
-
|
|
29602
|
-
|
|
29603
|
-
|
|
29604
|
-
|
|
29605
|
-
|
|
29606
|
-
|
|
29607
|
-
|
|
29608
|
-
|
|
29609
|
-
|
|
29610
|
-
|
|
29611
|
-
|
|
29612
|
-
}))));
|
|
29613
|
-
};
|
|
29614
|
-
|
|
29615
|
-
const QuickStartContent = React.forwardRef(({ quickStart, nextQuickStarts = [], taskNumber, allTaskStatuses, onTaskSelect, onTaskReview, onQuickStartChange, }, ref) => {
|
|
30913
|
+
const { getResource, alwaysShowTaskReview } = useContext(QuickStartContext);
|
|
30914
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: "pf-v6-c-wizard pf-v6-c-wizard__nav-list", style: { padding: '0 0 0 0' } }, { children: jsxRuntime.jsx("ul", { children: tasks
|
|
30915
|
+
.filter((_, index) => allTaskStatuses[index] !== QuickStartTaskStatus.INIT)
|
|
30916
|
+
.map((task, index) => {
|
|
30917
|
+
const { title, description, review } = task;
|
|
30918
|
+
const isActiveTask = index === taskNumber;
|
|
30919
|
+
const taskStatus = allTaskStatuses[index];
|
|
30920
|
+
const shouldShowTaskReview = (!QUICKSTART_TASKS_INITIAL_STATES.includes(taskStatus) || alwaysShowTaskReview) &&
|
|
30921
|
+
review;
|
|
30922
|
+
return (jsxRuntime.jsx(Fragment$1, { children: jsxRuntime.jsx(QuickStartTaskHeader, Object.assign({ taskIndex: index + 1, title: title, size: "md", subtitle: getResource('{{index, number}} of {{tasks, number}}')
|
|
30923
|
+
.replace('{{index, number}}', index + 1)
|
|
30924
|
+
.replace('{{tasks, number}}', tasks.length), taskStatus: taskStatus, isActiveTask: isActiveTask, onTaskSelect: onTaskSelect }, { children: isActiveTask && (jsxRuntime.jsxs(Stack, Object.assign({ hasGutter: true }, { children: [jsxRuntime.jsx(QuickStartMarkdownView, { content: description }), shouldShowTaskReview && (jsxRuntime.jsx(QuickStartTaskReview, { review: review, taskStatus: taskStatus, onTaskReview: onTaskReview }))] }))) })) }, title));
|
|
30925
|
+
}) }) })));
|
|
30926
|
+
};
|
|
30927
|
+
|
|
30928
|
+
const QuickStartContent = forwardRef(({ quickStart, nextQuickStarts = [], taskNumber, allTaskStatuses, onTaskSelect, onTaskReview, onQuickStartChange, }, ref) => {
|
|
29616
30929
|
const { spec: { introduction, tasks, conclusion, prerequisites }, } = quickStart;
|
|
29617
30930
|
const totalTasks = tasks === null || tasks === void 0 ? void 0 : tasks.length;
|
|
29618
|
-
return (
|
|
29619
|
-
taskNumber === -1 && (React.createElement(QuickStartIntroduction, { tasks: tasks, allTaskStatuses: allTaskStatuses, introduction: introduction, prerequisites: prerequisites, onTaskSelect: onTaskSelect })),
|
|
29620
|
-
taskNumber > -1 && taskNumber < totalTasks && (React.createElement(QuickStartTasks, { tasks: tasks, taskNumber: taskNumber, allTaskStatuses: allTaskStatuses, onTaskReview: onTaskReview, onTaskSelect: onTaskSelect })),
|
|
29621
|
-
taskNumber === totalTasks && (React.createElement(QuickStartConclusion, { tasks: tasks, conclusion: conclusion, allTaskStatuses: allTaskStatuses, nextQuickStarts: nextQuickStarts, onQuickStartChange: onQuickStartChange, onTaskSelect: onTaskSelect }))));
|
|
30931
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: "pfext-quick-start-task", ref: ref }, { children: [taskNumber === -1 && (jsxRuntime.jsx(QuickStartIntroduction, { tasks: tasks, allTaskStatuses: allTaskStatuses, introduction: introduction, prerequisites: prerequisites, onTaskSelect: onTaskSelect })), taskNumber > -1 && taskNumber < totalTasks && (jsxRuntime.jsx(QuickStartTasks, { tasks: tasks, taskNumber: taskNumber, allTaskStatuses: allTaskStatuses, onTaskReview: onTaskReview, onTaskSelect: onTaskSelect })), taskNumber === totalTasks && (jsxRuntime.jsx(QuickStartConclusion, { tasks: tasks, conclusion: conclusion, allTaskStatuses: allTaskStatuses, nextQuickStarts: nextQuickStarts, onQuickStartChange: onQuickStartChange, onTaskSelect: onTaskSelect }))] })));
|
|
29622
30932
|
});
|
|
29623
30933
|
|
|
29624
30934
|
const QuickStartFooter = ({ status, taskNumber, totalTasks, onNext, onBack, quickStartId, className, }) => {
|
|
29625
|
-
const { restartQuickStart, getResource } =
|
|
29626
|
-
const PrimaryButtonText =
|
|
30935
|
+
const { restartQuickStart, getResource } = useContext(QuickStartContext);
|
|
30936
|
+
const PrimaryButtonText = useMemo(() => ({
|
|
29627
30937
|
START: getResource('Start'),
|
|
29628
30938
|
CONTINUE: getResource('Continue'),
|
|
29629
30939
|
NEXT: getResource('Next'),
|
|
29630
30940
|
CLOSE: getResource('Close'),
|
|
29631
30941
|
}), [getResource]);
|
|
29632
|
-
const SecondaryButtonText =
|
|
30942
|
+
const SecondaryButtonText = useMemo(() => ({
|
|
29633
30943
|
BACK: getResource('Back'),
|
|
29634
30944
|
RESTART: getResource('Restart'),
|
|
29635
30945
|
}), [getResource]);
|
|
29636
|
-
const onRestart =
|
|
30946
|
+
const onRestart = useCallback((e) => {
|
|
29637
30947
|
e.preventDefault();
|
|
29638
30948
|
e.stopPropagation();
|
|
29639
30949
|
restartQuickStart(quickStartId, totalTasks);
|
|
29640
30950
|
}, [quickStartId, restartQuickStart, totalTasks]);
|
|
29641
|
-
const getPrimaryButtonText =
|
|
30951
|
+
const getPrimaryButtonText = useMemo(() => {
|
|
29642
30952
|
if (status === QuickStartStatus.NOT_STARTED) {
|
|
29643
30953
|
return PrimaryButtonText.START;
|
|
29644
30954
|
}
|
|
@@ -29650,23 +30960,17 @@ const QuickStartFooter = ({ status, taskNumber, totalTasks, onNext, onBack, quic
|
|
|
29650
30960
|
}
|
|
29651
30961
|
return PrimaryButtonText.CONTINUE;
|
|
29652
30962
|
}, [taskNumber, totalTasks, PrimaryButtonText, status]);
|
|
29653
|
-
const getPrimaryButton =
|
|
29654
|
-
const getSecondaryButton =
|
|
29655
|
-
const getSideNoteAction =
|
|
29656
|
-
return (
|
|
29657
|
-
React.createElement(ActionList, null,
|
|
29658
|
-
React.createElement(ActionListGroup, null,
|
|
29659
|
-
React.createElement(ActionListItem, null, getPrimaryButton),
|
|
29660
|
-
React.createElement(ActionListItem, null, getSecondaryButton)),
|
|
29661
|
-
React.createElement(ActionListGroup, null,
|
|
29662
|
-
React.createElement(ActionListItem, null, getSideNoteAction)))));
|
|
30963
|
+
const getPrimaryButton = useMemo(() => (jsxRuntime.jsx(Button, Object.assign({ variant: "primary", className: "pfext-quick-start-footer__actionbtn", onClick: onNext, "data-testid": `qs-drawer-${camelize(getPrimaryButtonText)}`, "data-test": `${getPrimaryButtonText} button` }, { children: getPrimaryButtonText }))), [getPrimaryButtonText, onNext]);
|
|
30964
|
+
const getSecondaryButton = useMemo(() => taskNumber === -1 && status !== QuickStartStatus.NOT_STARTED ? (jsxRuntime.jsx(Button, Object.assign({ variant: "secondary", onClick: onRestart, "data-testid": "qs-drawer-restart" }, { children: SecondaryButtonText.RESTART }))) : (taskNumber > -1 && (jsxRuntime.jsx(Button, Object.assign({ variant: "secondary", onClick: onBack, "data-testid": "qs-drawer-back" }, { children: SecondaryButtonText.BACK })))), [onRestart, onBack, SecondaryButtonText, status, taskNumber]);
|
|
30965
|
+
const getSideNoteAction = useMemo(() => taskNumber !== -1 && (jsxRuntime.jsx(Button, Object.assign({ variant: "link", onClick: onRestart, "data-testid": "qs-drawer-side-note-action" }, { children: SecondaryButtonText.RESTART }))), [taskNumber, onRestart, SecondaryButtonText.RESTART]);
|
|
30966
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: css('pfext-quick-start-footer', className) }, { children: jsxRuntime.jsxs(ActionList, { children: [jsxRuntime.jsxs(ActionListGroup, { children: [jsxRuntime.jsx(ActionListItem, { children: getPrimaryButton }), jsxRuntime.jsx(ActionListItem, { children: getSecondaryButton })] }), jsxRuntime.jsx(ActionListGroup, { children: jsxRuntime.jsx(ActionListItem, { children: getSideNoteAction }) })] }) })));
|
|
29663
30967
|
};
|
|
29664
30968
|
|
|
29665
30969
|
const QuickStartController = ({ quickStart, nextQuickStarts, contentRef, footerClass, }) => {
|
|
29666
30970
|
const { metadata: { name }, spec: { tasks = [] }, } = quickStart;
|
|
29667
30971
|
const totalTasks = tasks === null || tasks === void 0 ? void 0 : tasks.length;
|
|
29668
|
-
const { activeQuickStartID, allQuickStartStates, setAllQuickStartStates, activeQuickStartState, setActiveQuickStart, setQuickStartTaskNumber, setQuickStartTaskStatus, nextStep, previousStep, } =
|
|
29669
|
-
|
|
30972
|
+
const { activeQuickStartID, allQuickStartStates, setAllQuickStartStates, activeQuickStartState, setActiveQuickStart, setQuickStartTaskNumber, setQuickStartTaskStatus, nextStep, previousStep, } = useContext(QuickStartContext);
|
|
30973
|
+
useEffect(() => {
|
|
29670
30974
|
// If activeQuickStartID was changed through prop from QuickStartContainer, need to init the state if it does not exist yet
|
|
29671
30975
|
if (activeQuickStartID && !allQuickStartStates[activeQuickStartID]) {
|
|
29672
30976
|
setAllQuickStartStates(Object.assign(Object.assign({}, allQuickStartStates), { [activeQuickStartID]: getDefaultQuickStartState() }));
|
|
@@ -29675,9 +30979,9 @@ const QuickStartController = ({ quickStart, nextQuickStarts, contentRef, footerC
|
|
|
29675
30979
|
const status = activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.status;
|
|
29676
30980
|
const taskNumber = activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.taskNumber;
|
|
29677
30981
|
const allTaskStatuses = tasks.map((task, index) => activeQuickStartState[`taskStatus${index}`]);
|
|
29678
|
-
const handleQuickStartChange =
|
|
29679
|
-
const handleTaskStatusChange =
|
|
29680
|
-
const getQuickStartActiveTask =
|
|
30982
|
+
const handleQuickStartChange = useCallback((quickStartId) => setActiveQuickStart(quickStartId), [setActiveQuickStart]);
|
|
30983
|
+
const handleTaskStatusChange = useCallback((newTaskStatus) => setQuickStartTaskStatus(newTaskStatus), [setQuickStartTaskStatus]);
|
|
30984
|
+
const getQuickStartActiveTask = useCallback(() => {
|
|
29681
30985
|
let activeTaskNumber = 0;
|
|
29682
30986
|
while (activeTaskNumber !== totalTasks &&
|
|
29683
30987
|
activeQuickStartState[`taskStatus${activeTaskNumber}`] === QuickStartTaskStatus.SUCCESS) {
|
|
@@ -29685,11 +30989,11 @@ const QuickStartController = ({ quickStart, nextQuickStarts, contentRef, footerC
|
|
|
29685
30989
|
}
|
|
29686
30990
|
return activeTaskNumber;
|
|
29687
30991
|
}, [totalTasks, activeQuickStartState]);
|
|
29688
|
-
const handleQuickStartContinue =
|
|
30992
|
+
const handleQuickStartContinue = useCallback(() => {
|
|
29689
30993
|
const activeTaskNumber = getQuickStartActiveTask();
|
|
29690
30994
|
setQuickStartTaskNumber(name, activeTaskNumber);
|
|
29691
30995
|
}, [getQuickStartActiveTask, setQuickStartTaskNumber, name]);
|
|
29692
|
-
const handleNext =
|
|
30996
|
+
const handleNext = useCallback(() => {
|
|
29693
30997
|
if (status === QuickStartStatus.COMPLETE && taskNumber === totalTasks) {
|
|
29694
30998
|
return handleQuickStartChange('');
|
|
29695
30999
|
}
|
|
@@ -29698,13 +31002,11 @@ const QuickStartController = ({ quickStart, nextQuickStarts, contentRef, footerC
|
|
|
29698
31002
|
}
|
|
29699
31003
|
return nextStep(totalTasks);
|
|
29700
31004
|
}, [handleQuickStartChange, nextStep, status, taskNumber, totalTasks, handleQuickStartContinue]);
|
|
29701
|
-
const handleBack =
|
|
29702
|
-
const handleTaskSelect =
|
|
31005
|
+
const handleBack = useCallback(() => previousStep(), [previousStep]);
|
|
31006
|
+
const handleTaskSelect = useCallback((selectedTaskNumber) => {
|
|
29703
31007
|
setQuickStartTaskNumber(name, selectedTaskNumber);
|
|
29704
31008
|
}, [name, setQuickStartTaskNumber]);
|
|
29705
|
-
return (
|
|
29706
|
-
React.createElement(QuickStartContent, { quickStart: quickStart, nextQuickStarts: nextQuickStarts, taskNumber: taskNumber, allTaskStatuses: allTaskStatuses, onTaskSelect: handleTaskSelect, onTaskReview: handleTaskStatusChange, onQuickStartChange: handleQuickStartChange, ref: contentRef }),
|
|
29707
|
-
React.createElement(QuickStartFooter, { status: status, taskNumber: taskNumber, totalTasks: totalTasks, onNext: handleNext, onBack: handleBack, className: footerClass, quickStartId: quickStart.metadata.name })));
|
|
31009
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(QuickStartContent, { quickStart: quickStart, nextQuickStarts: nextQuickStarts, taskNumber: taskNumber, allTaskStatuses: allTaskStatuses, onTaskSelect: handleTaskSelect, onTaskReview: handleTaskStatusChange, onQuickStartChange: handleQuickStartChange, ref: contentRef }), jsxRuntime.jsx(QuickStartFooter, { status: status, taskNumber: taskNumber, totalTasks: totalTasks, onNext: handleNext, onBack: handleBack, className: footerClass, quickStartId: quickStart.metadata.name })] }));
|
|
29708
31010
|
};
|
|
29709
31011
|
|
|
29710
31012
|
const getElement = (appendTo) => {
|
|
@@ -29714,7 +31016,7 @@ const getElement = (appendTo) => {
|
|
|
29714
31016
|
return appendTo;
|
|
29715
31017
|
};
|
|
29716
31018
|
const useScrollTopOnTaskNumberChange = (node, taskNumber) => {
|
|
29717
|
-
|
|
31019
|
+
useEffect(() => {
|
|
29718
31020
|
if (node) {
|
|
29719
31021
|
node.scrollTo({ top: 0, behavior: 'smooth' });
|
|
29720
31022
|
}
|
|
@@ -29722,9 +31024,9 @@ const useScrollTopOnTaskNumberChange = (node, taskNumber) => {
|
|
|
29722
31024
|
};
|
|
29723
31025
|
const QuickStartPanelContent = (_a) => {
|
|
29724
31026
|
var { quickStarts = [], handleClose, activeQuickStartID, appendTo, isResizable = true, showClose = true, footerClass } = _a, props = __rest(_a, ["quickStarts", "handleClose", "activeQuickStartID", "appendTo", "isResizable", "showClose", "footerClass"]);
|
|
29725
|
-
const titleRef =
|
|
29726
|
-
const { getResource, activeQuickStartState, focusOnQuickStart } =
|
|
29727
|
-
const [contentRef, setContentRef] =
|
|
31027
|
+
const titleRef = useRef(null);
|
|
31028
|
+
const { getResource, activeQuickStartState, focusOnQuickStart } = useContext(QuickStartContext);
|
|
31029
|
+
const [contentRef, setContentRef] = useState();
|
|
29728
31030
|
const quickStart = quickStarts.find((qs) => qs.metadata.name === activeQuickStartID);
|
|
29729
31031
|
const taskNumber = activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.taskNumber;
|
|
29730
31032
|
useScrollTopOnTaskNumberChange(contentRef, taskNumber);
|
|
@@ -29740,27 +31042,16 @@ const QuickStartPanelContent = (_a) => {
|
|
|
29740
31042
|
}
|
|
29741
31043
|
return Number.parseInt(taskNumber) + 1;
|
|
29742
31044
|
};
|
|
29743
|
-
|
|
31045
|
+
useEffect(() => {
|
|
29744
31046
|
if (focusOnQuickStart && quickStart) {
|
|
29745
31047
|
titleRef.current.focus();
|
|
29746
31048
|
}
|
|
29747
31049
|
}, [focusOnQuickStart, quickStart]);
|
|
29748
|
-
const content = quickStart ? (
|
|
29749
|
-
|
|
29750
|
-
|
|
29751
|
-
|
|
29752
|
-
|
|
29753
|
-
React.createElement("span", null, quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.displayName),
|
|
29754
|
-
' '),
|
|
29755
|
-
React.createElement("span", null, (quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
29756
|
-
? getResource('{{type}} • {{duration, number}} minutes', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
29757
|
-
.replace('{{duration, number}}', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
29758
|
-
.replace('{{type}}', getResource('Type'))
|
|
29759
|
-
: getResource('Type'))),
|
|
29760
|
-
showClose && (React.createElement(DrawerActions, null,
|
|
29761
|
-
React.createElement(DrawerCloseButton, { onClick: handleClose, className: "pfext-quick-start-panel-content__close-button", "data-testid": "qs-drawer-close" }))))),
|
|
29762
|
-
React.createElement(DrawerPanelBody, { className: "pfext-quick-start-panel-content__body", "data-test": "content" },
|
|
29763
|
-
React.createElement(QuickStartController, { quickStart: quickStart, nextQuickStarts: nextQuickStarts, footerClass: footerClass, contentRef: setContentRef })))) : null;
|
|
31050
|
+
const content = quickStart ? (jsxRuntime.jsxs(DrawerPanelContent, Object.assign({ isResizable: isResizable, "data-testid": `qs-drawer-${camelize(quickStart.spec.displayName)}`, "data-qs": `qs-step-${getStep()}`, "data-test": "quickstart drawer", style: { '--pf-v6-c-drawer__panel--PaddingBlockStart': '0' } }, props, { children: [jsxRuntime.jsx("div", Object.assign({ className: "pfext-quick-start-panel-content" }, { children: jsxRuntime.jsxs(DrawerHead, { children: [jsxRuntime.jsxs("div", Object.assign({ tabIndex: -1, ref: titleRef }, { children: [jsxRuntime.jsxs(Title, Object.assign({ headingLevel: "h2", size: "xl", style: { marginRight: 'var(--pf-t--global--spacer--md)' } }, { children: [jsxRuntime.jsx("span", { children: quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.displayName }), ' '] })), jsxRuntime.jsx("span", { children: (quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
31051
|
+
? getResource('{{type}} • {{duration, number}} minutes', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
31052
|
+
.replace('{{duration, number}}', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
31053
|
+
.replace('{{type}}', getResource('Type'))
|
|
31054
|
+
: getResource('Type') })] })), showClose && (jsxRuntime.jsx(DrawerActions, { children: jsxRuntime.jsx(DrawerCloseButton, { onClick: handleClose, className: "pfext-quick-start-panel-content__close-button", "data-testid": "qs-drawer-close" }) }))] }) })), jsxRuntime.jsx(DrawerPanelBody, Object.assign({ className: "pfext-quick-start-panel-content__body", "data-test": "content" }, { children: jsxRuntime.jsx(QuickStartController, { quickStart: quickStart, nextQuickStarts: nextQuickStarts, footerClass: footerClass, contentRef: setContentRef }) }))] }))) : null;
|
|
29764
31055
|
if (appendTo) {
|
|
29765
31056
|
return ReactDOM.createPortal(content, getElement(appendTo));
|
|
29766
31057
|
}
|
|
@@ -29769,8 +31060,8 @@ const QuickStartPanelContent = (_a) => {
|
|
|
29769
31060
|
|
|
29770
31061
|
const QuickStartDrawerContent = (_a) => {
|
|
29771
31062
|
var { quickStarts = [], appendTo, fullWidth, handleDrawerClose } = _a, props = __rest(_a, ["quickStarts", "appendTo", "fullWidth", "handleDrawerClose"]);
|
|
29772
|
-
const { activeQuickStartID, allQuickStarts = [], activeQuickStartState, } =
|
|
29773
|
-
const combinedQuickStarts = allQuickStarts.
|
|
31063
|
+
const { activeQuickStartID, allQuickStarts = [], activeQuickStartState, } = useContext(QuickStartContext);
|
|
31064
|
+
const combinedQuickStarts = [...allQuickStarts, ...quickStarts].filter((qs, idx, arr) => arr.findIndex((q) => q.metadata.name === qs.metadata.name) === idx);
|
|
29774
31065
|
const handleClose = () => {
|
|
29775
31066
|
handleDrawerClose && handleDrawerClose(activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.status);
|
|
29776
31067
|
};
|
|
@@ -29781,14 +31072,14 @@ const QuickStartDrawerContent = (_a) => {
|
|
|
29781
31072
|
},
|
|
29782
31073
|
}
|
|
29783
31074
|
: {};
|
|
29784
|
-
return (
|
|
31075
|
+
return (jsxRuntime.jsx(QuickStartPanelContent, Object.assign({ quickStarts: combinedQuickStarts, handleClose: handleClose, activeQuickStartID: activeQuickStartID, appendTo: appendTo, isResizable: !fullWidth }, fullWidthPanelStyle, props)));
|
|
29785
31076
|
};
|
|
29786
31077
|
|
|
29787
31078
|
const QuickStartDrawer = (_a) => {
|
|
29788
31079
|
var { quickStarts = [], children, appendTo, fullWidth, onCloseInProgress, onCloseNotInProgress } = _a, props = __rest(_a, ["quickStarts", "children", "appendTo", "fullWidth", "onCloseInProgress", "onCloseNotInProgress"]);
|
|
29789
|
-
const { activeQuickStartID, setActiveQuickStart, allQuickStarts = [], allQuickStartStates, setAllQuickStartStates, } =
|
|
31080
|
+
const { activeQuickStartID, setActiveQuickStart, allQuickStarts = [], allQuickStartStates, setAllQuickStartStates, } = useContext(QuickStartContext);
|
|
29790
31081
|
const combinedQuickStarts = allQuickStarts.concat(quickStarts);
|
|
29791
|
-
|
|
31082
|
+
useEffect(() => {
|
|
29792
31083
|
const params = new URLSearchParams(window.location.search);
|
|
29793
31084
|
// if there is a quick start param, but the quick start is not active, set it
|
|
29794
31085
|
// this can happen if a new browser session is opened or an incognito window for example
|
|
@@ -29801,13 +31092,13 @@ const QuickStartDrawer = (_a) => {
|
|
|
29801
31092
|
}
|
|
29802
31093
|
}
|
|
29803
31094
|
}, [activeQuickStartID, combinedQuickStarts, setActiveQuickStart]);
|
|
29804
|
-
|
|
31095
|
+
useEffect(() => {
|
|
29805
31096
|
// If activeQuickStartID was changed through prop from QuickStartContainer, need to init the state if it does not exist yet
|
|
29806
31097
|
if (activeQuickStartID && !allQuickStartStates[activeQuickStartID]) {
|
|
29807
31098
|
setAllQuickStartStates(Object.assign(Object.assign({}, allQuickStartStates), { [activeQuickStartID]: getDefaultQuickStartState() }));
|
|
29808
31099
|
}
|
|
29809
31100
|
}, [activeQuickStartID, allQuickStartStates, setAllQuickStartStates]);
|
|
29810
|
-
const [modalOpen, setModalOpen] =
|
|
31101
|
+
const [modalOpen, setModalOpen] = useState(false);
|
|
29811
31102
|
const onClose = () => setActiveQuickStart('');
|
|
29812
31103
|
const handleClose = (activeQuickStartStatus) => {
|
|
29813
31104
|
if (activeQuickStartStatus === QuickStartStatus.IN_PROGRESS) {
|
|
@@ -29837,11 +31128,7 @@ const QuickStartDrawer = (_a) => {
|
|
|
29837
31128
|
},
|
|
29838
31129
|
}
|
|
29839
31130
|
: {};
|
|
29840
|
-
return (
|
|
29841
|
-
React.createElement(Drawer, Object.assign({ isExpanded: !!activeQuickStartID, isInline: true }, props),
|
|
29842
|
-
React.createElement(DrawerContent, Object.assign({ panelContent: React.createElement(QuickStartDrawerContent, { quickStarts: combinedQuickStarts, handleDrawerClose: handleClose, appendTo: appendTo, fullWidth: fullWidth }) }, fullWidthBodyStyle),
|
|
29843
|
-
React.createElement(DrawerContentBody, null, children))),
|
|
29844
|
-
React.createElement(QuickStartCloseModal, { isOpen: modalOpen, onConfirm: onModalConfirm, onCancel: onModalCancel })));
|
|
31131
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Drawer, Object.assign({ isExpanded: !!activeQuickStartID, isInline: true }, props, { children: jsxRuntime.jsx(DrawerContent, Object.assign({ panelContent: jsxRuntime.jsx(QuickStartDrawerContent, { quickStarts: combinedQuickStarts, handleDrawerClose: handleClose, appendTo: appendTo, fullWidth: fullWidth }) }, fullWidthBodyStyle, { children: jsxRuntime.jsx(DrawerContentBody, { children: children }) })) })), jsxRuntime.jsx(QuickStartCloseModal, { isOpen: modalOpen, onConfirm: onModalConfirm, onCancel: onModalCancel })] }));
|
|
29845
31132
|
};
|
|
29846
31133
|
|
|
29847
31134
|
const QuickStartContainer = (_a) => {
|
|
@@ -29856,13 +31143,13 @@ const QuickStartContainer = (_a) => {
|
|
|
29856
31143
|
useQueryParams,
|
|
29857
31144
|
markdown,
|
|
29858
31145
|
alwaysShowTaskReview }, contextProps));
|
|
29859
|
-
|
|
31146
|
+
useEffect(() => {
|
|
29860
31147
|
if (quickStarts &&
|
|
29861
31148
|
JSON.stringify(quickStarts) !== JSON.stringify(valuesForQuickstartContext.allQuickStarts)) {
|
|
29862
31149
|
valuesForQuickstartContext.setAllQuickStarts(quickStarts);
|
|
29863
31150
|
}
|
|
29864
31151
|
}, [quickStarts, valuesForQuickstartContext]);
|
|
29865
|
-
|
|
31152
|
+
useEffect(() => {
|
|
29866
31153
|
if (loading !== valuesForQuickstartContext.loading) {
|
|
29867
31154
|
valuesForQuickstartContext.setLoading(loading);
|
|
29868
31155
|
}
|
|
@@ -29871,7 +31158,7 @@ const QuickStartContainer = (_a) => {
|
|
|
29871
31158
|
fullWidth,
|
|
29872
31159
|
onCloseInProgress,
|
|
29873
31160
|
onCloseNotInProgress }, props);
|
|
29874
|
-
return (
|
|
31161
|
+
return (jsxRuntime.jsx(QuickStartContext.Provider, Object.assign({ value: valuesForQuickstartContext }, { children: isManagedDrawer ? (jsxRuntime.jsx(QuickStartDrawer, Object.assign({}, drawerProps, { children: children }))) : (children) })));
|
|
29875
31162
|
};
|
|
29876
31163
|
|
|
29877
31164
|
var barsIcon = createCommonjsModule(function (module, exports) {
|
|
@@ -29899,14 +31186,14 @@ const HelpTopicContextDefaults = {
|
|
|
29899
31186
|
setFilteredHelpTopics: () => { },
|
|
29900
31187
|
loading: false,
|
|
29901
31188
|
};
|
|
29902
|
-
const HelpTopicContext =
|
|
31189
|
+
const HelpTopicContext = createContext(HelpTopicContextDefaults);
|
|
29903
31190
|
const useValuesForHelpTopicContext = (value = {}) => {
|
|
29904
31191
|
const combinedValue = Object.assign(Object.assign({}, HelpTopicContextDefaults), value);
|
|
29905
|
-
const [loading, setLoading] =
|
|
31192
|
+
const [loading, setLoading] = useState(combinedValue.loading);
|
|
29906
31193
|
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
29907
|
-
const [helpTopics, setHelpTopics] =
|
|
29908
|
-
const [activeHelpTopic, setActiveHelpTopic] =
|
|
29909
|
-
const setActiveHelpTopicByName =
|
|
31194
|
+
const [helpTopics, setHelpTopics] = useState(combinedValue.helpTopics || []);
|
|
31195
|
+
const [activeHelpTopic, setActiveHelpTopic] = useState(combinedValue.activeHelpTopic || null);
|
|
31196
|
+
const setActiveHelpTopicByName = useCallback((helpTopicName) => {
|
|
29910
31197
|
const topic = helpTopics.find((t) => t.name === helpTopicName);
|
|
29911
31198
|
if (!helpTopicName) {
|
|
29912
31199
|
setActiveHelpTopic(null);
|
|
@@ -29914,7 +31201,7 @@ const useValuesForHelpTopicContext = (value = {}) => {
|
|
|
29914
31201
|
}
|
|
29915
31202
|
setActiveHelpTopic(topic);
|
|
29916
31203
|
}, [helpTopics]);
|
|
29917
|
-
const [filteredHelpTopics, setFilteredHelpTopics] =
|
|
31204
|
+
const [filteredHelpTopics, setFilteredHelpTopics] = useState(combinedValue.filteredHelpTopics || []);
|
|
29918
31205
|
return {
|
|
29919
31206
|
helpTopics,
|
|
29920
31207
|
setHelpTopics,
|
|
@@ -29930,8 +31217,8 @@ const useValuesForHelpTopicContext = (value = {}) => {
|
|
|
29930
31217
|
const HelpTopicPanelContent = (_a) => {
|
|
29931
31218
|
var _b, _c;
|
|
29932
31219
|
var { activeHelpTopic = null, filteredHelpTopics = [], isResizable = true, onClose } = _a, props = __rest(_a, ["activeHelpTopic", "filteredHelpTopics", "isResizable", "onClose"]);
|
|
29933
|
-
const { setActiveHelpTopicByName } =
|
|
29934
|
-
const [isHelpTopicMenuOpen, setIsHelpTopicMenuOpen] =
|
|
31220
|
+
const { setActiveHelpTopicByName } = useContext(HelpTopicContext);
|
|
31221
|
+
const [isHelpTopicMenuOpen, setIsHelpTopicMenuOpen] = useState(false);
|
|
29935
31222
|
const toggleHelpTopicMenu = () => {
|
|
29936
31223
|
setIsHelpTopicMenuOpen(!isHelpTopicMenuOpen);
|
|
29937
31224
|
};
|
|
@@ -29941,24 +31228,10 @@ const HelpTopicPanelContent = (_a) => {
|
|
|
29941
31228
|
toggleHelpTopicMenu();
|
|
29942
31229
|
};
|
|
29943
31230
|
const helpTopicOptions = filteredHelpTopics.length > 1 &&
|
|
29944
|
-
filteredHelpTopics.map((topic) => (
|
|
29945
|
-
const paddingContainer = (children) =>
|
|
29946
|
-
const panelBodyItems = (
|
|
29947
|
-
|
|
29948
|
-
!!((_b = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _b === void 0 ? void 0 : _b.length) && React.createElement(Divider, null),
|
|
29949
|
-
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) => (React.createElement(StackItem, { key: index },
|
|
29950
|
-
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))))))));
|
|
29951
|
-
const content = (React.createElement(DrawerPanelContent, Object.assign({ isResizable: isResizable }, props),
|
|
29952
|
-
React.createElement("div", null,
|
|
29953
|
-
React.createElement(DrawerHead, null,
|
|
29954
|
-
React.createElement("div", null,
|
|
29955
|
-
helpTopicOptions && (React.createElement(Select, { isPlain: true, id: "help-topics-select", selected: activeHelpTopic, isOpen: isHelpTopicMenuOpen, onSelect: onSelectHelpTopic, onOpenChange: (isOpen) => setIsHelpTopicMenuOpen(isOpen), toggle: (toggleRef) => (React.createElement(MenuToggle, { isFullWidth: true, ref: toggleRef, icon: React.createElement(BarsIcon, null), onClick: toggleHelpTopicMenu, isExpanded: isHelpTopicMenuOpen }, activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.title)) },
|
|
29956
|
-
React.createElement(SelectList, null, helpTopicOptions))),
|
|
29957
|
-
React.createElement(Title, { headingLevel: "h1", size: "xl", style: { marginRight: 'var(--pf-t--global--spacer--md)' } }, activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.title)),
|
|
29958
|
-
React.createElement(DrawerActions, null,
|
|
29959
|
-
React.createElement(DrawerCloseButton, { onClick: onClose, "data-testid": "qs-drawer-close" }))),
|
|
29960
|
-
React.createElement(Divider, null),
|
|
29961
|
-
React.createElement(DrawerPanelBody, { "data-test": "content" }, panelBodyItems))));
|
|
31231
|
+
filteredHelpTopics.map((topic) => (jsxRuntime.jsx(SelectOption, Object.assign({ value: topic.name }, { children: topic.title }), topic.name)));
|
|
31232
|
+
const paddingContainer = (children) => jsxRuntime.jsx("div", Object.assign({ style: { padding: '24px' } }, { children: children }));
|
|
31233
|
+
const panelBodyItems = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [paddingContainer(jsxRuntime.jsx(QuickStartMarkdownView, { content: activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.content })), !!((_b = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _b === void 0 ? void 0 : _b.length) && jsxRuntime.jsx(Divider, {}), paddingContainer(jsxRuntime.jsx(Stack, Object.assign({ hasGutter: true }, { children: (_c = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _c === void 0 ? void 0 : _c.map(({ href, text, newTab, isExternal }, index) => (jsxRuntime.jsx(StackItem, { children: jsxRuntime.jsx(Button, Object.assign({ component: "a", href: href, target: newTab ? '_blank' : '', rel: "noopener noreferrer", variant: "link", "aria-label": `Open documentation in new window`, isInline: true, icon: isExternal ? jsxRuntime.jsx(ExternalLinkAltIcon, {}) : null, iconPosition: "right", style: { fontSize: 'inherit' } }, { children: text || href })) }, index))) })))] }));
|
|
31234
|
+
const content = (jsxRuntime.jsx(DrawerPanelContent, Object.assign({ isResizable: isResizable }, props, { children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs(DrawerHead, { children: [jsxRuntime.jsxs("div", { children: [helpTopicOptions && (jsxRuntime.jsx(Select, Object.assign({ isPlain: true, id: "help-topics-select", selected: activeHelpTopic, isOpen: isHelpTopicMenuOpen, onSelect: onSelectHelpTopic, onOpenChange: (isOpen) => setIsHelpTopicMenuOpen(isOpen), toggle: (toggleRef) => (jsxRuntime.jsx(MenuToggle, Object.assign({ isFullWidth: true, ref: toggleRef, icon: jsxRuntime.jsx(BarsIcon, {}), onClick: toggleHelpTopicMenu, isExpanded: isHelpTopicMenuOpen }, { children: activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.title }))) }, { children: jsxRuntime.jsx(SelectList, { children: helpTopicOptions }) }))), jsxRuntime.jsx(Title, Object.assign({ headingLevel: "h1", size: "xl", style: { marginRight: 'var(--pf-t--global--spacer--md)' } }, { children: activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.title }))] }), jsxRuntime.jsx(DrawerActions, { children: jsxRuntime.jsx(DrawerCloseButton, { onClick: onClose, "data-testid": "qs-drawer-close" }) })] }), jsxRuntime.jsx(Divider, {}), jsxRuntime.jsx(DrawerPanelBody, Object.assign({ "data-test": "content" }, { children: panelBodyItems }))] }) })));
|
|
29962
31235
|
return content;
|
|
29963
31236
|
};
|
|
29964
31237
|
|
|
@@ -29967,30 +31240,27 @@ const HelpTopicContainer = (_a) => {
|
|
|
29967
31240
|
const valuesForHelpTopicContext = useValuesForHelpTopicContext(Object.assign({ helpTopics,
|
|
29968
31241
|
language, resourceBundle: Object.assign({}, resourceBundle), loading,
|
|
29969
31242
|
markdown }, contextProps));
|
|
29970
|
-
|
|
31243
|
+
useEffect(() => {
|
|
29971
31244
|
if (loading !== valuesForHelpTopicContext.loading) {
|
|
29972
31245
|
valuesForHelpTopicContext.setLoading(loading);
|
|
29973
31246
|
}
|
|
29974
31247
|
}, [loading, valuesForHelpTopicContext]);
|
|
29975
|
-
|
|
31248
|
+
useEffect(() => {
|
|
29976
31249
|
if (helpTopics &&
|
|
29977
31250
|
JSON.stringify(helpTopics) !== JSON.stringify(valuesForHelpTopicContext.helpTopics)) {
|
|
29978
31251
|
valuesForHelpTopicContext.setHelpTopics(helpTopics);
|
|
29979
31252
|
}
|
|
29980
31253
|
}, [helpTopics, valuesForHelpTopicContext]);
|
|
29981
|
-
return (
|
|
29982
|
-
React.createElement(HelpTopicDrawer, Object.assign({}, props), children)));
|
|
31254
|
+
return (jsxRuntime.jsx(HelpTopicContext.Provider, Object.assign({ value: valuesForHelpTopicContext }, { children: jsxRuntime.jsx(HelpTopicDrawer, Object.assign({}, props, { children: children })) })));
|
|
29983
31255
|
};
|
|
29984
31256
|
const HelpTopicDrawer = (_a) => {
|
|
29985
31257
|
var { children } = _a, props = __rest(_a, ["children"]);
|
|
29986
|
-
const { activeHelpTopic, filteredHelpTopics, setActiveHelpTopicByName } =
|
|
31258
|
+
const { activeHelpTopic, filteredHelpTopics, setActiveHelpTopicByName } = useContext(HelpTopicContext);
|
|
29987
31259
|
const onClose = () => {
|
|
29988
31260
|
setActiveHelpTopicByName('');
|
|
29989
31261
|
};
|
|
29990
|
-
const panelContent = (
|
|
29991
|
-
return (
|
|
29992
|
-
React.createElement(Drawer, Object.assign({ isExpanded: !!activeHelpTopic, isInline: true }, props), children ? (React.createElement(DrawerContent, { panelContent: panelContent },
|
|
29993
|
-
React.createElement(DrawerContentBody, null, children))) : (React.createElement("div", { className: "pf-v6-c-drawer__main" }, panelContent)))));
|
|
31262
|
+
const panelContent = (jsxRuntime.jsx(HelpTopicPanelContent, { activeHelpTopic: activeHelpTopic, filteredHelpTopics: filteredHelpTopics, onClose: onClose }));
|
|
31263
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(Drawer, Object.assign({ isExpanded: !!activeHelpTopic, isInline: true }, props, { children: children ? (jsxRuntime.jsx(DrawerContent, Object.assign({ panelContent: panelContent }, { children: jsxRuntime.jsx(DrawerContentBody, { children: children }) }))) : (jsxRuntime.jsx("div", Object.assign({ className: "pf-v6-c-drawer__main" }, { children: panelContent }))) })) }));
|
|
29994
31264
|
};
|
|
29995
31265
|
|
|
29996
31266
|
const useLocalStorage = (key, initialValue) => {
|