@teambit/api-reference 0.0.0-ec02bcceb773fbb5fbe9cb57fe55bee80ac065af → 0.0.0-ec16a1dc785bea559c02a98eae627283f313449c

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/.npmignore ADDED
@@ -0,0 +1,18 @@
1
+ dist/tsconfig.tsbuildinfo
2
+ dist/tsconfig.json
3
+ /tsconfig.json
4
+
5
+ package-tar/
6
+ .bit-capsule-ready
7
+ /*.ts
8
+ artifacts/*
9
+ !artifacts/env-template
10
+ !artifacts/ui-bundle
11
+ !artifacts/preview-bundle
12
+ package-tar/
13
+ .bit-capsule-ready
14
+ /*.ts
15
+ artifacts/*
16
+ !artifacts/env-template
17
+ !artifacts/ui-bundle
18
+ !artifacts/preview-bundle
@@ -0,0 +1,8 @@
1
+ .apiCompareContainer {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+ overflow: auto;
6
+ padding: 16px 24px;
7
+ max-width: 980px;
8
+ }
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import type { Section } from '@teambit/component';
3
+ import type { TabItem } from '@teambit/component.ui.component-compare.models.component-compare-props';
4
+ import type { ChangeType } from '@teambit/component.ui.component-compare.models.component-compare-change-type';
5
+ import type { ApiDiffInsight } from '@teambit/semantics.ui.api-diff-view';
6
+ import { APICompare } from './api-compare';
7
+
8
+ // Use string cast since the external ChangeType enum doesn't have API yet
9
+ const ChangeTypeAPI = 'API' as unknown as ChangeType;
10
+
11
+ export class APICompareSection implements TabItem, Section {
12
+ route: { path: string; element: React.ReactNode };
13
+
14
+ constructor(getInsights?: () => ApiDiffInsight[]) {
15
+ // built in the constructor (not a field initializer) so the element captures the
16
+ // getter regardless of class-field initialization order.
17
+ this.route = {
18
+ path: 'api/*',
19
+ element: <APICompare getInsights={getInsights} />,
20
+ };
21
+ }
22
+
23
+ navigationLink = {
24
+ href: 'api',
25
+ children: 'API',
26
+ };
27
+
28
+ props = this.navigationLink;
29
+
30
+ order = 15;
31
+ changeType = ChangeTypeAPI;
32
+ id = 'api';
33
+ }
@@ -0,0 +1,84 @@
1
+ import React from 'react';
2
+ import { useComponentCompare } from '@teambit/component.ui.component-compare.context';
3
+ import {
4
+ ComponentApiDiffSection,
5
+ ApiDiffSlimRow,
6
+ ApiDiffInsightProvider,
7
+ useApiDiff,
8
+ } from '@teambit/semantics.ui.api-diff-view';
9
+ import type { ApiDiffInsight } from '@teambit/semantics.ui.api-diff-view';
10
+ import styles from './api-compare.module.scss';
11
+
12
+ // single source of truth for the API diff model lives in api-diff-view.
13
+ export type { APIDiffResult, APIDiffChange, APIDiffDetail } from '@teambit/semantics.ui.api-diff-view';
14
+
15
+ export type APICompareProps = {
16
+ /** resolved lazily at render time — slot registrations can land after the section is constructed */
17
+ getInsights?: () => ApiDiffInsight[];
18
+ };
19
+
20
+ /**
21
+ * the API tab of the single-component compare page. thin host around the same
22
+ * `ComponentApiDiffSection` the lane-compare API view uses — one implementation, two hosts.
23
+ * data comes from the compare context (fetched once by ComponentCompare).
24
+ */
25
+ export function APICompare({ getInsights }: APICompareProps) {
26
+ const compareContext = useComponentCompare();
27
+ const baseModel = compareContext?.base?.model;
28
+ const compareModel = compareContext?.compare?.model;
29
+
30
+ // Prefer a diff already on the context — the legacy `ComponentCompare` fetches it once and sets
31
+ // it there. The redesign single-component page does NOT put it on its inline context, so we fetch
32
+ // on our own. This hook is only mounted when the API view is the active tab (the page renders the
33
+ // element on-demand), so lane-compare — which renders one panel per component and never mounts
34
+ // this tab — pays nothing.
35
+ const contextApiDiff = compareContext?.apiDiffResult;
36
+ const shouldSelfFetch = contextApiDiff === undefined;
37
+ const { result: fetchedApiDiff } = useApiDiff(baseModel?.id.toString(), compareModel?.id.toString(), {
38
+ skip: !shouldSelfFetch,
39
+ });
40
+ const apiDiffResult = shouldSelfFetch ? fetchedApiDiff : contextApiDiff;
41
+
42
+ // memoized so the insights context value keeps a stable identity — otherwise a fresh array every
43
+ // render would re-render every `useApiDiffInsights` consumer (incl. the React.memo'd ApiChangeBlock).
44
+ const insights = React.useMemo(() => getInsights?.(), [getInsights]);
45
+
46
+ if (!compareContext) return null;
47
+
48
+ const id = (compareModel || baseModel)?.id;
49
+ if (!id) return null;
50
+
51
+ const componentIdStr = id.toStringWithoutVersion();
52
+ const baseVersion = baseModel?.id.version;
53
+ const compareVersion = compareModel?.id.version;
54
+
55
+ // no base (first version) or identical versions — nothing to diff, not a failure.
56
+ const nothingToCompare = apiDiffResult === null && (!baseVersion || baseVersion === compareVersion);
57
+
58
+ return (
59
+ <ApiDiffInsightProvider insights={insights}>
60
+ <div className={styles.apiCompareContainer}>
61
+ {nothingToCompare ? (
62
+ <ApiDiffSlimRow
63
+ componentIdStr={componentIdStr}
64
+ displayName={id.fullName}
65
+ chip="nothing to compare"
66
+ detail={baseVersion ? 'both sides are the same version' : 'no base version to compare against'}
67
+ tone="ok"
68
+ />
69
+ ) : (
70
+ <ComponentApiDiffSection
71
+ componentIdStr={componentIdStr}
72
+ displayName={id.fullName}
73
+ baseId={baseModel?.id.toString()}
74
+ compareId={compareModel?.id.toString()}
75
+ baseVersion={baseVersion}
76
+ compareVersion={compareVersion}
77
+ result={apiDiffResult}
78
+ loading={apiDiffResult === undefined}
79
+ />
80
+ )}
81
+ </div>
82
+ </ApiDiffInsightProvider>
83
+ );
84
+ }
@@ -17,8 +17,11 @@ import { CodeAspect } from '@teambit/code';
17
17
  import { TaggedExports } from '@teambit/tagged-exports';
18
18
  import type { WorkspaceUI } from '@teambit/workspace';
19
19
  import { WorkspaceAspect } from '@teambit/workspace';
20
+ import type { ComponentCompareUI } from '@teambit/component-compare';
21
+ import { ComponentCompareAspect } from '@teambit/component-compare';
20
22
 
21
23
  import { APIReferenceAspect } from './api-reference.aspect';
24
+ import { APICompareSection } from './api-compare.section';
22
25
 
23
26
  export type APINodeRendererSlot = SlotRegistry<APINodeRenderer[]>;
24
27
  export class APIReferenceUI {
@@ -29,7 +32,7 @@ export class APIReferenceUI {
29
32
  private workspace: WorkspaceUI
30
33
  ) {}
31
34
 
32
- static dependencies = [ComponentAspect, CodeAspect, WorkspaceAspect];
35
+ static dependencies = [ComponentAspect, CodeAspect, WorkspaceAspect, ComponentCompareAspect];
33
36
  static runtime = UIRuntime;
34
37
  static slots = [Slot.withType<APINodeRenderer[]>()];
35
38
 
@@ -69,7 +72,7 @@ export class APIReferenceUI {
69
72
  apiNodeRenderers: APINodeRenderer[] = defaultNodeRenderers;
70
73
 
71
74
  static async provider(
72
- [componentUI, codeUI, workspaceUI]: [ComponentUI, CodeUI, WorkspaceUI],
75
+ [componentUI, codeUI, workspaceUI, componentCompareUI]: [ComponentUI, CodeUI, WorkspaceUI, ComponentCompareUI],
73
76
  _,
74
77
  [apiNodeRendererSlot]: [APINodeRendererSlot],
75
78
  harmony: Harmony
@@ -84,6 +87,12 @@ export class APIReferenceUI {
84
87
  // register all default schema classes
85
88
  apiReferenceUI.registerSchemaClasses(() => Object.values(Schemas));
86
89
 
90
+ // register API compare tab in component compare. insights are resolved lazily —
91
+ // aspects can register them on componentCompareUI after this provider runs.
92
+ const apiCompareSection = new APICompareSection(() => componentCompareUI.getApiDiffInsights());
93
+ componentCompareUI.registerNavigation(apiCompareSection);
94
+ componentCompareUI.registerRoutes([apiCompareSection.route]);
95
+
87
96
  return apiReferenceUI;
88
97
  }
89
98
  }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { ApiDiffInsight } from '@teambit/semantics.ui.api-diff-view';
3
+ export type { APIDiffResult, APIDiffChange, APIDiffDetail } from '@teambit/semantics.ui.api-diff-view';
4
+ export type APICompareProps = {
5
+ /** resolved lazily at render time — slot registrations can land after the section is constructed */
6
+ getInsights?: () => ApiDiffInsight[];
7
+ };
8
+ /**
9
+ * the API tab of the single-component compare page. thin host around the same
10
+ * `ComponentApiDiffSection` the lane-compare API view uses — one implementation, two hosts.
11
+ * data comes from the compare context (fetched once by ComponentCompare).
12
+ */
13
+ export declare function APICompare({ getInsights }: APICompareProps): React.JSX.Element | null;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.APICompare = APICompare;
7
+ function _react() {
8
+ const data = _interopRequireDefault(require("react"));
9
+ _react = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _componentUiComponentCompare() {
15
+ const data = require("@teambit/component.ui.component-compare.context");
16
+ _componentUiComponentCompare = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _semanticsUi() {
22
+ const data = require("@teambit/semantics.ui.api-diff-view");
23
+ _semanticsUi = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _apiCompareModule() {
29
+ const data = _interopRequireDefault(require("./api-compare.module.scss"));
30
+ _apiCompareModule = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
36
+ // single source of truth for the API diff model lives in api-diff-view.
37
+
38
+ /**
39
+ * the API tab of the single-component compare page. thin host around the same
40
+ * `ComponentApiDiffSection` the lane-compare API view uses — one implementation, two hosts.
41
+ * data comes from the compare context (fetched once by ComponentCompare).
42
+ */
43
+ function APICompare({
44
+ getInsights
45
+ }) {
46
+ const compareContext = (0, _componentUiComponentCompare().useComponentCompare)();
47
+ const baseModel = compareContext?.base?.model;
48
+ const compareModel = compareContext?.compare?.model;
49
+
50
+ // Prefer a diff already on the context — the legacy `ComponentCompare` fetches it once and sets
51
+ // it there. The redesign single-component page does NOT put it on its inline context, so we fetch
52
+ // on our own. This hook is only mounted when the API view is the active tab (the page renders the
53
+ // element on-demand), so lane-compare — which renders one panel per component and never mounts
54
+ // this tab — pays nothing.
55
+ const contextApiDiff = compareContext?.apiDiffResult;
56
+ const shouldSelfFetch = contextApiDiff === undefined;
57
+ const {
58
+ result: fetchedApiDiff
59
+ } = (0, _semanticsUi().useApiDiff)(baseModel?.id.toString(), compareModel?.id.toString(), {
60
+ skip: !shouldSelfFetch
61
+ });
62
+ const apiDiffResult = shouldSelfFetch ? fetchedApiDiff : contextApiDiff;
63
+
64
+ // memoized so the insights context value keeps a stable identity — otherwise a fresh array every
65
+ // render would re-render every `useApiDiffInsights` consumer (incl. the React.memo'd ApiChangeBlock).
66
+ const insights = _react().default.useMemo(() => getInsights?.(), [getInsights]);
67
+ if (!compareContext) return null;
68
+ const id = (compareModel || baseModel)?.id;
69
+ if (!id) return null;
70
+ const componentIdStr = id.toStringWithoutVersion();
71
+ const baseVersion = baseModel?.id.version;
72
+ const compareVersion = compareModel?.id.version;
73
+
74
+ // no base (first version) or identical versions — nothing to diff, not a failure.
75
+ const nothingToCompare = apiDiffResult === null && (!baseVersion || baseVersion === compareVersion);
76
+ return /*#__PURE__*/_react().default.createElement(_semanticsUi().ApiDiffInsightProvider, {
77
+ insights: insights
78
+ }, /*#__PURE__*/_react().default.createElement("div", {
79
+ className: _apiCompareModule().default.apiCompareContainer
80
+ }, nothingToCompare ? /*#__PURE__*/_react().default.createElement(_semanticsUi().ApiDiffSlimRow, {
81
+ componentIdStr: componentIdStr,
82
+ displayName: id.fullName,
83
+ chip: "nothing to compare",
84
+ detail: baseVersion ? 'both sides are the same version' : 'no base version to compare against',
85
+ tone: "ok"
86
+ }) : /*#__PURE__*/_react().default.createElement(_semanticsUi().ComponentApiDiffSection, {
87
+ componentIdStr: componentIdStr,
88
+ displayName: id.fullName,
89
+ baseId: baseModel?.id.toString(),
90
+ compareId: compareModel?.id.toString(),
91
+ baseVersion: baseVersion,
92
+ compareVersion: compareVersion,
93
+ result: apiDiffResult,
94
+ loading: apiDiffResult === undefined
95
+ })));
96
+ }
97
+
98
+ //# sourceMappingURL=api-compare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","data","_interopRequireDefault","require","_componentUiComponentCompare","_semanticsUi","_apiCompareModule","e","__esModule","default","APICompare","getInsights","compareContext","useComponentCompare","baseModel","base","model","compareModel","compare","contextApiDiff","apiDiffResult","shouldSelfFetch","undefined","result","fetchedApiDiff","useApiDiff","id","toString","skip","insights","React","useMemo","componentIdStr","toStringWithoutVersion","baseVersion","version","compareVersion","nothingToCompare","createElement","ApiDiffInsightProvider","className","styles","apiCompareContainer","ApiDiffSlimRow","displayName","fullName","chip","detail","tone","ComponentApiDiffSection","baseId","compareId","loading"],"sources":["api-compare.tsx"],"sourcesContent":["import React from 'react';\nimport { useComponentCompare } from '@teambit/component.ui.component-compare.context';\nimport {\n ComponentApiDiffSection,\n ApiDiffSlimRow,\n ApiDiffInsightProvider,\n useApiDiff,\n} from '@teambit/semantics.ui.api-diff-view';\nimport type { ApiDiffInsight } from '@teambit/semantics.ui.api-diff-view';\nimport styles from './api-compare.module.scss';\n\n// single source of truth for the API diff model lives in api-diff-view.\nexport type { APIDiffResult, APIDiffChange, APIDiffDetail } from '@teambit/semantics.ui.api-diff-view';\n\nexport type APICompareProps = {\n /** resolved lazily at render time — slot registrations can land after the section is constructed */\n getInsights?: () => ApiDiffInsight[];\n};\n\n/**\n * the API tab of the single-component compare page. thin host around the same\n * `ComponentApiDiffSection` the lane-compare API view uses — one implementation, two hosts.\n * data comes from the compare context (fetched once by ComponentCompare).\n */\nexport function APICompare({ getInsights }: APICompareProps) {\n const compareContext = useComponentCompare();\n const baseModel = compareContext?.base?.model;\n const compareModel = compareContext?.compare?.model;\n\n // Prefer a diff already on the context — the legacy `ComponentCompare` fetches it once and sets\n // it there. The redesign single-component page does NOT put it on its inline context, so we fetch\n // on our own. This hook is only mounted when the API view is the active tab (the page renders the\n // element on-demand), so lane-compare — which renders one panel per component and never mounts\n // this tab — pays nothing.\n const contextApiDiff = compareContext?.apiDiffResult;\n const shouldSelfFetch = contextApiDiff === undefined;\n const { result: fetchedApiDiff } = useApiDiff(baseModel?.id.toString(), compareModel?.id.toString(), {\n skip: !shouldSelfFetch,\n });\n const apiDiffResult = shouldSelfFetch ? fetchedApiDiff : contextApiDiff;\n\n // memoized so the insights context value keeps a stable identity — otherwise a fresh array every\n // render would re-render every `useApiDiffInsights` consumer (incl. the React.memo'd ApiChangeBlock).\n const insights = React.useMemo(() => getInsights?.(), [getInsights]);\n\n if (!compareContext) return null;\n\n const id = (compareModel || baseModel)?.id;\n if (!id) return null;\n\n const componentIdStr = id.toStringWithoutVersion();\n const baseVersion = baseModel?.id.version;\n const compareVersion = compareModel?.id.version;\n\n // no base (first version) or identical versions — nothing to diff, not a failure.\n const nothingToCompare = apiDiffResult === null && (!baseVersion || baseVersion === compareVersion);\n\n return (\n <ApiDiffInsightProvider insights={insights}>\n <div className={styles.apiCompareContainer}>\n {nothingToCompare ? (\n <ApiDiffSlimRow\n componentIdStr={componentIdStr}\n displayName={id.fullName}\n chip=\"nothing to compare\"\n detail={baseVersion ? 'both sides are the same version' : 'no base version to compare against'}\n tone=\"ok\"\n />\n ) : (\n <ComponentApiDiffSection\n componentIdStr={componentIdStr}\n displayName={id.fullName}\n baseId={baseModel?.id.toString()}\n compareId={compareModel?.id.toString()}\n baseVersion={baseVersion}\n compareVersion={compareVersion}\n result={apiDiffResult}\n loading={apiDiffResult === undefined}\n />\n )}\n </div>\n </ApiDiffInsightProvider>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,6BAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,4BAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAK,kBAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,iBAAA,YAAAA,C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,YAAY,EAAES,EAAE,CAACS,OAAO;;EAE/C;EACA,MAAME,gBAAgB,GAAGjB,aAAa,KAAK,IAAI,KAAK,CAACc,WAAW,IAAIA,WAAW,KAAKE,cAAc,CAAC;EAEnG,oBACEpC,MAAA,GAAAS,OAAA,CAAA6B,aAAA,CAACjC,YAAA,GAAAkC,sBAAsB;IAACV,QAAQ,EAAEA;EAAS,gBACzC7B,MAAA,GAAAS,OAAA,CAAA6B,aAAA;IAAKE,SAAS,EAAEC,2BAAM,CAACC;EAAoB,GACxCL,gBAAgB,gBACfrC,MAAA,GAAAS,OAAA,CAAA6B,aAAA,CAACjC,YAAA,GAAAsC,cAAc;IACbX,cAAc,EAAEA,cAAe;IAC/BY,WAAW,EAAElB,EAAE,CAACmB,QAAS;IACzBC,IAAI,EAAC,oBAAoB;IACzBC,MAAM,EAAEb,WAAW,GAAG,iCAAiC,GAAG,oCAAqC;IAC/Fc,IAAI,EAAC;EAAI,CACV,CAAC,gBAEFhD,MAAA,GAAAS,OAAA,CAAA6B,aAAA,CAACjC,YAAA,GAAA4C,uBAAuB;IACtBjB,cAAc,EAAEA,cAAe;IAC/BY,WAAW,EAAElB,EAAE,CAACmB,QAAS;IACzBK,MAAM,EAAEpC,SAAS,EAAEY,EAAE,CAACC,QAAQ,CAAC,CAAE;IACjCwB,SAAS,EAAElC,YAAY,EAAES,EAAE,CAACC,QAAQ,CAAC,CAAE;IACvCO,WAAW,EAAEA,WAAY;IACzBE,cAAc,EAAEA,cAAe;IAC/Bb,MAAM,EAAEH,aAAc;IACtBgC,OAAO,EAAEhC,aAAa,KAAKE;EAAU,CACtC,CAEA,CACiB,CAAC;AAE7B","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ .apiCompareContainer {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+ overflow: auto;
6
+ padding: 16px 24px;
7
+ max-width: 980px;
8
+ }
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import type { Section } from '@teambit/component';
3
+ import type { TabItem } from '@teambit/component.ui.component-compare.models.component-compare-props';
4
+ import type { ChangeType } from '@teambit/component.ui.component-compare.models.component-compare-change-type';
5
+ import type { ApiDiffInsight } from '@teambit/semantics.ui.api-diff-view';
6
+ export declare class APICompareSection implements TabItem, Section {
7
+ route: {
8
+ path: string;
9
+ element: React.ReactNode;
10
+ };
11
+ constructor(getInsights?: () => ApiDiffInsight[]);
12
+ navigationLink: {
13
+ href: string;
14
+ children: string;
15
+ };
16
+ props: {
17
+ href: string;
18
+ children: string;
19
+ };
20
+ order: number;
21
+ changeType: ChangeType;
22
+ id: string;
23
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.APICompareSection = void 0;
7
+ function _react() {
8
+ const data = _interopRequireDefault(require("react"));
9
+ _react = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _apiCompare() {
15
+ const data = require("./api-compare");
16
+ _apiCompare = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
23
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
24
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
25
+ // Use string cast since the external ChangeType enum doesn't have API yet
26
+ const ChangeTypeAPI = 'API';
27
+ class APICompareSection {
28
+ constructor(getInsights) {
29
+ _defineProperty(this, "route", void 0);
30
+ _defineProperty(this, "navigationLink", {
31
+ href: 'api',
32
+ children: 'API'
33
+ });
34
+ _defineProperty(this, "props", this.navigationLink);
35
+ _defineProperty(this, "order", 15);
36
+ _defineProperty(this, "changeType", ChangeTypeAPI);
37
+ _defineProperty(this, "id", 'api');
38
+ // built in the constructor (not a field initializer) so the element captures the
39
+ // getter regardless of class-field initialization order.
40
+ this.route = {
41
+ path: 'api/*',
42
+ element: /*#__PURE__*/_react().default.createElement(_apiCompare().APICompare, {
43
+ getInsights: getInsights
44
+ })
45
+ };
46
+ }
47
+ }
48
+ exports.APICompareSection = APICompareSection;
49
+
50
+ //# sourceMappingURL=api-compare.section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","data","_interopRequireDefault","require","_apiCompare","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ChangeTypeAPI","APICompareSection","constructor","getInsights","href","children","navigationLink","route","path","element","createElement","APICompare","exports"],"sources":["api-compare.section.tsx"],"sourcesContent":["import React from 'react';\nimport type { Section } from '@teambit/component';\nimport type { TabItem } from '@teambit/component.ui.component-compare.models.component-compare-props';\nimport type { ChangeType } from '@teambit/component.ui.component-compare.models.component-compare-change-type';\nimport type { ApiDiffInsight } from '@teambit/semantics.ui.api-diff-view';\nimport { APICompare } from './api-compare';\n\n// Use string cast since the external ChangeType enum doesn't have API yet\nconst ChangeTypeAPI = 'API' as unknown as ChangeType;\n\nexport class APICompareSection implements TabItem, Section {\n route: { path: string; element: React.ReactNode };\n\n constructor(getInsights?: () => ApiDiffInsight[]) {\n // built in the constructor (not a field initializer) so the element captures the\n // getter regardless of class-field initialization order.\n this.route = {\n path: 'api/*',\n element: <APICompare getInsights={getInsights} />,\n };\n }\n\n navigationLink = {\n href: 'api',\n children: 'API',\n };\n\n props = this.navigationLink;\n\n order = 15;\n changeType = ChangeTypeAPI;\n id = 'api';\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,C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B,eAAA,gBAEO,IAAI,CAACwB,cAAc;IAAAxB,eAAA,gBAEnB,EAAE;IAAAA,eAAA,qBACGkB,aAAa;IAAAlB,eAAA,aACrB,KAAK;IAjBR;IACA;IACA,IAAI,CAACyB,KAAK,GAAG;MACXC,IAAI,EAAE,OAAO;MACbC,OAAO,eAAEnC,MAAA,GAAAO,OAAA,CAAA6B,aAAA,CAAChC,WAAA,GAAAiC,UAAU;QAACR,WAAW,EAAEA;MAAY,CAAE;IAClD,CAAC;EACH;AAYF;AAACS,OAAA,CAAAX,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,9 +1,11 @@
1
+ import React from 'react';
1
2
  import type { ComponentUI } from '@teambit/component';
2
3
  import type { Harmony, SlotRegistry } from '@teambit/harmony';
3
4
  import type { APINodeRenderer } from '@teambit/api-reference.models.api-node-renderer';
4
5
  import type { SchemaNodeConstructor } from '@teambit/semantics.entities.semantic-schema';
5
6
  import type { CodeUI } from '@teambit/code';
6
7
  import type { WorkspaceUI } from '@teambit/workspace';
8
+ import type { ComponentCompareUI } from '@teambit/component-compare';
7
9
  export type APINodeRendererSlot = SlotRegistry<APINodeRenderer[]>;
8
10
  export declare class APIReferenceUI {
9
11
  private host;
@@ -14,10 +16,10 @@ export declare class APIReferenceUI {
14
16
  static dependencies: import("@teambit/harmony").Aspect[];
15
17
  static runtime: import("@teambit/harmony").RuntimeDefinition;
16
18
  static slots: ((registerFn: () => string) => SlotRegistry<APINodeRenderer[]>)[];
17
- getAPIPage(): import("react/jsx-runtime").JSX.Element;
19
+ getAPIPage(): React.JSX.Element;
18
20
  TaggedAPIPage: ({ componentId }: {
19
21
  componentId: string;
20
- }) => import("react/jsx-runtime").JSX.Element;
22
+ }) => React.JSX.Element;
21
23
  /**
22
24
  * @deprecated use registerSchemaClasses instead
23
25
  * registerSchemaClasses is better for performance as it lazy-loads the schemas.
@@ -26,6 +28,6 @@ export declare class APIReferenceUI {
26
28
  registerSchemaClasses(getSchemas: () => SchemaNodeConstructor[]): void;
27
29
  registerAPINodeRenderer(apiNodeRenderers: APINodeRenderer[]): void;
28
30
  apiNodeRenderers: APINodeRenderer[];
29
- static provider([componentUI, codeUI, workspaceUI]: [ComponentUI, CodeUI, WorkspaceUI], _: any, [apiNodeRendererSlot]: [APINodeRendererSlot], harmony: Harmony): Promise<APIReferenceUI>;
31
+ static provider([componentUI, codeUI, workspaceUI, componentCompareUI]: [ComponentUI, CodeUI, WorkspaceUI, ComponentCompareUI], _: any, [apiNodeRendererSlot]: [APINodeRendererSlot], harmony: Harmony): Promise<APIReferenceUI>;
30
32
  }
31
33
  export default APIReferenceUI;
@@ -95,6 +95,13 @@ function _workspace() {
95
95
  };
96
96
  return data;
97
97
  }
98
+ function _componentCompare() {
99
+ const data = require("@teambit/component-compare");
100
+ _componentCompare = function () {
101
+ return data;
102
+ };
103
+ return data;
104
+ }
98
105
  function _apiReference() {
99
106
  const data = require("./api-reference.aspect");
100
107
  _apiReference = function () {
@@ -102,6 +109,13 @@ function _apiReference() {
102
109
  };
103
110
  return data;
104
111
  }
112
+ function _apiCompare() {
113
+ const data = require("./api-compare.section");
114
+ _apiCompare = function () {
115
+ return data;
116
+ };
117
+ return data;
118
+ }
105
119
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
106
120
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
107
121
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
@@ -144,7 +158,7 @@ class APIReferenceUI {
144
158
  registerAPINodeRenderer(apiNodeRenderers) {
145
159
  this.apiNodeRendererSlot.register(apiNodeRenderers);
146
160
  }
147
- static async provider([componentUI, codeUI, workspaceUI], _, [apiNodeRendererSlot], harmony) {
161
+ static async provider([componentUI, codeUI, workspaceUI, componentCompareUI], _, [apiNodeRendererSlot], harmony) {
148
162
  const {
149
163
  config
150
164
  } = harmony;
@@ -156,11 +170,17 @@ class APIReferenceUI {
156
170
  componentUI.registerRoute(apiReferenceSection.route);
157
171
  // register all default schema classes
158
172
  apiReferenceUI.registerSchemaClasses(() => Object.values(_semanticsEntities().Schemas));
173
+
174
+ // register API compare tab in component compare. insights are resolved lazily —
175
+ // aspects can register them on componentCompareUI after this provider runs.
176
+ const apiCompareSection = new (_apiCompare().APICompareSection)(() => componentCompareUI.getApiDiffInsights());
177
+ componentCompareUI.registerNavigation(apiCompareSection);
178
+ componentCompareUI.registerRoutes([apiCompareSection.route]);
159
179
  return apiReferenceUI;
160
180
  }
161
181
  }
162
182
  exports.APIReferenceUI = APIReferenceUI;
163
- _defineProperty(APIReferenceUI, "dependencies", [_component().ComponentAspect, _code().CodeAspect, _workspace().WorkspaceAspect]);
183
+ _defineProperty(APIReferenceUI, "dependencies", [_component().ComponentAspect, _code().CodeAspect, _workspace().WorkspaceAspect, _componentCompare().ComponentCompareAspect]);
164
184
  _defineProperty(APIReferenceUI, "runtime", _ui().UIRuntime);
165
185
  _defineProperty(APIReferenceUI, "slots", [_harmony().Slot.withType()]);
166
186
  var _default = exports.default = APIReferenceUI;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","data","_interopRequireDefault","require","_lodash","_component","_ui","_apiReferenceSections","_apiReferenceSections2","_harmony","_apiReferenceRenderers","_apiReferenceHooks","_semanticsEntities","_code","_taggedExports","_workspace","_apiReference","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","APIReferenceUI","constructor","host","apiNodeRendererSlot","code","workspace","componentId","createElement","APIRefRenderersProvider","nodeRenderers","flatten","values","TaggedExports","showBanner","Boolean","defaultNodeRenderers","getAPIPage","EditorProvider","getCodeEditorProvider","APIRefPage","rendererSlot","registerSchemaClass","schema","SchemaRegistry","register","registerSchemaClasses","getSchemas","registerGetSchemas","registerAPINodeRenderer","apiNodeRenderers","provider","componentUI","codeUI","workspaceUI","_","harmony","config","get","apiReferenceUI","apiReferenceSection","APIRefSection","registerNavigation","navigationLink","order","registerRoute","route","Schemas","exports","ComponentAspect","CodeAspect","WorkspaceAspect","UIRuntime","Slot","withType","_default","APIReferenceAspect","addRuntime"],"sources":["api-reference.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { flatten } from 'lodash';\nimport type { ComponentUI } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport { UIRuntime } from '@teambit/ui';\nimport { APIRefPage } from '@teambit/api-reference.sections.api-reference-page';\nimport { APIRefSection } from '@teambit/api-reference.sections.api-reference-section';\nimport type { Harmony, SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport type { APINodeRenderer } from '@teambit/api-reference.models.api-node-renderer';\nimport { defaultNodeRenderers } from '@teambit/api-reference.renderers.default-node-renderers';\nimport { APIRefRenderersProvider } from '@teambit/api-reference.hooks.use-api-renderers';\nimport type { SchemaNodeConstructor } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaRegistry, Schemas } from '@teambit/semantics.entities.semantic-schema';\nimport type { CodeUI } from '@teambit/code';\nimport { CodeAspect } from '@teambit/code';\nimport { TaggedExports } from '@teambit/tagged-exports';\nimport type { WorkspaceUI } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\n\nimport { APIReferenceAspect } from './api-reference.aspect';\n\nexport type APINodeRendererSlot = SlotRegistry<APINodeRenderer[]>;\nexport class APIReferenceUI {\n constructor(\n private host: string,\n private apiNodeRendererSlot: APINodeRendererSlot,\n private code: CodeUI,\n private workspace: WorkspaceUI\n ) {}\n\n static dependencies = [ComponentAspect, CodeAspect, WorkspaceAspect];\n static runtime = UIRuntime;\n static slots = [Slot.withType<APINodeRenderer[]>()];\n\n getAPIPage() {\n const EditorProvider = this.code.getCodeEditorProvider();\n return (\n <EditorProvider>\n <APIRefPage host={this.host} rendererSlot={this.apiNodeRendererSlot} />\n </EditorProvider>\n );\n }\n\n TaggedAPIPage = ({ componentId }: { componentId: string }) => {\n return (\n <APIRefRenderersProvider nodeRenderers={flatten(this.apiNodeRendererSlot.values())}>\n <TaggedExports componentId={componentId} showBanner={Boolean(this.workspace)} />\n </APIRefRenderersProvider>\n );\n };\n\n /**\n * @deprecated use registerSchemaClasses instead\n * registerSchemaClasses is better for performance as it lazy-loads the schemas.\n */\n registerSchemaClass(schema: SchemaNodeConstructor) {\n SchemaRegistry.register(schema);\n }\n\n registerSchemaClasses(getSchemas: () => SchemaNodeConstructor[]) {\n SchemaRegistry.registerGetSchemas(getSchemas);\n }\n\n registerAPINodeRenderer(apiNodeRenderers: APINodeRenderer[]) {\n this.apiNodeRendererSlot.register(apiNodeRenderers);\n }\n\n apiNodeRenderers: APINodeRenderer[] = defaultNodeRenderers;\n\n static async provider(\n [componentUI, codeUI, workspaceUI]: [ComponentUI, CodeUI, WorkspaceUI],\n _,\n [apiNodeRendererSlot]: [APINodeRendererSlot],\n harmony: Harmony\n ) {\n const { config } = harmony;\n const host = String(config.get('teambit.harmony/bit'));\n const apiReferenceUI = new APIReferenceUI(host, apiNodeRendererSlot, codeUI, workspaceUI);\n apiReferenceUI.registerAPINodeRenderer(apiReferenceUI.apiNodeRenderers);\n const apiReferenceSection = new APIRefSection(apiReferenceUI);\n componentUI.registerNavigation(apiReferenceSection.navigationLink, apiReferenceSection.order);\n componentUI.registerRoute(apiReferenceSection.route);\n // register all default schema classes\n apiReferenceUI.registerSchemaClasses(() => Object.values(Schemas));\n\n return apiReferenceUI;\n }\n}\n\nexport default APIReferenceUI;\n\nAPIReferenceAspect.addRuntime(APIReferenceUI);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC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","data","_interopRequireDefault","require","_lodash","_component","_ui","_apiReferenceSections","_apiReferenceSections2","_harmony","_apiReferenceRenderers","_apiReferenceHooks","_semanticsEntities","_code","_taggedExports","_workspace","_componentCompare","_apiReference","_apiCompare","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","APIReferenceUI","constructor","host","apiNodeRendererSlot","code","workspace","componentId","createElement","APIRefRenderersProvider","nodeRenderers","flatten","values","TaggedExports","showBanner","Boolean","defaultNodeRenderers","getAPIPage","EditorProvider","getCodeEditorProvider","APIRefPage","rendererSlot","registerSchemaClass","schema","SchemaRegistry","register","registerSchemaClasses","getSchemas","registerGetSchemas","registerAPINodeRenderer","apiNodeRenderers","provider","componentUI","codeUI","workspaceUI","componentCompareUI","_","harmony","config","get","apiReferenceUI","apiReferenceSection","APIRefSection","registerNavigation","navigationLink","order","registerRoute","route","Schemas","apiCompareSection","APICompareSection","getApiDiffInsights","registerRoutes","exports","ComponentAspect","CodeAspect","WorkspaceAspect","ComponentCompareAspect","UIRuntime","Slot","withType","_default","APIReferenceAspect","addRuntime"],"sources":["api-reference.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { flatten } from 'lodash';\nimport type { ComponentUI } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport { UIRuntime } from '@teambit/ui';\nimport { APIRefPage } from '@teambit/api-reference.sections.api-reference-page';\nimport { APIRefSection } from '@teambit/api-reference.sections.api-reference-section';\nimport type { Harmony, SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport type { APINodeRenderer } from '@teambit/api-reference.models.api-node-renderer';\nimport { defaultNodeRenderers } from '@teambit/api-reference.renderers.default-node-renderers';\nimport { APIRefRenderersProvider } from '@teambit/api-reference.hooks.use-api-renderers';\nimport type { SchemaNodeConstructor } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaRegistry, Schemas } from '@teambit/semantics.entities.semantic-schema';\nimport type { CodeUI } from '@teambit/code';\nimport { CodeAspect } from '@teambit/code';\nimport { TaggedExports } from '@teambit/tagged-exports';\nimport type { WorkspaceUI } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { ComponentCompareUI } from '@teambit/component-compare';\nimport { ComponentCompareAspect } from '@teambit/component-compare';\n\nimport { APIReferenceAspect } from './api-reference.aspect';\nimport { APICompareSection } from './api-compare.section';\n\nexport type APINodeRendererSlot = SlotRegistry<APINodeRenderer[]>;\nexport class APIReferenceUI {\n constructor(\n private host: string,\n private apiNodeRendererSlot: APINodeRendererSlot,\n private code: CodeUI,\n private workspace: WorkspaceUI\n ) {}\n\n static dependencies = [ComponentAspect, CodeAspect, WorkspaceAspect, ComponentCompareAspect];\n static runtime = UIRuntime;\n static slots = [Slot.withType<APINodeRenderer[]>()];\n\n getAPIPage() {\n const EditorProvider = this.code.getCodeEditorProvider();\n return (\n <EditorProvider>\n <APIRefPage host={this.host} rendererSlot={this.apiNodeRendererSlot} />\n </EditorProvider>\n );\n }\n\n TaggedAPIPage = ({ componentId }: { componentId: string }) => {\n return (\n <APIRefRenderersProvider nodeRenderers={flatten(this.apiNodeRendererSlot.values())}>\n <TaggedExports componentId={componentId} showBanner={Boolean(this.workspace)} />\n </APIRefRenderersProvider>\n );\n };\n\n /**\n * @deprecated use registerSchemaClasses instead\n * registerSchemaClasses is better for performance as it lazy-loads the schemas.\n */\n registerSchemaClass(schema: SchemaNodeConstructor) {\n SchemaRegistry.register(schema);\n }\n\n registerSchemaClasses(getSchemas: () => SchemaNodeConstructor[]) {\n SchemaRegistry.registerGetSchemas(getSchemas);\n }\n\n registerAPINodeRenderer(apiNodeRenderers: APINodeRenderer[]) {\n this.apiNodeRendererSlot.register(apiNodeRenderers);\n }\n\n apiNodeRenderers: APINodeRenderer[] = defaultNodeRenderers;\n\n static async provider(\n [componentUI, codeUI, workspaceUI, componentCompareUI]: [ComponentUI, CodeUI, WorkspaceUI, ComponentCompareUI],\n _,\n [apiNodeRendererSlot]: [APINodeRendererSlot],\n harmony: Harmony\n ) {\n const { config } = harmony;\n const host = String(config.get('teambit.harmony/bit'));\n const apiReferenceUI = new APIReferenceUI(host, apiNodeRendererSlot, codeUI, workspaceUI);\n apiReferenceUI.registerAPINodeRenderer(apiReferenceUI.apiNodeRenderers);\n const apiReferenceSection = new APIRefSection(apiReferenceUI);\n componentUI.registerNavigation(apiReferenceSection.navigationLink, apiReferenceSection.order);\n componentUI.registerRoute(apiReferenceSection.route);\n // register all default schema classes\n apiReferenceUI.registerSchemaClasses(() => Object.values(Schemas));\n\n // register API compare tab in component compare. insights are resolved lazily —\n // aspects can register them on componentCompareUI after this provider runs.\n const apiCompareSection = new APICompareSection(() => componentCompareUI.getApiDiffInsights());\n componentCompareUI.registerNavigation(apiCompareSection);\n componentCompareUI.registerRoutes([apiCompareSection.route]);\n\n return apiReferenceUI;\n }\n}\n\nexport default APIReferenceUI;\n\nAPIReferenceAspect.addRuntime(APIReferenceUI);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,IAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,GAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,sBAAA;EAAA,MAAAN,IAAA,GAAAE,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,CAAoB,CAAC,CAAC;AAAA,IAAAC,QAAA,GAAAR,OAAA,CAAAvE,OAAA,GA+DtCmB,cAAc;AAE7B6D,kCAAkB,CAACC,UAAU,CAAC9D,cAAc,CAAC","ignoreList":[]}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { APIReferenceAspect } from './api-reference.aspect';
2
2
  export type { APIReferenceUI, APINodeRendererSlot } from './api-reference.ui.runtime';
3
+ export { APICompare } from './api-compare';
4
+ export type { APIDiffResult, APIDiffChange, APIDiffDetail } from './api-compare';
3
5
  export default APIReferenceAspect;
4
6
  export { APIReferenceAspect };
package/dist/index.js CHANGED
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "APICompare", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _apiCompare().APICompare;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "APIReferenceAspect", {
7
13
  enumerable: true,
8
14
  get: function () {
@@ -17,6 +23,13 @@ function _apiReference() {
17
23
  };
18
24
  return data;
19
25
  }
26
+ function _apiCompare() {
27
+ const data = require("./api-compare");
28
+ _apiCompare = function () {
29
+ return data;
30
+ };
31
+ return data;
32
+ }
20
33
  var _default = exports.default = _apiReference().APIReferenceAspect;
21
34
 
22
35
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_apiReference","data","require","_default","exports","default","APIReferenceAspect"],"sources":["index.ts"],"sourcesContent":["import { APIReferenceAspect } from './api-reference.aspect';\n\nexport type { APIReferenceUI, APINodeRendererSlot } from './api-reference.ui.runtime';\nexport default APIReferenceAspect;\nexport { APIReferenceAspect };\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,cAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,aAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4D,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAG7CC,kCAAkB","ignoreList":[]}
1
+ {"version":3,"names":["_apiReference","data","require","_apiCompare","_default","exports","default","APIReferenceAspect"],"sources":["index.ts"],"sourcesContent":["import { APIReferenceAspect } from './api-reference.aspect';\n\nexport type { APIReferenceUI, APINodeRendererSlot } from './api-reference.ui.runtime';\nexport { APICompare } from './api-compare';\nexport type { APIDiffResult, APIDiffChange, APIDiffDetail } from './api-compare';\nexport default APIReferenceAspect;\nexport { APIReferenceAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAAA,cAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,aAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE5BC,kCAAkB","ignoreList":[]}
package/package.json CHANGED
@@ -1,42 +1,47 @@
1
1
  {
2
2
  "name": "@teambit/api-reference",
3
- "version": "0.0.0-ec02bcceb773fbb5fbe9cb57fe55bee80ac065af",
3
+ "version": "0.0.0-ec16a1dc785bea559c02a98eae627283f313449c",
4
4
  "homepage": "https://bit.cloud/teambit/api-reference/api-reference",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.api-reference",
8
8
  "name": "api-reference",
9
- "version": "ec02bcceb773fbb5fbe9cb57fe55bee80ac065af"
9
+ "version": "ec16a1dc785bea559c02a98eae627283f313449c"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.17.21",
13
- "@teambit/harmony": "0.4.7",
14
- "@teambit/api-reference.hooks.use-api-renderers": "0.0.36",
15
- "@teambit/api-reference.models.api-node-renderer": "0.0.52",
16
- "@teambit/api-reference.renderers.default-node-renderers": "0.0.1",
17
- "@teambit/api-reference.sections.api-reference-page": "0.0.119",
13
+ "@teambit/component.ui.component-compare.models.component-compare-change-type": "0.0.7",
14
+ "@teambit/component.ui.component-compare.models.component-compare-props": "0.0.133",
15
+ "@teambit/semantics.ui.api-diff-view": "0.0.3",
16
+ "@teambit/component.ui.component-compare.context": "0.0.128",
17
+ "@teambit/harmony": "0.4.12",
18
+ "@teambit/api-reference.hooks.use-api-renderers": "0.0.37",
19
+ "@teambit/api-reference.models.api-node-renderer": "0.0.53",
20
+ "@teambit/api-reference.renderers.default-node-renderers": "0.0.23",
18
21
  "@teambit/api-reference.sections.api-reference-section": "0.0.16",
19
- "@teambit/semantics.entities.semantic-schema": "0.0.94",
20
- "@teambit/tagged-exports": "0.0.47",
21
- "@teambit/code": "0.0.0-d93de6267aff9a91590499542021cbc0f85bbd65",
22
- "@teambit/component": "0.0.0-af18bd977d4e871113e6b935ceae6c54573e7a91",
23
- "@teambit/ui": "0.0.0-af3160c46fd7f9ced392b9b4b7bdc778e59aa97b",
24
- "@teambit/workspace": "0.0.0-7b56564a43d23a0637e46961bf660b9164964341"
22
+ "@teambit/semantics.entities.semantic-schema": "0.0.113",
23
+ "@teambit/tagged-exports": "0.0.53",
24
+ "@teambit/api-reference.sections.api-reference-page": "0.0.120",
25
+ "@teambit/component": "0.0.0-d9ac5d7f03cf553d9d48b2c1b353e694df6555b5",
26
+ "@teambit/code": "0.0.0-eae2981019fe49e5dd5e741a80854b20a110ae17",
27
+ "@teambit/component-compare": "0.0.0-0f037e278e34f4d65bd5d7d41274a4848b8d76df",
28
+ "@teambit/ui": "0.0.0-6845034072697f7919f98c5c62e88bc862131cdf",
29
+ "@teambit/workspace": "0.0.0-883b2f8c7f58f482d0ef14ff6e6303f3fb109945"
25
30
  },
26
31
  "devDependencies": {
27
32
  "@types/lodash": "4.14.165",
28
33
  "@types/mocha": "9.1.0",
29
- "@teambit/harmony.envs.core-aspect-env": "0.0.79"
34
+ "@teambit/harmony.envs.core-aspect-env": "2.0.6"
30
35
  },
31
36
  "peerDependencies": {
32
- "react": "^17.0.0 || ^18.0.0",
33
- "@types/react": "^17.0.73"
37
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
34
38
  },
35
39
  "license": "Apache-2.0",
36
40
  "optionalDependencies": {},
37
41
  "peerDependenciesMeta": {},
38
42
  "exports": {
39
43
  ".": {
44
+ "types": "./dist/index.d.ts",
40
45
  "node": {
41
46
  "require": "./dist/index.js",
42
47
  "import": "./dist/esm.mjs"
@@ -44,8 +49,7 @@
44
49
  "default": "./dist/index.js"
45
50
  },
46
51
  "./dist/*": "./dist/*",
47
- "./artifacts/*": "./artifacts/*",
48
- "./*": "./*.ts"
52
+ "./artifacts/*": "./artifacts/*"
49
53
  },
50
54
  "private": false,
51
55
  "engines": {
package/types/style.d.ts CHANGED
@@ -40,3 +40,7 @@ declare module '*.mdx' {
40
40
  const component: any;
41
41
  export default component;
42
42
  }
43
+
44
+ // `reset-css` ships only `reset.css` (no `.d.ts`). TS6 refuses bare
45
+ // side-effect imports without declarations, so we declare the module here.
46
+ declare module 'reset-css';