Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 472132e8cf | |||
| e062f5046e | |||
| f2d3fc28f8 | |||
| 7295bfcf92 | |||
| ad732a3e68 | |||
| b38bd28360 | |||
| 99a531ee74 | |||
| 1a3a5e5454 | |||
| 5cf8161735 | |||
| 46d9cdc741 | |||
| c13f319474 | |||
| c0ac8f593a | |||
| c52854f902 |
33
changelog.md
33
changelog.md
@@ -1,5 +1,38 @@
|
||||
# Changelog
|
||||
|
||||
## 2026-04-03 - 3.51.1 - fix(repo)
|
||||
no changes to commit
|
||||
|
||||
|
||||
## 2026-04-03 - 3.51.0 - feat(chart-area)
|
||||
replace ApexCharts with Lightweight Charts for area chart rendering
|
||||
|
||||
- switch chart dependency and CDN loader from apexcharts to lightweight-charts
|
||||
- update dees-chart-area styling and tooltip support for the new chart engine
|
||||
- adjust appdash terminal overlay sizing with automatic height
|
||||
|
||||
## 2026-04-02 - 3.50.2 - fix(chart,dashboardgrid demos)
|
||||
use dees-button text property consistently in demo interactions and update dataset button highlighting reliably
|
||||
|
||||
- Replaces textContent reads with the component text property when wiring demo button handlers.
|
||||
- Updates the chart area demo to refresh dataset button highlight states directly on click without redundant listener replacement logic.
|
||||
- Uses the button text property when toggling dashboard edit mode labels.
|
||||
|
||||
## 2026-04-02 - 3.50.1 - fix(appdash)
|
||||
use banner height CSS variable for terminal layout and expose terminal resize handling
|
||||
|
||||
- Removes manual terminal top offset updates in the app dashboard and relies on the shared --banner-area-height CSS variable instead.
|
||||
- Drops fixed max-width and max-height calculations so the terminal can size more reliably within its container.
|
||||
- Makes the workspace terminal resize handler public to support external resize coordination.
|
||||
|
||||
## 2026-04-02 - 3.50.0 - feat(dees-simple-appdash)
|
||||
add global message banners with actions and dismissal support
|
||||
|
||||
- introduces typed global message APIs and public methods to add, remove, and clear banners
|
||||
- renders info, success, warning, and error banners with optional icons and action buttons
|
||||
- adjusts app content and terminal positioning to account for banner height dynamically
|
||||
- updates the demo to showcase dismissible and actionable global messages
|
||||
|
||||
## 2026-04-02 - 3.49.2 - fix(dees-input-list)
|
||||
refine dees-input-list spacing and simplify the add item action button
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@design.estate/dees-catalog",
|
||||
"version": "3.49.2",
|
||||
"version": "3.51.1",
|
||||
"private": false,
|
||||
"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",
|
||||
@@ -34,7 +34,7 @@
|
||||
"@tiptap/extension-underline": "^2.23.0",
|
||||
"@tiptap/starter-kit": "^2.23.0",
|
||||
"@tsclass/tsclass": "^9.5.0",
|
||||
"apexcharts": "^5.10.4",
|
||||
"lightweight-charts": "^5.1.0",
|
||||
"highlight.js": "11.11.1",
|
||||
"ibantools": "^4.5.1",
|
||||
"lucide": "^0.577.0",
|
||||
|
||||
18
pnpm-lock.yaml
generated
18
pnpm-lock.yaml
generated
@@ -62,15 +62,15 @@ importers:
|
||||
'@tsclass/tsclass':
|
||||
specifier: ^9.5.0
|
||||
version: 9.5.0
|
||||
apexcharts:
|
||||
specifier: ^5.10.4
|
||||
version: 5.10.4
|
||||
highlight.js:
|
||||
specifier: 11.11.1
|
||||
version: 11.11.1
|
||||
ibantools:
|
||||
specifier: ^4.5.1
|
||||
version: 4.5.1
|
||||
lightweight-charts:
|
||||
specifier: ^5.1.0
|
||||
version: 5.1.0
|
||||
lucide:
|
||||
specifier: ^0.577.0
|
||||
version: 0.577.0
|
||||
@@ -2648,6 +2648,9 @@ packages:
|
||||
resolution: {integrity: sha512-CGnyrvbhPlWYMngksqrSSUT1BAVP49dZocrHuK0SvtR0D5TMs5wP0o3j7jexDJW01KSadjBp1M/71o/KR3nD1w==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
fancy-canvas@2.1.0:
|
||||
resolution: {integrity: sha512-nifxXJ95JNLFR2NgRV4/MxVP45G9909wJTEKz5fg/TZS20JJZA6hfgRVh/bC9bwl2zBtBNcYPjiBE4njQHVBwQ==}
|
||||
|
||||
fast-deep-equal@3.1.3:
|
||||
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
|
||||
|
||||
@@ -2996,6 +2999,9 @@ packages:
|
||||
resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
lightweight-charts@5.1.0:
|
||||
resolution: {integrity: sha512-jEAYR4ODYeyNZcWUigsoLTl52rbPmgXnvd5FLIv/ZoA/2sSDw63YKnef8n4yhzum7W926yHeFwlm7ididKb7YQ==}
|
||||
|
||||
lines-and-columns@1.2.4:
|
||||
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
|
||||
|
||||
@@ -7810,6 +7816,8 @@ snapshots:
|
||||
|
||||
fake-indexeddb@6.2.5: {}
|
||||
|
||||
fancy-canvas@2.1.0: {}
|
||||
|
||||
fast-deep-equal@3.1.3: {}
|
||||
|
||||
fast-fifo@1.3.2: {}
|
||||
@@ -8229,6 +8237,10 @@ snapshots:
|
||||
|
||||
kind-of@6.0.3: {}
|
||||
|
||||
lightweight-charts@5.1.0:
|
||||
dependencies:
|
||||
fancy-canvas: 2.1.0
|
||||
|
||||
lines-and-columns@1.2.4: {}
|
||||
|
||||
linkify-it@5.0.0:
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@design.estate/dees-catalog',
|
||||
version: '3.49.2',
|
||||
version: '3.51.1',
|
||||
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -310,30 +310,11 @@ export const demoFunc = () => {
|
||||
connectionsLastUpdate = 0;
|
||||
};
|
||||
|
||||
// Wire up button click handlers
|
||||
const buttons = elementArg.querySelectorAll('dees-button');
|
||||
buttons.forEach(button => {
|
||||
const text = button.textContent?.trim();
|
||||
if (text === 'System Usage') {
|
||||
button.addEventListener('click', () => switchDataset('system'));
|
||||
} else if (text === 'Network Traffic') {
|
||||
button.addEventListener('click', () => switchDataset('network'));
|
||||
} else if (text === 'Sales Data') {
|
||||
button.addEventListener('click', () => switchDataset('sales'));
|
||||
} else if (text === 'Start Live') {
|
||||
button.addEventListener('click', () => startRealtime());
|
||||
} else if (text === 'Stop Live') {
|
||||
button.addEventListener('click', () => stopRealtime());
|
||||
} else if (text === 'Spike Values') {
|
||||
button.addEventListener('click', () => randomizeData());
|
||||
}
|
||||
});
|
||||
|
||||
// Update button states based on current dataset
|
||||
const updateButtonStates = () => {
|
||||
const buttons = elementArg.querySelectorAll('dees-button');
|
||||
buttons.forEach(button => {
|
||||
const text = button.textContent?.trim();
|
||||
const allButtons = elementArg.querySelectorAll('dees-button');
|
||||
allButtons.forEach((button: any) => {
|
||||
const text = button.text?.trim();
|
||||
if (text === 'System Usage') {
|
||||
button.type = currentDataset === 'system' ? 'highlighted' : 'normal';
|
||||
} else if (text === 'Network Traffic') {
|
||||
@@ -343,41 +324,38 @@ export const demoFunc = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// Wire up button click handlers
|
||||
const buttons = elementArg.querySelectorAll('dees-button');
|
||||
buttons.forEach((button: any) => {
|
||||
const text = button.text?.trim();
|
||||
if (text === 'System Usage') {
|
||||
button.addEventListener('click', () => { switchDataset('system'); updateButtonStates(); });
|
||||
} else if (text === 'Network Traffic') {
|
||||
button.addEventListener('click', () => { switchDataset('network'); updateButtonStates(); });
|
||||
} else if (text === 'Sales Data') {
|
||||
button.addEventListener('click', () => { switchDataset('sales'); updateButtonStates(); });
|
||||
} else if (text === 'Start Live') {
|
||||
button.addEventListener('click', () => startRealtime());
|
||||
} else if (text === 'Stop Live') {
|
||||
button.addEventListener('click', () => stopRealtime());
|
||||
} else if (text === 'Spike Values') {
|
||||
button.addEventListener('click', () => randomizeData());
|
||||
}
|
||||
});
|
||||
|
||||
// Configure main chart with rolling window
|
||||
chartElement.rollingWindow = TIME_WINDOW;
|
||||
chartElement.realtimeMode = false; // Will be enabled when starting live updates
|
||||
chartElement.yAxisScaling = 'percentage'; // Initial system dataset uses percentage
|
||||
chartElement.yAxisMax = 100;
|
||||
chartElement.autoScrollInterval = 1000; // Auto-scroll every second
|
||||
|
||||
|
||||
// Set initial time window
|
||||
setTimeout(() => {
|
||||
chartElement.updateTimeWindow();
|
||||
}, 100);
|
||||
|
||||
// Update button states when dataset changes
|
||||
const originalSwitchDataset = switchDataset;
|
||||
const switchDatasetWithButtonUpdate = (name: string) => {
|
||||
originalSwitchDataset(name);
|
||||
updateButtonStates();
|
||||
};
|
||||
|
||||
// Replace switchDataset with the one that updates buttons
|
||||
buttons.forEach(button => {
|
||||
const text = button.textContent?.trim();
|
||||
if (text === 'System Usage') {
|
||||
button.removeEventListener('click', () => switchDataset('system'));
|
||||
button.addEventListener('click', () => switchDatasetWithButtonUpdate('system'));
|
||||
} else if (text === 'Network Traffic') {
|
||||
button.removeEventListener('click', () => switchDataset('network'));
|
||||
button.addEventListener('click', () => switchDatasetWithButtonUpdate('network'));
|
||||
} else if (text === 'Sales Data') {
|
||||
button.removeEventListener('click', () => switchDataset('sales'));
|
||||
button.addEventListener('click', () => switchDatasetWithButtonUpdate('sales'));
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize connections chart with data
|
||||
if (connectionsChartElement) {
|
||||
const initialConnectionsData = generateInitialData(previousValues.connections, 30, UPDATE_INTERVAL);
|
||||
|
||||
@@ -6,7 +6,6 @@ export const chartAreaStyles = [
|
||||
:host {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
||||
color: ${cssManager.bdTheme('hsl(0 0% 3.9%)', 'hsl(0 0% 98%)')};
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
}
|
||||
.mainbox {
|
||||
@@ -18,7 +17,6 @@ export const chartAreaStyles = [
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chartTitle {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -34,27 +32,59 @@ export const chartAreaStyles = [
|
||||
}
|
||||
.chartContainer {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
padding: 44px 16px 16px 0px;
|
||||
overflow: hidden;
|
||||
background: transparent; /* Ensure container doesn't override chart background */
|
||||
top: 44px;
|
||||
left: 0;
|
||||
bottom: 32px;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
/* ApexCharts theme overrides */
|
||||
.apexcharts-canvas {
|
||||
background: transparent !important;
|
||||
.statsBar {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
padding: 0 16px;
|
||||
border-top: 1px solid ${cssManager.bdTheme('hsl(0 0% 89.8%)', 'hsl(0 0% 14.9%)')};
|
||||
font-size: 11px;
|
||||
color: ${cssManager.bdTheme('hsl(0 0% 45%)', 'hsl(0 0% 55%)')};
|
||||
}
|
||||
|
||||
.apexcharts-inner {
|
||||
background: transparent !important;
|
||||
.statsSeries {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.apexcharts-graphical {
|
||||
background: transparent !important;
|
||||
.statsSeries + .statsSeries {
|
||||
padding-left: 24px;
|
||||
border-left: 1px solid ${cssManager.bdTheme('hsl(0 0% 89.8%)', 'hsl(0 0% 14.9%)')};
|
||||
}
|
||||
.statsColor {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 2px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.statsName {
|
||||
font-weight: 500;
|
||||
color: ${cssManager.bdTheme('hsl(0 0% 20%)', 'hsl(0 0% 80%)')};
|
||||
margin-right: 4px;
|
||||
}
|
||||
.statsItem strong {
|
||||
color: ${cssManager.bdTheme('hsl(0 0% 15%)', 'hsl(0 0% 90%)')};
|
||||
}
|
||||
.lw-tooltip {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
pointer-events: none;
|
||||
padding: 12px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||
font-size: 12px;
|
||||
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);
|
||||
min-width: 140px;
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
|
||||
@@ -6,7 +6,20 @@ export const renderChartArea = (component: DeesChartArea): TemplateResult => {
|
||||
<div class="mainbox">
|
||||
<div class="chartTitle">${component.label}</div>
|
||||
<div class="chartContainer"></div>
|
||||
${component.seriesStats.length > 0 ? html`
|
||||
<div class="statsBar">
|
||||
${component.seriesStats.map(s => html`
|
||||
<div class="statsSeries">
|
||||
<span class="statsColor" style="background:${s.color}"></span>
|
||||
<span class="statsName">${s.name}</span>
|
||||
<span class="statsItem">latest <strong>${component.yAxisFormatter(s.latest)}</strong></span>
|
||||
<span class="statsItem">min <strong>${component.yAxisFormatter(s.min)}</strong></span>
|
||||
<span class="statsItem">max <strong>${component.yAxisFormatter(s.max)}</strong></span>
|
||||
<span class="statsItem">avg <strong>${component.yAxisFormatter(s.avg)}</strong></span>
|
||||
</div>
|
||||
`)}
|
||||
</div>
|
||||
` : ''}
|
||||
</div>
|
||||
`;
|
||||
|
||||
};
|
||||
|
||||
@@ -174,7 +174,7 @@ export const demoFunc = () => {
|
||||
// Wire up button click handlers
|
||||
const buttons = elementArg.querySelectorAll('dees-button');
|
||||
buttons.forEach(button => {
|
||||
const text = button.textContent?.trim();
|
||||
const text = (button as any).text?.trim();
|
||||
switch (text) {
|
||||
case 'Add Structured Log':
|
||||
button.addEventListener('click', () => generateRandomLog());
|
||||
|
||||
@@ -103,7 +103,7 @@ export const demoFunc = () => {
|
||||
|
||||
const buttons = elementArg.querySelectorAll('dees-button');
|
||||
buttons.forEach(button => {
|
||||
const text = button.textContent?.trim();
|
||||
const text = (button as any).text?.trim();
|
||||
|
||||
switch (text) {
|
||||
case 'Toggle Animation':
|
||||
@@ -147,7 +147,7 @@ export const demoFunc = () => {
|
||||
case 'Toggle Edit Mode':
|
||||
button.addEventListener('click', () => {
|
||||
grid.editable = !grid.editable;
|
||||
button.textContent = grid.editable ? 'Lock Grid' : 'Unlock Grid';
|
||||
(button as any).text = grid.editable ? 'Lock Grid' : 'Unlock Grid';
|
||||
});
|
||||
break;
|
||||
case 'Reset Layout':
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { html, DeesElement, customElement, css, cssManager } from '@design.estate/dees-element';
|
||||
import type { IView } from './dees-simple-appdash.js';
|
||||
import type { IView, IGlobalMessage } from './dees-simple-appdash.js';
|
||||
import '../../00group-form/dees-form/dees-form.js';
|
||||
import '../../00group-input/dees-input-text/dees-input-text.js';
|
||||
import '../../00group-input/dees-input-checkbox/dees-input-checkbox.js';
|
||||
@@ -263,6 +263,44 @@ export const demoFunc = () => html`
|
||||
<dees-simple-appdash
|
||||
name="My Application"
|
||||
terminalSetupCommand="echo 'Welcome to the terminal!'"
|
||||
.globalMessages=${[
|
||||
{
|
||||
id: 'update',
|
||||
type: 'info',
|
||||
message: 'A new version (v3.50.0) is available with performance improvements and bug fixes.',
|
||||
dismissible: true,
|
||||
actions: [
|
||||
{
|
||||
name: 'Update Now',
|
||||
iconName: 'lucide:download',
|
||||
action: () => alert('Updating...'),
|
||||
},
|
||||
{
|
||||
name: 'Release Notes',
|
||||
action: () => alert('Opening release notes...'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'maintenance',
|
||||
type: 'warning',
|
||||
message: 'Scheduled maintenance window: April 5, 2026 02:00–06:00 UTC. Some services may be temporarily unavailable.',
|
||||
dismissible: true,
|
||||
},
|
||||
{
|
||||
id: 'critical',
|
||||
type: 'error',
|
||||
message: 'Your SSL certificate expires in 3 days. Renew now to avoid service disruption.',
|
||||
dismissible: false,
|
||||
actions: [
|
||||
{
|
||||
name: 'Renew Certificate',
|
||||
iconName: 'lucide:shieldCheck',
|
||||
action: () => alert('Renewing certificate...'),
|
||||
},
|
||||
],
|
||||
},
|
||||
] as IGlobalMessage[]}
|
||||
.viewTabs=${[
|
||||
{
|
||||
name: 'Dashboard',
|
||||
|
||||
@@ -29,6 +29,23 @@ export interface IView {
|
||||
element: DeesElement['constructor']['prototype'];
|
||||
}
|
||||
|
||||
export type TGlobalMessageType = 'info' | 'success' | 'warning' | 'error';
|
||||
|
||||
export interface IGlobalMessageAction {
|
||||
name: string;
|
||||
iconName?: string;
|
||||
action: () => void | Promise<void>;
|
||||
}
|
||||
|
||||
export interface IGlobalMessage {
|
||||
id: string;
|
||||
type: TGlobalMessageType;
|
||||
message: string;
|
||||
dismissible?: boolean;
|
||||
icon?: string;
|
||||
actions?: IGlobalMessageAction[];
|
||||
}
|
||||
|
||||
@customElement('dees-simple-appdash')
|
||||
export class DeesSimpleAppDash extends DeesElement {
|
||||
// STATIC
|
||||
@@ -45,9 +62,15 @@ export class DeesSimpleAppDash extends DeesElement {
|
||||
@property({ type: String })
|
||||
accessor terminalSetupCommand: string = `echo "Terminal ready"`;
|
||||
|
||||
@property({ type: Array })
|
||||
accessor globalMessages: IGlobalMessage[] = [];
|
||||
|
||||
@state()
|
||||
accessor selectedView!: IView;
|
||||
|
||||
@state()
|
||||
accessor _activeMessages: IGlobalMessage[] = [];
|
||||
|
||||
|
||||
public static styles = [
|
||||
themeDefaultStyles,
|
||||
@@ -327,6 +350,170 @@ export class DeesSimpleAppDash extends DeesElement {
|
||||
.control.status-terminal dees-icon {
|
||||
color: hsl(45 90% 55%);
|
||||
}
|
||||
|
||||
/* Global Message Banners */
|
||||
.messageBannerArea {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 240px;
|
||||
right: 0;
|
||||
z-index: 3;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.messageBanner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 10px 16px;
|
||||
font-size: 13px;
|
||||
font-family: 'Geist Sans', sans-serif;
|
||||
font-weight: 500;
|
||||
border-bottom: 1px solid ${cssManager.bdTheme('hsl(0 0% 91%)', 'hsl(0 0% 13%)')};
|
||||
animation: bannerSlideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
||||
}
|
||||
|
||||
.messageBanner.dismissing {
|
||||
animation: bannerSlideUp 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
||||
}
|
||||
|
||||
@keyframes bannerSlideDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes bannerSlideUp {
|
||||
from {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
}
|
||||
|
||||
.messageBanner dees-icon {
|
||||
font-size: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.messageBanner-text {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.messageBanner-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.messageBanner-action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 4px 12px;
|
||||
border-radius: 4px;
|
||||
cursor: default;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.01em;
|
||||
transition: all 0.15s ease;
|
||||
white-space: nowrap;
|
||||
background: ${cssManager.bdTheme('hsl(0 0% 0% / 0.08)', 'hsl(0 0% 100% / 0.1)')};
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.messageBanner-action:hover {
|
||||
background: ${cssManager.bdTheme('hsl(0 0% 0% / 0.15)', 'hsl(0 0% 100% / 0.18)')};
|
||||
}
|
||||
|
||||
.messageBanner-action:active {
|
||||
transform: scale(0.97);
|
||||
}
|
||||
|
||||
.messageBanner-action dees-icon {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.messageBanner-dismiss {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 4px;
|
||||
cursor: default;
|
||||
opacity: 0.5;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.messageBanner-dismiss:hover {
|
||||
opacity: 1;
|
||||
background: hsl(0 0% 0% / 0.1);
|
||||
}
|
||||
|
||||
/* Message type: info */
|
||||
.messageBanner-info {
|
||||
background: ${cssManager.bdTheme('hsl(210 100% 97%)', 'hsl(210 50% 10%)')};
|
||||
color: ${cssManager.bdTheme('hsl(210 70% 30%)', 'hsl(210 70% 80%)')};
|
||||
border-left: 3px solid #0084ff;
|
||||
}
|
||||
.messageBanner-info dees-icon {
|
||||
color: #0084ff;
|
||||
}
|
||||
|
||||
/* Message type: success */
|
||||
.messageBanner-success {
|
||||
background: ${cssManager.bdTheme('hsl(142 70% 97%)', 'hsl(142 30% 10%)')};
|
||||
color: ${cssManager.bdTheme('hsl(142 50% 25%)', 'hsl(142 50% 80%)')};
|
||||
border-left: 3px solid #22c55e;
|
||||
}
|
||||
.messageBanner-success dees-icon {
|
||||
color: #22c55e;
|
||||
}
|
||||
|
||||
/* Message type: warning */
|
||||
.messageBanner-warning {
|
||||
background: ${cssManager.bdTheme('hsl(38 90% 97%)', 'hsl(38 40% 10%)')};
|
||||
color: ${cssManager.bdTheme('hsl(38 60% 25%)', 'hsl(38 60% 80%)')};
|
||||
border-left: 3px solid #f59e0b;
|
||||
}
|
||||
.messageBanner-warning dees-icon {
|
||||
color: #f59e0b;
|
||||
}
|
||||
|
||||
/* Message type: error */
|
||||
.messageBanner-error {
|
||||
background: ${cssManager.bdTheme('hsl(0 70% 97%)', 'hsl(0 40% 10%)')};
|
||||
color: ${cssManager.bdTheme('hsl(0 60% 30%)', 'hsl(0 60% 80%)')};
|
||||
border-left: 3px solid #ef4444;
|
||||
}
|
||||
.messageBanner-error dees-icon {
|
||||
color: #ef4444;
|
||||
}
|
||||
|
||||
.messageBanner-dismiss:hover {
|
||||
background: ${cssManager.bdTheme('hsl(0 0% 0% / 0.08)', 'hsl(0 0% 100% / 0.1)')};
|
||||
}
|
||||
|
||||
.appcontent {
|
||||
top: var(--banner-area-height, 0px);
|
||||
height: calc(100% - 24px - var(--banner-area-height, 0px));
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
@@ -369,6 +556,34 @@ export class DeesSimpleAppDash extends DeesElement {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
${this._activeMessages.length > 0 ? html`
|
||||
<div class="messageBannerArea">
|
||||
${this._activeMessages.map(msg => html`
|
||||
<div
|
||||
class="messageBanner messageBanner-${msg.type}"
|
||||
data-message-id="${msg.id}"
|
||||
>
|
||||
<dees-icon .icon="${this.getMessageIcon(msg)}"></dees-icon>
|
||||
<span class="messageBanner-text">${msg.message}</span>
|
||||
${msg.actions?.length ? html`
|
||||
<div class="messageBanner-actions">
|
||||
${msg.actions.map(a => html`
|
||||
<div class="messageBanner-action" @click=${() => a.action()}>
|
||||
${a.iconName ? html`<dees-icon .icon="${a.iconName.includes(':') ? a.iconName : `lucide:${a.iconName}`}"></dees-icon>` : ''}
|
||||
<span>${a.name}</span>
|
||||
</div>
|
||||
`)}
|
||||
</div>
|
||||
` : ''}
|
||||
${msg.dismissible !== false ? html`
|
||||
<div class="messageBanner-dismiss" @click=${() => this.removeMessage(msg.id)}>
|
||||
<dees-icon .icon="${'lucide:x'}"></dees-icon>
|
||||
</div>
|
||||
` : ''}
|
||||
</div>
|
||||
`)}
|
||||
</div>
|
||||
` : ''}
|
||||
<div class="appcontent">
|
||||
<!-- Content goes here -->
|
||||
</div>
|
||||
@@ -394,6 +609,86 @@ export class DeesSimpleAppDash extends DeesElement {
|
||||
await this.loadView(viewToLoad);
|
||||
}
|
||||
}
|
||||
|
||||
public willUpdate(changedProperties: Map<string, unknown>) {
|
||||
if (changedProperties.has('globalMessages')) {
|
||||
// Sync globalMessages property into _activeMessages
|
||||
// Keep any messages added via addMessage() that aren't in globalMessages
|
||||
const propertyIds = new Set(this.globalMessages.map(m => m.id));
|
||||
const existingIds = new Set(this._activeMessages.map(m => m.id));
|
||||
|
||||
// Add new messages from property that aren't already active
|
||||
const newMessages = this.globalMessages.filter(m => !existingIds.has(m.id));
|
||||
|
||||
// Keep messages added via API (those not in globalMessages are kept as-is)
|
||||
// Remove messages that were in the previous globalMessages but are no longer
|
||||
const previousGlobalMessages = (changedProperties.get('globalMessages') as IGlobalMessage[]) || [];
|
||||
const previousIds = new Set(previousGlobalMessages.map(m => m.id));
|
||||
const removedIds = new Set([...previousIds].filter(id => !propertyIds.has(id)));
|
||||
|
||||
this._activeMessages = [
|
||||
...this._activeMessages.filter(m => !removedIds.has(m.id)),
|
||||
...newMessages,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
public updated(changedProperties: Map<string, unknown>) {
|
||||
super.updated(changedProperties);
|
||||
this.updateBannerOffset();
|
||||
}
|
||||
|
||||
private updateBannerOffset() {
|
||||
requestAnimationFrame(() => {
|
||||
const bannerArea = this.shadowRoot?.querySelector('.messageBannerArea') as HTMLElement;
|
||||
const maincontainer = this.shadowRoot?.querySelector('.maincontainer') as HTMLElement;
|
||||
const height = bannerArea ? bannerArea.offsetHeight : 0;
|
||||
maincontainer?.style.setProperty('--banner-area-height', `${height}px`);
|
||||
});
|
||||
}
|
||||
|
||||
private getMessageIcon(msg: IGlobalMessage): string {
|
||||
if (msg.icon) return msg.icon;
|
||||
const defaults: Record<TGlobalMessageType, string> = {
|
||||
info: 'lucide:info',
|
||||
success: 'lucide:circleCheck',
|
||||
warning: 'lucide:triangleAlert',
|
||||
error: 'lucide:circleX',
|
||||
};
|
||||
return defaults[msg.type];
|
||||
}
|
||||
|
||||
public addMessage(message: Omit<IGlobalMessage, 'id'> & { id?: string }): string {
|
||||
const id = message.id || `msg-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
||||
const fullMessage: IGlobalMessage = {
|
||||
dismissible: true,
|
||||
...message,
|
||||
id,
|
||||
};
|
||||
this._activeMessages = [...this._activeMessages, fullMessage];
|
||||
return id;
|
||||
}
|
||||
|
||||
public removeMessage(id: string): void {
|
||||
const bannerEl = this.shadowRoot?.querySelector(`[data-message-id="${id}"]`) as HTMLElement;
|
||||
if (bannerEl) {
|
||||
bannerEl.classList.add('dismissing');
|
||||
bannerEl.addEventListener('animationend', () => {
|
||||
this._activeMessages = this._activeMessages.filter(m => m.id !== id);
|
||||
this.dispatchEvent(new CustomEvent('message-dismiss', {
|
||||
detail: { id },
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
}));
|
||||
}, { once: true });
|
||||
} else {
|
||||
this._activeMessages = this._activeMessages.filter(m => m.id !== id);
|
||||
}
|
||||
}
|
||||
|
||||
public clearMessages(): void {
|
||||
this._activeMessages = [];
|
||||
}
|
||||
|
||||
public currentTerminal: DeesWorkspaceTerminal | null = null;
|
||||
public async launchTerminal() {
|
||||
@@ -412,16 +707,15 @@ export class DeesSimpleAppDash extends DeesElement {
|
||||
maincontainer.appendChild(terminal);
|
||||
terminal.style.position = 'absolute';
|
||||
terminal.style.zIndex = '10';
|
||||
terminal.style.top = '0px';
|
||||
terminal.style.top = 'var(--banner-area-height, 0px)';
|
||||
terminal.style.left = '240px';
|
||||
terminal.style.right = '0px';
|
||||
terminal.style.height = 'auto';
|
||||
terminal.style.bottom = '24px';
|
||||
terminal.style.opacity = '0';
|
||||
terminal.style.transform = 'translateY(8px) scale(0.99)';
|
||||
terminal.style.transition = 'all 0.25s cubic-bezier(0.4, 0, 0.2, 1)';
|
||||
terminal.style.boxShadow = '0 25px 50px -12px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.05)';
|
||||
terminal.style.maxWidth = `calc(${maincontainer.clientWidth}px -240px)`;
|
||||
terminal.style.maxHeight = `calc(${maincontainer.clientHeight}px - 24px)`;
|
||||
|
||||
// Add close button to terminal
|
||||
terminal.addEventListener('close', () => this.closeTerminal());
|
||||
|
||||
@@ -106,11 +106,11 @@ export class DeesWorkspaceTerminal extends DeesElement {
|
||||
css`
|
||||
:host {
|
||||
background: ${cssManager.bdTheme('#ffffff', '#000000')};
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
* {
|
||||
@@ -596,7 +596,7 @@ export class DeesWorkspaceTerminal extends DeesElement {
|
||||
tab.terminal.focus();
|
||||
}
|
||||
|
||||
private handleResize(): void {
|
||||
public handleResize(): void {
|
||||
if (this.activeTabId) {
|
||||
const tab = this.tabManager.getTab(this.activeTabId);
|
||||
if (tab) {
|
||||
|
||||
@@ -4,7 +4,15 @@ import { CDN_BASE, CDN_VERSIONS } from './versions.js';
|
||||
import type { Terminal, ITerminalOptions } from 'xterm';
|
||||
import type { FitAddon } from 'xterm-addon-fit';
|
||||
import type { HLJSApi } from 'highlight.js';
|
||||
import type ApexChartsType from 'apexcharts';
|
||||
import type {
|
||||
createChart as createChartType,
|
||||
IChartApi,
|
||||
ISeriesApi,
|
||||
UTCTimestamp,
|
||||
MouseEventParams,
|
||||
DeepPartial,
|
||||
TimeChartOptions,
|
||||
} from 'lightweight-charts';
|
||||
import type { Editor, EditorOptions } from '@tiptap/core';
|
||||
import type { StarterKitOptions } from '@tiptap/starter-kit';
|
||||
import type { UnderlineOptions } from '@tiptap/extension-underline';
|
||||
@@ -43,6 +51,29 @@ export interface IXtermSearchAddon {
|
||||
findPrevious(term: string, searchOptions?: { regex?: boolean; wholeWord?: boolean; caseSensitive?: boolean; incremental?: boolean }): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bundle type for TradingView Lightweight Charts
|
||||
*/
|
||||
export interface ILightweightChartsBundle {
|
||||
createChart: typeof createChartType;
|
||||
AreaSeries: any;
|
||||
LineSeries: any;
|
||||
ColorType: {
|
||||
Solid: string;
|
||||
VerticalGradient: string;
|
||||
};
|
||||
LineType: {
|
||||
Simple: number;
|
||||
WithSteps: number;
|
||||
Curved: number;
|
||||
};
|
||||
CrosshairMode: {
|
||||
Normal: number;
|
||||
Magnet: number;
|
||||
Hidden: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Bundle type for Tiptap editor and extensions
|
||||
*/
|
||||
@@ -76,7 +107,7 @@ export class DeesServiceLibLoader {
|
||||
private xtermFitAddonLib: IXtermFitAddonBundle | null = null;
|
||||
private xtermSearchAddonLib: IXtermSearchAddonBundle | null = null;
|
||||
private highlightJsLib: HLJSApi | null = null;
|
||||
private apexChartsLib: typeof ApexChartsType | null = null;
|
||||
private lightweightChartsLib: ILightweightChartsBundle | null = null;
|
||||
private tiptapLib: ITiptapBundle | null = null;
|
||||
|
||||
// Loading promises to prevent duplicate concurrent loads
|
||||
@@ -84,7 +115,7 @@ export class DeesServiceLibLoader {
|
||||
private xtermFitAddonLoadingPromise: Promise<IXtermFitAddonBundle> | null = null;
|
||||
private xtermSearchAddonLoadingPromise: Promise<IXtermSearchAddonBundle> | null = null;
|
||||
private highlightJsLoadingPromise: Promise<HLJSApi> | null = null;
|
||||
private apexChartsLoadingPromise: Promise<typeof ApexChartsType> | null = null;
|
||||
private lightweightChartsLoadingPromise: Promise<ILightweightChartsBundle> | null = null;
|
||||
private tiptapLoadingPromise: Promise<ITiptapBundle> | null = null;
|
||||
|
||||
private constructor() {}
|
||||
@@ -235,27 +266,34 @@ body > div[style*="top: -50000px"][style*="width: 50000px"] {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load ApexCharts charting library from CDN
|
||||
* @returns Promise resolving to ApexCharts constructor
|
||||
* Load TradingView Lightweight Charts from CDN
|
||||
* @returns Promise resolving to Lightweight Charts bundle
|
||||
*/
|
||||
public async loadApexCharts(): Promise<typeof ApexChartsType> {
|
||||
if (this.apexChartsLib) {
|
||||
return this.apexChartsLib;
|
||||
public async loadLightweightCharts(): Promise<ILightweightChartsBundle> {
|
||||
if (this.lightweightChartsLib) {
|
||||
return this.lightweightChartsLib;
|
||||
}
|
||||
|
||||
if (this.apexChartsLoadingPromise) {
|
||||
return this.apexChartsLoadingPromise;
|
||||
if (this.lightweightChartsLoadingPromise) {
|
||||
return this.lightweightChartsLoadingPromise;
|
||||
}
|
||||
|
||||
this.apexChartsLoadingPromise = (async () => {
|
||||
const url = `${CDN_BASE}/apexcharts@${CDN_VERSIONS.apexcharts}/+esm`;
|
||||
this.lightweightChartsLoadingPromise = (async () => {
|
||||
const url = `${CDN_BASE}/lightweight-charts@${CDN_VERSIONS.lightweightCharts}/+esm`;
|
||||
const module = await import(/* @vite-ignore */ url);
|
||||
|
||||
this.apexChartsLib = module.default;
|
||||
return this.apexChartsLib!;
|
||||
this.lightweightChartsLib = {
|
||||
createChart: module.createChart,
|
||||
AreaSeries: module.AreaSeries,
|
||||
LineSeries: module.LineSeries,
|
||||
ColorType: module.ColorType,
|
||||
LineType: module.LineType,
|
||||
CrosshairMode: module.CrosshairMode,
|
||||
};
|
||||
return this.lightweightChartsLib;
|
||||
})();
|
||||
|
||||
return this.apexChartsLoadingPromise;
|
||||
return this.lightweightChartsLoadingPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -316,7 +354,7 @@ body > div[style*="top: -50000px"][style*="width: 50000px"] {
|
||||
this.loadXtermFitAddon(),
|
||||
this.loadXtermSearchAddon(),
|
||||
this.loadHighlightJs(),
|
||||
this.loadApexCharts(),
|
||||
this.loadLightweightCharts(),
|
||||
this.loadTiptap(),
|
||||
]);
|
||||
}
|
||||
@@ -324,7 +362,7 @@ body > div[style*="top: -50000px"][style*="width: 50000px"] {
|
||||
/**
|
||||
* Check if a specific library is already loaded
|
||||
*/
|
||||
public isLoaded(library: 'xterm' | 'xtermFitAddon' | 'xtermSearchAddon' | 'highlightJs' | 'apexCharts' | 'tiptap'): boolean {
|
||||
public isLoaded(library: 'xterm' | 'xtermFitAddon' | 'xtermSearchAddon' | 'highlightJs' | 'lightweightCharts' | 'tiptap'): boolean {
|
||||
switch (library) {
|
||||
case 'xterm':
|
||||
return this.xtermLib !== null;
|
||||
@@ -334,8 +372,8 @@ body > div[style*="top: -50000px"][style*="width: 50000px"] {
|
||||
return this.xtermSearchAddonLib !== null;
|
||||
case 'highlightJs':
|
||||
return this.highlightJsLib !== null;
|
||||
case 'apexCharts':
|
||||
return this.apexChartsLib !== null;
|
||||
case 'lightweightCharts':
|
||||
return this.lightweightChartsLib !== null;
|
||||
case 'tiptap':
|
||||
return this.tiptapLib !== null;
|
||||
default:
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export { DeesServiceLibLoader } from './DeesServiceLibLoader.js';
|
||||
export type { IXtermBundle, IXtermFitAddonBundle, IXtermSearchAddonBundle, IXtermSearchAddon, ITiptapBundle } from './DeesServiceLibLoader.js';
|
||||
export type { IXtermBundle, IXtermFitAddonBundle, IXtermSearchAddonBundle, IXtermSearchAddon, ITiptapBundle, ILightweightChartsBundle } from './DeesServiceLibLoader.js';
|
||||
export { CDN_BASE, CDN_VERSIONS } from './versions.js';
|
||||
|
||||
@@ -7,7 +7,7 @@ export const CDN_VERSIONS = {
|
||||
xtermAddonFit: '0.8.0',
|
||||
xtermAddonSearch: '0.13.0',
|
||||
highlightJs: '11.11.1',
|
||||
apexcharts: '5.10.4',
|
||||
lightweightCharts: '5.1.0',
|
||||
tiptap: '2.27.2',
|
||||
fontawesome: '7.2.0',
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user