@editora/core 1.0.24 → 1.0.26

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 (30) hide show
  1. package/dist/{CodePlugin.native-BRBEIqY7.mjs → CodePlugin.native-DNJmRGdT.mjs} +107 -93
  2. package/dist/{CodePlugin.native-CPfKDrkr.mjs → CodePlugin.native-DhLs8BoM.mjs} +43 -29
  3. package/dist/CommentsPlugin.native-CxdTwTGE.mjs +2101 -0
  4. package/dist/{DocumentManagerPlugin.native-tZqIa9o5.mjs → DocumentManagerPlugin.native-CaBqCH-p.mjs} +4 -4
  5. package/dist/MediaManagerPlugin.native-0YFHZfsb.mjs +4823 -0
  6. package/dist/MediaManagerPlugin.native-mXWWARRX.mjs +4908 -0
  7. package/dist/confirmDialog-CNqPHT5x.mjs +92 -0
  8. package/dist/{documentManager-8gnG-uG_.mjs → documentManager-DHLCoWzw.mjs} +490 -509
  9. package/dist/editora.min.js +2 -2
  10. package/dist/editora.umd.js +2 -2
  11. package/dist/index-DHPPVQwx.js +12 -0
  12. package/dist/{index-BICrB5kg.mjs → index-gI4djib2.mjs} +11 -2
  13. package/dist/index.cjs.js +1 -1
  14. package/dist/index.esm.js +2 -2
  15. package/dist/plugin-loader.js +3 -3
  16. package/dist/shared-config-DuA34Iii.mjs +26 -0
  17. package/dist/webcomponent-core.js +11 -2
  18. package/dist/webcomponent-core.min.css +1 -1
  19. package/dist/webcomponent-core.min.js +19 -20
  20. package/dist/webcomponent.cjs.js +1 -1
  21. package/dist/webcomponent.esm.js +1 -1
  22. package/dist/webcomponent.js +82 -73
  23. package/dist/webcomponent.min.css +1 -1
  24. package/dist/webcomponent.min.js +3345 -1655
  25. package/package.json +12 -30
  26. package/dist/CommentsPlugin.native-DHCDUm9f.mjs +0 -809
  27. package/dist/MediaManagerPlugin.native-BjrEarV6.mjs +0 -1161
  28. package/dist/MediaManagerPlugin.native-CRi24Mrb.mjs +0 -1057
  29. package/dist/confirmDialog-BP8hZPpX.mjs +0 -112
  30. package/dist/index--wO0CZVN.js +0 -12
@@ -464,7 +464,7 @@ class Ti {
464
464
  caret-color: var(--editor-foreground, #f8f9fa);
465
465
  tab-size: 2;
466
466
  -moz-tab-size: 2;
467
- `, this.contentElement.contentEditable = "true", this.contentElement.spellcheck = !1, this.contentElement.tabIndex = 0;
467
+ `, this.contentElement.contentEditable = "true", this.contentElement.spellcheck = !1, this.contentElement.tabIndex = 0, this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute("aria-label", "Code editor");
468
468
  const n = document.createElement("div");
469
469
  this.scrollWrapper = n, n.setAttribute("data-editora-editor", "true"), n.style.cssText = `
470
470
  position: relative;
@@ -833,7 +833,11 @@ class Ti {
833
833
  }
834
834
  // Set read-only mode
835
835
  setReadOnly(e) {
836
- this.contentElement.contentEditable = e ? "false" : "true";
836
+ this.contentElement.contentEditable = e ? "false" : "true", e ? this.contentElement.setAttribute("aria-readonly", "true") : this.contentElement.removeAttribute("aria-readonly");
837
+ }
838
+ /** The accessible name of the editing surface (what a screen reader calls the editor). */
839
+ setAccessibleName(e) {
840
+ this.contentElement.setAttribute("aria-label", e || "Code editor");
837
841
  }
838
842
  // Apply theme
839
843
  applyTheme(e) {
@@ -1218,7 +1222,7 @@ const Si = 200, wi = 1e3, vi = 8e3, B = class B {
1218
1222
  lineWrapping: !1,
1219
1223
  lineNumbers: !0,
1220
1224
  ...t
1221
- }, this.textModel = new It(this.config.value), this.view = new Ti(e), this.view.setTabSize(this.config.tabSize || 2), this.view.setLineWrapping(!!this.config.lineWrapping), this.view.setLineNumbersVisible(this.config.lineNumbers !== !1), this.hasCustomDecorationHighlightSupport = this.detectCustomHighlightSupport(), this.observeDecorationRelevantMutations(), this.setupEventHandlers(), this.config.extensions && this.config.extensions.forEach((n) => this.addExtension(n)), this.setTheme(this.config.theme), this.view.setReadOnly(this.config.readOnly || !1), this.renderTextWithHighlight(this.textModel.getText()), this.registerBuiltInCommands();
1225
+ }, this.textModel = new It(this.config.value), this.view = new Ti(e), this.view.setTabSize(this.config.tabSize || 2), this.view.setLineWrapping(!!this.config.lineWrapping), this.view.setLineNumbersVisible(this.config.lineNumbers !== !1), this.config.ariaLabel && this.view.setAccessibleName(this.config.ariaLabel), this.hasCustomDecorationHighlightSupport = this.detectCustomHighlightSupport(), this.observeDecorationRelevantMutations(), this.setupEventHandlers(), this.config.extensions && this.config.extensions.forEach((n) => this.addExtension(n)), this.setTheme(this.config.theme), this.view.setReadOnly(this.config.readOnly || !1), this.renderTextWithHighlight(this.textModel.getText()), this.registerBuiltInCommands();
1222
1226
  }
1223
1227
  // Public accessors for extensions
1224
1228
  getTextModel() {
@@ -1440,20 +1444,29 @@ const Si = 200, wi = 1e3, vi = 8e3, B = class B {
1440
1444
  // Configuration
1441
1445
  setTheme(e) {
1442
1446
  this.currentTheme = e;
1443
- const t = {
1444
- "editor-background": e === "dark" ? "#1e1e1e" : "#ffffff",
1445
- "editor-foreground": e === "dark" ? "#f8f9fa" : "#1a1a1a",
1446
- "editor-gutter-background": e === "dark" ? "#252526" : "#f8f9fa",
1447
- "editor-gutter-foreground": e === "dark" ? "#858585" : "#666666",
1448
- "editor-gutter-border": e === "dark" ? "#3e3e42" : "#e1e5e9"
1447
+ const t = e === "dark", n = {
1448
+ "editor-background": t ? "#1e1e1e" : "#ffffff",
1449
+ "editor-foreground": t ? "#f8f9fa" : "#1a1a1a",
1450
+ "editor-gutter-background": t ? "#252526" : "#f8f9fa",
1451
+ // muted text must read on the editor and on a tinted (active, hovered) row: 4.5:1 or better
1452
+ "editor-gutter-foreground": t ? "#a6a6ab" : "#5c6066",
1453
+ "editor-gutter-border": t ? "#3e3e42" : "#e1e5e9",
1454
+ // overlays (completion, find, go to line, menus): a raised surface with a hairline and a soft shadow
1455
+ "editor-surface": t ? "#262629" : "#ffffff",
1456
+ "editor-surface-hover": t ? "#2f2f34" : "#f3f4f6",
1457
+ "editor-border-strong": t ? "#505057" : "#cfd4da",
1458
+ "editor-accent": t ? "#4da3ff" : "#0b63c4",
1459
+ "editor-accent-soft": t ? "rgba(77, 163, 255, 0.16)" : "rgba(11, 99, 196, 0.10)",
1460
+ "editor-accent-contrast": t ? "#0b1b2b" : "#ffffff",
1461
+ "editor-shadow": t ? "0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35)" : "0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.08)"
1449
1462
  };
1450
- this.view.applyTheme(t);
1451
- const n = this.extensions.get("syntax-highlighting");
1452
- if (n && typeof n.setTheme == "function")
1463
+ this.view.applyTheme(n);
1464
+ const i = this.extensions.get("syntax-highlighting");
1465
+ if (i && typeof i.setTheme == "function")
1453
1466
  try {
1454
- n.setTheme(e === "dark" ? "dark" : "light"), this.renderTextWithHighlight(this.textModel.getText());
1455
- } catch (i) {
1456
- console.warn("Error applying theme to syntax-highlighting extension", i);
1467
+ i.setTheme(e === "dark" ? "dark" : "light"), this.renderTextWithHighlight(this.textModel.getText());
1468
+ } catch (s) {
1469
+ console.warn("Error applying theme to syntax-highlighting extension", s);
1457
1470
  }
1458
1471
  }
1459
1472
  setReadOnly(e) {
@@ -2561,12 +2574,12 @@ const C = class C {
2561
2574
  this.editorContainerSelector
2562
2575
  ), n = t == null ? void 0 : t.parentElement, i = e.closest(".rte-source-editor-modal") || n || t || e.parentElement;
2563
2576
  if (!i) return;
2564
- window.getComputedStyle(i).position === "static" && (i.style.position = "relative"), this.searchUI = document.createElement("div"), this.searchUI.className = C.css.root, this.searchUI.style.display = "none", this.searchUI.innerHTML = `
2577
+ window.getComputedStyle(i).position === "static" && (i.style.position = "relative"), this.searchUI = document.createElement("div"), this.searchUI.className = C.css.root, this.searchUI.style.display = "none", this.searchUI.setAttribute("role", "search"), this.searchUI.setAttribute("aria-label", "Find and replace"), this.searchUI.innerHTML = `
2565
2578
  <div class="${C.css.row}">
2566
- <input type="text" class="${C.css.findInput} ${C.css.inputBase}" placeholder="Find..." />
2567
- <button class="${C.css.prevButton} ${C.css.buttonBase}" type="button" aria-label="Previous match">↑</button>
2568
- <button class="${C.css.nextButton} ${C.css.buttonBase}" type="button" aria-label="Next match">↓</button>
2569
- <button class="${C.css.closeButton} ${C.css.buttonBase}" type="button" aria-label="Close search">×</button>
2579
+ <input type="text" class="${C.css.findInput} ${C.css.inputBase}" placeholder="Find..." aria-label="Find" autocomplete="off" spellcheck="false" />
2580
+ <button class="${C.css.prevButton} ${C.css.buttonBase}" type="button" aria-label="Previous match" title="Previous match (Shift+Enter)"><svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" focusable="false"><path d="M4 10l4-4 4 4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
2581
+ <button class="${C.css.nextButton} ${C.css.buttonBase}" type="button" aria-label="Next match" title="Next match (Enter)"><svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" focusable="false"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
2582
+ <button class="${C.css.closeButton} ${C.css.buttonBase}" type="button" aria-label="Close search" title="Close (Esc)"><svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" focusable="false"><path d="M4 4l8 8M12 4l-8 8" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg></button>
2570
2583
  </div>
2571
2584
  <div class="${C.css.options}">
2572
2585
  <label class="${C.css.optionLabel}" title="Case sensitive">
@@ -2583,10 +2596,10 @@ const C = class C {
2583
2596
  </label>
2584
2597
  </div>
2585
2598
  <div class="${C.css.meta}">
2586
- <div class="${C.css.status} ${C.css.statusLayout}"></div>
2599
+ <div class="${C.css.status} ${C.css.statusLayout}" role="status" aria-live="polite"></div>
2587
2600
  <div class="${C.css.mode} ${C.css.modeLayout}" aria-live="polite"></div>
2588
2601
  </div>
2589
- <input type="text" class="${C.css.replaceInput} ${C.css.inputBase} ${C.css.replaceInputLayout}" placeholder="Replace with..." />
2602
+ <input type="text" class="${C.css.replaceInput} ${C.css.inputBase} ${C.css.replaceInputLayout}" placeholder="Replace with..." aria-label="Replace with" autocomplete="off" spellcheck="false" />
2590
2603
  `;
2591
2604
  const s = this.searchUI.querySelector(
2592
2605
  `.${C.css.findInput}`
@@ -3568,7 +3581,7 @@ class Oi {
3568
3581
  }
3569
3582
  createFoldIndicator(e, t, n) {
3570
3583
  const i = document.createElement("button");
3571
- return i.type = "button", i.style.cssText = `
3584
+ i.type = "button", i.style.cssText = `
3572
3585
  position: absolute;
3573
3586
  left: 0;
3574
3587
  top: ${t * this.lineHeight}px;
@@ -3583,12 +3596,13 @@ class Oi {
3583
3596
  background: transparent;
3584
3597
  border: none;
3585
3598
  padding: 0;
3586
- font-size: 10px;
3587
3599
  user-select: none;
3588
- `, i.textContent = n ? "▶" : "▼", i.title = n ? "Expand folded region" : "Collapse region", i.setAttribute("aria-label", i.title), i.addEventListener("mousedown", (s) => {
3589
- s.preventDefault();
3590
- }), i.addEventListener("click", (s) => {
3591
- s.preventDefault(), s.stopPropagation(), this.toggleFold(e);
3600
+ `, i.className = "lce-fold-toggle";
3601
+ const s = document.createElement("span");
3602
+ return s.className = "lce-fold-chevron", s.dataset.state = n ? "closed" : "open", s.setAttribute("aria-hidden", "true"), i.appendChild(s), i.title = n ? "Expand folded region" : "Collapse region", i.setAttribute("aria-label", i.title), i.setAttribute("aria-expanded", String(!n)), i.addEventListener("mousedown", (r) => {
3603
+ r.preventDefault();
3604
+ }), i.addEventListener("click", (r) => {
3605
+ r.preventDefault(), r.stopPropagation(), this.toggleFold(e);
3592
3606
  }), i;
3593
3607
  }
3594
3608
  toggleFold(e) {
@@ -6654,4 +6668,4 @@ const Mt = '[data-theme="dark"], .dark, .editora-theme-dark', ms = `/* Source Ed
6654
6668
  export {
6655
6669
  ys as CodePlugin
6656
6670
  };
6657
- //# sourceMappingURL=CodePlugin.native-CPfKDrkr.mjs.map
6671
+ //# sourceMappingURL=CodePlugin.native-DhLs8BoM.mjs.map