@teambit/component.ui.component-drawer 0.0.0-016445ab72c5ad3afd55bcceac673cc440eb5284
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 +21 -0
- package/component-drawer-tree-widget.context.tsx +17 -0
- package/component-drawer.module.scss +64 -0
- package/component-drawer.tsx +267 -0
- package/dist/component-drawer-filter-widget.context.d.ts +10 -0
- package/dist/component-drawer-filter-widget.context.js +47 -0
- package/dist/component-drawer-filter-widget.context.js.map +1 -0
- package/dist/component-drawer-tree-widget.context.d.ts +10 -0
- package/dist/component-drawer-tree-widget.context.js +47 -0
- package/dist/component-drawer-tree-widget.context.js.map +1 -0
- package/dist/component-drawer.d.ts +67 -0
- package/dist/component-drawer.js +149 -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-1758893929366.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,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React, { createContext, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
export type ComponentFilterWidgetContextType = {
|
|
5
|
+
filterWidgetOpen: boolean;
|
|
6
|
+
setFilterWidget: (open: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const ComponentFilterWidgetContext = createContext<ComponentFilterWidgetContextType>({
|
|
10
|
+
filterWidgetOpen: false,
|
|
11
|
+
setFilterWidget: () => {},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const ComponentFilterWidgetProvider = ({ children }: { children: ReactNode }) => {
|
|
15
|
+
const [filterWidgetOpen, setFilterWidget] = useState<boolean>(false);
|
|
16
|
+
return (
|
|
17
|
+
<ComponentFilterWidgetContext.Provider value={{ filterWidgetOpen, setFilterWidget }}>
|
|
18
|
+
{children}
|
|
19
|
+
</ComponentFilterWidgetContext.Provider>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React, { createContext, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
export type ComponentTreeContextType = {
|
|
5
|
+
collapsed: boolean;
|
|
6
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const ComponentTreeContext = createContext<ComponentTreeContextType>({
|
|
10
|
+
collapsed: true,
|
|
11
|
+
setCollapsed: () => {},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const ComponentTreeProvider = ({ children }: { children: ReactNode }) => {
|
|
15
|
+
const [collapsed, setCollapsed] = useState<boolean>(true);
|
|
16
|
+
return <ComponentTreeContext.Provider value={{ collapsed, setCollapsed }}>{children}</ComponentTreeContext.Provider>;
|
|
17
|
+
};
|
|
@@ -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,267 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React, { useContext, useMemo } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { ComponentTree } from '@teambit/ui-foundation.ui.side-bar';
|
|
5
|
+
import type { PayloadType } from '@teambit/ui-foundation.ui.side-bar';
|
|
6
|
+
import type { ComponentTreeSlot } from '@teambit/component-tree';
|
|
7
|
+
import type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';
|
|
8
|
+
import { mutedItalic } from '@teambit/design.ui.styles.muted-italic';
|
|
9
|
+
import { ellipsis } from '@teambit/design.ui.styles.ellipsis';
|
|
10
|
+
import type { ComponentModel } from '@teambit/component';
|
|
11
|
+
import type { TreeNode as TreeNodeType, TreeNodeRenderer } from '@teambit/design.ui.tree';
|
|
12
|
+
import type { ComponentTuple } from '@teambit/base-ui.utils.composer';
|
|
13
|
+
import { Composer } from '@teambit/base-ui.utils.composer';
|
|
14
|
+
import flatten from 'lodash.flatten';
|
|
15
|
+
import type { ComponentFilters } from '@teambit/component.ui.component-filters.component-filter-context';
|
|
16
|
+
import {
|
|
17
|
+
ComponentFiltersProvider,
|
|
18
|
+
ComponentFilterContext,
|
|
19
|
+
runAllFilters,
|
|
20
|
+
} from '@teambit/component.ui.component-filters.component-filter-context';
|
|
21
|
+
import { useLanes } from '@teambit/lanes.hooks.use-lanes';
|
|
22
|
+
import type { LanesModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
23
|
+
import type { SlotRegistry } from '@teambit/harmony';
|
|
24
|
+
import type { ScopeModel } from '@teambit/scope.models.scope-model';
|
|
25
|
+
import type { WorkspaceModel } from '@teambit/workspace';
|
|
26
|
+
import { ComponentTreeLoader } from '@teambit/design.ui.skeletons.sidebar-loader';
|
|
27
|
+
import { ComponentFilterWidgetProvider, ComponentFilterWidgetContext } from './component-drawer-filter-widget.context';
|
|
28
|
+
import { ComponentTreeContext, ComponentTreeProvider } from './component-drawer-tree-widget.context';
|
|
29
|
+
|
|
30
|
+
import styles from './component-drawer.module.scss';
|
|
31
|
+
|
|
32
|
+
export type ComponentFiltersSlot = SlotRegistry<ComponentFilters>;
|
|
33
|
+
export type DrawerWidgetSlot = SlotRegistry<ReactNode[]>;
|
|
34
|
+
export type TransformTreeFn = (host?: WorkspaceModel | ScopeModel) => (rootNode: TreeNodeType) => TreeNodeType;
|
|
35
|
+
|
|
36
|
+
export type ComponentsDrawerProps = Omit<DrawerType, 'render'> & {
|
|
37
|
+
useComponents: () => { components: ComponentModel[]; loading?: boolean };
|
|
38
|
+
useLanes?: () => { lanesModel?: LanesModel; loading?: boolean };
|
|
39
|
+
emptyMessage?: ReactNode;
|
|
40
|
+
plugins?: ComponentsDrawerPlugins;
|
|
41
|
+
transformTree?: TransformTreeFn;
|
|
42
|
+
assumeScopeInUrl?: boolean;
|
|
43
|
+
useHost?: () => ScopeModel | WorkspaceModel;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type ComponentsDrawerPlugins = {
|
|
47
|
+
tree?: {
|
|
48
|
+
customRenderer?: (
|
|
49
|
+
treeNodeSlot?: ComponentTreeSlot,
|
|
50
|
+
host?: ScopeModel | WorkspaceModel
|
|
51
|
+
) => TreeNodeRenderer<PayloadType>;
|
|
52
|
+
widgets: ComponentTreeSlot;
|
|
53
|
+
};
|
|
54
|
+
filters?: ComponentFiltersSlot;
|
|
55
|
+
drawerWidgets?: DrawerWidgetSlot;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export class ComponentsDrawer implements DrawerType {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly useComponents: () => { components: ComponentModel[]; loading?: boolean };
|
|
61
|
+
readonly useLanes: () => { lanesModel?: LanesModel; loading?: boolean };
|
|
62
|
+
name: ReactNode;
|
|
63
|
+
tooltip?: string;
|
|
64
|
+
order?: number;
|
|
65
|
+
isHidden?: () => boolean;
|
|
66
|
+
emptyMessage?: ReactNode;
|
|
67
|
+
widgets: ReactNode[];
|
|
68
|
+
plugins: ComponentsDrawerPlugins;
|
|
69
|
+
assumeScopeInUrl: boolean;
|
|
70
|
+
useHost?: () => ScopeModel | WorkspaceModel;
|
|
71
|
+
transformTree?: TransformTreeFn;
|
|
72
|
+
|
|
73
|
+
constructor(props: ComponentsDrawerProps) {
|
|
74
|
+
Object.assign(this, props);
|
|
75
|
+
this.useComponents = props.useComponents;
|
|
76
|
+
this.useLanes = props.useLanes || useLanes;
|
|
77
|
+
this.emptyMessage = props.emptyMessage;
|
|
78
|
+
this.plugins = props.plugins || {};
|
|
79
|
+
this.setWidgets(props.plugins?.drawerWidgets);
|
|
80
|
+
this.assumeScopeInUrl = props.assumeScopeInUrl || false;
|
|
81
|
+
this.useHost = props.useHost;
|
|
82
|
+
this.transformTree = props.transformTree;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
Context = ({ children }) => {
|
|
86
|
+
const filters = flatten(this.plugins?.filters?.values() || []);
|
|
87
|
+
const combinedContexts = [
|
|
88
|
+
ComponentTreeProvider,
|
|
89
|
+
ComponentFilterWidgetProvider,
|
|
90
|
+
[ComponentFiltersProvider, { filters }] as ComponentTuple<{ children?: ReactNode; filters: any }>,
|
|
91
|
+
];
|
|
92
|
+
return <Composer components={combinedContexts}>{children}</Composer>;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
setWidgets = (widgets?: DrawerWidgetSlot) => {
|
|
96
|
+
this.widgets = flatten(widgets?.values());
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
render = () => {
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
101
|
+
const { useComponents, useLanes: useLanesFromInstance, emptyMessage, plugins, transformTree, useHost, id } = this;
|
|
102
|
+
return (
|
|
103
|
+
<ComponentsDrawerContent
|
|
104
|
+
useComponents={useComponents}
|
|
105
|
+
useLanes={useLanesFromInstance}
|
|
106
|
+
emptyMessage={emptyMessage}
|
|
107
|
+
plugins={plugins}
|
|
108
|
+
transformTree={transformTree}
|
|
109
|
+
useHost={useHost}
|
|
110
|
+
id={id}
|
|
111
|
+
/>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function ComponentsDrawerContent({
|
|
117
|
+
useComponents,
|
|
118
|
+
useLanes: useLanesFromProps,
|
|
119
|
+
emptyMessage,
|
|
120
|
+
plugins,
|
|
121
|
+
transformTree,
|
|
122
|
+
useHost,
|
|
123
|
+
id,
|
|
124
|
+
}: {
|
|
125
|
+
useComponents: () => { components: ComponentModel[]; loading?: boolean };
|
|
126
|
+
useLanes: () => { lanesModel?: LanesModel; loading?: boolean };
|
|
127
|
+
emptyMessage: ReactNode;
|
|
128
|
+
plugins: ComponentsDrawerPlugins;
|
|
129
|
+
transformTree?: TransformTreeFn;
|
|
130
|
+
useHost?: () => ScopeModel | WorkspaceModel;
|
|
131
|
+
id: string;
|
|
132
|
+
}) {
|
|
133
|
+
const { loading: loadingComponents, components } = useComponents();
|
|
134
|
+
const { lanesModel: lanes, loading: loadingLanesModel } = useLanesFromProps();
|
|
135
|
+
const componentFiltersContext = useContext(ComponentFilterContext);
|
|
136
|
+
const filters = componentFiltersContext?.filters || [];
|
|
137
|
+
const host = useHost?.();
|
|
138
|
+
|
|
139
|
+
const filteredComponents = useMemo(() => {
|
|
140
|
+
if (!filters.length) return components;
|
|
141
|
+
return runAllFilters(filters, { components, lanes });
|
|
142
|
+
}, [filters, components.length, lanes?.lanes.length, lanes?.viewedLane?.id.toString(), loadingLanesModel]);
|
|
143
|
+
|
|
144
|
+
const Filters = <ComponentsDrawerRenderFilters components={components} lanes={lanes} plugins={plugins} />;
|
|
145
|
+
|
|
146
|
+
const Tree = (
|
|
147
|
+
<ComponentsDrawerRenderTree
|
|
148
|
+
components={filteredComponents}
|
|
149
|
+
host={host}
|
|
150
|
+
plugins={plugins}
|
|
151
|
+
transformTree={transformTree}
|
|
152
|
+
lanesModel={lanes}
|
|
153
|
+
/>
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
const emptyDrawer = <span className={classNames(mutedItalic, ellipsis, styles.emptyDrawer)}>{emptyMessage}</span>;
|
|
157
|
+
|
|
158
|
+
const loading = loadingComponents || loadingLanesModel || !lanes || !components;
|
|
159
|
+
|
|
160
|
+
if (loading) return <ComponentTreeLoader />;
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<div key={id} className={styles.drawerContainer}>
|
|
164
|
+
{Filters}
|
|
165
|
+
{Tree}
|
|
166
|
+
{filteredComponents.length === 0 && emptyDrawer}
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function ComponentsDrawerRenderFilters({
|
|
172
|
+
components,
|
|
173
|
+
lanes,
|
|
174
|
+
plugins,
|
|
175
|
+
}: {
|
|
176
|
+
components: ComponentModel[];
|
|
177
|
+
lanes?: LanesModel;
|
|
178
|
+
plugins: ComponentsDrawerPlugins;
|
|
179
|
+
}) {
|
|
180
|
+
const { filterWidgetOpen } = useContext(ComponentFilterWidgetContext);
|
|
181
|
+
const filterPlugins = plugins.filters;
|
|
182
|
+
|
|
183
|
+
const filters = useMemo(
|
|
184
|
+
() =>
|
|
185
|
+
(filterPlugins &&
|
|
186
|
+
flatten(
|
|
187
|
+
filterPlugins.toArray().map(([key, filtersByKey]) => {
|
|
188
|
+
return filtersByKey.map((filter) => ({ ...filter, key: `${key}-${filter.id}` }));
|
|
189
|
+
})
|
|
190
|
+
).sort((a, b) => (a.order ?? 0) - (b.order ?? 0))) ||
|
|
191
|
+
[],
|
|
192
|
+
[filterPlugins?.map.size, filterPlugins?.values()?.length]
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
if (!filters.length) return null;
|
|
196
|
+
|
|
197
|
+
return (
|
|
198
|
+
<div className={classNames(styles.filtersContainer, filterWidgetOpen && styles.open)}>
|
|
199
|
+
{filters.map((filter) => (
|
|
200
|
+
<filter.render
|
|
201
|
+
key={filter.key}
|
|
202
|
+
components={components}
|
|
203
|
+
lanes={lanes}
|
|
204
|
+
className={classNames(styles.filter, filterWidgetOpen && styles.open)}
|
|
205
|
+
/>
|
|
206
|
+
))}
|
|
207
|
+
</div>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function ComponentsDrawerRenderTree({
|
|
212
|
+
components,
|
|
213
|
+
host,
|
|
214
|
+
plugins,
|
|
215
|
+
transformTree,
|
|
216
|
+
lanesModel,
|
|
217
|
+
}: {
|
|
218
|
+
components: ComponentModel[];
|
|
219
|
+
host?: ScopeModel | WorkspaceModel;
|
|
220
|
+
plugins: ComponentsDrawerPlugins;
|
|
221
|
+
transformTree?: TransformTreeFn;
|
|
222
|
+
lanesModel?: LanesModel;
|
|
223
|
+
}) {
|
|
224
|
+
const { collapsed } = useContext(ComponentTreeContext);
|
|
225
|
+
const { tree } = plugins;
|
|
226
|
+
|
|
227
|
+
const TreeNode = useMemo(() => {
|
|
228
|
+
return tree?.customRenderer && tree.customRenderer(tree.widgets, host);
|
|
229
|
+
}, [tree?.customRenderer, tree?.widgets.map.size, tree?.widgets.values().length]);
|
|
230
|
+
|
|
231
|
+
const isVisible = components.length > 0;
|
|
232
|
+
|
|
233
|
+
if (!isVisible) return null;
|
|
234
|
+
|
|
235
|
+
return (
|
|
236
|
+
<div className={styles.drawerTreeContainer}>
|
|
237
|
+
<ComponentTree
|
|
238
|
+
transformTree={transformTree ? transformTree(host) : undefined}
|
|
239
|
+
components={components}
|
|
240
|
+
isCollapsed={collapsed}
|
|
241
|
+
TreeNode={TreeNode}
|
|
242
|
+
lanesModel={lanesModel}
|
|
243
|
+
/>
|
|
244
|
+
</div>
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export function TreeToggleWidget() {
|
|
249
|
+
const { collapsed, setCollapsed } = useContext(ComponentTreeContext);
|
|
250
|
+
const icon = collapsed
|
|
251
|
+
? 'https://static.bit.dev/bit-icons/expand.svg'
|
|
252
|
+
: 'https://static.bit.dev/bit-icons/collapse.svg';
|
|
253
|
+
return (
|
|
254
|
+
<div className={classNames(styles.widgetIcon, !collapsed && styles.open)}>
|
|
255
|
+
<img src={icon} onClick={() => setCollapsed(!collapsed)} />
|
|
256
|
+
</div>
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export function FilterWidget() {
|
|
261
|
+
const { filterWidgetOpen, setFilterWidget } = useContext(ComponentFilterWidgetContext);
|
|
262
|
+
return (
|
|
263
|
+
<div className={classNames(styles.widgetIcon, styles.filterWidget, filterWidgetOpen && styles.open)}>
|
|
264
|
+
<img src="https://static.bit.dev/bit-icons/filter.svg" onClick={() => setFilterWidget(!filterWidgetOpen)} />
|
|
265
|
+
</div>
|
|
266
|
+
);
|
|
267
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type ComponentFilterWidgetContextType = {
|
|
4
|
+
filterWidgetOpen: boolean;
|
|
5
|
+
setFilterWidget: (open: boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const ComponentFilterWidgetContext: React.Context<ComponentFilterWidgetContextType>;
|
|
8
|
+
export declare const ComponentFilterWidgetProvider: ({ children }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ComponentFilterWidgetProvider = exports.ComponentFilterWidgetContext = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
exports.ComponentFilterWidgetContext = (0, react_1.createContext)({
|
|
39
|
+
filterWidgetOpen: false,
|
|
40
|
+
setFilterWidget: () => { },
|
|
41
|
+
});
|
|
42
|
+
const ComponentFilterWidgetProvider = ({ children }) => {
|
|
43
|
+
const [filterWidgetOpen, setFilterWidget] = (0, react_1.useState)(false);
|
|
44
|
+
return (react_1.default.createElement(exports.ComponentFilterWidgetContext.Provider, { value: { filterWidgetOpen, setFilterWidget } }, children));
|
|
45
|
+
};
|
|
46
|
+
exports.ComponentFilterWidgetProvider = ComponentFilterWidgetProvider;
|
|
47
|
+
//# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAuD;AAO1C,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,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type ComponentTreeContextType = {
|
|
4
|
+
collapsed: boolean;
|
|
5
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const ComponentTreeContext: React.Context<ComponentTreeContextType>;
|
|
8
|
+
export declare const ComponentTreeProvider: ({ children }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ComponentTreeProvider = exports.ComponentTreeContext = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
exports.ComponentTreeContext = (0, react_1.createContext)({
|
|
39
|
+
collapsed: true,
|
|
40
|
+
setCollapsed: () => { },
|
|
41
|
+
});
|
|
42
|
+
const ComponentTreeProvider = ({ children }) => {
|
|
43
|
+
const [collapsed, setCollapsed] = (0, react_1.useState)(true);
|
|
44
|
+
return react_1.default.createElement(exports.ComponentTreeContext.Provider, { value: { collapsed, setCollapsed } }, children);
|
|
45
|
+
};
|
|
46
|
+
exports.ComponentTreeProvider = ComponentTreeProvider;
|
|
47
|
+
//# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAuD;AAO1C,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,67 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { PayloadType } from '@teambit/ui-foundation.ui.side-bar';
|
|
4
|
+
import type { ComponentTreeSlot } from '@teambit/component-tree';
|
|
5
|
+
import type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';
|
|
6
|
+
import type { ComponentModel } from '@teambit/component';
|
|
7
|
+
import type { TreeNode as TreeNodeType, TreeNodeRenderer } from '@teambit/design.ui.tree';
|
|
8
|
+
import type { ComponentFilters } from '@teambit/component.ui.component-filters.component-filter-context';
|
|
9
|
+
import type { LanesModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
10
|
+
import type { SlotRegistry } from '@teambit/harmony';
|
|
11
|
+
import type { ScopeModel } from '@teambit/scope.models.scope-model';
|
|
12
|
+
import type { WorkspaceModel } from '@teambit/workspace';
|
|
13
|
+
export type ComponentFiltersSlot = SlotRegistry<ComponentFilters>;
|
|
14
|
+
export type DrawerWidgetSlot = SlotRegistry<ReactNode[]>;
|
|
15
|
+
export type TransformTreeFn = (host?: WorkspaceModel | ScopeModel) => (rootNode: TreeNodeType) => TreeNodeType;
|
|
16
|
+
export type ComponentsDrawerProps = Omit<DrawerType, 'render'> & {
|
|
17
|
+
useComponents: () => {
|
|
18
|
+
components: ComponentModel[];
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
};
|
|
21
|
+
useLanes?: () => {
|
|
22
|
+
lanesModel?: LanesModel;
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
};
|
|
25
|
+
emptyMessage?: ReactNode;
|
|
26
|
+
plugins?: ComponentsDrawerPlugins;
|
|
27
|
+
transformTree?: TransformTreeFn;
|
|
28
|
+
assumeScopeInUrl?: boolean;
|
|
29
|
+
useHost?: () => ScopeModel | WorkspaceModel;
|
|
30
|
+
};
|
|
31
|
+
export type ComponentsDrawerPlugins = {
|
|
32
|
+
tree?: {
|
|
33
|
+
customRenderer?: (treeNodeSlot?: ComponentTreeSlot, host?: ScopeModel | WorkspaceModel) => TreeNodeRenderer<PayloadType>;
|
|
34
|
+
widgets: ComponentTreeSlot;
|
|
35
|
+
};
|
|
36
|
+
filters?: ComponentFiltersSlot;
|
|
37
|
+
drawerWidgets?: DrawerWidgetSlot;
|
|
38
|
+
};
|
|
39
|
+
export declare class ComponentsDrawer implements DrawerType {
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly useComponents: () => {
|
|
42
|
+
components: ComponentModel[];
|
|
43
|
+
loading?: boolean;
|
|
44
|
+
};
|
|
45
|
+
readonly useLanes: () => {
|
|
46
|
+
lanesModel?: LanesModel;
|
|
47
|
+
loading?: boolean;
|
|
48
|
+
};
|
|
49
|
+
name: ReactNode;
|
|
50
|
+
tooltip?: string;
|
|
51
|
+
order?: number;
|
|
52
|
+
isHidden?: () => boolean;
|
|
53
|
+
emptyMessage?: ReactNode;
|
|
54
|
+
widgets: ReactNode[];
|
|
55
|
+
plugins: ComponentsDrawerPlugins;
|
|
56
|
+
assumeScopeInUrl: boolean;
|
|
57
|
+
useHost?: () => ScopeModel | WorkspaceModel;
|
|
58
|
+
transformTree?: TransformTreeFn;
|
|
59
|
+
constructor(props: ComponentsDrawerProps);
|
|
60
|
+
Context: ({ children }: {
|
|
61
|
+
children: any;
|
|
62
|
+
}) => React.JSX.Element;
|
|
63
|
+
setWidgets: (widgets?: DrawerWidgetSlot) => void;
|
|
64
|
+
render: () => React.JSX.Element;
|
|
65
|
+
}
|
|
66
|
+
export declare function TreeToggleWidget(): React.JSX.Element;
|
|
67
|
+
export declare function FilterWidget(): React.JSX.Element;
|
|
@@ -0,0 +1,149 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ComponentsDrawer = void 0;
|
|
40
|
+
exports.TreeToggleWidget = TreeToggleWidget;
|
|
41
|
+
exports.FilterWidget = FilterWidget;
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
44
|
+
const ui_foundation_ui_side_bar_1 = require("@teambit/ui-foundation.ui.side-bar");
|
|
45
|
+
const design_ui_styles_muted_italic_1 = require("@teambit/design.ui.styles.muted-italic");
|
|
46
|
+
const design_ui_styles_ellipsis_1 = require("@teambit/design.ui.styles.ellipsis");
|
|
47
|
+
const base_ui_utils_composer_1 = require("@teambit/base-ui.utils.composer");
|
|
48
|
+
const lodash_flatten_1 = __importDefault(require("lodash.flatten"));
|
|
49
|
+
const component_ui_component_filters_component_filter_context_1 = require("@teambit/component.ui.component-filters.component-filter-context");
|
|
50
|
+
const lanes_hooks_use_lanes_1 = require("@teambit/lanes.hooks.use-lanes");
|
|
51
|
+
const design_ui_skeletons_sidebar_loader_1 = require("@teambit/design.ui.skeletons.sidebar-loader");
|
|
52
|
+
const component_drawer_filter_widget_context_1 = require("./component-drawer-filter-widget.context");
|
|
53
|
+
const component_drawer_tree_widget_context_1 = require("./component-drawer-tree-widget.context");
|
|
54
|
+
const component_drawer_module_scss_1 = __importDefault(require("./component-drawer.module.scss"));
|
|
55
|
+
class ComponentsDrawer {
|
|
56
|
+
constructor(props) {
|
|
57
|
+
var _a;
|
|
58
|
+
this.Context = ({ children }) => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
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()) || []);
|
|
61
|
+
const combinedContexts = [
|
|
62
|
+
component_drawer_tree_widget_context_1.ComponentTreeProvider,
|
|
63
|
+
component_drawer_filter_widget_context_1.ComponentFilterWidgetProvider,
|
|
64
|
+
[component_ui_component_filters_component_filter_context_1.ComponentFiltersProvider, { filters }],
|
|
65
|
+
];
|
|
66
|
+
return react_1.default.createElement(base_ui_utils_composer_1.Composer, { components: combinedContexts }, children);
|
|
67
|
+
};
|
|
68
|
+
this.setWidgets = (widgets) => {
|
|
69
|
+
this.widgets = (0, lodash_flatten_1.default)(widgets === null || widgets === void 0 ? void 0 : widgets.values());
|
|
70
|
+
};
|
|
71
|
+
this.render = () => {
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
73
|
+
const { useComponents, useLanes: useLanesFromInstance, emptyMessage, plugins, transformTree, useHost, id } = this;
|
|
74
|
+
return (react_1.default.createElement(ComponentsDrawerContent, { useComponents: useComponents, useLanes: useLanesFromInstance, emptyMessage: emptyMessage, plugins: plugins, transformTree: transformTree, useHost: useHost, id: id }));
|
|
75
|
+
};
|
|
76
|
+
Object.assign(this, props);
|
|
77
|
+
this.useComponents = props.useComponents;
|
|
78
|
+
this.useLanes = props.useLanes || lanes_hooks_use_lanes_1.useLanes;
|
|
79
|
+
this.emptyMessage = props.emptyMessage;
|
|
80
|
+
this.plugins = props.plugins || {};
|
|
81
|
+
this.setWidgets((_a = props.plugins) === null || _a === void 0 ? void 0 : _a.drawerWidgets);
|
|
82
|
+
this.assumeScopeInUrl = props.assumeScopeInUrl || false;
|
|
83
|
+
this.useHost = props.useHost;
|
|
84
|
+
this.transformTree = props.transformTree;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.ComponentsDrawer = ComponentsDrawer;
|
|
88
|
+
function ComponentsDrawerContent({ useComponents, useLanes: useLanesFromProps, emptyMessage, plugins, transformTree, useHost, id, }) {
|
|
89
|
+
var _a;
|
|
90
|
+
const { loading: loadingComponents, components } = useComponents();
|
|
91
|
+
const { lanesModel: lanes, loading: loadingLanesModel } = useLanesFromProps();
|
|
92
|
+
const componentFiltersContext = (0, react_1.useContext)(component_ui_component_filters_component_filter_context_1.ComponentFilterContext);
|
|
93
|
+
const filters = (componentFiltersContext === null || componentFiltersContext === void 0 ? void 0 : componentFiltersContext.filters) || [];
|
|
94
|
+
const host = useHost === null || useHost === void 0 ? void 0 : useHost();
|
|
95
|
+
const filteredComponents = (0, react_1.useMemo)(() => {
|
|
96
|
+
if (!filters.length)
|
|
97
|
+
return components;
|
|
98
|
+
return (0, component_ui_component_filters_component_filter_context_1.runAllFilters)(filters, { components, lanes });
|
|
99
|
+
}, [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]);
|
|
100
|
+
const Filters = react_1.default.createElement(ComponentsDrawerRenderFilters, { components: components, lanes: lanes, plugins: plugins });
|
|
101
|
+
const Tree = (react_1.default.createElement(ComponentsDrawerRenderTree, { components: filteredComponents, host: host, plugins: plugins, transformTree: transformTree, lanesModel: lanes }));
|
|
102
|
+
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);
|
|
103
|
+
const loading = loadingComponents || loadingLanesModel || !lanes || !components;
|
|
104
|
+
if (loading)
|
|
105
|
+
return react_1.default.createElement(design_ui_skeletons_sidebar_loader_1.ComponentTreeLoader, null);
|
|
106
|
+
return (react_1.default.createElement("div", { key: id, className: component_drawer_module_scss_1.default.drawerContainer },
|
|
107
|
+
Filters,
|
|
108
|
+
Tree,
|
|
109
|
+
filteredComponents.length === 0 && emptyDrawer));
|
|
110
|
+
}
|
|
111
|
+
function ComponentsDrawerRenderFilters({ components, lanes, plugins, }) {
|
|
112
|
+
var _a;
|
|
113
|
+
const { filterWidgetOpen } = (0, react_1.useContext)(component_drawer_filter_widget_context_1.ComponentFilterWidgetContext);
|
|
114
|
+
const filterPlugins = plugins.filters;
|
|
115
|
+
const filters = (0, react_1.useMemo)(() => (filterPlugins &&
|
|
116
|
+
(0, lodash_flatten_1.default)(filterPlugins.toArray().map(([key, filtersByKey]) => {
|
|
117
|
+
return filtersByKey.map((filter) => (Object.assign(Object.assign({}, filter), { key: `${key}-${filter.id}` })));
|
|
118
|
+
})).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); })) ||
|
|
119
|
+
[], [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]);
|
|
120
|
+
if (!filters.length)
|
|
121
|
+
return null;
|
|
122
|
+
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) })))));
|
|
123
|
+
}
|
|
124
|
+
function ComponentsDrawerRenderTree({ components, host, plugins, transformTree, lanesModel, }) {
|
|
125
|
+
const { collapsed } = (0, react_1.useContext)(component_drawer_tree_widget_context_1.ComponentTreeContext);
|
|
126
|
+
const { tree } = plugins;
|
|
127
|
+
const TreeNode = (0, react_1.useMemo)(() => {
|
|
128
|
+
return (tree === null || tree === void 0 ? void 0 : tree.customRenderer) && tree.customRenderer(tree.widgets, host);
|
|
129
|
+
}, [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]);
|
|
130
|
+
const isVisible = components.length > 0;
|
|
131
|
+
if (!isVisible)
|
|
132
|
+
return null;
|
|
133
|
+
return (react_1.default.createElement("div", { className: component_drawer_module_scss_1.default.drawerTreeContainer },
|
|
134
|
+
react_1.default.createElement(ui_foundation_ui_side_bar_1.ComponentTree, { transformTree: transformTree ? transformTree(host) : undefined, components: components, isCollapsed: collapsed, TreeNode: TreeNode, lanesModel: lanesModel })));
|
|
135
|
+
}
|
|
136
|
+
function TreeToggleWidget() {
|
|
137
|
+
const { collapsed, setCollapsed } = (0, react_1.useContext)(component_drawer_tree_widget_context_1.ComponentTreeContext);
|
|
138
|
+
const icon = collapsed
|
|
139
|
+
? 'https://static.bit.dev/bit-icons/expand.svg'
|
|
140
|
+
: 'https://static.bit.dev/bit-icons/collapse.svg';
|
|
141
|
+
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) },
|
|
142
|
+
react_1.default.createElement("img", { src: icon, onClick: () => setCollapsed(!collapsed) })));
|
|
143
|
+
}
|
|
144
|
+
function FilterWidget() {
|
|
145
|
+
const { filterWidgetOpen, setFilterWidget } = (0, react_1.useContext)(component_drawer_filter_widget_context_1.ComponentFilterWidgetContext);
|
|
146
|
+
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) },
|
|
147
|
+
react_1.default.createElement("img", { src: "https://static.bit.dev/bit-icons/filter.svg", onClick: () => setFilterWidget(!filterWidgetOpen) })));
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=component-drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-drawer.js","sourceRoot":"","sources":["../component-drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuPA,4CAUC;AAED,oCAOC;AAzQD,+CAAmD;AACnD,4DAAoC;AACpC,kFAAmE;AAInE,0FAAqE;AACrE,kFAA8D;AAI9D,4EAA2D;AAC3D,oEAAqC;AAErC,8IAI0E;A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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-016445ab72c5ad3afd55bcceac673cc440eb5284",
|
|
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": "016445ab72c5ad3afd55bcceac673cc440eb5284"
|
|
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/component.ui.component-filters.component-filter-context": "0.0.239",
|
|
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/lanes.hooks.use-lanes": "0.0.290",
|
|
21
|
+
"@teambit/lanes.ui.models.lanes-model": "0.0.229",
|
|
22
|
+
"@teambit/ui-foundation.ui.tree.drawer": "0.0.518",
|
|
23
|
+
"@teambit/design.ui.skeletons.sidebar-loader": "0.0.5",
|
|
24
|
+
"@teambit/design.ui.tree": "0.0.16",
|
|
25
|
+
"@teambit/scope.models.scope-model": "0.0.0-9d31f2c0b8650aa110f596219082790e4695d975",
|
|
26
|
+
"@teambit/ui-foundation.ui.side-bar": "0.0.0-867b17499c4fbc9bab5a9197aeb88f7cd2e2b411"
|
|
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
|
+
}
|