@patternfly/quickstarts 6.1.0-prerelease.2 → 6.1.0-prerelease.3

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/index.js CHANGED
@@ -2161,39 +2161,26 @@ const QuickStartPanelContent = (_a) => {
2161
2161
  return content;
2162
2162
  };
2163
2163
 
2164
- const QuickStartContainer = (_a) => {
2165
- var { quickStarts, children, activeQuickStartID, allQuickStartStates, setActiveQuickStartID, setAllQuickStartStates, appendTo, fullWidth, onCloseInProgress, onCloseNotInProgress, resourceBundle, showCardFooters, useLegacyHeaderColors, language, loading = false, useQueryParams = true, markdown, contextProps, alwaysShowTaskReview = true } = _a, props = tslib.__rest(_a, ["quickStarts", "children", "activeQuickStartID", "allQuickStartStates", "setActiveQuickStartID", "setAllQuickStartStates", "appendTo", "fullWidth", "onCloseInProgress", "onCloseNotInProgress", "resourceBundle", "showCardFooters", "useLegacyHeaderColors", "language", "loading", "useQueryParams", "markdown", "contextProps", "alwaysShowTaskReview"]);
2166
- const valuesForQuickstartContext = useValuesForQuickStartContext(Object.assign({ allQuickStarts: quickStarts, activeQuickStartID,
2167
- setActiveQuickStartID,
2168
- allQuickStartStates,
2169
- setAllQuickStartStates, footer: {
2170
- show: showCardFooters,
2171
- }, useLegacyHeaderColors,
2172
- language, resourceBundle: Object.assign({}, resourceBundle), loading,
2173
- useQueryParams,
2174
- markdown,
2175
- alwaysShowTaskReview }, contextProps));
2176
- React__namespace.useEffect(() => {
2177
- if (quickStarts &&
2178
- JSON.stringify(quickStarts) !== JSON.stringify(valuesForQuickstartContext.allQuickStarts)) {
2179
- valuesForQuickstartContext.setAllQuickStarts(quickStarts);
2180
- }
2181
- }, [quickStarts, valuesForQuickstartContext]);
2182
- React__namespace.useEffect(() => {
2183
- if (loading !== valuesForQuickstartContext.loading) {
2184
- valuesForQuickstartContext.setLoading(loading);
2164
+ const QuickStartDrawerContent = (_a) => {
2165
+ var { quickStarts = [], appendTo, fullWidth, handleDrawerClose } = _a, props = tslib.__rest(_a, ["quickStarts", "appendTo", "fullWidth", "handleDrawerClose"]);
2166
+ const { activeQuickStartID, allQuickStarts = [], activeQuickStartState, } = React__namespace.useContext(QuickStartContext);
2167
+ const combinedQuickStarts = allQuickStarts.concat(quickStarts);
2168
+ const handleClose = () => {
2169
+ handleDrawerClose && handleDrawerClose(activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.status);
2170
+ };
2171
+ const fullWidthPanelStyle = fullWidth
2172
+ ? {
2173
+ style: {
2174
+ flex: 1,
2175
+ },
2185
2176
  }
2186
- }, [loading, valuesForQuickstartContext]);
2187
- const drawerProps = Object.assign({ appendTo,
2188
- fullWidth,
2189
- onCloseInProgress,
2190
- onCloseNotInProgress }, props);
2191
- return (React__namespace.createElement(QuickStartContext.Provider, { value: valuesForQuickstartContext },
2192
- React__namespace.createElement(QuickStartDrawer, Object.assign({}, drawerProps), children)));
2177
+ : {};
2178
+ return (React__namespace.createElement(QuickStartPanelContent, Object.assign({ quickStarts: combinedQuickStarts, handleClose: handleClose, activeQuickStartID: activeQuickStartID, appendTo: appendTo, isResizable: !fullWidth }, fullWidthPanelStyle, props)));
2193
2179
  };
2180
+
2194
2181
  const QuickStartDrawer = (_a) => {
2195
2182
  var { quickStarts = [], children, appendTo, fullWidth, onCloseInProgress, onCloseNotInProgress } = _a, props = tslib.__rest(_a, ["quickStarts", "children", "appendTo", "fullWidth", "onCloseInProgress", "onCloseNotInProgress"]);
2196
- const { activeQuickStartID, setActiveQuickStart, allQuickStarts = [], activeQuickStartState, allQuickStartStates, setAllQuickStartStates, } = React__namespace.useContext(QuickStartContext);
2183
+ const { activeQuickStartID, setActiveQuickStart, allQuickStarts = [], allQuickStartStates, setAllQuickStartStates, } = React__namespace.useContext(QuickStartContext);
2197
2184
  const combinedQuickStarts = allQuickStarts.concat(quickStarts);
2198
2185
  React__namespace.useEffect(() => {
2199
2186
  const params = new URLSearchParams(window.location.search);
@@ -2215,9 +2202,8 @@ const QuickStartDrawer = (_a) => {
2215
2202
  }
2216
2203
  }, [activeQuickStartID, allQuickStartStates, setAllQuickStartStates]);
2217
2204
  const [modalOpen, setModalOpen] = React__namespace.useState(false);
2218
- const activeQuickStartStatus = activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.status;
2219
2205
  const onClose = () => setActiveQuickStart('');
2220
- const handleClose = () => {
2206
+ const handleClose = (activeQuickStartStatus) => {
2221
2207
  if (activeQuickStartStatus === exports.QuickStartStatus.IN_PROGRESS) {
2222
2208
  if (onCloseInProgress) {
2223
2209
  onCloseInProgress();
@@ -2238,13 +2224,6 @@ const QuickStartDrawer = (_a) => {
2238
2224
  onClose();
2239
2225
  };
2240
2226
  const onModalCancel = () => setModalOpen(false);
2241
- const fullWidthPanelStyle = fullWidth
2242
- ? {
2243
- style: {
2244
- flex: 1,
2245
- },
2246
- }
2247
- : {};
2248
2227
  const fullWidthBodyStyle = fullWidth
2249
2228
  ? {
2250
2229
  style: {
@@ -2252,13 +2231,43 @@ const QuickStartDrawer = (_a) => {
2252
2231
  },
2253
2232
  }
2254
2233
  : {};
2255
- const panelContent = (React__namespace.createElement(QuickStartPanelContent, Object.assign({ quickStarts: combinedQuickStarts, handleClose: handleClose, activeQuickStartID: activeQuickStartID, appendTo: appendTo, isResizable: !fullWidth }, fullWidthPanelStyle)));
2256
2234
  return (React__namespace.createElement(React__namespace.Fragment, null,
2257
- React__namespace.createElement(reactCore.Drawer, Object.assign({ isExpanded: !!activeQuickStartID, isInline: true }, props), children ? (React__namespace.createElement(reactCore.DrawerContent, Object.assign({ panelContent: panelContent }, fullWidthBodyStyle),
2258
- React__namespace.createElement(reactCore.DrawerContentBody, null, children))) : (React__namespace.createElement("div", null, panelContent))),
2235
+ React__namespace.createElement(reactCore.Drawer, Object.assign({ isExpanded: !!activeQuickStartID, isInline: true }, props),
2236
+ React__namespace.createElement(reactCore.DrawerContent, Object.assign({ panelContent: React__namespace.createElement(QuickStartDrawerContent, { quickStarts: combinedQuickStarts, handleDrawerClose: handleClose, appendTo: appendTo, fullWidth: fullWidth }) }, fullWidthBodyStyle),
2237
+ React__namespace.createElement(reactCore.DrawerContentBody, null, children))),
2259
2238
  React__namespace.createElement(QuickStartCloseModal, { isOpen: modalOpen, onConfirm: onModalConfirm, onCancel: onModalCancel })));
2260
2239
  };
2261
2240
 
2241
+ const QuickStartContainer = (_a) => {
2242
+ var { quickStarts, children, activeQuickStartID, allQuickStartStates, setActiveQuickStartID, setAllQuickStartStates, appendTo, fullWidth, onCloseInProgress, onCloseNotInProgress, resourceBundle, showCardFooters, useLegacyHeaderColors, language, loading = false, useQueryParams = true, markdown, contextProps, alwaysShowTaskReview = true, isManagedDrawer = true } = _a, props = tslib.__rest(_a, ["quickStarts", "children", "activeQuickStartID", "allQuickStartStates", "setActiveQuickStartID", "setAllQuickStartStates", "appendTo", "fullWidth", "onCloseInProgress", "onCloseNotInProgress", "resourceBundle", "showCardFooters", "useLegacyHeaderColors", "language", "loading", "useQueryParams", "markdown", "contextProps", "alwaysShowTaskReview", "isManagedDrawer"]);
2243
+ const valuesForQuickstartContext = useValuesForQuickStartContext(Object.assign({ allQuickStarts: quickStarts, activeQuickStartID,
2244
+ setActiveQuickStartID,
2245
+ allQuickStartStates,
2246
+ setAllQuickStartStates, footer: {
2247
+ show: showCardFooters,
2248
+ }, useLegacyHeaderColors,
2249
+ language, resourceBundle: Object.assign({}, resourceBundle), loading,
2250
+ useQueryParams,
2251
+ markdown,
2252
+ alwaysShowTaskReview }, contextProps));
2253
+ React__namespace.useEffect(() => {
2254
+ if (quickStarts &&
2255
+ JSON.stringify(quickStarts) !== JSON.stringify(valuesForQuickstartContext.allQuickStarts)) {
2256
+ valuesForQuickstartContext.setAllQuickStarts(quickStarts);
2257
+ }
2258
+ }, [quickStarts, valuesForQuickstartContext]);
2259
+ React__namespace.useEffect(() => {
2260
+ if (loading !== valuesForQuickstartContext.loading) {
2261
+ valuesForQuickstartContext.setLoading(loading);
2262
+ }
2263
+ }, [loading, valuesForQuickstartContext]);
2264
+ const drawerProps = Object.assign({ appendTo,
2265
+ fullWidth,
2266
+ onCloseInProgress,
2267
+ onCloseNotInProgress }, props);
2268
+ return (React__namespace.createElement(QuickStartContext.Provider, { value: valuesForQuickstartContext }, isManagedDrawer ? (React__namespace.createElement(QuickStartDrawer, Object.assign({}, drawerProps), children)) : (children)));
2269
+ };
2270
+
2262
2271
  const HelpTopicContextDefaults = {
2263
2272
  helpTopics: [],
2264
2273
  setHelpTopics: () => { },
@@ -2532,6 +2541,7 @@ exports.QuickStartContext = QuickStartContext;
2532
2541
  exports.QuickStartContextDefaults = QuickStartContextDefaults;
2533
2542
  exports.QuickStartContextProvider = QuickStartContextProvider;
2534
2543
  exports.QuickStartDrawer = QuickStartDrawer;
2544
+ exports.QuickStartDrawerContent = QuickStartDrawerContent;
2535
2545
  exports.QuickStartPanelContent = QuickStartPanelContent;
2536
2546
  exports.QuickStartTile = QuickStartTile;
2537
2547
  exports.QuickStartTileDescription = QuickStartTileDescription;