@editora/core 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +34 -0
  2. package/dist/{A11yCheckerPlugin.native-CZKpi3uF.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +225 -173
  3. package/dist/AnchorPlugin.native-C1Rw5m04.mjs +404 -0
  4. package/dist/BackgroundColorPlugin.native-BE-p9DRd.mjs +489 -0
  5. package/dist/ChecklistPlugin.native-nuSSEFNI.mjs +309 -0
  6. package/dist/ClearFormattingPlugin.native-Bq_XcTh2.mjs +140 -0
  7. package/dist/{CodePlugin.native-CK9d8rmt.mjs → CodePlugin.native-0Zari_zp.mjs} +329 -310
  8. package/dist/CodeSamplePlugin.native-B-KS1pOl.mjs +384 -0
  9. package/dist/CommentsPlugin.native-tMnWn8a2.mjs +723 -0
  10. package/dist/DirectionPlugin.native-CDnbdNyl.mjs +130 -0
  11. package/dist/{EmbedIframePlugin.native-ifr9KLdN.mjs → EmbedIframePlugin.native-CSWIB1jm.mjs} +154 -50
  12. package/dist/{EmojisPlugin.native-D6mJSnSR.mjs → EmojisPlugin.native-DxTm_DL-.mjs} +156 -103
  13. package/dist/FontFamilyPlugin.native-j8hMTbg4.mjs +158 -0
  14. package/dist/FontSizePlugin.native-B_jCh7dY.mjs +286 -0
  15. package/dist/FootnotePlugin.native-D730OGRm.mjs +425 -0
  16. package/dist/HistoryPlugin.native-DCrPdeSW.mjs +257 -0
  17. package/dist/IndentPlugin.native-BHixp8sP.mjs +150 -0
  18. package/dist/LineHeightPlugin.native-CM7iXdQj.mjs +151 -0
  19. package/dist/{LinkPlugin.native-BdAOV-iu.mjs → LinkPlugin.native-CS2g-G18.mjs} +128 -53
  20. package/dist/{ListPlugin.native-CLFU5AUQ.mjs → ListPlugin.native-V7EZC1lM.mjs} +59 -12
  21. package/dist/MathPlugin.native-KUxz0o8C.mjs +251 -0
  22. package/dist/MediaManagerPlugin.native-CgP5iInD.mjs +970 -0
  23. package/dist/MergeTagPlugin.native-CU9LtsfD.mjs +416 -0
  24. package/dist/PageBreakPlugin.native-CGiQxXqR.mjs +297 -0
  25. package/dist/{PrintPlugin.native-BUpm52VJ.mjs → PrintPlugin.native-7qt5v7L5.mjs} +10 -10
  26. package/dist/{SpecialCharactersPlugin.native-x7a2SWXc.mjs → SpecialCharactersPlugin.native-DANrbExJ.mjs} +143 -97
  27. package/dist/SpellCheckPlugin.native-C8bPvRHy.mjs +1019 -0
  28. package/dist/StrikethroughPlugin.native-0Be7j49s.mjs +73 -0
  29. package/dist/{TablePlugin.native-EEWXn1-s.mjs → TablePlugin.native-DrHX-efe.mjs} +149 -145
  30. package/dist/TemplatePlugin.native-4lKEm-WY.mjs +578 -0
  31. package/dist/TextAlignmentPlugin.native-sM_1s00t.mjs +108 -0
  32. package/dist/{TextColorPlugin.native-D6SmTglm.mjs → TextColorPlugin.native-Clgtb50j.mjs} +173 -92
  33. package/dist/colorSelectionApply-CK1My9N2.mjs +67 -0
  34. package/dist/core.css +1 -1
  35. package/dist/editora.min.js +31 -29
  36. package/dist/editora.umd.js +31 -29
  37. package/dist/index-CqWQFb3D.js +10 -0
  38. package/dist/index-OwnkG39N.mjs +2227 -0
  39. package/dist/index.cjs.js +14 -18
  40. package/dist/index.esm.js +204 -521
  41. package/dist/plugin-loader.js +26 -26
  42. package/dist/webcomponent-core.js +1286 -295
  43. package/dist/webcomponent-core.min.css +1 -1
  44. package/dist/webcomponent-core.min.js +100 -75
  45. package/dist/webcomponent.cjs.js +1 -1
  46. package/dist/webcomponent.esm.js +1 -1
  47. package/dist/webcomponent.js +1252 -261
  48. package/dist/webcomponent.min.css +1 -1
  49. package/dist/webcomponent.min.js +3616 -2109
  50. package/index.d.ts +355 -0
  51. package/package.json +19 -17
  52. package/dist/A11yCheckerPlugin.native-CZKpi3uF.mjs.map +0 -1
  53. package/dist/AnchorPlugin.native-7es9PVZ9.mjs +0 -340
  54. package/dist/AnchorPlugin.native-7es9PVZ9.mjs.map +0 -1
  55. package/dist/BackgroundColorPlugin.native-Dip5uqTg.mjs +0 -449
  56. package/dist/BackgroundColorPlugin.native-Dip5uqTg.mjs.map +0 -1
  57. package/dist/BlockquotePlugin.native-JFmOLsxN.mjs.map +0 -1
  58. package/dist/BoldPlugin.native-BAzzoqU5.mjs.map +0 -1
  59. package/dist/CapitalizationPlugin.native-DOMsh5R7.mjs.map +0 -1
  60. package/dist/ChecklistPlugin.native-Dccs3nLe.mjs +0 -153
  61. package/dist/ChecklistPlugin.native-Dccs3nLe.mjs.map +0 -1
  62. package/dist/ClearFormattingPlugin.native-BZPDHswo.mjs +0 -27
  63. package/dist/ClearFormattingPlugin.native-BZPDHswo.mjs.map +0 -1
  64. package/dist/CodePlugin.native-CK9d8rmt.mjs.map +0 -1
  65. package/dist/CodeSamplePlugin.native-DMbEdO9j.mjs +0 -326
  66. package/dist/CodeSamplePlugin.native-DMbEdO9j.mjs.map +0 -1
  67. package/dist/CommentsPlugin.native-2zQV8Ia4.mjs +0 -473
  68. package/dist/CommentsPlugin.native-2zQV8Ia4.mjs.map +0 -1
  69. package/dist/DirectionPlugin.native-Be7wCzkI.mjs +0 -59
  70. package/dist/DirectionPlugin.native-Be7wCzkI.mjs.map +0 -1
  71. package/dist/DocumentManagerPlugin.native-BvZL5CSG.mjs.map +0 -1
  72. package/dist/EmbedIframePlugin.native-ifr9KLdN.mjs.map +0 -1
  73. package/dist/EmojisPlugin.native-D6mJSnSR.mjs.map +0 -1
  74. package/dist/FontFamilyPlugin.native-BzS_9qbM.mjs +0 -106
  75. package/dist/FontFamilyPlugin.native-BzS_9qbM.mjs.map +0 -1
  76. package/dist/FontSizePlugin.native-DkLMLPue.mjs +0 -186
  77. package/dist/FontSizePlugin.native-DkLMLPue.mjs.map +0 -1
  78. package/dist/FootnotePlugin.native-BciVc9W6.mjs +0 -128
  79. package/dist/FootnotePlugin.native-BciVc9W6.mjs.map +0 -1
  80. package/dist/FullscreenPlugin.native-ChXyxeNw.mjs.map +0 -1
  81. package/dist/HeadingPlugin.native-DrLYwQnQ.mjs.map +0 -1
  82. package/dist/HistoryPlugin.native-DoDRifCf.mjs +0 -89
  83. package/dist/HistoryPlugin.native-DoDRifCf.mjs.map +0 -1
  84. package/dist/IndentPlugin.native-CbFugPoi.mjs +0 -133
  85. package/dist/IndentPlugin.native-CbFugPoi.mjs.map +0 -1
  86. package/dist/ItalicPlugin.native-CQjjDyUL.mjs.map +0 -1
  87. package/dist/LineHeightPlugin.native-CWQT2FIa.mjs +0 -73
  88. package/dist/LineHeightPlugin.native-CWQT2FIa.mjs.map +0 -1
  89. package/dist/LinkPlugin.native-BdAOV-iu.mjs.map +0 -1
  90. package/dist/ListPlugin.native-CLFU5AUQ.mjs.map +0 -1
  91. package/dist/MathPlugin.native-DE_ii-LA.mjs +0 -182
  92. package/dist/MathPlugin.native-DE_ii-LA.mjs.map +0 -1
  93. package/dist/MediaManagerPlugin.native-DaYFDzNM.mjs +0 -533
  94. package/dist/MediaManagerPlugin.native-DaYFDzNM.mjs.map +0 -1
  95. package/dist/MergeTagPlugin.native-CrxyThyn.mjs +0 -178
  96. package/dist/MergeTagPlugin.native-CrxyThyn.mjs.map +0 -1
  97. package/dist/PageBreakPlugin.native-DDjcDyRW.mjs +0 -172
  98. package/dist/PageBreakPlugin.native-DDjcDyRW.mjs.map +0 -1
  99. package/dist/PreviewPlugin.native-DBvfpmIv.mjs.map +0 -1
  100. package/dist/PrintPlugin.native-BUpm52VJ.mjs.map +0 -1
  101. package/dist/SpecialCharactersPlugin.native-x7a2SWXc.mjs.map +0 -1
  102. package/dist/SpellCheckPlugin.native-B7yTh0iE.mjs +0 -465
  103. package/dist/SpellCheckPlugin.native-B7yTh0iE.mjs.map +0 -1
  104. package/dist/StrikethroughPlugin.native-ChaZLaXw.mjs +0 -43
  105. package/dist/StrikethroughPlugin.native-ChaZLaXw.mjs.map +0 -1
  106. package/dist/TablePlugin.native-EEWXn1-s.mjs.map +0 -1
  107. package/dist/TemplatePlugin.native-BlSn1c9h.mjs +0 -564
  108. package/dist/TemplatePlugin.native-BlSn1c9h.mjs.map +0 -1
  109. package/dist/TextAlignmentPlugin.native-CQIs1m7R.mjs +0 -97
  110. package/dist/TextAlignmentPlugin.native-CQIs1m7R.mjs.map +0 -1
  111. package/dist/TextColorPlugin.native-D6SmTglm.mjs.map +0 -1
  112. package/dist/UnderlinePlugin.native-QpIcK4L2.mjs.map +0 -1
  113. package/dist/documentManager-irzj9n3V.mjs.map +0 -1
  114. package/dist/editorContainerHelpers-C7kdWnS0.mjs.map +0 -1
  115. package/dist/editora.min.js.map +0 -1
  116. package/dist/editora.umd.js.map +0 -1
  117. package/dist/index-BF5RBhL9.js +0 -4
  118. package/dist/index-BF5RBhL9.js.map +0 -1
  119. package/dist/index-BPsf460l.mjs +0 -1243
  120. package/dist/index-BPsf460l.mjs.map +0 -1
  121. package/dist/index.cjs.js.map +0 -1
  122. package/dist/index.es-CuicffkQ.mjs.map +0 -1
  123. package/dist/index.esm.js.map +0 -1
  124. package/dist/plugin-loader.js.map +0 -1
  125. package/dist/purify.es-CKpwg8Tk.mjs.map +0 -1
  126. package/dist/webcomponent-core.js.map +0 -1
  127. package/dist/webcomponent-core.min.js.map +0 -1
  128. package/dist/webcomponent.cjs.js.map +0 -1
  129. package/dist/webcomponent.esm.js.map +0 -1
  130. package/dist/webcomponent.js.map +0 -1
  131. package/dist/webcomponent.min.js.map +0 -1
@@ -1,22 +1,22 @@
1
- const v = /* @__PURE__ */ new Set(), C = [], f = (t) => {
2
- C.push(t);
3
- };
4
- f({
1
+ const C = /* @__PURE__ */ new Set(), A = [], b = (t) => {
2
+ A.push(t);
3
+ }, v = '[data-theme="dark"], .dark, .editora-theme-dark';
4
+ b({
5
5
  id: "image-alt-text",
6
6
  wcag: "1.1.1",
7
7
  description: "Images must have alt text",
8
8
  severity: "error",
9
9
  selector: "img",
10
- evaluate(t, r) {
11
- var n;
10
+ evaluate(t, n) {
11
+ var r;
12
12
  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" ? null : !e.hasAttribute("alt") || ((n = e.getAttribute("alt")) == null ? void 0 : n.trim()) === "" ? {
14
- id: `img-alt-${r.cache.get("imgIdx")}`,
13
+ return e.hasAttribute("role") && e.getAttribute("role") === "presentation" || e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "image-alt-text" ? null : !e.hasAttribute("alt") || ((r = e.getAttribute("alt")) == null ? void 0 : r.trim()) === "" ? {
14
+ id: `img-alt-${n.cache.get("imgIdx")}`,
15
15
  rule: "image-alt-text",
16
16
  wcag: "1.1.1",
17
17
  severity: "error",
18
18
  message: "Image missing alt text",
19
- nodePath: r.cache.get("imgPath"),
19
+ nodePath: n.cache.get("imgPath"),
20
20
  element: e,
21
21
  suggestion: "Add descriptive alt text to all images",
22
22
  fixable: !0,
@@ -27,24 +27,24 @@ f({
27
27
  t.element && t.element.setAttribute("alt", "");
28
28
  }
29
29
  });
30
- f({
30
+ b({
31
31
  id: "empty-interactive",
32
32
  wcag: "4.1.2",
33
33
  description: "Interactive elements must have accessible names",
34
34
  severity: "error",
35
35
  selector: 'button, a, [role="button"]',
36
- evaluate(t, r) {
37
- var s;
36
+ evaluate(t, n) {
37
+ var c;
38
38
  const e = t;
39
39
  if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "empty-interactive") return null;
40
- const n = (s = e.textContent) == null ? void 0 : s.trim(), a = e.hasAttribute("aria-label"), l = e.hasAttribute("aria-labelledby"), c = e.hasAttribute("title");
41
- return !n && !a && !l && !c ? {
42
- id: `interactive-empty-${r.cache.get("buttonIdx")}`,
40
+ const r = (c = e.textContent) == null ? void 0 : c.trim(), a = e.hasAttribute("aria-label"), i = e.hasAttribute("aria-labelledby"), s = e.hasAttribute("title");
41
+ return !r && !a && !i && !s ? {
42
+ id: `interactive-empty-${n.cache.get("buttonIdx")}`,
43
43
  rule: "empty-interactive",
44
44
  wcag: "4.1.2",
45
45
  severity: "error",
46
46
  message: "Interactive element has no accessible name",
47
- nodePath: r.cache.get("buttonPath"),
47
+ nodePath: n.cache.get("buttonPath"),
48
48
  element: e,
49
49
  suggestion: "Add text, aria-label, aria-labelledby, or title",
50
50
  fixable: !0,
@@ -55,23 +55,23 @@ f({
55
55
  t.element && t.element.setAttribute("aria-label", "Button");
56
56
  }
57
57
  });
58
- f({
58
+ b({
59
59
  id: "form-label",
60
60
  wcag: "1.3.1",
61
61
  description: "Form controls must have labels",
62
62
  severity: "error",
63
63
  selector: "input, textarea, select",
64
- evaluate(t, r) {
64
+ evaluate(t, n) {
65
65
  const e = t;
66
66
  if (e.hasAttribute("type") && e.getAttribute("type") === "hidden" || e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "form-label") return null;
67
- const n = r.doc.querySelector(`label[for="${e.getAttribute("id")}"]`), a = e.hasAttribute("aria-label"), l = e.hasAttribute("aria-labelledby");
68
- return !n && !a && !l ? {
69
- id: `form-label-${r.cache.get("inputIdx")}`,
67
+ const r = n.doc.querySelector(`label[for="${e.getAttribute("id")}"]`), a = e.hasAttribute("aria-label"), i = e.hasAttribute("aria-labelledby");
68
+ return !r && !a && !i ? {
69
+ id: `form-label-${n.cache.get("inputIdx")}`,
70
70
  rule: "form-label",
71
71
  wcag: "1.3.1",
72
72
  severity: "error",
73
73
  message: "Form control missing label",
74
- nodePath: r.cache.get("inputPath"),
74
+ nodePath: n.cache.get("inputPath"),
75
75
  element: e,
76
76
  suggestion: "Add <label>, aria-label, or aria-labelledby",
77
77
  fixable: !0,
@@ -82,23 +82,23 @@ f({
82
82
  t.element && t.element.setAttribute("aria-label", "Input");
83
83
  }
84
84
  });
85
- f({
85
+ b({
86
86
  id: "table-headers",
87
87
  wcag: "1.3.1",
88
88
  description: "Tables must have header rows",
89
89
  severity: "error",
90
90
  selector: "table",
91
- evaluate(t, r) {
91
+ evaluate(t, n) {
92
92
  const e = t;
93
93
  if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "table-headers") return null;
94
- const n = e.querySelectorAll("th"), a = e.querySelectorAll("tr");
95
- return n.length === 0 && a.length > 0 ? {
96
- id: `table-no-headers-${r.cache.get("tableIdx")}`,
94
+ const r = e.querySelectorAll("th"), a = e.querySelectorAll("tr");
95
+ return r.length === 0 && a.length > 0 ? {
96
+ id: `table-no-headers-${n.cache.get("tableIdx")}`,
97
97
  rule: "table-headers",
98
98
  wcag: "1.3.1",
99
99
  severity: "error",
100
100
  message: "Table missing header row (<th> elements)",
101
- nodePath: r.cache.get("tablePath"),
101
+ nodePath: n.cache.get("tablePath"),
102
102
  element: e,
103
103
  suggestion: "Add <th> elements to first row",
104
104
  fixable: !0,
@@ -108,89 +108,89 @@ f({
108
108
  fix(t) {
109
109
  if (t.element) {
110
110
  const e = t.element.querySelector("tr");
111
- e && Array.from(e.children).forEach((n) => {
112
- if (n.tagName === "TD") {
111
+ e && Array.from(e.children).forEach((r) => {
112
+ if (r.tagName === "TD") {
113
113
  const a = document.createElement("th");
114
- a.innerHTML = n.innerHTML, e.replaceChild(a, n);
114
+ a.innerHTML = r.innerHTML, e.replaceChild(a, r);
115
115
  }
116
116
  });
117
117
  }
118
118
  }
119
119
  });
120
- f({
120
+ b({
121
121
  id: "heading-empty",
122
122
  wcag: "1.3.1",
123
123
  description: "Headings must not be empty",
124
124
  severity: "error",
125
125
  selector: "h1, h2, h3, h4, h5, h6",
126
- evaluate(t, r) {
127
- var l;
126
+ evaluate(t, n) {
127
+ var i;
128
128
  const e = t;
129
129
  if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "heading-empty") return null;
130
- const n = ((l = e.textContent) == null ? void 0 : l.replace(/\s+/g, "")) || "", a = e.childNodes.length === 1 && e.childNodes[0].nodeName === "BR";
131
- return !n && !a ? {
132
- id: `heading-empty-${r.cache.get("headingIdx")}`,
130
+ const r = ((i = e.textContent) == null ? void 0 : i.replace(/\s+/g, "")) || "", a = e.childNodes.length === 1 && e.childNodes[0].nodeName === "BR";
131
+ return !r && !a ? {
132
+ id: `heading-empty-${n.cache.get("headingIdx")}`,
133
133
  rule: "heading-empty",
134
134
  wcag: "1.3.1",
135
135
  severity: "error",
136
136
  message: `Empty ${e.tagName.toLowerCase()} heading`,
137
- nodePath: r.cache.get("headingPath"),
137
+ nodePath: n.cache.get("headingPath"),
138
138
  element: e,
139
139
  suggestion: "All headings must contain text",
140
140
  fixable: !1
141
141
  } : null;
142
142
  }
143
143
  });
144
- f({
144
+ b({
145
145
  id: "heading-order",
146
146
  wcag: "1.3.1",
147
147
  description: "Headings should not skip levels",
148
148
  severity: "warning",
149
149
  selector: "h1, h2, h3, h4, h5, h6",
150
- evaluate(t, r) {
151
- const e = t, n = parseInt(e.tagName[1]), a = r.cache.get("previousHeadingLevel") || n;
152
- return r.cache.set("previousHeadingLevel", n), n - a > 1 ? {
153
- id: `heading-order-${r.cache.get("headingIdx")}`,
150
+ evaluate(t, n) {
151
+ const e = t, r = parseInt(e.tagName[1]), a = n.cache.get("previousHeadingLevel") || r;
152
+ return n.cache.set("previousHeadingLevel", r), r - a > 1 ? {
153
+ id: `heading-order-${n.cache.get("headingIdx")}`,
154
154
  rule: "heading-order",
155
155
  wcag: "1.3.1",
156
156
  severity: "warning",
157
- message: `Heading skips level (${a} → ${n})`,
158
- nodePath: r.cache.get("headingPath"),
157
+ message: `Heading skips level (${a} → ${r})`,
158
+ nodePath: n.cache.get("headingPath"),
159
159
  element: e,
160
160
  suggestion: `Use heading level ${a + 1} instead`,
161
161
  fixable: !1
162
162
  } : null;
163
163
  }
164
164
  });
165
- f({
165
+ b({
166
166
  id: "link-text",
167
167
  wcag: "2.4.4",
168
168
  description: "Links must have descriptive text",
169
169
  severity: "error",
170
170
  selector: "a",
171
- evaluate(t, r) {
172
- var c, s;
171
+ evaluate(t, n) {
172
+ var s, c;
173
173
  const e = t;
174
174
  if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "link-text") return null;
175
- const n = ((c = e.textContent) == null ? void 0 : c.replace(/\s+/g, "").toLowerCase()) || "", a = e.childNodes.length === 1 && e.childNodes[0].nodeName === "BR", l = ["clickhere", "readmore", "link", "here", "this", "page"];
176
- return !n && !a ? {
177
- id: `link-empty-${r.cache.get("aIdx")}`,
175
+ 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"];
176
+ return !r && !a ? {
177
+ id: `link-empty-${n.cache.get("aIdx")}`,
178
178
  rule: "link-text",
179
179
  wcag: "2.4.4",
180
180
  severity: "error",
181
181
  message: "Link has no text content",
182
- nodePath: r.cache.get("aPath"),
182
+ nodePath: n.cache.get("aPath"),
183
183
  element: e,
184
184
  suggestion: "All links must have descriptive text",
185
185
  fixable: !0,
186
186
  fixLabel: "Insert placeholder"
187
- } : l.some((u) => n.includes(u)) ? {
188
- id: `link-vague-${r.cache.get("aIdx")}`,
187
+ } : i.some((h) => r.includes(h)) ? {
188
+ id: `link-vague-${n.cache.get("aIdx")}`,
189
189
  rule: "link-text",
190
190
  wcag: "2.4.4",
191
191
  severity: "warning",
192
- message: `Vague link text: "${(s = e.textContent) == null ? void 0 : s.trim()}"`,
193
- nodePath: r.cache.get("aPath"),
192
+ message: `Vague link text: "${(c = e.textContent) == null ? void 0 : c.trim()}"`,
193
+ nodePath: n.cache.get("aPath"),
194
194
  element: e,
195
195
  suggestion: "Use descriptive link text",
196
196
  fixable: !1
@@ -200,113 +200,155 @@ f({
200
200
  t.element && (t.element.textContent = "Link");
201
201
  }
202
202
  });
203
- f({
203
+ b({
204
204
  id: "list-structure",
205
205
  wcag: "1.3.1",
206
206
  description: "Lists must only contain <li> children",
207
207
  severity: "error",
208
208
  selector: "ul, ol",
209
- evaluate(t, r) {
209
+ evaluate(t, n) {
210
210
  const e = t;
211
211
  if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "list-structure") return null;
212
- const n = e.querySelectorAll(":scope > li");
213
- return Array.from(e.children).filter((l) => l.tagName !== "LI").length > 0 ? {
214
- id: `list-structure-${r.cache.get("ulIdx")}`,
212
+ const r = e.querySelectorAll(":scope > li");
213
+ return Array.from(e.children).filter((i) => i.tagName !== "LI").length > 0 ? {
214
+ id: `list-structure-${n.cache.get("ulIdx")}`,
215
215
  rule: "list-structure",
216
216
  wcag: "1.3.1",
217
217
  severity: "error",
218
218
  message: "List contains non-li elements",
219
- nodePath: r.cache.get("ulPath"),
219
+ nodePath: n.cache.get("ulPath"),
220
220
  element: e,
221
221
  suggestion: "All direct children of ul/ol must be li elements",
222
222
  fixable: !1
223
- } : n.length === 0 ? {
224
- id: `list-empty-${r.cache.get("ulIdx")}`,
223
+ } : r.length === 0 ? {
224
+ id: `list-empty-${n.cache.get("ulIdx")}`,
225
225
  rule: "list-structure",
226
226
  wcag: "1.3.1",
227
227
  severity: "warning",
228
228
  message: "Empty list element",
229
- nodePath: r.cache.get("ulPath"),
229
+ nodePath: n.cache.get("ulPath"),
230
230
  element: e,
231
231
  suggestion: "Remove empty lists or add list items",
232
232
  fixable: !1
233
233
  } : null;
234
234
  }
235
235
  });
236
- const L = () => {
236
+ const w = () => {
237
237
  const t = window.getSelection();
238
238
  if (t && t.rangeCount > 0) {
239
239
  let e = t.getRangeAt(0).startContainer;
240
240
  for (; e && e !== document.body; ) {
241
241
  if (e.nodeType === Node.ELEMENT_NODE) {
242
- const n = e;
243
- if (n.getAttribute("contenteditable") === "true")
244
- return n;
242
+ const r = e;
243
+ if (r.getAttribute("contenteditable") === "true")
244
+ return r;
245
245
  }
246
246
  e = e.parentNode;
247
247
  }
248
248
  }
249
- const r = document.activeElement;
250
- if (r) {
251
- if (r.getAttribute("contenteditable") === "true")
252
- return r;
253
- const e = r.closest('[contenteditable="true"]');
249
+ const n = document.activeElement;
250
+ if (n) {
251
+ if (n.getAttribute("contenteditable") === "true")
252
+ return n;
253
+ const e = n.closest('[contenteditable="true"]');
254
254
  if (e) return e;
255
255
  }
256
256
  return document.querySelector('[contenteditable="true"]');
257
- }, A = () => {
258
- var u, m, y;
259
- const t = L();
257
+ }, T = () => {
258
+ const t = w();
259
+ if (t != null && t.closest(v)) return !0;
260
+ const n = window.getSelection();
261
+ if (n && n.rangeCount > 0) {
262
+ const r = n.getRangeAt(0).startContainer, a = r.nodeType === Node.ELEMENT_NODE ? r : r.parentElement;
263
+ if (a != null && a.closest(v)) return !0;
264
+ }
265
+ const e = document.activeElement;
266
+ return e != null && e.closest(v) ? !0 : document.body.matches(v) || document.documentElement.matches(v);
267
+ }, k = () => {
268
+ var h, u, y;
269
+ const t = w();
260
270
  if (!t) return [];
261
- const r = [], e = { doc: t.ownerDocument || document, cache: /* @__PURE__ */ new Map() }, n = e.doc.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, null);
262
- let a = n.currentNode, l = {}, c = {}, s = 0;
263
- for (; a && s < 5e3; ) {
264
- const d = a, i = ((m = (u = d.tagName) == null ? void 0 : u.toLowerCase) == null ? void 0 : m.call(u)) || "";
265
- if (d.hidden || d.style.display === "none" || d.style.visibility === "hidden") {
266
- a = n.nextNode(), s++;
271
+ 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, i = {}, s = {}, c = 0;
273
+ for (; a && c < 5e3; ) {
274
+ const f = a, o = ((u = (h = f.tagName) == null ? void 0 : h.toLowerCase) == null ? void 0 : u.call(h)) || "";
275
+ if (f.hidden || f.style.display === "none" || f.style.visibility === "hidden") {
276
+ a = r.nextNode(), c++;
267
277
  continue;
268
278
  }
269
- l[i] = (l[i] || 0) + 1, c[i] = `${i}[${l[i] - 1}]`;
270
- for (const p of C) {
271
- if (v.has(p.id) || p.selector && !((y = a.matches) != null && y.call(a, p.selector))) continue;
272
- e.cache.set(`${i}Idx`, l[i] - 1), e.cache.set(`${i}Path`, c[i]), /^h[1-6]$/.test(i) && (e.cache.set("headingIdx", l[i] - 1), e.cache.set("headingPath", c[i])), i === "a" && (e.cache.set("aIdx", l[i] - 1), e.cache.set("aPath", c[i])), i === "table" && (e.cache.set("tableIdx", l[i] - 1), e.cache.set("tablePath", c[i])), i === "button" && (e.cache.set("buttonIdx", l[i] - 1), e.cache.set("buttonPath", c[i])), i === "input" && (e.cache.set("inputIdx", l[i] - 1), e.cache.set("inputPath", c[i])), (i === "ul" || i === "ol") && (e.cache.set("ulIdx", l[i] - 1), e.cache.set("ulPath", c[i]));
273
- const x = p.evaluate(a, e);
274
- x && r.push(x);
279
+ i[o] = (i[o] || 0) + 1, s[o] = `${o}[${i[o] - 1}]`;
280
+ for (const d of A) {
281
+ if (C.has(d.id) || d.selector && !((y = a.matches) != null && y.call(a, d.selector))) continue;
282
+ 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 = d.evaluate(a, e);
284
+ p && n.push(p);
275
285
  }
276
- a = n.nextNode(), s++;
286
+ a = r.nextNode(), c++;
277
287
  }
278
- return r;
279
- }, b = (t, r = !0) => {
280
- t.element && (r ? (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 = ""));
281
- }, E = (t) => {
282
- t || (t = A());
283
- const r = t.filter((a) => a.severity === "error").length, e = t.filter((a) => a.severity === "warning").length;
284
- let n = 100 - r * 20 - e * 5;
285
- return Math.max(0, n);
286
- }, $ = (t) => {
287
- const r = C.find((e) => e.id === t.rule);
288
- r && r.fix && r.fix(t);
288
+ return n;
289
+ }, x = (t, n = !0) => {
290
+ 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 = ""));
289
291
  }, I = (t) => {
290
- v.add(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);
291
299
  }, P = (t) => {
292
- v.delete(t);
293
- }, w = () => {
294
- const t = A(), r = E(t), e = document.createElement("div");
295
- e.className = "a11y-dialog-overlay", e.style.cssText = `
300
+ C.add(t);
301
+ }, N = (t) => {
302
+ C.delete(t);
303
+ }, $ = () => {
304
+ const t = k(), n = I(t), r = T() ? {
305
+ overlay: "rgba(0, 0, 0, 0.62)",
306
+ dialogBg: "#1f2937",
307
+ panelBg: "#222d3a",
308
+ border: "#3b4657",
309
+ text: "#e2e8f0",
310
+ muted: "#9fb0c6",
311
+ closeHover: "#334155",
312
+ summaryBg: "#111827",
313
+ issueBg: "#1f2937",
314
+ issueHoverBg: "#273244",
315
+ issueBorder: "#4b5563",
316
+ issueHoverBorder: "#58a6ff",
317
+ fixBtn: "#3b82f6",
318
+ fixBtnHover: "#2563eb"
319
+ } : {
320
+ overlay: "rgba(0, 0, 0, 0.5)",
321
+ dialogBg: "#ffffff",
322
+ panelBg: "#ffffff",
323
+ border: "#e0e0e0",
324
+ text: "#1f2937",
325
+ muted: "#666666",
326
+ closeHover: "#f0f0f0",
327
+ summaryBg: "#f5f5f5",
328
+ issueBg: "#ffffff",
329
+ issueHoverBg: "#f5f9ff",
330
+ issueBorder: "#e0e0e0",
331
+ issueHoverBorder: "#2196f3",
332
+ fixBtn: "#2196f3",
333
+ fixBtnHover: "#1976d2"
334
+ }, a = document.createElement("div");
335
+ a.className = "a11y-dialog-overlay", a.style.cssText = `
296
336
  position: fixed;
297
337
  top: 0;
298
338
  left: 0;
299
339
  right: 0;
300
340
  bottom: 0;
301
- background: rgba(0, 0, 0, 0.5);
341
+ background: ${r.overlay};
302
342
  z-index: 10000;
303
343
  display: flex;
304
344
  align-items: center;
305
345
  justify-content: center;
306
346
  `;
307
- const n = document.createElement("div");
308
- n.className = "a11y-dialog", n.style.cssText = `
309
- background: white;
347
+ const i = document.createElement("div");
348
+ i.className = "a11y-dialog", i.style.cssText = `
349
+ background: ${r.dialogBg};
350
+ border: 1px solid ${r.border};
351
+ color: ${r.text};
310
352
  border-radius: 8px;
311
353
  max-width: 800px;
312
354
  width: 90%;
@@ -315,27 +357,28 @@ const L = () => {
315
357
  flex-direction: column;
316
358
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
317
359
  `;
318
- const a = document.createElement("div");
319
- a.style.cssText = `
360
+ const s = document.createElement("div");
361
+ s.style.cssText = `
320
362
  padding: 20px;
321
- border-bottom: 1px solid #e0e0e0;
363
+ border-bottom: 1px solid ${r.border};
364
+ background: ${r.panelBg};
322
365
  display: flex;
323
366
  align-items: center;
324
367
  justify-content: space-between;
325
368
  `;
326
- const l = document.createElement("h2");
327
- l.style.cssText = "margin: 0; font-size: 20px; font-weight: 600;", l.textContent = "Accessibility Checker";
328
- const c = document.createElement("div");
329
- c.style.cssText = `
369
+ const c = document.createElement("h2");
370
+ c.style.cssText = `margin: 0; font-size: 20px; font-weight: 600; color: ${r.text};`, c.textContent = "Accessibility Checker";
371
+ const h = document.createElement("div");
372
+ h.style.cssText = `
330
373
  font-size: 24px;
331
374
  font-weight: bold;
332
375
  padding: 8px 16px;
333
376
  border-radius: 4px;
334
- background: ${r >= 80 ? "#4caf50" : r >= 60 ? "#ff9800" : "#f44336"};
377
+ background: ${n >= 80 ? "#4caf50" : n >= 60 ? "#ff9800" : "#f44336"};
335
378
  color: white;
336
- `, c.textContent = `${r}/100`;
337
- const s = document.createElement("button");
338
- s.textContent = "✕", s.style.cssText = `
379
+ `, h.textContent = `${n}/100`;
380
+ const u = document.createElement("button");
381
+ u.textContent = "✕", u.style.cssText = `
339
382
  background: none;
340
383
  border: none;
341
384
  font-size: 24px;
@@ -347,76 +390,85 @@ const L = () => {
347
390
  align-items: center;
348
391
  justify-content: center;
349
392
  border-radius: 4px;
350
- `, s.onmouseover = () => s.style.background = "#f0f0f0", s.onmouseout = () => s.style.background = "none", s.onclick = () => {
351
- t.forEach((d) => b(d, !1)), e.remove();
393
+ color: ${r.muted};
394
+ `, u.onmouseover = () => {
395
+ u.style.background = r.closeHover, u.style.color = "#f8fafc";
396
+ }, u.onmouseout = () => {
397
+ u.style.background = "none", u.style.color = r.muted;
398
+ }, u.onclick = () => {
399
+ t.forEach((d) => x(d, !1)), a.remove();
352
400
  };
353
- const u = document.createElement("div");
354
- u.style.cssText = "display: flex; align-items: center; gap: 16px;", u.appendChild(l), u.appendChild(c), a.appendChild(u), a.appendChild(s);
355
- const m = document.createElement("div");
356
- if (m.style.cssText = `
401
+ const y = document.createElement("div");
402
+ y.style.cssText = "display: flex; align-items: center; gap: 16px;", y.appendChild(c), y.appendChild(h), s.appendChild(y), s.appendChild(u);
403
+ const f = document.createElement("div");
404
+ if (f.style.cssText = `
357
405
  flex: 1;
358
406
  overflow-y: auto;
359
407
  padding: 20px;
408
+ background: ${r.dialogBg};
360
409
  `, t.length === 0)
361
- m.innerHTML = `
410
+ f.innerHTML = `
362
411
  <div style="text-align: center; padding: 40px 20px;">
363
412
  <div style="font-size: 48px; margin-bottom: 16px;">✅</div>
364
413
  <h3 style="margin: 0 0 8px 0; color: #4caf50;">No issues found!</h3>
365
- <p style="margin: 0; color: #666;">Your content meets WCAG 2.1 AA standards.</p>
414
+ <p style="margin: 0; color: ${r.muted};">Your content meets WCAG 2.1 AA standards.</p>
366
415
  </div>
367
416
  `;
368
417
  else {
369
418
  const d = document.createElement("div");
370
419
  d.style.cssText = `
371
- background: #f5f5f5;
420
+ background: ${r.summaryBg};
421
+ border: 1px solid ${r.border};
372
422
  padding: 12px 16px;
373
423
  border-radius: 6px;
374
424
  margin-bottom: 20px;
375
425
  display: flex;
376
426
  gap: 20px;
377
427
  `;
378
- const i = t.filter((o) => o.severity === "error").length, p = t.filter((o) => o.severity === "warning").length, x = t.filter((o) => o.severity === "info").length;
428
+ const p = t.filter((l) => l.severity === "error").length, E = t.filter((l) => l.severity === "warning").length, L = t.filter((l) => l.severity === "info").length;
379
429
  d.innerHTML = `
380
- <div><strong style="color: #f44336;">${i}</strong> <span style="color: #666;">Errors</span></div>
381
- <div><strong style="color: #ff9800;">${p}</strong> <span style="color: #666;">Warnings</span></div>
382
- <div><strong style="color: #2196f3;">${x}</strong> <span style="color: #666;">Info</span></div>
383
- `, m.appendChild(d), t.forEach((o) => {
384
- const h = document.createElement("div");
385
- h.style.cssText = `
386
- border: 1px solid #e0e0e0;
430
+ <div><strong style="color: #f44336;">${p}</strong> <span style="color: ${r.muted};">Errors</span></div>
431
+ <div><strong style="color: #ff9800;">${E}</strong> <span style="color: ${r.muted};">Warnings</span></div>
432
+ <div><strong style="color: #2196f3;">${L}</strong> <span style="color: ${r.muted};">Info</span></div>
433
+ `, f.appendChild(d), t.forEach((l) => {
434
+ const m = document.createElement("div");
435
+ m.style.cssText = `
436
+ border: 1px solid ${r.issueBorder};
387
437
  border-radius: 6px;
388
438
  padding: 16px;
389
439
  margin-bottom: 12px;
390
440
  transition: all 0.2s;
391
- `, h.onmouseover = () => {
392
- h.style.borderColor = "#2196f3", h.style.background = "#f5f9ff", b(o, !0);
393
- }, h.onmouseout = () => {
394
- h.style.borderColor = "#e0e0e0", h.style.background = "white", b(o, !1);
441
+ background: ${r.issueBg};
442
+ color: ${r.text};
443
+ `, m.onmouseover = () => {
444
+ m.style.borderColor = r.issueHoverBorder, m.style.background = r.issueHoverBg, x(l, !0);
445
+ }, m.onmouseout = () => {
446
+ m.style.borderColor = r.issueBorder, m.style.background = r.issueBg, x(l, !1);
395
447
  };
396
- const k = o.severity === "error" ? "#f44336" : o.severity === "warning" ? "#ff9800" : "#2196f3";
397
- if (h.innerHTML = `
448
+ const B = l.severity === "error" ? "#f44336" : l.severity === "warning" ? "#ff9800" : "#2196f3";
449
+ if (m.innerHTML = `
398
450
  <div style="display: flex; align-items: start; gap: 12px; margin-bottom: 8px;">
399
451
  <span style="
400
- background: ${k};
452
+ background: ${B};
401
453
  color: white;
402
454
  padding: 2px 8px;
403
455
  border-radius: 4px;
404
456
  font-size: 12px;
405
457
  font-weight: 600;
406
458
  text-transform: uppercase;
407
- ">${o.severity}</span>
459
+ ">${l.severity}</span>
408
460
  <div style="flex: 1;">
409
- <div style="font-weight: 600; margin-bottom: 4px;">${o.message}</div>
410
- <div style="font-size: 12px; color: #666;">WCAG ${o.wcag} · ${o.rule}</div>
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>
411
463
  </div>
412
464
  </div>
413
- <div style="font-size: 14px; color: #444; margin-bottom: 8px; padding-left: 68px;">
414
- ${o.suggestion || ""}
465
+ <div style="font-size: 14px; color: ${r.text}; margin-bottom: 8px; padding-left: 68px;">
466
+ ${l.suggestion || ""}
415
467
  </div>
416
- `, o.fixable) {
468
+ `, l.fixable) {
417
469
  const g = document.createElement("button");
418
- g.textContent = `🔧 ${o.fixLabel || "Auto-fix"}`, g.style.cssText = `
419
- background: #2196f3;
470
+ g.textContent = `🔧 ${l.fixLabel || "Auto-fix"}`, g.style.cssText = `
471
+ background: ${r.fixBtn};
420
472
  color: white;
421
473
  border: none;
422
474
  padding: 6px 12px;
@@ -424,23 +476,23 @@ const L = () => {
424
476
  cursor: pointer;
425
477
  font-size: 13px;
426
478
  margin-left: 68px;
427
- `, g.onmouseover = () => g.style.background = "#1976d2", g.onmouseout = () => g.style.background = "#2196f3", g.onclick = () => {
428
- $(o), g.textContent = "✓ Fixed", g.style.background = "#4caf50", g.disabled = !0, g.style.cursor = "not-allowed", b(o, !1), setTimeout(() => {
429
- e.remove(), w();
479
+ `, g.onmouseover = () => g.style.background = r.fixBtnHover, g.onmouseout = () => g.style.background = r.fixBtn, g.onclick = () => {
480
+ H(l), g.textContent = "✓ Fixed", g.style.background = "#4caf50", g.disabled = !0, g.style.cursor = "not-allowed", x(l, !1), setTimeout(() => {
481
+ a.remove(), $();
430
482
  }, 1e3);
431
- }, h.appendChild(g);
483
+ }, m.appendChild(g);
432
484
  }
433
- m.appendChild(h);
485
+ f.appendChild(m);
434
486
  });
435
487
  }
436
- n.appendChild(a), n.appendChild(m), e.appendChild(n), document.body.appendChild(e), e.onclick = (d) => {
437
- d.target === e && (t.forEach((i) => b(i, !1)), e.remove());
488
+ i.appendChild(s), i.appendChild(f), a.appendChild(i), document.body.appendChild(a), a.onclick = (d) => {
489
+ d.target === a && (t.forEach((p) => x(p, !1)), a.remove());
438
490
  };
439
- const y = (d) => {
440
- d.key === "Escape" && (t.forEach((i) => b(i, !1)), e.remove(), document.removeEventListener("keydown", y));
491
+ const o = (d) => {
492
+ d.key === "Escape" && (t.forEach((p) => x(p, !1)), a.remove(), document.removeEventListener("keydown", o));
441
493
  };
442
- document.addEventListener("keydown", y);
443
- }, T = () => ({
494
+ document.addEventListener("keydown", o);
495
+ }, M = () => ({
444
496
  name: "a11yChecker",
445
497
  toolbar: [
446
498
  {
@@ -453,7 +505,7 @@ const L = () => {
453
505
  commands: {
454
506
  toggleA11yChecker: () => {
455
507
  try {
456
- return w(), !0;
508
+ return $(), !0;
457
509
  } catch (t) {
458
510
  return console.error("Failed to open accessibility checker:", t), !1;
459
511
  }
@@ -464,12 +516,12 @@ const L = () => {
464
516
  }
465
517
  });
466
518
  export {
467
- T as A11yCheckerPlugin,
468
- $ as autoFixA11yIssue,
469
- E as getA11yScore,
470
- b as highlightIssue,
471
- A as runA11yAudit,
472
- I as suppressRule,
473
- P as unsuppressRule
519
+ M as A11yCheckerPlugin,
520
+ H as autoFixA11yIssue,
521
+ I as getA11yScore,
522
+ x as highlightIssue,
523
+ k as runA11yAudit,
524
+ P as suppressRule,
525
+ N as unsuppressRule
474
526
  };
475
- //# sourceMappingURL=A11yCheckerPlugin.native-CZKpi3uF.mjs.map
527
+ //# sourceMappingURL=A11yCheckerPlugin.native-BRdGYMju.mjs.map