@editora/core 1.0.14 → 1.0.16
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/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
- package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
- package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
- package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
- package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
- package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
- package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
- package/dist/{CodePlugin.native-veDC_kx5.mjs → CodePlugin.native-BH-K4xmW.mjs} +1049 -917
- package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
- package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
- package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
- package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
- package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
- package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
- package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
- package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
- package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
- package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
- package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
- package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
- package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
- package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
- package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
- package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
- package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
- package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
- package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
- package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
- package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
- package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
- package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
- package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
- package/dist/core.css +1 -1
- package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
- package/dist/{documentManager-vQ1VkbUY.mjs → documentManager-BcBIv5P-.mjs} +3 -3
- package/dist/editora.min.js +26 -24
- package/dist/editora.umd.js +26 -24
- package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
- package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
- package/dist/index-B1_vtXRz.mjs +3910 -0
- package/dist/index-C6BoNR2t.js +12 -0
- package/dist/{index-BslAFzmv.mjs → index-CavM-mEM.mjs} +6391 -6203
- package/dist/index.cjs.js +3 -3
- package/dist/{index.es-BYD2KEo6.mjs → index.es-BK-4TPv8.mjs} +1562 -1546
- package/dist/index.esm.js +17 -14
- package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-BsnKYYHL.mjs} +4 -3
- package/dist/plugin-loader.js +53 -52
- package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-DhWKBjsL.mjs} +3 -3
- package/dist/webcomponent-core.js +2039 -473
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +100 -70
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +2208 -641
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1575 -1209
- package/index.d.ts +32 -0
- package/package.json +10 -3
- package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
- package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
- package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
- package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
- package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
- package/dist/index-B9MPiUAR.mjs +0 -2341
- package/dist/index-BLm1MtzH.js +0 -10
package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs}
RENAMED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { e as C } from "./escapeHtml-CX8RelZ1.mjs";
|
|
2
|
+
import { i as H } from "./dialogHelpers-DBf7WqYH.mjs";
|
|
3
|
+
const A = /* @__PURE__ */ new Set(), w = [], b = (t) => {
|
|
4
|
+
w.push(t);
|
|
3
5
|
}, v = '[data-theme="dark"], .dark, .editora-theme-dark';
|
|
4
6
|
b({
|
|
5
7
|
id: "image-alt-text",
|
|
@@ -8,9 +10,8 @@ b({
|
|
|
8
10
|
severity: "error",
|
|
9
11
|
selector: "img",
|
|
10
12
|
evaluate(t, n) {
|
|
11
|
-
var r;
|
|
12
13
|
const e = t;
|
|
13
|
-
return e.hasAttribute("role") && e.getAttribute("role") === "presentation" || e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "image-alt-text"
|
|
14
|
+
return e.hasAttribute("role") && e.getAttribute("role") === "presentation" || e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "image-alt-text" || e.hasAttribute("alt") ? null : {
|
|
14
15
|
id: `img-alt-${n.cache.get("imgIdx")}`,
|
|
15
16
|
rule: "image-alt-text",
|
|
16
17
|
wcag: "1.1.1",
|
|
@@ -21,7 +22,7 @@ b({
|
|
|
21
22
|
suggestion: "Add descriptive alt text to all images",
|
|
22
23
|
fixable: !0,
|
|
23
24
|
fixLabel: "Add empty alt"
|
|
24
|
-
}
|
|
25
|
+
};
|
|
25
26
|
},
|
|
26
27
|
fix(t) {
|
|
27
28
|
t.element && t.element.setAttribute("alt", "");
|
|
@@ -34,10 +35,10 @@ b({
|
|
|
34
35
|
severity: "error",
|
|
35
36
|
selector: 'button, a, [role="button"]',
|
|
36
37
|
evaluate(t, n) {
|
|
37
|
-
var
|
|
38
|
+
var d;
|
|
38
39
|
const e = t;
|
|
39
40
|
if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "empty-interactive") return null;
|
|
40
|
-
const r = (
|
|
41
|
+
const r = (d = e.textContent) == null ? void 0 : d.trim(), a = e.hasAttribute("aria-label"), i = e.hasAttribute("aria-labelledby"), s = e.hasAttribute("title");
|
|
41
42
|
return !r && !a && !i && !s ? {
|
|
42
43
|
id: `interactive-empty-${n.cache.get("buttonIdx")}`,
|
|
43
44
|
rule: "empty-interactive",
|
|
@@ -169,7 +170,7 @@ b({
|
|
|
169
170
|
severity: "error",
|
|
170
171
|
selector: "a",
|
|
171
172
|
evaluate(t, n) {
|
|
172
|
-
var s,
|
|
173
|
+
var s, d;
|
|
173
174
|
const e = t;
|
|
174
175
|
if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "link-text") return null;
|
|
175
176
|
const r = ((s = e.textContent) == null ? void 0 : s.replace(/\s+/g, "").toLowerCase()) || "", a = e.childNodes.length === 1 && e.childNodes[0].nodeName === "BR", i = ["clickhere", "readmore", "link", "here", "this", "page"];
|
|
@@ -189,7 +190,7 @@ b({
|
|
|
189
190
|
rule: "link-text",
|
|
190
191
|
wcag: "2.4.4",
|
|
191
192
|
severity: "warning",
|
|
192
|
-
message: `Vague link text: "${(
|
|
193
|
+
message: `Vague link text: "${(d = e.textContent) == null ? void 0 : d.trim()}"`,
|
|
193
194
|
nodePath: n.cache.get("aPath"),
|
|
194
195
|
element: e,
|
|
195
196
|
suggestion: "Use descriptive link text",
|
|
@@ -233,7 +234,7 @@ b({
|
|
|
233
234
|
} : null;
|
|
234
235
|
}
|
|
235
236
|
});
|
|
236
|
-
const
|
|
237
|
+
const k = () => {
|
|
237
238
|
const t = window.getSelection();
|
|
238
239
|
if (t && t.rangeCount > 0) {
|
|
239
240
|
let e = t.getRangeAt(0).startContainer;
|
|
@@ -254,8 +255,8 @@ const w = () => {
|
|
|
254
255
|
if (e) return e;
|
|
255
256
|
}
|
|
256
257
|
return document.querySelector('[contenteditable="true"]');
|
|
257
|
-
},
|
|
258
|
-
const t =
|
|
258
|
+
}, I = () => {
|
|
259
|
+
const t = k();
|
|
259
260
|
if (t != null && t.closest(v)) return !0;
|
|
260
261
|
const n = window.getSelection();
|
|
261
262
|
if (n && n.rangeCount > 0) {
|
|
@@ -264,44 +265,46 @@ const w = () => {
|
|
|
264
265
|
}
|
|
265
266
|
const e = document.activeElement;
|
|
266
267
|
return e != null && e.closest(v) ? !0 : document.body.matches(v) || document.documentElement.matches(v);
|
|
267
|
-
},
|
|
268
|
+
}, $ = () => {
|
|
268
269
|
var h, u, y;
|
|
269
|
-
const t =
|
|
270
|
+
const t = k();
|
|
270
271
|
if (!t) return [];
|
|
271
272
|
const n = [], e = { doc: t.ownerDocument || document, cache: /* @__PURE__ */ new Map() }, r = e.doc.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, null);
|
|
272
|
-
let a = r.currentNode
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
let a = r.currentNode;
|
|
274
|
+
const i = {}, s = {};
|
|
275
|
+
let d = 0;
|
|
276
|
+
for (; a && d < 5e3; ) {
|
|
277
|
+
const m = a, o = ((u = (h = m.tagName) == null ? void 0 : h.toLowerCase) == null ? void 0 : u.call(h)) || "";
|
|
278
|
+
if (m.hidden || m.style.display === "none" || m.style.visibility === "hidden") {
|
|
279
|
+
a = r.nextNode(), d++;
|
|
277
280
|
continue;
|
|
278
281
|
}
|
|
279
282
|
i[o] = (i[o] || 0) + 1, s[o] = `${o}[${i[o] - 1}]`;
|
|
280
|
-
for (const
|
|
281
|
-
if (
|
|
283
|
+
for (const c of w) {
|
|
284
|
+
if (A.has(c.id) || c.selector && !((y = a.matches) != null && y.call(a, c.selector))) continue;
|
|
282
285
|
e.cache.set(`${o}Idx`, i[o] - 1), e.cache.set(`${o}Path`, s[o]), /^h[1-6]$/.test(o) && (e.cache.set("headingIdx", i[o] - 1), e.cache.set("headingPath", s[o])), o === "a" && (e.cache.set("aIdx", i[o] - 1), e.cache.set("aPath", s[o])), o === "table" && (e.cache.set("tableIdx", i[o] - 1), e.cache.set("tablePath", s[o])), o === "button" && (e.cache.set("buttonIdx", i[o] - 1), e.cache.set("buttonPath", s[o])), o === "input" && (e.cache.set("inputIdx", i[o] - 1), e.cache.set("inputPath", s[o])), (o === "ul" || o === "ol") && (e.cache.set("ulIdx", i[o] - 1), e.cache.set("ulPath", s[o]));
|
|
283
|
-
const p =
|
|
286
|
+
const p = c.evaluate(a, e);
|
|
284
287
|
p && n.push(p);
|
|
285
288
|
}
|
|
286
|
-
a = r.nextNode(),
|
|
289
|
+
a = r.nextNode(), d++;
|
|
287
290
|
}
|
|
288
291
|
return n;
|
|
289
292
|
}, x = (t, n = !0) => {
|
|
290
293
|
t.element && (n ? (t.element.classList.add("a11y-highlighted"), t.element.style.outline = "2px solid #ff9800", t.element.style.backgroundColor = "#fff3cd") : (t.element.classList.remove("a11y-highlighted"), t.element.style.outline = "", t.element.style.backgroundColor = ""));
|
|
291
|
-
}, I = (t) => {
|
|
292
|
-
t || (t = k());
|
|
293
|
-
const n = t.filter((a) => a.severity === "error").length, e = t.filter((a) => a.severity === "warning").length;
|
|
294
|
-
let r = 100 - n * 20 - e * 5;
|
|
295
|
-
return Math.max(0, r);
|
|
296
|
-
}, H = (t) => {
|
|
297
|
-
const n = A.find((e) => e.id === t.rule);
|
|
298
|
-
n && n.fix && n.fix(t);
|
|
299
294
|
}, P = (t) => {
|
|
300
|
-
|
|
295
|
+
t || (t = $());
|
|
296
|
+
const n = t.filter((a) => a.severity === "error").length, e = t.filter((a) => a.severity === "warning").length, r = 100 - n * 20 - e * 5;
|
|
297
|
+
return Math.max(0, r);
|
|
301
298
|
}, N = (t) => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
299
|
+
const n = w.find((e) => e.id === t.rule);
|
|
300
|
+
n && n.fix && n.fix(t);
|
|
301
|
+
}, R = (t) => {
|
|
302
|
+
A.add(t);
|
|
303
|
+
}, F = (t) => {
|
|
304
|
+
A.delete(t);
|
|
305
|
+
}, E = () => {
|
|
306
|
+
document.querySelectorAll(".a11y-dialog-overlay").forEach((c) => c.remove());
|
|
307
|
+
const t = $(), n = P(t), r = I() ? {
|
|
305
308
|
overlay: "rgba(0, 0, 0, 0.62)",
|
|
306
309
|
dialogBg: "#1f2937",
|
|
307
310
|
panelBg: "#222d3a",
|
|
@@ -332,7 +335,7 @@ const w = () => {
|
|
|
332
335
|
fixBtn: "#2196f3",
|
|
333
336
|
fixBtnHover: "#1976d2"
|
|
334
337
|
}, a = document.createElement("div");
|
|
335
|
-
a.className = "a11y-dialog-overlay", a.style.cssText = `
|
|
338
|
+
H(a), a.className = "a11y-dialog-overlay", a.style.cssText = `
|
|
336
339
|
position: fixed;
|
|
337
340
|
top: 0;
|
|
338
341
|
left: 0;
|
|
@@ -366,8 +369,8 @@ const w = () => {
|
|
|
366
369
|
align-items: center;
|
|
367
370
|
justify-content: space-between;
|
|
368
371
|
`;
|
|
369
|
-
const
|
|
370
|
-
|
|
372
|
+
const d = document.createElement("h2");
|
|
373
|
+
d.style.cssText = `margin: 0; font-size: 20px; font-weight: 600; color: ${r.text};`, d.textContent = "Accessibility Checker";
|
|
371
374
|
const h = document.createElement("div");
|
|
372
375
|
h.style.cssText = `
|
|
373
376
|
font-size: 24px;
|
|
@@ -396,18 +399,18 @@ const w = () => {
|
|
|
396
399
|
}, u.onmouseout = () => {
|
|
397
400
|
u.style.background = "none", u.style.color = r.muted;
|
|
398
401
|
}, u.onclick = () => {
|
|
399
|
-
t.forEach((
|
|
402
|
+
t.forEach((c) => x(c, !1)), a.remove();
|
|
400
403
|
};
|
|
401
404
|
const y = document.createElement("div");
|
|
402
|
-
y.style.cssText = "display: flex; align-items: center; gap: 16px;", y.appendChild(
|
|
403
|
-
const
|
|
404
|
-
if (
|
|
405
|
+
y.style.cssText = "display: flex; align-items: center; gap: 16px;", y.appendChild(d), y.appendChild(h), s.appendChild(y), s.appendChild(u);
|
|
406
|
+
const m = document.createElement("div");
|
|
407
|
+
if (m.style.cssText = `
|
|
405
408
|
flex: 1;
|
|
406
409
|
overflow-y: auto;
|
|
407
410
|
padding: 20px;
|
|
408
411
|
background: ${r.dialogBg};
|
|
409
412
|
`, t.length === 0)
|
|
410
|
-
|
|
413
|
+
m.innerHTML = `
|
|
411
414
|
<div style="text-align: center; padding: 40px 20px;">
|
|
412
415
|
<div style="font-size: 48px; margin-bottom: 16px;">✅</div>
|
|
413
416
|
<h3 style="margin: 0 0 8px 0; color: #4caf50;">No issues found!</h3>
|
|
@@ -415,8 +418,8 @@ const w = () => {
|
|
|
415
418
|
</div>
|
|
416
419
|
`;
|
|
417
420
|
else {
|
|
418
|
-
const
|
|
419
|
-
|
|
421
|
+
const c = document.createElement("div");
|
|
422
|
+
c.style.cssText = `
|
|
420
423
|
background: ${r.summaryBg};
|
|
421
424
|
border: 1px solid ${r.border};
|
|
422
425
|
padding: 12px 16px;
|
|
@@ -425,14 +428,14 @@ const w = () => {
|
|
|
425
428
|
display: flex;
|
|
426
429
|
gap: 20px;
|
|
427
430
|
`;
|
|
428
|
-
const p = t.filter((l) => l.severity === "error").length,
|
|
429
|
-
|
|
431
|
+
const p = t.filter((l) => l.severity === "error").length, L = t.filter((l) => l.severity === "warning").length, B = t.filter((l) => l.severity === "info").length;
|
|
432
|
+
c.innerHTML = `
|
|
430
433
|
<div><strong style="color: #f44336;">${p}</strong> <span style="color: ${r.muted};">Errors</span></div>
|
|
431
|
-
<div><strong style="color: #ff9800;">${
|
|
432
|
-
<div><strong style="color: #2196f3;">${
|
|
433
|
-
`,
|
|
434
|
-
const
|
|
435
|
-
|
|
434
|
+
<div><strong style="color: #ff9800;">${L}</strong> <span style="color: ${r.muted};">Warnings</span></div>
|
|
435
|
+
<div><strong style="color: #2196f3;">${B}</strong> <span style="color: ${r.muted};">Info</span></div>
|
|
436
|
+
`, m.appendChild(c), t.forEach((l) => {
|
|
437
|
+
const f = document.createElement("div");
|
|
438
|
+
f.style.cssText = `
|
|
436
439
|
border: 1px solid ${r.issueBorder};
|
|
437
440
|
border-radius: 6px;
|
|
438
441
|
padding: 16px;
|
|
@@ -440,16 +443,16 @@ const w = () => {
|
|
|
440
443
|
transition: all 0.2s;
|
|
441
444
|
background: ${r.issueBg};
|
|
442
445
|
color: ${r.text};
|
|
443
|
-
`,
|
|
444
|
-
|
|
445
|
-
},
|
|
446
|
-
|
|
446
|
+
`, f.onmouseover = () => {
|
|
447
|
+
f.style.borderColor = r.issueHoverBorder, f.style.background = r.issueHoverBg, x(l, !0);
|
|
448
|
+
}, f.onmouseout = () => {
|
|
449
|
+
f.style.borderColor = r.issueBorder, f.style.background = r.issueBg, x(l, !1);
|
|
447
450
|
};
|
|
448
|
-
const
|
|
449
|
-
if (
|
|
451
|
+
const T = l.severity === "error" ? "#f44336" : l.severity === "warning" ? "#ff9800" : "#2196f3";
|
|
452
|
+
if (f.innerHTML = `
|
|
450
453
|
<div style="display: flex; align-items: start; gap: 12px; margin-bottom: 8px;">
|
|
451
454
|
<span style="
|
|
452
|
-
background: ${
|
|
455
|
+
background: ${T};
|
|
453
456
|
color: white;
|
|
454
457
|
padding: 2px 8px;
|
|
455
458
|
border-radius: 4px;
|
|
@@ -458,12 +461,12 @@ const w = () => {
|
|
|
458
461
|
text-transform: uppercase;
|
|
459
462
|
">${l.severity}</span>
|
|
460
463
|
<div style="flex: 1;">
|
|
461
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${l.message}</div>
|
|
462
|
-
<div style="font-size: 12px; color: ${r.muted};">WCAG ${l.wcag} · ${l.rule}</div>
|
|
464
|
+
<div style="font-weight: 600; margin-bottom: 4px;">${C(l.message)}</div>
|
|
465
|
+
<div style="font-size: 12px; color: ${r.muted};">WCAG ${C(l.wcag)} · ${C(l.rule)}</div>
|
|
463
466
|
</div>
|
|
464
467
|
</div>
|
|
465
468
|
<div style="font-size: 14px; color: ${r.text}; margin-bottom: 8px; padding-left: 68px;">
|
|
466
|
-
${l.suggestion || ""}
|
|
469
|
+
${C(l.suggestion || "")}
|
|
467
470
|
</div>
|
|
468
471
|
`, l.fixable) {
|
|
469
472
|
const g = document.createElement("button");
|
|
@@ -477,22 +480,22 @@ const w = () => {
|
|
|
477
480
|
font-size: 13px;
|
|
478
481
|
margin-left: 68px;
|
|
479
482
|
`, g.onmouseover = () => g.style.background = r.fixBtnHover, g.onmouseout = () => g.style.background = r.fixBtn, g.onclick = () => {
|
|
480
|
-
|
|
481
|
-
a.remove(),
|
|
483
|
+
N(l), g.textContent = "✓ Fixed", g.style.background = "#4caf50", g.disabled = !0, g.style.cursor = "not-allowed", x(l, !1), setTimeout(() => {
|
|
484
|
+
a.remove(), E();
|
|
482
485
|
}, 1e3);
|
|
483
|
-
},
|
|
486
|
+
}, f.appendChild(g);
|
|
484
487
|
}
|
|
485
|
-
|
|
488
|
+
m.appendChild(f);
|
|
486
489
|
});
|
|
487
490
|
}
|
|
488
|
-
i.appendChild(s), i.appendChild(
|
|
489
|
-
|
|
491
|
+
i.appendChild(s), i.appendChild(m), a.appendChild(i), document.body.appendChild(a), a.onclick = (c) => {
|
|
492
|
+
c.target === a && (t.forEach((p) => x(p, !1)), a.remove());
|
|
490
493
|
};
|
|
491
|
-
const o = (
|
|
492
|
-
|
|
494
|
+
const o = (c) => {
|
|
495
|
+
c.key === "Escape" && (t.forEach((p) => x(p, !1)), a.remove(), document.removeEventListener("keydown", o));
|
|
493
496
|
};
|
|
494
497
|
document.addEventListener("keydown", o);
|
|
495
|
-
},
|
|
498
|
+
}, D = () => ({
|
|
496
499
|
name: "a11yChecker",
|
|
497
500
|
toolbar: [
|
|
498
501
|
{
|
|
@@ -505,7 +508,7 @@ const w = () => {
|
|
|
505
508
|
commands: {
|
|
506
509
|
toggleA11yChecker: () => {
|
|
507
510
|
try {
|
|
508
|
-
return
|
|
511
|
+
return E(), !0;
|
|
509
512
|
} catch (t) {
|
|
510
513
|
return console.error("Failed to open accessibility checker:", t), !1;
|
|
511
514
|
}
|
|
@@ -516,12 +519,12 @@ const w = () => {
|
|
|
516
519
|
}
|
|
517
520
|
});
|
|
518
521
|
export {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
+
D as A11yCheckerPlugin,
|
|
523
|
+
N as autoFixA11yIssue,
|
|
524
|
+
P as getA11yScore,
|
|
522
525
|
x as highlightIssue,
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
+
$ as runA11yAudit,
|
|
527
|
+
R as suppressRule,
|
|
528
|
+
F as unsuppressRule
|
|
526
529
|
};
|
|
527
|
-
//# sourceMappingURL=A11yCheckerPlugin.native-
|
|
530
|
+
//# sourceMappingURL=A11yCheckerPlugin.native-DIKuCeFw.mjs.map
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
+
import { i as z } from "./dialogHelpers-DBf7WqYH.mjs";
|
|
1
2
|
import { f as D, g as S } from "./editorContainerHelpers-C7kdWnS0.mjs";
|
|
2
3
|
const b = /* @__PURE__ */ new Set(), y = '[data-theme="dark"], .dark, .editora-theme-dark';
|
|
3
|
-
function
|
|
4
|
+
function R(t, l) {
|
|
4
5
|
if (l === t.innerHTML) return;
|
|
5
6
|
const i = window.execEditorCommand || window.executeEditorCommand;
|
|
6
7
|
if (typeof i == "function")
|
|
7
8
|
try {
|
|
8
9
|
i("recordDomTransaction", t, l, t.innerHTML);
|
|
9
|
-
} catch (
|
|
10
|
+
} catch (n) {
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function M() {
|
|
13
14
|
if (typeof window == "undefined" || window.__anchorObserverInitialized) return;
|
|
14
15
|
window.__anchorObserverInitialized = !0, new MutationObserver((l) => {
|
|
15
16
|
l.forEach((i) => {
|
|
16
|
-
i.removedNodes.forEach((
|
|
17
|
-
var
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
if ((
|
|
21
|
-
const c =
|
|
17
|
+
i.removedNodes.forEach((n) => {
|
|
18
|
+
var a, e;
|
|
19
|
+
if (n.nodeType === Node.ELEMENT_NODE) {
|
|
20
|
+
const r = n;
|
|
21
|
+
if ((a = r.classList) != null && a.contains("rte-anchor")) {
|
|
22
|
+
const c = r.id;
|
|
22
23
|
c && b.delete(c);
|
|
23
24
|
}
|
|
24
|
-
const f = (e =
|
|
25
|
+
const f = (e = r.querySelectorAll) == null ? void 0 : e.call(r, ".rte-anchor");
|
|
25
26
|
f == null || f.forEach((c) => {
|
|
26
27
|
const u = c.id;
|
|
27
28
|
u && b.delete(u);
|
|
@@ -35,35 +36,35 @@ function R() {
|
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
function A(t) {
|
|
38
|
-
return !t || t.trim().length === 0 ? { valid: !1, error: "Anchor ID cannot be empty" } : t.length > 256 ? { valid: !1, error: "Anchor ID must be less than 256 characters" } : /^[
|
|
39
|
+
return !t || t.trim().length === 0 ? { valid: !1, error: "Anchor ID cannot be empty" } : t.length > 256 ? { valid: !1, error: "Anchor ID must be less than 256 characters" } : /^[A-Za-z_]/.test(t) ? /^[A-Za-z0-9\-_]+$/.test(t) ? { valid: !0, error: "" } : { valid: !1, error: "Anchor ID can only contain letters, numbers, hyphens, and underscores" } : { valid: !1, error: "Anchor ID must start with a letter or underscore" };
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function H() {
|
|
41
42
|
const t = D();
|
|
42
43
|
if (!t) return;
|
|
43
44
|
const l = S(t);
|
|
44
45
|
if (!l) return;
|
|
45
|
-
const i = l.querySelectorAll(".rte-anchor"),
|
|
46
|
-
i.forEach((
|
|
47
|
-
const e =
|
|
48
|
-
e &&
|
|
49
|
-
}), b.clear(),
|
|
46
|
+
const i = l.querySelectorAll(".rte-anchor"), n = /* @__PURE__ */ new Set();
|
|
47
|
+
i.forEach((a) => {
|
|
48
|
+
const e = a.id;
|
|
49
|
+
e && n.add(e);
|
|
50
|
+
}), b.clear(), n.forEach((a) => b.add(a));
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
+
function _(t) {
|
|
52
53
|
if (t) {
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
54
|
+
const n = t.startContainer, a = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement;
|
|
55
|
+
if (a != null && a.closest(y)) return !0;
|
|
55
56
|
}
|
|
56
57
|
const l = window.getSelection();
|
|
57
58
|
if (l && l.rangeCount > 0) {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
59
|
+
const n = l.getRangeAt(0).startContainer, a = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement;
|
|
60
|
+
if (a != null && a.closest(y)) return !0;
|
|
60
61
|
}
|
|
61
62
|
const i = document.activeElement;
|
|
62
63
|
return i != null && i.closest(y) ? !0 : document.body.matches(y) || document.documentElement.matches(y);
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
const
|
|
65
|
+
function I(t, l, i, n) {
|
|
66
|
+
document.querySelectorAll(".rte-anchor-dialog-overlay").forEach((s) => s.remove()), H();
|
|
67
|
+
const a = _(n), e = a ? {
|
|
67
68
|
overlay: "rgba(0, 0, 0, 0.62)",
|
|
68
69
|
dialogBg: "#1f2937",
|
|
69
70
|
panelBg: "#222d3a",
|
|
@@ -111,8 +112,8 @@ function _(t, l, i, r) {
|
|
|
111
112
|
help: "#999999",
|
|
112
113
|
focusRing: "rgba(0, 102, 204, 0.1)",
|
|
113
114
|
errorRing: "rgba(211, 47, 47, 0.1)"
|
|
114
|
-
},
|
|
115
|
-
|
|
115
|
+
}, r = document.createElement("div");
|
|
116
|
+
z(r), r.className = "rte-anchor-dialog-overlay", r.style.cssText = `
|
|
116
117
|
position: fixed;
|
|
117
118
|
top: 0;
|
|
118
119
|
left: 0;
|
|
@@ -136,8 +137,8 @@ function _(t, l, i, r) {
|
|
|
136
137
|
overflow: hidden;
|
|
137
138
|
animation: rte-anchor-dialog-appear 0.2s ease;
|
|
138
139
|
`, !document.getElementById("rte-anchor-dialog-styles")) {
|
|
139
|
-
const
|
|
140
|
-
|
|
140
|
+
const s = document.createElement("style");
|
|
141
|
+
s.id = "rte-anchor-dialog-styles", s.textContent = `
|
|
141
142
|
@keyframes rte-anchor-dialog-appear {
|
|
142
143
|
from { opacity: 0; transform: scale(0.95); }
|
|
143
144
|
to { opacity: 1; transform: scale(1); }
|
|
@@ -145,7 +146,7 @@ function _(t, l, i, r) {
|
|
|
145
146
|
.rte-anchor-dialog input:focus {
|
|
146
147
|
outline: none !important;
|
|
147
148
|
}
|
|
148
|
-
`, document.head.appendChild(
|
|
149
|
+
`, document.head.appendChild(s);
|
|
149
150
|
}
|
|
150
151
|
let c = "";
|
|
151
152
|
const u = document.createElement("div");
|
|
@@ -207,8 +208,8 @@ function _(t, l, i, r) {
|
|
|
207
208
|
`;
|
|
208
209
|
const B = document.createElement("div");
|
|
209
210
|
B.textContent = "URL-safe ID (letters, numbers, hyphens, underscores). Must start with letter or underscore.", B.style.cssText = `color: ${e.help}; font-size: 12px; margin-top: 8px; line-height: 1.4;`, x.appendChild(v), x.appendChild(o), x.appendChild(g), x.appendChild(B), C.appendChild(x);
|
|
210
|
-
const
|
|
211
|
-
|
|
211
|
+
const E = document.createElement("div");
|
|
212
|
+
E.style.cssText = `
|
|
212
213
|
display: flex;
|
|
213
214
|
gap: 12px;
|
|
214
215
|
padding: 16px 20px;
|
|
@@ -228,8 +229,8 @@ function _(t, l, i, r) {
|
|
|
228
229
|
background: ${e.cancelBg};
|
|
229
230
|
color: ${e.cancelText};
|
|
230
231
|
`, h.onmouseover = () => h.style.background = e.cancelHover, h.onmouseout = () => h.style.background = e.cancelBg;
|
|
231
|
-
const
|
|
232
|
-
|
|
232
|
+
const d = document.createElement("button");
|
|
233
|
+
d.textContent = "Add Anchor", d.style.cssText = `
|
|
233
234
|
padding: 8px 16px;
|
|
234
235
|
font-size: 14px;
|
|
235
236
|
font-weight: 500;
|
|
@@ -239,19 +240,19 @@ function _(t, l, i, r) {
|
|
|
239
240
|
transition: all 0.2s ease;
|
|
240
241
|
background: ${e.saveBg};
|
|
241
242
|
color: white;
|
|
242
|
-
`,
|
|
243
|
+
`, d.disabled = !o.value.trim();
|
|
243
244
|
const $ = () => {
|
|
244
|
-
o.value.trim() ? (
|
|
245
|
+
o.value.trim() ? (d.disabled = !1, d.style.background = e.saveBg, d.style.color = "white", d.style.cursor = "pointer") : (d.disabled = !0, d.style.background = e.saveDisabledBg, d.style.color = e.saveDisabledText, d.style.cursor = "not-allowed");
|
|
245
246
|
};
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
},
|
|
249
|
-
|
|
250
|
-
},
|
|
251
|
-
const
|
|
252
|
-
if ($(),
|
|
253
|
-
const k = A(
|
|
254
|
-
k.valid ? b.has(
|
|
247
|
+
d.onmouseover = () => {
|
|
248
|
+
d.disabled || (d.style.background = e.saveHover, d.style.boxShadow = a ? "0 2px 8px rgba(59, 130, 246, 0.35)" : "0 2px 8px rgba(0, 102, 204, 0.3)");
|
|
249
|
+
}, d.onmouseout = () => {
|
|
250
|
+
d.disabled || (d.style.background = e.saveBg, d.style.boxShadow = "none");
|
|
251
|
+
}, E.appendChild(h), E.appendChild(d), o.oninput = () => {
|
|
252
|
+
const s = o.value;
|
|
253
|
+
if ($(), s.trim()) {
|
|
254
|
+
const k = A(s);
|
|
255
|
+
k.valid ? b.has(s) ? (c = `Anchor ID already exists: ${s}`, g.textContent = "⚠ " + c, g.style.display = "block", o.style.borderColor = e.fieldErrorBorder, o.style.background = e.fieldErrorBg) : (c = "", g.style.display = "none", o.style.borderColor = e.fieldBorder, o.style.background = e.fieldBg) : (c = k.error, g.textContent = "⚠ " + c, g.style.display = "block", o.style.borderColor = e.fieldErrorBorder, o.style.background = e.fieldErrorBg);
|
|
255
256
|
} else
|
|
256
257
|
g.style.display = "none", o.style.borderColor = e.fieldBorder, o.style.background = e.fieldBg;
|
|
257
258
|
}, o.onfocus = () => {
|
|
@@ -260,18 +261,18 @@ function _(t, l, i, r) {
|
|
|
260
261
|
o.style.boxShadow = "none", c || (o.style.background = e.fieldBg);
|
|
261
262
|
};
|
|
262
263
|
const T = () => {
|
|
263
|
-
const
|
|
264
|
-
!
|
|
265
|
-
},
|
|
266
|
-
|
|
264
|
+
const s = o.value.trim();
|
|
265
|
+
!s || !A(s).valid || b.has(s) || (i && i(s), r.remove());
|
|
266
|
+
}, w = () => {
|
|
267
|
+
r.remove();
|
|
267
268
|
};
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
},
|
|
271
|
-
|
|
272
|
-
}, f.appendChild(u), f.appendChild(C), f.appendChild(
|
|
269
|
+
d.onclick = T, h.onclick = w, p.onclick = w, o.onkeydown = (s) => {
|
|
270
|
+
s.key === "Enter" ? (s.preventDefault(), T()) : s.key === "Escape" && (s.preventDefault(), w());
|
|
271
|
+
}, r.onclick = (s) => {
|
|
272
|
+
s.target === r && w();
|
|
273
|
+
}, f.appendChild(u), f.appendChild(C), f.appendChild(E), r.appendChild(f), document.body.appendChild(r), setTimeout(() => o.focus(), 100);
|
|
273
274
|
}
|
|
274
|
-
function
|
|
275
|
+
function L(t, l) {
|
|
275
276
|
var c;
|
|
276
277
|
let i;
|
|
277
278
|
if (l)
|
|
@@ -281,26 +282,26 @@ function I(t, l) {
|
|
|
281
282
|
if (!u || u.rangeCount === 0) return;
|
|
282
283
|
i = u.getRangeAt(0);
|
|
283
284
|
}
|
|
284
|
-
let
|
|
285
|
-
for (;
|
|
286
|
-
if (
|
|
287
|
-
const u =
|
|
285
|
+
let n = null, a = i.startContainer;
|
|
286
|
+
for (; a && a !== document.body; ) {
|
|
287
|
+
if (a.nodeType === Node.ELEMENT_NODE) {
|
|
288
|
+
const u = a;
|
|
288
289
|
if (u.getAttribute("contenteditable") === "true") {
|
|
289
|
-
|
|
290
|
+
n = u;
|
|
290
291
|
break;
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
|
-
|
|
294
|
+
a = a.parentNode;
|
|
294
295
|
}
|
|
295
|
-
const e = (c =
|
|
296
|
-
|
|
296
|
+
const e = (c = n == null ? void 0 : n.innerHTML) != null ? c : "", r = document.createElement("span");
|
|
297
|
+
r.id = t, r.className = "rte-anchor", r.setAttribute("data-type", "anchor"), r.setAttribute("data-anchor-id", t), r.setAttribute("title", `Anchor: ${t}`), r.style.cssText = `
|
|
297
298
|
display: inline;
|
|
298
299
|
position: relative;
|
|
299
300
|
cursor: pointer;
|
|
300
|
-
`, i.insertNode(
|
|
301
|
+
`, i.insertNode(r), b.add(t), i.setStart(r.nextSibling || r.parentNode, 0), i.collapse(!0);
|
|
301
302
|
const f = window.getSelection();
|
|
302
|
-
if (f && (f.removeAllRanges(), f.addRange(i)),
|
|
303
|
-
|
|
303
|
+
if (f && (f.removeAllRanges(), f.addRange(i)), n)
|
|
304
|
+
R(n, e), n.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
304
305
|
else {
|
|
305
306
|
const u = D();
|
|
306
307
|
if (u) {
|
|
@@ -393,7 +394,7 @@ function N() {
|
|
|
393
394
|
}
|
|
394
395
|
`, document.head.appendChild(t);
|
|
395
396
|
}
|
|
396
|
-
const
|
|
397
|
+
const j = () => (typeof window != "undefined" && (M(), N()), {
|
|
397
398
|
name: "anchor",
|
|
398
399
|
toolbar: [
|
|
399
400
|
{
|
|
@@ -410,8 +411,8 @@ const O = () => (typeof window != "undefined" && (R(), N()), {
|
|
|
410
411
|
if (!t || t.rangeCount === 0)
|
|
411
412
|
return alert("Please place your cursor where you want to insert the anchor."), !1;
|
|
412
413
|
const l = t.getRangeAt(0).cloneRange();
|
|
413
|
-
return
|
|
414
|
-
|
|
414
|
+
return I("add", "", (i) => {
|
|
415
|
+
L(i, l);
|
|
415
416
|
}, l), !0;
|
|
416
417
|
} catch (t) {
|
|
417
418
|
return console.error("Failed to insert anchor:", t), !1;
|
|
@@ -423,6 +424,6 @@ const O = () => (typeof window != "undefined" && (R(), N()), {
|
|
|
423
424
|
}
|
|
424
425
|
});
|
|
425
426
|
export {
|
|
426
|
-
|
|
427
|
+
j as AnchorPlugin
|
|
427
428
|
};
|
|
428
|
-
//# sourceMappingURL=AnchorPlugin.native-
|
|
429
|
+
//# sourceMappingURL=AnchorPlugin.native-DXZdK3zr.mjs.map
|