starlight-annotations 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +73 -2
- package/index.d.ts +74 -0
- package/index.js +111 -0
- package/package.json +71 -4
- package/server-node.d.ts +10 -0
- package/server.d.ts +77 -0
- package/src/client/annotations.js +731 -0
- package/src/client/backend.js +67 -0
- package/src/client/i18n.js +237 -0
- package/src/client/styles.css +387 -0
- package/src/core.js +161 -0
- package/src/server/github.js +284 -0
- package/src/server/index.js +89 -0
- package/src/server/node.js +86 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Where the browser reads and writes notes.
|
|
2
|
+
//
|
|
3
|
+
// "api": the annotation handler on the same origin (GitHub, disk, or
|
|
4
|
+
// your own storage). Hidden when the API does not answer.
|
|
5
|
+
// "browser": localStorage. No server, no sign-in; notes stay on this device.
|
|
6
|
+
// Good for personal study notes, and for demos.
|
|
7
|
+
|
|
8
|
+
import { applyChange, parseDocument } from '../core.js';
|
|
9
|
+
|
|
10
|
+
export function createBackend(config, base, T) {
|
|
11
|
+
return config.backend === 'browser' ? browserBackend(config, T) : apiBackend(config, base);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function apiBackend(config, base) {
|
|
15
|
+
const api = config.apiBase.startsWith('/') ? `${base}${config.apiBase}` : config.apiBase;
|
|
16
|
+
const here = () => encodeURIComponent(location.pathname + location.search);
|
|
17
|
+
return {
|
|
18
|
+
async load(page) {
|
|
19
|
+
try {
|
|
20
|
+
const response = await fetch(`${api}/api?page=${encodeURIComponent(page)}`, { credentials: 'same-origin' });
|
|
21
|
+
return response.ok ? await response.json() : null; // No API here: stay invisible.
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
async send(page, change) {
|
|
27
|
+
const response = await fetch(`${api}/api`, {
|
|
28
|
+
method: 'POST',
|
|
29
|
+
credentials: 'same-origin',
|
|
30
|
+
headers: { 'Content-Type': 'application/json' },
|
|
31
|
+
body: JSON.stringify({ page, change }),
|
|
32
|
+
});
|
|
33
|
+
const data = await response.json().catch(() => ({}));
|
|
34
|
+
if (!response.ok) return { ok: false, status: response.status, error: data.error || `Error ${response.status}` };
|
|
35
|
+
return { ok: true, ...data };
|
|
36
|
+
},
|
|
37
|
+
loginUrl: () => `${api}/login?return=${here()}`,
|
|
38
|
+
logoutUrl: () => `${api}/logout?return=${here()}`,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function browserBackend(config, T) {
|
|
43
|
+
const key = (page) => `${config.storageKey}:${page}`;
|
|
44
|
+
const user = { login: 'me', name: T.you };
|
|
45
|
+
const read = (page) => {
|
|
46
|
+
try {
|
|
47
|
+
return parseDocument(localStorage.getItem(key(page)) || '', page);
|
|
48
|
+
} catch {
|
|
49
|
+
return parseDocument('', page);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
async load(page) {
|
|
54
|
+
return { annotations: read(page).annotations, user, mode: 'browser' };
|
|
55
|
+
},
|
|
56
|
+
async send(page, change) {
|
|
57
|
+
try {
|
|
58
|
+
const doc = read(page);
|
|
59
|
+
const { annotation } = applyChange(doc, change, user);
|
|
60
|
+
localStorage.setItem(key(page), JSON.stringify(doc));
|
|
61
|
+
return { ok: true, annotation, annotations: doc.annotations };
|
|
62
|
+
} catch (error) {
|
|
63
|
+
return { ok: false, status: error.status ?? 500, error: error.message };
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// UI strings. The page language picks the table (by its first subtag);
|
|
2
|
+
// `translations` in the plugin options overrides any string, per language.
|
|
3
|
+
|
|
4
|
+
const en = {
|
|
5
|
+
annotate: 'Annotate',
|
|
6
|
+
notes: 'Notes',
|
|
7
|
+
newNote: 'New note',
|
|
8
|
+
placeholder: 'Write a note…',
|
|
9
|
+
replyPlaceholder: 'Reply…',
|
|
10
|
+
save: 'Save',
|
|
11
|
+
cancel: 'Cancel',
|
|
12
|
+
reply: 'Reply',
|
|
13
|
+
resolve: 'Resolve',
|
|
14
|
+
reopen: 'Reopen',
|
|
15
|
+
delete: 'Delete',
|
|
16
|
+
confirmDelete: 'Delete this note and its replies?',
|
|
17
|
+
confirmDeleteReply: 'Delete this reply?',
|
|
18
|
+
inReplyTo: 'in reply to',
|
|
19
|
+
replyingTo: 'Replying to',
|
|
20
|
+
deletedMessage: 'in reply to a deleted message',
|
|
21
|
+
close: 'Close',
|
|
22
|
+
showResolved: 'Show resolved',
|
|
23
|
+
empty: 'No notes on this page yet. Select some text to add one.',
|
|
24
|
+
orphans: 'Text no longer found on the page',
|
|
25
|
+
login: 'Sign in with GitHub to annotate',
|
|
26
|
+
logout: 'Sign out',
|
|
27
|
+
local: 'local',
|
|
28
|
+
browserOnly: 'Notes are saved in this browser only.',
|
|
29
|
+
you: 'You',
|
|
30
|
+
resolved: 'Resolved',
|
|
31
|
+
write: 'Write',
|
|
32
|
+
preview: 'Preview',
|
|
33
|
+
nothing: 'Nothing to preview.',
|
|
34
|
+
markdown: 'Markdown is supported',
|
|
35
|
+
formatting: 'Formatting',
|
|
36
|
+
bold: 'Bold',
|
|
37
|
+
italic: 'Italic',
|
|
38
|
+
strike: 'Strikethrough',
|
|
39
|
+
code: 'Code',
|
|
40
|
+
link: 'Link',
|
|
41
|
+
quote: 'Quote',
|
|
42
|
+
bullets: 'Bulleted list',
|
|
43
|
+
numbers: 'Numbered list',
|
|
44
|
+
tasks: 'Task list',
|
|
45
|
+
codeBlock: 'Code block',
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const it = {
|
|
49
|
+
annotate: 'Annota',
|
|
50
|
+
notes: 'Note',
|
|
51
|
+
newNote: 'Nuova nota',
|
|
52
|
+
placeholder: 'Scrivi una nota…',
|
|
53
|
+
replyPlaceholder: 'Rispondi…',
|
|
54
|
+
save: 'Salva',
|
|
55
|
+
cancel: 'Annulla',
|
|
56
|
+
reply: 'Rispondi',
|
|
57
|
+
resolve: 'Risolvi',
|
|
58
|
+
reopen: 'Riapri',
|
|
59
|
+
delete: 'Elimina',
|
|
60
|
+
confirmDelete: 'Eliminare la nota e le sue risposte?',
|
|
61
|
+
confirmDeleteReply: 'Eliminare questa risposta?',
|
|
62
|
+
inReplyTo: 'in risposta a',
|
|
63
|
+
replyingTo: 'Rispondi a',
|
|
64
|
+
deletedMessage: 'in risposta a un messaggio eliminato',
|
|
65
|
+
close: 'Chiudi',
|
|
66
|
+
showResolved: 'Mostra risolte',
|
|
67
|
+
empty: 'Nessuna nota su questa pagina. Seleziona del testo per aggiungerne una.',
|
|
68
|
+
orphans: 'Testo non più trovato nella pagina',
|
|
69
|
+
login: 'Accedi con GitHub per annotare',
|
|
70
|
+
logout: 'Esci',
|
|
71
|
+
local: 'locale',
|
|
72
|
+
browserOnly: 'Le note sono salvate solo in questo browser.',
|
|
73
|
+
you: 'Tu',
|
|
74
|
+
resolved: 'Risolta',
|
|
75
|
+
write: 'Scrivi',
|
|
76
|
+
preview: 'Anteprima',
|
|
77
|
+
nothing: 'Niente da mostrare.',
|
|
78
|
+
markdown: 'Supporta Markdown',
|
|
79
|
+
formatting: 'Formattazione',
|
|
80
|
+
bold: 'Grassetto',
|
|
81
|
+
italic: 'Corsivo',
|
|
82
|
+
strike: 'Barrato',
|
|
83
|
+
code: 'Codice',
|
|
84
|
+
link: 'Link',
|
|
85
|
+
quote: 'Citazione',
|
|
86
|
+
bullets: 'Elenco puntato',
|
|
87
|
+
numbers: 'Elenco numerato',
|
|
88
|
+
tasks: 'Lista di attività',
|
|
89
|
+
codeBlock: 'Blocco di codice',
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const de = {
|
|
93
|
+
annotate: 'Notiz',
|
|
94
|
+
notes: 'Notizen',
|
|
95
|
+
newNote: 'Neue Notiz',
|
|
96
|
+
placeholder: 'Notiz schreiben…',
|
|
97
|
+
replyPlaceholder: 'Antworten…',
|
|
98
|
+
save: 'Speichern',
|
|
99
|
+
cancel: 'Abbrechen',
|
|
100
|
+
reply: 'Antworten',
|
|
101
|
+
resolve: 'Erledigt',
|
|
102
|
+
reopen: 'Wieder öffnen',
|
|
103
|
+
delete: 'Löschen',
|
|
104
|
+
confirmDelete: 'Diese Notiz und ihre Antworten löschen?',
|
|
105
|
+
confirmDeleteReply: 'Diese Antwort löschen?',
|
|
106
|
+
inReplyTo: 'Antwort an',
|
|
107
|
+
replyingTo: 'Antwort an',
|
|
108
|
+
deletedMessage: 'Antwort auf eine gelöschte Nachricht',
|
|
109
|
+
close: 'Schließen',
|
|
110
|
+
showResolved: 'Erledigte zeigen',
|
|
111
|
+
empty: 'Noch keine Notizen auf dieser Seite. Markiere Text, um eine hinzuzufügen.',
|
|
112
|
+
orphans: 'Text nicht mehr auf der Seite gefunden',
|
|
113
|
+
login: 'Mit GitHub anmelden, um Notizen zu schreiben',
|
|
114
|
+
logout: 'Abmelden',
|
|
115
|
+
local: 'lokal',
|
|
116
|
+
browserOnly: 'Notizen werden nur in diesem Browser gespeichert.',
|
|
117
|
+
you: 'Du',
|
|
118
|
+
resolved: 'Erledigt',
|
|
119
|
+
write: 'Schreiben',
|
|
120
|
+
preview: 'Vorschau',
|
|
121
|
+
nothing: 'Nichts anzuzeigen.',
|
|
122
|
+
markdown: 'Markdown wird unterstützt',
|
|
123
|
+
formatting: 'Formatierung',
|
|
124
|
+
bold: 'Fett',
|
|
125
|
+
italic: 'Kursiv',
|
|
126
|
+
strike: 'Durchgestrichen',
|
|
127
|
+
code: 'Code',
|
|
128
|
+
link: 'Link',
|
|
129
|
+
quote: 'Zitat',
|
|
130
|
+
bullets: 'Aufzählung',
|
|
131
|
+
numbers: 'Nummerierte Liste',
|
|
132
|
+
tasks: 'Aufgabenliste',
|
|
133
|
+
codeBlock: 'Codeblock',
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const fr = {
|
|
137
|
+
annotate: 'Annoter',
|
|
138
|
+
notes: 'Notes',
|
|
139
|
+
newNote: 'Nouvelle note',
|
|
140
|
+
placeholder: 'Écrire une note…',
|
|
141
|
+
replyPlaceholder: 'Répondre…',
|
|
142
|
+
save: 'Enregistrer',
|
|
143
|
+
cancel: 'Annuler',
|
|
144
|
+
reply: 'Répondre',
|
|
145
|
+
resolve: 'Résoudre',
|
|
146
|
+
reopen: 'Rouvrir',
|
|
147
|
+
delete: 'Supprimer',
|
|
148
|
+
confirmDelete: 'Supprimer cette note et ses réponses ?',
|
|
149
|
+
confirmDeleteReply: 'Supprimer cette réponse ?',
|
|
150
|
+
inReplyTo: 'en réponse à',
|
|
151
|
+
replyingTo: 'Réponse à',
|
|
152
|
+
deletedMessage: 'en réponse à un message supprimé',
|
|
153
|
+
close: 'Fermer',
|
|
154
|
+
showResolved: 'Afficher les résolues',
|
|
155
|
+
empty: 'Aucune note sur cette page. Sélectionnez du texte pour en ajouter une.',
|
|
156
|
+
orphans: 'Texte introuvable sur la page',
|
|
157
|
+
login: 'Se connecter avec GitHub pour annoter',
|
|
158
|
+
logout: 'Se déconnecter',
|
|
159
|
+
local: 'local',
|
|
160
|
+
browserOnly: 'Les notes sont enregistrées dans ce navigateur uniquement.',
|
|
161
|
+
you: 'Vous',
|
|
162
|
+
resolved: 'Résolue',
|
|
163
|
+
write: 'Écrire',
|
|
164
|
+
preview: 'Aperçu',
|
|
165
|
+
nothing: 'Rien à afficher.',
|
|
166
|
+
markdown: 'Markdown est pris en charge',
|
|
167
|
+
formatting: 'Mise en forme',
|
|
168
|
+
bold: 'Gras',
|
|
169
|
+
italic: 'Italique',
|
|
170
|
+
strike: 'Barré',
|
|
171
|
+
code: 'Code',
|
|
172
|
+
link: 'Lien',
|
|
173
|
+
quote: 'Citation',
|
|
174
|
+
bullets: 'Liste à puces',
|
|
175
|
+
numbers: 'Liste numérotée',
|
|
176
|
+
tasks: 'Liste de tâches',
|
|
177
|
+
codeBlock: 'Bloc de code',
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const es = {
|
|
181
|
+
annotate: 'Anotar',
|
|
182
|
+
notes: 'Notas',
|
|
183
|
+
newNote: 'Nueva nota',
|
|
184
|
+
placeholder: 'Escribe una nota…',
|
|
185
|
+
replyPlaceholder: 'Responder…',
|
|
186
|
+
save: 'Guardar',
|
|
187
|
+
cancel: 'Cancelar',
|
|
188
|
+
reply: 'Responder',
|
|
189
|
+
resolve: 'Resolver',
|
|
190
|
+
reopen: 'Reabrir',
|
|
191
|
+
delete: 'Eliminar',
|
|
192
|
+
confirmDelete: '¿Eliminar esta nota y sus respuestas?',
|
|
193
|
+
confirmDeleteReply: '¿Eliminar esta respuesta?',
|
|
194
|
+
inReplyTo: 'en respuesta a',
|
|
195
|
+
replyingTo: 'Respondiendo a',
|
|
196
|
+
deletedMessage: 'en respuesta a un mensaje eliminado',
|
|
197
|
+
close: 'Cerrar',
|
|
198
|
+
showResolved: 'Mostrar resueltas',
|
|
199
|
+
empty: 'Aún no hay notas en esta página. Selecciona texto para añadir una.',
|
|
200
|
+
orphans: 'Texto ya no encontrado en la página',
|
|
201
|
+
login: 'Inicia sesión con GitHub para anotar',
|
|
202
|
+
logout: 'Cerrar sesión',
|
|
203
|
+
local: 'local',
|
|
204
|
+
browserOnly: 'Las notas se guardan solo en este navegador.',
|
|
205
|
+
you: 'Tú',
|
|
206
|
+
resolved: 'Resuelta',
|
|
207
|
+
write: 'Escribir',
|
|
208
|
+
preview: 'Vista previa',
|
|
209
|
+
nothing: 'Nada que mostrar.',
|
|
210
|
+
markdown: 'Se admite Markdown',
|
|
211
|
+
formatting: 'Formato',
|
|
212
|
+
bold: 'Negrita',
|
|
213
|
+
italic: 'Cursiva',
|
|
214
|
+
strike: 'Tachado',
|
|
215
|
+
code: 'Código',
|
|
216
|
+
link: 'Enlace',
|
|
217
|
+
quote: 'Cita',
|
|
218
|
+
bullets: 'Lista con viñetas',
|
|
219
|
+
numbers: 'Lista numerada',
|
|
220
|
+
tasks: 'Lista de tareas',
|
|
221
|
+
codeBlock: 'Bloque de código',
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export const builtIn = { en, it, de, fr, es };
|
|
225
|
+
|
|
226
|
+
export function strings(lang = 'en', overrides = {}) {
|
|
227
|
+
const tag = String(lang || 'en').toLowerCase();
|
|
228
|
+
const base = tag.split('-')[0];
|
|
229
|
+
// English is the fallback for any string a language does not define.
|
|
230
|
+
return {
|
|
231
|
+
...en,
|
|
232
|
+
...(overrides.en ?? {}),
|
|
233
|
+
...(builtIn[base] ?? {}),
|
|
234
|
+
...(overrides[base] ?? {}),
|
|
235
|
+
...(overrides[tag] ?? {}),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
/* starlight-annotations: uses Starlight colour and spacing tokens, so it follows the theme. */
|
|
2
|
+
::highlight(annot) {
|
|
3
|
+
background-color: rgb(255 214 10 / 0.38);
|
|
4
|
+
}
|
|
5
|
+
::highlight(annot-active) {
|
|
6
|
+
background-color: rgb(255 170 0 / 0.6);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.annot-ui {
|
|
10
|
+
font-size: var(--sl-text-sm);
|
|
11
|
+
}
|
|
12
|
+
.annot-ui button {
|
|
13
|
+
font: inherit;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
.annot-select-button {
|
|
17
|
+
position: absolute;
|
|
18
|
+
z-index: 30;
|
|
19
|
+
padding: 0.3rem 0.7rem;
|
|
20
|
+
border: 0;
|
|
21
|
+
border-radius: 999px;
|
|
22
|
+
background: var(--sl-color-accent);
|
|
23
|
+
color: var(--sl-color-black);
|
|
24
|
+
box-shadow: var(--sl-shadow-md);
|
|
25
|
+
}
|
|
26
|
+
.annot-toggle {
|
|
27
|
+
position: fixed;
|
|
28
|
+
right: 1rem;
|
|
29
|
+
bottom: 1rem;
|
|
30
|
+
z-index: 30;
|
|
31
|
+
display: flex;
|
|
32
|
+
gap: 0.4rem;
|
|
33
|
+
align-items: center;
|
|
34
|
+
padding: 0.45rem 0.85rem;
|
|
35
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
36
|
+
border-radius: 999px;
|
|
37
|
+
background: var(--sl-color-bg-nav);
|
|
38
|
+
color: var(--sl-color-white);
|
|
39
|
+
box-shadow: var(--sl-shadow-md);
|
|
40
|
+
}
|
|
41
|
+
.annot-count {
|
|
42
|
+
min-width: 1.4em;
|
|
43
|
+
padding: 0 0.35em;
|
|
44
|
+
border-radius: 999px;
|
|
45
|
+
background: var(--sl-color-accent);
|
|
46
|
+
color: var(--sl-color-black);
|
|
47
|
+
text-align: center;
|
|
48
|
+
}
|
|
49
|
+
.annot-drawer {
|
|
50
|
+
position: fixed;
|
|
51
|
+
top: var(--sl-nav-height);
|
|
52
|
+
right: 0;
|
|
53
|
+
bottom: 0;
|
|
54
|
+
z-index: 40;
|
|
55
|
+
width: min(24rem, 100vw);
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
background: var(--sl-color-bg);
|
|
59
|
+
border-left: 1px solid var(--sl-color-hairline);
|
|
60
|
+
box-shadow: var(--sl-shadow-lg);
|
|
61
|
+
transform: translateX(100%);
|
|
62
|
+
visibility: hidden;
|
|
63
|
+
transition:
|
|
64
|
+
transform 0.2s ease,
|
|
65
|
+
visibility 0.2s;
|
|
66
|
+
}
|
|
67
|
+
.annot-drawer.open {
|
|
68
|
+
transform: none;
|
|
69
|
+
visibility: visible;
|
|
70
|
+
}
|
|
71
|
+
.annot-drawer header {
|
|
72
|
+
display: flex;
|
|
73
|
+
gap: 0.75rem;
|
|
74
|
+
align-items: center;
|
|
75
|
+
padding: 0.75rem 1rem;
|
|
76
|
+
border-bottom: 1px solid var(--sl-color-hairline);
|
|
77
|
+
}
|
|
78
|
+
.annot-resolved-toggle {
|
|
79
|
+
display: flex;
|
|
80
|
+
gap: 0.3rem;
|
|
81
|
+
align-items: center;
|
|
82
|
+
margin-left: auto;
|
|
83
|
+
color: var(--sl-color-gray-3);
|
|
84
|
+
}
|
|
85
|
+
.annot-close {
|
|
86
|
+
border: 0;
|
|
87
|
+
background: none;
|
|
88
|
+
color: var(--sl-color-gray-2);
|
|
89
|
+
font-size: 1.4rem !important;
|
|
90
|
+
line-height: 1;
|
|
91
|
+
}
|
|
92
|
+
.annot-body {
|
|
93
|
+
flex: 1;
|
|
94
|
+
overflow-y: auto;
|
|
95
|
+
padding: 0.75rem 1rem 4rem;
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
gap: 0.75rem;
|
|
99
|
+
}
|
|
100
|
+
.annot-body p {
|
|
101
|
+
margin: 0;
|
|
102
|
+
}
|
|
103
|
+
.annot-user {
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: space-between;
|
|
106
|
+
color: var(--sl-color-gray-3);
|
|
107
|
+
}
|
|
108
|
+
.annot-login {
|
|
109
|
+
align-self: flex-start;
|
|
110
|
+
}
|
|
111
|
+
.annot-error {
|
|
112
|
+
color: var(--sl-color-red);
|
|
113
|
+
}
|
|
114
|
+
.annot-empty,
|
|
115
|
+
.annot-orphans {
|
|
116
|
+
color: var(--sl-color-gray-3);
|
|
117
|
+
}
|
|
118
|
+
.annot-orphans {
|
|
119
|
+
font-size: var(--sl-text-sm);
|
|
120
|
+
margin: 0.5rem 0 0;
|
|
121
|
+
}
|
|
122
|
+
.annot-new,
|
|
123
|
+
.annot-thread {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: 0.4rem;
|
|
127
|
+
padding: 0.75rem;
|
|
128
|
+
border: 1px solid var(--sl-color-hairline);
|
|
129
|
+
border-radius: 0.5rem;
|
|
130
|
+
background: var(--sl-color-bg-nav);
|
|
131
|
+
}
|
|
132
|
+
.annot-thread.active {
|
|
133
|
+
border-color: var(--sl-color-accent);
|
|
134
|
+
}
|
|
135
|
+
.annot-thread.resolved {
|
|
136
|
+
opacity: 0.7;
|
|
137
|
+
}
|
|
138
|
+
.annot-quote-button {
|
|
139
|
+
padding: 0;
|
|
140
|
+
border: 0;
|
|
141
|
+
background: none;
|
|
142
|
+
color: inherit;
|
|
143
|
+
text-align: left;
|
|
144
|
+
}
|
|
145
|
+
.annot-quote-button:disabled {
|
|
146
|
+
cursor: default;
|
|
147
|
+
}
|
|
148
|
+
.annot-quote {
|
|
149
|
+
margin: 0;
|
|
150
|
+
padding-left: 0.6rem;
|
|
151
|
+
border-left: 3px solid rgb(255 200 0 / 0.8);
|
|
152
|
+
color: var(--sl-color-gray-2);
|
|
153
|
+
font-style: italic;
|
|
154
|
+
white-space: pre-wrap;
|
|
155
|
+
overflow-wrap: anywhere;
|
|
156
|
+
}
|
|
157
|
+
.annot-badge {
|
|
158
|
+
align-self: flex-start;
|
|
159
|
+
padding: 0 0.4rem;
|
|
160
|
+
border-radius: 0.25rem;
|
|
161
|
+
background: var(--sl-color-gray-5);
|
|
162
|
+
font-size: var(--sl-text-xs);
|
|
163
|
+
}
|
|
164
|
+
.annot-meta {
|
|
165
|
+
color: var(--sl-color-gray-3);
|
|
166
|
+
font-size: var(--sl-text-xs);
|
|
167
|
+
}
|
|
168
|
+
.annot-author {
|
|
169
|
+
color: var(--sl-color-white);
|
|
170
|
+
font-weight: 600;
|
|
171
|
+
}
|
|
172
|
+
.annot-text {
|
|
173
|
+
overflow-wrap: anywhere;
|
|
174
|
+
}
|
|
175
|
+
.annot-md-pending {
|
|
176
|
+
white-space: pre-wrap;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Markdown inside notes and the preview: compact, sized for the panel. */
|
|
180
|
+
.annot-md > :first-child {
|
|
181
|
+
margin-top: 0;
|
|
182
|
+
}
|
|
183
|
+
.annot-md > :last-child {
|
|
184
|
+
margin-bottom: 0;
|
|
185
|
+
}
|
|
186
|
+
.annot-md :is(p, ul, ol, blockquote, pre, table) {
|
|
187
|
+
margin: 0 0 0.5em;
|
|
188
|
+
}
|
|
189
|
+
.annot-md :is(h1, h2, h3, h4, h5, h6) {
|
|
190
|
+
margin: 0.4em 0 0.3em;
|
|
191
|
+
font-size: 1em;
|
|
192
|
+
color: var(--sl-color-white);
|
|
193
|
+
}
|
|
194
|
+
.annot-md :is(ul, ol) {
|
|
195
|
+
padding-left: 1.3em;
|
|
196
|
+
}
|
|
197
|
+
.annot-md li:has(> input[type='checkbox']) {
|
|
198
|
+
list-style: none;
|
|
199
|
+
margin-left: -1.3em;
|
|
200
|
+
}
|
|
201
|
+
.annot-md blockquote {
|
|
202
|
+
padding-left: 0.6em;
|
|
203
|
+
border-left: 3px solid var(--sl-color-gray-5);
|
|
204
|
+
color: var(--sl-color-gray-2);
|
|
205
|
+
}
|
|
206
|
+
.annot-md code {
|
|
207
|
+
padding: 0.05em 0.3em;
|
|
208
|
+
border-radius: 0.25em;
|
|
209
|
+
background: var(--sl-color-gray-6);
|
|
210
|
+
font-size: 0.9em;
|
|
211
|
+
}
|
|
212
|
+
.annot-md pre {
|
|
213
|
+
overflow-x: auto;
|
|
214
|
+
padding: 0.5em 0.6em;
|
|
215
|
+
border-radius: 0.35em;
|
|
216
|
+
background: var(--sl-color-gray-6);
|
|
217
|
+
}
|
|
218
|
+
.annot-md pre code {
|
|
219
|
+
padding: 0;
|
|
220
|
+
background: none;
|
|
221
|
+
}
|
|
222
|
+
.annot-md table {
|
|
223
|
+
display: block;
|
|
224
|
+
overflow-x: auto;
|
|
225
|
+
border-collapse: collapse;
|
|
226
|
+
}
|
|
227
|
+
.annot-md :is(th, td) {
|
|
228
|
+
padding: 0.2em 0.5em;
|
|
229
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
230
|
+
}
|
|
231
|
+
.annot-md a {
|
|
232
|
+
color: var(--sl-color-text-accent);
|
|
233
|
+
}
|
|
234
|
+
.annot-reply {
|
|
235
|
+
margin-left: 0.75rem;
|
|
236
|
+
padding-left: 0.6rem;
|
|
237
|
+
border-left: 1px solid var(--sl-color-gray-5);
|
|
238
|
+
}
|
|
239
|
+
.annot-ref {
|
|
240
|
+
display: block;
|
|
241
|
+
max-width: 100%;
|
|
242
|
+
margin-bottom: 0.15rem;
|
|
243
|
+
padding: 0;
|
|
244
|
+
border: 0;
|
|
245
|
+
background: none;
|
|
246
|
+
color: var(--sl-color-gray-3);
|
|
247
|
+
font-size: var(--sl-text-xs);
|
|
248
|
+
text-align: left;
|
|
249
|
+
overflow: hidden;
|
|
250
|
+
text-overflow: ellipsis;
|
|
251
|
+
white-space: nowrap;
|
|
252
|
+
}
|
|
253
|
+
button.annot-ref:hover {
|
|
254
|
+
color: var(--sl-color-text-accent);
|
|
255
|
+
}
|
|
256
|
+
.annot-ref strong {
|
|
257
|
+
color: var(--sl-color-gray-2);
|
|
258
|
+
}
|
|
259
|
+
.annot-ref.deleted {
|
|
260
|
+
font-style: italic;
|
|
261
|
+
}
|
|
262
|
+
.annot-message {
|
|
263
|
+
border-radius: 0.3rem;
|
|
264
|
+
}
|
|
265
|
+
.annot-flash {
|
|
266
|
+
animation: annot-flash 1.4s ease-out;
|
|
267
|
+
}
|
|
268
|
+
@keyframes annot-flash {
|
|
269
|
+
from {
|
|
270
|
+
background-color: rgb(255 200 0 / 0.35);
|
|
271
|
+
}
|
|
272
|
+
to {
|
|
273
|
+
background-color: transparent;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
.annot-reply-actions {
|
|
277
|
+
margin-top: 0.2rem;
|
|
278
|
+
}
|
|
279
|
+
.annot-reply-actions button {
|
|
280
|
+
padding: 0 0.4rem;
|
|
281
|
+
border-color: transparent;
|
|
282
|
+
font-size: var(--sl-text-xs);
|
|
283
|
+
}
|
|
284
|
+
.annot-actions {
|
|
285
|
+
display: flex;
|
|
286
|
+
flex-wrap: wrap;
|
|
287
|
+
gap: 0.4rem;
|
|
288
|
+
}
|
|
289
|
+
.annot-actions button {
|
|
290
|
+
padding: 0.15rem 0.6rem;
|
|
291
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
292
|
+
border-radius: 0.3rem;
|
|
293
|
+
background: none;
|
|
294
|
+
color: var(--sl-color-gray-2);
|
|
295
|
+
}
|
|
296
|
+
.annot-actions button.annot-primary {
|
|
297
|
+
border-color: var(--sl-color-accent);
|
|
298
|
+
background: var(--sl-color-accent);
|
|
299
|
+
color: var(--sl-color-black);
|
|
300
|
+
}
|
|
301
|
+
.annot-actions button.annot-danger {
|
|
302
|
+
margin-left: auto;
|
|
303
|
+
color: var(--sl-color-red);
|
|
304
|
+
}
|
|
305
|
+
.annot-editor {
|
|
306
|
+
display: flex;
|
|
307
|
+
flex-direction: column;
|
|
308
|
+
gap: 0.4rem;
|
|
309
|
+
}
|
|
310
|
+
.annot-editor textarea,
|
|
311
|
+
.annot-preview {
|
|
312
|
+
width: 100%;
|
|
313
|
+
box-sizing: border-box;
|
|
314
|
+
min-height: 6.5rem;
|
|
315
|
+
padding: 0.45rem;
|
|
316
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
317
|
+
border-radius: 0.35rem;
|
|
318
|
+
background: var(--sl-color-bg);
|
|
319
|
+
color: var(--sl-color-white);
|
|
320
|
+
font: inherit;
|
|
321
|
+
}
|
|
322
|
+
.annot-editor textarea {
|
|
323
|
+
resize: vertical;
|
|
324
|
+
}
|
|
325
|
+
.annot-editor [hidden] {
|
|
326
|
+
display: none !important;
|
|
327
|
+
}
|
|
328
|
+
.annot-editor-bar {
|
|
329
|
+
display: flex;
|
|
330
|
+
flex-wrap: wrap;
|
|
331
|
+
gap: 0.25rem 0.5rem;
|
|
332
|
+
align-items: center;
|
|
333
|
+
justify-content: space-between;
|
|
334
|
+
}
|
|
335
|
+
.annot-tabs {
|
|
336
|
+
display: flex;
|
|
337
|
+
}
|
|
338
|
+
.annot-tab {
|
|
339
|
+
padding: 0.15rem 0.6rem;
|
|
340
|
+
border: 0;
|
|
341
|
+
border-bottom: 2px solid transparent;
|
|
342
|
+
background: none;
|
|
343
|
+
color: var(--sl-color-gray-3);
|
|
344
|
+
}
|
|
345
|
+
.annot-tab[aria-selected='true'] {
|
|
346
|
+
border-bottom-color: var(--sl-color-accent);
|
|
347
|
+
color: var(--sl-color-white);
|
|
348
|
+
}
|
|
349
|
+
.annot-tools {
|
|
350
|
+
display: flex;
|
|
351
|
+
flex-wrap: wrap;
|
|
352
|
+
align-items: center;
|
|
353
|
+
}
|
|
354
|
+
.annot-tools button {
|
|
355
|
+
display: grid;
|
|
356
|
+
place-items: center;
|
|
357
|
+
width: 1.75rem;
|
|
358
|
+
height: 1.75rem;
|
|
359
|
+
padding: 0;
|
|
360
|
+
border: 0;
|
|
361
|
+
border-radius: 0.3rem;
|
|
362
|
+
background: none;
|
|
363
|
+
color: var(--sl-color-gray-2);
|
|
364
|
+
font-family: var(--sl-font-system);
|
|
365
|
+
}
|
|
366
|
+
.annot-tools button:hover,
|
|
367
|
+
.annot-tools button:focus-visible {
|
|
368
|
+
background: var(--sl-color-gray-6);
|
|
369
|
+
color: var(--sl-color-white);
|
|
370
|
+
}
|
|
371
|
+
.annot-tools-gap {
|
|
372
|
+
width: 1px;
|
|
373
|
+
height: 1rem;
|
|
374
|
+
margin: 0 0.2rem;
|
|
375
|
+
background: var(--sl-color-gray-5);
|
|
376
|
+
}
|
|
377
|
+
.annot-hint {
|
|
378
|
+
margin-left: auto;
|
|
379
|
+
align-self: center;
|
|
380
|
+
color: var(--sl-color-gray-3);
|
|
381
|
+
font-size: var(--sl-text-xs);
|
|
382
|
+
}
|
|
383
|
+
@media print {
|
|
384
|
+
.annot-ui {
|
|
385
|
+
display: none;
|
|
386
|
+
}
|
|
387
|
+
}
|