@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.
- package/dist/{GridLayout-1gWuIKeZ.js → GridLayout-BQcuPzng.js} +2 -2
- package/dist/GridLayout-BQcuPzng.js.map +1 -0
- package/dist/{ScriptDashboardViewerVertical-Rr_4adpH.js → ScriptDashboardViewerVertical-B8Y5LoE4.js} +42 -26
- package/dist/{ScriptDashboardViewerVertical-Rr_4adpH.js.map → ScriptDashboardViewerVertical-B8Y5LoE4.js.map} +1 -1
- package/dist/{biModuleSurface-BdJK7sSL.js → biModuleSurface-zEeRrln5.js} +6 -6
- package/dist/{biModuleSurface-BdJK7sSL.js.map → biModuleSurface-zEeRrln5.js.map} +1 -1
- package/dist/composer/index.d.ts +1 -1
- package/dist/composer/models/utils.d.ts +11 -0
- package/dist/composer.js +33 -32
- package/dist/grid.js +2 -2
- package/dist/{index-DChE_l-p.js → index-C38e4aIE.js} +2 -2
- package/dist/index-C38e4aIE.js.map +1 -0
- package/dist/{index-BzUugG0A.js → index-D6-YxBjl.js} +2 -2
- package/dist/{index-BzUugG0A.js.map → index-D6-YxBjl.js.map} +1 -1
- package/dist/{index-C4_VSDeU.js → index-GTSBsgzP.js} +875 -857
- package/dist/index-GTSBsgzP.js.map +1 -0
- package/dist/index-ZBNoVc5M.js +210 -0
- package/dist/index-ZBNoVc5M.js.map +1 -0
- package/dist/index-zN3LPF6u.js +97 -0
- package/dist/index-zN3LPF6u.js.map +1 -0
- package/dist/index.js +55 -54
- package/dist/inline/Chart.d.ts +0 -9
- package/dist/inline/Metric.d.ts +0 -2
- package/dist/inline/MetricGroup.d.ts +1 -1
- package/dist/inline.js +1 -1
- package/dist/runtime/version.d.ts +1 -1
- package/dist/runtime.js +7 -7
- package/dist/style.css +1 -1
- package/dist/theme.js +1 -1
- package/dist/{version-BTc4ElDG.js → version-oYqU5xJk.js} +6 -6
- package/dist/{version-BTc4ElDG.js.map → version-oYqU5xJk.js.map} +1 -1
- package/dist/viewer.js +1 -1
- package/package.json +1 -1
- package/dist/GridLayout-1gWuIKeZ.js.map +0 -1
- package/dist/index-BYc79sSy.js +0 -131
- package/dist/index-BYc79sSy.js.map +0 -1
- package/dist/index-C4_VSDeU.js.map +0 -1
- package/dist/index-D7Oo_dC-.js +0 -94
- package/dist/index-D7Oo_dC-.js.map +0 -1
- package/dist/index-DChE_l-p.js.map +0 -1
|
@@ -6,6 +6,6 @@ export interface MetricGroupProps {
|
|
|
6
6
|
footNote?: string;
|
|
7
7
|
partial?: boolean;
|
|
8
8
|
}
|
|
9
|
-
/** A row of `Metric` tiles (`present_metric_group`). */
|
|
9
|
+
/** A row of `Metric` tiles (`present_metric_group`). Sem inline.css. */
|
|
10
10
|
export declare const MetricGroup: React.FC<MetricGroupProps>;
|
|
11
11
|
export default MetricGroup;
|
package/dist/inline.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* `AIntelA.Bi.Agents` version at handshake (the instruction files describe
|
|
4
4
|
* THIS React API). Kept in sync with package.json by `tests/runtime/version.test.ts`.
|
|
5
5
|
*/
|
|
6
|
-
export declare const BI_RUNTIME_VERSION = "0.2.
|
|
6
|
+
export declare const BI_RUNTIME_VERSION = "0.2.5";
|
package/dist/runtime.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { B as a, c as o, n as i, r, a as t } from "./version-
|
|
2
|
-
import { getBiModuleSurface as d } from "./biModuleSurface-
|
|
3
|
-
import { c as n, e as B, g as c, b as g, h, i as M, l as S, s as f } from "./ScriptDashboardViewerVertical-
|
|
4
|
-
import { L as p, U as
|
|
1
|
+
import { B as a, c as o, n as i, r, a as t } from "./version-oYqU5xJk.js";
|
|
2
|
+
import { getBiModuleSurface as d } from "./biModuleSurface-zEeRrln5.js";
|
|
3
|
+
import { c as n, e as B, g as c, b as g, h, i as M, l as S, s as f } from "./ScriptDashboardViewerVertical-B8Y5LoE4.js";
|
|
4
|
+
import { L as p, U as I, W as R, aF as V } from "./index-GTSBsgzP.js";
|
|
5
5
|
export {
|
|
6
6
|
a as BI_RUNTIME_VERSION,
|
|
7
7
|
p as SessionVisualizationsProvider,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
I as VISIBLE_THRESHOLD,
|
|
9
|
+
R as VisualizationFrame,
|
|
10
10
|
n as clearBundleCaches,
|
|
11
11
|
o as createBiUiTools,
|
|
12
12
|
B as evaluateDashboardBundle,
|
|
@@ -20,6 +20,6 @@ export {
|
|
|
20
20
|
r as registerBiModules,
|
|
21
21
|
t as resetBiModuleRegistration,
|
|
22
22
|
f as seedHostModules,
|
|
23
|
-
|
|
23
|
+
V as useSessionVisualizations
|
|
24
24
|
};
|
|
25
25
|
//# sourceMappingURL=runtime.js.map
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--grid-card-padding: 15px;--grid-card-padding-mobile: 10px;--grid-card-gap: 15px;--grid-card-gap-mobile: 12px}.grid-card,.grid-card-nohandle,.grid-card-naked{--kpi-accent: var(--bi-accent);--kpi-accent-light: var(--bi-text-2);--kpi-glow: var(--bi-accent-soft);--chart-accent: var(--bi-accent);--chart-accent-light: var(--bi-text-2);--chart-glow: var(--bi-accent-soft);--table-accent: var(--bi-accent);--table-accent-light: var(--bi-text-2);--table-glow: var(--bi-accent-soft);--iframe-accent: var(--bi-accent);--iframe-accent-light: var(--bi-text-2);--iframe-glow: var(--bi-accent-soft);--info-accent: var(--bi-accent);--info-accent-light: var(--bi-text-2);--info-glow: var(--bi-accent-soft);--info-color: var(--bi-text-2);--grid-card-accent: var(--bi-accent);--grid-card-accent-light: var(--bi-accent-border);--grid-card-accent-dark: var(--bi-accent-soft)}.grid-card,.grid-card-nohandle{position:relative;background-color:var(--bi-card-bg);border:1px solid var(--bi-card-border);color:var(--bi-text-1)}.grid-card:active{cursor:grabbing}.grid-card:hover:before{opacity:.6}.grid-card:after{content:"";position:absolute;bottom:4px;right:4px;width:12px;height:12px;border-right:2px solid var(--bi-card-border-strong);border-bottom:2px solid var(--bi-card-border-strong);border-bottom-right-radius:var(--bi-radius);opacity:.3;transition:opacity .2s ease;pointer-events:none}.grid-card:hover:after{opacity:1}.grid-card .react-resizable-handle{opacity:0;transition:opacity .2s ease}.grid-card:hover .react-resizable-handle{opacity:1}.react-grid-placeholder{background:var(--bi-overlay)!important;border:1px dashed var(--bi-card-border-strong)!important;border-radius:var(--bi-radius);opacity:1!important}.grid-card-with-header{padding:0}.grid-card-with-header .grid-card-header{flex-shrink:0}.grid-card-with-header .grid-card-content{flex:1;min-height:0;overflow:auto}.grid-card-header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px 6px;border-bottom:none;background:transparent}.grid-card-title{margin:0;font-weight:500;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--bi-text-2)}.grid-card-icon{display:none;align-items:center;justify-content:center;margin-left:12px;opacity:.7}.grid-card-icon .material-icons{font-size:20px}.grid-card-content{padding:5px 6px 3px;height:100%}.grid-card-content-naked{padding:0;height:100%}.grid-card-content>*{height:100%}.grid-card-content-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}.grid-card-kpi,.grid-card-chart,.grid-card-table,.grid-card-info,.grid-card-iframe{border:1px solid var(--bi-card-border);border-radius:var(--card-radius, 14px);transition:border-color .15s ease,box-shadow .15s ease}.grid-card-details{border:0 solid transparent;transition:box-shadow .2s ease,border-color .2s ease;font-style:italic}.grid-card-kpi .grid-card-icon{background-color:var(--kpi-glow);color:var(--kpi-accent)}.grid-card-kpi .grid-card-title{color:var(--kpi-accent-light)}.grid-card-chart .grid-card-icon{background-color:var(--chart-glow);color:var(--chart-accent)}.grid-card-chart .grid-card-title{color:var(--chart-accent-light)}.grid-card-chart{align-content:center}.grid-card-table .grid-card-icon{background-color:var(--table-glow);color:var(--table-accent)}.grid-card-table .grid-card-title{color:var(--table-accent-light)}.grid-card-info .grid-card-icon{background-color:var(--info-glow);color:var(--info-color)}.grid-card-info .grid-card-title{color:var(--info-accent-light)}.grid-card-iframe .grid-card-icon{background-color:var(--iframe-glow);color:var(--iframe-accent)}.grid-card-iframe .grid-card-title{color:var(--iframe-accent-light)}.grid-card-naked.ds-card,.grid-card-naked{background-color:transparent;border:1px solid transparent;border-radius:var(--bi-radius);box-shadow:none;transform:none}.grid-card-naked.ds-card:hover,.grid-card-naked:hover{transform:none;box-shadow:none;border:1px solid transparent}.grid-card-naked:after{display:none}.grid-card-naked .grid-card-naked-resize-handle{position:absolute;bottom:4px;right:4px;width:12px;height:12px;border-right:2px solid var(--bi-card-border-strong);border-bottom:2px solid var(--bi-card-border-strong);border-bottom-right-radius:var(--bi-radius);opacity:.1;transition:opacity .2s ease;pointer-events:none;z-index:10}.grid-card-naked:hover .grid-card-naked-resize-handle{opacity:1}.grid-card-naked:before{content:"";position:absolute;top:4px;left:50%;transform:translate(-50%);width:28px;height:3px;border-radius:2px;background-color:var(--bi-grid-line);opacity:0;transition:opacity .2s ease;pointer-events:none;z-index:5}.grid-card-naked:hover:before{opacity:.6}.grid-card-naked .cardDragHandle{display:none}.grid-card-naked .react-resizable-handle{opacity:1;transition:opacity .2s ease}.grid-card-naked:hover .react-resizable-handle{opacity:.6}.grid-card-custom{border:1px solid var(--bi-card-border);border-left:3px solid var(--grid-card-accent);transition:box-shadow .2s ease,border-color .2s ease}.grid-card-custom:hover{border-radius:var(--bi-radius-sm);border-top:2px solid var(--grid-card-accent);border-right:2px solid var(--grid-card-accent);border-bottom:2px solid var(--grid-card-accent)}.grid-card-custom .grid-card-icon{background-color:var(--grid-card-accent-dark);color:var(--grid-card-accent)}.grid-card-custom .grid-card-title{color:var(--grid-card-accent-light)}.dscard-placeholder{border:1px dashed var(--bi-card-border-strong);background-color:var(--bi-surface-1)}.dscard-placeholder-naked{border:1px dashed transparent;background-color:transparent}@media(max-width:768px){.grid-card-content-grid{grid-template-columns:1fr}}.class-positive{background-color:var(--bi-positive-soft)}.class-negative{background-color:var(--bi-negative-soft)}@keyframes bi-shimmer{0%{stroke-opacity:.3}to{stroke-opacity:.9}}.parallax-wrapper{height:100%;overflow-x:hidden;overflow-y:auto;perspective:2px;perspective-origin:center}.parallax-group{position:relative;height:100%;transform-style:preserve-3d;display:flex;justify-content:center;align-items:center}.parallax-layer{position:absolute;top:0;left:0;right:0;bottom:0}.layer-bg{transform:translateZ(-5px) scale(1);z-index:1}.layer-fg{transform:translateZ(0) scale(1);z-index:2}.svgElement{transform:translateZ(-5px) scale(1);z-index:1;stroke:var(--bi-text-disabled);animation:bi-shimmer .6s infinite alternate;border-radius:1px}.grid-card .recharts-rectangle{filter:brightness(.95) saturate(.95)}.grid-card .recharts-cartesian-grid line{stroke:var(--bi-grid-line)}.grid-card .recharts-cartesian-axis-tick-value{fill:var(--bi-text-2);font-size:.75rem}.grid-card .recharts-cartesian-axis-line,.grid-card .recharts-cartesian-axis-tick-line{stroke:var(--bi-grid-line)}.grid-card .recharts-legend-item-text{color:var(--bi-text-2)!important;font-size:12px}.grid-card .recharts-tooltip-wrapper .recharts-default-tooltip{background-color:var(--bi-card-bg)!important;border:1px solid var(--bi-card-border)!important;border-radius:var(--bi-radius);font-size:12px}.grid-card .recharts-tooltip-wrapper .recharts-default-tooltip .recharts-tooltip-label{color:var(--bi-text-1)}.grid-card .recharts-tooltip-wrapper .recharts-default-tooltip .recharts-tooltip-item{color:var(--bi-text-2)!important}.grid-card .recharts-tooltip-cursor{fill:var(--bi-hover)!important}.grid-card .recharts-active-bar{fill-opacity:.85;filter:brightness(1.1)}.react-grid-item>.react-resizable-handle{position:absolute;width:20px;height:20px;opacity:0}.react-grid-item:hover>.react-resizable-handle{opacity:1}.react-grid-item>.react-resizable-handle:after{content:"";position:absolute;right:3px;bottom:3px;width:5px;height:5px;border-right:2px solid var(--bi-card-border-strong);border-bottom:2px solid var(--bi-card-border-strong)}.react-resizable-hide>.react-resizable-handle{display:none}.react-grid-item>.react-resizable-handle.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-w,.react-grid-item>.react-resizable-handle.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-n,.react-grid-item>.react-resizable-handle.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}.ds-section{margin-bottom:24px}.ds-card{background-color:var(--bi-card-bg);border-radius:var(--bi-radius);border:1px solid var(--bi-card-border);position:relative;overflow:hidden;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.ds-card-nohover{transform:none}.ds-card:hover{transform:translateY(-2px);box-shadow:var(--bi-shadow)}.ds-card-header{display:flex;align-items:center;position:relative;padding:2px 10px;justify-content:space-between;margin-bottom:4px}.ds-card-title{font-size:.875rem;font-weight:500;color:var(--bi-text-2);text-transform:uppercase;letter-spacing:.05em;margin:0}.ds-card-icon{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:var(--bi-radius);font-size:16px;background-color:var(--bi-accent-soft);color:var(--bi-accent)}.ds-card-body{flex:1;padding-left:5px;padding-right:5px}.ds-card-footer{margin-top:16px;padding-top:12px;border-top:1px solid var(--bi-card-border);display:flex;align-items:center;justify-content:space-between;font-size:.875rem;color:var(--bi-text-2)}.kpi-change{display:inline-flex;align-items:center;gap:4px;font-size:.875rem;font-weight:500;padding:2px 6px;border-radius:var(--bi-radius-sm)}.kpi-change-up{background-color:var(--bi-positive-soft);color:var(--bi-positive)}.kpi-change-down{background-color:var(--bi-negative-soft);color:var(--bi-negative)}.kpi-change-flat,.kpi-change-neutral{background-color:var(--bi-neutral-soft);color:var(--bi-neutral)}.quick-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:5px}.quick-stat,.quick-stat-nohover{display:flex;align-items:center;gap:12px;padding:12px;background-color:var(--bi-surface-1);border-radius:var(--bi-radius);transition:background-color .15s ease}.quick-stat-nohover{background-color:inherit}.quick-stat:hover{background-color:var(--bi-surface-2)}.quick-stat-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;border-radius:var(--bi-radius);font-size:20px;flex-shrink:0}.quick-stat-icon.kpi{background-color:var(--bi-accent-soft);color:var(--bi-accent)}.quick-stat-content{flex:1;min-width:0;align-items:flex-start}.quick-stat-value{font-size:1.25rem;font-weight:700;color:var(--bi-text-1);line-height:1.2}.quick-stat-value .thousand,.quick-stat-value .million,.quick-stat-value .billion{font-size:.7em;opacity:.7;margin-left:2px}.quick-stat-label{font-size:.875rem;color:var(--bi-text-2);line-height:1.3;margin-top:2px;max-height:70px;overflow:hidden}.quick-stat-label p{margin:0}@media(max-width:768px){.quick-stats{grid-template-columns:1fr}.quick-stat-icon{width:40px;height:40px;font-size:18px}}@media print{.ds-card{break-inside:avoid;box-shadow:none}.ds-card:hover{transform:none;box-shadow:none}}.dscard-placeholder{height:100%;border:1px dashed var(--bi-sketch-dash);border-radius:var(--bi-radius, 10px);text-align:center;align-content:center}.dscard-placeholder-naked{height:100%;border:1px dashed var(--bi-sketch-dash-faint);border-radius:var(--bi-radius, 10px);text-align:center;align-content:center;background-color:transparent!important}.grid-card-sketch-add{border:0}.content-sketch-add-cell{height:100px;width:70%;align-content:center;border-radius:var(--bi-radius, 10px);background-color:var(--bi-card-bg)}.content-sketch-add-row{height:50%;width:100%;border-radius:var(--bi-radius, 10px);align-content:center;background-color:var(--bi-card-bg)}.react-grid-placeholder-example{background:var(--bi-overlay)!important;border:1px dashed var(--bi-sketch-dash);border-radius:var(--bi-radius-sm, 8px);opacity:1!important}.llm-env-highlight-active{outline:2px solid var(--bi-highlight-outline)!important;outline-offset:2px;box-shadow:0 0 0 4px var(--bi-highlight-glow)!important;transition:outline-color .2s ease,box-shadow .2s ease}.llm-env-card-sketch .Mui-selected{background-color:var(--bi-sketch-selection)!important}
|
|
1
|
+
:root{--grid-card-padding: 15px;--grid-card-padding-mobile: 10px;--grid-card-gap: 15px;--grid-card-gap-mobile: 12px}.grid-card,.grid-card-nohandle,.grid-card-naked{--kpi-accent: var(--bi-accent);--kpi-accent-light: var(--bi-text-2);--kpi-glow: var(--bi-accent-soft);--chart-accent: var(--bi-accent);--chart-accent-light: var(--bi-text-2);--chart-glow: var(--bi-accent-soft);--table-accent: var(--bi-accent);--table-accent-light: var(--bi-text-2);--table-glow: var(--bi-accent-soft);--iframe-accent: var(--bi-accent);--iframe-accent-light: var(--bi-text-2);--iframe-glow: var(--bi-accent-soft);--info-accent: var(--bi-accent);--info-accent-light: var(--bi-text-2);--info-glow: var(--bi-accent-soft);--info-color: var(--bi-text-2);--grid-card-accent: var(--bi-accent);--grid-card-accent-light: var(--bi-accent-border);--grid-card-accent-dark: var(--bi-accent-soft)}.grid-card,.grid-card-nohandle{position:relative;background-color:var(--bi-card-bg);border:1px solid var(--bi-card-border);color:var(--bi-text-1)}.grid-card:active{cursor:grabbing}.grid-card:hover:before{opacity:.6}.grid-card:after{content:"";position:absolute;bottom:4px;right:4px;width:12px;height:12px;border-right:2px solid var(--bi-card-border-strong);border-bottom:2px solid var(--bi-card-border-strong);border-bottom-right-radius:var(--bi-radius);opacity:.3;transition:opacity .2s ease;pointer-events:none}.grid-card:hover:after{opacity:1}.grid-card .react-resizable-handle{opacity:0;transition:opacity .2s ease}.grid-card:hover .react-resizable-handle{opacity:1}.react-grid-placeholder{background:var(--bi-overlay)!important;border:1px dashed var(--bi-card-border-strong)!important;border-radius:var(--bi-radius);opacity:1!important}.grid-card-with-header{padding:0}.grid-card-with-header .grid-card-header{flex-shrink:0}.grid-card-with-header .grid-card-content{flex:1;min-height:0;overflow:auto}.grid-card-header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px 6px;border-bottom:none;background:transparent}.grid-card-title{margin:0;font-weight:500;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--bi-text-2)}.grid-card-icon{display:none;align-items:center;justify-content:center;margin-left:12px;opacity:.7}.grid-card-icon .material-icons{font-size:20px}.grid-card-content{padding:5px 6px 3px;height:100%}.grid-card-content-naked{padding:0;height:100%}.grid-card-content>*{height:100%}.grid-card-content-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}.grid-card-kpi,.grid-card-chart,.grid-card-table,.grid-card-info,.grid-card-iframe{border:1px solid var(--bi-card-border);border-radius:var(--card-radius, 14px);transition:border-color .15s ease,box-shadow .15s ease}.grid-card-details{border:0 solid transparent;transition:box-shadow .2s ease,border-color .2s ease;font-style:italic}.grid-card-kpi .grid-card-icon{background-color:var(--kpi-glow);color:var(--kpi-accent)}.grid-card-kpi .grid-card-title{color:var(--kpi-accent-light)}.grid-card-chart .grid-card-icon{background-color:var(--chart-glow);color:var(--chart-accent)}.grid-card-chart .grid-card-title{color:var(--chart-accent-light)}.grid-card-chart{align-content:center}.grid-card-table .grid-card-icon{background-color:var(--table-glow);color:var(--table-accent)}.grid-card-table .grid-card-title{color:var(--table-accent-light)}.grid-card-info .grid-card-icon{background-color:var(--info-glow);color:var(--info-color)}.grid-card-info .grid-card-title{color:var(--info-accent-light)}.grid-card-iframe .grid-card-icon{background-color:var(--iframe-glow);color:var(--iframe-accent)}.grid-card-iframe .grid-card-title{color:var(--iframe-accent-light)}.grid-card-naked.ds-card,.grid-card-naked{background-color:transparent;border:1px solid transparent;border-radius:var(--bi-radius);box-shadow:none;transform:none}.grid-card-naked.ds-card:hover,.grid-card-naked:hover{transform:none;box-shadow:none;border:1px solid transparent}.grid-card-naked:after{display:none}.grid-card-naked .grid-card-naked-resize-handle{position:absolute;bottom:4px;right:4px;width:12px;height:12px;border-right:2px solid var(--bi-card-border-strong);border-bottom:2px solid var(--bi-card-border-strong);border-bottom-right-radius:var(--bi-radius);opacity:.1;transition:opacity .2s ease;pointer-events:none;z-index:10}.grid-card-naked:hover .grid-card-naked-resize-handle{opacity:1}.grid-card-naked:before{content:"";position:absolute;top:4px;left:50%;transform:translate(-50%);width:28px;height:3px;border-radius:2px;background-color:var(--bi-grid-line);opacity:0;transition:opacity .2s ease;pointer-events:none;z-index:5}.grid-card-naked:hover:before{opacity:.6}.grid-card-naked .cardDragHandle{display:none}.grid-card-naked .react-resizable-handle{opacity:1;transition:opacity .2s ease}.grid-card-naked:hover .react-resizable-handle{opacity:.6}.grid-card-custom{border:1px solid var(--bi-card-border);border-left:3px solid var(--grid-card-accent);transition:box-shadow .2s ease,border-color .2s ease}.grid-card-custom:hover{border-radius:var(--bi-radius-sm);border-top:2px solid var(--grid-card-accent);border-right:2px solid var(--grid-card-accent);border-bottom:2px solid var(--grid-card-accent)}.grid-card-custom .grid-card-icon{background-color:var(--grid-card-accent-dark);color:var(--grid-card-accent)}.grid-card-custom .grid-card-title{color:var(--grid-card-accent-light)}.dscard-placeholder{border:1px dashed var(--bi-card-border-strong);background-color:var(--bi-surface-1)}.dscard-placeholder-naked{border:1px dashed transparent;background-color:transparent}@media(max-width:768px){.grid-card-content-grid{grid-template-columns:1fr}}.class-positive{background-color:var(--bi-positive-soft)}.class-negative{background-color:var(--bi-negative-soft)}@keyframes bi-shimmer{0%{stroke-opacity:.3}to{stroke-opacity:.9}}.parallax-wrapper{height:100%;overflow-x:hidden;overflow-y:auto;perspective:2px;perspective-origin:center}.parallax-group{position:relative;height:100%;transform-style:preserve-3d;display:flex;justify-content:center;align-items:center}.parallax-layer{position:absolute;top:0;left:0;right:0;bottom:0}.layer-bg{transform:translateZ(-5px) scale(1);z-index:1}.layer-fg{transform:translateZ(0) scale(1);z-index:2}.svgElement{transform:translateZ(-5px) scale(1);z-index:1;stroke:var(--bi-text-disabled);animation:bi-shimmer .6s infinite alternate;border-radius:1px}.grid-card .recharts-rectangle{filter:brightness(.95) saturate(.95)}.grid-card .recharts-cartesian-grid line{stroke:var(--bi-grid-line)}.grid-card .recharts-cartesian-axis-tick-value{fill:var(--bi-text-2);font-size:.75rem}.grid-card .recharts-cartesian-axis-line,.grid-card .recharts-cartesian-axis-tick-line{stroke:var(--bi-grid-line)}.grid-card .recharts-legend-item-text{color:var(--bi-text-2)!important;font-size:12px}.grid-card .recharts-tooltip-wrapper .recharts-default-tooltip{background-color:var(--bi-card-bg)!important;border:1px solid var(--bi-card-border)!important;border-radius:var(--bi-radius);font-size:12px}.grid-card .recharts-tooltip-wrapper .recharts-default-tooltip .recharts-tooltip-label{color:var(--bi-text-1)}.grid-card .recharts-tooltip-wrapper .recharts-default-tooltip .recharts-tooltip-item{color:var(--bi-text-2)!important}.grid-card .recharts-tooltip-cursor{fill:var(--bi-hover)!important}.grid-card .recharts-active-bar{fill-opacity:.85;filter:brightness(1.1)}.react-grid-item>.react-resizable-handle{position:absolute;width:20px;height:20px;opacity:0}.react-grid-item:hover>.react-resizable-handle{opacity:1}.react-grid-item>.react-resizable-handle:after{content:"";position:absolute;right:3px;bottom:3px;width:5px;height:5px;border-right:2px solid var(--bi-card-border-strong);border-bottom:2px solid var(--bi-card-border-strong)}.react-resizable-hide>.react-resizable-handle{display:none}.react-grid-item>.react-resizable-handle.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-w,.react-grid-item>.react-resizable-handle.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-n,.react-grid-item>.react-resizable-handle.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}.ds-section{margin-bottom:24px}.ds-card{background-color:var(--bi-card-bg);border-radius:var(--bi-radius);border:1px solid var(--bi-card-border);position:relative;overflow:hidden;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.ds-card-nohover{transform:none}.ds-card:hover{transform:translateY(-2px);box-shadow:var(--bi-shadow)}.ds-card-header{display:flex;align-items:center;position:relative;padding:2px 10px;justify-content:space-between;margin-bottom:4px}.ds-card-title{font-size:.875rem;font-weight:500;color:var(--bi-text-2);text-transform:uppercase;letter-spacing:.05em;margin:0}.ds-card-icon{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:var(--bi-radius);font-size:16px;background-color:var(--bi-accent-soft);color:var(--bi-accent)}.ds-card-body{flex:1;padding-left:5px;padding-right:5px}.ds-card-footer{margin-top:16px;padding-top:12px;border-top:1px solid var(--bi-card-border);display:flex;align-items:center;justify-content:space-between;font-size:.875rem;color:var(--bi-text-2)}.kpi-change{display:inline-flex;align-items:center;gap:4px;font-size:.875rem;font-weight:500;padding:2px 6px;border-radius:var(--bi-radius-sm)}.kpi-change-up{background-color:var(--bi-positive-soft);color:var(--bi-positive)}.kpi-change-down{background-color:var(--bi-negative-soft);color:var(--bi-negative)}.kpi-change-flat,.kpi-change-neutral{background-color:var(--bi-neutral-soft);color:var(--bi-neutral)}.quick-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:5px}.quick-stat,.quick-stat-nohover{display:flex;align-items:center;gap:12px;padding:12px;background-color:var(--bi-surface-1);border-radius:var(--bi-radius);transition:background-color .15s ease}.quick-stat-nohover{background-color:inherit}.quick-stat:hover{background-color:var(--bi-surface-2)}.quick-stat-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;border-radius:var(--bi-radius);font-size:20px;flex-shrink:0}.quick-stat-content{flex:1;min-width:0;align-items:flex-start}.quick-stat-value{font-size:1.25rem;font-weight:700;color:var(--bi-text-1);line-height:1.2}.quick-stat-value .thousand,.quick-stat-value .million,.quick-stat-value .billion{font-size:.7em;opacity:.7;margin-left:2px}.quick-stat-label{font-size:.875rem;color:var(--bi-text-2);line-height:1.3;margin-top:2px;max-height:70px;overflow:hidden}.quick-stat-label p{margin:0}@media(max-width:768px){.quick-stats{grid-template-columns:1fr}.quick-stat-icon{width:40px;height:40px;font-size:18px}}@media print{.ds-card{break-inside:avoid;box-shadow:none}.ds-card:hover{transform:none;box-shadow:none}}.dscard-placeholder{height:100%;border:1px dashed var(--bi-sketch-dash);border-radius:var(--bi-radius, 10px);text-align:center;align-content:center}.dscard-placeholder-naked{height:100%;border:1px dashed var(--bi-sketch-dash-faint);border-radius:var(--bi-radius, 10px);text-align:center;align-content:center;background-color:transparent!important}.grid-card-sketch-add{border:0}.content-sketch-add-cell{height:100px;width:70%;align-content:center;border-radius:var(--bi-radius, 10px);background-color:var(--bi-card-bg)}.content-sketch-add-row{height:50%;width:100%;border-radius:var(--bi-radius, 10px);align-content:center;background-color:var(--bi-card-bg)}.react-grid-placeholder-example{background:var(--bi-overlay)!important;border:1px dashed var(--bi-sketch-dash);border-radius:var(--bi-radius-sm, 8px);opacity:1!important}.llm-env-highlight-active{outline:2px solid var(--bi-highlight-outline)!important;outline-offset:2px;box-shadow:0 0 0 4px var(--bi-highlight-glow)!important;transition:outline-color .2s ease,box-shadow .2s ease}.llm-env-card-sketch .Mui-selected{background-color:var(--bi-sketch-selection)!important}
|
package/dist/theme.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as s, a as t, c as i, d as r, r as B, u as o, w as l } from "./createBiTheme-TyUv_UHM.js";
|
|
2
|
-
import { B as u, c as P, u as b } from "./index-
|
|
2
|
+
import { B as u, c as P, u as b } from "./index-zN3LPF6u.js";
|
|
3
3
|
export {
|
|
4
4
|
u as BiThemeBridge,
|
|
5
5
|
s as biDarkPalette,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var M = Object.defineProperty;
|
|
2
2
|
var l = (t, i) => M(t, "name", { value: i, configurable: !0 });
|
|
3
3
|
import { extendModuleRegistry as _, extendDefaultScope as b, createUiToolRegistry as w } from "@aintela/chat/components";
|
|
4
|
-
import { getBiModuleSurface as B } from "./biModuleSurface-
|
|
5
|
-
import { s as I } from "./ScriptDashboardViewerVertical-
|
|
4
|
+
import { getBiModuleSurface as B } from "./biModuleSurface-zEeRrln5.js";
|
|
5
|
+
import { s as I } from "./ScriptDashboardViewerVertical-B8Y5LoE4.js";
|
|
6
6
|
import { jsx as c } from "react/jsx-runtime";
|
|
7
7
|
import { Box as p } from "@mui/material";
|
|
8
|
-
import { M as g, a as V, C as k, I as E } from "./index-
|
|
8
|
+
import { M as g, a as V, C as k, I as E } from "./index-ZBNoVc5M.js";
|
|
9
9
|
import { B as R } from "./BiClientProvider-CWJochvi.js";
|
|
10
|
-
import { W as $ } from "./index-
|
|
10
|
+
import { W as $ } from "./index-GTSBsgzP.js";
|
|
11
11
|
const h = /* @__PURE__ */ new Set();
|
|
12
12
|
function O(t) {
|
|
13
13
|
const i = { ...B(), ...t.extraScope ?? {} }, a = t.specifiers.filter((o) => !h.has(o));
|
|
@@ -111,7 +111,7 @@ function T(t = {}) {
|
|
|
111
111
|
}, { status: "Guia iniciado" }) : x;
|
|
112
112
|
}
|
|
113
113
|
l(T, "createBiUiTools");
|
|
114
|
-
const j = "0.2.
|
|
114
|
+
const j = "0.2.5";
|
|
115
115
|
export {
|
|
116
116
|
j as B,
|
|
117
117
|
P as a,
|
|
@@ -119,4 +119,4 @@ export {
|
|
|
119
119
|
y as n,
|
|
120
120
|
O as r
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=version-
|
|
122
|
+
//# sourceMappingURL=version-oYqU5xJk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-BTc4ElDG.js","sources":["../src/runtime/registerBiModules.ts","../src/runtime/createBiUiTools.tsx","../src/runtime/version.ts"],"sourcesContent":["import { extendModuleRegistry, extendDefaultScope } from '@aintela/chat/components';\nimport { getBiModuleSurface } from './biModuleSurface';\nimport { seedHostModules } from './loadDashboardBundle';\n\nexport interface RegisterBiModulesOptions {\n /**\n * The module specifiers LLM-emitted code imports from. The compiled\n * snippet does `__scope[\"<specifier>\"].X` and a bundle does\n * `require(\"<specifier>\")`, so every string here must match what the\n * template / instruction files told the model to write.\n *\n * AIA starts clean: `['@aintela/bi']`. Envision must keep resolving the\n * legacy keys forever (persisted sessions + content-hashed bundles):\n * `['@aintela/bi', '@envision/ui-library', '@envision/ui-library/components', …]`.\n */\n specifiers: string[];\n /**\n * Extra values merged into the surface under every specifier AND into the\n * bare-identifier scope — e.g. Envision's `VizLibrary` compat shim, or a\n * host's own components the instructions mention.\n */\n extraScope?: Record<string, unknown>;\n /**\n * Extra `require()` targets for dashboard bundles keyed by specifier\n * (`{ 'date-fns': dateFns, lodash }`). Not in the live-TSX scope.\n */\n extraHostModules?: Record<string, unknown>;\n}\n\nconst registeredKeys = new Set<string>();\n\n/**\n * Makes this library resolvable from LLM-generated code:\n * 1. `extendModuleRegistry(specifier, surface)` once per specifier (live TSX imports);\n * 2. `extendDefaultScope(surface)` once (bare identifiers, no import line);\n * 3. seeds the dashboard-bundle loader's host-module map under the same specifiers.\n *\n * Idempotent per specifier — call it at app start, before the first chat turn\n * or bundle renders.\n */\nexport function registerBiModules(options: RegisterBiModulesOptions): void {\n const surface = { ...getBiModuleSurface(), ...(options.extraScope ?? {}) };\n\n const fresh = options.specifiers.filter((s) => !registeredKeys.has(s));\n for (const specifier of fresh) {\n extendModuleRegistry(specifier, surface);\n registeredKeys.add(specifier);\n }\n if (fresh.length > 0 || options.extraScope) {\n extendDefaultScope(surface);\n }\n seedHostModules(options.specifiers, options.extraHostModules);\n}\n\n/** Test seam. */\nexport function resetBiModuleRegistration(): void {\n registeredKeys.clear();\n}\n","import React from 'react';\nimport { Box } from '@mui/material';\nimport { createUiToolRegistry } from '@aintela/chat/components';\nimport type { UiToolRegistryBuilder } from '@aintela/chat/components';\nimport { Chart, Metric, MetricGroup, IFrame } from '../inline';\nimport type { ChartExpandInfo, IFrameExpandInfo } from '../inline';\nimport { BiClientProvider, type BiClient } from '../client';\nimport { VisualizationFrame, type VisualizationKind } from './sessionVisualizations';\nimport type { DashboardEnvironment, GuideStep } from '../composer/environment/types';\n\n/**\n * The explorer's visual vocabulary as `uiTools` registry entries. The chat\n * library owns the plumbing (routing `[KernelUiFunction]` calls, unwrapping\n * args, replay); here we only declare WHAT to draw per tool name.\n *\n * `present_dashboard` and `present_tsx` are deliberately NOT registered — the\n * dashboard hand-off belongs to the dashboard slice and `present_tsx`'s\n * compiled-JS sibling-event plumbing is host policy. Both are added by the\n * host on the returned builder:\n *\n * const uiTools = createBiUiTools({ client })\n * .render('present_dashboard', (a) => <ScriptDashboardViewer dashboardId={a.id} />)\n * .build();\n */\nexport interface CreateBiUiToolsOptions {\n /**\n * Client whose `artifactUrl` / `iframeUrl` resolve the images. When\n * omitted the renderers rely on an ambient `<BiClientProvider>` above the\n * chat pane (which is how a host also passes the session id).\n */\n client?: BiClient;\n /** Expand handlers (a lightbox, an artifact panel). Default: open in a new tab. */\n onExpandChart?: (info: ChartExpandInfo) => void;\n onExpandIframe?: (info: IFrameExpandInfo) => void;\n /** Start from an existing builder to chain more tools before these. */\n builder?: UiToolRegistryBuilder;\n /**\n * The composer's environment (`useComposerEnvironment()` /\n * `environmentFromStore(store)`). When supplied, the three ACTION tools\n * the dashboard agent calls are registered too: `refresh_dashboard`,\n * `present_dashboard_pad` (`definitionJson` + `mode`) and `present_guide`\n * (`stepsJson`). Without it they are left to the host, like `present_dashboard`.\n */\n environment?: Partial<DashboardEnvironment>;\n}\n\n// present_metric uses camelCase params, but present_metric_group's items come\n// from a C# class serialised PascalCase. Read either casing.\nexport interface PresentMetricArgs {\n currentValue: string;\n previousValue?: string;\n prefix?: string;\n suffix?: string;\n differenceStyle?: 'Percentage' | 'Value';\n description?: string;\n icon?: string;\n}\n\nexport function normalizeMetricArgs(raw: unknown): PresentMetricArgs {\n const o = (raw ?? {}) as Record<string, unknown>;\n const g = (k: string): string | undefined => {\n const v = o[k] ?? o[k.charAt(0).toUpperCase() + k.slice(1)];\n return v == null ? undefined : String(v);\n };\n return {\n currentValue: g('currentValue') ?? '',\n previousValue: g('previousValue'),\n prefix: g('prefix'),\n suffix: g('suffix'),\n differenceStyle: g('differenceStyle') as 'Percentage' | 'Value' | undefined,\n description: g('description'),\n icon: g('icon'),\n };\n}\n\nexport interface PresentChartArgs { src?: string; name?: string; alt?: string; reasoning?: string; naked?: boolean }\nexport interface PresentMetricGroupArgs { title?: string; materialIcon?: string; footNote?: string; metrics?: unknown[] }\nexport interface PresentIframeArgs { src?: string; name?: string }\nexport interface PresentDashboardPadArgs { definitionJson?: string; mode?: 'create' | 'update' | string }\nexport interface PresentGuideArgs { stepsJson?: string }\n\n/** JSON text that may have been encoded once or twice on the way through the tool call. */\nfunction parseJsonArg<T>(raw: string | undefined, fallback: T): T {\n let value: unknown = raw;\n for (let i = 0; i < 2 && typeof value === 'string'; i++) {\n try {\n value = JSON.parse(value);\n } catch {\n return fallback;\n }\n }\n return (value ?? fallback) as T;\n}\n\n/**\n * What `VisualizationFrame` needs from the tool call that produced the thing — a structural subset of the\n * chat library's `UiToolContext`, so the renderers can pass `ctx` straight through.\n */\ninterface FrameInfo {\n callId: string;\n /** The interaction the call belongs to — one group per agent answer. */\n message?: unknown;\n onGoing?: boolean;\n}\n\n/** The interaction's id, when it has one — the group key, and `undefined` is a perfectly good group. */\nfunction groupOf(message: unknown): string | undefined {\n const id = (message as { id?: unknown } | null | undefined)?.id;\n return typeof id === 'string' ? id : undefined;\n}\n\nexport function createBiUiTools(options: CreateBiUiToolsOptions = {}): UiToolRegistryBuilder {\n const { client, onExpandChart, onExpandIframe } = options;\n\n /**\n * Box the node, put it under the client, and REGISTER it as one of the session's visualizations.\n *\n * <p>The registration is here rather than in each inline component because it is a fact about the tool\n * CALL — its id, its interaction, whether the turn is still streaming — and only this layer sees those.\n * Outside a `SessionVisualizationsProvider` the frame is inert and renders its child unchanged, so a host\n * that does not use the panel sees no difference at all.</p>\n */\n const wrap = (node: React.ReactNode, viz?: { kind: VisualizationKind; title?: string; preview?: React.ReactNode; frame: FrameInfo }): React.ReactNode => {\n const boxed = <Box sx={{ my: 1 }}>{node}</Box>;\n const framed = viz ? (\n <VisualizationFrame\n id={viz.frame.callId}\n kind={viz.kind}\n title={viz.title}\n group={groupOf(viz.frame.message)}\n preview={viz.preview}\n ready={!viz.frame.onGoing}\n >\n {boxed}\n </VisualizationFrame>\n ) : (\n boxed\n );\n return client ? <BiClientProvider client={client}>{framed}</BiClientProvider> : framed;\n };\n\n const builder = (options.builder ?? createUiToolRegistry())\n .render<PresentMetricArgs>('present_metric', (args, ctx) => {\n const m = normalizeMetricArgs(args);\n if (!m.currentValue) return null;\n return wrap(<Metric partial={false} {...m} />, {\n kind: 'metric',\n title: m.description,\n // The value IS the thumbnail for a KPI — nothing smaller says more about it.\n preview: <Box sx={{ fontSize: 15, fontWeight: 600, letterSpacing: '-0.02em' }}>{`${m.prefix ?? ''}${m.currentValue}${m.suffix ?? ''}`}</Box>,\n frame: ctx,\n });\n })\n .render<PresentMetricGroupArgs>('present_metric_group', (a, ctx) => {\n if (!a.metrics?.length) return null;\n const values = a.metrics.map((raw) => normalizeMetricArgs(raw));\n return wrap(\n <MetricGroup partial={false} title={a.title} materialIcon={a.materialIcon} footNote={a.footNote}>\n {values.map((m, i) => (\n <Metric key={i} partial={false} {...m} />\n ))}\n </MetricGroup>,\n {\n kind: 'metric',\n title: a.title,\n preview: (\n <Box sx={{ display: 'flex', gap: 1.5, flexWrap: 'wrap', fontSize: 13, fontWeight: 600, letterSpacing: '-0.02em' }}>\n {values.slice(0, 3).map((m, i) => (\n <Box key={i} component=\"span\">{`${m.prefix ?? ''}${m.currentValue}${m.suffix ?? ''}`}</Box>\n ))}\n </Box>\n ),\n frame: ctx,\n },\n );\n })\n .render<PresentChartArgs>('present_chart', (a, ctx) => {\n if (!a.src) return null;\n return wrap(<Chart src={a.src} name={a.name} alt={a.alt} reasoning={a.reasoning} naked={a.naked} onExpand={onExpandChart} />, {\n kind: 'chart',\n title: a.name ?? a.alt,\n // The chart's OWN image, scaled down. A hand-drawn sparkline would be a second, different\n // picture of the same data — and one this package would have to keep in step with the chart.\n preview: client ? <Box component=\"img\" src={client.artifactUrl(a.src)} alt=\"\" sx={{ maxWidth: '100%', maxHeight: 44, objectFit: 'contain', display: 'block' }} /> : undefined,\n frame: ctx,\n });\n })\n .render<PresentIframeArgs>('present_iframe', (a, ctx) => {\n if (!a.src || !a.name) return null;\n return wrap(<IFrame partial={false} src={a.src} name={a.name} onExpand={onExpandIframe} />, { kind: 'iframe', title: a.name, frame: ctx });\n });\n\n const env = options.environment;\n if (!env) return builder;\n\n // Action tools: side effects on the composer, fired once per tool-call id\n // by the chat library; the status chip shows after a successful run.\n return builder\n .action('refresh_dashboard', () => {\n env.refreshDashboard?.();\n }, { status: 'Dashboard atualizado' })\n .action<PresentDashboardPadArgs>('present_dashboard_pad', (a) => {\n const def = parseJsonArg<Record<string, unknown>>(a.definitionJson, {});\n if (a.mode === 'create') env.createDashboardPad?.(def as never);\n else env.updateDashboardPad?.(def as never);\n }, { status: 'Rascunho atualizado' })\n .action<PresentGuideArgs>('present_guide', (a) => {\n const steps = parseJsonArg<GuideStep[]>(a.stepsJson, []);\n if (Array.isArray(steps) && steps.length > 0) env.showGuide?.(steps);\n }, { status: 'Guia iniciado' });\n}\n","/**\n * The package version, so a host can log a mismatch against the server-side\n * `AIntelA.Bi.Agents` version at handshake (the instruction files describe\n * THIS React API). Kept in sync with package.json by `tests/runtime/version.test.ts`.\n */\nexport const BI_RUNTIME_VERSION = '0.2.3';\n"],"names":["registeredKeys","registerBiModules","options","surface","getBiModuleSurface","fresh","s","specifier","extendModuleRegistry","extendDefaultScope","seedHostModules","__name","resetBiModuleRegistration","normalizeMetricArgs","raw","o","g","k","v","parseJsonArg","fallback","value","i","groupOf","message","id","createBiUiTools","client","onExpandChart","onExpandIframe","wrap","node","viz","boxed","Box","framed","jsx","VisualizationFrame","BiClientProvider","builder","createUiToolRegistry","args","ctx","m","Metric","a","_a","values","MetricGroup","Chart","IFrame","env","def","_b","steps","BI_RUNTIME_VERSION"],"mappings":";;;;;;;;;;AA6BA,MAAMA,wBAAqB,IAAA;AAWpB,SAASC,EAAkBC,GAAyC;AACvE,QAAMC,IAAU,EAAE,GAAGC,EAAA,GAAsB,GAAIF,EAAQ,cAAc,GAAC,GAEhEG,IAAQH,EAAQ,WAAW,OAAO,CAACI,MAAM,CAACN,EAAe,IAAIM,CAAC,CAAC;AACrE,aAAWC,KAAaF;AACpB,IAAAG,EAAqBD,GAAWJ,CAAO,GACvCH,EAAe,IAAIO,CAAS;AAEhC,GAAIF,EAAM,SAAS,KAAKH,EAAQ,eAC5BO,EAAmBN,CAAO,GAE9BO,EAAgBR,EAAQ,YAAYA,EAAQ,gBAAgB;AAChE;AAZgBS,EAAAV,GAAA;AAeT,SAASW,IAAkC;AAC9C,EAAAZ,EAAe,MAAA;AACnB;AAFgBW,EAAAC,GAAA;ACGT,SAASC,EAAoBC,GAAiC;AACjE,QAAMC,IAAKD,KAAO,CAAA,GACZE,IAAI,gBAAAL,EAAA,CAACM,MAAkC;AACzC,UAAMC,IAAIH,EAAEE,CAAC,KAAKF,EAAEE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A,CAAwB,EACpC,OAAgC,yBAAyB,CAACN,MAAM;;AAC7D,UAAMO,IAAMjC,EAAsC0B,EAAE,gBAAgB,CAAA,CAAE;AACtE,IAAIA,EAAE,SAAS,YAAUC,IAAAK,EAAI,uBAAJ,QAAAL,EAAA,KAAAK,GAAyBC,MAC7CC,IAAAF,EAAI,uBAAJ,QAAAE,EAAA,KAAAF,GAAyBC;AAAA,EAClC,GAAG,EAAE,QAAQ,sBAAA,CAAuB,EACnC,OAAyB,iBAAiB,CAACP,MAAM;;AAC9C,UAAMS,IAAQnC,EAA0B0B,EAAE,WAAW,CAAA,CAAE;AACvD,IAAI,MAAM,QAAQS,CAAK,KAAKA,EAAM,SAAS,OAAGR,IAAAK,EAAI,cAAJ,QAAAL,EAAA,KAAAK,GAAgBG;AAAA,EAClE,GAAG,EAAE,QAAQ,iBAAiB,IAhBjBf;AAiBrB;AAnGgB5B,EAAAe,GAAA;AC1GT,MAAM6B,IAAqB;"}
|
|
1
|
+
{"version":3,"file":"version-oYqU5xJk.js","sources":["../src/runtime/registerBiModules.ts","../src/runtime/createBiUiTools.tsx","../src/runtime/version.ts"],"sourcesContent":["import { extendModuleRegistry, extendDefaultScope } from '@aintela/chat/components';\nimport { getBiModuleSurface } from './biModuleSurface';\nimport { seedHostModules } from './loadDashboardBundle';\n\nexport interface RegisterBiModulesOptions {\n /**\n * The module specifiers LLM-emitted code imports from. The compiled\n * snippet does `__scope[\"<specifier>\"].X` and a bundle does\n * `require(\"<specifier>\")`, so every string here must match what the\n * template / instruction files told the model to write.\n *\n * AIA starts clean: `['@aintela/bi']`. Envision must keep resolving the\n * legacy keys forever (persisted sessions + content-hashed bundles):\n * `['@aintela/bi', '@envision/ui-library', '@envision/ui-library/components', …]`.\n */\n specifiers: string[];\n /**\n * Extra values merged into the surface under every specifier AND into the\n * bare-identifier scope — e.g. Envision's `VizLibrary` compat shim, or a\n * host's own components the instructions mention.\n */\n extraScope?: Record<string, unknown>;\n /**\n * Extra `require()` targets for dashboard bundles keyed by specifier\n * (`{ 'date-fns': dateFns, lodash }`). Not in the live-TSX scope.\n */\n extraHostModules?: Record<string, unknown>;\n}\n\nconst registeredKeys = new Set<string>();\n\n/**\n * Makes this library resolvable from LLM-generated code:\n * 1. `extendModuleRegistry(specifier, surface)` once per specifier (live TSX imports);\n * 2. `extendDefaultScope(surface)` once (bare identifiers, no import line);\n * 3. seeds the dashboard-bundle loader's host-module map under the same specifiers.\n *\n * Idempotent per specifier — call it at app start, before the first chat turn\n * or bundle renders.\n */\nexport function registerBiModules(options: RegisterBiModulesOptions): void {\n const surface = { ...getBiModuleSurface(), ...(options.extraScope ?? {}) };\n\n const fresh = options.specifiers.filter((s) => !registeredKeys.has(s));\n for (const specifier of fresh) {\n extendModuleRegistry(specifier, surface);\n registeredKeys.add(specifier);\n }\n if (fresh.length > 0 || options.extraScope) {\n extendDefaultScope(surface);\n }\n seedHostModules(options.specifiers, options.extraHostModules);\n}\n\n/** Test seam. */\nexport function resetBiModuleRegistration(): void {\n registeredKeys.clear();\n}\n","import React from 'react';\nimport { Box } from '@mui/material';\nimport { createUiToolRegistry } from '@aintela/chat/components';\nimport type { UiToolRegistryBuilder } from '@aintela/chat/components';\nimport { Chart, Metric, MetricGroup, IFrame } from '../inline';\nimport type { ChartExpandInfo, IFrameExpandInfo } from '../inline';\nimport { BiClientProvider, type BiClient } from '../client';\nimport { VisualizationFrame, type VisualizationKind } from './sessionVisualizations';\nimport type { DashboardEnvironment, GuideStep } from '../composer/environment/types';\n\n/**\n * The explorer's visual vocabulary as `uiTools` registry entries. The chat\n * library owns the plumbing (routing `[KernelUiFunction]` calls, unwrapping\n * args, replay); here we only declare WHAT to draw per tool name.\n *\n * `present_dashboard` and `present_tsx` are deliberately NOT registered — the\n * dashboard hand-off belongs to the dashboard slice and `present_tsx`'s\n * compiled-JS sibling-event plumbing is host policy. Both are added by the\n * host on the returned builder:\n *\n * const uiTools = createBiUiTools({ client })\n * .render('present_dashboard', (a) => <ScriptDashboardViewer dashboardId={a.id} />)\n * .build();\n */\nexport interface CreateBiUiToolsOptions {\n /**\n * Client whose `artifactUrl` / `iframeUrl` resolve the images. When\n * omitted the renderers rely on an ambient `<BiClientProvider>` above the\n * chat pane (which is how a host also passes the session id).\n */\n client?: BiClient;\n /** Expand handlers (a lightbox, an artifact panel). Default: open in a new tab. */\n onExpandChart?: (info: ChartExpandInfo) => void;\n onExpandIframe?: (info: IFrameExpandInfo) => void;\n /** Start from an existing builder to chain more tools before these. */\n builder?: UiToolRegistryBuilder;\n /**\n * The composer's environment (`useComposerEnvironment()` /\n * `environmentFromStore(store)`). When supplied, the three ACTION tools\n * the dashboard agent calls are registered too: `refresh_dashboard`,\n * `present_dashboard_pad` (`definitionJson` + `mode`) and `present_guide`\n * (`stepsJson`). Without it they are left to the host, like `present_dashboard`.\n */\n environment?: Partial<DashboardEnvironment>;\n}\n\n// present_metric uses camelCase params, but present_metric_group's items come\n// from a C# class serialised PascalCase. Read either casing.\nexport interface PresentMetricArgs {\n currentValue: string;\n previousValue?: string;\n prefix?: string;\n suffix?: string;\n differenceStyle?: 'Percentage' | 'Value';\n description?: string;\n icon?: string;\n}\n\nexport function normalizeMetricArgs(raw: unknown): PresentMetricArgs {\n const o = (raw ?? {}) as Record<string, unknown>;\n const g = (k: string): string | undefined => {\n const v = o[k] ?? o[k.charAt(0).toUpperCase() + k.slice(1)];\n return v == null ? undefined : String(v);\n };\n return {\n currentValue: g('currentValue') ?? '',\n previousValue: g('previousValue'),\n prefix: g('prefix'),\n suffix: g('suffix'),\n differenceStyle: g('differenceStyle') as 'Percentage' | 'Value' | undefined,\n description: g('description'),\n icon: g('icon'),\n };\n}\n\nexport interface PresentChartArgs { src?: string; name?: string; alt?: string; reasoning?: string; naked?: boolean }\nexport interface PresentMetricGroupArgs { title?: string; materialIcon?: string; footNote?: string; metrics?: unknown[] }\nexport interface PresentIframeArgs { src?: string; name?: string }\nexport interface PresentDashboardPadArgs { definitionJson?: string; mode?: 'create' | 'update' | string }\nexport interface PresentGuideArgs { stepsJson?: string }\n\n/** JSON text that may have been encoded once or twice on the way through the tool call. */\nfunction parseJsonArg<T>(raw: string | undefined, fallback: T): T {\n let value: unknown = raw;\n for (let i = 0; i < 2 && typeof value === 'string'; i++) {\n try {\n value = JSON.parse(value);\n } catch {\n return fallback;\n }\n }\n return (value ?? fallback) as T;\n}\n\n/**\n * What `VisualizationFrame` needs from the tool call that produced the thing — a structural subset of the\n * chat library's `UiToolContext`, so the renderers can pass `ctx` straight through.\n */\ninterface FrameInfo {\n callId: string;\n /** The interaction the call belongs to — one group per agent answer. */\n message?: unknown;\n onGoing?: boolean;\n}\n\n/** The interaction's id, when it has one — the group key, and `undefined` is a perfectly good group. */\nfunction groupOf(message: unknown): string | undefined {\n const id = (message as { id?: unknown } | null | undefined)?.id;\n return typeof id === 'string' ? id : undefined;\n}\n\nexport function createBiUiTools(options: CreateBiUiToolsOptions = {}): UiToolRegistryBuilder {\n const { client, onExpandChart, onExpandIframe } = options;\n\n /**\n * Box the node, put it under the client, and REGISTER it as one of the session's visualizations.\n *\n * <p>The registration is here rather than in each inline component because it is a fact about the tool\n * CALL — its id, its interaction, whether the turn is still streaming — and only this layer sees those.\n * Outside a `SessionVisualizationsProvider` the frame is inert and renders its child unchanged, so a host\n * that does not use the panel sees no difference at all.</p>\n */\n const wrap = (node: React.ReactNode, viz?: { kind: VisualizationKind; title?: string; preview?: React.ReactNode; frame: FrameInfo }): React.ReactNode => {\n const boxed = <Box sx={{ my: 1 }}>{node}</Box>;\n const framed = viz ? (\n <VisualizationFrame\n id={viz.frame.callId}\n kind={viz.kind}\n title={viz.title}\n group={groupOf(viz.frame.message)}\n preview={viz.preview}\n ready={!viz.frame.onGoing}\n >\n {boxed}\n </VisualizationFrame>\n ) : (\n boxed\n );\n return client ? <BiClientProvider client={client}>{framed}</BiClientProvider> : framed;\n };\n\n const builder = (options.builder ?? createUiToolRegistry())\n .render<PresentMetricArgs>('present_metric', (args, ctx) => {\n const m = normalizeMetricArgs(args);\n if (!m.currentValue) return null;\n return wrap(<Metric partial={false} {...m} />, {\n kind: 'metric',\n title: m.description,\n // The value IS the thumbnail for a KPI — nothing smaller says more about it.\n preview: <Box sx={{ fontSize: 15, fontWeight: 600, letterSpacing: '-0.02em' }}>{`${m.prefix ?? ''}${m.currentValue}${m.suffix ?? ''}`}</Box>,\n frame: ctx,\n });\n })\n .render<PresentMetricGroupArgs>('present_metric_group', (a, ctx) => {\n if (!a.metrics?.length) return null;\n const values = a.metrics.map((raw) => normalizeMetricArgs(raw));\n return wrap(\n <MetricGroup partial={false} title={a.title} materialIcon={a.materialIcon} footNote={a.footNote}>\n {values.map((m, i) => (\n <Metric key={i} partial={false} {...m} />\n ))}\n </MetricGroup>,\n {\n kind: 'metric',\n title: a.title,\n preview: (\n <Box sx={{ display: 'flex', gap: 1.5, flexWrap: 'wrap', fontSize: 13, fontWeight: 600, letterSpacing: '-0.02em' }}>\n {values.slice(0, 3).map((m, i) => (\n <Box key={i} component=\"span\">{`${m.prefix ?? ''}${m.currentValue}${m.suffix ?? ''}`}</Box>\n ))}\n </Box>\n ),\n frame: ctx,\n },\n );\n })\n .render<PresentChartArgs>('present_chart', (a, ctx) => {\n if (!a.src) return null;\n return wrap(<Chart src={a.src} name={a.name} alt={a.alt} reasoning={a.reasoning} naked={a.naked} onExpand={onExpandChart} />, {\n kind: 'chart',\n title: a.name ?? a.alt,\n // The chart's OWN image, scaled down. A hand-drawn sparkline would be a second, different\n // picture of the same data — and one this package would have to keep in step with the chart.\n preview: client ? <Box component=\"img\" src={client.artifactUrl(a.src)} alt=\"\" sx={{ maxWidth: '100%', maxHeight: 44, objectFit: 'contain', display: 'block' }} /> : undefined,\n frame: ctx,\n });\n })\n .render<PresentIframeArgs>('present_iframe', (a, ctx) => {\n if (!a.src || !a.name) return null;\n return wrap(<IFrame partial={false} src={a.src} name={a.name} onExpand={onExpandIframe} />, { kind: 'iframe', title: a.name, frame: ctx });\n });\n\n const env = options.environment;\n if (!env) return builder;\n\n // Action tools: side effects on the composer, fired once per tool-call id\n // by the chat library; the status chip shows after a successful run.\n return builder\n .action('refresh_dashboard', () => {\n env.refreshDashboard?.();\n }, { status: 'Dashboard atualizado' })\n .action<PresentDashboardPadArgs>('present_dashboard_pad', (a) => {\n const def = parseJsonArg<Record<string, unknown>>(a.definitionJson, {});\n if (a.mode === 'create') env.createDashboardPad?.(def as never);\n else env.updateDashboardPad?.(def as never);\n }, { status: 'Rascunho atualizado' })\n .action<PresentGuideArgs>('present_guide', (a) => {\n const steps = parseJsonArg<GuideStep[]>(a.stepsJson, []);\n if (Array.isArray(steps) && steps.length > 0) env.showGuide?.(steps);\n }, { status: 'Guia iniciado' });\n}\n","/**\n * The package version, so a host can log a mismatch against the server-side\n * `AIntelA.Bi.Agents` version at handshake (the instruction files describe\n * THIS React API). Kept in sync with package.json by `tests/runtime/version.test.ts`.\n */\nexport const BI_RUNTIME_VERSION = '0.2.5';\n"],"names":["registeredKeys","registerBiModules","options","surface","getBiModuleSurface","fresh","s","specifier","extendModuleRegistry","extendDefaultScope","seedHostModules","__name","resetBiModuleRegistration","normalizeMetricArgs","raw","o","g","k","v","parseJsonArg","fallback","value","i","groupOf","message","id","createBiUiTools","client","onExpandChart","onExpandIframe","wrap","node","viz","boxed","Box","framed","jsx","VisualizationFrame","BiClientProvider","builder","createUiToolRegistry","args","ctx","m","Metric","a","_a","values","MetricGroup","Chart","IFrame","env","def","_b","steps","BI_RUNTIME_VERSION"],"mappings":";;;;;;;;;;AA6BA,MAAMA,wBAAqB,IAAA;AAWpB,SAASC,EAAkBC,GAAyC;AACvE,QAAMC,IAAU,EAAE,GAAGC,EAAA,GAAsB,GAAIF,EAAQ,cAAc,GAAC,GAEhEG,IAAQH,EAAQ,WAAW,OAAO,CAACI,MAAM,CAACN,EAAe,IAAIM,CAAC,CAAC;AACrE,aAAWC,KAAaF;AACpB,IAAAG,EAAqBD,GAAWJ,CAAO,GACvCH,EAAe,IAAIO,CAAS;AAEhC,GAAIF,E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E,OAAa,OACvBf,oBAAMoB,GAAA,EAAO,SAAS,IAAO,KAAKL,EAAE,KAAK,MAAMA,EAAE,MAAM,UAAUhB,EAAA,CAAgB,GAAI,EAAE,MAAM,UAAU,OAAOgB,EAAE,MAAM,OAAOH,EAAA,CAAK,CAC5I,GAECS,IAAMjD,EAAQ;AACpB,SAAKiD,IAIEZ,EACF,OAAO,qBAAqB,MAAM;;AAC/B,KAAAO,IAAAK,EAAI,qBAAJ,QAAAL,EAAA,KAAAK;AAAA,EACJ,GAAG,EAAE,QAAQ,uBAAA,CAAwB,EACpC,OAAgC,yBAAyB,CAACN,MAAM;;AAC7D,UAAMO,IAAMjC,EAAsC0B,EAAE,gBAAgB,CAAA,CAAE;AACtE,IAAIA,EAAE,SAAS,YAAUC,IAAAK,EAAI,uBAAJ,QAAAL,EAAA,KAAAK,GAAyBC,MAC7CC,IAAAF,EAAI,uBAAJ,QAAAE,EAAA,KAAAF,GAAyBC;AAAA,EAClC,GAAG,EAAE,QAAQ,sBAAA,CAAuB,EACnC,OAAyB,iBAAiB,CAACP,MAAM;;AAC9C,UAAMS,IAAQnC,EAA0B0B,EAAE,WAAW,CAAA,CAAE;AACvD,IAAI,MAAM,QAAQS,CAAK,KAAKA,EAAM,SAAS,OAAGR,IAAAK,EAAI,cAAJ,QAAAL,EAAA,KAAAK,GAAgBG;AAAA,EAClE,GAAG,EAAE,QAAQ,iBAAiB,IAhBjBf;AAiBrB;AAnGgB5B,EAAAe,GAAA;AC1GT,MAAM6B,IAAqB;"}
|
package/dist/viewer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, S as s, a as d, r as o, u as t } from "./ScriptDashboardViewerVertical-
|
|
1
|
+
import { C as e, S as s, a as d, r as o, u as t } from "./ScriptDashboardViewerVertical-B8Y5LoE4.js";
|
|
2
2
|
export {
|
|
3
3
|
e as CATEGORY_PREFIXES,
|
|
4
4
|
s as ScriptDashboardViewer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aintela/bi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "BI visualisation components, dashboard grid, hooks, the dashboard composer (sketch pad + authoring view) and the LLM runtime registry for the AIA platform (extracted from Envision's dashboard app).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GridLayout-1gWuIKeZ.js","sources":["../src/grid/BiErrorBoundary.tsx","../src/grid/GridCard.tsx","../src/grid/types.ts","../src/grid/GridLayout.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface BiErrorBoundaryProps {\n fallback: (error: Error) => React.ReactNode;\n /** Reset the boundary when this value changes (e.g. the card key or a render generation). */\n resetKey?: unknown;\n onError?: (error: Error, info: React.ErrorInfo) => void;\n children?: React.ReactNode;\n}\n\ninterface State {\n error: Error | null;\n}\n\n/**\n * Minimal error boundary for grid cards. A local copy rather than the chat\n * library's `JsxErrorBoundary`, so `@aintela/bi/grid` has no runtime import\n * from `@aintela/chat` (only `@aintela/bi/runtime` talks to the chat library).\n */\nexport class BiErrorBoundary extends React.Component<BiErrorBoundaryProps, State> {\n state: State = { error: null };\n\n static getDerivedStateFromError(error: Error): State {\n return { error };\n }\n\n componentDidCatch(error: Error, info: React.ErrorInfo): void {\n this.props.onError?.(error, info);\n }\n\n componentDidUpdate(prev: BiErrorBoundaryProps): void {\n if (this.state.error && prev.resetKey !== this.props.resetKey) {\n this.setState({ error: null });\n }\n }\n\n render(): React.ReactNode {\n if (this.state.error) return this.props.fallback(this.state.error);\n return this.props.children;\n }\n}\n\nexport default BiErrorBoundary;\n","import React, { forwardRef } from 'react';\nimport type { HTMLAttributes, ReactNode, CSSProperties } from 'react';\nimport type { SvgIconComponent } from '@mui/icons-material';\nimport type { OverridableComponent } from '@mui/material/OverridableComponent';\nimport type { SvgIconTypeMap } from '@mui/material/SvgIcon';\nimport { useTheme } from '@mui/material/styles';\nimport { alpha } from '@mui/material/styles';\nimport { BiErrorBoundary } from './BiErrorBoundary';\nimport { ChartContextProvider } from './ChartContext';\nimport './GridLayout.css';\n\n/** Header configuration for GridCard */\nexport interface GridCardHeader {\n title: string;\n /** Material Icons ligature name (host loads the font) or an MUI icon component */\n icon?: string | SvgIconComponent;\n}\n\n/** Predefined accent variants for the card */\nexport type GridCardColor = 'kpi' | 'chart' | 'table' | 'info' | 'iframe' | 'details' | 'custom';\n\nexport type GridCardContentDisplay = 'default' | 'grid';\n\n/**\n * - \"Boxed\": default look with header, border accents, etc.\n * - \"Naked\": no header, no border accents, blends with the background; only\n * subtle drag/resize handles on hover.\n */\nexport type GridCardViewType = 'Boxed' | 'Naked';\n\nexport interface GridCardProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n variant?: 'default' | 'elevated';\n viewType?: GridCardViewType;\n header?: GridCardHeader;\n /** Custom header render function; overrides the default header. */\n renderHeader?: (header: GridCardHeader) => ReactNode;\n /** Accent variant. */\n color?: GridCardColor;\n /** Custom accent (used when color=\"custom\"): any CSS colour, e.g. a theme token you resolved. */\n customColor?: string;\n contentDisplay?: GridCardContentDisplay;\n contentStyle?: CSSProperties;\n contentClassName?: string;\n noBorder?: boolean;\n /** Raw CSS injected in a `<style>` next to the card (dashboard bundles emit per-card styles). */\n htmlStyle?: string;\n dragLocked?: boolean;\n zoomLevel?: number;\n isResizable?: boolean;\n}\n\n/**\n * GridCard — a card usable directly as a react-grid-layout item. Forwards the\n * ref and the mouse/touch props RGL needs; use it as a direct child of\n * `GridLayout` with a `key`.\n */\nexport const GridCard = forwardRef<HTMLDivElement, GridCardProps>(\n (\n {\n style,\n htmlStyle,\n className,\n onMouseDown,\n onMouseUp,\n onTouchEnd,\n children,\n variant = 'default',\n viewType = 'Boxed',\n header,\n renderHeader,\n dragLocked = false,\n noBorder = false,\n color,\n zoomLevel = 0.9,\n customColor,\n contentDisplay = 'default',\n contentStyle,\n contentClassName,\n isResizable = false,\n ...props\n },\n ref,\n ) => {\n const theme = useTheme();\n const isNaked = viewType === 'Naked';\n const variantClass = variant === 'elevated' ? 'grid-card-elevated' : '';\n const hasHeader = !!header && !isNaked;\n const colorClass = isNaked ? '' : color ? `grid-card-${color}` : '';\n const nakedClass = isNaked ? 'grid-card-naked' : '';\n const displayClass = contentDisplay === 'grid' ? 'grid-card-content-grid' : '';\n\n const HeaderIcon = header?.icon as OverridableComponent<SvgIconTypeMap<{}, 'svg'>>;\n\n const cardStyle: CSSProperties = {\n position: 'relative',\n cursor: dragLocked ? 'pointer' : 'grab',\n border: noBorder ? '0px' : '',\n height: '100%',\n zoom: `${zoomLevel} !important`,\n ...style,\n ...(color === 'custom' && customColor\n ? ({\n '--grid-card-accent': customColor,\n '--grid-card-accent-light': safeAlpha(customColor, 0.4),\n '--grid-card-accent-dark': safeAlpha(customColor, 0.2),\n } as CSSProperties)\n : {}),\n };\n\n const innerWidth = parseInt(String(style?.height ?? '0'));\n\n const headerElement = header && !isNaked ? (\n renderHeader ? (\n renderHeader(header)\n ) : (\n <div className=\"grid-card-header\">\n <h4 className=\"grid-card-title\">{header.title}</h4>\n {header.icon && (\n <div className=\"grid-card-icon\">\n {typeof header.icon === 'string' ? <i className=\"material-icons\">{header.icon}</i> : <HeaderIcon fontSize=\"small\" sx={{ fontSize: '16px' }} />}\n </div>\n )}\n </div>\n )\n ) : null;\n\n const errorFallback = (err: Error) => (\n <div\n className=\"grid-card-error\"\n style={{\n border: `1px solid ${theme.palette.error.main}`,\n borderRadius: 6,\n padding: '12px 16px',\n margin: '8px 0',\n height: '95%',\n backgroundColor: alpha(theme.palette.error.main, 0.06),\n }}\n >\n <div style={{ color: theme.palette.error.main, fontSize: '0.85em', fontWeight: 500, marginBottom: 6 }}>Card render error: {err.message}</div>\n </div>\n );\n\n const contentClasses = [isNaked ? 'grid-card-content-naked' : 'grid-card-content', displayClass, contentClassName].filter(Boolean).join(' ');\n\n return (\n <>\n {htmlStyle && <style>{htmlStyle}</style>}\n\n <div\n ref={ref}\n style={cardStyle}\n className={`${isResizable ? 'grid-card' : 'grid-card-nohandle'} ds-card ${variantClass} ${colorClass} ${nakedClass} ${hasHeader ? 'grid-card-with-header' : ''} ${className ?? ''}`.trim()}\n onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\n onTouchEnd={onTouchEnd}\n {...props}\n >\n {/* Flex column: pinned header slot + a content area that owns the scroll boundary\n (`flex: 1; min-height: 0`), so `height: 100%` inside children resolves to the\n content area and not header + content. */}\n <div style={{ paddingLeft: `${innerWidth * (1 - zoomLevel)}px`, zoom: zoomLevel, height: 'inherit', width: 'inherit', display: 'flex', flexDirection: 'column' }}>\n {headerElement && <div style={{ flexShrink: 0 }}>{headerElement}</div>}\n <div className={contentClasses} style={{ alignItems: 'center', flex: 1, minHeight: 0, overflow: 'hidden', ...contentStyle }}>\n <ChartContextProvider value={{ naked: isNaked }}>\n <BiErrorBoundary fallback={errorFallback}>{children}</BiErrorBoundary>\n </ChartContextProvider>\n </div>\n {isNaked && <div className=\"grid-card-naked-resize-handle\" aria-hidden=\"true\" />}\n </div>\n {isNaked && <div className=\"grid-card-naked-resize-handle\" aria-hidden=\"true\" />}\n </div>\n </>\n );\n },\n);\n\nGridCard.displayName = 'GridCard';\n\nfunction safeAlpha(color: string, a: number): string {\n try {\n return alpha(color, a);\n } catch {\n return color;\n }\n}\n\nexport default GridCard;\n","import type { Layout } from 'react-grid-layout';\nimport type { GridConfig } from './gridModels';\n\nexport type { CellConfig, RowConfig, GridConfig } from './gridModels';\n\n/** Breakpoint names supported by the grid */\nexport type BreakpointName = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';\n\n/** Responsive grid configuration — a GridConfig per breakpoint */\nexport interface ResponsiveGridConfig {\n lg?: GridConfig;\n md?: GridConfig;\n sm?: GridConfig;\n xs?: GridConfig;\n xxs?: GridConfig;\n rowMultipler?: number;\n}\n\n/** Responsive layouts (native react-grid-layout format) */\nexport type ResponsiveLayouts = {\n [K in BreakpointName]?: Layout;\n};\n\nexport const DEFAULT_BREAKPOINTS: Record<BreakpointName, number> = {\n lg: 920,\n md: 600,\n sm: 400,\n xs: 400,\n xxs: 0,\n};\n\nexport const DEFAULT_COLS: Record<BreakpointName, number> = { lg: 12, md: 9, sm: 4, xs: 4, xxs: 4 };\n\nexport const DEFAULT_ROW_HEIGHT = 20;\nexport const DEFAULT_ROW_MULTIPLIER = 3;\nexport const DEFAULT_MAX_ROWS = 36;\n","import React, { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { ReactGridLayout, Responsive, useContainerWidth } from \"react-grid-layout\";\nimport { gridBounds, minMaxSize } from \"react-grid-layout/core\";\nimport type {\n Layout,\n LayoutItem,\n ResponsiveLayouts as RGLResponsiveLayouts,\n} from \"react-grid-layout\";\nimport type { LayoutConstraint } from \"react-grid-layout/core\";\nimport type {\n GridConfig,\n ResponsiveGridConfig,\n ResponsiveLayouts,\n BreakpointName,\n} from \"./types\";\nimport {\n DEFAULT_BREAKPOINTS,\n DEFAULT_COLS,\n DEFAULT_MAX_ROWS,\n DEFAULT_ROW_HEIGHT,\n DEFAULT_ROW_MULTIPLIER,\n} from \"./types\";\nimport type { AutoResponsiveStrategy } from \"./useGridConfigTranslator\";\n\nimport './GridLayout.css';\n\n/**\n * Props for the GridLayout component\n */\nexport interface GridLayoutProps {\n /**\n * Grid configuration abstraction (rows/cells)\n * Used to generate the initial layout\n */\n config?: GridConfig | ResponsiveGridConfig;\n\n /**\n * Optional override layouts (native format)\n * When provided, these are used instead of translating config\n * Use this for persisted user modifications\n */\n layouts?: Layout | ResponsiveLayouts;\n\n /**\n * Whether to automatically generate responsive layouts for different breakpoints.\n * When true (default), a single GridConfig is automatically adapted for all screen sizes.\n * When false, the same layout is used for all breakpoints (only scaled by column count).\n * @default true\n */\n responsive?: boolean;\n\n /**\n * Strategy for auto-responsive layout generation.\n * - \"scale\": Proportionally scale widths (items may become narrow)\n * - \"stack\": Stack items vertically on small screens (full width)\n * - \"hybrid\": Scale for medium screens, stack for small screens (default)\n * Only applies when `responsive` is true and a single GridConfig is provided.\n * @default \"hybrid\"\n */\n autoResponsiveStrategy?: AutoResponsiveStrategy;\n\n dragLocked?: boolean\n\n /**\n * Row height in pixels\n * @default 25\n */\n rowHeight?: number;\n\n /**\n * Row height in pixels\n * @default 50\n */\n rowMultiplier?: number;\n\n /**\n * Breakpoint definitions (name → min-width)\n * @default { lg: 1200, md: 900, sm: 768, xs: 480, xxs: 0 }\n */\n breakpoints?: Record<BreakpointName, number>;\n\n /**\n * Column counts per breakpoint\n * @default { lg: 12, md: 12, sm: 12, xs: 4, xxs: 2 }\n */\n cols?: Record<BreakpointName, number>;\n\n /**\n * Maximum number of rows\n * @default Infinity\n */\n maxRows?: number;\n\n /**\n * Called when layout changes (after drag or resize ends)\n * Only fires when layout actually changed\n */\n onLayoutChange?: (layout: Layout, allLayouts: ResponsiveLayouts) => void;\n\n /**\n * User-driven boundaries. RGL fires these only at the end of a real\n * resize / drag interaction — *not* on prop syncs or layout reflows.\n * Use these (instead of `onLayoutChange`) when the consumer needs a\n * \"the user committed a change\" signal that shouldn't fire when a\n * fresh `layouts` prop comes in from above.\n */\n onResizeStop?: (\n layout: Layout,\n oldItem: LayoutItem | null,\n newItem: LayoutItem | null,\n ) => void;\n onDragStop?: (\n layout: Layout,\n oldItem: LayoutItem | null,\n newItem: LayoutItem | null,\n ) => void;\n\n /**\n * Children components (must have key prop matching cell keys)\n */\n children: React.ReactNode;\n\n zoomLevel?: number;\n\n /**\n * Additional class name for the container\n */\n className?: string;\n\n /**\n * Additional styles for the container\n */\n style?: React.CSSProperties;\n\n onDrop?: (data: any, item?: LayoutItem) => void;\n\n manualWidth?: number\n\n /**\n * Row-aware resize.\n *\n * When configured, dragging a card's resize handle adjusts the height\n * of every \"row sibling\" — items whose top edge (`y`) matches the\n * resized item's `y` — together. The width of the resized item is\n * unaffected, and so are widths/heights of any items NOT in the row.\n *\n * - Pass `true` for the default policy: a modifier (Shift) must be\n * held to opt into row-aware behaviour for a given drag.\n * - Pass an object to invert the default (`defaultOn: true` makes\n * row-aware the no-modifier behaviour and the modifier turns it\n * OFF for that drag) and/or to pick a different modifier key.\n * - Pass `false` (or omit the prop) to disable entirely.\n */\n rowAwareResize?: boolean | RowAwareResizeConfig;\n}\n\nexport interface RowAwareResizeConfig {\n /** Master switch. Defaults to `true` when this object is supplied. */\n enabled?: boolean;\n /**\n * When `true`, row-aware resize is the DEFAULT and holding the\n * modifier inverts it (i.e. the modifier disables row-aware for that\n * drag). When `false` (default), the user must hold the modifier to\n * opt into row-aware for that drag.\n */\n defaultOn?: boolean;\n /** Modifier key that flips the default behaviour. */\n modifierKey?: 'Shift' | 'Alt' | 'Ctrl' | 'Meta';\n}\n\ninterface NormalisedRowAwareResize {\n enabled: boolean;\n defaultOn: boolean;\n modifierKey: 'Shift' | 'Alt' | 'Ctrl' | 'Meta';\n}\n\nfunction normaliseRowAwareResize(\n cfg: boolean | RowAwareResizeConfig | undefined,\n): NormalisedRowAwareResize {\n if (cfg === true) return { enabled: true, defaultOn: false, modifierKey: 'Shift' };\n if (!cfg) return { enabled: false, defaultOn: false, modifierKey: 'Shift' };\n return {\n enabled: cfg.enabled ?? true,\n defaultOn: cfg.defaultOn ?? false,\n modifierKey: cfg.modifierKey ?? 'Shift',\n };\n}\n\n/**\n * Compare two layouts to check if they are equal\n */\nfunction areLayoutsEqual(a: Layout, b: Layout, _rowMultipler: number, _zoomLevel: number): boolean {\n if (a.length !== b.length) return false;\n\n for (let i = 0; i < a.length; i++) {\n const itemA = a[i];\n const itemB = b.find((item: LayoutItem) => item.i === itemA.i);\n if (!itemB) {\n return false\n }\n if (\n itemA.x !== itemB.x ||\n itemA.y !== itemB.y ||\n itemA.w !== itemB.w ||\n itemA.h !== itemB.h\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * GridLayout component\n *\n * A wrapper around react-grid-layout's Responsive component that accepts\n * a simplified row/cell configuration and translates it to the native format.\n *\n * @example\n * ```tsx\n * const config: GridConfig = {\n * rows: [\n * { height: 1, cells: [{ key: \"header\", width: 12 }] },\n * { height: 3, cells: [\n * { key: \"chart1\", width: 6 },\n * { key: \"chart2\", width: 6 }\n * ]}\n * ]\n * };\n *\n * <GridLayout config={config} onLayoutChange={handleChange}>\n * <div key=\"header\">Header</div>\n * <div key=\"chart1\">Chart 1</div>\n * <div key=\"chart2\">Chart 2</div>\n * </GridLayout>\n * ```\n */\nexport const GridLayout: React.FC<GridLayoutProps> = ({\n config,\n layouts,\n responsive = true,\n autoResponsiveStrategy: _autoResponsiveStrategy = \"scale\",\n rowHeight = DEFAULT_ROW_HEIGHT,\n rowMultiplier = DEFAULT_ROW_MULTIPLIER,\n breakpoints = DEFAULT_BREAKPOINTS,\n cols = DEFAULT_COLS,\n zoomLevel = 0.98,\n maxRows = DEFAULT_MAX_ROWS,\n dragLocked = false,\n onLayoutChange,\n \n onResizeStop,\n onDragStop,\n onDrop,\n manualWidth,\n children,\n className,\n rowAwareResize,\n}) => {\n // The two pass-through callbacks come straight from RGL's own\n // resize-stop / drag-stop events. We unwrap RGL's 6-arg signature\n // (oldItem, newItem, placeholder, e, element) into a leaner shape\n // matching `onLayoutChange` so the consumer doesn't have to know\n // RGL's internals.\n const handleResizeStopPassthrough = useCallback(\n (\n layout: Layout,\n oldItem: LayoutItem | null,\n newItem: LayoutItem | null,\n ) => {\n onResizeStop?.(layout, oldItem, newItem);\n },\n [onResizeStop],\n );\n const handleDragStopPassthrough = useCallback(\n (\n layout: Layout,\n oldItem: LayoutItem | null,\n newItem: LayoutItem | null,\n ) => {\n onDragStop?.(layout, oldItem, newItem);\n },\n [onDragStop],\n );\n const rowAwareCfg = normaliseRowAwareResize(rowAwareResize);\n // Modifier-key state is read globally rather than from the RGL\n // resize event because the constraint API doesn't pass the event\n // through. We listen on `window` so the state is fresh by the time\n // RGL invokes our constraint mid-drag.\n const modifierHeldRef = useRef(false);\n useEffect(() => {\n if (!rowAwareCfg.enabled) return;\n const update = (e: { shiftKey?: boolean; altKey?: boolean; ctrlKey?: boolean; metaKey?: boolean }) => {\n switch (rowAwareCfg.modifierKey) {\n case 'Shift': modifierHeldRef.current = !!e.shiftKey; return;\n case 'Alt': modifierHeldRef.current = !!e.altKey; return;\n case 'Ctrl': modifierHeldRef.current = !!e.ctrlKey; return;\n case 'Meta': modifierHeldRef.current = !!e.metaKey; return;\n }\n };\n const h = update as unknown as EventListener;\n window.addEventListener('keydown', h);\n window.addEventListener('keyup', h);\n window.addEventListener('mousemove', h);\n window.addEventListener('mousedown', h);\n return () => {\n window.removeEventListener('keydown', h);\n window.removeEventListener('keyup', h);\n window.removeEventListener('mousemove', h);\n window.removeEventListener('mousedown', h);\n };\n }, [rowAwareCfg.enabled, rowAwareCfg.modifierKey]);\n\n // Custom constraint that mutates the row siblings' `h` directly on\n // RGL's internal `layoutRef.current` (handed to us as\n // `context.layout`). RGL's `onResize` internal handler immediately\n // afterwards does `layout.map(item => item.i === id ? newItem : item)`\n // — siblings are returned by reference, so our mutations flow into\n // the new layout that gets handed to `compactor.compact` (which\n // clones items, baking the new heights into the next state). This is\n // the only path that survives RGL 2.x's prop-sync drag bail-out:\n // we're working WITH RGL's state pipeline, not feeding it from props.\n const rowAwareConstraint = useMemo<LayoutConstraint>(() => ({\n name: 'rowAwareResize',\n constrainSize(item, w, h, _handle, context) {\n if (!rowAwareCfg.enabled) return { w, h };\n const modifierHeld = modifierHeldRef.current;\n const shouldApply = rowAwareCfg.defaultOn ? !modifierHeld : modifierHeld;\n if (!shouldApply) return { w, h };\n const rowY = item.y ?? 0;\n for (const sibling of context.layout) {\n if (sibling.i === item.i) continue;\n if ((sibling.y ?? 0) !== rowY) continue;\n (sibling as { h: number }).h = h;\n }\n // Dragged item itself unchanged — RGL applies our returned\n // (w, h) as-is to it.\n return { w, h };\n },\n }), [rowAwareCfg.enabled, rowAwareCfg.defaultOn]);\n\n // RGL replaces its built-in defaults wholesale when `constraints` is\n // passed, so we explicitly bundle them in. When row-aware is\n // disabled we hand back `undefined` so RGL keeps its own defaults.\n const mergedConstraints = useMemo<LayoutConstraint[] | undefined>(() => {\n if (!rowAwareCfg.enabled) return undefined;\n return [gridBounds, minMaxSize, rowAwareConstraint];\n }, [rowAwareCfg.enabled, rowAwareConstraint]);\n const { width, containerRef, mounted } = useContainerWidth();\n const newWidth = manualWidth ?? (width);\n\n zoomLevel = zoomLevel ? zoomLevel * 0.95 : 0.98 * 0.95;\n\n // Last layouts we handed to RGL / received back from it, in *zoomed*\n // space. We compare incoming `onLayoutChange` payloads against this in\n // the same coordinate space so structurally-identical layouts dedupe\n // cleanly — without this the upward emission and the parent's\n // re-feeding form a loop.\n const lastRGLLayoutRef = useRef<ResponsiveLayouts | null>(null);\n\n if (config)\n config.rowMultipler = rowMultiplier ?? 1;\n\n // Pass-through. We used to multiply `h` by `unZoomLevel` here to\n // reverse the per-item h-scaling done in the effect — but that\n // scaling was redundant (the CSS `zoom: zoomLevel` on the wrapper\n // div already shrinks the rendered grid visually) AND the\n // round-trip was lossy due to rounding:\n // 6 → round(6*0.76)=5 → round(5*1.316)=7\n // so every store write came back with `h=7` instead of `h=6`,\n // which then re-zoomed to `h=5`, and any emit RGL fired (e.g.\n // collision compaction on a second card) ping-ponged forever\n // because the h field was effectively non-deterministic.\n //\n // Returning the layouts unchanged makes the round-trip identity:\n // whatever RGL hands us is what we send to the parent, and the\n // parent's next render feeds the exact same values back. RGL\n // settles in one cycle.\n const unZoomLayout = useCallback((internal: Layout | ResponsiveLayouts): ResponsiveLayouts => {\n const incoming: ResponsiveLayouts = Array.isArray(internal)\n ? ({ lg: internal, md: internal, sm: internal, xs: internal, xxs: internal } as ResponsiveLayouts)\n : (internal as ResponsiveLayouts);\n\n const result: ResponsiveLayouts = {} as ResponsiveLayouts;\n for (const bp of Object.keys(incoming) as BreakpointName[]) {\n const layout = incoming[bp];\n if (!layout) continue;\n // Spread each item so the parent gets a fresh object it can\n // mutate without aliasing back into our refs.\n result[bp] = layout.map((item) => ({ ...item }));\n }\n return result;\n }, []);\n\n\n // Translate config to layouts (memoized)\n // const translatedLayouts = useMemo(() => {\n // if (!config) return;\n\n // // If it's a simple GridConfig (has rows)\n // if (\"rows\" in config) {\n // const gridConfig = config as GridConfig;\n\n // if (responsive) {\n // // Auto-generate responsive layouts for all breakpoints\n // const translated = translateGridConfigAutoResponsive(\n // gridConfig,\n // cols,\n // autoResponsiveStrategy\n // );\n\n // return translated;\n // } else {\n // // Use same layout for all breakpoints (just scaled by cols)\n // return translateResponsiveGridConfig({ lg: gridConfig }, cols);\n // }\n // }\n\n // // Otherwise it's a ResponsiveGridConfig - use as-is\n // return translateResponsiveGridConfig(config as ResponsiveGridConfig, cols);\n // }, [config, cols, responsive, autoResponsiveStrategy]);\n\n if (responsive) {\n if (Array.isArray(layouts)) {\n layouts = {\n \"lg\": [...layouts] as Layout,\n \"md\": [...layouts] as Layout,\n \"sm\": [...layouts] as Layout,\n \"xs\": [...layouts] as Layout,\n \"xxs\": [...layouts] as Layout,\n } as ResponsiveLayouts;\n }\n }\n\n\n\n // Wrap the incoming layouts into a ResponsiveLayouts during render\n // (NOT inside a useEffect that calls setActiveLayouts). The\n // previous implementation lagged by one render: the effect set\n // `activeLayouts` *after* RGL had already rendered with the stale\n // value, so when the parent added a card RGL's children-prop saw\n // the new card while RGL's `propsLayout` was still the previous\n // render's. RGL's `synchronizeLayoutWithChildren` then created a\n // default placeholder ({w:1, h:1}) for the missing item and\n // emitted it back upward, which the parent wrote into the store,\n // which fed back as the new `propsLayout` — but by then RGL's\n // internal state was already (1,1), so it bounced to the new\n // (4,6) on the next render. Forever.\n //\n // Computing this with `useMemo` makes `activeLayouts` available\n // synchronously in the same render as the new `layouts` prop,\n // eliminating the one-render lag.\n const activeLayouts = useMemo<ResponsiveLayouts | null>(() => {\n if (!layouts) return null;\n if (Array.isArray(layouts)) {\n return {\n lg: layouts,\n md: layouts,\n sm: layouts,\n xs: layouts,\n xxs: layouts,\n } as ResponsiveLayouts;\n }\n return layouts as ResponsiveLayouts;\n }, [layouts]);\n\n // Sync the dedup baseline during render — refs can be safely\n // updated here (they don't trigger renders) and this guarantees\n // that when RGL fires `onLayoutChange` from one of its effects,\n // our handler compares against the SAME layout we just handed it,\n // not a stale value from the previous render.\n if (activeLayouts) {\n lastRGLLayoutRef.current = activeLayouts;\n }\n\n const handleDrop = (_layout: Layout, item?: LayoutItem, e?: Event) => {\n if (!onDrop) return;\n\n const dragEvent = e as unknown as React.DragEvent | undefined;\n const strData = dragEvent?.dataTransfer.getData(\"text/json\");\n let objData = null;\n if (strData) {\n objData = JSON.parse(strData);\n }\n onDrop(objData, item)\n }\n\n // Capture row-aware intent at the moment the resize finishes. RGL\n // fires `onResizeStop` BEFORE its `onLayoutChange`, so we record the\n // row's `y` and the new `h` here and apply the cascade to siblings\n // when `handleLayoutChange` runs immediately after.\n //\n // The modifier-key state is read directly off the native event RGL\n // hands us. If row-aware mode is configured as `defaultOn`, holding\n // the modifier *disables* the cascade for that drag; otherwise the\n // modifier is required to enable it. When the active policy doesn't\n // ask for row-aware on this drag, we leave `pendingRowAwareRef` null\n // and the layout flows through unchanged.\n // Handle layout change - only emit when layout actually changed.\n //\n // Comparison is done in *zoomed* (RGL-output) space, against the last\n // zoomed layouts we sent to or received from RGL. This is critical:\n // the previous implementation compared zoomed-vs-unzoomed, so equal\n // layouts always read as different and fed an upward emission on\n // every render — which, when the parent writes back into the store\n // and re-feeds `layouts`, closes a render loop.\n const handleLayoutChange = useCallback(\n (currentLayout: Layout, allLayouts?: RGLResponsiveLayouts<BreakpointName>) => {\n if (!onLayoutChange) return;\n\n // Row-aware cascade is applied INSIDE RGL via the\n // `rowAwareConstraint` above (pluggable constraints API), so\n // the layout RGL hands us here already has every row sibling\n // at the new height. Nothing extra to do at this boundary.\n const incoming: ResponsiveLayouts = (allLayouts ?? { lg: currentLayout }) as ResponsiveLayouts;\n\n const last = lastRGLLayoutRef.current;\n\n // Same-space comparison. If we have a baseline and every\n // breakpoint matches, this is a no-op — bail before touching\n // any state.\n if (last) {\n let hasChanged = false;\n for (const bp of Object.keys(incoming) as BreakpointName[]) {\n const newLayout = incoming[bp];\n const oldLayout = last[bp];\n if (!newLayout || !oldLayout) continue;\n if (!areLayoutsEqual(newLayout, oldLayout, config?.rowMultipler ?? 1, zoomLevel)) {\n hasChanged = true;\n break;\n }\n }\n if (!hasChanged) return;\n }\n\n // Update baseline in zoomed space *before* unzooming, so any\n // re-render triggered by the parent's response sees a\n // consistent ref.\n lastRGLLayoutRef.current = incoming;\n\n // Unzoom for the parent — restores the original `h` values\n // RGL scaled down for the visual zoom.\n const unzoomed = unZoomLayout(incoming);\n onLayoutChange(unzoomed[\"lg\"]!, unzoomed as ResponsiveLayouts);\n },\n [onLayoutChange, unZoomLayout, config?.rowMultipler, zoomLevel]\n );\n\n if (!activeLayouts) return null;\n\n for (const key of Object.keys(activeLayouts) as BreakpointName[]) {\n const bp = activeLayouts[key];\n\n if(bp) {\n bp.forEach(c => {\n c.isDraggable = !dragLocked;\n c.isResizable = !dragLocked;\n });\n }\n }\n\n\n return (\n <div\n ref={containerRef as React.RefObject<HTMLDivElement>}\n className={className}\n style={{ minHeight: \"100%\", paddingBottom: '200px', minWidth: '100%', paddingLeft: `${(1 - (zoomLevel)) / 2 * 100}%`, zoom: zoomLevel, overflow: 'auto' }}\n >\n {mounted &&\n responsive ?\n <Responsive\n onDrop={handleDrop}\n dropConfig={{\n enabled: !dragLocked,\n defaultItem: {\n h: 2,\n w: 2\n },\n }}\n dragConfig={{\n enabled: !dragLocked\n }}\n layouts={{ ...activeLayouts } as ResponsiveLayouts}\n breakpoints={breakpoints}\n cols={cols}\n rowHeight={rowHeight}\n maxRows={(maxRows ?? 24) * (config?.rowMultipler ?? 1)}\n width={newWidth}\n containerPadding={[0, 0]}\n\n onLayoutChange={handleLayoutChange}\n onResizeStop={handleResizeStopPassthrough}\n onDragStop={handleDragStopPassthrough}\n constraints={mergedConstraints}\n >\n {children}\n </Responsive>\n : <ReactGridLayout\n onDrop={handleDrop}\n dropConfig={{\n enabled: !dragLocked,\n defaultItem: {\n h: 1,\n w: 3\n },\n }}\n gridConfig={{ cols: 12, rowHeight: rowHeight, maxRows: 100, containerPadding: [0, 0], margin: [0, 2] }}\n dragConfig={{\n enabled: !dragLocked,\n bounded: true,\n }}\n\n layout={activeLayouts[\"lg\"] as Layout}\n autoSize={true}\n width={newWidth}\n onLayoutChange={handleLayoutChange}\n onResizeStop={handleResizeStopPassthrough}\n onDragStop={handleDragStopPassthrough}\n constraints={mergedConstraints}\n >\n {children}\n </ReactGridLayout>\n\n }\n </div >\n );\n};\n\nexport default GridLayout;\n"],"names":["_BiErrorBoundary","React","__publicField","error","info","_b","_a","prev","__name","BiErrorBoundary","GridCard","forwardRef","style","htmlStyle","className","onMouseDown","onMouseUp","onTouchEnd","children","variant","viewType","header","renderHeader","dragLocked","noBorder","color","zoomLevel","customColor","contentDisplay","contentStyle","contentClassName","isResizable","props","ref","theme","useTheme","isNaked","variantClass","hasHeader","colorClass","nakedClass","displayClass","HeaderIcon","cardStyle","safeAlpha","innerWidth","headerElement","jsxs","jsx","errorFallback","err","alpha","contentClasses","Fragment","ChartContextProvider","a","DEFAULT_BREAKPOINTS","DEFAULT_COLS","DEFAULT_ROW_HEIGHT","DEFAULT_ROW_MULTIPLIER","DEFAULT_MAX_ROWS","normaliseRowAwareResize","cfg","areLayoutsEqual","b","_rowMultipler","_zoomLevel","i","itemA","itemB","item","GridLayout","config","layouts","responsive","_autoResponsiveStrategy","rowHeight","rowMultiplier","breakpoints","cols","maxRows","onLayoutChange","onResizeStop","onDragStop","onDrop","manualWidth","rowAwareResize","handleResizeStopPassthrough","useCallback","layout","oldItem","newItem","handleDragStopPassthrough","rowAwareCfg","modifierHeldRef","useRef","useEffect","h","e","rowAwareConstraint","useMemo","w","_handle","context","modifierHeld","rowY","sibling","mergedConstraints","gridBounds","minMaxSize","width","containerRef","mounted","useContainerWidth","newWidth","lastRGLLayoutRef","unZoomLayout","internal","incoming","result","bp","activeLayouts","handleDrop","_layout","dragEvent","strData","objData","handleLayoutChange","currentLayout","allLayouts","last","hasChanged","newLayout","oldLayout","unzoomed","key","c","Responsive","ReactGridLayout"],"mappings":";;;;;;;;;;AAmBO,MAAMA,IAAN,MAAMA,UAAwBC,GAAM,UAAuC;AAAA,EAA3E;AAAA;AACH,IAAAC,EAAA,eAAe,EAAE,OAAO,KAAA;AAAA;AAAA,EAExB,OAAO,yBAAyBC,GAAqB;AACjD,WAAO,EAAE,OAAAA,EAAA;AAAA,EACb;AAAA,EAEA,kBAAkBA,GAAcC,GAA6B;;AACzD,KAAAC,KAAAC,IAAA,KAAK,OAAM,YAAX,QAAAD,EAAA,KAAAC,GAAqBH,GAAOC;AAAA,EAChC;AAAA,EAEA,mBAAmBG,GAAkC;AACjD,IAAI,KAAK,MAAM,SAASA,EAAK,aAAa,KAAK,MAAM,YACjD,KAAK,SAAS,EAAE,OAAO,KAAA,CAAM;AAAA,EAErC;AAAA,EAEA,SAA0B;AACtB,WAAI,KAAK,MAAM,QAAc,KAAK,MAAM,SAAS,KAAK,MAAM,KAAK,IAC1D,KAAK,MAAM;AAAA,EACtB;AACJ;AArBkFC,EAAAR,GAAA;AAA3E,IAAMS,IAANT;ACsCA,MAAMU,KAAWC;AAAA,EACpB,CACI;AAAA,IACI,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,aAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,GAAGC;AA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;AAAA,UAEJ,YAAY,EAAE,MAAM,IAAI,WAAAqD,GAAsB,SAAS,KAAK,kBAAkB,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAA;AAAA,UACnG,YAAY;AAAA,YACR,SAAS,CAACrD;AAAA,YACV,SAAS;AAAA,UAAA;AAAA,UAGb,QAAQkG,EAAc;AAAA,UACtB,UAAU;AAAA,UACV,OAAOP;AAAA,UACP,gBAAgBa;AAAA,UAChB,cAAcxC;AAAA,UACd,YAAYK;AAAA,UACZ,aAAae;AAAA,UAEZ,UAAAzF;AAAA,QAAA;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAKhB,GArYqD;"}
|
package/dist/index-BYc79sSy.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
var M = Object.defineProperty;
|
|
2
|
-
var o = (e, n) => M(e, "name", { value: n, configurable: !0 });
|
|
3
|
-
import { jsx as i, jsxs as t, Fragment as N } from "react/jsx-runtime";
|
|
4
|
-
import { useCallback as S } from "react";
|
|
5
|
-
import { Box as x, Paper as C, Typography as y, Tooltip as I, IconButton as z, Stack as q } from "@mui/material";
|
|
6
|
-
import F from "@mui/icons-material/SettingsOverscan";
|
|
7
|
-
import { u as $, e as j } from "./BiClientProvider-CWJochvi.js";
|
|
8
|
-
import P from "@mui/icons-material/TrendingUp";
|
|
9
|
-
import B from "@mui/icons-material/TrendingDown";
|
|
10
|
-
import T from "@mui/icons-material/TrendingFlat";
|
|
11
|
-
import { u as V } from "./createBiTheme-TyUv_UHM.js";
|
|
12
|
-
const _ = /* @__PURE__ */ o(({ src: e, name: n, reasoning: a, alt: c, naked: m, sessionId: d, dashboardId: f, id: l, onExpand: r }) => {
|
|
13
|
-
const u = $(), g = j(), p = { sessionId: d ?? g, dashboardId: f }, b = u.artifactUrl(e, p), h = S(() => {
|
|
14
|
-
r ? r({ src: e, url: b, name: n, reasoning: a }) : typeof window < "u" && window.open(b, "_blank", "noopener");
|
|
15
|
-
}, [r, e, b, n, a]), v = /* @__PURE__ */ i(
|
|
16
|
-
"img",
|
|
17
|
-
{
|
|
18
|
-
src: b,
|
|
19
|
-
alt: c ?? n ?? "",
|
|
20
|
-
title: a,
|
|
21
|
-
onClick: h,
|
|
22
|
-
style: { maxWidth: "100%", maxHeight: 480, width: "auto", height: "auto", objectFit: "scale-down", display: "block", cursor: "zoom-in", borderRadius: "var(--bi-radius)" }
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
return m ? /* @__PURE__ */ i(x, { id: l, sx: { position: "relative", width: "100%", my: 1 }, children: v }) : /* @__PURE__ */ t(C, { id: l, variant: "outlined", className: "bi-chart", sx: { position: "relative", my: 2, p: 1, bgcolor: "background.paper", borderColor: "divider", minHeight: 120 }, children: [
|
|
26
|
-
/* @__PURE__ */ t(x, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 0.5, minHeight: 32 }, children: [
|
|
27
|
-
/* @__PURE__ */ i(y, { variant: "overline", color: "text.secondary", sx: { letterSpacing: 0.6, lineHeight: 1.4, pl: 0.5 }, children: n ?? "" }),
|
|
28
|
-
/* @__PURE__ */ i(I, { title: "Expandir", children: /* @__PURE__ */ i(z, { size: "small", onClick: h, "aria-label": "Expandir gráfico", "data-src": e, children: /* @__PURE__ */ i(F, { fontSize: "small" }) }) })
|
|
29
|
-
] }),
|
|
30
|
-
/* @__PURE__ */ i(x, { sx: { display: "flex", justifyContent: "center" }, children: v })
|
|
31
|
-
] });
|
|
32
|
-
}, "Chart");
|
|
33
|
-
function k(e) {
|
|
34
|
-
if (!e) return { prefix: void 0, suffix: void 0, number: void 0 };
|
|
35
|
-
const n = /[$%(\w?$)]/gi, a = /[a-z]?\$/gi;
|
|
36
|
-
let c = "", m = "";
|
|
37
|
-
if (e.match(n)) {
|
|
38
|
-
e.indexOf("%") > -1 && (m = " %");
|
|
39
|
-
const l = e.match(a);
|
|
40
|
-
l && (c = l[0] + " ");
|
|
41
|
-
}
|
|
42
|
-
let d = parseFloat(e);
|
|
43
|
-
if (!isNaN(d))
|
|
44
|
-
return e = e.replaceAll(".", "").replaceAll(",", "."), { prefix: c, suffix: m, number: parseFloat(e) };
|
|
45
|
-
let f = "";
|
|
46
|
-
for (const l of e)
|
|
47
|
-
if (l.match(/[0-9.,]/)) {
|
|
48
|
-
let r = l;
|
|
49
|
-
r === "." ? r = "" : r === "," && (r = "."), f += r;
|
|
50
|
-
}
|
|
51
|
-
return d = parseFloat(f), isNaN(d) ? { prefix: void 0, suffix: void 0, number: void 0 } : { prefix: c, suffix: m, number: d };
|
|
52
|
-
}
|
|
53
|
-
o(k, "parseKnownNumbers");
|
|
54
|
-
const w = /* @__PURE__ */ o((e) => {
|
|
55
|
-
if (!e) return /* @__PURE__ */ i("span", { children: "N/A" });
|
|
56
|
-
const n = Math.abs(e);
|
|
57
|
-
return n >= 1e9 ? /* @__PURE__ */ t(N, { children: [
|
|
58
|
-
/* @__PURE__ */ i("span", { children: (e / 1e9).toFixed(2).replace(/\.?0+$/, "") }),
|
|
59
|
-
" ",
|
|
60
|
-
/* @__PURE__ */ i("span", { className: "billion", children: "B" })
|
|
61
|
-
] }) : n >= 1e6 ? /* @__PURE__ */ t(N, { children: [
|
|
62
|
-
/* @__PURE__ */ i("span", { children: (e / 1e6).toFixed(3).replace(/\.?0+$/, "") }),
|
|
63
|
-
/* @__PURE__ */ i("span", { className: "million", children: "M" })
|
|
64
|
-
] }) : n >= 1e3 ? /* @__PURE__ */ t(N, { children: [
|
|
65
|
-
/* @__PURE__ */ i("span", { children: (e / 1e3).toFixed(2).replace(/\.?0+$/, "") }),
|
|
66
|
-
/* @__PURE__ */ i("span", { className: "thousand", children: "K" })
|
|
67
|
-
] }) : /* @__PURE__ */ i("span", { children: e.toString() });
|
|
68
|
-
}, "formatValue"), H = /* @__PURE__ */ o((e, n) => {
|
|
69
|
-
if (e = e ?? 0, n = n ?? 0, !n) return { percentage: 0, trend: "flat" };
|
|
70
|
-
const a = (e - n) / n * 100, c = a > 0 ? "up" : a < 0 ? "down" : "flat";
|
|
71
|
-
return { percentage: Math.abs(a), trend: c };
|
|
72
|
-
}, "calculateDelta"), A = /* @__PURE__ */ o((e) => {
|
|
73
|
-
const n = V(), a = /* @__PURE__ */ o((s) => s === "up" ? n.positive : s === "down" ? n.negative : n.neutral, "trendColor"), c = /* @__PURE__ */ o((s) => s === "up" ? /* @__PURE__ */ i(P, { fontSize: "small" }) : s === "down" ? /* @__PURE__ */ i(B, { fontSize: "small" }) : /* @__PURE__ */ i(T, { fontSize: "small" }), "trendIcon"), m = /* @__PURE__ */ o((s) => s === "up" ? "+" : s === "down" ? "-" : "", "trendPrefix"), d = /* @__PURE__ */ o((s) => s === "up" ? "kpi-change-up" : s === "down" ? "kpi-change-down" : "kpi-change-flat", "trendClass"), { prefix: f, suffix: l, number: r } = k(e.currentValue), { prefix: u, suffix: g, number: p } = k(e.previousValue), { percentage: b, trend: h } = H(r, p), v = e.partial ? "-nohover" : "";
|
|
74
|
-
return /* @__PURE__ */ t("div", { className: `quick-stat${v}`, children: [
|
|
75
|
-
e.icon && /* @__PURE__ */ i("div", { className: "quick-stat-icon kpi", children: /* @__PURE__ */ i("i", { className: "material-icons", children: e.icon }) }),
|
|
76
|
-
/* @__PURE__ */ t("div", { className: "quick-stat-content", children: [
|
|
77
|
-
/* @__PURE__ */ t("div", { className: "quick-stat-value", children: [
|
|
78
|
-
e.prefix ?? f,
|
|
79
|
-
w(r),
|
|
80
|
-
e.suffix ?? l
|
|
81
|
-
] }),
|
|
82
|
-
e.description && /* @__PURE__ */ i(y, { component: "div", className: "quick-stat-label", variant: "body2", children: e.description }),
|
|
83
|
-
e.previousValue && /* @__PURE__ */ t(q, { direction: "row", spacing: 1, sx: { alignItems: "center" }, children: [
|
|
84
|
-
/* @__PURE__ */ t("div", { className: `kpi-change ${d(h)}`, style: { color: a(h) }, children: [
|
|
85
|
-
m(h),
|
|
86
|
-
c(h),
|
|
87
|
-
e.differenceStyle === "Value" && r != null && p != null ? w(Math.abs(r - p)) : `${b.toFixed(2)}%`
|
|
88
|
-
] }),
|
|
89
|
-
/* @__PURE__ */ t("div", { className: "quick-stat-label", style: { fontStyle: "italic" }, children: [
|
|
90
|
-
u,
|
|
91
|
-
w(p),
|
|
92
|
-
g
|
|
93
|
-
] })
|
|
94
|
-
] })
|
|
95
|
-
] })
|
|
96
|
-
] });
|
|
97
|
-
}, "Metric"), O = /* @__PURE__ */ o((e) => /* @__PURE__ */ t("div", { className: "bi-metric-group", children: [
|
|
98
|
-
e.title && /* @__PURE__ */ t(y, { variant: "overline", color: "text.secondary", sx: { px: 0.5, letterSpacing: 0.6 }, children: [
|
|
99
|
-
e.materialIcon && /* @__PURE__ */ i("i", { className: "material-icons", style: { fontSize: 14, verticalAlign: "middle", marginRight: 4 }, children: e.materialIcon }),
|
|
100
|
-
e.title
|
|
101
|
-
] }),
|
|
102
|
-
/* @__PURE__ */ i("div", { className: "ds-card-body", children: /* @__PURE__ */ i("div", { className: "quick-stats", children: e.children }) }),
|
|
103
|
-
e.footNote && /* @__PURE__ */ i("div", { className: "ds-card-footer", children: /* @__PURE__ */ i("small", { children: e.footNote }) })
|
|
104
|
-
] }), "MetricGroup"), R = /* @__PURE__ */ o(({ id: e, name: n, src: a, sessionId: c, partial: m, height: d = 400, onExpand: f }) => {
|
|
105
|
-
const l = $(), r = j(), u = l.iframeUrl(a, { sessionId: c ?? r }), g = S(() => {
|
|
106
|
-
f ? f({ name: n, url: u }) : typeof window < "u" && window.open(u, "_blank", "noopener");
|
|
107
|
-
}, [f, n, u]);
|
|
108
|
-
return /* @__PURE__ */ t(C, { id: e, variant: "outlined", className: `bi-iframe${m ? " bi-iframe-partial" : ""}`, sx: { position: "relative", my: 2, p: 1, bgcolor: "background.paper", borderColor: "divider" }, children: [
|
|
109
|
-
/* @__PURE__ */ t(x, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 0.5 }, children: [
|
|
110
|
-
/* @__PURE__ */ i(y, { variant: "overline", color: "text.secondary", sx: { letterSpacing: 0.6, pl: 0.5 }, children: n }),
|
|
111
|
-
/* @__PURE__ */ i(I, { title: "Expandir", children: /* @__PURE__ */ i(z, { size: "small", onClick: g, "aria-label": "Expandir", "data-src": u, children: /* @__PURE__ */ i(F, { fontSize: "small" }) }) })
|
|
112
|
-
] }),
|
|
113
|
-
/* @__PURE__ */ i(x, { className: "iframe-container", sx: { border: "1px dashed", borderColor: "divider", borderRadius: 1, bgcolor: "action.hover" }, children: /* @__PURE__ */ i("iframe", { title: n, src: u, style: { minHeight: d, width: "100%", border: 0, borderRadius: "var(--bi-radius)" } }) })
|
|
114
|
-
] });
|
|
115
|
-
}, "IFrame"), Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
116
|
-
__proto__: null,
|
|
117
|
-
Chart: _,
|
|
118
|
-
IFrame: R,
|
|
119
|
-
Metric: A,
|
|
120
|
-
MetricGroup: O,
|
|
121
|
-
parseKnownNumbers: k
|
|
122
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
123
|
-
export {
|
|
124
|
-
_ as C,
|
|
125
|
-
R as I,
|
|
126
|
-
A as M,
|
|
127
|
-
O as a,
|
|
128
|
-
Y as b,
|
|
129
|
-
k as p
|
|
130
|
-
};
|
|
131
|
-
//# sourceMappingURL=index-BYc79sSy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-BYc79sSy.js","sources":["../src/inline/Chart.tsx","../src/inline/parseKnownNumbers.ts","../src/inline/Metric.tsx","../src/inline/MetricGroup.tsx","../src/inline/IFrame.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport { Box, IconButton, Paper, Tooltip, Typography } from '@mui/material';\nimport SettingsOverscanIcon from '@mui/icons-material/SettingsOverscan';\nimport { useBiClient, useBiSessionId, type ArtifactUrlScope } from '../client';\n\nexport interface ChartExpandInfo {\n src: string;\n url: string;\n name?: string;\n reasoning?: string;\n}\n\nexport interface ChartProps {\n /** Artifact file name as the tool returned it (e.g. `chart_1.png`). */\n src: string;\n name?: string;\n reasoning?: string;\n alt?: string;\n /** Just the image, no card chrome. */\n naked?: boolean;\n /** Artifact scope; defaults to the `BiClientProvider`'s `sessionId`. */\n sessionId?: string;\n dashboardId?: string;\n id?: string;\n /** Called from the expand affordance. When omitted the image opens in a new tab. */\n onExpand?: (info: ChartExpandInfo) => void;\n}\n\n/**\n * The explorer's chart card: a matplotlib PNG rendered server-side and served\n * as an artifact. The URL comes from the injected `BiClient`\n * (`client.artifactUrl(src, { sessionId, dashboardId })`).\n */\nexport const Chart: React.FC<ChartProps> = ({ src, name, reasoning, alt, naked, sessionId, dashboardId, id, onExpand }) => {\n const client = useBiClient();\n const ambientSession = useBiSessionId();\n const scope: ArtifactUrlScope = { sessionId: sessionId ?? ambientSession, dashboardId };\n const url = client.artifactUrl(src, scope);\n\n const expand = useCallback(() => {\n if (onExpand) onExpand({ src, url, name, reasoning });\n else if (typeof window !== 'undefined') window.open(url, '_blank', 'noopener');\n }, [onExpand, src, url, name, reasoning]);\n\n const img = (\n <img\n src={url}\n alt={alt ?? name ?? ''}\n title={reasoning}\n onClick={expand}\n style={{ maxWidth: '100%', maxHeight: 480, width: 'auto', height: 'auto', objectFit: 'scale-down', display: 'block', cursor: 'zoom-in', borderRadius: 'var(--bi-radius)' }}\n />\n );\n\n if (naked) return <Box id={id} sx={{ position: 'relative', width: '100%', my: 1 }}>{img}</Box>;\n\n return (\n <Paper id={id} variant=\"outlined\" className=\"bi-chart\" sx={{ position: 'relative', my: 2, p: 1, bgcolor: 'background.paper', borderColor: 'divider', minHeight: 120 }}>\n <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 0.5, minHeight: 32 }}>\n <Typography variant=\"overline\" color=\"text.secondary\" sx={{ letterSpacing: 0.6, lineHeight: 1.4, pl: 0.5 }}>\n {name ?? ''}\n </Typography>\n <Tooltip title=\"Expandir\">\n <IconButton size=\"small\" onClick={expand} aria-label=\"Expandir gráfico\" data-src={src}>\n <SettingsOverscanIcon fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n </Box>\n <Box sx={{ display: 'flex', justifyContent: 'center' }}>{img}</Box>\n </Paper>\n );\n};\n\nexport default Chart;\n","/**\n * Splits a formatted figure such as `\"R$ 1.234,56\"` or `\"12,5%\"` into a\n * currency/percent prefix + suffix and a JS number. Mirrors the chat library's\n * `parseKnownNumbers` (`src/utils/stringUtils.ts`), which is not part of its\n * public `@aintela/chat/utils` surface — so it lives here.\n */\nexport function parseKnownNumbers(text?: string): { prefix?: string; suffix?: string; number?: number } {\n if (!text) return { prefix: undefined, suffix: undefined, number: undefined };\n\n const knownChars = /[$%(\\w?$)]/gi;\n const currencySymbol = /[a-z]?\\$/gi;\n\n let prefix = '';\n let suffix = '';\n\n if (text.match(knownChars)) {\n if (text.indexOf('%') > -1) suffix = ' %';\n const match = text.match(currencySymbol);\n if (match) prefix = match[0] + ' ';\n }\n\n let number = parseFloat(text);\n if (!isNaN(number)) {\n text = text.replaceAll('.', '').replaceAll(',', '.');\n return { prefix, suffix, number: parseFloat(text) };\n }\n\n let finalNumber = '';\n for (const char of text) {\n if (char.match(/[0-9.,]/)) {\n let replacedChar = char;\n if (replacedChar === '.') replacedChar = '';\n else if (replacedChar === ',') replacedChar = '.';\n finalNumber += replacedChar;\n }\n }\n\n number = parseFloat(finalNumber);\n if (!isNaN(number)) return { prefix, suffix, number };\n\n return { prefix: undefined, suffix: undefined, number: undefined };\n}\n","import React from 'react';\nimport TrendingUpIcon from '@mui/icons-material/TrendingUp';\nimport TrendingDownIcon from '@mui/icons-material/TrendingDown';\nimport TrendingFlatIcon from '@mui/icons-material/TrendingFlat';\nimport { Stack, Typography } from '@mui/material';\nimport { parseKnownNumbers } from './parseKnownNumbers';\nimport { useBiPalette } from '../theme/createBiTheme';\nimport './inline.css';\n\nexport interface MetricProps {\n preview?: boolean;\n previousValue?: string;\n currentValue: string;\n prefix?: string;\n suffix?: string;\n differenceStyle?: 'Percentage' | 'Value';\n description?: string;\n /** Material Icons ligature name (the host must load the Material Icons font). */\n icon?: string;\n partial?: boolean;\n}\n\nconst formatValue = (value?: number) => {\n if (!value) return <span>N/A</span>;\n const absValue = Math.abs(value);\n if (absValue >= 1e9) return <><span>{(value / 1e9).toFixed(2).replace(/\\.?0+$/, '')}</span> <span className=\"billion\">B</span></>;\n if (absValue >= 1e6) return <><span>{(value / 1e6).toFixed(3).replace(/\\.?0+$/, '')}</span><span className=\"million\">M</span></>;\n if (absValue >= 1e3) return <><span>{(value / 1e3).toFixed(2).replace(/\\.?0+$/, '')}</span><span className=\"thousand\">K</span></>;\n return <span>{value.toString()}</span>;\n};\n\ntype Trend = 'up' | 'down' | 'flat';\n\nconst calculateDelta = (current?: number, previous?: number): { percentage: number; trend: Trend } => {\n current = current ?? 0;\n previous = previous ?? 0;\n if (!previous) return { percentage: 0, trend: 'flat' };\n const percentage = ((current - previous) / previous) * 100;\n const trend: Trend = percentage > 0 ? 'up' : percentage < 0 ? 'down' : 'flat';\n return { percentage: Math.abs(percentage), trend };\n};\n\n/** KPI tile used by `present_metric` / `present_metric_group`. */\nexport const Metric: React.FC<MetricProps> = (props) => {\n const bi = useBiPalette();\n const trendColor = (t: Trend) => (t === 'up' ? bi.positive : t === 'down' ? bi.negative : bi.neutral);\n const trendIcon = (t: Trend) => (t === 'up' ? <TrendingUpIcon fontSize=\"small\" /> : t === 'down' ? <TrendingDownIcon fontSize=\"small\" /> : <TrendingFlatIcon fontSize=\"small\" />);\n const trendPrefix = (t: Trend) => (t === 'up' ? '+' : t === 'down' ? '-' : '');\n const trendClass = (t: Trend) => (t === 'up' ? 'kpi-change-up' : t === 'down' ? 'kpi-change-down' : 'kpi-change-flat');\n\n const { prefix: prefixC, suffix: suffixC, number: numberC } = parseKnownNumbers(props.currentValue);\n const { prefix: prefixP, suffix: suffixP, number: numberP } = parseKnownNumbers(props.previousValue);\n const { percentage, trend } = calculateDelta(numberC, numberP);\n const classNameSuffix = props.partial ? '-nohover' : '';\n\n return (\n <div className={`quick-stat${classNameSuffix}`}>\n {props.icon && (\n <div className=\"quick-stat-icon kpi\">\n <i className=\"material-icons\">{props.icon}</i>\n </div>\n )}\n <div className=\"quick-stat-content\">\n <div className=\"quick-stat-value\">\n {props.prefix ?? prefixC}\n {formatValue(numberC)}\n {props.suffix ?? suffixC}\n </div>\n {props.description && (\n <Typography component=\"div\" className=\"quick-stat-label\" variant=\"body2\">\n {props.description}\n </Typography>\n )}\n {props.previousValue && (\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <div className={`kpi-change ${trendClass(trend)}`} style={{ color: trendColor(trend) }}>\n {trendPrefix(trend)}\n {trendIcon(trend)}\n {props.differenceStyle === 'Value' && numberC != null && numberP != null\n ? formatValue(Math.abs(numberC - numberP))\n : `${percentage.toFixed(2)}%`}\n </div>\n <div className=\"quick-stat-label\" style={{ fontStyle: 'italic' }}>\n {prefixP}\n {formatValue(numberP)}\n {suffixP}\n </div>\n </Stack>\n )}\n </div>\n </div>\n );\n};\n\nexport default Metric;\n","import React from 'react';\nimport { Typography } from '@mui/material';\nimport './inline.css';\n\nexport interface MetricGroupProps {\n children: React.ReactNode;\n title?: string;\n materialIcon?: string;\n footNote?: string;\n partial?: boolean;\n}\n\n/** A row of `Metric` tiles (`present_metric_group`). */\nexport const MetricGroup: React.FC<MetricGroupProps> = (props) => (\n <div className=\"bi-metric-group\">\n {props.title && (\n <Typography variant=\"overline\" color=\"text.secondary\" sx={{ px: 0.5, letterSpacing: 0.6 }}>\n {props.materialIcon && <i className=\"material-icons\" style={{ fontSize: 14, verticalAlign: 'middle', marginRight: 4 }}>{props.materialIcon}</i>}\n {props.title}\n </Typography>\n )}\n <div className=\"ds-card-body\">\n <div className=\"quick-stats\">{props.children}</div>\n </div>\n {props.footNote && (\n <div className=\"ds-card-footer\">\n <small>{props.footNote}</small>\n </div>\n )}\n </div>\n);\n\nexport default MetricGroup;\n","import React, { useCallback } from 'react';\nimport { Box, IconButton, Paper, Tooltip, Typography } from '@mui/material';\nimport SettingsOverscanIcon from '@mui/icons-material/SettingsOverscan';\nimport { useBiClient, useBiSessionId } from '../client';\n\nexport interface IFrameExpandInfo {\n name: string;\n url: string;\n}\n\nexport interface IFrameProps {\n id?: string;\n name: string;\n /** HTML artifact file name (e.g. a folium map). */\n src: string;\n sessionId?: string;\n partial?: boolean;\n height?: number | string;\n /** Called from the expand affordance. When omitted the frame URL opens in a new tab. */\n onExpand?: (info: IFrameExpandInfo) => void;\n}\n\n/** HTML artifact card used by `present_iframe`. URL resolved through the injected `BiClient`. */\nexport const IFrame: React.FC<IFrameProps> = ({ id, name, src, sessionId, partial, height = 400, onExpand }) => {\n const client = useBiClient();\n const ambientSession = useBiSessionId();\n const url = client.iframeUrl(src, { sessionId: sessionId ?? ambientSession });\n\n const expand = useCallback(() => {\n if (onExpand) onExpand({ name, url });\n else if (typeof window !== 'undefined') window.open(url, '_blank', 'noopener');\n }, [onExpand, name, url]);\n\n return (\n <Paper id={id} variant=\"outlined\" className={`bi-iframe${partial ? ' bi-iframe-partial' : ''}`} sx={{ position: 'relative', my: 2, p: 1, bgcolor: 'background.paper', borderColor: 'divider' }}>\n <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 0.5 }}>\n <Typography variant=\"overline\" color=\"text.secondary\" sx={{ letterSpacing: 0.6, pl: 0.5 }}>{name}</Typography>\n <Tooltip title=\"Expandir\">\n <IconButton size=\"small\" onClick={expand} aria-label=\"Expandir\" data-src={url}>\n <SettingsOverscanIcon fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n </Box>\n <Box className=\"iframe-container\" sx={{ border: '1px dashed', borderColor: 'divider', borderRadius: 1, bgcolor: 'action.hover' }}>\n <iframe title={name} src={url} style={{ minHeight: height, width: '100%', border: 0, borderRadius: 'var(--bi-radius)' }} />\n </Box>\n </Paper>\n );\n};\n\nexport default IFrame;\n"],"names":["Chart","__name","src","name","reasoning","alt","naked","sessionId","dashboardId","id","onExpand","client","useBiClient","ambientSession","useBiSessionId","scope","url","expand","useCallback","img","jsx","Box","jsxs","Paper","Typography","Tooltip","IconButton","SettingsOverscanIcon","parseKnownNumbers","text","knownChars","currencySymbol","prefix","suffix","match","number","finalNumber","char","replacedChar","formatValue","value","absValue","Fragment","calculateDelta","current","previous","percentage","trend","Metric","props","bi","useBiPalette","trendColor","t","trendIcon","TrendingUpIcon","TrendingDownIcon","TrendingFlatIcon","trendPrefix","trendClass","prefixC","suffixC","numberC","prefixP","suffixP","numberP","classNameSuffix","Stack","MetricGroup","IFrame","partial","height"],"mappings":";;;;;;;;;;;AAiCO,MAAMA,IAA8B,gBAAAC,EAAA,CAAC,EAAE,KAAAC,GAAK,MAAAC,GAAM,WAAAC,GAAW,KAAAC,GAAK,OAAAC,GAAO,WAAAC,GAAW,aAAAC,GAAa,IAAAC,GAAI,UAAAC,EAAA,MAAe;AACvH,QAAMC,IAASC,EAAA,GACTC,IAAiBC,EAAA,GACjBC,IAA0B,EAAE,WAAWR,KAAaM,GAAgB,aAAAL,EAAA,GACpEQ,IAAML,EAAO,YAAYT,GAAKa,CAAK,GAEnCE,IAASC,EAAY,MAAM;AAC7B,IAAIR,IAAUA,EAAS,EAAE,KAAAR,GAAK,KAAAc,GAAK,MAAAb,GAAM,WAAAC,GAAW,IAC3C,OAAO,SAAW,cAAoB,KAAKY,GAAK,UAAU,UAAU;AAAA,EACjF,GAAG,CAACN,GAAUR,GAAKc,GAAKb,GAAMC,CAAS,CAAC,GAElCe,IACF,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKJ;AAAA,MACL,KAAKX,KAAOF,KAAQ;AAAA,MACpB,OAAOC;AAAA,MACP,SAASa;AAAA,MACT,OAAO,EAAE,UAAU,QAAQ,WAAW,KAAK,OAAO,QAAQ,QAAQ,QAAQ,WAAW,cAAc,SAAS,SAAS,QAAQ,WAAW,cAAc,mBAAA;AAAA,IAAmB;AAAA,EAAA;AAIjL,SAAIX,IAAc,gBAAAc,EAACC,GAAA,EA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