@stoplight/elements-dev-portal 2.0.2 → 2.0.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/BranchSelector/BranchSelector.spec.d.ts +2 -15
- package/handlers/getBranches.d.ts +2 -2
- package/hooks/useGetBranches.d.ts +1 -1
- package/index.esm.js +10 -9
- package/index.js +9 -8
- package/index.mjs +10 -9
- package/package.json +1 -1
- package/types.d.ts +3 -1
- package/version.d.ts +1 -1
- package/web-components.min.js +1 -1
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
slug: string;
|
|
4
|
-
is_default: boolean;
|
|
5
|
-
is_published: boolean;
|
|
6
|
-
projectId: number;
|
|
7
|
-
name: string;
|
|
8
|
-
} | {
|
|
9
|
-
id: number;
|
|
10
|
-
slug: string;
|
|
11
|
-
is_default: boolean;
|
|
12
|
-
is_published: boolean;
|
|
13
|
-
projectId: number;
|
|
14
|
-
name?: undefined;
|
|
15
|
-
})[];
|
|
1
|
+
import { Branch } from '../../types';
|
|
2
|
+
export declare const branches: Branch[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Branches } from '../types';
|
|
2
2
|
export declare const getBranches: ({ projectId, platformUrl, platformAuthToken, }: {
|
|
3
3
|
projectId: string;
|
|
4
4
|
platformUrl?: string | undefined;
|
|
5
5
|
platformAuthToken?: string | undefined;
|
|
6
|
-
}) => Promise<
|
|
6
|
+
}) => Promise<Branches>;
|
package/index.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ import { withPersistenceBoundary, withQueryClientProvider, withMosaicProvider, M
|
|
|
5
5
|
import { resolve, dirname } from '@stoplight/path';
|
|
6
6
|
import { NodeType } from '@stoplight/types';
|
|
7
7
|
import flow from 'lodash/flow.js';
|
|
8
|
-
import { Link, Route, useParams, useHistory, Redirect } from 'react-router-dom';
|
|
8
|
+
import { Link, Switch, Route, useParams, useHistory, Redirect } from 'react-router-dom';
|
|
9
9
|
import { useQuery } from 'react-query';
|
|
10
10
|
|
|
11
11
|
const BranchSelector = ({ branchSlug, branches, onChange }) => {
|
|
@@ -281,7 +281,7 @@ const UpgradeToStarter = () => (React__default.createElement(Flex, { as: "a", hr
|
|
|
281
281
|
React__default.createElement(Icon, { icon: ['fas', 'exclamation-triangle'], size: "4x" }),
|
|
282
282
|
React__default.createElement(Box, { pt: 3 }, "Please upgrade your Stoplight Workspace to the Starter Plan to use Elements Dev Portal in production.")));
|
|
283
283
|
|
|
284
|
-
const appVersion = '2.0.
|
|
284
|
+
const appVersion = '2.0.3';
|
|
285
285
|
|
|
286
286
|
class ResponseError extends Error {
|
|
287
287
|
constructor(message, responseCode) {
|
|
@@ -699,7 +699,7 @@ const StoplightProjectImpl = ({ projectId, hideTryIt, hideMocking, hideExport, c
|
|
|
699
699
|
}
|
|
700
700
|
};
|
|
701
701
|
return (React.createElement(SidebarLayout, { ref: container, sidebar: React.createElement(React.Fragment, null,
|
|
702
|
-
branches && branches.length > 1 ? (React.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches, onChange: branch => {
|
|
702
|
+
branches && branches.items.length > 1 ? (React.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches.items, onChange: branch => {
|
|
703
703
|
const encodedBranchSlug = encodeURIComponent(branch.slug);
|
|
704
704
|
history.push(branch.is_default ? `/${nodeSlug}` : `/branches/${encodedBranchSlug}/${nodeSlug}`);
|
|
705
705
|
} })) : null,
|
|
@@ -711,12 +711,13 @@ const StoplightProjectRouter = (_a) => {
|
|
|
711
711
|
return (React.createElement(DevPortalProvider, { platformUrl: platformUrl },
|
|
712
712
|
React.createElement(RouterTypeContext.Provider, { value: router },
|
|
713
713
|
React.createElement(Router, Object.assign({}, routerProps, { key: basePath }),
|
|
714
|
-
React.createElement(
|
|
715
|
-
React.createElement(
|
|
716
|
-
|
|
717
|
-
React.createElement(
|
|
718
|
-
|
|
719
|
-
React.createElement(
|
|
714
|
+
React.createElement(Switch, null,
|
|
715
|
+
React.createElement(Route, { path: "/branches/:branchSlug/:nodeSlug+", exact: true },
|
|
716
|
+
React.createElement(StoplightProjectImpl, Object.assign({}, props))),
|
|
717
|
+
React.createElement(Route, { path: "/:nodeSlug+", exact: true },
|
|
718
|
+
React.createElement(StoplightProjectImpl, Object.assign({}, props))),
|
|
719
|
+
React.createElement(Route, { path: "/", exact: true },
|
|
720
|
+
React.createElement(StoplightProjectImpl, Object.assign({}, props))))))));
|
|
720
721
|
};
|
|
721
722
|
const StoplightProject = withStyles(StoplightProjectRouter);
|
|
722
723
|
|
package/index.js
CHANGED
|
@@ -308,7 +308,7 @@ const UpgradeToStarter = () => (React__default["default"].createElement(mosaic.F
|
|
|
308
308
|
React__default["default"].createElement(mosaic.Icon, { icon: ['fas', 'exclamation-triangle'], size: "4x" }),
|
|
309
309
|
React__default["default"].createElement(mosaic.Box, { pt: 3 }, "Please upgrade your Stoplight Workspace to the Starter Plan to use Elements Dev Portal in production.")));
|
|
310
310
|
|
|
311
|
-
const appVersion = '2.0.
|
|
311
|
+
const appVersion = '2.0.3';
|
|
312
312
|
|
|
313
313
|
class ResponseError extends Error {
|
|
314
314
|
constructor(message, responseCode) {
|
|
@@ -726,7 +726,7 @@ const StoplightProjectImpl = ({ projectId, hideTryIt, hideMocking, hideExport, c
|
|
|
726
726
|
}
|
|
727
727
|
};
|
|
728
728
|
return (React__namespace.createElement(elementsCore.SidebarLayout, { ref: container, sidebar: React__namespace.createElement(React__namespace.Fragment, null,
|
|
729
|
-
branches && branches.length > 1 ? (React__namespace.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches, onChange: branch => {
|
|
729
|
+
branches && branches.items.length > 1 ? (React__namespace.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches.items, onChange: branch => {
|
|
730
730
|
const encodedBranchSlug = encodeURIComponent(branch.slug);
|
|
731
731
|
history.push(branch.is_default ? `/${nodeSlug}` : `/branches/${encodedBranchSlug}/${nodeSlug}`);
|
|
732
732
|
} })) : null,
|
|
@@ -738,12 +738,13 @@ const StoplightProjectRouter = (_a) => {
|
|
|
738
738
|
return (React__namespace.createElement(DevPortalProvider, { platformUrl: platformUrl },
|
|
739
739
|
React__namespace.createElement(elementsCore.RouterTypeContext.Provider, { value: router },
|
|
740
740
|
React__namespace.createElement(Router, Object.assign({}, routerProps, { key: basePath }),
|
|
741
|
-
React__namespace.createElement(reactRouterDom.
|
|
742
|
-
React__namespace.createElement(
|
|
743
|
-
|
|
744
|
-
React__namespace.createElement(
|
|
745
|
-
|
|
746
|
-
React__namespace.createElement(
|
|
741
|
+
React__namespace.createElement(reactRouterDom.Switch, null,
|
|
742
|
+
React__namespace.createElement(reactRouterDom.Route, { path: "/branches/:branchSlug/:nodeSlug+", exact: true },
|
|
743
|
+
React__namespace.createElement(StoplightProjectImpl, Object.assign({}, props))),
|
|
744
|
+
React__namespace.createElement(reactRouterDom.Route, { path: "/:nodeSlug+", exact: true },
|
|
745
|
+
React__namespace.createElement(StoplightProjectImpl, Object.assign({}, props))),
|
|
746
|
+
React__namespace.createElement(reactRouterDom.Route, { path: "/", exact: true },
|
|
747
|
+
React__namespace.createElement(StoplightProjectImpl, Object.assign({}, props))))))));
|
|
747
748
|
};
|
|
748
749
|
const StoplightProject = elementsCore.withStyles(StoplightProjectRouter);
|
|
749
750
|
|
package/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { withPersistenceBoundary, withQueryClientProvider, withMosaicProvider, M
|
|
|
5
5
|
import { resolve, dirname } from '@stoplight/path';
|
|
6
6
|
import { NodeType } from '@stoplight/types';
|
|
7
7
|
import flow from 'lodash/flow.js';
|
|
8
|
-
import { Link, Route, useParams, useHistory, Redirect } from 'react-router-dom';
|
|
8
|
+
import { Link, Switch, Route, useParams, useHistory, Redirect } from 'react-router-dom';
|
|
9
9
|
import { useQuery } from 'react-query';
|
|
10
10
|
|
|
11
11
|
const BranchSelector = ({ branchSlug, branches, onChange }) => {
|
|
@@ -281,7 +281,7 @@ const UpgradeToStarter = () => (React__default.createElement(Flex, { as: "a", hr
|
|
|
281
281
|
React__default.createElement(Icon, { icon: ['fas', 'exclamation-triangle'], size: "4x" }),
|
|
282
282
|
React__default.createElement(Box, { pt: 3 }, "Please upgrade your Stoplight Workspace to the Starter Plan to use Elements Dev Portal in production.")));
|
|
283
283
|
|
|
284
|
-
const appVersion = '2.0.
|
|
284
|
+
const appVersion = '2.0.3';
|
|
285
285
|
|
|
286
286
|
class ResponseError extends Error {
|
|
287
287
|
constructor(message, responseCode) {
|
|
@@ -699,7 +699,7 @@ const StoplightProjectImpl = ({ projectId, hideTryIt, hideMocking, hideExport, c
|
|
|
699
699
|
}
|
|
700
700
|
};
|
|
701
701
|
return (React.createElement(SidebarLayout, { ref: container, sidebar: React.createElement(React.Fragment, null,
|
|
702
|
-
branches && branches.length > 1 ? (React.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches, onChange: branch => {
|
|
702
|
+
branches && branches.items.length > 1 ? (React.createElement(BranchSelector, { branchSlug: branchSlug, branches: branches.items, onChange: branch => {
|
|
703
703
|
const encodedBranchSlug = encodeURIComponent(branch.slug);
|
|
704
704
|
history.push(branch.is_default ? `/${nodeSlug}` : `/branches/${encodedBranchSlug}/${nodeSlug}`);
|
|
705
705
|
} })) : null,
|
|
@@ -711,12 +711,13 @@ const StoplightProjectRouter = (_a) => {
|
|
|
711
711
|
return (React.createElement(DevPortalProvider, { platformUrl: platformUrl },
|
|
712
712
|
React.createElement(RouterTypeContext.Provider, { value: router },
|
|
713
713
|
React.createElement(Router, Object.assign({}, routerProps, { key: basePath }),
|
|
714
|
-
React.createElement(
|
|
715
|
-
React.createElement(
|
|
716
|
-
|
|
717
|
-
React.createElement(
|
|
718
|
-
|
|
719
|
-
React.createElement(
|
|
714
|
+
React.createElement(Switch, null,
|
|
715
|
+
React.createElement(Route, { path: "/branches/:branchSlug/:nodeSlug+", exact: true },
|
|
716
|
+
React.createElement(StoplightProjectImpl, Object.assign({}, props))),
|
|
717
|
+
React.createElement(Route, { path: "/:nodeSlug+", exact: true },
|
|
718
|
+
React.createElement(StoplightProjectImpl, Object.assign({}, props))),
|
|
719
|
+
React.createElement(Route, { path: "/", exact: true },
|
|
720
|
+
React.createElement(StoplightProjectImpl, Object.assign({}, props))))))));
|
|
720
721
|
};
|
|
721
722
|
const StoplightProject = withStyles(StoplightProjectRouter);
|
|
722
723
|
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ export declare type Branch = {
|
|
|
4
4
|
slug: string;
|
|
5
5
|
is_default: boolean;
|
|
6
6
|
is_published: boolean;
|
|
7
|
-
projectId: number;
|
|
8
7
|
name?: string;
|
|
9
8
|
};
|
|
9
|
+
export declare type Branches = {
|
|
10
|
+
items: Branch[];
|
|
11
|
+
};
|
|
10
12
|
export declare type ProjectTableOfContents = {
|
|
11
13
|
items: TableOfContentsItem[];
|
|
12
14
|
hide_powered_by?: boolean;
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const appVersion = "2.0.
|
|
1
|
+
export declare const appVersion = "2.0.3";
|