@teambit/sidebar 1.0.667 → 1.0.668
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{preview-1753809186996.js → preview-1753833698619.js} +2 -2
- package/dist/sidebar.ui.runtime.d.ts +4 -4
- package/dist/sidebar.ui.runtime.js.map +1 -1
- package/dist/ui/side-bar/side-bar.d.ts +4 -3
- package/dist/ui/side-bar/side-bar.js.map +1 -1
- package/package.json +4 -4
- package/sidebar.ui.runtime.tsx +7 -4
- package/ui/side-bar/side-bar.tsx +5 -3
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_sidebar@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_sidebar@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_sidebar@1.0.668/dist/sidebar.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_sidebar@1.0.668/dist/sidebar.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { ComponentModel } from '@teambit/component';
|
2
|
-
import { SlotRegistry } from '@teambit/harmony';
|
3
|
-
import { ComponentType } from 'react';
|
1
|
+
import type { ComponentModel } from '@teambit/component';
|
2
|
+
import type { SlotRegistry } from '@teambit/harmony';
|
3
|
+
import type { ComponentType } from 'react';
|
4
4
|
import type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';
|
5
|
-
import { SideBarProps } from './ui';
|
5
|
+
import type { SideBarProps } from './ui';
|
6
6
|
export type ComponentTypeProps = {
|
7
7
|
component: ComponentModel;
|
8
8
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_harmony","data","require","_ui","_react","_interopRequireDefault","_sidebar","_ui2","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_defineProperty","_toPropertyKey","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","SidebarUI","constructor","drawerSlot","props","createElement","SideBar","registerDrawer","drawer","register","provider","deps","config","exports","UIRuntime","Slot","withType","SidebarAspect","addRuntime"],"sources":["sidebar.ui.runtime.tsx"],"sourcesContent":["import { ComponentModel } from '@teambit/component';\nimport {
|
1
|
+
{"version":3,"names":["_harmony","data","require","_ui","_react","_interopRequireDefault","_sidebar","_ui2","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_defineProperty","_toPropertyKey","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","SidebarUI","constructor","drawerSlot","props","createElement","SideBar","registerDrawer","drawer","register","provider","deps","config","exports","UIRuntime","Slot","withType","SidebarAspect","addRuntime"],"sources":["sidebar.ui.runtime.tsx"],"sourcesContent":["import type { ComponentModel } from '@teambit/component';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport { UIRuntime } from '@teambit/ui';\nimport type { ComponentType } from 'react';\nimport React from 'react';\n\nimport type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';\nimport { SidebarAspect } from './sidebar.aspect';\nimport type { SideBarProps } from './ui';\nimport { SideBar } 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":";;;;;;AAEA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,IAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,KAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,IAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+B,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,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,CAAC;IACpE,CAAC;EAf4C;;EAE7C;AACF;AACA;EACEG,cAAcA,CAAC,GAAGC,MAAoB,EAAE;IACtC,IAAI,CAACL,UAAU,CAACM,QAAQ,CAACD,MAAM,CAAC;IAChC,OAAO,IAAI;EACb;EAeA,aAAaE,QAAQA,CAACC,IAAI,EAAEC,MAAM,EAAE,CAACT,UAAU,CAAe,EAAE;IAC9D,OAAO,IAAIF,SAAS,CAACE,UAAU,CAAC;EAClC;AACF;AAACU,OAAA,CAAAZ,SAAA,GAAAA,SAAA;AAAAd,eAAA,CA3BYc,SAAS,aAkBHa,eAAS;AAAA3B,eAAA,CAlBfc,SAAS,WAoBL,CAACc,eAAI,CAACC,QAAQ,CAAa,CAAC,CAAC;AAAA7B,eAAA,CApBjCc,SAAS,kBAsBE,EAAE;AAO1BgB,wBAAa,CAACC,UAAU,CAACjB,SAAS,CAAC","ignoreList":[]}
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import {
|
1
|
+
import type { ComponentType } from 'react';
|
2
|
+
import React from 'react';
|
3
|
+
import type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';
|
4
|
+
import type { DrawerSlot } from '../../sidebar.ui.runtime';
|
4
5
|
export type SideBarProps = {
|
5
6
|
/**
|
6
7
|
* slot of registered drawers.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_lodash","_classnames","_interopRequireDefault","_designUiSurfacesMenu","_uiFoundationUiTree","_sideBarModule","_excluded","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","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","key","Widgets","widgets","Context","render","first","second","order"],"sources":["side-bar.tsx"],"sourcesContent":["import React, { useState
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_lodash","_classnames","_interopRequireDefault","_designUiSurfacesMenu","_uiFoundationUiTree","_sideBarModule","_excluded","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","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","key","Widgets","widgets","Context","render","first","second","order"],"sources":["side-bar.tsx"],"sourcesContent":["import type { ComponentType } from 'react';\nimport React, { useState } from 'react';\nimport { flatten } from 'lodash';\nimport classNames from 'classnames';\nimport { MenuSection } from '@teambit/design.ui.surfaces.menu.section';\nimport type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';\nimport { DrawerUI } from '@teambit/ui-foundation.ui.tree.drawer';\nimport type { 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":";;;;;;AACA,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,qBAA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,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,oBACE3D,MAAA,GAAAa,OAAA,CAAAoD,aAAA,CAACzD,mBAAA,GAAAgE,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;MAC9CkB,GAAG,EAAE1B,MAAM,CAACQ,EAAG;MACfW,IAAI,EAAEnB,MAAM,CAACmB,IAAK;MAClBQ,OAAO,EAAE3B,MAAM,CAAC4B,OAAQ;MACxBC,OAAO,EAAE7B,MAAM,CAAC6B;IAAQ,gBAExBhF,MAAA,GAAAa,OAAA,CAAAoD,aAAA,CAACd,MAAM,CAAC8B,MAAM,MAAE,CACR,CAAC;EAEf,CAAC,CACE,CAAC;AAEV;AACA,SAAS3B,MAAMA,CAAC4B,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.
|
3
|
+
"version": "1.0.668",
|
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.
|
9
|
+
"version": "1.0.668"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"classnames": "2.2.6",
|
@@ -14,8 +14,8 @@
|
|
14
14
|
"@teambit/harmony": "0.4.7",
|
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.
|
18
|
-
"@teambit/ui": "1.0.
|
17
|
+
"@teambit/component": "1.0.668",
|
18
|
+
"@teambit/ui": "1.0.668"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
21
|
"@types/classnames": "2.2.11",
|
package/sidebar.ui.runtime.tsx
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
-
import { ComponentModel } from '@teambit/component';
|
2
|
-
import {
|
1
|
+
import type { ComponentModel } from '@teambit/component';
|
2
|
+
import type { SlotRegistry } from '@teambit/harmony';
|
3
|
+
import { Slot } from '@teambit/harmony';
|
3
4
|
import { UIRuntime } from '@teambit/ui';
|
4
|
-
import
|
5
|
+
import type { ComponentType } from 'react';
|
6
|
+
import React from 'react';
|
5
7
|
|
6
8
|
import type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';
|
7
9
|
import { SidebarAspect } from './sidebar.aspect';
|
8
|
-
import {
|
10
|
+
import type { SideBarProps } from './ui';
|
11
|
+
import { SideBar } from './ui';
|
9
12
|
|
10
13
|
export type ComponentTypeProps = {
|
11
14
|
component: ComponentModel;
|
package/ui/side-bar/side-bar.tsx
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
import
|
1
|
+
import type { ComponentType } from 'react';
|
2
|
+
import React, { useState } from 'react';
|
2
3
|
import { flatten } from 'lodash';
|
3
4
|
import classNames from 'classnames';
|
4
5
|
import { MenuSection } from '@teambit/design.ui.surfaces.menu.section';
|
5
|
-
import { DrawerType
|
6
|
-
import {
|
6
|
+
import type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';
|
7
|
+
import { DrawerUI } from '@teambit/ui-foundation.ui.tree.drawer';
|
8
|
+
import type { DrawerSlot } from '../../sidebar.ui.runtime';
|
7
9
|
import styles from './side-bar.module.scss';
|
8
10
|
|
9
11
|
export type SideBarProps = {
|