@delmaredigital/payload-experiments 0.4.0-rc.6 → 0.4.0-rc.9
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 +12 -12
- package/dist/admin/blocks/BlockPanel.js +6 -4
- package/dist/admin/blocks/inject.js +1 -0
- package/dist/admin/blocks/model.d.ts +3 -2
- package/dist/admin/blocks/model.js +9 -5
- package/dist/admin/copy/blocks.d.ts +3 -2
- package/dist/admin/copy/blocks.js +8 -7
- package/dist/admin/surface/ResultsRoute.js +18 -11
- package/dist/admin/surface/TestsHome.d.ts +2 -1
- package/dist/admin/surface/TestsHome.js +131 -44
- package/dist/admin/surface/TestsSurface.js +3 -0
- package/dist/admin/surface/home.model.d.ts +2 -0
- package/dist/admin/surface/newTest/PageWizard.js +9 -2
- package/dist/admin/surface/newTest/newTest.css +1 -1
- package/dist/admin/surface/results/ResultsHeader.js +11 -6
- package/dist/admin/surface/test/TestPage.js +3 -3
- package/dist/admin/views/TestsSurfaceClient.d.ts +3 -0
- package/dist/admin/views/TestsSurfaceClient.js +11 -0
- package/dist/admin/views/buildSurfaceProps.js +10 -3
- package/dist/blocks/bindings.js +3 -2
- package/dist/blocks/formState.js +1 -1
- package/dist/blocks/placementLanguages.d.ts +7 -0
- package/dist/blocks/placementLanguages.js +27 -0
- package/dist/blocks/placementLocale.d.ts +21 -7
- package/dist/blocks/placementLocale.js +218 -67
- package/dist/collections/experiments/config.js +8 -3
- package/dist/collections/experiments/deleteGuard.js +2 -2
- package/dist/collections/experiments/lockHook.js +21 -2
- package/dist/collections/experiments/pickSlug.js +2 -0
- package/dist/collections/metricsGuards.js +2 -0
- package/dist/collections/serialize.js +5 -4
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/db/adapter.d.ts +9 -1
- package/dist/db/adapter.js +77 -1
- package/dist/db/appends.d.ts +13 -0
- package/dist/db/appends.js +49 -0
- package/dist/db/bulkPlacementRemoval.js +8 -4
- package/dist/db/delete.d.ts +1 -1
- package/dist/db/delete.js +2 -4
- package/dist/db/events.d.ts +9 -0
- package/dist/db/events.js +42 -8
- package/dist/db/executor.d.ts +7 -1
- package/dist/db/executor.js +7 -3
- package/dist/db/results.d.ts +5 -1
- package/dist/db/results.js +21 -5
- package/dist/db/snapshots.d.ts +1 -0
- package/dist/endpoints/contentLocale.d.ts +6 -0
- package/dist/endpoints/contentLocale.js +15 -0
- package/dist/endpoints/deleteImpact.d.ts +6 -0
- package/dist/endpoints/deleteImpact.js +207 -0
- package/dist/endpoints/events.js +103 -39
- package/dist/endpoints/index.js +9 -8
- package/dist/endpoints/pages.js +7 -3
- package/dist/endpoints/placementStatus.js +13 -5
- package/dist/endpoints/preflight.d.ts +1 -1
- package/dist/endpoints/preflight.js +17 -2
- package/dist/endpoints/results.d.ts +1 -1
- package/dist/endpoints/results.js +6 -2
- package/dist/endpoints/routeId.d.ts +2 -2
- package/dist/endpoints/routeId.js +11 -5
- package/dist/endpoints/summary.js +46 -12
- package/dist/endpoints/transitions.js +37 -24
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +6 -0
- package/dist/events/request.d.ts +6 -2
- package/dist/events/request.js +35 -8
- package/dist/events/rows.d.ts +1 -1
- package/dist/events/rows.js +24 -8
- package/dist/events/writable.d.ts +9 -0
- package/dist/events/writable.js +13 -0
- package/dist/exports/adminClient.d.ts +1 -1
- package/dist/exports/adminClient.js +1 -1
- package/dist/exports/index.d.ts +1 -1
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +1 -0
- package/dist/goals/fairness.js +38 -31
- package/dist/hooks/blockRemovalRule.d.ts +2 -2
- package/dist/hooks/blockRemovalRule.js +16 -14
- package/dist/hooks/hostHook.js +6 -2
- package/dist/hooks/pageGuard.d.ts +3 -0
- package/dist/hooks/pageGuard.js +37 -23
- package/dist/hooks/puckNestedTests.d.ts +8 -0
- package/dist/hooks/puckNestedTests.js +36 -0
- package/dist/lib/fetchAllDocs.d.ts +1 -1
- package/dist/lib/placementPages.d.ts +2 -1
- package/dist/lib/placementPages.js +10 -2
- package/dist/manifest/compile.d.ts +2 -1
- package/dist/manifest/compile.js +13 -6
- package/dist/onInit.js +14 -0
- package/dist/options.js +5 -0
- 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.js +40 -37
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +8 -4
- package/dist/puck/editor/ConfigureTestDrawer.js +5 -2
- package/dist/puck/editor/ExperimentSlotEditor.js +313 -158
- package/dist/puck/editor/LeftoverVersions.d.ts +1 -1
- package/dist/puck/editor/LeftoverVersions.js +40 -43
- package/dist/puck/editor/QuickTestActions.d.ts +5 -2
- package/dist/puck/editor/QuickTestActions.js +16 -4
- package/dist/puck/editor/ResultsReadout.d.ts +2 -1
- package/dist/puck/editor/ResultsReadout.js +2 -1
- package/dist/puck/editor/VersionBuilder.d.ts +31 -3
- package/dist/puck/editor/VersionBuilder.js +336 -74
- package/dist/puck/editor/armWrites.js +1 -1
- package/dist/puck/editor/armsCache.js +1 -3
- package/dist/puck/editor/blockClipboard.d.ts +16 -0
- package/dist/puck/editor/blockClipboard.js +20 -0
- package/dist/puck/editor/copy.d.ts +12 -2
- package/dist/puck/editor/copy.js +13 -2
- package/dist/puck/editor/editor.chrome.css +118 -3
- package/dist/puck/editor/editor.css +131 -8
- package/dist/puck/editor/editor.model.d.ts +3 -1
- package/dist/puck/editor/editor.model.js +2 -2
- package/dist/puck/editor/localPlacements.d.ts +1 -0
- package/dist/puck/editor/localPlacements.js +12 -0
- package/dist/puck/editor/placementsCache.d.ts +22 -12
- package/dist/puck/editor/placementsCache.js +62 -49
- package/dist/puck/editor/usePageSaveReadiness.d.ts +9 -0
- package/dist/puck/editor/usePageSaveReadiness.js +34 -0
- package/dist/puck/editor/usePlacementNotice.d.ts +2 -2
- package/dist/puck/editor/usePlacementNotice.js +6 -4
- package/dist/puck/experimentSlug.d.ts +2 -0
- package/dist/puck/experimentSlug.js +3 -0
- package/dist/puck/nestedTestCopy.d.ts +8 -0
- package/dist/puck/nestedTestCopy.js +22 -0
- package/dist/puck/nestedTests.d.ts +17 -0
- package/dist/puck/nestedTests.js +30 -0
- package/dist/puck/slotConfig.d.ts +1 -1
- package/dist/puck/slotConfig.js +17 -4
- package/dist/puck/visibility.d.ts +2 -3
- package/dist/puck/visibility.js +11 -7
- package/dist/results/aggregate.d.ts +6 -3
- package/dist/results/aggregate.js +9 -9
- package/dist/results/health.d.ts +8 -0
- package/dist/results/health.js +28 -0
- package/dist/results/identityCredit.d.ts +1 -0
- package/dist/results/identityCredit.js +4 -1
- package/dist/results/verdict.js +2 -1
- package/dist/runtime/cookie.d.ts +10 -2
- package/dist/runtime/cookie.js +38 -6
- package/dist/runtime/cookieOptions.d.ts +6 -0
- package/dist/runtime/cookieOptions.js +14 -0
- package/dist/runtime/proxyRuntime.d.ts +1 -0
- package/dist/runtime/proxyRuntime.js +18 -8
- package/dist/runtime/signing.d.ts +1 -0
- package/dist/runtime/signing.js +5 -0
- package/dist/sanitizeReadinessDetail.d.ts +2 -2
- package/dist/sanitizeReadinessDetail.js +20 -2
- package/dist/server/getAssignments.js +11 -10
- package/dist/server/recordContentChange.d.ts +1 -1
- package/dist/server/recordContentChange.js +45 -21
- package/dist/server/resolveExperimentBlocks.js +2 -4
- package/dist/server/resolveExperimentData.js +4 -7
- package/dist/server/runResults.js +52 -14
- package/dist/server/startExperiment.d.ts +20 -0
- package/dist/server/startExperiment.js +70 -0
- package/dist/server/trackConversion.js +10 -13
- package/dist/testSurface/PreviewLinks.js +6 -2
- package/dist/testSurface/actions/DecideDialog.d.ts +4 -1
- package/dist/testSurface/actions/DecideDialog.js +32 -14
- package/dist/testSurface/actions/MakeContentResult.d.ts +4 -3
- package/dist/testSurface/actions/MakeContentResult.js +9 -1
- package/dist/testSurface/api.d.ts +11 -8
- package/dist/testSurface/api.js +27 -11
- package/dist/testSurface/contentLocaleURL.d.ts +2 -0
- package/dist/testSurface/contentLocaleURL.js +3 -0
- package/dist/testSurface/copy/actions.d.ts +1 -0
- package/dist/testSurface/copy/actions.js +1 -0
- package/dist/testSurface/copy/common.d.ts +6 -0
- package/dist/testSurface/copy/common.js +11 -5
- package/dist/testSurface/copy/languages.d.ts +12 -0
- package/dist/testSurface/copy/languages.js +8 -0
- package/dist/testSurface/copy/metrics.d.ts +1 -0
- package/dist/testSurface/copy/metrics.js +1 -0
- package/dist/testSurface/copy/readiness.d.ts +13 -2
- package/dist/testSurface/copy/readiness.js +19 -2
- package/dist/testSurface/copy/results.d.ts +5 -2
- package/dist/testSurface/copy/results.js +5 -2
- package/dist/testSurface/copy/testPage.d.ts +40 -1
- package/dist/testSurface/copy/testPage.js +53 -1
- package/dist/testSurface/placementLabel.d.ts +8 -0
- package/dist/testSurface/placementLabel.js +24 -0
- package/dist/testSurface/placements/placementLabels.d.ts +2 -0
- package/dist/testSurface/placements/placementLabels.js +2 -1
- package/dist/testSurface/readPreflight.d.ts +5 -0
- package/dist/testSurface/readPreflight.js +7 -0
- package/dist/testSurface/readinessRead.d.ts +3 -0
- package/dist/testSurface/readinessRead.js +4 -0
- package/dist/testSurface/results/VerdictHero.d.ts +2 -1
- package/dist/testSurface/results/VerdictHero.js +5 -1
- package/dist/testSurface/results/results.css +1 -1
- package/dist/testSurface/results/results.model.d.ts +1 -1
- package/dist/testSurface/results/results.model.js +6 -2
- package/dist/testSurface/surface/contracts.d.ts +10 -1
- package/dist/testSurface/surface/editorPlacement.d.ts +7 -2
- package/dist/testSurface/surface/editorPlacement.js +19 -1
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +4 -3
- package/dist/testSurface/surface/pageBlock/parts.js +24 -6
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +20 -6
- package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +4 -2
- package/dist/testSurface/surface/readiness/ActionDialogs.js +39 -34
- package/dist/testSurface/surface/readiness/Banner.js +23 -12
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +4 -3
- package/dist/testSurface/surface/readiness/SaveStatus.js +15 -15
- package/dist/testSurface/surface/readiness/readiness.model.d.ts +6 -1
- package/dist/testSurface/surface/readiness/readiness.model.js +116 -12
- package/dist/testSurface/surface/readiness/useTransition.d.ts +4 -4
- package/dist/testSurface/surface/readiness/useTransition.js +12 -10
- package/dist/testSurface/surface/results/ReleasePages.d.ts +4 -2
- package/dist/testSurface/surface/results/ReleasePages.js +5 -4
- package/dist/testSurface/surface/results/ResultsBody.d.ts +4 -2
- package/dist/testSurface/surface/results/ResultsBody.js +86 -43
- package/dist/testSurface/surface/results/useResults.d.ts +11 -7
- package/dist/testSurface/surface/results/useResults.js +3 -2
- package/dist/testSurface/surface/setting/parts.js +58 -18
- package/dist/testSurface/surface/test/AdvancedSection.js +1 -0
- package/dist/testSurface/surface/test/DeleteTest.d.ts +19 -0
- package/dist/testSurface/surface/test/DeleteTest.js +262 -0
- package/dist/testSurface/surface/test/GoalSection.js +7 -3
- package/dist/testSurface/surface/test/LengthSection.js +3 -0
- package/dist/testSurface/surface/test/PageHoldout.js +4 -1
- package/dist/testSurface/surface/test/ReadinessBar.js +1 -1
- package/dist/testSurface/surface/test/TargetingSection.js +77 -12
- package/dist/testSurface/surface/test/TestSurface.js +97 -15
- package/dist/testSurface/surface/test/VersionsSection.js +56 -29
- package/dist/testSurface/surface/test/fields.d.ts +29 -4
- package/dist/testSurface/surface/test/fields.js +159 -39
- package/dist/testSurface/surface/test/pageParts.js +14 -5
- package/dist/testSurface/surface/test/testPage.model.d.ts +1 -0
- package/dist/testSurface/surface/test/testPage.model.js +6 -0
- package/dist/testSurface/surface/testDocument.model.d.ts +3 -0
- package/dist/testSurface/surface/testDocument.model.js +4 -1
- package/dist/testSurface/surface/useTestDocument.d.ts +23 -4
- package/dist/testSurface/surface/useTestDocument.js +425 -162
- package/dist/testSurface/useApi.d.ts +9 -6
- package/dist/testSurface/useOnTestReturn.d.ts +2 -0
- package/dist/testSurface/useOnTestReturn.js +27 -0
- package/dist/testSurface/useReadinessPolling.js +3 -1
- package/dist/transitions/addMetric.d.ts +1 -4
- 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 +5 -1
- package/dist/transitions/checkStart.js +130 -16
- package/dist/transitions/contentFields.js +9 -5
- package/dist/transitions/decide.d.ts +1 -1
- package/dist/transitions/decide.js +5 -3
- package/dist/transitions/deleteExperiment.d.ts +2 -2
- package/dist/transitions/deleteExperiment.js +17 -7
- package/dist/transitions/kernel.d.ts +2 -0
- package/dist/transitions/kernel.js +9 -4
- package/dist/transitions/makeContent.d.ts +2 -1
- package/dist/transitions/makeContent.js +17 -12
- package/dist/transitions/nestedPlacementNames.d.ts +5 -0
- package/dist/transitions/nestedPlacementNames.js +32 -0
- package/dist/transitions/pageVersions.js +3 -1
- package/dist/transitions/phaseRecord.d.ts +2 -0
- package/dist/transitions/phaseRecord.js +5 -0
- package/dist/transitions/placementInteractions.d.ts +3 -3
- package/dist/transitions/placementInteractions.js +15 -11
- package/dist/transitions/placements.d.ts +28 -1
- package/dist/transitions/placements.js +223 -60
- package/dist/transitions/preflightData.d.ts +5 -3
- package/dist/transitions/preflightData.js +126 -37
- package/dist/transitions/releaseHoldout.d.ts +2 -1
- package/dist/transitions/releaseHoldout.js +3 -1
- package/dist/transitions/releasePages.d.ts +2 -1
- package/dist/transitions/releasePages.js +3 -1
- package/dist/transitions/resolveCaps.d.ts +2 -4
- package/dist/transitions/start.d.ts +6 -8
- package/dist/transitions/start.js +70 -34
- package/dist/transitions/startReads.d.ts +7 -0
- package/dist/transitions/startReads.js +28 -0
- package/dist/transitions/stop.d.ts +2 -1
- package/dist/transitions/stop.js +3 -2
- package/dist/types/contracts.d.ts +6 -3
- package/dist/types/endpoints.d.ts +86 -9
- package/dist/types/endpoints.js +1 -1
- package/dist/types/runtime.d.ts +15 -9
- package/dist/types/snapshot.d.ts +2 -0
- package/dist/types/surface.d.ts +2 -0
- package/dist/ui/Button.js +2 -2
- package/dist/ui/ChipsInput.d.ts +8 -1
- package/dist/ui/ChipsInput.js +17 -4
- package/dist/ui/Inputs.d.ts +4 -3
- package/dist/ui/Inputs.js +9 -9
- package/dist/ui/SelectControl.d.ts +33 -0
- package/dist/ui/SelectControl.js +504 -0
- package/dist/ui/ui.css +13 -5
- package/package.json +3 -2
package/dist/puck/editor/copy.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { nestedTestCopy } from '../nestedTestCopy.js';
|
|
1
2
|
import { ARM_LABELS } from '../../labels/arms.js';
|
|
2
3
|
export const editorCopy = {
|
|
4
|
+
nested: nestedTestCopy.editor,
|
|
5
|
+
nestedHidden: nestedTestCopy.hidden,
|
|
6
|
+
nestedPaste: "A test can't go inside another test's version.",
|
|
3
7
|
hidden: "This block is hidden, so visitors won't see this test here.",
|
|
4
8
|
hiddenOn: (sizes)=>`This block is hidden on ${sizes}. Visitors on ${sizes} are still counted in this test.`,
|
|
5
9
|
retrySetup: 'Retry',
|
|
@@ -16,7 +20,8 @@ export const editorCopy = {
|
|
|
16
20
|
draft: (label)=>`This block shows the ${label} to everyone until the test starts.`,
|
|
17
21
|
running: 'Changing this content mid-test mixes two versions in one result',
|
|
18
22
|
decided: (winner)=>`Decided: ${winner}. Use 'Make it the content' on the test to finish.`,
|
|
19
|
-
archived:
|
|
23
|
+
archived: (winner)=>`Archived: this block serves ${winner}, or nothing if that version is empty. To keep the content without the test, move it out of this Experiment block on the canvas, then remove the Experiment block.`,
|
|
24
|
+
archivedOriginal: (original, discarded)=>`${discarded ? 'Winner discarded' : 'Archived without a winner'}: this block shows ${original}, or nothing if it is empty. To keep it without the test, move its content out on the canvas, then remove this Experiment block.`,
|
|
20
25
|
copy: (label = ARM_LABELS.control)=>`Copy ${label} here`,
|
|
21
26
|
copyEmpty: (label = ARM_LABELS.control)=>`Add content to the ${label} before copying it.`,
|
|
22
27
|
enterName: 'Enter a name to create the test.',
|
|
@@ -45,6 +50,7 @@ export const editorCopy = {
|
|
|
45
50
|
deleteContentHelp: (label, count)=>`This deletes the ${count} ${count === 1 ? 'block' : 'blocks'} in ${label} from this page. Save the page to keep this change.`,
|
|
46
51
|
draftOnly: 'Only draft tests can add this version. Use a different test to include it.',
|
|
47
52
|
outsideTest: (label)=>`${label} · not in this test`,
|
|
53
|
+
showVersion: (label)=>`Show ${label} on the page`,
|
|
48
54
|
tabs: 'Test versions',
|
|
49
55
|
add: 'Add variant',
|
|
50
56
|
testGroup: 'Test',
|
|
@@ -54,6 +60,7 @@ export const editorCopy = {
|
|
|
54
60
|
createAnother: 'Create a test',
|
|
55
61
|
readOnlyVersions: "You don't have permission to change this test's versions.",
|
|
56
62
|
traffic: 'Traffic (%)',
|
|
63
|
+
percent: '%',
|
|
57
64
|
saved: 'Saved',
|
|
58
65
|
removeVersion: 'Remove version',
|
|
59
66
|
emptyLabel: 'Enter a name for this version.',
|
|
@@ -65,6 +72,7 @@ export const editorCopy = {
|
|
|
65
72
|
removed: "Save the page to finish removing this version's content.",
|
|
66
73
|
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.",
|
|
67
74
|
lockedGeneric: "This test's versions can't change. View the test page for details.",
|
|
75
|
+
holdoutContent: 'Holdout visitors see the Original.',
|
|
68
76
|
holdoutPeople: (label, count)=>`${label}: ${count} people (not compared)`,
|
|
69
77
|
weight: (label)=>`${label} traffic (%)`,
|
|
70
78
|
invalidShare: 'Use a whole number from 0 to 100.',
|
|
@@ -74,7 +82,10 @@ export const editorCopy = {
|
|
|
74
82
|
decided: "This test has a decision, so its versions can't change. View the results on the test page.",
|
|
75
83
|
archived: "This test is archived, so its versions can't change. View the results on the test page."
|
|
76
84
|
},
|
|
77
|
-
staleEdit: '
|
|
85
|
+
staleEdit: 'This test changed. Check the saved settings and try again.',
|
|
86
|
+
nameChanged: 'This version name changed while you were editing.',
|
|
87
|
+
versionName: (label)=>`${label} version name`,
|
|
88
|
+
shareChanged: 'The saved shares changed while you were editing.',
|
|
78
89
|
writeError: "Couldn't complete this change. Try again.",
|
|
79
90
|
writeNetwork: "Couldn't reach the server. Check your connection and try again.",
|
|
80
91
|
writeUnreadable: "Couldn't read the server's response. Reload and try again.",
|
|
@@ -132,6 +132,21 @@
|
|
|
132
132
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-error { color: var(--xp-error); }
|
|
133
133
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-help { color: var(--xp-text-2); }
|
|
134
134
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-field label { color: var(--xp-text); }
|
|
135
|
+
/* Native popovers keep this ancestry in the top layer. The fallback portals to
|
|
136
|
+
the nearest open dialog or owner-document body, copying the trigger's --xp-*
|
|
137
|
+
tokens; outside the field subtree, shared ui.css supplies the menu colors. */
|
|
138
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox { color: var(--xp-text); background: var(--xp-surface); border-color: var(--xp-border-strong); }
|
|
139
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox:hover { border-color: var(--xp-text-3); }
|
|
140
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox:focus-visible { outline: 2px solid var(--xp-focus); }
|
|
141
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox[aria-invalid='true'] { border-color: var(--xp-error); }
|
|
142
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox:disabled { opacity: 1; color: var(--xp-text-2); background: var(--xp-surface-3); border-color: var(--xp-border-strong); }
|
|
143
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox > span:first-child { color: inherit; }
|
|
144
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-chevron { border-right-color: var(--xp-text-2); border-bottom-color: var(--xp-text-2); }
|
|
145
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-popup { color: var(--xp-text); background: var(--xp-surface); border-color: var(--xp-border-strong); }
|
|
146
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-option { color: var(--xp-text); }
|
|
147
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-option[data-active='true'] { color: var(--xp-text); background: var(--xp-surface-3); outline: 1px solid var(--xp-border-strong); }
|
|
148
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-option[aria-disabled='true'] { color: var(--xp-text-3); }
|
|
149
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-group { color: var(--xp-text-2); }
|
|
135
150
|
[class*="_PuckFields"] .xp-puck-field .xp-ui-button:disabled,
|
|
136
151
|
[class*="_PuckFields"] .xp-puck-field .xp-ui-button[aria-disabled='true'] {
|
|
137
152
|
opacity: 1;
|
|
@@ -172,9 +187,6 @@
|
|
|
172
187
|
/* Grid stretching must not turn a status chip into a full-width bar. */
|
|
173
188
|
.xp-slot-sidebar .xp-ui-status { justify-self: start; width: max-content; }
|
|
174
189
|
.xp-slot-sidebar fieldset { min-width: 0; }
|
|
175
|
-
.xp-slot-sidebar .xp-slot-version-group[data-active='true'] { border-inline-start: 3px solid var(--xp-focus); }
|
|
176
|
-
.xp-slot-sidebar .xp-slot-version-name { display: flex; align-items: end; gap: var(--xp-space-2); }
|
|
177
|
-
.xp-slot-sidebar .xp-slot-version-name > .xp-ui-field { flex: 1; min-width: 0; }
|
|
178
190
|
|
|
179
191
|
.xp-slot-header .xp-ui-status { flex: none; }
|
|
180
192
|
|
|
@@ -184,3 +196,106 @@
|
|
|
184
196
|
overflow-wrap: anywhere;
|
|
185
197
|
text-overflow: clip;
|
|
186
198
|
}
|
|
199
|
+
|
|
200
|
+
/* Compact field cards fit the Puck sidebar and wrap by their own available width. */
|
|
201
|
+
.xp-slot-sidebar .xp-slot-test-heading {
|
|
202
|
+
display: grid;
|
|
203
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
204
|
+
align-items: start;
|
|
205
|
+
gap: var(--xp-space-2);
|
|
206
|
+
}
|
|
207
|
+
.xp-slot-test-heading > strong { min-width: 0; overflow-wrap: anywhere; }
|
|
208
|
+
.xp-slot-sidebar .xp-ui-banner {
|
|
209
|
+
min-width: 0;
|
|
210
|
+
padding: var(--xp-space-2) var(--xp-space-3);
|
|
211
|
+
gap: var(--xp-space-2);
|
|
212
|
+
font: var(--xp-text-small);
|
|
213
|
+
overflow-wrap: anywhere;
|
|
214
|
+
}
|
|
215
|
+
.xp-slot-sidebar .xp-ui-banner > p { min-width: 0; }
|
|
216
|
+
.xp-slot-version-controls, .xp-slot-weights { display: grid; gap: var(--xp-space-2); min-width: 0; }
|
|
217
|
+
.xp-slot-sidebar .xp-slot-weight-inputs { gap: var(--xp-space-2); }
|
|
218
|
+
.xp-slot-version-item { min-width: 0; }
|
|
219
|
+
.xp-slot-version-group {
|
|
220
|
+
display: grid;
|
|
221
|
+
gap: var(--xp-space-2);
|
|
222
|
+
padding: var(--xp-space-2);
|
|
223
|
+
border: 1px solid var(--xp-border-strong);
|
|
224
|
+
border-radius: var(--xp-radius-control);
|
|
225
|
+
background: var(--xp-surface);
|
|
226
|
+
min-width: 0;
|
|
227
|
+
container-type: inline-size;
|
|
228
|
+
}
|
|
229
|
+
.xp-slot-version-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 72px; align-items: start; gap: var(--xp-space-half) var(--xp-space-2); min-width: 0; }
|
|
230
|
+
.xp-slot-version-open {
|
|
231
|
+
position: relative;
|
|
232
|
+
grid-area: 1 / 1;
|
|
233
|
+
min-width: 24px;
|
|
234
|
+
min-height: 32px;
|
|
235
|
+
padding: 0;
|
|
236
|
+
border: 0;
|
|
237
|
+
border-radius: var(--xp-radius-control);
|
|
238
|
+
background: transparent;
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
}
|
|
241
|
+
.xp-slot-version-open::before { content: ''; position: absolute; inset-block: 4px; inset-inline-start: 0; width: 3px; border-radius: 2px; background: var(--xp-border-strong); }
|
|
242
|
+
.xp-slot-version-open[aria-pressed='true']::before { background: var(--xp-focus); }
|
|
243
|
+
.xp-slot-version-open:focus-visible { outline: 2px solid var(--xp-focus); outline-offset: 2px; }
|
|
244
|
+
.xp-slot-version-open:disabled { cursor: not-allowed; }
|
|
245
|
+
/* Flatten only field layout boxes so their feedback uses the entire card row. */
|
|
246
|
+
.xp-slot-version-name, .xp-slot-version-traffic, .xp-slot-version-row .xp-ui-field { display: contents; }
|
|
247
|
+
.xp-slot-version-name .xp-ui-input { grid-area: 1 / 2; min-width: 0; font-weight: 600; }
|
|
248
|
+
.xp-slot-version-traffic .xp-ui-input { grid-area: 1 / 3; min-width: 0; }
|
|
249
|
+
.xp-slot-version-label { grid-area: 1 / 2 / auto / -1; align-self: center; min-width: 0; overflow-wrap: anywhere; }
|
|
250
|
+
.xp-slot-version-row .xp-field-draft-notice,
|
|
251
|
+
.xp-slot-version-row .xp-ui-error { grid-column: 1 / -1; margin: 0; }
|
|
252
|
+
/* Reserve one feedback line. Visibility preserves geometry between saves. */
|
|
253
|
+
.xp-slot-version-saved { grid-column: 1 / -1; min-height: 16px; margin: 0; font: var(--xp-text-small); }
|
|
254
|
+
.xp-slot-version-row:has(.xp-ui-error) .xp-slot-version-saved { display: none; }
|
|
255
|
+
.xp-slot-version-row > .xp-slot-version-actions, .xp-slot-version-help { grid-column: 1 / -1; margin: 0; }
|
|
256
|
+
@container (max-width: 220px) {
|
|
257
|
+
.xp-slot-version-group > .xp-slot-version-row { grid-template-columns: 24px minmax(0, 1fr); }
|
|
258
|
+
.xp-slot-version-traffic .xp-ui-input { grid-area: 2 / 2; width: 72px; justify-self: end; }
|
|
259
|
+
.xp-slot-version-traffic .xp-slot-percent { grid-area: 2 / 2; }
|
|
260
|
+
}
|
|
261
|
+
.xp-slot-version-row .xp-ui-field > label {
|
|
262
|
+
position: absolute;
|
|
263
|
+
width: 1px;
|
|
264
|
+
height: 1px;
|
|
265
|
+
padding: 0;
|
|
266
|
+
margin: -1px;
|
|
267
|
+
overflow: hidden;
|
|
268
|
+
clip-path: inset(50%);
|
|
269
|
+
white-space: nowrap;
|
|
270
|
+
}
|
|
271
|
+
.xp-slot-version-row .xp-ui-input { height: 32px; padding-inline: var(--xp-space-2); font-size: 13px; }
|
|
272
|
+
.xp-slot-version-row .xp-ui-input--number { padding-inline-end: 22px; appearance: textfield; }
|
|
273
|
+
.xp-slot-version-row .xp-ui-input--number::-webkit-inner-spin-button,
|
|
274
|
+
.xp-slot-version-row .xp-ui-input--number::-webkit-outer-spin-button { appearance: none; margin: 0; }
|
|
275
|
+
.xp-slot-percent { position: relative; grid-area: 1 / 3; justify-self: end; inset-inline-end: var(--xp-space-2); top: 6px; font: var(--xp-text-small); color: var(--xp-text-2); pointer-events: none; }
|
|
276
|
+
.xp-slot-version-actions { display: flex; align-items: stretch; gap: var(--xp-space-one-half); min-width: 0; }
|
|
277
|
+
.xp-slot-version-actions > * { flex: 1 1 0; min-width: 0; }
|
|
278
|
+
.xp-slot-version-actions > div { display: flex; }
|
|
279
|
+
.xp-slot-version-actions .xp-ui-button { flex: 1; height: auto; min-height: 30px; padding: var(--xp-space-1) var(--xp-space-one-half); font-size: 12px; line-height: 16px; }
|
|
280
|
+
/* Match the solid disabled-button pattern without fading readable field values. */
|
|
281
|
+
.xp-slot-sidebar .xp-ui-input[aria-disabled='true'] {
|
|
282
|
+
opacity: 1;
|
|
283
|
+
background: var(--xp-surface-3);
|
|
284
|
+
border-color: var(--xp-border-strong);
|
|
285
|
+
color: var(--xp-text-2);
|
|
286
|
+
cursor: not-allowed;
|
|
287
|
+
}
|
|
288
|
+
.xp-slot-lock-notice {
|
|
289
|
+
padding: var(--xp-space-2) var(--xp-space-3);
|
|
290
|
+
border: 1px solid var(--xp-warning-border);
|
|
291
|
+
border-radius: var(--xp-radius-control);
|
|
292
|
+
background: var(--xp-warning-bg);
|
|
293
|
+
color: var(--xp-warning);
|
|
294
|
+
font: var(--xp-text-small);
|
|
295
|
+
overflow-wrap: anywhere;
|
|
296
|
+
scroll-margin-block: var(--xp-space-3);
|
|
297
|
+
}
|
|
298
|
+
.xp-slot-lock-notice[data-attention='true'] { border-color: var(--xp-error-border); background: var(--xp-error-bg); color: var(--xp-error); outline: 2px solid var(--xp-error); outline-offset: 2px; }
|
|
299
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
300
|
+
.xp-slot-lock-notice { transition: outline-color 180ms; }
|
|
301
|
+
}
|
|
@@ -281,11 +281,19 @@
|
|
|
281
281
|
.xp-ui-input::placeholder { color: var(--xp-text-3); }
|
|
282
282
|
.xp-ui-input:hover { border-color: var(--xp-text-3); }
|
|
283
283
|
.xp-ui-input[aria-invalid='true'] { border-color: var(--xp-error); }
|
|
284
|
-
.xp-ui-input--number { text-align:
|
|
285
|
-
/* The
|
|
286
|
-
.xp-ui-
|
|
287
|
-
.xp-ui-
|
|
288
|
-
.xp-ui-
|
|
284
|
+
.xp-ui-input--number { text-align: end; font-variant-numeric: tabular-nums; }
|
|
285
|
+
/* The open menu inherits the control's tokens, even in a dialog or canvas iframe. */
|
|
286
|
+
.xp-ui-combobox-wrap { display: block; position: relative; min-width: 0; max-width: 100%; }
|
|
287
|
+
.xp-ui-combobox { display: flex; align-items: center; justify-content: space-between; gap: var(--xp-space-2); cursor: pointer; text-align: start; }
|
|
288
|
+
.xp-ui-combobox > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
289
|
+
.xp-ui-combobox-chevron { flex: 0 0 auto; width: 7px; height: 7px; margin-inline-end: 4px; border-right: 2px solid var(--xp-text-2); border-bottom: 2px solid var(--xp-text-2); transform: translateY(-2px) rotate(45deg); }
|
|
290
|
+
.xp-ui-combobox-popup { box-sizing: border-box; position: fixed; inset: auto; margin: 0; padding: var(--xp-space-1); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--xp-border-strong); border-radius: var(--xp-radius-control); background: var(--xp-surface); color: var(--xp-text); font: var(--xp-text-body); z-index: 2147483647; }
|
|
291
|
+
.xp-ui-combobox-popup:popover-open { display: block; }
|
|
292
|
+
.xp-ui-combobox-option { padding: var(--xp-space-2); border-radius: var(--xp-space-1); cursor: pointer; overflow-wrap: anywhere; }
|
|
293
|
+
.xp-ui-combobox-option[data-active='true'] { background: var(--xp-surface-3); outline: 1px solid var(--xp-border-strong); outline-offset: -1px; }
|
|
294
|
+
.xp-ui-combobox-option[aria-disabled='true'] { color: var(--xp-text-3); cursor: not-allowed; }
|
|
295
|
+
.xp-ui-combobox-group { padding: var(--xp-space-2); color: var(--xp-text-2); font: var(--xp-text-small); }
|
|
296
|
+
.xp-ui-combobox-validation { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
|
|
289
297
|
.xp-ui-help { margin: 0; color: var(--xp-text-2); font: var(--xp-text-small); }
|
|
290
298
|
.xp-ui-error { margin: 0; color: var(--xp-error); font: var(--xp-text-small); }
|
|
291
299
|
.xp-ui-toggle { appearance: none; display: inline-block; width: 32px; height: 20px; margin: 0; padding: 2px; border-radius: 20px; border: 1px solid var(--xp-border-strong); background: var(--xp-surface-3); cursor: pointer; transition: background-color var(--xp-motion); }
|
|
@@ -518,6 +526,21 @@
|
|
|
518
526
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-error { color: var(--xp-error); }
|
|
519
527
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-help { color: var(--xp-text-2); }
|
|
520
528
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-field label { color: var(--xp-text); }
|
|
529
|
+
/* Native popovers keep this ancestry in the top layer. The fallback portals to
|
|
530
|
+
the nearest open dialog or owner-document body, copying the trigger's --xp-*
|
|
531
|
+
tokens; outside the field subtree, shared ui.css supplies the menu colors. */
|
|
532
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox { color: var(--xp-text); background: var(--xp-surface); border-color: var(--xp-border-strong); }
|
|
533
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox:hover { border-color: var(--xp-text-3); }
|
|
534
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox:focus-visible { outline: 2px solid var(--xp-focus); }
|
|
535
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox[aria-invalid='true'] { border-color: var(--xp-error); }
|
|
536
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox:disabled { opacity: 1; color: var(--xp-text-2); background: var(--xp-surface-3); border-color: var(--xp-border-strong); }
|
|
537
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox > span:first-child { color: inherit; }
|
|
538
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-chevron { border-right-color: var(--xp-text-2); border-bottom-color: var(--xp-text-2); }
|
|
539
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-popup { color: var(--xp-text); background: var(--xp-surface); border-color: var(--xp-border-strong); }
|
|
540
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-option { color: var(--xp-text); }
|
|
541
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-option[data-active='true'] { color: var(--xp-text); background: var(--xp-surface-3); outline: 1px solid var(--xp-border-strong); }
|
|
542
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-option[aria-disabled='true'] { color: var(--xp-text-3); }
|
|
543
|
+
[class*="_PuckFields"] .xp-slot-root .xp-ui-combobox-group { color: var(--xp-text-2); }
|
|
521
544
|
[class*="_PuckFields"] .xp-puck-field .xp-ui-button:disabled,
|
|
522
545
|
[class*="_PuckFields"] .xp-puck-field .xp-ui-button[aria-disabled='true'] {
|
|
523
546
|
opacity: 1;
|
|
@@ -558,9 +581,6 @@
|
|
|
558
581
|
/* Grid stretching must not turn a status chip into a full-width bar. */
|
|
559
582
|
.xp-slot-sidebar .xp-ui-status { justify-self: start; width: max-content; }
|
|
560
583
|
.xp-slot-sidebar fieldset { min-width: 0; }
|
|
561
|
-
.xp-slot-sidebar .xp-slot-version-group[data-active='true'] { border-inline-start: 3px solid var(--xp-focus); }
|
|
562
|
-
.xp-slot-sidebar .xp-slot-version-name { display: flex; align-items: end; gap: var(--xp-space-2); }
|
|
563
|
-
.xp-slot-sidebar .xp-slot-version-name > .xp-ui-field { flex: 1; min-width: 0; }
|
|
564
584
|
|
|
565
585
|
.xp-slot-header .xp-ui-status { flex: none; }
|
|
566
586
|
|
|
@@ -570,3 +590,106 @@
|
|
|
570
590
|
overflow-wrap: anywhere;
|
|
571
591
|
text-overflow: clip;
|
|
572
592
|
}
|
|
593
|
+
|
|
594
|
+
/* Compact field cards fit the Puck sidebar and wrap by their own available width. */
|
|
595
|
+
.xp-slot-sidebar .xp-slot-test-heading {
|
|
596
|
+
display: grid;
|
|
597
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
598
|
+
align-items: start;
|
|
599
|
+
gap: var(--xp-space-2);
|
|
600
|
+
}
|
|
601
|
+
.xp-slot-test-heading > strong { min-width: 0; overflow-wrap: anywhere; }
|
|
602
|
+
.xp-slot-sidebar .xp-ui-banner {
|
|
603
|
+
min-width: 0;
|
|
604
|
+
padding: var(--xp-space-2) var(--xp-space-3);
|
|
605
|
+
gap: var(--xp-space-2);
|
|
606
|
+
font: var(--xp-text-small);
|
|
607
|
+
overflow-wrap: anywhere;
|
|
608
|
+
}
|
|
609
|
+
.xp-slot-sidebar .xp-ui-banner > p { min-width: 0; }
|
|
610
|
+
.xp-slot-version-controls, .xp-slot-weights { display: grid; gap: var(--xp-space-2); min-width: 0; }
|
|
611
|
+
.xp-slot-sidebar .xp-slot-weight-inputs { gap: var(--xp-space-2); }
|
|
612
|
+
.xp-slot-version-item { min-width: 0; }
|
|
613
|
+
.xp-slot-version-group {
|
|
614
|
+
display: grid;
|
|
615
|
+
gap: var(--xp-space-2);
|
|
616
|
+
padding: var(--xp-space-2);
|
|
617
|
+
border: 1px solid var(--xp-border-strong);
|
|
618
|
+
border-radius: var(--xp-radius-control);
|
|
619
|
+
background: var(--xp-surface);
|
|
620
|
+
min-width: 0;
|
|
621
|
+
container-type: inline-size;
|
|
622
|
+
}
|
|
623
|
+
.xp-slot-version-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 72px; align-items: start; gap: var(--xp-space-half) var(--xp-space-2); min-width: 0; }
|
|
624
|
+
.xp-slot-version-open {
|
|
625
|
+
position: relative;
|
|
626
|
+
grid-area: 1 / 1;
|
|
627
|
+
min-width: 24px;
|
|
628
|
+
min-height: 32px;
|
|
629
|
+
padding: 0;
|
|
630
|
+
border: 0;
|
|
631
|
+
border-radius: var(--xp-radius-control);
|
|
632
|
+
background: transparent;
|
|
633
|
+
cursor: pointer;
|
|
634
|
+
}
|
|
635
|
+
.xp-slot-version-open::before { content: ''; position: absolute; inset-block: 4px; inset-inline-start: 0; width: 3px; border-radius: 2px; background: var(--xp-border-strong); }
|
|
636
|
+
.xp-slot-version-open[aria-pressed='true']::before { background: var(--xp-focus); }
|
|
637
|
+
.xp-slot-version-open:focus-visible { outline: 2px solid var(--xp-focus); outline-offset: 2px; }
|
|
638
|
+
.xp-slot-version-open:disabled { cursor: not-allowed; }
|
|
639
|
+
/* Flatten only field layout boxes so their feedback uses the entire card row. */
|
|
640
|
+
.xp-slot-version-name, .xp-slot-version-traffic, .xp-slot-version-row .xp-ui-field { display: contents; }
|
|
641
|
+
.xp-slot-version-name .xp-ui-input { grid-area: 1 / 2; min-width: 0; font-weight: 600; }
|
|
642
|
+
.xp-slot-version-traffic .xp-ui-input { grid-area: 1 / 3; min-width: 0; }
|
|
643
|
+
.xp-slot-version-label { grid-area: 1 / 2 / auto / -1; align-self: center; min-width: 0; overflow-wrap: anywhere; }
|
|
644
|
+
.xp-slot-version-row .xp-field-draft-notice,
|
|
645
|
+
.xp-slot-version-row .xp-ui-error { grid-column: 1 / -1; margin: 0; }
|
|
646
|
+
/* Reserve one feedback line. Visibility preserves geometry between saves. */
|
|
647
|
+
.xp-slot-version-saved { grid-column: 1 / -1; min-height: 16px; margin: 0; font: var(--xp-text-small); }
|
|
648
|
+
.xp-slot-version-row:has(.xp-ui-error) .xp-slot-version-saved { display: none; }
|
|
649
|
+
.xp-slot-version-row > .xp-slot-version-actions, .xp-slot-version-help { grid-column: 1 / -1; margin: 0; }
|
|
650
|
+
@container (max-width: 220px) {
|
|
651
|
+
.xp-slot-version-group > .xp-slot-version-row { grid-template-columns: 24px minmax(0, 1fr); }
|
|
652
|
+
.xp-slot-version-traffic .xp-ui-input { grid-area: 2 / 2; width: 72px; justify-self: end; }
|
|
653
|
+
.xp-slot-version-traffic .xp-slot-percent { grid-area: 2 / 2; }
|
|
654
|
+
}
|
|
655
|
+
.xp-slot-version-row .xp-ui-field > label {
|
|
656
|
+
position: absolute;
|
|
657
|
+
width: 1px;
|
|
658
|
+
height: 1px;
|
|
659
|
+
padding: 0;
|
|
660
|
+
margin: -1px;
|
|
661
|
+
overflow: hidden;
|
|
662
|
+
clip-path: inset(50%);
|
|
663
|
+
white-space: nowrap;
|
|
664
|
+
}
|
|
665
|
+
.xp-slot-version-row .xp-ui-input { height: 32px; padding-inline: var(--xp-space-2); font-size: 13px; }
|
|
666
|
+
.xp-slot-version-row .xp-ui-input--number { padding-inline-end: 22px; appearance: textfield; }
|
|
667
|
+
.xp-slot-version-row .xp-ui-input--number::-webkit-inner-spin-button,
|
|
668
|
+
.xp-slot-version-row .xp-ui-input--number::-webkit-outer-spin-button { appearance: none; margin: 0; }
|
|
669
|
+
.xp-slot-percent { position: relative; grid-area: 1 / 3; justify-self: end; inset-inline-end: var(--xp-space-2); top: 6px; font: var(--xp-text-small); color: var(--xp-text-2); pointer-events: none; }
|
|
670
|
+
.xp-slot-version-actions { display: flex; align-items: stretch; gap: var(--xp-space-one-half); min-width: 0; }
|
|
671
|
+
.xp-slot-version-actions > * { flex: 1 1 0; min-width: 0; }
|
|
672
|
+
.xp-slot-version-actions > div { display: flex; }
|
|
673
|
+
.xp-slot-version-actions .xp-ui-button { flex: 1; height: auto; min-height: 30px; padding: var(--xp-space-1) var(--xp-space-one-half); font-size: 12px; line-height: 16px; }
|
|
674
|
+
/* Match the solid disabled-button pattern without fading readable field values. */
|
|
675
|
+
.xp-slot-sidebar .xp-ui-input[aria-disabled='true'] {
|
|
676
|
+
opacity: 1;
|
|
677
|
+
background: var(--xp-surface-3);
|
|
678
|
+
border-color: var(--xp-border-strong);
|
|
679
|
+
color: var(--xp-text-2);
|
|
680
|
+
cursor: not-allowed;
|
|
681
|
+
}
|
|
682
|
+
.xp-slot-lock-notice {
|
|
683
|
+
padding: var(--xp-space-2) var(--xp-space-3);
|
|
684
|
+
border: 1px solid var(--xp-warning-border);
|
|
685
|
+
border-radius: var(--xp-radius-control);
|
|
686
|
+
background: var(--xp-warning-bg);
|
|
687
|
+
color: var(--xp-warning);
|
|
688
|
+
font: var(--xp-text-small);
|
|
689
|
+
overflow-wrap: anywhere;
|
|
690
|
+
scroll-margin-block: var(--xp-space-3);
|
|
691
|
+
}
|
|
692
|
+
.xp-slot-lock-notice[data-attention='true'] { border-color: var(--xp-error-border); background: var(--xp-error-bg); color: var(--xp-error); outline: 2px solid var(--xp-error); outline-offset: 2px; }
|
|
693
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
694
|
+
.xp-slot-lock-notice { transition: outline-color 180ms; }
|
|
695
|
+
}
|
|
@@ -3,18 +3,20 @@ import type { ArmSlot } from '../../types/puck.js';
|
|
|
3
3
|
import type { PreflightResult } from '../../types/endpoints.js';
|
|
4
4
|
export type EditorExperiment = {
|
|
5
5
|
name: string;
|
|
6
|
+
phase?: number;
|
|
6
7
|
updatedAt?: string;
|
|
7
8
|
status: Status;
|
|
8
9
|
arms: Array<Pick<Arm, 'key' | 'kind' | 'label'> & Partial<Arm>>;
|
|
9
10
|
decision?: {
|
|
10
11
|
winnerArm?: string;
|
|
12
|
+
discardedAt?: string;
|
|
11
13
|
} | null;
|
|
12
14
|
};
|
|
13
15
|
export declare function tabsFor(experiment?: Pick<EditorExperiment, 'arms'> | null): Array<{
|
|
14
16
|
slot: ArmSlot;
|
|
15
17
|
label: string;
|
|
16
18
|
}>;
|
|
17
|
-
export declare function bannerFor(status?: Status | null, winner?: string, original?: string): string;
|
|
19
|
+
export declare function bannerFor(status?: Status | null, winner?: string, original?: string, decision?: EditorExperiment['decision']): string;
|
|
18
20
|
/** Preserve the block's populated slots and the current test's versions, without carrying test settings. */
|
|
19
21
|
export declare function armsFromBlock(experiment: Pick<EditorExperiment, 'arms'>, content: Partial<Record<ArmSlot, unknown>>): Arm[];
|
|
20
22
|
/** The host's Payload Puck editor route identifies the saved document, including in an iframe. */
|
|
@@ -15,7 +15,7 @@ export function tabsFor(experiment) {
|
|
|
15
15
|
}
|
|
16
16
|
]).sort((a, b)=>Number(b.slot === 'control') - Number(a.slot === 'control'));
|
|
17
17
|
}
|
|
18
|
-
export function bannerFor(status, winner = editorCopy.labels.control, original = editorCopy.labels.control) {
|
|
18
|
+
export function bannerFor(status, winner = editorCopy.labels.control, original = editorCopy.labels.control, decision) {
|
|
19
19
|
switch(status){
|
|
20
20
|
case 'draft':
|
|
21
21
|
case 'stopped':
|
|
@@ -25,7 +25,7 @@ export function bannerFor(status, winner = editorCopy.labels.control, original =
|
|
|
25
25
|
case 'decided':
|
|
26
26
|
return editorCopy.decided(winner);
|
|
27
27
|
case 'archived':
|
|
28
|
-
return editorCopy.archived;
|
|
28
|
+
return decision?.winnerArm && !decision.discardedAt ? editorCopy.archived(winner) : editorCopy.archivedOriginal(original, Boolean(decision?.discardedAt));
|
|
29
29
|
default:
|
|
30
30
|
return editorCopy.unbound;
|
|
31
31
|
}
|
|
@@ -2,3 +2,4 @@ import { type BlockVisibility } from '../visibility.js';
|
|
|
2
2
|
import type { Data } from '@puckeditor/core';
|
|
3
3
|
export declare function localPlacements(data: Data): Map<string, Set<string>>;
|
|
4
4
|
export declare function localBlockVisibility(data: Data, id: string): BlockVisibility | undefined;
|
|
5
|
+
export declare function localNestedTests(data: Data): import("../nestedTests.js").NestedTest[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { nestedTests } from '../nestedTests.js';
|
|
1
2
|
import { walkVisiblePuck } from '../visibility.js';
|
|
2
3
|
// Puck data is immutable. Selection, hover and drag state reuse this
|
|
3
4
|
// result, and every block on the page shares a single traversal per data change.
|
|
@@ -29,3 +30,14 @@ export function localBlockVisibility(data, id) {
|
|
|
29
30
|
}
|
|
30
31
|
return blocks.get(id);
|
|
31
32
|
}
|
|
33
|
+
const nestedPages = new WeakMap();
|
|
34
|
+
export function localNestedTests(data) {
|
|
35
|
+
let nested = nestedPages.get(data);
|
|
36
|
+
if (!nested) {
|
|
37
|
+
nested = nestedTests(data, {
|
|
38
|
+
includeHidden: true
|
|
39
|
+
});
|
|
40
|
+
nestedPages.set(data, nested);
|
|
41
|
+
}
|
|
42
|
+
return nested;
|
|
43
|
+
}
|
|
@@ -2,40 +2,50 @@ import type { DocId } from '../../types/contracts.js';
|
|
|
2
2
|
import type { PreflightResult } from '../../types/endpoints.js';
|
|
3
3
|
type Placements = PreflightResult['placements'];
|
|
4
4
|
/** Share mounted reads, but destructive actions always bypass settled cached knowledge. */
|
|
5
|
-
export declare function refreshPlacements(api: string, id: DocId): Promise<{
|
|
5
|
+
export declare function refreshPlacements(api: string, id: DocId, contentLocale?: string): Promise<{
|
|
6
6
|
collection: string;
|
|
7
7
|
id: DocId;
|
|
8
8
|
title: string;
|
|
9
|
+
locales?: string[];
|
|
10
|
+
allLocales?: true;
|
|
11
|
+
localeCodes?: string[];
|
|
12
|
+
slotCount?: number;
|
|
9
13
|
url?: string;
|
|
10
14
|
editorUrl?: string;
|
|
11
15
|
slots?: Record<import("../../types/puck.js").ArmSlot, number>;
|
|
16
|
+
partlyFilledSlots?: import("../../types/puck.js").ArmSlot[];
|
|
12
17
|
ok: boolean;
|
|
13
18
|
detail?: string;
|
|
14
19
|
}[] | undefined>;
|
|
15
20
|
/** Focus storms share the last attempt (including polling), at most once per ten seconds. */
|
|
16
|
-
export declare function focusPlacements(api: string, id: DocId): Promise<{
|
|
21
|
+
export declare function focusPlacements(api: string, id: DocId, contentLocale?: string): Promise<{
|
|
17
22
|
collection: string;
|
|
18
23
|
id: DocId;
|
|
19
24
|
title: string;
|
|
25
|
+
locales?: string[];
|
|
26
|
+
allLocales?: true;
|
|
27
|
+
localeCodes?: string[];
|
|
28
|
+
slotCount?: number;
|
|
20
29
|
url?: string;
|
|
21
30
|
editorUrl?: string;
|
|
22
31
|
slots?: Record<import("../../types/puck.js").ArmSlot, number>;
|
|
32
|
+
partlyFilledSlots?: import("../../types/puck.js").ArmSlot[];
|
|
23
33
|
ok: boolean;
|
|
24
34
|
detail?: string;
|
|
25
35
|
}[] | undefined>;
|
|
26
|
-
export declare function invalidatePlacements(api: string, id: DocId): void;
|
|
36
|
+
export declare function invalidatePlacements(api: string, id: DocId, contentLocale?: string): void;
|
|
27
37
|
/** Listen without starting a request; the drawer already owns its initial preflight. */
|
|
28
|
-
export declare function subscribePlacements(api: string, id: DocId, notify: (placements: Placements | undefined) => void): () => void;
|
|
29
|
-
export declare function acquirePlacements(api: string, id: DocId, notify: (placements: Placements | undefined) => void, fresh?: boolean): () => void;
|
|
38
|
+
export declare function subscribePlacements(api: string, id: DocId, notify: (placements: Placements | undefined) => void, contentLocale?: string): () => void;
|
|
39
|
+
export declare function acquirePlacements(api: string, id: DocId, notify: (placements: Placements | undefined) => void, fresh?: boolean, contentLocale?: string): () => void;
|
|
30
40
|
/** Drawer preflight uses this same producer and follows a superseding post-write read. */
|
|
31
|
-
export declare function readEditorPreflight(api: string, id: DocId, signal: AbortSignal, supersede?: boolean): Promise<Response>;
|
|
41
|
+
export declare function readEditorPreflight(api: string, id: DocId, signal: AbortSignal, supersede?: boolean, contentLocale?: string): Promise<Response>;
|
|
32
42
|
/** Current readiness shares the same request and lifetime as placements. */
|
|
33
|
-
export declare function cachedPreflight(api: string, id: DocId): PreflightResult | undefined;
|
|
43
|
+
export declare function cachedPreflight(api: string, id: DocId, contentLocale?: string): PreflightResult | undefined;
|
|
34
44
|
/** Mandatory post-write/refusal reads guard Start in every shared consumer. */
|
|
35
|
-
export declare function placementsBlocking(api: string, id: DocId): boolean;
|
|
36
|
-
export declare function placementsPending(api: string, id: DocId): boolean;
|
|
45
|
+
export declare function placementsBlocking(api: string, id: DocId, contentLocale?: string): boolean;
|
|
46
|
+
export declare function placementsPending(api: string, id: DocId, contentLocale?: string): boolean;
|
|
37
47
|
/** Pending reads retain the complete settled classification, including terminal outcomes. */
|
|
38
|
-
export declare function cachedReadinessRead(api: string, id: DocId): {
|
|
48
|
+
export declare function cachedReadinessRead(api: string, id: DocId, contentLocale?: string): {
|
|
39
49
|
status: number;
|
|
40
50
|
loadState: "forbidden" | "error" | "missing" | "ready";
|
|
41
51
|
kind: string;
|
|
@@ -45,6 +55,6 @@ export declare function cachedReadinessRead(api: string, id: DocId): {
|
|
|
45
55
|
retry: boolean;
|
|
46
56
|
pollDelay: number | null;
|
|
47
57
|
} | undefined;
|
|
48
|
-
export declare function placementReadError(api: string, id: DocId): string | undefined;
|
|
49
|
-
export declare function watchPlacementNotice(api: string, id: DocId, doc: Document): () => void;
|
|
58
|
+
export declare function placementReadError(api: string, id: DocId, contentLocale?: string): string | undefined;
|
|
59
|
+
export declare function watchPlacementNotice(api: string, id: DocId, doc: Document, contentLocale?: string, showingNotice?: boolean): () => void;
|
|
50
60
|
export {};
|