@teambit/lanes 0.0.535 → 0.0.536
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/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lanes.ui.runtime.d.ts +11 -7
- package/dist/lanes.ui.runtime.js +14 -5
- package/dist/lanes.ui.runtime.js.map +1 -1
- package/dist/{preview-1674039846300.js → preview-1674098968766.js} +2 -2
- package/lanes.ui.runtime.tsx +19 -5
- package/package-tar/teambit-lanes-0.0.536.tgz +0 -0
- package/package.json +27 -27
- package/package-tar/teambit-lanes-0.0.535.tgz +0 -0
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { LanesAspect } from './lanes.aspect';
|
2
2
|
export type { LanesMain, Lane } from './lanes.main.runtime';
|
3
3
|
export { LanesModel, LanesQuery } from '@teambit/lanes.ui.models.lanes-model';
|
4
|
-
export type { LanesUI, LaneCompareProps } from './lanes.ui.runtime';
|
4
|
+
export type { LanesUI, LaneCompareProps, LaneProviderIgnoreSlot } from './lanes.ui.runtime';
|
5
5
|
export default LanesAspect;
|
6
6
|
export { LanesAspect };
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["LanesAspect"],"sources":["index.ts"],"sourcesContent":["import { LanesAspect } from './lanes.aspect';\n\nexport type { LanesMain, Lane } from './lanes.main.runtime';\nexport { LanesModel, LanesQuery } from '@teambit/lanes.ui.models.lanes-model';\nexport type { LanesUI, LaneCompareProps } from './lanes.ui.runtime';\nexport default LanesAspect;\nexport { LanesAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA8E,eAE/DA,oBAAW;AAAA"}
|
1
|
+
{"version":3,"names":["LanesAspect"],"sources":["index.ts"],"sourcesContent":["import { LanesAspect } from './lanes.aspect';\n\nexport type { LanesMain, Lane } from './lanes.main.runtime';\nexport { LanesModel, LanesQuery } from '@teambit/lanes.ui.models.lanes-model';\nexport type { LanesUI, LaneCompareProps, LaneProviderIgnoreSlot } from './lanes.ui.runtime';\nexport default LanesAspect;\nexport { LanesAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA8E,eAE/DA,oBAAW;AAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { RouteProps } from 'react-router-dom';
|
3
|
-
import { Harmony } from '@teambit/harmony';
|
3
|
+
import { Harmony, SlotRegistry } from '@teambit/harmony';
|
4
4
|
import { LaneCompareProps as DefaultLaneCompareProps } from '@teambit/lanes.ui.compare.lane-compare';
|
5
5
|
import { UiUI } from '@teambit/ui';
|
6
6
|
import { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
@@ -10,10 +10,11 @@ import { ComponentID, ComponentUI } from '@teambit/component';
|
|
10
10
|
import { MenuWidget, MenuWidgetSlot } from '@teambit/ui-foundation.ui.menu';
|
11
11
|
import { LaneOverviewLine, LaneOverviewLineSlot } from '@teambit/lanes.ui.lane-overview';
|
12
12
|
import { LanesNavPlugin, LanesOrderedNavigationSlot } from '@teambit/lanes.ui.menus.lanes-overview-menu';
|
13
|
-
import { LanesProvider, useLanes } from '@teambit/lanes.hooks.use-lanes';
|
13
|
+
import { LanesProvider, useLanes, IgnoreDerivingFromUrl } from '@teambit/lanes.hooks.use-lanes';
|
14
14
|
import { LaneId } from '@teambit/lane-id';
|
15
15
|
import { ComponentCompareUI } from '@teambit/component-compare';
|
16
16
|
export declare type LaneCompareProps = Partial<DefaultLaneCompareProps>;
|
17
|
+
export declare type LaneProviderIgnoreSlot = SlotRegistry<IgnoreDerivingFromUrl>;
|
17
18
|
export declare class LanesUI {
|
18
19
|
private componentUI;
|
19
20
|
private componentCompareUI;
|
@@ -24,16 +25,17 @@ export declare class LanesUI {
|
|
24
25
|
* overview line slot to add new lines beneath the overview section
|
25
26
|
*/
|
26
27
|
private overviewSlot;
|
28
|
+
private laneProviderIgnoreSlot;
|
27
29
|
private workspace?;
|
28
30
|
private scope?;
|
29
31
|
static dependencies: import("@teambit/harmony").Aspect[];
|
30
32
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
31
|
-
static slots: (((registerFn: () => string) =>
|
33
|
+
static slots: (((registerFn: () => string) => SlotRegistry<RouteProps>) | ((registerFn: () => string) => SlotRegistry<LaneOverviewLineSlot>) | ((registerFn: () => string) => SlotRegistry<NavigationSlot>) | ((registerFn: () => string) => SlotRegistry<LaneProviderIgnoreSlot>))[];
|
32
34
|
constructor(componentUI: ComponentUI, componentCompareUI: ComponentCompareUI, routeSlot: RouteSlot, navSlot: LanesOrderedNavigationSlot, menuWidgetSlot: MenuWidgetSlot,
|
33
35
|
/**
|
34
36
|
* overview line slot to add new lines beneath the overview section
|
35
37
|
*/
|
36
|
-
overviewSlot: LaneOverviewLineSlot, workspace?: WorkspaceUI | undefined, scope?: ScopeUI | undefined);
|
38
|
+
overviewSlot: LaneOverviewLineSlot, laneProviderIgnoreSlot: LaneProviderIgnoreSlot, workspace?: WorkspaceUI | undefined, scope?: ScopeUI | undefined);
|
37
39
|
private readonly lanesHost;
|
38
40
|
private readonly hostAspect?;
|
39
41
|
private readonly host;
|
@@ -65,7 +67,8 @@ export declare class LanesUI {
|
|
65
67
|
children: JSX.Element;
|
66
68
|
}[];
|
67
69
|
getLanesOverviewMenu(): JSX.Element;
|
68
|
-
registerMenuWidget(...menuItems: MenuWidget[]):
|
70
|
+
registerMenuWidget(...menuItems: MenuWidget[]): this;
|
71
|
+
registerLaneProviderIgnoreSlot(ignoreFn: IgnoreDerivingFromUrl): this;
|
69
72
|
private registerLanesRoutes;
|
70
73
|
private registerRoutes;
|
71
74
|
getLanesSwitcher(): JSX.Element;
|
@@ -86,11 +89,12 @@ export declare class LanesUI {
|
|
86
89
|
WorkspaceUI,
|
87
90
|
ScopeUI,
|
88
91
|
ComponentCompareUI
|
89
|
-
], _: any, [routeSlot, overviewSlot, navSlot, menuWidgetSlot]: [
|
92
|
+
], _: any, [routeSlot, overviewSlot, navSlot, menuWidgetSlot, laneProviderIgnoreSlot]: [
|
90
93
|
RouteSlot,
|
91
94
|
LaneOverviewLineSlot,
|
92
95
|
LanesOrderedNavigationSlot,
|
93
|
-
MenuWidgetSlot
|
96
|
+
MenuWidgetSlot,
|
97
|
+
LaneProviderIgnoreSlot
|
94
98
|
], harmony: Harmony): Promise<LanesUI>;
|
95
99
|
}
|
96
100
|
export default LanesUI;
|
package/dist/lanes.ui.runtime.js
CHANGED
@@ -170,13 +170,14 @@ class LanesUI {
|
|
170
170
|
/**
|
171
171
|
* overview line slot to add new lines beneath the overview section
|
172
172
|
*/
|
173
|
-
overviewSlot, workspace, scope) {
|
173
|
+
overviewSlot, laneProviderIgnoreSlot, workspace, scope) {
|
174
174
|
this.componentUI = componentUI;
|
175
175
|
this.componentCompareUI = componentCompareUI;
|
176
176
|
this.routeSlot = routeSlot;
|
177
177
|
this.navSlot = navSlot;
|
178
178
|
this.menuWidgetSlot = menuWidgetSlot;
|
179
179
|
this.overviewSlot = overviewSlot;
|
180
|
+
this.laneProviderIgnoreSlot = laneProviderIgnoreSlot;
|
180
181
|
this.workspace = workspace;
|
181
182
|
this.scope = scope;
|
182
183
|
(0, _defineProperty2().default)(this, "lanesHost", void 0);
|
@@ -206,7 +207,10 @@ class LanesUI {
|
|
206
207
|
(0, _defineProperty2().default)(this, "renderContext", ({
|
207
208
|
children
|
208
209
|
}) => {
|
209
|
-
|
210
|
+
const ignoreFns = this.laneProviderIgnoreSlot.values();
|
211
|
+
return /*#__PURE__*/_react().default.createElement(_lanesHooks().LanesProvider, {
|
212
|
+
ignoreDerivingFromUrl: ignoreFns
|
213
|
+
}, children);
|
210
214
|
});
|
211
215
|
(0, _defineProperty2().default)(this, "getLaneCompare", props => {
|
212
216
|
const routes = this.componentCompareUI.routes;
|
@@ -333,6 +337,11 @@ class LanesUI {
|
|
333
337
|
}
|
334
338
|
registerMenuWidget(...menuItems) {
|
335
339
|
this.menuWidgetSlot.register(menuItems);
|
340
|
+
return this;
|
341
|
+
}
|
342
|
+
registerLaneProviderIgnoreSlot(ignoreFn) {
|
343
|
+
this.laneProviderIgnoreSlot.register(ignoreFn);
|
344
|
+
return this;
|
336
345
|
}
|
337
346
|
registerLanesRoutes() {
|
338
347
|
this.registerNavigation([
|
@@ -405,7 +414,7 @@ class LanesUI {
|
|
405
414
|
registerNavigation(routes) {
|
406
415
|
this.navSlot.register(routes);
|
407
416
|
}
|
408
|
-
static async provider([uiUi, componentUI, workspaceUi, scopeUi, componentCompareUI], _, [routeSlot, overviewSlot, navSlot, menuWidgetSlot], harmony) {
|
417
|
+
static async provider([uiUi, componentUI, workspaceUi, scopeUi, componentCompareUI], _, [routeSlot, overviewSlot, navSlot, menuWidgetSlot, laneProviderIgnoreSlot], harmony) {
|
409
418
|
const {
|
410
419
|
config
|
411
420
|
} = harmony;
|
@@ -418,7 +427,7 @@ class LanesUI {
|
|
418
427
|
if (host === _scope().default.id) {
|
419
428
|
scope = scopeUi;
|
420
429
|
}
|
421
|
-
const lanesUi = new LanesUI(componentUI, componentCompareUI, routeSlot, navSlot, overviewSlot, menuWidgetSlot, workspace, scope);
|
430
|
+
const lanesUi = new LanesUI(componentUI, componentCompareUI, routeSlot, navSlot, overviewSlot, menuWidgetSlot, laneProviderIgnoreSlot, workspace, scope);
|
422
431
|
if (uiUi) uiUi.registerRenderHooks({
|
423
432
|
reactContext: lanesUi.renderContext
|
424
433
|
});
|
@@ -445,7 +454,7 @@ class LanesUI {
|
|
445
454
|
exports.LanesUI = LanesUI;
|
446
455
|
(0, _defineProperty2().default)(LanesUI, "dependencies", [_ui().UIAspect, _component().default, _workspace().default, _scope().default, _componentCompare().ComponentCompareAspect]);
|
447
456
|
(0, _defineProperty2().default)(LanesUI, "runtime", _ui().UIRuntime);
|
448
|
-
(0, _defineProperty2().default)(LanesUI, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
|
457
|
+
(0, _defineProperty2().default)(LanesUI, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
|
449
458
|
var _default = LanesUI;
|
450
459
|
exports.default = _default;
|
451
460
|
_lanes().LanesAspect.addRuntime(LanesUI);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["LanesUI","constructor","componentUI","componentCompareUI","routeSlot","navSlot","menuWidgetSlot","overviewSlot","workspace","scope","idFromLocation","useIdFromLocation","lanesModel","useLanes","laneFromUrl","useViewedLaneFromUrl","laneComponentId","isDefault","resolveComponentFromUrl","undefined","getLaneComponentIdFromUrl","toString","log","logHead","version","children","props","routes","navLinks","getElement","routeProps","href","length","element","find","route","path","startsWith","tabs","flatten","Array","from","entries","map","id","navProps","maybeRoutesForId","get","routesForId","isArray","navProp","base","compare","host","hostAspect","lanesHost","WorkspaceAspect","ScopeAspect","registerHostAspectRoutes","registerRoutes","getLaneRoutes","registerMenuRoutes","getMenuRoutes","LanesModel","lanesPrefix","lanePath","getLaneOverview","getLaneComponent","overrideComputeLaneUrl","fn","prefix","getLaneComponentUrl","getLaneIdFromPathname","getLaneUrl","getComponentUI","componentId","useComponentId","useComponentFilters","getLaneComponentMenu","getMenu","getLanesComparePage","getLaneCompare","getLanesOverviewMenu","registerMenuWidget","menuItems","register","registerLanesRoutes","registerNavigation","exact","order","hide","getLanesSwitcher","LanesSwitcher","getLanesProvider","LanesProvider","getUseLanes","registerLanesDropdown","registerSidebarLink","component","Gallery","weight","registerRoute","registerOverviewLine","lines","provider","uiUi","workspaceUi","scopeUi","_","harmony","config","String","lanesUi","registerRenderHooks","reactContext","renderContext","viewedLane","currentLane","UIAspect","ComponentAspect","ComponentCompareAspect","UIRuntime","Slot","withType","LanesAspect","addRuntime"],"sources":["lanes.ui.runtime.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Route, RouteProps } from 'react-router-dom';\nimport { flatten } from 'lodash';\nimport { Slot, Harmony } from '@teambit/harmony';\nimport { LaneCompare, LaneCompareProps as DefaultLaneCompareProps } from '@teambit/lanes.ui.compare.lane-compare';\nimport { UIRuntime, UiUI, UIAspect } from '@teambit/ui';\nimport { LanesAspect } from '@teambit/lanes';\nimport { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { NotFoundPage } from '@teambit/design.ui.pages.not-found';\nimport ScopeAspect, { ScopeUI } from '@teambit/scope';\nimport WorkspaceAspect, { WorkspaceUI } from '@teambit/workspace';\nimport ComponentAspect, { ComponentID, ComponentUI, useIdFromLocation } from '@teambit/component';\nimport { MenuWidget, MenuWidgetSlot } from '@teambit/ui-foundation.ui.menu';\nimport { LaneOverview, LaneOverviewLine, LaneOverviewLineSlot } from '@teambit/lanes.ui.lane-overview';\nimport {\n LanesNavPlugin,\n LanesOrderedNavigationSlot,\n LanesOverviewMenu,\n} from '@teambit/lanes.ui.menus.lanes-overview-menu';\nimport { UseLaneMenu } from '@teambit/lanes.ui.menus.use-lanes-menu';\nimport { LanesHost, LanesModel } from '@teambit/lanes.ui.models.lanes-model';\nimport { LanesProvider, useLanes } from '@teambit/lanes.hooks.use-lanes';\nimport { LaneSwitcher } from '@teambit/lanes.ui.navigation.lane-switcher';\nimport { LaneId } from '@teambit/lane-id';\nimport { useViewedLaneFromUrl } from '@teambit/lanes.hooks.use-viewed-lane-from-url';\nimport { TabItem } from '@teambit/component.ui.component-compare.models.component-compare-props';\nimport { ComponentCompareAspect, ComponentCompareUI } from '@teambit/component-compare';\nimport { LaneComparePage } from '@teambit/lanes.ui.compare.lane-compare-page';\n\nexport type LaneCompareProps = Partial<DefaultLaneCompareProps>;\nexport class LanesUI {\n static dependencies = [UIAspect, ComponentAspect, WorkspaceAspect, ScopeAspect, ComponentCompareAspect];\n\n static runtime = UIRuntime;\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<LaneOverviewLineSlot>(),\n Slot.withType<NavigationSlot>(),\n Slot.withType<MenuWidgetSlot>(),\n ];\n\n constructor(\n private componentUI: ComponentUI,\n private componentCompareUI: ComponentCompareUI,\n private routeSlot: RouteSlot,\n private navSlot: LanesOrderedNavigationSlot,\n private menuWidgetSlot: MenuWidgetSlot,\n /**\n * overview line slot to add new lines beneath the overview section\n */\n private overviewSlot: LaneOverviewLineSlot,\n private workspace?: WorkspaceUI,\n private scope?: ScopeUI\n ) {\n this.hostAspect = workspace || scope;\n this.lanesHost = workspace ? 'workspace' : 'scope';\n this.host = workspace ? WorkspaceAspect.id : ScopeAspect.id;\n }\n\n private readonly lanesHost: LanesHost;\n private readonly hostAspect?: WorkspaceUI | ScopeUI;\n private readonly host: string;\n\n private registerHostAspectRoutes() {\n if (!this.hostAspect) return;\n this.hostAspect.registerRoutes(this.getLaneRoutes());\n this.hostAspect.registerMenuRoutes(this.getMenuRoutes());\n }\n\n getLaneRoutes() {\n return [\n {\n path: LanesModel.lanesPrefix,\n children: (\n <>\n <Route path={LanesModel.lanePath}>\n <Route index element={this.getLaneOverview()} />\n <Route path=\"~component/*\" element={this.getLaneComponent()} />\n {/* <Route path=\"~compare/*\" element={this.getLanesComparePage()} /> */}\n <Route path=\"*\" element={<NotFoundPage />} />\n </Route>\n <Route path=\"*\" element={<NotFoundPage />} />\n </>\n ),\n },\n ];\n }\n\n overrideComputeLaneUrl(\n fn: () => {\n prefix: string;\n path: string;\n getLaneIdFromPathname: (pathname: string) => LaneId | undefined;\n getLaneUrl: (laneId: LaneId, relative?: boolean) => string;\n getLaneComponentUrl: (componentId: ComponentID, laneId: LaneId) => string;\n }\n ) {\n const { prefix, path, getLaneComponentUrl, getLaneIdFromPathname, getLaneUrl } = fn();\n LanesModel.lanesPrefix = prefix;\n LanesModel.lanePath = path;\n LanesModel.getLaneComponentUrl = getLaneComponentUrl;\n LanesModel.getLaneUrl = getLaneUrl;\n LanesModel.getLaneIdFromPathname = getLaneIdFromPathname;\n }\n\n // getLaneReadme() {\n // return <LaneReadmeOverview host={this.host} overviewSlot={this.overviewSlot} routeSlot={this.routeSlot} />;\n // }\n\n getLaneComponentIdFromUrl = () => {\n const idFromLocation = useIdFromLocation();\n const { lanesModel } = useLanes();\n const laneFromUrl = useViewedLaneFromUrl();\n const laneComponentId =\n idFromLocation && !laneFromUrl?.isDefault()\n ? lanesModel?.resolveComponentFromUrl(idFromLocation, laneFromUrl)\n : undefined;\n return laneComponentId;\n };\n\n useComponentId = () => {\n return this.getLaneComponentIdFromUrl()?.toString();\n };\n\n useComponentFilters = () => {\n const laneComponentId = this.getLaneComponentIdFromUrl();\n\n return {\n log: laneComponentId && {\n logHead: laneComponentId.version,\n },\n };\n };\n\n getLaneComponent() {\n return this.componentUI.getComponentUI(this.host, {\n componentId: this.useComponentId,\n useComponentFilters: this.useComponentFilters,\n });\n }\n\n getLaneComponentMenu() {\n return this.componentUI.getMenu(this.host, {\n componentId: this.useComponentId,\n useComponentFilters: this.useComponentFilters,\n });\n }\n\n getLaneOverview() {\n return <LaneOverview routeSlot={this.routeSlot} overviewSlot={this.overviewSlot} host={this.lanesHost} />;\n }\n\n getLanesComparePage() {\n return <LaneComparePage getLaneCompare={this.getLaneCompare} />;\n }\n\n getMenuRoutes() {\n return [\n {\n path: LanesModel.lanesPrefix,\n children: (\n <Route path={`${LanesModel.lanePath}/*`}>\n <Route path={'*'} element={this.getLanesOverviewMenu()} />\n <Route path=\"~component/*\" element={this.getLaneComponentMenu()} />\n </Route>\n ),\n },\n ];\n }\n\n getLanesOverviewMenu() {\n return <LanesOverviewMenu navigationSlot={this.navSlot} widgetSlot={this.menuWidgetSlot} />;\n }\n\n registerMenuWidget(...menuItems: MenuWidget[]) {\n this.menuWidgetSlot.register(menuItems);\n }\n\n private registerLanesRoutes() {\n this.registerNavigation([\n // {\n // props: {\n // href: '.',\n // exact: true,\n // children: 'README',\n // },\n // order: 1,\n // hide: () => {\n // const { lanesModel } = useLanes();\n // return !lanesModel?.viewedLane?.readmeComponent;\n // },\n // },\n {\n props: {\n href: '.',\n exact: true,\n children: 'Overview',\n },\n order: 1,\n },\n {\n props: {\n href: '~compare',\n children: 'Lane Compare',\n },\n order: 2,\n hide: () => true,\n },\n ]);\n }\n\n private registerRoutes() {\n this.registerHostAspectRoutes();\n this.registerLanesRoutes();\n }\n\n getLanesSwitcher() {\n const LanesSwitcher = <LaneSwitcher groupByScope={this.lanesHost === 'workspace'} />;\n return LanesSwitcher;\n }\n\n getLanesProvider() {\n return LanesProvider;\n }\n\n getUseLanes() {\n return useLanes;\n }\n\n private registerLanesDropdown() {\n const LanesSwitcher = this.getLanesSwitcher();\n\n this.hostAspect?.registerSidebarLink({\n component: function Gallery() {\n return LanesSwitcher;\n },\n weight: 1000,\n });\n }\n\n private renderContext = ({ children }: { children: ReactNode }) => {\n return <LanesProvider>{children}</LanesProvider>;\n };\n\n registerRoute(route: RouteProps) {\n this.routeSlot.register(route);\n return this;\n }\n\n /**\n * register a new line beneath the lane overview section.\n */\n registerOverviewLine(...lines: LaneOverviewLine[]) {\n this.overviewSlot.register(lines);\n return this;\n }\n\n registerNavigation(routes: LanesNavPlugin[]) {\n this.navSlot.register(routes);\n }\n\n getLaneCompare = (props: LaneCompareProps) => {\n const routes = this.componentCompareUI.routes;\n const navLinks = this.componentCompareUI.navLinks;\n\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 const tabs: TabItem[] = flatten(\n Array.from(navLinks.entries()).map(([id, navProps]) => {\n const maybeRoutesForId = routes.get(id);\n const routesForId =\n (maybeRoutesForId && (Array.isArray(maybeRoutesForId) ? [...maybeRoutesForId] : [maybeRoutesForId])) || [];\n\n return navProps.map((navProp) => ({\n ...navProp,\n id: `${id}-${navProp?.id}`,\n element: getElement(routesForId, navProp?.props?.href),\n }));\n })\n );\n\n if (!props.base || !props.compare) return null;\n\n return (\n <LaneCompare\n {...props}\n base={props.base}\n compare={props.compare}\n host={props.host || this.host}\n tabs={props.tabs || tabs}\n />\n );\n };\n\n static async provider(\n [uiUi, componentUI, workspaceUi, scopeUi, componentCompareUI]: [\n UiUI,\n ComponentUI,\n WorkspaceUI,\n ScopeUI,\n ComponentCompareUI\n ],\n _,\n [routeSlot, overviewSlot, navSlot, menuWidgetSlot]: [\n RouteSlot,\n LaneOverviewLineSlot,\n LanesOrderedNavigationSlot,\n MenuWidgetSlot\n ],\n harmony: Harmony\n ) {\n const { config } = harmony;\n const host = String(config.get('teambit.harmony/bit'));\n let workspace: WorkspaceUI | undefined;\n let scope: ScopeUI | undefined;\n if (host === WorkspaceAspect.id) {\n workspace = workspaceUi;\n }\n if (host === ScopeAspect.id) {\n scope = scopeUi;\n }\n const lanesUi = new LanesUI(\n componentUI,\n componentCompareUI,\n routeSlot,\n navSlot,\n overviewSlot,\n menuWidgetSlot,\n workspace,\n scope\n );\n if (uiUi) uiUi.registerRenderHooks({ reactContext: lanesUi.renderContext });\n lanesUi.registerRoutes();\n lanesUi.registerMenuWidget(() => {\n const { lanesModel } = useLanes();\n if (!lanesModel?.viewedLane) return null;\n const { viewedLane, currentLane } = lanesModel;\n return <UseLaneMenu host={lanesUi.lanesHost} viewedLaneId={viewedLane.id} currentLaneId={currentLane?.id} />;\n });\n lanesUi.registerLanesDropdown();\n return lanesUi;\n }\n}\n\nexport default LanesUI;\n\nLanesAspect.addRuntime(LanesUI);\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;AAC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ACxC,MAAM;QAAEA,UAAU;QAAEC;MAAY,CAAC,GAAGzG,UAAU;MAC9C,oBAAO,+BAAC,4BAAW;QAAC,IAAI,EAAEoG,OAAO,CAACzD,SAAU;QAAC,YAAY,EAAE6D,UAAU,CAACxE,EAAG;QAAC,aAAa,EAAEyE,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEzE;MAAG,EAAG;IAC9G,CAAC,CAAC;IACFoE,OAAO,CAAChB,qBAAqB,EAAE;IAC/B,OAAOgB,OAAO;EAChB;AACF;AAAC;AAAA,gCA5TYhH,OAAO,kBACI,CAACsH,cAAQ,EAAEC,oBAAe,EAAE/D,oBAAe,EAAEC,gBAAW,EAAE+D,0CAAsB,CAAC;AAAA,gCAD5FxH,OAAO,aAGDyH,eAAS;AAAA,gCAHfzH,OAAO,WAIH,CACb0H,eAAI,CAACC,QAAQ,EAAc,EAC3BD,eAAI,CAACC,QAAQ,EAAwB,EACrCD,eAAI,CAACC,QAAQ,EAAkB,EAC/BD,eAAI,CAACC,QAAQ,EAAkB,CAChC;AAAA,eAqTY3H,OAAO;AAAA;AAEtB4H,oBAAW,CAACC,UAAU,CAAC7H,OAAO,CAAC"}
|
1
|
+
{"version":3,"names":["LanesUI","constructor","componentUI","componentCompareUI","routeSlot","navSlot","menuWidgetSlot","overviewSlot","laneProviderIgnoreSlot","workspace","scope","idFromLocation","useIdFromLocation","lanesModel","useLanes","laneFromUrl","useViewedLaneFromUrl","laneComponentId","isDefault","resolveComponentFromUrl","undefined","getLaneComponentIdFromUrl","toString","log","logHead","version","children","ignoreFns","values","props","routes","navLinks","getElement","routeProps","href","length","element","find","route","path","startsWith","tabs","flatten","Array","from","entries","map","id","navProps","maybeRoutesForId","get","routesForId","isArray","navProp","base","compare","host","hostAspect","lanesHost","WorkspaceAspect","ScopeAspect","registerHostAspectRoutes","registerRoutes","getLaneRoutes","registerMenuRoutes","getMenuRoutes","LanesModel","lanesPrefix","lanePath","getLaneOverview","getLaneComponent","overrideComputeLaneUrl","fn","prefix","getLaneComponentUrl","getLaneIdFromPathname","getLaneUrl","getComponentUI","componentId","useComponentId","useComponentFilters","getLaneComponentMenu","getMenu","getLanesComparePage","getLaneCompare","getLanesOverviewMenu","registerMenuWidget","menuItems","register","registerLaneProviderIgnoreSlot","ignoreFn","registerLanesRoutes","registerNavigation","exact","order","hide","getLanesSwitcher","LanesSwitcher","getLanesProvider","LanesProvider","getUseLanes","registerLanesDropdown","registerSidebarLink","component","Gallery","weight","registerRoute","registerOverviewLine","lines","provider","uiUi","workspaceUi","scopeUi","_","harmony","config","String","lanesUi","registerRenderHooks","reactContext","renderContext","viewedLane","currentLane","UIAspect","ComponentAspect","ComponentCompareAspect","UIRuntime","Slot","withType","LanesAspect","addRuntime"],"sources":["lanes.ui.runtime.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Route, RouteProps } from 'react-router-dom';\nimport { flatten } from 'lodash';\nimport { Slot, Harmony, SlotRegistry } from '@teambit/harmony';\nimport { LaneCompare, LaneCompareProps as DefaultLaneCompareProps } from '@teambit/lanes.ui.compare.lane-compare';\nimport { UIRuntime, UiUI, UIAspect } from '@teambit/ui';\nimport { LanesAspect } from '@teambit/lanes';\nimport { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { NotFoundPage } from '@teambit/design.ui.pages.not-found';\nimport ScopeAspect, { ScopeUI } from '@teambit/scope';\nimport WorkspaceAspect, { WorkspaceUI } from '@teambit/workspace';\nimport ComponentAspect, { ComponentID, ComponentUI, useIdFromLocation } from '@teambit/component';\nimport { MenuWidget, MenuWidgetSlot } from '@teambit/ui-foundation.ui.menu';\nimport { LaneOverview, LaneOverviewLine, LaneOverviewLineSlot } from '@teambit/lanes.ui.lane-overview';\nimport {\n LanesNavPlugin,\n LanesOrderedNavigationSlot,\n LanesOverviewMenu,\n} from '@teambit/lanes.ui.menus.lanes-overview-menu';\nimport { UseLaneMenu } from '@teambit/lanes.ui.menus.use-lanes-menu';\nimport { LanesHost, LanesModel } from '@teambit/lanes.ui.models.lanes-model';\nimport { LanesProvider, useLanes, IgnoreDerivingFromUrl } from '@teambit/lanes.hooks.use-lanes';\nimport { LaneSwitcher } from '@teambit/lanes.ui.navigation.lane-switcher';\nimport { LaneId } from '@teambit/lane-id';\nimport { useViewedLaneFromUrl } from '@teambit/lanes.hooks.use-viewed-lane-from-url';\nimport { TabItem } from '@teambit/component.ui.component-compare.models.component-compare-props';\nimport { ComponentCompareAspect, ComponentCompareUI } from '@teambit/component-compare';\nimport { LaneComparePage } from '@teambit/lanes.ui.compare.lane-compare-page';\n\nexport type LaneCompareProps = Partial<DefaultLaneCompareProps>;\nexport type LaneProviderIgnoreSlot = SlotRegistry<IgnoreDerivingFromUrl>;\n\nexport class LanesUI {\n static dependencies = [UIAspect, ComponentAspect, WorkspaceAspect, ScopeAspect, ComponentCompareAspect];\n\n static runtime = UIRuntime;\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<LaneOverviewLineSlot>(),\n Slot.withType<NavigationSlot>(),\n Slot.withType<MenuWidgetSlot>(),\n Slot.withType<LaneProviderIgnoreSlot>(),\n ];\n\n constructor(\n private componentUI: ComponentUI,\n private componentCompareUI: ComponentCompareUI,\n private routeSlot: RouteSlot,\n private navSlot: LanesOrderedNavigationSlot,\n private menuWidgetSlot: MenuWidgetSlot,\n /**\n * overview line slot to add new lines beneath the overview section\n */\n private overviewSlot: LaneOverviewLineSlot,\n private laneProviderIgnoreSlot: LaneProviderIgnoreSlot,\n private workspace?: WorkspaceUI,\n private scope?: ScopeUI\n ) {\n this.hostAspect = workspace || scope;\n this.lanesHost = workspace ? 'workspace' : 'scope';\n this.host = workspace ? WorkspaceAspect.id : ScopeAspect.id;\n }\n\n private readonly lanesHost: LanesHost;\n private readonly hostAspect?: WorkspaceUI | ScopeUI;\n private readonly host: string;\n\n private registerHostAspectRoutes() {\n if (!this.hostAspect) return;\n this.hostAspect.registerRoutes(this.getLaneRoutes());\n this.hostAspect.registerMenuRoutes(this.getMenuRoutes());\n }\n\n getLaneRoutes() {\n return [\n {\n path: LanesModel.lanesPrefix,\n children: (\n <>\n <Route path={LanesModel.lanePath}>\n <Route index element={this.getLaneOverview()} />\n <Route path=\"~component/*\" element={this.getLaneComponent()} />\n {/* <Route path=\"~compare/*\" element={this.getLanesComparePage()} /> */}\n <Route path=\"*\" element={<NotFoundPage />} />\n </Route>\n <Route path=\"*\" element={<NotFoundPage />} />\n </>\n ),\n },\n ];\n }\n\n overrideComputeLaneUrl(\n fn: () => {\n prefix: string;\n path: string;\n getLaneIdFromPathname: (pathname: string) => LaneId | undefined;\n getLaneUrl: (laneId: LaneId, relative?: boolean) => string;\n getLaneComponentUrl: (componentId: ComponentID, laneId: LaneId) => string;\n }\n ) {\n const { prefix, path, getLaneComponentUrl, getLaneIdFromPathname, getLaneUrl } = fn();\n LanesModel.lanesPrefix = prefix;\n LanesModel.lanePath = path;\n LanesModel.getLaneComponentUrl = getLaneComponentUrl;\n LanesModel.getLaneUrl = getLaneUrl;\n LanesModel.getLaneIdFromPathname = getLaneIdFromPathname;\n }\n\n // getLaneReadme() {\n // return <LaneReadmeOverview host={this.host} overviewSlot={this.overviewSlot} routeSlot={this.routeSlot} />;\n // }\n\n getLaneComponentIdFromUrl = () => {\n const idFromLocation = useIdFromLocation();\n const { lanesModel } = useLanes();\n const laneFromUrl = useViewedLaneFromUrl();\n const laneComponentId =\n idFromLocation && !laneFromUrl?.isDefault()\n ? lanesModel?.resolveComponentFromUrl(idFromLocation, laneFromUrl)\n : undefined;\n return laneComponentId;\n };\n\n useComponentId = () => {\n return this.getLaneComponentIdFromUrl()?.toString();\n };\n\n useComponentFilters = () => {\n const laneComponentId = this.getLaneComponentIdFromUrl();\n\n return {\n log: laneComponentId && {\n logHead: laneComponentId.version,\n },\n };\n };\n\n getLaneComponent() {\n return this.componentUI.getComponentUI(this.host, {\n componentId: this.useComponentId,\n useComponentFilters: this.useComponentFilters,\n });\n }\n\n getLaneComponentMenu() {\n return this.componentUI.getMenu(this.host, {\n componentId: this.useComponentId,\n useComponentFilters: this.useComponentFilters,\n });\n }\n\n getLaneOverview() {\n return <LaneOverview routeSlot={this.routeSlot} overviewSlot={this.overviewSlot} host={this.lanesHost} />;\n }\n\n getLanesComparePage() {\n return <LaneComparePage getLaneCompare={this.getLaneCompare} />;\n }\n\n getMenuRoutes() {\n return [\n {\n path: LanesModel.lanesPrefix,\n children: (\n <Route path={`${LanesModel.lanePath}/*`}>\n <Route path={'*'} element={this.getLanesOverviewMenu()} />\n <Route path=\"~component/*\" element={this.getLaneComponentMenu()} />\n </Route>\n ),\n },\n ];\n }\n\n getLanesOverviewMenu() {\n return <LanesOverviewMenu navigationSlot={this.navSlot} widgetSlot={this.menuWidgetSlot} />;\n }\n\n registerMenuWidget(...menuItems: MenuWidget[]) {\n this.menuWidgetSlot.register(menuItems);\n return this;\n }\n\n registerLaneProviderIgnoreSlot(ignoreFn: IgnoreDerivingFromUrl) {\n this.laneProviderIgnoreSlot.register(ignoreFn);\n return this;\n }\n\n private registerLanesRoutes() {\n this.registerNavigation([\n // {\n // props: {\n // href: '.',\n // exact: true,\n // children: 'README',\n // },\n // order: 1,\n // hide: () => {\n // const { lanesModel } = useLanes();\n // return !lanesModel?.viewedLane?.readmeComponent;\n // },\n // },\n {\n props: {\n href: '.',\n exact: true,\n children: 'Overview',\n },\n order: 1,\n },\n {\n props: {\n href: '~compare',\n children: 'Lane Compare',\n },\n order: 2,\n hide: () => true,\n },\n ]);\n }\n\n private registerRoutes() {\n this.registerHostAspectRoutes();\n this.registerLanesRoutes();\n }\n\n getLanesSwitcher() {\n const LanesSwitcher = <LaneSwitcher groupByScope={this.lanesHost === 'workspace'} />;\n return LanesSwitcher;\n }\n\n getLanesProvider() {\n return LanesProvider;\n }\n\n getUseLanes() {\n return useLanes;\n }\n\n private registerLanesDropdown() {\n const LanesSwitcher = this.getLanesSwitcher();\n\n this.hostAspect?.registerSidebarLink({\n component: function Gallery() {\n return LanesSwitcher;\n },\n weight: 1000,\n });\n }\n\n private renderContext = ({ children }: { children: ReactNode }) => {\n const ignoreFns = this.laneProviderIgnoreSlot.values();\n\n return <LanesProvider ignoreDerivingFromUrl={ignoreFns}>{children}</LanesProvider>;\n };\n\n registerRoute(route: RouteProps) {\n this.routeSlot.register(route);\n return this;\n }\n\n /**\n * register a new line beneath the lane overview section.\n */\n registerOverviewLine(...lines: LaneOverviewLine[]) {\n this.overviewSlot.register(lines);\n return this;\n }\n\n registerNavigation(routes: LanesNavPlugin[]) {\n this.navSlot.register(routes);\n }\n\n getLaneCompare = (props: LaneCompareProps) => {\n const routes = this.componentCompareUI.routes;\n const navLinks = this.componentCompareUI.navLinks;\n\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 const tabs: TabItem[] = flatten(\n Array.from(navLinks.entries()).map(([id, navProps]) => {\n const maybeRoutesForId = routes.get(id);\n const routesForId =\n (maybeRoutesForId && (Array.isArray(maybeRoutesForId) ? [...maybeRoutesForId] : [maybeRoutesForId])) || [];\n\n return navProps.map((navProp) => ({\n ...navProp,\n id: `${id}-${navProp?.id}`,\n element: getElement(routesForId, navProp?.props?.href),\n }));\n })\n );\n\n if (!props.base || !props.compare) return null;\n\n return (\n <LaneCompare\n {...props}\n base={props.base}\n compare={props.compare}\n host={props.host || this.host}\n tabs={props.tabs || tabs}\n />\n );\n };\n\n static async provider(\n [uiUi, componentUI, workspaceUi, scopeUi, componentCompareUI]: [\n UiUI,\n ComponentUI,\n WorkspaceUI,\n ScopeUI,\n ComponentCompareUI\n ],\n _,\n [routeSlot, overviewSlot, navSlot, menuWidgetSlot, laneProviderIgnoreSlot]: [\n RouteSlot,\n LaneOverviewLineSlot,\n LanesOrderedNavigationSlot,\n MenuWidgetSlot,\n LaneProviderIgnoreSlot\n ],\n harmony: Harmony\n ) {\n const { config } = harmony;\n const host = String(config.get('teambit.harmony/bit'));\n let workspace: WorkspaceUI | undefined;\n let scope: ScopeUI | undefined;\n if (host === WorkspaceAspect.id) {\n workspace = workspaceUi;\n }\n if (host === ScopeAspect.id) {\n scope = scopeUi;\n }\n const lanesUi = new LanesUI(\n componentUI,\n componentCompareUI,\n routeSlot,\n navSlot,\n overviewSlot,\n menuWidgetSlot,\n laneProviderIgnoreSlot,\n workspace,\n scope\n );\n if (uiUi) uiUi.registerRenderHooks({ reactContext: lanesUi.renderContext });\n lanesUi.registerRoutes();\n lanesUi.registerMenuWidget(() => {\n const { lanesModel } = useLanes();\n if (!lanesModel?.viewedLane) return null;\n const { viewedLane, currentLane } = lanesModel;\n return <UseLaneMenu host={lanesUi.lanesHost} viewedLaneId={viewedLane.id} currentLaneId={currentLane?.id} />;\n });\n lanesUi.registerLanesDropdown();\n return lanesUi;\n }\n}\n\nexport default LanesUI;\n\nLanesAspect.addRuntime(LanesUI);\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;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;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;E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AAU,CAAC1E,EAAG;QAAC,aAAa,EAAE2E,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAE3E;MAAG,EAAG;IAC9G,CAAC,CAAC;IACFsE,OAAO,CAAChB,qBAAqB,EAAE;IAC/B,OAAOgB,OAAO;EAChB;AACF;AAAC;AAAA,gCAxUYrH,OAAO,kBACI,CAAC2H,cAAQ,EAAEC,oBAAe,EAAEjE,oBAAe,EAAEC,gBAAW,EAAEiE,0CAAsB,CAAC;AAAA,gCAD5F7H,OAAO,aAGD8H,eAAS;AAAA,gCAHf9H,OAAO,WAIH,CACb+H,eAAI,CAACC,QAAQ,EAAc,EAC3BD,eAAI,CAACC,QAAQ,EAAwB,EACrCD,eAAI,CAACC,QAAQ,EAAkB,EAC/BD,eAAI,CAACC,QAAQ,EAAkB,EAC/BD,eAAI,CAACC,QAAQ,EAA0B,CACxC;AAAA,eAgUYhI,OAAO;AAAA;AAEtBiI,oBAAW,CAACC,UAAU,CAAClI,OAAO,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.536/dist/lanes.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.536/dist/lanes.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/lanes.ui.runtime.tsx
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
2
|
import { Route, RouteProps } from 'react-router-dom';
|
3
3
|
import { flatten } from 'lodash';
|
4
|
-
import { Slot, Harmony } from '@teambit/harmony';
|
4
|
+
import { Slot, Harmony, SlotRegistry } from '@teambit/harmony';
|
5
5
|
import { LaneCompare, LaneCompareProps as DefaultLaneCompareProps } from '@teambit/lanes.ui.compare.lane-compare';
|
6
6
|
import { UIRuntime, UiUI, UIAspect } from '@teambit/ui';
|
7
7
|
import { LanesAspect } from '@teambit/lanes';
|
@@ -19,7 +19,7 @@ import {
|
|
19
19
|
} from '@teambit/lanes.ui.menus.lanes-overview-menu';
|
20
20
|
import { UseLaneMenu } from '@teambit/lanes.ui.menus.use-lanes-menu';
|
21
21
|
import { LanesHost, LanesModel } from '@teambit/lanes.ui.models.lanes-model';
|
22
|
-
import { LanesProvider, useLanes } from '@teambit/lanes.hooks.use-lanes';
|
22
|
+
import { LanesProvider, useLanes, IgnoreDerivingFromUrl } from '@teambit/lanes.hooks.use-lanes';
|
23
23
|
import { LaneSwitcher } from '@teambit/lanes.ui.navigation.lane-switcher';
|
24
24
|
import { LaneId } from '@teambit/lane-id';
|
25
25
|
import { useViewedLaneFromUrl } from '@teambit/lanes.hooks.use-viewed-lane-from-url';
|
@@ -28,6 +28,8 @@ import { ComponentCompareAspect, ComponentCompareUI } from '@teambit/component-c
|
|
28
28
|
import { LaneComparePage } from '@teambit/lanes.ui.compare.lane-compare-page';
|
29
29
|
|
30
30
|
export type LaneCompareProps = Partial<DefaultLaneCompareProps>;
|
31
|
+
export type LaneProviderIgnoreSlot = SlotRegistry<IgnoreDerivingFromUrl>;
|
32
|
+
|
31
33
|
export class LanesUI {
|
32
34
|
static dependencies = [UIAspect, ComponentAspect, WorkspaceAspect, ScopeAspect, ComponentCompareAspect];
|
33
35
|
|
@@ -37,6 +39,7 @@ export class LanesUI {
|
|
37
39
|
Slot.withType<LaneOverviewLineSlot>(),
|
38
40
|
Slot.withType<NavigationSlot>(),
|
39
41
|
Slot.withType<MenuWidgetSlot>(),
|
42
|
+
Slot.withType<LaneProviderIgnoreSlot>(),
|
40
43
|
];
|
41
44
|
|
42
45
|
constructor(
|
@@ -49,6 +52,7 @@ export class LanesUI {
|
|
49
52
|
* overview line slot to add new lines beneath the overview section
|
50
53
|
*/
|
51
54
|
private overviewSlot: LaneOverviewLineSlot,
|
55
|
+
private laneProviderIgnoreSlot: LaneProviderIgnoreSlot,
|
52
56
|
private workspace?: WorkspaceUI,
|
53
57
|
private scope?: ScopeUI
|
54
58
|
) {
|
@@ -174,6 +178,12 @@ export class LanesUI {
|
|
174
178
|
|
175
179
|
registerMenuWidget(...menuItems: MenuWidget[]) {
|
176
180
|
this.menuWidgetSlot.register(menuItems);
|
181
|
+
return this;
|
182
|
+
}
|
183
|
+
|
184
|
+
registerLaneProviderIgnoreSlot(ignoreFn: IgnoreDerivingFromUrl) {
|
185
|
+
this.laneProviderIgnoreSlot.register(ignoreFn);
|
186
|
+
return this;
|
177
187
|
}
|
178
188
|
|
179
189
|
private registerLanesRoutes() {
|
@@ -239,7 +249,9 @@ export class LanesUI {
|
|
239
249
|
}
|
240
250
|
|
241
251
|
private renderContext = ({ children }: { children: ReactNode }) => {
|
242
|
-
|
252
|
+
const ignoreFns = this.laneProviderIgnoreSlot.values();
|
253
|
+
|
254
|
+
return <LanesProvider ignoreDerivingFromUrl={ignoreFns}>{children}</LanesProvider>;
|
243
255
|
};
|
244
256
|
|
245
257
|
registerRoute(route: RouteProps) {
|
@@ -305,11 +317,12 @@ export class LanesUI {
|
|
305
317
|
ComponentCompareUI
|
306
318
|
],
|
307
319
|
_,
|
308
|
-
[routeSlot, overviewSlot, navSlot, menuWidgetSlot]: [
|
320
|
+
[routeSlot, overviewSlot, navSlot, menuWidgetSlot, laneProviderIgnoreSlot]: [
|
309
321
|
RouteSlot,
|
310
322
|
LaneOverviewLineSlot,
|
311
323
|
LanesOrderedNavigationSlot,
|
312
|
-
MenuWidgetSlot
|
324
|
+
MenuWidgetSlot,
|
325
|
+
LaneProviderIgnoreSlot
|
313
326
|
],
|
314
327
|
harmony: Harmony
|
315
328
|
) {
|
@@ -330,6 +343,7 @@ export class LanesUI {
|
|
330
343
|
navSlot,
|
331
344
|
overviewSlot,
|
332
345
|
menuWidgetSlot,
|
346
|
+
laneProviderIgnoreSlot,
|
333
347
|
workspace,
|
334
348
|
scope
|
335
349
|
);
|
Binary file
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/lanes",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.536",
|
4
4
|
"homepage": "https://bit.dev/teambit/lanes/lanes",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.lanes",
|
8
8
|
"name": "lanes",
|
9
|
-
"version": "0.0.
|
9
|
+
"version": "0.0.536"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -19,35 +19,35 @@
|
|
19
19
|
"@teambit/component-version": "0.0.406",
|
20
20
|
"@teambit/harmony": "0.4.6",
|
21
21
|
"@teambit/bit-error": "0.0.402",
|
22
|
-
"@teambit/lane-id": "0.0.
|
23
|
-
"@teambit/scope": "0.0.
|
24
|
-
"@teambit/lanes.ui.models.lanes-model": "0.0.
|
25
|
-
"@teambit/cli": "0.0.
|
26
|
-
"@teambit/workspace": "0.0.
|
27
|
-
"@teambit/express": "0.0.
|
28
|
-
"@teambit/logger": "0.0.
|
29
|
-
"@teambit/graphql": "0.0.
|
30
|
-
"@teambit/component-compare": "0.0.
|
31
|
-
"@teambit/component": "0.0.
|
32
|
-
"@teambit/export": "0.0.
|
33
|
-
"@teambit/importer": "0.0.
|
34
|
-
"@teambit/lanes.entities.lane-diff": "0.0.
|
35
|
-
"@teambit/lanes.modules.diff": "0.0.
|
22
|
+
"@teambit/lane-id": "0.0.164",
|
23
|
+
"@teambit/scope": "0.0.964",
|
24
|
+
"@teambit/lanes.ui.models.lanes-model": "0.0.72",
|
25
|
+
"@teambit/cli": "0.0.647",
|
26
|
+
"@teambit/workspace": "0.0.964",
|
27
|
+
"@teambit/express": "0.0.745",
|
28
|
+
"@teambit/logger": "0.0.740",
|
29
|
+
"@teambit/graphql": "0.0.964",
|
30
|
+
"@teambit/component-compare": "0.0.212",
|
31
|
+
"@teambit/component": "0.0.964",
|
32
|
+
"@teambit/export": "0.0.964",
|
33
|
+
"@teambit/importer": "0.0.393",
|
34
|
+
"@teambit/lanes.entities.lane-diff": "0.0.9",
|
35
|
+
"@teambit/lanes.modules.diff": "0.0.282",
|
36
36
|
"@teambit/legacy-bit-id": "0.0.421",
|
37
|
-
"@teambit/merging": "0.0.
|
37
|
+
"@teambit/merging": "0.0.279",
|
38
38
|
"@teambit/component.ui.component-compare.models.component-compare-props": "0.0.3",
|
39
39
|
"@teambit/design.ui.pages.not-found": "0.0.366",
|
40
|
-
"@teambit/lanes.hooks.use-lanes": "0.0.
|
41
|
-
"@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.
|
42
|
-
"@teambit/lanes.ui.compare.lane-compare-page": "0.0.
|
43
|
-
"@teambit/lanes.ui.compare.lane-compare": "0.0.
|
44
|
-
"@teambit/lanes.ui.lane-overview": "0.0.
|
40
|
+
"@teambit/lanes.hooks.use-lanes": "0.0.110",
|
41
|
+
"@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.72",
|
42
|
+
"@teambit/lanes.ui.compare.lane-compare-page": "0.0.9",
|
43
|
+
"@teambit/lanes.ui.compare.lane-compare": "0.0.28",
|
44
|
+
"@teambit/lanes.ui.lane-overview": "0.0.73",
|
45
45
|
"@teambit/lanes.ui.menus.lanes-overview-menu": "0.0.5",
|
46
|
-
"@teambit/lanes.ui.menus.use-lanes-menu": "0.0.
|
47
|
-
"@teambit/lanes.ui.navigation.lane-switcher": "0.0.
|
46
|
+
"@teambit/lanes.ui.menus.use-lanes-menu": "0.0.72",
|
47
|
+
"@teambit/lanes.ui.navigation.lane-switcher": "0.0.72",
|
48
48
|
"@teambit/ui-foundation.ui.menu": "0.0.497",
|
49
49
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.501",
|
50
|
-
"@teambit/ui": "0.0.
|
50
|
+
"@teambit/ui": "0.0.964"
|
51
51
|
},
|
52
52
|
"devDependencies": {
|
53
53
|
"@types/react": "^17.0.8",
|
@@ -61,12 +61,12 @@
|
|
61
61
|
"@types/testing-library__jest-dom": "5.9.5",
|
62
62
|
"@teambit/component.testing.mock-components": "0.0.18",
|
63
63
|
"@teambit/harmony.testing.load-aspect": "0.0.17",
|
64
|
-
"@teambit/snapping": "0.0.
|
64
|
+
"@teambit/snapping": "0.0.279",
|
65
65
|
"@teambit/workspace.testing.mock-workspace": "0.0.14"
|
66
66
|
},
|
67
67
|
"peerDependencies": {
|
68
68
|
"react-router-dom": "^6.0.0",
|
69
|
-
"@teambit/legacy": "1.0.
|
69
|
+
"@teambit/legacy": "1.0.427",
|
70
70
|
"react": "^16.8.0 || ^17.0.0",
|
71
71
|
"react-dom": "^16.8.0 || ^17.0.0"
|
72
72
|
},
|
Binary file
|