@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
@@ -0,0 +1,7 @@
1
+ import type { PayloadRequest } from 'payload';
2
+ type StartReadQuery = Parameters<PayloadRequest['payload']['find']>[0] & {
3
+ collection: 'xp-experiments' | 'xp-metrics' | 'xp-layers';
4
+ };
5
+ export declare function findStartDocuments(req: PayloadRequest, query: StartReadQuery, system?: boolean): Promise<import("payload").PaginatedDocs<import("payload").JsonObject & import("payload").TypeWithID>>;
6
+ export declare function readStartState(req: PayloadRequest, system?: boolean): Promise<import("payload").JsonObject>;
7
+ export {};
@@ -0,0 +1,28 @@
1
+ export function findStartDocuments(req, query, system = false) {
2
+ // §7.8: Start from trusted host code reads plugin readiness data without a manager actor.
3
+ if (system) return req.payload.find({
4
+ ...query,
5
+ req,
6
+ overrideAccess: true
7
+ });
8
+ return req.payload.find({
9
+ ...query,
10
+ req,
11
+ overrideAccess: false
12
+ });
13
+ }
14
+ export function readStartState(req, system = false) {
15
+ // §7.8: system Start needs the effective flag defaults even without a manager actor.
16
+ if (system) return req.payload.findGlobal({
17
+ slug: 'xp-state',
18
+ req,
19
+ overrideAccess: true,
20
+ depth: 0
21
+ });
22
+ return req.payload.findGlobal({
23
+ slug: 'xp-state',
24
+ req,
25
+ overrideAccess: false,
26
+ depth: 0
27
+ });
28
+ }
@@ -1,6 +1,7 @@
1
1
  import type { PayloadRequest } from 'payload';
2
2
  import type { DocId } from '../types/contracts.js';
3
- export declare function stop(req: PayloadRequest, { experimentId }: {
3
+ import type { RoundBody } from '../types/endpoints.js';
4
+ export declare function stop(req: PayloadRequest, { experimentId, phase: expectedPhase }: RoundBody & {
4
5
  experimentId: DocId;
5
6
  }): Promise<{
6
7
  doc: import("payload").JsonObject & import("payload").TypeWithID;
@@ -1,14 +1,15 @@
1
1
  import { relationshipId } from './checkStart.js';
2
2
  import { withTransition } from './kernel.js';
3
- import { setPhaseEndedAt } from './phaseRecord.js';
3
+ import { requireCurrentRound, setPhaseEndedAt } from './phaseRecord.js';
4
4
  import { readExperiment, refuse, updateExperiment } from './start.js';
5
- export async function stop(req, { experimentId }) {
5
+ export async function stop(req, { experimentId, phase: expectedPhase }) {
6
6
  const before = await readExperiment(req, experimentId);
7
7
  const { result: doc, revision } = await withTransition(req, {
8
8
  experimentId,
9
9
  layerId: relationshipId(before.layer)
10
10
  }, async ({ req })=>{
11
11
  const current = await readExperiment(req, experimentId);
12
+ requireCurrentRound(expectedPhase, current.phase);
12
13
  if (current.status !== 'running') refuse('invalid-status');
13
14
  const at = new Date().toISOString();
14
15
  await setPhaseEndedAt(req, experimentId, current.phase, at);
@@ -0,0 +1,2 @@
1
+ /** Leaf module: UI code imports this without pulling server types. */
2
+ export type ArmKey = 'control' | 'variantA' | 'variantB' | 'variantC' | 'holdout';
@@ -0,0 +1 @@
1
+ /** Leaf module: UI code imports this without pulling server types. */ export { };
@@ -16,7 +16,8 @@ export type ExposurePolicy = 'render' | 'viewport' | 'pageview' | 'manual';
16
16
  export type ExperimentKind = 'block' | 'page' | 'flag' | 'code';
17
17
  export type Status = 'draft' | 'running' | 'stopped' | 'decided' | 'archived';
18
18
  export type UnitType = 'visitor' | 'user';
19
- export type ArmKey = 'control' | 'variantA' | 'variantB' | 'variantC' | 'holdout';
19
+ import type { ArmKey } from './armKey.js';
20
+ export type { ArmKey };
20
21
  export type ArmKind = 'control' | 'variant' | 'holdout';
21
22
  export interface TargetingRule {
22
23
  attribute: string;
@@ -93,10 +94,11 @@ export interface FlagPoint {
93
94
  req: PayloadRequest;
94
95
  }): Promise<void>;
95
96
  }
96
- /** Host adapter: true permits the request; false drops it. */
97
+ /** Combine a trusted client-address cap with a limit for the verified unit. */
97
98
  export type RateLimiter = (args: {
98
99
  req: PayloadRequest;
99
100
  unitId: string;
101
+ unitType: UnitType;
100
102
  }) => boolean | Promise<boolean>;
101
103
  export type ExperimentsAccess = (args: {
102
104
  req: PayloadRequest;
@@ -107,6 +109,15 @@ export interface ExperimentsPageCollection {
107
109
  copyHint?: string;
108
110
  copyUrl?: string;
109
111
  copyLabel?: string;
112
+ /** Enable draft copying for this collection. Omit or set false to use manual setup. */
113
+ copy?: boolean | {
114
+ /** Override fields for the proposed address, or return null for manual setup. Can run more than once and must not write. */
115
+ overrides: (doc: Record<string, unknown>, context: {
116
+ req: PayloadRequest;
117
+ path: string;
118
+ suffix: string;
119
+ }) => Record<string, unknown> | null | Promise<Record<string, unknown> | null>;
120
+ };
110
121
  pathOf: (doc: Record<string, unknown>) => string | null;
111
122
  /** Lookup with the supplied req and overrideAccess: false. Under an anonymous req (results checks) only published pages are visible, so a hit is { published: true } or null. Under a req that can read drafts (Start), a draft-only page may be reported as { published: false }. */
112
123
  findByPath: (path: string, req: PayloadRequest) => Promise<{
@@ -173,11 +184,13 @@ export interface ExperimentsPluginOptions<TUser extends {
173
184
  field?: string;
174
185
  }>;
175
186
  };
176
- events?: {
187
+ events: {
177
188
  retentionDays?: number;
178
189
  maxBodyBytes?: number;
179
- rateLimit?: RateLimiter;
190
+ rateLimit: RateLimiter | false;
180
191
  dimensions?: string[];
192
+ /** Public HTTP(S) origin for clients without Fetch Metadata. Defaults to Payload's serverURL. */
193
+ origin?: string;
181
194
  };
182
195
  }
183
196
  /** Options required by the route table; CORE-02c resolves optional defaults. */
@@ -7,7 +7,7 @@ import type { Snapshot, VerdictCode } from './snapshot.js';
7
7
  export type ArmIssueCode = 'weights-total' | 'control-count' | 'control-first' | 'holdout-last' | 'holdout-count' | 'variant-count' | 'duplicate-key' | 'duplicate-slot' | 'slot-required' | 'invalid-key';
8
8
  /** Content-report dismiss/restore refusals (CORE-44). */
9
9
  export type ContentEntryRefusal = 'not-decided' | 'entry-not-found' | 'entry-ok' | 'entry-dismissed' | 'entry-not-dismissed';
10
- export type RefusalCode = ArmIssueCode | 'nested-tests' | 'goal-in-some-versions' | 'placement-unchecked' | 'placement-unpublished' | 'duplicate-version-row' | 'interacting-tests' | 'placements-changed' | 'page-busy' | 'wrap-target-missing' | 'version-identical' | 'version-same-address' | 'unknown-collection' | 'not-found' | ContentEntryRefusal | 'no-planned-duration' | 'no-primary-metric' | 'no-placements' | 'placement-removed' | 'empty-slot' | 'page-in-use' | 'page-no-targets' | 'page-target-unpublished' | 'page-user-unit' | 'version-page-unavailable' | 'version-page-unchecked' | 'flag-no-point' | 'flag-params-invalid' | 'flag-point-busy' | 'flag-placement-missing' | 'layer-full' | 'layer-unit-mismatch' | 'unknown-metric-source' | 'unit-source-mismatch' | 'no-reach-per-day' | 'invalid-status' | 'stale-draft' | 'stale-edit' | 'commit-unverified' | 'allocation-lower' | 'confirmation-required' | 'invalid-winner' | 'slices-taken' | 'locked-placement' | 'not-implemented' | 'forbidden' | 'unauthenticated' | 'body-too-large' | 'invalid-body' | 'too-many-ids' | 'invalid-phase' | 'invalid-ids' | 'recompute-failed' | 'analysis-failed' | 'undeclared-targeting-key' | 'invalid-targeting-rule' | 'block-path-rule' | 'duplicate-metric';
10
+ export type RefusalCode = ArmIssueCode | 'copy-unavailable' | 'copy-not-enabled' | 'copy-no-access' | 'copy-unique-field' | 'copy-orphaned' | 'transaction-lost' | 'nested-tests' | 'goal-in-some-versions' | 'placement-unchecked' | 'placement-unpublished' | 'duplicate-version-row' | 'interacting-tests' | 'placements-changed' | 'page-busy' | 'wrap-target-missing' | 'version-identical' | 'version-same-address' | 'unknown-collection' | 'not-found' | ContentEntryRefusal | 'no-planned-duration' | 'no-primary-metric' | 'no-placements' | 'placement-removed' | 'empty-slot' | 'page-in-use' | 'page-no-targets' | 'page-target-unpublished' | 'page-user-unit' | 'version-page-unavailable' | 'version-page-unchecked' | 'flag-no-point' | 'flag-params-invalid' | 'flag-point-busy' | 'flag-placement-missing' | 'layer-full' | 'layer-unit-mismatch' | 'unknown-metric-source' | 'unit-source-mismatch' | 'no-reach-per-day' | 'invalid-status' | 'first-start-only' | 'stale-draft' | 'stale-edit' | 'round-changed' | 'commit-unverified' | 'allocation-lower' | 'confirmation-required' | 'invalid-winner' | 'slices-taken' | 'locked-placement' | 'not-implemented' | 'forbidden' | 'unauthenticated' | 'body-too-large' | 'invalid-body' | 'too-many-ids' | 'invalid-phase' | 'invalid-ids' | 'recompute-failed' | 'analysis-failed' | 'undeclared-targeting-key' | 'invalid-targeting-rule' | 'block-path-rule' | 'duplicate-metric';
11
11
  export type ErrorEnvelope = {
12
12
  errors: Array<{
13
13
  code: RefusalCode;
@@ -19,8 +19,31 @@ export type TransitionSuccess = {
19
19
  doc: Record<string, unknown>;
20
20
  revision: number;
21
21
  };
22
- export type AllocateBody = {
23
- allocation: number;
22
+ export type StartExperimentWarning = {
23
+ metricId: DocId;
24
+ message: string;
25
+ };
26
+ export type StartExperimentFirstStartDetail = {
27
+ status: Status;
28
+ phase: number;
29
+ };
30
+ export type StartExperimentResult = {
31
+ status: 'started';
32
+ phase: number;
33
+ revision: number;
34
+ warnings: StartExperimentWarning[];
35
+ } | {
36
+ status: 'refused';
37
+ code: 'first-start-only';
38
+ message: string;
39
+ detail: StartExperimentFirstStartDetail;
40
+ } | {
41
+ status: 'refused';
42
+ code: Exclude<RefusalCode, 'not-found' | 'commit-unverified' | 'first-start-only'> | 'transaction-open';
43
+ message: string;
44
+ detail?: unknown;
45
+ } | {
46
+ status: 'not-found';
24
47
  };
25
48
  export type AddMetricWarning = {
26
49
  code: 'goal-in-some-versions' | 'goal-added-mid-test' | 'placement-unchecked';
@@ -29,16 +52,23 @@ export type AddMetricWarning = {
29
52
  export type AddMetricResult = TransitionSuccess & {
30
53
  warnings: AddMetricWarning[];
31
54
  };
32
- export type AddMetricBody = {
55
+ export type AddMetricBody = RoundBody & {
33
56
  metric: DocId;
34
57
  role: 'secondary' | 'guardrail';
35
58
  };
36
- export type DecideBody = {
59
+ /** When omitted, the action applies to the current round. */
60
+ export type RoundBody = {
61
+ phase?: number;
62
+ };
63
+ export type AllocateBody = RoundBody & {
64
+ allocation: number;
65
+ };
66
+ export type DecideBody = RoundBody & {
37
67
  winnerArm: string;
38
68
  note?: string;
39
69
  confirmation?: string;
40
70
  };
41
- export type ArchiveBody = {
71
+ export type ArchiveBody = RoundBody & {
42
72
  mode: 'stopped' | 'after-content' | 'discard' | 'hard-coded';
43
73
  confirmation?: string;
44
74
  };
@@ -64,10 +94,23 @@ export type MakeContentResult = TransitionSuccess & {
64
94
  }>;
65
95
  };
66
96
  export type PreflightResult = {
97
+ /** Saved document version used for these checks. */
98
+ document?: {
99
+ status: Status;
100
+ phase?: number;
101
+ updatedAt?: string;
102
+ };
103
+ /** Content language selection and labels when block placements are localized. */
104
+ contentLocales?: {
105
+ selected: string;
106
+ labels: Record<string, string>;
107
+ };
67
108
  goalNotes?: Array<{
68
109
  metricId: DocId;
69
110
  message: string;
70
111
  }>;
112
+ /** Advisory only. This does not affect Start readiness. */
113
+ browserWritablePrimaryId?: DocId;
71
114
  checks: Array<{
72
115
  code: ReadinessCode;
73
116
  ok: boolean;
@@ -91,10 +134,12 @@ export type PreflightResult = {
91
134
  title: string;
92
135
  locales?: string[];
93
136
  allLocales?: true;
137
+ localeCodes?: string[];
94
138
  slotCount?: number;
95
139
  url?: string;
96
140
  editorUrl?: string;
97
141
  slots?: Record<ArmSlot, number>;
142
+ partlyFilledSlots?: ArmSlot[];
98
143
  ok: boolean;
99
144
  detail?: string;
100
145
  }>;
@@ -119,6 +164,7 @@ export interface PhaseSummary {
119
164
  phaseKind: 'test' | 'rollout';
120
165
  startedAt: string;
121
166
  endedAt: string | null;
167
+ plannedDurationDays?: number;
122
168
  arms: Array<{
123
169
  key: string;
124
170
  label: string;
@@ -130,6 +176,7 @@ export interface PhaseSummary {
130
176
  kind: MetricSource['kind'];
131
177
  role: 'primary' | 'secondary' | 'guardrail';
132
178
  clickGoal?: true;
179
+ browserWritable?: true;
133
180
  resolvedCap?: number | null;
134
181
  historyUnits?: number;
135
182
  capNotice?: 'no-history';
@@ -186,16 +233,13 @@ export type EventBody = {
186
233
  attributes?: Record<string, string | number | boolean>;
187
234
  }>;
188
235
  };
189
- export type AccessKind = 'manage' | 'readResults' | 'surface' | 'manifestKey' | 'signedCookie';
236
+ export type AccessKind = 'manage' | 'readResults' | 'surface' | 'manifestKey' | 'browserEvents';
190
237
  export type EndpointContext<TUser extends {
191
238
  id: string | number;
192
239
  } = {
193
240
  id: string | number;
194
241
  }> = {
195
242
  options: ResolvedOptions<TUser>;
196
- unit?: {
197
- visitorId: string;
198
- };
199
243
  };
200
244
  export type ClickKeysResult = {
201
245
  keys: Array<{
@@ -204,15 +248,25 @@ export type ClickKeysResult = {
204
248
  label: string;
205
249
  }>;
206
250
  };
251
+ export type PageRow = {
252
+ id: DocId;
253
+ title: string;
254
+ path: string | null;
255
+ pathKey: string | null;
256
+ published: boolean;
257
+ address?: string;
258
+ draftAddress?: string;
259
+ status?: 'published' | 'draft' | 'changed';
260
+ updatedAt?: string;
261
+ editor?: 'puck' | 'blocks';
262
+ editorUrl?: string;
263
+ };
207
264
  export type PagesResult = {
208
- docs: Array<{
209
- id: DocId;
210
- title: string;
211
- path: string | null;
212
- pathKey: string | null;
213
- published: boolean;
214
- }>;
265
+ docs: PageRow[];
215
266
  hasNextPage: boolean;
267
+ pageLimitReached?: boolean;
268
+ totalDocs?: number;
269
+ pagingCounter?: number;
216
270
  };
217
271
  export type PlacementStatusBody = {
218
272
  docs?: Array<{
@@ -228,6 +282,7 @@ export type PageTestStatus = {
228
282
  role: 'original' | 'version';
229
283
  winner: boolean;
230
284
  armLabel: string;
285
+ controlLabel?: string;
231
286
  winnerLabel?: string;
232
287
  winnerTitle?: string;
233
288
  winnerPath?: string;
@@ -295,3 +350,20 @@ export type DeleteImpactResult = {
295
350
  addresses: string[];
296
351
  afterPaths?: Record<string, string>;
297
352
  };
353
+ export type CopyPagePlan = {
354
+ title: string;
355
+ path: string;
356
+ phase: number;
357
+ updatedAt: string;
358
+ originalId: DocId;
359
+ originalUpdatedAt: string;
360
+ };
361
+ export type CopyPageResult = {
362
+ doc: Record<string, unknown>;
363
+ copy: {
364
+ id: DocId;
365
+ title: string;
366
+ path: string;
367
+ editorUrl: string;
368
+ };
369
+ };
@@ -1 +1 @@
1
- /** Current visitor effect of deleting a draft or archived test; independent of its stored content report. */ export { };
1
+ export { };
@@ -2,15 +2,21 @@ import type { Payload } from 'payload';
2
2
  import type { NextRequest } from 'next/server';
3
3
  import type { Attributes } from './contracts.js';
4
4
  import type { Manifest } from './manifest.js';
5
+ type CookieOptions = {
6
+ name?: string;
7
+ maxAgeDays?: number;
8
+ /** Reject pre-rc.9 visitor IDs, including upgraded cookies, starting on this UTC date. Can only shorten the release cutoff. */
9
+ legacyCutoff?: string;
10
+ domain?: string;
11
+ /** Called with a request whose URL is a placeholder outside the proxy; read cookies and headers only. */
12
+ consent?(req: NextRequest): boolean;
13
+ };
5
14
  export interface ExperimentsProxyRuntimeOptions {
6
15
  secret: string | string[];
7
16
  apiRoute: string;
8
- cookie?: {
9
- name?: string;
10
- maxAgeDays?: number;
11
- domain?: string; /** Called with a request whose URL is a placeholder outside the proxy; read cookies and headers only. */
12
- consent?(req: NextRequest): boolean;
13
- };
17
+ /** Limit new visitor IDs by trusted client address, or pass false when protected upstream. */
18
+ rateLimitUnit: false | ((req: NextRequest) => boolean | Promise<boolean>);
19
+ cookie?: CookieOptions;
14
20
  loadManifest?: (opts?: {
15
21
  ifRevision?: number;
16
22
  }) => Promise<Manifest | 'not-modified' | null>;
@@ -27,11 +33,10 @@ export interface ExperimentsProxyRuntimeOptions {
27
33
  export interface ExperimentsProxyRuntime {
28
34
  readonly secrets: readonly string[];
29
35
  readonly apiRoute: string;
30
- readonly cookie: {
36
+ readonly rateLimitUnit: ExperimentsProxyRuntimeOptions['rateLimitUnit'];
37
+ readonly cookie: CookieOptions & {
31
38
  name: string;
32
39
  maxAgeDays: number;
33
- domain?: string; /** Called with a request whose URL is a placeholder outside the proxy; read cookies and headers only. */
34
- consent?(req: NextRequest): boolean;
35
40
  };
36
41
  readonly loadManifest?: ExperimentsProxyRuntimeOptions['loadManifest'];
37
42
  readonly getUnit?: ExperimentsProxyRuntimeOptions['getUnit'];
@@ -57,3 +62,4 @@ export interface ExperimentsServerRuntime<TUser extends {
57
62
  userIdOf: NonNullable<ExperimentsServerRuntimeOptions<TUser>['userIdOf']>;
58
63
  attributesOf: NonNullable<ExperimentsServerRuntimeOptions<TUser>['attributesOf']>;
59
64
  }
65
+ export {};
@@ -12,6 +12,8 @@ export type SnapshotHealth = {
12
12
  id?: string | number;
13
13
  path?: string;
14
14
  };
15
+ } | {
16
+ code: 'rapid-browser-events';
15
17
  };
16
18
  import type { GaussianPrior } from '@delmaredigital/experiments-stats';
17
19
  import type { DocId, MetricSource } from './contracts.js';
@@ -1,6 +1,10 @@
1
- import type { DocId } from './contracts.js';
2
1
  import type { SerializedAttributeKeys, SerializedFlagPoint, SerializedMetricSource } from './admin.js';
3
2
  export type TestsRoute = 'home' | 'new' | 'test' | 'results' | 'goals' | 'goalNew' | 'goal';
3
+ export type BlockPageCollection = {
4
+ slug: string;
5
+ label: string;
6
+ editors: Array<'puck' | 'blocks'>;
7
+ };
4
8
  export interface TestsSurfaceProps {
5
9
  route: TestsRoute;
6
10
  id?: string;
@@ -13,18 +17,12 @@ export interface TestsSurfaceProps {
13
17
  userId?: string | number;
14
18
  userCollection?: string;
15
19
  isAdmin: boolean;
16
- pages?: Array<{
17
- collection: string;
18
- collectionLabel: string;
19
- id: DocId;
20
- title: string;
21
- editorUrl: string;
22
- editor: 'puck' | 'blocks';
23
- }>;
20
+ blockPageCollections?: BlockPageCollection[];
24
21
  pageCollections?: Array<{
25
22
  slug: string;
26
23
  label: string;
27
24
  contentChecks: boolean;
25
+ copyEnabled?: true;
28
26
  copyHint?: string;
29
27
  copyUrl?: string;
30
28
  copyLabel?: string;
@@ -9,5 +9,12 @@ export interface ChipsInputProps {
9
9
  placeholder?: string;
10
10
  disabled?: boolean;
11
11
  id: string;
12
+ draft?: {
13
+ value: string;
14
+ change: (value: string) => void;
15
+ submit: (value: string) => void;
16
+ discard: () => void;
17
+ describedBy?: string;
18
+ };
12
19
  }
13
- export declare function ChipsInput({ value, onChange, label, description, help, error, placeholder, disabled, id }: ChipsInputProps): import("react").JSX.Element;
20
+ export declare function ChipsInput({ value, onChange, label, description, help, error, placeholder, disabled, id, draft: managedDraft }: ChipsInputProps): import("react").JSX.Element;
@@ -2,11 +2,17 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useRef, useState } from 'react';
4
4
  import './ui.css';
5
- export function ChipsInput({ value, onChange, label, description, help = description, error, placeholder, disabled = false, id }) {
6
- const [draft, setDraft] = useState('');
5
+ export function ChipsInput({ value, onChange, label, description, help = description, error, placeholder, disabled = false, id, draft: managedDraft }) {
6
+ const [localDraft, setLocalDraft] = useState('');
7
+ const draft = managedDraft?.value ?? localDraft;
8
+ const setDraft = managedDraft?.change ?? setLocalDraft;
7
9
  const input = useRef(null);
8
10
  const commit = (text)=>{
9
11
  if (disabled) return;
12
+ if (managedDraft) {
13
+ managedDraft.submit(text);
14
+ return;
15
+ }
10
16
  const next = [
11
17
  ...new Set([
12
18
  ...value,
@@ -60,13 +66,20 @@ export function ChipsInput({ value, onChange, label, description, help = descrip
60
66
  "aria-invalid": Boolean(error) || undefined,
61
67
  "aria-describedby": [
62
68
  help ? `${id}-description` : '',
63
- error ? `${id}-error` : ''
69
+ error ? `${id}-error` : '',
70
+ managedDraft?.describedBy
64
71
  ].filter(Boolean).join(' ') || undefined,
65
72
  onChange: (event)=>setDraft(event.target.value),
66
73
  onBlur: ()=>{
67
74
  if (draft.trim()) commit(draft);
68
75
  },
69
76
  onKeyDown: (event)=>{
77
+ if (event.key === 'Escape' && managedDraft && draft) {
78
+ event.preventDefault();
79
+ event.stopPropagation();
80
+ managedDraft.discard();
81
+ return;
82
+ }
70
83
  if (disabled || event.nativeEvent.isComposing) return;
71
84
  if (event.key === 'Enter' || event.key === ',') {
72
85
  event.preventDefault();
@@ -78,7 +91,7 @@ export function ChipsInput({ value, onChange, label, description, help = descrip
78
91
  }
79
92
  },
80
93
  onPaste: (event)=>{
81
- if (disabled) return;
94
+ if (disabled || managedDraft) return;
82
95
  const pasted = event.clipboardData.getData('text');
83
96
  if (!pasted.includes(',')) return;
84
97
  event.preventDefault();
@@ -3,7 +3,7 @@ import './ui.css';
3
3
  /** Native modal stays in its rendering document, including a Puck canvas iframe.
4
4
  * `initialFocus="cancel"` targets the focusable control marked `data-dialog-cancel`.
5
5
  */
6
- export declare function Dialog({ open, title, onClose, children, dismissible, initialFocus, className, headerActions, closeOnBackdrop }: {
6
+ export declare function Dialog({ open, title, descriptionId, onClose, children, dismissible, initialFocus, className, headerActions, closeOnBackdrop }: {
7
7
  open: boolean;
8
8
  className?: string;
9
9
  headerActions?: ReactNode;
@@ -11,6 +11,25 @@ export declare function Dialog({ open, title, onClose, children, dismissible, in
11
11
  dismissible?: boolean;
12
12
  initialFocus?: 'cancel';
13
13
  title: string;
14
- onClose: () => void;
14
+ descriptionId?: string;
15
+ onClose: () => void | false;
15
16
  children: ReactNode;
16
17
  }): import("react").JSX.Element;
18
+ export declare function ConfirmDialog({ open, title, description, children, error, busy, busyLabel, cancelLabel, onClose, confirm, secondaryAction }: {
19
+ open?: boolean;
20
+ title: string;
21
+ description?: ReactNode;
22
+ children?: ReactNode;
23
+ error?: string | null;
24
+ busy?: boolean;
25
+ busyLabel?: string;
26
+ cancelLabel: string;
27
+ onClose: () => void;
28
+ secondaryAction?: ReactNode;
29
+ confirm?: {
30
+ label: string;
31
+ onClick: () => void | Promise<void>;
32
+ disabled?: boolean;
33
+ destructive?: boolean;
34
+ };
35
+ }): import("react").JSX.Element;