@teambit/component-compare 0.0.324 → 0.0.326
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/component-compare.ui.runtime.tsx +9 -1
- package/dist/component-compare.ui.runtime.js +3 -1
- package/dist/component-compare.ui.runtime.js.map +1 -1
- package/dist/{preview-1686626379481.js → preview-1686799133952.js} +2 -2
- package/package-tar/teambit-component-compare-0.0.326.tgz +0 -0
- package/package.json +13 -13
- package/package-tar/teambit-component-compare-0.0.324.tgz +0 -0
|
@@ -35,7 +35,15 @@ export class ComponentCompareUI {
|
|
|
35
35
|
const routes = props?.routes || (() => flatten(this.routeSlot.values()));
|
|
36
36
|
const host = props?.host || this.host;
|
|
37
37
|
|
|
38
|
-
return
|
|
38
|
+
return (
|
|
39
|
+
<ComponentCompare
|
|
40
|
+
{...(props || {})}
|
|
41
|
+
tabs={tabs}
|
|
42
|
+
routes={routes}
|
|
43
|
+
host={host}
|
|
44
|
+
isFullScreen={props?.isFullScreen ?? true}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
39
47
|
};
|
|
40
48
|
|
|
41
49
|
getAspectsComparePage = () => {
|
|
@@ -114,13 +114,15 @@ class ComponentCompareUI {
|
|
|
114
114
|
this.routeSlot = routeSlot;
|
|
115
115
|
this.compUI = compUI;
|
|
116
116
|
(0, _defineProperty2().default)(this, "getComponentComparePage", props => {
|
|
117
|
+
var _props$isFullScreen;
|
|
117
118
|
const tabs = (props === null || props === void 0 ? void 0 : props.tabs) || (() => (0, _lodash().default)(this.navSlot.values()));
|
|
118
119
|
const routes = (props === null || props === void 0 ? void 0 : props.routes) || (() => (0, _lodash().default)(this.routeSlot.values()));
|
|
119
120
|
const host = (props === null || props === void 0 ? void 0 : props.host) || this.host;
|
|
120
121
|
return /*#__PURE__*/_react().default.createElement(_componentUiComponentCompare().ComponentCompare, (0, _extends2().default)({}, props || {}, {
|
|
121
122
|
tabs: tabs,
|
|
122
123
|
routes: routes,
|
|
123
|
-
host: host
|
|
124
|
+
host: host,
|
|
125
|
+
isFullScreen: (_props$isFullScreen = props === null || props === void 0 ? void 0 : props.isFullScreen) !== null && _props$isFullScreen !== void 0 ? _props$isFullScreen : true
|
|
124
126
|
}));
|
|
125
127
|
});
|
|
126
128
|
(0, _defineProperty2().default)(this, "getAspectsComparePage", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ComponentCompareUI","constructor","host","navSlot","routeSlot","compUI","props","tabs","flatten","values","routes","registerNavigation","nav","Array","isArray","register","registerRoutes","map","navLinks","getElement","routeProps","href","length","element","undefined","find","route","path","startsWith","toArray","id","navProps","maybeRoutesForId","get","routesForId","navProp","provider","componentUi","_","harmony","config","String","componentCompareUI","componentCompareSection","ComponentCompareSection","registerRoute","registerWidget","navigationLink","order","aspectCompareSection","AspectsCompareSection","compareChangelog","CompareChangelogSection","UIRuntime","Slot","withType","ComponentAspect","ComponentCompareAspect","addRuntime"],"sources":["component-compare.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { RouteProps } from 'react-router-dom';\nimport flatten from 'lodash.flatten';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport ComponentAspect, { ComponentUI } from '@teambit/component';\nimport { ComponentCompare } from '@teambit/component.ui.component-compare.component-compare';\nimport { UIRuntime } from '@teambit/ui';\nimport { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { ComponentCompareProps, TabItem } from '@teambit/component.ui.component-compare.models.component-compare-props';\nimport { ComponentCompareChangelog } from '@teambit/component.ui.component-compare.changelog';\nimport { ComponentCompareAspects } from '@teambit/component.ui.component-compare.compare-aspects.compare-aspects';\nimport { AspectsCompareSection } from './component-compare-aspects.section';\nimport { ComponentCompareAspect } from './component-compare.aspect';\nimport { ComponentCompareSection } from './component-compare.section';\nimport { CompareChangelogSection } from './component-compare-changelog.section';\n\nexport type ComponentCompareNav = Array<TabItem>;\nexport type ComponentCompareNavSlot = SlotRegistry<ComponentCompareNav>;\nexport class ComponentCompareUI {\n constructor(\n private host: string,\n private navSlot: ComponentCompareNavSlot,\n private routeSlot: RouteSlot,\n private compUI: ComponentUI\n ) {}\n\n static runtime = UIRuntime;\n\n static slots = [Slot.withType<ComponentCompareNavSlot>(), Slot.withType<RouteSlot>()];\n\n static dependencies = [ComponentAspect];\n\n getComponentComparePage = (props?: ComponentCompareProps) => {\n const tabs = props?.tabs || (() => flatten(this.navSlot.values()));\n const routes = props?.routes || (() => flatten(this.routeSlot.values()));\n const host = props?.host || this.host;\n\n return <ComponentCompare
|
|
1
|
+
{"version":3,"names":["ComponentCompareUI","constructor","host","navSlot","routeSlot","compUI","props","tabs","flatten","values","routes","isFullScreen","registerNavigation","nav","Array","isArray","register","registerRoutes","map","navLinks","getElement","routeProps","href","length","element","undefined","find","route","path","startsWith","toArray","id","navProps","maybeRoutesForId","get","routesForId","navProp","provider","componentUi","_","harmony","config","String","componentCompareUI","componentCompareSection","ComponentCompareSection","registerRoute","registerWidget","navigationLink","order","aspectCompareSection","AspectsCompareSection","compareChangelog","CompareChangelogSection","UIRuntime","Slot","withType","ComponentAspect","ComponentCompareAspect","addRuntime"],"sources":["component-compare.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { RouteProps } from 'react-router-dom';\nimport flatten from 'lodash.flatten';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport ComponentAspect, { ComponentUI } from '@teambit/component';\nimport { ComponentCompare } from '@teambit/component.ui.component-compare.component-compare';\nimport { UIRuntime } from '@teambit/ui';\nimport { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { ComponentCompareProps, TabItem } from '@teambit/component.ui.component-compare.models.component-compare-props';\nimport { ComponentCompareChangelog } from '@teambit/component.ui.component-compare.changelog';\nimport { ComponentCompareAspects } from '@teambit/component.ui.component-compare.compare-aspects.compare-aspects';\nimport { AspectsCompareSection } from './component-compare-aspects.section';\nimport { ComponentCompareAspect } from './component-compare.aspect';\nimport { ComponentCompareSection } from './component-compare.section';\nimport { CompareChangelogSection } from './component-compare-changelog.section';\n\nexport type ComponentCompareNav = Array<TabItem>;\nexport type ComponentCompareNavSlot = SlotRegistry<ComponentCompareNav>;\nexport class ComponentCompareUI {\n constructor(\n private host: string,\n private navSlot: ComponentCompareNavSlot,\n private routeSlot: RouteSlot,\n private compUI: ComponentUI\n ) {}\n\n static runtime = UIRuntime;\n\n static slots = [Slot.withType<ComponentCompareNavSlot>(), Slot.withType<RouteSlot>()];\n\n static dependencies = [ComponentAspect];\n\n getComponentComparePage = (props?: ComponentCompareProps) => {\n const tabs = props?.tabs || (() => flatten(this.navSlot.values()));\n const routes = props?.routes || (() => flatten(this.routeSlot.values()));\n const host = props?.host || this.host;\n\n return (\n <ComponentCompare\n {...(props || {})}\n tabs={tabs}\n routes={routes}\n host={host}\n isFullScreen={props?.isFullScreen ?? true}\n />\n );\n };\n\n getAspectsComparePage = () => {\n return <ComponentCompareAspects host={this.host} />;\n };\n\n getChangelogComparePage = () => {\n return <ComponentCompareChangelog />;\n };\n\n registerNavigation(nav: TabItem | Array<TabItem>) {\n if (Array.isArray(nav)) {\n this.navSlot.register(nav);\n } else {\n this.navSlot.register([nav]);\n }\n return this;\n }\n\n registerRoutes(routes: RouteProps[]) {\n this.routeSlot.register(routes);\n return this;\n }\n\n get routes() {\n return this.routeSlot.map;\n }\n\n get navLinks() {\n return this.navSlot.map;\n }\n\n get tabs() {\n const getElement = (routeProps: RouteProps[], href?: string) => {\n if (routeProps.length === 1) return routeProps[0].element;\n if (!href) return undefined;\n return routeProps.find((route) => route.path?.startsWith(href))?.element;\n };\n\n return flatten(\n this.navSlot.toArray().map(([id, navProps]) => {\n const maybeRoutesForId = this.routes.get(id);\n const routesForId =\n (maybeRoutesForId && (Array.isArray(maybeRoutesForId) ? [...maybeRoutesForId] : [maybeRoutesForId])) || [];\n\n return navProps.map((navProp) => ({\n ...navProp,\n id: navProp?.id || id,\n element: getElement(routesForId, navProp?.props?.href),\n }));\n })\n );\n }\n\n static async provider(\n [componentUi]: [ComponentUI],\n _,\n [navSlot, routeSlot]: [ComponentCompareNavSlot, RouteSlot],\n harmony: Harmony\n ) {\n const { config } = harmony;\n const host = String(config.get('teambit.harmony/bit'));\n const componentCompareUI = new ComponentCompareUI(host, navSlot, routeSlot, componentUi);\n const componentCompareSection = new ComponentCompareSection(componentCompareUI);\n componentUi.registerRoute([componentCompareSection.route]);\n componentUi.registerWidget(componentCompareSection.navigationLink, componentCompareSection.order);\n const aspectCompareSection = new AspectsCompareSection(componentCompareUI);\n const compareChangelog = new CompareChangelogSection(componentCompareUI);\n\n componentCompareUI.registerNavigation([aspectCompareSection, compareChangelog]);\n\n componentCompareUI.registerRoutes([aspectCompareSection.route, compareChangelog.route]);\n return componentCompareUI;\n }\n}\n\nComponentCompareAspect.addRuntime(ComponentCompareUI);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;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;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAgF;AAAA;AAIzE,MAAMA,kBAAkB,CAAC;EAC9BC,WAAW,CACDC,IAAY,EACZC,OAAgC,EAChCC,SAAoB,EACpBC,MAAmB,EAC3B;IAAA,KAJQH,IAAY,GAAZA,IAAY;IAAA,KACZC,OAAgC,GAA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;AA4FzCC,0CAAsB,CAACC,UAAU,CAAC3D,kBAAkB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component-compare@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component-compare@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component-compare@0.0.326/dist/component-compare.compositions.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component-compare@0.0.326/dist/component-compare.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component-compare",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.326",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/component-compare",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "component-compare",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.326"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
@@ -15,18 +15,18 @@
|
|
|
15
15
|
"@babel/runtime": "7.20.0",
|
|
16
16
|
"@teambit/harmony": "0.4.6",
|
|
17
17
|
"@teambit/component.ui.component-compare.models.component-compare-change-type": "0.0.1",
|
|
18
|
-
"@teambit/component.ui.component-compare.models.component-compare-props": "0.0.
|
|
19
|
-
"@teambit/component": "0.0.
|
|
18
|
+
"@teambit/component.ui.component-compare.models.component-compare-props": "0.0.34",
|
|
19
|
+
"@teambit/component": "0.0.1078",
|
|
20
20
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.497",
|
|
21
|
-
"@teambit/cli": "0.0.
|
|
22
|
-
"@teambit/graphql": "0.0.
|
|
23
|
-
"@teambit/logger": "0.0.
|
|
24
|
-
"@teambit/scope": "0.0.
|
|
25
|
-
"@teambit/component.ui.component-compare.changelog": "0.0.
|
|
26
|
-
"@teambit/component.ui.component-compare.compare-aspects.compare-aspects": "0.0.
|
|
27
|
-
"@teambit/component.ui.component-compare.component-compare": "0.0.
|
|
21
|
+
"@teambit/cli": "0.0.726",
|
|
22
|
+
"@teambit/graphql": "0.0.1078",
|
|
23
|
+
"@teambit/logger": "0.0.819",
|
|
24
|
+
"@teambit/scope": "0.0.1078",
|
|
25
|
+
"@teambit/component.ui.component-compare.changelog": "0.0.100",
|
|
26
|
+
"@teambit/component.ui.component-compare.compare-aspects.compare-aspects": "0.0.76",
|
|
27
|
+
"@teambit/component.ui.component-compare.component-compare": "0.0.100",
|
|
28
28
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.501",
|
|
29
|
-
"@teambit/ui": "0.0.
|
|
29
|
+
"@teambit/ui": "0.0.1078"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/react": "^17.0.8",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react-router-dom": "^6.0.0",
|
|
42
|
-
"@teambit/legacy": "1.0.
|
|
42
|
+
"@teambit/legacy": "1.0.506",
|
|
43
43
|
"react": "^16.8.0 || ^17.0.0",
|
|
44
44
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
45
45
|
},
|
|
Binary file
|