Comparing version 3.13.0-beta1 to 3.13.0-beta10
@@ -114,2 +114,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.search = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
this._cursorMoveListener = this._terminal.onCursorMove(function () { return _this._destroyLinesCache(); }); | ||
this._resizeListener = this._terminal.onResize(function () { return _this._destroyLinesCache(); }); | ||
} | ||
@@ -125,2 +126,6 @@ window.clearTimeout(this._linesCacheTimeoutId); | ||
} | ||
if (this._resizeListener) { | ||
this._resizeListener.dispose(); | ||
this._resizeListener = undefined; | ||
} | ||
if (this._linesCacheTimeoutId) { | ||
@@ -127,0 +132,0 @@ window.clearTimeout(this._linesCacheTimeoutId); |
@@ -13,3 +13,4 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.webLinks = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
var hostClause = '((' + domainBodyClause + '\\.' + tldClause + ')|' + ipClause + '|' + localHostClause + ')' + portClause + '?'; | ||
var pathClause = '(\\/[\\/\\w\\.\\-%~:]*)*([^:"\'\\s])'; | ||
var pathCharacterSet = '(\\/[\\/\\w\\.\\-%~:]*)*([^:"\'\\s])'; | ||
var pathClause = '(' + pathCharacterSet + ')?'; | ||
var queryStringHashFragmentCharacterSet = '[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&\'*+,:;~\\=\\.\\-]*'; | ||
@@ -16,0 +17,0 @@ var queryStringClause = '(\\?' + queryStringHashFragmentCharacterSet + ')?'; |
@@ -44,3 +44,3 @@ "use strict"; | ||
_this._accessibilityTreeRoot.appendChild(_this._rowContainer); | ||
_this._renderRowsDebouncer = new RenderDebouncer_1.RenderDebouncer(_this._terminal, _this._renderRows.bind(_this)); | ||
_this._renderRowsDebouncer = new RenderDebouncer_1.RenderDebouncer(_this._renderRows.bind(_this)); | ||
_this._refreshRows(); | ||
@@ -178,3 +178,3 @@ _this._liveRegion = document.createElement('div'); | ||
AccessibilityManager.prototype._refreshRows = function (start, end) { | ||
this._renderRowsDebouncer.refresh(start, end); | ||
this._renderRowsDebouncer.refresh(start, end, this._terminal.rows); | ||
}; | ||
@@ -181,0 +181,0 @@ AccessibilityManager.prototype._renderRows = function (start, end) { |
@@ -7,2 +7,3 @@ import { ISearchHelper, ISearchAddonTerminal, ISearchOptions, ISearchResult } from './Interfaces'; | ||
private _cursorMoveListener; | ||
private _resizeListener; | ||
constructor(_terminal: ISearchAddonTerminal); | ||
@@ -9,0 +10,0 @@ findNext(term: string, searchOptions?: ISearchOptions): boolean; |
@@ -113,2 +113,3 @@ "use strict"; | ||
this._cursorMoveListener = this._terminal.onCursorMove(function () { return _this._destroyLinesCache(); }); | ||
this._resizeListener = this._terminal.onResize(function () { return _this._destroyLinesCache(); }); | ||
} | ||
@@ -124,2 +125,6 @@ window.clearTimeout(this._linesCacheTimeoutId); | ||
} | ||
if (this._resizeListener) { | ||
this._resizeListener.dispose(); | ||
this._resizeListener = undefined; | ||
} | ||
if (this._linesCacheTimeoutId) { | ||
@@ -126,0 +131,0 @@ window.clearTimeout(this._linesCacheTimeoutId); |
@@ -12,3 +12,4 @@ "use strict"; | ||
var hostClause = '((' + domainBodyClause + '\\.' + tldClause + ')|' + ipClause + '|' + localHostClause + ')' + portClause + '?'; | ||
var pathClause = '(\\/[\\/\\w\\.\\-%~:]*)*([^:"\'\\s])'; | ||
var pathCharacterSet = '(\\/[\\/\\w\\.\\-%~:]*)*([^:"\'\\s])'; | ||
var pathClause = '(' + pathCharacterSet + ')?'; | ||
var queryStringHashFragmentCharacterSet = '[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&\'*+,:;~\\=\\.\\-]*'; | ||
@@ -15,0 +16,0 @@ var queryStringClause = '(\\?' + queryStringHashFragmentCharacterSet + ')?'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MouseZoneManager_1 = require("./ui/MouseZoneManager"); | ||
var MouseZoneManager_1 = require("./MouseZoneManager"); | ||
var CharWidth_1 = require("./CharWidth"); | ||
@@ -5,0 +5,0 @@ var EventEmitter2_1 = require("./common/EventEmitter2"); |
@@ -173,11 +173,16 @@ "use strict"; | ||
} | ||
else if (cell.isFgRGB()) { | ||
this._ctx.fillStyle = "rgb(" + BufferLine_1.AttributeData.toColorRGB(cell.getFgColor()).join(',') + ")"; | ||
} | ||
else if (cell.isFgPalette()) { | ||
var fg = cell.getFgColor(); | ||
if (terminal.options.drawBoldTextInBrightColors && cell.isBold() && fg < 8) { | ||
fg += 8; | ||
else { | ||
if (cell.isFgDefault()) { | ||
this._ctx.fillStyle = this._colors.foreground.css; | ||
} | ||
this._ctx.fillStyle = this._colors.ansi[fg].css; | ||
else if (cell.isFgRGB()) { | ||
this._ctx.fillStyle = "rgb(" + BufferLine_1.AttributeData.toColorRGB(cell.getFgColor()).join(',') + ")"; | ||
} | ||
else { | ||
var fg = cell.getFgColor(); | ||
if (terminal.options.drawBoldTextInBrightColors && cell.isBold() && fg < 8) { | ||
fg += 8; | ||
} | ||
this._ctx.fillStyle = this._colors.ansi[fg].css; | ||
} | ||
} | ||
@@ -184,0 +189,0 @@ this._clipRow(terminal, y); |
@@ -64,3 +64,3 @@ "use strict"; | ||
_this._updateDimensions(); | ||
_this._renderDebouncer = new RenderDebouncer_1.RenderDebouncer(_this._terminal, _this._renderRows.bind(_this)); | ||
_this._renderDebouncer = new RenderDebouncer_1.RenderDebouncer(_this._renderRows.bind(_this)); | ||
_this._rowFactory = new DomRendererRowFactory_1.DomRendererRowFactory(_terminal.options, document); | ||
@@ -154,5 +154,5 @@ _this._terminal.element.classList.add(TERMINAL_CLASS_PREFIX + _this._terminalClass); | ||
"@keyframes blink {" + | ||
" 0 % { opacity: 1.0; }" + | ||
" 0% { opacity: 1.0; }" + | ||
" 50% { opacity: 0.0; }" + | ||
" 100 % { opacity: 1.0; }" + | ||
" 100% { opacity: 1.0; }" + | ||
"}"; | ||
@@ -281,3 +281,3 @@ styles += | ||
DomRenderer.prototype.refreshRows = function (start, end) { | ||
this._renderDebouncer.refresh(start, end); | ||
this._renderDebouncer.refresh(start, end, this._terminal.rows); | ||
}; | ||
@@ -284,0 +284,0 @@ DomRenderer.prototype._renderRows = function (start, end) { |
@@ -9,2 +9,3 @@ "use strict"; | ||
exports.ITALIC_CLASS = 'xterm-italic'; | ||
exports.UNDERLINE_CLASS = 'xterm-underline'; | ||
exports.CURSOR_CLASS = 'xterm-cursor'; | ||
@@ -66,2 +67,5 @@ exports.CURSOR_BLINK_CLASS = 'xterm-cursor-blink'; | ||
} | ||
if (this._workCell.isUnderline()) { | ||
charElement.classList.add(exports.UNDERLINE_CLASS); | ||
} | ||
charElement.textContent = this._workCell.getChars() || Buffer_1.WHITESPACE_CELL_CHAR; | ||
@@ -68,0 +72,0 @@ var swapColor = this._workCell.isInverse(); |
@@ -64,3 +64,3 @@ "use strict"; | ||
_this.onOptionsChanged(); | ||
_this._renderDebouncer = new RenderDebouncer_1.RenderDebouncer(_this._terminal, _this._renderRows.bind(_this)); | ||
_this._renderDebouncer = new RenderDebouncer_1.RenderDebouncer(_this._renderRows.bind(_this)); | ||
_this._screenDprMonitor = new ScreenDprMonitor_1.ScreenDprMonitor(); | ||
@@ -177,3 +177,3 @@ _this._screenDprMonitor.setListener(function () { return _this.onWindowResize(window.devicePixelRatio); }); | ||
} | ||
this._renderDebouncer.refresh(start, end); | ||
this._renderDebouncer.refresh(start, end, this._terminal.rows); | ||
}; | ||
@@ -180,0 +180,0 @@ Renderer.prototype._renderRows = function (start, end) { |
@@ -152,8 +152,17 @@ "use strict"; | ||
} | ||
else if (cell.isFgRGB()) { | ||
_this._ctx.fillStyle = "rgb(" + BufferLine_1.AttributeData.toColorRGB(cell.getFgColor()).join(',') + ")"; | ||
else { | ||
if (cell.isFgDefault()) { | ||
_this._ctx.fillStyle = _this._colors.foreground.css; | ||
} | ||
else if (cell.isFgRGB()) { | ||
_this._ctx.fillStyle = "rgb(" + BufferLine_1.AttributeData.toColorRGB(cell.getFgColor()).join(',') + ")"; | ||
} | ||
else { | ||
var fg = cell.getFgColor(); | ||
if (terminal.options.drawBoldTextInBrightColors && cell.isBold() && fg < 8) { | ||
fg += 8; | ||
} | ||
_this._ctx.fillStyle = _this._colors.ansi[fg].css; | ||
} | ||
} | ||
else if (cell.isFgPalette()) { | ||
_this._ctx.fillStyle = _this._colors.ansi[cell.getFgColor()].css; | ||
} | ||
_this.fillBottomLineAtCells(x, y, cell.getWidth()); | ||
@@ -160,0 +169,0 @@ _this._ctx.restore(); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MouseHelper_1 = require("./ui/MouseHelper"); | ||
var MouseHelper_1 = require("./MouseHelper"); | ||
var Browser = require("./common/Platform"); | ||
@@ -5,0 +5,0 @@ var SelectionModel_1 = require("./SelectionModel"); |
@@ -21,3 +21,3 @@ "use strict"; | ||
var Viewport_1 = require("./Viewport"); | ||
var Clipboard_1 = require("./ui/Clipboard"); | ||
var Clipboard_1 = require("./Clipboard"); | ||
var EscapeSequences_1 = require("./common/data/EscapeSequences"); | ||
@@ -28,9 +28,9 @@ var InputHandler_1 = require("./InputHandler"); | ||
var SelectionManager_1 = require("./SelectionManager"); | ||
var CharMeasure_1 = require("./ui/CharMeasure"); | ||
var CharMeasure_1 = require("./CharMeasure"); | ||
var Browser = require("./common/Platform"); | ||
var Lifecycle_1 = require("./ui/Lifecycle"); | ||
var Strings = require("./Strings"); | ||
var MouseHelper_1 = require("./ui/MouseHelper"); | ||
var MouseHelper_1 = require("./MouseHelper"); | ||
var SoundManager_1 = require("./SoundManager"); | ||
var MouseZoneManager_1 = require("./ui/MouseZoneManager"); | ||
var MouseZoneManager_1 = require("./MouseZoneManager"); | ||
var AccessibilityManager_1 = require("./AccessibilityManager"); | ||
@@ -37,0 +37,0 @@ var ScreenDprMonitor_1 = require("./ui/ScreenDprMonitor"); |
@@ -11,4 +11,2 @@ "use strict"; | ||
node.removeEventListener(type, handler, useCapture); | ||
node = null; | ||
handler = null; | ||
} | ||
@@ -15,0 +13,0 @@ }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var RenderDebouncer = (function () { | ||
function RenderDebouncer(_terminal, _callback) { | ||
this._terminal = _terminal; | ||
this._callback = _callback; | ||
this._animationFrame = null; | ||
function RenderDebouncer(_renderCallback) { | ||
this._renderCallback = _renderCallback; | ||
} | ||
@@ -12,13 +10,12 @@ RenderDebouncer.prototype.dispose = function () { | ||
window.cancelAnimationFrame(this._animationFrame); | ||
this._animationFrame = null; | ||
this._animationFrame = undefined; | ||
} | ||
}; | ||
RenderDebouncer.prototype.refresh = function (rowStart, rowEnd) { | ||
RenderDebouncer.prototype.refresh = function (rowStart, rowEnd, rowCount) { | ||
var _this = this; | ||
rowStart = rowStart !== null && rowStart !== undefined ? rowStart : 0; | ||
rowEnd = rowEnd !== null && rowEnd !== undefined ? rowEnd : this._terminal.rows - 1; | ||
var isRowStartSet = this._rowStart !== undefined && this._rowStart !== null; | ||
var isRowEndSet = this._rowEnd !== undefined && this._rowEnd !== null; | ||
this._rowStart = isRowStartSet ? Math.min(this._rowStart, rowStart) : rowStart; | ||
this._rowEnd = isRowEndSet ? Math.max(this._rowEnd, rowEnd) : rowEnd; | ||
this._rowCount = rowCount; | ||
rowStart = rowStart !== undefined ? rowStart : 0; | ||
rowEnd = rowEnd !== undefined ? rowEnd : this._rowCount - 1; | ||
this._rowStart = this._rowStart !== undefined ? Math.min(this._rowStart, rowStart) : rowStart; | ||
this._rowEnd = this._rowEnd !== undefined ? Math.max(this._rowEnd, rowEnd) : rowEnd; | ||
if (this._animationFrame) { | ||
@@ -30,8 +27,11 @@ return; | ||
RenderDebouncer.prototype._innerRefresh = function () { | ||
if (this._rowStart === undefined || this._rowEnd === undefined || this._rowCount === undefined) { | ||
return; | ||
} | ||
this._rowStart = Math.max(this._rowStart, 0); | ||
this._rowEnd = Math.min(this._rowEnd, this._terminal.rows - 1); | ||
this._callback(this._rowStart, this._rowEnd); | ||
this._rowStart = null; | ||
this._rowEnd = null; | ||
this._animationFrame = null; | ||
this._rowEnd = Math.min(this._rowEnd, this._rowCount - 1); | ||
this._renderCallback(this._rowStart, this._rowEnd); | ||
this._rowStart = undefined; | ||
this._rowEnd = undefined; | ||
this._animationFrame = undefined; | ||
}; | ||
@@ -38,0 +38,0 @@ return RenderDebouncer; |
@@ -20,3 +20,5 @@ "use strict"; | ||
function ScreenDprMonitor() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this._currentDevicePixelRatio = window.devicePixelRatio; | ||
return _this; | ||
} | ||
@@ -30,2 +32,5 @@ ScreenDprMonitor.prototype.setListener = function (listener) { | ||
this._outerListener = function () { | ||
if (!_this._listener) { | ||
return; | ||
} | ||
_this._listener(window.devicePixelRatio, _this._currentDevicePixelRatio); | ||
@@ -41,5 +46,6 @@ _this._updateDpr(); | ||
ScreenDprMonitor.prototype._updateDpr = function () { | ||
if (this._resolutionMediaMatchList) { | ||
this._resolutionMediaMatchList.removeListener(this._outerListener); | ||
if (!this._resolutionMediaMatchList || !this._outerListener) { | ||
return; | ||
} | ||
this._resolutionMediaMatchList.removeListener(this._outerListener); | ||
this._currentDevicePixelRatio = window.devicePixelRatio; | ||
@@ -50,8 +56,9 @@ this._resolutionMediaMatchList = window.matchMedia("screen and (resolution: " + window.devicePixelRatio + "dppx)"); | ||
ScreenDprMonitor.prototype.clearListener = function () { | ||
if (!this._listener) { | ||
if (!this._resolutionMediaMatchList || !this._listener || !this._outerListener) { | ||
return; | ||
} | ||
this._resolutionMediaMatchList.removeListener(this._outerListener); | ||
this._listener = null; | ||
this._outerListener = null; | ||
this._resolutionMediaMatchList = undefined; | ||
this._listener = undefined; | ||
this._outerListener = undefined; | ||
}; | ||
@@ -58,0 +65,0 @@ return ScreenDprMonitor; |
{ | ||
"name": "xterm", | ||
"description": "Full xterm terminal, in your browser", | ||
"version": "3.13.0-beta1", | ||
"version": "3.13.0-beta10", | ||
"main": "lib/public/Terminal.js", | ||
@@ -64,2 +64,2 @@ "types": "typings/xterm.d.ts", | ||
} | ||
} | ||
} |
@@ -171,2 +171,12 @@ # [![xterm.js logo](logo-full.png)](https://xtermjs.org) | ||
### Beta builds | ||
Our CI releases beta builds to npm for every change that goes into master, install the latest beta build with: | ||
``` | ||
npm install -S xterm@beta | ||
``` | ||
These should generally be stable but some bugs may slip in, we recommend using the beta build primarily to test out new features and for verifying bug fixes. | ||
## Contributing | ||
@@ -173,0 +183,0 @@ |
@@ -64,3 +64,3 @@ /** | ||
this._renderRowsDebouncer = new RenderDebouncer(this._terminal, this._renderRows.bind(this)); | ||
this._renderRowsDebouncer = new RenderDebouncer(this._renderRows.bind(this)); | ||
this._refreshRows(); | ||
@@ -243,3 +243,3 @@ | ||
private _refreshRows(start?: number, end?: number): void { | ||
this._renderRowsDebouncer.refresh(start, end); | ||
this._renderRowsDebouncer.refresh(start, end, this._terminal.rows); | ||
} | ||
@@ -246,0 +246,0 @@ |
@@ -24,2 +24,3 @@ /** | ||
private _cursorMoveListener: IDisposable | undefined; | ||
private _resizeListener: IDisposable | undefined; | ||
@@ -189,2 +190,3 @@ constructor(private _terminal: ISearchAddonTerminal) { | ||
this._cursorMoveListener = this._terminal.onCursorMove(() => this._destroyLinesCache()); | ||
this._resizeListener = this._terminal.onResize(() => this._destroyLinesCache()); | ||
} | ||
@@ -202,2 +204,6 @@ | ||
} | ||
if (this._resizeListener) { | ||
this._resizeListener.dispose(); | ||
this._resizeListener = undefined; | ||
} | ||
if (this._linesCacheTimeoutId) { | ||
@@ -204,0 +210,0 @@ window.clearTimeout(this._linesCacheTimeoutId); |
@@ -17,3 +17,4 @@ /** | ||
const hostClause = '((' + domainBodyClause + '\\.' + tldClause + ')|' + ipClause + '|' + localHostClause + ')' + portClause + '?'; | ||
const pathClause = '(\\/[\\/\\w\\.\\-%~:]*)*([^:"\'\\s])'; | ||
const pathCharacterSet = '(\\/[\\/\\w\\.\\-%~:]*)*([^:"\'\\s])'; | ||
const pathClause = '(' + pathCharacterSet + ')?'; | ||
const queryStringHashFragmentCharacterSet = '[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&\'*+,:;~\\=\\.\\-]*'; | ||
@@ -20,0 +21,0 @@ const queryStringClause = '(\\?' + queryStringHashFragmentCharacterSet + ')?'; |
@@ -6,5 +6,4 @@ /** | ||
import { IMouseZoneManager } from './ui/Types'; | ||
import { ILinkifierEvent, ILinkMatcher, LinkMatcherHandler, ILinkMatcherOptions, ILinkifier, ITerminal, IBufferStringIteratorResult } from './Types'; | ||
import { MouseZone } from './ui/MouseZoneManager'; | ||
import { ILinkifierEvent, ILinkMatcher, LinkMatcherHandler, ILinkMatcherOptions, ILinkifier, ITerminal, IBufferStringIteratorResult, IMouseZoneManager } from './Types'; | ||
import { MouseZone } from './MouseZoneManager'; | ||
import { getStringCellWidth } from './CharWidth'; | ||
@@ -11,0 +10,0 @@ import { EventEmitter2, IEvent } from './common/EventEmitter2'; |
@@ -33,3 +33,3 @@ /** | ||
public get cols(): number { return this._core.cols; } | ||
public get markers(): IMarker[] { return this._core.markers; } | ||
public get markers(): ReadonlyArray<IMarker> { return this._core.markers; } | ||
public blur(): void { | ||
@@ -36,0 +36,0 @@ this._core.blur(); |
@@ -325,10 +325,14 @@ /** | ||
} | ||
} else if (cell.isFgRGB()) { | ||
this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`; | ||
} else if (cell.isFgPalette()) { | ||
let fg = cell.getFgColor(); | ||
if (terminal.options.drawBoldTextInBrightColors && cell.isBold() && fg < 8) { | ||
fg += 8; | ||
} else { | ||
if (cell.isFgDefault()) { | ||
this._ctx.fillStyle = this._colors.foreground.css; | ||
} else if (cell.isFgRGB()) { | ||
this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`; | ||
} else { | ||
let fg = cell.getFgColor(); | ||
if (terminal.options.drawBoldTextInBrightColors && cell.isBold() && fg < 8) { | ||
fg += 8; | ||
} | ||
this._ctx.fillStyle = this._colors.ansi[fg].css; | ||
} | ||
this._ctx.fillStyle = this._colors.ansi[fg].css; | ||
} | ||
@@ -335,0 +339,0 @@ |
@@ -83,3 +83,3 @@ /** | ||
this._renderDebouncer = new RenderDebouncer(this._terminal, this._renderRows.bind(this)); | ||
this._renderDebouncer = new RenderDebouncer(this._renderRows.bind(this)); | ||
this._rowFactory = new DomRendererRowFactory(_terminal.options, document); | ||
@@ -178,5 +178,5 @@ | ||
`@keyframes blink {` + | ||
` 0 % { opacity: 1.0; }` + | ||
` 0% { opacity: 1.0; }` + | ||
` 50% { opacity: 0.0; }` + | ||
` 100 % { opacity: 1.0; }` + | ||
` 100% { opacity: 1.0; }` + | ||
`}`; | ||
@@ -345,3 +345,3 @@ // Cursor | ||
public refreshRows(start: number, end: number): void { | ||
this._renderDebouncer.refresh(start, end); | ||
this._renderDebouncer.refresh(start, end, this._terminal.rows); | ||
} | ||
@@ -348,0 +348,0 @@ |
@@ -14,2 +14,3 @@ /** | ||
export const ITALIC_CLASS = 'xterm-italic'; | ||
export const UNDERLINE_CLASS = 'xterm-underline'; | ||
export const CURSOR_CLASS = 'xterm-cursor'; | ||
@@ -92,2 +93,6 @@ export const CURSOR_BLINK_CLASS = 'xterm-cursor-blink'; | ||
if (this._workCell.isUnderline()) { | ||
charElement.classList.add(UNDERLINE_CLASS); | ||
} | ||
charElement.textContent = this._workCell.getChars() || WHITESPACE_CELL_CHAR; | ||
@@ -94,0 +99,0 @@ |
@@ -71,3 +71,3 @@ /** | ||
this._renderDebouncer = new RenderDebouncer(this._terminal, this._renderRows.bind(this)); | ||
this._renderDebouncer = new RenderDebouncer(this._renderRows.bind(this)); | ||
this._screenDprMonitor = new ScreenDprMonitor(); | ||
@@ -198,3 +198,3 @@ this._screenDprMonitor.setListener(() => this.onWindowResize(window.devicePixelRatio)); | ||
} | ||
this._renderDebouncer.refresh(start, end); | ||
this._renderDebouncer.refresh(start, end, this._terminal.rows); | ||
} | ||
@@ -201,0 +201,0 @@ |
@@ -220,6 +220,14 @@ /** | ||
} | ||
} else if (cell.isFgRGB()) { | ||
this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`; | ||
} else if (cell.isFgPalette()) { | ||
this._ctx.fillStyle = this._colors.ansi[cell.getFgColor()].css; | ||
} else { | ||
if (cell.isFgDefault()) { | ||
this._ctx.fillStyle = this._colors.foreground.css; | ||
} else if (cell.isFgRGB()) { | ||
this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`; | ||
} else { | ||
let fg = cell.getFgColor(); | ||
if (terminal.options.drawBoldTextInBrightColors && cell.isBold() && fg < 8) { | ||
fg += 8; | ||
} | ||
this._ctx.fillStyle = this._colors.ansi[fg].css; | ||
} | ||
} | ||
@@ -226,0 +234,0 @@ |
@@ -7,5 +7,5 @@ /** | ||
import { ITerminal, ISelectionManager, IBuffer, IBufferLine, ISelectionRedrawRequestEvent } from './Types'; | ||
import { MouseHelper } from './ui/MouseHelper'; | ||
import { MouseHelper } from './MouseHelper'; | ||
import * as Browser from './common/Platform'; | ||
import { CharMeasure } from './ui/CharMeasure'; | ||
import { CharMeasure } from './CharMeasure'; | ||
import { SelectionModel } from './SelectionModel'; | ||
@@ -12,0 +12,0 @@ import { AltClickHandler } from './handlers/AltClickHandler'; |
@@ -24,4 +24,3 @@ /** | ||
import { IInputHandlingTerminal, IViewport, ICompositionHelper, ITerminalOptions, ITerminal, IBrowser, ILinkifier, ILinkMatcherOptions, CustomKeyEventHandler, LinkMatcherHandler, CharacterJoinerHandler, IBufferLine, IAttributeData } from './Types'; | ||
import { IMouseZoneManager } from './ui/Types'; | ||
import { IInputHandlingTerminal, IViewport, ICompositionHelper, ITerminalOptions, ITerminal, IBrowser, ILinkifier, ILinkMatcherOptions, CustomKeyEventHandler, LinkMatcherHandler, CharacterJoinerHandler, IBufferLine, IAttributeData, IMouseZoneManager } from './Types'; | ||
import { IRenderer } from './renderer/Types'; | ||
@@ -33,3 +32,3 @@ import { BufferSet } from './BufferSet'; | ||
import { Viewport } from './Viewport'; | ||
import { rightClickHandler, moveTextAreaUnderMouseCursor, pasteHandler, copyHandler } from './ui/Clipboard'; | ||
import { rightClickHandler, moveTextAreaUnderMouseCursor, pasteHandler, copyHandler } from './Clipboard'; | ||
import { C0 } from './common/data/EscapeSequences'; | ||
@@ -40,9 +39,9 @@ import { InputHandler } from './InputHandler'; | ||
import { SelectionManager } from './SelectionManager'; | ||
import { CharMeasure } from './ui/CharMeasure'; | ||
import { CharMeasure } from './CharMeasure'; | ||
import * as Browser from './common/Platform'; | ||
import { addDisposableDomListener } from './ui/Lifecycle'; | ||
import * as Strings from './Strings'; | ||
import { MouseHelper } from './ui/MouseHelper'; | ||
import { MouseHelper } from './MouseHelper'; | ||
import { DEFAULT_BELL_SOUND, SoundManager } from './SoundManager'; | ||
import { MouseZoneManager } from './ui/MouseZoneManager'; | ||
import { MouseZoneManager } from './MouseZoneManager'; | ||
import { AccessibilityManager } from './AccessibilityManager'; | ||
@@ -49,0 +48,0 @@ import { ScreenDprMonitor } from './ui/ScreenDprMonitor'; |
@@ -27,4 +27,5 @@ { | ||
{ "path": "./common" }, | ||
{ "path": "./core" } | ||
{ "path": "./core" }, | ||
{ "path": "./ui" } | ||
] | ||
} |
@@ -8,3 +8,2 @@ /** | ||
import { IColorSet, IRenderer } from './renderer/Types'; | ||
import { IMouseZoneManager } from './ui/Types'; | ||
import { ICharset } from './core/Types'; | ||
@@ -608,1 +607,18 @@ import { ICircularList } from './common/Types'; | ||
} | ||
export interface IMouseZoneManager extends IDisposable { | ||
add(zone: IMouseZone): void; | ||
clearAll(start?: number, end?: number): void; | ||
} | ||
export interface IMouseZone { | ||
x1: number; | ||
x2: number; | ||
y1: number; | ||
y2: number; | ||
clickCallback: (e: MouseEvent) => any; | ||
hoverCallback: (e: MouseEvent) => any | undefined; | ||
tooltipCallback: (e: MouseEvent) => any | undefined; | ||
leaveCallback: () => any | undefined; | ||
willLinkActivate: (e: MouseEvent) => boolean; | ||
} |
@@ -6,3 +6,3 @@ /** | ||
import { IDisposable } from 'xterm'; | ||
import { IDisposable } from '../common/Types'; | ||
@@ -28,6 +28,4 @@ /** | ||
node.removeEventListener(type, handler, useCapture); | ||
node = null; | ||
handler = null; | ||
} | ||
}; | ||
} |
@@ -1,4 +0,8 @@ | ||
import { ITerminal } from '../Types'; | ||
import { IDisposable } from 'xterm'; | ||
/** | ||
* Copyright (c) 2018 The xterm.js authors. All rights reserved. | ||
* @license MIT | ||
*/ | ||
import { IDisposable } from '../common/Types'; | ||
/** | ||
@@ -8,9 +12,9 @@ * Debounces calls to render terminal rows using animation frames. | ||
export class RenderDebouncer implements IDisposable { | ||
private _rowStart: number; | ||
private _rowEnd: number; | ||
private _animationFrame: number = null; | ||
private _rowStart: number | undefined; | ||
private _rowEnd: number | undefined; | ||
private _rowCount: number | undefined; | ||
private _animationFrame: number | undefined; | ||
constructor( | ||
private _terminal: ITerminal, | ||
private _callback: (start: number, end: number) => void | ||
private _renderCallback: (start: number, end: number) => void | ||
) { | ||
@@ -22,16 +26,14 @@ } | ||
window.cancelAnimationFrame(this._animationFrame); | ||
this._animationFrame = null; | ||
this._animationFrame = undefined; | ||
} | ||
} | ||
public refresh(rowStart: number, rowEnd: number): void { | ||
public refresh(rowStart: number, rowEnd: number, rowCount: number): void { | ||
this._rowCount = rowCount; | ||
// Get the min/max row start/end for the arg values | ||
rowStart = rowStart !== null && rowStart !== undefined ? rowStart : 0; | ||
rowEnd = rowEnd !== null && rowEnd !== undefined ? rowEnd : this._terminal.rows - 1; | ||
// Check whether the row start/end values have already been set | ||
const isRowStartSet = this._rowStart !== undefined && this._rowStart !== null; | ||
const isRowEndSet = this._rowEnd !== undefined && this._rowEnd !== null; | ||
rowStart = rowStart !== undefined ? rowStart : 0; | ||
rowEnd = rowEnd !== undefined ? rowEnd : this._rowCount - 1; | ||
// Set the properties to the updated values | ||
this._rowStart = isRowStartSet ? Math.min(this._rowStart, rowStart) : rowStart; | ||
this._rowEnd = isRowEndSet ? Math.max(this._rowEnd, rowEnd) : rowEnd; | ||
this._rowStart = this._rowStart !== undefined ? Math.min(this._rowStart, rowStart) : rowStart; | ||
this._rowEnd = this._rowEnd !== undefined ? Math.max(this._rowEnd, rowEnd) : rowEnd; | ||
@@ -46,14 +48,19 @@ if (this._animationFrame) { | ||
private _innerRefresh(): void { | ||
// Make sure values are set | ||
if (this._rowStart === undefined || this._rowEnd === undefined || this._rowCount === undefined) { | ||
return; | ||
} | ||
// Clamp values | ||
this._rowStart = Math.max(this._rowStart, 0); | ||
this._rowEnd = Math.min(this._rowEnd, this._terminal.rows - 1); | ||
this._rowEnd = Math.min(this._rowEnd, this._rowCount - 1); | ||
// Run render callback | ||
this._callback(this._rowStart, this._rowEnd); | ||
this._renderCallback(this._rowStart, this._rowEnd); | ||
// Reset debouncer | ||
this._rowStart = null; | ||
this._rowEnd = null; | ||
this._animationFrame = null; | ||
this._rowStart = undefined; | ||
this._rowEnd = undefined; | ||
this._animationFrame = undefined; | ||
} | ||
} |
@@ -21,6 +21,6 @@ /** | ||
export class ScreenDprMonitor extends Disposable { | ||
private _currentDevicePixelRatio: number; | ||
private _outerListener: (this: MediaQueryList, ev: MediaQueryListEvent) => any; | ||
private _listener: ScreenDprListener; | ||
private _resolutionMediaMatchList: MediaQueryList; | ||
private _currentDevicePixelRatio: number = window.devicePixelRatio; | ||
private _outerListener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | undefined; | ||
private _listener: ScreenDprListener | undefined; | ||
private _resolutionMediaMatchList: MediaQueryList | undefined; | ||
@@ -33,2 +33,5 @@ public setListener(listener: ScreenDprListener): void { | ||
this._outerListener = () => { | ||
if (!this._listener) { | ||
return; | ||
} | ||
this._listener(window.devicePixelRatio, this._currentDevicePixelRatio); | ||
@@ -46,6 +49,9 @@ this._updateDpr(); | ||
private _updateDpr(): void { | ||
if (!this._resolutionMediaMatchList || !this._outerListener) { | ||
return; | ||
} | ||
// Clear listeners for old DPR | ||
if (this._resolutionMediaMatchList) { | ||
this._resolutionMediaMatchList.removeListener(this._outerListener); | ||
} | ||
this._resolutionMediaMatchList.removeListener(this._outerListener); | ||
// Add listeners for new DPR | ||
@@ -58,9 +64,10 @@ this._currentDevicePixelRatio = window.devicePixelRatio; | ||
public clearListener(): void { | ||
if (!this._listener) { | ||
if (!this._resolutionMediaMatchList || !this._listener || !this._outerListener) { | ||
return; | ||
} | ||
this._resolutionMediaMatchList.removeListener(this._outerListener); | ||
this._listener = null; | ||
this._outerListener = null; | ||
this._resolutionMediaMatchList = undefined; | ||
this._listener = undefined; | ||
this._outerListener = undefined; | ||
} | ||
} |
@@ -8,3 +8,3 @@ /** | ||
import { ITerminal, IViewport } from './Types'; | ||
import { CharMeasure } from './ui/CharMeasure'; | ||
import { CharMeasure } from './CharMeasure'; | ||
import { Disposable } from './common/Lifecycle'; | ||
@@ -11,0 +11,0 @@ import { addDisposableDomListener } from './ui/Lifecycle'; |
@@ -362,3 +362,3 @@ /** | ||
*/ | ||
readonly markers: IMarker[]; | ||
readonly markers: ReadonlyArray<IMarker>; | ||
@@ -365,0 +365,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2558408
300
38610
192