autumnnote 1.0.0

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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +874 -0
  3. package/dist/autumnnote.css +1 -0
  4. package/dist/autumnnote.es.js +5888 -0
  5. package/dist/autumnnote.es.js.map +1 -0
  6. package/dist/autumnnote.umd.js +74 -0
  7. package/dist/autumnnote.umd.js.map +1 -0
  8. package/package.json +55 -0
  9. package/src/js/Context.js +497 -0
  10. package/src/js/core/dom.js +315 -0
  11. package/src/js/core/env.js +25 -0
  12. package/src/js/core/func.js +153 -0
  13. package/src/js/core/key.js +66 -0
  14. package/src/js/core/lists.js +121 -0
  15. package/src/js/core/markdown.js +294 -0
  16. package/src/js/core/range.js +194 -0
  17. package/src/js/core/sanitise.js +78 -0
  18. package/src/js/editing/History.js +205 -0
  19. package/src/js/editing/Style.js +329 -0
  20. package/src/js/editing/Table.js +59 -0
  21. package/src/js/editing/Typing.js +142 -0
  22. package/src/js/index.js +126 -0
  23. package/src/js/module/Buttons.js +300 -0
  24. package/src/js/module/Clipboard.js +460 -0
  25. package/src/js/module/CodeTooltip.js +428 -0
  26. package/src/js/module/Codeview.js +122 -0
  27. package/src/js/module/ContextMenu.js +470 -0
  28. package/src/js/module/Editor.js +528 -0
  29. package/src/js/module/EmojiDialog.js +726 -0
  30. package/src/js/module/FindReplace.js +440 -0
  31. package/src/js/module/Fullscreen.js +80 -0
  32. package/src/js/module/IconDialog.js +620 -0
  33. package/src/js/module/ImageDialog.js +208 -0
  34. package/src/js/module/ImageResizer.js +216 -0
  35. package/src/js/module/ImageTooltip.js +286 -0
  36. package/src/js/module/LinkDialog.js +204 -0
  37. package/src/js/module/LinkTooltip.js +242 -0
  38. package/src/js/module/Placeholder.js +44 -0
  39. package/src/js/module/ShortcutsDialog.js +141 -0
  40. package/src/js/module/Statusbar.js +238 -0
  41. package/src/js/module/TableTooltip.js +568 -0
  42. package/src/js/module/Toolbar.js +562 -0
  43. package/src/js/module/VideoDialog.js +263 -0
  44. package/src/js/module/VideoResizer.js +227 -0
  45. package/src/js/module/VideoTooltip.js +252 -0
  46. package/src/js/renderer.js +107 -0
  47. package/src/js/settings.js +134 -0
  48. package/src/styles/_variables.scss +48 -0
  49. package/src/styles/autumnnote.scss +1740 -0
  50. package/types/index.d.ts +324 -0
@@ -0,0 +1,1740 @@
1
+ /**
2
+ * autumnnote.scss — Main stylesheet for the AutumnNote editor
3
+ * Inspired by Summernote — rewritten with cleaner, modern CSS
4
+ */
5
+
6
+ @use 'variables' as *;
7
+
8
+ // =============================================================================
9
+ // Container
10
+ // =============================================================================
11
+
12
+ .an-container {
13
+ display: flex;
14
+ flex-direction: column;
15
+ border: 1px solid $an-border;
16
+ border-radius: $an-radius;
17
+ font-family: $an-font-family;
18
+ font-size: $an-font-size;
19
+ box-sizing: border-box;
20
+ background: $an-bg;
21
+ overflow: hidden;
22
+ // Prevent the container from participating in ancestor layout recalculations.
23
+ // This limits reflow thrashing when editing large documents.
24
+ contain: layout;
25
+
26
+ *,
27
+ *::before,
28
+ *::after {
29
+ box-sizing: border-box;
30
+ }
31
+
32
+ &.an-focused {
33
+ border-color: $an-primary;
34
+ box-shadow: 0 0 0 3px rgba($an-primary, 0.15);
35
+ }
36
+
37
+ &.an-disabled {
38
+ opacity: 0.6;
39
+ pointer-events: none;
40
+ user-select: none;
41
+ }
42
+
43
+ &.an-fullscreen {
44
+ position: fixed;
45
+ inset: 0;
46
+ z-index: 9990;
47
+ border-radius: 0;
48
+ border: none;
49
+
50
+ .an-editable {
51
+ flex: 1;
52
+ max-height: none !important;
53
+ }
54
+ }
55
+ }
56
+
57
+ // =============================================================================
58
+ // Toolbar
59
+ // =============================================================================
60
+
61
+ .an-toolbar {
62
+ display: flex;
63
+ flex-wrap: wrap;
64
+ align-items: center;
65
+ gap: $an-toolbar-gap;
66
+ padding: $an-toolbar-pad;
67
+ background: $an-bg-toolbar;
68
+ border-bottom: 1px solid $an-border;
69
+ user-select: none;
70
+ }
71
+
72
+ .an-btn-group {
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 2px;
76
+
77
+ // Separator between groups
78
+ & + .an-btn-group {
79
+ position: relative;
80
+ padding-left: $an-toolbar-gap + 4px;
81
+
82
+ &::before {
83
+ content: '';
84
+ position: absolute;
85
+ left: 0;
86
+ top: 15%;
87
+ height: 70%;
88
+ width: 1px;
89
+ background: $an-border;
90
+ }
91
+ }
92
+ }
93
+
94
+ // Font-family (and generic) select dropdown in toolbar
95
+ .an-select {
96
+ height: $an-btn-height;
97
+ padding: 0 24px 0 8px;
98
+ background: $an-bg url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 7px center;
99
+ background-size: 8px 5px;
100
+ border: 1px solid $an-border;
101
+ border-radius: $an-radius-sm;
102
+ font-family: inherit;
103
+ font-size: 12px;
104
+ color: $an-text;
105
+ cursor: pointer;
106
+ appearance: none;
107
+ -webkit-appearance: none;
108
+ min-width: 110px;
109
+ max-width: 160px;
110
+ transition: border-color $an-transition, box-shadow $an-transition;
111
+
112
+ &:hover {
113
+ border-color: $an-primary;
114
+ }
115
+
116
+ &:focus {
117
+ outline: none;
118
+ border-color: $an-primary;
119
+ box-shadow: 0 0 0 2px rgba($an-primary, 0.15);
120
+ }
121
+
122
+ option {
123
+ font-size: 13px;
124
+ }
125
+ }
126
+
127
+ // Narrow variant — used for short-value selects such as Line Height
128
+ .an-select-narrow {
129
+ min-width: 76px;
130
+ max-width: 90px;
131
+ padding-right: 20px;
132
+ }
133
+
134
+ // Paragraph-style variant — Normal/H1-H6/Quote/Code labels
135
+ .an-select-style {
136
+ min-width: 80px;
137
+ max-width: 92px;
138
+ padding-right: 20px;
139
+ }
140
+
141
+ // Table grid picker
142
+ .an-table-picker-wrap {
143
+ position: relative;
144
+ display: inline-flex;
145
+ }
146
+
147
+ .an-table-picker-popup {
148
+ display: none;
149
+ position: absolute;
150
+ top: calc(100% + 4px);
151
+ left: 0;
152
+ background: $an-bg;
153
+ border: 1px solid $an-border;
154
+ border-radius: 6px;
155
+ padding: 8px;
156
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
157
+ z-index: 1100;
158
+ user-select: none;
159
+ }
160
+
161
+ .an-table-grid {
162
+ display: grid;
163
+ grid-template-columns: repeat(10, 18px);
164
+ gap: 2px;
165
+ }
166
+
167
+ .an-table-cell {
168
+ width: 18px;
169
+ height: 18px;
170
+ border: 1px solid $an-border;
171
+ border-radius: 2px;
172
+ cursor: pointer;
173
+ background: $an-bg;
174
+ transition: background $an-transition, border-color $an-transition;
175
+
176
+ &.active {
177
+ background: rgba($an-primary, 0.15);
178
+ border-color: $an-primary;
179
+ }
180
+ }
181
+
182
+ .an-table-label {
183
+ margin-top: 6px;
184
+ text-align: center;
185
+ font-size: 12px;
186
+ color: $an-muted;
187
+ min-height: 16px;
188
+ }
189
+
190
+ // Context menu — inline table grid panel
191
+ .an-context-table-grid-panel {
192
+ padding: 6px 8px 8px;
193
+ border-top: 1px solid $an-border;
194
+ }
195
+
196
+ // =============================================================================
197
+ // Color picker (text color / highlight color) toolbar widget
198
+ // =============================================================================
199
+
200
+ .an-color-picker-wrap {
201
+ position: relative;
202
+ display: inline-flex;
203
+ align-items: stretch;
204
+ }
205
+
206
+ // Left part: icon + color strip stacked vertically
207
+ .an-color-btn {
208
+ flex-direction: column !important;
209
+ gap: 2px !important;
210
+ padding: 4px 6px 3px !important;
211
+ height: auto !important;
212
+ min-height: $an-btn-height;
213
+
214
+ .an-color-strip {
215
+ display: block;
216
+ width: 100%;
217
+ min-width: 14px;
218
+ height: 3px;
219
+ border-radius: 1px;
220
+ flex-shrink: 0;
221
+ }
222
+ }
223
+
224
+ // Right part: small chevron arrow to open popup
225
+ .an-color-arrow {
226
+ padding: 0 3px !important;
227
+ min-width: unset !important;
228
+ border-left: 1px solid transparent;
229
+
230
+ &:hover {
231
+ border-left-color: $an-border;
232
+ }
233
+ }
234
+
235
+ // Swatch popup panel
236
+ .an-color-popup {
237
+ position: absolute;
238
+ top: calc(100% + 4px);
239
+ left: 0;
240
+ z-index: 1100;
241
+ background: $an-bg;
242
+ border: 1px solid $an-border;
243
+ border-radius: 6px;
244
+ padding: 8px;
245
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
246
+ min-width: 184px;
247
+ user-select: none;
248
+ }
249
+
250
+ .an-color-swatches {
251
+ display: grid;
252
+ grid-template-columns: repeat(8, 18px);
253
+ gap: 3px;
254
+ margin-bottom: 8px;
255
+ }
256
+
257
+ .an-color-swatch {
258
+ width: 18px;
259
+ height: 18px;
260
+ border-radius: 2px;
261
+ cursor: pointer;
262
+ border: 1px solid rgba(0, 0, 0, 0.12);
263
+ transition: transform 0.1s ease;
264
+ position: relative;
265
+
266
+ &:hover {
267
+ transform: scale(1.25);
268
+ z-index: 1;
269
+ outline: 2px solid $an-primary;
270
+ outline-offset: 1px;
271
+ }
272
+ }
273
+
274
+ .an-color-custom {
275
+ display: flex;
276
+ align-items: center;
277
+ gap: 8px;
278
+ padding-top: 6px;
279
+ border-top: 1px solid $an-border;
280
+
281
+ input[type='color'] {
282
+ width: 28px;
283
+ height: 22px;
284
+ padding: 1px 2px;
285
+ border: 1px solid $an-border;
286
+ border-radius: 3px;
287
+ cursor: pointer;
288
+ background: none;
289
+ flex-shrink: 0;
290
+ appearance: none;
291
+ -webkit-appearance: none;
292
+
293
+ &::-webkit-color-swatch-wrapper { padding: 0; }
294
+ &::-webkit-color-swatch { border: none; border-radius: 2px; }
295
+
296
+ &:hover {
297
+ border-color: $an-primary;
298
+ }
299
+ }
300
+
301
+ span {
302
+ font-size: 11px;
303
+ color: $an-muted;
304
+ flex: 1;
305
+ }
306
+ }
307
+
308
+ .an-btn {
309
+ display: inline-flex;
310
+ align-items: center;
311
+ justify-content: center;
312
+ height: $an-btn-height;
313
+ min-width: $an-btn-height;
314
+ padding: $an-btn-padding;
315
+ background: transparent;
316
+ border: 1px solid transparent;
317
+ border-radius: $an-radius-sm;
318
+ color: $an-text;
319
+ font-family: inherit;
320
+ font-size: 13px;
321
+ line-height: 1;
322
+ cursor: pointer;
323
+ transition: background $an-transition, border-color $an-transition, color $an-transition;
324
+ white-space: nowrap;
325
+ text-decoration: none;
326
+
327
+ // Make sure inline SVGs render cleanly
328
+ svg {
329
+ display: block;
330
+ flex-shrink: 0;
331
+ pointer-events: none;
332
+ }
333
+
334
+ &:hover {
335
+ background: $an-bg-btn-hover;
336
+ border-color: $an-border;
337
+ color: $an-primary;
338
+
339
+ svg {
340
+ stroke: $an-primary;
341
+ }
342
+ }
343
+
344
+ &:focus-visible {
345
+ outline: 2px solid $an-primary;
346
+ outline-offset: 1px;
347
+ }
348
+
349
+ &.active {
350
+ background: $an-bg-btn-active;
351
+ border-color: $an-primary;
352
+ color: $an-primary-hover;
353
+
354
+ svg {
355
+ stroke: $an-primary-hover;
356
+ }
357
+ }
358
+
359
+ &.an-btn-primary {
360
+ background: $an-primary;
361
+ border-color: $an-primary;
362
+ color: #fff;
363
+
364
+ svg { stroke: #fff; }
365
+
366
+ &:hover {
367
+ background: $an-primary-hover;
368
+ border-color: $an-primary-hover;
369
+ }
370
+ }
371
+ }
372
+
373
+ // =============================================================================
374
+ // Editable area
375
+ // =============================================================================
376
+
377
+ .an-editable {
378
+ flex: 1;
379
+ padding: $an-editable-pad;
380
+ min-height: 200px;
381
+ outline: none;
382
+ line-height: $an-line-height;
383
+ color: $an-text;
384
+ overflow-y: auto;
385
+ word-break: break-word;
386
+
387
+ // Placeholder
388
+ &.an-placeholder::before {
389
+ content: attr(data-placeholder);
390
+ color: $an-muted;
391
+ pointer-events: none;
392
+ position: absolute;
393
+ }
394
+
395
+ // Content styles
396
+ p { margin: 0 0 0.75em; }
397
+ h1, h2, h3, h4, h5, h6 { margin: 0.5em 0; line-height: 1.3; }
398
+ ul, ol { margin: 0 0 0.75em 1.5em; padding: 0; }
399
+ li { margin-bottom: 0.25em; }
400
+ blockquote {
401
+ margin: 0.5em 0 0.5em 1em;
402
+ padding: 0.5em 1em;
403
+ border-left: 4px solid $an-border;
404
+ color: $an-muted;
405
+ }
406
+ pre, code {
407
+ font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
408
+ font-size: 0.9em;
409
+ background: $an-bg-toolbar;
410
+ border-radius: $an-radius-sm;
411
+ }
412
+ pre { padding: 0.75em 1em; overflow-x: auto; }
413
+ code { padding: 0.1em 0.3em; }
414
+
415
+ // Prism-highlighted blocks — <pre> gets class="language-*" mirrored from <code>
416
+ // Set dark background here as fallback for before Prism CSS loads from CDN.
417
+ pre[class*='language-'] {
418
+ background: #2d2d2d;
419
+ color: #ccc;
420
+ border-radius: $an-radius-sm;
421
+
422
+ > code[class*='language-'] {
423
+ background: transparent;
424
+ color: inherit;
425
+ padding: 0;
426
+ }
427
+ }
428
+ a { color: $an-primary; }
429
+ hr { border: none; border-top: 2px solid $an-border; margin: 1em 0; }
430
+ img.an-image {
431
+ max-width: 100%;
432
+ height: auto;
433
+ display: inline-block;
434
+ }
435
+
436
+ .an-video-wrapper {
437
+ position: relative;
438
+ display: inline-block;
439
+ max-width: 100%;
440
+ margin: 4px 0;
441
+
442
+ iframe,
443
+ video {
444
+ display: block;
445
+ max-width: 100%;
446
+ }
447
+
448
+ // Transparent overlay that intercepts mouse events on <iframe> embeds.
449
+ // iframes swallow all pointer events and prevent them from bubbling to the
450
+ // editable area; the shield sits on top so clicks/contextmenu bubble normally.
451
+ .an-video-shield {
452
+ position: absolute;
453
+ inset: 0;
454
+ z-index: 2;
455
+ cursor: default;
456
+ }
457
+ }
458
+
459
+ // Table styles — target both classed and unclassed tables
460
+ table, .an-table {
461
+ border-collapse: collapse;
462
+ table-layout: fixed;
463
+ width: 100%;
464
+ margin: 0.75em 0;
465
+
466
+ td, th {
467
+ border: 1px solid $an-border;
468
+ padding: 6px 10px;
469
+ min-width: 40px;
470
+ vertical-align: top;
471
+ overflow-wrap: break-word;
472
+ word-break: break-word;
473
+ }
474
+
475
+ th {
476
+ background: $an-bg-toolbar;
477
+ font-weight: 600;
478
+ }
479
+ }
480
+ }
481
+
482
+ // ---------------------------------------------------------------------------
483
+ // Link tooltip
484
+ // ---------------------------------------------------------------------------
485
+
486
+ .an-link-tooltip {
487
+ position: fixed;
488
+ z-index: 1300;
489
+ display: flex;
490
+ align-items: center;
491
+ gap: 2px;
492
+ height: 30px;
493
+ padding: 0 6px;
494
+ background: $an-bg;
495
+ border: 1px solid $an-border;
496
+ border-radius: $an-radius-sm;
497
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
498
+ white-space: nowrap;
499
+ pointer-events: all;
500
+
501
+ // URL preview label
502
+ .an-link-tooltip-url {
503
+ max-width: 200px;
504
+ overflow: hidden;
505
+ text-overflow: ellipsis;
506
+ white-space: nowrap;
507
+ font-size: 12px;
508
+ color: $an-primary;
509
+ cursor: default;
510
+ padding: 0 4px;
511
+ }
512
+
513
+ // Vertical divider
514
+ .an-link-tooltip-sep {
515
+ width: 1px;
516
+ height: 18px;
517
+ background: $an-border;
518
+ flex-shrink: 0;
519
+ margin: 0 2px;
520
+ }
521
+ }
522
+
523
+ .an-link-tooltip-btn {
524
+ display: flex;
525
+ align-items: center;
526
+ justify-content: center;
527
+ width: 24px;
528
+ height: 24px;
529
+ padding: 0;
530
+ border: none;
531
+ border-radius: $an-radius-sm;
532
+ background: transparent;
533
+ color: $an-muted;
534
+ cursor: pointer;
535
+ flex-shrink: 0;
536
+
537
+ svg { stroke: currentColor; display: block; }
538
+
539
+ &:hover {
540
+ background: $an-bg-btn-hover;
541
+ color: $an-text;
542
+ }
543
+
544
+ &:active,
545
+ &.an-link-tooltip-btn--copied {
546
+ background: $an-bg-btn-active;
547
+ color: $an-primary;
548
+ }
549
+
550
+ // Danger variant — used for Delete actions in image/video tooltips
551
+ &.an-link-tooltip-btn--danger {
552
+ color: #ef4444;
553
+
554
+ svg { stroke: #ef4444; }
555
+
556
+ &:hover {
557
+ background: rgba(#ef4444, 0.08);
558
+ color: #dc2626;
559
+ svg { stroke: #dc2626; }
560
+ }
561
+ }
562
+ }
563
+
564
+ // Shared modifier classes for image and video tooltips
565
+ // (re-use all .an-link-tooltip styles, only override the label colour)
566
+ .an-image-tooltip .an-link-tooltip-url {
567
+ color: $an-text;
568
+ font-weight: 500;
569
+ }
570
+
571
+ .an-video-tooltip .an-link-tooltip-url {
572
+ color: #7c3aed; // violet to match video accent
573
+ font-weight: 500;
574
+ }
575
+
576
+ .an-table-tooltip .an-link-tooltip-url {
577
+ color: #0369a1; // sky blue for table
578
+ font-weight: 500;
579
+ }
580
+
581
+ .an-code-tooltip .an-link-tooltip-url {
582
+ color: #059669; // emerald green for code
583
+ font-weight: 500;
584
+ font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
585
+ font-size: 11px;
586
+ letter-spacing: 0.02em;
587
+ }
588
+
589
+ // Size popover (column width / row height)
590
+ .an-size-popover {
591
+ position: fixed;
592
+ background: $an-bg;
593
+ border: 1px solid $an-border;
594
+ border-radius: 8px;
595
+ padding: 12px 14px;
596
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
597
+ z-index: 1200;
598
+ min-width: 200px;
599
+
600
+ .an-size-popover-title {
601
+ font-size: 12px;
602
+ font-weight: 600;
603
+ color: $an-text;
604
+ margin-bottom: 10px;
605
+ }
606
+
607
+ .an-size-popover-body {
608
+ display: flex;
609
+ align-items: center;
610
+ gap: 6px;
611
+ margin-bottom: 12px;
612
+ }
613
+
614
+ .an-size-input {
615
+ width: 80px;
616
+ height: 28px;
617
+ padding: 0 8px;
618
+ border: 1px solid $an-border;
619
+ border-radius: $an-radius-sm;
620
+ font-size: 13px;
621
+ font-family: inherit;
622
+ color: $an-text;
623
+ outline: none;
624
+
625
+ &:focus {
626
+ border-color: $an-primary;
627
+ box-shadow: 0 0 0 2px rgba($an-primary, 0.15);
628
+ }
629
+ }
630
+
631
+ .an-size-unit {
632
+ font-size: 12px;
633
+ color: $an-muted;
634
+ }
635
+
636
+ .an-size-popover-actions {
637
+ display: flex;
638
+ justify-content: flex-end;
639
+ gap: 6px;
640
+ }
641
+ }
642
+
643
+ // =============================================================================
644
+ // Codeview textarea
645
+ // =============================================================================
646
+
647
+ .an-codeview {
648
+ flex: 1;
649
+ width: 100%;
650
+ min-height: 200px;
651
+ padding: $an-editable-pad;
652
+ border: none;
653
+ outline: none;
654
+ resize: vertical;
655
+ font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
656
+ font-size: 13px;
657
+ line-height: 1.5;
658
+ background: #1e1e2e;
659
+ color: #cdd6f4;
660
+ }
661
+
662
+ // =============================================================================
663
+ // Statusbar
664
+ // =============================================================================
665
+
666
+ .an-statusbar {
667
+ display: flex;
668
+ align-items: center;
669
+ justify-content: space-between;
670
+ height: $an-statusbar-h;
671
+ padding: 0 8px;
672
+ background: $an-statusbar-bg;
673
+ border-top: 1px solid $an-border;
674
+ font-size: 11px;
675
+ color: $an-muted;
676
+ user-select: none;
677
+ }
678
+
679
+ .an-status-info {
680
+ display: flex;
681
+ gap: 12px;
682
+ }
683
+
684
+ .an-resize-handle {
685
+ width: 14px;
686
+ height: 14px;
687
+ cursor: ns-resize;
688
+ background: repeating-linear-gradient(
689
+ -45deg,
690
+ $an-border,
691
+ $an-border 1px,
692
+ transparent 1px,
693
+ transparent 3px
694
+ );
695
+ border-radius: 2px;
696
+ flex-shrink: 0;
697
+
698
+ &:hover {
699
+ opacity: 0.7;
700
+ }
701
+ }
702
+
703
+ // =============================================================================
704
+ // Dialogs
705
+ // =============================================================================
706
+
707
+ .an-dialog-overlay {
708
+ display: none; // toggled via JS
709
+ position: fixed;
710
+ inset: 0;
711
+ z-index: $an-dialog-z;
712
+ background: $an-dialog-bg;
713
+ align-items: center;
714
+ justify-content: center;
715
+ }
716
+
717
+ .an-dialog-box {
718
+ background: $an-bg;
719
+ border-radius: $an-dialog-radius;
720
+ padding: 24px;
721
+ width: min($an-dialog-width, 95vw);
722
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
723
+ display: flex;
724
+ flex-direction: column;
725
+ gap: 10px;
726
+ }
727
+
728
+ .an-dialog-title {
729
+ margin: 0 0 4px;
730
+ font-size: 16px;
731
+ font-weight: 600;
732
+ color: $an-text;
733
+ }
734
+
735
+ .an-dialog-actions {
736
+ display: flex;
737
+ gap: 8px;
738
+ justify-content: flex-end;
739
+ margin-top: 6px;
740
+ }
741
+
742
+ .an-dialog-hint {
743
+ margin: -4px 0 0;
744
+ font-size: 12px;
745
+ color: $an-muted;
746
+ min-height: 16px;
747
+ }
748
+
749
+ .an-align-row {
750
+ display: flex;
751
+ flex-wrap: wrap;
752
+ gap: 12px;
753
+ margin-bottom: 10px;
754
+
755
+ input[type='radio'] { accent-color: $an-primary; cursor: pointer; }
756
+
757
+ .an-align-label {
758
+ font-size: 13px;
759
+ cursor: pointer;
760
+ user-select: none;
761
+ }
762
+ }
763
+
764
+ .an-label {
765
+ display: block;
766
+ font-size: 13px;
767
+ font-weight: 500;
768
+ color: $an-text;
769
+ margin-bottom: 2px;
770
+
771
+ &.an-label-inline {
772
+ display: flex;
773
+ align-items: center;
774
+ gap: 6px;
775
+ font-weight: normal;
776
+ cursor: pointer;
777
+ }
778
+ }
779
+
780
+ .an-input {
781
+ width: 100%;
782
+ padding: 7px 10px;
783
+ border: 1px solid $an-border;
784
+ border-radius: $an-radius-sm;
785
+ font-family: inherit;
786
+ font-size: $an-font-size;
787
+ color: $an-text;
788
+ background: $an-bg;
789
+ outline: none;
790
+ transition: border-color $an-transition, box-shadow $an-transition;
791
+
792
+ &:focus {
793
+ border-color: $an-primary;
794
+ box-shadow: 0 0 0 3px rgba($an-primary, 0.15);
795
+ }
796
+ }
797
+
798
+ // ---------------------------------------------------------------------------
799
+ // Context menu
800
+ // ---------------------------------------------------------------------------
801
+
802
+ .an-contextmenu {
803
+ position: fixed;
804
+ z-index: 10050;
805
+ background: $an-bg;
806
+ border: 1px solid $an-border;
807
+ border-radius: 8px;
808
+ box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
809
+ min-width: 180px;
810
+ padding: 5px 4px;
811
+ display: none;
812
+ user-select: none;
813
+ }
814
+
815
+ .an-context-item {
816
+ display: flex;
817
+ align-items: center;
818
+ gap: 10px;
819
+ width: 100%;
820
+ text-align: left;
821
+ padding: 7px 14px;
822
+ background: transparent;
823
+ border: none;
824
+ border-radius: 5px;
825
+ font-size: 13px;
826
+ color: $an-text;
827
+ cursor: pointer;
828
+ transition: background 0.12s, color 0.12s;
829
+ line-height: 1.4;
830
+
831
+ &:hover {
832
+ background: $an-primary;
833
+ color: #fff;
834
+
835
+ .an-context-icon svg {
836
+ stroke: #fff;
837
+ }
838
+
839
+ .an-context-chevron svg {
840
+ stroke: #fff;
841
+ }
842
+ }
843
+
844
+ &:disabled {
845
+ opacity: 0.38;
846
+ cursor: default;
847
+ pointer-events: none;
848
+ }
849
+ }
850
+
851
+ // Submenu entry — chevron on the right
852
+ .an-context-submenu {
853
+ .an-context-chevron {
854
+ display: flex;
855
+ align-items: center;
856
+ margin-left: auto;
857
+ color: $an-muted;
858
+ flex-shrink: 0;
859
+
860
+ svg { display: block; }
861
+ }
862
+ }
863
+
864
+ // Back-navigation header button
865
+ .an-context-back {
866
+ display: flex;
867
+ align-items: center;
868
+ gap: 8px;
869
+ width: 100%;
870
+ text-align: left;
871
+ padding: 6px 14px 8px;
872
+ background: transparent;
873
+ border: none;
874
+ border-bottom: 1px solid $an-border;
875
+ border-radius: 5px 5px 0 0;
876
+ font-size: 12px;
877
+ font-weight: 600;
878
+ color: $an-muted;
879
+ cursor: pointer;
880
+ margin-bottom: 3px;
881
+ transition: background 0.12s, color 0.12s;
882
+
883
+ .an-context-icon svg { stroke: $an-muted; }
884
+
885
+ &:hover {
886
+ background: $an-bg-btn-hover;
887
+ color: $an-text;
888
+ .an-context-icon svg { stroke: $an-text; }
889
+ }
890
+ }
891
+
892
+ .an-context-icon {
893
+ display: flex;
894
+ align-items: center;
895
+ justify-content: center;
896
+ flex-shrink: 0;
897
+ width: 16px;
898
+ color: $an-muted;
899
+ transition: color 0.12s;
900
+
901
+ svg {
902
+ display: block;
903
+ stroke: currentColor;
904
+ }
905
+ }
906
+
907
+ .an-context-label {
908
+ flex: 1;
909
+ }
910
+
911
+ .an-context-sep {
912
+ height: 1px;
913
+ margin: 5px 10px;
914
+ background: $an-border;
915
+ }
916
+
917
+ // ---------------------------------------------------------------------------
918
+ // Image resize overlay
919
+ // ---------------------------------------------------------------------------
920
+
921
+ .an-image-resizer {
922
+ position: fixed;
923
+ z-index: 10000;
924
+ box-sizing: border-box;
925
+ border: 2px solid $an-primary;
926
+ pointer-events: none;
927
+
928
+ .an-resize-handle {
929
+ position: absolute;
930
+ width: 8px;
931
+ height: 8px;
932
+ background: $an-primary;
933
+ border: 1px solid #fff;
934
+ border-radius: 1px;
935
+ box-sizing: border-box;
936
+ pointer-events: all;
937
+ }
938
+
939
+ // Corners
940
+ .an-resize-nw { top: -4px; left: -4px; cursor: nw-resize; }
941
+ .an-resize-ne { top: -4px; right: -4px; cursor: ne-resize; }
942
+ .an-resize-se { bottom: -4px; right: -4px; cursor: se-resize; }
943
+ .an-resize-sw { bottom: -4px; left: -4px; cursor: sw-resize; }
944
+
945
+ // Edge midpoints
946
+ .an-resize-n { top: -4px; left: calc(50% - 4px); cursor: n-resize; }
947
+ .an-resize-e { top: calc(50% - 4px); right: -4px; cursor: e-resize; }
948
+ .an-resize-s { bottom: -4px; left: calc(50% - 4px); cursor: s-resize; }
949
+ .an-resize-w { top: calc(50% - 4px); left: -4px; cursor: w-resize; }
950
+ }
951
+
952
+ // ---------------------------------------------------------------------------
953
+ // Video resize overlay
954
+ // ---------------------------------------------------------------------------
955
+
956
+ $an-video-accent: #8b5cf6; // violet-500
957
+
958
+ .an-video-resizer {
959
+ position: fixed;
960
+ z-index: 10000;
961
+ box-sizing: border-box;
962
+ border: 2px solid $an-video-accent;
963
+ pointer-events: none;
964
+
965
+ .an-resize-handle {
966
+ position: absolute;
967
+ width: 8px;
968
+ height: 8px;
969
+ background: $an-video-accent;
970
+ border: 1px solid #fff;
971
+ border-radius: 1px;
972
+ box-sizing: border-box;
973
+ pointer-events: all;
974
+ }
975
+
976
+ // Corners
977
+ .an-resize-nw { top: -4px; left: -4px; cursor: nw-resize; }
978
+ .an-resize-ne { top: -4px; right: -4px; cursor: ne-resize; }
979
+ .an-resize-se { bottom: -4px; right: -4px; cursor: se-resize; }
980
+ .an-resize-sw { bottom: -4px; left: -4px; cursor: sw-resize; }
981
+
982
+ // Edge midpoints
983
+ .an-resize-n { top: -4px; left: calc(50% - 4px); cursor: n-resize; }
984
+ .an-resize-e { top: calc(50% - 4px); right: -4px; cursor: e-resize; }
985
+ .an-resize-s { bottom: -4px; left: calc(50% - 4px); cursor: s-resize; }
986
+ .an-resize-w { top: calc(50% - 4px); left: -4px; cursor: w-resize; }
987
+ }
988
+
989
+ // Selected video wrapper highlight (applied to .an-video-wrapper)
990
+ .an-video-selected {
991
+ outline: 2px solid $an-video-accent;
992
+ outline-offset: 1px;
993
+ }
994
+
995
+ // ---------------------------------------------------------------------------
996
+ // Icon dialog
997
+ // ---------------------------------------------------------------------------
998
+
999
+ // Wider box override
1000
+ .an-icon-box {
1001
+ width: min(596px, 95vw);
1002
+ gap: 0;
1003
+ padding: 20px;
1004
+ }
1005
+
1006
+ // Title row with close button
1007
+ .an-icon-title-row {
1008
+ display: flex;
1009
+ align-items: center;
1010
+ justify-content: space-between;
1011
+ margin-bottom: 14px;
1012
+
1013
+ .an-dialog-title {
1014
+ margin: 0;
1015
+ }
1016
+ }
1017
+
1018
+ .an-icon-close {
1019
+ display: flex;
1020
+ align-items: center;
1021
+ justify-content: center;
1022
+ width: 26px;
1023
+ height: 26px;
1024
+ padding: 0;
1025
+ font-size: 18px;
1026
+ line-height: 1;
1027
+ background: none;
1028
+ border: none;
1029
+ border-radius: $an-radius-sm;
1030
+ cursor: pointer;
1031
+ color: $an-muted;
1032
+ flex-shrink: 0;
1033
+
1034
+ &:hover {
1035
+ background: $an-bg-btn-hover;
1036
+ color: $an-text;
1037
+ }
1038
+ }
1039
+
1040
+ // Search
1041
+ .an-icon-search {
1042
+ width: 100%;
1043
+ margin-bottom: 10px;
1044
+ box-sizing: border-box;
1045
+ }
1046
+
1047
+ // Category tabs
1048
+ .an-icon-cats {
1049
+ display: flex;
1050
+ flex-wrap: wrap;
1051
+ gap: 4px;
1052
+ margin-bottom: 10px;
1053
+ }
1054
+
1055
+ .an-icon-cat {
1056
+ height: 26px;
1057
+ padding: 0 10px;
1058
+ font-size: 12px;
1059
+ font-family: $an-font-family;
1060
+ background: none;
1061
+ border: 1px solid $an-border;
1062
+ border-radius: 13px;
1063
+ cursor: pointer;
1064
+ color: $an-muted;
1065
+ white-space: nowrap;
1066
+ transition: background $an-transition, color $an-transition, border-color $an-transition;
1067
+
1068
+ &:hover {
1069
+ background: $an-bg-btn-hover;
1070
+ color: $an-text;
1071
+ }
1072
+
1073
+ &.active {
1074
+ background: $an-primary;
1075
+ border-color: $an-primary;
1076
+ color: #fff;
1077
+ }
1078
+ }
1079
+
1080
+ // Icon grid
1081
+ .an-icon-grid {
1082
+ display: grid;
1083
+ grid-template-columns: repeat(auto-fill, 56px);
1084
+ gap: 3px;
1085
+ max-height: 256px;
1086
+ overflow-y: auto;
1087
+ margin-bottom: 10px;
1088
+ padding: 4px;
1089
+ border: 1px solid $an-border;
1090
+ border-radius: $an-radius;
1091
+ background: $an-bg;
1092
+ scrollbar-width: thin;
1093
+ scrollbar-color: $an-border transparent;
1094
+
1095
+ &::-webkit-scrollbar { width: 6px; }
1096
+ &::-webkit-scrollbar-track { background: transparent; }
1097
+ &::-webkit-scrollbar-thumb { background: $an-border; border-radius: 3px; }
1098
+ }
1099
+
1100
+ .an-icon-cell {
1101
+ display: flex;
1102
+ flex-direction: column;
1103
+ align-items: center;
1104
+ justify-content: center;
1105
+ gap: 3px;
1106
+ width: 56px;
1107
+ height: 52px;
1108
+ padding: 0;
1109
+ border: 1px solid transparent;
1110
+ border-radius: $an-radius-sm;
1111
+ background: none;
1112
+ cursor: pointer;
1113
+ font-family: $an-font-family;
1114
+ font-size: 10px;
1115
+ color: $an-muted;
1116
+ transition: background $an-transition, border-color $an-transition;
1117
+ overflow: hidden;
1118
+ box-sizing: border-box;
1119
+
1120
+ i {
1121
+ font-size: 17px;
1122
+ color: $an-text;
1123
+ line-height: 1;
1124
+ pointer-events: none;
1125
+ }
1126
+
1127
+ span {
1128
+ overflow: hidden;
1129
+ text-overflow: ellipsis;
1130
+ white-space: nowrap;
1131
+ max-width: 52px;
1132
+ pointer-events: none;
1133
+ }
1134
+
1135
+ &:hover {
1136
+ background: $an-bg-btn-hover;
1137
+ border-color: $an-border;
1138
+ }
1139
+
1140
+ &.active {
1141
+ background: rgba($an-primary, 0.1);
1142
+ border-color: $an-primary;
1143
+ color: $an-primary;
1144
+
1145
+ i { color: $an-primary; }
1146
+ }
1147
+ }
1148
+
1149
+ // Empty state
1150
+ .an-icon-empty {
1151
+ grid-column: 1 / -1;
1152
+ padding: 24px 0;
1153
+ text-align: center;
1154
+ color: $an-muted;
1155
+ font-size: 13px;
1156
+ }
1157
+
1158
+ // Options row
1159
+ .an-icon-options {
1160
+ display: flex;
1161
+ align-items: center;
1162
+ flex-wrap: wrap;
1163
+ gap: 6px 10px;
1164
+ margin-bottom: 10px;
1165
+
1166
+ .an-label {
1167
+ margin: 0;
1168
+ font-size: 12px;
1169
+ white-space: nowrap;
1170
+ }
1171
+ }
1172
+
1173
+ .an-icon-option-select {
1174
+ height: $an-btn-height;
1175
+ padding: 0 6px;
1176
+ font-size: 12px;
1177
+ width: auto;
1178
+ }
1179
+
1180
+ .an-icon-color {
1181
+ width: 32px;
1182
+ height: $an-btn-height;
1183
+ padding: 2px;
1184
+ border: 1px solid $an-border;
1185
+ border-radius: $an-radius-sm;
1186
+ cursor: pointer;
1187
+ background: none;
1188
+ }
1189
+
1190
+ .an-icon-use-color {
1191
+ display: flex;
1192
+ align-items: center;
1193
+ gap: 4px;
1194
+ font-size: 12px;
1195
+ margin: 0;
1196
+ cursor: pointer;
1197
+
1198
+ input[type='checkbox'] {
1199
+ cursor: pointer;
1200
+ }
1201
+ }
1202
+
1203
+ // Preview
1204
+ .an-icon-preview {
1205
+ display: flex;
1206
+ flex-direction: column;
1207
+ align-items: center;
1208
+ justify-content: center;
1209
+ gap: 6px;
1210
+ min-height: 72px;
1211
+ margin-bottom: 14px;
1212
+ padding: 10px 12px;
1213
+ border: 1px solid $an-border;
1214
+ border-radius: $an-radius;
1215
+ background: $an-bg-toolbar;
1216
+
1217
+ i {
1218
+ line-height: 1;
1219
+ }
1220
+
1221
+ .an-icon-preview-hint {
1222
+ font-size: 12px;
1223
+ color: $an-muted;
1224
+ }
1225
+ }
1226
+
1227
+ .an-icon-preview-name {
1228
+ font-size: 12px;
1229
+ color: $an-muted;
1230
+ font-family: monospace;
1231
+ }
1232
+
1233
+ // ---------------------------------------------------------------------------
1234
+ // Emoji dialog
1235
+ // ---------------------------------------------------------------------------
1236
+
1237
+ .an-emoji-box {
1238
+ width: min(520px, 95vw);
1239
+ gap: 0;
1240
+ padding: 20px;
1241
+ }
1242
+
1243
+ .an-emoji-grid {
1244
+ display: grid;
1245
+ grid-template-columns: repeat(auto-fill, 42px);
1246
+ gap: 2px;
1247
+ max-height: 288px;
1248
+ overflow-y: auto;
1249
+ margin-bottom: 10px;
1250
+ padding: 4px;
1251
+ border: 1px solid $an-border;
1252
+ border-radius: $an-radius;
1253
+ scrollbar-width: thin;
1254
+ scrollbar-color: $an-border transparent;
1255
+
1256
+ &::-webkit-scrollbar { width: 6px; }
1257
+ &::-webkit-scrollbar-track { background: transparent; }
1258
+ &::-webkit-scrollbar-thumb { background: $an-border; border-radius: 3px; }
1259
+ }
1260
+
1261
+ .an-emoji-cell {
1262
+ width: 42px;
1263
+ height: 42px;
1264
+ padding: 0;
1265
+ display: flex;
1266
+ align-items: center;
1267
+ justify-content: center;
1268
+ font-size: 22px;
1269
+ line-height: 1;
1270
+ border: 1px solid transparent;
1271
+ border-radius: $an-radius-sm;
1272
+ background: none;
1273
+ cursor: pointer;
1274
+ transition: background $an-transition, border-color $an-transition;
1275
+
1276
+ &:hover {
1277
+ background: $an-bg-btn-hover;
1278
+ border-color: $an-border;
1279
+ }
1280
+
1281
+ &:active {
1282
+ background: $an-bg-btn-active;
1283
+ }
1284
+ }
1285
+
1286
+ // =============================================================================
1287
+ // Sticky toolbar
1288
+ // =============================================================================
1289
+
1290
+ .an-sticky-toolbar {
1291
+ overflow: visible;
1292
+
1293
+ .an-toolbar {
1294
+ position: sticky;
1295
+ top: var(--an-sticky-top, 0px);
1296
+ z-index: 100;
1297
+ border-radius: $an-radius $an-radius 0 0;
1298
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
1299
+ }
1300
+ }
1301
+
1302
+ // =============================================================================
1303
+ // Image caption — figure / figcaption
1304
+ // =============================================================================
1305
+
1306
+ .an-editable {
1307
+ figure.an-figure {
1308
+ display: inline-block;
1309
+ max-width: 100%;
1310
+ margin: 0.75em 0;
1311
+ text-align: center;
1312
+
1313
+ img { display: block; max-width: 100%; }
1314
+ }
1315
+
1316
+ figcaption.an-figcaption {
1317
+ font-size: 0.85em;
1318
+ font-style: italic;
1319
+ color: $an-muted;
1320
+ padding: 4px 0 2px;
1321
+ text-align: center;
1322
+ line-height: 1.4;
1323
+ min-width: 60px;
1324
+ outline: none;
1325
+
1326
+ &:focus {
1327
+ background: rgba($an-primary, 0.06);
1328
+ border-radius: 2px;
1329
+ }
1330
+ }
1331
+ }
1332
+
1333
+ // =============================================================================
1334
+ // Keyboard shortcuts dialog
1335
+ // =============================================================================
1336
+
1337
+ .an-shortcuts-box {
1338
+ width: min(480px, 95vw);
1339
+ max-height: 80vh;
1340
+ overflow-y: auto;
1341
+ }
1342
+
1343
+ .an-shortcuts-cat {
1344
+ font-size: 11px;
1345
+ font-weight: 600;
1346
+ text-transform: uppercase;
1347
+ letter-spacing: 0.06em;
1348
+ color: $an-muted;
1349
+ padding: 8px 0 4px;
1350
+ border-bottom: 1px solid $an-border;
1351
+ margin-bottom: 2px;
1352
+
1353
+ & + .an-shortcuts-table + & {
1354
+ margin-top: 10px;
1355
+ }
1356
+ }
1357
+
1358
+ .an-shortcuts-table {
1359
+ display: flex;
1360
+ flex-direction: column;
1361
+ }
1362
+
1363
+ .an-shortcuts-row {
1364
+ display: flex;
1365
+ align-items: center;
1366
+ justify-content: space-between;
1367
+ padding: 5px 4px;
1368
+ border-radius: $an-radius-sm;
1369
+
1370
+ &:hover { background: $an-bg-btn-hover; }
1371
+ }
1372
+
1373
+ .an-shortcuts-key {
1374
+ font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
1375
+ font-size: 12px;
1376
+ color: $an-text;
1377
+ background: $an-bg-toolbar;
1378
+ border: 1px solid $an-border;
1379
+ border-bottom-width: 2px;
1380
+ border-radius: $an-radius-sm;
1381
+ padding: 2px 8px;
1382
+ white-space: nowrap;
1383
+ flex-shrink: 0;
1384
+ }
1385
+
1386
+ .an-shortcuts-action {
1387
+ font-size: 13px;
1388
+ color: $an-text;
1389
+ flex: 1;
1390
+ padding-left: 14px;
1391
+ }
1392
+
1393
+ // =============================================================================
1394
+ // Code block language selector (inside CodeTooltip)
1395
+ // =============================================================================
1396
+
1397
+ .an-code-lang-select {
1398
+ height: 22px;
1399
+ padding: 0 20px 0 6px;
1400
+ border: 1px solid $an-border;
1401
+ border-radius: $an-radius-sm;
1402
+ font-family: inherit;
1403
+ font-size: 11px;
1404
+ color: $an-text;
1405
+ background: $an-bg url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 5px center;
1406
+ background-size: 6px 4px;
1407
+ appearance: none;
1408
+ -webkit-appearance: none;
1409
+ cursor: pointer;
1410
+
1411
+ &:focus { outline: none; border-color: $an-primary; }
1412
+ &:hover { border-color: $an-primary; }
1413
+ }
1414
+
1415
+ // =============================================================================
1416
+ // Dark theme — apply via options: { theme: 'dark' }
1417
+ // =============================================================================
1418
+
1419
+ .an-theme-dark {
1420
+ border-color: #3f3f5f;
1421
+ background: #1e1e2e;
1422
+ color: #cdd6f4;
1423
+
1424
+ &.an-focused {
1425
+ border-color: #89b4fa;
1426
+ box-shadow: 0 0 0 3px rgba(#89b4fa, 0.2);
1427
+ }
1428
+
1429
+ .an-toolbar {
1430
+ background: #181825;
1431
+ border-color: #3f3f5f;
1432
+ }
1433
+
1434
+ .an-btn {
1435
+ color: #cdd6f4;
1436
+
1437
+ &:hover {
1438
+ background: #2a2a3e;
1439
+ border-color: #3f3f5f;
1440
+ color: #cdd6f4;
1441
+
1442
+ svg { stroke: #cdd6f4; }
1443
+ }
1444
+
1445
+ &.active {
1446
+ background: #1a3a5c;
1447
+ border-color: #89b4fa;
1448
+ color: #89b4fa;
1449
+
1450
+ svg { stroke: #89b4fa; }
1451
+ }
1452
+
1453
+ &.an-btn-primary {
1454
+ background: #3b5bdb;
1455
+ border-color: #3b5bdb;
1456
+ color: #fff;
1457
+ }
1458
+ }
1459
+
1460
+ .an-select {
1461
+ background-color: #1e1e2e;
1462
+ border-color: #3f3f5f;
1463
+ color: #cdd6f4;
1464
+
1465
+ &:hover, &:focus { border-color: #89b4fa; }
1466
+ }
1467
+
1468
+ .an-editable {
1469
+ background: #1e1e2e;
1470
+ color: #cdd6f4;
1471
+
1472
+ a { color: #89b4fa; }
1473
+
1474
+ blockquote {
1475
+ border-color: #3f3f5f;
1476
+ color: #a6adc8;
1477
+ }
1478
+
1479
+ pre:not([class*='language-']),
1480
+ code:not([class*='language-']) {
1481
+ background: #313244;
1482
+ color: #cdd6f4;
1483
+ }
1484
+
1485
+ hr { border-color: #3f3f5f; }
1486
+
1487
+ table, .an-table {
1488
+ td, th { border-color: #3f3f5f; }
1489
+ th { background: #313244; }
1490
+ }
1491
+
1492
+ &.an-placeholder::before { color: #6c7086; }
1493
+
1494
+ figcaption.an-figcaption { color: #6c7086; }
1495
+ }
1496
+
1497
+ .an-statusbar {
1498
+ background: #181825;
1499
+ border-color: #3f3f5f;
1500
+ color: #6c7086;
1501
+ }
1502
+
1503
+ .an-link-tooltip,
1504
+ .an-contextmenu {
1505
+ background: #24273a;
1506
+ border-color: #3f3f5f;
1507
+ color: #cdd6f4;
1508
+ }
1509
+
1510
+ .an-link-tooltip-url { color: #89b4fa; }
1511
+
1512
+ .an-link-tooltip-btn {
1513
+ color: #a6adc8;
1514
+
1515
+ &:hover {
1516
+ background: #2a2a3e;
1517
+ color: #cdd6f4;
1518
+ }
1519
+ }
1520
+
1521
+ .an-dialog-overlay { background: rgba(0, 0, 0, 0.65); }
1522
+
1523
+ .an-dialog-box {
1524
+ background: #24273a;
1525
+ color: #cdd6f4;
1526
+ border: 1px solid #3f3f5f;
1527
+ }
1528
+
1529
+ .an-dialog-title { color: #cdd6f4; }
1530
+
1531
+ .an-label { color: #cdd6f4; }
1532
+
1533
+ .an-input {
1534
+ background: #313244;
1535
+ border-color: #3f3f5f;
1536
+ color: #cdd6f4;
1537
+
1538
+ &:focus {
1539
+ border-color: #89b4fa;
1540
+ box-shadow: 0 0 0 3px rgba(#89b4fa, 0.15);
1541
+ }
1542
+ }
1543
+
1544
+ .an-shortcuts-key {
1545
+ background: #313244;
1546
+ border-color: #3f3f5f;
1547
+ color: #cdd6f4;
1548
+ }
1549
+
1550
+ .an-shortcuts-action { color: #cdd6f4; }
1551
+ .an-shortcuts-row:hover { background: #2a2a3e; }
1552
+
1553
+ .an-shortcuts-cat {
1554
+ border-color: #3f3f5f;
1555
+ color: #a6adc8;
1556
+ }
1557
+
1558
+ .an-code-lang-select {
1559
+ background-color: #24273a;
1560
+ border-color: #3f3f5f;
1561
+ color: #cdd6f4;
1562
+ }
1563
+
1564
+ .an-color-popup,
1565
+ .an-table-picker-popup,
1566
+ .an-size-popover {
1567
+ background: #24273a;
1568
+ border-color: #3f3f5f;
1569
+ color: #cdd6f4;
1570
+ }
1571
+
1572
+ .an-table-cell {
1573
+ background: #24273a;
1574
+ border-color: #3f3f5f;
1575
+ }
1576
+
1577
+ .an-context-item { color: #cdd6f4; }
1578
+ .an-context-sep { background: #3f3f5f; }
1579
+
1580
+ .an-icon-cat {
1581
+ border-color: #3f3f5f;
1582
+ color: #a6adc8;
1583
+
1584
+ &.active {
1585
+ background: #3b5bdb;
1586
+ border-color: #3b5bdb;
1587
+ color: #fff;
1588
+ }
1589
+ }
1590
+
1591
+ .an-icon-search {
1592
+ border-color: #3f3f5f;
1593
+ background: #313244;
1594
+ color: #cdd6f4;
1595
+ }
1596
+
1597
+ .an-icon-cell {
1598
+ color: #cdd6f4;
1599
+
1600
+ &:hover { background: #2a2a3e; }
1601
+ }
1602
+
1603
+ .an-icon-close {
1604
+ color: #a6adc8;
1605
+
1606
+ &:hover {
1607
+ background: #2a2a3e;
1608
+ color: #cdd6f4;
1609
+ }
1610
+ }
1611
+ }
1612
+
1613
+
1614
+ // =============================================================================
1615
+ // Toolbar overflow modes
1616
+ // =============================================================================
1617
+
1618
+ // Default: flex-wrap:wrap (already set on .an-toolbar).
1619
+ // When toolbarOverflow:'scroll', the consumer adds .an-toolbar-overflow-scroll
1620
+ // to the container; toolbar becomes a single horizontally scrollable row.
1621
+ .an-toolbar-overflow-scroll {
1622
+ .an-toolbar {
1623
+ flex-wrap: nowrap;
1624
+ overflow-x: auto;
1625
+ scrollbar-width: thin;
1626
+
1627
+ // WebKit scrollbar - kept minimal
1628
+ &::-webkit-scrollbar {
1629
+ height: 4px;
1630
+ }
1631
+ &::-webkit-scrollbar-thumb {
1632
+ background: $an-border;
1633
+ border-radius: 2px;
1634
+ }
1635
+ }
1636
+ }
1637
+
1638
+ // =============================================================================
1639
+ // RTL support
1640
+ // =============================================================================
1641
+
1642
+ .an-dir-rtl {
1643
+ .an-toolbar {
1644
+ direction: rtl;
1645
+ }
1646
+ }
1647
+
1648
+ .an-editable[dir='rtl'] {
1649
+ text-align: right;
1650
+ }
1651
+
1652
+ // =============================================================================
1653
+ // Status-bar count warnings
1654
+ // =============================================================================
1655
+
1656
+ .an-count-warn {
1657
+ color: #f59e0b; // amber-400 — approaching limit
1658
+ font-weight: 600;
1659
+ }
1660
+
1661
+ .an-count-exceeded {
1662
+ color: #ef4444; // red-500 — over limit
1663
+ font-weight: 700;
1664
+ }
1665
+
1666
+ // =============================================================================
1667
+ // Checklist (task list)
1668
+ // =============================================================================
1669
+
1670
+ .an-editable {
1671
+ ul.an-checklist {
1672
+ list-style: none;
1673
+ padding-left: 0.5em;
1674
+ margin: 0.5em 0;
1675
+
1676
+ li {
1677
+ display: flex;
1678
+ align-items: baseline;
1679
+ gap: 6px;
1680
+ padding: 2px 0;
1681
+ line-height: inherit;
1682
+
1683
+ input[type='checkbox'] {
1684
+ flex-shrink: 0;
1685
+ width: 14px;
1686
+ height: 14px;
1687
+ margin: 0;
1688
+ cursor: pointer;
1689
+ accent-color: $an-primary;
1690
+ position: relative;
1691
+ top: 2px;
1692
+ }
1693
+
1694
+ // Checked item: dim + strike-through the text node
1695
+ &:has(input[type='checkbox']:checked) {
1696
+ color: $an-muted;
1697
+ text-decoration: line-through;
1698
+ }
1699
+ }
1700
+ }
1701
+ }
1702
+
1703
+ .an-theme-dark .an-editable ul.an-checklist li:has(input[type='checkbox']:checked) {
1704
+ color: $an-dark-muted;
1705
+ }
1706
+
1707
+ // =============================================================================
1708
+ // Print styles
1709
+ // =============================================================================
1710
+
1711
+ @media print {
1712
+ .an-container {
1713
+ border: none;
1714
+ box-shadow: none;
1715
+ contain: none; // allow natural page flow when printing
1716
+ }
1717
+
1718
+ .an-toolbar,
1719
+ .an-statusbar {
1720
+ display: none !important;
1721
+ }
1722
+
1723
+ .an-editable {
1724
+ overflow: visible;
1725
+ height: auto !important;
1726
+ max-height: none !important;
1727
+ padding: 0;
1728
+ color: #000;
1729
+ background: #fff;
1730
+ }
1731
+
1732
+ .an-video-wrapper .an-video-shield {
1733
+ display: none; // allow clicking embedded media when printing is unlikely
1734
+ }
1735
+
1736
+ .an-image-resizer,
1737
+ .an-video-resizer {
1738
+ display: none !important;
1739
+ }
1740
+ }