@dashspec/renderer 0.1.29 → 0.1.31
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/CHANGELOG.md +24 -0
- package/dist/{chunk-5QEL4G7I.js → chunk-REHDPS7O.js} +8 -3
- package/dist/chunk-REHDPS7O.js.map +1 -0
- package/dist/{core-DXB9suSF.d.ts → core-BVGHr1UI.d.ts} +20 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.d.ts +15 -4
- package/dist/index.js +63 -46
- package/dist/index.js.map +1 -1
- package/dist/schema.json +3 -0
- package/docs/json-format.md +1 -0
- package/docs/theming.md +7 -1
- package/package.json +1 -1
- package/dist/chunk-5QEL4G7I.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
translator,
|
|
117
117
|
validateDocument,
|
|
118
118
|
widgetChecks
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-REHDPS7O.js";
|
|
120
120
|
import {
|
|
121
121
|
createStateProxy,
|
|
122
122
|
getPath,
|
|
@@ -1808,6 +1808,8 @@ function themeCssVars(theme, mode) {
|
|
|
1808
1808
|
if (s.control?.iconSize) out["--ds-filter-icon-size"] = `${s.control.iconSize}px`;
|
|
1809
1809
|
if (s.control?.stepBackground && !UNSAFE_CSS.test(s.control.stepBackground))
|
|
1810
1810
|
out["--ds-control-step-bg"] = s.control.stepBackground;
|
|
1811
|
+
if (s.control?.iconColor && !UNSAFE_CSS.test(s.control.iconColor))
|
|
1812
|
+
out["--ds-filter-icon-color"] = s.control.iconColor;
|
|
1811
1813
|
if (s.control?.valueColor && !UNSAFE_CSS.test(s.control.valueColor))
|
|
1812
1814
|
out["--ds-control-value-color"] = s.control.valueColor;
|
|
1813
1815
|
if (typeof s.control?.valueWeight === "number") out["--ds-control-value-weight"] = String(s.control.valueWeight);
|
|
@@ -2320,6 +2322,7 @@ import { useCallback as useCallback2, useEffect as useEffect2, useId as useId3,
|
|
|
2320
2322
|
|
|
2321
2323
|
// src/components/controls.tsx
|
|
2322
2324
|
import {
|
|
2325
|
+
useContext as useContext3,
|
|
2323
2326
|
useEffect,
|
|
2324
2327
|
useId as useId2,
|
|
2325
2328
|
useLayoutEffect,
|
|
@@ -2328,7 +2331,7 @@ import {
|
|
|
2328
2331
|
useState
|
|
2329
2332
|
} from "react";
|
|
2330
2333
|
import { createPortal } from "react-dom";
|
|
2331
|
-
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2334
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2332
2335
|
var Chevron = () => /* @__PURE__ */ jsx7("svg", { className: "ds-pill-chev", viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": "true", children: /* @__PURE__ */ jsx7(
|
|
2333
2336
|
"path",
|
|
2334
2337
|
{
|
|
@@ -2340,7 +2343,12 @@ var Chevron = () => /* @__PURE__ */ jsx7("svg", { className: "ds-pill-chev", vie
|
|
|
2340
2343
|
strokeLinejoin: "round"
|
|
2341
2344
|
}
|
|
2342
2345
|
) });
|
|
2343
|
-
var Arrow = ({ dir }) =>
|
|
2346
|
+
var Arrow = ({ dir }) => {
|
|
2347
|
+
const icons = useContext3(DashboardContext)?.options.ui?.icons;
|
|
2348
|
+
const own = dir === "left" ? icons?.previous : icons?.next;
|
|
2349
|
+
return own ? /* @__PURE__ */ jsx7(Fragment3, { children: own }) : /* @__PURE__ */ jsx7(DefaultArrow, { dir });
|
|
2350
|
+
};
|
|
2351
|
+
var DefaultArrow = ({ dir }) => /* @__PURE__ */ jsx7("svg", { viewBox: "0 0 16 16", width: "15", height: "15", "aria-hidden": "true", children: /* @__PURE__ */ jsx7(
|
|
2344
2352
|
"path",
|
|
2345
2353
|
{
|
|
2346
2354
|
d: dir === "left" ? "M13 8H3m4-4L3 8l4 4" : "M3 8h10M9 4l4 4-4 4",
|
|
@@ -3014,7 +3022,7 @@ function DateControl({
|
|
|
3014
3022
|
}
|
|
3015
3023
|
|
|
3016
3024
|
// src/components/FilterBar.tsx
|
|
3017
|
-
import { Fragment as
|
|
3025
|
+
import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3018
3026
|
var PRESET_LABELS = {
|
|
3019
3027
|
today: "Today",
|
|
3020
3028
|
yesterday: "Yesterday",
|
|
@@ -3313,7 +3321,7 @@ var icon = (d) => /* @__PURE__ */ jsx8(
|
|
|
3313
3321
|
);
|
|
3314
3322
|
var BAR_ICONS = {
|
|
3315
3323
|
sliders: icon(
|
|
3316
|
-
/* @__PURE__ */ jsxs6(
|
|
3324
|
+
/* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
3317
3325
|
/* @__PURE__ */ jsx8("path", { d: "M3 6h9M15 6h2M3 14h3M9 14h8" }),
|
|
3318
3326
|
/* @__PURE__ */ jsx8("circle", { cx: "13.5", cy: "6", r: "1.8" }),
|
|
3319
3327
|
/* @__PURE__ */ jsx8("circle", { cx: "7.5", cy: "14", r: "1.8" })
|
|
@@ -3321,13 +3329,13 @@ var BAR_ICONS = {
|
|
|
3321
3329
|
),
|
|
3322
3330
|
filter: icon(/* @__PURE__ */ jsx8("path", { d: "M3 4h14l-5.5 6.5V16l-3-1.5v-4z", strokeLinejoin: "round" })),
|
|
3323
3331
|
calendar: icon(
|
|
3324
|
-
/* @__PURE__ */ jsxs6(
|
|
3332
|
+
/* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
3325
3333
|
/* @__PURE__ */ jsx8("rect", { x: "3", y: "4.5", width: "14", height: "12", rx: "2" }),
|
|
3326
3334
|
/* @__PURE__ */ jsx8("path", { d: "M3 8.5h14M7 2.5v4M13 2.5v4" })
|
|
3327
3335
|
] })
|
|
3328
3336
|
),
|
|
3329
3337
|
search: icon(
|
|
3330
|
-
/* @__PURE__ */ jsxs6(
|
|
3338
|
+
/* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
3331
3339
|
/* @__PURE__ */ jsx8("circle", { cx: "9", cy: "9", r: "5" }),
|
|
3332
3340
|
/* @__PURE__ */ jsx8("path", { d: "M13 13l4 4" })
|
|
3333
3341
|
] })
|
|
@@ -3428,7 +3436,7 @@ function FilterBar() {
|
|
|
3428
3436
|
} : void 0,
|
|
3429
3437
|
children: [
|
|
3430
3438
|
/* @__PURE__ */ jsxs6(Track, { segmented: bar.look === "segmented", children: [
|
|
3431
|
-
bar.icon !== "none" && /* @__PURE__ */ jsx8("span", { className: "ds-filters-icon", "aria-hidden": "true", children: BAR_ICONS[bar.icon ?? "sliders"] ?? BAR_ICONS.sliders }),
|
|
3439
|
+
bar.icon !== "none" && /* @__PURE__ */ jsx8("span", { className: "ds-filters-icon", "aria-hidden": "true", children: options.ui?.icons?.filterBar ?? BAR_ICONS[bar.icon ?? "sliders"] ?? BAR_ICONS.sliders }),
|
|
3432
3440
|
shown.map(
|
|
3433
3441
|
(v) => options.onFilterSelect ? (
|
|
3434
3442
|
// Builder: a click selects the filter to configure it instead of opening it.
|
|
@@ -3557,7 +3565,7 @@ function FilterDrawer({ active, children }) {
|
|
|
3557
3565
|
] });
|
|
3558
3566
|
}
|
|
3559
3567
|
function Track({ segmented, children }) {
|
|
3560
|
-
return segmented ? /* @__PURE__ */ jsx8("div", { className: "ds-filters-track", children }) : /* @__PURE__ */ jsx8(
|
|
3568
|
+
return segmented ? /* @__PURE__ */ jsx8("div", { className: "ds-filters-track", children }) : /* @__PURE__ */ jsx8(Fragment4, { children });
|
|
3561
3569
|
}
|
|
3562
3570
|
|
|
3563
3571
|
// src/widgets/builtins/Filter.tsx
|
|
@@ -3770,7 +3778,7 @@ function InfoTip({ text }) {
|
|
|
3770
3778
|
}
|
|
3771
3779
|
|
|
3772
3780
|
// src/widgets/shared/clickable.ts
|
|
3773
|
-
import { useContext as
|
|
3781
|
+
import { useContext as useContext5 } from "react";
|
|
3774
3782
|
|
|
3775
3783
|
// src/components/PanelFrame.tsx
|
|
3776
3784
|
import { useCallback as useCallback4, useEffect as useEffect4, useId as useId4, useMemo as useMemo3, useRef as useRef5, useState as useState4 } from "react";
|
|
@@ -3830,10 +3838,10 @@ var Boundary = class extends Component {
|
|
|
3830
3838
|
};
|
|
3831
3839
|
|
|
3832
3840
|
// src/components/Slot.tsx
|
|
3833
|
-
import { createContext as createContext3, useContext as
|
|
3834
|
-
import { Fragment as
|
|
3841
|
+
import { createContext as createContext3, useContext as useContext4 } from "react";
|
|
3842
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3835
3843
|
var NodeScopeContext = createContext3({});
|
|
3836
|
-
var useNodeScope = () =>
|
|
3844
|
+
var useNodeScope = () => useContext4(NodeScopeContext);
|
|
3837
3845
|
var SlotOwnerContext = createContext3(null);
|
|
3838
3846
|
var SlotChildContext = createContext3(null);
|
|
3839
3847
|
function slotChildren(def, name) {
|
|
@@ -3851,9 +3859,9 @@ function Slot({
|
|
|
3851
3859
|
empty
|
|
3852
3860
|
}) {
|
|
3853
3861
|
const { options } = useDashboard();
|
|
3854
|
-
const owner =
|
|
3862
|
+
const owner = useContext4(SlotOwnerContext);
|
|
3855
3863
|
const outer = useNodeScope();
|
|
3856
|
-
const renderChild =
|
|
3864
|
+
const renderChild = useContext4(SlotChildContext);
|
|
3857
3865
|
if (!owner || !renderChild) return null;
|
|
3858
3866
|
const ids = slotChildren(owner.def, name);
|
|
3859
3867
|
const editing = options.mode === "edit";
|
|
@@ -3882,7 +3890,7 @@ function Slot({
|
|
|
3882
3890
|
}
|
|
3883
3891
|
) });
|
|
3884
3892
|
}
|
|
3885
|
-
var SlotItem = ({ children }) => /* @__PURE__ */ jsx13(
|
|
3893
|
+
var SlotItem = ({ children }) => /* @__PURE__ */ jsx13(Fragment5, { children });
|
|
3886
3894
|
|
|
3887
3895
|
// src/components/PanelFrame.tsx
|
|
3888
3896
|
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
@@ -4452,7 +4460,7 @@ function LoadingState({ text }) {
|
|
|
4452
4460
|
|
|
4453
4461
|
// src/widgets/shared/clickable.ts
|
|
4454
4462
|
function useClickable(panelId, activate) {
|
|
4455
|
-
const ctx =
|
|
4463
|
+
const ctx = useContext5(DashboardContext);
|
|
4456
4464
|
const def = ctx && panelId ? findPanel(ctx.runtime.doc, panelId) : void 0;
|
|
4457
4465
|
const on = def?.on;
|
|
4458
4466
|
if (on?.click === void 0) return { onClick: activate };
|
|
@@ -4500,7 +4508,7 @@ function useCountUp(target, ms = 700) {
|
|
|
4500
4508
|
}
|
|
4501
4509
|
|
|
4502
4510
|
// src/widgets/builtins/Kpi.tsx
|
|
4503
|
-
import { Fragment as
|
|
4511
|
+
import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4504
4512
|
var Kpi = defineWidget({
|
|
4505
4513
|
...KpiContract,
|
|
4506
4514
|
implements: "kpi",
|
|
@@ -4551,7 +4559,7 @@ var Kpi = defineWidget({
|
|
|
4551
4559
|
children: empty ? (
|
|
4552
4560
|
// No value is not zero: the author's text, else a dash.
|
|
4553
4561
|
/* @__PURE__ */ jsx15("span", { className: "ds-kpi-empty", children: spec.emptyText || "\u2014" })
|
|
4554
|
-
) : /* @__PURE__ */ jsxs11(
|
|
4562
|
+
) : /* @__PURE__ */ jsxs11(Fragment6, { children: [
|
|
4555
4563
|
/* @__PURE__ */ jsxs11(
|
|
4556
4564
|
"span",
|
|
4557
4565
|
{
|
|
@@ -5323,7 +5331,7 @@ var Table = defineWidget({
|
|
|
5323
5331
|
|
|
5324
5332
|
// src/widgets/builtins/Tiles.tsx
|
|
5325
5333
|
import "zod";
|
|
5326
|
-
import { Fragment as
|
|
5334
|
+
import { Fragment as Fragment7, jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5327
5335
|
var Tiles = defineWidget({
|
|
5328
5336
|
...TilesContract,
|
|
5329
5337
|
implements: "tiles",
|
|
@@ -5407,7 +5415,7 @@ var Tiles = defineWidget({
|
|
|
5407
5415
|
return spec.captionInline ? /* @__PURE__ */ jsxs17("span", { className: "ds-tile-main", children: [
|
|
5408
5416
|
valueEl,
|
|
5409
5417
|
capEl
|
|
5410
|
-
] }) : /* @__PURE__ */ jsxs17(
|
|
5418
|
+
] }) : /* @__PURE__ */ jsxs17(Fragment7, { children: [
|
|
5411
5419
|
valueEl,
|
|
5412
5420
|
capEl
|
|
5413
5421
|
] });
|
|
@@ -5425,7 +5433,7 @@ var Tiles = defineWidget({
|
|
|
5425
5433
|
function CountUp({ value, render }) {
|
|
5426
5434
|
const n = toNumber(value);
|
|
5427
5435
|
const shown = useCountUp(n ?? value);
|
|
5428
|
-
return /* @__PURE__ */ jsx22(
|
|
5436
|
+
return /* @__PURE__ */ jsx22(Fragment7, { children: render(n === void 0 ? value : shown) });
|
|
5429
5437
|
}
|
|
5430
5438
|
function tplValue(t, row, helpers) {
|
|
5431
5439
|
try {
|
|
@@ -6045,7 +6053,7 @@ function cartesian(data, source, spec, type, h, colors) {
|
|
|
6045
6053
|
}
|
|
6046
6054
|
|
|
6047
6055
|
// src/widgets/builtins/charts.tsx
|
|
6048
|
-
import { Fragment as
|
|
6056
|
+
import { Fragment as Fragment8, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6049
6057
|
var chartEvents = ["click", "doubleClick", "hover", "hoverEnd", "legendClick", "brush", "datazoom"];
|
|
6050
6058
|
var BarChart2 = defineWidget({
|
|
6051
6059
|
...BarChartContract,
|
|
@@ -6076,7 +6084,7 @@ var BarChart2 = defineWidget({
|
|
|
6076
6084
|
const legend = c.coloured || avgText || c.legend.length > 0;
|
|
6077
6085
|
return /* @__PURE__ */ jsxs19("div", { className: "ds-chart", children: [
|
|
6078
6086
|
legend && /* @__PURE__ */ jsxs19("ul", { className: "ds-chart-legend", children: [
|
|
6079
|
-
c.coloured && /* @__PURE__ */ jsxs19(
|
|
6087
|
+
c.coloured && /* @__PURE__ */ jsxs19(Fragment8, { children: [
|
|
6080
6088
|
/* @__PURE__ */ jsxs19("li", { children: [
|
|
6081
6089
|
/* @__PURE__ */ jsx25("span", { className: "ds-swatch", style: { background: colors?.good } }),
|
|
6082
6090
|
spec.legendLabels?.above ?? "At or above avg"
|
|
@@ -6364,7 +6372,7 @@ var MatrixChart = defineWidget({
|
|
|
6364
6372
|
});
|
|
6365
6373
|
|
|
6366
6374
|
// src/widgets/builtins/layout.tsx
|
|
6367
|
-
import { Fragment as
|
|
6375
|
+
import { Fragment as Fragment9 } from "react";
|
|
6368
6376
|
import "zod";
|
|
6369
6377
|
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6370
6378
|
var Row = defineWidget({
|
|
@@ -6446,7 +6454,7 @@ var Repeater = defineWidget({
|
|
|
6446
6454
|
}) }) : /* @__PURE__ */ jsx26("div", { className: "ds-state", children: spec.emptyText });
|
|
6447
6455
|
return /* @__PURE__ */ jsx26("div", { className: "ds-repeater", style, children: rows.map((row, i) => (
|
|
6448
6456
|
// biome-ignore lint/suspicious/noArrayIndexKey: rows have no guaranteed id
|
|
6449
|
-
/* @__PURE__ */ jsx26(
|
|
6457
|
+
/* @__PURE__ */ jsx26(Fragment9, { children: renderSlot("item", { item: row, index: i, className: "ds-repeater-item" }) }, i)
|
|
6450
6458
|
)) });
|
|
6451
6459
|
}
|
|
6452
6460
|
});
|
|
@@ -6533,6 +6541,7 @@ function Grid({
|
|
|
6533
6541
|
columns,
|
|
6534
6542
|
rowHeight,
|
|
6535
6543
|
gap,
|
|
6544
|
+
exactHeights = false,
|
|
6536
6545
|
children,
|
|
6537
6546
|
editable = false,
|
|
6538
6547
|
onLayoutChange,
|
|
@@ -6559,15 +6568,19 @@ function Grid({
|
|
|
6559
6568
|
return () => ro.disconnect();
|
|
6560
6569
|
}, [wrapEl]);
|
|
6561
6570
|
const base = useMemo7(() => layoutsForView(layouts, view, columns), [layouts, view, columns]);
|
|
6571
|
+
const exact = exactHeights && !editable;
|
|
6572
|
+
const unit = rowHeight + gap;
|
|
6562
6573
|
const { rgl, panels, cols } = useMemo7(() => {
|
|
6563
|
-
|
|
6574
|
+
const scale2 = (l) => exact ? (l ?? []).map((i) => ({ ...i, y: i.y * unit, h: i.h * unit, minH: void 0, maxH: void 0 })) : l ?? [];
|
|
6575
|
+
const scaled = exact ? Object.fromEntries(Object.entries(base.layouts).map(([bp, l]) => [bp, scale2(l)])) : base.layouts;
|
|
6576
|
+
if (!hidden?.size || editable) return { rgl: scaled, panels: base.panels, cols: base.cols };
|
|
6564
6577
|
const keep = (l) => (l ?? []).filter((i) => !hidden.has(i.i));
|
|
6565
6578
|
return {
|
|
6566
|
-
rgl: Object.fromEntries(Object.entries(
|
|
6579
|
+
rgl: Object.fromEntries(Object.entries(scaled).map(([bp, l]) => [bp, keep(l)])),
|
|
6567
6580
|
panels: base.panels.filter((p) => !hidden.has(p)),
|
|
6568
6581
|
cols: base.cols
|
|
6569
6582
|
};
|
|
6570
|
-
}, [base, hidden, editable]);
|
|
6583
|
+
}, [base, hidden, editable, exact, unit]);
|
|
6571
6584
|
const [fitRows, setFitRows] = useState7({});
|
|
6572
6585
|
const fitted = useMemo7(() => {
|
|
6573
6586
|
if (editable || base.fit.size === 0) return rgl;
|
|
@@ -6582,12 +6595,12 @@ function Grid({
|
|
|
6582
6595
|
}
|
|
6583
6596
|
return (l ?? []).map((i) => {
|
|
6584
6597
|
const want = base.fit.has(i.i) ? rowWant.get(i.y) : void 0;
|
|
6585
|
-
return want && want > i.h ? { ...i, h: want } : i;
|
|
6598
|
+
return want && (exact || want > i.h) ? { ...i, h: want } : i;
|
|
6586
6599
|
});
|
|
6587
6600
|
})()
|
|
6588
6601
|
])
|
|
6589
6602
|
);
|
|
6590
|
-
}, [rgl, base.fit, fitRows, editable]);
|
|
6603
|
+
}, [rgl, base.fit, fitRows, editable, exact]);
|
|
6591
6604
|
const observeFit = (panel) => (el) => {
|
|
6592
6605
|
const prev = fitObservers.current.get(panel);
|
|
6593
6606
|
if (prev) {
|
|
@@ -6601,7 +6614,7 @@ function Grid({
|
|
|
6601
6614
|
const px = target2?.offsetHeight ?? 0;
|
|
6602
6615
|
el.removeAttribute("data-measuring");
|
|
6603
6616
|
if (!px) return;
|
|
6604
|
-
const rows = Math.ceil((px + gap) / (rowHeight + gap));
|
|
6617
|
+
const rows = exact ? Math.ceil(px) + gap : Math.ceil((px + gap) / (rowHeight + gap));
|
|
6605
6618
|
setFitRows((r) => {
|
|
6606
6619
|
const cur = r[panel];
|
|
6607
6620
|
if (cur === rows) return r;
|
|
@@ -6664,12 +6677,13 @@ function Grid({
|
|
|
6664
6677
|
return /* @__PURE__ */ jsx27("div", { ref: setWrapEl, children: /* @__PURE__ */ jsx27(
|
|
6665
6678
|
ResponsiveGrid,
|
|
6666
6679
|
{
|
|
6667
|
-
className: editable ? "ds-grid ds-grid-edit" : "ds-grid",
|
|
6680
|
+
className: editable ? "ds-grid ds-grid-edit" : exact ? "ds-grid ds-grid-exact" : "ds-grid",
|
|
6681
|
+
style: exact ? { "--ds-grid-gap": `${gap}px` } : void 0,
|
|
6668
6682
|
layouts: breakpoint ? { [breakpoint]: rgl[breakpoint] ?? [] } : fitted,
|
|
6669
6683
|
breakpoints: breakpoint ? { [breakpoint]: 0 } : BREAKPOINT_MIN,
|
|
6670
6684
|
cols: breakpoint ? { [breakpoint]: cols[breakpoint] } : cols,
|
|
6671
|
-
rowHeight,
|
|
6672
|
-
margin: [gap, gap],
|
|
6685
|
+
rowHeight: exact ? 1 : rowHeight,
|
|
6686
|
+
margin: exact ? [gap, 0] : [gap, gap],
|
|
6673
6687
|
containerPadding: [0, 0],
|
|
6674
6688
|
isDraggable: editable,
|
|
6675
6689
|
isResizable: editable,
|
|
@@ -6852,11 +6866,11 @@ function ModalHost() {
|
|
|
6852
6866
|
}
|
|
6853
6867
|
|
|
6854
6868
|
// src/components/Provider.tsx
|
|
6855
|
-
import { createContext as createContext4, useContext as
|
|
6869
|
+
import { createContext as createContext4, useContext as useContext6, useRef as useRef11 } from "react";
|
|
6856
6870
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
6857
6871
|
var SettingsContext = createContext4({});
|
|
6858
6872
|
function DashSpecProvider({ children, ...settings }) {
|
|
6859
|
-
const outer =
|
|
6873
|
+
const outer = useContext6(SettingsContext);
|
|
6860
6874
|
const last = useRef11(
|
|
6861
6875
|
void 0
|
|
6862
6876
|
);
|
|
@@ -6869,7 +6883,7 @@ function shallowEqual2(a, b) {
|
|
|
6869
6883
|
return ka.length === Object.keys(b).length && ka.every((k) => Object.is(a[k], b[k]));
|
|
6870
6884
|
}
|
|
6871
6885
|
function useDashSpecSettings() {
|
|
6872
|
-
return
|
|
6886
|
+
return useContext6(SettingsContext);
|
|
6873
6887
|
}
|
|
6874
6888
|
var LISTS = ["designSystems", "widgets", "datasourceTypes", "trustedOrigins"];
|
|
6875
6889
|
var MAPS = ["aliases", "actions", "functions", "themes", "context", "data", "connections", "connectionMap"];
|
|
@@ -6883,7 +6897,8 @@ function mergeSettings(outer, inner) {
|
|
|
6883
6897
|
for (const k of MAPS) if (isObj(o[k]) && isObj(i[k])) out[k] = { ...o[k], ...i[k] };
|
|
6884
6898
|
if (isObj(o.ui) && isObj(i.ui)) {
|
|
6885
6899
|
const filters = isObj(o.ui.filters) && isObj(i.ui.filters) ? { ...o.ui.filters, ...i.ui.filters } : i.ui.filters ?? o.ui.filters;
|
|
6886
|
-
|
|
6900
|
+
const icons = isObj(o.ui.icons) && isObj(i.ui.icons) ? { ...o.ui.icons, ...i.ui.icons } : i.ui.icons ?? o.ui.icons;
|
|
6901
|
+
out.ui = { ...o.ui, ...i.ui, ...filters ? { filters } : {}, ...icons ? { icons } : {} };
|
|
6887
6902
|
}
|
|
6888
6903
|
return out;
|
|
6889
6904
|
}
|
|
@@ -6901,7 +6916,7 @@ function pickTheme(name, themes, fallback) {
|
|
|
6901
6916
|
|
|
6902
6917
|
// src/components/Tour.tsx
|
|
6903
6918
|
import { useCallback as useCallback6, useEffect as useEffect10, useId as useId5, useLayoutEffect as useLayoutEffect3, useRef as useRef12, useState as useState8 } from "react";
|
|
6904
|
-
import { Fragment as
|
|
6919
|
+
import { Fragment as Fragment10, jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6905
6920
|
var useClientLayoutEffect = typeof window === "undefined" ? useEffect10 : useLayoutEffect3;
|
|
6906
6921
|
function panelElement(root, id) {
|
|
6907
6922
|
if (!root || !id) return null;
|
|
@@ -6978,7 +6993,7 @@ function TourButton({ steps }) {
|
|
|
6978
6993
|
}, [isOpen]);
|
|
6979
6994
|
if (steps.length === 0) return null;
|
|
6980
6995
|
const last = at === steps.length - 1;
|
|
6981
|
-
return /* @__PURE__ */ jsxs22(
|
|
6996
|
+
return /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
6982
6997
|
/* @__PURE__ */ jsx30(
|
|
6983
6998
|
"button",
|
|
6984
6999
|
{
|
|
@@ -7307,7 +7322,8 @@ var RENDERER_CSS = `
|
|
|
7307
7322
|
.ds-flow .ds-tiles { height: auto; overflow-y: visible; }
|
|
7308
7323
|
/* Grid items with fit: the panel takes its natural height (at least the cell's), so the grid can measure it. */
|
|
7309
7324
|
[data-fit] > .ds-fit { height: 100%; }
|
|
7310
|
-
.ds-
|
|
7325
|
+
.ds-grid-exact > .react-grid-item { padding-bottom: var(--ds-grid-gap); }
|
|
7326
|
+
.ds-fit > .ds-panel { height: auto !important; min-height: 100% !important; }
|
|
7311
7327
|
/* While measuring, the panel takes only its content's height (no stretching), then goes back. */
|
|
7312
7328
|
.ds-fit[data-measuring] > .ds-panel { min-height: 0 !important; }
|
|
7313
7329
|
.ds-fit[data-measuring] .ds-panel-body, .ds-fit[data-measuring] .ds-panel-body > * { flex: none !important; height: auto !important; }
|
|
@@ -7350,7 +7366,7 @@ var RENDERER_CSS = `
|
|
|
7350
7366
|
.ds-filters .ds-field > span { font-size: var(--ds-type-label-size); }
|
|
7351
7367
|
.ds-filters .ds-select, .ds-filters .ds-input { color: var(--ds-color-action-primary); border-color: var(--ds-color-border-default); background: var(--ds-color-surface-card); min-height: calc(var(--ds-control-height, 36px) - 2px); }
|
|
7352
7368
|
.ds-filters .ds-btn { border-color: transparent; background: var(--ds-color-surface-selection); color: var(--ds-color-action-primary); }
|
|
7353
|
-
.ds-filters-icon { display: inline-grid; place-items: center; width: calc(var(--ds-control-height, 36px) - 2px); height: calc(var(--ds-control-height, 36px) - 2px); border-radius: var(--ds-radius-control); border: 1px solid var(--ds-color-border-default); color: var(--ds-color-text-subtle); }
|
|
7369
|
+
.ds-filters-icon { display: inline-grid; place-items: center; width: calc(var(--ds-control-height, 36px) - 2px); height: calc(var(--ds-control-height, 36px) - 2px); border-radius: var(--ds-radius-control); border: 1px solid var(--ds-color-border-default); color: var(--ds-filter-icon-color, var(--ds-color-text-subtle)); }
|
|
7354
7370
|
.ds-meters .ds-progress, .ds-card .ds-progress { height: 8px; }
|
|
7355
7371
|
.ds-badge-stale { border-radius: 6px; padding: 2px 8px; }
|
|
7356
7372
|
|
|
@@ -7446,7 +7462,7 @@ var RENDERER_CSS = `
|
|
|
7446
7462
|
.ds-stepper .ds-pill-btn, .ds-stepper .ds-pill-btn:hover, .ds-stepper .ds-pill-btn[aria-expanded="true"] { border-color: transparent; box-shadow: none; }
|
|
7447
7463
|
.ds-stepper .ds-pill-btn:focus { outline: none; }
|
|
7448
7464
|
.ds-stepper .ds-pill-btn:focus-visible, .ds-stepper .ds-step:focus-visible { outline: 2px solid var(--ds-color-border-focus); outline-offset: -2px; }
|
|
7449
|
-
.ds-step { display: inline-grid; place-items: center; width: var(--ds-control-height, 36px); height: var(--ds-control-height, 36px); border: 1px solid transparent; background: var(--ds-color-surface-selection); color: var(--ds-color-action-primary); cursor: pointer; transition: background 140ms ease, opacity 140ms ease; }
|
|
7465
|
+
.ds-step { display: inline-grid; place-items: center; width: var(--ds-control-height, 36px); height: var(--ds-control-height, 36px); border: 1px solid transparent; background: var(--ds-color-surface-selection); color: var(--ds-color-action-primary); font-size: 16px; cursor: pointer; transition: background 140ms ease, opacity 140ms ease; }
|
|
7450
7466
|
.ds-stepper > .ds-step:first-child { border-radius: var(--ds-radius-control) 0 0 var(--ds-radius-control); }
|
|
7451
7467
|
.ds-stepper > .ds-step:last-child { border-radius: 0 var(--ds-radius-control) var(--ds-radius-control) 0; }
|
|
7452
7468
|
.ds-step:hover:not(:disabled) { background: color-mix(in srgb, var(--ds-color-action-primary) 18%, var(--ds-color-surface-card)); }
|
|
@@ -7724,7 +7740,7 @@ function releaseDefaultPrefix(owner) {
|
|
|
7724
7740
|
}
|
|
7725
7741
|
|
|
7726
7742
|
// src/components/DashboardRenderer.tsx
|
|
7727
|
-
import { Fragment as
|
|
7743
|
+
import { Fragment as Fragment11, jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
7728
7744
|
function usesScripts(doc) {
|
|
7729
7745
|
const handler = (h) => {
|
|
7730
7746
|
if (typeof h === "string") return isCallbackSource(h);
|
|
@@ -8196,7 +8212,7 @@ function DashboardBody({
|
|
|
8196
8212
|
const grid = doc.spec.grid;
|
|
8197
8213
|
const tour = editable ? NO_STEPS : doc.spec.tour ?? NO_STEPS;
|
|
8198
8214
|
const hidden = useHiddenPanels(Object.keys(doc.spec.panels));
|
|
8199
|
-
return /* @__PURE__ */ jsxs23(
|
|
8215
|
+
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
8200
8216
|
!hideHeader && (head.title || head.synced || tour.length > 0) && /* @__PURE__ */ jsxs23("div", { className: "ds-header", children: [
|
|
8201
8217
|
head.title && /* @__PURE__ */ jsx31("h2", { className: "ds-title", children: head.title }),
|
|
8202
8218
|
head.description && /* @__PURE__ */ jsx31("p", { className: "ds-desc", children: head.description }),
|
|
@@ -8239,6 +8255,7 @@ function DashboardBody({
|
|
|
8239
8255
|
columns: grid.columns,
|
|
8240
8256
|
rowHeight: grid.rowHeight,
|
|
8241
8257
|
gap: grid.gap,
|
|
8258
|
+
exactHeights: grid.exactHeights,
|
|
8242
8259
|
editable,
|
|
8243
8260
|
hidden,
|
|
8244
8261
|
...breakpoint ? { breakpoint } : {},
|