@jpmorganchase/elemental 3.0.1 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
package/index.esm.js CHANGED
@@ -200,7 +200,7 @@ TryItContext.displayName = 'TryItContext';
200
200
  const APIWithStackedLayout = ({ serviceNode, hideTryIt, hideExport, exportProps, tryItCredentialsPolicy, tryItCorsProxy, tryItOutDefaultServer, }) => {
201
201
  const location = useLocation();
202
202
  const { groups } = computeTagGroups(serviceNode);
203
- return (React.createElement(TryItContext.Provider, { value: { hideTryIt, tryItCredentialsPolicy, corsProxy: tryItCorsProxy } },
203
+ return (React.createElement(TryItContext.Provider, { value: { hideTryIt, tryItCredentialsPolicy, corsProxy: tryItCorsProxy, tryItOutDefaultServer } },
204
204
  React.createElement(Flex, { w: "full", flexDirection: "col", m: "auto", className: "sl-max-w-4xl" },
205
205
  React.createElement(Box, { w: "full", borderB: true },
206
206
  React.createElement(Docs, { className: "sl-mx-auto", nodeData: serviceNode.data, nodeTitle: serviceNode.name, nodeType: NodeType.HttpService, location: location, layoutOptions: { showPoweredByLink: true, hideExport }, exportProps: exportProps, tryItCredentialsPolicy: tryItCredentialsPolicy, tryItOutDefaultServer: tryItOutDefaultServer })),
@@ -239,7 +239,7 @@ const Item = React.memo(({ item }) => {
239
239
  const scrollRef = React.useRef(null);
240
240
  const color = HttpMethodColors[item.data.method] || 'gray';
241
241
  const isDeprecated = !!item.data.deprecated;
242
- const { hideTryIt, tryItCredentialsPolicy, corsProxy } = React.useContext(TryItContext);
242
+ const { hideTryIt, tryItCredentialsPolicy, corsProxy, tryItOutDefaultServer } = React.useContext(TryItContext);
243
243
  const onClick = React.useCallback(() => setIsExpanded(!isExpanded), [isExpanded]);
244
244
  React.useEffect(() => {
245
245
  var _a;
@@ -263,7 +263,7 @@ const Item = React.memo(({ item }) => {
263
263
  React.createElement(TabPanel, null,
264
264
  React.createElement(ParsedDocs, { className: "sl-px-4", node: item, location: location, layoutOptions: { noHeading: true, hideTryItPanel: true } })),
265
265
  React.createElement(TabPanel, null,
266
- React.createElement(TryItWithRequestSamples, { httpOperation: item.data, tryItCredentialsPolicy: tryItCredentialsPolicy, corsProxy: corsProxy }))))))));
266
+ React.createElement(TryItWithRequestSamples, { httpOperation: item.data, tryItCredentialsPolicy: tryItCredentialsPolicy, tryItOutDefaultServer: tryItOutDefaultServer, corsProxy: corsProxy }))))))));
267
267
  });
268
268
  const Collapse = ({ isOpen, children }) => {
269
269
  if (!isOpen)
@@ -434,7 +434,8 @@ function findMapMatch(key, map) {
434
434
  if (typeof key === 'number')
435
435
  return;
436
436
  for (const entry of map) {
437
- if (!!((_a = entry.match) === null || _a === void 0 ? void 0 : _a.match(key)) || (entry.notMatch !== void 0 && !entry.notMatch.match(key))) {
437
+ const escapedKey = key.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
438
+ if (!!((_a = entry.match) === null || _a === void 0 ? void 0 : _a.match(escapedKey)) || (entry.notMatch !== void 0 && !entry.notMatch.match(escapedKey))) {
438
439
  return entry;
439
440
  }
440
441
  }
package/index.js CHANGED
@@ -233,7 +233,7 @@ TryItContext.displayName = 'TryItContext';
233
233
  const APIWithStackedLayout = ({ serviceNode, hideTryIt, hideExport, exportProps, tryItCredentialsPolicy, tryItCorsProxy, tryItOutDefaultServer, }) => {
234
234
  const location = reactRouterDom.useLocation();
235
235
  const { groups } = computeTagGroups(serviceNode);
236
- return (React__namespace.createElement(TryItContext.Provider, { value: { hideTryIt, tryItCredentialsPolicy, corsProxy: tryItCorsProxy } },
236
+ return (React__namespace.createElement(TryItContext.Provider, { value: { hideTryIt, tryItCredentialsPolicy, corsProxy: tryItCorsProxy, tryItOutDefaultServer } },
237
237
  React__namespace.createElement(mosaic.Flex, { w: "full", flexDirection: "col", m: "auto", className: "sl-max-w-4xl" },
238
238
  React__namespace.createElement(mosaic.Box, { w: "full", borderB: true },
239
239
  React__namespace.createElement(elementalCore.Docs, { className: "sl-mx-auto", nodeData: serviceNode.data, nodeTitle: serviceNode.name, nodeType: types.NodeType.HttpService, location: location, layoutOptions: { showPoweredByLink: true, hideExport }, exportProps: exportProps, tryItCredentialsPolicy: tryItCredentialsPolicy, tryItOutDefaultServer: tryItOutDefaultServer })),
@@ -272,7 +272,7 @@ const Item = React__namespace.memo(({ item }) => {
272
272
  const scrollRef = React__namespace.useRef(null);
273
273
  const color = elementalCore.HttpMethodColors[item.data.method] || 'gray';
274
274
  const isDeprecated = !!item.data.deprecated;
275
- const { hideTryIt, tryItCredentialsPolicy, corsProxy } = React__namespace.useContext(TryItContext);
275
+ const { hideTryIt, tryItCredentialsPolicy, corsProxy, tryItOutDefaultServer } = React__namespace.useContext(TryItContext);
276
276
  const onClick = React__namespace.useCallback(() => setIsExpanded(!isExpanded), [isExpanded]);
277
277
  React__namespace.useEffect(() => {
278
278
  var _a;
@@ -296,7 +296,7 @@ const Item = React__namespace.memo(({ item }) => {
296
296
  React__namespace.createElement(mosaic.TabPanel, null,
297
297
  React__namespace.createElement(elementalCore.ParsedDocs, { className: "sl-px-4", node: item, location: location, layoutOptions: { noHeading: true, hideTryItPanel: true } })),
298
298
  React__namespace.createElement(mosaic.TabPanel, null,
299
- React__namespace.createElement(elementalCore.TryItWithRequestSamples, { httpOperation: item.data, tryItCredentialsPolicy: tryItCredentialsPolicy, corsProxy: corsProxy }))))))));
299
+ React__namespace.createElement(elementalCore.TryItWithRequestSamples, { httpOperation: item.data, tryItCredentialsPolicy: tryItCredentialsPolicy, tryItOutDefaultServer: tryItOutDefaultServer, corsProxy: corsProxy }))))))));
300
300
  });
301
301
  const Collapse = ({ isOpen, children }) => {
302
302
  if (!isOpen)
@@ -467,7 +467,8 @@ function findMapMatch(key, map) {
467
467
  if (typeof key === 'number')
468
468
  return;
469
469
  for (const entry of map) {
470
- if (!!((_a = entry.match) === null || _a === void 0 ? void 0 : _a.match(key)) || (entry.notMatch !== void 0 && !entry.notMatch.match(key))) {
470
+ const escapedKey = key.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
471
+ if (!!((_a = entry.match) === null || _a === void 0 ? void 0 : _a.match(escapedKey)) || (entry.notMatch !== void 0 && !entry.notMatch.match(escapedKey))) {
471
472
  return entry;
472
473
  }
473
474
  }
package/index.mjs CHANGED
@@ -200,7 +200,7 @@ TryItContext.displayName = 'TryItContext';
200
200
  const APIWithStackedLayout = ({ serviceNode, hideTryIt, hideExport, exportProps, tryItCredentialsPolicy, tryItCorsProxy, tryItOutDefaultServer, }) => {
201
201
  const location = useLocation();
202
202
  const { groups } = computeTagGroups(serviceNode);
203
- return (React.createElement(TryItContext.Provider, { value: { hideTryIt, tryItCredentialsPolicy, corsProxy: tryItCorsProxy } },
203
+ return (React.createElement(TryItContext.Provider, { value: { hideTryIt, tryItCredentialsPolicy, corsProxy: tryItCorsProxy, tryItOutDefaultServer } },
204
204
  React.createElement(Flex, { w: "full", flexDirection: "col", m: "auto", className: "sl-max-w-4xl" },
205
205
  React.createElement(Box, { w: "full", borderB: true },
206
206
  React.createElement(Docs, { className: "sl-mx-auto", nodeData: serviceNode.data, nodeTitle: serviceNode.name, nodeType: NodeType.HttpService, location: location, layoutOptions: { showPoweredByLink: true, hideExport }, exportProps: exportProps, tryItCredentialsPolicy: tryItCredentialsPolicy, tryItOutDefaultServer: tryItOutDefaultServer })),
@@ -239,7 +239,7 @@ const Item = React.memo(({ item }) => {
239
239
  const scrollRef = React.useRef(null);
240
240
  const color = HttpMethodColors[item.data.method] || 'gray';
241
241
  const isDeprecated = !!item.data.deprecated;
242
- const { hideTryIt, tryItCredentialsPolicy, corsProxy } = React.useContext(TryItContext);
242
+ const { hideTryIt, tryItCredentialsPolicy, corsProxy, tryItOutDefaultServer } = React.useContext(TryItContext);
243
243
  const onClick = React.useCallback(() => setIsExpanded(!isExpanded), [isExpanded]);
244
244
  React.useEffect(() => {
245
245
  var _a;
@@ -263,7 +263,7 @@ const Item = React.memo(({ item }) => {
263
263
  React.createElement(TabPanel, null,
264
264
  React.createElement(ParsedDocs, { className: "sl-px-4", node: item, location: location, layoutOptions: { noHeading: true, hideTryItPanel: true } })),
265
265
  React.createElement(TabPanel, null,
266
- React.createElement(TryItWithRequestSamples, { httpOperation: item.data, tryItCredentialsPolicy: tryItCredentialsPolicy, corsProxy: corsProxy }))))))));
266
+ React.createElement(TryItWithRequestSamples, { httpOperation: item.data, tryItCredentialsPolicy: tryItCredentialsPolicy, tryItOutDefaultServer: tryItOutDefaultServer, corsProxy: corsProxy }))))))));
267
267
  });
268
268
  const Collapse = ({ isOpen, children }) => {
269
269
  if (!isOpen)
@@ -434,7 +434,8 @@ function findMapMatch(key, map) {
434
434
  if (typeof key === 'number')
435
435
  return;
436
436
  for (const entry of map) {
437
- if (!!((_a = entry.match) === null || _a === void 0 ? void 0 : _a.match(key)) || (entry.notMatch !== void 0 && !entry.notMatch.match(key))) {
437
+ const escapedKey = key.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
438
+ if (!!((_a = entry.match) === null || _a === void 0 ? void 0 : _a.match(escapedKey)) || (entry.notMatch !== void 0 && !entry.notMatch.match(escapedKey))) {
438
439
  return entry;
439
440
  }
440
441
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jpmorganchase/elemental",
3
- "version": "3.0.1",
3
+ "version": "3.1.1",
4
4
  "description": "UI components for composing beautiful developer documentation.",
5
5
  "keywords": [],
6
6
  "main": "./index.js",
@@ -26,11 +26,11 @@
26
26
  "react-dom": ">=16.8"
27
27
  },
28
28
  "dependencies": {
29
- "@jpmorganchase/elemental-core": "^1.1.1",
30
- "@stoplight/http-spec": "^5.1.4",
29
+ "@jpmorganchase/elemental-core": "^1.2.1",
30
+ "@stoplight/http-spec": "^6.0.0",
31
31
  "@stoplight/json": "^3.18.1",
32
- "@stoplight/mosaic": "^1.33.0",
33
- "@stoplight/types": "^13.7.0",
32
+ "@stoplight/mosaic": "^1.44.3",
33
+ "@stoplight/types": "^14.0.0",
34
34
  "@stoplight/yaml": "^4.2.3",
35
35
  "classnames": "^2.2.6",
36
36
  "file-saver": "^2.0.5",