@delmaredigital/payload-experiments 0.4.0-rc.1 → 0.4.0-rc.11
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.
- package/README.md +284 -772
- package/dist/admin/LayerUsage.js +1 -1
- package/dist/admin/MetricSourceSelect.js +12 -5
- package/dist/admin/PlacementStatus.js +1 -1
- package/dist/admin/TestsDashboardCards.d.ts +1 -0
- package/dist/admin/TestsDashboardCards.js +5 -9
- package/dist/admin/TestsNavLink.d.ts +1 -0
- package/dist/admin/TestsNavLink.js +5 -11
- package/dist/admin/blocks/BlockPanel.d.ts +1 -0
- package/dist/admin/blocks/BlockPanel.js +129 -37
- package/dist/admin/blocks/TestBlockField.js +3 -3
- package/dist/admin/blocks/formApi.d.ts +3 -0
- package/dist/admin/blocks/formApi.js +10 -4
- package/dist/admin/blocks/inject.js +1 -0
- package/dist/admin/blocks/model.d.ts +3 -2
- package/dist/admin/blocks/model.js +10 -6
- package/dist/admin/blocks/statusCache.d.ts +2 -0
- package/dist/admin/blocks/statusCache.js +12 -3
- package/dist/admin/components/RootViewMessage.js +1 -1
- package/dist/admin/copy/blocks.d.ts +21 -1
- package/dist/admin/copy/blocks.js +40 -6
- package/dist/admin/copy/goals.d.ts +21 -9
- package/dist/admin/copy/goals.js +28 -11
- package/dist/admin/copy/newTest.d.ts +7 -7
- package/dist/admin/copy/newTest.js +10 -7
- package/dist/admin/goals/XpGoalField.d.ts +2 -0
- package/dist/admin/goals/XpGoalField.js +156 -114
- package/dist/admin/goals/xpGoalField.css +47 -0
- package/dist/admin/pageCollections.d.ts +1 -0
- package/dist/admin/pageCollections.js +3 -0
- package/dist/admin/paths.d.ts +3 -0
- package/dist/admin/paths.js +3 -0
- package/dist/admin/placementStatus.model.js +1 -1
- package/dist/admin/status.model.js +1 -1
- package/dist/admin/surface/ResultsRoute.d.ts +2 -1
- package/dist/admin/surface/ResultsRoute.js +20 -24
- package/dist/admin/surface/SurfaceShell.d.ts +4 -2
- package/dist/admin/surface/SurfaceShell.js +29 -4
- package/dist/admin/surface/TestRowMenu.d.ts +13 -0
- package/dist/admin/surface/TestRowMenu.js +163 -0
- package/dist/admin/surface/TestsHome.d.ts +5 -3
- package/dist/admin/surface/TestsHome.js +273 -58
- package/dist/admin/surface/TestsSurface.js +8 -7
- package/dist/admin/surface/goals/DeleteGoalDialog.d.ts +7 -0
- package/dist/admin/surface/goals/DeleteGoalDialog.js +42 -0
- package/dist/admin/surface/goals/GoalForm.d.ts +2 -1
- package/dist/admin/surface/goals/GoalForm.js +342 -212
- package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
- package/dist/admin/surface/goals/GoalsList.js +107 -37
- package/dist/admin/surface/goals/data.d.ts +2 -0
- package/dist/admin/surface/goals/data.js +11 -2
- package/dist/admin/surface/goals/goals.css +9 -1
- package/dist/admin/surface/goals/goals.model.d.ts +12 -2
- package/dist/admin/surface/goals/goals.model.js +39 -1
- package/dist/admin/surface/home.model.d.ts +10 -8
- package/dist/admin/surface/home.model.js +27 -22
- package/dist/admin/surface/newTest/NewTest.d.ts +4 -4
- package/dist/admin/surface/newTest/NewTest.js +149 -118
- package/dist/admin/surface/newTest/PageWizard.d.ts +5 -2
- package/dist/admin/surface/newTest/PageWizard.js +115 -80
- package/dist/admin/surface/newTest/newTest.css +28 -9
- package/dist/admin/surface/results/ResultsHeader.d.ts +3 -3
- package/dist/admin/surface/results/ResultsHeader.js +115 -83
- package/dist/admin/surface/surface.css +29 -0
- package/dist/admin/surface/test/TestPage.d.ts +1 -2
- package/dist/admin/surface/test/TestPage.js +44 -152
- package/dist/admin/surface/useXpStepNav.d.ts +11 -0
- package/dist/admin/surface/useXpStepNav.js +14 -0
- package/dist/admin/theme.css +2 -0
- package/dist/admin/views/CollectionListRedirect.d.ts +1 -0
- package/dist/admin/views/CollectionListRedirect.js +1 -1
- package/dist/admin/views/ExperimentsRootView.js +18 -165
- package/dist/admin/views/GoalEditRedirect.d.ts +4 -0
- package/dist/admin/views/GoalEditRedirect.js +14 -0
- package/dist/admin/views/GoalsCollectionListView.d.ts +2 -0
- package/dist/admin/views/GoalsCollectionListView.js +4 -0
- package/dist/admin/views/TestsCollectionListView.d.ts +2 -0
- package/dist/admin/views/TestsCollectionListView.js +4 -0
- package/dist/admin/views/TestsNavLinkServer.d.ts +1 -0
- package/dist/admin/views/TestsNavLinkServer.js +2 -2
- package/dist/admin/views/TestsSurfaceClient.d.ts +3 -0
- package/dist/admin/views/TestsSurfaceClient.js +35 -0
- package/dist/admin/views/buildSurfaceProps.d.ts +8 -0
- package/dist/admin/views/buildSurfaceProps.js +102 -0
- package/dist/admin/views/renderCollectionList.d.ts +2 -0
- package/dist/admin/views/renderCollectionList.js +34 -0
- package/dist/admin/views/renderTestsSurface.d.ts +3 -0
- package/dist/admin/views/renderTestsSurface.js +34 -0
- package/dist/blocks/bindings.js +8 -14
- package/dist/blocks/createExperimentBlock.js +1 -1
- package/dist/blocks/formState.js +2 -2
- package/dist/blocks/placementLanguages.d.ts +7 -0
- package/dist/blocks/placementLanguages.js +27 -0
- package/dist/blocks/placementLocale.d.ts +37 -0
- package/dist/blocks/placementLocale.js +270 -0
- package/dist/collections/experiments/config.js +17 -8
- package/dist/collections/experiments/deleteGuard.js +2 -2
- package/dist/collections/experiments/lockHook.js +21 -2
- package/dist/collections/experiments/pickSlug.js +2 -0
- package/dist/collections/metrics.js +28 -9
- package/dist/collections/metricsGuards.js +2 -0
- package/dist/collections/serialize.js +8 -6
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/db/adapter.d.ts +9 -1
- package/dist/db/adapter.js +77 -1
- package/dist/db/appends.d.ts +13 -0
- package/dist/db/appends.js +49 -0
- package/dist/db/bulkPlacementRemoval.d.ts +30 -0
- package/dist/db/bulkPlacementRemoval.js +111 -0
- package/dist/db/delete.d.ts +1 -1
- package/dist/db/delete.js +2 -4
- package/dist/db/events.d.ts +9 -0
- package/dist/db/events.js +42 -8
- package/dist/db/executor.d.ts +7 -1
- package/dist/db/executor.js +7 -3
- package/dist/db/pageCopies.d.ts +5 -0
- package/dist/db/pageCopies.js +31 -0
- package/dist/db/placements.d.ts +2 -0
- package/dist/db/placements.js +8 -0
- package/dist/db/results.d.ts +5 -1
- package/dist/db/results.js +21 -5
- package/dist/db/snapshots.d.ts +2 -0
- package/dist/endpoints/contentLocale.d.ts +6 -0
- package/dist/endpoints/contentLocale.js +15 -0
- package/dist/endpoints/deleteImpact.d.ts +6 -0
- package/dist/endpoints/deleteImpact.js +207 -0
- package/dist/endpoints/duplicateOriginal.d.ts +38 -0
- package/dist/endpoints/duplicateOriginal.js +407 -0
- package/dist/endpoints/editorSurface.d.ts +3 -0
- package/dist/endpoints/editorSurface.js +31 -0
- package/dist/endpoints/events.js +103 -39
- package/dist/endpoints/index.js +57 -9
- package/dist/endpoints/pages.js +247 -64
- package/dist/endpoints/placementStatus.js +13 -5
- package/dist/endpoints/preflight.d.ts +1 -1
- package/dist/endpoints/preflight.js +17 -2
- package/dist/endpoints/results.d.ts +1 -1
- package/dist/endpoints/results.js +6 -2
- package/dist/endpoints/routeId.d.ts +2 -2
- package/dist/endpoints/routeId.js +11 -5
- package/dist/endpoints/summary.js +46 -12
- package/dist/endpoints/testVersion.d.ts +2 -0
- package/dist/endpoints/testVersion.js +38 -0
- package/dist/endpoints/transitions.js +41 -29
- package/dist/errors.d.ts +5 -0
- package/dist/errors.js +8 -0
- package/dist/events/request.d.ts +6 -2
- package/dist/events/request.js +35 -8
- package/dist/events/rows.d.ts +1 -1
- package/dist/events/rows.js +24 -8
- package/dist/events/writable.d.ts +9 -0
- package/dist/events/writable.js +13 -0
- package/dist/exports/adminClient.d.ts +1 -1
- package/dist/exports/adminClient.js +1 -1
- package/dist/exports/adminRsc.d.ts +3 -0
- package/dist/exports/adminRsc.js +3 -0
- package/dist/exports/index.d.ts +1 -1
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +1 -0
- package/dist/fields/xpGoal.js +3 -15
- package/dist/goals/fairness.d.ts +1 -1
- package/dist/goals/fairness.js +44 -35
- package/dist/goals/picker/clickGoalPicker.model.d.ts +8 -1
- package/dist/goals/picker/clickGoalPicker.model.js +20 -2
- package/dist/goals/picker/copy.d.ts +6 -2
- package/dist/goals/picker/copy.js +11 -2
- package/dist/goals/picker/useClickGoalPicker.d.ts +1 -1
- package/dist/goals/picker/useClickGoalPicker.js +4 -2
- package/dist/goals/sourceLabel.d.ts +2 -0
- package/dist/goals/sourceLabel.js +4 -0
- package/dist/goals/validate.d.ts +3 -0
- package/dist/goals/validate.js +15 -0
- package/dist/hooks/blockRemovalRule.d.ts +30 -0
- package/dist/hooks/blockRemovalRule.js +165 -0
- package/dist/hooks/hostHook.js +6 -2
- package/dist/hooks/pageGuard.d.ts +27 -2
- package/dist/hooks/pageGuard.js +213 -45
- package/dist/hooks/puckGoals.d.ts +5 -0
- package/dist/hooks/puckGoals.js +62 -0
- package/dist/hooks/puckNestedTests.d.ts +8 -0
- package/dist/hooks/puckNestedTests.js +36 -0
- package/dist/hooks/trackPageCopies.d.ts +11 -0
- package/dist/hooks/trackPageCopies.js +7 -0
- package/dist/lib/fetchAllDocs.d.ts +1 -1
- package/dist/lib/placementPages.d.ts +10 -0
- package/dist/{admin/previewLinks.model.js → lib/placementPages.js} +10 -5
- package/dist/manifest/compile.d.ts +2 -1
- package/dist/manifest/compile.js +13 -6
- package/dist/onInit.js +36 -0
- package/dist/options.d.ts +2 -0
- package/dist/options.js +23 -2
- package/dist/plugin.js +70 -21
- package/dist/proxy/pageNavigation.d.ts +4 -0
- package/dist/proxy/pageNavigation.js +28 -0
- package/dist/proxy/resolve.js +52 -25
- package/dist/puck/ExperimentPicker.d.ts +2 -1
- package/dist/puck/ExperimentPicker.js +62 -40
- package/dist/puck/ExperimentSlot.js +3 -1
- package/dist/puck/copy.d.ts +5 -1
- package/dist/puck/copy.js +5 -1
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +25 -0
- package/dist/puck/editor/ConfigureTestDrawer.js +150 -0
- package/dist/puck/editor/CreateExperimentDrawer.d.ts +12 -2
- package/dist/puck/editor/CreateExperimentDrawer.js +89 -21
- package/dist/puck/editor/EditorControls.d.ts +14 -0
- package/dist/puck/editor/EditorControls.js +99 -0
- package/dist/puck/editor/ExperimentSlotEditor.d.ts +2 -1
- package/dist/puck/editor/ExperimentSlotEditor.js +1007 -182
- package/dist/puck/editor/LeftoverVersions.d.ts +15 -0
- package/dist/puck/editor/LeftoverVersions.js +79 -0
- package/dist/puck/editor/PlacementNotice.d.ts +8 -0
- package/dist/puck/editor/PlacementNotice.js +22 -0
- package/dist/puck/editor/QuickTestActions.d.ts +6 -0
- package/dist/puck/editor/QuickTestActions.js +72 -0
- package/dist/puck/editor/ResultsReadout.d.ts +4 -1
- package/dist/puck/editor/ResultsReadout.js +35 -19
- package/dist/puck/editor/VersionBuilder.d.ts +67 -12
- package/dist/puck/editor/VersionBuilder.js +560 -231
- package/dist/puck/editor/armWrites.d.ts +11 -2
- package/dist/puck/editor/armWrites.js +43 -4
- package/dist/puck/editor/armsCache.d.ts +3 -1
- package/dist/puck/editor/armsCache.js +20 -4
- package/dist/puck/editor/blockClipboard.d.ts +16 -0
- package/dist/puck/editor/blockClipboard.js +20 -0
- package/dist/puck/editor/cloneSlot.d.ts +2 -0
- package/dist/puck/editor/cloneSlot.js +7 -0
- package/dist/puck/editor/copy.d.ts +65 -20
- package/dist/puck/editor/copy.js +73 -21
- package/dist/puck/editor/createTest.d.ts +3 -0
- package/dist/puck/editor/createTest.js +33 -0
- package/dist/puck/editor/editor.chrome.css +200 -20
- package/dist/puck/editor/editor.css +338 -25
- package/dist/puck/editor/editor.model.d.ts +17 -1
- package/dist/puck/editor/editor.model.js +61 -4
- package/dist/puck/editor/editorSurface.d.ts +10 -0
- package/dist/puck/editor/editorSurface.js +65 -0
- package/dist/puck/editor/experimentOutlinePlugin.js +96 -28
- package/dist/puck/editor/localPlacements.d.ts +5 -0
- package/dist/puck/editor/localPlacements.js +43 -0
- package/dist/puck/editor/outlineVersion.d.ts +5 -0
- package/dist/puck/editor/outlineVersion.js +36 -0
- package/dist/puck/editor/placementsCache.d.ts +60 -0
- package/dist/puck/editor/placementsCache.js +263 -0
- package/dist/puck/editor/sidebar.d.ts +8 -0
- package/dist/puck/editor/sidebar.js +74 -0
- package/dist/puck/editor/usePageSaveReadiness.d.ts +6 -0
- package/dist/puck/editor/usePageSaveReadiness.js +31 -0
- package/dist/puck/editor/usePlacementNotice.d.ts +3 -0
- package/dist/puck/editor/usePlacementNotice.js +15 -0
- package/dist/puck/editor/xpGoalPuckEditorField.js +105 -86
- package/dist/puck/experimentSlotField.d.ts +3 -0
- package/dist/puck/experimentSlotField.js +15 -4
- package/dist/puck/experimentSlug.d.ts +2 -0
- package/dist/puck/experimentSlug.js +3 -0
- package/dist/puck/nestedTestCopy.d.ts +8 -0
- package/dist/puck/nestedTestCopy.js +22 -0
- package/dist/puck/nestedTests.d.ts +17 -0
- package/dist/puck/nestedTests.js +30 -0
- package/dist/puck/slotConfig.d.ts +2 -2
- package/dist/puck/slotConfig.js +18 -5
- package/dist/puck/visibility.d.ts +20 -0
- package/dist/puck/visibility.js +81 -0
- package/dist/results/aggregate.d.ts +6 -3
- package/dist/results/aggregate.js +9 -9
- package/dist/results/analyse.d.ts +2 -0
- package/dist/results/analyse.js +2 -2
- package/dist/results/health.d.ts +8 -0
- package/dist/results/health.js +28 -0
- package/dist/results/identityCredit.d.ts +1 -0
- package/dist/results/identityCredit.js +4 -1
- package/dist/results/verdict.d.ts +1 -1
- package/dist/results/verdict.js +9 -7
- package/dist/runtime/cookie.d.ts +10 -2
- package/dist/runtime/cookie.js +38 -6
- package/dist/runtime/cookieOptions.d.ts +6 -0
- package/dist/runtime/cookieOptions.js +14 -0
- package/dist/runtime/proxyRuntime.d.ts +1 -0
- package/dist/runtime/proxyRuntime.js +18 -8
- package/dist/runtime/signing.d.ts +1 -0
- package/dist/runtime/signing.js +5 -0
- package/dist/sanitizeReadinessDetail.d.ts +2 -2
- package/dist/sanitizeReadinessDetail.js +22 -2
- package/dist/server/getAssignments.js +11 -10
- package/dist/server/recordContentChange.d.ts +1 -1
- package/dist/server/recordContentChange.js +48 -22
- package/dist/server/resolveExperimentBlocks.js +2 -4
- package/dist/server/resolveExperimentData.js +8 -8
- package/dist/server/runResults.js +54 -15
- package/dist/server/startExperiment.d.ts +20 -0
- package/dist/server/startExperiment.js +70 -0
- package/dist/server/trackConversion.js +10 -13
- package/dist/{admin → testSurface}/PreviewLinks.d.ts +2 -1
- package/dist/{admin → testSurface}/PreviewLinks.js +9 -5
- package/dist/testSurface/actions/DecideDialog.d.ts +17 -0
- package/dist/testSurface/actions/DecideDialog.js +222 -0
- package/dist/testSurface/actions/LifecycleAction.d.ts +17 -0
- package/dist/testSurface/actions/LifecycleAction.js +107 -0
- package/dist/{admin → testSurface}/actions/MakeContentResult.d.ts +4 -3
- package/dist/{admin → testSurface}/actions/MakeContentResult.js +10 -2
- package/dist/{admin → testSurface}/actions/actions.model.d.ts +13 -5
- package/dist/testSurface/actions/actions.model.js +123 -0
- package/dist/{admin → testSurface}/actions/decide.model.d.ts +1 -0
- package/dist/{admin → testSurface}/actions/decide.model.js +1 -0
- package/dist/{admin → testSurface}/allocation.model.js +6 -3
- package/dist/{admin → testSurface}/api.d.ts +20 -7
- package/dist/{admin → testSurface}/api.js +72 -22
- package/dist/testSurface/contentLocaleURL.d.ts +2 -0
- package/dist/testSurface/contentLocaleURL.js +3 -0
- package/dist/{admin → testSurface}/copy/actions.d.ts +37 -14
- package/dist/{admin → testSurface}/copy/actions.js +40 -17
- package/dist/{admin → testSurface}/copy/advanced.d.ts +10 -0
- package/dist/{admin → testSurface}/copy/advanced.js +10 -0
- package/dist/{admin → testSurface}/copy/arms.d.ts +1 -1
- package/dist/{admin → testSurface}/copy/arms.js +1 -1
- package/dist/{admin → testSurface}/copy/audience.d.ts +4 -3
- package/dist/{admin → testSurface}/copy/audience.js +5 -4
- package/dist/{admin → testSurface}/copy/common.d.ts +15 -6
- package/dist/{admin → testSurface}/copy/common.js +20 -10
- package/dist/testSurface/copy/languages.d.ts +12 -0
- package/dist/testSurface/copy/languages.js +8 -0
- package/dist/{admin → testSurface}/copy/metrics.d.ts +7 -0
- package/dist/testSurface/copy/metrics.js +18 -0
- package/dist/testSurface/copy/pages.d.ts +84 -0
- package/dist/testSurface/copy/pages.js +90 -0
- package/dist/{admin → testSurface}/copy/readiness.d.ts +40 -6
- package/dist/{admin → testSurface}/copy/readiness.js +54 -9
- package/dist/{admin → testSurface}/copy/recommendation.d.ts +4 -4
- package/dist/{admin → testSurface}/copy/recommendation.js +4 -4
- package/dist/{admin → testSurface}/copy/results.d.ts +19 -12
- package/dist/{admin → testSurface}/copy/results.js +21 -12
- package/dist/testSurface/copy/review.d.ts +20 -0
- package/dist/testSurface/copy/review.js +21 -0
- package/dist/{admin → testSurface}/copy/setting.d.ts +1 -2
- package/dist/{admin → testSurface}/copy/setting.js +1 -2
- package/dist/{admin → testSurface}/copy/surface.d.ts +11 -2
- package/dist/{admin → testSurface}/copy/surface.js +14 -11
- package/dist/{admin → testSurface}/copy/testPage.d.ts +61 -12
- package/dist/testSurface/copy/testPage.js +168 -0
- package/dist/testSurface/format/adminURL.d.ts +7 -0
- package/dist/testSurface/format/adminURL.js +9 -0
- package/dist/{admin → testSurface}/format/date.d.ts +1 -0
- package/dist/testSurface/format/date.js +21 -0
- package/dist/{admin → testSurface}/labels.d.ts +1 -2
- package/dist/{admin → testSurface}/labels.js +2 -3
- package/dist/{admin → testSurface}/lockedNotice.model.d.ts +2 -0
- package/dist/{admin → testSurface}/lockedNotice.model.js +31 -0
- package/dist/testSurface/placementLabel.d.ts +8 -0
- package/dist/testSurface/placementLabel.js +24 -0
- package/dist/{admin → testSurface}/placements/placementLabels.d.ts +2 -0
- package/dist/{admin → testSurface}/placements/placementLabels.js +3 -2
- package/dist/{admin → testSurface}/previewLinks.model.d.ts +1 -6
- package/dist/testSurface/previewLinks.model.js +4 -0
- package/dist/testSurface/readPreflight.d.ts +13 -0
- package/dist/testSurface/readPreflight.js +44 -0
- package/dist/testSurface/readinessRead.d.ts +53 -0
- package/dist/testSurface/readinessRead.js +50 -0
- package/dist/{admin → testSurface}/results/VerdictHero.d.ts +2 -1
- package/dist/{admin → testSurface}/results/VerdictHero.js +5 -1
- package/dist/testSurface/results/results.css +64 -0
- package/dist/{admin → testSurface}/results/results.model.d.ts +3 -2
- package/dist/{admin → testSurface}/results/results.model.js +16 -11
- package/dist/{admin → testSurface}/surface/contracts.d.ts +17 -3
- package/dist/testSurface/surface/editorPlacement.d.ts +26 -0
- package/dist/testSurface/surface/editorPlacement.js +78 -0
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +9 -0
- package/dist/testSurface/surface/pageBlock/parts.js +107 -0
- package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +13 -0
- package/dist/testSurface/surface/pagePicker/CopyRoute.js +273 -0
- package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +21 -0
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +498 -0
- package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -0
- package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.d.ts +7 -3
- package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.js +17 -2
- package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.d.ts +9 -5
- package/dist/testSurface/surface/readiness/ActionDialogs.js +372 -0
- package/dist/{admin → testSurface}/surface/readiness/Banner.d.ts +4 -3
- package/dist/testSurface/surface/readiness/Banner.js +198 -0
- package/dist/testSurface/surface/readiness/BlockerList.d.ts +11 -0
- package/dist/testSurface/surface/readiness/BlockerList.js +31 -0
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +13 -0
- package/dist/testSurface/surface/readiness/SaveStatus.js +67 -0
- package/dist/{admin → testSurface}/surface/readiness/parts.js +0 -2
- package/dist/{admin → testSurface}/surface/readiness/readiness.model.d.ts +28 -2
- package/dist/testSurface/surface/readiness/readiness.model.js +377 -0
- package/dist/testSurface/surface/readiness/useTransition.d.ts +16 -0
- package/dist/testSurface/surface/readiness/useTransition.js +141 -0
- package/dist/{admin → testSurface}/surface/results/ReleasePages.d.ts +6 -3
- package/dist/{admin → testSurface}/surface/results/ReleasePages.js +40 -40
- package/dist/{admin → testSurface}/surface/results/ResultsBody.d.ts +11 -4
- package/dist/{admin → testSurface}/surface/results/ResultsBody.js +207 -104
- package/dist/{admin → testSurface}/surface/results/recommendation.model.js +3 -3
- package/dist/{admin → testSurface}/surface/results/useResults.d.ts +26 -8
- package/dist/{admin → testSurface}/surface/results/useResults.js +3 -2
- package/dist/{admin → testSurface}/surface/setting/parts.js +89 -46
- package/dist/testSurface/surface/setting/setting.css +18 -0
- package/dist/{admin → testSurface}/surface/test/AdvancedSection.js +12 -4
- package/dist/testSurface/surface/test/DeleteTest.d.ts +23 -0
- package/dist/testSurface/surface/test/DeleteTest.js +270 -0
- package/dist/testSurface/surface/test/GoalSection.d.ts +4 -0
- package/dist/{admin → testSurface}/surface/test/GoalSection.js +119 -89
- package/dist/testSurface/surface/test/LengthSection.d.ts +2 -0
- package/dist/{admin → testSurface}/surface/test/LengthSection.js +25 -14
- package/dist/{admin → testSurface}/surface/test/PageHoldout.d.ts +1 -1
- package/dist/{admin → testSurface}/surface/test/PageHoldout.js +11 -8
- package/dist/{admin → testSurface}/surface/test/Rail.js +7 -4
- package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +2 -1
- package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +4 -11
- package/dist/{admin → testSurface}/surface/test/Section.d.ts +3 -1
- package/dist/testSurface/surface/test/Section.js +88 -0
- package/dist/{admin → testSurface}/surface/test/TargetingSection.js +87 -12
- package/dist/testSurface/surface/test/TestSurface.d.ts +19 -0
- package/dist/testSurface/surface/test/TestSurface.js +265 -0
- package/dist/testSurface/surface/test/VersionsSection.d.ts +5 -0
- package/dist/testSurface/surface/test/VersionsSection.js +301 -0
- package/dist/{admin → testSurface}/surface/test/fields.d.ts +33 -9
- package/dist/testSurface/surface/test/fields.js +300 -0
- package/dist/{admin → testSurface}/surface/test/pageParts.js +30 -44
- package/dist/testSurface/surface/test/testPage.css +111 -0
- package/dist/{admin → testSurface}/surface/test/testPage.model.d.ts +1 -0
- package/dist/{admin → testSurface}/surface/test/testPage.model.js +6 -0
- package/dist/{admin → testSurface}/surface/testDocument.model.d.ts +3 -0
- package/dist/{admin → testSurface}/surface/testDocument.model.js +4 -1
- package/dist/testSurface/surface/useTestDocument.d.ts +60 -0
- package/dist/testSurface/surface/useTestDocument.js +782 -0
- package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
- package/dist/testSurface/surface/watchTestDocument.js +181 -0
- package/dist/testSurface/surfaceUrls.d.ts +8 -0
- package/dist/testSurface/surfaceUrls.js +23 -0
- package/dist/{admin → testSurface}/useApi.d.ts +21 -5
- package/dist/testSurface/useOnTestReturn.d.ts +2 -0
- package/dist/testSurface/useOnTestReturn.js +27 -0
- package/dist/testSurface/useReadinessPolling.d.ts +3 -0
- package/dist/testSurface/useReadinessPolling.js +26 -0
- package/dist/transitions/addMetric.d.ts +2 -5
- package/dist/transitions/addMetric.js +5 -1
- package/dist/transitions/allocate.d.ts +2 -2
- package/dist/transitions/allocate.js +3 -1
- package/dist/transitions/archive.d.ts +1 -1
- package/dist/transitions/archive.js +3 -2
- package/dist/transitions/checkStart.d.ts +6 -1
- package/dist/transitions/checkStart.js +133 -17
- package/dist/transitions/contentFields.js +9 -5
- package/dist/transitions/decide.d.ts +1 -1
- package/dist/transitions/decide.js +6 -3
- package/dist/transitions/deleteExperiment.d.ts +2 -2
- package/dist/transitions/deleteExperiment.js +17 -7
- package/dist/transitions/kernel.d.ts +4 -0
- package/dist/transitions/kernel.js +9 -4
- package/dist/transitions/makeContent.d.ts +2 -1
- package/dist/transitions/makeContent.js +41 -17
- package/dist/transitions/nestedPlacementNames.d.ts +5 -0
- package/dist/transitions/nestedPlacementNames.js +32 -0
- package/dist/transitions/pageAddress.d.ts +6 -0
- package/dist/transitions/pageAddress.js +71 -0
- package/dist/transitions/pageVersions.js +3 -1
- package/dist/transitions/phaseRecord.d.ts +2 -0
- package/dist/transitions/phaseRecord.js +5 -0
- package/dist/transitions/placementInteractions.d.ts +3 -3
- package/dist/transitions/placementInteractions.js +16 -12
- package/dist/transitions/placements.d.ts +54 -8
- package/dist/transitions/placements.js +304 -81
- package/dist/transitions/preflightData.d.ts +5 -3
- package/dist/transitions/preflightData.js +137 -40
- package/dist/transitions/releaseHoldout.d.ts +2 -1
- package/dist/transitions/releaseHoldout.js +3 -1
- package/dist/transitions/releasePages.d.ts +2 -1
- package/dist/transitions/releasePages.js +3 -1
- package/dist/transitions/resolveCaps.d.ts +2 -4
- package/dist/transitions/start.d.ts +6 -8
- package/dist/transitions/start.js +72 -35
- package/dist/transitions/startReads.d.ts +7 -0
- package/dist/transitions/startReads.js +28 -0
- package/dist/transitions/stop.d.ts +2 -1
- package/dist/transitions/stop.js +3 -2
- package/dist/types/contracts.d.ts +15 -3
- package/dist/types/endpoints.d.ts +121 -17
- package/dist/types/puck.d.ts +1 -0
- package/dist/types/runtime.d.ts +15 -9
- package/dist/types/snapshot.d.ts +2 -0
- package/dist/types/surface.d.ts +9 -9
- package/dist/ui/Button.js +2 -2
- package/dist/ui/Card.d.ts +2 -1
- package/dist/ui/Card.js +4 -4
- package/dist/ui/ChipsInput.d.ts +8 -1
- package/dist/ui/ChipsInput.js +17 -4
- package/dist/ui/Dialog.d.ts +24 -2
- package/dist/ui/Dialog.js +141 -6
- package/dist/ui/Drawer.d.ts +10 -0
- package/dist/ui/Drawer.js +29 -0
- package/dist/ui/Inputs.d.ts +4 -3
- package/dist/ui/Inputs.js +6 -4
- package/dist/ui/SelectControl.d.ts +33 -0
- package/dist/ui/SelectControl.js +504 -0
- package/dist/ui/Tabs.d.ts +4 -4
- package/dist/ui/Tabs.js +35 -32
- package/dist/ui/ui.css +50 -5
- package/package.json +3 -2
- package/dist/admin/actions/ConfirmDialog.d.ts +0 -19
- package/dist/admin/actions/ConfirmDialog.js +0 -149
- package/dist/admin/actions/DecideDialog.d.ts +0 -10
- package/dist/admin/actions/DecideDialog.js +0 -190
- package/dist/admin/actions/actions.model.js +0 -70
- package/dist/admin/copy/metrics.js +0 -9
- package/dist/admin/copy/pages.d.ts +0 -26
- package/dist/admin/copy/pages.js +0 -26
- package/dist/admin/copy/review.d.ts +0 -17
- package/dist/admin/copy/review.js +0 -17
- package/dist/admin/copy/testPage.js +0 -104
- package/dist/admin/format/date.js +0 -10
- package/dist/admin/results/results.css +0 -64
- package/dist/admin/styles.css +0 -10
- package/dist/admin/styles.d.ts +0 -2
- package/dist/admin/styles.js +0 -3
- package/dist/admin/surface/pageBlock/pageBlock.model.js +0 -8
- package/dist/admin/surface/pageBlock/parts.js +0 -69
- package/dist/admin/surface/pagePicker/CopyRoute.d.ts +0 -6
- package/dist/admin/surface/pagePicker/CopyRoute.js +0 -53
- package/dist/admin/surface/pagePicker/PagePicker.d.ts +0 -10
- package/dist/admin/surface/pagePicker/PagePicker.js +0 -172
- package/dist/admin/surface/readiness/ActionDialogs.js +0 -337
- package/dist/admin/surface/readiness/Banner.js +0 -190
- package/dist/admin/surface/readiness/SaveStatus.d.ts +0 -5
- package/dist/admin/surface/readiness/SaveStatus.js +0 -53
- package/dist/admin/surface/readiness/readiness.model.js +0 -205
- package/dist/admin/surface/readiness/useTransition.d.ts +0 -11
- package/dist/admin/surface/readiness/useTransition.js +0 -35
- package/dist/admin/surface/setting/setting.css +0 -17
- package/dist/admin/surface/test/GoalSection.d.ts +0 -2
- package/dist/admin/surface/test/LengthSection.d.ts +0 -2
- package/dist/admin/surface/test/Section.js +0 -47
- package/dist/admin/surface/test/VersionsSection.d.ts +0 -4
- package/dist/admin/surface/test/VersionsSection.js +0 -247
- package/dist/admin/surface/test/fields.js +0 -216
- package/dist/admin/surface/test/testPage.css +0 -97
- package/dist/admin/surface/useTestDocument.d.ts +0 -32
- package/dist/admin/surface/useTestDocument.js +0 -415
- /package/dist/{admin → testSurface}/allocation.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/arms/arms.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/arms/arms.model.js +0 -0
- /package/dist/{admin → testSurface}/arms/pageTarget.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/arms/pageTarget.model.js +0 -0
- /package/dist/{admin → testSurface}/arms/params.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/arms/params.model.js +0 -0
- /package/dist/{admin → testSurface}/metricSource.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/metricSource.model.js +0 -0
- /package/dist/{admin → testSurface}/placements/placementLabels.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/placements/placementLabels.model.js +0 -0
- /package/dist/{admin → testSurface}/placements/usePlacementLabels.d.ts +0 -0
- /package/dist/{admin → testSurface}/placements/usePlacementLabels.js +0 -0
- /package/dist/{admin → testSurface}/reload.d.ts +0 -0
- /package/dist/{admin → testSurface}/reload.js +0 -0
- /package/dist/{admin → testSurface}/results/CappedCell.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/CappedCell.js +0 -0
- /package/dist/{admin → testSurface}/results/CiChart.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/CiChart.js +0 -0
- /package/dist/{admin → testSurface}/results/DataQualityPanel.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/DataQualityPanel.js +0 -0
- /package/dist/{admin → testSurface}/results/DataTable.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/DataTable.js +0 -0
- /package/dist/{admin → testSurface}/results/StatTile.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/StatTile.js +0 -0
- /package/dist/{admin → testSurface}/results/chart.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/chart.model.js +0 -0
- /package/dist/{admin → testSurface}/results/format.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/format.js +0 -0
- /package/dist/{admin → testSurface}/results/legacy.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/legacy.js +0 -0
- /package/dist/{admin → testSurface}/results/releasePages.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/releasePages.model.js +0 -0
- /package/dist/{admin → testSurface}/results/snapshot.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/snapshot.js +0 -0
- /package/dist/{admin → testSurface}/review/review.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/review/review.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/contracts.js +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/pageBlock.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/recommendation.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/setting/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/setting/setting.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/setting/setting.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/AdvancedSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/Rail.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/TargetingSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/jumpToSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/jumpToSection.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/pageParts.d.ts +0 -0
- /package/dist/{admin → testSurface}/targeting/targeting.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/targeting/targeting.model.js +0 -0
- /package/dist/{admin → testSurface}/theme.d.ts +0 -0
- /package/dist/{admin → testSurface}/theme.js +0 -0
- /package/dist/{admin → testSurface}/useApi.js +0 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { placementReader } from '../blocks/placementLocale.js';
|
|
2
|
+
import { puckExperimentSlug } from '../puck/experimentSlug.js';
|
|
3
|
+
import { puckVisibility } from '../puck/visibility.js';
|
|
1
4
|
import { EXPERIMENT_BLOCK_SLUG, hostBlocks } from '../blocks/model.js';
|
|
2
5
|
import { safeError } from '../log.js';
|
|
3
6
|
import { isDeepStrictEqual } from 'node:util';
|
|
7
|
+
import { XpTransactionIsolationError } from '../db/adapter.js';
|
|
4
8
|
import { appendContentChange, contentChangeSavepoint, previousPublishedContent, runningContentExperiment, storedContent } from '../db/appends.js';
|
|
5
9
|
import { txExecutor } from '../db/executor.js';
|
|
6
10
|
import { pageContentBindings } from '../db/pageBindings.js';
|
|
7
11
|
import { sortLockKeys } from '../db/locks.js';
|
|
8
12
|
import { normalisePath } from '../runtime/normalisePath.js';
|
|
9
13
|
import { comparableContent } from '../transitions/pageVersions.js';
|
|
10
|
-
import {
|
|
14
|
+
import { puckCollections } from '../options.js';
|
|
11
15
|
import { withTransition } from '../transitions/kernel.js';
|
|
12
16
|
import { normaliseContentRelationships } from './normaliseContentRelationships.js';
|
|
13
17
|
const slots = [
|
|
@@ -19,6 +23,7 @@ const slots = [
|
|
|
19
23
|
const object = (value)=>value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
20
24
|
function bindings(data, puck) {
|
|
21
25
|
const found = new Map();
|
|
26
|
+
const visibility = puck ? puckVisibility(data) : undefined;
|
|
22
27
|
function add(field, value, content) {
|
|
23
28
|
const key = field + ':' + value;
|
|
24
29
|
const binding = found.get(key) ?? {
|
|
@@ -34,10 +39,10 @@ function bindings(data, puck) {
|
|
|
34
39
|
value.forEach(walk);
|
|
35
40
|
return;
|
|
36
41
|
}
|
|
37
|
-
if (!object(value)) return;
|
|
42
|
+
if (!object(value) || visibility?.get(value)?.hidden) return;
|
|
38
43
|
if (puck && value.type === 'ExperimentSlot' && object(value.props)) {
|
|
39
44
|
const props = value.props;
|
|
40
|
-
const slug =
|
|
45
|
+
const slug = puckExperimentSlug(props.experiment);
|
|
41
46
|
if (typeof slug === 'string' && slug) add('slug', slug, {
|
|
42
47
|
id: props.id,
|
|
43
48
|
...Object.fromEntries(slots.map((slot)=>[
|
|
@@ -77,11 +82,17 @@ const baselineKey = (collection, id)=>`${collection}:${id}`;
|
|
|
77
82
|
doc: audit.result
|
|
78
83
|
};
|
|
79
84
|
}
|
|
80
|
-
/** Publish-only host helper. Audit failures are logged
|
|
85
|
+
/** Publish-only host helper. Audit failures are logged after savepoint recovery. */ export async function recordContentChange(args) {
|
|
81
86
|
try {
|
|
82
87
|
await auditContentChange(args);
|
|
83
88
|
} catch (error) {
|
|
84
|
-
|
|
89
|
+
try {
|
|
90
|
+
// The isolation check already logged the reason once for this transaction.
|
|
91
|
+
if (error instanceof XpTransactionIsolationError) return;
|
|
92
|
+
} catch {}
|
|
93
|
+
try {
|
|
94
|
+
console.error('[payload-experiments] contentChanges failed; the document was saved without it', safeError(error));
|
|
95
|
+
} catch {}
|
|
85
96
|
}
|
|
86
97
|
}
|
|
87
98
|
async function auditContentChange({ doc, previousDoc, req, collection }) {
|
|
@@ -102,9 +113,10 @@ async function auditContentChange({ doc, previousDoc, req, collection }) {
|
|
|
102
113
|
}
|
|
103
114
|
const options = req.payload.config.custom?.xp;
|
|
104
115
|
const registration = puckCollections(options ?? {}).find((entry)=>entry.slug === collection.slug);
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
const
|
|
116
|
+
const reader = placementReader(req, collection.slug, options ?? {});
|
|
117
|
+
const changesOne = (previous, current)=>{
|
|
118
|
+
const after = bindings(registration && object(current) ? current[registration.field] : current, Boolean(registration) && reader.read(object(current) ? current : undefined, 'localized').editor === 'puck');
|
|
119
|
+
const before = bindings(registration && object(previous) ? previous[registration.field] : previous, Boolean(registration) && reader.read(object(previous) ? previous : undefined, 'localized').editor === 'puck');
|
|
108
120
|
const blockRegistration = options?.blocks?.collections.find((entry)=>entry.slug === collection.slug);
|
|
109
121
|
for (const [row, found] of [
|
|
110
122
|
[
|
|
@@ -116,7 +128,7 @@ async function auditContentChange({ doc, previousDoc, req, collection }) {
|
|
|
116
128
|
after
|
|
117
129
|
]
|
|
118
130
|
]){
|
|
119
|
-
if (!blockRegistration || !object(row) ||
|
|
131
|
+
if (!blockRegistration || !object(row) || reader.read(row, 'localized').editor !== 'blocks') continue;
|
|
120
132
|
for (const block of hostBlocks(row[blockRegistration.field])){
|
|
121
133
|
if (block.blockType !== (blockRegistration.blockSlug ?? EXPERIMENT_BLOCK_SLUG) || typeof block.experiment !== 'string') continue;
|
|
122
134
|
const key = 'slug:' + block.experiment;
|
|
@@ -136,6 +148,9 @@ async function auditContentChange({ doc, previousDoc, req, collection }) {
|
|
|
136
148
|
])
|
|
137
149
|
].filter((key)=>!isDeepStrictEqual(before.get(key)?.contents, after.get(key)?.contents)).map((key)=>after.get(key) ?? before.get(key));
|
|
138
150
|
};
|
|
151
|
+
const changes = (previous, current, input)=>(input === 'all-locales' ? reader.documentViews : [
|
|
152
|
+
undefined
|
|
153
|
+
]).flatMap((view)=>changesOne(reader.read(object(previous) ? previous : undefined, input, view).doc, reader.read(object(current) ? current : undefined, input, view).doc));
|
|
139
154
|
// Include discovery reads in the savepoint: a SQL read error also aborts Postgres.
|
|
140
155
|
// An explicit host call must supply its afterChange request's transaction.
|
|
141
156
|
const executor = txExecutor(req);
|
|
@@ -152,11 +167,11 @@ async function auditContentChange({ doc, previousDoc, req, collection }) {
|
|
|
152
167
|
if (!current) throw new Error('The saved content row was not found.');
|
|
153
168
|
beforeRow = baseline.doc;
|
|
154
169
|
afterRow = current;
|
|
155
|
-
changed = changes(beforeRow, afterRow);
|
|
170
|
+
changed = changes(beforeRow, afterRow, 'all-locales');
|
|
156
171
|
} else {
|
|
157
172
|
beforeRow = normalise(previousDoc);
|
|
158
173
|
afterRow = normalise(doc);
|
|
159
|
-
changed = changes(beforeRow, afterRow);
|
|
174
|
+
changed = changes(beforeRow, afterRow, 'localized');
|
|
160
175
|
}
|
|
161
176
|
const experiments = new Map();
|
|
162
177
|
for (const binding of changed){
|
|
@@ -164,17 +179,26 @@ async function auditContentChange({ doc, previousDoc, req, collection }) {
|
|
|
164
179
|
if (experiment) experiments.set(String(experiment.id), experiment.id);
|
|
165
180
|
}
|
|
166
181
|
const page = options?.pages?.collections.find((entry)=>entry.slug === collection.slug);
|
|
167
|
-
if (page?.contentOf
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
182
|
+
if (page?.contentOf) {
|
|
183
|
+
const input = baseline || req.locale === 'all' ? 'all-locales' : 'localized';
|
|
184
|
+
const paths = new Set();
|
|
185
|
+
for (const view of input === 'all-locales' ? reader.documentViews : [
|
|
186
|
+
undefined
|
|
187
|
+
]){
|
|
188
|
+
const before = reader.read(object(beforeRow) ? beforeRow : undefined, input, view).doc;
|
|
189
|
+
const after = reader.read(object(afterRow) ? afterRow : undefined, input, view).doc;
|
|
190
|
+
if (isDeepStrictEqual(comparableContent(before ? page.contentOf(before) : undefined), comparableContent(after ? page.contentOf(after) : undefined))) continue;
|
|
191
|
+
for (const doc of [
|
|
192
|
+
before,
|
|
193
|
+
after
|
|
194
|
+
]){
|
|
195
|
+
const path = doc ? page.pathOf(doc) : null;
|
|
196
|
+
if (path !== null) paths.add(normalisePath(path));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (paths.size) for (const id of (await pageContentBindings(executor, collection.slug, sortLockKeys([
|
|
200
|
+
...paths
|
|
201
|
+
]))))experiments.set(String(id), id);
|
|
178
202
|
}
|
|
179
203
|
// Successful audit locks persist until commit; acquire multiple E locks in order.
|
|
180
204
|
for (const key of sortLockKeys([
|
|
@@ -186,6 +210,8 @@ async function auditContentChange({ doc, previousDoc, req, collection }) {
|
|
|
186
210
|
bump: false,
|
|
187
211
|
audit: true
|
|
188
212
|
}, async ({ exec })=>{
|
|
213
|
+
// Keep the recheck and append on the executor. A failed nested Local API
|
|
214
|
+
// call would kill the host transaction before the savepoint could recover.
|
|
189
215
|
const experiment = await runningContentExperiment(exec, {
|
|
190
216
|
field: 'id',
|
|
191
217
|
value: experimentId
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BLOCK_SLOTS, EXPERIMENT_BLOCK_SLUG, hostBlocks, slotBlocks } from '../blocks/model.js';
|
|
2
|
-
import {
|
|
2
|
+
import { suppressExposure } from './context.js';
|
|
3
3
|
export function resolveExperimentBlocks(blocks, assignments, { blockSlug = EXPERIMENT_BLOCK_SLUG } = {}) {
|
|
4
4
|
const result = {
|
|
5
5
|
blocks: [],
|
|
@@ -18,10 +18,8 @@ export function resolveExperimentBlocks(blocks, assignments, { blockSlug = EXPER
|
|
|
18
18
|
}
|
|
19
19
|
const slug = typeof block.experiment === 'string' ? block.experiment : '';
|
|
20
20
|
const assignment = Object.hasOwn(assignments.bySlug, slug) ? assignments.bySlug[slug] : undefined;
|
|
21
|
-
const experiment = manifestOf(assignments)?.experiments.find((e)=>e.slug === slug);
|
|
22
|
-
const arm = experiment?.arms.find((a)=>a.key === assignment?.arm);
|
|
23
21
|
const archived = Object.hasOwn(assignments.archivedWinners, slug) ? assignments.archivedWinners[slug] : undefined;
|
|
24
|
-
const slot = assignment ? assignment.arm === 'holdout' ? 'control' :
|
|
22
|
+
const slot = assignment ? assignment.arm === 'holdout' ? 'control' : assignment.arm : archived ?? 'control';
|
|
25
23
|
const selected = BLOCK_SLOTS.includes(slot) ? slotBlocks(block, slot) : [];
|
|
26
24
|
const content = selected.length ? selected : slotBlocks(block, 'control');
|
|
27
25
|
const group = {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { puckExperimentSlug } from '../puck/experimentSlug.js';
|
|
2
|
+
import { puckVisibility } from '../puck/visibility.js';
|
|
3
|
+
import { suppressExposure } from './context.js';
|
|
2
4
|
export function resolveExperimentData(puckData, assignments) {
|
|
5
|
+
const visibility = puckVisibility(puckData);
|
|
3
6
|
const rendered = new Map();
|
|
4
7
|
const slots = [
|
|
5
8
|
'control',
|
|
@@ -7,10 +10,10 @@ export function resolveExperimentData(puckData, assignments) {
|
|
|
7
10
|
'variantB',
|
|
8
11
|
'variantC'
|
|
9
12
|
];
|
|
10
|
-
const manifest = manifestOf(assignments);
|
|
11
13
|
function walk(value) {
|
|
12
|
-
if (Array.isArray(value)) return value.map(walk);
|
|
14
|
+
if (Array.isArray(value)) return value.map(walk).filter((item)=>item !== undefined);
|
|
13
15
|
if (!value || typeof value !== 'object') return value;
|
|
16
|
+
if (visibility.get(value)?.hidden) return undefined;
|
|
14
17
|
const node = value;
|
|
15
18
|
if (node.type !== 'ExperimentSlot') return Object.fromEntries(Object.entries(node).map(([key, item])=>[
|
|
16
19
|
key,
|
|
@@ -24,13 +27,10 @@ export function resolveExperimentData(puckData, assignments) {
|
|
|
24
27
|
delete clean.xpSlot;
|
|
25
28
|
delete clean.xpArm;
|
|
26
29
|
delete clean.xpExpose;
|
|
27
|
-
const
|
|
28
|
-
const slug = typeof ref?.slug === 'string' ? ref.slug : undefined;
|
|
30
|
+
const slug = puckExperimentSlug(props.experiment);
|
|
29
31
|
const assignment = slug && Object.hasOwn(assignments.bySlug, slug) ? assignments.bySlug[slug] : undefined;
|
|
30
|
-
const experiment = manifest?.experiments.find((e)=>e.slug === slug);
|
|
31
|
-
const arm = experiment?.arms.find((a)=>a.key === assignment?.arm);
|
|
32
32
|
const archived = slug && Object.hasOwn(assignments.archivedWinners, slug) ? assignments.archivedWinners[slug] : undefined;
|
|
33
|
-
const selected = assignment ? assignment.arm === 'holdout' ? 'control' :
|
|
33
|
+
const selected = assignment ? assignment.arm === 'holdout' ? 'control' : assignment.arm : archived ?? 'control';
|
|
34
34
|
const slot = slots.includes(selected) ? selected : 'control';
|
|
35
35
|
clean.xpSlot = slot;
|
|
36
36
|
if (assignment) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { asymmetricGoal, goalContent, goalPlacementDetail, LEGACY_FAIRNESS } from '../goals/fairness.js';
|
|
2
2
|
import { XpAnalysisError } from '../errors.js';
|
|
3
|
-
import { canonicalHealth, mergePageHealth } from '../results/health.js';
|
|
3
|
+
import { canonicalHealth, mergePageHealth, rapidBrowserEvents } from '../results/health.js';
|
|
4
4
|
import { safeError } from '../log.js';
|
|
5
5
|
import { createLocalReq } from 'payload';
|
|
6
6
|
import { resultsCandidates, resultsExecutor, writeSnapshots } from '../db/snapshots.js';
|
|
@@ -11,6 +11,14 @@ import { analysePhase } from '../results/analyse.js';
|
|
|
11
11
|
import { firstExposures, perUnitValues, timestampMs } from '../results/aggregate.js';
|
|
12
12
|
import { rolloutAnalysisUnits } from '../results/rolloutUnits.js';
|
|
13
13
|
import { creditUserEvents, eligibleIdentityLinks } from '../results/identityCredit.js';
|
|
14
|
+
function* convertingUnits(units, values, ages) {
|
|
15
|
+
for (const [id, value] of values){
|
|
16
|
+
if (value > 0) yield {
|
|
17
|
+
arm: units.get(id).arm,
|
|
18
|
+
unitAgeMs: ages.get(id)?.unitAgeMs
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
14
22
|
async function analyseCandidate(exec, candidate, options, now, deadline, unavailableMetrics, logger) {
|
|
15
23
|
const { phase } = candidate;
|
|
16
24
|
// Rollout assignment preserves the original test ranges, but its SRM compares
|
|
@@ -53,6 +61,10 @@ async function analyseCandidate(exec, candidate, options, now, deadline, unavail
|
|
|
53
61
|
...units
|
|
54
62
|
].filter(([id])=>eligible.has(id)));
|
|
55
63
|
}
|
|
64
|
+
const comparedArms = new Set(analysisPhase.arms.filter((arm)=>phase.phaseKind === 'rollout' || arm.kind !== 'holdout').map((arm)=>arm.key));
|
|
65
|
+
// An age on an exposure is only written by browser ingestion, including
|
|
66
|
+
// browser-side manual exposures. Server-recorded exposures have unknown age.
|
|
67
|
+
let rapidActivity = rapidBrowserEvents(comparedArms, units.values());
|
|
56
68
|
const ids = [
|
|
57
69
|
...units.keys()
|
|
58
70
|
];
|
|
@@ -93,9 +105,8 @@ async function analyseCandidate(exec, candidate, options, now, deadline, unavail
|
|
|
93
105
|
// browser even if an earlier linked browser saw another arm or is ineligible.
|
|
94
106
|
const direct = userKeyed ? [] : events.filter((event)=>units.has(event.unitId) || event.userId == null || !linked.has(event.userId));
|
|
95
107
|
const userEvents = events.filter((event)=>userKeyed || !units.has(event.unitId) && event.userId != null && linked.has(event.userId)).map((event)=>({
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
ts: event.ts
|
|
108
|
+
...event,
|
|
109
|
+
userId: String(event.userId ?? event.unitId)
|
|
99
110
|
}));
|
|
100
111
|
const credited = creditUserEvents(units, identities, userEvents, (userId)=>identityConflicts.add(userId)).events;
|
|
101
112
|
for (const event of direct)if (event.userId != null && linked.has(event.userId)) {
|
|
@@ -121,8 +132,10 @@ async function analyseCandidate(exec, candidate, options, now, deadline, unavail
|
|
|
121
132
|
...units.values()
|
|
122
133
|
].reduce((earliest, unit)=>Math.min(earliest, +unit.firstTs), timestampMs(phase.startedAt)));
|
|
123
134
|
const preFrom = new Date(+from - 14 * 86_400_000);
|
|
135
|
+
const storedEvents = definition.source.startsWith('events:') || definition.source.startsWith('click:');
|
|
136
|
+
const readAge = storedEvents && definition.role === 'primary' && !rapidActivity;
|
|
124
137
|
let events, covariates;
|
|
125
|
-
if (
|
|
138
|
+
if (storedEvents) {
|
|
126
139
|
const eventName = definition.source.startsWith('click:') ? definition.source : definition.source.slice(7);
|
|
127
140
|
if (!definition.source.startsWith('click:') && !options.eventSources?.some((source)=>source.name === eventName)) throw new XpAnalysisError('source-unavailable');
|
|
128
141
|
const read = async (start)=>{
|
|
@@ -130,19 +143,24 @@ async function analyseCandidate(exec, candidate, options, now, deadline, unavail
|
|
|
130
143
|
eventName,
|
|
131
144
|
userIds: ids,
|
|
132
145
|
from: start,
|
|
133
|
-
to
|
|
146
|
+
to,
|
|
147
|
+
readAge
|
|
134
148
|
});
|
|
135
149
|
const direct = await metricEventRows(exec, {
|
|
136
150
|
eventName,
|
|
137
151
|
unitIds: ids,
|
|
138
152
|
from: start,
|
|
139
|
-
to
|
|
153
|
+
to,
|
|
154
|
+
readAge,
|
|
155
|
+
forVisitors: true
|
|
140
156
|
});
|
|
141
157
|
const signedIn = await metricEventRows(exec, {
|
|
142
158
|
eventName,
|
|
143
159
|
userIds,
|
|
144
160
|
from: start,
|
|
145
|
-
to
|
|
161
|
+
to,
|
|
162
|
+
readAge,
|
|
163
|
+
forVisitors: true
|
|
146
164
|
});
|
|
147
165
|
// The two lookups overlap when a linked user's own browser was exposed.
|
|
148
166
|
return [
|
|
@@ -226,13 +244,26 @@ async function analyseCandidate(exec, candidate, options, now, deadline, unavail
|
|
|
226
244
|
// The click-goal delta supersedes whole-phase attribution for mid-test adds.
|
|
227
245
|
// Retain pre-period events for CUPED above; exclude them from the outcome.
|
|
228
246
|
const outcomeEvents = definition.source.startsWith('click:') && definition.addedAt ? events.filter((event)=>timestampMs(event.ts) >= timestampMs(definition.addedAt)) : events;
|
|
247
|
+
const ages = new Map();
|
|
248
|
+
const values = perUnitValues(units, outcomeEvents, {
|
|
249
|
+
kind,
|
|
250
|
+
windowHours,
|
|
251
|
+
endedAt: to,
|
|
252
|
+
onAttributed: readAge ? (event, ts)=>{
|
|
253
|
+
if (event.unitAgeMs === undefined) return;
|
|
254
|
+
const previous = ages.get(event.unitId);
|
|
255
|
+
if (!previous || ts < previous.ts || ts === previous.ts && event.unitAgeMs > previous.unitAgeMs) {
|
|
256
|
+
ages.set(event.unitId, {
|
|
257
|
+
ts,
|
|
258
|
+
unitAgeMs: event.unitAgeMs
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
} : undefined
|
|
262
|
+
});
|
|
263
|
+
if (ages.size) rapidActivity = rapidBrowserEvents(comparedArms, convertingUnits(units, values, ages));
|
|
229
264
|
metricData.push({
|
|
230
265
|
metricId: definition.metricId,
|
|
231
|
-
values
|
|
232
|
-
kind,
|
|
233
|
-
windowHours,
|
|
234
|
-
endedAt: to
|
|
235
|
-
}),
|
|
266
|
+
values,
|
|
236
267
|
...covariates ? {
|
|
237
268
|
covariates
|
|
238
269
|
} : {}
|
|
@@ -284,9 +315,15 @@ async function analyseCandidate(exec, candidate, options, now, deadline, unavail
|
|
|
284
315
|
armMismatch: await armMismatchCount(exec, query),
|
|
285
316
|
identityConflictShare: userIds.length ? identityConflicts.size / userIds.length : 0,
|
|
286
317
|
...phase.phaseKind === 'rollout' ? {
|
|
287
|
-
winnerArm: phase.arms.find((arm)=>arm.kind !== 'holdout').key
|
|
318
|
+
winnerArm: phase.arms.find((arm)=>arm.kind !== 'holdout').key,
|
|
319
|
+
controlLabel: candidate.testArms.find((arm)=>arm.kind === 'control')?.label
|
|
288
320
|
} : {}
|
|
289
321
|
});
|
|
322
|
+
if (rapidActivity) snapshot.health = [
|
|
323
|
+
{
|
|
324
|
+
code: 'rapid-browser-events'
|
|
325
|
+
}
|
|
326
|
+
];
|
|
290
327
|
return snapshot;
|
|
291
328
|
}
|
|
292
329
|
export async function runResults(payload, { budgetMs = 20_000, experimentId, sweep = true } = {}) {
|
|
@@ -407,10 +444,12 @@ export async function runResults(payload, { budgetMs = 20_000, experimentId, swe
|
|
|
407
444
|
for (const [index, snapshot] of snapshots.entries()){
|
|
408
445
|
const previous = phases[index].previousHealth ?? phases[index].frozenSnapshot?.health ?? [];
|
|
409
446
|
const unjudged = previous.filter((row)=>row.code === 'goal-in-some-versions' && content && content.unchecked.length > 0 && clicks.some((metric)=>metric.metricId === row.metricId && !asymmetricGoal(content, metric.source, arms)));
|
|
447
|
+
const activity = snapshot.health?.filter((row)=>row.code === 'rapid-browser-events') ?? [];
|
|
410
448
|
snapshot.health = mergePageHealth(unjudged, [
|
|
411
449
|
...health,
|
|
412
450
|
...goals,
|
|
413
|
-
...unchecked
|
|
451
|
+
...unchecked,
|
|
452
|
+
...activity
|
|
414
453
|
]);
|
|
415
454
|
if (content?.skipped && current.kind === 'block') snapshot.goalFairnessNotice = LEGACY_FAIRNESS;
|
|
416
455
|
else delete snapshot.goalFairnessNotice;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Payload, type PayloadRequest } from 'payload';
|
|
2
|
+
import type { DocId } from '../types/contracts.js';
|
|
3
|
+
import type { StartExperimentResult } from '../types/endpoints.js';
|
|
4
|
+
/** Start a test from trusted host code. Call this after your own transaction commits.
|
|
5
|
+
* Pass the caller's Payload request if available so an open transaction can be refused.
|
|
6
|
+
* Without it, Start can hang waiting for a lock your transaction already holds.
|
|
7
|
+
* If a thrown error has code `commit-unverified`, read the test's status before retrying.
|
|
8
|
+
* Start may have committed even though it could not verify the commit.
|
|
9
|
+
*/
|
|
10
|
+
export declare function startExperiment(payload: Payload, { experiment, req, onlyIfNeverStarted }: {
|
|
11
|
+
experiment: {
|
|
12
|
+
id: DocId;
|
|
13
|
+
} | {
|
|
14
|
+
slug: string;
|
|
15
|
+
};
|
|
16
|
+
/** Pass the caller's request, if available, to detect an open transaction. */
|
|
17
|
+
req?: Pick<PayloadRequest, 'transactionID'>;
|
|
18
|
+
/** Require a draft with no prior round. By default, a stopped test can start a new round. */
|
|
19
|
+
onlyIfNeverStarted?: boolean;
|
|
20
|
+
}): Promise<StartExperimentResult>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { createLocalReq } from 'payload';
|
|
2
|
+
import { experimentId } from '../endpoints/routeId.js';
|
|
3
|
+
import { XpRefusal, XpStartTransactionOpen } from '../errors.js';
|
|
4
|
+
import { xpOptionsFromReq } from '../options/fromReq.js';
|
|
5
|
+
import { start } from '../transitions/start.js';
|
|
6
|
+
import { findStartDocuments } from '../transitions/startReads.js';
|
|
7
|
+
/** Start a test from trusted host code. Call this after your own transaction commits.
|
|
8
|
+
* Pass the caller's Payload request if available so an open transaction can be refused.
|
|
9
|
+
* Without it, Start can hang waiting for a lock your transaction already holds.
|
|
10
|
+
* If a thrown error has code `commit-unverified`, read the test's status before retrying.
|
|
11
|
+
* Start may have committed even though it could not verify the commit.
|
|
12
|
+
*/ export async function startExperiment(payload, { experiment, req, onlyIfNeverStarted }) {
|
|
13
|
+
try {
|
|
14
|
+
if (req?.transactionID != null) throw new XpStartTransactionOpen();
|
|
15
|
+
const systemReq = await createLocalReq({}, payload);
|
|
16
|
+
const options = xpOptionsFromReq(systemReq);
|
|
17
|
+
const id = 'id' in experiment ? experimentId(systemReq, experiment.id) : (await findStartDocuments(systemReq, {
|
|
18
|
+
collection: 'xp-experiments',
|
|
19
|
+
depth: 0,
|
|
20
|
+
limit: 1,
|
|
21
|
+
where: {
|
|
22
|
+
slug: {
|
|
23
|
+
equals: experiment.slug
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}, true)).docs[0]?.id;
|
|
27
|
+
if (id === undefined) return {
|
|
28
|
+
status: 'not-found'
|
|
29
|
+
};
|
|
30
|
+
const { doc, revision, detail } = await start(systemReq, {
|
|
31
|
+
experimentId: id,
|
|
32
|
+
options,
|
|
33
|
+
system: true,
|
|
34
|
+
onlyIfNeverStarted
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
status: 'started',
|
|
38
|
+
phase: doc.phase,
|
|
39
|
+
revision,
|
|
40
|
+
warnings: detail ?? []
|
|
41
|
+
};
|
|
42
|
+
} catch (error) {
|
|
43
|
+
if (error instanceof XpStartTransactionOpen) return {
|
|
44
|
+
status: 'refused',
|
|
45
|
+
code: 'transaction-open',
|
|
46
|
+
message: error.message
|
|
47
|
+
};
|
|
48
|
+
if (!(error instanceof XpRefusal) || error.status === 500 || error.code === 'commit-unverified') throw error;
|
|
49
|
+
if (error.code === 'not-found') return {
|
|
50
|
+
status: 'not-found'
|
|
51
|
+
};
|
|
52
|
+
const { code, message, detail } = error;
|
|
53
|
+
if (code === 'first-start-only') {
|
|
54
|
+
return {
|
|
55
|
+
status: 'refused',
|
|
56
|
+
code,
|
|
57
|
+
message,
|
|
58
|
+
detail: detail
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
status: 'refused',
|
|
63
|
+
code,
|
|
64
|
+
message,
|
|
65
|
+
...detail === undefined ? {} : {
|
|
66
|
+
detail
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { safeError } from '../log.js';
|
|
2
2
|
import { NextRequest } from 'next/server.js';
|
|
3
3
|
import { pooledExecutor } from '../db/executor.js';
|
|
4
|
-
import {
|
|
4
|
+
import { insertServerConversion } from '../db/events.js';
|
|
5
5
|
import { readUnitCookie } from '../runtime/cookie.js';
|
|
6
6
|
export async function trackConversion(serverRuntime, event) {
|
|
7
7
|
let payload;
|
|
@@ -46,18 +46,15 @@ export async function trackConversion(serverRuntime, event) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
if (!visitorId && !userId) return;
|
|
49
|
-
await
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
ts: new Date().toISOString()
|
|
59
|
-
}
|
|
60
|
-
], (message)=>payload.logger.error(message));
|
|
49
|
+
await insertServerConversion(pooledExecutor(payload), {
|
|
50
|
+
eventName: event.eventName,
|
|
51
|
+
value: event.value ?? 1,
|
|
52
|
+
unitId: visitorId ?? userId,
|
|
53
|
+
unitType: visitorId ? 'visitor' : 'user',
|
|
54
|
+
userId,
|
|
55
|
+
idempotencyKey: event.idempotencyKey,
|
|
56
|
+
ts: new Date().toISOString()
|
|
57
|
+
}, (message)=>payload.logger.error(message));
|
|
61
58
|
} catch (error) {
|
|
62
59
|
try {
|
|
63
60
|
payload?.logger.error({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DocId } from '../types/contracts.js';
|
|
2
2
|
import type { PreflightResult } from '../types/endpoints.js';
|
|
3
|
-
export declare function PreviewLinks({ experimentId, placements, arms, flagPoint, apiRoute }: {
|
|
3
|
+
export declare function PreviewLinks({ experimentId, placements, arms, flagPoint, apiRoute, showEditLinks }: {
|
|
4
|
+
showEditLinks?: boolean;
|
|
4
5
|
apiRoute: string;
|
|
5
6
|
flagPoint?: string;
|
|
6
7
|
experimentId: DocId;
|
|
@@ -5,10 +5,11 @@ import { Button } from '../ui/Button.js';
|
|
|
5
5
|
import { armLabel } from './labels.js';
|
|
6
6
|
import { useApi } from './useApi.js';
|
|
7
7
|
import { REVIEW_COPY as C } from './copy/review.js';
|
|
8
|
+
import { placementLabel } from './placementLabel.js';
|
|
8
9
|
import { TEST_PAGE } from './copy/testPage.js';
|
|
9
10
|
import { API_MESSAGES, refusalMessage } from './copy/common.js';
|
|
10
11
|
import { actionablePreviewPages } from './previewLinks.model.js';
|
|
11
|
-
export function PreviewLinks({ experimentId, placements, arms, flagPoint, apiRoute }) {
|
|
12
|
+
export function PreviewLinks({ experimentId, placements, arms, flagPoint, apiRoute, showEditLinks = true }) {
|
|
12
13
|
const api = useApi(apiRoute);
|
|
13
14
|
const inFlight = useRef(false);
|
|
14
15
|
const [busy, setBusy] = useState(false);
|
|
@@ -55,15 +56,16 @@ export function PreviewLinks({ experimentId, placements, arms, flagPoint, apiRou
|
|
|
55
56
|
setBusy(false);
|
|
56
57
|
}
|
|
57
58
|
}
|
|
59
|
+
const pages = actionablePreviewPages(placements, flagPoint);
|
|
58
60
|
return /*#__PURE__*/ _jsxs("div", {
|
|
59
61
|
className: "xp-preview-links",
|
|
60
62
|
children: [
|
|
61
|
-
|
|
63
|
+
pages.map((placement)=>/*#__PURE__*/ _jsxs("div", {
|
|
62
64
|
className: "xp-preview-row",
|
|
63
65
|
children: [
|
|
64
66
|
/*#__PURE__*/ _jsxs("p", {
|
|
65
67
|
children: [
|
|
66
|
-
placement
|
|
68
|
+
placementLabel(placement),
|
|
67
69
|
placement.slotCount > 1 ? ` ${C.placedTimes(placement.slotCount)}` : null
|
|
68
70
|
]
|
|
69
71
|
}),
|
|
@@ -73,6 +75,7 @@ export function PreviewLinks({ experimentId, placements, arms, flagPoint, apiRou
|
|
|
73
75
|
placement.url ? arms.filter((arm)=>arm.kind !== 'holdout' && arm.key !== 'holdout').map((arm)=>/*#__PURE__*/ _jsxs(Button, {
|
|
74
76
|
variant: "secondary",
|
|
75
77
|
size: "sm",
|
|
78
|
+
"aria-label": pages.length > 1 ? `${C.preview} ${arm.label?.trim() || armLabel(arm.key)}: ${placementLabel(placement)}` : undefined,
|
|
76
79
|
disabled: busy,
|
|
77
80
|
onClick: ()=>{
|
|
78
81
|
void preview(placement.url, arm.key);
|
|
@@ -83,10 +86,11 @@ export function PreviewLinks({ experimentId, placements, arms, flagPoint, apiRou
|
|
|
83
86
|
arm.label?.trim() || armLabel(arm.key)
|
|
84
87
|
]
|
|
85
88
|
}, arm.key)) : null,
|
|
86
|
-
placement.editorUrl ? /*#__PURE__*/ _jsx(Button, {
|
|
87
|
-
variant: "
|
|
89
|
+
showEditLinks && placement.editorUrl ? /*#__PURE__*/ _jsx(Button, {
|
|
90
|
+
variant: "secondary",
|
|
88
91
|
size: "sm",
|
|
89
92
|
href: placement.editorUrl,
|
|
93
|
+
"aria-label": pages.length > 1 ? `${TEST_PAGE.editOnPage}: ${placementLabel(placement)}` : undefined,
|
|
90
94
|
children: TEST_PAGE.editOnPage
|
|
91
95
|
}) : null
|
|
92
96
|
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DocId } from '../../types/contracts.js';
|
|
2
|
+
import type { ResultsResponse, PreflightResult } from '../../types/endpoints.js';
|
|
3
|
+
import { type ActionGroup } from './actions.model.js';
|
|
4
|
+
export declare function DecideDialog({ id, name, phase, arms, results, checks, unavailable, pending, onClose, apiRoute, onSuccess, onRefusal }: {
|
|
5
|
+
apiRoute: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
phase?: number;
|
|
8
|
+
onRefusal?: () => void;
|
|
9
|
+
unavailable?: boolean;
|
|
10
|
+
pending?: boolean;
|
|
11
|
+
onSuccess?: (doc?: Record<string, unknown>) => void;
|
|
12
|
+
id: DocId;
|
|
13
|
+
arms?: readonly ActionGroup[];
|
|
14
|
+
results?: ResultsResponse;
|
|
15
|
+
checks?: PreflightResult['checks'];
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
}): import("react").JSX.Element;
|