New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

xterm-addon-serialize

Package Overview
Dependencies
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xterm-addon-serialize - npm Package Compare versions

Comparing version 0.2.0-beta.2 to 0.2.0-beta.3

2

benchmark/SerializeAddon.benchmark.ts

@@ -15,3 +15,3 @@ /**

writeSync(data: string): void {
(<any>this)._core.writeSync(data);
(this as any)._core.writeSync(data);
}

@@ -18,0 +18,0 @@ }

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SerializeAddon=t():e.SerializeAddon=t()}(window,function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var i=e.call(this,t)||this;return i._rowIndex=0,i._allRows=new Array,i._currentRow="",i._nullCellCount=0,i}return r(t,e),t.prototype._beforeSerialize=function(e){this._allRows=new Array(e)},t.prototype._rowEnd=function(e){this._allRows[this._rowIndex++]=this._currentRow,this._currentRow="",this._nullCellCount=0},t.prototype._nextCell=function(e,t,i,n){var r,o,l=[],s=(o=t,!((r=e).getFgColorMode()===o.getFgColorMode()&&r.getFgColor()===o.getFgColor())),u=!function(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}(e,t),f=!function(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()}(e,t);if(s||u||f)if(e.isAttributeDefault())this._currentRow+="";else{if(s){var a=e.getFgColor();e.isFgRGB()?l.push(38,2,a>>>16&255,a>>>8&255,255&a):e.isFgPalette()?a>=16?l.push(38,5,a):l.push(8&a?90+(7&a):30+(7&a)):l.push(39)}if(u){a=e.getBgColor();e.isBgRGB()?l.push(48,2,a>>>16&255,a>>>8&255,255&a):e.isBgPalette()?a>=16?l.push(48,5,a):l.push(8&a?100+(7&a):40+(7&a)):l.push(49)}f&&(e.isInverse()!==t.isInverse()&&l.push(e.isInverse()?7:27),e.isBold()!==t.isBold()&&l.push(e.isBold()?1:22),e.isUnderline()!==t.isUnderline()&&l.push(e.isUnderline()?4:24),e.isBlink()!==t.isBlink()&&l.push(e.isBlink()?5:25),e.isInvisible()!==t.isInvisible()&&l.push(e.isInvisible()?8:28),e.isItalic()!==t.isItalic()&&l.push(e.isItalic()?3:23),e.isDim()!==t.isDim()&&l.push(e.isDim()?2:22))}l.length&&(this._currentRow+="["+l.join(";")+"m"),""===e.getChars()?this._nullCellCount++:this._nullCellCount>0&&(this._currentRow+="["+this._nullCellCount+"C",this._nullCellCount=0),this._currentRow+=e.getChars()},t.prototype._serializeString=function(){for(var e=this._allRows.length;e>0&&!this._allRows[e-1];e--);return this._allRows.slice(0,e).join("\r\n")},t}(function(){function e(e){this._buffer=e}return e.prototype.serialize=function(e,t){var i=this._buffer.getNullCell(),n=this._buffer.getNullCell(),r=i;this._beforeSerialize(t-e);for(var o=e;o<t;o++){var l=this._buffer.getLine(o);if(l)for(var s=0;s<l.length;s++){var u=l.getCell(s,r===i?n:i);u?(this._nextCell(u,r,o,s),r=u):console.warn("Can't get cell at row="+o+", col="+s)}this._rowEnd(o)}return this._afterSerialize(),this._serializeString()},e.prototype._nextCell=function(e,t,i,n){},e.prototype._rowEnd=function(e){},e.prototype._beforeSerialize=function(e){},e.prototype._afterSerialize=function(){},e.prototype._serializeString=function(){return""},e}()),l=function(){function e(){}return e.prototype.activate=function(e){this._terminal=e},e.prototype.serialize=function(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");var t,i,n,r=this._terminal.buffer.length,l=new o(this._terminal.buffer);return e=void 0===e?r:(t=e,i=0,n=r,Math.max(i,Math.min(t,n))),l.serialize(r-e,r)},e.prototype.dispose=function(){},e}();t.SerializeAddon=l}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SerializeAddon=t():e.SerializeAddon=t()}(window,(function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var i=e.call(this,t)||this;return i._rowIndex=0,i._allRows=new Array,i._currentRow="",i._nullCellCount=0,i}return r(t,e),t.prototype._beforeSerialize=function(e){this._allRows=new Array(e)},t.prototype._rowEnd=function(e){this._allRows[this._rowIndex++]=this._currentRow,this._currentRow="",this._nullCellCount=0},t.prototype._nextCell=function(e,t,i,n){var r,o,l=[],s=(o=t,!((r=e).getFgColorMode()===o.getFgColorMode()&&r.getFgColor()===o.getFgColor())),u=!function(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}(e,t),f=!function(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()}(e,t);if(s||u||f)if(e.isAttributeDefault())this._currentRow+="";else{if(s){var a=e.getFgColor();e.isFgRGB()?l.push(38,2,a>>>16&255,a>>>8&255,255&a):e.isFgPalette()?a>=16?l.push(38,5,a):l.push(8&a?90+(7&a):30+(7&a)):l.push(39)}if(u){a=e.getBgColor();e.isBgRGB()?l.push(48,2,a>>>16&255,a>>>8&255,255&a):e.isBgPalette()?a>=16?l.push(48,5,a):l.push(8&a?100+(7&a):40+(7&a)):l.push(49)}f&&(e.isInverse()!==t.isInverse()&&l.push(e.isInverse()?7:27),e.isBold()!==t.isBold()&&l.push(e.isBold()?1:22),e.isUnderline()!==t.isUnderline()&&l.push(e.isUnderline()?4:24),e.isBlink()!==t.isBlink()&&l.push(e.isBlink()?5:25),e.isInvisible()!==t.isInvisible()&&l.push(e.isInvisible()?8:28),e.isItalic()!==t.isItalic()&&l.push(e.isItalic()?3:23),e.isDim()!==t.isDim()&&l.push(e.isDim()?2:22))}l.length&&(this._currentRow+="["+l.join(";")+"m"),""===e.getChars()?this._nullCellCount++:this._nullCellCount>0&&(this._currentRow+="["+this._nullCellCount+"C",this._nullCellCount=0),this._currentRow+=e.getChars()},t.prototype._serializeString=function(){for(var e=this._allRows.length;e>0&&!this._allRows[e-1];e--);return this._allRows.slice(0,e).join("\r\n")},t}(function(){function e(e){this._buffer=e}return e.prototype.serialize=function(e,t){var i=this._buffer.getNullCell(),n=this._buffer.getNullCell(),r=i;this._beforeSerialize(t-e);for(var o=e;o<t;o++){var l=this._buffer.getLine(o);if(l)for(var s=0;s<l.length;s++){var u=l.getCell(s,r===i?n:i);u?(this._nextCell(u,r,o,s),r=u):console.warn("Can't get cell at row="+o+", col="+s)}this._rowEnd(o)}return this._afterSerialize(),this._serializeString()},e.prototype._nextCell=function(e,t,i,n){},e.prototype._rowEnd=function(e){},e.prototype._beforeSerialize=function(e){},e.prototype._afterSerialize=function(){},e.prototype._serializeString=function(){return""},e}()),l=function(){function e(){}return e.prototype.activate=function(e){this._terminal=e},e.prototype.serialize=function(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");var t,i,n,r=this._terminal.buffer.length,l=new o(this._terminal.buffer);return e=void 0===e?r:(t=e,i=0,n=r,Math.max(i,Math.min(t,n))),l.serialize(r-e,r)},e.prototype.dispose=function(){},e}();t.SerializeAddon=l}])}));
//# sourceMappingURL=xterm-addon-serialize.js.map

@@ -35,2 +35,3 @@ "use strict";

this._rowContainer.classList.add('xterm-accessibility-tree');
this._rowContainer.setAttribute('role', 'list');
this._rowElements = [];

@@ -37,0 +38,0 @@ for (let i = 0; i < this._terminal.rows; i++) {

@@ -544,5 +544,4 @@ "use strict";

function sendEvent(ev) {
let pos;
// get mouse coordinates
pos = self._mouseService.getRawByteCoords(ev, self.screenElement, self.cols, self.rows);
const pos = self._mouseService.getRawByteCoords(ev, self.screenElement, self.cols, self.rows);
if (!pos) {

@@ -854,3 +853,3 @@ return false;

// scrollback, instead we can just shift them in-place.
const scrollRegionHeight = bottomRow - topRow + 1 /*as it's zero-based*/;
const scrollRegionHeight = bottomRow - topRow + 1 /* as it's zero-based */;
this.buffer.lines.shiftElements(topRow + 1, scrollRegionHeight - 1, -1);

@@ -857,0 +856,0 @@ this.buffer.lines.set(bottomRow, newLine.clone());

{
"name": "xterm-addon-serialize",
"version": "0.2.0-beta.2",
"version": "0.2.0-beta.3",
"author": {

@@ -5,0 +5,0 @@ "name": "The xterm.js authors",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc