@stoplight/elements 7.3.5 → 7.3.9
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 +19 -15
- package/index.js +22 -20
- package/index.mjs +19 -15
- package/package.json +3 -3
- package/styles.min.css +1 -1
- package/web-components.min.js +1 -1
package/index.esm.js
CHANGED
|
@@ -88,21 +88,24 @@ const computeAPITree = (serviceNode, config = {}) => {
|
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
90
|
groups.forEach(group => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
meta: operationNode.data.method,
|
|
103
|
-
};
|
|
104
|
-
}),
|
|
91
|
+
const items = group.items.flatMap(operationNode => {
|
|
92
|
+
if (mergedConfig.hideInternal && operationNode.data.internal) {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
id: operationNode.uri,
|
|
97
|
+
slug: operationNode.uri,
|
|
98
|
+
title: operationNode.name,
|
|
99
|
+
type: operationNode.type,
|
|
100
|
+
meta: operationNode.data.method,
|
|
101
|
+
};
|
|
105
102
|
});
|
|
103
|
+
if (items.length > 0) {
|
|
104
|
+
tree.push({
|
|
105
|
+
title: group.title,
|
|
106
|
+
items,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
106
109
|
});
|
|
107
110
|
}
|
|
108
111
|
let schemaNodes = serviceNode.children.filter(node => node.type === NodeType.Model);
|
|
@@ -157,6 +160,7 @@ const APIWithSidebarLayout = ({ serviceNode, logo, hideTryIt, hideSchemas, hideI
|
|
|
157
160
|
const { pathname } = location;
|
|
158
161
|
const isRootPath = !pathname || pathname === '/';
|
|
159
162
|
const node = isRootPath ? serviceNode : serviceNode.children.find(child => child.uri === pathname);
|
|
163
|
+
const layoutOptions = React.useMemo(() => ({ hideTryIt: hideTryIt, hideExport: hideExport || (node === null || node === void 0 ? void 0 : node.type) !== NodeType.HttpService }), [hideTryIt, hideExport, node]);
|
|
160
164
|
if (!node) {
|
|
161
165
|
const firstSlug = findFirstNodeSlug(tree);
|
|
162
166
|
if (firstSlug) {
|
|
@@ -178,7 +182,7 @@ const APIWithSidebarLayout = ({ serviceNode, logo, hideTryIt, hideSchemas, hideI
|
|
|
178
182
|
React.createElement(Flex, { flexGrow: true, flexShrink: true, overflowY: "auto", direction: "col" },
|
|
179
183
|
React.createElement(TableOfContents, { tree: tree, activeId: pathname, Link: Link, onLinkClick: handleTocClick })),
|
|
180
184
|
React.createElement(PoweredByLink, { source: serviceNode.name, pathname: pathname, packageType: "elements" })));
|
|
181
|
-
return (React.createElement(SidebarLayout, { ref: container, sidebar: sidebar }, node && (React.createElement(ParsedDocs, { key: pathname, uri: pathname, node: node, nodeTitle: node.name, layoutOptions:
|
|
185
|
+
return (React.createElement(SidebarLayout, { ref: container, sidebar: sidebar }, node && (React.createElement(ParsedDocs, { key: pathname, uri: pathname, node: node, nodeTitle: node.name, layoutOptions: layoutOptions, location: location, allowRouting: true, exportProps: exportProps, tryItCredentialsPolicy: tryItCredentialsPolicy, tryItCorsProxy: tryItCorsProxy }))));
|
|
182
186
|
};
|
|
183
187
|
|
|
184
188
|
const itemMatchesHash = (hash, item) => {
|
package/index.js
CHANGED
|
@@ -28,14 +28,12 @@ function _interopNamespace(e) {
|
|
|
28
28
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
29
29
|
Object.defineProperty(n, k, d.get ? d : {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () {
|
|
32
|
-
return e[k];
|
|
33
|
-
}
|
|
31
|
+
get: function () { return e[k]; }
|
|
34
32
|
});
|
|
35
33
|
}
|
|
36
34
|
});
|
|
37
35
|
}
|
|
38
|
-
n[
|
|
36
|
+
n["default"] = e;
|
|
39
37
|
return Object.freeze(n);
|
|
40
38
|
}
|
|
41
39
|
|
|
@@ -117,21 +115,24 @@ const computeAPITree = (serviceNode, config = {}) => {
|
|
|
117
115
|
});
|
|
118
116
|
});
|
|
119
117
|
groups.forEach(group => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
meta: operationNode.data.method,
|
|
132
|
-
};
|
|
133
|
-
}),
|
|
118
|
+
const items = group.items.flatMap(operationNode => {
|
|
119
|
+
if (mergedConfig.hideInternal && operationNode.data.internal) {
|
|
120
|
+
return [];
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
id: operationNode.uri,
|
|
124
|
+
slug: operationNode.uri,
|
|
125
|
+
title: operationNode.name,
|
|
126
|
+
type: operationNode.type,
|
|
127
|
+
meta: operationNode.data.method,
|
|
128
|
+
};
|
|
134
129
|
});
|
|
130
|
+
if (items.length > 0) {
|
|
131
|
+
tree.push({
|
|
132
|
+
title: group.title,
|
|
133
|
+
items,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
135
136
|
});
|
|
136
137
|
}
|
|
137
138
|
let schemaNodes = serviceNode.children.filter(node => node.type === types.NodeType.Model);
|
|
@@ -186,6 +187,7 @@ const APIWithSidebarLayout = ({ serviceNode, logo, hideTryIt, hideSchemas, hideI
|
|
|
186
187
|
const { pathname } = location;
|
|
187
188
|
const isRootPath = !pathname || pathname === '/';
|
|
188
189
|
const node = isRootPath ? serviceNode : serviceNode.children.find(child => child.uri === pathname);
|
|
190
|
+
const layoutOptions = React__namespace.useMemo(() => ({ hideTryIt: hideTryIt, hideExport: hideExport || (node === null || node === void 0 ? void 0 : node.type) !== types.NodeType.HttpService }), [hideTryIt, hideExport, node]);
|
|
189
191
|
if (!node) {
|
|
190
192
|
const firstSlug = findFirstNodeSlug(tree);
|
|
191
193
|
if (firstSlug) {
|
|
@@ -207,7 +209,7 @@ const APIWithSidebarLayout = ({ serviceNode, logo, hideTryIt, hideSchemas, hideI
|
|
|
207
209
|
React__namespace.createElement(mosaic.Flex, { flexGrow: true, flexShrink: true, overflowY: "auto", direction: "col" },
|
|
208
210
|
React__namespace.createElement(elementsCore.TableOfContents, { tree: tree, activeId: pathname, Link: reactRouterDom.Link, onLinkClick: handleTocClick })),
|
|
209
211
|
React__namespace.createElement(elementsCore.PoweredByLink, { source: serviceNode.name, pathname: pathname, packageType: "elements" })));
|
|
210
|
-
return (React__namespace.createElement(elementsCore.SidebarLayout, { ref: container, sidebar: sidebar }, node && (React__namespace.createElement(elementsCore.ParsedDocs, { key: pathname, uri: pathname, node: node, nodeTitle: node.name, layoutOptions:
|
|
212
|
+
return (React__namespace.createElement(elementsCore.SidebarLayout, { ref: container, sidebar: sidebar }, node && (React__namespace.createElement(elementsCore.ParsedDocs, { key: pathname, uri: pathname, node: node, nodeTitle: node.name, layoutOptions: layoutOptions, location: location, allowRouting: true, exportProps: exportProps, tryItCredentialsPolicy: tryItCredentialsPolicy, tryItCorsProxy: tryItCorsProxy }))));
|
|
211
213
|
};
|
|
212
214
|
|
|
213
215
|
const itemMatchesHash = (hash, item) => {
|
|
@@ -273,7 +275,7 @@ const Item = React__namespace.memo(({ item }) => {
|
|
|
273
275
|
}, [hash, item]);
|
|
274
276
|
return (React__namespace.createElement(mosaic.Box, { ref: scrollRef, w: "full", my: 2, border: true, borderColor: { default: isExpanded ? 'light' : 'transparent', hover: 'light' }, bg: { default: isExpanded ? 'code' : 'transparent', hover: 'code' } },
|
|
275
277
|
React__namespace.createElement(mosaic.Flex, { mx: "auto", alignItems: "center", cursor: "pointer", fontSize: "lg", p: 2, onClick: onClick, color: "current" },
|
|
276
|
-
React__namespace.createElement(mosaic.Box, { w: 24, textTransform: "uppercase", textAlign: "center", fontWeight: "semibold", border: true, rounded: true, px: 2, bg: "canvas", className: cn__default[
|
|
278
|
+
React__namespace.createElement(mosaic.Box, { w: 24, textTransform: "uppercase", textAlign: "center", fontWeight: "semibold", border: true, rounded: true, px: 2, bg: "canvas", className: cn__default["default"](`sl-mr-5 sl-text-base`, `sl-text-${color}`, `sl-border-${color}`) }, item.data.method || 'UNKNOWN'),
|
|
277
279
|
React__namespace.createElement(mosaic.Box, { flex: 1, fontWeight: "medium", wordBreak: "all" }, item.name),
|
|
278
280
|
isDeprecated && React__namespace.createElement(elementsCore.DeprecatedBadge, null)),
|
|
279
281
|
React__namespace.createElement(Collapse, { isOpen: isExpanded }, hideTryIt ? (React__namespace.createElement(mosaic.Box, { as: elementsCore.ParsedDocs, layoutOptions: { noHeading: true, hideTryItPanel: true }, node: item, p: 4 })) : (React__namespace.createElement(mosaic.Tabs, { appearance: "line" },
|
package/index.mjs
CHANGED
|
@@ -88,21 +88,24 @@ const computeAPITree = (serviceNode, config = {}) => {
|
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
90
|
groups.forEach(group => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
meta: operationNode.data.method,
|
|
103
|
-
};
|
|
104
|
-
}),
|
|
91
|
+
const items = group.items.flatMap(operationNode => {
|
|
92
|
+
if (mergedConfig.hideInternal && operationNode.data.internal) {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
id: operationNode.uri,
|
|
97
|
+
slug: operationNode.uri,
|
|
98
|
+
title: operationNode.name,
|
|
99
|
+
type: operationNode.type,
|
|
100
|
+
meta: operationNode.data.method,
|
|
101
|
+
};
|
|
105
102
|
});
|
|
103
|
+
if (items.length > 0) {
|
|
104
|
+
tree.push({
|
|
105
|
+
title: group.title,
|
|
106
|
+
items,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
106
109
|
});
|
|
107
110
|
}
|
|
108
111
|
let schemaNodes = serviceNode.children.filter(node => node.type === NodeType.Model);
|
|
@@ -157,6 +160,7 @@ const APIWithSidebarLayout = ({ serviceNode, logo, hideTryIt, hideSchemas, hideI
|
|
|
157
160
|
const { pathname } = location;
|
|
158
161
|
const isRootPath = !pathname || pathname === '/';
|
|
159
162
|
const node = isRootPath ? serviceNode : serviceNode.children.find(child => child.uri === pathname);
|
|
163
|
+
const layoutOptions = React.useMemo(() => ({ hideTryIt: hideTryIt, hideExport: hideExport || (node === null || node === void 0 ? void 0 : node.type) !== NodeType.HttpService }), [hideTryIt, hideExport, node]);
|
|
160
164
|
if (!node) {
|
|
161
165
|
const firstSlug = findFirstNodeSlug(tree);
|
|
162
166
|
if (firstSlug) {
|
|
@@ -178,7 +182,7 @@ const APIWithSidebarLayout = ({ serviceNode, logo, hideTryIt, hideSchemas, hideI
|
|
|
178
182
|
React.createElement(Flex, { flexGrow: true, flexShrink: true, overflowY: "auto", direction: "col" },
|
|
179
183
|
React.createElement(TableOfContents, { tree: tree, activeId: pathname, Link: Link, onLinkClick: handleTocClick })),
|
|
180
184
|
React.createElement(PoweredByLink, { source: serviceNode.name, pathname: pathname, packageType: "elements" })));
|
|
181
|
-
return (React.createElement(SidebarLayout, { ref: container, sidebar: sidebar }, node && (React.createElement(ParsedDocs, { key: pathname, uri: pathname, node: node, nodeTitle: node.name, layoutOptions:
|
|
185
|
+
return (React.createElement(SidebarLayout, { ref: container, sidebar: sidebar }, node && (React.createElement(ParsedDocs, { key: pathname, uri: pathname, node: node, nodeTitle: node.name, layoutOptions: layoutOptions, location: location, allowRouting: true, exportProps: exportProps, tryItCredentialsPolicy: tryItCredentialsPolicy, tryItCorsProxy: tryItCorsProxy }))));
|
|
182
186
|
};
|
|
183
187
|
|
|
184
188
|
const itemMatchesHash = (hash, item) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoplight/elements",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.9",
|
|
4
4
|
"description": "UI components for composing beautiful developer documentation.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "./index.js",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"@fortawesome/fontawesome-svg-core": "^1.2.31",
|
|
30
30
|
"@fortawesome/free-solid-svg-icons": "^5.14.0",
|
|
31
31
|
"@fortawesome/react-fontawesome": "^0.1.11",
|
|
32
|
-
"@stoplight/elements-core": "~7.3.
|
|
32
|
+
"@stoplight/elements-core": "~7.3.8",
|
|
33
33
|
"@stoplight/http-spec": "^4.2.2",
|
|
34
34
|
"@stoplight/json": "^3.10.0",
|
|
35
|
-
"@stoplight/mosaic": "1.
|
|
35
|
+
"@stoplight/mosaic": "^1.8.2",
|
|
36
36
|
"@stoplight/types": "^12.0.0",
|
|
37
37
|
"classnames": "^2.2.6",
|
|
38
38
|
"file-saver": "^2.0.5",
|