@delmaredigital/payload-experiments 0.4.0-rc.2 → 0.4.0-rc.4

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 (305) hide show
  1. package/README.md +283 -775
  2. package/dist/admin/LayerUsage.js +1 -1
  3. package/dist/admin/MetricSourceSelect.js +2 -2
  4. package/dist/admin/PlacementStatus.js +1 -1
  5. package/dist/admin/TestsDashboardCards.js +2 -2
  6. package/dist/admin/TestsNavLink.js +2 -2
  7. package/dist/admin/blocks/BlockPanel.js +3 -3
  8. package/dist/admin/blocks/TestBlockField.js +3 -3
  9. package/dist/admin/blocks/formApi.js +1 -1
  10. package/dist/admin/blocks/model.js +1 -1
  11. package/dist/admin/blocks/statusCache.js +1 -1
  12. package/dist/admin/components/RootViewMessage.js +1 -1
  13. package/dist/admin/copy/blocks.d.ts +2 -2
  14. package/dist/admin/copy/blocks.js +3 -2
  15. package/dist/admin/copy/goals.d.ts +6 -1
  16. package/dist/admin/copy/goals.js +10 -3
  17. package/dist/admin/goals/XpGoalField.js +155 -129
  18. package/dist/admin/goals/xpGoalField.css +2 -3
  19. package/dist/admin/status.model.js +1 -1
  20. package/dist/admin/surface/ResultsRoute.d.ts +2 -1
  21. package/dist/admin/surface/ResultsRoute.js +4 -3
  22. package/dist/admin/surface/SurfaceShell.js +2 -2
  23. package/dist/admin/surface/TestsHome.d.ts +1 -1
  24. package/dist/admin/surface/TestsHome.js +3 -3
  25. package/dist/admin/surface/TestsSurface.js +2 -2
  26. package/dist/admin/surface/goals/GoalForm.d.ts +1 -1
  27. package/dist/admin/surface/goals/GoalForm.js +69 -15
  28. package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
  29. package/dist/admin/surface/goals/GoalsList.js +4 -4
  30. package/dist/admin/surface/goals/data.js +2 -2
  31. package/dist/admin/surface/goals/goals.css +7 -0
  32. package/dist/admin/surface/goals/goals.model.d.ts +11 -1
  33. package/dist/admin/surface/goals/goals.model.js +43 -0
  34. package/dist/admin/surface/home.model.d.ts +1 -1
  35. package/dist/admin/surface/home.model.js +5 -5
  36. package/dist/admin/surface/newTest/NewTest.d.ts +1 -1
  37. package/dist/admin/surface/newTest/NewTest.js +1 -1
  38. package/dist/admin/surface/newTest/PageWizard.d.ts +1 -1
  39. package/dist/admin/surface/newTest/PageWizard.js +13 -13
  40. package/dist/admin/surface/results/ResultsHeader.d.ts +2 -2
  41. package/dist/admin/surface/results/ResultsHeader.js +8 -8
  42. package/dist/admin/surface/test/TestPage.d.ts +1 -2
  43. package/dist/admin/surface/test/TestPage.js +45 -156
  44. package/dist/admin/views/ExperimentsRootView.js +1 -1
  45. package/dist/admin/views/TestsNavLinkServer.js +1 -1
  46. package/dist/admin/views/renderCollectionList.js +1 -1
  47. package/dist/admin/views/renderTestsSurface.js +1 -1
  48. package/dist/blocks/placementLocale.d.ts +21 -0
  49. package/dist/blocks/placementLocale.js +115 -0
  50. package/dist/collections/experiments/config.js +1 -1
  51. package/dist/collections/metrics.js +1 -1
  52. package/dist/db/bulkPlacementRemoval.d.ts +30 -0
  53. package/dist/db/bulkPlacementRemoval.js +107 -0
  54. package/dist/db/placements.d.ts +2 -0
  55. package/dist/db/placements.js +8 -0
  56. package/dist/endpoints/editorSurface.d.ts +3 -0
  57. package/dist/endpoints/editorSurface.js +31 -0
  58. package/dist/endpoints/index.js +28 -1
  59. package/dist/errors.d.ts +1 -0
  60. package/dist/errors.js +2 -0
  61. package/dist/fields/xpGoal.js +1 -1
  62. package/dist/goals/picker/clickGoalPicker.model.d.ts +8 -1
  63. package/dist/goals/picker/clickGoalPicker.model.js +20 -2
  64. package/dist/goals/picker/copy.d.ts +6 -2
  65. package/dist/goals/picker/copy.js +11 -2
  66. package/dist/goals/picker/useClickGoalPicker.d.ts +1 -1
  67. package/dist/goals/picker/useClickGoalPicker.js +4 -2
  68. package/dist/goals/validate.js +3 -2
  69. package/dist/hooks/blockRemovalRule.d.ts +29 -0
  70. package/dist/hooks/blockRemovalRule.js +141 -0
  71. package/dist/hooks/pageGuard.d.ts +24 -2
  72. package/dist/hooks/pageGuard.js +178 -24
  73. package/dist/hooks/puckGoals.d.ts +2 -0
  74. package/dist/hooks/puckGoals.js +34 -10
  75. package/dist/lib/placementPages.d.ts +9 -0
  76. package/dist/{admin/previewLinks.model.js → lib/placementPages.js} +1 -4
  77. package/dist/onInit.js +22 -0
  78. package/dist/plugin.js +2 -1
  79. package/dist/puck/ExperimentPicker.js +25 -10
  80. package/dist/puck/copy.d.ts +4 -1
  81. package/dist/puck/copy.js +4 -1
  82. package/dist/puck/editor/ConfigureTestDrawer.d.ts +21 -0
  83. package/dist/puck/editor/ConfigureTestDrawer.js +147 -0
  84. package/dist/puck/editor/CreateExperimentDrawer.d.ts +11 -2
  85. package/dist/puck/editor/CreateExperimentDrawer.js +69 -9
  86. package/dist/puck/editor/EditorControls.d.ts +14 -0
  87. package/dist/puck/editor/EditorControls.js +99 -0
  88. package/dist/puck/editor/ExperimentSlotEditor.js +317 -51
  89. package/dist/puck/editor/ResultsReadout.js +3 -5
  90. package/dist/puck/editor/VersionBuilder.js +2 -2
  91. package/dist/puck/editor/armsCache.d.ts +3 -1
  92. package/dist/puck/editor/armsCache.js +20 -3
  93. package/dist/puck/editor/copy.d.ts +18 -2
  94. package/dist/puck/editor/copy.js +19 -3
  95. package/dist/puck/editor/editor.chrome.css +33 -0
  96. package/dist/puck/editor/editor.css +39 -0
  97. package/dist/puck/editor/editor.model.d.ts +14 -0
  98. package/dist/puck/editor/editor.model.js +58 -1
  99. package/dist/puck/editor/editorSurface.d.ts +10 -0
  100. package/dist/puck/editor/editorSurface.js +65 -0
  101. package/dist/puck/editor/localPlacements.d.ts +2 -0
  102. package/dist/puck/editor/localPlacements.js +29 -0
  103. package/dist/puck/editor/placementsCache.d.ts +19 -0
  104. package/dist/puck/editor/placementsCache.js +83 -0
  105. package/dist/puck/editor/xpGoalPuckEditorField.js +109 -98
  106. package/dist/puck/experimentSlotField.d.ts +3 -0
  107. package/dist/puck/experimentSlotField.js +15 -4
  108. package/dist/{admin → testSurface}/actions/DecideDialog.d.ts +2 -1
  109. package/dist/{admin → testSurface}/actions/DecideDialog.js +6 -4
  110. package/dist/{admin → testSurface}/api.js +4 -5
  111. package/dist/{admin → testSurface}/copy/common.d.ts +2 -0
  112. package/dist/{admin → testSurface}/copy/common.js +2 -0
  113. package/dist/{admin → testSurface}/copy/readiness.d.ts +3 -0
  114. package/dist/{admin → testSurface}/copy/readiness.js +3 -0
  115. package/dist/{admin → testSurface}/copy/testPage.d.ts +3 -0
  116. package/dist/{admin → testSurface}/copy/testPage.js +7 -2
  117. package/dist/testSurface/format/adminURL.d.ts +7 -0
  118. package/dist/testSurface/format/adminURL.js +9 -0
  119. package/dist/{admin → testSurface}/placements/placementLabels.js +1 -1
  120. package/dist/{admin → testSurface}/previewLinks.model.d.ts +1 -6
  121. package/dist/testSurface/previewLinks.model.js +4 -0
  122. package/dist/testSurface/results/results.css +64 -0
  123. package/dist/{admin → testSurface}/surface/contracts.d.ts +1 -0
  124. package/dist/{admin → testSurface}/surface/pageBlock/parts.js +6 -6
  125. package/dist/testSurface/surface/pagePicker/pagePicker.css +10 -0
  126. package/dist/{admin → testSurface}/surface/readiness/useTransition.js +1 -0
  127. package/dist/{admin → testSurface}/surface/results/ResultsBody.d.ts +2 -2
  128. package/dist/{admin → testSurface}/surface/results/ResultsBody.js +18 -11
  129. package/dist/testSurface/surface/setting/setting.css +17 -0
  130. package/dist/testSurface/surface/test/GoalSection.d.ts +4 -0
  131. package/dist/{admin → testSurface}/surface/test/GoalSection.js +3 -2
  132. package/dist/{admin → testSurface}/surface/test/Section.js +9 -8
  133. package/dist/testSurface/surface/test/TestSurface.d.ts +18 -0
  134. package/dist/testSurface/surface/test/TestSurface.js +152 -0
  135. package/dist/testSurface/surface/test/VersionsSection.d.ts +5 -0
  136. package/dist/{admin → testSurface}/surface/test/VersionsSection.js +12 -6
  137. package/dist/testSurface/surface/test/testPage.css +92 -0
  138. package/dist/{admin → testSurface}/surface/useTestDocument.d.ts +5 -1
  139. package/dist/{admin → testSurface}/surface/useTestDocument.js +34 -3
  140. package/dist/{admin → testSurface}/surfaceUrls.js +1 -1
  141. package/dist/transitions/placementInteractions.js +1 -1
  142. package/dist/transitions/placements.d.ts +27 -8
  143. package/dist/transitions/placements.js +77 -6
  144. package/dist/transitions/start.js +2 -2
  145. package/dist/types/endpoints.d.ts +1 -1
  146. package/dist/ui/Dialog.d.ts +4 -1
  147. package/dist/ui/Dialog.js +41 -3
  148. package/dist/ui/Drawer.d.ts +10 -0
  149. package/dist/ui/Drawer.js +29 -0
  150. package/dist/ui/Tabs.d.ts +3 -3
  151. package/dist/ui/Tabs.js +35 -33
  152. package/dist/ui/ui.css +6 -0
  153. package/package.json +1 -1
  154. package/dist/admin/actions/ConfirmDialog.d.ts +0 -19
  155. package/dist/admin/actions/ConfirmDialog.js +0 -149
  156. package/dist/admin/results/results.css +0 -64
  157. package/dist/admin/styles.css +0 -10
  158. package/dist/admin/styles.d.ts +0 -2
  159. package/dist/admin/styles.js +0 -3
  160. package/dist/admin/surface/pagePicker/pagePicker.css +0 -10
  161. package/dist/admin/surface/setting/setting.css +0 -17
  162. package/dist/admin/surface/test/GoalSection.d.ts +0 -2
  163. package/dist/admin/surface/test/VersionsSection.d.ts +0 -4
  164. package/dist/admin/surface/test/testPage.css +0 -92
  165. /package/dist/{admin → testSurface}/PreviewLinks.d.ts +0 -0
  166. /package/dist/{admin → testSurface}/PreviewLinks.js +0 -0
  167. /package/dist/{admin → testSurface}/actions/MakeContentResult.d.ts +0 -0
  168. /package/dist/{admin → testSurface}/actions/MakeContentResult.js +0 -0
  169. /package/dist/{admin → testSurface}/actions/actions.model.d.ts +0 -0
  170. /package/dist/{admin → testSurface}/actions/actions.model.js +0 -0
  171. /package/dist/{admin → testSurface}/actions/decide.model.d.ts +0 -0
  172. /package/dist/{admin → testSurface}/actions/decide.model.js +0 -0
  173. /package/dist/{admin → testSurface}/allocation.model.d.ts +0 -0
  174. /package/dist/{admin → testSurface}/allocation.model.js +0 -0
  175. /package/dist/{admin → testSurface}/api.d.ts +0 -0
  176. /package/dist/{admin → testSurface}/arms/arms.model.d.ts +0 -0
  177. /package/dist/{admin → testSurface}/arms/arms.model.js +0 -0
  178. /package/dist/{admin → testSurface}/arms/pageTarget.model.d.ts +0 -0
  179. /package/dist/{admin → testSurface}/arms/pageTarget.model.js +0 -0
  180. /package/dist/{admin → testSurface}/arms/params.model.d.ts +0 -0
  181. /package/dist/{admin → testSurface}/arms/params.model.js +0 -0
  182. /package/dist/{admin → testSurface}/copy/actions.d.ts +0 -0
  183. /package/dist/{admin → testSurface}/copy/actions.js +0 -0
  184. /package/dist/{admin → testSurface}/copy/advanced.d.ts +0 -0
  185. /package/dist/{admin → testSurface}/copy/advanced.js +0 -0
  186. /package/dist/{admin → testSurface}/copy/arms.d.ts +0 -0
  187. /package/dist/{admin → testSurface}/copy/arms.js +0 -0
  188. /package/dist/{admin → testSurface}/copy/audience.d.ts +0 -0
  189. /package/dist/{admin → testSurface}/copy/audience.js +0 -0
  190. /package/dist/{admin → testSurface}/copy/metrics.d.ts +0 -0
  191. /package/dist/{admin → testSurface}/copy/metrics.js +0 -0
  192. /package/dist/{admin → testSurface}/copy/pages.d.ts +0 -0
  193. /package/dist/{admin → testSurface}/copy/pages.js +0 -0
  194. /package/dist/{admin → testSurface}/copy/recommendation.d.ts +0 -0
  195. /package/dist/{admin → testSurface}/copy/recommendation.js +0 -0
  196. /package/dist/{admin → testSurface}/copy/results.d.ts +0 -0
  197. /package/dist/{admin → testSurface}/copy/results.js +0 -0
  198. /package/dist/{admin → testSurface}/copy/review.d.ts +0 -0
  199. /package/dist/{admin → testSurface}/copy/review.js +0 -0
  200. /package/dist/{admin → testSurface}/copy/setting.d.ts +0 -0
  201. /package/dist/{admin → testSurface}/copy/setting.js +0 -0
  202. /package/dist/{admin → testSurface}/copy/surface.d.ts +0 -0
  203. /package/dist/{admin → testSurface}/copy/surface.js +0 -0
  204. /package/dist/{admin → testSurface}/format/date.d.ts +0 -0
  205. /package/dist/{admin → testSurface}/format/date.js +0 -0
  206. /package/dist/{admin → testSurface}/labels.d.ts +0 -0
  207. /package/dist/{admin → testSurface}/labels.js +0 -0
  208. /package/dist/{admin → testSurface}/lockedNotice.model.d.ts +0 -0
  209. /package/dist/{admin → testSurface}/lockedNotice.model.js +0 -0
  210. /package/dist/{admin → testSurface}/metricSource.model.d.ts +0 -0
  211. /package/dist/{admin → testSurface}/metricSource.model.js +0 -0
  212. /package/dist/{admin → testSurface}/placements/placementLabels.d.ts +0 -0
  213. /package/dist/{admin → testSurface}/placements/placementLabels.model.d.ts +0 -0
  214. /package/dist/{admin → testSurface}/placements/placementLabels.model.js +0 -0
  215. /package/dist/{admin → testSurface}/placements/usePlacementLabels.d.ts +0 -0
  216. /package/dist/{admin → testSurface}/placements/usePlacementLabels.js +0 -0
  217. /package/dist/{admin → testSurface}/reload.d.ts +0 -0
  218. /package/dist/{admin → testSurface}/reload.js +0 -0
  219. /package/dist/{admin → testSurface}/results/CappedCell.d.ts +0 -0
  220. /package/dist/{admin → testSurface}/results/CappedCell.js +0 -0
  221. /package/dist/{admin → testSurface}/results/CiChart.d.ts +0 -0
  222. /package/dist/{admin → testSurface}/results/CiChart.js +0 -0
  223. /package/dist/{admin → testSurface}/results/DataQualityPanel.d.ts +0 -0
  224. /package/dist/{admin → testSurface}/results/DataQualityPanel.js +0 -0
  225. /package/dist/{admin → testSurface}/results/DataTable.d.ts +0 -0
  226. /package/dist/{admin → testSurface}/results/DataTable.js +0 -0
  227. /package/dist/{admin → testSurface}/results/StatTile.d.ts +0 -0
  228. /package/dist/{admin → testSurface}/results/StatTile.js +0 -0
  229. /package/dist/{admin → testSurface}/results/VerdictHero.d.ts +0 -0
  230. /package/dist/{admin → testSurface}/results/VerdictHero.js +0 -0
  231. /package/dist/{admin → testSurface}/results/chart.model.d.ts +0 -0
  232. /package/dist/{admin → testSurface}/results/chart.model.js +0 -0
  233. /package/dist/{admin → testSurface}/results/format.d.ts +0 -0
  234. /package/dist/{admin → testSurface}/results/format.js +0 -0
  235. /package/dist/{admin → testSurface}/results/legacy.d.ts +0 -0
  236. /package/dist/{admin → testSurface}/results/legacy.js +0 -0
  237. /package/dist/{admin → testSurface}/results/releasePages.model.d.ts +0 -0
  238. /package/dist/{admin → testSurface}/results/releasePages.model.js +0 -0
  239. /package/dist/{admin → testSurface}/results/results.model.d.ts +0 -0
  240. /package/dist/{admin → testSurface}/results/results.model.js +0 -0
  241. /package/dist/{admin → testSurface}/results/snapshot.d.ts +0 -0
  242. /package/dist/{admin → testSurface}/results/snapshot.js +0 -0
  243. /package/dist/{admin → testSurface}/review/review.model.d.ts +0 -0
  244. /package/dist/{admin → testSurface}/review/review.model.js +0 -0
  245. /package/dist/{admin → testSurface}/surface/contracts.js +0 -0
  246. /package/dist/{admin → testSurface}/surface/pageBlock/pageBlock.model.d.ts +0 -0
  247. /package/dist/{admin → testSurface}/surface/pageBlock/pageBlock.model.js +0 -0
  248. /package/dist/{admin → testSurface}/surface/pageBlock/parts.d.ts +0 -0
  249. /package/dist/{admin → testSurface}/surface/pagePicker/CopyRoute.d.ts +0 -0
  250. /package/dist/{admin → testSurface}/surface/pagePicker/CopyRoute.js +0 -0
  251. /package/dist/{admin → testSurface}/surface/pagePicker/PageCombobox.d.ts +0 -0
  252. /package/dist/{admin → testSurface}/surface/pagePicker/PageCombobox.js +0 -0
  253. /package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.d.ts +0 -0
  254. /package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.js +0 -0
  255. /package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.d.ts +0 -0
  256. /package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.js +0 -0
  257. /package/dist/{admin → testSurface}/surface/readiness/Banner.d.ts +0 -0
  258. /package/dist/{admin → testSurface}/surface/readiness/Banner.js +0 -0
  259. /package/dist/{admin → testSurface}/surface/readiness/SaveStatus.d.ts +0 -0
  260. /package/dist/{admin → testSurface}/surface/readiness/SaveStatus.js +0 -0
  261. /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
  262. /package/dist/{admin → testSurface}/surface/readiness/parts.js +0 -0
  263. /package/dist/{admin → testSurface}/surface/readiness/readiness.model.d.ts +0 -0
  264. /package/dist/{admin → testSurface}/surface/readiness/readiness.model.js +0 -0
  265. /package/dist/{admin → testSurface}/surface/readiness/useTransition.d.ts +0 -0
  266. /package/dist/{admin → testSurface}/surface/results/ReleasePages.d.ts +0 -0
  267. /package/dist/{admin → testSurface}/surface/results/ReleasePages.js +0 -0
  268. /package/dist/{admin → testSurface}/surface/results/recommendation.model.d.ts +0 -0
  269. /package/dist/{admin → testSurface}/surface/results/recommendation.model.js +0 -0
  270. /package/dist/{admin → testSurface}/surface/results/useResults.d.ts +0 -0
  271. /package/dist/{admin → testSurface}/surface/results/useResults.js +0 -0
  272. /package/dist/{admin → testSurface}/surface/setting/parts.d.ts +0 -0
  273. /package/dist/{admin → testSurface}/surface/setting/parts.js +0 -0
  274. /package/dist/{admin → testSurface}/surface/setting/setting.model.d.ts +0 -0
  275. /package/dist/{admin → testSurface}/surface/setting/setting.model.js +0 -0
  276. /package/dist/{admin → testSurface}/surface/test/AdvancedSection.d.ts +0 -0
  277. /package/dist/{admin → testSurface}/surface/test/AdvancedSection.js +0 -0
  278. /package/dist/{admin → testSurface}/surface/test/LengthSection.d.ts +0 -0
  279. /package/dist/{admin → testSurface}/surface/test/LengthSection.js +0 -0
  280. /package/dist/{admin → testSurface}/surface/test/PageHoldout.d.ts +0 -0
  281. /package/dist/{admin → testSurface}/surface/test/PageHoldout.js +0 -0
  282. /package/dist/{admin → testSurface}/surface/test/Rail.d.ts +0 -0
  283. /package/dist/{admin → testSurface}/surface/test/Rail.js +0 -0
  284. /package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +0 -0
  285. /package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +0 -0
  286. /package/dist/{admin → testSurface}/surface/test/Section.d.ts +0 -0
  287. /package/dist/{admin → testSurface}/surface/test/TargetingSection.d.ts +0 -0
  288. /package/dist/{admin → testSurface}/surface/test/TargetingSection.js +0 -0
  289. /package/dist/{admin → testSurface}/surface/test/fields.d.ts +0 -0
  290. /package/dist/{admin → testSurface}/surface/test/fields.js +0 -0
  291. /package/dist/{admin → testSurface}/surface/test/jumpToSection.d.ts +0 -0
  292. /package/dist/{admin → testSurface}/surface/test/jumpToSection.js +0 -0
  293. /package/dist/{admin → testSurface}/surface/test/pageParts.d.ts +0 -0
  294. /package/dist/{admin → testSurface}/surface/test/pageParts.js +0 -0
  295. /package/dist/{admin → testSurface}/surface/test/testPage.model.d.ts +0 -0
  296. /package/dist/{admin → testSurface}/surface/test/testPage.model.js +0 -0
  297. /package/dist/{admin → testSurface}/surface/testDocument.model.d.ts +0 -0
  298. /package/dist/{admin → testSurface}/surface/testDocument.model.js +0 -0
  299. /package/dist/{admin → testSurface}/surfaceUrls.d.ts +0 -0
  300. /package/dist/{admin → testSurface}/targeting/targeting.model.d.ts +0 -0
  301. /package/dist/{admin → testSurface}/targeting/targeting.model.js +0 -0
  302. /package/dist/{admin → testSurface}/theme.d.ts +0 -0
  303. /package/dist/{admin → testSurface}/theme.js +0 -0
  304. /package/dist/{admin → testSurface}/useApi.d.ts +0 -0
  305. /package/dist/{admin → testSurface}/useApi.js +0 -0
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { FieldDescription, FieldLabel, useDocumentInfo } from '@payloadcms/ui';
4
4
  import { useLayerExperiments } from './useLayerUsage.js';
5
- import { statusLabel } from './labels.js';
5
+ import { statusLabel } from '../testSurface/labels.js';
6
6
  import { HISTORY_COPY, layerRow, layerSummary } from './copy/history.js';
7
7
  export function LayerUsage({ field, path }) {
8
8
  const { id } = useDocumentInfo();
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { SelectInput, useField } from '@payloadcms/ui';
4
- import { metricSourceHint, metricSourceOptions, sourceFor } from './metricSource.model.js';
5
- import { METRICS_COPY } from './copy/metrics.js';
4
+ import { metricSourceHint, metricSourceOptions, sourceFor } from '../testSurface/metricSource.model.js';
5
+ import { METRICS_COPY } from '../testSurface/copy/metrics.js';
6
6
  export function MetricSourceSelect({ path, field, readOnly }) {
7
7
  const { value, setValue } = useField({
8
8
  path
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  import { useConfig, useDocumentInfo } from '@payloadcms/ui';
4
4
  import { useEffect, useMemo, useState } from 'react';
5
5
  import { formatAdminURL } from 'payload/shared';
6
- import { createApi } from './api.js';
6
+ import { createApi } from '../testSurface/api.js';
7
7
  import { pageStatusCopy } from './placementStatus.model.js';
8
8
  /** Manage-only endpoint: access-filtered editors see no status or error text. */ export function PlacementStatus(_props) {
9
9
  const { id, collectionSlug } = useDocumentInfo();
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { surfaceUrls } from './surfaceUrls.js';
3
+ import { surfaceUrls } from '../testSurface/surfaceUrls.js';
4
4
  import './theme.css';
5
5
  import './dashboard.css';
6
6
  import { Card, useAuth, useConfig } from '@payloadcms/ui';
7
- import { SURFACE_COPY } from './copy/surface.js';
7
+ import { SURFACE_COPY } from '../testSurface/copy/surface.js';
8
8
  /** @deprecated Retained for existing import maps until 0.5.0. */ export function TestsDashboardCards() {
9
9
  const { config } = useConfig();
10
10
  const { permissions } = useAuth();
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { surfaceUrls } from './surfaceUrls.js';
3
+ import { surfaceUrls } from '../testSurface/surfaceUrls.js';
4
4
  import './theme.css';
5
5
  import { Link, NavGroup, useAuth, useConfig } from '@payloadcms/ui';
6
6
  import { usePathname } from 'next/navigation.js';
7
- import { SURFACE_COPY } from './copy/surface.js';
7
+ import { SURFACE_COPY } from '../testSurface/copy/surface.js';
8
8
  /** @deprecated Retained for existing import maps until 0.5.0. */ function TestsNav({ isOpen = true }) {
9
9
  const { config } = useConfig();
10
10
  const { permissions } = useAuth();
@@ -4,10 +4,10 @@ import { Banner, Button, ConfirmationModal, toast, useModal, useFormInitializing
4
4
  import { formatAdminURL } from 'payload/shared';
5
5
  import { useEffect, useId, useRef, useState } from 'react';
6
6
  import { copyOriginalIntoVersion, syncExperimentSlots, unwrapExperimentBlock } from '../../blocks/formState.js';
7
- import { BLOCK_COPY, blockSyncNotice, blockUnwrapNotice, blockDeleteConfirmation, blockUnwrapConfirmation, blockRunningUnwrap, blockDecidedUnwrap, blockFinishedCopy } from '../copy/blocks.js';
8
- import { API_MESSAGES } from '../copy/common.js';
7
+ import { BLOCK_COPY, blockSyncNotice, blockUnwrapNotice, blockDeleteConfirmation, blockUnwrapConfirmation, blockRunningUnwrap, blockDecidedUnwrap, blockFinishedCopy } from '../../admin/copy/blocks.js';
8
+ import { API_MESSAGES } from '../../testSurface/copy/common.js';
9
9
  import { isOrphan, liveStatus, slotLabel, statusSentence } from './model.js';
10
- import { createApi } from '../api.js';
10
+ import { createApi } from '../../testSurface/api.js';
11
11
  import { useBlockStatus, setBlockStatus } from './statusCache.js';
12
12
  import { useBlockForm } from './useBlockForm.js';
13
13
  import { BlockChangedError, RefusalError } from './formApi.js';
@@ -6,9 +6,9 @@ import { useMemo, useRef, useState } from 'react';
6
6
  import { hostBlocks } from '../../blocks/model.js';
7
7
  import { wrapExperimentBlock } from '../../blocks/formState.js';
8
8
  import { CreateRefused, createTest } from '../../puck/editor/createTest.js';
9
- import { createApi } from '../api.js';
10
- import { BLOCK_COPY, blockSaveNotice, blockTestName } from '../copy/blocks.js';
11
- import { API_MESSAGES } from '../copy/common.js';
9
+ import { createApi } from '../../testSurface/api.js';
10
+ import { BLOCK_COPY, blockSaveNotice, blockTestName } from '../../admin/copy/blocks.js';
11
+ import { API_MESSAGES } from '../../testSurface/copy/common.js';
12
12
  import { adaptClientBlocksField, BlockChangedError, dataAt, experimentBlockSlug, findClientBlocksField, replaceBlockRow, wrapMode } from './formApi.js';
13
13
  import { blockChoices, labelText } from './model.js';
14
14
  export function TestBlockField(props) {
@@ -1,5 +1,5 @@
1
1
  import { EXPERIMENT_BLOCK_SLUG, hostBlocks } from '../../blocks/model.js';
2
- import { BLOCK_COPY } from '../copy/blocks.js';
2
+ import { BLOCK_COPY } from '../../admin/copy/blocks.js';
3
3
  /** The only form-state failure with block-specific editor copy. */ export class BlockChangedError extends Error {
4
4
  constructor(){
5
5
  super(BLOCK_COPY.blockChanged);
@@ -1,5 +1,5 @@
1
1
  import { hostBlocks } from '../../blocks/model.js';
2
- import { BLOCK_COPY, blockDecidedStatus, blockDraftStatus, blockFinishedStatus, blockPosition } from '../copy/blocks.js';
2
+ import { BLOCK_COPY, blockDecidedStatus, blockDraftStatus, blockFinishedStatus, blockPosition } from '../../admin/copy/blocks.js';
3
3
  export function liveStatus(status) {
4
4
  return !!status && 'status' in status;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useEffect, useRef, useSyncExternalStore } from 'react';
2
- import { createApi } from '../api.js';
2
+ import { createApi } from '../../testSurface/api.js';
3
3
  const cache = new Map();
4
4
  // Subscribers do not create status entries: a label alone owns no cached data.
5
5
  const listeners = new Map();
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import '../theme.css';
4
- import { theme } from '../theme.js';
4
+ import { theme } from '../../testSurface/theme.js';
5
5
  export function RootViewMessage({ children, alert = false }) {
6
6
  return /*#__PURE__*/ _jsx("div", {
7
7
  role: alert ? 'alert' : undefined,
@@ -13,8 +13,8 @@ export declare const BLOCK_COPY: {
13
13
  unwrap: string;
14
14
  removeAndUnwrap: string;
15
15
  deleteAndUnwrap: string;
16
- alreadyDeleted: string;
17
- noLongerDraft: string;
16
+ alreadyDeleted: "This test was already deleted. Reload the page.";
17
+ noLongerDraft: "This test is no longer a draft. Reload the page.";
18
18
  finishUnwrap: string;
19
19
  deleted: string;
20
20
  discarded: string;
@@ -1,3 +1,4 @@
1
+ import { API_MESSAGES } from '../../testSurface/copy/common.js';
1
2
  export const BLOCK_COPY = {
2
3
  testBlock: 'Test a block on this page',
3
4
  pick: 'Choose a block',
@@ -13,8 +14,8 @@ export const BLOCK_COPY = {
13
14
  unwrap: 'Unwrap',
14
15
  removeAndUnwrap: 'Remove the test and unwrap',
15
16
  deleteAndUnwrap: 'Delete and unwrap',
16
- alreadyDeleted: 'This test was already deleted. Reload the page.',
17
- noLongerDraft: 'This test is no longer a draft. Reload the page.',
17
+ alreadyDeleted: API_MESSAGES.testAlreadyDeleted,
18
+ noLongerDraft: API_MESSAGES.testNoLongerDraft,
18
19
  finishUnwrap: 'The test was removed; use Unwrap to finish.',
19
20
  deleted: "This block's test was deleted; the page shows the Original.",
20
21
  discarded: 'This test has ended; the page shows the Original.',
@@ -1,6 +1,7 @@
1
1
  export declare const GOALS_COPY: {
2
2
  readonly slugRule: "Use 1–64 lowercase letters, numbers, underscores or hyphens, starting with a letter or number.";
3
3
  readonly duplicateSlug: "Another goal already uses this short name. Change it under Advanced.";
4
+ readonly duplicateSlugMain: "Another goal already uses this short name. Choose another.";
4
5
  readonly title: "Goals";
5
6
  readonly goal: "Goal";
6
7
  readonly newGoal: "New goal";
@@ -12,6 +13,7 @@ export declare const GOALS_COPY: {
12
13
  readonly decrease: "Less is better";
13
14
  readonly usedBy: "Used by";
14
15
  readonly status: "Status";
16
+ readonly showLess: "Show less";
15
17
  readonly inUse: "In use";
16
18
  readonly unused: "Not used yet";
17
19
  readonly empty: "No goals yet. A goal is what a test tries to improve.";
@@ -54,8 +56,11 @@ export declare const GOALS_COPY: {
54
56
  readonly deleteTitle: "Delete this goal?";
55
57
  readonly deleteBody: "This cannot be undone.";
56
58
  readonly confirmDelete: "Delete";
59
+ readonly thoseTests: "those tests";
60
+ readonly deleteLockedEnd: " first.";
57
61
  };
58
62
  export declare function goalUsedBy(count: number): string;
59
63
  export declare function goalInUse(count: number): string;
60
- export declare function goalDeleteLocked(count: number): string;
64
+ export declare function goalDeleteLockedStart(count: number): string;
61
65
  export declare function goalsNoMatches(search: string): string;
66
+ export declare function goalShowAll(count: number): string;
@@ -2,6 +2,7 @@ import { CLICK_GOAL_COPY } from '../../goals/picker/copy.js';
2
2
  export const GOALS_COPY = {
3
3
  slugRule: CLICK_GOAL_COPY.slugRule,
4
4
  duplicateSlug: CLICK_GOAL_COPY.duplicateSlug,
5
+ duplicateSlugMain: 'Another goal already uses this short name. Choose another.',
5
6
  title: 'Goals',
6
7
  goal: 'Goal',
7
8
  newGoal: 'New goal',
@@ -13,6 +14,7 @@ export const GOALS_COPY = {
13
14
  decrease: 'Less is better',
14
15
  usedBy: 'Used by',
15
16
  status: 'Status',
17
+ showLess: 'Show less',
16
18
  inUse: 'In use',
17
19
  unused: 'Not used yet',
18
20
  empty: 'No goals yet. A goal is what a test tries to improve.',
@@ -54,7 +56,9 @@ export const GOALS_COPY = {
54
56
  fields: 'Goal details',
55
57
  deleteTitle: 'Delete this goal?',
56
58
  deleteBody: 'This cannot be undone.',
57
- confirmDelete: 'Delete'
59
+ confirmDelete: 'Delete',
60
+ thoseTests: 'those tests',
61
+ deleteLockedEnd: ' first.'
58
62
  };
59
63
  export function goalUsedBy(count) {
60
64
  return `Used by ${count} ${count === 1 ? 'test' : 'tests'}`;
@@ -62,9 +66,12 @@ export function goalUsedBy(count) {
62
66
  export function goalInUse(count) {
63
67
  return `In use by ${count} ${count === 1 ? 'test' : 'tests'}`;
64
68
  }
65
- export function goalDeleteLocked(count) {
66
- return `${goalUsedBy(count)}. Remove it from those tests first.`;
69
+ export function goalDeleteLockedStart(count) {
70
+ return `${goalUsedBy(count)}. Remove it from `;
67
71
  }
68
72
  export function goalsNoMatches(search) {
69
73
  return `No goals match “${search}”.`;
70
74
  }
75
+ export function goalShowAll(count) {
76
+ return `Show all ${count}`;
77
+ }
@@ -1,11 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Button, FieldError, FieldLabel, SelectInput, TextInput, useAuth, useConfig, useField } from '@payloadcms/ui';
3
+ import { Button, FieldDescription, FieldError, FieldLabel, SelectInput, useAuth, useConfig, useField } from '@payloadcms/ui';
4
4
  import { useId } from 'react';
5
5
  import { useClickGoalPicker } from '../../goals/picker/useClickGoalPicker.js';
6
+ import { clickGoalOptions } from '../../goals/picker/clickGoalPicker.model.js';
6
7
  import { CLICK_GOAL_COPY as C } from '../../goals/picker/copy.js';
7
8
  import '../theme.css';
8
9
  import './xpGoalField.css';
10
+ // Payload 3's declaration requires `name`, though SelectInput only consumes `path`.
11
+ const GoalSelectInput = SelectInput;
9
12
  export function XpGoalField({ path, field, readOnly }) {
10
13
  const { value, setValue, showError } = useField({
11
14
  path
@@ -15,9 +18,11 @@ export function XpGoalField({ path, field, readOnly }) {
15
18
  const access = permissions?.collections?.['xp-experiments'];
16
19
  const locked = Boolean(readOnly || field.admin?.readOnly);
17
20
  const picker = useClickGoalPicker(config.routes.api, {
18
- enabled: access?.update === true,
21
+ enabled: access?.update === true && !locked,
19
22
  onSelect: setValue
20
23
  });
24
+ const { options, missing } = clickGoalOptions(picker.status, picker.goals, value ?? '');
25
+ const readonly = locked || picker.status === 'not-manager';
21
26
  const id = useId(), namePath = `${id}-name`, slugPath = `${id}-slug`;
22
27
  const stopEnter = (event)=>{
23
28
  if (event.key === 'Enter') {
@@ -28,140 +33,161 @@ export function XpGoalField({ path, field, readOnly }) {
28
33
  return /*#__PURE__*/ _jsxs("div", {
29
34
  className: "field-type xp-goal-field",
30
35
  children: [
31
- /*#__PURE__*/ _jsx(TextInput, {
32
- path: path,
33
- label: field.label ?? C.label,
34
- description: field.admin?.description,
35
- required: field.required,
36
- readOnly: locked,
37
- value: value ?? '',
38
- showError: showError,
39
- Error: /*#__PURE__*/ _jsx(FieldError, {
40
- path: path,
41
- showError: showError
42
- }),
43
- onChange: (event)=>{
44
- if (!locked) setValue(event.currentTarget.value);
45
- }
46
- }),
47
- picker.canManage && !locked ? /*#__PURE__*/ _jsxs(_Fragment, {
36
+ readonly ? /*#__PURE__*/ _jsxs("div", {
48
37
  children: [
49
- /*#__PURE__*/ _jsxs("div", {
50
- className: "xp-goal-field__row",
38
+ /*#__PURE__*/ _jsxs("span", {
39
+ className: "field-label",
40
+ id: `${id}-label`,
51
41
  children: [
52
- /*#__PURE__*/ _jsx(SelectInput, {
53
- name: `${path}__xpGoalPicker`,
54
- path: `${path}__xpGoalPicker`,
55
- className: "xp-goal-field__select",
56
- value: picker.goals.some((goal)=>goal.slug === value) ? value : undefined,
57
- options: picker.goals.map((goal)=>({
58
- value: goal.slug,
59
- label: goal.name
60
- })),
61
- placeholder: C.choose,
62
- isClearable: false,
63
- label: C.choose,
64
- onChange: (option)=>{
65
- if (option && !Array.isArray(option)) setValue(String(option.value));
66
- }
67
- }),
68
- !picker.panel.open ? /*#__PURE__*/ _jsx(Button, {
69
- type: "button",
70
- margin: false,
71
- buttonStyle: "secondary",
72
- onClick: picker.open,
73
- children: C.newGoal
42
+ C.label,
43
+ field.required ? /*#__PURE__*/ _jsx("span", {
44
+ className: "required",
45
+ children: "*"
74
46
  }) : null
75
47
  ]
76
48
  }),
77
- picker.undefinedKey(value ?? '') ? /*#__PURE__*/ _jsx("p", {
78
- role: "status",
79
- children: C.undefinedKey
80
- }) : null,
81
- picker.panel.open ? /*#__PURE__*/ _jsxs("section", {
82
- className: "xp-goal-field__panel",
83
- "aria-labelledby": `${id}-title`,
84
- children: [
85
- /*#__PURE__*/ _jsx("h3", {
86
- id: `${id}-title`,
87
- children: C.title
88
- }),
89
- /*#__PURE__*/ _jsxs("div", {
90
- className: "field-type text",
91
- children: [
92
- /*#__PURE__*/ _jsx(FieldLabel, {
93
- path: namePath,
94
- label: C.name
95
- }),
96
- /*#__PURE__*/ _jsx("input", {
97
- id: `field-${namePath}`,
98
- value: picker.panel.name,
99
- disabled: picker.panel.pending,
100
- onKeyDown: stopEnter,
101
- onChange: (event)=>picker.setName(event.currentTarget.value)
102
- })
103
- ]
104
- }),
105
- /*#__PURE__*/ _jsxs("details", {
106
- open: picker.panel.advanced,
107
- onToggle: (event)=>picker.setAdvanced(event.currentTarget.open),
108
- children: [
109
- /*#__PURE__*/ _jsx("summary", {
110
- children: C.advanced
111
- }),
112
- /*#__PURE__*/ _jsxs("div", {
113
- className: "field-type text",
114
- children: [
115
- /*#__PURE__*/ _jsx(FieldLabel, {
116
- path: slugPath,
117
- label: C.slug
118
- }),
119
- /*#__PURE__*/ _jsx("input", {
120
- id: `field-${slugPath}`,
121
- value: picker.panel.slug,
122
- disabled: picker.panel.pending,
123
- onKeyDown: stopEnter,
124
- "aria-invalid": Boolean(picker.panel.errors.slug) || undefined,
125
- "aria-describedby": picker.panel.errors.slug ? `${id}-slug-error` : undefined,
126
- onChange: (event)=>picker.setSlug(event.currentTarget.value)
127
- }),
128
- picker.panel.errors.slug ? /*#__PURE__*/ _jsx("p", {
129
- id: `${id}-slug-error`,
130
- role: "alert",
131
- children: picker.panel.errors.slug
132
- }) : null
133
- ]
134
- })
135
- ]
136
- }),
137
- picker.panel.errors.general ? /*#__PURE__*/ _jsx("p", {
138
- role: "alert",
139
- children: picker.panel.errors.general
140
- }) : null,
141
- /*#__PURE__*/ _jsxs("div", {
142
- className: "xp-goal-field__actions",
143
- children: [
144
- /*#__PURE__*/ _jsx(Button, {
145
- type: "button",
146
- margin: false,
147
- buttonStyle: "primary",
148
- disabled: picker.panel.pending || !picker.panel.name.trim(),
149
- onClick: ()=>void picker.create(),
150
- children: C.createGoal
151
- }),
152
- /*#__PURE__*/ _jsx(Button, {
153
- type: "button",
154
- margin: false,
155
- buttonStyle: "secondary",
156
- disabled: picker.panel.pending,
157
- onClick: picker.cancel,
158
- children: C.cancel
159
- })
160
- ]
161
- })
162
- ]
49
+ /*#__PURE__*/ _jsx("p", {
50
+ "aria-labelledby": `${id}-label`,
51
+ children: value || C.none
52
+ })
53
+ ]
54
+ }) : /*#__PURE__*/ _jsxs("div", {
55
+ className: "xp-goal-field__row",
56
+ children: [
57
+ /*#__PURE__*/ _jsx(GoalSelectInput, {
58
+ path: path,
59
+ className: "xp-goal-field__select",
60
+ value: value ?? '',
61
+ options: options,
62
+ label: C.label,
63
+ required: field.required,
64
+ readOnly: picker.status !== 'ready',
65
+ isClearable: false,
66
+ placeholder: C.none,
67
+ showError: showError,
68
+ onChange: (option)=>{
69
+ if (picker.status === 'ready' && option && !Array.isArray(option)) setValue(String(option.value));
70
+ }
71
+ }),
72
+ picker.canManage && !picker.panel.open ? /*#__PURE__*/ _jsx(Button, {
73
+ type: "button",
74
+ margin: false,
75
+ buttonStyle: "secondary",
76
+ onClick: picker.open,
77
+ children: C.newGoal
163
78
  }) : null
164
79
  ]
80
+ }),
81
+ readonly ? /*#__PURE__*/ _jsx(FieldError, {
82
+ path: path,
83
+ showError: showError
84
+ }) : null,
85
+ /*#__PURE__*/ _jsx(FieldDescription, {
86
+ path: path,
87
+ description: field.admin?.description
88
+ }),
89
+ !readonly && picker.status === 'error' ? /*#__PURE__*/ _jsxs("div", {
90
+ children: [
91
+ /*#__PURE__*/ _jsx("p", {
92
+ children: C.loadError
93
+ }),
94
+ /*#__PURE__*/ _jsx(Button, {
95
+ type: "button",
96
+ margin: false,
97
+ buttonStyle: "secondary",
98
+ onClick: picker.retry,
99
+ children: C.retry
100
+ })
101
+ ]
102
+ }) : null,
103
+ missing && !readonly && !showError ? /*#__PURE__*/ _jsx("p", {
104
+ role: "status",
105
+ children: C.undefinedKey
106
+ }) : null,
107
+ picker.canManage && !locked ? /*#__PURE__*/ _jsx(_Fragment, {
108
+ children: picker.panel.open ? /*#__PURE__*/ _jsxs("section", {
109
+ className: "xp-goal-field__panel",
110
+ "aria-labelledby": `${id}-title`,
111
+ children: [
112
+ /*#__PURE__*/ _jsx("h3", {
113
+ id: `${id}-title`,
114
+ children: C.title
115
+ }),
116
+ /*#__PURE__*/ _jsxs("div", {
117
+ className: "field-type text",
118
+ children: [
119
+ /*#__PURE__*/ _jsx(FieldLabel, {
120
+ path: namePath,
121
+ label: C.name
122
+ }),
123
+ /*#__PURE__*/ _jsx("input", {
124
+ id: `field-${namePath}`,
125
+ value: picker.panel.name,
126
+ disabled: picker.panel.pending,
127
+ onKeyDown: stopEnter,
128
+ onChange: (event)=>picker.setName(event.currentTarget.value)
129
+ })
130
+ ]
131
+ }),
132
+ /*#__PURE__*/ _jsxs("details", {
133
+ open: picker.panel.advanced,
134
+ onToggle: (event)=>picker.setAdvanced(event.currentTarget.open),
135
+ children: [
136
+ /*#__PURE__*/ _jsx("summary", {
137
+ children: C.advanced
138
+ }),
139
+ /*#__PURE__*/ _jsxs("div", {
140
+ className: "field-type text",
141
+ children: [
142
+ /*#__PURE__*/ _jsx(FieldLabel, {
143
+ path: slugPath,
144
+ label: C.slug
145
+ }),
146
+ /*#__PURE__*/ _jsx("input", {
147
+ id: `field-${slugPath}`,
148
+ value: picker.panel.slug,
149
+ disabled: picker.panel.pending,
150
+ onKeyDown: stopEnter,
151
+ "aria-invalid": Boolean(picker.panel.errors.slug) || undefined,
152
+ "aria-describedby": picker.panel.errors.slug ? `${id}-slug-error` : undefined,
153
+ onChange: (event)=>picker.setSlug(event.currentTarget.value)
154
+ }),
155
+ picker.panel.errors.slug ? /*#__PURE__*/ _jsx("p", {
156
+ id: `${id}-slug-error`,
157
+ role: "alert",
158
+ children: picker.panel.errors.slug
159
+ }) : null
160
+ ]
161
+ })
162
+ ]
163
+ }),
164
+ picker.panel.errors.general ? /*#__PURE__*/ _jsx("p", {
165
+ role: "alert",
166
+ children: picker.panel.errors.general
167
+ }) : null,
168
+ /*#__PURE__*/ _jsxs("div", {
169
+ className: "xp-goal-field__actions",
170
+ children: [
171
+ /*#__PURE__*/ _jsx(Button, {
172
+ type: "button",
173
+ margin: false,
174
+ buttonStyle: "primary",
175
+ disabled: picker.panel.pending || !picker.panel.name.trim(),
176
+ onClick: ()=>void picker.create(),
177
+ children: C.createGoal
178
+ }),
179
+ /*#__PURE__*/ _jsx(Button, {
180
+ type: "button",
181
+ margin: false,
182
+ buttonStyle: "secondary",
183
+ disabled: picker.panel.pending,
184
+ onClick: picker.cancel,
185
+ children: C.cancel
186
+ })
187
+ ]
188
+ })
189
+ ]
190
+ }) : null
165
191
  }) : null
166
192
  ]
167
193
  });
@@ -23,9 +23,8 @@
23
23
  padding: var(--xp-space-4);
24
24
  }
25
25
 
26
- .xp-goal-field > p,
27
- .xp-goal-field__panel > h3,
28
- .xp-goal-field__panel > p {
26
+ .xp-goal-field p,
27
+ .xp-goal-field__panel > h3 {
29
28
  margin: 0;
30
29
  }
31
30
 
@@ -1,4 +1,4 @@
1
- import { statusLabel } from './labels.js';
1
+ import { statusLabel } from '../testSurface/labels.js';
2
2
  import { STATUS_TOOLTIPS } from './copy/status.js';
3
3
  const TONES = {
4
4
  draft: 'neutral',
@@ -1,5 +1,6 @@
1
1
  import type { DocId } from '../../types/contracts.js';
2
- import type { SurfaceProps } from './contracts.js';
2
+ import type { SurfaceProps } from '../../testSurface/surface/contracts.js';
3
+ import '../../testSurface/surface/test/testPage.css';
3
4
  export declare function ResultsRoute(props: {
4
5
  id: DocId;
5
6
  surface: SurfaceProps;
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useState } from 'react';
4
- import { useTestDocument } from './useTestDocument.js';
4
+ import { useTestDocument } from '../../testSurface/surface/useTestDocument.js';
5
5
  import { ResultsHeader, ReaderResultsShell } from './results/ResultsHeader.js';
6
- import { ResultsBody } from './results/ResultsBody.js';
7
- import { TEST_PAGE as C } from '../copy/testPage.js';
6
+ import { ResultsBody } from '../../testSurface/surface/results/ResultsBody.js';
7
+ import { TEST_PAGE as C } from '../../testSurface/copy/testPage.js';
8
8
  import { Button } from '../../ui/Button.js';
9
+ import '../../testSurface/surface/test/testPage.css';
9
10
  export function ResultsRoute(props) {
10
11
  // Results-only readers cannot load the manager-only experiment or preflight.
11
12
  return props.surface.canManage ? /*#__PURE__*/ _jsx(ManagedResults, {
@@ -4,7 +4,7 @@ import '../theme.css';
4
4
  import { formatAdminURL } from 'payload/shared';
5
5
  import { Breadcrumb } from '../../ui/Breadcrumb.js';
6
6
  import { Button } from '../../ui/Button.js';
7
- import { SURFACE_COPY } from '../copy/surface.js';
7
+ import { SURFACE_COPY } from '../../testSurface/copy/surface.js';
8
8
  import './surface.css';
9
9
  export function SurfaceShell({ adminRoute, children, crumbs = [
10
10
  {
@@ -12,7 +12,7 @@ export function SurfaceShell({ adminRoute, children, crumbs = [
12
12
  }
13
13
  ], title = SURFACE_COPY.title, status, actions, subtitle }) {
14
14
  return /*#__PURE__*/ _jsxs("div", {
15
- className: "xp-tests-surface",
15
+ className: "xp-tests-surface xp-test-surface",
16
16
  children: [
17
17
  /*#__PURE__*/ _jsxs("header", {
18
18
  className: "xp-tests-shell-header",
@@ -1,5 +1,5 @@
1
1
  import type { SurfaceShellProps } from './SurfaceShell.js';
2
- import type { ReadinessContext } from './readiness/readiness.model.js';
2
+ import type { ReadinessContext } from '../../testSurface/surface/readiness/readiness.model.js';
3
3
  export declare function TestsHome({ adminRoute, apiRoute, canManage, crumbs, flagPoints }: {
4
4
  adminRoute: string;
5
5
  apiRoute: string;
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { surfaceUrls } from '../surfaceUrls.js';
3
+ import { surfaceUrls } from '../../testSurface/surfaceUrls.js';
4
4
  import { useEffect, useMemo, useState } from 'react';
5
5
  import { formatAdminURL } from 'payload/shared';
6
6
  import { fetchAllDocs } from '../../lib/fetchAllDocs.js';
7
- import { createApi } from '../api.js';
8
- import { noMatchesLine, SURFACE_COPY } from '../copy/surface.js';
7
+ import { createApi } from '../../testSurface/api.js';
8
+ import { noMatchesLine, SURFACE_COPY } from '../../testSurface/copy/surface.js';
9
9
  import { Banner, EmptyState, StatusChip } from '../../ui/Feedback.js';
10
10
  import { Button } from '../../ui/Button.js';
11
11
  import { SearchInput } from '../../ui/Inputs.js';