Comparing version 5.3.0-beta.41 to 5.3.0-beta.42
{ | ||
"name": "xterm", | ||
"description": "Full xterm terminal, in your browser", | ||
"version": "5.3.0-beta.41", | ||
"version": "5.3.0-beta.42", | ||
"main": "lib/xterm.js", | ||
@@ -6,0 +6,0 @@ "style": "css/xterm.css", |
@@ -164,3 +164,3 @@ /** | ||
this._verifyIntegers(cursorYOffset); | ||
return this._core.addMarker(cursorYOffset); | ||
return this._core.registerMarker(cursorYOffset); | ||
} | ||
@@ -167,0 +167,0 @@ public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined { |
@@ -17,3 +17,2 @@ /** | ||
import { IBufferService, IInstantiationService, IOptionsService } from 'common/services/Services'; | ||
import { createStyle, IStyleSheet } from './StyleSheet'; | ||
@@ -40,4 +39,4 @@ | ||
private _themeStyle!: IStyleSheet; | ||
private _dimensionsStyle!: IStyleSheet; | ||
private _themeStyleElement!: HTMLStyleElement; | ||
private _dimensionsStyleElement!: HTMLStyleElement; | ||
private _rowContainer: HTMLElement; | ||
@@ -97,5 +96,5 @@ private _rowElements: HTMLElement[] = []; | ||
this._selectionContainer.remove(); | ||
this._themeStyle.dispose(); | ||
this._dimensionsStyle.dispose(); | ||
this._widthCache.dispose(); | ||
this._themeStyleElement.remove(); | ||
this._dimensionsStyleElement.remove(); | ||
})); | ||
@@ -136,4 +135,5 @@ | ||
if (!this._dimensionsStyle) { | ||
this._dimensionsStyle = createStyle(this._screenElement); | ||
if (!this._dimensionsStyleElement) { | ||
this._dimensionsStyleElement = document.createElement('style'); | ||
this._screenElement.appendChild(this._dimensionsStyleElement); | ||
} | ||
@@ -148,3 +148,3 @@ | ||
this._dimensionsStyle.setCss(styles); | ||
this._dimensionsStyleElement.textContent = styles; | ||
@@ -157,4 +157,5 @@ this._selectionContainer.style.height = this._viewportElement.style.height; | ||
private _injectCss(colors: ReadonlyColorSet): void { | ||
if (!this._themeStyle) { | ||
this._themeStyle = createStyle(this._screenElement); | ||
if (!this._themeStyleElement) { | ||
this._themeStyleElement = document.createElement('style'); | ||
this._screenElement.appendChild(this._themeStyleElement); | ||
} | ||
@@ -257,3 +258,3 @@ | ||
this._themeStyle.setCss(styles); | ||
this._themeStyleElement.textContent = styles; | ||
} | ||
@@ -260,0 +261,0 @@ |
@@ -923,3 +923,3 @@ /** | ||
public addMarker(cursorYOffset: number): IMarker { | ||
public registerMarker(cursorYOffset: number): IMarker { | ||
return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset); | ||
@@ -926,0 +926,0 @@ } |
@@ -6,3 +6,3 @@ /** | ||
import { IDecorationOptions, IDecoration, IDisposable, IMarker } from 'xterm'; | ||
import { IDecorationOptions, IDecoration, IDisposable, IMarker, Terminal as ITerminalApi } from 'xterm'; | ||
import { IEvent } from 'common/EventEmitter'; | ||
@@ -14,4 +14,8 @@ import { ICoreTerminal, CharData, ITerminalOptions, IColor } from 'common/Types'; | ||
export interface ITerminal extends IPublicTerminal, ICoreTerminal { | ||
element: HTMLElement | undefined; | ||
/** | ||
* A portion of the public API that are implemented identially internally and simply passed through. | ||
*/ | ||
type InternalPassthroughApis = Omit<ITerminalApi, 'buffer' | 'parser' | 'unicode' | 'modes' | 'writeln' | 'loadAddon'>; | ||
export interface ITerminal extends InternalPassthroughApis, ICoreTerminal { | ||
screenElement: HTMLElement | undefined; | ||
@@ -33,74 +37,2 @@ browser: IBrowser; | ||
// Portions of the public API that are required by the internal Terminal | ||
export interface IPublicTerminal extends IDisposable { | ||
textarea: HTMLTextAreaElement | undefined; | ||
rows: number; | ||
cols: number; | ||
buffer: IBuffer; | ||
markers: IMarker[]; | ||
onCursorMove: IEvent<void>; | ||
onData: IEvent<string>; | ||
onBinary: IEvent<string>; | ||
onKey: IEvent<{ key: string, domEvent: KeyboardEvent }>; | ||
onLineFeed: IEvent<void>; | ||
onScroll: IEvent<number>; | ||
onSelectionChange: IEvent<void>; | ||
onRender: IEvent<{ start: number, end: number }>; | ||
onResize: IEvent<{ cols: number, rows: number }>; | ||
onWriteParsed: IEvent<void>; | ||
onTitleChange: IEvent<string>; | ||
onBell: IEvent<void>; | ||
blur(): void; | ||
focus(): void; | ||
resize(columns: number, rows: number): void; | ||
open(parent: HTMLElement): void; | ||
attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void; | ||
registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise<boolean>): IDisposable; | ||
registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise<boolean>): IDisposable; | ||
registerEscHandler(id: IFunctionIdentifier, callback: () => boolean | Promise<boolean>): IDisposable; | ||
registerOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable; | ||
registerLinkProvider(linkProvider: ILinkProvider): IDisposable; | ||
registerCharacterJoiner(handler: (text: string) => [number, number][]): number; | ||
deregisterCharacterJoiner(joinerId: number): void; | ||
addMarker(cursorYOffset: number): IMarker; | ||
registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined; | ||
hasSelection(): boolean; | ||
getSelection(): string; | ||
getSelectionPosition(): IBufferRange | undefined; | ||
clearSelection(): void; | ||
select(column: number, row: number, length: number): void; | ||
selectAll(): void; | ||
selectLines(start: number, end: number): void; | ||
dispose(): void; | ||
/** | ||
* Scroll the display of the terminal | ||
* @param amount The number of lines to scroll down (negative scroll up). | ||
*/ | ||
scrollLines(amount: number): void; | ||
/** | ||
* Scroll the display of the terminal by a number of pages. | ||
* @param pageCount The number of pages to scroll (negative scrolls up). | ||
*/ | ||
scrollPages(pageCount: number): void; | ||
/** | ||
* Scrolls the display of the terminal to the top. | ||
*/ | ||
scrollToTop(): void; | ||
/** | ||
* Scrolls the display of the terminal to the bottom. | ||
*/ | ||
scrollToBottom(): void; | ||
/** | ||
* Scrolls to a line within the buffer. | ||
* @param line The 0-based line index to scroll to. | ||
*/ | ||
scrollToLine(line: number): void; | ||
clear(): void; | ||
write(data: string | Uint8Array, callback?: () => void): void; | ||
paste(data: string): void; | ||
refresh(start: number, end: number): void; | ||
clearTextureAtlas(): void; | ||
reset(): void; | ||
} | ||
export type CustomKeyEventHandler = (event: KeyboardEvent) => boolean; | ||
@@ -107,0 +39,0 @@ |
@@ -20,3 +20,2 @@ /** | ||
export const isElectron = userAgent.includes('Electron'); | ||
export const isFirefox = userAgent.includes('Firefox'); | ||
@@ -23,0 +22,0 @@ export const isLegacyEdge = userAgent.includes('Edge'); |
@@ -20,3 +20,3 @@ /** | ||
buffers: IBufferSet; | ||
options: ITerminalOptions; | ||
options: Required<ITerminalOptions>; | ||
registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise<boolean>): IDisposable; | ||
@@ -23,0 +23,0 @@ registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise<boolean>): IDisposable; |
@@ -27,3 +27,3 @@ /** | ||
import { CoreTerminal } from 'common/CoreTerminal'; | ||
import { EventEmitter, forwardEvent, IEvent } from 'common/EventEmitter'; | ||
import { EventEmitter, forwardEvent } from 'common/EventEmitter'; | ||
import { ITerminalOptions as IInitializedTerminalOptions } from 'common/services/Services'; | ||
@@ -30,0 +30,0 @@ import { IMarker, ITerminalOptions, ScrollSource } from 'common/Types'; |
Sorry, the diff of this file is too big to display
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
2339135
109
24387