@delmaredigital/payload-experiments 0.4.0-rc.3 → 0.4.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/dist/admin/LayerUsage.js +1 -1
  2. package/dist/admin/MetricSourceSelect.js +2 -2
  3. package/dist/admin/PlacementStatus.js +1 -1
  4. package/dist/admin/TestsDashboardCards.js +2 -2
  5. package/dist/admin/TestsNavLink.js +2 -2
  6. package/dist/admin/blocks/BlockPanel.js +3 -3
  7. package/dist/admin/blocks/TestBlockField.js +3 -3
  8. package/dist/admin/blocks/formApi.js +1 -1
  9. package/dist/admin/blocks/model.js +1 -1
  10. package/dist/admin/blocks/statusCache.js +1 -1
  11. package/dist/admin/components/RootViewMessage.js +1 -1
  12. package/dist/admin/copy/blocks.d.ts +2 -2
  13. package/dist/admin/copy/blocks.js +3 -2
  14. package/dist/admin/copy/goals.d.ts +5 -1
  15. package/dist/admin/copy/goals.js +9 -3
  16. package/dist/admin/goals/XpGoalField.js +155 -129
  17. package/dist/admin/goals/xpGoalField.css +2 -3
  18. package/dist/admin/status.model.js +1 -1
  19. package/dist/admin/surface/ResultsRoute.d.ts +2 -1
  20. package/dist/admin/surface/ResultsRoute.js +6 -13
  21. package/dist/admin/surface/SurfaceShell.js +2 -2
  22. package/dist/admin/surface/TestsHome.d.ts +1 -1
  23. package/dist/admin/surface/TestsHome.js +3 -3
  24. package/dist/admin/surface/TestsSurface.js +2 -2
  25. package/dist/admin/surface/goals/GoalForm.d.ts +1 -1
  26. package/dist/admin/surface/goals/GoalForm.js +55 -7
  27. package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
  28. package/dist/admin/surface/goals/GoalsList.js +4 -4
  29. package/dist/admin/surface/goals/data.js +2 -2
  30. package/dist/admin/surface/goals/goals.css +7 -0
  31. package/dist/admin/surface/goals/goals.model.d.ts +11 -1
  32. package/dist/admin/surface/goals/goals.model.js +43 -0
  33. package/dist/admin/surface/home.model.d.ts +1 -1
  34. package/dist/admin/surface/home.model.js +5 -5
  35. package/dist/admin/surface/newTest/NewTest.d.ts +1 -1
  36. package/dist/admin/surface/newTest/NewTest.js +1 -1
  37. package/dist/admin/surface/newTest/PageWizard.d.ts +1 -1
  38. package/dist/admin/surface/newTest/PageWizard.js +23 -25
  39. package/dist/admin/surface/results/ResultsHeader.d.ts +2 -2
  40. package/dist/admin/surface/results/ResultsHeader.js +22 -15
  41. package/dist/admin/surface/test/TestPage.d.ts +1 -2
  42. package/dist/admin/surface/test/TestPage.js +45 -156
  43. package/dist/admin/views/ExperimentsRootView.js +1 -1
  44. package/dist/admin/views/TestsNavLinkServer.js +1 -1
  45. package/dist/admin/views/renderCollectionList.js +1 -1
  46. package/dist/admin/views/renderTestsSurface.js +1 -1
  47. package/dist/blocks/placementLocale.d.ts +21 -0
  48. package/dist/blocks/placementLocale.js +115 -0
  49. package/dist/collections/experiments/config.js +1 -1
  50. package/dist/collections/metrics.js +1 -1
  51. package/dist/db/bulkPlacementRemoval.d.ts +30 -0
  52. package/dist/db/bulkPlacementRemoval.js +107 -0
  53. package/dist/db/placements.d.ts +2 -0
  54. package/dist/db/placements.js +8 -0
  55. package/dist/endpoints/editorSurface.d.ts +3 -0
  56. package/dist/endpoints/editorSurface.js +31 -0
  57. package/dist/endpoints/index.js +28 -1
  58. package/dist/errors.d.ts +1 -0
  59. package/dist/errors.js +2 -0
  60. package/dist/fields/xpGoal.js +1 -1
  61. package/dist/goals/fairness.d.ts +1 -1
  62. package/dist/goals/fairness.js +1 -1
  63. package/dist/goals/picker/clickGoalPicker.model.d.ts +8 -1
  64. package/dist/goals/picker/clickGoalPicker.model.js +20 -2
  65. package/dist/goals/picker/copy.d.ts +4 -2
  66. package/dist/goals/picker/copy.js +4 -2
  67. package/dist/goals/picker/useClickGoalPicker.d.ts +1 -1
  68. package/dist/goals/picker/useClickGoalPicker.js +4 -2
  69. package/dist/hooks/blockRemovalRule.d.ts +29 -0
  70. package/dist/hooks/blockRemovalRule.js +141 -0
  71. package/dist/hooks/pageGuard.d.ts +24 -2
  72. package/dist/hooks/pageGuard.js +178 -24
  73. package/dist/lib/placementPages.d.ts +9 -0
  74. package/dist/{admin/previewLinks.model.js → lib/placementPages.js} +1 -4
  75. package/dist/onInit.js +22 -0
  76. package/dist/plugin.js +2 -1
  77. package/dist/puck/ExperimentPicker.js +25 -10
  78. package/dist/puck/copy.d.ts +4 -1
  79. package/dist/puck/copy.js +4 -1
  80. package/dist/puck/editor/ConfigureTestDrawer.d.ts +21 -0
  81. package/dist/puck/editor/ConfigureTestDrawer.js +147 -0
  82. package/dist/puck/editor/CreateExperimentDrawer.d.ts +11 -2
  83. package/dist/puck/editor/CreateExperimentDrawer.js +73 -9
  84. package/dist/puck/editor/EditorControls.d.ts +14 -0
  85. package/dist/puck/editor/EditorControls.js +99 -0
  86. package/dist/puck/editor/ExperimentSlotEditor.js +690 -79
  87. package/dist/puck/editor/LeftoverVersions.d.ts +13 -0
  88. package/dist/puck/editor/LeftoverVersions.js +115 -0
  89. package/dist/puck/editor/PlacementNotice.d.ts +8 -0
  90. package/dist/puck/editor/PlacementNotice.js +22 -0
  91. package/dist/puck/editor/QuickTestActions.d.ts +3 -0
  92. package/dist/puck/editor/QuickTestActions.js +50 -0
  93. package/dist/puck/editor/ResultsReadout.js +8 -5
  94. package/dist/puck/editor/VersionBuilder.d.ts +20 -6
  95. package/dist/puck/editor/VersionBuilder.js +80 -50
  96. package/dist/puck/editor/armWrites.d.ts +3 -1
  97. package/dist/puck/editor/armWrites.js +2 -1
  98. package/dist/puck/editor/armsCache.d.ts +3 -1
  99. package/dist/puck/editor/armsCache.js +20 -3
  100. package/dist/puck/editor/cloneSlot.d.ts +2 -0
  101. package/dist/puck/editor/cloneSlot.js +7 -0
  102. package/dist/puck/editor/copy.d.ts +42 -5
  103. package/dist/puck/editor/copy.js +43 -6
  104. package/dist/puck/editor/editor.chrome.css +44 -0
  105. package/dist/puck/editor/editor.css +68 -0
  106. package/dist/puck/editor/editor.model.d.ts +14 -0
  107. package/dist/puck/editor/editor.model.js +58 -1
  108. package/dist/puck/editor/editorSurface.d.ts +10 -0
  109. package/dist/puck/editor/editorSurface.js +65 -0
  110. package/dist/puck/editor/experimentOutlinePlugin.js +96 -28
  111. package/dist/puck/editor/localPlacements.d.ts +2 -0
  112. package/dist/puck/editor/localPlacements.js +29 -0
  113. package/dist/puck/editor/outlineVersion.d.ts +5 -0
  114. package/dist/puck/editor/outlineVersion.js +36 -0
  115. package/dist/puck/editor/placementsCache.d.ts +50 -0
  116. package/dist/puck/editor/placementsCache.js +258 -0
  117. package/dist/puck/editor/sidebar.d.ts +12 -0
  118. package/dist/puck/editor/sidebar.js +77 -0
  119. package/dist/puck/editor/usePlacementNotice.d.ts +3 -0
  120. package/dist/puck/editor/usePlacementNotice.js +14 -0
  121. package/dist/puck/editor/xpGoalPuckEditorField.js +109 -98
  122. package/dist/puck/experimentSlotField.d.ts +3 -0
  123. package/dist/puck/experimentSlotField.js +15 -4
  124. package/dist/{admin → testSurface}/actions/DecideDialog.d.ts +2 -1
  125. package/dist/{admin → testSurface}/actions/DecideDialog.js +6 -4
  126. package/dist/{admin → testSurface}/api.js +5 -6
  127. package/dist/{admin → testSurface}/copy/common.d.ts +3 -1
  128. package/dist/{admin → testSurface}/copy/common.js +5 -1
  129. package/dist/{admin → testSurface}/copy/readiness.d.ts +20 -1
  130. package/dist/{admin → testSurface}/copy/readiness.js +25 -1
  131. package/dist/{admin → testSurface}/copy/testPage.d.ts +4 -0
  132. package/dist/{admin → testSurface}/copy/testPage.js +8 -2
  133. package/dist/testSurface/format/adminURL.d.ts +7 -0
  134. package/dist/testSurface/format/adminURL.js +9 -0
  135. package/dist/{admin → testSurface}/placements/placementLabels.js +1 -1
  136. package/dist/{admin → testSurface}/previewLinks.model.d.ts +1 -6
  137. package/dist/testSurface/previewLinks.model.js +4 -0
  138. package/dist/testSurface/readPreflight.d.ts +9 -0
  139. package/dist/testSurface/readPreflight.js +38 -0
  140. package/dist/testSurface/readinessRead.d.ts +50 -0
  141. package/dist/testSurface/readinessRead.js +46 -0
  142. package/dist/testSurface/results/results.css +64 -0
  143. package/dist/{admin → testSurface}/surface/contracts.d.ts +7 -2
  144. package/dist/testSurface/surface/editorPlacement.d.ts +21 -0
  145. package/dist/testSurface/surface/editorPlacement.js +60 -0
  146. package/dist/{admin → testSurface}/surface/pageBlock/parts.js +19 -9
  147. package/dist/testSurface/surface/pagePicker/pagePicker.css +10 -0
  148. package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.js +37 -7
  149. package/dist/testSurface/surface/readiness/Banner.d.ts +2 -0
  150. package/dist/{admin → testSurface}/surface/readiness/Banner.js +106 -68
  151. package/dist/testSurface/surface/readiness/BlockerList.d.ts +11 -0
  152. package/dist/testSurface/surface/readiness/BlockerList.js +31 -0
  153. package/dist/testSurface/surface/readiness/SaveStatus.d.ts +9 -0
  154. package/dist/testSurface/surface/readiness/SaveStatus.js +66 -0
  155. package/dist/{admin → testSurface}/surface/readiness/parts.js +0 -2
  156. package/dist/{admin → testSurface}/surface/readiness/readiness.model.d.ts +13 -0
  157. package/dist/{admin → testSurface}/surface/readiness/readiness.model.js +51 -36
  158. package/dist/{admin → testSurface}/surface/readiness/useTransition.d.ts +5 -2
  159. package/dist/testSurface/surface/readiness/useTransition.js +98 -0
  160. package/dist/{admin → testSurface}/surface/results/ResultsBody.d.ts +2 -2
  161. package/dist/{admin → testSurface}/surface/results/ResultsBody.js +18 -11
  162. package/dist/testSurface/surface/setting/setting.css +17 -0
  163. package/dist/{admin → testSurface}/surface/test/AdvancedSection.js +1 -0
  164. package/dist/testSurface/surface/test/GoalSection.d.ts +4 -0
  165. package/dist/{admin → testSurface}/surface/test/GoalSection.js +4 -2
  166. package/dist/testSurface/surface/test/LengthSection.d.ts +2 -0
  167. package/dist/{admin → testSurface}/surface/test/LengthSection.js +2 -1
  168. package/dist/{admin → testSurface}/surface/test/Rail.js +7 -4
  169. package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +1 -2
  170. package/dist/{admin → testSurface}/surface/test/Section.d.ts +3 -1
  171. package/dist/testSurface/surface/test/Section.js +80 -0
  172. package/dist/{admin → testSurface}/surface/test/TargetingSection.js +5 -0
  173. package/dist/testSurface/surface/test/TestSurface.d.ts +19 -0
  174. package/dist/testSurface/surface/test/TestSurface.js +213 -0
  175. package/dist/testSurface/surface/test/VersionsSection.d.ts +5 -0
  176. package/dist/{admin → testSurface}/surface/test/VersionsSection.js +13 -6
  177. package/dist/testSurface/surface/test/testPage.css +104 -0
  178. package/dist/{admin → testSurface}/surface/useTestDocument.d.ts +9 -2
  179. package/dist/{admin → testSurface}/surface/useTestDocument.js +92 -46
  180. package/dist/{admin → testSurface}/surfaceUrls.js +1 -1
  181. package/dist/testSurface/useReadinessPolling.d.ts +3 -0
  182. package/dist/testSurface/useReadinessPolling.js +24 -0
  183. package/dist/transitions/placementInteractions.js +1 -1
  184. package/dist/transitions/placements.d.ts +27 -8
  185. package/dist/transitions/placements.js +77 -6
  186. package/dist/transitions/preflightData.js +1 -1
  187. package/dist/transitions/start.js +2 -2
  188. package/dist/types/endpoints.d.ts +1 -1
  189. package/dist/ui/Card.d.ts +2 -1
  190. package/dist/ui/Card.js +4 -4
  191. package/dist/ui/Dialog.d.ts +4 -1
  192. package/dist/ui/Dialog.js +41 -3
  193. package/dist/ui/Drawer.d.ts +10 -0
  194. package/dist/ui/Drawer.js +29 -0
  195. package/dist/ui/Tabs.d.ts +4 -3
  196. package/dist/ui/Tabs.js +47 -32
  197. package/dist/ui/ui.css +24 -0
  198. package/package.json +1 -1
  199. package/dist/admin/actions/ConfirmDialog.d.ts +0 -19
  200. package/dist/admin/actions/ConfirmDialog.js +0 -149
  201. package/dist/admin/results/results.css +0 -64
  202. package/dist/admin/styles.css +0 -10
  203. package/dist/admin/styles.d.ts +0 -2
  204. package/dist/admin/styles.js +0 -3
  205. package/dist/admin/surface/pagePicker/pagePicker.css +0 -10
  206. package/dist/admin/surface/readiness/Banner.d.ts +0 -5
  207. package/dist/admin/surface/readiness/SaveStatus.d.ts +0 -5
  208. package/dist/admin/surface/readiness/SaveStatus.js +0 -53
  209. package/dist/admin/surface/readiness/useTransition.js +0 -35
  210. package/dist/admin/surface/setting/setting.css +0 -17
  211. package/dist/admin/surface/test/GoalSection.d.ts +0 -2
  212. package/dist/admin/surface/test/LengthSection.d.ts +0 -2
  213. package/dist/admin/surface/test/Section.js +0 -48
  214. package/dist/admin/surface/test/VersionsSection.d.ts +0 -4
  215. package/dist/admin/surface/test/testPage.css +0 -92
  216. /package/dist/{admin → testSurface}/PreviewLinks.d.ts +0 -0
  217. /package/dist/{admin → testSurface}/PreviewLinks.js +0 -0
  218. /package/dist/{admin → testSurface}/actions/MakeContentResult.d.ts +0 -0
  219. /package/dist/{admin → testSurface}/actions/MakeContentResult.js +0 -0
  220. /package/dist/{admin → testSurface}/actions/actions.model.d.ts +0 -0
  221. /package/dist/{admin → testSurface}/actions/actions.model.js +0 -0
  222. /package/dist/{admin → testSurface}/actions/decide.model.d.ts +0 -0
  223. /package/dist/{admin → testSurface}/actions/decide.model.js +0 -0
  224. /package/dist/{admin → testSurface}/allocation.model.d.ts +0 -0
  225. /package/dist/{admin → testSurface}/allocation.model.js +0 -0
  226. /package/dist/{admin → testSurface}/api.d.ts +0 -0
  227. /package/dist/{admin → testSurface}/arms/arms.model.d.ts +0 -0
  228. /package/dist/{admin → testSurface}/arms/arms.model.js +0 -0
  229. /package/dist/{admin → testSurface}/arms/pageTarget.model.d.ts +0 -0
  230. /package/dist/{admin → testSurface}/arms/pageTarget.model.js +0 -0
  231. /package/dist/{admin → testSurface}/arms/params.model.d.ts +0 -0
  232. /package/dist/{admin → testSurface}/arms/params.model.js +0 -0
  233. /package/dist/{admin → testSurface}/copy/actions.d.ts +0 -0
  234. /package/dist/{admin → testSurface}/copy/actions.js +0 -0
  235. /package/dist/{admin → testSurface}/copy/advanced.d.ts +0 -0
  236. /package/dist/{admin → testSurface}/copy/advanced.js +0 -0
  237. /package/dist/{admin → testSurface}/copy/arms.d.ts +0 -0
  238. /package/dist/{admin → testSurface}/copy/arms.js +0 -0
  239. /package/dist/{admin → testSurface}/copy/audience.d.ts +0 -0
  240. /package/dist/{admin → testSurface}/copy/audience.js +0 -0
  241. /package/dist/{admin → testSurface}/copy/metrics.d.ts +0 -0
  242. /package/dist/{admin → testSurface}/copy/metrics.js +0 -0
  243. /package/dist/{admin → testSurface}/copy/pages.d.ts +0 -0
  244. /package/dist/{admin → testSurface}/copy/pages.js +0 -0
  245. /package/dist/{admin → testSurface}/copy/recommendation.d.ts +0 -0
  246. /package/dist/{admin → testSurface}/copy/recommendation.js +0 -0
  247. /package/dist/{admin → testSurface}/copy/results.d.ts +0 -0
  248. /package/dist/{admin → testSurface}/copy/results.js +0 -0
  249. /package/dist/{admin → testSurface}/copy/review.d.ts +0 -0
  250. /package/dist/{admin → testSurface}/copy/review.js +0 -0
  251. /package/dist/{admin → testSurface}/copy/setting.d.ts +0 -0
  252. /package/dist/{admin → testSurface}/copy/setting.js +0 -0
  253. /package/dist/{admin → testSurface}/copy/surface.d.ts +0 -0
  254. /package/dist/{admin → testSurface}/copy/surface.js +0 -0
  255. /package/dist/{admin → testSurface}/format/date.d.ts +0 -0
  256. /package/dist/{admin → testSurface}/format/date.js +0 -0
  257. /package/dist/{admin → testSurface}/labels.d.ts +0 -0
  258. /package/dist/{admin → testSurface}/labels.js +0 -0
  259. /package/dist/{admin → testSurface}/lockedNotice.model.d.ts +0 -0
  260. /package/dist/{admin → testSurface}/lockedNotice.model.js +0 -0
  261. /package/dist/{admin → testSurface}/metricSource.model.d.ts +0 -0
  262. /package/dist/{admin → testSurface}/metricSource.model.js +0 -0
  263. /package/dist/{admin → testSurface}/placements/placementLabels.d.ts +0 -0
  264. /package/dist/{admin → testSurface}/placements/placementLabels.model.d.ts +0 -0
  265. /package/dist/{admin → testSurface}/placements/placementLabels.model.js +0 -0
  266. /package/dist/{admin → testSurface}/placements/usePlacementLabels.d.ts +0 -0
  267. /package/dist/{admin → testSurface}/placements/usePlacementLabels.js +0 -0
  268. /package/dist/{admin → testSurface}/reload.d.ts +0 -0
  269. /package/dist/{admin → testSurface}/reload.js +0 -0
  270. /package/dist/{admin → testSurface}/results/CappedCell.d.ts +0 -0
  271. /package/dist/{admin → testSurface}/results/CappedCell.js +0 -0
  272. /package/dist/{admin → testSurface}/results/CiChart.d.ts +0 -0
  273. /package/dist/{admin → testSurface}/results/CiChart.js +0 -0
  274. /package/dist/{admin → testSurface}/results/DataQualityPanel.d.ts +0 -0
  275. /package/dist/{admin → testSurface}/results/DataQualityPanel.js +0 -0
  276. /package/dist/{admin → testSurface}/results/DataTable.d.ts +0 -0
  277. /package/dist/{admin → testSurface}/results/DataTable.js +0 -0
  278. /package/dist/{admin → testSurface}/results/StatTile.d.ts +0 -0
  279. /package/dist/{admin → testSurface}/results/StatTile.js +0 -0
  280. /package/dist/{admin → testSurface}/results/VerdictHero.d.ts +0 -0
  281. /package/dist/{admin → testSurface}/results/VerdictHero.js +0 -0
  282. /package/dist/{admin → testSurface}/results/chart.model.d.ts +0 -0
  283. /package/dist/{admin → testSurface}/results/chart.model.js +0 -0
  284. /package/dist/{admin → testSurface}/results/format.d.ts +0 -0
  285. /package/dist/{admin → testSurface}/results/format.js +0 -0
  286. /package/dist/{admin → testSurface}/results/legacy.d.ts +0 -0
  287. /package/dist/{admin → testSurface}/results/legacy.js +0 -0
  288. /package/dist/{admin → testSurface}/results/releasePages.model.d.ts +0 -0
  289. /package/dist/{admin → testSurface}/results/releasePages.model.js +0 -0
  290. /package/dist/{admin → testSurface}/results/results.model.d.ts +0 -0
  291. /package/dist/{admin → testSurface}/results/results.model.js +0 -0
  292. /package/dist/{admin → testSurface}/results/snapshot.d.ts +0 -0
  293. /package/dist/{admin → testSurface}/results/snapshot.js +0 -0
  294. /package/dist/{admin → testSurface}/review/review.model.d.ts +0 -0
  295. /package/dist/{admin → testSurface}/review/review.model.js +0 -0
  296. /package/dist/{admin → testSurface}/surface/contracts.js +0 -0
  297. /package/dist/{admin → testSurface}/surface/pageBlock/pageBlock.model.d.ts +0 -0
  298. /package/dist/{admin → testSurface}/surface/pageBlock/pageBlock.model.js +0 -0
  299. /package/dist/{admin → testSurface}/surface/pageBlock/parts.d.ts +0 -0
  300. /package/dist/{admin → testSurface}/surface/pagePicker/CopyRoute.d.ts +0 -0
  301. /package/dist/{admin → testSurface}/surface/pagePicker/CopyRoute.js +0 -0
  302. /package/dist/{admin → testSurface}/surface/pagePicker/PageCombobox.d.ts +0 -0
  303. /package/dist/{admin → testSurface}/surface/pagePicker/PageCombobox.js +0 -0
  304. /package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.d.ts +0 -0
  305. /package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.js +0 -0
  306. /package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.d.ts +0 -0
  307. /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
  308. /package/dist/{admin → testSurface}/surface/results/ReleasePages.d.ts +0 -0
  309. /package/dist/{admin → testSurface}/surface/results/ReleasePages.js +0 -0
  310. /package/dist/{admin → testSurface}/surface/results/recommendation.model.d.ts +0 -0
  311. /package/dist/{admin → testSurface}/surface/results/recommendation.model.js +0 -0
  312. /package/dist/{admin → testSurface}/surface/results/useResults.d.ts +0 -0
  313. /package/dist/{admin → testSurface}/surface/results/useResults.js +0 -0
  314. /package/dist/{admin → testSurface}/surface/setting/parts.d.ts +0 -0
  315. /package/dist/{admin → testSurface}/surface/setting/parts.js +0 -0
  316. /package/dist/{admin → testSurface}/surface/setting/setting.model.d.ts +0 -0
  317. /package/dist/{admin → testSurface}/surface/setting/setting.model.js +0 -0
  318. /package/dist/{admin → testSurface}/surface/test/AdvancedSection.d.ts +0 -0
  319. /package/dist/{admin → testSurface}/surface/test/PageHoldout.d.ts +0 -0
  320. /package/dist/{admin → testSurface}/surface/test/PageHoldout.js +0 -0
  321. /package/dist/{admin → testSurface}/surface/test/Rail.d.ts +0 -0
  322. /package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +0 -0
  323. /package/dist/{admin → testSurface}/surface/test/TargetingSection.d.ts +0 -0
  324. /package/dist/{admin → testSurface}/surface/test/fields.d.ts +0 -0
  325. /package/dist/{admin → testSurface}/surface/test/fields.js +0 -0
  326. /package/dist/{admin → testSurface}/surface/test/jumpToSection.d.ts +0 -0
  327. /package/dist/{admin → testSurface}/surface/test/jumpToSection.js +0 -0
  328. /package/dist/{admin → testSurface}/surface/test/pageParts.d.ts +0 -0
  329. /package/dist/{admin → testSurface}/surface/test/pageParts.js +0 -0
  330. /package/dist/{admin → testSurface}/surface/test/testPage.model.d.ts +0 -0
  331. /package/dist/{admin → testSurface}/surface/test/testPage.model.js +0 -0
  332. /package/dist/{admin → testSurface}/surface/testDocument.model.d.ts +0 -0
  333. /package/dist/{admin → testSurface}/surface/testDocument.model.js +0 -0
  334. /package/dist/{admin → testSurface}/surfaceUrls.d.ts +0 -0
  335. /package/dist/{admin → testSurface}/targeting/targeting.model.d.ts +0 -0
  336. /package/dist/{admin → testSurface}/targeting/targeting.model.js +0 -0
  337. /package/dist/{admin → testSurface}/theme.d.ts +0 -0
  338. /package/dist/{admin → testSurface}/theme.js +0 -0
  339. /package/dist/{admin → testSurface}/useApi.d.ts +0 -0
  340. /package/dist/{admin → testSurface}/useApi.js +0 -0
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useId } from 'react';
4
4
  import { useClickGoalPicker } from '../../goals/picker/useClickGoalPicker.js';
5
+ import { clickGoalOptions } from '../../goals/picker/clickGoalPicker.model.js';
5
6
  import { CLICK_GOAL_COPY as C } from '../../goals/picker/copy.js';
6
7
  import { TextInput, Select } from '../../ui/Inputs.js';
7
8
  import { Button } from '../../ui/Button.js';
@@ -9,8 +10,11 @@ import { resolvePuckRoutes } from '../routes.js';
9
10
  import './editor.css';
10
11
  function XpGoalPuckEditor({ value, onChange, api, readOnly }) {
11
12
  const picker = useClickGoalPicker(api, {
13
+ enabled: !readOnly,
12
14
  onSelect: onChange
13
15
  });
16
+ const { options, missing } = clickGoalOptions(picker.status, picker.goals, value ?? '');
17
+ const readonly = readOnly || picker.status === 'not-manager';
14
18
  const id = useId();
15
19
  const stopEnter = (event)=>{
16
20
  if (event.key === 'Enter') {
@@ -21,108 +25,115 @@ function XpGoalPuckEditor({ value, onChange, api, readOnly }) {
21
25
  return /*#__PURE__*/ _jsxs("div", {
22
26
  className: "xp-slot-root xp-puck-field",
23
27
  children: [
24
- /*#__PURE__*/ _jsx(TextInput, {
25
- id: `${id}-value`,
26
- label: C.label,
27
- value: value ?? '',
28
- readOnly: readOnly,
29
- onChange: (event)=>onChange(event.currentTarget.value)
30
- }),
31
- picker.canManage && !readOnly ? /*#__PURE__*/ _jsxs(_Fragment, {
28
+ readonly ? /*#__PURE__*/ _jsxs("div", {
29
+ className: "xp-ui-field",
32
30
  children: [
33
- /*#__PURE__*/ _jsxs("div", {
34
- className: "xp-ui-inline-row",
35
- children: [
36
- /*#__PURE__*/ _jsxs(Select, {
37
- id: `${id}-picker`,
38
- label: C.choose,
39
- value: picker.goals.some((goal)=>goal.slug === value) ? value : '',
40
- onChange: (event)=>{
41
- if (event.currentTarget.value) onChange(event.currentTarget.value);
42
- },
43
- children: [
44
- /*#__PURE__*/ _jsx("option", {
45
- value: "",
46
- children: C.choose
47
- }),
48
- picker.goals.map((goal)=>/*#__PURE__*/ _jsx("option", {
49
- value: goal.slug,
50
- children: goal.name
51
- }, goal.id))
52
- ]
53
- }),
54
- !picker.panel.open ? /*#__PURE__*/ _jsx(Button, {
55
- type: "button",
56
- onClick: picker.open,
57
- children: C.newGoal
58
- }) : null
59
- ]
31
+ /*#__PURE__*/ _jsx("span", {
32
+ children: C.label
60
33
  }),
61
- picker.undefinedKey(value ?? '') ? /*#__PURE__*/ _jsx("p", {
62
- className: "xp-ui-help",
63
- role: "status",
64
- children: C.undefinedKey
65
- }) : null,
66
- picker.panel.open ? /*#__PURE__*/ _jsxs("section", {
67
- className: "xp-ui-subpanel",
68
- "aria-labelledby": `${id}-title`,
69
- children: [
70
- /*#__PURE__*/ _jsx("h3", {
71
- id: `${id}-title`,
72
- children: C.title
73
- }),
74
- /*#__PURE__*/ _jsx(TextInput, {
75
- id: `${id}-name`,
76
- label: C.name,
77
- value: picker.panel.name,
78
- disabled: picker.panel.pending,
79
- onKeyDown: stopEnter,
80
- onChange: (event)=>picker.setName(event.currentTarget.value)
81
- }),
82
- /*#__PURE__*/ _jsxs("details", {
83
- open: picker.panel.advanced,
84
- onToggle: (event)=>picker.setAdvanced(event.currentTarget.open),
85
- children: [
86
- /*#__PURE__*/ _jsx("summary", {
87
- children: C.advanced
88
- }),
89
- /*#__PURE__*/ _jsx(TextInput, {
90
- id: `${id}-slug`,
91
- label: C.slug,
92
- value: picker.panel.slug,
93
- disabled: picker.panel.pending,
94
- onKeyDown: stopEnter,
95
- error: picker.panel.errors.slug,
96
- onChange: (event)=>picker.setSlug(event.currentTarget.value)
97
- })
98
- ]
99
- }),
100
- picker.panel.errors.general ? /*#__PURE__*/ _jsx("p", {
101
- className: "xp-ui-error",
102
- role: "alert",
103
- children: picker.panel.errors.general
104
- }) : null,
105
- /*#__PURE__*/ _jsxs("div", {
106
- className: "xp-ui-button-group",
107
- children: [
108
- /*#__PURE__*/ _jsx(Button, {
109
- type: "button",
110
- variant: "primary",
111
- disabled: picker.panel.pending || !picker.panel.name.trim(),
112
- onClick: ()=>void picker.create(),
113
- children: C.createGoal
114
- }),
115
- /*#__PURE__*/ _jsx(Button, {
116
- type: "button",
117
- disabled: picker.panel.pending,
118
- onClick: picker.cancel,
119
- children: C.cancel
120
- })
121
- ]
122
- })
123
- ]
34
+ /*#__PURE__*/ _jsx("p", {
35
+ children: value || C.none
36
+ })
37
+ ]
38
+ }) : /*#__PURE__*/ _jsxs("div", {
39
+ className: "xp-ui-inline-row",
40
+ children: [
41
+ /*#__PURE__*/ _jsx(Select, {
42
+ id: `${id}-picker`,
43
+ label: C.label,
44
+ value: value ?? '',
45
+ disabled: picker.status !== 'ready',
46
+ onChange: (event)=>onChange(event.currentTarget.value),
47
+ children: options.map((option)=>/*#__PURE__*/ _jsx("option", {
48
+ value: option.value,
49
+ children: option.label
50
+ }, option.value))
51
+ }),
52
+ picker.canManage && !picker.panel.open ? /*#__PURE__*/ _jsx(Button, {
53
+ type: "button",
54
+ onClick: picker.open,
55
+ children: C.newGoal
124
56
  }) : null
125
57
  ]
58
+ }),
59
+ !readonly && picker.status === 'error' ? /*#__PURE__*/ _jsxs("div", {
60
+ children: [
61
+ /*#__PURE__*/ _jsx("p", {
62
+ className: "xp-ui-help",
63
+ children: C.loadError
64
+ }),
65
+ /*#__PURE__*/ _jsx(Button, {
66
+ type: "button",
67
+ onClick: picker.retry,
68
+ children: C.retry
69
+ })
70
+ ]
71
+ }) : null,
72
+ missing && !readonly ? /*#__PURE__*/ _jsx("p", {
73
+ className: "xp-ui-help",
74
+ role: "status",
75
+ children: C.undefinedKey
76
+ }) : null,
77
+ picker.canManage && !readOnly ? /*#__PURE__*/ _jsx(_Fragment, {
78
+ children: picker.panel.open ? /*#__PURE__*/ _jsxs("section", {
79
+ className: "xp-ui-subpanel",
80
+ "aria-labelledby": `${id}-title`,
81
+ children: [
82
+ /*#__PURE__*/ _jsx("h3", {
83
+ id: `${id}-title`,
84
+ children: C.title
85
+ }),
86
+ /*#__PURE__*/ _jsx(TextInput, {
87
+ id: `${id}-name`,
88
+ label: C.name,
89
+ value: picker.panel.name,
90
+ disabled: picker.panel.pending,
91
+ onKeyDown: stopEnter,
92
+ onChange: (event)=>picker.setName(event.currentTarget.value)
93
+ }),
94
+ /*#__PURE__*/ _jsxs("details", {
95
+ open: picker.panel.advanced,
96
+ onToggle: (event)=>picker.setAdvanced(event.currentTarget.open),
97
+ children: [
98
+ /*#__PURE__*/ _jsx("summary", {
99
+ children: C.advanced
100
+ }),
101
+ /*#__PURE__*/ _jsx(TextInput, {
102
+ id: `${id}-slug`,
103
+ label: C.slug,
104
+ value: picker.panel.slug,
105
+ disabled: picker.panel.pending,
106
+ onKeyDown: stopEnter,
107
+ error: picker.panel.errors.slug,
108
+ onChange: (event)=>picker.setSlug(event.currentTarget.value)
109
+ })
110
+ ]
111
+ }),
112
+ picker.panel.errors.general ? /*#__PURE__*/ _jsx("p", {
113
+ className: "xp-ui-error",
114
+ role: "alert",
115
+ children: picker.panel.errors.general
116
+ }) : null,
117
+ /*#__PURE__*/ _jsxs("div", {
118
+ className: "xp-ui-button-group",
119
+ children: [
120
+ /*#__PURE__*/ _jsx(Button, {
121
+ type: "button",
122
+ variant: "primary",
123
+ disabled: picker.panel.pending || !picker.panel.name.trim(),
124
+ onClick: ()=>void picker.create(),
125
+ children: C.createGoal
126
+ }),
127
+ /*#__PURE__*/ _jsx(Button, {
128
+ type: "button",
129
+ disabled: picker.panel.pending,
130
+ onClick: picker.cancel,
131
+ children: C.cancel
132
+ })
133
+ ]
134
+ })
135
+ ]
136
+ }) : null
126
137
  }) : null
127
138
  ]
128
139
  });
@@ -1,7 +1,10 @@
1
+ import { type ReactNode } from 'react';
1
2
  import type { CustomField } from '@puckeditor/core';
2
3
  import type { ExperimentRef } from '../types/puck.js';
3
4
  import { type PuckRoutes } from './routes.js';
4
5
  export declare function createExperimentSlotField(opts?: {
5
6
  label?: string;
6
7
  routes?: PuckRoutes;
8
+ renderActions?: (experiment: ExperimentRef) => ReactNode;
9
+ onBind?: (previous: ExperimentRef | null, next: ExperimentRef | null) => void;
7
10
  }): CustomField<ExperimentRef | null>;
@@ -12,10 +12,21 @@ export function createExperimentSlotField(opts) {
12
12
  routes,
13
13
  children: createElement('div', {
14
14
  className: 'xp-puck-field'
15
- }, createElement(ExperimentPicker, {
16
- value,
17
- onChange
18
- }))
15
+ }, ...opts?.renderActions ? [
16
+ createElement(ExperimentPicker, {
17
+ value,
18
+ onChange: (next)=>{
19
+ opts?.onBind?.(value, next);
20
+ onChange(next);
21
+ }
22
+ }),
23
+ value ? opts.renderActions(value) : null
24
+ ] : [
25
+ createElement(ExperimentPicker, {
26
+ value,
27
+ onChange
28
+ })
29
+ ])
19
30
  })
20
31
  };
21
32
  }
@@ -1,8 +1,9 @@
1
1
  import type { DocId } from '../../types/contracts.js';
2
2
  import type { PreflightResult } from '../../types/endpoints.js';
3
3
  import type { ActionGroup } from './actions.model.js';
4
- export declare function DecideDialog({ id, arms, checks, onClose, apiRoute }: {
4
+ export declare function DecideDialog({ id, arms, checks, onClose, apiRoute, onSuccess }: {
5
5
  apiRoute: string;
6
+ onSuccess?: (doc?: Record<string, unknown>) => void;
6
7
  id: DocId;
7
8
  arms: readonly ActionGroup[];
8
9
  checks?: PreflightResult['checks'];
@@ -9,8 +9,8 @@ import { reloadPage } from '../reload.js';
9
9
  import { RESULTS_COPY } from '../copy/results.js';
10
10
  import { ACTIONS_COPY as C, decideCopy } from '../copy/actions.js';
11
11
  import { decideState } from './decide.model.js';
12
- import { DialogFrame } from './ConfirmDialog.js';
13
- export function DecideDialog({ id, arms, checks = [], onClose, apiRoute }) {
12
+ import { Dialog } from '../../ui/Dialog.js';
13
+ export function DecideDialog({ id, arms, checks = [], onClose, apiRoute, onSuccess }) {
14
14
  const api = useApi(apiRoute);
15
15
  const [snapshot, setSnapshot] = useState(null);
16
16
  const [chosenArm, setChosenArm] = useState(null);
@@ -73,7 +73,8 @@ export function DecideDialog({ id, arms, checks = [], onClose, apiRoute }) {
73
73
  setError(null);
74
74
  const result = await api.decide(id, state.body);
75
75
  if (result.ok) {
76
- reloadPage();
76
+ if (onSuccess) onSuccess(result.data?.doc);
77
+ else reloadPage();
77
78
  return;
78
79
  } else {
79
80
  setError(result);
@@ -87,7 +88,8 @@ export function DecideDialog({ id, arms, checks = [], onClose, apiRoute }) {
87
88
  }
88
89
  const enabled = !busy && !loading && !loadFailed && state.canSubmit;
89
90
  const label = state.options.find((option)=>option.value === chosenArm)?.label;
90
- return /*#__PURE__*/ _jsxs(DialogFrame, {
91
+ return /*#__PURE__*/ _jsxs(Dialog, {
92
+ open: true,
91
93
  dismissible: !busy,
92
94
  initialFocus: "cancel",
93
95
  title: C.decide,
@@ -1,5 +1,4 @@
1
1
  import { API_MESSAGES, refusalMessage } from './copy/common.js';
2
- import { BLOCK_COPY } from './copy/blocks.js';
3
2
  import { CONTENT_ENTRY_REFUSALS } from './copy/actions.js';
4
3
  export function createApi(apiBase) {
5
4
  const collectionBase = `${apiBase.replace(/\/$/, '')}/xp-experiments`;
@@ -52,7 +51,7 @@ export function createApi(apiBase) {
52
51
  ...code ? {
53
52
  code
54
53
  } : {},
55
- message: refusalMessage(code, response.status, typeof error?.message === 'string' ? error.message : undefined, options),
54
+ message: refusalMessage(code, response.status, typeof error?.message === 'string' ? error.message : undefined, options, error?.detail),
56
55
  retryable: code === 'page-busy' || code === 'commit-unverified' || response.status >= 500 && response.status !== 501
57
56
  };
58
57
  } catch {
@@ -75,7 +74,7 @@ export function createApi(apiBase) {
75
74
  status: 404,
76
75
  code: 'not-found',
77
76
  message: refusalMessage('not-found', 404, undefined, {
78
- notFound: BLOCK_COPY.alreadyDeleted
77
+ notFound: API_MESSAGES.testAlreadyDeleted
79
78
  }),
80
79
  retryable: false
81
80
  };
@@ -85,10 +84,10 @@ export function createApi(apiBase) {
85
84
  };
86
85
  },
87
86
  deleteTest: (id)=>request(()=>`${collectionBase}/${encodeURIComponent(id)}`, 'DELETE', undefined, {
88
- notFound: BLOCK_COPY.noLongerDraft,
89
- forbidden: BLOCK_COPY.noLongerDraft,
87
+ notFound: API_MESSAGES.testNoLongerDraft,
88
+ forbidden: API_MESSAGES.testNoLongerDraft,
90
89
  codes: {
91
- 'invalid-status': BLOCK_COPY.noLongerDraft
90
+ 'invalid-status': API_MESSAGES.testNoLongerDraft
92
91
  }
93
92
  }),
94
93
  wrapBlock: (body)=>request(()=>`${apiBase.replace(/\/$/, '')}/xp/blocks/wrap`, 'POST', body),
@@ -1,4 +1,6 @@
1
1
  export declare const API_MESSAGES: {
2
+ readonly testAlreadyDeleted: "This test was already deleted. Reload the page.";
3
+ readonly testNoLongerDraft: "This test is no longer a draft. Reload the page.";
2
4
  readonly notFound: "This test no longer exists.";
3
5
  readonly goalNotFound: "That goal no longer exists. Choose another goal.";
4
6
  readonly roundChanged: "This round has changed. Reload the page.";
@@ -25,4 +27,4 @@ export declare function refusalMessage(code: string | undefined, status: number,
25
27
  forbidden?: string;
26
28
  codes?: Readonly<Record<string, string>>;
27
29
  fallback?: string;
28
- }): string;
30
+ }, detail?: unknown): string;
@@ -1,4 +1,7 @@
1
+ import { unpublishedPlacementsCopy } from './readiness.js';
1
2
  export const API_MESSAGES = {
3
+ testAlreadyDeleted: 'This test was already deleted. Reload the page.',
4
+ testNoLongerDraft: 'This test is no longer a draft. Reload the page.',
2
5
  notFound: 'This test no longer exists.',
3
6
  goalNotFound: 'That goal no longer exists. Choose another goal.',
4
7
  roundChanged: 'This round has changed. Reload the page.',
@@ -20,7 +23,7 @@ export const LOCKED_MESSAGES = {
20
23
  archived: "Archived tests can't be changed.",
21
24
  other: "Can't be changed in this state."
22
25
  };
23
- export function refusalMessage(code, status, message, options) {
26
+ export function refusalMessage(code, status, message, options, detail) {
24
27
  // A per-call code wins over the status branches: entry-not-found is a 404 that is not "this test no longer exists".
25
28
  const mapped = code && options?.codes && Object.hasOwn(options.codes, code) ? options.codes[code] : undefined;
26
29
  if (mapped !== undefined) return mapped;
@@ -29,5 +32,6 @@ export function refusalMessage(code, status, message, options) {
29
32
  if (code === 'commit-unverified') return API_MESSAGES.commitUnverified;
30
33
  if (code === 'not-implemented' || status === 501) return API_MESSAGES.notImplemented;
31
34
  if (code === 'forbidden' || status === 403) return options?.forbidden ?? API_MESSAGES.forbidden;
35
+ if (code === 'placement-unpublished') return unpublishedPlacementsCopy(detail);
32
36
  return options?.fallback ?? (message || API_MESSAGES.failed);
33
37
  }
@@ -3,16 +3,28 @@ export declare const PLACEMENT_FAILURE_COPY: {
3
3
  readonly forbidden: "You don't have permission to check where this test is used.";
4
4
  readonly 'not-found': "A page used by this test no longer exists. Choose another page.";
5
5
  };
6
+ export declare const SAVE_PAGE = "Save this page to put the test on it.";
7
+ export declare const PUBLISH_PAGE = "Publish this page to start the test.";
8
+ export declare const RUNNING_PUBLISH_PAGE = "This test is running, but visitors won't see it here until this page is published.";
9
+ export declare const RUNNING_SAVE_PAGE = "This test is running, but visitors won't see it here until this page is saved and published.";
6
10
  export declare const READINESS_COPY: {
11
+ readonly beforeStart: "Before you can start:";
7
12
  readonly label: "Readiness";
8
13
  readonly addGoal: "Add a goal";
9
14
  readonly needsAttention: "Needs attention";
15
+ readonly needsAttentionPrefix: "Needs attention: ";
10
16
  readonly missingVersions: "This test is missing its saved versions. Open the test and check its setup before changing this page.";
17
+ readonly saveGeneralError: "Couldn't save. Reload to check the saved test.";
18
+ readonly changing: "Saving this change…";
19
+ readonly reloadAfterError: "Couldn't save the test. Reload to check its saved settings before starting.";
20
+ readonly chooseGoalToAdd: "Choose a goal to add it to this test.";
21
+ readonly reloadFirst: "Reload to see the latest test settings before starting.";
11
22
  readonly ready: "Ready to start.";
12
- readonly saveFirst: "Save your changes first.";
23
+ readonly saveFirst: "Wait for your changes to save.";
13
24
  readonly saving: "Saving…";
14
25
  readonly saved: "Saved";
15
26
  readonly saveError: "Couldn't save — see the highlighted field";
27
+ readonly invalidRequest: "This test's setup couldn't be checked.";
16
28
  readonly checkError: "Couldn't check readiness. Try again.";
17
29
  readonly checking: "Checking readiness…";
18
30
  readonly retry: "Try again";
@@ -56,6 +68,7 @@ export declare const unpublishedPageCopy: (path: string, context?: {
56
68
  }) => string;
57
69
  /** Old responses may include raw host errors; unknown strings use authored copy. */
58
70
  export declare const placementFailureCopy: (reason: unknown) => "Couldn't check where this test is used. Try again." | "You don't have permission to check where this test is used." | "A page used by this test no longer exists. Choose another page.";
71
+ export declare const fixFieldsNext: (name: string) => string;
59
72
  export declare const nextCopy: (sentence: string) => string;
60
73
  export declare const versionsNext: (detail: string) => string;
61
74
  export declare const contentNext: (group: string) => string;
@@ -67,6 +80,9 @@ export declare const attributeNext: (attribute: string) => string;
67
80
  export declare const stoppedCopy: (date: string | null) => string;
68
81
  export declare const decidedCopy: (date: string | null, winner: string) => string;
69
82
  export declare const runningCopy: (date: string | null, people: number | null, days: number | null) => string;
83
+ export declare const lastBlockPlacementCopy: (name: string, removingPage?: boolean) => string;
84
+ export declare const bulkBlockRemovalCopy: (name: string) => string;
85
+ export declare const pendingBlockRemovalCopy: (name: string) => string;
70
86
  /** After archive the guard protects the winner and the Original; only the winner page is "the winner". */
71
87
  export declare const pageGuardCopy: (name: string, status: "running" | "decided" | "archived", role?: "winner" | "original") => string;
72
88
  export declare const versionPageUnavailableCopy: (path: string, status?: string) => string;
@@ -85,3 +101,6 @@ export declare function interactingTestsCopy(page: string, state: string, name:
85
101
  export declare const goalInSomeVersionsCopy: (name?: string) => string;
86
102
  export declare function asymmetricGoalsCopy(detail: unknown): string;
87
103
  export declare const placementUncheckedCopy: (page: string) => string;
104
+ export declare const moreBlockers: (count: number) => string;
105
+ export declare const unpublishedPlacementsCopy: (detail?: unknown) => string;
106
+ export declare const unpublishedPlacementCopy: (title?: string) => string;
@@ -3,16 +3,28 @@ export const PLACEMENT_FAILURE_COPY = {
3
3
  forbidden: "You don't have permission to check where this test is used.",
4
4
  'not-found': "A page used by this test no longer exists. Choose another page."
5
5
  };
6
+ export const SAVE_PAGE = 'Save this page to put the test on it.';
7
+ export const PUBLISH_PAGE = 'Publish this page to start the test.';
8
+ export const RUNNING_PUBLISH_PAGE = "This test is running, but visitors won't see it here until this page is published.";
9
+ export const RUNNING_SAVE_PAGE = "This test is running, but visitors won't see it here until this page is saved and published.";
6
10
  export const READINESS_COPY = {
11
+ beforeStart: 'Before you can start:',
7
12
  label: 'Readiness',
8
13
  addGoal: 'Add a goal',
9
14
  needsAttention: 'Needs attention',
15
+ needsAttentionPrefix: 'Needs attention: ',
10
16
  missingVersions: 'This test is missing its saved versions. Open the test and check its setup before changing this page.',
17
+ saveGeneralError: "Couldn't save. Reload to check the saved test.",
18
+ changing: 'Saving this change…',
19
+ reloadAfterError: "Couldn't save the test. Reload to check its saved settings before starting.",
20
+ chooseGoalToAdd: 'Choose a goal to add it to this test.',
21
+ reloadFirst: 'Reload to see the latest test settings before starting.',
11
22
  ready: 'Ready to start.',
12
- saveFirst: 'Save your changes first.',
23
+ saveFirst: 'Wait for your changes to save.',
13
24
  saving: 'Saving…',
14
25
  saved: 'Saved',
15
26
  saveError: "Couldn't save — see the highlighted field",
27
+ invalidRequest: "This test's setup couldn't be checked.",
16
28
  checkError: "Couldn't check readiness. Try again.",
17
29
  checking: 'Checking readiness…',
18
30
  retry: 'Try again',
@@ -53,6 +65,7 @@ export const pageInUseCopy = (path, version = false)=>version ? `${path} is alre
53
65
  export const unpublishedPageCopy = (path, context)=>!context ? `${path} isn't a published page yet. Publish it, or choose another page.` : context.original ? `${path} isn't published, so it can't be the Original. Publish it, or choose another page.` : context.found ? `${path} is still a draft. Publish it in ${context.collection}, then start the test.` : `${path} isn't published yet, or no page has that address. Publish it in ${context.collection}, or choose another page.`;
54
66
  /** Old responses may include raw host errors; unknown strings use authored copy. */ export const placementFailureCopy = (reason)=>PLACEMENT_FAILURE_COPY[typeof reason === 'string' && Object.hasOwn(PLACEMENT_FAILURE_COPY, reason) ? reason : 'placements-failed'];
55
67
  const withoutPeriod = (value)=>value.trim().replace(/[.!?]+$/, '');
68
+ export const fixFieldsNext = (name)=>`Fix the highlighted fields in ${name}.`;
56
69
  export const nextCopy = (sentence)=>`Next: ${sentence}`;
57
70
  export const versionsNext = (detail)=>`Fix the versions: ${withoutPeriod(detail)}.`;
58
71
  export const contentNext = (group)=>`Add content for ${group} on the page.`;
@@ -68,6 +81,9 @@ export const runningCopy = (date, people, days)=>[
68
81
  people === null ? null : `${people.toLocaleString('en-US')} people so far`,
69
82
  days === null ? null : `about ${days} days to go`
70
83
  ].filter(Boolean).join(' · ');
84
+ export const lastBlockPlacementCopy = (name, removingPage = false)=>removingPage ? `“${name}” is running and this page is the only published place it appears. Stop the test first.` : `“${name}” is running and this is the only published place it appears. Stop the test, or keep its block on this page.`;
85
+ export const bulkBlockRemovalCopy = (name)=>`“${name}” is running and the pages in this change are the only published places it appears. Stop the test first.`;
86
+ export const pendingBlockRemovalCopy = (name)=>`“${name}” is running and the pages in this change are the only published places it appears. Stop the test first, or change these pages one at a time.`;
71
87
  /** After archive the guard protects the winner and the Original; only the winner page is "the winner". */ export const pageGuardCopy = (name, status, role = 'winner')=>status === 'archived' ? role === 'original' ? `This page's address now shows the winner of the finished test "${name}". To free it, open the test and choose "Release pages".` : `This page is shown at other addresses because the finished test "${name}" made it the winner. To free it, open the test and choose "Release pages".` : status === 'decided' ? `This page is part of the decided test "${name}". Choose "Make it the content" or "Discard winner" on the test before you delete, rename or unpublish it.` : `This page is part of the running test "${name}". Stop the test before you delete, rename or unpublish it.`;
72
88
  export const versionPageUnavailableCopy = (path, status = 'running')=>`${path} isn't published, so visitors assigned to it see an error. Republish it, or ${status === 'decided' ? 'discard the winner' : 'stop the test'}.`;
73
89
  export const versionPageUncheckedCopy = (path, status = 'running')=>`Couldn't check whether ${path} is published. Check that it is still published, or ${status === 'decided' ? 'discard the winner' : 'stop the test'}.`;
@@ -90,3 +106,11 @@ export function asymmetricGoalsCopy(detail) {
90
106
  }).join('\n');
91
107
  }
92
108
  export const placementUncheckedCopy = (page)=>`${page} couldn't be checked, so the test can't confirm every version shows the same goals. Check that you can open it.`;
109
+ export const moreBlockers = (count)=>`and ${count} more`;
110
+ export const unpublishedPlacementsCopy = (detail)=>(Array.isArray(detail) && detail.length ? detail : [
111
+ detail
112
+ ]).map((placement)=>{
113
+ const title = placement && typeof placement === 'object' && typeof placement.title === 'string' && placement.title.trim() ? placement.title.trim() : 'this page';
114
+ return unpublishedPlacementCopy(title);
115
+ }).join('\n');
116
+ export const unpublishedPlacementCopy = (title = 'this page')=>`The block you're testing is only on a draft of ${title}. Publish the page before you start.`;
@@ -1,4 +1,6 @@
1
1
  export declare const TEST_PAGE: {
2
+ readonly noAudienceRules: "No audience choices are available here. Everyone eligible takes part; leave this section as it is.";
3
+ readonly editVersionsOnCanvas: "Edit version content on the canvas.";
2
4
  readonly clickPageGroup: "On this test's page";
3
5
  readonly clickGoalsNote: "Goals inside linked documents aren't shown. Goals added in code (data-xp-goal) work but aren't listed here.";
4
6
  readonly clickGoalHelp: "A click shows interest, not the result you want.";
@@ -62,8 +64,10 @@ export declare const TEST_PAGE: {
62
64
  readonly traffic: "How people are split";
63
65
  readonly goal: "Goal";
64
66
  readonly goalHelp: "The goal decides whether a version wins. Pick the one thing you want more of.";
67
+ readonly guardrailsShort: "Must not get worse";
65
68
  readonly guardrails: "Must not get worse (optional)";
66
69
  readonly guardrailHelp: "If a version makes one of these worse, you'll be warned.";
70
+ readonly secondaryShort: "Also keep an eye on";
67
71
  readonly secondary: "Also keep an eye on (optional)";
68
72
  readonly manageGoals: "Manage goals";
69
73
  readonly searchGoals: "Search goals";
@@ -1,4 +1,8 @@
1
+ const guardrailsShort = 'Must not get worse';
2
+ const secondaryShort = 'Also keep an eye on';
1
3
  export const TEST_PAGE = {
4
+ noAudienceRules: 'No audience choices are available here. Everyone eligible takes part; leave this section as it is.',
5
+ editVersionsOnCanvas: 'Edit version content on the canvas.',
2
6
  clickPageGroup: "On this test's page",
3
7
  clickGoalsNote: "Goals inside linked documents aren't shown. Goals added in code (data-xp-goal) work but aren't listed here.",
4
8
  clickGoalHelp: 'A click shows interest, not the result you want.',
@@ -62,9 +66,11 @@ export const TEST_PAGE = {
62
66
  traffic: 'How people are split',
63
67
  goal: 'Goal',
64
68
  goalHelp: 'The goal decides whether a version wins. Pick the one thing you want more of.',
65
- guardrails: 'Must not get worse (optional)',
69
+ guardrailsShort,
70
+ guardrails: `${guardrailsShort} (optional)`,
66
71
  guardrailHelp: "If a version makes one of these worse, you'll be warned.",
67
- secondary: 'Also keep an eye on (optional)',
72
+ secondaryShort,
73
+ secondary: `${secondaryShort} (optional)`,
68
74
  manageGoals: 'Manage goals',
69
75
  searchGoals: 'Search goals',
70
76
  chooseGoal: 'Choose a goal',
@@ -0,0 +1,7 @@
1
+ /** Path-only admin URLs, preserving Payload's root-route and trailing-slash behavior.
2
+ * Source: Payload 3.90.2 utilities/formatAdminURL.ts (MIT).
3
+ */
4
+ export declare function formatAdminURL({ adminRoute, path }: {
5
+ adminRoute: string;
6
+ path?: string;
7
+ }): string;
@@ -0,0 +1,9 @@
1
+ /** Path-only admin URLs, preserving Payload's root-route and trailing-slash behavior.
2
+ * Source: Payload 3.90.2 utilities/formatAdminURL.ts (MIT).
3
+ */ export function formatAdminURL({ adminRoute, path = '' }) {
4
+ const url = `${adminRoute === '/' ? '' : adminRoute.replace(/\/$/, '')}${path}` || '/';
5
+ if (process.env.NEXT_TRAILING_SLASH !== 'true') return url;
6
+ const index = url.search(/[?#]/);
7
+ const pathname = index === -1 ? url : url.slice(0, index);
8
+ return pathname.endsWith('/') ? url : `${pathname}/${index === -1 ? '' : url.slice(index)}`;
9
+ }
@@ -1,4 +1,4 @@
1
- import { formatAdminURL } from 'payload/shared';
1
+ import { formatAdminURL } from '../format/adminURL.js';
2
2
  import { placementDetail } from './placementLabels.model.js';
3
3
  export { placementDetailKey, placementDetail, fallbackPlacementLabel } from './placementLabels.model.js';
4
4
  export function resolvedPlacementLabel(value, match, adminRoute) {
@@ -1,11 +1,6 @@
1
1
  import type { PreflightResult } from '../types/endpoints.js';
2
+ import { type PreviewPage } from '../lib/placementPages.js';
2
3
  type Placement = PreflightResult['placements'][number];
3
- type PreviewPage = Placement & {
4
- key: string;
5
- slotCount: number;
6
- };
7
- /** Preview URLs identify pages; counts use the most placements in any one version. */
8
- export declare function previewPages(placements: readonly Placement[], flagPoint?: string): PreviewPage[];
9
4
  /** Pages that offer something to do: a preview or an editor link. The section is hidden when none do. */
10
5
  export declare function actionablePreviewPages(placements: readonly Placement[], flagPoint?: string): PreviewPage[];
11
6
  export {};
@@ -0,0 +1,4 @@
1
+ import { placementPages } from '../lib/placementPages.js';
2
+ /** Pages that offer something to do: a preview or an editor link. The section is hidden when none do. */ export function actionablePreviewPages(placements, flagPoint) {
3
+ return placementPages(placements, flagPoint).filter((page)=>page.url || page.editorUrl);
4
+ }
@@ -0,0 +1,9 @@
1
+ import type { PreflightResult } from '../types/endpoints.js';
2
+ export declare const PREFLIGHT_TIMEOUT_MS = 15000;
3
+ /** The answer must support both readiness and placement consumers. */
4
+ export declare function isPreflightResult(value: unknown): value is PreflightResult;
5
+ /** Bound the response and body read, even when a producer ignores cancellation. */
6
+ export declare function readPreflight(request: (signal: AbortSignal) => Promise<Response>, signal: AbortSignal): Promise<{
7
+ response: Response;
8
+ body: unknown;
9
+ }>;