@teambit/workspace 1.0.983 → 1.0.985
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{preview-1778621260574.js → preview-1778686821215.js} +2 -2
- package/dist/ui/workspace/use-workspace.d.ts +7 -6
- package/dist/ui/workspace/workspace-overview/card-overlays.d.ts +4 -0
- package/dist/ui/workspace/workspace-overview/card-overlays.js +133 -0
- package/dist/ui/workspace/workspace-overview/card-overlays.js.map +1 -0
- package/dist/ui/workspace/workspace-overview/card-overlays.module.scss +72 -0
- package/dist/ui/workspace/workspace-overview/filter-utils.d.ts +4 -1
- package/dist/ui/workspace/workspace-overview/filter-utils.js +17 -1
- package/dist/ui/workspace/workspace-overview/filter-utils.js.map +1 -1
- package/dist/ui/workspace/workspace-overview/hope-component-card.d.ts +14 -0
- package/dist/ui/workspace/workspace-overview/hope-component-card.js +186 -0
- package/dist/ui/workspace/workspace-overview/hope-component-card.js.map +1 -0
- package/dist/ui/workspace/workspace-overview/hope-component-card.module.scss +162 -0
- package/dist/ui/workspace/workspace-overview/namespace-header.d.ts +8 -0
- package/dist/ui/workspace/workspace-overview/namespace-header.js +107 -0
- package/dist/ui/workspace/workspace-overview/namespace-header.js.map +1 -0
- package/dist/ui/workspace/workspace-overview/namespace-header.module.scss +88 -0
- package/dist/ui/workspace/workspace-overview/use-workspace-aggregation.js +11 -5
- package/dist/ui/workspace/workspace-overview/use-workspace-aggregation.js.map +1 -1
- package/dist/ui/workspace/workspace-overview/workspace-filter-panel.js +8 -6
- package/dist/ui/workspace/workspace-overview/workspace-filter-panel.js.map +1 -1
- package/dist/ui/workspace/workspace-overview/workspace-overview.d.ts +0 -6
- package/dist/ui/workspace/workspace-overview/workspace-overview.js +38 -105
- package/dist/ui/workspace/workspace-overview/workspace-overview.js.map +1 -1
- package/dist/ui/workspace/workspace-overview/workspace-overview.module.scss +38 -158
- package/dist/ui/workspace/workspace-overview/workspace-overview.types.d.ts +6 -0
- package/dist/ui/workspace/workspace-overview/workspace-overview.types.js.map +1 -1
- package/dist/ui/workspace/workspace.js +22 -5
- package/dist/ui/workspace/workspace.js.map +1 -1
- package/dist/ui/workspace/workspace.module.scss +38 -30
- package/package.json +43 -44
- package/ui/workspace/workspace-overview/card-overlays.module.scss +72 -0
- package/ui/workspace/workspace-overview/card-overlays.tsx +66 -0
- package/ui/workspace/workspace-overview/filter-utils.ts +18 -1
- package/ui/workspace/workspace-overview/hope-component-card.module.scss +162 -0
- package/ui/workspace/workspace-overview/hope-component-card.tsx +152 -0
- package/ui/workspace/workspace-overview/namespace-header.module.scss +88 -0
- package/ui/workspace/workspace-overview/namespace-header.tsx +72 -0
- package/ui/workspace/workspace-overview/use-workspace-aggregation.ts +11 -5
- package/ui/workspace/workspace-overview/workspace-filter-panel.tsx +10 -9
- package/ui/workspace/workspace-overview/workspace-overview.module.scss +38 -158
- package/ui/workspace/workspace-overview/workspace-overview.tsx +40 -88
- package/ui/workspace/workspace-overview/workspace-overview.types.ts +7 -1
- package/ui/workspace/workspace.module.scss +38 -30
- package/ui/workspace/workspace.tsx +24 -7
|
@@ -1,211 +1,91 @@
|
|
|
1
1
|
@import '@teambit/ui-foundation.ui.constants.z-indexes/z-indexes.module.scss';
|
|
2
2
|
|
|
3
3
|
.container {
|
|
4
|
-
padding: 24px 5% 150px 5%;
|
|
5
4
|
overflow-y: auto;
|
|
6
5
|
height: 100%;
|
|
7
6
|
box-sizing: border-box;
|
|
8
7
|
z-index: 1;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
align-items: flex-end;
|
|
14
|
-
justify-content: flex-end;
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 100%;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.envIcon {
|
|
20
|
-
height: 14px;
|
|
10
|
+
.content {
|
|
11
|
+
padding: 20px 40px 80px;
|
|
21
12
|
}
|
|
22
13
|
|
|
23
|
-
|
|
24
|
-
background-color: var(--surface-color);
|
|
25
|
-
padding: 4px;
|
|
26
|
-
height: 15px;
|
|
27
|
-
margin-right: 4px;
|
|
28
|
-
z-index: $nav-z-index;
|
|
29
|
-
border-radius: 8px;
|
|
30
|
-
margin-bottom: 4px;
|
|
31
|
-
box-shadow: 0px 2px 18px rgb(0 0 0 / 10%);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.cardGrid {
|
|
35
|
-
display: grid;
|
|
36
|
-
gap: 32px 24px;
|
|
37
|
-
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
|
|
38
|
-
max-width: 1280px;
|
|
39
|
-
grid-column-gap: 28px;
|
|
40
|
-
grid-row-gap: 32px;
|
|
41
|
-
}
|
|
14
|
+
/* ---- Command bar ---- */
|
|
42
15
|
|
|
43
|
-
.
|
|
16
|
+
.commandBar {
|
|
44
17
|
display: flex;
|
|
45
18
|
align-items: center;
|
|
46
19
|
justify-content: space-between;
|
|
47
|
-
|
|
48
|
-
|
|
20
|
+
gap: 12px;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
padding: 12px 40px;
|
|
23
|
+
background: color-mix(in srgb, var(--bit-accent-color, #6c5ce7) 3%, var(--background-color, #fff));
|
|
24
|
+
border-bottom: 1px solid var(--border-medium-color);
|
|
25
|
+
position: sticky;
|
|
26
|
+
top: 0;
|
|
49
27
|
z-index: $modal-z-index - 1;
|
|
50
28
|
}
|
|
51
29
|
|
|
52
|
-
.
|
|
53
|
-
display: inline-flex;
|
|
54
|
-
background: var(--surface-1-color);
|
|
55
|
-
border: 1px solid var(--border-medium-color);
|
|
56
|
-
border-radius: 8px;
|
|
57
|
-
padding: 2px;
|
|
58
|
-
height: 34px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.aggButton,
|
|
62
|
-
.aggActive {
|
|
63
|
-
padding: 4px 12px;
|
|
64
|
-
font-size: 14px;
|
|
65
|
-
border-radius: 6px;
|
|
66
|
-
background: transparent;
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
border: none;
|
|
30
|
+
.leftCluster {
|
|
69
31
|
display: flex;
|
|
70
32
|
align-items: center;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.aggButton:hover {
|
|
74
|
-
background: var(--surface-hover-color);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.aggActive {
|
|
78
|
-
background: var(--brand-primary-color);
|
|
79
|
-
color: white;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.dropdownList {
|
|
83
|
-
max-height: 260px;
|
|
84
|
-
overflow-y: auto;
|
|
85
|
-
padding: 0 12px;
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-direction: column;
|
|
88
33
|
gap: 8px;
|
|
34
|
+
flex-wrap: wrap;
|
|
89
35
|
}
|
|
90
36
|
|
|
91
|
-
.
|
|
37
|
+
.rightCluster {
|
|
92
38
|
display: flex;
|
|
93
39
|
align-items: center;
|
|
94
40
|
gap: 8px;
|
|
95
|
-
|
|
96
|
-
cursor: pointer;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.dropdownItem input {
|
|
100
|
-
width: 16px;
|
|
101
|
-
height: 16px;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.count {
|
|
105
|
-
opacity: 0.55;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.agg {
|
|
109
|
-
margin-bottom: 28px;
|
|
41
|
+
margin-left: auto;
|
|
110
42
|
}
|
|
111
43
|
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
|
|
44
|
+
.aggToggle {
|
|
45
|
+
height: 32px !important;
|
|
46
|
+
font-size: 12.5px;
|
|
47
|
+
--surface02-color: color-mix(in srgb, var(--bit-accent-color, #6c5ce7) 20%, var(--surface-color, #f5f5f5));
|
|
115
48
|
}
|
|
116
49
|
|
|
117
|
-
|
|
118
|
-
grid-row-gap: 24px !important;
|
|
119
|
-
grid-column-gap: 16px !important;
|
|
120
|
-
}
|
|
50
|
+
/* ---- Base filter overrides ---- */
|
|
121
51
|
|
|
122
|
-
.
|
|
52
|
+
.commandBar :global(.baseFilter) {
|
|
123
53
|
max-width: 220px;
|
|
124
54
|
height: 32px;
|
|
125
55
|
}
|
|
126
56
|
|
|
127
|
-
.
|
|
57
|
+
.commandBar :global(.control) {
|
|
128
58
|
border-radius: 8px !important;
|
|
129
59
|
height: 32px;
|
|
130
60
|
padding: 0 10px !important;
|
|
131
61
|
}
|
|
132
62
|
|
|
133
|
-
.
|
|
63
|
+
.commandBar :global(.menu) {
|
|
134
64
|
z-index: $modal-z-index - 1 !important;
|
|
135
|
-
border-radius:
|
|
65
|
+
border-radius: 14px !important;
|
|
136
66
|
padding: 8px 0 !important;
|
|
67
|
+
width: 260px;
|
|
68
|
+
box-shadow: 0 24px 60px -12px rgba(20, 0, 104, 0.2);
|
|
137
69
|
}
|
|
138
70
|
|
|
139
|
-
|
|
140
|
-
height: 32px;
|
|
141
|
-
max-width: 240px;
|
|
142
|
-
font-size: 14px;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.filterDropdown :global(.baseFilter .control) {
|
|
146
|
-
padding: 8px 12px;
|
|
147
|
-
border-radius: 8px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.filterDropdown :global(.menu) {
|
|
151
|
-
margin-top: 10px;
|
|
152
|
-
padding: 12px 0;
|
|
153
|
-
min-width: 260px;
|
|
154
|
-
border-radius: 12px;
|
|
155
|
-
|
|
156
|
-
box-shadow: var(--bit-shadow-hover-low, 0 2px 8px rgba(0, 0, 0, 0.1));
|
|
157
|
-
border: 1px solid var(--border-medium-color, #ededed);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.filterDropdown :global(.checkboxContainer) {
|
|
161
|
-
padding-left: 14px;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.filterDropdown :global(.checkbox) {
|
|
165
|
-
margin-right: 12px;
|
|
166
|
-
accent-color: var(--bit-accent-color, #6c5ce7);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.filterDropdown :global(.buttonsSection) {
|
|
170
|
-
padding: 12px 16px;
|
|
171
|
-
border-top: 1px solid var(--border-medium-color, #ededed);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.filterDropdown :global(.placeholder > span:not(:first-child)) {
|
|
175
|
-
margin-left: 8px;
|
|
176
|
-
}
|
|
71
|
+
/* ---- Section ---- */
|
|
177
72
|
|
|
178
|
-
.
|
|
179
|
-
|
|
180
|
-
align-items: center;
|
|
181
|
-
justify-content: space-between;
|
|
182
|
-
margin-bottom: 24px;
|
|
183
|
-
gap: 16px;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.leftFilters {
|
|
187
|
-
display: flex;
|
|
188
|
-
gap: 12px;
|
|
189
|
-
align-items: center;
|
|
73
|
+
.section {
|
|
74
|
+
margin-bottom: 40px;
|
|
190
75
|
}
|
|
191
76
|
|
|
192
|
-
.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
77
|
+
.sectionHeader {
|
|
78
|
+
position: sticky;
|
|
79
|
+
top: 57px;
|
|
80
|
+
z-index: $nav-z-index;
|
|
81
|
+
background: var(--background-color);
|
|
82
|
+
padding: 12px 0 18px;
|
|
198
83
|
}
|
|
199
84
|
|
|
200
|
-
|
|
201
|
-
height: 32px !important;
|
|
202
|
-
font-size: 14px;
|
|
203
|
-
}
|
|
85
|
+
/* ---- Card grid ---- */
|
|
204
86
|
|
|
205
87
|
.cardGrid {
|
|
206
88
|
display: grid;
|
|
207
|
-
grid-template-columns: repeat(auto-fill, minmax(
|
|
208
|
-
|
|
209
|
-
grid-column-gap: 24px;
|
|
210
|
-
max-width: 1280px;
|
|
89
|
+
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
90
|
+
gap: 14px;
|
|
211
91
|
}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
2
|
import { ComponentGrid } from '@teambit/explorer.ui.gallery.component-grid';
|
|
3
3
|
import { EmptyWorkspace } from '@teambit/workspace.ui.empty-workspace';
|
|
4
|
-
import { PreviewPlaceholder } from '@teambit/preview.ui.preview-placeholder';
|
|
5
|
-
import { Tooltip } from '@teambit/design.ui.tooltip';
|
|
6
|
-
import { ComponentID } from '@teambit/component-id';
|
|
7
|
-
import type { ComponentModel } from '@teambit/component';
|
|
8
4
|
import compact from 'lodash.compact';
|
|
9
5
|
import { ScopeID } from '@teambit/scopes.scope-id';
|
|
10
6
|
import { useCloudScopes } from '@teambit/cloud.hooks.use-cloud-scopes';
|
|
11
|
-
import { WorkspaceComponentCard } from '@teambit/workspace.ui.workspace-component-card';
|
|
12
|
-
import type { ComponentCardPluginType, PluginProps } from '@teambit/explorer.ui.component-card';
|
|
13
7
|
import { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';
|
|
14
|
-
import { H3 } from '@teambit/design.ui.heading';
|
|
15
8
|
import { WorkspaceContext } from '../workspace-context';
|
|
16
|
-
import { LinkPlugin } from './link-plugin';
|
|
17
9
|
import { useWorkspaceAggregation } from './use-workspace-aggregation';
|
|
18
10
|
import { useQueryParamWithDefault, useListParamWithDefault } from './use-query-param-with-default';
|
|
11
|
+
import { NamespaceHeader } from './namespace-header';
|
|
12
|
+
import { HopeComponentCard } from './hope-component-card';
|
|
19
13
|
import type { AggregationType } from './workspace-overview.types';
|
|
20
14
|
import { WorkspaceFilterPanel } from './workspace-filter-panel';
|
|
21
15
|
import styles from './workspace-overview.module.scss';
|
|
@@ -27,8 +21,6 @@ export function WorkspaceOverview() {
|
|
|
27
21
|
if (!components.length) return <EmptyWorkspace name={workspace.name} />;
|
|
28
22
|
|
|
29
23
|
const { isMinimal } = useWorkspaceMode();
|
|
30
|
-
const compModelsById = useMemo(() => new Map(components.map((c) => [c.id.toString(), c])), [components]);
|
|
31
|
-
|
|
32
24
|
const uniqueScopes = [...new Set(components.map((c) => c.id.scope))];
|
|
33
25
|
const { cloudScopes } = useCloudScopes(uniqueScopes);
|
|
34
26
|
const cloudMap = new Map((cloudScopes || []).map((s) => [s.id.toString(), s]));
|
|
@@ -48,7 +40,13 @@ export function WorkspaceOverview() {
|
|
|
48
40
|
(ScopeID.isValid(component.id.scope) && { id: ScopeID.fromString(component.id.scope) }) ||
|
|
49
41
|
undefined;
|
|
50
42
|
|
|
51
|
-
return {
|
|
43
|
+
return {
|
|
44
|
+
component,
|
|
45
|
+
componentDescriptor: descriptor,
|
|
46
|
+
scope: scope
|
|
47
|
+
? { id: scope.id, icon: (scope as any).icon, backgroundIconColor: (scope as any).backgroundIconColor }
|
|
48
|
+
: undefined,
|
|
49
|
+
};
|
|
52
50
|
})
|
|
53
51
|
);
|
|
54
52
|
|
|
@@ -57,7 +55,7 @@ export function WorkspaceOverview() {
|
|
|
57
55
|
const [activeScopes, setActiveScopes] = useListParamWithDefault('scopes');
|
|
58
56
|
|
|
59
57
|
const filters = useMemo(
|
|
60
|
-
() => ({ namespaces: activeNamespaces, scopes: activeScopes }),
|
|
58
|
+
() => ({ namespaces: activeNamespaces, scopes: activeScopes, statuses: new Set() as any }),
|
|
61
59
|
[activeNamespaces, activeScopes]
|
|
62
60
|
);
|
|
63
61
|
|
|
@@ -67,8 +65,6 @@ export function WorkspaceOverview() {
|
|
|
67
65
|
filters
|
|
68
66
|
);
|
|
69
67
|
|
|
70
|
-
const plugins = useCardPlugins({ compModelsById, showPreview: isMinimal });
|
|
71
|
-
|
|
72
68
|
return (
|
|
73
69
|
<div className={styles.container}>
|
|
74
70
|
<WorkspaceFilterPanel
|
|
@@ -82,80 +78,36 @@ export function WorkspaceOverview() {
|
|
|
82
78
|
onScopesChange={setActiveScopes}
|
|
83
79
|
/>
|
|
84
80
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
plugins={plugins}
|
|
99
|
-
shouldShowPreviewState={isMinimal}
|
|
100
|
-
/>
|
|
101
|
-
))}
|
|
102
|
-
</ComponentGrid>
|
|
103
|
-
</section>
|
|
104
|
-
))}
|
|
105
|
-
</div>
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export function useCardPlugins({
|
|
110
|
-
compModelsById,
|
|
111
|
-
showPreview,
|
|
112
|
-
}: {
|
|
113
|
-
compModelsById: Map<string, ComponentModel>;
|
|
114
|
-
showPreview?: boolean;
|
|
115
|
-
}): ComponentCardPluginType<PluginProps>[] {
|
|
116
|
-
const serverUrlsSignature = React.useMemo(() => {
|
|
117
|
-
const serversCount = Array.from(compModelsById.values())
|
|
118
|
-
.filter((comp) => comp.server?.url)
|
|
119
|
-
.map((comp) => comp.server?.url)
|
|
120
|
-
.join(',');
|
|
121
|
-
return serversCount;
|
|
122
|
-
}, [compModelsById]);
|
|
123
|
-
|
|
124
|
-
const plugins = React.useMemo(
|
|
125
|
-
() => [
|
|
126
|
-
{
|
|
127
|
-
preview: function Preview({ component, shouldShowPreview }) {
|
|
128
|
-
const compModel = compModelsById.get(component.id.toString());
|
|
129
|
-
if (!compModel) return null;
|
|
130
|
-
return (
|
|
131
|
-
<PreviewPlaceholder
|
|
132
|
-
componentDescriptor={component}
|
|
133
|
-
component={compModel}
|
|
134
|
-
shouldShowPreview={showPreview || shouldShowPreview}
|
|
135
|
-
/>
|
|
136
|
-
);
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
previewBottomRight: function PreviewBottomRight({ component }) {
|
|
141
|
-
const env = component.get('teambit.envs/envs');
|
|
142
|
-
const envComponentId = env?.id ? ComponentID.fromString(env?.id) : undefined;
|
|
143
|
-
|
|
144
|
-
return (
|
|
145
|
-
<div className={styles.rightPreviewPlugins}>
|
|
146
|
-
<div className={styles.badge}>
|
|
147
|
-
<Tooltip delay={300} content={envComponentId?.name}>
|
|
148
|
-
<img src={env?.icon} className={styles.envIcon} />
|
|
149
|
-
</Tooltip>
|
|
81
|
+
<div className={styles.content}>
|
|
82
|
+
{filteredCount === 0 && <EmptyWorkspace name={workspace.name} />}
|
|
83
|
+
|
|
84
|
+
{groups.map((group) => (
|
|
85
|
+
<section key={group.name} className={styles.section}>
|
|
86
|
+
{groupType !== 'none' && (
|
|
87
|
+
<div className={styles.sectionHeader}>
|
|
88
|
+
<NamespaceHeader
|
|
89
|
+
namespace={group.name}
|
|
90
|
+
items={group.items}
|
|
91
|
+
scopeIcon={group.scopeIcon}
|
|
92
|
+
scopeIconColor={group.scopeIconColor}
|
|
93
|
+
/>
|
|
150
94
|
</div>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
95
|
+
)}
|
|
96
|
+
|
|
97
|
+
<ComponentGrid className={styles.cardGrid}>
|
|
98
|
+
{group.items.map((item) => (
|
|
99
|
+
<HopeComponentCard
|
|
100
|
+
key={item.component.id.toString()}
|
|
101
|
+
component={item.component}
|
|
102
|
+
componentDescriptor={item.componentDescriptor}
|
|
103
|
+
scope={item.scope as any}
|
|
104
|
+
showPreview={isMinimal}
|
|
105
|
+
/>
|
|
106
|
+
))}
|
|
107
|
+
</ComponentGrid>
|
|
108
|
+
</section>
|
|
109
|
+
))}
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
158
112
|
);
|
|
159
|
-
|
|
160
|
-
return plugins;
|
|
161
113
|
}
|
|
@@ -5,15 +5,21 @@ import type { ScopeID } from '@teambit/scopes.scope-id';
|
|
|
5
5
|
export interface WorkspaceItem {
|
|
6
6
|
component: ComponentModel;
|
|
7
7
|
componentDescriptor: ComponentDescriptor;
|
|
8
|
-
scope?: { id: ScopeID };
|
|
8
|
+
scope?: { id: ScopeID; icon?: string; backgroundIconColor?: string };
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export type AggregationType = 'namespaces' | 'scopes' | 'none';
|
|
12
12
|
|
|
13
|
+
export type Density = 'compact' | 'comfy';
|
|
14
|
+
|
|
15
|
+
export type ComponentStatus = 'built' | 'changed' | 'building' | 'queued';
|
|
16
|
+
|
|
13
17
|
export interface AggregationGroup {
|
|
14
18
|
name: string;
|
|
15
19
|
displayName: string;
|
|
16
20
|
items: WorkspaceItem[];
|
|
21
|
+
scopeIcon?: string;
|
|
22
|
+
scopeIconColor?: string;
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
export interface AggregationResult {
|
|
@@ -18,37 +18,20 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&.light {
|
|
36
|
-
--background-color: #ededed;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
> a {
|
|
40
|
-
&[aria-current='page'] > img {
|
|
41
|
-
filter: invert(31%) sepia(75%) saturate(3183%) hue-rotate(235deg) brightness(99%) contrast(108%);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
> img {
|
|
45
|
-
width: 22px;
|
|
46
|
-
height: 22px;
|
|
21
|
+
.backButton {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
width: 32px;
|
|
26
|
+
height: 32px;
|
|
27
|
+
border-radius: 8px;
|
|
28
|
+
color: var(--on-background-color, var(--bit-text-color-heavy, #2b2b2b));
|
|
29
|
+
text-decoration: none;
|
|
30
|
+
transition: background 0.15s ease;
|
|
31
|
+
margin-left: 8px;
|
|
47
32
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
}
|
|
33
|
+
&:hover {
|
|
34
|
+
background: color-mix(in srgb, var(--on-background-color, #2b2b2b) 8%, transparent);
|
|
52
35
|
}
|
|
53
36
|
}
|
|
54
37
|
|
|
@@ -96,6 +79,28 @@
|
|
|
96
79
|
flex-direction: column;
|
|
97
80
|
overflow: hidden; // TODO
|
|
98
81
|
height: 100vh;
|
|
82
|
+
|
|
83
|
+
@media (hover: hover) {
|
|
84
|
+
* {
|
|
85
|
+
&::-webkit-scrollbar {
|
|
86
|
+
width: 14px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&::-webkit-scrollbar-track {
|
|
90
|
+
background: var(--background-color, #fff);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&::-webkit-scrollbar-thumb {
|
|
94
|
+
border: 5px solid var(--background-color, #fff);
|
|
95
|
+
background: var(--border-medium-color, #d0d0d0);
|
|
96
|
+
border-radius: 100vmax;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
100
|
+
background: var(--on-background-color, var(--bit-text-color-light, #999));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
.topbar {
|
|
@@ -135,6 +140,9 @@
|
|
|
135
140
|
|
|
136
141
|
&.minimal {
|
|
137
142
|
height: 46px;
|
|
143
|
+
--bit-bg-heaviest: color-mix(in srgb, var(--bit-accent-color, #6c5ce7) 3%, var(--background-color, #fff));
|
|
144
|
+
--bit-border-color-lightest: var(--bit-bg-heaviest);
|
|
145
|
+
border-bottom: 1px solid var(--border-medium-color, #e6e6e6);
|
|
138
146
|
}
|
|
139
147
|
}
|
|
140
148
|
|
|
@@ -86,6 +86,9 @@ export function Workspace({ routeSlot, menuSlot, sidebar, workspaceUI, onSidebar
|
|
|
86
86
|
|
|
87
87
|
workspaceUI.setComponents(workspace.components);
|
|
88
88
|
const inIframe = typeof window !== 'undefined' && window.parent && window.parent !== window;
|
|
89
|
+
const location = useLocation();
|
|
90
|
+
const isOverview = location.pathname === '/' || location.pathname === '';
|
|
91
|
+
const showTopBar = !isMinimal || (isMinimal && !isOverview);
|
|
89
92
|
|
|
90
93
|
return (
|
|
91
94
|
<WorkspaceProvider workspace={workspace}>
|
|
@@ -94,23 +97,37 @@ export function Workspace({ routeSlot, menuSlot, sidebar, workspaceUI, onSidebar
|
|
|
94
97
|
<ThemeFromUrlSync />
|
|
95
98
|
{isMinimal && inIframe && <MinimalModeUrlBroadcasterAndListener />}
|
|
96
99
|
<div className={styles.workspaceWrapper}>
|
|
97
|
-
{
|
|
100
|
+
{showTopBar && (
|
|
98
101
|
<TopBar
|
|
99
102
|
className={classNames(styles.topbar, styles[themeName], isMinimal && styles.minimal)}
|
|
100
103
|
Corner={() => (
|
|
101
104
|
<div className={classNames(isMinimal && styles.cornerWithBreadcrumb)}>
|
|
102
|
-
|
|
103
|
-
className={
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
{isMinimal ? (
|
|
106
|
+
<Link to="/" className={styles.backButton}>
|
|
107
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
108
|
+
<path
|
|
109
|
+
d="M11.25 13.5L6.75 9L11.25 4.5"
|
|
110
|
+
stroke="currentColor"
|
|
111
|
+
strokeWidth="1.5"
|
|
112
|
+
strokeLinecap="round"
|
|
113
|
+
strokeLinejoin="round"
|
|
114
|
+
/>
|
|
115
|
+
</svg>
|
|
116
|
+
</Link>
|
|
117
|
+
) : (
|
|
118
|
+
<Corner
|
|
119
|
+
className={classNames(styles.corner, styles[themeName])}
|
|
120
|
+
name={workspace.name}
|
|
121
|
+
icon={workspace.icon}
|
|
122
|
+
/>
|
|
123
|
+
)}
|
|
107
124
|
{isMinimal && <WorkspaceBreadcrumb />}
|
|
108
125
|
</div>
|
|
109
126
|
)}
|
|
110
127
|
// @ts-ignore - getting an error of "Types have separate declarations of a private property 'registerFn'." for some reason after upgrading teambit.harmony/harmony from 0.4.6 to 0.4.7
|
|
111
128
|
menu={menuSlot}
|
|
112
129
|
/>
|
|
113
|
-
}
|
|
130
|
+
)}
|
|
114
131
|
<SplitPane className={styles.main} size={246} layout={sidebarOpenness}>
|
|
115
132
|
<Pane className={classNames(styles.sidebar, styles[themeName], !isSidebarOpen && styles.closed)}>
|
|
116
133
|
{sidebar}
|