fix(core): update

This commit is contained in:
Philipp Kunz 2024-01-22 19:23:22 +01:00
parent 6ae21d73aa
commit a21a3b6918
2 changed files with 29 additions and 5 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-catalog',
version: '1.0.269',
version: '1.0.270',
description: 'website for lossless.com'
}

View File

@ -24,9 +24,18 @@ declare global {
export class DeesTerminal extends DeesElement {
public static demo = () => html` <dees-terminal></dees-terminal> `;
// INSTANCE
private resizeObserver: ResizeObserver;
constructor() {
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 = [
@ -231,6 +240,7 @@ export class DeesTerminal extends DeesElement {
`;
}
private fitAddon: FitAddon;
public async firstUpdated(
_changedProperties: Map<string | number | symbol, unknown>
): Promise<void> {
@ -242,14 +252,14 @@ export class DeesTerminal extends DeesElement {
convertEol: true,
cursorBlink: true,
});
const fitAddon = new FitAddon();
term.loadAddon(fitAddon);
this.fitAddon = new FitAddon();
term.loadAddon(this.fitAddon);
// Open the terminal in #terminal-container
term.open(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$ `);
@ -271,4 +281,18 @@ export class DeesTerminal extends DeesElement {
await domtools.convenience.smartdelay.delayFor(5000);
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();
}
}