@teambit/workspace 0.0.687 → 0.0.690
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/workspace.ui.drawer.js +37 -2
- package/dist/workspace.ui.drawer.js.map +1 -1
- package/package-tar/teambit-workspace-0.0.690.tgz +0 -0
- package/package.json +33 -31
- package/{preview-1648130327832.js → preview-1648265027481.js} +2 -2
- package/workspace.ui.drawer.tsx +19 -1
- package/package-tar/teambit-workspace-0.0.687.tgz +0 -0
package/dist/bit-map.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare class BitMap {
|
|
|
19
19
|
addComponentConfig(id: ComponentID, aspectId: string, config?: Record<string, any>): boolean;
|
|
20
20
|
removeComponentConfig(id: ComponentID, aspectId: string, markWithMinusIfNotExist: boolean): boolean;
|
|
21
21
|
removeEntireConfig(id: ComponentID): boolean;
|
|
22
|
+
setEntireConfig(id: ComponentID, config: Record<string, any>): void;
|
|
22
23
|
/**
|
|
23
24
|
* write .bitmap object to the filesystem
|
|
24
25
|
*/
|
package/dist/bit-map.js
CHANGED
|
@@ -94,6 +94,14 @@ class BitMap {
|
|
|
94
94
|
this.legacyBitMap.markAsChanged();
|
|
95
95
|
return true;
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
setEntireConfig(id, config) {
|
|
99
|
+
const bitMapEntry = this.getBitmapEntry(id, {
|
|
100
|
+
ignoreScopeAndVersion: true
|
|
101
|
+
});
|
|
102
|
+
bitMapEntry.config = config;
|
|
103
|
+
this.legacyBitMap.markAsChanged();
|
|
104
|
+
}
|
|
97
105
|
/**
|
|
98
106
|
* write .bitmap object to the filesystem
|
|
99
107
|
*/
|
package/dist/bit-map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["bit-map.ts"],"names":["BitMap","constructor","legacyBitMap","consumer","addComponentConfig","id","aspectId","config","Error","bitMapEntry","getBitmapEntry","ignoreScopeAndVersion","currentConfig","markAsChanged","removeComponentConfig","markWithMinusIfNotExist","REMOVE_EXTENSION_SPECIAL_SIGN","removeEntireConfig","write","writeBitMap","ignoreVersion","getComponent","_legacy","renameNewComponent","sourceId","targetId","hasVersion","toString","removeComponent","setComponent"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AACA;AACA;AACA;AACO,MAAMA,MAAN,CAAa;AAClBC,EAAAA,WAAW,CAASC,YAAT,EAA6CC,QAA7C,EAAiE;AAAA,SAAxDD,YAAwD,GAAxDA,YAAwD;AAAA,SAApBC,QAAoB,GAApBA,QAAoB;AAAE;AAE9E;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,kBAAkB,CAACC,EAAD,EAAkBC,QAAlB,EAAoCC,MAA2B,GAAG,EAAlE,EAA+E;AAC/F,QAAI,CAACD,QAAD,IAAa,OAAOA,QAAP,KAAoB,QAArC,EAA+C,MAAM,IAAIE,KAAJ,CAAW,qCAAoCF,QAAS,EAAxD,CAAN;AAC/C,UAAMG,WAAW,GAAG,KAAKC,cAAL,CAAoBL,EAApB,EAAwB;AAAEM,MAAAA,qBAAqB,EAAE;AAAzB,KAAxB,CAApB;AACA,UAAMC,aAAa,GAAG,CAACH,WAAW,CAACF,MAAb,KAACE,WAAW,CAACF,MAAb,GAAwB,EAAxB,GAA4BD,QAA5B,CAAtB;;AACA,QAAI,uBAAQM,aAAR,EAAuBL,MAAvB,CAAJ,EAAoC;AAClC,aAAO,KAAP,CADkC,CACpB;AACf;;AACD,QAAI,CAACA,MAAL,EAAa;AACX,aAAOE,WAAW,CAACF,MAAZ,CAAmBD,QAAnB,CAAP;AACD,KAFD,MAEO;AACLG,MAAAA,WAAW,CAACF,MAAZ,CAAmBD,QAAnB,IAA+BC,MAA/B;AACD;;AACD,SAAKL,YAAL,CAAkBW,aAAlB;AAEA,WAAO,IAAP,CAd+F,CAclF;AACd;;AAEDC,EAAAA,qBAAqB,CAACT,EAAD,EAAkBC,QAAlB,EAAoCS,uBAApC,EAA+E;AAClG,QAAI,CAACT,QAAD,IAAa,OAAOA,QAAP,KAAoB,QAArC,EAA+C,MAAM,IAAIE,KAAJ,CAAW,qCAAoCF,QAAS,EAAxD,CAAN;AAC/C,UAAMG,WAAW,GAAG,KAAKC,cAAL,CAAoBL,EAApB,EAAwB;AAAEM,MAAAA,qBAAqB,EAAE;AAAzB,KAAxB,CAApB;AACA,UAAMC,aAAa,GAAG,CAACH,WAAW,CAACF,MAAb,KAACE,WAAW,CAACF,MAAb,GAAwB,EAAxB,GAA4BD,QAA5B,CAAtB;;AACA,QAAIM,aAAJ,EAAmB;AACjB,aAAOH,WAAW,CAACF,MAAZ,CAAmBD,QAAnB,CAAP;AACD,KAFD,MAEO;AACL,UAAI,CAACS,uBAAL,EAA8B;AAC5B,eAAO,KAAP,CAD4B,CACd;AACf;;AACDN,MAAAA,WAAW,CAACF,MAAZ,CAAmBD,QAAnB,IAA+BU,uCAA/B;AACD;;AAED,SAAKd,YAAL,CAAkBW,aAAlB;AAEA,WAAO,IAAP,CAfkG,CAerF;AACd;;AAEDI,EAAAA,kBAAkB,CAACZ,EAAD,EAA2B;AAC3C,UAAMI,WAAW,GAAG,KAAKC,cAAL,CAAoBL,EAApB,EAAwB;AAAEM,MAAAA,qBAAqB,EAAE;AAAzB,KAAxB,CAApB;AACA,QAAI,CAACF,WAAW,CAACF,MAAjB,EAAyB,OAAO,KAAP;AACzB,WAAOE,WAAW,CAACF,MAAnB;AACA,SAAKL,YAAL,CAAkBW,aAAlB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;;;AACa,
|
|
1
|
+
{"version":3,"sources":["bit-map.ts"],"names":["BitMap","constructor","legacyBitMap","consumer","addComponentConfig","id","aspectId","config","Error","bitMapEntry","getBitmapEntry","ignoreScopeAndVersion","currentConfig","markAsChanged","removeComponentConfig","markWithMinusIfNotExist","REMOVE_EXTENSION_SPECIAL_SIGN","removeEntireConfig","setEntireConfig","write","writeBitMap","ignoreVersion","getComponent","_legacy","renameNewComponent","sourceId","targetId","hasVersion","toString","removeComponent","setComponent"],"mappings":"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","sourcesContent":["import { isEqual } from 'lodash';\nimport { ComponentID } from '@teambit/component-id';\nimport LegacyBitMap from '@teambit/legacy/dist/consumer/bit-map';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { GetBitMapComponentOptions } from '@teambit/legacy/dist/consumer/bit-map/bit-map';\nimport ComponentMap from '@teambit/legacy/dist/consumer/bit-map/component-map';\nimport { REMOVE_EXTENSION_SPECIAL_SIGN } from '@teambit/legacy/dist/consumer/config';\n/**\n * consider extracting to a new component.\n * (pro: making Workspace aspect smaller. con: it's an implementation details of the workspace)\n */\nexport class BitMap {\n constructor(private legacyBitMap: LegacyBitMap, private consumer: Consumer) {}\n\n /**\n * adds component config to the .bitmap file.\n * later, upon `bit tag`, the data is saved in the scope.\n * returns a boolean indicating whether a change has been made.\n */\n addComponentConfig(id: ComponentID, aspectId: string, config: Record<string, any> = {}): boolean {\n if (!aspectId || typeof aspectId !== 'string') throw new Error(`expect aspectId to be string, got ${aspectId}`);\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n const currentConfig = (bitMapEntry.config ||= {})[aspectId];\n if (isEqual(currentConfig, config)) {\n return false; // no changes\n }\n if (!config) {\n delete bitMapEntry.config[aspectId];\n } else {\n bitMapEntry.config[aspectId] = config;\n }\n this.legacyBitMap.markAsChanged();\n\n return true; // changes have been made\n }\n\n removeComponentConfig(id: ComponentID, aspectId: string, markWithMinusIfNotExist: boolean): boolean {\n if (!aspectId || typeof aspectId !== 'string') throw new Error(`expect aspectId to be string, got ${aspectId}`);\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n const currentConfig = (bitMapEntry.config ||= {})[aspectId];\n if (currentConfig) {\n delete bitMapEntry.config[aspectId];\n } else {\n if (!markWithMinusIfNotExist) {\n return false; // no changes\n }\n bitMapEntry.config[aspectId] = REMOVE_EXTENSION_SPECIAL_SIGN;\n }\n\n this.legacyBitMap.markAsChanged();\n\n return true; // changes have been made\n }\n\n removeEntireConfig(id: ComponentID): boolean {\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n if (!bitMapEntry.config) return false;\n delete bitMapEntry.config;\n this.legacyBitMap.markAsChanged();\n return true;\n }\n\n setEntireConfig(id: ComponentID, config: Record<string, any>) {\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n bitMapEntry.config = config;\n this.legacyBitMap.markAsChanged();\n }\n\n /**\n * write .bitmap object to the filesystem\n */\n async write() {\n await this.consumer.writeBitMap();\n }\n\n /**\n * get the data saved in the .bitmap file for this component-id.\n */\n getBitmapEntry(\n id: ComponentID,\n { ignoreVersion, ignoreScopeAndVersion }: GetBitMapComponentOptions = {}\n ): ComponentMap {\n return this.legacyBitMap.getComponent(id._legacy, { ignoreVersion, ignoreScopeAndVersion });\n }\n\n /**\n * components that were not tagged yet are safe to rename them from the .bitmap file.\n */\n renameNewComponent(sourceId: ComponentID, targetId: ComponentID) {\n const bitMapEntry = this.getBitmapEntry(sourceId);\n if (bitMapEntry.id.hasVersion()) {\n throw new Error(`unable to rename tagged or exported component: ${bitMapEntry.id.toString()}`);\n }\n this.legacyBitMap.removeComponent(bitMapEntry.id);\n bitMapEntry.id = targetId._legacy;\n this.legacyBitMap.setComponent(bitMapEntry.id, bitMapEntry);\n }\n}\n"]}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.workspaceDrawer = void 0;
|
|
7
9
|
|
|
10
|
+
function _extends2() {
|
|
11
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
|
|
13
|
+
_extends2 = function () {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
function _react() {
|
|
9
|
-
const data = require("react");
|
|
21
|
+
const data = _interopRequireWildcard(require("react"));
|
|
10
22
|
|
|
11
23
|
_react = function () {
|
|
12
24
|
return data;
|
|
@@ -25,6 +37,16 @@ function _componentUi() {
|
|
|
25
37
|
return data;
|
|
26
38
|
}
|
|
27
39
|
|
|
40
|
+
function _uiFoundationUi() {
|
|
41
|
+
const data = require("@teambit/ui-foundation.ui.side-bar");
|
|
42
|
+
|
|
43
|
+
_uiFoundationUi = function () {
|
|
44
|
+
return data;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
|
|
28
50
|
function _workspaceContext() {
|
|
29
51
|
const data = require("./ui/workspace/workspace-context");
|
|
30
52
|
|
|
@@ -35,6 +57,10 @@ function _workspaceContext() {
|
|
|
35
57
|
return data;
|
|
36
58
|
}
|
|
37
59
|
|
|
60
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
61
|
+
|
|
62
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
63
|
+
|
|
38
64
|
const workspaceDrawer = ({
|
|
39
65
|
treeWidgets,
|
|
40
66
|
filtersSlot,
|
|
@@ -45,7 +71,16 @@ const workspaceDrawer = ({
|
|
|
45
71
|
name: 'COMPONENTS',
|
|
46
72
|
plugins: {
|
|
47
73
|
tree: {
|
|
48
|
-
widgets: treeWidgets
|
|
74
|
+
widgets: treeWidgets,
|
|
75
|
+
customRenderer: treeNodeSlot => function TreeNode(props) {
|
|
76
|
+
const children = props.node.children;
|
|
77
|
+
if (!children) return /*#__PURE__*/_react().default.createElement(_uiFoundationUi().ComponentView, (0, _extends2().default)({}, props, {
|
|
78
|
+
treeNodeSlot: treeNodeSlot
|
|
79
|
+
})); // non collapse
|
|
80
|
+
|
|
81
|
+
if (props.node.payload instanceof _uiFoundationUi().ScopePayload) return /*#__PURE__*/_react().default.createElement(_uiFoundationUi().ScopeTreeNode, props);
|
|
82
|
+
return /*#__PURE__*/_react().default.createElement(_uiFoundationUi().NamespaceTreeNode, props);
|
|
83
|
+
}
|
|
49
84
|
},
|
|
50
85
|
filters: filtersSlot,
|
|
51
86
|
drawerWidgets: drawerWidgetSlot
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["workspace.ui.drawer.tsx"],"names":["workspaceDrawer","treeWidgets","filtersSlot","drawerWidgetSlot","ComponentsDrawer","order","id","name","plugins","tree","widgets","filters","drawerWidgets","emptyMessage","useComponents","workspace","WorkspaceContext","loading","components"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["workspace.ui.drawer.tsx"],"names":["workspaceDrawer","treeWidgets","filtersSlot","drawerWidgetSlot","ComponentsDrawer","order","id","name","plugins","tree","widgets","customRenderer","treeNodeSlot","TreeNode","props","children","node","payload","ScopePayload","filters","drawerWidgets","emptyMessage","useComponents","workspace","WorkspaceContext","loading","components"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAQA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AASO,MAAMA,eAAe,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,WAAf;AAA4BC,EAAAA;AAA5B,CAAD,KAC7B,KAAIC,+BAAJ,EAAqB;AACnBC,EAAAA,KAAK,EAAE,CADY;AAEnBC,EAAAA,EAAE,EAAE,6BAFe;AAGnBC,EAAAA,IAAI,EAAE,YAHa;AAInBC,EAAAA,OAAO,EAAE;AACPC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAET,WADL;AAEJU,MAAAA,cAAc,EAAGC,YAAD,IACd,SAASC,QAAT,CAAkBC,KAAlB,EAAqD;AACnD,cAAMC,QAAQ,GAAGD,KAAK,CAACE,IAAN,CAAWD,QAA5B;AAEA,YAAI,CAACA,QAAL,EAAe,oBAAO,+BAAC,+BAAD,+BAAmBD,KAAnB;AAA0B,UAAA,YAAY,EAAEF;AAAxC,WAAP,CAHoC,CAG6B;;AAEhF,YAAIE,KAAK,CAACE,IAAN,CAAWC,OAAX,YAA8BC,8BAAlC,EAAgD,oBAAO,+BAAC,+BAAD,EAAmBJ,KAAnB,CAAP;AAEhD,4BAAO,+BAAC,mCAAD,EAAuBA,KAAvB,CAAP;AACD;AAXC,KADC;AAcPK,IAAAA,OAAO,EAAEjB,WAdF;AAePkB,IAAAA,aAAa,EAAEjB;AAfR,GAJU;AAqBnBkB,EAAAA,YAAY,EAAE,oBArBK;AAsBnBC,EAAAA,aAAa,EAAE,MAAM;AACnB,UAAMC,SAAS,GAAG,yBAAWC,oCAAX,CAAlB;AACA,WAAO;AACLC,MAAAA,OAAO,EAAE,CAACF,SADL;AAELG,MAAAA,UAAU,EAAEH,SAAS,CAACG,UAAV,IAAwB;AAF/B,KAAP;AAID;AA5BkB,CAArB,CADK","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 { TreeNodeProps } from '@teambit/design.ui.tree';\nimport { WorkspaceContext } from './ui/workspace/workspace-context';\nimport { SidebarWidgetSlot } from './workspace.ui.runtime';\n\nexport type WorkspaceDrawerProps = {\n treeWidgets: SidebarWidgetSlot;\n filtersSlot: ComponentFiltersSlot;\n drawerWidgetSlot: DrawerWidgetSlot;\n};\n\nexport const workspaceDrawer = ({ treeWidgets, filtersSlot, drawerWidgetSlot }: WorkspaceDrawerProps) =>\n 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} />; // 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 useComponents: () => {\n const workspace = useContext(WorkspaceContext);\n return {\n loading: !workspace,\n components: workspace.components || [],\n };\n },\n });\n"]}
|
|
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.690",
|
|
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.690"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -39,45 +39,47 @@
|
|
|
39
39
|
"@teambit/component-id": "0.0.402",
|
|
40
40
|
"@teambit/bit-error": "0.0.394",
|
|
41
41
|
"@teambit/legacy-bit-id": "0.0.399",
|
|
42
|
-
"@teambit/logger": "0.0.
|
|
43
|
-
"@teambit/scope": "0.0.
|
|
44
|
-
"@teambit/cli": "0.0.
|
|
45
|
-
"@teambit/isolator": "0.0.
|
|
46
|
-
"@teambit/component-tree": "0.0.
|
|
42
|
+
"@teambit/logger": "0.0.554",
|
|
43
|
+
"@teambit/scope": "0.0.690",
|
|
44
|
+
"@teambit/cli": "0.0.462",
|
|
45
|
+
"@teambit/isolator": "0.0.690",
|
|
46
|
+
"@teambit/component-tree": "0.0.478",
|
|
47
47
|
"@teambit/component.ui.component-status-resolver": "0.0.492",
|
|
48
|
-
"@teambit/lanes.ui.lanes": "0.0.
|
|
48
|
+
"@teambit/lanes.ui.lanes": "0.0.26",
|
|
49
49
|
"@teambit/harmony.modules.resolved-component": "0.0.484",
|
|
50
|
-
"@teambit/dependency-resolver": "0.0.
|
|
51
|
-
"@teambit/compiler": "0.0.
|
|
52
|
-
"@teambit/component": "0.0.
|
|
53
|
-
"@teambit/graphql": "0.0.
|
|
54
|
-
"@teambit/aspect-loader": "0.0.
|
|
55
|
-
"@teambit/bundler": "0.0.
|
|
56
|
-
"@teambit/community": "0.0.
|
|
57
|
-
"@teambit/envs": "0.0.
|
|
58
|
-
"@teambit/pubsub": "0.0.
|
|
59
|
-
"@teambit/ui": "0.0.
|
|
60
|
-
"@teambit/variants": "0.0.
|
|
50
|
+
"@teambit/dependency-resolver": "0.0.690",
|
|
51
|
+
"@teambit/compiler": "0.0.690",
|
|
52
|
+
"@teambit/component": "0.0.690",
|
|
53
|
+
"@teambit/graphql": "0.0.690",
|
|
54
|
+
"@teambit/aspect-loader": "0.0.690",
|
|
55
|
+
"@teambit/bundler": "0.0.690",
|
|
56
|
+
"@teambit/community": "0.0.10",
|
|
57
|
+
"@teambit/envs": "0.0.690",
|
|
58
|
+
"@teambit/pubsub": "0.0.690",
|
|
59
|
+
"@teambit/ui": "0.0.690",
|
|
60
|
+
"@teambit/variants": "0.0.558",
|
|
61
61
|
"@teambit/component-issues": "0.0.48",
|
|
62
|
-
"@teambit/config": "0.0.
|
|
62
|
+
"@teambit/config": "0.0.475",
|
|
63
63
|
"@teambit/harmony.modules.requireable-component": "0.0.484",
|
|
64
|
-
"@teambit/importer": "0.0.
|
|
64
|
+
"@teambit/importer": "0.0.119",
|
|
65
65
|
"@teambit/workspace.modules.match-pattern": "0.0.489",
|
|
66
|
-
"@teambit/component.ui.component-drawer": "0.0.
|
|
67
|
-
"@teambit/
|
|
66
|
+
"@teambit/component.ui.component-drawer": "0.0.4",
|
|
67
|
+
"@teambit/design.ui.tree": "0.0.5",
|
|
68
|
+
"@teambit/ui-foundation.ui.side-bar": "0.0.523",
|
|
69
|
+
"@teambit/command-bar": "0.0.690",
|
|
68
70
|
"@teambit/component.ui.component-filters": "0.0.1",
|
|
69
71
|
"@teambit/design.ui.surfaces.menu.link-item": "0.0.379",
|
|
70
|
-
"@teambit/graph": "0.0.
|
|
71
|
-
"@teambit/react-router": "0.0.
|
|
72
|
-
"@teambit/sidebar": "0.0.
|
|
72
|
+
"@teambit/graph": "0.0.690",
|
|
73
|
+
"@teambit/react-router": "0.0.690",
|
|
74
|
+
"@teambit/sidebar": "0.0.690",
|
|
73
75
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.486",
|
|
74
76
|
"@teambit/ui-foundation.ui.menu": "0.0.486",
|
|
75
77
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.488",
|
|
76
|
-
"@teambit/ui-foundation.ui.tree.drawer": "0.0.
|
|
78
|
+
"@teambit/ui-foundation.ui.tree.drawer": "0.0.498",
|
|
77
79
|
"@teambit/toolbox.time.time-format": "0.0.483",
|
|
78
80
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.487",
|
|
79
|
-
"@teambit/component-descriptor": "0.0.
|
|
80
|
-
"@teambit/deprecation": "0.0.
|
|
81
|
+
"@teambit/component-descriptor": "0.0.27",
|
|
82
|
+
"@teambit/deprecation": "0.0.690",
|
|
81
83
|
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.487",
|
|
82
84
|
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.194",
|
|
83
85
|
"@teambit/ui-foundation.ui.corner": "0.0.494",
|
|
@@ -104,7 +106,7 @@
|
|
|
104
106
|
},
|
|
105
107
|
"peerDependencies": {
|
|
106
108
|
"@apollo/client": "^3.0.0",
|
|
107
|
-
"@teambit/legacy": "1.0.
|
|
109
|
+
"@teambit/legacy": "1.0.241",
|
|
108
110
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
109
111
|
"react": "^16.8.0 || ^17.0.0"
|
|
110
112
|
},
|
|
@@ -132,7 +134,7 @@
|
|
|
132
134
|
"react": "-"
|
|
133
135
|
},
|
|
134
136
|
"peerDependencies": {
|
|
135
|
-
"@teambit/legacy": "1.0.
|
|
137
|
+
"@teambit/legacy": "1.0.241",
|
|
136
138
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
137
139
|
"react": "^16.8.0 || ^17.0.0"
|
|
138
140
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.690/dist/workspace.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.690/dist/workspace.docs.mdx')]
|
package/workspace.ui.drawer.tsx
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
2
|
import { ComponentsDrawer, ComponentFiltersSlot, DrawerWidgetSlot } from '@teambit/component.ui.component-drawer';
|
|
3
|
+
import {
|
|
4
|
+
ComponentView,
|
|
5
|
+
NamespaceTreeNode,
|
|
6
|
+
PayloadType,
|
|
7
|
+
ScopePayload,
|
|
8
|
+
ScopeTreeNode,
|
|
9
|
+
} from '@teambit/ui-foundation.ui.side-bar';
|
|
10
|
+
import { TreeNodeProps } from '@teambit/design.ui.tree';
|
|
3
11
|
import { WorkspaceContext } from './ui/workspace/workspace-context';
|
|
4
12
|
import { SidebarWidgetSlot } from './workspace.ui.runtime';
|
|
5
13
|
|
|
@@ -17,6 +25,16 @@ export const workspaceDrawer = ({ treeWidgets, filtersSlot, drawerWidgetSlot }:
|
|
|
17
25
|
plugins: {
|
|
18
26
|
tree: {
|
|
19
27
|
widgets: treeWidgets,
|
|
28
|
+
customRenderer: (treeNodeSlot) =>
|
|
29
|
+
function TreeNode(props: TreeNodeProps<PayloadType>) {
|
|
30
|
+
const children = props.node.children;
|
|
31
|
+
|
|
32
|
+
if (!children) return <ComponentView {...props} treeNodeSlot={treeNodeSlot} />; // non collapse
|
|
33
|
+
|
|
34
|
+
if (props.node.payload instanceof ScopePayload) return <ScopeTreeNode {...props} />;
|
|
35
|
+
|
|
36
|
+
return <NamespaceTreeNode {...props} />;
|
|
37
|
+
},
|
|
20
38
|
},
|
|
21
39
|
filters: filtersSlot,
|
|
22
40
|
drawerWidgets: drawerWidgetSlot,
|
|
Binary file
|