@delmaredigital/payload-experiments 0.4.0-rc.5 → 0.4.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/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 +8 -4
- package/dist/admin/copy/blocks.d.ts +3 -2
- package/dist/admin/copy/blocks.js +7 -6
- package/dist/admin/copy/newTest.d.ts +1 -1
- package/dist/admin/copy/newTest.js +1 -1
- package/dist/admin/surface/ResultsRoute.js +2 -1
- package/dist/admin/surface/TestsHome.d.ts +2 -1
- package/dist/admin/surface/TestsHome.js +91 -37
- package/dist/admin/surface/TestsSurface.js +3 -0
- package/dist/admin/surface/home.model.d.ts +2 -0
- package/dist/admin/surface/newTest/NewTest.js +16 -18
- package/dist/admin/surface/newTest/PageWizard.js +1 -0
- package/dist/admin/surface/newTest/newTest.css +3 -1
- 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 +8 -14
- package/dist/blocks/placementLanguages.d.ts +7 -0
- package/dist/blocks/placementLanguages.js +27 -0
- package/dist/blocks/placementLocale.d.ts +23 -7
- package/dist/blocks/placementLocale.js +221 -66
- package/dist/db/appends.d.ts +13 -0
- package/dist/db/appends.js +49 -0
- package/dist/db/bulkPlacementRemoval.js +8 -4
- 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 +206 -0
- package/dist/endpoints/index.js +7 -0
- package/dist/endpoints/pages.js +7 -3
- package/dist/endpoints/placementStatus.js +6 -1
- package/dist/endpoints/preflight.d.ts +1 -1
- package/dist/endpoints/preflight.js +17 -2
- 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/goals/fairness.js +43 -34
- package/dist/hooks/blockRemovalRule.d.ts +4 -3
- package/dist/hooks/blockRemovalRule.js +33 -9
- package/dist/hooks/pageGuard.d.ts +3 -0
- package/dist/hooks/pageGuard.js +34 -24
- package/dist/hooks/puckNestedTests.d.ts +8 -0
- package/dist/hooks/puckNestedTests.js +36 -0
- 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 +5 -1
- package/dist/puck/ExperimentPicker.d.ts +2 -1
- package/dist/puck/ExperimentPicker.js +37 -30
- package/dist/puck/ExperimentSlot.js +3 -1
- package/dist/puck/copy.d.ts +1 -0
- package/dist/puck/copy.js +1 -0
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +8 -4
- package/dist/puck/editor/ConfigureTestDrawer.js +4 -2
- package/dist/puck/editor/CreateExperimentDrawer.d.ts +2 -1
- package/dist/puck/editor/CreateExperimentDrawer.js +24 -20
- package/dist/puck/editor/EditorControls.d.ts +1 -1
- package/dist/puck/editor/EditorControls.js +1 -1
- package/dist/puck/editor/ExperimentSlotEditor.js +405 -394
- package/dist/puck/editor/LeftoverVersions.d.ts +4 -2
- package/dist/puck/editor/LeftoverVersions.js +23 -44
- package/dist/puck/editor/QuickTestActions.js +2 -2
- package/dist/puck/editor/VersionBuilder.d.ts +41 -13
- package/dist/puck/editor/VersionBuilder.js +461 -224
- package/dist/puck/editor/armWrites.d.ts +9 -2
- package/dist/puck/editor/armWrites.js +40 -2
- package/dist/puck/editor/armsCache.d.ts +1 -1
- package/dist/puck/editor/armsCache.js +2 -1
- package/dist/puck/editor/blockClipboard.d.ts +16 -0
- package/dist/puck/editor/blockClipboard.js +20 -0
- package/dist/puck/editor/copy.d.ts +27 -26
- package/dist/puck/editor/copy.js +28 -26
- package/dist/puck/editor/createTest.d.ts +3 -0
- package/dist/puck/editor/createTest.js +33 -0
- package/dist/puck/editor/editor.chrome.css +138 -17
- package/dist/puck/editor/editor.css +156 -22
- package/dist/puck/editor/editor.model.d.ts +2 -1
- package/dist/puck/editor/editor.model.js +3 -3
- package/dist/puck/editor/experimentOutlinePlugin.js +1 -1
- package/dist/puck/editor/localPlacements.d.ts +5 -2
- package/dist/puck/editor/localPlacements.js +32 -18
- package/dist/puck/editor/placementsCache.d.ts +18 -12
- package/dist/puck/editor/placementsCache.js +52 -47
- package/dist/puck/editor/sidebar.d.ts +2 -6
- package/dist/puck/editor/sidebar.js +3 -6
- package/dist/puck/editor/usePlacementNotice.d.ts +1 -1
- package/dist/puck/editor/usePlacementNotice.js +4 -3
- package/dist/puck/experimentSlug.d.ts +2 -0
- package/dist/puck/experimentSlug.js +3 -0
- package/dist/puck/nestedTestCopy.d.ts +8 -0
- package/dist/puck/nestedTestCopy.js +22 -0
- package/dist/puck/nestedTests.d.ts +17 -0
- package/dist/puck/nestedTests.js +30 -0
- package/dist/puck/slotConfig.d.ts +1 -1
- package/dist/puck/slotConfig.js +17 -4
- package/dist/puck/visibility.d.ts +20 -0
- package/dist/puck/visibility.js +81 -0
- package/dist/server/recordContentChange.js +37 -20
- package/dist/server/resolveExperimentData.js +6 -3
- package/dist/testSurface/PreviewLinks.js +6 -2
- package/dist/testSurface/api.d.ts +6 -3
- package/dist/testSurface/api.js +10 -6
- package/dist/testSurface/contentLocaleURL.d.ts +2 -0
- package/dist/testSurface/contentLocaleURL.js +3 -0
- package/dist/testSurface/copy/common.d.ts +4 -0
- package/dist/testSurface/copy/common.js +8 -4
- package/dist/testSurface/copy/languages.d.ts +11 -0
- package/dist/testSurface/copy/languages.js +7 -0
- package/dist/testSurface/copy/readiness.d.ts +2 -1
- package/dist/testSurface/copy/readiness.js +2 -1
- package/dist/testSurface/copy/testPage.d.ts +28 -6
- package/dist/testSurface/copy/testPage.js +28 -6
- 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/results/results.css +1 -1
- package/dist/testSurface/results/results.model.d.ts +1 -1
- package/dist/testSurface/surface/contracts.d.ts +2 -0
- package/dist/testSurface/surface/editorPlacement.d.ts +5 -0
- package/dist/testSurface/surface/editorPlacement.js +18 -0
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +2 -1
- package/dist/testSurface/surface/pageBlock/parts.js +24 -6
- package/dist/testSurface/surface/readiness/ActionDialogs.js +28 -34
- package/dist/testSurface/surface/readiness/readiness.model.js +9 -2
- package/dist/testSurface/surface/results/useResults.d.ts +4 -1
- package/dist/testSurface/surface/test/DeleteTest.d.ts +15 -0
- package/dist/testSurface/surface/test/DeleteTest.js +171 -0
- package/dist/testSurface/surface/test/GoalSection.js +101 -74
- package/dist/testSurface/surface/test/TestSurface.js +29 -9
- package/dist/testSurface/surface/test/fields.d.ts +1 -3
- package/dist/testSurface/surface/test/fields.js +5 -35
- package/dist/testSurface/surface/useTestDocument.d.ts +2 -1
- package/dist/testSurface/surface/useTestDocument.js +20 -4
- package/dist/testSurface/useApi.d.ts +4 -1
- package/dist/transitions/checkStart.d.ts +4 -1
- package/dist/transitions/checkStart.js +117 -14
- package/dist/transitions/contentFields.js +9 -5
- package/dist/transitions/makeContent.js +29 -9
- package/dist/transitions/nestedPlacementNames.d.ts +5 -0
- package/dist/transitions/nestedPlacementNames.js +33 -0
- package/dist/transitions/pageVersions.js +3 -1
- package/dist/transitions/placementInteractions.js +7 -4
- package/dist/transitions/placements.d.ts +26 -1
- package/dist/transitions/placements.js +239 -87
- package/dist/transitions/preflightData.d.ts +2 -1
- package/dist/transitions/preflightData.js +66 -3
- package/dist/transitions/start.js +4 -1
- package/dist/types/endpoints.d.ts +35 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/puck.d.ts +1 -0
- package/dist/types/surface.d.ts +2 -0
- package/dist/ui/Button.js +2 -2
- 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 +0 -1
- package/dist/ui/Tabs.js +28 -40
- package/dist/ui/ui.css +18 -5
- package/package.json +3 -2
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
.xp-ui-button--sm { height: 30px; padding: 0 10px; font-size: 13px; }
|
|
274
274
|
.xp-ui-button--link { height: auto; min-height: 0; padding-inline: 0; color: var(--xp-accent-text); text-decoration: var(--xp-accent-text-decoration); }
|
|
275
275
|
.xp-ui-button--link:hover { text-decoration: underline; }
|
|
276
|
-
.xp-ui-button:disabled, .xp-ui-button[aria-disabled='true'], .xp-ui-input:disabled, .xp-ui-toggle:disabled { opacity: .5; cursor: not-allowed; }
|
|
276
|
+
.xp-ui-button:disabled, .xp-ui-button[aria-disabled='true'], .xp-ui-input:disabled, .xp-ui-input[aria-disabled='true'], .xp-ui-toggle:disabled { opacity: .5; cursor: not-allowed; }
|
|
277
277
|
.xp-ui-button:focus-visible, .xp-ui-input:focus-visible, .xp-ui-toggle:focus-visible, .xp-ui-tab:focus-visible, .xp-ui-tabpanel:focus-visible, .xp-ui-breadcrumb a:focus-visible, .xp-ui-dialog:focus-visible { outline: 2px solid var(--xp-focus); outline-offset: 2px; }
|
|
278
278
|
.xp-ui-field { min-width: 0; max-width: 100%; display: grid; gap: 6px; color: var(--xp-text); font: var(--xp-text-body); }
|
|
279
279
|
.xp-ui-field > label { font-weight: 500; }
|
|
@@ -281,8 +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
|
-
|
|
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; }
|
|
286
297
|
.xp-ui-help { margin: 0; color: var(--xp-text-2); font: var(--xp-text-small); }
|
|
287
298
|
.xp-ui-error { margin: 0; color: var(--xp-error); font: var(--xp-text-small); }
|
|
288
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); }
|
|
@@ -298,7 +309,7 @@
|
|
|
298
309
|
.xp-ui-section-body { padding: 20px; }
|
|
299
310
|
.xp-ui-tabs { color: var(--xp-text); font: var(--xp-text-body); }
|
|
300
311
|
.xp-ui-tablist { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--xp-border); }
|
|
301
|
-
.xp-ui-tab { appearance: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 12px; background: transparent; color: var(--xp-text-2); font: var(--xp-text-body); cursor: pointer; }
|
|
312
|
+
.xp-ui-tab { min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; appearance: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 12px; background: transparent; color: var(--xp-text-2); font: var(--xp-text-body); cursor: pointer; }
|
|
302
313
|
.xp-ui-tab[aria-selected='true'] { color: var(--xp-accent-text); text-decoration: var(--xp-accent-text-decoration); border-bottom-color: var(--xp-accent-text); font-weight: 600; }
|
|
303
314
|
.xp-ui-tab:disabled { opacity: .5; cursor: not-allowed; }
|
|
304
315
|
.xp-ui-tabpanel { padding-block: 16px; }
|
|
@@ -372,13 +383,15 @@
|
|
|
372
383
|
/* Actions sit beside each tab visually and outside the tablist's owned roles. */
|
|
373
384
|
.xp-ui-tabbar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 4px; border-bottom: 1px solid var(--xp-border); }
|
|
374
385
|
.xp-ui-tabbar > .xp-ui-tablist { display: contents; }
|
|
375
|
-
.xp-ui-tab-actions { display: flex; align-items: center; flex-wrap: wrap; position: relative; }
|
|
376
386
|
|
|
377
387
|
/* One blocker-list format in the admin footer and the Puck sidebar. */
|
|
378
388
|
.xp-readiness__blockers, .xp-readiness__blockers a { color: var(--xp-error); }
|
|
379
389
|
.xp-readiness__blockers ul { margin: 0; padding-inline-start: var(--xp-space-4); }
|
|
380
390
|
.xp-readiness__blockers li { white-space: pre-line; }
|
|
381
391
|
|
|
392
|
+
.xp-other-goals summary { cursor: pointer; font-weight: 600; }
|
|
393
|
+
.xp-other-goal-list { display: grid; gap: var(--xp-space-3); padding-block: var(--xp-space-3); }
|
|
394
|
+
|
|
382
395
|
/* Shared UI controls are assembled into editor.css for the isolated canvas. */
|
|
383
396
|
.xp-slot-editor {
|
|
384
397
|
min-width: 0;
|
|
@@ -399,7 +412,7 @@
|
|
|
399
412
|
|
|
400
413
|
.xp-slot-header {
|
|
401
414
|
display: flex;
|
|
402
|
-
flex-wrap:
|
|
415
|
+
flex-wrap: nowrap;
|
|
403
416
|
align-items: center;
|
|
404
417
|
gap: var(--xp-space-2);
|
|
405
418
|
cursor: pointer;
|
|
@@ -420,7 +433,11 @@
|
|
|
420
433
|
color: var(--xp-text);
|
|
421
434
|
font: inherit;
|
|
422
435
|
font-weight: 600;
|
|
423
|
-
|
|
436
|
+
min-width: 0;
|
|
437
|
+
flex: 1;
|
|
438
|
+
white-space: nowrap;
|
|
439
|
+
overflow: hidden;
|
|
440
|
+
text-overflow: ellipsis;
|
|
424
441
|
}
|
|
425
442
|
|
|
426
443
|
.xp-slot-editor > .xp-ui-tabs > .xp-ui-tabs-header {
|
|
@@ -475,7 +492,7 @@
|
|
|
475
492
|
gap: var(--xp-space-4);
|
|
476
493
|
}
|
|
477
494
|
|
|
478
|
-
.xp-slot-confirm {
|
|
495
|
+
.xp-slot-copy-confirm {
|
|
479
496
|
padding: var(--xp-space-2) var(--xp-space-3);
|
|
480
497
|
border: 1px solid var(--xp-warning);
|
|
481
498
|
border-radius: var(--xp-radius);
|
|
@@ -495,16 +512,6 @@
|
|
|
495
512
|
}
|
|
496
513
|
|
|
497
514
|
.xp-slot-editor .xp-ui-tabs-header { display: flex; flex-wrap: wrap; align-items: stretch; }
|
|
498
|
-
.xp-slot-version-actions { display: contents; }
|
|
499
|
-
.xp-slot-version-anchor { position: relative; display: flex; align-items: center; border-bottom: 1px solid var(--xp-border); }
|
|
500
|
-
.xp-slot-version-rename { flex: 1 0 100%; min-width: 0; padding-top: var(--xp-space-2); }
|
|
501
|
-
.xp-slot-version-menu {
|
|
502
|
-
position: absolute; top: 100%; inset-inline-end: 0; z-index: 5;
|
|
503
|
-
display: grid; min-width: 180px; padding: var(--xp-space-2);
|
|
504
|
-
box-shadow: 0 8px 24px var(--xp-overlay);
|
|
505
|
-
background: var(--xp-surface); border: 1px solid var(--xp-border); border-radius: var(--xp-radius);
|
|
506
|
-
}
|
|
507
|
-
.xp-slot-version-menu .xp-ui-button { justify-content: start; }
|
|
508
515
|
.xp-slot-weight-inputs, .xp-slot-people { display: flex; flex-wrap: wrap; gap: var(--xp-space-3); }
|
|
509
516
|
.xp-slot-weight-inputs { align-items: flex-start; }
|
|
510
517
|
.xp-slot-weight-inputs .xp-ui-field { flex: 1 1 120px; max-width: 200px; }
|
|
@@ -519,7 +526,23 @@
|
|
|
519
526
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-error { color: var(--xp-error); }
|
|
520
527
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-help { color: var(--xp-text-2); }
|
|
521
528
|
[class*="_PuckFields"] .xp-slot-root .xp-ui-field label { color: var(--xp-text); }
|
|
522
|
-
|
|
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); }
|
|
544
|
+
[class*="_PuckFields"] .xp-puck-field .xp-ui-button:disabled,
|
|
545
|
+
[class*="_PuckFields"] .xp-puck-field .xp-ui-button[aria-disabled='true'] {
|
|
523
546
|
opacity: 1;
|
|
524
547
|
background: var(--xp-surface-3);
|
|
525
548
|
border-color: var(--xp-border-strong);
|
|
@@ -550,11 +573,122 @@
|
|
|
550
573
|
|
|
551
574
|
.xp-slot-editor .xp-ui-tabbar { flex: 1 1 auto; min-width: 0; }
|
|
552
575
|
|
|
553
|
-
.xp-slot-weight-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--xp-space-2); }
|
|
554
576
|
.xp-slot-sidebar { display: grid; gap: var(--xp-space-4); }
|
|
555
577
|
.xp-slot-sidebar section, .xp-slot-sidebar section > div { display: grid; gap: var(--xp-space-3); }
|
|
556
|
-
.xp-slot-sidebar h4 { margin: 0; font: inherit; font-weight: 600; }
|
|
557
578
|
.xp-slot-sidebar .xp-slot-weight-inputs { display: grid; }
|
|
558
579
|
.xp-slot-sidebar .xp-slot-weight-inputs .xp-ui-field { max-width: none; flex: 1 1 100%; }
|
|
559
580
|
|
|
560
|
-
|
|
581
|
+
/* Grid stretching must not turn a status chip into a full-width bar. */
|
|
582
|
+
.xp-slot-sidebar .xp-ui-status { justify-self: start; width: max-content; }
|
|
583
|
+
.xp-slot-sidebar fieldset { min-width: 0; }
|
|
584
|
+
|
|
585
|
+
.xp-slot-header .xp-ui-status { flex: none; }
|
|
586
|
+
|
|
587
|
+
.xp-slot-title-sentence {
|
|
588
|
+
white-space: normal;
|
|
589
|
+
overflow: visible;
|
|
590
|
+
overflow-wrap: anywhere;
|
|
591
|
+
text-overflow: clip;
|
|
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-ui-error { grid-column: 1 / -1; margin: 0; }
|
|
645
|
+
/* Reserve one feedback line. Visibility preserves geometry between saves. */
|
|
646
|
+
.xp-slot-version-saved { grid-column: 1 / -1; min-height: 16px; margin: 0; font: var(--xp-text-small); }
|
|
647
|
+
.xp-slot-version-row:has(.xp-ui-error) .xp-slot-version-saved { display: none; }
|
|
648
|
+
.xp-slot-version-row > .xp-slot-version-actions, .xp-slot-version-help { grid-column: 1 / -1; margin: 0; }
|
|
649
|
+
@container (max-width: 220px) {
|
|
650
|
+
.xp-slot-version-group > .xp-slot-version-row { grid-template-columns: 24px minmax(0, 1fr); }
|
|
651
|
+
.xp-slot-version-traffic .xp-ui-input { grid-area: 2 / 2; width: 72px; justify-self: end; }
|
|
652
|
+
.xp-slot-version-traffic .xp-slot-percent { grid-area: 2 / 2; }
|
|
653
|
+
}
|
|
654
|
+
.xp-slot-version-row .xp-ui-field > label {
|
|
655
|
+
position: absolute;
|
|
656
|
+
width: 1px;
|
|
657
|
+
height: 1px;
|
|
658
|
+
padding: 0;
|
|
659
|
+
margin: -1px;
|
|
660
|
+
overflow: hidden;
|
|
661
|
+
clip-path: inset(50%);
|
|
662
|
+
white-space: nowrap;
|
|
663
|
+
}
|
|
664
|
+
.xp-slot-version-row .xp-ui-input { height: 32px; padding-inline: var(--xp-space-2); font-size: 13px; }
|
|
665
|
+
.xp-slot-version-row .xp-ui-input--number { padding-inline-end: 22px; appearance: textfield; }
|
|
666
|
+
.xp-slot-version-row .xp-ui-input--number::-webkit-inner-spin-button,
|
|
667
|
+
.xp-slot-version-row .xp-ui-input--number::-webkit-outer-spin-button { appearance: none; margin: 0; }
|
|
668
|
+
.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; }
|
|
669
|
+
.xp-slot-version-actions { display: flex; align-items: stretch; gap: var(--xp-space-one-half); min-width: 0; }
|
|
670
|
+
.xp-slot-version-actions > * { flex: 1 1 0; min-width: 0; }
|
|
671
|
+
.xp-slot-version-actions > div { display: flex; }
|
|
672
|
+
.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; }
|
|
673
|
+
/* Match the solid disabled-button pattern without fading readable field values. */
|
|
674
|
+
.xp-slot-sidebar .xp-ui-input[aria-disabled='true'] {
|
|
675
|
+
opacity: 1;
|
|
676
|
+
background: var(--xp-surface-3);
|
|
677
|
+
border-color: var(--xp-border-strong);
|
|
678
|
+
color: var(--xp-text-2);
|
|
679
|
+
cursor: not-allowed;
|
|
680
|
+
}
|
|
681
|
+
.xp-slot-lock-notice {
|
|
682
|
+
padding: var(--xp-space-2) var(--xp-space-3);
|
|
683
|
+
border: 1px solid var(--xp-warning-border);
|
|
684
|
+
border-radius: var(--xp-radius-control);
|
|
685
|
+
background: var(--xp-warning-bg);
|
|
686
|
+
color: var(--xp-warning);
|
|
687
|
+
font: var(--xp-text-small);
|
|
688
|
+
overflow-wrap: anywhere;
|
|
689
|
+
scroll-margin-block: var(--xp-space-3);
|
|
690
|
+
}
|
|
691
|
+
.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; }
|
|
692
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
693
|
+
.xp-slot-lock-notice { transition: outline-color 180ms; }
|
|
694
|
+
}
|
|
@@ -8,13 +8,14 @@ export type EditorExperiment = {
|
|
|
8
8
|
arms: Array<Pick<Arm, 'key' | 'kind' | 'label'> & Partial<Arm>>;
|
|
9
9
|
decision?: {
|
|
10
10
|
winnerArm?: string;
|
|
11
|
+
discardedAt?: string;
|
|
11
12
|
} | null;
|
|
12
13
|
};
|
|
13
14
|
export declare function tabsFor(experiment?: Pick<EditorExperiment, 'arms'> | null): Array<{
|
|
14
15
|
slot: ArmSlot;
|
|
15
16
|
label: string;
|
|
16
17
|
}>;
|
|
17
|
-
export declare function bannerFor(status?: Status | null, winner?: string): string;
|
|
18
|
+
export declare function bannerFor(status?: Status | null, winner?: string, original?: string, decision?: EditorExperiment['decision']): string;
|
|
18
19
|
/** Preserve the block's populated slots and the current test's versions, without carrying test settings. */
|
|
19
20
|
export declare function armsFromBlock(experiment: Pick<EditorExperiment, 'arms'>, content: Partial<Record<ArmSlot, unknown>>): Arm[];
|
|
20
21
|
/** The host's Payload Puck editor route identifies the saved document, including in an iframe. */
|
|
@@ -15,17 +15,17 @@ 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) {
|
|
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':
|
|
22
|
-
return editorCopy.draft;
|
|
22
|
+
return editorCopy.draft(original);
|
|
23
23
|
case 'running':
|
|
24
24
|
return editorCopy.running;
|
|
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
|
}
|
|
@@ -52,7 +52,7 @@ const chain = (count)=>Array(count).fill(zone).join(' ~ ');
|
|
|
52
52
|
// A drag's collision shapes were measured before it began. Never hide a
|
|
53
53
|
// previously visible target mid-drag; apply the new tab after it finishes.
|
|
54
54
|
if (!valid || unknown) fixedHidden.current = [];
|
|
55
|
-
else if (!dragging) fixedHidden.current = slots.filter((slot, index)=>
|
|
55
|
+
else if (!dragging) fixedHidden.current = slots.filter((slot, index)=>active ? slot !== active : slot !== active && slot !== 'control' && !known?.arms.includes(slot) && emptySlots[index]);
|
|
56
56
|
const rules = !valid || unknown ? '' : slots.flatMap((slot, index)=>{
|
|
57
57
|
// No canvas tab is mounted: retain the existing empty-unused-slot behavior.
|
|
58
58
|
if (!fixedHidden.current.includes(slot)) return [];
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type BlockVisibility } from '../visibility.js';
|
|
2
|
+
import type { Data } from '@puckeditor/core';
|
|
3
|
+
export declare function localPlacements(data: Data): Map<string, Set<string>>;
|
|
4
|
+
export declare function localBlockVisibility(data: Data, id: string): BlockVisibility | undefined;
|
|
5
|
+
export declare function localNestedTests(data: Data): import("../nestedTests.js").NestedTest[];
|
|
@@ -1,29 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { nestedTests } from '../nestedTests.js';
|
|
2
|
+
import { walkVisiblePuck } from '../visibility.js';
|
|
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.
|
|
4
5
|
const pages = new WeakMap();
|
|
5
|
-
export function localPlacements(data
|
|
6
|
-
let
|
|
7
|
-
if (!configs) {
|
|
8
|
-
configs = new WeakMap();
|
|
9
|
-
pages.set(data, configs);
|
|
10
|
-
}
|
|
11
|
-
let placements = configs.get(config);
|
|
6
|
+
export function localPlacements(data) {
|
|
7
|
+
let placements = pages.get(data);
|
|
12
8
|
if (!placements) {
|
|
13
9
|
placements = new Map();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
walkVisiblePuck(data, (item, visibility)=>{
|
|
11
|
+
const ref = item.props.experiment;
|
|
12
|
+
if (!visibility.hidden && item.type === 'ExperimentSlot' && ref && ref.id !== undefined) {
|
|
13
|
+
const key = String(ref.id);
|
|
17
14
|
const ids = placements.get(key) ?? new Set();
|
|
18
|
-
ids.add(item.props.id);
|
|
15
|
+
ids.add(String(item.props.id));
|
|
19
16
|
placements.set(key, ids);
|
|
20
17
|
}
|
|
21
|
-
};
|
|
22
|
-
walkTree(data, config, (content)=>{
|
|
23
|
-
collect(content);
|
|
24
18
|
});
|
|
25
|
-
|
|
26
|
-
configs.set(config, placements);
|
|
19
|
+
pages.set(data, placements);
|
|
27
20
|
}
|
|
28
21
|
return placements;
|
|
29
22
|
}
|
|
23
|
+
const visibilityPages = new WeakMap();
|
|
24
|
+
export function localBlockVisibility(data, id) {
|
|
25
|
+
let blocks = visibilityPages.get(data);
|
|
26
|
+
if (!blocks) {
|
|
27
|
+
blocks = new Map();
|
|
28
|
+
walkVisiblePuck(data, (block, visibility)=>blocks.set(String(block.props.id), visibility));
|
|
29
|
+
visibilityPages.set(data, blocks);
|
|
30
|
+
}
|
|
31
|
+
return blocks.get(id);
|
|
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,10 +2,13 @@ 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
|
+
slotCount?: number;
|
|
9
12
|
url?: string;
|
|
10
13
|
editorUrl?: string;
|
|
11
14
|
slots?: Record<import("../../types/puck.js").ArmSlot, number>;
|
|
@@ -13,29 +16,32 @@ export declare function refreshPlacements(api: string, id: DocId): Promise<{
|
|
|
13
16
|
detail?: string;
|
|
14
17
|
}[] | undefined>;
|
|
15
18
|
/** Focus storms share the last attempt (including polling), at most once per ten seconds. */
|
|
16
|
-
export declare function focusPlacements(api: string, id: DocId): Promise<{
|
|
19
|
+
export declare function focusPlacements(api: string, id: DocId, contentLocale?: string): Promise<{
|
|
17
20
|
collection: string;
|
|
18
21
|
id: DocId;
|
|
19
22
|
title: string;
|
|
23
|
+
locales?: string[];
|
|
24
|
+
allLocales?: true;
|
|
25
|
+
slotCount?: number;
|
|
20
26
|
url?: string;
|
|
21
27
|
editorUrl?: string;
|
|
22
28
|
slots?: Record<import("../../types/puck.js").ArmSlot, number>;
|
|
23
29
|
ok: boolean;
|
|
24
30
|
detail?: string;
|
|
25
31
|
}[] | undefined>;
|
|
26
|
-
export declare function invalidatePlacements(api: string, id: DocId): void;
|
|
32
|
+
export declare function invalidatePlacements(api: string, id: DocId, contentLocale?: string): void;
|
|
27
33
|
/** 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;
|
|
34
|
+
export declare function subscribePlacements(api: string, id: DocId, notify: (placements: Placements | undefined) => void, contentLocale?: string): () => void;
|
|
35
|
+
export declare function acquirePlacements(api: string, id: DocId, notify: (placements: Placements | undefined) => void, fresh?: boolean, contentLocale?: string): () => void;
|
|
30
36
|
/** 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>;
|
|
37
|
+
export declare function readEditorPreflight(api: string, id: DocId, signal: AbortSignal, supersede?: boolean, contentLocale?: string): Promise<Response>;
|
|
32
38
|
/** Current readiness shares the same request and lifetime as placements. */
|
|
33
|
-
export declare function cachedPreflight(api: string, id: DocId): PreflightResult | undefined;
|
|
39
|
+
export declare function cachedPreflight(api: string, id: DocId, contentLocale?: string): PreflightResult | undefined;
|
|
34
40
|
/** 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;
|
|
41
|
+
export declare function placementsBlocking(api: string, id: DocId, contentLocale?: string): boolean;
|
|
42
|
+
export declare function placementsPending(api: string, id: DocId, contentLocale?: string): boolean;
|
|
37
43
|
/** Pending reads retain the complete settled classification, including terminal outcomes. */
|
|
38
|
-
export declare function cachedReadinessRead(api: string, id: DocId): {
|
|
44
|
+
export declare function cachedReadinessRead(api: string, id: DocId, contentLocale?: string): {
|
|
39
45
|
status: number;
|
|
40
46
|
loadState: "forbidden" | "error" | "missing" | "ready";
|
|
41
47
|
kind: string;
|
|
@@ -45,6 +51,6 @@ export declare function cachedReadinessRead(api: string, id: DocId): {
|
|
|
45
51
|
retry: boolean;
|
|
46
52
|
pollDelay: number | null;
|
|
47
53
|
} | undefined;
|
|
48
|
-
export declare function placementReadError(api: string, id: DocId): string | undefined;
|
|
49
|
-
export declare function watchPlacementNotice(api: string, id: DocId, doc: Document): () => void;
|
|
54
|
+
export declare function placementReadError(api: string, id: DocId, contentLocale?: string): string | undefined;
|
|
55
|
+
export declare function watchPlacementNotice(api: string, id: DocId, doc: Document, contentLocale?: string): () => void;
|
|
50
56
|
export {};
|