@delmaredigital/payload-experiments 0.4.0-rc.7 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (367) hide show
  1. package/README.md +9 -15
  2. package/dist/admin/MetricSourceSelect.js +10 -3
  3. package/dist/admin/armSelect/armSelect.model.d.ts +1 -1
  4. package/dist/admin/blocks/BlockPanel.d.ts +1 -0
  5. package/dist/admin/blocks/BlockPanel.js +75 -29
  6. package/dist/admin/blocks/model.js +7 -6
  7. package/dist/admin/copy/blocks.d.ts +14 -11
  8. package/dist/admin/copy/blocks.js +33 -22
  9. package/dist/admin/copy/goals.d.ts +15 -8
  10. package/dist/admin/copy/goals.js +18 -8
  11. package/dist/admin/copy/newTest.d.ts +10 -7
  12. package/dist/admin/copy/newTest.js +14 -7
  13. package/dist/admin/copy/status.d.ts +1 -1
  14. package/dist/admin/copy/status.js +2 -1
  15. package/dist/admin/pageCollections.d.ts +1 -0
  16. package/dist/admin/pageCollections.js +3 -0
  17. package/dist/admin/placementStatus.model.js +5 -3
  18. package/dist/admin/status.model.d.ts +1 -0
  19. package/dist/admin/status.model.js +2 -1
  20. package/dist/admin/surface/ResultsRoute.js +12 -10
  21. package/dist/admin/surface/SurfaceShell.d.ts +4 -2
  22. package/dist/admin/surface/SurfaceShell.js +28 -3
  23. package/dist/admin/surface/TestRowMenu.d.ts +13 -0
  24. package/dist/admin/surface/TestRowMenu.js +163 -0
  25. package/dist/admin/surface/TestsHome.d.ts +4 -3
  26. package/dist/admin/surface/TestsHome.js +224 -52
  27. package/dist/admin/surface/TestsSurface.js +2 -1
  28. package/dist/admin/surface/goals/DeleteGoalDialog.d.ts +7 -0
  29. package/dist/admin/surface/goals/DeleteGoalDialog.js +42 -0
  30. package/dist/admin/surface/goals/GoalForm.d.ts +1 -0
  31. package/dist/admin/surface/goals/GoalForm.js +280 -198
  32. package/dist/admin/surface/goals/GoalsList.js +102 -33
  33. package/dist/admin/surface/goals/data.d.ts +2 -0
  34. package/dist/admin/surface/goals/data.js +9 -0
  35. package/dist/admin/surface/goals/goals.css +3 -2
  36. package/dist/admin/surface/goals/goals.model.d.ts +2 -2
  37. package/dist/admin/surface/goals/goals.model.js +7 -12
  38. package/dist/admin/surface/home.model.d.ts +15 -8
  39. package/dist/admin/surface/home.model.js +22 -18
  40. package/dist/admin/surface/newTest/NewTest.d.ts +3 -3
  41. package/dist/admin/surface/newTest/NewTest.js +156 -96
  42. package/dist/admin/surface/newTest/PageWizard.d.ts +4 -1
  43. package/dist/admin/surface/newTest/PageWizard.js +99 -68
  44. package/dist/admin/surface/newTest/newTest.css +28 -11
  45. package/dist/admin/surface/results/ResultsHeader.d.ts +1 -1
  46. package/dist/admin/surface/results/ResultsHeader.js +98 -66
  47. package/dist/admin/surface/surface.css +29 -0
  48. package/dist/admin/surface/test/TestPage.js +46 -38
  49. package/dist/admin/surface/useXpStepNav.d.ts +11 -0
  50. package/dist/admin/surface/useXpStepNav.js +14 -0
  51. package/dist/admin/views/TestsSurfaceClient.js +27 -3
  52. package/dist/admin/views/buildSurfaceProps.js +18 -66
  53. package/dist/arms/copy.d.ts +13 -3
  54. package/dist/arms/copy.js +5 -4
  55. package/dist/blocks/createExperimentBlock.js +1 -1
  56. package/dist/blocks/formState.js +2 -2
  57. package/dist/collections/experiments/armInvariants.js +8 -5
  58. package/dist/collections/experiments/config.js +8 -3
  59. package/dist/collections/experiments/deleteGuard.js +2 -2
  60. package/dist/collections/experiments/lockHook.js +21 -2
  61. package/dist/collections/experiments/pickSlug.js +2 -0
  62. package/dist/collections/metrics.js +12 -5
  63. package/dist/collections/metricsGuards.js +2 -0
  64. package/dist/collections/serialize.js +8 -6
  65. package/dist/constants.d.ts +1 -0
  66. package/dist/constants.js +1 -0
  67. package/dist/db/adapter.d.ts +9 -1
  68. package/dist/db/adapter.js +77 -1
  69. package/dist/db/delete.d.ts +1 -1
  70. package/dist/db/delete.js +2 -4
  71. package/dist/db/events.d.ts +9 -0
  72. package/dist/db/events.js +42 -8
  73. package/dist/db/executor.d.ts +7 -1
  74. package/dist/db/executor.js +7 -3
  75. package/dist/db/pageCopies.d.ts +5 -0
  76. package/dist/db/pageCopies.js +31 -0
  77. package/dist/db/results.d.ts +5 -1
  78. package/dist/db/results.js +21 -5
  79. package/dist/db/snapshots.d.ts +2 -0
  80. package/dist/endpoints/deleteImpact.js +2 -1
  81. package/dist/endpoints/duplicateOriginal.d.ts +38 -0
  82. package/dist/endpoints/duplicateOriginal.js +414 -0
  83. package/dist/endpoints/editorSurface.js +1 -1
  84. package/dist/endpoints/events.js +103 -39
  85. package/dist/endpoints/index.js +22 -8
  86. package/dist/endpoints/pages.js +245 -66
  87. package/dist/endpoints/placementStatus.js +8 -4
  88. package/dist/endpoints/results.d.ts +1 -1
  89. package/dist/endpoints/results.js +9 -2
  90. package/dist/endpoints/routeId.d.ts +2 -2
  91. package/dist/endpoints/routeId.js +11 -5
  92. package/dist/endpoints/summary.js +46 -12
  93. package/dist/endpoints/testVersion.d.ts +2 -0
  94. package/dist/endpoints/testVersion.js +38 -0
  95. package/dist/endpoints/transitions.js +41 -29
  96. package/dist/errors.d.ts +4 -0
  97. package/dist/errors.js +6 -0
  98. package/dist/events/request.d.ts +6 -2
  99. package/dist/events/request.js +35 -8
  100. package/dist/events/rows.d.ts +1 -1
  101. package/dist/events/rows.js +24 -8
  102. package/dist/events/writable.d.ts +9 -0
  103. package/dist/events/writable.js +13 -0
  104. package/dist/exports/index.d.ts +1 -1
  105. package/dist/exports/rsc.d.ts +1 -0
  106. package/dist/exports/rsc.js +1 -0
  107. package/dist/goals/fairness.js +2 -2
  108. package/dist/goals/picker/copy.js +1 -1
  109. package/dist/goals/sourceLabel.d.ts +2 -0
  110. package/dist/goals/sourceLabel.js +4 -0
  111. package/dist/hooks/hostHook.js +6 -2
  112. package/dist/hooks/pageGuard.js +4 -0
  113. package/dist/hooks/trackPageCopies.d.ts +11 -0
  114. package/dist/hooks/trackPageCopies.js +7 -0
  115. package/dist/labels/arms.d.ts +3 -0
  116. package/dist/labels/arms.js +8 -0
  117. package/dist/lib/fetchAllDocs.d.ts +1 -1
  118. package/dist/manifest/compile.js +8 -5
  119. package/dist/onInit.js +14 -0
  120. package/dist/options.d.ts +2 -0
  121. package/dist/options.js +23 -2
  122. package/dist/plugin.js +56 -2
  123. package/dist/proxy/pageNavigation.d.ts +4 -0
  124. package/dist/proxy/pageNavigation.js +28 -0
  125. package/dist/proxy/resolve.js +52 -25
  126. package/dist/puck/editor/ConfigureTestDrawer.d.ts +7 -7
  127. package/dist/puck/editor/ConfigureTestDrawer.js +40 -29
  128. package/dist/puck/editor/ExperimentSlotEditor.d.ts +2 -1
  129. package/dist/puck/editor/ExperimentSlotEditor.js +376 -139
  130. package/dist/puck/editor/LeftoverVersions.js +17 -32
  131. package/dist/puck/editor/QuickTestActions.d.ts +6 -3
  132. package/dist/puck/editor/QuickTestActions.js +55 -33
  133. package/dist/puck/editor/ResultsReadout.d.ts +4 -1
  134. package/dist/puck/editor/ResultsReadout.js +28 -15
  135. package/dist/puck/editor/VersionBuilder.d.ts +17 -4
  136. package/dist/puck/editor/VersionBuilder.js +175 -112
  137. package/dist/puck/editor/armWrites.js +2 -2
  138. package/dist/puck/editor/armsCache.js +1 -3
  139. package/dist/puck/editor/copy.d.ts +14 -7
  140. package/dist/puck/editor/copy.js +26 -13
  141. package/dist/puck/editor/editor.chrome.css +10 -8
  142. package/dist/puck/editor/editor.css +15 -9
  143. package/dist/puck/editor/editor.model.d.ts +1 -0
  144. package/dist/puck/editor/placementsCache.d.ts +4 -0
  145. package/dist/puck/editor/usePageSaveReadiness.d.ts +6 -0
  146. package/dist/puck/editor/usePageSaveReadiness.js +31 -0
  147. package/dist/puck/nestedTestCopy.js +2 -2
  148. package/dist/puck/slotConfig.d.ts +1 -1
  149. package/dist/puck/slotConfig.js +1 -1
  150. package/dist/results/aggregate.d.ts +6 -3
  151. package/dist/results/aggregate.js +9 -9
  152. package/dist/results/analyse.d.ts +2 -0
  153. package/dist/results/analyse.js +2 -2
  154. package/dist/results/health.d.ts +8 -0
  155. package/dist/results/health.js +28 -0
  156. package/dist/results/identityCredit.d.ts +1 -0
  157. package/dist/results/identityCredit.js +4 -1
  158. package/dist/results/verdict.d.ts +4 -4
  159. package/dist/results/verdict.js +15 -11
  160. package/dist/runtime/cookie.d.ts +10 -2
  161. package/dist/runtime/cookie.js +38 -6
  162. package/dist/runtime/cookieOptions.d.ts +6 -0
  163. package/dist/runtime/cookieOptions.js +14 -0
  164. package/dist/runtime/proxyRuntime.d.ts +1 -0
  165. package/dist/runtime/proxyRuntime.js +18 -8
  166. package/dist/runtime/signing.d.ts +1 -0
  167. package/dist/runtime/signing.js +5 -0
  168. package/dist/sanitizeReadinessDetail.d.ts +2 -2
  169. package/dist/sanitizeReadinessDetail.js +20 -2
  170. package/dist/server/getAssignments.js +11 -10
  171. package/dist/server/recordContentChange.d.ts +1 -1
  172. package/dist/server/recordContentChange.js +11 -2
  173. package/dist/server/resolveExperimentBlocks.js +2 -4
  174. package/dist/server/resolveExperimentData.js +2 -5
  175. package/dist/server/runResults.js +54 -15
  176. package/dist/server/startExperiment.d.ts +20 -0
  177. package/dist/server/startExperiment.js +70 -0
  178. package/dist/server/trackConversion.js +10 -13
  179. package/dist/testSurface/PreviewLinks.d.ts +2 -1
  180. package/dist/testSurface/PreviewLinks.js +3 -3
  181. package/dist/testSurface/actions/DecideDialog.d.ts +10 -4
  182. package/dist/testSurface/actions/DecideDialog.js +93 -63
  183. package/dist/testSurface/actions/LifecycleAction.d.ts +17 -0
  184. package/dist/testSurface/actions/LifecycleAction.js +107 -0
  185. package/dist/testSurface/actions/MakeContentResult.d.ts +4 -3
  186. package/dist/testSurface/actions/MakeContentResult.js +10 -2
  187. package/dist/testSurface/actions/actions.model.d.ts +13 -5
  188. package/dist/testSurface/actions/actions.model.js +75 -22
  189. package/dist/testSurface/actions/decide.model.d.ts +1 -0
  190. package/dist/testSurface/actions/decide.model.js +1 -0
  191. package/dist/testSurface/allocation.model.js +6 -3
  192. package/dist/testSurface/api.d.ts +9 -6
  193. package/dist/testSurface/api.js +43 -23
  194. package/dist/testSurface/copy/actions.d.ts +37 -14
  195. package/dist/testSurface/copy/actions.js +40 -17
  196. package/dist/testSurface/copy/advanced.d.ts +10 -0
  197. package/dist/testSurface/copy/advanced.js +10 -0
  198. package/dist/testSurface/copy/arms.d.ts +1 -1
  199. package/dist/testSurface/copy/arms.js +1 -1
  200. package/dist/testSurface/copy/audience.d.ts +4 -3
  201. package/dist/testSurface/copy/audience.js +5 -4
  202. package/dist/testSurface/copy/common.d.ts +8 -6
  203. package/dist/testSurface/copy/common.js +8 -6
  204. package/dist/testSurface/copy/languages.d.ts +1 -0
  205. package/dist/testSurface/copy/languages.js +1 -0
  206. package/dist/testSurface/copy/metrics.d.ts +7 -0
  207. package/dist/testSurface/copy/metrics.js +9 -0
  208. package/dist/testSurface/copy/pages.d.ts +67 -7
  209. package/dist/testSurface/copy/pages.js +74 -7
  210. package/dist/testSurface/copy/readiness.d.ts +20 -7
  211. package/dist/testSurface/copy/readiness.js +36 -10
  212. package/dist/testSurface/copy/recommendation.d.ts +1 -22
  213. package/dist/testSurface/copy/recommendation.js +2 -22
  214. package/dist/testSurface/copy/results.d.ts +21 -12
  215. package/dist/testSurface/copy/results.js +24 -13
  216. package/dist/testSurface/copy/review.d.ts +13 -10
  217. package/dist/testSurface/copy/review.js +14 -10
  218. package/dist/testSurface/copy/setting.d.ts +1 -2
  219. package/dist/testSurface/copy/setting.js +1 -2
  220. package/dist/testSurface/copy/surface.d.ts +11 -2
  221. package/dist/testSurface/copy/surface.js +14 -11
  222. package/dist/testSurface/copy/testPage.d.ts +36 -12
  223. package/dist/testSurface/copy/testPage.js +53 -16
  224. package/dist/testSurface/format/date.d.ts +5 -2
  225. package/dist/testSurface/format/date.js +24 -8
  226. package/dist/testSurface/format/roundProgress.d.ts +6 -0
  227. package/dist/testSurface/format/roundProgress.js +15 -0
  228. package/dist/testSurface/format/useDateFormatter.d.ts +3 -0
  229. package/dist/testSurface/format/useDateFormatter.js +8 -0
  230. package/dist/testSurface/labels.d.ts +1 -2
  231. package/dist/testSurface/labels.js +2 -3
  232. package/dist/testSurface/lockedNotice.model.d.ts +2 -0
  233. package/dist/testSurface/lockedNotice.model.js +31 -0
  234. package/dist/testSurface/readPreflight.d.ts +4 -0
  235. package/dist/testSurface/readPreflight.js +6 -0
  236. package/dist/testSurface/readinessRead.d.ts +3 -0
  237. package/dist/testSurface/readinessRead.js +4 -0
  238. package/dist/testSurface/results/CiChart.js +2 -1
  239. package/dist/testSurface/results/DataTable.d.ts +1 -1
  240. package/dist/testSurface/results/DataTable.js +4 -3
  241. package/dist/testSurface/results/VerdictHero.d.ts +3 -2
  242. package/dist/testSurface/results/VerdictHero.js +5 -1
  243. package/dist/testSurface/results/legacy.d.ts +0 -5
  244. package/dist/testSurface/results/legacy.js +0 -14
  245. package/dist/testSurface/results/results.css +2 -2
  246. package/dist/testSurface/results/results.model.d.ts +9 -4
  247. package/dist/testSurface/results/results.model.js +31 -23
  248. package/dist/testSurface/results/snapshot.d.ts +2 -0
  249. package/dist/testSurface/results/snapshot.js +3 -0
  250. package/dist/testSurface/surface/contracts.d.ts +13 -1
  251. package/dist/testSurface/surface/editorPlacement.d.ts +3 -3
  252. package/dist/testSurface/surface/editorPlacement.js +2 -2
  253. package/dist/testSurface/surface/pageBlock/pageBlock.model.js +3 -3
  254. package/dist/testSurface/surface/pageBlock/parts.js +25 -12
  255. package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +8 -1
  256. package/dist/testSurface/surface/pagePicker/CopyRoute.js +243 -22
  257. package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +15 -4
  258. package/dist/testSurface/surface/pagePicker/PageCombobox.js +300 -197
  259. package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -10
  260. package/dist/testSurface/surface/pagePicker/pagePicker.model.d.ts +5 -3
  261. package/dist/testSurface/surface/pagePicker/pagePicker.model.js +17 -2
  262. package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +9 -5
  263. package/dist/testSurface/surface/readiness/ActionDialogs.js +241 -230
  264. package/dist/testSurface/surface/readiness/Banner.d.ts +5 -1
  265. package/dist/testSurface/surface/readiness/Banner.js +113 -141
  266. package/dist/testSurface/surface/readiness/SaveStatus.d.ts +8 -4
  267. package/dist/testSurface/surface/readiness/SaveStatus.js +23 -22
  268. package/dist/testSurface/surface/readiness/readiness.model.d.ts +20 -6
  269. package/dist/testSurface/surface/readiness/readiness.model.js +168 -21
  270. package/dist/testSurface/surface/readiness/useTransition.d.ts +6 -4
  271. package/dist/testSurface/surface/readiness/useTransition.js +57 -14
  272. package/dist/testSurface/surface/results/ReleasePages.d.ts +6 -3
  273. package/dist/testSurface/surface/results/ReleasePages.js +42 -41
  274. package/dist/testSurface/surface/results/ResultsBody.d.ts +11 -4
  275. package/dist/testSurface/surface/results/ResultsBody.js +221 -118
  276. package/dist/testSurface/surface/results/recommendation.model.d.ts +6 -9
  277. package/dist/testSurface/surface/results/recommendation.model.js +15 -59
  278. package/dist/testSurface/surface/results/useResults.d.ts +13 -8
  279. package/dist/testSurface/surface/results/useResults.js +3 -2
  280. package/dist/testSurface/surface/setting/parts.js +89 -46
  281. package/dist/testSurface/surface/setting/setting.css +2 -1
  282. package/dist/testSurface/surface/test/AdvancedSection.js +11 -4
  283. package/dist/testSurface/surface/test/DeleteTest.d.ts +10 -2
  284. package/dist/testSurface/surface/test/DeleteTest.js +173 -74
  285. package/dist/testSurface/surface/test/GoalSection.js +18 -14
  286. package/dist/testSurface/surface/test/LengthSection.js +24 -13
  287. package/dist/testSurface/surface/test/PageHoldout.d.ts +1 -1
  288. package/dist/testSurface/surface/test/PageHoldout.js +11 -8
  289. package/dist/testSurface/surface/test/ReadinessBar.d.ts +2 -1
  290. package/dist/testSurface/surface/test/ReadinessBar.js +4 -10
  291. package/dist/testSurface/surface/test/Section.js +8 -0
  292. package/dist/testSurface/surface/test/TargetingSection.js +82 -12
  293. package/dist/testSurface/surface/test/TestSurface.js +73 -37
  294. package/dist/testSurface/surface/test/VersionsSection.js +141 -91
  295. package/dist/testSurface/surface/test/fields.d.ts +32 -6
  296. package/dist/testSurface/surface/test/fields.js +166 -52
  297. package/dist/testSurface/surface/test/pageParts.js +27 -12
  298. package/dist/testSurface/surface/test/testPage.css +9 -2
  299. package/dist/testSurface/surface/test/testPage.model.d.ts +1 -0
  300. package/dist/testSurface/surface/test/testPage.model.js +6 -0
  301. package/dist/testSurface/surface/testDocument.model.d.ts +3 -0
  302. package/dist/testSurface/surface/testDocument.model.js +4 -1
  303. package/dist/testSurface/surface/useTestDocument.d.ts +21 -5
  304. package/dist/testSurface/surface/useTestDocument.js +472 -167
  305. package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
  306. package/dist/testSurface/surface/watchTestDocument.js +181 -0
  307. package/dist/testSurface/surfaceUrls.d.ts +1 -0
  308. package/dist/testSurface/surfaceUrls.js +4 -0
  309. package/dist/testSurface/useApi.d.ts +8 -5
  310. package/dist/testSurface/useOnTestReturn.d.ts +2 -0
  311. package/dist/testSurface/useOnTestReturn.js +27 -0
  312. package/dist/testSurface/useReadinessPolling.js +3 -1
  313. package/dist/transitions/addMetric.d.ts +2 -5
  314. package/dist/transitions/addMetric.js +5 -1
  315. package/dist/transitions/allocate.d.ts +2 -2
  316. package/dist/transitions/allocate.js +3 -1
  317. package/dist/transitions/archive.d.ts +1 -1
  318. package/dist/transitions/archive.js +3 -2
  319. package/dist/transitions/checkStart.d.ts +1 -0
  320. package/dist/transitions/checkStart.js +17 -6
  321. package/dist/transitions/decide.d.ts +1 -1
  322. package/dist/transitions/decide.js +5 -3
  323. package/dist/transitions/deleteExperiment.d.ts +2 -2
  324. package/dist/transitions/deleteExperiment.js +17 -7
  325. package/dist/transitions/kernel.d.ts +4 -0
  326. package/dist/transitions/kernel.js +9 -4
  327. package/dist/transitions/makeContent.d.ts +2 -1
  328. package/dist/transitions/makeContent.js +12 -8
  329. package/dist/transitions/nestedPlacementNames.d.ts +2 -2
  330. package/dist/transitions/nestedPlacementNames.js +4 -5
  331. package/dist/transitions/pageAddress.d.ts +6 -0
  332. package/dist/transitions/pageAddress.js +71 -0
  333. package/dist/transitions/pageVersions.d.ts +1 -1
  334. package/dist/transitions/phaseRecord.d.ts +2 -0
  335. package/dist/transitions/phaseRecord.js +5 -0
  336. package/dist/transitions/placementInteractions.d.ts +3 -3
  337. package/dist/transitions/placementInteractions.js +8 -7
  338. package/dist/transitions/placements.d.ts +2 -0
  339. package/dist/transitions/placements.js +5 -5
  340. package/dist/transitions/preflightData.d.ts +3 -2
  341. package/dist/transitions/preflightData.js +77 -43
  342. package/dist/transitions/releaseHoldout.d.ts +2 -1
  343. package/dist/transitions/releaseHoldout.js +3 -1
  344. package/dist/transitions/releasePages.d.ts +2 -1
  345. package/dist/transitions/releasePages.js +3 -1
  346. package/dist/transitions/resolveCaps.d.ts +2 -4
  347. package/dist/transitions/start.d.ts +7 -9
  348. package/dist/transitions/start.js +75 -39
  349. package/dist/transitions/startReads.d.ts +7 -0
  350. package/dist/transitions/startReads.js +28 -0
  351. package/dist/transitions/stop.d.ts +2 -1
  352. package/dist/transitions/stop.js +3 -2
  353. package/dist/types/armKey.d.ts +2 -0
  354. package/dist/types/armKey.js +1 -0
  355. package/dist/types/contracts.d.ts +17 -4
  356. package/dist/types/endpoints.d.ts +89 -17
  357. package/dist/types/endpoints.js +1 -1
  358. package/dist/types/runtime.d.ts +15 -9
  359. package/dist/types/snapshot.d.ts +2 -0
  360. package/dist/types/surface.d.ts +7 -9
  361. package/dist/ui/ChipsInput.d.ts +8 -1
  362. package/dist/ui/ChipsInput.js +17 -4
  363. package/dist/ui/Dialog.d.ts +21 -2
  364. package/dist/ui/Dialog.js +101 -4
  365. package/dist/ui/Inputs.js +0 -1
  366. package/dist/ui/ui.css +5 -1
  367. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
+ import { GOAL_ROLES } from './metrics.js';
1
2
  export const RESULTS_COPY = {
2
- chooseGroup: 'Choose a group',
3
3
  tests: 'Tests',
4
4
  results: 'Results',
5
5
  test: 'Test',
@@ -39,7 +39,6 @@ export const RESULTS_COPY = {
39
39
  chanceToWin: 'Chance to win',
40
40
  risk: 'Risk',
41
41
  comparison: 'Comparison',
42
- original: 'Original',
43
42
  holdout: 'Measured, not compared',
44
43
  holdoutBaseline: 'Holdout · baseline',
45
44
  shippedGroup: 'the winner',
@@ -58,19 +57,22 @@ export const RESULTS_COPY = {
58
57
  infeasible: 'A clear answer would take more than 90 days at this traffic.',
59
58
  noCap: 'Not capped: fewer than 20 people had this outcome in the 90 days before Start, so every value counts in full.',
60
59
  quality: 'Data quality',
61
- missingWinner: 'The stored winner is missing from this round’s results.',
62
- missingWinnerNext: 'Recompute; if it persists, contact a developer before trusting these results.',
63
- srm: "Traffic isn't splitting as set. Check for caching or a page placed twice.",
60
+ missingWinner: "The stored winner is missing from this round's results.",
61
+ missingWinnerNext: 'Refresh results. If the problem continues, contact a developer before trusting these results.',
62
+ srm: "Traffic isn't splitting as set. Caching, a page placed twice, or automated traffic could affect the split.",
63
+ srmAction: "Don't trust these results. Ask a developer to check for caching, a page placed twice, or automated traffic.",
64
64
  multiGroup: 'People who saw more than one group were excluded.',
65
65
  multiGroupNext: 'Check for caching or a page placed twice before trusting the results.',
66
66
  mismatch: "Beacons that didn't match the assigned group were ignored.",
67
67
  mismatchNext: 'Check that the page reports the group it actually showed.',
68
+ rapidBrowserEvents: 'A larger share of visitors acted within seconds of arriving on one version than on another. One version may make it easier to act quickly, or some activity may be automated.',
69
+ rapidBrowserEventsNext: 'Check where the action appears in each version and ask your site team to review the traffic before choosing a winner.',
68
70
  identity: 'Some linked identities were seen in different groups.',
69
71
  identityNext: 'Check identity linking at sign-in and registration.',
70
72
  tooFew: 'Too few people have seen the compared groups.',
71
73
  tooFewNext: 'Keep collecting results until each compared group reaches the planned minimum.',
72
74
  layerFull: 'The layer has fewer slices reserved than the requested allocation.',
73
- layerNext: 'Free slices in the layer, then use "Let more people in".',
75
+ layerNext: 'Free up room in the layer to include more people.',
74
76
  unavailable: {
75
77
  'source-failed': "couldn't be read this time; the next results run will try again.",
76
78
  'source-unavailable': "can't be read because its data source is no longer available. Ask a developer to check this goal.",
@@ -81,7 +83,7 @@ export const RESULTS_COPY = {
81
83
  'not-supplied': "has no data for this results run; the next results run will try again.",
82
84
  'analysis-failed': "couldn't be calculated this time; the next results run will try again."
83
85
  },
84
- unavailableNext: 'Recompute; if it persists, contact a developer.',
86
+ unavailableNext: 'Refresh results. If the problem continues, contact a developer.',
85
87
  loading: 'Loading results…',
86
88
  refreshing: 'Refreshing…',
87
89
  retryPreview: 'Retry preview links',
@@ -89,11 +91,13 @@ export const RESULTS_COPY = {
89
91
  empty: 'No results yet — the first results appear within the hour after Start.',
90
92
  retry: 'Retry',
91
93
  round: 'Round',
92
- recompute: 'Recompute',
93
- recomputing: 'Recomputing…',
94
- primary: 'Primary outcome',
95
- secondary: 'Supporting (not used for the decision)',
96
- guardrail: 'Guardrails',
94
+ recompute: 'Refresh results',
95
+ recomputing: 'Refreshing…',
96
+ updated: (time)=>`Updated ${time}`,
97
+ previousRound: 'Choose the latest test round to decide.',
98
+ primary: GOAL_ROLES.primary,
99
+ secondary: `${GOAL_ROLES.secondary} (not used for the decision)`,
100
+ guardrail: GOAL_ROLES.guardrail,
97
101
  chart: 'Confidence interval over time',
98
102
  noHistory: 'Not enough history yet.'
99
103
  };
@@ -101,10 +105,14 @@ export const pagesReleasedCopy = (date, name)=>`Pages released ${date}${name ? `
101
105
  export const roundLabel = (round, kind)=>`Round ${round} · ${kind}`;
102
106
  export const decidedTitle = (winner)=>`Decided: ${winner}`;
103
107
  export const shippingTitle = (winner)=>`Since shipping ${winner}`;
104
- export const moreDays = (days)=>`About ${days} more ${days === '1' ? 'day' : 'days'}.`;
108
+ export const keepRunningTo = (date)=>`Keep running to the planned end (${date}).`;
109
+ export const pastPlannedEnd = (date)=>`The planned end was ${date}.`;
110
+ export const moreDays = (days)=>`At this traffic, a clear answer needs about ${days} more ${days === '1' ? 'day' : 'days'}.`;
105
111
  export const collectingCopy = (n, minimum, conversions, conversionMinimum)=>`${n} of ${minimum} people, ${conversions} of ${conversionMinimum} conversions`;
106
112
  export const uncappedTotal = (total)=>`Total ${total} (not capped)`;
107
113
  export const cappedCount = (count, cap)=>`${count} capped at ${cap}`;
114
+ export const revenueCapHelp = (threshold)=>`Amounts above ${threshold} are limited in the comparison. Totals include the full amounts.`;
115
+ export const percentileCapHelp = (tail)=>revenueCapHelp(tail === 0 ? 'the largest amount from the 90 days before the test' : `the cutoff for the largest ${tail}% of amounts from the 90 days before the test`);
108
116
  export const atLeast = (bound)=>`at least ${bound}`;
109
117
  export const atMost = (bound)=>`at most ${bound}`;
110
118
  export const intervalCopy = (low, high)=>`${low} to ${high}`;
@@ -120,3 +128,6 @@ export const chartSummary = (metric, groups, from, to, changes = [])=>`${metric}
120
128
  }).format(changes)}.` : ''}`;
121
129
  export const contentChangeTitle = (date)=>`Content changed ${date} by an editor`;
122
130
  export const daysOfPlan = (days, planned)=>`${days} of ${planned}`;
131
+ /** Use the frozen control label in the fixed wording stored by older verdict writers. */ export function verdictControlCopy(sentence, control) {
132
+ return sentence.replace(/^The Original is better\.(?= Decide for the Original\.$|$)/, ()=>`${control} is better.`).replace(/(^|\. )Decide for the Original(?=\.$| or restart without (?:it|them)\.$)/, (_, boundary)=>`${boundary}Decide for ${control}`).replace(/^((?:Both|All \d+ variants) beat )the Original;/, (_, lead)=>`${lead}${control};`).replace(/^(The main outcome improved compared with |This describes the shipped version compared with people still seeing )the Original\.$/, (_, lead)=>`${lead}${control}.`).replace(/(^|\. )((?:Smallest group so far|Fewest conversions so far): )Original,/g, (_, boundary, lead)=>`${boundary}${lead}${control},`);
133
+ }
@@ -1,17 +1,20 @@
1
1
  export declare const REVIEW_COPY: {
2
- readonly noBaseline: "No data yet for this metric.";
2
+ readonly noBaseline: "No data yet for this goal.";
3
3
  readonly preview: "Preview";
4
- readonly previewBlocked: "Your browser blocked the preview window. Allow pop-ups for this site, then try again.";
4
+ readonly previewBlocked: "Your browser blocked the preview window. Allow pop-ups for this site.";
5
5
  readonly placedTimes: (n: number) => string;
6
6
  readonly raise: "Raise allocation";
7
- readonly addMetric: "Add a metric";
7
+ readonly addMetric: "Add a goal";
8
8
  readonly allocationBody: "Raising allocation adds people; nobody already taking part changes group. Lowering needs a new round.";
9
9
  readonly allocationInvalid: "Enter a whole percentage higher than the current allocation and no more than 100.";
10
- readonly role: "Role";
11
- readonly supporting: "Supporting";
12
- readonly guardrail: "Guardrail";
13
- readonly metric: "Metric";
14
- readonly chooseMetric: "Choose a metric";
15
- readonly loadingMetrics: "Loading metrics…";
16
- readonly noMetrics: "All available goals are already on this test.";
10
+ readonly role: "How it counts";
11
+ readonly primary: "Main goal";
12
+ readonly supporting: "Also tracked";
13
+ readonly guardrail: "Must not get worse";
14
+ readonly metric: "Goal";
15
+ readonly chooseMetric: "Choose a goal";
16
+ readonly loadingMetrics: "Loading goals…";
17
+ readonly createGoal: "Create a goal";
18
+ readonly noMetrics: "There are no goals yet.";
19
+ readonly allMetricsAttached: "Every goal is already on this test.";
17
20
  };
@@ -1,17 +1,21 @@
1
+ import { GOAL_ROLES } from './metrics.js';
1
2
  export const REVIEW_COPY = {
2
- noBaseline: 'No data yet for this metric.',
3
+ noBaseline: 'No data yet for this goal.',
3
4
  preview: 'Preview',
4
- previewBlocked: 'Your browser blocked the preview window. Allow pop-ups for this site, then try again.',
5
+ previewBlocked: 'Your browser blocked the preview window. Allow pop-ups for this site.',
5
6
  placedTimes: (n)=>`(placed ${n} times on this page)`,
6
7
  raise: 'Raise allocation',
7
- addMetric: 'Add a metric',
8
+ addMetric: 'Add a goal',
8
9
  allocationBody: 'Raising allocation adds people; nobody already taking part changes group. Lowering needs a new round.',
9
10
  allocationInvalid: 'Enter a whole percentage higher than the current allocation and no more than 100.',
10
- role: 'Role',
11
- supporting: 'Supporting',
12
- guardrail: 'Guardrail',
13
- metric: 'Metric',
14
- chooseMetric: 'Choose a metric',
15
- loadingMetrics: 'Loading metrics…',
16
- noMetrics: 'All available goals are already on this test.'
11
+ role: 'How it counts',
12
+ primary: GOAL_ROLES.primary,
13
+ supporting: GOAL_ROLES.secondary,
14
+ guardrail: GOAL_ROLES.guardrail,
15
+ metric: 'Goal',
16
+ chooseMetric: 'Choose a goal',
17
+ loadingMetrics: 'Loading goals…',
18
+ createGoal: 'Create a goal',
19
+ noMetrics: 'There are no goals yet.',
20
+ allMetricsAttached: 'Every goal is already on this test.'
17
21
  };
@@ -3,8 +3,7 @@ export declare const SETTING_COPY: {
3
3
  readonly setValues: "Set values";
4
4
  readonly setting: "Setting";
5
5
  readonly choose: "Choose the setting first.";
6
- readonly current: "Current: {value}";
7
- readonly holdout: "Sees the Original.";
6
+ readonly current: "Current";
8
7
  readonly yes: "Yes";
9
8
  readonly no: "No";
10
9
  readonly empty: "Not set";
@@ -3,8 +3,7 @@ export const SETTING_COPY = {
3
3
  setValues: 'Set values',
4
4
  setting: 'Setting',
5
5
  choose: 'Choose the setting first.',
6
- current: 'Current: {value}',
7
- holdout: 'Sees the Original.',
6
+ current: 'Current',
8
7
  yes: 'Yes',
9
8
  no: 'No',
10
9
  empty: 'Not set',
@@ -18,7 +18,15 @@ export declare const SURFACE_COPY: {
18
18
  readonly retry: "Try again";
19
19
  readonly empty: "Create a test to learn what works.";
20
20
  readonly clear: "Clear";
21
- readonly groups: readonly ["Needs attention", "Running", "Ready to start", "Draft", "Decided", "Archived"];
21
+ readonly groups: {
22
+ readonly attention: "Needs attention";
23
+ readonly running: "Running";
24
+ readonly ready: "Ready to start";
25
+ readonly draft: "Draft";
26
+ readonly stopped: "Stopped";
27
+ readonly decided: "Decided";
28
+ readonly archived: "Archived";
29
+ };
22
30
  readonly kinds: {
23
31
  readonly block: "Page block";
24
32
  readonly flag: "Setting";
@@ -26,13 +34,14 @@ export declare const SURFACE_COPY: {
26
34
  readonly page: "Whole page";
27
35
  };
28
36
  readonly ready: "Ready to start";
37
+ readonly readyAgain: "Ready to start a new round";
29
38
  readonly next: "Review setup";
30
39
  readonly continue: "Continue setup";
31
40
  readonly results: "View results";
32
41
  readonly open: "Open";
33
42
  readonly health: {
34
43
  readonly red: "Needs attention";
35
- readonly amber: "Check data";
44
+ readonly amber: "Needs attention";
36
45
  readonly green: "On track";
37
46
  };
38
47
  readonly backToSetup: "Back to setup";
@@ -1,3 +1,4 @@
1
+ import { READINESS_COPY } from './readiness.js';
1
2
  export const SURFACE_COPY = {
2
3
  title: 'Tests',
3
4
  test: 'Test',
@@ -18,14 +19,15 @@ export const SURFACE_COPY = {
18
19
  retry: 'Try again',
19
20
  empty: 'Create a test to learn what works.',
20
21
  clear: 'Clear',
21
- groups: [
22
- 'Needs attention',
23
- 'Running',
24
- 'Ready to start',
25
- 'Draft',
26
- 'Decided',
27
- 'Archived'
28
- ],
22
+ groups: {
23
+ attention: READINESS_COPY.needsAttention,
24
+ running: 'Running',
25
+ ready: 'Ready to start',
26
+ draft: 'Draft',
27
+ stopped: 'Stopped',
28
+ decided: 'Decided',
29
+ archived: 'Archived'
30
+ },
29
31
  kinds: {
30
32
  block: 'Page block',
31
33
  flag: 'Setting',
@@ -33,19 +35,20 @@ export const SURFACE_COPY = {
33
35
  page: 'Whole page'
34
36
  },
35
37
  ready: 'Ready to start',
38
+ readyAgain: 'Ready to start a new round',
36
39
  next: 'Review setup',
37
40
  continue: 'Continue setup',
38
41
  results: 'View results',
39
42
  open: 'Open',
40
43
  health: {
41
- red: 'Needs attention',
42
- amber: 'Check data',
44
+ red: READINESS_COPY.needsAttention,
45
+ amber: READINESS_COPY.needsAttention,
43
46
  green: 'On track'
44
47
  },
45
48
  backToSetup: 'Back to setup'
46
49
  };
47
50
  export function runningLine(days, planned, people) {
48
- return `Running ${days} days of ${planned} · ${people} people so far`;
51
+ return `Day ${days} of ${planned} · ${people} people so far`;
49
52
  }
50
53
  export function decidedLine(date, winner) {
51
54
  return `Decided ${date}: ${winner}`;
@@ -1,10 +1,23 @@
1
+ import type { ExperimentKind } from '../../types/contracts.js';
1
2
  export declare const TEST_PAGE: {
2
3
  readonly noAudienceRules: "No audience choices are available here. Everyone eligible takes part; leave this section as it is.";
3
4
  readonly editVersionsOnCanvas: "Edit version content on the canvas.";
4
5
  readonly clickPageGroup: "On this test's page";
5
6
  readonly clickGoalHelp: "A click shows interest, not the result you want.";
6
- readonly staleEdit: "Someone else changed this test. Reload to see their changes.";
7
+ readonly staleEdit: "This test changed. Reload to see the latest settings and discard your unfinished edits.";
7
8
  readonly reload: "Reload";
9
+ readonly reloadAfterError: "Reload to discard your unfinished edits and try again.";
10
+ readonly draftNotSaved: "Your edit is still unsaved.";
11
+ readonly conflictChoice: "Your edit is unsaved. Choose which value to keep. Saving your edit replaces the saved value shown below.";
12
+ readonly keepEdit: "Save my edit";
13
+ readonly retryEdit: "Try saving again";
14
+ readonly editInvalid: "Enter a valid value before saving.";
15
+ readonly detachedEdit: (field: string) => string;
16
+ readonly discardEdit: "Discard edit";
17
+ readonly savedValueChanged: "This field changed while you were editing.";
18
+ readonly savedValue: "Saved value";
19
+ readonly emptyValue: "(empty)";
20
+ readonly useSavedValue: "Use saved value";
8
21
  readonly loading: "Loading test…";
9
22
  readonly forbidden: "You don't have access to this test.";
10
23
  readonly missing: "This test no longer exists.";
@@ -37,9 +50,11 @@ export declare const TEST_PAGE: {
37
50
  };
38
51
  readonly hypothesis: "Why are you testing this? (optional)";
39
52
  readonly hypothesisPlaceholder: "We believe … will … because …";
40
- readonly notPlaced: "Not on a page yet. Open a page, add an Experiment block and choose this test.";
41
- readonly onPage: "On:";
42
- readonly openPage: "Open the page";
53
+ readonly notPlaced: "This test needs a block on a page. Add it to a Test block.";
54
+ readonly onPage: "Page:";
55
+ readonly openPage: "Open page";
56
+ readonly published: "Published";
57
+ readonly draft: "Draft";
43
58
  readonly editedOnPage: "Versions are edited on the page.";
44
59
  readonly editOnPage: "Edit on page";
45
60
  readonly empty: "Empty";
@@ -48,8 +63,9 @@ export declare const TEST_PAGE: {
48
63
  readonly ready: "Content ready";
49
64
  readonly emptySlot: "Nothing in this slot yet";
50
65
  readonly pageBinding: "Each version is a whole page at its own address.";
66
+ readonly partialSlotContent: "Some slots empty";
51
67
  readonly pageAddress: "Page address";
52
- readonly holdoutContent: "Sees the Original";
68
+ readonly valueColumn: "Value";
53
69
  readonly label: "Version label";
54
70
  readonly weight: "Share (%)";
55
71
  readonly balanceHelp: "Changing a share balances the other versions so the total stays at 100%.";
@@ -60,17 +76,18 @@ export declare const TEST_PAGE: {
60
76
  readonly invalidShare: "Use a whole number from 0 to 100.";
61
77
  readonly holdoutPrefix: "Holdout: ";
62
78
  readonly allocation: "How many people take part";
79
+ readonly everyoneMatches: "Everyone who matches the audience takes part.";
63
80
  readonly traffic: "How people are split";
64
81
  readonly otherGoals: "Other goals (optional)";
65
82
  readonly otherGoalsTitle: "Other goals";
66
83
  readonly dontTrack: "Don't track";
67
- readonly watch: "Watch";
84
+ readonly watch: "Also tracked";
68
85
  readonly mustNotWorsen: "Must not get worse";
69
- readonly otherGoalsHelp: "Watch: shown in results. Must not get worse: you're warned if a version makes it worse.";
70
- readonly goal: "Goal";
86
+ readonly otherGoalsHelp: "Also tracked goals appear in results. Choose Must not get worse to get a warning when a version hurts that goal.";
87
+ readonly goal: "Main goal";
71
88
  readonly goalHelp: "The one thing you want more of. It decides the winner.";
72
89
  readonly guardrailsShort: "Must not get worse";
73
- readonly secondaryShort: "Also keep an eye on";
90
+ readonly secondaryShort: "Also tracked";
74
91
  readonly manageGoals: "Manage goals";
75
92
  readonly chooseGoal: "Choose a goal";
76
93
  readonly goalsError: "Couldn't load goals. Try again.";
@@ -82,6 +99,7 @@ export declare const TEST_PAGE: {
82
99
  readonly addRule: "Add a rule";
83
100
  readonly removeRule: "Remove rule";
84
101
  readonly blockPathRule: "This rule no longer applies to page block tests; remove it.";
102
+ readonly targetingValue: (attribute: string) => string;
85
103
  readonly attribute: "Attribute";
86
104
  readonly comparison: "Comparison";
87
105
  readonly value: "Value";
@@ -90,6 +108,7 @@ export declare const TEST_PAGE: {
90
108
  readonly reach: "About how many people will see this per day?";
91
109
  readonly reachHelp: "A rough number is fine. It only sets the suggested length.";
92
110
  readonly duration: "Planned length (days)";
111
+ readonly endDate: "Planned end date";
93
112
  readonly noSuggestion: "Enter a daily number above to get a suggestion. 4 weeks is a safe default.";
94
113
  readonly chooseGoalSuggestion: "Choose a goal to get a suggestion.";
95
114
  readonly required: "(required)";
@@ -113,18 +132,23 @@ export declare const DELETE_TEST: {
113
132
  readonly changedPages: (count: number) => string;
114
133
  readonly unreadablePages: (count: number, total: number) => string;
115
134
  readonly pageWinner: "These addresses will change where they send visitors:";
116
- readonly content: "Deleting the test does not delete your page content. An Experiment block that used this test stays on its page and says the test was deleted.";
135
+ readonly content: "Deleting the test does not delete your page content. A Test block that used this test stays on its page and says the test was deleted.";
136
+ readonly runningSteps: readonly ["Stop the test.", "Archive the test."];
137
+ readonly archiveFirst: "You can delete this test after it is archived.";
138
+ readonly close: "Close";
139
+ readonly labelWithCode: (label: string, code: string) => string;
117
140
  readonly allLocales: "All languages";
118
141
  readonly locales: (names: string) => string;
119
142
  readonly action: "Delete test";
120
143
  readonly cancel: "Cancel";
121
144
  readonly deleted: "Test deleted.";
122
145
  readonly title: (name: string) => string;
123
- readonly consequences: "This permanently deletes the test and all its rounds and results.";
146
+ readonly consequences: "This permanently deletes the test and all its rounds and results. You can't undo this.";
124
147
  readonly alreadyDeleted: "This test was already deleted.";
125
148
  readonly checking: "Checking what visitors will see…";
126
- readonly checkFailed: "Couldn’t check what visitors will see after deletion. You can still choose to delete this test.";
149
+ readonly checkFailed: "Couldn't check what visitors will see after deletion. You can still choose to delete this test.";
127
150
  readonly noEffect: "Deleting this test will not change what visitors see.";
128
151
  readonly versionChange: (before: string, after: string) => string;
129
152
  readonly morePages: (count: number) => string;
130
153
  };
154
+ export declare function deleteStatusCopy(status: string, kind?: ExperimentKind): string;
@@ -1,13 +1,25 @@
1
+ import { GOAL_ROLES } from './metrics.js';
2
+ import { API_MESSAGES } from './common.js';
1
3
  import { PLACEMENT_LANGUAGES } from './languages.js';
2
- const guardrailsShort = 'Must not get worse';
3
- const secondaryShort = 'Also keep an eye on';
4
4
  export const TEST_PAGE = {
5
5
  noAudienceRules: 'No audience choices are available here. Everyone eligible takes part; leave this section as it is.',
6
6
  editVersionsOnCanvas: 'Edit version content on the canvas.',
7
7
  clickPageGroup: "On this test's page",
8
8
  clickGoalHelp: 'A click shows interest, not the result you want.',
9
- staleEdit: 'Someone else changed this test. Reload to see their changes.',
9
+ staleEdit: 'This test changed. Reload to see the latest settings and discard your unfinished edits.',
10
10
  reload: 'Reload',
11
+ reloadAfterError: 'Reload to discard your unfinished edits and try again.',
12
+ draftNotSaved: 'Your edit is still unsaved.',
13
+ conflictChoice: 'Your edit is unsaved. Choose which value to keep. Saving your edit replaces the saved value shown below.',
14
+ keepEdit: 'Save my edit',
15
+ retryEdit: 'Try saving again',
16
+ editInvalid: 'Enter a valid value before saving.',
17
+ detachedEdit: (field)=>`Your edit to “${field}” is still unsaved. Return to the field to finish it, or copy your edit and discard it here.`,
18
+ discardEdit: 'Discard edit',
19
+ savedValueChanged: 'This field changed while you were editing.',
20
+ savedValue: 'Saved value',
21
+ emptyValue: '(empty)',
22
+ useSavedValue: 'Use saved value',
11
23
  loading: 'Loading test…',
12
24
  forbidden: "You don't have access to this test.",
13
25
  missing: 'This test no longer exists.',
@@ -40,9 +52,11 @@ export const TEST_PAGE = {
40
52
  },
41
53
  hypothesis: 'Why are you testing this? (optional)',
42
54
  hypothesisPlaceholder: 'We believe … will … because …',
43
- notPlaced: 'Not on a page yet. Open a page, add an Experiment block and choose this test.',
44
- onPage: 'On:',
45
- openPage: 'Open the page',
55
+ notPlaced: 'This test needs a block on a page. Add it to a Test block.',
56
+ onPage: 'Page:',
57
+ openPage: 'Open page',
58
+ published: 'Published',
59
+ draft: 'Draft',
46
60
  editedOnPage: 'Versions are edited on the page.',
47
61
  editOnPage: 'Edit on page',
48
62
  empty: 'Empty',
@@ -51,8 +65,9 @@ export const TEST_PAGE = {
51
65
  ready: 'Content ready',
52
66
  emptySlot: 'Nothing in this slot yet',
53
67
  pageBinding: 'Each version is a whole page at its own address.',
68
+ partialSlotContent: 'Some slots empty',
54
69
  pageAddress: 'Page address',
55
- holdoutContent: 'Sees the Original',
70
+ valueColumn: 'Value',
56
71
  label: 'Version label',
57
72
  weight: 'Share (%)',
58
73
  balanceHelp: 'Changing a share balances the other versions so the total stays at 100%.',
@@ -63,17 +78,18 @@ export const TEST_PAGE = {
63
78
  invalidShare: 'Use a whole number from 0 to 100.',
64
79
  holdoutPrefix: 'Holdout: ',
65
80
  allocation: 'How many people take part',
81
+ everyoneMatches: 'Everyone who matches the audience takes part.',
66
82
  traffic: 'How people are split',
67
83
  otherGoals: 'Other goals (optional)',
68
84
  otherGoalsTitle: 'Other goals',
69
85
  dontTrack: "Don't track",
70
- watch: 'Watch',
71
- mustNotWorsen: 'Must not get worse',
72
- otherGoalsHelp: "Watch: shown in results. Must not get worse: you're warned if a version makes it worse.",
73
- goal: 'Goal',
86
+ watch: GOAL_ROLES.secondary,
87
+ mustNotWorsen: GOAL_ROLES.guardrail,
88
+ otherGoalsHelp: "Also tracked goals appear in results. Choose Must not get worse to get a warning when a version hurts that goal.",
89
+ goal: GOAL_ROLES.primary,
74
90
  goalHelp: 'The one thing you want more of. It decides the winner.',
75
- guardrailsShort,
76
- secondaryShort,
91
+ guardrailsShort: GOAL_ROLES.guardrail,
92
+ secondaryShort: GOAL_ROLES.secondary,
77
93
  manageGoals: 'Manage goals',
78
94
  chooseGoal: 'Choose a goal',
79
95
  goalsError: "Couldn't load goals. Try again.",
@@ -85,6 +101,7 @@ export const TEST_PAGE = {
85
101
  addRule: 'Add a rule',
86
102
  removeRule: 'Remove rule',
87
103
  blockPathRule: 'This rule no longer applies to page block tests; remove it.',
104
+ targetingValue: (attribute)=>`Value for ${attribute}`,
88
105
  attribute: 'Attribute',
89
106
  comparison: 'Comparison',
90
107
  value: 'Value',
@@ -93,6 +110,7 @@ export const TEST_PAGE = {
93
110
  reach: 'About how many people will see this per day?',
94
111
  reachHelp: 'A rough number is fine. It only sets the suggested length.',
95
112
  duration: 'Planned length (days)',
113
+ endDate: 'Planned end date',
96
114
  noSuggestion: 'Enter a daily number above to get a suggestion. 4 weeks is a safe default.',
97
115
  chooseGoalSuggestion: 'Choose a goal to get a suggestion.',
98
116
  required: '(required)',
@@ -115,10 +133,10 @@ export const DELETE_TEST = {
115
133
  cancel: 'Cancel',
116
134
  deleted: 'Test deleted.',
117
135
  title: (name)=>`Delete “${name}”?`,
118
- consequences: 'This permanently deletes the test and all its rounds and results.',
136
+ consequences: "This permanently deletes the test and all its rounds and results. You can't undo this.",
119
137
  alreadyDeleted: 'This test was already deleted.',
120
138
  checking: 'Checking what visitors will see…',
121
- checkFailed: "Couldn’t check what visitors will see after deletion. You can still choose to delete this test.",
139
+ checkFailed: "Couldn't check what visitors will see after deletion. You can still choose to delete this test.",
122
140
  noEffect: 'Deleting this test will not change what visitors see.',
123
141
  versionChange: (before, after)=>`${before} → ${after}`,
124
142
  morePages: (count)=>`${count} more ${count === 1 ? 'page' : 'pages'}.`,
@@ -128,5 +146,24 @@ export const DELETE_TEST = {
128
146
  changedPages: (count)=>`${count} ${count === 1 ? 'page' : 'pages'} will change`,
129
147
  unreadablePages: (count, total)=>total === 1 ? "You can't open this page." : count === total ? "You can't open any of these pages." : `You can't open ${count} of these pages.`,
130
148
  pageWinner: 'These addresses will change where they send visitors:',
131
- content: 'Deleting the test does not delete your page content. An Experiment block that used this test stays on its page and says the test was deleted.'
149
+ content: 'Deleting the test does not delete your page content. A Test block that used this test stays on its page and says the test was deleted.',
150
+ runningSteps: [
151
+ 'Stop the test.',
152
+ 'Archive the test.'
153
+ ],
154
+ archiveFirst: 'You can delete this test after it is archived.',
155
+ close: 'Close'
132
156
  };
157
+ export function deleteStatusCopy(status, kind) {
158
+ switch(status){
159
+ case 'running':
160
+ return DELETE_TEST.archiveFirst;
161
+ case 'stopped':
162
+ return DELETE_TEST.archiveFirst;
163
+ case 'decided':
164
+ if (!kind) return `${DELETE_TEST.archiveFirst} Open the test to see the available archive options.`;
165
+ return `${DELETE_TEST.archiveFirst} Use the archive controls on the test.`;
166
+ default:
167
+ return API_MESSAGES.deleteInvalidStatus;
168
+ }
169
+ }
@@ -1,2 +1,5 @@
1
- /** Shared calendar date for admin copy, chart axes and tooltips. */
2
- export declare function formatDate(value: unknown): string;
1
+ export type DateFormatter = (value: unknown) => string;
2
+ export declare function createDateFormatter(timeZone?: string): DateFormatter;
3
+ /** Calendar date in the current environment's time zone. */
4
+ export declare const formatDate: DateFormatter;
5
+ export declare function relativeTime(value: string, now?: number, formatFallback?: DateFormatter): string;
@@ -1,10 +1,26 @@
1
- const formatter = new Intl.DateTimeFormat('en-GB', {
2
- day: 'numeric',
3
- month: 'short',
4
- year: 'numeric',
5
- timeZone: 'UTC'
1
+ export function createDateFormatter(timeZone) {
2
+ const formatter = new Intl.DateTimeFormat('en-US', {
3
+ month: 'short',
4
+ day: 'numeric',
5
+ year: 'numeric',
6
+ ...timeZone === undefined ? {} : {
7
+ timeZone
8
+ }
9
+ });
10
+ return (value)=>{
11
+ const date = value instanceof Date ? value : typeof value === 'string' || typeof value === 'number' ? new Date(value) : null;
12
+ return date && Number.isFinite(date.valueOf()) ? formatter.format(date) : '—';
13
+ };
14
+ }
15
+ /** Calendar date in the current environment's time zone. */ export const formatDate = createDateFormatter();
16
+ const relative = new Intl.RelativeTimeFormat('en', {
17
+ numeric: 'always'
6
18
  });
7
- /** Shared calendar date for admin copy, chart axes and tooltips. */ export function formatDate(value) {
8
- const date = value instanceof Date ? value : typeof value === 'string' || typeof value === 'number' ? new Date(value) : null;
9
- return date && Number.isFinite(date.valueOf()) ? formatter.format(date) : '—';
19
+ export function relativeTime(value, now = Date.now(), formatFallback = formatDate) {
20
+ const minutes = Math.max(0, Math.floor((now - Date.parse(value)) / 60_000));
21
+ if (!Number.isFinite(minutes)) return formatFallback(value);
22
+ if (minutes === 0) return 'just now';
23
+ if (minutes < 60) return relative.format(-minutes, 'minute');
24
+ if (minutes < 1440) return relative.format(-Math.floor(minutes / 60), 'hour');
25
+ return relative.format(-Math.floor(minutes / 1440), 'day');
10
26
  }
@@ -0,0 +1,6 @@
1
+ export declare function roundProgress(startedAt: unknown, duration: number | null | undefined, now: number, fallbackElapsedDays?: number): {
2
+ day: number | null;
3
+ plannedDays: number | null;
4
+ end: number | null;
5
+ daysToGo: number | null;
6
+ };
@@ -0,0 +1,15 @@
1
+ const dayMs = 86_400_000;
2
+ export function roundProgress(startedAt, duration, now, fallbackElapsedDays) {
3
+ const start = typeof startedAt === 'string' ? Date.parse(startedAt) : NaN;
4
+ const plannedDays = duration != null && Number.isFinite(duration) && duration > 0 ? duration : null;
5
+ const elapsed = Number.isFinite(start) ? (now - start) / dayMs : fallbackElapsedDays;
6
+ // The first 24 hours are Day 1. Countdown includes the part of today still ahead.
7
+ const day = elapsed != null && Number.isFinite(elapsed) ? Math.max(1, Math.floor(elapsed) + 1) : null;
8
+ const end = plannedDays !== null && Number.isFinite(start) ? start + plannedDays * dayMs : null;
9
+ return {
10
+ day: day !== null && plannedDays !== null ? Math.min(day, plannedDays) : day,
11
+ plannedDays,
12
+ end,
13
+ daysToGo: end !== null && Number.isFinite(now) ? Math.max(0, Math.ceil((end - now) / dayMs)) : null
14
+ };
15
+ }
@@ -0,0 +1,3 @@
1
+ import { type DateFormatter } from './date.js';
2
+ /** Use the same dates during SSR and hydration, then read the browser's time zone. */
3
+ export declare function useDateFormatter(): DateFormatter;
@@ -0,0 +1,8 @@
1
+ 'use client';
2
+ import { useSyncExternalStore } from 'react';
3
+ import { createDateFormatter, formatDate } from './date.js';
4
+ const formatUtcDate = createDateFormatter('UTC');
5
+ const subscribe = ()=>()=>{};
6
+ /** Use the same dates during SSR and hydration, then read the browser's time zone. */ export function useDateFormatter() {
7
+ return useSyncExternalStore(subscribe, ()=>formatDate, ()=>formatUtcDate);
8
+ }
@@ -24,7 +24,6 @@ export declare const VERDICT_LABELS: {
24
24
  'data-problem': string;
25
25
  'guardrail-failing': string;
26
26
  collecting: string;
27
- 'original-better': string;
28
27
  'worse-none-better': string;
29
28
  winner: string;
30
29
  mixed: string;
@@ -36,5 +35,5 @@ export declare const VERDICT_LABELS: {
36
35
  export declare function armLabel(key: string, storedLabel?: string): string;
37
36
  export declare function statusLabel(status: Status): string;
38
37
  export declare function phaseKindLabel(kind: 'test' | 'rollout'): string;
39
- export declare function verdictCodeLabel(code: VerdictCode): string;
38
+ export declare function verdictCodeLabel(code: VerdictCode, controlLabel?: string): string;
40
39
  export declare function kindLabel(kind: ExperimentKind): string;