@richscripts/richtexteditor 2.13.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/package.json +1 -1
  2. package/richtexteditor/all_plugins.js +43 -6
  3. package/richtexteditor/all_plugins.min.js +34 -34
  4. package/richtexteditor/plugins/a11yenhance.min.js +1 -0
  5. package/richtexteditor/plugins/accessibilitychecker.min.js +1 -0
  6. package/richtexteditor/plugins/aitoolkit.min.js +14 -0
  7. package/richtexteditor/plugins/all_plugins.js +43 -6
  8. package/richtexteditor/plugins/all_plugins.min.js +34 -34
  9. package/richtexteditor/plugins/autocorrect.min.js +1 -0
  10. package/richtexteditor/plugins/autoembed.min.js +1 -0
  11. package/richtexteditor/plugins/blocktypes.min.js +2 -0
  12. package/richtexteditor/plugins/bookmarkcard.min.js +2 -0
  13. package/richtexteditor/plugins/changecase.min.js +1 -0
  14. package/richtexteditor/plugins/charlimit.min.js +2 -0
  15. package/richtexteditor/plugins/comments.min.js +3 -0
  16. package/richtexteditor/plugins/contentminimap.min.js +1 -0
  17. package/richtexteditor/plugins/crossreference.min.js +1 -0
  18. package/richtexteditor/plugins/dialoga11y.min.js +1 -0
  19. package/richtexteditor/plugins/dictation.min.js +1 -0
  20. package/richtexteditor/plugins/documentimport.min.js +4 -0
  21. package/richtexteditor/plugins/documentoutline.js +43 -6
  22. package/richtexteditor/plugins/documentoutline.min.js +1 -0
  23. package/richtexteditor/plugins/docxexport.min.js +2 -0
  24. package/richtexteditor/plugins/draghandle.min.js +1 -0
  25. package/richtexteditor/plugins/emailtoolkit.min.js +1 -0
  26. package/richtexteditor/plugins/emojiautocomplete.min.js +1 -0
  27. package/richtexteditor/plugins/foldheadings.min.js +1 -0
  28. package/richtexteditor/plugins/footnotes.min.js +1 -0
  29. package/richtexteditor/plugins/formatpainter.min.js +1 -0
  30. package/richtexteditor/plugins/formattingmarks.min.js +1 -0
  31. package/richtexteditor/plugins/gapcursor.min.js +1 -0
  32. package/richtexteditor/plugins/ghostcomplete.min.js +1 -0
  33. package/richtexteditor/plugins/html2pdf.min.js +1 -0
  34. package/richtexteditor/plugins/imageeditor.min.js +1 -0
  35. package/richtexteditor/plugins/importstyles.min.js +1 -0
  36. package/richtexteditor/plugins/inlinecode.min.js +1 -0
  37. package/richtexteditor/plugins/insertcode.min.js +8 -0
  38. package/richtexteditor/plugins/insertemoji.min.js +1 -0
  39. package/richtexteditor/plugins/insertgallery.min.js +1 -0
  40. package/richtexteditor/plugins/inserttemplate.min.js +1 -0
  41. package/richtexteditor/plugins/keyboarda11y.min.js +1 -0
  42. package/richtexteditor/plugins/layouttable.min.js +1 -0
  43. package/richtexteditor/plugins/linenumbers.min.js +1 -0
  44. package/richtexteditor/plugins/linkchecker.min.js +1 -0
  45. package/richtexteditor/plugins/localdraft.min.js +1 -0
  46. package/richtexteditor/plugins/markdownexport.min.js +2 -0
  47. package/richtexteditor/plugins/mathdialog.min.js +1 -0
  48. package/richtexteditor/plugins/mentionplugin.min.js +3 -0
  49. package/richtexteditor/plugins/mergefields.min.js +1 -0
  50. package/richtexteditor/plugins/mermaiddiagram.min.js +16 -0
  51. package/richtexteditor/plugins/multilevellist.min.js +1 -0
  52. package/richtexteditor/plugins/multiroot.min.js +1 -0
  53. package/richtexteditor/plugins/nodetypes.min.js +1 -0
  54. package/richtexteditor/plugins/pagination.min.js +1 -0
  55. package/richtexteditor/plugins/pdfexport.min.js +19 -0
  56. package/richtexteditor/plugins/permanentpen.min.js +1 -0
  57. package/richtexteditor/plugins/readabilitystats.min.js +1 -0
  58. package/richtexteditor/plugins/readaloud.min.js +1 -0
  59. package/richtexteditor/plugins/restrictedediting.min.js +2 -0
  60. package/richtexteditor/plugins/revisionhistory.min.js +3 -0
  61. package/richtexteditor/plugins/rtlui.min.js +2 -0
  62. package/richtexteditor/plugins/rubyannotation.min.js +1 -0
  63. package/richtexteditor/plugins/sanitizer.min.js +1 -0
  64. package/richtexteditor/plugins/shadowdom.min.js +1 -0
  65. package/richtexteditor/plugins/slashcommand.min.js +2 -0
  66. package/richtexteditor/plugins/smartchips.min.js +2 -0
  67. package/richtexteditor/plugins/spellcheck.min.js +2 -0
  68. package/richtexteditor/plugins/stateinspector.min.js +2 -0
  69. package/richtexteditor/plugins/structured-content-bridge.js +5178 -0
  70. package/richtexteditor/plugins/structured-content-bridge.min.js +19 -0
  71. package/richtexteditor/plugins/tableofcontents.min.js +1 -0
  72. package/richtexteditor/plugins/tabletools.min.js +1 -0
  73. package/richtexteditor/plugins/textdirection.min.js +1 -0
  74. package/richtexteditor/plugins/textpartlanguage.min.js +1 -0
  75. package/richtexteditor/plugins/todolist.min.js +1 -0
  76. package/richtexteditor/plugins/trackedchanges.min.js +3 -0
  77. package/richtexteditor/plugins/typewriter.min.js +1 -0
  78. package/richtexteditor/plugins/watermark.min.js +1 -0
  79. package/richtexteditor/plugins/wordexport.min.js +23 -0
  80. package/richtexteditor/plugins/yjscollab.min.js +2 -0
  81. package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -0
  82. package/richtexteditor/rte-config.js +2 -0
  83. package/richtexteditor/rte.js +4 -2
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "2.13.0",
6
+ "version": "2.14.0",
7
7
  "description": "A full-featured JavaScript rich text editor (WYSIWYG) with toolbar, plugins, i18n support, a built-in AI Toolkit (Ask AI, AI Chat, AI Review drawer, BYOK resolver), structured content APIs (JSON/Markdown), and an optional collaboration / review stack: slash commands, @mentions, human-author Track Changes, threaded comments, revision history, and Yjs-backed presence. Ships first-class React, Vue, Angular and Svelte bindings, a headless \"bring your own UI\" core, and server-safe conversion helpers.",
8
8
  "main": "./richtexteditor/rte.js",
9
9
  "bin": {
@@ -25516,20 +25516,57 @@ function RTE_Plugin_DocumentOutline() {
25516
25516
  var minLevel = Math.max(1, Math.min(6, config.documentOutlineMinLevel || 1));
25517
25517
  var maxLevel = Math.max(minLevel, Math.min(6, config.documentOutlineMaxLevel || 6));
25518
25518
  var headings = editable.querySelectorAll("h1,h2,h3,h4,h5,h6");
25519
- var counts = {};
25520
25519
  var items = [];
25521
25520
  var i;
25521
+ // 2026-09-24 Ids must be unique in the SAVED document. This used to keep any id a
25522
+ // heading already had, so copying or cutting a heading and pasting it saved the same
25523
+ // id twice (measured on published 2.6.7: <h1 id="hello-world"> x2), and outline
25524
+ // clicks / anchor links went to the first one. Now the FIRST heading in document
25525
+ // order keeps an id and a later duplicate is renamed, so the original's links stay
25526
+ // valid and the pasted copy becomes "slug-2". Ids on non-heading elements are
25527
+ // reserved too, so a heading never takes one. Every heading is checked, including
25528
+ // levels the outline does not display, since they share one id namespace.
25529
+ var used = {};
25530
+ var withId = editable.querySelectorAll("[id]");
25531
+ for (i = 0; i < withId.length; i++) {
25532
+ if (!/^H[1-6]$/.test(withId[i].nodeName)) used[withId[i].id] = true;
25533
+ }
25534
+ // Headings with text claim ids first. An EMPTY heading is usually the shell a cut
25535
+ // leaves behind, still carrying the moved heading's id; letting it claim first would
25536
+ // hand the moved heading "-2" and break every link to it. So empty headings go last
25537
+ // and simply drop an id that a real heading already holds.
25538
+ var textOf = function (el) {
25539
+ return (el.innerText || el.textContent || "").replace(/\s+/g, " ").replace(/^\s+|\s+$/g, "");
25540
+ };
25541
+ var empties = [];
25542
+ for (i = 0; i < headings.length; i++) {
25543
+ var h = headings[i];
25544
+ var t = textOf(h);
25545
+ if (!t) { empties.push(h); continue; }
25546
+ var base = h.id;
25547
+ if (!base) base = slugifyHeading(t);
25548
+ else if (!used[base]) { used[base] = true; continue; }
25549
+ var unique = base;
25550
+ var n = 2;
25551
+ while (used[unique]) { unique = base + "-" + n; n++; }
25552
+ used[unique] = true;
25553
+ if (h.id !== unique) h.id = unique;
25554
+ }
25555
+ for (i = 0; i < empties.length; i++) {
25556
+ if (!empties[i].id) continue;
25557
+ if (used[empties[i].id]) empties[i].removeAttribute("id");
25558
+ else used[empties[i].id] = true;
25559
+ }
25522
25560
  for (i = 0; i < headings.length; i++) {
25523
25561
  var heading = headings[i];
25524
25562
  var level = parseInt(heading.nodeName.substring(1), 10);
25525
25563
  if (level < minLevel || level > maxLevel) continue;
25526
25564
  var text = (heading.innerText || heading.textContent || "").replace(/\s+/g, " ").replace(/^\s+|\s+$/g, "");
25527
- var baseId = heading.id || slugifyHeading(text);
25528
- counts[baseId] = (counts[baseId] || 0) + 1;
25529
- var resolvedId = heading.id || (counts[baseId] === 1 ? baseId : (baseId + "-" + counts[baseId]));
25530
- if (!heading.id) heading.id = resolvedId;
25531
25565
  items.push({
25532
- id: heading.id,
25566
+ // an empty heading may now have no id; key it internally (never written to
25567
+ // the element) so "" can't match the "no active heading" state and light up
25568
+ // every empty entry at once.
25569
+ id: heading.id || ("__rte-outline-" + items.length),
25533
25570
  level: level,
25534
25571
  text: text || ("Heading " + (items.length + 1)),
25535
25572
  element: heading