@stoplight/elements 7.3.4 → 7.3.8

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
@@ -88,21 +88,24 @@ const computeAPITree = (serviceNode, config = {}) => {
88
88
  });
89
89
  });
90
90
  groups.forEach(group => {
91
- tree.push({
92
- title: group.title,
93
- items: group.items.flatMap(operationNode => {
94
- if (mergedConfig.hideInternal && operationNode.data.internal) {
95
- return [];
96
- }
97
- return {
98
- id: operationNode.uri,
99
- slug: operationNode.uri,
100
- title: operationNode.name,
101
- type: operationNode.type,
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);
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['default'] = e;
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
- tree.push({
121
- title: group.title,
122
- items: group.items.flatMap(operationNode => {
123
- if (mergedConfig.hideInternal && operationNode.data.internal) {
124
- return [];
125
- }
126
- return {
127
- id: operationNode.uri,
128
- slug: operationNode.uri,
129
- title: operationNode.name,
130
- type: operationNode.type,
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);
@@ -273,7 +274,7 @@ const Item = React__namespace.memo(({ item }) => {
273
274
  }, [hash, item]);
274
275
  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
276
  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['default'](`sl-mr-5 sl-text-base`, `sl-text-${color}`, `sl-border-${color}`) }, item.data.method || 'UNKNOWN'),
277
+ 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
278
  React__namespace.createElement(mosaic.Box, { flex: 1, fontWeight: "medium", wordBreak: "all" }, item.name),
278
279
  isDeprecated && React__namespace.createElement(elementsCore.DeprecatedBadge, null)),
279
280
  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
- tree.push({
92
- title: group.title,
93
- items: group.items.flatMap(operationNode => {
94
- if (mergedConfig.hideInternal && operationNode.data.internal) {
95
- return [];
96
- }
97
- return {
98
- id: operationNode.uri,
99
- slug: operationNode.uri,
100
- title: operationNode.name,
101
- type: operationNode.type,
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoplight/elements",
3
- "version": "7.3.4",
3
+ "version": "7.3.8",
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.4",
32
+ "@stoplight/elements-core": "~7.3.7",
33
33
  "@stoplight/http-spec": "^4.2.2",
34
34
  "@stoplight/json": "^3.10.0",
35
- "@stoplight/mosaic": "1.5.0",
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",