@teambit/sidebar 0.0.881 → 0.0.882
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/index.js +0 -8
- package/dist/index.js.map +1 -1
- package/dist/sidebar.aspect.js +0 -5
- package/dist/sidebar.aspect.js.map +1 -1
- package/dist/sidebar.composition.js +0 -6
- package/dist/sidebar.composition.js.map +1 -1
- package/dist/sidebar.ui.runtime.js +2 -31
- package/dist/sidebar.ui.runtime.js.map +1 -1
- package/dist/ui/index.js +0 -3
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/side-bar/index.js +0 -3
- package/dist/ui/side-bar/index.js.map +1 -1
- package/dist/ui/side-bar/side-bar.js +7 -43
- package/dist/ui/side-bar/side-bar.js.map +1 -1
- package/package-tar/teambit-sidebar-0.0.882.tgz +0 -0
- package/package.json +4 -4
- package/{preview-1666409808293.js → preview-1666496165706.js} +2 -2
- package/package-tar/teambit-sidebar-0.0.881.tgz +0 -0
package/dist/index.js
CHANGED
|
@@ -28,29 +28,21 @@ Object.defineProperty(exports, "SidebarUI", {
|
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
exports.default = void 0;
|
|
31
|
-
|
|
32
31
|
function _sidebar() {
|
|
33
32
|
const data = require("./sidebar.aspect");
|
|
34
|
-
|
|
35
33
|
_sidebar = function () {
|
|
36
34
|
return data;
|
|
37
35
|
};
|
|
38
|
-
|
|
39
36
|
return data;
|
|
40
37
|
}
|
|
41
|
-
|
|
42
38
|
function _sidebarUi() {
|
|
43
39
|
const data = require("./sidebar.ui.runtime");
|
|
44
|
-
|
|
45
40
|
_sidebarUi = function () {
|
|
46
41
|
return data;
|
|
47
42
|
};
|
|
48
|
-
|
|
49
43
|
return data;
|
|
50
44
|
}
|
|
51
|
-
|
|
52
45
|
var _default = _sidebar().SidebarAspect;
|
|
53
|
-
|
|
54
46
|
exports.default = _default;
|
|
55
47
|
|
|
56
48
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SidebarAspect"],"sources":["index.ts"],"sourcesContent":["import { SidebarAspect } from './sidebar.aspect';\n\nexport { SidebarUI, SidebarItemSlot, SidebarItem } from './sidebar.ui.runtime';\nexport { SidebarAspect };\nexport default SidebarAspect;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["SidebarAspect"],"sources":["index.ts"],"sourcesContent":["import { SidebarAspect } from './sidebar.aspect';\n\nexport { SidebarUI, SidebarItemSlot, SidebarItem } from './sidebar.ui.runtime';\nexport { SidebarAspect };\nexport default SidebarAspect;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA+E,eAEhEA,wBAAa;AAAA"}
|
package/dist/sidebar.aspect.js
CHANGED
|
@@ -4,21 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SidebarAspect = void 0;
|
|
7
|
-
|
|
8
7
|
function _harmony() {
|
|
9
8
|
const data = require("@teambit/harmony");
|
|
10
|
-
|
|
11
9
|
_harmony = function () {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
const SidebarAspect = _harmony().Aspect.create({
|
|
19
15
|
id: 'teambit.ui-foundation/sidebar'
|
|
20
16
|
});
|
|
21
|
-
|
|
22
17
|
exports.SidebarAspect = SidebarAspect;
|
|
23
18
|
|
|
24
19
|
//# sourceMappingURL=sidebar.aspect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SidebarAspect","Aspect","create","id"],"sources":["sidebar.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const SidebarAspect = Aspect.create({\n id: 'teambit.ui-foundation/sidebar',\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["SidebarAspect","Aspect","create","id"],"sources":["sidebar.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const SidebarAspect = Aspect.create({\n id: 'teambit.ui-foundation/sidebar',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,aAAa,GAAGC,iBAAM,CAACC,MAAM,CAAC;EACzCC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.Logo = void 0;
|
|
9
|
-
|
|
10
8
|
function _react() {
|
|
11
9
|
const data = _interopRequireDefault(require("react"));
|
|
12
|
-
|
|
13
10
|
_react = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
|
21
16
|
style: {
|
|
22
17
|
height: '100%',
|
|
@@ -29,7 +24,6 @@ const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
|
|
29
24
|
},
|
|
30
25
|
src: "https://static.bit.dev/extensions-icons/sidebar.svg"
|
|
31
26
|
}));
|
|
32
|
-
|
|
33
27
|
exports.Logo = Logo;
|
|
34
28
|
|
|
35
29
|
//# sourceMappingURL=sidebar.composition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["sidebar.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/sidebar.svg\" />\n </div>\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["sidebar.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/sidebar.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAG,CAAE;EAAC,GAAG,EAAC;AAAqD,EAAG,CAE1F;AAAC"}
|
|
@@ -1,86 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.iterator.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.promise.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.SidebarUI = void 0;
|
|
13
|
-
|
|
14
10
|
function _extends2() {
|
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
|
-
|
|
17
12
|
_extends2 = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _defineProperty2() {
|
|
25
18
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
26
|
-
|
|
27
19
|
_defineProperty2 = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function _harmony() {
|
|
35
25
|
const data = require("@teambit/harmony");
|
|
36
|
-
|
|
37
26
|
_harmony = function () {
|
|
38
27
|
return data;
|
|
39
28
|
};
|
|
40
|
-
|
|
41
29
|
return data;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
function _ui() {
|
|
45
32
|
const data = require("@teambit/ui");
|
|
46
|
-
|
|
47
33
|
_ui = function () {
|
|
48
34
|
return data;
|
|
49
35
|
};
|
|
50
|
-
|
|
51
36
|
return data;
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
function _react() {
|
|
55
39
|
const data = _interopRequireDefault(require("react"));
|
|
56
|
-
|
|
57
40
|
_react = function () {
|
|
58
41
|
return data;
|
|
59
42
|
};
|
|
60
|
-
|
|
61
43
|
return data;
|
|
62
44
|
}
|
|
63
|
-
|
|
64
45
|
function _sidebar() {
|
|
65
46
|
const data = require("./sidebar.aspect");
|
|
66
|
-
|
|
67
47
|
_sidebar = function () {
|
|
68
48
|
return data;
|
|
69
49
|
};
|
|
70
|
-
|
|
71
50
|
return data;
|
|
72
51
|
}
|
|
73
|
-
|
|
74
52
|
function _ui2() {
|
|
75
53
|
const data = require("./ui");
|
|
76
|
-
|
|
77
54
|
_ui2 = function () {
|
|
78
55
|
return data;
|
|
79
56
|
};
|
|
80
|
-
|
|
81
57
|
return data;
|
|
82
58
|
}
|
|
83
|
-
|
|
84
59
|
class SidebarUI {
|
|
85
60
|
constructor(drawerSlot) {
|
|
86
61
|
this.drawerSlot = drawerSlot;
|
|
@@ -90,31 +65,27 @@ class SidebarUI {
|
|
|
90
65
|
}, props));
|
|
91
66
|
});
|
|
92
67
|
}
|
|
68
|
+
|
|
93
69
|
/**
|
|
94
70
|
* register a new drawer into the component sidebar.
|
|
95
71
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
72
|
registerDrawer(...drawer) {
|
|
99
73
|
this.drawerSlot.register(drawer);
|
|
100
74
|
return this;
|
|
101
75
|
}
|
|
76
|
+
|
|
102
77
|
/**
|
|
103
78
|
* render the sidebar.
|
|
104
79
|
*/
|
|
105
80
|
|
|
106
|
-
|
|
107
81
|
static async provider(deps, config, [drawerSlot]) {
|
|
108
82
|
return new SidebarUI(drawerSlot);
|
|
109
83
|
}
|
|
110
|
-
|
|
111
84
|
}
|
|
112
|
-
|
|
113
85
|
exports.SidebarUI = SidebarUI;
|
|
114
86
|
(0, _defineProperty2().default)(SidebarUI, "runtime", _ui().UIRuntime);
|
|
115
87
|
(0, _defineProperty2().default)(SidebarUI, "slots", [_harmony().Slot.withType()]);
|
|
116
88
|
(0, _defineProperty2().default)(SidebarUI, "dependencies", []);
|
|
117
|
-
|
|
118
89
|
_sidebar().SidebarAspect.addRuntime(SidebarUI);
|
|
119
90
|
|
|
120
91
|
//# sourceMappingURL=sidebar.ui.runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SidebarUI","constructor","drawerSlot","props","registerDrawer","drawer","register","provider","deps","config","UIRuntime","Slot","withType","SidebarAspect","addRuntime"],"sources":["sidebar.ui.runtime.tsx"],"sourcesContent":["import { ComponentModel } from '@teambit/component';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { UIRuntime } from '@teambit/ui';\nimport React, { ComponentType } from 'react';\n\nimport type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';\nimport { SidebarAspect } from './sidebar.aspect';\nimport { SideBar, SideBarProps } from './ui';\n\nexport type ComponentTypeProps = {\n component: ComponentModel;\n};\n\nexport type SidebarItem = {\n weight?: number;\n component?: ComponentType;\n};\n\nexport type SidebarItemSlot = SlotRegistry<SidebarItem[]>;\n\nexport type DrawerSlot = SlotRegistry<DrawerType[]>;\n\nexport class SidebarUI {\n constructor(private drawerSlot: DrawerSlot) {}\n\n /**\n * register a new drawer into the component sidebar.\n */\n registerDrawer(...drawer: DrawerType[]) {\n this.drawerSlot.register(drawer);\n return this;\n }\n\n /**\n * render the sidebar.\n */\n render = (props: Partial<SideBarProps>) => {\n return <SideBar drawerSlot={this.drawerSlot} {...props}></SideBar>;\n };\n\n static runtime = UIRuntime;\n\n static slots = [Slot.withType<DrawerType>()];\n\n static dependencies = [];\n\n static async provider(deps, config, [drawerSlot]: [DrawerSlot]) {\n return new SidebarUI(drawerSlot);\n }\n}\n\nSidebarAspect.addRuntime(SidebarUI);\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["SidebarUI","constructor","drawerSlot","props","registerDrawer","drawer","register","provider","deps","config","UIRuntime","Slot","withType","SidebarAspect","addRuntime"],"sources":["sidebar.ui.runtime.tsx"],"sourcesContent":["import { ComponentModel } from '@teambit/component';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { UIRuntime } from '@teambit/ui';\nimport React, { ComponentType } from 'react';\n\nimport type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';\nimport { SidebarAspect } from './sidebar.aspect';\nimport { SideBar, SideBarProps } from './ui';\n\nexport type ComponentTypeProps = {\n component: ComponentModel;\n};\n\nexport type SidebarItem = {\n weight?: number;\n component?: ComponentType;\n};\n\nexport type SidebarItemSlot = SlotRegistry<SidebarItem[]>;\n\nexport type DrawerSlot = SlotRegistry<DrawerType[]>;\n\nexport class SidebarUI {\n constructor(private drawerSlot: DrawerSlot) {}\n\n /**\n * register a new drawer into the component sidebar.\n */\n registerDrawer(...drawer: DrawerType[]) {\n this.drawerSlot.register(drawer);\n return this;\n }\n\n /**\n * render the sidebar.\n */\n render = (props: Partial<SideBarProps>) => {\n return <SideBar drawerSlot={this.drawerSlot} {...props}></SideBar>;\n };\n\n static runtime = UIRuntime;\n\n static slots = [Slot.withType<DrawerType>()];\n\n static dependencies = [];\n\n static async provider(deps, config, [drawerSlot]: [DrawerSlot]) {\n return new SidebarUI(drawerSlot);\n }\n}\n\nSidebarAspect.addRuntime(SidebarUI);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAeO,MAAMA,SAAS,CAAC;EACrBC,WAAW,CAASC,UAAsB,EAAE;IAAA,KAAxBA,UAAsB,GAAtBA,UAAsB;IAAA,gDAahCC,KAA4B,IAAK;MACzC,oBAAO,+BAAC,cAAO;QAAC,UAAU,EAAE,IAAI,CAACD;MAAW,GAAKC,KAAK,EAAY;IACpE,CAAC;EAf4C;;EAE7C;AACF;AACA;EACEC,cAAc,CAAC,GAAGC,MAAoB,EAAE;IACtC,IAAI,CAACH,UAAU,CAACI,QAAQ,CAACD,MAAM,CAAC;IAChC,OAAO,IAAI;EACb;;EAEA;AACF;AACA;;EAWE,aAAaE,QAAQ,CAACC,IAAI,EAAEC,MAAM,EAAE,CAACP,UAAU,CAAe,EAAE;IAC9D,OAAO,IAAIF,SAAS,CAACE,UAAU,CAAC;EAClC;AACF;AAAC;AAAA,gCA3BYF,SAAS,aAkBHU,eAAS;AAAA,gCAlBfV,SAAS,WAoBL,CAACW,eAAI,CAACC,QAAQ,EAAc,CAAC;AAAA,gCApBjCZ,SAAS,kBAsBE,EAAE;AAO1Ba,wBAAa,CAACC,UAAU,CAACd,SAAS,CAAC"}
|
package/dist/ui/index.js
CHANGED
|
@@ -15,14 +15,11 @@ Object.defineProperty(exports, "SideBarProps", {
|
|
|
15
15
|
return _sideBar().SideBarProps;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
|
|
19
18
|
function _sideBar() {
|
|
20
19
|
const data = require("./side-bar");
|
|
21
|
-
|
|
22
20
|
_sideBar = function () {
|
|
23
21
|
return data;
|
|
24
22
|
};
|
|
25
|
-
|
|
26
23
|
return data;
|
|
27
24
|
}
|
|
28
25
|
|
package/dist/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { SideBar, SideBarProps } from './side-bar';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { SideBar, SideBarProps } from './side-bar';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
|
|
@@ -15,14 +15,11 @@ Object.defineProperty(exports, "SideBarProps", {
|
|
|
15
15
|
return _sideBar().SideBarProps;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
|
|
19
18
|
function _sideBar() {
|
|
20
19
|
const data = require("./side-bar");
|
|
21
|
-
|
|
22
20
|
_sideBar = function () {
|
|
23
21
|
return data;
|
|
24
22
|
};
|
|
25
|
-
|
|
26
23
|
return data;
|
|
27
24
|
}
|
|
28
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { SideBar, SideBarProps } from './side-bar';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { SideBar, SideBarProps } from './side-bar';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
|
|
@@ -1,134 +1,99 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.iterator.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.array.sort.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.SideBar = SideBar;
|
|
13
|
-
|
|
14
10
|
function _extends2() {
|
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
|
-
|
|
17
12
|
_extends2 = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _objectWithoutProperties2() {
|
|
25
18
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
26
|
-
|
|
27
19
|
_objectWithoutProperties2 = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function _react() {
|
|
35
25
|
const data = _interopRequireWildcard(require("react"));
|
|
36
|
-
|
|
37
26
|
_react = function () {
|
|
38
27
|
return data;
|
|
39
28
|
};
|
|
40
|
-
|
|
41
29
|
return data;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
function _lodash() {
|
|
45
32
|
const data = require("lodash");
|
|
46
|
-
|
|
47
33
|
_lodash = function () {
|
|
48
34
|
return data;
|
|
49
35
|
};
|
|
50
|
-
|
|
51
36
|
return data;
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
function _classnames() {
|
|
55
39
|
const data = _interopRequireDefault(require("classnames"));
|
|
56
|
-
|
|
57
40
|
_classnames = function () {
|
|
58
41
|
return data;
|
|
59
42
|
};
|
|
60
|
-
|
|
61
43
|
return data;
|
|
62
44
|
}
|
|
63
|
-
|
|
64
45
|
function _designUiSurfacesMenu() {
|
|
65
46
|
const data = require("@teambit/design.ui.surfaces.menu.section");
|
|
66
|
-
|
|
67
47
|
_designUiSurfacesMenu = function () {
|
|
68
48
|
return data;
|
|
69
49
|
};
|
|
70
|
-
|
|
71
50
|
return data;
|
|
72
51
|
}
|
|
73
|
-
|
|
74
52
|
function _uiFoundationUiTree() {
|
|
75
53
|
const data = require("@teambit/ui-foundation.ui.tree.drawer");
|
|
76
|
-
|
|
77
54
|
_uiFoundationUiTree = function () {
|
|
78
55
|
return data;
|
|
79
56
|
};
|
|
80
|
-
|
|
81
57
|
return data;
|
|
82
58
|
}
|
|
83
|
-
|
|
84
59
|
function _sideBarModule() {
|
|
85
60
|
const data = _interopRequireDefault(require("./side-bar.module.scss"));
|
|
86
|
-
|
|
87
61
|
_sideBarModule = function () {
|
|
88
62
|
return data;
|
|
89
63
|
};
|
|
90
|
-
|
|
91
64
|
return data;
|
|
92
65
|
}
|
|
93
|
-
|
|
94
66
|
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); }
|
|
95
|
-
|
|
96
67
|
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; }
|
|
97
|
-
|
|
98
68
|
/**
|
|
99
69
|
* side bar component.
|
|
100
70
|
*/
|
|
101
71
|
function SideBar(_ref) {
|
|
102
72
|
let {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
73
|
+
drawerSlot,
|
|
74
|
+
items = []
|
|
75
|
+
} = _ref,
|
|
76
|
+
rest = (0, _objectWithoutProperties2().default)(_ref, ["drawerSlot", "items"]);
|
|
107
77
|
const drawers = (0, _lodash().flatten)(drawerSlot.values()).filter(drawer => {
|
|
108
78
|
var _drawer$isHidden;
|
|
109
|
-
|
|
110
79
|
return !(drawer !== null && drawer !== void 0 && (_drawer$isHidden = drawer.isHidden) !== null && _drawer$isHidden !== void 0 && _drawer$isHidden.call(drawer));
|
|
111
80
|
}).sort(sortFn);
|
|
112
81
|
const [openDrawerList, onToggleDrawer] = (0, _react().useState)(drawers.map(drawer => drawer.id));
|
|
113
|
-
|
|
114
82
|
const handleDrawerToggle = id => {
|
|
115
83
|
const isDrawerOpen = openDrawerList.includes(id);
|
|
116
|
-
|
|
117
84
|
if (isDrawerOpen) {
|
|
118
85
|
onToggleDrawer(list => list.filter(drawer => drawer !== id));
|
|
119
86
|
return;
|
|
120
87
|
}
|
|
121
|
-
|
|
122
88
|
onToggleDrawer(list => list.concat(id));
|
|
123
89
|
};
|
|
124
|
-
|
|
125
90
|
return /*#__PURE__*/_react().default.createElement("div", (0, _extends2().default)({}, rest, {
|
|
126
91
|
className: _sideBarModule().default.sidebar
|
|
127
92
|
}), /*#__PURE__*/_react().default.createElement(_designUiSurfacesMenu().MenuSection, {
|
|
128
93
|
items: items
|
|
129
94
|
}), drawers.map(drawer => {
|
|
130
|
-
if (!drawer || !drawer.name) return null;
|
|
131
|
-
|
|
95
|
+
if (!drawer || !drawer.name) return null;
|
|
96
|
+
// consider passing collapse all as a prop so each drawer collapses itself
|
|
132
97
|
const isOpen = openDrawerList.includes(drawer.id);
|
|
133
98
|
return /*#__PURE__*/_react().default.createElement(_uiFoundationUiTree().DrawerUI, {
|
|
134
99
|
className: (0, _classnames().default)(_sideBarModule().default.sidebarDrawer, isOpen && _sideBarModule().default.open),
|
|
@@ -141,13 +106,12 @@ function SideBar(_ref) {
|
|
|
141
106
|
}, /*#__PURE__*/_react().default.createElement(drawer.render, null));
|
|
142
107
|
}));
|
|
143
108
|
}
|
|
144
|
-
|
|
145
109
|
function sortFn(first, second) {
|
|
146
110
|
var _first$order, _second$order;
|
|
147
|
-
|
|
148
111
|
// 0 - equal
|
|
149
112
|
// <0 - first < second
|
|
150
113
|
// >0 - first > second
|
|
114
|
+
|
|
151
115
|
return ((_first$order = first.order) !== null && _first$order !== void 0 ? _first$order : 0) - ((_second$order = second.order) !== null && _second$order !== void 0 ? _second$order : 0);
|
|
152
116
|
}
|
|
153
117
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SideBar","drawerSlot","items","rest","drawers","flatten","values","filter","drawer","isHidden","sort","sortFn","openDrawerList","onToggleDrawer","useState","map","id","handleDrawerToggle","isDrawerOpen","includes","list","concat","styles","sidebar","name","isOpen","classNames","sidebarDrawer","open","widgets","Context","first","second","order"],"sources":["side-bar.tsx"],"sourcesContent":["import React, { useState, ComponentType } from 'react';\nimport { flatten } from 'lodash';\nimport classNames from 'classnames';\nimport { MenuSection } from '@teambit/design.ui.surfaces.menu.section';\nimport { DrawerType, DrawerUI } from '@teambit/ui-foundation.ui.tree.drawer';\nimport { DrawerSlot } from '../../sidebar.ui.runtime';\nimport styles from './side-bar.module.scss';\n\nexport type SideBarProps = {\n /**\n * slot of registered drawers.\n */\n drawerSlot: DrawerSlot;\n /**\n * slot of registered items to the main section at the top.\n */\n items?: ComponentType[];\n} & React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * side bar component.\n */\nexport function SideBar({ drawerSlot, items = [], ...rest }: SideBarProps) {\n const drawers = flatten(drawerSlot.values())\n .filter((drawer) => !drawer?.isHidden?.())\n .sort(sortFn);\n\n const [openDrawerList, onToggleDrawer] = useState<(string | undefined)[]>(drawers.map((drawer) => drawer.id));\n\n const handleDrawerToggle = (id: string) => {\n const isDrawerOpen = openDrawerList.includes(id);\n if (isDrawerOpen) {\n onToggleDrawer((list) => list.filter((drawer) => drawer !== id));\n return;\n }\n onToggleDrawer((list) => list.concat(id));\n };\n\n return (\n <div {...rest} className={styles.sidebar}>\n <MenuSection items={items} />\n {drawers.map((drawer) => {\n if (!drawer || !drawer.name) return null;\n // consider passing collapse all as a prop so each drawer collapses itself\n const isOpen = openDrawerList.includes(drawer.id);\n\n return (\n <DrawerUI\n className={classNames(styles.sidebarDrawer, isOpen && styles.open)}\n isOpen={isOpen}\n onToggle={() => handleDrawerToggle(drawer.id)}\n key={drawer.id}\n name={drawer.name}\n Widgets={drawer.widgets}\n Context={drawer.Context}\n >\n <drawer.render />\n </DrawerUI>\n );\n })}\n </div>\n );\n}\nfunction sortFn(first: DrawerType, second: DrawerType) {\n // 0 - equal\n // <0 - first < second\n // >0 - first > second\n\n return (first.order ?? 0) - (second.order ?? 0);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["SideBar","drawerSlot","items","rest","drawers","flatten","values","filter","drawer","isHidden","sort","sortFn","openDrawerList","onToggleDrawer","useState","map","id","handleDrawerToggle","isDrawerOpen","includes","list","concat","styles","sidebar","name","isOpen","classNames","sidebarDrawer","open","widgets","Context","first","second","order"],"sources":["side-bar.tsx"],"sourcesContent":["import React, { useState, ComponentType } from 'react';\nimport { flatten } from 'lodash';\nimport classNames from 'classnames';\nimport { MenuSection } from '@teambit/design.ui.surfaces.menu.section';\nimport { DrawerType, DrawerUI } from '@teambit/ui-foundation.ui.tree.drawer';\nimport { DrawerSlot } from '../../sidebar.ui.runtime';\nimport styles from './side-bar.module.scss';\n\nexport type SideBarProps = {\n /**\n * slot of registered drawers.\n */\n drawerSlot: DrawerSlot;\n /**\n * slot of registered items to the main section at the top.\n */\n items?: ComponentType[];\n} & React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * side bar component.\n */\nexport function SideBar({ drawerSlot, items = [], ...rest }: SideBarProps) {\n const drawers = flatten(drawerSlot.values())\n .filter((drawer) => !drawer?.isHidden?.())\n .sort(sortFn);\n\n const [openDrawerList, onToggleDrawer] = useState<(string | undefined)[]>(drawers.map((drawer) => drawer.id));\n\n const handleDrawerToggle = (id: string) => {\n const isDrawerOpen = openDrawerList.includes(id);\n if (isDrawerOpen) {\n onToggleDrawer((list) => list.filter((drawer) => drawer !== id));\n return;\n }\n onToggleDrawer((list) => list.concat(id));\n };\n\n return (\n <div {...rest} className={styles.sidebar}>\n <MenuSection items={items} />\n {drawers.map((drawer) => {\n if (!drawer || !drawer.name) return null;\n // consider passing collapse all as a prop so each drawer collapses itself\n const isOpen = openDrawerList.includes(drawer.id);\n\n return (\n <DrawerUI\n className={classNames(styles.sidebarDrawer, isOpen && styles.open)}\n isOpen={isOpen}\n onToggle={() => handleDrawerToggle(drawer.id)}\n key={drawer.id}\n name={drawer.name}\n Widgets={drawer.widgets}\n Context={drawer.Context}\n >\n <drawer.render />\n </DrawerUI>\n );\n })}\n </div>\n );\n}\nfunction sortFn(first: DrawerType, second: DrawerType) {\n // 0 - equal\n // <0 - first < second\n // >0 - first > second\n\n return (first.order ?? 0) - (second.order ?? 0);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA4C;AAAA;AAa5C;AACA;AACA;AACO,SAASA,OAAO,OAAoD;EAAA,IAAnD;MAAEC,UAAU;MAAEC,KAAK,GAAG;IAA0B,CAAC;IAApBC,IAAI;EACvD,MAAMC,OAAO,GAAG,IAAAC,iBAAO,EAACJ,UAAU,CAACK,MAAM,EAAE,CAAC,CACzCC,MAAM,CAAEC,MAAM;IAAA;IAAA,OAAK,EAACA,MAAM,aAANA,MAAM,mCAANA,MAAM,CAAEC,QAAQ,6CAAhB,sBAAAD,MAAM,CAAc;EAAA,EAAC,CACzCE,IAAI,CAACC,MAAM,CAAC;EAEf,MAAM,CAACC,cAAc,EAAEC,cAAc,CAAC,GAAG,IAAAC,iBAAQ,EAAyBV,OAAO,CAACW,GAAG,CAAEP,MAAM,IAAKA,MAAM,CAACQ,EAAE,CAAC,CAAC;EAE7G,MAAMC,kBAAkB,GAAID,EAAU,IAAK;IACzC,MAAME,YAAY,GAAGN,cAAc,CAACO,QAAQ,CAACH,EAAE,CAAC;IAChD,IAAIE,YAAY,EAAE;MAChBL,cAAc,CAAEO,IAAI,IAAKA,IAAI,CAACb,MAAM,CAAEC,MAAM,IAAKA,MAAM,KAAKQ,EAAE,CAAC,CAAC;MAChE;IACF;IACAH,cAAc,CAAEO,IAAI,IAAKA,IAAI,CAACC,MAAM,CAACL,EAAE,CAAC,CAAC;EAC3C,CAAC;EAED,oBACE,mEAASb,IAAI;IAAE,SAAS,EAAEmB,wBAAM,CAACC;EAAQ,iBACvC,+BAAC,mCAAW;IAAC,KAAK,EAAErB;EAAM,EAAG,EAC5BE,OAAO,CAACW,GAAG,CAAEP,MAAM,IAAK;IACvB,IAAI,CAACA,MAAM,IAAI,CAACA,MAAM,CAACgB,IAAI,EAAE,OAAO,IAAI;IACxC;IACA,MAAMC,MAAM,GAAGb,cAAc,CAACO,QAAQ,CAACX,MAAM,CAACQ,EAAE,CAAC;IAEjD,oBACE,+BAAC,8BAAQ;MACP,SAAS,EAAE,IAAAU,qBAAU,EAACJ,wBAAM,CAACK,aAAa,EAAEF,MAAM,IAAIH,wBAAM,CAACM,IAAI,CAAE;MACnE,MAAM,EAAEH,MAAO;MACf,QAAQ,EAAE,MAAMR,kBAAkB,CAACT,MAAM,CAACQ,EAAE,CAAE;MAC9C,GAAG,EAAER,MAAM,CAACQ,EAAG;MACf,IAAI,EAAER,MAAM,CAACgB,IAAK;MAClB,OAAO,EAAEhB,MAAM,CAACqB,OAAQ;MACxB,OAAO,EAAErB,MAAM,CAACsB;IAAQ,gBAExB,+BAAC,MAAM,CAAC,MAAM,OAAG,CACR;EAEf,CAAC,CAAC,CACE;AAEV;AACA,SAASnB,MAAM,CAACoB,KAAiB,EAAEC,MAAkB,EAAE;EAAA;EACrD;EACA;EACA;;EAEA,OAAO,iBAACD,KAAK,CAACE,KAAK,uDAAI,CAAC,sBAAKD,MAAM,CAACC,KAAK,yDAAI,CAAC,CAAC;AACjD"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/sidebar",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.882",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/ui-foundation/sidebar",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.ui-foundation",
|
|
8
8
|
"name": "sidebar",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.882"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"classnames": "2.2.6",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"@babel/runtime": "7.12.18",
|
|
15
15
|
"core-js": "^3.0.0",
|
|
16
16
|
"@teambit/harmony": "0.3.3",
|
|
17
|
-
"@teambit/component": "0.0.
|
|
17
|
+
"@teambit/component": "0.0.882",
|
|
18
18
|
"@teambit/ui-foundation.ui.tree.drawer": "0.0.507",
|
|
19
|
-
"@teambit/ui": "0.0.
|
|
19
|
+
"@teambit/ui": "0.0.882",
|
|
20
20
|
"@teambit/design.ui.surfaces.menu.section": "0.0.348"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_sidebar@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_sidebar@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_sidebar@0.0.882/dist/sidebar.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_sidebar@0.0.882/dist/sidebar.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
Binary file
|