@delmaredigital/payload-experiments 0.2.0-rc.3 → 0.2.0-rc.5
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 +22 -0
- package/dist/admin/PreviewLinks.js +8 -4
- package/dist/admin/TestsDashboardCards.d.ts +3 -0
- package/dist/admin/TestsDashboardCards.js +52 -0
- package/dist/admin/TestsNavLink.d.ts +3 -1
- package/dist/admin/TestsNavLink.js +62 -18
- package/dist/admin/actions/ConfirmDialog.d.ts +1 -0
- package/dist/admin/actions/ConfirmDialog.js +7 -5
- package/dist/admin/components/ChipsInput.d.ts +12 -0
- package/dist/admin/components/ChipsInput.js +96 -0
- package/dist/admin/components/RootViewMessage.d.ts +5 -0
- package/dist/admin/components/RootViewMessage.js +15 -0
- package/dist/admin/components/chipsInput.css +11 -0
- package/dist/admin/copy/audience.d.ts +4 -0
- package/dist/admin/copy/audience.js +4 -0
- package/dist/admin/copy/goals.d.ts +44 -0
- package/dist/admin/copy/goals.js +46 -0
- package/dist/admin/copy/review.d.ts +1 -0
- package/dist/admin/copy/review.js +1 -0
- package/dist/admin/copy/surface.d.ts +4 -0
- package/dist/admin/copy/surface.js +4 -0
- package/dist/admin/dashboard.css +35 -0
- package/dist/admin/paths.d.ts +1 -0
- package/dist/admin/paths.js +1 -0
- package/dist/admin/previewLinks.model.d.ts +9 -0
- package/dist/admin/previewLinks.model.js +34 -0
- package/dist/admin/results/ArmTable.js +2 -1
- package/dist/admin/results/CappedCell.js +2 -1
- package/dist/admin/results/CiChart.js +8 -7
- package/dist/admin/results/DataQualityPanel.js +3 -2
- package/dist/admin/results/VerdictCard.js +3 -2
- package/dist/admin/styles.css +8 -8
- package/dist/admin/styles.d.ts +1 -0
- package/dist/admin/styles.js +1 -0
- package/dist/admin/surface/SurfaceShell.d.ts +1 -0
- package/dist/admin/surface/SurfaceShell.js +1 -0
- package/dist/admin/surface/TestsHome.js +1 -1
- package/dist/admin/surface/TestsSurface.js +10 -1
- package/dist/admin/surface/goals/GoalForm.d.ts +7 -0
- package/dist/admin/surface/goals/GoalForm.js +470 -0
- package/dist/admin/surface/goals/GoalsBreadcrumb.d.ts +5 -0
- package/dist/admin/surface/goals/GoalsBreadcrumb.js +47 -0
- package/dist/admin/surface/goals/GoalsList.d.ts +6 -0
- package/dist/admin/surface/goals/GoalsList.js +135 -0
- package/dist/admin/surface/goals/data.d.ts +3 -0
- package/dist/admin/surface/goals/data.js +24 -0
- package/dist/admin/surface/goals/goals.css +15 -0
- package/dist/admin/surface/goals/goals.model.d.ts +30 -0
- package/dist/admin/surface/goals/goals.model.js +26 -0
- package/dist/admin/surface/newTest/newTest.css +6 -6
- package/dist/admin/surface/readiness/Banner.js +5 -4
- package/dist/admin/surface/results/ResultsBody.js +3 -2
- package/dist/admin/surface/setting/setting.css +11 -11
- package/dist/admin/surface/surface.css +29 -29
- package/dist/admin/surface/test/GoalSection.js +32 -1
- package/dist/admin/surface/test/TargetingSection.js +27 -10
- package/dist/admin/surface/test/VersionsSection.js +6 -5
- package/dist/admin/surface/test/testPage.css +12 -12
- package/dist/admin/targeting/targeting.model.d.ts +6 -1
- package/dist/admin/targeting/targeting.model.js +18 -2
- package/dist/admin/theme.css +44 -0
- package/dist/admin/theme.d.ts +50 -0
- package/dist/admin/theme.js +49 -0
- package/dist/admin/views/ExperimentsRootView.js +18 -18
- package/dist/collections/events.js +1 -0
- package/dist/collections/identities.js +1 -0
- package/dist/collections/layers.js +1 -0
- package/dist/collections/metricValidation.d.ts +3 -0
- package/dist/collections/metricValidation.js +9 -0
- package/dist/collections/metrics.js +4 -5
- package/dist/collections/phases.js +1 -0
- package/dist/collections/snapshots.js +1 -0
- package/dist/exports/adminClient.d.ts +1 -0
- package/dist/exports/adminClient.js +1 -0
- package/dist/globals/state.js +1 -0
- package/dist/plugin.js +8 -2
- package/dist/puck/editor/CreateExperimentDrawer.d.ts +1 -0
- package/dist/puck/editor/CreateExperimentDrawer.js +34 -25
- package/dist/puck/editor/ExperimentSlotEditor.d.ts +1 -0
- package/dist/puck/editor/ExperimentSlotEditor.js +137 -78
- package/dist/puck/editor/copy.d.ts +3 -1
- package/dist/puck/editor/copy.js +3 -1
- package/dist/puck/editor/editor.css +302 -0
- package/dist/types/surface.d.ts +2 -1
- package/package.json +2 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Preview URLs identify pages; counts use the most placements in any one version. */ export function previewPages(placements) {
|
|
2
|
+
const pages = new Map();
|
|
3
|
+
for (const placement of placements){
|
|
4
|
+
const key = `${placement.collection}\u0000${String(placement.id)}`;
|
|
5
|
+
const existing = pages.get(key);
|
|
6
|
+
if (existing) {
|
|
7
|
+
const { page, versions } = existing;
|
|
8
|
+
const count = (versions.get(placement.detail) ?? 0) + 1;
|
|
9
|
+
versions.set(placement.detail, count);
|
|
10
|
+
page.slotCount = Math.max(page.slotCount, count);
|
|
11
|
+
if (!page.url && placement.url) page.url = placement.url;
|
|
12
|
+
} else {
|
|
13
|
+
pages.set(key, {
|
|
14
|
+
page: {
|
|
15
|
+
key,
|
|
16
|
+
collection: placement.collection,
|
|
17
|
+
id: placement.id,
|
|
18
|
+
title: placement.title,
|
|
19
|
+
url: placement.url,
|
|
20
|
+
slotCount: 1
|
|
21
|
+
},
|
|
22
|
+
versions: new Map([
|
|
23
|
+
[
|
|
24
|
+
placement.detail,
|
|
25
|
+
1
|
|
26
|
+
]
|
|
27
|
+
])
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return [
|
|
32
|
+
...pages.values()
|
|
33
|
+
].map(({ page })=>page);
|
|
34
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { theme } from '../theme.js';
|
|
3
4
|
import { RESULTS_COPY } from '../copy/results.js';
|
|
4
5
|
import { CappedCell } from './CappedCell.js';
|
|
5
6
|
export function ArmTable({ rows, caption, method, metricKind }) {
|
|
@@ -10,7 +11,7 @@ export function ArmTable({ rows, caption, method, metricKind }) {
|
|
|
10
11
|
return /*#__PURE__*/ _jsx("div", {
|
|
11
12
|
className: "xp-arm-table",
|
|
12
13
|
style: {
|
|
13
|
-
color:
|
|
14
|
+
color: theme.color.text,
|
|
14
15
|
overflowX: 'auto'
|
|
15
16
|
},
|
|
16
17
|
children: /*#__PURE__*/ _jsxs("table", {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { theme } from '../theme.js';
|
|
3
4
|
export function CappedCell({ model }) {
|
|
4
5
|
return /*#__PURE__*/ _jsxs("div", {
|
|
5
6
|
className: "xp-capped-cell",
|
|
6
7
|
style: {
|
|
7
|
-
color:
|
|
8
|
+
color: theme.color.text
|
|
8
9
|
},
|
|
9
10
|
children: [
|
|
10
11
|
/*#__PURE__*/ _jsx("span", {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { theme } from '../theme.js';
|
|
3
4
|
import { RESULTS_COPY as C, chartSummary, contentChangeTitle } from '../copy/results.js';
|
|
4
5
|
import { chartModel } from './chart.model.js';
|
|
5
6
|
import { formatPercent } from './format.js';
|
|
6
7
|
const colors = [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
theme.color.textStrong,
|
|
9
|
+
theme.color.textMuted,
|
|
10
|
+
theme.color.borderAccent
|
|
10
11
|
];
|
|
11
12
|
const date = (t)=>new Intl.DateTimeFormat('en-US', {
|
|
12
13
|
dateStyle: 'medium',
|
|
@@ -28,7 +29,7 @@ export function CiChart({ series, metricId, metricName, phase, contentChanges })
|
|
|
28
29
|
return /*#__PURE__*/ _jsxs("section", {
|
|
29
30
|
className: "xp-ci-chart",
|
|
30
31
|
style: {
|
|
31
|
-
color:
|
|
32
|
+
color: theme.color.text
|
|
32
33
|
},
|
|
33
34
|
children: [
|
|
34
35
|
/*#__PURE__*/ _jsx("h2", {
|
|
@@ -50,7 +51,7 @@ export function CiChart({ series, metricId, metricName, phase, contentChanges })
|
|
|
50
51
|
x2: 680,
|
|
51
52
|
y1: y(0),
|
|
52
53
|
y2: y(0),
|
|
53
|
-
stroke:
|
|
54
|
+
stroke: theme.color.accent,
|
|
54
55
|
strokeDasharray: "4 4"
|
|
55
56
|
}),
|
|
56
57
|
[
|
|
@@ -146,7 +147,7 @@ export function CiChart({ series, metricId, metricName, phase, contentChanges })
|
|
|
146
147
|
x2: x(marker.t),
|
|
147
148
|
y1: 20,
|
|
148
149
|
y2: 230,
|
|
149
|
-
stroke:
|
|
150
|
+
stroke: theme.color.text,
|
|
150
151
|
strokeDasharray: "2 4"
|
|
151
152
|
})
|
|
152
153
|
]
|
|
@@ -156,7 +157,7 @@ export function CiChart({ series, metricId, metricName, phase, contentChanges })
|
|
|
156
157
|
/*#__PURE__*/ _jsx("ul", {
|
|
157
158
|
children: model.variants.map((variant, index)=>/*#__PURE__*/ _jsxs("li", {
|
|
158
159
|
style: {
|
|
159
|
-
color:
|
|
160
|
+
color: theme.color.text
|
|
160
161
|
},
|
|
161
162
|
children: [
|
|
162
163
|
/*#__PURE__*/ _jsx("span", {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { theme } from '../theme.js';
|
|
3
4
|
import { RESULTS_COPY } from '../copy/results.js';
|
|
4
5
|
export function DataQualityPanel({ items }) {
|
|
5
6
|
if (items.length === 0) return null;
|
|
@@ -7,8 +8,8 @@ export function DataQualityPanel({ items }) {
|
|
|
7
8
|
className: "xp-data-quality",
|
|
8
9
|
"aria-label": RESULTS_COPY.quality,
|
|
9
10
|
style: {
|
|
10
|
-
color:
|
|
11
|
-
background:
|
|
11
|
+
color: theme.color.text,
|
|
12
|
+
background: theme.color.surface,
|
|
12
13
|
padding: '1rem'
|
|
13
14
|
},
|
|
14
15
|
children: [
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { theme } from '../theme.js';
|
|
3
4
|
export function VerdictCard({ model, guardrails = [], power, collecting, sinceShipping }) {
|
|
4
5
|
return /*#__PURE__*/ _jsxs("section", {
|
|
5
6
|
className: "xp-verdict-card",
|
|
6
7
|
style: {
|
|
7
|
-
color:
|
|
8
|
-
background:
|
|
8
|
+
color: theme.color.text,
|
|
9
|
+
background: theme.color.surface,
|
|
9
10
|
padding: '1rem'
|
|
10
11
|
},
|
|
11
12
|
children: [
|
package/dist/admin/styles.css
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* Admin styles for the experiments plugin; loaded by src/admin/styles.ts. */
|
|
2
2
|
.xp-status-pill { font-weight: 600; }
|
|
3
|
-
.xp-status-pill--neutral { background: var(--
|
|
4
|
-
.xp-status-pill--success { background: var(--
|
|
5
|
-
.xp-status-pill--warning { background: var(--
|
|
6
|
-
.xp-status-pill--info { background: var(--
|
|
7
|
-
.xp-status-pill--muted { background: var(--
|
|
8
|
-
.xp-locked-notice, .xp-notice { padding: 0.75rem; border-inline-start: 3px solid var(--
|
|
9
|
-
.xp-notice--warning { border-color: var(--
|
|
10
|
-
.xp-notice--error { border-color: var(--
|
|
3
|
+
.xp-status-pill--neutral { background: var(--xp-border); color: var(--xp-text-strong); }
|
|
4
|
+
.xp-status-pill--success { background: var(--xp-success-bg); color: var(--xp-success-text-strong); }
|
|
5
|
+
.xp-status-pill--warning { background: var(--xp-warning-bg); color: var(--xp-warning-text-strong); }
|
|
6
|
+
.xp-status-pill--info { background: var(--xp-border-strong); color: var(--xp-text-emphasis); }
|
|
7
|
+
.xp-status-pill--muted { background: var(--xp-surface-raised); color: var(--xp-text-muted); }
|
|
8
|
+
.xp-locked-notice, .xp-notice { padding: 0.75rem; border-inline-start: 3px solid var(--xp-border-accent); background: var(--xp-surface); color: var(--xp-text-strong); }
|
|
9
|
+
.xp-notice--warning { border-color: var(--xp-warning); background: var(--xp-warning-surface); }
|
|
10
|
+
.xp-notice--error { border-color: var(--xp-error); background: var(--xp-error-surface); }
|
package/dist/admin/styles.d.ts
CHANGED
package/dist/admin/styles.js
CHANGED
|
@@ -4,6 +4,8 @@ import { NewTest } from './newTest/NewTest.js';
|
|
|
4
4
|
import { TestPage } from './test/TestPage.js';
|
|
5
5
|
import { ResultsRoute } from './ResultsRoute.js';
|
|
6
6
|
import { SurfaceShell } from './SurfaceShell.js';
|
|
7
|
+
import { GoalForm } from './goals/GoalForm.js';
|
|
8
|
+
import { GoalsList } from './goals/GoalsList.js';
|
|
7
9
|
import { TestsHome } from './TestsHome.js';
|
|
8
10
|
export function TestsSurface(props) {
|
|
9
11
|
const surface = {
|
|
@@ -22,7 +24,14 @@ export function TestsSurface(props) {
|
|
|
22
24
|
children: props.route === 'home' ? /*#__PURE__*/ _jsx(TestsHome, {
|
|
23
25
|
adminRoute: props.adminRoute,
|
|
24
26
|
apiRoute: props.apiRoute
|
|
25
|
-
}) : props.route === '
|
|
27
|
+
}) : props.route === 'goals' ? /*#__PURE__*/ _jsx(GoalsList, {
|
|
28
|
+
surface: surface,
|
|
29
|
+
returnToTest: props.returnToTest
|
|
30
|
+
}) : props.route === 'goalNew' || props.route === 'goal' ? /*#__PURE__*/ _jsx(GoalForm, {
|
|
31
|
+
surface: surface,
|
|
32
|
+
id: props.route === 'goal' ? props.id : undefined,
|
|
33
|
+
returnToTest: props.returnToTest
|
|
34
|
+
}, props.route === 'goalNew' ? 'new' : props.id) : props.route === 'new' ? /*#__PURE__*/ _jsx(NewTest, {
|
|
26
35
|
surface: surface,
|
|
27
36
|
pages: props.pages
|
|
28
37
|
}) : props.id === undefined ? null : props.route === 'test' ? /*#__PURE__*/ _jsx(TestPage, {
|