conflict_resolution
stringlengths
27
16k
<<<<<<< var ct: Kiwi.Geom.Transform = camera.transform; ======= // Draw raw bounds and raw center >>>>>>> var ct: Kiwi.Geom.Transform = camera.transform; // Draw raw bounds and raw center <<<<<<< ctx.strokeRect(this.rawBounds.x + ct.x, this.rawBounds.y + ct.y, this.rawBounds.width, this.rawBounds.height); ctx.fillRect(this.rawCenter.x + ct.x - 1, this.rawCenter.y + ct.y - 1, 3, 3); ctx.strokeRect(t.x + ct.x + t.rotPointX - 3, t.y + ct.y + t.rotPointY - 3, 7, 7); ======= ctx.strokeRect(this.rawBounds.x, this.rawBounds.y, this.rawBounds.width, this.rawBounds.height); ctx.fillRect(this.rawCenter.x - 1, this.rawCenter.y - 1, 3, 3); ctx.strokeRect(t.x + t.rotPointX - 3 , t.y + t.rotPointY - 3, 7, 7); // Draw bounds >>>>>>> ctx.fillRect(this.rawCenter.x + ct.x - 1, this.rawCenter.y + ct.y - 1, 3, 3); ctx.strokeRect(t.x + ct.x + t.rotPointX - 3, t.y + ct.y + t.rotPointY - 3, 7, 7); // Draw bounds <<<<<<< ctx.strokeRect(this.bounds.x + ct.x, this.bounds.y + ct.y, this.bounds.width, this.bounds.height); ======= ctx.strokeRect(this.bounds.x, this.bounds.y, this.bounds.width, this.bounds.height); // Draw hitbox >>>>>>> ctx.strokeRect(this.bounds.x + ct.x, this.bounds.y + ct.y, this.bounds.width, this.bounds.height); // Draw hitbox <<<<<<< ctx.strokeRect(this.hitbox.x + ct.x, this.hitbox.y + ct.y, this.hitbox.width, this.hitbox.height); ======= ctx.strokeRect(this.hitbox.x, this.hitbox.y, this.hitbox.width, this.hitbox.height); // Draw raw hitbox >>>>>>> ctx.strokeRect(this.hitbox.x + ct.x, this.hitbox.y + ct.y, this.hitbox.width, this.hitbox.height); // Draw raw hitbox <<<<<<< ctx.strokeRect(this.rawHitbox.x + ct.x, this.rawHitbox.y + ct.y, this.rawHitbox.width, this.rawHitbox.height); ======= ctx.strokeRect(this.rawHitbox.x, this.rawHitbox.y, this.rawHitbox.width, this.rawHitbox.height); // Draw world bounds ctx.strokeStyle = "purple"; ctx.strokeRect(this.worldBounds.x, this.worldBounds.y, this.worldBounds.width, this.worldBounds.height); // Draw world hitbox ctx.strokeStyle = "cyan"; ctx.strokeRect(this.worldHitbox.x, this.worldHitbox.y, this.worldHitbox.width, this.worldHitbox.height); >>>>>>> ctx.strokeRect(this.rawHitbox.x + ct.x, this.rawHitbox.y + ct.y, this.rawHitbox.width, this.rawHitbox.height); // Draw world bounds ctx.strokeStyle = "purple"; ctx.strokeRect(this.worldBounds.x, this.worldBounds.y, this.worldBounds.width, this.worldBounds.height); // Draw world hitbox ctx.strokeStyle = "cyan"; ctx.strokeRect(this.worldHitbox.x, this.worldHitbox.y, this.worldHitbox.width, this.worldHitbox.height);
<<<<<<< let formattedShader = this._beautify(sourceEventArg.state.value); // let formattedShader = sourceEventArg.state.value; ======= const formattedShader = this.beautify(sourceEventArg.state.value); >>>>>>> const formattedShader = this._beautify(sourceEventArg.state.value);
<<<<<<< import { GraphNode } from './graph/graphNodes'; import { CosmosDBAccountNode, INode } from './nodes'; ======= import { CosmosDBAccountNode, INode, IDocumentNode, LoadMoreNode } from './nodes'; >>>>>>> import { CosmosDBAccountNode, INode, IDocumentNode, LoadMoreNode } from './nodes'; <<<<<<< import { GraphViewsManager } from "./graph/GraphViewsManager"; ======= import { DocumentEditor } from './DocumentEditor'; >>>>>>> import { DocumentEditor } from './DocumentEditor'; import { GraphViewsManager } from "./graph/GraphViewsManager"; <<<<<<< let lastCommand: MongoCommand; let lastOpenedDocDBDocument: DocDBDocumentNode; let lastOpenedMongoDocument: MongoDocumentNode; let lastOpenedDocumentType: DocumentType; let graphViewsManager: GraphViewsManager = null; enum DocumentType { Mongo, DocDB }; ======= >>>>>>> let graphViewsManager: GraphViewsManager = null; enum DocumentType { Mongo, DocDB }; <<<<<<< initAsyncCommand(context, 'graph.openExplorer', async (graph: GraphNode) => { if (!graph) { return; // TODO: Ask for context? } await graph.showExplorer(); }); ======= initEvent(context, 'cosmosDB.documentEditor.onDidSaveTextDocument', vscode.workspace.onDidSaveTextDocument, (doc: vscode.TextDocument) => documentEditor.onDidSaveTextDocument(context.globalState, doc)); initEvent(context, 'cosmosDB.documentEditor.onDidCloseTextDocument', vscode.workspace.onDidCloseTextDocument, (doc: vscode.TextDocument) => documentEditor.onDidCloseTextDocument(doc)); >>>>>>> initAsyncCommand(context, 'graph.openExplorer', async (graph: GraphNode) => { if (!graph) { return; // TODO: Ask for context? } await graph.showExplorer(); }); initEvent(context, 'cosmosDB.documentEditor.onDidSaveTextDocument', vscode.workspace.onDidSaveTextDocument, (doc: vscode.TextDocument) => documentEditor.onDidSaveTextDocument(context.globalState, doc)); initEvent(context, 'cosmosDB.documentEditor.onDidCloseTextDocument', vscode.workspace.onDidCloseTextDocument, (doc: vscode.TextDocument) => documentEditor.onDidCloseTextDocument(doc));
<<<<<<< release || notImplemented("public flash.net.SharedObject::static getDiskUsage"); return; ======= somewhatImplemented("public flash.net.SharedObject::static getDiskUsage"); return 0; >>>>>>> release || somewhatImplemented("public flash.net.SharedObject::static getDiskUsage"); return 0; <<<<<<< release || notImplemented("send"); ======= notImplemented("public flash.net.SharedObject::send"); >>>>>>> release || notImplemented("public flash.net.SharedObject::send"); <<<<<<< flush(minDiskSpace: number = 0): string { release || somewhatImplemented("public flash.net.SharedObject::flush"); var value = JSON.stringify(transformASValueToJS(this.sec, this._data, true)); getSharedObjectStorage().setItem(this._path, value); ======= flush(minDiskSpace?: number): string { minDiskSpace = minDiskSpace | 0; somewhatImplemented("public flash.net.SharedObject::flush"); if (!this._pendingFlushId) { return 'flushed'; } clearTimeout(this._pendingFlushId); this._pendingFlushId = 0; // Check if the object is empty. If it is, don't create a stored object if one doesn't exist. var isEmpty = true; for (var key in this._data) { if (this._data.hasOwnProperty(key)) { isEmpty = false; break; } } if (isEmpty && !getSharedObjectStorage().getItem(this._path)) { return; } var serializedData = new this.sec.flash.utils.ByteArray(); serializedData.objectEncoding = this._objectEncoding; serializedData.writeObject(this._data); var bytes = serializedData.getBytes(); var encodedData = StringUtilities.base64EncodeBytes(bytes); if (!release) { var decoded = StringUtilities.decodeRestrictedBase64ToBytes(encodedData); Debug.assert(decoded.byteLength === bytes.byteLength); for (var i = 0; i < decoded.byteLength; i++) { Debug.assert(decoded[i] === bytes[i]); } } getSharedObjectStorage().setItem(this._path, encodedData); >>>>>>> flush(minDiskSpace?: number): string { minDiskSpace = minDiskSpace | 0; release || somewhatImplemented("public flash.net.SharedObject::flush"); if (!this._pendingFlushId) { return 'flushed'; } clearTimeout(this._pendingFlushId); this._pendingFlushId = 0; // Check if the object is empty. If it is, don't create a stored object if one doesn't exist. var isEmpty = true; for (var key in this._data) { if (this._data.hasOwnProperty(key)) { isEmpty = false; break; } } if (isEmpty && !getSharedObjectStorage().getItem(this._path)) { return; } var serializedData = new this.sec.flash.utils.ByteArray(); serializedData.objectEncoding = this._objectEncoding; serializedData.writeObject(this._data); var bytes = serializedData.getBytes(); var encodedData = StringUtilities.base64EncodeBytes(bytes); if (!release) { var decoded = StringUtilities.decodeRestrictedBase64ToBytes(encodedData); Debug.assert(decoded.byteLength === bytes.byteLength); for (var i = 0; i < decoded.byteLength; i++) { Debug.assert(decoded[i] === bytes[i]); } } getSharedObjectStorage().setItem(this._path, encodedData); <<<<<<< release || somewhatImplemented("public flash.net.SharedObject::get size"); return JSON.stringify(this._data).length - 2; ======= somewhatImplemented("public flash.net.SharedObject::get size"); this.flush(0); var storedData = getSharedObjectStorage().getItem(this._path); return storedData ? storedData.length : 0; >>>>>>> release || somewhatImplemented("public flash.net.SharedObject::get size"); this.flush(0); var storedData = getSharedObjectStorage().getItem(this._path); return storedData ? storedData.length : 0;
<<<<<<< import somewhatImplemented = Shumway.Debug.somewhatImplemented; import throwError = Shumway.AVM2.Runtime.throwError; import TextFieldType = flash.text.TextFieldType; import TextFieldAutosize = flash.text.TextFieldAutoSize; ======= import asCoerceString = Shumway.AVM2.Runtime.asCoerceString; >>>>>>> import somewhatImplemented = Shumway.Debug.somewhatImplemented; import throwError = Shumway.AVM2.Runtime.throwError; import asCoerceString = Shumway.AVM2.Runtime.asCoerceString; import TextFieldType = flash.text.TextFieldType; import TextFieldAutosize = flash.text.TextFieldAutoSize; <<<<<<< static initializer: any = function (symbol: TextField) { this._bbox = {xMin: 0, yMin: 0, xMax: 2000, yMax: 2000}; var initialFormat = this._defaultTextFormat = { align: 'LEFT', font: null, face: 'serif', size: 12, letterspacing: 0, kerning: 0, color: 0, leading: 0, bold: false, italic: false }; this._type = 'dynamic'; this._embedFonts = false; this._selectable = true; this._autoSize = 'none'; this._scrollV = 1; this._maxScrollV = 1; this._bottomScrollV = 1; this._background = false; this._border = false; this._backgroundColor = 0xffffff; this._backgroundColorStr = "#ffffff"; this._borderColor = 0x0; this._borderColorStr = "#000000"; this._text = ''; this._htmlText = ''; this._condenseWhite = false; this._multiline = false; this._wordWrap = false; this._textColor = 0; var s = symbol; if (!s) { this._matrix.tx -= 40; this._matrix.ty -= 40; this._text = ''; return; } var tag = s.tag; var bbox = tag.bbox; this._matrix.tx += bbox.xMin; this._matrix.ty += bbox.yMin; this._bbox.xMax = bbox.xMax - bbox.xMin; this._bbox.yMax = bbox.yMax - bbox.yMin; if (tag.hasLayout) { initialFormat.size = tag.fontHeight / 20; initialFormat.leading = (tag.leading | 0) / 20; } if (tag.hasColor) { var colorObj = tag.color; var color = (colorObj.red << 24) | (colorObj.green << 16) | (colorObj.blue << 8) | colorObj.alpha; initialFormat.color = this._textColor = color; } if (tag.hasFont) { var font = Font.getFontBySymbolId(tag.fontId); initialFormat.font = font; initialFormat.face = font._fontName; initialFormat.bold = font.symbol.bold; initialFormat.italic = font.symbol.italic; } this._multiline = !!tag.multiline; this._wordWrap = !!tag.wordWrap; this._embedFonts = !!tag.useOutlines; this._selectable = !tag.noSelect; // TODO: Find out how the IDE causes textfields to have a background this._border = !!tag.border; switch (tag.align) { case 1: initialFormat.align = 'RIGHT'; break; case 2: initialFormat.align = 'CENTER'; break; case 3: initialFormat.align = 'JUSTIFIED'; break; default: // 'left' is pre-set } if (tag.initialText) { if (tag.html) { this._htmlText = tag.initialText; } else { this._text = tag.initialText; } } else { this._text = ''; } }; constructor() { super(); ======= // Called whenever an instance of the class is initialized. static initializer: any = null; // List of static symbols to link. static classSymbols: string [] = null; // []; // List of instance symbols to link. static instanceSymbols: string [] = null; // ["selectedText", "appendText", "getXMLText", "insertXMLText", "copyRichText", "pasteRichText"]; constructor () { false && super(); >>>>>>> static initializer: any = function (symbol: TextField) { this._bbox = {xMin: 0, yMin: 0, xMax: 2000, yMax: 2000}; var initialFormat = this._defaultTextFormat = { align: 'LEFT', font: null, face: 'serif', size: 12, letterspacing: 0, kerning: 0, color: 0, leading: 0, bold: false, italic: false }; this._type = 'dynamic'; this._embedFonts = false; this._selectable = true; this._autoSize = 'none'; this._scrollV = 1; this._maxScrollV = 1; this._bottomScrollV = 1; this._background = false; this._border = false; this._backgroundColor = 0xffffff; this._backgroundColorStr = "#ffffff"; this._borderColor = 0x0; this._borderColorStr = "#000000"; this._text = ''; this._htmlText = ''; this._condenseWhite = false; this._multiline = false; this._wordWrap = false; this._textColor = 0; var s = symbol; if (!s) { this._matrix.tx -= 40; this._matrix.ty -= 40; this._text = ''; return; } var tag = s.tag; var bbox = tag.bbox; this._matrix.tx += bbox.xMin; this._matrix.ty += bbox.yMin; this._bbox.xMax = bbox.xMax - bbox.xMin; this._bbox.yMax = bbox.yMax - bbox.yMin; if (tag.hasLayout) { initialFormat.size = tag.fontHeight / 20; initialFormat.leading = (tag.leading | 0) / 20; } if (tag.hasColor) { var colorObj = tag.color; var color = (colorObj.red << 24) | (colorObj.green << 16) | (colorObj.blue << 8) | colorObj.alpha; initialFormat.color = this._textColor = color; } if (tag.hasFont) { var font = Font.getFontBySymbolId(tag.fontId); initialFormat.font = font; initialFormat.face = font._fontName; initialFormat.bold = font.symbol.bold; initialFormat.italic = font.symbol.italic; } this._multiline = !!tag.multiline; this._wordWrap = !!tag.wordWrap; this._embedFonts = !!tag.useOutlines; this._selectable = !tag.noSelect; // TODO: Find out how the IDE causes textfields to have a background this._border = !!tag.border; switch (tag.align) { case 1: initialFormat.align = 'RIGHT'; break; case 2: initialFormat.align = 'CENTER'; break; case 3: initialFormat.align = 'JUSTIFIED'; break; default: // 'left' is pre-set } if (tag.initialText) { if (tag.html) { this._htmlText = tag.initialText; } else { this._text = tag.initialText; } } else { this._text = ''; } }; constructor() { super(); <<<<<<< somewhatImplemented("flash.text.TextField.isFontCompatible"); return true; } _alwaysShowSelection: boolean = false; _antiAliasType: string = 'normal'; _autoSize: string = 'none'; _background: boolean = false; _backgroundColor: number /*uint*/ = 0xFFFFFF; _border: boolean = false; _borderColor: number /*uint*/ = 0x000000; _bbox: {xMin: number; xMax: number; yMin: number; yMax: number}; _lines: TextLineMetrics[]; _dimensionsValid: boolean; _bottomScrollV: number /*int*/ = 0; ======= fontName = asCoerceString(fontName); fontStyle = asCoerceString(fontStyle); notImplemented("public flash.text.TextField::static isFontCompatible"); return; } // _alwaysShowSelection: boolean; // _antiAliasType: string; // _autoSize: string; // _background: boolean; // _backgroundColor: number /*uint*/; // _border: boolean; // _borderColor: number /*uint*/; // _bottomScrollV: number /*int*/; >>>>>>> fontName = asCoerceString(fontName); fontStyle = asCoerceString(fontStyle); somewhatImplemented("flash.text.TextField.isFontCompatible"); return true; } _alwaysShowSelection: boolean = false; _antiAliasType: string = 'normal'; _autoSize: string = 'none'; _background: boolean = false; _backgroundColor: number /*uint*/ = 0xFFFFFF; _border: boolean = false; _borderColor: number /*uint*/ = 0x000000; _bbox: {xMin: number; xMax: number; yMin: number; yMax: number}; _lines: TextLineMetrics[]; _dimensionsValid: boolean; _bottomScrollV: number /*int*/ = 0; <<<<<<< somewhatImplemented("public flash.text.TextField::set antiAliasType"); this._antiAliasType = antiAliasType === 'advanced' ? 'advanced' : 'normal'; ======= antiAliasType = asCoerceString(antiAliasType); notImplemented("public flash.text.TextField::set antiAliasType"); return; // this._antiAliasType = antiAliasType; >>>>>>> somewhatImplemented("public flash.text.TextField::set antiAliasType"); this._antiAliasType = asCoerceString(antiAliasType) === 'advanced' ? 'advanced' : 'normal'; <<<<<<< if (!TextFieldAutoSize.validValues[value]) { throwError("ArgumentError", Errors.InvalidParamError, "autoSize"); } this._autoSize = value + ''; ======= value = asCoerceString(value); notImplemented("public flash.text.TextField::set autoSize"); return; // this._autoSize = value; >>>>>>> value = asCoerceString(value); if (!TextFieldAutoSize.validValues[value]) { throwError("ArgumentError", Errors.InvalidParamError, "autoSize"); } this._autoSize = value; <<<<<<< somewhatImplemented("public flash.text.TextField::set gridFitType"); this._gridFitType = "" + gridFitType; ======= gridFitType = asCoerceString(gridFitType); notImplemented("public flash.text.TextField::set gridFitType"); return; // this._gridFitType = gridFitType; >>>>>>> gridFitType = asCoerceString(gridFitType); somewhatImplemented("public flash.text.TextField::set gridFitType"); this._gridFitType = "" + gridFitType; <<<<<<< this._htmlText = value + ''; this._text = ''; this.invalidateDimensions(); ======= value = asCoerceString(value); notImplemented("public flash.text.TextField::set htmlText"); return; // this._htmlText = value; >>>>>>> this._htmlText = asCoerceString(value); this._text = ''; this.invalidateDimensions(); <<<<<<< somewhatImplemented("public flash.text.TextField::set restrict"); this._restrict = "" + value; ======= value = asCoerceString(value); notImplemented("public flash.text.TextField::set restrict"); return; // this._restrict = value; >>>>>>> somewhatImplemented("public flash.text.TextField::set restrict"); this._restrict = asCoerceString(value); <<<<<<< this._text = value + ""; this._htmlText = ''; this.invalidateDimensions(); ======= value = asCoerceString(value); notImplemented("public flash.text.TextField::set text"); return; // this._text = value; >>>>>>> this._text = asCoerceString(value); this._htmlText = ''; this.invalidateDimensions(); <<<<<<< value = "" + value; if (value !== TextFieldType.DYNAMIC && value !== TextFieldType.INPUT) { throwError("ArgumentError", Errors.InvalidParamError, "type"); } somewhatImplemented("public flash.text.TextField::set type"); this._type = value; ======= value = asCoerceString(value); notImplemented("public flash.text.TextField::set type"); return; // this._type = value; >>>>>>> value = asCoerceString(value); if (value !== TextFieldType.DYNAMIC && value !== TextFieldType.INPUT) { throwError("ArgumentError", Errors.InvalidParamError, "type"); } somewhatImplemented("public flash.text.TextField::set type"); this._type = value; <<<<<<< value = "" + value; somewhatImplemented("public flash.text.TextField::replaceSelectedText"); var text = this._text; this.text = text.substring(0, this._selectionBeginIndex) + value + text.substring(this._selectionEndIndex); ======= value = asCoerceString(value); notImplemented("public flash.text.TextField::replaceSelectedText"); return; >>>>>>> value = asCoerceString(value); somewhatImplemented("public flash.text.TextField::replaceSelectedText"); var text = this._text; this.text = text.substring(0, this._selectionBeginIndex) + value + text.substring(this._selectionEndIndex); <<<<<<< beginIndex |= 0; endIndex |= 0; newText = "" + newText; somewhatImplemented("public flash.text.TextField::replaceText"); var text = this._text; this.text = text.substring(0, beginIndex) + newText + text.substring(endIndex); ======= beginIndex = beginIndex | 0; endIndex = endIndex | 0; newText = asCoerceString(newText); notImplemented("public flash.text.TextField::replaceText"); return; >>>>>>> beginIndex |= 0; endIndex |= 0; newText = "" + newText; somewhatImplemented("public flash.text.TextField::replaceText"); var text = this._text; this.text = text.substring(0, beginIndex) + newText + text.substring(endIndex); <<<<<<< id = "" + id; notImplemented("public flash.text.TextField::getImageReference"); return; ======= id = asCoerceString(id); notImplemented("public flash.text.TextField::getImageReference"); return; >>>>>>> id = asCoerceString(id); notImplemented("public flash.text.TextField::getImageReference"); return null;
<<<<<<< stack = [this]; var transformStack: Matrix []; var calculateTransform = !!transform; if (calculateTransform) { transformStack = [transform]; } var flagsStack: FrameFlags [] = [flags]; while (stack.length > 0) { frame = stack.pop(); if (calculateTransform) { transform = transformStack.pop(); } flags = flagsStack.pop(); if (frame instanceof FrameContainer) { frameContainer = <FrameContainer>frame; for (var i = frameContainer.children.length - 1; i >= 0; i--) { var child = frameContainer.children[i]; if (visibleOnly && !child.isVisible) { continue; } stack.push(child); if (calculateTransform) { ======= if (transform) { stack = [this]; var transforms: Matrix []; transforms = [transform]; while (stack.length > 0) { frame = stack.pop(); transform = transforms.pop(); if (frame instanceof FrameContainer) { frameContainer = <FrameContainer>frame; for (var i = frameContainer.children.length - 1; i >= 0; i--) { var child = frameContainer.children[i]; if (!child) { continue; } if (visibleOnly && !child.isVisible) { continue; } stack.push(child); >>>>>>> stack = [this]; var transformStack: Matrix []; var calculateTransform = !!transform; if (calculateTransform) { transformStack = [transform]; } var flagsStack: FrameFlags [] = [flags]; while (stack.length > 0) { frame = stack.pop(); if (calculateTransform) { transform = transformStack.pop(); } flags = flagsStack.pop(); if (frame instanceof FrameContainer) { frameContainer = <FrameContainer>frame; for (var i = frameContainer.children.length - 1; i >= 0; i--) { var child = frameContainer.children[i]; if (!child || (visibleOnly && !child.isVisible)) { continue; } stack.push(child); if (calculateTransform) { <<<<<<< child.parent = this; child.invalidate(); ======= if (child) { child.parent = this; } >>>>>>> if (child) { child.parent = this; child.invalidate(); } <<<<<<< assert(index > 0); child.parent = this; child.invalidate(); if (index >= this.children.length) { ======= assert(index >= 0 && index <= this.children.length); if (index === this.children.length) { >>>>>>> assert(index >= 0 && index <= this.children.length); if (index === this.children.length) { <<<<<<< child.gatherPreviousDirtyRegions(); this.children.splice(index, 1); child.parent = undefined; child.invalidate(); ======= this.removeChildAt(index); >>>>>>> this.removeChildAt(index)
<<<<<<< var character = DisplayObject.createAnimatedDisplayObject(state, false); this.addChildAtDepth(character, state.depth); if (state.symbol.isAS2Object) { this._initAvm1Bindings(character, state); } } } _initAvm1Bindings(instance: DisplayObject, state: Shumway.Timeline.AnimationState) { var getAS2Object = Shumway.AVM2.AS.avm1lib.getAS2Object; var instanceAS2Object = getAS2Object(instance); assert(instanceAS2Object); if (state.variableName) { instanceAS2Object.asSetPublicProperty('variable', state.variableName); } var events = state.events; if (events) { var eventsBound = []; for (var i = 0; i < events.length; i++) { var event = events[i]; var eventNames = event.eventNames; var fn = event.handler.bind(instance); for (var j = 0; j < eventNames.length; j++) { var eventName = eventNames[j]; var avm2EventTarget = instance; if (eventName === 'mouseDown' || eventName === 'mouseUp' || eventName === 'mouseMove') { avm2EventTarget = instance.stage; } avm2EventTarget.addEventListener(eventName, fn, false); eventsBound.push({eventName: eventName, fn: fn, target: avm2EventTarget}); } } if (eventsBound.length > 0) { instance.addEventListener('removed', function (eventsBound) { for (var i = 0; i < eventsBound.length; i++) { eventsBound[i].target.removeEventListener(eventsBound[i].eventName, eventsBound[i].fn, false); } }.bind(instance, eventsBound), false); } } // Only set the name property for display objects that have AS2 // reflections. Some SWFs contain AS2 names for things like Shapes. if (state.name) { var parentAS2Object = getAS2Object(this); parentAS2Object.asSetPublicProperty(state.name, instanceAS2Object); ======= if (state) { var character = DisplayObject.createAnimatedDisplayObject(state, false); this.addChildAtDepth(character, state.depth); } >>>>>>> if (state) { var character = DisplayObject.createAnimatedDisplayObject(state, false); this.addChildAtDepth(character, state.depth); if (state.symbol.isAS2Object) { this._initAvm1Bindings(character, state); } } } } _initAvm1Bindings(instance: DisplayObject, state: Shumway.Timeline.AnimationState) { var getAS2Object = Shumway.AVM2.AS.avm1lib.getAS2Object; var instanceAS2Object = getAS2Object(instance); assert(instanceAS2Object); if (state.variableName) { instanceAS2Object.asSetPublicProperty('variable', state.variableName); } var events = state.events; if (events) { var eventsBound = []; for (var i = 0; i < events.length; i++) { var event = events[i]; var eventNames = event.eventNames; var fn = event.handler.bind(instance); for (var j = 0; j < eventNames.length; j++) { var eventName = eventNames[j]; var avm2EventTarget = instance; if (eventName === 'mouseDown' || eventName === 'mouseUp' || eventName === 'mouseMove') { avm2EventTarget = instance.stage; } avm2EventTarget.addEventListener(eventName, fn, false); eventsBound.push({eventName: eventName, fn: fn, target: avm2EventTarget}); } } if (eventsBound.length > 0) { instance.addEventListener('removed', function (eventsBound) { for (var i = 0; i < eventsBound.length; i++) { eventsBound[i].target.removeEventListener(eventsBound[i].eventName, eventsBound[i].fn, false); } }.bind(instance, eventsBound), false); } } // Only set the name property for display objects that have AS2 // reflections. Some SWFs contain AS2 names for things like Shapes. if (state.name) { var parentAS2Object = getAS2Object(this); parentAS2Object.asSetPublicProperty(state.name, instanceAS2Object);
<<<<<<< return this._loaderUrl; ======= if (!this._loader) { // For the instance of the main class of the SWF file, this URL is the // same as the SWF file's own URL. // The loaderURL value can be changed by player settings. var service: IRootElementService = Shumway.AVM2.Runtime.AVM2.instance.globals['Shumway.Player.Utils']; return (this.url === service.swfUrl && service.loaderUrl) || this.url; } return this._loader.loaderInfo.url; >>>>>>> if (!this._loader) { // For the instance of the main class of the SWF file, this URL is the // same as the SWF file's own URL. // The loaderURL value can be changed by player settings. var service: IRootElementService = Shumway.AVM2.Runtime.AVM2.instance.globals['Shumway.Player.Utils']; return (this.url === service.swfUrl && service.loaderUrl) || this.url; } return this._loaderUrl;
<<<<<<< PathPaymentOperation: { destinationAccount: resolvers.account, destinationAsset: resolvers.asset, sourceAsset: resolvers.asset, path: resolvers.asset }, CreatePassiveSellOfferOperation: { assetBuying: resolvers.asset, assetSelling: resolvers.asset }, ManageSellOfferOperation: { assetBuying: resolvers.asset, assetSelling: resolvers.asset }, ======= PathPaymentOperation: { destinationAccount: resolvers.account, destinationAsset: resolvers.asset, sourceAsset: resolvers.asset, }, PathPaymentStrictSendOperation: { destinationAccount: resolvers.account, destinationAsset: resolvers.asset, sourceAsset: resolvers.asset, }, >>>>>>> PathPaymentOperation: { destinationAccount: resolvers.account, destinationAsset: resolvers.asset, sourceAsset: resolvers.asset, path: resolvers.asset }, CreatePassiveSellOfferOperation: { assetBuying: resolvers.asset, assetSelling: resolvers.asset }, ManageSellOfferOperation: { assetBuying: resolvers.asset, assetSelling: resolvers.asset }, PathPaymentStrictSendOperation: { destinationAccount: resolvers.account, destinationAsset: resolvers.asset, sourceAsset: resolvers.asset },
<<<<<<< ======= if (hasBits & UpdateFrameTagBits.HasColorTransform) { frame.colorMatrix = this._readColorMatrix(); } if (hasBits & UpdateFrameTagBits.HasMiscellaneousProperties) { frame.blendMode = input.readInt(); // TODO: Should make a proper flag for this. input.readBoolean(); // Visibility // frame.alpha = input.readBoolean() ? 1 : 0; } if (cacheAsBitmap) { this._cacheAsBitmap(frame); } } private _cacheAsBitmap(frame) { var canvas = document.createElement('canvas'); var bounds = frame.getBounds(); canvas.width = bounds.w; canvas.height = bounds.h; var stage = new Stage(bounds.w, bounds.h); stage.addChild(frame); var renderer = new Canvas2DStageRenderer(canvas, stage); renderer.render(); >>>>>>> if (cacheAsBitmap) { this._cacheAsBitmap(frame); } } private _cacheAsBitmap(frame) { var canvas = document.createElement('canvas'); var bounds = frame.getBounds(); canvas.width = bounds.w; canvas.height = bounds.h; var stage = new Stage(bounds.w, bounds.h); stage.addChild(frame); var renderer = new Canvas2DStageRenderer(canvas, stage); renderer.render();
<<<<<<< operations(first: Int, after: String, last: Int, before: String, order: Order): OperationConnection ======= operation(id: String): Operation operations(first: Int, after: String, last: Int, before: String): OperationConnection >>>>>>> operations(first: Int, after: String, last: Int, before: String, order: Order): OperationConnection operation(id: String): Operation
<<<<<<< child.dispatchEvent(addedEvent); // ADDED event handlers may remove the child from the stage, in such cases // we should not dispatch the ADDED_TO_STAGE event. ======= child.dispatchEvent(Event.getInstance(Event.ADDED, true)); >>>>>>> child.dispatchEvent(Event.getInstance(Event.ADDED, true)); // ADDED event handlers may remove the child from the stage, in such cases // we should not dispatch the ADDED_TO_STAGE event.
<<<<<<< static staticBindings: string [] = null; // []; static bindings: string [] = null; // []; constructor(font: string = null, size: ASObject = null, color: ASObject = null, bold: ASObject = null, italic: ASObject = null, underline: ASObject = null, url: string = null, target: string = null, align: string = null, leftMargin: ASObject = null, rightMargin: ASObject = null, indent: ASObject = null, leading: ASObject = null) { font = "" + font; size = size; color = color; bold = bold; italic = italic; underline = underline; url = "" + url; target = "" + target; align = "" + align; leftMargin = leftMargin; rightMargin = rightMargin; indent = indent; leading = leading; ======= // List of static symbols to link. static classSymbols: string [] = null; // []; // List of instance symbols to link. static instanceSymbols: string [] = null; // []; constructor (font: string = null, size: ASObject = null, color: ASObject = null, bold: ASObject = null, italic: ASObject = null, underline: ASObject = null, url: string = null, target: string = null, align: string = null, leftMargin: ASObject = null, rightMargin: ASObject = null, indent: ASObject = null, leading: ASObject = null) { font = asCoerceString(font); size = size; color = color; bold = bold; italic = italic; underline = underline; url = asCoerceString(url); target = asCoerceString(target); align = asCoerceString(align); leftMargin = leftMargin; rightMargin = rightMargin; indent = indent; leading = leading; >>>>>>> static classSymbols: string [] = null; // []; static instanceSymbols: string [] = null; // []; constructor(font: string = null, size: ASObject = null, color: ASObject = null, bold: ASObject = null, italic: ASObject = null, underline: ASObject = null, url: string = null, target: string = null, align: string = null, leftMargin: ASObject = null, rightMargin: ASObject = null, indent: ASObject = null, leading: ASObject = null) { font = "" + font; size = size; color = color; bold = bold; italic = italic; underline = underline; url = "" + url; target = "" + target; align = "" + align; leftMargin = leftMargin; rightMargin = rightMargin; indent = indent; leading = leading; <<<<<<< this._align = value + ''; ======= value = asCoerceString(value); notImplemented("public flash.text.TextFormat::set align"); return; // this._align = value; >>>>>>> this._align = asCoerceString(value); <<<<<<< this._display = value + ''; ======= value = asCoerceString(value); notImplemented("public flash.text.TextFormat::set display"); return; // this._display = value; >>>>>>> this._display = asCoerceString(value); <<<<<<< this._font = value + ''; ======= value = asCoerceString(value); notImplemented("public flash.text.TextFormat::set font"); return; // this._font = value; >>>>>>> this._font = asCoerceString(value); <<<<<<< this._target = value + ''; ======= value = asCoerceString(value); notImplemented("public flash.text.TextFormat::set target"); return; // this._target = value; >>>>>>> this._target = asCoerceString(value); <<<<<<< this._url = value + ''; ======= value = asCoerceString(value); notImplemented("public flash.text.TextFormat::set url"); return; // this._url = value; >>>>>>> this._url = asCoerceString(value);
<<<<<<< this._server = new Remoting.Server(this._frameContainer); this._keyboardEventDispatcher = new KeyboardEventDispatcher(); ======= this._context = new Shumway.Remoting.Server.ChannelDeserializerContext(this._frameContainer); >>>>>>> this._keyboardEventDispatcher = new KeyboardEventDispatcher(); this._context = new Shumway.Remoting.Server.ChannelDeserializerContext(this._frameContainer);
<<<<<<< public events: any [] = null, public variableName: string = null) { ======= public events: any [] = null) { if (matrix && symbol instanceof TextSymbol) { this.matrix = this.matrix.clone(); this.matrix.translate(-40, -40); } >>>>>>> public events: any [] = null, public variableName: string = null) { if (matrix && symbol instanceof TextSymbol) { this.matrix = this.matrix.clone(); this.matrix.translate(-40, -40); } <<<<<<< if (cmd.hasEvents && this.loaderInfo._allowCodeExecution && this.loaderInfo._actionScriptVersion === ActionScriptVersion.ACTIONSCRIPT2) { var loaderInfo = this.loaderInfo; var swfEvents = cmd.events; events = []; for (var i = 0; i < swfEvents.length; i++) { var swfEvent = swfEvents[i]; if (swfEvent.eoe) { break; } var actionsData = new AVM1.AS2ActionsData(swfEvent.actionsData, 's' + cmd.symbolId + 'e' + i); var fn = (function (actionsData, loaderInfo) { return function() { var avm1Context = loaderInfo._avm1Context; var as2Object = Shumway.AVM2.AS.avm1lib.getAS2Object(this); return avm1Context.executeActions(actionsData, this.stage, as2Object); }; })(actionsData, loaderInfo); var eventNames = []; for (var eventName in swfEvent) { if (eventName.indexOf("on") !== 0 || !swfEvent[eventName]) { continue; } var avm2EventName = eventName[2].toLowerCase() + eventName.substring(3); if (avm2EventName === 'enterFrame') { avm2EventName = 'frameConstructed'; } eventNames.push(avm2EventName); } events.push({ eventNames: eventNames, handler: fn, keyPress: swfEvent.keyPress }); } ======= if (cmd.flags & PlaceObjectFlags.HasClipActions) { // TODO >>>>>>> if ((cmd.flags & PlaceObjectFlags.HasClipActions) && loaderInfo._allowCodeExecution && loaderInfo._actionScriptVersion === ActionScriptVersion.ACTIONSCRIPT2) { var swfEvents = cmd.events; events = []; for (var i = 0; i < swfEvents.length; i++) { var swfEvent = swfEvents[i]; if (swfEvent.eoe) { break; } var actionsData = new AVM1.AS2ActionsData(swfEvent.actionsData, 's' + cmd.symbolId + 'e' + i); var fn = (function (actionsData, loaderInfo) { return function() { var avm1Context = loaderInfo._avm1Context; var as2Object = Shumway.AVM2.AS.avm1lib.getAS2Object(this); return avm1Context.executeActions(actionsData, this.stage, as2Object); }; })(actionsData, loaderInfo); var eventNames = []; for (var eventName in swfEvent) { if (eventName.indexOf("on") !== 0 || !swfEvent[eventName]) { continue; } var avm2EventName = eventName[2].toLowerCase() + eventName.substring(3); if (avm2EventName === 'enterFrame') { avm2EventName = 'frameConstructed'; } eventNames.push(avm2EventName); } events.push({ eventNames: eventNames, handler: fn, keyPress: swfEvent.keyPress }); } <<<<<<< cmd.cache, cmd.hasVisibility ? !!cmd.visibility : true, events, cmd.variableName ======= !!(cmd.flags & PlaceObjectFlags.HasCacheAsBitmap), cmd.flags & PlaceObjectFlags.HasVisible ? !!cmd.visibility : true, events >>>>>>> !!(cmd.flags & PlaceObjectFlags.HasCacheAsBitmap), cmd.flags & PlaceObjectFlags.HasVisible ? !!cmd.visibility : true, events, cmd.variableName
<<<<<<< ======= import notImplemented = Shumway.Debug.notImplemented; import asCoerceString = Shumway.AVM2.Runtime.asCoerceString; >>>>>>> <<<<<<< static staticBindings: string [] = null; static bindings: string [] = null; constructor() { super(); ======= // List of static symbols to link. static classSymbols: string [] = null; // []; // List of instance symbols to link. static instanceSymbols: string [] = null; // []; constructor () { false && super(); notImplemented("Dummy Constructor: public flash.text.TextInteractionMode"); >>>>>>> static classSymbols: string [] = null; static instanceSymbols: string [] = null; constructor() { super();
<<<<<<< static classInitializer: any = function () { Event = flash.events.Event; }; static initializer: any = null; ======= static classInitializer: any = null; static initializer: any = function () { var self: DisplayObjectContainer = this; self._tabChildren = true; self._mouseChildren = true; self._children = []; }; >>>>>>> static classInitializer: any = function () { Event = flash.events.Event; }; static initializer: any = function () { var self: DisplayObjectContainer = this; self._tabChildren = true; self._mouseChildren = true; self._children = []; };
<<<<<<< _dirty() { if (this._parent) { this._propagateFlags(DisplayObjectFlags.DirtyChild, Direction.Upward); } } /** * WIP */ ======= >>>>>>> _dirty() { if (this._parent) { this._propagateFlags(DisplayObjectFlags.DirtyChild, Direction.Upward); } }
<<<<<<< ======= import notImplemented = Shumway.Debug.notImplemented; import asCoerceString = Shumway.AVM2.Runtime.asCoerceString; >>>>>>> <<<<<<< static staticBindings: string [] = null; static bindings: string [] = null; constructor() { super(); ======= // List of static symbols to link. static classSymbols: string [] = null; // []; // List of instance symbols to link. static instanceSymbols: string [] = null; // []; constructor () { false && super(); notImplemented("Dummy Constructor: public flash.text.FontStyle"); >>>>>>> static classSymbols: string [] = null; static instanceSymbols: string [] = null; constructor() { super();
<<<<<<< ======= import notImplemented = Shumway.Debug.notImplemented; import asCoerceString = Shumway.AVM2.Runtime.asCoerceString; >>>>>>> <<<<<<< static staticBindings: string [] = null; static bindings: string [] = null; constructor() { super(); ======= // List of static symbols to link. static classSymbols: string [] = null; // []; // List of instance symbols to link. static instanceSymbols: string [] = null; // []; constructor () { false && super(); notImplemented("Dummy Constructor: public flash.text.TextFormatAlign"); >>>>>>> static classSymbols: string [] = null; static instanceSymbols: string [] = null; constructor() { super();
<<<<<<< import { Colors, Layout } from "../../../../style"; ======= import layout from "../../../../style/layout"; >>>>>>> import { Layout } from "../../../../style"; <<<<<<< }, track: { height: 2, borderRadius: 1 }, thumb: { width: SIZE_THUMB_SLIDER, height: SIZE_THUMB_SLIDER, borderRadius: SIZE_THUMB_SLIDER / 2, backgroundColor: Colors.linkGreen, shadowOffset: { width: 0, height: 2 }, shadowRadius: 2, shadowOpacity: 0.35 ======= >>>>>>>
<<<<<<< import { Balance, ITrade, Operation, PaymentOperations, Transaction } from "../../model"; ======= import { IHorizonOperationData, IHorizonTradeData, IHorizonTransactionData } from "../../datasource/types"; import { IBalance, Operation, Trade, Transaction } from "../../model"; >>>>>>> import { IBalance, ITrade, Operation, PaymentOperations, Transaction } from "../../model"; <<<<<<< import { Account, Offer } from "../../orm/entities"; import { OperationData as StorageOperationData, ITradeData as IStorageTradeData, ITransactionData as IStorageTransactionData } from "../../storage/types"; ======= import { Account, Asset, Offer, TrustLine } from "../../orm/entities"; >>>>>>> import { Account, Asset, Offer, TrustLine } from "../../orm/entities"; import { OperationData as StorageOperationData, ITradeData as IStorageTradeData, ITransactionData as IStorageTransactionData } from "../../storage/types";
<<<<<<< this.glTexture.dispose(WebGLCapabilities.webgl); ======= if (this._isBuiltin) { return; } this.glTexture.dispose(WebGLKit.webgl); >>>>>>> if (this._isBuiltin) { return; } this.glTexture.dispose(WebGLCapabilities.webgl);
<<<<<<< textAlignmentProperty, textTransformProperty ======= >>>>>>> <<<<<<< import { TextAlignment } from '@nativescript/core/ui/text-base'; ======= import { TextTransform, textTransformProperty } from '@nativescript/core/ui/text-base'; >>>>>>> import { TextTransform, textAlignmentProperty , textTransformProperty } from '@nativescript/core/ui/text-base';
<<<<<<< ======= type SortOrder = "desc" | "asc"; interface IForwardPagingParams { first: number; after: string; } interface IBackwardPagingParams { last: number; before: string; } type PagingParams = IForwardPagingParams & IBackwardPagingParams; >>>>>>> interface IForwardPagingParams { first: number; after: string; } interface IBackwardPagingParams { last: number; before: string; } type PagingParams = IForwardPagingParams & IBackwardPagingParams; <<<<<<< public async getAccountOperations( accountId: AccountID, limit = 10, order: SortOrder = SortOrder.DESC, cursor?: string ) { ======= public async getPayments(pagingParams: PagingParams): Promise<IHorizonOperationData[]> { const records = await this.request("payments", { ...this.parseCursorPagination(pagingParams), cacheTtl: 5 }); if (pagingParams.last && pagingParams.before) { return records.reverse(); } return records; } public async getAccountPayments(accountId: AccountID, pagingParams: PagingParams): Promise<IHorizonOperationData[]> { const records = await this.request(`accounts/${accountId}/payments`, { ...this.parseCursorPagination(pagingParams), cacheTtl: 5 }); if (pagingParams.last && pagingParams.before) { return records.reverse(); } return records; } public async getLedgerPayments(ledgerSeq: number, pagingParams: PagingParams): Promise<IHorizonOperationData[]> { const records = await this.request(`ledgers/${ledgerSeq}/payments`, { ...this.parseCursorPagination(pagingParams), cacheTtl: 5 }); if (pagingParams.last && pagingParams.before) { return records.reverse(); } return records; } public async getTransactionPayments( transactionId: string, pagingParams: PagingParams ): Promise<IHorizonOperationData[]> { const records = await this.request(`transactions/${transactionId}/payments`, { ...this.parseCursorPagination(pagingParams), cacheTtl: 5 }); if (pagingParams.last && pagingParams.before) { return records.reverse(); } return records; } public async getAccountOperations(accountId: AccountID, limit = 10, order: SortOrder = "desc", cursor?: string) { >>>>>>> public async getPayments(pagingParams: PagingParams): Promise<IHorizonOperationData[]> { const records = await this.request("payments", { ...this.parseCursorPagination(pagingParams), cacheTtl: 5 }); if (pagingParams.last && pagingParams.before) { return records.reverse(); } return records; } public async getAccountPayments(accountId: AccountID, pagingParams: PagingParams): Promise<IHorizonOperationData[]> { const records = await this.request(`accounts/${accountId}/payments`, { ...this.parseCursorPagination(pagingParams), cacheTtl: 5 }); if (pagingParams.last && pagingParams.before) { return records.reverse(); } return records; } public async getLedgerPayments(ledgerSeq: number, pagingParams: PagingParams): Promise<IHorizonOperationData[]> { const records = await this.request(`ledgers/${ledgerSeq}/payments`, { ...this.parseCursorPagination(pagingParams), cacheTtl: 5 }); if (pagingParams.last && pagingParams.before) { return records.reverse(); } return records; } public async getTransactionPayments( transactionId: string, pagingParams: PagingParams ): Promise<IHorizonOperationData[]> { const records = await this.request(`transactions/${transactionId}/payments`, { ...this.parseCursorPagination(pagingParams), cacheTtl: 5 }); if (pagingParams.last && pagingParams.before) { return records.reverse(); } return records; } public async getAccountOperations( accountId: AccountID, limit = 10, order: SortOrder = SortOrder.DESC, cursor?: string ) {
<<<<<<< /** * Document common VT features here that are currently unsupported */ // @vt: unsupported DCS SIXEL "SIXEL Graphics" "DCS Ps ; Ps ; Ps ; q Pt ST" "Draw SIXEL image starting at cursor position." // @vt: unsupported CSI SL "Scroll Left" "CSI Ps SP @" "Scroll viewport `Ps` times to the left." // @vt: unsupported CSI SR "Scroll Right" "CSI Ps SP A" "Scroll viewport `Ps` times to the right." // @vt: unsupported CSI DECIC "Insert Columns" "CSI Ps ' }" "Insert `Ps` columns at cursor position." // @vt: unsupported CSI DECDC "Delete Columns" "CSI Ps ' ~" "Delete `Ps` columns at cursor position." ======= /** * Max length of the UTF32 input buffer. Real memory consumption is 4 times higher. */ const MAX_PARSEBUFFER_LENGTH = 131072; >>>>>>> /** * Document common VT features here that are currently unsupported */ // @vt: unsupported DCS SIXEL "SIXEL Graphics" "DCS Ps ; Ps ; Ps ; q Pt ST" "Draw SIXEL image starting at cursor position." /** * Max length of the UTF32 input buffer. Real memory consumption is 4 times higher. */ const MAX_PARSEBUFFER_LENGTH = 131072; <<<<<<< // @vt: supported CSI CUU "Cursor Up" "CSI Ps A" "Move cursor `Ps` times up (default=1)." ======= this._parser.setCsiHandler({intermediates: ' ', final: '@'}, params => this.scrollLeft(params)); >>>>>>> // @vt: supported CSI SL "Scroll Left" "CSI Ps SP @" "Scroll viewport `Ps` times to the left." this._parser.setCsiHandler({intermediates: ' ', final: '@'}, params => this.scrollLeft(params)); // @vt: supported CSI CUU "Cursor Up" "CSI Ps A" "Move cursor `Ps` times up (default=1)." <<<<<<< // @vt: supported CSI CUD "Cursor Down" "CSI Ps B" "Move cursor `Ps` times down (default=1)." ======= this._parser.setCsiHandler({intermediates: ' ', final: 'A'}, params => this.scrollRight(params)); >>>>>>> // @vt: supported CSI SR "Scroll Right" "CSI Ps SP A" "Scroll viewport `Ps` times to the right." this._parser.setCsiHandler({intermediates: ' ', final: 'A'}, params => this.scrollRight(params)); // @vt: supported CSI CUD "Cursor Down" "CSI Ps B" "Move cursor `Ps` times down (default=1)."
<<<<<<< export * from "./assets"; export * from "./operations"; export * from "./payments"; export * from "./trades"; export * from "./transactions"; ======= export * from "./effects"; export * from "./order_book"; export * from "./pathfinding"; export * from "./trades"; >>>>>>> export * from "./trades";
<<<<<<< ======= import { NULL_CELL_CHAR, NULL_CELL_CODE, NULL_CELL_WIDTH, CHAR_DATA_CHAR_INDEX, CHAR_DATA_ATTR_INDEX, DEFAULT_ATTR } from './Buffer'; >>>>>>> import { CHAR_DATA_CHAR_INDEX, CHAR_DATA_ATTR_INDEX, DEFAULT_ATTR } from './Buffer';
<<<<<<< import { ITheme, IMarker, IDisposable, ISelectionPosition, ILinkProvider } from 'xterm'; import { DomRenderer } from './renderer/dom/DomRenderer'; ======= import { ITheme, IMarker, IDisposable, ISelectionPosition } from 'xterm'; import { DomRenderer } from 'browser/renderer/dom/DomRenderer'; >>>>>>> import { ITheme, IMarker, IDisposable, ISelectionPosition, ILinkProvider } from 'xterm'; import { DomRenderer } from 'browser/renderer/dom/DomRenderer'; <<<<<<< import { Linkifier2 } from 'browser/Linkifier2'; ======= import { CoreBrowserService } from 'browser/services/CoreBrowserService'; >>>>>>> import { Linkifier2 } from 'browser/Linkifier2'; import { CoreBrowserService } from 'browser/services/CoreBrowserService';
<<<<<<< import { IParsingState, IDcsHandler, IEscapeSequenceParser } from 'common/parser/Types'; import { NULL_CELL_CODE, NULL_CELL_WIDTH, Attributes, FgFlags, BgFlags, Content } from 'common/buffer/Constants'; ======= import { IParsingState, IDcsHandler, IEscapeSequenceParser, IParams } from 'common/parser/Types'; import { NULL_CELL_CODE, NULL_CELL_WIDTH, Attributes, FgFlags, BgFlags } from 'common/buffer/Constants'; >>>>>>> import { IParsingState, IDcsHandler, IEscapeSequenceParser, IParams } from 'common/parser/Types'; import { NULL_CELL_CODE, NULL_CELL_WIDTH, Attributes, FgFlags, BgFlags, Content } from 'common/buffer/Constants'; <<<<<<< public insertChars(params: number[]): void { if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x = this._terminal.cols - 1; } ======= public insertChars(params: IParams): void { >>>>>>> public insertChars(params: IParams): void { if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x = this._terminal.cols - 1; } <<<<<<< public cursorUp(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._moveCursor(0, -param); ======= public cursorUp(params: IParams): void { const param = params.params[0] || 1; this._terminal.buffer.y -= param; if (this._terminal.buffer.y < 0) { this._terminal.buffer.y = 0; } >>>>>>> public cursorUp(params: IParams): void { this._moveCursor(0, -(params.params[0] || 1)); <<<<<<< public cursorDown(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._moveCursor(0, param); ======= public cursorDown(params: IParams): void { const param = params.params[0] || 1; this._terminal.buffer.y += param; if (this._terminal.buffer.y >= this._terminal.rows) { this._terminal.buffer.y = this._terminal.rows - 1; } // If the end of the line is hit, prevent this action from wrapping around to the next line. if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x--; } >>>>>>> public cursorDown(params: IParams): void { this._moveCursor(0, params.params[0] || 1); <<<<<<< public cursorForward(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._moveCursor(param, 0); ======= public cursorForward(params: IParams): void { const param = params.params[0] || 1; this._terminal.buffer.x += param; if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x = this._terminal.cols - 1; } >>>>>>> public cursorForward(params: IParams): void { this._moveCursor(params.params[0] || 1, 0); <<<<<<< public cursorBackward(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._moveCursor(-param, 0); ======= public cursorBackward(params: IParams): void { const param = params.params[0] || 1; // If the end of the line is hit, prevent this action from wrapping around to the next line. if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x--; } this._terminal.buffer.x -= param; if (this._terminal.buffer.x < 0) { this._terminal.buffer.x = 0; } >>>>>>> public cursorBackward(params: IParams): void { this._moveCursor(-(params.params[0] || 1), 0); <<<<<<< public cursorNextLine(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._moveCursor(0, param); ======= public cursorNextLine(params: IParams): void { const param = params.params[0] || 1; this._terminal.buffer.y += param; if (this._terminal.buffer.y >= this._terminal.rows) { this._terminal.buffer.y = this._terminal.rows - 1; } >>>>>>> public cursorNextLine(params: IParams): void { this._moveCursor(0, params.params[0] || 1); <<<<<<< public cursorPrecedingLine(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._moveCursor(0, -param); ======= public cursorPrecedingLine(params: IParams): void { const param = params.params[0] || 1; this._terminal.buffer.y -= param; if (this._terminal.buffer.y < 0) { this._terminal.buffer.y = 0; } >>>>>>> public cursorPrecedingLine(params: IParams): void { this._moveCursor(0, -(params.params[0] || 1)); <<<<<<< public cursorCharAbsolute(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._setCursor(param - 1, this._terminal.buffer.y); ======= public cursorCharAbsolute(params: IParams): void { const param = params.params[0] || 1; this._terminal.buffer.x = param - 1; >>>>>>> public cursorCharAbsolute(params: IParams): void { this._setCursor((params.params[0] || 1) - 1, this._terminal.buffer.y); <<<<<<< public cursorPosition(params: number[]): void { let col: number; const row: number = params[0] - 1; if (params.length >= 2) { col = params[1] - 1; } else { col = 0; } this._setCursor(col, row); ======= public cursorPosition(params: IParams): void { let row: number = params.params[0] - 1; let col: number = (params.length >= 2) ? params.params[1] - 1 : 0; if (row < 0) { row = 0; } else if (row >= this._terminal.rows) { row = this._terminal.rows - 1; } if (col < 0) { col = 0; } else if (col >= this._terminal.cols) { col = this._terminal.cols - 1; } this._terminal.buffer.x = col; this._terminal.buffer.y = row; >>>>>>> public cursorPosition(params: IParams): void { this._setCursor( // col (params.length >= 2) ? (params.params[1] || 1) - 1 : 0, // row (params.params[0] || 1) - 1); <<<<<<< public cursorForwardTab(params: number[]): void { if (this._terminal.buffer.x >= this._terminal.cols) { return; } let param = params[0] || 1; ======= public cursorForwardTab(params: IParams): void { let param = params.params[0] || 1; >>>>>>> public cursorForwardTab(params: IParams): void { if (this._terminal.buffer.x >= this._terminal.cols) { return; } let param = params.params[0] || 1; <<<<<<< public eraseInLine(params: number[]): void { if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x = this._terminal.cols - 1; } switch (params[0]) { ======= public eraseInLine(params: IParams): void { switch (params.params[0]) { >>>>>>> public eraseInLine(params: IParams): void { if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x = this._terminal.cols - 1; } switch (params.params[0]) { <<<<<<< public charPosAbsolute(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._setCursor(param - 1, this._terminal.buffer.y); ======= public charPosAbsolute(params: IParams): void { const param = params.params[0] || 1; this._terminal.buffer.x = param - 1; if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x = this._terminal.cols - 1; } >>>>>>> public charPosAbsolute(params: IParams): void { this._setCursor((params.params[0] || 1) - 1, this._terminal.buffer.y); <<<<<<< public hPositionRelative(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._moveCursor(param, 0); ======= public hPositionRelative(params: IParams): void { const param = params.params[0] || 1; this._terminal.buffer.x += param; if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x = this._terminal.cols - 1; } >>>>>>> public hPositionRelative(params: IParams): void { this._moveCursor(params.params[0] || 1, 0); <<<<<<< public linePosAbsolute(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._setCursor(this._terminal.buffer.x, param - 1); ======= public linePosAbsolute(params: IParams): void { const param = params.params[0] || 1; this._terminal.buffer.y = param - 1; if (this._terminal.buffer.y >= this._terminal.rows) { this._terminal.buffer.y = this._terminal.rows - 1; } >>>>>>> public linePosAbsolute(params: IParams): void { this._setCursor(this._terminal.buffer.x, (params.params[0] || 1) - 1); <<<<<<< public vPositionRelative(params: number[]): void { let param = params[0]; if (param < 1) { param = 1; } this._moveCursor(0, param); ======= public vPositionRelative(params: IParams): void { const param = params.params[0] || 1; this._terminal.buffer.y += param; if (this._terminal.buffer.y >= this._terminal.rows) { this._terminal.buffer.y = this._terminal.rows - 1; } // If the end of the line is hit, prevent this action from wrapping around to the next line. if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x--; } >>>>>>> public vPositionRelative(params: IParams): void { this._moveCursor(0, params.params[0] || 1); <<<<<<< public hVPosition(params: number[]): void { this.cursorPosition(params); ======= public hVPosition(params: IParams): void { const row = params.params[0] || 1; const col = (params.length > 1) ? params.params[1] || 1 : 1; this._terminal.buffer.y = row - 1; if (this._terminal.buffer.y >= this._terminal.rows) { this._terminal.buffer.y = this._terminal.rows - 1; } this._terminal.buffer.x = col - 1; if (this._terminal.buffer.x >= this._terminal.cols) { this._terminal.buffer.x = this._terminal.cols - 1; } >>>>>>> public hVPosition(params: IParams): void { this.cursorPosition(params);
<<<<<<< private _screenDprMonitor: ScreenDprMonitor; ======= private _isPaused: boolean = false; private _needsFullRefresh: boolean = false; >>>>>>> private _screenDprMonitor: ScreenDprMonitor; private _isPaused: boolean = false; private _needsFullRefresh: boolean = false; <<<<<<< this._screenDprMonitor = new ScreenDprMonitor(); this._screenDprMonitor.setListener(() => this.onWindowResize(window.devicePixelRatio)); ======= // Detect whether IntersectionObserver is detected and enable renderer pause // and resume based on terminal visibility if so if ('IntersectionObserver' in window) { const observer = new IntersectionObserver(e => this.onIntersectionChange(e[0]), {threshold: 0}); observer.observe(this._terminal.element); } } public onIntersectionChange(entry: IntersectionObserverEntry): void { this._isPaused = entry.intersectionRatio === 0; if (!this._isPaused && this._needsFullRefresh) { this._terminal.refresh(0, this._terminal.rows - 1); } >>>>>>> this._screenDprMonitor = new ScreenDprMonitor(); this._screenDprMonitor.setListener(() => this.onWindowResize(window.devicePixelRatio)); // Detect whether IntersectionObserver is detected and enable renderer pause // and resume based on terminal visibility if so if ('IntersectionObserver' in window) { const observer = new IntersectionObserver(e => this.onIntersectionChange(e[0]), {threshold: 0}); observer.observe(this._terminal.element); } } public onIntersectionChange(entry: IntersectionObserverEntry): void { this._isPaused = entry.intersectionRatio === 0; if (!this._isPaused && this._needsFullRefresh) { this._terminal.refresh(0, this._terminal.rows - 1); }
<<<<<<< import { IEventEmitter } from 'xterm'; import { IEvent, EventEmitter2 } from './EventEmitter2'; import { IDeleteEvent, IInsertEvent } from './CircularList'; ======= export interface IDisposable { dispose(): void; } export interface IEventEmitter { on(type: string, listener: (...args: any[]) => void): void; off(type: string, listener: (...args: any[]) => void): void; emit(type: string, data?: any): void; addDisposableListener(type: string, handler: (...args: any[]) => void): IDisposable; } >>>>>>> import { IEvent, EventEmitter2 } from './EventEmitter2'; import { IDeleteEvent, IInsertEvent } from './CircularList'; export interface IDisposable { dispose(): void; } export interface IEventEmitter { on(type: string, listener: (...args: any[]) => void): void; off(type: string, listener: (...args: any[]) => void): void; emit(type: string, data?: any): void; addDisposableListener(type: string, handler: (...args: any[]) => void): IDisposable; }
<<<<<<< import { MockCoreService, MockBufferService, MockDirtyRowService, MockOptionsService, MockLogService, MockCoreMouseService, MockUnicodeService } from 'common/TestUtils.test'; ======= import { MockCoreService, MockBufferService, MockDirtyRowService, MockOptionsService, MockLogService, MockCoreMouseService, MockCharsetService } from 'common/TestUtils.test'; >>>>>>> import { MockCoreService, MockBufferService, MockDirtyRowService, MockOptionsService, MockLogService, MockCoreMouseService, MockCharsetService, MockUnicodeService } from 'common/TestUtils.test'; <<<<<<< const inputHandler = new InputHandler(terminal, bufferService, new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); ======= const inputHandler = new TestInputHandler(terminal, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService()); inputHandler.curAttrData.fg = 3; >>>>>>> const inputHandler = new TestInputHandler(terminal, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); inputHandler.curAttrData.fg = 3; <<<<<<< const inputHandler = new InputHandler(new MockInputHandlingTerminal(), new MockBufferService(80, 30), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), optionsService, new MockCoreMouseService(), new MockUnicodeService()); ======= const inputHandler = new InputHandler(new MockInputHandlingTerminal(), new MockBufferService(80, 30), new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), optionsService, new MockCoreMouseService()); >>>>>>> const inputHandler = new InputHandler(new MockInputHandlingTerminal(), new MockBufferService(80, 30), new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), optionsService, new MockCoreMouseService(), new MockUnicodeService()); <<<<<<< const inputHandler = new InputHandler(terminal, new MockBufferService(80, 30), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); ======= const inputHandler = new InputHandler(terminal, new MockBufferService(80, 30), new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService()); >>>>>>> const inputHandler = new InputHandler(terminal, new MockBufferService(80, 30), new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); <<<<<<< const inputHandler = new InputHandler(term, bufferService, new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); ======= const inputHandler = new InputHandler(term, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService()); >>>>>>> const inputHandler = new InputHandler(term, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); <<<<<<< const inputHandler = new InputHandler(term, bufferService, new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); ======= const inputHandler = new InputHandler(term, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService()); >>>>>>> const inputHandler = new InputHandler(term, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); <<<<<<< const inputHandler = new InputHandler(term, bufferService, new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); ======= const inputHandler = new InputHandler(term, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService()); >>>>>>> const inputHandler = new InputHandler(term, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); <<<<<<< const inputHandler = new InputHandler(term, bufferService, new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); ======= const inputHandler = new InputHandler(term, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService()); >>>>>>> const inputHandler = new InputHandler(term, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); <<<<<<< const inputHandler = new InputHandler(term, new MockBufferService(80, 30), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); ======= const inputHandler = new InputHandler(term, new MockBufferService(80, 30), new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService()); >>>>>>> const inputHandler = new InputHandler(term, new MockBufferService(80, 30), new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); <<<<<<< handler = new InputHandler(term, bufferService, new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService()); ======= handler = new InputHandler(term, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService()); >>>>>>> handler = new InputHandler(term, bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService());
<<<<<<< import { CircularList, IInsertEvent } from './common/CircularList'; import { ITerminal, IBuffer, IBufferLine, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult, ICellData } from './Types'; ======= import { CircularList, IInsertEvent, IDeleteEvent } from './common/CircularList'; import { ITerminal, IBuffer, IBufferLine, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult, ICellData, IAttributeData } from './Types'; >>>>>>> import { CircularList, IInsertEvent } from './common/CircularList'; import { ITerminal, IBuffer, IBufferLine, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult, ICellData, IAttributeData } from './Types';
<<<<<<< import { listenOffers, orderBook } from "./service/dex"; ======= import { OperationsStorage, TransactionsStorage } from "./storage"; >>>>>>> import { listenOffers, orderBook } from "./service/dex"; import { OperationsStorage, TransactionsStorage } from "./storage"; <<<<<<< assets: HorizonAssetsDataSource; operations: HorizonOperationsDataSource; payments: HorizonPaymentsDataSource; ======= effects: HorizonEffectsDataSource; orderBook: HorizonOrderBookDataSource; pathfinding: HorizonPathFindingDataSource; >>>>>>> <<<<<<< orderBook: { load: typeof orderBook.load }; ======= storage: { operations: OperationsStorage; transactions: TransactionsStorage; }; >>>>>>> orderBook: { load: typeof orderBook.load }; storage: { operations: OperationsStorage; transactions: TransactionsStorage; }; <<<<<<< assets: new HorizonAssetsDataSource(), operations: new HorizonOperationsDataSource(), payments: new HorizonPaymentsDataSource(), trades: new HorizonTradesDataSource(), transactions: new HorizonTransactionsDataSource() ======= effects: new HorizonEffectsDataSource(), orderBook: new HorizonOrderBookDataSource(), pathfinding: new HorizonPathFindingDataSource(), trades: new HorizonTradesDataSource() >>>>>>> trades: new HorizonTradesDataSource(),
<<<<<<< import { BaseHorizonDataSource, HorizonOperationsDataSource, HorizonPaymentsDataSource, HorizonTradesDataSource, HorizonTransactionsDataSource } from "./datasource/horizon"; ======= >>>>>>> <<<<<<< context: ({ req, connection }) => { // initialize datasources manually only for subscriptions if (connection) { return { orderBook, dataSources: constructDataSourcesForSubscriptions(connection.context), }; } else { return { orderBook }; } }, ======= >>>>>>>
<<<<<<< code * charAtlasCellWidth, colorIndex * charAtlasCellHeight, charAtlasCellWidth, this._scaledCharHeight, x * this._scaledCellWidth + this._scaledCharLeft, y * this._scaledCellHeight + this._scaledCharTop, this._scaledCharWidth, this._scaledCharHeight); ======= code * charAtlasCellWidth, colorIndex * charAtlasCellHeight, charAtlasCellWidth, this._scaledCharHeight, x * this._scaledCharWidth, y * this._scaledLineHeight + this._scaledLineDrawY, charAtlasCellWidth, this._scaledCharHeight); >>>>>>> code * charAtlasCellWidth, colorIndex * charAtlasCellHeight, charAtlasCellWidth, this._scaledCharHeight, x * this._scaledCellWidth + this._scaledCharLeft, y * this._scaledCellHeight + this._scaledCharTop, charAtlasCellWidth, this._scaledCharHeight);
<<<<<<< import { IEvent } from 'common/EventEmitter'; ======= import { IEvent } from 'common/EventEmitter2'; import { IBuffer, IBufferSet } from 'common/buffer/Types'; >>>>>>> import { IEvent } from 'common/EventEmitter'; import { IBuffer, IBufferSet } from 'common/buffer/Types';
<<<<<<< import { Disposable } from 'common/Lifecycle'; ======= import { IBufferSet, IBuffer } from 'common/buffer/Types'; >>>>>>> import { Disposable } from 'common/Lifecycle'; import { IBufferSet, IBuffer } from 'common/buffer/Types'; <<<<<<< ======= this._bufferService = new BufferService(this.optionsService); // TODO: Remove these in v4 // Fire old style events from new emitters this.onCursorMove(() => this.emit('cursormove')); this.onData(e => this.emit('data', e)); this.onKey(e => this.emit('key', e.key, e.domEvent)); this.onLineFeed(() => this.emit('linefeed')); this.onRender(e => this.emit('refresh', e)); this.onResize(e => this.emit('resize', e)); this.onSelectionChange(() => this.emit('selection')); this.onScroll(e => this.emit('scroll', e)); this.onTitleChange(e => this.emit('title', e)); >>>>>>> this._bufferService = new BufferService(this.optionsService);
<<<<<<< import { BufferLine, CellData } from './BufferLine'; ======= import { FILL_CHAR_DATA } from './Buffer'; import { BufferLine } from './BufferLine'; >>>>>>> import { BufferLine, CellData } from './BufferLine'; <<<<<<< import { NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, DEFAULT_ATTR } from './Buffer'; ======= >>>>>>> import { NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, DEFAULT_ATTR } from './Buffer'; <<<<<<< export function reflowLargerGetLinesToRemove(lines: CircularList<IBufferLine>, newCols: number): number[] { const nullCell = CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]); ======= export function reflowLargerGetLinesToRemove(lines: CircularList<IBufferLine>, newCols: number, bufferAbsoluteY: number): number[] { >>>>>>> export function reflowLargerGetLinesToRemove(lines: CircularList<IBufferLine>, newCols: number, bufferAbsoluteY: number): number[] { const nullCell = CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);
<<<<<<< import { BufferLine, CellData } from './BufferLine'; import { reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths, getWrappedLineTrimmedLength } from './BufferReflow'; ======= import { BufferLine, CellData, AttributeData } from './BufferLine'; import { reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths } from './BufferReflow'; >>>>>>> import { BufferLine, CellData, AttributeData } from './BufferLine'; import { reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths, getWrappedLineTrimmedLength } from './BufferReflow'; <<<<<<< const toRemove: number[] = reflowLargerGetLinesToRemove(this.lines, this._cols, newCols, this.ybase + this.y); ======= const toRemove: number[] = reflowLargerGetLinesToRemove(this.lines, newCols, this.ybase + this.y, this.getNullCell(DEFAULT_ATTR_DATA)); >>>>>>> const toRemove: number[] = reflowLargerGetLinesToRemove(this.lines, this._cols, newCols, this.ybase + this.y, this.getNullCell(DEFAULT_ATTR_DATA));
<<<<<<< import { Params } from 'common/parser/Params'; ======= import { MockCoreService } from 'common/TestUtils.test'; >>>>>>> import { Params } from 'common/parser/Params'; import { MockCoreService } from 'common/TestUtils.test';
<<<<<<< getBlankLine(attr: number, isWrapped?: boolean): IBufferLine; ======= stringIndexToBufferIndex(lineIndex: number, stringIndex: number): number[]; iterator(trimRight: boolean, startIndex?: number, endIndex?: number): IBufferStringIterator; >>>>>>> getBlankLine(attr: number, isWrapped?: boolean): IBufferLine; stringIndexToBufferIndex(lineIndex: number, stringIndex: number): number[]; iterator(trimRight: boolean, startIndex?: number, endIndex?: number): IBufferStringIterator;
<<<<<<< reverseWraparound: false, ======= sendFocus: false, >>>>>>> reverseWraparound: false, sendFocus: false,
<<<<<<< import { CircularList, IInsertEvent, IDeleteEvent } from './common/CircularList'; import { CharData, ITerminal, IBuffer, IBufferLine, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult, IBufferLineConstructor } from './Types'; ======= import { CircularList } from './common/CircularList'; import { CharData, ITerminal, IBuffer, IBufferLine, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult } from './Types'; >>>>>>> import { CircularList, IInsertEvent, IDeleteEvent } from './common/CircularList'; import { CharData, ITerminal, IBuffer, IBufferLine, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult } from './Types'; <<<<<<< private _bufferLineConstructor: IBufferLineConstructor; private _cols: number; private _rows: number; ======= >>>>>>> private _cols: number; private _rows: number; <<<<<<< return new this._bufferLineConstructor(this._cols, fillCharData, isWrapped); ======= return new BufferLine(this._terminal.cols, fillCharData, isWrapped); >>>>>>> return new BufferLine(this._cols, fillCharData, isWrapped); <<<<<<< this.lines.push(new this._bufferLineConstructor(newCols, FILL_CHAR_DATA)); ======= const fillCharData: CharData = [DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]; this.lines.push(new BufferLine(newCols, fillCharData)); >>>>>>> this.lines.push(new BufferLine(newCols, FILL_CHAR_DATA));
<<<<<<< self._keyUp(ev); }, true); ======= }, true)); >>>>>>> self._keyUp(ev); }, true)); <<<<<<< this.element.addEventListener('mousedown', (e: MouseEvent) => this.selectionManager.onMouseDown(e)); this.selectionManager.on('refresh', data => this.renderer.onSelectionChanged(data.start, data.end, data.columnSelectMode)); this.selectionManager.on('newselection', text => { ======= this.register(addDisposableDomListener(this.element, 'mousedown', (e: MouseEvent) => this.selectionManager.onMouseDown(e))); this.register(this.selectionManager.addDisposableListener('refresh', data => this.renderer.onSelectionChanged(data.start, data.end))); this.register(this.selectionManager.addDisposableListener('newselection', text => { >>>>>>> this.register(addDisposableDomListener(this.element, 'mousedown', (e: MouseEvent) => this.selectionManager.onMouseDown(e))); this.register(this.selectionManager.addDisposableListener('refresh', data => this.renderer.onSelectionChanged(data.start, data.end, data.columnSelectMode))); this.register(this.selectionManager.addDisposableListener('newselection', text => {
<<<<<<< import { HorizonAssetsDataSource } from "../../src/datasource/horizon"; import { Account, AccountData, Offer, TrustLine } from "../../src/orm/entities"; ======= import { Account } from "../../src/orm/entities/account"; import { AccountData } from "../../src/orm/entities/account_data"; >>>>>>> import { Offer, TrustLine } from "../../src/orm/entities"; import { Account } from "../../src/orm/entities/account"; import { AccountData } from "../../src/orm/entities/account_data";
<<<<<<< function addRow(html: string) { const element = document.createElement('div'); element.innerHTML = html; container.appendChild(element); rows.push(element); } ======= describe('before attachToDom', () => { it('should allow link matcher registration', done => { assert.doesNotThrow(() => { const linkMatcherId = linkifier.registerLinkMatcher(/foo/, () => {}); assert.isTrue(linkifier.deregisterLinkMatcher(linkMatcherId)); done(); }); }); }); >>>>>>> function addRow(html: string) { const element = document.createElement('div'); element.innerHTML = html; container.appendChild(element); rows.push(element); } describe('before attachToDom', () => { it('should allow link matcher registration', done => { assert.doesNotThrow(() => { const linkMatcherId = linkifier.registerLinkMatcher(/foo/, () => {}); assert.isTrue(linkifier.deregisterLinkMatcher(linkMatcherId)); done(); }); }); }); <<<<<<< linkifier.linkifyRow(0); // Allow time for the click to be performed setTimeout(() => done(), 10); }); it('should trigger for multiple link matches on one row', done => { addRow('test test'); let count = 0; linkifier.registerLinkMatcher(/test/, () => assert.fail(), { validationCallback: (url, cb) => { count += 1; if (count === 2) { done(); } cb(false); } }); linkifier.linkifyRow(0); }); }); ======= >>>>>>>
<<<<<<< let fitAddon: FitAddon; let searchAddon: SearchAddon; let serializeAddon: SerializeAddon; ======= >>>>>>> <<<<<<< document.getElementById('webgl').addEventListener('click', () => term.loadAddon(new WebglAddon())); document.getElementById('serialize').addEventListener('click', serializeButtonHandler); ======= >>>>>>> document.getElementById('serialize').addEventListener('click', serializeButtonHandler); <<<<<<< typedTerm.loadAddon(new WebLinksAddon()); searchAddon = new SearchAddon(); typedTerm.loadAddon(searchAddon); fitAddon = new FitAddon(); typedTerm.loadAddon(fitAddon); serializeAddon = new SerializeAddon(); typedTerm.loadAddon(serializeAddon); ======= addons['web-links'].instance = new WebLinksAddon(); addons.search.instance = new SearchAddon(); addons.fit.instance = new FitAddon(); typedTerm.loadAddon(addons['web-links'].instance); typedTerm.loadAddon(addons.search.instance); typedTerm.loadAddon(addons.fit.instance); >>>>>>> addons.search.instance = new SearchAddon(); addons.serialize.instance = new SerializeAddon(); addons.fit.instance = new FitAddon(); addons['web-links'].instance = new WebLinksAddon(); typedTerm.loadAddon(addons.fit.instance); typedTerm.loadAddon(addons.search.instance); typedTerm.loadAddon(addons.serialize.instance); typedTerm.loadAddon(addons['web-links'].instance); <<<<<<< fitAddon.fit(); } function serializeButtonHandler(): void { const output = serializeAddon.serialize(); const outputString = JSON.stringify(output); console.log('serialize output', outputString); document.getElementById('serialize-output').innerText = outputString; if ((document.getElementById('write-to-terminal') as HTMLInputElement).checked) { term.reset(); term.write(output); } ======= addons.fit.instance.fit(); >>>>>>> addons.fit.instance.fit(); } function serializeButtonHandler(): void { const output = addons.serialize.instance.serialize(); const outputString = JSON.stringify(output); console.log('serialize output', outputString); document.getElementById('serialize-output').innerText = outputString; if ((document.getElementById('write-to-terminal') as HTMLInputElement).checked) { term.reset(); term.write(output); }
<<<<<<< import { concat, utf32ToString } from './common/TypedArrayUtils'; import { StringToUtf32, stringFromCodePoint } from './core/input/TextDecoder'; import { CellData } from './BufferLine'; ======= import { concat } from './common/TypedArrayUtils'; import { StringToUtf32, stringFromCodePoint, utf32ToString } from './core/input/TextDecoder'; >>>>>>> import { concat } from './common/TypedArrayUtils'; import { StringToUtf32, stringFromCodePoint, utf32ToString } from './core/input/TextDecoder'; import { CellData } from './BufferLine'; <<<<<<< private _parseBuffer: Uint32Array = new Uint32Array(4096); private _stringDecoder: StringToUtf32 = new StringToUtf32(); private _cell: CellData = new CellData(); ======= private _parseBuffer: Uint32Array = new Uint32Array(4096); private _stringDecoder: StringToUtf32 = new StringToUtf32(); >>>>>>> private _parseBuffer: Uint32Array = new Uint32Array(4096); private _stringDecoder: StringToUtf32 = new StringToUtf32(); private _cell: CellData = new CellData(); <<<<<<< this._parser.parse(this._parseBuffer, this._stringDecoder.decode(data, this._parseBuffer)); ======= for (let i = 0; i < data.length; ++i) { this._parseBuffer[i] = data.charCodeAt(i); } this._parser.parse(this._parseBuffer, this._stringDecoder.decode(data, this._parseBuffer)); >>>>>>> this._parser.parse(this._parseBuffer, this._stringDecoder.decode(data, this._parseBuffer)); <<<<<<< for (let pos = start; pos < end; ++pos) { code = data[pos]; ======= for (let pos = start; pos < end; ++pos) { code = data[pos]; char = stringFromCodePoint(code); >>>>>>> for (let pos = start; pos < end; ++pos) { code = data[pos]; <<<<<<< // charset is only defined for ASCII, therefore we only // search for an replacement char if code < 127 if (code < 127 && charset) { const ch = charset[String.fromCharCode(code)]; if (ch) { code = ch.charCodeAt(0); } ======= // charset are only defined for ASCII, therefore we only // search for an replacement char if code < 127 if (code < 127 && charset) { const ch = charset[char]; if (ch) { code = ch.charCodeAt(0); char = ch; } >>>>>>> // charset is only defined for ASCII, therefore we only // search for an replacement char if code < 127 if (code < 127 && charset) { const ch = charset[String.fromCharCode(code)]; if (ch) { code = ch.charCodeAt(0); }
<<<<<<< import { IBufferService, ICoreService, ILogService, IOptionsService, ITerminalOptions, IPartialTerminalOptions, IDirtyRowService, ICoreMouseService, IUnicodeService, IUnicodeVersionProvider } from 'common/services/Services'; ======= import { IBufferService, ICoreService, ILogService, IOptionsService, ITerminalOptions, IPartialTerminalOptions, IDirtyRowService, ICoreMouseService, ICharsetService } from 'common/services/Services'; >>>>>>> import { IBufferService, ICoreService, ILogService, IOptionsService, ITerminalOptions, IPartialTerminalOptions, IDirtyRowService, ICoreMouseService, ICharsetService, IUnicodeService, IUnicodeVersionProvider } from 'common/services/Services'; <<<<<<< import { IDecPrivateModes, ICoreMouseEvent, CoreMouseEventType } from 'common/Types'; import { UnicodeV6 } from 'common/input/UnicodeV6'; ======= import { IDecPrivateModes, ICoreMouseEvent, CoreMouseEventType, ICharset } from 'common/Types'; >>>>>>> import { IDecPrivateModes, ICoreMouseEvent, CoreMouseEventType, ICharset } from 'common/Types'; import { UnicodeV6 } from 'common/input/UnicodeV6';
<<<<<<< operations(first: Int, after: String, last: Int, before: String, order: Order): OperationConnection ======= operations(first: Int, after: String, last: Int, before: String): OperationConnection payments(first: Int, after: String, last: Int, before: String): OperationConnection >>>>>>> operations(first: Int, after: String, last: Int, before: String, order: Order): OperationConnection payments(first: Int, after: String, last: Int, before: String): OperationConnection
<<<<<<< Terminal.applyAddon(winptyCompat); ======= Terminal.applyAddon(webLinks); const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].indexOf(navigator.platform) >= 0; if (isWindows) { Terminal.applyAddon(winptyCompat); } >>>>>>> const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].indexOf(navigator.platform) >= 0; if (isWindows) { Terminal.applyAddon(winptyCompat); } <<<<<<< term.winptyCompatInit(); // term.webLinksInit(); ======= if (isWindows) { term.winptyCompatInit(); } term.webLinksInit(); >>>>>>> if (isWindows) { term.winptyCompatInit(); } // term.webLinksInit();
<<<<<<< } export function slice<T extends TypedArray>(array: T, start?: number, end?: number): T { // all modern engines that support .slice if (array.slice) { return array.slice(start, end) as T; } return sliceFallback(array, start, end); } export function sliceFallback<T extends TypedArray>(array: T, start: number = 0, end: number = array.length): T { if (start < 0) { start = (array.length + start) % array.length; } if (end >= array.length) { end = array.length; } else { end = (array.length + end) % array.length; } start = Math.min(start, end); const result: T = new (array.constructor as any)(end - start); for (let i = 0; i < end - start; ++i) { result[i] = array[i + start]; } return result; ======= } /** * Concat two typed arrays `a` and `b`. * Returns a new typed array. */ export function concat<T extends TypedArray>(a: T, b: T): T { const result = new (a.constructor as any)(a.length + b.length); result.set(a); result.set(b, a.length); return result; >>>>>>> } export function slice<T extends TypedArray>(array: T, start?: number, end?: number): T { // all modern engines that support .slice if (array.slice) { return array.slice(start, end) as T; } return sliceFallback(array, start, end); } export function sliceFallback<T extends TypedArray>(array: T, start: number = 0, end: number = array.length): T { if (start < 0) { start = (array.length + start) % array.length; } if (end >= array.length) { end = array.length; } else { end = (array.length + end) % array.length; } start = Math.min(start, end); const result: T = new (array.constructor as any)(end - start); for (let i = 0; i < end - start; ++i) { result[i] = array[i + start]; } return result; } /** * Concat two typed arrays `a` and `b`. * Returns a new typed array. */ export function concat<T extends TypedArray>(a: T, b: T): T { const result = new (a.constructor as any)(a.length + b.length); result.set(a); result.set(b, a.length); return result;
<<<<<<< private _reflowLargerAdjustViewport(newCols: number, countRemoved: number): void { const nullCell = this.getNullCell(DEFAULT_ATTR); ======= private _reflowLargerAdjustViewport(newCols: number, newRows: number, countRemoved: number): void { >>>>>>> private _reflowLargerAdjustViewport(newCols: number, newRows: number, countRemoved: number): void { const nullCell = this.getNullCell(DEFAULT_ATTR);
<<<<<<< import { BufferLine, CellData } from './BufferLine'; import { CircularList } from './common/CircularList'; import { IBufferLine } from './Types'; import { NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, DEFAULT_ATTR } from './Buffer'; ======= import { BufferLine } from './BufferLine'; import { CircularList, IDeleteEvent } from './common/CircularList'; import { IBufferLine, ICellData } from './Types'; >>>>>>> import { BufferLine } from './BufferLine'; import { CircularList } from './common/CircularList'; import { IBufferLine, ICellData } from './Types';
<<<<<<< const width = this._cell.width; ======= const attr = this._cell.fg; const width = this._cell.getWidth(); >>>>>>> const width = this._cell.getWidth(); <<<<<<< charElement.textContent = this._cell.chars || WHITESPACE_CELL_CHAR; const swapColor = this._cell.isInverse(); // fg if (this._cell.isFgRGB()) { let style = charElement.getAttribute('style') || ''; style += `${swapColor ? 'background-' : ''}color:rgb(${(AttributeData.toColorRGB(this._cell.getFgColor())).join(',')});`; charElement.setAttribute('style', style); } else if (this._cell.isFgPalette()) { let fg = this._cell.getFgColor(); if (this._cell.isBold() && fg < 8 && !swapColor) { fg += 8; } charElement.classList.add(`xterm-${swapColor ? 'b' : 'f'}g-${fg}`); } else if (swapColor) { charElement.classList.add(`xterm-bg-${INVERTED_DEFAULT_COLOR}`); ======= charElement.textContent = this._cell.getChars() || WHITESPACE_CELL_CHAR; if (fg !== DEFAULT_COLOR) { charElement.classList.add(`xterm-fg-${fg}`); >>>>>>> charElement.textContent = this._cell.getChars() || WHITESPACE_CELL_CHAR; const swapColor = this._cell.isInverse(); // fg if (this._cell.isFgRGB()) { let style = charElement.getAttribute('style') || ''; style += `${swapColor ? 'background-' : ''}color:rgb(${(AttributeData.toColorRGB(this._cell.getFgColor())).join(',')});`; charElement.setAttribute('style', style); } else if (this._cell.isFgPalette()) { let fg = this._cell.getFgColor(); if (this._cell.isBold() && fg < 8 && !swapColor) { fg += 8; } charElement.classList.add(`xterm-${swapColor ? 'b' : 'f'}g-${fg}`); } else if (swapColor) { charElement.classList.add(`xterm-bg-${INVERTED_DEFAULT_COLOR}`);
<<<<<<< getCoords(event: { clientX: number, clientY: number }, element: HTMLElement, charMeasure: ICharMeasure, lineHeight: number, colCount: number, rowCount: number, isSelection?: boolean): [number, number]; getRawByteCoords(event: MouseEvent, element: HTMLElement, charMeasure: ICharMeasure, lineHeight: number, colCount: number, rowCount: number): { x: number, y: number }; ======= getCoords(event: { pageX: number, pageY: number }, element: HTMLElement, charMeasure: ICharMeasure, colCount: number, rowCount: number, isSelection?: boolean): [number, number]; getRawByteCoords(event: MouseEvent, element: HTMLElement, charMeasure: ICharMeasure, colCount: number, rowCount: number): { x: number, y: number }; >>>>>>> getCoords(event: { clientX: number, clientY: number }, element: HTMLElement, charMeasure: ICharMeasure, colCount: number, rowCount: number, isSelection?: boolean): [number, number]; getRawByteCoords(event: MouseEvent, element: HTMLElement, charMeasure: ICharMeasure, colCount: number, rowCount: number): { x: number, y: number };
<<<<<<< import { RenderDebouncer } from '../utils/RenderDebouncer'; ======= import { ScreenDprMonitor } from '../utils/ScreenDprMonitor'; >>>>>>> import { RenderDebouncer } from '../utils/RenderDebouncer'; import { ScreenDprMonitor } from '../utils/ScreenDprMonitor'; <<<<<<< this._renderDebouncer = new RenderDebouncer(this._terminal, this._renderRows.bind(this)); ======= this._screenDprMonitor = new ScreenDprMonitor(); this._screenDprMonitor.setListener(() => this.onWindowResize(window.devicePixelRatio)); // Detect whether IntersectionObserver is detected and enable renderer pause // and resume based on terminal visibility if so if ('IntersectionObserver' in window) { const observer = new IntersectionObserver(e => this.onIntersectionChange(e[0]), {threshold: 0}); observer.observe(this._terminal.element); } } public onIntersectionChange(entry: IntersectionObserverEntry): void { this._isPaused = entry.intersectionRatio === 0; if (!this._isPaused && this._needsFullRefresh) { this._terminal.refresh(0, this._terminal.rows - 1); } >>>>>>> this._renderDebouncer = new RenderDebouncer(this._terminal, this._renderRows.bind(this)); this._screenDprMonitor = new ScreenDprMonitor(); this._screenDprMonitor.setListener(() => this.onWindowResize(window.devicePixelRatio)); // Detect whether IntersectionObserver is detected and enable renderer pause // and resume based on terminal visibility if so if ('IntersectionObserver' in window) { const observer = new IntersectionObserver(e => this.onIntersectionChange(e[0]), {threshold: 0}); observer.observe(this._terminal.element); } } public onIntersectionChange(entry: IntersectionObserverEntry): void { this._isPaused = entry.intersectionRatio === 0; if (!this._isPaused && this._needsFullRefresh) { this._terminal.refresh(0, this._terminal.rows - 1); } <<<<<<< public refreshRows(start: number, end: number): void { this._renderDebouncer.refresh(start, end); ======= public queueRefresh(start: number, end: number): void { if (this._isPaused) { this._needsFullRefresh = true; return; } this._refreshRowsQueue.push({ start: start, end: end }); if (!this._refreshAnimationFrame) { this._refreshAnimationFrame = window.requestAnimationFrame(this._refreshLoop.bind(this)); } >>>>>>> public refreshRows(start: number, end: number): void { if (this._isPaused) { this._needsFullRefresh = true; return; } this._renderDebouncer.refresh(start, end);
<<<<<<< setRenderer(renderer: any): void { throw new Error('Method not implemented.'); } ======= onBlur: IEvent<void>; onFocus: IEvent<void>; onA11yChar: IEvent<string>; onA11yTab: IEvent<number>; >>>>>>> setRenderer(renderer: any): void { throw new Error('Method not implemented.'); } onBlur: IEvent<void>; onFocus: IEvent<void>; onA11yChar: IEvent<string>; onA11yTab: IEvent<number>;
<<<<<<< import { ISearchHelper, ISearchAddonTerminal, ISearchOptions, ISearchResult, ISearchIndex } from './Interfaces'; const nonWordCharacters = ' ~!@#$%^&*()+`-=[]{}|\;:"\',./<>?'; ======= import { ISearchHelper, ISearchAddonTerminal, ISearchOptions, ISearchResult } from './Interfaces'; const NON_WORD_CHARACTERS = ' ~!@#$%^&*()+`-=[]{}|\;:"\',./<>?'; const LINES_CACHE_TIME_TO_LIVE = 15 * 1000; // 15 secs >>>>>>> import { ISearchHelper, ISearchAddonTerminal, ISearchOptions, ISearchResult, ISearchIndex } from './Interfaces'; const NON_WORD_CHARACTERS = ' ~!@#$%^&*()+`-=[]{}|\;:"\',./<>?'; const LINES_CACHE_TIME_TO_LIVE = 15 * 1000; // 15 secs <<<<<<< const stringLine = this.translateBufferLineToStringWithWrap(searchIndex.row, true); ======= let stringLine = this._linesCache ? this._linesCache[y] : void 0; if (stringLine === void 0) { stringLine = this.translateBufferLineToStringWithWrap(y, true); if (this._linesCache) { this._linesCache[y] = stringLine; } } const searchStringLine = searchOptions.caseSensitive ? stringLine : stringLine.toLowerCase(); >>>>>>> let stringLine = this._linesCache ? this._linesCache[searchIndex.row] : void 0; if (stringLine === void 0) { stringLine = this.translateBufferLineToStringWithWrap(searchIndex.row, true); if (this._linesCache) { this._linesCache[searchIndex.row] = stringLine; } }
<<<<<<< // TODO: All mouse handling should be pulled into its own file. ======= // TODO: these event listeners should be managed by the disposable, the Terminal reference may // be kept aroud if Terminal.dispose is fired when the mouse is down >>>>>>> // TODO: All mouse handling should be pulled into its own file. <<<<<<< let moveHandler: (event: MouseEvent) => void; if (this.normalMouse) { moveHandler = (event: MouseEvent) => { // Do nothing if normal mouse mode is on. This can happen if the mouse is held down when the // terminal exits normalMouse mode. if (!this.normalMouse) { return; } sendMove(event); }; on(this._document, 'mousemove', moveHandler); } ======= if (this.normalMouse) { this._document.addEventListener('mousemove', sendMove); } >>>>>>> let moveHandler: (event: MouseEvent) => void; if (this.normalMouse) { moveHandler = (event: MouseEvent) => { // Do nothing if normal mouse mode is on. This can happen if the mouse is held down when the // terminal exits normalMouse mode. if (!this.normalMouse) { return; } sendMove(event); }; // TODO: these event listeners should be managed by the disposable, the Terminal reference may // be kept aroud if Terminal.dispose is fired when the mouse is down this._document.addEventListener('mousemove', moveHandler); } <<<<<<< } if (moveHandler) { // Even though this should only be attached when this.normalMouse is true, holding the // mouse button down when normalMouse changes can happen. Just always try to remove it. off(this._document, 'mousemove', moveHandler); moveHandler = null; } off(this._document, 'mouseup', handler); return this.cancel(ev); }; on(this._document, 'mouseup', handler); ======= // TODO: Seems dangerous calling this on document? if (this.normalMouse) { this._document.removeEventListener('mousemove', sendMove); } this._document.removeEventListener('mouseup', handler); return this.cancel(ev); }; // TODO: Seems dangerous calling this on document? this._document.addEventListener('mouseup', handler); } >>>>>>> } if (moveHandler) { // Even though this should only be attached when this.normalMouse is true, holding the // mouse button down when normalMouse changes can happen. Just always try to remove it. this._document.removeEventListener('mousemove', moveHandler); moveHandler = null; } this._document.removeEventListener('mouseup', handler); return this.cancel(ev); }; this._document.addEventListener('mouseup', handler);
<<<<<<< '<span class="xterm-fg-1 xterm-bg-257">a</span>' + '<span> </span>' ======= '<span class="xterm-fg-1 xterm-bg-15">a</span>' >>>>>>> '<span class="xterm-fg-1 xterm-bg-257">a</span>' <<<<<<< '<span class="xterm-fg-257 xterm-bg-1">a</span>' + '<span> </span>' ======= '<span class="xterm-fg-0 xterm-bg-1">a</span>' >>>>>>> '<span class="xterm-fg-257 xterm-bg-1">a</span>'
<<<<<<< import { CircularList, IInsertEvent, IDeleteEvent } from './common/CircularList'; import { ITerminal, IBuffer, IBufferLine, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult, ICellData } from './Types'; import { EventEmitter } from './common/EventEmitter'; ======= >>>>>>> import { CircularList, IInsertEvent, IDeleteEvent } from './common/CircularList'; import { ITerminal, IBuffer, IBufferLine, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult, ICellData } from './Types'; import { EventEmitter } from './common/EventEmitter'; <<<<<<< import { BufferLine, CellData } from './BufferLine'; ======= import { BufferLine } from './BufferLine'; import { reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths } from './BufferReflow'; import { CircularList, IDeleteEvent, IInsertEvent } from './common/CircularList'; import { EventEmitter } from './common/EventEmitter'; >>>>>>> import { BufferLine, CellData } from './BufferLine'; import { reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths } from './BufferReflow'; <<<<<<< this.y--; // Add an extra row at the bottom of the viewport this.lines.push(new BufferLine(newCols, nullCell)); ======= if (this.y > 0) { this.y--; } if (this.lines.length < this._rows) { // Add an extra row at the bottom of the viewport this.lines.push(new BufferLine(newCols, FILL_CHAR_DATA)); } >>>>>>> if (this.y > 0) { this.y--; } if (this.lines.length < this._rows) { // Add an extra row at the bottom of the viewport this.lines.push(new BufferLine(newCols, nullCell)); } <<<<<<< private _reflowSmaller(newCols: number): void { const nullCell = this.getNullCell(DEFAULT_ATTR); ======= private _reflowSmaller(newCols: number, newRows: number): void { >>>>>>> private _reflowSmaller(newCols: number, newRows: number): void { const nullCell = this.getNullCell(DEFAULT_ATTR);
<<<<<<< const consoleLog = console.log; ======= const CONSOLE_LOG = console.log; >>>>>>> const consoleLog = console.log; <<<<<<< const cols = 80; const rows = 25; ======= const COLS = 80; const ROWS = 25; >>>>>>> const cols = 80; const rows = 25; <<<<<<< xterm = new Terminal({ cols: cols, rows: rows }); ======= xterm = new TestTerminal({ cols: COLS, rows: ROWS }); >>>>>>> xterm = new TestTerminal({ cols: cols, rows: rows }); <<<<<<< let fromEmulator = terminalToString(xterm); console.log = consoleLog; let expected = fs.readFileSync(filename.split('.')[0] + '.text', 'utf8'); ======= const fromEmulator = terminalToString(xterm); console.log = CONSOLE_LOG; const expected = fs.readFileSync(filename.split('.')[0] + '.text', 'utf8'); >>>>>>> const fromEmulator = terminalToString(xterm); console.log = consoleLog; const expected = fs.readFileSync(filename.split('.')[0] + '.text', 'utf8');
<<<<<<< import { KeyboardResultType, ICharset } from './core/Types'; import { WebglRenderer } from './renderer/webgl/WebglRenderer'; ======= import { KeyboardResultType, ICharset, IBufferLine, IAttributeData } from './core/Types'; >>>>>>> import { WebglRenderer } from './renderer/webgl/WebglRenderer'; import { KeyboardResultType, ICharset, IBufferLine, IAttributeData } from './core/Types';
<<<<<<< // get the buffer index as [absolute row, col] for the match // load the attrs at that pos and underline const bufferIndex = this._terminal.buffer.stringIndexToBufferIndex(rowIndex, stringIndex); const line = this._terminal.buffer.lines.get(bufferIndex[0]); const char = line.get(bufferIndex[1]); const attr: number = char[CHAR_DATA_ATTR_INDEX]; const fg = (attr >> 9) & 0x1ff; ======= // Get cell color const line = this._terminal.buffer.lines.get(this._terminal.buffer.ydisp + rowIndex); const char = line.get(index); let fg: number | undefined; if (char) { const attr: number = char[CHAR_DATA_ATTR_INDEX]; fg = (attr >> 9) & 0x1ff; } // Ensure the link is valid before registering if (matcher.validationCallback) { matcher.validationCallback(uri, isValid => { // Discard link if the line has already changed if (this._rowsTimeoutId) { return; } if (isValid) { this._addLink(offset + index, rowIndex, uri, matcher, fg); } }); } else { this._addLink(offset + index, rowIndex, uri, matcher, fg); } >>>>>>> // get the buffer index as [absolute row, col] for the match // load the attrs at that pos and underline const bufferIndex = this._terminal.buffer.stringIndexToBufferIndex(rowIndex, stringIndex); const line = this._terminal.buffer.lines.get(bufferIndex[0]); const char = line.get(bufferIndex[1]); let fg: number | undefined; if (char) { const attr: number = char[CHAR_DATA_ATTR_INDEX]; fg = (attr >> 9) & 0x1ff; }
<<<<<<< import { BufferLine, CellData } from '../../BufferLine'; import { IBufferLine } from '../../Types'; ======= import { BufferLine } from '../../BufferLine'; import { IBufferLine, ITerminalOptions } from '../../Types'; >>>>>>> import { BufferLine, CellData } from '../../BufferLine'; import { IBufferLine, ITerminalOptions } from '../../Types'; <<<<<<< lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, '', 0, undefined])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, 5, 20); ======= lineData.set(1, [DEFAULT_ATTR, '', 0, undefined]); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); >>>>>>> lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, '', 0, undefined])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); <<<<<<< lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)])); lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, 'b', 1, 'b'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, 5, 1); ======= lineData.set(0, [DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)]); lineData.set(1, [DEFAULT_ATTR, 'b', 1, 'b'.charCodeAt(0)]); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 1); >>>>>>> lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)])); lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, 'b', 1, 'b'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 1); <<<<<<< lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR | (FLAGS.BOLD << 18), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, 5, 20); ======= lineData.set(0, [DEFAULT_ATTR | (FLAGS.BOLD << 18), 'a', 1, 'a'.charCodeAt(0)]); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); >>>>>>> lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR | (FLAGS.BOLD << 18), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); <<<<<<< lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR | (FLAGS.ITALIC << 18), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, 5, 20); ======= lineData.set(0, [DEFAULT_ATTR | (FLAGS.ITALIC << 18), 'a', 1, 'a'.charCodeAt(0)]); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); >>>>>>> lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR | (FLAGS.ITALIC << 18), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); <<<<<<< lineData.setCell(0, CellData.fromCharData([defaultAttrNoFgColor | (i << 9), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, 5, 20); ======= lineData.set(0, [defaultAttrNoFgColor | (i << 9), 'a', 1, 'a'.charCodeAt(0)]); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); >>>>>>> lineData.setCell(0, CellData.fromCharData([defaultAttrNoFgColor | (i << 9), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); <<<<<<< lineData.setCell(0, CellData.fromCharData([defaultAttrNoBgColor | (i << 0), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, 5, 20); ======= lineData.set(0, [defaultAttrNoBgColor | (i << 0), 'a', 1, 'a'.charCodeAt(0)]); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); >>>>>>> lineData.setCell(0, CellData.fromCharData([defaultAttrNoBgColor | (i << 0), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); <<<<<<< lineData.setCell(0, CellData.fromCharData([(FLAGS.INVERSE << 18) | (2 << 9) | (1 << 0), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, 5, 20); ======= lineData.set(0, [(FLAGS.INVERSE << 18) | (2 << 9) | (1 << 0), 'a', 1, 'a'.charCodeAt(0)]); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); >>>>>>> lineData.setCell(0, CellData.fromCharData([(FLAGS.INVERSE << 18) | (2 << 9) | (1 << 0), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); <<<<<<< lineData.setCell(0, CellData.fromCharData([(FLAGS.INVERSE << 18) | (DEFAULT_ATTR << 9) | (1 << 0), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, 5, 20); ======= lineData.set(0, [(FLAGS.INVERSE << 18) | (DEFAULT_ATTR << 9) | (1 << 0), 'a', 1, 'a'.charCodeAt(0)]); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); >>>>>>> lineData.setCell(0, CellData.fromCharData([(FLAGS.INVERSE << 18) | (DEFAULT_ATTR << 9) | (1 << 0), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); <<<<<<< lineData.setCell(0, CellData.fromCharData([(FLAGS.INVERSE << 18) | (1 << 9) | (DEFAULT_COLOR << 0), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, 5, 20); ======= lineData.set(0, [(FLAGS.INVERSE << 18) | (1 << 9) | (DEFAULT_COLOR << 0), 'a', 1, 'a'.charCodeAt(0)]); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); >>>>>>> lineData.setCell(0, CellData.fromCharData([(FLAGS.INVERSE << 18) | (1 << 9) | (DEFAULT_COLOR << 0), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); <<<<<<< lineData.setCell(0, CellData.fromCharData([(FLAGS.BOLD << 18) | (i << 9) | (DEFAULT_COLOR << 0), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, 5, 20); ======= lineData.set(0, [(FLAGS.BOLD << 18) | (i << 9) | (DEFAULT_COLOR << 0), 'a', 1, 'a'.charCodeAt(0)]); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20); >>>>>>> lineData.setCell(0, CellData.fromCharData([(FLAGS.BOLD << 18) | (i << 9) | (DEFAULT_COLOR << 0), 'a', 1, 'a'.charCodeAt(0)])); const fragment = rowFactory.createRow(lineData, false, undefined, 0, false, 5, 20);
<<<<<<< before(async function(): Promise<any> { browser = await puppeteer.launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); page = (await browser.pages())[0]; await page.setViewport({ width, height }); await page.goto(APP); await openTerminal(); await page.evaluate(`window.term.loadAddon(new WebglAddon(true));`); ======= this.timeout(20000); it('dispose removes renderer canvases', async () => { await setupBrowser(); assert.equal(await page.evaluate(`document.querySelectorAll('.xterm canvas').length`), 3); await page.evaluate(`addon.dispose()`); assert.equal(await page.evaluate(`document.querySelectorAll('.xterm canvas').length`), 0); await browser.close(); >>>>>>> it('dispose removes renderer canvases', async () => { await setupBrowser(); assert.equal(await page.evaluate(`document.querySelectorAll('.xterm canvas').length`), 3); await page.evaluate(`addon.dispose()`); assert.equal(await page.evaluate(`document.querySelectorAll('.xterm canvas').length`), 0); await browser.close(); <<<<<<< } async function pollFor<T>(page: puppeteer.Page, evalOrFn: string | (() => Promise<T>), val: T, preFn?: () => Promise<void>): Promise<void> { if (preFn) { await preFn(); } const result = typeof evalOrFn === 'string' ? await page.evaluate(evalOrFn) : await evalOrFn(); let equal = false; if (typeof result === 'object') { equal = Object.keys(result).every(e => result[e] === (val as any)[e]); } else { equal = result === val; } if (!equal) { return new Promise<void>(r => { setTimeout(() => r(pollFor(page, evalOrFn, val, preFn)), 10); }); } ======= } async function setupBrowser(): Promise<void> { browser = await puppeteer.launch({ headless: process.argv.indexOf('--headless') !== -1, slowMo: 80, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); page = (await browser.pages())[0]; await page.setViewport({ width, height }); await page.goto(APP); await openTerminal({ rendererType: 'dom' }); await page.evaluate(` window.addon = new WebglAddon(true); window.term.loadAddon(window.addon); `); >>>>>>> } async function setupBrowser(): Promise<void> { browser = await puppeteer.launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`, `--no-sandbox`] }); page = (await browser.pages())[0]; await page.setViewport({ width, height }); await page.goto(APP); await openTerminal({ rendererType: 'dom' }); await page.evaluate(` window.addon = new WebglAddon(true); window.term.loadAddon(window.addon); `); } async function pollFor<T>(page: puppeteer.Page, evalOrFn: string | (() => Promise<T>), val: T, preFn?: () => Promise<void>): Promise<void> { if (preFn) { await preFn(); } const result = typeof evalOrFn === 'string' ? await page.evaluate(evalOrFn) : await evalOrFn(); let equal = false; if (typeof result === 'object') { equal = Object.keys(result).every(e => result[e] === (val as any)[e]); } else { equal = result === val; } if (!equal) { return new Promise<void>(r => { setTimeout(() => r(pollFor(page, evalOrFn, val, preFn)), 10); }); }
<<<<<<< if (!this.mouseEvents) { // Convert wheel events into up/down events when the buffer does not have scrollback, this // enables scrolling in apps hosted in the alt buffer such as vim or tmux. if (!this.buffer.hasScrollback) { const amount = this.viewport.getLinesScrolled(ev); // Do nothing if there's no vertical scroll if (amount === 0) { return; } // Construct and send sequences const sequence = C0.ESC + (this.applicationCursor ? 'O' : '[') + ( ev.deltaY < 0 ? 'A' : 'B'); let data = ''; for (let i = 0; i < Math.abs(amount); i++) { data += sequence; } this.send(data); } return; } if (this.x10Mouse || this.vt300Mouse || this.decLocator) return; ======= if (!this.mouseEvents) return; if (this.x10Mouse || this._vt300Mouse || this._decLocator) return; >>>>>>> if (!this.mouseEvents) { // Convert wheel events into up/down events when the buffer does not have scrollback, this // enables scrolling in apps hosted in the alt buffer such as vim or tmux. if (!this.buffer.hasScrollback) { const amount = this.viewport.getLinesScrolled(ev); // Do nothing if there's no vertical scroll if (amount === 0) { return; } // Construct and send sequences const sequence = C0.ESC + (this.applicationCursor ? 'O' : '[') + ( ev.deltaY < 0 ? 'A' : 'B'); let data = ''; for (let i = 0; i < Math.abs(amount); i++) { data += sequence; } this.send(data); } return; } if (this.x10Mouse || this._vt300Mouse || this._decLocator) return;
<<<<<<< import { ITerminalOptions } from 'xterm'; import { pollFor, timeout, writeSync, getBrowserType } from './TestUtils'; import { Browser, Page } from 'playwright'; ======= import { pollFor, timeout, writeSync, openTerminal } from './TestUtils'; >>>>>>> import { pollFor, timeout, writeSync, openTerminal, getBrowserType } from './TestUtils'; import { Browser, Page } from 'playwright'; <<<<<<< async function moveMouseCell(page: Page, dimensions: IDimensions, col: number, row: number) { ======= async function moveMouseCell(page: puppeteer.Page, dimensions: IDimensions, col: number, row: number): Promise<void> { >>>>>>> async function moveMouseCell(page: Page, dimensions: IDimensions, col: number, row: number): Promise<void> {
<<<<<<< private static performSymlink(installDirectory: string, previouslyLinkedFiles: string[]): string[] | R2Error { const fs = FsProvider.instance; ======= private static performLink(installDirectory: string, previouslyLinkedFiles: string[]): string[] | R2Error { >>>>>>> private static performLink(installDirectory: string, previouslyLinkedFiles: string[]): string[] | R2Error { const fs = FsProvider.instance; <<<<<<< FileUtils.ensureDirectory(path.join(installDirectory, 'r2modman')) } catch(e) { const err: Error = e; return new R2Error( 'Failed to ensure directory was created', err.message, 'If r2modman was installed in the Risk of Rain 2 directory, please reinstall in a different location. \nIf not, try running the manager as an administrator.' ) } try { LoggerProvider.instance.Log(LogSeverity.INFO, `Files to remove: \n-> ${previouslyLinkedFiles.join('\n-> ')}`); ======= Logger.Log(LogSeverity.INFO, `Files to remove: \n-> ${previouslyLinkedFiles.join('\n-> ')}`); >>>>>>> LoggerProvider.instance.Log(LogSeverity.INFO, `Files to remove: \n-> ${previouslyLinkedFiles.join('\n-> ')}`); <<<<<<< LoggerProvider.instance.Log(LogSeverity.INFO, `Removing previously copied file: ${file}`); if (fs.existsSync(file)) { if (fs.lstatSync(file).isDirectory()) { FileUtils.emptyDirectory(file); fs.rmdirSync(file); } else { fs.unlinkSync(file); } } ======= Logger.Log(LogSeverity.INFO, `Removing previously copied file: ${file}`); if (fs.existsSync(file)) { fs.removeSync(file); } >>>>>>> LoggerProvider.instance.Log(LogSeverity.INFO, `Removing previously copied file: ${file}`); if (fs.existsSync(file)) { if (fs.lstatSync(file).isDirectory()) { FileUtils.emptyDirectory(file); fs.rmdirSync(file); } else { fs.unlinkSync(file); } } <<<<<<< private static performLegacyInstall(installDirectory: string, previouslyLinkedFiles: string[]): string[] | R2Error { const fs = FsProvider.instance; const newLinkedFiles: string[] = []; const dir: string = path.join(installDirectory, 'r2modman'); try { if (fs.existsSync(dir)) { FileUtils.emptyDirectory(dir); } previouslyLinkedFiles.forEach((file: string) => { if (fs.existsSync(file)) { if (fs.lstatSync(file).isDirectory()) { FileUtils.emptyDirectory(file); fs.rmdirSync(file); } else { fs.unlinkSync(file); } } }); const profileFiles = fs.readdirSync(Profile.getActiveProfile().getPathOfProfile()); profileFiles.forEach((file: string) => { if (fs.lstatSync(path.join(Profile.getActiveProfile().getPathOfProfile(), file)).isFile()) { if (file.toLowerCase() !== 'mods.yml') { // Symlink Files in Install Root try { if (fs.existsSync(path.join(installDirectory, file))) { fs.unlinkSync(path.join(installDirectory, file)); } fs.copyFileSync(path.join(Profile.getActiveProfile().getPathOfProfile(), file), path.join(installDirectory, file)); newLinkedFiles.push(path.join(installDirectory, file)); } catch(e) { const err: Error = e; throw new FileWriteError( `Couldn't copy file ${file} to RoR2 directory`, err.message, 'Try running r2modman as an administrator' ) } } } else { fs.copyFolderSync(path.join(Profile.getActiveProfile().getPathOfProfile(), file), path.join(dir, file)); newLinkedFiles.push(path.join(dir, file)); } }) } catch(e) { const err: Error = e; return new FileWriteError( 'Failed to produce a symlink between profile and RoR2', err.message, 'If r2modman was installed in the Risk of Rain 2 directory, please reinstall in a different location. \nIf not, try running the manager as an administrator.' ); } return newLinkedFiles; } ======= >>>>>>>
<<<<<<< this.eventHub.on("afterRender", () => { this.invokePlugins("afterRender"); }); ======= this.hookPlugins(); >>>>>>> this.hookPlugins(); this.eventHub.on("afterRender", () => { this.invokePlugins("afterRender"); });
<<<<<<< private scale: number = 1; ======= /** Current scale of the document */ private scale = 1; >>>>>>> /** Current scale of the document */ private scale = 1; <<<<<<< this.paper.node.addEventListener("mousewheel", ev => { // Cancel the mousewheel event if a drag event is currently being handled if (this.isDragging) { return; } ======= /** * Whenever user scrolls, take the scroll delta and scale the workflow. */ this.svgRoot.addEventListener("mousewheel", (ev: MouseWheelEvent) => { >>>>>>> /** * Whenever user scrolls, take the scroll delta and scale the workflow. */ this.svgRoot.addEventListener("mousewheel", (ev: MouseWheelEvent) => { if (this.isDragging) { return; } <<<<<<< let selectedStuff = this.workflow.querySelectorAll(".selected"); if (selectedStuff.length) { selectedStuff = selectedStuff.item(0).getAttribute("data-connection-id"); } else { selectedStuff = undefined; } ======= // We might have an active selection that we want to preserve upon redrawing, save it let selectedStuff = this.workflow.querySelector(".selected"); let selectedItemConnectionID = selectedStuff ? selectedStuff.getAttribute("data-connection-id") : undefined; >>>>>>> // We might have an active selection that we want to preserve upon redrawing, save it let selectedStuff = this.workflow.querySelector(".selected"); let selectedItemConnectionID = selectedStuff ? selectedStuff.getAttribute("data-connection-id") : undefined; <<<<<<< Array.from(this.workflow.querySelectorAll(".node .label")) .map((el: SVGGElement) => el.transform.baseVal.getItem(0).matrix) .forEach(m => { m.a = labelScale; m.d = labelScale; }); /** * @name workflow.fit */ this.eventHub.on("workflow.fit", () => { this.group.transform(new Snap.Matrix()); let {clientWidth: paperWidth, clientHeight: paperHeight} = this.paper.node; let clientBounds = this.paper.node.getBoundingClientRect(); let wfBounds = this.group.node.getBoundingClientRect(); const padding = 200; const verticalScale = (wfBounds.height + padding) / paperHeight; const horizontalScale = (wfBounds.width + padding) / paperWidth; const scaleFactor = Math.max(verticalScale, horizontalScale); this.command("workflow.scale", 1 / scaleFactor); let paperBounds = this.paper.node.getBoundingClientRect(); wfBounds = this.group.node.getBoundingClientRect(); const moveY = scaleFactor * -wfBounds.top + scaleFactor * clientBounds.top + scaleFactor * Math.abs(paperBounds.height - wfBounds.height) / 2; const moveX = scaleFactor * -wfBounds.left + scaleFactor * clientBounds.left + scaleFactor * Math.abs(paperBounds.width - wfBounds.width) / 2; this.group.transform(this.group.transform().localMatrix.clone().translate(moveX, moveY)); }); ======= Array.from(this.workflow.querySelectorAll(".node .label")) .map((el: SVGTextElement) => el.transform.baseVal.getItem(0).matrix) .forEach(m => { m.a = labelScale; m.d = labelScale; }); >>>>>>> Array.from(this.workflow.querySelectorAll(".node .label")) .map((el: SVGTextElement) => el.transform.baseVal.getItem(0).matrix) .forEach(m => { m.a = labelScale; m.d = labelScale; }); <<<<<<< this.domEvents.drag(".node .drag-handle", (dx: number, dy: number, ev: any, handle: SVGGElement): any => { const el = handle.parentNode; ======= this.domEvents.drag(".node .drag-handle", (dx, dy, ev, handle: SVGGElement) => { const nodeEl = handle.parentNode as SVGGElement; >>>>>>> this.domEvents.drag(".node .drag-handle", (dx: number, dy: number, ev, handle: SVGGElement) => { const nodeEl = handle.parentNode as SVGGElement; <<<<<<< this.isDragging = true; const el = handle.parentNode; const matrix = el.transform.baseVal.getItem(0).matrix; startX = matrix.e; startY = matrix.f; inputEdges = new Map(); outputEdges = new Map(); ======= const el = handle.parentNode as SVGGElement; const matrix = el.transform.baseVal.getItem(0).matrix; startX = matrix.e; startY = matrix.f; inputEdges = new Map<SVGElement, number[]>(); outputEdges = new Map<SVGElement, number[]>(); >>>>>>> this.isDragging = true; const el = handle.parentNode as SVGGElement; const matrix = el.transform.baseVal.getItem(0).matrix; startX = matrix.e; startY = matrix.f; inputEdges = new Map<SVGElement, number[]>(); outputEdges = new Map<SVGElement, number[]>(); <<<<<<< pathInfo?: { startX: number, startY: number, inputEdges: Map<SVGElement, number[]>, outputEdges: Map<SVGElement, number[]> }, ghostIO?: { edge: SVGPathElement, nodeToMouseDistance: number, allConnectionPorts: SVGGElement[], highlightedPort: SVGGElement, origin: { x: number, y: number }, coords: { x: number, y: number } edgeDirection: "left" | "right" }): void { ======= pathInfo?: { startX: number, startY: number, inputEdges: Map<SVGElement, number[]>, outputEdges: Map<SVGElement, number[]> }, ghostIO?: { edge, originX: number, originY: number, edgeDirection: string }): void { >>>>>>> pathInfo?: { startX: number, startY: number, inputEdges: Map<SVGElement, number[]>, outputEdges: Map<SVGElement, number[]> }, ghostIO?: { edge: SVGPathElement, nodeToMouseDistance: number, connectionPorts: SVGGElement[], highlightedPort: SVGGElement, origin: { x: number, y: number }, coords: { x: number, y: number }, portToOriginTransformation: WeakMap<SVGGElement, SVGMatrix>, edgeDirection: "left" | "right" }): void { <<<<<<< ======= } // when mouse is brought back to the main workflow area else if (edgeIntervalOn) { const mouseCoords = this.transformScreenCTMtoCanvas(ev.clientX, ev.clientY); sdx = mouseCoords.x - startX; sdy = mouseCoords.y - startY; this.dragBoundaryInterval.xOffset = sdx - this.adaptToScale(dx); this.dragBoundaryInterval.yOffset = sdy - this.adaptToScale(dy); >>>>>>> <<<<<<< let edge: SVGPathElement; let preferredConnectionPorts: SVGGElement[]; let allConnectionPorts: SVGGElement[]; ======= let edge; let preferredConnectionPorts; let allOppositeConnectionPorts; >>>>>>> let edge: SVGPathElement; let preferredConnectionPorts: SVGGElement[]; let allOppositeConnectionPorts: SVGGElement[]; <<<<<<< this.setDragBoundaryIntervalIfNecessary(ghostIONode, { x: boundary.x, y: boundary.y }, null, { edge: edge, nodeToMouseDistance: nodeToMouseDistance, allConnectionPorts, highlightedPort, origin, coords, edgeDirection: edgeDirection } ); ======= this.setDragBoundaryIntervalIfNecessary(ghostIONode, {x: boundary.x, y: boundary.y}, null, {edge: edge, originX: origin.x, originY: origin.y, edgeDirection: edgeDirection}); >>>>>>> this.setDragBoundaryIntervalIfNecessary(ghostIONode, { x: boundary.x, y: boundary.y }, null, { edge, nodeToMouseDistance, connectionPorts: allOppositeConnectionPorts, highlightedPort, origin, coords, portToOriginTransformation, edgeDirection } ); <<<<<<< const sorted = this.getSortedConnectionPorts(allConnectionPorts, coords); highlightedPort = this.dragBoundaryInterval.highlightedPort || highlightedPort; this.removeHighlightedPort(highlightedPort, edgeDirection); highlightedPort = this.setHighlightedPort(sorted, edgeDirection); this.translateGhostNodeAndShowIfNecessary(ghostIONode, nodeToMouseDistance, highlightedPort !== undefined, { x: origin.x + scaledDeltas.x, y: origin.y + scaledDeltas.y}); ======= const sorted = allOppositeConnectionPorts.map(el => { const ctm = portToOriginTransformation.get(el); el.distance = Geometry.distance(coords.x, coords.y, ctm.e, ctm.f); return el; }).sort((el1, el2) => { return el1.distance - el2.distance }); if (highlightedPort) { const parentNode = Workflow.findParentNode(highlightedPort); highlightedPort.classList.remove("highlighted", "preferred-port"); parentNode.classList.remove("highlighted", "preferred-node", edgeDirection); } ghostIONode.classList.add("hidden"); // If there is a port in close proximity, assume that we want to connect to it, so highlight it if (sorted.length && sorted[0].distance < 100) { highlightedPort = sorted[0]; highlightedPort.classList.add("highlighted", "preferred-port"); const parentNode = Workflow.findParentNode(highlightedPort); this.workflow.appendChild(parentNode); parentNode.classList.add("highlighted", "preferred-node", edgeDirection); } else { >>>>>>> const sorted = this.getSortedConnectionPorts(allOppositeConnectionPorts, coords, portToOriginTransformation); highlightedPort = this.dragBoundaryInterval.highlightedPort || highlightedPort; this.removeHighlightedPort(highlightedPort, edgeDirection); highlightedPort = this.setHighlightedPort(sorted, edgeDirection); this.translateGhostNodeAndShowIfNecessary(ghostIONode, nodeToMouseDistance, highlightedPort !== undefined, { x: origin.x + scaledDeltas.x, y: origin.y + scaledDeltas.y}); <<<<<<< this.isDragging = true; ======= portToOriginTransformation = new WeakMap<SVGGElement, SVGMatrix>() >>>>>>> this.isDragging = true; portToOriginTransformation = new WeakMap<SVGGElement, SVGMatrix>() <<<<<<< ).filter((el: SVGGElement) => { // Except the same node that we are dragging from return Workflow.findParentNode(el) !== originNode; }).map((el: SVGGElement) => { ======= ).filter(el => Workflow.findParentNode(el) !== originNode); >>>>>>> ).filter((el: SVGGElement) => Workflow.findParentNode(el) !== originNode) as SVGGElement[]; <<<<<<< const el: SVGGElement = <SVGGElement>this.workflow.querySelector(`.port[data-connection-id="${p.connectionId}"]`); el.wfCTM = Geometry.getTransformToElement(el, this.workflow); ======= const el = this.workflow.querySelector(`.port[data-connection-id="${p.connectionId}"]`) as SVGGElement; portToOriginTransformation.set(el, Geometry.getTransformToElement(el, this.workflow)); >>>>>>> const el = this.workflow.querySelector(`.port[data-connection-id="${p.connectionId}"]`) as SVGGElement; portToOriginTransformation.set(el, Geometry.getTransformToElement(el, this.workflow));
<<<<<<< const manager = await CustomRulePathManager.create({}); const classpathEntries = await manager.addPathsForLanguage(language, paths); ======= const manager = await CustomRulePathManager.create(); const classpathEntries = await manager.addPathsForLanguage(language, path); >>>>>>> const manager = await CustomRulePathManager.create(); const classpathEntries = await manager.addPathsForLanguage(language, paths);
<<<<<<< <input class="ng2-flatpickr-input {{ addClass }}" [placeholder]="placeholder" [tabindex]="tabindex" type="text" data-input> </div>`, ======= <input *ngIf="!hideButton" class="ng2-flatpickr-input" [placeholder]="placeholder" type="text" data-input> <ng-content></ng-content> </div> `, >>>>>>> <input *ngIf="!hideButton" class="ng2-flatpickr-input {{ addClass }}" [placeholder]="placeholder" [tabindex]="tabindex" type="text" data-input> <ng-content></ng-content> </div> `, <<<<<<< @Input() get tabindex() { return this._tabindex; } set tabindex( ti: number ) { this._tabindex = Number( ti ); } ======= @Input() hideButton = false; >>>>>>> @Input() get tabindex() { return this._tabindex; } set tabindex( ti: number ) { this._tabindex = Number( ti ); } @Input() hideButton = false;
<<<<<<< this.implementation = node.implementation; this.sslVerification = node.sslVerification; this.chainAddress = node.onChainAddress; ======= this.accessKey = node.accessKey; this.implementation = node.implementation || 'lnd'; this.sslVerification = node.sslVerification || false; >>>>>>> this.accessKey = node.accessKey; this.implementation = node.implementation || 'lnd'; this.sslVerification = node.sslVerification || false; this.chainAddress = node.onChainAddress; <<<<<<< const data = response.json(); const newAddress = data.address; this.settings.nodes[ this.settings.selectedNode || 0 ].onChainAddress = newAddress; const newSettings = this.settings; ======= this.chainAddress = data.address; const newSettings = { ...this.settings, onChainAddress: data.address }; >>>>>>> const newAddress = data.address; this.settings.nodes[ this.settings.selectedNode || 0 ].onChainAddress = newAddress; const newSettings = this.settings;
<<<<<<< import { Injectable, Inject } from '@angular/core' import { AlertController } from '@ionic/angular' ======= import { StorageProvider, SettingsKey } from './../storage/storage' import { Injectable } from '@angular/core' import { AlertController, Platform } from '@ionic/angular' >>>>>>> import { Injectable, Inject } from '@angular/core' import { AlertController } from '@ionic/angular' import { StorageProvider, SettingsKey } from './../storage/storage' <<<<<<< private readonly serializerService: SerializerService, @Inject(APP_PLUGIN) private readonly app: AppPlugin ======= private readonly serializerService: SerializerService, private readonly storageProvider: StorageProvider >>>>>>> private readonly serializerService: SerializerService, @Inject(APP_PLUGIN) private readonly app: AppPlugin, private readonly storageProvider: StorageProvider
<<<<<<< import { BeaconRequestPage } from './pages/beacon-request/beacon-request.page' import { BeaconRequestPageModule } from './pages/beacon-request/beacon-request.module' ======= import { ExtensionsService } from './services/extensions/extensions.service' >>>>>>> import { BeaconRequestPage } from './pages/beacon-request/beacon-request.page' import { BeaconRequestPageModule } from './pages/beacon-request/beacon-request.module' import { ExtensionsService } from './services/extensions/extensions.service' <<<<<<< entryComponents: [ProtocolSelectPage, IntroductionPushPage, BeaconRequestPage], ======= entryComponents: [ProtocolSelectPage, IntroductionPushPage, ExchangeSelectPage], >>>>>>> entryComponents: [ProtocolSelectPage, IntroductionPushPage, BeaconRequestPage, ExchangeSelectPage], <<<<<<< IntroductionPushPageModule, BeaconRequestPageModule ======= ExchangeSelectPageModule, IntroductionPushPageModule >>>>>>> BeaconRequestPageModule, ExchangeSelectPageModule, IntroductionPushPageModule
<<<<<<< import { supportsDelegation } from 'src/app/helpers/delegation' // import 'core-js/es7/object' ======= import { timer, Subscription } from 'rxjs' >>>>>>> import { supportsDelegation } from 'src/app/helpers/delegation' import { timer, Subscription } from 'rxjs' <<<<<<< private readonly pushBackendProvider: PushBackendProvider ======= private readonly loadingController: LoadingController, private readonly pushBackendProvider: PushBackendProvider, private readonly exchangeProvider: ExchangeProvider >>>>>>> private readonly pushBackendProvider: PushBackendProvider, private readonly exchangeProvider: ExchangeProvider
<<<<<<< public delegateeLabel: string = 'Validator' ======= public airGapDelegatee?: string = 'cosmosvaloper1n3f5lm7xtlrp05z9ud2xk2cnvk2xnzkm2he6er' public delegateeLabel: string = 'delegation-detail-cosmos.delegatee-label' public delegateeLabelPlural: string = 'delegation-detail-cosmos.delegatee-label-plural' public supportsMultipleDelegations: boolean = true private knownValidators?: CosmosValidatorDetails[] >>>>>>> public delegateeLabel: string = 'delegation-detail-cosmos.delegatee-label' public delegateeLabelPlural: string = 'delegation-detail-cosmos.delegatee-label-plural' public supportsMultipleDelegations: boolean = true private knownValidators?: CosmosValidatorDetails[] <<<<<<< public airGapDelegatee(_protocol: CosmosProtocol): string { return 'cosmosvaloper1n3f5lm7xtlrp05z9ud2xk2cnvk2xnzkm2he6er' } // TODO: add translations ======= >>>>>>> public airGapDelegatee(_protocol: CosmosProtocol): string { return 'cosmosvaloper1n3f5lm7xtlrp05z9ud2xk2cnvk2xnzkm2he6er' } // TODO: add translations
<<<<<<< public delegatedAmount: string private readonly validatorAddress: string = 'cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0' public validatorInfo: CosmosValidatorInfo ======= public delegatedAmount: BigNumber public validatorAddress: string = 'cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0' public validatorAlias: string public validatorInfos: ValidatorInfos >>>>>>> public delegatedAmount: BigNumber public validatorAddress: string = 'cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0' public validatorAlias: string public validatorInfo: CosmosValidatorInfo <<<<<<< this.checkAddressDelegations() ======= >>>>>>> <<<<<<< this.getValidatorInfo() ======= >>>>>>> <<<<<<< public async getValidatorInfo() { this.validatorInfo = await this.validatorService.getValidatorInfos(this.validatorAddress) this.validatorCommission = this.validatorInfo.rate this.validatorStatus = this.validatorInfo.status this.totalDelegationBalance = this.validatorInfo.totalDelegationBalance ======= public async getValidatorInfos() { this.validatorInfos = await this.validatorService.getValidatorInfos(this.validatorAddress) this.validatorCommission = this.validatorInfos.rate this.validatorAlias = this.validatorInfos.alias this.validatorStatus = this.validatorInfos.status this.totalDelegationBalance = this.validatorInfos.totalDelegationBalance >>>>>>> public async getValidatorInfo() { this.validatorInfo = await this.validatorService.getValidatorInfo(this.validatorAddress) this.validatorCommission = this.validatorInfo.rate this.validatorAlias = this.validatorInfo.alias this.validatorStatus = this.validatorInfo.status this.totalDelegationBalance = this.validatorInfo.totalDelegationBalance
<<<<<<< import { ProtocolDelegationExtensions } from './ProtocolDelegationExtensions' const supportedActions = [ SubstrateStakingActionType.BOND_NOMINATE, SubstrateStakingActionType.BOND_EXTRA, SubstrateStakingActionType.CANCEL_NOMINATION, SubstrateStakingActionType.CHANGE_NOMINATION, SubstrateStakingActionType.WITHDRAW_UNBONDED ] ======= import { SubstrateValidatorDetails } from 'airgap-coin-lib/dist/protocols/substrate/helpers/data/staking/SubstrateValidatorDetails' import { UIRewardList } from 'src/app/models/widgets/display/UIRewardList' import { TranslateService } from '@ngx-translate/core' >>>>>>> import { ProtocolDelegationExtensions } from './ProtocolDelegationExtensions' <<<<<<< public airGapDelegatee(_protocol: SubstrateProtocol): string | undefined { return undefined } public delegateeLabel: string = 'Validator' ======= public airGapDelegatee?: string = undefined public delegateeLabel: string = 'delegation-detail-substrate.delegatee-label' public delegateeLabelPlural: string = 'delegation-detail-substrate.delegatee-label-plural' public supportsMultipleDelegations: boolean = true >>>>>>> public airGapDelegatee(_protocol: SubstrateProtocol): string | undefined { return undefined } public delegateeLabel: string = 'delegation-detail-substrate.delegatee-label' public delegateeLabelPlural: string = 'delegation-detail-substrate.delegatee-label-plural' public supportsMultipleDelegations: boolean = true
<<<<<<< const migrateAction: ButtonAction<TezosDelegateActionResult, void> = new ButtonAction( { name: 'account-transaction-list.migrate_label', icon: 'return-down-back-outline', identifier: 'migrate-action' }, ======= const migrateAction = new ButtonAction<void, AirGapTezosMigrateActionContext>( { name: 'account-transaction-list.migrate_label', icon: 'return-right', identifier: 'migrate-action' }, >>>>>>> const migrateAction = new ButtonAction<void, AirGapTezosMigrateActionContext>( { name: 'account-transaction-list.migrate_label', icon: 'return-down-back-outline', identifier: 'migrate-action' },
<<<<<<< import moment from 'moment' const hoursPerCycle = 68 ======= import moment from 'moment' >>>>>>> import moment from 'moment' const hoursPerCycle = 68 <<<<<<< public isDelegated: boolean public nextPayout: Date ======= public isDelegated: boolean public nextPayout: Date = moment() .add(476, 'h') .toDate() public firstPayout: Date = moment() .add(476, 'h') .toDate() >>>>>>> public isDelegated: boolean public nextPayout: Date <<<<<<< const { isDelegated, value } = await this.operationsProvider.checkDelegated(this.wallet.receivingPublicAddress) this.isDelegated = isDelegated ======= const { isDelegated } = await this.operationsProvider.checkDelegated(this.wallet.receivingPublicAddress) this.isDelegated = isDelegated >>>>>>> const { isDelegated, value } = await this.operationsProvider.checkDelegated(this.wallet.receivingPublicAddress) this.isDelegated = isDelegated <<<<<<< // we are already delegating, and to this address if (isDelegated && value && value === this.bakerConfig.address) { const delegatedCycles = this.delegationRewards.filter(value => value.delegatedBalance.isGreaterThan(0)) this.nextPayout = delegatedCycles.length > 0 ? delegatedCycles[0].payout : moment() .add(hoursPerCycle * 7, 'h') .toDate() } else { this.nextPayout = moment() .add(hoursPerCycle * 7, 'h') .toDate() } console.log(this.delegationRewards) ======= this.nextPayout = this.delegationRewards[0].payout this.firstPayout = this.delegationRewards[this.delegationRewards.length - 1].payout >>>>>>> // we are already delegating, and to this address if (isDelegated && value && value === this.bakerConfig.address) { const delegatedCycles = this.delegationRewards.filter(value => value.delegatedBalance.isGreaterThan(0)) this.nextPayout = delegatedCycles.length > 0 ? delegatedCycles[0].payout : moment() .add(hoursPerCycle * 7, 'h') .toDate() } else { this.nextPayout = moment() .add(hoursPerCycle * 7, 'h') .toDate() }
<<<<<<< import { switchMap, map } from 'rxjs/operators' import { from } from 'rxjs' import { UIAccountSummary } from 'src/app/models/widgets/display/UIAccountSummary' import { ShortenStringPipe } from 'src/app/pipes/shorten-string/shorten-string.pipe' import { TranslateService } from '@ngx-translate/core' const hoursPerCycle: number = 68 ======= >>>>>>> import { UIAccountSummary } from 'src/app/models/widgets/display/UIAccountSummary' import { ShortenStringPipe } from 'src/app/pipes/shorten-string/shorten-string.pipe' import { TranslateService } from '@ngx-translate/core' <<<<<<< private async createDelegatorDisplayDetails( protocol: TezosProtocol, delegatorDetails: DelegatorDetails, delegatorExtraInfo: DelegationInfo, baker: string ): Promise<UIWidget[]> { const details = [] const knownBakers: TezosBakerCollection = await this.getKnownBakers() const knownBaker = knownBakers[baker] try { const bakerRewards = await protocol.getDelegationRewards(baker) details.push(...this.createFuturePayoutWidgets(protocol, delegatorDetails, delegatorExtraInfo, baker, bakerRewards, knownBaker)) } catch (error) { // Baker was never delegated } return details } private async getRewardAmountsByCycle( protocol: TezosProtocol, accountAddress: string, bakerAddress: string ): Promise<Map<number, string>> { const currentCycle = await protocol.fetchCurrentCycle() const cycles = [...Array(6).keys()].map(num => currentCycle - num) return new Map<number, string>( await Promise.all( cycles.map( async (cycle): Promise<[number, string]> => [ cycle, await this.getRewardAmountByCycle(protocol, accountAddress, bakerAddress, cycle) ] ) ) ) } private async getRewardAmountByCycle( protocol: TezosProtocol, accountAddress: string, bakerAddress: string, cycle: number ): Promise<string> { const knownBakers: TezosBakerCollection = await this.getKnownBakers() const knownBaker = knownBakers[bakerAddress] const firstWithFee = Object.values(knownBakers).find((baker: TezosBakerDetails) => baker.fee) const defaultFee = firstWithFee ? firstWithFee.fee : new BigNumber(0) const fee = knownBaker && knownBaker.fee ? knownBaker.fee : defaultFee return from(protocol.calculateRewards(bakerAddress, cycle)) .pipe( switchMap(tezosRewards => from(protocol.calculatePayout(accountAddress, tezosRewards)).pipe( map(payout => { return payout ? `~${this.amountConverter.transform(new BigNumber(payout.payout).minus(new BigNumber(payout.payout).times(fee)), { protocolIdentifier: protocol.identifier, maxDigits: 6 })}` : null }) ) ) ) .toPromise() } ======= >>>>>>> <<<<<<< const amountByCycle = await this.getRewardAmountsByCycle(protocol, address, delegatorExtraInfo.value) ======= >>>>>>> <<<<<<< rewards: rewardInfo.slice(0, 5).map(reward => ({ index: reward.cycle, amount: amountByCycle.get(reward.cycle), collected: reward.payout < new Date(), timestamp: reward.payout.getTime() })), indexColLabel: 'delegation-detail-tezos.rewards.index-col_label', amountColLabel: 'delegation-detail-tezos.rewards.amount-col_label', payoutColLabel: 'delegation-detail-tezos.rewards.payout-col_label' ======= rewards: rewardInfo .map(info => { return { index: info.cycle, amount: this.amountConverter.transform(new BigNumber(info.reward), { protocolIdentifier: protocol.identifier, maxDigits: 10 }), collected: info.payout < new Date(), timestamp: info.payout.getTime() } }) .reverse(), indexColLabel: 'Cycle', amountColLabel: 'Expected Reward', payoutColLabel: 'Earliest Payout' >>>>>>> rewards: rewardInfo .map(info => { return { index: info.cycle, amount: this.amountConverter.transform(new BigNumber(info.reward), { protocolIdentifier: protocol.identifier, maxDigits: 10 }), collected: info.payout < new Date(), timestamp: info.payout.getTime() } }) .reverse(), indexColLabel: 'delegation-detail-tezos.rewards.index-col_label', amountColLabel: 'delegation-detail-tezos.rewards.amount-col_label', payoutColLabel: 'delegation-detail-tezos.rewards.payout-col_label' <<<<<<< private createFuturePayoutWidgets( protocol: TezosProtocol, delegatorDetails: DelegatorDetails, delegatorExtraInfo: DelegationInfo, baker: string, bakerRewards: DelegationRewardInfo[], bakerDetails?: TezosBakerDetails ): UIWidget[] { const nextPayout = this.getNextPayoutMoment(delegatorExtraInfo, bakerRewards, bakerDetails ? bakerDetails.payoutDelay : undefined) const avgRoIPerCyclePercentage = bakerRewards .map(rewardInfo => rewardInfo.totalRewards.plus(rewardInfo.totalFees).div(rewardInfo.stakingBalance)) .reduce((avg, value) => avg.plus(value)) .div(bakerRewards.length) const avgRoIPerCycle = new BigNumber(avgRoIPerCyclePercentage).multipliedBy(delegatorDetails.balance) return [ new UIIconText({ iconName: 'sync-outline', text: nextPayout.fromNow(), description: delegatorDetails.delegatees.includes(baker) ? 'delegation-detail-tezos.next-payout_label' : 'delegation-detail-tezos.first-payout_label' }), new UIIconText({ iconName: 'alarm-outline', text: this.amountConverter.transform(avgRoIPerCycle.toFixed(), { protocolIdentifier: protocol.identifier, maxDigits: 10 }), description: 'delegation-detail-tezos.return-per-cycle_label' }) ] } private getNextPayoutMoment( delegatorExtraInfo: DelegationInfo, bakerRewards: DelegationRewardInfo[], bakerPayoutCycles?: number ): Moment { let nextPayout: Moment if (delegatorExtraInfo.isDelegated) { const delegatedCycles = bakerRewards.filter(value => value.delegatedBalance.isGreaterThan(0)) const delegatedDate = delegatorExtraInfo.delegatedDate nextPayout = delegatedCycles.length > 0 ? moment(delegatedCycles[0].payout) : this.addPayoutDelayToMoment(moment(), bakerPayoutCycles) if (this.addPayoutDelayToMoment(moment(delegatedDate), bakerPayoutCycles).isAfter(nextPayout)) { nextPayout = this.addPayoutDelayToMoment(moment(delegatedDate), bakerPayoutCycles) } } else { nextPayout = this.addPayoutDelayToMoment(moment(), bakerPayoutCycles) } return nextPayout } private addPayoutDelayToMoment(time: Moment, payoutCycles?: number): Moment { return time.add(hoursPerCycle * 7 + payoutCycles || 0, 'h') } private async getKnownBakers(): Promise<TezosBakerCollection> { if (this.knownBakers === undefined) { this.knownBakers = await this.remoteConfigProvider.getKnownTezosBakers() } return this.knownBakers } private getFormattedCycleDuration(protocol: TezosProtocol): string { const cycleDuration = moment.duration(protocol.minCycleDuration) const days = Math.floor(cycleDuration.asDays()) const hours = Math.floor(cycleDuration.asHours() - days * 24) const minutes = Math.floor(cycleDuration.asMinutes() - (days * 24 * 60 + hours * 60)) return `${days}d ${hours}h ${minutes}m` } ======= >>>>>>> private async getKnownBakers(): Promise<TezosBakerCollection> { if (this.knownBakers === undefined) { this.knownBakers = await this.remoteConfigProvider.getKnownTezosBakers() } return this.knownBakers } private getFormattedCycleDuration(protocol: TezosProtocol): string { const cycleDuration = moment.duration(protocol.minCycleDuration) const days = Math.floor(cycleDuration.asDays()) const hours = Math.floor(cycleDuration.asHours() - days * 24) const minutes = Math.floor(cycleDuration.asMinutes() - (days * 24 * 60 + hours * 60)) return `${days}d ${hours}h ${minutes}m` }
<<<<<<< import { AlertOptions } from '@ionic/core' import { AirGapDelegatorAction } from 'src/app/interfaces/IAirGapCoinDelegateProtocol' ======= import { AlertOptions } from '@ionic/angular/node_modules/@ionic/core' import { TranslateService } from '@ngx-translate/core' >>>>>>> import { AlertOptions } from '@ionic/core' import { TranslateService } from '@ngx-translate/core'
<<<<<<< //TODO this._readRenderTarget = RenderTexture.create({ width: stage.viewport.w, height: stage.viewport.h, depthBuffer: true }).setRepeat(false).retain(); this._writeRenderTarget = RenderTexture.create({ width: stage.viewport.w, height: stage.viewport.h, depthBuffer: true }).setRepeat(false).retain(); ======= >>>>>>>
<<<<<<< import { ICoinProtocol } from 'airgap-coin-lib' ======= import { Platform } from '@ionic/angular' import { ICoinProtocol, supportedProtocols } from 'airgap-coin-lib' import { SubProtocolType } from 'airgap-coin-lib/dist/protocols/ICoinSubProtocol' import { NetworkType } from 'airgap-coin-lib/dist/utils/ProtocolNetwork' import { LedgerService } from 'src/app/services/ledger/ledger-service' >>>>>>> import { Platform } from '@ionic/angular' import { ICoinProtocol } from 'airgap-coin-lib' import { LedgerService } from 'src/app/services/ledger/ledger-service' <<<<<<< private readonly dataService: DataService ) {} ======= private readonly dataService: DataService, private readonly ledgerService: LedgerService ) { this.supportedAccountProtocols = supportedProtocols() .filter((protocol: ICoinProtocol) => protocol.options.network.type === NetworkType.MAINNET) .map(coin => coin) this.supportedSubAccountProtocols = supportedProtocols() .filter((protocol: ICoinProtocol) => protocol.options.network.type === NetworkType.MAINNET) .reduce((pv, cv) => { if (cv.subProtocols) { const subProtocols = cv.subProtocols.filter( subProtocol => subProtocol.subProtocolType === SubProtocolType.TOKEN && this.protocolService.isProtocolActive(subProtocol) ) >>>>>>> private readonly ledgerService: LedgerService, private readonly dataService: DataService ) {}
<<<<<<< }, { path: 'delegation-detail/:id', resolve: { special: DataResolverService }, loadChildren: () => import('./pages/delegation-detail/delegation-detail.module').then(m => m.DelegationDetailPageModule) ======= }, { path: 'exchange-select', loadChildren: () => import('./pages/exchange-select/exchange-select.module').then(m => m.ExchangeSelectPageModule) }, { path: 'exchange-custom', loadChildren: () => import('./pages/exchange-custom/exchange-custom.module').then(m => m.ExchangeCustomPageModule) >>>>>>> }, { path: 'delegation-detail/:id', resolve: { special: DataResolverService }, loadChildren: () => import('./pages/delegation-detail/delegation-detail.module').then(m => m.DelegationDetailPageModule) }, { path: 'exchange-select', loadChildren: () => import('./pages/exchange-select/exchange-select.module').then(m => m.ExchangeSelectPageModule) }, { path: 'exchange-custom', loadChildren: () => import('./pages/exchange-custom/exchange-custom.module').then(m => m.ExchangeCustomPageModule)
<<<<<<< import { WidgetSelector } from './widget-selector/widget-selector' import { WidgetIconText } from './widget-icon-text/widget-icon-text' import { WidgetInputText } from './widget-input-text/widget-input-text' import { WidgetAccount } from './widget-account/widget-account' import { WidgetRewardList } from './widget-reward-list/widget-reward-list' ======= import { TezosDelegationStats } from './tezos-delegation-stats/tezos-delegation-stats' import { TransactionListComponent } from './transaction-list/transaction-list.component' import { TransactionItemComponent } from './transaction-item/transaction-item.component' >>>>>>> import { TransactionListComponent } from './transaction-list/transaction-list.component' import { TransactionItemComponent } from './transaction-item/transaction-item.component' import { WidgetSelector } from './widget-selector/widget-selector' import { WidgetIconText } from './widget-icon-text/widget-icon-text' import { WidgetInputText } from './widget-input-text/widget-input-text' import { WidgetAccount } from './widget-account/widget-account' import { WidgetRewardList } from './widget-reward-list/widget-reward-list' <<<<<<< DelegateEditPopoverComponent, WidgetSelector, WidgetAccount, WidgetIconText, WidgetInputText, WidgetRewardList ======= DelegateEditPopoverComponent, TransactionListComponent, TransactionItemComponent >>>>>>> DelegateEditPopoverComponent, TransactionListComponent, TransactionItemComponent, WidgetSelector, WidgetAccount, WidgetIconText, WidgetInputText, WidgetRewardList <<<<<<< DelegateEditPopoverComponent, WidgetSelector, WidgetAccount, WidgetIconText, WidgetInputText, WidgetRewardList ======= DelegateEditPopoverComponent, TransactionListComponent, TransactionItemComponent >>>>>>> DelegateEditPopoverComponent, TransactionListComponent, TransactionItemComponent, WidgetSelector, WidgetAccount, WidgetIconText, WidgetInputText, WidgetRewardList
<<<<<<< import { Component } from '@angular/core' import { Events, ModalController } from 'ionic-angular' import { IntroductionPage } from '../introduction/introduction' import { PortfolioPage } from '../portfolio/portfolio' import { ScanPage } from '../scan/scan' import { SettingsPage } from '../settings/settings' import { ExchangePage } from '../exchange/exchange' import { SettingsProvider, SettingsKey } from '../../providers/settings/settings' @Component({ templateUrl: 'tabs.html' }) export class TabsPage { tab1Root = PortfolioPage tab2Root = ScanPage tab3Root = ExchangePage tab4Root = SettingsPage constructor(public modalController: ModalController, private settingsProvider: SettingsProvider, private events: Events) { this.showIntroduction().catch(console.error) } private async showIntroduction() { const introduction = await this.settingsProvider.get(SettingsKey.INTRODUCTION) if (!introduction) { setTimeout(async () => { await this.settingsProvider.set(SettingsKey.INTRODUCTION, true) }, 3000) const modal = this.modalController.create(IntroductionPage) modal.onDidDismiss(() => { this.events.publish('scan:start') }) modal.present().catch(console.error) } } } ======= import { Component } from '@angular/core' import { Events, ModalController } from 'ionic-angular' import { IntroductionPage } from '../introduction/introduction' import { PortfolioPage } from '../portfolio/portfolio' import { ScanPage } from '../scan/scan' import { SettingsPage } from '../settings/settings' import { StorageProvider, SettingsKey } from '../../providers/storage/storage' @Component({ templateUrl: 'tabs.html' }) export class TabsPage { tab1Root = PortfolioPage tab2Root = ScanPage tab3Root = SettingsPage constructor(public modalController: ModalController, private storageProvider: StorageProvider) { this.showIntroduction().catch(console.error) } private async showIntroduction() { const introduction = await this.storageProvider.get(SettingsKey.INTRODUCTION) if (!introduction) { setTimeout(async () => { await this.storageProvider.set(SettingsKey.INTRODUCTION, true) }, 3000) const modal = this.modalController.create(IntroductionPage) modal.present().catch(console.error) } } } >>>>>>> import { Component } from '@angular/core' import { Events, ModalController } from 'ionic-angular' import { IntroductionPage } from '../introduction/introduction' import { PortfolioPage } from '../portfolio/portfolio' import { ScanPage } from '../scan/scan' import { SettingsPage } from '../settings/settings' import { ExchangePage } from '../exchange/exchange' import { StorageProvider, SettingsKey } from '../../providers/storage/storage' @Component({ templateUrl: 'tabs.html' }) export class TabsPage { tab1Root = PortfolioPage tab2Root = ScanPage tab3Root = ExchangePage tab4Root = SettingsPage constructor(public modalController: ModalController, private storageProvider: StorageProvider) { this.showIntroduction().catch(console.error) } private async showIntroduction() { const introduction = await this.storageProvider.get(SettingsKey.INTRODUCTION) if (!introduction) { setTimeout(async () => { await this.storageProvider.set(SettingsKey.INTRODUCTION, true) }, 3000) const modal = this.modalController.create(IntroductionPage) modal.present().catch(console.error) } } }
<<<<<<< import { ProtocolSymbols } from './../../services/protocols/protocols' import { handleErrorSentry, ErrorCategory } from 'src/app/services/sentry-error-handler/sentry-error-handler' import { DataServiceKey } from './../../services/data/data.service' import { ValidatorService, CosmosValidatorInfo } from './../../services/validator/validator.service' import { AirGapCosmosDelegateActionContext } from './../../models/actions/CosmosDelegateAction' import { ActivatedRoute, Router } from '@angular/router' import { DecimalValidator } from 'src/app/validators/DecimalValidator' import { Component } from '@angular/core' import { AirGapMarketWallet, CosmosProtocol, Serializer, UnsignedCosmosTransaction, IACMessageDefinitionObject, IACMessageType } from 'airgap-coin-lib' import { ToastController, LoadingController, AlertController } from '@ionic/angular' import { DataService } from 'src/app/services/data/data.service' import BigNumber from 'bignumber.js' import { FormGroup, FormBuilder, Validators } from '@angular/forms' import { CosmosDelegation } from 'airgap-coin-lib/dist/protocols/cosmos/CosmosNodeClient' ======= import { ProtocolSymbols } from './../../services/protocols/protocols' import { handleErrorSentry, ErrorCategory } from 'src/app/services/sentry-error-handler/sentry-error-handler' import { DataServiceKey } from './../../services/data/data.service' import { ValidatorService, CosmosValidatorInfo } from './../../services/validator/validator.service' import { AirGapCosmosDelegateActionContext } from './../../models/actions/CosmosDelegateAction' import { ActivatedRoute, Router } from '@angular/router' import { Component } from '@angular/core' import { AirGapMarketWallet, CosmosProtocol } from 'airgap-coin-lib' import { ToastController, LoadingController, AlertController } from '@ionic/angular' import { DataService } from 'src/app/services/data/data.service' import BigNumber from 'bignumber.js' import { FormGroup, FormBuilder, Validators } from '@angular/forms' import { DecimalValidator } from 'src/app/validators/DecimalValidator' import { CosmosDelegation } from 'airgap-coin-lib/dist/protocols/cosmos/CosmosNodeClient' import { CosmosUnsignedTransactionSerializer, UnsignedCosmosTransaction } from 'airgap-coin-lib/dist/serializer/unsigned-transactions/cosmos-transactions.serializer' >>>>>>> import { ProtocolSymbols } from './../../services/protocols/protocols' import { handleErrorSentry, ErrorCategory } from 'src/app/services/sentry-error-handler/sentry-error-handler' import { DataServiceKey } from './../../services/data/data.service' import { ValidatorService, CosmosValidatorInfo } from './../../services/validator/validator.service' import { AirGapCosmosDelegateActionContext } from './../../models/actions/CosmosDelegateAction' import { ActivatedRoute, Router } from '@angular/router' import { DecimalValidator } from 'src/app/validators/DecimalValidator' import { Component } from '@angular/core' import { AirGapMarketWallet, CosmosProtocol, Serializer, UnsignedCosmosTransaction, IACMessageDefinitionObject, IACMessageType } from 'airgap-coin-lib' import { ToastController, LoadingController, AlertController } from '@ionic/angular' import { DataService } from 'src/app/services/data/data.service' import BigNumber from 'bignumber.js' import { FormGroup, FormBuilder, Validators } from '@angular/forms' import { CosmosDelegation } from 'airgap-coin-lib/dist/protocols/cosmos/CosmosNodeClient' <<<<<<< console.log('info', info) console.log('validatorAddress', this.validatorAddress) ======= >>>>>>> <<<<<<< const delegations: CosmosDelegation[] = await protocol.fetchDelegations(this.wallet.addresses[0]) console.log('delegations', delegations) console.log('this.validatorAddress', this.validatorAddress) const index = delegations.findIndex(delegation => delegation.validator_address === this.validatorAddress) ======= const delegations: CosmosDelegation[] = await protocol.fetchDelegations(this.wallet.addresses[0]) const index = delegations.findIndex(delegation => delegation.validator_address === this.validatorAddress) >>>>>>> const delegations: CosmosDelegation[] = await protocol.fetchDelegations(this.wallet.addresses[0]) const index = delegations.findIndex(delegation => delegation.validator_address === this.validatorAddress) <<<<<<< console.log('address is not delegated') ======= >>>>>>> <<<<<<< this.totalDelegatedAmount = await this.validatorService.fetchTotalDelegatedAmount(this.wallet.addresses[0]) const rawDelegatableBalance = new BigNumber(this.wallet.currentBalance - this.totalDelegatedAmount.toNumber()) console.log('rawDelegatableBalance', rawDelegatableBalance) ======= this.totalDelegatedAmount = await this.validatorService.fetchTotalDelegatedAmount(this.wallet.addresses[0]) const rawDelegatableBalance = new BigNumber(this.wallet.currentBalance - this.totalDelegatedAmount.toNumber()) >>>>>>> this.totalDelegatedAmount = await this.validatorService.fetchTotalDelegatedAmount(this.wallet.addresses[0]) const rawDelegatableBalance = new BigNumber(this.wallet.currentBalance - this.totalDelegatedAmount.toNumber()) <<<<<<< const transaction: IACMessageDefinitionObject = { protocol: protocol.identifier, type: IACMessageType.TransactionSignRequest, payload: unsignedCosmosTx } const serializedTx = serializer.serialize([transaction]) console.log('serializedTx', serializedTx) const airGapTxs = cosmosTransaction.toAirGapTransactions('cosmos') ======= const serializedTx = serializer.serialize(unsignedCosmosTx) const airGapTxs = cosmosTransaction.toAirGapTransactions('cosmos') >>>>>>> const transaction: IACMessageDefinitionObject = { protocol: protocol.identifier, type: IACMessageType.TransactionSignRequest, payload: unsignedCosmosTx } const serializedTx = serializer.serialize([transaction]) console.log('serializedTx', serializedTx) const airGapTxs = cosmosTransaction.toAirGapTransactions('cosmos') <<<<<<< console.log('airGapTxs', airGapTxs) ======= >>>>>>>
<<<<<<< let deleteUUid: string = this.stateData.cachePrefabUUid; if (deleteUUid) { let gameObj = Editor.editorModel.getGameObjectByUUid(deleteUUid); ======= let deleteUUid: string = this.data.cachePrefabUUid; let gameObj = this.editorModel.getGameObjectByUUid(deleteUUid); gameObj.destroy(); this.dispatchEditorModelEvent(EditorModelEvent.DELETE_GAMEOBJECTS, []); return true; >>>>>>> let deleteUUid: string = this.stateData.cachePrefabUUid; if (deleteUUid) { let gameObj = this.editorModel.getGameObjectByUUid(deleteUUid); gameObj.destroy(); <<<<<<< if (this.stateData.cacheSerializeData) { instance = deserialize(this.stateData.cacheSerializeData,true); Editor.editorModel.setGameObjectPrefab(instance,prefab,instance); ======= if (this.data.serializeData) { instance = new Deserializer().deserialize(this.data.serializeData,true); >>>>>>> if (this.data.serializeData) { instance = new Deserializer().deserialize(this.data.serializeData,true); <<<<<<< Editor.editorModel.setGameObjectPrefab(instance,prefab,instance); this.stateData.cacheSerializeData = serialize(instance); ======= this.data.serializeData = serialize(instance); >>>>>>> this.data.serializeData = serialize(instance);
<<<<<<< ======= export async function newFolder(data: any){ console.log(data); let file_path = paths.projects + data.currentProject + '/' + data.newFolder; if (await file_manager.directory_exists(file_path)){ data.error = 'failed, folder ' + data.newFolder + ' already exists!'; return; } await file_manager.write_folder(file_path); data.fileList = await listFiles(data.currentProject); } >>>>>>> export async function newFolder(data: any){ console.log(data); let file_path = paths.projects + data.currentProject + '/' + data.newFolder; if (await file_manager.directory_exists(file_path)){ data.error = 'failed, folder ' + data.newFolder + ' already exists!'; return; } await file_manager.write_folder(file_path); data.fileList = await listFiles(data.currentProject); } <<<<<<< export async function moveUploadedFile(data: any){ await file_manager.rename_file(paths.uploads+data.newFile, paths.projects+data.currentProject+'/'+data.sanitisedNewFile); await cleanFile(data.currentProject, data.sanitisedNewFile); data.newFile = data.sanitisedNewFile; data.fileList = await listFiles(data.currentProject); await openFile(data); } ======= >>>>>>> export async function moveUploadedFile(data: any){ await file_manager.rename_file(paths.uploads+data.newFile, paths.projects+data.currentProject+'/'+data.sanitisedNewFile); await cleanFile(data.currentProject, data.sanitisedNewFile); data.newFile = data.sanitisedNewFile; data.fileList = await listFiles(data.currentProject); await openFile(data); } <<<<<<< let file_path = paths.projects+data.currentProject+'/'+data.newFile; let file_exists = (await file_manager.file_exists(file_path) || await file_manager.directory_exists(file_path)); ======= let old_file_name = data.oldName; let file_name = data.oldName.split('/').pop(); let file_path; if (data.folder) { let folder = data.folder + '/'; file_path = paths.projects + data.currentProject + '/' + folder + file_name; } else { file_path = paths.projects + data.currentProject + '/' + file_name; } let new_file_path = file_path.replace(file_name, data.newFile); let file_exists = (await file_manager.file_exists(new_file_path) || await file_manager.directory_exists(file_path)); >>>>>>> let old_file_name = data.oldName; let file_name = data.oldName.split('/').pop(); let file_path; if (data.folder) { let folder = data.folder + '/'; file_path = paths.projects + data.currentProject + '/' + folder + file_name; } else { file_path = paths.projects + data.currentProject + '/' + file_name; } let new_file_path = file_path.replace(file_name, data.newFile); let file_exists = (await file_manager.file_exists(new_file_path) || await file_manager.directory_exists(file_path)); <<<<<<< ======= export async function renameFolder(data: any){ let folder_path = paths.projects + data.currentProject + "/" + data.oldName; let new_folder_path = paths.projects + data.currentProject + "/" + data.newFolder; let folder_exists = await file_manager.directory_exists(new_folder_path); if (folder_exists){ data.error = 'failed, file ' + data.newFolder + ' already exists!'; return; } await file_manager.rename_file(folder_path, new_folder_path); await cleanFile(data.currentProject, data.oldName); data.fileList = await listFiles(data.currentProject); let regex = RegExp(data.oldName); if (regex.test(data.fileName)) { data.fileName = data.fileName.replace(data.oldName, data.newFolder); await openFile(data); } } >>>>>>> export async function renameFolder(data: any){ let folder_path = paths.projects + data.currentProject + "/" + data.oldName; let new_folder_path = paths.projects + data.currentProject + "/" + data.newFolder; let folder_exists = await file_manager.directory_exists(new_folder_path); if (folder_exists){ data.error = 'failed, file ' + data.newFolder + ' already exists!'; return; } await file_manager.rename_file(folder_path, new_folder_path); await cleanFile(data.currentProject, data.oldName); data.fileList = await listFiles(data.currentProject); let regex = RegExp(data.oldName); if (regex.test(data.fileName)) { data.fileName = data.fileName.replace(data.oldName, data.newFolder); await openFile(data); } }
<<<<<<< import { AirGapWallet } from '@airgap/coinlib-core' ======= import { AirGapWallet, MessageSignResponse } from 'airgap-coin-lib' >>>>>>> import { AirGapWallet, MessageSignResponse } from '@airgap/coinlib-core'
<<<<<<< import { ProtocolService } from '@airgap/angular-core' import { Component, Input, OnChanges } from '@angular/core' import { IACMessageDefinitionObject, IAirGapTransaction, ICoinProtocol, SignedTransaction, UnsignedTransaction } from '@airgap/coinlib-core' ======= import { ProtocolService, SerializerService } from '@airgap/angular-core' import { Component, Input } from '@angular/core' import { IACMessageDefinitionObject, IAirGapTransaction, ICoinProtocol, SignedTransaction } from 'airgap-coin-lib' >>>>>>> import { ProtocolService, SerializerService } from '@airgap/angular-core' import { Component, Input } from '@angular/core' import { IACMessageDefinitionObject, IAirGapTransaction, ICoinProtocol, SignedTransaction } from '@airgap/coinlib-core' <<<<<<< if (this.unsignedTxs && this.unsignedTxs.length > 0) { const protocol: ICoinProtocol = await this.protocolService.getProtocol(this.unsignedTxs[0].protocol) try { // tslint:disable-next-line:no-unnecessary-type-assertion const unsignedTransaction: UnsignedTransaction = this.unsignedTxs[0].payload as UnsignedTransaction this.airGapTxs = ( await Promise.all(this.unsignedTxs.map((unsignedTx) => protocol.getTransactionDetails(unsignedTx.payload as UnsignedTransaction))) ).reduce((flatten, toFlatten) => flatten.concat(toFlatten), []) console.log(this.airGapTxs) if ( this.airGapTxs.length > 1 && this.airGapTxs.every((tx: IAirGapTransaction) => tx.protocolIdentifier === this.airGapTxs[0].protocolIdentifier) ) { this.aggregatedInfo = { numberOfTxs: this.airGapTxs.length, totalAmount: this.airGapTxs.reduce( (pv: BigNumber, cv: IAirGapTransaction) => pv.plus(cv.amount ? cv.amount : 0), new BigNumber(0) ), totalFees: this.airGapTxs.reduce((pv: BigNumber, cv: IAirGapTransaction) => pv.plus(cv.fee ? cv.fee : 0), new BigNumber(0)) } return } try { if (this.airGapTxs.length !== 1) { throw Error('TokenTransferDetails returned more than 1 transaction!') } this.airGapTxs = [await this.tokenService.getTokenTransferDetails(this.airGapTxs[0], unsignedTransaction)] } catch (error) { console.error('unable to parse token transaction, using ethereum transaction details instead') } this.fallbackActivated = false } catch (e) { this.fallbackActivated = true // tslint:disable-next-line:no-unnecessary-type-assertion this.rawTxData = JSON.stringify((this.unsignedTxs[0].payload as UnsignedTransaction).transaction) } } ======= >>>>>>>
<<<<<<< resetFields: (newValues?: Props) => void; validate: (names?: string | string[], option?: validateOptions) => Promise<any>; validateField: ( ======= resetFields: () => void; validate: <T = any>(names?: string | string[], option?: validateOptions) => Promise<T>; validateField: <T = any>( >>>>>>> resetFields: (newValues?: Props) => void; validate: <T = any>(names?: string | string[], option?: validateOptions) => Promise<T>; validateField: <T = any>(
<<<<<<< }; /* Fill the address/amount inputs with data from QR code */ export const onQrScan = (parsedUri: ParsedURI, outputId: number) => (dispatch: Dispatch) => { const { address = '', amount } = parsedUri; dispatch(handleAddressChange(outputId, address)); if (amount) dispatch(handleAmountChange(outputId, amount)); ======= }; export const dispose = () => (dispatch: Dispatch, _getState: GetState) => { dispatch({ type: SEND.DISPOSE, }); >>>>>>> }; export const dispose = () => (dispatch: Dispatch, _getState: GetState) => { dispatch({ type: SEND.DISPOSE, }); }; /* Fill the address/amount inputs with data from QR code */ export const onQrScan = (parsedUri: ParsedURI, outputId: number) => (dispatch: Dispatch) => { const { address = '', amount } = parsedUri; dispatch(handleAddressChange(outputId, address)); if (amount) dispatch(handleAmountChange(outputId, amount));
<<<<<<< import { Discovery, PartialDiscovery, DISCOVERY_STATUS } from '@wallet-reducers/discoveryReducer'; ======= import { add as addNotification } from '@wallet-actions/notificationActions'; import { Discovery, PartialDiscovery, STATUS } from '@wallet-reducers/discoveryReducer'; >>>>>>> import { add as addNotification } from '@wallet-actions/notificationActions'; import { Discovery, PartialDiscovery, DISCOVERY_STATUS } from '@wallet-reducers/discoveryReducer'; <<<<<<< update({ device, status: DISCOVERY_STATUS.COMPLETED, }), ======= update( { device, status: STATUS.COMPLETED, }, DISCOVERY.COMPLETE, ), >>>>>>> update( { device, status: DISCOVERY_STATUS.COMPLETED, }, DISCOVERY.COMPLETE, ), <<<<<<< dispatch(start()); // restart process without failed coins } else if (result.payload.error === 'discovery_interrupted') { console.warn('BY USER!'); await TrezorConnect.getFeatures({ keepSession: false }); dispatch(update({ device, status: DISCOVERY_STATUS.STOPPED }, DISCOVERY.STOP)); ======= if (result.payload.error === 'discovery_interrupted') { // if interruption comes from the user then device session should be released await TrezorConnect.getFeatures({ device: getState().suite.device, keepSession: false, }); dispatch(update({ device, status: STATUS.STOPPED }, DISCOVERY.STOP)); dispatch( addNotification({ variant: 'error', title: 'Reading accounts error', cancelable: true, }), ); >>>>>>> if (result.payload.error === 'discovery_interrupted') { // if interruption comes from the user then device session should be released await TrezorConnect.getFeatures({ device: getState().suite.device, keepSession: false, }); dispatch(update({ device, status: DISCOVERY_STATUS.STOPPED }, DISCOVERY.STOP)); dispatch( addNotification({ variant: 'error', title: 'Reading accounts error', cancelable: true, }), ); <<<<<<< dispatch(update({ device, status: DISCOVERY_STATUS.STOPPED }, DISCOVERY.STOP)); ======= // handle dispatch(update({ device, status: STATUS.STOPPED }, DISCOVERY.STOP)); dispatch( addNotification({ variant: 'error', title: 'Reading accounts error', // message: (<>{result.payload.error}</>), cancelable: true, }), ); >>>>>>> // handle dispatch(update({ device, status: DISCOVERY_STATUS.STOPPED }, DISCOVERY.STOP)); dispatch( addNotification({ variant: 'error', title: 'Reading accounts error', // message: (<>{result.payload.error}</>), cancelable: true, }), );