@stoplight/elements-core 7.5.2 → 7.5.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/components/Docs/Article/Article.stories.d.ts +1 -0
- package/index.esm.js +18 -16
- package/index.js +18 -16
- package/index.mjs +18 -16
- package/package.json +1 -1
|
@@ -2,3 +2,4 @@ declare const meta: import("@storybook/react").Meta<import("..").DocsComponentPr
|
|
|
2
2
|
export default meta;
|
|
3
3
|
export declare const Basic: import("@storybook/react").Story<import("..").DocsComponentProps<string | import("@stoplight/markdown/ast-types/mdast").Root> & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
4
4
|
export declare const KitchenSink: import("@storybook/react").Story<import("..").DocsComponentProps<string | import("@stoplight/markdown/ast-types/mdast").Root> & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
5
|
+
export declare const MultipleTryIts: import("@storybook/react").Story<import("..").DocsComponentProps<string | import("@stoplight/markdown/ast-types/mdast").Root> & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
package/index.esm.js
CHANGED
|
@@ -477,7 +477,8 @@ const getServerUrlWithDefaultValues = (server) => {
|
|
|
477
477
|
if (url.is('relative') && typeof window !== 'undefined') {
|
|
478
478
|
url = url.absoluteTo(window.location.origin);
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
const stringifiedUrl = url.toString();
|
|
481
|
+
return stringifiedUrl.endsWith('/') ? stringifiedUrl.slice(0, -1) : stringifiedUrl;
|
|
481
482
|
};
|
|
482
483
|
|
|
483
484
|
const persistAtom = (key, atomInstance) => {
|
|
@@ -2392,6 +2393,20 @@ const Logo = ({ logo }) => {
|
|
|
2392
2393
|
React.createElement("img", { src: logo.url, height: "30px", width: "30px", alt: logo.altText }))) : (React.createElement("img", { src: logo.url, height: "30px", width: "30px", alt: logo.altText }))));
|
|
2393
2394
|
};
|
|
2394
2395
|
|
|
2396
|
+
function getDisplayName(WrappedComponent) {
|
|
2397
|
+
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
const PersistenceContextProvider = Provider;
|
|
2401
|
+
function withPersistenceBoundary(WrappedComponent) {
|
|
2402
|
+
const WithPersistenceBoundary = props => {
|
|
2403
|
+
return (React.createElement(PersistenceContextProvider, null,
|
|
2404
|
+
React.createElement(WrappedComponent, Object.assign({}, props))));
|
|
2405
|
+
};
|
|
2406
|
+
WithPersistenceBoundary.displayName = `withPersistenceBoundary(${getDisplayName(WrappedComponent)})`;
|
|
2407
|
+
return WithPersistenceBoundary;
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2395
2410
|
function useParsedValue(value) {
|
|
2396
2411
|
return React.useMemo(() => {
|
|
2397
2412
|
let parsedValue = value;
|
|
@@ -2436,7 +2451,8 @@ const CodeComponent = props => {
|
|
|
2436
2451
|
if (!isObject(parsedValue) || (!isPartialHttpRequest(parsedValue) && !isHttpOperation(parsedValue))) {
|
|
2437
2452
|
return null;
|
|
2438
2453
|
}
|
|
2439
|
-
return (React__default.createElement(
|
|
2454
|
+
return (React__default.createElement(PersistenceContextProvider, null,
|
|
2455
|
+
React__default.createElement(TryIt, { httpOperation: isHttpOperation(parsedValue) ? parsedValue : parseHttpRequest(parsedValue), embeddedInMd: true })));
|
|
2440
2456
|
}
|
|
2441
2457
|
const DefaultCode = DefaultSMDComponents.code;
|
|
2442
2458
|
return React__default.createElement(DefaultCode, Object.assign({}, props));
|
|
@@ -2656,20 +2672,6 @@ const NonIdealState = ({ description, icon, title }) => {
|
|
|
2656
2672
|
React.createElement(Text, null, description)));
|
|
2657
2673
|
};
|
|
2658
2674
|
|
|
2659
|
-
function getDisplayName(WrappedComponent) {
|
|
2660
|
-
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
2661
|
-
}
|
|
2662
|
-
|
|
2663
|
-
const PersistenceContextProvider = Provider;
|
|
2664
|
-
function withPersistenceBoundary(WrappedComponent) {
|
|
2665
|
-
const WithPersistenceBoundary = props => {
|
|
2666
|
-
return (React.createElement(PersistenceContextProvider, null,
|
|
2667
|
-
React.createElement(WrappedComponent, Object.assign({}, props))));
|
|
2668
|
-
};
|
|
2669
|
-
WithPersistenceBoundary.displayName = `withPersistenceBoundary(${getDisplayName(WrappedComponent)})`;
|
|
2670
|
-
return WithPersistenceBoundary;
|
|
2671
|
-
}
|
|
2672
|
-
|
|
2673
2675
|
function withMosaicProvider(WrappedComponent) {
|
|
2674
2676
|
const WithMosaicProvider = (props) => {
|
|
2675
2677
|
try {
|
package/index.js
CHANGED
|
@@ -532,7 +532,8 @@ const getServerUrlWithDefaultValues = (server) => {
|
|
|
532
532
|
if (url.is('relative') && typeof window !== 'undefined') {
|
|
533
533
|
url = url.absoluteTo(window.location.origin);
|
|
534
534
|
}
|
|
535
|
-
|
|
535
|
+
const stringifiedUrl = url.toString();
|
|
536
|
+
return stringifiedUrl.endsWith('/') ? stringifiedUrl.slice(0, -1) : stringifiedUrl;
|
|
536
537
|
};
|
|
537
538
|
|
|
538
539
|
const persistAtom = (key, atomInstance) => {
|
|
@@ -2447,6 +2448,20 @@ const Logo = ({ logo }) => {
|
|
|
2447
2448
|
React__namespace.createElement("img", { src: logo.url, height: "30px", width: "30px", alt: logo.altText }))) : (React__namespace.createElement("img", { src: logo.url, height: "30px", width: "30px", alt: logo.altText }))));
|
|
2448
2449
|
};
|
|
2449
2450
|
|
|
2451
|
+
function getDisplayName(WrappedComponent) {
|
|
2452
|
+
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
const PersistenceContextProvider = jotai.Provider;
|
|
2456
|
+
function withPersistenceBoundary(WrappedComponent) {
|
|
2457
|
+
const WithPersistenceBoundary = props => {
|
|
2458
|
+
return (React__namespace.createElement(PersistenceContextProvider, null,
|
|
2459
|
+
React__namespace.createElement(WrappedComponent, Object.assign({}, props))));
|
|
2460
|
+
};
|
|
2461
|
+
WithPersistenceBoundary.displayName = `withPersistenceBoundary(${getDisplayName(WrappedComponent)})`;
|
|
2462
|
+
return WithPersistenceBoundary;
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2450
2465
|
function useParsedValue(value) {
|
|
2451
2466
|
return React__namespace.useMemo(() => {
|
|
2452
2467
|
let parsedValue = value;
|
|
@@ -2491,7 +2506,8 @@ const CodeComponent = props => {
|
|
|
2491
2506
|
if (!isObject__default["default"](parsedValue) || (!isPartialHttpRequest(parsedValue) && !isHttpOperation(parsedValue))) {
|
|
2492
2507
|
return null;
|
|
2493
2508
|
}
|
|
2494
|
-
return (React__default["default"].createElement(
|
|
2509
|
+
return (React__default["default"].createElement(PersistenceContextProvider, null,
|
|
2510
|
+
React__default["default"].createElement(TryIt, { httpOperation: isHttpOperation(parsedValue) ? parsedValue : parseHttpRequest(parsedValue), embeddedInMd: true })));
|
|
2495
2511
|
}
|
|
2496
2512
|
const DefaultCode = markdownViewer.DefaultSMDComponents.code;
|
|
2497
2513
|
return React__default["default"].createElement(DefaultCode, Object.assign({}, props));
|
|
@@ -2711,20 +2727,6 @@ const NonIdealState = ({ description, icon, title }) => {
|
|
|
2711
2727
|
React__namespace.createElement(mosaic.Text, null, description)));
|
|
2712
2728
|
};
|
|
2713
2729
|
|
|
2714
|
-
function getDisplayName(WrappedComponent) {
|
|
2715
|
-
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
2716
|
-
}
|
|
2717
|
-
|
|
2718
|
-
const PersistenceContextProvider = jotai.Provider;
|
|
2719
|
-
function withPersistenceBoundary(WrappedComponent) {
|
|
2720
|
-
const WithPersistenceBoundary = props => {
|
|
2721
|
-
return (React__namespace.createElement(PersistenceContextProvider, null,
|
|
2722
|
-
React__namespace.createElement(WrappedComponent, Object.assign({}, props))));
|
|
2723
|
-
};
|
|
2724
|
-
WithPersistenceBoundary.displayName = `withPersistenceBoundary(${getDisplayName(WrappedComponent)})`;
|
|
2725
|
-
return WithPersistenceBoundary;
|
|
2726
|
-
}
|
|
2727
|
-
|
|
2728
2730
|
function withMosaicProvider(WrappedComponent) {
|
|
2729
2731
|
const WithMosaicProvider = (props) => {
|
|
2730
2732
|
try {
|
package/index.mjs
CHANGED
|
@@ -477,7 +477,8 @@ const getServerUrlWithDefaultValues = (server) => {
|
|
|
477
477
|
if (url.is('relative') && typeof window !== 'undefined') {
|
|
478
478
|
url = url.absoluteTo(window.location.origin);
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
const stringifiedUrl = url.toString();
|
|
481
|
+
return stringifiedUrl.endsWith('/') ? stringifiedUrl.slice(0, -1) : stringifiedUrl;
|
|
481
482
|
};
|
|
482
483
|
|
|
483
484
|
const persistAtom = (key, atomInstance) => {
|
|
@@ -2392,6 +2393,20 @@ const Logo = ({ logo }) => {
|
|
|
2392
2393
|
React.createElement("img", { src: logo.url, height: "30px", width: "30px", alt: logo.altText }))) : (React.createElement("img", { src: logo.url, height: "30px", width: "30px", alt: logo.altText }))));
|
|
2393
2394
|
};
|
|
2394
2395
|
|
|
2396
|
+
function getDisplayName(WrappedComponent) {
|
|
2397
|
+
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
const PersistenceContextProvider = Provider;
|
|
2401
|
+
function withPersistenceBoundary(WrappedComponent) {
|
|
2402
|
+
const WithPersistenceBoundary = props => {
|
|
2403
|
+
return (React.createElement(PersistenceContextProvider, null,
|
|
2404
|
+
React.createElement(WrappedComponent, Object.assign({}, props))));
|
|
2405
|
+
};
|
|
2406
|
+
WithPersistenceBoundary.displayName = `withPersistenceBoundary(${getDisplayName(WrappedComponent)})`;
|
|
2407
|
+
return WithPersistenceBoundary;
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2395
2410
|
function useParsedValue(value) {
|
|
2396
2411
|
return React.useMemo(() => {
|
|
2397
2412
|
let parsedValue = value;
|
|
@@ -2436,7 +2451,8 @@ const CodeComponent = props => {
|
|
|
2436
2451
|
if (!isObject(parsedValue) || (!isPartialHttpRequest(parsedValue) && !isHttpOperation(parsedValue))) {
|
|
2437
2452
|
return null;
|
|
2438
2453
|
}
|
|
2439
|
-
return (React__default.createElement(
|
|
2454
|
+
return (React__default.createElement(PersistenceContextProvider, null,
|
|
2455
|
+
React__default.createElement(TryIt, { httpOperation: isHttpOperation(parsedValue) ? parsedValue : parseHttpRequest(parsedValue), embeddedInMd: true })));
|
|
2440
2456
|
}
|
|
2441
2457
|
const DefaultCode = DefaultSMDComponents.code;
|
|
2442
2458
|
return React__default.createElement(DefaultCode, Object.assign({}, props));
|
|
@@ -2656,20 +2672,6 @@ const NonIdealState = ({ description, icon, title }) => {
|
|
|
2656
2672
|
React.createElement(Text, null, description)));
|
|
2657
2673
|
};
|
|
2658
2674
|
|
|
2659
|
-
function getDisplayName(WrappedComponent) {
|
|
2660
|
-
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
2661
|
-
}
|
|
2662
|
-
|
|
2663
|
-
const PersistenceContextProvider = Provider;
|
|
2664
|
-
function withPersistenceBoundary(WrappedComponent) {
|
|
2665
|
-
const WithPersistenceBoundary = props => {
|
|
2666
|
-
return (React.createElement(PersistenceContextProvider, null,
|
|
2667
|
-
React.createElement(WrappedComponent, Object.assign({}, props))));
|
|
2668
|
-
};
|
|
2669
|
-
WithPersistenceBoundary.displayName = `withPersistenceBoundary(${getDisplayName(WrappedComponent)})`;
|
|
2670
|
-
return WithPersistenceBoundary;
|
|
2671
|
-
}
|
|
2672
|
-
|
|
2673
2675
|
function withMosaicProvider(WrappedComponent) {
|
|
2674
2676
|
const WithMosaicProvider = (props) => {
|
|
2675
2677
|
try {
|