@delmaredigital/payload-experiments 0.4.0-rc.1 → 0.4.0-rc.10

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 (573) hide show
  1. package/README.md +284 -772
  2. package/dist/admin/LayerUsage.js +1 -1
  3. package/dist/admin/MetricSourceSelect.js +2 -2
  4. package/dist/admin/PlacementStatus.js +1 -1
  5. package/dist/admin/TestsDashboardCards.d.ts +1 -0
  6. package/dist/admin/TestsDashboardCards.js +5 -9
  7. package/dist/admin/TestsNavLink.d.ts +1 -0
  8. package/dist/admin/TestsNavLink.js +5 -11
  9. package/dist/admin/blocks/BlockPanel.d.ts +1 -0
  10. package/dist/admin/blocks/BlockPanel.js +129 -37
  11. package/dist/admin/blocks/TestBlockField.js +3 -3
  12. package/dist/admin/blocks/formApi.d.ts +3 -0
  13. package/dist/admin/blocks/formApi.js +10 -4
  14. package/dist/admin/blocks/inject.js +1 -0
  15. package/dist/admin/blocks/model.d.ts +3 -2
  16. package/dist/admin/blocks/model.js +10 -6
  17. package/dist/admin/blocks/statusCache.d.ts +2 -0
  18. package/dist/admin/blocks/statusCache.js +12 -3
  19. package/dist/admin/components/RootViewMessage.js +1 -1
  20. package/dist/admin/copy/blocks.d.ts +21 -1
  21. package/dist/admin/copy/blocks.js +40 -6
  22. package/dist/admin/copy/goals.d.ts +6 -1
  23. package/dist/admin/copy/goals.js +10 -3
  24. package/dist/admin/copy/newTest.d.ts +6 -7
  25. package/dist/admin/copy/newTest.js +9 -7
  26. package/dist/admin/goals/XpGoalField.d.ts +2 -0
  27. package/dist/admin/goals/XpGoalField.js +156 -114
  28. package/dist/admin/goals/xpGoalField.css +47 -0
  29. package/dist/admin/pageCollections.d.ts +1 -0
  30. package/dist/admin/pageCollections.js +3 -0
  31. package/dist/admin/paths.d.ts +3 -0
  32. package/dist/admin/paths.js +3 -0
  33. package/dist/admin/placementStatus.model.js +1 -1
  34. package/dist/admin/status.model.js +1 -1
  35. package/dist/admin/surface/ResultsRoute.d.ts +2 -1
  36. package/dist/admin/surface/ResultsRoute.js +20 -24
  37. package/dist/admin/surface/SurfaceShell.js +5 -2
  38. package/dist/admin/surface/TestRowMenu.d.ts +6 -0
  39. package/dist/admin/surface/TestRowMenu.js +156 -0
  40. package/dist/admin/surface/TestsHome.d.ts +5 -3
  41. package/dist/admin/surface/TestsHome.js +266 -58
  42. package/dist/admin/surface/TestsSurface.js +8 -7
  43. package/dist/admin/surface/goals/GoalForm.d.ts +1 -1
  44. package/dist/admin/surface/goals/GoalForm.js +95 -54
  45. package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
  46. package/dist/admin/surface/goals/GoalsList.js +5 -4
  47. package/dist/admin/surface/goals/data.js +2 -2
  48. package/dist/admin/surface/goals/goals.css +7 -0
  49. package/dist/admin/surface/goals/goals.model.d.ts +11 -1
  50. package/dist/admin/surface/goals/goals.model.js +43 -0
  51. package/dist/admin/surface/home.model.d.ts +9 -8
  52. package/dist/admin/surface/home.model.js +22 -21
  53. package/dist/admin/surface/newTest/NewTest.d.ts +4 -4
  54. package/dist/admin/surface/newTest/NewTest.js +98 -94
  55. package/dist/admin/surface/newTest/PageWizard.d.ts +2 -1
  56. package/dist/admin/surface/newTest/PageWizard.js +111 -76
  57. package/dist/admin/surface/newTest/newTest.css +28 -9
  58. package/dist/admin/surface/results/ResultsHeader.d.ts +2 -2
  59. package/dist/admin/surface/results/ResultsHeader.js +58 -54
  60. package/dist/admin/surface/surface.css +10 -0
  61. package/dist/admin/surface/test/TestPage.d.ts +1 -2
  62. package/dist/admin/surface/test/TestPage.js +42 -162
  63. package/dist/admin/theme.css +2 -0
  64. package/dist/admin/views/CollectionListRedirect.d.ts +1 -0
  65. package/dist/admin/views/CollectionListRedirect.js +1 -1
  66. package/dist/admin/views/ExperimentsRootView.js +18 -165
  67. package/dist/admin/views/GoalEditRedirect.d.ts +4 -0
  68. package/dist/admin/views/GoalEditRedirect.js +14 -0
  69. package/dist/admin/views/GoalsCollectionListView.d.ts +2 -0
  70. package/dist/admin/views/GoalsCollectionListView.js +4 -0
  71. package/dist/admin/views/TestsCollectionListView.d.ts +2 -0
  72. package/dist/admin/views/TestsCollectionListView.js +4 -0
  73. package/dist/admin/views/TestsNavLinkServer.d.ts +1 -0
  74. package/dist/admin/views/TestsNavLinkServer.js +2 -2
  75. package/dist/admin/views/TestsSurfaceClient.d.ts +3 -0
  76. package/dist/admin/views/TestsSurfaceClient.js +11 -0
  77. package/dist/admin/views/buildSurfaceProps.d.ts +8 -0
  78. package/dist/admin/views/buildSurfaceProps.js +102 -0
  79. package/dist/admin/views/renderCollectionList.d.ts +2 -0
  80. package/dist/admin/views/renderCollectionList.js +34 -0
  81. package/dist/admin/views/renderTestsSurface.d.ts +3 -0
  82. package/dist/admin/views/renderTestsSurface.js +34 -0
  83. package/dist/blocks/bindings.js +8 -14
  84. package/dist/blocks/formState.js +1 -1
  85. package/dist/blocks/placementLanguages.d.ts +7 -0
  86. package/dist/blocks/placementLanguages.js +27 -0
  87. package/dist/blocks/placementLocale.d.ts +37 -0
  88. package/dist/blocks/placementLocale.js +270 -0
  89. package/dist/collections/experiments/config.js +17 -8
  90. package/dist/collections/experiments/deleteGuard.js +2 -2
  91. package/dist/collections/experiments/lockHook.js +21 -2
  92. package/dist/collections/experiments/pickSlug.js +2 -0
  93. package/dist/collections/metrics.js +16 -4
  94. package/dist/collections/metricsGuards.js +2 -0
  95. package/dist/collections/serialize.js +5 -4
  96. package/dist/constants.d.ts +1 -0
  97. package/dist/constants.js +1 -0
  98. package/dist/db/adapter.d.ts +9 -1
  99. package/dist/db/adapter.js +77 -1
  100. package/dist/db/appends.d.ts +13 -0
  101. package/dist/db/appends.js +49 -0
  102. package/dist/db/bulkPlacementRemoval.d.ts +30 -0
  103. package/dist/db/bulkPlacementRemoval.js +111 -0
  104. package/dist/db/delete.d.ts +1 -1
  105. package/dist/db/delete.js +2 -4
  106. package/dist/db/events.d.ts +9 -0
  107. package/dist/db/events.js +42 -8
  108. package/dist/db/executor.d.ts +7 -1
  109. package/dist/db/executor.js +7 -3
  110. package/dist/db/pageCopies.d.ts +5 -0
  111. package/dist/db/pageCopies.js +31 -0
  112. package/dist/db/placements.d.ts +2 -0
  113. package/dist/db/placements.js +8 -0
  114. package/dist/db/results.d.ts +5 -1
  115. package/dist/db/results.js +21 -5
  116. package/dist/db/snapshots.d.ts +1 -0
  117. package/dist/endpoints/contentLocale.d.ts +6 -0
  118. package/dist/endpoints/contentLocale.js +15 -0
  119. package/dist/endpoints/deleteImpact.d.ts +6 -0
  120. package/dist/endpoints/deleteImpact.js +207 -0
  121. package/dist/endpoints/duplicateOriginal.d.ts +38 -0
  122. package/dist/endpoints/duplicateOriginal.js +407 -0
  123. package/dist/endpoints/editorSurface.d.ts +3 -0
  124. package/dist/endpoints/editorSurface.js +31 -0
  125. package/dist/endpoints/events.js +103 -39
  126. package/dist/endpoints/index.js +57 -9
  127. package/dist/endpoints/pages.js +247 -64
  128. package/dist/endpoints/placementStatus.js +13 -5
  129. package/dist/endpoints/preflight.d.ts +1 -1
  130. package/dist/endpoints/preflight.js +17 -2
  131. package/dist/endpoints/results.d.ts +1 -1
  132. package/dist/endpoints/results.js +6 -2
  133. package/dist/endpoints/routeId.d.ts +2 -2
  134. package/dist/endpoints/routeId.js +11 -5
  135. package/dist/endpoints/summary.js +46 -12
  136. package/dist/endpoints/testVersion.d.ts +2 -0
  137. package/dist/endpoints/testVersion.js +38 -0
  138. package/dist/endpoints/transitions.js +41 -29
  139. package/dist/errors.d.ts +5 -0
  140. package/dist/errors.js +8 -0
  141. package/dist/events/request.d.ts +6 -2
  142. package/dist/events/request.js +35 -8
  143. package/dist/events/rows.d.ts +1 -1
  144. package/dist/events/rows.js +24 -8
  145. package/dist/events/writable.d.ts +9 -0
  146. package/dist/events/writable.js +13 -0
  147. package/dist/exports/adminClient.d.ts +1 -1
  148. package/dist/exports/adminClient.js +1 -1
  149. package/dist/exports/adminRsc.d.ts +3 -0
  150. package/dist/exports/adminRsc.js +3 -0
  151. package/dist/exports/index.d.ts +1 -1
  152. package/dist/exports/rsc.d.ts +1 -0
  153. package/dist/exports/rsc.js +1 -0
  154. package/dist/fields/xpGoal.js +3 -15
  155. package/dist/goals/fairness.d.ts +1 -1
  156. package/dist/goals/fairness.js +44 -35
  157. package/dist/goals/picker/clickGoalPicker.model.d.ts +8 -1
  158. package/dist/goals/picker/clickGoalPicker.model.js +20 -2
  159. package/dist/goals/picker/copy.d.ts +6 -2
  160. package/dist/goals/picker/copy.js +11 -2
  161. package/dist/goals/picker/useClickGoalPicker.d.ts +1 -1
  162. package/dist/goals/picker/useClickGoalPicker.js +4 -2
  163. package/dist/goals/validate.d.ts +3 -0
  164. package/dist/goals/validate.js +15 -0
  165. package/dist/hooks/blockRemovalRule.d.ts +30 -0
  166. package/dist/hooks/blockRemovalRule.js +165 -0
  167. package/dist/hooks/hostHook.js +6 -2
  168. package/dist/hooks/pageGuard.d.ts +27 -2
  169. package/dist/hooks/pageGuard.js +213 -45
  170. package/dist/hooks/puckGoals.d.ts +5 -0
  171. package/dist/hooks/puckGoals.js +62 -0
  172. package/dist/hooks/puckNestedTests.d.ts +8 -0
  173. package/dist/hooks/puckNestedTests.js +36 -0
  174. package/dist/hooks/trackPageCopies.d.ts +11 -0
  175. package/dist/hooks/trackPageCopies.js +7 -0
  176. package/dist/lib/fetchAllDocs.d.ts +1 -1
  177. package/dist/lib/placementPages.d.ts +10 -0
  178. package/dist/{admin/previewLinks.model.js → lib/placementPages.js} +10 -5
  179. package/dist/manifest/compile.d.ts +2 -1
  180. package/dist/manifest/compile.js +13 -6
  181. package/dist/onInit.js +36 -0
  182. package/dist/options.d.ts +2 -0
  183. package/dist/options.js +23 -2
  184. package/dist/plugin.js +19 -20
  185. package/dist/proxy/pageNavigation.d.ts +4 -0
  186. package/dist/proxy/pageNavigation.js +28 -0
  187. package/dist/proxy/resolve.js +52 -25
  188. package/dist/puck/ExperimentPicker.d.ts +2 -1
  189. package/dist/puck/ExperimentPicker.js +62 -40
  190. package/dist/puck/ExperimentSlot.js +3 -1
  191. package/dist/puck/copy.d.ts +5 -1
  192. package/dist/puck/copy.js +5 -1
  193. package/dist/puck/editor/ConfigureTestDrawer.d.ts +25 -0
  194. package/dist/puck/editor/ConfigureTestDrawer.js +150 -0
  195. package/dist/puck/editor/CreateExperimentDrawer.d.ts +12 -2
  196. package/dist/puck/editor/CreateExperimentDrawer.js +89 -21
  197. package/dist/puck/editor/EditorControls.d.ts +14 -0
  198. package/dist/puck/editor/EditorControls.js +99 -0
  199. package/dist/puck/editor/ExperimentSlotEditor.js +951 -179
  200. package/dist/puck/editor/LeftoverVersions.d.ts +15 -0
  201. package/dist/puck/editor/LeftoverVersions.js +79 -0
  202. package/dist/puck/editor/PlacementNotice.d.ts +8 -0
  203. package/dist/puck/editor/PlacementNotice.js +22 -0
  204. package/dist/puck/editor/QuickTestActions.d.ts +6 -0
  205. package/dist/puck/editor/QuickTestActions.js +57 -0
  206. package/dist/puck/editor/ResultsReadout.d.ts +2 -1
  207. package/dist/puck/editor/ResultsReadout.js +10 -6
  208. package/dist/puck/editor/VersionBuilder.d.ts +66 -12
  209. package/dist/puck/editor/VersionBuilder.js +554 -231
  210. package/dist/puck/editor/armWrites.d.ts +11 -2
  211. package/dist/puck/editor/armWrites.js +43 -4
  212. package/dist/puck/editor/armsCache.d.ts +3 -1
  213. package/dist/puck/editor/armsCache.js +20 -4
  214. package/dist/puck/editor/blockClipboard.d.ts +16 -0
  215. package/dist/puck/editor/blockClipboard.js +20 -0
  216. package/dist/puck/editor/cloneSlot.d.ts +2 -0
  217. package/dist/puck/editor/cloneSlot.js +7 -0
  218. package/dist/puck/editor/copy.d.ts +64 -19
  219. package/dist/puck/editor/copy.js +72 -20
  220. package/dist/puck/editor/createTest.d.ts +3 -0
  221. package/dist/puck/editor/createTest.js +33 -0
  222. package/dist/puck/editor/editor.chrome.css +191 -19
  223. package/dist/puck/editor/editor.css +328 -24
  224. package/dist/puck/editor/editor.model.d.ts +17 -1
  225. package/dist/puck/editor/editor.model.js +61 -4
  226. package/dist/puck/editor/editorSurface.d.ts +10 -0
  227. package/dist/puck/editor/editorSurface.js +65 -0
  228. package/dist/puck/editor/experimentOutlinePlugin.js +96 -28
  229. package/dist/puck/editor/localPlacements.d.ts +5 -0
  230. package/dist/puck/editor/localPlacements.js +43 -0
  231. package/dist/puck/editor/outlineVersion.d.ts +5 -0
  232. package/dist/puck/editor/outlineVersion.js +36 -0
  233. package/dist/puck/editor/placementsCache.d.ts +60 -0
  234. package/dist/puck/editor/placementsCache.js +263 -0
  235. package/dist/puck/editor/sidebar.d.ts +8 -0
  236. package/dist/puck/editor/sidebar.js +74 -0
  237. package/dist/puck/editor/usePageSaveReadiness.d.ts +6 -0
  238. package/dist/puck/editor/usePageSaveReadiness.js +31 -0
  239. package/dist/puck/editor/usePlacementNotice.d.ts +3 -0
  240. package/dist/puck/editor/usePlacementNotice.js +15 -0
  241. package/dist/puck/editor/xpGoalPuckEditorField.js +105 -86
  242. package/dist/puck/experimentSlotField.d.ts +3 -0
  243. package/dist/puck/experimentSlotField.js +15 -4
  244. package/dist/puck/experimentSlug.d.ts +2 -0
  245. package/dist/puck/experimentSlug.js +3 -0
  246. package/dist/puck/nestedTestCopy.d.ts +8 -0
  247. package/dist/puck/nestedTestCopy.js +22 -0
  248. package/dist/puck/nestedTests.d.ts +17 -0
  249. package/dist/puck/nestedTests.js +30 -0
  250. package/dist/puck/slotConfig.d.ts +1 -1
  251. package/dist/puck/slotConfig.js +17 -4
  252. package/dist/puck/visibility.d.ts +20 -0
  253. package/dist/puck/visibility.js +81 -0
  254. package/dist/results/aggregate.d.ts +6 -3
  255. package/dist/results/aggregate.js +9 -9
  256. package/dist/results/health.d.ts +8 -0
  257. package/dist/results/health.js +28 -0
  258. package/dist/results/identityCredit.d.ts +1 -0
  259. package/dist/results/identityCredit.js +4 -1
  260. package/dist/results/verdict.js +2 -1
  261. package/dist/runtime/cookie.d.ts +10 -2
  262. package/dist/runtime/cookie.js +38 -6
  263. package/dist/runtime/cookieOptions.d.ts +6 -0
  264. package/dist/runtime/cookieOptions.js +14 -0
  265. package/dist/runtime/proxyRuntime.d.ts +1 -0
  266. package/dist/runtime/proxyRuntime.js +18 -8
  267. package/dist/runtime/signing.d.ts +1 -0
  268. package/dist/runtime/signing.js +5 -0
  269. package/dist/sanitizeReadinessDetail.d.ts +2 -2
  270. package/dist/sanitizeReadinessDetail.js +22 -2
  271. package/dist/server/getAssignments.js +11 -10
  272. package/dist/server/recordContentChange.d.ts +1 -1
  273. package/dist/server/recordContentChange.js +48 -22
  274. package/dist/server/resolveExperimentBlocks.js +2 -4
  275. package/dist/server/resolveExperimentData.js +8 -8
  276. package/dist/server/runResults.js +52 -14
  277. package/dist/server/startExperiment.d.ts +20 -0
  278. package/dist/server/startExperiment.js +70 -0
  279. package/dist/server/trackConversion.js +10 -13
  280. package/dist/{admin → testSurface}/PreviewLinks.js +6 -2
  281. package/dist/testSurface/actions/DecideDialog.d.ts +16 -0
  282. package/dist/{admin → testSurface}/actions/DecideDialog.js +78 -55
  283. package/dist/testSurface/actions/LifecycleAction.d.ts +16 -0
  284. package/dist/testSurface/actions/LifecycleAction.js +105 -0
  285. package/dist/{admin → testSurface}/actions/MakeContentResult.d.ts +4 -3
  286. package/dist/{admin → testSurface}/actions/MakeContentResult.js +10 -2
  287. package/dist/{admin → testSurface}/actions/actions.model.d.ts +13 -5
  288. package/dist/testSurface/actions/actions.model.js +122 -0
  289. package/dist/{admin → testSurface}/api.d.ts +20 -7
  290. package/dist/{admin → testSurface}/api.js +72 -22
  291. package/dist/testSurface/contentLocaleURL.d.ts +2 -0
  292. package/dist/testSurface/contentLocaleURL.js +3 -0
  293. package/dist/{admin → testSurface}/copy/actions.d.ts +28 -8
  294. package/dist/{admin → testSurface}/copy/actions.js +31 -11
  295. package/dist/{admin → testSurface}/copy/common.d.ts +13 -4
  296. package/dist/{admin → testSurface}/copy/common.js +18 -8
  297. package/dist/testSurface/copy/languages.d.ts +12 -0
  298. package/dist/testSurface/copy/languages.js +8 -0
  299. package/dist/{admin → testSurface}/copy/metrics.d.ts +1 -0
  300. package/dist/{admin → testSurface}/copy/metrics.js +1 -0
  301. package/dist/testSurface/copy/pages.d.ts +84 -0
  302. package/dist/testSurface/copy/pages.js +90 -0
  303. package/dist/{admin → testSurface}/copy/readiness.d.ts +38 -4
  304. package/dist/{admin → testSurface}/copy/readiness.js +52 -7
  305. package/dist/{admin → testSurface}/copy/results.d.ts +6 -3
  306. package/dist/{admin → testSurface}/copy/results.js +6 -3
  307. package/dist/{admin → testSurface}/copy/review.d.ts +1 -1
  308. package/dist/{admin → testSurface}/copy/review.js +1 -1
  309. package/dist/{admin → testSurface}/copy/surface.d.ts +11 -2
  310. package/dist/{admin → testSurface}/copy/surface.js +13 -10
  311. package/dist/{admin → testSurface}/copy/testPage.d.ts +53 -8
  312. package/dist/testSurface/copy/testPage.js +165 -0
  313. package/dist/testSurface/format/adminURL.d.ts +7 -0
  314. package/dist/testSurface/format/adminURL.js +9 -0
  315. package/dist/testSurface/placementLabel.d.ts +8 -0
  316. package/dist/testSurface/placementLabel.js +24 -0
  317. package/dist/{admin → testSurface}/placements/placementLabels.d.ts +2 -0
  318. package/dist/{admin → testSurface}/placements/placementLabels.js +3 -2
  319. package/dist/{admin → testSurface}/previewLinks.model.d.ts +1 -6
  320. package/dist/testSurface/previewLinks.model.js +4 -0
  321. package/dist/testSurface/readPreflight.d.ts +13 -0
  322. package/dist/testSurface/readPreflight.js +44 -0
  323. package/dist/testSurface/readinessRead.d.ts +53 -0
  324. package/dist/testSurface/readinessRead.js +50 -0
  325. package/dist/{admin → testSurface}/results/VerdictHero.d.ts +2 -1
  326. package/dist/{admin → testSurface}/results/VerdictHero.js +5 -1
  327. package/dist/testSurface/results/results.css +64 -0
  328. package/dist/{admin → testSurface}/results/results.model.js +6 -2
  329. package/dist/{admin → testSurface}/surface/contracts.d.ts +17 -3
  330. package/dist/testSurface/surface/editorPlacement.d.ts +26 -0
  331. package/dist/testSurface/surface/editorPlacement.js +78 -0
  332. package/dist/testSurface/surface/pageBlock/pageBlock.model.js +9 -0
  333. package/dist/{admin → testSurface}/surface/pageBlock/parts.js +39 -11
  334. package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +13 -0
  335. package/dist/testSurface/surface/pagePicker/CopyRoute.js +273 -0
  336. package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +21 -0
  337. package/dist/testSurface/surface/pagePicker/PageCombobox.js +503 -0
  338. package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -0
  339. package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.d.ts +7 -3
  340. package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.js +17 -2
  341. package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.d.ts +8 -4
  342. package/dist/testSurface/surface/readiness/ActionDialogs.js +351 -0
  343. package/dist/{admin → testSurface}/surface/readiness/Banner.d.ts +2 -3
  344. package/dist/testSurface/surface/readiness/Banner.js +187 -0
  345. package/dist/testSurface/surface/readiness/BlockerList.d.ts +11 -0
  346. package/dist/testSurface/surface/readiness/BlockerList.js +31 -0
  347. package/dist/testSurface/surface/readiness/SaveStatus.d.ts +10 -0
  348. package/dist/testSurface/surface/readiness/SaveStatus.js +66 -0
  349. package/dist/{admin → testSurface}/surface/readiness/parts.js +0 -2
  350. package/dist/{admin → testSurface}/surface/readiness/readiness.model.d.ts +28 -2
  351. package/dist/testSurface/surface/readiness/readiness.model.js +377 -0
  352. package/dist/testSurface/surface/readiness/useTransition.d.ts +16 -0
  353. package/dist/testSurface/surface/readiness/useTransition.js +141 -0
  354. package/dist/{admin → testSurface}/surface/results/ReleasePages.d.ts +6 -3
  355. package/dist/{admin → testSurface}/surface/results/ReleasePages.js +40 -40
  356. package/dist/{admin → testSurface}/surface/results/ResultsBody.d.ts +7 -3
  357. package/dist/{admin → testSurface}/surface/results/ResultsBody.js +108 -44
  358. package/dist/{admin → testSurface}/surface/results/useResults.d.ts +26 -8
  359. package/dist/{admin → testSurface}/surface/results/useResults.js +3 -2
  360. package/dist/{admin → testSurface}/surface/setting/parts.js +58 -18
  361. package/dist/testSurface/surface/setting/setting.css +17 -0
  362. package/dist/{admin → testSurface}/surface/test/AdvancedSection.js +2 -0
  363. package/dist/testSurface/surface/test/DeleteTest.d.ts +23 -0
  364. package/dist/testSurface/surface/test/DeleteTest.js +270 -0
  365. package/dist/testSurface/surface/test/GoalSection.d.ts +4 -0
  366. package/dist/{admin → testSurface}/surface/test/GoalSection.js +116 -86
  367. package/dist/testSurface/surface/test/LengthSection.d.ts +2 -0
  368. package/dist/{admin → testSurface}/surface/test/LengthSection.js +5 -1
  369. package/dist/{admin → testSurface}/surface/test/PageHoldout.js +4 -1
  370. package/dist/{admin → testSurface}/surface/test/Rail.js +7 -4
  371. package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +1 -0
  372. package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +2 -3
  373. package/dist/{admin → testSurface}/surface/test/Section.d.ts +3 -1
  374. package/dist/testSurface/surface/test/Section.js +80 -0
  375. package/dist/{admin → testSurface}/surface/test/TargetingSection.js +82 -12
  376. package/dist/testSurface/surface/test/TestSurface.d.ts +19 -0
  377. package/dist/testSurface/surface/test/TestSurface.js +265 -0
  378. package/dist/testSurface/surface/test/VersionsSection.d.ts +5 -0
  379. package/dist/{admin → testSurface}/surface/test/VersionsSection.js +69 -35
  380. package/dist/{admin → testSurface}/surface/test/fields.d.ts +30 -7
  381. package/dist/testSurface/surface/test/fields.js +306 -0
  382. package/dist/{admin → testSurface}/surface/test/pageParts.js +27 -43
  383. package/dist/testSurface/surface/test/testPage.css +103 -0
  384. package/dist/{admin → testSurface}/surface/test/testPage.model.d.ts +1 -0
  385. package/dist/{admin → testSurface}/surface/test/testPage.model.js +6 -0
  386. package/dist/{admin → testSurface}/surface/testDocument.model.d.ts +3 -0
  387. package/dist/{admin → testSurface}/surface/testDocument.model.js +4 -1
  388. package/dist/testSurface/surface/useTestDocument.d.ts +60 -0
  389. package/dist/testSurface/surface/useTestDocument.js +782 -0
  390. package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
  391. package/dist/testSurface/surface/watchTestDocument.js +181 -0
  392. package/dist/testSurface/surfaceUrls.d.ts +7 -0
  393. package/dist/testSurface/surfaceUrls.js +19 -0
  394. package/dist/{admin → testSurface}/useApi.d.ts +21 -5
  395. package/dist/testSurface/useOnTestReturn.d.ts +2 -0
  396. package/dist/testSurface/useOnTestReturn.js +27 -0
  397. package/dist/testSurface/useReadinessPolling.d.ts +3 -0
  398. package/dist/testSurface/useReadinessPolling.js +26 -0
  399. package/dist/transitions/addMetric.d.ts +2 -5
  400. package/dist/transitions/addMetric.js +5 -1
  401. package/dist/transitions/allocate.d.ts +2 -2
  402. package/dist/transitions/allocate.js +3 -1
  403. package/dist/transitions/archive.d.ts +1 -1
  404. package/dist/transitions/archive.js +3 -2
  405. package/dist/transitions/checkStart.d.ts +6 -1
  406. package/dist/transitions/checkStart.js +133 -17
  407. package/dist/transitions/contentFields.js +9 -5
  408. package/dist/transitions/decide.d.ts +1 -1
  409. package/dist/transitions/decide.js +6 -3
  410. package/dist/transitions/deleteExperiment.d.ts +2 -2
  411. package/dist/transitions/deleteExperiment.js +17 -7
  412. package/dist/transitions/kernel.d.ts +4 -0
  413. package/dist/transitions/kernel.js +9 -4
  414. package/dist/transitions/makeContent.d.ts +2 -1
  415. package/dist/transitions/makeContent.js +41 -17
  416. package/dist/transitions/nestedPlacementNames.d.ts +5 -0
  417. package/dist/transitions/nestedPlacementNames.js +32 -0
  418. package/dist/transitions/pageAddress.d.ts +6 -0
  419. package/dist/transitions/pageAddress.js +71 -0
  420. package/dist/transitions/pageVersions.js +3 -1
  421. package/dist/transitions/phaseRecord.d.ts +2 -0
  422. package/dist/transitions/phaseRecord.js +5 -0
  423. package/dist/transitions/placementInteractions.d.ts +3 -3
  424. package/dist/transitions/placementInteractions.js +16 -12
  425. package/dist/transitions/placements.d.ts +54 -8
  426. package/dist/transitions/placements.js +304 -81
  427. package/dist/transitions/preflightData.d.ts +5 -3
  428. package/dist/transitions/preflightData.js +137 -40
  429. package/dist/transitions/releaseHoldout.d.ts +2 -1
  430. package/dist/transitions/releaseHoldout.js +3 -1
  431. package/dist/transitions/releasePages.d.ts +2 -1
  432. package/dist/transitions/releasePages.js +3 -1
  433. package/dist/transitions/resolveCaps.d.ts +2 -4
  434. package/dist/transitions/start.d.ts +6 -8
  435. package/dist/transitions/start.js +72 -35
  436. package/dist/transitions/startReads.d.ts +7 -0
  437. package/dist/transitions/startReads.js +28 -0
  438. package/dist/transitions/stop.d.ts +2 -1
  439. package/dist/transitions/stop.js +3 -2
  440. package/dist/types/contracts.d.ts +15 -3
  441. package/dist/types/endpoints.d.ts +121 -17
  442. package/dist/types/puck.d.ts +1 -0
  443. package/dist/types/runtime.d.ts +15 -9
  444. package/dist/types/snapshot.d.ts +2 -0
  445. package/dist/types/surface.d.ts +9 -9
  446. package/dist/ui/Button.js +2 -2
  447. package/dist/ui/Card.d.ts +2 -1
  448. package/dist/ui/Card.js +4 -4
  449. package/dist/ui/ChipsInput.d.ts +8 -1
  450. package/dist/ui/ChipsInput.js +17 -4
  451. package/dist/ui/Dialog.d.ts +24 -2
  452. package/dist/ui/Dialog.js +116 -6
  453. package/dist/ui/Drawer.d.ts +10 -0
  454. package/dist/ui/Drawer.js +29 -0
  455. package/dist/ui/Inputs.d.ts +4 -3
  456. package/dist/ui/Inputs.js +7 -4
  457. package/dist/ui/SelectControl.d.ts +33 -0
  458. package/dist/ui/SelectControl.js +504 -0
  459. package/dist/ui/Tabs.d.ts +4 -4
  460. package/dist/ui/Tabs.js +35 -32
  461. package/dist/ui/ui.css +49 -5
  462. package/package.json +3 -2
  463. package/dist/admin/actions/ConfirmDialog.d.ts +0 -19
  464. package/dist/admin/actions/ConfirmDialog.js +0 -149
  465. package/dist/admin/actions/DecideDialog.d.ts +0 -10
  466. package/dist/admin/actions/actions.model.js +0 -70
  467. package/dist/admin/copy/pages.d.ts +0 -26
  468. package/dist/admin/copy/pages.js +0 -26
  469. package/dist/admin/copy/testPage.js +0 -104
  470. package/dist/admin/results/results.css +0 -64
  471. package/dist/admin/styles.css +0 -10
  472. package/dist/admin/styles.d.ts +0 -2
  473. package/dist/admin/styles.js +0 -3
  474. package/dist/admin/surface/pageBlock/pageBlock.model.js +0 -8
  475. package/dist/admin/surface/pagePicker/CopyRoute.d.ts +0 -6
  476. package/dist/admin/surface/pagePicker/CopyRoute.js +0 -53
  477. package/dist/admin/surface/pagePicker/PagePicker.d.ts +0 -10
  478. package/dist/admin/surface/pagePicker/PagePicker.js +0 -172
  479. package/dist/admin/surface/readiness/ActionDialogs.js +0 -337
  480. package/dist/admin/surface/readiness/Banner.js +0 -190
  481. package/dist/admin/surface/readiness/SaveStatus.d.ts +0 -5
  482. package/dist/admin/surface/readiness/SaveStatus.js +0 -53
  483. package/dist/admin/surface/readiness/readiness.model.js +0 -205
  484. package/dist/admin/surface/readiness/useTransition.d.ts +0 -11
  485. package/dist/admin/surface/readiness/useTransition.js +0 -35
  486. package/dist/admin/surface/setting/setting.css +0 -17
  487. package/dist/admin/surface/test/GoalSection.d.ts +0 -2
  488. package/dist/admin/surface/test/LengthSection.d.ts +0 -2
  489. package/dist/admin/surface/test/Section.js +0 -47
  490. package/dist/admin/surface/test/VersionsSection.d.ts +0 -4
  491. package/dist/admin/surface/test/fields.js +0 -216
  492. package/dist/admin/surface/test/testPage.css +0 -97
  493. package/dist/admin/surface/useTestDocument.d.ts +0 -32
  494. package/dist/admin/surface/useTestDocument.js +0 -415
  495. /package/dist/{admin → testSurface}/PreviewLinks.d.ts +0 -0
  496. /package/dist/{admin → testSurface}/actions/decide.model.d.ts +0 -0
  497. /package/dist/{admin → testSurface}/actions/decide.model.js +0 -0
  498. /package/dist/{admin → testSurface}/allocation.model.d.ts +0 -0
  499. /package/dist/{admin → testSurface}/allocation.model.js +0 -0
  500. /package/dist/{admin → testSurface}/arms/arms.model.d.ts +0 -0
  501. /package/dist/{admin → testSurface}/arms/arms.model.js +0 -0
  502. /package/dist/{admin → testSurface}/arms/pageTarget.model.d.ts +0 -0
  503. /package/dist/{admin → testSurface}/arms/pageTarget.model.js +0 -0
  504. /package/dist/{admin → testSurface}/arms/params.model.d.ts +0 -0
  505. /package/dist/{admin → testSurface}/arms/params.model.js +0 -0
  506. /package/dist/{admin → testSurface}/copy/advanced.d.ts +0 -0
  507. /package/dist/{admin → testSurface}/copy/advanced.js +0 -0
  508. /package/dist/{admin → testSurface}/copy/arms.d.ts +0 -0
  509. /package/dist/{admin → testSurface}/copy/arms.js +0 -0
  510. /package/dist/{admin → testSurface}/copy/audience.d.ts +0 -0
  511. /package/dist/{admin → testSurface}/copy/audience.js +0 -0
  512. /package/dist/{admin → testSurface}/copy/recommendation.d.ts +0 -0
  513. /package/dist/{admin → testSurface}/copy/recommendation.js +0 -0
  514. /package/dist/{admin → testSurface}/copy/setting.d.ts +0 -0
  515. /package/dist/{admin → testSurface}/copy/setting.js +0 -0
  516. /package/dist/{admin → testSurface}/format/date.d.ts +0 -0
  517. /package/dist/{admin → testSurface}/format/date.js +0 -0
  518. /package/dist/{admin → testSurface}/labels.d.ts +0 -0
  519. /package/dist/{admin → testSurface}/labels.js +0 -0
  520. /package/dist/{admin → testSurface}/lockedNotice.model.d.ts +0 -0
  521. /package/dist/{admin → testSurface}/lockedNotice.model.js +0 -0
  522. /package/dist/{admin → testSurface}/metricSource.model.d.ts +0 -0
  523. /package/dist/{admin → testSurface}/metricSource.model.js +0 -0
  524. /package/dist/{admin → testSurface}/placements/placementLabels.model.d.ts +0 -0
  525. /package/dist/{admin → testSurface}/placements/placementLabels.model.js +0 -0
  526. /package/dist/{admin → testSurface}/placements/usePlacementLabels.d.ts +0 -0
  527. /package/dist/{admin → testSurface}/placements/usePlacementLabels.js +0 -0
  528. /package/dist/{admin → testSurface}/reload.d.ts +0 -0
  529. /package/dist/{admin → testSurface}/reload.js +0 -0
  530. /package/dist/{admin → testSurface}/results/CappedCell.d.ts +0 -0
  531. /package/dist/{admin → testSurface}/results/CappedCell.js +0 -0
  532. /package/dist/{admin → testSurface}/results/CiChart.d.ts +0 -0
  533. /package/dist/{admin → testSurface}/results/CiChart.js +0 -0
  534. /package/dist/{admin → testSurface}/results/DataQualityPanel.d.ts +0 -0
  535. /package/dist/{admin → testSurface}/results/DataQualityPanel.js +0 -0
  536. /package/dist/{admin → testSurface}/results/DataTable.d.ts +0 -0
  537. /package/dist/{admin → testSurface}/results/DataTable.js +0 -0
  538. /package/dist/{admin → testSurface}/results/StatTile.d.ts +0 -0
  539. /package/dist/{admin → testSurface}/results/StatTile.js +0 -0
  540. /package/dist/{admin → testSurface}/results/chart.model.d.ts +0 -0
  541. /package/dist/{admin → testSurface}/results/chart.model.js +0 -0
  542. /package/dist/{admin → testSurface}/results/format.d.ts +0 -0
  543. /package/dist/{admin → testSurface}/results/format.js +0 -0
  544. /package/dist/{admin → testSurface}/results/legacy.d.ts +0 -0
  545. /package/dist/{admin → testSurface}/results/legacy.js +0 -0
  546. /package/dist/{admin → testSurface}/results/releasePages.model.d.ts +0 -0
  547. /package/dist/{admin → testSurface}/results/releasePages.model.js +0 -0
  548. /package/dist/{admin → testSurface}/results/results.model.d.ts +0 -0
  549. /package/dist/{admin → testSurface}/results/snapshot.d.ts +0 -0
  550. /package/dist/{admin → testSurface}/results/snapshot.js +0 -0
  551. /package/dist/{admin → testSurface}/review/review.model.d.ts +0 -0
  552. /package/dist/{admin → testSurface}/review/review.model.js +0 -0
  553. /package/dist/{admin → testSurface}/surface/contracts.js +0 -0
  554. /package/dist/{admin → testSurface}/surface/pageBlock/pageBlock.model.d.ts +0 -0
  555. /package/dist/{admin → testSurface}/surface/pageBlock/parts.d.ts +0 -0
  556. /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
  557. /package/dist/{admin → testSurface}/surface/results/recommendation.model.d.ts +0 -0
  558. /package/dist/{admin → testSurface}/surface/results/recommendation.model.js +0 -0
  559. /package/dist/{admin → testSurface}/surface/setting/parts.d.ts +0 -0
  560. /package/dist/{admin → testSurface}/surface/setting/setting.model.d.ts +0 -0
  561. /package/dist/{admin → testSurface}/surface/setting/setting.model.js +0 -0
  562. /package/dist/{admin → testSurface}/surface/test/AdvancedSection.d.ts +0 -0
  563. /package/dist/{admin → testSurface}/surface/test/PageHoldout.d.ts +0 -0
  564. /package/dist/{admin → testSurface}/surface/test/Rail.d.ts +0 -0
  565. /package/dist/{admin → testSurface}/surface/test/TargetingSection.d.ts +0 -0
  566. /package/dist/{admin → testSurface}/surface/test/jumpToSection.d.ts +0 -0
  567. /package/dist/{admin → testSurface}/surface/test/jumpToSection.js +0 -0
  568. /package/dist/{admin → testSurface}/surface/test/pageParts.d.ts +0 -0
  569. /package/dist/{admin → testSurface}/targeting/targeting.model.d.ts +0 -0
  570. /package/dist/{admin → testSurface}/targeting/targeting.model.js +0 -0
  571. /package/dist/{admin → testSurface}/theme.d.ts +0 -0
  572. /package/dist/{admin → testSurface}/theme.js +0 -0
  573. /package/dist/{admin → testSurface}/useApi.js +0 -0
@@ -1,5 +1,6 @@
1
1
  import { asymmetricGoalsCopy, placementUncheckedCopy } from './readiness.js';
2
2
  export const ACTIONS_COPY = {
3
+ decisionUnavailable: 'This round can no longer be decided here. Copy your note before closing.',
3
4
  start: 'Start',
4
5
  restart: 'Start a new round',
5
6
  stop: 'Stop',
@@ -9,13 +10,29 @@ export const ACTIONS_COPY = {
9
10
  finish: 'Finish archiving',
10
11
  archive: 'Archive',
11
12
  discard: 'Discard winner',
12
- startBody: 'Start this test?',
13
- restartBody: 'Starting again begins a new round; results restart.',
14
- stopBody: 'Everyone will see the Original. Starting again begins a new round; results restart.',
13
+ startBody: 'The test will start showing versions to visitors and collecting results.',
14
+ restartBody: 'Visitors will start seeing test versions again. New results go into a new round, and earlier results are kept.',
15
+ stopBody: 'Visitors will go back to the Original. The test stops collecting data and keeps its results. Starting again begins a new round.',
15
16
  original: 'Everyone will see the Original.',
16
- discardBody: 'Everyone goes back to the Original. The decision note is kept.',
17
- archiveBody: 'Archive this test?',
18
- finishBody: 'The content has been updated. Finish archiving this test.',
17
+ discardBody: 'Visitors go back to the Original. The test moves to Archived and keeps its results and decision note. You can then delete it.',
18
+ archiveBody: "The test moves out of the active list into Archived. It won't collect any more data, and visitors will keep seeing the Original. You can still view the results or delete the test later. You can't restart it.",
19
+ finishBody: 'The updated content stays in place. The test moves to Archived and keeps its results. You can then delete it.',
20
+ hardCodedBody: 'The test moves to Archived and keeps its results. The site will use the version your developer made permanent. You can then delete the test.',
21
+ confirmPermanentWinner: 'Confirm permanent winner',
22
+ titleLead: {
23
+ restart: 'Start a new round for',
24
+ decide: 'Decide the winner for',
25
+ 'release-holdout': 'Release the holdout for',
26
+ 'make-content': 'Make the winner permanent for',
27
+ discard: 'Discard the winner for',
28
+ 'hard-coded': 'Confirm the permanent winner for',
29
+ allocate: 'Let more people into',
30
+ 'add-metric': 'Add a goal to',
31
+ 'release-pages': 'Release pages for'
32
+ },
33
+ decideBody: 'Choose the version visitors should see going forward. The test round ends and its results are kept.',
34
+ decideRoundMissing: "Couldn't find the versions from this round. Close this dialog and check the current round.",
35
+ actionChanged: 'This test changed. Close this dialog to see the current actions.',
19
36
  noResults: 'There are no results yet.',
20
37
  noRecommendation: "The results don't recommend a group yet.",
21
38
  different: 'You chose a different group than the results recommend.',
@@ -32,7 +49,7 @@ export const ACTIONS_COPY = {
32
49
  contentArchived: 'The winner is now the content and the test is archived.',
33
50
  dismissLabel: (page)=>`Dismiss ${page}`,
34
51
  undoLabel: (page)=>`Undo dismiss ${page}`,
35
- dismissHelp: "Dismiss a page you'll update by hand, then finish archiving.",
52
+ dismissHelp: "Dismiss each page you plan to update by hand so you can finish archiving.",
36
53
  contentEntryNotDecided: "This test isn't decided, so its pages can't be changed.",
37
54
  contentEntryMissing: 'This page is no longer in the list. Reload to see the current list.',
38
55
  contentEntryDismissed: 'This page was already dismissed.',
@@ -45,18 +62,21 @@ export const ACTIONS_COPY = {
45
62
  failed: 'Failed',
46
63
  contentReasons: {
47
64
  localized: "This page has more than one language; Make it the content can't publish it safely yet. Copy the winning version by hand.",
48
- locked: 'Someone is editing this page. Wait for them to finish, then retry.',
65
+ locked: 'Someone is editing this page. Retry when they finish.',
49
66
  forbidden: "You can't read or update this page. Ask someone with access to update it by hand. If it was deleted or moved to trash, discard the winner to archive this test.",
50
67
  'not-found': 'This page could not be found. Check whether it was deleted.',
51
- validation: "This page couldn't be saved automatically. Update it by hand, then retry.",
68
+ validation: "This page couldn't be saved automatically. Update it by hand.",
52
69
  'update-failed': "This page couldn't be updated this time. Retry; if it keeps happening, ask a developer."
53
70
  },
54
71
  missingContent: 'This page no longer exists; nothing to change.',
55
- partial: "Some pages couldn't be updated. Fix them and retry."
72
+ partial: "Some pages still need changes."
56
73
  };
74
+ export const actionTitle = (action, test)=>`${action} “${test}”?`;
75
+ export const actionTitleFor = (action, test)=>`${action} for “${test}”?`;
76
+ export const actionsForTest = (test)=>`Actions for ${test}`;
57
77
  export const decideCopy = (winner, holdout, original)=>original ? ACTIONS_COPY.original : holdout ? `Everyone except the holdout will see ${winner}. The holdout keeps seeing the Original so we can measure the shipped change.` : `Everyone will see ${winner}.`;
58
78
  export const releaseCopy = (winner)=>`The holdout will see ${winner} too. Measuring since shipping ends.`;
59
- export const makeContentCopy = (winner, kind)=>kind === 'flag' ? `Saves ${winner}'s settings as the new defaults so the test can be archived.` : `Copies ${winner} into the page content so the test can be archived.`;
79
+ export const makeContentCopy = (winner, kind)=>kind === 'flag' ? `Saves ${winner}'s settings as the new defaults so the test can be archived.` : kind === 'page' ? `Archives the test and keeps serving ${winner} at the test's addresses. The pages and results are kept.` : `Copies ${winner} into the page content so the test can be archived.`;
60
80
  export const hardCodedLabel = (winner)=>`The developer has hard-coded ${winner}`;
61
81
  /** Old reports can contain host error text: never interpolate an unknown string. */ export const contentReportCopy = (reason, ok = false)=>reason === 'not-found' && ok ? ACTIONS_COPY.missingContent : ACTIONS_COPY.contentReasons[reason !== undefined && Object.hasOwn(ACTIONS_COPY.contentReasons, reason) ? reason : 'update-failed'];
62
82
  // Each dismiss/restore refusal code has its own sentence; server text is never shown.
@@ -1,15 +1,20 @@
1
1
  export declare const API_MESSAGES: {
2
+ readonly testAlreadyDeleted: "This test was already deleted. Reload the page.";
3
+ readonly deleteInvalidStatus: "Only draft and archived tests can be deleted. Open the test to see how to archive it.";
4
+ readonly testNoLongerDraft: "This test is no longer a draft. Reload the page.";
2
5
  readonly notFound: "This test no longer exists.";
3
6
  readonly goalNotFound: "That goal no longer exists. Choose another goal.";
4
7
  readonly roundChanged: "This round has changed. Reload the page.";
5
8
  readonly roundNotFound: "That round no longer exists. Choose another round.";
6
- readonly commitUnverified: "The change may not have been saved. Reload and try again.";
9
+ readonly commitUnverified: "The change may not have been saved. Reload to check.";
10
+ readonly transactionIsolation: "The site's database settings don't allow this right now. Ask your developer to check the server log.";
7
11
  readonly notImplemented: "This isn't available yet.";
8
12
  readonly unauthenticated: "Your session has expired. Sign in again.";
9
13
  readonly forbidden: "You don't have permission to do this.";
10
- readonly network: "Couldn't reach the server. Check your connection and try again.";
14
+ readonly network: "Couldn't reach the server. Check your connection.";
11
15
  readonly failed: "Couldn't complete this change. Try again.";
12
- readonly unreadable: "Couldn't read the server's response. Reload and try again.";
16
+ readonly unreadable: "Couldn't read the server's response. Reload to check.";
17
+ readonly deleteImpactUnavailable: "Couldn't check what visitors will see after deletion. Reopen this dialog to check again.";
13
18
  };
14
19
  export declare const LOCKED_MESSAGES: {
15
20
  readonly creation: "Set when the test was created.";
@@ -22,6 +27,10 @@ export declare const LOCKED_MESSAGES: {
22
27
  };
23
28
  export declare function refusalMessage(code: string | undefined, status: number, message?: string, options?: {
24
29
  notFound?: string;
30
+ forbidden?: string;
25
31
  codes?: Readonly<Record<string, string>>;
26
32
  fallback?: string;
27
- }): string;
33
+ }, detail?: unknown): string;
34
+ export declare const INPUT_COPY: {
35
+ readonly selectRequired: "Choose an option.";
36
+ };
@@ -1,15 +1,21 @@
1
+ import { unpublishedPlacementsCopy } from './readiness.js';
1
2
  export const API_MESSAGES = {
3
+ testAlreadyDeleted: 'This test was already deleted. Reload the page.',
4
+ deleteInvalidStatus: 'Only draft and archived tests can be deleted. Open the test to see how to archive it.',
5
+ testNoLongerDraft: 'This test is no longer a draft. Reload the page.',
2
6
  notFound: 'This test no longer exists.',
3
7
  goalNotFound: 'That goal no longer exists. Choose another goal.',
4
8
  roundChanged: 'This round has changed. Reload the page.',
5
9
  roundNotFound: 'That round no longer exists. Choose another round.',
6
- commitUnverified: 'The change may not have been saved. Reload and try again.',
10
+ commitUnverified: 'The change may not have been saved. Reload to check.',
11
+ transactionIsolation: "The site's database settings don't allow this right now. Ask your developer to check the server log.",
7
12
  notImplemented: "This isn't available yet.",
8
13
  unauthenticated: 'Your session has expired. Sign in again.',
9
14
  forbidden: "You don't have permission to do this.",
10
- network: "Couldn't reach the server. Check your connection and try again.",
15
+ network: "Couldn't reach the server. Check your connection.",
11
16
  failed: "Couldn't complete this change. Try again.",
12
- unreadable: "Couldn't read the server's response. Reload and try again."
17
+ unreadable: "Couldn't read the server's response. Reload to check.",
18
+ deleteImpactUnavailable: "Couldn't check what visitors will see after deletion. Reopen this dialog to check again."
13
19
  };
14
20
  export const LOCKED_MESSAGES = {
15
21
  creation: 'Set when the test was created.',
@@ -20,14 +26,18 @@ export const LOCKED_MESSAGES = {
20
26
  archived: "Archived tests can't be changed.",
21
27
  other: "Can't be changed in this state."
22
28
  };
23
- export function refusalMessage(code, status, message, options) {
24
- // A per-call code wins over the status branches: entry-not-found is a 404 that is not "this test no longer exists".
29
+ export function refusalMessage(code, status, message, options, detail) {
30
+ // Authorization takes priority over code copy; entry-specific 404s still name the missing entry.
25
31
  const mapped = code && options?.codes && Object.hasOwn(options.codes, code) ? options.codes[code] : undefined;
26
- if (mapped !== undefined) return mapped;
27
32
  if (code === 'unauthenticated' || status === 401) return API_MESSAGES.unauthenticated;
28
- if (code === 'not-found' || status === 404) return options?.notFound ?? API_MESSAGES.notFound;
33
+ if (code === 'forbidden' || status === 403) return options?.forbidden ?? API_MESSAGES.forbidden;
34
+ if (code === 'not-found' || status === 404) return mapped ?? options?.notFound ?? API_MESSAGES.notFound;
29
35
  if (code === 'commit-unverified') return API_MESSAGES.commitUnverified;
30
36
  if (code === 'not-implemented' || status === 501) return API_MESSAGES.notImplemented;
31
- if (code === 'forbidden' || status === 403) return API_MESSAGES.forbidden;
37
+ if (mapped !== undefined) return mapped;
38
+ if (code === 'placement-unpublished') return unpublishedPlacementsCopy(detail);
32
39
  return options?.fallback ?? (message || API_MESSAGES.failed);
33
40
  }
41
+ export const INPUT_COPY = {
42
+ selectRequired: 'Choose an option.'
43
+ };
@@ -0,0 +1,12 @@
1
+ /** Shared by server readiness checks and client placement lists. */
2
+ export declare const PLACEMENT_LANGUAGES: {
3
+ readonly labelWithCode: (label: string, code: string) => string;
4
+ readonly allLocales: "All languages";
5
+ readonly locales: (names: string) => string;
6
+ };
7
+ export interface PlacementLanguages {
8
+ locales?: readonly string[];
9
+ allLocales?: boolean;
10
+ }
11
+ /** Shared suffix for server findings, placement rows, and delete-impact details. */
12
+ export declare function placementLanguageSuffix({ locales, allLocales }: PlacementLanguages): string;
@@ -0,0 +1,8 @@
1
+ /** Shared by server readiness checks and client placement lists. */ export const PLACEMENT_LANGUAGES = {
2
+ labelWithCode: (label, code)=>`${label} (${code})`,
3
+ allLocales: 'All languages',
4
+ locales: (names)=>`Languages: ${names}`
5
+ };
6
+ /** Shared suffix for server findings, placement rows, and delete-impact details. */ export function placementLanguageSuffix({ locales, allLocales }) {
7
+ return allLocales ? ` · ${PLACEMENT_LANGUAGES.allLocales}` : locales?.length ? ` · ${PLACEMENT_LANGUAGES.locales(locales.join(', '))}` : '';
8
+ }
@@ -1,5 +1,6 @@
1
1
  export declare const METRICS_COPY: {
2
2
  readonly source: "Measured by";
3
+ readonly browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.";
3
4
  readonly revenueHint: "Very large amounts are counted only up to the level that the top 1% of amounts reached in the 90 days before the test starts; totals are always shown in full.";
4
5
  };
5
6
  export declare const METRIC_KIND_LABELS: {
@@ -1,5 +1,6 @@
1
1
  export const METRICS_COPY = {
2
2
  source: 'Measured by',
3
+ browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.",
3
4
  revenueHint: 'Very large amounts are counted only up to the level that the top 1% of amounts reached in the 90 days before the test starts; totals are always shown in full.'
4
5
  };
5
6
  export const METRIC_KIND_LABELS = {
@@ -0,0 +1,84 @@
1
+ export declare const PAGE_COPY: {
2
+ readonly loading: "Loading pages…";
3
+ readonly empty: "There are no pages here yet.";
4
+ readonly emptyPage: "There are no eligible pages on this results page.";
5
+ readonly error: "Couldn't load pages.";
6
+ readonly retry: "Try again";
7
+ readonly draft: "Draft";
8
+ readonly published: "Published";
9
+ readonly changed: "Changed";
10
+ readonly noPath: "This page has no address yet.";
11
+ readonly justNow: "Just now";
12
+ readonly search: "Search pages";
13
+ readonly searchHint: "Search by title or address";
14
+ readonly previous: "Previous page";
15
+ readonly next: "Next page";
16
+ readonly puckEditor: "Puck editor";
17
+ readonly blocksEditor: "Page editor";
18
+ readonly pageLimit: "Search to narrow the list.";
19
+ readonly choose: "Choose a page";
20
+ readonly where: "Where it shows";
21
+ readonly open: "Open";
22
+ readonly preview: "Preview";
23
+ readonly contentChecksOff: "Content checks are off for this page type.";
24
+ readonly copyIntro: "To create a test of this page, we'll copy the page and use the copy as the test version.";
25
+ readonly copyVisibility: "The copy stays private as a draft. Visitors at the Original's address can see it once you start the test.";
26
+ readonly copyTitle: "Title";
27
+ readonly copyAddressLabel: "Address";
28
+ readonly copyConfirm: "Make the copy";
29
+ readonly copyCancel: "Cancel";
30
+ readonly copyChecking: "Checking the title and address…";
31
+ readonly copying: "Making the draft…";
32
+ readonly copyOpen: "Open draft copy";
33
+ readonly copyOpenPage: "Open draft page";
34
+ readonly copyDraftSelected: "The selected page is still a draft.";
35
+ readonly copyPublishWhy: "The test can start once this copy is published.";
36
+ readonly copyEdit: "Edit the copy.";
37
+ readonly copyPublish: "Publish the copy when it's ready.";
38
+ readonly copyPublishedAddress: "Publishing the copy also makes it reachable at its own address until the test starts.";
39
+ readonly copyRouting: "During the test, visitors stay at the Original's address while the test uses the copy's address behind the scenes.";
40
+ readonly copyExisting: "Or choose an existing page.";
41
+ readonly copyUnavailable: "This page needs to be copied by hand because the site couldn't make a draft here.";
42
+ readonly copyNotEnabled: "Your site uses manual copies for this page type.";
43
+ readonly copyProtected: "Some fields have read restrictions, so make the copy in the page editor.";
44
+ readonly copyNoAccess: "Someone else needs to make the copy because your account can't create pages here.";
45
+ readonly copyAsk: "Ask someone with permission to make a copy of the Original.";
46
+ readonly copyChooseAfterAsk: "Then choose the copy below.";
47
+ readonly copyDisabled: "This page type requires a new page because duplication is disabled.";
48
+ readonly copyNewPage: "Create a new page.";
49
+ readonly copyContent: "Copy the content from the Original.";
50
+ readonly copyNoDrafts: "Pages of this type go live as soon as they're saved, so you need to make the copy by hand.";
51
+ readonly copyLocalized: "The Original has fields for different languages, so make the copy in the page editor.";
52
+ readonly copyEmbeddedTest: "The Original contains a test block, so make the copy in the page editor.";
53
+ readonly copyOriginal: "The Original needs a published page with no pending edits before it can be copied here.";
54
+ readonly copyChooseOriginal: "Choose the Original before making a test version.";
55
+ readonly copyAddress: "The copy needs an available address, so make it in the page editor.";
56
+ readonly copyUnique: "Another page already uses a value the copy needs to change, so the copy wasn't made. If it's an earlier copy, choose it in the page list.";
57
+ readonly copyTransactionLost: "Something went wrong, and nothing was copied. Try again.";
58
+ readonly copyChanged: "The test, the Original, or the proposed address changed. Check the latest details before making the copy.";
59
+ readonly duplicateStep: "Choose Duplicate for the Original.";
60
+ readonly keepTitleStep: "Keep the Original's title unless you're testing a new title.";
61
+ readonly homepageStep: "If the copy has a Homepage setting, turn it off.";
62
+ readonly ownAddress: "Give the copy its own address.";
63
+ readonly saveCopy: "Save the copy.";
64
+ readonly chooseCopy: "Choose the copy below.";
65
+ };
66
+ export declare const usedPageCopy: (label: string) => string;
67
+ export declare const usedAddressCopy: (label: string, path: string) => string;
68
+ export declare const openCollectionCopy: (collection: string) => string;
69
+ export declare const pageStepCopy: (label: string) => string;
70
+ export declare const pageNotFoundCopy: (path: string, collection: string) => string;
71
+ export declare const pageFieldCopy: (label: string) => string;
72
+ export declare const noPageMatches: (query: string) => string;
73
+ export declare const pageRangeCopy: (first: number, last: number, total: number) => string;
74
+ export declare const pageCountCopy: (count: number) => string;
75
+ export declare const draftPageAddress: (address: string) => string;
76
+ export declare const lastEditedCopy: (time: string) => string;
77
+ export declare const makeCopyLabel: (label: string) => string;
78
+ export declare const copyLocation: (collection: string) => string;
79
+ export declare const copiedPage: (title: string, path: string) => string;
80
+ export declare function orphanedPages(pages: Array<{
81
+ id: string | number;
82
+ title?: string;
83
+ path: string | null;
84
+ }>, collection: string): string;
@@ -0,0 +1,90 @@
1
+ export const PAGE_COPY = {
2
+ loading: 'Loading pages…',
3
+ empty: 'There are no pages here yet.',
4
+ emptyPage: 'There are no eligible pages on this results page.',
5
+ error: "Couldn't load pages.",
6
+ retry: 'Try again',
7
+ draft: 'Draft',
8
+ published: 'Published',
9
+ changed: 'Changed',
10
+ noPath: 'This page has no address yet.',
11
+ justNow: 'Just now',
12
+ search: 'Search pages',
13
+ searchHint: 'Search by title or address',
14
+ previous: 'Previous page',
15
+ next: 'Next page',
16
+ puckEditor: 'Puck editor',
17
+ blocksEditor: 'Page editor',
18
+ pageLimit: 'Search to narrow the list.',
19
+ choose: 'Choose a page',
20
+ where: 'Where it shows',
21
+ open: 'Open',
22
+ preview: 'Preview',
23
+ contentChecksOff: 'Content checks are off for this page type.',
24
+ copyIntro: "To create a test of this page, we'll copy the page and use the copy as the test version.",
25
+ copyVisibility: "The copy stays private as a draft. Visitors at the Original's address can see it once you start the test.",
26
+ copyTitle: 'Title',
27
+ copyAddressLabel: 'Address',
28
+ copyConfirm: 'Make the copy',
29
+ copyCancel: 'Cancel',
30
+ copyChecking: 'Checking the title and address…',
31
+ copying: 'Making the draft…',
32
+ copyOpen: 'Open draft copy',
33
+ copyOpenPage: 'Open draft page',
34
+ copyDraftSelected: 'The selected page is still a draft.',
35
+ copyPublishWhy: 'The test can start once this copy is published.',
36
+ copyEdit: 'Edit the copy.',
37
+ copyPublish: "Publish the copy when it's ready.",
38
+ copyPublishedAddress: 'Publishing the copy also makes it reachable at its own address until the test starts.',
39
+ copyRouting: "During the test, visitors stay at the Original's address while the test uses the copy's address behind the scenes.",
40
+ copyExisting: 'Or choose an existing page.',
41
+ copyUnavailable: "This page needs to be copied by hand because the site couldn't make a draft here.",
42
+ copyNotEnabled: 'Your site uses manual copies for this page type.',
43
+ copyProtected: 'Some fields have read restrictions, so make the copy in the page editor.',
44
+ copyNoAccess: "Someone else needs to make the copy because your account can't create pages here.",
45
+ copyAsk: 'Ask someone with permission to make a copy of the Original.',
46
+ copyChooseAfterAsk: 'Then choose the copy below.',
47
+ copyDisabled: 'This page type requires a new page because duplication is disabled.',
48
+ copyNewPage: 'Create a new page.',
49
+ copyContent: 'Copy the content from the Original.',
50
+ copyNoDrafts: "Pages of this type go live as soon as they're saved, so you need to make the copy by hand.",
51
+ copyLocalized: 'The Original has fields for different languages, so make the copy in the page editor.',
52
+ copyEmbeddedTest: 'The Original contains a test block, so make the copy in the page editor.',
53
+ copyOriginal: 'The Original needs a published page with no pending edits before it can be copied here.',
54
+ copyChooseOriginal: 'Choose the Original before making a test version.',
55
+ copyAddress: 'The copy needs an available address, so make it in the page editor.',
56
+ copyUnique: "Another page already uses a value the copy needs to change, so the copy wasn't made. If it's an earlier copy, choose it in the page list.",
57
+ copyTransactionLost: 'Something went wrong, and nothing was copied. Try again.',
58
+ copyChanged: 'The test, the Original, or the proposed address changed. Check the latest details before making the copy.',
59
+ duplicateStep: 'Choose Duplicate for the Original.',
60
+ keepTitleStep: "Keep the Original's title unless you're testing a new title.",
61
+ homepageStep: 'If the copy has a Homepage setting, turn it off.',
62
+ ownAddress: 'Give the copy its own address.',
63
+ saveCopy: 'Save the copy.',
64
+ chooseCopy: 'Choose the copy below.'
65
+ };
66
+ export const usedPageCopy = (label)=>`This is ${label}.`;
67
+ export const usedAddressCopy = (label, path)=>`This page needs its own address. It shares ${path} with ${label}.`;
68
+ export const openCollectionCopy = (collection)=>`Open ${collection}`;
69
+ export const pageStepCopy = (label)=>`A page for ${label}`;
70
+ export const pageNotFoundCopy = (path, collection)=>`${path} isn't in ${collection}. Choose a page.`;
71
+ export const pageFieldCopy = (label)=>`Page for ${label}`;
72
+ export const noPageMatches = (query)=>`No pages match “${query}”.`;
73
+ export const pageRangeCopy = (first, last, total)=>`${first.toLocaleString('en-US')}–${last.toLocaleString('en-US')} of ${total.toLocaleString('en-US')} pages`;
74
+ export const pageCountCopy = (count)=>`${count} ${count === 1 ? 'page' : 'pages'} shown`;
75
+ export const draftPageAddress = (address)=>`Draft address: ${address}`;
76
+ export const lastEditedCopy = (time)=>`Edited ${time}`;
77
+ export const makeCopyLabel = (label)=>`Make ${label} from the Original`;
78
+ export const copyLocation = (collection)=>`You can find the copy later in ${collection}.`;
79
+ export const copiedPage = (title, path)=>`We made a draft copy of “${title}” at ${path}.`;
80
+ export function orphanedPages(pages, collection) {
81
+ const names = pages.map(({ id, title, path })=>{
82
+ if (path) return title ? `${title} (${path})` : path;
83
+ return title ? `${title} (ID ${id})` : `page ID ${id}`;
84
+ });
85
+ if (pages.length === 1) {
86
+ if (!pages[0]?.path) return `Something went wrong while copying, but a page was made: ${names[0]}. Open it in ${collection} to give it an address, or delete it.`;
87
+ return `Something went wrong while copying, but a page was made: ${names[0]}. Choose it in the page list, or delete it in ${collection}.`;
88
+ }
89
+ return `Something went wrong while copying, but these pages were made: ${names.join(', ')}. Choose one in the page list, or delete them in ${collection}.`;
90
+ }
@@ -3,16 +3,32 @@ 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";
13
+ readonly refresh: "Refresh readiness";
8
14
  readonly addGoal: "Add a goal";
9
15
  readonly needsAttention: "Needs attention";
16
+ readonly needsAttentionPrefix: "Needs attention: ";
10
17
  readonly missingVersions: "This test is missing its saved versions. Open the test and check its setup before changing this page.";
18
+ readonly addMissingVersionContent: "Add content to the empty versions.";
19
+ readonly summaryMissingVersionContent: "Add or publish the missing version content.";
20
+ readonly saveGeneralError: "Couldn't save. Reload to check the saved test.";
21
+ readonly changing: "Saving this change…";
22
+ readonly reloadAfterError: "Couldn't save the test. Reload to check its saved settings before starting.";
23
+ readonly chooseGoalToAdd: "Choose a goal to add it to this test.";
24
+ readonly reloadFirst: "Reload to see the latest settings and discard your unfinished edits.";
11
25
  readonly ready: "Ready to start.";
12
- readonly saveFirst: "Save your changes first.";
26
+ readonly saveFirst: "Wait for your changes to save.";
27
+ readonly finishEdits: "Finish your edits before starting the test.";
13
28
  readonly saving: "Saving…";
14
29
  readonly saved: "Saved";
15
30
  readonly saveError: "Couldn't save — see the highlighted field";
31
+ readonly invalidRequest: "This test's setup couldn't be checked.";
16
32
  readonly checkError: "Couldn't check readiness. Try again.";
17
33
  readonly checking: "Checking readiness…";
18
34
  readonly retry: "Try again";
@@ -24,7 +40,8 @@ export declare const READINESS_COPY: {
24
40
  readonly allocate: "Let more people in";
25
41
  readonly everyone: "Everyone already takes part.";
26
42
  readonly participation: "How many people take part (%)";
27
- readonly noPlacements: "Not on a page yet. Open a page, add an Experiment block and choose this test.";
43
+ readonly noPlacements: "This test needs a block on a page. Add it to an Experiment block.";
44
+ readonly placementRemoved: "The block for this test was removed from its page, so it can't start again. Its results are kept. To test the block again, start a new test from the page.";
28
45
  readonly noPoint: "Choose the setting to test.";
29
46
  readonly busy: "Another test is already running on this setting. Stop it first.";
30
47
  readonly noGoal: "Choose a goal.";
@@ -36,6 +53,8 @@ export declare const READINESS_COPY: {
36
53
  readonly uncheckedPages: "Version pages aren't checked; make sure each one is published.";
37
54
  readonly chooseDifferentPage: "Choose a different page";
38
55
  readonly choosePages: "Choose pages";
56
+ readonly publishPage: "Publish the page";
57
+ readonly saveAndPublishPage: "Save and publish the page";
39
58
  readonly noTargets: "Choose a page for each version.";
40
59
  readonly pageVisitors: "Whole-page tests count visitors. Create the test again counting visitors.";
41
60
  readonly blockPathRule: "Remove the page-path rule in Who takes part; page block tests run on their page.";
@@ -55,22 +74,32 @@ export declare const unpublishedPageCopy: (path: string, context?: {
55
74
  }) => string;
56
75
  /** Old responses may include raw host errors; unknown strings use authored copy. */
57
76
  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.";
77
+ export declare const fixFieldsNext: (name: string) => string;
58
78
  export declare const nextCopy: (sentence: string) => string;
59
79
  export declare const versionsNext: (detail: string) => string;
60
- export declare const contentNext: (group: string) => string;
80
+ export declare const contentNext: (group: string, page?: string) => string;
81
+ export declare const draftContentNext: (group: string, page: string) => string;
82
+ export declare const unsavedContentNext: (group: string) => string;
83
+ export declare const partialContentNext: (group: string, page: string) => string;
84
+ export declare function summaryContentNext(groups: string[], draftGroups?: string[]): string;
61
85
  export declare const parameterNext: (parameter: string, group: string) => string;
62
86
  export declare const placementNext: (group: string, detail: string) => string;
63
87
  export declare const goalPeopleNext: (people: string) => string;
64
88
  export declare const ruleNext: (detail: string) => string;
65
89
  export declare const attributeNext: (attribute: string) => string;
90
+ export declare const firstStartOnlyCopy: (status: string) => string;
66
91
  export declare const stoppedCopy: (date: string | null) => string;
67
92
  export declare const decidedCopy: (date: string | null, winner: string) => string;
68
93
  export declare const runningCopy: (date: string | null, people: number | null, days: number | null) => string;
94
+ export declare const lastBlockPlacementCopy: (name: string, removingPage?: boolean) => string;
95
+ export declare const hiddenBlockPlacementCopy: (name: string) => string;
96
+ export declare const bulkBlockRemovalCopy: (name: string) => string;
97
+ export declare const pendingBlockRemovalCopy: (name: string) => string;
69
98
  /** After archive the guard protects the winner and the Original; only the winner page is "the winner". */
70
99
  export declare const pageGuardCopy: (name: string, status: "running" | "decided" | "archived", role?: "winner" | "original") => string;
71
100
  export declare const versionPageUnavailableCopy: (path: string, status?: string) => string;
72
101
  export declare const versionPageUncheckedCopy: (path: string, status?: string) => string;
73
- export declare const sameAddressCopy: (label: string, other: string, path: string, collection?: string) => string;
102
+ export declare const sameAddressCopy: (label: string, other: string, path: string) => string;
74
103
  export declare const identicalVersionCopy: (version: string) => string;
75
104
  /** Keep named actions aligned with the actual transition buttons. */
76
105
  export declare function placementGuardCopy(page: {
@@ -84,3 +113,8 @@ export declare function interactingTestsCopy(page: string, state: string, name:
84
113
  export declare const goalInSomeVersionsCopy: (name?: string) => string;
85
114
  export declare function asymmetricGoalsCopy(detail: unknown): string;
86
115
  export declare const placementUncheckedCopy: (page: string) => string;
116
+ export declare const moreBlockers: (count: number) => string;
117
+ export declare const unpublishedPlacementsCopy: (detail?: unknown) => string;
118
+ export declare const unpublishedPlacementCopy: (title?: string) => string;
119
+ export declare const finishEditCopy: (field: string) => string;
120
+ export declare const duplicateVersionCopy: (page: string) => string;
@@ -3,16 +3,32 @@ 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',
13
+ refresh: 'Refresh readiness',
8
14
  addGoal: 'Add a goal',
9
15
  needsAttention: 'Needs attention',
16
+ needsAttentionPrefix: 'Needs attention: ',
10
17
  missingVersions: 'This test is missing its saved versions. Open the test and check its setup before changing this page.',
18
+ addMissingVersionContent: 'Add content to the empty versions.',
19
+ summaryMissingVersionContent: 'Add or publish the missing version content.',
20
+ saveGeneralError: "Couldn't save. Reload to check the saved test.",
21
+ changing: 'Saving this change…',
22
+ reloadAfterError: "Couldn't save the test. Reload to check its saved settings before starting.",
23
+ chooseGoalToAdd: 'Choose a goal to add it to this test.',
24
+ reloadFirst: 'Reload to see the latest settings and discard your unfinished edits.',
11
25
  ready: 'Ready to start.',
12
- saveFirst: 'Save your changes first.',
26
+ saveFirst: 'Wait for your changes to save.',
27
+ finishEdits: 'Finish your edits before starting the test.',
13
28
  saving: 'Saving…',
14
29
  saved: 'Saved',
15
30
  saveError: "Couldn't save — see the highlighted field",
31
+ invalidRequest: "This test's setup couldn't be checked.",
16
32
  checkError: "Couldn't check readiness. Try again.",
17
33
  checking: 'Checking readiness…',
18
34
  retry: 'Try again',
@@ -24,7 +40,8 @@ export const READINESS_COPY = {
24
40
  allocate: 'Let more people in',
25
41
  everyone: 'Everyone already takes part.',
26
42
  participation: 'How many people take part (%)',
27
- noPlacements: 'Not on a page yet. Open a page, add an Experiment block and choose this test.',
43
+ noPlacements: 'This test needs a block on a page. Add it to an Experiment block.',
44
+ placementRemoved: "The block for this test was removed from its page, so it can't start again. Its results are kept. To test the block again, start a new test from the page.",
28
45
  noPoint: 'Choose the setting to test.',
29
46
  busy: 'Another test is already running on this setting. Stop it first.',
30
47
  noGoal: 'Choose a goal.',
@@ -36,6 +53,8 @@ export const READINESS_COPY = {
36
53
  uncheckedPages: "Version pages aren't checked; make sure each one is published.",
37
54
  chooseDifferentPage: 'Choose a different page',
38
55
  choosePages: 'Choose pages',
56
+ publishPage: 'Publish the page',
57
+ saveAndPublishPage: 'Save and publish the page',
39
58
  noTargets: 'Choose a page for each version.',
40
59
  pageVisitors: 'Whole-page tests count visitors. Create the test again counting visitors.',
41
60
  blockPathRule: 'Remove the page-path rule in Who takes part; page block tests run on their page.',
@@ -49,28 +68,44 @@ export const READINESS_COPY = {
49
68
  };
50
69
  export const unsupportedContentCopy = (page)=>`${page} has more than one language, so Make it the content isn't available for it; you'll copy the winning version by hand.`;
51
70
  export const pageInUseCopy = (path, version = false)=>version ? `${path} is already in another running or decided test. Make a new copy of the Original for this version, or finish that test first.` : `Another running or decided test already uses ${path}. Choose a different page, or finish that test first.`;
52
- 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.`;
71
+ 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} to get it ready for the test.` : `${path} isn't published yet, or no page has that address. Publish it in ${context.collection}, or choose another page.`;
53
72
  /** 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'];
54
73
  const withoutPeriod = (value)=>value.trim().replace(/[.!?]+$/, '');
74
+ export const fixFieldsNext = (name)=>`Fix the highlighted fields in ${name}.`;
55
75
  export const nextCopy = (sentence)=>`Next: ${sentence}`;
56
76
  export const versionsNext = (detail)=>`Fix the versions: ${withoutPeriod(detail)}.`;
57
- export const contentNext = (group)=>`Add content for ${group} on the page.`;
77
+ export const contentNext = (group, page = 'the page')=>`Add content for ${group} on ${page}.`;
78
+ export const draftContentNext = (group, page)=>`${group} has content in the draft of ${page}. ${READINESS_COPY.publishPage}.`;
79
+ export const unsavedContentNext = (group)=>`${group} has unsaved content. ${READINESS_COPY.saveAndPublishPage}.`;
80
+ export const partialContentNext = (group, page)=>`Fill ${group} in the empty Experiment blocks on ${page}.`;
81
+ export function summaryContentNext(groups, draftGroups = []) {
82
+ const format = new Intl.ListFormat('en-US');
83
+ return [
84
+ groups.length ? `Add or publish content for ${format.format(groups)}.` : '',
85
+ draftGroups.length ? `Publish the draft content for ${format.format(draftGroups)}.` : ''
86
+ ].filter(Boolean).join(' ');
87
+ }
58
88
  export const parameterNext = (parameter, group)=>`Set a value for ${parameter} on ${group}.`;
59
89
  export const placementNext = (group, detail)=>`Add content for ${group} wherever this setting is used${detail.trim() ? `: ${withoutPeriod(detail)}` : ''}.`;
60
90
  export const goalPeopleNext = (people)=>`This goal can't be measured for ${people}. Choose another goal.`;
61
91
  export const ruleNext = (detail)=>`Fix the rule: ${withoutPeriod(detail)}.`;
62
92
  export const attributeNext = (attribute)=>`Remove the rule on ${attribute}: it isn't available.`;
63
- export const stoppedCopy = (date)=>`Stopped${date ? ` ${date}` : ''}. Edit the versions, goal, audience or length below, then start again (results restart).`;
93
+ export const firstStartOnlyCopy = (status)=>`Only a draft that has never started can start this way. The test is currently ${status === 'draft' ? 'a draft' : status}.`;
94
+ export const stoppedCopy = (date)=>`Stopped${date ? ` ${date}` : ''}. You can edit the versions, goal, audience or length. Starting again resets the results.`;
64
95
  export const decidedCopy = (date, winner)=>`Decided${date ? ` ${date}` : ''}: ${winner}.`;
65
96
  export const runningCopy = (date, people, days)=>[
66
97
  date ? `Running since ${date}` : READINESS_COPY.running,
67
98
  people === null ? null : `${people.toLocaleString('en-US')} people so far`,
68
99
  days === null ? null : `about ${days} days to go`
69
100
  ].filter(Boolean).join(' · ');
70
- /** 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.`;
101
+ 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.`;
102
+ export const hiddenBlockPlacementCopy = (name)=>`“${name}” is running and this is the only published place it appears. Stop the test first, or keep its block visible on this page.`;
103
+ export const bulkBlockRemovalCopy = (name)=>`“${name}” is running and the pages in this change are the only published places it appears. Stop the test first.`;
104
+ 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.`;
105
+ /** 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}". Use "Release pages" on the test to free it.` : `This page is shown at other addresses because the finished test "${name}" made it the winner. Use "Release pages" on the test to free it.` : 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.`;
71
106
  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'}.`;
72
107
  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'}.`;
73
- export const sameAddressCopy = (label, other, path, collection)=>`${label} has the same address (${path}) as ${other}. Choose a different page.${collection ? ` Give the copy its own address in ${collection}, publish it, then choose it.` : ''}`;
108
+ export const sameAddressCopy = (label, other, path)=>`${label} has the same address (${path}) as ${other}. Choose a different page.`;
74
109
  export const identicalVersionCopy = (version)=>`${version} looks the same as the Original, so the test would compare nothing. Change it before you start.`;
75
110
  /** Keep named actions aligned with the actual transition buttons. */ export function placementGuardCopy(page, block, preExisting) {
76
111
  const action = (test)=>test.status === 'running' ? `stop ${test.name}` : `choose "Make it the content" or "Discard winner" on ${test.name}`;
@@ -89,3 +124,13 @@ export function asymmetricGoalsCopy(detail) {
89
124
  }).join('\n');
90
125
  }
91
126
  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.`;
127
+ export const moreBlockers = (count)=>`and ${count} more`;
128
+ export const unpublishedPlacementsCopy = (detail)=>(Array.isArray(detail) && detail.length ? detail : [
129
+ detail
130
+ ]).map((placement)=>{
131
+ const title = placement && typeof placement === 'object' && typeof placement.title === 'string' && placement.title.trim() ? placement.title.trim() : 'this page';
132
+ return unpublishedPlacementCopy(title);
133
+ }).join('\n');
134
+ export const unpublishedPlacementCopy = (title = 'this page')=>`The block you're testing is only on a draft of ${title}. Publish the page before you start.`;
135
+ export const finishEditCopy = (field)=>`Finish your edit to “${field}” before starting the test.`;
136
+ export const duplicateVersionCopy = (page)=>`The Experiment block on ${page} has the same version twice. Remove the extra version.`;