@teambit/changelog 0.0.662 → 0.0.665
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/{__preview-1646104918375.js → __preview-1646295435675.js} +0 -0
- package/dist/ui/change-log-page.js +7 -21
- package/dist/ui/change-log-page.js.map +1 -1
- package/package-tar/teambit-changelog-0.0.665.tgz +0 -0
- package/package.json +8 -9
- package/ui/change-log-page.tsx +5 -8
- package/package-tar/teambit-changelog-0.0.662.tgz +0 -0
|
File without changes
|
|
@@ -57,16 +57,6 @@ function _classnames() {
|
|
|
57
57
|
return data;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
function _componentUiHooks() {
|
|
61
|
-
const data = require("@teambit/component.ui.hooks.use-snaps");
|
|
62
|
-
|
|
63
|
-
_componentUiHooks = function () {
|
|
64
|
-
return data;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return data;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
60
|
function _mdxUi() {
|
|
71
61
|
const data = require("@teambit/mdx.ui.mdx-layout");
|
|
72
62
|
|
|
@@ -154,21 +144,17 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
154
144
|
function ChangeLogPage({
|
|
155
145
|
className
|
|
156
146
|
}) {
|
|
157
|
-
var
|
|
147
|
+
var _logs$, _logs$2;
|
|
158
148
|
|
|
159
149
|
const component = (0, _react().useContext)(_component().ComponentContext);
|
|
160
150
|
const lanesContext = (0, _lanesUi().useLanesContext)();
|
|
161
151
|
const currentLane = lanesContext === null || lanesContext === void 0 ? void 0 : lanesContext.currentLane;
|
|
162
|
-
const snapResult = (0, _componentUiHooks().useSnaps)(component.id);
|
|
163
|
-
const {
|
|
164
|
-
loading
|
|
165
|
-
} = snapResult;
|
|
166
152
|
const {
|
|
167
|
-
|
|
168
|
-
} =
|
|
169
|
-
if (!
|
|
153
|
+
logs
|
|
154
|
+
} = component;
|
|
155
|
+
if (!logs) return null;
|
|
170
156
|
|
|
171
|
-
if (
|
|
157
|
+
if (logs.length === 0) {
|
|
172
158
|
return /*#__PURE__*/_react().default.createElement(_react().default.Fragment, null, currentLane && /*#__PURE__*/_react().default.createElement(_react().default.Fragment, null, /*#__PURE__*/_react().default.createElement("div", {
|
|
173
159
|
className: _changeLogPageModule().default.lane
|
|
174
160
|
}, /*#__PURE__*/_react().default.createElement(_evangelistElements().Icon, {
|
|
@@ -192,7 +178,7 @@ function ChangeLogPage({
|
|
|
192
178
|
}, /*#__PURE__*/_react().default.createElement(_mdxUi().MDXLayout, null, /*#__PURE__*/_react().default.createElement(_componentInstructions().ExportingComponents, null)))));
|
|
193
179
|
}
|
|
194
180
|
|
|
195
|
-
const latestVersion = ((
|
|
181
|
+
const latestVersion = ((_logs$ = logs[0]) === null || _logs$ === void 0 ? void 0 : _logs$.tag) || ((_logs$2 = logs[0]) === null || _logs$2 === void 0 ? void 0 : _logs$2.hash);
|
|
196
182
|
return /*#__PURE__*/_react().default.createElement(_react().default.Fragment, null, /*#__PURE__*/_react().default.createElement(_lanesUi().LaneBreadcrumb, {
|
|
197
183
|
lane: currentLane
|
|
198
184
|
}), /*#__PURE__*/_react().default.createElement(_designUi().Separator, {
|
|
@@ -204,7 +190,7 @@ function ChangeLogPage({
|
|
|
204
190
|
}, "History"), /*#__PURE__*/_react().default.createElement(_designUi().Separator, {
|
|
205
191
|
isPresentational: true,
|
|
206
192
|
className: _changeLogPageModule().default.separator
|
|
207
|
-
}),
|
|
193
|
+
}), logs.map((snap, index) => {
|
|
208
194
|
const isLatest = latestVersion === snap.tag || latestVersion === snap.hash;
|
|
209
195
|
return /*#__PURE__*/_react().default.createElement(_componentUi().VersionBlock, {
|
|
210
196
|
key: index,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["change-log-page.tsx"],"names":["ChangeLogPage","className","component","ComponentContext","lanesContext","currentLane","
|
|
1
|
+
{"version":3,"sources":["change-log-page.tsx"],"names":["ChangeLogPage","className","component","ComponentContext","lanesContext","currentLane","logs","length","styles","lane","laneName","id","separator","changeLogPage","title","separatorNoChangeLog","changeLogCard","latestVersion","tag","hash","map","snap","index","isLatest","fullName"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAIO,SAASA,aAAT,CAAuB;AAAEC,EAAAA;AAAF,CAAvB,EAA0D;AAAA;;AAC/D,QAAMC,SAAS,GAAG,yBAAWC,6BAAX,CAAlB;AACA,QAAMC,YAAY,GAAG,iCAArB;AACA,QAAMC,WAAW,GAAGD,YAAH,aAAGA,YAAH,uBAAGA,YAAY,CAAEC,WAAlC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAWJ,SAAjB;AAEA,MAAI,CAACI,IAAL,EAAW,OAAO,IAAP;;AAEX,MAAIA,IAAI,CAACC,MAAL,KAAgB,CAApB,EAAuB;AACrB,wBACE,gEACGF,WAAW,iBACV,6EACE;AAAK,MAAA,SAAS,EAAEG,+BAAOC;AAAvB,oBACE,+BAAC,0BAAD;AAAM,MAAA,EAAE,EAAC;AAAT,MADF,eAEE,+BAAC,0B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AI,CAACH,GAAvB,IAA8BD,aAAa,KAAKI,IAAI,CAACF,IAAtE;AACA,wBAAO,+BAAC,2BAAD;AAAc,MAAA,GAAG,EAAEG,KAAnB;AAA0B,MAAA,WAAW,EAAEpB,SAAS,CAACS,EAAV,CAAaa,QAApD;AAA8D,MAAA,QAAQ,EAAED,QAAxE;AAAkF,MAAA,IAAI,EAAEF;AAAxF,MAAP;AACD,GAHA,CAHH,CAHF,CADF;AAcD","sourcesContent":["import { ComponentContext } 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';\nimport { LaneBreadcrumb, useLanesContext } from '@teambit/lanes.ui.lanes';\nimport { Icon } from '@teambit/evangelist.elements.icon';\nimport { Ellipsis } from '@teambit/design.ui.styles.ellipsis';\nimport styles from './change-log-page.module.scss';\n\ntype ChangeLogPageProps = {} & HTMLAttributes<HTMLDivElement>;\n\nexport function ChangeLogPage({ className }: ChangeLogPageProps) {\n const component = useContext(ComponentContext);\n const lanesContext = useLanesContext();\n const currentLane = lanesContext?.currentLane;\n const { logs } = component;\n\n if (!logs) return null;\n\n if (logs.length === 0) {\n return (\n <>\n {currentLane && (\n <>\n <div className={styles.lane}>\n <Icon of=\"lane\"></Icon>\n <Ellipsis className={styles.laneName}>{currentLane.id}</Ellipsis>\n </div>\n <Separator isPresentational className={styles.separator} />\n </>\n )}\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\n const latestVersion = logs[0]?.tag || logs[0]?.hash;\n\n return (\n <>\n <LaneBreadcrumb lane={currentLane} />\n <Separator isPresentational />\n <div className={classNames(styles.changeLogPage, className)}>\n <H1 className={styles.title}>History</H1>\n <Separator isPresentational className={styles.separator} />\n {logs.map((snap, index) => {\n const isLatest = latestVersion === snap.tag || latestVersion === snap.hash;\n return <VersionBlock key={index} componentId={component.id.fullName} isLatest={isLatest} snap={snap} />;\n })}\n </div>\n </>\n );\n}\n"]}
|
|
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.665",
|
|
4
4
|
"homepage": "https://bit.dev/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.665"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
@@ -16,15 +16,14 @@
|
|
|
16
16
|
"@teambit/component.instructions.exporting-components": "0.0.6",
|
|
17
17
|
"@teambit/documenter.ui.heading": "4.1.1",
|
|
18
18
|
"@teambit/evangelist.elements.icon": "1.0.2",
|
|
19
|
-
"@teambit/component": "0.0.
|
|
19
|
+
"@teambit/component": "0.0.665",
|
|
20
20
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.488",
|
|
21
|
-
"@teambit/ui": "0.0.
|
|
22
|
-
"@teambit/component.ui.
|
|
23
|
-
"@teambit/component.ui.version-block": "0.0.510",
|
|
21
|
+
"@teambit/ui": "0.0.665",
|
|
22
|
+
"@teambit/component.ui.version-block": "0.0.512",
|
|
24
23
|
"@teambit/design.ui.alert-card": "0.0.14",
|
|
25
24
|
"@teambit/design.ui.separator": "0.0.351",
|
|
26
25
|
"@teambit/design.ui.styles.ellipsis": "0.0.347",
|
|
27
|
-
"@teambit/lanes.ui.lanes": "0.0.
|
|
26
|
+
"@teambit/lanes.ui.lanes": "0.0.9",
|
|
28
27
|
"@teambit/mdx.ui.mdx-layout": "0.0.494"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
"@types/node": "12.20.4"
|
|
38
37
|
},
|
|
39
38
|
"peerDependencies": {
|
|
40
|
-
"@teambit/legacy": "1.0.
|
|
39
|
+
"@teambit/legacy": "1.0.229",
|
|
41
40
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
42
41
|
"react": "^16.8.0 || ^17.0.0"
|
|
43
42
|
},
|
|
@@ -65,7 +64,7 @@
|
|
|
65
64
|
"react": "-"
|
|
66
65
|
},
|
|
67
66
|
"peerDependencies": {
|
|
68
|
-
"@teambit/legacy": "1.0.
|
|
67
|
+
"@teambit/legacy": "1.0.229",
|
|
69
68
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
70
69
|
"react": "^16.8.0 || ^17.0.0"
|
|
71
70
|
}
|
package/ui/change-log-page.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import { H1 } from '@teambit/documenter.ui.heading';
|
|
|
3
3
|
import { Separator } from '@teambit/design.ui.separator';
|
|
4
4
|
import { VersionBlock } from '@teambit/component.ui.version-block';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import { useSnaps } from '@teambit/component.ui.hooks.use-snaps';
|
|
7
6
|
import { MDXLayout } from '@teambit/mdx.ui.mdx-layout';
|
|
8
7
|
import { ExportingComponents } from '@teambit/component.instructions.exporting-components';
|
|
9
8
|
import { AlertCard } from '@teambit/design.ui.alert-card';
|
|
@@ -19,13 +18,11 @@ export function ChangeLogPage({ className }: ChangeLogPageProps) {
|
|
|
19
18
|
const component = useContext(ComponentContext);
|
|
20
19
|
const lanesContext = useLanesContext();
|
|
21
20
|
const currentLane = lanesContext?.currentLane;
|
|
22
|
-
const
|
|
23
|
-
const { loading } = snapResult;
|
|
24
|
-
const { snaps } = snapResult;
|
|
21
|
+
const { logs } = component;
|
|
25
22
|
|
|
26
|
-
if (!
|
|
23
|
+
if (!logs) return null;
|
|
27
24
|
|
|
28
|
-
if (
|
|
25
|
+
if (logs.length === 0) {
|
|
29
26
|
return (
|
|
30
27
|
<>
|
|
31
28
|
{currentLane && (
|
|
@@ -55,7 +52,7 @@ export function ChangeLogPage({ className }: ChangeLogPageProps) {
|
|
|
55
52
|
);
|
|
56
53
|
}
|
|
57
54
|
|
|
58
|
-
const latestVersion =
|
|
55
|
+
const latestVersion = logs[0]?.tag || logs[0]?.hash;
|
|
59
56
|
|
|
60
57
|
return (
|
|
61
58
|
<>
|
|
@@ -64,7 +61,7 @@ export function ChangeLogPage({ className }: ChangeLogPageProps) {
|
|
|
64
61
|
<div className={classNames(styles.changeLogPage, className)}>
|
|
65
62
|
<H1 className={styles.title}>History</H1>
|
|
66
63
|
<Separator isPresentational className={styles.separator} />
|
|
67
|
-
{
|
|
64
|
+
{logs.map((snap, index) => {
|
|
68
65
|
const isLatest = latestVersion === snap.tag || latestVersion === snap.hash;
|
|
69
66
|
return <VersionBlock key={index} componentId={component.id.fullName} isLatest={isLatest} snap={snap} />;
|
|
70
67
|
})}
|
|
Binary file
|