@editora/core 1.0.6 → 1.0.8

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 (60) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{AnchorPlugin.native-C1Rw5m04.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +129 -105
  3. package/dist/ApprovalWorkflowPlugin.native-C3jtAYjG.mjs +1076 -0
  4. package/dist/{BackgroundColorPlugin.native-BE-p9DRd.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +119 -122
  5. package/dist/BlocksLibraryPlugin.native-HMWKxWNs.mjs +1327 -0
  6. package/dist/CitationsPlugin.native-BnU0qCwR.mjs +1464 -0
  7. package/dist/CodePlugin.native-DlpTPdkd.mjs +2691 -0
  8. package/dist/{CommentsPlugin.native-tMnWn8a2.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +153 -135
  9. package/dist/ConditionalContentPlugin.native-CfhY46rU.mjs +1367 -0
  10. package/dist/ContentRulesPlugin.native-nBLQ8QFZ.mjs +1099 -0
  11. package/dist/DataBindingPlugin.native-jQ1JPRTp.mjs +917 -0
  12. package/dist/DocSchemaPlugin.native-CHOge18O.mjs +1325 -0
  13. package/dist/{DocumentManagerPlugin.native-BvZL5CSG.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +43 -43
  14. package/dist/{EmbedIframePlugin.native-CSWIB1jm.mjs → EmbedIframePlugin.native-DKJx2OS7.mjs} +61 -58
  15. package/dist/{EmojisPlugin.native-DxTm_DL-.mjs → EmojisPlugin.native-CitxxlWX.mjs} +135 -104
  16. package/dist/{LinkPlugin.native-CS2g-G18.mjs → LinkPlugin.native-DYCIcdTm.mjs} +47 -45
  17. package/dist/{MathPlugin.native-KUxz0o8C.mjs → MathPlugin.native-f_mDp8VL.mjs} +149 -108
  18. package/dist/{MediaManagerPlugin.native-CgP5iInD.mjs → MediaManagerPlugin.native-BiXiK8FC.mjs} +238 -217
  19. package/dist/MentionPlugin.native-BMDlOqur.mjs +734 -0
  20. package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +559 -0
  21. package/dist/PIIRedactionPlugin.native-DcsjmtV1.mjs +1396 -0
  22. package/dist/{PageBreakPlugin.native-CGiQxXqR.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +86 -77
  23. package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +30 -30
  24. package/dist/SlashCommandsPlugin.native-CmxvMEaE.mjs +755 -0
  25. package/dist/SmartPastePlugin.native-BOKKtF07.mjs +1398 -0
  26. package/dist/{SpecialCharactersPlugin.native-DANrbExJ.mjs → SpecialCharactersPlugin.native-CZDato89.mjs} +143 -98
  27. package/dist/{SpellCheckPlugin.native-C8bPvRHy.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +239 -219
  28. package/dist/{TemplatePlugin.native-4lKEm-WY.mjs → TemplatePlugin.native-CrpfKRJ8.mjs} +167 -143
  29. package/dist/{TextColorPlugin.native-Clgtb50j.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +134 -118
  30. package/dist/TrackChangesPlugin.native-Bghu2q4a.mjs +761 -0
  31. package/dist/TranslationWorkflowPlugin.native-Bz6jDGvj.mjs +1728 -0
  32. package/dist/VersionDiffPlugin.native-Bvxgy--t.mjs +776 -0
  33. package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
  34. package/dist/anchoredPopover-Bxds0VoB.mjs +110 -0
  35. package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
  36. package/dist/editora.min.js +13 -13
  37. package/dist/editora.umd.js +13 -13
  38. package/dist/html2canvas.esm-AYkPY5LS.mjs +4803 -0
  39. package/dist/index-BslAFzmv.mjs +16544 -0
  40. package/dist/index-D1LOqg5C.js +10 -0
  41. package/dist/{index-OwnkG39N.mjs → index-DqC57IEH.mjs} +438 -328
  42. package/dist/index.cjs.js +1 -1
  43. package/dist/{index.es-CuicffkQ.mjs → index.es-BYD2KEo6.mjs} +5 -4
  44. package/dist/index.esm.js +2 -2
  45. package/dist/jspdf.es.min-BJGtOnRT.mjs +7890 -0
  46. package/dist/plugin-loader.js +77 -40
  47. package/dist/webcomponent-core.js +456 -346
  48. package/dist/webcomponent-core.min.css +1 -1
  49. package/dist/webcomponent-core.min.js +87 -107
  50. package/dist/webcomponent.cjs.js +1 -1
  51. package/dist/webcomponent.esm.js +1 -1
  52. package/dist/webcomponent.js +503 -356
  53. package/dist/webcomponent.min.css +1 -1
  54. package/dist/webcomponent.min.js +6003 -658
  55. package/package.json +2 -2
  56. package/dist/CodePlugin.native-B263UI8O.mjs +0 -2173
  57. package/dist/MergeTagPlugin.native-DIGWhdnF.mjs +0 -419
  58. package/dist/colorSelectionApply-CK1My9N2.mjs +0 -67
  59. package/dist/documentManager-irzj9n3V.mjs +0 -37627
  60. package/dist/index-CqWQFb3D.js +0 -10
@@ -1,4 +1,4 @@
1
- const u = {
1
+ const m = {
2
2
  all: {
3
3
  name: "All",
4
4
  characters: [
@@ -389,7 +389,7 @@ const u = {
389
389
  name: "Arrows",
390
390
  characters: ["←", "↑", "→", "↓", "↔", "↕", "↖", "↗", "↘", "↙", "↚", "↛", "↜", "↝", "↞", "↟", "↠", "↡", "↢", "↣", "↤", "↥", "↦", "↧", "↨", "↩", "↪", "↫", "↬", "↭", "↮", "↯", "↰", "↱", "↲", "↳", "↴", "↵", "↶", "↷", "↸", "↹", "↺", "↻", "↼", "↽", "↾", "↿", "⇀", "⇁", "⇂", "⇃", "⇄", "⇅", "⇆", "⇇", "⇈", "⇉", "⇊", "⇋", "⇌", "⇍", "⇎", "⇏", "⇐", "⇑", "⇒", "⇓", "⇔", "⇕", "⇖", "⇗", "⇘", "⇙", "⇚", "⇛", "⇜", "⇝", "⇞", "⇟", "⇠", "⇡", "⇢", "⇣", "⇤", "⇥", "⇦", "⇧", "⇨", "⇩", "⇪", "⇫", "⇬", "⇭", "⇮", "⇯", "⇰", "⇱", "⇲", "⇳", "⇴", "⇵", "⇶", "⇷", "⇸", "⇹", "⇺", "⇻", "⇼", "⇽", "⇾", "⇿"]
391
391
  }
392
- }, f = {
392
+ }, k = {
393
393
  "€": "euro",
394
394
  "£": "pound",
395
395
  "¥": "yen",
@@ -438,16 +438,16 @@ const u = {
438
438
  "↓": "down arrow",
439
439
  "↔": "left right arrow"
440
440
  };
441
- let g = !1;
442
- const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
441
+ let v = !1;
442
+ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
443
443
  const a = window.getSelection();
444
444
  if (!a || a.rangeCount === 0) return null;
445
- const e = a.anchorNode, r = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement;
446
- return (r == null ? void 0 : r.closest(".rte-content, .editora-content")) || null;
447
- }, v = (a) => {
448
- const e = a || m();
449
- return e ? !!e.closest(x) : !1;
450
- }, y = () => {
445
+ const e = a.anchorNode, t = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement;
446
+ return (t == null ? void 0 : t.closest(".rte-content, .editora-content")) || null;
447
+ }, z = (a) => {
448
+ const e = a || w();
449
+ return e ? !!e.closest(E) : !1;
450
+ }, C = () => {
451
451
  if (typeof document == "undefined") return;
452
452
  const a = "special-characters-plugin-styles";
453
453
  if (document.getElementById(a)) return;
@@ -464,6 +464,26 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
464
464
  --rte-sc-accent: #1f75fe;
465
465
  --rte-sc-accent-strong: #165fd6;
466
466
  --rte-sc-ring: rgba(31, 117, 254, 0.18);
467
+ --rte-picker-dialog-width: min(640px, 96vw);
468
+ --rte-picker-dialog-max-height: min(560px, 86vh);
469
+ --rte-picker-dialog-radius: 12px;
470
+ --rte-picker-search-wrap-padding: 12px;
471
+ --rte-picker-search-height: 38px;
472
+ --rte-picker-search-font-size: 13px;
473
+ --rte-picker-search-radius: 8px;
474
+ --rte-picker-tabs-width: 156px;
475
+ --rte-picker-tab-padding-y: 10px;
476
+ --rte-picker-tab-padding-x: 12px;
477
+ --rte-picker-tab-font-size: 13px;
478
+ --rte-picker-grid-padding: 12px;
479
+ --rte-picker-grid-gap: 6px;
480
+ --rte-picker-cell-size: 34px;
481
+ --rte-picker-cell-font-size: 17px;
482
+ --rte-picker-cell-radius: 7px;
483
+ --rte-picker-mobile-tab-min-width: 82px;
484
+ --rte-picker-mobile-cell-size: 32px;
485
+ --rte-picker-mobile-grid-gap: 5px;
486
+ --rte-picker-mobile-dialog-max-height: 88vh;
467
487
  position: fixed;
468
488
  top: 0;
469
489
  left: 0;
@@ -496,11 +516,10 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
496
516
  background: var(--rte-sc-dialog-bg);
497
517
  color: var(--rte-sc-dialog-text);
498
518
  border: 1px solid var(--rte-sc-border);
499
- border-radius: 12px;
519
+ border-radius: var(--rte-picker-dialog-radius);
500
520
  box-shadow: 0 24px 48px rgba(10, 15, 24, 0.28);
501
- max-width: 800px;
502
- width: 90%;
503
- max-height: 80vh;
521
+ width: var(--rte-picker-dialog-width);
522
+ max-height: var(--rte-picker-dialog-max-height);
504
523
  display: flex;
505
524
  flex-direction: column;
506
525
  overflow: hidden;
@@ -554,18 +573,20 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
554
573
  display: flex;
555
574
  flex-direction: column;
556
575
  overflow: hidden;
576
+ min-width: 0;
557
577
  }
558
578
 
559
579
  .special-characters-search {
560
- padding: 16px 16px 0 16px;
580
+ padding: var(--rte-picker-search-wrap-padding) var(--rte-picker-search-wrap-padding) 0 var(--rte-picker-search-wrap-padding);
561
581
  }
562
582
 
563
583
  .special-characters-search-input {
564
584
  width: 100%;
565
- padding: 10px 12px;
585
+ height: var(--rte-picker-search-height);
586
+ padding: 8px 12px;
566
587
  border: 1px solid var(--rte-sc-border);
567
- border-radius: 8px;
568
- font-size: 14px;
588
+ border-radius: var(--rte-picker-search-radius);
589
+ font-size: var(--rte-picker-search-font-size);
569
590
  color: var(--rte-sc-dialog-text);
570
591
  background-color: var(--rte-sc-subtle-bg);
571
592
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
@@ -585,21 +606,23 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
585
606
  .special-characters-tabs {
586
607
  display: flex;
587
608
  flex-direction: column;
588
- width: 180px;
609
+ width: var(--rte-picker-tabs-width);
589
610
  border-right: 1px solid var(--rte-sc-border);
590
611
  background-color: var(--rte-sc-subtle-bg);
612
+ overflow-y: auto;
591
613
  }
592
614
 
593
615
  .special-characters-tab {
594
- padding: 12px 16px;
616
+ padding: var(--rte-picker-tab-padding-y) var(--rte-picker-tab-padding-x);
595
617
  border: none;
596
618
  background: none;
597
619
  text-align: left;
598
620
  cursor: pointer;
599
- font-size: 14px;
621
+ font-size: var(--rte-picker-tab-font-size);
600
622
  color: var(--rte-sc-muted-text);
601
623
  border-bottom: 1px solid var(--rte-sc-border);
602
624
  transition: all 0.2s ease;
625
+ line-height: 1.25;
603
626
  }
604
627
 
605
628
  .special-characters-tab:hover {
@@ -614,24 +637,25 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
614
637
  }
615
638
 
616
639
  .special-characters-grid {
617
- padding: 16px;
640
+ padding: var(--rte-picker-grid-padding);
618
641
  overflow-y: auto;
619
642
  display: grid;
620
- grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
621
- gap: 8px;
643
+ grid-template-columns: repeat(auto-fill, minmax(var(--rte-picker-cell-size), 1fr));
644
+ gap: var(--rte-picker-grid-gap);
645
+ contain: content;
622
646
  }
623
647
 
624
648
  .special-characters-item {
625
- width: 40px;
626
- height: 40px;
649
+ width: var(--rte-picker-cell-size);
650
+ height: var(--rte-picker-cell-size);
627
651
  display: flex;
628
652
  align-items: center;
629
653
  justify-content: center;
630
654
  border: 1px solid var(--rte-sc-border);
631
655
  background: var(--rte-sc-subtle-bg);
632
- border-radius: 8px;
656
+ border-radius: var(--rte-picker-cell-radius);
633
657
  cursor: pointer;
634
- font-size: 18px;
658
+ font-size: var(--rte-picker-cell-font-size);
635
659
  transition: all 0.2s ease;
636
660
  color: var(--rte-sc-dialog-text);
637
661
  }
@@ -660,8 +684,8 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
660
684
 
661
685
  @media (max-width: 768px) {
662
686
  .special-characters-dialog {
663
- width: 95%;
664
- max-height: 90vh;
687
+ width: 96%;
688
+ max-height: var(--rte-picker-mobile-dialog-max-height);
665
689
  }
666
690
 
667
691
  .special-characters-content {
@@ -680,83 +704,104 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
680
704
  border-bottom: none;
681
705
  border-right: 1px solid var(--rte-sc-border);
682
706
  white-space: nowrap;
707
+ min-width: var(--rte-picker-mobile-tab-min-width);
708
+ }
709
+
710
+ .special-characters-grid {
711
+ grid-template-columns: repeat(auto-fill, minmax(var(--rte-picker-mobile-cell-size), 1fr));
712
+ gap: var(--rte-picker-mobile-grid-gap);
713
+ }
714
+
715
+ .special-characters-item {
716
+ width: var(--rte-picker-mobile-cell-size);
717
+ height: var(--rte-picker-mobile-cell-size);
718
+ font-size: 16px;
683
719
  }
684
720
  }
685
721
  `, document.head.appendChild(e);
686
- }, w = (a) => {
722
+ }, L = (a) => {
687
723
  const e = window.getSelection();
688
724
  if (e && e.rangeCount > 0) {
689
- const r = e.getRangeAt(0);
690
- r.deleteContents();
725
+ const t = e.getRangeAt(0);
726
+ t.deleteContents();
691
727
  const c = document.createTextNode(a);
692
- r.insertNode(c), r.setStartAfter(c), r.setEndAfter(c), e.removeAllRanges(), e.addRange(r);
728
+ t.insertNode(c), t.setStartAfter(c), t.setEndAfter(c), e.removeAllRanges(), e.addRange(t);
693
729
  }
694
- }, k = (a) => {
695
- if (typeof window == "undefined" || g) return;
696
- g = !0, y();
697
- let e = "all", r = "";
698
- const c = document.createElement("div");
699
- c.className = "special-characters-overlay", v(a) && c.classList.add("rte-ui-theme-dark");
730
+ }, S = (a) => {
731
+ if (typeof window == "undefined" || v) return;
732
+ v = !0, C();
733
+ let e = "all", t = "", c = null;
734
+ const i = document.createElement("div");
735
+ i.className = "special-characters-overlay", z(a) && i.classList.add("rte-ui-theme-dark");
700
736
  const s = document.createElement("div");
701
- s.className = "special-characters-dialog", s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "true");
702
- const d = () => {
703
- const o = u[e].characters.filter((t) => {
704
- if (!r.trim()) return !0;
705
- const i = r.toLowerCase();
706
- return t.toLowerCase().includes(i) || (f[t] || "").toLowerCase().includes(i);
707
- });
708
- s.innerHTML = `
709
- <div class="special-characters-header">
710
- <h2>Insert Special Characters</h2>
711
- <button class="special-characters-close">×</button>
737
+ s.className = "special-characters-dialog", s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "true"), s.innerHTML = `
738
+ <div class="special-characters-header">
739
+ <h2>Insert Special Characters</h2>
740
+ <button class="special-characters-close">×</button>
741
+ </div>
742
+ <div class="special-characters-content">
743
+ <div class="special-characters-tabs">
744
+ ${Object.keys(m).map((r) => `
745
+ <button class="special-characters-tab ${e === r ? "active" : ""}" data-category="${r}">
746
+ ${m[r].name}
747
+ </button>
748
+ `).join("")}
712
749
  </div>
713
- <div class="special-characters-content">
714
- <div class="special-characters-tabs">
715
- ${Object.keys(u).map((t) => `
716
- <button class="special-characters-tab ${e === t ? "active" : ""}" data-category="${t}">
717
- ${u[t].name}
718
- </button>
719
- `).join("")}
720
- </div>
721
- <div class="special-characters-main-content">
722
- <div class="special-characters-search">
723
- <input type="text" placeholder="Search characters..." value="${r}" class="special-characters-search-input">
724
- </div>
725
- <div class="special-characters-grid">
726
- ${o.length > 0 ? o.map((t) => `
727
- <button class="special-characters-item" data-char="${t}" title="${f[t] || t}">
728
- ${t}
729
- </button>
730
- `).join("") : `<div class="special-characters-no-results">No characters found for "${r}"</div>`}
731
- </div>
750
+ <div class="special-characters-main-content">
751
+ <div class="special-characters-search">
752
+ <input
753
+ type="text"
754
+ placeholder="Search characters..."
755
+ class="special-characters-search-input"
756
+ >
732
757
  </div>
758
+ <div class="special-characters-grid"></div>
733
759
  </div>
734
- `;
735
- const p = s.querySelector(".special-characters-close");
736
- p == null || p.addEventListener("click", l), s.querySelectorAll(".special-characters-tab").forEach((t) => {
737
- t.addEventListener("click", (i) => {
738
- const n = i.target.getAttribute("data-category");
739
- n && (e = n, d());
740
- });
741
- });
742
- const h = s.querySelector(".special-characters-search-input");
743
- h == null || h.addEventListener("input", (t) => {
744
- r = t.target.value, d();
745
- }), s.querySelectorAll(".special-characters-item").forEach((t) => {
746
- t.addEventListener("click", (i) => {
747
- const n = i.target.getAttribute("data-char");
748
- n && (w(n), l());
749
- });
760
+ </div>
761
+ `;
762
+ const l = s.querySelector(".special-characters-tabs"), n = s.querySelector(".special-characters-grid"), d = s.querySelector(".special-characters-search-input"), u = s.querySelector(".special-characters-close"), y = () => m[e].characters.filter((r) => {
763
+ if (!t.trim()) return !0;
764
+ const o = t.toLowerCase();
765
+ return r.toLowerCase().includes(o) || (k[r] || "").toLowerCase().includes(o);
766
+ }), f = () => {
767
+ l == null || l.querySelectorAll(".special-characters-tab").forEach((r) => {
768
+ r.classList.toggle("active", r.getAttribute("data-category") === e);
750
769
  });
751
- }, l = () => {
752
- c.parentNode && c.parentNode.removeChild(c), g = !1, document.removeEventListener("keydown", b);
753
- }, b = (o) => {
754
- o.key === "Escape" && (o.preventDefault(), o.stopPropagation(), l());
770
+ }, b = () => {
771
+ if (!n) return;
772
+ const r = y();
773
+ if (r.length === 0) {
774
+ n.innerHTML = `<div class="special-characters-no-results">No characters found for "${t}"</div>`;
775
+ return;
776
+ }
777
+ n.innerHTML = r.map((o) => `
778
+ <button class="special-characters-item" data-char="${o}" title="${k[o] || o}">
779
+ ${o}
780
+ </button>
781
+ `).join("");
782
+ }, g = () => {
783
+ c !== null && (window.clearTimeout(c), c = null), i.parentNode && i.parentNode.removeChild(i), v = !1, document.removeEventListener("keydown", x, !0);
784
+ }, x = (r) => {
785
+ r.key === "Escape" && (r.preventDefault(), r.stopPropagation(), g());
755
786
  };
756
- c.addEventListener("click", (o) => {
757
- o.target === c && l();
758
- }), document.addEventListener("keydown", b), d(), c.appendChild(s), document.body.appendChild(c);
759
- }, C = () => ({
787
+ u == null || u.addEventListener("click", g), l == null || l.addEventListener("click", (r) => {
788
+ const h = r.target.closest(".special-characters-tab");
789
+ if (!h) return;
790
+ const p = h.getAttribute("data-category");
791
+ !p || e === p || (e = p, f(), b());
792
+ }), d == null || d.addEventListener("input", (r) => {
793
+ t = r.target.value, c !== null && window.clearTimeout(c), c = window.setTimeout(() => {
794
+ c = null, b();
795
+ }, 90);
796
+ }), n == null || n.addEventListener("click", (r) => {
797
+ const h = r.target.closest(".special-characters-item");
798
+ if (!h) return;
799
+ const p = h.getAttribute("data-char");
800
+ p && (L(p), g());
801
+ }), i.addEventListener("click", (r) => {
802
+ r.target === i && g();
803
+ }), document.addEventListener("keydown", x, !0), f(), b(), i.appendChild(s), document.body.appendChild(i), requestAnimationFrame(() => d == null ? void 0 : d.focus());
804
+ }, q = () => ({
760
805
  name: "specialCharacters",
761
806
  toolbar: [{
762
807
  label: "Special Characters",
@@ -765,13 +810,13 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
765
810
  }],
766
811
  commands: {
767
812
  insertSpecialCharacter: (a, e) => {
768
- const r = (e == null ? void 0 : e.contentElement) instanceof HTMLElement ? e.contentElement : m();
769
- return k(r), !0;
813
+ const t = (e == null ? void 0 : e.contentElement) instanceof HTMLElement ? e.contentElement : w();
814
+ return S(t), !0;
770
815
  }
771
816
  },
772
817
  keymap: {}
773
818
  });
774
819
  export {
775
- C as SpecialCharactersPlugin
820
+ q as SpecialCharactersPlugin
776
821
  };
777
- //# sourceMappingURL=SpecialCharactersPlugin.native-DANrbExJ.mjs.map
822
+ //# sourceMappingURL=SpecialCharactersPlugin.native-CZDato89.mjs.map