@adhese/sdk-devtools 0.3.0 → 0.5.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.
- package/dist/cjs/devtools.js +17 -6
- package/dist/cjs/devtools.js.map +1 -1
- package/dist/es/devtools.js +17 -6
- package/dist/es/devtools.js.map +1 -1
- package/dist/index.d.ts +70 -149
- package/dist/style.css +13 -4
- package/package.json +4 -4
package/dist/cjs/devtools.js
CHANGED
|
@@ -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) {
|
|
@@ -1250,7 +1250,7 @@ function SlotsTable({ adheseContext }) {
|
|
|
1250
1250
|
};
|
|
1251
1251
|
}, []);
|
|
1252
1252
|
const formattedSlots = require$$0.useMemo(() => slots.map((slot) => {
|
|
1253
|
-
const ad = slot.
|
|
1253
|
+
const ad = slot.ad.value;
|
|
1254
1254
|
const iframe = slot.getElement();
|
|
1255
1255
|
let status = "unloaded";
|
|
1256
1256
|
if (iframe)
|
|
@@ -1259,10 +1259,10 @@ function SlotsTable({ adheseContext }) {
|
|
|
1259
1259
|
status = "loaded";
|
|
1260
1260
|
return {
|
|
1261
1261
|
...slot,
|
|
1262
|
-
name: slot.
|
|
1262
|
+
name: slot.name.value,
|
|
1263
1263
|
ad,
|
|
1264
1264
|
status,
|
|
1265
|
-
format: slot.
|
|
1265
|
+
format: slot.format.value,
|
|
1266
1266
|
iframe,
|
|
1267
1267
|
parameters: Array.from(slot.parameters.entries())
|
|
1268
1268
|
};
|
|
@@ -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;
|
|
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,
|
|
@@ -1359,8 +1370,8 @@ function SlotsTable({ adheseContext }) {
|
|
|
1359
1370
|
) : "-" }),
|
|
1360
1371
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: (ad == null ? void 0 : ad.id) ?? "-" }),
|
|
1361
1372
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: (ad == null ? void 0 : ad.ext) ? /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "outline", children: ad.ext }) : "-" }),
|
|
1362
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: isViewabilityTracked
|
|
1363
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: isImpressionTracked
|
|
1373
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: isViewabilityTracked.value ? /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { className: "bg-green-100 text-green-900 hover:bg-green-100", children: "Yes" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "secondary", children: "No" }) }),
|
|
1374
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: isImpressionTracked.value ? /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { className: "bg-green-100 text-green-900 hover:bg-green-100", children: "Yes" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "secondary", children: "No" }) }),
|
|
1364
1375
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1365
1376
|
Button,
|
|
1366
1377
|
{
|