@teambit/component 1.0.1212 → 1.0.1214
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.ui.runtime.tsx +45 -52
- package/dist/component.ui.runtime.d.ts +30 -16
- package/dist/component.ui.runtime.js +31 -67
- package/dist/component.ui.runtime.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{preview-1791563417062.js → preview-1791624541512.js} +2 -2
- package/dist/ui/component-model/component-model.d.ts +21 -3
- package/dist/ui/component-model/component-model.js +9 -4
- package/dist/ui/component-model/component-model.js.map +1 -1
- package/dist/ui/component-model/index.d.ts +1 -1
- package/dist/ui/component-model/index.js +12 -0
- package/dist/ui/component-model/index.js.map +1 -1
- package/dist/ui/component-searcher/component-searcher.d.ts +1 -2
- package/dist/ui/component-searcher/component-searcher.js.map +1 -1
- package/package.json +18 -22
- package/ui/component-model/component-model.ts +23 -3
- package/ui/component-model/index.ts +8 -1
- package/ui/component-searcher/component-searcher.tsx +1 -2
package/component.ui.runtime.tsx
CHANGED
|
@@ -3,19 +3,13 @@ import flatten from 'lodash.flatten';
|
|
|
3
3
|
import copy from 'copy-to-clipboard';
|
|
4
4
|
import type { RouteProps } from 'react-router-dom';
|
|
5
5
|
import type { LinkProps } from '@teambit/base-react.navigation.link';
|
|
6
|
-
import type { CommandBarUI, CommandEntry } from '@teambit/command-bar';
|
|
7
|
-
import { CommandBarAspect } from '@teambit/command-bar';
|
|
8
6
|
import { DeprecationIcon } from '@teambit/component.ui.deprecation-icon';
|
|
9
7
|
import type { SlotRegistry } from '@teambit/harmony';
|
|
10
8
|
import { Slot } from '@teambit/harmony';
|
|
11
|
-
import { PreviewAspect, ClickInsideAnIframeEvent } from '@teambit/preview';
|
|
12
|
-
import type { BitBaseEvent, PubsubUI } from '@teambit/pubsub';
|
|
13
|
-
import { PubsubAspect } from '@teambit/pubsub';
|
|
14
9
|
import type { ReactRouterUI } from '@teambit/react-router';
|
|
15
10
|
import { ReactRouterAspect } from '@teambit/react-router';
|
|
16
11
|
import { UIRuntime } from '@teambit/harmony.modules.runtimes';
|
|
17
12
|
import { groupBy } from 'lodash';
|
|
18
|
-
import { isBrowser } from '@teambit/ui-foundation.ui.is-browser';
|
|
19
13
|
import type { MenuItem, MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
20
14
|
import type { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
21
15
|
import { Import } from '@teambit/ui-foundation.ui.use-box.menu';
|
|
@@ -44,6 +38,18 @@ export type ComponentUIConfig = {
|
|
|
44
38
|
commandBar: boolean;
|
|
45
39
|
};
|
|
46
40
|
|
|
41
|
+
/**
|
|
42
|
+
* a command the component page offers to the command bar (the shape of the command-bar's `CommandEntry`).
|
|
43
|
+
*/
|
|
44
|
+
export type ComponentCommand = {
|
|
45
|
+
id: string;
|
|
46
|
+
action: () => void;
|
|
47
|
+
keybinding?: string | string[];
|
|
48
|
+
displayName: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type CommandRunner = (commandId: string) => unknown;
|
|
52
|
+
|
|
47
53
|
export type Server = {
|
|
48
54
|
env: string;
|
|
49
55
|
url: string;
|
|
@@ -55,14 +61,9 @@ export type ComponentMeta = {
|
|
|
55
61
|
|
|
56
62
|
export class ComponentUI {
|
|
57
63
|
readonly routePath = `/*`;
|
|
58
|
-
|
|
64
|
+
readonly componentSearcher: ComponentSearcher;
|
|
59
65
|
|
|
60
66
|
constructor(
|
|
61
|
-
/**
|
|
62
|
-
* Pubsub aspects
|
|
63
|
-
*/
|
|
64
|
-
private pubsub: PubsubUI,
|
|
65
|
-
|
|
66
67
|
private routeSlot: RouteSlot,
|
|
67
68
|
|
|
68
69
|
private navSlot: OrderedNavigationSlot,
|
|
@@ -87,12 +88,14 @@ export class ComponentUI {
|
|
|
87
88
|
|
|
88
89
|
private componentSearchResultSlot: ComponentSearchResultSlot,
|
|
89
90
|
|
|
90
|
-
|
|
91
|
+
reactRouterUi: ReactRouterUI,
|
|
91
92
|
|
|
92
|
-
|
|
93
|
+
/**
|
|
94
|
+
* whether the component page offers its commands and component search to the command bar
|
|
95
|
+
*/
|
|
96
|
+
readonly isCommandBarEnabled: boolean
|
|
93
97
|
) {
|
|
94
98
|
this.componentSearcher = new ComponentSearcher({ navigate: reactRouterUi.navigateTo });
|
|
95
|
-
if (isBrowser) this.registerPubSub();
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
get routes() {
|
|
@@ -110,6 +113,10 @@ export class ComponentUI {
|
|
|
110
113
|
return snapToSemver(version);
|
|
111
114
|
}
|
|
112
115
|
|
|
116
|
+
private copyBitId = () => {
|
|
117
|
+
copy(this.activeComponent?.id.toString() || '');
|
|
118
|
+
};
|
|
119
|
+
|
|
113
120
|
private copyNpmId = () => {
|
|
114
121
|
const packageName = this.activeComponent?.packageName;
|
|
115
122
|
if (packageName) {
|
|
@@ -119,15 +126,26 @@ export class ComponentUI {
|
|
|
119
126
|
}
|
|
120
127
|
};
|
|
121
128
|
|
|
129
|
+
private commandRunner?: CommandRunner;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* set by the command bar, so the menu items can run its commands.
|
|
133
|
+
*/
|
|
134
|
+
registerCommandRunner(commandRunner: CommandRunner) {
|
|
135
|
+
this.commandRunner = commandRunner;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private runCommand(commandId: string) {
|
|
139
|
+
return this.commandRunner?.(commandId);
|
|
140
|
+
}
|
|
141
|
+
|
|
122
142
|
/**
|
|
123
143
|
* key bindings used by component aspect
|
|
124
144
|
*/
|
|
125
|
-
|
|
145
|
+
readonly keyBindings: ComponentCommand[] = [
|
|
126
146
|
{
|
|
127
147
|
id: 'component.copyBitId', // TODO - extract to a component!
|
|
128
|
-
action:
|
|
129
|
-
copy(this.activeComponent?.id.toString() || '');
|
|
130
|
-
},
|
|
148
|
+
action: this.copyBitId,
|
|
131
149
|
displayName: 'Copy component ID',
|
|
132
150
|
keybinding: '.',
|
|
133
151
|
},
|
|
@@ -144,25 +162,25 @@ export class ComponentUI {
|
|
|
144
162
|
category: 'general',
|
|
145
163
|
title: 'Open command bar',
|
|
146
164
|
keyChar: 'mod+k',
|
|
147
|
-
handler: () => this.
|
|
165
|
+
handler: () => this.runCommand('command-bar.open'),
|
|
148
166
|
},
|
|
149
167
|
{
|
|
150
168
|
category: 'general',
|
|
151
169
|
title: 'Toggle component list',
|
|
152
170
|
keyChar: 'alt+s',
|
|
153
|
-
handler: () => this.
|
|
171
|
+
handler: () => this.runCommand('sidebar.toggle'),
|
|
154
172
|
},
|
|
155
173
|
{
|
|
156
174
|
category: 'workflow',
|
|
157
175
|
title: 'Copy component ID',
|
|
158
176
|
keyChar: '.',
|
|
159
|
-
handler:
|
|
177
|
+
handler: this.copyBitId,
|
|
160
178
|
},
|
|
161
179
|
{
|
|
162
180
|
category: 'workflow',
|
|
163
181
|
title: 'Copy component package name',
|
|
164
182
|
keyChar: ',',
|
|
165
|
-
handler:
|
|
183
|
+
handler: this.copyNpmId,
|
|
166
184
|
},
|
|
167
185
|
];
|
|
168
186
|
|
|
@@ -194,21 +212,6 @@ export class ComponentUI {
|
|
|
194
212
|
};
|
|
195
213
|
};
|
|
196
214
|
|
|
197
|
-
registerPubSub() {
|
|
198
|
-
this.pubsub.sub(PreviewAspect.id, (be: BitBaseEvent<any>) => {
|
|
199
|
-
if (be.type === ClickInsideAnIframeEvent.TYPE) {
|
|
200
|
-
const event = new MouseEvent('mousedown', {
|
|
201
|
-
view: window,
|
|
202
|
-
bubbles: true,
|
|
203
|
-
cancelable: true,
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
const body = document.body;
|
|
207
|
-
body?.dispatchEvent(event);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
|
|
212
215
|
handleComponentChange = (activeComponent?: ComponentModel) => {
|
|
213
216
|
this.activeComponent = activeComponent;
|
|
214
217
|
};
|
|
@@ -304,7 +307,7 @@ export class ComponentUI {
|
|
|
304
307
|
this.componentSearcher.update(components || []);
|
|
305
308
|
};
|
|
306
309
|
|
|
307
|
-
static dependencies = [
|
|
310
|
+
static dependencies = [ReactRouterAspect];
|
|
308
311
|
|
|
309
312
|
static runtime = UIRuntime;
|
|
310
313
|
|
|
@@ -324,7 +327,7 @@ export class ComponentUI {
|
|
|
324
327
|
};
|
|
325
328
|
|
|
326
329
|
static async provider(
|
|
327
|
-
[
|
|
330
|
+
[reactRouterUI]: [ReactRouterUI],
|
|
328
331
|
config: ComponentUIConfig,
|
|
329
332
|
[
|
|
330
333
|
routeSlot,
|
|
@@ -351,7 +354,6 @@ export class ComponentUI {
|
|
|
351
354
|
// TODO: refactor ComponentHost to a separate extension (including sidebar, host, graphql, etc.)
|
|
352
355
|
// TODO: add contextual hook for ComponentHost @uri/@oded
|
|
353
356
|
const componentUI = new ComponentUI(
|
|
354
|
-
pubsub,
|
|
355
357
|
routeSlot,
|
|
356
358
|
navSlot,
|
|
357
359
|
consumeMethodSlot,
|
|
@@ -361,26 +363,17 @@ export class ComponentUI {
|
|
|
361
363
|
menuItemSlot,
|
|
362
364
|
pageSlot,
|
|
363
365
|
componentSearchResultSlot,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
+
reactRouterUI,
|
|
367
|
+
config.commandBar
|
|
366
368
|
);
|
|
367
369
|
const aspectSection = new AspectSection();
|
|
368
370
|
// @ts-ignore
|
|
369
371
|
componentUI.registerSearchResultWidget({ key: 'deprecation', end: DeprecationIcon });
|
|
370
372
|
|
|
371
|
-
if (componentUI.commandBarUI && config.commandBar) {
|
|
372
|
-
componentUI.commandBarUI.addCommand(...componentUI.keyBindings);
|
|
373
|
-
commandBarUI.addSearcher(componentUI.componentSearcher);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
373
|
componentUI.registerMenuItem(componentUI.menuItems);
|
|
377
374
|
componentUI.registerRoute(aspectSection.route);
|
|
378
375
|
componentUI.registerWidget(aspectSection.navigationLink, aspectSection.order);
|
|
379
376
|
componentUI.registerConsumeMethod(componentUI.bitMethod);
|
|
380
|
-
componentUI.registerRightSideMenuItem({
|
|
381
|
-
item: <commandBarUI.CommandBarButton />,
|
|
382
|
-
order: 90,
|
|
383
|
-
});
|
|
384
377
|
return componentUI;
|
|
385
378
|
}
|
|
386
379
|
}
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { RouteProps } from 'react-router-dom';
|
|
3
3
|
import type { LinkProps } from '@teambit/base-react.navigation.link';
|
|
4
|
-
import type { CommandBarUI } from '@teambit/command-bar';
|
|
5
4
|
import type { SlotRegistry } from '@teambit/harmony';
|
|
6
|
-
import type { PubsubUI } from '@teambit/pubsub';
|
|
7
5
|
import type { ReactRouterUI } from '@teambit/react-router';
|
|
8
6
|
import type { MenuItem, MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
9
7
|
import type { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
10
8
|
import type { ComponentModel } from './ui';
|
|
11
9
|
import type { ComponentPageElement, ComponentPageSlot } from './ui/component';
|
|
12
10
|
import type { ComponentResultPlugin } from './ui/component-searcher';
|
|
11
|
+
import { ComponentSearcher } from './ui/component-searcher';
|
|
13
12
|
import type { ConsumeMethodSlot, ConsumePlugin, NavPlugin, OrderedNavigationSlot, RightSideMenuItem, RightSideMenuSlot } from './ui/menu';
|
|
14
13
|
import type { GetComponentsOptions } from './get-component-opts';
|
|
15
14
|
export type ComponentSearchResultSlot = SlotRegistry<ComponentResultPlugin[]>;
|
|
16
15
|
export type ComponentUIConfig = {
|
|
17
16
|
commandBar: boolean;
|
|
18
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* a command the component page offers to the command bar (the shape of the command-bar's `CommandEntry`).
|
|
20
|
+
*/
|
|
21
|
+
export type ComponentCommand = {
|
|
22
|
+
id: string;
|
|
23
|
+
action: () => void;
|
|
24
|
+
keybinding?: string | string[];
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export type CommandRunner = (commandId: string) => unknown;
|
|
19
28
|
export type Server = {
|
|
20
29
|
env: string;
|
|
21
30
|
url: string;
|
|
@@ -24,10 +33,6 @@ export type ComponentMeta = {
|
|
|
24
33
|
id: string;
|
|
25
34
|
};
|
|
26
35
|
export declare class ComponentUI {
|
|
27
|
-
/**
|
|
28
|
-
* Pubsub aspects
|
|
29
|
-
*/
|
|
30
|
-
private pubsub;
|
|
31
36
|
private routeSlot;
|
|
32
37
|
private navSlot;
|
|
33
38
|
readonly consumeMethodSlot: ConsumeMethodSlot;
|
|
@@ -46,14 +51,13 @@ export declare class ComponentUI {
|
|
|
46
51
|
private menuItemSlot;
|
|
47
52
|
private pageItemSlot;
|
|
48
53
|
private componentSearchResultSlot;
|
|
49
|
-
private commandBarUI;
|
|
50
|
-
readonly routePath = "/*";
|
|
51
|
-
private componentSearcher;
|
|
52
|
-
constructor(
|
|
53
54
|
/**
|
|
54
|
-
*
|
|
55
|
+
* whether the component page offers its commands and component search to the command bar
|
|
55
56
|
*/
|
|
56
|
-
|
|
57
|
+
readonly isCommandBarEnabled: boolean;
|
|
58
|
+
readonly routePath = "/*";
|
|
59
|
+
readonly componentSearcher: ComponentSearcher;
|
|
60
|
+
constructor(routeSlot: RouteSlot, navSlot: OrderedNavigationSlot, consumeMethodSlot: ConsumeMethodSlot,
|
|
57
61
|
/**
|
|
58
62
|
* slot for registering a new widget to the menu.
|
|
59
63
|
*/
|
|
@@ -65,21 +69,31 @@ export declare class ComponentUI {
|
|
|
65
69
|
/**
|
|
66
70
|
* slot for registering the right section of the menu
|
|
67
71
|
*/
|
|
68
|
-
rightSideMenuSlot: RightSideMenuSlot, menuItemSlot: MenuItemSlot, pageItemSlot: ComponentPageSlot, componentSearchResultSlot: ComponentSearchResultSlot,
|
|
72
|
+
rightSideMenuSlot: RightSideMenuSlot, menuItemSlot: MenuItemSlot, pageItemSlot: ComponentPageSlot, componentSearchResultSlot: ComponentSearchResultSlot, reactRouterUi: ReactRouterUI,
|
|
73
|
+
/**
|
|
74
|
+
* whether the component page offers its commands and component search to the command bar
|
|
75
|
+
*/
|
|
76
|
+
isCommandBarEnabled: boolean);
|
|
69
77
|
get routes(): [string, RouteProps[]][];
|
|
70
78
|
/**
|
|
71
79
|
* the current visible component
|
|
72
80
|
*/
|
|
73
81
|
private activeComponent?;
|
|
74
82
|
formatToInstallableVersion(version: string): string;
|
|
83
|
+
private copyBitId;
|
|
75
84
|
private copyNpmId;
|
|
85
|
+
private commandRunner?;
|
|
86
|
+
/**
|
|
87
|
+
* set by the command bar, so the menu items can run its commands.
|
|
88
|
+
*/
|
|
89
|
+
registerCommandRunner(commandRunner: CommandRunner): void;
|
|
90
|
+
private runCommand;
|
|
76
91
|
/**
|
|
77
92
|
* key bindings used by component aspect
|
|
78
93
|
*/
|
|
79
|
-
|
|
94
|
+
readonly keyBindings: ComponentCommand[];
|
|
80
95
|
private menuItems;
|
|
81
96
|
private bitMethod;
|
|
82
|
-
registerPubSub(): void;
|
|
83
97
|
handleComponentChange: (activeComponent?: ComponentModel) => void;
|
|
84
98
|
getComponentUI(host: string, options?: GetComponentsOptions): React.JSX.Element;
|
|
85
99
|
getMenu(host: string, options?: GetComponentsOptions): React.JSX.Element;
|
|
@@ -99,7 +113,7 @@ export declare class ComponentUI {
|
|
|
99
113
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
100
114
|
static slots: (((registerFn: () => string) => SlotRegistry<ComponentPageSlot>) | ((registerFn: () => string) => SlotRegistry<ComponentSearchResultSlot>) | ((registerFn: () => string) => SlotRegistry<ConsumeMethodSlot>) | ((registerFn: () => string) => SlotRegistry<MenuItemSlot>) | ((registerFn: () => string) => SlotRegistry<NavPlugin>) | ((registerFn: () => string) => SlotRegistry<NavigationSlot>) | ((registerFn: () => string) => SlotRegistry<RightSideMenuSlot>) | ((registerFn: () => string) => SlotRegistry<RouteProps>))[];
|
|
101
115
|
static defaultConfig: ComponentUIConfig;
|
|
102
|
-
static provider([
|
|
116
|
+
static provider([reactRouterUI]: [ReactRouterUI], config: ComponentUIConfig, [routeSlot, navSlot, consumeMethodSlot, widgetSlot, menuItemSlot, pageSlot, componentSearchResultSlot, rightSideMenuSlot, pinnedWidgetSlot,]: [
|
|
103
117
|
RouteSlot,
|
|
104
118
|
OrderedNavigationSlot,
|
|
105
119
|
ConsumeMethodSlot,
|
|
@@ -25,13 +25,6 @@ function _copyToClipboard() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
function _commandBar() {
|
|
29
|
-
const data = require("@teambit/command-bar");
|
|
30
|
-
_commandBar = function () {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
28
|
function _componentUi() {
|
|
36
29
|
const data = require("@teambit/component.ui.deprecation-icon");
|
|
37
30
|
_componentUi = function () {
|
|
@@ -46,20 +39,6 @@ function _harmony() {
|
|
|
46
39
|
};
|
|
47
40
|
return data;
|
|
48
41
|
}
|
|
49
|
-
function _preview() {
|
|
50
|
-
const data = require("@teambit/preview");
|
|
51
|
-
_preview = function () {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
return data;
|
|
55
|
-
}
|
|
56
|
-
function _pubsub() {
|
|
57
|
-
const data = require("@teambit/pubsub");
|
|
58
|
-
_pubsub = function () {
|
|
59
|
-
return data;
|
|
60
|
-
};
|
|
61
|
-
return data;
|
|
62
|
-
}
|
|
63
42
|
function _reactRouter() {
|
|
64
43
|
const data = require("@teambit/react-router");
|
|
65
44
|
_reactRouter = function () {
|
|
@@ -81,13 +60,6 @@ function _lodash2() {
|
|
|
81
60
|
};
|
|
82
61
|
return data;
|
|
83
62
|
}
|
|
84
|
-
function _uiFoundationUi() {
|
|
85
|
-
const data = require("@teambit/ui-foundation.ui.is-browser");
|
|
86
|
-
_uiFoundationUi = function () {
|
|
87
|
-
return data;
|
|
88
|
-
};
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
63
|
function _uiFoundationUiUseBox() {
|
|
92
64
|
const data = require("@teambit/ui-foundation.ui.use-box.menu");
|
|
93
65
|
_uiFoundationUiUseBox = function () {
|
|
@@ -141,12 +113,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
141
113
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
142
114
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
143
115
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
116
|
+
/**
|
|
117
|
+
* a command the component page offers to the command bar (the shape of the command-bar's `CommandEntry`).
|
|
118
|
+
*/
|
|
119
|
+
|
|
144
120
|
class ComponentUI {
|
|
145
|
-
constructor(
|
|
146
|
-
/**
|
|
147
|
-
* Pubsub aspects
|
|
148
|
-
*/
|
|
149
|
-
pubsub, routeSlot, navSlot, consumeMethodSlot,
|
|
121
|
+
constructor(routeSlot, navSlot, consumeMethodSlot,
|
|
150
122
|
/**
|
|
151
123
|
* slot for registering a new widget to the menu.
|
|
152
124
|
*/
|
|
@@ -158,8 +130,11 @@ class ComponentUI {
|
|
|
158
130
|
/**
|
|
159
131
|
* slot for registering the right section of the menu
|
|
160
132
|
*/
|
|
161
|
-
rightSideMenuSlot, menuItemSlot, pageItemSlot, componentSearchResultSlot,
|
|
162
|
-
|
|
133
|
+
rightSideMenuSlot, menuItemSlot, pageItemSlot, componentSearchResultSlot, reactRouterUi,
|
|
134
|
+
/**
|
|
135
|
+
* whether the component page offers its commands and component search to the command bar
|
|
136
|
+
*/
|
|
137
|
+
isCommandBarEnabled) {
|
|
163
138
|
this.routeSlot = routeSlot;
|
|
164
139
|
this.navSlot = navSlot;
|
|
165
140
|
this.consumeMethodSlot = consumeMethodSlot;
|
|
@@ -169,13 +144,16 @@ class ComponentUI {
|
|
|
169
144
|
this.menuItemSlot = menuItemSlot;
|
|
170
145
|
this.pageItemSlot = pageItemSlot;
|
|
171
146
|
this.componentSearchResultSlot = componentSearchResultSlot;
|
|
172
|
-
this.
|
|
147
|
+
this.isCommandBarEnabled = isCommandBarEnabled;
|
|
173
148
|
_defineProperty(this, "routePath", `/*`);
|
|
174
149
|
_defineProperty(this, "componentSearcher", void 0);
|
|
175
150
|
/**
|
|
176
151
|
* the current visible component
|
|
177
152
|
*/
|
|
178
153
|
_defineProperty(this, "activeComponent", void 0);
|
|
154
|
+
_defineProperty(this, "copyBitId", () => {
|
|
155
|
+
(0, _copyToClipboard().default)(this.activeComponent?.id.toString() || '');
|
|
156
|
+
});
|
|
179
157
|
_defineProperty(this, "copyNpmId", () => {
|
|
180
158
|
const packageName = this.activeComponent?.packageName;
|
|
181
159
|
if (packageName) {
|
|
@@ -184,15 +162,14 @@ class ComponentUI {
|
|
|
184
162
|
(0, _copyToClipboard().default)(`${packageName}${versionString}`);
|
|
185
163
|
}
|
|
186
164
|
});
|
|
165
|
+
_defineProperty(this, "commandRunner", void 0);
|
|
187
166
|
/**
|
|
188
167
|
* key bindings used by component aspect
|
|
189
168
|
*/
|
|
190
169
|
_defineProperty(this, "keyBindings", [{
|
|
191
170
|
id: 'component.copyBitId',
|
|
192
171
|
// TODO - extract to a component!
|
|
193
|
-
action:
|
|
194
|
-
(0, _copyToClipboard().default)(this.activeComponent?.id.toString() || '');
|
|
195
|
-
},
|
|
172
|
+
action: this.copyBitId,
|
|
196
173
|
displayName: 'Copy component ID',
|
|
197
174
|
keybinding: '.'
|
|
198
175
|
}, {
|
|
@@ -206,22 +183,22 @@ class ComponentUI {
|
|
|
206
183
|
category: 'general',
|
|
207
184
|
title: 'Open command bar',
|
|
208
185
|
keyChar: 'mod+k',
|
|
209
|
-
handler: () => this.
|
|
186
|
+
handler: () => this.runCommand('command-bar.open')
|
|
210
187
|
}, {
|
|
211
188
|
category: 'general',
|
|
212
189
|
title: 'Toggle component list',
|
|
213
190
|
keyChar: 'alt+s',
|
|
214
|
-
handler: () => this.
|
|
191
|
+
handler: () => this.runCommand('sidebar.toggle')
|
|
215
192
|
}, {
|
|
216
193
|
category: 'workflow',
|
|
217
194
|
title: 'Copy component ID',
|
|
218
195
|
keyChar: '.',
|
|
219
|
-
handler:
|
|
196
|
+
handler: this.copyBitId
|
|
220
197
|
}, {
|
|
221
198
|
category: 'workflow',
|
|
222
199
|
title: 'Copy component package name',
|
|
223
200
|
keyChar: ',',
|
|
224
|
-
handler:
|
|
201
|
+
handler: this.copyNpmId
|
|
225
202
|
}]);
|
|
226
203
|
_defineProperty(this, "bitMethod", ({
|
|
227
204
|
options,
|
|
@@ -273,7 +250,6 @@ class ComponentUI {
|
|
|
273
250
|
this.componentSearcher = new (_componentSearcher().ComponentSearcher)({
|
|
274
251
|
navigate: reactRouterUi.navigateTo
|
|
275
252
|
});
|
|
276
|
-
if (_uiFoundationUi().isBrowser) this.registerPubSub();
|
|
277
253
|
}
|
|
278
254
|
get routes() {
|
|
279
255
|
return this.routeSlot.toArray().map(([key, routes]) => [key, Array.isArray(routes) ? [...(0, _lodash().default)(routes)] : [routes]]);
|
|
@@ -281,18 +257,14 @@ class ComponentUI {
|
|
|
281
257
|
formatToInstallableVersion(version) {
|
|
282
258
|
return (0, _componentPackageVersion().snapToSemver)(version);
|
|
283
259
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const body = document.body;
|
|
293
|
-
body?.dispatchEvent(event);
|
|
294
|
-
}
|
|
295
|
-
});
|
|
260
|
+
/**
|
|
261
|
+
* set by the command bar, so the menu items can run its commands.
|
|
262
|
+
*/
|
|
263
|
+
registerCommandRunner(commandRunner) {
|
|
264
|
+
this.commandRunner = commandRunner;
|
|
265
|
+
}
|
|
266
|
+
runCommand(commandId) {
|
|
267
|
+
return this.commandRunner?.(commandId);
|
|
296
268
|
}
|
|
297
269
|
getComponentUI(host, options = {}) {
|
|
298
270
|
return /*#__PURE__*/_react().default.createElement(_component2().Component, {
|
|
@@ -358,33 +330,25 @@ class ComponentUI {
|
|
|
358
330
|
registerRightSideMenuItem(...rightSideMenuItem) {
|
|
359
331
|
this.rightSideMenuSlot.register(rightSideMenuItem);
|
|
360
332
|
}
|
|
361
|
-
static async provider([
|
|
333
|
+
static async provider([reactRouterUI], config, [routeSlot, navSlot, consumeMethodSlot, widgetSlot, menuItemSlot, pageSlot, componentSearchResultSlot, rightSideMenuSlot, pinnedWidgetSlot]) {
|
|
362
334
|
// TODO: refactor ComponentHost to a separate extension (including sidebar, host, graphql, etc.)
|
|
363
335
|
// TODO: add contextual hook for ComponentHost @uri/@oded
|
|
364
|
-
const componentUI = new ComponentUI(
|
|
336
|
+
const componentUI = new ComponentUI(routeSlot, navSlot, consumeMethodSlot, widgetSlot, pinnedWidgetSlot, rightSideMenuSlot, menuItemSlot, pageSlot, componentSearchResultSlot, reactRouterUI, config.commandBar);
|
|
365
337
|
const aspectSection = new (_aspect().AspectSection)();
|
|
366
338
|
// @ts-ignore
|
|
367
339
|
componentUI.registerSearchResultWidget({
|
|
368
340
|
key: 'deprecation',
|
|
369
341
|
end: _componentUi().DeprecationIcon
|
|
370
342
|
});
|
|
371
|
-
if (componentUI.commandBarUI && config.commandBar) {
|
|
372
|
-
componentUI.commandBarUI.addCommand(...componentUI.keyBindings);
|
|
373
|
-
commandBarUI.addSearcher(componentUI.componentSearcher);
|
|
374
|
-
}
|
|
375
343
|
componentUI.registerMenuItem(componentUI.menuItems);
|
|
376
344
|
componentUI.registerRoute(aspectSection.route);
|
|
377
345
|
componentUI.registerWidget(aspectSection.navigationLink, aspectSection.order);
|
|
378
346
|
componentUI.registerConsumeMethod(componentUI.bitMethod);
|
|
379
|
-
componentUI.registerRightSideMenuItem({
|
|
380
|
-
item: /*#__PURE__*/_react().default.createElement(commandBarUI.CommandBarButton, null),
|
|
381
|
-
order: 90
|
|
382
|
-
});
|
|
383
347
|
return componentUI;
|
|
384
348
|
}
|
|
385
349
|
}
|
|
386
350
|
exports.ComponentUI = ComponentUI;
|
|
387
|
-
_defineProperty(ComponentUI, "dependencies", [
|
|
351
|
+
_defineProperty(ComponentUI, "dependencies", [_reactRouter().ReactRouterAspect]);
|
|
388
352
|
_defineProperty(ComponentUI, "runtime", _harmonyModules().UIRuntime);
|
|
389
353
|
_defineProperty(ComponentUI, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
|
|
390
354
|
_defineProperty(ComponentUI, "defaultConfig", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_lodash","_copyToClipboard","_commandBar","_componentUi","_harmony","_preview","_pubsub","_reactRouter","_harmonyModules","_lodash2","_uiFoundationUi","_uiFoundationUiUseBox","_componentPackageVersion","_aspect","_component","_component2","_componentSearcher","_menu","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ComponentUI","constructor","pubsub","routeSlot","navSlot","consumeMethodSlot","widgetSlot","pinnedWidgetSlot","rightSideMenuSlot","menuItemSlot","pageItemSlot","componentSearchResultSlot","commandBarUI","reactRouterUi","packageName","activeComponent","version","id","versionString","formatToInstallableVersion","copy","action","toString","displayName","keybinding","copyNpmId","category","title","keyChar","handler","run","options","componentId","packageNameFromProps","latest","latestFromProps","componentModel","packageVersion","Title","createElement","style","width","src","Component","hide","Import","ignoreVersion","componentName","name","showInstallMethod","disableInstall","order","menuItems","register","items","totalPlugins","flatten","values","componentSearcher","updatePlugins","components","update","ComponentSearcher","navigate","navigateTo","isBrowser","registerPubSub","routes","toArray","map","key","Array","isArray","snapToSemver","sub","PreviewAspect","be","type","ClickInsideAnIframeEvent","TYPE","event","MouseEvent","view","window","bubbles","cancelable","body","document","dispatchEvent","getComponentUI","host","containerSlot","onComponentChange","handleComponentChange","path","useComponent","componentIdStr","useComponentFilters","overriddenRoutes","getMenu","ComponentMenu","className","skipRightSide","navigationSlot","RightNode","authToken","listMenuItems","mainMenuItems","groupBy","registerRoute","registerNavigation","nav","props","registerConsumeMethod","consumeMethods","registerWidget","widget","registerPinnedWidget","registerRightSideMenuItem","rightSideMenuItem","provider","reactRouterUI","config","pageSlot","componentUI","aspectSection","AspectSection","registerSearchResultWidget","end","DeprecationIcon","commandBar","addCommand","keyBindings","addSearcher","registerMenuItem","route","navigationLink","bitMethod","item","CommandBarButton","exports","PubsubAspect","CommandBarAspect","ReactRouterAspect","UIRuntime","Slot","withType","_default","ComponentAspect","addRuntime"],"sources":["component.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport flatten from 'lodash.flatten';\nimport copy from 'copy-to-clipboard';\nimport type { RouteProps } from 'react-router-dom';\nimport type { LinkProps } from '@teambit/base-react.navigation.link';\nimport type { CommandBarUI, CommandEntry } from '@teambit/command-bar';\nimport { CommandBarAspect } from '@teambit/command-bar';\nimport { DeprecationIcon } from '@teambit/component.ui.deprecation-icon';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport { PreviewAspect, ClickInsideAnIframeEvent } from '@teambit/preview';\nimport type { BitBaseEvent, PubsubUI } from '@teambit/pubsub';\nimport { PubsubAspect } from '@teambit/pubsub';\nimport type { ReactRouterUI } from '@teambit/react-router';\nimport { ReactRouterAspect } from '@teambit/react-router';\nimport { UIRuntime } from '@teambit/harmony.modules.runtimes';\nimport { groupBy } from 'lodash';\nimport { isBrowser } from '@teambit/ui-foundation.ui.is-browser';\nimport type { MenuItem, MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';\nimport type { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { Import } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { snapToSemver } from '@teambit/component-package-version';\nimport { AspectSection } from './aspect.section';\nimport { ComponentAspect } from './component.aspect';\nimport type { ComponentModel } from './ui';\nimport type { ComponentPageElement, ComponentPageSlot } from './ui/component';\nimport { Component } from './ui/component';\nimport type { ComponentResultPlugin } from './ui/component-searcher';\nimport { ComponentSearcher } from './ui/component-searcher';\nimport type {\n ConsumeMethodSlot,\n ConsumePlugin,\n NavPlugin,\n OrderedNavigationSlot,\n RightSideMenuItem,\n RightSideMenuSlot,\n} from './ui/menu';\nimport { ComponentMenu } from './ui/menu';\nimport type { GetComponentsOptions } from './get-component-opts';\n\nexport type ComponentSearchResultSlot = SlotRegistry<ComponentResultPlugin[]>;\n\nexport type ComponentUIConfig = {\n commandBar: boolean;\n};\n\nexport type Server = {\n env: string;\n url: string;\n};\n\nexport type ComponentMeta = {\n id: string;\n};\n\nexport class ComponentUI {\n readonly routePath = `/*`;\n private componentSearcher: ComponentSearcher;\n\n constructor(\n /**\n * Pubsub aspects\n */\n private pubsub: PubsubUI,\n\n private routeSlot: RouteSlot,\n\n private navSlot: OrderedNavigationSlot,\n\n readonly consumeMethodSlot: ConsumeMethodSlot,\n /**\n * slot for registering a new widget to the menu.\n */\n private widgetSlot: OrderedNavigationSlot,\n /**\n * slot for registering pinned widgets to the menu\n */\n private pinnedWidgetSlot: OrderedNavigationSlot,\n /**\n * slot for registering the right section of the menu\n */\n private rightSideMenuSlot: RightSideMenuSlot,\n\n private menuItemSlot: MenuItemSlot,\n\n private pageItemSlot: ComponentPageSlot,\n\n private componentSearchResultSlot: ComponentSearchResultSlot,\n\n private commandBarUI: CommandBarUI,\n\n reactRouterUi: ReactRouterUI\n ) {\n this.componentSearcher = new ComponentSearcher({ navigate: reactRouterUi.navigateTo });\n if (isBrowser) this.registerPubSub();\n }\n\n get routes() {\n return this.routeSlot\n .toArray()\n .map(([key, routes]) => [key, Array.isArray(routes) ? [...flatten(routes)] : [routes]] as [string, RouteProps[]]);\n }\n\n /**\n * the current visible component\n */\n private activeComponent?: ComponentModel;\n\n formatToInstallableVersion(version: string) {\n return snapToSemver(version);\n }\n\n private copyNpmId = () => {\n const packageName = this.activeComponent?.packageName;\n if (packageName) {\n const version = this.activeComponent?.id.version;\n const versionString = version ? `@${this.formatToInstallableVersion(version)}` : '';\n copy(`${packageName}${versionString}`);\n }\n };\n\n /**\n * key bindings used by component aspect\n */\n private keyBindings: CommandEntry[] = [\n {\n id: 'component.copyBitId', // TODO - extract to a component!\n action: () => {\n copy(this.activeComponent?.id.toString() || '');\n },\n displayName: 'Copy component ID',\n keybinding: '.',\n },\n {\n id: 'component.copyNpmId', // TODO - extract to a component!\n action: this.copyNpmId,\n displayName: 'Copy component package name',\n keybinding: ',',\n },\n ];\n\n private menuItems: MenuItem[] = [\n {\n category: 'general',\n title: 'Open command bar',\n keyChar: 'mod+k',\n handler: () => this.commandBarUI?.run('command-bar.open'),\n },\n {\n category: 'general',\n title: 'Toggle component list',\n keyChar: 'alt+s',\n handler: () => this.commandBarUI?.run('sidebar.toggle'),\n },\n {\n category: 'workflow',\n title: 'Copy component ID',\n keyChar: '.',\n handler: () => this.commandBarUI?.run('component.copyBitId'),\n },\n {\n category: 'workflow',\n title: 'Copy component package name',\n keyChar: ',',\n handler: () => this.commandBarUI?.run('component.copyNpmId'),\n },\n ];\n\n private bitMethod: ConsumePlugin = ({\n options,\n id: componentId,\n packageName: packageNameFromProps,\n latest: latestFromProps,\n componentModel,\n }) => {\n const packageName = packageNameFromProps || componentModel?.packageName;\n const latest = latestFromProps || componentModel?.id.version;\n\n const version = componentId.version === latest ? '' : `@${componentId.version}`;\n const packageVersion =\n componentId.version === latest ? '' : `@${this.formatToInstallableVersion(componentId.version as string)}`;\n\n return {\n Title: <img style={{ width: '20px' }} src=\"https://static.bit.dev/brands/bit-logo-text.svg\" />,\n Component: !options?.hide ? (\n <Import\n componentId={`${componentId.toString({ ignoreVersion: true })}${version}`}\n packageName={`${packageName}${packageVersion}`}\n componentName={componentId.name}\n showInstallMethod={!options?.disableInstall}\n />\n ) : null,\n order: 0,\n };\n };\n\n registerPubSub() {\n this.pubsub.sub(PreviewAspect.id, (be: BitBaseEvent<any>) => {\n if (be.type === ClickInsideAnIframeEvent.TYPE) {\n const event = new MouseEvent('mousedown', {\n view: window,\n bubbles: true,\n cancelable: true,\n });\n\n const body = document.body;\n body?.dispatchEvent(event);\n }\n });\n }\n\n handleComponentChange = (activeComponent?: ComponentModel) => {\n this.activeComponent = activeComponent;\n };\n\n getComponentUI(host: string, options: GetComponentsOptions = {}) {\n return (\n <Component\n routeSlot={this.routeSlot}\n containerSlot={this.pageItemSlot}\n onComponentChange={this.handleComponentChange}\n host={host}\n path={options.path}\n useComponent={options.useComponent}\n componentIdStr={options.componentId}\n useComponentFilters={options.useComponentFilters}\n overriddenRoutes={options.routes}\n />\n );\n }\n\n getMenu(host: string, options: GetComponentsOptions = {}) {\n return (\n <ComponentMenu\n className={options.className}\n skipRightSide={options.skipRightSide}\n navigationSlot={this.navSlot}\n consumeMethodSlot={this.consumeMethodSlot}\n rightSideMenuSlot={this.rightSideMenuSlot}\n widgetSlot={this.widgetSlot}\n host={host}\n menuItemSlot={this.menuItemSlot}\n useComponent={options.useComponent}\n path={options.path}\n componentIdStr={options.componentId}\n useComponentFilters={options.useComponentFilters}\n RightNode={options.RightNode}\n authToken={options.authToken}\n pinnedWidgetSlot={this.pinnedWidgetSlot}\n />\n );\n }\n\n listMenuItems() {\n const mainMenuItems = groupBy(flatten(this.menuItemSlot.values()), 'category');\n return mainMenuItems;\n }\n\n registerRoute(routes: RouteProps[] | RouteProps) {\n this.routeSlot.register(routes);\n return this;\n }\n\n registerNavigation(nav: LinkProps, order?: number) {\n this.navSlot.register({\n props: nav,\n order,\n });\n }\n\n registerConsumeMethod(...consumeMethods: ConsumePlugin[]) {\n this.consumeMethodSlot.register(consumeMethods);\n }\n\n registerWidget(widget: LinkProps, order?: number) {\n this.widgetSlot.register({ props: widget, order });\n }\n\n registerPinnedWidget(widget: LinkProps, order?: number) {\n this.pinnedWidgetSlot.register({ props: widget, order });\n }\n\n registerRightSideMenuItem(...rightSideMenuItem: RightSideMenuItem[]) {\n this.rightSideMenuSlot.register(rightSideMenuItem);\n }\n\n registerMenuItem = (menuItems: MenuItem[]) => {\n this.menuItemSlot.register(menuItems);\n };\n\n registerPageItem = (...items: ComponentPageElement[]) => {\n this.pageItemSlot.register(items);\n };\n\n /** register widgets to the components listed in the command bar */\n registerSearchResultWidget = (...items: ComponentResultPlugin[]) => {\n this.componentSearchResultSlot.register(items);\n const totalPlugins = flatten(this.componentSearchResultSlot.values());\n\n this.componentSearcher.updatePlugins(totalPlugins);\n };\n\n updateComponents = (components: ComponentModel[]) => {\n this.componentSearcher.update(components || []);\n };\n\n static dependencies = [PubsubAspect, CommandBarAspect, ReactRouterAspect];\n\n static runtime = UIRuntime;\n\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<NavPlugin>(),\n Slot.withType<NavigationSlot>(),\n Slot.withType<ConsumeMethodSlot>(),\n Slot.withType<MenuItemSlot>(),\n Slot.withType<ComponentPageSlot>(),\n Slot.withType<ComponentSearchResultSlot>(),\n Slot.withType<RightSideMenuSlot>(),\n Slot.withType<NavPlugin>(),\n ];\n static defaultConfig: ComponentUIConfig = {\n commandBar: true,\n };\n\n static async provider(\n [pubsub, commandBarUI, reactRouterUI]: [PubsubUI, CommandBarUI, ReactRouterUI],\n config: ComponentUIConfig,\n [\n routeSlot,\n navSlot,\n consumeMethodSlot,\n widgetSlot,\n menuItemSlot,\n pageSlot,\n componentSearchResultSlot,\n rightSideMenuSlot,\n pinnedWidgetSlot,\n ]: [\n RouteSlot,\n OrderedNavigationSlot,\n ConsumeMethodSlot,\n OrderedNavigationSlot,\n MenuItemSlot,\n ComponentPageSlot,\n ComponentSearchResultSlot,\n RightSideMenuSlot,\n OrderedNavigationSlot,\n ]\n ) {\n // TODO: refactor ComponentHost to a separate extension (including sidebar, host, graphql, etc.)\n // TODO: add contextual hook for ComponentHost @uri/@oded\n const componentUI = new ComponentUI(\n pubsub,\n routeSlot,\n navSlot,\n consumeMethodSlot,\n widgetSlot,\n pinnedWidgetSlot,\n rightSideMenuSlot,\n menuItemSlot,\n pageSlot,\n componentSearchResultSlot,\n commandBarUI,\n reactRouterUI\n );\n const aspectSection = new AspectSection();\n // @ts-ignore\n componentUI.registerSearchResultWidget({ key: 'deprecation', end: DeprecationIcon });\n\n if (componentUI.commandBarUI && config.commandBar) {\n componentUI.commandBarUI.addCommand(...componentUI.keyBindings);\n commandBarUI.addSearcher(componentUI.componentSearcher);\n }\n\n componentUI.registerMenuItem(componentUI.menuItems);\n componentUI.registerRoute(aspectSection.route);\n componentUI.registerWidget(aspectSection.navigationLink, aspectSection.order);\n componentUI.registerConsumeMethod(componentUI.bitMethod);\n componentUI.registerRightSideMenuItem({\n item: <commandBarUI.CommandBarButton />,\n order: 90,\n });\n return componentUI;\n }\n}\n\nexport default ComponentUI;\n\nComponentAspect.addRuntime(ComponentUI);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,iBAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,gBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAA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A0QoB;EACxCkI,UAAU,EAAE;AACd,CAAC;AAAA,IAAAiB,QAAA,GAAAP,OAAA,CAAA/J,OAAA,GAgEYmB,WAAW;AAE1BoJ,4BAAe,CAACC,UAAU,CAACrJ,WAAW,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_lodash","_copyToClipboard","_componentUi","_harmony","_reactRouter","_harmonyModules","_lodash2","_uiFoundationUiUseBox","_componentPackageVersion","_aspect","_component","_component2","_componentSearcher","_menu","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ComponentUI","constructor","routeSlot","navSlot","consumeMethodSlot","widgetSlot","pinnedWidgetSlot","rightSideMenuSlot","menuItemSlot","pageItemSlot","componentSearchResultSlot","reactRouterUi","isCommandBarEnabled","copy","activeComponent","id","toString","packageName","version","versionString","formatToInstallableVersion","action","copyBitId","displayName","keybinding","copyNpmId","category","title","keyChar","handler","runCommand","options","componentId","packageNameFromProps","latest","latestFromProps","componentModel","packageVersion","Title","createElement","style","width","src","Component","hide","Import","ignoreVersion","componentName","name","showInstallMethod","disableInstall","order","menuItems","register","items","totalPlugins","flatten","values","componentSearcher","updatePlugins","components","update","ComponentSearcher","navigate","navigateTo","routes","toArray","map","key","Array","isArray","snapToSemver","registerCommandRunner","commandRunner","commandId","getComponentUI","host","containerSlot","onComponentChange","handleComponentChange","path","useComponent","componentIdStr","useComponentFilters","overriddenRoutes","getMenu","ComponentMenu","className","skipRightSide","navigationSlot","RightNode","authToken","listMenuItems","mainMenuItems","groupBy","registerRoute","registerNavigation","nav","props","registerConsumeMethod","consumeMethods","registerWidget","widget","registerPinnedWidget","registerRightSideMenuItem","rightSideMenuItem","provider","reactRouterUI","config","pageSlot","componentUI","commandBar","aspectSection","AspectSection","registerSearchResultWidget","end","DeprecationIcon","registerMenuItem","route","navigationLink","bitMethod","exports","ReactRouterAspect","UIRuntime","Slot","withType","_default","ComponentAspect","addRuntime"],"sources":["component.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport flatten from 'lodash.flatten';\nimport copy from 'copy-to-clipboard';\nimport type { RouteProps } from 'react-router-dom';\nimport type { LinkProps } from '@teambit/base-react.navigation.link';\nimport { DeprecationIcon } from '@teambit/component.ui.deprecation-icon';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport type { ReactRouterUI } from '@teambit/react-router';\nimport { ReactRouterAspect } from '@teambit/react-router';\nimport { UIRuntime } from '@teambit/harmony.modules.runtimes';\nimport { groupBy } from 'lodash';\nimport type { MenuItem, MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';\nimport type { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { Import } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { snapToSemver } from '@teambit/component-package-version';\nimport { AspectSection } from './aspect.section';\nimport { ComponentAspect } from './component.aspect';\nimport type { ComponentModel } from './ui';\nimport type { ComponentPageElement, ComponentPageSlot } from './ui/component';\nimport { Component } from './ui/component';\nimport type { ComponentResultPlugin } from './ui/component-searcher';\nimport { ComponentSearcher } from './ui/component-searcher';\nimport type {\n ConsumeMethodSlot,\n ConsumePlugin,\n NavPlugin,\n OrderedNavigationSlot,\n RightSideMenuItem,\n RightSideMenuSlot,\n} from './ui/menu';\nimport { ComponentMenu } from './ui/menu';\nimport type { GetComponentsOptions } from './get-component-opts';\n\nexport type ComponentSearchResultSlot = SlotRegistry<ComponentResultPlugin[]>;\n\nexport type ComponentUIConfig = {\n commandBar: boolean;\n};\n\n/**\n * a command the component page offers to the command bar (the shape of the command-bar's `CommandEntry`).\n */\nexport type ComponentCommand = {\n id: string;\n action: () => void;\n keybinding?: string | string[];\n displayName: string;\n};\n\nexport type CommandRunner = (commandId: string) => unknown;\n\nexport type Server = {\n env: string;\n url: string;\n};\n\nexport type ComponentMeta = {\n id: string;\n};\n\nexport class ComponentUI {\n readonly routePath = `/*`;\n readonly componentSearcher: ComponentSearcher;\n\n constructor(\n private routeSlot: RouteSlot,\n\n private navSlot: OrderedNavigationSlot,\n\n readonly consumeMethodSlot: ConsumeMethodSlot,\n /**\n * slot for registering a new widget to the menu.\n */\n private widgetSlot: OrderedNavigationSlot,\n /**\n * slot for registering pinned widgets to the menu\n */\n private pinnedWidgetSlot: OrderedNavigationSlot,\n /**\n * slot for registering the right section of the menu\n */\n private rightSideMenuSlot: RightSideMenuSlot,\n\n private menuItemSlot: MenuItemSlot,\n\n private pageItemSlot: ComponentPageSlot,\n\n private componentSearchResultSlot: ComponentSearchResultSlot,\n\n reactRouterUi: ReactRouterUI,\n\n /**\n * whether the component page offers its commands and component search to the command bar\n */\n readonly isCommandBarEnabled: boolean\n ) {\n this.componentSearcher = new ComponentSearcher({ navigate: reactRouterUi.navigateTo });\n }\n\n get routes() {\n return this.routeSlot\n .toArray()\n .map(([key, routes]) => [key, Array.isArray(routes) ? [...flatten(routes)] : [routes]] as [string, RouteProps[]]);\n }\n\n /**\n * the current visible component\n */\n private activeComponent?: ComponentModel;\n\n formatToInstallableVersion(version: string) {\n return snapToSemver(version);\n }\n\n private copyBitId = () => {\n copy(this.activeComponent?.id.toString() || '');\n };\n\n private copyNpmId = () => {\n const packageName = this.activeComponent?.packageName;\n if (packageName) {\n const version = this.activeComponent?.id.version;\n const versionString = version ? `@${this.formatToInstallableVersion(version)}` : '';\n copy(`${packageName}${versionString}`);\n }\n };\n\n private commandRunner?: CommandRunner;\n\n /**\n * set by the command bar, so the menu items can run its commands.\n */\n registerCommandRunner(commandRunner: CommandRunner) {\n this.commandRunner = commandRunner;\n }\n\n private runCommand(commandId: string) {\n return this.commandRunner?.(commandId);\n }\n\n /**\n * key bindings used by component aspect\n */\n readonly keyBindings: ComponentCommand[] = [\n {\n id: 'component.copyBitId', // TODO - extract to a component!\n action: this.copyBitId,\n displayName: 'Copy component ID',\n keybinding: '.',\n },\n {\n id: 'component.copyNpmId', // TODO - extract to a component!\n action: this.copyNpmId,\n displayName: 'Copy component package name',\n keybinding: ',',\n },\n ];\n\n private menuItems: MenuItem[] = [\n {\n category: 'general',\n title: 'Open command bar',\n keyChar: 'mod+k',\n handler: () => this.runCommand('command-bar.open'),\n },\n {\n category: 'general',\n title: 'Toggle component list',\n keyChar: 'alt+s',\n handler: () => this.runCommand('sidebar.toggle'),\n },\n {\n category: 'workflow',\n title: 'Copy component ID',\n keyChar: '.',\n handler: this.copyBitId,\n },\n {\n category: 'workflow',\n title: 'Copy component package name',\n keyChar: ',',\n handler: this.copyNpmId,\n },\n ];\n\n private bitMethod: ConsumePlugin = ({\n options,\n id: componentId,\n packageName: packageNameFromProps,\n latest: latestFromProps,\n componentModel,\n }) => {\n const packageName = packageNameFromProps || componentModel?.packageName;\n const latest = latestFromProps || componentModel?.id.version;\n\n const version = componentId.version === latest ? '' : `@${componentId.version}`;\n const packageVersion =\n componentId.version === latest ? '' : `@${this.formatToInstallableVersion(componentId.version as string)}`;\n\n return {\n Title: <img style={{ width: '20px' }} src=\"https://static.bit.dev/brands/bit-logo-text.svg\" />,\n Component: !options?.hide ? (\n <Import\n componentId={`${componentId.toString({ ignoreVersion: true })}${version}`}\n packageName={`${packageName}${packageVersion}`}\n componentName={componentId.name}\n showInstallMethod={!options?.disableInstall}\n />\n ) : null,\n order: 0,\n };\n };\n\n handleComponentChange = (activeComponent?: ComponentModel) => {\n this.activeComponent = activeComponent;\n };\n\n getComponentUI(host: string, options: GetComponentsOptions = {}) {\n return (\n <Component\n routeSlot={this.routeSlot}\n containerSlot={this.pageItemSlot}\n onComponentChange={this.handleComponentChange}\n host={host}\n path={options.path}\n useComponent={options.useComponent}\n componentIdStr={options.componentId}\n useComponentFilters={options.useComponentFilters}\n overriddenRoutes={options.routes}\n />\n );\n }\n\n getMenu(host: string, options: GetComponentsOptions = {}) {\n return (\n <ComponentMenu\n className={options.className}\n skipRightSide={options.skipRightSide}\n navigationSlot={this.navSlot}\n consumeMethodSlot={this.consumeMethodSlot}\n rightSideMenuSlot={this.rightSideMenuSlot}\n widgetSlot={this.widgetSlot}\n host={host}\n menuItemSlot={this.menuItemSlot}\n useComponent={options.useComponent}\n path={options.path}\n componentIdStr={options.componentId}\n useComponentFilters={options.useComponentFilters}\n RightNode={options.RightNode}\n authToken={options.authToken}\n pinnedWidgetSlot={this.pinnedWidgetSlot}\n />\n );\n }\n\n listMenuItems() {\n const mainMenuItems = groupBy(flatten(this.menuItemSlot.values()), 'category');\n return mainMenuItems;\n }\n\n registerRoute(routes: RouteProps[] | RouteProps) {\n this.routeSlot.register(routes);\n return this;\n }\n\n registerNavigation(nav: LinkProps, order?: number) {\n this.navSlot.register({\n props: nav,\n order,\n });\n }\n\n registerConsumeMethod(...consumeMethods: ConsumePlugin[]) {\n this.consumeMethodSlot.register(consumeMethods);\n }\n\n registerWidget(widget: LinkProps, order?: number) {\n this.widgetSlot.register({ props: widget, order });\n }\n\n registerPinnedWidget(widget: LinkProps, order?: number) {\n this.pinnedWidgetSlot.register({ props: widget, order });\n }\n\n registerRightSideMenuItem(...rightSideMenuItem: RightSideMenuItem[]) {\n this.rightSideMenuSlot.register(rightSideMenuItem);\n }\n\n registerMenuItem = (menuItems: MenuItem[]) => {\n this.menuItemSlot.register(menuItems);\n };\n\n registerPageItem = (...items: ComponentPageElement[]) => {\n this.pageItemSlot.register(items);\n };\n\n /** register widgets to the components listed in the command bar */\n registerSearchResultWidget = (...items: ComponentResultPlugin[]) => {\n this.componentSearchResultSlot.register(items);\n const totalPlugins = flatten(this.componentSearchResultSlot.values());\n\n this.componentSearcher.updatePlugins(totalPlugins);\n };\n\n updateComponents = (components: ComponentModel[]) => {\n this.componentSearcher.update(components || []);\n };\n\n static dependencies = [ReactRouterAspect];\n\n static runtime = UIRuntime;\n\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<NavPlugin>(),\n Slot.withType<NavigationSlot>(),\n Slot.withType<ConsumeMethodSlot>(),\n Slot.withType<MenuItemSlot>(),\n Slot.withType<ComponentPageSlot>(),\n Slot.withType<ComponentSearchResultSlot>(),\n Slot.withType<RightSideMenuSlot>(),\n Slot.withType<NavPlugin>(),\n ];\n static defaultConfig: ComponentUIConfig = {\n commandBar: true,\n };\n\n static async provider(\n [reactRouterUI]: [ReactRouterUI],\n config: ComponentUIConfig,\n [\n routeSlot,\n navSlot,\n consumeMethodSlot,\n widgetSlot,\n menuItemSlot,\n pageSlot,\n componentSearchResultSlot,\n rightSideMenuSlot,\n pinnedWidgetSlot,\n ]: [\n RouteSlot,\n OrderedNavigationSlot,\n ConsumeMethodSlot,\n OrderedNavigationSlot,\n MenuItemSlot,\n ComponentPageSlot,\n ComponentSearchResultSlot,\n RightSideMenuSlot,\n OrderedNavigationSlot,\n ]\n ) {\n // TODO: refactor ComponentHost to a separate extension (including sidebar, host, graphql, etc.)\n // TODO: add contextual hook for ComponentHost @uri/@oded\n const componentUI = new ComponentUI(\n routeSlot,\n navSlot,\n consumeMethodSlot,\n widgetSlot,\n pinnedWidgetSlot,\n rightSideMenuSlot,\n menuItemSlot,\n pageSlot,\n componentSearchResultSlot,\n reactRouterUI,\n config.commandBar\n );\n const aspectSection = new AspectSection();\n // @ts-ignore\n componentUI.registerSearchResultWidget({ key: 'deprecation', end: DeprecationIcon });\n\n componentUI.registerMenuItem(componentUI.menuItems);\n componentUI.registerRoute(aspectSection.route);\n componentUI.registerWidget(aspectSection.navigationLink, aspectSection.order);\n componentUI.registerConsumeMethod(componentUI.bitMethod);\n return componentUI;\n }\n}\n\nexport default ComponentUI;\n\nComponentAspect.addRuntime(ComponentUI);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,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AAA,CAtQUkB,WAAW,mBAuQoB;EACxC+G,UAAU,EAAE;AACd,CAAC;AAAA,IAAAe,QAAA,GAAAL,OAAA,CAAA5I,OAAA,GAsDYmB,WAAW;AAE1B+H,4BAAe,CAACC,UAAU,CAAChI,WAAW,CAAC","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export { componentFields, componentIdFields, componentOverviewFields } from './u
|
|
|
29
29
|
export type { NavPlugin, ConsumePlugin, MenuNavProps } from './ui/menu';
|
|
30
30
|
export { CollapsibleMenuNav, ComponentMenu, VersionRelatedDropdowns } from './ui/menu';
|
|
31
31
|
export type { RegisteredComponentRoute, ComponentUrlParams } from './component.route';
|
|
32
|
-
export type { ComponentModelProps, DeprecationInfo, RegularCompDescriptor } from './ui/component-model';
|
|
32
|
+
export type { ComponentModelProps, DeprecationInfo, RegularCompDescriptor, ComponentPreviewSize, ComponentPreviewSizedFile, } from './ui/component-model';
|
|
33
33
|
export { ComponentModel } from './ui/component-model';
|
|
34
34
|
export { TopBarNav } from './ui/top-bar-nav';
|
|
35
35
|
export type { ShowFragment, ShowRow, ShowJSONRow } from './show';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_component","data","require","_host","_component2","_componentId","_componentFs","_interopRequireDefault","_aspectEntry","_snap","_tag","_state","_tagMap","_componentMap","_componentContext","_context","_ui","_menu","_componentModel","_topBarNav","_config","e","__esModule","default","_default","exports","ComponentAspect"],"sources":["index.ts"],"sourcesContent":["import { ComponentAspect } from './component.aspect';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\n\nexport type { GetComponentsOptions } from './get-component-opts';\nexport type { UseComponentType } from './ui/use-component';\nexport type { ConsumerComponent };\nexport { useComponentHost } from './host';\nexport { Component, InvalidComponent } from './component';\nexport { ComponentID } from '@teambit/component-id';\nexport { default as ComponentFS } from './component-fs';\nexport type { Config as ComponentConfig } from './config';\nexport type {\n ComponentFactory,\n ResolveAspectsOptions,\n FilterAspectsOptions,\n LoadAspectsOptions,\n GetGraphIdsOpts,\n} from './component-factory';\nexport type { AspectList } from './aspect-list';\nexport { AspectEntry, AspectData, ResolveComponentIdFunc } from './aspect-entry';\n// TODO: check why it's not working when using the index in snap dir like this:\n// export { Snap, Author } from './snap';\nexport { Snap, SnapProps } from './snap/snap';\nexport type { Author } from './snap/author';\n// TODO: check why it's not working when using the index in tag dir like this:\n// export { Tag } from './tag';\nexport { Tag, TagProps } from './tag/tag';\nexport type { IComponent } from './component-interface';\nexport { State } from './state';\nexport type { Hash } from './hash';\nexport { TagMap } from './tag-map';\nexport { ComponentMap } from './component-map';\nexport type { ComponentMain } from './component.main.runtime';\nexport type { ComponentUI } from './component.ui.runtime';\nexport type { Section } from './section';\nexport { ComponentContext, ComponentDescriptorContext, useComponentDescriptor } from './ui/context/component-context';\nexport type { ComponentProviderProps, ComponentDescriptorProviderProps } from './ui/context';\nexport { ComponentProvider, ComponentDescriptorProvider } from './ui/context';\nexport { componentFields, componentIdFields, componentOverviewFields } from './ui';\nexport type { NavPlugin, ConsumePlugin, MenuNavProps } from './ui/menu';\nexport { CollapsibleMenuNav, ComponentMenu, VersionRelatedDropdowns } from './ui/menu';\nexport type { RegisteredComponentRoute, ComponentUrlParams } from './component.route';\nexport type {
|
|
1
|
+
{"version":3,"names":["_component","data","require","_host","_component2","_componentId","_componentFs","_interopRequireDefault","_aspectEntry","_snap","_tag","_state","_tagMap","_componentMap","_componentContext","_context","_ui","_menu","_componentModel","_topBarNav","_config","e","__esModule","default","_default","exports","ComponentAspect"],"sources":["index.ts"],"sourcesContent":["import { ComponentAspect } from './component.aspect';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\n\nexport type { GetComponentsOptions } from './get-component-opts';\nexport type { UseComponentType } from './ui/use-component';\nexport type { ConsumerComponent };\nexport { useComponentHost } from './host';\nexport { Component, InvalidComponent } from './component';\nexport { ComponentID } from '@teambit/component-id';\nexport { default as ComponentFS } from './component-fs';\nexport type { Config as ComponentConfig } from './config';\nexport type {\n ComponentFactory,\n ResolveAspectsOptions,\n FilterAspectsOptions,\n LoadAspectsOptions,\n GetGraphIdsOpts,\n} from './component-factory';\nexport type { AspectList } from './aspect-list';\nexport { AspectEntry, AspectData, ResolveComponentIdFunc } from './aspect-entry';\n// TODO: check why it's not working when using the index in snap dir like this:\n// export { Snap, Author } from './snap';\nexport { Snap, SnapProps } from './snap/snap';\nexport type { Author } from './snap/author';\n// TODO: check why it's not working when using the index in tag dir like this:\n// export { Tag } from './tag';\nexport { Tag, TagProps } from './tag/tag';\nexport type { IComponent } from './component-interface';\nexport { State } from './state';\nexport type { Hash } from './hash';\nexport { TagMap } from './tag-map';\nexport { ComponentMap } from './component-map';\nexport type { ComponentMain } from './component.main.runtime';\nexport type { ComponentUI } from './component.ui.runtime';\nexport type { Section } from './section';\nexport { ComponentContext, ComponentDescriptorContext, useComponentDescriptor } from './ui/context/component-context';\nexport type { ComponentProviderProps, ComponentDescriptorProviderProps } from './ui/context';\nexport { ComponentProvider, ComponentDescriptorProvider } from './ui/context';\nexport { componentFields, componentIdFields, componentOverviewFields } from './ui';\nexport type { NavPlugin, ConsumePlugin, MenuNavProps } from './ui/menu';\nexport { CollapsibleMenuNav, ComponentMenu, VersionRelatedDropdowns } from './ui/menu';\nexport type { RegisteredComponentRoute, ComponentUrlParams } from './component.route';\nexport type {\n ComponentModelProps,\n DeprecationInfo,\n RegularCompDescriptor,\n ComponentPreviewSize,\n ComponentPreviewSizedFile,\n} from './ui/component-model';\nexport { ComponentModel } from './ui/component-model';\nexport { TopBarNav } from './ui/top-bar-nav';\nexport type { ShowFragment, ShowRow, ShowJSONRow } from './show';\nexport { Config } from './config';\nexport { useComponent, useIdFromLocation, useComponentLogs, ComponentLogsResult, Filters } from './ui';\n\n// export { AspectList } from './aspect-list';\n// export { AspectEntry } from './aspect-entry';\nexport { ComponentAspect };\nexport default ComponentAspect;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;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AmB,QAAA;EAAA,MAAAnB,IAAA,GAAAC,OAAA;EAAAkB,OAAA,YAAAA,CAAA;IAAA,OAAAnB,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkC,SAAAM,uBAAAc,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAhClC;AACA;AAGA;AACA;AA8BA;AACA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEeG,4BAAe","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.1214/dist/component.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.1214/dist/component.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { CompositionProps } from '@teambit/compositions';
|
|
2
|
-
import { Composition } from '@teambit/compositions';
|
|
1
|
+
import type { CompositionProps } from '@teambit/compositions.model.composition-type';
|
|
2
|
+
import { Composition } from '@teambit/compositions.model.composition-type';
|
|
3
3
|
import type { ComponentIdObj } from '@teambit/component-id';
|
|
4
4
|
import { ComponentID } from '@teambit/component-id';
|
|
5
5
|
import type { LegacyComponentLog } from '@teambit/legacy-component-log';
|
|
6
|
-
import type { ComponentPreviewSize } from '@teambit/preview';
|
|
7
6
|
import { TagMap } from '../../tag-map';
|
|
8
7
|
import type { TagProps } from '../../tag/tag';
|
|
9
8
|
/**
|
|
@@ -26,6 +25,25 @@ export type RegularCompDescriptor = {
|
|
|
26
25
|
name?: string;
|
|
27
26
|
description?: string;
|
|
28
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* the preview bundle size the component model needs. it lives here and not in the preview aspect, so the
|
|
30
|
+
* component model doesn't depend on that aspect (it depends on component).
|
|
31
|
+
*/
|
|
32
|
+
export type ComponentPreviewSize = {
|
|
33
|
+
files: ComponentPreviewSizedFile[];
|
|
34
|
+
assets: ComponentPreviewSizedFile[];
|
|
35
|
+
totalFiles: number;
|
|
36
|
+
compressedTotalFiles?: number;
|
|
37
|
+
totalAssets: number;
|
|
38
|
+
compressedTotalAssets?: number;
|
|
39
|
+
total: number;
|
|
40
|
+
compressedTotal?: number;
|
|
41
|
+
};
|
|
42
|
+
export type ComponentPreviewSizedFile = {
|
|
43
|
+
name: string;
|
|
44
|
+
size: number;
|
|
45
|
+
compressedSize?: number;
|
|
46
|
+
};
|
|
29
47
|
export type ComponentModelProps = {
|
|
30
48
|
id: ComponentIdObj;
|
|
31
49
|
description: string;
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ComponentModel = void 0;
|
|
7
|
-
function
|
|
8
|
-
const data = require("@teambit/compositions");
|
|
9
|
-
|
|
7
|
+
function _compositionsModel() {
|
|
8
|
+
const data = require("@teambit/compositions.model.composition-type");
|
|
9
|
+
_compositionsModel = function () {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
@@ -44,6 +44,11 @@ function _tagMap() {
|
|
|
44
44
|
* component model doesn't depend on that aspect (it depends on component).
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* the preview bundle size the component model needs. it lives here and not in the preview aspect, so the
|
|
49
|
+
* component model doesn't depend on that aspect (it depends on component).
|
|
50
|
+
*/
|
|
51
|
+
|
|
47
52
|
// ADDING MORE PROPERTIES HERE IS NOT ALLOWED!!! IF YOU NEED DATA PLEASE ADD A NEW
|
|
48
53
|
// HOOK FROM YOUR ASPECT!!!
|
|
49
54
|
// TODO: remove all properties from here to their rightful place in their aspects.
|
|
@@ -159,7 +164,7 @@ class ComponentModel {
|
|
|
159
164
|
size,
|
|
160
165
|
logs
|
|
161
166
|
}) {
|
|
162
|
-
return new ComponentModel(_componentId().ComponentID.fromObject(id), displayName, packageName, server,
|
|
167
|
+
return new ComponentModel(_componentId().ComponentID.fromObject(id), displayName, packageName, server, _compositionsModel().Composition.fromArray(compositions), _tagMap().TagMap.fromArray(tags.map(tag => _tag().Tag.fromObject(tag))), buildStatus, issuesCount, status, deprecation, env, description, labels, host, size, latest, preview, logs?.map(log => log ?? {
|
|
163
168
|
hash: '[error]',
|
|
164
169
|
tag: '[error]',
|
|
165
170
|
message: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_compositionsModel","data","require","_componentId","_tag","_tagMap","ComponentModel","constructor","id","displayName","packageName","server","compositions","tags","buildStatus","issuesCount","status","deprecation","environment","description","labels","host","size","latest","preview","logs","version","from","env","ComponentID","fromObject","Composition","fromArray","TagMap","map","tag","Tag","log","hash","message","parents","componentsProps","rawComponent","empty","name","scope","url","exports"],"sources":["component-model.ts"],"sourcesContent":["import type { CompositionProps } from '@teambit/compositions.model.composition-type';\nimport { Composition } from '@teambit/compositions.model.composition-type';\nimport type { ComponentIdObj } from '@teambit/component-id';\nimport { ComponentID } from '@teambit/component-id';\nimport type { LegacyComponentLog } from '@teambit/legacy-component-log';\nimport { Tag } from '../../tag';\nimport { TagMap } from '../../tag-map';\nimport type { TagProps } from '../../tag/tag';\n// import { Snap } from '../../snap';\n\n/**\n * the deprecation data of a component. it lives here and not in the deprecation aspect, so the\n * component model doesn't depend on that aspect (it depends on component).\n */\nexport type DeprecationInfo = {\n isDeprecate: boolean;\n newId?: string;\n range?: string;\n};\n\n/**\n * the env data the component model needs. it lives here and not in the envs aspect, so the\n * component model doesn't depend on that aspect (it depends on component).\n */\nexport type RegularCompDescriptor = {\n id: string;\n icon?: string;\n type?: string;\n name?: string;\n description?: string;\n};\n\n/**\n * the preview bundle size the component model needs. it lives here and not in the preview aspect, so the\n * component model doesn't depend on that aspect (it depends on component).\n */\nexport type ComponentPreviewSize = {\n files: ComponentPreviewSizedFile[];\n assets: ComponentPreviewSizedFile[];\n totalFiles: number;\n compressedTotalFiles?: number;\n totalAssets: number;\n compressedTotalAssets?: number;\n total: number;\n compressedTotal?: number;\n};\n\nexport type ComponentPreviewSizedFile = {\n name: string;\n size: number;\n compressedSize?: number;\n};\n\n// ADDING MORE PROPERTIES HERE IS NOT ALLOWED!!! IF YOU NEED DATA PLEASE ADD A NEW\n// HOOK FROM YOUR ASPECT!!!\n// TODO: remove all properties from here to their rightful place in their aspects.\n\nexport type ComponentModelProps = {\n id: ComponentIdObj;\n description: string;\n buildStatus?: string;\n server?: ComponentServer;\n displayName: string;\n packageName: string; // pkg aspect\n compositions?: CompositionProps[];\n tags?: TagProps[];\n issuesCount?: number; // component/issues aspect\n status?: any; // workspace aspect.\n deprecation?: DeprecationInfo; // deprecation aspect\n env?: RegularCompDescriptor; // env aspect.\n labels?: string[];\n host?: string;\n latest?: string;\n preview?: ComponentPreview;\n logs?: LegacyComponentLog[];\n size?: ComponentPreviewSize;\n};\n\nexport type ComponentPreview = {\n includesEnvTemplate?: boolean;\n isScaling?: boolean;\n onlyOverview?: boolean;\n legacyHeader?: boolean;\n useNameParam?: boolean;\n skipIncludes?: boolean;\n};\n\nexport type ComponentServer = {\n env: string;\n /**\n * Full dev server url.\n */\n url?: string;\n\n /**\n * host of the component server (used mostly by cloud providers for remote scopes)\n */\n host?: string;\n\n /**\n * This is used mostly by cloud to proxy requests to the correct scope.\n */\n basePath?: string;\n};\n\nexport class ComponentModel {\n constructor(\n /**\n * id of the component\n */\n readonly id: ComponentID,\n\n /**\n * display name of the component.\n */\n readonly displayName: string,\n\n /**\n * package name of the component.\n */\n readonly packageName: string,\n\n /**\n * the component server.\n */\n readonly server: ComponentServer | undefined,\n\n /**\n * array of compositions\n */\n readonly compositions: Composition[],\n\n /**\n * tags of the component.\n */\n readonly tags: TagMap,\n\n /**\n * component build status\n */\n readonly buildStatus?: string,\n\n /**\n * issues of component.\n */\n readonly issuesCount?: number,\n /**\n * status of component.\n */\n readonly status?: any,\n\n /**\n * deprecation info of the component.\n */\n readonly deprecation?: DeprecationInfo,\n\n /**\n * env descriptor.\n */\n readonly environment?: RegularCompDescriptor,\n\n /**\n * description of the component.\n */\n\n readonly description = '',\n\n readonly labels: string[] = [],\n\n /**\n * host of the component\n */\n readonly host?: string,\n\n /**\n *\n * size preview\n */\n readonly size?: ComponentPreviewSize,\n\n /**\n * latest version of component\n */\n readonly latest?: string,\n\n readonly preview?: ComponentPreview,\n\n readonly logs?: LegacyComponentLog[]\n ) {}\n\n get version() {\n if (!this.id.version) return 'new';\n return this.id.version;\n }\n\n /**\n * create an instance of a component from a plain object.\n */\n static from({\n id,\n server,\n displayName,\n compositions = [],\n packageName,\n tags = [],\n deprecation,\n buildStatus,\n env,\n status,\n issuesCount,\n description,\n labels,\n host,\n latest,\n preview,\n size,\n logs,\n }: ComponentModelProps) {\n return new ComponentModel(\n ComponentID.fromObject(id),\n displayName,\n packageName,\n server,\n Composition.fromArray(compositions),\n TagMap.fromArray(tags.map((tag) => Tag.fromObject(tag))),\n buildStatus,\n issuesCount,\n status,\n deprecation,\n env,\n description,\n labels,\n host,\n size,\n latest,\n preview,\n logs?.map((log) => log ?? { hash: '[error]', tag: '[error]', message: '', parents: [] })\n );\n }\n\n static fromArray(componentsProps: ComponentModelProps[]) {\n return componentsProps.map((rawComponent) => ComponentModel.from(rawComponent));\n }\n\n static empty() {\n return new ComponentModel(\n ComponentID.fromObject({ name: 'root', scope: 'temp' }),\n '',\n '',\n { env: '', url: '' },\n [],\n TagMap.empty()\n );\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAA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IAAKC,UAAG,CAACN,UAAU,CAACK,GAAG,CAAC,CAAC,CAAC,EACxDrB,WAAW,EACXC,WAAW,EACXC,MAAM,EACNC,WAAW,EACXW,GAAG,EACHT,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,IAAI,EAAES,GAAG,CAAEG,GAAG,IAAKA,GAAG,IAAI;MAAEC,IAAI,EAAE,SAAS;MAAEH,GAAG,EAAE,SAAS;MAAEI,OAAO,EAAE,EAAE;MAAEC,OAAO,EAAE;IAAG,CAAC,CACzF,CAAC;EACH;EAEA,OAAOR,SAASA,CAACS,eAAsC,EAAE;IACvD,OAAOA,eAAe,CAACP,GAAG,CAAEQ,YAAY,IAAKpC,cAAc,CAACqB,IAAI,CAACe,YAAY,CAAC,CAAC;EACjF;EAEA,OAAOC,KAAKA,CAAA,EAAG;IACb,OAAO,IAAIrC,cAAc,CACvBuB,0BAAW,CAACC,UAAU,CAAC;MAAEc,IAAI,EAAE,MAAM;MAAEC,KAAK,EAAE;IAAO,CAAC,CAAC,EACvD,EAAE,EACF,EAAE,EACF;MAAEjB,GAAG,EAAE,EAAE;MAAEkB,GAAG,EAAE;IAAG,CAAC,EACpB,EAAE,EACFb,gBAAM,CAACU,KAAK,CAAC,CACf,CAAC;EACH;AACF;AAACI,OAAA,CAAAzC,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ComponentModel, ComponentModelProps, DeprecationInfo, RegularCompDescriptor } from './component-model';
|
|
1
|
+
export { ComponentModel, ComponentModelProps, DeprecationInfo, RegularCompDescriptor, ComponentPreviewSize, ComponentPreviewSizedFile, } from './component-model';
|
|
@@ -15,6 +15,18 @@ Object.defineProperty(exports, "ComponentModelProps", {
|
|
|
15
15
|
return _componentModel().ComponentModelProps;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "ComponentPreviewSize", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _componentModel().ComponentPreviewSize;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ComponentPreviewSizedFile", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _componentModel().ComponentPreviewSizedFile;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
18
30
|
Object.defineProperty(exports, "DeprecationInfo", {
|
|
19
31
|
enumerable: true,
|
|
20
32
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_componentModel","data","require"],"sources":["index.ts"],"sourcesContent":["export {
|
|
1
|
+
{"version":3,"names":["_componentModel","data","require"],"sources":["index.ts"],"sourcesContent":["export {\n ComponentModel,\n ComponentModelProps,\n DeprecationInfo,\n RegularCompDescriptor,\n ComponentPreviewSize,\n ComponentPreviewSizedFile,\n} from './component-model';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,gBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,eAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { SearchResult, FuzzySearchItem } from '@teambit/explorer.ui.command-bar';
|
|
2
2
|
import { FuzzySearcher } from '@teambit/explorer.ui.command-bar';
|
|
3
|
-
import type { SearchProvider } from '@teambit/command-bar';
|
|
4
3
|
import type { ComponentResultPlugin } from './component-result';
|
|
5
4
|
import type { ComponentModel } from '../component-model';
|
|
6
5
|
export type { ComponentResultPlugin };
|
|
@@ -13,7 +12,7 @@ type ComponentSearcherOptions = {
|
|
|
13
12
|
navigate: (path: string) => void;
|
|
14
13
|
resultPlugins?: ComponentResultPlugin[];
|
|
15
14
|
};
|
|
16
|
-
export declare class ComponentSearcher extends FuzzySearcher<ComponentModel, ComponentSearchIdx>
|
|
15
|
+
export declare class ComponentSearcher extends FuzzySearcher<ComponentModel, ComponentSearchIdx> {
|
|
17
16
|
options: ComponentSearcherOptions;
|
|
18
17
|
constructor(options: ComponentSearcherOptions);
|
|
19
18
|
updatePlugins(plugins: ComponentResultPlugin[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_explorerUi","_componentResult","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","searchKeys","ComponentSearcher","FuzzySearcher","constructor","options","item","resultPlugins","component","id","fullName","action","children","createElement","ComponentResult","plugins","updatePlugins","test","term","startsWith","toSearchableItem","name","displayName","exports"],"sources":["component-searcher.tsx"],"sourcesContent":["import React from 'react';\nimport type { SearchResult, FuzzySearchItem } from '@teambit/explorer.ui.command-bar';\nimport { FuzzySearcher } from '@teambit/explorer.ui.command-bar';\nimport type {
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_explorerUi","_componentResult","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","searchKeys","ComponentSearcher","FuzzySearcher","constructor","options","item","resultPlugins","component","id","fullName","action","children","createElement","ComponentResult","plugins","updatePlugins","test","term","startsWith","toSearchableItem","name","displayName","exports"],"sources":["component-searcher.tsx"],"sourcesContent":["import React from 'react';\nimport type { SearchResult, FuzzySearchItem } from '@teambit/explorer.ui.command-bar';\nimport { FuzzySearcher } from '@teambit/explorer.ui.command-bar';\nimport type { ComponentResultPlugin } from './component-result';\nimport { ComponentResult } from './component-result';\nimport type { ComponentModel } from '../component-model';\n\nexport type { ComponentResultPlugin };\n\ntype ComponentSearchIdx = {\n name: string;\n displayName: string;\n component: ComponentModel;\n};\n\nconst searchKeys: (keyof ComponentSearchIdx)[] = ['displayName', 'name'];\n\ntype ComponentSearcherOptions = {\n navigate: (path: string) => void;\n resultPlugins?: ComponentResultPlugin[];\n};\n\nexport class ComponentSearcher extends FuzzySearcher<ComponentModel, ComponentSearchIdx> {\n constructor(public options: ComponentSearcherOptions) {\n super({ searchKeys });\n }\n\n updatePlugins(plugins: ComponentResultPlugin[]) {\n this.options = {\n ...this.options,\n resultPlugins: plugins,\n };\n }\n\n override test(term: string): boolean {\n return !term.startsWith('>') && term.length > 0;\n }\n\n protected override toSearchableItem(item: ComponentModel): ComponentSearchIdx {\n return {\n name: item.id.name,\n displayName: item.id.fullName,\n component: item,\n };\n }\n\n protected override toSearchResult = ({ item }: FuzzySearchItem<ComponentSearchIdx>): SearchResult => {\n const { resultPlugins } = this.options;\n const { component } = item;\n\n return {\n id: component.id.fullName,\n action: `/${component.id.fullName}`,\n children: <ComponentResult component={component} plugins={resultPlugins} />,\n };\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,iBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,gBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAqD,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,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aA,CAACD,OAAgC,EAAE;IAC9C,IAAI,CAACV,OAAO,GAAAxB,aAAA,CAAAA,aAAA,KACP,IAAI,CAACwB,OAAO;MACfE,aAAa,EAAEQ;IAAO,EACvB;EACH;EAESE,IAAIA,CAACC,IAAY,EAAW;IACnC,OAAO,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,IAAID,IAAI,CAACnC,MAAM,GAAG,CAAC;EACjD;EAEmBqC,gBAAgBA,CAACd,IAAoB,EAAsB;IAC5E,OAAO;MACLe,IAAI,EAAEf,IAAI,CAACG,EAAE,CAACY,IAAI;MAClBC,WAAW,EAAEhB,IAAI,CAACG,EAAE,CAACC,QAAQ;MAC7BF,SAAS,EAAEF;IACb,CAAC;EACH;AAYF;AAACiB,OAAA,CAAArB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1214",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/component",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "component",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.1214"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/any-fs": "0.0.5",
|
|
@@ -25,15 +25,19 @@
|
|
|
25
25
|
"classnames": "^2.5.1",
|
|
26
26
|
"lodash.compact": "3.0.1",
|
|
27
27
|
"@teambit/component-id": "1.2.5",
|
|
28
|
+
"@teambit/legacy.extension-data": "0.0.183",
|
|
28
29
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.502",
|
|
29
30
|
"@teambit/graph.cleargraph": "0.0.11",
|
|
30
31
|
"@teambit/legacy-bit-id": "1.1.4",
|
|
32
|
+
"@teambit/legacy.consumer-component": "0.0.182",
|
|
33
|
+
"@teambit/component.sources": "0.0.233",
|
|
31
34
|
"@teambit/toolbox.path.match-patterns": "0.0.37",
|
|
32
35
|
"@teambit/toolbox.string.eol": "0.0.22",
|
|
33
36
|
"@teambit/toolbox.string.capitalize": "0.0.518",
|
|
34
37
|
"@teambit/harmony": "0.4.12",
|
|
35
38
|
"@teambit/graphql": "1.0.1205",
|
|
36
39
|
"@teambit/toolbox.path.path": "0.0.26",
|
|
40
|
+
"@teambit/cli": "0.0.1412",
|
|
37
41
|
"@teambit/express": "0.0.1504",
|
|
38
42
|
"@teambit/harmony.modules.runtimes": "0.0.4",
|
|
39
43
|
"@teambit/logger": "0.0.1498",
|
|
@@ -42,7 +46,6 @@
|
|
|
42
46
|
"@teambit/component-package-version": "0.0.466",
|
|
43
47
|
"@teambit/component.ui.deprecation-icon": "0.0.509",
|
|
44
48
|
"@teambit/react-router": "1.0.1205",
|
|
45
|
-
"@teambit/ui-foundation.ui.is-browser": "0.0.500",
|
|
46
49
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.505",
|
|
47
50
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.533",
|
|
48
51
|
"@teambit/ui-foundation.ui.use-box.menu": "1.0.16",
|
|
@@ -51,16 +54,25 @@
|
|
|
51
54
|
"@teambit/pkg.modules.semver-helper": "0.0.38",
|
|
52
55
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.512",
|
|
53
56
|
"@teambit/cli-table": "0.0.66",
|
|
57
|
+
"@teambit/legacy.bit-map": "0.0.238",
|
|
58
|
+
"@teambit/pkg.modules.component-package-name": "0.0.188",
|
|
54
59
|
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.505",
|
|
55
60
|
"@teambit/legacy-component-log": "0.0.434",
|
|
56
61
|
"@teambit/component-descriptor": "0.0.469",
|
|
62
|
+
"@teambit/semantics.doc-parser": "0.0.189",
|
|
63
|
+
"@teambit/legacy.consumer": "0.0.181",
|
|
64
|
+
"@teambit/legacy.dependency-graph": "0.0.184",
|
|
57
65
|
"@teambit/legacy.loader": "0.0.34",
|
|
66
|
+
"@teambit/legacy.scope": "0.0.181",
|
|
67
|
+
"@teambit/scope.remotes": "0.0.181",
|
|
68
|
+
"@teambit/legacy.component-diff": "0.0.237",
|
|
58
69
|
"@teambit/design.ui.empty-box": "0.0.364",
|
|
59
70
|
"@teambit/documenter.ui.heading": "4.1.8",
|
|
60
71
|
"@teambit/documenter.ui.separator": "4.1.7",
|
|
61
72
|
"@teambit/harmony.ui.aspect-box": "0.0.517",
|
|
62
73
|
"@teambit/design.ui.pages.not-found": "0.0.371",
|
|
63
74
|
"@teambit/design.ui.pages.server-error": "0.0.368",
|
|
75
|
+
"@teambit/compositions.model.composition-type": "0.0.538",
|
|
64
76
|
"@teambit/design.ui.styles.ellipsis": "0.0.357",
|
|
65
77
|
"@teambit/envs.ui.env-icon": "0.0.513",
|
|
66
78
|
"@teambit/explorer.ui.command-bar": "2.0.19",
|
|
@@ -73,25 +85,9 @@
|
|
|
73
85
|
"@teambit/lanes.hooks.use-lanes": "0.0.300",
|
|
74
86
|
"@teambit/lanes.ui.models.lanes-model": "0.0.239",
|
|
75
87
|
"@teambit/ui-foundation.ui.use-box.dropdown": "0.0.151",
|
|
76
|
-
"@teambit/
|
|
77
|
-
"@teambit/
|
|
78
|
-
"@teambit/
|
|
79
|
-
"@teambit/legacy.consumer-component": "0.0.182",
|
|
80
|
-
"@teambit/objects": "0.0.712",
|
|
81
|
-
"@teambit/component.sources": "0.0.233",
|
|
82
|
-
"@teambit/cli": "0.0.1412",
|
|
83
|
-
"@teambit/command-bar": "1.0.1212",
|
|
84
|
-
"@teambit/preview": "1.0.1212",
|
|
85
|
-
"@teambit/pubsub": "1.0.1212",
|
|
86
|
-
"@teambit/legacy.bit-map": "0.0.238",
|
|
87
|
-
"@teambit/pkg.modules.component-package-name": "0.0.188",
|
|
88
|
-
"@teambit/semantics.doc-parser": "0.0.189",
|
|
89
|
-
"@teambit/legacy.consumer": "0.0.181",
|
|
90
|
-
"@teambit/legacy.dependency-graph": "0.0.184",
|
|
91
|
-
"@teambit/legacy.scope": "0.0.181",
|
|
92
|
-
"@teambit/scope.remotes": "0.0.181",
|
|
93
|
-
"@teambit/legacy.component-diff": "0.0.237",
|
|
94
|
-
"@teambit/compositions": "1.0.1212"
|
|
88
|
+
"@teambit/aspect-loader": "1.0.1214",
|
|
89
|
+
"@teambit/dependency-resolver": "1.0.1214",
|
|
90
|
+
"@teambit/objects": "0.0.714"
|
|
95
91
|
},
|
|
96
92
|
"devDependencies": {
|
|
97
93
|
"@types/lodash": "4.14.165",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { CompositionProps } from '@teambit/compositions';
|
|
2
|
-
import { Composition } from '@teambit/compositions';
|
|
1
|
+
import type { CompositionProps } from '@teambit/compositions.model.composition-type';
|
|
2
|
+
import { Composition } from '@teambit/compositions.model.composition-type';
|
|
3
3
|
import type { ComponentIdObj } from '@teambit/component-id';
|
|
4
4
|
import { ComponentID } from '@teambit/component-id';
|
|
5
5
|
import type { LegacyComponentLog } from '@teambit/legacy-component-log';
|
|
6
|
-
import type { ComponentPreviewSize } from '@teambit/preview';
|
|
7
6
|
import { Tag } from '../../tag';
|
|
8
7
|
import { TagMap } from '../../tag-map';
|
|
9
8
|
import type { TagProps } from '../../tag/tag';
|
|
@@ -31,6 +30,27 @@ export type RegularCompDescriptor = {
|
|
|
31
30
|
description?: string;
|
|
32
31
|
};
|
|
33
32
|
|
|
33
|
+
/**
|
|
34
|
+
* the preview bundle size the component model needs. it lives here and not in the preview aspect, so the
|
|
35
|
+
* component model doesn't depend on that aspect (it depends on component).
|
|
36
|
+
*/
|
|
37
|
+
export type ComponentPreviewSize = {
|
|
38
|
+
files: ComponentPreviewSizedFile[];
|
|
39
|
+
assets: ComponentPreviewSizedFile[];
|
|
40
|
+
totalFiles: number;
|
|
41
|
+
compressedTotalFiles?: number;
|
|
42
|
+
totalAssets: number;
|
|
43
|
+
compressedTotalAssets?: number;
|
|
44
|
+
total: number;
|
|
45
|
+
compressedTotal?: number;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type ComponentPreviewSizedFile = {
|
|
49
|
+
name: string;
|
|
50
|
+
size: number;
|
|
51
|
+
compressedSize?: number;
|
|
52
|
+
};
|
|
53
|
+
|
|
34
54
|
// ADDING MORE PROPERTIES HERE IS NOT ALLOWED!!! IF YOU NEED DATA PLEASE ADD A NEW
|
|
35
55
|
// HOOK FROM YOUR ASPECT!!!
|
|
36
56
|
// TODO: remove all properties from here to their rightful place in their aspects.
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
ComponentModel,
|
|
3
|
+
ComponentModelProps,
|
|
4
|
+
DeprecationInfo,
|
|
5
|
+
RegularCompDescriptor,
|
|
6
|
+
ComponentPreviewSize,
|
|
7
|
+
ComponentPreviewSizedFile,
|
|
8
|
+
} from './component-model';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SearchResult, FuzzySearchItem } from '@teambit/explorer.ui.command-bar';
|
|
3
3
|
import { FuzzySearcher } from '@teambit/explorer.ui.command-bar';
|
|
4
|
-
import type { SearchProvider } from '@teambit/command-bar';
|
|
5
4
|
import type { ComponentResultPlugin } from './component-result';
|
|
6
5
|
import { ComponentResult } from './component-result';
|
|
7
6
|
import type { ComponentModel } from '../component-model';
|
|
@@ -21,7 +20,7 @@ type ComponentSearcherOptions = {
|
|
|
21
20
|
resultPlugins?: ComponentResultPlugin[];
|
|
22
21
|
};
|
|
23
22
|
|
|
24
|
-
export class ComponentSearcher extends FuzzySearcher<ComponentModel, ComponentSearchIdx>
|
|
23
|
+
export class ComponentSearcher extends FuzzySearcher<ComponentModel, ComponentSearchIdx> {
|
|
25
24
|
constructor(public options: ComponentSearcherOptions) {
|
|
26
25
|
super({ searchKeys });
|
|
27
26
|
}
|