@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
@@ -0,0 +1,32 @@
1
+ function c(e) {
2
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3
+ }
4
+ function a(e) {
5
+ if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
6
+ var n = e.default;
7
+ if (typeof n == "function") {
8
+ var t = function r() {
9
+ var o = !1;
10
+ try {
11
+ o = this instanceof r;
12
+ } catch (u) {
13
+ }
14
+ return o ? Reflect.construct(n, arguments, this.constructor) : n.apply(this, arguments);
15
+ };
16
+ t.prototype = n.prototype;
17
+ } else t = {};
18
+ return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
19
+ var o = Object.getOwnPropertyDescriptor(e, r);
20
+ Object.defineProperty(t, r, o.get ? o : {
21
+ enumerable: !0,
22
+ get: function() {
23
+ return e[r];
24
+ }
25
+ });
26
+ }), t;
27
+ }
28
+ export {
29
+ c as a,
30
+ a as g
31
+ };
32
+ //# sourceMappingURL=_commonjsHelpers-DOllISpa.mjs.map
@@ -0,0 +1,110 @@
1
+ const b = "p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre";
2
+ function p(e) {
3
+ return !!e.cloneContents().querySelector(b);
4
+ }
5
+ function v(e, n) {
6
+ var r, o;
7
+ const t = (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE ? e : (r = e == null ? void 0 : e.parentElement) != null ? r : null;
8
+ return (t == null ? void 0 : t.closest('[contenteditable="true"]')) || ((o = n()) == null ? void 0 : o.querySelector('[contenteditable="true"]')) || document.querySelector('[contenteditable="true"]');
9
+ }
10
+ function C(e, n) {
11
+ const t = v(e, n);
12
+ t && t.dispatchEvent(new Event("input", { bubbles: !0 }));
13
+ }
14
+ function A(e, n) {
15
+ let r = e.startContainer.nodeType === Node.TEXT_NODE ? e.startContainer.parentElement : e.startContainer;
16
+ for (; r && r !== document.body; ) {
17
+ if (r.classList.contains(n)) {
18
+ const o = document.createRange();
19
+ if (o.selectNodeContents(r), o.compareBoundaryPoints(Range.START_TO_START, e) <= 0 && o.compareBoundaryPoints(Range.END_TO_END, e) >= 0)
20
+ return r;
21
+ }
22
+ r = r.parentElement;
23
+ }
24
+ return null;
25
+ }
26
+ function N(e) {
27
+ try {
28
+ if (e.savedRange) {
29
+ const c = window.getSelection();
30
+ c && (c.removeAllRanges(), c.addRange(e.savedRange.cloneRange()));
31
+ }
32
+ const n = window.getSelection();
33
+ if (!n || n.rangeCount === 0 || n.isCollapsed)
34
+ return !1;
35
+ const t = n.getRangeAt(0);
36
+ if (t.collapsed)
37
+ return !1;
38
+ const r = A(t, e.className);
39
+ if (r)
40
+ return e.styleProperty === "backgroundColor" ? r.style.backgroundColor = e.color : r.style.color = e.color, C(r, e.getActiveEditorRoot), !0;
41
+ const o = v(
42
+ t.commonAncestorContainer,
43
+ e.getActiveEditorRoot
44
+ );
45
+ o == null || o.focus({ preventScroll: !0 });
46
+ try {
47
+ document.execCommand("styleWithCSS", !1, "true");
48
+ } catch (c) {
49
+ }
50
+ let l = !1;
51
+ if (e.commands.forEach((c) => {
52
+ l || (l = document.execCommand(c, !1, e.color));
53
+ }), !l && !p(t)) {
54
+ const c = document.createElement("span");
55
+ e.styleProperty === "backgroundColor" ? c.style.backgroundColor = e.color : c.style.color = e.color, c.className = e.className;
56
+ const a = t.extractContents();
57
+ c.appendChild(a), t.insertNode(c), t.setStartAfter(c), t.collapse(!0), n.removeAllRanges(), n.addRange(t), l = !0;
58
+ }
59
+ return l ? (C(t.commonAncestorContainer, e.getActiveEditorRoot), !0) : (e.warnMessage && console.warn(e.warnMessage), !1);
60
+ } catch (n) {
61
+ return e.warnMessage ? console.error(e.warnMessage, n) : console.error("[ColorApply] Failed to apply color", n), !1;
62
+ }
63
+ }
64
+ function T({
65
+ popover: e,
66
+ anchor: n,
67
+ onClose: t,
68
+ gap: r = 6,
69
+ margin: o = 8,
70
+ zIndex: l = 1e4
71
+ }) {
72
+ e.style.position = "fixed", e.style.zIndex = `${l}`, e.style.visibility = "hidden";
73
+ const c = () => {
74
+ if (!e.isConnected || !n.isConnected) {
75
+ t();
76
+ return;
77
+ }
78
+ const s = n.getBoundingClientRect();
79
+ if (s.width === 0 && s.height === 0) {
80
+ t();
81
+ return;
82
+ }
83
+ const i = e.getBoundingClientRect(), w = i.width || e.offsetWidth || 220, f = i.height || e.offsetHeight || 260, y = window.innerWidth, E = window.innerHeight;
84
+ let u = s.left, d = s.bottom + r;
85
+ if (u + w > y - o && (u = y - w - o), u = Math.max(o, u), d + f > E - o) {
86
+ const g = s.top - f - r;
87
+ g >= o ? d = g : d = Math.max(o, E - f - o);
88
+ }
89
+ d < o && (d = o), e.style.left = `${Math.round(u)}px`, e.style.top = `${Math.round(d)}px`, e.style.visibility = "visible";
90
+ }, a = () => {
91
+ c();
92
+ }, h = (s) => {
93
+ const i = s.target;
94
+ i && (e.contains(i) || n.contains(i) || t());
95
+ }, m = (s) => {
96
+ s.key === "Escape" && t();
97
+ };
98
+ window.addEventListener("resize", a), window.addEventListener("scroll", a, !0), document.addEventListener("keydown", m);
99
+ const R = window.requestAnimationFrame(() => {
100
+ document.addEventListener("mousedown", h, !0);
101
+ });
102
+ return c(), { reposition: c, destroy: () => {
103
+ window.cancelAnimationFrame(R), window.removeEventListener("resize", a), window.removeEventListener("scroll", a, !0), document.removeEventListener("keydown", m), document.removeEventListener("mousedown", h, !0);
104
+ } };
105
+ }
106
+ export {
107
+ N as a,
108
+ T as b
109
+ };
110
+ //# sourceMappingURL=anchoredPopover-Bxds0VoB.mjs.map