@teambit/compositions.ui.composition-compare 0.0.143 → 0.0.145
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/composition-compare.tsx +5 -4
- package/dist/composition-compare.d.ts +3 -2
- package/dist/composition-compare.js +3 -3
- package/dist/composition-compare.js.map +1 -1
- package/package-tar/teambit-compositions.ui.composition-compare-0.0.145.tgz +0 -0
- package/package.json +4 -4
- package/package-tar/teambit-compositions.ui.composition-compare-0.0.143.tgz +0 -0
- /package/dist/{preview-1675083688288.js → preview-1677555458635.js} +0 -0
package/composition-compare.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useComponentCompare } from '@teambit/component.ui.component-compare.context';
|
|
2
|
-
import { CompositionContent, EmptyStateSlot } from '@teambit/compositions';
|
|
2
|
+
import { CompositionContent, CompositionContentProps, EmptyStateSlot } from '@teambit/compositions';
|
|
3
3
|
import { CompositionContextProvider } from '@teambit/compositions.ui.hooks.use-composition';
|
|
4
4
|
import { CompareSplitLayoutPreset } from '@teambit/component.ui.component-compare.layouts.compare-split-layout-preset';
|
|
5
5
|
import {
|
|
@@ -14,10 +14,11 @@ import { CompositionDropdown } from './composition-dropdown';
|
|
|
14
14
|
|
|
15
15
|
export type CompositionCompareProps = {
|
|
16
16
|
emptyState?: EmptyStateSlot;
|
|
17
|
+
PreviewView?: React.ComponentType<CompositionContentProps>;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export function CompositionCompare(props: CompositionCompareProps) {
|
|
20
|
-
const { emptyState } = props;
|
|
21
|
+
const { emptyState, PreviewView = CompositionContent } = props;
|
|
21
22
|
|
|
22
23
|
const component = useComponentCompare();
|
|
23
24
|
|
|
@@ -87,7 +88,7 @@ export function CompositionCompare(props: CompositionCompareProps) {
|
|
|
87
88
|
return (
|
|
88
89
|
<div className={styles.subView}>
|
|
89
90
|
<CompositionContextProvider queryParams={baseCompositionParams} setQueryParams={setBaseCompositionParams}>
|
|
90
|
-
<
|
|
91
|
+
<PreviewView
|
|
91
92
|
emptyState={emptyState}
|
|
92
93
|
component={component?.base.model}
|
|
93
94
|
selected={selectedBaseComp}
|
|
@@ -106,7 +107,7 @@ export function CompositionCompare(props: CompositionCompareProps) {
|
|
|
106
107
|
return (
|
|
107
108
|
<div className={styles.subView}>
|
|
108
109
|
<CompositionContextProvider queryParams={compareCompositionParams} setQueryParams={setCompareCompositionParams}>
|
|
109
|
-
<
|
|
110
|
+
<PreviewView
|
|
110
111
|
emptyState={emptyState}
|
|
111
112
|
component={component.compare.model}
|
|
112
113
|
selected={selectedCompareComp}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import { CompositionContentProps, EmptyStateSlot } from '@teambit/compositions';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
export declare type CompositionCompareProps = {
|
|
4
4
|
emptyState?: EmptyStateSlot;
|
|
5
|
+
PreviewView?: React.ComponentType<CompositionContentProps>;
|
|
5
6
|
};
|
|
6
7
|
export declare function CompositionCompare(props: CompositionCompareProps): JSX.Element;
|
|
@@ -38,7 +38,7 @@ const react_1 = __importStar(require("react"));
|
|
|
38
38
|
const composition_compare_module_scss_1 = __importDefault(require("./composition-compare.module.scss"));
|
|
39
39
|
const composition_dropdown_1 = require("./composition-dropdown");
|
|
40
40
|
function CompositionCompare(props) {
|
|
41
|
-
const { emptyState } = props;
|
|
41
|
+
const { emptyState, PreviewView = compositions_1.CompositionContent } = props;
|
|
42
42
|
const component = (0, component_ui_component_compare_context_1.useComponentCompare)();
|
|
43
43
|
const base = component === null || component === void 0 ? void 0 : component.base;
|
|
44
44
|
const compare = component === null || component === void 0 ? void 0 : component.compare;
|
|
@@ -86,7 +86,7 @@ function CompositionCompare(props) {
|
|
|
86
86
|
}
|
|
87
87
|
return (react_1.default.createElement("div", { className: composition_compare_module_scss_1.default.subView },
|
|
88
88
|
react_1.default.createElement(compositions_ui_hooks_use_composition_1.CompositionContextProvider, { queryParams: baseCompositionParams, setQueryParams: setBaseCompositionParams },
|
|
89
|
-
react_1.default.createElement(
|
|
89
|
+
react_1.default.createElement(PreviewView, { emptyState: emptyState, component: component === null || component === void 0 ? void 0 : component.base.model, selected: selectedBaseComp, queryParams: baseCompQueryParams }))));
|
|
90
90
|
}, [component === null || component === void 0 ? void 0 : component.base, selectedBaseComp]);
|
|
91
91
|
const CompareLayout = (0, react_1.useMemo)(() => {
|
|
92
92
|
if ((component === null || component === void 0 ? void 0 : component.compare) === undefined) {
|
|
@@ -94,7 +94,7 @@ function CompositionCompare(props) {
|
|
|
94
94
|
}
|
|
95
95
|
return (react_1.default.createElement("div", { className: composition_compare_module_scss_1.default.subView },
|
|
96
96
|
react_1.default.createElement(compositions_ui_hooks_use_composition_1.CompositionContextProvider, { queryParams: compareCompositionParams, setQueryParams: setCompareCompositionParams },
|
|
97
|
-
react_1.default.createElement(
|
|
97
|
+
react_1.default.createElement(PreviewView, { emptyState: emptyState, component: component.compare.model, selected: selectedCompareComp, queryParams: compareCompQueryParams }))));
|
|
98
98
|
}, [component === null || component === void 0 ? void 0 : component.compare, selectedCompareComp]);
|
|
99
99
|
function CompositionDropdowns() {
|
|
100
100
|
if (baseCompositionDropdownSource.length < 0 && compareCompositionDropdownSource.length < 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition-compare.js","sourceRoot":"","sources":["../composition-compare.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4GAAsF;AACtF,
|
|
1
|
+
{"version":3,"file":"composition-compare.js","sourceRoot":"","sources":["../composition-compare.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4GAAsF;AACtF,wDAAoG;AACpG,0GAA4F;AAC5F,oKAAuH;AACvH,4JAGiF;AACjF,4EAA8D;AAC9D,gEAAuC;AACvC,+CAAiD;AACjD,wGAAuD;AACvD,iEAA6D;AAO7D,SAAgB,kBAAkB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AmB,EAC7B,WAAW,EAAE,sBAAsB,GACnC,CACyB,CACzB,CACP,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAE9C,SAAS,oBAAoB;QAC3B,IAAI,6BAA6B,CAAC,MAAM,GAAG,CAAC,IAAI,gCAAgC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3F,OAAO,6DAAK,CAAC;SACd;QAED,OAAO,CACL,uCAAK,SAAS,EAAE,yCAAM,CAAC,iBAAiB;YACtC,uCAAK,SAAS,EAAE,yCAAM,CAAC,YAAY,IAChC,6BAA6B,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3C,8BAAC,0CAAmB,IAAC,aAAa,EAAE,6BAA6B,EAAE,QAAQ,EAAE,oBAAoB,GAAI,CACtG,CACG;YACN,uCAAK,SAAS,EAAE,yCAAM,CAAC,aAAa,IACjC,gCAAgC,CAAC,MAAM,GAAG,CAAC,IAAI,CAC9C,8BAAC,0CAAmB,IAAC,aAAa,EAAE,gCAAgC,EAAE,QAAQ,EAAE,uBAAuB,GAAI,CAC5G,CACG,CACF,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL;QACG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,KAAI,CACrB,uCAAK,SAAS,EAAE,yCAAM,CAAC,MAAM;YAC3B,8BAAC,oCAAW,OAAG,CACX,CACP;QACD,8BAAC,oBAAoB,OAAG;QACxB,8BAAC,6FAAwB,IAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,GAAI,CACrE,CACJ,CAAC;AACJ,CAAC;AArID,gDAqIC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/compositions.ui.composition-compare",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.145",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/compositions/ui/composition-compare",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.compositions",
|
|
8
8
|
"name": "ui/composition-compare",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.145"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"query-string": "7.0.0",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"@teambit/design.ui.surfaces.menu.link-item": "1.0.0",
|
|
15
15
|
"@teambit/evangelist.elements.icon": "1.0.2",
|
|
16
16
|
"@teambit/evangelist.surfaces.dropdown": "1.0.2",
|
|
17
|
-
"@teambit/component.ui.component-compare.context": "0.0.
|
|
18
|
-
"@teambit/component.ui.component-compare.hooks.use-component-compare-url": "0.0.
|
|
17
|
+
"@teambit/component.ui.component-compare.context": "0.0.7",
|
|
18
|
+
"@teambit/component.ui.component-compare.hooks.use-component-compare-url": "0.0.3",
|
|
19
19
|
"@teambit/component.ui.component-compare.layouts.compare-split-layout-preset": "0.0.2",
|
|
20
20
|
"@teambit/compositions.ui.hooks.use-composition": "0.0.172",
|
|
21
21
|
"@teambit/design.ui.round-loader": "0.0.355",
|
|
Binary file
|
|
File without changes
|