@adhese/sdk-devtools 0.2.0 → 0.4.0

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,7 +1,7 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
2
  const require$$0 = require("react");
4
3
  const require$$0$1 = require("react-dom");
4
+ const lodashEs = require("lodash-es");
5
5
  const clsx = require("clsx");
6
6
  const tailwindMerge = require("tailwind-merge");
7
7
  const classVarianceAuthority = require("class-variance-authority");
@@ -9,7 +9,6 @@ const reactSlot = require("@radix-ui/react-slot");
9
9
  const SheetPrimitive = require("@radix-ui/react-dialog");
10
10
  const reactIcons = require("@radix-ui/react-icons");
11
11
  const TabsPrimitive = require("@radix-ui/react-tabs");
12
- const lodashEs = require("lodash-es");
13
12
  const SwitchPrimitives = require("@radix-ui/react-switch");
14
13
  const LabelPrimitive = require("@radix-ui/react-label");
15
14
  function _interopNamespaceDefault(e) {
@@ -1273,10 +1272,20 @@ function SlotsTable({ adheseContext }) {
1273
1272
  var _a;
1274
1273
  return (_a = formattedSlot.ad) == null ? void 0 : _a.preview;
1275
1274
  });
1275
+ const origins = require$$0.useMemo(() => {
1276
+ const set = /* @__PURE__ */ new Set();
1277
+ for (const slot of formattedSlots) {
1278
+ const ad = slot.getAd();
1279
+ if (ad)
1280
+ set.add(ad.origin);
1281
+ }
1282
+ return Array.from(set);
1283
+ }, [formattedSlots]);
1276
1284
  return formattedSlots.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { children: [
1277
1285
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { children: [
1278
1286
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Name" }),
1279
1287
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Format" }),
1288
+ origins.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Origin" }),
1280
1289
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Location" }),
1281
1290
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Render Status" }),
1282
1291
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Campaign ID" }),
@@ -1307,6 +1316,7 @@ function SlotsTable({ adheseContext }) {
1307
1316
  /* @__PURE__ */ jsxRuntimeExports.jsx("del", { className: "text-red-300 italic", children: format }),
1308
1317
  /* @__PURE__ */ jsxRuntimeExports.jsx("ins", { className: "no-underline text-green-700", children: ad == null ? void 0 : ad.adFormat })
1309
1318
  ] }) }),
1319
+ origins.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: (ad == null ? void 0 : ad.origin) && /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { className: cn(slotIndexBadgeClasses[origins.indexOf(ad.origin) % slotIndexBadgeClasses.length], "text-white"), children: lodashEs.upperFirst(ad.origin.toLowerCase()) }) }),
1310
1320
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: location }),
1311
1321
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1312
1322
  Badge,
@@ -1663,13 +1673,10 @@ function FronttailSettings({
1663
1673
  id: `fronttailDebugKey${id}`,
1664
1674
  value: fronttailDebugKey,
1665
1675
  onChange: onFronttailDebugKeyChange,
1666
- className: cn(
1667
- "max-w-60",
1668
- {
1669
- // eslint-disable-next-line ts/naming-convention
1670
- "border-destructive": fronttailDebugKey.length < 4
1671
- }
1672
- )
1676
+ className: cn("max-w-60", {
1677
+ // eslint-disable-next-line ts/naming-convention
1678
+ "border-destructive": fronttailDebugKey.length < 4
1679
+ })
1673
1680
  }
1674
1681
  ),
1675
1682
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -1775,6 +1782,10 @@ function Devtools({ adheseContext }) {
1775
1782
  /* @__PURE__ */ jsxRuntimeExports.jsx(PreviewButton, {})
1776
1783
  ] }) });
1777
1784
  }
1785
+ const Devtools$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1786
+ __proto__: null,
1787
+ Devtools
1788
+ }, Symbol.toStringTag, { value: "Module" }));
1778
1789
  function createAdheseDevtools(element, context) {
1779
1790
  const root = createRoot(element);
1780
1791
  root.render(/* @__PURE__ */ jsxRuntimeExports.jsx(Devtools, { adheseContext: context }));
@@ -1782,6 +1793,10 @@ function createAdheseDevtools(element, context) {
1782
1793
  root.unmount();
1783
1794
  };
1784
1795
  }
1785
- exports.Devtools = Devtools;
1786
- exports.createAdheseDevtools = createAdheseDevtools;
1796
+ const main = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1797
+ __proto__: null,
1798
+ createAdheseDevtools
1799
+ }, Symbol.toStringTag, { value: "Module" }));
1800
+ exports.Devtools = Devtools$1;
1801
+ exports.main = main;
1787
1802
  //# sourceMappingURL=devtools.js.map