@teambit/lanes 0.0.235 → 0.0.236
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/{__preview-1646147591351.js → __preview-1646191436076.js} +1 -1
- package/dist/lanes.ui.runtime.d.ts +17 -17
- package/dist/lanes.ui.runtime.js +21 -20
- package/dist/lanes.ui.runtime.js.map +1 -1
- package/lanes.ui.runtime.tsx +21 -34
- package/package-tar/teambit-lanes-0.0.236.tgz +0 -0
- package/package.json +13 -14
- package/package-tar/teambit-lanes-0.0.235.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.
|
|
1
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.236/dist/lanes.docs.md')]
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { RouteProps } from 'react-router-dom';
|
|
2
2
|
import { Harmony } from '@teambit/harmony';
|
|
3
|
-
import { MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
4
3
|
import { UiUI } from '@teambit/ui';
|
|
5
4
|
import { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
6
|
-
import { LanesOrderedNavigationSlot } from '@teambit/lanes.ui.lanes';
|
|
5
|
+
import { LanesOrderedNavigationSlot, LaneOverviewLineSlot, LaneOverviewLine } from '@teambit/lanes.ui.lanes';
|
|
7
6
|
import { ScopeUI } from '@teambit/scope';
|
|
8
7
|
import { WorkspaceUI } from '@teambit/workspace';
|
|
9
|
-
import { NavLinkProps
|
|
8
|
+
import { NavLinkProps } from '@teambit/react-router';
|
|
10
9
|
import { ComponentUI } from '@teambit/component';
|
|
11
10
|
import { SidebarUI } from '@teambit/sidebar';
|
|
12
11
|
export declare class LanesUI {
|
|
13
|
-
private uiUi;
|
|
14
12
|
private componentUi;
|
|
15
13
|
private routeSlot;
|
|
16
|
-
private menuRouteSlot;
|
|
17
14
|
private navSlot;
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
/**
|
|
16
|
+
* overview line slot to add new lines beneath the overview section
|
|
17
|
+
*/
|
|
18
|
+
private overviewSlot;
|
|
20
19
|
private workspace?;
|
|
21
20
|
private scope?;
|
|
22
21
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
23
22
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
24
23
|
static slots: (((registerFn: () => string) => import("@teambit/harmony").SlotRegistry<RouteProps<string, {
|
|
25
24
|
[x: string]: string | undefined;
|
|
26
|
-
}>>) | ((registerFn: () => string) => import("@teambit/harmony").SlotRegistry<
|
|
27
|
-
constructor(
|
|
25
|
+
}>>) | ((registerFn: () => string) => import("@teambit/harmony").SlotRegistry<NavigationSlot>) | ((registerFn: () => string) => import("@teambit/harmony").SlotRegistry<LaneOverviewLineSlot>))[];
|
|
26
|
+
constructor(componentUi: ComponentUI, routeSlot: RouteSlot, navSlot: LanesOrderedNavigationSlot,
|
|
27
|
+
/**
|
|
28
|
+
* overview line slot to add new lines beneath the overview section
|
|
29
|
+
*/
|
|
30
|
+
overviewSlot: LaneOverviewLineSlot, workspace?: WorkspaceUI | undefined, scope?: ScopeUI | undefined);
|
|
28
31
|
private readonly lanesHost;
|
|
29
32
|
private readonly hostAspect?;
|
|
30
33
|
private readonly host;
|
|
@@ -33,14 +36,11 @@ export declare class LanesUI {
|
|
|
33
36
|
private registerRoutes;
|
|
34
37
|
private renderContext;
|
|
35
38
|
registerRoute(route: RouteProps): this;
|
|
39
|
+
/**
|
|
40
|
+
* register a new line beneath the lane overview section.
|
|
41
|
+
*/
|
|
42
|
+
registerOverviewLine(...lines: LaneOverviewLine[]): this;
|
|
36
43
|
registerNavigation(nav: NavLinkProps, order?: number): void;
|
|
37
|
-
static provider([uiUi,
|
|
38
|
-
UiUI,
|
|
39
|
-
ReactRouterUI,
|
|
40
|
-
ComponentUI,
|
|
41
|
-
WorkspaceUI,
|
|
42
|
-
ScopeUI,
|
|
43
|
-
SidebarUI
|
|
44
|
-
], _: any, [routeSlot, menuItemSlot, menuRouteSlot, navSlot]: [RouteSlot, MenuItemSlot, RouteSlot, LanesOrderedNavigationSlot], harmony: Harmony): Promise<LanesUI>;
|
|
44
|
+
static provider([uiUi, componentUi, workspaceUi, scopeUi, sidebarUi]: [UiUI, ComponentUI, WorkspaceUI, ScopeUI, SidebarUI], _: any, [routeSlot, overviewSlot, navSlot]: [RouteSlot, LaneOverviewLineSlot, LanesOrderedNavigationSlot], harmony: Harmony): Promise<LanesUI>;
|
|
45
45
|
}
|
|
46
46
|
export default LanesUI;
|
package/dist/lanes.ui.runtime.js
CHANGED
|
@@ -91,16 +91,6 @@ function _workspace() {
|
|
|
91
91
|
return data;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
function _reactRouter() {
|
|
95
|
-
const data = _interopRequireDefault(require("@teambit/react-router"));
|
|
96
|
-
|
|
97
|
-
_reactRouter = function () {
|
|
98
|
-
return data;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
return data;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
94
|
function _component() {
|
|
105
95
|
const data = _interopRequireDefault(require("@teambit/component"));
|
|
106
96
|
|
|
@@ -122,14 +112,15 @@ function _sidebar() {
|
|
|
122
112
|
}
|
|
123
113
|
|
|
124
114
|
class LanesUI {
|
|
125
|
-
constructor(
|
|
126
|
-
|
|
115
|
+
constructor(componentUi, routeSlot, navSlot,
|
|
116
|
+
/**
|
|
117
|
+
* overview line slot to add new lines beneath the overview section
|
|
118
|
+
*/
|
|
119
|
+
overviewSlot, workspace, scope) {
|
|
127
120
|
this.componentUi = componentUi;
|
|
128
121
|
this.routeSlot = routeSlot;
|
|
129
|
-
this.menuRouteSlot = menuRouteSlot;
|
|
130
122
|
this.navSlot = navSlot;
|
|
131
|
-
this.
|
|
132
|
-
this.reactRouter = reactRouter;
|
|
123
|
+
this.overviewSlot = overviewSlot;
|
|
133
124
|
this.workspace = workspace;
|
|
134
125
|
this.scope = scope;
|
|
135
126
|
(0, _defineProperty2().default)(this, "lanesHost", void 0);
|
|
@@ -153,7 +144,8 @@ class LanesUI {
|
|
|
153
144
|
}, {
|
|
154
145
|
path: _lanesUi().LanesModel.laneRouteUrlRegex,
|
|
155
146
|
children: /*#__PURE__*/_react().default.createElement(_lanesUi().LanesOverview, {
|
|
156
|
-
routeSlot: this.routeSlot
|
|
147
|
+
routeSlot: this.routeSlot,
|
|
148
|
+
overviewSlot: this.overviewSlot
|
|
157
149
|
})
|
|
158
150
|
}]);
|
|
159
151
|
this.hostAspect.registerMenuRoutes([{
|
|
@@ -184,6 +176,15 @@ class LanesUI {
|
|
|
184
176
|
this.routeSlot.register(route);
|
|
185
177
|
return this;
|
|
186
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* register a new line beneath the lane overview section.
|
|
181
|
+
*/
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
registerOverviewLine(...lines) {
|
|
185
|
+
this.overviewSlot.register(lines);
|
|
186
|
+
return this;
|
|
187
|
+
}
|
|
187
188
|
|
|
188
189
|
registerNavigation(nav, order) {
|
|
189
190
|
this.navSlot.register({
|
|
@@ -192,7 +193,7 @@ class LanesUI {
|
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
|
|
195
|
-
static async provider([uiUi,
|
|
196
|
+
static async provider([uiUi, componentUi, workspaceUi, scopeUi, sidebarUi], _, [routeSlot, overviewSlot, navSlot], harmony) {
|
|
196
197
|
const {
|
|
197
198
|
config
|
|
198
199
|
} = harmony;
|
|
@@ -208,7 +209,7 @@ class LanesUI {
|
|
|
208
209
|
scope = scopeUi;
|
|
209
210
|
}
|
|
210
211
|
|
|
211
|
-
const lanesUi = new LanesUI(
|
|
212
|
+
const lanesUi = new LanesUI(componentUi, routeSlot, navSlot, overviewSlot, workspace, scope);
|
|
212
213
|
uiUi.registerRenderHooks({
|
|
213
214
|
reactContext: lanesUi.renderContext
|
|
214
215
|
});
|
|
@@ -223,9 +224,9 @@ class LanesUI {
|
|
|
223
224
|
}
|
|
224
225
|
|
|
225
226
|
exports.LanesUI = LanesUI;
|
|
226
|
-
(0, _defineProperty2().default)(LanesUI, "dependencies", [_ui().UIAspect,
|
|
227
|
+
(0, _defineProperty2().default)(LanesUI, "dependencies", [_ui().UIAspect, _component().default, _workspace().default, _scope().default, _sidebar().default]);
|
|
227
228
|
(0, _defineProperty2().default)(LanesUI, "runtime", _ui().UIRuntime);
|
|
228
|
-
(0, _defineProperty2().default)(LanesUI, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()
|
|
229
|
+
(0, _defineProperty2().default)(LanesUI, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
|
|
229
230
|
var _default = LanesUI;
|
|
230
231
|
exports.default = _default;
|
|
231
232
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["lanes.ui.runtime.tsx"],"names":["LanesUI","constructor","
|
|
1
|
+
{"version":3,"sources":["lanes.ui.runtime.tsx"],"names":["LanesUI","constructor","componentUi","routeSlot","navSlot","overviewSlot","workspace","scope","children","hostAspect","lanesHost","host","WorkspaceAspect","id","ScopeAspect","registerHostAspectRoutes","registerRoutes","path","LanesModel","laneComponentUrlRegex","getComponentUI","laneRouteUrlRegex","registerMenuRoutes","getMenu","registerLanesRoutes","registerNavigation","href","registerRoute","route","register","registerOverviewLine","lines","nav","order","props","provider","uiUi","workspaceUi","scopeUi","sidebarUi","_","harmony","config","String","get","lanesUi","registerRenderHooks","reactContext","renderContext","drawer","LanesDrawer","showScope","registerDrawer","UIAspect","ComponentAspect","SidebarAspect","UIRuntime","Slot","withType","LanesAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA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QAAL,EAA9B,EAAqED,gBAAKC,QAAL,EAArE,C;eA4GF1D,O;;;AAEf2D,qBAAYC,UAAZ,CAAuB5D,OAAvB","sourcesContent":["import React, { ReactNode } from 'react';\nimport { RouteProps } from 'react-router-dom';\nimport { Slot, Harmony } from '@teambit/harmony';\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 {\n LanesDrawer,\n LanesHost,\n LanesOverview,\n LanesOrderedNavigationSlot,\n LanesModel,\n LanesOverviewMenu,\n CurrentLaneFromUrl,\n LaneOverviewLineSlot,\n LaneOverviewLine,\n} from '@teambit/lanes.ui.lanes';\nimport ScopeAspect, { ScopeUI } from '@teambit/scope';\nimport WorkspaceAspect, { WorkspaceUI } from '@teambit/workspace';\nimport { NavLinkProps } from '@teambit/react-router';\nimport ComponentAspect, { ComponentUI } from '@teambit/component';\nimport SidebarAspect, { SidebarUI } from '@teambit/sidebar';\n\nexport class LanesUI {\n static dependencies = [UIAspect, ComponentAspect, WorkspaceAspect, ScopeAspect, SidebarAspect];\n static runtime = UIRuntime;\n static slots = [Slot.withType<RouteProps>(), Slot.withType<LaneOverviewLineSlot>(), Slot.withType<NavigationSlot>()];\n\n constructor(\n private componentUi: ComponentUI,\n private routeSlot: RouteSlot,\n private navSlot: LanesOrderedNavigationSlot,\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([\n {\n path: LanesModel.laneComponentUrlRegex,\n children: this.componentUi.getComponentUI(this.host),\n },\n {\n path: LanesModel.laneRouteUrlRegex,\n children: <LanesOverview routeSlot={this.routeSlot} overviewSlot={this.overviewSlot} />,\n },\n ]);\n this.hostAspect.registerMenuRoutes([\n {\n path: LanesModel.laneComponentUrlRegex,\n children: this.componentUi.getMenu(this.host),\n },\n {\n path: LanesModel.laneRouteUrlRegex,\n children: <LanesOverviewMenu navigationSlot={this.navSlot} host={this.host} />,\n },\n ]);\n }\n\n private registerLanesRoutes() {\n this.registerNavigation({\n href: '',\n children: 'Gallery',\n });\n }\n\n private registerRoutes() {\n this.registerHostAspectRoutes();\n this.registerLanesRoutes();\n }\n\n private renderContext = ({ children }: { children: ReactNode }) => {\n return <CurrentLaneFromUrl>{children}</CurrentLaneFromUrl>;\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(nav: NavLinkProps, order?: number) {\n this.navSlot.register({\n props: nav,\n order,\n });\n }\n\n static async provider(\n [uiUi, componentUi, workspaceUi, scopeUi, sidebarUi]: [UiUI, ComponentUI, WorkspaceUI, ScopeUI, SidebarUI],\n _,\n [routeSlot, overviewSlot, navSlot]: [RouteSlot, LaneOverviewLineSlot, LanesOrderedNavigationSlot],\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(componentUi, routeSlot, navSlot, overviewSlot, workspace, scope);\n uiUi.registerRenderHooks({ reactContext: lanesUi.renderContext });\n const drawer = new LanesDrawer({ showScope: lanesUi.lanesHost === 'workspace' });\n sidebarUi.registerDrawer(drawer);\n lanesUi.registerRoutes();\n\n return lanesUi;\n }\n}\n\nexport default LanesUI;\n\nLanesAspect.addRuntime(LanesUI);\n"]}
|
package/lanes.ui.runtime.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { RouteProps } from 'react-router-dom';
|
|
3
3
|
import { Slot, Harmony } from '@teambit/harmony';
|
|
4
|
-
import { MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
5
4
|
import { UIRuntime, UiUI, UIAspect } from '@teambit/ui';
|
|
6
5
|
import { LanesAspect } from '@teambit/lanes';
|
|
7
6
|
import { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
@@ -13,31 +12,28 @@ import {
|
|
|
13
12
|
LanesModel,
|
|
14
13
|
LanesOverviewMenu,
|
|
15
14
|
CurrentLaneFromUrl,
|
|
15
|
+
LaneOverviewLineSlot,
|
|
16
|
+
LaneOverviewLine,
|
|
16
17
|
} from '@teambit/lanes.ui.lanes';
|
|
17
18
|
import ScopeAspect, { ScopeUI } from '@teambit/scope';
|
|
18
19
|
import WorkspaceAspect, { WorkspaceUI } from '@teambit/workspace';
|
|
19
|
-
import
|
|
20
|
+
import { NavLinkProps } from '@teambit/react-router';
|
|
20
21
|
import ComponentAspect, { ComponentUI } from '@teambit/component';
|
|
21
22
|
import SidebarAspect, { SidebarUI } from '@teambit/sidebar';
|
|
22
23
|
|
|
23
24
|
export class LanesUI {
|
|
24
|
-
static dependencies = [UIAspect,
|
|
25
|
+
static dependencies = [UIAspect, ComponentAspect, WorkspaceAspect, ScopeAspect, SidebarAspect];
|
|
25
26
|
static runtime = UIRuntime;
|
|
26
|
-
static slots = [
|
|
27
|
-
Slot.withType<RouteProps>(),
|
|
28
|
-
Slot.withType<MenuItemSlot>(),
|
|
29
|
-
Slot.withType<RouteProps>(),
|
|
30
|
-
Slot.withType<NavigationSlot>(),
|
|
31
|
-
];
|
|
27
|
+
static slots = [Slot.withType<RouteProps>(), Slot.withType<LaneOverviewLineSlot>(), Slot.withType<NavigationSlot>()];
|
|
32
28
|
|
|
33
29
|
constructor(
|
|
34
|
-
private uiUi: UiUI,
|
|
35
30
|
private componentUi: ComponentUI,
|
|
36
31
|
private routeSlot: RouteSlot,
|
|
37
|
-
private menuRouteSlot: RouteSlot,
|
|
38
32
|
private navSlot: LanesOrderedNavigationSlot,
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
/**
|
|
34
|
+
* overview line slot to add new lines beneath the overview section
|
|
35
|
+
*/
|
|
36
|
+
private overviewSlot: LaneOverviewLineSlot,
|
|
41
37
|
private workspace?: WorkspaceUI,
|
|
42
38
|
private scope?: ScopeUI
|
|
43
39
|
) {
|
|
@@ -59,7 +55,7 @@ export class LanesUI {
|
|
|
59
55
|
},
|
|
60
56
|
{
|
|
61
57
|
path: LanesModel.laneRouteUrlRegex,
|
|
62
|
-
children: <LanesOverview routeSlot={this.routeSlot} />,
|
|
58
|
+
children: <LanesOverview routeSlot={this.routeSlot} overviewSlot={this.overviewSlot} />,
|
|
63
59
|
},
|
|
64
60
|
]);
|
|
65
61
|
this.hostAspect.registerMenuRoutes([
|
|
@@ -95,6 +91,14 @@ export class LanesUI {
|
|
|
95
91
|
return this;
|
|
96
92
|
}
|
|
97
93
|
|
|
94
|
+
/**
|
|
95
|
+
* register a new line beneath the lane overview section.
|
|
96
|
+
*/
|
|
97
|
+
registerOverviewLine(...lines: LaneOverviewLine[]) {
|
|
98
|
+
this.overviewSlot.register(lines);
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
|
|
98
102
|
registerNavigation(nav: NavLinkProps, order?: number) {
|
|
99
103
|
this.navSlot.register({
|
|
100
104
|
props: nav,
|
|
@@ -103,16 +107,9 @@ export class LanesUI {
|
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
static async provider(
|
|
106
|
-
[uiUi,
|
|
107
|
-
UiUI,
|
|
108
|
-
ReactRouterUI,
|
|
109
|
-
ComponentUI,
|
|
110
|
-
WorkspaceUI,
|
|
111
|
-
ScopeUI,
|
|
112
|
-
SidebarUI
|
|
113
|
-
],
|
|
110
|
+
[uiUi, componentUi, workspaceUi, scopeUi, sidebarUi]: [UiUI, ComponentUI, WorkspaceUI, ScopeUI, SidebarUI],
|
|
114
111
|
_,
|
|
115
|
-
[routeSlot,
|
|
112
|
+
[routeSlot, overviewSlot, navSlot]: [RouteSlot, LaneOverviewLineSlot, LanesOrderedNavigationSlot],
|
|
116
113
|
harmony: Harmony
|
|
117
114
|
) {
|
|
118
115
|
const { config } = harmony;
|
|
@@ -125,17 +122,7 @@ export class LanesUI {
|
|
|
125
122
|
if (host === ScopeAspect.id) {
|
|
126
123
|
scope = scopeUi;
|
|
127
124
|
}
|
|
128
|
-
const lanesUi = new LanesUI(
|
|
129
|
-
uiUi,
|
|
130
|
-
componentUi,
|
|
131
|
-
routeSlot,
|
|
132
|
-
menuRouteSlot,
|
|
133
|
-
navSlot,
|
|
134
|
-
menuItemSlot,
|
|
135
|
-
reactRouter,
|
|
136
|
-
workspace,
|
|
137
|
-
scope
|
|
138
|
-
);
|
|
125
|
+
const lanesUi = new LanesUI(componentUi, routeSlot, navSlot, overviewSlot, workspace, scope);
|
|
139
126
|
uiUi.registerRenderHooks({ reactContext: lanesUi.renderContext });
|
|
140
127
|
const drawer = new LanesDrawer({ showScope: lanesUi.lanesHost === 'workspace' });
|
|
141
128
|
sidebarUi.registerDrawer(drawer);
|
|
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.236",
|
|
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.236"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -18,18 +18,17 @@
|
|
|
18
18
|
"@babel/runtime": "7.12.18",
|
|
19
19
|
"core-js": "^3.0.0",
|
|
20
20
|
"@teambit/bit-error": "0.0.394",
|
|
21
|
-
"@teambit/cli": "0.0.
|
|
22
|
-
"@teambit/scope": "0.0.
|
|
23
|
-
"@teambit/workspace": "0.0.
|
|
24
|
-
"@teambit/graphql": "0.0.
|
|
21
|
+
"@teambit/cli": "0.0.450",
|
|
22
|
+
"@teambit/scope": "0.0.664",
|
|
23
|
+
"@teambit/workspace": "0.0.664",
|
|
24
|
+
"@teambit/graphql": "0.0.664",
|
|
25
25
|
"@teambit/lanes.modules.diff": "0.0.106",
|
|
26
|
-
"@teambit/component": "0.0.
|
|
27
|
-
"@teambit/lanes.ui.lanes": "0.0.
|
|
28
|
-
"@teambit/react-router": "0.0.
|
|
29
|
-
"@teambit/sidebar": "0.0.
|
|
30
|
-
"@teambit/ui-foundation.ui.main-dropdown": "0.0.486",
|
|
26
|
+
"@teambit/component": "0.0.664",
|
|
27
|
+
"@teambit/lanes.ui.lanes": "0.0.8",
|
|
28
|
+
"@teambit/react-router": "0.0.664",
|
|
29
|
+
"@teambit/sidebar": "0.0.664",
|
|
31
30
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.488",
|
|
32
|
-
"@teambit/ui": "0.0.
|
|
31
|
+
"@teambit/ui": "0.0.664"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"@types/react-router-dom": "5.1.7",
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"@teambit/workspace.testing.mock-workspace": "0.0.3"
|
|
45
44
|
},
|
|
46
45
|
"peerDependencies": {
|
|
47
|
-
"@teambit/legacy": "1.0.
|
|
46
|
+
"@teambit/legacy": "1.0.229",
|
|
48
47
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
49
48
|
"react": "^16.8.0 || ^17.0.0"
|
|
50
49
|
},
|
|
@@ -72,7 +71,7 @@
|
|
|
72
71
|
"react": "-"
|
|
73
72
|
},
|
|
74
73
|
"peerDependencies": {
|
|
75
|
-
"@teambit/legacy": "1.0.
|
|
74
|
+
"@teambit/legacy": "1.0.229",
|
|
76
75
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
77
76
|
"react": "^16.8.0 || ^17.0.0"
|
|
78
77
|
}
|
|
Binary file
|