@stoplight/elements-dev-portal 1.16.4 → 1.16.7

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 CHANGED
@@ -249,7 +249,7 @@ const UpgradeToStarter = () => (React__default.createElement(Flex, { as: "a", hr
249
249
  React__default.createElement(Icon, { icon: ['fas', 'exclamation-triangle'], size: "4x" }),
250
250
  React__default.createElement(Box, { pt: 3 }, "Please upgrade your Stoplight Workspace to the Starter Plan to use Elements Dev Portal in production.")));
251
251
 
252
- const appVersion = '1.16.4';
252
+ const appVersion = '1.16.7';
253
253
 
254
254
  class ResponseError extends Error {
255
255
  constructor(message, responseCode) {
@@ -325,7 +325,8 @@ function useGetTableOfContents({ projectId, branchSlug }) {
325
325
  }
326
326
 
327
327
  const StoplightProjectImpl = ({ projectId, hideTryIt, hideMocking, hideExport, collapseTableOfContents = false, tryItCredentialsPolicy, tryItCorsProxy, }) => {
328
- const { branchSlug = '', nodeSlug = '' } = useParams();
328
+ const { branchSlug: encodedBranchSlug = '', nodeSlug = '' } = useParams();
329
+ const branchSlug = decodeURIComponent(encodedBranchSlug);
329
330
  const history = useHistory();
330
331
  const { data: tableOfContents, isFetched: isTocFetched } = useGetTableOfContents({ projectId, branchSlug });
331
332
  const { data: branches } = useGetBranches({ projectId });
@@ -376,7 +377,10 @@ const StoplightProjectImpl = ({ projectId, hideTryIt, hideMocking, hideExport, c
376
377
  }
377
378
  };
378
379
  return (React.createElement(SidebarLayout, { ref: container, sidebar: React.createElement(React.Fragment, null,
379
- branches && branches.length > 1 ? (React.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches, onChange: branch => history.push(branch.is_default ? `/${nodeSlug}` : `/branches/${branch.slug}/${nodeSlug}`) })) : null,
380
+ branches && branches.length > 1 ? (React.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches, onChange: branch => {
381
+ const encodedBranchSlug = encodeURIComponent(branch.slug);
382
+ history.push(branch.is_default ? `/${nodeSlug}` : `/branches/${encodedBranchSlug}/${nodeSlug}`);
383
+ } })) : null,
380
384
  tableOfContents ? (React.createElement(TableOfContents, { activeId: (node === null || node === void 0 ? void 0 : node.id) || (nodeSlug === null || nodeSlug === void 0 ? void 0 : nodeSlug.split('-')[0]) || '', tableOfContents: tableOfContents, Link: Link, collapseTableOfContents: collapseTableOfContents, onLinkClick: handleTocClick })) : null) }, elem));
381
385
  };
382
386
  const StoplightProjectRouter = (_a) => {
package/index.js CHANGED
@@ -276,7 +276,7 @@ const UpgradeToStarter = () => (React__default["default"].createElement(mosaic.F
276
276
  React__default["default"].createElement(mosaic.Icon, { icon: ['fas', 'exclamation-triangle'], size: "4x" }),
277
277
  React__default["default"].createElement(mosaic.Box, { pt: 3 }, "Please upgrade your Stoplight Workspace to the Starter Plan to use Elements Dev Portal in production.")));
278
278
 
279
- const appVersion = '1.16.4';
279
+ const appVersion = '1.16.7';
280
280
 
281
281
  class ResponseError extends Error {
282
282
  constructor(message, responseCode) {
@@ -352,7 +352,8 @@ function useGetTableOfContents({ projectId, branchSlug }) {
352
352
  }
353
353
 
354
354
  const StoplightProjectImpl = ({ projectId, hideTryIt, hideMocking, hideExport, collapseTableOfContents = false, tryItCredentialsPolicy, tryItCorsProxy, }) => {
355
- const { branchSlug = '', nodeSlug = '' } = reactRouterDom.useParams();
355
+ const { branchSlug: encodedBranchSlug = '', nodeSlug = '' } = reactRouterDom.useParams();
356
+ const branchSlug = decodeURIComponent(encodedBranchSlug);
356
357
  const history = reactRouterDom.useHistory();
357
358
  const { data: tableOfContents, isFetched: isTocFetched } = useGetTableOfContents({ projectId, branchSlug });
358
359
  const { data: branches } = useGetBranches({ projectId });
@@ -403,7 +404,10 @@ const StoplightProjectImpl = ({ projectId, hideTryIt, hideMocking, hideExport, c
403
404
  }
404
405
  };
405
406
  return (React__namespace.createElement(elementsCore.SidebarLayout, { ref: container, sidebar: React__namespace.createElement(React__namespace.Fragment, null,
406
- branches && branches.length > 1 ? (React__namespace.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches, onChange: branch => history.push(branch.is_default ? `/${nodeSlug}` : `/branches/${branch.slug}/${nodeSlug}`) })) : null,
407
+ branches && branches.length > 1 ? (React__namespace.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches, onChange: branch => {
408
+ const encodedBranchSlug = encodeURIComponent(branch.slug);
409
+ history.push(branch.is_default ? `/${nodeSlug}` : `/branches/${encodedBranchSlug}/${nodeSlug}`);
410
+ } })) : null,
407
411
  tableOfContents ? (React__namespace.createElement(TableOfContents, { activeId: (node === null || node === void 0 ? void 0 : node.id) || (nodeSlug === null || nodeSlug === void 0 ? void 0 : nodeSlug.split('-')[0]) || '', tableOfContents: tableOfContents, Link: reactRouterDom.Link, collapseTableOfContents: collapseTableOfContents, onLinkClick: handleTocClick })) : null) }, elem));
408
412
  };
409
413
  const StoplightProjectRouter = (_a) => {
package/index.mjs CHANGED
@@ -249,7 +249,7 @@ const UpgradeToStarter = () => (React__default.createElement(Flex, { as: "a", hr
249
249
  React__default.createElement(Icon, { icon: ['fas', 'exclamation-triangle'], size: "4x" }),
250
250
  React__default.createElement(Box, { pt: 3 }, "Please upgrade your Stoplight Workspace to the Starter Plan to use Elements Dev Portal in production.")));
251
251
 
252
- const appVersion = '1.16.4';
252
+ const appVersion = '1.16.7';
253
253
 
254
254
  class ResponseError extends Error {
255
255
  constructor(message, responseCode) {
@@ -325,7 +325,8 @@ function useGetTableOfContents({ projectId, branchSlug }) {
325
325
  }
326
326
 
327
327
  const StoplightProjectImpl = ({ projectId, hideTryIt, hideMocking, hideExport, collapseTableOfContents = false, tryItCredentialsPolicy, tryItCorsProxy, }) => {
328
- const { branchSlug = '', nodeSlug = '' } = useParams();
328
+ const { branchSlug: encodedBranchSlug = '', nodeSlug = '' } = useParams();
329
+ const branchSlug = decodeURIComponent(encodedBranchSlug);
329
330
  const history = useHistory();
330
331
  const { data: tableOfContents, isFetched: isTocFetched } = useGetTableOfContents({ projectId, branchSlug });
331
332
  const { data: branches } = useGetBranches({ projectId });
@@ -376,7 +377,10 @@ const StoplightProjectImpl = ({ projectId, hideTryIt, hideMocking, hideExport, c
376
377
  }
377
378
  };
378
379
  return (React.createElement(SidebarLayout, { ref: container, sidebar: React.createElement(React.Fragment, null,
379
- branches && branches.length > 1 ? (React.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches, onChange: branch => history.push(branch.is_default ? `/${nodeSlug}` : `/branches/${branch.slug}/${nodeSlug}`) })) : null,
380
+ branches && branches.length > 1 ? (React.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches, onChange: branch => {
381
+ const encodedBranchSlug = encodeURIComponent(branch.slug);
382
+ history.push(branch.is_default ? `/${nodeSlug}` : `/branches/${encodedBranchSlug}/${nodeSlug}`);
383
+ } })) : null,
380
384
  tableOfContents ? (React.createElement(TableOfContents, { activeId: (node === null || node === void 0 ? void 0 : node.id) || (nodeSlug === null || nodeSlug === void 0 ? void 0 : nodeSlug.split('-')[0]) || '', tableOfContents: tableOfContents, Link: Link, collapseTableOfContents: collapseTableOfContents, onLinkClick: handleTocClick })) : null) }, elem));
381
385
  };
382
386
  const StoplightProjectRouter = (_a) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoplight/elements-dev-portal",
3
- "version": "1.16.4",
3
+ "version": "1.16.7",
4
4
  "description": "UI components for composing beautiful developer documentation.",
5
5
  "keywords": [],
6
6
  "main": "./index.js",
@@ -26,7 +26,7 @@
26
26
  "react-dom": ">=16.8"
27
27
  },
28
28
  "dependencies": {
29
- "@stoplight/elements-core": "~7.13.4",
29
+ "@stoplight/elements-core": "~7.13.6",
30
30
  "@stoplight/markdown-viewer": "^5.5.0",
31
31
  "@stoplight/mosaic": "^1.33.0",
32
32
  "@stoplight/path": "^1.3.2",