@burdenoff/microfe-bigconsole 2026.1012.2 → 2026.1012.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.
@@ -1,14 +1,16 @@
1
- import { Section as e, SectionStack as t } from "../common/Section.js";
1
+ import { useBigConsole as e } from "../../context/BigConsoleContext.js";
2
+ import "../../context/index.js";
3
+ import { Section as t, SectionStack as n } from "../common/Section.js";
2
4
  import "../common/index.js";
3
- import n from "../../hooks/useExportDashboard.js";
5
+ import r from "../../hooks/useExportDashboard.js";
4
6
  import "../../hooks/index.js";
5
- import { nativeCopyText as r } from "../../../utils/nativeBridge.js";
6
- import { memo as i, useCallback as a, useEffect as o, useState as s } from "react";
7
- import { Check as c, Copy as l, Download as u, FileJson as d } from "lucide-react";
8
- import { ResponsiveDialog as f, ResponsiveDialogContent as p, ResponsiveDialogDescription as m, ResponsiveDialogTitle as h, Spinner as g } from "@burdenoff/fe-libs/ui";
9
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
7
+ import { nativeCopyText as i } from "../../../utils/nativeBridge.js";
8
+ import { memo as a, useCallback as o, useEffect as s, useState as c } from "react";
9
+ import { Check as l, Copy as u, Download as d, FileJson as f } from "lucide-react";
10
+ import { ResponsiveDialog as p, ResponsiveDialogContent as m, ResponsiveDialogDescription as h, ResponsiveDialogTitle as g, Spinner as _ } from "@burdenoff/fe-libs/ui";
11
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
10
12
  //#region src/bigconsole/components/dashboard/ExportDashboardDialog.tsx
11
- var b = {
13
+ var x = {
12
14
  dialogContent: {
13
15
  maxWidth: "640px",
14
16
  width: "95vw",
@@ -168,15 +170,15 @@ var b = {
168
170
  opacity: .5,
169
171
  cursor: "not-allowed"
170
172
  }
171
- }, x = i(function({ checked: e, onChange: t, disabled: n, label: r, description: i }) {
172
- return /* @__PURE__ */ y("label", {
173
+ }, S = a(function({ checked: e, onChange: t, disabled: n, label: r, description: i }) {
174
+ return /* @__PURE__ */ b("label", {
173
175
  style: {
174
- ...b.optionItem,
175
- ...e ? b.optionItemActive : {},
176
+ ...x.optionItem,
177
+ ...e ? x.optionItemActive : {},
176
178
  opacity: n ? .6 : 1,
177
179
  cursor: n ? "not-allowed" : "pointer"
178
180
  },
179
- children: [/* @__PURE__ */ v("input", {
181
+ children: [/* @__PURE__ */ y("input", {
180
182
  type: "checkbox",
181
183
  checked: e,
182
184
  onChange: (e) => t(e.target.checked),
@@ -188,204 +190,204 @@ var b = {
188
190
  flexShrink: 0,
189
191
  accentColor: "var(--color-action-primary-bg)"
190
192
  }
191
- }), /* @__PURE__ */ y("span", {
192
- style: b.optionText,
193
- children: [/* @__PURE__ */ v("span", {
193
+ }), /* @__PURE__ */ b("span", {
194
+ style: x.optionText,
195
+ children: [/* @__PURE__ */ y("span", {
194
196
  className: "block",
195
- style: b.optionLabel,
197
+ style: x.optionLabel,
196
198
  children: r
197
- }), /* @__PURE__ */ v("span", {
199
+ }), /* @__PURE__ */ y("span", {
198
200
  className: "block",
199
- style: b.optionDescription,
201
+ style: x.optionDescription,
200
202
  children: i
201
203
  })]
202
204
  })]
203
205
  });
204
- }), S = i(function({ isOpen: i, dashboardId: S, dashboardName: C, onClose: w, onSuccess: T }) {
205
- let [E, D] = s(!1), [O, k] = s(!1), [A, j] = s(!0), [M, N] = s(null), [P, F] = s(null), { loading: I, error: L, downloadDashboard: R, clearError: z } = n(), { loading: B, error: V, exportDashboard: H } = n(), U = `${S}|${E}|${O}|${A}`, W = M?.key === U ? M.json : null, G = P === U;
206
- o(() => {
207
- i && (D(!1), k(!1), j(!0), z());
208
- }, [i, z]), o(() => {
209
- if (!i || !S) return;
206
+ }), C = a(function({ isOpen: a, dashboardId: C, dashboardName: w, onClose: T, onSuccess: E }) {
207
+ let [D, O] = c(!1), [k, A] = c(!1), [j, M] = c(!0), [N, P] = c(null), [F, I] = c(null), { loading: L, error: R, downloadDashboard: z, clearError: B } = r(), { currentUser: V, workspaceId: H } = e(), { loading: U, error: W, exportDashboard: G } = r(), K = `${V?.id ?? ""}|${H ?? ""}|${C}|${D}|${k}|${j}`, q = N?.key === K ? N.json : null, J = F === K;
208
+ s(() => {
209
+ a && (O(!1), A(!1), M(!0), B());
210
+ }, [a, B]), s(() => {
211
+ if (!a || !C) return;
210
212
  let e = !1;
211
- return H(S, {
212
- includeDataSourceRefs: E,
213
- includeWebhookMappings: O,
214
- prettyPrint: A
213
+ return G(C, {
214
+ includeDataSourceRefs: D,
215
+ includeWebhookMappings: k,
216
+ prettyPrint: j
215
217
  }).then((t) => {
216
- e || N({
217
- key: U,
218
+ e || P({
219
+ key: K,
218
220
  json: t
219
221
  });
220
222
  }), () => {
221
223
  e = !0;
222
224
  };
223
225
  }, [
224
- i,
225
- S,
226
- E,
227
- O,
228
- A,
229
- U,
230
- H
226
+ a,
227
+ C,
228
+ D,
229
+ k,
230
+ j,
231
+ K,
232
+ G
231
233
  ]);
232
- let K = a(async () => {
233
- W && await r(W) && (F(U), window.setTimeout(() => F(null), 2e3));
234
- }, [W, U]), q = a(async () => {
235
- !S || !W || B || await R(S, C, {
236
- includeDataSourceRefs: E,
237
- includeWebhookMappings: O,
238
- prettyPrint: A,
239
- preparedContent: W
240
- }) && (T?.(), w());
234
+ let Y = o(async () => {
235
+ q && await i(q) && (I(K), window.setTimeout(() => I(null), 2e3));
236
+ }, [q, K]), X = o(async () => {
237
+ !C || !q || U || await z(C, w, {
238
+ includeDataSourceRefs: D,
239
+ includeWebhookMappings: k,
240
+ prettyPrint: j,
241
+ preparedContent: q
242
+ }) && (E?.(), T());
241
243
  }, [
242
- S,
243
244
  C,
245
+ w,
246
+ D,
247
+ k,
248
+ j,
249
+ z,
250
+ q,
251
+ U,
244
252
  E,
245
- O,
246
- A,
247
- R,
248
- W,
249
- B,
250
- T,
251
- w
253
+ T
252
254
  ]);
253
- return S ? /* @__PURE__ */ v(f, {
254
- open: i,
255
- onOpenChange: (e) => !e && !I && w(),
256
- children: /* @__PURE__ */ y(p, {
257
- style: b.dialogContent,
255
+ return C ? /* @__PURE__ */ y(p, {
256
+ open: a,
257
+ onOpenChange: (e) => !e && !L && T(),
258
+ children: /* @__PURE__ */ b(m, {
259
+ style: x.dialogContent,
258
260
  children: [
259
- /* @__PURE__ */ y("div", {
260
- style: b.header,
261
- children: [/* @__PURE__ */ v("div", {
262
- style: b.iconWrapper,
263
- children: /* @__PURE__ */ v(d, { style: {
261
+ /* @__PURE__ */ b("div", {
262
+ style: x.header,
263
+ children: [/* @__PURE__ */ y("div", {
264
+ style: x.iconWrapper,
265
+ children: /* @__PURE__ */ y(f, { style: {
264
266
  width: "22px",
265
267
  height: "22px"
266
268
  } })
267
- }), /* @__PURE__ */ y("div", {
268
- style: b.headerText,
269
- children: [/* @__PURE__ */ v(h, {
269
+ }), /* @__PURE__ */ b("div", {
270
+ style: x.headerText,
271
+ children: [/* @__PURE__ */ y(g, {
270
272
  asChild: !0,
271
- children: /* @__PURE__ */ v("h2", {
272
- style: b.title,
273
+ children: /* @__PURE__ */ y("h2", {
274
+ style: x.title,
273
275
  children: "Export Dashboard"
274
276
  })
275
- }), /* @__PURE__ */ v(m, {
277
+ }), /* @__PURE__ */ y(h, {
276
278
  asChild: !0,
277
- children: /* @__PURE__ */ v("p", {
278
- style: b.description,
279
+ children: /* @__PURE__ */ y("p", {
280
+ style: x.description,
279
281
  children: "Export your dashboard configuration to a JSON file."
280
282
  })
281
283
  })]
282
284
  })]
283
285
  }),
284
- /* @__PURE__ */ v("div", {
285
- style: b.content,
286
- children: /* @__PURE__ */ y(t, { children: [
287
- C && /* @__PURE__ */ v(e, {
286
+ /* @__PURE__ */ y("div", {
287
+ style: x.content,
288
+ children: /* @__PURE__ */ b(n, { children: [
289
+ w && /* @__PURE__ */ y(t, {
288
290
  headingLevel: 3,
289
291
  emphasis: "muted",
290
292
  padding: "compact",
291
293
  title: "Exporting",
292
- description: C,
294
+ description: w,
293
295
  "data-testid": "export-target"
294
296
  }),
295
- /* @__PURE__ */ y(e, {
297
+ /* @__PURE__ */ b(t, {
296
298
  headingLevel: 3,
297
299
  title: "Export options",
298
300
  description: "What to include in the JSON file.",
299
301
  "data-testid": "export-options",
300
302
  bodyClassName: "flex flex-col gap-form-gap",
301
303
  children: [
302
- /* @__PURE__ */ v(x, {
303
- checked: E,
304
- onChange: D,
304
+ /* @__PURE__ */ y(S, {
305
+ checked: D,
306
+ onChange: O,
305
307
  disabled: !0,
306
308
  label: "Include Data Source References",
307
309
  description: "Not available for exports from this session."
308
310
  }),
309
- /* @__PURE__ */ v(x, {
310
- checked: O,
311
- onChange: k,
311
+ /* @__PURE__ */ y(S, {
312
+ checked: k,
313
+ onChange: A,
312
314
  disabled: !0,
313
315
  label: "Include Webhook Mappings",
314
316
  description: "Not available for exports from this session."
315
317
  }),
316
- /* @__PURE__ */ v(x, {
317
- checked: A,
318
- onChange: j,
319
- disabled: I,
318
+ /* @__PURE__ */ y(S, {
319
+ checked: j,
320
+ onChange: M,
321
+ disabled: L,
320
322
  label: "Format JSON (Pretty Print)",
321
323
  description: "Makes the export file human-readable (larger file size)"
322
324
  })
323
325
  ]
324
326
  }),
325
- /* @__PURE__ */ y(e, {
327
+ /* @__PURE__ */ b(t, {
326
328
  headingLevel: 3,
327
329
  title: "Preview",
328
330
  description: "The exact JSON the download writes. Credentials are never serialized — only data source references.",
329
331
  "data-testid": "export-preview",
330
- actions: W ? /* @__PURE__ */ y("button", {
332
+ actions: q ? /* @__PURE__ */ b("button", {
331
333
  type: "button",
332
- style: b.previewAction,
333
- onClick: K,
334
- children: [v(G ? c : l, {
334
+ style: x.previewAction,
335
+ onClick: Y,
336
+ children: [y(J ? l : u, {
335
337
  style: {
336
338
  width: "14px",
337
339
  height: "14px"
338
340
  },
339
341
  "aria-hidden": "true"
340
- }), G ? "Copied" : "Copy"]
342
+ }), J ? "Copied" : "Copy"]
341
343
  }) : void 0,
342
344
  children: [
343
- B && !W && /* @__PURE__ */ y("div", {
345
+ U && !q && /* @__PURE__ */ b("div", {
344
346
  style: {
345
347
  display: "flex",
346
348
  alignItems: "center",
347
349
  gap: "8px",
348
350
  color: "var(--color-text-secondary)"
349
351
  },
350
- children: [/* @__PURE__ */ v(g, { style: {
352
+ children: [/* @__PURE__ */ y(_, { style: {
351
353
  width: "16px",
352
354
  height: "16px"
353
- } }), /* @__PURE__ */ v("span", {
355
+ } }), /* @__PURE__ */ y("span", {
354
356
  style: { fontSize: "13px" },
355
357
  children: "Building the export…"
356
358
  })]
357
359
  }),
358
- !B && V && /* @__PURE__ */ y("p", {
360
+ !U && W && /* @__PURE__ */ b("p", {
359
361
  style: {
360
362
  margin: 0,
361
363
  fontSize: "13px",
362
364
  color: "var(--color-status-error-text)"
363
365
  },
364
- children: ["Preview unavailable: ", V.message]
366
+ children: ["Preview unavailable: ", W.message]
365
367
  }),
366
- W && /* @__PURE__ */ v("pre", {
367
- style: b.previewBlock,
368
+ q && /* @__PURE__ */ y("pre", {
369
+ style: x.previewBlock,
368
370
  "data-testid": "export-preview-json",
369
- children: W
371
+ children: q
370
372
  })
371
373
  ]
372
374
  }),
373
- L && /* @__PURE__ */ v(e, {
375
+ R && /* @__PURE__ */ y(t, {
374
376
  headingLevel: 3,
375
377
  tone: "danger",
376
378
  padding: "compact",
377
379
  title: "Export failed",
378
- description: L.message,
380
+ description: R.message,
379
381
  "data-testid": "export-error"
380
382
  })
381
383
  ] })
382
384
  }),
383
- /* @__PURE__ */ y("div", {
384
- style: b.footer,
385
- children: [/* @__PURE__ */ v("button", {
386
- style: b.cancelButton,
387
- onClick: w,
388
- disabled: I,
385
+ /* @__PURE__ */ b("div", {
386
+ style: x.footer,
387
+ children: [/* @__PURE__ */ y("button", {
388
+ style: x.cancelButton,
389
+ onClick: T,
390
+ disabled: L,
389
391
  onMouseEnter: (e) => {
390
392
  e.currentTarget.style.backgroundColor = "var(--color-bg-muted)";
391
393
  },
@@ -393,23 +395,23 @@ var b = {
393
395
  e.currentTarget.style.backgroundColor = "var(--color-bg-surface)";
394
396
  },
395
397
  children: "Cancel"
396
- }), /* @__PURE__ */ v("button", {
398
+ }), /* @__PURE__ */ y("button", {
397
399
  style: {
398
- ...b.exportButton,
399
- ...I || B || !W ? b.exportButtonDisabled : {}
400
+ ...x.exportButton,
401
+ ...L || U || !q ? x.exportButtonDisabled : {}
400
402
  },
401
- onClick: q,
402
- disabled: I || B || !W,
403
+ onClick: X,
404
+ disabled: L || U || !q,
403
405
  onMouseEnter: (e) => {
404
- I || (e.currentTarget.style.opacity = "0.9");
406
+ L || (e.currentTarget.style.opacity = "0.9");
405
407
  },
406
408
  onMouseLeave: (e) => {
407
- I || (e.currentTarget.style.opacity = "1");
409
+ L || (e.currentTarget.style.opacity = "1");
408
410
  },
409
- children: I ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(g, { style: {
411
+ children: L ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(_, { style: {
410
412
  width: "16px",
411
413
  height: "16px"
412
- } }), "Exporting..."] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(u, { style: {
414
+ } }), "Exporting..."] }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(d, { style: {
413
415
  width: "16px",
414
416
  height: "16px"
415
417
  } }), "Download Export"] })
@@ -420,4 +422,4 @@ var b = {
420
422
  }) : null;
421
423
  });
422
424
  //#endregion
423
- export { S as default };
425
+ export { C as default };