fix(core): update
This commit is contained in:
parent
6ae21d73aa
commit
a21a3b6918
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-catalog',
|
name: '@design.estate/dees-catalog',
|
||||||
version: '1.0.269',
|
version: '1.0.270',
|
||||||
description: 'website for lossless.com'
|
description: 'website for lossless.com'
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,18 @@ declare global {
|
|||||||
export class DeesTerminal extends DeesElement {
|
export class DeesTerminal extends DeesElement {
|
||||||
public static demo = () => html` <dees-terminal></dees-terminal> `;
|
public static demo = () => html` <dees-terminal></dees-terminal> `;
|
||||||
|
|
||||||
|
// INSTANCE
|
||||||
|
private resizeObserver: ResizeObserver;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
domtools.DomTools.setupDomTools();
|
this.resizeObserver = new ResizeObserver((entries) => {
|
||||||
|
for (const entry of entries) {
|
||||||
|
// Handle the resize event
|
||||||
|
console.log(`Terminal Resized`);
|
||||||
|
this.handleResize();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static styles = [
|
public static styles = [
|
||||||
@ -231,6 +240,7 @@ export class DeesTerminal extends DeesElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fitAddon: FitAddon;
|
||||||
public async firstUpdated(
|
public async firstUpdated(
|
||||||
_changedProperties: Map<string | number | symbol, unknown>
|
_changedProperties: Map<string | number | symbol, unknown>
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
@ -242,14 +252,14 @@ export class DeesTerminal extends DeesElement {
|
|||||||
convertEol: true,
|
convertEol: true,
|
||||||
cursorBlink: true,
|
cursorBlink: true,
|
||||||
});
|
});
|
||||||
const fitAddon = new FitAddon();
|
this.fitAddon = new FitAddon();
|
||||||
term.loadAddon(fitAddon);
|
term.loadAddon(this.fitAddon);
|
||||||
|
|
||||||
// Open the terminal in #terminal-container
|
// Open the terminal in #terminal-container
|
||||||
term.open(container);
|
term.open(container);
|
||||||
|
|
||||||
// Make the terminal's size and geometry fit the size of #terminal-container
|
// Make the terminal's size and geometry fit the size of #terminal-container
|
||||||
fitAddon.fit();
|
this.fitAddon.fit();
|
||||||
|
|
||||||
term.write(`dees-terminal custom terminal. \r\n$ `);
|
term.write(`dees-terminal custom terminal. \r\n$ `);
|
||||||
|
|
||||||
@ -271,4 +281,18 @@ export class DeesTerminal extends DeesElement {
|
|||||||
await domtools.convenience.smartdelay.delayFor(5000);
|
await domtools.convenience.smartdelay.delayFor(5000);
|
||||||
input.write(`pnpm add isomorphic-git @git.zone/tsbuild\n`);
|
input.write(`pnpm add isomorphic-git @git.zone/tsbuild\n`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async connectedCallback(): Promise<void> {
|
||||||
|
await super.connectedCallback();
|
||||||
|
this.resizeObserver.observe(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
async disconnectedCallback(): Promise<void> {
|
||||||
|
this.resizeObserver.unobserve(this);
|
||||||
|
await super.disconnectedCallback();
|
||||||
|
}
|
||||||
|
|
||||||
|
handleResize() {
|
||||||
|
this.fitAddon.fit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user