@adhese/sdk-devtools 0.3.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,6 +1,7 @@
1
1
  "use strict";
2
2
  const require$$0 = require("react");
3
3
  const require$$0$1 = require("react-dom");
4
+ const lodashEs = require("lodash-es");
4
5
  const clsx = require("clsx");
5
6
  const tailwindMerge = require("tailwind-merge");
6
7
  const classVarianceAuthority = require("class-variance-authority");
@@ -8,7 +9,6 @@ const reactSlot = require("@radix-ui/react-slot");
8
9
  const SheetPrimitive = require("@radix-ui/react-dialog");
9
10
  const reactIcons = require("@radix-ui/react-icons");
10
11
  const TabsPrimitive = require("@radix-ui/react-tabs");
11
- const lodashEs = require("lodash-es");
12
12
  const SwitchPrimitives = require("@radix-ui/react-switch");
13
13
  const LabelPrimitive = require("@radix-ui/react-label");
14
14
  function _interopNamespaceDefault(e) {
@@ -1272,10 +1272,20 @@ function SlotsTable({ adheseContext }) {
1272
1272
  var _a;
1273
1273
  return (_a = formattedSlot.ad) == null ? void 0 : _a.preview;
1274
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]);
1275
1284
  return formattedSlots.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { children: [
1276
1285
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { children: [
1277
1286
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Name" }),
1278
1287
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Format" }),
1288
+ origins.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Origin" }),
1279
1289
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Location" }),
1280
1290
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Render Status" }),
1281
1291
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Campaign ID" }),
@@ -1306,6 +1316,7 @@ function SlotsTable({ adheseContext }) {
1306
1316
  /* @__PURE__ */ jsxRuntimeExports.jsx("del", { className: "text-red-300 italic", children: format }),
1307
1317
  /* @__PURE__ */ jsxRuntimeExports.jsx("ins", { className: "no-underline text-green-700", children: ad == null ? void 0 : ad.adFormat })
1308
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()) }) }),
1309
1320
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: location }),
1310
1321
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1311
1322
  Badge,