@stoplight/elements-core 8.3.4 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,7 @@ interface BaseDocsProps {
24
24
  tryItCorsProxy?: string;
25
25
  layoutOptions?: {
26
26
  hideTryIt?: boolean;
27
+ hideSamples?: boolean;
27
28
  hideTryItPanel?: boolean;
28
29
  noHeading?: boolean;
29
30
  showPoweredByLink?: boolean;
@@ -3,5 +3,6 @@ import { ResponseExamplesProps } from '../ResponseExamples/ResponseExamples';
3
3
  import { TryItProps } from './TryIt';
4
4
  export declare type TryItWithRequestSamplesProps = Omit<TryItProps, 'onRequestChange'> & ResponseExamplesProps & {
5
5
  hideTryIt?: boolean;
6
+ hideSamples?: boolean;
6
7
  };
7
8
  export declare const TryItWithRequestSamples: React.FC<TryItWithRequestSamplesProps>;
package/index.esm.js CHANGED
@@ -2450,14 +2450,14 @@ const ResponseExamples = ({ httpOperation, responseMediaType, responseStatusCode
2450
2450
  };
2451
2451
 
2452
2452
  const TryItWithRequestSamples = (_a) => {
2453
- var { hideTryIt } = _a, props = __rest(_a, ["hideTryIt"]);
2453
+ var { hideTryIt, hideSamples } = _a, props = __rest(_a, ["hideTryIt", "hideSamples"]);
2454
2454
  const [requestData, setRequestData] = React.useState();
2455
2455
  const customCodeSamples = extractCodeSamples(props.httpOperation);
2456
2456
  return (React.createElement(VStack, { spacing: 6 },
2457
2457
  !hideTryIt && (React.createElement(InvertTheme, null,
2458
2458
  React.createElement(Box, null,
2459
2459
  React.createElement(TryIt, Object.assign({}, props, { onRequestChange: setRequestData }))))),
2460
- requestData && React.createElement(RequestSamples, { request: requestData, customCodeSamples: customCodeSamples }),
2460
+ requestData && !hideSamples && React.createElement(RequestSamples, { request: requestData, customCodeSamples: customCodeSamples }),
2461
2461
  React.createElement(ResponseExamples, Object.assign({}, props))));
2462
2462
  };
2463
2463
 
@@ -2915,7 +2915,7 @@ const HttpOperationComponent = React.memo(({ className, data: unresolvedData, la
2915
2915
  throw new RangeError('unsupported node type');
2916
2916
  }
2917
2917
  const header = (React.createElement(OperationHeader, { id: data.id, method: data.method, path: path, noHeading: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.noHeading, hasBadges: hasBadges, name: prettyName, isDeprecated: isDeprecated, isInternal: isInternal, hideServerUrl: !isHttpOperation(data) }));
2918
- const tryItPanel = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryItPanel) && (React.createElement(TryItWithRequestSamples, { httpOperation: data, responseMediaType: responseMediaType, responseStatusCode: responseStatusCode, requestBodyIndex: requestBodyIndex, hideTryIt: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryIt, tryItCredentialsPolicy: tryItCredentialsPolicy, mockUrl: mocking.hideMocking ? undefined : mocking.mockUrl, corsProxy: tryItCorsProxy }));
2918
+ const tryItPanel = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryItPanel) && (React.createElement(TryItWithRequestSamples, { httpOperation: data, responseMediaType: responseMediaType, responseStatusCode: responseStatusCode, requestBodyIndex: requestBodyIndex, hideTryIt: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryIt, hideSamples: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideSamples, tryItCredentialsPolicy: tryItCredentialsPolicy, mockUrl: mocking.hideMocking ? undefined : mocking.mockUrl, corsProxy: tryItCorsProxy }));
2919
2919
  const descriptionChanged = nodeHasChanged === null || nodeHasChanged === void 0 ? void 0 : nodeHasChanged({ nodeId: data.id, attr: 'description' });
2920
2920
  const description = (React.createElement(VStack, { spacing: 10 },
2921
2921
  data.description && (React.createElement(Box, { pos: "relative" },
package/index.js CHANGED
@@ -2472,14 +2472,14 @@ const ResponseExamples = ({ httpOperation, responseMediaType, responseStatusCode
2472
2472
  };
2473
2473
 
2474
2474
  const TryItWithRequestSamples = (_a) => {
2475
- var { hideTryIt } = _a, props = tslib.__rest(_a, ["hideTryIt"]);
2475
+ var { hideTryIt, hideSamples } = _a, props = tslib.__rest(_a, ["hideTryIt", "hideSamples"]);
2476
2476
  const [requestData, setRequestData] = React__namespace.useState();
2477
2477
  const customCodeSamples = extractCodeSamples(props.httpOperation);
2478
2478
  return (React__namespace.createElement(mosaic.VStack, { spacing: 6 },
2479
2479
  !hideTryIt && (React__namespace.createElement(mosaic.InvertTheme, null,
2480
2480
  React__namespace.createElement(mosaic.Box, null,
2481
2481
  React__namespace.createElement(TryIt, Object.assign({}, props, { onRequestChange: setRequestData }))))),
2482
- requestData && React__namespace.createElement(RequestSamples, { request: requestData, customCodeSamples: customCodeSamples }),
2482
+ requestData && !hideSamples && React__namespace.createElement(RequestSamples, { request: requestData, customCodeSamples: customCodeSamples }),
2483
2483
  React__namespace.createElement(ResponseExamples, Object.assign({}, props))));
2484
2484
  };
2485
2485
 
@@ -2937,7 +2937,7 @@ const HttpOperationComponent = React__namespace.memo(({ className, data: unresol
2937
2937
  throw new RangeError('unsupported node type');
2938
2938
  }
2939
2939
  const header = (React__namespace.createElement(OperationHeader, { id: data.id, method: data.method, path: path, noHeading: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.noHeading, hasBadges: hasBadges, name: prettyName, isDeprecated: isDeprecated, isInternal: isInternal, hideServerUrl: !isHttpOperation(data) }));
2940
- const tryItPanel = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryItPanel) && (React__namespace.createElement(TryItWithRequestSamples, { httpOperation: data, responseMediaType: responseMediaType, responseStatusCode: responseStatusCode, requestBodyIndex: requestBodyIndex, hideTryIt: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryIt, tryItCredentialsPolicy: tryItCredentialsPolicy, mockUrl: mocking.hideMocking ? undefined : mocking.mockUrl, corsProxy: tryItCorsProxy }));
2940
+ const tryItPanel = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryItPanel) && (React__namespace.createElement(TryItWithRequestSamples, { httpOperation: data, responseMediaType: responseMediaType, responseStatusCode: responseStatusCode, requestBodyIndex: requestBodyIndex, hideTryIt: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryIt, hideSamples: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideSamples, tryItCredentialsPolicy: tryItCredentialsPolicy, mockUrl: mocking.hideMocking ? undefined : mocking.mockUrl, corsProxy: tryItCorsProxy }));
2941
2941
  const descriptionChanged = nodeHasChanged === null || nodeHasChanged === void 0 ? void 0 : nodeHasChanged({ nodeId: data.id, attr: 'description' });
2942
2942
  const description = (React__namespace.createElement(mosaic.VStack, { spacing: 10 },
2943
2943
  data.description && (React__namespace.createElement(mosaic.Box, { pos: "relative" },
package/index.mjs CHANGED
@@ -2450,14 +2450,14 @@ const ResponseExamples = ({ httpOperation, responseMediaType, responseStatusCode
2450
2450
  };
2451
2451
 
2452
2452
  const TryItWithRequestSamples = (_a) => {
2453
- var { hideTryIt } = _a, props = __rest(_a, ["hideTryIt"]);
2453
+ var { hideTryIt, hideSamples } = _a, props = __rest(_a, ["hideTryIt", "hideSamples"]);
2454
2454
  const [requestData, setRequestData] = React.useState();
2455
2455
  const customCodeSamples = extractCodeSamples(props.httpOperation);
2456
2456
  return (React.createElement(VStack, { spacing: 6 },
2457
2457
  !hideTryIt && (React.createElement(InvertTheme, null,
2458
2458
  React.createElement(Box, null,
2459
2459
  React.createElement(TryIt, Object.assign({}, props, { onRequestChange: setRequestData }))))),
2460
- requestData && React.createElement(RequestSamples, { request: requestData, customCodeSamples: customCodeSamples }),
2460
+ requestData && !hideSamples && React.createElement(RequestSamples, { request: requestData, customCodeSamples: customCodeSamples }),
2461
2461
  React.createElement(ResponseExamples, Object.assign({}, props))));
2462
2462
  };
2463
2463
 
@@ -2915,7 +2915,7 @@ const HttpOperationComponent = React.memo(({ className, data: unresolvedData, la
2915
2915
  throw new RangeError('unsupported node type');
2916
2916
  }
2917
2917
  const header = (React.createElement(OperationHeader, { id: data.id, method: data.method, path: path, noHeading: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.noHeading, hasBadges: hasBadges, name: prettyName, isDeprecated: isDeprecated, isInternal: isInternal, hideServerUrl: !isHttpOperation(data) }));
2918
- const tryItPanel = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryItPanel) && (React.createElement(TryItWithRequestSamples, { httpOperation: data, responseMediaType: responseMediaType, responseStatusCode: responseStatusCode, requestBodyIndex: requestBodyIndex, hideTryIt: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryIt, tryItCredentialsPolicy: tryItCredentialsPolicy, mockUrl: mocking.hideMocking ? undefined : mocking.mockUrl, corsProxy: tryItCorsProxy }));
2918
+ const tryItPanel = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryItPanel) && (React.createElement(TryItWithRequestSamples, { httpOperation: data, responseMediaType: responseMediaType, responseStatusCode: responseStatusCode, requestBodyIndex: requestBodyIndex, hideTryIt: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideTryIt, hideSamples: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideSamples, tryItCredentialsPolicy: tryItCredentialsPolicy, mockUrl: mocking.hideMocking ? undefined : mocking.mockUrl, corsProxy: tryItCorsProxy }));
2919
2919
  const descriptionChanged = nodeHasChanged === null || nodeHasChanged === void 0 ? void 0 : nodeHasChanged({ nodeId: data.id, attr: 'description' });
2920
2920
  const description = (React.createElement(VStack, { spacing: 10 },
2921
2921
  data.description && (React.createElement(Box, { pos: "relative" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoplight/elements-core",
3
- "version": "8.3.4",
3
+ "version": "8.4.0",
4
4
  "main": "./index.js",
5
5
  "sideEffects": [
6
6
  "web-components.min.js",
@@ -30,8 +30,8 @@
30
30
  "@stoplight/json-schema-sampler": "0.3.0",
31
31
  "@stoplight/json-schema-tree": "^4.0.0",
32
32
  "@stoplight/json-schema-viewer": "4.16.1",
33
- "@stoplight/markdown-viewer": "^5.7.0",
34
- "@stoplight/mosaic": "^1.53.1",
33
+ "@stoplight/markdown-viewer": "^5.7.1",
34
+ "@stoplight/mosaic": "^1.53.3",
35
35
  "@stoplight/mosaic-code-editor": "^1.53.1",
36
36
  "@stoplight/mosaic-code-viewer": "^1.53.1",
37
37
  "@stoplight/path": "^1.3.2",