@editora/plugins 1.0.17 → 1.0.18

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 (100) hide show
  1. package/dist/{CodePlugin.native-Cqi46sxh.js → CodePlugin.native-Bwf25lLX.js} +6 -6
  2. package/dist/{CodePlugin.native-CmnEFfJi.mjs → CodePlugin.native-Cpp4u3Jl.mjs} +23 -21
  3. package/dist/a11y-checker.cjs.js +16 -16
  4. package/dist/a11y-checker.esm.js +79 -75
  5. package/dist/anchor.cjs.js +9 -9
  6. package/dist/anchor.esm.js +61 -60
  7. package/dist/anchoredPopover-Bg-ey7Yo.js +1 -0
  8. package/dist/anchoredPopover-D_JbjvdA.mjs +111 -0
  9. package/dist/approval-workflow.cjs.js +5 -5
  10. package/dist/approval-workflow.esm.js +105 -104
  11. package/dist/background-color.cjs.js +1 -1
  12. package/dist/background-color.esm.js +1 -1
  13. package/dist/blocks-library.cjs.js +6 -6
  14. package/dist/blocks-library.esm.js +226 -202
  15. package/dist/capitalization.cjs.js +1 -1
  16. package/dist/capitalization.esm.js +9 -4
  17. package/dist/checklist.cjs.js +1 -1
  18. package/dist/checklist.esm.js +154 -116
  19. package/dist/citations.cjs.js +43 -18
  20. package/dist/citations.esm.js +465 -446
  21. package/dist/clear-formatting.cjs.js +1 -1
  22. package/dist/clear-formatting.esm.js +21 -20
  23. package/dist/code-sample.cjs.js +85 -66
  24. package/dist/code-sample.esm.js +301 -190
  25. package/dist/code.cjs.js +1 -1
  26. package/dist/code.esm.js +1 -1
  27. package/dist/collaboration.cjs.js +68 -0
  28. package/dist/collaboration.esm.js +7428 -0
  29. package/dist/comments.cjs.js +11 -11
  30. package/dist/comments.esm.js +284 -237
  31. package/dist/conditional-content.cjs.js +67 -60
  32. package/dist/conditional-content.esm.js +270 -220
  33. package/dist/data-binding.cjs.js +3 -3
  34. package/dist/data-binding.esm.js +28 -27
  35. package/dist/dialogHelpers-5d5BuOCW.mjs +39 -0
  36. package/dist/dialogHelpers-zU6zpMIA.js +12 -0
  37. package/dist/document-manager.cjs.js +1 -1
  38. package/dist/document-manager.esm.js +1 -1
  39. package/dist/{documentManager-3nPkITwx.js → documentManager-BDz6tovy.js} +1 -1
  40. package/dist/{documentManager-CRumGpCT.mjs → documentManager-yjRBab4v.mjs} +1 -1
  41. package/dist/embed-iframe.cjs.js +37 -17
  42. package/dist/embed-iframe.esm.js +188 -143
  43. package/dist/emojis.cjs.js +13 -10
  44. package/dist/emojis.esm.js +288 -76
  45. package/dist/enterprise.cjs.js +1 -1
  46. package/dist/enterprise.esm.js +9 -7
  47. package/dist/escapeHtml-D2Zh82pD.js +1 -0
  48. package/dist/escapeHtml-DyksyvcZ.mjs +6 -0
  49. package/dist/font-family.cjs.js +1 -1
  50. package/dist/font-family.esm.js +48 -41
  51. package/dist/font-size.cjs.js +1 -1
  52. package/dist/font-size.esm.js +67 -60
  53. package/dist/format-painter.cjs.js +1 -1
  54. package/dist/format-painter.esm.js +2 -1
  55. package/dist/history.cjs.js +1 -1
  56. package/dist/history.esm.js +40 -36
  57. package/dist/historyHelpers-BEKwNOtA.mjs +14 -0
  58. package/dist/historyHelpers-Cu8Pk7m1.js +1 -0
  59. package/dist/index-Bm1eqYHh.mjs +194 -0
  60. package/dist/index-CoflqYuK.js +30 -0
  61. package/dist/index.cjs.js +1 -1
  62. package/dist/index.esm.js +17 -15
  63. package/dist/link.cjs.js +17 -13
  64. package/dist/link.esm.js +138 -69
  65. package/dist/list.cjs.js +1 -1
  66. package/dist/list.esm.js +66 -33
  67. package/dist/math.cjs.js +22 -22
  68. package/dist/math.esm.js +221 -126
  69. package/dist/media-manager.cjs.js +12 -12
  70. package/dist/media-manager.esm.js +55 -50
  71. package/dist/mentions.cjs.js +2 -2
  72. package/dist/mentions.esm.js +17 -12
  73. package/dist/merge-tag.cjs.js +2 -2
  74. package/dist/merge-tag.esm.js +43 -42
  75. package/dist/plugins.css +1 -1
  76. package/dist/preview.cjs.js +3 -3
  77. package/dist/preview.esm.js +30 -27
  78. package/dist/slash-commands.cjs.js +13 -7
  79. package/dist/slash-commands.esm.js +90 -79
  80. package/dist/smart-paste.cjs.js +5 -5
  81. package/dist/smart-paste.esm.js +85 -81
  82. package/dist/special-characters.cjs.js +6 -3
  83. package/dist/special-characters.esm.js +72 -25
  84. package/dist/spell-check.cjs.js +8 -8
  85. package/dist/spell-check.esm.js +10189 -295
  86. package/dist/table.cjs.js +166 -13
  87. package/dist/table.esm.js +543 -266
  88. package/dist/template.cjs.js +11 -11
  89. package/dist/template.esm.js +290 -264
  90. package/dist/text-color.cjs.js +1 -1
  91. package/dist/text-color.esm.js +1 -1
  92. package/dist/translation-workflow.cjs.js +4 -4
  93. package/dist/translation-workflow.esm.js +33 -31
  94. package/dist/version-diff.cjs.js +6 -6
  95. package/dist/version-diff.esm.js +40 -40
  96. package/package.json +11 -5
  97. package/dist/anchoredPopover-BzqGPOAE.js +0 -1
  98. package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
  99. package/dist/index-CJ90EVWy.mjs +0 -145
  100. package/dist/index-DTkvH8gX.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const l=require("@editora/light-code-editor"),T='[data-theme="dark"], .dark, .editora-theme-dark',I=`/* Source Editor Dialog Styles */
1
+ "use strict";const I=require("./dialogHelpers-zU6zpMIA.js"),l=require("@editora/light-code-editor"),H='[data-theme="dark"], .dark, .editora-theme-dark',P=`/* Source Editor Dialog Styles */
2
2
  .rte-source-editor-overlay {
3
3
  position: fixed !important;
4
4
  top: 0 !important;
@@ -375,10 +375,10 @@
375
375
  flex: 1;
376
376
  text-align: center;
377
377
  }
378
- }`,P=()=>({name:"code",toolbar:[{label:"Source",command:"toggleSourceView",icon:'<svg width="24" height="24" focusable="false"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 0 1 0-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7ZM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 0 0-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7Z"></path></g></svg>',shortcut:"Mod-Shift-S"}],commands:{toggleSourceView:()=>{const u=(()=>{const a=window.getSelection();if(a&&a.anchorNode){let e=a.anchorNode instanceof HTMLElement?a.anchorNode:a.anchorNode.parentElement;for(;e;){if(e.classList?.contains("rte-content"))return e;e=e.parentElement}}if(document.activeElement){let e=document.activeElement;if(e.classList?.contains("rte-content"))return e;for(;e&&e!==document.body;){if(e.classList?.contains("rte-content"))return e;const n=e.querySelector(".rte-content");if(n)return n;e=e.parentElement}}const o=document.querySelector("[data-editora-editor]");if(o){const e=o.querySelector(".rte-content");if(e)return e}return document.querySelector(".rte-content")})();if(!u)return console.error("[CodePlugin] Editor content area not found"),alert("Editor content area not found. Please click inside the editor first."),!1;const N=u.innerHTML,D=a=>{let o="",e=0;const n=2,h=a.split(/(<\/?[a-zA-Z][^>]*>)/);for(const r of h)r.trim()&&(r.match(/^<\/[a-zA-Z]/)?(e=Math.max(0,e-1),o+=`
378
+ }`,U=()=>({name:"code",toolbar:[{label:"Source",command:"toggleSourceView",icon:'<svg width="24" height="24" focusable="false"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 0 1 0-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7ZM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 0 0-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7Z"></path></g></svg>',shortcut:"Mod-Shift-S"}],commands:{toggleSourceView:()=>{const u=(()=>{const a=window.getSelection();if(a&&a.anchorNode){let e=a.anchorNode instanceof HTMLElement?a.anchorNode:a.anchorNode.parentElement;for(;e;){if(e.classList?.contains("rte-content"))return e;e=e.parentElement}}if(document.activeElement){let e=document.activeElement;if(e.classList?.contains("rte-content"))return e;for(;e&&e!==document.body;){if(e.classList?.contains("rte-content"))return e;const n=e.querySelector(".rte-content");if(n)return n;e=e.parentElement}}const o=document.querySelector("[data-editora-editor]");if(o){const e=o.querySelector(".rte-content");if(e)return e}return document.querySelector(".rte-content")})();if(!u)return console.error("[CodePlugin] Editor content area not found"),alert("Editor content area not found. Please click inside the editor first."),!1;const N=u.innerHTML,D=a=>{let o="",e=0;const n=2,h=a.split(/(<\/?[a-zA-Z][^>]*>)/);for(const r of h)r.trim()&&(r.match(/^<\/[a-zA-Z]/)?(e=Math.max(0,e-1),o+=`
379
379
  `+" ".repeat(e*n)+r):r.match(/^<[a-zA-Z]/)&&!r.match(/\/>$/)?(o+=`
380
380
  `+" ".repeat(e*n)+r,e++):r.match(/^<[a-zA-Z].*\/>$/)?o+=`
381
- `+" ".repeat(e*n)+r:o+=r.trim());return o.trim()};return(()=>{const o=D(N);let e=null,n="dark",h=!1,r=!1,v=!1,E=!1;const R=!!u.closest(T)||document.body.matches(T)||document.documentElement.matches(T),i=document.createElement("div");i.className="rte-source-editor-overlay",R&&i.classList.add("rte-theme-dark");const d=document.createElement("div");d.className="rte-source-editor-modal",d.setAttribute("role","dialog"),d.setAttribute("aria-modal","true"),d.setAttribute("aria-labelledby","source-editor-title");const f=document.createElement("div");f.className="rte-source-editor-header",f.innerHTML=`
381
+ `+" ".repeat(e*n)+r:o+=r.trim());return o.trim()};return(()=>{document.querySelectorAll(".rte-source-editor-overlay").forEach(t=>t.remove());const o=D(N);let e=null,n="dark",h=!1,r=!1,v=!1,E=!1;const O=!!u.closest(H)||document.body.matches(H)||document.documentElement.matches(H),i=document.createElement("div");I.initDialogOverlay(i),i.className="rte-source-editor-overlay",O&&i.classList.add("rte-theme-dark");const d=document.createElement("div");d.className="rte-source-editor-modal",d.setAttribute("role","dialog"),d.setAttribute("aria-modal","true"),d.setAttribute("aria-labelledby","source-editor-title");const f=document.createElement("div");f.className="rte-source-editor-header",f.innerHTML=`
382
382
  <h2 id="source-editor-title">Source Editor</h2>
383
383
  <div class="rte-source-editor-header-toolbar">
384
384
  <button class="rte-source-editor-toolbar-btn theme-toggle-btn" title="Switch theme">
@@ -422,7 +422,7 @@
422
422
  <button class="rte-source-editor-btn rte-source-editor-btn-cancel">Cancel</button>
423
423
  <button class="rte-source-editor-btn rte-source-editor-btn-save">Save</button>
424
424
  </div>
425
- `,d.appendChild(f),d.appendChild(C),d.appendChild(b),i.appendChild(d),!document.getElementById("rte-source-editor-styles")){const t=document.createElement("style");t.id="rte-source-editor-styles",t.textContent=I,document.head.appendChild(t)}const y=f.querySelector(".theme-toggle-btn"),p=f.querySelector(".readonly-toggle-btn"),k=f.querySelector(".rte-source-editor-fullscreen-btn"),H=f.querySelector(".rte-source-editor-close-btn"),z=b.querySelector(".rte-source-editor-btn-cancel"),B=b.querySelector(".rte-source-editor-btn-save"),q=b.querySelector(".unsaved-changes"),S=[],s=(t,c,L,w)=>{t.addEventListener(c,L,w),S.push(()=>t.removeEventListener(c,L,w))},A=t=>{v!==t&&(v=t,q&&(q.style.display=v?"inline":"none"))},m=()=>{if(!E){for(E=!0;S.length;)S.pop()?.();e&&(e.destroy(),e=null),i.isConnected&&i.remove()}},O=()=>{n=n==="dark"?"light":"dark",e?.setTheme(n),y&&(y.innerHTML=n==="light"?`
425
+ `,d.appendChild(f),d.appendChild(C),d.appendChild(b),i.appendChild(d),!document.getElementById("rte-source-editor-styles")){const t=document.createElement("style");t.id="rte-source-editor-styles",t.textContent=P,document.head.appendChild(t)}const y=f.querySelector(".theme-toggle-btn"),m=f.querySelector(".readonly-toggle-btn"),k=f.querySelector(".rte-source-editor-fullscreen-btn"),T=f.querySelector(".rte-source-editor-close-btn"),z=b.querySelector(".rte-source-editor-btn-cancel"),B=b.querySelector(".rte-source-editor-btn-save"),q=b.querySelector(".unsaved-changes"),S=[],s=(t,c,L,w)=>{t.addEventListener(c,L,w),S.push(()=>t.removeEventListener(c,L,w))},A=t=>{v!==t&&(v=t,q&&(q.style.display=v?"inline":"none"))},p=()=>{if(!E){for(E=!0;S.length;)S.pop()?.();e&&(e.destroy(),e=null),i.isConnected&&i.remove()}},R=()=>{n=n==="dark"?"light":"dark",e?.setTheme(n),y&&(y.innerHTML=n==="light"?`
426
426
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
427
427
  <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
428
428
  </svg>
@@ -438,7 +438,7 @@
438
438
  <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>
439
439
  <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
440
440
  </svg>
441
- `)},j=()=>{h=!h,e?.setReadOnly(h),p&&(p.classList.toggle("active",h),p.innerHTML=h?`
441
+ `)},j=()=>{h=!h,e?.setReadOnly(h),m&&(m.classList.toggle("active",h),m.innerHTML=h?`
442
442
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
443
443
  <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
444
444
  <circle cx="12" cy="16" r="1"/>
@@ -457,4 +457,4 @@
457
457
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
458
458
  <path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/>
459
459
  </svg>
460
- `)},V=()=>{v&&!confirm("You have unsaved changes. Are you sure you want to cancel?")||m()},Z=()=>{try{const t=e?.getValue()||"",c=document.createElement("div");c.innerHTML=t,c.querySelectorAll('script, iframe[src^="javascript:"], object, embed').forEach(w=>w.remove()),u.innerHTML=c.innerHTML;try{u.dispatchEvent(new InputEvent("input",{bubbles:!0,cancelable:!1,inputType:"insertReplacementText"}))}catch{u.dispatchEvent(new Event("input",{bubbles:!0}))}u.dispatchEvent(new Event("change",{bubbles:!0})),A(!1),m()}catch(t){alert("Failed to update HTML. Please check your syntax."),console.error("HTML update error:",t)}};y&&s(y,"click",O),p&&s(p,"click",j),k&&s(k,"click",F),H&&s(H,"click",m),z&&s(z,"click",V),B&&s(B,"click",Z),s(i,"click",t=>{t.target===i&&m()}),s(document,"keydown",t=>{const c=t;c.key==="Escape"&&(c.preventDefault(),m())}),document.body.appendChild(i),requestAnimationFrame(()=>{if(!(E||!i.isConnected))try{e=l.createEditor(g,{value:o,theme:"dark",readOnly:!1,extensions:[new l.LineNumbersExtension,new l.ThemeExtension,new l.ReadOnlyExtension,new l.BracketMatchingExtension,new l.SearchExtension,new l.CodeFoldingExtension,new l.SyntaxHighlightingExtension]}),e.on("change",()=>{const t=e?.getValue()||"";A(t!==o)}),requestAnimationFrame(()=>e?.focus())}catch(t){console.error("Failed to initialize code editor:",t)}})})(),!0}},keymap:{"Mod-Shift-s":"toggleSourceView","Mod-Shift-S":"toggleSourceView"}});exports.CodePlugin=P;
460
+ `)},V=()=>{v&&!confirm("You have unsaved changes. Are you sure you want to cancel?")||p()},Z=()=>{try{const t=e?.getValue()||"",c=document.createElement("div");c.innerHTML=t,c.querySelectorAll('script, iframe[src^="javascript:"], object, embed').forEach(w=>w.remove()),u.innerHTML=c.innerHTML;try{u.dispatchEvent(new InputEvent("input",{bubbles:!0,cancelable:!1,inputType:"insertReplacementText"}))}catch{u.dispatchEvent(new Event("input",{bubbles:!0}))}u.dispatchEvent(new Event("change",{bubbles:!0})),A(!1),p()}catch(t){alert("Failed to update HTML. Please check your syntax."),console.error("HTML update error:",t)}};y&&s(y,"click",R),m&&s(m,"click",j),k&&s(k,"click",F),T&&s(T,"click",p),z&&s(z,"click",V),B&&s(B,"click",Z),s(i,"click",t=>{t.target===i&&p()}),s(document,"keydown",t=>{const c=t;c.key==="Escape"&&(c.preventDefault(),p())}),document.body.appendChild(i),requestAnimationFrame(()=>{if(!(E||!i.isConnected))try{e=l.createEditor(g,{value:o,theme:"dark",readOnly:!1,extensions:[new l.LineNumbersExtension,new l.ThemeExtension,new l.ReadOnlyExtension,new l.BracketMatchingExtension,new l.SearchExtension,new l.CodeFoldingExtension,new l.SyntaxHighlightingExtension]}),e.on("change",()=>{const t=e?.getValue()||"";A(t!==o)}),requestAnimationFrame(()=>e?.focus())}catch(t){console.error("Failed to initialize code editor:",t)}})})(),!0}},keymap:{"Mod-Shift-s":"toggleSourceView","Mod-Shift-S":"toggleSourceView"}});exports.CodePlugin=U;
@@ -1,5 +1,6 @@
1
- import { createEditor as Z, LineNumbersExtension as I, ThemeExtension as U, ReadOnlyExtension as P, BracketMatchingExtension as _, SearchExtension as $, CodeFoldingExtension as K, SyntaxHighlightingExtension as Y } from "@editora/light-code-editor";
2
- const L = '[data-theme="dark"], .dark, .editora-theme-dark', G = `/* Source Editor Dialog Styles */
1
+ import { i as Z } from "./dialogHelpers-5d5BuOCW.mjs";
2
+ import { createEditor as I, LineNumbersExtension as U, ThemeExtension as P, ReadOnlyExtension as _, BracketMatchingExtension as $, SearchExtension as K, CodeFoldingExtension as Y, SyntaxHighlightingExtension as G } from "@editora/light-code-editor";
3
+ const L = '[data-theme="dark"], .dark, .editora-theme-dark', J = `/* Source Editor Dialog Styles */
3
4
  .rte-source-editor-overlay {
4
5
  position: fixed !important;
5
6
  top: 0 !important;
@@ -376,7 +377,7 @@ const L = '[data-theme="dark"], .dark, .editora-theme-dark', G = `/* Source Edit
376
377
  flex: 1;
377
378
  text-align: center;
378
379
  }
379
- }`, X = () => ({
380
+ }`, te = () => ({
380
381
  name: "code",
381
382
  // Toolbar button configuration
382
383
  toolbar: [
@@ -443,10 +444,11 @@ const L = '[data-theme="dark"], .dark, .editora-theme-dark', G = `/* Source Edit
443
444
  return o.trim();
444
445
  };
445
446
  return (() => {
447
+ document.querySelectorAll(".rte-source-editor-overlay").forEach((t) => t.remove());
446
448
  const o = N(A);
447
- let e = null, n = "dark", u = !1, r = !1, m = !1, w = !1;
449
+ let e = null, n = "dark", u = !1, r = !1, p = !1, w = !1;
448
450
  const D = !!l.closest(L) || document.body.matches(L) || document.documentElement.matches(L), i = document.createElement("div");
449
- i.className = "rte-source-editor-overlay", D && i.classList.add("rte-theme-dark");
451
+ Z(i), i.className = "rte-source-editor-overlay", D && i.classList.add("rte-theme-dark");
450
452
  const d = document.createElement("div");
451
453
  d.className = "rte-source-editor-modal", d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "true"), d.setAttribute("aria-labelledby", "source-editor-title");
452
454
  const h = document.createElement("div");
@@ -506,11 +508,11 @@ const L = '[data-theme="dark"], .dark, .editora-theme-dark', G = `/* Source Edit
506
508
  </div>
507
509
  `, d.appendChild(h), d.appendChild(E), d.appendChild(f), i.appendChild(d), !document.getElementById("rte-source-editor-styles")) {
508
510
  const t = document.createElement("style");
509
- t.id = "rte-source-editor-styles", t.textContent = G, document.head.appendChild(t);
511
+ t.id = "rte-source-editor-styles", t.textContent = J, document.head.appendChild(t);
510
512
  }
511
513
  const x = h.querySelector(
512
514
  ".theme-toggle-btn"
513
- ), g = h.querySelector(
515
+ ), m = h.querySelector(
514
516
  ".readonly-toggle-btn"
515
517
  ), y = h.querySelector(
516
518
  ".rte-source-editor-fullscreen-btn"
@@ -527,14 +529,14 @@ const L = '[data-theme="dark"], .dark, .editora-theme-dark', G = `/* Source Edit
527
529
  () => t.removeEventListener(c, S, k)
528
530
  );
529
531
  }, q = (t) => {
530
- m !== t && (m = t, B && (B.style.display = m ? "inline" : "none"));
531
- }, p = () => {
532
+ p !== t && (p = t, B && (B.style.display = p ? "inline" : "none"));
533
+ }, g = () => {
532
534
  if (!w) {
533
535
  for (w = !0; M.length; )
534
536
  M.pop()?.();
535
537
  e && (e.destroy(), e = null), i.isConnected && i.remove();
536
538
  }
537
- }, R = () => {
539
+ }, O = () => {
538
540
  n = n === "dark" ? "light" : "dark", e?.setTheme(n), x && (x.innerHTML = n === "light" ? `
539
541
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
540
542
  <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
@@ -552,8 +554,8 @@ const L = '[data-theme="dark"], .dark, .editora-theme-dark', G = `/* Source Edit
552
554
  <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
553
555
  </svg>
554
556
  `);
555
- }, O = () => {
556
- u = !u, e?.setReadOnly(u), g && (g.classList.toggle("active", u), g.innerHTML = u ? `
557
+ }, R = () => {
558
+ u = !u, e?.setReadOnly(u), m && (m.classList.toggle("active", u), m.innerHTML = u ? `
557
559
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
558
560
  <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
559
561
  <circle cx="12" cy="16" r="1"/>
@@ -576,7 +578,7 @@ const L = '[data-theme="dark"], .dark, .editora-theme-dark', G = `/* Source Edit
576
578
  </svg>
577
579
  `);
578
580
  }, F = () => {
579
- m && !confirm("You have unsaved changes. Are you sure you want to cancel?") || p();
581
+ p && !confirm("You have unsaved changes. Are you sure you want to cancel?") || g();
580
582
  }, V = () => {
581
583
  try {
582
584
  const t = e?.getValue() || "", c = document.createElement("div");
@@ -598,31 +600,31 @@ const L = '[data-theme="dark"], .dark, .editora-theme-dark', G = `/* Source Edit
598
600
  }
599
601
  l.dispatchEvent(
600
602
  new Event("change", { bubbles: !0 })
601
- ), q(!1), p();
603
+ ), q(!1), g();
602
604
  } catch (t) {
603
605
  alert("Failed to update HTML. Please check your syntax."), console.error("HTML update error:", t);
604
606
  }
605
607
  };
606
- x && s(x, "click", R), g && s(g, "click", O), y && s(y, "click", j), T && s(T, "click", p), H && s(H, "click", F), z && s(z, "click", V), s(i, "click", (t) => {
607
- t.target === i && p();
608
+ x && s(x, "click", O), m && s(m, "click", R), y && s(y, "click", j), T && s(T, "click", g), H && s(H, "click", F), z && s(z, "click", V), s(i, "click", (t) => {
609
+ t.target === i && g();
608
610
  }), s(document, "keydown", (t) => {
609
611
  const c = t;
610
- c.key === "Escape" && (c.preventDefault(), p());
612
+ c.key === "Escape" && (c.preventDefault(), g());
611
613
  }), document.body.appendChild(i), requestAnimationFrame(() => {
612
614
  if (!(w || !i.isConnected))
613
615
  try {
614
- e = Z(b, {
616
+ e = I(b, {
615
617
  value: o,
616
618
  theme: "dark",
617
619
  readOnly: !1,
618
620
  extensions: [
619
- new I(),
620
621
  new U(),
621
622
  new P(),
622
623
  new _(),
623
624
  new $(),
624
625
  new K(),
625
- new Y()
626
+ new Y(),
627
+ new G()
626
628
  ]
627
629
  }), e.on("change", () => {
628
630
  const t = e?.getValue() || "";
@@ -642,5 +644,5 @@ const L = '[data-theme="dark"], .dark, .editora-theme-dark', G = `/* Source Edit
642
644
  }
643
645
  });
644
646
  export {
645
- X as C
647
+ te as C
646
648
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const B=new Set,v=[],f=t=>{v.push(t)},x='[data-theme="dark"], .dark, .editora-theme-dark';f({id:"image-alt-text",wcag:"1.1.1",description:"Images must have alt text",severity:"error",selector:"img",evaluate(t,n){const e=t;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")||e.getAttribute("alt")?.trim()===""?{id:`img-alt-${n.cache.get("imgIdx")}`,rule:"image-alt-text",wcag:"1.1.1",severity:"error",message:"Image missing alt text",nodePath:n.cache.get("imgPath"),element:e,suggestion:"Add descriptive alt text to all images",fixable:!0,fixLabel:"Add empty alt"}:null},fix(t){t.element&&t.element.setAttribute("alt","")}});f({id:"empty-interactive",wcag:"4.1.2",description:"Interactive elements must have accessible names",severity:"error",selector:'button, a, [role="button"]',evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="empty-interactive")return null;const r=e.textContent?.trim(),a=e.hasAttribute("aria-label"),o=e.hasAttribute("aria-labelledby"),s=e.hasAttribute("title");return!r&&!a&&!o&&!s?{id:`interactive-empty-${n.cache.get("buttonIdx")}`,rule:"empty-interactive",wcag:"4.1.2",severity:"error",message:"Interactive element has no accessible name",nodePath:n.cache.get("buttonPath"),element:e,suggestion:"Add text, aria-label, aria-labelledby, or title",fixable:!0,fixLabel:"Add aria-label"}:null},fix(t){t.element&&t.element.setAttribute("aria-label","Button")}});f({id:"form-label",wcag:"1.3.1",description:"Form controls must have labels",severity:"error",selector:"input, textarea, select",evaluate(t,n){const e=t;if(e.hasAttribute("type")&&e.getAttribute("type")==="hidden"||e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="form-label")return null;const r=n.doc.querySelector(`label[for="${e.getAttribute("id")}"]`),a=e.hasAttribute("aria-label"),o=e.hasAttribute("aria-labelledby");return!r&&!a&&!o?{id:`form-label-${n.cache.get("inputIdx")}`,rule:"form-label",wcag:"1.3.1",severity:"error",message:"Form control missing label",nodePath:n.cache.get("inputPath"),element:e,suggestion:"Add <label>, aria-label, or aria-labelledby",fixable:!0,fixLabel:"Add aria-label"}:null},fix(t){t.element&&t.element.setAttribute("aria-label","Input")}});f({id:"table-headers",wcag:"1.3.1",description:"Tables must have header rows",severity:"error",selector:"table",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="table-headers")return null;const r=e.querySelectorAll("th"),a=e.querySelectorAll("tr");return r.length===0&&a.length>0?{id:`table-no-headers-${n.cache.get("tableIdx")}`,rule:"table-headers",wcag:"1.3.1",severity:"error",message:"Table missing header row (<th> elements)",nodePath:n.cache.get("tablePath"),element:e,suggestion:"Add <th> elements to first row",fixable:!0,fixLabel:"Convert first row to headers"}:null},fix(t){if(t.element){const e=t.element.querySelector("tr");e&&Array.from(e.children).forEach(r=>{if(r.tagName==="TD"){const a=document.createElement("th");a.innerHTML=r.innerHTML,e.replaceChild(a,r)}})}}});f({id:"heading-empty",wcag:"1.3.1",description:"Headings must not be empty",severity:"error",selector:"h1, h2, h3, h4, h5, h6",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="heading-empty")return null;const r=e.textContent?.replace(/\s+/g,"")||"",a=e.childNodes.length===1&&e.childNodes[0].nodeName==="BR";return!r&&!a?{id:`heading-empty-${n.cache.get("headingIdx")}`,rule:"heading-empty",wcag:"1.3.1",severity:"error",message:`Empty ${e.tagName.toLowerCase()} heading`,nodePath:n.cache.get("headingPath"),element:e,suggestion:"All headings must contain text",fixable:!1}:null}});f({id:"heading-order",wcag:"1.3.1",description:"Headings should not skip levels",severity:"warning",selector:"h1, h2, h3, h4, h5, h6",evaluate(t,n){const e=t,r=parseInt(e.tagName[1]),a=n.cache.get("previousHeadingLevel")||r;return n.cache.set("previousHeadingLevel",r),r-a>1?{id:`heading-order-${n.cache.get("headingIdx")}`,rule:"heading-order",wcag:"1.3.1",severity:"warning",message:`Heading skips level (${a} → ${r})`,nodePath:n.cache.get("headingPath"),element:e,suggestion:`Use heading level ${a+1} instead`,fixable:!1}:null}});f({id:"link-text",wcag:"2.4.4",description:"Links must have descriptive text",severity:"error",selector:"a",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="link-text")return null;const r=e.textContent?.replace(/\s+/g,"").toLowerCase()||"",a=e.childNodes.length===1&&e.childNodes[0].nodeName==="BR",o=["clickhere","readmore","link","here","this","page"];return!r&&!a?{id:`link-empty-${n.cache.get("aIdx")}`,rule:"link-text",wcag:"2.4.4",severity:"error",message:"Link has no text content",nodePath:n.cache.get("aPath"),element:e,suggestion:"All links must have descriptive text",fixable:!0,fixLabel:"Insert placeholder"}:o.some(s=>r.includes(s))?{id:`link-vague-${n.cache.get("aIdx")}`,rule:"link-text",wcag:"2.4.4",severity:"warning",message:`Vague link text: "${e.textContent?.trim()}"`,nodePath:n.cache.get("aPath"),element:e,suggestion:"Use descriptive link text",fixable:!1}:null},fix(t){t.element&&(t.element.textContent="Link")}});f({id:"list-structure",wcag:"1.3.1",description:"Lists must only contain <li> children",severity:"error",selector:"ul, ol",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="list-structure")return null;const r=e.querySelectorAll(":scope > li");return Array.from(e.children).filter(o=>o.tagName!=="LI").length>0?{id:`list-structure-${n.cache.get("ulIdx")}`,rule:"list-structure",wcag:"1.3.1",severity:"error",message:"List contains non-li elements",nodePath:n.cache.get("ulPath"),element:e,suggestion:"All direct children of ul/ol must be li elements",fixable:!1}:r.length===0?{id:`list-empty-${n.cache.get("ulIdx")}`,rule:"list-structure",wcag:"1.3.1",severity:"warning",message:"Empty list element",nodePath:n.cache.get("ulPath"),element:e,suggestion:"Remove empty lists or add list items",fixable:!1}:null}});const A=()=>{const t=window.getSelection();if(t&&t.rangeCount>0){let e=t.getRangeAt(0).startContainer;for(;e&&e!==document.body;){if(e.nodeType===Node.ELEMENT_NODE){const r=e;if(r.getAttribute("contenteditable")==="true")return r}e=e.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const e=n.closest('[contenteditable="true"]');if(e)return e}return document.querySelector('[contenteditable="true"]')},T=()=>{if(A()?.closest(x))return!0;const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).startContainer;if((r.nodeType===Node.ELEMENT_NODE?r:r.parentElement)?.closest(x))return!0}return document.activeElement?.closest(x)?!0:document.body.matches(x)||document.documentElement.matches(x)},w=()=>{const t=A();if(!t)return[];const n=[],e={doc:t.ownerDocument||document,cache:new Map},r=e.doc.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let a=r.currentNode,o={},s={},p=0;for(;a&&p<5e3;){const h=a,i=h.tagName?.toLowerCase?.()||"";if(h.hidden||h.style.display==="none"||h.style.visibility==="hidden"){a=r.nextNode(),p++;continue}o[i]=(o[i]||0)+1,s[i]=`${i}[${o[i]-1}]`;for(const u of v){if(B.has(u.id)||u.selector&&!a.matches?.(u.selector))continue;e.cache.set(`${i}Idx`,o[i]-1),e.cache.set(`${i}Path`,s[i]),/^h[1-6]$/.test(i)&&(e.cache.set("headingIdx",o[i]-1),e.cache.set("headingPath",s[i])),i==="a"&&(e.cache.set("aIdx",o[i]-1),e.cache.set("aPath",s[i])),i==="table"&&(e.cache.set("tableIdx",o[i]-1),e.cache.set("tablePath",s[i])),i==="button"&&(e.cache.set("buttonIdx",o[i]-1),e.cache.set("buttonPath",s[i])),i==="input"&&(e.cache.set("inputIdx",o[i]-1),e.cache.set("inputPath",s[i])),(i==="ul"||i==="ol")&&(e.cache.set("ulIdx",o[i]-1),e.cache.set("ulPath",s[i]));const m=u.evaluate(a,e);m&&n.push(m)}a=r.nextNode(),p++}return n},b=(t,n=!0)=>{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=""))},I=t=>{t||(t=w());const n=t.filter(a=>a.severity==="error").length,e=t.filter(a=>a.severity==="warning").length;let r=100-n*20-e*5;return Math.max(0,r)},P=t=>{const n=v.find(e=>e.id===t.rule);n&&n.fix&&n.fix(t)},k=()=>{const t=w(),n=I(t),r=T()?{overlay:"rgba(0, 0, 0, 0.62)",dialogBg:"#1f2937",panelBg:"#222d3a",border:"#3b4657",text:"#e2e8f0",muted:"#9fb0c6",closeHover:"#334155",summaryBg:"#111827",issueBg:"#1f2937",issueHoverBg:"#273244",issueBorder:"#4b5563",issueHoverBorder:"#58a6ff",fixBtn:"#3b82f6",fixBtnHover:"#2563eb"}:{overlay:"rgba(0, 0, 0, 0.5)",dialogBg:"#ffffff",panelBg:"#ffffff",border:"#e0e0e0",text:"#1f2937",muted:"#666666",closeHover:"#f0f0f0",summaryBg:"#f5f5f5",issueBg:"#ffffff",issueHoverBg:"#f5f9ff",issueBorder:"#e0e0e0",issueHoverBorder:"#2196f3",fixBtn:"#2196f3",fixBtnHover:"#1976d2"},a=document.createElement("div");a.className="a11y-dialog-overlay",a.style.cssText=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("./escapeHtml-D2Zh82pD.js"),H=require("./dialogHelpers-zU6zpMIA.js"),T=new Set,C=[],f=t=>{C.push(t)},x='[data-theme="dark"], .dark, .editora-theme-dark';f({id:"image-alt-text",wcag:"1.1.1",description:"Images must have alt text",severity:"error",selector:"img",evaluate(t,n){const e=t;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:{id:`img-alt-${n.cache.get("imgIdx")}`,rule:"image-alt-text",wcag:"1.1.1",severity:"error",message:"Image missing alt text",nodePath:n.cache.get("imgPath"),element:e,suggestion:"Add descriptive alt text to all images",fixable:!0,fixLabel:"Add empty alt"}},fix(t){t.element&&t.element.setAttribute("alt","")}});f({id:"empty-interactive",wcag:"4.1.2",description:"Interactive elements must have accessible names",severity:"error",selector:'button, a, [role="button"]',evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="empty-interactive")return null;const r=e.textContent?.trim(),a=e.hasAttribute("aria-label"),i=e.hasAttribute("aria-labelledby"),s=e.hasAttribute("title");return!r&&!a&&!i&&!s?{id:`interactive-empty-${n.cache.get("buttonIdx")}`,rule:"empty-interactive",wcag:"4.1.2",severity:"error",message:"Interactive element has no accessible name",nodePath:n.cache.get("buttonPath"),element:e,suggestion:"Add text, aria-label, aria-labelledby, or title",fixable:!0,fixLabel:"Add aria-label"}:null},fix(t){t.element&&t.element.setAttribute("aria-label","Button")}});f({id:"form-label",wcag:"1.3.1",description:"Form controls must have labels",severity:"error",selector:"input, textarea, select",evaluate(t,n){const e=t;if(e.hasAttribute("type")&&e.getAttribute("type")==="hidden"||e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="form-label")return null;const r=n.doc.querySelector(`label[for="${e.getAttribute("id")}"]`),a=e.hasAttribute("aria-label"),i=e.hasAttribute("aria-labelledby");return!r&&!a&&!i?{id:`form-label-${n.cache.get("inputIdx")}`,rule:"form-label",wcag:"1.3.1",severity:"error",message:"Form control missing label",nodePath:n.cache.get("inputPath"),element:e,suggestion:"Add <label>, aria-label, or aria-labelledby",fixable:!0,fixLabel:"Add aria-label"}:null},fix(t){t.element&&t.element.setAttribute("aria-label","Input")}});f({id:"table-headers",wcag:"1.3.1",description:"Tables must have header rows",severity:"error",selector:"table",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="table-headers")return null;const r=e.querySelectorAll("th"),a=e.querySelectorAll("tr");return r.length===0&&a.length>0?{id:`table-no-headers-${n.cache.get("tableIdx")}`,rule:"table-headers",wcag:"1.3.1",severity:"error",message:"Table missing header row (<th> elements)",nodePath:n.cache.get("tablePath"),element:e,suggestion:"Add <th> elements to first row",fixable:!0,fixLabel:"Convert first row to headers"}:null},fix(t){if(t.element){const e=t.element.querySelector("tr");e&&Array.from(e.children).forEach(r=>{if(r.tagName==="TD"){const a=document.createElement("th");a.innerHTML=r.innerHTML,e.replaceChild(a,r)}})}}});f({id:"heading-empty",wcag:"1.3.1",description:"Headings must not be empty",severity:"error",selector:"h1, h2, h3, h4, h5, h6",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="heading-empty")return null;const r=e.textContent?.replace(/\s+/g,"")||"",a=e.childNodes.length===1&&e.childNodes[0].nodeName==="BR";return!r&&!a?{id:`heading-empty-${n.cache.get("headingIdx")}`,rule:"heading-empty",wcag:"1.3.1",severity:"error",message:`Empty ${e.tagName.toLowerCase()} heading`,nodePath:n.cache.get("headingPath"),element:e,suggestion:"All headings must contain text",fixable:!1}:null}});f({id:"heading-order",wcag:"1.3.1",description:"Headings should not skip levels",severity:"warning",selector:"h1, h2, h3, h4, h5, h6",evaluate(t,n){const e=t,r=parseInt(e.tagName[1]),a=n.cache.get("previousHeadingLevel")||r;return n.cache.set("previousHeadingLevel",r),r-a>1?{id:`heading-order-${n.cache.get("headingIdx")}`,rule:"heading-order",wcag:"1.3.1",severity:"warning",message:`Heading skips level (${a} → ${r})`,nodePath:n.cache.get("headingPath"),element:e,suggestion:`Use heading level ${a+1} instead`,fixable:!1}:null}});f({id:"link-text",wcag:"2.4.4",description:"Links must have descriptive text",severity:"error",selector:"a",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="link-text")return null;const r=e.textContent?.replace(/\s+/g,"").toLowerCase()||"",a=e.childNodes.length===1&&e.childNodes[0].nodeName==="BR",i=["clickhere","readmore","link","here","this","page"];return!r&&!a?{id:`link-empty-${n.cache.get("aIdx")}`,rule:"link-text",wcag:"2.4.4",severity:"error",message:"Link has no text content",nodePath:n.cache.get("aPath"),element:e,suggestion:"All links must have descriptive text",fixable:!0,fixLabel:"Insert placeholder"}:i.some(s=>r.includes(s))?{id:`link-vague-${n.cache.get("aIdx")}`,rule:"link-text",wcag:"2.4.4",severity:"warning",message:`Vague link text: "${e.textContent?.trim()}"`,nodePath:n.cache.get("aPath"),element:e,suggestion:"Use descriptive link text",fixable:!1}:null},fix(t){t.element&&(t.element.textContent="Link")}});f({id:"list-structure",wcag:"1.3.1",description:"Lists must only contain <li> children",severity:"error",selector:"ul, ol",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="list-structure")return null;const r=e.querySelectorAll(":scope > li");return Array.from(e.children).filter(i=>i.tagName!=="LI").length>0?{id:`list-structure-${n.cache.get("ulIdx")}`,rule:"list-structure",wcag:"1.3.1",severity:"error",message:"List contains non-li elements",nodePath:n.cache.get("ulPath"),element:e,suggestion:"All direct children of ul/ol must be li elements",fixable:!1}:r.length===0?{id:`list-empty-${n.cache.get("ulIdx")}`,rule:"list-structure",wcag:"1.3.1",severity:"warning",message:"Empty list element",nodePath:n.cache.get("ulPath"),element:e,suggestion:"Remove empty lists or add list items",fixable:!1}:null}});const w=()=>{const t=window.getSelection();if(t&&t.rangeCount>0){let e=t.getRangeAt(0).startContainer;for(;e&&e!==document.body;){if(e.nodeType===Node.ELEMENT_NODE){const r=e;if(r.getAttribute("contenteditable")==="true")return r}e=e.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const e=n.closest('[contenteditable="true"]');if(e)return e}return document.querySelector('[contenteditable="true"]')},I=()=>{if(w()?.closest(x))return!0;const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).startContainer;if((r.nodeType===Node.ELEMENT_NODE?r:r.parentElement)?.closest(x))return!0}return document.activeElement?.closest(x)?!0:document.body.matches(x)||document.documentElement.matches(x)},k=()=>{const t=w();if(!t)return[];const n=[],e={doc:t.ownerDocument||document,cache:new Map},r=e.doc.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let a=r.currentNode;const i={},s={};let p=0;for(;a&&p<5e3;){const h=a,o=h.tagName?.toLowerCase?.()||"";if(h.hidden||h.style.display==="none"||h.style.visibility==="hidden"){a=r.nextNode(),p++;continue}i[o]=(i[o]||0)+1,s[o]=`${o}[${i[o]-1}]`;for(const g of C){if(T.has(g.id)||g.selector&&!a.matches?.(g.selector))continue;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]));const m=g.evaluate(a,e);m&&n.push(m)}a=r.nextNode(),p++}return n},b=(t,n=!0)=>{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=""))},P=t=>{t||(t=k());const n=t.filter(a=>a.severity==="error").length,e=t.filter(a=>a.severity==="warning").length,r=100-n*20-e*5;return Math.max(0,r)},N=t=>{const n=C.find(e=>e.id===t.rule);n&&n.fix&&n.fix(t)},$=()=>{document.querySelectorAll(".a11y-dialog-overlay").forEach(d=>d.remove());const t=k(),n=P(t),r=I()?{overlay:"rgba(0, 0, 0, 0.62)",dialogBg:"#1f2937",panelBg:"#222d3a",border:"#3b4657",text:"#e2e8f0",muted:"#9fb0c6",closeHover:"#334155",summaryBg:"#111827",issueBg:"#1f2937",issueHoverBg:"#273244",issueBorder:"#4b5563",issueHoverBorder:"#58a6ff",fixBtn:"#3b82f6",fixBtnHover:"#2563eb"}:{overlay:"rgba(0, 0, 0, 0.5)",dialogBg:"#ffffff",panelBg:"#ffffff",border:"#e0e0e0",text:"#1f2937",muted:"#666666",closeHover:"#f0f0f0",summaryBg:"#f5f5f5",issueBg:"#ffffff",issueHoverBg:"#f5f9ff",issueBorder:"#e0e0e0",issueHoverBorder:"#2196f3",fixBtn:"#2196f3",fixBtnHover:"#1976d2"},a=document.createElement("div");H.initDialogOverlay(a),a.className="a11y-dialog-overlay",a.style.cssText=`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -9,7 +9,7 @@
9
9
  display: flex;
10
10
  align-items: center;
11
11
  justify-content: center;
12
- `;const o=document.createElement("div");o.className="a11y-dialog",o.style.cssText=`
12
+ `;const i=document.createElement("div");i.className="a11y-dialog",i.style.cssText=`
13
13
  background: ${r.dialogBg};
14
14
  border: 1px solid ${r.border};
15
15
  color: ${r.text};
@@ -34,7 +34,7 @@
34
34
  border-radius: 4px;
35
35
  background: ${n>=80?"#4caf50":n>=60?"#ff9800":"#f44336"};
36
36
  color: white;
37
- `,h.textContent=`${n}/100`;const i=document.createElement("button");i.textContent="✕",i.style.cssText=`
37
+ `,h.textContent=`${n}/100`;const o=document.createElement("button");o.textContent="✕",o.style.cssText=`
38
38
  background: none;
39
39
  border: none;
40
40
  font-size: 24px;
@@ -47,7 +47,7 @@
47
47
  justify-content: center;
48
48
  border-radius: 4px;
49
49
  color: ${r.muted};
50
- `,i.onmouseover=()=>{i.style.background=r.closeHover,i.style.color="#f8fafc"},i.onmouseout=()=>{i.style.background="none",i.style.color=r.muted},i.onclick=()=>{t.forEach(g=>b(g,!1)),a.remove()};const u=document.createElement("div");u.style.cssText="display: flex; align-items: center; gap: 16px;",u.appendChild(p),u.appendChild(h),s.appendChild(u),s.appendChild(i);const m=document.createElement("div");if(m.style.cssText=`
50
+ `,o.onmouseover=()=>{o.style.background=r.closeHover,o.style.color="#f8fafc"},o.onmouseout=()=>{o.style.background="none",o.style.color=r.muted},o.onclick=()=>{t.forEach(d=>b(d,!1)),a.remove()};const g=document.createElement("div");g.style.cssText="display: flex; align-items: center; gap: 16px;",g.appendChild(p),g.appendChild(h),s.appendChild(g),s.appendChild(o);const m=document.createElement("div");if(m.style.cssText=`
51
51
  flex: 1;
52
52
  overflow-y: auto;
53
53
  padding: 20px;
@@ -58,7 +58,7 @@
58
58
  <h3 style="margin: 0 0 8px 0; color: #4caf50;">No issues found!</h3>
59
59
  <p style="margin: 0; color: ${r.muted};">Your content meets WCAG 2.1 AA standards.</p>
60
60
  </div>
61
- `;else{const g=document.createElement("div");g.style.cssText=`
61
+ `;else{const d=document.createElement("div");d.style.cssText=`
62
62
  background: ${r.summaryBg};
63
63
  border: 1px solid ${r.border};
64
64
  padding: 12px 16px;
@@ -66,11 +66,11 @@
66
66
  margin-bottom: 20px;
67
67
  display: flex;
68
68
  gap: 20px;
69
- `;const y=t.filter(l=>l.severity==="error").length,$=t.filter(l=>l.severity==="warning").length,E=t.filter(l=>l.severity==="info").length;g.innerHTML=`
69
+ `;const y=t.filter(l=>l.severity==="error").length,E=t.filter(l=>l.severity==="warning").length,L=t.filter(l=>l.severity==="info").length;d.innerHTML=`
70
70
  <div><strong style="color: #f44336;">${y}</strong> <span style="color: ${r.muted};">Errors</span></div>
71
- <div><strong style="color: #ff9800;">${$}</strong> <span style="color: ${r.muted};">Warnings</span></div>
72
- <div><strong style="color: #2196f3;">${E}</strong> <span style="color: ${r.muted};">Info</span></div>
73
- `,m.appendChild(g),t.forEach(l=>{const c=document.createElement("div");c.style.cssText=`
71
+ <div><strong style="color: #ff9800;">${E}</strong> <span style="color: ${r.muted};">Warnings</span></div>
72
+ <div><strong style="color: #2196f3;">${L}</strong> <span style="color: ${r.muted};">Info</span></div>
73
+ `,m.appendChild(d),t.forEach(l=>{const u=document.createElement("div");u.style.cssText=`
74
74
  border: 1px solid ${r.issueBorder};
75
75
  border-radius: 6px;
76
76
  padding: 16px;
@@ -78,10 +78,10 @@
78
78
  transition: all 0.2s;
79
79
  background: ${r.issueBg};
80
80
  color: ${r.text};
81
- `,c.onmouseover=()=>{c.style.borderColor=r.issueHoverBorder,c.style.background=r.issueHoverBg,b(l,!0)},c.onmouseout=()=>{c.style.borderColor=r.issueBorder,c.style.background=r.issueBg,b(l,!1)};const L=l.severity==="error"?"#f44336":l.severity==="warning"?"#ff9800":"#2196f3";if(c.innerHTML=`
81
+ `,u.onmouseover=()=>{u.style.borderColor=r.issueHoverBorder,u.style.background=r.issueHoverBg,b(l,!0)},u.onmouseout=()=>{u.style.borderColor=r.issueBorder,u.style.background=r.issueBg,b(l,!1)};const B=l.severity==="error"?"#f44336":l.severity==="warning"?"#ff9800":"#2196f3";if(u.innerHTML=`
82
82
  <div style="display: flex; align-items: start; gap: 12px; margin-bottom: 8px;">
83
83
  <span style="
84
- background: ${L};
84
+ background: ${B};
85
85
  color: white;
86
86
  padding: 2px 8px;
87
87
  border-radius: 4px;
@@ -90,14 +90,14 @@
90
90
  text-transform: uppercase;
91
91
  ">${l.severity}</span>
92
92
  <div style="flex: 1;">
93
- <div style="font-weight: 600; margin-bottom: 4px;">${l.message}</div>
94
- <div style="font-size: 12px; color: ${r.muted};">WCAG ${l.wcag} · ${l.rule}</div>
93
+ <div style="font-weight: 600; margin-bottom: 4px;">${v.escapeHtml(l.message)}</div>
94
+ <div style="font-size: 12px; color: ${r.muted};">WCAG ${v.escapeHtml(l.wcag)} · ${v.escapeHtml(l.rule)}</div>
95
95
  </div>
96
96
  </div>
97
97
  <div style="font-size: 14px; color: ${r.text}; margin-bottom: 8px; padding-left: 68px;">
98
- ${l.suggestion||""}
98
+ ${v.escapeHtml(l.suggestion||"")}
99
99
  </div>
100
- `,l.fixable){const d=document.createElement("button");d.textContent=`🔧 ${l.fixLabel||"Auto-fix"}`,d.style.cssText=`
100
+ `,l.fixable){const c=document.createElement("button");c.textContent=`🔧 ${l.fixLabel||"Auto-fix"}`,c.style.cssText=`
101
101
  background: ${r.fixBtn};
102
102
  color: white;
103
103
  border: none;
@@ -106,4 +106,4 @@
106
106
  cursor: pointer;
107
107
  font-size: 13px;
108
108
  margin-left: 68px;
109
- `,d.onmouseover=()=>d.style.background=r.fixBtnHover,d.onmouseout=()=>d.style.background=r.fixBtn,d.onclick=()=>{P(l),d.textContent="✓ Fixed",d.style.background="#4caf50",d.disabled=!0,d.style.cursor="not-allowed",b(l,!1),setTimeout(()=>{a.remove(),k()},1e3)},c.appendChild(d)}m.appendChild(c)})}o.appendChild(s),o.appendChild(m),a.appendChild(o),document.body.appendChild(a),a.onclick=g=>{g.target===a&&(t.forEach(y=>b(y,!1)),a.remove())};const C=g=>{g.key==="Escape"&&(t.forEach(y=>b(y,!1)),a.remove(),document.removeEventListener("keydown",C))};document.addEventListener("keydown",C)},H=()=>({name:"a11yChecker",toolbar:[{label:"Accessibility",command:"toggleA11yChecker",icon:'<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path fill-rule="evenodd" clip-rule="evenodd" d="M9 6.82954C10.1652 6.4177 11 5.30646 11 4.00024C11 2.34339 9.65686 1.00024 8 1.00024C6.34315 1.00024 5 2.34339 5 4.00024C5 5.30646 5.83481 6.4177 7 6.82954V12.0002C7 13.6571 8.34315 15.0002 10 15.0002H14.9296C15.264 15.0002 15.5762 15.1673 15.7617 15.4455L18.4913 19.54C19.1914 20.5901 20.6772 20.7373 21.5696 19.8448L22.7071 18.7074C23.0976 18.3168 23.0976 17.6837 22.7071 17.2931C22.3166 16.9026 21.6834 16.9026 21.2929 17.2931L20.1554 18.4306L17.4258 14.3361C16.8694 13.5015 15.9327 13.0002 14.9296 13.0002H10C9.44772 13.0002 9 12.5525 9 12.0002V11.0002H15C15.5523 11.0002 16 10.5525 16 10.0002C16 9.44796 15.5523 9.00025 15 9.00025H9V6.82954ZM8 5.10758C7.38844 5.10758 6.89267 4.61181 6.89267 4.00024C6.89267 3.38868 7.38844 2.89291 8 2.89291C8.61157 2.89291 9.10734 3.38868 9.10734 4.00024C9.10734 4.61181 8.61157 5.10758 8 5.10758Z" fill="#0F0F0F"></path> <path d="M4.6328 9.07414C5.10517 8.78987 5.69738 9.0279 5.91645 9.53381C6.13552 10.0397 5.89604 10.6205 5.43795 10.9272C4.92993 11.2673 4.48018 11.6911 4.10882 12.1826C3.53598 12.9408 3.16922 13.8345 3.04425 14.7765C2.91928 15.7185 3.04036 16.6768 3.3957 17.5582C3.75103 18.4395 4.32852 19.2138 5.07194 19.8058C5.81535 20.3977 6.69937 20.787 7.63791 20.9359C8.57646 21.0847 9.53756 20.988 10.4276 20.6552C11.3177 20.3223 12.1065 19.7647 12.7171 19.0366C13.1129 18.5645 13.4251 18.0313 13.6428 17.46C13.8391 16.9448 14.3514 16.5813 14.8936 16.6815C15.4357 16.7816 15.8004 17.3054 15.6291 17.8295C15.3326 18.7372 14.8644 19.583 14.2468 20.3194C13.4147 21.3117 12.3399 22.0716 11.1269 22.5252C9.91394 22.9787 8.6042 23.1105 7.32518 22.9077C6.04617 22.7048 4.84148 22.1742 3.82838 21.3676C2.81528 20.561 2.02831 19.5058 1.54407 18.3047C1.05983 17.1037 0.894836 15.7977 1.06514 14.5139C1.23545 13.2302 1.73525 12.0124 2.51589 10.9791C3.09523 10.2123 3.81459 9.56654 4.6328 9.07414Z" fill="#0F0F0F"></path> </g></svg>',shortcut:"Mod-Shift-Alt-a"}],commands:{toggleA11yChecker:()=>{try{return k(),!0}catch(t){return console.error("Failed to open accessibility checker:",t),!1}}},keymap:{"Mod-Shift-Alt-a":"toggleA11yChecker"}});exports.A11yCheckerPlugin=H;
109
+ `,c.onmouseover=()=>c.style.background=r.fixBtnHover,c.onmouseout=()=>c.style.background=r.fixBtn,c.onclick=()=>{N(l),c.textContent="✓ Fixed",c.style.background="#4caf50",c.disabled=!0,c.style.cursor="not-allowed",b(l,!1),setTimeout(()=>{a.remove(),$()},1e3)},u.appendChild(c)}m.appendChild(u)})}i.appendChild(s),i.appendChild(m),a.appendChild(i),document.body.appendChild(a),a.onclick=d=>{d.target===a&&(t.forEach(y=>b(y,!1)),a.remove())};const A=d=>{d.key==="Escape"&&(t.forEach(y=>b(y,!1)),a.remove(),document.removeEventListener("keydown",A))};document.addEventListener("keydown",A)},M=()=>({name:"a11yChecker",toolbar:[{label:"Accessibility",command:"toggleA11yChecker",icon:'<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path fill-rule="evenodd" clip-rule="evenodd" d="M9 6.82954C10.1652 6.4177 11 5.30646 11 4.00024C11 2.34339 9.65686 1.00024 8 1.00024C6.34315 1.00024 5 2.34339 5 4.00024C5 5.30646 5.83481 6.4177 7 6.82954V12.0002C7 13.6571 8.34315 15.0002 10 15.0002H14.9296C15.264 15.0002 15.5762 15.1673 15.7617 15.4455L18.4913 19.54C19.1914 20.5901 20.6772 20.7373 21.5696 19.8448L22.7071 18.7074C23.0976 18.3168 23.0976 17.6837 22.7071 17.2931C22.3166 16.9026 21.6834 16.9026 21.2929 17.2931L20.1554 18.4306L17.4258 14.3361C16.8694 13.5015 15.9327 13.0002 14.9296 13.0002H10C9.44772 13.0002 9 12.5525 9 12.0002V11.0002H15C15.5523 11.0002 16 10.5525 16 10.0002C16 9.44796 15.5523 9.00025 15 9.00025H9V6.82954ZM8 5.10758C7.38844 5.10758 6.89267 4.61181 6.89267 4.00024C6.89267 3.38868 7.38844 2.89291 8 2.89291C8.61157 2.89291 9.10734 3.38868 9.10734 4.00024C9.10734 4.61181 8.61157 5.10758 8 5.10758Z" fill="#0F0F0F"></path> <path d="M4.6328 9.07414C5.10517 8.78987 5.69738 9.0279 5.91645 9.53381C6.13552 10.0397 5.89604 10.6205 5.43795 10.9272C4.92993 11.2673 4.48018 11.6911 4.10882 12.1826C3.53598 12.9408 3.16922 13.8345 3.04425 14.7765C2.91928 15.7185 3.04036 16.6768 3.3957 17.5582C3.75103 18.4395 4.32852 19.2138 5.07194 19.8058C5.81535 20.3977 6.69937 20.787 7.63791 20.9359C8.57646 21.0847 9.53756 20.988 10.4276 20.6552C11.3177 20.3223 12.1065 19.7647 12.7171 19.0366C13.1129 18.5645 13.4251 18.0313 13.6428 17.46C13.8391 16.9448 14.3514 16.5813 14.8936 16.6815C15.4357 16.7816 15.8004 17.3054 15.6291 17.8295C15.3326 18.7372 14.8644 19.583 14.2468 20.3194C13.4147 21.3117 12.3399 22.0716 11.1269 22.5252C9.91394 22.9787 8.6042 23.1105 7.32518 22.9077C6.04617 22.7048 4.84148 22.1742 3.82838 21.3676C2.81528 20.561 2.02831 19.5058 1.54407 18.3047C1.05983 17.1037 0.894836 15.7977 1.06514 14.5139C1.23545 13.2302 1.73525 12.0124 2.51589 10.9791C3.09523 10.2123 3.81459 9.56654 4.6328 9.07414Z" fill="#0F0F0F"></path> </g></svg>',shortcut:"Mod-Shift-Alt-a"}],commands:{toggleA11yChecker:()=>{try{return $(),!0}catch(t){return console.error("Failed to open accessibility checker:",t),!1}}},keymap:{"Mod-Shift-Alt-a":"toggleA11yChecker"}});exports.A11yCheckerPlugin=M;