@richscripts/richtexteditor 2.4.2 → 2.5.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.
@@ -8,10 +8,12 @@
8
8
  --rte-icon-color: #5F6368; /* toolbar/dialog icon color */
9
9
  --rte-surface: #ffffff; /* editor + panel background */
10
10
  --rte-surface-raised: #ffffff; /* toolbar / status bar background */
11
- --rte-border: #dddddd; /* chrome borders */
11
+ --rte-border: #d0d7de; /* chrome borders */
12
12
  --rte-text: #333333; /* chrome text */
13
13
  --rte-hover-bg: #f2f2f2; /* button hover background */
14
14
  --rte-accent: #1d67ba; /* active/selected accent */
15
+ --rte-shadow: 0 1px 2px rgba(16,24,40,.04), 0 2px 6px rgba(16,24,40,.06); /* container elevation */
16
+ --rte-focus-ring: 0 0 0 3px rgba(29,103,186,.14); /* focus halo */
15
17
  }
16
18
 
17
19
  rte-toolbar-button, rte-toolbar-splitbutton, rte-toolbar-dropdown, rte-toolbar-arrowbutton, rte-toolbar-dropdown-input, rte-toolbar-dropdown-arrow {
@@ -23,16 +25,20 @@ rte-toolbar-button, rte-toolbar-splitbutton, rte-toolbar-dropdown, rte-toolbar-a
23
25
  flex-direction: column !important;
24
26
  position: relative !important;
25
27
  box-sizing: border-box !important;
26
- border: 1px solid #ddd;
27
- background-color: #fff;
28
+ border: 1px solid var(--rte-border, #d0d7de);
29
+ background-color: var(--rte-surface, #fff);
30
+ /* A flat hairline box reads as an unstyled control; a hint of elevation is
31
+ what separates it from the page it sits on. */
32
+ box-shadow: var(--rte-shadow, none);
33
+ transition: border-color .15s ease, box-shadow .15s ease;
28
34
  user-select: none;
29
35
  min-height: 200px;
30
36
  min-width: 200px;
31
- font-family: -apple-system, Helvetica, Arial, sans-serif;
37
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
32
38
  }
33
39
 
34
40
  .richtexteditor, .rte-absolute, .rte-fixed, rte-dropdown-panel {
35
- font-family: -apple-system, Helvetica, Arial, sans-serif;
41
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
36
42
  font-size: 14px;
37
43
  }
38
44
 
@@ -283,11 +289,11 @@ rte-codebox {
283
289
  previously hardcoded #d5d5d5 stayed light-gray on the dark surface. */
284
290
  border: 1px solid var(--rte-border, #d5d5d5);
285
291
  border-radius: 10px;
286
- /* Deliberately NOT overflow:hidden. Toolbar dropdown panels
287
- (rte-dropdown-panel) are absolutely positioned children of this element,
288
- so clipping here cut off any panel anchored near the right edge: Line
289
- Height rendered only the "1" of "100%", Paragraphs and Document Outline
290
- lost 91px. Corner rounding does not depend on this clip - the toolbar and
292
+ /* Deliberately NOT overflow:hidden. Toolbar dropdown panels
293
+ (rte-dropdown-panel) are absolutely positioned children of this element,
294
+ so clipping here cut off any panel anchored near the right edge: Line
295
+ Height rendered only the "1" of "100%", Paragraphs and Document Outline
296
+ lost 91px. Corner rounding does not depend on this clip - the toolbar and
291
297
  status bar round their own corners (see the rule below). */
292
298
  overflow: visible;
293
299
  background-clip: padding-box;
@@ -1435,7 +1441,12 @@ rte-dropdown-panel.rte-panel-insertimage rte-tabui-toolbar, rte-dropdown-panel.r
1435
1441
  }
1436
1442
 
1437
1443
  .rte-panel-general rte-dialog-header {
1438
- margin: -10px -15px 10px;
1444
+ /* Cancel exactly the panel's own padding, whatever it is. A hard -15px
1445
+ here made the header wider than the panel that contains it. */
1446
+ margin: calc(var(--rte-panel-pad, 8px) * -1) calc(var(--rte-panel-pad, 8px) * -1) 10px;
1447
+ padding: 12px 14px;
1448
+ border-top-left-radius: inherit;
1449
+ border-top-right-radius: inherit;
1439
1450
  }
1440
1451
 
1441
1452
  rte-inserttable-panel {
@@ -1576,14 +1587,14 @@ rte-dropdown-panel.rte-panel-backcolor rte-dialog-item-color[rte-tooltip]:hover
1576
1587
  border-color: rgba(0,0,0,.08) !important;
1577
1588
  }
1578
1589
 
1579
- rte-dropdown-panel.rte-panel-forecolor rte-dialog-item-color[role="menuitem"]:focus-visible,
1580
- rte-dropdown-panel.rte-panel-backcolor rte-dialog-item-color[role="menuitem"]:focus-visible {
1581
- outline: 2px solid #1a73e8 !important;
1582
- outline-offset: 2px !important;
1583
- transform: scale(1.15) !important;
1584
- position: relative !important;
1585
- z-index: 2 !important;
1586
- }
1590
+ rte-dropdown-panel.rte-panel-forecolor rte-dialog-item-color[role="menuitem"]:focus-visible,
1591
+ rte-dropdown-panel.rte-panel-backcolor rte-dialog-item-color[role="menuitem"]:focus-visible {
1592
+ outline: 2px solid #1a73e8 !important;
1593
+ outline-offset: 2px !important;
1594
+ transform: scale(1.15) !important;
1595
+ position: relative !important;
1596
+ z-index: 2 !important;
1597
+ }
1587
1598
  rte-dropdown-panel.rte-panel-forecolor rte-dialog-line-auto,
1588
1599
  rte-dropdown-panel.rte-panel-backcolor rte-dialog-line-auto,
1589
1600
  rte-dropdown-panel.rte-panel-forecolor rte-dialog-line-more,
@@ -1605,14 +1616,14 @@ rte-dropdown-panel.rte-panel-backcolor rte-dialog-line-more:hover {
1605
1616
  border: 0 !important;
1606
1617
  }
1607
1618
 
1608
- rte-dropdown-panel.rte-panel-forecolor rte-dialog-line-auto:focus-visible,
1609
- rte-dropdown-panel.rte-panel-backcolor rte-dialog-line-auto:focus-visible,
1610
- rte-dropdown-panel.rte-panel-forecolor rte-dialog-line-more:focus-visible,
1611
- rte-dropdown-panel.rte-panel-backcolor rte-dialog-line-more:focus-visible {
1612
- outline: 2px solid #1a73e8 !important;
1613
- outline-offset: 1px !important;
1614
- background: #f1f5f9 !important;
1615
- }
1619
+ rte-dropdown-panel.rte-panel-forecolor rte-dialog-line-auto:focus-visible,
1620
+ rte-dropdown-panel.rte-panel-backcolor rte-dialog-line-auto:focus-visible,
1621
+ rte-dropdown-panel.rte-panel-forecolor rte-dialog-line-more:focus-visible,
1622
+ rte-dropdown-panel.rte-panel-backcolor rte-dialog-line-more:focus-visible {
1623
+ outline: 2px solid #1a73e8 !important;
1624
+ outline-offset: 1px !important;
1625
+ background: #f1f5f9 !important;
1626
+ }
1616
1627
  rte-dropdown-panel.rte-panel-forecolor rte-dialog-line-auto rte-dialog-item-label,
1617
1628
  rte-dropdown-panel.rte-panel-backcolor rte-dialog-line-auto rte-dialog-item-label,
1618
1629
  rte-dropdown-panel.rte-panel-forecolor rte-dialog-line-more rte-dialog-item-label,
@@ -1992,21 +2003,21 @@ rte-menuspliter {
1992
2003
  margin: 3px 0px 3px 28px;
1993
2004
  }
1994
2005
 
1995
- /* The panel is shrink-to-fit, so its width is decided by its widest preview —
1996
- "Headline 1" at 32px — and measured 187px of text inside 187px of space:
1997
- ZERO tolerance. Whenever the font used at layout time is a hair narrower than
1998
- the one finally painted (a fallback still in place during a webfont swap, a
1999
- different platform's metrics), the label overflows and the last character is
2000
- cut off. Reported from the wild with "Headline 1" clipped.
2001
-
2002
- A min-width gives the panel slack that does not depend on font metrics
2003
- matching to the pixel; the previews are nowrap, so slack is the only thing
2004
- that can absorb the variance. */
2005
- .rte-dropdown-panel.rte_command_paragraphs,
2006
- rte-dropdown-panel.rte_command_paragraphs {
2007
- min-width: 292px;
2008
- }
2009
-
2006
+ /* The panel is shrink-to-fit, so its width is decided by its widest preview —
2007
+ "Headline 1" at 32px — and measured 187px of text inside 187px of space:
2008
+ ZERO tolerance. Whenever the font used at layout time is a hair narrower than
2009
+ the one finally painted (a fallback still in place during a webfont swap, a
2010
+ different platform's metrics), the label overflows and the last character is
2011
+ cut off. Reported from the wild with "Headline 1" clipped.
2012
+
2013
+ A min-width gives the panel slack that does not depend on font metrics
2014
+ matching to the pixel; the previews are nowrap, so slack is the only thing
2015
+ that can absorb the variance. */
2016
+ .rte-dropdown-panel.rte_command_paragraphs,
2017
+ rte-dropdown-panel.rte_command_paragraphs {
2018
+ min-width: 292px;
2019
+ }
2020
+
2010
2021
  .rte_command_paragraphs rte-toolbar-dropdown-item div {
2011
2022
  font-size: 15px;
2012
2023
  margin: 0px;
@@ -2388,6 +2399,31 @@ rte-content::-webkit-scrollbar-thumb:hover {
2388
2399
  }
2389
2400
 
2390
2401
  .rte-dialog-browser,
2402
+ /* Upload failure notice. Deliberately a banner above the grid rather than a
2403
+ replacement for it: a rejected file used to blank the whole browser, leaving
2404
+ the dialog reading "0 items" with an error while the footer still said an
2405
+ image was ready to insert. */
2406
+ .rte-gallery-browser-error {
2407
+ display: flex;
2408
+ align-items: flex-start;
2409
+ gap: 8px;
2410
+ margin-bottom: 10px;
2411
+ padding: 10px 12px;
2412
+ border-radius: 10px;
2413
+ font-size: 13px;
2414
+ line-height: 1.5;
2415
+ color: #9f1239;
2416
+ background: #fff1f2;
2417
+ box-shadow: inset 0 0 0 1px rgba(190, 18, 60, 0.18);
2418
+ }
2419
+
2420
+ /* Accepted-format hint under the dialog subtitle. */
2421
+ .rte-dialog-browser-accept {
2422
+ margin-top: 4px;
2423
+ font-size: 12px;
2424
+ color: #64748b;
2425
+ }
2426
+
2391
2427
  .rte-gallery-browser {
2392
2428
  display: flex;
2393
2429
  flex-direction: column;
@@ -2580,25 +2616,25 @@ rte-content::-webkit-scrollbar-thumb:hover {
2580
2616
  flex-wrap: wrap;
2581
2617
  }
2582
2618
 
2583
- /* The toolbar is a flex row whose children are these two groups. Without a
2584
- display on the groups themselves the buttons stack vertically and the row
2585
- collapses to the width of its widest label -- which is exactly what shipped
2586
- when these rules went missing. */
2587
- .rte-gallery-browser-toolbar-group {
2588
- display: flex;
2589
- align-items: center;
2590
- gap: 8px;
2591
- min-width: 0;
2592
- flex: 1 1 auto;
2593
- flex-wrap: wrap;
2594
- }
2595
-
2596
- .rte-gallery-browser-toolbar-group-right {
2597
- flex: 0 1 auto;
2598
- justify-content: flex-end;
2599
- margin-left: auto;
2600
- }
2601
-
2619
+ /* The toolbar is a flex row whose children are these two groups. Without a
2620
+ display on the groups themselves the buttons stack vertically and the row
2621
+ collapses to the width of its widest label -- which is exactly what shipped
2622
+ when these rules went missing. */
2623
+ .rte-gallery-browser-toolbar-group {
2624
+ display: flex;
2625
+ align-items: center;
2626
+ gap: 8px;
2627
+ min-width: 0;
2628
+ flex: 1 1 auto;
2629
+ flex-wrap: wrap;
2630
+ }
2631
+
2632
+ .rte-gallery-browser-toolbar-group-right {
2633
+ flex: 0 1 auto;
2634
+ justify-content: flex-end;
2635
+ margin-left: auto;
2636
+ }
2637
+
2602
2638
  .rte-gallery-browser-button {
2603
2639
  border: 1px solid rgba(116, 135, 162, 0.28);
2604
2640
  border-radius: 999px;
@@ -2733,44 +2769,44 @@ rte-content::-webkit-scrollbar-thumb:hover {
2733
2769
  overflow: hidden;
2734
2770
  }
2735
2771
 
2736
- /* Folders sit in their own container above the image listbox, so the two are
2737
- separated by a rule rather than running together in one grid. */
2738
- .rte-gallery-browser-grid-folders {
2739
- margin-bottom: 14px;
2740
- padding-bottom: 14px;
2741
- border-bottom: 1px solid rgba(116, 135, 162, 0.16);
2742
- }
2743
-
2744
- /* Folder tiles have no image to show, so the icon is drawn in CSS. The plugin
2745
- emits an empty div for it -- with no rule here the tile renders blank. */
2746
- .rte-gallery-browser-thumbnail-folder {
2747
- background: linear-gradient(180deg, #fffaea 0%, #fdeec4 100%);
2748
- border-color: rgba(197, 158, 61, 0.32);
2749
- }
2750
-
2751
- .rte-gallery-browser-folder-icon {
2752
- position: relative;
2753
- width: 60px;
2754
- height: 42px;
2755
- border: 1px solid rgba(178, 138, 45, 0.7);
2756
- border-radius: 7px;
2757
- background: linear-gradient(180deg, #ffe6a1 0%, #f3c957 100%);
2758
- box-shadow: 0 8px 16px rgba(140, 100, 20, 0.18);
2759
- }
2760
-
2761
- .rte-gallery-browser-folder-icon:before {
2762
- content: "";
2763
- position: absolute;
2764
- left: 7px;
2765
- top: -9px;
2766
- width: 25px;
2767
- height: 13px;
2768
- border: 1px solid rgba(178, 138, 45, 0.7);
2769
- border-bottom: 0;
2770
- border-radius: 6px 6px 0 0;
2771
- background: linear-gradient(180deg, #fff1c4 0%, #f8d97c 100%);
2772
- }
2773
-
2772
+ /* Folders sit in their own container above the image listbox, so the two are
2773
+ separated by a rule rather than running together in one grid. */
2774
+ .rte-gallery-browser-grid-folders {
2775
+ margin-bottom: 14px;
2776
+ padding-bottom: 14px;
2777
+ border-bottom: 1px solid rgba(116, 135, 162, 0.16);
2778
+ }
2779
+
2780
+ /* Folder tiles have no image to show, so the icon is drawn in CSS. The plugin
2781
+ emits an empty div for it -- with no rule here the tile renders blank. */
2782
+ .rte-gallery-browser-thumbnail-folder {
2783
+ background: linear-gradient(180deg, #fffaea 0%, #fdeec4 100%);
2784
+ border-color: rgba(197, 158, 61, 0.32);
2785
+ }
2786
+
2787
+ .rte-gallery-browser-folder-icon {
2788
+ position: relative;
2789
+ width: 60px;
2790
+ height: 42px;
2791
+ border: 1px solid rgba(178, 138, 45, 0.7);
2792
+ border-radius: 7px;
2793
+ background: linear-gradient(180deg, #ffe6a1 0%, #f3c957 100%);
2794
+ box-shadow: 0 8px 16px rgba(140, 100, 20, 0.18);
2795
+ }
2796
+
2797
+ .rte-gallery-browser-folder-icon:before {
2798
+ content: "";
2799
+ position: absolute;
2800
+ left: 7px;
2801
+ top: -9px;
2802
+ width: 25px;
2803
+ height: 13px;
2804
+ border: 1px solid rgba(178, 138, 45, 0.7);
2805
+ border-bottom: 0;
2806
+ border-radius: 6px 6px 0 0;
2807
+ background: linear-gradient(180deg, #fff1c4 0%, #f8d97c 100%);
2808
+ }
2809
+
2774
2810
  .rte-gallery-browser-thumbnail-image {
2775
2811
  max-width: 100%;
2776
2812
  max-height: 100%;
@@ -3601,10 +3637,16 @@ rte-dialog-outer rte-dialog-header-close {
3601
3637
 
3602
3638
  rte-dropdown-panel {
3603
3639
  gap: 2px;
3604
- padding: 8px !important;
3640
+ /* Published as a variable so the full-bleed header below can cancel
3641
+ exactly this much padding instead of guessing at it. */
3642
+ --rte-panel-pad: 8px;
3643
+ padding: var(--rte-panel-pad) !important;
3605
3644
  max-width: min(520px, calc(100vw - 20px));
3606
3645
  max-height: min(420px, calc(100vh - 76px));
3607
- overflow: auto;
3646
+ /* Vertical only: a tall panel should scroll, but nothing in a panel is
3647
+ meant to be reachable sideways - a horizontal bar here is always a bug. */
3648
+ overflow-x: hidden;
3649
+ overflow-y: auto;
3608
3650
  scrollbar-width: thin;
3609
3651
  }
3610
3652
 
@@ -4756,8 +4798,8 @@ rte-dropdown-panel .rte-dialog-button:active {
4756
4798
  .richtexteditor.rte-modern.rte-desktop rte-toolbar.rte-toolbar-desktop rte-toolbar-splitbutton svg {
4757
4799
  display: block !important;
4758
4800
  flex: 0 0 auto;
4759
- width: 20px !important;
4760
- height: 20px !important;
4801
+ width: 20px !important;
4802
+ height: 20px !important;
4761
4803
  margin: 0 !important;
4762
4804
  align-self: center !important;
4763
4805
  color: currentColor;
@@ -4775,10 +4817,10 @@ rte-dropdown-panel .rte-dialog-button:active {
4775
4817
  pointer-events: none;
4776
4818
  }
4777
4819
 
4778
- .rte-modern rte-dropdown-panel rte-toolbar-button svg {
4779
- width: 20px !important;
4780
- height: 20px !important;
4781
- }
4820
+ .rte-modern rte-dropdown-panel rte-toolbar-button svg {
4821
+ width: 20px !important;
4822
+ height: 20px !important;
4823
+ }
4782
4824
 
4783
4825
  .richtexteditor.rte-modern.rte-desktop rte-toolbar.rte-toolbar-desktop rte-toolbar-button:hover,
4784
4826
  .richtexteditor.rte-modern.rte-desktop rte-toolbar.rte-toolbar-desktop rte-toolbar-arrowbutton:hover,
@@ -4916,3 +4958,26 @@ rte-dialog-float rte-dialog-inner {
4916
4958
  max-height: calc(100vh - max(104px, calc(var(--rte-dialog-effective-top-chrome) + 32px)));
4917
4959
  overflow: auto;
4918
4960
  }
4961
+
4962
+ /* WCAG 1.4.10 Reflow: rte-bottom
4963
+ The editor footer is a flex row (word count, tag list, "powered by", resize
4964
+ grip). With flex-wrap:nowrap and non-shrinking children it overflowed the
4965
+ editor AND the viewport at 320px - measured on the live home page as document
4966
+ scrollWidth 349 against a 320 viewport - which is the horizontal scrolling
4967
+ WCAG 1.4.10 (AA) prohibits. Wrapping keeps every control reachable instead of
4968
+ clipping it. Appended rather than merged into the existing rule because tier
4969
+ themes have diverged and a surgical edit risks corrupting them. */
4970
+ rte-bottom { flex-wrap: wrap; }
4971
+ rte-bottom > * { min-width: 0; }
4972
+ /* Editor focus state. rte.js has always toggled .rte-is-focused/.rte-is-blurred
4973
+ on the container, but nothing ever styled them, so focusing the editor gave no
4974
+ visual feedback at all. The halo mirrors the focus treatment of the individual
4975
+ controls, so the whole component behaves consistently. */
4976
+ .richtexteditor.rte-is-focused {
4977
+ border-color: var(--rte-accent, #1d67ba);
4978
+ box-shadow: var(--rte-shadow, none), var(--rte-focus-ring, none);
4979
+ }
4980
+
4981
+ @media (prefers-reduced-motion: reduce) {
4982
+ .richtexteditor { transition: none; }
4983
+ }
@@ -1,21 +1,27 @@
1
1
  
2
2
  /* TODO: use @import for your css */
3
3
 
4
+ /* This stylesheet is the customer-editable layer for the EDITING SURFACE.
5
+ It loads between the editor's built-in defaults and the editor's own
6
+ mechanics rules, so anything set here wins over the defaults. Values below
7
+ intentionally match those defaults - edit freely to match your own site. */
8
+
4
9
  body {
5
10
  overflow-y: hidden;
6
- padding: 0px;
7
- margin: 0px
11
+ /* Writing gutters come from RTE_DefaultConfig.editablePadding* (applied
12
+ inline, so setting padding here would have no effect). */
13
+ margin: 0;
8
14
  }
9
15
 
10
16
  body, table, p, div {
11
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
12
- color: #414141;
13
- font-size: 14px;
14
- line-height: 1.6;
17
+ font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
18
+ color: #1f2328;
19
+ font-size: 16px;
20
+ line-height: 1.7;
15
21
  }
16
22
 
17
23
  a {
18
- color: #377dff;
24
+ color: #0969da;
19
25
  text-decoration: none;
20
26
  -webkit-transition: color 0.2s ease 0s, text-decoration 0.2s ease 0s;
21
27
  -moz-transition: color 0.2s ease 0s, text-decoration 0.2s ease 0s;
@@ -24,8 +30,8 @@ a {
24
30
  }
25
31
 
26
32
  ::selection {
27
- background: #b5d6fd;
28
- color: #000030;
33
+ background: #b6dafd;
34
+ color: #06121f;
29
35
  }
30
36
 
31
37
  /*RTE_DefaultConfig.items_InlineClasses*/
@@ -98,11 +104,11 @@ table {
98
104
  }
99
105
 
100
106
  table[border="0"] td, table:not([border]) td, table[border="0"] th, table:not([border]) th {
101
- border: 1px solid #ddd;
107
+ border: 1px solid #d0d7de;
102
108
  }
103
109
 
104
110
  thead {
105
- background-color: #eee;
111
+ background-color: #f6f8fa;
106
112
  }
107
113
 
108
114
  .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
@@ -129,9 +135,10 @@ video-container {
129
135
  }
130
136
 
131
137
  blockquote {
132
- border-left: 3px solid #ddd;
133
- padding: 5px 0 5px 10px;
134
- margin: 15px 0 15px 15px;
138
+ border-left: 3px solid #d0d7de;
139
+ padding: 0.2em 0 0.2em 1em;
140
+ margin: 1.2em 0;
141
+ color: #57606a;
135
142
  }
136
143
 
137
144