@teambit/component 0.0.818 → 0.0.821
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/dist/component-factory.d.ts +1 -1
- package/dist/component-factory.js.map +1 -1
- package/dist/component.ui.runtime.d.ts +1 -1
- package/dist/ui/component.js +7 -5
- package/dist/ui/component.js.map +1 -1
- package/dist/ui/menu/menu.js +15 -11
- package/dist/ui/menu/menu.js.map +1 -1
- package/dist/ui/menu/nav-plugin.d.ts +1 -1
- package/dist/ui/menu/nav-plugin.js.map +1 -1
- package/package-tar/teambit-component-0.0.821.tgz +0 -0
- package/package.json +21 -20
- package/{preview-1660620618310.js → preview-1660879941721.js} +2 -2
- package/ui/component.tsx +3 -3
- package/ui/menu/menu.tsx +7 -6
- package/ui/menu/nav-plugin.tsx +1 -1
- package/package-tar/teambit-component-0.0.818.tgz +0 -0
|
@@ -38,7 +38,7 @@ export interface ComponentFactory {
|
|
|
38
38
|
/**
|
|
39
39
|
* returns a component by ID.
|
|
40
40
|
*/
|
|
41
|
-
get(id: ComponentID
|
|
41
|
+
get(id: ComponentID): Promise<Component | undefined>;
|
|
42
42
|
/**
|
|
43
43
|
* returns many components by ids.
|
|
44
44
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["component-factory.ts"],"sourcesContent":["import { BitId } from '@teambit/legacy-bit-id';\nimport LegacyGraph from '@teambit/legacy/dist/scope/graph/graph';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport type { ComponentLog } from '@teambit/legacy/dist/scope/models/model-component';\nimport type { AspectDefinition } from '@teambit/aspect-loader';\nimport { ComponentID } from '@teambit/component-id';\nimport { Component, InvalidComponent } from './component';\nimport { State } from './state';\nimport { Snap } from './snap';\n\nexport type ResolveAspectsOptions = {\n /**\n * Do not return results for the core aspects\n */\n excludeCore?: boolean;\n /**\n * Only return results for the provided list of ids\n */\n requestedOnly?: boolean;\n};\n\nexport interface ComponentFactory {\n /**\n * name of the component host.\n */\n name: string;\n\n /**\n * path to the component host.\n */\n path: string;\n\n isLegacy: boolean;\n\n /**\n * resolve a `string` component ID to an instance of a ComponentID.\n */\n resolveComponentId(id: string | ComponentID | BitId): Promise<ComponentID>;\n\n /**\n * resolve multiple `string` component ID to an instance of a ComponentID.\n */\n resolveMultipleComponentIds(ids: (string | ComponentID | BitId)[]): Promise<ComponentID[]>;\n\n /**\n * returns a component by ID.\n */\n get(
|
|
1
|
+
{"version":3,"names":[],"sources":["component-factory.ts"],"sourcesContent":["import { BitId } from '@teambit/legacy-bit-id';\nimport LegacyGraph from '@teambit/legacy/dist/scope/graph/graph';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport type { ComponentLog } from '@teambit/legacy/dist/scope/models/model-component';\nimport type { AspectDefinition } from '@teambit/aspect-loader';\nimport { ComponentID } from '@teambit/component-id';\nimport { Component, InvalidComponent } from './component';\nimport { State } from './state';\nimport { Snap } from './snap';\n\nexport type ResolveAspectsOptions = {\n /**\n * Do not return results for the core aspects\n */\n excludeCore?: boolean;\n /**\n * Only return results for the provided list of ids\n */\n requestedOnly?: boolean;\n};\n\nexport interface ComponentFactory {\n /**\n * name of the component host.\n */\n name: string;\n\n /**\n * path to the component host.\n */\n path: string;\n\n isLegacy: boolean;\n\n /**\n * resolve a `string` component ID to an instance of a ComponentID.\n */\n resolveComponentId(id: string | ComponentID | BitId): Promise<ComponentID>;\n\n /**\n * resolve multiple `string` component ID to an instance of a ComponentID.\n */\n resolveMultipleComponentIds(ids: (string | ComponentID | BitId)[]): Promise<ComponentID[]>;\n\n /**\n * returns a component by ID.\n */\n get(id: ComponentID): Promise<Component | undefined>;\n\n /**\n * returns many components by ids.\n */\n getMany(ids: ComponentID[]): Promise<Component[]>;\n\n /**\n * returns many components by their legacy representation.\n */\n getManyByLegacy(components: ConsumerComponent[]): Promise<Component[]>;\n\n /**\n * get a component from a remote without importing it\n */\n getRemoteComponent?: (id: ComponentID) => Promise<Component>;\n\n getLegacyGraph(ids?: ComponentID[]): Promise<LegacyGraph>;\n\n getLogs(id: ComponentID, shortHash?: boolean, startsFrom?: string): Promise<ComponentLog[]>;\n\n /**\n * returns a specific state of a component by hash or semver.\n */\n getState(id: ComponentID, snapId: string): Promise<State>;\n\n /**\n * returns a specific snap of a component by hash.\n */\n getSnap(id: ComponentID, snapId: string): Promise<Snap>;\n\n /**\n * load aspects.\n * returns the loaded aspect ids including the loaded versions.\n */\n loadAspects: (ids: string[], throwOnError?: boolean, neededFor?: string) => Promise<string[]>;\n\n /**\n * Resolve dirs for aspects\n */\n resolveAspects: (\n runtimeName?: string,\n componentIds?: ComponentID[],\n opts?: ResolveAspectsOptions\n ) => Promise<AspectDefinition[]>;\n\n /**\n * list all components in the host.\n */\n list(filter?: { offset: number; limit: number }): Promise<Component[]>;\n\n /**\n * list invalid components, such as components with missing files on the fs.\n */\n listInvalid(): Promise<InvalidComponent[]>;\n\n listIds(): Promise<ComponentID[]>;\n\n /**\n * get component-ids matching the given pattern. a pattern can have multiple patterns separated by a comma.\n * it uses multimatch (https://www.npmjs.com/package/multimatch) package for the matching algorithm, which supports\n * (among others) negate character \"!\" to exclude ids. See the package page for more supported characters.\n */\n idsByPattern(pattern: string, throwForNoMatch?: boolean): Promise<ComponentID[]>;\n\n hasId(componentId: ComponentID): Promise<boolean>;\n\n /**\n * Check if the host has the id, if no, search for the id in inner host (for example, workspace will search in the scope)\n * @param componentId\n */\n hasIdNested(componentId: ComponentID, includeCache?: boolean): Promise<boolean>;\n\n /**\n * whether a component is not the same as its head.\n * for a new component, it'll return \"true\" as it has no head yet.\n * this is relevant for component from the workspace, where it can be locally changed. on the scope it's always false\n */\n isModified(component: Component): Promise<boolean>;\n\n /**\n * write the component to the filesystem when applicable (no-op for scope).\n * to change the component-path, specify the \"rootPath\", which should be a relative path inside the workspace.\n */\n write(component: Component, rootPath?: string): Promise<void>;\n\n /**\n * determine whether host should be the prior one in case multiple hosts persist.\n */\n priority?: boolean;\n}\n"],"mappings":""}
|
|
@@ -76,7 +76,7 @@ export declare class ComponentUI {
|
|
|
76
76
|
updateComponents: (components: ComponentModel[]) => void;
|
|
77
77
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
78
78
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
79
|
-
static slots: (((registerFn: () => string) => SlotRegistry<RouteProps>) | ((registerFn: () => string) => SlotRegistry<
|
|
79
|
+
static slots: (((registerFn: () => string) => SlotRegistry<RouteProps>) | ((registerFn: () => string) => SlotRegistry<MenuItemSlot>) | ((registerFn: () => string) => SlotRegistry<NavigationSlot>) | ((registerFn: () => string) => SlotRegistry<NavPlugin>) | ((registerFn: () => string) => SlotRegistry<ConsumeMethodSlot>) | ((registerFn: () => string) => SlotRegistry<ComponentPageSlot>) | ((registerFn: () => string) => SlotRegistry<ComponentSearchResultSlot>))[];
|
|
80
80
|
static defaultConfig: ComponentUIConfig;
|
|
81
81
|
static provider([pubsub, commandBarUI, reactRouterUI]: [PubsubUI, CommandBarUI, ReactRouterUI], config: ComponentUIConfig, [routeSlot, navSlot, consumeMethodSlot, widgetSlot, menuItemSlot, pageSlot, componentSearchResultSlot]: [
|
|
82
82
|
RouteSlot,
|
package/dist/ui/component.js
CHANGED
|
@@ -39,10 +39,10 @@ function _uiFoundationUiReactRouter() {
|
|
|
39
39
|
return data;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function
|
|
43
|
-
const data = require("@teambit/lanes.
|
|
42
|
+
function _lanesHooks() {
|
|
43
|
+
const data = require("@teambit/lanes.hooks.use-lanes");
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
_lanesHooks = function () {
|
|
46
46
|
return data;
|
|
47
47
|
};
|
|
48
48
|
|
|
@@ -117,8 +117,10 @@ function Component({
|
|
|
117
117
|
const idFromLocation = (0, _useComponentFromLocation().useIdFromLocation)();
|
|
118
118
|
const componentId = componentIdStr ? _().ComponentID.fromString(componentIdStr) : undefined;
|
|
119
119
|
const fullName = (componentId === null || componentId === void 0 ? void 0 : componentId.fullName) || idFromLocation;
|
|
120
|
-
const
|
|
121
|
-
|
|
120
|
+
const {
|
|
121
|
+
lanesModel
|
|
122
|
+
} = (0, _lanesHooks().useLanes)();
|
|
123
|
+
const laneComponent = fullName ? lanesModel === null || lanesModel === void 0 ? void 0 : lanesModel.resolveComponent(fullName) : undefined;
|
|
122
124
|
const useComponentOptions = {
|
|
123
125
|
logFilters: laneComponent && {
|
|
124
126
|
log: {
|
package/dist/ui/component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Component","routeSlot","containerSlot","host","onComponentChange","componentIdStr","useComponent","idFromLocation","useIdFromLocation","componentId","ComponentID","fromString","undefined","fullName","
|
|
1
|
+
{"version":3,"names":["Component","routeSlot","containerSlot","host","onComponentChange","componentIdStr","useComponent","idFromLocation","useIdFromLocation","componentId","ComponentID","fromString","undefined","fullName","lanesModel","useLanes","laneComponent","resolveComponent","useComponentOptions","logFilters","log","logHead","version","customUseComponent","component","componentDescriptor","error","useComponentQuery","id","toString","useEffect","pageItems","useMemo","flatten","values","before","filter","x","type","map","content","after","renderError","styles","container"],"sources":["component.tsx"],"sourcesContent":["import React, { useEffect, ReactNode, useMemo } from 'react';\nimport flatten from 'lodash.flatten';\nimport { RouteSlot, SlotRouter } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { SlotRegistry } from '@teambit/harmony';\nimport { useLanes } from '@teambit/lanes.hooks.use-lanes';\nimport styles from './component.module.scss';\nimport { ComponentProvider, ComponentDescriptorProvider } from './context';\nimport { useComponent as useComponentQuery, UseComponentType } from './use-component';\nimport { ComponentModel } from './component-model';\nimport { useIdFromLocation } from './use-component-from-location';\nimport { ComponentID } from '..';\n\nexport type ComponentPageSlot = SlotRegistry<ComponentPageElement[]>;\nexport type ComponentPageElement = {\n type: 'before' | 'after';\n content: ReactNode;\n};\n\nexport type ComponentProps = {\n containerSlot?: ComponentPageSlot;\n routeSlot: RouteSlot;\n host: string;\n onComponentChange?: (activeComponent?: ComponentModel) => void;\n useComponent?: UseComponentType;\n componentIdStr?: string;\n};\n\n/**\n * main UI component of the Component extension.\n */\nexport function Component({\n routeSlot,\n containerSlot,\n host,\n onComponentChange,\n componentIdStr,\n useComponent,\n}: ComponentProps) {\n const idFromLocation = useIdFromLocation();\n const componentId = componentIdStr ? ComponentID.fromString(componentIdStr) : undefined;\n const fullName = componentId?.fullName || idFromLocation;\n const { lanesModel } = useLanes();\n const laneComponent = fullName ? lanesModel?.resolveComponent(fullName) : undefined;\n const useComponentOptions = {\n logFilters: laneComponent && { log: { logHead: laneComponent.version } },\n customUseComponent: useComponent,\n };\n\n const { component, componentDescriptor, error } = useComponentQuery(\n host,\n laneComponent?.id.toString() || componentId?.toString() || idFromLocation,\n useComponentOptions\n );\n // trigger onComponentChange when component changes\n useEffect(() => onComponentChange?.(component), [component]);\n // cleanup when unmounting component\n useEffect(() => () => onComponentChange?.(undefined), []);\n\n const pageItems = useMemo(() => flatten(containerSlot?.values()), [containerSlot]);\n const before = useMemo(() => pageItems.filter((x) => x.type === 'before').map((x) => x.content), [pageItems]);\n const after = useMemo(() => pageItems.filter((x) => x.type === 'after').map((x) => x.content), [pageItems]);\n\n if (error) return error.renderError();\n if (!component) return <div></div>;\n\n return (\n <ComponentDescriptorProvider componentDescriptor={componentDescriptor}>\n <ComponentProvider component={component}>\n {before}\n <div className={styles.container}>\n {routeSlot && <SlotRouter parentPath={`${fullName}/*`} slot={routeSlot} />}\n </div>\n {after}\n </ComponentProvider>\n </ComponentDescriptorProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EA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hB,CAFF,EAKGwC,KALH,CADF,CADF;AAWD"}
|
package/dist/ui/menu/menu.js
CHANGED
|
@@ -111,20 +111,20 @@ function _uiFoundationUiUseBox() {
|
|
|
111
111
|
return data;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
function
|
|
115
|
-
const data = require("@teambit/
|
|
114
|
+
function _lanesHooks() {
|
|
115
|
+
const data = require("@teambit/lanes.hooks.use-lanes");
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
_lanesHooks = function () {
|
|
118
118
|
return data;
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
return data;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
function
|
|
125
|
-
const data = require("@teambit/
|
|
124
|
+
function _uiFoundationUiUseBox2() {
|
|
125
|
+
const data = require("@teambit/ui-foundation.ui.use-box.menu");
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
_uiFoundationUiUseBox2 = function () {
|
|
128
128
|
return data;
|
|
129
129
|
};
|
|
130
130
|
|
|
@@ -215,8 +215,10 @@ function ComponentMenu({
|
|
|
215
215
|
const idFromLocation = (0, _useComponentFromLocation().useIdFromLocation)();
|
|
216
216
|
const componentId = componentIdStr ? _().ComponentID.fromString(componentIdStr) : undefined;
|
|
217
217
|
const fullName = (componentId === null || componentId === void 0 ? void 0 : componentId.fullName) || idFromLocation;
|
|
218
|
-
const
|
|
219
|
-
|
|
218
|
+
const {
|
|
219
|
+
lanesModel
|
|
220
|
+
} = (0, _lanesHooks().useLanes)();
|
|
221
|
+
const laneComponent = fullName ? lanesModel === null || lanesModel === void 0 ? void 0 : lanesModel.resolveComponent(fullName) : undefined;
|
|
220
222
|
const useComponentOptions = {
|
|
221
223
|
logFilters: laneComponent && {
|
|
222
224
|
log: {
|
|
@@ -263,8 +265,10 @@ function VersionRelatedDropdowns({
|
|
|
263
265
|
host
|
|
264
266
|
}) {
|
|
265
267
|
const location = (0, _baseReactNavigation().useLocation)();
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
+
const {
|
|
269
|
+
lanesModel
|
|
270
|
+
} = (0, _lanesHooks().useLanes)();
|
|
271
|
+
const currentLane = lanesModel === null || lanesModel === void 0 ? void 0 : lanesModel.viewedLane;
|
|
268
272
|
const {
|
|
269
273
|
logs
|
|
270
274
|
} = component;
|
|
@@ -286,7 +290,7 @@ function VersionRelatedDropdowns({
|
|
|
286
290
|
}));
|
|
287
291
|
}, [logs]);
|
|
288
292
|
const isNew = snaps.length === 0 && tags.length === 0;
|
|
289
|
-
const lanes = (
|
|
293
|
+
const lanes = (lanesModel === null || lanesModel === void 0 ? void 0 : lanesModel.getLanesByComponentId(component.id)) || [];
|
|
290
294
|
const localVersion = isWorkspace && !isNew && !currentLane;
|
|
291
295
|
const currentVersion = isWorkspace && !isNew && !(location !== null && location !== void 0 && location.search.includes('version')) ? 'workspace' : component.version;
|
|
292
296
|
const methods = useConsumeMethods(consumeMethods, component, currentLane);
|
package/dist/ui/menu/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ComponentMenu","navigationSlot","widgetSlot","className","host","menuItemSlot","consumeMethodSlot","componentIdStr","useComponent","idFromLocation","useIdFromLocation","componentId","ComponentID","fromString","undefined","fullName","lanesContext","useLanesContext","laneComponent","resolveComponent","useComponentOptions","logFilters","log","logHead","version","customUseComponent","component","useComponentQuery","id","toString","toStringWithoutVersion","mainMenuItems","useMemo","groupBy","flatten","values","classnames","styles","topBar","leftSide","rightSide","widgets","VersionRelatedDropdowns","consumeMethods","location","useLocation","currentLane","viewedLane","logs","isWorkspace","snaps","filter","tag","map","snap","hash","reverse","tags","tagLookup","Map","forEach","set","compact","toArray","get","isNew","length","lanes","getLanesByComponentId","localVersion","currentVersion","search","includes","methods","useConsumeMethods","useBox","name","latest","componentVersionMenu","componentModel","method","x","Component","Title"],"sources":["menu.tsx"],"sourcesContent":["import { Routes, Route } from 'react-router-dom';\nimport { MainDropdown, MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';\nimport { VersionDropdown } from '@teambit/component.ui.version-dropdown';\nimport { FullLoader } from '@teambit/ui-foundation.ui.full-loader';\nimport type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { useLocation } from '@teambit/base-react.navigation.link';\nimport { flatten, groupBy, compact } from 'lodash';\nimport classnames from 'classnames';\nimport React, { useMemo } from 'react';\nimport { UseBoxDropdown } from '@teambit/ui-foundation.ui.use-box.dropdown';\nimport { Menu as ConsumeMethodsMenu } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { LaneModel, useLanesContext } from '@teambit/lanes.ui.lanes';\nimport { LegacyComponentLog } from '@teambit/legacy-component-log';\nimport type { ComponentModel } from '../component-model';\nimport { useComponent as useComponentQuery, UseComponentType } from '../use-component';\nimport { MenuNav } from './menu-nav';\nimport { MobileMenuNav } from './mobile-menu-nav';\nimport styles from './menu.module.scss';\nimport { OrderedNavigationSlot, ConsumeMethodSlot } from './nav-plugin';\nimport { useIdFromLocation } from '../use-component-from-location';\nimport { ComponentID } from '../..';\n\nexport type MenuProps = {\n className?: string;\n /**\n * slot for top bar menu nav items\n */\n navigationSlot: OrderedNavigationSlot;\n /**\n * right side menu item slot\n */\n widgetSlot: OrderedNavigationSlot;\n host: string;\n /**\n * main dropdown item slot\n */\n menuItemSlot: MenuItemSlot;\n\n consumeMethodSlot: ConsumeMethodSlot;\n\n componentIdStr?: string;\n\n useComponent?: UseComponentType;\n};\n\n/**\n * top bar menu.\n */\nexport function ComponentMenu({\n navigationSlot,\n widgetSlot,\n className,\n host,\n menuItemSlot,\n consumeMethodSlot,\n componentIdStr,\n useComponent,\n}: MenuProps) {\n const idFromLocation = useIdFromLocation();\n const componentId = componentIdStr ? ComponentID.fromString(componentIdStr) : undefined;\n const fullName = componentId?.fullName || idFromLocation;\n const lanesContext = useLanesContext();\n const laneComponent = fullName ? lanesContext?.resolveComponent(fullName) : undefined;\n const useComponentOptions = {\n logFilters: laneComponent && { log: { logHead: laneComponent.version } },\n customUseComponent: useComponent,\n };\n\n const { component } = useComponentQuery(\n host,\n laneComponent?.id.toString() || componentId?.toStringWithoutVersion() || fullName,\n useComponentOptions\n );\n const mainMenuItems = useMemo(() => groupBy(flatten(menuItemSlot.values()), 'category'), [menuItemSlot]);\n if (!component) return <FullLoader />;\n return (\n <Routes>\n <Route\n path={`${fullName}/*`}\n element={\n <div className={classnames(styles.topBar, className)}>\n <div className={styles.leftSide}>\n <MenuNav navigationSlot={navigationSlot} />\n <MobileMenuNav navigationSlot={navigationSlot} widgetSlot={widgetSlot} />\n </div>\n <div className={styles.rightSide}>\n <div className={styles.widgets}>\n <MenuNav navigationSlot={widgetSlot} />\n </div>\n <VersionRelatedDropdowns component={component} consumeMethods={consumeMethodSlot} host={host} />\n <MainDropdown menuItems={mainMenuItems} />\n </div>\n </div>\n }\n />\n </Routes>\n );\n}\n\nfunction VersionRelatedDropdowns({\n component,\n consumeMethods,\n host,\n}: {\n component: ComponentModel;\n consumeMethods: ConsumeMethodSlot;\n host: string;\n}) {\n const location = useLocation();\n const lanesContext = useLanesContext();\n const currentLane = lanesContext?.viewedLane;\n const { logs } = component;\n const isWorkspace = host === 'teambit.workspace/workspace';\n\n const snaps = useMemo(() => {\n return (logs || [])\n .filter((log) => !log.tag)\n .map((snap) => ({ ...snap, version: snap.hash }))\n .reverse();\n }, [logs]);\n\n const tags = useMemo(() => {\n const tagLookup = new Map<string, LegacyComponentLog>();\n (logs || [])\n .filter((log) => log.tag)\n .forEach((tag) => {\n tagLookup.set(tag?.tag as string, tag);\n });\n return compact(\n component.tags\n ?.toArray()\n .reverse()\n .map((tag) => tagLookup.get(tag.version.version))\n ).map((tag) => ({ ...tag, version: tag.tag as string }));\n }, [logs]);\n\n const isNew = snaps.length === 0 && tags.length === 0;\n\n const lanes = lanesContext?.getLanesByComponentId(component.id) || [];\n const localVersion = isWorkspace && !isNew && !currentLane;\n\n const currentVersion =\n isWorkspace && !isNew && !location?.search.includes('version') ? 'workspace' : component.version;\n\n const methods = useConsumeMethods(consumeMethods, component, currentLane);\n return (\n <>\n {tags.length > 0 && (\n <UseBoxDropdown\n position=\"bottom-end\"\n className={styles.useBox}\n Menu={<ConsumeMethodsMenu methods={methods} componentName={component.id.name} />}\n />\n )}\n <VersionDropdown\n tags={tags}\n snaps={snaps}\n lanes={lanes}\n localVersion={localVersion}\n currentVersion={currentVersion}\n latestVersion={component.latest}\n currentLane={currentLane}\n menuClassName={styles.componentVersionMenu}\n />\n </>\n );\n}\n\nfunction useConsumeMethods(\n consumeMethods: ConsumeMethodSlot,\n componentModel: ComponentModel,\n currentLane?: LaneModel\n): ConsumeMethod[] {\n return useMemo(\n () =>\n flatten(consumeMethods.values())\n .map((method) => {\n return method?.(componentModel, { currentLane });\n })\n .filter((x) => !!x && x.Component && x.Title) as ConsumeMethod[],\n [consumeMethods, componentModel, currentLane]\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;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;;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;;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;;EAA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BD,CAAC,CAACE,KAJzC,CAFG,EAOL,CAACxC,cAAD,EAAiBoC,cAAjB,EAAiCjC,WAAjC,CAPK,CAAP;AASD"}
|
|
1
|
+
{"version":3,"names":["ComponentMenu","navigationSlot","widgetSlot","className","host","menuItemSlot","consumeMethodSlot","componentIdStr","useComponent","idFromLocation","useIdFromLocation","componentId","ComponentID","fromString","undefined","fullName","lanesModel","useLanes","laneComponent","resolveComponent","useComponentOptions","logFilters","log","logHead","version","customUseComponent","component","useComponentQuery","id","toString","toStringWithoutVersion","mainMenuItems","useMemo","groupBy","flatten","values","classnames","styles","topBar","leftSide","rightSide","widgets","VersionRelatedDropdowns","consumeMethods","location","useLocation","currentLane","viewedLane","logs","isWorkspace","snaps","filter","tag","map","snap","hash","reverse","tags","tagLookup","Map","forEach","set","compact","toArray","get","isNew","length","lanes","getLanesByComponentId","localVersion","currentVersion","search","includes","methods","useConsumeMethods","useBox","name","latest","componentVersionMenu","componentModel","method","x","Component","Title"],"sources":["menu.tsx"],"sourcesContent":["import { Routes, Route } from 'react-router-dom';\nimport { MainDropdown, MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';\nimport { VersionDropdown } from '@teambit/component.ui.version-dropdown';\nimport { FullLoader } from '@teambit/ui-foundation.ui.full-loader';\nimport type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { useLocation } from '@teambit/base-react.navigation.link';\nimport { flatten, groupBy, compact } from 'lodash';\nimport classnames from 'classnames';\nimport React, { useMemo } from 'react';\nimport { UseBoxDropdown } from '@teambit/ui-foundation.ui.use-box.dropdown';\nimport { useLanes } from '@teambit/lanes.hooks.use-lanes';\nimport { LaneModel } from '@teambit/lanes.ui.models';\nimport { Menu as ConsumeMethodsMenu } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { LegacyComponentLog } from '@teambit/legacy-component-log';\nimport type { ComponentModel } from '../component-model';\nimport { useComponent as useComponentQuery, UseComponentType } from '../use-component';\nimport { MenuNav } from './menu-nav';\nimport { MobileMenuNav } from './mobile-menu-nav';\nimport styles from './menu.module.scss';\nimport { OrderedNavigationSlot, ConsumeMethodSlot } from './nav-plugin';\nimport { useIdFromLocation } from '../use-component-from-location';\nimport { ComponentID } from '../..';\n\nexport type MenuProps = {\n className?: string;\n /**\n * slot for top bar menu nav items\n */\n navigationSlot: OrderedNavigationSlot;\n /**\n * right side menu item slot\n */\n widgetSlot: OrderedNavigationSlot;\n host: string;\n /**\n * main dropdown item slot\n */\n menuItemSlot: MenuItemSlot;\n\n consumeMethodSlot: ConsumeMethodSlot;\n\n componentIdStr?: string;\n\n useComponent?: UseComponentType;\n};\n\n/**\n * top bar menu.\n */\nexport function ComponentMenu({\n navigationSlot,\n widgetSlot,\n className,\n host,\n menuItemSlot,\n consumeMethodSlot,\n componentIdStr,\n useComponent,\n}: MenuProps) {\n const idFromLocation = useIdFromLocation();\n const componentId = componentIdStr ? ComponentID.fromString(componentIdStr) : undefined;\n const fullName = componentId?.fullName || idFromLocation;\n const { lanesModel } = useLanes();\n const laneComponent = fullName ? lanesModel?.resolveComponent(fullName) : undefined;\n const useComponentOptions = {\n logFilters: laneComponent && { log: { logHead: laneComponent.version } },\n customUseComponent: useComponent,\n };\n\n const { component } = useComponentQuery(\n host,\n laneComponent?.id.toString() || componentId?.toStringWithoutVersion() || fullName,\n useComponentOptions\n );\n const mainMenuItems = useMemo(() => groupBy(flatten(menuItemSlot.values()), 'category'), [menuItemSlot]);\n if (!component) return <FullLoader />;\n return (\n <Routes>\n <Route\n path={`${fullName}/*`}\n element={\n <div className={classnames(styles.topBar, className)}>\n <div className={styles.leftSide}>\n <MenuNav navigationSlot={navigationSlot} />\n <MobileMenuNav navigationSlot={navigationSlot} widgetSlot={widgetSlot} />\n </div>\n <div className={styles.rightSide}>\n <div className={styles.widgets}>\n <MenuNav navigationSlot={widgetSlot} />\n </div>\n <VersionRelatedDropdowns component={component} consumeMethods={consumeMethodSlot} host={host} />\n <MainDropdown menuItems={mainMenuItems} />\n </div>\n </div>\n }\n />\n </Routes>\n );\n}\n\nfunction VersionRelatedDropdowns({\n component,\n consumeMethods,\n host,\n}: {\n component: ComponentModel;\n consumeMethods: ConsumeMethodSlot;\n host: string;\n}) {\n const location = useLocation();\n const { lanesModel } = useLanes();\n const currentLane = lanesModel?.viewedLane;\n const { logs } = component;\n const isWorkspace = host === 'teambit.workspace/workspace';\n\n const snaps = useMemo(() => {\n return (logs || [])\n .filter((log) => !log.tag)\n .map((snap) => ({ ...snap, version: snap.hash }))\n .reverse();\n }, [logs]);\n\n const tags = useMemo(() => {\n const tagLookup = new Map<string, LegacyComponentLog>();\n (logs || [])\n .filter((log) => log.tag)\n .forEach((tag) => {\n tagLookup.set(tag?.tag as string, tag);\n });\n return compact(\n component.tags\n ?.toArray()\n .reverse()\n .map((tag) => tagLookup.get(tag.version.version))\n ).map((tag) => ({ ...tag, version: tag.tag as string }));\n }, [logs]);\n\n const isNew = snaps.length === 0 && tags.length === 0;\n\n const lanes = lanesModel?.getLanesByComponentId(component.id) || [];\n const localVersion = isWorkspace && !isNew && !currentLane;\n\n const currentVersion =\n isWorkspace && !isNew && !location?.search.includes('version') ? 'workspace' : component.version;\n\n const methods = useConsumeMethods(consumeMethods, component, currentLane);\n return (\n <>\n {tags.length > 0 && (\n <UseBoxDropdown\n position=\"bottom-end\"\n className={styles.useBox}\n Menu={<ConsumeMethodsMenu methods={methods} componentName={component.id.name} />}\n />\n )}\n <VersionDropdown\n tags={tags}\n snaps={snaps}\n lanes={lanes}\n localVersion={localVersion}\n currentVersion={currentVersion}\n latestVersion={component.latest}\n currentLane={currentLane}\n menuClassName={styles.componentVersionMenu}\n />\n </>\n );\n}\n\nfunction useConsumeMethods(\n consumeMethods: ConsumeMethodSlot,\n componentModel: ComponentModel,\n currentLane?: LaneModel\n): ConsumeMethod[] {\n return useMemo(\n () =>\n flatten(consumeMethods.values())\n .map((method) => {\n return method?.(componentModel, { currentLane });\n })\n .filter((x) => !!x && x.Component && x.Title) as ConsumeMethod[],\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+BAAC,6BAAD;MAAoB,OAAO,EAAEF,OAA7B;MAAsC,aAAa,EAAE/C,SAAS,CAACE,EAAV,CAAagD;IAAlE;EAHR,EAFJ,eAQE,+BAAC,8BAAD;IACE,IAAI,EAAEnB,IADR;IAEE,KAAK,EAAEP,KAFT;IAGE,KAAK,EAAEiB,KAHT;IAIE,YAAY,EAAEE,YAJhB;IAKE,cAAc,EAAEC,cALlB;IAME,aAAa,EAAE5C,SAAS,CAACmD,MAN3B;IAOE,WAAW,EAAE/B,WAPf;IAQE,aAAa,EAAET,qBAAA,CAAOyC;EARxB,EARF,CADF;AAqBD;;AAED,SAASJ,iBAAT,CACE/B,cADF,EAEEoC,cAFF,EAGEjC,WAHF,EAImB;EACjB,OAAO,IAAAd,gBAAA,EACL,MACE,IAAAE,iBAAA,EAAQS,cAAc,CAACR,MAAf,EAAR,EACGkB,GADH,CACQ2B,MAAD,IAAY;IACf,OAAOA,MAAP,aAAOA,MAAP,uBAAOA,MAAM,CAAGD,cAAH,EAAmB;MAAEjC;IAAF,CAAnB,CAAb;EACD,CAHH,EAIGK,MAJH,CAIW8B,CAAD,IAAO,CAAC,CAACA,CAAF,IAAOA,CAAC,CAACC,SAAT,IAAsBD,CAAC,CAACE,KAJzC,CAFG,EAOL,CAACxC,cAAD,EAAiBoC,cAAjB,EAAiCjC,WAAjC,CAPK,CAAP;AASD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SlotRegistry } from '@teambit/harmony';
|
|
2
2
|
import type { LinkProps } from '@teambit/base-react.navigation.link';
|
|
3
3
|
import type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';
|
|
4
|
-
import { LaneModel } from '@teambit/lanes.ui.
|
|
4
|
+
import { LaneModel } from '@teambit/lanes.ui.models';
|
|
5
5
|
import { ComponentModel } from '../../ui';
|
|
6
6
|
export declare type NavPluginProps = {
|
|
7
7
|
displayName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["nav-plugin.tsx"],"sourcesContent":["import { SlotRegistry } from '@teambit/harmony';\nimport type { LinkProps } from '@teambit/base-react.navigation.link';\nimport type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { LaneModel } from '@teambit/lanes.ui.
|
|
1
|
+
{"version":3,"names":[],"sources":["nav-plugin.tsx"],"sourcesContent":["import { SlotRegistry } from '@teambit/harmony';\nimport type { LinkProps } from '@teambit/base-react.navigation.link';\nimport type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { LaneModel } from '@teambit/lanes.ui.models';\nimport { ComponentModel } from '../../ui';\n\nexport type NavPluginProps = {\n displayName?: string;\n} & LinkProps;\n\nexport type NavPlugin = {\n props: NavPluginProps;\n order?: number;\n};\n\nexport type OrderedNavigationSlot = SlotRegistry<NavPlugin>;\nexport type ConsumePluginOptions = {\n currentLane?: LaneModel;\n};\n\nexport type ConsumePlugin = (\n componentModel: ComponentModel,\n options?: ConsumePluginOptions\n) => ConsumeMethod | undefined;\n\nexport type ConsumeMethodSlot = SlotRegistry<ConsumePlugin[]>;\n"],"mappings":""}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.821",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/component/component",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "component",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.821"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/any-fs": "0.0.5",
|
|
@@ -31,41 +31,42 @@
|
|
|
31
31
|
"@teambit/design.inputs.dropdown": "0.0.7",
|
|
32
32
|
"@teambit/component-id": "0.0.405",
|
|
33
33
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.488",
|
|
34
|
-
"@teambit/aspect-loader": "0.0.
|
|
34
|
+
"@teambit/aspect-loader": "0.0.821",
|
|
35
35
|
"@teambit/legacy-bit-id": "0.0.402",
|
|
36
36
|
"@teambit/toolbox.path.match-patterns": "0.0.1",
|
|
37
37
|
"@teambit/toolbox.string.capitalize": "0.0.483",
|
|
38
|
-
"@teambit/cli": "0.0.
|
|
39
|
-
"@teambit/express": "0.0.
|
|
40
|
-
"@teambit/graphql": "0.0.
|
|
38
|
+
"@teambit/cli": "0.0.549",
|
|
39
|
+
"@teambit/express": "0.0.647",
|
|
40
|
+
"@teambit/graphql": "0.0.821",
|
|
41
41
|
"@teambit/bit-error": "0.0.394",
|
|
42
|
-
"@teambit/command-bar": "0.0.
|
|
42
|
+
"@teambit/command-bar": "0.0.821",
|
|
43
43
|
"@teambit/component.ui.deprecation-icon": "0.0.494",
|
|
44
|
-
"@teambit/preview": "0.0.
|
|
45
|
-
"@teambit/pubsub": "0.0.
|
|
46
|
-
"@teambit/react-router": "0.0.
|
|
44
|
+
"@teambit/preview": "0.0.821",
|
|
45
|
+
"@teambit/pubsub": "0.0.821",
|
|
46
|
+
"@teambit/react-router": "0.0.821",
|
|
47
47
|
"@teambit/ui-foundation.ui.is-browser": "0.0.486",
|
|
48
48
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.487",
|
|
49
49
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.490",
|
|
50
50
|
"@teambit/ui-foundation.ui.use-box.menu": "0.0.116",
|
|
51
|
-
"@teambit/ui": "0.0.
|
|
51
|
+
"@teambit/ui": "0.0.821",
|
|
52
52
|
"@teambit/component-issues": "0.0.60",
|
|
53
53
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.488",
|
|
54
54
|
"@teambit/cli-table": "0.0.34",
|
|
55
|
-
"@teambit/lanes.
|
|
56
|
-
"@teambit/component-descriptor": "0.0.
|
|
55
|
+
"@teambit/lanes.hooks.use-lanes": "0.0.2",
|
|
56
|
+
"@teambit/component-descriptor": "0.0.112",
|
|
57
57
|
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.487",
|
|
58
58
|
"@teambit/design.ui.empty-box": "0.0.354",
|
|
59
59
|
"@teambit/harmony.ui.aspect-box": "0.0.486",
|
|
60
|
-
"@teambit/design.ui.pages.not-found": "0.0.
|
|
61
|
-
"@teambit/design.ui.pages.server-error": "0.0.
|
|
62
|
-
"@teambit/compositions": "0.0.
|
|
63
|
-
"@teambit/deprecation": "0.0.
|
|
64
|
-
"@teambit/envs": "0.0.
|
|
60
|
+
"@teambit/design.ui.pages.not-found": "0.0.357",
|
|
61
|
+
"@teambit/design.ui.pages.server-error": "0.0.357",
|
|
62
|
+
"@teambit/compositions": "0.0.821",
|
|
63
|
+
"@teambit/deprecation": "0.0.821",
|
|
64
|
+
"@teambit/envs": "0.0.821",
|
|
65
65
|
"@teambit/legacy-component-log": "0.0.392",
|
|
66
66
|
"@teambit/design.ui.styles.ellipsis": "0.0.347",
|
|
67
67
|
"@teambit/envs.ui.env-icon": "0.0.486",
|
|
68
|
-
"@teambit/component.ui.version-dropdown": "0.0.
|
|
68
|
+
"@teambit/component.ui.version-dropdown": "0.0.606",
|
|
69
|
+
"@teambit/lanes.ui.models": "0.0.2",
|
|
69
70
|
"@teambit/ui-foundation.ui.full-loader": "0.0.486",
|
|
70
71
|
"@teambit/ui-foundation.ui.use-box.dropdown": "0.0.116",
|
|
71
72
|
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.488"
|
|
@@ -87,7 +88,7 @@
|
|
|
87
88
|
"peerDependencies": {
|
|
88
89
|
"react-router-dom": "^6.0.0",
|
|
89
90
|
"@apollo/client": "^3.0.0",
|
|
90
|
-
"@teambit/legacy": "1.0.
|
|
91
|
+
"@teambit/legacy": "1.0.332",
|
|
91
92
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
92
93
|
"react": "^16.8.0 || ^17.0.0"
|
|
93
94
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.821/dist/component.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.821/dist/component.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/ui/component.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useEffect, ReactNode, useMemo } from 'react';
|
|
|
2
2
|
import flatten from 'lodash.flatten';
|
|
3
3
|
import { RouteSlot, SlotRouter } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
4
4
|
import { SlotRegistry } from '@teambit/harmony';
|
|
5
|
-
import {
|
|
5
|
+
import { useLanes } from '@teambit/lanes.hooks.use-lanes';
|
|
6
6
|
import styles from './component.module.scss';
|
|
7
7
|
import { ComponentProvider, ComponentDescriptorProvider } from './context';
|
|
8
8
|
import { useComponent as useComponentQuery, UseComponentType } from './use-component';
|
|
@@ -39,8 +39,8 @@ export function Component({
|
|
|
39
39
|
const idFromLocation = useIdFromLocation();
|
|
40
40
|
const componentId = componentIdStr ? ComponentID.fromString(componentIdStr) : undefined;
|
|
41
41
|
const fullName = componentId?.fullName || idFromLocation;
|
|
42
|
-
const
|
|
43
|
-
const laneComponent = fullName ?
|
|
42
|
+
const { lanesModel } = useLanes();
|
|
43
|
+
const laneComponent = fullName ? lanesModel?.resolveComponent(fullName) : undefined;
|
|
44
44
|
const useComponentOptions = {
|
|
45
45
|
logFilters: laneComponent && { log: { logHead: laneComponent.version } },
|
|
46
46
|
customUseComponent: useComponent,
|
package/ui/menu/menu.tsx
CHANGED
|
@@ -8,8 +8,9 @@ import { flatten, groupBy, compact } from 'lodash';
|
|
|
8
8
|
import classnames from 'classnames';
|
|
9
9
|
import React, { useMemo } from 'react';
|
|
10
10
|
import { UseBoxDropdown } from '@teambit/ui-foundation.ui.use-box.dropdown';
|
|
11
|
+
import { useLanes } from '@teambit/lanes.hooks.use-lanes';
|
|
12
|
+
import { LaneModel } from '@teambit/lanes.ui.models';
|
|
11
13
|
import { Menu as ConsumeMethodsMenu } from '@teambit/ui-foundation.ui.use-box.menu';
|
|
12
|
-
import { LaneModel, useLanesContext } from '@teambit/lanes.ui.lanes';
|
|
13
14
|
import { LegacyComponentLog } from '@teambit/legacy-component-log';
|
|
14
15
|
import type { ComponentModel } from '../component-model';
|
|
15
16
|
import { useComponent as useComponentQuery, UseComponentType } from '../use-component';
|
|
@@ -59,8 +60,8 @@ export function ComponentMenu({
|
|
|
59
60
|
const idFromLocation = useIdFromLocation();
|
|
60
61
|
const componentId = componentIdStr ? ComponentID.fromString(componentIdStr) : undefined;
|
|
61
62
|
const fullName = componentId?.fullName || idFromLocation;
|
|
62
|
-
const
|
|
63
|
-
const laneComponent = fullName ?
|
|
63
|
+
const { lanesModel } = useLanes();
|
|
64
|
+
const laneComponent = fullName ? lanesModel?.resolveComponent(fullName) : undefined;
|
|
64
65
|
const useComponentOptions = {
|
|
65
66
|
logFilters: laneComponent && { log: { logHead: laneComponent.version } },
|
|
66
67
|
customUseComponent: useComponent,
|
|
@@ -107,8 +108,8 @@ function VersionRelatedDropdowns({
|
|
|
107
108
|
host: string;
|
|
108
109
|
}) {
|
|
109
110
|
const location = useLocation();
|
|
110
|
-
const
|
|
111
|
-
const currentLane =
|
|
111
|
+
const { lanesModel } = useLanes();
|
|
112
|
+
const currentLane = lanesModel?.viewedLane;
|
|
112
113
|
const { logs } = component;
|
|
113
114
|
const isWorkspace = host === 'teambit.workspace/workspace';
|
|
114
115
|
|
|
@@ -136,7 +137,7 @@ function VersionRelatedDropdowns({
|
|
|
136
137
|
|
|
137
138
|
const isNew = snaps.length === 0 && tags.length === 0;
|
|
138
139
|
|
|
139
|
-
const lanes =
|
|
140
|
+
const lanes = lanesModel?.getLanesByComponentId(component.id) || [];
|
|
140
141
|
const localVersion = isWorkspace && !isNew && !currentLane;
|
|
141
142
|
|
|
142
143
|
const currentVersion =
|
package/ui/menu/nav-plugin.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SlotRegistry } from '@teambit/harmony';
|
|
2
2
|
import type { LinkProps } from '@teambit/base-react.navigation.link';
|
|
3
3
|
import type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';
|
|
4
|
-
import { LaneModel } from '@teambit/lanes.ui.
|
|
4
|
+
import { LaneModel } from '@teambit/lanes.ui.models';
|
|
5
5
|
import { ComponentModel } from '../../ui';
|
|
6
6
|
|
|
7
7
|
export type NavPluginProps = {
|
|
Binary file
|