@teambit/workspace 0.0.963 → 0.0.965
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/bit-map.d.ts +1 -0
- package/dist/bit-map.js +8 -0
- package/dist/bit-map.js.map +1 -1
- package/dist/{preview-1674039846300.js → preview-1674271762484.js} +2 -2
- package/dist/workspace.d.ts +1 -0
- package/dist/workspace.js +15 -0
- package/dist/workspace.js.map +1 -1
- package/dist/workspace.ui.drawer.d.ts +6 -1
- package/dist/workspace.ui.drawer.js +51 -45
- package/dist/workspace.ui.drawer.js.map +1 -1
- package/package-tar/teambit-workspace-0.0.965.tgz +0 -0
- package/package.json +34 -33
- package/workspace.ui.drawer.tsx +15 -4
- package/package-tar/teambit-workspace-0.0.963.tgz +0 -0
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { ComponentsDrawer, ComponentFiltersSlot, DrawerWidgetSlot } from '@teambit/component.ui.component-drawer';
|
|
2
|
+
import { LanesModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
2
3
|
import { SidebarWidgetSlot } from './workspace.ui.runtime';
|
|
3
4
|
export declare type WorkspaceDrawerProps = {
|
|
4
5
|
treeWidgets: SidebarWidgetSlot;
|
|
5
6
|
filtersSlot: ComponentFiltersSlot;
|
|
6
7
|
drawerWidgetSlot: DrawerWidgetSlot;
|
|
8
|
+
overrideUseLanes?: () => {
|
|
9
|
+
lanesModel?: LanesModel;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
};
|
|
7
12
|
};
|
|
8
|
-
export declare const workspaceDrawer: ({ treeWidgets, filtersSlot, drawerWidgetSlot }: WorkspaceDrawerProps) => ComponentsDrawer;
|
|
13
|
+
export declare const workspaceDrawer: ({ treeWidgets, filtersSlot, drawerWidgetSlot, overrideUseLanes: useLanesFromProps, }: WorkspaceDrawerProps) => ComponentsDrawer;
|
|
@@ -50,54 +50,60 @@ function _lanesHooks2() {
|
|
|
50
50
|
const workspaceDrawer = ({
|
|
51
51
|
treeWidgets,
|
|
52
52
|
filtersSlot,
|
|
53
|
-
drawerWidgetSlot
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
drawerWidgetSlot,
|
|
54
|
+
overrideUseLanes: useLanesFromProps
|
|
55
|
+
}) => {
|
|
56
|
+
const useLanes = useLanesFromProps || _lanesHooks().useLanes;
|
|
57
|
+
return new (_componentUi().ComponentsDrawer)({
|
|
58
|
+
order: 0,
|
|
59
|
+
id: 'workspace-components-drawer',
|
|
60
|
+
name: 'COMPONENTS',
|
|
61
|
+
plugins: {
|
|
62
|
+
tree: {
|
|
63
|
+
widgets: treeWidgets,
|
|
64
|
+
customRenderer: treeNodeSlot => function TreeNode(props) {
|
|
65
|
+
const children = props.node.children;
|
|
66
|
+
if (!children) return /*#__PURE__*/_react().default.createElement(_uiFoundationUi().ComponentView, (0, _extends2().default)({}, props, {
|
|
67
|
+
treeNodeSlot: treeNodeSlot,
|
|
68
|
+
useLanes: useLanes
|
|
69
|
+
})); // non collapse
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
if (props.node.payload instanceof _uiFoundationUi().ScopePayload) return /*#__PURE__*/_react().default.createElement(_uiFoundationUi().ScopeTreeNode, props);
|
|
72
|
+
return /*#__PURE__*/_react().default.createElement(_uiFoundationUi().NamespaceTreeNode, props);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
filters: filtersSlot,
|
|
76
|
+
drawerWidgets: drawerWidgetSlot
|
|
70
77
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
loading: mainCompsLoading
|
|
91
|
-
} = (0, _lanesHooks2().useLaneComponents)(!isViewingDefaultLane ? defaultLane === null || defaultLane === void 0 ? void 0 : defaultLane.id : undefined);
|
|
78
|
+
emptyMessage: 'Workspace is empty',
|
|
79
|
+
useLanes,
|
|
80
|
+
useComponents: () => {
|
|
81
|
+
var _lanesModel$viewedLan;
|
|
82
|
+
const {
|
|
83
|
+
lanesModel,
|
|
84
|
+
loading: lanesLoading
|
|
85
|
+
} = useLanes();
|
|
86
|
+
const viewedLaneId = lanesModel === null || lanesModel === void 0 ? void 0 : (_lanesModel$viewedLan = lanesModel.viewedLane) === null || _lanesModel$viewedLan === void 0 ? void 0 : _lanesModel$viewedLan.id;
|
|
87
|
+
const defaultLane = lanesModel === null || lanesModel === void 0 ? void 0 : lanesModel.getDefaultLane();
|
|
88
|
+
const isViewingDefaultLane = viewedLaneId && (defaultLane === null || defaultLane === void 0 ? void 0 : defaultLane.id.isEqual(viewedLaneId));
|
|
89
|
+
const {
|
|
90
|
+
components: laneComponents = [],
|
|
91
|
+
loading: laneCompsLoading
|
|
92
|
+
} = (0, _lanesHooks2().useLaneComponents)(viewedLaneId);
|
|
93
|
+
const {
|
|
94
|
+
components: mainComponents = [],
|
|
95
|
+
loading: mainCompsLoading
|
|
96
|
+
} = (0, _lanesHooks2().useLaneComponents)(!isViewingDefaultLane ? defaultLane === null || defaultLane === void 0 ? void 0 : defaultLane.id : undefined);
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
});
|
|
98
|
+
// lane components + main components
|
|
99
|
+
const components = isViewingDefaultLane ? laneComponents : mergeComponents(mainComponents, laneComponents);
|
|
100
|
+
return {
|
|
101
|
+
loading: lanesLoading || laneCompsLoading || mainCompsLoading,
|
|
102
|
+
components
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
};
|
|
101
107
|
exports.workspaceDrawer = workspaceDrawer;
|
|
102
108
|
function mergeComponents(mainComponents, laneComponents) {
|
|
103
109
|
const mainComponentsThatAreNotOnLane = mainComponents.filter(mainComponent => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["workspaceDrawer","treeWidgets","filtersSlot","drawerWidgetSlot","ComponentsDrawer","order","id","name","plugins","tree","widgets","customRenderer","treeNodeSlot","TreeNode","props","children","node","payload","ScopePayload","filters","drawerWidgets","emptyMessage","useComponents","lanesModel","loading","lanesLoading","
|
|
1
|
+
{"version":3,"names":["workspaceDrawer","treeWidgets","filtersSlot","drawerWidgetSlot","overrideUseLanes","useLanesFromProps","useLanes","defaultUseLanesHook","ComponentsDrawer","order","id","name","plugins","tree","widgets","customRenderer","treeNodeSlot","TreeNode","props","children","node","payload","ScopePayload","filters","drawerWidgets","emptyMessage","useComponents","lanesModel","loading","lanesLoading","viewedLaneId","viewedLane","defaultLane","getDefaultLane","isViewingDefaultLane","isEqual","components","laneComponents","laneCompsLoading","useLaneComponents","mainComponents","mainCompsLoading","undefined","mergeComponents","mainComponentsThatAreNotOnLane","filter","mainComponent","find","laneComponent","toStringWithoutVersion","concat"],"sources":["workspace.ui.drawer.tsx"],"sourcesContent":["import React from 'react';\nimport { ComponentsDrawer, ComponentFiltersSlot, DrawerWidgetSlot } from '@teambit/component.ui.component-drawer';\nimport {\n ComponentView,\n NamespaceTreeNode,\n PayloadType,\n ScopePayload,\n ScopeTreeNode,\n} from '@teambit/ui-foundation.ui.side-bar';\nimport { useLanes as defaultUseLanesHook } from '@teambit/lanes.hooks.use-lanes';\nimport { useLaneComponents } from '@teambit/lanes.hooks.use-lane-components';\nimport { TreeNodeProps } from '@teambit/design.ui.tree';\nimport { ComponentModel } from '@teambit/component';\nimport { LanesModel } from '@teambit/lanes.ui.models.lanes-model';\nimport { SidebarWidgetSlot } from './workspace.ui.runtime';\n\nexport type WorkspaceDrawerProps = {\n treeWidgets: SidebarWidgetSlot;\n filtersSlot: ComponentFiltersSlot;\n drawerWidgetSlot: DrawerWidgetSlot;\n overrideUseLanes?: () => { lanesModel?: LanesModel; loading?: boolean };\n};\n\nexport const workspaceDrawer = ({\n treeWidgets,\n filtersSlot,\n drawerWidgetSlot,\n overrideUseLanes: useLanesFromProps,\n}: WorkspaceDrawerProps) => {\n const useLanes = useLanesFromProps || defaultUseLanesHook;\n\n return new ComponentsDrawer({\n order: 0,\n id: 'workspace-components-drawer',\n name: 'COMPONENTS',\n plugins: {\n tree: {\n widgets: treeWidgets,\n customRenderer: (treeNodeSlot) =>\n function TreeNode(props: TreeNodeProps<PayloadType>) {\n const children = props.node.children;\n\n if (!children) return <ComponentView {...props} treeNodeSlot={treeNodeSlot} useLanes={useLanes} />; // non collapse\n\n if (props.node.payload instanceof ScopePayload) return <ScopeTreeNode {...props} />;\n\n return <NamespaceTreeNode {...props} />;\n },\n },\n filters: filtersSlot,\n drawerWidgets: drawerWidgetSlot,\n },\n emptyMessage: 'Workspace is empty',\n useLanes,\n useComponents: () => {\n const { lanesModel, loading: lanesLoading } = useLanes();\n const viewedLaneId = lanesModel?.viewedLane?.id;\n const defaultLane = lanesModel?.getDefaultLane();\n const isViewingDefaultLane = viewedLaneId && defaultLane?.id.isEqual(viewedLaneId);\n\n const { components: laneComponents = [], loading: laneCompsLoading } = useLaneComponents(viewedLaneId);\n const { components: mainComponents = [], loading: mainCompsLoading } = useLaneComponents(\n !isViewingDefaultLane ? defaultLane?.id : undefined\n );\n\n // lane components + main components\n const components = isViewingDefaultLane ? laneComponents : mergeComponents(mainComponents, laneComponents);\n\n return {\n loading: lanesLoading || laneCompsLoading || mainCompsLoading,\n components,\n };\n },\n });\n};\n\nfunction mergeComponents(mainComponents: ComponentModel[], laneComponents: ComponentModel[]): ComponentModel[] {\n const mainComponentsThatAreNotOnLane = mainComponents.filter((mainComponent) => {\n return !laneComponents.find(\n (laneComponent) => laneComponent.id.toStringWithoutVersion() === mainComponent.id.toStringWithoutVersion()\n );\n });\n return laneComponents.concat(mainComponentsThatAreNotOnLane);\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAaO,MAAMA,eAAe,GAAG,CAAC;EAC9BC,WAAW;EACXC,WAAW;EACXC,gBAAgB;EAChBC,gBAAgB,EAAEC;AACE,CAAC,KAAK;EAC1B,MAAMC,QAAQ,GAAGD,iBAAiB,IAAIE,sBAAmB;EAEzD,OAAO,KAAIC,+BAAgB,EAAC;IAC1BC,KAAK,EAAE,CAAC;IACRC,EAAE,EAAE,6BAA6B;IACjCC,IAAI,EAAE,YAAY;IAClBC,OAAO,EAAE;MACPC,IAAI,EAAE;QACJC,OAAO,EAAEb,WAAW;QACpBc,cAAc,EAAGC,YAAY,IAC3B,SAASC,QAAQ,CAACC,KAAiC,EAAE;UACnD,MAAMC,QAAQ,GAAGD,KAAK,CAACE,IAAI,CAACD,QAAQ;UAEpC,IAAI,CAACA,QAAQ,EAAE,oBAAO,+BAAC,+BAAa,+BAAKD,KAAK;YAAE,YAAY,EAAEF,YAAa;YAAC,QAAQ,EAAEV;UAAS,GAAG,CAAC,CAAC;;UAEpG,IAAIY,KAAK,CAACE,IAAI,CAACC,OAAO,YAAYC,8BAAY,EAAE,oBAAO,+BAAC,+BAAa,EAAKJ,KAAK,CAAI;UAEnF,oBAAO,+BAAC,mCAAiB,EAAKA,KAAK,CAAI;QACzC;MACJ,CAAC;MACDK,OAAO,EAAErB,WAAW;MACpBsB,aAAa,EAAErB;IACjB,CAAC;IACDsB,YAAY,EAAE,oBAAoB;IAClCnB,QAAQ;IACRoB,aAAa,EAAE,MAAM;MAAA;MACnB,MAAM;QAAEC,UAAU;QAAEC,OAAO,EAAEC;MAAa,CAAC,GAAGvB,QAAQ,EAAE;MACxD,MAAMwB,YAAY,GAAGH,UAAU,aAAVA,UAAU,gDAAVA,UAAU,CAAEI,UAAU,0DAAtB,sBAAwBrB,EAAE;MAC/C,MAAMsB,WAAW,GAAGL,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEM,cAAc,EAAE;MAChD,MAAMC,oBAAoB,GAAGJ,YAAY,KAAIE,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEtB,EAAE,CAACyB,OAAO,CAACL,YAAY,CAAC;MAElF,MAAM;QAAEM,UAAU,EAAEC,cAAc,GAAG,EAAE;QAAET,OAAO,EAAEU;MAAiB,CAAC,GAAG,IAAAC,gCAAiB,EAACT,YAAY,CAAC;MACtG,MAAM;QAAEM,UAAU,EAAEI,cAAc,GAAG,EAAE;QAAEZ,OAAO,EAAEa;MAAiB,CAAC,GAAG,IAAAF,gCAAiB,EACtF,CAACL,oBAAoB,GAAGF,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEtB,EAAE,GAAGgC,SAAS,CACpD;;MAED;MACA,MAAMN,UAAU,GAAGF,oBAAoB,GAAGG,cAAc,GAAGM,eAAe,CAACH,cAAc,EAAEH,cAAc,CAAC;MAE1G,OAAO;QACLT,OAAO,EAAEC,YAAY,IAAIS,gBAAgB,IAAIG,gBAAgB;QAC7DL;MACF,CAAC;IACH;EACF,CAAC,CAAC;AACJ,CAAC;AAAC;AAEF,SAASO,eAAe,CAACH,cAAgC,EAAEH,cAAgC,EAAoB;EAC7G,MAAMO,8BAA8B,GAAGJ,cAAc,CAACK,MAAM,CAAEC,aAAa,IAAK;IAC9E,OAAO,CAACT,cAAc,CAACU,IAAI,CACxBC,aAAa,IAAKA,aAAa,CAACtC,EAAE,CAACuC,sBAAsB,EAAE,KAAKH,aAAa,CAACpC,EAAE,CAACuC,sBAAsB,EAAE,CAC3G;EACH,CAAC,CAAC;EACF,OAAOZ,cAAc,CAACa,MAAM,CAACN,8BAA8B,CAAC;AAC9D"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/workspace",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.965",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/workspace/workspace",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "workspace",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.965"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -33,50 +33,51 @@
|
|
|
33
33
|
"@teambit/design.ui.surfaces.menu.link-item": "1.0.0",
|
|
34
34
|
"@teambit/base-ui.surfaces.split-pane.hover-splitter": "1.0.0",
|
|
35
35
|
"@teambit/base-ui.surfaces.split-pane.split-pane": "1.0.0",
|
|
36
|
-
"@teambit/component": "0.0.
|
|
37
|
-
"@teambit/envs": "0.0.
|
|
36
|
+
"@teambit/component": "0.0.965",
|
|
37
|
+
"@teambit/envs": "0.0.965",
|
|
38
38
|
"@teambit/bit-error": "0.0.402",
|
|
39
39
|
"@teambit/component-id": "0.0.425",
|
|
40
|
-
"@teambit/lane-id": "0.0.
|
|
41
|
-
"@teambit/dependency-resolver": "0.0.
|
|
42
|
-
"@teambit/logger": "0.0.
|
|
43
|
-
"@teambit/scope": "0.0.
|
|
44
|
-
"@teambit/graph": "0.0.
|
|
45
|
-
"@teambit/cli": "0.0.
|
|
46
|
-
"@teambit/isolator": "0.0.
|
|
47
|
-
"@teambit/component-tree": "0.0.
|
|
40
|
+
"@teambit/lane-id": "0.0.165",
|
|
41
|
+
"@teambit/dependency-resolver": "0.0.965",
|
|
42
|
+
"@teambit/logger": "0.0.741",
|
|
43
|
+
"@teambit/scope": "0.0.965",
|
|
44
|
+
"@teambit/graph": "0.0.965",
|
|
45
|
+
"@teambit/cli": "0.0.648",
|
|
46
|
+
"@teambit/isolator": "0.0.965",
|
|
47
|
+
"@teambit/component-tree": "0.0.753",
|
|
48
48
|
"@teambit/component.ui.component-status-resolver": "0.0.504",
|
|
49
|
-
"@teambit/lanes.hooks.use-lanes": "0.0.
|
|
49
|
+
"@teambit/lanes.hooks.use-lanes": "0.0.111",
|
|
50
50
|
"@teambit/harmony.modules.resolved-component": "0.0.491",
|
|
51
|
-
"@teambit/compiler": "0.0.
|
|
52
|
-
"@teambit/graphql": "0.0.
|
|
53
|
-
"@teambit/aspect-loader": "0.0.
|
|
54
|
-
"@teambit/bundler": "0.0.
|
|
55
|
-
"@teambit/pubsub": "0.0.
|
|
56
|
-
"@teambit/ui": "0.0.
|
|
57
|
-
"@teambit/variants": "0.0.
|
|
51
|
+
"@teambit/compiler": "0.0.965",
|
|
52
|
+
"@teambit/graphql": "0.0.965",
|
|
53
|
+
"@teambit/aspect-loader": "0.0.965",
|
|
54
|
+
"@teambit/bundler": "0.0.965",
|
|
55
|
+
"@teambit/pubsub": "0.0.965",
|
|
56
|
+
"@teambit/ui": "0.0.965",
|
|
57
|
+
"@teambit/variants": "0.0.753",
|
|
58
58
|
"@teambit/component-issues": "0.0.85",
|
|
59
|
-
"@teambit/config": "0.0.
|
|
59
|
+
"@teambit/config": "0.0.661",
|
|
60
60
|
"@teambit/harmony.modules.requireable-component": "0.0.491",
|
|
61
61
|
"@teambit/legacy-bit-id": "0.0.421",
|
|
62
62
|
"@teambit/workspace.modules.match-pattern": "0.0.498",
|
|
63
|
-
"@teambit/component.ui.component-drawer": "0.0.
|
|
63
|
+
"@teambit/component.ui.component-drawer": "0.0.206",
|
|
64
64
|
"@teambit/design.ui.tree": "0.0.16",
|
|
65
|
-
"@teambit/lanes.hooks.use-lane-components": "0.0.
|
|
66
|
-
"@teambit/
|
|
67
|
-
"@teambit/
|
|
68
|
-
"@teambit/
|
|
69
|
-
"@teambit/component.ui.component-filters.
|
|
70
|
-
"@teambit/component.ui.component-filters.
|
|
71
|
-
"@teambit/component.ui.component-filters.
|
|
72
|
-
"@teambit/
|
|
65
|
+
"@teambit/lanes.hooks.use-lane-components": "0.0.110",
|
|
66
|
+
"@teambit/lanes.ui.models.lanes-model": "0.0.73",
|
|
67
|
+
"@teambit/ui-foundation.ui.side-bar": "0.0.723",
|
|
68
|
+
"@teambit/command-bar": "0.0.965",
|
|
69
|
+
"@teambit/component.ui.component-filters.component-filter-context": "0.0.80",
|
|
70
|
+
"@teambit/component.ui.component-filters.deprecate-filter": "0.0.80",
|
|
71
|
+
"@teambit/component.ui.component-filters.env-filter": "0.0.86",
|
|
72
|
+
"@teambit/component.ui.component-filters.show-main-filter": "0.0.73",
|
|
73
|
+
"@teambit/sidebar": "0.0.965",
|
|
73
74
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.497",
|
|
74
75
|
"@teambit/ui-foundation.ui.menu": "0.0.497",
|
|
75
76
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.501",
|
|
76
77
|
"@teambit/ui-foundation.ui.tree.drawer": "0.0.511",
|
|
77
78
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.500",
|
|
78
|
-
"@teambit/component-descriptor": "0.0.
|
|
79
|
-
"@teambit/deprecation": "0.0.
|
|
79
|
+
"@teambit/component-descriptor": "0.0.217",
|
|
80
|
+
"@teambit/deprecation": "0.0.965",
|
|
80
81
|
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.498",
|
|
81
82
|
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.206",
|
|
82
83
|
"@teambit/ui-foundation.ui.corner": "0.0.507",
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
"peerDependencies": {
|
|
104
105
|
"react-router-dom": "^6.0.0",
|
|
105
106
|
"@apollo/client": "^3.6.0",
|
|
106
|
-
"@teambit/legacy": "1.0.
|
|
107
|
+
"@teambit/legacy": "1.0.429",
|
|
107
108
|
"react": "^16.8.0 || ^17.0.0",
|
|
108
109
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
109
110
|
},
|
package/workspace.ui.drawer.tsx
CHANGED
|
@@ -7,20 +7,29 @@ import {
|
|
|
7
7
|
ScopePayload,
|
|
8
8
|
ScopeTreeNode,
|
|
9
9
|
} from '@teambit/ui-foundation.ui.side-bar';
|
|
10
|
-
import { useLanes } from '@teambit/lanes.hooks.use-lanes';
|
|
10
|
+
import { useLanes as defaultUseLanesHook } from '@teambit/lanes.hooks.use-lanes';
|
|
11
11
|
import { useLaneComponents } from '@teambit/lanes.hooks.use-lane-components';
|
|
12
12
|
import { TreeNodeProps } from '@teambit/design.ui.tree';
|
|
13
13
|
import { ComponentModel } from '@teambit/component';
|
|
14
|
+
import { LanesModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
14
15
|
import { SidebarWidgetSlot } from './workspace.ui.runtime';
|
|
15
16
|
|
|
16
17
|
export type WorkspaceDrawerProps = {
|
|
17
18
|
treeWidgets: SidebarWidgetSlot;
|
|
18
19
|
filtersSlot: ComponentFiltersSlot;
|
|
19
20
|
drawerWidgetSlot: DrawerWidgetSlot;
|
|
21
|
+
overrideUseLanes?: () => { lanesModel?: LanesModel; loading?: boolean };
|
|
20
22
|
};
|
|
21
23
|
|
|
22
|
-
export const workspaceDrawer = ({
|
|
23
|
-
|
|
24
|
+
export const workspaceDrawer = ({
|
|
25
|
+
treeWidgets,
|
|
26
|
+
filtersSlot,
|
|
27
|
+
drawerWidgetSlot,
|
|
28
|
+
overrideUseLanes: useLanesFromProps,
|
|
29
|
+
}: WorkspaceDrawerProps) => {
|
|
30
|
+
const useLanes = useLanesFromProps || defaultUseLanesHook;
|
|
31
|
+
|
|
32
|
+
return new ComponentsDrawer({
|
|
24
33
|
order: 0,
|
|
25
34
|
id: 'workspace-components-drawer',
|
|
26
35
|
name: 'COMPONENTS',
|
|
@@ -31,7 +40,7 @@ export const workspaceDrawer = ({ treeWidgets, filtersSlot, drawerWidgetSlot }:
|
|
|
31
40
|
function TreeNode(props: TreeNodeProps<PayloadType>) {
|
|
32
41
|
const children = props.node.children;
|
|
33
42
|
|
|
34
|
-
if (!children) return <ComponentView {...props} treeNodeSlot={treeNodeSlot} />; // non collapse
|
|
43
|
+
if (!children) return <ComponentView {...props} treeNodeSlot={treeNodeSlot} useLanes={useLanes} />; // non collapse
|
|
35
44
|
|
|
36
45
|
if (props.node.payload instanceof ScopePayload) return <ScopeTreeNode {...props} />;
|
|
37
46
|
|
|
@@ -42,6 +51,7 @@ export const workspaceDrawer = ({ treeWidgets, filtersSlot, drawerWidgetSlot }:
|
|
|
42
51
|
drawerWidgets: drawerWidgetSlot,
|
|
43
52
|
},
|
|
44
53
|
emptyMessage: 'Workspace is empty',
|
|
54
|
+
useLanes,
|
|
45
55
|
useComponents: () => {
|
|
46
56
|
const { lanesModel, loading: lanesLoading } = useLanes();
|
|
47
57
|
const viewedLaneId = lanesModel?.viewedLane?.id;
|
|
@@ -62,6 +72,7 @@ export const workspaceDrawer = ({ treeWidgets, filtersSlot, drawerWidgetSlot }:
|
|
|
62
72
|
};
|
|
63
73
|
},
|
|
64
74
|
});
|
|
75
|
+
};
|
|
65
76
|
|
|
66
77
|
function mergeComponents(mainComponents: ComponentModel[], laneComponents: ComponentModel[]): ComponentModel[] {
|
|
67
78
|
const mainComponentsThatAreNotOnLane = mainComponents.filter((mainComponent) => {
|
|
Binary file
|