@stoplight/elements-core 7.7.2 → 7.7.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/index.esm.js +13 -7
- package/index.js +13 -7
- package/index.mjs +13 -7
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1908,10 +1908,13 @@ const TryIt = ({ httpOperation, mockUrl, onRequestChange, requestBodyIndex, embe
|
|
|
1908
1908
|
if (response) {
|
|
1909
1909
|
const contentType = response.headers.get('Content-Type');
|
|
1910
1910
|
const type = contentType ? getResponseType(contentType) : undefined;
|
|
1911
|
+
const bodyText = type !== 'image' ? yield response.text() : undefined;
|
|
1912
|
+
const blob = type === 'image' ? yield response.blob() : undefined;
|
|
1913
|
+
setResponse(undefined);
|
|
1911
1914
|
setResponse({
|
|
1912
1915
|
status: response.status,
|
|
1913
|
-
bodyText
|
|
1914
|
-
blob
|
|
1916
|
+
bodyText,
|
|
1917
|
+
blob,
|
|
1915
1918
|
contentType,
|
|
1916
1919
|
});
|
|
1917
1920
|
}
|
|
@@ -2108,9 +2111,9 @@ const CustomLinkHeading = React.memo(function LinkHeading(_a) {
|
|
|
2108
2111
|
});
|
|
2109
2112
|
|
|
2110
2113
|
const SectionTitle = ({ title, id, size = 2, children }) => {
|
|
2111
|
-
return (React.createElement(
|
|
2112
|
-
React.createElement(Box, { as: LinkHeading, size: size, "aria-label": title, id: id || slugify(title) }, title),
|
|
2113
|
-
children));
|
|
2114
|
+
return (React.createElement(Flex, { flexWrap: true },
|
|
2115
|
+
React.createElement(Box, { py: 1, pr: 6, as: LinkHeading, size: size, "aria-label": title, id: id || slugify(title) }, title),
|
|
2116
|
+
React.createElement(Box, { alignSelf: 'center', py: 1 }, children)));
|
|
2114
2117
|
};
|
|
2115
2118
|
const SectionSubtitle = props => {
|
|
2116
2119
|
return React.createElement(SectionTitle, Object.assign({}, props, { size: 3 }));
|
|
@@ -2525,14 +2528,17 @@ const ModelComponent = ({ data: unresolvedData, className, nodeTitle, layoutOpti
|
|
|
2525
2528
|
const { ref: layoutRef, isCompact } = useIsCompact(layoutOptions);
|
|
2526
2529
|
const nodeId = (_a = data === null || data === void 0 ? void 0 : data['x-stoplight']) === null || _a === void 0 ? void 0 : _a.id;
|
|
2527
2530
|
const title = (_b = data.title) !== null && _b !== void 0 ? _b : nodeTitle;
|
|
2531
|
+
const isDeprecated = !!data['deprecated'];
|
|
2528
2532
|
const isInternal = !!data['x-internal'];
|
|
2529
2533
|
const shouldDisplayHeader = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.noHeading) && (title !== undefined || (exportProps && !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideExport)));
|
|
2530
2534
|
const titleChanged = nodeHasChanged === null || nodeHasChanged === void 0 ? void 0 : nodeHasChanged({ nodeId, attr: ['title', 'internal'] });
|
|
2531
|
-
const header = (shouldDisplayHeader || isInternal) && (React.createElement(Flex, { justifyContent: "between", alignItems: "center" },
|
|
2535
|
+
const header = (shouldDisplayHeader || isInternal || isDeprecated) && (React.createElement(Flex, { justifyContent: "between", alignItems: "center" },
|
|
2532
2536
|
React.createElement(Box, { pos: "relative" },
|
|
2533
2537
|
React.createElement(HStack, { spacing: 5 },
|
|
2534
2538
|
title && (React.createElement(Heading, { size: 1, fontWeight: "semibold" }, title)),
|
|
2535
|
-
React.createElement(HStack, { spacing: 2 },
|
|
2539
|
+
React.createElement(HStack, { spacing: 2 },
|
|
2540
|
+
isDeprecated && React.createElement(DeprecatedBadge, null),
|
|
2541
|
+
isInternal && React.createElement(InternalBadge, null))),
|
|
2536
2542
|
React.createElement(NodeAnnotation, { change: titleChanged })),
|
|
2537
2543
|
exportProps && !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideExport) && React.createElement(ExportButton, Object.assign({}, exportProps))));
|
|
2538
2544
|
const modelExamples = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideModelExamples) && React.createElement(ModelExamples, { data: data, isCollapsible: isCompact });
|
package/index.js
CHANGED
|
@@ -1962,10 +1962,13 @@ const TryIt = ({ httpOperation, mockUrl, onRequestChange, requestBodyIndex, embe
|
|
|
1962
1962
|
if (response) {
|
|
1963
1963
|
const contentType = response.headers.get('Content-Type');
|
|
1964
1964
|
const type = contentType ? getResponseType(contentType) : undefined;
|
|
1965
|
+
const bodyText = type !== 'image' ? yield response.text() : undefined;
|
|
1966
|
+
const blob = type === 'image' ? yield response.blob() : undefined;
|
|
1967
|
+
setResponse(undefined);
|
|
1965
1968
|
setResponse({
|
|
1966
1969
|
status: response.status,
|
|
1967
|
-
bodyText
|
|
1968
|
-
blob
|
|
1970
|
+
bodyText,
|
|
1971
|
+
blob,
|
|
1969
1972
|
contentType,
|
|
1970
1973
|
});
|
|
1971
1974
|
}
|
|
@@ -2162,9 +2165,9 @@ const CustomLinkHeading = React__namespace.memo(function LinkHeading(_a) {
|
|
|
2162
2165
|
});
|
|
2163
2166
|
|
|
2164
2167
|
const SectionTitle = ({ title, id, size = 2, children }) => {
|
|
2165
|
-
return (React__namespace.createElement(mosaic.
|
|
2166
|
-
React__namespace.createElement(mosaic.Box, { as: LinkHeading, size: size, "aria-label": title, id: id || slugify(title) }, title),
|
|
2167
|
-
children));
|
|
2168
|
+
return (React__namespace.createElement(mosaic.Flex, { flexWrap: true },
|
|
2169
|
+
React__namespace.createElement(mosaic.Box, { py: 1, pr: 6, as: LinkHeading, size: size, "aria-label": title, id: id || slugify(title) }, title),
|
|
2170
|
+
React__namespace.createElement(mosaic.Box, { alignSelf: 'center', py: 1 }, children)));
|
|
2168
2171
|
};
|
|
2169
2172
|
const SectionSubtitle = props => {
|
|
2170
2173
|
return React__namespace.createElement(SectionTitle, Object.assign({}, props, { size: 3 }));
|
|
@@ -2579,14 +2582,17 @@ const ModelComponent = ({ data: unresolvedData, className, nodeTitle, layoutOpti
|
|
|
2579
2582
|
const { ref: layoutRef, isCompact } = useIsCompact(layoutOptions);
|
|
2580
2583
|
const nodeId = (_a = data === null || data === void 0 ? void 0 : data['x-stoplight']) === null || _a === void 0 ? void 0 : _a.id;
|
|
2581
2584
|
const title = (_b = data.title) !== null && _b !== void 0 ? _b : nodeTitle;
|
|
2585
|
+
const isDeprecated = !!data['deprecated'];
|
|
2582
2586
|
const isInternal = !!data['x-internal'];
|
|
2583
2587
|
const shouldDisplayHeader = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.noHeading) && (title !== undefined || (exportProps && !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideExport)));
|
|
2584
2588
|
const titleChanged = nodeHasChanged === null || nodeHasChanged === void 0 ? void 0 : nodeHasChanged({ nodeId, attr: ['title', 'internal'] });
|
|
2585
|
-
const header = (shouldDisplayHeader || isInternal) && (React__namespace.createElement(mosaic.Flex, { justifyContent: "between", alignItems: "center" },
|
|
2589
|
+
const header = (shouldDisplayHeader || isInternal || isDeprecated) && (React__namespace.createElement(mosaic.Flex, { justifyContent: "between", alignItems: "center" },
|
|
2586
2590
|
React__namespace.createElement(mosaic.Box, { pos: "relative" },
|
|
2587
2591
|
React__namespace.createElement(mosaic.HStack, { spacing: 5 },
|
|
2588
2592
|
title && (React__namespace.createElement(mosaic.Heading, { size: 1, fontWeight: "semibold" }, title)),
|
|
2589
|
-
React__namespace.createElement(mosaic.HStack, { spacing: 2 },
|
|
2593
|
+
React__namespace.createElement(mosaic.HStack, { spacing: 2 },
|
|
2594
|
+
isDeprecated && React__namespace.createElement(DeprecatedBadge, null),
|
|
2595
|
+
isInternal && React__namespace.createElement(InternalBadge, null))),
|
|
2590
2596
|
React__namespace.createElement(mosaic.NodeAnnotation, { change: titleChanged })),
|
|
2591
2597
|
exportProps && !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideExport) && React__namespace.createElement(ExportButton, Object.assign({}, exportProps))));
|
|
2592
2598
|
const modelExamples = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideModelExamples) && React__namespace.createElement(ModelExamples, { data: data, isCollapsible: isCompact });
|
package/index.mjs
CHANGED
|
@@ -1908,10 +1908,13 @@ const TryIt = ({ httpOperation, mockUrl, onRequestChange, requestBodyIndex, embe
|
|
|
1908
1908
|
if (response) {
|
|
1909
1909
|
const contentType = response.headers.get('Content-Type');
|
|
1910
1910
|
const type = contentType ? getResponseType(contentType) : undefined;
|
|
1911
|
+
const bodyText = type !== 'image' ? yield response.text() : undefined;
|
|
1912
|
+
const blob = type === 'image' ? yield response.blob() : undefined;
|
|
1913
|
+
setResponse(undefined);
|
|
1911
1914
|
setResponse({
|
|
1912
1915
|
status: response.status,
|
|
1913
|
-
bodyText
|
|
1914
|
-
blob
|
|
1916
|
+
bodyText,
|
|
1917
|
+
blob,
|
|
1915
1918
|
contentType,
|
|
1916
1919
|
});
|
|
1917
1920
|
}
|
|
@@ -2108,9 +2111,9 @@ const CustomLinkHeading = React.memo(function LinkHeading(_a) {
|
|
|
2108
2111
|
});
|
|
2109
2112
|
|
|
2110
2113
|
const SectionTitle = ({ title, id, size = 2, children }) => {
|
|
2111
|
-
return (React.createElement(
|
|
2112
|
-
React.createElement(Box, { as: LinkHeading, size: size, "aria-label": title, id: id || slugify(title) }, title),
|
|
2113
|
-
children));
|
|
2114
|
+
return (React.createElement(Flex, { flexWrap: true },
|
|
2115
|
+
React.createElement(Box, { py: 1, pr: 6, as: LinkHeading, size: size, "aria-label": title, id: id || slugify(title) }, title),
|
|
2116
|
+
React.createElement(Box, { alignSelf: 'center', py: 1 }, children)));
|
|
2114
2117
|
};
|
|
2115
2118
|
const SectionSubtitle = props => {
|
|
2116
2119
|
return React.createElement(SectionTitle, Object.assign({}, props, { size: 3 }));
|
|
@@ -2525,14 +2528,17 @@ const ModelComponent = ({ data: unresolvedData, className, nodeTitle, layoutOpti
|
|
|
2525
2528
|
const { ref: layoutRef, isCompact } = useIsCompact(layoutOptions);
|
|
2526
2529
|
const nodeId = (_a = data === null || data === void 0 ? void 0 : data['x-stoplight']) === null || _a === void 0 ? void 0 : _a.id;
|
|
2527
2530
|
const title = (_b = data.title) !== null && _b !== void 0 ? _b : nodeTitle;
|
|
2531
|
+
const isDeprecated = !!data['deprecated'];
|
|
2528
2532
|
const isInternal = !!data['x-internal'];
|
|
2529
2533
|
const shouldDisplayHeader = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.noHeading) && (title !== undefined || (exportProps && !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideExport)));
|
|
2530
2534
|
const titleChanged = nodeHasChanged === null || nodeHasChanged === void 0 ? void 0 : nodeHasChanged({ nodeId, attr: ['title', 'internal'] });
|
|
2531
|
-
const header = (shouldDisplayHeader || isInternal) && (React.createElement(Flex, { justifyContent: "between", alignItems: "center" },
|
|
2535
|
+
const header = (shouldDisplayHeader || isInternal || isDeprecated) && (React.createElement(Flex, { justifyContent: "between", alignItems: "center" },
|
|
2532
2536
|
React.createElement(Box, { pos: "relative" },
|
|
2533
2537
|
React.createElement(HStack, { spacing: 5 },
|
|
2534
2538
|
title && (React.createElement(Heading, { size: 1, fontWeight: "semibold" }, title)),
|
|
2535
|
-
React.createElement(HStack, { spacing: 2 },
|
|
2539
|
+
React.createElement(HStack, { spacing: 2 },
|
|
2540
|
+
isDeprecated && React.createElement(DeprecatedBadge, null),
|
|
2541
|
+
isInternal && React.createElement(InternalBadge, null))),
|
|
2536
2542
|
React.createElement(NodeAnnotation, { change: titleChanged })),
|
|
2537
2543
|
exportProps && !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideExport) && React.createElement(ExportButton, Object.assign({}, exportProps))));
|
|
2538
2544
|
const modelExamples = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideModelExamples) && React.createElement(ModelExamples, { data: data, isCollapsible: isCompact });
|