@delmaredigital/payload-experiments 0.3.0-rc.4 → 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 +293 -688
- package/dist/admin/LayerUsage.js +1 -1
- package/dist/admin/MetricSourceSelect.js +4 -4
- package/dist/admin/PlacementStatus.d.ts +3 -0
- package/dist/admin/PlacementStatus.js +54 -0
- 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 +5 -0
- package/dist/admin/blocks/BlockPanel.js +245 -0
- package/dist/admin/blocks/TestBlockField.d.ts +5 -0
- package/dist/admin/blocks/TestBlockField.js +163 -0
- package/dist/admin/blocks/formApi.d.ts +46 -0
- package/dist/admin/blocks/formApi.js +159 -0
- package/dist/admin/blocks/inject.d.ts +7 -0
- package/dist/admin/blocks/inject.js +42 -0
- package/dist/admin/blocks/model.d.ts +18 -0
- package/dist/admin/blocks/model.js +49 -0
- package/dist/admin/blocks/statusCache.d.ts +9 -0
- package/dist/admin/blocks/statusCache.js +92 -0
- package/dist/admin/blocks/useBlockForm.d.ts +17 -0
- package/dist/admin/blocks/useBlockForm.js +46 -0
- package/dist/admin/components/RootViewMessage.js +1 -1
- package/dist/admin/copy/blocks.d.ts +47 -0
- package/dist/admin/copy/blocks.js +72 -0
- package/dist/admin/copy/goals.d.ts +8 -1
- package/dist/admin/copy/goals.js +14 -4
- package/dist/admin/copy/newTest.d.ts +13 -4
- package/dist/admin/copy/newTest.js +16 -4
- package/dist/admin/goals/XpGoalField.d.ts +4 -0
- package/dist/admin/goals/XpGoalField.js +194 -0
- package/dist/admin/goals/xpGoalField.css +47 -0
- package/dist/admin/pageCollections.d.ts +11 -0
- package/dist/admin/pageCollections.js +23 -0
- package/dist/admin/paths.d.ts +9 -0
- package/dist/admin/paths.js +9 -0
- package/dist/admin/placementStatus.model.d.ts +2 -0
- package/dist/admin/placementStatus.model.js +19 -0
- 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 +298 -59
- package/dist/admin/surface/TestsSurface.js +13 -8
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -1
- package/dist/admin/surface/goals/GoalForm.js +159 -85
- package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
- package/dist/admin/surface/goals/GoalsList.js +7 -6
- package/dist/admin/surface/goals/data.js +6 -3
- package/dist/admin/surface/goals/goals.css +7 -0
- package/dist/admin/surface/goals/goals.model.d.ts +12 -3
- package/dist/admin/surface/goals/goals.model.js +43 -2
- package/dist/admin/surface/home.model.d.ts +9 -8
- package/dist/admin/surface/home.model.js +28 -23
- package/dist/admin/surface/newTest/NewTest.d.ts +4 -4
- package/dist/admin/surface/newTest/NewTest.js +146 -101
- package/dist/admin/surface/newTest/PageWizard.d.ts +8 -0
- package/dist/admin/surface/newTest/PageWizard.js +244 -0
- 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 -57
- 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 -161
- 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 +28 -133
- 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.d.ts +3 -0
- package/dist/blocks/bindings.js +28 -0
- package/dist/blocks/createExperimentBlock.d.ts +6 -0
- package/dist/blocks/createExperimentBlock.js +77 -0
- package/dist/blocks/formState.d.ts +31 -0
- package/dist/blocks/formState.js +146 -0
- package/dist/blocks/model.d.ts +41 -0
- package/dist/blocks/model.js +34 -0
- 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/client/ExperimentGroup.d.ts +6 -0
- package/dist/client/ExperimentGroup.js +9 -0
- package/dist/client/ExperimentsProvider.js +20 -4
- package/dist/client/clickGoals.d.ts +4 -0
- package/dist/client/clickGoals.js +43 -0
- package/dist/collections/experiments/config.js +29 -10
- package/dist/collections/experiments/deleteGuard.d.ts +2 -1
- package/dist/collections/experiments/deleteGuard.js +14 -3
- package/dist/collections/experiments/editability.js +4 -2
- package/dist/collections/experiments/lockHook.js +21 -2
- package/dist/collections/experiments/pickSlug.d.ts +2 -0
- package/dist/collections/experiments/pickSlug.js +10 -0
- package/dist/collections/labels.d.ts +3 -0
- package/dist/collections/labels.js +20 -0
- package/dist/collections/metrics.js +28 -6
- package/dist/collections/metricsGuards.js +2 -0
- package/dist/collections/phases.js +1 -0
- package/dist/collections/serialize.js +12 -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/clickGoals.d.ts +9 -0
- package/dist/db/clickGoals.js +22 -0
- package/dist/db/delete.d.ts +2 -1
- package/dist/db/delete.js +3 -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/locks.d.ts +8 -0
- package/dist/db/locks.js +27 -4
- package/dist/db/names.d.ts +4 -0
- package/dist/db/names.js +4 -0
- package/dist/db/pageBindings.d.ts +4 -0
- package/dist/db/pageBindings.js +17 -0
- package/dist/db/pageBusy.d.ts +2 -0
- package/dist/db/pageBusy.js +10 -0
- package/dist/db/pageContent.d.ts +10 -0
- package/dist/db/pageContent.js +79 -0
- package/dist/db/pageCopies.d.ts +5 -0
- package/dist/db/pageCopies.js +31 -0
- package/dist/db/placements.d.ts +35 -0
- package/dist/db/placements.js +62 -0
- package/dist/db/results.d.ts +5 -1
- package/dist/db/results.js +21 -5
- package/dist/db/slugs.d.ts +8 -0
- package/dist/db/slugs.js +40 -0
- package/dist/db/snapshots.d.ts +7 -0
- package/dist/db/snapshots.js +8 -5
- package/dist/endpoints/clickKeys.d.ts +5 -0
- package/dist/endpoints/clickKeys.js +17 -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 +106 -39
- package/dist/endpoints/index.js +85 -9
- package/dist/endpoints/pages.d.ts +5 -0
- package/dist/endpoints/pages.js +303 -0
- package/dist/endpoints/placementStatus.d.ts +6 -0
- package/dist/endpoints/placementStatus.js +246 -0
- package/dist/endpoints/preflight.d.ts +1 -1
- package/dist/endpoints/preflight.js +17 -2
- package/dist/endpoints/readBody.d.ts +2 -0
- package/dist/endpoints/readBody.js +24 -0
- package/dist/endpoints/results.d.ts +1 -1
- package/dist/endpoints/results.js +10 -2
- package/dist/endpoints/routeId.d.ts +2 -2
- package/dist/endpoints/routeId.js +11 -5
- package/dist/endpoints/summary.js +46 -5
- package/dist/endpoints/testVersion.d.ts +2 -0
- package/dist/endpoints/testVersion.js +38 -0
- package/dist/endpoints/transitions.js +41 -29
- package/dist/endpoints/wrapBlock.d.ts +6 -0
- package/dist/endpoints/wrapBlock.js +76 -0
- package/dist/errors.d.ts +7 -2
- package/dist/errors.js +11 -3
- 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 +25 -7
- package/dist/events/writable.d.ts +9 -0
- package/dist/events/writable.js +13 -0
- package/dist/exports/adminClient.d.ts +6 -1
- package/dist/exports/adminClient.js +6 -1
- package/dist/exports/adminRsc.d.ts +3 -0
- package/dist/exports/adminRsc.js +3 -0
- package/dist/exports/blocks.d.ts +2 -0
- package/dist/exports/blocks.js +1 -0
- package/dist/exports/client.d.ts +1 -0
- package/dist/exports/client.js +1 -0
- package/dist/exports/index.d.ts +6 -1
- package/dist/exports/index.js +3 -0
- package/dist/exports/puck.d.ts +3 -1
- package/dist/exports/puck.js +2 -0
- package/dist/exports/puckEditor.d.ts +3 -0
- package/dist/exports/puckEditor.js +2 -0
- package/dist/exports/rsc.d.ts +4 -0
- package/dist/exports/rsc.js +3 -0
- package/dist/fields/xpGoal.d.ts +3 -0
- package/dist/fields/xpGoal.js +16 -0
- package/dist/globals/state.js +10 -0
- package/dist/goals/cache.d.ts +3 -0
- package/dist/goals/cache.js +35 -0
- package/dist/goals/fairness.d.ts +40 -0
- package/dist/goals/fairness.js +209 -0
- package/dist/goals/key.d.ts +4 -0
- package/dist/goals/key.js +3 -0
- package/dist/goals/picker/clickGoalPicker.model.d.ts +36 -0
- package/dist/goals/picker/clickGoalPicker.model.js +63 -0
- package/dist/goals/picker/copy.d.ts +20 -0
- package/dist/goals/picker/copy.js +24 -0
- package/dist/goals/picker/useClickGoalPicker.d.ts +30 -0
- package/dist/goals/picker/useClickGoalPicker.js +222 -0
- package/dist/goals/validate.d.ts +3 -0
- package/dist/goals/validate.js +15 -0
- package/dist/hooks/blockRemovalRule.d.ts +30 -0
- package/dist/hooks/blockRemovalRule.js +165 -0
- package/dist/hooks/hostHook.js +6 -2
- package/dist/hooks/pageGuard.d.ts +30 -1
- package/dist/hooks/pageGuard.js +337 -107
- 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 +65 -0
- package/dist/options.d.ts +4 -0
- package/dist/options.js +62 -1
- package/dist/plugin.js +56 -44
- 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 +6 -1
- package/dist/puck/copy.js +6 -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 +192 -19
- package/dist/puck/editor/editor.css +329 -24
- package/dist/puck/editor/editor.model.d.ts +21 -3
- package/dist/puck/editor/editor.model.js +67 -7
- 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/integration.d.ts +10 -0
- package/dist/puck/editor/integration.js +30 -0
- 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.d.ts +7 -0
- package/dist/puck/editor/xpGoalPuckEditorField.js +153 -0
- 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/integration.d.ts +6 -0
- package/dist/puck/integration.js +21 -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/puck/xpGoalField.d.ts +3 -0
- package/dist/puck/xpGoalField.js +6 -0
- package/dist/results/aggregate.d.ts +6 -3
- package/dist/results/aggregate.js +9 -9
- package/dist/results/health.d.ts +12 -0
- package/dist/results/health.js +55 -0
- package/dist/results/identityCredit.d.ts +1 -0
- package/dist/results/identityCredit.js +4 -1
- package/dist/results/snapshot.js +15 -2
- 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 +63 -2
- package/dist/server/getAssignments.js +11 -10
- package/dist/server/pageKindSeoContract.d.ts +27 -0
- package/dist/server/pageKindSeoContract.js +80 -0
- package/dist/server/recordContentChange.d.ts +1 -1
- package/dist/server/recordContentChange.js +88 -12
- package/dist/server/resolveExperimentBlocks.d.ts +5 -0
- package/dist/server/resolveExperimentBlocks.js +52 -0
- package/dist/server/resolveExperimentData.js +8 -8
- package/dist/server/runResults.js +104 -25
- package/dist/server/startExperiment.d.ts +20 -0
- package/dist/server/startExperiment.js +70 -0
- package/dist/server/toClientAssignments.js +2 -1
- package/dist/server/trackConversion.js +10 -13
- package/dist/{admin → testSurface}/PreviewLinks.d.ts +2 -1
- package/dist/{admin → testSurface}/PreviewLinks.js +8 -4
- package/dist/testSurface/actions/DecideDialog.d.ts +16 -0
- package/dist/{admin → testSurface}/actions/DecideDialog.js +79 -56
- 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/testSurface/api.d.ts +60 -0
- package/dist/testSurface/api.js +167 -0
- package/dist/testSurface/contentLocaleURL.d.ts +2 -0
- package/dist/testSurface/contentLocaleURL.js +3 -0
- package/dist/{admin → testSurface}/copy/actions.d.ts +30 -8
- package/dist/{admin → testSurface}/copy/actions.js +40 -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 +59 -6
- package/dist/testSurface/copy/readiness.js +136 -0
- package/dist/{admin → testSurface}/copy/results.d.ts +7 -3
- package/dist/{admin → testSurface}/copy/results.js +7 -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 +56 -7
- 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/{admin → testSurface}/metricSource.model.d.ts +2 -0
- package/dist/{admin → testSurface}/metricSource.model.js +4 -0
- package/dist/testSurface/placementLabel.d.ts +8 -0
- package/dist/testSurface/placementLabel.js +24 -0
- package/dist/testSurface/placements/placementLabels.d.ts +13 -0
- package/dist/testSurface/placements/placementLabels.js +22 -0
- package/dist/testSurface/placements/placementLabels.model.d.ts +13 -0
- package/dist/testSurface/placements/placementLabels.model.js +12 -0
- package/dist/testSurface/placements/usePlacementLabels.d.ts +12 -0
- package/dist/testSurface/placements/usePlacementLabels.js +102 -0
- 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/DataQualityPanel.js +4 -1
- package/dist/{admin → testSurface}/results/VerdictHero.d.ts +2 -1
- package/dist/{admin → testSurface}/results/VerdictHero.js +5 -1
- package/dist/testSurface/results/results.css +64 -0
- package/dist/{admin → testSurface}/results/results.model.d.ts +3 -0
- package/dist/{admin → testSurface}/results/results.model.js +14 -6
- package/dist/{admin → testSurface}/surface/contracts.d.ts +23 -8
- 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/testSurface/surface/pagePicker/pagePicker.model.d.ts +29 -0
- package/dist/testSurface/surface/pagePicker/pagePicker.model.js +40 -0
- 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/testSurface/surface/readiness/readiness.model.d.ts +57 -0
- 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/testSurface/surface/results/ReleasePages.d.ts +19 -0
- package/dist/{admin → testSurface}/surface/results/ReleasePages.js +43 -47
- package/dist/{admin → testSurface}/surface/results/ResultsBody.d.ts +7 -3
- package/dist/{admin → testSurface}/surface/results/ResultsBody.js +129 -46
- package/dist/{admin → testSurface}/surface/results/useResults.d.ts +36 -9
- 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/testSurface/surface/test/AdvancedSection.js +169 -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/testSurface/surface/test/GoalSection.js +341 -0
- package/dist/testSurface/surface/test/LengthSection.d.ts +2 -0
- package/dist/{admin → testSurface}/surface/test/LengthSection.js +6 -2
- package/dist/testSurface/surface/test/PageHoldout.d.ts +3 -0
- package/dist/testSurface/surface/test/PageHoldout.js +70 -0
- 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 +81 -40
- package/dist/{admin → testSurface}/surface/test/fields.d.ts +40 -8
- package/dist/testSurface/surface/test/fields.js +306 -0
- package/dist/{admin → testSurface}/surface/test/jumpToSection.d.ts +1 -1
- package/dist/{admin → testSurface}/surface/test/jumpToSection.js +4 -3
- package/dist/testSurface/surface/test/pageParts.d.ts +5 -0
- package/dist/testSurface/surface/test/pageParts.js +106 -0
- 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 +4 -0
- package/dist/{admin → testSurface}/surface/testDocument.model.js +6 -2
- 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/testSurface/useApi.d.ts +60 -0
- package/dist/testSurface/useApi.js +8 -0
- 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 +4 -6
- package/dist/transitions/addMetric.js +33 -2
- 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 +18 -1
- package/dist/transitions/checkStart.js +207 -9
- package/dist/transitions/contentFields.js +9 -5
- package/dist/transitions/decide.d.ts +1 -1
- package/dist/transitions/decide.js +30 -3
- package/dist/transitions/deleteExperiment.d.ts +5 -3
- package/dist/transitions/deleteExperiment.js +43 -7
- package/dist/transitions/kernel.d.ts +4 -0
- package/dist/transitions/kernel.js +13 -4
- package/dist/transitions/makeContent.d.ts +7 -1
- package/dist/transitions/makeContent.js +74 -22
- 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/pageCollection.d.ts +10 -0
- package/dist/transitions/pageCollection.js +20 -0
- package/dist/transitions/pageVersions.d.ts +10 -0
- package/dist/transitions/pageVersions.js +46 -0
- package/dist/transitions/phaseRecord.d.ts +3 -0
- package/dist/transitions/phaseRecord.js +5 -0
- package/dist/transitions/placementInteractions.d.ts +40 -0
- package/dist/transitions/placementInteractions.js +98 -0
- package/dist/transitions/placements.d.ts +58 -4
- package/dist/transitions/placements.js +391 -21
- package/dist/transitions/preflightData.d.ts +7 -5
- package/dist/transitions/preflightData.js +269 -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 +3 -4
- package/dist/transitions/resolveCaps.js +6 -2
- package/dist/transitions/start.d.ts +6 -8
- package/dist/transitions/start.js +112 -31
- 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/admin.d.ts +1 -1
- package/dist/types/assignments.d.ts +1 -0
- package/dist/types/contracts.d.ts +30 -3
- package/dist/types/endpoints.d.ts +204 -13
- package/dist/types/index.d.ts +3 -0
- package/dist/types/puck.d.ts +8 -1
- package/dist/types/runtime.d.ts +15 -9
- package/dist/types/snapshot.d.ts +19 -4
- package/dist/types/surface.d.ts +20 -7
- 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 +9 -1
- package/dist/admin/actions/ConfirmDialog.d.ts +0 -18
- package/dist/admin/actions/ConfirmDialog.js +0 -149
- package/dist/admin/actions/DecideDialog.d.ts +0 -9
- package/dist/admin/actions/actions.model.js +0 -70
- package/dist/admin/api.d.ts +0 -38
- package/dist/admin/api.js +0 -99
- package/dist/admin/copy/readiness.js +0 -71
- package/dist/admin/copy/testPage.js +0 -100
- 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/readiness/ActionDialogs.js +0 -302
- package/dist/admin/surface/readiness/Banner.js +0 -166
- 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.d.ts +0 -24
- package/dist/admin/surface/readiness/readiness.model.js +0 -123
- package/dist/admin/surface/readiness/useTransition.d.ts +0 -11
- package/dist/admin/surface/readiness/useTransition.js +0 -35
- package/dist/admin/surface/results/ReleasePages.d.ts +0 -14
- package/dist/admin/surface/setting/setting.css +0 -17
- package/dist/admin/surface/test/AdvancedSection.js +0 -160
- package/dist/admin/surface/test/GoalSection.d.ts +0 -2
- package/dist/admin/surface/test/GoalSection.js +0 -228
- 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 -184
- package/dist/admin/surface/test/pageParts.d.ts +0 -2
- package/dist/admin/surface/test/pageParts.js +0 -45
- package/dist/admin/surface/test/testPage.css +0 -90
- package/dist/admin/surface/useTestDocument.d.ts +0 -23
- package/dist/admin/surface/useTestDocument.js +0 -377
- package/dist/admin/useApi.d.ts +0 -35
- package/dist/admin/useApi.js +0 -10
- /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}/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/DataTable.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/DataTable.js +0 -0
- /package/dist/{admin → testSurface}/results/StatTile.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/StatTile.js +0 -0
- /package/dist/{admin → testSurface}/results/chart.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/chart.model.js +0 -0
- /package/dist/{admin → testSurface}/results/format.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/format.js +0 -0
- /package/dist/{admin → testSurface}/results/legacy.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/legacy.js +0 -0
- /package/dist/{admin → testSurface}/results/releasePages.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/releasePages.model.js +0 -0
- /package/dist/{admin → testSurface}/results/snapshot.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/snapshot.js +0 -0
- /package/dist/{admin → testSurface}/review/review.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/review/review.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/contracts.js +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/pageBlock.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/recommendation.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/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/Rail.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/TargetingSection.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
|
@@ -7,7 +7,7 @@ import type { Snapshot, VerdictCode } from './snapshot.js';
|
|
|
7
7
|
export type ArmIssueCode = 'weights-total' | 'control-count' | 'control-first' | 'holdout-last' | 'holdout-count' | 'variant-count' | 'duplicate-key' | 'duplicate-slot' | 'slot-required' | 'invalid-key';
|
|
8
8
|
/** Content-report dismiss/restore refusals (CORE-44). */
|
|
9
9
|
export type ContentEntryRefusal = 'not-decided' | 'entry-not-found' | 'entry-ok' | 'entry-dismissed' | 'entry-not-dismissed';
|
|
10
|
-
export type RefusalCode = ArmIssueCode | 'not-found' | ContentEntryRefusal | 'no-planned-duration' | 'no-primary-metric' | 'no-placements' | 'empty-slot' | 'page-in-use' | 'page-no-targets' | 'page-target-unpublished' | 'page-user-unit' | 'version-page-unavailable' | 'version-page-unchecked' | 'flag-no-point' | 'flag-params-invalid' | 'flag-point-busy' | 'flag-placement-missing' | 'layer-full' | 'layer-unit-mismatch' | 'unknown-metric-source' | 'unit-source-mismatch' | 'no-reach-per-day' | 'invalid-status' | 'stale-draft' | 'stale-edit' | 'commit-unverified' | 'allocation-lower' | 'confirmation-required' | 'invalid-winner' | 'slices-taken' | 'locked-placement' | 'not-implemented' | 'forbidden' | 'unauthenticated' | 'body-too-large' | 'invalid-body' | 'too-many-ids' | 'invalid-phase' | 'invalid-ids' | 'recompute-failed' | 'analysis-failed' | 'undeclared-targeting-key' | 'invalid-targeting-rule' | 'block-path-rule' | 'duplicate-metric';
|
|
10
|
+
export type RefusalCode = ArmIssueCode | 'copy-unavailable' | 'copy-not-enabled' | 'copy-no-access' | 'copy-unique-field' | 'copy-orphaned' | 'transaction-lost' | 'nested-tests' | 'goal-in-some-versions' | 'placement-unchecked' | 'placement-unpublished' | 'duplicate-version-row' | 'interacting-tests' | 'placements-changed' | 'page-busy' | 'wrap-target-missing' | 'version-identical' | 'version-same-address' | 'unknown-collection' | 'not-found' | ContentEntryRefusal | 'no-planned-duration' | 'no-primary-metric' | 'no-placements' | 'placement-removed' | 'empty-slot' | 'page-in-use' | 'page-no-targets' | 'page-target-unpublished' | 'page-user-unit' | 'version-page-unavailable' | 'version-page-unchecked' | 'flag-no-point' | 'flag-params-invalid' | 'flag-point-busy' | 'flag-placement-missing' | 'layer-full' | 'layer-unit-mismatch' | 'unknown-metric-source' | 'unit-source-mismatch' | 'no-reach-per-day' | 'invalid-status' | 'first-start-only' | 'stale-draft' | 'stale-edit' | 'round-changed' | 'commit-unverified' | 'allocation-lower' | 'confirmation-required' | 'invalid-winner' | 'slices-taken' | 'locked-placement' | 'not-implemented' | 'forbidden' | 'unauthenticated' | 'body-too-large' | 'invalid-body' | 'too-many-ids' | 'invalid-phase' | 'invalid-ids' | 'recompute-failed' | 'analysis-failed' | 'undeclared-targeting-key' | 'invalid-targeting-rule' | 'block-path-rule' | 'duplicate-metric';
|
|
11
11
|
export type ErrorEnvelope = {
|
|
12
12
|
errors: Array<{
|
|
13
13
|
code: RefusalCode;
|
|
@@ -19,19 +19,56 @@ export type TransitionSuccess = {
|
|
|
19
19
|
doc: Record<string, unknown>;
|
|
20
20
|
revision: number;
|
|
21
21
|
};
|
|
22
|
-
export type
|
|
23
|
-
|
|
22
|
+
export type StartExperimentWarning = {
|
|
23
|
+
metricId: DocId;
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
export type StartExperimentFirstStartDetail = {
|
|
27
|
+
status: Status;
|
|
28
|
+
phase: number;
|
|
29
|
+
};
|
|
30
|
+
export type StartExperimentResult = {
|
|
31
|
+
status: 'started';
|
|
32
|
+
phase: number;
|
|
33
|
+
revision: number;
|
|
34
|
+
warnings: StartExperimentWarning[];
|
|
35
|
+
} | {
|
|
36
|
+
status: 'refused';
|
|
37
|
+
code: 'first-start-only';
|
|
38
|
+
message: string;
|
|
39
|
+
detail: StartExperimentFirstStartDetail;
|
|
40
|
+
} | {
|
|
41
|
+
status: 'refused';
|
|
42
|
+
code: Exclude<RefusalCode, 'not-found' | 'commit-unverified' | 'first-start-only'> | 'transaction-open';
|
|
43
|
+
message: string;
|
|
44
|
+
detail?: unknown;
|
|
45
|
+
} | {
|
|
46
|
+
status: 'not-found';
|
|
47
|
+
};
|
|
48
|
+
export type AddMetricWarning = {
|
|
49
|
+
code: 'goal-in-some-versions' | 'goal-added-mid-test' | 'placement-unchecked';
|
|
50
|
+
detail?: unknown;
|
|
51
|
+
};
|
|
52
|
+
export type AddMetricResult = TransitionSuccess & {
|
|
53
|
+
warnings: AddMetricWarning[];
|
|
24
54
|
};
|
|
25
|
-
export type AddMetricBody = {
|
|
55
|
+
export type AddMetricBody = RoundBody & {
|
|
26
56
|
metric: DocId;
|
|
27
57
|
role: 'secondary' | 'guardrail';
|
|
28
58
|
};
|
|
29
|
-
|
|
59
|
+
/** When omitted, the action applies to the current round. */
|
|
60
|
+
export type RoundBody = {
|
|
61
|
+
phase?: number;
|
|
62
|
+
};
|
|
63
|
+
export type AllocateBody = RoundBody & {
|
|
64
|
+
allocation: number;
|
|
65
|
+
};
|
|
66
|
+
export type DecideBody = RoundBody & {
|
|
30
67
|
winnerArm: string;
|
|
31
68
|
note?: string;
|
|
32
69
|
confirmation?: string;
|
|
33
70
|
};
|
|
34
|
-
export type ArchiveBody = {
|
|
71
|
+
export type ArchiveBody = RoundBody & {
|
|
35
72
|
mode: 'stopped' | 'after-content' | 'discard' | 'hard-coded';
|
|
36
73
|
confirmation?: string;
|
|
37
74
|
};
|
|
@@ -57,19 +94,52 @@ export type MakeContentResult = TransitionSuccess & {
|
|
|
57
94
|
}>;
|
|
58
95
|
};
|
|
59
96
|
export type PreflightResult = {
|
|
97
|
+
/** Saved document version used for these checks. */
|
|
98
|
+
document?: {
|
|
99
|
+
status: Status;
|
|
100
|
+
phase?: number;
|
|
101
|
+
updatedAt?: string;
|
|
102
|
+
};
|
|
103
|
+
/** Content language selection and labels when block placements are localized. */
|
|
104
|
+
contentLocales?: {
|
|
105
|
+
selected: string;
|
|
106
|
+
labels: Record<string, string>;
|
|
107
|
+
};
|
|
108
|
+
goalNotes?: Array<{
|
|
109
|
+
metricId: DocId;
|
|
110
|
+
message: string;
|
|
111
|
+
}>;
|
|
112
|
+
/** Advisory only. This does not affect Start readiness. */
|
|
113
|
+
browserWritablePrimaryId?: DocId;
|
|
60
114
|
checks: Array<{
|
|
61
115
|
code: ReadinessCode;
|
|
62
116
|
ok: boolean;
|
|
63
117
|
detail?: unknown;
|
|
64
118
|
warning?: boolean;
|
|
65
119
|
}>;
|
|
120
|
+
pagePlacements?: Array<{
|
|
121
|
+
arm: string;
|
|
122
|
+
path: string;
|
|
123
|
+
collection?: string;
|
|
124
|
+
id?: DocId | null;
|
|
125
|
+
title?: string;
|
|
126
|
+
published: boolean;
|
|
127
|
+
slug?: string;
|
|
128
|
+
url?: string;
|
|
129
|
+
editorUrl?: string;
|
|
130
|
+
}>;
|
|
66
131
|
placements: Array<{
|
|
67
132
|
collection: string;
|
|
68
133
|
id: DocId;
|
|
69
134
|
title: string;
|
|
135
|
+
locales?: string[];
|
|
136
|
+
allLocales?: true;
|
|
137
|
+
localeCodes?: string[];
|
|
138
|
+
slotCount?: number;
|
|
70
139
|
url?: string;
|
|
71
140
|
editorUrl?: string;
|
|
72
141
|
slots?: Record<ArmSlot, number>;
|
|
142
|
+
partlyFilledSlots?: ArmSlot[];
|
|
73
143
|
ok: boolean;
|
|
74
144
|
detail?: string;
|
|
75
145
|
}>;
|
|
@@ -104,6 +174,8 @@ export interface PhaseSummary {
|
|
|
104
174
|
name: string;
|
|
105
175
|
kind: MetricSource['kind'];
|
|
106
176
|
role: 'primary' | 'secondary' | 'guardrail';
|
|
177
|
+
clickGoal?: true;
|
|
178
|
+
browserWritable?: true;
|
|
107
179
|
resolvedCap?: number | null;
|
|
108
180
|
historyUnits?: number;
|
|
109
181
|
capNotice?: 'no-history';
|
|
@@ -137,10 +209,7 @@ export type SummaryResponse = Record<DocId, {
|
|
|
137
209
|
code: ReadinessCode;
|
|
138
210
|
detail?: unknown;
|
|
139
211
|
};
|
|
140
|
-
health?:
|
|
141
|
-
code: 'version-page-unavailable' | 'version-page-unchecked';
|
|
142
|
-
path: string;
|
|
143
|
-
}>;
|
|
212
|
+
health?: import('./snapshot.js').SnapshotHealth[];
|
|
144
213
|
exposures: number;
|
|
145
214
|
days: number;
|
|
146
215
|
verdict: {
|
|
@@ -163,14 +232,136 @@ export type EventBody = {
|
|
|
163
232
|
attributes?: Record<string, string | number | boolean>;
|
|
164
233
|
}>;
|
|
165
234
|
};
|
|
166
|
-
export type AccessKind = 'manage' | 'readResults' | 'manifestKey' | '
|
|
235
|
+
export type AccessKind = 'manage' | 'readResults' | 'surface' | 'manifestKey' | 'browserEvents';
|
|
167
236
|
export type EndpointContext<TUser extends {
|
|
168
237
|
id: string | number;
|
|
169
238
|
} = {
|
|
170
239
|
id: string | number;
|
|
171
240
|
}> = {
|
|
172
241
|
options: ResolvedOptions<TUser>;
|
|
173
|
-
|
|
174
|
-
|
|
242
|
+
};
|
|
243
|
+
export type ClickKeysResult = {
|
|
244
|
+
keys: Array<{
|
|
245
|
+
key: string;
|
|
246
|
+
arms: string[];
|
|
247
|
+
label: string;
|
|
248
|
+
}>;
|
|
249
|
+
};
|
|
250
|
+
export type PageRow = {
|
|
251
|
+
id: DocId;
|
|
252
|
+
title: string;
|
|
253
|
+
path: string | null;
|
|
254
|
+
pathKey: string | null;
|
|
255
|
+
published: boolean;
|
|
256
|
+
address?: string;
|
|
257
|
+
draftAddress?: string;
|
|
258
|
+
status?: 'published' | 'draft' | 'changed';
|
|
259
|
+
updatedAt?: string;
|
|
260
|
+
editor?: 'puck' | 'blocks';
|
|
261
|
+
editorUrl?: string;
|
|
262
|
+
};
|
|
263
|
+
export type PagesResult = {
|
|
264
|
+
docs: PageRow[];
|
|
265
|
+
hasNextPage: boolean;
|
|
266
|
+
pageLimitReached?: boolean;
|
|
267
|
+
totalDocs?: number;
|
|
268
|
+
pagingCounter?: number;
|
|
269
|
+
};
|
|
270
|
+
export type PlacementStatusBody = {
|
|
271
|
+
docs?: Array<{
|
|
272
|
+
collection: string;
|
|
273
|
+
id: DocId;
|
|
274
|
+
}>;
|
|
275
|
+
slugs?: string[];
|
|
276
|
+
};
|
|
277
|
+
export type PageTestStatus = {
|
|
278
|
+
slug: string;
|
|
279
|
+
name: string;
|
|
280
|
+
status: Status;
|
|
281
|
+
role: 'original' | 'version';
|
|
282
|
+
winner: boolean;
|
|
283
|
+
armLabel: string;
|
|
284
|
+
winnerLabel?: string;
|
|
285
|
+
winnerTitle?: string;
|
|
286
|
+
winnerPath?: string;
|
|
287
|
+
originalPath?: string;
|
|
288
|
+
rollout: boolean;
|
|
289
|
+
pagesReleased: boolean;
|
|
290
|
+
};
|
|
291
|
+
export type PlacementStatusResult = {
|
|
292
|
+
docs: Record<string, {
|
|
293
|
+
path: string | null;
|
|
294
|
+
tests: PageTestStatus[];
|
|
295
|
+
}>;
|
|
296
|
+
slugs: Record<string, {
|
|
297
|
+
missing: true;
|
|
298
|
+
} | {
|
|
299
|
+
deleted: true;
|
|
300
|
+
} | {
|
|
301
|
+
name: string;
|
|
302
|
+
status: Status;
|
|
303
|
+
kind: ExperimentKind;
|
|
304
|
+
arms: Array<{
|
|
305
|
+
key: string;
|
|
306
|
+
label: string;
|
|
307
|
+
slot?: string;
|
|
308
|
+
}>;
|
|
309
|
+
winnerArm?: string;
|
|
310
|
+
discarded?: boolean;
|
|
311
|
+
rollout: boolean;
|
|
312
|
+
}>;
|
|
313
|
+
};
|
|
314
|
+
export type WrapBlockBody = {
|
|
315
|
+
collection: string;
|
|
316
|
+
id: DocId;
|
|
317
|
+
field: string;
|
|
318
|
+
blockId: string;
|
|
319
|
+
experiment: string;
|
|
320
|
+
};
|
|
321
|
+
/** Current visitor effect of deleting a draft or archived test; independent of its stored content report. */
|
|
322
|
+
export type DeleteImpactResult = {
|
|
323
|
+
effect: 'none';
|
|
324
|
+
} | {
|
|
325
|
+
effect: 'block';
|
|
326
|
+
controlLabel: string;
|
|
327
|
+
unreadablePages: number;
|
|
328
|
+
pageCount: number;
|
|
329
|
+
placements: Array<{
|
|
330
|
+
collection: string;
|
|
331
|
+
id: DocId;
|
|
332
|
+
title: string;
|
|
333
|
+
path: string | null;
|
|
334
|
+
locales?: string[];
|
|
335
|
+
allLocales?: true;
|
|
336
|
+
before: {
|
|
337
|
+
key: string;
|
|
338
|
+
label: string;
|
|
339
|
+
};
|
|
340
|
+
after: {
|
|
341
|
+
key: string;
|
|
342
|
+
label: string;
|
|
343
|
+
};
|
|
344
|
+
}>;
|
|
345
|
+
} | {
|
|
346
|
+
effect: 'page';
|
|
347
|
+
winnerPath: string;
|
|
348
|
+
addresses: string[];
|
|
349
|
+
afterPaths?: Record<string, string>;
|
|
350
|
+
};
|
|
351
|
+
export type CopyPagePlan = {
|
|
352
|
+
title: string;
|
|
353
|
+
path: string;
|
|
354
|
+
phase: number;
|
|
355
|
+
updatedAt: string;
|
|
356
|
+
originalId: DocId;
|
|
357
|
+
originalUpdatedAt: string;
|
|
358
|
+
};
|
|
359
|
+
export type CopyPageResult = {
|
|
360
|
+
doc: Record<string, unknown>;
|
|
361
|
+
copy: {
|
|
362
|
+
id: DocId;
|
|
363
|
+
title: string;
|
|
364
|
+
path: string;
|
|
365
|
+
editorUrl: string;
|
|
175
366
|
};
|
|
176
367
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,3 +7,6 @@ export * from './admin.js';
|
|
|
7
7
|
export * from './endpoints.js';
|
|
8
8
|
export * from './snapshot.js';
|
|
9
9
|
export * from './reasons.js';
|
|
10
|
+
export type { HostBlock, ExperimentBlock, ExperimentBlockGroup, ResolvedHostBlock, ResolvedExperimentBlocks } from '../blocks/model.js';
|
|
11
|
+
export type { WrapBlockBody } from './endpoints.js';
|
|
12
|
+
export type { SnapshotHealth } from './snapshot.js';
|
package/dist/types/puck.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DocId } from './contracts.js';
|
|
2
|
-
import type { Slot } from '@puckeditor/core';
|
|
2
|
+
import type { ComponentConfig, Config, Plugin, Slot } from '@puckeditor/core';
|
|
3
3
|
export type { Slot } from '@puckeditor/core';
|
|
4
4
|
export type ArmSlot = 'control' | 'variantA' | 'variantB' | 'variantC';
|
|
5
5
|
export type ExperimentRef = {
|
|
@@ -12,6 +12,7 @@ export type ExperimentSlotProps = {
|
|
|
12
12
|
variantA: Slot;
|
|
13
13
|
variantB: Slot;
|
|
14
14
|
variantC: Slot;
|
|
15
|
+
_visibility?: unknown;
|
|
15
16
|
xpArm?: string;
|
|
16
17
|
xpSlot?: ArmSlot;
|
|
17
18
|
xpExpose?: {
|
|
@@ -21,3 +22,9 @@ export type ExperimentSlotProps = {
|
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
24
|
export declare const EXPERIMENT_SLOT_TYPE: "ExperimentSlot";
|
|
25
|
+
export interface ExperimentsPuckIntegration {
|
|
26
|
+
name: string;
|
|
27
|
+
components: Record<string, ComponentConfig<ExperimentSlotProps>>;
|
|
28
|
+
categories: Config['categories'];
|
|
29
|
+
plugins?: readonly Plugin[];
|
|
30
|
+
}
|
package/dist/types/runtime.d.ts
CHANGED
|
@@ -2,15 +2,21 @@ import type { Payload } from 'payload';
|
|
|
2
2
|
import type { NextRequest } from 'next/server';
|
|
3
3
|
import type { Attributes } from './contracts.js';
|
|
4
4
|
import type { Manifest } from './manifest.js';
|
|
5
|
+
type CookieOptions = {
|
|
6
|
+
name?: string;
|
|
7
|
+
maxAgeDays?: number;
|
|
8
|
+
/** Reject pre-rc.9 visitor IDs, including upgraded cookies, starting on this UTC date. Can only shorten the release cutoff. */
|
|
9
|
+
legacyCutoff?: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
/** Called with a request whose URL is a placeholder outside the proxy; read cookies and headers only. */
|
|
12
|
+
consent?(req: NextRequest): boolean;
|
|
13
|
+
};
|
|
5
14
|
export interface ExperimentsProxyRuntimeOptions {
|
|
6
15
|
secret: string | string[];
|
|
7
16
|
apiRoute: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
domain?: string; /** Called with a request whose URL is a placeholder outside the proxy; read cookies and headers only. */
|
|
12
|
-
consent?(req: NextRequest): boolean;
|
|
13
|
-
};
|
|
17
|
+
/** Limit new visitor IDs by trusted client address, or pass false when protected upstream. */
|
|
18
|
+
rateLimitUnit: false | ((req: NextRequest) => boolean | Promise<boolean>);
|
|
19
|
+
cookie?: CookieOptions;
|
|
14
20
|
loadManifest?: (opts?: {
|
|
15
21
|
ifRevision?: number;
|
|
16
22
|
}) => Promise<Manifest | 'not-modified' | null>;
|
|
@@ -27,11 +33,10 @@ export interface ExperimentsProxyRuntimeOptions {
|
|
|
27
33
|
export interface ExperimentsProxyRuntime {
|
|
28
34
|
readonly secrets: readonly string[];
|
|
29
35
|
readonly apiRoute: string;
|
|
30
|
-
readonly
|
|
36
|
+
readonly rateLimitUnit: ExperimentsProxyRuntimeOptions['rateLimitUnit'];
|
|
37
|
+
readonly cookie: CookieOptions & {
|
|
31
38
|
name: string;
|
|
32
39
|
maxAgeDays: number;
|
|
33
|
-
domain?: string; /** Called with a request whose URL is a placeholder outside the proxy; read cookies and headers only. */
|
|
34
|
-
consent?(req: NextRequest): boolean;
|
|
35
40
|
};
|
|
36
41
|
readonly loadManifest?: ExperimentsProxyRuntimeOptions['loadManifest'];
|
|
37
42
|
readonly getUnit?: ExperimentsProxyRuntimeOptions['getUnit'];
|
|
@@ -57,3 +62,4 @@ export interface ExperimentsServerRuntime<TUser extends {
|
|
|
57
62
|
userIdOf: NonNullable<ExperimentsServerRuntimeOptions<TUser>['userIdOf']>;
|
|
58
63
|
attributesOf: NonNullable<ExperimentsServerRuntimeOptions<TUser>['attributesOf']>;
|
|
59
64
|
}
|
|
65
|
+
export {};
|
package/dist/types/snapshot.d.ts
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
export type SnapshotHealth = {
|
|
2
|
+
code: 'version-page-unavailable' | 'version-page-unchecked';
|
|
3
|
+
path: string;
|
|
4
|
+
} | {
|
|
5
|
+
code: 'goal-in-some-versions';
|
|
6
|
+
metricId: string | number;
|
|
7
|
+
name: string;
|
|
8
|
+
} | {
|
|
9
|
+
code: 'placement-unchecked';
|
|
10
|
+
detail: {
|
|
11
|
+
collection?: string;
|
|
12
|
+
id?: string | number;
|
|
13
|
+
path?: string;
|
|
14
|
+
};
|
|
15
|
+
} | {
|
|
16
|
+
code: 'rapid-browser-events';
|
|
17
|
+
};
|
|
1
18
|
import type { GaussianPrior } from '@delmaredigital/experiments-stats';
|
|
2
19
|
import type { DocId, MetricSource } from './contracts.js';
|
|
3
20
|
import type { MetricUnavailableReason } from './reasons.js';
|
|
@@ -108,10 +125,8 @@ export interface Snapshot {
|
|
|
108
125
|
guardrailLine?: string;
|
|
109
126
|
worstArm?: string;
|
|
110
127
|
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
path: string;
|
|
114
|
-
}>;
|
|
128
|
+
goalFairnessNotice?: string;
|
|
129
|
+
health?: SnapshotHealth[];
|
|
115
130
|
contentChanges: Array<{
|
|
116
131
|
at: string;
|
|
117
132
|
doc: {
|
package/dist/types/surface.d.ts
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
import type { DocId } from './contracts.js';
|
|
2
1
|
import type { SerializedAttributeKeys, SerializedFlagPoint, SerializedMetricSource } from './admin.js';
|
|
3
2
|
export type TestsRoute = 'home' | 'new' | 'test' | 'results' | 'goals' | 'goalNew' | 'goal';
|
|
3
|
+
export type BlockPageCollection = {
|
|
4
|
+
slug: string;
|
|
5
|
+
label: string;
|
|
6
|
+
editors: Array<'puck' | 'blocks'>;
|
|
7
|
+
};
|
|
4
8
|
export interface TestsSurfaceProps {
|
|
5
9
|
route: TestsRoute;
|
|
6
10
|
id?: string;
|
|
7
11
|
returnToTest?: string;
|
|
8
12
|
adminRoute: string;
|
|
9
13
|
apiRoute: string;
|
|
14
|
+
contentLanguageLabels?: string[];
|
|
15
|
+
contentLocale?: string;
|
|
16
|
+
collectionTitles?: Record<string, string>;
|
|
17
|
+
userId?: string | number;
|
|
18
|
+
userCollection?: string;
|
|
10
19
|
isAdmin: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
blockPageCollections?: BlockPageCollection[];
|
|
21
|
+
pageCollections?: Array<{
|
|
22
|
+
slug: string;
|
|
23
|
+
label: string;
|
|
24
|
+
contentChecks: boolean;
|
|
25
|
+
copyEnabled?: true;
|
|
26
|
+
copyHint?: string;
|
|
27
|
+
copyUrl?: string;
|
|
28
|
+
copyLabel?: string;
|
|
17
29
|
}>;
|
|
18
30
|
canManage: boolean;
|
|
19
31
|
canReadResults: boolean;
|
|
@@ -22,6 +34,7 @@ export interface TestsSurfaceProps {
|
|
|
22
34
|
metricSources: SerializedMetricSource[];
|
|
23
35
|
admin?: {
|
|
24
36
|
descriptions?: {
|
|
37
|
+
page?: string;
|
|
25
38
|
block?: string;
|
|
26
39
|
document?: string;
|
|
27
40
|
setting?: string;
|
package/dist/ui/Button.js
CHANGED
|
@@ -12,7 +12,7 @@ export function Button({ variant = 'secondary', size = 'md', disabled, busy, cla
|
|
|
12
12
|
href: blocked ? undefined : href,
|
|
13
13
|
role: blocked ? 'link' : undefined,
|
|
14
14
|
"aria-disabled": blocked || undefined,
|
|
15
|
-
"aria-busy": busy || undefined,
|
|
15
|
+
"aria-busy": busy || props['aria-busy'] || undefined,
|
|
16
16
|
tabIndex: blocked ? -1 : rest.tabIndex,
|
|
17
17
|
onClick: (event)=>{
|
|
18
18
|
if (blocked) event.preventDefault();
|
|
@@ -26,7 +26,7 @@ export function Button({ variant = 'secondary', size = 'md', disabled, busy, cla
|
|
|
26
26
|
type: props.type ?? 'button',
|
|
27
27
|
className: classes,
|
|
28
28
|
disabled: blocked,
|
|
29
|
-
"aria-busy": busy || undefined,
|
|
29
|
+
"aria-busy": busy || props['aria-busy'] || undefined,
|
|
30
30
|
children: children
|
|
31
31
|
});
|
|
32
32
|
}
|
package/dist/ui/Card.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import './ui.css';
|
|
3
3
|
export declare function Card({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
4
|
-
export declare function SectionCard({ number, title, complete, children, id, headingId, className }: {
|
|
4
|
+
export declare function SectionCard({ number, title, complete, blocked, children, id, headingId, className }: {
|
|
5
5
|
number: number;
|
|
6
6
|
title: string;
|
|
7
7
|
complete?: boolean;
|
|
8
|
+
blocked?: boolean;
|
|
8
9
|
children: ReactNode;
|
|
9
10
|
id?: string;
|
|
10
11
|
headingId?: string;
|
package/dist/ui/Card.js
CHANGED
|
@@ -6,11 +6,11 @@ export function Card({ className = '', ...props }) {
|
|
|
6
6
|
className: `xp-ui-card ${className}`
|
|
7
7
|
});
|
|
8
8
|
}
|
|
9
|
-
export function SectionCard({ number, title, complete = false, children, id, headingId, className = '' }) {
|
|
9
|
+
export function SectionCard({ number, title, complete = false, blocked = false, children, id, headingId, className = '' }) {
|
|
10
10
|
return /*#__PURE__*/ _jsxs("section", {
|
|
11
11
|
id: id,
|
|
12
12
|
"aria-labelledby": headingId,
|
|
13
|
-
className: `xp-ui-card xp-ui-section ${className}`,
|
|
13
|
+
className: `xp-ui-card xp-ui-section ${blocked ? 'xp-ui-section--blocked' : complete ? 'xp-ui-section--complete' : ''} ${className}`,
|
|
14
14
|
children: [
|
|
15
15
|
/*#__PURE__*/ _jsxs("header", {
|
|
16
16
|
className: "xp-ui-section-head",
|
|
@@ -26,8 +26,8 @@ export function SectionCard({ number, title, complete = false, children, id, hea
|
|
|
26
26
|
}),
|
|
27
27
|
/*#__PURE__*/ _jsx("span", {
|
|
28
28
|
className: "xp-ui-section-complete",
|
|
29
|
-
"aria-label": complete ? 'Complete' : 'Incomplete',
|
|
30
|
-
children: complete ? '✓' : '○'
|
|
29
|
+
"aria-label": blocked ? 'Needs attention' : complete ? 'Complete' : 'Incomplete',
|
|
30
|
+
children: blocked ? '!' : complete ? '✓' : '○'
|
|
31
31
|
})
|
|
32
32
|
]
|
|
33
33
|
}),
|
package/dist/ui/ChipsInput.d.ts
CHANGED
|
@@ -9,5 +9,12 @@ export interface ChipsInputProps {
|
|
|
9
9
|
placeholder?: string;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
id: string;
|
|
12
|
+
draft?: {
|
|
13
|
+
value: string;
|
|
14
|
+
change: (value: string) => void;
|
|
15
|
+
submit: (value: string) => void;
|
|
16
|
+
discard: () => void;
|
|
17
|
+
describedBy?: string;
|
|
18
|
+
};
|
|
12
19
|
}
|
|
13
|
-
export declare function ChipsInput({ value, onChange, label, description, help, error, placeholder, disabled, id }: ChipsInputProps): import("react").JSX.Element;
|
|
20
|
+
export declare function ChipsInput({ value, onChange, label, description, help, error, placeholder, disabled, id, draft: managedDraft }: ChipsInputProps): import("react").JSX.Element;
|
package/dist/ui/ChipsInput.js
CHANGED
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
4
|
import './ui.css';
|
|
5
|
-
export function ChipsInput({ value, onChange, label, description, help = description, error, placeholder, disabled = false, id }) {
|
|
6
|
-
const [
|
|
5
|
+
export function ChipsInput({ value, onChange, label, description, help = description, error, placeholder, disabled = false, id, draft: managedDraft }) {
|
|
6
|
+
const [localDraft, setLocalDraft] = useState('');
|
|
7
|
+
const draft = managedDraft?.value ?? localDraft;
|
|
8
|
+
const setDraft = managedDraft?.change ?? setLocalDraft;
|
|
7
9
|
const input = useRef(null);
|
|
8
10
|
const commit = (text)=>{
|
|
9
11
|
if (disabled) return;
|
|
12
|
+
if (managedDraft) {
|
|
13
|
+
managedDraft.submit(text);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
10
16
|
const next = [
|
|
11
17
|
...new Set([
|
|
12
18
|
...value,
|
|
@@ -60,13 +66,20 @@ export function ChipsInput({ value, onChange, label, description, help = descrip
|
|
|
60
66
|
"aria-invalid": Boolean(error) || undefined,
|
|
61
67
|
"aria-describedby": [
|
|
62
68
|
help ? `${id}-description` : '',
|
|
63
|
-
error ? `${id}-error` : ''
|
|
69
|
+
error ? `${id}-error` : '',
|
|
70
|
+
managedDraft?.describedBy
|
|
64
71
|
].filter(Boolean).join(' ') || undefined,
|
|
65
72
|
onChange: (event)=>setDraft(event.target.value),
|
|
66
73
|
onBlur: ()=>{
|
|
67
74
|
if (draft.trim()) commit(draft);
|
|
68
75
|
},
|
|
69
76
|
onKeyDown: (event)=>{
|
|
77
|
+
if (event.key === 'Escape' && managedDraft && draft) {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
event.stopPropagation();
|
|
80
|
+
managedDraft.discard();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
70
83
|
if (disabled || event.nativeEvent.isComposing) return;
|
|
71
84
|
if (event.key === 'Enter' || event.key === ',') {
|
|
72
85
|
event.preventDefault();
|
|
@@ -78,7 +91,7 @@ export function ChipsInput({ value, onChange, label, description, help = descrip
|
|
|
78
91
|
}
|
|
79
92
|
},
|
|
80
93
|
onPaste: (event)=>{
|
|
81
|
-
if (disabled) return;
|
|
94
|
+
if (disabled || managedDraft) return;
|
|
82
95
|
const pasted = event.clipboardData.getData('text');
|
|
83
96
|
if (!pasted.includes(',')) return;
|
|
84
97
|
event.preventDefault();
|
package/dist/ui/Dialog.d.ts
CHANGED
|
@@ -3,11 +3,33 @@ import './ui.css';
|
|
|
3
3
|
/** Native modal stays in its rendering document, including a Puck canvas iframe.
|
|
4
4
|
* `initialFocus="cancel"` targets the focusable control marked `data-dialog-cancel`.
|
|
5
5
|
*/
|
|
6
|
-
export declare function Dialog({ open, title, onClose, children, dismissible, initialFocus }: {
|
|
6
|
+
export declare function Dialog({ open, title, descriptionId, onClose, children, dismissible, initialFocus, className, headerActions, closeOnBackdrop }: {
|
|
7
7
|
open: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
headerActions?: ReactNode;
|
|
10
|
+
closeOnBackdrop?: boolean;
|
|
8
11
|
dismissible?: boolean;
|
|
9
12
|
initialFocus?: 'cancel';
|
|
10
13
|
title: string;
|
|
11
|
-
|
|
14
|
+
descriptionId?: string;
|
|
15
|
+
onClose: () => void | false;
|
|
12
16
|
children: ReactNode;
|
|
13
17
|
}): import("react").JSX.Element;
|
|
18
|
+
export declare function ConfirmDialog({ open, title, description, children, error, busy, busyLabel, cancelLabel, onClose, confirm, secondaryAction }: {
|
|
19
|
+
open?: boolean;
|
|
20
|
+
title: string;
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
error?: string | null;
|
|
24
|
+
busy?: boolean;
|
|
25
|
+
busyLabel?: string;
|
|
26
|
+
cancelLabel: string;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
secondaryAction?: ReactNode;
|
|
29
|
+
confirm?: {
|
|
30
|
+
label: string;
|
|
31
|
+
onClick: () => void | Promise<void>;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
destructive?: boolean;
|
|
34
|
+
};
|
|
35
|
+
}): import("react").JSX.Element;
|