@teambit/sidebar 1.0.257 → 1.0.259

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.
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.ui-foundation/sidebar@1.0.257" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.ui-foundation/sidebar@1.0.259" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.ui-foundation/sidebar-preview"]=t():e["teambit.ui-foundation/sidebar-preview"]=t()}(self,(()=>(()=>{"use strict";var e={43708:(e,t,o)=>{var r={id:"teambit.ui-foundation/sidebar@1.0.257",homepage:"https://bit.cloud/teambit/ui-foundation/sidebar",exported:!0};function n(){const e=i(o(41594));return n=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,n.__bit_component=r,i.__bit_component=r;const a=()=>n().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},n().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/sidebar.svg"}));a.__bit_component=r,t.Logo=a},41594:e=>{e.exports=React}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{o.r(r),o.d(r,{compositions:()=>u,compositions_metadata:()=>l,overview:()=>f});var e={};o.r(e),o.d(e,{default:()=>d});var t=o(43708);o(41594);const n=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var a=["components"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},s.apply(this,arguments)}var p={},c="wrapper";function d(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||(n[o]=e[o]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}(e,a);return(0,n.mdx)(c,s({},p,o,{components:t,mdxType:"MDXLayout"}),(0,n.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const u=[t],f=[e],l={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),r})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.ui-foundation/sidebar-preview"]=t():e["teambit.ui-foundation/sidebar-preview"]=t()}(self,(()=>(()=>{"use strict";var e={97546:(e,t,o)=>{var r={id:"teambit.ui-foundation/sidebar@1.0.259",homepage:"https://bit.cloud/teambit/ui-foundation/sidebar",exported:!0};function n(){const e=i(o(41594));return n=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,n.__bit_component=r,i.__bit_component=r;const a=()=>n().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},n().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/sidebar.svg"}));a.__bit_component=r,t.Logo=a},41594:e=>{e.exports=React}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{o.r(r),o.d(r,{compositions:()=>u,compositions_metadata:()=>l,overview:()=>f});var e={};o.r(e),o.d(e,{default:()=>d});var t=o(97546);o(41594);const n=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var a=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},p.apply(this,arguments)}var s={},c="wrapper";function d(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;o[r]=e[r]}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}(e,a);return(0,n.mdx)(c,p({},s,o,{components:t,mdxType:"MDXLayout"}),(0,n.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const u=[t],f=[e],l={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),r})()));
@@ -14,446 +14,482 @@
14
14
  },
15
15
  "exports": [
16
16
  {
17
- "__schema": "ClassSchema",
17
+ "__schema": "ExportSchema",
18
18
  "location": {
19
- "filePath": "sidebar.ui.runtime.tsx",
20
- "line": 23,
21
- "character": 1
19
+ "filePath": "index.ts",
20
+ "line": 3,
21
+ "character": 15
22
22
  },
23
- "signature": "class SidebarUI",
24
23
  "name": "SidebarUI",
25
- "members": [
26
- {
27
- "__schema": "ConstructorSchema",
28
- "location": {
29
- "filePath": "sidebar.ui.runtime.tsx",
30
- "line": 24,
31
- "character": 3
32
- },
33
- "signature": "constructor SidebarUI(drawerSlot: DrawerSlot): SidebarUI",
34
- "name": "constructor",
35
- "params": [
36
- {
37
- "__schema": "ParameterSchema",
38
- "location": {
39
- "filePath": "sidebar.ui.runtime.tsx",
40
- "line": 24,
41
- "character": 15
42
- },
43
- "name": "drawerSlot",
44
- "type": {
45
- "__schema": "TypeRefSchema",
24
+ "exportNode": {
25
+ "__schema": "ClassSchema",
26
+ "location": {
27
+ "filePath": "sidebar.ui.runtime.tsx",
28
+ "line": 23,
29
+ "character": 1
30
+ },
31
+ "signature": "class SidebarUI",
32
+ "name": "SidebarUI",
33
+ "members": [
34
+ {
35
+ "__schema": "ConstructorSchema",
36
+ "location": {
37
+ "filePath": "sidebar.ui.runtime.tsx",
38
+ "line": 24,
39
+ "character": 3
40
+ },
41
+ "signature": "constructor SidebarUI(drawerSlot: DrawerSlot): SidebarUI",
42
+ "name": "constructor",
43
+ "params": [
44
+ {
45
+ "__schema": "ParameterSchema",
46
46
  "location": {
47
47
  "filePath": "sidebar.ui.runtime.tsx",
48
48
  "line": 24,
49
- "character": 35
49
+ "character": 15
50
+ },
51
+ "name": "drawerSlot",
52
+ "type": {
53
+ "__schema": "TypeRefSchema",
54
+ "location": {
55
+ "filePath": "sidebar.ui.runtime.tsx",
56
+ "line": 24,
57
+ "character": 35
58
+ },
59
+ "name": "DrawerSlot",
60
+ "internalFilePath": "sidebar.ui.runtime.tsx"
50
61
  },
51
- "name": "DrawerSlot",
52
- "internalFilePath": "sidebar.ui.runtime.tsx"
62
+ "isOptional": false,
63
+ "isSpread": false
64
+ }
65
+ ],
66
+ "returnType": {
67
+ "__schema": "ThisTypeSchema",
68
+ "location": {
69
+ "filePath": "sidebar.ui.runtime.tsx",
70
+ "line": 23,
71
+ "character": 1
53
72
  },
54
- "isOptional": false,
55
- "isSpread": false
56
- }
57
- ],
58
- "returnType": {
59
- "__schema": "ThisTypeSchema",
60
- "location": {
61
- "filePath": "sidebar.ui.runtime.tsx",
62
- "line": 23,
63
- "character": 1
73
+ "name": "SidebarUI"
64
74
  },
65
- "name": "SidebarUI"
66
- },
67
- "modifiers": []
68
- },
69
- {
70
- "__schema": "FunctionLikeSchema",
71
- "location": {
72
- "filePath": "sidebar.ui.runtime.tsx",
73
- "line": 29,
74
- "character": 3
75
+ "modifiers": []
75
76
  },
76
- "doc": {
77
- "__schema": "DocSchema",
77
+ {
78
+ "__schema": "FunctionLikeSchema",
78
79
  "location": {
79
80
  "filePath": "sidebar.ui.runtime.tsx",
80
- "line": 26,
81
+ "line": 29,
81
82
  "character": 3
82
83
  },
83
- "raw": "/**\n * register a new drawer into the component sidebar.\n */",
84
- "comment": "register a new drawer into the component sidebar."
85
- },
86
- "signature": "(method) SidebarUI.registerDrawer(...drawer: DrawerType[]): this",
87
- "name": "registerDrawer",
88
- "params": [
89
- {
90
- "__schema": "ParameterSchema",
84
+ "doc": {
85
+ "__schema": "DocSchema",
91
86
  "location": {
92
87
  "filePath": "sidebar.ui.runtime.tsx",
93
- "line": 29,
94
- "character": 18
88
+ "line": 26,
89
+ "character": 3
95
90
  },
96
- "name": "drawer",
97
- "type": {
98
- "__schema": "TypeArraySchema",
91
+ "raw": "/**\n * register a new drawer into the component sidebar.\n */",
92
+ "comment": "register a new drawer into the component sidebar."
93
+ },
94
+ "signature": "(method) SidebarUI.registerDrawer(...drawer: DrawerType[]): this",
95
+ "name": "registerDrawer",
96
+ "params": [
97
+ {
98
+ "__schema": "ParameterSchema",
99
99
  "location": {
100
100
  "filePath": "sidebar.ui.runtime.tsx",
101
101
  "line": 29,
102
- "character": 29
102
+ "character": 18
103
103
  },
104
+ "name": "drawer",
104
105
  "type": {
105
- "__schema": "TypeRefSchema",
106
+ "__schema": "TypeArraySchema",
106
107
  "location": {
107
108
  "filePath": "sidebar.ui.runtime.tsx",
108
109
  "line": 29,
109
110
  "character": 29
110
111
  },
111
- "name": "DrawerType",
112
- "componentId": {
113
- "scope": "teambit.ui-foundation",
114
- "name": "ui/tree/drawer",
115
- "version": "0.0.518"
112
+ "type": {
113
+ "__schema": "TypeRefSchema",
114
+ "location": {
115
+ "filePath": "sidebar.ui.runtime.tsx",
116
+ "line": 29,
117
+ "character": 29
118
+ },
119
+ "name": "DrawerType",
120
+ "componentId": {
121
+ "scope": "teambit.ui-foundation",
122
+ "name": "ui/tree/drawer",
123
+ "version": "0.0.518"
124
+ }
116
125
  }
117
- }
126
+ },
127
+ "isOptional": false,
128
+ "isSpread": true
129
+ }
130
+ ],
131
+ "returnType": {
132
+ "__schema": "TypeRefSchema",
133
+ "location": {
134
+ "filePath": "sidebar.ui.runtime.tsx",
135
+ "line": 29,
136
+ "character": 3
118
137
  },
119
- "isOptional": false,
120
- "isSpread": true
121
- }
122
- ],
123
- "returnType": {
124
- "__schema": "TypeRefSchema",
125
- "location": {
126
- "filePath": "sidebar.ui.runtime.tsx",
127
- "line": 29,
128
- "character": 3
129
- },
130
- "name": "SidebarUI"
131
- },
132
- "modifiers": []
133
- },
134
- {
135
- "__schema": "VariableLikeSchema",
136
- "location": {
137
- "filePath": "sidebar.ui.runtime.tsx",
138
- "line": 37,
139
- "character": 3
140
- },
141
- "doc": {
142
- "__schema": "DocSchema",
143
- "location": {
144
- "filePath": "sidebar.ui.runtime.tsx",
145
- "line": 34,
146
- "character": 3
138
+ "name": "SidebarUI"
147
139
  },
148
- "raw": "/**\n * render the sidebar.\n */",
149
- "comment": "render the sidebar."
140
+ "modifiers": []
150
141
  },
151
- "signature": "(property) SidebarUI.render: (props: Partial<SideBarProps>) => React.JSX.Element",
152
- "name": "render",
153
- "type": {
154
- "__schema": "InferenceTypeSchema",
142
+ {
143
+ "__schema": "VariableLikeSchema",
155
144
  "location": {
156
145
  "filePath": "sidebar.ui.runtime.tsx",
157
146
  "line": 37,
158
147
  "character": 3
159
148
  },
160
- "type": "(props: Partial<SideBarProps>) => React.JSX.Element"
161
- },
162
- "isOptional": true,
163
- "defaultValue": "(props: Partial<SideBarProps>) => {\n return <SideBar drawerSlot={this.drawerSlot} {...props}></SideBar>;\n }"
164
- },
165
- {
166
- "__schema": "VariableLikeSchema",
167
- "location": {
168
- "filePath": "sidebar.ui.runtime.tsx",
169
- "line": 41,
170
- "character": 3
149
+ "doc": {
150
+ "__schema": "DocSchema",
151
+ "location": {
152
+ "filePath": "sidebar.ui.runtime.tsx",
153
+ "line": 34,
154
+ "character": 3
155
+ },
156
+ "raw": "/**\n * render the sidebar.\n */",
157
+ "comment": "render the sidebar."
158
+ },
159
+ "signature": "(property) SidebarUI.render: (props: Partial<SideBarProps>) => React.JSX.Element",
160
+ "name": "render",
161
+ "type": {
162
+ "__schema": "InferenceTypeSchema",
163
+ "location": {
164
+ "filePath": "sidebar.ui.runtime.tsx",
165
+ "line": 37,
166
+ "character": 3
167
+ },
168
+ "type": "(props: Partial<SideBarProps>) => React.JSX.Element"
169
+ },
170
+ "isOptional": true,
171
+ "defaultValue": "(props: Partial<SideBarProps>) => {\n return <SideBar drawerSlot={this.drawerSlot} {...props}></SideBar>;\n }"
171
172
  },
172
- "signature": "(property) SidebarUI.runtime: RuntimeDefinition",
173
- "name": "runtime",
174
- "type": {
175
- "__schema": "InferenceTypeSchema",
173
+ {
174
+ "__schema": "VariableLikeSchema",
176
175
  "location": {
177
176
  "filePath": "sidebar.ui.runtime.tsx",
178
177
  "line": 41,
179
178
  "character": 3
180
179
  },
181
- "type": "RuntimeDefinition"
182
- },
183
- "isOptional": true,
184
- "defaultValue": "UIRuntime"
185
- },
186
- {
187
- "__schema": "VariableLikeSchema",
188
- "location": {
189
- "filePath": "sidebar.ui.runtime.tsx",
190
- "line": 43,
191
- "character": 3
180
+ "signature": "(property) SidebarUI.runtime: RuntimeDefinition",
181
+ "name": "runtime",
182
+ "type": {
183
+ "__schema": "InferenceTypeSchema",
184
+ "location": {
185
+ "filePath": "sidebar.ui.runtime.tsx",
186
+ "line": 41,
187
+ "character": 3
188
+ },
189
+ "type": "RuntimeDefinition"
190
+ },
191
+ "isOptional": true,
192
+ "defaultValue": "UIRuntime"
192
193
  },
193
- "signature": "(property) SidebarUI.slots: ((registerFn: () => string) => SlotRegistry<DrawerType>)[]",
194
- "name": "slots",
195
- "type": {
196
- "__schema": "InferenceTypeSchema",
194
+ {
195
+ "__schema": "VariableLikeSchema",
197
196
  "location": {
198
197
  "filePath": "sidebar.ui.runtime.tsx",
199
198
  "line": 43,
200
199
  "character": 3
201
200
  },
202
- "type": "((registerFn: () => string) => SlotRegistry<DrawerType>)[]"
203
- },
204
- "isOptional": true,
205
- "defaultValue": "[Slot.withType<DrawerType>()]"
206
- },
207
- {
208
- "__schema": "VariableLikeSchema",
209
- "location": {
210
- "filePath": "sidebar.ui.runtime.tsx",
211
- "line": 45,
212
- "character": 3
201
+ "signature": "(property) SidebarUI.slots: ((registerFn: () => string) => SlotRegistry<DrawerType>)[]",
202
+ "name": "slots",
203
+ "type": {
204
+ "__schema": "InferenceTypeSchema",
205
+ "location": {
206
+ "filePath": "sidebar.ui.runtime.tsx",
207
+ "line": 43,
208
+ "character": 3
209
+ },
210
+ "type": "((registerFn: () => string) => SlotRegistry<DrawerType>)[]"
211
+ },
212
+ "isOptional": true,
213
+ "defaultValue": "[Slot.withType<DrawerType>()]"
213
214
  },
214
- "signature": "(property) SidebarUI.dependencies: never[]",
215
- "name": "dependencies",
216
- "type": {
217
- "__schema": "InferenceTypeSchema",
215
+ {
216
+ "__schema": "VariableLikeSchema",
218
217
  "location": {
219
218
  "filePath": "sidebar.ui.runtime.tsx",
220
219
  "line": 45,
221
220
  "character": 3
222
221
  },
223
- "type": "never[]"
224
- },
225
- "isOptional": true,
226
- "defaultValue": "[]"
227
- },
228
- {
229
- "__schema": "FunctionLikeSchema",
230
- "location": {
231
- "filePath": "sidebar.ui.runtime.tsx",
232
- "line": 47,
233
- "character": 3
234
- },
235
- "signature": "(method) SidebarUI.provider(deps: any, config: any, [drawerSlot]: [DrawerSlot]): Promise<SidebarUI>",
236
- "name": "provider",
237
- "params": [
238
- {
239
- "__schema": "ParameterSchema",
222
+ "signature": "(property) SidebarUI.dependencies: never[]",
223
+ "name": "dependencies",
224
+ "type": {
225
+ "__schema": "InferenceTypeSchema",
240
226
  "location": {
241
227
  "filePath": "sidebar.ui.runtime.tsx",
242
- "line": 47,
243
- "character": 25
228
+ "line": 45,
229
+ "character": 3
244
230
  },
245
- "name": "deps",
246
- "type": {
247
- "__schema": "InferenceTypeSchema",
231
+ "type": "never[]"
232
+ },
233
+ "isOptional": true,
234
+ "defaultValue": "[]"
235
+ },
236
+ {
237
+ "__schema": "FunctionLikeSchema",
238
+ "location": {
239
+ "filePath": "sidebar.ui.runtime.tsx",
240
+ "line": 47,
241
+ "character": 3
242
+ },
243
+ "signature": "(method) SidebarUI.provider(deps: any, config: any, [drawerSlot]: [DrawerSlot]): Promise<SidebarUI>",
244
+ "name": "provider",
245
+ "params": [
246
+ {
247
+ "__schema": "ParameterSchema",
248
248
  "location": {
249
249
  "filePath": "sidebar.ui.runtime.tsx",
250
250
  "line": 47,
251
251
  "character": 25
252
252
  },
253
- "type": "any"
254
- },
255
- "isOptional": false,
256
- "isSpread": false
257
- },
258
- {
259
- "__schema": "ParameterSchema",
260
- "location": {
261
- "filePath": "sidebar.ui.runtime.tsx",
262
- "line": 47,
263
- "character": 31
253
+ "name": "deps",
254
+ "type": {
255
+ "__schema": "InferenceTypeSchema",
256
+ "location": {
257
+ "filePath": "sidebar.ui.runtime.tsx",
258
+ "line": 47,
259
+ "character": 25
260
+ },
261
+ "type": "any"
262
+ },
263
+ "isOptional": false,
264
+ "isSpread": false
264
265
  },
265
- "name": "config",
266
- "type": {
267
- "__schema": "InferenceTypeSchema",
266
+ {
267
+ "__schema": "ParameterSchema",
268
268
  "location": {
269
269
  "filePath": "sidebar.ui.runtime.tsx",
270
270
  "line": 47,
271
271
  "character": 31
272
272
  },
273
- "type": "any"
274
- },
275
- "isOptional": false,
276
- "isSpread": false
277
- },
278
- {
279
- "__schema": "ParameterSchema",
280
- "location": {
281
- "filePath": "sidebar.ui.runtime.tsx",
282
- "line": 47,
283
- "character": 39
273
+ "name": "config",
274
+ "type": {
275
+ "__schema": "InferenceTypeSchema",
276
+ "location": {
277
+ "filePath": "sidebar.ui.runtime.tsx",
278
+ "line": 47,
279
+ "character": 31
280
+ },
281
+ "type": "any"
282
+ },
283
+ "isOptional": false,
284
+ "isSpread": false
284
285
  },
285
- "name": "[ drawerSlot ]",
286
- "type": {
287
- "__schema": "TupleTypeSchema",
286
+ {
287
+ "__schema": "ParameterSchema",
288
288
  "location": {
289
289
  "filePath": "sidebar.ui.runtime.tsx",
290
290
  "line": 47,
291
- "character": 53
291
+ "character": 39
292
292
  },
293
- "elements": [
294
- {
295
- "__schema": "TypeRefSchema",
296
- "location": {
297
- "filePath": "sidebar.ui.runtime.tsx",
298
- "line": 47,
299
- "character": 54
300
- },
301
- "name": "DrawerSlot",
302
- "internalFilePath": "sidebar.ui.runtime.tsx"
303
- }
304
- ]
293
+ "name": "[ drawerSlot ]",
294
+ "type": {
295
+ "__schema": "TupleTypeSchema",
296
+ "location": {
297
+ "filePath": "sidebar.ui.runtime.tsx",
298
+ "line": 47,
299
+ "character": 53
300
+ },
301
+ "elements": [
302
+ {
303
+ "__schema": "TypeRefSchema",
304
+ "location": {
305
+ "filePath": "sidebar.ui.runtime.tsx",
306
+ "line": 47,
307
+ "character": 54
308
+ },
309
+ "name": "DrawerSlot",
310
+ "internalFilePath": "sidebar.ui.runtime.tsx"
311
+ }
312
+ ]
313
+ },
314
+ "isOptional": false,
315
+ "isSpread": false
316
+ }
317
+ ],
318
+ "returnType": {
319
+ "__schema": "InferenceTypeSchema",
320
+ "location": {
321
+ "filePath": "sidebar.ui.runtime.tsx",
322
+ "line": 47,
323
+ "character": 3
305
324
  },
306
- "isOptional": false,
307
- "isSpread": false
308
- }
309
- ],
310
- "returnType": {
311
- "__schema": "InferenceTypeSchema",
312
- "location": {
313
- "filePath": "sidebar.ui.runtime.tsx",
314
- "line": 47,
315
- "character": 3
325
+ "type": "Promise<SidebarUI>"
316
326
  },
317
- "type": "Promise<SidebarUI>"
318
- },
319
- "modifiers": [
320
- "static",
321
- "async"
322
- ]
323
- }
324
- ],
325
- "extendsNodes": [],
326
- "implementNodes": []
327
+ "modifiers": [
328
+ "static",
329
+ "async"
330
+ ]
331
+ }
332
+ ],
333
+ "extendsNodes": [],
334
+ "implementNodes": []
335
+ }
327
336
  },
328
337
  {
329
- "__schema": "TypeSchema",
338
+ "__schema": "ExportSchema",
330
339
  "location": {
331
- "filePath": "sidebar.ui.runtime.tsx",
332
- "line": 19,
333
- "character": 1
340
+ "filePath": "index.ts",
341
+ "line": 3,
342
+ "character": 26
334
343
  },
335
- "signature": "type SidebarItemSlot = SlotRegistry<SidebarItem[]>",
336
344
  "name": "SidebarItemSlot",
337
- "type": {
338
- "__schema": "TypeRefSchema",
345
+ "exportNode": {
346
+ "__schema": "TypeSchema",
339
347
  "location": {
340
348
  "filePath": "sidebar.ui.runtime.tsx",
341
349
  "line": 19,
342
- "character": 31
343
- },
344
- "name": "SlotRegistry",
345
- "componentId": {
346
- "scope": "teambit.harmony",
347
- "name": "harmony",
348
- "version": "0.4.6"
350
+ "character": 1
349
351
  },
350
- "typeArgs": [
351
- {
352
- "__schema": "TypeArraySchema",
353
- "location": {
354
- "filePath": "sidebar.ui.runtime.tsx",
355
- "line": 19,
356
- "character": 44
357
- },
358
- "type": {
359
- "__schema": "TypeRefSchema",
352
+ "signature": "type SidebarItemSlot = SlotRegistry<SidebarItem[]>",
353
+ "name": "SidebarItemSlot",
354
+ "type": {
355
+ "__schema": "TypeRefSchema",
356
+ "location": {
357
+ "filePath": "sidebar.ui.runtime.tsx",
358
+ "line": 19,
359
+ "character": 31
360
+ },
361
+ "name": "SlotRegistry",
362
+ "componentId": {
363
+ "scope": "teambit.harmony",
364
+ "name": "harmony",
365
+ "version": "0.4.6"
366
+ },
367
+ "typeArgs": [
368
+ {
369
+ "__schema": "TypeArraySchema",
360
370
  "location": {
361
371
  "filePath": "sidebar.ui.runtime.tsx",
362
372
  "line": 19,
363
373
  "character": 44
364
374
  },
365
- "name": "SidebarItem"
375
+ "type": {
376
+ "__schema": "TypeRefSchema",
377
+ "location": {
378
+ "filePath": "sidebar.ui.runtime.tsx",
379
+ "line": 19,
380
+ "character": 44
381
+ },
382
+ "name": "SidebarItem"
383
+ }
366
384
  }
367
- }
368
- ]
385
+ ]
386
+ }
369
387
  }
370
388
  },
371
389
  {
372
- "__schema": "TypeSchema",
390
+ "__schema": "ExportSchema",
373
391
  "location": {
374
- "filePath": "sidebar.ui.runtime.tsx",
375
- "line": 14,
376
- "character": 1
392
+ "filePath": "index.ts",
393
+ "line": 3,
394
+ "character": 43
377
395
  },
378
- "signature": "type SidebarItem = {\n weight?: number | undefined;\n component?: React.ComponentType | undefined;\n}",
379
396
  "name": "SidebarItem",
380
- "type": {
381
- "__schema": "TypeLiteralSchema",
397
+ "exportNode": {
398
+ "__schema": "TypeSchema",
382
399
  "location": {
383
400
  "filePath": "sidebar.ui.runtime.tsx",
384
401
  "line": 14,
385
- "character": 27
402
+ "character": 1
386
403
  },
387
- "members": [
388
- {
389
- "__schema": "VariableLikeSchema",
390
- "location": {
391
- "filePath": "sidebar.ui.runtime.tsx",
392
- "line": 15,
393
- "character": 3
394
- },
395
- "signature": "(property) weight?: number | undefined",
396
- "name": "weight",
397
- "type": {
398
- "__schema": "KeywordTypeSchema",
404
+ "signature": "type SidebarItem = {\n weight?: number | undefined;\n component?: React.ComponentType | undefined;\n}",
405
+ "name": "SidebarItem",
406
+ "type": {
407
+ "__schema": "TypeLiteralSchema",
408
+ "location": {
409
+ "filePath": "sidebar.ui.runtime.tsx",
410
+ "line": 14,
411
+ "character": 27
412
+ },
413
+ "members": [
414
+ {
415
+ "__schema": "VariableLikeSchema",
399
416
  "location": {
400
417
  "filePath": "sidebar.ui.runtime.tsx",
401
418
  "line": 15,
402
- "character": 12
419
+ "character": 3
403
420
  },
404
- "name": "number"
405
- },
406
- "isOptional": true
407
- },
408
- {
409
- "__schema": "VariableLikeSchema",
410
- "location": {
411
- "filePath": "sidebar.ui.runtime.tsx",
412
- "line": 16,
413
- "character": 3
421
+ "signature": "(property) weight?: number | undefined",
422
+ "name": "weight",
423
+ "type": {
424
+ "__schema": "KeywordTypeSchema",
425
+ "location": {
426
+ "filePath": "sidebar.ui.runtime.tsx",
427
+ "line": 15,
428
+ "character": 12
429
+ },
430
+ "name": "number"
431
+ },
432
+ "isOptional": true
414
433
  },
415
- "signature": "(property) component?: React.ComponentType | undefined",
416
- "name": "component",
417
- "type": {
418
- "__schema": "TypeRefSchema",
434
+ {
435
+ "__schema": "VariableLikeSchema",
419
436
  "location": {
420
437
  "filePath": "sidebar.ui.runtime.tsx",
421
438
  "line": 16,
422
- "character": 15
439
+ "character": 3
423
440
  },
424
- "name": "ComponentType",
425
- "packageName": "react"
426
- },
427
- "isOptional": true
428
- }
429
- ]
441
+ "signature": "(property) component?: React.ComponentType | undefined",
442
+ "name": "component",
443
+ "type": {
444
+ "__schema": "TypeRefSchema",
445
+ "location": {
446
+ "filePath": "sidebar.ui.runtime.tsx",
447
+ "line": 16,
448
+ "character": 15
449
+ },
450
+ "name": "ComponentType",
451
+ "packageName": "react"
452
+ },
453
+ "isOptional": true
454
+ }
455
+ ]
456
+ }
430
457
  }
431
458
  },
432
459
  {
433
- "__schema": "VariableLikeSchema",
460
+ "__schema": "ExportSchema",
434
461
  "location": {
435
- "filePath": "sidebar.aspect.ts",
436
- "line": 3,
437
- "character": 14
462
+ "filePath": "index.ts",
463
+ "line": 4,
464
+ "character": 10
438
465
  },
439
- "signature": "const SidebarAspect: Aspect",
440
466
  "name": "SidebarAspect",
441
- "type": {
442
- "__schema": "TypeRefSchema",
467
+ "exportNode": {
468
+ "__schema": "VariableLikeSchema",
443
469
  "location": {
444
470
  "filePath": "sidebar.aspect.ts",
445
471
  "line": 3,
446
472
  "character": 14
447
473
  },
448
- "name": "Aspect",
449
- "componentId": {
450
- "scope": "teambit.harmony",
451
- "name": "harmony",
452
- "version": "0.4.6"
453
- }
454
- },
455
- "isOptional": false,
456
- "defaultValue": "Aspect.create({\n id: 'teambit.ui-foundation/sidebar',\n})"
474
+ "signature": "const SidebarAspect: Aspect",
475
+ "name": "SidebarAspect",
476
+ "type": {
477
+ "__schema": "TypeRefSchema",
478
+ "location": {
479
+ "filePath": "sidebar.aspect.ts",
480
+ "line": 3,
481
+ "character": 14
482
+ },
483
+ "name": "Aspect",
484
+ "componentId": {
485
+ "scope": "teambit.harmony",
486
+ "name": "harmony",
487
+ "version": "0.4.6"
488
+ }
489
+ },
490
+ "isOptional": false,
491
+ "defaultValue": "Aspect.create({\n id: 'teambit.ui-foundation/sidebar',\n})"
492
+ }
457
493
  },
458
494
  {
459
495
  "__schema": "UnImplementedSchema",
@@ -1050,7 +1086,7 @@
1050
1086
  "componentId": {
1051
1087
  "scope": "teambit.ui-foundation",
1052
1088
  "name": "sidebar",
1053
- "version": "1.0.257"
1089
+ "version": "1.0.259"
1054
1090
  },
1055
1091
  "taggedModuleExports": []
1056
1092
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_sidebar@1.0.257/dist/sidebar.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_sidebar@1.0.257/dist/sidebar.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_sidebar@1.0.259/dist/sidebar.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_sidebar@1.0.259/dist/sidebar.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -52,7 +52,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
52
52
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
53
53
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
54
54
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
55
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
55
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
56
56
  /**
57
57
  * side bar component.
58
58
  */
@@ -1 +1 @@
1
- {"version":3,"names":["_react","data","_interopRequireWildcard","require","_lodash","_classnames","_interopRequireDefault","_designUiSurfacesMenu","_uiFoundationUiTree","_sideBarModule","_excluded","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","prototype","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","SideBar","_ref","drawerSlot","items","overrideDrawerSlot","rest","drawers","flatten","values","filter","drawer","isHidden","sort","sortFn","openDrawerList","onToggleDrawer","useState","map","id","handleDrawerToggle","isDrawerOpen","includes","list","concat","createElement","className","styles","sidebar","MenuSection","name","isOpen","DrawerUI","classNames","sidebarDrawer","open","onToggle","Widgets","widgets","Context","render","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 /**\n * override register drawers from the slot\n */\n overrideDrawerSlot?: DrawerType[];\n} & React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * side bar component.\n */\nexport function SideBar({ drawerSlot, items = [], overrideDrawerSlot, ...rest }: SideBarProps) {\n const drawers = (overrideDrawerSlot || 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,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAH,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,sBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,qBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,oBAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,mBAAA,YAAAA,CAAA;IAA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B,SAAS,EAAEC,wBAAM,CAACC;EAAQ,iBACvC9E,MAAA,GAAAa,OAAA,CAAA8D,aAAA,CAACpE,qBAAA,GAAAwE,WAAW;IAACzB,KAAK,EAAEA;EAAM,CAAE,CAAC,EAC5BG,OAAO,CAACW,GAAG,CAAEP,MAAM,IAAK;IACvB,IAAI,CAACA,MAAM,IAAI,CAACA,MAAM,CAACmB,IAAI,EAAE,OAAO,IAAI;IACxC;IACA,MAAMC,MAAM,GAAGhB,cAAc,CAACO,QAAQ,CAACX,MAAM,CAACQ,EAAE,CAAC;IAEjD,oBACErE,MAAA,GAAAa,OAAA,CAAA8D,aAAA,CAACnE,mBAAA,GAAA0E,QAAQ;MACPN,SAAS,EAAE,IAAAO,qBAAU,EAACN,wBAAM,CAACO,aAAa,EAAEH,MAAM,IAAIJ,wBAAM,CAACQ,IAAI,CAAE;MACnEJ,MAAM,EAAEA,MAAO;MACfK,QAAQ,EAAEA,CAAA,KAAMhB,kBAAkB,CAACT,MAAM,CAACQ,EAAE,CAAE;MAC9C9B,GAAG,EAAEsB,MAAM,CAACQ,EAAG;MACfW,IAAI,EAAEnB,MAAM,CAACmB,IAAK;MAClBO,OAAO,EAAE1B,MAAM,CAAC2B,OAAQ;MACxBC,OAAO,EAAE5B,MAAM,CAAC4B;IAAQ,gBAExBzF,MAAA,GAAAa,OAAA,CAAA8D,aAAA,CAACd,MAAM,CAAC6B,MAAM,MAAE,CACR,CAAC;EAEf,CAAC,CACE,CAAC;AAEV;AACA,SAAS1B,MAAMA,CAAC2B,KAAiB,EAAEC,MAAkB,EAAE;EACrD;EACA;EACA;;EAEA,OAAO,CAACD,KAAK,CAACE,KAAK,IAAI,CAAC,KAAKD,MAAM,CAACC,KAAK,IAAI,CAAC,CAAC;AACjD","ignoreList":[]}
1
+ {"version":3,"names":["_react","data","_interopRequireWildcard","require","_lodash","_classnames","_interopRequireDefault","_designUiSurfacesMenu","_uiFoundationUiTree","_sideBarModule","_excluded","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","prototype","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","SideBar","_ref","drawerSlot","items","overrideDrawerSlot","rest","drawers","flatten","values","filter","drawer","isHidden","sort","sortFn","openDrawerList","onToggleDrawer","useState","map","id","handleDrawerToggle","isDrawerOpen","includes","list","concat","createElement","className","styles","sidebar","MenuSection","name","isOpen","DrawerUI","classNames","sidebarDrawer","open","onToggle","Widgets","widgets","Context","render","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 /**\n * override register drawers from the slot\n */\n overrideDrawerSlot?: DrawerType[];\n} & React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * side bar component.\n */\nexport function SideBar({ drawerSlot, items = [], overrideDrawerSlot, ...rest }: SideBarProps) {\n const drawers = (overrideDrawerSlot || 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,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAH,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,sBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,qBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,oBAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,mBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,eAAA;EAAA,MAAAR,IAAA,GAAAK,sBAAA,CAAAH,OAAA;EAAAM,cAAA,YAAAA,CAAA;IAAA,O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MAAM,CAACmB,IAAI,EAAE,OAAO,IAAI;IACxC;IACA,MAAMC,MAAM,GAAGhB,cAAc,CAACO,QAAQ,CAACX,MAAM,CAACQ,EAAE,CAAC;IAEjD,oBACEnE,MAAA,GAAAa,OAAA,CAAA4D,aAAA,CAACjE,mBAAA,GAAAwE,QAAQ;MACPN,SAAS,EAAE,IAAAO,qBAAU,EAACN,wBAAM,CAACO,aAAa,EAAEH,MAAM,IAAIJ,wBAAM,CAACQ,IAAI,CAAE;MACnEJ,MAAM,EAAEA,MAAO;MACfK,QAAQ,EAAEA,CAAA,KAAMhB,kBAAkB,CAACT,MAAM,CAACQ,EAAE,CAAE;MAC9C5B,GAAG,EAAEoB,MAAM,CAACQ,EAAG;MACfW,IAAI,EAAEnB,MAAM,CAACmB,IAAK;MAClBO,OAAO,EAAE1B,MAAM,CAAC2B,OAAQ;MACxBC,OAAO,EAAE5B,MAAM,CAAC4B;IAAQ,gBAExBvF,MAAA,GAAAa,OAAA,CAAA4D,aAAA,CAACd,MAAM,CAAC6B,MAAM,MAAE,CACR,CAAC;EAEf,CAAC,CACE,CAAC;AAEV;AACA,SAAS1B,MAAMA,CAAC2B,KAAiB,EAAEC,MAAkB,EAAE;EACrD;EACA;EACA;;EAEA,OAAO,CAACD,KAAK,CAACE,KAAK,IAAI,CAAC,KAAKD,MAAM,CAACC,KAAK,IAAI,CAAC,CAAC;AACjD","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/sidebar",
3
- "version": "1.0.257",
3
+ "version": "1.0.259",
4
4
  "homepage": "https://bit.cloud/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": "1.0.257"
9
+ "version": "1.0.259"
10
10
  },
11
11
  "dependencies": {
12
12
  "classnames": "2.2.6",
@@ -14,8 +14,8 @@
14
14
  "@teambit/harmony": "0.4.6",
15
15
  "@teambit/ui-foundation.ui.tree.drawer": "0.0.518",
16
16
  "@teambit/design.ui.surfaces.menu.section": "0.0.357",
17
- "@teambit/component": "1.0.257",
18
- "@teambit/ui": "1.0.257"
17
+ "@teambit/component": "1.0.259",
18
+ "@teambit/ui": "1.0.259"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/classnames": "2.2.11",