@xterm/addon-attach 0.12.0-beta.53 → 0.12.0-beta.55

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.
@@ -15,4 +15,4 @@
15
15
  * Licensed under the MIT License. See License.txt in the project root for license information.
16
16
  *--------------------------------------------------------------------------------------------*/
17
17
  var r=class{constructor(e,t){this._disposables=[];this._socket=e,this._socket.binaryType="arraybuffer",this._bidirectional=!(t&&t.bidirectional===!1)}activate(e){this._disposables.push(o(this._socket,"message",t=>{let s=t.data;e.write(typeof s=="string"?s:new Uint8Array(s))})),this._bidirectional&&(this._disposables.push(e.onData(t=>this._sendData(t))),this._disposables.push(e.onBinary(t=>this._sendBinary(t)))),this._disposables.push(o(this._socket,"close",()=>this.dispose())),this._disposables.push(o(this._socket,"error",()=>this.dispose()))}dispose(){for(let e of this._disposables)e.dispose()}_sendData(e){this._checkOpenSocket()&&this._socket.send(e)}_sendBinary(e){if(!this._checkOpenSocket())return;let t=new Uint8Array(e.length);for(let s=0;s<e.length;++s)t[s]=e.charCodeAt(s)&255;this._socket.send(t)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw new Error("Attach addon was loaded before socket was open");case WebSocket.CLOSING:return console.warn("Attach addon socket is closing"),!1;case WebSocket.CLOSED:throw new Error("Attach addon socket is closed");default:throw new Error("Unexpected socket state")}}};function o(i,e,t){return i.addEventListener(e,t),{dispose:()=>{t&&i.removeEventListener(e,t)}}}export{r as AttachAddon};
18
- //# sourceMappingURL=xterm-addon-attach.mjs.map
18
+ //# sourceMappingURL=addon-attach.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xterm/addon-attach",
3
- "version": "0.12.0-beta.53",
3
+ "version": "0.12.0-beta.55",
4
4
  "author": {
5
5
  "name": "The xterm.js authors",
6
6
  "url": "https://xtermjs.org/"