@zeroleo12345/tabby-send-input 0.0.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Domain
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # tabby-quick-cmds
2
+
3
+ A plugin that provides quick command functionality for Tabby terminal.
4
+
5
+ ## Features
6
+
7
+ - Quick Command Menu: Quickly open command list through hotkeys
8
+ - Command Group Management: Support organizing commands by groups
9
+ - Multi-line Command Support: Execute complex commands containing multiple lines
10
+ - Hotkey Combination Support: Send special combination key commands (like Ctrl+C, Ctrl+I, etc.)
11
+ - Delayed Execution: Support adding delays between commands
12
+ - Enter Control: Option to automatically add carriage return at the end of commands
13
+
14
+ ## Hotkeys
15
+
16
+ - Windows: `Alt+Q`
17
+ - macOS: `option(⌥)+Q`
18
+ - Linux: `Alt+Q`
19
+
20
+ ## Installation
21
+
22
+ ### Install from ZIP Package
23
+
24
+ 1. Download the latest release ZIP package from [GitHub Releases](https://github.com/minyoad/terminus-quick-cmds/releases)
25
+ 2. Extract the ZIP package
26
+ 3. Copy the extracted folder to Tabby's plugins directory:
27
+ - Windows: `%APPDATA%\tabby\plugins\node_modules`
28
+ - macOS: `~/Library/Application Support/tabby/plugins`
29
+ - Linux: `~/.config/tabby/plugins`
30
+ 4. Restart Tabby
31
+ 5. Verify the installation by checking if the Quick Commands menu appears in Tabby's settings
32
+
33
+ ## Configuration
34
+
35
+ ### Command Configuration
36
+
37
+ Each command contains the following properties:
38
+ - name: Command name
39
+ - text: Command content
40
+ - appendCR: Whether to automatically add carriage return (true/false)
41
+ - group: Command group (optional)
42
+
43
+ ### Special Syntax
44
+
45
+ 1. Multi-line Commands: Use line breaks directly in command content
46
+ ```
47
+ cd /path/to/project
48
+ npm install
49
+ npm start
50
+ ```
51
+
52
+ 2. Combination Keys: Use ASCII control characters
53
+ - Ctrl+C: \x03
54
+ - Ctrl+I: \x09
55
+
56
+ 3. Delayed Execution: Use \sxxx to add delay
57
+ - \s1000: Delay 1000 milliseconds
58
+
59
+ ## Usage Examples
60
+
61
+ 1. Basic Command
62
+ ```
63
+ name: "List Files"
64
+ text: "ls -la"
65
+ appendCR: true
66
+ ```
67
+
68
+ 2. Multi-line Command Example
69
+ ```
70
+ name: "Start Project"
71
+ text: "cd ~/project\nnpm install\nnpm start"
72
+ appendCR: true
73
+ ```
74
+
75
+ 3. Command with Delay
76
+ ```
77
+ name: "Step Execution"
78
+ text: "echo Step 1\s1000\necho Step 2\s1000\necho Step 3"
79
+ appendCR: true
80
+ ```
81
+
82
+ 4. Combination Key Command
83
+ ```
84
+ name: "Interrupt Process"
85
+ text: "\x03"
86
+ appendCR: false
87
+ ```
package/dist/api.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ export interface QuickCmds {
2
+ id: string;
3
+ name: string;
4
+ text: string;
5
+ appendCR: boolean;
6
+ group?: string;
7
+ shortcut?: string;
8
+ }
9
+ export interface ICmdGroup {
10
+ name: string;
11
+ cmds: QuickCmds[];
12
+ }
@@ -0,0 +1,13 @@
1
+ import { HotkeysService, ToolbarButtonProvider, IToolbarButton, ConfigService, AppService, BaseTabComponent } from 'tabby-core';
2
+ import { QuickCmds } from './api';
3
+ export declare class QuickCmdButtonProvider extends ToolbarButtonProvider {
4
+ private hotkeys;
5
+ private config;
6
+ private app;
7
+ PLUGIN_NAME: string;
8
+ constructor(hotkeys: HotkeysService, config: ConfigService, app: AppService);
9
+ executeCommandByShortcut(hotkey_id: string): Promise<void>;
10
+ _send(tab: BaseTabComponent, quick_cmd: QuickCmds): any;
11
+ reload_hotkey(): void;
12
+ provide(): IToolbarButton[];
13
+ }
@@ -0,0 +1,13 @@
1
+ import { HotkeysService, ToolbarButtonProvider, IToolbarButton, ConfigService, AppService, BaseTabComponent } from 'tabby-core';
2
+ import { QuickCmds } from './api';
3
+ export declare class ButtonProvider extends ToolbarButtonProvider {
4
+ private hotkeys;
5
+ private config;
6
+ private app;
7
+ PLUGIN_NAME: string;
8
+ constructor(hotkeys: HotkeysService, config: ConfigService, app: AppService);
9
+ executeCommandByShortcut(hotkey_id: string): Promise<void>;
10
+ _send(tab: BaseTabComponent, quick_cmd: QuickCmds): any;
11
+ reload_hotkey(): void;
12
+ provide(): IToolbarButton[];
13
+ }
@@ -0,0 +1,13 @@
1
+ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
2
+ import { QuickCmds } from '../api';
3
+ export declare class EditCommandModalComponent {
4
+ private modalInstance;
5
+ allGroups: string[];
6
+ command: QuickCmds;
7
+ isCapturingShortcut: boolean;
8
+ constructor(modalInstance: NgbActiveModal);
9
+ onKeyDown(event: KeyboardEvent): void;
10
+ startCaptureShortcut(event: Event): void;
11
+ save(): void;
12
+ cancel(): void;
13
+ }
@@ -0,0 +1,12 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
3
+ export declare class PromptModalComponent {
4
+ private modalInstance;
5
+ value: string;
6
+ password: boolean;
7
+ input: ElementRef;
8
+ constructor(modalInstance: NgbActiveModal);
9
+ ngOnInit(): void;
10
+ ok(): void;
11
+ cancel(): void;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
2
+ import { ConfigService, ToolbarButtonProvider } from 'tabby-core';
3
+ import { QuickCmds, ICmdGroup } from '../api';
4
+ export declare class QuickCmdsSettingsTabComponent {
5
+ config: ConfigService;
6
+ private ngbModal;
7
+ private buttonProviders;
8
+ quickCmd: string;
9
+ commands: QuickCmds[];
10
+ childGroups: ICmdGroup[];
11
+ groupCollapsed: {
12
+ [id: string]: boolean;
13
+ };
14
+ constructor(config: ConfigService, ngbModal: NgbModal, buttonProviders: ToolbarButtonProvider[]);
15
+ private get_button;
16
+ createCommand(): void;
17
+ editCommand(command: QuickCmds): void;
18
+ deleteCommand(command: QuickCmds): void;
19
+ editGroup(group: ICmdGroup): void;
20
+ deleteGroup(group: ICmdGroup): void;
21
+ cancelFilter(): void;
22
+ refresh(): void;
23
+ }
@@ -0,0 +1,11 @@
1
+ import { ConfigProvider } from 'tabby-core';
2
+ import { QuickCmds } from "./api";
3
+ export declare class QuickCmdsConfigProvider extends ConfigProvider {
4
+ defaults: {
5
+ qc: {
6
+ cmds: QuickCmds[];
7
+ };
8
+ hotkeys: {};
9
+ };
10
+ platformDefaults: {};
11
+ }
@@ -0,0 +1,17 @@
1
+ import { altKeyName, metaKeyName } from "tabby-core";
2
+ export { altKeyName, metaKeyName };
3
+ export interface KeyEventData {
4
+ ctrlKey?: boolean;
5
+ metaKey?: boolean;
6
+ altKey?: boolean;
7
+ shiftKey?: boolean;
8
+ key: string;
9
+ code: string;
10
+ eventName: string;
11
+ time: number;
12
+ registrationTime: number;
13
+ }
14
+ export declare type KeyName = string;
15
+ export declare type Keystroke = string;
16
+ export declare function getKeyName(event: KeyEventData): KeyName;
17
+ export declare function getKeystrokeName(keys: KeyName[]): Keystroke;
@@ -0,0 +1,2 @@
1
+ export default class QuickCmdsModule {
2
+ }
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! For license information please see index.js.LICENSE.txt */
2
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("@ng-bootstrap/ng-bootstrap"),require("tabby-core"),require("tabby-settings"),require("tabby-terminal"));else if("function"==typeof define&&define.amd)define(["@angular/common","@angular/core","@angular/forms","@ng-bootstrap/ng-bootstrap","tabby-core","tabby-settings","tabby-terminal"],e);else{var o="object"==typeof exports?e(require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("@ng-bootstrap/ng-bootstrap"),require("tabby-core"),require("tabby-settings"),require("tabby-terminal")):e(t["@angular/common"],t["@angular/core"],t["@angular/forms"],t["@ng-bootstrap/ng-bootstrap"],t["tabby-core"],t["tabby-settings"],t["tabby-terminal"]);for(var n in o)("object"==typeof exports?exports:t)[n]=o[n]}}(global,((t,e,o,n,r,a,i)=>{return s={27:(t,e,o)=>{var n=o(817);t.exports=(n.default||n).apply(n,[])},721:(t,e,o)=>{var n=o(29);t.exports=(n.default||n).apply(n,[])},774:(t,e,o)=>{var n=o(772);t.exports=(n.default||n).apply(n,[])},817:(t,e,o)=>{o(55),t.exports=function(t){var e="",o=t||{};return function(t){e+='<div class="modal-body"><div class="form-group"><label>Name</label><input class="form-control" type="text" placeholder="Name" autofocus [(ngModel)]="command.name"></div><div class="form-group"><label>Text</label><textarea class="form-control" rows="6" style="white-space: pre-line" placeholder="Text to be sent" [(ngModel)]="command.text"></textarea></div><div class="form-group"><label>Group</label><select class="form-control" [(ngModel)]="command.group"><option [value]="">Ungrouped</option><option *ngFor="let group of allGroups" [value]="group">{{ group }}</option></select></div><div class="form-group"><label>Shortcut</label><div class="input-group"><input class="form-control" type="text" placeholder="Click to capture shortcut" [(ngModel)]="command.shortcut" (click)="startCaptureShortcut($event)" (focus)="startCaptureShortcut($event)" [disabled]="isCapturingShortcut"><div class="input-group-append"><button class="btn btn-outline-secondary" type="button" (click)="startCaptureShortcut($event)" [class.btn-outline-primary]="isCapturingShortcut">',e+=t?"Capturing...":"Capture",e+='</button></div></div></div><div class="form-line"><div class="header"><div class="title">Append \'\\n\'</div><div class="description">Automatically append a \'\\n\' char to the end</div></div><toggle [(ngModel)]="command.appendCR"></toggle></div></div><div class="modal-footer"><button class="btn btn-outline-primary" (click)="save()">Save</button><button class="btn btn-outline-danger" (click)="cancel()">Cancel</button></div>'}.call(this,"isCapturingShortcut"in o?o.isCapturingShortcut:"undefined"!=typeof isCapturingShortcut?isCapturingShortcut:void 0),e}},29:(t,e,o)=>{o(55),t.exports=function(t){return""+'<div class="modal-body"><input class="form-control" [type]="password ? &quot;password&quot; : &quot;text&quot;" autofocus [(ngModel)]="value" #input [placeholder]="prompt" (keyup.enter)="ok()" (keyup.esc)="cancel()"></div>'}},772:(t,e,o)=>{o(55),t.exports=function(t){return""+'<h3>Quick Commands</h3><div class="form-group"><button class="btn btn-outline-primary" (click)="createCommand()"><div class="fa fa-fw fa-globe"></div><span class="ml-2">Add command</span></button></div><div class="form-group"><input class="form-control quickCmd" type="text" [(ngModel)]="quickCmd" autofocus placeholder="enter to filter" (ngModelChange)="refresh()" (keyup.esc)="cancelFilter()"></div><div class="list-group mt-3 mb-3"><ng-container *ngFor="let group of childGroups"> <div class="list-group-item list-group-item-action d-flex align-items-center" (click)="groupCollapsed[group.name] = !groupCollapsed[group.name]"><div class="fa fa-fw fa-chevron-right" *ngIf="groupCollapsed[group.name]"></div><div class="fa fa-fw fa-chevron-down" *ngIf="!groupCollapsed[group.name]"></div><span class="ml-3 mr-auto">{{group.name || "Ungrouped"}}</span><button class="btn btn-outline-info ml-2" (click)="editGroup(group)"><i class="fa fa-pencil"></i></button><button class="btn btn-outline-danger ml-1" (click)="deleteGroup(group)"><i class="fa fa-trash-can"> </i></button></div><ng-container *ngIf="!groupCollapsed[group.name]"><div class="list-group-item pl-5 d-flex align-items-center" *ngFor="let cmd of group.cmds"> <div class="mr-auto"><div>{{cmd.name}}</div><div class="text-muted">{{cmd.text}} {{cmd.appendCR ? "\\\\n" : ""}}</div></div><button class="btn btn-outline-info ml-2" (click)="editCommand(cmd)"><i class="fa fa-pencil"></i></button><button class="btn btn-outline-danger ml-1" (click)="deleteCommand(cmd)"><i class="fa fa-trash-can"> </i></button></div></ng-container></ng-container></div>'}},55:(t,e,o)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(t,e){return Array.isArray(t)?function(t,e){for(var o,n="",a="",i=Array.isArray(e),s=0;s<t.length;s++)(o=r(t[s]))&&(i&&e[s]&&(o=c(o)),n=n+a+o,a=" ");return n}(t,e):t&&"object"==typeof t?function(t){var e="",o="";for(var r in t)r&&t[r]&&n.call(t,r)&&(e=e+o+r,o=" ");return e}(t):t||""}function a(t){if(!t)return"";if("object"==typeof t){var e="";for(var o in t)n.call(t,o)&&(e=e+o+":"+t[o]+";");return e}return t+""}function i(t,e,o,n){if(!1===e||null==e||!e&&("class"===t||"style"===t))return"";if(!0===e)return" "+(n?t:t+'="'+t+'"');var r=typeof e;return"object"!==r&&"function"!==r||"function"!=typeof e.toJSON||(e=e.toJSON()),"string"==typeof e||(e=JSON.stringify(e),o||-1===e.indexOf('"'))?(o&&(e=c(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"&#39;")+"'"}e.merge=function t(e,o){if(1===arguments.length){for(var n=e[0],r=1;r<e.length;r++)n=t(n,e[r]);return n}for(var i in o)if("class"===i){var s=e[i]||[];e[i]=(Array.isArray(s)?s:[s]).concat(o[i]||[])}else if("style"===i){s=(s=a(e[i]))&&";"!==s[s.length-1]?s+";":s;var c=a(o[i]);c=c&&";"!==c[c.length-1]?c+";":c,e[i]=s+c}else e[i]=o[i];return e},e.classes=r,e.style=a,e.attr=i,e.attrs=function(t,e){var o="";for(var s in t)if(n.call(t,s)){var c=t[s];if("class"===s){o=i(s,c=r(c),!1,e)+o;continue}"style"===s&&(c=a(c)),o+=i(s,c,!1,e)}return o};var s=/["&<>]/;function c(t){var e=""+t,o=s.exec(e);if(!o)return t;var n,r,a,i="";for(n=o.index,r=0;n<e.length;n++){switch(e.charCodeAt(n)){case 34:a="&quot;";break;case 38:a="&amp;";break;case 60:a="&lt;";break;case 62:a="&gt;";break;default:continue}r!==n&&(i+=e.substring(r,n)),r=n+1,i+=a}return r!==n?i+e.substring(r,n):i}e.escape=c,e.rethrow=function t(e,n,r,a){if(!(e instanceof Error))throw e;if(!("undefined"==typeof window&&n||a))throw e.message+=" on line "+r,e;var i,s,c,l;try{a=a||o(147).readFileSync(n,{encoding:"utf8"}),i=3,s=a.split("\n"),c=Math.max(r-i,0),l=Math.min(s.length,r+i)}catch(o){return e.message+=" - could not read from "+n+" ("+o.message+")",void t(e,null,r)}i=s.slice(c,l).map((function(t,e){var o=e+c+1;return(o==r?" > ":" ")+o+"| "+t})).join("\n"),e.path=n;try{e.message=(n||"Pug")+":"+r+"\n"+i+"\n\n"+e.message}catch(t){}throw e}},812:t=>{t.exports='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve"><metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata><g><path d="M286.1,422.2h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C315.5,409,302.3,422.2,286.1,422.2z"></path><path d="M455.2,422.2h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C484.6,409,471.3,422.2,455.2,422.2z"></path><path d="M624.2,422.2h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C653.6,409,640.4,422.2,624.2,422.2z"></path><path d="M793.2,422.2h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C822.6,409,809.4,422.2,793.2,422.2z"></path><path d="M305,573.6h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4H305c16.2,0,29.4,13.2,29.4,29.4v54.4C334.4,560.4,321.2,573.6,305,573.6z"></path><path d="M461.5,573.6h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C490.9,560.4,477.6,573.6,461.5,573.6z"></path><path d="M617.9,573.6h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C647.3,560.4,634.1,573.6,617.9,573.6z"></path><path d="M774.4,573.6H695c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C803.8,560.4,790.6,573.6,774.4,573.6z"></path><path d="M741.1,732.1H258.9c-16.2,0-29.4-13.2-29.4-29.4v-35.3c0-16.2,13.2-29.4,29.4-29.4h482.2c16.2,0,29.4,13.2,29.4,29.4v35.3C770.5,718.9,757.3,732.1,741.1,732.1z"></path><path d="M500,39.4c62.2,0,122.5,12.2,179.3,36.2c54.8,23.2,104.1,56.4,146.4,98.7s75.5,91.6,98.7,146.4c24,56.8,36.2,117.1,36.2,179.3c0,62.2-12.2,122.5-36.2,179.3c-23.2,54.8-56.4,104.1-98.7,146.4s-91.6,75.5-146.4,98.7c-56.8,24-117.1,36.2-179.3,36.2c-62.2,0-122.5-12.2-179.3-36.2c-54.8-23.2-104.1-56.4-146.4-98.7s-75.5-91.6-98.7-146.4c-24-56.8-36.2-117.1-36.2-179.3c0-62.2,12.2-122.5,36.2-179.3c23.2-54.8,56.4-104.1,98.7-146.4s91.6-75.5,146.4-98.7C377.5,51.6,437.8,39.4,500,39.4 M500,10C229.4,10,10,229.4,10,500s219.4,490,490,490c270.6,0,490-219.4,490-490S770.6,10,500,10L500,10z"></path></g></svg>'},881:function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(i=(a<3?r(i):a>3?r(e,o,i):r(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},a=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))((function(r,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function s(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,s)}c((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.QuickCmdButtonProvider=void 0;const i=o(900),s=o(315),c=o(316);let l=class extends s.ToolbarButtonProvider{constructor(t,e,o){super(),this.hotkeys=t,this.config=e,this.app=o,this.PLUGIN_NAME="Quick Cmd",this.config.ready$.toPromise().then((()=>{this.reload_hotkey()})),this.hotkeys.hotkey$.subscribe((t=>a(this,void 0,void 0,(function*(){yield this.executeCommandByShortcut(t)}))))}executeCommandByShortcut(t){return a(this,void 0,void 0,(function*(){const e=this.config.store.qc.cmds.find((e=>e.id===t));e&&(yield this._send(this.app.activeTab,e))}))}_send(t,e){return a(this,void 0,void 0,(function*(){if(t instanceof s.SplitTabComponent)return this._send(t.getFocusedTab(),e);if(t instanceof c.BaseTerminalTabComponent){let o=e.text;o.startsWith("\\x")&&(o=o.replace(/\\x([0-9a-f]{2})/gi,(function(t,e){return String.fromCharCode(parseInt(e,16))})));let n=t;return yield n.sendInput(o),!0}return!1}))}reload_hotkey(){console.log("[Quick Cmd] reload hotkeys");for(const t of Object.keys(this.config.store.hotkeys))t.startsWith(this.PLUGIN_NAME)&&delete this.config.store.hotkeys[t];let t;for(let e of this.config.store.qc.cmds)t=this.PLUGIN_NAME+":"+e.name,this.config.store.hotkeys[t]=[e.shortcut.replace(/\+/g,"-")],e.id=t}provide(){return[{icon:o(812),weight:5,title:"Quick commands",touchBarNSImage:"NSTouchBarComposeTemplate"}]}};l=n([(0,i.Injectable)(),r("design:paramtypes",[s.HotkeysService,s.ConfigService,s.AppService])],l),e.QuickCmdButtonProvider=l},704:function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(i=(a<3?r(i):a>3?r(e,o,i):r(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};Object.defineProperty(e,"__esModule",{value:!0}),e.EditCommandModalComponent=void 0;const a=o(900),i=o(571),s=o(684),c=o(315);let l=class{constructor(t){this.modalInstance=t,this.allGroups=[],this.isCapturingShortcut=!1}onKeyDown(t){if(this.isCapturingShortcut){t.preventDefault(),t.stopPropagation();const e={ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,shiftKey:t.shiftKey,code:t.code,key:t.key,eventName:"keydown",time:t.timeStamp,registrationTime:performance.now()},o=(0,s.getKeyName)(e);if("Escape"===o)return void(this.isCapturingShortcut=!1);if("Delete"===o||"Backspace"===o)return this.command.shortcut="",void(this.isCapturingShortcut=!1);const n=[];e.ctrlKey&&n.push("Ctrl"),e.metaKey&&n.push(c.metaKeyName),e.altKey&&n.push(c.altKeyName),e.shiftKey&&n.push("Shift"),n.sort();let r="";n.length>0&&(r=n.join("+")+"+"),["Control",c.altKeyName,"Shift",c.metaKeyName].includes(o)||(r+=o,this.command.shortcut=r,this.isCapturingShortcut=!1)}}startCaptureShortcut(t){t.preventDefault(),this.isCapturingShortcut=!0}save(){this.modalInstance.close(this.command)}cancel(){this.modalInstance.dismiss()}};n([(0,a.HostListener)("document:keydown",["$event"]),r("design:type",Function),r("design:paramtypes",[KeyboardEvent]),r("design:returntype",void 0)],l.prototype,"onKeyDown",null),l=n([(0,a.Component)({template:o(27)}),r("design:paramtypes",[i.NgbActiveModal])],l),e.EditCommandModalComponent=l},491:function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(i=(a<3?r(i):a>3?r(e,o,i):r(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};Object.defineProperty(e,"__esModule",{value:!0}),e.PromptModalComponent=void 0;const a=o(900),i=o(571);let s=class{constructor(t){this.modalInstance=t}ngOnInit(){this.input.nativeElement.focus()}ok(){this.modalInstance.close(this.value)}cancel(){this.modalInstance.close("")}};n([(0,a.Input)(),r("design:type",String)],s.prototype,"value",void 0),n([(0,a.Input)(),r("design:type",Boolean)],s.prototype,"password",void 0),n([(0,a.ViewChild)("input"),r("design:type",a.ElementRef)],s.prototype,"input",void 0),s=n([(0,a.Component)({template:o(721)}),r("design:paramtypes",[i.NgbActiveModal])],s),e.PromptModalComponent=s},864:function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(i=(a<3?r(i):a>3?r(e,o,i):r(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},a=this&&this.__param||function(t,e){return function(o,n){e(o,n,t)}};Object.defineProperty(e,"__esModule",{value:!0}),e.QuickCmdsSettingsTabComponent=void 0;const i=o(900),s=o(571),c=o(315),l=o(704),u=o(491),d=o(881);let p=class{constructor(t,e,o){this.config=t,this.ngbModal=e,this.buttonProviders=o,this.groupCollapsed={},this.commands=this.config.store.qc.cmds,this.refresh()}get_button(){return this.buttonProviders.find((t=>t instanceof d.QuickCmdButtonProvider))}createCommand(){let t=this.ngbModal.open(l.EditCommandModalComponent);t.componentInstance.command={id:"",name:"",text:"",appendCR:!1},t.componentInstance.allGroups=Array.from(new Set(this.commands.map((t=>t.group||"")))).filter((t=>t)),t.result.then((t=>{this.commands.push(t),this.config.store.qc.cmds=this.commands,this.config.save(),this.refresh()}))}editCommand(t){let e=this.ngbModal.open(l.EditCommandModalComponent);e.componentInstance.command=Object.assign(Object.assign({},t),{group:t.group||"Ungrouped"}),e.componentInstance.allGroups=Array.from(new Set(this.commands.map((t=>t.group||"")))).filter((t=>t)),e.result.then((e=>{"Ungrouped"===e.group&&(e.group=null),Object.assign(t,e),this.config.save(),this.refresh()}))}deleteCommand(t){confirm(`Delete "${t.name}"?`)&&(this.commands=this.commands.filter((e=>e!==t)),this.config.store.qc.cmds=this.commands,this.config.save(),this.refresh())}editGroup(t){let e=this.ngbModal.open(u.PromptModalComponent);e.componentInstance.prompt="New group name",e.componentInstance.value=t.name,e.result.then((e=>{if(e){for(let o of this.commands.filter((e=>e.group===t.name)))o.group=e;this.config.save(),this.refresh()}}))}deleteGroup(t){if(confirm(`Delete "${t}"?`)){for(let e of this.commands.filter((e=>e.group===t.name)))e.group=null;this.config.save(),this.refresh()}}cancelFilter(){this.quickCmd="",this.refresh()}refresh(){var t;this.childGroups=[];let e=this.commands;this.quickCmd&&(e=e.filter((t=>(t.name+t.group+t.text).toLowerCase().includes(this.quickCmd))));for(let t of e){t.group=t.group||null;let e=this.childGroups.find((e=>e.name===t.group));e||(e={name:t.group,cmds:[]},this.childGroups.push(e)),e.cmds.push(t)}null===(t=this.get_button())||void 0===t||t.reload_hotkey()}};p=n([(0,i.Component)({template:o(774)}),a(2,(0,i.Inject)(c.ToolbarButtonProvider)),r("design:paramtypes",[c.ConfigService,s.NgbModal,Array])],p),e.QuickCmdsSettingsTabComponent=p},913:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickCmdsConfigProvider=void 0;const n=o(315);class r extends n.ConfigProvider{constructor(){super(...arguments),this.defaults={qc:{cmds:[]},hotkeys:{}},this.platformDefaults={}}}e.QuickCmdsConfigProvider=r},684:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getKeystrokeName=e.getKeyName=e.metaKeyName=e.altKeyName=void 0;const n=o(315);Object.defineProperty(e,"altKeyName",{enumerable:!0,get:function(){return n.altKeyName}}),Object.defineProperty(e,"metaKeyName",{enumerable:!0,get:function(){return n.metaKeyName}});const r=/^[A-Za-z]$/;e.getKeyName=function(t){var e;let o;return"Control"===t.key?o="Ctrl":"Meta"===t.key?o=n.metaKeyName:"Alt"===t.key?o=n.altKeyName:"Shift"===t.key?o="Shift":"`"===t.key?o="`":"~"===t.key?o="~":(o=t.code,r.test(t.key)?o=t.key.toUpperCase():(o=o.replace("Key",""),o=o.replace("Arrow",""),o=o.replace("Digit",""),o=null!==(e={Comma:",",Period:".",Slash:"/",Backslash:"\\",IntlBackslash:"`",Minus:"-",Equal:"=",Semicolon:";",Quote:"'",BracketLeft:"[",BracketRight:"]"}[o])&&void 0!==e?e:o)),o},e.getKeystrokeName=function(t){const e=["Ctrl",n.metaKeyName,n.altKeyName,"Shift"];return(t=[...e.map((e=>t.find((t=>t===e)))).filter((t=>!!t)),...t.filter((t=>!e.includes(t)))]).join("-")}},607:function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(i=(a<3?r(i):a>3?r(e,o,i):r(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i};Object.defineProperty(e,"__esModule",{value:!0});const r=o(900),a=o(848),i=o(161),s=o(571),c=o(315),l=o(315),u=o(663),d=o(704),p=o(864),f=o(491),m=o(881),h=o(913),g=o(310);let v=class{};v=n([(0,r.NgModule)({imports:[s.NgbModule,a.CommonModule,i.FormsModule,l.default],providers:[{provide:c.ToolbarButtonProvider,useClass:m.QuickCmdButtonProvider,multi:!0},{provide:c.ConfigProvider,useClass:h.QuickCmdsConfigProvider,multi:!0},{provide:u.SettingsTabProvider,useClass:g.QuickCmdsSettingsTabProvider,multi:!0}],declarations:[f.PromptModalComponent,d.EditCommandModalComponent,p.QuickCmdsSettingsTabComponent]})],v),e.default=v},310:function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(i=(a<3?r(i):a>3?r(e,o,i):r(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.QuickCmdsSettingsTabProvider=void 0;const r=o(900),a=o(663),i=o(864);let s=class extends a.SettingsTabProvider{constructor(){super(...arguments),this.id="qc",this.title="Quick Commands"}getComponentType(){return i.QuickCmdsSettingsTabComponent}};s=n([(0,r.Injectable)()],s),e.QuickCmdsSettingsTabProvider=s},147:t=>{"use strict";t.exports=require("fs")},848:e=>{"use strict";e.exports=t},900:t=>{"use strict";t.exports=e},161:t=>{"use strict";t.exports=o},571:t=>{"use strict";t.exports=n},315:t=>{"use strict";t.exports=r},663:t=>{"use strict";t.exports=a},316:t=>{"use strict";t.exports=i}},c={},function t(e){var o=c[e];if(void 0!==o)return o.exports;var n=c[e]={exports:{}};return s[e].call(n.exports,n,n.exports,t),n.exports}(607);var s,c}));
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,147 @@
1
+ /*! !!./node_modules/pug-loader/index.js!./src/components/editCommandModal.component.pug */
2
+
3
+ /*! !!./node_modules/pug-loader/index.js!./src/components/promptModal.component.pug */
4
+
5
+ /*! !!./node_modules/pug-loader/index.js!./src/components/quickCmdsSettingsTab.component.pug */
6
+
7
+ /*! !../../node_modules/pug-runtime/index.js */
8
+
9
+ /*! ../button */
10
+
11
+ /*! ../hotkeys.util */
12
+
13
+ /*! ./button */
14
+
15
+ /*! ./components/editCommandModal.component */
16
+
17
+ /*! ./components/promptModal.component */
18
+
19
+ /*! ./components/quickCmdsSettingsTab.component */
20
+
21
+ /*! ./config */
22
+
23
+ /*! ./editCommandModal.component */
24
+
25
+ /*! ./editCommandModal.component.pug */
26
+
27
+ /*! ./icons/keyboard.svg */
28
+
29
+ /*! ./promptModal.component */
30
+
31
+ /*! ./promptModal.component.pug */
32
+
33
+ /*! ./quickCmdsSettingsTab.component.pug */
34
+
35
+ /*! ./settings */
36
+
37
+ /*! @angular/common */
38
+
39
+ /*! @angular/core */
40
+
41
+ /*! @angular/forms */
42
+
43
+ /*! @ng-bootstrap/ng-bootstrap */
44
+
45
+ /*! fs */
46
+
47
+ /*! tabby-core */
48
+
49
+ /*! tabby-settings */
50
+
51
+ /*! tabby-terminal */
52
+
53
+ /*!*********************!*\
54
+ !*** external "fs" ***!
55
+ \*********************/
56
+
57
+ /*!**********************!*\
58
+ !*** ./src/index.ts ***!
59
+ \**********************/
60
+
61
+ /*!***********************!*\
62
+ !*** ./src/button.ts ***!
63
+ \***********************/
64
+
65
+ /*!***********************!*\
66
+ !*** ./src/config.ts ***!
67
+ \***********************/
68
+
69
+ /*!*************************!*\
70
+ !*** ./src/settings.ts ***!
71
+ \*************************/
72
+
73
+ /*!*****************************!*\
74
+ !*** ./src/hotkeys.util.ts ***!
75
+ \*****************************/
76
+
77
+ /*!*****************************!*\
78
+ !*** external "tabby-core" ***!
79
+ \*****************************/
80
+
81
+ /*!********************************!*\
82
+ !*** ./src/icons/keyboard.svg ***!
83
+ \********************************/
84
+
85
+ /*!********************************!*\
86
+ !*** external "@angular/core" ***!
87
+ \********************************/
88
+
89
+ /*!*********************************!*\
90
+ !*** external "@angular/forms" ***!
91
+ \*********************************/
92
+
93
+ /*!*********************************!*\
94
+ !*** external "tabby-settings" ***!
95
+ \*********************************/
96
+
97
+ /*!*********************************!*\
98
+ !*** external "tabby-terminal" ***!
99
+ \*********************************/
100
+
101
+ /*!**********************************!*\
102
+ !*** external "@angular/common" ***!
103
+ \**********************************/
104
+
105
+ /*!*******************************************!*\
106
+ !*** ./node_modules/pug-runtime/index.js ***!
107
+ \*******************************************/
108
+
109
+ /*!*********************************************!*\
110
+ !*** external "@ng-bootstrap/ng-bootstrap" ***!
111
+ \*********************************************/
112
+
113
+ /*!*************************************************!*\
114
+ !*** ./src/components/promptModal.component.ts ***!
115
+ \*************************************************/
116
+
117
+ /*!**************************************************!*\
118
+ !*** ./src/components/promptModal.component.pug ***!
119
+ \**************************************************/
120
+
121
+ /*!******************************************************!*\
122
+ !*** ./src/components/editCommandModal.component.ts ***!
123
+ \******************************************************/
124
+
125
+ /*!*******************************************************!*\
126
+ !*** ./src/components/editCommandModal.component.pug ***!
127
+ \*******************************************************/
128
+
129
+ /*!**********************************************************!*\
130
+ !*** ./src/components/quickCmdsSettingsTab.component.ts ***!
131
+ \**********************************************************/
132
+
133
+ /*!***********************************************************!*\
134
+ !*** ./src/components/quickCmdsSettingsTab.component.pug ***!
135
+ \***********************************************************/
136
+
137
+ /*!*************************************************************************************!*\
138
+ !*** ./node_modules/pug-loader/index.js!./src/components/promptModal.component.pug ***!
139
+ \*************************************************************************************/
140
+
141
+ /*!******************************************************************************************!*\
142
+ !*** ./node_modules/pug-loader/index.js!./src/components/editCommandModal.component.pug ***!
143
+ \******************************************************************************************/
144
+
145
+ /*!**********************************************************************************************!*\
146
+ !*** ./node_modules/pug-loader/index.js!./src/components/quickCmdsSettingsTab.component.pug ***!
147
+ \**********************************************************************************************/
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","mappings":";CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,mBAAoBA,QAAQ,iBAAkBA,QAAQ,kBAAmBA,QAAQ,8BAA+BA,QAAQ,cAAeA,QAAQ,kBAAmBA,QAAQ,wBACvM,GAAqB,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,kBAAmB,gBAAiB,iBAAkB,6BAA8B,aAAc,iBAAkB,kBAAmBJ,OAC3I,CACJ,IAAIM,EAAuB,iBAAZL,QAAuBD,EAAQG,QAAQ,mBAAoBA,QAAQ,iBAAkBA,QAAQ,kBAAmBA,QAAQ,8BAA+BA,QAAQ,cAAeA,QAAQ,kBAAmBA,QAAQ,mBAAqBH,EAAQD,EAAK,mBAAoBA,EAAK,iBAAkBA,EAAK,kBAAmBA,EAAK,8BAA+BA,EAAK,cAAeA,EAAK,kBAAmBA,EAAK,mBAC1Z,IAAI,IAAIQ,KAAKD,GAAuB,iBAAZL,QAAuBA,QAAUF,GAAMQ,GAAKD,EAAEC,I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ICCb8P,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBvP,IAAjBwP,EACH,OAAOA,EAAa/Q,QAGrB,IAAIC,EAAS2Q,EAAyBE,GAAY,CAGjD9Q,QAAS,IAOV,OAHAgR,EAAoBF,GAAUzP,KAAKpB,EAAOD,QAASC,EAAQA,EAAOD,QAAS6Q,GAGpE5Q,EAAOD,QClBW6Q,CAAoB,WDF1CD","sources":["webpack-terminus-quick-cmds:///webpack/universalModuleDefinition","webpack://@zeroleo12345/tabby-send-input/./src/components/editCommandModal.component.pug?27df","webpack://@zeroleo12345/tabby-send-input/./src/components/promptModal.component.pug?9184","webpack://@zeroleo12345/tabby-send-input/./src/components/quickCmdsSettingsTab.component.pug?4c61","webpack-terminus-quick-cmds:///./src/components/editCommandModal.component.pug","webpack-terminus-quick-cmds:///./src/components/promptModal.component.pug","webpack-terminus-quick-cmds:///./src/components/quickCmdsSettingsTab.component.pug","webpack-terminus-quick-cmds:///./node_modules/pug-runtime/index.js","webpack-terminus-quick-cmds:///./src/icons/keyboard.svg","webpack-terminus-quick-cmds:///./src/button.ts","webpack-terminus-quick-cmds:///./src/components/editCommandModal.component.ts","webpack-terminus-quick-cmds:///./src/components/promptModal.component.ts","webpack-terminus-quick-cmds:///./src/components/quickCmdsSettingsTab.component.ts","webpack-terminus-quick-cmds:///./src/config.ts","webpack-terminus-quick-cmds:///./src/hotkeys.util.ts","webpack-terminus-quick-cmds:///./src/index.ts","webpack-terminus-quick-cmds:///./src/settings.ts","webpack-terminus-quick-cmds:///external node-commonjs \"fs\"","webpack-terminus-quick-cmds:///external umd \"@angular/common\"","webpack-terminus-quick-cmds:///external umd \"@angular/core\"","webpack-terminus-quick-cmds:///external umd \"@angular/forms\"","webpack-terminus-quick-cmds:///external umd \"@ng-bootstrap/ng-bootstrap\"","webpack-terminus-quick-cmds:///external umd \"tabby-core\"","webpack-terminus-quick-cmds:///external umd \"tabby-settings\"","webpack-terminus-quick-cmds:///external umd \"tabby-terminal\"","webpack-terminus-quick-cmds:///webpack/bootstrap","webpack-terminus-quick-cmds:///webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@angular/common\"), require(\"@angular/core\"), require(\"@angular/forms\"), require(\"@ng-bootstrap/ng-bootstrap\"), require(\"tabby-core\"), require(\"tabby-settings\"), require(\"tabby-terminal\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@angular/common\", \"@angular/core\", \"@angular/forms\", \"@ng-bootstrap/ng-bootstrap\", \"tabby-core\", \"tabby-settings\", \"tabby-terminal\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"@angular/common\"), require(\"@angular/core\"), require(\"@angular/forms\"), require(\"@ng-bootstrap/ng-bootstrap\"), require(\"tabby-core\"), require(\"tabby-settings\"), require(\"tabby-terminal\")) : factory(root[\"@angular/common\"], root[\"@angular/core\"], root[\"@angular/forms\"], root[\"@ng-bootstrap/ng-bootstrap\"], root[\"tabby-core\"], root[\"tabby-settings\"], root[\"tabby-terminal\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(global, (__WEBPACK_EXTERNAL_MODULE__848__, __WEBPACK_EXTERNAL_MODULE__900__, __WEBPACK_EXTERNAL_MODULE__161__, __WEBPACK_EXTERNAL_MODULE__571__, __WEBPACK_EXTERNAL_MODULE__315__, __WEBPACK_EXTERNAL_MODULE__663__, __WEBPACK_EXTERNAL_MODULE__316__) => {\nreturn ","var req = require(\"!!/Users/zlx/github/tabby_project/terminus-quick-cmds/node_modules/pug-loader/index.js!/Users/zlx/github/tabby_project/terminus-quick-cmds/src/components/editCommandModal.component.pug\");\nmodule.exports = (req['default'] || req).apply(req, [])","var req = require(\"!!/Users/zlx/github/tabby_project/terminus-quick-cmds/node_modules/pug-loader/index.js!/Users/zlx/github/tabby_project/terminus-quick-cmds/src/components/promptModal.component.pug\");\nmodule.exports = (req['default'] || req).apply(req, [])","var req = require(\"!!/Users/zlx/github/tabby_project/terminus-quick-cmds/node_modules/pug-loader/index.js!/Users/zlx/github/tabby_project/terminus-quick-cmds/src/components/quickCmdsSettingsTab.component.pug\");\nmodule.exports = (req['default'] || req).apply(req, [])","var pug = require(\"!../../node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;\n var locals_for_with = (locals || {});\n \n (function (isCapturingShortcut) {\n pug_html = pug_html + \"\\u003Cdiv class=\\\"modal-body\\\"\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Clabel\\u003EName\\u003C\\u002Flabel\\u003E\\u003Cinput class=\\\"form-control\\\" type=\\\"text\\\" placeholder=\\\"Name\\\" autofocus [(ngModel)]=\\\"command.name\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Clabel\\u003EText\\u003C\\u002Flabel\\u003E\\u003Ctextarea class=\\\"form-control\\\" rows=\\\"6\\\" style=\\\"white-space: pre-line\\\" placeholder=\\\"Text to be sent\\\" [(ngModel)]=\\\"command.text\\\"\\u003E\\u003C\\u002Ftextarea\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Clabel\\u003EGroup\\u003C\\u002Flabel\\u003E\\u003Cselect class=\\\"form-control\\\" [(ngModel)]=\\\"command.group\\\"\\u003E\\u003Coption [value]=\\\"\\\"\\u003EUngrouped\\u003C\\u002Foption\\u003E\\u003Coption *ngFor=\\\"let group of allGroups\\\" [value]=\\\"group\\\"\\u003E{{ group }}\\u003C\\u002Foption\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Clabel\\u003EShortcut\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"input-group\\\"\\u003E\\u003Cinput class=\\\"form-control\\\" type=\\\"text\\\" placeholder=\\\"Click to capture shortcut\\\" [(ngModel)]=\\\"command.shortcut\\\" (click)=\\\"startCaptureShortcut($event)\\\" (focus)=\\\"startCaptureShortcut($event)\\\" [disabled]=\\\"isCapturingShortcut\\\"\\u003E\\u003Cdiv class=\\\"input-group-append\\\"\\u003E\\u003Cbutton class=\\\"btn btn-outline-secondary\\\" type=\\\"button\\\" (click)=\\\"startCaptureShortcut($event)\\\" [class.btn-outline-primary]=\\\"isCapturingShortcut\\\"\\u003E\";\nif (isCapturingShortcut) {\npug_html = pug_html + \"Capturing...\";\n}\nelse {\npug_html = pug_html + \"Capture\";\n}\npug_html = pug_html + \"\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-line\\\"\\u003E\\u003Cdiv class=\\\"header\\\"\\u003E\\u003Cdiv class=\\\"title\\\"\\u003EAppend '\\\\n'\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"description\\\"\\u003EAutomatically append a '\\\\n' char to the end\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Ctoggle [(ngModel)]=\\\"command.appendCR\\\"\\u003E\\u003C\\u002Ftoggle\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"modal-footer\\\"\\u003E\\u003Cbutton class=\\\"btn btn-outline-primary\\\" (click)=\\\"save()\\\"\\u003ESave\\u003C\\u002Fbutton\\u003E\\u003Cbutton class=\\\"btn btn-outline-danger\\\" (click)=\\\"cancel()\\\"\\u003ECancel\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\";\n }.call(this, \"isCapturingShortcut\" in locals_for_with ?\n locals_for_with.isCapturingShortcut :\n typeof isCapturingShortcut !== 'undefined' ? isCapturingShortcut : undefined));\n ;;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;pug_html = pug_html + \"\\u003Cdiv class=\\\"modal-body\\\"\\u003E\\u003Cinput class=\\\"form-control\\\" [type]=\\\"password ? &quot;password&quot; : &quot;text&quot;\\\" autofocus [(ngModel)]=\\\"value\\\" #input [placeholder]=\\\"prompt\\\" (keyup.enter)=\\\"ok()\\\" (keyup.esc)=\\\"cancel()\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;pug_html = pug_html + \"\\u003Ch3\\u003EQuick Commands\\u003C\\u002Fh3\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cbutton class=\\\"btn btn-outline-primary\\\" (click)=\\\"createCommand()\\\"\\u003E\\u003Cdiv class=\\\"fa fa-fw fa-globe\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cspan class=\\\"ml-2\\\"\\u003EAdd command\\u003C\\u002Fspan\\u003E\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cinput class=\\\"form-control quickCmd\\\" type=\\\"text\\\" [(ngModel)]=\\\"quickCmd\\\" autofocus placeholder=\\\"enter to filter\\\" (ngModelChange)=\\\"refresh()\\\" (keyup.esc)=\\\"cancelFilter()\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"list-group mt-3 mb-3\\\"\\u003E\\u003Cng-container *ngFor=\\\"let group of childGroups\\\"\\u003E \\u003Cdiv class=\\\"list-group-item list-group-item-action d-flex align-items-center\\\" (click)=\\\"groupCollapsed[group.name] = !groupCollapsed[group.name]\\\"\\u003E\\u003Cdiv class=\\\"fa fa-fw fa-chevron-right\\\" *ngIf=\\\"groupCollapsed[group.name]\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"fa fa-fw fa-chevron-down\\\" *ngIf=\\\"!groupCollapsed[group.name]\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cspan class=\\\"ml-3 mr-auto\\\"\\u003E{{group.name || \\\"Ungrouped\\\"}}\\u003C\\u002Fspan\\u003E\\u003Cbutton class=\\\"btn btn-outline-info ml-2\\\" (click)=\\\"editGroup(group)\\\"\\u003E\\u003Ci class=\\\"fa fa-pencil\\\"\\u003E\\u003C\\u002Fi\\u003E\\u003C\\u002Fbutton\\u003E\\u003Cbutton class=\\\"btn btn-outline-danger ml-1\\\" (click)=\\\"deleteGroup(group)\\\"\\u003E\\u003Ci class=\\\"fa fa-trash-can\\\"\\u003E \\u003C\\u002Fi\\u003E\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cng-container *ngIf=\\\"!groupCollapsed[group.name]\\\"\\u003E\\u003Cdiv class=\\\"list-group-item pl-5 d-flex align-items-center\\\" *ngFor=\\\"let cmd of group.cmds\\\"\\u003E \\u003Cdiv class=\\\"mr-auto\\\"\\u003E\\u003Cdiv\\u003E{{cmd.name}}\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"text-muted\\\"\\u003E{{cmd.text}} {{cmd.appendCR ? \\\"\\\\\\\\n\\\" : \\\"\\\"}}\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cbutton class=\\\"btn btn-outline-info ml-2\\\" (click)=\\\"editCommand(cmd)\\\"\\u003E\\u003Ci class=\\\"fa fa-pencil\\\"\\u003E\\u003C\\u002Fi\\u003E\\u003C\\u002Fbutton\\u003E\\u003Cbutton class=\\\"btn btn-outline-danger ml-1\\\" (click)=\\\"deleteCommand(cmd)\\\"\\u003E\\u003Ci class=\\\"fa fa-trash-can\\\"\\u003E \\u003C\\u002Fi\\u003E\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fng-container\\u003E\\u003C\\u002Fng-container\\u003E\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","'use strict';\n\nvar pug_has_own_property = Object.prototype.hasOwnProperty;\n\n/**\n * Merge two attribute objects giving precedence\n * to values in object `b`. Classes are special-cased\n * allowing for arrays and merging/joining appropriately\n * resulting in a string.\n *\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n * @api private\n */\n\nexports.merge = pug_merge;\nfunction pug_merge(a, b) {\n if (arguments.length === 1) {\n var attrs = a[0];\n for (var i = 1; i < a.length; i++) {\n attrs = pug_merge(attrs, a[i]);\n }\n return attrs;\n }\n\n for (var key in b) {\n if (key === 'class') {\n var valA = a[key] || [];\n a[key] = (Array.isArray(valA) ? valA : [valA]).concat(b[key] || []);\n } else if (key === 'style') {\n var valA = pug_style(a[key]);\n valA = valA && valA[valA.length - 1] !== ';' ? valA + ';' : valA;\n var valB = pug_style(b[key]);\n valB = valB && valB[valB.length - 1] !== ';' ? valB + ';' : valB;\n a[key] = valA + valB;\n } else {\n a[key] = b[key];\n }\n }\n\n return a;\n}\n\n/**\n * Process array, object, or string as a string of classes delimited by a space.\n *\n * If `val` is an array, all members of it and its subarrays are counted as\n * classes. If `escaping` is an array, then whether or not the item in `val` is\n * escaped depends on the corresponding item in `escaping`. If `escaping` is\n * not an array, no escaping is done.\n *\n * If `val` is an object, all the keys whose value is truthy are counted as\n * classes. No escaping is done.\n *\n * If `val` is a string, it is counted as a class. No escaping is done.\n *\n * @param {(Array.<string>|Object.<string, boolean>|string)} val\n * @param {?Array.<string>} escaping\n * @return {String}\n */\nexports.classes = pug_classes;\nfunction pug_classes_array(val, escaping) {\n var classString = '',\n className,\n padding = '',\n escapeEnabled = Array.isArray(escaping);\n for (var i = 0; i < val.length; i++) {\n className = pug_classes(val[i]);\n if (!className) continue;\n escapeEnabled && escaping[i] && (className = pug_escape(className));\n classString = classString + padding + className;\n padding = ' ';\n }\n return classString;\n}\nfunction pug_classes_object(val) {\n var classString = '',\n padding = '';\n for (var key in val) {\n if (key && val[key] && pug_has_own_property.call(val, key)) {\n classString = classString + padding + key;\n padding = ' ';\n }\n }\n return classString;\n}\nfunction pug_classes(val, escaping) {\n if (Array.isArray(val)) {\n return pug_classes_array(val, escaping);\n } else if (val && typeof val === 'object') {\n return pug_classes_object(val);\n } else {\n return val || '';\n }\n}\n\n/**\n * Convert object or string to a string of CSS styles delimited by a semicolon.\n *\n * @param {(Object.<string, string>|string)} val\n * @return {String}\n */\n\nexports.style = pug_style;\nfunction pug_style(val) {\n if (!val) return '';\n if (typeof val === 'object') {\n var out = '';\n for (var style in val) {\n /* istanbul ignore else */\n if (pug_has_own_property.call(val, style)) {\n out = out + style + ':' + val[style] + ';';\n }\n }\n return out;\n } else {\n return val + '';\n }\n}\n\n/**\n * Render the given attribute.\n *\n * @param {String} key\n * @param {String} val\n * @param {Boolean} escaped\n * @param {Boolean} terse\n * @return {String}\n */\nexports.attr = pug_attr;\nfunction pug_attr(key, val, escaped, terse) {\n if (\n val === false ||\n val == null ||\n (!val && (key === 'class' || key === 'style'))\n ) {\n return '';\n }\n if (val === true) {\n return ' ' + (terse ? key : key + '=\"' + key + '\"');\n }\n var type = typeof val;\n if (\n (type === 'object' || type === 'function') &&\n typeof val.toJSON === 'function'\n ) {\n val = val.toJSON();\n }\n if (typeof val !== 'string') {\n val = JSON.stringify(val);\n if (!escaped && val.indexOf('\"') !== -1) {\n return ' ' + key + \"='\" + val.replace(/'/g, '&#39;') + \"'\";\n }\n }\n if (escaped) val = pug_escape(val);\n return ' ' + key + '=\"' + val + '\"';\n}\n\n/**\n * Render the given attributes object.\n *\n * @param {Object} obj\n * @param {Object} terse whether to use HTML5 terse boolean attributes\n * @return {String}\n */\nexports.attrs = pug_attrs;\nfunction pug_attrs(obj, terse) {\n var attrs = '';\n\n for (var key in obj) {\n if (pug_has_own_property.call(obj, key)) {\n var val = obj[key];\n\n if ('class' === key) {\n val = pug_classes(val);\n attrs = pug_attr(key, val, false, terse) + attrs;\n continue;\n }\n if ('style' === key) {\n val = pug_style(val);\n }\n attrs += pug_attr(key, val, false, terse);\n }\n }\n\n return attrs;\n}\n\n/**\n * Escape the given string of `html`.\n *\n * @param {String} html\n * @return {String}\n * @api private\n */\n\nvar pug_match_html = /[\"&<>]/;\nexports.escape = pug_escape;\nfunction pug_escape(_html) {\n var html = '' + _html;\n var regexResult = pug_match_html.exec(html);\n if (!regexResult) return _html;\n\n var result = '';\n var i, lastIndex, escape;\n for (i = regexResult.index, lastIndex = 0; i < html.length; i++) {\n switch (html.charCodeAt(i)) {\n case 34:\n escape = '&quot;';\n break;\n case 38:\n escape = '&amp;';\n break;\n case 60:\n escape = '&lt;';\n break;\n case 62:\n escape = '&gt;';\n break;\n default:\n continue;\n }\n if (lastIndex !== i) result += html.substring(lastIndex, i);\n lastIndex = i + 1;\n result += escape;\n }\n if (lastIndex !== i) return result + html.substring(lastIndex, i);\n else return result;\n}\n\n/**\n * Re-throw the given `err` in context to the\n * the pug in `filename` at the given `lineno`.\n *\n * @param {Error} err\n * @param {String} filename\n * @param {String} lineno\n * @param {String} str original source\n * @api private\n */\n\nexports.rethrow = pug_rethrow;\nfunction pug_rethrow(err, filename, lineno, str) {\n if (!(err instanceof Error)) throw err;\n if ((typeof window != 'undefined' || !filename) && !str) {\n err.message += ' on line ' + lineno;\n throw err;\n }\n var context, lines, start, end;\n try {\n str = str || require('fs').readFileSync(filename, {encoding: 'utf8'});\n context = 3;\n lines = str.split('\\n');\n start = Math.max(lineno - context, 0);\n end = Math.min(lines.length, lineno + context);\n } catch (ex) {\n err.message +=\n ' - could not read from ' + filename + ' (' + ex.message + ')';\n pug_rethrow(err, null, lineno);\n return;\n }\n\n // Error context\n context = lines\n .slice(start, end)\n .map(function(line, i) {\n var curr = i + start + 1;\n return (curr == lineno ? ' > ' : ' ') + curr + '| ' + line;\n })\n .join('\\n');\n\n // Alter exception message\n err.path = filename;\n try {\n err.message =\n (filename || 'Pug') +\n ':' +\n lineno +\n '\\n' +\n context +\n '\\n\\n' +\n err.message;\n } catch (e) {}\n throw err;\n}\n","module.exports = \"<svg version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" x=\\\"0px\\\" y=\\\"0px\\\" viewBox=\\\"0 0 1000 1000\\\" enable-background=\\\"new 0 0 1000 1000\\\" xml:space=\\\"preserve\\\"><metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata><g><path d=\\\"M286.1,422.2h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C315.5,409,302.3,422.2,286.1,422.2z\\\"></path><path d=\\\"M455.2,422.2h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C484.6,409,471.3,422.2,455.2,422.2z\\\"></path><path d=\\\"M624.2,422.2h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C653.6,409,640.4,422.2,624.2,422.2z\\\"></path><path d=\\\"M793.2,422.2h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C822.6,409,809.4,422.2,793.2,422.2z\\\"></path><path d=\\\"M305,573.6h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4H305c16.2,0,29.4,13.2,29.4,29.4v54.4C334.4,560.4,321.2,573.6,305,573.6z\\\"></path><path d=\\\"M461.5,573.6h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C490.9,560.4,477.6,573.6,461.5,573.6z\\\"></path><path d=\\\"M617.9,573.6h-79.4c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C647.3,560.4,634.1,573.6,617.9,573.6z\\\"></path><path d=\\\"M774.4,573.6H695c-16.2,0-29.4-13.2-29.4-29.4v-54.4c0-16.2,13.2-29.4,29.4-29.4h79.4c16.2,0,29.4,13.2,29.4,29.4v54.4C803.8,560.4,790.6,573.6,774.4,573.6z\\\"></path><path d=\\\"M741.1,732.1H258.9c-16.2,0-29.4-13.2-29.4-29.4v-35.3c0-16.2,13.2-29.4,29.4-29.4h482.2c16.2,0,29.4,13.2,29.4,29.4v35.3C770.5,718.9,757.3,732.1,741.1,732.1z\\\"></path><path d=\\\"M500,39.4c62.2,0,122.5,12.2,179.3,36.2c54.8,23.2,104.1,56.4,146.4,98.7s75.5,91.6,98.7,146.4c24,56.8,36.2,117.1,36.2,179.3c0,62.2-12.2,122.5-36.2,179.3c-23.2,54.8-56.4,104.1-98.7,146.4s-91.6,75.5-146.4,98.7c-56.8,24-117.1,36.2-179.3,36.2c-62.2,0-122.5-12.2-179.3-36.2c-54.8-23.2-104.1-56.4-146.4-98.7s-75.5-91.6-98.7-146.4c-24-56.8-36.2-117.1-36.2-179.3c0-62.2,12.2-122.5,36.2-179.3c23.2-54.8,56.4-104.1,98.7-146.4s91.6-75.5,146.4-98.7C377.5,51.6,437.8,39.4,500,39.4 M500,10C229.4,10,10,229.4,10,500s219.4,490,490,490c270.6,0,490-219.4,490-490S770.6,10,500,10L500,10z\\\"></path></g></svg>\"","import { Injectable } from '@angular/core'\nimport { HotkeysService, ToolbarButtonProvider, IToolbarButton, ConfigService, AppService, BaseTabComponent, SplitTabComponent } from 'tabby-core'\nimport { BaseTerminalTabComponent } from 'tabby-terminal';\nimport { QuickCmds } from './api'\n\n@Injectable()\nexport class QuickCmdButtonProvider extends ToolbarButtonProvider {\n PLUGIN_NAME = \"Quick Cmd\"\n\n constructor (\n private hotkeys: HotkeysService,\n private config: ConfigService,\n private app: AppService,\n ) {\n super()\n\n this.config.ready$.toPromise().then(() => {\n this.reload_hotkey()\n })\n // Listen for hotkey matches\n this.hotkeys.hotkey$.subscribe(async (hotkey_id) => {\n await this.executeCommandByShortcut(hotkey_id)\n })\n }\n\n async executeCommandByShortcut(hotkey_id: string) {\n const commands = this.config.store.qc.cmds\n const matchedCommand = commands.find(cmd => cmd.id === hotkey_id)\n // console.log(\"[quick-cmd] hotkey_id:\", hotkey_id)\n // console.log(\"[quick-cmd] commands:\", commands)\n // console.log(\"[quick-cmd] match:\", matchedCommand)\n\n if (matchedCommand) {\n await this._send(this.app.activeTab, matchedCommand)\n }\n }\n\n async _send (tab: BaseTabComponent, quick_cmd: QuickCmds) {\n if (tab instanceof SplitTabComponent) {\n return this._send((tab as SplitTabComponent).getFocusedTab(), quick_cmd)\n }\n if (tab instanceof BaseTerminalTabComponent) {\n let cmd = quick_cmd.text\n\n if (cmd.startsWith('\\\\x')) {\n cmd = cmd.replace(/\\\\x([0-9a-f]{2})/ig, function(_, pair) { return String.fromCharCode(parseInt(pair, 16)) })\n }\n\n let currentTab = tab as BaseTerminalTabComponent<any>\n await currentTab.sendInput(cmd)\n return true\n }\n return false\n }\n\n reload_hotkey () {\n console.log(\"[Quick Cmd] reload hotkeys\")\n\n // Cleanup Quick Cmd hotkeys\n for (const key of Object.keys(this.config.store.hotkeys)) {\n if (key.startsWith(this.PLUGIN_NAME)) {\n delete this.config.store.hotkeys[key]\n }\n }\n // Add new Quick Cmd hotkeys\n let hotkey_id: string\n for (let cmd of this.config.store.qc.cmds) {\n hotkey_id = this.PLUGIN_NAME + \":\" + cmd.name\n this.config.store.hotkeys[hotkey_id] = [cmd.shortcut.replace(/\\+/g, '-')]\n cmd.id = hotkey_id\n }\n }\n\n provide (): IToolbarButton[] {\n return [{\n icon: require('./icons/keyboard.svg'),\n weight: 5,\n title: 'Quick commands',\n touchBarNSImage: 'NSTouchBarComposeTemplate',\n }]\n }\n}\n","import { Component, HostListener } from '@angular/core'\nimport { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'\nimport { QuickCmds } from '../api'\nimport { getKeyName } from \"../hotkeys.util\"\nimport { altKeyName, metaKeyName, KeyEventData } from \"tabby-core\"\n\n@Component({\n template: require('./editCommandModal.component.pug'),\n})\nexport class EditCommandModalComponent {\n allGroups: string[] = []\n command: QuickCmds\n isCapturingShortcut: boolean = false\n\n constructor (\n private modalInstance: NgbActiveModal,\n ) {\n }\n\n @HostListener('document:keydown', ['$event'])\n onKeyDown(event: KeyboardEvent) {\n /*\n UI输入框监听设置快捷键\n */\n if (this.isCapturingShortcut) {\n event.preventDefault()\n event.stopPropagation()\n\n const eventData: KeyEventData = {\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n shiftKey: event.shiftKey,\n code: event.code,\n key: event.key,\n eventName: \"keydown\",\n time: event.timeStamp,\n registrationTime: performance.now(),\n }\n const keyName = getKeyName(eventData)\n\n // Handle ESC key to cancel capture without changes\n if (keyName === 'Escape') {\n this.isCapturingShortcut = false\n return\n }\n\n // Handle Delete or Backspace to clear the shortcut\n if (keyName === 'Delete' || keyName === 'Backspace') {\n this.command.shortcut = ''\n this.isCapturingShortcut = false\n return\n }\n\n const modifiers: string[] = []\n\n if (eventData.ctrlKey) {\n modifiers.push('Ctrl')\n }\n if (eventData.metaKey) {\n modifiers.push(metaKeyName)\n }\n if (eventData.altKey) {\n modifiers.push(altKeyName)\n }\n if (eventData.shiftKey) {\n modifiers.push('Shift')\n }\n\n // Sort modifiers to ensure consistent ordering\n modifiers.sort()\n\n // Add modifiers to shortcut string\n let shortcut = ''\n if (modifiers.length > 0) {\n shortcut = modifiers.join('+') + '+'\n }\n\n // Only process if we have a valid main key (not just modifiers)\n // console.log(\"222 eventData.ctrlKey\", eventData.ctrlKey)\n // console.log(\"222 eventData.metaKey\", eventData.metaKey)\n // console.log(\"222 eventData.shiftKey\", eventData.shiftKey)\n // console.log(\"222 eventData.altKey\", eventData.altKey)\n // console.log(\"222 eventData.key\", eventData.key)\n // console.log(\"222 keyName\", keyName)\n // console.log(\"222 altKeyName\", altKeyName)\n if (!['Control', altKeyName, 'Shift', metaKeyName].includes(keyName)) {\n shortcut += keyName\n this.command.shortcut = shortcut\n this.isCapturingShortcut = false\n }\n }\n }\n\n startCaptureShortcut(event: Event) {\n event.preventDefault()\n this.isCapturingShortcut = true\n }\n\n save () {\n this.modalInstance.close(this.command)\n }\n\n cancel () {\n this.modalInstance.dismiss()\n }\n}\n","import { Component, Input, ViewChild, ElementRef } from '@angular/core'\nimport { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'\n\n@Component({\n template: require('./promptModal.component.pug'),\n})\nexport class PromptModalComponent {\n @Input() value: string\n @Input() password: boolean\n @ViewChild('input') input: ElementRef\n\n constructor (\n private modalInstance: NgbActiveModal,\n ) { }\n\n ngOnInit () {\n this.input.nativeElement.focus()\n }\n\n ok () {\n this.modalInstance.close(this.value)\n }\n\n cancel () {\n this.modalInstance.close('')\n }\n}\n","import { Component, Inject } from '@angular/core'\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap'\nimport { ConfigService, ToolbarButtonProvider } from 'tabby-core'\nimport { QuickCmds, ICmdGroup } from '../api'\nimport { EditCommandModalComponent } from './editCommandModal.component'\nimport { PromptModalComponent } from './promptModal.component'\nimport { QuickCmdButtonProvider } from \"../button\";\n\n@Component({\n template: require('./quickCmdsSettingsTab.component.pug'),\n})\nexport class QuickCmdsSettingsTabComponent {\n quickCmd: string\n commands: QuickCmds[]\n childGroups: ICmdGroup[]\n groupCollapsed: {[id: string]: boolean} = {}\n\n constructor (\n public config: ConfigService,\n private ngbModal: NgbModal,\n @Inject(ToolbarButtonProvider)\n private buttonProviders: ToolbarButtonProvider[],\n ) {\n this.commands = this.config.store.qc.cmds\n this.refresh()\n }\n\n private get_button (): QuickCmdButtonProvider | undefined {\n return this.buttonProviders.find(p => p instanceof QuickCmdButtonProvider) as QuickCmdButtonProvider\n }\n\n createCommand () {\n let command: QuickCmds = {\n id: '',\n name: '',\n text: '',\n appendCR: false,\n }\n\n let modal = this.ngbModal.open(EditCommandModalComponent)\n modal.componentInstance.command = command\n modal.componentInstance.allGroups = Array.from(new Set(this.commands.map(x => x.group || ''))).filter(x => x)\n\n modal.result.then(result => {\n /*\n // 从UI新建 QuickCmds: name, shortcut, text, group\n export interface QuickCmds {\n name: string\n text: string\n appendCR: boolean\n group?: string\n shortcut?: string\n }\n */\n this.commands.push(result)\n this.config.store.qc.cmds = this.commands\n this.config.save()\n this.refresh()\n })\n }\n\n editCommand (command: QuickCmds) {\n let modal = this.ngbModal.open(EditCommandModalComponent)\n // Ensure command.group is an empty string if it's null or undefined\n modal.componentInstance.command = { ...command, group: command.group || 'Ungrouped' }\n modal.componentInstance.allGroups = Array.from(new Set(this.commands.map(x => x.group || ''))).filter(x => x)\n modal.result.then(result => {\n // If the group is 'Ungrouped', set it to null\n if (result.group === 'Ungrouped') {\n result.group = null\n }\n /*\n // 从UI修改 QuickCmds: name, shortcut, text, group\n export interface QuickCmds {\n name: string\n text: string\n appendCR: boolean\n group?: string\n shortcut?: string\n }\n */\n Object.assign(command, result)\n this.config.save()\n this.refresh()\n })\n }\n\n deleteCommand (command: QuickCmds) {\n if (confirm(`Delete \"${command.name}\"?`)) {\n this.commands = this.commands.filter(x => x !== command)\n this.config.store.qc.cmds = this.commands\n this.config.save()\n this.refresh()\n }\n }\n\n editGroup (group: ICmdGroup) {\n let modal = this.ngbModal.open(PromptModalComponent)\n modal.componentInstance.prompt = 'New group name'\n modal.componentInstance.value = group.name\n modal.result.then(result => {\n if (result) {\n for (let connection of this.commands.filter(x => x.group === group.name)) {\n connection.group = result\n }\n this.config.save()\n this.refresh()\n }\n })\n }\n\n deleteGroup (group: ICmdGroup) {\n if (confirm(`Delete \"${group}\"?`)) {\n for (let command of this.commands.filter(x => x.group === group.name)) {\n command.group = null\n }\n this.config.save()\n this.refresh()\n }\n }\n\n cancelFilter(){\n this.quickCmd=''\n this.refresh()\n }\n\n refresh () {\n this.childGroups = []\n\n let cmds = this.commands\n if (this.quickCmd) {\n cmds = cmds.filter(cmd => (cmd.name + cmd.group + cmd.text).toLowerCase().includes(this.quickCmd))\n }\n\n for (let cmd of cmds) {\n cmd.group = cmd.group || null\n let group = this.childGroups.find(x => x.name === cmd.group)\n if (!group) {\n group = {\n name: cmd.group,\n cmds: [],\n }\n this.childGroups.push(group)\n }\n group.cmds.push(cmd)\n }\n this.get_button()?.reload_hotkey()\n }\n\n}\n","import { ConfigProvider } from 'tabby-core'\nimport {QuickCmds} from \"./api\";\n\nexport class QuickCmdsConfigProvider extends ConfigProvider {\n defaults = {\n qc: {\n cmds: [] as QuickCmds[],\n },\n hotkeys: {},\n }\n\n platformDefaults = { }\n}\n","import { altKeyName, metaKeyName } from \"tabby-core\"\nexport { altKeyName, metaKeyName }\n\nexport interface KeyEventData {\n ctrlKey?: boolean\n metaKey?: boolean\n altKey?: boolean\n shiftKey?: boolean\n key: string\n code: string\n eventName: string\n time: number\n registrationTime: number\n}\n\nconst REGEX_LATIN_KEYNAME = /^[A-Za-z]$/\n\nexport type KeyName = string\nexport type Keystroke = string\n\nexport function getKeyName (event: KeyEventData): KeyName {\n // eslint-disable-next-line @typescript-eslint/init-declarations\n let key: string\n if (event.key === 'Control') {\n key = 'Ctrl'\n } else if (event.key === 'Meta') {\n key = metaKeyName\n } else if (event.key === 'Alt') {\n key = altKeyName\n } else if (event.key === 'Shift') {\n key = 'Shift'\n } else if (event.key === '`') {\n key = '`'\n } else if (event.key === '~') {\n key = '~'\n } else {\n key = event.code\n if (REGEX_LATIN_KEYNAME.test(event.key)) {\n // Handle Dvorak etc via the reported \"character\" instead of the scancode\n key = event.key.toUpperCase()\n } else {\n key = key.replace('Key', '')\n key = key.replace('Arrow', '')\n key = key.replace('Digit', '')\n key = {\n Comma: ',',\n Period: '.',\n Slash: '/',\n Backslash: '\\\\',\n IntlBackslash: '`',\n Minus: '-',\n Equal: '=',\n Semicolon: ';',\n Quote: '\\'',\n BracketLeft: '[',\n BracketRight: ']',\n }[key] ?? key\n }\n }\n return key\n}\n\nexport function getKeystrokeName (keys: KeyName[]): Keystroke {\n const strictOrdering: KeyName[] = ['Ctrl', metaKeyName, altKeyName, 'Shift']\n keys = [\n ...strictOrdering.map(x => keys.find(k => k === x)).filter(x => !!x) as KeyName[],\n ...keys.filter(k => !strictOrdering.includes(k)),\n ]\n return keys.join('-')\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { FormsModule } from '@angular/forms'\nimport { NgbModule } from '@ng-bootstrap/ng-bootstrap'\nimport { ToolbarButtonProvider, ConfigProvider } from 'tabby-core'\nimport TabbyCoreModule from 'tabby-core'\nimport { SettingsTabProvider } from 'tabby-settings'\n\nimport { EditCommandModalComponent } from './components/editCommandModal.component'\nimport { QuickCmdsSettingsTabComponent } from './components/quickCmdsSettingsTab.component'\nimport { PromptModalComponent } from './components/promptModal.component'\n\nimport { QuickCmdButtonProvider } from './button'\nimport { QuickCmdsConfigProvider } from './config'\nimport { QuickCmdsSettingsTabProvider } from './settings'\n\n@NgModule({\n imports: [\n NgbModule,\n CommonModule,\n FormsModule,\n TabbyCoreModule,\n ],\n providers: [\n { provide: ToolbarButtonProvider, useClass: QuickCmdButtonProvider, multi: true },\n { provide: ConfigProvider, useClass: QuickCmdsConfigProvider, multi: true },\n { provide: SettingsTabProvider, useClass: QuickCmdsSettingsTabProvider, multi: true },\n ],\n declarations: [\n PromptModalComponent,\n EditCommandModalComponent,\n QuickCmdsSettingsTabComponent,\n ],\n})\nexport default class QuickCmdsModule { }\n","import { Injectable } from '@angular/core'\nimport { SettingsTabProvider } from 'tabby-settings'\n\nimport { QuickCmdsSettingsTabComponent } from './components/quickCmdsSettingsTab.component'\n\n@Injectable()\nexport class QuickCmdsSettingsTabProvider extends SettingsTabProvider {\n id = 'qc'\n title = 'Quick Commands'\n\n getComponentType (): any {\n return QuickCmdsSettingsTabComponent\n }\n}\n","module.exports = require(\"fs\");","module.exports = __WEBPACK_EXTERNAL_MODULE__848__;","module.exports = __WEBPACK_EXTERNAL_MODULE__900__;","module.exports = __WEBPACK_EXTERNAL_MODULE__161__;","module.exports = __WEBPACK_EXTERNAL_MODULE__571__;","module.exports = __WEBPACK_EXTERNAL_MODULE__315__;","module.exports = __WEBPACK_EXTERNAL_MODULE__663__;","module.exports = __WEBPACK_EXTERNAL_MODULE__316__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(607);\n"],"names":["root","factory","exports","module","require","define","amd","a","i","global","__WEBPACK_EXTERNAL_MODULE__848__","__WEBPACK_EXTERNAL_MODULE__900__","__WEBPACK_EXTERNAL_MODULE__161__","__WEBPACK_EXTERNAL_MODULE__571__","__WEBPACK_EXTERNAL_MODULE__315__","__WEBPACK_EXTERNAL_MODULE__663__","__WEBPACK_EXTERNAL_MODULE__316__","req","apply","locals","pug_html","locals_for_with","isCapturingShortcut","call","this","undefined","pug_has_own_property","Object","prototype","hasOwnProperty","pug_classes","val","escaping","Array","isArray","className","classString","padding","escapeEnabled","length","pug_escape","pug_classes_array","key","pug_classes_object","pug_style","out","style","pug_attr","escaped","terse","type","toJSON","JSON","stringify","indexOf","replace","merge","pug_merge","b","arguments","attrs","valA","concat","valB","classes","attr","obj","pug_match_html","_html","html","regexResult","exec","lastIndex","escape","result","index","charCodeAt","substring","rethrow","pug_rethrow","err","filename","lineno","str","Error","window","message","context","lines","start","end","encoding","split","Math","max","min","ex","slice","map","line","curr","join","path","e","QuickCmdButtonProvider","ToolbarButtonProvider","constructor","hotkeys","config","app","super","PLUGIN_NAME","ready$","toPromise","then","reload_hotkey","hotkey$","subscribe","hotkey_id","executeCommandByShortcut","matchedCommand","store","qc","cmds","find","cmd","id","_send","activeTab","tab","quick_cmd","SplitTabComponent","getFocusedTab","BaseTerminalTabComponent","text","startsWith","_","pair","String","fromCharCode","parseInt","currentTab","sendInput","console","log","keys","name","shortcut","provide","icon","weight","title","touchBarNSImage","Injectable","HotkeysService","ConfigService","AppService","EditCommandModalComponent","modalInstance","allGroups","onKeyDown","event","preventDefault","stopPropagation","eventData","ctrlKey","metaKey","altKey","shiftKey","code","eventName","time","timeStamp","registrationTime","performance","now","keyName","getKeyName","command","modifiers","push","metaKeyName","altKeyName","sort","includes","startCaptureShortcut","save","close","cancel","dismiss","HostListener","KeyboardEvent","Component","template","NgbActiveModal","PromptModalComponent","ngOnInit","input","nativeElement","focus","ok","value","Input","ViewChild","ElementRef","QuickCmdsSettingsTabComponent","ngbModal","buttonProviders","groupCollapsed","commands","refresh","get_button","p","createCommand","modal","open","componentInstance","appendCR","from","Set","x","group","filter","editCommand","assign","deleteCommand","confirm","editGroup","prompt","connection","deleteGroup","cancelFilter","quickCmd","childGroups","toLowerCase","Inject","NgbModal","QuickCmdsConfigProvider","ConfigProvider","defaults","platformDefaults","REGEX_LATIN_KEYNAME","test","toUpperCase","Comma","Period","Slash","Backslash","IntlBackslash","Minus","Equal","Semicolon","Quote","BracketLeft","BracketRight","strictOrdering","k","QuickCmdsModule","NgModule","imports","NgbModule","CommonModule","FormsModule","providers","useClass","multi","SettingsTabProvider","QuickCmdsSettingsTabProvider","declarations","getComponentType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__"],"sourceRoot":""}
@@ -0,0 +1,17 @@
1
+ import { altKeyName, metaKeyName } from "tabby-core";
2
+ export { altKeyName, metaKeyName };
3
+ export interface KeyEventData {
4
+ ctrlKey?: boolean;
5
+ metaKey?: boolean;
6
+ altKey?: boolean;
7
+ shiftKey?: boolean;
8
+ key: string;
9
+ code: string;
10
+ eventName: string;
11
+ time: number;
12
+ registrationTime: number;
13
+ }
14
+ export declare type KeyName = string;
15
+ export declare type Keystroke = string;
16
+ export declare function getKeyName(event: KeyEventData): KeyName;
17
+ export declare function getKeystrokeName(keys: KeyName[]): Keystroke;
@@ -0,0 +1,6 @@
1
+ import { SettingsTabProvider } from 'tabby-settings';
2
+ export declare class QuickCmdsSettingsTabProvider extends SettingsTabProvider {
3
+ id: string;
4
+ title: string;
5
+ getComponentType(): any;
6
+ }
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@zeroleo12345/tabby-send-input",
3
+ "version": "0.0.3",
4
+ "description": "hotkey plugin for Tabby",
5
+ "keywords": [
6
+ "@zeroleo12345/tabby-plugin"
7
+ ],
8
+ "main": "dist/index.js",
9
+ "typings": "dist/index.d.ts",
10
+ "scripts": {
11
+ "build": "webpack --progress --color",
12
+ "watch": "webpack --progress --color --watch",
13
+ "prepublishOnly": "npm run build"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "author": "minyoad",
19
+ "license": "MIT",
20
+ "devDependencies": {
21
+ "@types/webpack-env": "^1.16.3",
22
+ "apply-loader": "^2.0.0",
23
+ "awesome-typescript-loader": "^5.2.1",
24
+ "css-loader": "^6.7.1",
25
+ "electron": "^18.0.3",
26
+ "pug": "^3.0.2",
27
+ "pug-loader": "^2.4.0",
28
+ "sass": "^1.69.5",
29
+ "sass-loader": "^13.3.2",
30
+ "svg-inline-loader": "^0.8.2",
31
+ "to-string-loader": "^1.2.0",
32
+ "typescript": "^4.6.3",
33
+ "webpack": "^5.72.0",
34
+ "webpack-cli": "^4.9.2"
35
+ },
36
+ "peerDependencies": {
37
+ "@angular/common": "^4.1.3",
38
+ "@angular/core": "^4.1.3",
39
+ "@angular/forms": "^4.1.3",
40
+ "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.29",
41
+ "tabby-core": "*",
42
+ "tabby-settings": "*",
43
+ "tabby-terminal": "*"
44
+ },
45
+ "dependencies": {
46
+ "@angular/common": "^13.3.2",
47
+ "@angular/core": "^13.3.2",
48
+ "@angular/forms": "^13.3.2",
49
+ "@ng-bootstrap/ng-bootstrap": "^12.0.2",
50
+ "rxjs": "^7.5.5",
51
+ "tabby-core": "^1.0.197-nightly.1",
52
+ "tabby-settings": "^1.0.197-nightly.1",
53
+ "tabby-terminal": "^1.0.197-nightly.1",
54
+ "ts-loader": "^9.2.8"
55
+ },
56
+ "engines": {
57
+ "node": ">=14.0.0 <19.0.0"
58
+ }
59
+ }