@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
1
  import type { DocId } from '../types/contracts.js';
2
- import type { DeleteImpactResult, WrapBlockBody, PagesResult, PlacementStatusBody, PlacementStatusResult, RestoreContentEntryBody, RestoreContentEntryResult, DismissContentEntryBody, DismissContentEntryResult, AddMetricBody, AllocateBody, ArchiveBody, DecideBody, MakeContentResult, AddMetricResult, ClickKeysResult, PreflightResult, PreviewTokenResult, RefusalCode, ResultsResponse, SummaryResponse, TransitionSuccess } from '../types/endpoints.js';
2
+ import type { CopyPagePlan, CopyPageResult, DeleteImpactResult, WrapBlockBody, PagesResult, PlacementStatusBody, PlacementStatusResult, RestoreContentEntryBody, RestoreContentEntryResult, DismissContentEntryBody, DismissContentEntryResult, AddMetricBody, AllocateBody, ArchiveBody, DecideBody, MakeContentResult, AddMetricResult, ClickKeysResult, PreflightResult, PreviewTokenResult, RefusalCode, ResultsResponse, SummaryResponse, TransitionSuccess } from '../types/endpoints.js';
3
3
  import { refusalMessage } from './copy/common.js';
4
4
  export type ApiResult<T> = {
5
5
  ok: true;
@@ -28,16 +28,19 @@ export declare function createApi(apiBase: string, contentLocale?: string): {
28
28
  q?: string;
29
29
  path?: string;
30
30
  page?: number;
31
+ mode?: "block";
31
32
  }, signal?: AbortSignal) => Promise<ApiResult<PagesResult>>;
33
+ previewPageCopy: (id: DocId, arm: string, signal?: AbortSignal) => Promise<ApiResult<CopyPagePlan>>;
34
+ makePageCopy: (id: DocId, arm: string, plan: CopyPagePlan) => Promise<ApiResult<CopyPageResult>>;
32
35
  placementStatus: (body: PlacementStatusBody) => Promise<ApiResult<PlacementStatusResult>>;
33
- start: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
36
+ start: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
34
37
  allocate: (id: DocId, body: AllocateBody, options?: RequestOptions) => Promise<ApiResult<TransitionSuccess>>;
35
38
  addMetric: (id: DocId, body: AddMetricBody, options?: RequestOptions) => Promise<ApiResult<AddMetricResult>>;
36
- stop: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
39
+ stop: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
37
40
  decide: (id: DocId, body: DecideBody) => Promise<ApiResult<TransitionSuccess>>;
38
- releaseHoldout: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
39
- releasePages: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
40
- makeContent: (id: DocId) => Promise<ApiResult<MakeContentResult>>;
41
+ releaseHoldout: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
42
+ releasePages: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
43
+ makeContent: (id: DocId, phase?: number) => Promise<ApiResult<MakeContentResult>>;
41
44
  dismissContentEntry: (id: DocId, body: DismissContentEntryBody) => Promise<ApiResult<DismissContentEntryResult>>;
42
45
  restoreContentEntry: (id: DocId, body: RestoreContentEntryBody) => Promise<ApiResult<RestoreContentEntryResult>>;
43
46
  archive: (id: DocId, body: ArchiveBody) => Promise<ApiResult<TransitionSuccess>>;
@@ -1,3 +1,4 @@
1
+ import { XP_IF_UPDATED_AT_HEADER } from '../constants.js';
1
2
  import { contentLocaleURL } from './contentLocaleURL.js';
2
3
  import { API_MESSAGES, refusalMessage } from './copy/common.js';
3
4
  import { CONTENT_ENTRY_REFUSALS } from './copy/actions.js';
@@ -5,7 +6,7 @@ export function createApi(apiBase, contentLocale) {
5
6
  const collectionBase = `${apiBase.replace(/\/$/, '')}/xp-experiments`;
6
7
  const base = `${apiBase.replace(/\/$/, '')}/xp/experiments`;
7
8
  const route = (id, action)=>`${base}/${encodeURIComponent(id)}/${action}`;
8
- async function request(path, method, body, options, signal) {
9
+ async function request(path, method, body, options, signal, updatedAt) {
9
10
  try {
10
11
  const response = await fetch(path(), {
11
12
  method,
@@ -15,7 +16,10 @@ export function createApi(apiBase, contentLocale) {
15
16
  } : {},
16
17
  ...body === undefined ? {} : {
17
18
  headers: {
18
- 'Content-Type': 'application/json'
19
+ 'Content-Type': 'application/json',
20
+ ...updatedAt ? {
21
+ [XP_IF_UPDATED_AT_HEADER]: updatedAt
22
+ } : {}
19
23
  },
20
24
  body: JSON.stringify(body)
21
25
  }
@@ -86,40 +90,56 @@ export function createApi(apiBase, contentLocale) {
86
90
  },
87
91
  deleteTest: (id, { draft = false } = {})=>request(()=>`${collectionBase}/${encodeURIComponent(id)}`, 'DELETE', undefined, {
88
92
  notFound: API_MESSAGES.testAlreadyDeleted,
89
- ...draft ? {
90
- forbidden: API_MESSAGES.testNoLongerDraft
91
- } : {},
92
93
  codes: {
93
94
  'invalid-status': draft ? API_MESSAGES.testNoLongerDraft : API_MESSAGES.deleteInvalidStatus
94
95
  }
95
96
  }),
96
97
  wrapBlock: (body)=>request(()=>`${apiBase.replace(/\/$/, '')}/xp/blocks/wrap`, 'POST', body),
97
- pages: (query, signal)=>request(()=>`${apiBase.replace(/\/$/, '')}/xp/pages?${new URLSearchParams({
98
- collection: query.collection,
99
- ...query.q ? {
100
- q: query.q
101
- } : {},
102
- ...query.path !== undefined ? {
103
- path: query.path
104
- } : {},
105
- ...query.page ? {
106
- page: String(query.page)
107
- } : {}
108
- })}`, 'GET', undefined, undefined, signal),
98
+ pages: (query, signal)=>request(()=>{
99
+ const params = new URLSearchParams({
100
+ collection: query.collection
101
+ });
102
+ if (query.q) params.set('q', query.q);
103
+ if (query.path !== undefined) params.set('path', query.path);
104
+ if (query.page) params.set('page', String(query.page));
105
+ if (query.mode) params.set('mode', query.mode);
106
+ if (contentLocale) params.set('locale', contentLocale);
107
+ return `${apiBase.replace(/\/$/, '')}/xp/pages?${params}`;
108
+ }, 'GET', undefined, undefined, signal),
109
+ previewPageCopy: (id, arm, signal)=>request(()=>`${route(id, 'duplicate-original')}?arm=${encodeURIComponent(arm)}`, 'GET', undefined, undefined, signal),
110
+ makePageCopy: (id, arm, plan)=>request(()=>route(id, 'duplicate-original'), 'POST', {
111
+ ...plan,
112
+ arm
113
+ }, undefined, undefined, plan.updatedAt),
109
114
  placementStatus: (body)=>request(()=>`${apiBase.replace(/\/$/, '')}/xp/placements/status`, 'POST', body),
110
- start: (id)=>post(id, 'start'),
115
+ start: (id, phase)=>post(id, 'start', phase === undefined ? undefined : {
116
+ phase
117
+ }),
111
118
  allocate: (id, body, options)=>post(id, 'allocate', body, options),
112
119
  addMetric: (id, body, options)=>post(id, 'add-metric', body, options),
113
- stop: (id)=>post(id, 'stop'),
120
+ stop: (id, phase)=>post(id, 'stop', phase === undefined ? undefined : {
121
+ phase
122
+ }),
114
123
  decide: (id, body)=>post(id, 'decide', body),
115
- releaseHoldout: (id)=>post(id, 'release-holdout'),
116
- releasePages: (id)=>post(id, 'release-pages'),
117
- makeContent: (id)=>post(id, 'make-content'),
124
+ releaseHoldout: (id, phase)=>post(id, 'release-holdout', phase === undefined ? undefined : {
125
+ phase
126
+ }),
127
+ releasePages: (id, phase)=>post(id, 'release-pages', phase === undefined ? undefined : {
128
+ phase
129
+ }),
130
+ makeContent: (id, phase)=>post(id, 'make-content', phase === undefined ? undefined : {
131
+ phase
132
+ }),
118
133
  dismissContentEntry: (id, body)=>post(id, 'content-report/dismiss', body, CONTENT_ENTRY_REFUSALS),
119
134
  restoreContentEntry: (id, body)=>post(id, 'content-report/restore', body, CONTENT_ENTRY_REFUSALS),
120
135
  archive: (id, body)=>post(id, 'archive', body),
121
136
  clickKeys: (id)=>request(()=>route(id, 'click-keys'), 'GET'),
122
- deleteImpact: (id, signal)=>request(()=>contentLocaleURL(route(id, 'delete-impact'), contentLocale), 'GET', undefined, undefined, signal),
137
+ deleteImpact: (id, signal)=>request(()=>contentLocaleURL(route(id, 'delete-impact'), contentLocale), 'GET', undefined, {
138
+ codes: {
139
+ 'invalid-status': API_MESSAGES.deleteInvalidStatus
140
+ },
141
+ fallback: API_MESSAGES.deleteImpactUnavailable
142
+ }, signal),
123
143
  preflight: (id)=>request(()=>contentLocaleURL(route(id, 'preflight'), contentLocale), 'GET'),
124
144
  previewToken: (id, arm)=>request(()=>`${route(id, 'preview-token')}?arm=${encodeURIComponent(arm)}`, 'GET'),
125
145
  results: (id, options = {})=>request(()=>{
@@ -1,5 +1,6 @@
1
1
  import type { AddMetricWarning } from '../../types/endpoints.js';
2
2
  export declare const ACTIONS_COPY: {
3
+ readonly decisionUnavailable: "This round can no longer be decided here. Copy your note before closing.";
3
4
  readonly start: "Start";
4
5
  readonly restart: "Start a new round";
5
6
  readonly stop: "Stop";
@@ -9,19 +10,35 @@ export declare const ACTIONS_COPY: {
9
10
  readonly finish: "Finish archiving";
10
11
  readonly archive: "Archive";
11
12
  readonly discard: "Discard winner";
12
- readonly startBody: "Start this test?";
13
- readonly restartBody: "Starting again begins a new round; results restart.";
14
- readonly stopBody: "Everyone will see the Original. Starting again begins a new round; results restart.";
15
- readonly original: "Everyone will see the Original.";
16
- readonly discardBody: "Everyone goes back to the Original. The decision note is kept.";
17
- readonly archiveBody: "Archive this test?";
18
- readonly finishBody: "The content has been updated. Finish archiving this test.";
13
+ readonly startBody: "The test will start showing versions to visitors and collecting results.";
14
+ readonly restartBody: "Visitors will start seeing test versions again. New results go into a new round, and earlier results are kept.";
15
+ readonly finishBody: "The updated content stays in place. The test moves to Archived and keeps its results. You can then delete it.";
16
+ readonly 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.";
17
+ readonly confirmPermanentWinner: "Confirm permanent winner";
18
+ readonly titleLead: {
19
+ readonly restart: "Start a new round for";
20
+ readonly decide: "Decide the winner for";
21
+ readonly 'release-holdout': "Release the holdout for";
22
+ readonly 'make-content': "Make the winner permanent for";
23
+ readonly discard: "Discard the winner for";
24
+ readonly 'hard-coded': "Confirm the permanent winner for";
25
+ readonly allocate: "Let more people into";
26
+ readonly 'add-metric': "Add a goal to";
27
+ readonly 'release-pages': "Release pages for";
28
+ };
29
+ readonly decideBody: "Choose the version visitors should see going forward. The test round ends and its results are kept.";
30
+ readonly decideRoundMissing: "Couldn't find the versions from this round. Close this dialog and check the current round.";
31
+ readonly actionChanged: "This test changed. Close this dialog to see the current actions.";
19
32
  readonly noResults: "There are no results yet.";
20
- readonly noRecommendation: "The results don't recommend a group yet.";
21
- readonly different: "You chose a different group than the results recommend.";
22
- readonly group: "Group";
23
- readonly note: "Decision note";
33
+ readonly noRecommendation: "The results don't recommend a version yet.";
34
+ readonly different: "You chose a different version than the results recommend.";
35
+ readonly winningVersion: "Winning version";
36
+ readonly chooseVersion: "Choose a version";
37
+ readonly note: "Decision note (optional)";
38
+ readonly requiredNote: "Decision note (required for this choice)";
24
39
  readonly confirmation: "Confirmation";
40
+ readonly noEvidence: "No one has taken part yet, so there's nothing to compare. Deciding now picks a version without evidence.";
41
+ readonly decideAnyway: "Decide anyway";
25
42
  readonly typePhrase: "Type the following to confirm:";
26
43
  readonly cancel: "Cancel";
27
44
  readonly retry: "Retry";
@@ -32,7 +49,7 @@ export declare const ACTIONS_COPY: {
32
49
  readonly contentArchived: "The winner is now the content and the test is archived.";
33
50
  readonly dismissLabel: (page: string) => string;
34
51
  readonly undoLabel: (page: string) => string;
35
- readonly dismissHelp: "Dismiss a page you'll update by hand, then finish archiving.";
52
+ readonly dismissHelp: "Dismiss each page you plan to update by hand so you can finish archiving.";
36
53
  readonly contentEntryNotDecided: "This test isn't decided, so its pages can't be changed.";
37
54
  readonly contentEntryMissing: "This page is no longer in the list. Reload to see the current list.";
38
55
  readonly contentEntryDismissed: "This page was already dismissed.";
@@ -52,9 +69,15 @@ export declare const ACTIONS_COPY: {
52
69
  'update-failed': string;
53
70
  };
54
71
  readonly missingContent: "This page no longer exists; nothing to change.";
55
- readonly partial: "Some pages couldn't be updated. Fix them and retry.";
72
+ readonly partial: "Some pages still need changes.";
56
73
  };
57
- export declare const decideCopy: (winner: string, holdout: boolean, original: boolean) => string;
74
+ export declare const actionTitle: (action: string, test: string) => string;
75
+ export declare const actionTitleFor: (action: string, test: string) => string;
76
+ export declare const actionsForTest: (test: string) => string;
77
+ export declare const stopCopy: (control: string) => string;
78
+ export declare const discardCopy: (control: string) => string;
79
+ export declare const archiveCopy: (control: string) => string;
80
+ export declare const decideCopy: (winner: string, holdout: boolean, control: string, isControl: boolean) => string;
58
81
  export declare const releaseCopy: (winner: string) => string;
59
82
  export declare const makeContentCopy: (winner: string, kind: "block" | "page" | "flag") => string;
60
83
  export declare const hardCodedLabel: (winner: string) => string;
@@ -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,19 +10,35 @@ 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.',
15
- 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.',
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
+ finishBody: 'The updated content stays in place. The test moves to Archived and keeps its results. You can then delete it.',
16
+ 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.',
17
+ confirmPermanentWinner: 'Confirm permanent winner',
18
+ titleLead: {
19
+ restart: 'Start a new round for',
20
+ decide: 'Decide the winner for',
21
+ 'release-holdout': 'Release the holdout for',
22
+ 'make-content': 'Make the winner permanent for',
23
+ discard: 'Discard the winner for',
24
+ 'hard-coded': 'Confirm the permanent winner for',
25
+ allocate: 'Let more people into',
26
+ 'add-metric': 'Add a goal to',
27
+ 'release-pages': 'Release pages for'
28
+ },
29
+ decideBody: 'Choose the version visitors should see going forward. The test round ends and its results are kept.',
30
+ decideRoundMissing: "Couldn't find the versions from this round. Close this dialog and check the current round.",
31
+ actionChanged: 'This test changed. Close this dialog to see the current actions.',
19
32
  noResults: 'There are no results yet.',
20
- noRecommendation: "The results don't recommend a group yet.",
21
- different: 'You chose a different group than the results recommend.',
22
- group: 'Group',
23
- note: 'Decision note',
33
+ noRecommendation: "The results don't recommend a version yet.",
34
+ different: 'You chose a different version than the results recommend.',
35
+ winningVersion: 'Winning version',
36
+ chooseVersion: 'Choose a version',
37
+ note: 'Decision note (optional)',
38
+ requiredNote: 'Decision note (required for this choice)',
24
39
  confirmation: 'Confirmation',
40
+ noEvidence: "No one has taken part yet, so there's nothing to compare. Deciding now picks a version without evidence.",
41
+ decideAnyway: 'Decide anyway',
25
42
  typePhrase: 'Type the following to confirm:',
26
43
  cancel: 'Cancel',
27
44
  retry: 'Retry',
@@ -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,24 @@ 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
  };
57
- 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}.`;
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}`;
77
+ export const stopCopy = (control)=>`Visitors will go back to ${control}. The test stops collecting data and keeps its results. Starting again begins a new round.`;
78
+ export const discardCopy = (control)=>`Visitors go back to ${control}. The test moves to Archived and keeps its results and decision note. You can then delete it.`;
79
+ export const archiveCopy = (control)=>`The test moves out of the active list into Archived. It won't collect any more data, and visitors will keep seeing ${control}. You can still view the results or delete the test later. You can't restart it.`;
80
+ export const decideCopy = (winner, holdout, control, isControl)=>holdout && !isControl ? `Everyone except the holdout will see ${winner}. The holdout keeps seeing ${control} so we can measure the shipped change.` : `Everyone will see ${winner}.`;
58
81
  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.`;
82
+ 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
83
  export const hardCodedLabel = (winner)=>`The developer has hard-coded ${winner}`;
61
84
  /** 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
85
  // Each dismiss/restore refusal code has its own sentence; server text is never shown.
@@ -45,6 +45,16 @@ export declare const ADVANCED_COPY: {
45
45
  readonly label: "Unit type";
46
46
  readonly help: "Count visitors or signed-in users, as chosen at creation.";
47
47
  };
48
+ readonly kinds: {
49
+ readonly block: "Page block";
50
+ readonly flag: "Setting";
51
+ readonly code: "Developer code";
52
+ readonly page: "Whole page";
53
+ };
54
+ readonly units: {
55
+ readonly visitor: "Each visitor";
56
+ readonly user: "Each signed-in user";
57
+ };
48
58
  readonly inheritedWindow: "Use each goal's window";
49
59
  readonly automaticTuning: "Automatic (5,000)";
50
60
  readonly sequential: "Sequential";
@@ -45,6 +45,16 @@ export const ADVANCED_COPY = {
45
45
  label: 'Unit type',
46
46
  help: 'Count visitors or signed-in users, as chosen at creation.'
47
47
  },
48
+ kinds: {
49
+ block: 'Page block',
50
+ flag: 'Setting',
51
+ code: 'Developer code',
52
+ page: 'Whole page'
53
+ },
54
+ units: {
55
+ visitor: 'Each visitor',
56
+ user: 'Each signed-in user'
57
+ },
48
58
  inheritedWindow: "Use each goal's window",
49
59
  automaticTuning: 'Automatic (5,000)',
50
60
  sequential: 'Sequential',
@@ -1,7 +1,7 @@
1
1
  export { ARM_LABELS as GROUP_LABELS } from '../../labels/arms.js';
2
2
  export { ISSUE_COPY, issueMessage } from '../../arms/copy.js';
3
3
  export declare const ARMS_COPY: {
4
- readonly holdout: "The holdout sees the Original and is measured but not compared during the test. After you decide, it keeps seeing the Original so the winner can be compared with it.";
4
+ readonly holdout: (control: string) => string;
5
5
  readonly pageRequired: "Enter a page path for this group.";
6
6
  readonly pageInvalid: "Use a page path starting with /, without a host, query or fragment.";
7
7
  readonly paramRequired: "Enter a value for {label}.";
@@ -1,7 +1,7 @@
1
1
  export { ARM_LABELS as GROUP_LABELS } from '../../labels/arms.js';
2
2
  export { ISSUE_COPY, issueMessage } from '../../arms/copy.js';
3
3
  export const ARMS_COPY = {
4
- holdout: 'The holdout sees the Original and is measured but not compared during the test. After you decide, it keeps seeing the Original so the winner can be compared with it.',
4
+ holdout: (control)=>`The holdout sees ${control} and is measured but not compared during the test. After you decide, it keeps seeing ${control} so the winner can be compared with it.`,
5
5
  pageRequired: 'Enter a page path for this group.',
6
6
  pageInvalid: 'Use a page path starting with /, without a host, query or fragment.',
7
7
  paramRequired: 'Enter a value for {label}.',
@@ -23,9 +23,10 @@ export declare const NUMBER_OP_LABELS: {
23
23
  export declare const participation: (allocation: string, people: string, groups: string) => string;
24
24
  export declare const eachVersion: (share: string) => string;
25
25
  export declare const groupShare: (share: string, label: string) => string;
26
- export declare const uncounted = "; the rest see the Original and are not counted";
27
- export declare const holdoutClause: (weight: string) => string;
28
- export declare const holdoutRemainder = "; everyone else sees the Original and is not counted";
26
+ export declare const uncounted: (control: string) => string;
27
+ export declare const holdoutClause: (weight: string, control: string) => string;
28
+ export declare const holdoutRemainder: (control: string) => string;
29
+ export declare const holdoutContent: (control: string) => string;
29
30
  export declare const layerSentence: (name: string, used: number, free: number) => string;
30
31
  export declare const peopleLabel: {
31
32
  readonly visitor: "visitors";
@@ -22,10 +22,11 @@ export const NUMBER_OP_LABELS = {
22
22
  };
23
23
  export const participation = (allocation, people, groups)=>`${allocation}% of ${people} take part: about ${groups}`;
24
24
  export const eachVersion = (share)=>`${share}% see each version`;
25
- export const groupShare = (share, label)=>`${share}% see ${label === 'Original' ? 'the Original' : label}`;
26
- export const uncounted = '; the rest see the Original and are not counted';
27
- export const holdoutClause = (weight)=>`; the holdout (${weight}% of them) sees the Original and is measured`;
28
- export const holdoutRemainder = '; everyone else sees the Original and is not counted';
25
+ export const groupShare = (share, label)=>`${share}% see ${label}`;
26
+ export const uncounted = (control)=>`; the rest see ${control} and are not counted`;
27
+ export const holdoutClause = (weight, control)=>`; the holdout (${weight}% of them) sees ${control} and is measured`;
28
+ export const holdoutRemainder = (control)=>`; everyone else sees ${control} and is not counted`;
29
+ export const holdoutContent = (control)=>`Sees ${control}`;
29
30
  export const layerSentence = (name, used, free)=>` Uses ${used} of the 100 slices in layer ${name}; ${free} are free.`;
30
31
  export const peopleLabel = {
31
32
  visitor: 'visitors',
@@ -1,24 +1,26 @@
1
1
  export declare const API_MESSAGES: {
2
2
  readonly testAlreadyDeleted: "This test was already deleted. Reload the page.";
3
- readonly deleteInvalidStatus: "This test has changed and cannot be deleted now. Reload the page.";
3
+ readonly deleteInvalidStatus: "Only draft and archived tests can be deleted. Open the test to see how to archive it.";
4
4
  readonly testNoLongerDraft: "This test is no longer a draft. Reload the page.";
5
5
  readonly notFound: "This test no longer exists.";
6
6
  readonly goalNotFound: "That goal no longer exists. Choose another goal.";
7
7
  readonly roundChanged: "This round has changed. Reload the page.";
8
8
  readonly roundNotFound: "That round no longer exists. Choose another round.";
9
- 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.";
10
11
  readonly notImplemented: "This isn't available yet.";
11
12
  readonly unauthenticated: "Your session has expired. Sign in again.";
12
13
  readonly forbidden: "You don't have permission to do this.";
13
- readonly network: "Couldn't reach the server. Check your connection and try again.";
14
+ readonly network: "Couldn't reach the server. Check your connection.";
14
15
  readonly failed: "Couldn't complete this change. Try again.";
15
- 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.";
16
18
  };
17
19
  export declare const LOCKED_MESSAGES: {
18
20
  readonly creation: "Set when the test was created.";
19
- readonly running: "Locked while the test is running so everyone in this round sees the same thing. Stop the test to change it.";
21
+ readonly running: "Locked while the test is running. Stop the test to change this.";
20
22
  readonly runningAllocation: "To include more people, use \"Let more people in\" at the bottom of the page. To include fewer, stop the test; the change applies when you start it again.";
21
- readonly runningMetrics: "Add a guardrail or something to watch with \"Add a goal\" at the bottom of the page; the main goal is fixed for this round.";
23
+ readonly runningMetrics: "Use \"Add a goal\" to track another goal. The main goal is fixed for this round.";
22
24
  readonly decided: "Locked after the decision.";
23
25
  readonly archived: "Archived tests can't be changed.";
24
26
  readonly other: "Can't be changed in this state.";
@@ -1,25 +1,27 @@
1
1
  import { unpublishedPlacementsCopy } from './readiness.js';
2
2
  export const API_MESSAGES = {
3
3
  testAlreadyDeleted: 'This test was already deleted. Reload the page.',
4
- deleteInvalidStatus: 'This test has changed and cannot be deleted now. Reload the page.',
4
+ deleteInvalidStatus: 'Only draft and archived tests can be deleted. Open the test to see how to archive it.',
5
5
  testNoLongerDraft: 'This test is no longer a draft. Reload the page.',
6
6
  notFound: 'This test no longer exists.',
7
7
  goalNotFound: 'That goal no longer exists. Choose another goal.',
8
8
  roundChanged: 'This round has changed. Reload the page.',
9
9
  roundNotFound: 'That round no longer exists. Choose another round.',
10
- 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.",
11
12
  notImplemented: "This isn't available yet.",
12
13
  unauthenticated: 'Your session has expired. Sign in again.',
13
14
  forbidden: "You don't have permission to do this.",
14
- network: "Couldn't reach the server. Check your connection and try again.",
15
+ network: "Couldn't reach the server. Check your connection.",
15
16
  failed: "Couldn't complete this change. Try again.",
16
- 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."
17
19
  };
18
20
  export const LOCKED_MESSAGES = {
19
21
  creation: 'Set when the test was created.',
20
- running: 'Locked while the test is running so everyone in this round sees the same thing. Stop the test to change it.',
22
+ running: 'Locked while the test is running. Stop the test to change this.',
21
23
  runningAllocation: 'To include more people, use "Let more people in" at the bottom of the page. To include fewer, stop the test; the change applies when you start it again.',
22
- runningMetrics: 'Add a guardrail or something to watch with "Add a goal" at the bottom of the page; the main goal is fixed for this round.',
24
+ runningMetrics: 'Use "Add a goal" to track another goal. The main goal is fixed for this round.',
23
25
  decided: 'Locked after the decision.',
24
26
  archived: "Archived tests can't be changed.",
25
27
  other: "Can't be changed in this state."
@@ -1,5 +1,6 @@
1
1
  /** Shared by server readiness checks and client placement lists. */
2
2
  export declare const PLACEMENT_LANGUAGES: {
3
+ readonly labelWithCode: (label: string, code: string) => string;
3
4
  readonly allLocales: "All languages";
4
5
  readonly locales: (names: string) => string;
5
6
  };
@@ -1,4 +1,5 @@
1
1
  /** Shared by server readiness checks and client placement lists. */ export const PLACEMENT_LANGUAGES = {
2
+ labelWithCode: (label, code)=>`${label} (${code})`,
2
3
  allLocales: 'All languages',
3
4
  locales: (names)=>`Languages: ${names}`
4
5
  };
@@ -1,5 +1,11 @@
1
+ export declare const GOAL_ROLES: {
2
+ readonly primary: "Main goal";
3
+ readonly secondary: "Also tracked";
4
+ readonly guardrail: "Must not get worse";
5
+ };
1
6
  export declare const METRICS_COPY: {
2
7
  readonly source: "Measured by";
8
+ readonly browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.";
3
9
  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
10
  };
5
11
  export declare const METRIC_KIND_LABELS: {
@@ -7,3 +13,4 @@ export declare const METRIC_KIND_LABELS: {
7
13
  readonly count: "count";
8
14
  readonly revenue: "amount";
9
15
  };
16
+ export declare function percentileTail(quantile: number): number;
@@ -1,5 +1,11 @@
1
+ export const GOAL_ROLES = {
2
+ primary: 'Main goal',
3
+ secondary: 'Also tracked',
4
+ guardrail: 'Must not get worse'
5
+ };
1
6
  export const METRICS_COPY = {
2
7
  source: 'Measured by',
8
+ browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.",
3
9
  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
10
  };
5
11
  export const METRIC_KIND_LABELS = {
@@ -7,3 +13,6 @@ export const METRIC_KIND_LABELS = {
7
13
  count: 'count',
8
14
  revenue: 'amount'
9
15
  };
16
+ export function percentileTail(quantile) {
17
+ return Number(((1 - quantile) * 100).toPrecision(12));
18
+ }