@stoplight/elements-dev-portal 1.13.1 → 1.15.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.
- package/components/NodeContent/NodeContent.d.ts +2 -2
- package/components/Search/Search.stories.d.ts +7 -0
- package/components/TableOfContents/TableOfContents.d.ts +2 -1
- package/components/TableOfContents/TableOfContents.stories.d.ts +9 -1
- package/index.esm.js +6 -6
- package/index.js +6 -6
- package/index.mjs +6 -6
- package/package.json +2 -2
- package/version.d.ts +1 -1
- package/web-components.min.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CustomLinkComponent, DocsProps, ReferenceResolver } from '@stoplight/elements-core';
|
|
2
2
|
import { Node } from '../../types';
|
|
3
|
-
declare type DocsBaseProps = Pick<DocsProps, 'tryItCorsProxy' | 'tryItCredentialsPolicy' | 'nodeHasChanged'>;
|
|
3
|
+
declare type DocsBaseProps = Pick<DocsProps, 'tryItCorsProxy' | 'tryItCredentialsPolicy' | 'nodeHasChanged' | 'nodeUnsupported'>;
|
|
4
4
|
declare type DocsLayoutProps = Pick<Required<DocsProps>['layoutOptions'], 'compact' | 'hideTryIt' | 'hideTryItPanel' | 'hideExport'>;
|
|
5
5
|
export declare type NodeContentProps = {
|
|
6
6
|
node: Node;
|
|
@@ -9,7 +9,7 @@ export declare type NodeContentProps = {
|
|
|
9
9
|
refResolver?: ReferenceResolver;
|
|
10
10
|
onExportRequest?: (type: 'original' | 'bundled') => void;
|
|
11
11
|
} & DocsBaseProps & DocsLayoutProps;
|
|
12
|
-
export declare const NodeContent: ({ node, Link, hideMocking, refResolver, tryItCorsProxy, tryItCredentialsPolicy, nodeHasChanged, compact, hideTryIt, hideTryItPanel, hideExport, onExportRequest, }: NodeContentProps) => JSX.Element;
|
|
12
|
+
export declare const NodeContent: ({ node, Link, hideMocking, refResolver, tryItCorsProxy, tryItCredentialsPolicy, nodeHasChanged, nodeUnsupported, compact, hideTryIt, hideTryItPanel, hideExport, onExportRequest, }: NodeContentProps) => JSX.Element;
|
|
13
13
|
export declare const getNodeUriParts: (uri: string) => {
|
|
14
14
|
fileUri: string;
|
|
15
15
|
pointer: string;
|
|
@@ -2,6 +2,7 @@ import { Story } from '@storybook/react';
|
|
|
2
2
|
declare type SearchWrapperProps = {
|
|
3
3
|
projectIds: string[];
|
|
4
4
|
workspaceId: string;
|
|
5
|
+
isInResponsiveMode?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const _default: {
|
|
7
8
|
title: string;
|
|
@@ -22,11 +23,17 @@ declare const _default: {
|
|
|
22
23
|
category: string;
|
|
23
24
|
};
|
|
24
25
|
};
|
|
26
|
+
isInResponsiveMode: {
|
|
27
|
+
table: {
|
|
28
|
+
category: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
25
31
|
};
|
|
26
32
|
args: {
|
|
27
33
|
projectIds: string[];
|
|
28
34
|
workspaceId: string;
|
|
29
35
|
platformUrl: string;
|
|
36
|
+
isInResponsiveMode: boolean;
|
|
30
37
|
};
|
|
31
38
|
};
|
|
32
39
|
export default _default;
|
|
@@ -7,6 +7,7 @@ export declare type TableOfContentsProps = BoxProps<'div'> & {
|
|
|
7
7
|
Link: CustomLinkComponent;
|
|
8
8
|
collapseTableOfContents?: boolean;
|
|
9
9
|
externalScrollbar?: boolean;
|
|
10
|
+
isInResponsiveMode?: boolean;
|
|
10
11
|
onLinkClick?(): void;
|
|
11
12
|
};
|
|
12
|
-
export declare const TableOfContents: ({ tableOfContents, activeId, Link, collapseTableOfContents, externalScrollbar, onLinkClick, ...boxProps }: TableOfContentsProps) => JSX.Element;
|
|
13
|
+
export declare const TableOfContents: ({ tableOfContents, activeId, Link, collapseTableOfContents, externalScrollbar, isInResponsiveMode, onLinkClick, ...boxProps }: TableOfContentsProps) => JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Story } from '@storybook/react';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ projectId, branchSlug }: {
|
|
4
|
+
component: ({ projectId, branchSlug, isInResponsiveMode, }: {
|
|
5
5
|
projectId: string;
|
|
6
6
|
branchSlug?: string | undefined;
|
|
7
|
+
isInResponsiveMode?: boolean | undefined;
|
|
7
8
|
}) => JSX.Element;
|
|
8
9
|
argTypes: {
|
|
9
10
|
projectId: {
|
|
@@ -21,11 +22,17 @@ declare const _default: {
|
|
|
21
22
|
category: string;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
25
|
+
isInResponsiveMode: {
|
|
26
|
+
table: {
|
|
27
|
+
category: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
24
30
|
};
|
|
25
31
|
args: {
|
|
26
32
|
projectId: string;
|
|
27
33
|
branchSlug: string;
|
|
28
34
|
platformUrl: string;
|
|
35
|
+
isInResponsiveMode: boolean;
|
|
29
36
|
};
|
|
30
37
|
};
|
|
31
38
|
export default _default;
|
|
@@ -33,4 +40,5 @@ export declare const Playground: Story<{
|
|
|
33
40
|
nodeSlug: string;
|
|
34
41
|
projectId: string;
|
|
35
42
|
branchSlug?: string;
|
|
43
|
+
isInResponsiveMode?: boolean;
|
|
36
44
|
}>;
|
package/index.esm.js
CHANGED
|
@@ -37,7 +37,7 @@ const PlatformProvider = ({ platformUrl = 'https://stoplight.io', platformAuthTo
|
|
|
37
37
|
};
|
|
38
38
|
const DevPortalProvider = withPersistenceBoundary(withQueryClientProvider(withMosaicProvider(PlatformProvider)));
|
|
39
39
|
|
|
40
|
-
const NodeContent = ({ node, Link, hideMocking, refResolver, tryItCorsProxy, tryItCredentialsPolicy, nodeHasChanged, compact, hideTryIt, hideTryItPanel, hideExport, onExportRequest, }) => {
|
|
40
|
+
const NodeContent = ({ node, Link, hideMocking, refResolver, tryItCorsProxy, tryItCredentialsPolicy, nodeHasChanged, nodeUnsupported, compact, hideTryIt, hideTryItPanel, hideExport, onExportRequest, }) => {
|
|
41
41
|
var _a, _b, _c, _d;
|
|
42
42
|
return (React.createElement(NodeLinkContext.Provider, { value: [node, Link] },
|
|
43
43
|
React.createElement(MarkdownComponentsProvider, { value: { a: LinkComponent } },
|
|
@@ -58,7 +58,7 @@ const NodeContent = ({ node, Link, hideMocking, refResolver, tryItCorsProxy, try
|
|
|
58
58
|
? { onPress: () => onExportRequest('bundled') }
|
|
59
59
|
: { href: (_d = node.links.export_bundled_file_url) !== null && _d !== void 0 ? _d : getBundledUrl(node.links.export_url) },
|
|
60
60
|
}
|
|
61
|
-
: undefined, tryItCredentialsPolicy: tryItCredentialsPolicy, nodeHasChanged: nodeHasChanged })))));
|
|
61
|
+
: undefined, tryItCredentialsPolicy: tryItCredentialsPolicy, nodeHasChanged: nodeHasChanged, nodeUnsupported: nodeUnsupported })))));
|
|
62
62
|
};
|
|
63
63
|
const NodeLinkContext = React.createContext(undefined);
|
|
64
64
|
const externalRegex = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
@@ -202,10 +202,10 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
const TableOfContents = (_a) => {
|
|
205
|
-
var { tableOfContents, activeId, Link, collapseTableOfContents = false, externalScrollbar, onLinkClick } = _a, boxProps = __rest(_a, ["tableOfContents", "activeId", "Link", "collapseTableOfContents", "externalScrollbar", "onLinkClick"]);
|
|
206
|
-
return (React.createElement(Flex, Object.assign({ bg:
|
|
205
|
+
var { tableOfContents, activeId, Link, collapseTableOfContents = false, externalScrollbar, isInResponsiveMode = false, onLinkClick } = _a, boxProps = __rest(_a, ["tableOfContents", "activeId", "Link", "collapseTableOfContents", "externalScrollbar", "isInResponsiveMode", "onLinkClick"]);
|
|
206
|
+
return (React.createElement(Flex, Object.assign({ bg: isInResponsiveMode ? 'canvas' : 'canvas-100' }, boxProps, { flexDirection: "col", maxH: "full" }),
|
|
207
207
|
React.createElement(Flex, { flexGrow: true, flexShrink: true, overflowY: "auto" },
|
|
208
|
-
React.createElement(TableOfContents$1, { tree: tableOfContents.items, activeId: activeId, Link: Link, maxDepthOpenByDefault: collapseTableOfContents ? 0 : 1, externalScrollbar: externalScrollbar, onLinkClick: onLinkClick })),
|
|
208
|
+
React.createElement(TableOfContents$1, { tree: tableOfContents.items, activeId: activeId, Link: Link, maxDepthOpenByDefault: collapseTableOfContents ? 0 : 1, externalScrollbar: externalScrollbar, onLinkClick: onLinkClick, isInResponsiveMode: isInResponsiveMode })),
|
|
209
209
|
tableOfContents.hide_powered_by ? null : (React.createElement(PoweredByLink, { source: activeId, pathname: typeof window !== 'undefined' ? window.location.pathname : '', packageType: "elements-dev-portal" }))));
|
|
210
210
|
};
|
|
211
211
|
|
|
@@ -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.
|
|
252
|
+
const appVersion = '1.15.0';
|
|
253
253
|
|
|
254
254
|
class ResponseError extends Error {
|
|
255
255
|
constructor(message, responseCode) {
|
package/index.js
CHANGED
|
@@ -64,7 +64,7 @@ const PlatformProvider = ({ platformUrl = 'https://stoplight.io', platformAuthTo
|
|
|
64
64
|
};
|
|
65
65
|
const DevPortalProvider = elementsCore.withPersistenceBoundary(elementsCore.withQueryClientProvider(elementsCore.withMosaicProvider(PlatformProvider)));
|
|
66
66
|
|
|
67
|
-
const NodeContent = ({ node, Link, hideMocking, refResolver, tryItCorsProxy, tryItCredentialsPolicy, nodeHasChanged, compact, hideTryIt, hideTryItPanel, hideExport, onExportRequest, }) => {
|
|
67
|
+
const NodeContent = ({ node, Link, hideMocking, refResolver, tryItCorsProxy, tryItCredentialsPolicy, nodeHasChanged, nodeUnsupported, compact, hideTryIt, hideTryItPanel, hideExport, onExportRequest, }) => {
|
|
68
68
|
var _a, _b, _c, _d;
|
|
69
69
|
return (React__namespace.createElement(NodeLinkContext.Provider, { value: [node, Link] },
|
|
70
70
|
React__namespace.createElement(elementsCore.MarkdownComponentsProvider, { value: { a: LinkComponent } },
|
|
@@ -85,7 +85,7 @@ const NodeContent = ({ node, Link, hideMocking, refResolver, tryItCorsProxy, try
|
|
|
85
85
|
? { onPress: () => onExportRequest('bundled') }
|
|
86
86
|
: { href: (_d = node.links.export_bundled_file_url) !== null && _d !== void 0 ? _d : getBundledUrl(node.links.export_url) },
|
|
87
87
|
}
|
|
88
|
-
: undefined, tryItCredentialsPolicy: tryItCredentialsPolicy, nodeHasChanged: nodeHasChanged })))));
|
|
88
|
+
: undefined, tryItCredentialsPolicy: tryItCredentialsPolicy, nodeHasChanged: nodeHasChanged, nodeUnsupported: nodeUnsupported })))));
|
|
89
89
|
};
|
|
90
90
|
const NodeLinkContext = React__namespace.createContext(undefined);
|
|
91
91
|
const externalRegex = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
@@ -229,10 +229,10 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
const TableOfContents = (_a) => {
|
|
232
|
-
var { tableOfContents, activeId, Link, collapseTableOfContents = false, externalScrollbar, onLinkClick } = _a, boxProps = __rest(_a, ["tableOfContents", "activeId", "Link", "collapseTableOfContents", "externalScrollbar", "onLinkClick"]);
|
|
233
|
-
return (React__namespace.createElement(mosaic.Flex, Object.assign({ bg:
|
|
232
|
+
var { tableOfContents, activeId, Link, collapseTableOfContents = false, externalScrollbar, isInResponsiveMode = false, onLinkClick } = _a, boxProps = __rest(_a, ["tableOfContents", "activeId", "Link", "collapseTableOfContents", "externalScrollbar", "isInResponsiveMode", "onLinkClick"]);
|
|
233
|
+
return (React__namespace.createElement(mosaic.Flex, Object.assign({ bg: isInResponsiveMode ? 'canvas' : 'canvas-100' }, boxProps, { flexDirection: "col", maxH: "full" }),
|
|
234
234
|
React__namespace.createElement(mosaic.Flex, { flexGrow: true, flexShrink: true, overflowY: "auto" },
|
|
235
|
-
React__namespace.createElement(elementsCore.TableOfContents, { tree: tableOfContents.items, activeId: activeId, Link: Link, maxDepthOpenByDefault: collapseTableOfContents ? 0 : 1, externalScrollbar: externalScrollbar, onLinkClick: onLinkClick })),
|
|
235
|
+
React__namespace.createElement(elementsCore.TableOfContents, { tree: tableOfContents.items, activeId: activeId, Link: Link, maxDepthOpenByDefault: collapseTableOfContents ? 0 : 1, externalScrollbar: externalScrollbar, onLinkClick: onLinkClick, isInResponsiveMode: isInResponsiveMode })),
|
|
236
236
|
tableOfContents.hide_powered_by ? null : (React__namespace.createElement(elementsCore.PoweredByLink, { source: activeId, pathname: typeof window !== 'undefined' ? window.location.pathname : '', packageType: "elements-dev-portal" }))));
|
|
237
237
|
};
|
|
238
238
|
|
|
@@ -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.
|
|
279
|
+
const appVersion = '1.15.0';
|
|
280
280
|
|
|
281
281
|
class ResponseError extends Error {
|
|
282
282
|
constructor(message, responseCode) {
|
package/index.mjs
CHANGED
|
@@ -37,7 +37,7 @@ const PlatformProvider = ({ platformUrl = 'https://stoplight.io', platformAuthTo
|
|
|
37
37
|
};
|
|
38
38
|
const DevPortalProvider = withPersistenceBoundary(withQueryClientProvider(withMosaicProvider(PlatformProvider)));
|
|
39
39
|
|
|
40
|
-
const NodeContent = ({ node, Link, hideMocking, refResolver, tryItCorsProxy, tryItCredentialsPolicy, nodeHasChanged, compact, hideTryIt, hideTryItPanel, hideExport, onExportRequest, }) => {
|
|
40
|
+
const NodeContent = ({ node, Link, hideMocking, refResolver, tryItCorsProxy, tryItCredentialsPolicy, nodeHasChanged, nodeUnsupported, compact, hideTryIt, hideTryItPanel, hideExport, onExportRequest, }) => {
|
|
41
41
|
var _a, _b, _c, _d;
|
|
42
42
|
return (React.createElement(NodeLinkContext.Provider, { value: [node, Link] },
|
|
43
43
|
React.createElement(MarkdownComponentsProvider, { value: { a: LinkComponent } },
|
|
@@ -58,7 +58,7 @@ const NodeContent = ({ node, Link, hideMocking, refResolver, tryItCorsProxy, try
|
|
|
58
58
|
? { onPress: () => onExportRequest('bundled') }
|
|
59
59
|
: { href: (_d = node.links.export_bundled_file_url) !== null && _d !== void 0 ? _d : getBundledUrl(node.links.export_url) },
|
|
60
60
|
}
|
|
61
|
-
: undefined, tryItCredentialsPolicy: tryItCredentialsPolicy, nodeHasChanged: nodeHasChanged })))));
|
|
61
|
+
: undefined, tryItCredentialsPolicy: tryItCredentialsPolicy, nodeHasChanged: nodeHasChanged, nodeUnsupported: nodeUnsupported })))));
|
|
62
62
|
};
|
|
63
63
|
const NodeLinkContext = React.createContext(undefined);
|
|
64
64
|
const externalRegex = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
@@ -202,10 +202,10 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
const TableOfContents = (_a) => {
|
|
205
|
-
var { tableOfContents, activeId, Link, collapseTableOfContents = false, externalScrollbar, onLinkClick } = _a, boxProps = __rest(_a, ["tableOfContents", "activeId", "Link", "collapseTableOfContents", "externalScrollbar", "onLinkClick"]);
|
|
206
|
-
return (React.createElement(Flex, Object.assign({ bg:
|
|
205
|
+
var { tableOfContents, activeId, Link, collapseTableOfContents = false, externalScrollbar, isInResponsiveMode = false, onLinkClick } = _a, boxProps = __rest(_a, ["tableOfContents", "activeId", "Link", "collapseTableOfContents", "externalScrollbar", "isInResponsiveMode", "onLinkClick"]);
|
|
206
|
+
return (React.createElement(Flex, Object.assign({ bg: isInResponsiveMode ? 'canvas' : 'canvas-100' }, boxProps, { flexDirection: "col", maxH: "full" }),
|
|
207
207
|
React.createElement(Flex, { flexGrow: true, flexShrink: true, overflowY: "auto" },
|
|
208
|
-
React.createElement(TableOfContents$1, { tree: tableOfContents.items, activeId: activeId, Link: Link, maxDepthOpenByDefault: collapseTableOfContents ? 0 : 1, externalScrollbar: externalScrollbar, onLinkClick: onLinkClick })),
|
|
208
|
+
React.createElement(TableOfContents$1, { tree: tableOfContents.items, activeId: activeId, Link: Link, maxDepthOpenByDefault: collapseTableOfContents ? 0 : 1, externalScrollbar: externalScrollbar, onLinkClick: onLinkClick, isInResponsiveMode: isInResponsiveMode })),
|
|
209
209
|
tableOfContents.hide_powered_by ? null : (React.createElement(PoweredByLink, { source: activeId, pathname: typeof window !== 'undefined' ? window.location.pathname : '', packageType: "elements-dev-portal" }))));
|
|
210
210
|
};
|
|
211
211
|
|
|
@@ -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.
|
|
252
|
+
const appVersion = '1.15.0';
|
|
253
253
|
|
|
254
254
|
class ResponseError extends Error {
|
|
255
255
|
constructor(message, responseCode) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoplight/elements-dev-portal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
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.
|
|
29
|
+
"@stoplight/elements-core": "~7.12.0",
|
|
30
30
|
"@stoplight/markdown-viewer": "^5.5.0",
|
|
31
31
|
"@stoplight/mosaic": "^1.33.0",
|
|
32
32
|
"@stoplight/path": "^1.3.2",
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const appVersion = "1.
|
|
1
|
+
export declare const appVersion = "1.15.0";
|