@delmaredigital/payload-experiments 0.4.0-rc.3 → 0.4.0-rc.5
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/dist/admin/LayerUsage.js +1 -1
- package/dist/admin/MetricSourceSelect.js +2 -2
- package/dist/admin/PlacementStatus.js +1 -1
- package/dist/admin/TestsDashboardCards.js +2 -2
- package/dist/admin/TestsNavLink.js +2 -2
- package/dist/admin/blocks/BlockPanel.js +3 -3
- package/dist/admin/blocks/TestBlockField.js +3 -3
- package/dist/admin/blocks/formApi.js +1 -1
- package/dist/admin/blocks/model.js +1 -1
- package/dist/admin/blocks/statusCache.js +1 -1
- package/dist/admin/components/RootViewMessage.js +1 -1
- package/dist/admin/copy/blocks.d.ts +2 -2
- package/dist/admin/copy/blocks.js +3 -2
- package/dist/admin/copy/goals.d.ts +5 -1
- package/dist/admin/copy/goals.js +9 -3
- package/dist/admin/goals/XpGoalField.js +155 -129
- package/dist/admin/goals/xpGoalField.css +2 -3
- package/dist/admin/status.model.js +1 -1
- package/dist/admin/surface/ResultsRoute.d.ts +2 -1
- package/dist/admin/surface/ResultsRoute.js +6 -13
- package/dist/admin/surface/SurfaceShell.js +2 -2
- package/dist/admin/surface/TestsHome.d.ts +1 -1
- package/dist/admin/surface/TestsHome.js +3 -3
- package/dist/admin/surface/TestsSurface.js +2 -2
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -1
- package/dist/admin/surface/goals/GoalForm.js +55 -7
- package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
- package/dist/admin/surface/goals/GoalsList.js +4 -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 +1 -1
- package/dist/admin/surface/home.model.js +5 -5
- package/dist/admin/surface/newTest/NewTest.d.ts +1 -1
- package/dist/admin/surface/newTest/NewTest.js +1 -1
- package/dist/admin/surface/newTest/PageWizard.d.ts +1 -1
- package/dist/admin/surface/newTest/PageWizard.js +23 -25
- package/dist/admin/surface/results/ResultsHeader.d.ts +2 -2
- package/dist/admin/surface/results/ResultsHeader.js +22 -15
- package/dist/admin/surface/test/TestPage.d.ts +1 -2
- package/dist/admin/surface/test/TestPage.js +45 -156
- package/dist/admin/views/ExperimentsRootView.js +1 -1
- package/dist/admin/views/TestsNavLinkServer.js +1 -1
- package/dist/admin/views/renderCollectionList.js +1 -1
- package/dist/admin/views/renderTestsSurface.js +1 -1
- package/dist/blocks/placementLocale.d.ts +21 -0
- package/dist/blocks/placementLocale.js +115 -0
- package/dist/collections/experiments/config.js +1 -1
- package/dist/collections/metrics.js +1 -1
- package/dist/db/bulkPlacementRemoval.d.ts +30 -0
- package/dist/db/bulkPlacementRemoval.js +107 -0
- package/dist/db/placements.d.ts +2 -0
- package/dist/db/placements.js +8 -0
- package/dist/endpoints/editorSurface.d.ts +3 -0
- package/dist/endpoints/editorSurface.js +31 -0
- package/dist/endpoints/index.js +28 -1
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +2 -0
- package/dist/fields/xpGoal.js +1 -1
- package/dist/goals/fairness.d.ts +1 -1
- package/dist/goals/fairness.js +1 -1
- 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 +4 -2
- package/dist/goals/picker/copy.js +4 -2
- package/dist/goals/picker/useClickGoalPicker.d.ts +1 -1
- package/dist/goals/picker/useClickGoalPicker.js +4 -2
- package/dist/hooks/blockRemovalRule.d.ts +29 -0
- package/dist/hooks/blockRemovalRule.js +141 -0
- package/dist/hooks/pageGuard.d.ts +24 -2
- package/dist/hooks/pageGuard.js +178 -24
- package/dist/lib/placementPages.d.ts +9 -0
- package/dist/{admin/previewLinks.model.js → lib/placementPages.js} +1 -4
- package/dist/onInit.js +22 -0
- package/dist/plugin.js +2 -1
- package/dist/puck/ExperimentPicker.js +25 -10
- package/dist/puck/copy.d.ts +4 -1
- package/dist/puck/copy.js +4 -1
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +21 -0
- package/dist/puck/editor/ConfigureTestDrawer.js +147 -0
- package/dist/puck/editor/CreateExperimentDrawer.d.ts +11 -2
- package/dist/puck/editor/CreateExperimentDrawer.js +73 -9
- package/dist/puck/editor/EditorControls.d.ts +14 -0
- package/dist/puck/editor/EditorControls.js +99 -0
- package/dist/puck/editor/ExperimentSlotEditor.js +690 -79
- package/dist/puck/editor/LeftoverVersions.d.ts +13 -0
- package/dist/puck/editor/LeftoverVersions.js +115 -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 +3 -0
- package/dist/puck/editor/QuickTestActions.js +50 -0
- package/dist/puck/editor/ResultsReadout.js +8 -5
- package/dist/puck/editor/VersionBuilder.d.ts +20 -6
- package/dist/puck/editor/VersionBuilder.js +80 -50
- package/dist/puck/editor/armWrites.d.ts +3 -1
- package/dist/puck/editor/armWrites.js +2 -1
- package/dist/puck/editor/armsCache.d.ts +3 -1
- package/dist/puck/editor/armsCache.js +20 -3
- package/dist/puck/editor/cloneSlot.d.ts +2 -0
- package/dist/puck/editor/cloneSlot.js +7 -0
- package/dist/puck/editor/copy.d.ts +42 -5
- package/dist/puck/editor/copy.js +43 -6
- package/dist/puck/editor/editor.chrome.css +44 -0
- package/dist/puck/editor/editor.css +68 -0
- package/dist/puck/editor/editor.model.d.ts +14 -0
- package/dist/puck/editor/editor.model.js +58 -1
- 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 +2 -0
- package/dist/puck/editor/localPlacements.js +29 -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 +50 -0
- package/dist/puck/editor/placementsCache.js +258 -0
- package/dist/puck/editor/sidebar.d.ts +12 -0
- package/dist/puck/editor/sidebar.js +77 -0
- package/dist/puck/editor/usePlacementNotice.d.ts +3 -0
- package/dist/puck/editor/usePlacementNotice.js +14 -0
- package/dist/puck/editor/xpGoalPuckEditorField.js +109 -98
- package/dist/puck/experimentSlotField.d.ts +3 -0
- package/dist/puck/experimentSlotField.js +15 -4
- package/dist/{admin → testSurface}/actions/DecideDialog.d.ts +2 -1
- package/dist/{admin → testSurface}/actions/DecideDialog.js +6 -4
- package/dist/{admin → testSurface}/api.js +5 -6
- package/dist/{admin → testSurface}/copy/common.d.ts +3 -1
- package/dist/{admin → testSurface}/copy/common.js +5 -1
- package/dist/{admin → testSurface}/copy/readiness.d.ts +20 -1
- package/dist/{admin → testSurface}/copy/readiness.js +25 -1
- package/dist/{admin → testSurface}/copy/testPage.d.ts +4 -0
- package/dist/{admin → testSurface}/copy/testPage.js +8 -2
- package/dist/testSurface/format/adminURL.d.ts +7 -0
- package/dist/testSurface/format/adminURL.js +9 -0
- package/dist/{admin → testSurface}/placements/placementLabels.js +1 -1
- package/dist/{admin → testSurface}/previewLinks.model.d.ts +1 -6
- package/dist/testSurface/previewLinks.model.js +4 -0
- package/dist/testSurface/readPreflight.d.ts +9 -0
- package/dist/testSurface/readPreflight.js +38 -0
- package/dist/testSurface/readinessRead.d.ts +50 -0
- package/dist/testSurface/readinessRead.js +46 -0
- package/dist/testSurface/results/results.css +64 -0
- package/dist/{admin → testSurface}/surface/contracts.d.ts +7 -2
- package/dist/testSurface/surface/editorPlacement.d.ts +21 -0
- package/dist/testSurface/surface/editorPlacement.js +60 -0
- package/dist/{admin → testSurface}/surface/pageBlock/parts.js +19 -9
- package/dist/testSurface/surface/pagePicker/pagePicker.css +10 -0
- package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.js +37 -7
- package/dist/testSurface/surface/readiness/Banner.d.ts +2 -0
- package/dist/{admin → testSurface}/surface/readiness/Banner.js +106 -68
- 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 +9 -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 +13 -0
- package/dist/{admin → testSurface}/surface/readiness/readiness.model.js +51 -36
- package/dist/{admin → testSurface}/surface/readiness/useTransition.d.ts +5 -2
- package/dist/testSurface/surface/readiness/useTransition.js +98 -0
- package/dist/{admin → testSurface}/surface/results/ResultsBody.d.ts +2 -2
- package/dist/{admin → testSurface}/surface/results/ResultsBody.js +18 -11
- package/dist/testSurface/surface/setting/setting.css +17 -0
- package/dist/{admin → testSurface}/surface/test/AdvancedSection.js +1 -0
- package/dist/testSurface/surface/test/GoalSection.d.ts +4 -0
- package/dist/{admin → testSurface}/surface/test/GoalSection.js +4 -2
- package/dist/testSurface/surface/test/LengthSection.d.ts +2 -0
- package/dist/{admin → testSurface}/surface/test/LengthSection.js +2 -1
- package/dist/{admin → testSurface}/surface/test/Rail.js +7 -4
- package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +1 -2
- 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 +5 -0
- package/dist/testSurface/surface/test/TestSurface.d.ts +19 -0
- package/dist/testSurface/surface/test/TestSurface.js +213 -0
- package/dist/testSurface/surface/test/VersionsSection.d.ts +5 -0
- package/dist/{admin → testSurface}/surface/test/VersionsSection.js +13 -6
- package/dist/testSurface/surface/test/testPage.css +104 -0
- package/dist/{admin → testSurface}/surface/useTestDocument.d.ts +9 -2
- package/dist/{admin → testSurface}/surface/useTestDocument.js +92 -46
- package/dist/{admin → testSurface}/surfaceUrls.js +1 -1
- package/dist/testSurface/useReadinessPolling.d.ts +3 -0
- package/dist/testSurface/useReadinessPolling.js +24 -0
- package/dist/transitions/placementInteractions.js +1 -1
- package/dist/transitions/placements.d.ts +27 -8
- package/dist/transitions/placements.js +77 -6
- package/dist/transitions/preflightData.js +1 -1
- package/dist/transitions/start.js +2 -2
- package/dist/types/endpoints.d.ts +1 -1
- package/dist/ui/Card.d.ts +2 -1
- package/dist/ui/Card.js +4 -4
- package/dist/ui/Dialog.d.ts +4 -1
- package/dist/ui/Dialog.js +41 -3
- package/dist/ui/Drawer.d.ts +10 -0
- package/dist/ui/Drawer.js +29 -0
- package/dist/ui/Tabs.d.ts +4 -3
- package/dist/ui/Tabs.js +47 -32
- package/dist/ui/ui.css +24 -0
- package/package.json +1 -1
- package/dist/admin/actions/ConfirmDialog.d.ts +0 -19
- package/dist/admin/actions/ConfirmDialog.js +0 -149
- 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/pagePicker/pagePicker.css +0 -10
- package/dist/admin/surface/readiness/Banner.d.ts +0 -5
- package/dist/admin/surface/readiness/SaveStatus.d.ts +0 -5
- package/dist/admin/surface/readiness/SaveStatus.js +0 -53
- 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 -48
- package/dist/admin/surface/test/VersionsSection.d.ts +0 -4
- package/dist/admin/surface/test/testPage.css +0 -92
- /package/dist/{admin → testSurface}/PreviewLinks.d.ts +0 -0
- /package/dist/{admin → testSurface}/PreviewLinks.js +0 -0
- /package/dist/{admin → testSurface}/actions/MakeContentResult.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/MakeContentResult.js +0 -0
- /package/dist/{admin → testSurface}/actions/actions.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/actions.model.js +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}/api.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}/copy/actions.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/actions.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/metrics.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/metrics.js +0 -0
- /package/dist/{admin → testSurface}/copy/pages.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/pages.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/results.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/results.js +0 -0
- /package/dist/{admin → testSurface}/copy/review.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/review.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}/copy/surface.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/surface.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.d.ts +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/VerdictHero.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/VerdictHero.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/results.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/pageBlock.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/CopyRoute.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/CopyRoute.js +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/PageCombobox.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/PageCombobox.js +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/ReleasePages.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/ReleasePages.js +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/results/useResults.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/useResults.js +0 -0
- /package/dist/{admin → testSurface}/surface/setting/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/setting/parts.js +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/PageHoldout.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/Rail.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/TargetingSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/fields.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/fields.js +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}/surface/test/pageParts.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/testPage.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/testPage.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/testDocument.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/testDocument.model.js +0 -0
- /package/dist/{admin → testSurface}/surfaceUrls.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.d.ts +0 -0
- /package/dist/{admin → testSurface}/useApi.js +0 -0
|
@@ -39,3 +39,10 @@ function freshId(type, used) {
|
|
|
39
39
|
}
|
|
40
40
|
return clone(slot);
|
|
41
41
|
}
|
|
42
|
+
/** Count the Puck blocks that will be removed, including nested version content. */ export function countSlotBlocks(value) {
|
|
43
|
+
if (!value || typeof value !== 'object') return 0;
|
|
44
|
+
if (Array.isArray(value)) return value.reduce((total, item)=>total + countSlotBlocks(item), 0);
|
|
45
|
+
const node = value;
|
|
46
|
+
const own = typeof node.type === 'string' && node.props && typeof node.props === 'object' ? 1 : 0;
|
|
47
|
+
return own + Object.values(node).reduce((total, item)=>total + countSlotBlocks(item), 0);
|
|
48
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare const editorCopy: {
|
|
2
|
+
readonly retrySetup: "Retry";
|
|
3
|
+
readonly controlsUnavailable: "Test controls couldn't load.";
|
|
4
|
+
readonly setupForbidden: "You don't have access to set up tests.";
|
|
5
|
+
readonly setupUnavailable: "Setup isn't available right now.";
|
|
2
6
|
readonly labels: {
|
|
3
7
|
readonly control: "Original";
|
|
4
8
|
readonly variantA: "Variant A";
|
|
@@ -6,6 +10,11 @@ export declare const editorCopy: {
|
|
|
6
10
|
readonly variantC: "Variant C";
|
|
7
11
|
readonly holdout: "Holdout";
|
|
8
12
|
};
|
|
13
|
+
readonly configure: "Configure test";
|
|
14
|
+
readonly openInTab: "Open in a new tab";
|
|
15
|
+
readonly closeConfigure: "Close";
|
|
16
|
+
readonly selectBlock: "Select this test block";
|
|
17
|
+
readonly placementsError: "Couldn't check where this test is used. Try again.";
|
|
9
18
|
readonly notSetUp: "Not set up";
|
|
10
19
|
readonly unbound: "Choose or create a test to show different versions.";
|
|
11
20
|
readonly draft: "This block shows the Original to everyone until the test starts.";
|
|
@@ -13,29 +22,57 @@ export declare const editorCopy: {
|
|
|
13
22
|
readonly decided: (winner: string) => string;
|
|
14
23
|
readonly archived: "This test is archived; the winning content is shown to everyone.";
|
|
15
24
|
readonly copy: "Copy Original here";
|
|
25
|
+
readonly copyEmpty: "Add content to the Original before copying it.";
|
|
26
|
+
readonly enterName: "Enter a name to create the test.";
|
|
27
|
+
readonly loadingBeforeNew: "Wait for this test to load before starting a new one.";
|
|
28
|
+
readonly checkingRemoval: "Checking whether this test can be removed…";
|
|
16
29
|
readonly dropZone: (slot: "control" | "variantA" | "variantB" | "variantC") => string;
|
|
17
30
|
readonly replaceConfirm: (label: string) => string;
|
|
18
31
|
readonly replace: "Replace";
|
|
19
32
|
readonly createLabel: "Test this block";
|
|
33
|
+
readonly newTest: "Start a new test from this block";
|
|
34
|
+
readonly sharedTest: "This test is also used in another place. Changes here affect that test.";
|
|
35
|
+
readonly detach: "Remove the test from this block";
|
|
36
|
+
readonly detachTitle: "Remove the test from this block?";
|
|
37
|
+
readonly detachHelp: "Show the Original on this page? All version content stays in this block. The test and its results are kept. Save the page to keep this change.";
|
|
38
|
+
readonly stopToDetach: "Stop the test to remove it from this block.";
|
|
39
|
+
readonly detachRunningHelp: "Show the Original here? The test keeps running in its other place. All version content stays in this block. Save the page to keep this change.";
|
|
40
|
+
readonly createdUnbound: "The test was created, but this block changed or was removed. Open the test to continue.";
|
|
20
41
|
readonly creating: "Creating…";
|
|
21
42
|
readonly cancel: "Cancel";
|
|
22
43
|
readonly name: "Name";
|
|
23
|
-
readonly
|
|
24
|
-
readonly viewResults: "View results";
|
|
44
|
+
readonly openTest: "Open the test";
|
|
25
45
|
readonly nameExists: "This name is too close to an existing test. Choose a different name.";
|
|
26
46
|
readonly createError: "Couldn't create the test. Try again.";
|
|
47
|
+
readonly savingVersions: "Saving version changes…";
|
|
48
|
+
readonly refreshing: "Refreshing results…";
|
|
27
49
|
readonly loading: "Loading test…";
|
|
28
50
|
readonly loadError: "Couldn't load this test. Try selecting it again.";
|
|
29
|
-
readonly orphan: (label: string) => string;
|
|
51
|
+
readonly orphan: (label: string, versions: string) => string;
|
|
52
|
+
readonly addLeftover: "Add to the test";
|
|
53
|
+
readonly deleteContent: "Delete its content";
|
|
54
|
+
readonly deleteContentTitle: (label: string) => string;
|
|
55
|
+
readonly deleteContentHelp: (label: string, count: number) => string;
|
|
56
|
+
readonly draftOnly: "Only draft tests can add this version. Start a new test from this block to include it.";
|
|
57
|
+
readonly leftovers: (labels: string) => string;
|
|
58
|
+
readonly outsideTest: (label: string) => string;
|
|
30
59
|
readonly tabs: "Test versions";
|
|
31
60
|
readonly add: "Add variant";
|
|
32
61
|
readonly menu: (label: string) => string;
|
|
62
|
+
readonly testGroup: "Test";
|
|
63
|
+
readonly versionsGroup: "Versions";
|
|
64
|
+
readonly actionsGroup: "Actions";
|
|
65
|
+
readonly options: "Options";
|
|
66
|
+
readonly runningVersions: "Versions can't change while the test runs.";
|
|
67
|
+
readonly removeVersion: "Remove version";
|
|
33
68
|
readonly rename: "Rename";
|
|
34
69
|
readonly renameLabel: "Version name";
|
|
35
70
|
readonly emptyLabel: "Enter a name for this version.";
|
|
36
71
|
readonly remove: "Remove";
|
|
37
72
|
readonly removeTitle: (label: string) => string;
|
|
38
|
-
readonly removeHelp:
|
|
73
|
+
readonly removeHelp: (count: number) => string;
|
|
74
|
+
readonly removeShared: "This test is also used in another place. The version is removed from the test there too.";
|
|
75
|
+
readonly removeScopeUnknown: "If this test is used on other pages, the version is removed from the test there too.";
|
|
39
76
|
readonly removed: "Save the page to finish removing this version's content.";
|
|
40
77
|
readonly removeUncleared: "The version was removed from the test, but its content couldn't be cleared here. Delete it from the outline, then save the page.";
|
|
41
78
|
readonly lockedGeneric: "This test's versions can't change. View the test page for details.";
|
|
@@ -53,7 +90,7 @@ export declare const editorCopy: {
|
|
|
53
90
|
readonly writeNetwork: "Couldn't reach the server. Check your connection and try again.";
|
|
54
91
|
readonly writeUnreadable: "Couldn't read the server's response. Reload and try again.";
|
|
55
92
|
readonly collecting: "Collecting";
|
|
56
|
-
readonly resultsUnavailable: "Results aren't available here.";
|
|
93
|
+
readonly resultsUnavailable: "Results aren't available here. Try Refresh.";
|
|
57
94
|
readonly refresh: "Refresh";
|
|
58
95
|
readonly people: (label: string, count: string) => string;
|
|
59
96
|
};
|
package/dist/puck/editor/copy.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { ARM_LABELS } from '../../labels/arms.js';
|
|
2
2
|
export const editorCopy = {
|
|
3
|
+
retrySetup: 'Retry',
|
|
4
|
+
controlsUnavailable: "Test controls couldn't load.",
|
|
5
|
+
setupForbidden: "You don't have access to set up tests.",
|
|
6
|
+
setupUnavailable: "Setup isn't available right now.",
|
|
3
7
|
labels: ARM_LABELS,
|
|
8
|
+
configure: 'Configure test',
|
|
9
|
+
openInTab: 'Open in a new tab',
|
|
10
|
+
closeConfigure: 'Close',
|
|
11
|
+
selectBlock: 'Select this test block',
|
|
12
|
+
placementsError: "Couldn't check where this test is used. Try again.",
|
|
4
13
|
notSetUp: 'Not set up',
|
|
5
14
|
unbound: 'Choose or create a test to show different versions.',
|
|
6
15
|
draft: 'This block shows the Original to everyone until the test starts.',
|
|
@@ -8,29 +17,57 @@ export const editorCopy = {
|
|
|
8
17
|
decided: (winner)=>`Decided: ${winner}. Use 'Make it the content' on the test to finish.`,
|
|
9
18
|
archived: 'This test is archived; the winning content is shown to everyone.',
|
|
10
19
|
copy: 'Copy Original here',
|
|
20
|
+
copyEmpty: 'Add content to the Original before copying it.',
|
|
21
|
+
enterName: 'Enter a name to create the test.',
|
|
22
|
+
loadingBeforeNew: 'Wait for this test to load before starting a new one.',
|
|
23
|
+
checkingRemoval: 'Checking whether this test can be removed…',
|
|
11
24
|
dropZone: (slot)=>slot === 'control' ? 'Drop the original content here' : `Drop ${editorCopy.labels[slot]} content here`,
|
|
12
25
|
replaceConfirm: (label)=>`${label} already has content. Replace it with a copy of the Original?`,
|
|
13
26
|
replace: 'Replace',
|
|
14
27
|
createLabel: 'Test this block',
|
|
28
|
+
newTest: 'Start a new test from this block',
|
|
29
|
+
sharedTest: 'This test is also used in another place. Changes here affect that test.',
|
|
30
|
+
detach: 'Remove the test from this block',
|
|
31
|
+
detachTitle: 'Remove the test from this block?',
|
|
32
|
+
detachHelp: 'Show the Original on this page? All version content stays in this block. The test and its results are kept. Save the page to keep this change.',
|
|
33
|
+
stopToDetach: 'Stop the test to remove it from this block.',
|
|
34
|
+
detachRunningHelp: 'Show the Original here? The test keeps running in its other place. All version content stays in this block. Save the page to keep this change.',
|
|
35
|
+
createdUnbound: 'The test was created, but this block changed or was removed. Open the test to continue.',
|
|
15
36
|
creating: 'Creating…',
|
|
16
37
|
cancel: 'Cancel',
|
|
17
38
|
name: 'Name',
|
|
18
|
-
|
|
19
|
-
viewResults: 'View results',
|
|
39
|
+
openTest: 'Open the test',
|
|
20
40
|
nameExists: "This name is too close to an existing test. Choose a different name.",
|
|
21
41
|
createError: "Couldn't create the test. Try again.",
|
|
42
|
+
savingVersions: 'Saving version changes…',
|
|
43
|
+
refreshing: 'Refreshing results…',
|
|
22
44
|
loading: 'Loading test…',
|
|
23
45
|
loadError: "Couldn't load this test. Try selecting it again.",
|
|
24
|
-
orphan: (label)=>`${label} has content
|
|
46
|
+
orphan: (label, versions)=>`${label} has content on this page, but the test only has ${versions}. Visitors never see it.`,
|
|
47
|
+
addLeftover: 'Add to the test',
|
|
48
|
+
deleteContent: 'Delete its content',
|
|
49
|
+
deleteContentTitle: (label)=>`Delete ${label} content?`,
|
|
50
|
+
deleteContentHelp: (label, count)=>`This deletes the ${count} ${count === 1 ? 'block' : 'blocks'} in ${label} from this page. Save the page to keep this change.`,
|
|
51
|
+
draftOnly: 'Only draft tests can add this version. Start a new test from this block to include it.',
|
|
52
|
+
leftovers: (labels)=>`3 versions have content outside this test: ${labels}. Visitors never see them.`,
|
|
53
|
+
outsideTest: (label)=>`${label} · not in this test`,
|
|
25
54
|
tabs: 'Test versions',
|
|
26
55
|
add: 'Add variant',
|
|
27
56
|
menu: (label)=>`Options for ${label}`,
|
|
57
|
+
testGroup: 'Test',
|
|
58
|
+
versionsGroup: 'Versions',
|
|
59
|
+
actionsGroup: 'Actions',
|
|
60
|
+
options: 'Options',
|
|
61
|
+
runningVersions: "Versions can't change while the test runs.",
|
|
62
|
+
removeVersion: 'Remove version',
|
|
28
63
|
rename: 'Rename',
|
|
29
64
|
renameLabel: 'Version name',
|
|
30
65
|
emptyLabel: 'Enter a name for this version.',
|
|
31
66
|
remove: 'Remove',
|
|
32
67
|
removeTitle: (label)=>`Remove ${label}?`,
|
|
33
|
-
removeHelp: 'This removes the version from the test and
|
|
68
|
+
removeHelp: (count)=>count === 0 ? 'This removes the version from the test.' : `This removes the version from the test and deletes its ${count} ${count === 1 ? 'block' : 'blocks'} from this page. Save the page to keep this change.`,
|
|
69
|
+
removeShared: 'This test is also used in another place. The version is removed from the test there too.',
|
|
70
|
+
removeScopeUnknown: 'If this test is used on other pages, the version is removed from the test there too.',
|
|
34
71
|
removed: "Save the page to finish removing this version's content.",
|
|
35
72
|
removeUncleared: "The version was removed from the test, but its content couldn't be cleared here. Delete it from the outline, then save the page.",
|
|
36
73
|
lockedGeneric: "This test's versions can't change. View the test page for details.",
|
|
@@ -48,11 +85,11 @@ export const editorCopy = {
|
|
|
48
85
|
writeNetwork: "Couldn't reach the server. Check your connection and try again.",
|
|
49
86
|
writeUnreadable: "Couldn't read the server's response. Reload and try again.",
|
|
50
87
|
collecting: 'Collecting',
|
|
51
|
-
resultsUnavailable: "Results aren't available here.",
|
|
88
|
+
resultsUnavailable: "Results aren't available here. Try Refresh.",
|
|
52
89
|
refresh: 'Refresh',
|
|
53
90
|
people: (label, count)=>`${label}: ${count} people`
|
|
54
91
|
};
|
|
55
|
-
// Minimal editor-side equivalent of
|
|
92
|
+
// Minimal editor-side equivalent of testSurface/copy/common.ts: kept local to the editor creation flow.
|
|
56
93
|
// Never accept server text as a fallback.
|
|
57
94
|
export function writeRefusal(code, status) {
|
|
58
95
|
if (code === 'stale-edit') return editorCopy.staleEdit;
|
|
@@ -21,6 +21,17 @@
|
|
|
21
21
|
flex-wrap: wrap;
|
|
22
22
|
align-items: center;
|
|
23
23
|
gap: var(--xp-space-2);
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.xp-slot-chrome[data-selected='true'] {
|
|
28
|
+
border-color: var(--xp-focus);
|
|
29
|
+
box-shadow: inset 0 0 0 2px var(--xp-focus);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.xp-slot-header:focus-visible {
|
|
33
|
+
outline: 2px solid var(--xp-focus);
|
|
34
|
+
outline-offset: 2px;
|
|
24
35
|
}
|
|
25
36
|
|
|
26
37
|
.xp-slot-title {
|
|
@@ -133,3 +144,36 @@
|
|
|
133
144
|
border-color: var(--xp-border-strong);
|
|
134
145
|
color: var(--xp-text-2);
|
|
135
146
|
}
|
|
147
|
+
|
|
148
|
+
.xp-slot-control-events { display: contents; }
|
|
149
|
+
|
|
150
|
+
/* The configure surface is opt-in and always outside the Puck component tree. */
|
|
151
|
+
.xp-slot-editor.xp-configure-host .xp-ui-drawer { margin: 0; }
|
|
152
|
+
.xp-configure-panel { font: var(--xp-text-body); color: var(--xp-text); }
|
|
153
|
+
.xp-configure-panel .xp-test-page { margin: 0; padding: var(--xp-space-5); min-width: 0; }
|
|
154
|
+
.xp-configure-panel .xp-test-layout { grid-template-columns: minmax(0, 1fr); gap: var(--xp-space-5); }
|
|
155
|
+
.xp-configure-panel .xp-test-content { max-width: none; gap: var(--xp-space-5); }
|
|
156
|
+
.xp-configure-panel .xp-test-rail { position: static; }
|
|
157
|
+
.xp-configure-panel .xp-test-rail-list { flex-direction: row; overflow-x: auto; }
|
|
158
|
+
.xp-configure-panel .xp-test-rail-item { white-space: nowrap; }
|
|
159
|
+
.xp-configure-panel .xp-test-rail-item--advanced { margin-top: 0; }
|
|
160
|
+
.xp-configure-panel .xp-test-readiness-bar { position: sticky; bottom: 0; margin: var(--xp-space-5) calc(-1 * var(--xp-space-5)) calc(-1 * var(--xp-space-5)); }
|
|
161
|
+
.xp-configure-panel .xp-readiness--bar { grid-template-columns: minmax(0, 1fr); padding: var(--xp-space-4) var(--xp-space-5); }
|
|
162
|
+
.xp-configure-panel .xp-readiness--bar > .xp-readiness__actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
|
|
163
|
+
.xp-configure-panel .xp-readiness__separator { display: none; }
|
|
164
|
+
.xp-configure-panel .xp-targeting-row { grid-template-columns: minmax(0, 1fr); }
|
|
165
|
+
.xp-configure-panel .xp-targeting-row > * { min-width: 0; }
|
|
166
|
+
.xp-configure-panel .xp-version-rows { grid-template-columns: minmax(0, 1fr) var(--xp-version-share-width-mobile); }
|
|
167
|
+
.xp-configure-panel .xp-version-content, .xp-configure-panel .xp-version-remove { grid-column: 1 / -1; }
|
|
168
|
+
.xp-configure-panel .xp-version-grid-head > :nth-child(n+3) { display: none; }
|
|
169
|
+
|
|
170
|
+
.xp-slot-editor .xp-ui-tabbar { flex: 1 1 auto; min-width: 0; }
|
|
171
|
+
|
|
172
|
+
.xp-slot-weight-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--xp-space-2); }
|
|
173
|
+
.xp-slot-sidebar { display: grid; gap: var(--xp-space-4); }
|
|
174
|
+
.xp-slot-sidebar section, .xp-slot-sidebar section > div { display: grid; gap: var(--xp-space-3); }
|
|
175
|
+
.xp-slot-sidebar h4 { margin: 0; font: inherit; font-weight: 600; }
|
|
176
|
+
.xp-slot-sidebar .xp-slot-weight-inputs { display: grid; }
|
|
177
|
+
.xp-slot-sidebar .xp-slot-weight-inputs .xp-ui-field { max-width: none; flex: 1 1 100%; }
|
|
178
|
+
|
|
179
|
+
.xp-slot-sidebar .xp-slot-version-menu { inset-inline-start: 0; inset-inline-end: auto; }
|
|
@@ -355,6 +355,30 @@
|
|
|
355
355
|
.xp-ui-field-label { display: flex; align-items: center; justify-content: space-between; gap: var(--xp-space-3); }
|
|
356
356
|
.xp-ui-field-label > label { font-weight: 500; }
|
|
357
357
|
|
|
358
|
+
.xp-ui-dialog.xp-ui-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(720px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border-block: 0; border-inline-end: 0; padding: 0; overflow: hidden; }
|
|
359
|
+
.xp-ui-drawer[open] { display: flex; flex-direction: column; }
|
|
360
|
+
.xp-ui-drawer > .xp-ui-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: var(--xp-space-4); padding: var(--xp-space-4) var(--xp-space-5); border-bottom: 1px solid var(--xp-border); flex-shrink: 0; background: var(--xp-surface); }
|
|
361
|
+
.xp-ui-drawer > .xp-ui-dialog-header h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; font: var(--xp-text-title); }
|
|
362
|
+
.xp-ui-drawer-body { min-height: 0; overflow: auto; overscroll-behavior: contain; flex: 1; background: var(--xp-bg); }
|
|
363
|
+
|
|
364
|
+
.xp-ui-section--blocked { border-color: var(--xp-error-border); }
|
|
365
|
+
.xp-ui-section--blocked .xp-ui-section-number, .xp-ui-section--blocked .xp-ui-section-complete { color: var(--xp-error); border-color: var(--xp-error-border); }
|
|
366
|
+
.xp-ui-section--complete .xp-ui-section-complete { color: var(--xp-success); }
|
|
367
|
+
.xp-ui-section--complete .xp-ui-section-number { color: var(--xp-success); border-color: var(--xp-success); }
|
|
368
|
+
.xp-ui-section--blocked h2:focus { outline-color: var(--xp-error); }
|
|
369
|
+
|
|
370
|
+
.xp-ui-section--blocked .xp-ui-section-complete { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--xp-error-border); border-radius: 50%; }
|
|
371
|
+
|
|
372
|
+
/* Actions sit beside each tab visually and outside the tablist's owned roles. */
|
|
373
|
+
.xp-ui-tabbar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 4px; border-bottom: 1px solid var(--xp-border); }
|
|
374
|
+
.xp-ui-tabbar > .xp-ui-tablist { display: contents; }
|
|
375
|
+
.xp-ui-tab-actions { display: flex; align-items: center; flex-wrap: wrap; position: relative; }
|
|
376
|
+
|
|
377
|
+
/* One blocker-list format in the admin footer and the Puck sidebar. */
|
|
378
|
+
.xp-readiness__blockers, .xp-readiness__blockers a { color: var(--xp-error); }
|
|
379
|
+
.xp-readiness__blockers ul { margin: 0; padding-inline-start: var(--xp-space-4); }
|
|
380
|
+
.xp-readiness__blockers li { white-space: pre-line; }
|
|
381
|
+
|
|
358
382
|
/* Shared UI controls are assembled into editor.css for the isolated canvas. */
|
|
359
383
|
.xp-slot-editor {
|
|
360
384
|
min-width: 0;
|
|
@@ -378,6 +402,17 @@
|
|
|
378
402
|
flex-wrap: wrap;
|
|
379
403
|
align-items: center;
|
|
380
404
|
gap: var(--xp-space-2);
|
|
405
|
+
cursor: pointer;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.xp-slot-chrome[data-selected='true'] {
|
|
409
|
+
border-color: var(--xp-focus);
|
|
410
|
+
box-shadow: inset 0 0 0 2px var(--xp-focus);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.xp-slot-header:focus-visible {
|
|
414
|
+
outline: 2px solid var(--xp-focus);
|
|
415
|
+
outline-offset: 2px;
|
|
381
416
|
}
|
|
382
417
|
|
|
383
418
|
.xp-slot-title {
|
|
@@ -490,3 +525,36 @@
|
|
|
490
525
|
border-color: var(--xp-border-strong);
|
|
491
526
|
color: var(--xp-text-2);
|
|
492
527
|
}
|
|
528
|
+
|
|
529
|
+
.xp-slot-control-events { display: contents; }
|
|
530
|
+
|
|
531
|
+
/* The configure surface is opt-in and always outside the Puck component tree. */
|
|
532
|
+
.xp-slot-editor.xp-configure-host .xp-ui-drawer { margin: 0; }
|
|
533
|
+
.xp-configure-panel { font: var(--xp-text-body); color: var(--xp-text); }
|
|
534
|
+
.xp-configure-panel .xp-test-page { margin: 0; padding: var(--xp-space-5); min-width: 0; }
|
|
535
|
+
.xp-configure-panel .xp-test-layout { grid-template-columns: minmax(0, 1fr); gap: var(--xp-space-5); }
|
|
536
|
+
.xp-configure-panel .xp-test-content { max-width: none; gap: var(--xp-space-5); }
|
|
537
|
+
.xp-configure-panel .xp-test-rail { position: static; }
|
|
538
|
+
.xp-configure-panel .xp-test-rail-list { flex-direction: row; overflow-x: auto; }
|
|
539
|
+
.xp-configure-panel .xp-test-rail-item { white-space: nowrap; }
|
|
540
|
+
.xp-configure-panel .xp-test-rail-item--advanced { margin-top: 0; }
|
|
541
|
+
.xp-configure-panel .xp-test-readiness-bar { position: sticky; bottom: 0; margin: var(--xp-space-5) calc(-1 * var(--xp-space-5)) calc(-1 * var(--xp-space-5)); }
|
|
542
|
+
.xp-configure-panel .xp-readiness--bar { grid-template-columns: minmax(0, 1fr); padding: var(--xp-space-4) var(--xp-space-5); }
|
|
543
|
+
.xp-configure-panel .xp-readiness--bar > .xp-readiness__actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
|
|
544
|
+
.xp-configure-panel .xp-readiness__separator { display: none; }
|
|
545
|
+
.xp-configure-panel .xp-targeting-row { grid-template-columns: minmax(0, 1fr); }
|
|
546
|
+
.xp-configure-panel .xp-targeting-row > * { min-width: 0; }
|
|
547
|
+
.xp-configure-panel .xp-version-rows { grid-template-columns: minmax(0, 1fr) var(--xp-version-share-width-mobile); }
|
|
548
|
+
.xp-configure-panel .xp-version-content, .xp-configure-panel .xp-version-remove { grid-column: 1 / -1; }
|
|
549
|
+
.xp-configure-panel .xp-version-grid-head > :nth-child(n+3) { display: none; }
|
|
550
|
+
|
|
551
|
+
.xp-slot-editor .xp-ui-tabbar { flex: 1 1 auto; min-width: 0; }
|
|
552
|
+
|
|
553
|
+
.xp-slot-weight-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--xp-space-2); }
|
|
554
|
+
.xp-slot-sidebar { display: grid; gap: var(--xp-space-4); }
|
|
555
|
+
.xp-slot-sidebar section, .xp-slot-sidebar section > div { display: grid; gap: var(--xp-space-3); }
|
|
556
|
+
.xp-slot-sidebar h4 { margin: 0; font: inherit; font-weight: 600; }
|
|
557
|
+
.xp-slot-sidebar .xp-slot-weight-inputs { display: grid; }
|
|
558
|
+
.xp-slot-sidebar .xp-slot-weight-inputs .xp-ui-field { max-width: none; flex: 1 1 100%; }
|
|
559
|
+
|
|
560
|
+
.xp-slot-sidebar .xp-slot-version-menu { inset-inline-start: 0; inset-inline-end: auto; }
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Arm, DocId, Status, UnitType } from '../../types/contracts.js';
|
|
2
2
|
import type { ArmSlot } from '../../types/puck.js';
|
|
3
|
+
import type { PreflightResult } from '../../types/endpoints.js';
|
|
3
4
|
export type EditorExperiment = {
|
|
4
5
|
name: string;
|
|
5
6
|
updatedAt?: string;
|
|
@@ -14,6 +15,18 @@ export declare function tabsFor(experiment?: Pick<EditorExperiment, 'arms'> | nu
|
|
|
14
15
|
label: string;
|
|
15
16
|
}>;
|
|
16
17
|
export declare function bannerFor(status?: Status | null, winner?: string): string;
|
|
18
|
+
/** Preserve the block's populated slots and the current test's versions, without carrying test settings. */
|
|
19
|
+
export declare function armsFromBlock(experiment: Pick<EditorExperiment, 'arms'>, content: Partial<Record<ArmSlot, unknown>>): Arm[];
|
|
20
|
+
/** The host's Payload Puck editor route identifies the saved document, including in an iframe. */
|
|
21
|
+
export declare function currentPuckDocument(pathname: string, admin: string, placements?: PreflightResult['placements']): {
|
|
22
|
+
collection: string;
|
|
23
|
+
id: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
/** Saved placements elsewhere are shared; current-page multiplicity comes from live Puck data. */
|
|
26
|
+
export declare function isSharedTest(placements: PreflightResult['placements'], current?: {
|
|
27
|
+
collection: string;
|
|
28
|
+
id: DocId;
|
|
29
|
+
}): boolean;
|
|
17
30
|
export declare function slugify(name: string): string;
|
|
18
31
|
/** Complete draft defaults, shared by the page hand-off and setting creation. */
|
|
19
32
|
export declare function newTestBody(input: {
|
|
@@ -25,6 +38,7 @@ export declare function newTestBody(input: {
|
|
|
25
38
|
flagPoint?: string;
|
|
26
39
|
layer?: DocId;
|
|
27
40
|
hypothesis?: string;
|
|
41
|
+
arms?: Arm[];
|
|
28
42
|
}): {
|
|
29
43
|
hypothesis?: string | undefined;
|
|
30
44
|
layer?: DocId | undefined;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { placementPages } from '../../lib/placementPages.js';
|
|
2
|
+
import { splitEvenly } from '../../arms/model.js';
|
|
1
3
|
import { editorCopy } from './copy.js';
|
|
2
4
|
export function tabsFor(experiment) {
|
|
3
5
|
if (!experiment) return [
|
|
@@ -28,12 +30,67 @@ export function bannerFor(status, winner = editorCopy.labels.control) {
|
|
|
28
30
|
return editorCopy.unbound;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
33
|
+
/** Preserve the block's populated slots and the current test's versions, without carrying test settings. */ export function armsFromBlock(experiment, content) {
|
|
34
|
+
const slots = [
|
|
35
|
+
'control',
|
|
36
|
+
'variantA',
|
|
37
|
+
'variantB',
|
|
38
|
+
'variantC'
|
|
39
|
+
];
|
|
40
|
+
return splitEvenly(slots.flatMap((slot)=>{
|
|
41
|
+
const arm = experiment.arms.find((arm)=>arm.key === slot && arm.kind !== 'holdout');
|
|
42
|
+
if (slot !== 'control' && !arm && !(Array.isArray(content[slot]) && content[slot].length > 0)) return [];
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
key: slot,
|
|
46
|
+
slot,
|
|
47
|
+
kind: slot === 'control' ? 'control' : 'variant',
|
|
48
|
+
label: arm?.label.trim() || editorCopy.labels[slot],
|
|
49
|
+
weight: 0
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
/** The host's Payload Puck editor route identifies the saved document, including in an iframe. */ export function currentPuckDocument(pathname, admin, placements = []) {
|
|
55
|
+
const linked = placements.find((page)=>{
|
|
56
|
+
try {
|
|
57
|
+
return page.editorUrl && new URL(page.editorUrl, 'https://puck.local').pathname === pathname;
|
|
58
|
+
} catch {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
if (linked) return {
|
|
63
|
+
collection: linked.collection,
|
|
64
|
+
id: String(linked.id)
|
|
65
|
+
};
|
|
66
|
+
if (!pathname.startsWith(`${admin}/`)) return;
|
|
67
|
+
let parts;
|
|
68
|
+
try {
|
|
69
|
+
parts = pathname.slice(admin.length + 1).split('/').map(decodeURIComponent);
|
|
70
|
+
} catch {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (![
|
|
74
|
+
'puck',
|
|
75
|
+
'puck-editor',
|
|
76
|
+
'collections'
|
|
77
|
+
].includes(parts[0] ?? '') || !parts[1] || !parts[2] || parts[2] === 'create') return;
|
|
78
|
+
return {
|
|
79
|
+
collection: parts[1],
|
|
80
|
+
id: parts[2]
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** Saved placements elsewhere are shared; current-page multiplicity comes from live Puck data. */ export function isSharedTest(placements, current) {
|
|
84
|
+
return placementPages(placements).some((page)=>page.collection !== current?.collection || String(page.id) !== String(current.id));
|
|
85
|
+
}
|
|
31
86
|
export function slugify(name) {
|
|
32
87
|
return name.normalize('NFKD').replace(/[\u0300-\u036f]/g, '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 64).replace(/-+$/g, '');
|
|
33
88
|
}
|
|
34
89
|
/** Complete draft defaults, shared by the page hand-off and setting creation. */ export function newTestBody(input) {
|
|
35
90
|
const { kind, name, slug, unitType, flagPoint, layer, hypothesis, pageCollection } = input;
|
|
36
|
-
const arms =
|
|
91
|
+
const arms = input.arms?.map((arm)=>({
|
|
92
|
+
...arm
|
|
93
|
+
})) ?? [
|
|
37
94
|
{
|
|
38
95
|
key: 'control',
|
|
39
96
|
kind: 'control',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SurfaceProps } from '../../testSurface/surface/contracts.js';
|
|
2
|
+
export type SurfaceState = {
|
|
3
|
+
surface?: SurfaceProps;
|
|
4
|
+
error?: 'forbidden' | 'unavailable';
|
|
5
|
+
};
|
|
6
|
+
export declare function readSurface(api: string): Promise<SurfaceState>;
|
|
7
|
+
/** Share only pending requests across canvas blocks and sidebar controls. */
|
|
8
|
+
export declare function useEditorSurface(api: string): SurfaceState & {
|
|
9
|
+
retry: () => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
const pending = new Map();
|
|
4
|
+
export function readSurface(api) {
|
|
5
|
+
let request = pending.get(api);
|
|
6
|
+
if (!request) {
|
|
7
|
+
request = fetch(`${api}/xp/editor-surface`, {
|
|
8
|
+
credentials: 'include',
|
|
9
|
+
cache: 'no-store'
|
|
10
|
+
}).then(async (response)=>{
|
|
11
|
+
if (response.status === 401 || response.status === 403) return {
|
|
12
|
+
error: 'forbidden'
|
|
13
|
+
};
|
|
14
|
+
if (!response.ok) throw new Error('surface');
|
|
15
|
+
const surface = await response.json();
|
|
16
|
+
if (!surface || typeof surface.canManage !== 'boolean' || typeof surface.canReadResults !== 'boolean') throw new Error('surface');
|
|
17
|
+
return {
|
|
18
|
+
surface
|
|
19
|
+
};
|
|
20
|
+
}).catch(()=>({
|
|
21
|
+
error: 'unavailable'
|
|
22
|
+
}));
|
|
23
|
+
pending.set(api, request);
|
|
24
|
+
const release = ()=>{
|
|
25
|
+
if (pending.get(api) === request) pending.delete(api);
|
|
26
|
+
};
|
|
27
|
+
void request.then(release, release);
|
|
28
|
+
}
|
|
29
|
+
return request;
|
|
30
|
+
}
|
|
31
|
+
/** Share only pending requests across canvas blocks and sidebar controls. */ export function useEditorSurface(api) {
|
|
32
|
+
const [loaded, setLoaded] = useState();
|
|
33
|
+
const [attempt, setAttempt] = useState(0);
|
|
34
|
+
const retry = useCallback(()=>{
|
|
35
|
+
setLoaded(undefined);
|
|
36
|
+
setAttempt((value)=>value + 1);
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(()=>{
|
|
39
|
+
let active = true;
|
|
40
|
+
const load = ()=>{
|
|
41
|
+
void readSurface(api).then((state)=>{
|
|
42
|
+
if (active) setLoaded({
|
|
43
|
+
api,
|
|
44
|
+
state
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
load();
|
|
49
|
+
const onVisible = ()=>{
|
|
50
|
+
if (document.visibilityState === 'visible') load();
|
|
51
|
+
};
|
|
52
|
+
document.addEventListener('visibilitychange', onVisible);
|
|
53
|
+
return ()=>{
|
|
54
|
+
active = false;
|
|
55
|
+
document.removeEventListener('visibilitychange', onVisible);
|
|
56
|
+
};
|
|
57
|
+
}, [
|
|
58
|
+
api,
|
|
59
|
+
attempt
|
|
60
|
+
]);
|
|
61
|
+
return {
|
|
62
|
+
...loaded?.api === api ? loaded.state : {},
|
|
63
|
+
retry
|
|
64
|
+
};
|
|
65
|
+
}
|