editium 1.0.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.
@@ -0,0 +1,772 @@
1
+ /**
2
+ * Editium - Vanilla JavaScript Rich Text Editor Styles
3
+ * Matches the React version UI
4
+ */
5
+
6
+ /* Main container */
7
+ .editium-wrapper {
8
+ border: 1px solid #ccc;
9
+ border-radius: 4px;
10
+ background-color: #ffffff;
11
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
12
+ display: flex;
13
+ flex-direction: column;
14
+ overflow: hidden;
15
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
16
+ }
17
+
18
+ /* Fullscreen mode */
19
+ .editium-fullscreen {
20
+ position: fixed;
21
+ top: 0;
22
+ left: 0;
23
+ right: 0;
24
+ bottom: 0;
25
+ width: 100vw;
26
+ height: 100vh;
27
+ z-index: 9999;
28
+ border-radius: 0;
29
+ margin: 0;
30
+ }
31
+
32
+ /* Block body scroll when in fullscreen mode */
33
+ body.editium-fullscreen-active {
34
+ overflow: hidden;
35
+ }
36
+
37
+ /* Toolbar */
38
+ .editium-toolbar {
39
+ display: flex;
40
+ flex-wrap: wrap;
41
+ gap: 4px;
42
+ padding: 12px;
43
+ background-color: #f8f9fa;
44
+ border-bottom: 1px solid #ccc;
45
+ border-radius: 4px 4px 0 0;
46
+ align-items: center;
47
+ }
48
+
49
+ .editium-toolbar-button {
50
+ background-color: transparent;
51
+ border: none;
52
+ border-radius: 3px;
53
+ padding: 5px 8px;
54
+ cursor: pointer;
55
+ font-size: 14px;
56
+ font-weight: 400;
57
+ color: #222f3e;
58
+ transition: background-color 0.1s ease;
59
+ display: inline-flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+ gap: 4px;
63
+ min-width: 28px;
64
+ min-height: 28px;
65
+ line-height: 1;
66
+ white-space: nowrap;
67
+ }
68
+
69
+ .editium-toolbar-button i {
70
+ font-size: 14px;
71
+ width: 14px;
72
+ height: 14px;
73
+ display: inline-flex;
74
+ align-items: center;
75
+ justify-content: center;
76
+ }
77
+
78
+ .editium-toolbar-button:hover {
79
+ background-color: #e9ecef;
80
+ }
81
+
82
+ .editium-toolbar-button:active,
83
+ .editium-toolbar-button.active {
84
+ background-color: #dee2e6;
85
+ }
86
+
87
+ .editium-toolbar-button strong,
88
+ .editium-toolbar-button em,
89
+ .editium-toolbar-button u,
90
+ .editium-toolbar-button s {
91
+ pointer-events: none;
92
+ }
93
+
94
+ .editium-toolbar-separator {
95
+ width: 1px;
96
+ height: 24px;
97
+ background-color: #ccc;
98
+ margin: 0 4px;
99
+ align-self: center;
100
+ }
101
+
102
+ /* Dropdown */
103
+ .editium-dropdown {
104
+ position: relative;
105
+ display: inline-block;
106
+ }
107
+
108
+ .editium-dropdown-trigger {
109
+ display: inline-flex;
110
+ align-items: center;
111
+ gap: 4px;
112
+ }
113
+
114
+ .editium-dropdown-trigger::after {
115
+ content: '▼';
116
+ font-size: 8px;
117
+ margin-left: 2px;
118
+ opacity: 0.6;
119
+ }
120
+
121
+ .editium-dropdown-menu {
122
+ display: none;
123
+ position: absolute;
124
+ top: 100%;
125
+ left: 0;
126
+ background-color: #ffffff;
127
+ border: 1px solid #ccc;
128
+ border-radius: 3px;
129
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
130
+ margin-top: 4px;
131
+ min-width: 180px;
132
+ z-index: 9999;
133
+ padding: 4px 0;
134
+ overflow: hidden;
135
+ }
136
+
137
+ .editium-dropdown-menu.show {
138
+ display: block;
139
+ }
140
+
141
+ .editium-dropdown-menu button {
142
+ display: flex;
143
+ align-items: center;
144
+ gap: 10px;
145
+ width: 100%;
146
+ padding: 6px 16px;
147
+ border: none;
148
+ background: none;
149
+ text-align: left;
150
+ cursor: pointer;
151
+ font-size: 14px;
152
+ font-weight: 400;
153
+ color: #222f3e;
154
+ transition: background-color 0.1s ease;
155
+ border-radius: 0;
156
+ }
157
+
158
+ .editium-dropdown-menu button i {
159
+ font-size: 14px;
160
+ width: 16px;
161
+ display: inline-flex;
162
+ align-items: center;
163
+ justify-content: center;
164
+ }
165
+
166
+ .editium-dropdown-menu button:hover {
167
+ background-color: #e7f4ff;
168
+ }
169
+
170
+ .editium-dropdown-menu button.active {
171
+ background-color: #e7f4ff;
172
+ }
173
+
174
+ .editium-dropdown-menu button i {
175
+ width: 16px;
176
+ text-align: center;
177
+ margin-right: 4px;
178
+ }
179
+
180
+ .editium-dropdown-menu button span {
181
+ flex: 1;
182
+ text-align: left;
183
+ }
184
+
185
+ /* Editor container */
186
+ .editium-editor-container {
187
+ position: relative;
188
+ flex: 1;
189
+ display: flex;
190
+ flex-direction: column;
191
+ overflow: hidden;
192
+ }
193
+
194
+ /* Fullscreen editor container should allow scrolling */
195
+ .editium-fullscreen .editium-editor-container {
196
+ overflow: auto;
197
+ }
198
+
199
+ /* Editor area */
200
+ .editium-editor {
201
+ flex: 1;
202
+ padding: 16px;
203
+ /* Height, min-height, and max-height are set via inline styles from options */
204
+ outline: none;
205
+ font-size: 14px;
206
+ line-height: 1.6;
207
+ color: #000;
208
+ overflow-y: auto;
209
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
210
+ }
211
+
212
+ /* In fullscreen mode, ensure editor takes full available space */
213
+ .editium-fullscreen .editium-editor {
214
+ height: 100% !important;
215
+ min-height: unset !important;
216
+ max-height: unset !important;
217
+ }
218
+
219
+ .editium-editor:empty:before {
220
+ content: attr(data-placeholder);
221
+ color: #999;
222
+ pointer-events: none;
223
+ position: absolute;
224
+ }
225
+
226
+ /* Content styles - Match React version exactly */
227
+ .editium-editor h1,
228
+ .editium-editor h2,
229
+ .editium-editor h3,
230
+ .editium-editor h4,
231
+ .editium-editor h5,
232
+ .editium-editor h6 {
233
+ margin: 0;
234
+ font-weight: normal;
235
+ }
236
+
237
+ .editium-editor h1 {
238
+ font-size: 2em;
239
+ font-weight: bold;
240
+ }
241
+
242
+ .editium-editor h2 {
243
+ font-size: 1.5em;
244
+ font-weight: bold;
245
+ }
246
+
247
+ .editium-editor h3 {
248
+ font-size: 1.25em;
249
+ font-weight: bold;
250
+ }
251
+
252
+ .editium-editor h4 {
253
+ font-size: 1.1em;
254
+ font-weight: bold;
255
+ }
256
+
257
+ .editium-editor h5 {
258
+ font-size: 1em;
259
+ font-weight: bold;
260
+ }
261
+
262
+ .editium-editor h6 {
263
+ font-size: 0.9em;
264
+ font-weight: bold;
265
+ }
266
+
267
+ .editium-editor p {
268
+ margin: 0;
269
+ font-weight: normal;
270
+ }
271
+
272
+ .editium-editor blockquote {
273
+ margin: 1em 0;
274
+ padding-left: 1em;
275
+ border-left: 4px solid #dee2e6;
276
+ color: #6c757d;
277
+ font-style: italic;
278
+ }
279
+
280
+ .editium-editor code {
281
+ background-color: #f4f4f4;
282
+ padding: 2px 4px;
283
+ border-radius: 3px;
284
+ font-family: 'Courier New', Courier, monospace;
285
+ font-size: 0.9em;
286
+ }
287
+
288
+ .editium-editor pre {
289
+ background-color: #f4f4f4;
290
+ padding: 10px;
291
+ border-radius: 5px;
292
+ overflow-x: auto;
293
+ margin: 1em 0;
294
+ }
295
+
296
+ .editium-editor pre code {
297
+ background: none;
298
+ padding: 0;
299
+ }
300
+
301
+ .editium-editor ul,
302
+ .editium-editor ol {
303
+ margin: 1em 0;
304
+ padding-left: 2em;
305
+ }
306
+
307
+ .editium-editor li {
308
+ margin: 0.5em 0;
309
+ }
310
+
311
+ .editium-editor a {
312
+ color: #007bff;
313
+ text-decoration: underline;
314
+ cursor: pointer;
315
+ user-select: none;
316
+ -webkit-user-select: none;
317
+ -moz-user-select: none;
318
+ -ms-user-select: none;
319
+ position: relative;
320
+ padding: 2px 4px;
321
+ border-radius: 3px;
322
+ transition: all 0.15s ease;
323
+ display: inline-block;
324
+ }
325
+
326
+ .editium-editor a:hover {
327
+ color: #0056b3;
328
+ background-color: rgba(0, 123, 255, 0.1);
329
+ }
330
+
331
+ /* Visual hint for clickable links */
332
+ .editium-editor a::after {
333
+ content: '';
334
+ position: absolute;
335
+ bottom: 0px;
336
+ left: 0;
337
+ right: 0;
338
+ height: 2px;
339
+ background-color: transparent;
340
+ transition: background-color 0.2s ease;
341
+ }
342
+
343
+ .editium-editor a:hover::after {
344
+ background-color: rgba(0, 123, 255, 0.4);
345
+ }
346
+
347
+ .editium-editor img {
348
+ max-width: 100%;
349
+ height: auto;
350
+ display: block;
351
+ margin: 10px 0;
352
+ }
353
+
354
+ .editium-editor img.resizable {
355
+ cursor: nwse-resize;
356
+ border: 2px solid transparent;
357
+ transition: border-color 0.2s ease;
358
+ position: relative;
359
+ }
360
+
361
+ .editium-editor img.resizable:hover,
362
+ .editium-editor img.resizable:focus {
363
+ border-color: #007bff;
364
+ outline: none;
365
+ }
366
+
367
+ .editium-editor img.resizing {
368
+ border-color: #007bff;
369
+ opacity: 0.8;
370
+ }
371
+
372
+ /* Image wrapper for alignment */
373
+ .editium-image-wrapper {
374
+ margin: 10px 0;
375
+ display: flex;
376
+ position: relative;
377
+ }
378
+
379
+ .editium-image-wrapper.align-left {
380
+ justify-content: flex-start;
381
+ }
382
+
383
+ .editium-image-wrapper.align-center {
384
+ justify-content: center;
385
+ }
386
+
387
+ .editium-image-wrapper.align-right {
388
+ justify-content: flex-end;
389
+ }
390
+
391
+ /* Image toolbar that appears on hover/selection */
392
+ .editium-image-toolbar {
393
+ position: absolute;
394
+ top: 8px;
395
+ right: 8px;
396
+ display: none;
397
+ gap: 4px;
398
+ z-index: 10;
399
+ }
400
+
401
+ .editium-image-wrapper:hover .editium-image-toolbar,
402
+ .editium-image-wrapper.selected .editium-image-toolbar {
403
+ display: flex;
404
+ }
405
+
406
+ .editium-image-toolbar-group {
407
+ display: flex;
408
+ gap: 4px;
409
+ background-color: #ffffff;
410
+ border: 1px solid #d1d5db;
411
+ border-radius: 4px;
412
+ padding: 4px;
413
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
414
+ }
415
+
416
+ .editium-image-toolbar button {
417
+ padding: 4px 8px;
418
+ background-color: transparent;
419
+ border: none;
420
+ border-radius: 2px;
421
+ color: #374151;
422
+ font-size: 12px;
423
+ font-weight: 500;
424
+ cursor: pointer;
425
+ transition: all 0.15s ease;
426
+ min-width: 28px;
427
+ height: 28px;
428
+ display: flex;
429
+ align-items: center;
430
+ justify-content: center;
431
+ }
432
+
433
+ .editium-image-toolbar button:hover {
434
+ background-color: #f9fafb;
435
+ }
436
+
437
+ .editium-image-toolbar button.active {
438
+ background-color: #e0f2fe;
439
+ }
440
+
441
+ .editium-editor hr {
442
+ border: none;
443
+ border-top: 2px solid #dee2e6;
444
+ margin: 2em 0;
445
+ }
446
+
447
+ .editium-editor table {
448
+ border-collapse: collapse;
449
+ width: 100%;
450
+ margin: 1em 0;
451
+ }
452
+
453
+ .editium-editor table th,
454
+ .editium-editor table td {
455
+ border: 1px solid #dee2e6;
456
+ padding: 8px 12px;
457
+ text-align: left;
458
+ }
459
+
460
+ .editium-editor table th {
461
+ background-color: #f8f9fa;
462
+ font-weight: 600;
463
+ }
464
+
465
+ .editium-editor table tr:nth-child(even) {
466
+ background-color: #f8f9fa;
467
+ }
468
+
469
+ /* Search highlighting */
470
+ .editium-search-match {
471
+ background-color: #ffeb3b;
472
+ color: #000000;
473
+ padding: 2px 4px;
474
+ border-radius: 2px;
475
+ }
476
+
477
+ .editium-search-current {
478
+ background-color: #ff9800;
479
+ color: #ffffff;
480
+ padding: 2px 4px;
481
+ border-radius: 2px;
482
+ font-weight: 600;
483
+ }
484
+
485
+ /* Find & Replace Panel */
486
+ .editium-find-replace {
487
+ background-color: #f9fafb;
488
+ border: 1px solid #ccc;
489
+ border-top: none;
490
+ border-radius: 0 0 4px 4px;
491
+ padding: 16px;
492
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
493
+ }
494
+
495
+ .editium-find-replace-row {
496
+ display: flex;
497
+ gap: 8px;
498
+ margin-bottom: 8px;
499
+ align-items: center;
500
+ }
501
+
502
+ .editium-find-replace-row:last-child {
503
+ margin-bottom: 0;
504
+ }
505
+
506
+ .editium-find-input,
507
+ .editium-replace-input {
508
+ flex: 1;
509
+ padding: 6px 10px;
510
+ border: 1px solid #ced4da;
511
+ border-radius: 4px;
512
+ font-size: 14px;
513
+ outline: none;
514
+ }
515
+
516
+ .editium-find-input:focus,
517
+ .editium-replace-input:focus {
518
+ border-color: #80bdff;
519
+ box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
520
+ }
521
+
522
+ .editium-find-replace button {
523
+ padding: 6px 12px;
524
+ border: 1px solid #ced4da;
525
+ border-radius: 4px;
526
+ background-color: #ffffff;
527
+ cursor: pointer;
528
+ font-size: 14px;
529
+ transition: background-color 0.15s ease;
530
+ }
531
+
532
+ .editium-find-replace button:hover {
533
+ background-color: #e9ecef;
534
+ }
535
+
536
+ .editium-match-count {
537
+ font-size: 14px;
538
+ color: #6c757d;
539
+ white-space: nowrap;
540
+ }
541
+
542
+ .editium-btn-prev,
543
+ .editium-btn-next {
544
+ min-width: 32px;
545
+ }
546
+
547
+ .editium-btn-close {
548
+ background-color: transparent;
549
+ border: none;
550
+ font-size: 18px;
551
+ color: #6c757d;
552
+ cursor: pointer;
553
+ padding: 0 8px;
554
+ }
555
+
556
+ .editium-btn-close:hover {
557
+ color: #dc3545;
558
+ }
559
+
560
+ /* Word count */
561
+ .editium-word-count {
562
+ padding: 8px 16px;
563
+ background-color: #f8f9fa;
564
+ border-top: 1px solid #ccc;
565
+ border-radius: 0 0 4px 4px;
566
+ font-size: 12px;
567
+ color: #666;
568
+ text-align: right;
569
+ display: flex;
570
+ justify-content: flex-end;
571
+ gap: 16px;
572
+ }
573
+
574
+ .editium-word-count strong {
575
+ color: #000;
576
+ font-weight: 500;
577
+ }
578
+
579
+ /* Modal */
580
+ .editium-modal {
581
+ position: fixed;
582
+ top: 0;
583
+ left: 0;
584
+ right: 0;
585
+ bottom: 0;
586
+ background-color: rgba(0, 0, 0, 0.5);
587
+ display: flex;
588
+ align-items: center;
589
+ justify-content: center;
590
+ z-index: 10000;
591
+ padding: 20px;
592
+ }
593
+
594
+ .editium-modal-content {
595
+ background-color: #ffffff;
596
+ border-radius: 8px;
597
+ box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
598
+ max-width: 800px;
599
+ max-height: 90vh;
600
+ width: 100%;
601
+ display: flex;
602
+ flex-direction: column;
603
+ overflow: hidden;
604
+ }
605
+
606
+ .editium-modal-content.editium-preview {
607
+ max-width: 1200px;
608
+ }
609
+
610
+ .editium-modal-header {
611
+ padding: 16px 20px;
612
+ border-bottom: 1px solid #e0e0e0;
613
+ display: flex;
614
+ justify-content: space-between;
615
+ align-items: center;
616
+ }
617
+
618
+ .editium-modal-header h3 {
619
+ margin: 0;
620
+ font-size: 18px;
621
+ font-weight: 600;
622
+ color: #222f3e;
623
+ }
624
+
625
+ .editium-modal-close {
626
+ background: none;
627
+ border: none;
628
+ font-size: 24px;
629
+ color: #6c757d;
630
+ cursor: pointer;
631
+ padding: 0;
632
+ width: 32px;
633
+ height: 32px;
634
+ display: flex;
635
+ align-items: center;
636
+ justify-content: center;
637
+ border-radius: 4px;
638
+ transition: background-color 0.15s ease;
639
+ }
640
+
641
+ .editium-modal-close:hover {
642
+ background-color: #f8f9fa;
643
+ color: #dc3545;
644
+ }
645
+
646
+ .editium-modal-body {
647
+ flex: 1;
648
+ padding: 20px;
649
+ overflow: auto;
650
+ }
651
+
652
+ .editium-modal-body pre {
653
+ background-color: #f8f9fa;
654
+ padding: 15px;
655
+ border-radius: 4px;
656
+ overflow-x: auto;
657
+ margin: 0;
658
+ }
659
+
660
+ .editium-modal-body code {
661
+ font-family: 'Courier New', Courier, monospace;
662
+ font-size: 13px;
663
+ line-height: 1.5;
664
+ color: #222f3e;
665
+ }
666
+
667
+ .editium-modal-footer {
668
+ padding: 16px 20px;
669
+ border-top: 1px solid #e0e0e0;
670
+ display: flex;
671
+ justify-content: flex-end;
672
+ gap: 10px;
673
+ }
674
+
675
+ .editium-btn-copy {
676
+ padding: 8px 16px;
677
+ border: 1px solid #007bff;
678
+ border-radius: 4px;
679
+ background-color: #007bff;
680
+ color: #ffffff;
681
+ cursor: pointer;
682
+ font-size: 14px;
683
+ font-weight: 500;
684
+ transition: background-color 0.15s ease;
685
+ }
686
+
687
+ .editium-btn-copy:hover {
688
+ background-color: #0056b3;
689
+ border-color: #0056b3;
690
+ }
691
+
692
+ /* Word count */
693
+ .editium-word-count {
694
+ display: flex;
695
+ justify-content: space-between;
696
+ align-items: center;
697
+ padding: 8px 12px;
698
+ background-color: #f8f9fa;
699
+ border-top: 1px solid #ccc;
700
+ font-size: 12px;
701
+ color: #6c757d;
702
+ border-radius: 0 0 4px 4px;
703
+ }
704
+
705
+ /* When only branding is shown (no stats) */
706
+ .editium-word-count:has(.editium-word-count-branding:only-child) {
707
+ justify-content: flex-end;
708
+ }
709
+
710
+ .editium-word-count-stats {
711
+ text-align: left;
712
+ display: flex;
713
+ gap: 16px;
714
+ }
715
+
716
+ .editium-word-count-branding {
717
+ text-align: right;
718
+ color: #6c757d;
719
+ }
720
+
721
+ .editium-word-count-branding .editium-brand {
722
+ color: #4f88f7;
723
+ font-weight: 500;
724
+ text-decoration: none;
725
+ cursor: pointer;
726
+ transition: color 0.2s ease;
727
+ }
728
+
729
+ .editium-word-count-branding .editium-brand:hover {
730
+ color: #3b6fd9;
731
+ }
732
+
733
+ /* Responsive */
734
+ @media (max-width: 768px) {
735
+ .editium-toolbar {
736
+ padding: 8px;
737
+ gap: 2px;
738
+ }
739
+
740
+ .editium-toolbar-button {
741
+ padding: 5px 8px;
742
+ min-width: 28px;
743
+ min-height: 28px;
744
+ font-size: 13px;
745
+ }
746
+
747
+ .editium-editor {
748
+ padding: 15px;
749
+ font-size: 15px;
750
+ }
751
+
752
+ .editium-modal-content {
753
+ max-width: 95%;
754
+ }
755
+ }
756
+
757
+ /* Print styles */
758
+ @media print {
759
+ .editium-toolbar,
760
+ .editium-word-count,
761
+ .editium-find-replace {
762
+ display: none;
763
+ }
764
+
765
+ .editium-wrapper {
766
+ border: none;
767
+ }
768
+
769
+ .editium-editor {
770
+ padding: 0;
771
+ }
772
+ }