update eaf package
This commit is contained in:
19
lisp/emacs-application-framework/app/terminal/node_modules/xterm-addon-attach/LICENSE
generated
vendored
19
lisp/emacs-application-framework/app/terminal/node_modules/xterm-addon-attach/LICENSE
generated
vendored
@@ -1,19 +0,0 @@
|
||||
Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
22
lisp/emacs-application-framework/app/terminal/node_modules/xterm-addon-attach/README.md
generated
vendored
22
lisp/emacs-application-framework/app/terminal/node_modules/xterm-addon-attach/README.md
generated
vendored
@@ -1,22 +0,0 @@
|
||||
## xterm-addon-attach
|
||||
|
||||
An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables attaching to a web socket. This addon requires xterm.js v4+.
|
||||
|
||||
### Install
|
||||
|
||||
```bash
|
||||
npm install --save xterm-addon-attach
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
```ts
|
||||
import { Terminal } from 'xterm';
|
||||
import { AttachAddon } from 'xterm-addon-attach';
|
||||
|
||||
const terminal = new Terminal();
|
||||
const attachAddon = new AttachAddon(webSocket);
|
||||
terminal.loadAddon(attachAddon);
|
||||
```
|
||||
|
||||
See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-attach/typings/xterm-addon-attach.d.ts) for more advanced usage.
|
||||
@@ -1,2 +0,0 @@
|
||||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AttachAddon=e():t.AttachAddon=e()}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){this._disposables=[],this._socket=t,this._socket.binaryType="arraybuffer",this._bidirectional=!e||!1!==e.bidirectional}return t.prototype.activate=function(t){var e=this;this._disposables.push(r(this._socket,"message",function(e){var n=e.data;t.write("string"==typeof n?n:new Uint8Array(n))})),this._bidirectional&&(this._disposables.push(t.onData(function(t){return e._sendData(t)})),this._disposables.push(t.onBinary(function(t){return e._sendBinary(t)}))),this._disposables.push(r(this._socket,"close",function(){return e.dispose()})),this._disposables.push(r(this._socket,"error",function(){return e.dispose()}))},t.prototype.dispose=function(){this._disposables.forEach(function(t){return t.dispose()})},t.prototype._sendData=function(t){1===this._socket.readyState&&this._socket.send(t)},t.prototype._sendBinary=function(t){if(1===this._socket.readyState){for(var e=new Uint8Array(t.length),n=0;n<t.length;++n)e[n]=255&t.charCodeAt(n);this._socket.send(e)}},t}();function r(t,e,n){return t.addEventListener(e,n),{dispose:function(){n&&t.removeEventListener(e,n)}}}e.AttachAddon=o}])});
|
||||
//# sourceMappingURL=xterm-addon-attach.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"AttachAddon.api.js","sourceRoot":"","sources":["../src/AttachAddon.api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,qCAAuC;AAGvC,8BAAiC;AAEjC,IAAM,GAAG,GAAG,4BAA4B,CAAC;AAEzC,IAAI,OAA0B,CAAC;AAC/B,IAAI,IAAoB,CAAC;AACzB,IAAM,KAAK,GAAG,GAAG,CAAC;AAClB,IAAM,MAAM,GAAG,GAAG,CAAC;AAEnB,QAAQ,CAAC,aAAa,EAAE;IACtB,MAAM,CAAC;;;;;wBACL,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;wBACV,WAAM,SAAS,CAAC,MAAM,CAAC;gCAC/B,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gCACnD,IAAI,EAAE,CAAC,mBAAiB,KAAK,SAAI,MAAQ,EAAE,cAAc,CAAC;6BAC3D,CAAC,EAAA;;wBAHF,OAAO,GAAG,SAGR,CAAC;wBACK,WAAM,OAAO,CAAC,KAAK,EAAE,EAAA;;wBAA7B,IAAI,GAAG,CAAC,SAAqB,CAA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;;wBAChD,WAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;oBAAhC,MAAM,GAAG,SAAuB;oBACtC,IAAI,MAAM,KAAK,GAAG,EAAE;wBAClB,WAAO,IAAI,OAAO,CAAO,UAAA,CAAC;gCACxB,UAAU,CAAC,cAAM,OAAA,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAzB,CAAyB,EAAE,EAAE,CAAC,CAAC;4BAClD,CAAC,CAAC,EAAC;qBACJ;;;;;CACF"}
|
||||
@@ -1,56 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var AttachAddon = (function () {
|
||||
function AttachAddon(socket, options) {
|
||||
this._disposables = [];
|
||||
this._socket = socket;
|
||||
this._socket.binaryType = 'arraybuffer';
|
||||
this._bidirectional = (options && options.bidirectional === false) ? false : true;
|
||||
}
|
||||
AttachAddon.prototype.activate = function (terminal) {
|
||||
var _this = this;
|
||||
this._disposables.push(addSocketListener(this._socket, 'message', function (ev) {
|
||||
var data = ev.data;
|
||||
terminal.write(typeof data === 'string' ? data : new Uint8Array(data));
|
||||
}));
|
||||
if (this._bidirectional) {
|
||||
this._disposables.push(terminal.onData(function (data) { return _this._sendData(data); }));
|
||||
this._disposables.push(terminal.onBinary(function (data) { return _this._sendBinary(data); }));
|
||||
}
|
||||
this._disposables.push(addSocketListener(this._socket, 'close', function () { return _this.dispose(); }));
|
||||
this._disposables.push(addSocketListener(this._socket, 'error', function () { return _this.dispose(); }));
|
||||
};
|
||||
AttachAddon.prototype.dispose = function () {
|
||||
this._disposables.forEach(function (d) { return d.dispose(); });
|
||||
};
|
||||
AttachAddon.prototype._sendData = function (data) {
|
||||
if (this._socket.readyState !== 1) {
|
||||
return;
|
||||
}
|
||||
this._socket.send(data);
|
||||
};
|
||||
AttachAddon.prototype._sendBinary = function (data) {
|
||||
if (this._socket.readyState !== 1) {
|
||||
return;
|
||||
}
|
||||
var buffer = new Uint8Array(data.length);
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
buffer[i] = data.charCodeAt(i) & 255;
|
||||
}
|
||||
this._socket.send(buffer);
|
||||
};
|
||||
return AttachAddon;
|
||||
}());
|
||||
exports.AttachAddon = AttachAddon;
|
||||
function addSocketListener(socket, type, handler) {
|
||||
socket.addEventListener(type, handler);
|
||||
return {
|
||||
dispose: function () {
|
||||
if (!handler) {
|
||||
return;
|
||||
}
|
||||
socket.removeEventListener(type, handler);
|
||||
}
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=AttachAddon.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"AttachAddon.js","sourceRoot":"","sources":["../src/AttachAddon.ts"],"names":[],"mappings":";;AAaA;IAKE,qBAAY,MAAiB,EAAE,OAAwB;QAF/C,iBAAY,GAAkB,EAAE,CAAC;QAGvC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC;QACxC,IAAI,CAAC,cAAc,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACpF,CAAC;IAEM,8BAAQ,GAAf,UAAgB,QAAkB;QAAlC,iBAeC;QAdC,IAAI,CAAC,YAAY,CAAC,IAAI,CACpB,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,UAAA,EAAE;YAC3C,IAAM,IAAI,GAAyB,EAAE,CAAC,IAAI,CAAC;YAC3C,QAAQ,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QACzE,CAAC,CAAC,CACH,CAAC;QAEF,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,YAAY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AAC,EAAE;YACpC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;SACtC;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IACH,kBAAC;AAAD,CAAC,AApDD,IAoDC;AApDY,kCAAW;AAsDxB,SAAS,iBAAiB,CAAoC,MAAiB,EAAE,IAAO,EAAE,OAA2D;IACnJ,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACvC,OAAO;QACL,OAAO,EAAE;YACP,IAAI,CAAC,OAAO,EAAE;gBAEZ,OAAO;aACR;YACD,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "xterm-addon-attach",
|
||||
"version": "0.5.0",
|
||||
"author": {
|
||||
"name": "The xterm.js authors",
|
||||
"url": "https://xtermjs.org/"
|
||||
},
|
||||
"main": "lib/xterm-addon-attach.js",
|
||||
"types": "typings/xterm-addon-attach.d.ts",
|
||||
"repository": "https://github.com/xtermjs/xterm.js",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "../../node_modules/.bin/tsc -p src",
|
||||
"prepackage": "npm run build",
|
||||
"package": "../../node_modules/.bin/webpack",
|
||||
"prepublishOnly": "npm run package"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"xterm": "^4.0.0"
|
||||
},
|
||||
"__npminstall_done": "Sun Apr 05 2020 17:05:40 GMT+0800 (中国标准时间)",
|
||||
"_from": "xterm-addon-attach@0.5.0",
|
||||
"_resolved": "https://registry.npm.taobao.org/xterm-addon-attach/download/xterm-addon-attach-0.5.0.tgz"
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2014, 2019 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*
|
||||
* Implements the attach method, that attaches the terminal to a WebSocket stream.
|
||||
*/
|
||||
|
||||
import { Terminal, IDisposable, ITerminalAddon } from 'xterm';
|
||||
|
||||
interface IAttachOptions {
|
||||
bidirectional?: boolean;
|
||||
}
|
||||
|
||||
export class AttachAddon implements ITerminalAddon {
|
||||
private _socket: WebSocket;
|
||||
private _bidirectional: boolean;
|
||||
private _disposables: IDisposable[] = [];
|
||||
|
||||
constructor(socket: WebSocket, options?: IAttachOptions) {
|
||||
this._socket = socket;
|
||||
// always set binary type to arraybuffer, we do not handle blobs
|
||||
this._socket.binaryType = 'arraybuffer';
|
||||
this._bidirectional = (options && options.bidirectional === false) ? false : true;
|
||||
}
|
||||
|
||||
public activate(terminal: Terminal): void {
|
||||
this._disposables.push(
|
||||
addSocketListener(this._socket, 'message', ev => {
|
||||
const data: ArrayBuffer | string = ev.data;
|
||||
terminal.write(typeof data === 'string' ? data : new Uint8Array(data));
|
||||
})
|
||||
);
|
||||
|
||||
if (this._bidirectional) {
|
||||
this._disposables.push(terminal.onData(data => this._sendData(data)));
|
||||
this._disposables.push(terminal.onBinary(data => this._sendBinary(data)));
|
||||
}
|
||||
|
||||
this._disposables.push(addSocketListener(this._socket, 'close', () => this.dispose()));
|
||||
this._disposables.push(addSocketListener(this._socket, 'error', () => this.dispose()));
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._disposables.forEach(d => d.dispose());
|
||||
}
|
||||
|
||||
private _sendData(data: string): void {
|
||||
// TODO: do something better than just swallowing
|
||||
// the data if the socket is not in a working condition
|
||||
if (this._socket.readyState !== 1) {
|
||||
return;
|
||||
}
|
||||
this._socket.send(data);
|
||||
}
|
||||
|
||||
private _sendBinary(data: string): void {
|
||||
if (this._socket.readyState !== 1) {
|
||||
return;
|
||||
}
|
||||
const buffer = new Uint8Array(data.length);
|
||||
for (let i = 0; i < data.length; ++i) {
|
||||
buffer[i] = data.charCodeAt(i) & 255;
|
||||
}
|
||||
this._socket.send(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
function addSocketListener<K extends keyof WebSocketEventMap>(socket: WebSocket, type: K, handler: (this: WebSocket, ev: WebSocketEventMap[K]) => any): IDisposable {
|
||||
socket.addEventListener(type, handler);
|
||||
return {
|
||||
dispose: () => {
|
||||
if (!handler) {
|
||||
// Already disposed
|
||||
return;
|
||||
}
|
||||
socket.removeEventListener(type, handler);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { Terminal, ILinkMatcherOptions, ITerminalAddon } from 'xterm';
|
||||
|
||||
declare module 'xterm-addon-attach' {
|
||||
export interface IAttachOptions {
|
||||
/**
|
||||
* Whether input should be written to the backend. Defaults to `true`.
|
||||
*/
|
||||
bidirectional?: boolean;
|
||||
}
|
||||
|
||||
export class AttachAddon implements ITerminalAddon {
|
||||
constructor(socket: WebSocket, options?: IAttachOptions);
|
||||
public activate(terminal: Terminal): void;
|
||||
public dispose(): void;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user