orbital-ds 0.44.1 → 0.50.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.
- package/AGENTS.md +42 -10
- package/CHANGELOG.md +489 -0
- package/README.md +2 -2
- package/components.manifest.json +590 -83
- package/dist/hooks/use-ds-messages.d.ts +54 -0
- package/dist/hooks/use-esc-close-stack.d.ts +3 -0
- package/dist/hooks/use-esc-close-stack.js +38 -0
- package/dist/hooks/use-simulated-progress.d.ts +11 -0
- package/dist/hooks/use-simulated-progress.js +30 -0
- package/dist/lib/brand-allowlist.d.ts +3 -0
- package/dist/lib/brand-allowlist.js +719 -0
- package/dist/lib/brand-runtime.d.ts +52 -0
- package/dist/lib/brand-runtime.js +85 -0
- package/dist/lib/echarts-presets.d.ts +81 -1
- package/dist/lib/echarts-presets.js +152 -1
- package/dist/lib/echarts-setup.js +2 -0
- package/dist/lib/i18n.d.ts +54 -0
- package/dist/lib/i18n.js +165 -3
- package/dist/lib/locales/de.js +55 -1
- package/dist/lib/locales/fr.js +55 -1
- package/dist/lib/locales/he.js +55 -1
- package/dist/lib/locales/it.js +55 -1
- package/dist/styles.css +44 -0
- package/dist/themes/tactile.css +1 -6
- package/dist/themes/tactile.scoped.css +1 -6
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/api-key-list.d.ts +40 -0
- package/dist/ui/api-key-list.js +89 -0
- package/dist/ui/attachment.d.ts +3 -3
- package/dist/ui/audit-log.d.ts +53 -0
- package/dist/ui/audit-log.js +102 -0
- package/dist/ui/banner.d.ts +1 -1
- package/dist/ui/bubble.d.ts +1 -1
- package/dist/ui/button-group.d.ts +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/chart-card.d.ts +0 -1
- package/dist/ui/context-menu.js +2 -2
- package/dist/ui/cta-banner.d.ts +30 -0
- package/dist/ui/cta-banner.js +63 -0
- package/dist/ui/detail-panel.d.ts +3 -1
- package/dist/ui/detail-panel.js +2 -2
- package/dist/ui/faq.d.ts +34 -0
- package/dist/ui/faq.js +25 -0
- package/dist/ui/feature-grid.d.ts +40 -0
- package/dist/ui/feature-grid.js +40 -0
- package/dist/ui/field.d.ts +1 -1
- package/dist/ui/input-group.d.ts +1 -1
- package/dist/ui/item.d.ts +3 -3
- package/dist/ui/landing-section.d.ts +34 -0
- package/dist/ui/landing-section.js +59 -0
- package/dist/ui/marker.d.ts +1 -1
- package/dist/ui/member-list.d.ts +43 -0
- package/dist/ui/member-list.js +107 -0
- package/dist/ui/onboarding-checklist.d.ts +38 -0
- package/dist/ui/onboarding-checklist.js +132 -0
- package/dist/ui/panel.d.ts +2 -2
- package/dist/ui/permission-matrix.d.ts +35 -0
- package/dist/ui/permission-matrix.js +89 -0
- package/dist/ui/plan-summary.d.ts +59 -0
- package/dist/ui/plan-summary.js +92 -0
- package/dist/ui/popover.d.ts +1 -1
- package/dist/ui/pricing-table.d.ts +29 -0
- package/dist/ui/pricing-table.js +86 -0
- package/dist/ui/sheet.d.ts +2 -2
- package/dist/ui/sheet.js +1 -1
- package/dist/ui/sidebar.d.ts +1 -1
- package/dist/ui/sparkline.d.ts +1 -1
- package/dist/ui/status-badge.d.ts +2 -2
- package/dist/ui/tabs.d.ts +1 -1
- package/dist/ui/testimonial.d.ts +37 -0
- package/dist/ui/testimonial.js +61 -0
- package/dist/ui/toggle.d.ts +1 -1
- package/dist/ui/upgrade-prompt.d.ts +24 -0
- package/dist/ui/upgrade-prompt.js +85 -0
- package/dist/ui/workspace-switcher.d.ts +28 -0
- package/dist/ui/workspace-switcher.js +92 -0
- package/docs/GRAFICOS.md +1 -1
- package/docs/designer/patrones.md +36 -3
- package/manifest/actions.json +1 -1
- package/manifest/agents.json +1 -1
- package/manifest/ai.json +1 -1
- package/manifest/auth.json +1 -1
- package/manifest/chat.json +1 -1
- package/manifest/content.json +496 -1
- package/manifest/data.json +498 -103
- package/manifest/feedback.json +234 -47
- package/manifest/forms.json +1 -1
- package/manifest/motion.json +3 -3
- package/manifest/navigation.json +104 -3
- package/manifest/overlays.json +15 -12
- package/package.json +6 -18
- package/scripts/cli.mjs +82 -5
- package/scripts/doctor.mjs +32 -4
- package/scripts/eslint-plugin.mjs +32 -0
- package/scripts/manifest.mjs +20 -0
- package/scripts/skill.mjs +85 -0
- package/scripts/upgrade.mjs +126 -0
- package/skill/SKILL.md +5 -2
- package/dist/ui/chart.d.ts +0 -65
- package/dist/ui/chart.js +0 -254
- package/dist/ui/sonner.d.ts +0 -6
- package/dist/ui/sonner.js +0 -60
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Tokens de una piel: nombre con o sin `--` → valor CSS. */
|
|
2
|
+
type BrandTokenMap = Record<string, string>;
|
|
3
|
+
/** Marca con las dos pieles. Un objeto plano equivale a `{ light }`. */
|
|
4
|
+
type BrandSkins = {
|
|
5
|
+
light?: BrandTokenMap;
|
|
6
|
+
dark?: BrandTokenMap;
|
|
7
|
+
};
|
|
8
|
+
type BrandSkinName = "light" | "dark";
|
|
9
|
+
type BrandIssueCode = "unknown-token" | "unsafe-value" | "empty-value" | "contrast" | "contrast-unchecked";
|
|
10
|
+
type BrandIssue = {
|
|
11
|
+
skin: BrandSkinName;
|
|
12
|
+
/** Nombre sin `--` (en un par de contraste, el del texto). */
|
|
13
|
+
token: string;
|
|
14
|
+
code: BrandIssueCode;
|
|
15
|
+
message: string;
|
|
16
|
+
ratio?: number;
|
|
17
|
+
min?: number;
|
|
18
|
+
};
|
|
19
|
+
type BrandValidationOptions = {
|
|
20
|
+
/** Colores ya resueltos del tema activo por piel (background, foreground, card…), para medir el contraste. */
|
|
21
|
+
base?: {
|
|
22
|
+
light?: BrandTokenMap;
|
|
23
|
+
dark?: BrandTokenMap;
|
|
24
|
+
};
|
|
25
|
+
/** Longitud máxima de un valor (256 por defecto). */
|
|
26
|
+
maxValueLength?: number;
|
|
27
|
+
};
|
|
28
|
+
type BrandValidation = {
|
|
29
|
+
ok: boolean;
|
|
30
|
+
/** Solo los tokens válidos, con su `--`. */
|
|
31
|
+
light: Record<string, string>;
|
|
32
|
+
dark: Record<string, string>;
|
|
33
|
+
errors: BrandIssue[];
|
|
34
|
+
warnings: BrandIssue[];
|
|
35
|
+
};
|
|
36
|
+
/** Pares de contraste que se miden si la marca toca alguno de sus dos miembros: [texto, fondo, mínimo]. */
|
|
37
|
+
declare const BRAND_CONTRAST_PAIRS: ReadonlyArray<readonly [string, string, number]>;
|
|
38
|
+
/** Valida una marca que viene de datos: nombres públicos, valores seguros y contraste AA. */
|
|
39
|
+
declare function validateBrandTokens(input: BrandTokenMap | BrandSkins | null | undefined, options?: BrandValidationOptions): BrandValidation;
|
|
40
|
+
type BrandCssOptions = {
|
|
41
|
+
/** Selector de la piel clara. Por defecto `:root:root`, que gana al tema sea cual sea el orden de las hojas. */
|
|
42
|
+
selector?: string;
|
|
43
|
+
/** Selector de la piel oscura. Por defecto el modo `.dark` de orbital-ds, en <html> o en un contenedor. */
|
|
44
|
+
darkSelector?: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* CSS de una marca YA validada. Lanza si la validación tiene errores: así una marca rota nunca llega a la página.
|
|
48
|
+
* Devuelve "" si no hay nada que aplicar.
|
|
49
|
+
*/
|
|
50
|
+
declare function brandTokensToCss(brand: BrandValidation, { selector, darkSelector }?: BrandCssOptions): string;
|
|
51
|
+
|
|
52
|
+
export { BRAND_CONTRAST_PAIRS, type BrandCssOptions, type BrandIssue, type BrandIssueCode, type BrandSkinName, type BrandSkins, type BrandTokenMap, type BrandValidation, type BrandValidationOptions, brandTokensToCss, validateBrandTokens };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { contrastRatio, parseColor } from "../../scripts/brand-core.mjs";
|
|
2
|
+
import { BRAND_PUBLIC_TOKENS } from "./brand-allowlist.js";
|
|
3
|
+
const BRAND_CONTRAST_PAIRS = [
|
|
4
|
+
["foreground", "background", 4.5],
|
|
5
|
+
["card-foreground", "card", 4.5],
|
|
6
|
+
["popover-foreground", "popover", 4.5],
|
|
7
|
+
["primary-foreground", "primary", 4.5],
|
|
8
|
+
["secondary-foreground", "secondary", 4.5],
|
|
9
|
+
["accent-foreground", "accent", 4.5],
|
|
10
|
+
["sidebar-foreground", "sidebar", 4.5],
|
|
11
|
+
["sidebar-primary-foreground", "sidebar-primary", 4.5],
|
|
12
|
+
["link", "background", 4.5],
|
|
13
|
+
["link-hover", "background", 4.5],
|
|
14
|
+
["ring", "background", 3]
|
|
15
|
+
];
|
|
16
|
+
const UNSAFE = /[;{}<>\\]|\/\*|\*\/|@|!|url\s*\(|expression\s*\(|javascript:|[\u0000-\u001f\u007f]/i;
|
|
17
|
+
function normalizeName(raw) {
|
|
18
|
+
return raw.trim().replace(/^--/, "");
|
|
19
|
+
}
|
|
20
|
+
function isSkins(input) {
|
|
21
|
+
const keys = Object.keys(input);
|
|
22
|
+
return keys.length > 0 && keys.every((k) => k === "light" || k === "dark") && keys.every((k) => typeof input[k] === "object");
|
|
23
|
+
}
|
|
24
|
+
function validateBrandTokens(input, options = {}) {
|
|
25
|
+
const { base = {}, maxValueLength = 256 } = options;
|
|
26
|
+
const skins = input == null ? {} : isSkins(input) ? input : { light: input };
|
|
27
|
+
const result = { ok: true, light: {}, dark: {}, errors: [], warnings: [] };
|
|
28
|
+
for (const skin of ["light", "dark"]) {
|
|
29
|
+
const raw = skins[skin] ?? {};
|
|
30
|
+
const clean = {};
|
|
31
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
32
|
+
const token = normalizeName(key);
|
|
33
|
+
const v = typeof value === "string" ? value.trim() : "";
|
|
34
|
+
if (!BRAND_PUBLIC_TOKENS.has(token)) {
|
|
35
|
+
result.errors.push({ skin, token, code: "unknown-token", message: `--${token} is not a public orbital-ds token` });
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (v === "") {
|
|
39
|
+
result.errors.push({ skin, token, code: "empty-value", message: `--${token} has an empty value` });
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (v.length > maxValueLength || UNSAFE.test(v)) {
|
|
43
|
+
result.errors.push({ skin, token, code: "unsafe-value", message: `--${token} has a value that is not a single safe CSS value` });
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
clean[token] = v;
|
|
47
|
+
}
|
|
48
|
+
const themeBase = base[skin] ?? {};
|
|
49
|
+
const lookup = (name) => clean[name] ?? themeBase[name] ?? themeBase[`--${name}`];
|
|
50
|
+
for (const [fg, bg, min] of BRAND_CONTRAST_PAIRS) {
|
|
51
|
+
if (!(fg in clean) && !(bg in clean)) continue;
|
|
52
|
+
const fgValue = lookup(fg);
|
|
53
|
+
const bgValue = lookup(bg);
|
|
54
|
+
if (fgValue == null || bgValue == null) continue;
|
|
55
|
+
const a = parseColor(fgValue);
|
|
56
|
+
const b = parseColor(bgValue);
|
|
57
|
+
if (a == null || b == null) {
|
|
58
|
+
result.warnings.push({ skin, token: fg, code: "contrast-unchecked", message: `--${fg} on --${bg} could not be measured (use resolved colors)` });
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const ratio = Math.round(contrastRatio(a, b) * 100) / 100;
|
|
62
|
+
if (ratio < min) {
|
|
63
|
+
result.errors.push({ skin, token: fg, code: "contrast", ratio, min, message: `--${fg} on --${bg} is ${ratio}:1 (WCAG AA needs ${min}:1)` });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const prefixed = {};
|
|
67
|
+
for (const [k, v] of Object.entries(clean)) prefixed[`--${k}`] = v;
|
|
68
|
+
result[skin] = prefixed;
|
|
69
|
+
}
|
|
70
|
+
result.ok = result.errors.length === 0;
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
function brandTokensToCss(brand, { selector = ":root:root", darkSelector = ":root.dark, :root .dark" } = {}) {
|
|
74
|
+
if (!brand.ok) throw new Error(`orbital-ds: refusing to render a brand with ${brand.errors.length} error(s); check validateBrandTokens().errors`);
|
|
75
|
+
const block = (sel, tokens) => {
|
|
76
|
+
const body = Object.entries(tokens).filter(([k, v]) => BRAND_PUBLIC_TOKENS.has(k.replace(/^--/, "")) && !UNSAFE.test(v)).map(([k, v]) => `${k}:${v};`).join("");
|
|
77
|
+
return body ? `${sel}{${body}}` : "";
|
|
78
|
+
};
|
|
79
|
+
return [block(selector, brand.light), block(darkSelector, brand.dark)].filter(Boolean).join("\n");
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
BRAND_CONTRAST_PAIRS,
|
|
83
|
+
brandTokensToCss,
|
|
84
|
+
validateBrandTokens
|
|
85
|
+
};
|
|
@@ -223,5 +223,85 @@ interface BoxplotOptionInput extends CommonOptions {
|
|
|
223
223
|
}
|
|
224
224
|
/** Distribución de una medida por grupo (mediana, cuartiles y extremos). */
|
|
225
225
|
declare function boxplotOption(input: BoxplotOptionInput): EChartsCoreOption;
|
|
226
|
+
interface WaterfallStep {
|
|
227
|
+
name: string;
|
|
228
|
+
/** Variación con signo: positiva suma (altas, expansión) y negativa resta (bajas, contracción). */
|
|
229
|
+
value: number;
|
|
230
|
+
}
|
|
231
|
+
interface WaterfallOptionInput extends CommonOptions {
|
|
232
|
+
/** Barra inicial con el valor de partida (MRR al empezar el mes). Opcional. */
|
|
233
|
+
start?: {
|
|
234
|
+
name: string;
|
|
235
|
+
value: number;
|
|
236
|
+
};
|
|
237
|
+
steps: WaterfallStep[];
|
|
238
|
+
/** Barra final con el total acumulado (su etiqueta). `false` = sin barra final. */
|
|
239
|
+
end?: string | false;
|
|
240
|
+
/** Nombres de las series (leyenda y tooltip), en el idioma de la app. */
|
|
241
|
+
increaseLabel: string;
|
|
242
|
+
decreaseLabel: string;
|
|
243
|
+
totalLabel: string;
|
|
244
|
+
showLabels?: boolean;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Cascada: cómo se pasa de un valor a otro sumando y restando (puente de MRR: nuevo, expansión,
|
|
248
|
+
* contracción, bajas). Pensada para acumulados que no bajan de cero.
|
|
249
|
+
*/
|
|
250
|
+
declare function waterfallOption(input: WaterfallOptionInput): EChartsCoreOption;
|
|
251
|
+
interface CohortOptionInput extends CommonOptions {
|
|
252
|
+
/** Cohortes (filas), p. ej. el mes de alta. */
|
|
253
|
+
cohorts: string[];
|
|
254
|
+
/** Periodos desde el alta (columnas): «Mes 0», «Mes 1»… */
|
|
255
|
+
periods: string[];
|
|
256
|
+
/** Retención por cohorte y periodo (0–100 por defecto); `null` = aún no ha llegado (triángulo). */
|
|
257
|
+
values: DsChartValue[][];
|
|
258
|
+
min?: number;
|
|
259
|
+
max?: number;
|
|
260
|
+
showLabels?: boolean;
|
|
261
|
+
showScale?: boolean;
|
|
262
|
+
}
|
|
263
|
+
/** Retención por cohortes: qué parte de cada grupo de altas sigue activa con el tiempo. */
|
|
264
|
+
declare function cohortOption(input: CohortOptionInput): EChartsCoreOption;
|
|
265
|
+
interface CalendarOptionInput extends CommonOptions {
|
|
266
|
+
/** Un valor por día: `[fecha ISO "2026-03-14", valor]`; `null` = sin dato. */
|
|
267
|
+
data: Array<[string, DsChartValue]>;
|
|
268
|
+
/** Año ("2026") o intervalo `["2026-01-01", "2026-06-30"]`. */
|
|
269
|
+
range: string | [string, string];
|
|
270
|
+
/** Idioma de los nombres de días y meses (Intl). Por defecto, inglés. */
|
|
271
|
+
locale?: string;
|
|
272
|
+
/** Primer día de la semana: 0 = domingo, 1 = lunes (por defecto). */
|
|
273
|
+
firstDay?: 0 | 1;
|
|
274
|
+
min?: number;
|
|
275
|
+
max?: number;
|
|
276
|
+
showScale?: boolean;
|
|
277
|
+
}
|
|
278
|
+
/** Actividad diaria en un calendario (uso, despliegues, incidencias por día). */
|
|
279
|
+
declare function calendarOption(input: CalendarOptionInput): EChartsCoreOption;
|
|
280
|
+
interface GraphNode {
|
|
281
|
+
id: string;
|
|
282
|
+
name?: string;
|
|
283
|
+
/** Peso del nodo (tamaño); sin él, todos iguales. */
|
|
284
|
+
value?: number;
|
|
285
|
+
/** Categoría (leyenda y color del tema), por nombre de `categories`. */
|
|
286
|
+
category?: string;
|
|
287
|
+
}
|
|
288
|
+
interface GraphLink {
|
|
289
|
+
source: string;
|
|
290
|
+
target: string;
|
|
291
|
+
value?: number;
|
|
292
|
+
}
|
|
293
|
+
interface GraphOptionInput extends CommonOptions {
|
|
294
|
+
nodes: GraphNode[];
|
|
295
|
+
links: GraphLink[];
|
|
296
|
+
/** Disposición: fuerzas (por defecto) o en círculo. */
|
|
297
|
+
layout?: "force" | "circular";
|
|
298
|
+
/** Categorías de nodo, en orden (cada una toma un color de la paleta del tema). */
|
|
299
|
+
categories?: string[];
|
|
300
|
+
/** Flechas en los enlaces (dependencias: quién llama a quién). */
|
|
301
|
+
directed?: boolean;
|
|
302
|
+
showLabels?: boolean;
|
|
303
|
+
}
|
|
304
|
+
/** Red de relaciones: dependencias entre servicios, integraciones o equipos. */
|
|
305
|
+
declare function graphOption(input: GraphOptionInput): EChartsCoreOption;
|
|
226
306
|
|
|
227
|
-
export { type BarOptionInput, type BoxplotOptionInput, type CandlestickOptionInput, type ComboOptionInput, type DsChartValue, type DsReference, type DsSeries, type DsValueFormatter, type FunnelOptionInput, type GaugeOptionInput, type HeatmapOptionInput, type HierarchyNode, type LineOptionInput, type PieOptionInput, type RadarOptionInput, type SankeyLink, type SankeyOptionInput, type ScatterOptionInput, type SunburstOptionInput, type TreemapOptionInput, barOption, boxplotOption, candlestickOption, comboOption, escapeHtml, funnelOption, gaugeOption, heatmapOption, lineOption, pieOption, radarOption, referenceArea, referenceLine, sankeyOption, scatterOption, sunburstOption, treemapOption };
|
|
307
|
+
export { type BarOptionInput, type BoxplotOptionInput, type CalendarOptionInput, type CandlestickOptionInput, type CohortOptionInput, type ComboOptionInput, type DsChartValue, type DsReference, type DsSeries, type DsValueFormatter, type FunnelOptionInput, type GaugeOptionInput, type GraphLink, type GraphNode, type GraphOptionInput, type HeatmapOptionInput, type HierarchyNode, type LineOptionInput, type PieOptionInput, type RadarOptionInput, type SankeyLink, type SankeyOptionInput, type ScatterOptionInput, type SunburstOptionInput, type TreemapOptionInput, type WaterfallOptionInput, type WaterfallStep, barOption, boxplotOption, calendarOption, candlestickOption, cohortOption, comboOption, escapeHtml, funnelOption, gaugeOption, graphOption, heatmapOption, lineOption, pieOption, radarOption, referenceArea, referenceLine, sankeyOption, scatterOption, sunburstOption, treemapOption, waterfallOption };
|
|
@@ -427,14 +427,164 @@ function boxplotOption(input) {
|
|
|
427
427
|
input.extend
|
|
428
428
|
);
|
|
429
429
|
}
|
|
430
|
+
function waterfallOption(input) {
|
|
431
|
+
const categories = [];
|
|
432
|
+
const base = [];
|
|
433
|
+
const inc = [];
|
|
434
|
+
const dec = [];
|
|
435
|
+
const total = [];
|
|
436
|
+
let running = 0;
|
|
437
|
+
const push = (name, b, i, d, t) => {
|
|
438
|
+
categories.push(name);
|
|
439
|
+
base.push(b);
|
|
440
|
+
inc.push(i);
|
|
441
|
+
dec.push(d);
|
|
442
|
+
total.push(t);
|
|
443
|
+
};
|
|
444
|
+
if (input.start) {
|
|
445
|
+
running = input.start.value;
|
|
446
|
+
push(input.start.name, "-", "-", "-", running);
|
|
447
|
+
}
|
|
448
|
+
for (const s of input.steps) {
|
|
449
|
+
if (s.value >= 0) {
|
|
450
|
+
push(s.name, running, s.value, "-", "-");
|
|
451
|
+
running += s.value;
|
|
452
|
+
} else {
|
|
453
|
+
running += s.value;
|
|
454
|
+
push(s.name, running, "-", -s.value, "-");
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
if (input.end !== false) push(input.end ?? input.totalLabel, "-", "-", "-", running);
|
|
458
|
+
const fmt = input.valueFormatter;
|
|
459
|
+
const label = (sign) => input.showLabels ? {
|
|
460
|
+
label: {
|
|
461
|
+
show: true,
|
|
462
|
+
position: "top",
|
|
463
|
+
formatter: (p) => typeof p.value === "number" ? `${sign}${fmt ? fmt(p.value) : p.value}` : ""
|
|
464
|
+
}
|
|
465
|
+
} : {};
|
|
466
|
+
const bar = (name, data, sign) => ({ type: "bar", name, stack: "waterfall", data, emphasis: { focus: "series" }, ...label(sign) });
|
|
467
|
+
return finish(
|
|
468
|
+
{
|
|
469
|
+
tooltip: tooltip("item", fmt),
|
|
470
|
+
legend: { ...legend(input.legend, 3), data: [input.increaseLabel, input.decreaseLabel, input.totalLabel] },
|
|
471
|
+
xAxis: { type: "category", data: categories },
|
|
472
|
+
yAxis: valueAxis(fmt),
|
|
473
|
+
series: [
|
|
474
|
+
// Base invisible que eleva cada tramo hasta el acumulado anterior.
|
|
475
|
+
{ type: "bar", name: "base", stack: "waterfall", data: base, silent: true, itemStyle: { color: "transparent", borderColor: "transparent" }, emphasis: { disabled: true }, tooltip: { show: false } },
|
|
476
|
+
bar(input.increaseLabel, inc, "+"),
|
|
477
|
+
bar(input.decreaseLabel, dec, "\u2212"),
|
|
478
|
+
bar(input.totalLabel, total, "")
|
|
479
|
+
]
|
|
480
|
+
},
|
|
481
|
+
input.extend
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
function cohortOption(input) {
|
|
485
|
+
return heatmapOption({
|
|
486
|
+
xCategories: input.periods,
|
|
487
|
+
yCategories: input.cohorts,
|
|
488
|
+
values: input.values,
|
|
489
|
+
min: input.min ?? 0,
|
|
490
|
+
max: input.max ?? 100,
|
|
491
|
+
showLabels: input.showLabels ?? true,
|
|
492
|
+
showScale: input.showScale ?? false,
|
|
493
|
+
valueFormatter: input.valueFormatter,
|
|
494
|
+
extend: input.extend
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
function calendarOption(input) {
|
|
498
|
+
const locale = input.locale ?? "en";
|
|
499
|
+
const day = new Intl.DateTimeFormat(locale, { weekday: "narrow", timeZone: "UTC" });
|
|
500
|
+
const month = new Intl.DateTimeFormat(locale, { month: "short", timeZone: "UTC" });
|
|
501
|
+
const days = Array.from({ length: 7 }, (_, i) => day.format(Date.UTC(2023, 0, 1 + i)));
|
|
502
|
+
const months = Array.from({ length: 12 }, (_, i) => month.format(Date.UTC(2023, i, 1)));
|
|
503
|
+
const nums = input.data.map(([, v]) => v).filter((v) => v != null);
|
|
504
|
+
const showScale = input.showScale ?? true;
|
|
505
|
+
const fmt = input.valueFormatter;
|
|
506
|
+
return finish(
|
|
507
|
+
{
|
|
508
|
+
tooltip: tooltip("item", void 0, {
|
|
509
|
+
formatter: (p) => {
|
|
510
|
+
const [date, v] = p.value;
|
|
511
|
+
return `${escapeHtml(date)}: ${escapeHtml(typeof v === "number" ? fmt ? fmt(v) : v : "\u2013")}`;
|
|
512
|
+
}
|
|
513
|
+
}),
|
|
514
|
+
visualMap: {
|
|
515
|
+
show: showScale,
|
|
516
|
+
min: input.min ?? 0,
|
|
517
|
+
max: input.max ?? (nums.length ? Math.max(...nums) : 1),
|
|
518
|
+
calculable: false,
|
|
519
|
+
orient: "horizontal",
|
|
520
|
+
left: "center",
|
|
521
|
+
bottom: 0,
|
|
522
|
+
...fmt ? { formatter: (v) => fmt(v) } : {}
|
|
523
|
+
},
|
|
524
|
+
calendar: {
|
|
525
|
+
range: input.range,
|
|
526
|
+
top: 24,
|
|
527
|
+
left: 32,
|
|
528
|
+
right: 8,
|
|
529
|
+
bottom: showScale ? 48 : 8,
|
|
530
|
+
cellSize: ["auto", "auto"],
|
|
531
|
+
splitLine: { show: false },
|
|
532
|
+
yearLabel: { show: false },
|
|
533
|
+
dayLabel: { firstDay: input.firstDay ?? 1, nameMap: days },
|
|
534
|
+
monthLabel: { nameMap: months }
|
|
535
|
+
},
|
|
536
|
+
series: [{ type: "heatmap", coordinateSystem: "calendar", data: input.data.map(([d, v]) => [d, v ?? "-"]) }]
|
|
537
|
+
},
|
|
538
|
+
input.extend
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
function graphOption(input) {
|
|
542
|
+
const cats = input.categories ?? [];
|
|
543
|
+
const values = input.nodes.map((n) => n.value).filter((v) => v != null);
|
|
544
|
+
const maxV = values.length ? Math.max(...values) : 0;
|
|
545
|
+
const size = (v) => v == null || !maxV ? 16 : 10 + 24 * Math.sqrt(v / maxV);
|
|
546
|
+
return finish(
|
|
547
|
+
{
|
|
548
|
+
tooltip: tooltip("item", input.valueFormatter),
|
|
549
|
+
legend: { ...legend(input.legend, cats.length), data: cats },
|
|
550
|
+
series: [
|
|
551
|
+
{
|
|
552
|
+
type: "graph",
|
|
553
|
+
layout: input.layout ?? "force",
|
|
554
|
+
roam: true,
|
|
555
|
+
draggable: (input.layout ?? "force") === "force",
|
|
556
|
+
label: { show: input.showLabels ?? true, position: "right" },
|
|
557
|
+
...input.directed ? { edgeSymbol: ["none", "arrow"], edgeSymbolSize: 8 } : {},
|
|
558
|
+
data: input.nodes.map((n) => ({
|
|
559
|
+
id: n.id,
|
|
560
|
+
name: n.name ?? n.id,
|
|
561
|
+
value: n.value,
|
|
562
|
+
symbolSize: size(n.value),
|
|
563
|
+
...n.category && cats.includes(n.category) ? { category: cats.indexOf(n.category) } : {}
|
|
564
|
+
})),
|
|
565
|
+
links: input.links,
|
|
566
|
+
categories: cats.map((name) => ({ name })),
|
|
567
|
+
force: { repulsion: 160, edgeLength: [48, 120] },
|
|
568
|
+
circular: { rotateLabel: true },
|
|
569
|
+
lineStyle: { curveness: input.layout === "circular" ? 0.2 : 0 },
|
|
570
|
+
emphasis: { focus: "adjacency" }
|
|
571
|
+
}
|
|
572
|
+
]
|
|
573
|
+
},
|
|
574
|
+
input.extend
|
|
575
|
+
);
|
|
576
|
+
}
|
|
430
577
|
export {
|
|
431
578
|
barOption,
|
|
432
579
|
boxplotOption,
|
|
580
|
+
calendarOption,
|
|
433
581
|
candlestickOption,
|
|
582
|
+
cohortOption,
|
|
434
583
|
comboOption,
|
|
435
584
|
escapeHtml,
|
|
436
585
|
funnelOption,
|
|
437
586
|
gaugeOption,
|
|
587
|
+
graphOption,
|
|
438
588
|
heatmapOption,
|
|
439
589
|
lineOption,
|
|
440
590
|
pieOption,
|
|
@@ -444,5 +594,6 @@ export {
|
|
|
444
594
|
sankeyOption,
|
|
445
595
|
scatterOption,
|
|
446
596
|
sunburstOption,
|
|
447
|
-
treemapOption
|
|
597
|
+
treemapOption,
|
|
598
|
+
waterfallOption
|
|
448
599
|
};
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
} from "echarts/charts";
|
|
22
22
|
import {
|
|
23
23
|
AriaComponent,
|
|
24
|
+
CalendarComponent,
|
|
24
25
|
DatasetComponent,
|
|
25
26
|
DataZoomComponent,
|
|
26
27
|
GraphicComponent,
|
|
@@ -64,6 +65,7 @@ function dsEcharts() {
|
|
|
64
65
|
SankeyChart,
|
|
65
66
|
ScatterChart,
|
|
66
67
|
AriaComponent,
|
|
68
|
+
CalendarComponent,
|
|
67
69
|
DatasetComponent,
|
|
68
70
|
DataZoomComponent,
|
|
69
71
|
GraphicComponent,
|
package/dist/lib/i18n.d.ts
CHANGED
|
@@ -158,6 +158,7 @@ declare const en: {
|
|
|
158
158
|
composerRemoveFile: string;
|
|
159
159
|
tagRemove: string;
|
|
160
160
|
tagAdd: string;
|
|
161
|
+
planNotIncluded: string;
|
|
161
162
|
composerCounter: string;
|
|
162
163
|
composerDrop: string;
|
|
163
164
|
composerUploading: string;
|
|
@@ -533,6 +534,59 @@ declare const en: {
|
|
|
533
534
|
authErrorPasskeyFailed: string;
|
|
534
535
|
authErrorNetwork: string;
|
|
535
536
|
authErrorUnknown: string;
|
|
537
|
+
onboardingProgress: string;
|
|
538
|
+
onboardingComplete: string;
|
|
539
|
+
onboardingDismiss: string;
|
|
540
|
+
onboardingStepDone: string;
|
|
541
|
+
onboardingStepTodo: string;
|
|
542
|
+
onboardingOptional: string;
|
|
543
|
+
onboardingShowCompleted: string;
|
|
544
|
+
onboardingHideCompleted: string;
|
|
545
|
+
memberYou: string;
|
|
546
|
+
memberInvited: string;
|
|
547
|
+
memberSuspended: string;
|
|
548
|
+
memberRoleOf: string;
|
|
549
|
+
memberRemove: string;
|
|
550
|
+
memberResendInvite: string;
|
|
551
|
+
memberCancelInvite: string;
|
|
552
|
+
memberLastActive: string;
|
|
553
|
+
memberPendingInvites: string;
|
|
554
|
+
apiKeyCreated: string;
|
|
555
|
+
apiKeyLastUsed: string;
|
|
556
|
+
apiKeyNeverUsed: string;
|
|
557
|
+
apiKeyExpires: string;
|
|
558
|
+
apiKeyNoExpiry: string;
|
|
559
|
+
apiKeyExpired: string;
|
|
560
|
+
apiKeyRevoked: string;
|
|
561
|
+
apiKeyPaused: string;
|
|
562
|
+
apiKeyHealthy: string;
|
|
563
|
+
apiKeyFailing: string;
|
|
564
|
+
apiKeyRevoke: string;
|
|
565
|
+
apiKeyRoll: string;
|
|
566
|
+
apiKeyRevealTitle: string;
|
|
567
|
+
apiKeyRevealHint: string;
|
|
568
|
+
auditToday: string;
|
|
569
|
+
auditYesterday: string;
|
|
570
|
+
auditSystem: string;
|
|
571
|
+
planActive: string;
|
|
572
|
+
planTrialing: string;
|
|
573
|
+
planPastDue: string;
|
|
574
|
+
planCanceled: string;
|
|
575
|
+
planRenews: string;
|
|
576
|
+
planEnds: string;
|
|
577
|
+
planTrialEnds: string;
|
|
578
|
+
planUsage: string;
|
|
579
|
+
upgradeLocked: string;
|
|
580
|
+
upgradeRequires: string;
|
|
581
|
+
workspaceSwitch: string;
|
|
582
|
+
workspaceList: string;
|
|
583
|
+
workspaceCreate: string;
|
|
584
|
+
workspaceCurrent: string;
|
|
585
|
+
permissionHeader: string;
|
|
586
|
+
permissionAllowed: string;
|
|
587
|
+
permissionDenied: string;
|
|
588
|
+
permissionToggle: string;
|
|
589
|
+
permissionLocked: string;
|
|
536
590
|
};
|
|
537
591
|
type DsMessages = typeof en;
|
|
538
592
|
type DsMessageKey = keyof DsMessages;
|