@delmaredigital/payload-experiments 0.4.0-rc.9 → 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.
- package/README.md +2 -8
- package/dist/admin/MetricSourceSelect.js +10 -3
- package/dist/admin/armSelect/armSelect.model.d.ts +1 -1
- package/dist/admin/blocks/BlockPanel.d.ts +1 -0
- package/dist/admin/blocks/BlockPanel.js +75 -29
- package/dist/admin/blocks/model.js +5 -4
- package/dist/admin/copy/blocks.d.ts +14 -11
- package/dist/admin/copy/blocks.js +33 -22
- package/dist/admin/copy/goals.d.ts +15 -8
- package/dist/admin/copy/goals.js +18 -8
- package/dist/admin/copy/newTest.d.ts +10 -7
- package/dist/admin/copy/newTest.js +14 -7
- package/dist/admin/copy/status.d.ts +1 -1
- package/dist/admin/copy/status.js +2 -1
- package/dist/admin/pageCollections.d.ts +1 -0
- package/dist/admin/pageCollections.js +3 -0
- package/dist/admin/placementStatus.model.js +5 -3
- package/dist/admin/status.model.d.ts +1 -0
- package/dist/admin/status.model.js +2 -1
- package/dist/admin/surface/ResultsRoute.js +4 -8
- package/dist/admin/surface/SurfaceShell.d.ts +4 -2
- package/dist/admin/surface/SurfaceShell.js +28 -3
- package/dist/admin/surface/TestRowMenu.d.ts +13 -0
- package/dist/admin/surface/TestRowMenu.js +163 -0
- package/dist/admin/surface/TestsHome.d.ts +4 -3
- package/dist/admin/surface/TestsHome.js +186 -47
- package/dist/admin/surface/TestsSurface.js +2 -1
- package/dist/admin/surface/goals/DeleteGoalDialog.d.ts +7 -0
- package/dist/admin/surface/goals/DeleteGoalDialog.js +42 -0
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -0
- package/dist/admin/surface/goals/GoalForm.js +280 -198
- package/dist/admin/surface/goals/GoalsList.js +102 -33
- package/dist/admin/surface/goals/data.d.ts +2 -0
- package/dist/admin/surface/goals/data.js +9 -0
- package/dist/admin/surface/goals/goals.css +3 -2
- package/dist/admin/surface/goals/goals.model.d.ts +2 -2
- package/dist/admin/surface/goals/goals.model.js +7 -12
- package/dist/admin/surface/home.model.d.ts +15 -8
- package/dist/admin/surface/home.model.js +22 -18
- package/dist/admin/surface/newTest/NewTest.d.ts +3 -3
- package/dist/admin/surface/newTest/NewTest.js +156 -96
- package/dist/admin/surface/newTest/PageWizard.d.ts +4 -1
- package/dist/admin/surface/newTest/PageWizard.js +93 -68
- package/dist/admin/surface/newTest/newTest.css +28 -11
- package/dist/admin/surface/results/ResultsHeader.d.ts +1 -1
- package/dist/admin/surface/results/ResultsHeader.js +90 -63
- package/dist/admin/surface/surface.css +29 -0
- package/dist/admin/surface/test/TestPage.js +46 -38
- package/dist/admin/surface/useXpStepNav.d.ts +11 -0
- package/dist/admin/surface/useXpStepNav.js +14 -0
- package/dist/admin/views/TestsSurfaceClient.js +27 -3
- package/dist/admin/views/buildSurfaceProps.js +18 -66
- package/dist/arms/copy.d.ts +13 -3
- package/dist/arms/copy.js +5 -4
- package/dist/blocks/createExperimentBlock.js +1 -1
- package/dist/blocks/formState.js +1 -1
- package/dist/collections/experiments/armInvariants.js +8 -5
- package/dist/collections/metrics.js +12 -5
- package/dist/collections/serialize.js +3 -2
- package/dist/db/pageCopies.d.ts +5 -0
- package/dist/db/pageCopies.js +31 -0
- package/dist/db/snapshots.d.ts +1 -0
- package/dist/endpoints/duplicateOriginal.d.ts +38 -0
- package/dist/endpoints/duplicateOriginal.js +414 -0
- package/dist/endpoints/editorSurface.js +1 -1
- package/dist/endpoints/index.js +20 -0
- package/dist/endpoints/pages.js +245 -66
- package/dist/endpoints/placementStatus.js +1 -0
- package/dist/endpoints/results.js +3 -0
- package/dist/endpoints/testVersion.d.ts +2 -0
- package/dist/endpoints/testVersion.js +38 -0
- package/dist/endpoints/transitions.js +4 -5
- package/dist/exports/index.d.ts +1 -1
- package/dist/goals/picker/copy.js +1 -1
- package/dist/goals/sourceLabel.d.ts +2 -0
- package/dist/goals/sourceLabel.js +4 -0
- package/dist/hooks/trackPageCopies.d.ts +11 -0
- package/dist/hooks/trackPageCopies.js +7 -0
- package/dist/labels/arms.d.ts +3 -0
- package/dist/labels/arms.js +8 -0
- package/dist/options.d.ts +2 -0
- package/dist/options.js +18 -2
- package/dist/plugin.js +56 -2
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +7 -7
- package/dist/puck/editor/ConfigureTestDrawer.js +36 -26
- package/dist/puck/editor/ExperimentSlotEditor.d.ts +2 -1
- package/dist/puck/editor/ExperimentSlotEditor.js +219 -106
- package/dist/puck/editor/LeftoverVersions.js +17 -32
- package/dist/puck/editor/QuickTestActions.d.ts +2 -2
- package/dist/puck/editor/QuickTestActions.js +44 -34
- package/dist/puck/editor/ResultsReadout.d.ts +3 -1
- package/dist/puck/editor/ResultsReadout.js +28 -16
- package/dist/puck/editor/VersionBuilder.d.ts +4 -2
- package/dist/puck/editor/VersionBuilder.js +42 -63
- package/dist/puck/editor/armWrites.js +1 -1
- package/dist/puck/editor/copy.d.ts +10 -6
- package/dist/puck/editor/copy.js +22 -12
- package/dist/puck/editor/editor.chrome.css +9 -8
- package/dist/puck/editor/editor.css +14 -9
- package/dist/puck/editor/placementsCache.d.ts +1 -1
- package/dist/puck/editor/placementsCache.js +9 -17
- package/dist/puck/editor/usePageSaveReadiness.d.ts +1 -4
- package/dist/puck/editor/usePageSaveReadiness.js +18 -21
- package/dist/puck/editor/usePlacementNotice.d.ts +2 -2
- package/dist/puck/editor/usePlacementNotice.js +4 -5
- package/dist/puck/nestedTestCopy.js +2 -2
- package/dist/puck/slotConfig.d.ts +1 -1
- package/dist/puck/slotConfig.js +1 -1
- package/dist/results/analyse.d.ts +2 -0
- package/dist/results/analyse.js +2 -2
- package/dist/results/verdict.d.ts +4 -4
- package/dist/results/verdict.js +13 -10
- package/dist/server/runResults.js +2 -1
- package/dist/testSurface/PreviewLinks.d.ts +2 -1
- package/dist/testSurface/PreviewLinks.js +3 -3
- package/dist/testSurface/actions/DecideDialog.d.ts +7 -4
- package/dist/testSurface/actions/DecideDialog.js +71 -59
- package/dist/testSurface/actions/LifecycleAction.d.ts +17 -0
- package/dist/testSurface/actions/LifecycleAction.js +107 -0
- package/dist/testSurface/actions/MakeContentResult.js +1 -1
- package/dist/testSurface/actions/actions.model.d.ts +13 -5
- package/dist/testSurface/actions/actions.model.js +75 -22
- package/dist/testSurface/actions/decide.model.d.ts +1 -0
- package/dist/testSurface/actions/decide.model.js +1 -0
- package/dist/testSurface/allocation.model.js +6 -3
- package/dist/testSurface/api.d.ts +4 -1
- package/dist/testSurface/api.js +22 -14
- package/dist/testSurface/copy/actions.d.ts +36 -14
- package/dist/testSurface/copy/actions.js +39 -17
- package/dist/testSurface/copy/advanced.d.ts +10 -0
- package/dist/testSurface/copy/advanced.js +10 -0
- package/dist/testSurface/copy/arms.d.ts +1 -1
- package/dist/testSurface/copy/arms.js +1 -1
- package/dist/testSurface/copy/audience.d.ts +4 -3
- package/dist/testSurface/copy/audience.js +5 -4
- package/dist/testSurface/copy/common.d.ts +6 -6
- package/dist/testSurface/copy/common.js +6 -6
- package/dist/testSurface/copy/metrics.d.ts +6 -0
- package/dist/testSurface/copy/metrics.js +8 -0
- package/dist/testSurface/copy/pages.d.ts +67 -7
- package/dist/testSurface/copy/pages.js +74 -7
- package/dist/testSurface/copy/readiness.d.ts +8 -6
- package/dist/testSurface/copy/readiness.js +19 -10
- package/dist/testSurface/copy/recommendation.d.ts +1 -22
- package/dist/testSurface/copy/recommendation.js +2 -22
- package/dist/testSurface/copy/results.d.ts +16 -10
- package/dist/testSurface/copy/results.js +19 -11
- package/dist/testSurface/copy/review.d.ts +13 -10
- package/dist/testSurface/copy/review.js +14 -10
- package/dist/testSurface/copy/setting.d.ts +1 -2
- package/dist/testSurface/copy/setting.js +1 -2
- package/dist/testSurface/copy/surface.d.ts +11 -2
- package/dist/testSurface/copy/surface.js +14 -11
- package/dist/testSurface/copy/testPage.d.ts +16 -10
- package/dist/testSurface/copy/testPage.js +24 -18
- package/dist/testSurface/format/date.d.ts +5 -2
- package/dist/testSurface/format/date.js +24 -8
- package/dist/testSurface/format/roundProgress.d.ts +6 -0
- package/dist/testSurface/format/roundProgress.js +15 -0
- package/dist/testSurface/format/useDateFormatter.d.ts +3 -0
- package/dist/testSurface/format/useDateFormatter.js +8 -0
- package/dist/testSurface/labels.d.ts +1 -2
- package/dist/testSurface/labels.js +2 -3
- package/dist/testSurface/lockedNotice.model.d.ts +2 -0
- package/dist/testSurface/lockedNotice.model.js +31 -0
- package/dist/testSurface/readPreflight.d.ts +0 -1
- package/dist/testSurface/readPreflight.js +0 -1
- package/dist/testSurface/results/CiChart.js +2 -1
- package/dist/testSurface/results/DataTable.d.ts +1 -1
- package/dist/testSurface/results/DataTable.js +4 -3
- package/dist/testSurface/results/VerdictHero.d.ts +1 -1
- package/dist/testSurface/results/legacy.d.ts +0 -5
- package/dist/testSurface/results/legacy.js +0 -14
- package/dist/testSurface/results/results.css +2 -2
- package/dist/testSurface/results/results.model.d.ts +8 -3
- package/dist/testSurface/results/results.model.js +25 -21
- package/dist/testSurface/results/snapshot.d.ts +2 -0
- package/dist/testSurface/results/snapshot.js +3 -0
- package/dist/testSurface/surface/contracts.d.ts +6 -1
- package/dist/testSurface/surface/editorPlacement.d.ts +1 -1
- package/dist/testSurface/surface/editorPlacement.js +1 -1
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +1 -1
- package/dist/testSurface/surface/pageBlock/parts.js +25 -12
- package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +8 -1
- package/dist/testSurface/surface/pagePicker/CopyRoute.js +243 -22
- package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +15 -4
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +298 -209
- package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -10
- package/dist/testSurface/surface/pagePicker/pagePicker.model.d.ts +5 -3
- package/dist/testSurface/surface/pagePicker/pagePicker.model.js +17 -2
- package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +5 -3
- package/dist/testSurface/surface/readiness/ActionDialogs.js +213 -207
- package/dist/testSurface/surface/readiness/Banner.d.ts +5 -1
- package/dist/testSurface/surface/readiness/Banner.js +109 -148
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +5 -2
- package/dist/testSurface/surface/readiness/SaveStatus.js +8 -7
- package/dist/testSurface/surface/readiness/readiness.model.d.ts +14 -5
- package/dist/testSurface/surface/readiness/readiness.model.js +62 -12
- package/dist/testSurface/surface/readiness/useTransition.d.ts +3 -1
- package/dist/testSurface/surface/readiness/useTransition.js +49 -8
- package/dist/testSurface/surface/results/ReleasePages.d.ts +4 -3
- package/dist/testSurface/surface/results/ReleasePages.js +41 -41
- package/dist/testSurface/surface/results/ResultsBody.d.ts +7 -2
- package/dist/testSurface/surface/results/ResultsBody.js +170 -110
- package/dist/testSurface/surface/results/recommendation.model.d.ts +6 -9
- package/dist/testSurface/surface/results/recommendation.model.js +15 -59
- package/dist/testSurface/surface/results/useResults.d.ts +6 -2
- package/dist/testSurface/surface/setting/parts.js +31 -28
- package/dist/testSurface/surface/setting/setting.css +2 -1
- package/dist/testSurface/surface/test/AdvancedSection.js +10 -4
- package/dist/testSurface/surface/test/DeleteTest.d.ts +5 -1
- package/dist/testSurface/surface/test/DeleteTest.js +63 -55
- package/dist/testSurface/surface/test/GoalSection.js +11 -11
- package/dist/testSurface/surface/test/LengthSection.js +21 -13
- package/dist/testSurface/surface/test/PageHoldout.d.ts +1 -1
- package/dist/testSurface/surface/test/PageHoldout.js +7 -7
- package/dist/testSurface/surface/test/ReadinessBar.d.ts +2 -1
- package/dist/testSurface/surface/test/ReadinessBar.js +4 -10
- package/dist/testSurface/surface/test/Section.js +8 -0
- package/dist/testSurface/surface/test/TargetingSection.js +7 -2
- package/dist/testSurface/surface/test/TestSurface.js +17 -43
- package/dist/testSurface/surface/test/VersionsSection.js +93 -70
- package/dist/testSurface/surface/test/fields.d.ts +4 -3
- package/dist/testSurface/surface/test/fields.js +10 -16
- package/dist/testSurface/surface/test/pageParts.js +13 -7
- package/dist/testSurface/surface/test/testPage.css +9 -2
- package/dist/testSurface/surface/useTestDocument.d.ts +1 -3
- package/dist/testSurface/surface/useTestDocument.js +110 -52
- package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
- package/dist/testSurface/surface/watchTestDocument.js +181 -0
- package/dist/testSurface/surfaceUrls.d.ts +1 -0
- package/dist/testSurface/surfaceUrls.js +4 -0
- package/dist/testSurface/useApi.d.ts +3 -0
- package/dist/transitions/addMetric.d.ts +1 -1
- package/dist/transitions/addMetric.js +5 -1
- package/dist/transitions/kernel.d.ts +2 -0
- package/dist/transitions/kernel.js +1 -1
- package/dist/transitions/pageAddress.d.ts +6 -0
- package/dist/transitions/pageAddress.js +71 -0
- package/dist/transitions/pageVersions.d.ts +1 -1
- package/dist/transitions/preflightData.js +10 -2
- package/dist/transitions/start.d.ts +1 -1
- package/dist/transitions/start.js +8 -5
- package/dist/types/armKey.d.ts +2 -0
- package/dist/types/armKey.js +1 -0
- package/dist/types/contracts.d.ts +11 -1
- package/dist/types/endpoints.d.ts +38 -9
- package/dist/types/endpoints.js +1 -1
- package/dist/types/surface.d.ts +7 -9
- package/dist/ui/Dialog.d.ts +21 -2
- package/dist/ui/Dialog.js +101 -4
- package/dist/ui/Inputs.js +0 -1
- package/dist/ui/ui.css +5 -1
- package/package.json +2 -2
|
@@ -4,28 +4,30 @@ import { READINESS_COPY } from '../../testSurface/copy/readiness.js';
|
|
|
4
4
|
import { canStartTest, hasBrowserWritablePrimary, readyToStart } from '../../testSurface/readinessRead.js';
|
|
5
5
|
import { METRICS_COPY } from '../../testSurface/copy/metrics.js';
|
|
6
6
|
import { useState } from 'react';
|
|
7
|
-
import { Button } from '../../ui/Button.js';
|
|
8
7
|
import { Banner } from '../../ui/Feedback.js';
|
|
9
8
|
import { availableActions } from '../../testSurface/actions/actions.model.js';
|
|
10
|
-
import {
|
|
9
|
+
import { LifecycleButton, LifecycleDialog } from '../../testSurface/actions/LifecycleAction.js';
|
|
11
10
|
import { actionWaitMessage } from '../../testSurface/surface/readiness/SaveStatus.js';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/** Same transition runner and confirmation as the drawer; Decide stays there. */ export function QuickTestActions({ test, surface }) {
|
|
15
|
-
const [confirm, setConfirm] = useState(false);
|
|
16
|
-
const transition = useTransition(test, undefined, surface);
|
|
11
|
+
/** Render sidebar actions in the lifecycle model's order. */ export function QuickTestActions({ test, surface }) {
|
|
12
|
+
const [confirm, setConfirm] = useState(null);
|
|
17
13
|
const doc = test.doc;
|
|
18
|
-
const
|
|
14
|
+
const actions = availableActions({
|
|
19
15
|
...doc,
|
|
20
|
-
canManage: surface.canManage
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
16
|
+
canManage: surface.canManage,
|
|
17
|
+
canReadResults: surface.canReadResults
|
|
18
|
+
}).filter((action)=>doc.status === 'running' || action.id === 'start');
|
|
19
|
+
const start = actions.some((action)=>action.id === 'start');
|
|
20
|
+
const startVisible = start && readyToStart(test, surface.editorPlacementMessage) && !test.hasUnsaved;
|
|
21
|
+
const ready = canStartTest(test, surface.editorPlacementMessage);
|
|
22
|
+
const wait = start ? actionWaitMessage(test) : undefined;
|
|
23
|
+
const visible = test.statusReadPending ? [] : actions.filter((action)=>action.id !== 'start' || startVisible);
|
|
24
|
+
const triggers = confirm && !visible.some((action)=>action.id === confirm.id) ? [
|
|
25
|
+
...visible,
|
|
26
|
+
confirm
|
|
27
|
+
] : visible;
|
|
26
28
|
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
27
29
|
children: [
|
|
28
|
-
!test.statusReadPending &&
|
|
30
|
+
!test.statusReadPending && start && hasBrowserWritablePrimary(test.preflight, doc.metrics?.primary) ? /*#__PURE__*/ _jsx(Banner, {
|
|
29
31
|
tone: "warning",
|
|
30
32
|
children: METRICS_COPY.browserWritablePrimary
|
|
31
33
|
}) : null,
|
|
@@ -33,29 +35,37 @@ import { createApi } from '../../testSurface/api.js';
|
|
|
33
35
|
role: "status",
|
|
34
36
|
children: wait
|
|
35
37
|
}) : null,
|
|
36
|
-
|
|
38
|
+
startVisible ? /*#__PURE__*/ _jsx("p", {
|
|
37
39
|
role: "status",
|
|
38
40
|
children: READINESS_COPY.ready
|
|
39
41
|
}) : null,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
children: transition.error
|
|
42
|
+
triggers.length ? /*#__PURE__*/ _jsx("div", {
|
|
43
|
+
className: "xp-ui-button-group xp-slot-lifecycle",
|
|
44
|
+
children: triggers.map((action)=>/*#__PURE__*/ _jsx(LifecycleButton, {
|
|
45
|
+
action: action,
|
|
46
|
+
reason: action.unavailable,
|
|
47
|
+
disabled: action.id === 'start' && !ready && !confirm,
|
|
48
|
+
ariaDisabled: !!confirm,
|
|
49
|
+
onClick: ()=>{
|
|
50
|
+
if (!confirm) setConfirm(action);
|
|
51
|
+
}
|
|
52
|
+
}, action.id))
|
|
52
53
|
}) : null,
|
|
53
|
-
confirm ? /*#__PURE__*/ _jsx(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
confirm ? /*#__PURE__*/ _jsx("div", {
|
|
55
|
+
onClickCapture: (event)=>{
|
|
56
|
+
// Goal creation and other dialog links must leave the current page open.
|
|
57
|
+
const link = event.target.closest('a[href]');
|
|
58
|
+
if (link && !link.getAttribute('href')?.startsWith('#')) {
|
|
59
|
+
link.target = '_blank';
|
|
60
|
+
link.rel = 'noopener noreferrer';
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
children: /*#__PURE__*/ _jsx(LifecycleDialog, {
|
|
64
|
+
test: test,
|
|
65
|
+
surface: surface,
|
|
66
|
+
action: confirm,
|
|
67
|
+
onClose: ()=>setConfirm(null)
|
|
68
|
+
})
|
|
59
69
|
}) : null
|
|
60
70
|
]
|
|
61
71
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import type { EditorExperiment } from './editor.model.js';
|
|
2
|
-
export declare function ResultsReadout({ id, api, experiment, onRefresh }: {
|
|
3
|
+
export declare function ResultsReadout({ id, api, experiment, more, onRefresh }: {
|
|
3
4
|
id: string | number;
|
|
4
5
|
api: string;
|
|
5
6
|
experiment: EditorExperiment;
|
|
7
|
+
more?: ReactNode;
|
|
6
8
|
onRefresh?: () => void;
|
|
7
9
|
}): import("react").JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
4
4
|
import { Button } from '../../ui/Button.js';
|
|
5
5
|
import { formatCount } from '../../testSurface/results/format.js';
|
|
6
6
|
import { editorCopy as C } from './copy.js';
|
|
7
|
-
export function ResultsReadout({ id, api, experiment, onRefresh }) {
|
|
7
|
+
export function ResultsReadout({ id, api, experiment, more, onRefresh }) {
|
|
8
8
|
const [data, setData] = useState(null);
|
|
9
9
|
const [refresh, setRefresh] = useState(0);
|
|
10
10
|
const pending = useRef(false);
|
|
@@ -56,17 +56,41 @@ export function ResultsReadout({ id, api, experiment, onRefresh }) {
|
|
|
56
56
|
refresh,
|
|
57
57
|
experiment.status
|
|
58
58
|
]);
|
|
59
|
+
const collecting = data && data !== 'unavailable' && data.headline === C.collecting;
|
|
59
60
|
return /*#__PURE__*/ _jsxs("div", {
|
|
60
61
|
className: "xp-slot-readout",
|
|
61
62
|
children: [
|
|
63
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
64
|
+
className: "xp-slot-readout-bar",
|
|
65
|
+
children: [
|
|
66
|
+
more,
|
|
67
|
+
collecting ? /*#__PURE__*/ _jsx("strong", {
|
|
68
|
+
className: "xp-slot-readout-status",
|
|
69
|
+
children: C.collecting
|
|
70
|
+
}) : null,
|
|
71
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
72
|
+
variant: "quiet",
|
|
73
|
+
size: "sm",
|
|
74
|
+
className: "xp-slot-readout-refresh",
|
|
75
|
+
disabled: busy,
|
|
76
|
+
onClick: ()=>{
|
|
77
|
+
if (pending.current) return;
|
|
78
|
+
pending.current = true;
|
|
79
|
+
setRefresh((value)=>value + 1);
|
|
80
|
+
onRefresh?.();
|
|
81
|
+
},
|
|
82
|
+
children: C.refresh
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
}),
|
|
62
86
|
data === 'unavailable' ? /*#__PURE__*/ _jsx("p", {
|
|
63
87
|
className: "xp-ui-help",
|
|
64
88
|
children: C.resultsUnavailable
|
|
65
89
|
}) : data ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
66
90
|
children: [
|
|
67
|
-
/*#__PURE__*/ _jsx("strong", {
|
|
91
|
+
!collecting ? /*#__PURE__*/ _jsx("strong", {
|
|
68
92
|
children: data.headline
|
|
69
|
-
}),
|
|
93
|
+
}) : null,
|
|
70
94
|
data.people ? /*#__PURE__*/ _jsx("div", {
|
|
71
95
|
className: "xp-slot-people",
|
|
72
96
|
children: [
|
|
@@ -85,19 +109,7 @@ export function ResultsReadout({ id, api, experiment, onRefresh }) {
|
|
|
85
109
|
role: "status",
|
|
86
110
|
className: "xp-ui-help",
|
|
87
111
|
children: C.refreshing
|
|
88
|
-
}) : null
|
|
89
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
90
|
-
variant: "quiet",
|
|
91
|
-
size: "sm",
|
|
92
|
-
disabled: busy,
|
|
93
|
-
onClick: ()=>{
|
|
94
|
-
if (pending.current) return;
|
|
95
|
-
pending.current = true;
|
|
96
|
-
setRefresh((value)=>value + 1);
|
|
97
|
-
onRefresh?.();
|
|
98
|
-
},
|
|
99
|
-
children: C.refresh
|
|
100
|
-
})
|
|
112
|
+
}) : null
|
|
101
113
|
]
|
|
102
114
|
});
|
|
103
115
|
}
|
|
@@ -13,8 +13,9 @@ export declare function VersionCard({ label, openLabel, active, dragging, intera
|
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
}): import("react").JSX.Element;
|
|
15
15
|
/** Keep unavailable controls reachable, and explain an attempted edit in place. */
|
|
16
|
-
export declare function VersionLock({ message, children }: {
|
|
16
|
+
export declare function VersionLock({ message, detail, children }: {
|
|
17
17
|
message?: string;
|
|
18
|
+
detail?: string;
|
|
18
19
|
children: (noticeId?: string) => ReactNode;
|
|
19
20
|
}): import("react").JSX.Element;
|
|
20
21
|
export declare function useArmWrites({ url, bindingKey, status, controlKeys, publish, isCurrent, onWrite, onSaved }: {
|
|
@@ -58,8 +59,9 @@ export declare function VersionName({ arm, writes, editable, draftState }: {
|
|
|
58
59
|
editable: boolean;
|
|
59
60
|
draftState?: [NameEdit | null, (edit: NameEdit | null) => void];
|
|
60
61
|
}): import("react").JSX.Element;
|
|
61
|
-
export declare function RemoveVersion({ arm, writes, count, shared, onRemove, onClose }: {
|
|
62
|
+
export declare function RemoveVersion({ arm, name, writes, count, shared, onRemove, onClose }: {
|
|
62
63
|
arm: EditorExperiment['arms'][number];
|
|
64
|
+
name?: string;
|
|
63
65
|
writes: ArmWrites;
|
|
64
66
|
count: number;
|
|
65
67
|
shared: boolean | undefined;
|
|
@@ -5,7 +5,7 @@ import { balanceWeight, splitEvenly, totalWeight, withSlotsFor } from '../../arm
|
|
|
5
5
|
import { checkArms } from '../../collections/experiments/armInvariants.js';
|
|
6
6
|
import { issueMessage } from '../../arms/copy.js';
|
|
7
7
|
import { Button } from '../../ui/Button.js';
|
|
8
|
-
import {
|
|
8
|
+
import { ConfirmDialog } from '../../ui/Dialog.js';
|
|
9
9
|
import { NumberInput, TextInput } from '../../ui/Inputs.js';
|
|
10
10
|
import { addVersionArms, ArmWriteError, removeVersionArms, renameVersionArms, setVersionTraffic, writeArms } from './armWrites.js';
|
|
11
11
|
import { editorCopy as C } from './copy.js';
|
|
@@ -43,7 +43,7 @@ const VersionLockContext = /*#__PURE__*/ createContext(undefined);
|
|
|
43
43
|
})
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
/** Keep unavailable controls reachable, and explain an attempted edit in place. */ export function VersionLock({ message, children }) {
|
|
46
|
+
/** Keep unavailable controls reachable, and explain an attempted edit in place. */ export function VersionLock({ message, detail, children }) {
|
|
47
47
|
const id = useId();
|
|
48
48
|
const controls = useRef(null);
|
|
49
49
|
const notice = useRef(null);
|
|
@@ -141,17 +141,23 @@ const VersionLockContext = /*#__PURE__*/ createContext(undefined);
|
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
143
|
children: [
|
|
144
|
-
message ? /*#__PURE__*/
|
|
144
|
+
message ? /*#__PURE__*/ _jsxs("div", {
|
|
145
145
|
ref: notice,
|
|
146
146
|
id: id,
|
|
147
147
|
className: "xp-slot-lock-notice",
|
|
148
148
|
"data-attention": attention,
|
|
149
|
-
children:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
149
|
+
children: [
|
|
150
|
+
attention ? /*#__PURE__*/ _jsx("span", {
|
|
151
|
+
role: "alert",
|
|
152
|
+
children: message
|
|
153
|
+
}, "attention") : /*#__PURE__*/ _jsx("span", {
|
|
154
|
+
children: message
|
|
155
|
+
}, "rest"),
|
|
156
|
+
detail ? /*#__PURE__*/ _jsx("p", {
|
|
157
|
+
className: "xp-slot-lock-detail",
|
|
158
|
+
children: detail
|
|
159
|
+
}) : null
|
|
160
|
+
]
|
|
155
161
|
}) : null,
|
|
156
162
|
children(message ? id : undefined)
|
|
157
163
|
]
|
|
@@ -422,65 +428,37 @@ export function VersionName({ arm, writes, editable, draftState }) {
|
|
|
422
428
|
]
|
|
423
429
|
});
|
|
424
430
|
}
|
|
425
|
-
export function RemoveVersion({ arm, writes, count, shared, onRemove, onClose }) {
|
|
431
|
+
export function RemoveVersion({ arm, name, writes, count, shared, onRemove, onClose }) {
|
|
426
432
|
const slot = arm.key === 'holdout' ? undefined : arm.key;
|
|
427
433
|
const close = ()=>{
|
|
428
434
|
writes.clearError(`remove:${arm.key}`);
|
|
429
435
|
onClose();
|
|
430
436
|
};
|
|
431
|
-
return /*#__PURE__*/ _jsx(
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
initialFocus: "cancel",
|
|
435
|
-
dismissible: !writes.busy,
|
|
437
|
+
return /*#__PURE__*/ _jsx(ConfirmDialog, {
|
|
438
|
+
title: C.removeTitle(arm.label, name),
|
|
439
|
+
description: C.removeHelp(count),
|
|
436
440
|
onClose: close,
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
"aria-disabled": writes.busy || undefined,
|
|
459
|
-
onClick: ()=>{
|
|
460
|
-
if (!writes.busy) close();
|
|
461
|
-
},
|
|
462
|
-
children: C.cancel
|
|
463
|
-
}),
|
|
464
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
465
|
-
variant: "danger",
|
|
466
|
-
"aria-busy": writes.busy || undefined,
|
|
467
|
-
"aria-disabled": writes.busy || undefined,
|
|
468
|
-
onClick: async ()=>{
|
|
469
|
-
if (writes.busy) return;
|
|
470
|
-
const saved = await writes.write((arms)=>removeVersionArms(arms, arm.key), {
|
|
471
|
-
errorKey: `remove:${arm.key}`
|
|
472
|
-
});
|
|
473
|
-
if (saved) {
|
|
474
|
-
if (slot) onRemove(slot);
|
|
475
|
-
close();
|
|
476
|
-
}
|
|
477
|
-
},
|
|
478
|
-
children: C.remove
|
|
479
|
-
})
|
|
480
|
-
]
|
|
481
|
-
})
|
|
482
|
-
]
|
|
483
|
-
})
|
|
441
|
+
cancelLabel: C.cancel,
|
|
442
|
+
busy: writes.busy,
|
|
443
|
+
error: writes.errorFor(`remove:${arm.key}`),
|
|
444
|
+
confirm: {
|
|
445
|
+
label: C.remove,
|
|
446
|
+
destructive: true,
|
|
447
|
+
onClick: async ()=>{
|
|
448
|
+
const saved = await writes.write((arms)=>removeVersionArms(arms, arm.key), {
|
|
449
|
+
errorKey: `remove:${arm.key}`
|
|
450
|
+
});
|
|
451
|
+
if (saved) {
|
|
452
|
+
if (slot) onRemove(slot);
|
|
453
|
+
close();
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
children: shared === undefined ? /*#__PURE__*/ _jsx("p", {
|
|
458
|
+
children: C.removeScopeUnknown
|
|
459
|
+
}) : shared ? /*#__PURE__*/ _jsx("p", {
|
|
460
|
+
children: C.removeShared
|
|
461
|
+
}) : null
|
|
484
462
|
});
|
|
485
463
|
}
|
|
486
464
|
const shareBase = (arms)=>arms.map((arm)=>`${arm.key}:${arm.weight}`).join(',');
|
|
@@ -504,6 +482,7 @@ export function VersionWeights({ experiment, writes, edits, setEdits, groupId, s
|
|
|
504
482
|
const clearDraft = (key)=>setEdits((current)=>Object.fromEntries(Object.entries(current).filter(([candidate])=>candidate !== key)));
|
|
505
483
|
const live = withSlotsFor(keys.length === 1 && !invalidKeys.has(keys[0]) && !errors[keys[0]] && edits[keys[0]]?.base === base && editable ? apply(experiment.arms, keys[0]) : experiment.arms, 'block');
|
|
506
484
|
const issues = checkArms(live, 'block');
|
|
485
|
+
const controlLabel = live.find((arm)=>arm.kind === 'control')?.label;
|
|
507
486
|
async function commit(key, confirmed = false) {
|
|
508
487
|
const edit = edits[key];
|
|
509
488
|
if (writes.busy || !edit || invalidKeys.has(key)) return;
|
|
@@ -627,7 +606,7 @@ export function VersionWeights({ experiment, writes, edits, setEdits, groupId, s
|
|
|
627
606
|
keys.length && !invalidKeys.size ? issues.map((issue, i)=>/*#__PURE__*/ _jsx("p", {
|
|
628
607
|
role: "alert",
|
|
629
608
|
className: "xp-ui-error",
|
|
630
|
-
children: issueMessage(issue, totalWeight(live))
|
|
609
|
+
children: issueMessage(issue, totalWeight(live), controlLabel)
|
|
631
610
|
}, i)) : null,
|
|
632
611
|
beforeActions,
|
|
633
612
|
beforeSplit || showSplit ? /*#__PURE__*/ _jsxs("div", {
|
|
@@ -77,7 +77,7 @@ export async function readExperiment(url, signal) {
|
|
|
77
77
|
if (!fresh.updatedAt || !Array.isArray(fresh.arms)) throw new ArmWriteError(editorCopy.writeUnreadable);
|
|
78
78
|
const arms = withSlotsFor(transform(fresh.arms), 'block');
|
|
79
79
|
const issue = checkArms(arms, 'block')[0];
|
|
80
|
-
if (issue) throw new ArmWriteError(issueMessage(issue, totalWeight(arms)));
|
|
80
|
+
if (issue) throw new ArmWriteError(issueMessage(issue, totalWeight(arms), arms.find((arm)=>arm.kind === 'control')?.label));
|
|
81
81
|
if (arms.some((arm)=>!arm.label.trim())) throw new ArmWriteError(editorCopy.emptyLabel);
|
|
82
82
|
const response = await fetch(url, {
|
|
83
83
|
method: 'PATCH',
|
|
@@ -20,7 +20,7 @@ export declare const editorCopy: {
|
|
|
20
20
|
readonly closeConfigure: "Close";
|
|
21
21
|
readonly selectBlock: "Select this test block";
|
|
22
22
|
readonly deleted: "The test for this block was deleted.";
|
|
23
|
-
readonly unbound: "This
|
|
23
|
+
readonly unbound: "This Test block has no test yet.";
|
|
24
24
|
readonly draft: (label: string) => string;
|
|
25
25
|
readonly running: "Changing this content mid-test mixes two versions in one result";
|
|
26
26
|
readonly decided: (winner: string) => string;
|
|
@@ -31,6 +31,7 @@ export declare const editorCopy: {
|
|
|
31
31
|
readonly enterName: "Enter a name to create the test.";
|
|
32
32
|
readonly dropZone: (label: string) => string;
|
|
33
33
|
readonly replaceConfirm: (label: string, original?: string) => string;
|
|
34
|
+
readonly replaceTitle: (label: string, test?: string) => string;
|
|
34
35
|
readonly replace: "Replace";
|
|
35
36
|
readonly pageFallback: "Page";
|
|
36
37
|
readonly createLabel: "Set up test";
|
|
@@ -50,7 +51,7 @@ export declare const editorCopy: {
|
|
|
50
51
|
readonly orphan: (label: string, versions: string) => string;
|
|
51
52
|
readonly addLeftover: "Add to the test";
|
|
52
53
|
readonly deleteContent: "Delete its content";
|
|
53
|
-
readonly deleteContentTitle: (label: string) => string;
|
|
54
|
+
readonly deleteContentTitle: (label: string, test?: string) => string;
|
|
54
55
|
readonly deleteContentHelp: (label: string, count: number) => string;
|
|
55
56
|
readonly draftOnly: "Only draft tests can add this version. Use a different test to include it.";
|
|
56
57
|
readonly outsideTest: (label: string) => string;
|
|
@@ -69,20 +70,23 @@ export declare const editorCopy: {
|
|
|
69
70
|
readonly removeVersion: "Remove version";
|
|
70
71
|
readonly emptyLabel: "Enter a name for this version.";
|
|
71
72
|
readonly remove: "Remove";
|
|
72
|
-
readonly removeTitle: (label: string) => string;
|
|
73
|
+
readonly removeTitle: (label: string, test?: string) => string;
|
|
73
74
|
readonly removeHelp: (count: number) => string;
|
|
74
75
|
readonly removeShared: "This test is also used in another place. The version is removed from the test there too.";
|
|
75
76
|
readonly removeScopeUnknown: "If this test is used on other pages, the version is removed from the test there too.";
|
|
76
77
|
readonly removed: "Save the page to finish removing this version's content.";
|
|
77
|
-
readonly
|
|
78
|
+
readonly removeUnclearedSteps: readonly ["Delete the leftover content from the outline.", "Save the page."];
|
|
79
|
+
readonly archivedStepsWhy: "To keep this content on the page without the test, move it into regular blocks.";
|
|
80
|
+
readonly archivedSteps: readonly ["Move the content out of the Test block on the canvas.", "Remove the Test block."];
|
|
81
|
+
readonly removeUncleared: "The version was removed from the test. Its content still needs to be removed from the page.";
|
|
78
82
|
readonly lockedGeneric: "This test's versions can't change. View the test page for details.";
|
|
79
|
-
readonly holdoutContent:
|
|
83
|
+
readonly holdoutContent: (label?: string) => string;
|
|
80
84
|
readonly holdoutPeople: (label: string, count: string) => string;
|
|
81
85
|
readonly weight: (label: string) => string;
|
|
82
86
|
readonly invalidShare: "Use a whole number from 0 to 100.";
|
|
83
87
|
readonly split: "Split evenly";
|
|
84
88
|
readonly locked: {
|
|
85
|
-
readonly running: "This test is running, so its versions can't change.
|
|
89
|
+
readonly running: "This test is running, so its versions can't change. Editing content during the test mixes two versions in one result.";
|
|
86
90
|
readonly decided: "This test has a decision, so its versions can't change. View the results on the test page.";
|
|
87
91
|
readonly archived: "This test is archived, so its versions can't change. View the results on the test page.";
|
|
88
92
|
};
|
package/dist/puck/editor/copy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { nestedTestCopy } from '../nestedTestCopy.js';
|
|
2
|
-
import { ARM_LABELS } from '../../labels/arms.js';
|
|
2
|
+
import { ARM_LABELS, controlVersionName } from '../../labels/arms.js';
|
|
3
3
|
export const editorCopy = {
|
|
4
4
|
nested: nestedTestCopy.editor,
|
|
5
5
|
nestedHidden: nestedTestCopy.hidden,
|
|
@@ -16,17 +16,18 @@ export const editorCopy = {
|
|
|
16
16
|
closeConfigure: 'Close',
|
|
17
17
|
selectBlock: 'Select this test block',
|
|
18
18
|
deleted: 'The test for this block was deleted.',
|
|
19
|
-
unbound: 'This
|
|
20
|
-
draft: (label)=>`This block shows
|
|
19
|
+
unbound: 'This Test block has no test yet.',
|
|
20
|
+
draft: (label)=>`This block shows ${controlVersionName(label)} to everyone until the test starts.`,
|
|
21
21
|
running: 'Changing this content mid-test mixes two versions in one result',
|
|
22
22
|
decided: (winner)=>`Decided: ${winner}. Use 'Make it the content' on the test to finish.`,
|
|
23
|
-
archived: (winner)=>`Archived: this block serves ${winner}, or nothing if that version is empty
|
|
24
|
-
archivedOriginal: (original, discarded)=>`${discarded ? 'Winner discarded' : 'Archived without a winner'}: this block shows ${original}, or nothing if it is empty
|
|
23
|
+
archived: (winner)=>`Archived: this block serves ${winner}, or nothing if that version is empty.`,
|
|
24
|
+
archivedOriginal: (original, discarded)=>`${discarded ? 'Winner discarded' : 'Archived without a winner'}: this block shows ${original}, or nothing if it is empty.`,
|
|
25
25
|
copy: (label = ARM_LABELS.control)=>`Copy ${label} here`,
|
|
26
|
-
copyEmpty: (label
|
|
26
|
+
copyEmpty: (label)=>`Add content to ${controlVersionName(label)} before copying it.`,
|
|
27
27
|
enterName: 'Enter a name to create the test.',
|
|
28
28
|
dropZone: (label)=>`Drop ${label} content here`,
|
|
29
|
-
replaceConfirm: (label, original = ARM_LABELS.control)
|
|
29
|
+
replaceConfirm: (label, original = ARM_LABELS.control)=>`This replaces the content in ${label} with a copy of ${original}. The original content stays in place.`,
|
|
30
|
+
replaceTitle: (label, test)=>test ? `Replace ${label} in “${test}”?` : `Replace ${label}?`,
|
|
30
31
|
replace: 'Replace',
|
|
31
32
|
pageFallback: 'Page',
|
|
32
33
|
createLabel: 'Set up test',
|
|
@@ -46,7 +47,7 @@ export const editorCopy = {
|
|
|
46
47
|
orphan: (label, versions)=>`${label} has content on this page, but the test only has ${versions}. Visitors never see it.`,
|
|
47
48
|
addLeftover: 'Add to the test',
|
|
48
49
|
deleteContent: 'Delete its content',
|
|
49
|
-
deleteContentTitle: (label)
|
|
50
|
+
deleteContentTitle: (label, test)=>test ? `Delete ${label} content from “${test}”?` : `Delete ${label} content?`,
|
|
50
51
|
deleteContentHelp: (label, count)=>`This deletes the ${count} ${count === 1 ? 'block' : 'blocks'} in ${label} from this page. Save the page to keep this change.`,
|
|
51
52
|
draftOnly: 'Only draft tests can add this version. Use a different test to include it.',
|
|
52
53
|
outsideTest: (label)=>`${label} · not in this test`,
|
|
@@ -65,20 +66,29 @@ export const editorCopy = {
|
|
|
65
66
|
removeVersion: 'Remove version',
|
|
66
67
|
emptyLabel: 'Enter a name for this version.',
|
|
67
68
|
remove: 'Remove',
|
|
68
|
-
removeTitle: (label)
|
|
69
|
+
removeTitle: (label, test)=>test ? `Remove ${label} from “${test}”?` : `Remove ${label}?`,
|
|
69
70
|
removeHelp: (count)=>count === 0 ? 'This removes the version from the test.' : `This removes the version from the test and deletes its ${count} ${count === 1 ? 'block' : 'blocks'} from this page. Save the page to keep this change.`,
|
|
70
71
|
removeShared: 'This test is also used in another place. The version is removed from the test there too.',
|
|
71
72
|
removeScopeUnknown: 'If this test is used on other pages, the version is removed from the test there too.',
|
|
72
73
|
removed: "Save the page to finish removing this version's content.",
|
|
73
|
-
|
|
74
|
+
removeUnclearedSteps: [
|
|
75
|
+
'Delete the leftover content from the outline.',
|
|
76
|
+
'Save the page.'
|
|
77
|
+
],
|
|
78
|
+
archivedStepsWhy: 'To keep this content on the page without the test, move it into regular blocks.',
|
|
79
|
+
archivedSteps: [
|
|
80
|
+
'Move the content out of the Test block on the canvas.',
|
|
81
|
+
'Remove the Test block.'
|
|
82
|
+
],
|
|
83
|
+
removeUncleared: "The version was removed from the test. Its content still needs to be removed from the page.",
|
|
74
84
|
lockedGeneric: "This test's versions can't change. View the test page for details.",
|
|
75
|
-
holdoutContent:
|
|
85
|
+
holdoutContent: (label)=>`Holdout visitors see ${controlVersionName(label)}.`,
|
|
76
86
|
holdoutPeople: (label, count)=>`${label}: ${count} people (not compared)`,
|
|
77
87
|
weight: (label)=>`${label} traffic (%)`,
|
|
78
88
|
invalidShare: 'Use a whole number from 0 to 100.',
|
|
79
89
|
split: 'Split evenly',
|
|
80
90
|
locked: {
|
|
81
|
-
running: "This test is running, so its versions can't change.
|
|
91
|
+
running: "This test is running, so its versions can't change. Editing content during the test mixes two versions in one result.",
|
|
82
92
|
decided: "This test has a decision, so its versions can't change. View the results on the test page.",
|
|
83
93
|
archived: "This test is archived, so its versions can't change. View the results on the test page."
|
|
84
94
|
},
|
|
@@ -98,13 +98,6 @@
|
|
|
98
98
|
gap: var(--xp-space-4);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
.xp-slot-copy-confirm {
|
|
102
|
-
padding: var(--xp-space-2) var(--xp-space-3);
|
|
103
|
-
border: 1px solid var(--xp-warning);
|
|
104
|
-
border-radius: var(--xp-radius);
|
|
105
|
-
background: var(--xp-warning-surface);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
101
|
/* Tailwind's preflight runs before these controls in the canvas document. */
|
|
109
102
|
.xp-slot-editor .xp-ui-button,
|
|
110
103
|
.xp-slot-editor .xp-ui-tab,
|
|
@@ -122,13 +115,21 @@
|
|
|
122
115
|
.xp-slot-weight-inputs { align-items: flex-start; }
|
|
123
116
|
.xp-slot-weight-inputs .xp-ui-field { flex: 1 1 120px; max-width: 200px; }
|
|
124
117
|
.xp-slot-readout { display: grid; gap: var(--xp-space-2); }
|
|
125
|
-
.xp-slot-readout
|
|
118
|
+
.xp-slot-readout-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: var(--xp-space-2); }
|
|
119
|
+
.xp-slot-readout-status { grid-column: 2; padding-block: var(--xp-space-2); font: var(--xp-text-small); }
|
|
120
|
+
.xp-slot-readout-refresh { grid-column: 3; }
|
|
121
|
+
.xp-slot-more { grid-column: 1; min-width: 0; }
|
|
122
|
+
.xp-slot-more > button { gap: var(--xp-space-2); }
|
|
123
|
+
.xp-slot-more > button[aria-expanded='true'] svg { transform: rotate(180deg); }
|
|
124
|
+
.xp-slot-more > div > button { white-space: normal; }
|
|
125
|
+
.xp-slot-lock-detail { margin: var(--xp-space-2) 0 0; }
|
|
126
126
|
.xp-slot-editor .xp-ui-tablist { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
|
|
127
127
|
.xp-slot-root.xp-puck-field { display: grid; gap: var(--xp-space-3); min-width: 0; }
|
|
128
128
|
|
|
129
129
|
/* Puck's inline field sidebar stays light, including under Payload's dark-mode text overrides. */
|
|
130
130
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-button--secondary { color: var(--xp-text); }
|
|
131
131
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-button--primary { color: var(--xp-accent-fg); }
|
|
132
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-button--danger { color: var(--xp-error); }
|
|
132
133
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-error { color: var(--xp-error); }
|
|
133
134
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-help { color: var(--xp-text-2); }
|
|
134
135
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-field label { color: var(--xp-text); }
|
|
@@ -329,7 +329,8 @@
|
|
|
329
329
|
.xp-ui-breadcrumb a:hover { color: var(--xp-text); }
|
|
330
330
|
.xp-ui-breadcrumb [aria-current] { color: var(--xp-text); }
|
|
331
331
|
.xp-ui-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; padding: 24px; border: 1px solid var(--xp-border); border-radius: var(--xp-radius-card); background: var(--xp-surface); color: var(--xp-text); font: var(--xp-text-body); box-shadow: 0 16px 48px var(--xp-overlay); }
|
|
332
|
-
.xp-ui-dialog h2 { margin: 0 0 16px; font: var(--xp-text-title); }
|
|
332
|
+
.xp-ui-dialog h2 { margin: 0 0 16px; font: var(--xp-text-title); overflow-wrap: anywhere; }
|
|
333
|
+
.xp-ui-dialog > [id]:has(+ :is(.xp-ui-field, .xp-ui-banner)), .xp-ui-dialog > .xp-ui-banner:has(+ .xp-ui-field) { margin-block-end: var(--xp-space-4); }
|
|
333
334
|
.xp-ui-dialog::backdrop { background: var(--xp-overlay); }
|
|
334
335
|
.xp-ui-chips { width: 100%; max-width: 100%; min-width: 0; display: grid; gap: var(--xp-space-2); margin-block: var(--xp-space-4); color: var(--xp-text); font-family: var(--xp-font-body); }
|
|
335
336
|
.xp-ui-chips-control { width: 100%; max-width: 100%; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: var(--xp-space-1); padding: var(--xp-space-2); border: 1px solid var(--xp-border-control); border-radius: var(--xp-radius); background: var(--xp-input-bg); }
|
|
@@ -345,6 +346,9 @@
|
|
|
345
346
|
.xp-ui-chips p:not(.xp-ui-error) { margin: 0; color: var(--xp-text-muted); font-size: var(--xp-font-size-small); }
|
|
346
347
|
/* Quiet actions and breadcrumb links stay neutral; only the selected tab takes the text accent. */
|
|
347
348
|
.xp-ui-button-group { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; max-width: 100%; }
|
|
349
|
+
.xp-ui-confirm-actions { justify-content: flex-end; gap: var(--xp-space-2); margin-block-start: var(--xp-space-4); }
|
|
350
|
+
.xp-lifecycle-action { display: inline-flex; flex-direction: column; align-items: flex-start; gap: var(--xp-space-1); min-width: 0; }
|
|
351
|
+
.xp-lifecycle-action > .xp-ui-help { margin: 0; max-width: 24ch; }
|
|
348
352
|
.xp-ui-inline-row { display: flex; flex-wrap: wrap; align-items: end; gap: var(--xp-space-3); min-width: 0; }
|
|
349
353
|
.xp-ui-inline-row > .xp-ui-field { flex: 1 1 auto; min-width: 0; }
|
|
350
354
|
.xp-ui-inline-row > .xp-ui-button { flex: 0 0 auto; }
|
|
@@ -492,13 +496,6 @@
|
|
|
492
496
|
gap: var(--xp-space-4);
|
|
493
497
|
}
|
|
494
498
|
|
|
495
|
-
.xp-slot-copy-confirm {
|
|
496
|
-
padding: var(--xp-space-2) var(--xp-space-3);
|
|
497
|
-
border: 1px solid var(--xp-warning);
|
|
498
|
-
border-radius: var(--xp-radius);
|
|
499
|
-
background: var(--xp-warning-surface);
|
|
500
|
-
}
|
|
501
|
-
|
|
502
499
|
/* Tailwind's preflight runs before these controls in the canvas document. */
|
|
503
500
|
.xp-slot-editor .xp-ui-button,
|
|
504
501
|
.xp-slot-editor .xp-ui-tab,
|
|
@@ -516,13 +513,21 @@
|
|
|
516
513
|
.xp-slot-weight-inputs { align-items: flex-start; }
|
|
517
514
|
.xp-slot-weight-inputs .xp-ui-field { flex: 1 1 120px; max-width: 200px; }
|
|
518
515
|
.xp-slot-readout { display: grid; gap: var(--xp-space-2); }
|
|
519
|
-
.xp-slot-readout
|
|
516
|
+
.xp-slot-readout-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: var(--xp-space-2); }
|
|
517
|
+
.xp-slot-readout-status { grid-column: 2; padding-block: var(--xp-space-2); font: var(--xp-text-small); }
|
|
518
|
+
.xp-slot-readout-refresh { grid-column: 3; }
|
|
519
|
+
.xp-slot-more { grid-column: 1; min-width: 0; }
|
|
520
|
+
.xp-slot-more > button { gap: var(--xp-space-2); }
|
|
521
|
+
.xp-slot-more > button[aria-expanded='true'] svg { transform: rotate(180deg); }
|
|
522
|
+
.xp-slot-more > div > button { white-space: normal; }
|
|
523
|
+
.xp-slot-lock-detail { margin: var(--xp-space-2) 0 0; }
|
|
520
524
|
.xp-slot-editor .xp-ui-tablist { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
|
|
521
525
|
.xp-slot-root.xp-puck-field { display: grid; gap: var(--xp-space-3); min-width: 0; }
|
|
522
526
|
|
|
523
527
|
/* Puck's inline field sidebar stays light, including under Payload's dark-mode text overrides. */
|
|
524
528
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-button--secondary { color: var(--xp-text); }
|
|
525
529
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-button--primary { color: var(--xp-accent-fg); }
|
|
530
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-button--danger { color: var(--xp-error); }
|
|
526
531
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-error { color: var(--xp-error); }
|
|
527
532
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-help { color: var(--xp-text-2); }
|
|
528
533
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-field label { color: var(--xp-text); }
|
|
@@ -56,5 +56,5 @@ export declare function cachedReadinessRead(api: string, id: DocId, contentLocal
|
|
|
56
56
|
pollDelay: number | null;
|
|
57
57
|
} | undefined;
|
|
58
58
|
export declare function placementReadError(api: string, id: DocId, contentLocale?: string): string | undefined;
|
|
59
|
-
export declare function watchPlacementNotice(api: string, id: DocId, doc: Document, contentLocale?: string
|
|
59
|
+
export declare function watchPlacementNotice(api: string, id: DocId, doc: Document, contentLocale?: string): () => void;
|
|
60
60
|
export {};
|