@teambit/component.ui.component-compare.changelog 0.0.251 → 0.0.253
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
CHANGED
|
@@ -1,43 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
6
|
exports.ComponentCompareChangelog = ComponentCompareChangelog;
|
|
40
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
41
9
|
const component_ui_version_block_1 = require("@teambit/component.ui.version-block");
|
|
42
10
|
const component_1 = require("@teambit/component");
|
|
43
11
|
const classnames_1 = __importDefault(require("classnames"));
|
|
@@ -56,11 +24,11 @@ const orderByDateDsc = (logA, logB) => {
|
|
|
56
24
|
const getLogsBetweenVersions = (allLogs, baseVersion, compareVersion) => {
|
|
57
25
|
const [startingVersion, endingVersion] = orderByDateDsc(baseVersion, compareVersion);
|
|
58
26
|
const { startingVersionIndex, endingVersionIndex } = allLogs.reduce((accum, next, index) => {
|
|
59
|
-
if (next.hash ===
|
|
60
|
-
accum =
|
|
27
|
+
if (next.hash === startingVersion?.hash) {
|
|
28
|
+
accum = { ...accum, startingVersionIndex: index };
|
|
61
29
|
}
|
|
62
|
-
if (next.hash ===
|
|
63
|
-
accum =
|
|
30
|
+
if (next.hash === endingVersion?.hash) {
|
|
31
|
+
accum = { ...accum, endingVersionIndex: index };
|
|
64
32
|
}
|
|
65
33
|
return accum;
|
|
66
34
|
}, {});
|
|
@@ -70,14 +38,14 @@ function ComponentCompareChangelog({ className }) {
|
|
|
70
38
|
const component = (0, react_1.useContext)(component_1.ComponentContext);
|
|
71
39
|
const componentCompareContext = (0, component_ui_component_compare_context_1.useComponentCompare)();
|
|
72
40
|
const { base, compare, logsByVersion } = componentCompareContext || {};
|
|
73
|
-
const allLogs = (0, react_1.useMemo)(() => (
|
|
74
|
-
const baseVersionInfo =
|
|
75
|
-
const compareVersionInfo =
|
|
76
|
-
const logs = (0, react_1.useMemo)(() => getLogsBetweenVersions(allLogs, baseVersionInfo, compareVersionInfo), [baseVersionInfo
|
|
77
|
-
return (
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
41
|
+
const allLogs = (0, react_1.useMemo)(() => (compare?.model.logs || []).slice().sort(component_ui_component_compare_utils_sort_logs_1.sortByDateDsc), [compare?.model.id.toString()]);
|
|
42
|
+
const baseVersionInfo = base?.model.version ? logsByVersion?.get(base?.model.version) : undefined;
|
|
43
|
+
const compareVersionInfo = compare?.model.version ? logsByVersion?.get(compare?.model.version) : undefined;
|
|
44
|
+
const logs = (0, react_1.useMemo)(() => getLogsBetweenVersions(allLogs, baseVersionInfo, compareVersionInfo), [baseVersionInfo?.hash, compareVersionInfo?.hash]);
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(component_compare_changelog_module_scss_1.default.changeLogPage, className), children: logs.map((snap, index) => {
|
|
46
|
+
const isLatest = component.latest === snap.tag || component.latest === snap.hash;
|
|
47
|
+
const isCurrent = component.version === snap.tag || component.version === snap.hash;
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(component_ui_version_block_1.VersionBlock, { isCurrent: isCurrent, isLatest: isLatest, componentId: component.id.fullName, snap: snap }, `comp-compare-changelog-${index}`));
|
|
49
|
+
}) }));
|
|
82
50
|
}
|
|
83
51
|
//# sourceMappingURL=component-compare-changelog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-compare-changelog.js","sourceRoot":"","sources":["../component-compare-changelog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component-compare-changelog.js","sourceRoot":"","sources":["../component-compare-changelog.tsx"],"names":[],"mappings":";;;;;AAiDA,8DAmCC;;AAnFD,iCAAmD;AAEnD,oFAAmE;AACnE,kDAAsD;AACtD,4DAAoC;AACpC,4GAAsF;AACtF,4HAAwF;AAExF,wHAA+D;AAI/D,MAAM,cAAc,GAGoD,CAAC,IAAI,EAAE,IAA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EAAC,iDAAM,CAAC,aAAa,EAAE,SAAS,CAAC,YACxD,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACxB,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,SAAS,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC;YACjF,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,SAAS,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC;YACpF,OAAO,CACL,uBAAC,yCAAY,IACX,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAElB,WAAW,EAAE,SAAS,CAAC,EAAE,CAAC,QAAQ,EAClC,IAAI,EAAE,IAAI,IAFL,0BAA0B,KAAK,EAAE,CAGtC,CACH,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component.ui.component-compare.changelog",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.253",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/ui/component-compare/changelog",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "ui/component-compare/changelog",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.253"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"classnames": "^2.5.1",
|
|
13
|
-
"core-js": "^3.0.0",
|
|
14
13
|
"@teambit/component.ui.component-compare.utils.sort-logs": "0.0.8",
|
|
15
|
-
"@teambit/component
|
|
16
|
-
"@teambit/
|
|
17
|
-
"@teambit/component.ui.
|
|
14
|
+
"@teambit/legacy-component-log": "0.0.429",
|
|
15
|
+
"@teambit/component.ui.component-compare.context": "0.0.131",
|
|
16
|
+
"@teambit/component.ui.version-block": "0.0.957"
|
|
18
17
|
},
|
|
19
18
|
"devDependencies": {
|
|
20
19
|
"@types/classnames": "^2.3.4",
|
|
21
|
-
"@types/react": "^19.0.0",
|
|
22
20
|
"@types/mocha": "9.1.0",
|
|
23
|
-
"@
|
|
24
|
-
"@types/react-dom": "^19.0.0",
|
|
25
|
-
"@types/jest": "^26.0.0",
|
|
26
|
-
"@babel/runtime": "7.20.0",
|
|
27
|
-
"@types/testing-library__jest-dom": "5.9.5"
|
|
21
|
+
"@teambit/harmony.envs.core-react-env": "0.0.1"
|
|
28
22
|
},
|
|
29
23
|
"peerDependencies": {
|
|
30
|
-
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
31
|
-
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
24
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
32
25
|
},
|
|
33
26
|
"license": "Apache-2.0",
|
|
34
27
|
"optionalDependencies": {},
|
package/types/asset.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ declare module '*.png' {
|
|
|
5
5
|
declare module '*.svg' {
|
|
6
6
|
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
7
|
|
|
8
|
-
export const ReactComponent: FunctionComponent<
|
|
8
|
+
export const ReactComponent: FunctionComponent<
|
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
|
10
|
+
>;
|
|
9
11
|
const src: string;
|
|
10
12
|
export default src;
|
|
11
13
|
}
|
|
@@ -27,3 +29,15 @@ declare module '*.bmp' {
|
|
|
27
29
|
const value: any;
|
|
28
30
|
export = value;
|
|
29
31
|
}
|
|
32
|
+
declare module '*.otf' {
|
|
33
|
+
const value: any;
|
|
34
|
+
export = value;
|
|
35
|
+
}
|
|
36
|
+
declare module '*.woff' {
|
|
37
|
+
const value: any;
|
|
38
|
+
export = value;
|
|
39
|
+
}
|
|
40
|
+
declare module '*.woff2' {
|
|
41
|
+
const value: any;
|
|
42
|
+
export = value;
|
|
43
|
+
}
|
|
File without changes
|