Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
6c2f36f020 | |||
71f4d44782 | |||
6df2eb5acc | |||
469f8e0f21 | |||
3712f6ef90 | |||
d2646cd62c |
24
changelog.md
24
changelog.md
@ -1,5 +1,29 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-04-11 - 1.5.0 - feat(badge)
|
||||||
|
Add dees-badge component with demo file and update packageManager field in package.json
|
||||||
|
|
||||||
|
- Introduce a new badge component allowing different types (default, primary, success, warning, error) with an optional rounded style
|
||||||
|
- Provide a demo for the badge component
|
||||||
|
- Export the badge component in the main elements index
|
||||||
|
- Update package.json to include an explicit packageManager field
|
||||||
|
|
||||||
|
## 2025-01-20 - 1.4.1 - fix(dependencies)
|
||||||
|
Update dependency versions for smartpromise, webcontainer/api, tapbundle, and @types/node
|
||||||
|
|
||||||
|
- Update @push.rocks/smartpromise to version ^4.2.0
|
||||||
|
- Downgrade @webcontainer/api to version 1.2.0
|
||||||
|
- Update @push.rocks/tapbundle to version ^5.5.6
|
||||||
|
- Update @types/node to version ^22.10.7
|
||||||
|
|
||||||
|
## 2025-01-20 - 1.4.0 - feat(dees-terminal)
|
||||||
|
Enhanced the dees-terminal component to support environment variable settings and improved setup command execution.
|
||||||
|
|
||||||
|
- Added environment property to pass custom environment variables.
|
||||||
|
- Introduced webcontainerDeferred to handle the promise for web container creation.
|
||||||
|
- Enhanced demo to illustrate environment variable usage.
|
||||||
|
- Improved async interaction with the terminal for setting environment variables and executing setup commands.
|
||||||
|
|
||||||
## 2025-01-15 - 1.3.4 - fix(chart)
|
## 2025-01-15 - 1.3.4 - fix(chart)
|
||||||
Fix chart rendering and appearance issues in the DeesChartArea component.
|
Fix chart rendering and appearance issues in the DeesChartArea component.
|
||||||
|
|
||||||
|
13
package.json
13
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@design.estate/dees-catalog",
|
"name": "@design.estate/dees-catalog",
|
||||||
"version": "1.3.4",
|
"version": "1.5.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
|
"description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
|
||||||
"main": "dist_ts_web/index.js",
|
"main": "dist_ts_web/index.js",
|
||||||
@ -23,10 +23,10 @@
|
|||||||
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
||||||
"@push.rocks/smarti18n": "^1.0.4",
|
"@push.rocks/smarti18n": "^1.0.4",
|
||||||
"@push.rocks/smartpromise": "^4.1.0",
|
"@push.rocks/smartpromise": "^4.2.0",
|
||||||
"@push.rocks/smartstring": "^4.0.15",
|
"@push.rocks/smartstring": "^4.0.15",
|
||||||
"@tsclass/tsclass": "^4.4.0",
|
"@tsclass/tsclass": "^4.4.0",
|
||||||
"@webcontainer/api": "1.5.1-internal.6",
|
"@webcontainer/api": "1.2.0",
|
||||||
"apexcharts": "^4.3.0",
|
"apexcharts": "^4.3.0",
|
||||||
"highlight.js": "11.11.1",
|
"highlight.js": "11.11.1",
|
||||||
"ibantools": "^4.5.1",
|
"ibantools": "^4.5.1",
|
||||||
@ -41,8 +41,8 @@
|
|||||||
"@git.zone/tstest": "^1.0.90",
|
"@git.zone/tstest": "^1.0.90",
|
||||||
"@git.zone/tswatch": "^2.0.37",
|
"@git.zone/tswatch": "^2.0.37",
|
||||||
"@push.rocks/projectinfo": "^5.0.2",
|
"@push.rocks/projectinfo": "^5.0.2",
|
||||||
"@push.rocks/tapbundle": "^5.5.4",
|
"@push.rocks/tapbundle": "^5.5.6",
|
||||||
"@types/node": "^22.10.6"
|
"@types/node": "^22.10.7"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
@ -84,5 +84,6 @@
|
|||||||
"Web Applications",
|
"Web Applications",
|
||||||
"Modern Web",
|
"Modern Web",
|
||||||
"Frontend Development"
|
"Frontend Development"
|
||||||
]
|
],
|
||||||
|
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
|
||||||
}
|
}
|
||||||
|
4368
pnpm-lock.yaml
generated
4368
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-catalog',
|
name: '@design.estate/dees-catalog',
|
||||||
version: '1.3.4',
|
version: '1.5.0',
|
||||||
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
||||||
}
|
}
|
||||||
|
12
ts_web/elements/dees-badge.demo.ts
Normal file
12
ts_web/elements/dees-badge.demo.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { html } from '@design.estate/dees-element';
|
||||||
|
|
||||||
|
export const demoFunc = () => html`
|
||||||
|
<div style="display: flex; gap: 8px; align-items: center;">
|
||||||
|
<dees-badge .text=${'Default'}></dees-badge>
|
||||||
|
<dees-badge .type=${'primary'} .text=${'Primary'}></dees-badge>
|
||||||
|
<dees-badge .type=${'success'} .text=${'Success'}></dees-badge>
|
||||||
|
<dees-badge .type=${'warning'} .text=${'Warning'}></dees-badge>
|
||||||
|
<dees-badge .type=${'error'} .text=${'Error'}></dees-badge>
|
||||||
|
<dees-badge .type=${'primary'} .rounded=${true} .text=${'Rounded'}></dees-badge>
|
||||||
|
</div>
|
||||||
|
`;
|
96
ts_web/elements/dees-badge.ts
Normal file
96
ts_web/elements/dees-badge.ts
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
import {
|
||||||
|
DeesElement,
|
||||||
|
css,
|
||||||
|
cssManager,
|
||||||
|
customElement,
|
||||||
|
html,
|
||||||
|
property,
|
||||||
|
type CSSResult,
|
||||||
|
type TemplateResult,
|
||||||
|
} from '@design.estate/dees-element';
|
||||||
|
|
||||||
|
import * as domtools from '@design.estate/dees-domtools';
|
||||||
|
import { demoFunc } from './dees-badge.demo.js';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
'dees-badge': DeesBadge;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@customElement('dees-badge')
|
||||||
|
export class DeesBadge extends DeesElement {
|
||||||
|
public static demo = demoFunc;
|
||||||
|
|
||||||
|
@property({ type: String })
|
||||||
|
public type: 'default' | 'primary' | 'success' | 'warning' | 'error' = 'default';
|
||||||
|
|
||||||
|
@property({ type: String })
|
||||||
|
public text: string = '';
|
||||||
|
|
||||||
|
@property({ type: Boolean })
|
||||||
|
public rounded: boolean = false;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
domtools.elementBasic.setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static styles = [
|
||||||
|
cssManager.defaultStyles,
|
||||||
|
css`
|
||||||
|
:host {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 2px 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.5;
|
||||||
|
border-radius: 4px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.rounded {
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.default {
|
||||||
|
background: ${cssManager.bdTheme('#f5f5f5', '#333')};
|
||||||
|
color: ${cssManager.bdTheme('#666', '#ccc')};
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.primary {
|
||||||
|
background: #0050b9;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.success {
|
||||||
|
background: #2e7d32;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.warning {
|
||||||
|
background: #ed6c02;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.error {
|
||||||
|
background: #e4002b;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
];
|
||||||
|
|
||||||
|
public render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<div class="badge ${this.type} ${this.rounded ? 'rounded' : ''}">
|
||||||
|
${this.text}
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
@ -22,13 +22,25 @@ declare global {
|
|||||||
|
|
||||||
@customElement('dees-terminal')
|
@customElement('dees-terminal')
|
||||||
export class DeesTerminal extends DeesElement {
|
export class DeesTerminal extends DeesElement {
|
||||||
public static demo = () => html` <dees-terminal></dees-terminal> `;
|
public static demo = () => html` <dees-terminal
|
||||||
|
.environment=${{
|
||||||
|
NODE_ENV: 'development',
|
||||||
|
PORT: '3000',
|
||||||
|
}}
|
||||||
|
></dees-terminal> `;
|
||||||
|
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
private resizeObserver: ResizeObserver;
|
private resizeObserver: ResizeObserver;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
public setupCommand = `pnpm install @git.zone/tsbuild && clear && echo 'welcome'`;
|
public setupCommand = `pnpm install @serve.zone/cli && servezone cli\n`;
|
||||||
|
|
||||||
|
@property()
|
||||||
|
environment: {[key: string]: string} = {};
|
||||||
|
|
||||||
|
// exposing webcontainer
|
||||||
|
private webcontainerDeferred = new domtools.plugins.smartpromise.Deferred<webcontainer.WebContainer>();
|
||||||
|
public webcontainerPromise = this.webcontainerDeferred.promise;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@ -282,8 +294,15 @@ export class DeesTerminal extends DeesElement {
|
|||||||
input.write(data);
|
input.write(data);
|
||||||
});
|
});
|
||||||
await this.waitForPrompt(term, '~/');
|
await this.waitForPrompt(term, '~/');
|
||||||
|
// lets set the environment variables
|
||||||
|
await this.setEnvironmentVariables(this.environment, webcontainerInstance);
|
||||||
|
input.write(`source source.env\n`);
|
||||||
|
await this.waitForPrompt(term, '~/');
|
||||||
|
// lets run the setup command
|
||||||
input.write(this.setupCommand);
|
input.write(this.setupCommand);
|
||||||
input.write(`\n`);
|
await this.waitForPrompt(term, '~/');
|
||||||
|
input.write(`clear && echo 'welcome'\n`);
|
||||||
|
this.webcontainerDeferred.resolve(webcontainerInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
async connectedCallback(): Promise<void> {
|
async connectedCallback(): Promise<void> {
|
||||||
@ -300,14 +319,16 @@ export class DeesTerminal extends DeesElement {
|
|||||||
this.fitAddon.fit();
|
this.fitAddon.fit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async waitForPrompt(term: Terminal, prompt: string): Promise<void> {
|
public async waitForPrompt(term: Terminal, prompt: string): Promise<void> {
|
||||||
return new Promise<void>((resolve) => {
|
return new Promise<void>((resolve) => {
|
||||||
const checkPrompt = () => {
|
const checkPrompt = () => {
|
||||||
const lines = term.buffer.active;
|
const lines = term.buffer.active;
|
||||||
for (let i = 0; i < lines.length; i++) {
|
for (let i = 0; i < lines.length; i++) {
|
||||||
const line = lines.getLine(i);
|
const line = lines.getLine(i);
|
||||||
if (line && line.translateToString().includes(prompt)) {
|
if (line && line.translateToString().includes(prompt)) {
|
||||||
|
setTimeout(() => {
|
||||||
resolve();
|
resolve();
|
||||||
|
}, 100);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -317,4 +338,18 @@ export class DeesTerminal extends DeesElement {
|
|||||||
checkPrompt();
|
checkPrompt();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async setEnvironmentVariables(envArg: {[key: string]: string}, webcontainerInstanceArg?: webcontainer.WebContainer) {
|
||||||
|
const webcontainerInstance = webcontainerInstanceArg ||await this.webcontainerPromise;
|
||||||
|
let envFile = ``
|
||||||
|
for (const key in envArg) {
|
||||||
|
envFile += `export ${key}="${envArg[key]}"\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
await webcontainerInstance.mount({'source.env': {
|
||||||
|
file: {
|
||||||
|
contents: envFile,
|
||||||
|
}
|
||||||
|
}});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ export * from './dees-appui-base.js';
|
|||||||
export * from './dees-appui-maincontent.js';
|
export * from './dees-appui-maincontent.js';
|
||||||
export * from './dees-appui-mainmenu.js';
|
export * from './dees-appui-mainmenu.js';
|
||||||
export * from './dees-appui-mainselector.js';
|
export * from './dees-appui-mainselector.js';
|
||||||
|
export * from './dees-badge.js';
|
||||||
export * from './dees-button-exit.js';
|
export * from './dees-button-exit.js';
|
||||||
export * from './dees-button.js';
|
export * from './dees-button.js';
|
||||||
export * from './dees-chart-area.js';
|
export * from './dees-chart-area.js';
|
||||||
|
Reference in New Issue
Block a user