@device-management-toolkit/ui-toolkit-angular 11.1.9 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"device-management-toolkit-ui-toolkit-angular-sol.mjs","sources":["../../sol/src/terminal/terminal.component.ts","../../sol/src/terminal/terminal.component.html","../../sol/src/sol.component.ts","../../sol/src/sol.component.html","../../sol/src/public_api.ts","../../sol/src/device-management-toolkit-ui-toolkit-angular-sol.ts"],"sourcesContent":["/*********************************************************************\n * Copyright (c) Intel Corporation 2023\n * SPDX-License-Identifier: Apache-2.0\n **********************************************************************/\nimport { Component, OnInit, input, output } from '@angular/core'\nimport { Terminal } from '@xterm/xterm'\n@Component({\n selector: 'amt-terminal',\n templateUrl: './terminal.component.html'\n})\nexport class TerminalComponent implements OnInit {\n // TODO: Notes from signal input migration:\n // Input is initialized to `undefined` but type does not allow this value.\n // This worked with `@Input` because your project uses `--strictPropertyInitialization=false`.\n readonly term = input<Terminal>(undefined!)\n readonly handleKeyPress = output<any>()\n container!: HTMLElement | null\n ngOnInit(): void {\n const term = this.term()\n if (term == null) throw new Error('Terminal not found')\n this.container = document.getElementById('terminal')\n if (this.container == null) throw new Error('Container not found')\n term.open(this.container)\n term.onKey(({ key, domEvent }) => {\n domEvent.preventDefault()\n if (domEvent.ctrlKey && domEvent.key === 'c') {\n const termValue = this.term()\n if (termValue.hasSelection()) {\n navigator.clipboard\n .writeText(termValue.getSelection())\n .then(() => {})\n .catch((err) => {\n console.error('Failed to copy to clipboard', err)\n })\n } else {\n // Send interrupt signal (SIGINT) to terminal\n termValue.write('\\x03') // Sends Ctrl + C (ASCII code 03)\n }\n // Prevent the default browser behavior (like opening menus)\n return false\n }\n if (domEvent.ctrlKey && domEvent.key === 'v') {\n navigator.clipboard\n .readText()\n .then((text) => {\n this.handleKeyPress.emit(text)\n })\n .catch((err) => {\n console.error('Failed to read clipboard', err)\n })\n return false\n }\n this.handleKeyPress.emit(key)\n })\n }\n}\n","<div id=\"terminal\" class=\"xtermDisplay\" style=\"width: fit-content\"></div>\n","/*********************************************************************\n * Copyright (c) Intel Corporation 2023\n * SPDX-License-Identifier: Apache-2.0\n **********************************************************************/\nimport {\n Component,\n ViewEncapsulation,\n OnDestroy,\n AfterViewInit,\n input,\n output,\n inject,\n DestroyRef,\n effect\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\nimport { Terminal } from '@xterm/xterm'\nimport {\n AmtTerminal,\n AMTRedirector,\n TerminalDataProcessor,\n RedirectorConfig,\n Protocol\n} from '@device-management-toolkit/ui-toolkit/core'\nimport { TerminalComponent } from './terminal/terminal.component'\n\n@Component({\n selector: 'amt-sol',\n templateUrl: './sol.component.html',\n styleUrls: ['./sol.component.css'],\n encapsulation: ViewEncapsulation.None,\n imports: [TerminalComponent]\n})\nexport class SOLComponent implements OnDestroy {\n private readonly destroyRef = inject(DestroyRef)\n\n terminal: AmtTerminal\n container!: any\n term: Terminal\n redirector: AMTRedirector\n dataProcessor: TerminalDataProcessor\n deviceState = 0\n\n readonly deviceStatus = output<number>()\n readonly deviceConnection = input<boolean>(false)\n public mpsServer = input('')\n public authToken = input('')\n public deviceId = input('')\n\n constructor() {\n // React to deviceConnection changes\n effect(() => {\n const connected = this.deviceConnection()\n if (connected) {\n if (this.redirector == null) {\n this.instantiate()\n }\n this.startSol()\n } else if (this.redirector != null) {\n this.stopSol()\n }\n })\n }\n\n instantiate(): void {\n this.terminal = new AmtTerminal()\n this.dataProcessor = new TerminalDataProcessor(this.terminal)\n const config: RedirectorConfig = {\n mode: 'sol',\n protocol: Protocol.SOL,\n fr: new FileReader(),\n host: this.deviceId(),\n port: 16994,\n user: '',\n pass: '',\n tls: 0,\n tls1only: 0,\n authToken: this.authToken(),\n server: this.mpsServer()\n }\n this.redirector = new AMTRedirector(config)\n this.terminal.onSend = this.redirector.send.bind(this.redirector)\n this.redirector.onNewState = this.terminal.StateChange.bind(this.terminal)\n this.redirector.onStateChanged = this.onTerminalStateChange.bind(this)\n this.redirector.onProcessData = this.dataProcessor.processData.bind(this)\n this.dataProcessor.processDataToXterm = this.handleWriteToXterm.bind(this)\n this.dataProcessor.clearTerminal = this.handleClearTerminal.bind(this)\n this.term = new Terminal({\n rows: 30,\n cols: 100,\n cursorStyle: 'block',\n fontWeight: 'bold'\n })\n }\n\n handleKeyPress(domEvent: any): void {\n this.terminal?.TermSendKeys(domEvent)\n }\n\n handleClearTerminal(): void {\n this.term?.reset()\n }\n\n handleWriteToXterm(str: string): void {\n this.term?.write(str)\n }\n\n onTerminalStateChange(redirector: AMTRedirector, state: number): void {\n this.deviceStatus.emit(state)\n this.deviceState = state\n }\n\n startSol(): void {\n if (this.redirector != null) {\n this.redirector.start(WebSocket)\n }\n }\n\n stopSol(): void {\n if (this.redirector != null) {\n this.redirector.stop()\n this.handleClearTerminal()\n this.term?.dispose()\n this.cleanup()\n }\n }\n\n cleanup(): void {\n ;(this.terminal as any) = null\n ;(this.redirector as any) = null\n ;(this.dataProcessor as any) = null\n ;(this.term as any) = null\n }\n\n ngOnDestroy(): void {\n this.stopSol()\n }\n}\n","<div class=\"container\">\n @if (deviceState === 3) {\n <amt-terminal [term]=\"term\" (handleKeyPress)=\"handleKeyPress($event)\"></amt-terminal>\n }\n</div>\n","/*********************************************************************\n * Copyright (c) Intel Corporation 2023\n * SPDX-License-Identifier: Apache-2.0\n **********************************************************************/\n/*\n * Public API Surface of sol\n */\n\nexport * from './sol.component'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAAA;;;AAGwE;MAO3D,iBAAiB,CAAA;AAJ9B,IAAA,WAAA,GAAA;;;;AAQW,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAW,SAAU,2EAAC;QAClC,IAAA,CAAA,cAAc,GAAG,MAAM,EAAO;AAwCxC,IAAA;IAtCC,QAAQ,GAAA;AACN,QAAA,MAAM,IA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AA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,ED0BY,iBAAiB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;4FAEhB,YAAY,EAAA,UAAA,EAAA,CAAA;kBAPxB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,iBAGJ,iBAAiB,CAAC,IAAI,EAAA,OAAA,EAC5B,CAAC,iBAAiB,CAAC,EAAA,QAAA,EAAA,sKAAA,EAAA,MAAA,EAAA,CAAA,kFAAA,CAAA,EAAA;;;AE/B9B;;;AAGwE;AACxE;;AAEG;;ACNH;;AAEG;;;;"}
1
+ {"version":3,"file":"device-management-toolkit-ui-toolkit-angular-sol.mjs","names":[],"sources":["../../sol/src/terminal/terminal.component.ts","../../sol/src/terminal/terminal.component.html","../../sol/src/sol.component.ts","../../sol/src/sol.component.html"],"sourcesContent":["/*********************************************************************\n * Copyright (c) Intel Corporation 2023\n * SPDX-License-Identifier: Apache-2.0\n **********************************************************************/\nimport { Component, OnInit, input, output } from '@angular/core'\nimport { Terminal } from '@xterm/xterm'\n@Component({\n selector: 'amt-terminal',\n templateUrl: './terminal.component.html'\n})\nexport class TerminalComponent implements OnInit {\n readonly term = input.required<Terminal>()\n readonly handleKeyPress = output<any>()\n container: HTMLElement | null = null\n ngOnInit(): void {\n const term = this.term()\n if (term == null) throw new Error('Terminal not found')\n this.container = document.getElementById('terminal')\n if (this.container == null) throw new Error('Container not found')\n term.open(this.container)\n term.onKey(({ key, domEvent }) => {\n domEvent.preventDefault()\n if (domEvent.ctrlKey && domEvent.key === 'c') {\n const termValue = this.term()\n if (termValue.hasSelection()) {\n navigator.clipboard\n .writeText(termValue.getSelection())\n .then(() => {})\n .catch((err) => {\n console.error('Failed to copy to clipboard', err)\n })\n } else {\n // Send interrupt signal (SIGINT) to terminal\n termValue.write('\\x03') // Sends Ctrl + C (ASCII code 03)\n }\n // Prevent the default browser behavior (like opening menus)\n return false\n }\n if (domEvent.ctrlKey && domEvent.key === 'v') {\n navigator.clipboard\n .readText()\n .then((text) => {\n this.handleKeyPress.emit(text)\n })\n .catch((err) => {\n console.error('Failed to read clipboard', err)\n })\n return false\n }\n this.handleKeyPress.emit(key)\n })\n }\n}\n","<div id=\"terminal\" class=\"xtermDisplay\" style=\"width: fit-content\"></div>\n","/*********************************************************************\n * Copyright (c) Intel Corporation 2023\n * SPDX-License-Identifier: Apache-2.0\n **********************************************************************/\nimport {\n Component,\n ViewEncapsulation,\n OnDestroy,\n AfterViewInit,\n input,\n output,\n inject,\n DestroyRef,\n effect,\n signal\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\nimport { Terminal } from '@xterm/xterm'\nimport {\n AmtTerminal,\n AMTRedirector,\n TerminalDataProcessor,\n RedirectorConfig,\n Protocol\n} from '@device-management-toolkit/ui-toolkit/core'\nimport { TerminalComponent } from './terminal/terminal.component'\n\n@Component({\n selector: 'amt-sol',\n templateUrl: './sol.component.html',\n styleUrls: ['./sol.component.css'],\n encapsulation: ViewEncapsulation.None,\n imports: [TerminalComponent]\n})\nexport class SOLComponent implements OnDestroy {\n private readonly destroyRef = inject(DestroyRef)\n\n terminal: AmtTerminal | null = null\n container!: any\n term: Terminal | null = null\n redirector: AMTRedirector | null = null\n dataProcessor: TerminalDataProcessor | null = null\n private readonly _deviceState = signal(0)\n readonly deviceState = this._deviceState.asReadonly()\n\n readonly deviceStatus = output<number>()\n readonly deviceConnection = input<boolean>(false)\n public mpsServer = input('')\n public authToken = input('')\n public deviceId = input('')\n\n constructor() {\n // React to deviceConnection changes\n effect(() => {\n const connected = this.deviceConnection()\n if (connected) {\n if (this.redirector == null) {\n this.instantiate()\n }\n this.startSol()\n } else if (this.redirector != null) {\n this.stopSol()\n }\n })\n }\n\n instantiate(): void {\n this.terminal = new AmtTerminal()\n this.dataProcessor = new TerminalDataProcessor(this.terminal)\n const config: RedirectorConfig = {\n mode: 'sol',\n protocol: Protocol.SOL,\n fr: new FileReader(),\n host: this.deviceId(),\n port: 16994,\n user: '',\n pass: '',\n tls: 0,\n tls1only: 0,\n authToken: this.authToken(),\n server: this.mpsServer()\n }\n this.redirector = new AMTRedirector(config)\n this.terminal.onSend = this.redirector.send.bind(this.redirector)\n this.redirector.onNewState = this.terminal.StateChange.bind(this.terminal)\n this.redirector.onStateChanged = this.onTerminalStateChange.bind(this)\n this.redirector.onProcessData = this.dataProcessor.processData.bind(this)\n this.dataProcessor.processDataToXterm = this.handleWriteToXterm.bind(this)\n this.dataProcessor.clearTerminal = this.handleClearTerminal.bind(this)\n this.term = new Terminal({\n rows: 30,\n cols: 100,\n cursorStyle: 'block',\n fontWeight: 'bold'\n })\n }\n\n handleKeyPress(domEvent: any): void {\n this.terminal?.TermSendKeys(domEvent)\n }\n\n handleClearTerminal(): void {\n this.term?.reset()\n }\n\n handleWriteToXterm(str: string): void {\n this.term?.write(str)\n }\n\n onTerminalStateChange(redirector: AMTRedirector, state: number): void {\n this.deviceStatus.emit(state)\n this._deviceState.set(state)\n }\n\n startSol(): void {\n if (this.redirector != null) {\n this.redirector.start(WebSocket)\n }\n }\n\n stopSol(): void {\n if (this.redirector != null) {\n this.redirector.stop()\n this.handleClearTerminal()\n this.term?.dispose()\n this.cleanup()\n }\n }\n\n cleanup(): void {\n this.terminal = null\n this.redirector = null\n this.dataProcessor = null\n this.term = null\n }\n\n ngOnDestroy(): void {\n this.stopSol()\n }\n}\n","<div class=\"container\">\n @if (deviceState() === 3 && term) {\n <amt-terminal [term]=\"term\" (handleKeyPress)=\"handleKeyPress($event)\"></amt-terminal>\n }\n</div>\n"],"mappings":";;;;AAUA,IAAa,oBAAb,MAAa,kBAAiB;CAJ9B,cAAA;EAKW,KAAA,OAAO,MAAM,SAA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