@teambit/command-bar 0.0.554 → 0.0.555
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.
|
@@ -10,23 +10,43 @@ export declare type CommandEntry = {
|
|
|
10
10
|
keybinding?: Keybinding;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
|
+
/** Quick launch actions. Use the `addSearcher` slot to extend the available actions */
|
|
13
14
|
export declare class CommandBarUI {
|
|
14
15
|
private searcherSlot;
|
|
15
16
|
private commandSlot;
|
|
16
17
|
private mousetrap;
|
|
17
18
|
private commandSearcher;
|
|
19
|
+
/** Opens the command bar */
|
|
18
20
|
open: () => boolean;
|
|
21
|
+
/** Closes the command bar */
|
|
19
22
|
close: () => void;
|
|
23
|
+
/** Add and autocomplete provider. To support keyboard navigation, each result should have a props `active: boolean`, and `exectue: () => any` */
|
|
20
24
|
addSearcher(commandSearcher: SearchProvider): this;
|
|
25
|
+
/**
|
|
26
|
+
* registers a command
|
|
27
|
+
*/
|
|
21
28
|
addCommand(...originalCommands: CommandEntry[]): ((next: CommandHandler) => void)[];
|
|
29
|
+
/**
|
|
30
|
+
* executes command by name, if exists.
|
|
31
|
+
* @param commandId
|
|
32
|
+
*/
|
|
22
33
|
run(commandId: CommandId): any;
|
|
34
|
+
/**
|
|
35
|
+
* executes a keyboard shortcut manually
|
|
36
|
+
*/
|
|
23
37
|
trigger: (key: string) => void;
|
|
24
38
|
private search;
|
|
25
39
|
private getCommand;
|
|
26
40
|
private updateCommandsSearcher;
|
|
27
41
|
private addKeybinding;
|
|
28
42
|
private renderContext;
|
|
43
|
+
/**
|
|
44
|
+
* internal. Opens and closes the command bar UI.
|
|
45
|
+
*/
|
|
29
46
|
setVisibility?: (visible: boolean) => void;
|
|
47
|
+
/**
|
|
48
|
+
* generate the ui for command bar
|
|
49
|
+
*/
|
|
30
50
|
getCommandBar: () => JSX.Element;
|
|
31
51
|
constructor(searcherSlot: SearcherSlot, commandSlot: CommandSlot, pubSub: PubsubUI);
|
|
32
52
|
static dependencies: import("@teambit/harmony").Aspect[];
|
package/dist/types.d.ts
CHANGED
|
@@ -9,7 +9,9 @@ export declare type CommanderSearchResult = {
|
|
|
9
9
|
keybinding?: Keybinding;
|
|
10
10
|
};
|
|
11
11
|
export interface SearchProvider {
|
|
12
|
+
/** provide completions for this search term */
|
|
12
13
|
search(term: string, limit: number): CommanderSearchResult[];
|
|
14
|
+
/** determines what terms are handled by this searcher. */
|
|
13
15
|
test(term: string): boolean;
|
|
14
16
|
}
|
|
15
17
|
export declare type Keybinding = string | string[];
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/command-bar",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.555",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/explorer/command-bar",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.explorer",
|
|
8
8
|
"name": "command-bar",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.555"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"core-js": "^3.0.0",
|
|
20
20
|
"@teambit/base-ui.surfaces.card": "1.0.1",
|
|
21
21
|
"@teambit/base-ui.text.muted-text": "1.0.1",
|
|
22
|
-
"@teambit/preview": "0.0.
|
|
23
|
-
"@teambit/pubsub": "0.0.
|
|
24
|
-
"@teambit/ui-foundation.ui.is-browser": "0.0.
|
|
25
|
-
"@teambit/ui": "0.0.
|
|
26
|
-
"@teambit/bit-error": "0.0.
|
|
27
|
-
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.
|
|
28
|
-
"@teambit/ui-foundation.ui.keycap": "0.0.
|
|
29
|
-
"@teambit/component": "0.0.
|
|
22
|
+
"@teambit/preview": "0.0.555",
|
|
23
|
+
"@teambit/pubsub": "0.0.555",
|
|
24
|
+
"@teambit/ui-foundation.ui.is-browser": "0.0.463",
|
|
25
|
+
"@teambit/ui": "0.0.555",
|
|
26
|
+
"@teambit/bit-error": "0.0.372",
|
|
27
|
+
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.463",
|
|
28
|
+
"@teambit/ui-foundation.ui.keycap": "0.0.463",
|
|
29
|
+
"@teambit/component": "0.0.555"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/mousetrap": "1.6.5",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@types/node": "12.20.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@teambit/legacy": "1.0.
|
|
42
|
+
"@teambit/legacy": "1.0.172",
|
|
43
43
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
44
44
|
"react": "^16.8.0 || ^17.0.0"
|
|
45
45
|
},
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"react": "-"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@teambit/legacy": "1.0.
|
|
70
|
+
"@teambit/legacy": "1.0.172",
|
|
71
71
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
72
72
|
"react": "^16.8.0 || ^17.0.0"
|
|
73
73
|
}
|
package/tsconfig.json
CHANGED
|
Binary file
|