@teambit/tagged-exports 0.0.1
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/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/preview-1704113440840.js +7 -0
- package/dist/tagged-exports.d.ts +5 -0
- package/dist/tagged-exports.js +65 -0
- package/dist/tagged-exports.js.map +1 -0
- package/dist/tagged-exports.module.scss +72 -0
- package/dist/tsconfig.json +32 -0
- package/index.ts +2 -0
- package/package.json +35 -0
- package/tagged-exports.module.scss +72 -0
- package/tagged-exports.tsx +81 -0
- package/tsconfig.json +32 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaggedExports = void 0;
|
|
4
|
+
var tagged_exports_1 = require("./tagged-exports");
|
|
5
|
+
Object.defineProperty(exports, "TaggedExports", { enumerable: true, get: function () { return tagged_exports_1.TaggedExports; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,+GAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.TaggedExports = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const documenter_ui_linked_heading_1 = require("@teambit/documenter.ui.linked-heading");
|
|
20
|
+
const documenter_ui_section_1 = require("@teambit/documenter.ui.section");
|
|
21
|
+
const api_reference_hooks_use_api_1 = require("@teambit/api-reference.hooks.use-api");
|
|
22
|
+
const base_ui_loaders_skeleton_1 = require("@teambit/base-ui.loaders.skeleton");
|
|
23
|
+
const api_reference_hooks_use_api_renderers_1 = require("@teambit/api-reference.hooks.use-api-renderers");
|
|
24
|
+
const api_reference_overview_api_reference_table_of_contents_1 = require("@teambit/api-reference.overview.api-reference-table-of-contents");
|
|
25
|
+
const tagged_exports_module_scss_1 = __importDefault(require("./tagged-exports.module.scss"));
|
|
26
|
+
function TaggedExports(_a) {
|
|
27
|
+
var _b, _c;
|
|
28
|
+
var { componentId } = _a, rest = __rest(_a, ["componentId"]);
|
|
29
|
+
const renderers = (0, api_reference_hooks_use_api_renderers_1.useAPIRefRenderers)();
|
|
30
|
+
const api = (0, api_reference_hooks_use_api_1.useAPI)(componentId, renderers.nodeRenderers);
|
|
31
|
+
const showTableOfContents = ((_b = api.apiModel) === null || _b === void 0 ? void 0 : _b.taggedAPINodes.length) === 0;
|
|
32
|
+
const taggedAPIs = (_c = api.apiModel) === null || _c === void 0 ? void 0 : _c.taggedAPINodes;
|
|
33
|
+
const loading = !!api.loading;
|
|
34
|
+
if (!loading && !api.apiModel)
|
|
35
|
+
return null;
|
|
36
|
+
const Loader = (react_1.default.createElement("div", { className: tagged_exports_module_scss_1.default.loader },
|
|
37
|
+
react_1.default.createElement("div", { className: tagged_exports_module_scss_1.default.loaderTitle },
|
|
38
|
+
react_1.default.createElement(base_ui_loaders_skeleton_1.CircleSkeleton, { size: 1.5 }),
|
|
39
|
+
react_1.default.createElement(base_ui_loaders_skeleton_1.WordSkeleton, { length: 5 })),
|
|
40
|
+
react_1.default.createElement(base_ui_loaders_skeleton_1.BlockSkeleton, { lines: 8 }),
|
|
41
|
+
react_1.default.createElement(base_ui_loaders_skeleton_1.BlockSkeleton, { lines: 4 })));
|
|
42
|
+
return (react_1.default.createElement(documenter_ui_section_1.Section, Object.assign({}, rest, { className: tagged_exports_module_scss_1.default.section }),
|
|
43
|
+
react_1.default.createElement(documenter_ui_linked_heading_1.LinkedHeading, { className: tagged_exports_module_scss_1.default.heading, size: 'sm' },
|
|
44
|
+
react_1.default.createElement("div", { className: tagged_exports_module_scss_1.default.title },
|
|
45
|
+
react_1.default.createElement("img", { style: { width: 24 }, src: "https://static.bit.dev/bit-icons/api-ref.svg" }),
|
|
46
|
+
react_1.default.createElement("span", null, "API"))),
|
|
47
|
+
showTableOfContents && api.apiModel && (react_1.default.createElement("div", { className: tagged_exports_module_scss_1.default.content },
|
|
48
|
+
react_1.default.createElement(api_reference_overview_api_reference_table_of_contents_1.APIReferenceTableOfContents, { apiModel: api.apiModel }))),
|
|
49
|
+
!loading && (react_1.default.createElement("div", { className: tagged_exports_module_scss_1.default.taggedAPIs }, taggedAPIs === null || taggedAPIs === void 0 ? void 0 : taggedAPIs.map((taggedAPI, index) => {
|
|
50
|
+
const OverviewComponent = taggedAPI.renderer.OverviewComponent;
|
|
51
|
+
// @todo - change this to be non nullable
|
|
52
|
+
if (!OverviewComponent)
|
|
53
|
+
return null;
|
|
54
|
+
return (react_1.default.createElement(OverviewComponent, { apiNode: taggedAPI, key: `${taggedAPI.api.name}-${index}`, apiRefModel: api.apiModel, renderers: renderers.nodeRenderers }));
|
|
55
|
+
}))),
|
|
56
|
+
!loading && (react_1.default.createElement("div", { className: tagged_exports_module_scss_1.default.banner },
|
|
57
|
+
react_1.default.createElement("img", { style: { width: 16 }, src: "https://static.bit.dev/bit-icons/lightbulb-thinking.svg" }),
|
|
58
|
+
react_1.default.createElement("span", null,
|
|
59
|
+
"Use the",
|
|
60
|
+
react_1.default.createElement("span", { className: tagged_exports_module_scss_1.default.highlighted }, "@exports"),
|
|
61
|
+
"jsdoc tag to only show relevant APIs with details for your users"))),
|
|
62
|
+
loading && Loader));
|
|
63
|
+
}
|
|
64
|
+
exports.TaggedExports = TaggedExports;
|
|
65
|
+
//# sourceMappingURL=tagged-exports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tagged-exports.js","sourceRoot":"","sources":["../tagged-exports.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,wFAAsE;AACtE,0EAAyD;AACzD,sFAA8D;AAC9D,gFAAgG;AAChG,0GAAoF;AACpF,4IAA8G;AAG9G,8FAAkD;AAMlD,SAAgB,aAAa,CAAC,EAA4C;;QAA5C,EAAE,WAAW,OAA+B,EAA1B,IAAI,cAAtB,eAAwB,CAAF;IAClD,MAAM,SAAS,GAAG,IAAA,0DAAkB,GAAE,CAAC;IACvC,MAAM,GAAG,GAAG,IAAA,oCAAM,EAAC,WAAW,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACzD,MAAM,mBAAmB,GAAG,CAAA,MAAA,GAAG,CAAC,QAAQ,0CAAE,cAAc,CAAC,MAAM,MAAK,CAAC,CAAC;IAEtE,MAAM,UAAU,GAAG,MAAA,GAAG,CAAC,QAAQ,0CAAE,cAAc,CAAC;IAChD,MAAM,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC;IAE9B,IAAI,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE3C,MAAM,MAAM,GAAG,CACb,uCAAK,SAAS,EAAE,oCAAM,CAAC,MAAM;QAC3B,uCAAK,SAAS,EAAE,oCAAM,CAAC,WAAW;YAChC,8BAAC,yCAAc,IAAC,IAAI,EAAE,GAAG,GAAI;YAC7B,8BAAC,uCAAY,IAAC,MAAM,EAAE,CAAC,GAAI,CACvB;QAEN,8BAAC,wCAAa,IAAC,KAAK,EAAE,CAAC,GAAI;QAC3B,8BAAC,wCAAa,IAAC,KAAK,EAAE,CAAC,GAAI,CACvB,CACP,CAAC;IAEF,OAAO,CACL,8BAAC,+BAAO,oBAAK,IAAI,IAAE,SAAS,EAAE,oCAAM,CAAC,OAAO;QAC1C,8BAAC,4CAAa,IAAC,SAAS,EAAE,oCAAM,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI;YAClD,uCAAK,SAAS,EAAE,oCAAM,CAAC,KAAK;gBAC1B,uCAAK,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,EAAC,8CAA8C,GAAG;gBAChF,kDAAgB,CACZ,CACQ;QACf,mBAAmB,IAAI,GAAG,CAAC,QAAQ,IAAI,CACtC,uCAAK,SAAS,EAAE,oCAAM,CAAC,OAAO;YAC5B,8BAAC,oFAA2B,IAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,GAAI,CACnD,CACP;QACA,CAAC,OAAO,IAAI,CACX,uCAAK,SAAS,EAAE,oCAAM,CAAC,UAAU,IAC9B,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE;YACpC,MAAM,iBAAiB,GAAG,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAC/D,yCAAyC;YACzC,IAAI,CAAC,iBAAiB;gBAAE,OAAO,IAAI,CAAC;YACpC,OAAO,CACL,8BAAC,iBAAiB,IAChB,OAAO,EAAE,SAAS,EAClB,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,IAAI,KAAK,EAAE,EACrC,WAAW,EAAE,GAAG,CAAC,QAA6B,EAC9C,SAAS,EAAE,SAAS,CAAC,aAAa,GAClC,CACH,CAAC;QACJ,CAAC,CAAC,CACE,CACP;QACA,CAAC,OAAO,IAAI,CACX,uCAAK,SAAS,EAAE,oCAAM,CAAC,MAAM;YAC3B,uCAAK,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,EAAC,yDAAyD,GAAG;YAC3F;;gBAEE,wCAAM,SAAS,EAAE,oCAAM,CAAC,WAAW,eAAiB;mFAE/C,CACH,CACP;QACA,OAAO,IAAI,MAAM,CACV,CACX,CAAC;AACJ,CAAC;AAjED,sCAiEC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
.section {
|
|
2
|
+
padding: 20px 40px 10px 40px;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 32px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.title {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.heading {
|
|
16
|
+
margin-bottom: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.content {
|
|
20
|
+
display: flex;
|
|
21
|
+
border-radius: 8px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.banner {
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: rgba(247, 247, 245, 0.631372549);
|
|
29
|
+
border-radius: 8px;
|
|
30
|
+
padding: 16px;
|
|
31
|
+
font-size: 16px;
|
|
32
|
+
gap: 8px;
|
|
33
|
+
> img {
|
|
34
|
+
background-color: none;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.highlighted {
|
|
39
|
+
color: var(--primary-color, #6c5ce7);
|
|
40
|
+
margin: 0px 4px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.loader {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
gap: 16px;
|
|
47
|
+
color: rgba(247, 247, 245, 0.631372549);
|
|
48
|
+
// > * {
|
|
49
|
+
// background-color: rgba(247, 247, 245, 0.631372549) !important;
|
|
50
|
+
// }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.loaderTitle {
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.apiSkeleton {
|
|
59
|
+
margin-top: 8px;
|
|
60
|
+
border-radius: 4px;
|
|
61
|
+
align-items: center;
|
|
62
|
+
// background-color: rgba(247, 247, 245, 0.631372549);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.bannerSkeleton {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: 8px;
|
|
69
|
+
padding: 8px;
|
|
70
|
+
border-radius: 8px;
|
|
71
|
+
// background-color: rgba(247, 247, 245, 0.631372549);
|
|
72
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"target": "es2015",
|
|
10
|
+
"module": "CommonJS",
|
|
11
|
+
"jsx": "react",
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
"composite": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"outDir": "dist",
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"rootDir": ".",
|
|
22
|
+
"resolveJsonModule": true
|
|
23
|
+
},
|
|
24
|
+
"exclude": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"include": [
|
|
29
|
+
"**/*",
|
|
30
|
+
"**/*.json"
|
|
31
|
+
]
|
|
32
|
+
}
|
package/index.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/tagged-exports",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"componentId": {
|
|
6
|
+
"name": "tagged-exports",
|
|
7
|
+
"version": "0.0.1",
|
|
8
|
+
"scope": "teambit.api-reference"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"core-js": "^3.0.0",
|
|
12
|
+
"@teambit/base-ui.loaders.skeleton": "1.0.1",
|
|
13
|
+
"@teambit/documenter.ui.linked-heading": "4.1.6",
|
|
14
|
+
"@teambit/documenter.ui.section": "4.1.1",
|
|
15
|
+
"@teambit/api-reference.hooks.use-api-renderers": "0.0.1",
|
|
16
|
+
"@teambit/api-reference.hooks.use-api": "0.0.16",
|
|
17
|
+
"@teambit/api-reference.models.api-reference-model": "0.0.18",
|
|
18
|
+
"@teambit/api-reference.overview.api-reference-table-of-contents": "0.0.1"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/react": "^17.0.8",
|
|
22
|
+
"@types/node": "12.20.4",
|
|
23
|
+
"@types/react-dom": "^17.0.5",
|
|
24
|
+
"@types/jest": "^26.0.0",
|
|
25
|
+
"@babel/runtime": "7.20.0",
|
|
26
|
+
"@types/testing-library__jest-dom": "5.9.5"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": "^16.8.0 || ^17.0.0",
|
|
30
|
+
"react-dom": "^16.8.0 || ^17.0.0"
|
|
31
|
+
},
|
|
32
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
33
|
+
"optionalDependencies": {},
|
|
34
|
+
"peerDependenciesMeta": {}
|
|
35
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
.section {
|
|
2
|
+
padding: 20px 40px 10px 40px;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 32px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.title {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.heading {
|
|
16
|
+
margin-bottom: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.content {
|
|
20
|
+
display: flex;
|
|
21
|
+
border-radius: 8px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.banner {
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: rgba(247, 247, 245, 0.631372549);
|
|
29
|
+
border-radius: 8px;
|
|
30
|
+
padding: 16px;
|
|
31
|
+
font-size: 16px;
|
|
32
|
+
gap: 8px;
|
|
33
|
+
> img {
|
|
34
|
+
background-color: none;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.highlighted {
|
|
39
|
+
color: var(--primary-color, #6c5ce7);
|
|
40
|
+
margin: 0px 4px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.loader {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
gap: 16px;
|
|
47
|
+
color: rgba(247, 247, 245, 0.631372549);
|
|
48
|
+
// > * {
|
|
49
|
+
// background-color: rgba(247, 247, 245, 0.631372549) !important;
|
|
50
|
+
// }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.loaderTitle {
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.apiSkeleton {
|
|
59
|
+
margin-top: 8px;
|
|
60
|
+
border-radius: 4px;
|
|
61
|
+
align-items: center;
|
|
62
|
+
// background-color: rgba(247, 247, 245, 0.631372549);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.bannerSkeleton {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: 8px;
|
|
69
|
+
padding: 8px;
|
|
70
|
+
border-radius: 8px;
|
|
71
|
+
// background-color: rgba(247, 247, 245, 0.631372549);
|
|
72
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LinkedHeading } from '@teambit/documenter.ui.linked-heading';
|
|
3
|
+
import { Section } from '@teambit/documenter.ui.section';
|
|
4
|
+
import { useAPI } from '@teambit/api-reference.hooks.use-api';
|
|
5
|
+
import { BlockSkeleton, WordSkeleton, CircleSkeleton } from '@teambit/base-ui.loaders.skeleton';
|
|
6
|
+
import { useAPIRefRenderers } from '@teambit/api-reference.hooks.use-api-renderers';
|
|
7
|
+
import { APIReferenceTableOfContents } from '@teambit/api-reference.overview.api-reference-table-of-contents';
|
|
8
|
+
import { APIReferenceModel } from '@teambit/api-reference.models.api-reference-model';
|
|
9
|
+
|
|
10
|
+
import styles from './tagged-exports.module.scss';
|
|
11
|
+
|
|
12
|
+
export type TaggedExportsProps = {
|
|
13
|
+
componentId: string;
|
|
14
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
15
|
+
|
|
16
|
+
export function TaggedExports({ componentId, ...rest }: TaggedExportsProps) {
|
|
17
|
+
const renderers = useAPIRefRenderers();
|
|
18
|
+
const api = useAPI(componentId, renderers.nodeRenderers);
|
|
19
|
+
const showTableOfContents = api.apiModel?.taggedAPINodes.length === 0;
|
|
20
|
+
|
|
21
|
+
const taggedAPIs = api.apiModel?.taggedAPINodes;
|
|
22
|
+
const loading = !!api.loading;
|
|
23
|
+
|
|
24
|
+
if (!loading && !api.apiModel) return null;
|
|
25
|
+
|
|
26
|
+
const Loader = (
|
|
27
|
+
<div className={styles.loader}>
|
|
28
|
+
<div className={styles.loaderTitle}>
|
|
29
|
+
<CircleSkeleton size={1.5} />
|
|
30
|
+
<WordSkeleton length={5} />
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<BlockSkeleton lines={8} />
|
|
34
|
+
<BlockSkeleton lines={4} />
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Section {...rest} className={styles.section}>
|
|
40
|
+
<LinkedHeading className={styles.heading} size={'sm'}>
|
|
41
|
+
<div className={styles.title}>
|
|
42
|
+
<img style={{ width: 24 }} src="https://static.bit.dev/bit-icons/api-ref.svg" />
|
|
43
|
+
<span>API</span>
|
|
44
|
+
</div>
|
|
45
|
+
</LinkedHeading>
|
|
46
|
+
{showTableOfContents && api.apiModel && (
|
|
47
|
+
<div className={styles.content}>
|
|
48
|
+
<APIReferenceTableOfContents apiModel={api.apiModel} />
|
|
49
|
+
</div>
|
|
50
|
+
)}
|
|
51
|
+
{!loading && (
|
|
52
|
+
<div className={styles.taggedAPIs}>
|
|
53
|
+
{taggedAPIs?.map((taggedAPI, index) => {
|
|
54
|
+
const OverviewComponent = taggedAPI.renderer.OverviewComponent;
|
|
55
|
+
// @todo - change this to be non nullable
|
|
56
|
+
if (!OverviewComponent) return null;
|
|
57
|
+
return (
|
|
58
|
+
<OverviewComponent
|
|
59
|
+
apiNode={taggedAPI}
|
|
60
|
+
key={`${taggedAPI.api.name}-${index}`}
|
|
61
|
+
apiRefModel={api.apiModel as APIReferenceModel}
|
|
62
|
+
renderers={renderers.nodeRenderers}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
})}
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
{!loading && (
|
|
69
|
+
<div className={styles.banner}>
|
|
70
|
+
<img style={{ width: 16 }} src="https://static.bit.dev/bit-icons/lightbulb-thinking.svg" />
|
|
71
|
+
<span>
|
|
72
|
+
Use the
|
|
73
|
+
<span className={styles.highlighted}>@exports</span>
|
|
74
|
+
jsdoc tag to only show relevant APIs with details for your users
|
|
75
|
+
</span>
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
{loading && Loader}
|
|
79
|
+
</Section>
|
|
80
|
+
);
|
|
81
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"target": "es2015",
|
|
10
|
+
"module": "CommonJS",
|
|
11
|
+
"jsx": "react",
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
"composite": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"outDir": "dist",
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"rootDir": ".",
|
|
22
|
+
"resolveJsonModule": true
|
|
23
|
+
},
|
|
24
|
+
"exclude": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"include": [
|
|
29
|
+
"**/*",
|
|
30
|
+
"**/*.json"
|
|
31
|
+
]
|
|
32
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: any;
|
|
3
|
+
export = value;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.svg' {
|
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
+
|
|
8
|
+
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @TODO Gilad
|
|
14
|
+
declare module '*.jpg' {
|
|
15
|
+
const value: any;
|
|
16
|
+
export = value;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.jpeg' {
|
|
19
|
+
const value: any;
|
|
20
|
+
export = value;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const value: any;
|
|
24
|
+
export = value;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.bmp' {
|
|
27
|
+
const value: any;
|
|
28
|
+
export = value;
|
|
29
|
+
}
|
package/types/style.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module '*.module.css' {
|
|
2
|
+
const classes: { readonly [key: string]: string };
|
|
3
|
+
export default classes;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.module.scss' {
|
|
6
|
+
const classes: { readonly [key: string]: string };
|
|
7
|
+
export default classes;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.module.sass' {
|
|
10
|
+
const classes: { readonly [key: string]: string };
|
|
11
|
+
export default classes;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module '*.module.less' {
|
|
15
|
+
const classes: { readonly [key: string]: string };
|
|
16
|
+
export default classes;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '*.less' {
|
|
20
|
+
const classes: { readonly [key: string]: string };
|
|
21
|
+
export default classes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.css' {
|
|
25
|
+
const classes: { readonly [key: string]: string };
|
|
26
|
+
export default classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module '*.sass' {
|
|
30
|
+
const classes: { readonly [key: string]: string };
|
|
31
|
+
export default classes;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module '*.scss' {
|
|
35
|
+
const classes: { readonly [key: string]: string };
|
|
36
|
+
export default classes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module '*.mdx' {
|
|
40
|
+
const component: any;
|
|
41
|
+
export default component;
|
|
42
|
+
}
|