react-semaphor 0.1.301 → 0.1.303
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/appearance/index.cjs +1 -0
- package/dist/appearance/index.js +9 -0
- package/dist/brand-studio/index.cjs +21 -0
- package/dist/brand-studio/index.js +1461 -0
- package/dist/chunks/dashboard-controls-BCJZOzrL.js +2226 -0
- package/dist/chunks/dashboard-controls-CVFoOPti.js +47 -0
- package/dist/chunks/dashboard-filter-controls-button-C-e7230k.js +11 -0
- package/dist/chunks/{dashboard-filter-controls-button-DjALRkvg.js → dashboard-filter-controls-button-Cfbac4Jw.js} +205 -216
- package/dist/chunks/dashboard-json-BM5ywMgp.js +1 -0
- package/dist/chunks/{dashboard-json-D-zIG46N.js → dashboard-json-BzvLPhGM.js} +14 -12
- package/dist/chunks/dashboard-summary-settings-dialog-BdxKl1UF.js +1 -0
- package/dist/chunks/{dashboard-summary-settings-dialog-D-F1eEJI.js → dashboard-summary-settings-dialog-ChK3344r.js} +64 -63
- package/dist/chunks/date-formatter-D9Bvw5Qk.js +1 -0
- package/dist/chunks/date-formatter-DyIOb6uC.js +333 -0
- package/dist/chunks/{edit-dashboard-visual-BjflrL8w.js → edit-dashboard-visual-D725CWD5.js} +6690 -6679
- package/dist/chunks/edit-dashboard-visual-nNaZ2IK1.js +183 -0
- package/dist/chunks/index-BWjB_9uz.js +1356 -0
- package/dist/chunks/index-CJdxSyQq.js +2578 -0
- package/dist/chunks/{index-DDA12yqV.js → index-CYWgnME0.js} +48994 -66425
- package/dist/chunks/index-D7KJindZ.js +1 -0
- package/dist/chunks/index-DFOb_6HB.js +1657 -0
- package/dist/chunks/index-DRlMUglg.js +4 -0
- package/dist/chunks/palette-B9DJXMGo.js +11 -0
- package/dist/chunks/palette-DGOzbtsn.js +43 -0
- package/dist/chunks/{resource-management-panel-B2558XA1.js → resource-management-panel-CE0-NcLL.js} +116 -115
- package/dist/chunks/resource-management-panel-mJmc5dMT.js +6 -0
- package/dist/chunks/rotate-ccw-Bs7YJn10.js +6 -0
- package/dist/chunks/rotate-ccw-YsjQwpKm.js +14 -0
- package/dist/chunks/save-Bj1y1rug.js +6 -0
- package/dist/chunks/save-CUrexoNl.js +21 -0
- package/dist/chunks/switch-CiEX68py.js +163 -0
- package/dist/chunks/switch-oojO-gal.js +19730 -0
- package/dist/chunks/{use-create-flow-overlay-state-BUw_JtLs.js → use-create-flow-overlay-state-BHDKxe7I.js} +396 -412
- package/dist/chunks/use-create-flow-overlay-state-D2I2wNey.js +16 -0
- package/dist/chunks/{use-visual-utils-C45OxsOf.js → use-visual-utils-CjFzlR0P.js} +54 -53
- package/dist/chunks/use-visual-utils-DYDXMl5v.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/format-utils/index.cjs +1 -1
- package/dist/format-utils/index.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +210 -207
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/appearance.d.ts +176 -0
- package/dist/types/brand-studio.d.ts +245 -0
- package/dist/types/dashboard.d.ts +134 -0
- package/dist/types/main.d.ts +142 -1
- package/dist/types/surfboard.d.ts +134 -0
- package/dist/types/types.d.ts +139 -0
- package/package.json +13 -1
- package/dist/chunks/braces-Bhqo4iW1.js +0 -23
- package/dist/chunks/braces-BwK7fWd_.js +0 -6
- package/dist/chunks/dashboard-controls-BIRiWCUK.js +0 -47
- package/dist/chunks/dashboard-controls-DIlnYo96.js +0 -2219
- package/dist/chunks/dashboard-filter-controls-button-CK1-mKQh.js +0 -11
- package/dist/chunks/dashboard-json-DK4mQ1gS.js +0 -1
- package/dist/chunks/dashboard-summary-settings-dialog-DSxNqxFI.js +0 -1
- package/dist/chunks/date-formatter-CqXdM6JO.js +0 -1
- package/dist/chunks/date-formatter-vkCj9Ct-.js +0 -1982
- package/dist/chunks/edit-dashboard-visual-DCsrtJr_.js +0 -193
- package/dist/chunks/index-8GnvL1_L.js +0 -1523
- package/dist/chunks/resource-management-panel-CKp4_aem.js +0 -6
- package/dist/chunks/use-create-flow-overlay-state-CWcCdPbC.js +0 -21
- package/dist/chunks/use-visual-utils-DyaThRzf.js +0 -1
package/dist/chunks/{resource-management-panel-B2558XA1.js → resource-management-panel-CE0-NcLL.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n, Fragment as le } from "react/jsx-runtime";
|
|
2
|
-
import { c as je, u as ne,
|
|
3
|
-
import
|
|
4
|
-
import { u as
|
|
2
|
+
import { c as je, u as ne, n as Fe, a as Z, B as I, f as se, s as be, w as ze, L as fe, I as ge, X as Be, z as He, A as Ke, D as _e, F as We, af as Ye } from "./switch-oojO-gal.js";
|
|
3
|
+
import Xe, { useRef as $e, useEffect as ae, useState as b } from "react";
|
|
4
|
+
import { v as de, bL as Ge, bM as Qe, bE as ie, bN as Ze, bO as qe, bP as Je, bQ as ke, bR as Q, bS as et, bT as tt, bU as nt, bV as xe, bs as ce, bW as at, bX as st, bY as we, bZ as Ne, b_ as ot, a0 as ye, Y as Ce, b$ as ve, c0 as Se, c1 as Ee, c2 as Ve, c3 as Le, c4 as Ae, c5 as Oe, c6 as Re, c7 as Te, c8 as rt, c9 as ue, ca as it, W as te, u as lt, cb as Ue, b as dt, c as ct, d as ut, e as ht, f as pt, o as mt, cc as ft, cd as De, ce as gt, cf as xt } from "./index-CYWgnME0.js";
|
|
5
|
+
import { u as Ie } from "./use-visual-utils-CjFzlR0P.js";
|
|
5
6
|
/**
|
|
6
7
|
* @license lucide-react v0.453.0 - ISC
|
|
7
8
|
*
|
|
@@ -17,11 +18,11 @@ const Dt = je("FolderOpen", [
|
|
|
17
18
|
}
|
|
18
19
|
]
|
|
19
20
|
]);
|
|
20
|
-
function
|
|
21
|
-
const { enabled: p = !0, eventType: l = "mousedown" } = m, i =
|
|
21
|
+
function bt(t, m = {}) {
|
|
22
|
+
const { enabled: p = !0, eventType: l = "mousedown" } = m, i = $e(null);
|
|
22
23
|
return ae(() => {
|
|
23
|
-
const h = (
|
|
24
|
-
const o =
|
|
24
|
+
const h = (w) => {
|
|
25
|
+
const o = w.target;
|
|
25
26
|
i.current && i.current.contains(o) || o instanceof Element && (o.closest("[data-radix-popper-content-wrapper]") || o.closest("[data-radix-select-content]") || o.closest("[data-radix-popover-content]") || o.closest("[data-radix-dropdown-menu-content]") || o.closest("[data-radix-tooltip-content]") || o.closest('[role="listbox"]') || o.closest('[role="option"]') || o.closest('[role="combobox"]')) || o instanceof Element && o.hasAttribute("data-radix-") || t();
|
|
26
27
|
};
|
|
27
28
|
return p && document.addEventListener(l, h), () => {
|
|
@@ -45,24 +46,24 @@ function Me() {
|
|
|
45
46
|
m
|
|
46
47
|
)) });
|
|
47
48
|
}
|
|
48
|
-
const
|
|
49
|
+
const wt = (t) => {
|
|
49
50
|
const m = ne((i) => i.isVisualEditing), p = ne((i) => i.selectedFrameId), l = Fe((i) => i.frame);
|
|
50
51
|
return !!(m && p && (l == null ? void 0 : l.visualId) === t);
|
|
51
52
|
};
|
|
52
|
-
function
|
|
53
|
+
function Nt({
|
|
53
54
|
visual: t,
|
|
54
55
|
isDeleting: m,
|
|
55
56
|
isDuplicating: p,
|
|
56
57
|
onAddVisual: l,
|
|
57
58
|
onOpenVisual: i,
|
|
58
59
|
onEditDetails: h,
|
|
59
|
-
onDeleteClick:
|
|
60
|
+
onDeleteClick: w,
|
|
60
61
|
onDuplicateVisual: o,
|
|
61
|
-
onShareVisual:
|
|
62
|
+
onShareVisual: N,
|
|
62
63
|
formatDate: y
|
|
63
64
|
}) {
|
|
64
65
|
var M, U, j, F;
|
|
65
|
-
const { selectVisual: f } = de(), d =
|
|
66
|
+
const { selectVisual: f } = de(), d = Ge(t.id), u = wt(t.id), A = ne((r) => r.isVisualEditing), { isConsoleMode: T } = Qe(), x = Xe.useRef(null), [S, E] = b(!1), [V, O] = b(!1);
|
|
66
67
|
ae(() => {
|
|
67
68
|
p ? (E(!0), O(!0)) : V && (E(!1), O(!1));
|
|
68
69
|
}, [p, V]), ae(() => {
|
|
@@ -80,7 +81,7 @@ function bt({
|
|
|
80
81
|
"div",
|
|
81
82
|
{
|
|
82
83
|
ref: x,
|
|
83
|
-
className:
|
|
84
|
+
className: Z(
|
|
84
85
|
"group flex cursor-pointer items-start gap-1 rounded-[5px] px-2 py-1.5 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",
|
|
85
86
|
u ? "bg-muted ring-1 ring-inset ring-foreground/20" : d && "bg-muted"
|
|
86
87
|
),
|
|
@@ -116,7 +117,7 @@ function bt({
|
|
|
116
117
|
/* @__PURE__ */ e(
|
|
117
118
|
"div",
|
|
118
119
|
{
|
|
119
|
-
className:
|
|
120
|
+
className: Z(
|
|
120
121
|
"flex shrink-0 items-center transition-opacity",
|
|
121
122
|
d || u || S ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100"
|
|
122
123
|
),
|
|
@@ -140,30 +141,30 @@ function bt({
|
|
|
140
141
|
}
|
|
141
142
|
),
|
|
142
143
|
/* @__PURE__ */ n(
|
|
143
|
-
|
|
144
|
+
Ze,
|
|
144
145
|
{
|
|
145
146
|
modal: !1,
|
|
146
147
|
open: S,
|
|
147
148
|
onOpenChange: E,
|
|
148
149
|
children: [
|
|
149
|
-
/* @__PURE__ */ e(
|
|
150
|
+
/* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
150
151
|
I,
|
|
151
152
|
{
|
|
152
153
|
size: "xs",
|
|
153
154
|
variant: "ghost",
|
|
154
155
|
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent/50",
|
|
155
156
|
"aria-label": "Open visual actions",
|
|
156
|
-
children: /* @__PURE__ */ e(
|
|
157
|
+
children: /* @__PURE__ */ e(Je, { className: "h-3.5 w-3.5" })
|
|
157
158
|
}
|
|
158
159
|
) }),
|
|
159
160
|
/* @__PURE__ */ n(
|
|
160
|
-
|
|
161
|
+
ke,
|
|
161
162
|
{
|
|
162
163
|
align: "end",
|
|
163
164
|
className: "z-[51] w-44 rounded-[6px] border border-border/60 p-1 shadow-sm",
|
|
164
165
|
children: [
|
|
165
166
|
/* @__PURE__ */ n(
|
|
166
|
-
|
|
167
|
+
Q,
|
|
167
168
|
{
|
|
168
169
|
onClick: (r) => {
|
|
169
170
|
r.stopPropagation(), l(t);
|
|
@@ -176,7 +177,7 @@ function bt({
|
|
|
176
177
|
}
|
|
177
178
|
),
|
|
178
179
|
/* @__PURE__ */ n(
|
|
179
|
-
|
|
180
|
+
Q,
|
|
180
181
|
{
|
|
181
182
|
onClick: (r) => {
|
|
182
183
|
r.stopPropagation(), i == null || i(t);
|
|
@@ -188,49 +189,49 @@ function bt({
|
|
|
188
189
|
}
|
|
189
190
|
),
|
|
190
191
|
/* @__PURE__ */ n(
|
|
191
|
-
|
|
192
|
+
Q,
|
|
192
193
|
{
|
|
193
194
|
onClick: (r) => {
|
|
194
195
|
r.preventDefault(), r.stopPropagation(), o(t.id);
|
|
195
196
|
},
|
|
196
197
|
disabled: p,
|
|
197
198
|
children: [
|
|
198
|
-
p ? /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(
|
|
199
|
+
p ? /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
|
|
199
200
|
p ? "Duplicating…" : "Duplicate"
|
|
200
201
|
]
|
|
201
202
|
}
|
|
202
203
|
),
|
|
203
204
|
t.ownership.isOwner && /* @__PURE__ */ n(le, { children: [
|
|
204
205
|
/* @__PURE__ */ n(
|
|
205
|
-
|
|
206
|
+
Q,
|
|
206
207
|
{
|
|
207
208
|
onClick: (r) => {
|
|
208
209
|
r.stopPropagation(), h == null || h(t);
|
|
209
210
|
},
|
|
210
211
|
children: [
|
|
211
|
-
/* @__PURE__ */ e(
|
|
212
|
+
/* @__PURE__ */ e(tt, { className: "h-3.5 w-3.5" }),
|
|
212
213
|
"Edit details"
|
|
213
214
|
]
|
|
214
215
|
}
|
|
215
216
|
),
|
|
216
217
|
/* @__PURE__ */ n(
|
|
217
|
-
|
|
218
|
+
Q,
|
|
218
219
|
{
|
|
219
220
|
onClick: (r) => {
|
|
220
|
-
r.stopPropagation(),
|
|
221
|
+
r.stopPropagation(), N(t);
|
|
221
222
|
},
|
|
222
223
|
children: [
|
|
223
|
-
/* @__PURE__ */ e(
|
|
224
|
+
/* @__PURE__ */ e(nt, { className: "h-3.5 w-3.5" }),
|
|
224
225
|
"Share"
|
|
225
226
|
]
|
|
226
227
|
}
|
|
227
228
|
),
|
|
228
|
-
/* @__PURE__ */ e(
|
|
229
|
+
/* @__PURE__ */ e(xe, {}),
|
|
229
230
|
/* @__PURE__ */ n(
|
|
230
|
-
|
|
231
|
+
Q,
|
|
231
232
|
{
|
|
232
233
|
onClick: (r) => {
|
|
233
|
-
r.stopPropagation(),
|
|
234
|
+
r.stopPropagation(), w(t);
|
|
234
235
|
},
|
|
235
236
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
236
237
|
disabled: m,
|
|
@@ -241,14 +242,14 @@ function bt({
|
|
|
241
242
|
}
|
|
242
243
|
)
|
|
243
244
|
] }),
|
|
244
|
-
/* @__PURE__ */ e(
|
|
245
|
+
/* @__PURE__ */ e(xe, {}),
|
|
245
246
|
/* @__PURE__ */ n("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
246
247
|
(((U = t.ownership.createdBy) == null ? void 0 : U.type) === "tenant" || ((j = t.ownership.createdBy) == null ? void 0 : j.type) === "organization" && T) && /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
|
|
247
|
-
/* @__PURE__ */ e(
|
|
248
|
+
/* @__PURE__ */ e(at, { className: "h-3 w-3" }),
|
|
248
249
|
/* @__PURE__ */ e("span", { children: ((F = t.ownership.createdBy) == null ? void 0 : F.name) || "Unknown" })
|
|
249
250
|
] }),
|
|
250
251
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
|
|
251
|
-
/* @__PURE__ */ e(
|
|
252
|
+
/* @__PURE__ */ e(st, { className: "h-3 w-3" }),
|
|
252
253
|
/* @__PURE__ */ e("span", { children: y(t.lastModified) })
|
|
253
254
|
] })
|
|
254
255
|
] })
|
|
@@ -266,9 +267,9 @@ function bt({
|
|
|
266
267
|
);
|
|
267
268
|
}
|
|
268
269
|
function yt({ searchQuery: t }) {
|
|
269
|
-
const [m, p] =
|
|
270
|
+
const [m, p] = b(!1), [l, i] = b(
|
|
270
271
|
null
|
|
271
|
-
), [h,
|
|
272
|
+
), [h, w] = b(!1), [o, N] = b(null), [y, f] = b(null), [d, u] = b(
|
|
272
273
|
null
|
|
273
274
|
), { handleEditLibraryVisual: A, handleAddLibraryVisual: T } = Ie(), {
|
|
274
275
|
resources: x,
|
|
@@ -279,7 +280,7 @@ function yt({ searchQuery: t }) {
|
|
|
279
280
|
duplicateResource: C,
|
|
280
281
|
isDeleting: v
|
|
281
282
|
} = we(() => {
|
|
282
|
-
|
|
283
|
+
w(!1), N(null);
|
|
283
284
|
}), M = x.filter(
|
|
284
285
|
(s) => {
|
|
285
286
|
var R, c;
|
|
@@ -290,12 +291,12 @@ function yt({ searchQuery: t }) {
|
|
|
290
291
|
day: "numeric",
|
|
291
292
|
year: "numeric"
|
|
292
293
|
}), j = (s) => {
|
|
293
|
-
|
|
294
|
+
N(s), w(!0);
|
|
294
295
|
}, F = () => {
|
|
295
296
|
o && O(o.id);
|
|
296
297
|
}, {
|
|
297
298
|
startUpdating: r,
|
|
298
|
-
stopUpdating:
|
|
299
|
+
stopUpdating: Y,
|
|
299
300
|
isUpdating: B
|
|
300
301
|
} = Ne(), L = (s, R, c) => {
|
|
301
302
|
var ee;
|
|
@@ -315,27 +316,27 @@ function yt({ searchQuery: t }) {
|
|
|
315
316
|
{
|
|
316
317
|
onSuccess: () => {
|
|
317
318
|
var P;
|
|
318
|
-
|
|
319
|
+
Y(s, K), (P = c == null ? void 0 : c.onSuccess) == null || P.call(c);
|
|
319
320
|
},
|
|
320
321
|
onError: () => {
|
|
321
322
|
var P;
|
|
322
|
-
|
|
323
|
+
Y(s, K), (P = c == null ? void 0 : c.onError) == null || P.call(c);
|
|
323
324
|
}
|
|
324
325
|
}
|
|
325
326
|
);
|
|
326
|
-
},
|
|
327
|
+
}, X = (s) => {
|
|
327
328
|
f(s), C(s, {
|
|
328
329
|
onSettled: () => f(null)
|
|
329
330
|
});
|
|
330
331
|
}, H = (s) => {
|
|
331
332
|
A(s);
|
|
332
|
-
}, G = (s) => {
|
|
333
|
-
T(s);
|
|
334
333
|
}, $ = (s) => {
|
|
334
|
+
T(s);
|
|
335
|
+
}, G = (s) => {
|
|
335
336
|
i(s), p(!0);
|
|
336
|
-
},
|
|
337
|
+
}, q = (s) => {
|
|
337
338
|
u(s);
|
|
338
|
-
},
|
|
339
|
+
}, J = () => {
|
|
339
340
|
u(null);
|
|
340
341
|
}, k = ({
|
|
341
342
|
title: s,
|
|
@@ -363,19 +364,19 @@ function yt({ searchQuery: t }) {
|
|
|
363
364
|
)
|
|
364
365
|
] }) }) : /* @__PURE__ */ n("div", { className: "flex h-full flex-1 flex-col", children: [
|
|
365
366
|
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto", children: M.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-1.5 px-4 py-10 text-center", children: [
|
|
366
|
-
/* @__PURE__ */ e(
|
|
367
|
+
/* @__PURE__ */ e(ot, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
367
368
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-medium text-foreground", children: t ? "No visuals found" : "No visuals yet" }),
|
|
368
369
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: t ? "Try adjusting your search." : 'Click "New" above to add your first visual.' })
|
|
369
370
|
] }) : M.map((s) => /* @__PURE__ */ e(
|
|
370
|
-
|
|
371
|
+
Nt,
|
|
371
372
|
{
|
|
372
373
|
visual: s,
|
|
373
|
-
onAddVisual:
|
|
374
|
+
onAddVisual: $,
|
|
374
375
|
onOpenVisual: H,
|
|
375
|
-
onEditDetails:
|
|
376
|
+
onEditDetails: q,
|
|
376
377
|
onDeleteClick: j,
|
|
377
|
-
onDuplicateVisual:
|
|
378
|
-
onShareVisual:
|
|
378
|
+
onDuplicateVisual: X,
|
|
379
|
+
onShareVisual: G,
|
|
379
380
|
isDeleting: v,
|
|
380
381
|
isDuplicating: y === s.id,
|
|
381
382
|
formatDate: U
|
|
@@ -399,7 +400,7 @@ function yt({ searchQuery: t }) {
|
|
|
399
400
|
resourceLabel: "Visual",
|
|
400
401
|
initialTitle: d.title || "",
|
|
401
402
|
initialDescription: d.description || "",
|
|
402
|
-
onClose:
|
|
403
|
+
onClose: J,
|
|
403
404
|
onSave: k,
|
|
404
405
|
isSaving: B(d.id)
|
|
405
406
|
}
|
|
@@ -409,7 +410,7 @@ function yt({ searchQuery: t }) {
|
|
|
409
410
|
{
|
|
410
411
|
open: h,
|
|
411
412
|
onOpenChange: (s) => {
|
|
412
|
-
!s && v || (
|
|
413
|
+
!s && v || (w(s), s || N(null));
|
|
413
414
|
},
|
|
414
415
|
children: /* @__PURE__ */ n(Ee, { children: [
|
|
415
416
|
/* @__PURE__ */ n(Ve, { children: [
|
|
@@ -448,13 +449,13 @@ function Ct({
|
|
|
448
449
|
onLoadDashboard: l,
|
|
449
450
|
onEditDetails: i,
|
|
450
451
|
onDeleteClick: h,
|
|
451
|
-
onDuplicateDashboard:
|
|
452
|
+
onDuplicateDashboard: w,
|
|
452
453
|
onShareDashboard: o,
|
|
453
|
-
formatDate:
|
|
454
|
+
formatDate: N,
|
|
454
455
|
onDashboardItemClick: y
|
|
455
456
|
}) {
|
|
456
457
|
var V, O;
|
|
457
|
-
const { selectDashboard: f } = de(), d =
|
|
458
|
+
const { selectDashboard: f } = de(), d = rt(t.id), { userContext: u, isLoading: A } = ue(), T = ((V = u == null ? void 0 : u.permissions) == null ? void 0 : V.canEdit) ?? !1, x = A || !T, S = () => {
|
|
458
459
|
f(t), l(t.id), y == null || y(t.id);
|
|
459
460
|
}, E = (C) => {
|
|
460
461
|
C.currentTarget === C.target && (C.key === "Enter" || C.key === " ") && (C.preventDefault(), S());
|
|
@@ -462,7 +463,7 @@ function Ct({
|
|
|
462
463
|
return /* @__PURE__ */ n(
|
|
463
464
|
"div",
|
|
464
465
|
{
|
|
465
|
-
className:
|
|
466
|
+
className: Z(
|
|
466
467
|
"group flex cursor-pointer items-start gap-1 rounded-[5px] px-2 py-1.5 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",
|
|
467
468
|
d && "bg-muted"
|
|
468
469
|
),
|
|
@@ -498,12 +499,12 @@ function Ct({
|
|
|
498
499
|
/* @__PURE__ */ e(
|
|
499
500
|
"div",
|
|
500
501
|
{
|
|
501
|
-
className:
|
|
502
|
+
className: Z(
|
|
502
503
|
"shrink-0 transition-opacity",
|
|
503
504
|
d ? "opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"
|
|
504
505
|
),
|
|
505
506
|
children: /* @__PURE__ */ e(
|
|
506
|
-
|
|
507
|
+
it,
|
|
507
508
|
{
|
|
508
509
|
dashboard: t,
|
|
509
510
|
isDeleting: m,
|
|
@@ -511,9 +512,9 @@ function Ct({
|
|
|
511
512
|
shouldHideActions: x,
|
|
512
513
|
onEditDetails: i,
|
|
513
514
|
onDeleteClick: h,
|
|
514
|
-
onDuplicateDashboard:
|
|
515
|
+
onDuplicateDashboard: w,
|
|
515
516
|
onShareDashboard: o,
|
|
516
|
-
formatDate:
|
|
517
|
+
formatDate: N
|
|
517
518
|
}
|
|
518
519
|
)
|
|
519
520
|
}
|
|
@@ -530,9 +531,9 @@ function vt({ onRetry: t }) {
|
|
|
530
531
|
}
|
|
531
532
|
function St(t) {
|
|
532
533
|
var he;
|
|
533
|
-
const { searchQuery: m, onLoadDashboard: p, onEditDashboard: l, onDashboardItemClick: i } = t, [h,
|
|
534
|
+
const { searchQuery: m, onLoadDashboard: p, onEditDashboard: l, onDashboardItemClick: i } = t, [h, w] = b(!1), [o, N] = b(
|
|
534
535
|
null
|
|
535
|
-
), [y, f] =
|
|
536
|
+
), [y, f] = b(!1), [d, u] = b(null), [A, T] = b(null), [x, S] = b(null), E = te(
|
|
536
537
|
(a) => a.lastSelectedDashboard
|
|
537
538
|
), V = te(
|
|
538
539
|
(a) => a.selectedDashboard
|
|
@@ -540,33 +541,33 @@ function St(t) {
|
|
|
540
541
|
(a) => a.actions.selectDashboard
|
|
541
542
|
), C = te(
|
|
542
543
|
(a) => a.actions.clearSelectedDashboard
|
|
543
|
-
), { tokenProps: v, id: M } =
|
|
544
|
+
), { tokenProps: v, id: M } = lt(), {
|
|
544
545
|
resources: U,
|
|
545
546
|
isLoading: j,
|
|
546
547
|
isError: F,
|
|
547
548
|
updateResource: r,
|
|
548
|
-
deleteResource:
|
|
549
|
+
deleteResource: Y,
|
|
549
550
|
duplicateResource: B,
|
|
550
551
|
isDeleting: L
|
|
551
552
|
} = Ue(() => {
|
|
552
553
|
f(!1);
|
|
553
554
|
const a = d == null ? void 0 : d.id;
|
|
554
555
|
u(null), (V == null ? void 0 : V.id) === a && (!(v != null && v.dashboard_id) && !M ? C() : E && E.id !== a && O(E));
|
|
555
|
-
}), { userContext:
|
|
556
|
+
}), { userContext: X } = ue(), H = ((he = X == null ? void 0 : X.permissions) == null ? void 0 : he.canCreateDashboard) ?? !1, $ = U.filter(
|
|
556
557
|
(a) => {
|
|
557
558
|
var _, g;
|
|
558
559
|
return ((_ = a == null ? void 0 : a.title) == null ? void 0 : _.toLowerCase().includes(m.toLowerCase())) || ((g = a == null ? void 0 : a.description) == null ? void 0 : g.toLowerCase().includes(m.toLowerCase()));
|
|
559
560
|
}
|
|
560
|
-
),
|
|
561
|
+
), G = (a) => new Date(a).toLocaleDateString("en-US", {
|
|
561
562
|
month: "short",
|
|
562
563
|
day: "numeric",
|
|
563
564
|
year: "numeric"
|
|
564
|
-
}),
|
|
565
|
+
}), q = (a) => {
|
|
565
566
|
p == null || p(a);
|
|
566
|
-
},
|
|
567
|
+
}, J = (a) => {
|
|
567
568
|
u(a), f(!0);
|
|
568
569
|
}, k = () => {
|
|
569
|
-
d &&
|
|
570
|
+
d && Y(d.id);
|
|
570
571
|
}, s = (a) => {
|
|
571
572
|
T(a), B(a, {
|
|
572
573
|
onSettled: () => T(null)
|
|
@@ -602,7 +603,7 @@ function St(t) {
|
|
|
602
603
|
}
|
|
603
604
|
);
|
|
604
605
|
}, K = (a) => {
|
|
605
|
-
|
|
606
|
+
N(a), w(!0);
|
|
606
607
|
}, ee = (a) => {
|
|
607
608
|
l == null || l(a.id), S(a);
|
|
608
609
|
}, P = () => {
|
|
@@ -621,22 +622,22 @@ function St(t) {
|
|
|
621
622
|
});
|
|
622
623
|
};
|
|
623
624
|
return j ? /* @__PURE__ */ e(Me, {}) : F ? /* @__PURE__ */ e(vt, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ n("div", { className: "flex h-full flex-1 flex-col", children: [
|
|
624
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto", children:
|
|
625
|
-
/* @__PURE__ */ e(
|
|
625
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto", children: $.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-1.5 px-4 py-10 text-center", children: [
|
|
626
|
+
/* @__PURE__ */ e(ze, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
626
627
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-medium text-foreground", children: m ? "No dashboards found" : "No dashboards yet" }),
|
|
627
628
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: m ? "Try adjusting your search." : H ? 'Click "New" above to add your first dashboard.' : "No dashboards have been shared with you yet." })
|
|
628
|
-
] }) :
|
|
629
|
+
] }) : $.map((a) => /* @__PURE__ */ e(
|
|
629
630
|
Ct,
|
|
630
631
|
{
|
|
631
632
|
dashboard: a,
|
|
632
633
|
isDeleting: L,
|
|
633
634
|
isDuplicating: A === a.id,
|
|
634
|
-
onLoadDashboard:
|
|
635
|
+
onLoadDashboard: q,
|
|
635
636
|
onEditDetails: ee,
|
|
636
|
-
onDeleteClick:
|
|
637
|
+
onDeleteClick: J,
|
|
637
638
|
onDuplicateDashboard: s,
|
|
638
639
|
onShareDashboard: K,
|
|
639
|
-
formatDate:
|
|
640
|
+
formatDate: G,
|
|
640
641
|
onDashboardItemClick: i
|
|
641
642
|
},
|
|
642
643
|
a.id
|
|
@@ -647,7 +648,7 @@ function St(t) {
|
|
|
647
648
|
resource: o,
|
|
648
649
|
resourceType: Ce.DASHBOARD,
|
|
649
650
|
onClose: () => {
|
|
650
|
-
|
|
651
|
+
w(!1), N(null);
|
|
651
652
|
}
|
|
652
653
|
}
|
|
653
654
|
),
|
|
@@ -706,25 +707,25 @@ function Et({
|
|
|
706
707
|
onSubmit: p,
|
|
707
708
|
isCreating: l
|
|
708
709
|
}) {
|
|
709
|
-
const [i, h] =
|
|
710
|
+
const [i, h] = b(""), [w, o] = b("");
|
|
710
711
|
ae(() => {
|
|
711
712
|
t || (h(""), o(""));
|
|
712
713
|
}, [t]);
|
|
713
|
-
const
|
|
714
|
-
i.trim() && p({ title: i, description:
|
|
714
|
+
const N = () => {
|
|
715
|
+
i.trim() && p({ title: i, description: w });
|
|
715
716
|
}, y = (f) => {
|
|
716
717
|
m(f);
|
|
717
718
|
};
|
|
718
|
-
return /* @__PURE__ */ e(
|
|
719
|
-
/* @__PURE__ */ n(
|
|
720
|
-
/* @__PURE__ */ e(
|
|
721
|
-
/* @__PURE__ */ e(
|
|
719
|
+
return /* @__PURE__ */ e(dt, { open: t, onOpenChange: y, children: /* @__PURE__ */ n(ct, { children: [
|
|
720
|
+
/* @__PURE__ */ n(ut, { children: [
|
|
721
|
+
/* @__PURE__ */ e(ht, { children: "Create New Visual" }),
|
|
722
|
+
/* @__PURE__ */ e(pt, { children: "Add a new visual to your library. You can configure it after creation." })
|
|
722
723
|
] }),
|
|
723
724
|
/* @__PURE__ */ n("div", { className: "space-y-4 py-4", children: [
|
|
724
725
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
725
|
-
/* @__PURE__ */ e(
|
|
726
|
+
/* @__PURE__ */ e(fe, { htmlFor: "title", children: "Visual Title" }),
|
|
726
727
|
/* @__PURE__ */ e(
|
|
727
|
-
|
|
728
|
+
ge,
|
|
728
729
|
{
|
|
729
730
|
id: "title",
|
|
730
731
|
placeholder: "Enter visual title...",
|
|
@@ -732,26 +733,26 @@ function Et({
|
|
|
732
733
|
onChange: (f) => h(f.target.value),
|
|
733
734
|
disabled: l,
|
|
734
735
|
onKeyDown: (f) => {
|
|
735
|
-
f.key === "Enter" && !f.shiftKey && (f.preventDefault(),
|
|
736
|
+
f.key === "Enter" && !f.shiftKey && (f.preventDefault(), N());
|
|
736
737
|
}
|
|
737
738
|
}
|
|
738
739
|
)
|
|
739
740
|
] }),
|
|
740
741
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
741
|
-
/* @__PURE__ */ e(
|
|
742
|
+
/* @__PURE__ */ e(fe, { htmlFor: "description", children: "Description (optional)" }),
|
|
742
743
|
/* @__PURE__ */ e(
|
|
743
|
-
|
|
744
|
+
ge,
|
|
744
745
|
{
|
|
745
746
|
id: "description",
|
|
746
747
|
placeholder: "Enter visual description...",
|
|
747
|
-
value:
|
|
748
|
+
value: w,
|
|
748
749
|
onChange: (f) => o(f.target.value),
|
|
749
750
|
disabled: l
|
|
750
751
|
}
|
|
751
752
|
)
|
|
752
753
|
] })
|
|
753
754
|
] }),
|
|
754
|
-
/* @__PURE__ */ n(
|
|
755
|
+
/* @__PURE__ */ n(mt, { children: [
|
|
755
756
|
/* @__PURE__ */ e(
|
|
756
757
|
I,
|
|
757
758
|
{
|
|
@@ -764,7 +765,7 @@ function Et({
|
|
|
764
765
|
/* @__PURE__ */ e(
|
|
765
766
|
I,
|
|
766
767
|
{
|
|
767
|
-
onClick:
|
|
768
|
+
onClick: N,
|
|
768
769
|
disabled: !i.trim() || l,
|
|
769
770
|
children: l ? /* @__PURE__ */ n(le, { children: [
|
|
770
771
|
/* @__PURE__ */ e(se, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
@@ -775,7 +776,7 @@ function Et({
|
|
|
775
776
|
] })
|
|
776
777
|
] }) });
|
|
777
778
|
}
|
|
778
|
-
function
|
|
779
|
+
function Tt({
|
|
779
780
|
isOpen: t,
|
|
780
781
|
onClose: m,
|
|
781
782
|
className: p,
|
|
@@ -785,7 +786,7 @@ function Rt({
|
|
|
785
786
|
var c, z;
|
|
786
787
|
const h = ne(
|
|
787
788
|
(D) => D.isDashboardEditing
|
|
788
|
-
), [
|
|
789
|
+
), [w, o] = b(!1), [N, y] = b(""), [f, d] = b(!1), { currentUser: u, userContext: A } = ue(), T = ((c = A == null ? void 0 : A.permissions) == null ? void 0 : c.canCreateDashboard) ?? !1, { onCreateSuccess: x } = ft({
|
|
789
790
|
onDashboardSelect: l
|
|
790
791
|
}), { selectVisual: S } = de(), { handleEditLibraryVisual: E } = Ie(), {
|
|
791
792
|
createResource: V,
|
|
@@ -797,11 +798,11 @@ function Rt({
|
|
|
797
798
|
(D) => {
|
|
798
799
|
o(!1), D && (S(D), E(D));
|
|
799
800
|
}
|
|
800
|
-
), U = i === "overlay", j = h ? "New Visual" : "New", F = h ? "New Visual" : "New Dashboard", r = h ? "Search visuals..." : "Search dashboards...",
|
|
801
|
+
), U = i === "overlay", j = h ? "New Visual" : "New", F = h ? "New Visual" : "New Dashboard", r = h ? "Search visuals..." : "Search dashboards...", Y = h ? "Collapse visuals panel" : "Collapse dashboard panel", B = ((u == null ? void 0 : u.name) ?? "").trim(), L = ((u == null ? void 0 : u.email) ?? "").trim(), H = B && B.toLowerCase() !== "undefined" ? B : L || "Current user", $ = ((z = H.charAt(0)) == null ? void 0 : z.toUpperCase()) || "?", G = L && L.toLowerCase() !== "undefined" ? L : "", q = bt(m, {
|
|
801
802
|
enabled: t && U
|
|
802
|
-
}),
|
|
803
|
+
}), J = Z(
|
|
803
804
|
"flex h-full flex-col border-r border-border/60 bg-background",
|
|
804
|
-
U ?
|
|
805
|
+
U ? Z(
|
|
805
806
|
"absolute inset-y-0 left-0 z-[51] w-60 overflow-hidden shadow-lg transition-transform duration-300 ease-in-out",
|
|
806
807
|
t ? "translate-x-0" : "pointer-events-none -translate-x-full"
|
|
807
808
|
) : "w-full max-w-[17rem] min-w-[11rem] overflow-hidden",
|
|
@@ -816,14 +817,14 @@ function Rt({
|
|
|
816
817
|
}
|
|
817
818
|
});
|
|
818
819
|
};
|
|
819
|
-
return /* @__PURE__ */ e(le, { children: (!U || t) && /* @__PURE__ */ n("div", { ref:
|
|
820
|
+
return /* @__PURE__ */ e(le, { children: (!U || t) && /* @__PURE__ */ n("div", { ref: q, className: J, children: [
|
|
820
821
|
/* @__PURE__ */ e("div", { className: "border-b border-border/60 bg-background", children: f ? /* @__PURE__ */ n("div", { className: "flex h-10 items-center gap-1 px-3", children: [
|
|
821
822
|
/* @__PURE__ */ e(De, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
822
823
|
/* @__PURE__ */ e(
|
|
823
824
|
"input",
|
|
824
825
|
{
|
|
825
826
|
autoFocus: !0,
|
|
826
|
-
value:
|
|
827
|
+
value: N,
|
|
827
828
|
onChange: (D) => y(D.target.value),
|
|
828
829
|
onKeyDown: (D) => {
|
|
829
830
|
D.key === "Escape" && (y(""), d(!1));
|
|
@@ -843,7 +844,7 @@ function Rt({
|
|
|
843
844
|
y(""), d(!1);
|
|
844
845
|
},
|
|
845
846
|
"aria-label": "Close search",
|
|
846
|
-
children: /* @__PURE__ */ e(
|
|
847
|
+
children: /* @__PURE__ */ e(Be, { className: "h-3.5 w-3.5" })
|
|
847
848
|
}
|
|
848
849
|
)
|
|
849
850
|
] }) : /* @__PURE__ */ n("div", { className: "flex h-10 items-center justify-between gap-2 px-3", children: [
|
|
@@ -880,48 +881,48 @@ function Rt({
|
|
|
880
881
|
variant: "ghost",
|
|
881
882
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
882
883
|
onClick: m,
|
|
883
|
-
"aria-label":
|
|
884
|
-
children: /* @__PURE__ */ e(
|
|
884
|
+
"aria-label": Y,
|
|
885
|
+
children: /* @__PURE__ */ e(gt, { className: "h-3.5 w-3.5" })
|
|
885
886
|
}
|
|
886
887
|
)
|
|
887
888
|
] })
|
|
888
889
|
] }) }),
|
|
889
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-1.5 py-2", children: h ? /* @__PURE__ */ e(yt, { searchQuery:
|
|
890
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-1.5 py-2", children: h ? /* @__PURE__ */ e(yt, { searchQuery: N }) : /* @__PURE__ */ e(
|
|
890
891
|
St,
|
|
891
892
|
{
|
|
892
|
-
searchQuery:
|
|
893
|
+
searchQuery: N,
|
|
893
894
|
onLoadDashboard: k,
|
|
894
895
|
onEditDashboard: s,
|
|
895
896
|
onDashboardItemClick: l
|
|
896
897
|
}
|
|
897
898
|
) }),
|
|
898
|
-
u && /* @__PURE__ */ e(
|
|
899
|
-
/* @__PURE__ */ e(
|
|
900
|
-
/* @__PURE__ */ e("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-medium text-muted-foreground", children:
|
|
899
|
+
u && /* @__PURE__ */ e(He, { children: /* @__PURE__ */ e("div", { className: "border-t border-border/60 px-3 py-2", children: /* @__PURE__ */ n(Ke, { children: [
|
|
900
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex cursor-default items-center gap-2", children: [
|
|
901
|
+
/* @__PURE__ */ e("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-medium text-muted-foreground", children: $ }),
|
|
901
902
|
/* @__PURE__ */ e("span", { className: "truncate text-[12px] text-muted-foreground", children: H })
|
|
902
903
|
] }) }),
|
|
903
|
-
/* @__PURE__ */ e(
|
|
904
|
+
/* @__PURE__ */ e(We, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ n("div", { className: "space-y-0.5", children: [
|
|
904
905
|
/* @__PURE__ */ e("div", { className: "font-medium", children: H }),
|
|
905
|
-
|
|
906
|
+
G && /* @__PURE__ */ e("div", { className: "text-[11px] opacity-80", children: G }),
|
|
906
907
|
u.role && /* @__PURE__ */ n("div", { className: "text-[11px] opacity-80", children: [
|
|
907
908
|
"Role:",
|
|
908
909
|
" ",
|
|
909
|
-
|
|
910
|
+
Ye(u.role.replace(/_/g, " "))
|
|
910
911
|
] })
|
|
911
912
|
] }) })
|
|
912
913
|
] }) }) }),
|
|
913
914
|
h ? /* @__PURE__ */ e(
|
|
914
915
|
Et,
|
|
915
916
|
{
|
|
916
|
-
open:
|
|
917
|
+
open: w,
|
|
917
918
|
onOpenChange: o,
|
|
918
919
|
onSubmit: v,
|
|
919
920
|
isCreating: M
|
|
920
921
|
}
|
|
921
922
|
) : /* @__PURE__ */ e(
|
|
922
|
-
|
|
923
|
+
xt,
|
|
923
924
|
{
|
|
924
|
-
open:
|
|
925
|
+
open: w,
|
|
925
926
|
onOpenChange: o,
|
|
926
927
|
onSubmit: R,
|
|
927
928
|
isCreating: O
|
|
@@ -930,5 +931,5 @@ function Rt({
|
|
|
930
931
|
] }) });
|
|
931
932
|
}
|
|
932
933
|
export {
|
|
933
|
-
|
|
934
|
+
Tt as ResourceManagementPanel
|
|
934
935
|
};
|