@databrainhq/plugin 0.14.8 → 0.14.9

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.
@@ -27329,31 +27329,38 @@ const Eq = ({
27329
27329
  }, vq = (t) => {
27330
27330
  De.useEffect(() => {
27331
27331
  var n, r, M, a, u, o, s, N, D, g, l, j;
27332
- const i = !!(document.querySelector("dbn-dashboard") || document.querySelector("dbn-metric"));
27332
+ const i = !!(document.querySelector("dbn-dashboard") || document.querySelector("dbn-metric") || document.querySelector("dbn-create-metric"));
27333
27333
  if (!t) {
27334
27334
  if (i) {
27335
27335
  const T = document.querySelectorAll("dbn-dashboard");
27336
- T.length && T.forEach((A, h) => {
27337
- if (A && A.shadowRoot) {
27338
- const x = document.querySelector(
27339
- `#dbn-dashboard-${h}-admin-styles`
27336
+ T.length && T.forEach((h, x) => {
27337
+ if (h && h.shadowRoot) {
27338
+ const O = document.querySelector(
27339
+ `#dbn-dashboard-${x}-admin-styles`
27340
27340
  );
27341
- x && A.shadowRoot.removeChild(x);
27341
+ O && h.shadowRoot.removeChild(O);
27342
27342
  }
27343
27343
  });
27344
27344
  const y = document.querySelectorAll("dbn-metric");
27345
- y.length && y.forEach((A, h) => {
27346
- const x = document.querySelector(
27347
- `#dbn-metric-${h}-admin-styles`
27345
+ y.length && y.forEach((h, x) => {
27346
+ const O = document.querySelector(
27347
+ `#dbn-metric-${x}-admin-styles`
27348
27348
  );
27349
- x && A.shadowRoot && A.shadowRoot.removeChild(x);
27349
+ O && h.shadowRoot && h.shadowRoot.removeChild(O);
27350
27350
  });
27351
- const z = document.querySelector("#dbn-portal");
27352
- if (z && z.shadowRoot) {
27353
- const A = document.querySelector(
27351
+ const z = document.querySelectorAll("dbn-create-metric");
27352
+ z.length && z.forEach((h, x) => {
27353
+ const O = document.querySelector(
27354
+ `#dbn-create-metric-${x}-admin-styles`
27355
+ );
27356
+ O && h.shadowRoot && h.shadowRoot.removeChild(O);
27357
+ });
27358
+ const A = document.querySelector("#dbn-portal");
27359
+ if (A && A.shadowRoot) {
27360
+ const h = document.querySelector(
27354
27361
  "#dbn-portal-admin-styles"
27355
27362
  );
27356
- A && z.shadowRoot.removeChild(A);
27363
+ h && A.shadowRoot.removeChild(h);
27357
27364
  }
27358
27365
  } else {
27359
27366
  const T = document.querySelector("#dbn-admin-styles");
@@ -27403,43 +27410,60 @@ const Eq = ({
27403
27410
  padding: ${t.cardCustomization.padding} !important;
27404
27411
  }`), i) {
27405
27412
  const T = document.querySelectorAll("dbn-dashboard");
27406
- T.length && T.forEach((A, h) => {
27407
- if (A && A.shadowRoot) {
27408
- const x = document.querySelector(
27409
- `#dbn-dashboard-${h}-admin-styles`
27413
+ T.length && T.forEach((h, x) => {
27414
+ if (h && h.shadowRoot) {
27415
+ const O = document.querySelector(
27416
+ `#dbn-dashboard-${x}-admin-styles`
27410
27417
  );
27411
- if (x)
27412
- x.innerHTML = e;
27418
+ if (O)
27419
+ O.innerHTML = e;
27413
27420
  else {
27414
- const O = document.createElement("style");
27415
- O.setAttribute(
27421
+ const d = document.createElement("style");
27422
+ d.setAttribute(
27416
27423
  "id",
27417
- `dbn-dashboard-${h}-admin-styles`
27418
- ), O.innerHTML = e, A.shadowRoot.appendChild(O);
27424
+ `dbn-dashboard-${x}-admin-styles`
27425
+ ), d.innerHTML = e, h.shadowRoot.appendChild(d);
27419
27426
  }
27420
27427
  }
27421
27428
  });
27422
27429
  const y = document.querySelectorAll("dbn-metric");
27423
- y.length && y.forEach((A, h) => {
27424
- if (A.shadowRoot) {
27425
- const x = document.querySelector(
27426
- `#dbn-metric-${h}-admin-styles`
27430
+ y.length && y.forEach((h, x) => {
27431
+ if (h.shadowRoot) {
27432
+ const O = document.querySelector(
27433
+ `#dbn-metric-${x}-admin-styles`
27427
27434
  );
27428
- if (x)
27429
- x.innerHTML = e;
27435
+ if (O)
27436
+ O.innerHTML = e;
27430
27437
  else {
27431
- const O = document.createElement("style");
27432
- O.setAttribute(
27438
+ const d = document.createElement("style");
27439
+ d.setAttribute(
27433
27440
  "id",
27434
- `dbn-metric-${h}-admin-styles`
27435
- ), O.innerHTML = e, A.shadowRoot.appendChild(O);
27441
+ `dbn-metric-${x}-admin-styles`
27442
+ ), d.innerHTML = e, h.shadowRoot.appendChild(d);
27436
27443
  }
27437
27444
  }
27438
27445
  });
27439
- const z = document.querySelector("#dbn-portal");
27440
- if (z && z.shadowRoot) {
27441
- const A = document.querySelector("#dbn-portal-admin-styles");
27442
- A && z.shadowRoot.removeChild(A);
27446
+ const z = document.querySelectorAll("dbn-create-metric");
27447
+ z.length && z.forEach((h, x) => {
27448
+ if (h.shadowRoot) {
27449
+ const O = document.querySelector(
27450
+ `#dbn-create-metric-${x}-admin-styles`
27451
+ );
27452
+ if (O)
27453
+ O.innerHTML = e;
27454
+ else {
27455
+ const d = document.createElement("style");
27456
+ d.setAttribute(
27457
+ "id",
27458
+ `dbn-create-metric-${x}-admin-styles`
27459
+ ), d.innerHTML = e, h.shadowRoot.appendChild(d);
27460
+ }
27461
+ }
27462
+ });
27463
+ const A = document.querySelector("#dbn-portal");
27464
+ if (A && A.shadowRoot) {
27465
+ const h = document.querySelector("#dbn-portal-admin-styles");
27466
+ h && A.shadowRoot.removeChild(h);
27443
27467
  }
27444
27468
  } else {
27445
27469
  const T = document.querySelector("#dbn-admin-styles") || document.createElement("style");
@@ -121178,7 +121202,7 @@ const lat = "_container_tcaud_1", cat = "_label_tcaud_9", jat = "_textarea_tcaud
121178
121202
  const [i, e] = De.useState();
121179
121203
  return De.useEffect(() => {
121180
121204
  const n = document.querySelector("#dbn-portal") || document.createElement("div");
121181
- if (n.setAttribute("id", "dbn-portal"), document.body.querySelector("#dbn-portal") || document.body.appendChild(n), document.querySelector("dbn-dashboard") || document.querySelector("dbn-metric")) {
121205
+ if (n.setAttribute("id", "dbn-portal"), document.body.querySelector("#dbn-portal") || document.body.appendChild(n), document.querySelector("dbn-dashboard") || document.querySelector("dbn-metric") || document.querySelector("dbn-create-metric")) {
121182
121206
  const r = document.querySelector("#dbn-styles"), M = n.shadowRoot || n.attachShadow({ mode: "open" });
121183
121207
  if (r && !M.querySelector("#dbn-portal-style")) {
121184
121208
  const a = document.createElement("style");
@@ -122454,7 +122478,16 @@ const Aut = ({
122454
122478
  ] }) : /* @__PURE__ */ v.jsx(m5, { text: n || "Create metric is not enabled" }),
122455
122479
  e ? /* @__PURE__ */ v.jsx("div", { className: "dbn-w-full dbn-h-full dbn-flex dbn-items-center dbn-justify-center", children: /* @__PURE__ */ v.jsx(a1, {}) }) : null
122456
122480
  ] });
122457
- }, xut = (t) => /* @__PURE__ */ v.jsx(v.Fragment, { children: /* @__PURE__ */ v.jsx(k7, { theme: t.theme, children: /* @__PURE__ */ v.jsx(INe, { token: t.token, dashboardId: t.dashboardId, children: /* @__PURE__ */ v.jsx(Lut, { ...t }) }) }) }), put = l3(Aut, {
122481
+ }, xut = (t) => {
122482
+ const i = De.useId(), [e, n] = De.useState("");
122483
+ return De.useEffect(() => {
122484
+ const r = document.querySelector("#dbn-styles");
122485
+ r && n(r.innerHTML);
122486
+ }, []), /* @__PURE__ */ v.jsxs(v.Fragment, { children: [
122487
+ /* @__PURE__ */ v.jsx("style", { id: `dbn-create-metric-${i}-style`, children: e }),
122488
+ /* @__PURE__ */ v.jsx(k7, { theme: t.theme, children: /* @__PURE__ */ v.jsx(INe, { token: t.token, dashboardId: t.dashboardId, children: /* @__PURE__ */ v.jsx(Lut, { ...t }) }) })
122489
+ ] });
122490
+ }, put = l3(Aut, {
122458
122491
  props: {
122459
122492
  token: "string",
122460
122493
  dashboardId: "string",