@delmaredigital/payload-experiments 0.4.0-rc.1 → 0.4.0-rc.10
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 +2 -2
- 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 +6 -1
- package/dist/admin/copy/goals.js +10 -3
- package/dist/admin/copy/newTest.d.ts +6 -7
- package/dist/admin/copy/newTest.js +9 -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.js +5 -2
- package/dist/admin/surface/TestRowMenu.d.ts +6 -0
- package/dist/admin/surface/TestRowMenu.js +156 -0
- package/dist/admin/surface/TestsHome.d.ts +5 -3
- package/dist/admin/surface/TestsHome.js +266 -58
- package/dist/admin/surface/TestsSurface.js +8 -7
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -1
- package/dist/admin/surface/goals/GoalForm.js +95 -54
- package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
- package/dist/admin/surface/goals/GoalsList.js +5 -4
- package/dist/admin/surface/goals/data.js +2 -2
- package/dist/admin/surface/goals/goals.css +7 -0
- package/dist/admin/surface/goals/goals.model.d.ts +11 -1
- package/dist/admin/surface/goals/goals.model.js +43 -0
- package/dist/admin/surface/home.model.d.ts +9 -8
- package/dist/admin/surface/home.model.js +22 -21
- package/dist/admin/surface/newTest/NewTest.d.ts +4 -4
- package/dist/admin/surface/newTest/NewTest.js +98 -94
- package/dist/admin/surface/newTest/PageWizard.d.ts +2 -1
- package/dist/admin/surface/newTest/PageWizard.js +111 -76
- package/dist/admin/surface/newTest/newTest.css +28 -9
- package/dist/admin/surface/results/ResultsHeader.d.ts +2 -2
- package/dist/admin/surface/results/ResultsHeader.js +58 -54
- package/dist/admin/surface/surface.css +10 -0
- package/dist/admin/surface/test/TestPage.d.ts +1 -2
- package/dist/admin/surface/test/TestPage.js +42 -162
- 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 +11 -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/formState.js +1 -1
- 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 +16 -4
- package/dist/collections/metricsGuards.js +2 -0
- package/dist/collections/serialize.js +5 -4
- 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 +1 -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/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 +19 -20
- 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.js +951 -179
- 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 +57 -0
- package/dist/puck/editor/ResultsReadout.d.ts +2 -1
- package/dist/puck/editor/ResultsReadout.js +10 -6
- package/dist/puck/editor/VersionBuilder.d.ts +66 -12
- package/dist/puck/editor/VersionBuilder.js +554 -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 +64 -19
- package/dist/puck/editor/copy.js +72 -20
- package/dist/puck/editor/createTest.d.ts +3 -0
- package/dist/puck/editor/createTest.js +33 -0
- package/dist/puck/editor/editor.chrome.css +191 -19
- package/dist/puck/editor/editor.css +328 -24
- 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 +1 -1
- package/dist/puck/slotConfig.js +17 -4
- 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/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.js +2 -1
- 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 +52 -14
- 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.js +6 -2
- package/dist/testSurface/actions/DecideDialog.d.ts +16 -0
- package/dist/{admin → testSurface}/actions/DecideDialog.js +78 -55
- package/dist/testSurface/actions/LifecycleAction.d.ts +16 -0
- package/dist/testSurface/actions/LifecycleAction.js +105 -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 +122 -0
- 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 +28 -8
- package/dist/{admin → testSurface}/copy/actions.js +31 -11
- package/dist/{admin → testSurface}/copy/common.d.ts +13 -4
- package/dist/{admin → testSurface}/copy/common.js +18 -8
- 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 +1 -0
- package/dist/{admin → testSurface}/copy/metrics.js +1 -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 +38 -4
- package/dist/{admin → testSurface}/copy/readiness.js +52 -7
- package/dist/{admin → testSurface}/copy/results.d.ts +6 -3
- package/dist/{admin → testSurface}/copy/results.js +6 -3
- package/dist/{admin → testSurface}/copy/review.d.ts +1 -1
- package/dist/{admin → testSurface}/copy/review.js +1 -1
- package/dist/{admin → testSurface}/copy/surface.d.ts +11 -2
- package/dist/{admin → testSurface}/copy/surface.js +13 -10
- package/dist/{admin → testSurface}/copy/testPage.d.ts +53 -8
- package/dist/testSurface/copy/testPage.js +165 -0
- package/dist/testSurface/format/adminURL.d.ts +7 -0
- package/dist/testSurface/format/adminURL.js +9 -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.js +6 -2
- 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/{admin → testSurface}/surface/pageBlock/parts.js +39 -11
- 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 +503 -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 +8 -4
- package/dist/testSurface/surface/readiness/ActionDialogs.js +351 -0
- package/dist/{admin → testSurface}/surface/readiness/Banner.d.ts +2 -3
- package/dist/testSurface/surface/readiness/Banner.js +187 -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 +10 -0
- package/dist/testSurface/surface/readiness/SaveStatus.js +66 -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 +7 -3
- package/dist/{admin → testSurface}/surface/results/ResultsBody.js +108 -44
- 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 +58 -18
- package/dist/testSurface/surface/setting/setting.css +17 -0
- package/dist/{admin → testSurface}/surface/test/AdvancedSection.js +2 -0
- 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 +116 -86
- package/dist/testSurface/surface/test/LengthSection.d.ts +2 -0
- package/dist/{admin → testSurface}/surface/test/LengthSection.js +5 -1
- package/dist/{admin → testSurface}/surface/test/PageHoldout.js +4 -1
- package/dist/{admin → testSurface}/surface/test/Rail.js +7 -4
- package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +1 -0
- package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +2 -3
- package/dist/{admin → testSurface}/surface/test/Section.d.ts +3 -1
- package/dist/testSurface/surface/test/Section.js +80 -0
- package/dist/{admin → testSurface}/surface/test/TargetingSection.js +82 -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/{admin → testSurface}/surface/test/VersionsSection.js +69 -35
- package/dist/{admin → testSurface}/surface/test/fields.d.ts +30 -7
- package/dist/testSurface/surface/test/fields.js +306 -0
- package/dist/{admin → testSurface}/surface/test/pageParts.js +27 -43
- package/dist/testSurface/surface/test/testPage.css +103 -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 +7 -0
- package/dist/testSurface/surfaceUrls.js +19 -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 +116 -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 +7 -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 +49 -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/actions.model.js +0 -70
- package/dist/admin/copy/pages.d.ts +0 -26
- package/dist/admin/copy/pages.js +0 -26
- package/dist/admin/copy/testPage.js +0 -104
- 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/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/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}/PreviewLinks.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/decide.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/decide.model.js +0 -0
- /package/dist/{admin → testSurface}/allocation.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/allocation.model.js +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}/copy/advanced.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/advanced.js +0 -0
- /package/dist/{admin → testSurface}/copy/arms.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/arms.js +0 -0
- /package/dist/{admin → testSurface}/copy/audience.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/audience.js +0 -0
- /package/dist/{admin → testSurface}/copy/recommendation.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/recommendation.js +0 -0
- /package/dist/{admin → testSurface}/copy/setting.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/setting.js +0 -0
- /package/dist/{admin → testSurface}/format/date.d.ts +0 -0
- /package/dist/{admin → testSurface}/format/date.js +0 -0
- /package/dist/{admin → testSurface}/labels.d.ts +0 -0
- /package/dist/{admin → testSurface}/labels.js +0 -0
- /package/dist/{admin → testSurface}/lockedNotice.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/lockedNotice.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/results.model.d.ts +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/results/recommendation.model.js +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/PageHoldout.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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { API_MESSAGES } from './copy/common.js';
|
|
2
|
+
import { PLACEMENT_FAILURE_COPY, READINESS_COPY, placementFailureCopy } from './copy/readiness.js';
|
|
3
|
+
import { TEST_PAGE } from './copy/testPage.js';
|
|
4
|
+
import { editorCopy } from '../puck/editor/copy.js';
|
|
5
|
+
import { pickerCopy } from '../puck/copy.js';
|
|
6
|
+
import { isPreflightResult } from './readPreflight.js';
|
|
7
|
+
/** One read policy for every surface. Pending retains this settled value verbatim. */ export function classifyReadinessRead(status, body, failures = 1, context = {
|
|
8
|
+
kind: 'readiness'
|
|
9
|
+
}) {
|
|
10
|
+
const document = context.kind === 'document';
|
|
11
|
+
const answer = !document && status === 200 && isPreflightResult(body) ? body : undefined;
|
|
12
|
+
const detail = answer?.checks.find((check)=>!check.ok && (check.code === 'no-placements' && check.detail !== undefined || check.code === 'flag-placement-missing' && typeof check.detail === 'string'))?.detail;
|
|
13
|
+
const kind = status === 401 ? 'signed-out' : status === 404 || detail === 'not-found' ? 'not-found' : status === 403 || detail === 'forbidden' ? 'no-access' : status === 400 || status === 501 ? 'permanent' : answer ? 'answered' : 'failed';
|
|
14
|
+
const failed = kind === 'failed' || kind === 'answered' && detail !== undefined;
|
|
15
|
+
const retry = failed;
|
|
16
|
+
const message = kind === 'signed-out' ? API_MESSAGES.unauthenticated : kind === 'not-found' ? answer ? PLACEMENT_FAILURE_COPY['not-found'] : document && context.surface === 'editor' ? pickerCopy.unavailable : API_MESSAGES.notFound : kind === 'no-access' ? document ? context.surface === 'editor' ? context.resultsOnly ? pickerCopy.resultsOnly : pickerCopy.forbidden : TEST_PAGE.forbidden : PLACEMENT_FAILURE_COPY.forbidden : kind === 'permanent' ? status === 501 ? API_MESSAGES.notImplemented : document ? context.surface === 'editor' ? editorCopy.loadError : TEST_PAGE.error : READINESS_COPY.invalidRequest : kind === 'failed' ? document ? context.surface === 'editor' ? editorCopy.loadError : TEST_PAGE.error : READINESS_COPY.checkError : detail !== undefined ? placementFailureCopy(detail) : undefined;
|
|
17
|
+
// Subscribers determine whether save/publish guidance is displayed. Its polling
|
|
18
|
+
// eligibility is classified here, alongside permanent and temporary failures.
|
|
19
|
+
const placementNotice = !document && (context.placementNotice ?? context.kind === 'where-used');
|
|
20
|
+
const pollDelay = retry ? [
|
|
21
|
+
4_000,
|
|
22
|
+
8_000,
|
|
23
|
+
16_000,
|
|
24
|
+
30_000
|
|
25
|
+
][Math.min(Math.max(0, failures - 1), 3)] : kind === 'answered' && placementNotice ? 4_000 : null;
|
|
26
|
+
const loadState = kind === 'not-found' ? 'missing' : kind === 'signed-out' || kind === 'no-access' ? 'forbidden' : kind === 'failed' || kind === 'permanent' ? 'error' : 'ready';
|
|
27
|
+
return {
|
|
28
|
+
status,
|
|
29
|
+
loadState,
|
|
30
|
+
kind,
|
|
31
|
+
answer,
|
|
32
|
+
message,
|
|
33
|
+
failed,
|
|
34
|
+
retry,
|
|
35
|
+
pollDelay
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** Legacy callers can supply an answer; producers always supply the classified read. */ export function readinessRead(test) {
|
|
39
|
+
return test.preflightRead ?? classifyReadinessRead(test.preflightError ? 0 : 200, test.preflight);
|
|
40
|
+
}
|
|
41
|
+
/** Settled display is independent of a refresh in progress. */ export function readyToStart(test, placementMessage) {
|
|
42
|
+
return !!test.preflight && !placementMessage && readinessRead(test).kind === 'answered' && !test.preflightError && test.preflight.checks.every((check)=>check.ok);
|
|
43
|
+
}
|
|
44
|
+
/** A pending edit can change the selected goal before the next readiness response. */ export function hasBrowserWritablePrimary(preflight, primary) {
|
|
45
|
+
const reported = preflight?.browserWritablePrimaryId;
|
|
46
|
+
return reported != null && primary != null && String(reported) === String(primary);
|
|
47
|
+
}
|
|
48
|
+
/** Pending changes only the ability to fire Start, never the settled display. */ export function canStartTest(test, placementMessage) {
|
|
49
|
+
return readyToStart(test, placementMessage) && !test.preflightPending && !test.hasUnsaved && test.saving !== 'saving';
|
|
50
|
+
}
|
|
@@ -8,6 +8,7 @@ export interface VerdictHeroProps {
|
|
|
8
8
|
sinceShipping?: string | null;
|
|
9
9
|
meta?: ReactNode;
|
|
10
10
|
recommendation?: string;
|
|
11
|
+
browserWritablePrimary?: boolean;
|
|
11
12
|
}
|
|
12
13
|
import './results.css';
|
|
13
|
-
export declare function VerdictHero({ model, guardrails, power, collecting, sinceShipping, meta, recommendation }: VerdictHeroProps): import("react").JSX.Element;
|
|
14
|
+
export declare function VerdictHero({ model, guardrails, power, collecting, sinceShipping, meta, recommendation, browserWritablePrimary }: VerdictHeroProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { METRICS_COPY } from '../copy/metrics.js';
|
|
3
4
|
import './results.css';
|
|
4
|
-
export function VerdictHero({ model, guardrails = [], power, collecting, sinceShipping, meta, recommendation }) {
|
|
5
|
+
export function VerdictHero({ model, guardrails = [], power, collecting, sinceShipping, meta, recommendation, browserWritablePrimary }) {
|
|
5
6
|
return /*#__PURE__*/ _jsxs("section", {
|
|
6
7
|
className: "xp-verdict-hero",
|
|
7
8
|
children: [
|
|
@@ -25,6 +26,9 @@ export function VerdictHero({ model, guardrails = [], power, collecting, sinceSh
|
|
|
25
26
|
className: "xp-collecting",
|
|
26
27
|
children: collecting
|
|
27
28
|
}) : null,
|
|
29
|
+
browserWritablePrimary ? /*#__PURE__*/ _jsx("p", {
|
|
30
|
+
children: METRICS_COPY.browserWritablePrimary
|
|
31
|
+
}) : null,
|
|
28
32
|
recommendation ? /*#__PURE__*/ _jsx("p", {
|
|
29
33
|
className: "xp-recommendation",
|
|
30
34
|
children: recommendation
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
:where(.xp-test-surface) .xp-results { max-width: 1120px; display: grid; gap: var(--xp-space-8); min-width: 0; }
|
|
2
|
+
:where(.xp-test-surface) .xp-results h2, :where(.xp-test-surface) .xp-results h3, :where(.xp-test-surface) .xp-results p { margin: 0; }
|
|
3
|
+
:where(.xp-test-surface) .xp-verdict-hero { background: var(--xp-surface); border: 1px solid var(--xp-border); border-radius: var(--xp-radius-card); padding: 28px; min-width: 0; }
|
|
4
|
+
:where(.xp-test-surface) .xp-verdict-hero h2 { font: var(--xp-text-display); letter-spacing: -0.01em; max-width: 36ch; }
|
|
5
|
+
:where(.xp-test-surface) .xp-verdict-hero p { margin-top: var(--xp-space-2); color: var(--xp-text-2); }
|
|
6
|
+
:where(.xp-test-surface) .xp-verdict-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--xp-space-3); margin-top: var(--xp-space-5); padding-top: var(--xp-space-4); border-top: 1px solid var(--xp-border); color: var(--xp-text-3); font: var(--xp-text-small); }
|
|
7
|
+
:where(.xp-test-surface) .xp-round-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--xp-space-2); min-width: 0; }
|
|
8
|
+
:where(.xp-test-surface) .xp-round-meta .xp-ui-field { display: flex; align-items: center; gap: var(--xp-space-2); margin: 0; min-width: 0; }
|
|
9
|
+
:where(.xp-test-surface) .xp-round-meta .xp-ui-combobox-wrap { width: auto; max-width: 100%; }
|
|
10
|
+
:where(.xp-test-surface) .xp-results-chips { display: flex; flex-wrap: wrap; gap: var(--xp-space-2); list-style: none; padding: 0; margin-bottom: 0; }
|
|
11
|
+
:where(.xp-test-surface) .xp-stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--xp-border); border-radius: var(--xp-radius-card); background: var(--xp-surface); overflow: hidden; }
|
|
12
|
+
:where(.xp-test-surface) .xp-stat-tile { padding: 20px; min-width: 0; }
|
|
13
|
+
:where(.xp-test-surface) .xp-stat-tile + .xp-stat-tile { border-left: 1px solid var(--xp-border); }
|
|
14
|
+
:where(.xp-test-surface) .xp-stat-tile-label, :where(.xp-test-surface) .xp-stat-tile-detail { font: var(--xp-text-small); color: var(--xp-text-2); }
|
|
15
|
+
:where(.xp-test-surface) .xp-stat-tile-value { margin-top: 6px; font: 600 32px/36px var(--xp-font); font-variant-numeric: tabular-nums; }
|
|
16
|
+
:where(.xp-test-surface) .xp-stat-tile-detail { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
|
|
17
|
+
:where(.xp-test-surface) .xp-results-block { min-width: 0; }
|
|
18
|
+
:where(.xp-test-surface) .xp-results-block-head { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
|
|
19
|
+
:where(.xp-test-surface) .xp-results-block-head h2 { font: var(--xp-text-title); }
|
|
20
|
+
:where(.xp-test-surface) .xp-results-block-meta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--xp-text-2); }
|
|
21
|
+
:where(.xp-test-surface) .xp-data-table-frame { position: relative; min-width: 0; border-radius: var(--xp-radius-card); }
|
|
22
|
+
:where(.xp-test-surface) .xp-data-table-wrap { overflow-x: auto; overflow-y: auto; max-height: 70vh; border: 1px solid var(--xp-border); border-radius: var(--xp-radius-card); background: var(--xp-surface); }
|
|
23
|
+
:where(.xp-test-surface) .xp-data-table-wrap:focus-visible { outline: 2px solid var(--xp-focus); outline-offset: 2px; }
|
|
24
|
+
/* Overlays stay visible above opaque sticky headers and the highlighted row. */
|
|
25
|
+
:where(.xp-test-surface) .xp-data-table-frame::before, :where(.xp-test-surface) .xp-data-table-frame::after { content: ''; position: absolute; top: 1px; bottom: 1px; width: var(--xp-space-6); z-index: 3; pointer-events: none; opacity: 0; }
|
|
26
|
+
:where(.xp-test-surface) .xp-data-table-frame::before { left: 1px; border-radius: var(--xp-radius-card) 0 0 var(--xp-radius-card); background: linear-gradient(to right, var(--xp-border-strong), transparent); }
|
|
27
|
+
:where(.xp-test-surface) .xp-data-table-frame::after { right: 1px; border-radius: 0 var(--xp-radius-card) var(--xp-radius-card) 0; background: linear-gradient(to left, var(--xp-border-strong), transparent); }
|
|
28
|
+
:where(.xp-test-surface) .xp-data-table-frame.has-left::before, :where(.xp-test-surface) .xp-data-table-frame.has-right::after { opacity: 1; }
|
|
29
|
+
:where(.xp-test-surface) .xp-data-table { width: 100%; border-collapse: separate; border-spacing: 0; font: 400 14px/20px var(--xp-font); }
|
|
30
|
+
:where(.xp-test-surface) .xp-data-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
|
|
31
|
+
:where(.xp-test-surface) .xp-data-table th, :where(.xp-test-surface) .xp-data-table td { padding: 12px 14px; white-space: nowrap; border-bottom: 1px solid var(--xp-border); text-align: left; }
|
|
32
|
+
:where(.xp-test-surface) .xp-data-table thead th { position: sticky; top: 0; z-index: 1; background: var(--xp-surface); font: var(--xp-text-small); color: var(--xp-text-2); }
|
|
33
|
+
:where(.xp-test-surface) .xp-data-table tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--xp-surface); }
|
|
34
|
+
:where(.xp-test-surface) .xp-data-table thead tr > :first-child { z-index: 2; }
|
|
35
|
+
:where(.xp-test-surface) .xp-data-table tbody th { font-weight: 400; }
|
|
36
|
+
:where(.xp-test-surface) .xp-data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
|
|
37
|
+
:where(.xp-test-surface) .xp-data-table .muted { color: var(--xp-text-3); }
|
|
38
|
+
:where(.xp-test-surface) .xp-data-table tr:last-child > * { border-bottom: 0; }
|
|
39
|
+
:where(.xp-test-surface) .xp-data-table tr.is-lead > * { background: var(--xp-surface-2); font-weight: 600; }
|
|
40
|
+
:where(.xp-test-surface) .xp-results-group { display: inline-flex; align-items: center; gap: 8px; }
|
|
41
|
+
:where(.xp-test-surface) .xp-results-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
|
|
42
|
+
:where(.xp-test-surface) .xp-results-panel { border: 1px solid var(--xp-border); border-radius: var(--xp-radius-card); background: var(--xp-surface); min-width: 0; }
|
|
43
|
+
:where(.xp-test-surface) .xp-results-panel > summary { padding: 16px 20px; cursor: pointer; font: var(--xp-text-title); }
|
|
44
|
+
:where(.xp-test-surface) .xp-results-panel > summary:focus-visible { outline: 2px solid var(--xp-focus); outline-offset: 2px; }
|
|
45
|
+
:where(.xp-test-surface) .xp-results-panel > summary .xp-quality-chip { margin-left: 12px; }
|
|
46
|
+
:where(.xp-test-surface) .xp-quality-row { padding: 14px 20px; border-top: 1px solid var(--xp-border); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; }
|
|
47
|
+
:where(.xp-test-surface) .xp-quality-row > :not(:first-child) { grid-column: 2; }
|
|
48
|
+
:where(.xp-test-surface) .xp-quality-row ul { margin: 0; padding-left: 20px; }
|
|
49
|
+
:where(.xp-test-surface) .xp-quality-detail, :where(.xp-test-surface) .xp-quality-next, :where(.xp-test-surface) .xp-results-cap-help { color: var(--xp-text-2); font: var(--xp-text-small); }
|
|
50
|
+
:where(.xp-test-surface) .xp-quality-chip { display: inline-flex; align-self: start; padding: 2px 8px; border-radius: var(--xp-radius-chip); font: var(--xp-text-small); color: var(--xp-success); background: var(--xp-success-bg); }
|
|
51
|
+
:where(.xp-test-surface) .xp-quality-chip--watch { color: var(--xp-warning); background: var(--xp-warning-bg); }
|
|
52
|
+
:where(.xp-test-surface) .xp-quality-chip--problem { color: var(--xp-error); background: var(--xp-error-bg); }
|
|
53
|
+
:where(.xp-test-surface) .xp-ci-chart { padding: 20px; overflow-x: auto; }
|
|
54
|
+
:where(.xp-test-surface) .xp-ci-chart svg { display: block; min-width: 560px; }
|
|
55
|
+
:where(.xp-test-surface) .xp-ci-chart ul { display: flex; flex-wrap: wrap; gap: 16px; list-style: none; margin: 0; padding: 0; font: var(--xp-text-small); }
|
|
56
|
+
:where(.xp-test-surface) .xp-preview-links { display: grid; gap: 12px; }
|
|
57
|
+
:where(.xp-test-surface) .xp-preview-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--xp-border); padding-bottom: 12px; }
|
|
58
|
+
@media (max-width: 720px) {
|
|
59
|
+
:where(.xp-test-surface) .xp-stat-tiles { grid-template-columns: minmax(0, 1fr); }
|
|
60
|
+
:where(.xp-test-surface) .xp-stat-tile + .xp-stat-tile { border-left: 0; border-top: 1px solid var(--xp-border); }
|
|
61
|
+
:where(.xp-test-surface) .xp-verdict-hero { padding: 20px; }
|
|
62
|
+
:where(.xp-test-surface) .xp-verdict-hero h2 { font-size: 24px; line-height: 30px; }
|
|
63
|
+
}
|
|
64
|
+
:where(.xp-test-surface) .xp-results-as-of { color: var(--xp-text-2); }
|
|
@@ -132,14 +132,18 @@ function smallest(values) {
|
|
|
132
132
|
return collectingCopy(formatCount(smallest(keys.map((key)=>snapshot.exposures.perArm[key]))), formatCount(isLegacySnapshot(snapshot) ? legacyMinimum(snapshot, ctx) : snapshot.minExposuresPerArm), formatCount(smallest(keys.map((key)=>primary?.perArm.find((arm)=>arm.arm === key)?.converters))), formatCount(primary ? snapshot.params.minSampleSizes[primary.metricId] : undefined));
|
|
133
133
|
}
|
|
134
134
|
export function dataQuality(snapshot, ctx = {}) {
|
|
135
|
-
const items = (snapshot.health ?? []).map((item)=>
|
|
135
|
+
const items = (snapshot.health ?? []).map((item)=>item.code === 'rapid-browser-events' ? {
|
|
136
|
+
id: item.code,
|
|
137
|
+
message: RESULTS_COPY.rapidBrowserEvents,
|
|
138
|
+
nextStep: RESULTS_COPY.rapidBrowserEventsNext
|
|
139
|
+
} : {
|
|
136
140
|
id: item.code === 'placement-unchecked' ? `${item.code}:${JSON.stringify(item.detail)}` : `${item.code}:${'path' in item ? item.path : item.metricId}`,
|
|
137
141
|
message: item.code === 'placement-unchecked' ? placementUncheckedCopy(ctx.placementLabels?.get(placementDetailKey(item.detail))?.title ?? item.detail.path ?? 'This page') : item.code === 'goal-in-some-versions' ? `${item.name} now appears in some versions but not all, so this result is no longer a fair comparison. Add it to every version, or remove it.` : READINESS_COPY.needsAttention,
|
|
138
142
|
...item.code === 'placement-unchecked' ? {
|
|
139
143
|
href: ctx.placementLabels?.get(placementDetailKey(item.detail))?.href
|
|
140
144
|
} : {},
|
|
141
145
|
nextStep: item.code === 'placement-unchecked' ? `Open ${ctx.placementLabels?.get(placementDetailKey(item.detail))?.title ?? item.detail.path ?? 'the page'}` : item.code === 'goal-in-some-versions' ? 'Edit the versions' : item.code === 'version-page-unavailable' ? versionPageUnavailableCopy(item.path, ctx.status) : versionPageUncheckedCopy(item.path, ctx.status)
|
|
142
|
-
})
|
|
146
|
+
});
|
|
143
147
|
// Test snapshots store null by design; only rollout snapshots record the shipped winner.
|
|
144
148
|
if (!isLegacySnapshot(snapshot) && snapshot.phaseKind === 'rollout' && snapshot.winnerArm === null) items.push({
|
|
145
149
|
id: 'missing-winner',
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { TestsSurfaceProps } from '../../types/surface.js';
|
|
3
3
|
import type { SerializedAttributeKeys, SerializedFlagPoint, SerializedMetricSource } from '../../types/admin.js';
|
|
4
|
+
import type { ArmSlot } from '../../types/puck.js';
|
|
4
5
|
import type { useTestDocument } from './useTestDocument.js';
|
|
5
6
|
/** Sections of the test page, in readiness order (surface spec §6.2, §8). */
|
|
6
7
|
export type SectionId = 'what' | 'versions' | 'win' | 'who' | 'length' | 'advanced';
|
|
7
8
|
export declare const SECTION_ORDER: readonly SectionId[];
|
|
8
9
|
/** The data layer's return value; every section takes it as `test`. */
|
|
9
|
-
|
|
10
|
+
type DocumentApi = ReturnType<typeof useTestDocument>;
|
|
11
|
+
type FieldLifecycle = Pick<DocumentApi, 'mountDraft' | 'submitDraft' | 'syncDocument'>;
|
|
12
|
+
export type TestDocApi = Omit<DocumentApi, keyof FieldLifecycle> & Partial<FieldLifecycle>;
|
|
13
|
+
/** Quick actions have a document reader and transition handlers, with no field editor. */
|
|
14
|
+
export type ActionTestApi = Omit<TestDocApi, 'stage' | 'commit' | 'choosePage' | 'chosenPages' | 'mountDraft' | 'submitDraft' | 'trackDraft' | 'syncDocument'>;
|
|
10
15
|
/** Serialisable props the server root view passes to the surface (ADM-20). */
|
|
11
16
|
export interface SurfaceProps {
|
|
17
|
+
/** Present only when configuring a block from its page editor. */
|
|
18
|
+
editorPage?: {
|
|
19
|
+
collection: string;
|
|
20
|
+
id: string;
|
|
21
|
+
versionContent?: Partial<Record<ArmSlot, 'filled' | 'partial' | 'empty'>>;
|
|
22
|
+
};
|
|
23
|
+
editorPlacementMessage?: string;
|
|
12
24
|
adminRoute: string;
|
|
13
25
|
apiRoute: string;
|
|
26
|
+
contentLanguageLabels?: string[];
|
|
27
|
+
contentLocale?: string;
|
|
14
28
|
collectionTitles?: Record<string, string>;
|
|
15
29
|
userId?: string | number;
|
|
16
30
|
userCollection?: string;
|
|
@@ -35,12 +49,11 @@ export interface KindParts {
|
|
|
35
49
|
/** The content cell of one version row in Section 2. */
|
|
36
50
|
VersionContent: ComponentType<SectionProps & {
|
|
37
51
|
armIndex: number;
|
|
52
|
+
summary?: boolean;
|
|
38
53
|
}>;
|
|
39
54
|
}
|
|
40
55
|
/** Readiness pieces (ADM-23). */
|
|
41
56
|
export interface ReadinessParts {
|
|
42
|
-
/** Sticky-header banner incl. Start / status sentence. */
|
|
43
|
-
Banner: ComponentType<SectionProps>;
|
|
44
57
|
/** "Saving…" / "Saved" / error indicator for the header. */
|
|
45
58
|
SaveStatus: ComponentType<{
|
|
46
59
|
test: TestDocApi;
|
|
@@ -48,3 +61,4 @@ export interface ReadinessParts {
|
|
|
48
61
|
/** Check-circle state per section, from preflight. */
|
|
49
62
|
sectionDone(test: TestDocApi): Record<SectionId, boolean>;
|
|
50
63
|
}
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PreflightResult } from '../../types/endpoints.js';
|
|
2
|
+
import type { Status } from '../../types/contracts.js';
|
|
3
|
+
import type { ActionTestApi, SurfaceProps } from './contracts.js';
|
|
4
|
+
export { SAVE_PAGE, PUBLISH_PAGE, RUNNING_PUBLISH_PAGE, RUNNING_SAVE_PAGE } from '../copy/readiness.js';
|
|
5
|
+
/** Replace only the guidance represented by this page's local notice. */
|
|
6
|
+
export declare function editorPlacementChecks(checks: PreflightResult['checks'], page: NonNullable<SurfaceProps['editorPage']>): PreflightResult['checks'];
|
|
7
|
+
/** Editor context is a hint for guidance only; Start still runs server preflight. */
|
|
8
|
+
export declare function editorPlacementMessage(placements: PreflightResult['placements'] | undefined, page: SurfaceProps['editorPage'], status: Status | undefined): string | undefined;
|
|
9
|
+
/** Replace this page's checks once, retaining every other page's blocker. */
|
|
10
|
+
export declare function editorPreflight(answer: PreflightResult | null, surface: SurfaceProps, includeLocalBlocker?: boolean): PreflightResult | null;
|
|
11
|
+
/** Shared sidebar policy; the bounded list renders these steps verbatim. */
|
|
12
|
+
export declare function sidebarReadinessBlockers(test: ActionTestApi, surface: SurfaceProps): ({
|
|
13
|
+
arm?: import("../../types/contracts.js").ArmKey | undefined;
|
|
14
|
+
section: "header" | import("./contracts.js").SectionId;
|
|
15
|
+
sentence: string;
|
|
16
|
+
code: import("../../transitions/checkStart.js").ReadinessCode;
|
|
17
|
+
} | {
|
|
18
|
+
sentence: "Wait for your changes to save.";
|
|
19
|
+
})[] | {
|
|
20
|
+
sentence: "Checking readiness…";
|
|
21
|
+
}[];
|
|
22
|
+
/** The local notice already names this pair. Keep other pairs and other pages. */
|
|
23
|
+
export declare function editorNestedChecks(checks: PreflightResult['checks'], page: NonNullable<SurfaceProps['editorPage']>, identity: {
|
|
24
|
+
outerSlug: string;
|
|
25
|
+
innerSlug: string;
|
|
26
|
+
}): PreflightResult['checks'];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { SAVE_PAGE, PUBLISH_PAGE, RUNNING_PUBLISH_PAGE, RUNNING_SAVE_PAGE } from '../copy/readiness.js';
|
|
2
|
+
import { blockingSteps, pageReadinessContext } from './readiness/readiness.model.js';
|
|
3
|
+
import { READINESS_COPY } from '../copy/readiness.js';
|
|
4
|
+
export { SAVE_PAGE, PUBLISH_PAGE, RUNNING_PUBLISH_PAGE, RUNNING_SAVE_PAGE } from '../copy/readiness.js';
|
|
5
|
+
/** Replace only the guidance represented by this page's local notice. */ export function editorPlacementChecks(checks, page) {
|
|
6
|
+
return checks.flatMap((check)=>{
|
|
7
|
+
if (check.code === 'no-placements') return [];
|
|
8
|
+
if (check.code !== 'placement-unpublished' || check.ok) return [
|
|
9
|
+
check
|
|
10
|
+
];
|
|
11
|
+
const detail = (Array.isArray(check.detail) ? check.detail : [
|
|
12
|
+
check.detail
|
|
13
|
+
]).filter((value)=>{
|
|
14
|
+
if (!value || typeof value !== 'object') return true;
|
|
15
|
+
const row = value;
|
|
16
|
+
return row.collection !== page.collection || String(row.id) !== String(page.id);
|
|
17
|
+
});
|
|
18
|
+
return detail.length ? [
|
|
19
|
+
{
|
|
20
|
+
...check,
|
|
21
|
+
detail
|
|
22
|
+
}
|
|
23
|
+
] : [];
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** Editor context is a hint for guidance only; Start still runs server preflight. */ export function editorPlacementMessage(placements, page, status) {
|
|
27
|
+
if (!page || !placements || !status || status === 'decided' || status === 'archived') return;
|
|
28
|
+
const here = placements.filter((p)=>p.collection === page.collection && String(p.id) === String(page.id));
|
|
29
|
+
if (!here.length) return status === 'running' ? RUNNING_SAVE_PAGE : SAVE_PAGE;
|
|
30
|
+
if (!here.some((p)=>p.detail === 'Published')) return status === 'running' ? RUNNING_PUBLISH_PAGE : PUBLISH_PAGE;
|
|
31
|
+
}
|
|
32
|
+
/** Replace this page's checks once, retaining every other page's blocker. */ export function editorPreflight(answer, surface, includeLocalBlocker = true) {
|
|
33
|
+
return answer && surface.editorPlacementMessage && surface.editorPage ? {
|
|
34
|
+
...answer,
|
|
35
|
+
checks: [
|
|
36
|
+
...editorPlacementChecks(answer.checks, surface.editorPage),
|
|
37
|
+
...includeLocalBlocker ? [
|
|
38
|
+
{
|
|
39
|
+
code: 'no-placements',
|
|
40
|
+
ok: false
|
|
41
|
+
}
|
|
42
|
+
] : []
|
|
43
|
+
]
|
|
44
|
+
} : answer;
|
|
45
|
+
}
|
|
46
|
+
/** Shared sidebar policy; the bounded list renders these steps verbatim. */ export function sidebarReadinessBlockers(test, surface) {
|
|
47
|
+
const answer = editorPreflight(test.preflight, surface, false);
|
|
48
|
+
const blockers = test.doc ? blockingSteps(answer, pageReadinessContext(test.doc, test.preflight, surface)) : [];
|
|
49
|
+
const notice = test.preflightRead?.message ?? surface.editorPlacementMessage;
|
|
50
|
+
return test.saving === 'saving' ? [
|
|
51
|
+
{
|
|
52
|
+
sentence: READINESS_COPY.saveFirst
|
|
53
|
+
},
|
|
54
|
+
...blockers
|
|
55
|
+
] : !answer && !notice ? [
|
|
56
|
+
{
|
|
57
|
+
sentence: READINESS_COPY.checking
|
|
58
|
+
}
|
|
59
|
+
] : blockers.filter((step)=>step.sentence !== notice);
|
|
60
|
+
}
|
|
61
|
+
/** The local notice already names this pair. Keep other pairs and other pages. */ export function editorNestedChecks(checks, page, identity) {
|
|
62
|
+
return checks.flatMap((check)=>{
|
|
63
|
+
if (check.code !== 'nested-tests' || check.ok || !Array.isArray(check.detail)) return [
|
|
64
|
+
check
|
|
65
|
+
];
|
|
66
|
+
const detail = check.detail.filter((value)=>{
|
|
67
|
+
if (!value || typeof value !== 'object') return true;
|
|
68
|
+
const pair = value;
|
|
69
|
+
return pair.collection !== page.collection || String(pair.id) !== String(page.id) || pair.outerSlug !== identity.outerSlug || pair.innerSlug !== identity.innerSlug;
|
|
70
|
+
});
|
|
71
|
+
return detail.length ? [
|
|
72
|
+
{
|
|
73
|
+
...check,
|
|
74
|
+
detail
|
|
75
|
+
}
|
|
76
|
+
] : [];
|
|
77
|
+
});
|
|
78
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TEST_PAGE as C } from '../../copy/testPage.js';
|
|
2
|
+
import { placementLabel } from '../../placementLabel.js';
|
|
3
|
+
export function placementLine(placement) {
|
|
4
|
+
return `${C.onPage} ${placementLabel(placement, true)}`;
|
|
5
|
+
}
|
|
6
|
+
export function slotReady(placement, arm) {
|
|
7
|
+
const slot = arm.kind === 'holdout' ? 'control' : arm.key;
|
|
8
|
+
return slot !== 'holdout' && (placement.slots?.[slot] ?? 0) > 0;
|
|
9
|
+
}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Banner } from '../../../ui/Banner.js';
|
|
3
4
|
import { Button } from '../../../ui/Button.js';
|
|
4
|
-
import {
|
|
5
|
+
import { placementPages } from '../../../lib/placementPages.js';
|
|
5
6
|
import { TEST_PAGE as C, placementCount } from '../../copy/testPage.js';
|
|
6
7
|
import { placementLine, slotReady } from './pageBlock.model.js';
|
|
7
|
-
|
|
8
|
+
import { placementLabel, placementGroupLabel } from '../../placementLabel.js';
|
|
9
|
+
function Binding({ test, surface }) {
|
|
8
10
|
const placements = test.preflight?.placements ?? [];
|
|
11
|
+
const pages = placementPages(placements);
|
|
9
12
|
return /*#__PURE__*/ _jsx("div", {
|
|
10
13
|
className: "xp-page-binding",
|
|
11
|
-
children:
|
|
14
|
+
children: surface.editorPlacementMessage ? test.doc?.status === 'running' ? /*#__PURE__*/ _jsxs(Banner, {
|
|
15
|
+
tone: "warning",
|
|
12
16
|
children: [
|
|
13
|
-
|
|
17
|
+
/*#__PURE__*/ _jsx("span", {
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
children: "⚠ "
|
|
20
|
+
}),
|
|
21
|
+
surface.editorPlacementMessage
|
|
22
|
+
]
|
|
23
|
+
}) : null : placements.length ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
24
|
+
children: [
|
|
25
|
+
pages.map((placement)=>/*#__PURE__*/ _jsxs("p", {
|
|
14
26
|
className: "xp-ui-button-group",
|
|
15
27
|
children: [
|
|
16
28
|
placementLine(placement),
|
|
@@ -20,6 +32,7 @@ function Binding({ test }) {
|
|
|
20
32
|
variant: "link",
|
|
21
33
|
size: "sm",
|
|
22
34
|
href: placement.editorUrl,
|
|
35
|
+
"aria-label": pages.length > 1 ? `${C.openPage}: ${placementLabel(placement, true)}` : undefined,
|
|
23
36
|
children: C.openPage
|
|
24
37
|
}) : null
|
|
25
38
|
]
|
|
@@ -28,12 +41,12 @@ function Binding({ test }) {
|
|
|
28
41
|
children: C.editedOnPage
|
|
29
42
|
})
|
|
30
43
|
]
|
|
31
|
-
}) : /*#__PURE__*/ _jsx("p", {
|
|
44
|
+
}) : test.preflight?.checks.some((check)=>!check.ok && check.code === 'no-placements') ? null : /*#__PURE__*/ _jsx("p", {
|
|
32
45
|
children: C.notPlaced
|
|
33
46
|
})
|
|
34
47
|
});
|
|
35
48
|
}
|
|
36
|
-
function VersionContent({ test, armIndex }) {
|
|
49
|
+
function VersionContent({ test, surface, armIndex, summary }) {
|
|
37
50
|
const arm = test.doc?.arms[armIndex];
|
|
38
51
|
if (!arm) return null;
|
|
39
52
|
if (arm.kind === 'holdout') return /*#__PURE__*/ _jsx("span", {
|
|
@@ -41,7 +54,16 @@ function VersionContent({ test, armIndex }) {
|
|
|
41
54
|
children: C.holdoutContent
|
|
42
55
|
});
|
|
43
56
|
const placements = test.preflight?.placements ?? [];
|
|
44
|
-
const pages =
|
|
57
|
+
const pages = placementPages(placements);
|
|
58
|
+
const localized = pages.some((page)=>page.allLocales || page.locales?.length);
|
|
59
|
+
const editPages = new Map();
|
|
60
|
+
for (const page of pages){
|
|
61
|
+
if (!page.editorUrl) continue;
|
|
62
|
+
const key = localized ? page.editorUrl : page.key;
|
|
63
|
+
const group = editPages.get(key) ?? [];
|
|
64
|
+
group.push(page);
|
|
65
|
+
editPages.set(key, group);
|
|
66
|
+
}
|
|
45
67
|
const ready = placements.length > 0 && placements.every((placement)=>slotReady(placement, arm));
|
|
46
68
|
return /*#__PURE__*/ _jsxs("div", {
|
|
47
69
|
className: "xp-version-content",
|
|
@@ -52,13 +74,19 @@ function VersionContent({ test, armIndex }) {
|
|
|
52
74
|
}),
|
|
53
75
|
/*#__PURE__*/ _jsx("div", {
|
|
54
76
|
className: "xp-ui-button-group",
|
|
55
|
-
children:
|
|
77
|
+
children: !summary ? [
|
|
78
|
+
...editPages.values()
|
|
79
|
+
].map((group)=>{
|
|
80
|
+
const page = group[0];
|
|
81
|
+
const label = localized ? `${C.editOnPage}: ${placementGroupLabel(group, surface.contentLanguageLabels)}` : C.editOnPage;
|
|
82
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
56
83
|
variant: "link",
|
|
57
84
|
size: "sm",
|
|
58
85
|
href: page.editorUrl,
|
|
59
|
-
"aria-label": pages.length > 1 ? `${C.editOnPage}: ${page.title}` : undefined,
|
|
60
|
-
children:
|
|
61
|
-
}, page.key)
|
|
86
|
+
"aria-label": localized ? label : pages.length > 1 ? `${C.editOnPage}: ${page.title}` : undefined,
|
|
87
|
+
children: label
|
|
88
|
+
}, page.key);
|
|
89
|
+
}) : null
|
|
62
90
|
})
|
|
63
91
|
]
|
|
64
92
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Arm } from '../../../types/contracts.js';
|
|
3
|
+
import type { SurfaceProps, TestDocApi } from '../contracts.js';
|
|
4
|
+
import type { PageCollection } from './pagePicker.model.js';
|
|
5
|
+
import './pagePicker.css';
|
|
6
|
+
export declare function CopyRoute({ collection, arm, test, surface, children, onBusy }: {
|
|
7
|
+
collection: PageCollection;
|
|
8
|
+
arm: Arm;
|
|
9
|
+
test: TestDocApi;
|
|
10
|
+
surface: SurfaceProps;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
onBusy?: (busy: boolean) => void;
|
|
13
|
+
}): import("react").JSX.Element;
|