@databrainhq/plugin 0.14.12 → 0.14.14

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.
@@ -27334,36 +27334,50 @@ const Eq = ({
27334
27334
  const T = document.querySelectorAll("dbn-dashboard");
27335
27335
  T.length && T.forEach((h, x) => {
27336
27336
  if (h && h.shadowRoot) {
27337
- const O = document.querySelector(
27337
+ const O = document.querySelectorAll(
27338
27338
  `#dbn-dashboard-${x}-admin-styles`
27339
27339
  );
27340
- O && h.shadowRoot.removeChild(O);
27340
+ O.length && O.forEach((d) => {
27341
+ var E;
27342
+ (E = h.shadowRoot) == null || E.removeChild(d);
27343
+ });
27341
27344
  }
27342
27345
  });
27343
27346
  const y = document.querySelectorAll("dbn-metric");
27344
27347
  y.length && y.forEach((h, x) => {
27345
- const O = document.querySelector(
27348
+ const O = document.querySelectorAll(
27346
27349
  `#dbn-metric-${x}-admin-styles`
27347
27350
  );
27348
- O && h.shadowRoot && h.shadowRoot.removeChild(O);
27351
+ O.length && O.forEach((d) => {
27352
+ var E;
27353
+ (E = h.shadowRoot) == null || E.removeChild(d);
27354
+ });
27349
27355
  });
27350
27356
  const z = document.querySelectorAll("dbn-create-metric");
27351
27357
  z.length && z.forEach((h, x) => {
27352
- const O = document.querySelector(
27358
+ const O = document.querySelectorAll(
27353
27359
  `#dbn-create-metric-${x}-admin-styles`
27354
27360
  );
27355
- O && h.shadowRoot && h.shadowRoot.removeChild(O);
27361
+ O.length && O.forEach((d) => {
27362
+ var E;
27363
+ (E = h.shadowRoot) == null || E.removeChild(d);
27364
+ });
27356
27365
  });
27357
27366
  const A = document.querySelector("#dbn-portal");
27358
27367
  if (A && A.shadowRoot) {
27359
- const h = document.querySelector(
27368
+ const h = document.querySelectorAll(
27360
27369
  "#dbn-portal-admin-styles"
27361
27370
  );
27362
- h && A.shadowRoot.removeChild(h);
27371
+ h.length && h.forEach((x) => {
27372
+ var O;
27373
+ (O = A.shadowRoot) == null || O.removeChild(x);
27374
+ });
27363
27375
  }
27364
27376
  } else {
27365
- const T = document.querySelector("#dbn-admin-styles");
27366
- T && document.head.removeChild(T);
27377
+ const T = document.querySelectorAll("#dbn-admin-styles");
27378
+ T.length && T.forEach((y) => {
27379
+ document.head.removeChild(y);
27380
+ });
27367
27381
  }
27368
27382
  return;
27369
27383
  }
@@ -27411,52 +27425,49 @@ const Eq = ({
27411
27425
  const T = document.querySelectorAll("dbn-dashboard");
27412
27426
  T.length && T.forEach((h, x) => {
27413
27427
  if (h && h.shadowRoot) {
27414
- const O = document.querySelector(
27428
+ const O = document.querySelectorAll(
27415
27429
  `#dbn-dashboard-${x}-admin-styles`
27416
27430
  );
27417
- if (O)
27418
- O.innerHTML = t;
27419
- else {
27420
- const d = document.createElement("style");
27421
- d.setAttribute(
27422
- "id",
27423
- `dbn-dashboard-${x}-admin-styles`
27424
- ), d.innerHTML = t, h.shadowRoot.appendChild(d);
27425
- }
27431
+ O.length && O.forEach((E) => {
27432
+ var k;
27433
+ (k = h.shadowRoot) == null || k.removeChild(E);
27434
+ });
27435
+ const d = document.createElement("style");
27436
+ d.setAttribute(
27437
+ "id",
27438
+ `dbn-dashboard-${x}-admin-styles`
27439
+ ), d.innerHTML = t, h.shadowRoot.appendChild(d);
27426
27440
  }
27427
27441
  });
27428
27442
  const y = document.querySelectorAll("dbn-metric");
27429
27443
  y.length && y.forEach((h, x) => {
27430
27444
  if (h.shadowRoot) {
27431
- const O = document.querySelector(
27445
+ const O = document.querySelectorAll(
27432
27446
  `#dbn-metric-${x}-admin-styles`
27433
27447
  );
27434
- if (O)
27435
- O.innerHTML = t;
27436
- else {
27437
- const d = document.createElement("style");
27438
- d.setAttribute(
27439
- "id",
27440
- `dbn-metric-${x}-admin-styles`
27441
- ), d.innerHTML = t, h.shadowRoot.appendChild(d);
27442
- }
27448
+ O.length && O.forEach((E) => {
27449
+ var k;
27450
+ (k = h.shadowRoot) == null || k.removeChild(E);
27451
+ });
27452
+ const d = document.createElement("style");
27453
+ d.setAttribute("id", `dbn-metric-${x}-admin-styles`), d.innerHTML = t, h.shadowRoot.appendChild(d);
27443
27454
  }
27444
27455
  });
27445
27456
  const z = document.querySelectorAll("dbn-create-metric");
27446
27457
  z.length && z.forEach((h, x) => {
27447
27458
  if (h.shadowRoot) {
27448
- const O = document.querySelector(
27459
+ const O = document.querySelectorAll(
27449
27460
  `#dbn-create-metric-${x}-admin-styles`
27450
27461
  );
27451
- if (O)
27452
- O.innerHTML = t;
27453
- else {
27454
- const d = document.createElement("style");
27455
- d.setAttribute(
27456
- "id",
27457
- `dbn-create-metric-${x}-admin-styles`
27458
- ), d.innerHTML = t, h.shadowRoot.appendChild(d);
27459
- }
27462
+ O.length && O.forEach((E) => {
27463
+ var k;
27464
+ (k = h.shadowRoot) == null || k.removeChild(E);
27465
+ });
27466
+ const d = document.createElement("style");
27467
+ d.setAttribute(
27468
+ "id",
27469
+ `dbn-create-metric-${x}-admin-styles`
27470
+ ), d.innerHTML = t, h.shadowRoot.appendChild(d);
27460
27471
  }
27461
27472
  });
27462
27473
  const A = document.querySelector("#dbn-portal");
@@ -79838,11 +79849,45 @@ const j8e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
79838
79849
  throw new Error('Network response was not ok');
79839
79850
  }
79840
79851
 
79852
+ const clonedRes = res.clone(); // Clone the response for reading the content
79853
+
79854
+ const reader = clonedRes.body?.getReader();
79855
+
79856
+ let receivedLength = 0;
79857
+ const chunks = [];
79858
+
79859
+ if (reader) {
79860
+ while (true) {
79861
+ const { done: isDone, value } = await reader.read();
79862
+ if (isDone) {
79863
+ break;
79864
+ }
79865
+ chunks.push(value);
79866
+
79867
+ receivedLength += value.length;
79868
+ const lenghtInKb = Math.round(receivedLength / 1024);
79869
+
79870
+
79871
+ document.getElementById('progress-text').textContent = 'Download Progress: ' + lenghtInKb + ' KB';
79872
+ }
79873
+ }
79874
+ // Concatenate all the chunks into a single Uint8Array
79875
+ const chunksAll = new Uint8Array(receivedLength);
79876
+ let position = 0;
79877
+ for (const chunk of chunks) {
79878
+ chunksAll.set(chunk, position);
79879
+ position += chunk.length;
79880
+ }
79881
+ // Convert the Uint8Array to a Blob
79882
+ const blob = new Blob([chunksAll]);
79841
79883
  // Read the response body as a Blob (binary data)
79842
- const zipData = await res.blob();
79884
+ // const zipData = await res.blob();
79885
+
79886
+ // Create a temporary URL for the Blob
79887
+ const zipUrl = URL.createObjectURL(blob);
79843
79888
 
79844
79889
  // Create a temporary URL for the Blob
79845
- const zipUrl = URL.createObjectURL(zipData);
79890
+ //const zipUrl = URL.createObjectURL(zipData);
79846
79891
 
79847
79892
  // Create a link element to trigger the download
79848
79893
  const downloadLink = document.createElement('a');
@@ -79862,6 +79907,8 @@ const j8e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
79862
79907
  // Remove the link from the document
79863
79908
  document.body.removeChild(downloadLink);
79864
79909
  // Close the new tab/window
79910
+ document.getElementById('progress-text').textContent = 'Download complete';
79911
+
79865
79912
  window.close();
79866
79913
 
79867
79914
  } catch (error) {
@@ -122065,7 +122112,7 @@ const WA = {
122065
122112
  children: "Create Metric"
122066
122113
  }
122067
122114
  ),
122068
- /* @__PURE__ */ v.jsx(
122115
+ a && /* @__PURE__ */ v.jsx(
122069
122116
  Nue,
122070
122117
  {
122071
122118
  clientId: n.clientId,