@aintela/bi 0.2.3 → 0.2.5

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.
Files changed (40) hide show
  1. package/dist/{GridLayout-1gWuIKeZ.js → GridLayout-BQcuPzng.js} +2 -2
  2. package/dist/GridLayout-BQcuPzng.js.map +1 -0
  3. package/dist/{ScriptDashboardViewerVertical-Rr_4adpH.js → ScriptDashboardViewerVertical-B8Y5LoE4.js} +42 -26
  4. package/dist/{ScriptDashboardViewerVertical-Rr_4adpH.js.map → ScriptDashboardViewerVertical-B8Y5LoE4.js.map} +1 -1
  5. package/dist/{biModuleSurface-BdJK7sSL.js → biModuleSurface-zEeRrln5.js} +6 -6
  6. package/dist/{biModuleSurface-BdJK7sSL.js.map → biModuleSurface-zEeRrln5.js.map} +1 -1
  7. package/dist/composer/index.d.ts +1 -1
  8. package/dist/composer/models/utils.d.ts +11 -0
  9. package/dist/composer.js +33 -32
  10. package/dist/grid.js +2 -2
  11. package/dist/{index-DChE_l-p.js → index-C38e4aIE.js} +2 -2
  12. package/dist/index-C38e4aIE.js.map +1 -0
  13. package/dist/{index-BzUugG0A.js → index-D6-YxBjl.js} +2 -2
  14. package/dist/{index-BzUugG0A.js.map → index-D6-YxBjl.js.map} +1 -1
  15. package/dist/{index-C4_VSDeU.js → index-GTSBsgzP.js} +875 -857
  16. package/dist/index-GTSBsgzP.js.map +1 -0
  17. package/dist/index-ZBNoVc5M.js +210 -0
  18. package/dist/index-ZBNoVc5M.js.map +1 -0
  19. package/dist/index-zN3LPF6u.js +97 -0
  20. package/dist/index-zN3LPF6u.js.map +1 -0
  21. package/dist/index.js +55 -54
  22. package/dist/inline/Chart.d.ts +0 -9
  23. package/dist/inline/Metric.d.ts +0 -2
  24. package/dist/inline/MetricGroup.d.ts +1 -1
  25. package/dist/inline.js +1 -1
  26. package/dist/runtime/version.d.ts +1 -1
  27. package/dist/runtime.js +7 -7
  28. package/dist/style.css +1 -1
  29. package/dist/theme.js +1 -1
  30. package/dist/{version-BTc4ElDG.js → version-oYqU5xJk.js} +6 -6
  31. package/dist/{version-BTc4ElDG.js.map → version-oYqU5xJk.js.map} +1 -1
  32. package/dist/viewer.js +1 -1
  33. package/package.json +1 -1
  34. package/dist/GridLayout-1gWuIKeZ.js.map +0 -1
  35. package/dist/index-BYc79sSy.js +0 -131
  36. package/dist/index-BYc79sSy.js.map +0 -1
  37. package/dist/index-C4_VSDeU.js.map +0 -1
  38. package/dist/index-D7Oo_dC-.js +0 -94
  39. package/dist/index-D7Oo_dC-.js.map +0 -1
  40. package/dist/index-DChE_l-p.js.map +0 -1
@@ -1,94 +0,0 @@
1
- var f = Object.defineProperty;
2
- var n = (t, i) => f(t, "name", { value: i, configurable: !0 });
3
- import { r as d, b as y, a as h, c as v, d as g, u as x, w as k } from "./createBiTheme-TyUv_UHM.js";
4
- import { jsx as P } from "react/jsx-runtime";
5
- import { useMemo as u, useEffect as m } from "react";
6
- import { useTheme as p, alpha as r } from "@mui/material/styles";
7
- function c(t) {
8
- const i = d(t), e = t.palette, o = typeof t.shape.borderRadius == "number" ? `${t.shape.borderRadius}px` : String(t.shape.borderRadius);
9
- return {
10
- "--bi-bg": e.background.default,
11
- "--bi-card-bg": e.background.paper,
12
- "--bi-card-border": e.divider,
13
- "--bi-card-border-strong": r(e.text.primary, 0.28),
14
- "--bi-text-1": e.text.primary,
15
- "--bi-text-2": e.text.secondary,
16
- "--bi-text-disabled": e.text.disabled,
17
- "--bi-grid-line": r(e.text.primary, 0.12),
18
- "--bi-hover": e.action.hover,
19
- "--bi-selected": e.action.selected,
20
- "--bi-overlay": r(e.text.primary, 0.08),
21
- "--bi-surface-1": r(e.text.primary, 0.03),
22
- "--bi-surface-2": r(e.text.primary, 0.06),
23
- "--bi-accent": e.primary.main,
24
- "--bi-accent-soft": r(e.primary.main, 0.12),
25
- "--bi-accent-border": r(e.primary.main, 0.3),
26
- "--bi-positive": i.positive,
27
- "--bi-positive-soft": r(i.positive, 0.15),
28
- "--bi-negative": i.negative,
29
- "--bi-negative-soft": r(i.negative, 0.15),
30
- "--bi-neutral": i.neutral,
31
- "--bi-neutral-soft": r(i.neutral, 0.15),
32
- "--bi-error": e.error.main,
33
- "--bi-error-soft": r(e.error.main, 0.08),
34
- // ── Composer / sketch pad (`composer.css`) ──
35
- "--bi-secondary": e.secondary.main,
36
- "--bi-secondary-soft": r(e.secondary.main, 0.16),
37
- "--bi-sketch-dash": r(e.text.primary, 0.35),
38
- "--bi-sketch-dash-faint": r(e.text.primary, 0.12),
39
- "--bi-sketch-selection": r(e.primary.main, 0.12),
40
- "--bi-scrim": r(e.common.black, 0.4),
41
- "--bi-highlight-outline": e.secondary.main,
42
- "--bi-highlight-glow": r(e.secondary.main, 0.35),
43
- "--bi-shadow": t.shadows[4],
44
- "--bi-shadow-strong": t.shadows[8],
45
- "--bi-radius": o,
46
- "--bi-radius-sm": `${Math.max(2, Math.round((typeof t.shape.borderRadius == "number" ? t.shape.borderRadius : 4) / 2))}px`,
47
- "--bi-font-family": t.typography.fontFamily ?? "inherit"
48
- };
49
- }
50
- n(c, "computeBiCssVars");
51
- const B = /* @__PURE__ */ n(({ children: t, className: i, style: e }) => {
52
- const o = p(), a = u(() => c(o), [o]);
53
- return m(() => {
54
- if (t !== void 0 || typeof document > "u") return;
55
- const s = document.documentElement;
56
- for (const [b, l] of Object.entries(a)) s.style.setProperty(b, l);
57
- return () => {
58
- for (const b of Object.keys(a)) s.style.removeProperty(b);
59
- };
60
- }, [a, t]), t === void 0 ? null : /* @__PURE__ */ P("div", { className: i, "data-bi-theme": o.palette.mode, style: { ...a, height: "100%", ...e }, children: t });
61
- }, "BiThemeBridge");
62
- function j(t) {
63
- const i = p(), e = u(() => c(i), [i]);
64
- return m(() => {
65
- const o = t ?? (typeof document < "u" ? document.documentElement : null);
66
- if (o) {
67
- for (const [a, s] of Object.entries(e)) o.style.setProperty(a, s);
68
- return () => {
69
- for (const a of Object.keys(e)) o.style.removeProperty(a);
70
- };
71
- }
72
- }, [e, t]), e;
73
- }
74
- n(j, "useBiCssVars");
75
- const S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
76
- __proto__: null,
77
- BiThemeBridge: B,
78
- biDarkPalette: y,
79
- biLightPalette: h,
80
- biSeriesColor: v,
81
- computeBiCssVars: c,
82
- createBiTheme: g,
83
- resolveBiPalette: d,
84
- useBiCssVars: j,
85
- useBiPalette: x,
86
- withBiPalette: k
87
- }, Symbol.toStringTag, { value: "Module" }));
88
- export {
89
- B,
90
- S as T,
91
- c,
92
- j as u
93
- };
94
- //# sourceMappingURL=index-D7Oo_dC-.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-D7Oo_dC-.js","sources":["../src/theme/BiThemeBridge.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from 'react';\nimport { alpha, useTheme } from '@mui/material/styles';\nimport type { Theme } from '@mui/material/styles';\nimport { resolveBiPalette } from './createBiTheme';\n\n/**\n * The CSS custom properties the package's stylesheets consume\n * (`GridLayout.css`, `inline.css`, `composer.css`). Every value is derived from the MUI theme —\n * the stylesheets themselves contain no colour.\n */\nexport function computeBiCssVars(theme: Theme): Record<string, string> {\n const bi = resolveBiPalette(theme);\n const p = theme.palette;\n const radius = typeof theme.shape.borderRadius === 'number' ? `${theme.shape.borderRadius}px` : String(theme.shape.borderRadius);\n return {\n '--bi-bg': p.background.default,\n '--bi-card-bg': p.background.paper,\n '--bi-card-border': p.divider,\n '--bi-card-border-strong': alpha(p.text.primary, 0.28),\n '--bi-text-1': p.text.primary,\n '--bi-text-2': p.text.secondary,\n '--bi-text-disabled': p.text.disabled,\n '--bi-grid-line': alpha(p.text.primary, 0.12),\n '--bi-hover': p.action.hover,\n '--bi-selected': p.action.selected,\n '--bi-overlay': alpha(p.text.primary, 0.08),\n '--bi-surface-1': alpha(p.text.primary, 0.03),\n '--bi-surface-2': alpha(p.text.primary, 0.06),\n '--bi-accent': p.primary.main,\n '--bi-accent-soft': alpha(p.primary.main, 0.12),\n '--bi-accent-border': alpha(p.primary.main, 0.3),\n '--bi-positive': bi.positive,\n '--bi-positive-soft': alpha(bi.positive, 0.15),\n '--bi-negative': bi.negative,\n '--bi-negative-soft': alpha(bi.negative, 0.15),\n '--bi-neutral': bi.neutral,\n '--bi-neutral-soft': alpha(bi.neutral, 0.15),\n '--bi-error': p.error.main,\n '--bi-error-soft': alpha(p.error.main, 0.08),\n // ── Composer / sketch pad (`composer.css`) ──\n '--bi-secondary': p.secondary.main,\n '--bi-secondary-soft': alpha(p.secondary.main, 0.16),\n '--bi-sketch-dash': alpha(p.text.primary, 0.35),\n '--bi-sketch-dash-faint': alpha(p.text.primary, 0.12),\n '--bi-sketch-selection': alpha(p.primary.main, 0.12),\n '--bi-scrim': alpha(p.common.black, 0.4),\n '--bi-highlight-outline': p.secondary.main,\n '--bi-highlight-glow': alpha(p.secondary.main, 0.35),\n '--bi-shadow': theme.shadows[4],\n '--bi-shadow-strong': theme.shadows[8],\n '--bi-radius': radius,\n '--bi-radius-sm': `${Math.max(2, Math.round((typeof theme.shape.borderRadius === 'number' ? theme.shape.borderRadius : 4) / 2))}px`,\n '--bi-font-family': theme.typography.fontFamily ?? 'inherit',\n };\n}\n\nexport interface BiThemeBridgeProps {\n /**\n * With children: renders a wrapper `div` carrying the variables as inline\n * style, so the theme applies to that subtree only (several themes may\n * coexist on one page). Without children: writes the variables onto\n * `document.documentElement` on mount and updates them when the theme\n * changes.\n */\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/**\n * Publishes the theme-derived CSS custom properties the package stylesheets\n * read. Mount it once inside your `<ThemeProvider>` (either around the BI\n * surface, or childless at the app root).\n */\nexport const BiThemeBridge: React.FC<BiThemeBridgeProps> = ({ children, className, style }) => {\n const theme = useTheme();\n const vars = useMemo(() => computeBiCssVars(theme), [theme]);\n\n useEffect(() => {\n if (children !== undefined) return;\n if (typeof document === 'undefined') return;\n const root = document.documentElement;\n for (const [k, v] of Object.entries(vars)) root.style.setProperty(k, v);\n return () => {\n for (const k of Object.keys(vars)) root.style.removeProperty(k);\n };\n }, [vars, children]);\n\n if (children === undefined) return null;\n return (\n <div className={className} data-bi-theme={theme.palette.mode} style={{ ...(vars as React.CSSProperties), height: '100%', ...style }}>\n {children}\n </div>\n );\n};\n\n/**\n * Hook form of the bridge: applies the variables to `target` (default:\n * `document.documentElement`) for as long as the calling component is mounted.\n */\nexport function useBiCssVars(target?: HTMLElement | null): Record<string, string> {\n const theme = useTheme();\n const vars = useMemo(() => computeBiCssVars(theme), [theme]);\n useEffect(() => {\n const el = target ?? (typeof document !== 'undefined' ? document.documentElement : null);\n if (!el) return;\n for (const [k, v] of Object.entries(vars)) el.style.setProperty(k, v);\n return () => {\n for (const k of Object.keys(vars)) el.style.removeProperty(k);\n };\n }, [vars, target]);\n return vars;\n}\n\nexport default BiThemeBridge;\n"],"names":["computeBiCssVars","theme","bi","resolveBiPalette","p","radius","alpha","__name","BiThemeBridge","children","className","style","useTheme","vars","useMemo","useEffect","root","k","v","useBiCssVars","target","el"],"mappings":";;;;;;AAUO,SAASA,EAAiBC,GAAsC;AACnE,QAAMC,IAAKC,EAAiBF,CAAK,GAC3BG,IAAIH,EAAM,SACVI,IAAS,OAAOJ,EAAM,MAAM,gBAAiB,WAAW,GAAGA,EAAM,MAAM,YAAY,OAAO,OAAOA,EAAM,MAAM,YAAY;AAC/H,SAAO;AAAA,IACH,WAAWG,EAAE,WAAW;AAAA,IACxB,gBAAgBA,EAAE,WAAW;AAAA,IAC7B,oBAAoBA,EAAE;AAAA,IACtB,2BAA2BE,EAAMF,EAAE,KAAK,SAAS,IAAI;AAAA,IACrD,eAAeA,EAAE,KAAK;AAAA,IACtB,eAAeA,EAAE,KAAK;AAAA,IACtB,sBAAsBA,EAAE,KAAK;AAAA,IAC7B,kBAAkBE,EAAMF,EAAE,KAAK,SAAS,IAAI;AAAA,IAC5C,cAAcA,EAAE,OAAO;AAAA,IACvB,iBAAiBA,EAAE,OAAO;AA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