@burdenoff/microfe-bigconsole 2026.711.2 → 2026.712.1

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.
@@ -1,10 +1,11 @@
1
- import e from "../../../hooks/useDashboardSharing.js";
1
+ import e from "../../../hooks/useBigConsoleAnalytics.js";
2
+ import t from "../../../hooks/useDashboardSharing.js";
2
3
  import "../../../hooks/index.js";
3
- import { useCallback as t, useEffect as n, useMemo as r, useState as i } from "react";
4
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
- import { createPortal as s } from "react-dom";
4
+ import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { createPortal as c } from "react-dom";
6
7
  //#region src/bigconsole/components/dashboard/ShareDialog/ShareDialog.tsx
7
- var c = (e) => ({
8
+ var l = (e) => ({
8
9
  bgPrimary: e ? "#1a1a2e" : "#ffffff",
9
10
  bgSecondary: e ? "#252542" : "#f4f4f5",
10
11
  bgTertiary: e ? "#2d2d4a" : "#e4e4e7",
@@ -16,7 +17,7 @@ var c = (e) => ({
16
17
  actionPrimaryBgHover: "#4f46e5",
17
18
  statusSuccessBg: "#22c55e",
18
19
  statusErrorText: "#ef4444"
19
- }), l = [{
20
+ }), u = [{
20
21
  value: "VIEW",
21
22
  label: "View",
22
23
  description: "Can view the dashboard"
@@ -25,37 +26,49 @@ var c = (e) => ({
25
26
  label: "Edit",
26
27
  description: "Can edit widgets, layout, and share"
27
28
  }];
28
- function u({ dashboardId: u, dashboardName: f, isOpen: p, onClose: m }) {
29
- let { shares: h, loading: g, fetchShares: _, shareWithUser: v, shareWithGroup: y, updateShare: b, revokeShare: x, revokeAllShares: S } = e(), [C, w] = i(""), [T, E] = i(null), [D, O] = i("VIEW"), [k, A] = i(""), [j, M] = i(!1);
30
- n(() => {
31
- p && u && (_(u), A(`${window.location.origin}/dashboard/${u}?shared=true`));
29
+ function d({ dashboardId: d, dashboardName: p, isOpen: m, onClose: h }) {
30
+ let { shares: g, loading: _, fetchShares: v, shareWithUser: y, shareWithGroup: b, updateShare: x, revokeShare: S, revokeAllShares: C } = t(), w = e(), [T, E] = a(""), [D, O] = a(null), [k, A] = a("VIEW"), [j, M] = a(""), [N, P] = a(!1);
31
+ r(() => {
32
+ m && d && (v(d), M(`${window.location.origin}/dashboard/${d}?shared=true`));
32
33
  }, [
33
- p,
34
- u,
35
- _
34
+ m,
35
+ d,
36
+ v
36
37
  ]);
37
- let N = t(async () => {
38
- T && (T.type === "USER" ? await v(u, T.id, D) : T.type === "GROUP" && await y(u, T.id, D), E(null), w(""));
38
+ let F = n(async () => {
39
+ if (!D) return;
40
+ w("bigconsole.dashboard.share_clicked", {
41
+ dashboardId: d,
42
+ permission: k,
43
+ recipientType: D.type
44
+ });
45
+ let e = null;
46
+ D.type === "USER" ? e = await y(d, D.id, k) : D.type === "GROUP" && (e = await b(d, D.id, k)), e && w("bigconsole.dashboard.shared", {
47
+ dashboardId: d,
48
+ permission: k,
49
+ recipientType: D.type
50
+ }), O(null), E("");
39
51
  }, [
40
- u,
41
- T,
52
+ d,
53
+ w,
42
54
  D,
43
- v,
55
+ k,
56
+ b,
44
57
  y
45
- ]), P = t(async (e, t) => {
46
- await b({
58
+ ]), I = n(async (e, t) => {
59
+ await x({
47
60
  id: e,
48
61
  permission: t
49
62
  });
50
- }, [b]), F = t(async (e) => {
51
- window.confirm("Are you sure you want to revoke this access?") && await x(e);
52
- }, [x]), I = t(async () => {
53
- window.confirm("Are you sure you want to revoke all shared access?") && await S(u);
54
- }, [u, S]), L = t(async () => {
63
+ }, [x]), L = n(async (e) => {
64
+ window.confirm("Are you sure you want to revoke this access?") && await S(e);
65
+ }, [S]), R = n(async () => {
66
+ window.confirm("Are you sure you want to revoke all shared access?") && await C(d);
67
+ }, [d, C]), z = n(async () => {
55
68
  try {
56
- await navigator.clipboard.writeText(k), M(!0), setTimeout(() => M(!1), 2e3);
69
+ await navigator.clipboard.writeText(j), P(!0), setTimeout(() => P(!1), 2e3);
57
70
  } catch {}
58
- }, [k]), R = C ? [
71
+ }, [j]), B = T ? [
59
72
  {
60
73
  id: "user-1",
61
74
  name: "John Doe",
@@ -78,8 +91,8 @@ function u({ dashboardId: u, dashboardName: f, isOpen: p, onClose: m }) {
78
91
  name: "Editors",
79
92
  type: "GROUP"
80
93
  }
81
- ].filter((e) => e.name.toLowerCase().includes(C.toLowerCase()) || e.email?.toLowerCase().includes(C.toLowerCase())) : [], z = typeof document < "u" && document.documentElement.classList.contains("dark"), B = r(() => c(z), [z]);
82
- return p ? s(/* @__PURE__ */ a("div", {
94
+ ].filter((e) => e.name.toLowerCase().includes(T.toLowerCase()) || e.email?.toLowerCase().includes(T.toLowerCase())) : [], V = typeof document < "u" && document.documentElement.classList.contains("dark"), H = i(() => l(V), [V]);
95
+ return m ? c(/* @__PURE__ */ o("div", {
83
96
  style: {
84
97
  position: "fixed",
85
98
  top: 0,
@@ -93,99 +106,99 @@ function u({ dashboardId: u, dashboardName: f, isOpen: p, onClose: m }) {
93
106
  zIndex: 99999,
94
107
  isolation: "isolate"
95
108
  },
96
- onClick: m,
97
- children: /* @__PURE__ */ o("div", {
109
+ onClick: h,
110
+ children: /* @__PURE__ */ s("div", {
98
111
  style: {
99
112
  width: "520px",
100
113
  maxHeight: "80vh",
101
- backgroundColor: B.bgPrimary,
114
+ backgroundColor: H.bgPrimary,
102
115
  borderRadius: "12px",
103
116
  boxShadow: "0 8px 32px rgba(0, 0, 0, 0.3)",
104
117
  overflow: "hidden",
105
118
  position: "relative",
106
119
  zIndex: 1e5,
107
- color: B.textPrimary
120
+ color: H.textPrimary
108
121
  },
109
122
  onClick: (e) => e.stopPropagation(),
110
- children: [/* @__PURE__ */ o("div", {
123
+ children: [/* @__PURE__ */ s("div", {
111
124
  style: {
112
125
  padding: "20px 24px",
113
- borderBottom: `1px solid ${B.borderDefault}`,
126
+ borderBottom: `1px solid ${H.borderDefault}`,
114
127
  display: "flex",
115
128
  alignItems: "center",
116
129
  justifyContent: "space-between",
117
- backgroundColor: B.bgPrimary
130
+ backgroundColor: H.bgPrimary
118
131
  },
119
- children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("h3", {
132
+ children: [/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("h3", {
120
133
  style: {
121
134
  margin: 0,
122
135
  fontSize: "18px",
123
136
  fontWeight: 600,
124
- color: B.textPrimary
137
+ color: H.textPrimary
125
138
  },
126
139
  children: "Share Dashboard"
127
- }), /* @__PURE__ */ a("p", {
140
+ }), /* @__PURE__ */ o("p", {
128
141
  style: {
129
142
  margin: "4px 0 0",
130
143
  fontSize: "13px",
131
- color: B.textSecondary
144
+ color: H.textSecondary
132
145
  },
133
- children: f
134
- })] }), /* @__PURE__ */ a("button", {
135
- onClick: m,
146
+ children: p
147
+ })] }), /* @__PURE__ */ o("button", {
148
+ onClick: h,
136
149
  style: {
137
150
  background: "none",
138
151
  border: "none",
139
152
  fontSize: "24px",
140
153
  cursor: "pointer",
141
- color: B.textSecondary,
154
+ color: H.textSecondary,
142
155
  padding: "4px",
143
156
  lineHeight: 1
144
157
  },
145
158
  children: "×"
146
159
  })]
147
- }), /* @__PURE__ */ o("div", {
160
+ }), /* @__PURE__ */ s("div", {
148
161
  style: {
149
162
  padding: "24px",
150
163
  overflowY: "auto",
151
164
  maxHeight: "calc(80vh - 200px)",
152
- backgroundColor: B.bgPrimary
165
+ backgroundColor: H.bgPrimary
153
166
  },
154
167
  children: [
155
- /* @__PURE__ */ o("div", {
168
+ /* @__PURE__ */ s("div", {
156
169
  style: { marginBottom: "24px" },
157
- children: [/* @__PURE__ */ a("label", {
170
+ children: [/* @__PURE__ */ o("label", {
158
171
  style: {
159
172
  display: "block",
160
173
  marginBottom: "8px",
161
174
  fontSize: "13px",
162
175
  fontWeight: 600,
163
- color: B.textPrimary
176
+ color: H.textPrimary
164
177
  },
165
178
  children: "Share Link"
166
- }), /* @__PURE__ */ o("div", {
179
+ }), /* @__PURE__ */ s("div", {
167
180
  style: {
168
181
  display: "flex",
169
182
  gap: "8px"
170
183
  },
171
- children: [/* @__PURE__ */ a("input", {
184
+ children: [/* @__PURE__ */ o("input", {
172
185
  type: "text",
173
- value: k,
186
+ value: j,
174
187
  readOnly: !0,
175
188
  style: {
176
189
  flex: 1,
177
190
  padding: "10px 12px",
178
- border: `1px solid ${B.borderDefault}`,
191
+ border: `1px solid ${H.borderDefault}`,
179
192
  borderRadius: "6px",
180
193
  fontSize: "13px",
181
- backgroundColor: B.bgSecondary,
182
- color: B.textPrimary
194
+ backgroundColor: H.bgSecondary,
195
+ color: H.textPrimary
183
196
  }
184
- }), /* @__PURE__ */ a("button", {
185
- onClick: L,
197
+ }), /* @__PURE__ */ o("button", {
198
+ onClick: z,
186
199
  style: {
187
200
  padding: "10px 16px",
188
- backgroundColor: j ? B.statusSuccessBg : B.actionPrimaryBg,
201
+ backgroundColor: N ? H.statusSuccessBg : H.actionPrimaryBg,
189
202
  color: "white",
190
203
  border: "none",
191
204
  borderRadius: "6px",
@@ -194,66 +207,66 @@ function u({ dashboardId: u, dashboardName: f, isOpen: p, onClose: m }) {
194
207
  fontWeight: 500,
195
208
  minWidth: "80px"
196
209
  },
197
- children: j ? "Copied!" : "Copy"
210
+ children: N ? "Copied!" : "Copy"
198
211
  })]
199
212
  })]
200
213
  }),
201
- /* @__PURE__ */ o("div", {
214
+ /* @__PURE__ */ s("div", {
202
215
  style: { marginBottom: "24px" },
203
- children: [/* @__PURE__ */ a("label", {
216
+ children: [/* @__PURE__ */ o("label", {
204
217
  style: {
205
218
  display: "block",
206
219
  marginBottom: "8px",
207
220
  fontSize: "13px",
208
221
  fontWeight: 600,
209
- color: B.textPrimary
222
+ color: H.textPrimary
210
223
  },
211
224
  children: "Add People"
212
- }), /* @__PURE__ */ o("div", {
225
+ }), /* @__PURE__ */ s("div", {
213
226
  style: {
214
227
  display: "flex",
215
228
  gap: "8px",
216
229
  marginBottom: "8px"
217
230
  },
218
231
  children: [
219
- /* @__PURE__ */ o("div", {
232
+ /* @__PURE__ */ s("div", {
220
233
  style: {
221
234
  flex: 1,
222
235
  position: "relative"
223
236
  },
224
- children: [/* @__PURE__ */ a("input", {
237
+ children: [/* @__PURE__ */ o("input", {
225
238
  type: "text",
226
- value: T ? T.name : C,
239
+ value: D ? D.name : T,
227
240
  onChange: (e) => {
228
- w(e.target.value), E(null);
241
+ E(e.target.value), O(null);
229
242
  },
230
243
  placeholder: "Search by name or email...",
231
244
  style: {
232
245
  width: "100%",
233
246
  padding: "10px 12px",
234
- border: `1px solid ${B.borderDefault}`,
247
+ border: `1px solid ${H.borderDefault}`,
235
248
  borderRadius: "6px",
236
249
  fontSize: "13px",
237
- backgroundColor: B.bgPrimary,
238
- color: B.textPrimary
250
+ backgroundColor: H.bgPrimary,
251
+ color: H.textPrimary
239
252
  }
240
- }), C && !T && R.length > 0 && /* @__PURE__ */ a("div", {
253
+ }), T && !D && B.length > 0 && /* @__PURE__ */ o("div", {
241
254
  style: {
242
255
  position: "absolute",
243
256
  top: "100%",
244
257
  left: 0,
245
258
  right: 0,
246
259
  marginTop: "4px",
247
- backgroundColor: B.bgPrimary,
248
- border: `1px solid ${B.borderDefault}`,
260
+ backgroundColor: H.bgPrimary,
261
+ border: `1px solid ${H.borderDefault}`,
249
262
  borderRadius: "6px",
250
263
  boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
251
264
  zIndex: 100001,
252
265
  maxHeight: "200px",
253
266
  overflowY: "auto"
254
267
  },
255
- children: R.map((e) => /* @__PURE__ */ o("button", {
256
- onClick: () => E(e),
268
+ children: B.map((e) => /* @__PURE__ */ s("button", {
269
+ onClick: () => O(e),
257
270
  style: {
258
271
  display: "block",
259
272
  width: "100%",
@@ -262,28 +275,28 @@ function u({ dashboardId: u, dashboardName: f, isOpen: p, onClose: m }) {
262
275
  backgroundColor: "transparent",
263
276
  border: "none",
264
277
  cursor: "pointer",
265
- borderBottom: `1px solid ${B.borderDefault}`
278
+ borderBottom: `1px solid ${H.borderDefault}`
266
279
  },
267
280
  children: [
268
- /* @__PURE__ */ a("div", {
281
+ /* @__PURE__ */ o("div", {
269
282
  style: {
270
283
  fontSize: "13px",
271
284
  fontWeight: 500,
272
- color: B.textPrimary
285
+ color: H.textPrimary
273
286
  },
274
287
  children: e.name
275
288
  }),
276
- e.email && /* @__PURE__ */ a("div", {
289
+ e.email && /* @__PURE__ */ o("div", {
277
290
  style: {
278
291
  fontSize: "11px",
279
- color: B.textSecondary
292
+ color: H.textSecondary
280
293
  },
281
294
  children: e.email
282
295
  }),
283
- /* @__PURE__ */ a("span", {
296
+ /* @__PURE__ */ o("span", {
284
297
  style: {
285
298
  fontSize: "10px",
286
- color: B.textTertiary,
299
+ color: H.textTertiary,
287
300
  textTransform: "uppercase"
288
301
  },
289
302
  children: e.type
@@ -292,32 +305,32 @@ function u({ dashboardId: u, dashboardName: f, isOpen: p, onClose: m }) {
292
305
  }, e.id))
293
306
  })]
294
307
  }),
295
- /* @__PURE__ */ a("select", {
296
- value: D,
297
- onChange: (e) => O(e.target.value),
308
+ /* @__PURE__ */ o("select", {
309
+ value: k,
310
+ onChange: (e) => A(e.target.value),
298
311
  style: {
299
312
  padding: "10px 12px",
300
- border: `1px solid ${B.borderDefault}`,
313
+ border: `1px solid ${H.borderDefault}`,
301
314
  borderRadius: "6px",
302
315
  fontSize: "13px",
303
- backgroundColor: B.bgPrimary,
304
- color: B.textPrimary
316
+ backgroundColor: H.bgPrimary,
317
+ color: H.textPrimary
305
318
  },
306
- children: l.map((e) => /* @__PURE__ */ a("option", {
319
+ children: u.map((e) => /* @__PURE__ */ o("option", {
307
320
  value: e.value,
308
321
  children: e.label
309
322
  }, e.value))
310
323
  }),
311
- /* @__PURE__ */ a("button", {
312
- onClick: N,
313
- disabled: !T || g,
324
+ /* @__PURE__ */ o("button", {
325
+ onClick: F,
326
+ disabled: !D || _,
314
327
  style: {
315
328
  padding: "10px 16px",
316
- backgroundColor: T ? B.actionPrimaryBg : B.bgTertiary,
317
- color: T ? "white" : B.textSecondary,
329
+ backgroundColor: D ? H.actionPrimaryBg : H.bgTertiary,
330
+ color: D ? "white" : H.textSecondary,
318
331
  border: "none",
319
332
  borderRadius: "6px",
320
- cursor: T ? "pointer" : "not-allowed",
333
+ cursor: D ? "pointer" : "not-allowed",
321
334
  fontSize: "13px",
322
335
  fontWeight: 500
323
336
  },
@@ -326,59 +339,59 @@ function u({ dashboardId: u, dashboardName: f, isOpen: p, onClose: m }) {
326
339
  ]
327
340
  })]
328
341
  }),
329
- /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ o("div", {
342
+ /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ s("div", {
330
343
  style: {
331
344
  display: "flex",
332
345
  alignItems: "center",
333
346
  justifyContent: "space-between",
334
347
  marginBottom: "12px"
335
348
  },
336
- children: [/* @__PURE__ */ o("label", {
349
+ children: [/* @__PURE__ */ s("label", {
337
350
  style: {
338
351
  fontSize: "13px",
339
352
  fontWeight: 600,
340
- color: B.textPrimary
353
+ color: H.textPrimary
341
354
  },
342
355
  children: [
343
356
  "People with Access (",
344
- h.length,
357
+ g.length,
345
358
  ")"
346
359
  ]
347
- }), h.length > 0 && /* @__PURE__ */ a("button", {
348
- onClick: I,
360
+ }), g.length > 0 && /* @__PURE__ */ o("button", {
361
+ onClick: R,
349
362
  style: {
350
363
  padding: "4px 8px",
351
364
  backgroundColor: "transparent",
352
- color: B.statusErrorText,
365
+ color: H.statusErrorText,
353
366
  border: "none",
354
367
  cursor: "pointer",
355
368
  fontSize: "12px"
356
369
  },
357
370
  children: "Revoke All"
358
371
  })]
359
- }), g && h.length === 0 ? /* @__PURE__ */ a("p", {
372
+ }), _ && g.length === 0 ? /* @__PURE__ */ o("p", {
360
373
  style: {
361
- color: B.textSecondary,
374
+ color: H.textSecondary,
362
375
  fontSize: "13px"
363
376
  },
364
377
  children: "Loading..."
365
- }) : h.length === 0 ? /* @__PURE__ */ a("p", {
378
+ }) : g.length === 0 ? /* @__PURE__ */ o("p", {
366
379
  style: {
367
- color: B.textSecondary,
380
+ color: H.textSecondary,
368
381
  fontSize: "13px"
369
382
  },
370
383
  children: "No one has access to this dashboard yet."
371
- }) : /* @__PURE__ */ a("div", {
384
+ }) : /* @__PURE__ */ o("div", {
372
385
  style: {
373
386
  display: "flex",
374
387
  flexDirection: "column",
375
388
  gap: "8px"
376
389
  },
377
- children: h.map((e) => /* @__PURE__ */ a(d, {
390
+ children: g.map((e) => /* @__PURE__ */ o(f, {
378
391
  share: e,
379
- onUpdatePermission: P,
380
- onRevoke: F,
381
- colors: B
392
+ onUpdatePermission: I,
393
+ onRevoke: L,
394
+ colors: H
382
395
  }, e.id))
383
396
  })] })
384
397
  ]
@@ -386,8 +399,8 @@ function u({ dashboardId: u, dashboardName: f, isOpen: p, onClose: m }) {
386
399
  })
387
400
  }), document.body) : null;
388
401
  }
389
- function d({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
390
- return /* @__PURE__ */ o("div", {
402
+ function f({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
403
+ return /* @__PURE__ */ s("div", {
391
404
  style: {
392
405
  display: "flex",
393
406
  alignItems: "center",
@@ -396,13 +409,13 @@ function d({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
396
409
  backgroundColor: r.bgSecondary,
397
410
  borderRadius: "6px"
398
411
  },
399
- children: [/* @__PURE__ */ o("div", {
412
+ children: [/* @__PURE__ */ s("div", {
400
413
  style: {
401
414
  display: "flex",
402
415
  alignItems: "center",
403
416
  gap: "10px"
404
417
  },
405
- children: [/* @__PURE__ */ a("div", {
418
+ children: [/* @__PURE__ */ o("div", {
406
419
  style: {
407
420
  width: "36px",
408
421
  height: "36px",
@@ -416,14 +429,14 @@ function d({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
416
429
  fontSize: "14px"
417
430
  },
418
431
  children: e.recipientType === "USER" ? "U" : "R"
419
- }), /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("div", {
432
+ }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("div", {
420
433
  style: {
421
434
  fontSize: "13px",
422
435
  fontWeight: 500,
423
436
  color: r.textPrimary
424
437
  },
425
438
  children: e.recipientId
426
- }), /* @__PURE__ */ o("div", {
439
+ }), /* @__PURE__ */ s("div", {
427
440
  style: {
428
441
  fontSize: "11px",
429
442
  color: r.textSecondary
@@ -434,13 +447,13 @@ function d({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
434
447
  new Date(e.createdAt).toLocaleDateString()
435
448
  ]
436
449
  })] })]
437
- }), /* @__PURE__ */ o("div", {
450
+ }), /* @__PURE__ */ s("div", {
438
451
  style: {
439
452
  display: "flex",
440
453
  alignItems: "center",
441
454
  gap: "8px"
442
455
  },
443
- children: [/* @__PURE__ */ a("select", {
456
+ children: [/* @__PURE__ */ o("select", {
444
457
  value: e.permission,
445
458
  onChange: (n) => t(e.id, n.target.value),
446
459
  style: {
@@ -451,11 +464,11 @@ function d({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
451
464
  backgroundColor: r.bgPrimary,
452
465
  color: r.textPrimary
453
466
  },
454
- children: l.map((e) => /* @__PURE__ */ a("option", {
467
+ children: u.map((e) => /* @__PURE__ */ o("option", {
455
468
  value: e.value,
456
469
  children: e.label
457
470
  }, e.value))
458
- }), /* @__PURE__ */ a("button", {
471
+ }), /* @__PURE__ */ o("button", {
459
472
  onClick: () => n(e.id),
460
473
  style: {
461
474
  padding: "6px 10px",
@@ -472,6 +485,6 @@ function d({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
472
485
  });
473
486
  }
474
487
  //#endregion
475
- export { u as default };
488
+ export { d as default };
476
489
 
477
490
  //# sourceMappingURL=ShareDialog.js.map