@teambit/workspace 0.0.1004 → 0.0.1008
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/{preview-1677814515640.js → preview-1678073766935.js} +2 -2
- package/dist/workspace.ui.drawer.js +20 -4
- package/dist/workspace.ui.drawer.js.map +1 -1
- package/package-tar/teambit-workspace-0.0.1008.tgz +0 -0
- package/package.json +35 -35
- package/workspace.ui.drawer.tsx +24 -6
- package/package-tar/teambit-workspace-0.0.1004.tgz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.1008/dist/workspace.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.1008/dist/workspace.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -108,12 +108,28 @@ const workspaceDrawer = ({
|
|
|
108
108
|
const {
|
|
109
109
|
components: workspaceComponents
|
|
110
110
|
} = workspace;
|
|
111
|
+
const loading = lanesLoading || laneCompsLoading || mainCompsLoading;
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
/**
|
|
114
|
+
* if viewing locally checked out lane, return all components from the workspace
|
|
115
|
+
* when viewing main when locally checked out to another lane, explicitly return components from the "main" lane
|
|
116
|
+
* when viewing another lane when locally checked out to a different lane, return "main" + "lane" components
|
|
117
|
+
* */
|
|
118
|
+
if (isViewingWorkspaceVersions) {
|
|
119
|
+
return {
|
|
120
|
+
loading,
|
|
121
|
+
components: workspaceComponents
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
if (isViewingDefaultLane) {
|
|
125
|
+
return {
|
|
126
|
+
loading,
|
|
127
|
+
components: mainComponents
|
|
128
|
+
};
|
|
129
|
+
}
|
|
114
130
|
return {
|
|
115
|
-
loading
|
|
116
|
-
components
|
|
131
|
+
loading,
|
|
132
|
+
components: mergeComponents(mainComponents, laneComponents)
|
|
117
133
|
};
|
|
118
134
|
}
|
|
119
135
|
});
|
|
@@ -1 +1 @@
|
|
|
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","isViewingWorkspaceVersions","isViewingCurrentLane","components","laneComponents","laneCompsLoading","useLaneComponents","undefined","mainComponents","mainCompsLoading","workspace","useContext","WorkspaceContext","workspaceComponents","mergeComponents","mainComponentsThatAreNotOnLane","filter","mainComponent","find","laneComponent","toStringWithoutVersion","concat"],"sources":["workspace.ui.drawer.tsx"],"sourcesContent":["import React, { useContext } 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';\nimport { WorkspaceContext } from './ui/workspace/workspace-context';\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\n const viewedLaneId = lanesModel?.viewedLane?.id;\n const defaultLane = lanesModel?.getDefaultLane();\n const isViewingDefaultLane = viewedLaneId && defaultLane?.id.isEqual(viewedLaneId);\n const isViewingWorkspaceVersions = lanesModel?.isViewingCurrentLane();\n\n const { components: laneComponents = [], loading: laneCompsLoading } = useLaneComponents(\n !isViewingWorkspaceVersions ? viewedLaneId : undefined\n );\n const { components: mainComponents = [], loading: mainCompsLoading } = useLaneComponents(\n !isViewingDefaultLane ? defaultLane?.id : undefined\n );\n const workspace = useContext(WorkspaceContext);\n const { components: workspaceComponents } = workspace;\n\n
|
|
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","isViewingWorkspaceVersions","isViewingCurrentLane","components","laneComponents","laneCompsLoading","useLaneComponents","undefined","mainComponents","mainCompsLoading","workspace","useContext","WorkspaceContext","workspaceComponents","mergeComponents","mainComponentsThatAreNotOnLane","filter","mainComponent","find","laneComponent","toStringWithoutVersion","concat"],"sources":["workspace.ui.drawer.tsx"],"sourcesContent":["import React, { useContext } 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';\nimport { WorkspaceContext } from './ui/workspace/workspace-context';\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\n const viewedLaneId = lanesModel?.viewedLane?.id;\n const defaultLane = lanesModel?.getDefaultLane();\n const isViewingDefaultLane = viewedLaneId && defaultLane?.id.isEqual(viewedLaneId);\n\n const isViewingWorkspaceVersions = lanesModel?.isViewingCurrentLane();\n\n const { components: laneComponents = [], loading: laneCompsLoading } = useLaneComponents(\n !isViewingWorkspaceVersions ? viewedLaneId : undefined\n );\n const { components: mainComponents = [], loading: mainCompsLoading } = useLaneComponents(\n !isViewingDefaultLane ? defaultLane?.id : undefined\n );\n\n const workspace = useContext(WorkspaceContext);\n const { components: workspaceComponents } = workspace;\n\n const loading = lanesLoading || laneCompsLoading || mainCompsLoading;\n\n /**\n * if viewing locally checked out lane, return all components from the workspace\n * when viewing main when locally checked out to another lane, explicitly return components from the \"main\" lane\n * when viewing another lane when locally checked out to a different lane, return \"main\" + \"lane\" components\n * */\n if (isViewingWorkspaceVersions) {\n return {\n loading,\n components: workspaceComponents,\n };\n }\n\n if (isViewingDefaultLane) {\n return {\n loading,\n components: mainComponents,\n };\n }\n\n return {\n loading,\n components: mergeComponents(mainComponents, laneComponents),\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;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAoE;AAAA;AAS7D,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;MAExD,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,MAAMM,0BAA0B,GAAGT,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEU,oBAAoB,EAAE;MAErE,MAAM;QAAEC,UAAU,EAAEC,cAAc,GAAG,EAAE;QAAEX,OAAO,EAAEY;MAAiB,CAAC,GAAG,IAAAC,gCAAiB,EACtF,CAACL,0BAA0B,GAAGN,YAAY,GAAGY,SAAS,CACvD;MACD,MAAM;QAAEJ,UAAU,EAAEK,cAAc,GAAG,EAAE;QAAEf,OAAO,EAAEgB;MAAiB,CAAC,GAAG,IAAAH,gCAAiB,EACtF,CAACP,oBAAoB,GAAGF,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEtB,EAAE,GAAGgC,SAAS,CACpD;MAED,MAAMG,SAAS,GAAG,IAAAC,mBAAU,EAACC,oCAAgB,CAAC;MAC9C,MAAM;QAAET,UAAU,EAAEU;MAAoB,CAAC,GAAGH,SAAS;MAErD,MAAMjB,OAAO,GAAGC,YAAY,IAAIW,gBAAgB,IAAII,gBAAgB;;MAEpE;AACN;AACA;AACA;AACA;MACM,IAAIR,0BAA0B,EAAE;QAC9B,OAAO;UACLR,OAAO;UACPU,UAAU,EAAEU;QACd,CAAC;MACH;MAEA,IAAId,oBAAoB,EAAE;QACxB,OAAO;UACLN,OAAO;UACPU,UAAU,EAAEK;QACd,CAAC;MACH;MAEA,OAAO;QACLf,OAAO;QACPU,UAAU,EAAEW,eAAe,CAACN,cAAc,EAAEJ,cAAc;MAC5D,CAAC;IACH;EACF,CAAC,CAAC;AACJ,CAAC;AAAC;AAEF,SAASU,eAAe,CAACN,cAAgC,EAAEJ,cAAgC,EAAoB;EAC7G,MAAMW,8BAA8B,GAAGP,cAAc,CAACQ,MAAM,CAAEC,aAAa,IAAK;IAC9E,OAAO,CAACb,cAAc,CAACc,IAAI,CACxBC,aAAa,IAAKA,aAAa,CAAC5C,EAAE,CAAC6C,sBAAsB,EAAE,KAAKH,aAAa,CAAC1C,EAAE,CAAC6C,sBAAsB,EAAE,CAC3G;EACH,CAAC,CAAC;EACF,OAAOhB,cAAc,CAACiB,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.1008",
|
|
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.1008"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -31,54 +31,54 @@
|
|
|
31
31
|
"@teambit/design.ui.surfaces.menu.link-item": "1.0.0",
|
|
32
32
|
"@teambit/base-ui.surfaces.split-pane.hover-splitter": "1.0.0",
|
|
33
33
|
"@teambit/base-ui.surfaces.split-pane.split-pane": "1.0.0",
|
|
34
|
-
"@teambit/component": "0.0.
|
|
35
|
-
"@teambit/dependency-resolver": "0.0.
|
|
36
|
-
"@teambit/envs": "0.0.
|
|
34
|
+
"@teambit/component": "0.0.1008",
|
|
35
|
+
"@teambit/dependency-resolver": "0.0.1008",
|
|
36
|
+
"@teambit/envs": "0.0.1008",
|
|
37
37
|
"@teambit/legacy-bit-id": "0.0.423",
|
|
38
38
|
"@teambit/bit-error": "0.0.402",
|
|
39
39
|
"@teambit/component-id": "0.0.427",
|
|
40
|
-
"@teambit/lane-id": "0.0.
|
|
41
|
-
"@teambit/logger": "0.0.
|
|
42
|
-
"@teambit/scope": "0.0.
|
|
43
|
-
"@teambit/graph": "0.0.
|
|
44
|
-
"@teambit/cli": "0.0.
|
|
45
|
-
"@teambit/isolator": "0.0.
|
|
46
|
-
"@teambit/component-tree": "0.0.
|
|
40
|
+
"@teambit/lane-id": "0.0.194",
|
|
41
|
+
"@teambit/logger": "0.0.770",
|
|
42
|
+
"@teambit/scope": "0.0.1008",
|
|
43
|
+
"@teambit/graph": "0.0.1008",
|
|
44
|
+
"@teambit/cli": "0.0.677",
|
|
45
|
+
"@teambit/isolator": "0.0.1008",
|
|
46
|
+
"@teambit/component-tree": "0.0.796",
|
|
47
47
|
"@teambit/component.ui.component-status-resolver": "0.0.505",
|
|
48
48
|
"@teambit/harmony.modules.resolved-component": "0.0.491",
|
|
49
|
-
"@teambit/compiler": "0.0.
|
|
50
|
-
"@teambit/aspect-loader": "0.0.
|
|
51
|
-
"@teambit/config": "0.0.
|
|
49
|
+
"@teambit/compiler": "0.0.1008",
|
|
50
|
+
"@teambit/aspect-loader": "0.0.1008",
|
|
51
|
+
"@teambit/config": "0.0.690",
|
|
52
52
|
"@teambit/harmony.modules.requireable-component": "0.0.491",
|
|
53
53
|
"@teambit/toolbox.modules.module-resolver": "0.0.1",
|
|
54
|
-
"@teambit/workspace.modules.node-modules-linker": "0.0.
|
|
55
|
-
"@teambit/graphql": "0.0.
|
|
56
|
-
"@teambit/bundler": "0.0.
|
|
57
|
-
"@teambit/pubsub": "0.0.
|
|
58
|
-
"@teambit/ui": "0.0.
|
|
59
|
-
"@teambit/variants": "0.0.
|
|
54
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.21",
|
|
55
|
+
"@teambit/graphql": "0.0.1008",
|
|
56
|
+
"@teambit/bundler": "0.0.1008",
|
|
57
|
+
"@teambit/pubsub": "0.0.1008",
|
|
58
|
+
"@teambit/ui": "0.0.1008",
|
|
59
|
+
"@teambit/variants": "0.0.782",
|
|
60
60
|
"@teambit/component-issues": "0.0.88",
|
|
61
61
|
"@teambit/component-version": "0.0.408",
|
|
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.235",
|
|
64
64
|
"@teambit/design.ui.tree": "0.0.16",
|
|
65
|
-
"@teambit/lanes.hooks.use-lane-components": "0.0.
|
|
66
|
-
"@teambit/lanes.hooks.use-lanes": "0.0.
|
|
67
|
-
"@teambit/lanes.ui.models.lanes-model": "0.0.
|
|
68
|
-
"@teambit/ui-foundation.ui.side-bar": "0.0.
|
|
69
|
-
"@teambit/command-bar": "0.0.
|
|
70
|
-
"@teambit/component.ui.component-filters.component-filter-context": "0.0.
|
|
71
|
-
"@teambit/component.ui.component-filters.deprecate-filter": "0.0.
|
|
72
|
-
"@teambit/component.ui.component-filters.env-filter": "0.0.
|
|
73
|
-
"@teambit/component.ui.component-filters.show-main-filter": "0.0.
|
|
74
|
-
"@teambit/sidebar": "0.0.
|
|
65
|
+
"@teambit/lanes.hooks.use-lane-components": "0.0.139",
|
|
66
|
+
"@teambit/lanes.hooks.use-lanes": "0.0.140",
|
|
67
|
+
"@teambit/lanes.ui.models.lanes-model": "0.0.102",
|
|
68
|
+
"@teambit/ui-foundation.ui.side-bar": "0.0.752",
|
|
69
|
+
"@teambit/command-bar": "0.0.1008",
|
|
70
|
+
"@teambit/component.ui.component-filters.component-filter-context": "0.0.109",
|
|
71
|
+
"@teambit/component.ui.component-filters.deprecate-filter": "0.0.109",
|
|
72
|
+
"@teambit/component.ui.component-filters.env-filter": "0.0.115",
|
|
73
|
+
"@teambit/component.ui.component-filters.show-main-filter": "0.0.102",
|
|
74
|
+
"@teambit/sidebar": "0.0.1008",
|
|
75
75
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.497",
|
|
76
76
|
"@teambit/ui-foundation.ui.menu": "0.0.497",
|
|
77
77
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.501",
|
|
78
78
|
"@teambit/ui-foundation.ui.tree.drawer": "0.0.511",
|
|
79
79
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.500",
|
|
80
|
-
"@teambit/component-descriptor": "0.0.
|
|
81
|
-
"@teambit/deprecation": "0.0.
|
|
80
|
+
"@teambit/component-descriptor": "0.0.246",
|
|
81
|
+
"@teambit/deprecation": "0.0.1008",
|
|
82
82
|
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.498",
|
|
83
83
|
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.206",
|
|
84
84
|
"@teambit/ui-foundation.ui.corner": "0.0.508",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"react-router-dom": "^6.0.0",
|
|
108
108
|
"@apollo/client": "^3.6.0",
|
|
109
|
-
"@teambit/legacy": "1.0.
|
|
109
|
+
"@teambit/legacy": "1.0.456",
|
|
110
110
|
"react": "^16.8.0 || ^17.0.0",
|
|
111
111
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
112
112
|
},
|
package/workspace.ui.drawer.tsx
CHANGED
|
@@ -59,6 +59,7 @@ export const workspaceDrawer = ({
|
|
|
59
59
|
const viewedLaneId = lanesModel?.viewedLane?.id;
|
|
60
60
|
const defaultLane = lanesModel?.getDefaultLane();
|
|
61
61
|
const isViewingDefaultLane = viewedLaneId && defaultLane?.id.isEqual(viewedLaneId);
|
|
62
|
+
|
|
62
63
|
const isViewingWorkspaceVersions = lanesModel?.isViewingCurrentLane();
|
|
63
64
|
|
|
64
65
|
const { components: laneComponents = [], loading: laneCompsLoading } = useLaneComponents(
|
|
@@ -67,17 +68,34 @@ export const workspaceDrawer = ({
|
|
|
67
68
|
const { components: mainComponents = [], loading: mainCompsLoading } = useLaneComponents(
|
|
68
69
|
!isViewingDefaultLane ? defaultLane?.id : undefined
|
|
69
70
|
);
|
|
71
|
+
|
|
70
72
|
const workspace = useContext(WorkspaceContext);
|
|
71
73
|
const { components: workspaceComponents } = workspace;
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
const loading = lanesLoading || laneCompsLoading || mainCompsLoading;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* if viewing locally checked out lane, return all components from the workspace
|
|
79
|
+
* when viewing main when locally checked out to another lane, explicitly return components from the "main" lane
|
|
80
|
+
* when viewing another lane when locally checked out to a different lane, return "main" + "lane" components
|
|
81
|
+
* */
|
|
82
|
+
if (isViewingWorkspaceVersions) {
|
|
83
|
+
return {
|
|
84
|
+
loading,
|
|
85
|
+
components: workspaceComponents,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (isViewingDefaultLane) {
|
|
90
|
+
return {
|
|
91
|
+
loading,
|
|
92
|
+
components: mainComponents,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
77
95
|
|
|
78
96
|
return {
|
|
79
|
-
loading
|
|
80
|
-
components,
|
|
97
|
+
loading,
|
|
98
|
+
components: mergeComponents(mainComponents, laneComponents),
|
|
81
99
|
};
|
|
82
100
|
},
|
|
83
101
|
});
|
|
Binary file
|