@xenia-martech/sdk-js 1.2.0-dev.6 → 1.2.0-dev.8
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/README.md +2 -2
- package/dist/{actions-C18Kv-4w.d.cts → actions-35V37IT0.d.cts} +2 -1
- package/dist/{actions-C18Kv-4w.d.ts → actions-35V37IT0.d.ts} +2 -1
- package/dist/{chunk-OMMIRSPK.js → chunk-F3WZFXYK.js} +5 -3
- package/dist/chunk-F3WZFXYK.js.map +1 -0
- package/dist/{chunk-YLMMTKQL.cjs → chunk-IOY6IPUW.cjs} +5 -3
- package/dist/chunk-IOY6IPUW.cjs.map +1 -0
- package/dist/client/index.d.cts +4 -3
- package/dist/client/index.d.ts +4 -3
- package/dist/client/react/index.cjs +14 -7
- package/dist/client/react/index.cjs.map +1 -1
- package/dist/client/react/index.d.cts +10 -4
- package/dist/client/react/index.d.ts +10 -4
- package/dist/client/react/index.js +14 -7
- package/dist/client/react/index.js.map +1 -1
- package/dist/cms/contentful.d.cts +3 -2
- package/dist/cms/contentful.d.ts +3 -2
- package/dist/{consent-DgWdjsSy.d.cts → consent-BgAETCkL.d.cts} +2 -1
- package/dist/{consent-Cemn91j3.d.ts → consent-DRCV0N0d.d.ts} +2 -1
- package/dist/{cookie-names-CnL65Oly.d.cts → cookie-names-DFItnSLK.d.cts} +2 -1
- package/dist/{cookie-names-BvUaW3uo.d.ts → cookie-names-DU3MtcNG.d.ts} +2 -1
- package/dist/edge/index.cjs +22 -22
- package/dist/edge/index.d.cts +5 -4
- package/dist/edge/index.d.ts +5 -4
- package/dist/edge/index.js +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/next/index.cjs +23 -19
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +7 -5
- package/dist/next/index.d.ts +7 -5
- package/dist/next/index.js +6 -2
- package/dist/next/index.js.map +1 -1
- package/dist/{personalize-content-c2DDAV6g.d.ts → personalize-content-Cwc2AomC.d.ts} +2 -1
- package/dist/{personalize-content-ghZPKlf1.d.cts → personalize-content-CxSdplMV.d.cts} +2 -1
- package/dist/server/index.d.cts +5 -4
- package/dist/server/index.d.ts +5 -4
- package/dist/{xenia-server-DV8Sjmoo.d.ts → xenia-server-Cf24mL0c.d.ts} +3 -2
- package/dist/{xenia-server-C3O-cWQT.d.cts → xenia-server-D-bx14lw.d.cts} +3 -2
- package/package.json +10 -10
- package/dist/chunk-OMMIRSPK.js.map +0 -1
- package/dist/chunk-YLMMTKQL.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ElementType, ComponentType } from 'react';
|
|
3
|
-
import { E as XeniaClientOptions, D as XeniaClient, w as ResolveResult, u as ResolveBatchResult, J as JsonValue, x as WebhookResponse, R as ResolveBatchItem, g as AnalyticsEventName, T as TrackOptions, P as PagePersonalizeOptions, j as AppliedSwap, s as PageRef, e as XeniaAction, I as InteractionType, q as MessageMountContext, c as MessageComponentRenderer } from '../../actions-
|
|
4
|
-
export { A as AnalyticsContext, h as AnalyticsIdentity, i as AnalyticsIngestResponse, k as ClientEvent, l as CmsAdapter, C as ConsentState, m as ContentSwap, n as IdentifyRequest, o as IdentifyResponse, M as MessageCta, f as MessagePlacement, r as MessageRenderContext, b as MessageTemplateFn, t as PersonalizationSwap, v as ResolveOptions, X as XeniaConfig, a as XeniaEvent, F as XeniaMarker, G as createXeniaClient, H as extractContentSwaps, K as parseActions, L as pendingTargets, N as personalizeContent, O as personalizePage, Q as spliceSlots } from '../../actions-
|
|
3
|
+
import { E as XeniaClientOptions, D as XeniaClient, w as ResolveResult, u as ResolveBatchResult, J as JsonValue, x as WebhookResponse, R as ResolveBatchItem, g as AnalyticsEventName, T as TrackOptions, P as PagePersonalizeOptions, j as AppliedSwap, s as PageRef, e as XeniaAction, I as InteractionType, q as MessageMountContext, c as MessageComponentRenderer } from '../../actions-35V37IT0.cjs';
|
|
4
|
+
export { A as AnalyticsContext, h as AnalyticsIdentity, i as AnalyticsIngestResponse, k as ClientEvent, l as CmsAdapter, C as ConsentState, m as ContentSwap, n as IdentifyRequest, o as IdentifyResponse, M as MessageCta, f as MessagePlacement, r as MessageRenderContext, b as MessageTemplateFn, t as PersonalizationSwap, v as ResolveOptions, X as XeniaConfig, a as XeniaEvent, F as XeniaMarker, G as createXeniaClient, H as extractContentSwaps, K as parseActions, L as pendingTargets, N as personalizeContent, O as personalizePage, Q as spliceSlots } from '../../actions-35V37IT0.cjs';
|
|
5
5
|
|
|
6
6
|
interface XeniaProviderProps extends XeniaClientOptions {
|
|
7
7
|
children: ReactNode;
|
|
@@ -235,6 +235,11 @@ interface XeniaDebugPanelProps {
|
|
|
235
235
|
prefix?: string;
|
|
236
236
|
/** Corner for the launcher. Default `bottom-right` (Next.js's own dev tools sit bottom-left). */
|
|
237
237
|
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
238
|
+
/**
|
|
239
|
+
* Open the card on page load instead of only the launcher. Default `false`. Once the visitor opens
|
|
240
|
+
* or closes it, their choice wins for the rest of the session.
|
|
241
|
+
*/
|
|
242
|
+
defaultOpen?: boolean;
|
|
238
243
|
/**
|
|
239
244
|
* Content of your own for the Site tab, beyond `custom` (which the panel shows by itself), from
|
|
240
245
|
* the fields your proxy's `debugInfo` added.
|
|
@@ -250,6 +255,7 @@ declare function debugStatus(entry: DebugEntry): DebugStatus;
|
|
|
250
255
|
* site's own rows (`debugInfo`'s `custom`). Reads the debug cookie `xeniaEdgeProxy({ debug: true })`
|
|
251
256
|
* writes; renders nothing without an entry for this page.
|
|
252
257
|
*/
|
|
253
|
-
declare function XeniaDebugPanel({ prefix, position, renderExtra }: XeniaDebugPanelProps): react.JSX.Element | null;
|
|
258
|
+
declare function XeniaDebugPanel({ prefix, position, defaultOpen, renderExtra }: XeniaDebugPanelProps): react.JSX.Element | null;
|
|
254
259
|
|
|
255
|
-
export { AnalyticsEventName, AppliedSwap,
|
|
260
|
+
export { AnalyticsEventName, AppliedSwap, InteractionType, JsonValue, MessageComponentRenderer, MessageMountContext, PagePersonalizeOptions, PageRef, ResolveBatchItem, ResolveBatchResult, ResolveResult, TrackOptions, WebhookResponse, XeniaAction, XeniaClient, XeniaClientOptions, XeniaContentProvider, XeniaContext, XeniaDebugPanel, XeniaMessage, XeniaProvider, XeniaTrack, debugStatus, reactMessageComponent, usePersonalization, usePersonalizationResolve, usePersonalizationResolveSlots, usePersonalizationSlots, usePersonalizedContent, usePersonalizedPage, useTrack, useWebhook, useXenia, useXeniaEntry, useXeniaResponse };
|
|
261
|
+
export type { DebugStatus, EntryStatus, UsePersonalizationResolveResult, UsePersonalizationResolveSlotsResult, UsePersonalizationResult, UsePersonalizationSlotsResult, UsePersonalizedContentOptions, UsePersonalizedContentResult, UseWebhookResult, XeniaDebugPanelProps, XeniaMessageComponentProps, XeniaMessageProps, XeniaProviderProps, XeniaTrackProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ElementType, ComponentType } from 'react';
|
|
3
|
-
import { E as XeniaClientOptions, D as XeniaClient, w as ResolveResult, u as ResolveBatchResult, J as JsonValue, x as WebhookResponse, R as ResolveBatchItem, g as AnalyticsEventName, T as TrackOptions, P as PagePersonalizeOptions, j as AppliedSwap, s as PageRef, e as XeniaAction, I as InteractionType, q as MessageMountContext, c as MessageComponentRenderer } from '../../actions-
|
|
4
|
-
export { A as AnalyticsContext, h as AnalyticsIdentity, i as AnalyticsIngestResponse, k as ClientEvent, l as CmsAdapter, C as ConsentState, m as ContentSwap, n as IdentifyRequest, o as IdentifyResponse, M as MessageCta, f as MessagePlacement, r as MessageRenderContext, b as MessageTemplateFn, t as PersonalizationSwap, v as ResolveOptions, X as XeniaConfig, a as XeniaEvent, F as XeniaMarker, G as createXeniaClient, H as extractContentSwaps, K as parseActions, L as pendingTargets, N as personalizeContent, O as personalizePage, Q as spliceSlots } from '../../actions-
|
|
3
|
+
import { E as XeniaClientOptions, D as XeniaClient, w as ResolveResult, u as ResolveBatchResult, J as JsonValue, x as WebhookResponse, R as ResolveBatchItem, g as AnalyticsEventName, T as TrackOptions, P as PagePersonalizeOptions, j as AppliedSwap, s as PageRef, e as XeniaAction, I as InteractionType, q as MessageMountContext, c as MessageComponentRenderer } from '../../actions-35V37IT0.js';
|
|
4
|
+
export { A as AnalyticsContext, h as AnalyticsIdentity, i as AnalyticsIngestResponse, k as ClientEvent, l as CmsAdapter, C as ConsentState, m as ContentSwap, n as IdentifyRequest, o as IdentifyResponse, M as MessageCta, f as MessagePlacement, r as MessageRenderContext, b as MessageTemplateFn, t as PersonalizationSwap, v as ResolveOptions, X as XeniaConfig, a as XeniaEvent, F as XeniaMarker, G as createXeniaClient, H as extractContentSwaps, K as parseActions, L as pendingTargets, N as personalizeContent, O as personalizePage, Q as spliceSlots } from '../../actions-35V37IT0.js';
|
|
5
5
|
|
|
6
6
|
interface XeniaProviderProps extends XeniaClientOptions {
|
|
7
7
|
children: ReactNode;
|
|
@@ -235,6 +235,11 @@ interface XeniaDebugPanelProps {
|
|
|
235
235
|
prefix?: string;
|
|
236
236
|
/** Corner for the launcher. Default `bottom-right` (Next.js's own dev tools sit bottom-left). */
|
|
237
237
|
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
238
|
+
/**
|
|
239
|
+
* Open the card on page load instead of only the launcher. Default `false`. Once the visitor opens
|
|
240
|
+
* or closes it, their choice wins for the rest of the session.
|
|
241
|
+
*/
|
|
242
|
+
defaultOpen?: boolean;
|
|
238
243
|
/**
|
|
239
244
|
* Content of your own for the Site tab, beyond `custom` (which the panel shows by itself), from
|
|
240
245
|
* the fields your proxy's `debugInfo` added.
|
|
@@ -250,6 +255,7 @@ declare function debugStatus(entry: DebugEntry): DebugStatus;
|
|
|
250
255
|
* site's own rows (`debugInfo`'s `custom`). Reads the debug cookie `xeniaEdgeProxy({ debug: true })`
|
|
251
256
|
* writes; renders nothing without an entry for this page.
|
|
252
257
|
*/
|
|
253
|
-
declare function XeniaDebugPanel({ prefix, position, renderExtra }: XeniaDebugPanelProps): react.JSX.Element | null;
|
|
258
|
+
declare function XeniaDebugPanel({ prefix, position, defaultOpen, renderExtra }: XeniaDebugPanelProps): react.JSX.Element | null;
|
|
254
259
|
|
|
255
|
-
export { AnalyticsEventName, AppliedSwap,
|
|
260
|
+
export { AnalyticsEventName, AppliedSwap, InteractionType, JsonValue, MessageComponentRenderer, MessageMountContext, PagePersonalizeOptions, PageRef, ResolveBatchItem, ResolveBatchResult, ResolveResult, TrackOptions, WebhookResponse, XeniaAction, XeniaClient, XeniaClientOptions, XeniaContentProvider, XeniaContext, XeniaDebugPanel, XeniaMessage, XeniaProvider, XeniaTrack, debugStatus, reactMessageComponent, usePersonalization, usePersonalizationResolve, usePersonalizationResolveSlots, usePersonalizationSlots, usePersonalizedContent, usePersonalizedPage, useTrack, useWebhook, useXenia, useXeniaEntry, useXeniaResponse };
|
|
261
|
+
export type { DebugStatus, EntryStatus, UsePersonalizationResolveResult, UsePersonalizationResolveSlotsResult, UsePersonalizationResult, UsePersonalizationSlotsResult, UsePersonalizedContentOptions, UsePersonalizedContentResult, UseWebhookResult, XeniaDebugPanelProps, XeniaMessageComponentProps, XeniaMessageProps, XeniaProviderProps, XeniaTrackProps };
|
|
@@ -3300,6 +3300,7 @@ function view(e) {
|
|
|
3300
3300
|
};
|
|
3301
3301
|
}
|
|
3302
3302
|
var changed = (result) => !/^(base|control|suppressed)\b/.test(result);
|
|
3303
|
+
var heldOut = (d) => d.reason === "holdout" || d.result === "control";
|
|
3303
3304
|
function debugStatus(entry) {
|
|
3304
3305
|
const v = view(entry);
|
|
3305
3306
|
if (v.source === "timeout" || v.source === "error") return "attention";
|
|
@@ -3343,7 +3344,7 @@ function Id({ value }) {
|
|
|
3343
3344
|
] }) : /* @__PURE__ */ jsx(Fragment, { children: value });
|
|
3344
3345
|
}
|
|
3345
3346
|
var percent = (n) => `${Math.round(n <= 1 ? n * 100 : n)}%`;
|
|
3346
|
-
function XeniaDebugPanel({ prefix = DEFAULT_PREFIX, position = "bottom-right", renderExtra }) {
|
|
3347
|
+
function XeniaDebugPanel({ prefix = DEFAULT_PREFIX, position = "bottom-right", defaultOpen = false, renderExtra }) {
|
|
3347
3348
|
const [entry, setEntry] = useState(null);
|
|
3348
3349
|
const [open, setOpen] = useState(false);
|
|
3349
3350
|
const [tab, setTab] = useState("Decision");
|
|
@@ -3351,6 +3352,7 @@ function XeniaDebugPanel({ prefix = DEFAULT_PREFIX, position = "bottom-right", r
|
|
|
3351
3352
|
const launcher = useRef(null);
|
|
3352
3353
|
const card = useRef(null);
|
|
3353
3354
|
const tabRefs = useRef({});
|
|
3355
|
+
const focusOnOpen = useRef(false);
|
|
3354
3356
|
const id = useId();
|
|
3355
3357
|
useEffect(() => {
|
|
3356
3358
|
let timer;
|
|
@@ -3362,25 +3364,28 @@ function XeniaDebugPanel({ prefix = DEFAULT_PREFIX, position = "bottom-right", r
|
|
|
3362
3364
|
};
|
|
3363
3365
|
read();
|
|
3364
3366
|
try {
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3367
|
+
const saved = sessionStorage.getItem(OPEN_KEY);
|
|
3368
|
+
setOpen(saved === null ? defaultOpen : saved === "1");
|
|
3369
|
+
const savedTab = sessionStorage.getItem(TAB_KEY);
|
|
3370
|
+
if (savedTab === "Decision" || savedTab === "Visitor" || savedTab === "Request" || savedTab === "Site") setTab(savedTab);
|
|
3368
3371
|
} catch {
|
|
3372
|
+
setOpen(defaultOpen);
|
|
3369
3373
|
}
|
|
3370
3374
|
const unwatch = watchNavigation(onNavigate);
|
|
3371
3375
|
return () => {
|
|
3372
3376
|
clearTimeout(timer);
|
|
3373
3377
|
unwatch();
|
|
3374
3378
|
};
|
|
3375
|
-
}, [prefix]);
|
|
3379
|
+
}, [prefix, defaultOpen]);
|
|
3376
3380
|
const toggle = useCallback((next, focusLauncher = false) => {
|
|
3377
3381
|
setOpen(next);
|
|
3382
|
+
focusOnOpen.current = next;
|
|
3378
3383
|
if (focusLauncher) launcher.current?.focus();
|
|
3379
3384
|
remember(OPEN_KEY, next ? "1" : "0");
|
|
3380
3385
|
}, []);
|
|
3381
3386
|
useEffect(() => {
|
|
3382
3387
|
if (!open) return;
|
|
3383
|
-
card.current?.focus();
|
|
3388
|
+
if (focusOnOpen.current) card.current?.focus();
|
|
3384
3389
|
const onKey = (e) => {
|
|
3385
3390
|
if (e.key === "Escape" && root.current?.contains(document.activeElement)) toggle(false, true);
|
|
3386
3391
|
};
|
|
@@ -3434,6 +3439,7 @@ function XeniaDebugPanel({ prefix = DEFAULT_PREFIX, position = "bottom-right", r
|
|
|
3434
3439
|
/* @__PURE__ */ jsxs("div", { className: "xdp-head-row", children: [
|
|
3435
3440
|
/* @__PURE__ */ jsx("span", { className: "xdp-pill", "data-status": status, children: status === "personalized" ? "Personalized" : "Base content" }),
|
|
3436
3441
|
/* @__PURE__ */ jsx("span", { className: "xdp-chip", title: v.source, children: sourceChip(v.source) }),
|
|
3442
|
+
v.decisions.some(heldOut) ? /* @__PURE__ */ jsx("span", { className: "xdp-chip", "data-tone": "holdout", title: "This visitor is in the holdout: they see base content on purpose, to measure the lift", children: "Holdout" }) : null,
|
|
3437
3443
|
typeof v.ms === "number" && v.source === "xenia" ? /* @__PURE__ */ jsxs("span", { className: "xdp-ms", children: [
|
|
3438
3444
|
v.ms,
|
|
3439
3445
|
" ms"
|
|
@@ -3497,7 +3503,7 @@ function DecisionTab({ v }) {
|
|
|
3497
3503
|
/* @__PURE__ */ jsx("code", { className: "xdp-key", children: d.key }),
|
|
3498
3504
|
/* @__PURE__ */ jsx("span", { className: "xdp-result", "data-result": changed(d.result) ? "changed" : "base", children: d.result })
|
|
3499
3505
|
] }),
|
|
3500
|
-
d.reason ? /* @__PURE__ */ jsx("p", { className: "xdp-reason", children: d.reason }) : null,
|
|
3506
|
+
d.reason && d.reason !== "holdout" ? /* @__PURE__ */ jsx("p", { className: "xdp-reason", children: d.reason }) : null,
|
|
3501
3507
|
d.trace.length ? /* @__PURE__ */ jsx("ol", { className: "xdp-steps", "aria-label": "Journey path", children: d.trace.map(([step, outcome]) => /* @__PURE__ */ jsxs("li", { children: [
|
|
3502
3508
|
/* @__PURE__ */ jsx("code", { children: step }),
|
|
3503
3509
|
/* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Id, { value: outcome }) })
|
|
@@ -3604,6 +3610,7 @@ var STYLES2 = `
|
|
|
3604
3610
|
.xdp-pill[data-status=attention]{background:var(--xdp-warn-tint);color:var(--xdp-warn)}
|
|
3605
3611
|
.xdp-chip{display:inline-flex;align-items:center;padding:2px 8px;border-radius:6px;background:var(--xdp-soft);color:var(--xdp-muted);font-size:12px;white-space:nowrap}
|
|
3606
3612
|
code.xdp-chip{font-size:11.5px}
|
|
3613
|
+
.xdp-chip[data-tone=holdout]{background:var(--xdp-warn-tint);color:var(--xdp-warn);font-weight:600}
|
|
3607
3614
|
.xdp-ms{margin-left:auto;color:var(--xdp-faint)}
|
|
3608
3615
|
.xdp-path{display:block;margin-top:8px;font-size:13px;color:var(--xdp-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
3609
3616
|
.xdp-alert{margin:8px 0 0;padding:8px 10px;border-radius:8px;background:var(--xdp-warn-tint);color:var(--xdp-warn)}
|