@teambit/changelog 0.0.1082 → 0.0.1083
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/changelog.section.tsx +5 -2
- package/changelog.ui.runtime.tsx +12 -6
- package/dist/changelog.section.d.ts +3 -0
- package/dist/changelog.section.js +3 -9
- package/dist/changelog.section.js.map +1 -1
- package/dist/changelog.ui.runtime.d.ts +6 -2
- package/dist/changelog.ui.runtime.js +20 -6
- package/dist/changelog.ui.runtime.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/{preview-1687177768270.js → preview-1687231140262.js} +2 -2
- package/dist/ui/change-log-page.d.ts +6 -3
- package/dist/ui/change-log-page.js +17 -8
- package/dist/ui/change-log-page.js.map +1 -1
- package/package-tar/teambit-changelog-0.0.1083.tgz +0 -0
- package/package.json +5 -5
- package/ui/change-log-page.tsx +24 -9
- package/package-tar/teambit-changelog-0.0.1082.tgz +0 -0
package/changelog.section.tsx
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Section } from '@teambit/component';
|
|
3
3
|
import { MenuWidgetIcon } from '@teambit/ui-foundation.ui.menu-widget-icon';
|
|
4
|
-
import {
|
|
4
|
+
import { ChangeLogUI } from './changelog.ui.runtime';
|
|
5
5
|
|
|
6
6
|
export class ChangelogSection implements Section {
|
|
7
|
+
constructor(private ui: ChangeLogUI) {}
|
|
8
|
+
|
|
7
9
|
route = {
|
|
8
10
|
path: '~changelog',
|
|
9
|
-
element:
|
|
11
|
+
element: this.ui.ChangeLog(),
|
|
10
12
|
};
|
|
13
|
+
|
|
11
14
|
navigationLink = {
|
|
12
15
|
href: '~changelog',
|
|
13
16
|
children: <MenuWidgetIcon icon="changelog" tooltipContent="Change log" />,
|
package/changelog.ui.runtime.tsx
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { ComponentAspect, ComponentUI } from '@teambit/component';
|
|
2
2
|
import { UIRuntime } from '@teambit/ui';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { Harmony } from '@teambit/harmony';
|
|
4
5
|
|
|
5
6
|
import { ChangelogAspect } from './changelog.aspect';
|
|
6
7
|
import { ChangelogSection } from './changelog.section';
|
|
7
|
-
import { ChangeLogPage } from './ui/change-log-page';
|
|
8
|
+
import { ChangeLogPage, ChangeLogPageProps } from './ui/change-log-page';
|
|
8
9
|
|
|
9
10
|
export class ChangeLogUI {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
constructor(private host: string) {}
|
|
12
|
+
|
|
13
|
+
ChangeLog = (props: ChangeLogPageProps = {}) => {
|
|
14
|
+
return <ChangeLogPage {...props} host={this.host} />;
|
|
12
15
|
};
|
|
13
16
|
|
|
14
17
|
static dependencies = [ComponentAspect];
|
|
15
18
|
|
|
16
19
|
static runtime = UIRuntime;
|
|
17
20
|
|
|
18
|
-
static async provider([component]: [ComponentUI]) {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
+
static async provider([component]: [ComponentUI], _, __, harmony: Harmony) {
|
|
22
|
+
const { config } = harmony;
|
|
23
|
+
const host = String(config.get('teambit.harmony/bit'));
|
|
24
|
+
|
|
25
|
+
const ui = new ChangeLogUI(host);
|
|
26
|
+
const section = new ChangelogSection(ui);
|
|
21
27
|
|
|
22
28
|
component.registerRoute(section.route);
|
|
23
29
|
component.registerWidget(section.navigationLink, section.order);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Section } from '@teambit/component';
|
|
3
|
+
import { ChangeLogUI } from './changelog.ui.runtime';
|
|
3
4
|
export declare class ChangelogSection implements Section {
|
|
5
|
+
private ui;
|
|
6
|
+
constructor(ui: ChangeLogUI);
|
|
4
7
|
route: {
|
|
5
8
|
path: string;
|
|
6
9
|
element: JSX.Element;
|
|
@@ -26,18 +26,12 @@ function _uiFoundationUi() {
|
|
|
26
26
|
};
|
|
27
27
|
return data;
|
|
28
28
|
}
|
|
29
|
-
function _changeLogPage() {
|
|
30
|
-
const data = require("./ui/change-log-page");
|
|
31
|
-
_changeLogPage = function () {
|
|
32
|
-
return data;
|
|
33
|
-
};
|
|
34
|
-
return data;
|
|
35
|
-
}
|
|
36
29
|
class ChangelogSection {
|
|
37
|
-
constructor() {
|
|
30
|
+
constructor(ui) {
|
|
31
|
+
this.ui = ui;
|
|
38
32
|
(0, _defineProperty2().default)(this, "route", {
|
|
39
33
|
path: '~changelog',
|
|
40
|
-
element:
|
|
34
|
+
element: this.ui.ChangeLog()
|
|
41
35
|
});
|
|
42
36
|
(0, _defineProperty2().default)(this, "navigationLink", {
|
|
43
37
|
href: '~changelog',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ChangelogSection","path","element","href","children","displayName"],"sources":["changelog.section.tsx"],"sourcesContent":["import React from 'react';\nimport { Section } from '@teambit/component';\nimport { MenuWidgetIcon } from '@teambit/ui-foundation.ui.menu-widget-icon';\nimport {
|
|
1
|
+
{"version":3,"names":["ChangelogSection","constructor","ui","path","element","ChangeLog","href","children","displayName"],"sources":["changelog.section.tsx"],"sourcesContent":["import React from 'react';\nimport { Section } from '@teambit/component';\nimport { MenuWidgetIcon } from '@teambit/ui-foundation.ui.menu-widget-icon';\nimport { ChangeLogUI } from './changelog.ui.runtime';\n\nexport class ChangelogSection implements Section {\n constructor(private ui: ChangeLogUI) {}\n\n route = {\n path: '~changelog',\n element: this.ui.ChangeLog(),\n };\n\n navigationLink = {\n href: '~changelog',\n children: <MenuWidgetIcon icon=\"changelog\" tooltipContent=\"Change log\" />,\n displayName: 'Change log',\n };\n order = 40;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,gBAAgB,CAAoB;EAC/CC,WAAW,CAASC,EAAe,EAAE;IAAA,KAAjBA,EAAe,GAAfA,EAAe;IAAA,+CAE3B;MACNC,IAAI,EAAE,YAAY;MAClBC,OAAO,EAAE,IAAI,CAACF,EAAE,CAACG,SAAS;IAC5B,CAAC;IAAA,wDAEgB;MACfC,IAAI,EAAE,YAAY;MAClBC,QAAQ,eAAE,+BAAC,gCAAc;QAAC,IAAI,EAAC,WAAW;QAAC,cAAc,EAAC;MAAY,EAAG;MACzEC,WAAW,EAAE;IACf,CAAC;IAAA,+CACO,EAAE;EAZ4B;AAaxC;AAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ComponentUI } from '@teambit/component';
|
|
3
|
+
import { Harmony } from '@teambit/harmony';
|
|
4
|
+
import { ChangeLogPageProps } from './ui/change-log-page';
|
|
3
5
|
export declare class ChangeLogUI {
|
|
4
|
-
|
|
6
|
+
private host;
|
|
7
|
+
constructor(host: string);
|
|
8
|
+
ChangeLog: (props?: ChangeLogPageProps) => JSX.Element;
|
|
5
9
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
6
10
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
7
|
-
static provider([component]: [ComponentUI]): Promise<ChangeLogUI>;
|
|
11
|
+
static provider([component]: [ComponentUI], _: any, __: any, harmony: Harmony): Promise<ChangeLogUI>;
|
|
8
12
|
}
|
|
@@ -7,6 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.ChangeLogUI = void 0;
|
|
10
|
+
function _extends2() {
|
|
11
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
_extends2 = function () {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
10
17
|
function _defineProperty2() {
|
|
11
18
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
19
|
_defineProperty2 = function () {
|
|
@@ -57,14 +64,21 @@ function _changeLogPage() {
|
|
|
57
64
|
return data;
|
|
58
65
|
}
|
|
59
66
|
class ChangeLogUI {
|
|
60
|
-
constructor() {
|
|
61
|
-
|
|
62
|
-
|
|
67
|
+
constructor(host) {
|
|
68
|
+
this.host = host;
|
|
69
|
+
(0, _defineProperty2().default)(this, "ChangeLog", (props = {}) => {
|
|
70
|
+
return /*#__PURE__*/_react().default.createElement(_changeLogPage().ChangeLogPage, (0, _extends2().default)({}, props, {
|
|
71
|
+
host: this.host
|
|
72
|
+
}));
|
|
63
73
|
});
|
|
64
74
|
}
|
|
65
|
-
static async provider([component]) {
|
|
66
|
-
const
|
|
67
|
-
|
|
75
|
+
static async provider([component], _, __, harmony) {
|
|
76
|
+
const {
|
|
77
|
+
config
|
|
78
|
+
} = harmony;
|
|
79
|
+
const host = String(config.get('teambit.harmony/bit'));
|
|
80
|
+
const ui = new ChangeLogUI(host);
|
|
81
|
+
const section = new (_changelog2().ChangelogSection)(ui);
|
|
68
82
|
component.registerRoute(section.route);
|
|
69
83
|
component.registerWidget(section.navigationLink, section.order);
|
|
70
84
|
return ui;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ChangeLogUI","provider","component","ui","section","ChangelogSection","registerRoute","route","registerWidget","navigationLink","order","ComponentAspect","UIRuntime","ChangelogAspect","addRuntime"],"sources":["changelog.ui.runtime.tsx"],"sourcesContent":["import { ComponentAspect, ComponentUI } from '@teambit/component';\nimport { UIRuntime } from '@teambit/ui';\nimport React from 'react';\n\nimport { ChangelogAspect } from './changelog.aspect';\nimport { ChangelogSection } from './changelog.section';\nimport { ChangeLogPage } from './ui/change-log-page';\n\nexport class ChangeLogUI {\n ChangeLog = () => {\n return <ChangeLogPage />;\n };\n\n static dependencies = [ComponentAspect];\n\n static runtime = UIRuntime;\n\n static async provider([component]: [ComponentUI]) {\n const ui = new ChangeLogUI();\n const section = new ChangelogSection();\n\n component.registerRoute(section.route);\n component.registerWidget(section.navigationLink, section.order);\n\n return ui;\n }\n}\n\nChangelogAspect.addRuntime(ChangeLogUI);\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["ChangeLogUI","constructor","host","props","provider","component","_","__","harmony","config","String","get","ui","section","ChangelogSection","registerRoute","route","registerWidget","navigationLink","order","ComponentAspect","UIRuntime","ChangelogAspect","addRuntime"],"sources":["changelog.ui.runtime.tsx"],"sourcesContent":["import { ComponentAspect, ComponentUI } from '@teambit/component';\nimport { UIRuntime } from '@teambit/ui';\nimport React from 'react';\nimport { Harmony } from '@teambit/harmony';\n\nimport { ChangelogAspect } from './changelog.aspect';\nimport { ChangelogSection } from './changelog.section';\nimport { ChangeLogPage, ChangeLogPageProps } from './ui/change-log-page';\n\nexport class ChangeLogUI {\n constructor(private host: string) {}\n\n ChangeLog = (props: ChangeLogPageProps = {}) => {\n return <ChangeLogPage {...props} host={this.host} />;\n };\n\n static dependencies = [ComponentAspect];\n\n static runtime = UIRuntime;\n\n static async provider([component]: [ComponentUI], _, __, harmony: Harmony) {\n const { config } = harmony;\n const host = String(config.get('teambit.harmony/bit'));\n\n const ui = new ChangeLogUI(host);\n const section = new ChangelogSection(ui);\n\n component.registerRoute(section.route);\n component.registerWidget(section.navigationLink, section.order);\n\n return ui;\n }\n}\n\nChangelogAspect.addRuntime(ChangeLogUI);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,WAAW,CAAC;EACvBC,WAAW,CAASC,IAAY,EAAE;IAAA,KAAdA,IAAY,GAAZA,IAAY;IAAA,mDAEpB,CAACC,KAAyB,GAAG,CAAC,CAAC,KAAK;MAC9C,oBAAO,+BAAC,8BAAa,+BAAKA,KAAK;QAAE,IAAI,EAAE,IAAI,CAACD;MAAK,GAAG;IACtD,CAAC;EAJkC;EAUnC,aAAaE,QAAQ,CAAC,CAACC,SAAS,CAAgB,EAAEC,CAAC,EAAEC,EAAE,EAAEC,OAAgB,EAAE;IACzE,MAAM;MAAEC;IAAO,CAAC,GAAGD,OAAO;IAC1B,MAAMN,IAAI,GAAGQ,MAAM,CAACD,MAAM,CAACE,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAEtD,MAAMC,EAAE,GAAG,IAAIZ,WAAW,CAACE,IAAI,CAAC;IAChC,MAAMW,OAAO,GAAG,KAAIC,8BAAgB,EAACF,EAAE,CAAC;IAExCP,SAAS,CAACU,aAAa,CAACF,OAAO,CAACG,KAAK,CAAC;IACtCX,SAAS,CAACY,cAAc,CAACJ,OAAO,CAACK,cAAc,EAAEL,OAAO,CAACM,KAAK,CAAC;IAE/D,OAAOP,EAAE;EACX;AACF;AAAC;AAAA,gCAvBYZ,WAAW,kBAOA,CAACoB,4BAAe,CAAC;AAAA,gCAP5BpB,WAAW,aASLqB,eAAS;AAgB5BC,4BAAe,CAACC,UAAU,CAACvB,WAAW,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ChangelogAspect"],"sources":["index.ts"],"sourcesContent":["import { ChangelogAspect } from './changelog.aspect';\n\nexport type { ChangeLogUI } from './changelog.ui.runtime';\nexport { ChangelogAspect };\nexport default ChangelogAspect;\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAqD,
|
|
1
|
+
{"version":3,"names":["ChangelogAspect"],"sources":["index.ts"],"sourcesContent":["import { ChangelogAspect } from './changelog.aspect';\n\nexport type { ChangeLogPageProps } from './ui/change-log-page';\n\nexport type { ChangeLogUI } from './changelog.ui.runtime';\nexport { ChangelogAspect };\nexport default ChangelogAspect;\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAqD,eAMtCA,4BAAe;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_changelog@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_changelog@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_changelog@0.0.1083/dist/changelog.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_changelog@0.0.1083/dist/changelog.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { ComponentLogsResult, Filters } from '@teambit/component';
|
|
1
2
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
declare type ChangeLogPageProps = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export declare type ChangeLogPageProps = {
|
|
4
|
+
host?: string;
|
|
5
|
+
useComponentLogs?: (id: string, host: string, filters?: Filters, skip?: boolean) => ComponentLogsResult;
|
|
6
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
7
|
+
export declare function ChangeLogPage({ className, useComponentLogs, host, }: ChangeLogPageProps): JSX.Element | null;
|
|
@@ -78,14 +78,22 @@ function _changeLogPageModule() {
|
|
|
78
78
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
79
79
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
80
80
|
function ChangeLogPage({
|
|
81
|
-
className
|
|
81
|
+
className,
|
|
82
|
+
useComponentLogs = _component().useComponentLogs,
|
|
83
|
+
host = ''
|
|
82
84
|
}) {
|
|
83
85
|
const component = (0, _react().useContext)(_component().ComponentContext);
|
|
84
86
|
const {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
loading,
|
|
88
|
+
componentLogs,
|
|
89
|
+
latest,
|
|
90
|
+
id
|
|
91
|
+
} = (useComponentLogs === null || useComponentLogs === void 0 ? void 0 : useComponentLogs(component === null || component === void 0 ? void 0 : component.id.toString(), host, undefined, !component)) || {};
|
|
92
|
+
if (loading || !componentLogs) return null;
|
|
93
|
+
const {
|
|
94
|
+
logs = []
|
|
95
|
+
} = componentLogs;
|
|
96
|
+
if ((logs === null || logs === void 0 ? void 0 : logs.length) === 0) {
|
|
89
97
|
return /*#__PURE__*/_react().default.createElement("div", {
|
|
90
98
|
className: (0, _classnames().default)(_changeLogPageModule().default.changeLogPage, className)
|
|
91
99
|
}, /*#__PURE__*/_react().default.createElement(_documenterUi().H1, {
|
|
@@ -109,11 +117,12 @@ function ChangeLogPage({
|
|
|
109
117
|
}), /*#__PURE__*/_react().default.createElement("div", {
|
|
110
118
|
className: _changeLogPageModule().default.logContainer
|
|
111
119
|
}, logs.map((snap, index) => {
|
|
112
|
-
|
|
113
|
-
const
|
|
120
|
+
var _id$fullName;
|
|
121
|
+
const isLatest = latest === snap.tag || latest === snap.hash;
|
|
122
|
+
const isCurrent = (id === null || id === void 0 ? void 0 : id.version) === snap.tag || (id === null || id === void 0 ? void 0 : id.version) === snap.hash;
|
|
114
123
|
return /*#__PURE__*/_react().default.createElement(_componentUi().VersionBlock, {
|
|
115
124
|
key: index,
|
|
116
|
-
componentId:
|
|
125
|
+
componentId: (_id$fullName = id === null || id === void 0 ? void 0 : id.fullName) !== null && _id$fullName !== void 0 ? _id$fullName : '',
|
|
117
126
|
isLatest: isLatest,
|
|
118
127
|
snap: snap,
|
|
119
128
|
isCurrent: isCurrent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ChangeLogPage","className","component","useContext","ComponentContext","logs","length","classNames","styles","changeLogPage","title","separatorNoChangeLog","changeLogCard","separator","logContainer","map","snap","index","isLatest","
|
|
1
|
+
{"version":3,"names":["ChangeLogPage","className","useComponentLogs","defaultUseComponentLogs","host","component","useContext","ComponentContext","loading","componentLogs","latest","id","toString","undefined","logs","length","classNames","styles","changeLogPage","title","separatorNoChangeLog","changeLogCard","separator","logContainer","map","snap","index","isLatest","tag","hash","isCurrent","version","fullName"],"sources":["change-log-page.tsx"],"sourcesContent":["import {\n ComponentContext,\n useComponentLogs as defaultUseComponentLogs,\n ComponentLogsResult,\n Filters,\n} from '@teambit/component';\nimport { H1 } from '@teambit/documenter.ui.heading';\nimport { Separator } from '@teambit/design.ui.separator';\nimport { VersionBlock } from '@teambit/component.ui.version-block';\nimport classNames from 'classnames';\nimport { MDXLayout } from '@teambit/mdx.ui.mdx-layout';\nimport { ExportingComponents } from '@teambit/component.instructions.exporting-components';\nimport { AlertCard } from '@teambit/design.ui.alert-card';\nimport React, { HTMLAttributes, useContext } from 'react';\n\nimport styles from './change-log-page.module.scss';\n\nexport type ChangeLogPageProps = {\n host?: string;\n useComponentLogs?: (id: string, host: string, filters?: Filters, skip?: boolean) => ComponentLogsResult;\n} & HTMLAttributes<HTMLDivElement>;\n\nexport function ChangeLogPage({\n className,\n useComponentLogs = defaultUseComponentLogs,\n host = '',\n}: ChangeLogPageProps) {\n const component = useContext(ComponentContext);\n const { loading, componentLogs, latest, id } =\n useComponentLogs?.(component?.id.toString(), host, undefined, !component) || {};\n\n if (loading || !componentLogs) return null;\n\n const { logs = [] } = componentLogs;\n\n if (logs?.length === 0) {\n return (\n <div className={classNames(styles.changeLogPage, className)}>\n <H1 className={styles.title}>History</H1>\n <Separator isPresentational className={styles.separatorNoChangeLog} />\n <AlertCard\n level=\"info\"\n title=\"There is no change log as this component has not been exported yet.\n Learn how to export components:\"\n className={styles.changeLogCard}\n >\n <MDXLayout>\n <ExportingComponents />\n </MDXLayout>\n </AlertCard>\n </div>\n );\n }\n\n return (\n <div className={classNames(styles.changeLogPage, className)}>\n <H1 className={styles.title}>History</H1>\n <Separator isPresentational className={styles.separator} />\n <div className={styles.logContainer}>\n {logs.map((snap, index) => {\n const isLatest = latest === snap.tag || latest === snap.hash;\n const isCurrent = id?.version === snap.tag || id?.version === snap.hash;\n return (\n <VersionBlock\n key={index}\n componentId={id?.fullName ?? ''}\n isLatest={isLatest}\n snap={snap}\n isCurrent={isCurrent}\n />\n );\n })}\n </div>\n </div>\n );\n}\n"],"mappings":"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"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/changelog",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1083",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/changelog",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "changelog",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.1083"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"classnames": "2.2.6",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"@teambit/design.ui.alert-card": "0.0.26",
|
|
18
18
|
"@teambit/design.ui.separator": "0.0.354",
|
|
19
19
|
"@teambit/documenter.ui.heading": "4.1.1",
|
|
20
|
-
"@teambit/component": "0.0.
|
|
20
|
+
"@teambit/component": "0.0.1083",
|
|
21
21
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.497",
|
|
22
|
-
"@teambit/ui": "0.0.
|
|
23
|
-
"@teambit/component.ui.version-block": "0.0.
|
|
22
|
+
"@teambit/ui": "0.0.1083",
|
|
23
|
+
"@teambit/component.ui.version-block": "0.0.813",
|
|
24
24
|
"@teambit/mdx.ui.mdx-layout": "0.0.515"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
package/ui/change-log-page.tsx
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ComponentContext,
|
|
3
|
+
useComponentLogs as defaultUseComponentLogs,
|
|
4
|
+
ComponentLogsResult,
|
|
5
|
+
Filters,
|
|
6
|
+
} from '@teambit/component';
|
|
2
7
|
import { H1 } from '@teambit/documenter.ui.heading';
|
|
3
8
|
import { Separator } from '@teambit/design.ui.separator';
|
|
4
9
|
import { VersionBlock } from '@teambit/component.ui.version-block';
|
|
@@ -10,15 +15,25 @@ import React, { HTMLAttributes, useContext } from 'react';
|
|
|
10
15
|
|
|
11
16
|
import styles from './change-log-page.module.scss';
|
|
12
17
|
|
|
13
|
-
type ChangeLogPageProps = {
|
|
18
|
+
export type ChangeLogPageProps = {
|
|
19
|
+
host?: string;
|
|
20
|
+
useComponentLogs?: (id: string, host: string, filters?: Filters, skip?: boolean) => ComponentLogsResult;
|
|
21
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
14
22
|
|
|
15
|
-
export function ChangeLogPage({
|
|
23
|
+
export function ChangeLogPage({
|
|
24
|
+
className,
|
|
25
|
+
useComponentLogs = defaultUseComponentLogs,
|
|
26
|
+
host = '',
|
|
27
|
+
}: ChangeLogPageProps) {
|
|
16
28
|
const component = useContext(ComponentContext);
|
|
17
|
-
const {
|
|
29
|
+
const { loading, componentLogs, latest, id } =
|
|
30
|
+
useComponentLogs?.(component?.id.toString(), host, undefined, !component) || {};
|
|
18
31
|
|
|
19
|
-
if (!
|
|
32
|
+
if (loading || !componentLogs) return null;
|
|
20
33
|
|
|
21
|
-
|
|
34
|
+
const { logs = [] } = componentLogs;
|
|
35
|
+
|
|
36
|
+
if (logs?.length === 0) {
|
|
22
37
|
return (
|
|
23
38
|
<div className={classNames(styles.changeLogPage, className)}>
|
|
24
39
|
<H1 className={styles.title}>History</H1>
|
|
@@ -43,12 +58,12 @@ export function ChangeLogPage({ className }: ChangeLogPageProps) {
|
|
|
43
58
|
<Separator isPresentational className={styles.separator} />
|
|
44
59
|
<div className={styles.logContainer}>
|
|
45
60
|
{logs.map((snap, index) => {
|
|
46
|
-
const isLatest =
|
|
47
|
-
const isCurrent =
|
|
61
|
+
const isLatest = latest === snap.tag || latest === snap.hash;
|
|
62
|
+
const isCurrent = id?.version === snap.tag || id?.version === snap.hash;
|
|
48
63
|
return (
|
|
49
64
|
<VersionBlock
|
|
50
65
|
key={index}
|
|
51
|
-
componentId={
|
|
66
|
+
componentId={id?.fullName ?? ''}
|
|
52
67
|
isLatest={isLatest}
|
|
53
68
|
snap={snap}
|
|
54
69
|
isCurrent={isCurrent}
|
|
Binary file
|