@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.
Files changed (254) hide show
  1. package/README.md +2 -8
  2. package/dist/admin/MetricSourceSelect.js +10 -3
  3. package/dist/admin/armSelect/armSelect.model.d.ts +1 -1
  4. package/dist/admin/blocks/BlockPanel.d.ts +1 -0
  5. package/dist/admin/blocks/BlockPanel.js +75 -29
  6. package/dist/admin/blocks/model.js +5 -4
  7. package/dist/admin/copy/blocks.d.ts +14 -11
  8. package/dist/admin/copy/blocks.js +33 -22
  9. package/dist/admin/copy/goals.d.ts +15 -8
  10. package/dist/admin/copy/goals.js +18 -8
  11. package/dist/admin/copy/newTest.d.ts +10 -7
  12. package/dist/admin/copy/newTest.js +14 -7
  13. package/dist/admin/copy/status.d.ts +1 -1
  14. package/dist/admin/copy/status.js +2 -1
  15. package/dist/admin/pageCollections.d.ts +1 -0
  16. package/dist/admin/pageCollections.js +3 -0
  17. package/dist/admin/placementStatus.model.js +5 -3
  18. package/dist/admin/status.model.d.ts +1 -0
  19. package/dist/admin/status.model.js +2 -1
  20. package/dist/admin/surface/ResultsRoute.js +4 -8
  21. package/dist/admin/surface/SurfaceShell.d.ts +4 -2
  22. package/dist/admin/surface/SurfaceShell.js +28 -3
  23. package/dist/admin/surface/TestRowMenu.d.ts +13 -0
  24. package/dist/admin/surface/TestRowMenu.js +163 -0
  25. package/dist/admin/surface/TestsHome.d.ts +4 -3
  26. package/dist/admin/surface/TestsHome.js +186 -47
  27. package/dist/admin/surface/TestsSurface.js +2 -1
  28. package/dist/admin/surface/goals/DeleteGoalDialog.d.ts +7 -0
  29. package/dist/admin/surface/goals/DeleteGoalDialog.js +42 -0
  30. package/dist/admin/surface/goals/GoalForm.d.ts +1 -0
  31. package/dist/admin/surface/goals/GoalForm.js +280 -198
  32. package/dist/admin/surface/goals/GoalsList.js +102 -33
  33. package/dist/admin/surface/goals/data.d.ts +2 -0
  34. package/dist/admin/surface/goals/data.js +9 -0
  35. package/dist/admin/surface/goals/goals.css +3 -2
  36. package/dist/admin/surface/goals/goals.model.d.ts +2 -2
  37. package/dist/admin/surface/goals/goals.model.js +7 -12
  38. package/dist/admin/surface/home.model.d.ts +15 -8
  39. package/dist/admin/surface/home.model.js +22 -18
  40. package/dist/admin/surface/newTest/NewTest.d.ts +3 -3
  41. package/dist/admin/surface/newTest/NewTest.js +156 -96
  42. package/dist/admin/surface/newTest/PageWizard.d.ts +4 -1
  43. package/dist/admin/surface/newTest/PageWizard.js +93 -68
  44. package/dist/admin/surface/newTest/newTest.css +28 -11
  45. package/dist/admin/surface/results/ResultsHeader.d.ts +1 -1
  46. package/dist/admin/surface/results/ResultsHeader.js +90 -63
  47. package/dist/admin/surface/surface.css +29 -0
  48. package/dist/admin/surface/test/TestPage.js +46 -38
  49. package/dist/admin/surface/useXpStepNav.d.ts +11 -0
  50. package/dist/admin/surface/useXpStepNav.js +14 -0
  51. package/dist/admin/views/TestsSurfaceClient.js +27 -3
  52. package/dist/admin/views/buildSurfaceProps.js +18 -66
  53. package/dist/arms/copy.d.ts +13 -3
  54. package/dist/arms/copy.js +5 -4
  55. package/dist/blocks/createExperimentBlock.js +1 -1
  56. package/dist/blocks/formState.js +1 -1
  57. package/dist/collections/experiments/armInvariants.js +8 -5
  58. package/dist/collections/metrics.js +12 -5
  59. package/dist/collections/serialize.js +3 -2
  60. package/dist/db/pageCopies.d.ts +5 -0
  61. package/dist/db/pageCopies.js +31 -0
  62. package/dist/db/snapshots.d.ts +1 -0
  63. package/dist/endpoints/duplicateOriginal.d.ts +38 -0
  64. package/dist/endpoints/duplicateOriginal.js +414 -0
  65. package/dist/endpoints/editorSurface.js +1 -1
  66. package/dist/endpoints/index.js +20 -0
  67. package/dist/endpoints/pages.js +245 -66
  68. package/dist/endpoints/placementStatus.js +1 -0
  69. package/dist/endpoints/results.js +3 -0
  70. package/dist/endpoints/testVersion.d.ts +2 -0
  71. package/dist/endpoints/testVersion.js +38 -0
  72. package/dist/endpoints/transitions.js +4 -5
  73. package/dist/exports/index.d.ts +1 -1
  74. package/dist/goals/picker/copy.js +1 -1
  75. package/dist/goals/sourceLabel.d.ts +2 -0
  76. package/dist/goals/sourceLabel.js +4 -0
  77. package/dist/hooks/trackPageCopies.d.ts +11 -0
  78. package/dist/hooks/trackPageCopies.js +7 -0
  79. package/dist/labels/arms.d.ts +3 -0
  80. package/dist/labels/arms.js +8 -0
  81. package/dist/options.d.ts +2 -0
  82. package/dist/options.js +18 -2
  83. package/dist/plugin.js +56 -2
  84. package/dist/puck/editor/ConfigureTestDrawer.d.ts +7 -7
  85. package/dist/puck/editor/ConfigureTestDrawer.js +36 -26
  86. package/dist/puck/editor/ExperimentSlotEditor.d.ts +2 -1
  87. package/dist/puck/editor/ExperimentSlotEditor.js +219 -106
  88. package/dist/puck/editor/LeftoverVersions.js +17 -32
  89. package/dist/puck/editor/QuickTestActions.d.ts +2 -2
  90. package/dist/puck/editor/QuickTestActions.js +44 -34
  91. package/dist/puck/editor/ResultsReadout.d.ts +3 -1
  92. package/dist/puck/editor/ResultsReadout.js +28 -16
  93. package/dist/puck/editor/VersionBuilder.d.ts +4 -2
  94. package/dist/puck/editor/VersionBuilder.js +42 -63
  95. package/dist/puck/editor/armWrites.js +1 -1
  96. package/dist/puck/editor/copy.d.ts +10 -6
  97. package/dist/puck/editor/copy.js +22 -12
  98. package/dist/puck/editor/editor.chrome.css +9 -8
  99. package/dist/puck/editor/editor.css +14 -9
  100. package/dist/puck/editor/placementsCache.d.ts +1 -1
  101. package/dist/puck/editor/placementsCache.js +9 -17
  102. package/dist/puck/editor/usePageSaveReadiness.d.ts +1 -4
  103. package/dist/puck/editor/usePageSaveReadiness.js +18 -21
  104. package/dist/puck/editor/usePlacementNotice.d.ts +2 -2
  105. package/dist/puck/editor/usePlacementNotice.js +4 -5
  106. package/dist/puck/nestedTestCopy.js +2 -2
  107. package/dist/puck/slotConfig.d.ts +1 -1
  108. package/dist/puck/slotConfig.js +1 -1
  109. package/dist/results/analyse.d.ts +2 -0
  110. package/dist/results/analyse.js +2 -2
  111. package/dist/results/verdict.d.ts +4 -4
  112. package/dist/results/verdict.js +13 -10
  113. package/dist/server/runResults.js +2 -1
  114. package/dist/testSurface/PreviewLinks.d.ts +2 -1
  115. package/dist/testSurface/PreviewLinks.js +3 -3
  116. package/dist/testSurface/actions/DecideDialog.d.ts +7 -4
  117. package/dist/testSurface/actions/DecideDialog.js +71 -59
  118. package/dist/testSurface/actions/LifecycleAction.d.ts +17 -0
  119. package/dist/testSurface/actions/LifecycleAction.js +107 -0
  120. package/dist/testSurface/actions/MakeContentResult.js +1 -1
  121. package/dist/testSurface/actions/actions.model.d.ts +13 -5
  122. package/dist/testSurface/actions/actions.model.js +75 -22
  123. package/dist/testSurface/actions/decide.model.d.ts +1 -0
  124. package/dist/testSurface/actions/decide.model.js +1 -0
  125. package/dist/testSurface/allocation.model.js +6 -3
  126. package/dist/testSurface/api.d.ts +4 -1
  127. package/dist/testSurface/api.js +22 -14
  128. package/dist/testSurface/copy/actions.d.ts +36 -14
  129. package/dist/testSurface/copy/actions.js +39 -17
  130. package/dist/testSurface/copy/advanced.d.ts +10 -0
  131. package/dist/testSurface/copy/advanced.js +10 -0
  132. package/dist/testSurface/copy/arms.d.ts +1 -1
  133. package/dist/testSurface/copy/arms.js +1 -1
  134. package/dist/testSurface/copy/audience.d.ts +4 -3
  135. package/dist/testSurface/copy/audience.js +5 -4
  136. package/dist/testSurface/copy/common.d.ts +6 -6
  137. package/dist/testSurface/copy/common.js +6 -6
  138. package/dist/testSurface/copy/metrics.d.ts +6 -0
  139. package/dist/testSurface/copy/metrics.js +8 -0
  140. package/dist/testSurface/copy/pages.d.ts +67 -7
  141. package/dist/testSurface/copy/pages.js +74 -7
  142. package/dist/testSurface/copy/readiness.d.ts +8 -6
  143. package/dist/testSurface/copy/readiness.js +19 -10
  144. package/dist/testSurface/copy/recommendation.d.ts +1 -22
  145. package/dist/testSurface/copy/recommendation.js +2 -22
  146. package/dist/testSurface/copy/results.d.ts +16 -10
  147. package/dist/testSurface/copy/results.js +19 -11
  148. package/dist/testSurface/copy/review.d.ts +13 -10
  149. package/dist/testSurface/copy/review.js +14 -10
  150. package/dist/testSurface/copy/setting.d.ts +1 -2
  151. package/dist/testSurface/copy/setting.js +1 -2
  152. package/dist/testSurface/copy/surface.d.ts +11 -2
  153. package/dist/testSurface/copy/surface.js +14 -11
  154. package/dist/testSurface/copy/testPage.d.ts +16 -10
  155. package/dist/testSurface/copy/testPage.js +24 -18
  156. package/dist/testSurface/format/date.d.ts +5 -2
  157. package/dist/testSurface/format/date.js +24 -8
  158. package/dist/testSurface/format/roundProgress.d.ts +6 -0
  159. package/dist/testSurface/format/roundProgress.js +15 -0
  160. package/dist/testSurface/format/useDateFormatter.d.ts +3 -0
  161. package/dist/testSurface/format/useDateFormatter.js +8 -0
  162. package/dist/testSurface/labels.d.ts +1 -2
  163. package/dist/testSurface/labels.js +2 -3
  164. package/dist/testSurface/lockedNotice.model.d.ts +2 -0
  165. package/dist/testSurface/lockedNotice.model.js +31 -0
  166. package/dist/testSurface/readPreflight.d.ts +0 -1
  167. package/dist/testSurface/readPreflight.js +0 -1
  168. package/dist/testSurface/results/CiChart.js +2 -1
  169. package/dist/testSurface/results/DataTable.d.ts +1 -1
  170. package/dist/testSurface/results/DataTable.js +4 -3
  171. package/dist/testSurface/results/VerdictHero.d.ts +1 -1
  172. package/dist/testSurface/results/legacy.d.ts +0 -5
  173. package/dist/testSurface/results/legacy.js +0 -14
  174. package/dist/testSurface/results/results.css +2 -2
  175. package/dist/testSurface/results/results.model.d.ts +8 -3
  176. package/dist/testSurface/results/results.model.js +25 -21
  177. package/dist/testSurface/results/snapshot.d.ts +2 -0
  178. package/dist/testSurface/results/snapshot.js +3 -0
  179. package/dist/testSurface/surface/contracts.d.ts +6 -1
  180. package/dist/testSurface/surface/editorPlacement.d.ts +1 -1
  181. package/dist/testSurface/surface/editorPlacement.js +1 -1
  182. package/dist/testSurface/surface/pageBlock/pageBlock.model.js +1 -1
  183. package/dist/testSurface/surface/pageBlock/parts.js +25 -12
  184. package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +8 -1
  185. package/dist/testSurface/surface/pagePicker/CopyRoute.js +243 -22
  186. package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +15 -4
  187. package/dist/testSurface/surface/pagePicker/PageCombobox.js +298 -209
  188. package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -10
  189. package/dist/testSurface/surface/pagePicker/pagePicker.model.d.ts +5 -3
  190. package/dist/testSurface/surface/pagePicker/pagePicker.model.js +17 -2
  191. package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +5 -3
  192. package/dist/testSurface/surface/readiness/ActionDialogs.js +213 -207
  193. package/dist/testSurface/surface/readiness/Banner.d.ts +5 -1
  194. package/dist/testSurface/surface/readiness/Banner.js +109 -148
  195. package/dist/testSurface/surface/readiness/SaveStatus.d.ts +5 -2
  196. package/dist/testSurface/surface/readiness/SaveStatus.js +8 -7
  197. package/dist/testSurface/surface/readiness/readiness.model.d.ts +14 -5
  198. package/dist/testSurface/surface/readiness/readiness.model.js +62 -12
  199. package/dist/testSurface/surface/readiness/useTransition.d.ts +3 -1
  200. package/dist/testSurface/surface/readiness/useTransition.js +49 -8
  201. package/dist/testSurface/surface/results/ReleasePages.d.ts +4 -3
  202. package/dist/testSurface/surface/results/ReleasePages.js +41 -41
  203. package/dist/testSurface/surface/results/ResultsBody.d.ts +7 -2
  204. package/dist/testSurface/surface/results/ResultsBody.js +170 -110
  205. package/dist/testSurface/surface/results/recommendation.model.d.ts +6 -9
  206. package/dist/testSurface/surface/results/recommendation.model.js +15 -59
  207. package/dist/testSurface/surface/results/useResults.d.ts +6 -2
  208. package/dist/testSurface/surface/setting/parts.js +31 -28
  209. package/dist/testSurface/surface/setting/setting.css +2 -1
  210. package/dist/testSurface/surface/test/AdvancedSection.js +10 -4
  211. package/dist/testSurface/surface/test/DeleteTest.d.ts +5 -1
  212. package/dist/testSurface/surface/test/DeleteTest.js +63 -55
  213. package/dist/testSurface/surface/test/GoalSection.js +11 -11
  214. package/dist/testSurface/surface/test/LengthSection.js +21 -13
  215. package/dist/testSurface/surface/test/PageHoldout.d.ts +1 -1
  216. package/dist/testSurface/surface/test/PageHoldout.js +7 -7
  217. package/dist/testSurface/surface/test/ReadinessBar.d.ts +2 -1
  218. package/dist/testSurface/surface/test/ReadinessBar.js +4 -10
  219. package/dist/testSurface/surface/test/Section.js +8 -0
  220. package/dist/testSurface/surface/test/TargetingSection.js +7 -2
  221. package/dist/testSurface/surface/test/TestSurface.js +17 -43
  222. package/dist/testSurface/surface/test/VersionsSection.js +93 -70
  223. package/dist/testSurface/surface/test/fields.d.ts +4 -3
  224. package/dist/testSurface/surface/test/fields.js +10 -16
  225. package/dist/testSurface/surface/test/pageParts.js +13 -7
  226. package/dist/testSurface/surface/test/testPage.css +9 -2
  227. package/dist/testSurface/surface/useTestDocument.d.ts +1 -3
  228. package/dist/testSurface/surface/useTestDocument.js +110 -52
  229. package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
  230. package/dist/testSurface/surface/watchTestDocument.js +181 -0
  231. package/dist/testSurface/surfaceUrls.d.ts +1 -0
  232. package/dist/testSurface/surfaceUrls.js +4 -0
  233. package/dist/testSurface/useApi.d.ts +3 -0
  234. package/dist/transitions/addMetric.d.ts +1 -1
  235. package/dist/transitions/addMetric.js +5 -1
  236. package/dist/transitions/kernel.d.ts +2 -0
  237. package/dist/transitions/kernel.js +1 -1
  238. package/dist/transitions/pageAddress.d.ts +6 -0
  239. package/dist/transitions/pageAddress.js +71 -0
  240. package/dist/transitions/pageVersions.d.ts +1 -1
  241. package/dist/transitions/preflightData.js +10 -2
  242. package/dist/transitions/start.d.ts +1 -1
  243. package/dist/transitions/start.js +8 -5
  244. package/dist/types/armKey.d.ts +2 -0
  245. package/dist/types/armKey.js +1 -0
  246. package/dist/types/contracts.d.ts +11 -1
  247. package/dist/types/endpoints.d.ts +38 -9
  248. package/dist/types/endpoints.js +1 -1
  249. package/dist/types/surface.d.ts +7 -9
  250. package/dist/ui/Dialog.d.ts +21 -2
  251. package/dist/ui/Dialog.js +101 -4
  252. package/dist/ui/Inputs.js +0 -1
  253. package/dist/ui/ui.css +5 -1
  254. 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 { ConfirmAction } from '../../testSurface/surface/readiness/ActionDialogs.js';
9
+ import { LifecycleButton, LifecycleDialog } from '../../testSurface/actions/LifecycleAction.js';
11
10
  import { actionWaitMessage } from '../../testSurface/surface/readiness/SaveStatus.js';
12
- import { useTransition } from '../../testSurface/surface/readiness/useTransition.js';
13
- import { createApi } from '../../testSurface/api.js';
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 action = availableActions({
14
+ const actions = availableActions({
19
15
  ...doc,
20
- canManage: surface.canManage
21
- }).find((item)=>doc.status === 'draft' || doc.status === 'stopped' ? item.id === 'start' : doc.status === 'running' && item.id === 'stop');
22
- if (!action) return null;
23
- const ready = !transition.checking && canStartTest(test, surface.editorPlacementMessage);
24
- const showAction = action.id !== 'start' || readyToStart(test, surface.editorPlacementMessage) && !test.hasUnsaved;
25
- const wait = action.id === 'start' ? actionWaitMessage(test) : undefined;
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 && action.id === 'start' && hasBrowserWritablePrimary(test.preflight, doc.metrics?.primary) ? /*#__PURE__*/ _jsx(Banner, {
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
- showAction && action.id === 'start' ? /*#__PURE__*/ _jsx("p", {
38
+ startVisible ? /*#__PURE__*/ _jsx("p", {
37
39
  role: "status",
38
40
  children: READINESS_COPY.ready
39
41
  }) : null,
40
- showAction && !test.statusReadPending ? /*#__PURE__*/ _jsx(Button, {
41
- disabled: transition.busy || confirm || action.id === 'start' && !ready,
42
- busy: transition.busy,
43
- onClick: ()=>{
44
- if (action.id === 'start' && doc.status !== 'stopped') void transition.run('start', ()=>createApi(surface.apiRoute).start(doc.id, doc.phase));
45
- else setConfirm(true);
46
- },
47
- children: action.label
48
- }) : null,
49
- transition.error ? /*#__PURE__*/ _jsx("p", {
50
- role: "alert",
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(ConfirmAction, {
54
- test: test,
55
- surface: surface,
56
- action: action,
57
- winnerLabel: "",
58
- onClose: ()=>setConfirm(false)
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 { Dialog } from '../../ui/Dialog.js';
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__*/ _jsx("div", {
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: attention ? /*#__PURE__*/ _jsx("span", {
150
- role: "alert",
151
- children: message
152
- }, "attention") : /*#__PURE__*/ _jsx("span", {
153
- children: message
154
- }, "rest")
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(Dialog, {
432
- open: true,
433
- title: C.removeTitle(arm.label),
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
- children: /*#__PURE__*/ _jsxs("div", {
438
- className: "xp-slot-drawer",
439
- children: [
440
- /*#__PURE__*/ _jsx("p", {
441
- children: C.removeHelp(count)
442
- }),
443
- shared === undefined ? /*#__PURE__*/ _jsx("p", {
444
- children: C.removeScopeUnknown
445
- }) : shared ? /*#__PURE__*/ _jsx("p", {
446
- children: C.removeShared
447
- }) : null,
448
- writes.errorFor(`remove:${arm.key}`) ? /*#__PURE__*/ _jsx("p", {
449
- role: "alert",
450
- className: "xp-ui-error",
451
- children: writes.errorFor(`remove:${arm.key}`)
452
- }) : null,
453
- /*#__PURE__*/ _jsxs("div", {
454
- className: "xp-ui-button-group",
455
- children: [
456
- /*#__PURE__*/ _jsx(Button, {
457
- "data-dialog-cancel": true,
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 Experiment block has no test yet.";
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 removeUncleared: "The version was removed from the test, but its content couldn't be cleared here. Delete it from the outline, then save the page.";
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: "Holdout visitors see the Original.";
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. Stop it on the test page to edit them.";
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
  };
@@ -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 Experiment block has no test yet.',
20
- draft: (label)=>`This block shows the ${label} to everyone until the test starts.`,
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. To keep the content without the test, move it out of this Experiment block on the canvas, then remove the Experiment block.`,
24
- archivedOriginal: (original, discarded)=>`${discarded ? 'Winner discarded' : 'Archived without a winner'}: this block shows ${original}, or nothing if it is empty. To keep it without the test, move its content out on the canvas, then remove this Experiment block.`,
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 = ARM_LABELS.control)=>`Add content to the ${label} before copying it.`,
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)=>`${label} already has content. Replace it with a copy of the ${original}?`,
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)=>`Delete ${label} content?`,
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)=>`Remove ${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
- removeUncleared: "The version was removed from the test, but its content couldn't be cleared here. Delete it from the outline, then save the page.",
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: 'Holdout visitors see the Original.',
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. Stop it on the test page to edit them.",
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 > .xp-ui-button { justify-self: start; }
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 > .xp-ui-button { justify-self: start; }
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, showingNotice?: boolean): () => void;
59
+ export declare function watchPlacementNotice(api: string, id: DocId, doc: Document, contentLocale?: string): () => void;
60
60
  export {};