@teambit/workspace 1.0.1080 → 1.0.1082

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.
Files changed (77) hide show
  1. package/dist/{preview-1785267101230.js → preview-1785362864561.js} +2 -2
  2. package/dist/ui/workspace/use-workspace.js +179 -27
  3. package/dist/ui/workspace/use-workspace.js.map +1 -1
  4. package/dist/ui/workspace/workspace-overview/index.d.ts +1 -1
  5. package/dist/ui/workspace/workspace-overview/index.js +5 -5
  6. package/dist/ui/workspace/workspace-overview/index.js.map +1 -1
  7. package/dist/ui/workspace/workspace-overview/workspace-overview.js +13 -143
  8. package/dist/ui/workspace/workspace-overview/workspace-overview.js.map +1 -1
  9. package/dist/ui/workspace/workspace-skeleton.d.ts +8 -0
  10. package/dist/ui/workspace/workspace-skeleton.js +73 -0
  11. package/dist/ui/workspace/workspace-skeleton.js.map +1 -0
  12. package/dist/ui/workspace/workspace-skeleton.module.scss +102 -0
  13. package/dist/ui/workspace/workspace.js +23 -7
  14. package/dist/ui/workspace/workspace.js.map +1 -1
  15. package/package.json +59 -68
  16. package/ui/workspace/use-workspace.ts +185 -27
  17. package/ui/workspace/workspace-overview/index.ts +1 -1
  18. package/ui/workspace/workspace-overview/workspace-overview.tsx +9 -102
  19. package/ui/workspace/workspace-skeleton.module.scss +102 -0
  20. package/ui/workspace/workspace-skeleton.tsx +35 -0
  21. package/ui/workspace/workspace.tsx +16 -5
  22. package/dist/ui/workspace/workspace-overview/card-overlays.d.ts +0 -5
  23. package/dist/ui/workspace/workspace-overview/card-overlays.js +0 -133
  24. package/dist/ui/workspace/workspace-overview/card-overlays.js.map +0 -1
  25. package/dist/ui/workspace/workspace-overview/card-overlays.module.scss +0 -72
  26. package/dist/ui/workspace/workspace-overview/filter-utils.d.ts +0 -10
  27. package/dist/ui/workspace/workspace-overview/filter-utils.js +0 -40
  28. package/dist/ui/workspace/workspace-overview/filter-utils.js.map +0 -1
  29. package/dist/ui/workspace/workspace-overview/hope-component-card.d.ts +0 -15
  30. package/dist/ui/workspace/workspace-overview/hope-component-card.js +0 -186
  31. package/dist/ui/workspace/workspace-overview/hope-component-card.js.map +0 -1
  32. package/dist/ui/workspace/workspace-overview/hope-component-card.module.scss +0 -169
  33. package/dist/ui/workspace/workspace-overview/link-plugin.d.ts +0 -3
  34. package/dist/ui/workspace/workspace-overview/link-plugin.js +0 -14
  35. package/dist/ui/workspace/workspace-overview/link-plugin.js.map +0 -1
  36. package/dist/ui/workspace/workspace-overview/namespace-header.d.ts +0 -9
  37. package/dist/ui/workspace/workspace-overview/namespace-header.js +0 -107
  38. package/dist/ui/workspace/workspace-overview/namespace-header.js.map +0 -1
  39. package/dist/ui/workspace/workspace-overview/namespace-header.module.scss +0 -88
  40. package/dist/ui/workspace/workspace-overview/namespace-sort.d.ts +0 -8
  41. package/dist/ui/workspace/workspace-overview/namespace-sort.js +0 -47
  42. package/dist/ui/workspace/workspace-overview/namespace-sort.js.map +0 -1
  43. package/dist/ui/workspace/workspace-overview/scope-sort.d.ts +0 -1
  44. package/dist/ui/workspace/workspace-overview/scope-sort.js +0 -14
  45. package/dist/ui/workspace/workspace-overview/scope-sort.js.map +0 -1
  46. package/dist/ui/workspace/workspace-overview/use-query-param-with-default.d.ts +0 -6
  47. package/dist/ui/workspace/workspace-overview/use-query-param-with-default.js +0 -102
  48. package/dist/ui/workspace/workspace-overview/use-query-param-with-default.js.map +0 -1
  49. package/dist/ui/workspace/workspace-overview/use-workspace-aggregation.d.ts +0 -3
  50. package/dist/ui/workspace/workspace-overview/use-workspace-aggregation.js +0 -88
  51. package/dist/ui/workspace/workspace-overview/use-workspace-aggregation.js.map +0 -1
  52. package/dist/ui/workspace/workspace-overview/workspace-filter-panel.d.ts +0 -13
  53. package/dist/ui/workspace/workspace-overview/workspace-filter-panel.js +0 -110
  54. package/dist/ui/workspace/workspace-overview/workspace-filter-panel.js.map +0 -1
  55. package/dist/ui/workspace/workspace-overview/workspace-overview.module.scss +0 -91
  56. package/dist/ui/workspace/workspace-overview/workspace-overview.sort.d.ts +0 -1
  57. package/dist/ui/workspace/workspace-overview/workspace-overview.sort.js +0 -30
  58. package/dist/ui/workspace/workspace-overview/workspace-overview.sort.js.map +0 -1
  59. package/dist/ui/workspace/workspace-overview/workspace-overview.types.d.ts +0 -28
  60. package/dist/ui/workspace/workspace-overview/workspace-overview.types.js +0 -3
  61. package/dist/ui/workspace/workspace-overview/workspace-overview.types.js.map +0 -1
  62. package/ui/workspace/workspace-overview/card-overlays.module.scss +0 -72
  63. package/ui/workspace/workspace-overview/card-overlays.tsx +0 -66
  64. package/ui/workspace/workspace-overview/filter-utils.ts +0 -42
  65. package/ui/workspace/workspace-overview/hope-component-card.module.scss +0 -169
  66. package/ui/workspace/workspace-overview/hope-component-card.tsx +0 -152
  67. package/ui/workspace/workspace-overview/link-plugin.ts +0 -5
  68. package/ui/workspace/workspace-overview/namespace-header.module.scss +0 -88
  69. package/ui/workspace/workspace-overview/namespace-header.tsx +0 -72
  70. package/ui/workspace/workspace-overview/namespace-sort.ts +0 -44
  71. package/ui/workspace/workspace-overview/scope-sort.ts +0 -9
  72. package/ui/workspace/workspace-overview/use-query-param-with-default.ts +0 -115
  73. package/ui/workspace/workspace-overview/use-workspace-aggregation.ts +0 -79
  74. package/ui/workspace/workspace-overview/workspace-filter-panel.tsx +0 -109
  75. package/ui/workspace/workspace-overview/workspace-overview.module.scss +0 -91
  76. package/ui/workspace/workspace-overview/workspace-overview.sort.ts +0 -29
  77. package/ui/workspace/workspace-overview/workspace-overview.types.ts +0 -30
@@ -1,88 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useWorkspaceAggregation = useWorkspaceAggregation;
7
- function _react() {
8
- const data = require("react");
9
- _react = function () {
10
- return data;
11
- };
12
- return data;
13
- }
14
- function _namespaceSort() {
15
- const data = require("./namespace-sort");
16
- _namespaceSort = function () {
17
- return data;
18
- };
19
- return data;
20
- }
21
- function _filterUtils() {
22
- const data = require("./filter-utils");
23
- _filterUtils = function () {
24
- return data;
25
- };
26
- return data;
27
- }
28
- function useWorkspaceAggregation(items, aggregation, filters) {
29
- const filtered = (0, _react().useMemo)(() => (0, _filterUtils().filterItems)(items, filters), [items, filters]);
30
- if (aggregation === 'none') {
31
- return {
32
- groups: [{
33
- name: 'all',
34
- displayName: '',
35
- items: (0, _namespaceSort().sortItemsByNamespace)(filtered)
36
- }],
37
- groupType: 'none',
38
- availableAggregations: ['namespaces', 'scopes', 'none'],
39
- filteredCount: filtered.length
40
- };
41
- }
42
- if (aggregation === 'namespaces') {
43
- const map = new Map();
44
- for (const item of filtered) {
45
- const ns = item.component.id.namespace || '/';
46
- if (!map.has(ns)) map.set(ns, []);
47
- map.get(ns).push(item);
48
- }
49
- const sortedKeys = (0, _namespaceSort().sortNamespacesAdvanced)([...map.keys()]);
50
- const groups = sortedKeys.map(ns => ({
51
- name: ns,
52
- displayName: ns,
53
- items: (0, _namespaceSort().sortItemsByNamespace)(map.get(ns))
54
- }));
55
- return {
56
- groups,
57
- groupType: 'namespaces',
58
- availableAggregations: ['namespaces', 'scopes', 'none'],
59
- filteredCount: filtered.length
60
- };
61
- }
62
- const map = new Map();
63
- for (const item of filtered) {
64
- const scope = item.component.id.scope;
65
- if (!map.has(scope)) map.set(scope, []);
66
- map.get(scope).push(item);
67
- }
68
- const sortedScopes = [...map.keys()].sort();
69
- const groups = sortedScopes.map(sc => {
70
- const groupItems = map.get(sc);
71
- const sampleScope = groupItems.find(i => i.scope?.icon)?.scope;
72
- return {
73
- name: sc,
74
- displayName: sc,
75
- items: (0, _namespaceSort().sortItemsByNamespace)(groupItems),
76
- scopeIcon: sampleScope?.icon,
77
- scopeIconColor: sampleScope?.backgroundIconColor
78
- };
79
- });
80
- return {
81
- groups,
82
- groupType: 'scopes',
83
- availableAggregations: ['namespaces', 'scopes', 'none'],
84
- filteredCount: filtered.length
85
- };
86
- }
87
-
88
- //# sourceMappingURL=use-workspace-aggregation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","data","require","_namespaceSort","_filterUtils","useWorkspaceAggregation","items","aggregation","filters","filtered","useMemo","filterItems","groups","name","displayName","sortItemsByNamespace","groupType","availableAggregations","filteredCount","length","map","Map","item","ns","component","id","namespace","has","set","get","push","sortedKeys","sortNamespacesAdvanced","keys","scope","sortedScopes","sort","sc","groupItems","sampleScope","find","i","icon","scopeIcon","scopeIconColor","backgroundIconColor"],"sources":["use-workspace-aggregation.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { sortNamespacesAdvanced, sortItemsByNamespace } from './namespace-sort';\nimport { filterItems, type ActiveFilters } from './filter-utils';\nimport type { WorkspaceItem, AggregationType, AggregationGroup, AggregationResult } from './workspace-overview.types';\n\nexport function useWorkspaceAggregation(\n items: WorkspaceItem[],\n aggregation: AggregationType,\n filters: ActiveFilters\n): AggregationResult {\n const filtered = useMemo(() => filterItems(items, filters), [items, filters]);\n\n if (aggregation === 'none') {\n return {\n groups: [\n {\n name: 'all',\n displayName: '',\n items: sortItemsByNamespace(filtered),\n },\n ],\n groupType: 'none',\n availableAggregations: ['namespaces', 'scopes', 'none'],\n filteredCount: filtered.length,\n };\n }\n\n if (aggregation === 'namespaces') {\n const map = new Map<string, WorkspaceItem[]>();\n for (const item of filtered) {\n const ns = item.component.id.namespace || '/';\n if (!map.has(ns)) map.set(ns, []);\n map.get(ns)!.push(item);\n }\n\n const sortedKeys = sortNamespacesAdvanced([...map.keys()]);\n\n const groups: AggregationGroup[] = sortedKeys.map((ns) => ({\n name: ns,\n displayName: ns,\n items: sortItemsByNamespace(map.get(ns)!),\n }));\n\n return {\n groups,\n groupType: 'namespaces',\n availableAggregations: ['namespaces', 'scopes', 'none'],\n filteredCount: filtered.length,\n };\n }\n\n const map = new Map<string, WorkspaceItem[]>();\n for (const item of filtered) {\n const scope = item.component.id.scope;\n if (!map.has(scope)) map.set(scope, []);\n map.get(scope)!.push(item);\n }\n\n const sortedScopes = [...map.keys()].sort();\n\n const groups: AggregationGroup[] = sortedScopes.map((sc) => {\n const groupItems = map.get(sc)!;\n const sampleScope = groupItems.find((i) => i.scope?.icon)?.scope;\n return {\n name: sc,\n displayName: sc,\n items: sortItemsByNamespace(groupItems),\n scopeIcon: sampleScope?.icon,\n scopeIconColor: sampleScope?.backgroundIconColor,\n };\n });\n\n return {\n groups,\n groupType: 'scopes',\n availableAggregations: ['namespaces', 'scopes', 'none'],\n filteredCount: filtered.length,\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,eAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,cAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,SAASI,uBAAuBA,CACrCC,KAAsB,EACtBC,WAA4B,EAC5BC,OAAsB,EACH;EACnB,MAAMC,QAAQ,GAAG,IAAAC,gBAAO,EAAC,MAAM,IAAAC,0BAAW,EAACL,KAAK,EAAEE,OAAO,CAAC,EAAE,CAACF,KAAK,EAAEE,OAAO,CAAC,CAAC;EAE7E,IAAID,WAAW,KAAK,MAAM,EAAE;IAC1B,OAAO;MACLK,MAAM,EAAE,CACN;QACEC,IAAI,EAAE,KAAK;QACXC,WAAW,EAAE,EAAE;QACfR,KAAK,EAAE,IAAAS,qCAAoB,EAACN,QAAQ;MACtC,CAAC,CACF;MACDO,SAAS,EAAE,MAAM;MACjBC,qBAAqB,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,MAAM,CAAC;MACvDC,aAAa,EAAET,QAAQ,CAACU;IAC1B,CA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C,CAAEJ,IAAI,CAACR,IAAI,CAAC;EAC5B;EAEA,MAAMa,YAAY,GAAG,CAAC,GAAGf,GAAG,CAACa,IAAI,CAAC,CAAC,CAAC,CAACG,IAAI,CAAC,CAAC;EAE3C,MAAMxB,MAA0B,GAAGuB,YAAY,CAACf,GAAG,CAAEiB,EAAE,IAAK;IAC1D,MAAMC,UAAU,GAAGlB,GAAG,CAACS,GAAG,CAACQ,EAAE,CAAE;IAC/B,MAAME,WAAW,GAAGD,UAAU,CAACE,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACP,KAAK,EAAEQ,IAAI,CAAC,EAAER,KAAK;IAChE,OAAO;MACLrB,IAAI,EAAEwB,EAAE;MACRvB,WAAW,EAAEuB,EAAE;MACf/B,KAAK,EAAE,IAAAS,qCAAoB,EAACuB,UAAU,CAAC;MACvCK,SAAS,EAAEJ,WAAW,EAAEG,IAAI;MAC5BE,cAAc,EAAEL,WAAW,EAAEM;IAC/B,CAAC;EACH,CAAC,CAAC;EAEF,OAAO;IACLjC,MAAM;IACNI,SAAS,EAAE,QAAQ;IACnBC,qBAAqB,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,MAAM,CAAC;IACvDC,aAAa,EAAET,QAAQ,CAACU;EAC1B,CAAC;AACH","ignoreList":[]}
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import type { WorkspaceItem, AggregationType } from './workspace-overview.types';
3
- export interface WorkspaceFilterPanelProps {
4
- aggregation: AggregationType;
5
- onAggregationChange: (agg: AggregationType) => void;
6
- availableAggregations: AggregationType[];
7
- items: WorkspaceItem[];
8
- activeNamespaces: string[];
9
- onNamespacesChange: (namespaces: string[]) => void;
10
- activeScopes: string[];
11
- onScopesChange: (scopes: string[]) => void;
12
- }
13
- export declare function WorkspaceFilterPanel({ aggregation, onAggregationChange, availableAggregations, items, activeNamespaces, onNamespacesChange, activeScopes, onScopesChange, }: WorkspaceFilterPanelProps): React.JSX.Element;
@@ -1,110 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.WorkspaceFilterPanel = WorkspaceFilterPanel;
7
- function _react() {
8
- const data = _interopRequireWildcard(require("react"));
9
- _react = function () {
10
- return data;
11
- };
12
- return data;
13
- }
14
- function _designInputs() {
15
- const data = require("@teambit/design.inputs.toggle-button");
16
- _designInputs = function () {
17
- return data;
18
- };
19
- return data;
20
- }
21
- function _componentFilters() {
22
- const data = require("@teambit/component.filters.base-filter");
23
- _componentFilters = function () {
24
- return data;
25
- };
26
- return data;
27
- }
28
- function _workspaceOverviewModule() {
29
- const data = _interopRequireDefault(require("./workspace-overview.module.scss"));
30
- _workspaceOverviewModule = function () {
31
- return data;
32
- };
33
- return data;
34
- }
35
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
36
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
37
- const LABELS = {
38
- namespaces: 'Namespaces',
39
- scopes: 'Scopes',
40
- none: 'None'
41
- };
42
- function WorkspaceFilterPanel({
43
- aggregation,
44
- onAggregationChange,
45
- availableAggregations,
46
- items,
47
- activeNamespaces,
48
- onNamespacesChange,
49
- activeScopes,
50
- onScopesChange
51
- }) {
52
- const namespaceOptions = (0, _react().useMemo)(() => [...new Set(items.map(i => i.component.id.namespace || '/'))].map(v => ({
53
- value: v
54
- })), [items]);
55
- const scopeOptions = (0, _react().useMemo)(() => [...new Set(items.map(i => i.component.id.scope))].map(v => ({
56
- value: v
57
- })), [items]);
58
- const activeNsOptions = activeNamespaces.map(v => ({
59
- value: v
60
- }));
61
- const activeScopeOptions = activeScopes.map(v => ({
62
- value: v
63
- }));
64
- const applyNs = opts => {
65
- const arr = Array.isArray(opts) ? opts : opts ? [opts] : [];
66
- const list = arr.map(o => o.value).filter(v => typeof v === 'string');
67
- onNamespacesChange(list);
68
- };
69
- const applyScopes = opts => {
70
- const arr = Array.isArray(opts) ? opts : opts ? [opts] : [];
71
- const list = arr.map(o => o.value).filter(v => typeof v === 'string');
72
- onScopesChange(list);
73
- };
74
- const currentIndex = Math.max(0, availableAggregations.findIndex(a => a === aggregation));
75
- const applyAgg = i => {
76
- const agg = availableAggregations[i];
77
- onAggregationChange(agg);
78
- };
79
- return /*#__PURE__*/_react().default.createElement("div", {
80
- className: _workspaceOverviewModule().default.commandBar
81
- }, /*#__PURE__*/_react().default.createElement("div", {
82
- className: _workspaceOverviewModule().default.leftCluster
83
- }, /*#__PURE__*/_react().default.createElement(_componentFilters().BaseFilter, {
84
- id: "namespaces",
85
- placeholder: "Namespaces",
86
- options: namespaceOptions,
87
- activeOptions: activeNsOptions,
88
- onChange: applyNs,
89
- isSearchable: true
90
- }), /*#__PURE__*/_react().default.createElement(_componentFilters().BaseFilter, {
91
- id: "scopes",
92
- placeholder: "Scopes",
93
- options: scopeOptions,
94
- activeOptions: activeScopeOptions,
95
- onChange: applyScopes,
96
- isSearchable: true
97
- })), /*#__PURE__*/_react().default.createElement("div", {
98
- className: _workspaceOverviewModule().default.rightCluster
99
- }, /*#__PURE__*/_react().default.createElement(_designInputs().ToggleButton, {
100
- className: _workspaceOverviewModule().default.aggToggle,
101
- defaultIndex: currentIndex,
102
- onOptionSelect: idx => applyAgg(idx),
103
- options: availableAggregations.map(agg => ({
104
- value: agg,
105
- element: LABELS[agg]
106
- }))
107
- })));
108
- }
109
-
110
- //# sourceMappingURL=workspace-filter-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","data","_interopRequireWildcard","require","_designInputs","_componentFilters","_workspaceOverviewModule","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","LABELS","namespaces","scopes","none","WorkspaceFilterPanel","aggregation","onAggregationChange","availableAggregations","items","activeNamespaces","onNamespacesChange","activeScopes","onScopesChange","namespaceOptions","useMemo","Set","map","component","id","namespace","v","value","scopeOptions","scope","activeNsOptions","activeScopeOptions","applyNs","opts","arr","Array","isArray","list","filter","applyScopes","currentIndex","Math","max","findIndex","a","applyAgg","agg","createElement","className","styles","commandBar","leftCluster","BaseFilter","placeholder","options","activeOptions","onChange","isSearchable","rightCluster","ToggleButton","aggToggle","defaultIndex","onOptionSelect","idx","element"],"sources":["workspace-filter-panel.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { ToggleButton } from '@teambit/design.inputs.toggle-button';\nimport { BaseFilter } from '@teambit/component.filters.base-filter';\nimport type { WorkspaceItem, AggregationType } from './workspace-overview.types';\nimport styles from './workspace-overview.module.scss';\n\nexport interface WorkspaceFilterPanelProps {\n aggregation: AggregationType;\n onAggregationChange: (agg: AggregationType) => void;\n availableAggregations: AggregationType[];\n items: WorkspaceItem[];\n activeNamespaces: string[];\n onNamespacesChange: (namespaces: string[]) => void;\n activeScopes: string[];\n onScopesChange: (scopes: string[]) => void;\n}\n\nconst LABELS: Record<AggregationType, string> = {\n namespaces: 'Namespaces',\n scopes: 'Scopes',\n none: 'None',\n};\n\nexport function WorkspaceFilterPanel({\n aggregation,\n onAggregationChange,\n availableAggregations,\n items,\n activeNamespaces,\n onNamespacesChange,\n activeScopes,\n onScopesChange,\n}: WorkspaceFilterPanelProps) {\n const namespaceOptions = useMemo(\n () =>\n [...new Set(items.map((i) => i.component.id.namespace || '/'))].map((v) => ({\n value: v,\n })),\n [items]\n );\n\n const scopeOptions = useMemo(\n () =>\n [...new Set(items.map((i) => i.component.id.scope))].map((v) => ({\n value: v,\n })),\n [items]\n );\n\n const activeNsOptions = activeNamespaces.map((v) => ({ value: v }));\n const activeScopeOptions = activeScopes.map((v) => ({ value: v }));\n\n const applyNs = (opts: readonly { value?: string }[] | { value?: string } | null) => {\n const arr = Array.isArray(opts) ? opts : opts ? [opts] : [];\n const list = arr.map((o) => o.value).filter((v): v is string => typeof v === 'string');\n onNamespacesChange(list);\n };\n\n const applyScopes = (opts: readonly { value?: string }[] | { value?: string } | null) => {\n const arr = Array.isArray(opts) ? opts : opts ? [opts] : [];\n const list = arr.map((o) => o.value).filter((v): v is string => typeof v === 'string');\n onScopesChange(list);\n };\n\n const currentIndex = Math.max(\n 0,\n availableAggregations.findIndex((a) => a === aggregation)\n );\n\n const applyAgg = (i: number) => {\n const agg = availableAggregations[i];\n onAggregationChange(agg);\n };\n\n return (\n <div className={styles.commandBar}>\n <div className={styles.leftCluster}>\n <BaseFilter\n id=\"namespaces\"\n placeholder=\"Namespaces\"\n options={namespaceOptions}\n activeOptions={activeNsOptions}\n onChange={applyNs}\n isSearchable\n />\n <BaseFilter\n id=\"scopes\"\n placeholder=\"Scopes\"\n options={scopeOptions}\n activeOptions={activeScopeOptions}\n onChange={applyScopes}\n isSearchable\n />\n </div>\n\n <div className={styles.rightCluster}>\n <ToggleButton\n className={styles.aggToggle}\n defaultIndex={currentIndex}\n onOptionSelect={(idx) => applyAgg(idx)}\n options={availableAggregations.map((agg) => ({\n value: agg,\n element: LABELS[agg],\n }))}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA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IACxBC,OAAO,EAAEnC,gBAAiB;IAC1BoC,aAAa,EAAEzB,eAAgB;IAC/B0B,QAAQ,EAAExB,OAAQ;IAClByB,YAAY;EAAA,CACb,CAAC,eACF9E,MAAA,GAAAU,OAAA,CAAA0D,aAAA,CAAC/D,iBAAA,GAAAoE,UAAU;IACT5B,EAAE,EAAC,QAAQ;IACX6B,WAAW,EAAC,QAAQ;IACpBC,OAAO,EAAE1B,YAAa;IACtB2B,aAAa,EAAExB,kBAAmB;IAClCyB,QAAQ,EAAEjB,WAAY;IACtBkB,YAAY;EAAA,CACb,CACE,CAAC,eAEN9E,MAAA,GAAAU,OAAA,CAAA0D,aAAA;IAAKC,SAAS,EAAEC,kCAAM,CAACS;EAAa,gBAClC/E,MAAA,GAAAU,OAAA,CAAA0D,aAAA,CAAChE,aAAA,GAAA4E,YAAY;IACXX,SAAS,EAAEC,kCAAM,CAACW,SAAU;IAC5BC,YAAY,EAAErB,YAAa;IAC3BsB,cAAc,EAAGC,GAAG,IAAKlB,QAAQ,CAACkB,GAAG,CAAE;IACvCT,OAAO,EAAEzC,qBAAqB,CAACS,GAAG,CAAEwB,GAAG,KAAM;MAC3CnB,KAAK,EAAEmB,GAAG;MACVkB,OAAO,EAAE1D,MAAM,CAACwC,GAAG;IACrB,CAAC,CAAC;EAAE,CACL,CACE,CACF,CAAC;AAEV","ignoreList":[]}
@@ -1,91 +0,0 @@
1
- @import '@teambit/ui-foundation.ui.constants.z-indexes/z-indexes.module.scss';
2
-
3
- .container {
4
- overflow-y: auto;
5
- height: 100%;
6
- box-sizing: border-box;
7
- z-index: 1;
8
- }
9
-
10
- .content {
11
- padding: 20px 40px 80px;
12
- }
13
-
14
- /* ---- Command bar ---- */
15
-
16
- .commandBar {
17
- display: flex;
18
- align-items: center;
19
- justify-content: space-between;
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;
27
- z-index: $modal-z-index - 1;
28
- }
29
-
30
- .leftCluster {
31
- display: flex;
32
- align-items: center;
33
- gap: 8px;
34
- flex-wrap: wrap;
35
- }
36
-
37
- .rightCluster {
38
- display: flex;
39
- align-items: center;
40
- gap: 8px;
41
- margin-left: auto;
42
- }
43
-
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));
48
- }
49
-
50
- /* ---- Base filter overrides ---- */
51
-
52
- .commandBar :global(.baseFilter) {
53
- max-width: 220px;
54
- height: 32px;
55
- }
56
-
57
- .commandBar :global(.control) {
58
- border-radius: 8px !important;
59
- height: 32px;
60
- padding: 0 10px !important;
61
- }
62
-
63
- .commandBar :global(.menu) {
64
- z-index: $modal-z-index - 1 !important;
65
- border-radius: 14px !important;
66
- padding: 8px 0 !important;
67
- width: 260px;
68
- box-shadow: 0 24px 60px -12px rgba(20, 0, 104, 0.2);
69
- }
70
-
71
- /* ---- Section ---- */
72
-
73
- .section {
74
- margin-bottom: 40px;
75
- }
76
-
77
- .sectionHeader {
78
- position: sticky;
79
- top: 57px;
80
- z-index: $nav-z-index;
81
- background: var(--background-color);
82
- padding: 12px 0 18px;
83
- }
84
-
85
- /* ---- Card grid ---- */
86
-
87
- .cardGrid {
88
- display: grid;
89
- grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
90
- gap: 14px;
91
- }
@@ -1 +0,0 @@
1
- export declare function sortNamespacesAdvanced(arr: string[]): string[];
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.sortNamespacesAdvanced = sortNamespacesAdvanced;
7
- const PRIORITY_HIGH = ['ui', 'pages'];
8
- const PRIORITY_MED = ['design'];
9
- const PRIORITY_LOW = ['entities', 'provider', 'hooks', 'icons'];
10
- function root(ns) {
11
- if (!ns) return '';
12
- return ns.split('/')[0];
13
- }
14
- function priorityOf(ns) {
15
- const r = root(ns);
16
- if (PRIORITY_HIGH.includes(r)) return 0;
17
- if (PRIORITY_MED.includes(r)) return 1;
18
- if (PRIORITY_LOW.includes(r)) return 3;
19
- return 2;
20
- }
21
- function sortNamespacesAdvanced(arr) {
22
- return [...arr].sort((a, b) => {
23
- const pa = priorityOf(a);
24
- const pb = priorityOf(b);
25
- if (pa !== pb) return pa - pb;
26
- return a.localeCompare(b);
27
- });
28
- }
29
-
30
- //# sourceMappingURL=workspace-overview.sort.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["PRIORITY_HIGH","PRIORITY_MED","PRIORITY_LOW","root","ns","split","priorityOf","r","includes","sortNamespacesAdvanced","arr","sort","a","b","pa","pb","localeCompare"],"sources":["workspace-overview.sort.ts"],"sourcesContent":["const PRIORITY_HIGH = ['ui', 'pages'];\nconst PRIORITY_MED = ['design'];\nconst PRIORITY_LOW = ['entities', 'provider', 'hooks', 'icons'];\n\nfunction root(ns: string) {\n if (!ns) return '';\n return ns.split('/')[0];\n}\n\nfunction priorityOf(ns: string) {\n const r = root(ns);\n\n if (PRIORITY_HIGH.includes(r)) return 0;\n if (PRIORITY_MED.includes(r)) return 1;\n if (PRIORITY_LOW.includes(r)) return 3;\n\n return 2;\n}\n\nexport function sortNamespacesAdvanced(arr: string[]) {\n return [...arr].sort((a, b) => {\n const pa = priorityOf(a);\n const pb = priorityOf(b);\n\n if (pa !== pb) return pa - pb;\n\n return a.localeCompare(b);\n });\n}\n"],"mappings":";;;;;;AAAA,MAAMA,aAAa,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC;AACrC,MAAMC,YAAY,GAAG,CAAC,QAAQ,CAAC;AAC/B,MAAMC,YAAY,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC;AAE/D,SAASC,IAAIA,CAACC,EAAU,EAAE;EACxB,IAAI,CAACA,EAAE,EAAE,OAAO,EAAE;EAClB,OAAOA,EAAE,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACzB;AAEA,SAASC,UAAUA,CAACF,EAAU,EAAE;EAC9B,MAAMG,CAAC,GAAGJ,IAAI,CAACC,EAAE,CAAC;EAElB,IAAIJ,aAAa,CAACQ,QAAQ,CAACD,CAAC,CAAC,EAAE,OAAO,CAAC;EACvC,IAAIN,YAAY,CAACO,QAAQ,CAACD,CAAC,CAAC,EAAE,OAAO,CAAC;EACtC,IAAIL,YAAY,CAACM,QAAQ,CAACD,CAAC,CAAC,EAAE,OAAO,CAAC;EAEtC,OAAO,CAAC;AACV;AAEO,SAASE,sBAAsBA,CAACC,GAAa,EAAE;EACpD,OAAO,CAAC,GAAGA,GAAG,CAAC,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAK;IAC7B,MAAMC,EAAE,GAAGR,UAAU,CAACM,CAAC,CAAC;IACxB,MAAMG,EAAE,GAAGT,UAAU,CAACO,CAAC,CAAC;IAExB,IAAIC,EAAE,KAAKC,EAAE,EAAE,OAAOD,EAAE,GAAGC,EAAE;IAE7B,OAAOH,CAAC,CAACI,aAAa,CAACH,CAAC,CAAC;EAC3B,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1,28 +0,0 @@
1
- import type { ComponentModel } from '@teambit/component';
2
- import type { ComponentDescriptor } from '@teambit/component-descriptor';
3
- import type { ScopeID } from '@teambit/scopes.scope-id';
4
- export interface WorkspaceItem {
5
- component: ComponentModel;
6
- componentDescriptor: ComponentDescriptor;
7
- scope?: {
8
- id: ScopeID;
9
- icon?: string;
10
- backgroundIconColor?: string;
11
- };
12
- }
13
- export type AggregationType = 'namespaces' | 'scopes' | 'none';
14
- export type Density = 'compact' | 'comfy';
15
- export type ComponentStatus = 'built' | 'changed' | 'building' | 'queued';
16
- export interface AggregationGroup {
17
- name: string;
18
- displayName: string;
19
- items: WorkspaceItem[];
20
- scopeIcon?: string;
21
- scopeIconColor?: string;
22
- }
23
- export interface AggregationResult {
24
- groups: AggregationGroup[];
25
- groupType: AggregationType;
26
- availableAggregations: AggregationType[];
27
- filteredCount: number;
28
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
-
3
- //# sourceMappingURL=workspace-overview.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["workspace-overview.types.ts"],"sourcesContent":["import type { ComponentModel } from '@teambit/component';\nimport type { ComponentDescriptor } from '@teambit/component-descriptor';\nimport type { ScopeID } from '@teambit/scopes.scope-id';\n\nexport interface WorkspaceItem {\n component: ComponentModel;\n componentDescriptor: ComponentDescriptor;\n scope?: { id: ScopeID; icon?: string; backgroundIconColor?: string };\n}\n\nexport type AggregationType = 'namespaces' | 'scopes' | 'none';\n\nexport type Density = 'compact' | 'comfy';\n\nexport type ComponentStatus = 'built' | 'changed' | 'building' | 'queued';\n\nexport interface AggregationGroup {\n name: string;\n displayName: string;\n items: WorkspaceItem[];\n scopeIcon?: string;\n scopeIconColor?: string;\n}\n\nexport interface AggregationResult {\n groups: AggregationGroup[];\n groupType: AggregationType;\n availableAggregations: AggregationType[];\n filteredCount: number;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,72 +0,0 @@
1
- .changedPill {
2
- display: inline-flex;
3
- align-items: center;
4
- gap: 5px;
5
- font-size: 10px;
6
- padding: 3px 8px;
7
- border-radius: 999px;
8
- background: var(--warning-surface-color);
9
- color: var(--warning-color);
10
- font-weight: 600;
11
- letter-spacing: 0.02em;
12
- }
13
-
14
- .changedDot {
15
- width: 5px;
16
- height: 5px;
17
- border-radius: 50%;
18
- background: var(--warning-color);
19
- }
20
-
21
- .spinnerBadge {
22
- width: 22px;
23
- height: 22px;
24
- border-radius: 50%;
25
- background: var(--surface-color);
26
- display: inline-flex;
27
- align-items: center;
28
- justify-content: center;
29
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
30
- }
31
-
32
- .spinnerArc {
33
- transform-origin: center;
34
- animation: spinSlow 0.9s linear infinite;
35
- }
36
-
37
- .buildingPreview {
38
- position: relative;
39
- height: 100%;
40
- }
41
-
42
- .dotsPattern {
43
- position: absolute;
44
- inset: 0;
45
- }
46
-
47
- .buildingPlaceholder {
48
- position: absolute;
49
- inset: 20% 14%;
50
- border-radius: 10px;
51
- background: rgba(255, 255, 255, 0.55);
52
- backdrop-filter: blur(2px);
53
- display: flex;
54
- flex-direction: column;
55
- justify-content: center;
56
- padding: 0 16px;
57
- gap: 7px;
58
- }
59
-
60
- .queuedPreview {
61
- position: absolute;
62
- inset: 0;
63
- display: flex;
64
- align-items: center;
65
- justify-content: center;
66
- }
67
-
68
- @keyframes spinSlow {
69
- to {
70
- transform: rotate(360deg);
71
- }
72
- }
@@ -1,66 +0,0 @@
1
- import React from 'react';
2
- import styles from './card-overlays.module.scss';
3
-
4
- const accent = 'var(--bit-accent-color, #6c5ce7)';
5
- const accentAlpha = (pct: number) => `color-mix(in srgb, var(--bit-accent-color, #6c5ce7) ${pct}%, transparent)`;
6
-
7
- export function ChangedPill() {
8
- return (
9
- <span className={styles.changedPill}>
10
- <span className={styles.changedDot} />
11
- changed
12
- </span>
13
- );
14
- }
15
-
16
- export function BuildSpinner() {
17
- return (
18
- <div className={styles.spinnerBadge}>
19
- <svg width="14" height="14" viewBox="0 0 14 14">
20
- <circle cx="7" cy="7" r="5" stroke={accentAlpha(20)} strokeWidth="1.5" fill="none" />
21
- <circle
22
- cx="7"
23
- cy="7"
24
- r="5"
25
- stroke={accent}
26
- strokeWidth="1.5"
27
- fill="none"
28
- strokeDasharray="8 24"
29
- strokeLinecap="round"
30
- className={styles.spinnerArc}
31
- />
32
- </svg>
33
- </div>
34
- );
35
- }
36
-
37
- export function BuildingPreview() {
38
- return (
39
- <div className={styles.buildingPreview}>
40
- <svg width="100%" height="100%" preserveAspectRatio="none" className={styles.dotsPattern}>
41
- <defs>
42
- <pattern id="dots-accent" width="14" height="14" patternUnits="userSpaceOnUse">
43
- <circle cx="7" cy="7" r="1" fill={accentAlpha(20)} />
44
- </pattern>
45
- </defs>
46
- <rect width="100%" height="100%" fill="url(#dots-accent)" />
47
- </svg>
48
- <div className={styles.buildingPlaceholder} style={{ border: `1.5px dashed ${accentAlpha(40)}` }}>
49
- <div style={{ height: 6, width: '55%', background: accentAlpha(27), borderRadius: 3 }} />
50
- <div style={{ height: 4, width: '85%', background: accentAlpha(13), borderRadius: 2 }} />
51
- <div style={{ height: 4, width: '70%', background: accentAlpha(13), borderRadius: 2 }} />
52
- </div>
53
- </div>
54
- );
55
- }
56
-
57
- export function QueuedPreview() {
58
- return (
59
- <div className={styles.queuedPreview}>
60
- <svg width="46" height="46" viewBox="0 0 46 46">
61
- <circle cx="23" cy="23" r="20" fill="none" stroke={accentAlpha(20)} strokeWidth="1.2" strokeDasharray="3 4" />
62
- <circle cx="23" cy="23" r="3" fill={accentAlpha(53)} />
63
- </svg>
64
- </div>
65
- );
66
- }
@@ -1,42 +0,0 @@
1
- import type { WorkspaceItem, ComponentStatus } from './workspace-overview.types';
2
-
3
- export interface ActiveFilters {
4
- namespaces: string[];
5
- scopes: string[];
6
- statuses: Set<ComponentStatus>;
7
- }
8
-
9
- export const ALL_STATUSES: ComponentStatus[] = ['built', 'changed', 'building', 'queued'];
10
-
11
- export function parseActiveFilters(search: URLSearchParams): ActiveFilters {
12
- return {
13
- namespaces: (search.get('ns') || '').split(',').filter(Boolean),
14
- scopes: (search.get('scopes') || '').split(',').filter(Boolean),
15
- statuses: new Set(ALL_STATUSES),
16
- };
17
- }
18
-
19
- export function getComponentStatus(item: WorkspaceItem): ComponentStatus {
20
- const buildStatus = (item.component as any).buildStatus;
21
- const status = (item.component as any).status;
22
- if (buildStatus === 'pending') return 'queued';
23
- if (status?.modifyInfo?.hasModifiedFiles || status?.modifyInfo?.hasModifiedDependencies) return 'changed';
24
- if (buildStatus === 'building') return 'building';
25
- return 'built';
26
- }
27
-
28
- export function filterItems(items: WorkspaceItem[], filters: ActiveFilters): WorkspaceItem[] {
29
- return items.filter((item) => {
30
- const ns = item.component.id.namespace || '/';
31
- const sc = item.component.id.scope;
32
-
33
- if (filters.namespaces.length && !filters.namespaces.includes(ns)) return false;
34
- if (filters.scopes.length && !filters.scopes.includes(sc)) return false;
35
- if (filters.statuses.size > 0 && filters.statuses.size < ALL_STATUSES.length) {
36
- const componentStatus = getComponentStatus(item);
37
- if (!filters.statuses.has(componentStatus)) return false;
38
- }
39
-
40
- return true;
41
- });
42
- }