@teambit/component.ui.component-drawer 0.0.0-749a8f928da2d57edc546f586d491cdfcf30043d
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/component-drawer-filter-widget.context.tsx +20 -0
- package/component-drawer-tree-widget.context.tsx +16 -0
- package/component-drawer.module.scss +64 -0
- package/component-drawer.tsx +264 -0
- package/dist/component-drawer-filter-widget.context.d.ts +9 -0
- package/dist/component-drawer-filter-widget.context.js +37 -0
- package/dist/component-drawer-filter-widget.context.js.map +1 -0
- package/dist/component-drawer-tree-widget.context.d.ts +9 -0
- package/dist/component-drawer-tree-widget.context.js +37 -0
- package/dist/component-drawer-tree-widget.context.js.map +1 -0
- package/dist/component-drawer.d.ts +66 -0
- package/dist/component-drawer.js +138 -0
- package/dist/component-drawer.js.map +1 -0
- package/dist/component-drawer.module.scss +64 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/preview-1752267760470.js +7 -0
- package/index.ts +18 -0
- package/package.json +64 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { createContext, ReactNode, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ComponentFilterWidgetContextType = {
|
|
4
|
+
filterWidgetOpen: boolean;
|
|
5
|
+
setFilterWidget: (open: boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const ComponentFilterWidgetContext = createContext<ComponentFilterWidgetContextType>({
|
|
9
|
+
filterWidgetOpen: false,
|
|
10
|
+
setFilterWidget: () => {},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const ComponentFilterWidgetProvider = ({ children }: { children: ReactNode }) => {
|
|
14
|
+
const [filterWidgetOpen, setFilterWidget] = useState<boolean>(false);
|
|
15
|
+
return (
|
|
16
|
+
<ComponentFilterWidgetContext.Provider value={{ filterWidgetOpen, setFilterWidget }}>
|
|
17
|
+
{children}
|
|
18
|
+
</ComponentFilterWidgetContext.Provider>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { createContext, ReactNode, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ComponentTreeContextType = {
|
|
4
|
+
collapsed: boolean;
|
|
5
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const ComponentTreeContext = createContext<ComponentTreeContextType>({
|
|
9
|
+
collapsed: true,
|
|
10
|
+
setCollapsed: () => {},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const ComponentTreeProvider = ({ children }: { children: ReactNode }) => {
|
|
14
|
+
const [collapsed, setCollapsed] = useState<boolean>(true);
|
|
15
|
+
return <ComponentTreeContext.Provider value={{ collapsed, setCollapsed }}>{children}</ComponentTreeContext.Provider>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.drawerContainer {
|
|
2
|
+
height: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.emptyDrawer {
|
|
8
|
+
padding: 8px 8px 0 28px;
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.widgetIcon {
|
|
13
|
+
padding: 4px;
|
|
14
|
+
border-radius: 8px;
|
|
15
|
+
align-items: center;
|
|
16
|
+
display: flex;
|
|
17
|
+
margin-left: 4px;
|
|
18
|
+
|
|
19
|
+
&:hover,
|
|
20
|
+
&.open {
|
|
21
|
+
background-color: var(--bit-border-color-lightest, #ededed);
|
|
22
|
+
}
|
|
23
|
+
img {
|
|
24
|
+
width: 16px;
|
|
25
|
+
}
|
|
26
|
+
&:active img,
|
|
27
|
+
&.open img {
|
|
28
|
+
filter: invert(38%) sepia(33%) saturate(7140%) hue-rotate(234deg) brightness(96%) contrast(87%);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.filterWidgetIcon {
|
|
33
|
+
margin-right: 8px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.filtersContainer {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transition:
|
|
39
|
+
max-height 300ms ease-in-out,
|
|
40
|
+
opacity 250ms ease-in-out;
|
|
41
|
+
max-height: 0;
|
|
42
|
+
border-bottom: 1px solid var(--bit-border-color-lightest, #ededed);
|
|
43
|
+
|
|
44
|
+
&.open {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
max-height: 100%;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.filter {
|
|
51
|
+
display: none;
|
|
52
|
+
&.open {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
margin: 4px 8px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.drawerTreeContainer {
|
|
62
|
+
height: 100%;
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import React, { useContext, ReactNode, useMemo } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { ComponentTree } from '@teambit/ui-foundation.ui.side-bar';
|
|
4
|
+
import type { PayloadType } from '@teambit/ui-foundation.ui.side-bar';
|
|
5
|
+
import { ComponentTreeSlot } from '@teambit/component-tree';
|
|
6
|
+
import type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';
|
|
7
|
+
import { mutedItalic } from '@teambit/design.ui.styles.muted-italic';
|
|
8
|
+
import { ellipsis } from '@teambit/design.ui.styles.ellipsis';
|
|
9
|
+
import { ComponentModel } from '@teambit/component';
|
|
10
|
+
import { TreeNode as TreeNodeType, TreeNodeRenderer } from '@teambit/design.ui.tree';
|
|
11
|
+
import { Composer, ComponentTuple } from '@teambit/base-ui.utils.composer';
|
|
12
|
+
import flatten from 'lodash.flatten';
|
|
13
|
+
import {
|
|
14
|
+
ComponentFiltersProvider,
|
|
15
|
+
ComponentFilterContext,
|
|
16
|
+
runAllFilters,
|
|
17
|
+
ComponentFilters,
|
|
18
|
+
} from '@teambit/component.ui.component-filters.component-filter-context';
|
|
19
|
+
import { useLanes } from '@teambit/lanes.hooks.use-lanes';
|
|
20
|
+
import { LanesModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
21
|
+
import { SlotRegistry } from '@teambit/harmony';
|
|
22
|
+
import { ScopeModel } from '@teambit/scope.models.scope-model';
|
|
23
|
+
import { WorkspaceModel } from '@teambit/workspace';
|
|
24
|
+
import { ComponentTreeLoader } from '@teambit/design.ui.skeletons.sidebar-loader';
|
|
25
|
+
import { ComponentFilterWidgetProvider, ComponentFilterWidgetContext } from './component-drawer-filter-widget.context';
|
|
26
|
+
import { ComponentTreeContext, ComponentTreeProvider } from './component-drawer-tree-widget.context';
|
|
27
|
+
|
|
28
|
+
import styles from './component-drawer.module.scss';
|
|
29
|
+
|
|
30
|
+
export type ComponentFiltersSlot = SlotRegistry<ComponentFilters>;
|
|
31
|
+
export type DrawerWidgetSlot = SlotRegistry<ReactNode[]>;
|
|
32
|
+
export type TransformTreeFn = (host?: WorkspaceModel | ScopeModel) => (rootNode: TreeNodeType) => TreeNodeType;
|
|
33
|
+
|
|
34
|
+
export type ComponentsDrawerProps = Omit<DrawerType, 'render'> & {
|
|
35
|
+
useComponents: () => { components: ComponentModel[]; loading?: boolean };
|
|
36
|
+
useLanes?: () => { lanesModel?: LanesModel; loading?: boolean };
|
|
37
|
+
emptyMessage?: ReactNode;
|
|
38
|
+
plugins?: ComponentsDrawerPlugins;
|
|
39
|
+
transformTree?: TransformTreeFn;
|
|
40
|
+
assumeScopeInUrl?: boolean;
|
|
41
|
+
useHost?: () => ScopeModel | WorkspaceModel;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type ComponentsDrawerPlugins = {
|
|
45
|
+
tree?: {
|
|
46
|
+
customRenderer?: (
|
|
47
|
+
treeNodeSlot?: ComponentTreeSlot,
|
|
48
|
+
host?: ScopeModel | WorkspaceModel
|
|
49
|
+
) => TreeNodeRenderer<PayloadType>;
|
|
50
|
+
widgets: ComponentTreeSlot;
|
|
51
|
+
};
|
|
52
|
+
filters?: ComponentFiltersSlot;
|
|
53
|
+
drawerWidgets?: DrawerWidgetSlot;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export class ComponentsDrawer implements DrawerType {
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly useComponents: () => { components: ComponentModel[]; loading?: boolean };
|
|
59
|
+
readonly useLanes: () => { lanesModel?: LanesModel; loading?: boolean };
|
|
60
|
+
name: ReactNode;
|
|
61
|
+
tooltip?: string;
|
|
62
|
+
order?: number;
|
|
63
|
+
isHidden?: () => boolean;
|
|
64
|
+
emptyMessage?: ReactNode;
|
|
65
|
+
widgets: ReactNode[];
|
|
66
|
+
plugins: ComponentsDrawerPlugins;
|
|
67
|
+
assumeScopeInUrl: boolean;
|
|
68
|
+
useHost?: () => ScopeModel | WorkspaceModel;
|
|
69
|
+
transformTree?: TransformTreeFn;
|
|
70
|
+
|
|
71
|
+
constructor(props: ComponentsDrawerProps) {
|
|
72
|
+
Object.assign(this, props);
|
|
73
|
+
this.useComponents = props.useComponents;
|
|
74
|
+
this.useLanes = props.useLanes || useLanes;
|
|
75
|
+
this.emptyMessage = props.emptyMessage;
|
|
76
|
+
this.plugins = props.plugins || {};
|
|
77
|
+
this.setWidgets(props.plugins?.drawerWidgets);
|
|
78
|
+
this.assumeScopeInUrl = props.assumeScopeInUrl || false;
|
|
79
|
+
this.useHost = props.useHost;
|
|
80
|
+
this.transformTree = props.transformTree;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
Context = ({ children }) => {
|
|
84
|
+
const filters = flatten(this.plugins?.filters?.values() || []);
|
|
85
|
+
const combinedContexts = [
|
|
86
|
+
ComponentTreeProvider,
|
|
87
|
+
ComponentFilterWidgetProvider,
|
|
88
|
+
[ComponentFiltersProvider, { filters }] as ComponentTuple<{ children?: ReactNode; filters: any }>,
|
|
89
|
+
];
|
|
90
|
+
return <Composer components={combinedContexts}>{children}</Composer>;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
setWidgets = (widgets?: DrawerWidgetSlot) => {
|
|
94
|
+
this.widgets = flatten(widgets?.values());
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
render = () => {
|
|
98
|
+
const { useComponents, useLanes: useLanesFromInstance, emptyMessage, plugins, transformTree, useHost, id } = this;
|
|
99
|
+
return (
|
|
100
|
+
<ComponentsDrawerContent
|
|
101
|
+
useComponents={useComponents}
|
|
102
|
+
useLanes={useLanesFromInstance}
|
|
103
|
+
emptyMessage={emptyMessage}
|
|
104
|
+
plugins={plugins}
|
|
105
|
+
transformTree={transformTree}
|
|
106
|
+
useHost={useHost}
|
|
107
|
+
id={id}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function ComponentsDrawerContent({
|
|
114
|
+
useComponents,
|
|
115
|
+
useLanes: useLanesFromProps,
|
|
116
|
+
emptyMessage,
|
|
117
|
+
plugins,
|
|
118
|
+
transformTree,
|
|
119
|
+
useHost,
|
|
120
|
+
id,
|
|
121
|
+
}: {
|
|
122
|
+
useComponents: () => { components: ComponentModel[]; loading?: boolean };
|
|
123
|
+
useLanes: () => { lanesModel?: LanesModel; loading?: boolean };
|
|
124
|
+
emptyMessage: ReactNode;
|
|
125
|
+
plugins: ComponentsDrawerPlugins;
|
|
126
|
+
transformTree?: TransformTreeFn;
|
|
127
|
+
useHost?: () => ScopeModel | WorkspaceModel;
|
|
128
|
+
id: string;
|
|
129
|
+
}) {
|
|
130
|
+
const { loading: loadingComponents, components } = useComponents();
|
|
131
|
+
const { lanesModel: lanes, loading: loadingLanesModel } = useLanesFromProps();
|
|
132
|
+
const componentFiltersContext = useContext(ComponentFilterContext);
|
|
133
|
+
const filters = componentFiltersContext?.filters || [];
|
|
134
|
+
const host = useHost?.();
|
|
135
|
+
|
|
136
|
+
const filteredComponents = useMemo(() => {
|
|
137
|
+
if (!filters.length) return components;
|
|
138
|
+
return runAllFilters(filters, { components, lanes });
|
|
139
|
+
}, [filters, components.length, lanes?.lanes.length, lanes?.viewedLane?.id.toString(), loadingLanesModel]);
|
|
140
|
+
|
|
141
|
+
const Filters = <ComponentsDrawerRenderFilters components={components} lanes={lanes} plugins={plugins} />;
|
|
142
|
+
|
|
143
|
+
const Tree = (
|
|
144
|
+
<ComponentsDrawerRenderTree
|
|
145
|
+
components={filteredComponents}
|
|
146
|
+
host={host}
|
|
147
|
+
plugins={plugins}
|
|
148
|
+
transformTree={transformTree}
|
|
149
|
+
lanesModel={lanes}
|
|
150
|
+
/>
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
const emptyDrawer = <span className={classNames(mutedItalic, ellipsis, styles.emptyDrawer)}>{emptyMessage}</span>;
|
|
154
|
+
|
|
155
|
+
const loading = loadingComponents || loadingLanesModel || !lanes || !components;
|
|
156
|
+
|
|
157
|
+
if (loading) return <ComponentTreeLoader />;
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<div key={id} className={styles.drawerContainer}>
|
|
161
|
+
{Filters}
|
|
162
|
+
{Tree}
|
|
163
|
+
{filteredComponents.length === 0 && emptyDrawer}
|
|
164
|
+
</div>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function ComponentsDrawerRenderFilters({
|
|
169
|
+
components,
|
|
170
|
+
lanes,
|
|
171
|
+
plugins,
|
|
172
|
+
}: {
|
|
173
|
+
components: ComponentModel[];
|
|
174
|
+
lanes?: LanesModel;
|
|
175
|
+
plugins: ComponentsDrawerPlugins;
|
|
176
|
+
}) {
|
|
177
|
+
const { filterWidgetOpen } = useContext(ComponentFilterWidgetContext);
|
|
178
|
+
const filterPlugins = plugins.filters;
|
|
179
|
+
|
|
180
|
+
const filters = useMemo(
|
|
181
|
+
() =>
|
|
182
|
+
(filterPlugins &&
|
|
183
|
+
flatten(
|
|
184
|
+
filterPlugins.toArray().map(([key, filtersByKey]) => {
|
|
185
|
+
return filtersByKey.map((filter) => ({ ...filter, key: `${key}-${filter.id}` }));
|
|
186
|
+
})
|
|
187
|
+
).sort((a, b) => (a.order ?? 0) - (b.order ?? 0))) ||
|
|
188
|
+
[],
|
|
189
|
+
[filterPlugins?.map.size, filterPlugins?.values()?.length]
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
if (!filters.length) return null;
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
<div className={classNames(styles.filtersContainer, filterWidgetOpen && styles.open)}>
|
|
196
|
+
{filters.map((filter) => (
|
|
197
|
+
<filter.render
|
|
198
|
+
key={filter.key}
|
|
199
|
+
components={components}
|
|
200
|
+
lanes={lanes}
|
|
201
|
+
className={classNames(styles.filter, filterWidgetOpen && styles.open)}
|
|
202
|
+
/>
|
|
203
|
+
))}
|
|
204
|
+
</div>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function ComponentsDrawerRenderTree({
|
|
209
|
+
components,
|
|
210
|
+
host,
|
|
211
|
+
plugins,
|
|
212
|
+
transformTree,
|
|
213
|
+
lanesModel,
|
|
214
|
+
}: {
|
|
215
|
+
components: ComponentModel[];
|
|
216
|
+
host?: ScopeModel | WorkspaceModel;
|
|
217
|
+
plugins: ComponentsDrawerPlugins;
|
|
218
|
+
transformTree?: TransformTreeFn;
|
|
219
|
+
lanesModel?: LanesModel;
|
|
220
|
+
}) {
|
|
221
|
+
const { collapsed } = useContext(ComponentTreeContext);
|
|
222
|
+
const { tree } = plugins;
|
|
223
|
+
|
|
224
|
+
const TreeNode = useMemo(() => {
|
|
225
|
+
return tree?.customRenderer && tree.customRenderer(tree.widgets, host);
|
|
226
|
+
}, [tree?.customRenderer, tree?.widgets.map.size, tree?.widgets.values().length]);
|
|
227
|
+
|
|
228
|
+
const isVisible = components.length > 0;
|
|
229
|
+
|
|
230
|
+
if (!isVisible) return null;
|
|
231
|
+
|
|
232
|
+
return (
|
|
233
|
+
<div className={styles.drawerTreeContainer}>
|
|
234
|
+
<ComponentTree
|
|
235
|
+
transformTree={transformTree ? transformTree(host) : undefined}
|
|
236
|
+
components={components}
|
|
237
|
+
isCollapsed={collapsed}
|
|
238
|
+
TreeNode={TreeNode}
|
|
239
|
+
lanesModel={lanesModel}
|
|
240
|
+
/>
|
|
241
|
+
</div>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export function TreeToggleWidget() {
|
|
246
|
+
const { collapsed, setCollapsed } = useContext(ComponentTreeContext);
|
|
247
|
+
const icon = collapsed
|
|
248
|
+
? 'https://static.bit.dev/bit-icons/expand.svg'
|
|
249
|
+
: 'https://static.bit.dev/bit-icons/collapse.svg';
|
|
250
|
+
return (
|
|
251
|
+
<div className={classNames(styles.widgetIcon, !collapsed && styles.open)}>
|
|
252
|
+
<img src={icon} onClick={() => setCollapsed(!collapsed)} />
|
|
253
|
+
</div>
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export function FilterWidget() {
|
|
258
|
+
const { filterWidgetOpen, setFilterWidget } = useContext(ComponentFilterWidgetContext);
|
|
259
|
+
return (
|
|
260
|
+
<div className={classNames(styles.widgetIcon, styles.filterWidget, filterWidgetOpen && styles.open)}>
|
|
261
|
+
<img src="https://static.bit.dev/bit-icons/filter.svg" onClick={() => setFilterWidget(!filterWidgetOpen)} />
|
|
262
|
+
</div>
|
|
263
|
+
);
|
|
264
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export type ComponentFilterWidgetContextType = {
|
|
3
|
+
filterWidgetOpen: boolean;
|
|
4
|
+
setFilterWidget: (open: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const ComponentFilterWidgetContext: React.Context<ComponentFilterWidgetContextType>;
|
|
7
|
+
export declare const ComponentFilterWidgetProvider: ({ children }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ComponentFilterWidgetProvider = exports.ComponentFilterWidgetContext = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
exports.ComponentFilterWidgetContext = (0, react_1.createContext)({
|
|
29
|
+
filterWidgetOpen: false,
|
|
30
|
+
setFilterWidget: () => { },
|
|
31
|
+
});
|
|
32
|
+
const ComponentFilterWidgetProvider = ({ children }) => {
|
|
33
|
+
const [filterWidgetOpen, setFilterWidget] = (0, react_1.useState)(false);
|
|
34
|
+
return (react_1.default.createElement(exports.ComponentFilterWidgetContext.Provider, { value: { filterWidgetOpen, setFilterWidget } }, children));
|
|
35
|
+
};
|
|
36
|
+
exports.ComponentFilterWidgetProvider = ComponentFilterWidgetProvider;
|
|
37
|
+
//# sourceMappingURL=component-drawer-filter-widget.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-drawer-filter-widget.context.js","sourceRoot":"","sources":["../component-drawer-filter-widget.context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkE;AAOrD,QAAA,4BAA4B,GAAG,IAAA,qBAAa,EAAmC;IAC1F,gBAAgB,EAAE,KAAK;IACvB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;CAC1B,CAAC,CAAC;AAEI,MAAM,6BAA6B,GAAG,CAAC,EAAE,QAAQ,EAA2B,EAAE,EAAE;IACrF,MAAM,CAAC,gBAAgB,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IACrE,OAAO,CACL,8BAAC,oCAA4B,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,gBAAgB,EAAE,eAAe,EAAE,IAChF,QAAQ,CAC6B,CACzC,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,6BAA6B,iCAOxC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export type ComponentTreeContextType = {
|
|
3
|
+
collapsed: boolean;
|
|
4
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const ComponentTreeContext: React.Context<ComponentTreeContextType>;
|
|
7
|
+
export declare const ComponentTreeProvider: ({ children }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ComponentTreeProvider = exports.ComponentTreeContext = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
exports.ComponentTreeContext = (0, react_1.createContext)({
|
|
29
|
+
collapsed: true,
|
|
30
|
+
setCollapsed: () => { },
|
|
31
|
+
});
|
|
32
|
+
const ComponentTreeProvider = ({ children }) => {
|
|
33
|
+
const [collapsed, setCollapsed] = (0, react_1.useState)(true);
|
|
34
|
+
return react_1.default.createElement(exports.ComponentTreeContext.Provider, { value: { collapsed, setCollapsed } }, children);
|
|
35
|
+
};
|
|
36
|
+
exports.ComponentTreeProvider = ComponentTreeProvider;
|
|
37
|
+
//# sourceMappingURL=component-drawer-tree-widget.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-drawer-tree-widget.context.js","sourceRoot":"","sources":["../component-drawer-tree-widget.context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkE;AAOrD,QAAA,oBAAoB,GAAG,IAAA,qBAAa,EAA2B;IAC1E,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;CACvB,CAAC,CAAC;AAEI,MAAM,qBAAqB,GAAG,CAAC,EAAE,QAAQ,EAA2B,EAAE,EAAE;IAC7E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAU,IAAI,CAAC,CAAC;IAC1D,OAAO,8BAAC,4BAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IAAG,QAAQ,CAAiC,CAAC;AACvH,CAAC,CAAC;AAHW,QAAA,qBAAqB,yBAGhC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { PayloadType } from '@teambit/ui-foundation.ui.side-bar';
|
|
3
|
+
import { ComponentTreeSlot } from '@teambit/component-tree';
|
|
4
|
+
import type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';
|
|
5
|
+
import { ComponentModel } from '@teambit/component';
|
|
6
|
+
import { TreeNode as TreeNodeType, TreeNodeRenderer } from '@teambit/design.ui.tree';
|
|
7
|
+
import { ComponentFilters } from '@teambit/component.ui.component-filters.component-filter-context';
|
|
8
|
+
import { LanesModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
9
|
+
import { SlotRegistry } from '@teambit/harmony';
|
|
10
|
+
import { ScopeModel } from '@teambit/scope.models.scope-model';
|
|
11
|
+
import { WorkspaceModel } from '@teambit/workspace';
|
|
12
|
+
export type ComponentFiltersSlot = SlotRegistry<ComponentFilters>;
|
|
13
|
+
export type DrawerWidgetSlot = SlotRegistry<ReactNode[]>;
|
|
14
|
+
export type TransformTreeFn = (host?: WorkspaceModel | ScopeModel) => (rootNode: TreeNodeType) => TreeNodeType;
|
|
15
|
+
export type ComponentsDrawerProps = Omit<DrawerType, 'render'> & {
|
|
16
|
+
useComponents: () => {
|
|
17
|
+
components: ComponentModel[];
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
};
|
|
20
|
+
useLanes?: () => {
|
|
21
|
+
lanesModel?: LanesModel;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
};
|
|
24
|
+
emptyMessage?: ReactNode;
|
|
25
|
+
plugins?: ComponentsDrawerPlugins;
|
|
26
|
+
transformTree?: TransformTreeFn;
|
|
27
|
+
assumeScopeInUrl?: boolean;
|
|
28
|
+
useHost?: () => ScopeModel | WorkspaceModel;
|
|
29
|
+
};
|
|
30
|
+
export type ComponentsDrawerPlugins = {
|
|
31
|
+
tree?: {
|
|
32
|
+
customRenderer?: (treeNodeSlot?: ComponentTreeSlot, host?: ScopeModel | WorkspaceModel) => TreeNodeRenderer<PayloadType>;
|
|
33
|
+
widgets: ComponentTreeSlot;
|
|
34
|
+
};
|
|
35
|
+
filters?: ComponentFiltersSlot;
|
|
36
|
+
drawerWidgets?: DrawerWidgetSlot;
|
|
37
|
+
};
|
|
38
|
+
export declare class ComponentsDrawer implements DrawerType {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
readonly useComponents: () => {
|
|
41
|
+
components: ComponentModel[];
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
};
|
|
44
|
+
readonly useLanes: () => {
|
|
45
|
+
lanesModel?: LanesModel;
|
|
46
|
+
loading?: boolean;
|
|
47
|
+
};
|
|
48
|
+
name: ReactNode;
|
|
49
|
+
tooltip?: string;
|
|
50
|
+
order?: number;
|
|
51
|
+
isHidden?: () => boolean;
|
|
52
|
+
emptyMessage?: ReactNode;
|
|
53
|
+
widgets: ReactNode[];
|
|
54
|
+
plugins: ComponentsDrawerPlugins;
|
|
55
|
+
assumeScopeInUrl: boolean;
|
|
56
|
+
useHost?: () => ScopeModel | WorkspaceModel;
|
|
57
|
+
transformTree?: TransformTreeFn;
|
|
58
|
+
constructor(props: ComponentsDrawerProps);
|
|
59
|
+
Context: ({ children }: {
|
|
60
|
+
children: any;
|
|
61
|
+
}) => React.JSX.Element;
|
|
62
|
+
setWidgets: (widgets?: DrawerWidgetSlot) => void;
|
|
63
|
+
render: () => React.JSX.Element;
|
|
64
|
+
}
|
|
65
|
+
export declare function TreeToggleWidget(): React.JSX.Element;
|
|
66
|
+
export declare function FilterWidget(): React.JSX.Element;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ComponentsDrawer = void 0;
|
|
30
|
+
exports.TreeToggleWidget = TreeToggleWidget;
|
|
31
|
+
exports.FilterWidget = FilterWidget;
|
|
32
|
+
const react_1 = __importStar(require("react"));
|
|
33
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
34
|
+
const ui_foundation_ui_side_bar_1 = require("@teambit/ui-foundation.ui.side-bar");
|
|
35
|
+
const design_ui_styles_muted_italic_1 = require("@teambit/design.ui.styles.muted-italic");
|
|
36
|
+
const design_ui_styles_ellipsis_1 = require("@teambit/design.ui.styles.ellipsis");
|
|
37
|
+
const base_ui_utils_composer_1 = require("@teambit/base-ui.utils.composer");
|
|
38
|
+
const lodash_flatten_1 = __importDefault(require("lodash.flatten"));
|
|
39
|
+
const component_ui_component_filters_component_filter_context_1 = require("@teambit/component.ui.component-filters.component-filter-context");
|
|
40
|
+
const lanes_hooks_use_lanes_1 = require("@teambit/lanes.hooks.use-lanes");
|
|
41
|
+
const design_ui_skeletons_sidebar_loader_1 = require("@teambit/design.ui.skeletons.sidebar-loader");
|
|
42
|
+
const component_drawer_filter_widget_context_1 = require("./component-drawer-filter-widget.context");
|
|
43
|
+
const component_drawer_tree_widget_context_1 = require("./component-drawer-tree-widget.context");
|
|
44
|
+
const component_drawer_module_scss_1 = __importDefault(require("./component-drawer.module.scss"));
|
|
45
|
+
class ComponentsDrawer {
|
|
46
|
+
constructor(props) {
|
|
47
|
+
var _a;
|
|
48
|
+
this.Context = ({ children }) => {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
const filters = (0, lodash_flatten_1.default)(((_b = (_a = this.plugins) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.values()) || []);
|
|
51
|
+
const combinedContexts = [
|
|
52
|
+
component_drawer_tree_widget_context_1.ComponentTreeProvider,
|
|
53
|
+
component_drawer_filter_widget_context_1.ComponentFilterWidgetProvider,
|
|
54
|
+
[component_ui_component_filters_component_filter_context_1.ComponentFiltersProvider, { filters }],
|
|
55
|
+
];
|
|
56
|
+
return react_1.default.createElement(base_ui_utils_composer_1.Composer, { components: combinedContexts }, children);
|
|
57
|
+
};
|
|
58
|
+
this.setWidgets = (widgets) => {
|
|
59
|
+
this.widgets = (0, lodash_flatten_1.default)(widgets === null || widgets === void 0 ? void 0 : widgets.values());
|
|
60
|
+
};
|
|
61
|
+
this.render = () => {
|
|
62
|
+
const { useComponents, useLanes: useLanesFromInstance, emptyMessage, plugins, transformTree, useHost, id } = this;
|
|
63
|
+
return (react_1.default.createElement(ComponentsDrawerContent, { useComponents: useComponents, useLanes: useLanesFromInstance, emptyMessage: emptyMessage, plugins: plugins, transformTree: transformTree, useHost: useHost, id: id }));
|
|
64
|
+
};
|
|
65
|
+
Object.assign(this, props);
|
|
66
|
+
this.useComponents = props.useComponents;
|
|
67
|
+
this.useLanes = props.useLanes || lanes_hooks_use_lanes_1.useLanes;
|
|
68
|
+
this.emptyMessage = props.emptyMessage;
|
|
69
|
+
this.plugins = props.plugins || {};
|
|
70
|
+
this.setWidgets((_a = props.plugins) === null || _a === void 0 ? void 0 : _a.drawerWidgets);
|
|
71
|
+
this.assumeScopeInUrl = props.assumeScopeInUrl || false;
|
|
72
|
+
this.useHost = props.useHost;
|
|
73
|
+
this.transformTree = props.transformTree;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.ComponentsDrawer = ComponentsDrawer;
|
|
77
|
+
function ComponentsDrawerContent({ useComponents, useLanes: useLanesFromProps, emptyMessage, plugins, transformTree, useHost, id, }) {
|
|
78
|
+
var _a;
|
|
79
|
+
const { loading: loadingComponents, components } = useComponents();
|
|
80
|
+
const { lanesModel: lanes, loading: loadingLanesModel } = useLanesFromProps();
|
|
81
|
+
const componentFiltersContext = (0, react_1.useContext)(component_ui_component_filters_component_filter_context_1.ComponentFilterContext);
|
|
82
|
+
const filters = (componentFiltersContext === null || componentFiltersContext === void 0 ? void 0 : componentFiltersContext.filters) || [];
|
|
83
|
+
const host = useHost === null || useHost === void 0 ? void 0 : useHost();
|
|
84
|
+
const filteredComponents = (0, react_1.useMemo)(() => {
|
|
85
|
+
if (!filters.length)
|
|
86
|
+
return components;
|
|
87
|
+
return (0, component_ui_component_filters_component_filter_context_1.runAllFilters)(filters, { components, lanes });
|
|
88
|
+
}, [filters, components.length, lanes === null || lanes === void 0 ? void 0 : lanes.lanes.length, (_a = lanes === null || lanes === void 0 ? void 0 : lanes.viewedLane) === null || _a === void 0 ? void 0 : _a.id.toString(), loadingLanesModel]);
|
|
89
|
+
const Filters = react_1.default.createElement(ComponentsDrawerRenderFilters, { components: components, lanes: lanes, plugins: plugins });
|
|
90
|
+
const Tree = (react_1.default.createElement(ComponentsDrawerRenderTree, { components: filteredComponents, host: host, plugins: plugins, transformTree: transformTree, lanesModel: lanes }));
|
|
91
|
+
const emptyDrawer = react_1.default.createElement("span", { className: (0, classnames_1.default)(design_ui_styles_muted_italic_1.mutedItalic, design_ui_styles_ellipsis_1.ellipsis, component_drawer_module_scss_1.default.emptyDrawer) }, emptyMessage);
|
|
92
|
+
const loading = loadingComponents || loadingLanesModel || !lanes || !components;
|
|
93
|
+
if (loading)
|
|
94
|
+
return react_1.default.createElement(design_ui_skeletons_sidebar_loader_1.ComponentTreeLoader, null);
|
|
95
|
+
return (react_1.default.createElement("div", { key: id, className: component_drawer_module_scss_1.default.drawerContainer },
|
|
96
|
+
Filters,
|
|
97
|
+
Tree,
|
|
98
|
+
filteredComponents.length === 0 && emptyDrawer));
|
|
99
|
+
}
|
|
100
|
+
function ComponentsDrawerRenderFilters({ components, lanes, plugins, }) {
|
|
101
|
+
var _a;
|
|
102
|
+
const { filterWidgetOpen } = (0, react_1.useContext)(component_drawer_filter_widget_context_1.ComponentFilterWidgetContext);
|
|
103
|
+
const filterPlugins = plugins.filters;
|
|
104
|
+
const filters = (0, react_1.useMemo)(() => (filterPlugins &&
|
|
105
|
+
(0, lodash_flatten_1.default)(filterPlugins.toArray().map(([key, filtersByKey]) => {
|
|
106
|
+
return filtersByKey.map((filter) => (Object.assign(Object.assign({}, filter), { key: `${key}-${filter.id}` })));
|
|
107
|
+
})).sort((a, b) => { var _a, _b; return ((_a = a.order) !== null && _a !== void 0 ? _a : 0) - ((_b = b.order) !== null && _b !== void 0 ? _b : 0); })) ||
|
|
108
|
+
[], [filterPlugins === null || filterPlugins === void 0 ? void 0 : filterPlugins.map.size, (_a = filterPlugins === null || filterPlugins === void 0 ? void 0 : filterPlugins.values()) === null || _a === void 0 ? void 0 : _a.length]);
|
|
109
|
+
if (!filters.length)
|
|
110
|
+
return null;
|
|
111
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(component_drawer_module_scss_1.default.filtersContainer, filterWidgetOpen && component_drawer_module_scss_1.default.open) }, filters.map((filter) => (react_1.default.createElement(filter.render, { key: filter.key, components: components, lanes: lanes, className: (0, classnames_1.default)(component_drawer_module_scss_1.default.filter, filterWidgetOpen && component_drawer_module_scss_1.default.open) })))));
|
|
112
|
+
}
|
|
113
|
+
function ComponentsDrawerRenderTree({ components, host, plugins, transformTree, lanesModel, }) {
|
|
114
|
+
const { collapsed } = (0, react_1.useContext)(component_drawer_tree_widget_context_1.ComponentTreeContext);
|
|
115
|
+
const { tree } = plugins;
|
|
116
|
+
const TreeNode = (0, react_1.useMemo)(() => {
|
|
117
|
+
return (tree === null || tree === void 0 ? void 0 : tree.customRenderer) && tree.customRenderer(tree.widgets, host);
|
|
118
|
+
}, [tree === null || tree === void 0 ? void 0 : tree.customRenderer, tree === null || tree === void 0 ? void 0 : tree.widgets.map.size, tree === null || tree === void 0 ? void 0 : tree.widgets.values().length]);
|
|
119
|
+
const isVisible = components.length > 0;
|
|
120
|
+
if (!isVisible)
|
|
121
|
+
return null;
|
|
122
|
+
return (react_1.default.createElement("div", { className: component_drawer_module_scss_1.default.drawerTreeContainer },
|
|
123
|
+
react_1.default.createElement(ui_foundation_ui_side_bar_1.ComponentTree, { transformTree: transformTree ? transformTree(host) : undefined, components: components, isCollapsed: collapsed, TreeNode: TreeNode, lanesModel: lanesModel })));
|
|
124
|
+
}
|
|
125
|
+
function TreeToggleWidget() {
|
|
126
|
+
const { collapsed, setCollapsed } = (0, react_1.useContext)(component_drawer_tree_widget_context_1.ComponentTreeContext);
|
|
127
|
+
const icon = collapsed
|
|
128
|
+
? 'https://static.bit.dev/bit-icons/expand.svg'
|
|
129
|
+
: 'https://static.bit.dev/bit-icons/collapse.svg';
|
|
130
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(component_drawer_module_scss_1.default.widgetIcon, !collapsed && component_drawer_module_scss_1.default.open) },
|
|
131
|
+
react_1.default.createElement("img", { src: icon, onClick: () => setCollapsed(!collapsed) })));
|
|
132
|
+
}
|
|
133
|
+
function FilterWidget() {
|
|
134
|
+
const { filterWidgetOpen, setFilterWidget } = (0, react_1.useContext)(component_drawer_filter_widget_context_1.ComponentFilterWidgetContext);
|
|
135
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(component_drawer_module_scss_1.default.widgetIcon, component_drawer_module_scss_1.default.filterWidget, filterWidgetOpen && component_drawer_module_scss_1.default.open) },
|
|
136
|
+
react_1.default.createElement("img", { src: "https://static.bit.dev/bit-icons/filter.svg", onClick: () => setFilterWidget(!filterWidgetOpen) })));
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=component-drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-drawer.js","sourceRoot":"","sources":["../component-drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoPA,4CAUC;AAED,oCAOC;AAvQD,+CAA8D;AAC9D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C,2DAAoB,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,SAAS;QACpB,CAAC,CAAC,6CAA6C;QAC/C,CAAC,CAAC,+CAA+C,CAAC;IACpD,OAAO,CACL,uCAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,sCAAM,CAAC,UAAU,EAAE,CAAC,SAAS,IAAI,sCAAM,CAAC,IAAI,CAAC;QACtE,uCAAK,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,GAAI,CACvD,CACP,CAAC;AACJ,CAAC;AAED,SAAgB,YAAY;IAC1B,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,IAAA,kBAAU,EAAC,qEAA4B,CAAC,CAAC;IACvF,OAAO,CACL,uCAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,sCAAM,CAAC,UAAU,EAAE,sCAAM,CAAC,YAAY,EAAE,gBAAgB,IAAI,sCAAM,CAAC,IAAI,CAAC;QACjG,uCAAK,GAAG,EAAC,6CAA6C,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,GAAI,CACxG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.drawerContainer {
|
|
2
|
+
height: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.emptyDrawer {
|
|
8
|
+
padding: 8px 8px 0 28px;
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.widgetIcon {
|
|
13
|
+
padding: 4px;
|
|
14
|
+
border-radius: 8px;
|
|
15
|
+
align-items: center;
|
|
16
|
+
display: flex;
|
|
17
|
+
margin-left: 4px;
|
|
18
|
+
|
|
19
|
+
&:hover,
|
|
20
|
+
&.open {
|
|
21
|
+
background-color: var(--bit-border-color-lightest, #ededed);
|
|
22
|
+
}
|
|
23
|
+
img {
|
|
24
|
+
width: 16px;
|
|
25
|
+
}
|
|
26
|
+
&:active img,
|
|
27
|
+
&.open img {
|
|
28
|
+
filter: invert(38%) sepia(33%) saturate(7140%) hue-rotate(234deg) brightness(96%) contrast(87%);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.filterWidgetIcon {
|
|
33
|
+
margin-right: 8px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.filtersContainer {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transition:
|
|
39
|
+
max-height 300ms ease-in-out,
|
|
40
|
+
opacity 250ms ease-in-out;
|
|
41
|
+
max-height: 0;
|
|
42
|
+
border-bottom: 1px solid var(--bit-border-color-lightest, #ededed);
|
|
43
|
+
|
|
44
|
+
&.open {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
max-height: 100%;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.filter {
|
|
51
|
+
display: none;
|
|
52
|
+
&.open {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
margin: 4px 8px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.drawerTreeContainer {
|
|
62
|
+
height: 100%;
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ComponentsDrawer, ComponentsDrawerProps, FilterWidget, TreeToggleWidget, ComponentFiltersSlot, DrawerWidgetSlot, } from './component-drawer';
|
|
2
|
+
export { ComponentFilterWidgetContextType, ComponentFilterWidgetContext, ComponentFilterWidgetProvider, } from './component-drawer-filter-widget.context';
|
|
3
|
+
export { ComponentTreeContextType, ComponentTreeContext, ComponentTreeProvider, } from './component-drawer-tree-widget.context';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentTreeProvider = exports.ComponentTreeContext = exports.ComponentFilterWidgetProvider = exports.ComponentFilterWidgetContext = exports.TreeToggleWidget = exports.FilterWidget = exports.ComponentsDrawer = void 0;
|
|
4
|
+
var component_drawer_1 = require("./component-drawer");
|
|
5
|
+
Object.defineProperty(exports, "ComponentsDrawer", { enumerable: true, get: function () { return component_drawer_1.ComponentsDrawer; } });
|
|
6
|
+
Object.defineProperty(exports, "FilterWidget", { enumerable: true, get: function () { return component_drawer_1.FilterWidget; } });
|
|
7
|
+
Object.defineProperty(exports, "TreeToggleWidget", { enumerable: true, get: function () { return component_drawer_1.TreeToggleWidget; } });
|
|
8
|
+
var component_drawer_filter_widget_context_1 = require("./component-drawer-filter-widget.context");
|
|
9
|
+
Object.defineProperty(exports, "ComponentFilterWidgetContext", { enumerable: true, get: function () { return component_drawer_filter_widget_context_1.ComponentFilterWidgetContext; } });
|
|
10
|
+
Object.defineProperty(exports, "ComponentFilterWidgetProvider", { enumerable: true, get: function () { return component_drawer_filter_widget_context_1.ComponentFilterWidgetProvider; } });
|
|
11
|
+
var component_drawer_tree_widget_context_1 = require("./component-drawer-tree-widget.context");
|
|
12
|
+
Object.defineProperty(exports, "ComponentTreeContext", { enumerable: true, get: function () { return component_drawer_tree_widget_context_1.ComponentTreeContext; } });
|
|
13
|
+
Object.defineProperty(exports, "ComponentTreeProvider", { enumerable: true, get: function () { return component_drawer_tree_widget_context_1.ComponentTreeProvider; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,uDAO4B;AAN1B,oHAAA,gBAAgB,OAAA;AAEhB,gHAAA,YAAY,OAAA;AACZ,oHAAA,gBAAgB,OAAA;AAIlB,mGAIkD;AAFhD,sJAAA,4BAA4B,OAAA;AAC5B,uJAAA,6BAA6B,OAAA;AAE/B,+FAIgD;AAF9C,4IAAA,oBAAoB,OAAA;AACpB,6IAAA,qBAAqB,OAAA"}
|
package/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ComponentsDrawer,
|
|
3
|
+
ComponentsDrawerProps,
|
|
4
|
+
FilterWidget,
|
|
5
|
+
TreeToggleWidget,
|
|
6
|
+
ComponentFiltersSlot,
|
|
7
|
+
DrawerWidgetSlot,
|
|
8
|
+
} from './component-drawer';
|
|
9
|
+
export {
|
|
10
|
+
ComponentFilterWidgetContextType,
|
|
11
|
+
ComponentFilterWidgetContext,
|
|
12
|
+
ComponentFilterWidgetProvider,
|
|
13
|
+
} from './component-drawer-filter-widget.context';
|
|
14
|
+
export {
|
|
15
|
+
ComponentTreeContextType,
|
|
16
|
+
ComponentTreeContext,
|
|
17
|
+
ComponentTreeProvider,
|
|
18
|
+
} from './component-drawer-tree-widget.context';
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/component.ui.component-drawer",
|
|
3
|
+
"version": "0.0.0-749a8f928da2d57edc546f586d491cdfcf30043d",
|
|
4
|
+
"homepage": "https://bit.cloud/teambit/component/ui/component-drawer",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"componentId": {
|
|
7
|
+
"scope": "teambit.component",
|
|
8
|
+
"name": "ui/component-drawer",
|
|
9
|
+
"version": "749a8f928da2d57edc546f586d491cdfcf30043d"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"classnames": "2.2.6",
|
|
13
|
+
"lodash.flatten": "4.4.0",
|
|
14
|
+
"core-js": "^3.0.0",
|
|
15
|
+
"@teambit/base-ui.utils.composer": "1.0.0",
|
|
16
|
+
"@teambit/design.ui.skeletons.sidebar-loader": "0.0.4",
|
|
17
|
+
"@teambit/design.ui.styles.ellipsis": "0.0.357",
|
|
18
|
+
"@teambit/design.ui.styles.muted-italic": "0.0.44",
|
|
19
|
+
"@teambit/harmony": "0.4.7",
|
|
20
|
+
"@teambit/ui-foundation.ui.tree.drawer": "0.0.518",
|
|
21
|
+
"@teambit/design.ui.tree": "0.0.16",
|
|
22
|
+
"@teambit/component.ui.component-filters.component-filter-context": "0.0.238",
|
|
23
|
+
"@teambit/lanes.hooks.use-lanes": "0.0.289",
|
|
24
|
+
"@teambit/lanes.ui.models.lanes-model": "0.0.228",
|
|
25
|
+
"@teambit/scope.models.scope-model": "0.0.528",
|
|
26
|
+
"@teambit/ui-foundation.ui.side-bar": "0.0.0-a9e2edbdd7f2d36a9ebd1ee8d02d04427ed71d54"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/react": "^17.0.8",
|
|
30
|
+
"@types/classnames": "2.2.11",
|
|
31
|
+
"@types/lodash.flatten": "4.4.6",
|
|
32
|
+
"@types/mocha": "9.1.0",
|
|
33
|
+
"@types/node": "12.20.4",
|
|
34
|
+
"@types/react-dom": "^17.0.5",
|
|
35
|
+
"@types/jest": "^26.0.0",
|
|
36
|
+
"@babel/runtime": "7.20.0",
|
|
37
|
+
"@types/testing-library__jest-dom": "5.9.5"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": "^16.8.0 || ^17.0.0",
|
|
41
|
+
"react-dom": "^16.8.0 || ^17.0.0"
|
|
42
|
+
},
|
|
43
|
+
"license": "Apache-2.0",
|
|
44
|
+
"optionalDependencies": {},
|
|
45
|
+
"peerDependenciesMeta": {},
|
|
46
|
+
"private": false,
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=12.22.0"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "https://github.com/teambit/bit"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"bit",
|
|
56
|
+
"components",
|
|
57
|
+
"collaboration",
|
|
58
|
+
"web",
|
|
59
|
+
"react",
|
|
60
|
+
"react-components",
|
|
61
|
+
"angular",
|
|
62
|
+
"angular-components"
|
|
63
|
+
]
|
|
64
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: any;
|
|
3
|
+
export = value;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.svg' {
|
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
+
|
|
8
|
+
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @TODO Gilad
|
|
14
|
+
declare module '*.jpg' {
|
|
15
|
+
const value: any;
|
|
16
|
+
export = value;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.jpeg' {
|
|
19
|
+
const value: any;
|
|
20
|
+
export = value;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const value: any;
|
|
24
|
+
export = value;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.bmp' {
|
|
27
|
+
const value: any;
|
|
28
|
+
export = value;
|
|
29
|
+
}
|
package/types/style.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module '*.module.css' {
|
|
2
|
+
const classes: { readonly [key: string]: string };
|
|
3
|
+
export default classes;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.module.scss' {
|
|
6
|
+
const classes: { readonly [key: string]: string };
|
|
7
|
+
export default classes;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.module.sass' {
|
|
10
|
+
const classes: { readonly [key: string]: string };
|
|
11
|
+
export default classes;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module '*.module.less' {
|
|
15
|
+
const classes: { readonly [key: string]: string };
|
|
16
|
+
export default classes;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '*.less' {
|
|
20
|
+
const classes: { readonly [key: string]: string };
|
|
21
|
+
export default classes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.css' {
|
|
25
|
+
const classes: { readonly [key: string]: string };
|
|
26
|
+
export default classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module '*.sass' {
|
|
30
|
+
const classes: { readonly [key: string]: string };
|
|
31
|
+
export default classes;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module '*.scss' {
|
|
35
|
+
const classes: { readonly [key: string]: string };
|
|
36
|
+
export default classes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module '*.mdx' {
|
|
40
|
+
const component: any;
|
|
41
|
+
export default component;
|
|
42
|
+
}
|