@richscripts/richtexteditor 2.7.2 → 2.9.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.
- package/package.json +1 -1
- package/richtexteditor/all_plugins.js +2583 -719
- package/richtexteditor/all_plugins.min.js +59 -58
- package/richtexteditor/plugins/accessibilitychecker.js +7 -0
- package/richtexteditor/plugins/all_plugins.js +2583 -719
- package/richtexteditor/plugins/all_plugins.min.js +59 -58
- package/richtexteditor/plugins/autoembed.js +7 -0
- package/richtexteditor/plugins/blocktypes.js +7 -0
- package/richtexteditor/plugins/bookmarkcard.js +7 -0
- package/richtexteditor/plugins/charlimit.js +7 -0
- package/richtexteditor/plugins/comments.js +14 -0
- package/richtexteditor/plugins/contentminimap.js +7 -0
- package/richtexteditor/plugins/crossreference.js +7 -0
- package/richtexteditor/plugins/dictation.js +7 -0
- package/richtexteditor/plugins/documentoutline.js +9 -3
- package/richtexteditor/plugins/draghandle.js +7 -0
- package/richtexteditor/plugins/foldheadings.js +7 -0
- package/richtexteditor/plugins/footnotes.js +7 -0
- package/richtexteditor/plugins/formatpainter.js +7 -0
- package/richtexteditor/plugins/formattingmarks.js +7 -0
- package/richtexteditor/plugins/gapcursor.js +7 -0
- package/richtexteditor/plugins/ghostcomplete.js +7 -0
- package/richtexteditor/plugins/layouttable.js +7 -0
- package/richtexteditor/plugins/linenumbers.js +7 -0
- package/richtexteditor/plugins/linkchecker.js +7 -0
- package/richtexteditor/plugins/mentionplugin.js +14 -0
- package/richtexteditor/plugins/mergefields.js +7 -0
- package/richtexteditor/plugins/mermaiddiagram.js +7 -0
- package/richtexteditor/plugins/multilevellist.js +7 -0
- package/richtexteditor/plugins/nodetypes.js +439 -0
- package/richtexteditor/plugins/pagination.js +7 -0
- package/richtexteditor/plugins/restrictedediting.js +7 -0
- package/richtexteditor/plugins/revisionhistory.js +7 -0
- package/richtexteditor/plugins/rtlui.js +7 -0
- package/richtexteditor/plugins/rubyannotation.js +255 -0
- package/richtexteditor/plugins/slashcommand.js +7 -0
- package/richtexteditor/plugins/smartchips.js +7 -0
- package/richtexteditor/plugins/spellcheck.js +7 -0
- package/richtexteditor/plugins/stateinspector.js +866 -0
- package/richtexteditor/plugins/tableofcontents.js +7 -0
- package/richtexteditor/plugins/textdirection.js +7 -0
- package/richtexteditor/plugins/textpartlanguage.js +7 -0
- package/richtexteditor/plugins/todolist.js +7 -0
- package/richtexteditor/plugins/trackedchanges.js +730 -716
- package/richtexteditor/plugins/typewriter.js +7 -0
- package/richtexteditor/plugins/watermark.js +15 -0
- package/richtexteditor/plugins/yjscollab.js +7 -0
- package/richtexteditor/rte.js +2 -2
|
@@ -163,6 +163,13 @@ function RTE_Plugin_AutoEmbed() {
|
|
|
163
163
|
st.id = "rte-autoembed-styles";
|
|
164
164
|
st.appendChild(doc.createTextNode(css));
|
|
165
165
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
166
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
167
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
168
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
169
|
+
// the policy actually emptied it.
|
|
170
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
171
|
+
editor.ensureStyleSheetLive(doc, st, "rte-autoembed-styles", st.textContent);
|
|
172
|
+
}
|
|
166
173
|
}
|
|
167
174
|
|
|
168
175
|
// Programmatic insert at caret (public editor.embedUrl API).
|
|
@@ -169,6 +169,13 @@ function RTE_Plugin_BlockTypes() {
|
|
|
169
169
|
st.setAttribute("data-rte-blocktypes", "1");
|
|
170
170
|
st.textContent = css;
|
|
171
171
|
head.appendChild(st);
|
|
172
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
173
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
174
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
175
|
+
// the policy actually emptied it.
|
|
176
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
177
|
+
editor.ensureStyleSheetLive(editdoc, st, "rte-blocktypes-st", st.textContent);
|
|
178
|
+
}
|
|
172
179
|
}
|
|
173
180
|
} catch (e) { /* ignore */ }
|
|
174
181
|
}
|
|
@@ -231,6 +231,13 @@ function RTE_Plugin_BookmarkCard() {
|
|
|
231
231
|
st.setAttribute("data-rte-bookmarkcard", "1");
|
|
232
232
|
st.textContent = css;
|
|
233
233
|
head.appendChild(st);
|
|
234
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
235
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
236
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
237
|
+
// the policy actually emptied it.
|
|
238
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
239
|
+
editor.ensureStyleSheetLive(editdoc, st, "rte-bookmarkcard-st", st.textContent);
|
|
240
|
+
}
|
|
234
241
|
}
|
|
235
242
|
} catch (e) { /* ignore */ }
|
|
236
243
|
}
|
|
@@ -167,6 +167,13 @@ function RTE_Plugin_CharLimit() {
|
|
|
167
167
|
st.textContent = ".rte-charlimit-counter{position:absolute;right:10px;bottom:6px;z-index:5;font:11px -apple-system,Segoe UI,sans-serif;color:#64748b;background:rgba(255,255,255,.85);padding:1px 7px;border-radius:9px;pointer-events:none}" +
|
|
168
168
|
".rte-charlimit-counter.is-near{color:#b45309}.rte-charlimit-counter.is-over{color:#dc2626;font-weight:600}";
|
|
169
169
|
(doc.head || doc.documentElement).appendChild(st);
|
|
170
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
171
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
172
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
173
|
+
// the policy actually emptied it.
|
|
174
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
175
|
+
editor.ensureStyleSheetLive(doc, st, "rte-charlimit-st", st.textContent);
|
|
176
|
+
}
|
|
170
177
|
}
|
|
171
178
|
|
|
172
179
|
function refresh() {
|
|
@@ -627,6 +627,13 @@ function RTE_Plugin_Comments() {
|
|
|
627
627
|
".rte-comment-dark .rte-comment-quote{background:rgba(245,158,11,.12);color:#fcd34d}"
|
|
628
628
|
].join("\n");
|
|
629
629
|
host.head.appendChild(style);
|
|
630
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
631
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
632
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
633
|
+
// the policy actually emptied it.
|
|
634
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
635
|
+
editor.ensureStyleSheetLive(host, style, "rte-comments-style", style.textContent);
|
|
636
|
+
}
|
|
630
637
|
}
|
|
631
638
|
|
|
632
639
|
var editdoc = editor.getDocument();
|
|
@@ -640,6 +647,13 @@ function RTE_Plugin_Comments() {
|
|
|
640
647
|
"@keyframes rte-comment-flash{0%{background:rgba(251,191,36,.9)}100%{background:" + config.commentHighlightBg + "}}"
|
|
641
648
|
].join("\n");
|
|
642
649
|
editdoc.head.appendChild(iStyle);
|
|
650
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
651
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
652
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
653
|
+
// the policy actually emptied it.
|
|
654
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
655
|
+
editor.ensureStyleSheetLive(editdoc, iStyle, "rte-comments-iStyle", iStyle.textContent);
|
|
656
|
+
}
|
|
643
657
|
}
|
|
644
658
|
}
|
|
645
659
|
|
|
@@ -104,6 +104,13 @@ function RTE_Plugin_ContentMinimap() {
|
|
|
104
104
|
"@media (max-width: 1100px){.rte-content-minimap-shell{display:block;}.rte-content-minimap-panel{margin-top:12px;max-width:none;width:100%;}.rte-content-minimap-body{max-height:280px;}}"
|
|
105
105
|
].join("");
|
|
106
106
|
hostDoc.head.appendChild(style);
|
|
107
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
108
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
109
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
110
|
+
// the policy actually emptied it.
|
|
111
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
112
|
+
editor.ensureStyleSheetLive(hostDoc, style, "rte-content-minimap-style", style.textContent);
|
|
113
|
+
}
|
|
107
114
|
}
|
|
108
115
|
|
|
109
116
|
function ensureShell() {
|
|
@@ -404,5 +404,12 @@ function RTE_Plugin_CrossReference() {
|
|
|
404
404
|
st.setAttribute("data-css", text);
|
|
405
405
|
st.appendChild(doc.createTextNode(text));
|
|
406
406
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
407
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
408
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
409
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
410
|
+
// the policy actually emptied it.
|
|
411
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
412
|
+
editor.ensureStyleSheetLive(doc, st, "rte-xref-styles", st.textContent);
|
|
413
|
+
}
|
|
407
414
|
}
|
|
408
415
|
}
|
|
@@ -231,6 +231,13 @@ function RTE_Plugin_Dictation() {
|
|
|
231
231
|
style.setAttribute("data-rte-dictation", "1");
|
|
232
232
|
style.appendChild(document.createTextNode(css));
|
|
233
233
|
document.head.appendChild(style);
|
|
234
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
235
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
236
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
237
|
+
// the policy actually emptied it.
|
|
238
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
239
|
+
editor.ensureStyleSheetLive(document, style, "rte-dictation-style", style.textContent);
|
|
240
|
+
}
|
|
234
241
|
}
|
|
235
242
|
|
|
236
243
|
function normalize(text, isFinal) {
|
|
@@ -75,9 +75,7 @@ function RTE_Plugin_DocumentOutline() {
|
|
|
75
75
|
function injectStyles() {
|
|
76
76
|
var hostDoc = config.container.ownerDocument;
|
|
77
77
|
if (hostDoc.getElementById("rte-document-outline-style")) return;
|
|
78
|
-
var
|
|
79
|
-
style.id = "rte-document-outline-style";
|
|
80
|
-
style.innerHTML = [
|
|
78
|
+
var csstext = [
|
|
81
79
|
".rte-document-outline-shell{display:flex;align-items:stretch;gap:10px;}",
|
|
82
80
|
".rte-document-outline-shell>.rte-document-outline-host{flex:1 1 auto;min-width:0;}",
|
|
83
81
|
"/* 2026-07-12 navigation panel precision */",
|
|
@@ -100,7 +98,15 @@ function RTE_Plugin_DocumentOutline() {
|
|
|
100
98
|
".rte-document-outline-empty{margin:6px;padding:14px;color:#52657e;font-size:13px;font-weight:700;line-height:1.55;background:#fff;border:1px dashed rgba(148,163,184,.34);border-radius:8px;}",
|
|
101
99
|
"@media (max-width: 1100px){.rte-document-outline-shell{display:block;}.rte-document-outline-panel{margin-top:12px;max-width:none;width:100%;}.rte-document-outline-body{max-height:320px;}}"
|
|
102
100
|
].join("");
|
|
101
|
+
var style = hostDoc.createElement("style");
|
|
102
|
+
style.id = "rte-document-outline-style";
|
|
103
|
+
style.appendChild(hostDoc.createTextNode(csstext));
|
|
103
104
|
hostDoc.head.appendChild(style);
|
|
105
|
+
// A <style> element's rules are dropped under a strict style-src; this
|
|
106
|
+
// re-injects them through the CSSOM in that case only.
|
|
107
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
108
|
+
editor.ensureStyleSheetLive(hostDoc, style, "rte-document-outline-style", csstext);
|
|
109
|
+
}
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
function ensureShell() {
|
|
@@ -305,5 +305,12 @@ function RTE_Plugin_DragHandle() {
|
|
|
305
305
|
".rte-drag-active *{cursor:grabbing !important;}"
|
|
306
306
|
));
|
|
307
307
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
308
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
309
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
310
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
311
|
+
// the policy actually emptied it.
|
|
312
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
313
|
+
editor.ensureStyleSheetLive(doc, st, "rte-drag-handle-styles", st.textContent);
|
|
314
|
+
}
|
|
308
315
|
}
|
|
309
316
|
}
|
|
@@ -146,6 +146,13 @@ function RTE_Plugin_FoldHeadings() {
|
|
|
146
146
|
st.id = "rte-foldheadings-styles";
|
|
147
147
|
st.appendChild(doc.createTextNode(css));
|
|
148
148
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
149
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
150
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
151
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
152
|
+
// the policy actually emptied it.
|
|
153
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
154
|
+
editor.ensureStyleSheetLive(doc, st, "rte-foldheadings-styles", st.textContent);
|
|
155
|
+
}
|
|
149
156
|
}
|
|
150
157
|
|
|
151
158
|
// Strip fold classes for the duration of a serialization call so saved markup
|
|
@@ -394,5 +394,12 @@ function RTE_Plugin_Footnotes() {
|
|
|
394
394
|
st.setAttribute("data-css", text);
|
|
395
395
|
st.appendChild(doc.createTextNode(text));
|
|
396
396
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
397
|
+
// A <style> ELEMENT is refused under `style-src 'self'` and its rules are
|
|
398
|
+
// dropped, so footnote markers and the separator rendered unstyled for any
|
|
399
|
+
// customer on a strict CSP. This re-injects through the CSSOM only in that
|
|
400
|
+
// case; the element above stays the path everyone else takes.
|
|
401
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
402
|
+
editor.ensureStyleSheetLive(doc, st, "rte-footnotes-styles", text);
|
|
403
|
+
}
|
|
397
404
|
}
|
|
398
405
|
}
|
|
@@ -294,5 +294,12 @@ function RTE_Plugin_FormatPainter() {
|
|
|
294
294
|
st.id = "rte-format-painter-styles";
|
|
295
295
|
st.appendChild(doc.createTextNode(css()));
|
|
296
296
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
297
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
298
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
299
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
300
|
+
// the policy actually emptied it.
|
|
301
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
302
|
+
editor.ensureStyleSheetLive(doc, st, "rte-format-painter-styles", st.textContent);
|
|
303
|
+
}
|
|
297
304
|
}
|
|
298
305
|
}
|
|
@@ -242,5 +242,12 @@ function RTE_Plugin_FormattingMarks() {
|
|
|
242
242
|
st.setAttribute("data-css", text);
|
|
243
243
|
st.appendChild(doc.createTextNode(text));
|
|
244
244
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
245
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
246
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
247
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
248
|
+
// the policy actually emptied it.
|
|
249
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
250
|
+
editor.ensureStyleSheetLive(doc, st, "rte-formatting-marks-styles", st.textContent);
|
|
251
|
+
}
|
|
245
252
|
}
|
|
246
253
|
}
|
|
@@ -361,5 +361,12 @@ function RTE_Plugin_GapCursor() {
|
|
|
361
361
|
st.setAttribute("data-css", text);
|
|
362
362
|
st.appendChild(doc.createTextNode(text));
|
|
363
363
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
364
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
365
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
366
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
367
|
+
// the policy actually emptied it.
|
|
368
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
369
|
+
editor.ensureStyleSheetLive(doc, st, "rte-gapcursor-styles", st.textContent);
|
|
370
|
+
}
|
|
364
371
|
}
|
|
365
372
|
}
|
|
@@ -264,6 +264,13 @@ function RTE_Plugin_GhostComplete() {
|
|
|
264
264
|
st.id = "rte-ghost-styles";
|
|
265
265
|
st.appendChild(doc.createTextNode(css));
|
|
266
266
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
267
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
268
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
269
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
270
|
+
// the policy actually emptied it.
|
|
271
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
272
|
+
editor.ensureStyleSheetLive(doc, st, "rte-ghost-styles", st.textContent);
|
|
273
|
+
}
|
|
267
274
|
}
|
|
268
275
|
|
|
269
276
|
function stripFor() {
|
|
@@ -374,6 +374,13 @@ function RTE_Plugin_LayoutTable() {
|
|
|
374
374
|
st.setAttribute("data-css", text);
|
|
375
375
|
st.appendChild(doc.createTextNode(text));
|
|
376
376
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
377
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
378
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
379
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
380
|
+
// the policy actually emptied it.
|
|
381
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
382
|
+
editor.ensureStyleSheetLive(doc, st, "rte-layout-table-styles", st.textContent);
|
|
383
|
+
}
|
|
377
384
|
}
|
|
378
385
|
|
|
379
386
|
function fireChange() {
|
|
@@ -348,5 +348,12 @@ function RTE_Plugin_LineNumbers() {
|
|
|
348
348
|
st.setAttribute("data-css", text);
|
|
349
349
|
st.appendChild(doc.createTextNode(text));
|
|
350
350
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
351
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
352
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
353
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
354
|
+
// the policy actually emptied it.
|
|
355
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
356
|
+
editor.ensureStyleSheetLive(doc, st, "rte-linenumber-styles", st.textContent);
|
|
357
|
+
}
|
|
351
358
|
}
|
|
352
359
|
}
|
|
@@ -392,5 +392,12 @@ function RTE_Plugin_LinkChecker() {
|
|
|
392
392
|
st.setAttribute("data-css", text);
|
|
393
393
|
st.appendChild(doc.createTextNode(text));
|
|
394
394
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
395
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
396
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
397
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
398
|
+
// the policy actually emptied it.
|
|
399
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
400
|
+
editor.ensureStyleSheetLive(doc, st, "rte-link-checker-styles", st.textContent);
|
|
401
|
+
}
|
|
395
402
|
}
|
|
396
403
|
}
|
|
@@ -519,6 +519,13 @@ function RTE_Plugin_Mention() {
|
|
|
519
519
|
".rte-mention:hover{background:#e4edff}"
|
|
520
520
|
].join("\n");
|
|
521
521
|
host.head.appendChild(style);
|
|
522
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
523
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
524
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
525
|
+
// the policy actually emptied it.
|
|
526
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
527
|
+
editor.ensureStyleSheetLive(host, style, "rte-mentionplugin-style", style.textContent);
|
|
528
|
+
}
|
|
522
529
|
|
|
523
530
|
// Also inject mention-span styles inside the iframe so the pill looks right while editing.
|
|
524
531
|
var editdoc = editor.getDocument();
|
|
@@ -530,6 +537,13 @@ function RTE_Plugin_Mention() {
|
|
|
530
537
|
".rte-mention:hover{background:#e4edff}"
|
|
531
538
|
].join("\n");
|
|
532
539
|
editdoc.head.appendChild(iStyle);
|
|
540
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
541
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
542
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
543
|
+
// the policy actually emptied it.
|
|
544
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
545
|
+
editor.ensureStyleSheetLive(editdoc, iStyle, "rte-mentionplugin-iStyle", iStyle.textContent);
|
|
546
|
+
}
|
|
533
547
|
}
|
|
534
548
|
}
|
|
535
549
|
}
|
|
@@ -324,5 +324,12 @@ function RTE_Plugin_MergeFields() {
|
|
|
324
324
|
st.setAttribute("data-css", text);
|
|
325
325
|
st.appendChild(doc.createTextNode(text));
|
|
326
326
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
327
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
328
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
329
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
330
|
+
// the policy actually emptied it.
|
|
331
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
332
|
+
editor.ensureStyleSheetLive(doc, st, "rte-merge-field-styles", st.textContent);
|
|
333
|
+
}
|
|
327
334
|
}
|
|
328
335
|
}
|
|
@@ -128,6 +128,13 @@ function RTE_Plugin_MermaidDiagram() {
|
|
|
128
128
|
style.id = "rte-mermaid-styles";
|
|
129
129
|
style.appendChild(doc.createTextNode(css));
|
|
130
130
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(style);
|
|
131
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
132
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
133
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
134
|
+
// the policy actually emptied it.
|
|
135
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
136
|
+
editor.ensureStyleSheetLive(doc, style, "rte-mermaid-styles", style.textContent);
|
|
137
|
+
}
|
|
131
138
|
}
|
|
132
139
|
|
|
133
140
|
function getMermaid(win) {
|
|
@@ -133,5 +133,12 @@ function RTE_Plugin_MultiLevelList() {
|
|
|
133
133
|
st.setAttribute("data-css", text);
|
|
134
134
|
st.appendChild(doc.createTextNode(text));
|
|
135
135
|
(doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement).appendChild(st);
|
|
136
|
+
// A <style> ELEMENT is governed by style-src: under a strict policy the browser
|
|
137
|
+
// drops its rules, leaving this plugin's UI unstyled. The element above stays
|
|
138
|
+
// the path everyone else takes; this re-injects through the CSSOM only when
|
|
139
|
+
// the policy actually emptied it.
|
|
140
|
+
if (editor && typeof editor.ensureStyleSheetLive === "function") {
|
|
141
|
+
editor.ensureStyleSheetLive(doc, st, "rte-legal-list-styles", st.textContent);
|
|
142
|
+
}
|
|
136
143
|
}
|
|
137
144
|
}
|