@burdenoff/microfe-bigconsole 2026.1122.2 → 2026.1122.3

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.
@@ -3,14 +3,14 @@ import e from "../../../hooks/useBigConsoleAnalytics.js";
3
3
  import t from "../../../hooks/useDashboardSharing.js";
4
4
  import { EmbedTab as n } from "./EmbedTab.js";
5
5
  import { AS_OF_PARAM as r, formatAsOf as i } from "../../../asof/asOfParam.js";
6
- import { useAsOf as ee } from "../../../asof/AsOfProvider.js";
7
- import { useShareRecipients as te } from "../../../hooks/useShareRecipients.js";
8
- import { useBigConsole as a, useBigConsoleBasePath as ne } from "../../../context/BigConsoleContext.js";
6
+ import { useAsOf as a } from "../../../asof/AsOfProvider.js";
7
+ import { useShareRecipients as ee } from "../../../hooks/useShareRecipients.js";
8
+ import { useBigConsole as o, useBigConsoleBasePath as te } from "../../../context/BigConsoleContext.js";
9
9
  import "../../../asof/index.js";
10
- import { useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
11
- import { ResponsiveDialog as u, ResponsiveDialogContent as re, ResponsiveDialogDescription as d, ResponsiveDialogTitle as ie } from "@burdenoff/fe-libs/ui";
10
+ import { useCallback as s, useEffect as c, useRef as l, useState as u } from "react";
11
+ import { ResponsiveDialog as ne, ResponsiveDialogContent as d, ResponsiveDialogDescription as re, ResponsiveDialogTitle as ie } from "@burdenoff/fe-libs/ui";
12
12
  import { useI18n as ae } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
13
+ import { Fragment as oe, jsx as f, jsxs as p } from "react/jsx-runtime";
14
14
  import { formatDistanceToNow as m } from "date-fns";
15
15
  // src/bigconsole/components/dashboard/ShareDialog/ShareDialog.tsx
16
16
  var h = {
@@ -51,29 +51,29 @@ var h = {
51
51
  description: "Can edit widgets, layout, and share"
52
52
  }];
53
53
  function v(e) {
54
- let { workspaceId: t, currentUser: n } = a(), r = c(null);
54
+ let { workspaceId: t, currentUser: n } = o(), r = l(null);
55
55
  return /* @__PURE__ */ f(y, {
56
56
  ...e,
57
57
  returnFocusRef: r
58
58
  }, `${n?.id ?? ""}|${t ?? ""}|${e.dashboardId}`);
59
59
  }
60
- function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility: y, onVisibilityChange: b, canChangeVisibility: S = !0, returnFocusRef: C }) {
61
- let { t: w } = ae(), { shares: T, loading: E, error: oe, fetchShares: D, shareWithUser: O, shareWithGroup: k, updateShare: A, revokeShare: j, revokeAllShares: M } = t(), N = e(), [P, F] = l(""), [I, L] = l(null), [R, se] = l("VIEW"), [z, ce] = l(""), [B, V] = l(!1), [H, U] = l("people"), [W, G] = l(!1), [K, q] = l(null), [J, Y] = l(null), X = te(m, P), Z = ee().asOf?.getTime() ?? null, Q = ne();
62
- s(() => {
60
+ function y({ dashboardId: o, dashboardName: l, isOpen: m, onClose: v, visibility: y, onVisibilityChange: b, canChangeVisibility: x = !0, returnFocusRef: S }) {
61
+ let { t: C } = ae(), { shares: w, loading: T, error: ce, fetchShares: E, shareWithUser: D, shareWithGroup: O, updateShare: k, revokeShare: A, revokeAllShares: j } = t(), M = e(), [N, P] = u(""), [F, I] = u(null), [L, le] = u("VIEW"), [R, ue] = u(""), [z, B] = u(!1), [V, H] = u("people"), [U, W] = u(!1), [G, K] = u(null), [q, J] = u(null), Y = a().asOf?.getTime() ?? null, X = Y !== null, Z = ee(m && !X, N), Q = te();
62
+ c(() => {
63
63
  let e = !1;
64
64
  return Promise.resolve().then(() => {
65
- e || (L(null), F(""), Y(null));
65
+ e || (I(null), P(""), J(null));
66
66
  }), () => {
67
67
  e = !0;
68
68
  };
69
69
  }, [
70
- X.owner,
71
- a,
70
+ Z.owner,
71
+ o,
72
72
  m
73
- ]), s(() => {
74
- if (m && a) {
75
- D(a);
76
- let e = new URL(`${Q}/dashboards/${encodeURIComponent(a)}`, window.location.origin), t = new URLSearchParams(window.location.search);
73
+ ]), c(() => {
74
+ if (m && o) {
75
+ X || E(o);
76
+ let e = new URL(`${Q}/dashboards/${encodeURIComponent(o)}`, window.location.origin), t = new URLSearchParams(window.location.search);
77
77
  for (let n of [
78
78
  "org",
79
79
  "workspace",
@@ -83,81 +83,82 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
83
83
  let r = t.get(n);
84
84
  r && e.searchParams.set(n, r);
85
85
  }
86
- X.workspaceId && e.searchParams.set("workspace", X.workspaceId), Z !== null && e.searchParams.set(r, i(new Date(Z))), ce(e.toString());
86
+ Z.workspaceId && e.searchParams.set("workspace", Z.workspaceId), Y !== null && e.searchParams.set(r, i(new Date(Y))), ue(e.toString());
87
87
  }
88
88
  }, [
89
89
  m,
90
- a,
91
- D,
90
+ o,
91
+ E,
92
92
  Q,
93
- X.workspaceId,
94
- Z
93
+ Z.workspaceId,
94
+ Y,
95
+ X
95
96
  ]);
96
- let le = o(async () => {
97
- if (!I || E || I.workspaceId !== X.workspaceId) return;
98
- Y(null), N("bigconsole.dashboard.share_clicked", {
99
- dashboardId: a,
100
- permission: R,
101
- recipientType: I.type
97
+ let de = s(async () => {
98
+ if (!F || T || F.workspaceId !== Z.workspaceId) return;
99
+ J(null), M("bigconsole.dashboard.share_clicked", {
100
+ dashboardId: o,
101
+ permission: L,
102
+ recipientType: F.type
102
103
  });
103
104
  let e = null;
104
- I.type === "USER" ? e = await O(a, I.id, R) : I.type === "GROUP" && (e = await k(a, I.id, R)), e && N("bigconsole.dashboard.shared", {
105
- dashboardId: a,
106
- permission: R,
107
- recipientType: I.type
108
- }), e ? (L(null), F("")) : Y(w("bigconsole.share.error.grantFailed", "Access could not be granted. Review the recipient and try again."));
105
+ F.type === "USER" ? e = await D(o, F.id, L) : F.type === "GROUP" && (e = await O(o, F.id, L)), e && M("bigconsole.dashboard.shared", {
106
+ dashboardId: o,
107
+ permission: L,
108
+ recipientType: F.type
109
+ }), e ? (I(null), P("")) : J(C("bigconsole.share.error.grantFailed", "Access could not be granted. Review the recipient and try again."));
109
110
  }, [
110
- X.workspaceId,
111
- w,
112
- E,
113
- a,
114
- N,
115
- I,
116
- R,
117
- k,
118
- O
119
- ]), ue = o(async (e, t) => {
120
- await A({
111
+ Z.workspaceId,
112
+ C,
113
+ T,
114
+ o,
115
+ M,
116
+ F,
117
+ L,
118
+ O,
119
+ D
120
+ ]), fe = s(async (e, t) => {
121
+ await k({
121
122
  id: e,
122
123
  permission: t
123
124
  });
124
- }, [A]), de = o(async (e) => {
125
- window.confirm("Are you sure you want to revoke this access?") && await j(e);
126
- }, [j]), fe = o(async () => {
127
- window.confirm("Are you sure you want to revoke all shared access?") && await M(a);
128
- }, [a, M]), pe = o(async (e) => {
125
+ }, [k]), pe = s(async (e) => {
126
+ window.confirm("Are you sure you want to revoke this access?") && await A(e);
127
+ }, [A]), me = s(async () => {
128
+ window.confirm("Are you sure you want to revoke all shared access?") && await j(o);
129
+ }, [o, j]), he = s(async (e) => {
129
130
  if (b && e !== y) {
130
- q(null), G(!0);
131
+ K(null), W(!0);
131
132
  try {
132
133
  await b(e);
133
134
  } catch (e) {
134
- q(e instanceof Error ? e.message : "Could not update general access.");
135
+ K(e instanceof Error ? e.message : "Could not update general access.");
135
136
  } finally {
136
- G(!1);
137
+ W(!1);
137
138
  }
138
139
  }
139
- }, [b, y]), me = o(async () => {
140
+ }, [b, y]), ge = s(async () => {
140
141
  try {
141
- await navigator.clipboard.writeText(z), V(!0), setTimeout(() => V(!1), 2e3);
142
+ await navigator.clipboard.writeText(R), B(!0), setTimeout(() => B(!1), 2e3);
142
143
  } catch {
143
- Y(w("bigconsole.share.error.copyFailed", "The link could not be copied. Select the link and copy it manually."));
144
+ J(C("bigconsole.share.error.copyFailed", "The link could not be copied. Select the link and copy it manually."));
144
145
  }
145
- }, [z, w]), $ = X.results;
146
- return m ? /* @__PURE__ */ f(u, {
146
+ }, [R, C]), $ = Z.results;
147
+ return m ? /* @__PURE__ */ f(ne, {
147
148
  open: m,
148
149
  onOpenChange: (e) => {
149
150
  e || v();
150
151
  },
151
- children: /* @__PURE__ */ p(re, {
152
+ children: /* @__PURE__ */ p(d, {
152
153
  showCloseButton: !1,
153
154
  "data-testid": "share-dialog",
154
155
  className: "flex w-full flex-col gap-0 overflow-hidden rounded-card p-0 sm:w-[calc(100%-2rem)] sm:max-w-[520px]",
155
156
  onOpenAutoFocus: () => {
156
157
  let e = document.activeElement;
157
- e instanceof HTMLElement && e !== document.body && !e.closest("[role=dialog]") && (C.current = e);
158
+ e instanceof HTMLElement && e !== document.body && !e.closest("[role=dialog]") && (S.current = e);
158
159
  },
159
160
  onCloseAutoFocus: (e) => {
160
- e.preventDefault(), C.current?.isConnected && C.current.focus();
161
+ e.preventDefault(), S.current?.isConnected && S.current.focus();
161
162
  },
162
163
  style: {
163
164
  maxWidth: "520px",
@@ -184,16 +185,16 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
184
185
  color: h.textPrimary
185
186
  },
186
187
  children: "Share Dashboard"
187
- }), /* @__PURE__ */ f(d, {
188
+ }), /* @__PURE__ */ f(re, {
188
189
  style: {
189
190
  margin: "4px 0 0",
190
191
  fontSize: "13px",
191
192
  color: h.textSecondary
192
193
  },
193
- children: c
194
+ children: l
194
195
  })] }), /* @__PURE__ */ f("button", {
195
196
  type: "button",
196
- "aria-label": w("bigconsole.share.closeLabel", "Close share dialog"),
197
+ "aria-label": C("bigconsole.share.closeLabel", "Close share dialog"),
197
198
  onClick: v,
198
199
  style: {
199
200
  background: "none",
@@ -207,7 +208,7 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
207
208
  children: "×"
208
209
  })]
209
210
  }),
210
- /* @__PURE__ */ f("div", {
211
+ !X && /* @__PURE__ */ f("div", {
211
212
  role: "tablist",
212
213
  "aria-label": "Share options",
213
214
  style: {
@@ -221,14 +222,14 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
221
222
  children: ["people", "embed"].map((e) => /* @__PURE__ */ f("button", {
222
223
  type: "button",
223
224
  role: "tab",
224
- "aria-selected": H === e,
225
- onClick: () => U(e),
225
+ "aria-selected": V === e,
226
+ onClick: () => H(e),
226
227
  style: {
227
228
  padding: "10px 12px",
228
229
  background: "none",
229
230
  border: "none",
230
- borderBottom: `2px solid ${H === e ? h.actionPrimaryBg : "transparent"}`,
231
- color: H === e ? h.textPrimary : h.textSecondary,
231
+ borderBottom: `2px solid ${V === e ? h.actionPrimaryBg : "transparent"}`,
232
+ color: V === e ? h.textPrimary : h.textSecondary,
232
233
  fontSize: "13px",
233
234
  fontWeight: 600,
234
235
  cursor: "pointer"
@@ -236,19 +237,19 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
236
237
  children: e === "people" ? "People" : "Publish to web"
237
238
  }, e))
238
239
  }),
239
- H === "embed" && /* @__PURE__ */ f("div", {
240
+ !X && V === "embed" && /* @__PURE__ */ f("div", {
240
241
  className: "min-h-0 flex-1 overflow-y-auto",
241
242
  style: { backgroundColor: h.bgPrimary },
242
243
  children: /* @__PURE__ */ f(n, {
243
- dashboardId: a,
244
+ dashboardId: o,
244
245
  colors: h
245
246
  })
246
247
  }),
247
- H === "people" && /* @__PURE__ */ p("div", {
248
+ (X || V === "people") && /* @__PURE__ */ p("div", {
248
249
  className: "flex min-h-0 flex-1 flex-col gap-section-gap overflow-y-auto p-card-padding",
249
250
  style: { backgroundColor: h.bgPrimary },
250
251
  children: [
251
- y && b && /* @__PURE__ */ p("section", {
252
+ !X && y && b && /* @__PURE__ */ p("section", {
252
253
  "aria-labelledby": "share-visibility-heading",
253
254
  children: [
254
255
  /* @__PURE__ */ f("h3", {
@@ -268,8 +269,8 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
268
269
  "aria-label": "General access",
269
270
  "data-testid": "share-visibility",
270
271
  value: y,
271
- disabled: !S || W,
272
- onChange: (e) => void pe(e.target.value),
272
+ disabled: !x || U,
273
+ onChange: (e) => void he(e.target.value),
273
274
  style: {
274
275
  padding: "10px 12px",
275
276
  border: `1px solid ${h.borderDefault}`,
@@ -277,8 +278,8 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
277
278
  fontSize: "13px",
278
279
  backgroundColor: h.bgPrimary,
279
280
  color: h.textPrimary,
280
- cursor: !S || W ? "not-allowed" : "pointer",
281
- opacity: !S || W ? .6 : 1
281
+ cursor: !x || U ? "not-allowed" : "pointer",
282
+ opacity: !x || U ? .6 : 1
282
283
  },
283
284
  children: g.map((e) => /* @__PURE__ */ f("option", {
284
285
  value: e.value,
@@ -292,7 +293,7 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
292
293
  children: g.find((e) => e.value === y)?.description
293
294
  })]
294
295
  }),
295
- !S && /* @__PURE__ */ f("p", {
296
+ !x && /* @__PURE__ */ f("p", {
296
297
  style: {
297
298
  margin: "6px 0 0",
298
299
  fontSize: "11px",
@@ -300,13 +301,13 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
300
301
  },
301
302
  children: "You don't have permission to change general access."
302
303
  }),
303
- K && /* @__PURE__ */ f("p", {
304
+ G && /* @__PURE__ */ f("p", {
304
305
  style: {
305
306
  margin: "6px 0 0",
306
307
  fontSize: "11px",
307
308
  color: h.statusErrorText
308
309
  },
309
- children: K
310
+ children: G
310
311
  })
311
312
  ]
312
313
  }),
@@ -325,7 +326,7 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
325
326
  },
326
327
  children: [/* @__PURE__ */ f("input", {
327
328
  type: "text",
328
- value: z,
329
+ value: R,
329
330
  readOnly: !0,
330
331
  style: {
331
332
  flex: 1,
@@ -337,10 +338,10 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
337
338
  color: h.textPrimary
338
339
  }
339
340
  }), /* @__PURE__ */ f("button", {
340
- onClick: me,
341
+ onClick: ge,
341
342
  style: {
342
343
  padding: "10px 16px",
343
- backgroundColor: B ? h.statusSuccessBg : h.actionPrimaryBg,
344
+ backgroundColor: z ? h.statusSuccessBg : h.actionPrimaryBg,
344
345
  color: "var(--color-action-primary-text)",
345
346
  border: "none",
346
347
  borderRadius: "6px",
@@ -349,235 +350,242 @@ function y({ dashboardId: a, dashboardName: c, isOpen: m, onClose: v, visibility
349
350
  fontWeight: 500,
350
351
  minWidth: "80px"
351
352
  },
352
- children: B ? "Copied!" : "Copy"
353
+ children: z ? "Copied!" : "Copy"
353
354
  })]
354
355
  })]
355
356
  }),
356
- (oe || J) && /* @__PURE__ */ f("p", {
357
- role: "alert",
358
- style: { color: h.statusErrorText },
359
- children: J || w("bigconsole.share.error.loadFailed", "Dashboard access could not be loaded or updated. Try again.")
360
- }),
361
- /* @__PURE__ */ p("section", {
362
- "aria-labelledby": "share-invite-heading",
363
- children: [
364
- /* @__PURE__ */ f("h3", {
365
- id: "share-invite-heading",
366
- className: "mb-form-gap text-sm font-semibold",
367
- style: { color: h.textPrimary },
368
- children: "Invite people"
369
- }),
370
- /* @__PURE__ */ f("p", {
371
- style: {
372
- color: h.textSecondary,
373
- fontSize: "13px",
374
- marginBottom: "8px"
375
- },
376
- children: w("bigconsole.share.directory.scopeHint", "Only members and groups from the current workspace are listed.")
377
- }),
378
- X.loading && /* @__PURE__ */ f("p", {
379
- role: "status",
380
- children: w("bigconsole.share.directory.loading", "Loading workspace recipients…")
381
- }),
382
- X.error && /* @__PURE__ */ p("div", {
383
- role: "alert",
384
- children: [/* @__PURE__ */ f("p", { children: w("bigconsole.share.directory.loadFailed", "The workspace directory could not be loaded. Your access may not allow directory lookup.") }), /* @__PURE__ */ f("button", {
357
+ X ? /* @__PURE__ */ f("p", {
358
+ className: "text-sm",
359
+ style: { color: h.textSecondary },
360
+ "data-testid": "share-past-view-note",
361
+ children: C("bigconsole.share.pastViewNote", "Access and publishing settings apply to the live board, so they are not available while you view a past time. The link above keeps that time.")
362
+ }) : /* @__PURE__ */ p(oe, { children: [
363
+ (ce || q) && /* @__PURE__ */ f("p", {
364
+ role: "alert",
365
+ style: { color: h.statusErrorText },
366
+ children: q || C("bigconsole.share.error.loadFailed", "Dashboard access could not be loaded or updated. Try again.")
367
+ }),
368
+ /* @__PURE__ */ p("section", {
369
+ "aria-labelledby": "share-invite-heading",
370
+ children: [
371
+ /* @__PURE__ */ f("h3", {
372
+ id: "share-invite-heading",
373
+ className: "mb-form-gap text-sm font-semibold",
374
+ style: { color: h.textPrimary },
375
+ children: "Invite people"
376
+ }),
377
+ /* @__PURE__ */ f("p", {
378
+ style: {
379
+ color: h.textSecondary,
380
+ fontSize: "13px",
381
+ marginBottom: "8px"
382
+ },
383
+ children: C("bigconsole.share.directory.scopeHint", "Only members and groups from the current workspace are listed.")
384
+ }),
385
+ Z.loading && /* @__PURE__ */ f("p", {
386
+ role: "status",
387
+ children: C("bigconsole.share.directory.loading", "Loading workspace recipients…")
388
+ }),
389
+ Z.error && /* @__PURE__ */ p("div", {
390
+ role: "alert",
391
+ children: [/* @__PURE__ */ f("p", { children: C("bigconsole.share.directory.loadFailed", "The workspace directory could not be loaded. Your access may not allow directory lookup.") }), /* @__PURE__ */ f("button", {
392
+ type: "button",
393
+ onClick: Z.retry,
394
+ children: C("bigconsole.share.directory.retry", "Retry directory")
395
+ })]
396
+ }),
397
+ N && !F && !Z.loading && !Z.error && $.length === 0 && /* @__PURE__ */ f("p", {
398
+ role: "status",
399
+ children: C("bigconsole.share.directory.empty", "No matching workspace members or groups.")
400
+ }),
401
+ Z.hasMoreMembers && /* @__PURE__ */ f("button", {
385
402
  type: "button",
386
- onClick: X.retry,
387
- children: w("bigconsole.share.directory.retry", "Retry directory")
388
- })]
389
- }),
390
- P && !I && !X.loading && !X.error && $.length === 0 && /* @__PURE__ */ f("p", {
391
- role: "status",
392
- children: w("bigconsole.share.directory.empty", "No matching workspace members or groups.")
393
- }),
394
- X.hasMoreMembers && /* @__PURE__ */ f("button", {
395
- type: "button",
396
- disabled: X.loading,
397
- onClick: X.loadMoreMembers,
398
- children: w("bigconsole.share.directory.loadMore", "Load more workspace members")
399
- }),
400
- X.hasMoreGroups && /* @__PURE__ */ f("p", { children: w("bigconsole.share.directory.moreGroups", "More groups match. Narrow your search to find a specific group.") }),
401
- /* @__PURE__ */ p("div", {
402
- style: {
403
- display: "flex",
404
- gap: "8px",
405
- marginBottom: "8px",
406
- flexWrap: "wrap"
407
- },
408
- children: [
409
- /* @__PURE__ */ p("div", {
410
- style: {
411
- flex: 1,
412
- position: "relative"
413
- },
414
- children: [/* @__PURE__ */ f("input", {
415
- type: "text",
416
- value: I ? I.name : P,
417
- onChange: (e) => {
418
- F(e.target.value), L(null);
403
+ disabled: Z.loading,
404
+ onClick: Z.loadMoreMembers,
405
+ children: C("bigconsole.share.directory.loadMore", "Load more workspace members")
406
+ }),
407
+ Z.hasMoreGroups && /* @__PURE__ */ f("p", { children: C("bigconsole.share.directory.moreGroups", "More groups match. Narrow your search to find a specific group.") }),
408
+ /* @__PURE__ */ p("div", {
409
+ style: {
410
+ display: "flex",
411
+ gap: "8px",
412
+ marginBottom: "8px",
413
+ flexWrap: "wrap"
414
+ },
415
+ children: [
416
+ /* @__PURE__ */ p("div", {
417
+ style: {
418
+ flex: 1,
419
+ position: "relative"
419
420
  },
420
- "aria-label": w("bigconsole.share.directory.searchLabel", "Search workspace members and groups"),
421
- placeholder: w("bigconsole.share.directory.searchPlaceholder", "Search workspace members or groups..."),
421
+ children: [/* @__PURE__ */ f("input", {
422
+ type: "text",
423
+ value: F ? F.name : N,
424
+ onChange: (e) => {
425
+ P(e.target.value), I(null);
426
+ },
427
+ "aria-label": C("bigconsole.share.directory.searchLabel", "Search workspace members and groups"),
428
+ placeholder: C("bigconsole.share.directory.searchPlaceholder", "Search workspace members or groups..."),
429
+ style: {
430
+ width: "100%",
431
+ padding: "10px 12px",
432
+ border: `1px solid ${h.borderDefault}`,
433
+ borderRadius: "6px",
434
+ fontSize: "13px",
435
+ backgroundColor: h.bgPrimary,
436
+ color: h.textPrimary
437
+ }
438
+ }), N && !F && $.length > 0 && /* @__PURE__ */ f("div", {
439
+ style: {
440
+ position: "absolute",
441
+ top: "100%",
442
+ left: 0,
443
+ right: 0,
444
+ marginTop: "4px",
445
+ backgroundColor: h.bgPrimary,
446
+ border: `1px solid ${h.borderDefault}`,
447
+ borderRadius: "6px",
448
+ boxShadow: "var(--shadow-elevation-3)",
449
+ zIndex: 100001,
450
+ maxHeight: "200px",
451
+ overflowY: "auto"
452
+ },
453
+ children: $.map((e) => /* @__PURE__ */ p("button", {
454
+ type: "button",
455
+ onClick: () => I(e),
456
+ style: {
457
+ display: "block",
458
+ width: "100%",
459
+ padding: "10px 12px",
460
+ textAlign: "left",
461
+ backgroundColor: "transparent",
462
+ border: "none",
463
+ cursor: "pointer",
464
+ borderBottom: `1px solid ${h.borderDefault}`
465
+ },
466
+ children: [
467
+ /* @__PURE__ */ f("div", {
468
+ style: {
469
+ fontSize: "13px",
470
+ fontWeight: 500,
471
+ color: h.textPrimary
472
+ },
473
+ children: e.name
474
+ }),
475
+ e.email && /* @__PURE__ */ f("div", {
476
+ style: {
477
+ fontSize: "11px",
478
+ color: h.textSecondary
479
+ },
480
+ children: e.email
481
+ }),
482
+ /* @__PURE__ */ f("span", {
483
+ style: {
484
+ fontSize: "10px",
485
+ color: h.textTertiary,
486
+ textTransform: "uppercase"
487
+ },
488
+ children: e.type
489
+ })
490
+ ]
491
+ }, `${e.type}:${e.id}`))
492
+ })]
493
+ }),
494
+ /* @__PURE__ */ f("select", {
495
+ "aria-label": C("bigconsole.share.permissionLabel", "Access permission"),
496
+ value: L,
497
+ onChange: (e) => le(e.target.value),
422
498
  style: {
423
- width: "100%",
424
499
  padding: "10px 12px",
425
500
  border: `1px solid ${h.borderDefault}`,
426
501
  borderRadius: "6px",
427
502
  fontSize: "13px",
428
503
  backgroundColor: h.bgPrimary,
429
504
  color: h.textPrimary
430
- }
431
- }), P && !I && $.length > 0 && /* @__PURE__ */ f("div", {
505
+ },
506
+ children: _.map((e) => /* @__PURE__ */ f("option", {
507
+ value: e.value,
508
+ children: e.label
509
+ }, e.value))
510
+ }),
511
+ /* @__PURE__ */ f("button", {
512
+ onClick: de,
513
+ disabled: !F || T || F.workspaceId !== Z.workspaceId,
432
514
  style: {
433
- position: "absolute",
434
- top: "100%",
435
- left: 0,
436
- right: 0,
437
- marginTop: "4px",
438
- backgroundColor: h.bgPrimary,
439
- border: `1px solid ${h.borderDefault}`,
515
+ padding: "10px 16px",
516
+ backgroundColor: F ? h.actionPrimaryBg : h.bgTertiary,
517
+ color: F ? "var(--color-action-primary-text)" : h.textSecondary,
518
+ border: "none",
440
519
  borderRadius: "6px",
441
- boxShadow: "var(--shadow-elevation-3)",
442
- zIndex: 100001,
443
- maxHeight: "200px",
444
- overflowY: "auto"
520
+ cursor: F ? "pointer" : "not-allowed",
521
+ fontSize: "13px",
522
+ fontWeight: 500
445
523
  },
446
- children: $.map((e) => /* @__PURE__ */ p("button", {
447
- type: "button",
448
- onClick: () => L(e),
449
- style: {
450
- display: "block",
451
- width: "100%",
452
- padding: "10px 12px",
453
- textAlign: "left",
454
- backgroundColor: "transparent",
455
- border: "none",
456
- cursor: "pointer",
457
- borderBottom: `1px solid ${h.borderDefault}`
458
- },
459
- children: [
460
- /* @__PURE__ */ f("div", {
461
- style: {
462
- fontSize: "13px",
463
- fontWeight: 500,
464
- color: h.textPrimary
465
- },
466
- children: e.name
467
- }),
468
- e.email && /* @__PURE__ */ f("div", {
469
- style: {
470
- fontSize: "11px",
471
- color: h.textSecondary
472
- },
473
- children: e.email
474
- }),
475
- /* @__PURE__ */ f("span", {
476
- style: {
477
- fontSize: "10px",
478
- color: h.textTertiary,
479
- textTransform: "uppercase"
480
- },
481
- children: e.type
482
- })
483
- ]
484
- }, `${e.type}:${e.id}`))
485
- })]
486
- }),
487
- /* @__PURE__ */ f("select", {
488
- "aria-label": w("bigconsole.share.permissionLabel", "Access permission"),
489
- value: R,
490
- onChange: (e) => se(e.target.value),
491
- style: {
492
- padding: "10px 12px",
493
- border: `1px solid ${h.borderDefault}`,
494
- borderRadius: "6px",
495
- fontSize: "13px",
496
- backgroundColor: h.bgPrimary,
497
- color: h.textPrimary
498
- },
499
- children: _.map((e) => /* @__PURE__ */ f("option", {
500
- value: e.value,
501
- children: e.label
502
- }, e.value))
503
- }),
504
- /* @__PURE__ */ f("button", {
505
- onClick: le,
506
- disabled: !I || E || I.workspaceId !== X.workspaceId,
507
- style: {
508
- padding: "10px 16px",
509
- backgroundColor: I ? h.actionPrimaryBg : h.bgTertiary,
510
- color: I ? "var(--color-action-primary-text)" : h.textSecondary,
511
- border: "none",
512
- borderRadius: "6px",
513
- cursor: I ? "pointer" : "not-allowed",
514
- fontSize: "13px",
515
- fontWeight: 500
516
- },
517
- children: "Share"
518
- })
519
- ]
520
- })
521
- ]
522
- }),
523
- /* @__PURE__ */ p("section", {
524
- "aria-labelledby": "share-access-heading",
525
- children: [/* @__PURE__ */ p("div", {
526
- style: {
527
- display: "flex",
528
- alignItems: "center",
529
- justifyContent: "space-between",
530
- flexWrap: "wrap",
531
- gap: "8px",
532
- marginBottom: "12px"
533
- },
534
- children: [/* @__PURE__ */ p("h3", {
535
- id: "share-access-heading",
536
- className: "text-sm font-semibold",
537
- style: { color: h.textPrimary },
538
- children: [
539
- "People with access (",
540
- T.length,
541
- ")"
542
- ]
543
- }), T.length > 0 && /* @__PURE__ */ f("button", {
544
- onClick: fe,
524
+ children: "Share"
525
+ })
526
+ ]
527
+ })
528
+ ]
529
+ }),
530
+ /* @__PURE__ */ p("section", {
531
+ "aria-labelledby": "share-access-heading",
532
+ children: [/* @__PURE__ */ p("div", {
545
533
  style: {
546
- padding: "4px 8px",
547
- backgroundColor: "transparent",
548
- color: h.statusErrorText,
549
- border: "none",
550
- cursor: "pointer",
551
- fontSize: "12px"
534
+ display: "flex",
535
+ alignItems: "center",
536
+ justifyContent: "space-between",
537
+ flexWrap: "wrap",
538
+ gap: "8px",
539
+ marginBottom: "12px"
552
540
  },
553
- children: "Revoke All"
541
+ children: [/* @__PURE__ */ p("h3", {
542
+ id: "share-access-heading",
543
+ className: "text-sm font-semibold",
544
+ style: { color: h.textPrimary },
545
+ children: [
546
+ "People with access (",
547
+ w.length,
548
+ ")"
549
+ ]
550
+ }), w.length > 0 && /* @__PURE__ */ f("button", {
551
+ onClick: me,
552
+ style: {
553
+ padding: "4px 8px",
554
+ backgroundColor: "transparent",
555
+ color: h.statusErrorText,
556
+ border: "none",
557
+ cursor: "pointer",
558
+ fontSize: "12px"
559
+ },
560
+ children: "Revoke All"
561
+ })]
562
+ }), T && w.length === 0 ? /* @__PURE__ */ f("p", {
563
+ style: {
564
+ color: h.textSecondary,
565
+ fontSize: "13px"
566
+ },
567
+ children: "Loading..."
568
+ }) : w.length === 0 ? /* @__PURE__ */ f("p", {
569
+ style: {
570
+ color: h.textSecondary,
571
+ fontSize: "13px"
572
+ },
573
+ children: "No one has access to this dashboard yet."
574
+ }) : /* @__PURE__ */ f("div", {
575
+ style: {
576
+ display: "flex",
577
+ flexDirection: "column",
578
+ gap: "8px"
579
+ },
580
+ children: w.map((e) => /* @__PURE__ */ f(se, {
581
+ share: e,
582
+ onUpdatePermission: fe,
583
+ onRevoke: pe,
584
+ colors: h
585
+ }, e.id))
554
586
  })]
555
- }), E && T.length === 0 ? /* @__PURE__ */ f("p", {
556
- style: {
557
- color: h.textSecondary,
558
- fontSize: "13px"
559
- },
560
- children: "Loading..."
561
- }) : T.length === 0 ? /* @__PURE__ */ f("p", {
562
- style: {
563
- color: h.textSecondary,
564
- fontSize: "13px"
565
- },
566
- children: "No one has access to this dashboard yet."
567
- }) : /* @__PURE__ */ f("div", {
568
- style: {
569
- display: "flex",
570
- flexDirection: "column",
571
- gap: "8px"
572
- },
573
- children: T.map((e) => /* @__PURE__ */ f(x, {
574
- share: e,
575
- onUpdatePermission: ue,
576
- onRevoke: de,
577
- colors: h
578
- }, e.id))
579
- })]
580
- })
587
+ })
588
+ ] })
581
589
  ]
582
590
  })
583
591
  ]
@@ -601,7 +609,7 @@ function b(e) {
601
609
  expired: !1
602
610
  };
603
611
  }
604
- function x({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
612
+ function se({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
605
613
  let i = b(e.expiresAt);
606
614
  return /* @__PURE__ */ p("div", {
607
615
  style: {