@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/es/devtools.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import require$$0, { forwardRef, useState, useEffect, useMemo, Fragment, useCallback, useId, useRef } from "react";
|
|
2
2
|
import require$$0$1, { createPortal } from "react-dom";
|
|
3
|
+
import { upperFirst } from "lodash-es";
|
|
3
4
|
import { clsx } from "clsx";
|
|
4
5
|
import { twMerge } from "tailwind-merge";
|
|
5
6
|
import { cva } from "class-variance-authority";
|
|
@@ -7,7 +8,6 @@ import { Slot } from "@radix-ui/react-slot";
|
|
|
7
8
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
8
9
|
import { Cross2Icon } from "@radix-ui/react-icons";
|
|
9
10
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
10
|
-
import { upperFirst } from "lodash-es";
|
|
11
11
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
12
12
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
13
13
|
var jsxRuntime = { exports: {} };
|
|
@@ -1229,7 +1229,7 @@ function SlotsTable({ adheseContext }) {
|
|
|
1229
1229
|
};
|
|
1230
1230
|
}, []);
|
|
1231
1231
|
const formattedSlots = useMemo(() => slots.map((slot) => {
|
|
1232
|
-
const ad = slot.
|
|
1232
|
+
const ad = slot.ad.value;
|
|
1233
1233
|
const iframe = slot.getElement();
|
|
1234
1234
|
let status = "unloaded";
|
|
1235
1235
|
if (iframe)
|
|
@@ -1238,10 +1238,10 @@ function SlotsTable({ adheseContext }) {
|
|
|
1238
1238
|
status = "loaded";
|
|
1239
1239
|
return {
|
|
1240
1240
|
...slot,
|
|
1241
|
-
name: slot.
|
|
1241
|
+
name: slot.name.value,
|
|
1242
1242
|
ad,
|
|
1243
1243
|
status,
|
|
1244
|
-
format: slot.
|
|
1244
|
+
format: slot.format.value,
|
|
1245
1245
|
iframe,
|
|
1246
1246
|
parameters: Array.from(slot.parameters.entries())
|
|
1247
1247
|
};
|
|
@@ -1251,10 +1251,20 @@ function SlotsTable({ adheseContext }) {
|
|
|
1251
1251
|
var _a;
|
|
1252
1252
|
return (_a = formattedSlot.ad) == null ? void 0 : _a.preview;
|
|
1253
1253
|
});
|
|
1254
|
+
const origins = useMemo(() => {
|
|
1255
|
+
const set = /* @__PURE__ */ new Set();
|
|
1256
|
+
for (const slot of formattedSlots) {
|
|
1257
|
+
const { ad } = slot;
|
|
1258
|
+
if (ad)
|
|
1259
|
+
set.add(ad.origin);
|
|
1260
|
+
}
|
|
1261
|
+
return Array.from(set);
|
|
1262
|
+
}, [formattedSlots]);
|
|
1254
1263
|
return formattedSlots.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { children: [
|
|
1255
1264
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { children: [
|
|
1256
1265
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Name" }),
|
|
1257
1266
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Format" }),
|
|
1267
|
+
origins.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Origin" }),
|
|
1258
1268
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Location" }),
|
|
1259
1269
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Render Status" }),
|
|
1260
1270
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { children: "Campaign ID" }),
|
|
@@ -1285,6 +1295,7 @@ function SlotsTable({ adheseContext }) {
|
|
|
1285
1295
|
/* @__PURE__ */ jsxRuntimeExports.jsx("del", { className: "text-red-300 italic", children: format }),
|
|
1286
1296
|
/* @__PURE__ */ jsxRuntimeExports.jsx("ins", { className: "no-underline text-green-700", children: ad == null ? void 0 : ad.adFormat })
|
|
1287
1297
|
] }) }),
|
|
1298
|
+
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: upperFirst(ad.origin.toLowerCase()) }) }),
|
|
1288
1299
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: location }),
|
|
1289
1300
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1290
1301
|
Badge,
|
|
@@ -1338,8 +1349,8 @@ function SlotsTable({ adheseContext }) {
|
|
|
1338
1349
|
) : "-" }),
|
|
1339
1350
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: (ad == null ? void 0 : ad.id) ?? "-" }),
|
|
1340
1351
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: (ad == null ? void 0 : ad.ext) ? /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "outline", children: ad.ext }) : "-" }),
|
|
1341
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: isViewabilityTracked
|
|
1342
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: isImpressionTracked
|
|
1352
|
+
/* @__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" }) }),
|
|
1353
|
+
/* @__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" }) }),
|
|
1343
1354
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1344
1355
|
Button,
|
|
1345
1356
|
{
|