Files
Momento/memento-note/extension/dist-chrome-store/sidepanel.css
Antigravity bff060ad20
All checks were successful
CI / Lint, Unit Tests & Build (push) Successful in 7m24s
CI / Deploy production (on server) (push) Successful in 23s
feat(extension): rendu Markdown dans la prévisualisation + zone agrandie v0.4.3
Avant : renderConfirm() échappait le résumé et l'extrait avec escapeHtml(),
donc les **gras**, *italique*, [liens](), listes, titres du Markdown
produit par l'IA s'affichaient en texte brut (littéral « **gras** »).

Maintenant : renderMarkdownSafe() parse le Markdown en HTML limité
et sûr (escapeHtml d'abord, puis regex sur le texte échappé — pas de
HTML brut autorisé).

+ Refonte du panneau de prévisualisation :
  - .preview-block avec header sticky (label Résumé / Extrait)
  - .excerpt-block : min-height 180px, max-height 360px, scroll si long
  - .summary-block : fond bleuté léger, bordure gauche sky
  - markdown-h3/h4/h5 stylés (serif pour titres), strong/em/code/ul/a
  - Polices 14px, line-height 1.7, word-break pour texte long

+ Nouvelle clé i18n summaryLabel dans les 15 locales.
+ Version 0.4.2 → 0.4.3.
2026-07-18 10:35:00 +00:00

649 lines
16 KiB
CSS

:root {
--ink: #1c1c1c;
--paper: #faf9f5;
--card: #ffffff;
--muted: #6b7280;
--border: #e8e4dc;
--accent: #a47148;
--accent-soft: rgba(164, 113, 72, 0.12);
--accent-glow: rgba(164, 113, 72, 0.35);
--success: #10b981;
--danger: #ef4444;
--shadow: 0 18px 40px rgba(28, 28, 28, 0.08);
--radius: 14px;
--radius-sm: 10px;
}
* { box-sizing: border-box; }
html, body {
margin: 0;
min-height: 100%;
font-family: 'Inter', system-ui, -apple-system, sans-serif;
font-size: 13px;
color: var(--ink);
background: var(--paper);
overflow-wrap: break-word;
word-break: break-word;
}
.shell {
min-height: 100vh;
display: flex;
flex-direction: column;
background: var(--paper);
}
/* Responsive : le side panel peut faire 280px (Chrome défaut) ou 480px+ (Firefox).
On adapte les paddings/margins en fonction de la largeur disponible. */
@media (max-width: 380px) {
html, body { font-size: 12px; }
.header { padding: 12px 14px; }
.main { padding: 12px 14px 16px; gap: 12px; }
.footer { padding: 8px 14px 12px; }
.field span, .label, .sub { letter-spacing: 0.1em; }
}
@media (min-width: 420px) {
.main { padding: 20px 22px; gap: 18px; }
.header { padding: 18px 22px; }
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 18px;
background: linear-gradient(180deg, #fff 0%, #fcfcfa 100%);
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
width: 34px; height: 34px; border-radius: 11px;
background: var(--ink); color: #faf9f5;
display: flex; align-items: center; justify-content: center;
font-family: Georgia, 'Times New Roman', serif;
font-weight: 900; font-size: 16px;
box-shadow: 0 4px 14px rgba(28, 28, 28, 0.18);
}
.brand-text { line-height: 1.1; }
.brand-name {
display: block; font-size: 14px; font-weight: 700;
font-family: Georgia, 'Times New Roman', serif;
}
.brand-sub {
display: block; font-size: 9px; letter-spacing: 0.16em;
text-transform: uppercase; color: var(--accent); font-weight: 700;
}
.icon-btn {
width: 34px; height: 34px; border-radius: 10px;
border: 1px solid var(--border); background: #fff;
color: var(--muted); cursor: pointer;
display: flex; align-items: center; justify-content: center;
transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.icon-btn:hover {
border-color: var(--accent);
color: var(--accent);
background: var(--accent-soft);
}
.header-right {
display: flex;
align-items: center;
gap: 10px;
}
.conn-badge {
display: flex;
align-items: center;
gap: 6px;
font-size: 9px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--muted);
}
.conn-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #10b981;
}
.settings-panel {
padding: 14px 18px;
background: #fff;
border-bottom: 1px solid var(--border);
}
.settings-panel[hidden] { display: none !important; }
.settings-hint {
margin: 8px 0 0;
font-size: 11px;
color: var(--muted);
line-height: 1.5;
}
.settings-hint code {
font-size: 10px;
background: var(--paper);
padding: 1px 4px;
border-radius: 4px;
}
.settings-status {
margin: 10px 0 0;
font-size: 11px;
line-height: 1.45;
}
.settings-status.is-ok { color: #059669; }
.settings-status.is-error { color: #dc2626; }
.preset-row {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 10px;
}
.preset-btn {
border: 1px solid var(--border);
background: var(--paper);
border-radius: 999px;
padding: 6px 10px;
font-size: 10px;
font-weight: 700;
cursor: pointer;
color: var(--muted);
}
.preset-btn:hover {
border-color: var(--accent);
color: var(--accent);
background: var(--accent-soft);
}
.settings-actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field span {
font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em;
color: var(--muted); font-weight: 700;
}
input[type="url"],
input[type="text"],
.notebook-select {
width: 100%; padding: 10px 12px; border: 1px solid var(--border);
border-radius: var(--radius-sm); background: var(--paper);
font-family: inherit; font-size: 12px;
}
input[type="url"]:focus,
input[type="text"]:focus,
.notebook-select:focus {
outline: none; border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-soft);
}
.notebook-select {
background: #fff;
font-weight: 600;
cursor: pointer;
}
.main {
flex: 1;
padding: 16px 18px 20px;
display: flex;
flex-direction: column;
gap: 14px;
min-height: 0;
}
.main > .actions {
margin-top: auto;
}
.footer {
padding: 10px 18px 14px;
border-top: 1px solid var(--border);
background: #fff;
text-align: center;
}
.footer-meta { font-size: 9px; color: #9ca3af; letter-spacing: 0.06em; }
.label {
font-size: 9px; text-transform: uppercase; letter-spacing: 0.14em;
color: var(--muted); font-weight: 700; margin-bottom: 8px; display: block;
}
.auth-hint {
padding: 12px 14px;
border-radius: var(--radius);
background: #fffbeb;
border: 1px solid #fde68a;
font-size: 11px;
color: #92400e;
line-height: 1.5;
}
.page-card {
padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
background: #fff;
box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
min-width: 0;
}
.page-card .sub {
font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
color: var(--muted); font-weight: 700; display: block; margin-bottom: 8px;
}
.page-row { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.page-row img {
width: 22px; height: 22px; border-radius: 5px;
flex-shrink: 0; margin-top: 2px;
}
.page-text { min-width: 0; flex: 1; }
.page-row .title {
font-size: 13px; font-weight: 700; line-height: 1.45;
display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
unicode-bidi: plaintext;
word-break: break-word;
overflow-wrap: anywhere;
}
.page-row .url {
font-size: 10px; color: var(--muted); margin-top: 4px;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
direction: ltr; text-align: left;
max-width: 100%;
}
.text-rtl {
direction: rtl;
text-align: right;
font-family: 'Vazirmatn', 'Inter', sans-serif;
unicode-bidi: plaintext;
}
.selection-panel {
border-radius: var(--radius);
border: 1px solid var(--border);
background: #fff;
overflow: hidden;
min-height: 140px;
display: flex;
flex-direction: column;
flex: 1 1 auto;
}
.selection-panel.has-text {
border-color: #bae6fd;
background: rgba(14, 165, 233, 0.05);
box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.12);
}
.selection-hint {
padding: 18px;
border: 1px dashed var(--border);
border-radius: var(--radius);
text-align: center;
background: #fff;
min-height: 120px;
display: flex;
align-items: center;
justify-content: center;
}
.selection-hint p {
margin: 0;
font-size: 12px;
color: var(--muted);
line-height: 1.6;
}
.selection-head {
display: flex; align-items: center; justify-content: space-between;
gap: 8px;
padding: 14px 16px;
background: linear-gradient(180deg, #fff 0%, #fdfcfa 100%);
border-bottom: 1px solid var(--border);
flex-wrap: wrap;
}
.selection-head .status {
display: flex; align-items: center; gap: 8px;
font-size: 10px; font-weight: 800; text-transform: uppercase;
letter-spacing: 0.08em; color: var(--muted);
}
.selection-head .status.live { color: #0284c7; }
.selection-head .count {
font-size: 10px; font-weight: 700; color: var(--muted);
background: var(--paper); padding: 4px 8px; border-radius: 999px;
}
.selection-head .count.active { color: var(--accent); background: var(--accent-soft); }
.selection-body {
flex: 1 1 auto;
padding: 14px 16px;
font-size: 13px;
line-height: 1.65;
color: rgba(28, 28, 28, 0.88);
min-height: 80px;
max-height: none;
overflow-y: auto;
unicode-bidi: plaintext;
border-inline-start: 3px solid transparent;
word-break: break-word;
overflow-wrap: anywhere;
}
.selection-panel.has-text .selection-body {
border-inline-start-color: #38bdf8;
padding-inline-start: 18px;
font-style: italic;
font-size: 13px;
min-height: 100px;
}
.pulse-dot {
width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
animation: pulse 1.4s ease infinite;
}
.pulse-dot.sky { background: #0ea5e9; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.85)} }
.clear-btn {
border: none; background: none; font-size: 10px;
color: var(--muted); cursor: pointer; font-weight: 600;
padding: 4px 6px; border-radius: 6px;
}
.clear-btn:hover { color: var(--ink); background: var(--paper); }
.actions {
display: flex; flex-direction: column; gap: 12px;
margin-top: auto; padding-top: 8px;
}
.btn {
padding: 16px 18px; border-radius: var(--radius); border: none; cursor: pointer;
font-weight: 700; font-size: 12px; text-transform: uppercase;
letter-spacing: 0.1em;
display: flex; align-items: center; justify-content: center; gap: 10px;
min-height: 48px;
transition: transform 0.12s ease, opacity 0.12s ease, filter 0.12s ease;
word-break: break-word;
text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn:disabled {
opacity: 0.42; cursor: not-allowed; transform: none;
box-shadow: none !important;
}
.btn-primary {
background: var(--ink); color: #fff;
box-shadow: 0 10px 24px rgba(28, 28, 28, 0.18);
}
.btn-primary:hover:not(:disabled) { opacity: 0.94; }
.btn-sky {
background: #0284c7;
color: #fff;
box-shadow: 0 10px 22px rgba(2, 132, 199, 0.22);
}
.btn-sky:hover:not(:disabled) { background: #0369a1; }
.btn-secondary {
background: #f3f4f6;
color: #374151;
box-shadow: none;
}
.btn-secondary:hover:not(:disabled) { background: #e5e7eb; }
.btn-sm {
padding: 12px 14px;
font-size: 11px;
min-height: 40px;
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-link.link-only {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
}
.btn-link {
background: none; border: none; color: var(--muted); font-size: 12px;
cursor: pointer; padding: 10px; font-weight: 500;
}
.btn-link:hover { color: var(--ink); text-decoration: underline; }
.btn-icon { width: 14px; height: 14px; display: inline-flex; }
.center-state {
flex: 1; display: flex; flex-direction: column; align-items: center;
justify-content: center; text-align: center; gap: 14px; padding: 32px 12px;
min-height: 280px;
}
.spinner-wrap { position: relative; width: 52px; height: 52px; }
.spinner-ring {
position: absolute; inset: 0; border-radius: 50%;
border: 1px solid var(--border); animation: ping 1.2s ease infinite;
}
@keyframes ping { 0%{transform:scale(1);opacity:.6} 100%{transform:scale(1.35);opacity:0} }
.spinner {
position: absolute; inset: 6px;
border: 3px solid var(--border); border-top-color: var(--accent);
border-radius: 50%; animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state-title {
font-size: 10px; font-weight: 800; text-transform: uppercase;
letter-spacing: 0.14em; color: var(--muted);
}
.state-sub { font-size: 15px; font-weight: 700; color: var(--ink); }
.state-detail {
font-size: 11px; color: var(--muted); max-width: 280px;
line-height: 1.55; margin: 0 auto;
}
.success-icon, .error-icon {
width: 58px; height: 58px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 26px; font-weight: 700;
}
.success-icon {
background: rgba(16, 185, 129, 0.1);
border: 1px solid rgba(16, 185, 129, 0.25); color: var(--success);
}
.error-icon { background: #fef2f2; color: var(--danger); }
.badge-ok {
display: inline-block; margin-bottom: 8px;
font-size: 9px; background: rgba(16, 185, 129, 0.12);
color: #059669; font-weight: 800; padding: 3px 8px; border-radius: 6px;
text-transform: uppercase; letter-spacing: 0.1em;
}
.note-title {
font-size: 15px; font-weight: 700;
font-family: Georgia, 'Times New Roman', serif;
line-height: 1.35; margin-top: 6px;
unicode-bidi: plaintext;
}
.tags {
display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
padding-top: 14px; border-top: 1px solid var(--border); margin-top: 10px;
width: 100%;
}
.tag-chip {
font-size: 9px; font-weight: 800; text-transform: uppercase;
letter-spacing: 0.06em; color: var(--accent);
background: var(--accent-soft); border: 1px solid rgba(164, 113, 72, 0.2);
padding: 5px 10px; border-radius: 999px;
}
.restricted-note {
padding: 14px; border-radius: var(--radius);
background: #fef2f2; border: 1px solid #fecaca;
font-size: 11px; color: #991b1b; line-height: 1.5;
}
.confirm-panel {
display: flex;
flex-direction: column;
gap: 14px;
}
.preview-block {
border: 1px solid var(--border);
border-radius: var(--radius);
background: #fff;
overflow: hidden;
}
.preview-block-head {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 14px;
background: linear-gradient(180deg, #fdfcfa 0%, #faf9f5 100%);
border-bottom: 1px solid var(--border);
font-size: 10px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--muted);
}
.preview-block-head .dot {
width: 7px; height: 7px; border-radius: 50%;
background: var(--accent);
}
.preview-block-head .dot-summary { background: #0284c7; }
.preview-block-head .dot-excerpt { background: #a47148; }
.preview-block-body {
padding: 14px 16px;
font-size: 14px;
line-height: 1.7;
color: rgba(28, 28, 28, 0.92);
word-break: break-word;
overflow-wrap: anywhere;
}
.excerpt-block .preview-block-body {
min-height: 180px;
max-height: 360px;
overflow-y: auto;
background: #fcfbf9;
}
.summary-block .preview-block-body {
font-style: normal;
color: rgba(28, 28, 28, 0.78);
background: rgba(2, 132, 199, 0.04);
border-left: 3px solid #0ea5e9;
padding-inline-start: 18px;
}
/* Markdown rendu dans le side panel */
.md { font-size: 14px; line-height: 1.7; }
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md-h3 {
font-size: 16px; font-weight: 700;
margin: 14px 0 8px; color: var(--ink);
font-family: Georgia, 'Times New Roman', serif;
}
.md-h4 {
font-size: 14px; font-weight: 700;
margin: 12px 0 6px; color: var(--ink);
font-family: Georgia, 'Times New Roman', serif;
}
.md-h5 {
font-size: 13px; font-weight: 700;
margin: 10px 0 4px; color: var(--muted);
}
.md strong { font-weight: 700; color: var(--ink); }
.md em { font-style: italic; }
.md a {
color: #0284c7;
text-decoration: underline;
text-decoration-thickness: 1px;
text-underline-offset: 2px;
}
.md a:hover { color: #0369a1; }
.md-code {
background: rgba(28, 28, 28, 0.06);
padding: 1px 5px;
border-radius: 4px;
font-family: ui-monospace, 'SF Mono', Menlo, monospace;
font-size: 12.5px;
color: var(--ink);
}
.md-ul {
margin: 8px 0;
padding-inline-start: 20px;
}
.md-ul li { margin: 3px 0; }
.summary-preview {
margin: 0;
font-size: 12px;
color: var(--muted);
line-height: 1.55;
font-style: italic;
}
.excerpt-preview {
padding: 12px 14px;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
background: #fff;
font-size: 12px;
line-height: 1.65;
max-height: 150px;
overflow-y: auto;
unicode-bidi: plaintext;
}
.excerpt-label {
display: block;
font-size: 9px;
text-transform: uppercase;
letter-spacing: 0.12em;
color: var(--muted);
font-weight: 700;
margin-bottom: 8px;
}
.meta-row { margin-top: -4px; }
.reading-time {
font-size: 10px;
font-weight: 700;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.preview-tags { justify-content: flex-start; border-top: none; margin-top: 0; padding-top: 0; }
html[dir="rtl"] .header,
html[dir="rtl"] .header-right,
html[dir="rtl"] .selection-head,
html[dir="rtl"] .page-row {
flex-direction: row-reverse;
}
html[dir="rtl"] .page-row .url {
direction: ltr;
text-align: left;
}
html[dir="rtl"] .notebook-select,
html[dir="rtl"] .dropdown-item,
html[dir="rtl"] .label,
html[dir="rtl"] .sub {
text-align: right;
}
/* Firefox sidebar : plus large que Chrome Side Panel par défaut,
on aère la mise en page. */
@-moz-document url-prefix("chrome:") {
.shell { min-height: 100vh; }
}
/* Fallback : on cible aussi le web-extension panel de Firefox */
@media (min-width: 480px) {
.selection-panel { min-height: 160px; }
.selection-body { font-size: 14px; }
.page-row .title { font-size: 14px; }
}
/* Très petits écrans (mobile debug, fenetres étirées) */
@media (max-width: 320px) {
.brand-text { display: none; }
.header-right { gap: 4px; }
.icon-btn { width: 28px; height: 28px; }
.btn { padding: 14px 12px; font-size: 11px; }
}