@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,4 +1,5 @@
1
1
  import { CLICK_GOAL_COPY } from '../../goals/picker/copy.js';
2
+ import { percentileTail } from '../../testSurface/copy/metrics.js';
2
3
  export const GOALS_COPY = {
3
4
  slugRule: CLICK_GOAL_COPY.slugRule,
4
5
  duplicateSlug: CLICK_GOAL_COPY.duplicateSlug,
@@ -9,6 +10,7 @@ export const GOALS_COPY = {
9
10
  name: 'Name',
10
11
  source: 'Measured by',
11
12
  directionColumn: 'Better when',
13
+ nameRequired: 'Enter a name for this goal.',
12
14
  direction: 'Better when it goes',
13
15
  increase: 'More is better',
14
16
  decrease: 'Less is better',
@@ -26,18 +28,19 @@ export const GOALS_COPY = {
26
28
  slugLocked: 'The short name stays the same once a test uses this goal.',
27
29
  sourceLocked: 'What this goal measures stays the same once a test uses it.',
28
30
  chooseSource: 'Choose an outcome',
29
- window: 'Count results for (hours)',
31
+ window: 'Count results for (days)',
32
+ windowError: 'Enter a whole number of days, at least 1.',
30
33
  minimum: 'Minimum completions before deciding',
34
+ minimumError: 'Enter a number of at least 1.',
31
35
  advanced: 'Advanced',
32
36
  capping: 'Limit very large values',
33
37
  capType: 'Limit by',
34
- capValue: 'Limit value',
35
- noCap: 'No limit',
36
- percentile: 'Based on past amounts',
37
- absolute: 'Fixed amount',
38
- capHelp: 'For past amounts, enter a number such as 0.99 to limit only the largest 1%; or enter a fixed amount.',
38
+ capValue: 'Fixed amount',
39
+ noCap: "Don't limit",
40
+ absolute: 'Limit to a fixed amount',
41
+ fixedAmountError: 'Enter an amount of zero or more.',
39
42
  threshold: 'Warn when it gets worse by (%)',
40
- save: 'Save',
43
+ createGoal: 'Create goal',
41
44
  saving: 'Saving…',
42
45
  cancel: 'Cancel',
43
46
  remove: 'Delete goal',
@@ -50,9 +53,13 @@ export const GOALS_COPY = {
50
53
  notFound: 'This goal no longer exists.',
51
54
  backToTest: 'Back to the test',
52
55
  useGoal: 'Use this goal',
53
- open: 'Open',
54
56
  search: 'Search goals',
55
57
  clearSearch: 'Clear search',
58
+ roles: {
59
+ primary: 'Main goal',
60
+ secondary: 'Also tracked',
61
+ guardrails: 'Must not get worse'
62
+ },
56
63
  fields: 'Goal details',
57
64
  deleteTitle: 'Delete this goal?',
58
65
  deleteBody: 'This cannot be undone.',
@@ -75,3 +82,6 @@ export function goalsNoMatches(search) {
75
82
  export function goalShowAll(count) {
76
83
  return `Show all ${count}`;
77
84
  }
85
+ export function largestValues(quantile) {
86
+ return `Limit the largest ${percentileTail(Number(quantile))}%`;
87
+ }
@@ -4,21 +4,23 @@ export declare const NEW_TEST_COPY: {
4
4
  readonly setting: "A setting";
5
5
  readonly page: "A whole page";
6
6
  readonly pageMeaning: "Show different versions of a whole page at the same address, and see which one works better.";
7
- readonly collection: "Collection";
7
+ readonly collection: "Which type of page?";
8
8
  readonly original: "Original";
9
9
  readonly originalHelp: "Choose the page visitors see today.";
10
10
  readonly review: "Review";
11
11
  readonly backToTest: "Back to the test";
12
12
  readonly finishSetup: "Finish setup";
13
- readonly start: "Start";
14
- readonly blocksHandoff: "Pick the block to test with 'Test a block on this page'.";
13
+ readonly blocksHandoff: `Choose '${string}' to pick the block to test.`;
14
+ readonly blocksOnlyHandoff: `Open the page you want to test, then choose '${string}' to pick the block to test.`;
15
+ readonly pageType: "Page type";
16
+ readonly choosePageType: "Choose a page type";
15
17
  readonly blockMeaning: "Compare different versions of content on a page.";
16
18
  readonly settingMeaning: "Compare different choices for a setting on your site.";
17
19
  readonly unavailable: "A developer needs to set up pages or settings before you can create a test.";
18
- readonly handoff: "Open the page, add an Experiment block where you want it, and choose Set up test.";
19
- readonly noPages: "There are no pages yet.";
20
- readonly recentPages: "Showing the 50 most recently edited.";
21
- readonly open: "Open";
20
+ readonly handoff: "Open the page you want to test, then follow these steps in the editor.";
21
+ readonly mixedEditorHandoff: "Open the page you want to test, then follow the steps for its editor.";
22
+ readonly pagesMarked: (editor: string) => string;
23
+ readonly handoffSteps: readonly ["Add a Test block to the page.", "Choose Set up test in the sidebar."];
22
24
  readonly chooseSetting: "Which setting do you want to test?";
23
25
  readonly people: "Count people as:";
24
26
  readonly visitors: "Visitors";
@@ -35,6 +37,7 @@ export declare const NEW_TEST_COPY: {
35
37
  readonly name: "Name";
36
38
  readonly hypothesis: "Why are you testing this? (optional)";
37
39
  readonly back: "Back";
40
+ readonly change: "Change";
38
41
  readonly next: "Next";
39
42
  readonly createTest: "Create";
40
43
  readonly creating: "Creating…";
@@ -1,24 +1,30 @@
1
+ import { BLOCK_COPY } from './blocks.js';
1
2
  export const NEW_TEST_COPY = {
2
3
  question: 'What do you want to test?',
3
4
  block: 'A block on a page',
4
5
  setting: 'A setting',
5
6
  page: 'A whole page',
6
7
  pageMeaning: 'Show different versions of a whole page at the same address, and see which one works better.',
7
- collection: 'Collection',
8
+ collection: 'Which type of page?',
8
9
  original: 'Original',
9
10
  originalHelp: 'Choose the page visitors see today.',
10
11
  review: 'Review',
11
12
  backToTest: 'Back to the test',
12
13
  finishSetup: 'Finish setup',
13
- start: 'Start',
14
- blocksHandoff: "Pick the block to test with 'Test a block on this page'.",
14
+ blocksHandoff: `Choose '${BLOCK_COPY.testBlock}' to pick the block to test.`,
15
+ blocksOnlyHandoff: `Open the page you want to test, then choose '${BLOCK_COPY.testBlock}' to pick the block to test.`,
16
+ pageType: 'Page type',
17
+ choosePageType: 'Choose a page type',
15
18
  blockMeaning: 'Compare different versions of content on a page.',
16
19
  settingMeaning: 'Compare different choices for a setting on your site.',
17
20
  unavailable: 'A developer needs to set up pages or settings before you can create a test.',
18
- handoff: 'Open the page, add an Experiment block where you want it, and choose Set up test.',
19
- noPages: 'There are no pages yet.',
20
- recentPages: 'Showing the 50 most recently edited.',
21
- open: 'Open',
21
+ handoff: 'Open the page you want to test, then follow these steps in the editor.',
22
+ mixedEditorHandoff: 'Open the page you want to test, then follow the steps for its editor.',
23
+ pagesMarked: (editor)=>`Pages marked ${editor}:`,
24
+ handoffSteps: [
25
+ 'Add a Test block to the page.',
26
+ 'Choose Set up test in the sidebar.'
27
+ ],
22
28
  chooseSetting: 'Which setting do you want to test?',
23
29
  people: 'Count people as:',
24
30
  visitors: 'Visitors',
@@ -35,6 +41,7 @@ export const NEW_TEST_COPY = {
35
41
  name: 'Name',
36
42
  hypothesis: 'Why are you testing this? (optional)',
37
43
  back: 'Back',
44
+ change: 'Change',
38
45
  next: 'Next',
39
46
  createTest: 'Create',
40
47
  creating: 'Creating…',
@@ -1,7 +1,7 @@
1
1
  export declare const STATUS_TOOLTIPS: {
2
2
  readonly draft: "Draft";
3
3
  readonly running: "Running";
4
- readonly stopped: "Stopped — everyone sees the Original";
4
+ readonly stopped: (label?: string) => string;
5
5
  readonly decided: "Decided — everyone sees the winner";
6
6
  readonly decidedWithHoldout: "Decided — everyone sees the winner, except the holdout";
7
7
  readonly archived: "Archived";
@@ -1,7 +1,8 @@
1
+ import { controlVersionName } from '../../labels/arms.js';
1
2
  export const STATUS_TOOLTIPS = {
2
3
  draft: 'Draft',
3
4
  running: 'Running',
4
- stopped: 'Stopped — everyone sees the Original',
5
+ stopped: (label)=>`Stopped — everyone sees ${controlVersionName(label)}`,
5
6
  decided: 'Decided — everyone sees the winner',
6
7
  decidedWithHoldout: 'Decided — everyone sees the winner, except the holdout',
7
8
  archived: 'Archived'
@@ -3,6 +3,7 @@ import type { ExperimentsPageCollection } from '../types/contracts.js';
3
3
  export declare function serializePageCollections(collections: ExperimentsPageCollection[], req: PayloadRequest): {
4
4
  copyUrl: string;
5
5
  copyLabel: string;
6
+ copyEnabled?: true | undefined;
6
7
  copyHint?: string | undefined;
7
8
  slug: string;
8
9
  label: string;
@@ -10,6 +10,9 @@ export function serializePageCollections(collections, req) {
10
10
  ...entry.copyHint ? {
11
11
  copyHint: entry.copyHint
12
12
  } : {},
13
+ ...entry.copy ? {
14
+ copyEnabled: true
15
+ } : {},
13
16
  copyUrl: entry.copyUrl ?? formatAdminURL({
14
17
  adminRoute: req.payload.config.routes.admin,
15
18
  path: `/collections/${entry.slug}`
@@ -1,3 +1,4 @@
1
+ import { controlVersionName } from '../labels/arms.js';
1
2
  export function pageStatusCopy(test) {
2
3
  if (test.pagesReleased) return null;
3
4
  const winner = `${test.winnerLabel ?? 'the winner'}${test.winnerTitle ? ` (${test.winnerTitle})` : ''}`;
@@ -6,14 +7,15 @@ export function pageStatusCopy(test) {
6
7
  return `This page is ${test.armLabel} in the draft test ${test.name}.`;
7
8
  case 'stopped':
8
9
  {
9
- const visitors = test.role === 'original' ? 'Visitors see this page.' : !test.originalPath ? 'Visitors see the Original.' : `Visitors to ${test.originalPath === '/' ? 'the homepage (/)' : test.originalPath} see the Original.`;
10
+ const control = controlVersionName(test.controlLabel);
11
+ const visitors = test.role === 'original' ? 'Visitors see this page.' : !test.originalPath ? `Visitors see ${control}.` : `Visitors to ${test.originalPath === '/' ? 'the homepage (/)' : test.originalPath} see ${control}.`;
10
12
  return `This page is ${test.armLabel} in the stopped test ${test.name}. ${visitors}`;
11
13
  }
12
14
  case 'running':
13
15
  return `This page is the ${test.armLabel} of a running test: ${test.name}.`;
14
16
  case 'decided':
15
- return `This page is ${test.armLabel} of a decided test; ${test.rollout ? `most visitors see ${winner}; a holdout still sees the Original` : `visitors see ${winner}`}.`;
17
+ return `This page is ${test.armLabel} of a decided test; ${test.rollout ? `most visitors see ${winner}; a holdout still sees ${controlVersionName(test.controlLabel ?? (test.role === 'original' ? test.armLabel : undefined))}` : `visitors see ${winner}`}.`;
16
18
  case 'archived':
17
- return test.winner ? `This page is also shown at the other versions' addresses because test ${test.name} made it the winner. To free it, open the test and choose "Release pages".` : test.role === 'original' ? `This page's address now shows the winner of test ${test.name}. To free it, open the test and choose "Release pages".` : `This page's address now shows ${winner}. To show this page again, open the test and choose "Release pages".`;
19
+ return test.winner ? `This page is also shown at the other versions' addresses because test ${test.name} made it the winner. Use "Release pages" on the test to free it.` : test.role === 'original' ? `This page's address now shows the winner of test ${test.name}. Use "Release pages" on the test to free it.` : `This page's address now shows ${winner}. Use "Release pages" on the test to show this page again.`;
18
20
  }
19
21
  }
@@ -4,6 +4,7 @@ export declare function statusPill({ status, arms, decision }: {
4
4
  status: Status;
5
5
  arms?: readonly {
6
6
  key: string;
7
+ label?: string;
7
8
  }[] | null;
8
9
  decision?: {
9
10
  winnerArm?: string | null;
@@ -9,9 +9,10 @@ const TONES = {
9
9
  };
10
10
  export function statusPill({ status, arms = [], decision }) {
11
11
  const holdout = status === 'decided' && arms?.some((group)=>group.key === 'holdout') && Boolean(decision?.winnerArm) && decision?.winnerArm !== 'control' && !decision?.holdoutReleasedAt;
12
+ const tooltip = status === 'stopped' ? STATUS_TOOLTIPS.stopped(arms?.find((group)=>group.key === 'control')?.label) : holdout ? STATUS_TOOLTIPS.decidedWithHoldout : STATUS_TOOLTIPS[status];
12
13
  return {
13
14
  label: statusLabel(status),
14
15
  tone: TONES[status],
15
- tooltip: holdout ? STATUS_TOOLTIPS.decidedWithHoldout : STATUS_TOOLTIPS[status]
16
+ tooltip
16
17
  };
17
18
  }
@@ -39,12 +39,15 @@ function ManagedResults({ id, surface, onTitleChange }) {
39
39
  test.doc.allocation,
40
40
  test.doc.metrics
41
41
  ]) : 'loading';
42
- // ResultsBody's Decide is the shared DecideDialog, which reloads the page; Recompute keeps status.
43
42
  if (test.loadState === 'ready' && test.doc) return /*#__PURE__*/ _jsx(ResultsBody, {
43
+ documentVersion: bodyKey,
44
+ liveDocument: test.doc,
45
+ statusReadPending: test.statusReadPending,
44
46
  id: id,
45
47
  surface: surface,
46
48
  onRecomputed: ()=>setResultsVersion((value)=>value + 1),
47
- onPagesReleased: ()=>{
49
+ onChanged: (transition)=>{
50
+ if (transition) test.acceptTransition?.(transition);
48
51
  void test.reload();
49
52
  },
50
53
  renderPage: (parts)=>/*#__PURE__*/ _jsx(ResultsHeader, {
@@ -52,8 +55,8 @@ function ManagedResults({ id, surface, onTitleChange }) {
52
55
  surface: surface,
53
56
  resultsVersion: resultsVersion,
54
57
  ...parts
55
- }, `${test.doc.id}/${test.doc.status}`)
56
- }, bodyKey);
58
+ }, test.doc.id)
59
+ });
57
60
  return /*#__PURE__*/ _jsx(ReaderResultsShell, {
58
61
  surface: surface,
59
62
  children: /*#__PURE__*/ _jsxs("div", {
@@ -67,14 +70,13 @@ function ManagedResults({ id, surface, onTitleChange }) {
67
70
  onClick: ()=>void test.reload(),
68
71
  children: C.retry
69
72
  }) : null,
70
- test.loadState !== 'loading' && test.loadState !== 'missing' && test.loadState !== 'forbidden' ? /*#__PURE__*/ _jsx(ResultsBody, {
73
+ test.loadState === 'error' ? /*#__PURE__*/ _jsx(ResultsBody, {
71
74
  id: id,
72
- surface: surface,
73
- onRecomputed: ()=>setResultsVersion((value)=>value + 1),
74
- onPagesReleased: ()=>{
75
- void test.reload();
75
+ surface: {
76
+ ...surface,
77
+ canManage: false
76
78
  }
77
- }, bodyKey) : null
79
+ }) : null
78
80
  ]
79
81
  })
80
82
  });
@@ -1,5 +1,5 @@
1
1
  import '../theme.css';
2
- import type { ReactNode } from 'react';
2
+ import { type ReactNode } from 'react';
3
3
  import './surface.css';
4
4
  export interface SurfaceShellProps {
5
5
  adminRoute: string;
@@ -12,5 +12,7 @@ export interface SurfaceShellProps {
12
12
  status?: ReactNode;
13
13
  actions?: ReactNode;
14
14
  subtitle?: ReactNode;
15
+ className?: string;
16
+ dynamicTitle?: boolean;
15
17
  }
16
- export declare function SurfaceShell({ adminRoute, children, crumbs, title, status, actions, subtitle }: SurfaceShellProps): import("react").JSX.Element;
18
+ export declare function SurfaceShell({ adminRoute, children, crumbs, title, status, actions, subtitle, className, dynamicTitle }: SurfaceShellProps): import("react").JSX.Element;
@@ -1,18 +1,41 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import '../theme.css';
4
+ import { useContext, useEffect } from 'react';
4
5
  import { formatAdminURL } from 'payload/shared';
5
6
  import { Breadcrumb } from '../../ui/Breadcrumb.js';
6
7
  import { Button } from '../../ui/Button.js';
7
8
  import { SURFACE_COPY } from '../../testSurface/copy/surface.js';
9
+ import { XpStepNavContext } from './useXpStepNav.js';
8
10
  import './surface.css';
9
11
  export function SurfaceShell({ adminRoute, children, crumbs = [
10
12
  {
11
13
  label: SURFACE_COPY.title
12
14
  }
13
- ], title = SURFACE_COPY.title, status, actions, subtitle }) {
15
+ ], title = SURFACE_COPY.title, status, actions, subtitle, className, dynamicTitle = false }) {
16
+ const stepNav = useContext(XpStepNavContext);
17
+ const route = stepNav?.route;
18
+ const items = stepNav?.items.length && route !== 'home' && route !== 'goals' ? stepNav.items.map(({ label, url })=>({
19
+ label,
20
+ href: url
21
+ })) : crumbs;
22
+ // Custom view metadata is static in Payload 3. Use the name already loaded by the screen.
23
+ useEffect(()=>{
24
+ if (!dynamicTitle && route !== 'goal') return;
25
+ const previous = document.title;
26
+ const next = `${title} · ${SURFACE_COPY.title}`;
27
+ document.title = next;
28
+ return ()=>{
29
+ if (document.title === next) document.title = previous;
30
+ };
31
+ }, [
32
+ title,
33
+ dynamicTitle,
34
+ route
35
+ ]);
14
36
  return /*#__PURE__*/ _jsxs("div", {
15
- className: "xp-tests-surface xp-test-surface",
37
+ className: `xp-tests-surface xp-test-surface${className ? ` ${className}` : ''}`,
38
+ "data-dialog-focus-scope": true,
16
39
  children: [
17
40
  /*#__PURE__*/ _jsxs("header", {
18
41
  className: "xp-tests-shell-header",
@@ -21,7 +44,7 @@ export function SurfaceShell({ adminRoute, children, crumbs = [
21
44
  className: "xp-tests-container xp-tests-shell-top",
22
45
  children: [
23
46
  /*#__PURE__*/ _jsx(Breadcrumb, {
24
- items: crumbs
47
+ items: items
25
48
  }),
26
49
  /*#__PURE__*/ _jsx(Button, {
27
50
  variant: "quiet",
@@ -43,6 +66,8 @@ export function SurfaceShell({ adminRoute, children, crumbs = [
43
66
  className: "xp-tests-shell-title",
44
67
  children: [
45
68
  /*#__PURE__*/ _jsx("h1", {
69
+ tabIndex: -1,
70
+ "data-dialog-focus-fallback": true,
46
71
  children: title
47
72
  }),
48
73
  status
@@ -0,0 +1,13 @@
1
+ import type { ExperimentAction } from '../../testSurface/actions/actions.model.js';
2
+ export declare function TestRowMenu({ name, actions, onSelect }: {
3
+ name: string;
4
+ actions: ExperimentAction[];
5
+ onSelect: (action: ExperimentAction) => void;
6
+ }): import("react").JSX.Element;
7
+ export declare function RowMenu<T extends Pick<ExperimentAction, 'label' | 'tone' | 'unavailable' | 'hint'> & {
8
+ id: string;
9
+ }>({ label, actions, onSelect, }: {
10
+ label: string;
11
+ actions: T[];
12
+ onSelect: (action: T) => void;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,163 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useId, useLayoutEffect, useRef, useState } from 'react';
4
+ import { Button } from '../../ui/Button.js';
5
+ import { actionsForTest } from '../../testSurface/copy/actions.js';
6
+ export function TestRowMenu({ name, actions, onSelect }) {
7
+ return /*#__PURE__*/ _jsx(RowMenu, {
8
+ label: actionsForTest(name),
9
+ actions: actions,
10
+ onSelect: onSelect
11
+ });
12
+ }
13
+ export function RowMenu({ label, actions, onSelect }) {
14
+ const root = useRef(null);
15
+ const menu = useRef(null);
16
+ const triggerId = useId();
17
+ const menuId = useId();
18
+ const [open, setOpen] = useState(false);
19
+ const startAtEnd = useRef(false);
20
+ const menuItems = ()=>[
21
+ ...menu.current?.querySelectorAll('[role="menuitem"]') ?? []
22
+ ];
23
+ function close(restoreFocus) {
24
+ if (restoreFocus) root.current?.querySelector('button')?.focus();
25
+ setOpen(false);
26
+ }
27
+ useLayoutEffect(()=>{
28
+ if (!open) return;
29
+ const items = menuItems();
30
+ (startAtEnd.current ? items.at(-1) : items[0])?.focus();
31
+ }, [
32
+ open
33
+ ]);
34
+ useEffect(()=>{
35
+ if (!open) return;
36
+ const element = root.current;
37
+ if (!element) return;
38
+ const doc = element.ownerDocument;
39
+ const dismiss = (event)=>{
40
+ if (!element.contains(event.target)) setOpen(false);
41
+ };
42
+ doc.addEventListener('pointerdown', dismiss, true);
43
+ return ()=>doc.removeEventListener('pointerdown', dismiss, true);
44
+ }, [
45
+ open
46
+ ]);
47
+ return /*#__PURE__*/ _jsxs("div", {
48
+ className: "xp-tests-row-menu",
49
+ ref: root,
50
+ onBlur: (event)=>{
51
+ if (open && !event.currentTarget.contains(event.relatedTarget)) close(false);
52
+ },
53
+ children: [
54
+ /*#__PURE__*/ _jsx(Button, {
55
+ id: triggerId,
56
+ className: "xp-tests-row-menu-trigger",
57
+ variant: "quiet",
58
+ size: "sm",
59
+ "aria-label": label,
60
+ "aria-haspopup": "menu",
61
+ "aria-expanded": open,
62
+ "aria-controls": open ? menuId : undefined,
63
+ onClick: ()=>{
64
+ if (open) close(true);
65
+ else {
66
+ startAtEnd.current = false;
67
+ setOpen(true);
68
+ }
69
+ },
70
+ onKeyDown: (event)=>{
71
+ if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;
72
+ event.preventDefault();
73
+ startAtEnd.current = event.key === 'ArrowUp';
74
+ if (open) {
75
+ const items = menuItems();
76
+ (startAtEnd.current ? items.at(-1) : items[0])?.focus();
77
+ } else setOpen(true);
78
+ },
79
+ children: /*#__PURE__*/ _jsxs("svg", {
80
+ width: "18",
81
+ height: "18",
82
+ viewBox: "0 0 18 18",
83
+ fill: "currentColor",
84
+ "aria-hidden": "true",
85
+ children: [
86
+ /*#__PURE__*/ _jsx("circle", {
87
+ cx: "4",
88
+ cy: "9",
89
+ r: "1.3"
90
+ }),
91
+ /*#__PURE__*/ _jsx("circle", {
92
+ cx: "9",
93
+ cy: "9",
94
+ r: "1.3"
95
+ }),
96
+ /*#__PURE__*/ _jsx("circle", {
97
+ cx: "14",
98
+ cy: "9",
99
+ r: "1.3"
100
+ })
101
+ ]
102
+ })
103
+ }),
104
+ open ? /*#__PURE__*/ _jsx("div", {
105
+ id: menuId,
106
+ ref: menu,
107
+ role: "menu",
108
+ "aria-labelledby": triggerId,
109
+ className: "xp-tests-row-menu-items",
110
+ onKeyDown: (event)=>{
111
+ const items = menuItems();
112
+ const index = items.findIndex((item)=>item === event.target);
113
+ const key = event.key;
114
+ if (key === 'Tab') {
115
+ close(true);
116
+ return;
117
+ }
118
+ if (key === 'Escape') {
119
+ event.preventDefault();
120
+ close(true);
121
+ return;
122
+ }
123
+ const next = key === 'Home' ? items[0] : key === 'End' ? items.at(-1) : key === 'ArrowDown' ? items[(index + 1) % items.length] : key === 'ArrowUp' ? items[(index - 1 + items.length) % items.length] : key.length === 1 && key !== ' ' && !event.altKey && !event.ctrlKey && !event.metaKey ? [
124
+ ...items.slice(index + 1),
125
+ ...items.slice(0, index + 1)
126
+ ].find((item)=>item.textContent?.trim().toLowerCase().startsWith(key.toLowerCase())) : undefined;
127
+ if (next) {
128
+ event.preventDefault();
129
+ next.focus();
130
+ }
131
+ },
132
+ children: actions.map((action, index)=>{
133
+ const detail = action.unavailable ?? action.hint;
134
+ const detailId = `${menuId}-${index}`;
135
+ return /*#__PURE__*/ _jsxs("button", {
136
+ type: "button",
137
+ role: "menuitem",
138
+ tabIndex: -1,
139
+ "aria-label": action.label,
140
+ "aria-disabled": action.unavailable ? true : undefined,
141
+ className: `xp-tests-menu-item${action.tone === 'secondary' ? '' : ` xp-tests-menu-item--${action.tone}`}`,
142
+ "aria-describedby": detail ? detailId : undefined,
143
+ onClick: ()=>{
144
+ if (action.unavailable) return;
145
+ close(true);
146
+ onSelect(action);
147
+ },
148
+ children: [
149
+ /*#__PURE__*/ _jsx("span", {
150
+ children: action.label
151
+ }),
152
+ detail ? /*#__PURE__*/ _jsx("span", {
153
+ id: detailId,
154
+ className: "xp-ui-help",
155
+ children: detail
156
+ }) : null
157
+ ]
158
+ }, action.id);
159
+ })
160
+ }) : null
161
+ ]
162
+ });
163
+ }
@@ -1,10 +1,11 @@
1
1
  import type { SurfaceShellProps } from './SurfaceShell.js';
2
- import type { ReadinessContext } from '../../testSurface/surface/readiness/readiness.model.js';
3
- export declare function TestsHome({ adminRoute, apiRoute, contentLocale, canManage, crumbs, flagPoints }: {
2
+ import type { SurfaceProps } from '../../testSurface/surface/contracts.js';
3
+ export declare function TestsHome({ adminRoute, apiRoute, contentLocale, canManage, canReadResults, crumbs, flagPoints }: {
4
4
  adminRoute: string;
5
5
  apiRoute: string;
6
6
  contentLocale?: string;
7
7
  canManage?: boolean;
8
+ canReadResults?: boolean;
8
9
  crumbs?: SurfaceShellProps['crumbs'];
9
- flagPoints?: ReadinessContext['flagPoints'];
10
+ flagPoints?: SurfaceProps['flagPoints'];
10
11
  }): import("react").JSX.Element;