react-semaphor 0.1.145 → 0.1.147
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/chunks/{dashboard-controls-DhQZskp-.js → dashboard-controls-BTd2GP5a.js} +1 -1
- package/dist/chunks/{dashboard-controls-CK-TP9Qx.js → dashboard-controls-CE8KM6Tg.js} +199 -199
- package/dist/chunks/{dashboard-export-dialog-DWHbgRQ2.js → dashboard-export-dialog-D9RPWq-E.js} +26 -26
- package/dist/chunks/{dashboard-export-dialog-D2JI5ycD.js → dashboard-export-dialog-DvMsFXpk.js} +1 -1
- package/dist/chunks/{dashboard-json-xIJDJDEK.js → dashboard-json-B1RDTwhR.js} +1 -1
- package/dist/chunks/{dashboard-json-C_agr9Il.js → dashboard-json-BYlLpF4e.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CyWgFWeR.js → edit-dashboard-visual-BvFmi5Wg.js} +2246 -2240
- package/dist/chunks/{edit-dashboard-visual-DjlER5zs.js → edit-dashboard-visual-DEgGCKtt.js} +13 -13
- package/dist/chunks/{editor-action-buttons-DPryoh3-.js → editor-action-buttons-Be2gqSdc.js} +1 -1
- package/dist/chunks/{editor-action-buttons-CRGFmZT-.js → editor-action-buttons-CrwUOyJX.js} +2 -2
- package/dist/chunks/{index-DB87nSG-.js → index-C4H_NxAd.js} +61 -61
- package/dist/chunks/{index-DI6ZxR4E.js → index-Cz1fGuVl.js} +1 -1
- package/dist/chunks/{resource-management-panel-BugB44JB.js → resource-management-panel-CBrnB1xs.js} +1 -1
- package/dist/chunks/{resource-management-panel-BOJcXuoC.js → resource-management-panel-CmaSAoHN.js} +62 -62
- package/dist/chunks/{use-visual-utils-jua7RF1E.js → use-visual-utils-DF-sQ-ZN.js} +1 -1
- package/dist/chunks/{use-visual-utils-CpYOpmej.js → use-visual-utils-DHrvE5kS.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +26 -25
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +67 -5
- package/package.json +1 -1
package/dist/chunks/{resource-management-panel-BugB44JB.js → resource-management-panel-CBrnB1xs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-Cz1fGuVl.js"),c=require("react"),oe=require("./use-visual-utils-DF-sQ-ZN.js");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/dist/chunks/{resource-management-panel-BOJcXuoC.js → resource-management-panel-CmaSAoHN.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as me } from "react/jsx-runtime";
|
|
2
|
-
import { b as We, u as ce, f as qe,
|
|
2
|
+
import { b as We, u as ce, f as qe, ap as ie, b5 as Je, b6 as Qe, c as ee, b7 as Ye, aG as Xe, aH as Ze, B as G, aI as $e, aJ as ke, aK as Q, b8 as ue, L as re, b9 as et, ba as tt, bb as st, bc as Ne, bd as pe, be as at, bf as nt, I as it, bg as we, bh as oe, bi as ve, bj as Ce, bk as rt, M as ye, R as Se, bl as Ee, aO as Ve, aP as Le, aQ as Ae, aS as Te, aT as Oe, aU as Re, aV as Pe, aW as Ie, bm as ot, bn as lt, bo as Ue, bp as Me, bq as je, br as dt, bs as Fe, bt as ct, A as ae, ao as ut, bu as ht, bv as ze, bw as mt, bx as pt, at as ft, au as gt, av as Dt, aw as xt, ax as Nt, ay as be, az as he, aC as bt, by as wt, bz as vt, bA as Ct, bB as yt } from "./index-C4H_NxAd.js";
|
|
3
3
|
import St, { useRef as Et, useEffect as ne, useState as x } from "react";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as Be } from "./use-visual-utils-DHrvE5kS.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.453.0 - ISC
|
|
7
7
|
*
|
|
@@ -60,12 +60,12 @@ function Tt({
|
|
|
60
60
|
onDuplicateVisual: i,
|
|
61
61
|
// onTogglePrivacy,
|
|
62
62
|
onShareVisual: N,
|
|
63
|
-
formatDate:
|
|
63
|
+
formatDate: y
|
|
64
64
|
}) {
|
|
65
65
|
var R, S, v, T;
|
|
66
|
-
const { selectVisual: d } = ie(), c = Je(t.id), p = At(t.id), { isConsoleMode: E } = Qe(), V = St.useRef(null), [b,
|
|
66
|
+
const { selectVisual: d } = ie(), c = Je(t.id), p = At(t.id), { isConsoleMode: E } = Qe(), V = St.useRef(null), [b, C] = x(!1), [L, A] = x(!1);
|
|
67
67
|
ne(() => {
|
|
68
|
-
m ? (
|
|
68
|
+
m ? (C(!0), A(!0)) : L && (C(!1), A(!1));
|
|
69
69
|
}, [m, L]), ne(() => {
|
|
70
70
|
p && V.current && V.current.scrollIntoView({
|
|
71
71
|
behavior: "smooth",
|
|
@@ -116,7 +116,7 @@ function Tt({
|
|
|
116
116
|
{
|
|
117
117
|
modal: !1,
|
|
118
118
|
open: b,
|
|
119
|
-
onOpenChange:
|
|
119
|
+
onOpenChange: C,
|
|
120
120
|
children: [
|
|
121
121
|
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(G, { size: "sm", variant: "ghost", className: "h-6 w-6 p-0", children: /* @__PURE__ */ e($e, { className: "h-3 w-3" }) }) }),
|
|
122
122
|
/* @__PURE__ */ a(ke, { align: "end", className: "z-[51] w-40", children: [
|
|
@@ -206,7 +206,7 @@ function Tt({
|
|
|
206
206
|
] }),
|
|
207
207
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
208
208
|
/* @__PURE__ */ e(nt, { className: "h-3 w-3" }),
|
|
209
|
-
/* @__PURE__ */ e("span", { children:
|
|
209
|
+
/* @__PURE__ */ e("span", { children: y(t.lastModified) })
|
|
210
210
|
] })
|
|
211
211
|
] })
|
|
212
212
|
] })
|
|
@@ -240,10 +240,10 @@ function Tt({
|
|
|
240
240
|
function Ot({ searchQuery: t }) {
|
|
241
241
|
const [f, m] = x(!1), [r, o] = x(
|
|
242
242
|
null
|
|
243
|
-
), [g, D] = x(!1), [i, N] = x(null), [
|
|
243
|
+
), [g, D] = x(!1), [i, N] = x(null), [y, d] = x(null), [c, p] = x(
|
|
244
244
|
null
|
|
245
|
-
), { selectVisual: E } = ie(), { handleEditLibraryVisual: V, handleAddLibraryVisual: b } =
|
|
246
|
-
resources:
|
|
245
|
+
), { selectVisual: E } = ie(), { handleEditLibraryVisual: V, handleAddLibraryVisual: b } = Be(), {
|
|
246
|
+
resources: C,
|
|
247
247
|
isLoading: L,
|
|
248
248
|
isError: A,
|
|
249
249
|
updateResource: I,
|
|
@@ -254,7 +254,7 @@ function Ot({ searchQuery: t }) {
|
|
|
254
254
|
D(!1), N(null);
|
|
255
255
|
});
|
|
256
256
|
oe();
|
|
257
|
-
const T =
|
|
257
|
+
const T = C.filter(
|
|
258
258
|
(n) => {
|
|
259
259
|
var O, l;
|
|
260
260
|
return ((O = n == null ? void 0 : n.title) == null ? void 0 : O.toLowerCase().includes(t.toLowerCase())) || ((l = n == null ? void 0 : n.description) == null ? void 0 : l.toLowerCase().includes(t.toLowerCase()));
|
|
@@ -263,7 +263,7 @@ function Ot({ searchQuery: t }) {
|
|
|
263
263
|
month: "short",
|
|
264
264
|
day: "numeric",
|
|
265
265
|
year: "numeric"
|
|
266
|
-
}),
|
|
266
|
+
}), j = (n) => {
|
|
267
267
|
N(n), D(!0);
|
|
268
268
|
}, Y = () => {
|
|
269
269
|
i && R(i.id);
|
|
@@ -271,10 +271,10 @@ function Ot({ searchQuery: t }) {
|
|
|
271
271
|
startUpdating: F,
|
|
272
272
|
stopUpdating: W,
|
|
273
273
|
isUpdating: P
|
|
274
|
-
} = ve(),
|
|
274
|
+
} = ve(), z = (n, O, l) => {
|
|
275
275
|
var se;
|
|
276
276
|
const J = Object.fromEntries(
|
|
277
|
-
Object.entries(O).filter(([,
|
|
277
|
+
Object.entries(O).filter(([, M]) => M !== void 0)
|
|
278
278
|
);
|
|
279
279
|
if (Object.keys(J).length === 0) {
|
|
280
280
|
(se = l == null ? void 0 : l.onSuccess) == null || se.call(l);
|
|
@@ -288,16 +288,16 @@ function Ot({ searchQuery: t }) {
|
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
290
|
onSuccess: () => {
|
|
291
|
-
var
|
|
292
|
-
W(n, k), (
|
|
291
|
+
var M;
|
|
292
|
+
W(n, k), (M = l == null ? void 0 : l.onSuccess) == null || M.call(l);
|
|
293
293
|
},
|
|
294
294
|
onError: () => {
|
|
295
|
-
var
|
|
296
|
-
W(n, k), (
|
|
295
|
+
var M;
|
|
296
|
+
W(n, k), (M = l == null ? void 0 : l.onError) == null || M.call(l);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
);
|
|
300
|
-
},
|
|
300
|
+
}, B = (n) => {
|
|
301
301
|
d(n), S(n, {
|
|
302
302
|
onSettled: () => d(null)
|
|
303
303
|
});
|
|
@@ -306,7 +306,7 @@ function Ot({ searchQuery: t }) {
|
|
|
306
306
|
}, H = (n) => {
|
|
307
307
|
b(n);
|
|
308
308
|
}, Z = (n) => {
|
|
309
|
-
const O =
|
|
309
|
+
const O = C.find((l) => l.id === n);
|
|
310
310
|
O && I({
|
|
311
311
|
resourceId: n,
|
|
312
312
|
data: {
|
|
@@ -326,13 +326,13 @@ function Ot({ searchQuery: t }) {
|
|
|
326
326
|
if (!c)
|
|
327
327
|
return;
|
|
328
328
|
const l = {};
|
|
329
|
-
n !== c.title && (l.title = n), (c.description || "") !== O && (l.description = O),
|
|
329
|
+
n !== c.title && (l.title = n), (c.description || "") !== O && (l.description = O), z(c.id, l, {
|
|
330
330
|
onSuccess: () => {
|
|
331
331
|
p(null);
|
|
332
332
|
}
|
|
333
333
|
});
|
|
334
334
|
};
|
|
335
|
-
return L ? /* @__PURE__ */ e(He, {}) : A ? /* @__PURE__ */ e(
|
|
335
|
+
return L ? /* @__PURE__ */ e(He, {}) : A ? /* @__PURE__ */ e(Ce, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
336
336
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
|
|
337
337
|
/* @__PURE__ */ e(
|
|
338
338
|
G,
|
|
@@ -356,18 +356,18 @@ function Ot({ searchQuery: t }) {
|
|
|
356
356
|
onAddVisual: H,
|
|
357
357
|
onOpenVisual: X,
|
|
358
358
|
onEditDetails: q,
|
|
359
|
-
onDeleteClick:
|
|
360
|
-
onDuplicateVisual:
|
|
359
|
+
onDeleteClick: j,
|
|
360
|
+
onDuplicateVisual: B,
|
|
361
361
|
onTogglePrivacy: Z,
|
|
362
362
|
onShareVisual: _,
|
|
363
363
|
isDeleting: v,
|
|
364
|
-
isDuplicating:
|
|
364
|
+
isDuplicating: y === n.id,
|
|
365
365
|
formatDate: u
|
|
366
366
|
},
|
|
367
367
|
n.id
|
|
368
368
|
)) }),
|
|
369
369
|
f && r && /* @__PURE__ */ e(
|
|
370
|
-
|
|
370
|
+
ye,
|
|
371
371
|
{
|
|
372
372
|
resource: r,
|
|
373
373
|
resourceType: Se.VISUAL,
|
|
@@ -436,11 +436,11 @@ function Rt({
|
|
|
436
436
|
onDeleteClick: D,
|
|
437
437
|
onDuplicateDashboard: i,
|
|
438
438
|
onShareDashboard: N,
|
|
439
|
-
formatDate:
|
|
439
|
+
formatDate: y,
|
|
440
440
|
onDashboardItemClick: d
|
|
441
441
|
}) {
|
|
442
442
|
var R, S;
|
|
443
|
-
const { selectDashboard: c } = ie(), p = ot(t.id), { userContext: E, isLoading: V } = oe(), { mutate: b } = lt(),
|
|
443
|
+
const { selectDashboard: c } = ie(), p = ot(t.id), { userContext: E, isLoading: V } = oe(), { mutate: b } = lt(), C = ((R = E == null ? void 0 : E.permissions) == null ? void 0 : R.canEdit) ?? !1, L = V || !C, A = () => {
|
|
444
444
|
c(t), o(t.id), d == null || d(t.id);
|
|
445
445
|
}, I = (v) => {
|
|
446
446
|
v.stopPropagation(), b({ dashboardId: r ? null : t.id });
|
|
@@ -454,8 +454,8 @@ function Rt({
|
|
|
454
454
|
),
|
|
455
455
|
onClick: A,
|
|
456
456
|
children: [
|
|
457
|
-
/* @__PURE__ */ a(
|
|
458
|
-
/* @__PURE__ */ e(
|
|
457
|
+
/* @__PURE__ */ a(Me, { children: [
|
|
458
|
+
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
|
|
459
459
|
"button",
|
|
460
460
|
{
|
|
461
461
|
onClick: I,
|
|
@@ -503,7 +503,7 @@ function Rt({
|
|
|
503
503
|
onDeleteClick: D,
|
|
504
504
|
onDuplicateDashboard: i,
|
|
505
505
|
onShareDashboard: N,
|
|
506
|
-
formatDate:
|
|
506
|
+
formatDate: y
|
|
507
507
|
}
|
|
508
508
|
) })
|
|
509
509
|
] }) })
|
|
@@ -513,7 +513,7 @@ function Rt({
|
|
|
513
513
|
) });
|
|
514
514
|
}
|
|
515
515
|
function Pt({ onRetry: t }) {
|
|
516
|
-
return /* @__PURE__ */ e(
|
|
516
|
+
return /* @__PURE__ */ e(Ce, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
517
517
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load dashboards" }),
|
|
518
518
|
/* @__PURE__ */ e(G, { variant: "outline", size: "sm", className: "mt-2", onClick: t, children: "Retry" })
|
|
519
519
|
] }) });
|
|
@@ -522,7 +522,7 @@ function It(t) {
|
|
|
522
522
|
var fe, ge;
|
|
523
523
|
const { searchQuery: f, onLoadDashboard: m, onEditDashboard: r, onDashboardItemClick: o } = t, [g, D] = x(!1), [i, N] = x(
|
|
524
524
|
null
|
|
525
|
-
), [
|
|
525
|
+
), [y, d] = x(!1), [c, p] = x(null), [E, V] = x(null), [b, C] = x(null), L = ae(
|
|
526
526
|
(s) => s.lastSelectedDashboard
|
|
527
527
|
), A = ae(
|
|
528
528
|
(s) => s.selectedDashboard
|
|
@@ -535,16 +535,16 @@ function It(t) {
|
|
|
535
535
|
const {
|
|
536
536
|
resources: T,
|
|
537
537
|
isLoading: u,
|
|
538
|
-
isError:
|
|
538
|
+
isError: j,
|
|
539
539
|
updateResource: Y,
|
|
540
540
|
deleteResource: F,
|
|
541
541
|
duplicateResource: W,
|
|
542
542
|
isDeleting: P
|
|
543
|
-
} =
|
|
543
|
+
} = ze(() => {
|
|
544
544
|
d(!1);
|
|
545
545
|
const s = c == null ? void 0 : c.id;
|
|
546
546
|
p(null), (A == null ? void 0 : A.id) === s && (!(S != null && S.dashboard_id) && !v ? R() : L && L.id !== s && I(L));
|
|
547
|
-
}), { currentUser:
|
|
547
|
+
}), { currentUser: z, userContext: B } = oe(), X = ((fe = B == null ? void 0 : B.permissions) == null ? void 0 : fe.canCreateDashboard) ?? !1, { data: H } = mt(), Z = ((ge = H == null ? void 0 : H.preference) == null ? void 0 : ge.defaultDashboardId) || null, _ = T.filter(
|
|
548
548
|
(s) => {
|
|
549
549
|
var U, h;
|
|
550
550
|
return ((U = s == null ? void 0 : s.title) == null ? void 0 : U.toLowerCase().includes(f.toLowerCase())) || ((h = s == null ? void 0 : s.description) == null ? void 0 : h.toLowerCase().includes(f.toLowerCase()));
|
|
@@ -603,12 +603,12 @@ function It(t) {
|
|
|
603
603
|
isPrivate: !U.isPrivate
|
|
604
604
|
}
|
|
605
605
|
});
|
|
606
|
-
},
|
|
607
|
-
N(s),
|
|
606
|
+
}, M = (s) => {
|
|
607
|
+
N(s), z == null || z.type, D(!0);
|
|
608
608
|
}, _e = (s) => {
|
|
609
|
-
r == null || r(s.id),
|
|
609
|
+
r == null || r(s.id), C(s);
|
|
610
610
|
}, Ke = () => {
|
|
611
|
-
|
|
611
|
+
C(null);
|
|
612
612
|
}, Ge = ({
|
|
613
613
|
title: s,
|
|
614
614
|
description: U
|
|
@@ -618,11 +618,11 @@ function It(t) {
|
|
|
618
618
|
const h = {};
|
|
619
619
|
s !== b.title && (h.title = s), (b.description || "") !== U && (h.description = U), k(b.id, h, {
|
|
620
620
|
onSuccess: () => {
|
|
621
|
-
|
|
621
|
+
C(null);
|
|
622
622
|
}
|
|
623
623
|
});
|
|
624
624
|
};
|
|
625
|
-
return u ? /* @__PURE__ */ e(He, {}) :
|
|
625
|
+
return u ? /* @__PURE__ */ e(He, {}) : j ? /* @__PURE__ */ e(Pt, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
|
|
626
626
|
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: _.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
|
|
627
627
|
/* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(pt, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
|
|
628
628
|
/* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: f ? "No dashboards found" : "No dashboards yet" }),
|
|
@@ -639,14 +639,14 @@ function It(t) {
|
|
|
639
639
|
onDeleteClick: $,
|
|
640
640
|
onDuplicateDashboard: O,
|
|
641
641
|
onTogglePrivacy: se,
|
|
642
|
-
onShareDashboard:
|
|
642
|
+
onShareDashboard: M,
|
|
643
643
|
formatDate: q,
|
|
644
644
|
onDashboardItemClick: o
|
|
645
645
|
},
|
|
646
646
|
s.id
|
|
647
647
|
)) }),
|
|
648
648
|
g && i && /* @__PURE__ */ e(
|
|
649
|
-
|
|
649
|
+
ye,
|
|
650
650
|
{
|
|
651
651
|
resource: i,
|
|
652
652
|
resourceType: Se.DASHBOARD,
|
|
@@ -658,7 +658,7 @@ function It(t) {
|
|
|
658
658
|
/* @__PURE__ */ e(
|
|
659
659
|
Ve,
|
|
660
660
|
{
|
|
661
|
-
open:
|
|
661
|
+
open: y,
|
|
662
662
|
onOpenChange: (s) => {
|
|
663
663
|
!s && P || (d(s), s || p(null));
|
|
664
664
|
},
|
|
@@ -717,10 +717,10 @@ function Ut({
|
|
|
717
717
|
}, [t]);
|
|
718
718
|
const N = () => {
|
|
719
719
|
o.trim() && m({ title: o, description: D });
|
|
720
|
-
},
|
|
720
|
+
}, y = (d) => {
|
|
721
721
|
f(d);
|
|
722
722
|
};
|
|
723
|
-
return /* @__PURE__ */ e(ft, { open: t, onOpenChange:
|
|
723
|
+
return /* @__PURE__ */ e(ft, { open: t, onOpenChange: y, children: /* @__PURE__ */ a(gt, { children: [
|
|
724
724
|
/* @__PURE__ */ a(Dt, { children: [
|
|
725
725
|
/* @__PURE__ */ e(xt, { children: "Create New Visual" }),
|
|
726
726
|
/* @__PURE__ */ e(Nt, { children: "Add a new visual to your library. You can configure it after creation." })
|
|
@@ -761,7 +761,7 @@ function Ut({
|
|
|
761
761
|
G,
|
|
762
762
|
{
|
|
763
763
|
variant: "outline",
|
|
764
|
-
onClick: () =>
|
|
764
|
+
onClick: () => y(!1),
|
|
765
765
|
disabled: r,
|
|
766
766
|
children: "Cancel"
|
|
767
767
|
}
|
|
@@ -780,7 +780,7 @@ function Ut({
|
|
|
780
780
|
] })
|
|
781
781
|
] }) });
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function Bt({
|
|
784
784
|
isOpen: t,
|
|
785
785
|
onClose: f,
|
|
786
786
|
className: m,
|
|
@@ -790,21 +790,21 @@ function zt({
|
|
|
790
790
|
var _, q;
|
|
791
791
|
const g = ce(
|
|
792
792
|
(w) => w.isDashboardEditing
|
|
793
|
-
), [D, i] = x(!1), [N,
|
|
793
|
+
), [D, i] = x(!1), [N, y] = x(""), [d, c] = x(!1), { currentUser: p, userContext: E } = oe(), V = ((_ = E == null ? void 0 : E.permissions) == null ? void 0 : _.canCreateDashboard) ?? !1, { onCreateSuccess: b } = wt({
|
|
794
794
|
onDashboardSelect: r
|
|
795
|
-
}), { selectVisual:
|
|
795
|
+
}), { selectVisual: C } = ie(), { handleEditLibraryVisual: L } = Be(), {
|
|
796
796
|
createResource: A,
|
|
797
797
|
isCreating: I,
|
|
798
798
|
refetch: R
|
|
799
|
-
} =
|
|
799
|
+
} = ze(), { createResource: S, isCreating: v } = we(
|
|
800
800
|
void 0,
|
|
801
801
|
// onDeleteSuccess (not needed here)
|
|
802
802
|
(w) => {
|
|
803
|
-
i(!1), w && (
|
|
803
|
+
i(!1), w && (C(w), L(w));
|
|
804
804
|
}
|
|
805
|
-
), T = o === "overlay", u = ((p == null ? void 0 : p.name) ?? "").trim(),
|
|
805
|
+
), T = o === "overlay", u = ((p == null ? void 0 : p.name) ?? "").trim(), j = ((p == null ? void 0 : p.email) ?? "").trim(), F = u && u.toLowerCase() !== "undefined" ? u : j || "Current user", W = ((q = F.charAt(0)) == null ? void 0 : q.toUpperCase()) || "?", P = j && j.toLowerCase() !== "undefined" ? j : "", z = Lt(f, {
|
|
806
806
|
enabled: t && T
|
|
807
|
-
}),
|
|
807
|
+
}), B = ee(
|
|
808
808
|
"flex h-full flex-col border-r bg-background",
|
|
809
809
|
T ? ee(
|
|
810
810
|
"absolute inset-y-0 left-0 z-[51] w-60 shadow-lg transition-transform duration-300 ease-in-out",
|
|
@@ -821,7 +821,7 @@ function zt({
|
|
|
821
821
|
}
|
|
822
822
|
});
|
|
823
823
|
};
|
|
824
|
-
return /* @__PURE__ */ e(me, { children: (!T || t) && /* @__PURE__ */ a("div", { ref:
|
|
824
|
+
return /* @__PURE__ */ e(me, { children: (!T || t) && /* @__PURE__ */ a("div", { ref: z, className: B, children: [
|
|
825
825
|
/* @__PURE__ */ a("div", { className: "border-b border-border", children: [
|
|
826
826
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-1.5", children: [
|
|
827
827
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-sm font-semibold", children: g ? "Visuals" : "Dashboards" }) }),
|
|
@@ -853,7 +853,7 @@ function zt({
|
|
|
853
853
|
{
|
|
854
854
|
placeholder: "Search...",
|
|
855
855
|
value: N,
|
|
856
|
-
onChange: (w) =>
|
|
856
|
+
onChange: (w) => y(w.target.value),
|
|
857
857
|
className: "h-8 border-muted-foreground/20 bg-background text-sm focus-visible:border-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
858
858
|
autoFocus: !0
|
|
859
859
|
}
|
|
@@ -869,14 +869,14 @@ function zt({
|
|
|
869
869
|
}
|
|
870
870
|
) }),
|
|
871
871
|
p && /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
872
|
-
/* @__PURE__ */ a(
|
|
873
|
-
/* @__PURE__ */ e(
|
|
872
|
+
/* @__PURE__ */ a(Me, { children: [
|
|
873
|
+
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex h-6 w-6 cursor-default items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-primary", children: W }) }) }),
|
|
874
874
|
/* @__PURE__ */ e(Fe, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
875
875
|
/* @__PURE__ */ e("div", { className: "font-medium", children: F }),
|
|
876
876
|
P && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: P }),
|
|
877
877
|
p.role && /* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: [
|
|
878
878
|
"Role: ",
|
|
879
|
-
|
|
879
|
+
Ct(p.role.replace(/_/g, " "))
|
|
880
880
|
] })
|
|
881
881
|
] }) })
|
|
882
882
|
] }),
|
|
@@ -891,7 +891,7 @@ function zt({
|
|
|
891
891
|
isCreating: v
|
|
892
892
|
}
|
|
893
893
|
) : /* @__PURE__ */ e(
|
|
894
|
-
|
|
894
|
+
yt,
|
|
895
895
|
{
|
|
896
896
|
open: D,
|
|
897
897
|
onOpenChange: i,
|
|
@@ -902,5 +902,5 @@ function zt({
|
|
|
902
902
|
] }) });
|
|
903
903
|
}
|
|
904
904
|
export {
|
|
905
|
-
|
|
905
|
+
Bt as ResourceManagementPanel
|
|
906
906
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./index-
|
|
1
|
+
"use strict";const o=require("./index-Cz1fGuVl.js"),b=require("react");function _(e){const a=e.toUpperCase().indexOf("WHERE"),r=e.toUpperCase().indexOf("GROUP BY"),t=e.toUpperCase().indexOf("LIMIT"),d=e.toUpperCase().indexOf("ORDER BY");let c=e.length;if(d!==-1&&(c=d),t!==-1&&t<c&&(c=t),a!==-1){const n=e.substring(0,a),s=e.substring(a);return`${n} {{ filters | where }} AND ${s.substring(6)}`}else if(r!==-1){const n=e.substring(0,r),s=e.substring(r);return`${n} {{ filters | where }} ${s}`}else{const n=e.substring(0,c),s=e.substring(c);return console.log("beforeClause",n),console.log("afterClause",s),s?`${n} {{ filters | where }} ${s}`:`${n.replace(/;$/,"")} {{ filters | where }}`}}function B(e){const[a,r]=b.useState(null),[t,d]=b.useState(null),c=o.useEnsureReactGlobals();return b.useEffect(()=>{if(!e||e.trim()===""){r(null),d(null);return}if(!c)return;(async()=>{try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error(`Invalid URL format: ${e}`);try{new URL(e)}catch{throw new Error(`Invalid URL: ${e}`)}const l=`${e.endsWith("/")?e:`${e}/`}index.js`;try{if(!(await fetch(l,{method:"HEAD"})).ok)throw new Error(`Module not found at ${l}`)}catch{}const m=await import(l);if(typeof m.useChartStore!="function")throw new Error("useChartStore is not a function");r(()=>m.useChartStore),d(null)}catch(s){const l=s instanceof Error?s.message:"Unknown error";console.error("Failed to load remote chart store:",l),d(l),r(null)}})()},[e,c]),a}function H(e,a){if(e.length===0)return"";if(a){const r=e.find(t=>t.id===a);if(r){const t=r.tabTitle;if(t=="All__Header")return e[0].id;if(t&&t.endsWith("__Header")){const c=t.split("__")[0],n=e.find(s=>s.tabTitle===c);return n?n.id:e[0].id}return a}}return e[0].id}async function j(e,a,r,t){if(!a||!r)throw new Error("Missing auth token or visual ID");const d=["resource-by-id","visual",r],c=t.getQueryData(d);if(c)return console.log("Using cached visual data for:",r),{data:c,fromCache:!0};console.log("Fetching visual data from network for:",r);const n=o.ue.loading("Loading visual...",{position:"top-center"});try{const s=await fetch(`${e}/management/v1/visuals/${r}`,{headers:{Authorization:`Bearer ${a}`}});if(!s.ok)throw new Error("Failed to load visual");const l=await s.json();return t.setQueryData(d,l),o.ue.dismiss(n),{data:l,fromCache:!1}}catch(s){throw o.ue.dismiss(n),s}}function T(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error("Invalid frame object format")}function Q(e,a){var c,n;const r=(e==null?void 0:e.frameObject)??((c=e==null?void 0:e.visual)==null?void 0:c.frameObject);if(!r)return!1;const t=T(r);if(!(t!=null&&t.cards)||t.cards.length===0)return!1;const d=(n=t.cards)==null?void 0:n.find(s=>s.id===t.activeCardId);return d?(o.setupEditorWithCard({...a,frame:t,card:d,visualId:(e==null?void 0:e.id)||t.visualId}),!0):!1}function G(){var g;const{setCardSql:e}=o.useEditorActions(),a=o.useEditorStore(i=>i.frame),r=o.useEditorStore(i=>i.card),t=B(((g=r.customCardPreferences)==null?void 0:g.url)||""),d=o.useEditorStore(i=>i.selectedSchemaName),c=o.useEditorStore(i=>i.selectedDatamodelId),n=o.useEditorStore(i=>i.selectedDatabaseName),s=o.useEditorStore(i=>i.selectedTableName),l=o.useEditorStore(i=>i.selectedConnectionId),m=o.useEditorStore(i=>i.isShowingVisual),f=r.sql;return{getUpdatedFrame:b.useCallback(()=>{var E;let i=f;f&&!f.includes("{{")&&(i=_(f),e(i));const C=(E=t==null?void 0:t.getState())==null?void 0:E.settings,U={...r,dataSource:r.dataSource||{mode:"directSource"},lastSelectedSchema:d,lastSelectedDatamodelId:c,lastSelectedDatabase:n,lastSelectedTable:s,connectionId:l,sql:i,customCfg:m?r.customCfg:null,preferences:r.preferences,...C&&{customCardPreferences:{...r.customCardPreferences,settings:C}}},w=a.cards.map(S=>S.id===r.id?U:S);return{...a,cards:w,activeCardId:H(w,a.activeCardId)}},[r,a,m,d,c,n,s,l,e,t,f])}}function z(){const{authToken:e,tokenProps:a}=o.useSemaphorContext(),r=o.useQueryClient(),t=o.useSelectedVisual(),{selectVisual:d}=o.useManagementActions(),{setFrame:c,setCard:n,setIsDevMode:s,setActiveTabCardId:l,updateDataSource:m,setQueryResultColumns:f,setSelectedConnectionId:V,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:U,setFilterValues:w,setApplyFilters:E}=o.useEditorActions(),{setIsDashboardEditing:S,setIsVisualEditing:$,setSelectedFrameId:v,clearSelectedFrameId:A,addFrame:N,setIsDashboardPanelOpen:R}=o.useDashboardActions(),I=o.useDashboardStore(u=>u.selectedSheetId),D=o.useDashboardStore(u=>u.selectedFrameId),O=o.useDashboardStore(u=>u.dashboard),x=o.useDashboardStore(u=>u.filterValues),y=o.useVisualById((t==null?void 0:t.id)||"",{enabled:!!(t!=null&&t.id)&&!!(e!=null&&e.accessToken)}),M=b.useCallback(async u=>{try{d(u),A();const{data:p,fromCache:h}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,r);if(!Q(p,{setFrame:c,setCard:n,setIsDevMode:s,setActiveTabCardId:l,updateDataSource:m,setQueryResultColumns:f,setSelectedConnectionId:V,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:U,setFilterValues:w,setApplyFilters:E,setIsDashboardEditing:S,setIsVisualEditing:$,dashboard:O,selectedSheetId:I,selectedFrameId:D,filterValues:x}))throw new Error("Failed to setup editor with visual data");return{success:!0,fromCache:h}}catch(p){return console.error("Error editing visual:",p),{success:!1,error:"Failed to load visual for editing"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,r,d,c,n,S,$,s,l,m,f,V,g,i,C,U,w,E,A,O,I,D,x]),k=b.useCallback(async u=>{var p;try{if(d(u),!I)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:h,fromCache:W}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,r),L=(h==null?void 0:h.frameObject)??((p=h==null?void 0:h.visual)==null?void 0:p.frameObject);if(!L)return{success:!1,error:"Visual has no frame data"};const F=T(L);if(!(F!=null&&F.cards)||F.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const P={...o.cloneFrameWithNewIds(F),visualId:u.id};return N(I,P,"end"),S(!0),v(P.id),R(!1),{success:!0,fromCache:W}}catch(h){return console.error("Error adding visual:",h),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,r,d,I,N,S,v,R]);return{visual:y.data,isLoading:y.isLoading,isError:y.isError,error:y.error,handleEditLibraryVisual:M,handleAddLibraryVisual:k,getUpdatedFrame:G().getUpdatedFrame,refetch:y.refetch}}exports.useRemoteChartStore=B;exports.useVisualUtils=z;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { an as G, ao as z, h as Y, i as J, ap as K, e as _, g as X, u as U, aq as Z, ar as q, l as v, as as ee, f as h } from "./index-C4H_NxAd.js";
|
|
2
2
|
import { useState as T, useEffect as te, useCallback as V } from "react";
|
|
3
3
|
function re(e) {
|
|
4
4
|
const o = e.toUpperCase().indexOf("WHERE"), r = e.toUpperCase().indexOf("GROUP BY"), t = e.toUpperCase().indexOf("LIMIT"), i = e.toUpperCase().indexOf("ORDER BY");
|
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-Cz1fGuVl.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
package/dist/dashboard/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-Cz1fGuVl.js"),E=require("./types/index.cjs"),a=require("react/jsx-runtime"),g=require("react"),j=require("./chunks/resource-management-panel-CBrnB1xs.js"),c=require("./chunks/dashboard-export-dialog-DvMsFXpk.js");require("react-dom");function P(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return t.default=r,Object.freeze(t)}const C=P(g);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const M=e.createLucideIcon("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);function N(r){const{displayPreferences:t,...s}=r,i={...s,id:r.dashboardId};return a.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:a.jsx(e.SemaphorContextProvider,{dashboardProps:i,children:a.jsx(e.UXProvider,{children:a.jsx(e.DisplayPreferencesProvider,{displayPreferences:t,children:a.jsx(e.Container,{type:"visual",...i,children:a.jsx(A,{cardId:r.cardId})})})})})})}function A({cardId:r}){const t=e.useDashboardStore(n=>{var l;return(l=n.dashboard)==null?void 0:l.sheets}),{card:s,frame:i}=g.useMemo(()=>{const n=t==null?void 0:t.flatMap(o=>o.frames),l=n==null?void 0:n.flatMap(o=>o==null?void 0:o.cards),m=l==null?void 0:l.find(o=>(o==null?void 0:o.id)===r),f=n==null?void 0:n.find(o=>{var p;return(p=o==null?void 0:o.cards)==null?void 0:p.find(u=>(u==null?void 0:u.id)===r)});return{card:m,frame:f}},[t,r]);return!s||!i?a.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${r}`}):a.jsx("main",{className:"flex h-full grow flex-col",children:a.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:l})=>a.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:l,customerFacingMessage:"Error creating visual. Please try again."}),children:a.jsx(e.DashboardCard,{card:s,frame:i})})})}function k({name:r,items:t,value:s,onChange:i,isLoading:n,isError:l,refetch:m,className:f,icon:o,showNone:p=!1}){const u=C.useRef(null),[b,x]=C.useState(!1),[y,v]=C.useState("100%"),D=p?[...t||[],{id:"none",name:"None"}]:t;C.useLayoutEffect(()=>{u.current&&v(u.current.offsetWidth)},[]);function T(){var d;return n?"Loading...":l?"Error":s?(d=t==null?void 0:t.find(h=>h.id===s))==null?void 0:d.name:`Select ${r}`}function S(d,h){i(h),x(!1)}return a.jsxs(e.Popover,{open:b,onOpenChange:x,children:[a.jsx(e.PopoverTrigger,{asChild:!0,children:a.jsxs(e.Button,{ref:u,variant:"outline",role:"combobox","aria-expanded":b,className:e.cn("flex h-9 w-full justify-between",f),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[o&&a.jsx("div",{className:"mr-2",children:o}),a.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:T()})]}),a.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),a.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:y},children:a.jsxs(e.Command,{children:[a.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[a.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),a.jsx(e.IconButton,{className:"h-7",onClick:m,children:a.jsx(M,{className:e.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),a.jsxs(e.CommandList,{children:[a.jsxs(e.CommandEmpty,{children:["No ",r==null?void 0:r.toLowerCase()," found."]}),a.jsx(e.CommandGroup,{children:D==null?void 0:D.map(d=>a.jsx(e.CommandItem,{className:"overflow-x-auto",value:d.name,onSelect:h=>S(h,d.id),children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(e.Check,{className:e.cn("size-4",s===d.id?"opacity-100":"opacity-0")}),a.jsx("div",{title:d.name,children:d.name})]})},d.id))})]})]})})]})}exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.Surfboard=e.DashboardPlus;exports.cloneDeep=e.cloneDeep;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createSqlGenConfig=e.createSqlGenConfig;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.getColumnDataType=e.getColumnDataType;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedField=e.isCalculatedField;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.useCard=e.useCard;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardStore=e.useDashboardStore;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useManagementStore=e.useManagementStore;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=E.EMPTY_SELECTION;exports.ResourceManagementPanel=j.ResourceManagementPanel;exports.AdvancedModeToggle=c.AdvancedModeToggle;exports.DashboardExportDialog=c.DashboardExportDialog;exports.ScheduleDashboard=c.ScheduleDashboard;exports.UnsavedChangesAlert=c.UnsavedChangesAlert;exports.VisualEditingControls=c.VisualEditingControls;exports.usePristineSnapshotInitializer=c.usePristineSnapshotInitializer;exports.Combobox=k;exports.Visual=N;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as
|
|
2
|
-
import {
|
|
3
|
-
import { EMPTY_SELECTION as
|
|
1
|
+
import { b as T, E as y, F as P, S as w, U as M, m as k, n as A, u as F, o as g, p as L, P as R, q as I, B as V, c as v, r as _, s as U, t as B, v as W, I as j, w as q, x as z, y as O, z as Q, C as G } from "./chunks/index-C4H_NxAd.js";
|
|
2
|
+
import { _ as oa, $ as na, D as ta, O as ia, a3 as la, R as da, K as ca, K as ua, M as ha, a as pa, V as fa, am as ma, aa as Ca, Y as va, Q as ba, T as Da, a4 as ga, ac as ya, ab as xa, af as Ea, ag as Na, a9 as Sa, W as Ta, a8 as Pa, a1 as wa, a2 as Ma, a0 as ka, ad as Aa, a7 as Fa, a6 as La, a5 as Ra, ah as Ia, ae as Va, N as _a, aj as Ua, al as Ba, ak as Wa, g as ja, G as qa, Z as za, H as Oa, e as Qa, ai as Ga, f as Ha, A as Ka, J as Ya } from "./chunks/index-C4H_NxAd.js";
|
|
3
|
+
import { EMPTY_SELECTION as Ja } from "./types/index.js";
|
|
4
4
|
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
5
5
|
import * as p from "react";
|
|
6
6
|
import { useMemo as H } from "react";
|
|
7
|
-
import { ResourceManagementPanel as
|
|
8
|
-
import { A as
|
|
7
|
+
import { ResourceManagementPanel as Za } from "./chunks/resource-management-panel-CmaSAoHN.js";
|
|
8
|
+
import { A as ee, D as se, S as re, U as oe, V as ne, u as te } from "./chunks/dashboard-export-dialog-D9RPWq-E.js";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
/**
|
|
11
11
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -13,7 +13,7 @@ import "react-dom";
|
|
|
13
13
|
* This source code is licensed under the ISC license.
|
|
14
14
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
const K =
|
|
16
|
+
const K = T("RefreshCw", [
|
|
17
17
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
18
18
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
19
19
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
@@ -25,7 +25,7 @@ function aa(s) {
|
|
|
25
25
|
id: s.dashboardId
|
|
26
26
|
// override the id to the dashboard id so that the dashboard is not loaded
|
|
27
27
|
};
|
|
28
|
-
return /* @__PURE__ */ a(
|
|
28
|
+
return /* @__PURE__ */ a(y, { FallbackComponent: P, children: /* @__PURE__ */ a(w, { dashboardProps: d, children: /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(k, { displayPreferences: o, children: /* @__PURE__ */ a(A, { type: "visual", ...d, children: /* @__PURE__ */ a(Y, { cardId: s.cardId }) }) }) }) }) });
|
|
29
29
|
}
|
|
30
30
|
function Y({ cardId: s }) {
|
|
31
31
|
const o = F((r) => {
|
|
@@ -41,7 +41,7 @@ function Y({ cardId: s }) {
|
|
|
41
41
|
return { card: f, frame: m };
|
|
42
42
|
}, [o, s]);
|
|
43
43
|
return !i || !d ? /* @__PURE__ */ a(
|
|
44
|
-
|
|
44
|
+
g,
|
|
45
45
|
{
|
|
46
46
|
error: new Error("Card not found"),
|
|
47
47
|
resetErrorBoundary: () => {
|
|
@@ -49,13 +49,13 @@ function Y({ cardId: s }) {
|
|
|
49
49
|
customerFacingMessage: `Card not found with ID: ${s}`
|
|
50
50
|
}
|
|
51
51
|
) : /* @__PURE__ */ a("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ a(
|
|
52
|
-
|
|
52
|
+
y,
|
|
53
53
|
{
|
|
54
54
|
FallbackComponent: ({
|
|
55
55
|
error: r,
|
|
56
56
|
resetErrorBoundary: n
|
|
57
57
|
}) => /* @__PURE__ */ a(
|
|
58
|
-
|
|
58
|
+
g,
|
|
59
59
|
{
|
|
60
60
|
error: r,
|
|
61
61
|
resetErrorBoundary: n,
|
|
@@ -86,7 +86,7 @@ function ea({
|
|
|
86
86
|
var t;
|
|
87
87
|
return r ? "Loading..." : n ? "Error" : i ? (t = o == null ? void 0 : o.find((u) => u.id === i)) == null ? void 0 : t.name : `Select ${s}`;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function S(t, u) {
|
|
90
90
|
d(u), D(!1);
|
|
91
91
|
}
|
|
92
92
|
return /* @__PURE__ */ l(R, { open: b, onOpenChange: D, children: [
|
|
@@ -136,7 +136,7 @@ function ea({
|
|
|
136
136
|
{
|
|
137
137
|
className: "overflow-x-auto",
|
|
138
138
|
value: t.name,
|
|
139
|
-
onSelect: (u) =>
|
|
139
|
+
onSelect: (u) => S(u, t.id),
|
|
140
140
|
children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
141
141
|
/* @__PURE__ */ a(
|
|
142
142
|
G,
|
|
@@ -159,39 +159,39 @@ function ea({
|
|
|
159
159
|
] });
|
|
160
160
|
}
|
|
161
161
|
export {
|
|
162
|
-
|
|
162
|
+
ee as AdvancedModeToggle,
|
|
163
163
|
oa as CALCULATED_FIELD_ENTITY_MARKER,
|
|
164
164
|
ea as Combobox,
|
|
165
165
|
na as DATE_FORMAT_VALUES,
|
|
166
166
|
ta as Dashboard,
|
|
167
|
-
|
|
167
|
+
se as DashboardExportDialog,
|
|
168
168
|
ia as DashboardWC,
|
|
169
|
-
|
|
169
|
+
Ja as EMPTY_SELECTION,
|
|
170
170
|
la as PivotMarkerEnum,
|
|
171
|
-
|
|
171
|
+
Za as ResourceManagementPanel,
|
|
172
172
|
da as ResourceType,
|
|
173
|
-
|
|
173
|
+
re as ScheduleDashboard,
|
|
174
174
|
w as SemaphorContextProvider,
|
|
175
175
|
ca as SemaphorDataProvider,
|
|
176
176
|
ua as SemaphorQueryClient,
|
|
177
177
|
ha as ShareDialog,
|
|
178
178
|
pa as Surfboard,
|
|
179
|
-
|
|
179
|
+
oe as UnsavedChangesAlert,
|
|
180
180
|
aa as Visual,
|
|
181
|
-
|
|
181
|
+
ne as VisualEditingControls,
|
|
182
182
|
fa as cloneDeep,
|
|
183
183
|
ma as createEmptyKpiConfig,
|
|
184
184
|
Ca as createSqlGenConfig,
|
|
185
185
|
va as downloadPdf,
|
|
186
186
|
ba as emitDashboardLoad,
|
|
187
187
|
Da as emitDashboardUnload,
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
ga as fmt,
|
|
189
|
+
ya as getColumnDataType,
|
|
190
190
|
xa as getFilterValueType,
|
|
191
191
|
Ea as getFormattedTableNameForQuery,
|
|
192
192
|
Na as getQualifiedTableName,
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
Sa as getSql,
|
|
194
|
+
Ta as invalidateToken,
|
|
195
195
|
Pa as isBooleanDataType,
|
|
196
196
|
wa as isCalculatedDimension,
|
|
197
197
|
Ma as isCalculatedField,
|
|
@@ -214,6 +214,7 @@ export {
|
|
|
214
214
|
Qa as useEditorActions,
|
|
215
215
|
Ga as useEditorAside,
|
|
216
216
|
Ha as useEditorStore,
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
Ka as useManagementStore,
|
|
218
|
+
te as usePristineSnapshotInitializer,
|
|
219
|
+
Ya as useTextFilterHook
|
|
219
220
|
};
|
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-Cz1fGuVl.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|