ordinarthur f5671008a7
All checks were successful
Build & Deploy to K3s / build-and-deploy (push) Successful in 2m39s
feat(admin): replace default edit view with visual preview editor
Overriding admin.components.views.edit.default makes /admin/collections/
products/:id and /create render the product-detail panel directly —
text fields are contentEditable, the image is click-to-upload, and
price is inline-editable in the checkout-price-line. Fields that don't
fit the public template (slug, name, currency, availability, SEO,
isPublished, sortOrder, stripeID) live in a collapsible "Réglages
avancés" drawer below the panel.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 13:54:50 +02:00

366 lines
7.1 KiB
CSS

/* Scoped replica of the /collection/[slug] product panel, for the Payload admin edit view.
Root class: .rebours-admin-panel */
.rebours-admin-panel {
--clr-bg: #c8c8c8;
--clr-black: #111;
--clr-white: #dcdcdc;
--clr-red: #e8a800;
--font-mono: 'Space Mono', ui-monospace, Menlo, monospace;
--border: 1px solid #111;
--pad: 2rem;
position: relative;
width: 100%;
background: var(--clr-bg);
color: var(--clr-black);
font-family: var(--font-mono);
}
/* Make sure admin crosshair cursor rules don't leak here */
.rebours-admin-panel, .rebours-admin-panel * {
cursor: auto;
}
.rebours-admin-panel__hint {
padding: 0.65rem var(--pad);
font-size: 0.7rem;
letter-spacing: 0.08em;
text-transform: uppercase;
color: #555;
background: #b6b6b6;
border-bottom: var(--border);
}
.rebours-admin-panel__grid {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
min-height: 640px;
}
/* Left: image */
.rebours-admin-panel__img-col {
background: #1a1a1a;
border-right: var(--border);
position: relative;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
min-height: 640px;
}
.rebours-admin-panel__img-slot {
position: relative;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.rebours-admin-panel__img-slot img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
opacity: 0.92;
transition: opacity 0.15s;
}
.rebours-admin-panel__img-slot:hover img {
opacity: 0.7;
}
.rebours-admin-panel__img-placeholder {
color: rgba(255,255,255,0.5);
font-size: 0.78rem;
letter-spacing: 0.1em;
text-align: center;
padding: 2rem;
border: 1px dashed rgba(255,255,255,0.25);
}
.rebours-admin-panel__img-overlay {
position: absolute;
inset: auto 0 0 0;
padding: 0.75rem 1rem;
background: rgba(0,0,0,0.65);
color: #fff;
font-size: 0.7rem;
letter-spacing: 0.08em;
text-transform: uppercase;
opacity: 0;
transition: opacity 0.15s;
text-align: center;
}
.rebours-admin-panel__img-slot:hover .rebours-admin-panel__img-overlay {
opacity: 1;
}
.rebours-admin-panel__img-uploading {
position: absolute;
inset: 0;
background: rgba(0,0,0,0.75);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.8rem;
letter-spacing: 0.1em;
}
/* Right: info */
.rebours-admin-panel__info-col {
padding: 2.5rem var(--pad);
display: flex;
flex-direction: column;
gap: 1.4rem;
background: var(--clr-white);
}
.rebours-admin-panel .panel-index {
font-size: 0.72rem;
color: #555;
letter-spacing: 0.05em;
margin: 0;
}
.rebours-admin-panel h2 {
font-size: clamp(1.8rem, 3vw, 2.8rem);
font-weight: 700;
line-height: 1;
letter-spacing: -0.01em;
margin: 0;
}
.rebours-admin-panel hr {
border: none;
border-top: 1px solid rgba(0,0,0,0.15);
margin: 0;
}
.rebours-admin-panel .panel-meta {
display: flex;
flex-direction: column;
gap: 0;
}
.rebours-admin-panel .panel-meta-row {
display: flex;
gap: 1.5rem;
padding: 0.55rem 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
font-size: 0.8rem;
align-items: baseline;
}
.rebours-admin-panel .meta-key {
color: #555;
width: 7rem;
flex-shrink: 0;
font-size: 0.72rem;
}
.rebours-admin-panel .red {
color: var(--clr-red);
}
.rebours-admin-panel .panel-desc {
font-size: 0.85rem;
line-height: 1.85;
color: #333;
margin: 0;
}
.rebours-admin-panel .accordion {
border-bottom: var(--border);
}
.rebours-admin-panel .accordion summary {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 0;
font-size: 0.78rem;
font-weight: 700;
letter-spacing: 0.04em;
cursor: pointer;
list-style: none;
}
.rebours-admin-panel .accordion summary::-webkit-details-marker {
display: none;
}
.rebours-admin-panel .accordion-body {
font-size: 0.78rem;
line-height: 2;
color: #333;
padding-bottom: 1rem;
white-space: pre-line;
}
/* Checkout-like price block */
.rebours-admin-panel .checkout-price-line {
display: flex;
align-items: baseline;
gap: 1.2rem;
margin-top: 0.5rem;
}
.rebours-admin-panel .checkout-price {
font-size: 1.6rem;
font-weight: 700;
letter-spacing: -0.01em;
}
.rebours-admin-panel .checkout-edition {
font-size: 0.72rem;
color: #555;
}
.rebours-admin-panel .checkout-btn {
display: block;
width: 100%;
background: #e8a800;
color: var(--clr-black);
border: var(--border);
font-family: var(--font-mono);
font-size: 0.82rem;
font-weight: 700;
letter-spacing: 0.04em;
padding: 1.1rem 1.5rem;
text-align: center;
margin-top: 0.8rem;
pointer-events: none;
opacity: 0.9;
}
.rebours-admin-panel .panel-footer {
font-size: 0.75rem;
color: #555;
padding-top: 0.5rem;
}
/* Inline-editable visual feedback */
.rebours-editable {
outline: none;
transition: box-shadow 120ms ease, background 120ms ease;
border-radius: 2px;
padding: 2px 4px;
margin: -2px -4px;
cursor: text;
display: inline-block;
min-width: 2ch;
}
.rebours-editable[data-as='p'],
.rebours-editable[data-as='div'],
.rebours-editable[data-as='h2'] {
display: block;
}
.rebours-editable:hover {
background: rgba(0,0,0,0.04);
box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
}
.rebours-editable:focus {
background: rgba(232, 168, 0, 0.08);
box-shadow: inset 0 0 0 1px #e8a800;
}
.rebours-editable--empty::before {
content: attr(data-placeholder);
opacity: 0.3;
pointer-events: none;
}
.rebours-editable--empty:focus::before {
content: none;
}
/* Settings drawer */
.rebours-admin-settings {
margin-top: 0;
border-top: var(--border);
background: #dcdcdc;
}
.rebours-admin-settings > summary {
padding: 1rem var(--pad);
font-size: 0.78rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
cursor: pointer;
list-style: none;
display: flex;
align-items: center;
justify-content: space-between;
}
.rebours-admin-settings > summary::-webkit-details-marker {
display: none;
}
.rebours-admin-settings > summary::after {
content: '▾';
font-size: 0.7rem;
}
.rebours-admin-settings[open] > summary::after {
content: '▴';
}
.rebours-admin-settings__grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1rem 1.5rem;
padding: 1rem var(--pad) 1.5rem;
border-top: 1px solid rgba(0,0,0,0.1);
}
.rebours-admin-settings__field {
display: flex;
flex-direction: column;
gap: 0.3rem;
font-size: 0.78rem;
}
.rebours-admin-settings__field label {
font-size: 0.68rem;
letter-spacing: 0.08em;
text-transform: uppercase;
color: #555;
}
.rebours-admin-settings__field input,
.rebours-admin-settings__field select,
.rebours-admin-settings__field textarea {
font-family: var(--font-mono);
font-size: 0.8rem;
padding: 0.5rem 0.65rem;
background: #fff;
border: 1px solid rgba(0,0,0,0.25);
color: var(--clr-black);
}
.rebours-admin-settings__field input:focus,
.rebours-admin-settings__field select:focus,
.rebours-admin-settings__field textarea:focus {
outline: none;
border-color: #e8a800;
}
.rebours-admin-settings__checkbox {
display: flex;
align-items: center;
gap: 0.5rem;
padding-top: 1.2rem;
font-size: 0.8rem;
}