@teambit/workspace 1.0.114 → 1.0.116
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/artifacts/preview/static/css/teambit.workspace/{workspace-preview.02f9235c.css → workspace-preview.10745253.css} +2 -2
- package/artifacts/preview/teambit_workspace_workspace-preview.js +1 -1
- package/dist/component-tree.widget.d.ts +1 -0
- package/dist/{preview-1703992959524.js → preview-1704113440840.js} +2 -2
- package/dist/ui/workspace/use-workspace.js +11 -0
- package/dist/ui/workspace/use-workspace.js.map +1 -1
- package/dist/ui/workspace/workspace-model.d.ts +3 -1
- package/dist/ui/workspace/workspace-model.js +15 -3
- package/dist/ui/workspace/workspace-model.js.map +1 -1
- package/dist/ui/workspace/workspace-overview/link-plugin.d.ts +3 -0
- package/dist/ui/workspace/workspace-overview/link-plugin.js +14 -0
- package/dist/ui/workspace/workspace-overview/link-plugin.js.map +1 -0
- package/dist/ui/workspace/workspace-overview/workspace-overview.d.ts +6 -0
- package/dist/ui/workspace/workspace-overview/workspace-overview.js +107 -8
- package/dist/ui/workspace/workspace-overview/workspace-overview.js.map +1 -1
- package/dist/ui/workspace/workspace-overview/workspace-overview.module.scss +31 -0
- package/dist/ui/workspace/workspace.d.ts +1 -0
- package/dist/workspace-component/workspace-component-loader.js +25 -1
- package/dist/workspace-component/workspace-component-loader.js.map +1 -1
- package/dist/workspace.composition.d.ts +1 -0
- package/dist/workspace.js +1 -3
- package/dist/workspace.js.map +1 -1
- package/dist/workspace.ui.runtime.d.ts +7 -3
- package/dist/workspace.ui.runtime.js +10 -5
- package/dist/workspace.ui.runtime.js.map +1 -1
- package/package.json +26 -22
- package/ui/workspace/use-workspace.ts +11 -0
- package/ui/workspace/workspace-model.ts +11 -2
- package/ui/workspace/workspace-overview/link-plugin.ts +5 -0
- package/ui/workspace/workspace-overview/workspace-overview.module.scss +31 -0
- package/ui/workspace/workspace-overview/workspace-overview.tsx +71 -4
- package/workspace-component/workspace-component-loader.ts +24 -1
- package/workspace.ui.runtime.tsx +24 -6
|
@@ -2,6 +2,7 @@ import { ComponentUI, ComponentModel } from '@teambit/component';
|
|
|
2
2
|
import { ComponentTreeUI, ComponentTreeNode } from '@teambit/component-tree';
|
|
3
3
|
import { SlotRegistry } from '@teambit/harmony';
|
|
4
4
|
import { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
5
|
+
import { MenuWidgetSlot, MenuWidget } from '@teambit/ui-foundation.ui.menu';
|
|
5
6
|
import { SidebarUI, SidebarItem, SidebarItemSlot } from '@teambit/sidebar';
|
|
6
7
|
import { MenuItemSlot, MenuItem } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
7
8
|
import { UIRootUI as UIRoot, UiUI } from '@teambit/ui';
|
|
@@ -36,6 +37,7 @@ export declare class WorkspaceUI {
|
|
|
36
37
|
private drawerWidgetSlot;
|
|
37
38
|
private drawerComponentsFiltersSlot;
|
|
38
39
|
private commandBarUI;
|
|
40
|
+
private menuWidgetSlot;
|
|
39
41
|
constructor(
|
|
40
42
|
/**
|
|
41
43
|
* route slot.
|
|
@@ -52,7 +54,7 @@ export declare class WorkspaceUI {
|
|
|
52
54
|
/**
|
|
53
55
|
* sidebar link slot
|
|
54
56
|
*/
|
|
55
|
-
sidebarItemSlot: SidebarItemSlot, drawerWidgetSlot: DrawerWidgetSlot, drawerComponentsFiltersSlot: ComponentFiltersSlot, commandBarUI: CommandBarUI);
|
|
57
|
+
sidebarItemSlot: SidebarItemSlot, drawerWidgetSlot: DrawerWidgetSlot, drawerComponentsFiltersSlot: ComponentFiltersSlot, commandBarUI: CommandBarUI, menuWidgetSlot: MenuWidgetSlot);
|
|
56
58
|
private setKeyBindHandler;
|
|
57
59
|
/**
|
|
58
60
|
* register a route to the workspace.
|
|
@@ -61,6 +63,7 @@ export declare class WorkspaceUI {
|
|
|
61
63
|
registerDrawers(...drawers: DrawerType[]): this;
|
|
62
64
|
registerSidebarWidget(componentTreeNode: ComponentTreeNode): this;
|
|
63
65
|
registerMenuItem: (menuItems: MenuItem[]) => void;
|
|
66
|
+
registerMenuWidget: (menuWidgets: MenuWidget[]) => void;
|
|
64
67
|
registerMenuRoutes: (routes: RouteProps[]) => this;
|
|
65
68
|
setComponents: (components: ComponentModel[]) => void;
|
|
66
69
|
registerSidebarLink: (...links: SidebarItem[]) => void;
|
|
@@ -82,14 +85,15 @@ export declare class WorkspaceUI {
|
|
|
82
85
|
ComponentTreeUI,
|
|
83
86
|
CommandBarUI,
|
|
84
87
|
GraphUI
|
|
85
|
-
], config: any, [routeSlot, menuSlot, menuItemSlot, sidebarSlot, sidebarItemSlot, drawerWidgetSlot, drawerComponentsFiltersSlot]: [
|
|
88
|
+
], config: any, [routeSlot, menuSlot, menuItemSlot, sidebarSlot, sidebarItemSlot, drawerWidgetSlot, drawerComponentsFiltersSlot, menuWidgetSlot,]: [
|
|
86
89
|
RouteSlot,
|
|
87
90
|
RouteSlot,
|
|
88
91
|
MenuItemSlot,
|
|
89
92
|
SidebarWidgetSlot,
|
|
90
93
|
SidebarItemSlot,
|
|
91
94
|
DrawerWidgetSlot,
|
|
92
|
-
ComponentFiltersSlot
|
|
95
|
+
ComponentFiltersSlot,
|
|
96
|
+
MenuWidgetSlot
|
|
93
97
|
]): Promise<WorkspaceUI>;
|
|
94
98
|
}
|
|
95
99
|
export default WorkspaceUI;
|
|
@@ -158,7 +158,7 @@ class WorkspaceUI {
|
|
|
158
158
|
/**
|
|
159
159
|
* sidebar link slot
|
|
160
160
|
*/
|
|
161
|
-
sidebarItemSlot, drawerWidgetSlot, drawerComponentsFiltersSlot, commandBarUI) {
|
|
161
|
+
sidebarItemSlot, drawerWidgetSlot, drawerComponentsFiltersSlot, commandBarUI, menuWidgetSlot) {
|
|
162
162
|
this.routeSlot = routeSlot;
|
|
163
163
|
this.componentUi = componentUi;
|
|
164
164
|
this.menuSlot = menuSlot;
|
|
@@ -169,10 +169,14 @@ class WorkspaceUI {
|
|
|
169
169
|
this.drawerWidgetSlot = drawerWidgetSlot;
|
|
170
170
|
this.drawerComponentsFiltersSlot = drawerComponentsFiltersSlot;
|
|
171
171
|
this.commandBarUI = commandBarUI;
|
|
172
|
+
this.menuWidgetSlot = menuWidgetSlot;
|
|
172
173
|
_defineProperty(this, "setKeyBindHandler", () => {});
|
|
173
174
|
_defineProperty(this, "registerMenuItem", menuItems => {
|
|
174
175
|
this.menuItemSlot.register(menuItems);
|
|
175
176
|
});
|
|
177
|
+
_defineProperty(this, "registerMenuWidget", menuWidgets => {
|
|
178
|
+
this.menuWidgetSlot.register(menuWidgets);
|
|
179
|
+
});
|
|
176
180
|
_defineProperty(this, "registerMenuRoutes", routes => {
|
|
177
181
|
this.menuSlot.register(routes);
|
|
178
182
|
return this;
|
|
@@ -254,11 +258,11 @@ class WorkspaceUI {
|
|
|
254
258
|
return item.component;
|
|
255
259
|
}));
|
|
256
260
|
}
|
|
257
|
-
static async provider([ui, componentUi, sidebar, componentTree, commandBarUI, graphUI], config, [routeSlot, menuSlot, menuItemSlot, sidebarSlot, sidebarItemSlot, drawerWidgetSlot, drawerComponentsFiltersSlot]) {
|
|
261
|
+
static async provider([ui, componentUi, sidebar, componentTree, commandBarUI, graphUI], config, [routeSlot, menuSlot, menuItemSlot, sidebarSlot, sidebarItemSlot, drawerWidgetSlot, drawerComponentsFiltersSlot, menuWidgetSlot]) {
|
|
258
262
|
componentTree.registerTreeNode(new (_componentTree2().ComponentTreeWidget)());
|
|
259
263
|
sidebarSlot.register(new (_componentTree2().ComponentTreeWidget)());
|
|
260
264
|
graphUI.registerComponentWidget(new (_componentTree2().ComponentTreeWidget)().widget);
|
|
261
|
-
const workspaceUI = new WorkspaceUI(routeSlot, componentUi, menuSlot, menuItemSlot, sidebar, sidebarSlot, sidebarItemSlot, drawerWidgetSlot, drawerComponentsFiltersSlot, commandBarUI);
|
|
265
|
+
const workspaceUI = new WorkspaceUI(routeSlot, componentUi, menuSlot, menuItemSlot, sidebar, sidebarSlot, sidebarItemSlot, drawerWidgetSlot, drawerComponentsFiltersSlot, commandBarUI, menuWidgetSlot);
|
|
262
266
|
workspaceUI.registerDrawerComponentFilters([_componentUiComponentFilters().DeprecateFilter, _componentUiComponentFilters2().EnvsFilter, (0, _componentUiComponentFilters3().ShowMainFilter)(true)]);
|
|
263
267
|
workspaceUI.registerDrawerWidgets([/*#__PURE__*/_react().default.createElement(_componentUi().FilterWidget, {
|
|
264
268
|
key: 'workspace-filter-widget'
|
|
@@ -279,7 +283,8 @@ class WorkspaceUI {
|
|
|
279
283
|
workspaceUI.registerMenuRoutes([{
|
|
280
284
|
path: '/',
|
|
281
285
|
element: /*#__PURE__*/_react().default.createElement(_uiFoundationUi().Menu, {
|
|
282
|
-
menuItemSlot: workspaceUI.menuItemSlot
|
|
286
|
+
menuItemSlot: workspaceUI.menuItemSlot,
|
|
287
|
+
widgetSlot: workspaceUI.menuWidgetSlot
|
|
283
288
|
})
|
|
284
289
|
}, {
|
|
285
290
|
path: workspaceUI.componentUi.routePath,
|
|
@@ -295,7 +300,7 @@ class WorkspaceUI {
|
|
|
295
300
|
exports.WorkspaceUI = WorkspaceUI;
|
|
296
301
|
_defineProperty(WorkspaceUI, "dependencies", [_ui().UIAspect, _component().ComponentAspect, _sidebar().default, _componentTree().ComponentTreeAspect, _commandBar().default, _graph().GraphAspect]);
|
|
297
302
|
_defineProperty(WorkspaceUI, "runtime", _ui().UIRuntime);
|
|
298
|
-
_defineProperty(WorkspaceUI, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
|
|
303
|
+
_defineProperty(WorkspaceUI, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
|
|
299
304
|
var _default = exports.default = WorkspaceUI;
|
|
300
305
|
_workspace().WorkspaceAspect.addRuntime(WorkspaceUI);
|
|
301
306
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_component","data","require","_lodash","_componentTree","_harmony","_uiFoundationUi","_sidebar","_interopRequireDefault","_ui","_graph","_react","_commandBar","_designUiSurfacesMenu","_componentUiComponentFilters","_componentUiComponentFilters2","_componentUiComponentFilters3","_componentUi","_componentTree2","_ui2","_workspace","_workspaceUi","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","WorkspaceUI","constructor","routeSlot","componentUi","menuSlot","menuItemSlot","sidebar","sidebarSlot","sidebarItemSlot","drawerWidgetSlot","drawerComponentsFiltersSlot","commandBarUI","menuItems","register","routes","components","updateComponents","links","filters","widgets","category","title","keyChar","handler","run","registerRoutes","registerDrawers","drawers","registerDrawer","registerSidebarWidget","componentTreeNode","uiRoot","workspaceDrawer","treeWidgets","filtersSlot","setKeyBindHandler","addCommand","id","action","displayName","keybinding","path","element","createElement","Workspace","render","items","listSidebarItems","workspaceUI","onSidebarTogglerChange","flatten","values","compact","map","item","component","provider","ui","componentTree","graphUI","config","registerTreeNode","ComponentTreeWidget","registerComponentWidget","widget","registerDrawerComponentFilters","DeprecateFilter","EnvsFilter","ShowMainFilter","registerDrawerWidgets","FilterWidget","TreeToggleWidget","registerRoot","bind","registerMenuItem","registerSidebarLink","Gallery","MenuLinkItem","exact","href","icon","registerMenuRoutes","Menu","routePath","getMenu","WorkspaceAspect","getComponentUI","exports","UIAspect","ComponentAspect","SidebarAspect","ComponentTreeAspect","CommandBarAspect","GraphAspect","UIRuntime","Slot","withType","_default","addRuntime"],"sources":["workspace.ui.runtime.tsx"],"sourcesContent":["import { ComponentAspect, ComponentUI, ComponentModel } from '@teambit/component';\nimport { compact, flatten } from 'lodash';\nimport { ComponentTreeAspect, ComponentTreeUI, ComponentTreeNode } from '@teambit/component-tree';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { Menu } from '@teambit/ui-foundation.ui.menu';\nimport SidebarAspect, { SidebarUI, SidebarItem, SidebarItemSlot } from '@teambit/sidebar';\nimport { MenuItemSlot, MenuItem } from '@teambit/ui-foundation.ui.main-dropdown';\nimport { UIAspect, UIRootUI as UIRoot, UIRuntime, UiUI } from '@teambit/ui';\nimport { GraphAspect, GraphUI } from '@teambit/graph';\nimport React, { ReactNode } from 'react';\nimport { RouteProps } from 'react-router-dom';\nimport CommandBarAspect, { CommandBarUI, CommandHandler } from '@teambit/command-bar';\nimport { MenuLinkItem } from '@teambit/design.ui.surfaces.menu.link-item';\nimport type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';\nimport { ComponentFilters } from '@teambit/component.ui.component-filters.component-filter-context';\nimport { DeprecateFilter } from '@teambit/component.ui.component-filters.deprecate-filter';\nimport { EnvsFilter } from '@teambit/component.ui.component-filters.env-filter';\nimport { ShowMainFilter } from '@teambit/component.ui.component-filters.show-main-filter';\nimport {\n DrawerWidgetSlot,\n FilterWidget,\n TreeToggleWidget,\n ComponentFiltersSlot,\n} from '@teambit/component.ui.component-drawer';\nimport { ComponentTreeWidget } from './component-tree.widget';\nimport { Workspace } from './ui';\nimport { WorkspaceAspect } from './workspace.aspect';\nimport { workspaceDrawer } from './workspace.ui.drawer';\n\nexport type SidebarWidgetSlot = SlotRegistry<ComponentTreeNode>;\n\nexport class WorkspaceUI {\n constructor(\n /**\n * route slot.\n */\n private routeSlot: RouteSlot,\n\n /**\n * component ui extension.\n */\n private componentUi: ComponentUI,\n\n /**\n * menu slot\n */\n private menuSlot: RouteSlot,\n\n private menuItemSlot: MenuItemSlot,\n\n private sidebar: SidebarUI,\n\n private sidebarSlot: SidebarWidgetSlot,\n\n /**\n * sidebar link slot\n */\n private sidebarItemSlot: SidebarItemSlot,\n\n private drawerWidgetSlot: DrawerWidgetSlot,\n\n private drawerComponentsFiltersSlot: ComponentFiltersSlot,\n\n private commandBarUI: CommandBarUI\n ) {}\n\n private setKeyBindHandler: (updated: CommandHandler) => void = () => {};\n\n /**\n * register a route to the workspace.\n */\n registerRoutes(routes: RouteProps[]) {\n this.routeSlot.register(routes);\n return this;\n }\n\n registerDrawers(...drawers: DrawerType[]) {\n this.sidebar.registerDrawer(...drawers);\n return this;\n }\n\n registerSidebarWidget(componentTreeNode: ComponentTreeNode) {\n this.sidebarSlot.register(componentTreeNode);\n return this;\n }\n\n registerMenuItem = (menuItems: MenuItem[]) => {\n this.menuItemSlot.register(menuItems);\n };\n\n registerMenuRoutes = (routes: RouteProps[]) => {\n this.menuSlot.register(routes);\n return this;\n };\n\n setComponents = (components: ComponentModel[]) => {\n this.componentUi.updateComponents(components);\n };\n\n registerSidebarLink = (...links: SidebarItem[]) => {\n this.sidebarItemSlot.register(links);\n };\n\n /**\n * register component filters\n */\n registerDrawerComponentFilters = (filters: ComponentFilters) => {\n this.drawerComponentsFiltersSlot.register(filters);\n };\n\n registerDrawerWidgets = (widgets: ReactNode[]) => {\n this.drawerWidgetSlot.register(widgets);\n };\n\n uiRoot(): UIRoot {\n this.registerDrawers(\n workspaceDrawer({\n treeWidgets: this.sidebarSlot,\n drawerWidgetSlot: this.drawerWidgetSlot,\n filtersSlot: this.drawerComponentsFiltersSlot,\n })\n );\n\n const [setKeyBindHandler] = this.commandBarUI.addCommand({\n id: 'sidebar.toggle', // TODO - extract to a component!\n action: () => {},\n displayName: 'Toggle component list',\n keybinding: 'alt+s',\n });\n this.setKeyBindHandler = setKeyBindHandler;\n\n return {\n routes: [\n {\n path: '/*',\n element: (\n <Workspace\n menuSlot={this.menuSlot}\n routeSlot={this.routeSlot}\n sidebar={<this.sidebar.render items={this.listSidebarItems()} />}\n workspaceUI={this}\n onSidebarTogglerChange={this.setKeyBindHandler}\n />\n ),\n },\n ],\n };\n }\n\n listSidebarItems() {\n const items = flatten(this.sidebarItemSlot.values());\n return compact(\n items.map((item) => {\n return item.component;\n })\n );\n }\n\n private menuItems: MenuItem[] = [\n {\n category: 'general',\n title: 'Open command bar',\n keyChar: 'mod+k',\n handler: () => this.commandBarUI?.run('command-bar.open'),\n },\n {\n category: 'general',\n title: 'Toggle component list',\n keyChar: 'alt+s',\n handler: () => this.commandBarUI?.run('sidebar.toggle'),\n },\n ];\n\n static dependencies = [UIAspect, ComponentAspect, SidebarAspect, ComponentTreeAspect, CommandBarAspect, GraphAspect];\n\n static runtime = UIRuntime;\n\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<RouteProps>(),\n Slot.withType<ComponentTreeNode>(),\n Slot.withType<MenuItemSlot>(),\n Slot.withType<SidebarItemSlot>(),\n Slot.withType<DrawerWidgetSlot>(),\n Slot.withType<ComponentFiltersSlot>(),\n ];\n\n static async provider(\n [ui, componentUi, sidebar, componentTree, commandBarUI, graphUI]: [\n UiUI,\n ComponentUI,\n SidebarUI,\n ComponentTreeUI,\n CommandBarUI,\n GraphUI\n ],\n config,\n [routeSlot, menuSlot, menuItemSlot, sidebarSlot, sidebarItemSlot, drawerWidgetSlot, drawerComponentsFiltersSlot]: [\n RouteSlot,\n RouteSlot,\n MenuItemSlot,\n SidebarWidgetSlot,\n SidebarItemSlot,\n DrawerWidgetSlot,\n ComponentFiltersSlot\n ]\n ) {\n componentTree.registerTreeNode(new ComponentTreeWidget());\n sidebarSlot.register(new ComponentTreeWidget());\n graphUI.registerComponentWidget(new ComponentTreeWidget().widget);\n\n const workspaceUI = new WorkspaceUI(\n routeSlot,\n componentUi,\n menuSlot,\n menuItemSlot,\n sidebar,\n sidebarSlot,\n sidebarItemSlot,\n drawerWidgetSlot,\n drawerComponentsFiltersSlot,\n commandBarUI\n );\n\n workspaceUI.registerDrawerComponentFilters([DeprecateFilter, EnvsFilter, ShowMainFilter(true)]);\n workspaceUI.registerDrawerWidgets([\n <FilterWidget key={'workspace-filter-widget'} />,\n <TreeToggleWidget key={'workspace-tree-toggle-widget'} />,\n ]);\n ui.registerRoot(workspaceUI.uiRoot.bind(workspaceUI));\n workspaceUI.registerMenuItem(workspaceUI.menuItems);\n\n workspaceUI.registerSidebarLink({\n component: function Gallery() {\n return (\n <MenuLinkItem exact href=\"/\" icon=\"comps\">\n Workspace overview\n </MenuLinkItem>\n );\n },\n });\n\n workspaceUI.registerMenuRoutes([\n {\n path: '/',\n element: <Menu menuItemSlot={workspaceUI.menuItemSlot} />,\n },\n {\n path: workspaceUI.componentUi.routePath,\n element: workspaceUI.componentUi.getMenu(WorkspaceAspect.id),\n },\n ]);\n\n workspaceUI.registerRoutes([\n {\n path: workspaceUI.componentUi.routePath,\n element: workspaceUI.componentUi.getComponentUI(WorkspaceAspect.id),\n },\n ]);\n\n return workspaceUI;\n }\n}\n\nexport default WorkspaceUI;\n\nWorkspaceAspect.addRuntime(WorkspaceUI);\n"],"mappings":";;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,eAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,cAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,gBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAO,sBAAA,CAAAN,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OAAA,GA+EYqB,WAAW;AAE1BqF,4BAAe,CAACa,UAAU,CAAClG,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"names":["_component","data","require","_lodash","_componentTree","_harmony","_uiFoundationUi","_sidebar","_interopRequireDefault","_ui","_graph","_react","_commandBar","_designUiSurfacesMenu","_componentUiComponentFilters","_componentUiComponentFilters2","_componentUiComponentFilters3","_componentUi","_componentTree2","_ui2","_workspace","_workspaceUi","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","WorkspaceUI","constructor","routeSlot","componentUi","menuSlot","menuItemSlot","sidebar","sidebarSlot","sidebarItemSlot","drawerWidgetSlot","drawerComponentsFiltersSlot","commandBarUI","menuWidgetSlot","menuItems","register","menuWidgets","routes","components","updateComponents","links","filters","widgets","category","title","keyChar","handler","run","registerRoutes","registerDrawers","drawers","registerDrawer","registerSidebarWidget","componentTreeNode","uiRoot","workspaceDrawer","treeWidgets","filtersSlot","setKeyBindHandler","addCommand","id","action","displayName","keybinding","path","element","createElement","Workspace","render","items","listSidebarItems","workspaceUI","onSidebarTogglerChange","flatten","values","compact","map","item","component","provider","ui","componentTree","graphUI","config","registerTreeNode","ComponentTreeWidget","registerComponentWidget","widget","registerDrawerComponentFilters","DeprecateFilter","EnvsFilter","ShowMainFilter","registerDrawerWidgets","FilterWidget","TreeToggleWidget","registerRoot","bind","registerMenuItem","registerSidebarLink","Gallery","MenuLinkItem","exact","href","icon","registerMenuRoutes","Menu","widgetSlot","routePath","getMenu","WorkspaceAspect","getComponentUI","exports","UIAspect","ComponentAspect","SidebarAspect","ComponentTreeAspect","CommandBarAspect","GraphAspect","UIRuntime","Slot","withType","_default","addRuntime"],"sources":["workspace.ui.runtime.tsx"],"sourcesContent":["import { ComponentAspect, ComponentUI, ComponentModel } from '@teambit/component';\nimport { compact, flatten } from 'lodash';\nimport { ComponentTreeAspect, ComponentTreeUI, ComponentTreeNode } from '@teambit/component-tree';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { Menu, MenuWidgetSlot, MenuWidget } from '@teambit/ui-foundation.ui.menu';\nimport SidebarAspect, { SidebarUI, SidebarItem, SidebarItemSlot } from '@teambit/sidebar';\nimport { MenuItemSlot, MenuItem } from '@teambit/ui-foundation.ui.main-dropdown';\nimport { UIAspect, UIRootUI as UIRoot, UIRuntime, UiUI } from '@teambit/ui';\nimport { GraphAspect, GraphUI } from '@teambit/graph';\nimport React, { ReactNode } from 'react';\nimport { RouteProps } from 'react-router-dom';\nimport CommandBarAspect, { CommandBarUI, CommandHandler } from '@teambit/command-bar';\nimport { MenuLinkItem } from '@teambit/design.ui.surfaces.menu.link-item';\nimport type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';\nimport { ComponentFilters } from '@teambit/component.ui.component-filters.component-filter-context';\nimport { DeprecateFilter } from '@teambit/component.ui.component-filters.deprecate-filter';\nimport { EnvsFilter } from '@teambit/component.ui.component-filters.env-filter';\nimport { ShowMainFilter } from '@teambit/component.ui.component-filters.show-main-filter';\nimport {\n DrawerWidgetSlot,\n FilterWidget,\n TreeToggleWidget,\n ComponentFiltersSlot,\n} from '@teambit/component.ui.component-drawer';\nimport { ComponentTreeWidget } from './component-tree.widget';\nimport { Workspace } from './ui';\nimport { WorkspaceAspect } from './workspace.aspect';\nimport { workspaceDrawer } from './workspace.ui.drawer';\n\nexport type SidebarWidgetSlot = SlotRegistry<ComponentTreeNode>;\n\nexport class WorkspaceUI {\n constructor(\n /**\n * route slot.\n */\n private routeSlot: RouteSlot,\n\n /**\n * component ui extension.\n */\n private componentUi: ComponentUI,\n\n /**\n * menu slot\n */\n private menuSlot: RouteSlot,\n\n private menuItemSlot: MenuItemSlot,\n\n private sidebar: SidebarUI,\n\n private sidebarSlot: SidebarWidgetSlot,\n\n /**\n * sidebar link slot\n */\n private sidebarItemSlot: SidebarItemSlot,\n\n private drawerWidgetSlot: DrawerWidgetSlot,\n\n private drawerComponentsFiltersSlot: ComponentFiltersSlot,\n\n private commandBarUI: CommandBarUI,\n\n private menuWidgetSlot: MenuWidgetSlot\n ) {}\n\n private setKeyBindHandler: (updated: CommandHandler) => void = () => {};\n\n /**\n * register a route to the workspace.\n */\n registerRoutes(routes: RouteProps[]) {\n this.routeSlot.register(routes);\n return this;\n }\n\n registerDrawers(...drawers: DrawerType[]) {\n this.sidebar.registerDrawer(...drawers);\n return this;\n }\n\n registerSidebarWidget(componentTreeNode: ComponentTreeNode) {\n this.sidebarSlot.register(componentTreeNode);\n return this;\n }\n\n registerMenuItem = (menuItems: MenuItem[]) => {\n this.menuItemSlot.register(menuItems);\n };\n\n registerMenuWidget = (menuWidgets: MenuWidget[]) => {\n this.menuWidgetSlot.register(menuWidgets);\n };\n\n registerMenuRoutes = (routes: RouteProps[]) => {\n this.menuSlot.register(routes);\n return this;\n };\n\n setComponents = (components: ComponentModel[]) => {\n this.componentUi.updateComponents(components);\n };\n\n registerSidebarLink = (...links: SidebarItem[]) => {\n this.sidebarItemSlot.register(links);\n };\n\n /**\n * register component filters\n */\n registerDrawerComponentFilters = (filters: ComponentFilters) => {\n this.drawerComponentsFiltersSlot.register(filters);\n };\n\n registerDrawerWidgets = (widgets: ReactNode[]) => {\n this.drawerWidgetSlot.register(widgets);\n };\n\n uiRoot(): UIRoot {\n this.registerDrawers(\n workspaceDrawer({\n treeWidgets: this.sidebarSlot,\n drawerWidgetSlot: this.drawerWidgetSlot,\n filtersSlot: this.drawerComponentsFiltersSlot,\n })\n );\n\n const [setKeyBindHandler] = this.commandBarUI.addCommand({\n id: 'sidebar.toggle', // TODO - extract to a component!\n action: () => {},\n displayName: 'Toggle component list',\n keybinding: 'alt+s',\n });\n this.setKeyBindHandler = setKeyBindHandler;\n\n return {\n routes: [\n {\n path: '/*',\n element: (\n <Workspace\n menuSlot={this.menuSlot}\n routeSlot={this.routeSlot}\n sidebar={<this.sidebar.render items={this.listSidebarItems()} />}\n workspaceUI={this}\n onSidebarTogglerChange={this.setKeyBindHandler}\n />\n ),\n },\n ],\n };\n }\n\n listSidebarItems() {\n const items = flatten(this.sidebarItemSlot.values());\n return compact(\n items.map((item) => {\n return item.component;\n })\n );\n }\n\n private menuItems: MenuItem[] = [\n {\n category: 'general',\n title: 'Open command bar',\n keyChar: 'mod+k',\n handler: () => this.commandBarUI?.run('command-bar.open'),\n },\n {\n category: 'general',\n title: 'Toggle component list',\n keyChar: 'alt+s',\n handler: () => this.commandBarUI?.run('sidebar.toggle'),\n },\n ];\n\n static dependencies = [UIAspect, ComponentAspect, SidebarAspect, ComponentTreeAspect, CommandBarAspect, GraphAspect];\n\n static runtime = UIRuntime;\n\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<RouteProps>(),\n Slot.withType<ComponentTreeNode>(),\n Slot.withType<MenuItemSlot>(),\n Slot.withType<SidebarItemSlot>(),\n Slot.withType<DrawerWidgetSlot>(),\n Slot.withType<ComponentFiltersSlot>(),\n Slot.withType<MenuWidgetSlot>(),\n ];\n\n static async provider(\n [ui, componentUi, sidebar, componentTree, commandBarUI, graphUI]: [\n UiUI,\n ComponentUI,\n SidebarUI,\n ComponentTreeUI,\n CommandBarUI,\n GraphUI\n ],\n config,\n [\n routeSlot,\n menuSlot,\n menuItemSlot,\n sidebarSlot,\n sidebarItemSlot,\n drawerWidgetSlot,\n drawerComponentsFiltersSlot,\n menuWidgetSlot,\n ]: [\n RouteSlot,\n RouteSlot,\n MenuItemSlot,\n SidebarWidgetSlot,\n SidebarItemSlot,\n DrawerWidgetSlot,\n ComponentFiltersSlot,\n MenuWidgetSlot\n ]\n ) {\n componentTree.registerTreeNode(new ComponentTreeWidget());\n sidebarSlot.register(new ComponentTreeWidget());\n graphUI.registerComponentWidget(new ComponentTreeWidget().widget);\n\n const workspaceUI = new WorkspaceUI(\n routeSlot,\n componentUi,\n menuSlot,\n menuItemSlot,\n sidebar,\n sidebarSlot,\n sidebarItemSlot,\n drawerWidgetSlot,\n drawerComponentsFiltersSlot,\n commandBarUI,\n menuWidgetSlot\n );\n\n workspaceUI.registerDrawerComponentFilters([DeprecateFilter, EnvsFilter, ShowMainFilter(true)]);\n workspaceUI.registerDrawerWidgets([\n <FilterWidget key={'workspace-filter-widget'} />,\n <TreeToggleWidget key={'workspace-tree-toggle-widget'} />,\n ]);\n ui.registerRoot(workspaceUI.uiRoot.bind(workspaceUI));\n workspaceUI.registerMenuItem(workspaceUI.menuItems);\n\n workspaceUI.registerSidebarLink({\n component: function Gallery() {\n return (\n <MenuLinkItem exact href=\"/\" icon=\"comps\">\n Workspace overview\n </MenuLinkItem>\n );\n },\n });\n\n workspaceUI.registerMenuRoutes([\n {\n path: '/',\n element: <Menu menuItemSlot={workspaceUI.menuItemSlot} widgetSlot={workspaceUI.menuWidgetSlot} />,\n },\n {\n path: workspaceUI.componentUi.routePath,\n element: workspaceUI.componentUi.getMenu(WorkspaceAspect.id),\n },\n ]);\n\n workspaceUI.registerRoutes([\n {\n path: workspaceUI.componentUi.routePath,\n element: workspaceUI.componentUi.getComponentUI(WorkspaceAspect.id),\n },\n ]);\n\n return workspaceUI;\n }\n}\n\nexport default WorkspaceUI;\n\nWorkspaceAspect.addRuntime(WorkspaceUI);\n"],"mappings":";;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,eAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,cAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IA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2F,cAAQ,EAAEC,4BAAe,EAAEC,kBAAa,EAAEC,oCAAmB,EAAEC,qBAAgB,EAAEC,oBAAW,CAAC;AAAApH,eAAA,CApJzGoB,WAAW,aAsJLiG,eAAS;AAAArH,eAAA,CAtJfoB,WAAW,WAwJP,CACbkG,eAAI,CAACC,QAAQ,CAAa,CAAC,EAC3BD,eAAI,CAACC,QAAQ,CAAa,CAAC,EAC3BD,eAAI,CAACC,QAAQ,CAAoB,CAAC,EAClCD,eAAI,CAACC,QAAQ,CAAe,CAAC,EAC7BD,eAAI,CAACC,QAAQ,CAAkB,CAAC,EAChCD,eAAI,CAACC,QAAQ,CAAmB,CAAC,EACjCD,eAAI,CAACC,QAAQ,CAAuB,CAAC,EACrCD,eAAI,CAACC,QAAQ,CAAiB,CAAC,CAChC;AAAA,IAAAC,QAAA,GAAAV,OAAA,CAAA/G,OAAA,GA0FYqB,WAAW;AAE1BwF,4BAAe,CAACa,UAAU,CAACrG,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/workspace",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.116",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/workspace/workspace",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "workspace",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.116"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -56,38 +56,42 @@
|
|
|
56
56
|
"@teambit/ui-foundation.ui.corner": "0.0.520",
|
|
57
57
|
"@teambit/ui-foundation.ui.notifications.notification-context": "0.0.501",
|
|
58
58
|
"@teambit/ui-foundation.ui.top-bar": "0.0.514",
|
|
59
|
+
"@teambit/scopes.scope-id": "0.0.7",
|
|
60
|
+
"@teambit/design.ui.tooltip": "0.0.361",
|
|
61
|
+
"@teambit/explorer.ui.component-card": "0.0.30",
|
|
59
62
|
"@teambit/explorer.ui.gallery.component-grid": "0.0.496",
|
|
60
63
|
"@teambit/workspace.ui.empty-workspace": "0.0.508",
|
|
61
|
-
"@teambit/
|
|
62
|
-
"@teambit/
|
|
63
|
-
"@teambit/
|
|
64
|
-
"@teambit/envs": "1.0.114",
|
|
64
|
+
"@teambit/component": "1.0.116",
|
|
65
|
+
"@teambit/dependency-resolver": "1.0.116",
|
|
66
|
+
"@teambit/envs": "1.0.116",
|
|
65
67
|
"@teambit/logger": "0.0.935",
|
|
66
|
-
"@teambit/scope": "1.0.
|
|
67
|
-
"@teambit/graph": "1.0.
|
|
68
|
+
"@teambit/scope": "1.0.116",
|
|
69
|
+
"@teambit/graph": "1.0.116",
|
|
68
70
|
"@teambit/cli": "0.0.842",
|
|
69
|
-
"@teambit/isolator": "1.0.
|
|
70
|
-
"@teambit/component-tree": "1.0.
|
|
71
|
+
"@teambit/isolator": "1.0.116",
|
|
72
|
+
"@teambit/component-tree": "1.0.116",
|
|
71
73
|
"@teambit/harmony.modules.resolved-component": "0.0.495",
|
|
72
|
-
"@teambit/watcher": "1.0.
|
|
73
|
-
"@teambit/aspect-loader": "1.0.
|
|
74
|
-
"@teambit/config": "0.0.
|
|
75
|
-
"@teambit/global-config": "0.0.
|
|
74
|
+
"@teambit/watcher": "1.0.116",
|
|
75
|
+
"@teambit/aspect-loader": "1.0.116",
|
|
76
|
+
"@teambit/config": "0.0.867",
|
|
77
|
+
"@teambit/global-config": "0.0.845",
|
|
76
78
|
"@teambit/harmony.modules.requireable-component": "0.0.495",
|
|
77
79
|
"@teambit/toolbox.modules.module-resolver": "0.0.5",
|
|
78
80
|
"@teambit/workspace.modules.node-modules-linker": "0.0.159",
|
|
79
|
-
"@teambit/graphql": "1.0.
|
|
80
|
-
"@teambit/bundler": "1.0.
|
|
81
|
-
"@teambit/pubsub": "1.0.
|
|
82
|
-
"@teambit/ui": "1.0.
|
|
83
|
-
"@teambit/variants": "0.0.
|
|
81
|
+
"@teambit/graphql": "1.0.116",
|
|
82
|
+
"@teambit/bundler": "1.0.116",
|
|
83
|
+
"@teambit/pubsub": "1.0.116",
|
|
84
|
+
"@teambit/ui": "1.0.116",
|
|
85
|
+
"@teambit/variants": "0.0.960",
|
|
84
86
|
"@teambit/component-issues": "0.0.138",
|
|
85
87
|
"@teambit/workspace.modules.match-pattern": "0.0.502",
|
|
86
88
|
"@teambit/component.ui.component-drawer": "0.0.383",
|
|
87
|
-
"@teambit/command-bar": "1.0.
|
|
88
|
-
"@teambit/sidebar": "1.0.
|
|
89
|
+
"@teambit/command-bar": "1.0.116",
|
|
90
|
+
"@teambit/sidebar": "1.0.116",
|
|
91
|
+
"@teambit/deprecation": "1.0.116",
|
|
89
92
|
"@teambit/component-descriptor": "0.0.410",
|
|
90
|
-
"@teambit/
|
|
93
|
+
"@teambit/cloud.hooks.use-cloud-scopes": "0.0.1",
|
|
94
|
+
"@teambit/preview.ui.preview-placeholder": "0.0.505"
|
|
91
95
|
},
|
|
92
96
|
"devDependencies": {
|
|
93
97
|
"@types/lodash": "4.14.165",
|
|
@@ -21,6 +21,13 @@ const wcComponentFields = gql`
|
|
|
21
21
|
version
|
|
22
22
|
scope
|
|
23
23
|
}
|
|
24
|
+
aspects(include: ["teambit.preview/preview", "teambit.envs/envs"]) {
|
|
25
|
+
# 'id' property in gql refers to a *global* identifier and used for caching.
|
|
26
|
+
# this makes aspect data cache under the same key, even when they are under different components.
|
|
27
|
+
# renaming the property fixes that.
|
|
28
|
+
aspectId: id
|
|
29
|
+
data
|
|
30
|
+
}
|
|
24
31
|
compositions {
|
|
25
32
|
identifier
|
|
26
33
|
}
|
|
@@ -37,8 +44,12 @@ const wcComponentFields = gql`
|
|
|
37
44
|
}
|
|
38
45
|
isDeleted
|
|
39
46
|
}
|
|
47
|
+
buildStatus
|
|
40
48
|
preview {
|
|
49
|
+
includesEnvTemplate
|
|
50
|
+
legacyHeader
|
|
41
51
|
isScaling
|
|
52
|
+
skipIncludes
|
|
42
53
|
}
|
|
43
54
|
deprecation {
|
|
44
55
|
isDeprecate
|
|
@@ -16,7 +16,7 @@ export type WorkspaceModelComponent = {
|
|
|
16
16
|
export type WorkspaceProps = {
|
|
17
17
|
name: string;
|
|
18
18
|
path: string;
|
|
19
|
-
components: ComponentModelProps[];
|
|
19
|
+
components: (ComponentModelProps & { aspects: Record<string, any> })[];
|
|
20
20
|
icon: string;
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -58,7 +58,16 @@ export class Workspace {
|
|
|
58
58
|
static from({ name, path, components, icon }: WorkspaceProps) {
|
|
59
59
|
const componentDescriptors = components.map((component) => {
|
|
60
60
|
const id = ComponentID.fromObject(component.id);
|
|
61
|
-
|
|
61
|
+
const aspectList = {
|
|
62
|
+
entries: component?.aspects.map((aspectObject) => {
|
|
63
|
+
return {
|
|
64
|
+
...aspectObject,
|
|
65
|
+
aspectId: aspectObject.aspectId,
|
|
66
|
+
aspectData: aspectObject.data,
|
|
67
|
+
};
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
return ComponentDescriptor.fromObject({ id: id.toString(), aspectList });
|
|
62
71
|
});
|
|
63
72
|
return new Workspace(
|
|
64
73
|
name,
|
|
@@ -4,3 +4,34 @@
|
|
|
4
4
|
height: 100%;
|
|
5
5
|
box-sizing: border-box;
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
.rightPreviewPlugins {
|
|
9
|
+
// background-color: var(--surface-color);
|
|
10
|
+
display: flex;
|
|
11
|
+
// box-shadow: 0px 2px 48px rgb(0 0 0 / 89%);
|
|
12
|
+
// box-shadow: 0px 2px 160px rgb(0 0 0 / 52%);
|
|
13
|
+
// border-radius: 8px;
|
|
14
|
+
// padding: 4px;
|
|
15
|
+
align-items: flex-end;
|
|
16
|
+
justify-content: flex-end;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.envIcon {
|
|
22
|
+
// padding-right: 4px;
|
|
23
|
+
// height: 24px;
|
|
24
|
+
height: 14px;
|
|
25
|
+
// padding-top: 2px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.badge {
|
|
29
|
+
background-color: var(--surface-color);
|
|
30
|
+
padding: 4px;
|
|
31
|
+
height: 15px;
|
|
32
|
+
margin-right: 4px;
|
|
33
|
+
z-index: 100;
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
margin-bottom: 4px;
|
|
36
|
+
box-shadow: 0px 2px 18px rgb(0 0 0 / 10%);
|
|
37
|
+
}
|
|
@@ -1,22 +1,89 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { ComponentGrid } from '@teambit/explorer.ui.gallery.component-grid';
|
|
3
3
|
import { EmptyWorkspace } from '@teambit/workspace.ui.empty-workspace';
|
|
4
|
-
import {
|
|
4
|
+
import { PreviewPlaceholder } from '@teambit/preview.ui.preview-placeholder';
|
|
5
|
+
import { Tooltip } from '@teambit/design.ui.tooltip';
|
|
6
|
+
import { ComponentID } from '@teambit/component-id';
|
|
7
|
+
import { ComponentModel } from '@teambit/component';
|
|
8
|
+
import { useCloudScopes } from '@teambit/cloud.hooks.use-cloud-scopes';
|
|
9
|
+
import { ScopeID } from '@teambit/scopes.scope-id';
|
|
10
|
+
import { ComponentCard, ComponentCardPluginType, PluginProps } from '@teambit/explorer.ui.component-card';
|
|
5
11
|
import { WorkspaceContext } from '../workspace-context';
|
|
6
12
|
import styles from './workspace-overview.module.scss';
|
|
13
|
+
import { LinkPlugin } from './link-plugin';
|
|
7
14
|
|
|
8
15
|
export function WorkspaceOverview() {
|
|
9
16
|
const workspace = useContext(WorkspaceContext);
|
|
10
|
-
const
|
|
17
|
+
const compModelsById = new Map(workspace.components.map((comp) => [comp.id.toString(), comp]));
|
|
18
|
+
const { components, componentDescriptors } = workspace;
|
|
19
|
+
const uniqueScopes = new Set(components.map((c) => c.id.scope));
|
|
20
|
+
const uniqueScopesArr = Array.from(uniqueScopes);
|
|
21
|
+
const { cloudScopes = [] } = useCloudScopes(uniqueScopesArr);
|
|
22
|
+
const cloudScopesById = new Map(cloudScopes.map((scope) => [scope.id.toString(), scope]));
|
|
23
|
+
const plugins = useCardPlugins({ compModelsById });
|
|
11
24
|
if (!components || components.length === 0) return <EmptyWorkspace name={workspace.name} />;
|
|
25
|
+
const compDescriptorById = new Map(componentDescriptors.map((comp) => [comp.id.toString(), comp]));
|
|
12
26
|
return (
|
|
13
27
|
<div className={styles.container}>
|
|
14
28
|
<ComponentGrid>
|
|
15
|
-
{components.map((component
|
|
29
|
+
{components.map((component) => {
|
|
16
30
|
if (component.deprecation?.isDeprecate) return null;
|
|
17
|
-
|
|
31
|
+
const compDescriptor = compDescriptorById.get(component.id.toString());
|
|
32
|
+
if (!compDescriptor) return null;
|
|
33
|
+
const cloudScope = cloudScopesById.get(component.id.scope);
|
|
34
|
+
const scope =
|
|
35
|
+
cloudScope ||
|
|
36
|
+
(ScopeID.isValid(component.id.scope) && { id: ScopeID.fromString(component.id.scope) }) ||
|
|
37
|
+
undefined;
|
|
38
|
+
return (
|
|
39
|
+
<ComponentCard
|
|
40
|
+
key={component.id.toString()}
|
|
41
|
+
component={compDescriptor}
|
|
42
|
+
plugins={plugins}
|
|
43
|
+
displayOwnerDetails="all"
|
|
44
|
+
scope={scope}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
18
47
|
})}
|
|
19
48
|
</ComponentGrid>
|
|
20
49
|
</div>
|
|
21
50
|
);
|
|
22
51
|
}
|
|
52
|
+
|
|
53
|
+
export function useCardPlugins({
|
|
54
|
+
compModelsById,
|
|
55
|
+
}: {
|
|
56
|
+
compModelsById: Map<string, ComponentModel>;
|
|
57
|
+
}): ComponentCardPluginType<PluginProps>[] {
|
|
58
|
+
const plugins = React.useMemo(
|
|
59
|
+
() => [
|
|
60
|
+
{
|
|
61
|
+
preview: function Preview({ component }) {
|
|
62
|
+
const compModel = compModelsById.get(component.id.toString());
|
|
63
|
+
if (!compModel) return null;
|
|
64
|
+
return <PreviewPlaceholder componentDescriptor={component} component={compModel} />;
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
previewBottomRight: function PreviewBottomRight({ component }) {
|
|
69
|
+
const env = component.get('teambit.envs/envs');
|
|
70
|
+
const envComponentId = env?.id ? ComponentID.fromString(env?.id) : undefined;
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div className={styles.rightPreviewPlugins}>
|
|
74
|
+
<div className={styles.badge}>
|
|
75
|
+
<Tooltip delay={300} content={envComponentId?.name}>
|
|
76
|
+
<img src={env?.icon} className={styles.envIcon} />
|
|
77
|
+
</Tooltip>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
new LinkPlugin(),
|
|
84
|
+
],
|
|
85
|
+
[compModelsById.size]
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
return plugins;
|
|
89
|
+
}
|
|
@@ -153,6 +153,10 @@ export class WorkspaceComponentLoader {
|
|
|
153
153
|
const workspaceScopeIdsMap: WorkspaceScopeIdsMap = await this.groupAndUpdateIds(ids);
|
|
154
154
|
|
|
155
155
|
const groupsToHandle = await this.buildLoadGroups(workspaceScopeIdsMap);
|
|
156
|
+
// prefix your command with "BIT_LOG=*" to see the detailed groups
|
|
157
|
+
if (process.env.BIT_LOG) {
|
|
158
|
+
printGroupsToHandle(groupsToHandle, this.logger);
|
|
159
|
+
}
|
|
156
160
|
const groupsRes = compact(
|
|
157
161
|
await mapSeries(groupsToHandle, async (group) => {
|
|
158
162
|
const { scopeIds, workspaceIds, aspects, core, seeders } = group;
|
|
@@ -344,7 +348,7 @@ export class WorkspaceComponentLoader {
|
|
|
344
348
|
if (!aspectIds.length) return;
|
|
345
349
|
|
|
346
350
|
try {
|
|
347
|
-
await this.workspace.loadAspects(aspectIds, true, 'self loading aspects', {});
|
|
351
|
+
await this.workspace.loadAspects(aspectIds, true, 'self loading aspects', { useScopeAspectsCapsule: true });
|
|
348
352
|
} catch (err: any) {
|
|
349
353
|
this.logger.warn(`failed loading components as aspects for components ${aspectIds.join(', ')}`, err);
|
|
350
354
|
// we ignore that errors at the moment
|
|
@@ -831,3 +835,22 @@ function createComponentCacheKey(id: ComponentID, loadOpts?: ComponentLoadOption
|
|
|
831
835
|
function sortKeys(obj: Object) {
|
|
832
836
|
return fromPairs(Object.entries(obj).sort(([k1], [k2]) => k1.localeCompare(k2)));
|
|
833
837
|
}
|
|
838
|
+
|
|
839
|
+
function printGroupsToHandle(groupsToHandle: Array<LoadGroup>, logger: Logger): void {
|
|
840
|
+
groupsToHandle.forEach((group) => {
|
|
841
|
+
const { scopeIds, workspaceIds, aspects, core, seeders } = group;
|
|
842
|
+
logger.console(
|
|
843
|
+
`workspace-component-loader ~ groupsToHandle ${JSON.stringify(
|
|
844
|
+
{
|
|
845
|
+
scopeIds: scopeIds.map((id) => id.toString()),
|
|
846
|
+
workspaceIds: workspaceIds.map((id) => id.toString()),
|
|
847
|
+
aspects,
|
|
848
|
+
core,
|
|
849
|
+
seeders,
|
|
850
|
+
},
|
|
851
|
+
null,
|
|
852
|
+
2
|
|
853
|
+
)}`
|
|
854
|
+
);
|
|
855
|
+
});
|
|
856
|
+
}
|
package/workspace.ui.runtime.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { compact, flatten } from 'lodash';
|
|
|
3
3
|
import { ComponentTreeAspect, ComponentTreeUI, ComponentTreeNode } from '@teambit/component-tree';
|
|
4
4
|
import { Slot, SlotRegistry } from '@teambit/harmony';
|
|
5
5
|
import { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
6
|
-
import { Menu } from '@teambit/ui-foundation.ui.menu';
|
|
6
|
+
import { Menu, MenuWidgetSlot, MenuWidget } from '@teambit/ui-foundation.ui.menu';
|
|
7
7
|
import SidebarAspect, { SidebarUI, SidebarItem, SidebarItemSlot } from '@teambit/sidebar';
|
|
8
8
|
import { MenuItemSlot, MenuItem } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
9
9
|
import { UIAspect, UIRootUI as UIRoot, UIRuntime, UiUI } from '@teambit/ui';
|
|
@@ -62,7 +62,9 @@ export class WorkspaceUI {
|
|
|
62
62
|
|
|
63
63
|
private drawerComponentsFiltersSlot: ComponentFiltersSlot,
|
|
64
64
|
|
|
65
|
-
private commandBarUI: CommandBarUI
|
|
65
|
+
private commandBarUI: CommandBarUI,
|
|
66
|
+
|
|
67
|
+
private menuWidgetSlot: MenuWidgetSlot
|
|
66
68
|
) {}
|
|
67
69
|
|
|
68
70
|
private setKeyBindHandler: (updated: CommandHandler) => void = () => {};
|
|
@@ -89,6 +91,10 @@ export class WorkspaceUI {
|
|
|
89
91
|
this.menuItemSlot.register(menuItems);
|
|
90
92
|
};
|
|
91
93
|
|
|
94
|
+
registerMenuWidget = (menuWidgets: MenuWidget[]) => {
|
|
95
|
+
this.menuWidgetSlot.register(menuWidgets);
|
|
96
|
+
};
|
|
97
|
+
|
|
92
98
|
registerMenuRoutes = (routes: RouteProps[]) => {
|
|
93
99
|
this.menuSlot.register(routes);
|
|
94
100
|
return this;
|
|
@@ -184,6 +190,7 @@ export class WorkspaceUI {
|
|
|
184
190
|
Slot.withType<SidebarItemSlot>(),
|
|
185
191
|
Slot.withType<DrawerWidgetSlot>(),
|
|
186
192
|
Slot.withType<ComponentFiltersSlot>(),
|
|
193
|
+
Slot.withType<MenuWidgetSlot>(),
|
|
187
194
|
];
|
|
188
195
|
|
|
189
196
|
static async provider(
|
|
@@ -196,14 +203,24 @@ export class WorkspaceUI {
|
|
|
196
203
|
GraphUI
|
|
197
204
|
],
|
|
198
205
|
config,
|
|
199
|
-
[
|
|
206
|
+
[
|
|
207
|
+
routeSlot,
|
|
208
|
+
menuSlot,
|
|
209
|
+
menuItemSlot,
|
|
210
|
+
sidebarSlot,
|
|
211
|
+
sidebarItemSlot,
|
|
212
|
+
drawerWidgetSlot,
|
|
213
|
+
drawerComponentsFiltersSlot,
|
|
214
|
+
menuWidgetSlot,
|
|
215
|
+
]: [
|
|
200
216
|
RouteSlot,
|
|
201
217
|
RouteSlot,
|
|
202
218
|
MenuItemSlot,
|
|
203
219
|
SidebarWidgetSlot,
|
|
204
220
|
SidebarItemSlot,
|
|
205
221
|
DrawerWidgetSlot,
|
|
206
|
-
ComponentFiltersSlot
|
|
222
|
+
ComponentFiltersSlot,
|
|
223
|
+
MenuWidgetSlot
|
|
207
224
|
]
|
|
208
225
|
) {
|
|
209
226
|
componentTree.registerTreeNode(new ComponentTreeWidget());
|
|
@@ -220,7 +237,8 @@ export class WorkspaceUI {
|
|
|
220
237
|
sidebarItemSlot,
|
|
221
238
|
drawerWidgetSlot,
|
|
222
239
|
drawerComponentsFiltersSlot,
|
|
223
|
-
commandBarUI
|
|
240
|
+
commandBarUI,
|
|
241
|
+
menuWidgetSlot
|
|
224
242
|
);
|
|
225
243
|
|
|
226
244
|
workspaceUI.registerDrawerComponentFilters([DeprecateFilter, EnvsFilter, ShowMainFilter(true)]);
|
|
@@ -244,7 +262,7 @@ export class WorkspaceUI {
|
|
|
244
262
|
workspaceUI.registerMenuRoutes([
|
|
245
263
|
{
|
|
246
264
|
path: '/',
|
|
247
|
-
element: <Menu menuItemSlot={workspaceUI.menuItemSlot} />,
|
|
265
|
+
element: <Menu menuItemSlot={workspaceUI.menuItemSlot} widgetSlot={workspaceUI.menuWidgetSlot} />,
|
|
248
266
|
},
|
|
249
267
|
{
|
|
250
268
|
path: workspaceUI.componentUi.routePath,
|